diff --git a/dirs/mainsail/.version b/dirs/mainsail/.version deleted file mode 100644 index 899ab6b..0000000 --- a/dirs/mainsail/.version +++ /dev/null @@ -1 +0,0 @@ -v2.9.1 \ No newline at end of file diff --git a/dirs/mainsail/assets/Codemirror-d2702935.js b/dirs/mainsail/assets/Codemirror-d2702935.js deleted file mode 100644 index 6ad607f..0000000 --- a/dirs/mainsail/assets/Codemirror-d2702935.js +++ /dev/null @@ -1 +0,0 @@ -import{m as w,W as E,B as H,P as d,j as B,n as F}from"./index-97b4652c.js";import{E as f,H as Z,s as O,t as n,a as P,b as $,i as D,k as T,c as A,S as J,j as L,d as q}from"./codemirror-0a1db0c7.js";import"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";function k(){return k=Object.assign?Object.assign.bind():function(i){for(var e=1;e{var{theme:e,settings:r={},styles:t=[]}=i,o={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),(r.background||r.foreground)&&(o["&"]=a),r.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(o[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(o[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(o[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(o[".cm-content"]={caretColor:r.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var s={};r.gutterActiveForeground&&(s.color=r.gutterActiveForeground),r.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:r.lineHighlight},s.backgroundColor=r.lineHighlight),o[".cm-activeLineGutter"]=s,r.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var g=f.theme(o,{dark:e==="dark"}),h=Z.define(t),m=[g,O(h)];return m},W={background:"#1e1e1e",foreground:"#9cdcfe",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'};function R(i){var{theme:e="dark",settings:r={},styles:t=[]}=i||{};return I({theme:e,settings:k({},W,r),styles:[{tag:[n.keyword,n.operatorKeyword,n.modifier,n.color,n.constant(n.name),n.standard(n.name),n.standard(n.tagName),n.special(n.brace),n.atom,n.bool,n.special(n.variableName)],color:"#569cd6"},{tag:[n.controlKeyword,n.moduleKeyword],color:"#c586c0"},{tag:[n.name,n.deleted,n.character,n.macroName,n.propertyName,n.variableName,n.labelName,n.definition(n.name)],color:"#9cdcfe"},{tag:n.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[n.typeName,n.className,n.tagName,n.number,n.changed,n.annotation,n.self,n.namespace],color:"#4ec9b0"},{tag:[n.function(n.variableName),n.function(n.propertyName)],color:"#dcdcaa"},{tag:[n.number],color:"#b5cea8"},{tag:[n.operator,n.punctuation,n.separator,n.url,n.escape,n.regexp],color:"#d4d4d4"},{tag:[n.regexp],color:"#d16969"},{tag:[n.special(n.string),n.processingInstruction,n.string,n.inserted],color:"#ce9178"},{tag:[n.angleBracket],color:"#808080"},{tag:n.strong,fontWeight:"bold"},{tag:n.emphasis,fontStyle:"italic"},{tag:n.strikethrough,textDecoration:"line-through"},{tag:[n.meta,n.comment],color:"#6a9955"},{tag:n.link,color:"#6a9955",textDecoration:"underline"},{tag:n.invalid,color:"#ff0000"},...t]})}var K=R();const b={token:function(i,e,r=0){const t=i.peek();if(i.pos===r&&e.klipperMacro&&(e.klipperMacro=!1),i.pos>r&&e.klipperMacro){if(i.eatSpace(),i.match(/^{/))return"tag";if(i.match(/^"[^{]+"/)||i.match(/^'[^{]+'/))return"string";if(i.match(/^[-+]?[0-9]*\.?[0-9]+/))return"number";if(i.match(/^[A-Za-z\d_]+/))return"propertyName";if(r===0&&i.match(/^{[^%]+}/))return"variable"}if([";"].includes(t!=null?t:""))return i.skipToEnd(),"comment";const o=i.pos==r;return o&&i.match(/_?[GMgm][\d.]+/)?"namespace":i.string.substring(r).toLowerCase().startsWith("m117")?(i.skipToEnd(),"string"):i.pos>r&&i.match(/[EPXYZIJ]-?([\d]*\.[\d]+|[\d]+)?/i)?"className":i.pos>r&&i.match(/[Ff]-?([\d]*\.[\d]+|[\d]+)?/)?"string":i.pos>r&&i.match(/[TtSs]-?([\d]*\.[\d]+|[\d]+)?/)?"atom":r===0&&i.pos>r&&i.match(/^{[^%]+}/)?"propertyName":o&&i.match(/^\s*[A-Z_\d]+/)?(e.klipperMacro=!0,"name"):(i.next(),null)},startState:function(){return{klipperMacro:!1}},languageData:{commentTokens:{line:";"}}},V={token:function(i,e){var j,x;const r=["\\+","-","\\/\\/","\\/","%","\\*\\*","\\*","\\(","\\)","==","!=",">=",">","<=","<","=","\\|","~",","],t=new RegExp("^"+r.join("|")),o=["elif","else","endif","if","endfor","for","loop\\.index","loop\\.revindex","loop\\.first","loop\\.last","loop\\.length","loop\\.cycle","loop\\.depth","and","or","not","in","is","endmacro","macro","endcall","call","endfilter","filter","endset","set","extends","block","endblock","include","import","do"],a=["abs","attr","batch","capitalize","center","default","dictsort","escape","filesizeformat","first","float","forceescape","format","groupby","indent","int","join","last","length","list","lower","map","max","min","pprint","random","reject","rejectattr","replace","reverse","round","tojson","safe","select","selectattr","slice","sort","string","striptags","sum","title","trim","truncate","unique","upper","urlencode","urlize","wordcount","wordwrap","xmlattr"],s=["callable","defined","divisibleby","equalto","escaped","even","iterable","lower","mapping","none","number","odd","sameas","sequence","string","undefined","upper"],g=["range","lipsum","dict","cycler","joiner"],h=["\\.reset\\(\\)","\\.next\\(\\)"],m=new RegExp("^"+o.join("\\s+|")+"|"+h.join("|")+"\\s+"),C=new RegExp("^"+a.join("|")+"|"+s.join("|")+"|"+g.join("|")+"\\s+");function v(c){var S;const y=c.match(/^%}/),_=c.match(/^}/);function M(){return e.klipperMacroJinjaBraceStack.length===0&&e.klipperMacroJinjaPctStack.length===0}return y||_?(y?(e.klipperMacroJinjaPctStack.pop(),M()&&(e.klipperMacroJinja=!1)):(e.klipperMacroJinjaBraceStack.pop(),M()&&(e.klipperMacroJinja=!1)),c.eatSpace(),e.gcodeZeroPos=c.pos,"tag"):c.match(new RegExp("^((?{for(var o=t>1?void 0:t?U(e,r):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(o=(t?s(e,r,o):s(o))||o);return t&&o&&G(e,r,o),o};let u=class extends w(H){constructor(){super(...arguments),this.content="",this.codemirror=null,this.cminstance=null}valueChanged(e){var t,o;const r=(o=(t=this.cminstance)==null?void 0:t.state)==null?void 0:o.doc.toString();e!==r&&this.setCmValue(e)}mounted(){this.initialize()}beforeDestroy(){this.destroy()}destroy(){var e;(e=this.cminstance)==null||e.destroy()}initialize(){this.codemirror=new f({parent:this.$refs.codemirror}),this.cminstance=this.codemirror,this.$nextTick(()=>{this.setCmValue(this.code||this.value||this.content),this.$emit("ready",this.codemirror)})}setCmValue(e){var r;(r=this.cminstance)==null||r.setState(P.create({doc:e,extensions:this.cmExtensions}))}get cmExtensions(){const e=[f.theme({},{dark:!0}),$,K,D.of(" ".repeat(this.tabSize)),T.of([A]),f.updateListener.of(r=>{var t;this.content=(t=r.state)==null?void 0:t.doc.toString(),this.$emit&&this.$emit("input",this.content)})];return["cfg","conf"].includes(this.fileExtension)?e.push(J.define(V)):["gcode"].includes(this.fileExtension)?e.push(J.define(b)):["json"].includes(this.fileExtension)?e.push(L()):["css","scss","sass"].includes(this.fileExtension)&&e.push(q()),e}visibilityChanged(e){var r;e&&((r=this.cminstance)==null||r.focus())}get tabSize(){return this.$store.state.gui.editor.tabSize||2}};p([d({required:!1,default:""})],u.prototype,"code",2);p([d({required:!1,default:""})],u.prototype,"value",2);p([d({required:!1,default:"codemirror"})],u.prototype,"name",2);p([d({required:!1,default:""})],u.prototype,"fileExtension",2);p([E("value")],u.prototype,"valueChanged",1);u=p([B],u);var z=function(){var i=this,e=i.$createElement,r=i._self._c||e;return r("div",{staticClass:"vue-codemirror"},[r("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:i.visibilityChanged,expression:"visibilityChanged"}],ref:"codemirror"})])},X=[];const N={};var Y=F(u,z,X,!1,Q,null,null,null);function Q(i){for(let e in N)this[e]=N[e]}const ce=function(){return Y.exports}();export{ce as default}; diff --git a/dirs/mainsail/assets/Heightmap-0ea0fb44.css b/dirs/mainsail/assets/Heightmap-0ea0fb44.css deleted file mode 100644 index ce58fff..0000000 --- a/dirs/mainsail/assets/Heightmap-0ea0fb44.css +++ /dev/null @@ -1 +0,0 @@ -.rename-profile[data-v-37c48ba8]{text-transform:none}.currentMeshName[data-v-37c48ba8]{cursor:pointer;color:var(--v-primary-base)}.currentMeshName .v-icon[data-v-37c48ba8]{opacity:0}.currentMeshName:hover .v-icon[data-v-37c48ba8]{opacity:1}.rowProfile .colActions[data-v-37c48ba8]{display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.rowProfile .colName[data-v-37c48ba8],.rowProfile .colVariance[data-v-37c48ba8]{line-height:48px}.rowProfile .colName span.current[data-v-37c48ba8]{font-weight:700;color:var(--v-primary-base)}.rowProfile .colActions .v-btn[data-v-37c48ba8]{height:48px;width:48px} diff --git a/dirs/mainsail/assets/Heightmap-7418030f.js b/dirs/mainsail/assets/Heightmap-7418030f.js deleted file mode 100644 index 5d15a7a..0000000 --- a/dirs/mainsail/assets/Heightmap-7418030f.js +++ /dev/null @@ -1 +0,0 @@ -import{m as us,B as fs,C as ds,T as vs,a as ms,b as ps,c as _s,d as gs,e as ys,f as xs,g as Ts,h as Es,i as As,W as Ss,j as bs,_ as St,n as ws}from"./index-97b4652c.js";import{j as mr,m as dn,A as Cs,L as Rs,p as ua,R as fa,k as Ms,r as Ns,l as pr,n as Ls,o as Ps,q as Ds,s as Is,Z as Os,C as da,v as _t,w as Ar,x as Bs,y as Fs,M as Us,z as Oi,B as Bi,D as Hs,E as va,F as ma,G as pa,H as _a,I as zs,J as Gs,K as ks,O as Vs,N as Ws,P as Xs,Q as wr,S as vn,T as js,U as Ys,V as qs,W as Zs,X as $s,Y as Ks,_ as Qs,$ as Js,a0 as Cr,a1 as eo,u as to,a2 as ro,a3 as io}from"./echarts-9bc570b0.js";import{l as it,m as Me,f as Te,c as ht,i as nt,A as no,M as ao,E as Rr,w as kt,z as so,q as oo,F as lo,h as Mr,n as mn,o as Nr,d as Lr}from"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";function pn(e,t,r){typeof t=="object"&&(r=t,t=null);var i=this,n;if(!(e instanceof Function)){n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(a)}var s=function(l){if(i.apply(this,arguments),e instanceof Function?_n(this,e.call(this,l)):co(this,e,n),this.constructor===s)for(var c=s.__initializers__,h=0;h=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}const yo={get:go};var fi,Xe={};Xe.supportWebGL=function(){if(fi==null)try{var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)throw new Error}catch{fi=!1}return fi};Xe.Int8Array=typeof Int8Array>"u"?Array:Int8Array;Xe.Uint8Array=typeof Uint8Array>"u"?Array:Uint8Array;Xe.Uint16Array=typeof Uint16Array>"u"?Array:Uint16Array;Xe.Uint32Array=typeof Uint32Array>"u"?Array:Uint32Array;Xe.Int16Array=typeof Int16Array>"u"?Array:Int16Array;Xe.Float32Array=typeof Float32Array>"u"?Array:Float32Array;Xe.Float64Array=typeof Float64Array>"u"?Array:Float64Array;var Ot={};typeof window<"u"?Ot=window:typeof global<"u"&&(Ot=global);Xe.requestAnimationFrame=Ot.requestAnimationFrame||Ot.msRequestAnimationFrame||Ot.mozRequestAnimationFrame||Ot.webkitRequestAnimationFrame||function(e){setTimeout(e,16)};Xe.createCanvas=function(){return document.createElement("canvas")};Xe.createImage=function(){return new Ot.Image};Xe.request={get:yo.get};Xe.addEventListener=function(e,t,r,i){e.addEventListener(t,r,i)};Xe.removeEventListener=function(e,t,r){e.removeEventListener(t,r)};const be=Xe;var Le=function(){this.head=null,this.tail=null,this._length=0};Le.prototype.insert=function(e){var t=new Le.Entry(e);return this.insertEntry(t),t};Le.prototype.insertAt=function(e,t){if(!(e<0)){for(var r=this.head,i=0;r&&i!=e;)r=r.next,i++;if(r){var n=new Le.Entry(t),a=r.prev;a?(a.next=n,n.prev=a):this.head=n,n.next=r,r.prev=n}else this.insert(t)}};Le.prototype.insertBeforeEntry=function(e,t){var r=new Le.Entry(e),i=t.prev;i?(i.next=r,r.prev=i):this.head=r,r.next=t,t.prev=r,this._length++};Le.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++};Le.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._length--};Le.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;if(t)return this.remove(t),t.value}};Le.prototype.getHead=function(){if(this.head)return this.head.value};Le.prototype.getTail=function(){if(this.tail)return this.tail.value};Le.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;return t.value}};Le.prototype.indexOf=function(e){for(var t=this.head,r=0;t;){if(t.value===e)return r;t=t.next,r++}};Le.prototype.length=function(){return this._length};Le.prototype.isEmpty=function(){return this._length===0};Le.prototype.forEach=function(e,t){for(var r=this.head,i=0,n=typeof t<"u";r;)n?e.call(t,r.value,i):e(r.value,i),r=r.next,i++};Le.prototype.clear=function(){this.tail=this.head=null,this._length=0};Le.Entry=function(e){this.value=e,this.next=null,this.prev=null};const xo=Le;var ir=function(e){this._list=new xo,this._map={},this._maxSize=e||10};ir.prototype.setMaxSize=function(e){this._maxSize=e};ir.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var r=this._list.length();if(r>=this._maxSize&&r>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var n=this._list.insert(t);n.key=e,this._map[e]=n}};ir.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value};ir.prototype.remove=function(e){var t=this._map[e];typeof t<"u"&&(delete this._map[e],this._list.remove(t))};ir.prototype.clear=function(){this._list.clear(),this._map={}};const ga=ir;var pe={},xn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ot(e){return e=Math.round(e),e<0?0:e>255?255:e}function To(e){return e=Math.round(e),e<0?0:e>360?360:e}function _r(e){return e<0?0:e>1?1:e}function di(e){return e.length&&e.charAt(e.length-1)==="%"?ot(parseFloat(e)/100*255):ot(parseInt(e,10))}function Jt(e){return e.length&&e.charAt(e.length-1)==="%"?_r(parseFloat(e)/100):_r(parseFloat(e))}function vi(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function bt(e,t,r){return e+(t-e)*r}function st(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function Fi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var ya=new ga(20),Pr=null;function Vt(e,t){Pr&&Fi(Pr,t),Pr=ya.put(e,Pr||t.slice())}pe.parse=function(e,t){if(e){t=t||[];var r=ya.get(e);if(r)return Fi(t,r);e=e+"";var i=e.replace(/ /g,"").toLowerCase();if(i in xn)return Fi(t,xn[i]),Vt(e,t),t;if(i.charAt(0)==="#"){if(i.length===4){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=4095)){st(t,0,0,0,1);return}return st(t,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,1),Vt(e,t),t}else if(i.length===7){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=16777215)){st(t,0,0,0,1);return}return st(t,(n&16711680)>>16,(n&65280)>>8,n&255,1),Vt(e,t),t}return}var a=i.indexOf("("),s=i.indexOf(")");if(a!==-1&&s+1===i.length){var o=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),c=1;switch(o){case"rgba":if(l.length!==4){st(t,0,0,0,1);return}c=Jt(l.pop());case"rgb":if(l.length!==3){st(t,0,0,0,1);return}return st(t,di(l[0]),di(l[1]),di(l[2]),c),Vt(e,t),t;case"hsla":if(l.length!==4){st(t,0,0,0,1);return}return l[3]=Jt(l[3]),Ui(l,t),Vt(e,t),t;case"hsl":if(l.length!==3){st(t,0,0,0,1);return}return Ui(l,t),Vt(e,t),t;default:return}}st(t,0,0,0,1)}};pe.parseToFloat=function(e,t){if(t=pe.parse(e,t),!!t)return t[0]/=255,t[1]/=255,t[2]/=255,t};function Ui(e,t){var r=(parseFloat(e[0])%360+360)%360/360,i=Jt(e[1]),n=Jt(e[2]),a=n<=.5?n*(i+1):n+i-n*i,s=n*2-a;return t=t||[],st(t,ot(vi(s,a,r+1/3)*255),ot(vi(s,a,r)*255),ot(vi(s,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Eo(e){if(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,n=Math.min(t,r,i),a=Math.max(t,r,i),s=a-n,o=(a+n)/2,l,c;if(s===0)l=0,c=0;else{o<.5?c=s/(a+n):c=s/(2-a-n);var h=((a-t)/6+s/2)/s,u=((a-r)/6+s/2)/s,d=((a-i)/6+s/2)/s;t===a?l=d-u:r===a?l=1/3+h-d:i===a&&(l=2/3+u-h),l<0&&(l+=1),l>1&&(l-=1)}var f=[l*360,c,o];return e[3]!=null&&f.push(e[3]),f}}pe.lift=function(e,t){var r=pe.parse(e);if(r){for(var i=0;i<3;i++)t<0?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return pe.stringify(r,r.length===4?"rgba":"rgb")}};pe.toHex=function(e){var t=pe.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)};pe.fastLerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),s=t[n],o=t[a],l=i-n;return r[0]=ot(bt(s[0],o[0],l)),r[1]=ot(bt(s[1],o[1],l)),r[2]=ot(bt(s[2],o[2],l)),r[3]=_r(bt(s[3],o[3],l)),r}};pe.fastMapToColor=pe.fastLerp;pe.lerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),s=pe.parse(t[n]),o=pe.parse(t[a]),l=i-n,c=pe.stringify([ot(bt(s[0],o[0],l)),ot(bt(s[1],o[1],l)),ot(bt(s[2],o[2],l)),_r(bt(s[3],o[3],l))],"rgba");return r?{color:c,leftIndex:n,rightIndex:a,value:i}:c}};pe.mapToColor=pe.lerp;pe.modifyHSL=function(e,t,r,i){if(e=pe.parse(e),e)return e=Eo(e),t!=null&&(e[0]=To(t)),r!=null&&(e[1]=Jt(r)),i!=null&&(e[2]=Jt(i)),pe.stringify(Ui(e),"rgba")};pe.modifyAlpha=function(e,t){if(e=pe.parse(e),e&&t!=null)return e[3]=_r(t),pe.stringify(e,"rgba")};pe.stringify=function(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}};const Ao=pe;var So=Ao.parseToFloat,mi={};function Tn(e){var t=Object.keys(e);t.sort();for(var r=[],i=0;i=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if(typeof e=="object")for(var r in e){var i=e[r];this.setUniform(r,i)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var r=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(c){var h=this.uniforms[c].type;return h==="t"||h==="tv"},this);var n=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=De.clone(e.vertexDefines),this.fragmentDefines=De.clone(e.fragmentDefines),t){for(var s in r)i[s]&&(i[s].value=r[s].value);De.defaults(this.vertexDefines,n),De.defaults(this.fragmentDefines,a)}var o={};for(var l in e.textures)o[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:t&&this._textureStatus[l]?this._textureStatus[l].enabled:!1};this._textureStatus=o,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=De.clone(this.vertexDefines),e.fragmentDefines=De.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,r){var i=this.vertexDefines,n=this.fragmentDefines;e!=="vertex"&&e!=="fragment"&&e!=="both"&&arguments.length<3&&(r=t,t=e,e="both"),r=r!=null?r:null,(e==="vertex"||e==="both")&&i[t]!==r&&(i[t]=r,this._programKey=""),(e==="fragment"||e==="both")&&n[t]!==r&&(n[t]=r,e!=="both"&&(this._programKey=""))},undefine:function(e,t){e!=="vertex"&&e!=="fragment"&&e!=="both"&&arguments.length<2&&(t=e,e="both"),(e==="vertex"||e==="both")&&this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),(e==="fragment"||e==="both")&&this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],e!=="both"&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return this.vertexDefines[t]!==void 0;case"fragment":return this.fragmentDefines[t]!==void 0}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e)){for(var t=0;t0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n),e};$.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]};$.cross=function(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e};$.lerp=function(e,t,r,i){var n=t[0],a=t[1];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e};$.random=function(e,t){t=t||1;var r=GLMAT_RANDOM()*2*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e};$.transformMat2=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e};$.transformMat2d=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e};$.transformMat3=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e};$.transformMat4=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e};$.forEach=function(){var e=$.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o0&&i.push("#define "+n.toUpperCase()+"_COUNT "+a)}if(r)for(var s=0;sl.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),u+="\n"+_i(d)+"\n"}a&&(u+="\n#define INSTANCING\n");var f=u+_i(t.vertexDefines,o,h),v=u+_i(t.fragmentDefines,o,h),m=f+"\n"+t.shader.vertex,p=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(S){return l.getGLExtension(S)!=null});p.indexOf("EXT_shader_texture_lod")>=0&&(v+="\n#define SUPPORT_TEXTURE_LOD"),p.indexOf("OES_standard_derivatives")>=0&&(v+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _=Lo(p)+"\n"+Po(t.precision)+"\n"+v+"\n"+t.shader.fragment,T=Rn(m,t.vertexDefines,o),y=Rn(_,t.fragmentDefines,o),g=new Mo;g.uniformSemantics=t.shader.uniformSemantics,g.attributes=t.shader.attributes;var E=g.buildProgram(c,t.shader,T,y);return g.__error=E,i[s]=g,g};var Mn=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,Do=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,Nn=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,Io={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function mt(e){for(var t=[],r=0;r=0){if(d!==o&&d!==h){Wt();break}d=l,v=[];continue}else if(d===o){e==="bool"?f[m].value=_==="true":f[m].value=parseFloat(_),v=null;continue}else if(d===h){var T=_;Hi.indexOf(T)>=0||Ta.indexOf(T)>=0||Ea.indexOf(T)>=0?f[m].semantic=T:T==="ignore"||T==="unconfigurable"?f[m].ignore=!0:e==="bool"?f[m].value=T==="true":f[m].value=parseFloat(T);continue}p(_),d=s}}return f}function N(e,t){typeof e=="object"&&(t=e.fragment,e=e.vertex),e=Pn(e),t=Pn(t),this._shaderID=Bo(e,t),this._vertexCode=N.parseImport(e),this._fragmentCode=N.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}N.prototype={constructor:N,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var r=this.uniformTemplates[t];e[t]={type:r.type,value:r.value()}}return e},_parseImport:function(){this._vertexCode=N.parseImport(this.vertex),this._fragmentCode=N.parseImport(this.fragment)},_addSemanticUniform:function(e,t,r){if(Hi.indexOf(r)>=0)this.attributeSemantics[r]={symbol:e,type:t};else if(Ea.indexOf(r)>=0){var i=!1,n=r;r.match(/TRANSPOSE$/)&&(i=!0,n=r.slice(0,-9)),this.matrixSemantics[r]={symbol:e,type:t,isTranspose:i,semanticNoTranspose:n}}else Ta.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:e,type:t})},_addMaterialUniform:function(e,t,r,i,n,a){a[e]={type:r,value:n?Ln.array:i||Ln[t],semantic:null}},_parseUniforms:function(){var e={},t=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(Mn,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(Mn,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics);function i(a){return a!=null?function(){return a}:null}function n(a,s,o){var l=Dn(s,o),c=[];for(var h in l){var u=l[h],d=u.semantic,f=h,v=Io[s],m=i(l[h].value);l[h].isArray&&(f+="["+l[h].arraySize+"]",v+="v"),c.push(f),t._uniformList.push(h),u.ignore||((s==="sampler2D"||s==="samplerCube")&&(t.textures[h]={shaderType:r,type:s}),d?t._addSemanticUniform(h,v,d):t._addMaterialUniform(h,s,v,m,l[h].isArray,e))}return c.length>0?"uniform "+s+" "+c.join(",")+";\n":""}this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(Do,r);function r(i,n,a){var s=Dn(n,a),o=Oo[n]||1,l=[];for(var c in s){var h=s[c].semantic;if(e[c]={type:"float",size:o,semantic:h||null},h){if(Hi.indexOf(h)<0)throw new Error('Unkown semantic "'+h+'"');t.attributeSemantics[h]={symbol:c,type:n}}l.push(c)}return"attribute "+n+" "+l.join(",")+";\n"}this.attributes=e},_parseDefines:function(){var e=this,t="vertex";this._vertexCode=this._vertexCode.replace(Nn,r),t="fragment",this._fragmentCode=this._fragmentCode.replace(Nn,r);function r(i,n,a){var s=t==="vertex"?e.vertexDefines:e.fragmentDefines;return s[n]||(a==="false"?s[n]=!1:a==="true"?s[n]=!0:s[n]=a?isNaN(parseFloat(a))?a.trim():parseFloat(a):null),""}},clone:function(){var e=Aa[this._shaderID],t=new N(e.vertex,e.fragment);return t}};Object.defineProperty&&(Object.defineProperty(N.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(N.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(N.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(N.prototype,"uniforms",{get:function(){return this._uniformList}}));var Fo=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;N.parseImport=function(e){return e=e.replace(Fo,function(n,r,i){var n=N.source(i);return n?N.parseImport(n):(console.error('Shader chunk "'+i+'" not existed in library'),"")}),e};var Uo=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;N.import=function(e){e.replace(Uo,function(t,r,i,a){var a=a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(a){for(var s=i.split("."),o=N.codes,l=0,c;l0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e};X.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]};X.cross=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=n*l-a*o,e[1]=a*s-i*l,e[2]=i*o-n*s,e};X.lerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e};X.random=function(e,t){t=t||1;var r=Kt()*2*Math.PI,i=Kt()*2-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e};X.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[3]*i+r[7]*n+r[11]*a+r[15];return s=s||1,e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/s,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/s,e};X.transformMat3=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e};X.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],c=r[3],h=c*i+o*a-l*n,u=c*n+l*i-s*a,d=c*a+s*n-o*i,f=-s*i-o*n-l*a;return e[0]=h*c+f*-s+u*-l-d*-o,e[1]=u*c+f*-o+d*-s-h*-l,e[2]=d*c+f*-l+h*-o-u*-s,e};X.rotateX=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};X.rotateY=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};X.rotateZ=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};X.forEach=function(){var e=X.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o1?0:Math.acos(n)};const x=X;N.import(Sa);var de=C.create,In={};function On(e){return e.material}function Ho(e,t,r){return t.uniforms[r].value}function zo(e,t,r,i){return r!==i}function Go(e){return!0}function Bn(){}var Fn={float:A.FLOAT,byte:A.BYTE,ubyte:A.UNSIGNED_BYTE,short:A.SHORT,ushort:A.UNSIGNED_SHORT};function ko(e,t,r){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=r,this.vao=null}function Vo(e){var t,r;this.bind=function(i){t||(t=be.createCanvas(),t.width=t.height=1,t.getContext("2d"));var n=i.gl,a=!r;a&&(r=n.createTexture()),n.bindTexture(n.TEXTURE_2D,r),a&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)},this.unbind=function(i){i.gl.bindTexture(i.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var wt=qe.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=be.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new _o(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(r){throw"Error creating WebGL Context "+r}this._programMgr=new xa(this),this._placeholderTexture=new Vo},{resize:function(e,t){var r=this.canvas,i=this.devicePixelRatio;e!=null?(r.style&&(r.style.width=e+"px",r.style.height=t+"px"),r.width=e*i,r.height=t*i,this._width=e,this._height=t):(this._width=r.width/i,this._height=r.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,r,i,n){if(typeof e=="object"){var a=e;e=a.x,t=a.y,r=a.width,i=a.height,n=a.devicePixelRatio}n=n||this.devicePixelRatio,this.gl.viewport(e*n,t*n,r*n,i*n),this.viewport={x:e,y:t,width:r,height:i,devicePixelRatio:n}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,r,i){var n=this.gl,a=this.clearColor;if(this.clearBit){n.colorMask(!0,!0,!0,!0),n.depthMask(!0);var s=this.viewport,o=!1,l=s.devicePixelRatio;(s.width!==this._width||s.height!==this._height||l&&l!==this.devicePixelRatio||s.x||s.y)&&(o=!0,n.enable(n.SCISSOR_TEST),n.scissor(s.x*l,s.y*l,s.width*l,s.height*l)),n.clearColor(a[0],a[1],a[2],a[3]),n.clear(this.clearBit),o&&n.disable(n.SCISSOR_TEST)}if(r||e.update(!1),e.updateLights(),t=t||e.getMainCamera(),!t){console.error("Can't find camera in the scene.");return}t.update();var c=e.updateRenderList(t,!0);this._sceneRendering=e;var h=c.opaque,u=c.transparent,d=e.material;e.trigger("beforerender",this,e,t,c),i?(this.renderPreZ(h,e,t),n.depthFunc(n.LEQUAL)):n.depthFunc(n.LESS);for(var f=de(),v=x.create(),m=0;m0){var o=e[n-1],l=o.joints?o.joints.length:0,c=a.joints?a.joints.length:0;if(c===l&&a.material===o.material&&a.lightGroup===o.lightGroup){a.__program=o.__program;continue}}var h=this._programMgr.getProgram(a,s,t);this.validateProgram(h),a.__program=h}},renderPass:function(e,t,r){this.trigger("beforerenderpass",this,e,t,r),r=r||{},r.getMaterial=r.getMaterial||On,r.getUniform=r.getUniform||Ho,r.isMaterialChanged=r.isMaterialChanged||zo,r.beforeRender=r.beforeRender||Bn,r.afterRender=r.afterRender||Bn;var i=r.ifRender||Go;this.updatePrograms(e,this._sceneRendering,r),r.sortCompare&&e.sort(r.sortCompare);var n=this.viewport,a=n.devicePixelRatio,s=[n.x*a,n.y*a,n.width*a,n.height*a],o=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*o,this._height*o],c=[s[2],s[3]],h=Date.now();t?(C.copy(fe.VIEW,t.viewMatrix.array),C.copy(fe.PROJECTION,t.projectionMatrix.array),C.copy(fe.VIEWINVERSE,t.worldTransform.array)):(C.identity(fe.VIEW),C.identity(fe.PROJECTION),C.identity(fe.VIEWINVERSE)),C.multiply(fe.VIEWPROJECTION,fe.PROJECTION,fe.VIEW),C.invert(fe.PROJECTIONINVERSE,fe.PROJECTION),C.invert(fe.VIEWPROJECTIONINVERSE,fe.VIEWPROJECTION);for(var u=this.gl,d=this._sceneRendering,f,v,m,p,_,T,y,g,E,S,R,b,M=null,F=0;Fthis.getMaxJointNumber()){var a=n.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,r),t.setUniform(i,"1i","skinMatricesTexture",r),t.setUniform(i,"1f","skinMatricesTextureSize",a.width)}else{var s=n.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(i,"SKIN_MATRIX",s)}},_renderObject:function(e,t,r){var i=this.gl,n=e.geometry,a=e.mode;a==null&&(a=4);var s=null,o=e.isInstancedMesh&&e.isInstancedMesh();if(o&&(s=this.getGLExtension("ANGLE_instanced_arrays"),!s)){console.warn("Device not support ANGLE_instanced_arrays extension");return}var l;if(o&&(l=this._bindInstancedAttributes(e,r,s)),t.indicesBuffer){var c=this.getGLExtension("OES_element_index_uint"),h=c&&n.indices instanceof Uint32Array,u=h?i.UNSIGNED_INT:i.UNSIGNED_SHORT;o?s.drawElementsInstancedANGLE(a,t.indicesBuffer.count,u,0,e.getInstanceCount()):i.drawElements(a,t.indicesBuffer.count,u,0)}else o?s.drawArraysInstancedANGLE(a,0,n.vertexCount,e.getInstanceCount()):i.drawArrays(a,0,n.vertexCount);if(o)for(var d=0;dr?r:e}var oe=Math.atan2,et=Math.asin,Xt=Math.abs;W.eulerFromQuat=function(e,t,d){e._dirty=!0,t=t.array;var i=e.array,n=t[0],a=t[1],s=t[2],o=t[3],l=n*n,c=a*a,h=s*s,u=o*o,d=(d||"XYZ").toUpperCase();switch(d){case"XYZ":i[0]=oe(2*(n*o-a*s),u-l-c+h),i[1]=et(Je(2*(n*s+a*o),-1,1)),i[2]=oe(2*(s*o-n*a),u+l-c-h);break;case"YXZ":i[0]=et(Je(2*(n*o-a*s),-1,1)),i[1]=oe(2*(n*s+a*o),u-l-c+h),i[2]=oe(2*(n*a+s*o),u-l+c-h);break;case"ZXY":i[0]=et(Je(2*(n*o+a*s),-1,1)),i[1]=oe(2*(a*o-s*n),u-l-c+h),i[2]=oe(2*(s*o-n*a),u-l+c-h);break;case"ZYX":i[0]=oe(2*(n*o+s*a),u-l-c+h),i[1]=et(Je(2*(a*o-n*s),-1,1)),i[2]=oe(2*(n*a+s*o),u+l-c-h);break;case"YZX":i[0]=oe(2*(n*o-s*a),u-l+c-h),i[1]=oe(2*(a*o-n*s),u+l-c-h),i[2]=et(Je(2*(n*a+s*o),-1,1));break;case"XZY":i[0]=oe(2*(n*o+a*s),u-l+c-h),i[1]=oe(2*(n*s+a*o),u+l-c-h),i[2]=et(Je(2*(s*o-n*a),-1,1));break;default:console.warn("Unkown order: "+d)}return e};W.eulerFromMat3=function(e,t,v){var i=t.array,n=i[0],a=i[3],s=i[6],o=i[1],l=i[4],c=i[7],h=i[2],u=i[5],d=i[8],f=e.array,v=(v||"XYZ").toUpperCase();switch(v){case"XYZ":f[1]=et(Je(s,-1,1)),Xt(s)<.99999?(f[0]=oe(-c,d),f[2]=oe(-a,n)):(f[0]=oe(u,l),f[2]=0);break;case"YXZ":f[0]=et(-Je(c,-1,1)),Xt(c)<.99999?(f[1]=oe(s,d),f[2]=oe(o,l)):(f[1]=oe(-h,n),f[2]=0);break;case"ZXY":f[0]=et(Je(u,-1,1)),Xt(u)<.99999?(f[1]=oe(-h,d),f[2]=oe(-a,l)):(f[1]=0,f[2]=oe(o,n));break;case"ZYX":f[1]=et(-Je(h,-1,1)),Xt(h)<.99999?(f[0]=oe(u,d),f[2]=oe(o,n)):(f[0]=0,f[2]=oe(-a,l));break;case"YZX":f[2]=et(Je(o,-1,1)),Xt(o)<.99999?(f[0]=oe(-c,l),f[1]=oe(-h,n)):(f[0]=0,f[1]=oe(s,d));break;case"XZY":f[2]=et(-Je(a,-1,1)),Xt(a)<.99999?(f[0]=oe(u,l),f[1]=oe(s,n)):(f[0]=oe(-c,d),f[1]=0);break;default:console.warn("Unkown order: "+v)}return e._dirty=!0,e};Object.defineProperties(W,{POSITIVE_X:{get:function(){return new W(1,0,0)}},NEGATIVE_X:{get:function(){return new W(-1,0,0)}},POSITIVE_Y:{get:function(){return new W(0,1,0)}},NEGATIVE_Y:{get:function(){return new W(0,-1,0)}},POSITIVE_Z:{get:function(){return new W(0,0,1)}},NEGATIVE_Z:{get:function(){return new W(0,0,-1)}},UP:{get:function(){return new W(0,1,0)}},ZERO:{get:function(){return new W}}});const P=W;var xi=1e-5,Wr=function(e,t){this.origin=e||new P,this.direction=t||new P};Wr.prototype={constructor:Wr,intersectPlane:function(e,t){var r=e.normal.array,i=e.distance,n=this.origin.array,a=this.direction.array,s=x.dot(r,a);if(s===0)return null;t||(t=new P);var o=(x.dot(r,n)-i)/s;return x.scaleAndAdd(t.array,n,a,-o),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=x.dot(e.normal.array,this.direction.array);x.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,-t*2),this.direction._dirty=!0},distanceToPoint:function(){var e=x.create();return function(t){x.sub(e,t,this.origin.array);var r=x.dot(e,this.direction.array);if(r<0)return x.distance(this.origin.array,t);var i=x.lenSquared(e);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var e=x.create();return function(t,r,i){var n=this.origin.array,a=this.direction.array;t=t.array,x.sub(e,t,n);var s=x.dot(e,a),o=x.squaredLength(e),l=o-s*s,c=r*r;if(!(l>c)){var h=Math.sqrt(c-l),u=s-h,d=s+h;return i||(i=new P),u<0?d<0?null:(x.scaleAndAdd(i.array,n,a,d),i):(x.scaleAndAdd(i.array,n,a,u),i)}}}(),intersectBoundingBox:function(e,t){var r=this.direction.array,i=this.origin.array,n=e.min.array,a=e.max.array,s=1/r[0],o=1/r[1],l=1/r[2],c,h,u,d,f,v;if(s>=0?(c=(n[0]-i[0])*s,h=(a[0]-i[0])*s):(h=(n[0]-i[0])*s,c=(a[0]-i[0])*s),o>=0?(u=(n[1]-i[1])*o,d=(a[1]-i[1])*o):(d=(n[1]-i[1])*o,u=(a[1]-i[1])*o),c>d||u>h||((u>c||c!==c)&&(c=u),(d=0?(f=(n[2]-i[2])*l,v=(a[2]-i[2])*l):(v=(n[2]-i[2])*l,f=(a[2]-i[2])*l),c>v||f>h)||((f>c||c!==c)&&(c=f),(v=0?c:h;return t||(t=new P),x.scaleAndAdd(t.array,i,r,m),t},intersectTriangle:function(){var e=x.create(),t=x.create(),r=x.create(),i=x.create();return function(n,a,s,o,l,c){var h=this.direction.array,u=this.origin.array;n=n.array,a=a.array,s=s.array,x.sub(e,a,n),x.sub(t,s,n),x.cross(i,t,h);var d=x.dot(e,i);if(o){if(d>-xi)return null}else if(d>-xi&&d1)return null;x.cross(i,e,r);var v=x.dot(h,i)/d;if(v<0||v>1||f+v>1)return null;x.cross(i,e,t);var m=-x.dot(r,i)/d;return m<0?null:(l||(l=new P),c&&P.set(c,1-f-v,f,v),x.scaleAndAdd(l.array,u,h,m),l)}}(),applyTransform:function(e){P.add(this.direction,this.direction,this.origin),P.transformMat4(this.origin,this.origin,e),P.transformMat4(this.direction,this.direction,e),P.sub(this.direction,this.direction,this.origin),P.normalize(this.direction,this.direction)},copy:function(e){P.copy(this.origin,e.origin),P.copy(this.direction,e.direction)},clone:function(){var e=new Wr;return e.copy(this),e}};const $r=Wr;var K={};K.create=function(){var e=new Ie(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e};K.clone=function(e){var t=new Ie(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};K.fromValues=function(e,t,r,i){var n=new Ie(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n};K.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};K.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e};K.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e};K.subtract=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e};K.sub=K.subtract;K.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e};K.mul=K.multiply;K.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e};K.div=K.divide;K.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e};K.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e};K.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e};K.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e};K.distance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+a*a)};K.dist=K.distance;K.squaredDistance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a};K.sqrDist=K.squaredDistance;K.length=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)};K.len=K.length;K.squaredLength=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n};K.sqrLen=K.squaredLength;K.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e};K.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e};K.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s),e};K.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]};K.lerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e[3]=o+i*(r[3]-o),e};K.random=function(e,t){return t=t||1,e[0]=Kt(),e[1]=Kt(),e[2]=Kt(),e[3]=Kt(),K.normalize(e,e),K.scale(e,e,t),e};K.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,e};K.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],c=r[3],h=c*i+o*a-l*n,u=c*n+l*i-s*a,d=c*a+s*n-o*i,f=-s*i-o*n-l*a;return e[0]=h*c+f*-s+u*-l-d*-o,e[1]=u*c+f*-o+d*-s-h*-l,e[2]=d*c+f*-l+h*-o-u*-s,e};K.forEach=function(){var e=K.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(x.cross(e,n,a),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,ie.normalize(i,i))}}();ie.setAxes=function(){var e=ee.create();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],ie.normalize(t,ie.fromMat3(t,e))}}();ie.clone=D.clone;ie.fromValues=D.fromValues;ie.copy=D.copy;ie.set=D.set;ie.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e};ie.setAxisAngle=function(e,t,r){r=r*.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e};ie.add=D.add;ie.multiply=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=r[0],l=r[1],c=r[2],h=r[3];return e[0]=i*h+s*o+n*c-a*l,e[1]=n*h+s*l+a*o-i*c,e[2]=a*h+s*c+i*l-n*o,e[3]=s*h-i*o-n*l-a*c,e};ie.mul=ie.multiply;ie.scale=D.scale;ie.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*o,e[1]=n*l+a*o,e[2]=a*l-n*o,e[3]=s*l-i*o,e};ie.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l-a*o,e[1]=n*l+s*o,e[2]=a*l+i*o,e[3]=s*l-n*o,e};ie.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*o,e[1]=n*l-i*o,e[2]=a*l+s*o,e[3]=s*l-a*o,e};ie.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e};ie.dot=D.dot;ie.lerp=D.lerp;ie.slerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3],l=r[0],c=r[1],h=r[2],u=r[3],d,f,v,m,p;return f=n*l+a*c+s*h+o*u,f<0&&(f=-f,l=-l,c=-c,h=-h,u=-u),1-f>1e-6?(d=Math.acos(f),v=Math.sin(d),m=Math.sin((1-i)*d)/v,p=Math.sin(i*d)/v):(m=1-i,p=i),e[0]=m*n+p*l,e[1]=m*a+p*c,e[2]=m*s+p*h,e[3]=m*o+p*u,e};ie.invert=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a,o=s?1/s:0;return e[0]=-r*o,e[1]=-i*o,e[2]=-n*o,e[3]=a*o,e};ie.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e};ie.length=D.length;ie.len=ie.length;ie.squaredLength=D.squaredLength;ie.sqrLen=ie.squaredLength;ie.normalize=D.normalize;ie.fromMat3=function(e,t){var r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[a*3+a]-t[s*3+s]+1),e[n]=.5*i,i=.5/i,e[3]=(t[a*3+s]-t[s*3+a])*i,e[a]=(t[a*3+n]+t[n*3+a])*i,e[s]=(t[s*3+n]+t[n*3+s])*i}return e};const Y=ie;var he=function(){this._axisX=new P,this._axisY=new P,this._axisZ=new P,this.array=C.create(),this._dirty=!0};he.prototype={constructor:he,setArray:function(e){for(var t=0;t0){var t=this.min,r=this.max,i=t.array,n=r.array;Br(i,e[0]),Br(n,e[0]);for(var a=1;an[0]&&(n[0]=s[0]),s[1]>n[1]&&(n[1]=s[1]),s[2]>n[2]&&(n[2]=s[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return x.min(t.array,t.array,e.min.array),x.max(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersection:function(e){var t=this.min,r=this.max;return x.max(t.array,t.array,e.min.array),x.min(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,r=this.max.array,i=e.min.array,n=e.max.array;return!(t[0]>n[0]||t[1]>n[1]||t[2]>n[2]||r[0]=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(e){var t=this.min.array,r=this.max.array,i=e.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:function(){var e=x.create(),t=x.create(),r=x.create(),i=x.create(),n=x.create(),a=x.create();return function(s,o){var l=s.min.array,c=s.max.array,h=o.array;return e[0]=h[0]*l[0],e[1]=h[1]*l[0],e[2]=h[2]*l[0],t[0]=h[0]*c[0],t[1]=h[1]*c[0],t[2]=h[2]*c[0],r[0]=h[4]*l[1],r[1]=h[5]*l[1],r[2]=h[6]*l[1],i[0]=h[4]*c[1],i[1]=h[5]*c[1],i[2]=h[6]*c[1],n[0]=h[8]*l[2],n[1]=h[9]*l[2],n[2]=h[10]*l[2],a[0]=h[8]*c[2],a[1]=h[9]*c[2],a[2]=h[10]*c[2],l=this.min.array,c=this.max.array,l[0]=Math.min(e[0],t[0])+Math.min(r[0],i[0])+Math.min(n[0],a[0])+h[12],l[1]=Math.min(e[1],t[1])+Math.min(r[1],i[1])+Math.min(n[1],a[1])+h[13],l[2]=Math.min(e[2],t[2])+Math.min(r[2],i[2])+Math.min(n[2],a[2])+h[14],c[0]=Math.max(e[0],t[0])+Math.max(r[0],i[0])+Math.max(n[0],a[0])+h[12],c[1]=Math.max(e[1],t[1])+Math.max(r[1],i[1])+Math.max(n[1],a[1])+h[13],c[2]=Math.max(e[2],t[2])+Math.max(r[2],i[2])+Math.max(n[2],a[2])+h[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(e){var t=this.min.array,r=this.max.array,i=e.array,n=t[0],a=t[1],s=t[2],o=r[0],l=r[1],c=t[2],h=r[0],u=r[1],d=r[2];if(i[15]===1)t[0]=i[0]*n+i[12],t[1]=i[5]*a+i[13],r[2]=i[10]*s+i[14],r[0]=i[0]*h+i[12],r[1]=i[5]*u+i[13],t[2]=i[10]*d+i[14];else{var f=-1/s;t[0]=i[0]*n*f,t[1]=i[5]*a*f,r[2]=(i[10]*s+i[14])*f,f=-1/c,r[0]=i[0]*o*f,r[1]=i[5]*l*f,f=-1/d,t[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=x.fromValues(0,0,0);this.vertices=e}var r=this.min.array,i=this.max.array;return Et(e[0],r[0],r[1],r[2]),Et(e[1],r[0],i[1],r[2]),Et(e[2],i[0],r[1],r[2]),Et(e[3],i[0],i[1],r[2]),Et(e[4],r[0],r[1],i[2]),Et(e[5],r[0],i[1],i[2]),Et(e[6],i[0],r[1],i[2]),Et(e[7],i[0],i[1],i[2]),this},copy:function(e){var t=this.min,r=this.max;return Br(t.array,e.min.array),Br(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new Xr;return e.copy(this),e}};const ke=Xr;var Wo=0,Xo=qe.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+Wo++),this.position||(this.position=new P),this.rotation||(this.rotation=new ba),this.scale||(this.scale=new P(1,1,1)),this.worldTransform=new z,this.localTransform=new z,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var r=t._nodeRepository;delete r[this.name],r[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var r=this._scene;r&&r!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,r=t.indexOf(e);r<0||(t.splice(r,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=dt.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:function(){var e=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var t=dt.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var r=0;r=0&&E[y]>1e-4&&(x.transformMat4(b,g,_[S[y]]),x.scaleAndAdd(R,R,b,E[y]));M.set(T,R)}}for(var T=0;T>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("webgl_texture");r&&e.gl.deleteTexture(r),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(te.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}});Object.defineProperty(te.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}});te.BYTE=A.BYTE;te.UNSIGNED_BYTE=A.UNSIGNED_BYTE;te.SHORT=A.SHORT;te.UNSIGNED_SHORT=A.UNSIGNED_SHORT;te.INT=A.INT;te.UNSIGNED_INT=A.UNSIGNED_INT;te.FLOAT=A.FLOAT;te.HALF_FLOAT=36193;te.UNSIGNED_INT_24_8_WEBGL=34042;te.DEPTH_COMPONENT=A.DEPTH_COMPONENT;te.DEPTH_STENCIL=A.DEPTH_STENCIL;te.ALPHA=A.ALPHA;te.RGB=A.RGB;te.RGBA=A.RGBA;te.LUMINANCE=A.LUMINANCE;te.LUMINANCE_ALPHA=A.LUMINANCE_ALPHA;te.SRGB=35904;te.SRGB_ALPHA=35906;te.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;te.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;te.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;te.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;te.NEAREST=A.NEAREST;te.LINEAR=A.LINEAR;te.NEAREST_MIPMAP_NEAREST=A.NEAREST_MIPMAP_NEAREST;te.LINEAR_MIPMAP_NEAREST=A.LINEAR_MIPMAP_NEAREST;te.NEAREST_MIPMAP_LINEAR=A.NEAREST_MIPMAP_LINEAR;te.LINEAR_MIPMAP_LINEAR=A.LINEAR_MIPMAP_LINEAR;te.REPEAT=A.REPEAT;te.CLAMP_TO_EDGE=A.CLAMP_TO_EDGE;te.MIRRORED_REPEAT=A.MIRRORED_REPEAT;const q=te;var Qe=zi.extend({skeleton:null,joints:null},function(){this.joints||(this.joints=[])},{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=zi.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});Qe.POINTS=A.POINTS;Qe.LINES=A.LINES;Qe.LINE_LOOP=A.LINE_LOOP;Qe.LINE_STRIP=A.LINE_STRIP;Qe.TRIANGLES=A.TRIANGLES;Qe.TRIANGLE_STRIP=A.TRIANGLE_STRIP;Qe.TRIANGLE_FAN=A.TRIANGLE_FAN;Qe.BACK=A.BACK;Qe.FRONT=A.FRONT;Qe.FRONT_AND_BACK=A.FRONT_AND_BACK;Qe.CW=A.CW;Qe.CCW=A.CCW;const Ji=Qe;var si={};si.isPowerOfTwo=function(e){return(e&e-1)===0};si.nextPowerOfTwo=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e};si.nearestPowerOfTwo=function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))};const wa=si;var Un=wa.isPowerOfTwo;function Hn(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function Yo(e,t){var r=Hn(e.width),i=Hn(e.height);t=t||document.createElement("canvas"),t.width=r,t.height=i;var n=t.getContext("2d");return n.drawImage(e.image,0,0,r,i),t}var en=q.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var r=this.format,i=this.type,n=!!(this.convertToPOT&&!this.mipmaps.length&&this.image&&(this.wrapS===q.REPEAT||this.wrapT===q.REPEAT)&&this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,n?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,n?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n?this.minFilter:this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var s=e.getGLExtension("OES_texture_half_float");s||(i=A.FLOAT)}if(this.mipmaps.length)for(var o=this.width,l=this.height,c=0;c=q.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,r,a,i,n,0,t.pixels):e.texImage2D(e.TEXTURE_2D,r,a,i,n,0,a,s,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return Un(this.width)&&Un(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!!(this.width&&this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var r=be.createImage();t&&(r.crossOrigin=t);var i=this;return r.onload=function(){i.dirty(),i.trigger("success",i)},r.onerror=function(){i.trigger("error",i)},r.src=e,this.image=r,this}});Object.defineProperty(en.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}});Object.defineProperty(en.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});const ne=en;function Ca(e){return{byte:be.Int8Array,ubyte:be.Uint8Array,short:be.Int16Array,ushort:be.Uint16Array}[e]||be.Float32Array}function Ei(e){return"attr_"+e}function er(e,t,r,i){switch(this.name=e,this.type=t,this.size=r,this.semantic=i||"",this.value=null,r){case 1:this.get=function(n){return this.value[n]},this.set=function(n,a){this.value[n]=a},this.copy=function(n,a){this.value[n]=this.value[n]};break;case 2:this.get=function(n,a){var s=this.value;return a[0]=s[n*2],a[1]=s[n*2+1],a},this.set=function(n,a){var s=this.value;s[n*2]=a[0],s[n*2+1]=a[1]},this.copy=function(n,a){var s=this.value;a*=2,n*=2,s[n]=s[a],s[n+1]=s[a+1]};break;case 3:this.get=function(n,a){var s=n*3,o=this.value;return a[0]=o[s],a[1]=o[s+1],a[2]=o[s+2],a},this.set=function(n,a){var s=n*3,o=this.value;o[s]=a[0],o[s+1]=a[1],o[s+2]=a[2]},this.copy=function(n,a){var s=this.value;a*=3,n*=3,s[n]=s[a],s[n+1]=s[a+1],s[n+2]=s[a+2]};break;case 4:this.get=function(n,a){var s=this.value,o=n*4;return a[0]=s[o],a[1]=s[o+1],a[2]=s[o+2],a[3]=s[o+3],a},this.set=function(n,a){var s=this.value,o=n*4;s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2],s[o+3]=a[3]},this.copy=function(n,a){var s=this.value;a*=4,n*=4,s[n]=s[a],s[n+1]=s[a+1],s[n+2]=s[a+2],s[n+3]=s[a+3]}}}er.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=Ca(this.type);this.value=new t(e*this.size)}};er.prototype.fromArray=function(e){var t=Ca(this.type),r;if(e[0]&&e[0].length){var i=0,n=this.size;r=new t(e.length*n);for(var a=0;a=0){t||(t=[]);var r=this.indices;return t[0]=r[e*3],t[1]=r[e*3+1],t[2]=r[e*3+2],t}},setTriangleIndices:function(e,t){var r=this.indices;r[e*3]=t[0],r[e*3+1]=t[1],r[e*3+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,r=this.vertexCount>65535?be.Uint32Array:be.Uint16Array;if(e[0]&&e[0].length){var i=0,n=3;t=new r(e.length*n);for(var a=0;a=0?(t.splice(r,1),delete this.attributes[e],!0):!1},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var r=[],i=this.vertexCount,n=0;na[0]&&(a[0]=o),l>a[1]&&(a[1]=l),c>a[2]&&(a[2]=c)}r._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,r=t.position.value,i=t.normal.value;if(!i||i.length!==r.length)i=t.normal.value=new be.Float32Array(r.length);else for(var n=0;n65535&&(this.indices=new be.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,r=this.getEnabledAttributes(),i={},n=0;nthis.distance,n=1;n<8;n++)if(x.dot(t[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var e=x.create();return function(t,r,i){var n=this.distanceToPoint(t),a=this.distanceToPoint(r);if(n>0&&a>0||n<0&&a<0)return null;var s=this.normal.array,o=this.distance,l=t.array;x.sub(e,r.array,t.array),x.normalize(e,e);var c=x.dot(s,e);if(c===0)return null;i||(i=new P);var h=(x.dot(s,l)-o)/c;return x.scaleAndAdd(i.array,l,e,-h),i._dirty=!0,i}}(),applyTransform:function(){var e=C.create(),t=D.create(),r=D.create();return r[3]=1,function(i){i=i.array,x.scale(r,this.normal.array,this.distance),D.transformMat4(r,r,i),this.distance=x.dot(r,this.normal.array),C.invert(e,i),C.transpose(e,e),t[3]=0,x.copy(t,this.normal.array),D.transformMat4(t,t,e),x.copy(this.normal.array,t)}}(),copy:function(e){x.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new jr;return e.copy(this),e}};const Na=jr;var Ee=x.set,zn=x.copy,Gn=x.transformMat4,Ai=Math.min,Si=Math.max,La=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new Na);this.boundingBox=new ke,this.vertices=[];for(var e=0;e<8;e++)this.vertices[e]=x.fromValues(0,0,0)};La.prototype={setFromProjection:function(e){var t=this.planes,r=e.array,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],l=r[5],c=r[6],h=r[7],u=r[8],d=r[9],f=r[10],v=r[11],m=r[12],p=r[13],_=r[14],T=r[15];Ee(t[0].normal.array,s-i,h-o,v-u),t[0].distance=-(T-m),t[0].normalize(),Ee(t[1].normal.array,s+i,h+o,v+u),t[1].distance=-(T+m),t[1].normalize(),Ee(t[2].normal.array,s+n,h+l,v+d),t[2].distance=-(T+p),t[2].normalize(),Ee(t[3].normal.array,s-n,h-l,v-d),t[3].distance=-(T-p),t[3].normalize(),Ee(t[4].normal.array,s-a,h-c,v-f),t[4].distance=-(T-_),t[4].normalize(),Ee(t[5].normal.array,s+a,h+c,v+f),t[5].distance=-(T+_),t[5].normalize();var y=this.boundingBox,g=this.vertices;if(T===0){var E=l/i,S=-_/(f-1),R=-_/(f+1),b=-R/l,M=-S/l;y.min.set(-b*E,-b,R),y.max.set(b*E,b,S),Ee(g[0],-b*E,-b,R),Ee(g[1],-b*E,b,R),Ee(g[2],b*E,-b,R),Ee(g[3],b*E,b,R),Ee(g[4],-M*E,-M,S),Ee(g[5],-M*E,M,S),Ee(g[6],M*E,-M,S),Ee(g[7],M*E,M,S)}else{var F=(-1-m)/i,w=(1-m)/i,U=(1-p)/l,O=(-1-p)/l,L=(-1-_)/f,G=(1-_)/f;y.min.set(Math.min(F,w),Math.min(O,U),Math.min(G,L)),y.max.set(Math.max(w,F),Math.max(U,O),Math.max(L,G));var B=y.min.array,Z=y.max.array;Ee(g[0],B[0],B[1],B[2]),Ee(g[1],B[0],Z[1],B[2]),Ee(g[2],Z[0],B[1],B[2]),Ee(g[3],Z[0],Z[1],B[2]),Ee(g[4],B[0],B[1],Z[2]),Ee(g[5],B[0],Z[1],Z[2]),Ee(g[6],Z[0],B[1],Z[2]),Ee(g[7],Z[0],Z[1],Z[2])}},getTransformedBoundingBox:function(){var e=x.create();return function(t,r){var i=this.vertices,n=r.array,a=t.min,s=t.max,o=a.array,l=s.array,c=i[0];Gn(e,c,n),zn(o,e),zn(l,e);for(var h=1;h<8;h++)c=i[h],Gn(e,c,n),o[0]=Ai(e[0],o[0]),o[1]=Ai(e[1],o[1]),o[2]=Ai(e[2],o[2]),l[0]=Si(e[0],l[0]),l[1]=Si(e[1],l[1]),l[2]=Si(e[2],l[2]);return a._dirty=!0,s._dirty=!0,t}}()};const tn=La;var Ko=dt.extend(function(){return{projectionMatrix:new z,invProjectionMatrix:new z,viewMatrix:new z,frustum:new tn}},function(){this.update(!0)},{update:function(e){dt.prototype.update.call(this,e),z.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),z.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){z.copy(this.viewMatrix,e),z.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){z.copy(this.projectionMatrix,e),z.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var e=D.create();return function(t,r){var i=r!==void 0?r:new $r,n=t.array[0],a=t.array[1];return D.set(e,n,a,-1,1),D.transformMat4(e,e,this.invProjectionMatrix.array),D.transformMat4(e,e,this.worldTransform.array),x.scale(i.origin.array,e,1/e[3]),D.set(e,n,a,1,1),D.transformMat4(e,e,this.invProjectionMatrix.array),D.transformMat4(e,e,this.worldTransform.array),x.scale(e,e,1/e[3]),x.sub(i.direction.array,e,i.origin.array),x.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()});const tr=Ko;var Qo=C.create(),kn=C.create(),bi={};function Jo(e){var t=[],r=Object.keys(e);r.sort();for(var i=0;i0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof lt&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof tr?(t=this._cameraList.indexOf(e),t>=0&&this._cameraList.splice(t,1)):e instanceof lt&&(t=this.lights.indexOf(e),t>=0&&this.lights.splice(t,1)),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},r=0;r0&&this._doUpdateRenderList(s,t,r,i,n)}},isFrustumCulled:function(){var e=new ke,t=new z;return function(r,i,n){var a=r.boundingBox;if(a||(r.skeleton&&r.skeleton.boundingBox?a=r.skeleton.boundingBox:a=r.geometry.boundingBox),!a)return!1;if(t.array=n,e.transformFrom(a,t),r.castShadow&&this.viewBoundingBoxLastFrame.union(e),r.frustumCulling){if(!e.intersectBoundingBox(i.frustum.boundingBox))return!0;t.array=i.projectionMatrix.array,e.max.array[2]>0&&e.min.array[2]<0&&(e.max.array[2]=-1e-20),e.applyProjection(t);var s=e.min.array,o=e.max.array;if(o[0]<-1||s[0]>1||o[1]<-1||s[1]>1||o[2]<-1||s[2]>1)return!0}return!1}}(),_updateLightUniforms:function(){var e=this.lights;e.sort(tl);var t=this._lightUniforms;for(var r in t)for(var i in t[r])t[r][i].value.length=0;for(var n=0;n1&&t.texParameterf(t.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var a=e.getGLExtension("OES_texture_half_float");a||(i=A.FLOAT)}if(this.mipmaps.length)for(var s=this.width,o=this.height,l=0;l0&&e.height>0}const gr=rn;var il=tr.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=Math.atan(1/e[5])*2;this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=tr.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});const Ne=il;var Ur="framebuffer",pt="renderbuffer",Vn=pt+"_width",Wn=pt+"_height",wi=pt+"_attached",Ci="depthtexture_attached",Mt=A.FRAMEBUFFER,lr=A.RENDERBUFFER,fr=A.DEPTH_ATTACHMENT,Pa=A.COLOR_ATTACHMENT0,Sr=qe.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new Qi,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(Mt,this._getFrameBufferGL(e)),this._boundRenderer=e;var r=this._cache;r.put("viewport",e.viewport);var i=!1,n,a;for(var s in this._textures){i=!0;var o=this._textures[s];o&&(n=o.texture.width,a=o.texture.height,this._doAttach(e,o.texture,s,o.target))}this._width=n,this._height=a,!i&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,n,a,1);var l=r.get("attached_textures");if(l){for(var s in l)if(!this._textures[s]){var c=l[s];this._doDetach(t,s,c)}}if(!r.get(Ci)&&this.depthBuffer){r.miss(pt)&&r.put(pt,t.createRenderbuffer());var h=r.get(pt);(n!==r.get(Vn)||a!==r.get(Wn))&&(t.bindRenderbuffer(lr,h),t.renderbufferStorage(lr,t.DEPTH_COMPONENT16,n,a),r.put(Vn,n),r.put(Wn,a),t.bindRenderbuffer(lr,null)),r.get(wi)||(t.framebufferRenderbuffer(Mt,fr,lr,h),r.put(wi,!0))}},unbind:function(e){e.__currentFrameBuffer=null;var t=e.gl;t.bindFramebuffer(Mt,null),this._boundRenderer=null,this._cache.use(e.__uid__);var r=this._cache.get("viewport");r&&e.setViewport(r),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var r in this._textures){var i=this._textures[r];if(i){var n=i.texture;if(!n.NPOT&&n.useMipmap&&n.minFilter===q.LINEAR_MIPMAP_LINEAR){var a=n.textureType==="textureCube"?A.TEXTURE_CUBE_MAP:A.TEXTURE_2D;t.bindTexture(a,n.getWebGLTexture(e)),t.generateMipmap(a),t.bindTexture(a,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(Mt)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(Ur)&&t.put(Ur,e.gl.createFramebuffer()),t.get(Ur)},attach:function(e,t,r){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||Pa,r=r||A.TEXTURE_2D;var i=this._boundRenderer,n=i&&i.gl,a;if(n){var s=this._cache;s.use(i.__uid__),a=s.get("attached_textures")}var o=this._textures[t];if(!(o&&o.target===r&&o.texture===e&&a&&a[t]!=null)){var l=!0;i&&(l=this._doAttach(i,e,t,r),this.viewport||i.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=r)}},_doAttach:function(e,t,r,i){var n=e.gl,a=t.getWebGLTexture(e),s=this._cache.get("attached_textures");if(s&&s[r]){var o=s[r];if(o.texture===t&&o.target===i)return}r=+r;var l=!0;if(r===fr||r===A.DEPTH_STENCIL_ATTACHMENT){var c=e.getGLExtension("WEBGL_depth_texture");if(c||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==A.DEPTH_COMPONENT&&t.format!==A.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var h=this._cache.get(pt);h&&(n.framebufferRenderbuffer(Mt,fr,lr,null),n.deleteRenderbuffer(h),this._cache.put(pt,!1)),this._cache.put(wi,!1),this._cache.put(Ci,!0)}}return n.framebufferTexture2D(Mt,r,i,a,0),s||(s={},this._cache.put("attached_textures",s)),s[r]=s[r]||{},s[r].texture=t,s[r].target=i,l},_doDetach:function(e,t,r){e.framebufferTexture2D(Mt,t,r,null,0);var i=this._cache.get("attached_textures");i&&i[t]&&(i[t]=null),(t===fr||t===A.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(Ci,!1)},detach:function(e,t){if(this._textures[e]=null,this._boundRenderer){var r=this._cache;r.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t)}},dispose:function(e){var t=e.gl,r=this._cache;r.use(e.__uid__);var i=r.get(pt);i&&t.deleteRenderbuffer(i);var n=r.get(Ur);n&&t.deleteFramebuffer(n),r.deleteContext(e.__uid__),this._textures={}}});Sr.DEPTH_ATTACHMENT=fr;Sr.COLOR_ATTACHMENT0=Pa;Sr.STENCIL_ATTACHMENT=A.STENCIL_ATTACHMENT;Sr.DEPTH_STENCIL_ATTACHMENT=A.DEPTH_STENCIL_ATTACHMENT;const Ue=Sr;var nl=["px","nx","py","ny","pz","nz"],al=qe.extend(function(){var e={position:new P,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new Ne({fov:90}),nx:new Ne({fov:90}),py:new Ne({fov:90}),ny:new Ne({fov:90}),pz:new Ne({fov:90}),nz:new Ne({fov:90})};return t.px.lookAt(P.POSITIVE_X,P.NEGATIVE_Y),t.nx.lookAt(P.NEGATIVE_X,P.NEGATIVE_Y),t.py.lookAt(P.POSITIVE_Y,P.POSITIVE_Z),t.ny.lookAt(P.NEGATIVE_Y,P.NEGATIVE_Z),t.pz.lookAt(P.POSITIVE_Z,P.NEGATIVE_Y),t.nz.lookAt(P.NEGATIVE_Z,P.NEGATIVE_Y),e._frameBuffer=new Ue,e},{getCamera:function(e){return this._cameras[e]},render:function(e,t,r){var i=e.gl;r||t.update();for(var n=this.texture.width,a=2*Math.atan(n/(n-.5))/Math.PI*180,s=0;s<6;s++){var o=nl[s],l=this._cameras[o];if(P.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass){l.update();var c=t.getBoundingBox();c.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(c),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+s),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}});const nn=al;var sl=Ae.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var e=this.heightSegments,t=this.widthSegments,r=this.attributes,i=[],n=[],a=[],s=[],o=0;o<=e;o++)for(var l=o/e,c=0;c<=t;c++){var h=c/t;if(i.push([2*h-1,2*l-1,0]),n&&n.push([h,l]),a&&a.push([0,0,1]),c0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],r)}});const yr=cl;var hl=542327876,ul=131072,fl=512,dl=4;function sn(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var vl=31,ml=sn("DXT1"),pl=sn("DXT3"),_l=sn("DXT5"),gl=0,yl=1,xl=2,Tl=3,El=4,Al=7,Sl=20,bl=21,wl=28,Cl={parse:function(e,t){var r=new Int32Array(e,0,vl);if(r[gl]!==hl||!r(Sl)&dl)return null;var i=r(bl),n=r[El],a=r[Tl],s=r[wl]&fl,o=r[xl]&ul,l,c;switch(i){case ml:l=8,c=q.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case pl:l=16,c=q.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case _l:l=16,c=q.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var h=r[yl]+4,u=s?6:1,d=1;o&&(d=Math.max(1,r[Al]));for(var f=[],v=0;v0){var n=Math.pow(2,e[3]-128-8+i);t[r+0]=e[0]*n,t[r+1]=e[1]*n,t[r+2]=e[2]*n}else t[r+0]=0,t[r+1]=0,t[r+2]=0;return t[r+3]=1,t}function Pl(e,t,r){for(var i="",n=t;n0;)if(e[a][0]=t[r++],e[a][1]=t[r++],e[a][2]=t[r++],e[a][3]=t[r++],e[a][0]===1&&e[a][1]===1&&e[a][2]===1){for(var o=e[a][3]<>>0;o>0;o--)Dl(e[a-1],e[a]),a++,s--;n+=8}else a++,s--,n=0;return r}function Il(e,t,r,i){if(iNl)return Xn(e,t,r,i);var n=t[r++];if(n!=2)return Xn(e,t,r-1,i);if(e[0][1]=t[r++],e[0][2]=t[r++],n=t[r++],(e[0][2]<<8>>>0|n)>>>0!==i)return null;for(var n=0;n<4;n++)for(var a=0;a128){s=(s&127)>>>0;for(var o=t[r++];s--;)e[a++][n]=o}else for(;s--;)e[a++][n]=t[r++]}return r}var Ol={parseRGBE:function(e,t,r){r==null&&(r=0);var i=new Uint8Array(e),n=i.length;if(Pl(i,0,2)==="#?"){for(var a=2;a=n)){a+=2;for(var s="";a20)return console.warn("Given image is not a height map"),e}var f,v,m,p;l%(i*4)===0?(f=s.data[l],m=s.data[l+4]):l%(i*4)===(i-1)*4?(f=s.data[l-4],m=s.data[l]):(f=s.data[l-4],m=s.data[l+4]),li*(n-1)*4?(v=s.data[l-i*4],p=s.data[l]):(v=s.data[l-i*4],p=s.data[l+i*4]),o.data[l]=f-m+127,o.data[l+1]=v-p+127,o.data[l+2]=255,o.data[l+3]=255}return a.putImageData(o,0,0),r},isHeightImage:function(e,t,r){if(!e||!e.width||!e.height)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t||32;r=r||20,i.width=i.height=a,n.drawImage(e,0,0,a,a);for(var s=n.getImageData(0,0,a,a),o=0;or)return!1}return!0},_fetchTexture:function(e,t,r){be.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:r})},createChessboard:function(e,t,r,i){e=e||512,t=t||64,r=r||"black",i=i||"white";var n=Math.ceil(e/t),a=document.createElement("canvas");a.width=e,a.height=e;var s=a.getContext("2d");s.fillStyle=i,s.fillRect(0,0,e,e),s.fillStyle=r;for(var o=0;o=0||(Gi.forEach(function(t){e.on(t,this[ki(t)],this)},this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),Gi.forEach(function(r){e.off(r,this[ki(r)])},this)},dispose:function(){this._meshes.forEach(function(e){this.detachFromMesh(e)},this)}};const Fl=Vi;var Ul=tr.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=tr.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});const xr=Ul,Hl="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end";N.import(Hl);var zl=new an,jn=new Ji({geometry:zl,frustumCulling:!1}),Gl=new xr,kl=qe.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var e=new N(N.source("clay.compositor.vertex"),this.fragment),t=new yt({shader:e});t.enableTexturesAll(),this.material=t},{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||A.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var r in this.outputs){var i=this.outputs[r];i&&t.attach(i,r)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var r=e.gl;if(t){this.bind(e,t);var i=e.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var n=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&n.push(a);i.drawBuffersEXT(n)}}this.trigger("beforerender",this,e);var s=this.clearDepth?r.DEPTH_BUFFER_BIT:0;if(r.depthMask(!0),this.clearColor){s=s|r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0);var o=this.clearColor;Array.isArray(o)&&r.clearColor(o[0],o[1],o[2],o[3])}r.clear(s),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){jn.material=this.material,e.renderPass([jn],Gl)},dispose:function(e){}});const Ve=kl,Vl="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n",Wl="#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n";var Ut={},Ri=["px","nx","py","ny","pz","nz"];Ut.prefilterEnvironmentMap=function(e,t,r,i,n){(!n||!i)&&(i=Ut.generateNormalDistribution(),n=Ut.integrateBRDF(e,i)),r=r||{};var a=r.width||64,s=r.height||64,o=r.type||t.type,l=new gr({width:a,height:s,type:o,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var c=Math.min(a,s),h=Math.log(c)/Math.log(2)+1,u=new yt({shader:new N({vertex:N.source("clay.skybox.vertex"),fragment:Wl})});u.set("normalDistribution",i),r.encodeRGBM&&u.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&u.define("fragment","RGBM_DECODE");var d=new Ct,f;if(t.textureType==="texture2D"){var v=new gr({width:a,height:s,type:o===q.FLOAT?q.HALF_FLOAT:o});Ft.panoramaToCubeMap(e,t,v,{encodeRGBM:r.decodeRGBM}),t=v}f=new yr({scene:d,material:u}),f.material.set("environmentMap",t);var m=new nn({texture:l});r.encodeRGBM&&(o=l.type=q.UNSIGNED_BYTE);for(var p=new ne({width:a,height:s,type:o}),_=new Ue({depthBuffer:!1}),T=be[o===q.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y>>16)>>>0;u=((u&1431655765)<<1|(u&2863311530)>>>1)>>>0,u=((u&858993459)<<2|(u&3435973836)>>>2)>>>0,u=((u&252645135)<<4|(u&4042322160)>>>4)>>>0,u=(((u&16711935)<<8|(u&4278255360)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-u)/(1+(c*c-1)*u));s[h]=d}for(var h=0;h65535?Uint32Array:Uint16Array,o=this.indices=new s(t*e*6),l,c,h,u,d,f,v,y=this.radius,m=this.phiStart,p=this.phiLength,_=this.thetaStart,T=this.thetaLength,y=this.radius,g=[],E=[],S=0,R=1/y;for(v=0;v<=e;v++)for(f=0;f<=t;f++)u=f/t,d=v/e,l=-y*Math.cos(m+u*p)*Math.sin(_+d*T),c=y*Math.cos(_+d*T),h=y*Math.sin(m+u*p)*Math.sin(_+d*T),g[0]=l,g[1]=c,g[2]=h,E[0]=u,E[1]=d,r.set(S,g),i.set(S,E),g[0]*=R,g[1]*=R,g[2]*=R,n.set(S,g),S++;var b,M,F,w,U=t+1,O=0;for(v=0;v=0&&l.splice(u,1)}),l.push(c),this.__zr&&this.__zr.animation.addAnimator(c),c},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,r=t.length,i=0;i 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end",_c="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n",gc="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end",yc="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",xc="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",Tc="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n",Ec="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end";Object.assign(dt.prototype,mc);N.import(pc);N.import(Sa);N.import(_c);N.import(gc);N.import(yc);N.import(xc);N.import(Tc);N.import(Ec);function Ac(e){return!e||e==="none"}function Oa(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}function Sc(e){return e.getZr&&e.setOption}var bc=Ct.prototype.addToScene,wc=Ct.prototype.removeFromScene;Ct.prototype.addToScene=function(e){if(bc.call(this,e),this.__zr){var t=this.__zr;e.traverse(function(r){r.__zr=t,r.addAnimatorsToZr&&r.addAnimatorsToZr(t)})}};Ct.prototype.removeFromScene=function(e){wc.call(this,e),e.traverse(function(t){var r=t.__zr;t.__zr=null,r&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(r)})};yt.prototype.setTextureImage=function(e,t,r,i){if(this.shader){var n=r.getZr(),a=this,s;return a.autoUpdateTextureStatus=!1,a.disableTexture(e),Ac(t)||(s=j.loadTexture(t,r,i,function(o){a.enableTexture(e),n&&n.refresh()}),a.set(e,s)),s}};var j={};j.Renderer=vr;j.Node=dt;j.Mesh=Ji;j.Shader=N;j.Material=yt;j.Texture=q;j.Texture2D=ne;j.Geometry=Ae;j.SphereGeometry=tc;j.PlaneGeometry=an;j.CubeGeometry=Da;j.AmbientLight=ic;j.DirectionalLight=ac;j.PointLight=oc;j.SpotLight=cc;j.PerspectiveCamera=Ne;j.OrthographicCamera=xr;j.Vector2=$e;j.Vector3=P;j.Vector4=hc;j.Quaternion=ba;j.Matrix2=uc;j.Matrix2d=fc;j.Matrix3=dc;j.Matrix4=z;j.Plane=Na;j.Ray=$r;j.BoundingBox=ke;j.Frustum=tn;var zr=null;function Cc(){return zr!==null||(zr=Ft.createBlank("rgba(255,255,255,0)").image),zr}function Yn(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function qn(e){if((e.wrapS===q.REPEAT||e.wrapT===q.REPEAT)&&e.image){var t=Yn(e.width),r=Yn(e.height);if(t!==e.width||r!==e.height){var i=document.createElement("canvas");i.width=t,i.height=r;var n=i.getContext("2d");n.drawImage(e.image,0,0,t,r),e.image=i}}}j.loadTexture=function(e,t,r,i){typeof r=="function"&&(i=r,r={}),r=r||{};for(var n=Object.keys(r).sort(),a="",s=0;s3?t[3]=e[3]:t[3]=1,t):(t=ua(e||"#000",t)||[0,0,0,0],t[0]/=255,t[1]/=255,t[2]/=255,t)};j.directionFromAlphaBeta=function(e,t){var r=e/180*Math.PI+Math.PI/2,i=-t/180*Math.PI+Math.PI/2,n=[],a=Math.sin(r);return n[0]=a*Math.cos(i),n[1]=-Math.cos(r),n[2]=a*Math.sin(i),n};j.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096;break}return t};j.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];j.createShader=function(e){e==="ecgl.shadow"&&(e="ecgl.displayShadow");var t=N.source(e+".vertex"),r=N.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),r||console.error("Fragment shader of '%s' not exits",e);var i=new N(t,r);return i.name=e,i};j.createMaterial=function(e,t){t instanceof Array||(t=[t]);var r=j.createShader(e),i=new yt({shader:r});return t.forEach(function(n){typeof n=="string"&&i.define(n)}),i};j.setMaterialFromModel=function(e,t,r,i){t.autoUpdateTextureStatus=!1;var n=r.getModel(e+"Material"),a=n.get("detailTexture"),s=tt.firstNotNull(n.get("textureTiling"),1),o=tt.firstNotNull(n.get("textureOffset"),0);typeof s=="number"&&(s=[s,s]),typeof o=="number"&&(o=[o,o]);var l=s[0]>1||s[1]>1?j.Texture.REPEAT:j.Texture.CLAMP_TO_EDGE,c={anisotropic:8,wrapS:l,wrapT:l};if(e==="realistic"){var h=n.get("roughness"),u=n.get("metalness");u!=null?isNaN(u)&&(t.setTextureImage("metalnessMap",u,i,c),u=tt.firstNotNull(n.get("metalnessAdjust"),.5)):u=0,h!=null?isNaN(h)&&(t.setTextureImage("roughnessMap",h,i,c),h=tt.firstNotNull(n.get("roughnessAdjust"),.5)):h=.5;var d=n.get("normalTexture");t.setTextureImage("detailMap",a,i,c),t.setTextureImage("normalMap",d,i,c),t.set({roughness:h,metalness:u,detailUvRepeat:s,detailUvOffset:o})}else if(e==="lambert")t.setTextureImage("detailMap",a,i,c),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="color")t.setTextureImage("detailMap",a,i,c),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="hatching"){var f=n.get("hatchingTextures")||[];f.length<6;for(var v=0;v<6;v++)t.setTextureImage("hatch"+(v+1),f[v],i,{anisotropic:8,wrapS:j.Texture.REPEAT,wrapT:j.Texture.REPEAT});t.set({detailUvRepeat:s,detailUvOffset:o})}};j.updateVertexAnimation=function(e,t,r,i){var n=i.get("animation"),a=i.get("animationDurationUpdate"),s=i.get("animationEasingUpdate"),o=r.shadowDepthMaterial;if(n&&t&&a>0&&t.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,o&&o.define("vertex","VERTEX_ANIMATION");for(var l=0;l=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var r=this.zr;e.scene.traverse(function(i){i.__zr=r,i.addAnimatorsToZr&&i.addAnimatorsToZr(r)})}};function Ba(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}ce.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(Ba,this),e.layer=null,this._viewsToDispose.push(e))}};ce.prototype.removeViewsAll=function(){this.views.forEach(function(e){e.scene.traverse(Ba,this),e.layer=null,this._viewsToDispose.push(e)},this),this.views.length=0};ce.prototype.resize=function(e,t){var r=this.renderer;r.resize(e,t)};ce.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)};ce.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)};ce.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)};ce.prototype.needsRefresh=function(){this.zr.refresh()};ce.prototype.refresh=function(e){this._backgroundColor=e?V.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t20)){e=e.event;var i=this.pickObject(e.offsetX,e.offsetY);i&&(this._dispatchEvent(e.type,e,i),this._dispatchDataEvent(e.type,e,i));var n=this._clickToSetFocusPoint(e);if(n){var a=n.view.setDOFFocusOnPoint(n.distance);a&&this.zr.refresh()}}}};ce.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,r=t.viewport,i=this.views.length-1;i>=0;i--){var n=this.views[i];if(n.hasDOF()&&n.containPoint(e.offsetX,e.offsetY)){this._picking.scene=n.scene,this._picking.camera=n.camera,t.viewport=n.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=n,a}}t.viewport=r};ce.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})};ce.prototype.pickObject=function(e,t){for(var r=[],i=this.renderer,n=i.viewport,a=0;a=0&&(h.dataIndex=this._lastDataIndex,h.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(c,"mouseout",t)),o=!0):s!=null&&s!==this._lastEventData&&(this._lastEventData!=null&&(h.eventData=this._lastEventData,this.zr.handler.dispatchToElement(c,"mouseout",t)),o=!0),this._lastEventData=s,this._lastDataIndex=n,this._lastSeriesIndex=a),h.eventData=s,h.dataIndex=n,h.seriesIndex=a,(s!=null||parseInt(n,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(c,e,t),o&&this.zr.handler.dispatchToElement(c,"mouseover",t))};ce.prototype._dispatchToView=function(e,t){for(var r=0;r=0&&(Lc(t),t.coordinateSystem==="mapbox"&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))}),kr(e.xAxis3D),kr(e.yAxis3D),kr(e.zAxis3D),kr(e.grid3D),dr(e.geo3D)}function Ua(e){this._layers={},this._zr=e}Ua.prototype.update=function(e,t){var r=this,i=t.getZr();if(!i.getWidth()||!i.getHeight()){console.warn("Dom has no width or height");return}function n(o){i.setSleepAfterStill(0);var l;o.coordinateSystem&&o.coordinateSystem.model,l=o.get("zlevel");var c=r._layers,h=c[l];if(!h){if(h=c[l]=new Fa("gl-"+l,i),i.painter.isSingleCanvas()){h.virtual=!0;var u=new Os({z:1e4,style:{image:h.renderer.canvas},silent:!0});h.__hostImage=u,i.add(u)}i.painter.insertLayer(l,h)}return h.__hostImage&&h.__hostImage.setStyle({width:h.renderer.getWidth(),height:h.renderer.getHeight()}),h}function a(o,l){o&&o.traverse(function(c){c.isRenderable&&c.isRenderable()&&(c.ignorePicking=c.$ignorePicking!=null?c.$ignorePicking:l)})}for(var s in this._layers)this._layers[s].removeViewsAll();e.eachComponent(function(o,l){if(o!=="series"){var c=t.getViewOfComponentModel(l),h=l.coordinateSystem;if(c.__ecgl__){var u;if(h){if(!h.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+l.id);return}u=h.viewGL}else{if(!l.viewGL){console.error("Can't find viewGL of component "+l.id);return}u=h.viewGL}var u=h.viewGL,d=n(l);d.addView(u),c.afterRender&&c.afterRender(l,e,t,d),a(c.groupGL,l.get("silent"))}}}),e.eachSeries(function(o){var l=t.getViewOfSeriesModel(o),c=o.coordinateSystem;if(l.__ecgl__){if(c&&!c.viewGL&&!l.viewGL){console.error("Can't find viewGL of series "+l.id);return}var h=c&&c.viewGL||l.viewGL,u=n(o);u.addView(h),l.afterRender&&l.afterRender(o,e,t,u),a(l.groupGL,o.get("silent"))}})};Ps(function(e){var t=e.getZr(),r=t.painter.dispose;t.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(i){i instanceof Fa&&i.dispose()}),r.call(this)},t.painter.getRenderedCanvas=function(i){if(i=i||{},this._singleCanvas)return this._layers[0].dom;var n=document.createElement("canvas"),a=i.pixelRatio||this.dpr;n.width=this.getWidth()*a,n.height=this.getHeight()*a;var s=n.getContext("2d");s.dpr=a,s.clearRect(0,0,n.width,n.height),i.backgroundColor&&(s.fillStyle=i.backgroundColor,s.fillRect(0,0,n.width,n.height));var o=this.storage.getDisplayList(!0),l={},c,h=this;function u(m,p){var _=h._zlevelList;m==null&&(m=-1/0);for(var T,y=0;y<_.length;y++){var g=_[y],E=h._layers[g];if(!E.__builtin__&&g>m&&g0&&this._notFirst?this.animateTo({alpha:c,beta:h,center:u,distance:a,orthographicSize:s,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(h),this.setCenter(u),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(e){var t=this.zr,r=this,i={},n={};return e.distance!=null&&(i.distance=this.getDistance(),n.distance=e.distance),e.orthographicSize!=null&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=e.orthographicSize),e.alpha!=null&&(i.alpha=this.getAlpha(),n.alpha=e.alpha),e.beta!=null&&(i.beta=this.getBeta(),n.beta=e.beta),e.center!=null&&(i.center=this.getCenter(),n.center=e.center),this._addAnimator(t.animation.animate(i).when(e.duration||1e3,n).during(function(){i.alpha!=null&&r.setAlpha(i.alpha),i.beta!=null&&r.setBeta(i.beta),i.distance!=null&&r.setDistance(i.distance),i.center!=null&&r.setCenter(i.center),i.orthographicSize!=null&&r.setOrthographicSize(i.orthographicSize),r._needsUpdate=!0})).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e0},_update:function(e){if(this._rotating){var t=(this.autoRotateDirection==="cw"?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){this._projection==="perspective"?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),r=this._orthoSize,i=r/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-i/2,t.right=i/2,t.top=r/2,t.bottom=-r/2},_updatePan:function(e){var t=this._panVelocity,r=this._distance,i=this.getCamera(),n=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-t.x*r/200).scaleAndAdd(n,-t.y*r/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new P,r=this._theta+Math.PI/2,i=this._phi+Math.PI/2,n=Math.sin(r);t.x=n*Math.cos(i),t.y=-Math.cos(r),t.z=n*Math.sin(i),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout(function(){t._rotating=!0},e*1e3))},_vectorDamping:function(e,t){var r=e.len();r=r*t,r<1e-4&&(r=0),e.normalize().scale(r)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),r=Math.atan2(e.x,e.z);this._theta=t,this._phi=-r,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?e.event.targetTouches.length===1&&(this._mode="rotate"):e.event.button===Zn[this.rotateMouseButton]?this._mode="rotate":e.event.button===Zn[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy)&&!this._isAnimating()){var t=$n(this.panSensitivity),r=$n(this.rotateSensitivity);this._mode==="rotate"?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):this._mode==="pan"&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(t!==0){var r=e.offsetX,i=e.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(r,i))){var n;this._projection==="perspective"?n=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):n=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&this._mode==="rotate"&&this._startCountingStill(),e.event.preventDefault()}}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return this.rotateMouseButton==="right"||this.panMouseButton==="right"},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done(function(){var r=t.indexOf(e);r>=0&&t.splice(r,1)}),e}});Object.defineProperty(Ha.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});const Fc=Ha,on={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var r in t)e||!t[r].value?t[r].value=[]:t[r].value=Array.prototype.slice.call(t[r].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},ci={vec2:H,vec3:x,vec4:D,mat2:xe,mat2d:Se,mat3:ee,mat4:C,quat:Y};var Mi=ci.vec3,Kn=[[0,0],[1,1]],za=Ae.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new Ae.Attribute("position","float",3,"POSITION"),positionPrev:new Ae.Attribute("positionPrev","float",3),positionNext:new Ae.Attribute("positionNext","float",3),prevPositionPrev:new Ae.Attribute("prevPositionPrev","float",3),prevPosition:new Ae.Attribute("prevPosition","float",3),prevPositionNext:new Ae.Attribute("prevPositionNext","float",3),offset:new Ae.Attribute("offset","float",1),color:new Ae.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(e===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(e*3):new Uint16Array(e*3))},_getCubicCurveApproxStep:function(e,t,r,i){var n=Mi.dist(e,t)+Mi.dist(r,t)+Mi.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?a*2:a*2+2},getCubicCurveTriangleCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:a*2},getLineVertexCount:function(){return this.getPolylineVertexCount(Kn)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(Kn)},getPolylineVertexCount:function(e){var t;if(typeof e=="number")t=e;else{var r=typeof e[0]!="number";t=r?e.length:e.length/3}return this.useNativeLine?(t-1)*2:(t-1)*2+2},getPolylineTriangleCount:function(e){var t;if(typeof e=="number")t=e;else{var r=typeof e[0]!="number";t=r?e.length:e.length/3}return this.useNativeLine?0:Math.max(t-1,0)*2},addCubicCurve:function(e,t,r,i,n,a){a==null&&(a=1);for(var s=e[0],o=e[1],l=e[2],c=t[0],h=t[1],u=t[2],d=r[0],f=r[1],v=r[2],m=i[0],p=i[1],_=i[2],T=this._getCubicCurveApproxStep(e,t,r,i),y=T*T,g=y*T,E=3*T,S=3*y,R=6*y,b=6*g,M=s-c*2+d,F=o-h*2+f,w=l-u*2+v,U=(c-d)*3-s+m,O=(h-f)*3-o+p,L=(u-v)*3-l+_,G=s,B=o,Z=l,I=(c-s)*E+M*S+U*g,ue=(h-o)*E+F*S+O*g,k=(u-l)*E+w*S+L*g,ye=M*R+U*b,ae=F*R+O*b,ve=w*R+L*b,me=U*b,Oe=O*b,Be=L*b,Re=0,ze=0,Ze=Math.ceil(1/T),Fe=new Float32Array((Ze+1)*3),Fe=[],rt=0,ze=0;ze1&&(G=I>0?Math.min(G,m):Math.max(G,m),B=ue>0?Math.min(B,p):Math.max(B,p),Z=k>0?Math.min(Z,_):Math.max(Z,_));return this.addPolyline(Fe,n,a)},addLine:function(e,t,r,i){return this.addPolyline([e,t],r,i)},addPolyline:function(e,t,r,i,n){if(e.length){var a=typeof e[0]!="number";if(n==null&&(n=a?e.length:e.length/3),!(n<2)){i==null&&(i=0),r==null&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var a=typeof e[0]!="number",s=a?typeof t[0]!="number":t.length/4===n,o=this.attributes.position,l=this.attributes.positionPrev,c=this.attributes.positionNext,h=this.attributes.color,u=this.attributes.offset,d=this.indices,f=this._vertexOffset,v,m;r=Math.max(r,.01);for(var p=i;p1&&(o.copy(f,f-1),h.copy(f,f-1),f++):(p0&&(c.set(f-2,v),c.set(f-1,v)),o.set(f,v),o.set(f+1,v),h.set(f,m),h.set(f+1,m),u.set(f,r/2),u.set(f+1,-r/2),f+=2),this.useNativeLine)h.set(f,m),o.set(f,v),f++;else if(p>0){var y=this._triangleOffset*3,d=this.indices;d[y]=f-4,d[y+1]=f-3,d[y+2]=f-2,d[y+3]=f-3,d[y+4]=f-1,d[y+5]=f-2,this._triangleOffset+=2}}if(!this.useNativeLine){var g=this._vertexOffset,E=this._vertexOffset+n*2;l.copy(g,g+2),l.copy(g+1,g+3),c.copy(E-1,E-3),c.copy(E-2,E-4)}return this._vertexOffset=f,this._vertexOffset}}},setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],i=es&&(n=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,r),a+r+l>o)return null;e.x+=this.offsetX*this.dpr+n,e.y+=this.offsetY*this.dpr+a,this._zr.add(e);var c=[this.offsetX/this.width,this.offsetY/this.height],h=[[n/s+c[0],a/o+c[1]],[(n+t)/s+c[0],(a+r)/o+c[1]]];return h},_fitElement:function(e,t,r){var i=e.getBoundingRect(),n=t/i.width,a=r/i.height;e.x=-i.x*n,e.y=-i.y*a,e.scaleX=n,e.scaleY=a,e.update()}};function Wi(e){e=e||{},e.width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=e.gap==null?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new ne({image:t,flipY:!1});var r=this;this._zr=Bs(t);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new ei(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}Wi.prototype={clear:function(){for(var e=0;e=e)){var a=(i+this._nodeWidth)*this._dpr,s=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:s})}catch{this._canvas.width=a,this._canvas.height=s}var o=new ei(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(o),o}},add:function(e,t,r){if(this._coords[e.id])return this._coords[e.id];var i=this._getCurrentNode().add(e,t,r);if(!i){var n=this._expand();if(!n)return;i=n.add(e,t,r)}return this._coords[e.id]=i,i},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}};function Xi(){}Xi.prototype={constructor:Xi,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new V.DirectionalLight({shadowBias:.005}),this.ambientLight=new V.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,r=this.ambientLight,i=e.getModel("light"),n=i.getModel("main"),a=i.getModel("ambient");t.intensity=n.get("intensity"),r.intensity=a.get("intensity"),t.color=V.parseColor(n.get("color")).slice(0,3),r.color=V.parseColor(a.get("color")).slice(0,3);var s=n.get("alpha")||0,o=n.get("beta")||0;t.position.setArray(V.directionFromAlphaBeta(s,o)),t.lookAt(V.Vector3.ZERO),t.castShadow=n.get("shadow"),t.shadowResolution=V.getShadowResolution(n.get("shadowQuality"))},updateAmbientCubemap:function(e,t,r){var i=t.getModel("light.ambientCubemap"),n=i.get("texture");if(n){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[n];if(!a){var s=this;a=this._cubemapLightsCache[n]=V.createAmbientCubemap(i.option,e,r,function(){s._isSkyboxFromAmbientCubemap&&s._skybox.setEnvironmentMap(a.specular.cubemap),r.getZr().refresh()})}this._lightRoot.add(a.diffuse),this._lightRoot.add(a.specular),this._currentCubemapLights=a}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,r){var i=t.get("environment"),n=this;function a(){return n._skybox=n._skybox||new yr,n._skybox}var s=a();if(i&&i!=="none")if(i==="auto")if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var o=this._currentCubemapLights.specular.cubemap;s.setEnvironmentMap(o),this._scene&&s.attachScene(this._scene),s.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if(typeof i=="object"&&i.colorStops||typeof i=="string"&&ua(i)){this._isSkyboxFromAmbientCubemap=!1;var l=new V.Texture2D({anisotropic:8,flipY:!1});s.setEnvironmentMap(l);var c=l.image=document.createElement("canvas");c.width=c.height=16;var h=c.getContext("2d"),u=new fa({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});Fs(h,u),s.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=V.loadTexture(i,r,{anisotropic:8,flipY:!1});s.setEnvironmentMap(l),s.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var d=t.coordinateSystem;if(this._skybox)if(d&&d.viewGL&&i!=="auto"&&!(i.match&&i.match(/.hdr$/))){var f=d.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[f]("fragment","SRGB_DECODE")}else this._skybox.material.undefine("fragment","SRGB_DECODE")}};var Nt=ci.vec3,Ga=Ae.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new Ae.Attribute("position","float",3,"POSITION"),normal:new Ae.Attribute("normal","float",3,"NORMAL"),color:new Ae.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,r=this.getQuadVertexCount()*e,i=this.getQuadTriangleCount()*e;this.vertexCount!==r&&(t.position.init(r),t.normal.init(r),t.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(i*3):new Uint16Array(i*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=Nt.create(),t=Nt.create(),r=Nt.create(),i=[0,3,1,3,2,1];return function(n,a){var s=this.attributes.position,o=this.attributes.normal,l=this.attributes.color;Nt.sub(e,n[1],n[0]),Nt.sub(t,n[2],n[1]),Nt.cross(r,e,t),Nt.normalize(r,r);for(var c=0;c<4;c++)s.set(this._vertexOffset+c,n[c]),l.set(this._vertexOffset+c,a),o.set(this._vertexOffset+c,r);for(var h=this._faceOffset*3,c=0;c<6;c++)this.indices[h+c]=i[c]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});Ar(Ga.prototype,on);const Uc=Ga;var ji=tt.firstNotNull,Hc={x:0,y:2,z:1};function zc(e,t,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[Hc[r.dim]]=a,e.position.setArray(n),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),r.dim==="x"?(e.rotation.rotateY(i*Math.PI/2),t.normal.x=-i):r.dim==="z"?(e.rotation.rotateX(-i*Math.PI/2),t.normal.y=-i):(i>0&&e.rotation.rotateY(Math.PI),t.normal.z=-i)}function hi(e,t,r){this.rootNode=new V.Node;var i=new V.Mesh({geometry:new ln({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new V.Mesh({geometry:new Uc,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(n),this.rootNode.add(i),this.faceInfo=e,this.plane=new V.Plane,this.linesMesh=i,this.quadsMesh=n}hi.prototype.update=function(e,t,r){var i=e.coordinateSystem,n=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,s=this.quadsMesh.geometry;a.convertToDynamicArray(!0),s.convertToDynamicArray(!0),this._updateSplitLines(a,n,e,r),this._udpateSplitAreas(s,n,e,r),a.convertToTypedArray(),s.convertToTypedArray();var o=i.getAxis(this.faceInfo[2]);zc(this.rootNode,this.plane,o,this.faceInfo[3])};hi.prototype._updateSplitLines=function(e,t,r,i){var n=i.getDevicePixelRatio();t.forEach(function(a,s){var o=a.model,l=t[1-s].getExtent();if(!a.scale.isBlank()){var c=o.getModel("splitLine",r.getModel("splitLine"));if(c.get("show")){var h=c.getModel("lineStyle"),u=h.get("color"),d=ji(h.get("opacity"),1),f=ji(h.get("width"),1);u=mr(u)?u:[u];for(var v=a.getTicksCoords({tickModel:c}),m=0,p=0;p65535?new Uint32Array(r*3):new Uint16Array(r*3))},setSpriteAlign:function(e,t,r,i,n){r==null&&(r="left"),i==null&&(i="top");var a,s,o,l;switch(n=n||0,r){case"left":a=n,o=t[0]+n;break;case"center":case"middle":a=-t[0]/2,o=t[0]/2;break;case"right":a=-t[0]-n,o=-n;break}switch(i){case"bottom":s=n,l=t[1]+n;break;case"middle":s=-t[1]/2,l=t[1]/2;break;case"top":s=-t[1]-n,l=-n;break}var c=e*4,h=this.attributes.offset;h.set(c,[a,l]),h.set(c+1,[o,l]),h.set(c+2,[o,s]),h.set(c+3,[a,s])},addSprite:function(e,t,r,i,n,a){var s=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,r,i,n,a);for(var o=0;oi[1]?0:1,o=this._faces[r*2+s],l=this._faces[r*2+1-s];o.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),r=e.getAxis("y"),i=e.getAxis("z"),n=i.getExtentMax(),a=i.getExtentMin(),s=t.getExtentMin(),o=t.getExtentMax(),l=r.getExtentMax(),c=r.getExtentMin(),h=this._axes[0].rootNode,u=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,v=f[4].rootNode.invisible?c:l,m=f[2].rootNode.invisible?n:a,p=f[0].rootNode.invisible?s:o,_=f[2].rootNode.invisible?n:a,T=f[0].rootNode.invisible?o:s,y=f[4].rootNode.invisible?c:l;h.rotation.identity(),u.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,u.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,m,v),u.position.set(p,_,0),d.position.set(T,0,y),h.update(),u.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new V.Vector4,new V.Vector4],r=new V.Vector4;this.groupGL.getWorldPosition(r),r.w=1,r.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),r.x/=r.w,r.y/=r.w,this._axes.forEach(function(i){var n=i.axisLineCoords;i.labelsMesh.geometry;for(var a=0;ar.y?"bottom":"top"):(u="middle",h=l>r.x?"left":"right"),i.setSpriteAlign(h,u,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,r=t.dataToPoint(e),i=this._axisPointerLineMesh,n=i.geometry,a=this._model.getModel("axisPointer"),s=this._api.getDevicePixelRatio();n.convertToDynamicArray(!0);function o(b){return tt.firstNotNull(b.model.get("axisPointer.show"),a.get("show"))}function l(b){var M=b.model.getModel("axisPointer",a),F=M.getModel("lineStyle"),w=V.parseColor(F.get("color")),U=Jn(F.get("width"),1),O=Jn(F.get("opacity"),1);return w[3]*=O,{color:w,lineWidth:U}}for(var c=0;c 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end";var At=["px","nx","py","ny","pz","nz"];N.import(Yc);function Pi(e,t,r){if(r==="alphaMap")return e.material.get("diffuseMap");if(r==="alphaCutoff"){if(e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")){var i=e.material.get("alphaCutoff");return i||0}return 0}else return r==="uvRepeat"?e.material.get("uvRepeat"):r==="uvOffset"?e.material.get("uvOffset"):t.get(r)}function ta(e,t){var r=e.material,i=t.material;return r.get("diffuseMap")!==i.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(i.get("alphaCutoff")||0)}var ft=qe.extend(function(){return{softShadow:ft.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new Ue,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new Xa}},function(){this._gaussianPassH=new Ve({fragment:N.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new Ve({fragment:N.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new Ve({fragment:N.source("clay.sm.debug_depth")})},{render:function(e,t,r,i){r||(r=t.getMainCamera()),this.trigger("beforerender",this,e,t,r),this._renderShadowPass(e,t,r,i),this.trigger("afterrender",this,e,t,r)},renderDebug:function(e,t){e.saveClear();var r=e.viewport,i=0,n=0,a=t||r.width/4,s=a;this.softShadow===ft.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM");for(var o in this._textures){var l=this._textures[o];e.setViewport(i,n,a*l.width/l.height,s),this._outputDepthPass.setUniform("depthMap",l),this._outputDepthPass.render(e),i+=a*l.width/l.height}e.setViewport(r),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===ft.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var r=this.kernelPCF;r&&r.length?t.material.define("fragment","PCF_KERNEL_SIZE",r.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var r=this;t.traverse(function(a){a.isRenderable()&&r._updateReceivers(e,a)});for(var i=0;i4){console.warn("Support at most 4 cascade");continue}v.shadowCascade>1&&(d=v),this.renderDirectionalLightShadow(e,t,r,v,h,c,l)}else v.type==="SPOT_LIGHT"?this.renderSpotLightShadow(e,t,v,o,s):v.type==="POINT_LIGHT"&&this.renderPointLightShadow(e,t,v,u);this._shadowMapNumber[v.type]++}for(var m in this._shadowMapNumber)for(var p=this._shadowMapNumber[m],_=m+"_SHADOWMAP_COUNT",f=0;f0?y.define("fragment",_,p):y.isDefined("fragment",_)&&y.undefine("fragment",_))}for(var f=0;f0){var S=l.map(E);if(g.directionalLightShadowMaps={value:l,type:"tv"},g.directionalLightMatrices={value:c,type:"m4v"},g.directionalLightShadowMapSizes={value:S,type:"1fv"},d){var R=h.slice(),b=h.slice();R.pop(),b.shift(),R.reverse(),b.reverse(),c.reverse(),g.shadowCascadeClipsNear={value:R,type:"1fv"},g.shadowCascadeClipsFar={value:b,type:"1fv"}}}if(s.length>0){var M=s.map(E),g=t.shadowUniforms;g.spotLightShadowMaps={value:s,type:"tv"},g.spotLightMatrices={value:o,type:"m4v"},g.spotLightShadowMapSizes={value:M,type:"1fv"}}u.length>0&&(g.pointLightShadowMaps={value:u,type:"tv"})},renderDirectionalLightShadow:function(){var e=new tn,t=new z,r=new ke,i=new z,n=new z,a=new z,s=new z;return function(o,l,c,h,u,d,f){var v=this._getDepthMaterial(h),m={getMaterial:function(ve){return ve.shadowDepthMaterial||v},isMaterialChanged:ta,getUniform:Pi,ifRender:function(ve){return ve.castShadow},sortCompare:vr.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var p=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(p).applyTransform(c.viewMatrix)}var _=Math.min(-l.viewBoundingBoxLastFrame.min.z,c.far),T=Math.max(-l.viewBoundingBoxLastFrame.max.z,c.near),y=this._getDirectionalLightCamera(h,l,c),g=a.array;s.copy(y.projectionMatrix),C.invert(n.array,y.worldTransform.array),C.multiply(n.array,n.array,c.worldTransform.array),C.multiply(g,s.array,n.array);for(var E=[],S=c instanceof Ne,R=(c.near+c.far)/(c.near-c.far),b=2*c.near*c.far/(c.near-c.far),M=0;M<=h.shadowCascade;M++){var F=T*Math.pow(_/T,M/h.shadowCascade),w=T+(_-T)*M/h.shadowCascade,U=F*h.cascadeSplitLogFactor+w*(1-h.cascadeSplitLogFactor);E.push(U),u.push(-(-U*R+b)/-U)}var O=this._getTexture(h,h.shadowCascade);f.push(O);var L=o.viewport,G=o.gl;this._frameBuffer.attach(O),this._frameBuffer.bind(o),G.clear(G.COLOR_BUFFER_BIT|G.DEPTH_BUFFER_BIT);for(var M=0;MF?M>w?v[S>0?"px":"nx"]=!0:v[b>0?"pz":"nz"]=!0:F>w?v[R>0?"py":"ny"]=!0:v[b>0?"pz":"nz"]=!0}for(var g=0;g0){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}});const Er=Zc;var $c=qe.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){typeof e=="string"&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t=t.COLOR_ATTACHMENT0&&l<=t.COLOR_ATTACHMENT0+8&&h.push(l);c.drawBuffersEXT(h)}e.saveClear(),e.clearBit=A.DEPTH_BUFFER_BIT|A.COLOR_BUFFER_BIT,r=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),i.unbind(e)}this.trigger("afterrender",r),this._rendering=!1,this._rendered=!0}});const eh=Jc;var th=Er.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});const rh=th;var ih=Er.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var e=new Ve({fragment:this.shader});this.pass=e},{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var r=e.gl;for(var i in this.inputLinks){var n=this.inputLinks[i],a=n.node.getOutput(e,n.pin);this.pass.setUniform(i,a)}if(!this.outputs)this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);else{this.pass.outputs={};var s={};for(var o in this.outputs){var l=this.updateParameter(o,e);isNaN(l.width)&&this.updateParameter(o,e);var c=this.outputs[o],h=this._compositor.allocateTexture(l);this._outputTextures[o]=h;var u=c.attachment||r.COLOR_ATTACHMENT0;typeof u=="string"&&(u=r[u]),s[u]=h}this._compositor.getFrameBuffer().bind(e);for(var u in s)this._compositor.getFrameBuffer().attach(s[u],u);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}for(var i in this.inputLinks){var n=this.inputLinks[i];n.node.removeReference(n.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var r=this.outputs[e],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var s,o;return typeof i.width=="function"?s=i.width.call(this,t):s=i.width,typeof i.height=="function"?o=i.height.call(this,t):o=i.height,s=Math.ceil(s),o=Math.ceil(o),(n.width!==s||n.height!==o)&&this._outputTextures[e]&&this._outputTextures[e].dispose(t),n.width=s,n.height=o,n},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){if(this._outputReferences[e]--,this._outputReferences[e]===0){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}},clear:function(){Er.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const nh=ih,ah="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end",ja="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",sh="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end",Ya="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",oh="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end",qa="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",Za="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",$a="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",Ka="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",Qa="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",lh="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end",Ja="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",es="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";function ch(e){e.import(ah),e.import(ja),e.import(sh),e.import(Ya),e.import(oh),e.import(qa),e.import(Za),e.import($a),e.import(Ka),e.import(Qa),e.import(lh),e.import(Ja),e.import(es)}ch(N);var hh=/^#source\((.*?)\)/;function uh(e,t){var r=new Qc;t=t||{};var i={textures:{},parameters:{}},n=function(o,l){for(var c=0;c0;)r=r+i*(n%t),n=Math.floor(n/t),i=i/t;return r}const gh="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n";N.import(gh);function rs(e){for(var t=new Uint8Array(e*e*4),r=0,i=new P,n=0;n=1?.95:0,weight2:i>=1?.05:1}),f.render(e)),c.attach(o),u.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),u.render(e),c.attach(l),d.setUniform("texture",o),d.render(e),c.unbind(e),this._physicallyCorrect){var _=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=_}};Tt.prototype.getTargetTexture=function(){return this._texture3};Tt.prototype.setParameter=function(e,t){e==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)};Tt.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=Zr.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e};Tt.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")};Tt.prototype.isFinished=function(e){return this._physicallyCorrect?e>this._totalSamples/this._samplePerFrame:!0};Tt.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};const na=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925],Th="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end";N.import(Th);function Di(e,t,r,i,n){var a=e.gl;t.setUniform(a,"1i",r,n),a.activeTexture(a.TEXTURE0+n),i.isRenderable()?i.bind(e):i.unbind(e)}function Eh(e,t,r,i,n){var a,s,o,l,c=e.gl;return function(h,u,d){if(!(l&&l.material===h.material)){var f=h.material,v=h.__program,m=f.get("roughness");m==null&&(m=1);var p=f.get("normalMap")||t,_=f.get("roughnessMap"),T=f.get("bumpMap"),y=f.get("uvRepeat"),g=f.get("uvOffset"),E=f.get("detailUvRepeat"),S=f.get("detailUvOffset"),R=!!T&&f.isTextureEnabled("bumpMap"),b=!!_&&f.isTextureEnabled("roughnessMap"),M=f.isDefined("fragment","DOUBLE_SIDED");T=T||r,_=_||i,d!==u?(u.set("normalMap",p),u.set("bumpMap",T),u.set("roughnessMap",_),u.set("useBumpMap",R),u.set("useRoughnessMap",b),u.set("doubleSide",M),y!=null&&u.set("uvRepeat",y),g!=null&&u.set("uvOffset",g),E!=null&&u.set("detailUvRepeat",E),S!=null&&u.set("detailUvOffset",S),u.set("roughness",m)):(v.setUniform(c,"1f","roughness",m),a!==p&&Di(e,v,"normalMap",p,0),s!==T&&T&&Di(e,v,"bumpMap",T,1),o!==_&&_&&Di(e,v,"roughnessMap",_,2),y!=null&&v.setUniform(c,"2f","uvRepeat",y),g!=null&&v.setUniform(c,"2f","uvOffset",g),E!=null&&v.setUniform(c,"2f","detailUvRepeat",E),S!=null&&v.setUniform(c,"2f","detailUvOffset",S),v.setUniform(c,"1i","useBumpMap",+R),v.setUniform(c,"1i","useRoughnessMap",+b),v.setUniform(c,"1i","doubleSide",+M)),a=p,s=T,o=_,l=h}}}function nr(e){this._depthTex=new ne({format:q.DEPTH_COMPONENT,type:q.UNSIGNED_INT}),this._normalTex=new ne({type:q.HALF_FLOAT}),this._framebuffer=new Ue,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,Ue.DEPTH_ATTACHMENT),this._normalMaterial=new yt({shader:new N(N.source("ecgl.normal.vertex"),N.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=Ft.createBlank("#000"),this._defaultBumpMap=Ft.createBlank("#000"),this._defaultRoughessMap=Ft.createBlank("#000"),this._debugPass=new Ve({fragment:N.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}nr.prototype.getDepthTexture=function(){return this._depthTex};nr.prototype.getNormalTexture=function(){return this._normalTex};nr.prototype.update=function(e,t,r){var i=e.getWidth(),n=e.getHeight(),a=this._depthTex,s=this._normalTex,o=this._normalMaterial;a.width=i,a.height=n,s.width=i,s.height=n;var l=t.getRenderList(r).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,r,{getMaterial:function(){return o},ifRender:function(c){return c.renderNormal},beforeRender:Eh(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)};nr.prototype.renderDebug=function(e){this._debugPass.render(e)};nr.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)};function br(e){e=e||{},this._edgePass=new Ve({fragment:N.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new ne({type:q.HALF_FLOAT}),this._frameBuffer=new Ue,this._frameBuffer.attach(this._targetTexture)}br.prototype.update=function(e,t,r,i){var n=e.getWidth(),a=e.getHeight(),s=this._targetTexture;s.width=n,s.height=a;var o=this._frameBuffer;o.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[n,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(e),o.unbind(e)};br.prototype.getTargetTexture=function(){return this._targetTexture};br.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)};br.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};const Ah={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]},Sh="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end",bh="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end";N.import(ja);N.import(Ya);N.import(qa);N.import(Za);N.import($a);N.import(Ka);N.import(Qa);N.import(Ja);N.import(es);N.import(Sh);N.import(bh);function is(e,t){return{color:{parameters:{width:e,height:t}}}}var un=["composite","FXAA"];function J(){this._width,this._height,this._dpr,this._sourceTexture=new ne({type:q.HALF_FLOAT}),this._depthTexture=new ne({format:q.DEPTH_COMPONENT,type:q.UNSIGNED_INT}),this._framebuffer=new Ue,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,Ue.DEPTH_ATTACHMENT),this._normalPass=new nr,this._compositor=uh(Ah);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(i){return this._compositor.getNodeByName(i)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=un.map(function(i){return this._compositor.getNodeByName(i)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new xt(r),this._ssrPass=new Tt(r),this._edgePass=new br(r)}J.prototype.resize=function(i,n,r){r=r||1;var i=i*r,n=n*r,a=this._sourceTexture,s=this._depthTexture;a.width=i,a.height=n,s.width=i,s.height=n;var o={getWidth:function(){return i},getHeight:function(){return n},getDevicePixelRatio:function(){return r}};function l(c,h){if(typeof c[h]=="function"){var u=c[h].__original||c[h];c[h]=function(d){return u.call(this,o)},c[h].__original=u}}this._compositor.nodes.forEach(function(c){for(var h in c.outputs){var u=c.outputs[h].parameters;u&&(l(u,"width"),l(u,"height"))}for(var d in c.parameters)l(c.parameters,d)}),this._width=i,this._height=n,this._dpr=r};J.prototype.getWidth=function(){return this._width};J.prototype.getHeight=function(){return this._height};J.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR};J.prototype._getPrevNode=function(e){for(var t=un.indexOf(e.name)-1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)t-=1,r=this._finalNodesChain[t];return r};J.prototype._getNextNode=function(e){for(var t=un.indexOf(e.name)+1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)t+=1,r=this._finalNodesChain[t];return r};J.prototype._addChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(e.inputs.texture=t.name,r?(e.outputs=is(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))};J.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(r?(t.outputs=is(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))};J.prototype.updateNormal=function(e,t,r,i){this._ifRenderNormalPass()&&this._normalPass.update(e,t,r)};J.prototype.updateSSAO=function(e,t,r,i){this._ssaoPass.update(e,r,i)};J.prototype.enableSSAO=function(){this._enableSSAO=!0};J.prototype.disableSSAO=function(){this._enableSSAO=!1};J.prototype.enableSSR=function(){this._enableSSR=!0};J.prototype.disableSSR=function(){this._enableSSR=!1};J.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()};J.prototype.getSourceFrameBuffer=function(){return this._framebuffer};J.prototype.getSourceTexture=function(){return this._sourceTexture};J.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)};J.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)};J.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()};J.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()};J.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()};J.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()};J.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0};J.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1};J.prototype.enableEdge=function(){this._enableEdge=!0};J.prototype.disableEdge=function(){this._enableEdge=!1};J.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)};J.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var r={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break}};J.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var r=0;r=this._haltonSequence.length},render:function(e,t,r){var i=this._blendPass;this._frame===0?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),i.render(e),this._blendFb.unbind(e),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var n=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=n,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}};function _e(e){e=e||"perspective",this.layer=null,this.scene=new Ct,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new J,this._temporalSS=new qi,this._shadowMapPass=new qc;for(var t=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(rr(r,2)*4-2),n.push(rr(r,3)*4-2),r++;t.push(n)}this._pcfKernels=t,this.scene.on("beforerender",function(s,o,l){this.needsTemporalSS()&&this._temporalSS.jitterProjection(s,l)},this)}_e.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),e==="perspective"?this.camera instanceof Ne||(this.camera=new Ne,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof xr||(this.camera=new xr,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3};_e.prototype.setViewport=function(e,t,r,i,n){this.camera instanceof Ne&&(this.camera.aspect=r/i),n=n||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=r,this.viewport.height=i,this.viewport.devicePixelRatio=n,this._compositor.resize(r*n,i*n),this._temporalSS.resize(r*n,i*n)};_e.prototype.containPoint=function(e,t){var r=this.viewport,i=this.layer.renderer.getHeight();return t=i-t,e>=r.x&&t>=r.y&&e<=r.x+r.width&&t<=r.y+r.height};var aa=new $e;_e.prototype.castRay=function(e,t,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(e,t,aa),this.camera.castRay(aa,r),i.viewport=n,r};_e.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t30};_e.prototype._doRender=function(e,t,r){var i=this.scene,n=this.camera;r=r||0,this._updateTransparent(e,i,n,r),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,i,n,!0)),this._updateShadowPCFKernel(r);var a=e.clearColor;if(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n),this._compositor.updateNormal(e,i,n,this._temporalSS.getFrame())),this._updateSSAO(e,i,n,this._temporalSS.getFrame()),this._enablePostEffect){var s=this._compositor.getSourceFrameBuffer();s.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(i,n,!0,!0),s.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,i,n,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,i,n,null,0))}else if(this.needsTemporalSS()&&t){var s=this._temporalSS.getSourceFrameBuffer();s.bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(i,n,!0,!0),e.restoreClear(),s.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)}else e.setViewport(this.viewport),e.render(i,n,!0,!0)};_e.prototype._updateTransparent=function(e,t,r,i){for(var n=new P,a=new z,s=r.getWorldPosition(),o=t.getRenderList(r).transparent,l=0;lthis.camera.far||el&&o.push({pivot:Math.floor((c+l)/2),left:l,right:c});var l=a[s].pivot+1,c=a[s].right;c>l&&o.push({pivot:Math.floor((c+l)/2),left:l,right:c})}a=this._parts=o}else for(var s=0;s=2e4},doSortTriangles:function(e,t){var r=this.indices;if(t===0){var i=this.attributes.position,e=e.array;(!this._triangleZList||this._triangleZList.length!==this.triangleCount)&&(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var n=0,a,s=0;s"+d.join("
")}var n=e.getData(),a=e.getRawValue(t),s=mr(a)?i(a):wr(vn(a)),o=n.getName(t),l=Zi(n,t);js(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var c=Ys(l),h=e.name;return h==="\0-"&&(h=""),h=h?wr(h)+(r?": ":"
"):"",r?c+h+s:h+c+(o?wr(o)+": "+s:s)}function kh(e,t,r){r=r||e.getSource();var i=t||Zs(e.get("coordinateSystem"))||["x","y","z"],n=$s(r,{dimensionsDefine:r.dimensionsDefine||e.get("dimensions"),encodeDefine:r.encodeDefine||e.get("encode"),coordDimensions:i.map(function(o){var l=e.getReferringComponents(o+"Axis3D").models[0];return{type:l&&l.get("type")==="category"?"ordinal":"float",name:o}})});e.get("coordinateSystem")==="cartesian3D"&&n.forEach(function(o){if(i.indexOf(o.coordDim)>=0){var l=e.getReferringComponents(o.coordDim+"Axis3D").models[0];l&&l.get("type")==="category"&&(o.ordinalMeta=l.getOrdinalMeta())}});var a=Ks.enableDataStack(e,n,{byIndex:!0,stackedCoordDimension:"z"}),s=new Qs(n,e);return s.setCalculationInfo(a),s.initData(r),s}var ls=Js.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return Gh(this,e)},getInitialData:function(e,t){var r=e.data;function i(Z){return!(isNaN(Z.min)||isNaN(Z.max)||isNaN(Z.step))}function n(Z){var I=va;return Math.max(I(Z.min),I(Z.max),I(Z.step))+1}if(!r)if(e.parametric){var g=e.parametricEquation||{},E=g.u||{},S=g.v||{};["u","v"].forEach(function(I){i(g[I])}),["x","y","z"].forEach(function(I){g[I]});var R=Math.floor((E.max+E.step-E.min)/E.step),b=Math.floor((S.max+S.step-S.min)/S.step);r=new Float32Array(R*b*5);for(var M=n(E),F=n(S),d=0,f=0;f0;this._updateSurfaceMesh(this._surfaceMesh,e,h,f);var v=this._surfaceMesh.material;f?(v.define("WIREFRAME_QUAD"),v.set("wireframeLineWidth",d),v.set("wireframeLineColor",V.parseColor(u.get("lineStyle.color")))):v.undefine("WIREFRAME_QUAD"),this._initHandler(e,r),this._updateAnimation(e)},_updateAnimation:function(e){V.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new V.Mesh({geometry:new V.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new V.Material({shader:new V.Shader(V.Shader.source("ecgl.sm.depth.vertex"),V.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,Hh),e},_initHandler:function(e,t){var r=e.getData(),i=this._surfaceMesh,n=e.coordinateSystem;function a(o,l){for(var c=1/0,h=-1,u=[],d=0;d=0){var c=[];i.geometry.attributes.position.get(l,c);for(var h=n.pointToData(c),u=1/0,d=-1,f=[],v=0;v65535?Uint32Array:Uint16Array)((v-1)*(m-1)*6),S=function(ct,Gt,vt){vt[1]=ct*m+Gt,vt[0]=ct*m+Gt+1,vt[3]=(ct+1)*m+Gt+1,vt[2]=(ct+1)*m+Gt},R=!1;if(l){var b=[],M=[],F=0;_?h.init(n.vertexCount):h.value=null;for(var w=[[],[],[]],U=[],O=[],L=It.create(),G=function(ct,Gt,vt){var ui=Gt*3;return vt[0]=ct[ui],vt[1]=ct[ui+1],vt[2]=ct[ui+2],vt},B=new Float32Array(s.length),Z=new Float32Array(s.length/3*4),I=0;I0;){if(Math.floor(o/h)===o/h)return[h,o/h];h--}return h=Math.floor(Math.sqrt(o)),[h,h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function jh(e){e.registerChartView(Xh),e.registerSeriesModel(Vh),e.registerLayout(function(t,r){t.eachSeriesByType("surface",function(i){var n=i.coordinateSystem;!n||n.type;var a=i.getData(),s=new Float32Array(3*a.count()),o=[NaN,NaN,NaN];if(n&&n.type==="cartesian3D"){var l=n.dimensions,c=l.map(function(h){return i.coordDimToDataDim(h)[0]});a.each(c,function(h,u,d,f){var v;a.hasValue(f)?v=n.dataToPoint([h,u,d]):v=o,s[f*3]=v[0],s[f*3+1]=v[1],s[f*3+2]=v[2]})}a.setLayout("points",s)})})}var Yh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,cs=(e,t,r,i)=>{for(var n=i>1?void 0:i?qh(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&Yh(t,r,n),n};to([ro,io,Fh,jh]);let ni=class extends us(fs,ds,vs){constructor(){super(...arguments),this.mdiGrid=ms,this.mdiHome=ps,this.mdiInformation=_s,this.mdiStackOverflow=gs,this.mdiLockOutline=ys,this.mdiCloseThick=xs,this.mdiPencil=Ts,this.mdiDelete=Es,this.mdiProgressUpload=As,this.renameDialog=!1,this.removeDialogProfile="",this.removeDialog=!1,this.saveConfigDialog=!1,this.calibrateDialog={boolShow:!1,name:"default",isInvalidName:!1},this.newName="",this.oldName="",this.isInvalidName=!0,this.createInputRules=[e=>!!e||this.$t("Heightmap.InvalidNameEmpty"),e=>e===e.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")],this.renameInputRules=[e=>!!e||this.$t("Heightmap.InvalidNameEmpty"),e=>e!=="default"||this.$t("Heightmap.InvalidNameReserved"),e=>!this.existsProfileName(e)||this.$t("Heightmap.InvalidNameAlreadyExists"),e=>e===e.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")],this.probedOpacity=1,this.meshOpacity=1,this.flatOpacity=.5,this.fontSizeVisualMap=14}get chartOptions(){return{tooltip:{backgroundColor:this.bgColor(.9),borderWidth:0,textStyle:{color:this.fgColor(1),fontSize:"14px"},padding:15,formatter:this.tooltipFormatter},darkMode:this.$vuetify.theme.dark,animation:!1,legend:{show:!1,selected:this.selected},visualMap:{show:!0,min:this.visualMapRange[0],max:this.visualMapRange[1],calculable:!0,dimension:2,inRange:{color:this.colorMap},seriesIndex:this.visualMapSeriesIndex,left:this.isMobile?10:30,top:20,bottom:0,itemWidth:this.isMobile?10:30,itemHeight:550,precision:3,textStyle:{color:this.fgColorHi,fontSize:this.fontSizeVisualMap}},xAxis3D:{type:"value",nameTextStyle:{color:this.fgColorMid},min:this.rangeX[0],max:this.rangeX[1],minInterval:1},yAxis3D:{type:"value",nameTextStyle:{color:this.fgColorMid},min:this.rangeY[0],max:this.rangeY[1]},zAxis3D:{type:"value",min:this.scaleZMax*-1,max:this.scaleZMax,nameTextStyle:{color:this.fgColorMid},axisPointer:{label:{formatter:function(e){return e=parseFloat(e),e.toFixed(2)}}}},grid3D:{axisLabel:{textStyle:{color:this.fgColorMid}},axisLine:{lineStyle:{color:this.fgColorLow}},axisTick:{lineStyle:{color:this.fgColorLow}},splitLine:{lineStyle:{color:this.fgColorLow}},axisPointer:{lineStyle:{color:this.fgColorHi},label:{textStyle:{color:this.fgColorHi}}},boxWidth:100*this.scaleX,boxDepth:100*this.scaleY,viewControl:{distance:150}},series:this.series}}get chart(){var e,t;return(t=(e=this.$refs.heightmap)==null?void 0:e.chart)!=null?t:null}get profiles(){return this.$store.getters["printer/getBedMeshProfiles"]}get bed_mesh(){var e;return(e=this.$store.state.printer.bed_mesh)!=null?e:null}get currentProfileName(){var e,t;return(t=(e=this.bed_mesh)==null?void 0:e.profile_name)!=null?t:""}get currentProfile(){return this.profiles.find(e=>e.name===this.currentProfileName)}bed_meshChanged(){var e;(e=this.chart)==null||e.setOption(this.chartOptions)}get showProbed(){var e;return(e=this.$store.state.gui.view.heightmap.probed)!=null?e:!0}set showProbed(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.probed",value:e})}get showMesh(){var e;return(e=this.$store.state.gui.view.heightmap.mesh)!=null?e:!0}set showMesh(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.mesh",value:e})}get showFlat(){var e;return(e=this.$store.state.gui.view.heightmap.flat)!=null?e:!0}set showFlat(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.flat",value:e})}get wireframe(){var e;return(e=this.$store.state.gui.view.heightmap.wireframe)!=null?e:!0}set wireframe(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.wireframe",value:e})}get scaleGradient(){var e;return(e=this.$store.state.gui.view.heightmap.scaleGradient)!=null?e:!1}set scaleGradient(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.scaleGradient",value:e})}get absRangeX(){return this.rangeX[1]-this.rangeX[0]}get absRangeY(){return this.rangeY[1]-this.rangeY[0]}get minRangeXY(){return Math.min(this.absRangeX,this.absRangeY)}get scaleX(){return this.minRangeXY===0?1:this.absRangeX/this.minRangeXY}get scaleY(){return this.minRangeXY===0?1:this.absRangeY/this.minRangeXY}get scaleZMax(){var e;return(e=this.$store.state.gui.view.heightmap.scaleZMax)!=null?e:.5}set scaleZMax(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.scaleZMax",value:e})}get rangeX(){var r,i,n,a;const e=(r=this.$store.state.printer.toolhead)==null?void 0:r.axis_minimum,t=(i=this.$store.state.printer.toolhead)==null?void 0:i.axis_maximum;return[(n=e[0])!=null?n:0,(a=t[0])!=null?a:0]}get rangeY(){var r,i,n,a,s,o;const e=(i=(r=this.$store.state.printer.toolhead)==null?void 0:r.axis_minimum)!=null?i:[0,0],t=(a=(n=this.$store.state.printer.toolhead)==null?void 0:n.axis_maximum)!=null?a:[0,0];return[(s=e[1])!=null?s:0,(o=t[1])!=null?o:0]}get heightmapLimit(){let e=0,t=0;if(this.bed_mesh){const r=[];if(this.showProbed)for(const i of this.bed_mesh.probed_matrix)for(const n of i)r.push(n);if(this.showMesh)for(const i of this.bed_mesh.mesh_matrix)for(const n of i)r.push(n);e=Math.min(e,...r),t=Math.max(t,...r)}return[e,t]}get probedHeightmapLimit(){let e=0,t=0;return this.currentProfile&&(e=this.currentProfile.min,t=this.currentProfile.max),[e,t]}get heightmapRangeLimit(){const[e,t]=this.heightmapLimit,r=Math.round(Math.max(Math.abs(e),Math.abs(t))*10)/10,i=Math.max(r,1);return[r,i]}get selected(){return{probed:this.showProbed,mesh:this.showMesh,flat:this.showFlat}}get series(){const e=[];return this.bed_mesh&&(e.push(this.seriesProbed),e.push(this.seriesMesh),e.push(this.seriesFlat)),e}get seriesProbed(){const e={type:"surface",name:"probed",data:[],itemStyle:{opacity:this.probedOpacity},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.probed_matrix[0].length,r=this.bed_mesh.probed_matrix.length,i=this.bed_mesh.mesh_min[0],n=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(n-i)/(t-1),l=(s-a)/(r-1),c=[];let h=0;this.bed_mesh.probed_matrix.forEach(u=>{let d=0;u.forEach(f=>{c.push([i+o*d,a+l*h,f]),d++}),h++}),e.data=c,e.dataShape=[r,t]}return e}get seriesMesh(){const e={type:"surface",name:"mesh",data:[],itemStyle:{opacity:this.meshOpacity},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.mesh_matrix[0].length,r=this.bed_mesh.mesh_matrix.length,i=this.bed_mesh.mesh_min[0],n=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(n-i)/(t-1),l=(s-a)/(r-1),c=[];let h=0;this.bed_mesh.mesh_matrix.forEach(u=>{let d=0;u.forEach(f=>{c.push([i+o*d,a+l*h,f]),d++}),h++}),e.data=c,e.dataShape=[r,t]}return e}get seriesFlat(){var r,i;const e={type:"surface",name:"flat",data:[],itemStyle:{color:[1,1,1,1],opacity:this.flatOpacity},wireframe:{show:this.wireframe}},t=(i=(r=this.$store.state.printer.configfile)==null?void 0:r.settings)==null?void 0:i.bed_mesh;if(t){let n=[1,1];t.probe_count&&typeof t.probe_count=="string"?n=t.probe_count.split(","):t.probe_count?n=t.probe_count.length<2?[t.probe_count,t.probe_count]:t.probe_count:t.round_probe_count&&(n=[t.round_probe_count,t.round_probe_count]);let a=[],s=[];t.mesh_min&&t.mesh_max?(a=typeof t.mesh_min=="string"?t.mesh_min.split(","):t.mesh_min,s=typeof t.mesh_max=="string"?t.mesh_max.split(","):t.mesh_max):(a=[t.mesh_radius*-1,t.mesh_radius*-1],s=[t.mesh_radius,t.mesh_radius]);const o=n[0],l=n[1],c=parseFloat(a[0]),h=parseFloat(s[0]),u=parseFloat(a[1]),d=parseFloat(s[1]),f=(h-c)/(o-1),v=(d-u)/(l-1),m=[];for(let p=0;p{Math.max(...a)===e&&(t=s+1,r=a.findIndex(o=>o===e)+1)});const i=Math.round((this.bed_mesh.mesh_min[0]+(this.bed_mesh.mesh_max[0]-this.bed_mesh.mesh_min[0])/this.bedMeshXLength*(r-1))*10)/10,n=Math.round((this.bed_mesh.mesh_min[1]+(this.bed_mesh.mesh_max[1]-this.bed_mesh.mesh_min[1])/this.bedMeshYLength*(t-1))*10)/10;return{row:t,col:r,positionX:i,positionY:n,value:e}}get bedMeshMinPoint(){if(this.bed_mesh.profile_name==="")return{row:0,col:0,positionX:0,positionY:0,value:0};const[e]=this.probedHeightmapLimit;let t=0,r=0;this.bed_mesh.probed_matrix.forEach((a,s)=>{Math.min(...a)===e&&(t=s+1,r=a.findIndex(o=>o===e)+1)});const i=Math.round((this.bed_mesh.mesh_min[0]+(this.bed_mesh.mesh_max[0]-this.bed_mesh.mesh_min[0])/this.bedMeshXLength*(r-1))*10)/10,n=Math.round((this.bed_mesh.mesh_min[1]+(this.bed_mesh.mesh_max[1]-this.bed_mesh.mesh_min[1])/this.bedMeshYLength*(t-1))*10)/10;return{row:t,col:r,positionX:i,positionY:n,value:e}}get meshLoaded(){return this.bed_mesh!==null?this.bed_mesh.profile_name!=="":!1}get colorMap(){return this.$store.getters["gui/heightmap/getActiveColorSchemeList"]}tooltipFormatter(e){const t=[];return t.push(""+e.seriesName+""),Object.keys(e.encode).sort().forEach(r=>{t.push(""+r.toUpperCase()+": "+e.data[e.encode[r][0]].toFixed(r==="z"?3:1)+" mm")}),t.join("
")}loadProfile(e){const t='BED_MESH_PROFILE LOAD="'+e+'"';this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t},{loading:"bedMeshLoad_"+e})}openRenameProfile(){var e,t;this.newName=(t=(e=this.bed_mesh)==null?void 0:e.profile_name)!=null?t:"",this.oldName=this.bed_mesh.profile_name,this.renameDialog=!0,this.isInvalidName=!1,setTimeout(()=>{var r;(r=this.$refs.inputDialogRenameHeightmapName)==null||r.focus()},200)}existsProfileName(e){return this.profiles.findIndex(t=>t.name===e)>=0}renameProfile(){this.renameDialog=!1;const e='BED_MESH_PROFILE SAVE="'+this.newName+'"',t='BED_MESH_PROFILE REMOVE="'+this.oldName+'"';this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshRename"}),this.$socket.emit("printer.gcode.script",{script:t},{loading:"bedMeshRename"}),this.newName="",this.oldName=""}openRemoveProfile(e){this.removeDialogProfile=e,this.removeDialog=!0}removeProfile(){this.removeDialog=!1;const e='BED_MESH_PROFILE REMOVE="'+this.removeDialogProfile+'"';this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{action:"printer/removeBedMeshProfile",actionPayload:{name:this.removeDialogProfile},loading:"bedMeshRename_"+this.removeDialogProfile}),this.removeDialogProfile="",this.saveConfigDialog=!0}homePrinter(){const e="G28";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"homeAll"})}clearBedMesh(){const e="BED_MESH_CLEAR";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshClear"})}openCalibrateMesh(){this.calibrateDialog.name="default",this.calibrateDialog.boolShow=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldCalibrateBedMeshName)==null||e.focus()},200)}calibrateMesh(){this.calibrateDialog.boolShow=!1;const e='BED_MESH_CALIBRATE PROFILE="'+this.calibrateDialog.name+'"';this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshCalibrate"})}saveConfig(){const e="SAVE_CONFIG";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"topbarSaveConfig"}),this.saveConfigDialog=!1}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}};cs([Ss("bed_mesh",{deep:!0})],ni.prototype,"bed_meshChanged",1);ni=cs([bs({components:{Panel:St}})],ni);var Zh=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.klipperReadyForGui?r(it,[r(Me,{staticClass:"col-12 col-md-8 pb-0"},[r(St,{attrs:{"card-class":"heightmap-map-panel",title:e.$t("Heightmap.Heightmap"),icon:e.mdiGrid},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Te,{staticClass:"d-none d-sm-flex",attrs:{icon:"",tile:"",disabled:e.printerIsPrinting,color:e.homedAxes.includes("xyz")?"primary":"warning",loading:e.loadings.includes("homeAll"),title:e.$t("Heightmap.TitleHomeAll"),ripple:!0},on:{click:e.homePrinter}},[r(ht,[e._v(e._s(e.mdiHome))])],1),e.meshLoaded?r(Te,{staticClass:"d-none d-sm-flex",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshClear"),title:e.$t("Heightmap.TitleClear")},on:{click:e.clearBedMesh}},[e._v(" "+e._s(e.$t("Heightmap.Clear"))+" ")]):e._e(),r(Te,{staticClass:"d-none d-sm-flex",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshCalibrate"),disabled:e.printerIsPrinting,title:e.$t("Heightmap.TitleCalibrate")},on:{click:e.openCalibrateMesh}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])]},proxy:!0}],null,!1,2015509893)},[r(nt,{staticClass:"d-sm-none text-center pb-0"},[r(no,{staticClass:"v-btn-toggle",attrs:{tile:"",name:"controllers"}},[r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",disabled:e.printerIsPrinting,color:e.homedAxes.includes("xyz")?"primary":"warning",loading:e.loadings.includes("homeAll"),title:e.$t("Heightmap.TitleHomeAll")},on:{click:e.homePrinter}},[r(ht,{attrs:{color:e.homedAxes.includes("xyz")?"primary":"warning",small:""}},[e._v(" "+e._s(e.mdiHome)+" ")])],1),e.bed_mesh?r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",color:"primary",loading:e.loadings.includes("bedMeshClear"),title:e.$t("Heightmap.TitleClear")},on:{click:e.clearBedMesh}},[e._v(" "+e._s(e.$t("Heightmap.Clear"))+" ")]):e._e(),r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",color:"primary",loading:e.loadings.includes("bedMeshCalibrate"),disabled:e.printerIsPrinting,title:e.$t("Heightmap.TitleCalibrate")},on:{click:e.openCalibrateMesh}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])],1)],1),e.meshLoaded?[r(nt,{staticClass:"py-0 px-0"},[r(it,[r(Me,{},[r("e-chart",{ref:"heightmap",staticStyle:{height:"600px",width:"100%",overflow:"hidden"},attrs:{option:e.chartOptions,"init-options":{renderer:"canvas"}}})],1)],1),r(it,[r(Me,{staticClass:"col-12 col-sm-auto pt-0 pb-0 pl-lg-6 d-flex justify-center justify-sm-start"},[r(ao,{staticClass:"mt-0 ml-5",attrs:{label:e.$t("Heightmap.ScaleGradient")},model:{value:e.scaleGradient,callback:function(i){e.scaleGradient=i},expression:"scaleGradient"}})],1),r(Me,{staticClass:"d-flex justify-center pt-0 pb-6 pb-lg-3"},[r(Rr,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Probed"),"hide-details":""},model:{value:e.showProbed,callback:function(i){e.showProbed=i},expression:"showProbed"}}),r(Rr,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Mesh"),"hide-details":""},model:{value:e.showMesh,callback:function(i){e.showMesh=i},expression:"showMesh"}}),r(Rr,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Flat"),"hide-details":""},model:{value:e.showFlat,callback:function(i){e.showFlat=i},expression:"showFlat"}}),r(Rr,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Wireframe"),"hide-details":""},model:{value:e.wireframe,callback:function(i){e.wireframe=i},expression:"wireframe"}})],1)],1)],1),r(kt),r(nt,{staticClass:"pt-0 pb-3"},[r(it,[r(Me,[r(so,{staticClass:"mt-4",attrs:{label:e.$t("Heightmap.ScaleZMax"),min:e.heightmapRangeLimit[0],max:e.heightmapRangeLimit[1],step:.1,ticks:"always","hide-details":""},model:{value:e.scaleZMax,callback:function(i){e.scaleZMax=i},expression:"scaleZMax"}})],1)],1)],1)]:[r(nt,{staticClass:"text-center py-3 font-italic"},[e._v(" "+e._s(e.$t("Heightmap.NoBedMeshHasBeenLoadedYet"))+" ")])]],2)],1),r(Me,{staticClass:"col-12 col-md-4"},[e.currentProfile?r(St,{staticClass:"mt-0",attrs:{title:e.$t("Heightmap.CurrentMesh.Headline"),"card-class":"heightmap-current-mesh-panel",icon:e.mdiInformation,collapsible:!0}},[r(nt,{staticClass:"py-3 px-0"},[r(it,{staticClass:"px-3"},[r(Me,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Name")))]),r(Me,{staticClass:"text-right"},[r("span",{staticClass:"currentMeshName font-weight-bold",on:{click:function(i){return e.openRenameProfile()}}},[r(ht,{attrs:{left:"",small:"",color:"primary"}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.currentProfileName)+" ")],1)])],1),r(kt,{staticClass:"my-3"}),"data"in e.currentProfile?r(it,{staticClass:"px-3"},[r(Me,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Size")))]),r(Me,{staticClass:"text-right"},[e._v(" "+e._s(e.currentProfile.data.x_count)+"x"+e._s(e.currentProfile.data.y_count)+" ")])],1):e._e(),r(kt,{staticClass:"my-3"}),r(it,{staticClass:"px-3"},[r(Me,[e._v(" "+e._s(e.$t("Heightmap.CurrentMesh.Max"))+" ["+e._s(e.bedMeshMaxPoint.positionX)+", "+e._s(e.bedMeshMaxPoint.positionY)+"] ")]),r(Me,{staticClass:"text-right"},[e._v(e._s(e.currentProfile.max.toFixed(3))+" mm")])],1),r(kt,{staticClass:"my-3"}),r(it,{staticClass:"px-3"},[r(Me,[e._v(" "+e._s(e.$t("Heightmap.CurrentMesh.Min"))+" ["+e._s(e.bedMeshMinPoint.positionX)+", "+e._s(e.bedMeshMinPoint.positionY)+"] ")]),r(Me,{staticClass:"text-right"},[e._v(e._s(e.currentProfile.min.toFixed(3))+" mm")])],1),r(kt,{staticClass:"my-3"}),r(it,{staticClass:"px-3"},[r(Me,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Range")))]),r(Me,{staticClass:"text-right"},[e._v(e._s(e.currentProfile.variance.toFixed(3))+" mm")])],1)],1)],1):e._e(),r(St,{staticClass:"mt-6 mt-md-0",attrs:{title:e.$t("Heightmap.Profiles"),"card-class":"heightmap-profiles-panel",icon:e.mdiStackOverflow,collapsible:!0}},[e.profiles.length?r(nt,{staticClass:"px-0 py-3"},[e._l(e.profiles,function(i,n){return[n?r(kt,{key:"deliver_"+n,staticClass:"my-3"}):e._e(),r(it,{key:n,staticClass:"rowProfile"},[r(Me,{staticClass:"pl-6 py-0 colName"},[r("span",{class:i.is_active?"current":"",staticStyle:{cursor:"pointer"},on:{click:function(a){i.is_active?e.openRenameProfile():e.loadProfile(i.name)}}},[e._v(" "+e._s(i.name)+" ")])]),r(Me,{staticClass:"text-center py-0 colVariance"},[r(oo,{attrs:{top:"",color:"rgba(0,0,0,0.8)"},scopedSlots:e._u([{key:"activator",fn:function(a){var s=a.on,o=a.attrs;return[r("small",e._g(e._b({},"small",o,!1),s),[e._v(" "+e._s(i.variance.toFixed(3))+" ")])]}}],null,!0)},[r("span",[e._v(" max: "+e._s(i.max)+" "),r("br"),e._v(" min: "+e._s(i.min)+" ")])])],1),r(Me,{staticClass:"py-0 colActions"},[i.is_active?r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshLoad_"+i.name)},on:{click:e.openRenameProfile}},[r(ht,[e._v(e._s(e.mdiPencil))])],1):r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshLoad_"+i.name)},on:{click:function(a){return e.loadProfile(i.name)}}},[r(ht,[e._v(e._s(e.mdiProgressUpload))])],1),r(Te,{staticClass:"px-2 minwidth-0",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshRemove_"+i.name),title:e.$t("Heightmap.DeleteBedMeshProfile")},on:{click:function(a){return e.openRemoveProfile(i.name)}}},[r(ht,[e._v(e._s(e.mdiDelete))])],1)],1)],1)]})],2):r(nt,[r("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Heightmap.NoProfile")))])])],1)],1)],1):r(it,[r(lo,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:e.mdiLockOutline}},[e._v(" "+e._s(e.$t("Heightmap.ErrorKlipperNotReady"))+" ")])],1),r(Mr,{attrs:{persistent:"","max-width":400},on:{keydown:function(i){if(!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;e.renameDialog=!1}},model:{value:e.renameDialog,callback:function(i){e.renameDialog=i},expression:"renameDialog"}},[r(St,{attrs:{title:e.$t("Heightmap.RenameBedMeshProfile"),icon:e.mdiGrid,"card-class":"heightmap-rename-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Te,{attrs:{icon:"",tile:""},on:{click:function(i){e.renameDialog=!1}}},[r(ht,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(nt,[r(mn,{ref:"inputDialogRenameHeightmapName",attrs:{label:e.$t("Heightmap.Name"),required:"",rules:e.renameInputRules},on:{"update:error":function(i){e.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.renameProfile.apply(null,arguments)}},model:{value:e.newName,callback:function(i){e.newName=i},expression:"newName"}})],1),r(Nr,[r(Lr),r(Te,{attrs:{text:""},on:{click:function(i){e.renameDialog=!1}}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Te,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameProfile}},[e._v(" "+e._s(e.$t("Heightmap.Rename"))+" ")])],1)],1)],1),r(Mr,{attrs:{persistent:"","max-width":400},on:{keydown:function(i){if(!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;e.calibrateDialog.boolShow=!1}},model:{value:e.calibrateDialog.boolShow,callback:function(i){e.$set(e.calibrateDialog,"boolShow",i)},expression:"calibrateDialog.boolShow"}},[r(St,{attrs:{title:e.$t("Heightmap.BedMeshCalibrate"),icon:e.mdiGrid,"card-class":"heightmap-calibrate-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Te,{attrs:{icon:"",tile:""},on:{click:function(i){e.calibrateDialog.boolShow=!1}}},[r(ht,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(nt,[r(mn,{ref:"inputFieldCalibrateBedMeshName",attrs:{label:e.$t("Heightmap.Name"),rules:e.createInputRules,required:""},on:{"update:error":function(i){e.calibrateDialog.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.calibrateMesh.apply(null,arguments)}},model:{value:e.calibrateDialog.name,callback:function(i){e.$set(e.calibrateDialog,"name",i)},expression:"calibrateDialog.name"}})],1),r(Nr,[r(Lr),r(Te,{attrs:{text:""},on:{click:function(i){e.calibrateDialog.boolShow=!1}}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Te,{attrs:{disabled:e.calibrateDialog.isInvalidName,color:"primary",text:""},on:{click:e.calibrateMesh}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])],1)],1)],1),r(Mr,{attrs:{persistent:"","max-width":400},on:{keydown:function(i){if(!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;e.removeDialog=!1}},model:{value:e.removeDialog,callback:function(i){e.removeDialog=i},expression:"removeDialog"}},[r(St,{attrs:{title:e.$t("Heightmap.BedMeshRemove"),icon:e.mdiGrid,"card-class":"heightmap-remove-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Te,{attrs:{icon:"",tile:""},on:{click:function(i){e.removeDialog=!1}}},[r(ht,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(nt,[r("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Heightmap.DoYouReallyWantToDelete",{name:e.removeDialogProfile})))])]),r(Nr,[r(Lr),r(Te,{attrs:{text:""},on:{click:function(i){e.removeDialog=!1}}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Te,{attrs:{color:"error",text:""},on:{click:e.removeProfile}},[e._v(e._s(e.$t("Heightmap.Remove")))])],1)],1)],1),r(Mr,{attrs:{persistent:"","max-width":400},on:{keydown:function(i){if(!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;e.saveConfigDialog=!1}},model:{value:e.saveConfigDialog,callback:function(i){e.saveConfigDialog=i},expression:"saveConfigDialog"}},[r(St,{attrs:{title:e.$t("Heightmap.SAVE_CONFIG"),icon:e.mdiGrid,"card-class":"heightmap-remove-save-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Te,{attrs:{icon:"",tile:""},on:{click:function(i){e.saveConfigDialog=!1}}},[r(ht,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(nt,[r("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Heightmap.RemoveSaveDescription")))])]),r(Nr,[r(Lr),e.printerIsPrinting?[r(Te,{attrs:{text:""},on:{click:function(i){e.saveConfigDialog=!1}}},[e._v(e._s(e.$t("Heightmap.Ok")))])]:[r(Te,{attrs:{color:"primary",text:""},on:{click:e.saveConfig}},[e._v(" "+e._s(e.$t("Heightmap.SAVE_CONFIG"))+" ")]),r(Te,{attrs:{text:""},on:{click:function(i){e.saveConfigDialog=!1}}},[e._v(e._s(e.$t("Heightmap.Later")))])]],2)],1)],1)],1)},$h=[];const ha={};var Kh=ws(ni,Zh,$h,!1,Qh,"37c48ba8",null,null);function Qh(e){for(let t in ha)this[t]=ha[t]}const iu=function(){return Kh.exports}();export{iu as default}; diff --git a/dirs/mainsail/assets/Hlsstreamer-886899b4.js b/dirs/mainsail/assets/Hlsstreamer-886899b4.js deleted file mode 100644 index 92ed8e9..0000000 --- a/dirs/mainsail/assets/Hlsstreamer-886899b4.js +++ /dev/null @@ -1 +0,0 @@ -import{m as nr,B as ar,G as or,P as ai,j as lr,n as cr}from"./index-97b4652c.js";import"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";function hr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var oi={exports:{}};(function(a,t){(function(e){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var f=o.parseURL(l);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var g=i.exec(f.path);f.netLoc=g[1],f.path=g[2]}f.netLoc&&!f.path&&(f.path="/");var p={scheme:f.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(p.netLoc=f.netLoc,d.path[0]!=="/"))if(!d.path)p.path=f.path,d.params||(p.params=f.params,d.query||(p.query=f.query));else{var T=f.path,y=T.substring(0,T.lastIndexOf("/")+1)+d.path;p.path=o.normalizePath(y)}return p.path===null&&(p.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(p)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})(oi);var je=oi.exports;function us(a,t){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),e.push.apply(e,s)}return e}function ct(a){for(var t=1;t")):_t}function mr(a,...t){t.forEach(function(e){Kt[e]=a[e]?a[e].bind(a):gr(e)})}function pr(a,t){if(self.console&&a===!0||typeof a=="object"){mr(a,"debug","log","info","warn","error");try{Kt.log('Debug logs enabled for "'.concat(t,'" in hls.js version 1.4.12'))}catch{Kt=Ue}}else Kt=Ue}const x=Kt,Tr=/^(\d+)x(\d+)$/,ds=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Q{constructor(t){typeof t=="string"&&(t=Q.parseAttrList(t));for(const e in t)t.hasOwnProperty(e)&&(e.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(e)),this[e]=t[e])}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(e.length&1?"0":"")+e;const s=new Uint8Array(e.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const s=this[t];return s?parseFloat(s):e}enumeratedString(t){return this[t]}bool(t){return this[t]==="YES"}decimalResolution(t){const e=Tr.exec(this[t]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t){let e;const s={},i='"';for(ds.lastIndex=0;(e=ds.exec(t))!==null;){let r=e[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const n=e[1].trim();s[n]=r}return s}}function yr(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function xr(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class li{constructor(t,e){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,e){const s=e.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]!==s[i]){x.warn('DATERANGE tag attribute: "'.concat(i,'" does not match for tags with ID: "').concat(t.ID,'"')),this._badValueForSameId=i;break}t=tt(new Q({}),s,t)}if(this.attr=t,this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);F(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const t=this.duration;return t!==null?new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(F(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&F(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class ue{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var H={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ci{constructor(t){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[H.AUDIO]:null,[H.VIDEO]:null,[H.AUDIOVIDEO]:null},this.baseurl=t}setByteRange(t,e){const s=t.split("@",2),i=[];s.length===1?i[0]=e?e.byteRangeEndOffset:0:i[0]=parseInt(s[1]),i[1]=parseInt(s[0])+i[0],this._byteRange=i}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=je.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}}class me extends ci{constructor(t,e){super(e),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new ue,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=t}get decryptdata(){const{levelkeys:t}=this;if(!t&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!F(this.programDateTime))return null;const t=F(this.duration)?this.duration:0;return this.programDateTime+t*1e3}get encrypted(){var t;if((t=this._decryptdata)!=null&&t.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),s=e.length;if(s>1||s===1&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(t){if(this.levelkeys){const e=this.levelkeys[t];e&&!this._decryptdata&&(this._decryptdata=e.getDecryptData(this.sn))}}abortRequests(){var t,e;(t=this.loader)==null||t.abort(),(e=this.keyLoader)==null||e.abort()}setElementaryStreamInfo(t,e,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[t];if(!l){o[t]={startPTS:e,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,e),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[H.AUDIO]=null,t[H.VIDEO]=null,t[H.AUDIOVIDEO]=null}}class Er extends ci{constructor(t,e,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new ue,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=i;const n=t.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}const Sr=10;class vr{constructor(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t){this.advanced=!0,this.updated=!0;return}const e=this.lastPartSn-t.lastPartSn,s=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!s||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||e===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(t.misses*.6):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?F(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Sr}get drift(){const t=this.driftEndTime-this.driftStartTime;return t>0?(this.driftEnd-this.driftStart)*1e3/t:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var t;return(t=this.fragments)!=null&&t.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Xe(a){return Uint8Array.from(atob(a),t=>t.charCodeAt(0))}function Ar(a){const t=hi(a).subarray(0,16),e=new Uint8Array(16);return e.set(t,16-t.length),e}function Lr(a){const t=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};t(a,0,3),t(a,1,2),t(a,4,5),t(a,6,7)}function Rr(a){const t=a.split(":");let e=null;if(t[0]==="data"&&t.length===2){const s=t[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),e=Xe(n)):e=Ar(n)}}return e}function hi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),t=>t.charCodeAt(0))}var J={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},lt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function fs(a){switch(a){case lt.FAIRPLAY:return J.FAIRPLAY;case lt.PLAYREADY:return J.PLAYREADY;case lt.WIDEVINE:return J.WIDEVINE;case lt.CLEARKEY:return J.CLEARKEY}}var ui={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Ir(a){if(a===ui.WIDEVINE)return J.WIDEVINE}function gs(a){switch(a){case J.FAIRPLAY:return lt.FAIRPLAY;case J.PLAYREADY:return lt.PLAYREADY;case J.WIDEVINE:return lt.WIDEVINE;case J.CLEARKEY:return lt.CLEARKEY}}function pe(a){const{drmSystems:t,widevineLicenseUrl:e}=a,s=t?[J.FAIRPLAY,J.WIDEVINE,J.PLAYREADY,J.CLEARKEY].filter(i=>!!t[i]):[];return!s[J.WIDEVINE]&&e&&s.push(J.WIDEVINE),s}const di=function(){return typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function br(a,t,e,s){let i;switch(a){case J.FAIRPLAY:i=["cenc","sinf"];break;case J.WIDEVINE:case J.PLAYREADY:i=["cenc"];break;case J.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error("Unknown key-system: ".concat(a))}return Dr(i,t,e,s)}function Dr(a,t,e,s){return[{initDataTypes:a,persistentState:s.persistentState||"not-allowed",distinctiveIdentifier:s.distinctiveIdentifier||"not-allowed",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:t.map(r=>({contentType:'audio/mp4; codecs="'.concat(r,'"'),robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:e.map(r=>({contentType:'video/mp4; codecs="'.concat(r,'"'),robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function wt(a,t,e){return Uint8Array.prototype.slice?a.slice(t,e):new Uint8Array(Array.prototype.slice.call(a,t,e))}const ze=(a,t)=>t+10<=a.length&&a[t]===73&&a[t+1]===68&&a[t+2]===51&&a[t+3]<255&&a[t+4]<255&&a[t+6]<128&&a[t+7]<128&&a[t+8]<128&&a[t+9]<128,fi=(a,t)=>t+10<=a.length&&a[t]===51&&a[t+1]===68&&a[t+2]===73&&a[t+3]<255&&a[t+4]<255&&a[t+6]<128&&a[t+7]<128&&a[t+8]<128&&a[t+9]<128,ne=(a,t)=>{const e=t;let s=0;for(;ze(a,t);){s+=10;const i=de(a,t+6);s+=i,fi(a,t+10)&&(s+=10),t+=s}if(s>0)return a.subarray(e,e+s)},de=(a,t)=>{let e=0;return e=(a[t]&127)<<21,e|=(a[t+1]&127)<<14,e|=(a[t+2]&127)<<7,e|=a[t+3]&127,e},Cr=(a,t)=>ze(a,t)&&de(a,t+6)+10<=a.length-t,kr=a=>{const t=mi(a);for(let e=0;ea&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",_r=a=>{const t=String.fromCharCode(a[0],a[1],a[2],a[3]),e=de(a,4),s=10;return{type:t,size:e,data:a.subarray(s,s+e)}},mi=a=>{let t=0;const e=[];for(;ze(a,t);){const s=de(a,t+6);t+=10;const i=t+s;for(;t+8a.type==="PRIV"?Pr(a):a.type[0]==="W"?Or(a):Fr(a),Pr=a=>{if(a.size<2)return;const t=St(a.data,!0),e=new Uint8Array(a.data.subarray(t.length+1));return{key:a.type,info:t,data:e.buffer}},Fr=a=>{if(a.size<2)return;if(a.type==="TXXX"){let e=1;const s=St(a.data.subarray(e),!0);e+=s.length+1;const i=St(a.data.subarray(e));return{key:a.type,info:s,data:i}}const t=St(a.data.subarray(1));return{key:a.type,data:t}},Or=a=>{if(a.type==="WXXX"){if(a.size<2)return;let e=1;const s=St(a.data.subarray(e),!0);e+=s.length+1;const i=St(a.data.subarray(e));return{key:a.type,info:s,data:i}}const t=St(a.data);return{key:a.type,data:t}},Mr=a=>{if(a.data.byteLength===8){const t=new Uint8Array(a.data),e=t[3]&1;let s=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return s/=45,e&&(s+=4772185884e-2),Math.round(s)}},St=(a,t=!1)=>{const e=Nr();if(e){const c=e.decode(a);if(t){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let Te;function Nr(){return!Te&&typeof self.TextDecoder<"u"&&(Te=new self.TextDecoder("utf-8")),Te}const xt={hexDump:function(a){let t="";for(let e=0;e>24,a[t+1]=e>>16&255,a[t+2]=e>>8&255,a[t+3]=e&255}function $(a,t){const e=[];if(!t.length)return e;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===t[0])if(t.length===1)e.push(a.subarray(i+8,o));else{const l=$(a.subarray(i+8,o),t.slice(1));l.length&&Ur.apply(e,l)}i=o}return e}function Br(a){const t=[],e=a[0];let s=8;const i=B(a,s);s+=4;const r=0,n=0;e===0?s+=8:s+=16,s+=2;let o=a.length+n;const l=Ti(a,s);s+=2;for(let c=0;c>>31===1)return x.warn("SIDX has hierarchical references (not supported)"),null;const g=B(a,h);h+=4,t.push({referenceSize:d,subsegmentDuration:g,info:{duration:g/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:e,referencesCount:l,references:t}}function xi(a){const t=[],e=$(a,["moov","trak"]);for(let i=0;i{const r=B(i,4),n=t[r];n&&(n.default={duration:B(i,12),flags:B(i,20)})}),t}function $r(a,t){if(!a||!t)return a;const e=t.keyId;return e&&t.isCommonEncryption&&$(a,["moov","trak"]).forEach(i=>{const n=$(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=$(n,["enca"]);const l=o.length>0;l||(o=$(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);$(h,["sinf"]).forEach(d=>{const f=Ei(d);if(f){const g=f.subarray(8,24);g.some(p=>p!==0)||(x.log("[eme] Patching keyId in 'enc".concat(l?"a":"v",">sinf>>tenc' box: ").concat(xt.hexDump(g)," -> ").concat(xt.hexDump(e))),f.set(e,8))}})})}),a}function Ei(a){const t=$(a,["schm"])[0];if(t){const e=st(t.subarray(4,8));if(e==="cbcs"||e==="cenc")return $(a,["schi","tenc"])[0]}return x.error("[eme] missing 'schm' box"),null}function Gr(a,t){return $(t,["moof","traf"]).reduce((e,s)=>{const i=$(s,["tfdt"])[0],r=i[0],n=$(s,["tfhd"]).reduce((o,l)=>{const c=B(l,4),h=a[c];if(h){let u=B(i,4);if(r===1){if(u===ae)return x.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=ae+1,u+=B(i,8)}const d=h.timescale||9e4,f=u/d;if(isFinite(f)&&(o===null||fh+u.info.duration||0,0))}return n}return s||i}function Hr(a){const t=B(a,0);let e=8;t&1&&(e+=4),t&4&&(e+=4);let s=0;const i=B(a,4);for(let r=0;r{$(s,["tfhd"]).forEach(i=>{const r=B(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;$(s,["tfdt"]).forEach(l=>{const c=l[0];let h=B(l,4);if(c===0)h-=e*o,h=Math.max(h,0),ye(l,4,h);else{h*=Math.pow(2,32),h+=B(l,8),h-=e*o,h=Math.max(h,0);const u=Math.floor(h/(ae+1)),d=Math.floor(h%(ae+1));ye(l,4,u),ye(l,8,d)}})})})}function Wr(a){const t={valid:null,remainder:null},e=$(a,["moof"]);if(e){if(e.length<2)return t.remainder=a,t}else return t;const s=e[e.length-1];return t.valid=wt(a,0,s.byteOffset-8),t.remainder=wt(a,s.byteOffset-8),t}function Pt(a,t){const e=new Uint8Array(a.length+t.length);return e.set(a),e.set(t,a.length),e}function ms(a,t){const e=[],s=t.samples,i=t.timescale,r=t.id;let n=!1;return $(s,["moof"]).map(l=>{const c=l.byteOffset-8;$(l,["traf"]).map(u=>{const d=$(u,["tfdt"]).map(f=>{const g=f[0];let p=B(f,4);return g===1&&(p*=Math.pow(2,32),p+=B(f,8)),p/i})[0];return d!==void 0&&(a=d),$(u,["tfhd"]).map(f=>{const g=B(f,4),p=B(f,0)&16777215,T=(p&1)!==0,y=(p&2)!==0,S=(p&8)!==0;let E=0;const R=(p&16)!==0;let A=0;const k=(p&32)!==0;let D=8;g===r&&(T&&(D+=8),y&&(D+=4),S&&(E=B(f,D),D+=4),R&&(A=B(f,D),D+=4),k&&(D+=4),t.type==="video"&&(n=Yr(t.codec)),$(u,["trun"]).map(C=>{const _=C[0],I=B(C,0)&16777215,O=(I&1)!==0;let w=0;const V=(I&4)!==0,nt=(I&256)!==0;let j=0;const z=(I&512)!==0;let X=0;const P=(I&1024)!==0,M=(I&2048)!==0;let W=0;const Y=B(C,4);let K=8;O&&(w=B(C,K),K+=4),V&&(K+=4);let Z=w+c;for(let ht=0;ht>1&63;return e===39||e===40}else return(t&31)===6}function Si(a,t,e,s){const i=vi(a);let r=0;r+=t;let n=0,o=0,l=!1,c=0;for(;r=i.length)break;c=i[r++],n+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const h=i.length-r;if(!l&&n===4&&r16){const u=[];for(let g=0;g<16;g++){const p=i[r++].toString(16);u.push(p.length==1?"0"+p:p),(g===3||g===5||g===7||g===9)&&u.push("-")}const d=o-16,f=new Uint8Array(d);for(let g=0;gh)break}}function vi(a){const t=a.byteLength,e=[];let s=1;for(;s>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),t.length>0&&new DataView(r.buffer).setUint32(0,t.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return e&&e.byteLength>0&&new DataView(n.buffer).setUint32(0,e.byteLength,!1),Xr([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,e||new Uint8Array)}function Qr(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},e=new DataView(a),s=e.getUint32(0);if(a.byteLength!==s&&s>44||e.getUint32(4)!==1886614376||(t.version=e.getUint32(8)>>>24,t.version>1))return null;t.systemId=xt.hexDump(new Uint8Array(a,12,16));const r=e.getUint32(28);if(t.version===0){if(s-32=22&&(this.keyId=e.subarray(e.length-22,e.length-6));break;case lt.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=zr(s,null,e);const i=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Xe(h).subarray(0,16);Lr(u),this.keyId=u}}break}default:{let s=e.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=jt[this.uri];if(!s){const i=Object.keys(jt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),jt[this.uri]=s}this.keyId=s}return this}}function Jr(a){const t=new Uint8Array(16);for(let e=12;e<16;e++)t[e]=a>>8*(15-e)&255;return t}const Ai=/\{\$([a-zA-Z0-9-_]+)\}/g;function ps(a){return Ai.test(a)}function ot(a,t,e){if(a.variableList!==null||a.hasVariableRefs)for(let s=e.length;s--;){const i=e[s],r=t[i];r&&(t[i]=Be(a,r))}}function Be(a,t){if(a.variableList!==null||a.hasVariableRefs){const e=a.variableList;return t.replace(Ai,s=>{const i=s.substring(2,s.length-1),r=e==null?void 0:e[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'.concat(i,'"'))),s):r})}return t}function Ts(a,t,e){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in t){i=t.QUERYPARAM;try{const n=new self.URL(e).searchParams;if(n.has(i))r=n.get(i);else throw new Error('"'.concat(i,'" does not match any query parameter in URI: "').concat(e,'"'))}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: ".concat(n.message)))}}else i=t.NAME,r=t.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'.concat(i,'"'))):s[i]=r||""}function Zr(a,t,e){const s=t.IMPORT;if(e&&s in e){let i=a.variableList;i||(a.variableList=i={}),i[s]=e[s]}else a.playlistParsingError||(a.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'.concat(s,'"')))}function fe(){if(!(typeof self>"u"))return self.MediaSource||self.WebKitMediaSource}const tn={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},ys=fe();function en(a,t){const e=tn[t];return!!e&&e[a.slice(0,4)]===!0}function xe(a,t){var e;return(e=ys==null?void 0:ys.isTypeSupported("".concat(t||"video",'/mp4;codecs="').concat(a,'"')))!=null?e:!1}const xs=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Es=/#EXT-X-MEDIA:(.*)/g,sn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ss=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),rn=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class yt{static findGroup(t,e){for(let s=0;s2){let s=e.shift()+".";return s+=parseInt(e.shift()).toString(16),s+=("000"+parseInt(e.shift()).toString(16)).slice(-4),s}return t}static resolve(t,e){return je.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return sn.test(t)}static parseMasterPlaylist(t,e){const s=ps(t),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},r=[];xs.lastIndex=0;let n;for(;(n=xs.exec(t))!=null;)if(n[1]){var o;const c=new Q(n[1]);ot(i,c,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const h=Be(i,n[2]),u={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:yt.resolve(h,e)},d=c.decimalResolution("RESOLUTION");d&&(u.width=d.width,u.height=d.height),nn((c.CODECS||"").split(/[ ,]+/).filter(f=>f),u),u.videoCodec&&u.videoCodec.indexOf("avc1")!==-1&&(u.videoCodec=yt.convertAVC1ToAVCOTI(u.videoCodec)),(o=u.unknownCodecs)!=null&&o.length||r.push(u),i.levels.push(u)}else if(n[3]){const c=n[3],h=n[4];switch(c){case"SESSION-DATA":{const u=new Q(h);ot(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const d=u["DATA-ID"];d&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[d]=u);break}case"SESSION-KEY":{const u=vs(h,e,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):x.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'.concat(h,'"'));break}case"DEFINE":{{const u=new Q(h);ot(i,u,["NAME","VALUE","QUERYPARAM"]),Ts(i,u,e)}break}case"CONTENT-STEERING":{const u=new Q(h);ot(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:yt.resolve(u["SERVER-URI"],e),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=As(h);break}}}const l=r.length>0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Es.lastIndex=0;(i=Es.exec(t))!==null;){const c=new Q(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,ot(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const f={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?yt.resolve(c.URI,e):""};if(u!=null&&u.length){const g=yt.findGroup(u,f.groupId)||u[0];Ls(f,g,"audioCodec"),Ls(f,g,"textCodec")}d.push(f)}}return r}static parseLevelPlaylist(t,e,s,i,r,n){const o=new vr(e),l=o.fragments;let c=null,h=0,u=0,d=0,f=0,g=null,p=new me(i,e),T,y,S,E=-1,R=!1;for(Ss.lastIndex=0,o.m3u8=t,o.hasVariableRefs=ps(t);(T=Ss.exec(t))!==null;){R&&(R=!1,p=new me(i,e),p.start=d,p.sn=h,p.cc=f,p.level=s,c&&(p.initSegment=c,p.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null));const C=T[1];if(C){p.duration=parseFloat(C);const _=(" "+T[2]).slice(1);p.title=_||null,p.tagList.push(_?["INF",C,_]:["INF",C])}else if(T[3]){if(F(p.duration)){p.start=d,S&&bs(p,S,o),p.sn=h,p.level=s,p.cc=f,p.urlId=r,l.push(p);const _=(" "+T[3]).slice(1);p.relurl=Be(o,_),Rs(p,g),g=p,d+=p.duration,h++,u=0,R=!0}}else if(T[4]){const _=(" "+T[4]).slice(1);g?p.setByteRange(_,g):p.setByteRange(_)}else if(T[5])p.rawProgramDateTime=(" "+T[5]).slice(1),p.tagList.push(["PROGRAM-DATE-TIME",p.rawProgramDateTime]),E===-1&&(E=l.length);else{if(T=T[0].match(rn),!T){x.warn("No matches on slow regex match for level playlist!");continue}for(y=1;y0&&w.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=w.optionalFloat("PART-HOLD-BACK",0),o.holdBack=w.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const w=new Q(I);o.partTarget=w.decimalFloatingPoint("PART-TARGET");break}case"PART":{let w=o.partList;w||(w=o.partList=[]);const V=u>0?w[w.length-1]:void 0,nt=u++,j=new Q(I);ot(o,j,["BYTERANGE","URI"]);const z=new Er(j,p,e,nt,V);w.push(z),p.duration+=z.duration;break}case"PRELOAD-HINT":{const w=new Q(I);ot(o,w,["URI"]),o.preloadHint=w;break}case"RENDITION-REPORT":{const w=new Q(I);ot(o,w,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(w);break}default:x.warn("line parsed but not handled: ".concat(T));break}}}g&&!g.relurl?(l.pop(),d-=g.duration,o.partList&&(o.fragmentHint=g)):o.partList&&(Rs(p,g),p.cc=f,o.fragmentHint=p,S&&bs(p,S,o));const A=l.length,k=l[0],D=l[A-1];if(d+=o.skippedSegments*o.targetduration,d>0&&A&&D){o.averagetargetduration=d/A;const C=D.sn;o.endSN=C!=="initSegment"?C:0,o.live||(D.endList=!0),k&&(o.startCC=k.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=f,E>0&&an(l,E),o}}function vs(a,t,e){var s,i;const r=new Q(a);ot(e,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&x.error("Invalid IV: ".concat(r.IV));const u=o?yt.resolve(o,t):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Vt(n,u,h,d,l)}function As(a){const e=new Q(a).decimalFloatingPoint("TIME-OFFSET");return F(e)?e:null}function nn(a,t){["video","audio","text"].forEach(e=>{const s=a.filter(i=>en(i,e));if(s.length){const i=s.filter(r=>r.lastIndexOf("avc1",0)===0||r.lastIndexOf("mp4a",0)===0);t["".concat(e,"Codec")]=i.length>0?i[0]:s[0],a=a.filter(r=>s.indexOf(r)===-1)}}),t.unknownCodecs=a}function Ls(a,t,e){const s=t[e];s&&(a[e]=s)}function an(a,t){let e=a[t];for(let s=t;s--;){const i=a[s];if(!i)return;i.programDateTime=e.programDateTime-i.duration*1e3,e=i}}function Rs(a,t){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):t!=null&&t.programDateTime&&(a.programDateTime=t.endProgramDateTime),F(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Is(a,t,e,s){a.relurl=t.URI,t.BYTERANGE&&a.setByteRange(t.BYTERANGE),a.level=e,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function bs(a,t,e){a.levelkeys=t;const{encryptedFragments:s}=e;(!s.length||s[s.length-1].levelkeys!==t)&&Object.keys(t).some(i=>t[i].isCommonEncryption)&&s.push(a)}var G={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},U={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Ds(a){const{type:t}=a;switch(t){case G.AUDIO_TRACK:return U.AUDIO;case G.SUBTITLE_TRACK:return U.SUBTITLE;default:return U.MAIN}}function Ee(a,t){let e=a.url;return(e===void 0||e.indexOf("data:")===0)&&(e=t.url),e}class on{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(t){const e=this.hls.config,s=e.pLoader,i=e.loader,r=s||i,n=new r(e);return this.loaders[t.type]=n,n}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:s}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:G.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(t,e){const{id:s,level:i,url:r,deliveryDirectives:n}=e;this.load({id:s,level:i,responseType:"text",type:G.LEVEL,url:r,deliveryDirectives:n})}onAudioTrackLoading(t,e){const{id:s,groupId:i,url:r,deliveryDirectives:n}=e;this.load({id:s,groupId:i,level:null,responseType:"text",type:G.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(t,e){const{id:s,groupId:i,url:r,deliveryDirectives:n}=e;this.load({id:s,groupId:i,level:null,responseType:"text",type:G.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(t){var e;const s=this.hls.config;let i=this.getInternalLoader(t);if(i){const c=i.context;if(c&&c.url===t.url){x.trace("[playlist-loader]: playlist request ongoing");return}x.log("[playlist-loader]: aborting previous loader for type: ".concat(t.type)),i.abort()}let r;if(t.type===G.MANIFEST?r=s.manifestLoadPolicy.default:r=tt({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(t),(e=t.deliveryDirectives)!=null&&e.part){let c;if(t.type===G.LEVEL&&t.level!==null?c=this.hls.levels[t.level].details:t.type===G.AUDIO_TRACK&&t.id!==null?c=this.hls.audioTracks[t.id].details:t.type===G.SUBTITLE_TRACK&&t.id!==null&&(c=this.hls.subtitleTracks[t.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=tt({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const f=this.getInternalLoader(u);this.resetInternalLoader(u.type);const g=c.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),yt.isMediaPlaylist(g)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,f):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(t,o,l)}handleMasterPlaylist(t,e,s,i){const r=this.hls,n=t.data,o=Ee(t,s),l=yt.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(t,s,l.playlistParsingError,i,e);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:g}=l;this.variableList=g;const{AUDIO:p=[],SUBTITLES:T,"CLOSED-CAPTIONS":y}=yt.parseMasterPlaylistMedia(n,o,l);p.length&&!p.some(E=>!E.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(x.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Q({}),bitrate:0,url:""})),r.trigger(m.MANIFEST_LOADED,{levels:h,audioTracks:p,subtitles:T,captions:y,contentSteering:c,url:o,stats:e,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:g})}handleTrackOrLevelPlaylist(t,e,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Ee(t,s),u=F(o)?o:0,d=F(l)?l:u,f=Ds(s),g=yt.parseLevelPlaylist(t.data,h,d,f,u,this.variableList);if(c===G.MANIFEST){const p={attrs:new Q({}),bitrate:0,details:g,name:"",url:h};n.trigger(m.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:h,stats:e,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),s.levelDetails=g,this.handlePlaylistLoaded(g,t,e,s,i,r)}handleManifestParsingError(t,e,s,i,r){this.hls.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.MANIFEST_PARSING_ERROR,fatal:e.type===G.MANIFEST,url:t.url,err:s,error:s,reason:s.message,response:t,context:e,networkDetails:i,stats:r})}handleNetworkError(t,e,s=!1,i,r){let n="A network ".concat(s?"timeout":"error"+(i?" (status "+i.code+")":"")," occurred while loading ").concat(t.type);t.type===G.LEVEL?n+=": ".concat(t.level," id: ").concat(t.id):(t.type===G.AUDIO_TRACK||t.type===G.SUBTITLE_TRACK)&&(n+=" id: ".concat(t.id,' group-id: "').concat(t.groupId,'"'));const o=new Error(n);x.warn("[playlist-loader]: ".concat(n));let l=L.UNKNOWN,c=!1;const h=this.getInternalLoader(t);switch(t.type){case G.MANIFEST:l=s?L.MANIFEST_LOAD_TIMEOUT:L.MANIFEST_LOAD_ERROR,c=!0;break;case G.LEVEL:l=s?L.LEVEL_LOAD_TIMEOUT:L.LEVEL_LOAD_ERROR,c=!1;break;case G.AUDIO_TRACK:l=s?L.AUDIO_TRACK_LOAD_TIMEOUT:L.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case G.SUBTITLE_TRACK:l=s?L.SUBTITLE_TRACK_LOAD_TIMEOUT:L.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(t.type);const u={type:N.NETWORK_ERROR,details:l,fatal:c,url:t.url,loader:h,context:t,error:o,networkDetails:e,stats:r};if(i){const d=(e==null?void 0:e.url)||t.url;u.response=ct({url:d,data:void 0},i)}this.hls.trigger(m.ERROR,u)}handlePlaylistLoaded(t,e,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,f=Ee(e,i),g=Ds(i),p=typeof i.level=="number"&&g===U.MAIN?c:void 0;if(!t.fragments.length){const y=new Error("No Segments found in Playlist");o.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.LEVEL_EMPTY_ERROR,fatal:!1,url:f,error:y,reason:y.message,response:e,context:i,level:p,parent:g,networkDetails:r,stats:s});return}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const T=t.playlistParsingError;if(T){o.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.LEVEL_PARSING_ERROR,fatal:!1,url:f,error:T,reason:T.message,response:e,context:i,level:p,parent:g,networkDetails:r,stats:s});return}switch(t.live&&n&&(n.getCacheAge&&(t.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(t.ageHeader))&&(t.ageHeader=0)),l){case G.MANIFEST:case G.LEVEL:o.trigger(m.LEVEL_LOADED,{details:t,level:p||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case G.AUDIO_TRACK:o.trigger(m.AUDIO_TRACK_LOADED,{details:t,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case G.SUBTITLE_TRACK:o.trigger(m.SUBTITLE_TRACK_LOADED,{details:t,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function Li(a,t){let e;try{e=new Event("addtrack")}catch{e=document.createEvent("Event"),e.initEvent("addtrack",!1,!1)}e.track=a,t.dispatchEvent(e)}function Ri(a,t){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(t.id))try{if(a.addCue(t),!a.cues.getCueById(t.id))throw new Error("addCue is failed for: ".concat(t))}catch(s){x.debug("[texttrack-utils]: ".concat(s));try{const i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,a.addCue(i)}catch(i){x.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: ".concat(i))}}e==="disabled"&&(a.mode=e)}function Ut(a){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let e=a.cues.length;e--;)a.removeCue(a.cues[e]);t==="disabled"&&(a.mode=t)}function $e(a,t,e,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=cn(a.cues,t,e);for(let n=0;na[e].endTime)return-1;let s=0,i=e;for(;s<=i;){const r=Math.floor((i+s)/2);if(ta[r].startTime&&s-1)for(let r=i,n=a.length;r=t&&o.endTime<=e)s.push(o);else if(o.startTime>e)return s}return s}var Tt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const hn=.25;function Ge(){if(!(typeof self>"u"))return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Xt=(()=>{const a=Ge();try{new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Se(a,t){return a.getTime()/1e3-t}function un(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class dn{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(t,e){this.media=e.media}onMediaDetaching(){this.id3Track&&(Ut(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;eXt&&(u=Xt),u-h<=0&&(u=h+hn);for(let f=0;fh.type===Tt.audioId3&&l:i==="video"?c=h=>h.type===Tt.emsg&&o:c=h=>h.type===Tt.audioId3&&l||h.type===Tt.emsg&&o,$e(r,e,s,c)}}onLevelUpdated(t,{details:e}){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=e,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(f=>{i.removeCue(s[d].cues[f])}),delete s[d]}}const o=e.fragments[e.fragments.length-1];if(n.length===0||!F(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=Ge();for(let h=0;h{const D=r[k];return D.class===d.class&&D.id!==k&&D.startDate>d.startDate&&A.push(D),A},[]).sort((A,k)=>A.startDate.getTime()-k.startDate.getTime())[0];R&&(y=Se(R.startDate,l),p=!0)}const E=Object.keys(d.attr);for(let R=0;Rthis.timeupdate(),this.hls=t,this.config=t.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:t,levelDetails:e}=this;return t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const{levelDetails:t}=this;if(t===null)return null;const{holdBack:e,partHoldBack:s,targetduration:i}=t,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||e;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i,u=1;return c+Math.min(this.stallCount*u,h)}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency,s=this.levelDetails;if(t===null||e===null||s===null)return null;const i=s.edge,r=t-e-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:t}=this;return t===null?1:t.drift}get edgeStalled(){const{levelDetails:t}=this;if(t===null)return 0;const e=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t,levelDetails:e}=this;if(!t||!e)return 0;const s=t.buffered.length;return(s?t.buffered.end(s-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(m.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(m.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){this.levelDetails=e,e.advanced&&this.timeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(t,e){var s;e.details===L.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&x.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:t,levelDetails:e}=this;if(!t||!e)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+e.targetduration),c=o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(h,Math.max(1,u))}else t.playbackRate!==1&&t.playbackRate!==0&&(t.playbackRate=1)}estimateLiveEdge(){const{levelDetails:t}=this;return t===null?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return t===null?null:t-this.currentTime}}const Ke=["NONE","TYPE-0","TYPE-1",null];var Ht={No:"",Yes:"YES",v2:"v2"};function gn(a,t){const{canSkipUntil:e,canSkipDateRanges:s,endSN:i}=a,r=t!==void 0?t-i:0;return e&&re).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(t){const e=t%this.url.length;this._urlId!==e&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=e)}get audioGroupId(){var t;return(t=this.audioGroupIds)==null?void 0:t[this.urlId]}get textGroupId(){var t;return(t=this.textGroupIds)==null?void 0:t[this.urlId]}addFallback(t){this.url.push(t.url),this._attrs.push(t.attrs)}}function ve(a,t){const e=t.startPTS;if(F(e)){let s=0,i;t.sn>a.sn?(s=e-a.start,i=a):(s=a.start-e,i=t),i.duration!==s&&(i.duration=s)}else t.sn>a.sn?a.cc===t.cc&&a.minEndPTS?t.start=a.start+(a.minEndPTS-a.start):t.start=a.start+a.duration:t.start=Math.max(a.start-t.duration,0)}function Ii(a,t,e,s,i,r){s-e<=0&&(x.warn("Fragment should have a positive duration",t),s=e+t.duration,r=i+t.duration);let o=e,l=s;const c=t.startPTS,h=t.endPTS;if(F(c)){const T=Math.abs(c-e);F(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,o=Math.max(e,c),e=Math.min(e,c),i=Math.min(i,t.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,t.endDTS)}const u=e-t.start;t.start!==0&&(t.start=e),t.duration=s-t.start,t.startPTS=e,t.maxStartPTS=o,t.startDTS=i,t.endPTS=s,t.minEndPTS=l,t.endDTS=r;const d=t.sn;if(!a||da.endSN)return 0;let f;const g=d-a.startSN,p=a.fragments;for(p[g]=t,f=g;f>0;f--)ve(p[f],p[f-1]);for(f=g;f=0;l--){const c=s[l].initSegment;if(c){e=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(yn(a,t,(l,c)=>{l.relurl&&(i=l.cc-c.cc),F(l.startPTS)&&F(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),t.PTSKnown=t.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,c.urlId=l.urlId,l.initSegment&&(c.initSegment=l.initSegment,e=l.initSegment)}),e&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach(c=>{var h;(!c.initSegment||c.initSegment.relurl===((h=e)==null?void 0:h.relurl))&&(c.initSegment=e)}),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some(l=>!l),t.deltaUpdateFailed){x.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=t.skippedSegments;l--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=pn(a.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const n=t.fragments;if(i){x.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?Ii(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):bi(a,t),n.length&&(t.totalduration=t.edge-n[0].start),t.driftStartTime=a.driftStartTime,t.driftStart=a.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const l=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=l),t.driftEndTime=o,t.driftEnd=l}else t.driftEndTime=a.driftEndTime,t.driftEnd=a.driftEnd,t.advancedDateTime=a.advancedDateTime}function pn(a,t,e){const s=tt({},a);return e&&e.forEach(i=>{delete s[i]}),Object.keys(t).forEach(i=>{const r=new li(t[i].attr,s[i]);r.isValid?s[i]=r:x.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'.concat(JSON.stringify(t[i].attr),'"'))}),s}function Tn(a,t,e){if(a&&t){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=t[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?e(n,o):s--}}}function yn(a,t,e){const s=t.skippedSegments,i=Math.max(a.startSN,t.startSN)-t.startSN,r=(a.fragmentHint?1:0)+(s?t.endSN:Math.min(a.endSN,t.endSN))-t.startSN,n=t.startSN-a.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||He(t,s[e].start)}function He(a,t){if(t){const e=a.fragments;for(let s=a.skippedSegments;st){const r=s[s.length-1].duration*1e3;r499)}const Ci={search:function(a,t){let e=0,s=a.length-1,i=null,r=null;for(;e<=s;){i=(e+s)/2|0,r=a[i];const n=t(r);if(n>0)e=i+1;else if(n<0)s=i-1;else return r}return null}};function vn(a,t,e){if(t===null||!Array.isArray(a)||!a.length||!F(t))return null;const s=a[0].programDateTime;if(t<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(t>=(i||0))return null;e=e||0;for(let r=0;ra)return 0;const s=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0));return e.start+e.duration-s<=a?1:e.start-s>a&&e.start?-1:0}function An(a,t,e){const s=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0))*1e3;return(e.endProgramDateTime||0)-s>a}function Ln(a,t){return Ci.search(a,e=>e.cct?-1:0)}const Rn=3e5;var rt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},ft={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class In{constructor(t){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=x.log.bind(x,"[info]:"),this.warn=x.warn.bind(x,"[warning]:"),this.error=x.error.bind(x,"[error]:"),this.registerListeners()}registerListeners(){const t=this.hls;t.on(m.ERROR,this.onError,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(m.ERROR,this.onError,this),t.off(m.ERROR,this.onErrorOut,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(t){this.playlistError=0}stopLoad(){}getVariantLevelIndex(t){return(t==null?void 0:t.type)===U.MAIN?t.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(t,e){var s,i;if(e.fatal)return;const r=this.hls,n=e.context;switch(e.details){case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:e.errorAction=this.getFragRetryOrSwitchAction(e);return;case L.FRAG_PARSING_ERROR:if((s=e.frag)!=null&&s.gap){e.errorAction={action:rt.DoNothing,flags:ft.None};return}case L.FRAG_GAP:case L.FRAG_DECRYPT_ERROR:{e.errorAction=this.getFragRetryOrSwitchAction(e),e.errorAction.action=rt.SendAlternateToPenaltyBox;return}case L.LEVEL_EMPTY_ERROR:case L.LEVEL_PARSING_ERROR:{var o,l;const c=e.parent===U.MAIN?e.level:r.loadLevel;e.details===L.LEVEL_EMPTY_ERROR&&((o=e.context)!=null&&(l=o.levelDetails)!=null&&l.live)?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,c):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,c))}return;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,n.level));return;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.SUBTITLE_LOAD_ERROR:case L.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===G.AUDIO_TRACK&&n.groupId===c.audioGroupId||n.type===G.SUBTITLE_TRACK&&n.groupId===c.textGroupId)){e.errorAction=this.getPlaylistRetryOrSwitchAction(e,r.loadLevel),e.errorAction.action=rt.SendAlternateToPenaltyBox,e.errorAction.flags=ft.MoveAllAlternatesMatchingHost;return}}return;case L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h&&(e.errorAction={action:rt.SendAlternateToPenaltyBox,flags:ft.MoveAllAlternatesMatchingHDCP,hdcpLevel:h})}return;case L.BUFFER_ADD_CODEC_ERROR:case L.REMUX_ALLOC_ERROR:e.errorAction=this.getLevelSwitchAction(e,(i=e.level)!=null?i:r.loadLevel);return;case L.INTERNAL_EXCEPTION:case L.BUFFER_APPENDING_ERROR:case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:case L.LEVEL_SWITCH_ERROR:case L.BUFFER_STALLED_ERROR:case L.BUFFER_SEEK_OVER_HOLE:case L.BUFFER_NUDGE_ON_STALL:e.errorAction={action:rt.DoNothing,flags:ft.None};return}if(e.type===N.KEY_SYSTEM_ERROR){const c=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,c);return}}getPlaylistRetryOrSwitchAction(t,e){var s;const i=this.hls,r=_s(i.config.playlistLoadPolicy,t),n=this.playlistError++,o=(s=t.response)==null?void 0:s.code;if(le(r,n,oe(t),o))return{action:rt.RetryRequest,flags:ft.None,retryConfig:r,retryCount:n};const c=this.getLevelSwitchAction(t,e);return r&&(c.retryConfig=r,c.retryCount=n),c}getFragRetryOrSwitchAction(t){const e=this.hls,s=this.getVariantLevelIndex(t.frag),i=e.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=e.config,o=_s(t.details.startsWith("key")?n:r,t),l=e.levels.reduce((u,d)=>u+d.fragmentError,0);if(i){var c;t.details!==L.FRAG_GAP&&i.fragmentError++;const u=(c=t.response)==null?void 0:c.code;if(le(o,l,oe(t),u))return{action:rt.RetryRequest,flags:ft.None,retryConfig:o,retryCount:l}}const h=this.getLevelSwitchAction(t,s);return o&&(h.retryConfig=o,h.retryCount=l),h}getLevelSwitchAction(t,e){const s=this.hls;e==null&&(e=s.loadLevel);const i=this.hls.levels[e];if(i&&(i.loadError++,s.autoLevelEnabled)){var r,n;let o=-1;const{levels:l,loadLevel:c,minAutoLevel:h,maxAutoLevel:u}=s,d=(r=t.frag)==null?void 0:r.type,{type:f,groupId:g}=(n=t.context)!=null?n:{};for(let p=l.length;p--;){const T=(p+c)%l.length;if(T!==c&&T>=h&&T<=u&&l[T].loadError===0){const y=l[T];if(t.details===L.FRAG_GAP&&t.frag){const S=l[T].details;if(S){const E=Yt(t.frag,S.fragments,t.frag.start);if(E!=null&&E.gap)continue}}else{if(f===G.AUDIO_TRACK&&g===y.audioGroupId||f===G.SUBTITLE_TRACK&&g===y.textGroupId)continue;if(d===U.AUDIO&&i.audioGroupId===y.audioGroupId||d===U.SUBTITLE&&i.textGroupId===y.textGroupId)continue}o=T;break}}if(o>-1&&s.loadLevel!==o)return t.levelRetry=!0,this.playlistError=0,{action:rt.SendAlternateToPenaltyBox,flags:ft.None,nextAutoLevel:o}}return{action:rt.SendAlternateToPenaltyBox,flags:ft.MoveAllAlternatesMatchingHost}}onErrorOut(t,e){var s;switch((s=e.errorAction)==null?void 0:s.action){case rt.DoNothing:break;case rt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(e),!e.errorAction.resolved&&e.details!==L.FRAG_GAP&&(e.fatal=!0);break}if(e.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(t){const e=this.hls,s=t.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case ft.None:this.switchLevel(t,n);break;case ft.MoveAllAlternatesMatchingHost:s.resolved||(s.resolved=this.redundantFailover(t));break;case ft.MoveAllAlternatesMatchingHDCP:r&&(e.maxHdcpLevel=Ke[Ke.indexOf(r)-1],s.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'.concat(e.maxHdcpLevel,'" or lower'));break}s.resolved||this.switchLevel(t,n)}switchLevel(t,e){e!==void 0&&t.errorAction&&(this.warn("switching to level ".concat(e," after ").concat(t.details)),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(t){const{hls:e,penalizedRenditions:s}=this,i=t.parent===U.MAIN?t.level:e.loadLevel,r=e.levels[i],n=r.url.length,o=t.frag?t.frag.urlId:r.urlId;r.urlId===o&&(!t.frag||r.details)&&this.penalizeRendition(r,t);for(let l=1;l{u.urlId=c}),e.nextLoadLevel=i,!0}return!1}penalizeRendition(t,e){const{penalizedRenditions:s}=this,i=s[t.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};i.lastErrorPerfMs=performance.now(),i.errors.push(e),i.details=t.details,s[t.urlId]=i}}function bn(a,t,e){if(performance.now()-a.lastErrorPerfMs>Rn)return!0;const s=a.details;if(t.details===L.FRAG_GAP&&s&&t.frag){const i=t.frag.start,r=Yt(null,s.fragments,i);if(r&&!r.gap)return!0}if(e&&a.errors.lengths.targetduration*3)return!0}return!1}class Je{constructor(t,e){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=x.log.bind(x,"".concat(e,":")),this.warn=x.warn.bind(x,"".concat(e,":")),this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e){const s=e==null?void 0:e.renditionReports;if(s){let i=-1;for(let r=0;r=0&&l>e.partTarget&&(o+=1)}return new Cs(n,o>=0?o:void 0,Ht.No)}}}loadPlaylist(t){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}shouldReloadPlaylist(t){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(t)}playlistLoaded(t,e,s){const{details:i,stats:r}=e,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist ".concat(t," ").concat(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED")),s&&i.fragments.length>0&&mn(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const T=this.hls.config.lowLatencyMode,y=i.lastPartSn,S=i.endSN,E=i.lastPartIndex,R=E!==-1,A=y===S,k=T?0:E;R?(c=A?S+1:y,h=A?k:E+1):c=S+1;const D=i.age,C=D+i.ageHeader;let _=Math.min(C-i.partTarget,i.targetduration*1.5);if(_>0){if(s&&_>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: ".concat(s.tuneInGoal," to: ").concat(_," with playlist age: ").concat(i.age)),_=0;else{const I=Math.floor(_/i.targetduration);if(c+=I,h!==void 0){const O=Math.round(_%i.targetduration/i.partTarget);h+=O}this.log("CDN Tune-in age: ".concat(i.ageHeader,"s last advanced ").concat(D.toFixed(2),"s goal: ").concat(_," skip sn ").concat(I," to part ").concat(h))}i.tuneInGoal=_}if(l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,h),T||!A){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,f=(i.edge-d)*1e3,g=xn(i,f);i.updated&&n>this.requestScheduled+g&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+g-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+gthis.loadPlaylist(l),p)}else this.clearTimer()}getDeliveryDirectives(t,e,s,i){let r=gn(t,s);return e!=null&&e.skip&&t.deltaUpdateFailed&&(s=e.msn,i=e.part,r=Ht.No),new Cs(s,i,r)}checkRetry(t){const e=t.details,s=oe(t),i=t.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===rt.RetryRequest||!i.resolved&&r===rt.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=t.context)!=null&&c.deliveryDirectives)this.warn("Retrying playlist loading ".concat(n+1,"/").concat(o.maxNumRetry,' after "').concat(e,'" without delivery-directives')),this.loadPlaylist();else{const h=Qe(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn("Retrying playlist loading ".concat(n+1,"/").concat(o.maxNumRetry,' after "').concat(e,'" in ').concat(h,"ms"))}t.levelRetry=!0,i.resolved=!0}return l}}let Ae;class Dn extends Je{constructor(t,e){super(t,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this),t.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this),t.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(t,e){this.resetLevels()}onManifestLoaded(t,e){const s=[],i={};let r;e.levels.forEach(n=>{var o;const l=n.attrs;((o=n.audioCodec)==null?void 0:o.indexOf("mp4a.40.34"))!==-1&&(Ae||(Ae=/chrome|firefox/i.test(navigator.userAgent)),Ae&&(n.audioCodec=void 0));const{AUDIO:c,CODECS:h,"FRAME-RATE":u,"PATHWAY-ID":d,RESOLUTION:f,SUBTITLES:g}=l,p="".concat(d||".","-"),T="".concat(p).concat(n.bitrate,"-").concat(f,"-").concat(u,"-").concat(h);r=i[T],r?r.addFallback(n):(r=new Wt(n),i[T]=r,s.push(r)),ce(r,"audio",c),ce(r,"text",g)}),this.filterAndSortMediaOptions(s,e)}filterAndSortMediaOptions(t,e){let s=[],i=[],r=!1,n=!1,o=!1,l=t.filter(({audioCodec:f,videoCodec:g,width:p,height:T,unknownCodecs:y})=>(r||(r=!!(p&&T)),n||(n=!!g),o||(o=!!f),!(y!=null&&y.length)&&(!f||xe(f,"audio"))&&(!g||xe(g,"video"))));if((r||n)&&o&&(l=l.filter(({videoCodec:f,width:g,height:p})=>!!f||!!(g&&p))),l.length===0){Promise.resolve().then(()=>{if(this.hls){const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:f,reason:f.message})}});return}e.audioTracks&&(s=e.audioTracks.filter(f=>!f.audioCodec||xe(f.audioCodec,"audio")),Ps(s)),e.subtitles&&(i=e.subtitles,Ps(i));const c=l.slice(0);l.sort((f,g)=>f.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"]?(f.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1:f.bitrate!==g.bitrate?f.bitrate-g.bitrate:f.attrs["FRAME-RATE"]!==g.attrs["FRAME-RATE"]?f.attrs.decimalFloatingPoint("FRAME-RATE")-g.attrs.decimalFloatingPoint("FRAME-RATE"):f.attrs.SCORE!==g.attrs.SCORE?f.attrs.decimalFloatingPoint("SCORE")-g.attrs.decimalFloatingPoint("SCORE"):r&&f.height!==g.height?f.height-g.height:0);let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;f!!f.url)};this.hls.trigger(m.MANIFEST_PARSED,d),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(e.length===0)return;if(t<0||t>=e.length){const h=new Error("invalid level idx"),u=t<0;if(this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.LEVEL_SWITCH_ERROR,level:t,fatal:u,error:h,reason:h.message}),u)return;t=Math.min(t,e.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=e[t],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=n,s===t&&n.details&&i&&r===o)return;this.log("Switching to level ".concat(t).concat(o?" with Pathway "+o:""," from level ").concat(s).concat(r?" with Pathway "+r:""));const l=tt({},n,{level:t,maxBitrate:n.maxBitrate,attrs:n.attrs,uri:n.uri,urlId:n.urlId});delete l._attrs,delete l._urlId,this.hls.trigger(m.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i==null?void 0:i.details);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(this._startLevel===void 0){const t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel}set startLevel(t){this._startLevel=t}onError(t,e){e.fatal||!e.context||e.context.type===G.LEVEL&&e.context.level===this.level&&this.checkRetry(e)}onFragLoaded(t,{frag:e}){if(e!==void 0&&e.type===U.MAIN){const s=this._levels[e.level];s!==void 0&&(s.loadError=0)}}onLevelLoaded(t,e){var s;const{level:i,details:r}=e,n=this._levels[i];if(!n){var o;this.warn("Invalid level index ".concat(i)),(o=e.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,e,n.details)):(s=e.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}onAudioTrackSwitched(t,e){const s=this.currentLevel;if(!s)return;const i=this.hls.audioTracks[e.id].groupId;if(s.audioGroupIds&&s.audioGroupId!==i){let r=-1;for(let n=0;nn!==e,i=this._levels.filter((r,n)=>n!==t?!0:r.url.length>1&&e!==void 0?(r.url=r.url.filter(s),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(s)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(s)),r.urlId=0,!0):(this.steering&&this.steering.removeLevel(r),!1));this.hls.trigger(m.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(t,{levels:e}){e.forEach((s,i)=>{const{details:r}=s;r!=null&&r.fragments&&r.fragments.forEach(n=>{n.level=i})}),this._levels=e}}function ce(a,t,e){e&&(t==="audio"?(a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds[a.url.length-1]=e):t==="text"&&(a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds[a.url.length-1]=e))}function Ps(a){const t={};a.forEach(e=>{const s=e.groupId||"";e.id=t[s]=t[s]||0,t[s]++})}var et={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Cn{constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(m.BUFFER_APPENDED,this.onBufferAppended,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.BUFFER_APPENDED,this.onBufferAppended,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const s=this.activePartLists[e];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=t&&n!==null&&t<=n)return r}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if((n==null?void 0:n.body.type)===e&&n.buffered){const o=n.body;if(o.start<=t&&t<=o.end)return o}}return null}detectEvictedFragments(t,e,s,i){this.timeRanges&&(this.timeRanges[t]=e);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[t];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,e);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(t){const e=this.timeRanges,{frag:s,part:i}=t;if(!e||s.sn==="initSegment")return;const r=Ft(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(e).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=e[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),zt(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(t,e){const s=this.activePartLists[e];s&&(this.activePartLists[e]=s.filter(i=>i.fragment.sn>=t))}fragBuffered(t,e){const s=Ft(t);let i=this.fragments[s];!i&&e&&(i=this.fragments[s]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(t,e,s,i){const r={time:[],partial:s},n=t.start,o=t.end,l=t.minEndPTS||o,c=t.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu)r.partial=!0,r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});else if(o<=u)break}return r}getPartialFragment(t){let e=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&zt(h)&&(i=h.body.start-o,r=h.body.end+o,t>=i&&t<=r&&(s=Math.min(t-i,r-t),n<=s&&(e=h.body,n=s)))}),e}isEndListAppended(t){const e=this.endListFragments[t];return e!==void 0&&(e.buffered||zt(e))}getState(t){const e=Ft(t),s=this.fragments[e];return s?s.buffered?zt(s)?et.PARTIAL:et.OK:et.APPENDING:et.NOT_LOADED}isTimeBuffered(t,e,s){let i,r;for(let n=0;n=i&&e<=r)return!0;if(e<=i)return!1}return!1}onFragLoaded(t,e){const{frag:s,part:i}=e;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:e,n=Ft(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:s,part:i,timeRanges:r}=e;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Ft(t);return!!this.fragments[e]}hasParts(t){var e;return!!((e=this.activePartLists[t])!=null&&e.length)}removeFragmentsInRange(t,e,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.startt&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(t){const e=Ft(t);t.stats.loaded=0,t.clearElementaryStreamInfo();const s=this.activePartLists[t.type];if(s){const i=t.sn;this.activePartLists[t.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function zt(a){var t,e,s;return a.buffered&&(a.body.gap||((t=a.range.video)==null?void 0:t.partial)||((e=a.range.audio)==null?void 0:e.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Ft(a){return"".concat(a.type,"_").concat(a.level,"_").concat(a.urlId,"_").concat(a.sn)}const Fs=Math.pow(2,17);class kn{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const s=t.url;if(!s)return Promise.reject(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a ".concat(s?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap)if(t.tagList.some(f=>f[0]==="GAP")){l(Ms(t));return}else t.gap=!1;const c=this.loader=t.loader=r?new r(i):new n(i),h=Os(t),u=ws(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:Fs};t.stats=c.stats,c.load(h,d,{onSuccess:(f,g,p,T)=>{this.resetLoader(t,c);let y=f.data;p.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(y.slice(0,16)),y=y.slice(16)),o({frag:t,part:null,payload:y,networkDetails:T})},onError:(f,g,p,T)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:ct({url:s,data:void 0},f),error:new Error("HTTP Error ".concat(f.code," ").concat(f.text)),networkDetails:p,stats:T}))},onAbort:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:p,stats:f}))},onTimeout:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error("Timeout after ".concat(d.timeout,"ms")),networkDetails:p,stats:f}))},onProgress:(f,g,p,T)=>{e&&e({frag:t,part:null,payload:p,networkDetails:T})}})})}loadPart(t,e,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap){l(Ms(t,e));return}const c=this.loader=t.loader=r?new r(i):new n(i),h=Os(t,e),u=ws(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Fs};e.stats=c.stats,c.load(h,d,{onSuccess:(f,g,p,T)=>{this.resetLoader(t,c),this.updateStatsFromPart(t,e);const y={frag:t,part:e,payload:f.data,networkDetails:T};s(y),o(y)},onError:(f,g,p,T)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:ct({url:h.url,data:void 0},f),error:new Error("HTTP Error ".concat(f.code," ").concat(f.text)),networkDetails:p,stats:T}))},onAbort:(f,g,p)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:p,stats:f}))},onTimeout:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error("Timeout after ".concat(d.timeout,"ms")),networkDetails:p,stats:f}))}})})}updateStatsFromPart(t,e){const s=t.stats,i=e.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(t.duration/e.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function Os(a,t=null){const e=t||a,s={frag:a,part:t,responseType:"arraybuffer",url:e.url,headers:{},rangeStart:0,rangeEnd:0},i=e.byteRangeStartOffset,r=e.byteRangeEndOffset;if(F(i)&&F(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function Ms(a,t){const e=new Error("GAP ".concat(a.gap?"tag":"attribute"," found")),s={type:N.MEDIA_ERROR,details:L.FRAG_GAP,fatal:!1,frag:a,error:e,networkDetails:null};return t&&(s.part=t),(t||a).stats.aborted=!0,new At(s)}class At extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class _n{constructor(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e].loader;if(s){if(t&&t!==s.context.frag.type)return;s.abort()}}}detach(){for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t].loader;e&&e.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(t,e=L.KEY_LOAD_ERROR,s,i,r){return new At({type:N.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:r,error:s,networkDetails:i})}loadClear(t,e){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=t;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(t){return!t.decryptdata&&t.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(t).then(e=>this.loadInternal(t,e)):this.loadInternal(t)}loadInternal(t,e){var s,i;e&&t.setKeyFormat(e);const r=t.decryptdata;if(!r){const c=new Error(e?"Expected frag.decryptdata to be defined after setting format ".concat(e):"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error('Invalid key URI: "'.concat(n,'"'))));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:t,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:t,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,t):this.loadKeyEME(o,t);case"AES-128":return this.loadKeyHTTP(o,t);default:return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error('Key supplied with unsupported METHOD: "'.concat(r.method,'"'))))}}loadKeyEME(t,e){const s={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(t.keyLoadPromise=i.then(r=>(t.mediaKeySessionContext=r,s))).catch(r=>{throw t.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(t,e){const s=this.config,i=s.loader,r=new i(s);return e.keyLoader=t.loader=r,t.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,f,g,p)=>{const{frag:T,keyInfo:y,url:S}=g;if(!T.decryptdata||y!==this.keyUriToKeyInfo[S])return o(this.createKeyLoadError(T,L.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),p));y.decryptdata.key=T.decryptdata.key=new Uint8Array(d.data),T.keyLoader=null,y.loader=null,n({frag:T,keyInfo:y})},onError:(d,f,g,p)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error("HTTP Error ".concat(d.code," loading key ").concat(d.text)),g,ct({url:l.url,data:void 0},d)))},onTimeout:(d,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),g))},onAbort:(d,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.INTERNAL_ABORTED,new Error("key loading aborted"),g))}};r.load(l,h,u)})}resetLoader(t){const{frag:e,keyInfo:s,url:i}=t,r=s.loader;e.keyLoader===r&&(e.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}class wn{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const Pn={length:0,start:()=>0,end:()=>0};class q{static isBuffered(t,e){try{if(t){const s=q.getBuffered(t);for(let i=0;i=s.start(i)&&e<=s.end(i))return!0}}catch{}return!1}static bufferInfo(t,e,s){try{if(t){const i=q.getBuffered(t),r=[];let n;for(n=0;nu&&(i[h-1].end=t[c].end):i.push(t[c])}else i.push(t[c])}else i=t;let r=0,n,o=e,l=e;for(let c=0;c=h&&ee.startCC||a&&a.cc>>8^y&255^99,t[g]=y,e[y]=g;const S=f[g],E=f[S],R=f[E];let A=f[y]*257^y*16843008;i[g]=A<<24|A>>>8,r[g]=A<<16|A>>>16,n[g]=A<<8|A>>>24,o[g]=A,A=R*16843009^E*65537^S*257^g*16843008,c[y]=A<<24|A>>>8,h[y]=A<<16|A>>>16,u[y]=A<<8|A>>>24,d[y]=A,g?(g=S^f[f[f[R^S]]],p^=f[f[p]]):g=p=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let s=!0,i=0;for(;ii?(this.logOnce("WebCrypto AES decrypt"),new Bn(i,new Uint8Array(s)).decrypt(t.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(x.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, ".concat(r.name,": ").concat(r.message)),this.onWebCryptoError(t,e,s)))}onWebCryptoError(t,e,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(t){let e=t;const s=t.length-t.length%Hn;return s!==t.length&&(e=wt(t,0,s),this.remainderData=wt(t,s)),e}logOnce(t){this.logEnabled&&(x.log("[decrypter]: ".concat(t)),this.logEnabled=!1)}}const Vn={toString:function(a){let t="";const e=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(t)){this.warn("Fragment ".concat(t.sn).concat(r.part?" p: "+r.part.index:""," of level ").concat(t.level," was dropped during download.")),this.fragmentTracker.removeFragment(t);return}t.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(t,e,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(t)){(n===b.FRAG_LOADING||!this.fragCurrent&&n===b.PARSING)&&(this.fragmentTracker.removeFragment(t),this.state=b.IDLE);return}"payload"in r&&(this.log("Loaded fragment ".concat(t.sn," of level ").concat(t.level)),this.hls.trigger(m.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===b.STOPPED||this.state===b.ERROR||(this.warn(r),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var e;const{fragmentTracker:s}=this;if(s.getState(t)===et.APPENDING){const r=t.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(t.duration,n?n.len:this.config.maxBufferLength);this.reduceMaxBufferLength(o)&&s.removeFragment(t)}else((e=this.mediaBuffer)==null?void 0:e.buffered.length)===0?s.removeAllFragments():s.hasParts(t.type)&&(s.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),s.getState(t)===et.PARTIAL&&s.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}flushMainBuffer(t,e,s=null){if(!(t-e))return;const i={startOffset:t,endOffset:e,type:s};this.hls.trigger(m.BUFFER_FLUSHING,i)}_loadInitSegment(t,e){this._doFragLoad(t,e).then(s=>{if(!s||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=t.decryptdata;if(r&&r.byteLength>0&&n&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=self.performance.now();return i.trigger(m.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,s})}return s}).then(s=>{const{fragCurrent:i,hls:r,levels:n}=this;if(!n)throw new Error("init load aborted, missing levels");const o=t.stats;this.state=b.IDLE,e.fragmentError=0,t.data=new Uint8Array(s.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),s.frag===i&&r.trigger(m.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:t.type}),this.tick()}).catch(s=>{this.state===b.STOPPED||this.state===b.ERROR||(this.warn(s),this.resetFragmentLoading(t))})}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId}fragBufferedComplete(t,e){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered ".concat(t.type," sn: ").concat(t.sn).concat(e?" part: "+e.index:""," of ").concat(this.playlistType===U.MAIN?"level":"track"," ").concat(t.level," (frag:[").concat(((s=t.startPTS)!=null?s:NaN).toFixed(3),"-").concat(((i=t.endPTS)!=null?i:NaN).toFixed(3),"] > buffer:").concat(o?Vn.toString(q.getBuffered(o)):"(detached)",")")),this.state=b.IDLE,o&&(!this.loadedmetadata&&t.type==U.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:s,part:i,partsLoaded:r}=t,n=!r||r.length===0||r.some(l=>!l),o=new Ze(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);e.flush(o)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,s=null,i){var r;const n=e==null?void 0:e.details;if(!this.levels||!n)throw new Error("frag load aborted, missing level".concat(n?"":" detail","s"));let o=null;if(t.encrypted&&!((r=t.decryptdata)!=null&&r.key)?(this.log("Loading key for ".concat(t.sn," of [").concat(n.startSN,"-").concat(n.endSN,"], ").concat(this.logPrefix==="[stream-controller]"?"level":"track"," ").concat(t.level)),this.state=b.KEY_LOADING,this.fragCurrent=t,o=this.keyLoader.load(t).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(m.KEY_LOADED,h),this.state===b.KEY_LOADING&&(this.state=b.IDLE),h}),this.hls.trigger(m.KEY_LOADING,{frag:t}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!t.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(t,n.encryptedFragments),s=Math.max(t.start,s||0),this.config.lowLatencyMode&&t.sn!=="initSegment"){const h=n.partList;if(h&&i){s>t.end&&n.fragmentHint&&(t=n.fragmentHint);const u=this.getNextPart(h,t,s);if(u>-1){const d=h[u];this.log("Loading part sn: ".concat(t.sn," p: ").concat(d.index," cc: ").concat(t.cc," of playlist [").concat(n.startSN,"-").concat(n.endSN,"] parts [0-").concat(u,"-").concat(h.length-1,"] ").concat(this.logPrefix==="[stream-controller]"?"level":"track",": ").concat(t.level,", target: ").concat(parseFloat(s.toFixed(3)))),this.nextLoadPosition=d.start+d.duration,this.state=b.FRAG_LOADING;let f;return o?f=o.then(g=>!g||this.fragContextChanged(g.frag)?null:this.doFragPartsLoad(t,d,e,i)).catch(g=>this.handleFragLoadError(g)):f=this.doFragPartsLoad(t,d,e,i).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(m.FRAG_LOADING,{frag:t,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):f}else if(!t.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log("Loading fragment ".concat(t.sn," cc: ").concat(t.cc," ").concat(n?"of ["+n.startSN+"-"+n.endSN+"] ":"").concat(this.logPrefix==="[stream-controller]"?"level":"track",": ").concat(t.level,", target: ").concat(parseFloat(s.toFixed(3)))),F(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=b.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(t,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(t,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(m.FRAG_LOADING,{frag:t,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(t,e,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(t,u,i).then(d=>{l[u.index]=d;const f=d.part;this.hls.trigger(m.FRAG_LOADED,d);const g=ks(s,t.sn,u.index+1)||Di(c,t.sn,u.index+1);if(g)h(g);else return r({frag:t,part:f,partsLoaded:l})}).catch(n)};h(e)})}handleFragLoadError(t){if("data"in t){const e=t.data;t.data&&e.details===L.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(m.ERROR,e)}else this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==b.PARSING){!this.fragCurrent&&this.state!==b.STOPPED&&this.state!==b.ERROR&&(this.state=b.IDLE);return}const{frag:s,part:i,level:r}=e,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,t.partial)}getCurrentContext(t){const{levels:e,fragCurrent:s}=this,{level:i,sn:r,part:n}=t;if(!(e!=null&&e[i]))return this.warn("Levels object was unset while buffering fragment ".concat(r," of level ").concat(i,". The current chunk will not be buffered.")),null;const o=e[i],l=n>-1?ks(o,r,n):null,c=l?l.fragment:En(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(t,e,s,i,r){var n;if(!t||this.state!==b.PARSING)return;const{data1:o,data2:l}=t;let c=o;if(o&&l&&(c=Pt(o,l)),!((n=c)!=null&&n.length))return;const h={type:t.type,frag:e,part:s,chunkMeta:i,parent:e.type,data:c};if(this.hls.trigger(m.BUFFER_APPENDING,h),t.dropped&&t.independent&&!s){if(r)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!q.isBuffered(e,e.currentTime)){this.flushMainBuffer(0,t.start);return}const s=e.currentTime,i=q.bufferInfo(e,s,0),r=t.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(t.start-n,i.end-n),s+n);t.start-o>n&&this.flushMainBuffer(o,t.start)}getFwdBufferInfo(t,e){const s=this.getLoadPosition();return F(s)?this.getFwdBufferInfoAtPos(t,s,e):null}getFwdBufferInfoAtPos(t,e,s){const{config:{maxBufferHole:i}}=this,r=q.bufferInfo(t,e,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(e,s);if(n&&r.nextStart=s?(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to ".concat(e.maxMaxBufferLength,"s")),!0):!1}getAppendedFrag(t,e=U.MAIN){const s=this.fragmentTracker.getAppendedFrag(t,U.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(t,e){const s=e.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(e.live){const l=r.initialLiveManifestSize;if(ie}getNextFragmentLoopLoading(t,e,s,i,r){const n=t.gap,o=this.getNextFragment(this.nextLoadPosition,e);if(o===null)return o;if(t=o,n&&t&&!t.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log('buffer full after gaps in "'.concat(i,'" playlist starting at sn: ').concat(t.sn)),null}return t}mapToInitFragWhenRequired(t){return t!=null&&t.initSegment&&!(t!=null&&t.initSegment.data)&&!this.bitrateTest?t.initSegment:t}getNextPart(t,e,s){let i=-1,r=!1,n=!0;for(let o=0,l=t.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(t,e){const s=this.fragPrevious;let i=null;if(s){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: ".concat(s.programDateTime)),i=vn(e,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=t.startSN&&r<=t.endSN){const n=e[r-t.startSN];s.cc===n.cc&&(i=n,this.log("Live playlist, switching playlist, load frag with next SN: ".concat(i.sn)))}i||(i=Ln(e,s.cc),i&&this.log("Live playlist, switching playlist, load frag with same CC: ".concat(i.sn)))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i}getFragmentAtPosition(t,e,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,c=i.maxFragLookUpTolerance,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(te-c?0:c;d=Yt(r,n,t,f)}else d=n[n.length-1];if(d){const f=d.sn-s.startSN,g=this.fragmentTracker.getState(d);if((g===et.OK||g===et.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const T=n[f+1];d.sn=n-e.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r").concat(t.startSN," prev-sn: ").concat(r?r.sn:"na"," fragments: ").concat(o)),u}return l}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,t.partTarget*3)}setStartPosition(t,e){let s=this.startPosition;if(s ").concat((i=this.fragCurrent)==null?void 0:i.url));return}const r=e.details===L.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=e.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===rt.RetryRequest&&c){var h;this.resetStartWhenNotLoaded((h=this.levelLastLoaded)!=null?h:s.level);const u=Qe(c,l);this.warn("Fragment ".concat(s.sn," of ").concat(t," ").concat(s.level," errored with ").concat(e.details,", retrying loading ").concat(l+1,"/").concat(c.maxNumRetry," in ").concat(u,"ms")),n.resolved=!0,this.retryDate=self.performance.now()+u,this.state=b.FRAG_LOADING_WAITING_RETRY}else c&&n?(this.resetFragmentErrors(t),l.5;i&&this.reduceMaxBufferLength(s.len);const r=!i;return r&&this.warn("Buffer full error while media.currentTime is not buffered, flush ".concat(e," buffer")),t.frag&&(this.fragmentTracker.removeFragment(t.frag),this.nextLoadPosition=t.frag.start),this.resetLoadingState(),r}return!1}resetFragmentErrors(t){t===U.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==b.STOPPED&&(this.state=b.IDLE)}afterBufferFlushed(t,e,s){if(!t)return;const i=q.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,i,s),this.state===b.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE}resetStartWhenNotLoaded(t){if(!this.loadedmetadata){this.startFragRequested=!1;const e=this.levels?this.levels[t].details:null;e!=null&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){var e;this.warn("The loading context changed while buffering fragment ".concat(t.sn," of level ").concat(t.level,". This chunk will not be buffered.")),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded((e=this.levelLastLoaded)!=null?e:t.level),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(Object.keys(t.elementaryStreams).reduce((l,c)=>{const h=t.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn("Could not parse fragment ".concat(t.sn," ").concat(c," duration reliably (").concat(u,")")),l||!1;const d=i?0:Ii(n,t,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:t,start:h.startPTS,end:h.endPTS}),!0}return l},!1))s.fragmentError=0;else if(((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error("Found no media in fragment ".concat(t.sn," of level ").concat(t.level," resetting transmuxer to fallback to playlist timing"));if(s.fragmentError===0&&(s.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)),this.warn(l.message),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:t,reason:"Found no media in msn ".concat(t.sn,' of level "').concat(s.url,'"')}),!this.hls)return;this.resetTransmuxer()}this.state=b.PARSED,this.hls.trigger(m.FRAG_PARSED,{frag:t,part:e})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(t){if(t.event==="demuxerWorker"){var e,s,i;this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded((e=(s=this.levelLastLoaded)!=null?s:(i=this.fragCurrent)==null?void 0:i.level)!=null?e:0),this.resetLoadingState()}}set state(t){const e=this._state;e!==t&&(this._state=t,this.log("".concat(e,"->").concat(t)))}get state(){return this._state}}function wi(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wn(){const a=fe();if(!a)return!1;const t=wi(),e=a&&typeof a.isTypeSupported=="function"&&a.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function";return!!e&&!!s}function Yn(){var a;const t=wi();return typeof(t==null||(a=t.prototype)==null?void 0:a.changeType)=="function"}function qn(){return typeof __HLS_WORKER_BUNDLE__=="function"}function jn(){const a=new self.Blob(["var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(".concat(__HLS_WORKER_BUNDLE__.toString(),")(true);")],{type:"text/javascript"}),t=self.URL.createObjectURL(a);return{worker:new self.Worker(t),objectURL:t}}function Xn(a){const t=new self.URL(a,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}function Et(a="",t=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class Pi{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,s,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,s){}demux(t,e){this.cachedData&&(t=Pt(this.cachedData,t),this.cachedData=null);let s=ne(t,0),i=s?s.length:0,r;const n=this._audioTrack,o=this._id3Track,l=s?kr(s):void 0,c=t.length;for((this.basePTS===null||this.frameIndex===0&&F(l))&&(this.basePTS=zn(l,e,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Tt.audioId3,duration:Number.POSITIVE_INFINITY});i{if(F(a))return a*90;const s=e?e.baseTime*9e4/e.timescale:0;return t*9e4+s};function Qn(a,t,e,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((t[e+2]&192)>>>6)+1;const u=(t[e+2]&60)>>>2;if(u>h.length-1){a.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:".concat(u)});return}return n=(t[e+2]&1)<<2,n|=(t[e+3]&192)>>>6,x.log("manifest codec:".concat(s,", ADTS type:").concat(i,", samplingIndex:").concat(u)),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function Fi(a,t){return a[t]===255&&(a[t+1]&246)===240}function Oi(a,t){return a[t+1]&1?7:9}function is(a,t){return(a[t+3]&3)<<11|a[t+4]<<3|(a[t+5]&224)>>>5}function Jn(a,t){return t+5=a.length)return!1;const s=is(a,t);if(s<=e)return!1;const i=t+s;return i===a.length||he(a,i)}return!1}function Mi(a,t,e,s,i){if(!a.samplerate){const r=Qn(t,e,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,x.log("parsed codec:".concat(a.codec,", rate:").concat(r.samplerate,", channels:").concat(r.channelCount))}}function Ni(a){return 1024*9e4/a}function ea(a,t){const e=Oi(a,t);if(t+e<=a.length){const s=is(a,t)-e;if(s>0)return{headerLength:e,frameLength:s}}}function Ui(a,t,e,s,i){const r=Ni(a.samplerate),n=s+i*r,o=ea(t,e);let l;if(o){const{frameLength:u,headerLength:d}=o,f=d+u,g=Math.max(0,e+f-t.length);g?(l=new Uint8Array(f-d),l.set(t.subarray(e+d,t.length),0)):l=t.subarray(e+d,e+f);const p={unit:l,pts:n};return g||a.samples.push(p),{sample:p,length:f,missing:g}}const c=t.length-e;return l=new Uint8Array(c),l.set(t.subarray(e,t.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}class sa extends Pi{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,s,i){super.resetInitSegment(t,e,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;let s=(ne(t,0)||[]).length;for(let i=t.length;s16384?t.subarray(0,16384):t,$(t,["moof"]).length>0}demux(t,e){this.timeOffset=e;let s=t;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Pt(this.remainderData,t));const o=Wr(s);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=s;const n=this.extractID3Track(i,e);return r.samples=ms(e,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,s=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(e,this.timeOffset);return s.samples=ms(t,e),{videoTrack:e,audioTrack:Et(),id3Track:i,textTrack:Et()}}extractID3Track(t,e){const s=this.id3Track;if(t.samples.length){const i=$(t.samples,["emsg"]);i&&i.forEach(r=>{const n=jr(r);if(ia.test(n.schemeIdUri)){const o=F(n.presentationTime)?n.presentationTime/n.timeScale:e+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:Tt.emsg,duration:l})}})}return s}demuxSampleAes(t,e,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let Jt=null;const na=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],aa=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],oa=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],la=[0,1,1,4];function Bi(a,t,e,s,i){if(e+24>t.length)return;const r=$i(t,e);if(r&&e+r.frameLength<=t.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:t.subarray(e,e+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function $i(a,t){const e=a[t+1]>>3&3,s=a[t+1]>>1&3,i=a[t+2]>>4&15,r=a[t+2]>>2&3;if(e!==1&&i!==0&&i!==15&&r!==3){const n=a[t+2]>>1&1,o=a[t+3]>>6,l=e===3?3-s:s===3?3:4,c=na[l*14+i-1]*1e3,u=aa[(e===3?0:e===2?1:2)*3+r],d=o===3?1:2,f=oa[e][s],g=la[s],p=f*8*g,T=Math.floor(f*c/u+n)*g;if(Jt===null){const E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Jt=E?parseInt(E[1]):0}return!!Jt&&Jt<=87&&s===2&&c>=224e3&&o===0&&(a[t+3]=a[t+3]|128),{sampleRate:u,channelCount:d,frameLength:T,samplesPerFrame:p}}}function rs(a,t){return a[t]===255&&(a[t+1]&224)===224&&(a[t+1]&6)!==0}function Gi(a,t){return t+1t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const s=this.word>>>32-e;if(t>32&&x.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return e=t-e,e>0&&this.bitsAvailable?s<>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(t){let e=8,s=8,i;for(let r=0;r{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,s)})}decryptAacSamples(t,e,s){for(;;e++){if(e>=t.length){s();return}if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=Math.floor((t.length-48)/160)*16+16,s=new Int8Array(e);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(t,e,s+1,i)})}decryptAvcSamples(t,e,s,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,s=0){if(e>=t.length){i();return}const r=t[e].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(t,e,s,i,n),!this.decrypter.isSync()))return}}}}const it=188;class bt{constructor(t,e,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=s}static probe(t){const e=bt.syncOffset(t);return e>0&&x.warn("MPEG2-TS detected but first sync word found @ offset ".concat(e)),e!==-1}static syncOffset(t){const e=t.length;let s=Math.min(it*5,t.length-it)+1,i=0;for(;i1&&(n===0&&o>2||l+it>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(t,e){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:pi[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?e:void 0}}resetInitSegment(t,e,s,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=bt.createTrack("video"),this._audioTrack=bt.createTrack("audio",i),this._id3Track=bt.createTrack("id3"),this._txtTrack=bt.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_avcTrack:e,_id3Track:s}=this;t&&(t.pesData=null),e&&(e.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(t,e,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._avcTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,f=l.pid,g=o.pesData,p=l.pesData,T=null,y=this.pmtParsed,S=this._pmtId,E=t.length;if(this.remainderData&&(t=Pt(this.remainderData,t),E=t.length,this.remainderData=null),E>4;let O;if(I>1){if(O=D+5+t[D+4],O===D+it)continue}else O=D+4;switch(_){case h:C&&(u&&(r=Ot(u))&&this.parseAVCPES(n,c,r,!1),u={data:[],size:0}),u&&(u.data.push(t.subarray(O,D+it)),u.size+=D+it-O);break;case d:if(C){if(g&&(r=Ot(g)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break}g={data:[],size:0}}g&&(g.data.push(t.subarray(O,D+it)),g.size+=D+it-O);break;case f:C&&(p&&(r=Ot(p))&&this.parseID3PES(l,r),p={data:[],size:0}),p&&(p.data.push(t.subarray(O,D+it)),p.size+=D+it-O);break;case 0:C&&(O+=t[O]+1),S=this._pmtId=da(t,O);break;case S:{C&&(O+=t[O]+1);const w=fa(t,O,this.typeSupported,s);h=w.avc,h>0&&(n.pid=h),d=w.audio,d>0&&(o.pid=d,o.segmentCodec=w.segmentCodec),f=w.id3,f>0&&(l.pid=f),T!==null&&!y&&(x.warn("MPEG-TS PMT found at ".concat(D," after unknown PID '").concat(T,"'. Backtracking to sync byte @").concat(R," to parse all TS packets.")),T=null,D=R-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=_;break}}else A++;if(A>0){const D=new Error("Found ".concat(A," TS packet/s that do not start with 0x47"));this.observer.emit(m.ERROR,m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:D,reason:D.message})}n.pesData=u,o.pesData=g,l.pesData=p;const k={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(k),k}flush(){const{remainderData:t}=this;this.remainderData=null;let e;return t?e=this.demux(t,-1,!1,!0):e={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:s,id3Track:i,textTrack:r}=t,n=s.pesData,o=e.pesData,l=i.pesData;let c;if(n&&(c=Ot(n))?(this.parseAVCPES(s,r,c,!0),s.pesData=null):s.pesData=n,o&&(c=Ot(o))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,c);break;case"mp3":this.parseMPEGPES(e,c);break}e.pesData=null}else o!=null&&o.size&&x.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=o;l&&(c=Ot(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(t,e,s){const i=this.demux(t,s,!0,!this.config.progressive),r=this.sampleAes=new ua(this.observer,this.config,e);return this.decrypt(i,r)}decrypt(t,e){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=t;i.samples&&i.segmentCodec==="aac"?e.decryptAacSamples(i.samples,0,()=>{r.samples?e.decryptAvcSamples(r.samples,0,0,()=>{s(t)}):s(t)}):r.samples&&e.decryptAvcSamples(r.samples,0,0,()=>{s(t)})})}destroy(){this._duration=0}parseAVCPES(t,e,s,i){const r=this.parseAVCNALu(t,s.data);let n=this.avcSample,o,l=!1;s.data=null,n&&r.length&&!t.audFound&&($t(n,t),n=this.avcSample=Zt(!1,s.pts,s.dts,"")),r.forEach(c=>{var h;switch(c.type){case 1:{let d=!1;o=!0;const f=c.data;if(l&&f.length>4){const g=new Us(f).readSliceType();(g===2||g===4||g===7||g===9)&&(d=!0)}if(d){var u;(u=n)!=null&&u.frame&&!n.key&&($t(n,t),n=this.avcSample=null)}n||(n=this.avcSample=Zt(!0,s.pts,s.dts,"")),n.frame=!0,n.key=d;break}case 5:o=!0,(h=n)!=null&&h.frame&&!n.key&&($t(n,t),n=this.avcSample=null),n||(n=this.avcSample=Zt(!0,s.pts,s.dts,"")),n.key=!0,n.frame=!0;break;case 6:{o=!0,Si(c.data,1,s.pts,e.samples);break}case 7:if(o=!0,l=!0,!t.sps){const d=c.data,g=new Us(d).readSPS();t.width=g.width,t.height=g.height,t.pixelRatio=g.pixelRatio,t.sps=[d],t.duration=this._duration;const p=d.subarray(1,4);let T="avc1.";for(let y=0;y<3;y++){let S=p[y].toString(16);S.length<2&&(S="0"+S),T+=S}t.codec=T}break;case 8:o=!0,t.pps||(t.pps=[c.data]);break;case 9:o=!1,t.audFound=!0,n&&$t(n,t),n=this.avcSample=Zt(!1,s.pts,s.dts,"");break;case 12:o=!0;break;default:o=!1,n&&(n.debug+="unknown NAL "+c.type+" ");break}n&&o&&n.units.push(c)}),i&&n&&($t(n,t),this.avcSample=null)}getLastNalUnit(t){var e;let s=this.avcSample,i;if((!s||s.units.length===0)&&(s=t[t.length-1]),(e=s)!=null&&e.units){const r=s.units;i=r[r.length-1]}return i}parseAVCNALu(t,e){const s=e.byteLength;let i=t.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=e[0]&31,i=0,o=1);o=0){const f={data:e.subarray(u,o-i-1),type:d};n.push(f)}else{const f=this.getLastNalUnit(t.samples);if(f&&(r&&o<=4-r&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-r)),c=o-i-1,c>0)){const g=new Uint8Array(f.data.byteLength+c);g.set(f.data,0),g.set(e.subarray(0,c),f.data.byteLength),f.data=g,f.state=0}}o=0&&i>=0){const f={data:e.subarray(u,s),type:d,state:i};n.push(f)}if(n.length===0){const f=this.getLastNalUnit(t.samples);if(f){const g=new Uint8Array(f.data.byteLength+e.byteLength);g.set(f.data,0),g.set(e,f.data.byteLength),f.data=g}}return t.naluState=i,n}parseAACPES(t,e){let s=0;const i=this.aacOverFlow;let r=e.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1){const f=new Uint8Array(d+r.byteLength);f.set(i.sample.unit,0),f.set(r,d),r=f}else{const f=d-u;i.sample.unit.set(r.subarray(0,u),f),t.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n1;){const c=new Uint8Array(o[0].length+o[1].length);c.set(o[0]),c.set(o[1],o[0].length),o[0]=c,o.splice(1,1)}if(e=o[0],(e[0]<<16)+(e[1]<<8)+e[2]===1){if(s=(e[4]<<8)+e[5],s&&s>a.size-6)return null;const c=e[7];c&192&&(r=(e[9]&14)*536870912+(e[10]&255)*4194304+(e[11]&254)*16384+(e[12]&255)*128+(e[13]&254)/2,c&64?(n=(e[14]&14)*536870912+(e[15]&255)*4194304+(e[16]&254)*16384+(e[17]&255)*128+(e[18]&254)/2,r-n>60*9e4&&(x.warn("".concat(Math.round((r-n)/9e4),"s delta between PTS and DTS, align them")),r=n)):n=r),i=e[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,f=o.length;dg){h-=g;continue}else e=e.subarray(h),g-=h,h=0;u.set(e,t),t+=g}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}function $t(a,t){if(a.units.length&&a.frame){if(a.pts===void 0){const e=t.samples,s=e.length;if(s){const i=e[s-1];a.pts=i.pts,a.dts=i.dts}else{t.dropped++;return}}t.samples.push(a)}a.debug.length&&x.log(a.pts+"/"+a.dts+":"+a.debug)}class ga extends Pi{resetInitSegment(t,e,s,i){super.resetInitSegment(t,e,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;let s=(ne(t,0)||[]).length;for(let i=t.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(t,4),i=0,s=8;i>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(t){return v.box(v.types.mdia,v.mdhd(t.timescale,t.duration),v.hdlr(t.type),v.minf(t))}static mfhd(t){return v.box(v.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type==="audio"?v.box(v.types.minf,v.box(v.types.smhd,v.SMHD),v.DINF,v.stbl(t)):v.box(v.types.minf,v.box(v.types.vmhd,v.VMHD),v.DINF,v.stbl(t))}static moof(t,e,s){return v.box(v.types.moof,v.mfhd(t),v.traf(s,e))}static moov(t){let e=t.length;const s=[];for(;e--;)s[e]=v.trak(t[e]);return v.box.apply(null,[v.types.moov,v.mvhd(t[0].timescale,t[0].duration)].concat(s).concat(v.mvex(t)))}static mvex(t){let e=t.length;const s=[];for(;e--;)s[e]=v.trex(t[e]);return v.box.apply(null,[v.types.mvex,...s])}static mvhd(t,e){e*=t;const s=Math.floor(e/(It+1)),i=Math.floor(e%(It+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return v.box(v.types.mvhd,r)}static sdtp(t){const e=t.samples||[],s=new Uint8Array(4+e.length);let i,r;for(i=0;i>>8&255),e.push(n&255),e=e.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=v.box(v.types.avcC,new Uint8Array([1,e[3],e[4],e[5],255,224|t.sps.length].concat(e).concat([t.pps.length]).concat(s))),l=t.width,c=t.height,h=t.pixelRatio[0],u=t.pixelRatio[1];return v.box(v.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,v.box(v.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),v.box(v.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(t){const e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}static mp4a(t){const e=t.samplerate;return v.box(v.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),v.box(v.types.esds,v.esds(t)))}static mp3(t){const e=t.samplerate;return v.box(v.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))}static stsd(t){return t.type==="audio"?t.segmentCodec==="mp3"&&t.codec==="mp3"?v.box(v.types.stsd,v.STSD,v.mp3(t)):v.box(v.types.stsd,v.STSD,v.mp4a(t)):v.box(v.types.stsd,v.STSD,v.avc1(t))}static tkhd(t){const e=t.id,s=t.duration*t.timescale,i=t.width,r=t.height,n=Math.floor(s/(It+1)),o=Math.floor(s%(It+1));return v.box(v.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(t,e){const s=v.sdtp(t),i=t.id,r=Math.floor(e/(It+1)),n=Math.floor(e%(It+1));return v.box(v.types.traf,v.box(v.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),v.box(v.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),v.trun(t,s.length+16+20+8+16+8+8),s)}static trak(t){return t.duration=t.duration||4294967295,v.box(v.types.trak,v.tkhd(t),v.mdia(t))}static trex(t){const e=t.id;return v.box(v.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const s=t.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(e+=8+r,n.set([t.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return v.box(v.types.trun,n)}static initSegment(t){v.types||v.init();const e=v.moov(t),s=new Uint8Array(v.FTYP.byteLength+e.byteLength);return s.set(v.FTYP),s.set(e,v.FTYP.byteLength),s}}v.types=void 0;v.HDLR_TYPES=void 0;v.STTS=void 0;v.STSC=void 0;v.STCO=void 0;v.STSZ=void 0;v.VMHD=void 0;v.SMHD=void 0;v.STSD=void 0;v.FTYP=void 0;v.DINF=void 0;const Ki=9e4;function ns(a,t,e=1,s=!1){const i=a*t*e;return s?Math.round(i):i}function ma(a,t,e=1,s=!1){return ns(a,t,1/e,s)}function Gt(a,t=!1){return ns(a,1e3,1/Ki,t)}function pa(a,t=1){return ns(a,Ki,1/t)}const Ta=10*1e3,$s=1024,ya=1152;let te=null,Le=null;class Re{constructor(t,e,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=s,this.ISGenerated=!1,te===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);te=n?parseInt(n[1]):0}if(Le===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Le=r?parseInt(r[1]):0}}destroy(){}resetTimeStamp(t){x.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t}resetNextTimestamp(){x.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){x.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(t){let e=!1;const s=t.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(e=!0,gt(i,r.pts)):n>0?i:r.pts},t[0].pts);return e&&x.debug("PTS rollover detected"),s}remux(t,e,s,i,r,n,o,l){let c,h,u,d,f,g,p=r,T=r;const y=t.pid>-1,S=e.pid>-1,E=e.samples.length,R=t.samples.length>0,A=o&&E>0||E>1;if((!y||R)&&(!S||A)||this.ISGenerated||o){this.ISGenerated||(u=this.generateIS(t,e,r,n));const D=this.isVideoContiguous;let C=-1,_;if(A&&(C=xa(e.samples),!D&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,C>0){x.warn("[mp4-remuxer]: Dropped ".concat(C," out of ").concat(E," video samples due to a missing keyframe"));const I=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(C),e.dropped+=C,T+=(e.samples[0].pts-I)/e.inputTimeScale,_=T}else C===-1&&(x.warn("[mp4-remuxer]: No keyframe found out of ".concat(E," video samples")),g=!1);if(this.ISGenerated){if(R&&A){const I=this.getVideoStartPts(e.samples),w=(gt(t.samples[0].pts,I)-I)/e.inputTimeScale;p+=Math.max(0,w),T+=Math.max(0,-w)}if(R){if(t.samplerate||(x.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(t,e,r,n)),h=this.remuxAudio(t,p,this.isAudioContiguous,n,S||A||l===U.AUDIO?T:void 0),A){const I=h?h.endPTS-h.startPTS:0;e.inputTimeScale||(x.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(t,e,r,n)),c=this.remuxVideo(e,T,D,I)}}else A&&(c=this.remuxVideo(e,T,D,0));c&&(c.firstKeyFrame=C,c.independent=C!==-1,c.firstKeyFramePTS=_)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(f=Hi(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Vi(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:g,text:d,id3:f}}generateIS(t,e,s,i){const r=t.samples,n=e.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,f,g;if(h&&(d=f=1/0),t.config&&r.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",t.codec=""):o.mp3&&(t.codec="mp3");break}l.audio={id:"audio",container:u,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):v.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(g=t.inputTimeScale,!c||g!==c.timescale?d=f=r[0].pts-Math.round(g*s):h=!1)}if(e.sps&&e.pps&&n.length&&(e.timescale=e.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:v.initSegment([e]),metadata:{width:e.width,height:e.height}},h))if(g=e.inputTimeScale,!c||g!==c.timescale){const p=this.getVideoStartPts(n),T=Math.round(g*s);f=Math.min(f,gt(n[0].dts,p)-T),d=Math.min(d,p-T)}else h=!1;if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:g},this._initDTS={baseTime:f,timescale:g}):d=g=void 0,{tracks:l,initPTS:d,timescale:g}}remuxVideo(t,e,s,i){const r=t.inputTimeScale,n=t.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,f,g,p=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,y=!1;if(!s||h===null){const P=e*r,M=n[0].pts-gt(n[0].dts,n[0].pts);h=P-M}const S=c.baseTime*r/c.timescale;for(let P=0;P0?P-1:P].dts&&(y=!0)}y&&n.sort(function(P,M){const W=P.dts-M.dts,Y=P.pts-M.pts;return W||Y}),f=n[0].dts,g=n[n.length-1].dts;const E=g-f,R=E?Math.round(E/(l-1)):d||t.inputTimeScale/30;if(s){const P=f-h,M=P>R,W=P<-1;if((M||W)&&(M?x.warn("AVC: ".concat(Gt(P,!0)," ms (").concat(P,"dts) hole between fragments detected, filling it")):x.warn("AVC: ".concat(Gt(-P,!0)," ms (").concat(P,"dts) overlapping between fragments detected")),!W||h>=n[0].pts)){f=h;const Y=n[0].pts-P;n[0].dts=f,n[0].pts=Y,x.log("Video: First PTS/DTS adjusted: ".concat(Gt(Y,!0),"/").concat(Gt(f,!0),", delta: ").concat(Gt(P,!0)," ms"))}}f=Math.max(0,f);let A=0,k=0;for(let P=0;P0?M.dts-n[P-1].dts:R;if(K=P>0?M.pts-n[P-1].pts:R,ht.stretchShortVideoTrack&&this.nextAudioPts!==null){const ut=Math.floor(ht.maxBufferHole*r),Ct=(i?p+i*r:this.nextAudioPts)-M.pts;Ct>ut?(d=Ct-mt,d<0?d=mt:I=!0,x.log("[mp4-remuxer]: It is approximately ".concat(Ct/90," ms to the next segment; using duration ").concat(d/90," ms for the last video frame."))):d=mt}else d=mt}const Z=Math.round(M.pts-M.dts);O=Math.min(O,d),V=Math.max(V,d),w=Math.min(w,K),nt=Math.max(nt,K),o.push(new Gs(M.key,d,Y,Z))}if(o.length){if(te){if(te<70){const P=o[0].flags;P.dependsOn=2,P.isNonSync=0}}else if(Le&&nt-w0&&(i&&Math.abs(S-y)<9e3||Math.abs(gt(p[0].pts-E,S)-y)<20*h),p.forEach(function(z){z.pts=gt(z.pts-E,S)}),!s||y<0){if(p=p.filter(z=>z.pts>=0),!p.length)return;r===0?y=0:i&&!g?y=Math.max(0,S):y=p[0].pts}if(t.segmentCodec==="aac"){const z=this.config.maxAudioFramesDrift;for(let X=0,P=y;X=z*h&&K0){D+=T;try{k=new Uint8Array(D)}catch(K){this.observer.emit(m.ERROR,m.ERROR,{type:N.MUX_ERROR,details:L.REMUX_ALLOC_ERROR,fatal:!1,error:K,bytes:D,reason:"fail allocating audio mdat ".concat(D)});return}d||(new DataView(k.buffer).setUint32(0,D),k.set(v.types.mdat,4))}else return;k.set(M,T);const Y=M.byteLength;T+=Y,f.push(new Gs(!0,c,Y,0)),A=W}const _=f.length;if(!_)return;const I=f[f.length-1];this.nextAudioPts=y=A+l*I.duration;const O=d?new Uint8Array(0):v.moof(t.sequenceNumber++,R/l,tt({},t,{samples:f}));t.samples=[];const w=R/n,V=y/n,j={data1:O,data2:k,startPTS:w,endPTS:V,startDTS:w,endDTS:V,type:"audio",hasAudio:!0,hasVideo:!1,nb:_};return this.isAudioContiguous=!0,j}remuxEmptyAudio(t,e,s,i){const r=t.inputTimeScale,n=t.samplerate?t.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,f=o*$s,g=Math.ceil((d-u)/f),p=Bs.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(x.warn("[mp4-remuxer]: remux empty Audio"),!p){x.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const T=[];for(let y=0;y4294967296;)a+=e;return a}function xa(a){for(let t=0;tn.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class Gs{constructor(t,e,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=s,this.cts=i,this.flags=new Ea(t)}}class Ea{constructor(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}}class Sa{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(t){this.initPTS=t,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(t,e,s,i){this.audioCodec=e,this.videoCodec=s,this.generateInitSegment($r(t,i)),this.emitInitSegment=!0}generateInitSegment(t){let{audioCodec:e,videoCodec:s}=this;if(!(t!=null&&t.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=xi(t);e||(e=Ks(i.audio,H.AUDIO)),s||(s=Ks(i.video,H.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:e+","+s,initSegment:t,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:t,id:"main"}:x.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(t,e,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};F(h)||(h=this.lastEndTime=r||0);const d=e.samples;if(!(d!=null&&d.length))return u;const f={initPTS:void 0,timescale:1};let g=this.initData;if((o=g)!=null&&o.length||(this.generateInitSegment(d),g=this.initData),!((l=g)!=null&&l.length))return x.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const p=Kr(d,g),T=Gr(g,d),y=T===null?r:T;(va(c,y,r,p)||f.timescale!==c.timescale&&n)&&(f.initPTS=y-r,c&&c.timescale===1&&x.warn("Adjusting initPTS by ".concat(f.initPTS-c.baseTime)),this.initPTS=c={baseTime:f.initPTS,timescale:1});const S=t?y-c.baseTime/c.timescale:h,E=S+p;Vr(g,d,c.baseTime/c.timescale),p>0?this.lastEndTime=E:(x.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const R=!!g.audio,A=!!g.video;let k="";R&&(k+="audio"),A&&(k+="video");const D={data1:d,startPTS:S,startDTS:S,endPTS:E,endDTS:E,type:k,hasAudio:R,hasVideo:A,nb:1,dropped:0};return u.audio=D.type==="audio"?D:void 0,u.video=D.type!=="audio"?D:void 0,u.initSegment=f,u.id3=Hi(s,r,c,c),i.samples.length&&(u.text=Vi(i,r,c)),u}}function va(a,t,e,s){if(a===null)return!0;const i=Math.max(s,1),r=t-a.baseTime/a.timescale;return Math.abs(r-e)>i}function Ks(a,t){const e=a==null?void 0:a.codec;return e&&e.length>4?e:e==="hvc1"||e==="hev1"?"hvc1.1.6.L120.90":e==="av01"?"av01.0.04M.08":e==="avc1"||t===H.VIDEO?"avc1.42e01e":"mp4a.40.5"}let Lt;try{Lt=self.performance.now.bind(self.performance)}catch{x.debug("Unable to use Performance API on this environment"),Lt=typeof self<"u"&&self.Date.now}const Ie=[{demux:ra,remux:Sa},{demux:bt,remux:Re},{demux:sa,remux:Re},{demux:ga,remux:Re}];class Hs{constructor(t,e,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=s,this.vendor=i,this.id=r}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,s,i){const r=s.transmuxing;r.executeStart=Lt();let n=new Uint8Array(t);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:f,initSegmentChange:g}=i||o,{audioCodec:p,videoCodec:T,defaultInitPts:y,duration:S,initSegmentData:E}=l,R=Aa(n,e);if(R&&R.method==="AES-128"){const C=this.getDecrypter();if(C.isSync()){let _=C.softwareDecrypt(n,R.key.buffer,R.iv.buffer);if(s.part>-1&&(_=C.flush()),!_)return r.executeEnd=Lt(),be(s);n=new Uint8Array(_)}else return this.decryptionPromise=C.webCryptoDecrypt(n,R.key.buffer,R.iv.buffer).then(_=>{const I=this.push(_,null,s);return this.decryptionPromise=null,I}),this.decryptionPromise}const A=this.needsProbing(h,u);if(A){const C=this.configureTransmuxer(n);if(C)return x.warn("[transmuxer] ".concat(C.message)),this.observer.emit(m.ERROR,m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:C,reason:C.message}),r.executeEnd=Lt(),be(s)}(h||u||g||A)&&this.resetInitSegment(E,p,T,S,e),(h||g||A)&&this.resetInitialTimestamp(y),c||this.resetContiguity();const k=this.transmux(n,R,f,d,s),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,r.executeEnd=Lt(),k}flush(t){const e=t.transmuxing;e.executeStart=Lt();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(t));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,t))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return e.executeEnd=Lt(),[be(t)];const h=l.flush(o);return re(h)?h.then(u=>(this.flushRemux(n,u,t),n)):(this.flushRemux(n,h,t),n)}flushRemux(t,e,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=e,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;x.log("[transmuxer.ts]: Flushed fragment ".concat(s.sn).concat(s.part>-1?" p: "+s.part:""," of level ").concat(s.level));const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);t.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=Lt()}resetInitialTimestamp(t){const{demuxer:e,remuxer:s}=this;!e||!s||(e.resetTimeStamp(t),s.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;!t||!e||(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(t,e,s,i),o.resetInitSegment(t,e,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,s,i,r){let n;return e&&e.method==="SAMPLE-AES"?n=this.transmuxSampleAes(t,e,s,i,r):n=this.transmuxUnencrypted(t,s,i,r),n}transmuxUnencrypted(t,e,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,e,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(t,e,s,i,r){return this.demuxer.demuxSampleAes(t,e,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(t){const{config:e,observer:s,typeSupported:i,vendor:r}=this;let n;for(let u=0,d=Ie.length;u0&&t!=null&&t.key!=null&&t.iv!==null&&t.method!=null&&(e=t),e}const be=a=>({remuxResult:{},chunkMeta:a});function re(a){return"then"in a&&a.then instanceof Function}class La{constructor(t,e,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class Ra{constructor(t,e,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var Wi={exports:{}};(function(a){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new i(h,u||l,d),g=e?e+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],f]:l._events[g].push(f):(l._events[g]=f,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)t.call(h,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=e?e+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,g=new Array(f);d!1};class Yi{constructor(t,e,s,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=t.config;this.hls=t,this.id=e,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=s,this.onFlush=i;const n=(c,h)=>{h=h||{},h.frag=this.frag,h.id=this.id,c===m.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new as,this.observer.on(m.FRAG_DECRYPTED,n),this.observer.on(m.ERROR,n);const o={mp4:De.isTypeSupported("video/mp4"),mpeg:De.isTypeSupported("audio/mpeg"),mp3:De.isTypeSupported('audio/mp4; codecs="mp3"')},l=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||qn())){try{r.workerPath?(x.log("loading Web Worker ".concat(r.workerPath,' for "').concat(e,'"')),this.workerContext=Xn(r.workerPath)):(x.log('injecting Web Worker for "'.concat(e,'"')),this.workerContext=jn()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error("".concat(u.message," (").concat(u.filename,":").concat(u.lineno,")"));r.enableWorker=!1,x.warn('Error in "'.concat(e,'" Web Worker, fallback to inline')),this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:o,vendor:l,id:e,config:JSON.stringify(r)})}catch(h){x.warn('Error setting up "'.concat(e,'" Web Worker, fallback to inline'),h),this.resetWorker(),this.error=null,this.transmuxer=new Hs(this.observer,o,r,l,e)}return}this.transmuxer=new Hs(this.observer,o,r,l,e)}resetWorker(){if(this.workerContext){const{worker:t,objectURL:e}=this.workerContext;e&&self.URL.revokeObjectURL(e),t.removeEventListener("message",this.onwmsg),t.onerror=null,t.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(t,e,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:f}=this,g=n?n.start:r.start,p=r.decryptdata,T=this.frag,y=!(T&&r.cc===T.cc),S=!(T&&c.level===T.level),E=T?c.sn-T.sn:-1,R=this.part?c.part-this.part.index:-1,A=E===0&&c.id>1&&c.id===(T==null?void 0:T.stats.chunkCount),k=!S&&(E===1||E===0&&(R===1||A&&R<=0)),D=self.performance.now();(S||E||r.stats.parsing.start===0)&&(r.stats.parsing.start=D),n&&(R||!k)&&(n.stats.parsing.start=D);const C=!(T&&((u=r.initSegment)==null?void 0:u.url)===((d=T.initSegment)==null?void 0:d.url)),_=new Ra(y,k,l,S,g,C);if(!k||y||C){x.log("[transmuxer-interface, ".concat(r.type,"]: Starting new transmux session for sn: ").concat(c.sn," p: ").concat(c.part," level: ").concat(c.level," id: ").concat(c.id,"\n discontinuity: ").concat(y,"\n trackSwitch: ").concat(S,"\n contiguous: ").concat(k,"\n accurateTimeOffset: ").concat(l,"\n timeOffset: ").concat(g,"\n initSegmentChange: ").concat(C));const I=new La(s,i,e,o,h);this.configureTransmuxer(I)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:t,decryptdata:p,chunkMeta:c,state:_},t instanceof ArrayBuffer?[t]:[]);else if(f){const I=f.push(t,p,c,_);re(I)?(f.async=!0,I.then(O=>{this.handleTransmuxComplete(O)}).catch(O=>{this.transmuxerError(O,c,"transmuxer-interface push error")})):(f.async=!1,this.handleTransmuxComplete(I))}}flush(t){t.transmuxing.start=self.performance.now();const{transmuxer:e}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:t});else if(e){let s=e.flush(t);re(s)||e.async?(re(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,t)}).catch(r=>{this.transmuxerError(r,t,"transmuxer-interface flush error")})):this.handleFlushResult(s,t)}}transmuxerError(t,e,s){this.hls&&(this.error=t,this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,chunkMeta:e,fatal:!1,error:t,err:t,reason:s}))}handleFlushResult(t,e){t.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(e)}onWorkerMessage(t){const e=t.data,s=this.hls;switch(e.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(e.data);break}case"flush":{this.onFlush(e.data);break}case"workerLog":x[e.data.logType]&&x[e.data.logType](e.data.message);break;default:{e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,s.trigger(e.event,e.data);break}}}configureTransmuxer(t){const{transmuxer:e}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:t}):e&&e.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}const ba=250,Ce=2,Da=.1,Ca=.05;class ka{constructor(t,e,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(t,e){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==t){if(this.moved=!0,r!==null){if(this.stallReported){const y=self.performance.now()-r;x.warn("playback not stuck anymore @".concat(n,", after ").concat(Math.round(y),"ms")),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!q.getBuffered(i).length)return;const h=q.bufferInfo(i,n,0),u=h.len>0,d=h.nextStart||0;if(!u&&!d)return;if(o){const y=h.len>Ce,S=!d||e&&e.start<=n||d-n>Ce&&!this.fragmentTracker.getPartialFragment(n);if(y||S)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var f;const y=Math.max(d,h.start||0)-n,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,R=(S==null||(f=S.details)==null?void 0:f.live)?S.details.targetduration*2:Ce,A=this.fragmentTracker.getPartialFragment(n);if(y>0&&(y<=R||A)){this._trySkipBufferHole(A);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const p=g-r;if(!o&&p>=ba&&(this._reportStall(h),!this.media))return;const T=q.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(T,p)}_tryFixBufferStall(t,e){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(t.len>s.maxBufferHole||t.nextStart&&t.nextStart-ns.highBufferWatchdogPeriod*1e3&&(x.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(t){const{hls:e,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error("Playback stalling at @".concat(s.currentTime," due to low buffer (").concat(JSON.stringify(t),")"));x.warn(r.message),e.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len})}}_trySkipBufferHole(t){const{config:e,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=q.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>e.maxBufferHole){const{fragmentTracker:d}=this;let f=!1;if(r===0){const g=d.getAppendedFrag(0,U.MAIN);g&&o1?(i=0,this.bitrateTest=!0):i=s.nextAutoLevel),this.level=s.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&t===-1&&(this.log("Override startPosition with lastCurrentTime @".concat(e.toFixed(3))),t=e),this.state=b.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=b.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case b.WAITING_LEVEL:{var t;const{levels:s,level:i}=this,r=s==null||(t=s[i])==null?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=b.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=b.IDLE;break}break}case b.FRAG_LOADING_WAITING_RETRY:{var e;const s=self.performance.now(),i=this.retryDate;(!i||s>=i||(e=this.media)!=null&&e.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=b.IDLE)}break}this.state===b.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:s,media:i}=this,{config:r,nextLoadLevel:n}=t;if(e===null||!i&&(this.startFragRequested||!r.startFragPrefetch)||this.altAudio&&this.audioOnly||!(s!=null&&s[n]))return;const o=s[n],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const T={};this.altAudio&&(T.type="video"),this.hls.trigger(m.BUFFER_EOS,T),this.state=b.ENDED;return}t.loadLevel!==n&&t.manualLevel===-1&&this.log("Adapting to level ".concat(n," from level ").concat(this.level)),this.level=t.nextLoadLevel=n;const h=o.details;if(!h||this.state===b.WAITING_LEVEL||h.live&&this.levelLastLoaded!==n){this.level=n,this.state=b.WAITING_LEVEL;return}const u=l.len,d=this.getMaxBufferLength(o.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const f=this.backtrackFragment?this.backtrackFragment.start:l.end;let g=this.getNextFragment(f,h);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==et.OK){var p;const y=((p=this.backtrackFragment)!=null?p:g).sn-h.startSN,S=h.fragments[y-1];S&&g.cc===S.cc&&(g=S,this.fragmentTracker.removeFragment(S))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,f)){if(!g.gap){const y=this.audioOnly&&!this.altAudio?H.AUDIO:H.VIDEO,S=(y===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;S&&this.afterBufferFlushed(S,y,U.MAIN)}g=this.getNextFragmentLoopLoading(g,h,l,U.MAIN,d)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,o,f))}loadFragment(t,e,s){const i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===et.NOT_LOADED||i===et.PARTIAL?t.sn==="initSegment"?this._loadInitSegment(t,e):this.bitrateTest?(this.log("Fragment ".concat(t.sn," of level ").concat(t.level," is being downloaded to test bitrate and will not be buffered")),this._loadBitrateTestFrag(t,e)):(this.startFragRequested=!0,super.loadFragment(t,e,s)):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,U.MAIN)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:e}=this;if(e!=null&&e.readyState){let s;const i=this.getAppendedFrag(e.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{r=n.audioCodec,r&&(r.indexOf("mp4a.40.2")!==-1&&(s=!0),r.indexOf("mp4a.40.5")!==-1&&(i=!0))}),this.audioCodecSwitch=s&&i&&!Yn(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:s}=this;if(!s||this.state!==b.IDLE)return;const i=s[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=b.WAITING_LEVEL)}onLevelLoaded(t,e){var s;const{levels:i}=this,r=e.level,n=e.details,o=n.totalduration;if(!i){this.warn("Levels were reset while loading level ".concat(r));return}this.log("Level ".concat(r," loaded [").concat(n.startSN,",").concat(n.endSN,"]").concat(n.lastPartSn?"[part-".concat(n.lastPartSn,"-").concat(n.lastPartIndex,"]"):"",", cc [").concat(n.startCC,", ").concat(n.endCC,"] duration:").concat(o));const l=i[r],c=this.fragCurrent;c&&(this.state===b.FRAG_LOADING||this.state===b.FRAG_LOADING_WAITING_RETRY)&&(c.level!==e.level||c.urlId!==l.urlId)&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details)}if(l.details=n,this.levelLastLoaded=r,this.hls.trigger(m.LEVEL_UPDATED,{details:n,level:r}),this.state===b.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=b.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:s,part:i,payload:r}=t,{levels:n}=this;if(!n){this.warn("Levels were reset while fragment load was in progress. Fragment ".concat(s.sn," of level ").concat(s.level," will not be buffered"));return}const o=n[s.level],l=o.details;if(!l){this.warn("Dropping fragment ".concat(s.sn," of level ").concat(s.level," after level details were reset")),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(e=s.initSegment)==null?void 0:e.data,d=this._getAudioCodec(o),f=this.transmuxer=this.transmuxer||new Yi(this.hls,U.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=i?i.index:-1,p=g!==-1,T=new Ze(s.level,s.sn,s.stats.chunkCount,r.byteLength,g,p),y=this.initPTS[s.cc];f.push(r,u,d,c,s,i,l.totalduration,h,T,y)}onAudioTrackSwitching(t,e){const s=this.altAudio;if(!!!e.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(m.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const s=e.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(t,e){const s=e.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log("Alternate track found, use ".concat(r,".buffered to schedule main fragment loading")),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:s,part:i}=e;if(s&&s.type!==U.MAIN)return;if(this.fragContextChanged(s)){this.warn("Fragment ".concat(s.sn).concat(i?" p: "+i.index:""," of level ").concat(s.level," finished buffering, but was aborted. state: ").concat(this.state)),this.state===b.PARSED&&(this.state=b.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(t,e){var s;if(e.fatal){this.state=b.ERROR;return}switch(e.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.MAIN,e);break;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===b.WAITING_LEVEL&&((s=e.context)==null?void 0:s.type)===G.LEVEL&&(this.state=b.IDLE);break;case L.BUFFER_FULL_ERROR:if(!e.parent||e.parent!=="main")return;this.reduceLengthAndFlushBuffer(e)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}checkBuffer(){const{media:t,gapController:e}=this;if(!(!t||!e||!t.readyState)){if(this.loadedmetadata||!q.getBuffered(t).length){const s=this.state!==b.IDLE?this.fragCurrent:null;e.poll(this.lastCurrentTime,s)}this.lastCurrentTime=t.currentTime}}onFragLoadEmergencyAborted(){this.state=b.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==H.AUDIO||this.audioOnly&&!this.altAudio){const s=(e===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,e,U.MAIN)}}onLevelsUpdated(t,e){this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let s=this.startPosition;if(s>=0&&e0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(t))return;e.fragmentError=0,this.state=b.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=t.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(m.FRAG_LOADED,s),t.bitrateTest=!1})}_handleTransmuxComplete(t){var e;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=t,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:f,initSegment:g}=r,{details:p}=h,T=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=b.PARSING,g){if(g!=null&&g.tracks){const E=l.initSegment||l;this._bufferInitSegment(h,g.tracks,E,n),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:s,tracks:g.tracks})}const y=g.initPTS,S=g.timescale;F(y)&&(this.initPTS[l.cc]={baseTime:y,timescale:S},i.trigger(m.INIT_PTS_FOUND,{frag:l,id:s,initPTS:y,timescale:S}))}if(u&&p&&l.sn!=="initSegment"){const y=p.fragments[l.sn-1-p.startSN],S=l.sn===p.startSN,E=!y||l.cc>y.cc;if(r.independent!==!1){const{startPTS:R,endPTS:A,startDTS:k,endDTS:D}=u;if(c)c.elementaryStreams[u.type]={startPTS:R,endPTS:A,startDTS:k,endDTS:D};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!E&&(this.couldBacktrack=!0),u.dropped&&u.independent){const C=this.getMainFwdBufferInfo(),_=(C?C.end:this.getLoadPosition())+this.config.maxBufferHole,I=u.firstKeyFramePTS?u.firstKeyFramePTS:R;if(!S&&_{const h=e[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,U.MAIN)}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=b.IDLE}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&t.seeking===!1){const s=t.currentTime;if(q.isBuffered(t,s)?e=this.getAppendedFrag(s):q.isBuffered(t,s+.1)&&(e=this.getAppendedFrag(s+.1)),e){this.backtrackFragment=null;const i=this.fragPlaying,r=e.level;(!i||e.sn!==i.sn||i.level!==r||e.urlId!==i.urlId)&&(this.fragPlaying=e,this.hls.trigger(m.FRAG_CHANGED,{frag:e}),(!i||i.level!==r)&&this.hls.trigger(m.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){const t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}get currentProgramDateTime(){const t=this.media;if(t){const e=t.currentTime,s=this.currentFrag;if(s&&F(e)&&F(s.programDateTime)){const i=s.programDateTime+(e-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class Mt{constructor(t,e=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=s}sample(t,e){const s=Math.pow(this.alpha_,t);this.estimate_=e*(1-s)+s*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class Pa{constructor(t,e,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Mt(t),this.fast_=new Mt(e),this.defaultTTFB_=i,this.ttfb_=new Mt(t)}update(t,e){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==t&&(this.slow_=new Mt(t,s.getEstimate(),s.getTotalWeight())),i.halfLife!==e&&(this.fast_=new Mt(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.ttfb_=new Mt(t,r.getEstimate(),r.getTotalWeight()))}sample(t,e){t=Math.max(t,this.minDelayMs_);const s=8*e,i=t/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(t){const e=t/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(s,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Fa{constructor(t){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;const e=t.config;this.bwEstimator=new Pa(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(m.FRAG_LOADING,this.onFragLoading,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:t}=this;t.off(m.FRAG_LOADING,this.onFragLoading,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(t,e){var s;const i=e.frag;this.ignoreFragment(i)||(this.fragCurrent=i,this.partCurrent=(s=e.part)!=null?s:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(t,e){this.clearTimer()}getTimeToLoadFrag(t,e,s,i){const r=t+s/e,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(t,e){const s=this.hls.config,{total:i,bwEstimate:r}=e.stats;F(i)&&F(r)&&(this.lastLevelLoadSec=8*i/r),e.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:t,partCurrent:e,hls:s}=this,{autoLevelEnabled:i,media:r}=s;if(!t||!r)return;const n=performance.now(),o=e?e.stats:t.stats,l=e?e.duration:t.duration,c=n-o.loading.start;if(o.aborted||o.loaded&&o.loaded===o.total||t.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||r.paused||!r.playbackRate||!r.readyState)return;const h=s.mainForwardBufferInfo;if(h===null)return;const u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(r.playbackRate);if(c<=Math.max(u,1e3*(l/(d*2))))return;const f=h.len/d;if(f>=2*l/d)return;const g=o.loading.first?o.loading.first-o.loading.start:-1,p=o.loaded&&g>-1,T=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:S}=s,E=y[t.level],R=o.total||Math.max(o.loaded,Math.round(l*E.maxBitrate/8));let A=c-g;A<1&&p&&(A=Math.min(c,o.loaded*8/T));const k=p?o.loaded*1e3/A:0,D=k?(R-o.loaded)/k:R*8/T+u/1e3;if(D<=f)return;const C=k?k*8:T;let _=Number.POSITIVE_INFINITY,I;for(I=t.level-1;I>S;I--){const O=y[I].maxBitrate;if(_=this.getTimeToLoadFrag(u/1e3,C,l*O,!y[I].details),_=D||_>l*10||(s.nextLoadLevel=I,p?this.bwEstimator.sample(c-Math.min(u,g),o.loaded):this.bwEstimator.sampleTTFB(c),this.clearTimer(),x.warn("[abr] Fragment ".concat(t.sn).concat(e?" part "+e.index:""," of level ").concat(t.level," is loading too slowly;\n Time to underbuffer: ").concat(f.toFixed(3)," s\n Estimated load time for current fragment: ").concat(D.toFixed(3)," s\n Estimated load time for down switch fragment: ").concat(_.toFixed(3)," s\n TTFB estimate: ").concat(g,"\n Current BW estimate: ").concat(F(T)?(T/1024).toFixed(3):"Unknown"," Kb/s\n New BW estimate: ").concat((this.bwEstimator.getEstimate()/1024).toFixed(3)," Kb/s\n Aborting and switching to level ").concat(I)),t.loader&&(this.fragCurrent=this.partCurrent=null,t.abortRequests()),s.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:o}))}onFragLoaded(t,{frag:e,part:s}){const i=s?s.stats:e.stats;if(e.type===U.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:e.duration,n=this.hls.levels[e.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(e.bitrateTest){const r={stats:i,frag:e,part:s,id:e.type};this.onFragBuffered(m.FRAG_BUFFERED,r),e.bitrateTest=!1}}}onFragBuffered(t,e){const{frag:s,part:i}=e,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==U.MAIN||t.sn==="initSegment"}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const t=this._nextAutoLevel,e=this.bwEstimator;if(t!==-1&&!e.canEstimate())return t;let s=this.getNextABRAutoLevel();if(t!==-1){const i=this.hls.levels;if(i.length>Math.max(t,s)&&i[t].loadError<=i[s].loadError)return t}return t!==-1&&(s=Math.min(t,s)),s}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n,media:o}=s,l=e?e.duration:t?t.duration:0,c=o&&o.playbackRate!==0?Math.abs(o.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,u=s.mainForwardBufferInfo,d=(u?u.len:0)/c;let f=this.findBestLevel(h,n,i,d,r.abrBandWidthFactor,r.abrBandWidthUpFactor);if(f>=0)return f;x.trace("[abr] ".concat(d?"rebuffering expected":"buffer is empty",", finding optimal quality level"));let g=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay,p=r.abrBandWidthFactor,T=r.abrBandWidthUpFactor;if(!d){const y=this.bitrateTestDelay;y&&(g=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-y,x.trace("[abr] bitrate test took ".concat(Math.round(1e3*y),"ms, set first fragment max fetchDuration to ").concat(Math.round(1e3*g)," ms")),p=T=1)}return f=this.findBestLevel(h,n,i,d+g,p,T),Math.max(f,0)}findBestLevel(t,e,s,i,r,n){var o;const{fragCurrent:l,partCurrent:c,lastLoadedFragLevel:h}=this,{levels:u}=this.hls,d=u[h],f=!!(d!=null&&(o=d.details)!=null&&o.live),g=d==null?void 0:d.codecSet,p=c?c.duration:l?l.duration:0,T=this.bwEstimator.getEstimateTTFB()/1e3;let y=e,S=-1;for(let E=s;E>=e;E--){const R=u[E];if(!R||g&&R.codecSet!==g){R&&(y=Math.min(E,y),S=Math.max(E,S));continue}S!==-1&&x.trace("[abr] Skipped level(s) ".concat(y,"-").concat(S,' with CODECS:"').concat(u[S].attrs.CODECS,'"; not compatible with "').concat(d.attrs.CODECS,'"'));const A=R.details,k=(c?A==null?void 0:A.partTarget:A==null?void 0:A.averagetargetduration)||p;let D;E<=h?D=r*t:D=n*t;const C=u[E].maxBitrate,_=this.getTimeToLoadFrag(T,D,C*k,A===void 0);if(x.trace("[abr] level:".concat(E," adjustedbw-bitrate:").concat(Math.round(D-C)," avgDuration:").concat(k.toFixed(1)," maxFetchDuration:").concat(i.toFixed(1)," fetchDuration:").concat(_.toFixed(1))),D>C&&(_===0||!F(_)||f&&!this.bitrateTestDelay||_0&&t===-1?(this.log("Override startPosition with lastCurrentTime @".concat(e.toFixed(3))),t=e,this.state=b.IDLE):(this.loadedmetadata=!1,this.state=b.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}doTick(){switch(this.state){case b.IDLE:this.doTickIdle();break;case b.WAITING_TRACK:{var t;const{levels:s,trackId:i}=this,r=s==null||(t=s[i])==null?void 0:t.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=b.WAITING_INIT_PTS}break}case b.FRAG_LOADING_WAITING_RETRY:{var e;const s=performance.now(),i=this.retryDate;(!i||s>=i||(e=this.media)!=null&&e.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=b.IDLE);break}case b.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=b.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc (".concat(i.cc,") cancelled because video is at cc ").concat(this.videoTrackCC)),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=q.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);Ve(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log("Waiting fragment cc (".concat(i.cc,") @ ").concat(i.start," cancelled because another fragment at ").concat(c.end," is needed")),this.clearWaitingFragment())}}else this.state=b.IDLE}}this.onTickEnd()}clearWaitingFragment(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=b.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:t}=this;t!=null&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){const{hls:t,levels:e,media:s,trackId:i}=this,r=t.config;if(!(e!=null&&e[i])||!s&&(this.startFragRequested||!r.startFragPrefetch))return;const n=e[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(o)){this.state=b.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,H.AUDIO,U.AUDIO));const c=this.getFwdBufferInfo(l,U.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){t.trigger(m.BUFFER_EOS,{type:"audio"}),this.state=b.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,U.MAIN),f=c.len,g=this.getMaxBufferLength(d==null?void 0:d.len);if(f>=g&&!u)return;const T=o.fragments[0].start;let y=c.end;if(u&&s){const A=this.getLoadPosition();h&&u.attrs!==h.attrs&&(y=A),o.PTSKnown&&AT||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=T+.05)}let S=this.getNextFragment(y,o),E=!1;if(S&&this.isLoopLoading(S,y)&&(E=!!S.gap,S=this.getNextFragmentLoopLoading(S,o,c,U.MAIN,g)),!S){this.bufferFlushed=!0;return}const R=d&&S.start>d.end+o.targetduration;if(R||!(d!=null&&d.len)&&c.len){const A=this.getAppendedFrag(S.start,U.MAIN);if(A===null||(E||(E=!!A.gap||!!R&&d.len===0),R&&!E||E&&c.nextStart&&c.nextStartnew Wt(s))}onAudioTrackSwitching(t,e){const s=!!e.url;this.trackId=e.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(Vs):this.resetTransmuxer(),s?(this.switchingTrack=e,this.state=b.IDLE):(this.switchingTrack=null,this.bufferedTrack=e,this.state=b.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(t,e){this.mainDetails=e.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(m.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(t,e){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=e;return}const{levels:i}=this,{details:r,id:n}=e;if(!i){this.warn("Audio tracks were reset while loading level ".concat(n));return}this.log("Track ".concat(n," loaded [").concat(r.startSN,",").concat(r.endSN,"]").concat(r.lastPartSn?"[part-".concat(r.lastPartSn,"-").concat(r.lastPartIndex,"]"):"",",duration:").concat(r.totalduration));const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const c=this.mainDetails;if(r.deltaUpdateFailed||!c)return;!o.details&&r.hasProgramDateTime&&c.hasProgramDateTime?(_i(r,c),l=r.fragments[0].start):l=this.alignPlaylists(r,o.details)}o.details=r,this.levelLastLoaded=n,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(o.details,l),this.state===b.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=b.IDLE),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:s,part:i,payload:r}=t,{config:n,trackId:o,levels:l}=this;if(!l){this.warn("Audio tracks were reset while fragment load was in progress. Fragment ".concat(s.sn," of level ").concat(s.level," will not be buffered"));return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Yi(this.hls,U.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const f=this.initPTS[s.cc],g=(e=s.initSegment)==null?void 0:e.data;if(f!==void 0){const T=i?i.index:-1,y=T!==-1,S=new Ze(s.level,s.sn,s.stats.chunkCount,r.byteLength,T,y);d.push(r,g,u,"",s,i,h.totalduration,!1,S,f)}else{this.log("Unknown video PTS for cc ".concat(s.cc,", waiting for video PTS before demuxing audio frag ").concat(s.sn," of [").concat(h.startSN," ,").concat(h.endSN,"],track ").concat(o));const{cache:p}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new qi,complete:!1};p.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=b.WAITING_INIT_PTS}}_handleFragmentLoadComplete(t){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(t,e){const s=e.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)}onFragBuffered(t,e){const{frag:s,part:i}=e;if(s.type!==U.AUDIO){if(!this.loadedmetadata&&s.type===U.MAIN){const r=this.videoBuffer||this.media;r&&q.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn("Fragment ".concat(s.sn).concat(i?" p: "+i.index:""," of level ").concat(s.level," finished buffering, but was aborted. state: ").concat(this.state,", audioSwitch: ").concat(this.switchingTrack?this.switchingTrack.name:"false"));return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,ct({},r)))}this.fragBufferedComplete(s,i)}onError(t,e){var s;if(e.fatal){this.state=b.ERROR;return}switch(e.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.AUDIO,e);break;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===b.WAITING_TRACK&&((s=e.context)==null?void 0:s.type)===G.AUDIO_TRACK&&(this.state=b.IDLE);break;case L.BUFFER_FULL_ERROR:if(!e.parent||e.parent!=="audio")return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}onBufferFlushed(t,{type:e}){e===H.AUDIO&&(this.bufferFlushed=!0,this.state===b.ENDED&&(this.state=b.IDLE))}_handleTransmuxComplete(t){var e;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=t,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:f,id3:g,initSegment:p}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=b.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),p!=null&&p.tracks){const T=l.initSegment||l;this._bufferInitSegment(p.tracks,T,n),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:p.tracks})}if(d){const{startPTS:T,endPTS:y,startDTS:S,endDTS:E}=d;c&&(c.elementaryStreams[H.AUDIO]={startPTS:T,endPTS:y,startDTS:S,endDTS:E}),l.setElementaryStreamInfo(H.AUDIO,T,y,S,E),this.bufferFragmentData(d,l,c,n)}if(g!=null&&(e=g.samples)!=null&&e.length){const T=tt({id:s,frag:l,details:u},g);i.trigger(m.FRAG_PARSING_METADATA,T)}if(f){const T=tt({id:s,frag:l,details:u},f);i.trigger(m.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(t,e,s){if(this.state!==b.PARSING)return;t.video&&delete t.video;const i=t.audio;if(!i)return;i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:".concat(i.container,", codecs[parsed]=[").concat(i.codec,"]")),this.hls.trigger(m.BUFFER_CODECS,t);const r=i.initSegment;if(r!=null&&r.byteLength){const n={type:"audio",frag:e,part:null,chunkMeta:s,parent:e.type,data:r};this.hls.trigger(m.BUFFER_APPENDING,n)}this.tick()}loadFragment(t,e,s){const i=this.fragmentTracker.getState(t);if(this.fragCurrent=t,this.switchingTrack||i===et.NOT_LOADED||i===et.PARTIAL){var r;t.sn==="initSegment"?this._loadInitSegment(t,e):(r=e.details)!=null&&r.live&&!this.initPTS[t.cc]?(this.log("Waiting for video PTS in continuity counter ".concat(t.cc," of live stream before loading audio fragment ").concat(t.sn," of level ").concat(this.trackId)),this.state=b.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(t,e,s))}else this.clearTrackerIfNeeded(t)}completeAudioSwitch(t){const{hls:e,media:s,bufferedTrack:i}=this,r=i==null?void 0:i.attrs,n=t.attrs;s&&r&&(r.CHANNELS!==n.CHANNELS||r.NAME!==n.NAME||r.LANGUAGE!==n.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(m.AUDIO_TRACK_SWITCHED,ct({},t))}}class Na extends Je{constructor(t){super(t,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:s,groupId:i,details:r}=e,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn("Track with id:".concat(s," and group:").concat(i," not found in active group ").concat(n.groupId));return}const o=n.details;n.details=e.details,this.log("audio-track ".concat(s,' "').concat(n.name,'" lang:').concat(n.lang," group:").concat(i," loaded [").concat(r.startSN,"-").concat(r.endSN,"]")),s===this.trackId&&this.playlistLoaded(s,e,o)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!(e!=null&&e.audioGroupIds))return;const s=e.audioGroupIds[e.urlId];if(this.groupId!==s){this.groupId=s||null;const i=this.tracks.filter(n=>!s||n.groupId===s);this.selectDefaultTrack&&!i.some(n=>n.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;const r={audioTracks:i};this.log("Updating audio tracks, ".concat(i.length," track(s) found in group:").concat(s)),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,r),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(t,e){e.fatal||!e.context||e.context.type===G.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(e))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();const s=this.currentTrack;e[this.trackId];const i=e[t],{groupId:r,name:n}=i;if(this.log("Switching to audio-track ".concat(t,' "').concat(n,'" lang:').concat(i.lang," group:").concat(r)),this.trackId=t,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,ct({},i)),i.details&&!i.details.live)return;const o=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(o)}selectInitialTrack(){const t=this.tracksInGroup,e=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(e!==-1)this.setAudioTrack(e);else{const s=new Error("No track found for running audio group-ID: ".concat(this.groupId," track count: ").concat(t.length));this.warn(s.message),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:s})}}findTrackId(t){const e=this.tracksInGroup;for(let s=0;sa[s]!==t[s])}const Ws=500;class Ba extends ss{constructor(t,e,s){super(t,e,s,"[subtitle-stream-controller]",U.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this),t.on(m.ERROR,this.onError,this),t.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this),t.off(m.ERROR,this.onError,this),t.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(t){this.stopLoad(),this.state=b.IDLE,this.setInterval(Ws),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:s,success:i}=e;if(this.fragPrevious=s,this.state=b.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let n;const o=s.start;for(let c=0;c=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s)}onBufferFlushing(t,e){const{startOffset:s,endOffset:i}=e;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;e.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew Wt(s));return}this.tracksBuffered=[],this.levels=e.map(s=>{const i=new Wt(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,U.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(t,e){if(this.currentTrackId=e.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}const s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.setInterval(Ws)}onSubtitleTrackLoaded(t,e){var s;const{details:i,id:r}=e,{currentTrackId:n,levels:o}=this;if(!o.length)return;const l=o[n];if(r>=o.length||r!==n||!l)return;this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(i.live||(s=l.details)!=null&&s.live){const h=this.mainDetails;if(i.deltaUpdateFailed||!h)return;const u=h.fragments[0];l.details?(c=this.alignPlaylists(i,l.details),c===0&&u&&(c=u.start,He(i,c))):i.hasProgramDateTime&&h.hasProgramDateTime?(_i(i,h),c=i.fragments[0].start):u&&(c=u.start,He(i,c))}l.details=i,this.levelLastLoaded=r,!this.startFragRequested&&(this.mainDetails||!i.live)&&this.setStartPosition(l.details,c),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===b.IDLE&&(Yt(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0))}_handleFragmentLoadComplete(t){const{frag:e,payload:s}=t,i=e.decryptdata,r=this.hls;if(!this.fragContextChanged(e)&&s&&s.byteLength>0&&i&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:e}),o}).then(o=>{const l=performance.now();r.trigger(m.FRAG_DECRYPTED,{frag:e,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn("".concat(o.name,": ").concat(o.message)),this.state=b.IDLE})}}doTick(){if(!this.media){this.state=b.IDLE;return}if(this.state===b.IDLE){const{currentTrackId:t,levels:e}=this,s=e[t];if(!e.length||!s||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=q.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,U.MAIN),h=s.details,u=this.getMaxBufferLength(c==null?void 0:c.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,f=d.length,g=h.edge;let p=null;const T=this.fragPrevious;if(og-y?0:y;p=Yt(T,d,Math.max(d[0].start,o),S),!p&&T&&T.start{if(i=i>>>0,i>r-1)throw new DOMException("Failed to execute '".concat(s,"' on 'TimeRanges': The index provided (").concat(i,") is greater than the maximum bound (").concat(r,")"));return t[i][s]};this.buffered={get length(){return t.length},end(s){return e("end",s,t.length)},start(s){return e("start",s,t.length)}}}}class Ga extends Je{constructor(t){super(t,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(m.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),ke(this.media.textTracks).forEach(e=>{Ut(e)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:s,details:i}=e,{trackId:r}=this,n=this.tracksInGroup[r];if(!n){this.warn("Invalid subtitle track id ".concat(s));return}const o=n.details;n.details=e.details,this.log("subtitle track ".concat(s," loaded [").concat(i.startSN,"-").concat(i.endSN,"]")),s===this.trackId&&this.playlistLoaded(s,e,o)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!(e!=null&&e.textGroupIds))return;const s=e.textGroupIds[e.urlId],i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==s){const r=this.tracks.filter(l=>!s||l.groupId===s);this.tracksInGroup=r;const n=this.findTrackId(i==null?void 0:i.name)||this.findTrackId();this.groupId=s||null;const o={subtitleTracks:r};this.log("Updating subtitle tracks, ".concat(r.length,' track(s) found in "').concat(s,'" group-id')),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,o),n!==-1&&this.setSubtitleTrack(n,i)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId,i)}findTrackId(t){const e=this.tracksInGroup;for(let s=0;so.groupId===this.groupId);if(t===-1)[].slice.call(i).forEach(o=>{o.mode="disabled"});else{const o=r[s];o&&(o.mode="disabled")}const n=r[t];n&&(n.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(t,e){var s;const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(s=i[t])!=null&&s.details)||t<-1||t>=i.length)return;this.clearTimer();const r=i[t];if(this.log("Switching to subtitle-track ".concat(t)+(r?' "'.concat(r.name,'" lang:').concat(r.lang," group:").concat(r.groupId):"")),this.trackId=t,r){const{id:n,groupId:o="",name:l,type:c,url:h}=r;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(r.url,e==null?void 0:e.details);this.loadPlaylist(u)}else this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:t})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=-1;const e=ke(this.media.textTracks);for(let s=0;s{e=r}),i={execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,t),s}executeNext(t){const{buffers:e,queues:s}=this,i=e[t],r=s[t];if(r.length){const n=r[0];try{n.execute()}catch(o){x.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(o),i!=null&&i.updating||(r.shift(),this.executeNext(t))}}}shiftAndExecuteNext(t){this.queues[t].shift(),this.executeNext(t)}current(t){return this.queues[t][0]}}const Ys=fe(),qs=/([ha]vc.)(?:\.[^.,]+)+/;class Ha{constructor(t){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:s}=this;x.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(m.MEDIA_ATTACHED,{media:e})),s&&s.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{x.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{x.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:s}=this;e&&e.src!==s&&x.error("Media element src was set while attaching MediaSource (".concat(s," > ").concat(e.src,")"))},this.hls=t,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.BUFFER_RESET,this.onBufferReset,this),t.on(m.BUFFER_APPENDING,this.onBufferAppending,this),t.on(m.BUFFER_CODECS,this.onBufferCodecs,this),t.on(m.BUFFER_EOS,this.onBufferEos,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(m.FRAG_PARSED,this.onFragParsed,this),t.on(m.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.BUFFER_RESET,this.onBufferReset,this),t.off(m.BUFFER_APPENDING,this.onBufferAppending,this),t.off(m.BUFFER_CODECS,this.onBufferCodecs,this),t.off(m.BUFFER_EOS,this.onBufferEos,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(m.FRAG_PARSED,this.onFragParsed,this),t.off(m.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ka(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){let s=2;(e.audio&&!e.video||!e.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,x.log("".concat(this.bufferCodecEventsExpected," bufferCodec event(s) expected"))}onMediaAttaching(t,e){const s=this.media=e.media;if(s&&Ys){const i=this.mediaSource=new Ys;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(i),this._objectUrl=s.src,s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:t,mediaSource:e,_objectUrl:s}=this;if(e){if(x.log("[buffer-controller]: media source detaching"),e.readyState==="open")try{e.endOfStream()}catch(i){x.warn("[buffer-controller]: onMediaDetaching: ".concat(i.message," while calling endOfStream"))}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(t.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),t.src===s?(t.removeAttribute("src"),t.load()):x.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(m.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(t=>{const e=this.sourceBuffer[t];try{e&&(this.removeBufferListeners(t),this.mediaSource&&this.mediaSource.removeSourceBuffer(e),this.sourceBuffer[t]=void 0)}catch(s){x.warn("[buffer-controller]: Failed to reset the ".concat(t," buffer"),s)}}),this._initSourceBuffer()}onBufferCodecs(t,e){const s=this.getSourceBufferTypes().length;Object.keys(e).forEach(i=>{if(s){const r=this.tracks[i];if(r&&typeof r.buffer.changeType=="function"){const{id:n,codec:o,levelCodec:l,container:c,metadata:h}=e[i],u=(r.levelCodec||r.codec).replace(qs,"$1"),d=(l||o).replace(qs,"$1");if(u!==d){const f="".concat(c,";codecs=").concat(l||o);this.appendChangeType(i,f),x.log("[buffer-controller]: switching codec ".concat(u," to ").concat(d)),this.tracks[i]={buffer:r.buffer,codec:o,container:c,levelCodec:l,metadata:h,id:n}}}}else this.pendingTracks[i]=e[i]}),!s&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())}appendChangeType(t,e){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[t];r&&(x.log("[buffer-controller]: changing ".concat(t," sourceBuffer type to ").concat(e)),r.changeType(e)),s.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:r=>{x.warn("[buffer-controller]: Failed to change ".concat(t," SourceBuffer type"),r)}};s.append(i,t)}onBufferAppending(t,e){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=e,u=h.buffering[o],d=self.performance.now();u.start=d;const f=l.stats.buffering,g=c?c.stats.buffering:null;f.start===0&&(f.start=d),g&&g.start===0&&(g.start=d);const p=r.audio;let T=!1;o==="audio"&&(p==null?void 0:p.container)==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const y=l.start,S={execute:()=>{if(u.executeStart=self.performance.now(),T){const E=this.sourceBuffer[o];if(E){const R=y-E.timestampOffset;Math.abs(R)>=.1&&(x.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to ".concat(y," (delta: ").concat(R,") sn: ").concat(l.sn,")")),E.timestampOffset=y)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const E=self.performance.now();u.executeEnd=u.end=E,f.first===0&&(f.first=E),g&&g.first===0&&(g.first=E);const{sourceBuffer:R}=this,A={};for(const k in R)A[k]=q.getBuffered(R[k]);this.appendError=0,this.hls.trigger(m.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:A})},onError:E=>{x.error("[buffer-controller]: Error encountered while trying to append to the ".concat(o," SourceBuffer"),E);const R={type:N.MEDIA_ERROR,parent:l.type,details:L.BUFFER_APPEND_ERROR,frag:l,part:c,chunkMeta:h,error:E,err:E,fatal:!1};E.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=L.BUFFER_FULL_ERROR:(this.appendError++,R.details=L.BUFFER_APPEND_ERROR,this.appendError>s.config.appendErrorMaxRetry&&(x.error("[buffer-controller]: Failed ".concat(s.config.appendErrorMaxRetry," times to append segment in sourceBuffer")),R.fatal=!0)),s.trigger(m.ERROR,R)}};i.append(S,o)}onBufferFlushing(t,e){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,e.startOffset,e.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:r})},onError:n=>{x.warn("[buffer-controller]: Failed to remove from ".concat(r," SourceBuffer"),n)}});e.type?s.append(i(e.type),e.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(t,e){const{frag:s,part:i}=e,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[H.AUDIOVIDEO]?r.push("audiovideo"):(n[H.AUDIO]&&r.push("audio"),n[H.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&x.warn("Fragments must have at least one ElementaryStreamType set. type: ".concat(s.type," level: ").concat(s.level," sn: ").concat(s.sn)),this.blockBuffers(o,r)}onFragChanged(t,e){this.flushBackBuffer()}onBufferEos(t,e){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!e.type||e.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,x.log("[buffer-controller]: ".concat(r," sourceBuffer now EOS")))),i&&!!(!n||n.ended)},!0)&&(x.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&x.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ".concat(i.readyState));return}x.log("[buffer-controller]: Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:t,details:e,media:s,sourceBuffer:i}=this;if(!s||e===null)return;const r=this.getSourceBufferTypes();if(!r.length)return;const n=e.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!F(n)||n<0)return;const o=s.currentTime,l=e.levelTargetDuration,c=Math.max(n,l),h=Math.floor(o/l)*l-c;r.forEach(u=>{const d=i[u];if(d){const f=q.getBuffered(d);if(f.length>0&&h>f.start(0)){if(t.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:h}),e.live)t.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h});else if(d.ended&&f.end(f.length-1)-oo&&r>n||!F(n))&&(x.log("[buffer-controller]: Updating Media Source duration to ".concat(r.toFixed(3))),i.duration=r)}updateSeekableRange(t){const e=this.mediaSource,s=t.fragments;if(s.length&&t.live&&e!=null&&e.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:t,operationQueue:e,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&!t||i===2){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(m.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{e.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(t){const{sourceBuffer:e,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const i in t)if(!e[i]){const r=t[i];if(!r)throw Error("source buffer exists for track ".concat(i,", however track does not"));const n=r.levelCodec||r.codec,o="".concat(r.container,";codecs=").concat(n);x.log("[buffer-controller]: creating sourceBuffer(".concat(o,")"));try{const l=e[i]=s.addSourceBuffer(o),c=i;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[i]={buffer:l,codec:n,container:r.container,levelCodec:r.levelCodec,metadata:r.metadata,id:r.id}}catch(l){x.error("[buffer-controller]: error while trying to add sourceBuffer: ".concat(l.message)),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:o})}}}_onSBUpdateStart(t){const{operationQueue:e}=this;e.current(t).onStart()}_onSBUpdateEnd(t){const{operationQueue:e}=this;e.current(t).onComplete(),e.shiftAndExecuteNext(t)}_onSBUpdateError(t,e){const s=new Error("".concat(t," SourceBuffer error"));x.error("[buffer-controller]: ".concat(s),e),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_APPENDING_ERROR,error:s,fatal:!1});const i=this.operationQueue.current(t);i&&i.onError(e)}removeExecutor(t,e,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[t];if(!i||!r||!l){x.warn("[buffer-controller]: Attempting to remove from the ".concat(t," SourceBuffer, but it does not exist")),n.shiftAndExecuteNext(t);return}const c=F(i.duration)?i.duration:1/0,h=F(r.duration)?r.duration:1/0,u=Math.max(0,e),d=Math.min(s,c,h);d>u&&!l.ending?(l.ended=!1,x.log("[buffer-controller]: Removing [".concat(u,",").concat(d,"] from the ").concat(t," SourceBuffer")),l.remove(u,d)):n.shiftAndExecuteNext(t)}appendExecutor(t,e){const{operationQueue:s,sourceBuffer:i}=this,r=i[e];if(!r){x.warn("[buffer-controller]: Attempting to append to the ".concat(e," SourceBuffer, but it does not exist")),s.shiftAndExecuteNext(e);return}r.ended=!1,r.appendBuffer(t)}blockBuffers(t,e=this.getSourceBufferTypes()){if(!e.length){x.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);return}const{operationQueue:s}=this,i=e.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{t(),e.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(t,e,s){const i=this.sourceBuffer[t];if(!i)return;const r=s.bind(this,t);this.listeners[t].push({event:e,listener:r}),i.addEventListener(e,r)}removeBufferListeners(t){const e=this.sourceBuffer[t];e&&this.listeners[t].forEach(s=>{e.removeEventListener(s.event,s.listener)})}}const js={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Xi=function(t){let e=t;return js.hasOwnProperty(t)&&(e=js[t]),String.fromCharCode(e)},pt=15,vt=100,Va={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Wa={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ya={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},qa={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ja=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Xa{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const s=typeof e=="function"?e():e;x.log("".concat(this.time," [").concat(t,"] ").concat(s))}}}const kt=function(t){const e=[];for(let s=0;svt&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=vt)}moveCursor(t){const e=this.pos+t;if(t>1)for(let s=this.pos+1;s=144&&this.backSpace();const e=Xi(t);if(this.pos>=vt){this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)}clearFromPos(t){let e;for(e=t;e"pacData = "+JSON.stringify(t));let e=t.row-1;if(this.nrRollUpRows&&e"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let s="",i=-1;for(let r=0;r0&&(t?s="["+e.join(" | ")+"]":s=e.join("\n")),s}getTextAndFormat(){return this.rows}}class Xs{constructor(t,e,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new _e(s),this.nonDisplayedMemory=new _e(s),this.lastOutputScreen=new _e(s),this.currRollUpRow=this.displayedMemory.rows[pt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[pt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let s=0;se+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2===1,e.italics=t>=46,e.italics)e.foreground="white";else{const s=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=e:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class zs{constructor(t,e,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const i=new Xa;this.channels=[null,new Xs(t,e,i),new Xs(t+1,s,i)],this.cmdHistory=Js(),this.logger=i}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){let s,i,r,n=!1;this.logger.time=t;for(let o=0;o ("+kt([i,r])+")"),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r)),!s&&(n=this.parseChars(i,r),n)){const l=this.currentChannel;l&&l>0?this.channels[l].insertChars(n):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!n&&this.logger.log(2,"Couldn't parse cleaned data "+kt([i,r])+" orig: "+kt([e[o],e[o+1]]))}}parseCmd(t,e){const{cmdHistory:s}=this,i=(t===20||t===28||t===21||t===29)&&e>=32&&e<=47,r=(t===23||t===31)&&e>=33&&e<=35;if(!(i||r))return!1;if(Qs(t,e,s))return Nt(null,null,s),this.logger.log(3,"Repeated command ("+kt([t,e])+") is dropped"),!0;const n=t===20||t===21||t===23?1:2,o=this.channels[n];return t===20||t===21||t===28||t===29?e===32?o.ccRCL():e===33?o.ccBS():e===34?o.ccAOF():e===35?o.ccAON():e===36?o.ccDER():e===37?o.ccRU(2):e===38?o.ccRU(3):e===39?o.ccRU(4):e===40?o.ccFON():e===41?o.ccRDC():e===42?o.ccTR():e===43?o.ccRTD():e===44?o.ccEDM():e===45?o.ccCR():e===46?o.ccENM():e===47&&o.ccEOC():o.ccTO(e-32),Nt(t,e,s),this.currentChannel=n,!0}parseMidrow(t,e){let s=0;if((t===17||t===25)&&e>=32&&e<=47){if(t===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(e),this.logger.log(3,"MIDROW ("+kt([t,e])+")"),!0):!1}return!1}parsePAC(t,e){let s;const i=this.cmdHistory,r=(t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127,n=(t===16||t===24)&&e>=64&&e<=95;if(!(r||n))return!1;if(Qs(t,e,i))return Nt(null,null,i),!0;const o=t<=23?1:2;e>=64&&e<=95?s=o===1?Va[t]:Ya[t]:s=o===1?Wa[t]:qa[t];const l=this.channels[o];return l?(l.setPAC(this.interpretPAC(s,e)),Nt(t,e,i),this.currentChannel=o,!0):!1}interpretPAC(t,e){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:t};return e>95?s=e-96:s=e-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(t,e){let s,i=null,r=null;if(t>=25?(s=2,r=t-8):(s=1,r=t),r>=17&&r<=19){let n;r===17?n=e+80:r===18?n=e+112:n=e+144,this.logger.log(2,"Special char '"+Xi(n)+"' in channel "+s),i=[n]}else t>=32&&t<=127&&(i=e===0?[t]:[t,e]);if(i){const n=kt(i);this.logger.log(3,"Char codes = "+n.join(",")),Nt(t,e,this.cmdHistory)}return i}parseBackgroundAttributes(t,e){const s=(t===16||t===24)&&e>=32&&e<=47,i=(t===23||t===31)&&e>=45&&e<=47;if(!(s||i))return!1;let r;const n={};t===16||t===24?(r=Math.floor((e-32)/2),n.background=ja[r],e%2===1&&(n.background=n.background+"_semi")):e===45?n.background="transparent":(n.foreground="black",e===47&&(n.underline=!0));const o=t<=23?1:2;return this.channels[o].setBkgData(n),Nt(t,e,this.cmdHistory),!0}reset(){for(let t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var os=function(){if(typeof self<"u"&&self.VTTCue)return self.VTTCue;const a=["","lr","rl"],t=["start","middle","end","left","right"];function e(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return e(a,o)}function i(o){return e(t,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");k=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return D},set:function(I){const O=i(I);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");D=O,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return C},set:function(I){if(I<0||I>100)throw new Error("Size must be between 0 and 100.");C=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return _},set:function(I){const O=i(I);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");_=O,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class Ja{decode(t,e){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function Qi(a){function t(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const e=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return e?parseFloat(e[2])>59?t(e[2],e[3],0,e[4]):t(e[1],e[2],e[3],e[4]):null}class Za{constructor(){this.values=Object.create(null)}set(t,e){!this.get(t)&&e!==""&&(this.values[t]=e)}get(t,e,s){return s?this.has(t)?this.values[t]:e[s]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,s){for(let i=0;i=0&&s<=100)return this.set(t,s),!0}return!1}}function Ji(a,t,e,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(e);if(n.length!==2)continue;const o=n[0],l=n[1];t(o,l)}}const Ye=new os(0,0,""),se=Ye.align==="middle"?"middle":"center";function to(a,t,e){const s=a;function i(){const o=Qi(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new Za;Ji(o,function(d,f){let g;switch(d){case"region":for(let p=e.length-1;p>=0;p--)if(e[p].id===f){c.set(d,e[p].region);break}break;case"vertical":c.alt(d,f,["rl","lr"]);break;case"line":g=f.split(","),c.integer(d,g[0]),c.percent(d,g[0])&&c.set("snapToLines",!1),c.alt(d,g[0],["auto"]),g.length===2&&c.alt("lineAlign",g[1],["start",se,"end"]);break;case"position":g=f.split(","),c.percent(d,g[0]),g.length===2&&c.alt("positionAlign",g[1],["start",se,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,f);break;case"align":c.alt(d,f,["start",se,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&Ye.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",se);let u=c.get("position","auto");u==="auto"&&Ye.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),t.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),t.endTime=i(),n(),r(a,t)}function Zi(a){return a.replace(//gi,"\n")}class eo{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ja,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));function s(){let r=e.buffer,n=0;for(r=Zi(r);n")===-1){e.cue.id=r;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{to(r,e.cue,e.regionList)}catch{e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=r}continue;case"BADCUE":r||(e.state="ID")}}}catch{e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+="\n\n",t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const so=/\r\n|\n\r|\n|\r/g,we=function(t,e,s=0){return t.slice(s,s+e.length)===e},io=function(t){let e=parseInt(t.slice(-3));const s=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),r=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!F(e)||!F(s)||!F(i)||!F(r))throw Error("Malformed X-TIMESTAMP-MAP: Local:".concat(t));return e+=1e3*s,e+=60*1e3*i,e+=60*60*1e3*r,e},Pe=function(t){let e=5381,s=t.length;for(;s;)e=e*33^t.charCodeAt(--s);return(e>>>0).toString()};function ls(a,t,e){return Pe(a.toString())+Pe(t.toString())+Pe(e)}const ro=function(t,e,s){let i=t[e],r=t[i.prevCC];if(!r||!r.new&&i.new){t.ccOffset=t.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;t.ccOffset+=i.start-r.start,i.new=!1,i=r,r=t[i.prevCC]}t.presentationOffset=s};function no(a,t,e,s,i,r,n){const o=new eo,l=St(new Uint8Array(a)).trim().replace(so,"\n").split("\n"),c=[],h=t?pa(t.baseTime,t.timescale):0;let u="00:00.000",d=0,f=0,g,p=!0;o.oncue=function(T){const y=e[s];let S=e.ccOffset;const E=(d-h)/9e4;if(y!=null&&y.new&&(f!==void 0?S=e.ccOffset=y.start:ro(e,s,E)),E){if(!t){g=new Error("Missing initPTS for VTT MPEGTS");return}S=E-e.presentationOffset}const R=T.endTime-T.startTime,A=gt((T.startTime+S-f)*9e4,i*9e4)/9e4;T.startTime=Math.max(A,0),T.endTime=Math.max(A+R,0);const k=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(k)),T.id||(T.id=ls(T.startTime,T.endTime,k)),T.endTime>0&&c.push(T)},o.onparsingerror=function(T){g=T},o.onflush=function(){if(g){n(g);return}r(c)},l.forEach(T=>{if(p)if(we(T,"X-TIMESTAMP-MAP=")){p=!1,T.slice(16).split(",").forEach(y=>{we(y,"LOCAL:")?u=y.slice(6):we(y,"MPEGTS:")&&(d=parseInt(y.slice(7)))});try{f=io(u)/1e3}catch(y){g=y}return}else T===""&&(p=!1);o.parse(T+"\n")}),o.flush()}const Fe="stpp.ttml.im1t",tr=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,er=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ao={left:"start",center:"center",right:"end",start:"start",end:"end"};function Zs(a,t,e,s){const i=$(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>St(o)),n=ma(t.baseTime,1,t.timescale);try{r.forEach(o=>e(oo(o,n)))}catch(o){s(o)}}function oo(a,t){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute("ttp:".concat(d))||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=ti(Oe(i,"styling","style")),c=ti(Oe(i,"layout","region")),h=Oe(i,"body","[begin]");return[].map.call(h,u=>{const d=sr(u,o);if(!d||!u.hasAttribute("begin"))return null;const f=Ne(u.getAttribute("begin"),n),g=Ne(u.getAttribute("dur"),n);let p=Ne(u.getAttribute("end"),n);if(f===null)throw ei(u);if(p===null){if(g===null)throw ei(u);p=f+g}const T=new os(f-t,p-t,d);T.id=ls(T.startTime,T.endTime,T.text);const y=c[u.getAttribute("region")],S=l[u.getAttribute("style")],E=lo(y,S,l),{textAlign:R}=E;if(R){const A=ao[R];A&&(T.lineAlign=A),T.align=R}return tt(T,E),T}).filter(u=>u!==null)}function Oe(a,t,e){const s=a.getElementsByTagName(t)[0];return s?[].slice.call(s.querySelectorAll(e)):[]}function ti(a){return a.reduce((t,e)=>{const s=e.getAttribute("xml:id");return s&&(t[s]=e),t},{})}function sr(a,t){return[].slice.call(a.childNodes).reduce((e,s,i)=>{var r;return s.nodeName==="br"&&i?e+"\n":(r=s.childNodes)!=null&&r.length?sr(s,t):t?e+s.textContent.trim().replace(/\s+/g," "):e+s.textContent},"")}function lo(a,t,e){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&e.hasOwnProperty(n)&&(i=e[n]),r.reduce((o,l)=>{const c=Me(t,s,l)||Me(a,s,l)||Me(i,s,l);return c&&(o[l]=c),o},{})}function Me(a,t,e){return a&&a.hasAttributeNS(t,e)?a.getAttributeNS(t,e):null}function ei(a){return new Error("Could not parse ttml timestamp ".concat(a))}function Ne(a,t){if(!a)return null;let e=Qi(a);return e===null&&(tr.test(a)?e=co(a,t):er.test(a)&&(e=ho(a,t))),e}function co(a,t){const e=tr.exec(a),s=(e[4]|0)+(e[5]|0)/t.subFrameRate;return(e[1]|0)*3600+(e[2]|0)*60+(e[3]|0)+s/t.frameRate}function ho(a,t){const e=er.exec(a),s=Number(e[1]);switch(e[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/t.frameRate;case"t":return s/t.tickRate}return s}class uo{constructor(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=si(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new ee(this,"textTrack1"),s=new ee(this,"textTrack2"),i=new ee(this,"textTrack3"),r=new ee(this,"textTrack4");this.cea608Parser1=new zs(1,e,s),this.cea608Parser2=new zs(3,i,r)}t.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(m.FRAG_LOADING,this.onFragLoading,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(m.FRAG_LOADING,this.onFragLoading,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(t,e,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=go(l[0],l[1],e,s);if(c>=0&&(l[0]=Math.min(l[0],e),l[1]=Math.max(l[1],s),n=!0,c/(s-e)>.5))return}if(n||r.push([e,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[t];this.Cues.newCue(o,e,s,i)}else{const o=this.Cues.newCue(null,e,s,i);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:o,track:t})}}onInitPtsFound(t,{frag:e,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[e.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(m.FRAG_LOADED,o)}))}getExistingTrack(t){const{media:e}=this;if(e)for(let s=0;s{Ut(t[e]),delete t[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=si(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let s=0;sr.textCodec===Fe);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ji(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media?this.media.textTracks:null;this.tracks.forEach((o,l)=>{let c;if(n&&l({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}_captionsOrSubtitlesFromCharacteristics(t){if(t.attrs.CHARACTERISTICS){const e=/transcribes-spoken-dialog/gi.test(t.attrs.CHARACTERISTICS),s=/describes-music-and-sound/gi.test(t.attrs.CHARACTERISTICS);if(e&&s)return"captions"}return"subtitles"}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r="textTrack".concat(i[1]),n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return e==null?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){const{cea608Parser1:s,cea608Parser2:i,lastSn:r,lastPartIndex:n}=this;if(!(!this.enabled||!(s&&i))&&e.frag.type===U.MAIN){var o,l;const c=e.frag.sn,h=(o=e==null||(l=e.part)==null?void 0:l.index)!=null?o:-1;c===r+1||c===r&&h===n+1||(s.reset(),i.reset()),this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(t,e){const{frag:s,payload:i}=e;if(s.type===U.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in e;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===Fe?this._parseIMSC1(s,i):this._parseVTTs(e)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const s=this.hls;Zs(e,this.initPTS[t.cc],i=>{this._appendCues(i,t.level),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},i=>{x.log("Failed to parse IMSC1: ".concat(i)),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:i})})}_parseVTTs(t){var e;const{frag:s,payload:i}=t,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(t);return}const l=this.hls,c=(e=s.initSegment)!=null&&e.data?Pt(s.initSegment.data,new Uint8Array(i)):i;no(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(t):this._fallbackToIMSC1(s,i),x.log("Failed to parse VTT cue: ".concat(h)),!(u&&o>s.cc)&&l.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(t,e){const s=this.tracks[t.level];s.textCodec||Zs(e,this.initPTS[t.cc],()=>{s.textCodec=Fe,this._parseIMSC1(t,e)},()=>{s.textCodec="wvtt"})}_appendCues(t,e){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[e];if(!i||i.mode==="disabled")return;t.forEach(r=>Ri(i,r))}else{const i=this.tracks[e];if(!i)return;const r=i.default?"default":"subtitles"+e;s.trigger(m.CUES_PARSED,{type:"subtitles",cues:t,track:r})}}onFragDecrypted(t,e){const{frag:s}=e;s.type===U.SUBTITLE&&this.onFragLoaded(m.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!(s&&i))return;const{frag:r,samples:n}=e;if(!(r.type===U.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;o$e(o[l],e,s))}if(this.config.renderTextTracksNatively&&e===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>$e(o[l],e,i))}}}extractCea608Data(t){const e=[[],[]],s=t[0]&31;let i=2;for(let r=0;r0&&this.mediaWidth>0){const t=this.hls.levels;if(t.length){const e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const s=e.filter((i,r)=>this.isLevelAllowed(i)&&r<=t);return this.clientRect=null,cs.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,e={width:0,height:0};if(t){const s=t.getBoundingClientRect();e.width=s.width,e.height=s.height,!e.width&&!e.height&&(e.width=s.right-s.left||t.width||0,e.height=s.bottom-s.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch{}return t}isLevelAllowed(t){return!this.restrictedLevels.some(s=>t.bitrate===s.bitrate&&t.width===s.width&&t.height===s.height)}static getMaxLevelByMediaSize(t,e,s){if(!(t!=null&&t.length))return-1;const i=(n,o)=>o?n.width!==o.width||n.height!==o.height:!0;let r=t.length-1;for(let n=0;n=e||o.height>=s)&&i(o,t[n+1])){r=n;break}}return r}}class mo{constructor(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(t,e,s){const i=performance.now();if(e){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=e-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(m.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;x.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}const ie="[eme]";class Bt{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Bt.CDMCleanupPromise?[Bt.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=x.debug.bind(x,ie),this.log=x.log.bind(x,ie),this.warn=x.warn.bind(x,ie),this.error=x.error.bind(x,ie),this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:s}=this.config,i=e[t];if(i)return i.licenseUrl;if(t===J.WIDEVINE&&s)return s;throw new Error('no license server URL configured for key-system "'.concat(t,'"'))}getServerCertificateUrl(t){const{drmSystems:e}=this.config,s=e[t];if(s)return s.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'.concat(t,'"]'))}attemptKeySystemAccess(t){const e=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=e.map(n=>n.audioCodec).filter(s),r=e.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof dt?o(u):o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(t)})}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i="Configured requestMediaKeySystemAccess is not a function ".concat(s);return di===null&&self.location.protocol==="http:"&&(i="navigator.requestMediaKeySystemAccess is not available over insecure protocol ".concat(location.protocol)),Promise.reject(new Error(i))}return s(t,e)}getMediaKeysPromise(t,e,s){const i=br(t,e,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[t];let n=r==null?void 0:r.keySystemAccess;if(!n){this.log('Requesting encrypted media "'.concat(t,'" key-system access with config: ').concat(JSON.stringify(i))),n=this.requestMediaKeySystemAccess(t,i);const o=this.keySystemAccessPromises[t]={keySystemAccess:n};return n.catch(l=>{this.log('Failed to obtain access to key-system "'.concat(t,'": ').concat(l))}),n.then(l=>{this.log('Access for key-system "'.concat(l.keySystem,'" obtained'));const c=this.fetchServerCertificate(t);return this.log('Create media-keys for "'.concat(t,'"')),o.mediaKeys=l.createMediaKeys().then(h=>(this.log('Media-keys created for "'.concat(t,'"')),c.then(u=>u?this.setMediaKeysServerCertificate(h,t,u):h))),o.mediaKeys.catch(h=>{this.error('Failed to create media-keys for "'.concat(t,'"}: ').concat(h))}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:s}){this.log('Creating key-system session "'.concat(e,'" keyId: ').concat(xt.hexDump(t.keyId||[])));const i=s.createSession(),r={decryptdata:t,keySystem:e,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const s=this.createMediaKeySessionContext(t),i=this.getKeyIdString(e),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,e.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}getKeyIdString(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(t.keyId===null)throw new Error("keyId is null");return xt.hexDump(t.keyId)}updateKeySession(t,e){var s;const i=t.mediaKeysSession;return this.log('Updating key-session "'.concat(i.sessionId,'" for keyID ').concat(xt.hexDump(((s=t.decryptdata)==null?void 0:s.keyId)||[]),"\n } (data length: ").concat(e&&e.byteLength,")")),i.update(e)}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: ".concat(t.sn," ").concat(t.type,": ").concat(t.level,") key formats ").concat(e.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){return new Promise((e,s)=>{const i=pe(this.config),r=t.map(fs).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=gs(n);o?e(o):s(new Error('Unable to find format for key-system "'.concat(n,'"')))}).catch(s)})}loadKey(t){const e=t.keyInfo.decryptdata,s=this.getKeyIdString(e),i="(keyId: ".concat(s,' format: "').concat(e.keyFormat,'" method: ').concat(e.method," uri: ").concat(e.uri,")");this.log("Starting session for key ".concat(i));let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(e).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log("Handle encrypted media sn: ".concat(t.frag.sn," ").concat(t.frag.type,": ").concat(t.frag.level," using key ").concat(i)),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:e}),c="cenc";return this.generateRequestWithPreferredKeySession(l,c,e.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t){this.hls&&(this.error(t.message),t instanceof dt?this.hls.trigger(m.ERROR,t.data):this.hls.trigger(m.ERROR,{type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const e=this.getKeyIdString(t),s=this.keyIdToKeySessionPromise[e];if(!s){const i=fs(t.keyFormat),r=i?[i]:pe(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(t){if(t.length||(t=pe(this.config)),t.length===0)throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options ".concat(JSON.stringify({drmSystems:this.config.drmSystems})));return this.attemptKeySystemAccess(t)}_onMediaEncrypted(t){const{initDataType:e,initData:s}=t;if(this.debug('"'.concat(t.type,'" event: init data type: "').concat(e,'"')),s===null)return;let i,r;if(e==="sinf"&&this.config.drmSystems[J.FAIRPLAY]){const h=st(new Uint8Array(s));try{const u=Xe(JSON.parse(h).sinf),d=Ei(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=J.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=Qr(s);if(h===null)return;h.version===0&&h.systemId===ui.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=Ir(h.systemId)}if(!r||!i)return;const n=xt.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,e,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const f=new Vt("ISO-23001-7",n,(d=gs(h))!=null?d:"");return f.pssh=new Uint8Array(s),f.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:f,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(g,e,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(t){this.log('"'.concat(t.type,'" event'))}attemptSetMediaKeys(t,e){const s=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'.concat(t,'"'));const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(e)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log('Media-keys set for "'.concat(t,'"')),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(t,e,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[t.keySystem])==null?void 0:n.generateRequest;if(o)try{const d=o.call(this.hls,e,s,t);if(!d)throw new Error("Invalid response from configured generateRequest filter");e=d.initDataType,s=t.decryptdata.pssh=d.initData?new Uint8Array(d.initData):null}catch(d){var l;if(this.warn(d.message),(l=this.hls)!=null&&l.config.debug)throw d}if(s===null)return this.log('Skipping key-session request for "'.concat(i,'" (no initData)')),Promise.resolve(t);const c=this.getKeyIdString(t.decryptdata);this.log('Generating key-session request for "'.concat(i,'": ').concat(c," (init data type: ").concat(e," length: ").concat(s?s.byteLength:null,")"));const h=new as;t.mediaKeysSession.onmessage=d=>{const f=t.mediaKeysSession;if(!f){h.emit("error",new Error("invalid state"));return}const{messageType:g,message:p}=d;this.log('"'.concat(g,'" message event for session "').concat(f.sessionId,'" message size: ').concat(p.byteLength)),g==="license-request"||g==="license-renewal"?this.renewLicense(t,p).catch(T=>{this.handleError(T),h.emit("error",T)}):g==="license-release"?t.keySystem===J.FAIRPLAY&&(this.updateKeySession(t,hi("acknowledged")),this.removeSession(t)):this.warn('unhandled media key message type "'.concat(g,'"'))},t.mediaKeysSession.onkeystatuseschange=d=>{if(!t.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(t);const g=t.keyStatus;h.emit("keyStatus",g),g==="expired"&&(this.warn("".concat(t.keySystem," expired for key ").concat(c)),this.renewKeySession(t))};const u=new Promise((d,f)=>{h.on("error",f),h.on("keyStatus",g=>{g.startsWith("usable")?d():g==="output-restricted"?f(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?f(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'.concat(g,'"'))):g==="expired"?f(new Error("key expired while generating request")):this.warn('unhandled key status change "'.concat(g,'"'))})});return t.mediaKeysSession.generateRequest(e,s).then(()=>{var d;this.log('Request generated for key-session "'.concat((d=t.mediaKeysSession)==null?void 0:d.sessionId,'" keyId: ').concat(c))}).catch(d=>{throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_SESSION,error:d,fatal:!1},"Error generating key-session request: ".concat(d))}).then(()=>u).catch(d=>{throw h.removeAllListeners(),this.removeSession(t),d}).then(()=>(h.removeAllListeners(),t))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach((e,s)=>{this.log('key status change "'.concat(e,'" for keyStatuses keyId: ').concat(xt.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))," session keyId: ").concat(xt.hexDump(new Uint8Array(t.decryptdata.keyId||[]))," uri: ").concat(t.decryptdata.uri)),t.keyStatus=e})}fetchServerCertificate(t){const e=this.config,s=e.loader,i=new s(e),r=this.getServerCertificateUrl(t);return r?(this.log('Fetching serverCertificate for "'.concat(t,'"')),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=e.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,f,g,p)=>{n(d.data)},onError:(d,f,g,p)=>{o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:ct({url:l.url,data:void 0},d)},'"'.concat(t,'" certificate request failed (').concat(r,"). Status: ").concat(d.code," (").concat(d.text,")")))},onTimeout:(d,f,g)=>{o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:{url:l.url,data:void 0}},'"'.concat(t,'" certificate request timed out (').concat(r,")")))},onAbort:(d,f,g)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(t,e,s){return new Promise((i,r)=>{t.setServerCertificate(s).then(n=>{this.log("setServerCertificate ".concat(n?"success":"not supported by CDM"," (").concat(s==null?void 0:s.byteLength,') on "').concat(e,'"')),i(t)}).catch(n=>{r(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then(s=>this.updateKeySession(t,new Uint8Array(s)).catch(i=>{throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}setupLicenseXHR(t,e,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,t,e,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return t.open("POST",e,!0),r.call(this.hls,t,e,s,i)}).then(n=>(t.readyState||t.open("POST",e,!0),{xhr:t,licenseChallenge:n||i})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:i}))}requestLicense(t,e){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(t.keySystem);this.log("Sending license request to URL: ".concat(n));const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log("License received ".concat(l instanceof ArrayBuffer?l.byteLength:l));const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,t)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},"License Request XHR failed (".concat(n,"). Status: ").concat(o.status," (").concat(o.statusText,")")));else{const h=c-this._requestLicenseFailureCount+1;this.warn("Retrying license request, ".concat(h," attempts left")),this.requestLicense(t,e).then(i,r)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=o,this.setupLicenseXHR(o,n,t,e).then(({xhr:l,licenseChallenge:c})=>{l.send(c)})})}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const s=e.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media,e=this.mediaKeySessions;t&&(t.removeEventListener("encrypted",this.onMediaEncrypted),t.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Vt.clearKeyUriToKeyIdMap();const s=e.length;Bt.CDMCleanupPromise=Promise.all(e.map(i=>this.removeSession(i)).concat(t==null?void 0:t.setMediaKeys(null).catch(i=>{this.log("Could not clear media keys: ".concat(i,". media.src: ").concat(t==null?void 0:t.src))}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),e.length=0)}).catch(i=>{this.log("Could not close sessions and clear media keys: ".concat(i,". media.src: ").concat(t==null?void 0:t.src))})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(t,{sessionKeys:e}){if(!(!e||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=e.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log("Selecting key-system from session-keys ".concat(s.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:s}=t;if(e){this.log("Remove licenses and keys and close session ".concat(e.sessionId)),e.onmessage=null,e.onkeystatuseschange=null,s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(t);return i>-1&&this.mediaKeySessions.splice(i,1),e.remove().catch(r=>{this.log("Could not remove session: ".concat(r))}).then(()=>e.close()).catch(r=>{this.log("Could not close session: ".concat(r))})}}}Bt.CDMCleanupPromise=void 0;class dt extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}const po=1;var at={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const To="h";class Dt{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:at.MANIFEST,su:!this.initialized})}catch(r){x.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===at.VIDEO||o===at.AUDIO||o==at.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){x.warn("Could not generate segment CMCD data.",r)}},this.hls=t;const e=this.config=t.config,{cmcd:s}=e;s!=null&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Dt.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}registerListeners(){const t=this.hls;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHED,this.onMediaDetached,this),t.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHED,this.onMediaDetached,this),t.off(m.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,e){var s,i;this.audioBuffer=(s=e.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=e.tracks.video)==null?void 0:i.buffer}createData(){var t;return{v:po,sf:To,sid:this.sid,cid:this.cid,pr:(t=this.media)==null?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){tt(e,this.createData());const s=e.ot===at.INIT||e.ot===at.VIDEO||e.ot===at.MUXED;if(this.starved&&s&&(e.bs=!0,e.su=!0,this.starved=!1),e.su==null&&(e.su=this.buffering),this.useHeaders){const i=Dt.toHeaders(e);if(!Object.keys(i).length)return;t.headers||(t.headers={}),tt(t.headers,i)}else{const i=Dt.toQuery(e);if(!i)return;t.url=Dt.appendQueryToUri(t.url,i)}}getObjectType(t){const{type:e}=t;if(e==="subtitle")return at.TIMED_TEXT;if(t.sn==="initSegment")return at.INIT;if(e==="audio")return at.AUDIO;if(e==="main")return this.hls.audioTracks.length?at.VIDEO:at.MUXED}getTopBandwidth(t){let e=0,s;const i=this.hls;if(t===at.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>e&&(e=r.bitrate);return e>0?e:NaN}getBufferLength(t){const e=this.hls.media,s=t===at.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!e?NaN:q.bufferInfo(s,e.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,s=t||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){e(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,s=t||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){e(r),this.loader.load(r,n,o)}}}static uuid(){const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}static serialize(t){const e=[],s=c=>!Number.isNaN(c)&&c!=null&&c!==""&&c!==!1,i=c=>Math.round(c),r=c=>i(c/100)*100,o={br:i,d:i,bl:r,dl:r,mtp:r,nor:c=>encodeURIComponent(c),rtp:r,tb:i},l=Object.keys(t||{}).sort();for(const c of l){let h=t[c];if(!s(h)||c==="v"&&h===1||c=="pr"&&h===1)continue;const u=o[c];u&&(h=u(h));const d=typeof h;let f;c==="ot"||c==="sf"||c==="st"?f="".concat(c,"=").concat(h):d==="boolean"?f=c:d==="number"?f="".concat(c,"=").concat(h):f="".concat(c,"=").concat(JSON.stringify(h)),e.push(f)}return e.join(",")}static toHeaders(t){const e=Object.keys(t),s={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],n={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const o of e){const l=n[o]!=null?n[o]:1;r[l][o]=t[o]}for(let o=0;os!==t))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,e){const{contentSteering:s}=e;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:s}=e;if((s==null?void 0:s.action)===rt.SendAlternateToPenaltyBox&&s.flags===ft.MoveAllAlternatesMatchingHost){let i=this.pathwayPriority;const r=this.pathwayId;this.penalizedPathways[r]||(this.penalizedPathways[r]=performance.now()),!i&&this.levels&&(i=this.levels.reduce((n,o)=>(n.indexOf(o.pathwayId)===-1&&n.push(o.pathwayId),n),[])),i&&i.length>1&&(this.updatePathwayPriority(i),s.resolved=this.pathwayId!==r)}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(e.length===0){const s=t[0].pathwayId;this.log("No levels found in Pathway ".concat(this.pathwayId,'. Setting initial Pathway to "').concat(s,'"')),e=this.getLevelsForPathway(s),this.pathwayId=s}return e.length!==t.length?(this.log("Found ".concat(e.length,"/").concat(t.length,' levels in Pathway "').concat(this.pathwayId,'"')),e):t}getLevelsForPathway(t){return this.levels===null?[]:this.levels.filter(e=>t===e.pathwayId)}updatePathwayPriority(t){this.pathwayPriority=t;let e;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>yo&&delete s[r]});for(let r=0;r0){this.log('Setting Pathway to "'.concat(n,'"')),this.pathwayId=n,this.hls.trigger(m.LEVELS_UPDATED,{levels:e});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log("Unstable Pathways change from bitrate ".concat(l.bitrate," to ").concat(c.bitrate)),this.hls.nextLoadLevel=o);break}}}clonePathways(t){const e=this.levels;if(!e)return;const s={},i={};t.forEach(r=>{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(e.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=tt({},h);u.details=void 0,u.url=ir(h.uri,h.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l);const d=new Q(h.attrs);d["PATHWAY-ID"]=n;const f=d.AUDIO&&"".concat(d.AUDIO,"_clone_").concat(n),g=d.SUBTITLES&&"".concat(d.SUBTITLES,"_clone_").concat(n);f&&(s[d.AUDIO]=f,d.AUDIO=f),g&&(i[d.SUBTITLES]=g,d.SUBTITLES=g),u.attrs=d;const p=new Wt(u);return ce(p,"audio",f),ce(p,"text",g),p});e.push(...c),ii(this.audioTracks,s,l,n),ii(this.subtitleTracks,i,l,n)})}loadSteeringManifest(t){const e=this.hls.config,s=e.loader;this.loader&&this.loader.destroy(),this.loader=new s(e);let i;try{i=new self.URL(t)}catch{this.enabled=!1,this.log("Failed to parse Steering Manifest URI: ".concat(t));return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const r={responseType:"json",url:i.href},n=e.steeringManifestLoadPolicy.default,o=n.errorRetry||n.timeoutRetry||{},l={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(h,u,d,f)=>{this.log('Loaded steering manifest: "'.concat(i,'"'));const g=h.data;if(g.VERSION!==1){this.log("Steering VERSION ".concat(g.VERSION," not supported!"));return}this.updated=performance.now(),this.timeToLoad=g.TTL;const{"RELOAD-URI":p,"PATHWAY-CLONES":T,"PATHWAY-PRIORITY":y}=g;if(p)try{this.uri=new self.URL(p,i).href}catch{this.enabled=!1,this.log("Failed to parse Steering Manifest RELOAD-URI: ".concat(p));return}this.scheduleRefresh(this.uri||d.url),T&&this.clonePathways(T),y&&this.updatePathwayPriority(y)},onError:(h,u,d,f)=>{if(this.log("Error loading steering manifest: ".concat(h.code," ").concat(h.text," (").concat(u.url,")")),this.stopLoad(),h.code===410){this.enabled=!1,this.log("Steering manifest ".concat(u.url," no longer available"));return}let g=this.timeToLoad*1e3;if(h.code===429){const p=this.loader;if(typeof(p==null?void 0:p.getResponseHeader)=="function"){const T=p.getResponseHeader("Retry-After");T&&(g=parseFloat(T)*1e3)}this.log("Steering manifest ".concat(u.url," rate limited"));return}this.scheduleRefresh(this.uri||u.url,g)},onTimeout:(h,u,d)=>{this.log("Timeout loading steering manifest (".concat(u.url,")")),this.scheduleRefresh(this.uri||u.url)}};this.log("Requesting steering manifest: ".concat(i)),this.loader.load(r,l,c)}scheduleRefresh(t,e=this.timeToLoad*1e3){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(t)},e)}}function ii(a,t,e,s){a&&Object.keys(t).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=tt({},n);return o.details=void 0,o.attrs=new Q(o.attrs),o.url=o.attrs.URI=ir(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",e),o.groupId=o.attrs["GROUP-ID"]=t[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function ir(a,t,e,s){const{HOST:i,PARAMS:r,[e]:n}=s;let o;t&&(o=n==null?void 0:n[t],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const Eo=/^age:\s*[\d.]+\s*$/im;class rr{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new ue,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!this.stats.aborted)return r(s,e.url)}).catch(n=>(s.open("GET",e.url,!0),r(s,e.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(s,e,t)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},e,s,i)}):this.openAndSendXhr(s,e,t)}openAndSendXhr(t,e,s){t.readyState||t.open("GET",e.url,!0);const i=this.context.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)t.setRequestHeader(o,i[o]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&F(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:s}=this;if(!t||!e)return;const i=e.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const n=e.status,o=e.responseType!=="text";if(n>=200&&n<300&&(o&&e.response||e.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?e.response:e.responseText,c=e.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,t,l,e),!this.callbacks)return;const u={url:e.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,t,e)}else{const l=r.loadPolicy.errorRetry,c=s.retry;le(l,c,!1,n)?this.retry(l):(x.error("".concat(n," while loading ").concat(t.url)),this.callbacks.onError({code:n,text:e.statusText},t,e,s))}}}loadtimeout(){var t;const e=(t=this.config)==null?void 0:t.loadPolicy.timeoutRetry,s=this.stats.retry;if(le(e,s,!0))this.retry(e);else{x.warn("timeout while loading ".concat(this.context.url));const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:s}=this;this.retryDelay=Qe(t,s.retry),s.retry++,x.warn("".concat(status?"HTTP Status "+status:"Timeout"," while loading ").concat(e.url,", retrying ").concat(s.retry,"/").concat(t.maxNumRetry," in ").concat(this.retryDelay,"ms")),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&Eo.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp("^".concat(t,":\\s*[\\d.]+\\s*$"),"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}function So(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const vo=/(\d+)-(\d+)\/(\d+)/;class ri{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||Io,this.controller=new self.AbortController,this.stats=new ue}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const t=this.response;t!=null&&t.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=Ao(t,this.controller.signal),n=s.onProgress,o=t.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=s,this.request=this.fetchSetup(t,r),self.clearTimeout(this.requestTimeout),e.timeout=c&&F(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,t,this.response)},e.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,t,this.response)},h-(d-i.loading.start)),!u.ok){const{status:f,statusText:g}=u;throw new bo(g||"fetch, bad network response",f,u)}return i.loading.first=d,i.total=Ro(u.headers)||i.total,n&&F(e.highWaterMark)?this.loadProgressively(u,i,t,e.highWaterMark,n):o?u.arrayBuffer():t.responseType==="json"?u.json():u.text()}).then(u=>{const{response:d}=this;self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const f=u[l];f&&(i.loaded=i.total=f);const g={url:d.url,data:u,code:d.status};n&&!F(e.highWaterMark)&&n(i,t,u,d),s.onSuccess(g,i,t,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,f=u?u.message:null;s.onError({code:d,text:f},t,u?u.details:null,i)})}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,s,i=0,r){const n=new qi,o=t.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(e,s,n.flush(),t),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return e.loaded+=u,u=i&&r(e,s,n.flush(),t)):r(e,s,h,t),l()}).catch(()=>Promise.reject());return l()}}function Ao(a,t){const e={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(tt({},a.headers))};return a.rangeEnd&&e.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),e}function Lo(a){const t=vo.exec(a);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Ro(a){const t=a.get("Content-Range");if(t){const s=Lo(t);if(F(s))return s}const e=a.get("Content-Length");if(e)return parseInt(e)}function Io(a,t){return new self.Request(a.url,t)}class bo extends Error{constructor(t,e,s){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=s}}const Do=/\s/,Co={newCue(a,t,e,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const f=Zi(c.trim()),g=ls(t,e,f);a!=null&&(u=a.cues)!=null&&u.getCueById(g)||(n=new h(t,e,f),n.id=g,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,f)=>d.line==="auto"||f.line==="auto"?0:d.line>8&&f.line>8?f.line-d.line:d.line-f.line),i.forEach(d=>Ri(a,d))),i}},ko={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},_o=ct(ct({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:rr,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Fa,bufferController:Ha,capLevelController:cs,errorController:In,fpsController:mo,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:di,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:ko},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},wo()),{},{subtitleStreamController:Ba,subtitleTrackController:Ga,timelineController:uo,audioStreamController:Ma,audioTrackController:Na,emeController:Bt,cmcdController:Dt,contentSteeringController:xo});function wo(){return{cueHandler:Co,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Po(a,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const e=qe(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n="".concat(r==="level"?"playlist":r,"LoadPolicy"),o=t[n]===void 0,l=[];i.forEach(c=>{const h="".concat(r,"Loading").concat(c),u=t[h];if(u!==void 0&&o){l.push(h);const d=e[n].default;switch(t[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&x.warn('hls.js config: "'.concat(l.join('", "'),'" setting(s) are deprecated, use "').concat(n,'": ').concat(JSON.stringify(t[n])))}),ct(ct({},e),t)}function qe(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(qe):Object.keys(a).reduce((t,e)=>(t[e]=qe(a[e]),t),{}):a}function Fo(a){const t=a.loader;t!==ri&&t!==rr?(x.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):So()&&(a.loader=ri,a.progressive=!0,a.enableSoftwareAES=!0,x.log("[config]: Progressive streaming enabled, using FetchLoader"))}class Rt{static get version(){return"1.4.12"}static isSupported(){return Wn()}static get Events(){return m}static get ErrorTypes(){return N}static get ErrorDetails(){return L}static get DefaultConfig(){return Rt.defaultConfig?Rt.defaultConfig:_o}static set DefaultConfig(t){Rt.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new as,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,pr(t.debug||!1,"Hls instance");const e=this.config=Po(Rt.DefaultConfig,t);this.userConfig=t,this._autoLevelCapping=-1,e.progressive&&Fo(e);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=e,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),f=new on(this),g=new dn(this),p=e.contentSteeringController,T=p?new p(this):null,y=this.levelController=new Dn(this,T),S=new Cn(this),E=new _n(this.config),R=this.streamController=new wa(this,S,E);u.setStreamController(R),d.setStreamController(R);const A=[f,y,R];T&&A.splice(1,0,T),this.networkControllers=A;const k=[c,h,u,d,g,S];this.audioTrackController=this.createController(e.audioTrackController,A);const D=e.audioStreamController;D&&A.push(new D(this,S,E)),this.subtitleTrackController=this.createController(e.subtitleTrackController,A);const C=e.subtitleStreamController;C&&A.push(new C(this,S,E)),this.createController(e.timelineController,k),E.emeController=this.emeController=this.createController(e.emeController,k),this.cmcdController=this.createController(e.cmcdController,k),this.latencyController=this.createController(fn,k),this.coreComponents=k,A.push(l);const _=l.onErrorOut;typeof _=="function"&&this.on(m.ERROR,_,l)}createController(t,e){if(t){const s=new t(this);return e&&e.push(s),s}return null}on(t,e,s=this){this._emitter.on(t,e,s)}once(t,e,s=this){this._emitter.once(t,e,s)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,s=this,i){this._emitter.off(t,e,s,i)}listeners(t){return this._emitter.listeners(t)}emit(t,e,s){return this._emitter.emit(t,e,s)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(s){x.error("An internal error happened while handling event "+t+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:t,error:s})}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){x.log("destroy"),this.trigger(m.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){x.log("attachMedia"),this._media=t,this.trigger(m.MEDIA_ATTACHING,{media:t})}detachMedia(){x.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,void 0),this._media=null}loadSource(t){this.stopLoad();const e=this.media,s=this.url,i=this.url=je.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});x.log("loadSource:".concat(i)),e&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(m.MANIFEST_LOADING,{url:t})}startLoad(t=-1){x.log("startLoad(".concat(t,")")),this.networkControllers.forEach(e=>{e.startLoad(t)})}stopLoad(){x.log("stopLoad"),this.networkControllers.forEach(t=>{t.stopLoad()})}swapAudioCodec(){x.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){x.log("recoverMediaError");const t=this._media;this.detachMedia(),t&&this.attachMedia(t)}removeLevel(t,e=0){this.levelController.removeLevel(t,e)}get levels(){const t=this.levelController.levels;return t||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){x.log("set currentLevel:".concat(t)),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){x.log("set nextLevel:".concat(t)),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){x.log("set loadLevel:".concat(t)),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){x.log("set firstLevel:".concat(t)),this.levelController.firstLevel=t}get startLevel(){return this.levelController.startLevel}set startLevel(t){x.log("set startLevel:".concat(t)),t!==-1&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(x.log("set autoLevelCapping:".concat(t)),this._autoLevelCapping=t)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){Ke.indexOf(t)>-1&&(this._maxHdcpLevel=t)}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const s=t.length;for(let i=0;i=e)return i;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:s}=this;let i;if(e===-1&&t&&t.length?i=t.length-1:i=e,s)for(let r=i;r--;){const n=t[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return t?t.subtitleDisplay:!1}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Rt.defaultConfig=void 0;var Oo=Object.defineProperty,Mo=Object.getOwnPropertyDescriptor,hs=(a,t,e,s)=>{for(var i=s>1?void 0:s?Mo(t,e):t,r=a.length-1,n;r>=0;r--)(n=a[r])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Oo(t,e,i),i};let qt=class extends nr(ar,or){constructor(){super(...arguments),this.aspectRatio=null,this.isVisible=!0,this.hls=null}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var e,s,i;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(i=this.camSettings.rotation)!=null?i:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}visibilityChanged(t){this.isVisible=t}mounted(){this.play();const t=this.$refs.video;t.onplaying=()=>{this.aspectRatio=t.videoWidth/t.videoHeight}}updated(){this.play()}play(){var e;const t=this.$refs.video;Rt.isSupported()?((e=this.hls)==null||e.destroy(),this.hls=new Rt({enableWorker:!0,lowLatencyMode:!0,maxLiveSyncPlaybackRate:2,liveSyncDuration:.5,liveMaxLatencyDuration:2,backBufferLength:5}),this.hls.loadSource(this.url),this.hls.attachMedia(t),this.hls.on(Rt.Events.MANIFEST_PARSED,()=>{t.play()})):t.canPlayType("application/vnd.apple.mpegurl")&&fetch(this.url).then(()=>{t.src=this.url,t.play()})}beforeUnmount(){var t;(t=this.hls)==null||t.destroy()}};hs([ai({required:!0})],qt.prototype,"camSettings",2);hs([ai({default:null})],qt.prototype,"printerUrl",2);qt=hs([lr],qt);var No=function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"d-flex justify-center"},[e("video",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:a.visibilityChanged,expression:"visibilityChanged"}],ref:"video",staticClass:"webcamImage",style:a.webcamStyle,attrs:{autoplay:"",muted:""},domProps:{muted:!0}})])},Uo=[];const ni={};var Bo=cr(qt,No,Uo,!1,$o,"16b345da",null,null);function $o(a){for(let t in ni)this[t]=ni[t]}const jo=function(){return Bo.exports}();export{jo as default}; diff --git a/dirs/mainsail/assets/Hlsstreamer-f9f189cf.css b/dirs/mainsail/assets/Hlsstreamer-f9f189cf.css deleted file mode 100644 index 5db5021..0000000 --- a/dirs/mainsail/assets/Hlsstreamer-f9f189cf.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-16b345da]{width:100%} diff --git a/dirs/mainsail/assets/Ipstreamer-dd27a9e8.js b/dirs/mainsail/assets/Ipstreamer-dd27a9e8.js deleted file mode 100644 index da503fb..0000000 --- a/dirs/mainsail/assets/Ipstreamer-dd27a9e8.js +++ /dev/null @@ -1 +0,0 @@ -import{m as p,B as _,G as u,P as m,j as v,n as f}from"./index-97b4652c.js";import"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var b=Object.defineProperty,h=Object.getOwnPropertyDescriptor,o=(t,e,r,s)=>{for(var i=s>1?void 0:s?h(e,r):e,n=t.length-1,l;n>=0;n--)(l=t[n])&&(i=(s?l(e,r,i):l(i))||i);return s&&i&&b(e,r,i),i};let a=class extends p(_,u){constructor(){super(...arguments),this.isVisible=!0}get url(){var e;return this.convertUrl((e=this.camSettings)==null?void 0:e.stream_url,this.printerUrl)}get webcamStyle(){var e,r,s;return{transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(r=this.camSettings.flip_vertical)!=null?r:!1,(s=this.camSettings.rotation)!=null?s:0)}}visibilityChanged(e){this.isVisible=e}};o([m({required:!0})],a.prototype,"camSettings",2);o([m({default:null})],a.prototype,"printerUrl",2);a=o([v],a);var g=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("video",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:t.visibilityChanged,expression:"visibilityChanged"}],staticClass:"webcamImage",style:t.webcamStyle,attrs:{src:t.url,autoplay:""}})},y=[];const c={};var d=f(a,g,y,!1,x,"bd59f4b0",null,null);function x(t){for(let e in c)this[e]=c[e]}const j=function(){return d.exports}();export{j as default}; diff --git a/dirs/mainsail/assets/Ipstreamer-f951d43b.css b/dirs/mainsail/assets/Ipstreamer-f951d43b.css deleted file mode 100644 index abfc875..0000000 --- a/dirs/mainsail/assets/Ipstreamer-f951d43b.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-bd59f4b0]{width:100%} diff --git a/dirs/mainsail/assets/JMuxerStream-7e36ed89.js b/dirs/mainsail/assets/JMuxerStream-7e36ed89.js deleted file mode 100644 index 3dbd09d..0000000 --- a/dirs/mainsail/assets/JMuxerStream-7e36ed89.js +++ /dev/null @@ -1 +0,0 @@ -import{c as fe,g as he}from"./overlayscrollbars-44d87bcf.js";import{H as de,m as pe,B as ye,G as ve,P as X,W as me,j as ge,n as ke}from"./index-97b4652c.js";import{l as be,m as Se,p as we}from"./vuetify-52f40ce5.js";import"./echarts-9bc570b0.js";var ee={exports:{}};(function(d,g){(function(v,k){d.exports=k(de)})(fe,function(v){function k(t){return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,r=M(t);if(e){var n=M(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return te(this,i)}}function re(t,e){return function(i){if(Array.isArray(i))return i}(t)||function(i,r){var n=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(n!=null){var s,o,u=[],a=!0,c=!1;try{for(n=n.call(i);!(a=(s=n.next()).done)&&(u.push(s.value),!r||u.length!==r);a=!0);}catch(f){c=!0,o=f}finally{try{a||n.return==null||n.return()}finally{if(c)throw o}}return u}}(t,e)||J(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){if(t){if(typeof t=="string")return W(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set"?Array.from(t):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?W(t,e):void 0}}function W(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(a){throw a},f:n}}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 s,o=!0,u=!1;return{s:function(){i=i.call(t)},n:function(){var a=i.next();return o=a.done,a},e:function(a){u=!0,s=a},f:function(){try{o||i.return==null||i.return()}finally{if(u)throw s}}}}var z,N;function b(t){if(z){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r>5,this.ntype=31&this.payload[0],this.isvcl=this.ntype==1||this.ntype==5,this.stype="",this.isfmb=!1}return m(t,[{key:"toString",value:function(){return"".concat(t.type(this),": NRI: ").concat(this.getNri())}},{key:"getNri",value:function(){return this.nri}},{key:"type",value:function(){return this.ntype}},{key:"isKeyframe",value:function(){return this.ntype===t.IDR}},{key:"getPayload",value:function(){return this.payload}},{key:"getPayloadSize",value:function(){return this.payload.byteLength}},{key:"getSize",value:function(){return 4+this.getPayloadSize()}},{key:"getData",value:function(){var e=new Uint8Array(this.getSize());return new DataView(e.buffer).setUint32(0,this.getSize()-4),e.set(this.getPayload(),4),e}}],[{key:"NDR",get:function(){return 1}},{key:"IDR",get:function(){return 5}},{key:"SEI",get:function(){return 6}},{key:"SPS",get:function(){return 7}},{key:"PPS",get:function(){return 8}},{key:"AUD",get:function(){return 9}},{key:"TYPES",get:function(){var e;return P(e={},t.IDR,"IDR"),P(e,t.SEI,"SEI"),P(e,t.SPS,"SPS"),P(e,t.PPS,"PPS"),P(e,t.NDR,"NDR"),P(e,t.AUD,"AUD"),e}},{key:"type",value:function(e){return e.ntype in t.TYPES?t.TYPES[e.ntype]:"UNKNOWN"}}]),t}();function H(t,e){var i=new Uint8Array((0|t.byteLength)+(0|e.byteLength));return i.set(t,0),i.set(e,0|t.byteLength),i}var Z=function(){function t(e){h(this,t),this.data=e,this.index=0,this.bitLength=8*e.byteLength}return m(t,[{key:"setData",value:function(e){this.data=e,this.index=0,this.bitLength=8*e.byteLength}},{key:"bitsAvailable",get:function(){return this.bitLength-this.index}},{key:"skipBits",value:function(e){if(this.bitsAvailable1&&arguments[1]!==void 0)||arguments[1],r=this.getBits(e,this.index,i);return r}},{key:"getBits",value:function(e,i){var r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(this.bitsAvailable>>n,o=8-n;if(o>=e)return r&&(this.index+=e),s>>o-e;r&&(this.index+=o);var u=e-o;return s<>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return this.readBits(1)===1}},{key:"readUByte",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return this.readBits(8*e)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}}]),t}(),q=function(){function t(e){h(this,t),this.remuxer=e,this.track=e.mp4track}return m(t,[{key:"parseSPS",value:function(e){var i=t.readSPS(new Uint8Array(e));this.track.fps=i.fps,this.track.width=i.width,this.track.height=i.height,this.track.sps=[new Uint8Array(e)],this.track.codec="avc1.";for(var r=new DataView(e.buffer,e.byteOffset+1,4),n=0;n<3;++n){var s=r.getUint8(n).toString(16);s.length<2&&(s="0"+s),this.track.codec+=s}}},{key:"parsePPS",value:function(e){this.track.pps=[new Uint8Array(e)]}},{key:"parseNAL",value:function(e){if(!e)return!1;var i=!1;switch(e.type()){case B.IDR:case B.NDR:i=!0;break;case B.PPS:this.track.pps||(this.parsePPS(e.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),i=!0;break;case B.SPS:this.track.sps||(this.parseSPS(e.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),i=!0;break;case B.AUD:b("AUD - ignoing");break;case B.SEI:b("SEI - ignoing")}return i}}],[{key:"extractNALu",value:function(e){for(var i,r,n=0,s=e.byteLength,o=0,u=[],a=0;n0&&y[1]>0&&(w=y[0]/y[1])}if(a.readBoolean()&&a.skipBits(1),a.readBoolean()&&(a.skipBits(4),a.readBoolean()&&a.skipBits(24)),a.readBoolean()&&(a.skipUEG(),a.skipUEG()),a.readBoolean()){var ce=a.readUInt(),le=a.readUInt();a.readBoolean()&&(S=le/(2*ce))}}return{fps:S>0?S:void 0,width:Math.ceil((16*(n+1)-2*c-2*f)*w),height:(2-o)*(s+1)*16-(o?2:4)*(l+p)}}},{key:"parseHeader",value:function(e){var i=new Z(e.getPayload());i.readUByte(),e.isfmb=i.readUEG()===0,e.stype=i.readUEG()}}]),t}(),ne=function(){function t(e){h(this,t),this.remuxer=e,this.track=e.mp4track}return m(t,[{key:"extractAAC",value:function(e){var i,r,n=0,s=e.byteLength,o=[];if(!t.isAACPattern(e))return C("Invalid ADTS audio format"),o;for(i=t.getHeaderLength(e),this.aacHeader||(this.aacHeader=e.subarray(0,i));n>>6),i=(60&s[2])>>>2,r=(1&s[2])<<2,r|=(192&s[3])>>>6,n[0]=e<<3,n[0]|=(14&i)>>1,n[1]|=(1&i)<<7,n[1]|=r<<3,this.track.codec="mp4a.40."+e,this.track.channelCount=r,this.track.config=n,this.remuxer.readyToDecode=!0)}}],[{key:"samplingRateMap",get:function(){return[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]}},{key:"getHeaderLength",value:function(e){return 1&e[1]?7:9}},{key:"getFrameLength",value:function(e){return(3&e[3])<<11|e[4]<<3|(224&e[5])>>>5}},{key:"isAACPattern",value:function(e){return e[0]===255&&(240&e[1])==240&&(6&e[1])==0}}]),t}(),V=function(){function t(e){h(this,t),this.listener={},this.type=""|e}return m(t,[{key:"on",value:function(e,i){return this.listener[e]||(this.listener[e]=[]),this.listener[e].push(i),!0}},{key:"off",value:function(e,i){if(this.listener[e]){var r=this.listener[e].indexOf(i);return r>-1&&this.listener[e].splice(r,1),!0}return!1}},{key:"offAll",value:function(){this.listener={}}},{key:"dispatch",value:function(e,i){return!!this.listener[e]&&(this.listener[e].map(function(r){r.apply(null,[i])}),!0)}}]),t}(),I=function(){function t(){h(this,t)}return m(t,null,[{key:"init",value:function(){var e;for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:i,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=s,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,a,o,u),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))}},{key:"box",value:function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n>24&255,s[1]=o>>16&255,s[2]=o>>8&255,s[3]=255&o,s.set(e,4),u=0,o=8;u>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))}},{key:"mfhd",value:function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}},{key:"minf",value:function(e){return e.type==="audio"?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))}},{key:"moof",value:function(e,i,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,i))}},{key:"moov",value:function(e,i,r){for(var n=e.length,s=[];n--;)s[n]=t.trak(e[n]);return t.box.apply(null,[t.types.moov,t.mvhd(r,i)].concat(s).concat(t.mvex(e)))}},{key:"mvex",value:function(e){for(var i=e.length,r=[];i--;)r[i]=t.trex(e[i]);return t.box.apply(null,[t.types.mvex].concat(r))}},{key:"mvhd",value:function(e,i){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,r)}},{key:"sdtp",value:function(e){var i,r,n=e.samples||[],s=new Uint8Array(4+n.length);for(r=0;r>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(r));var u=t.box(t.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(o))),a=e.width,c=e.height;return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,255&a,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,98,105,110,101,108,112,114,111,46,114,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(e){var i=e.config.byteLength,r=new Uint8Array(26+i+3);return r.set([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5,i]),r.set(e.config,26),r.set([6,1,2],26+i),r}},{key:"mp4a",value:function(e){var i=e.audiosamplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),t.box(t.types.esds,t.esds(e)))}},{key:"stsd",value:function(e){return e.type==="audio"?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))}},{key:"tkhd",value:function(e){var i=e.id,r=e.duration,n=e.width,s=e.height,o=e.volume;return t.box(t.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,o>>0&255,o%1*10>>0&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]))}},{key:"traf",value:function(e,i){var r=t.sdtp(e),n=e.id;return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),t.trun(e,r.length+16+16+8+16+8+8),r)}},{key:"trak",value:function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))}},{key:"trex",value:function(e){var i=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(e,i){var r,n,s,o,u,a,c=e.samples||[],f=c.length,l=12+16*f,p=new Uint8Array(l);for(i+=8+l,p.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,255&f,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,a>>>24&255,a>>>16&255,a>>>8&255,255&a],12+16*r);return t.box(t.types.trun,p)}},{key:"initSegment",value:function(e,i,r){t.types||t.init();var n,s=t.moov(e,i,r);return(n=new Uint8Array(t.FTYP.byteLength+s.byteLength)).set(t.FTYP),n.set(s,t.FTYP.byteLength),n}}]),t}(),ie=1,j=function(){function t(){h(this,t)}return m(t,[{key:"flush",value:function(){this.mp4track.len=0,this.mp4track.samples=[]}},{key:"isReady",value:function(){return!(!this.readyToDecode||!this.samples.length)||null}}],[{key:"getTrackID",value:function(){return ie++}}]),t}(),se=function(t){L(i,t);var e=R(i);function i(r){var n;return h(this,i),(n=e.call(this)).readyToDecode=!1,n.nextDts=0,n.dts=0,n.mp4track={id:j.getTrackID(),type:"audio",channelCount:0,len:0,fragmented:!0,timescale:r,duration:r,samples:[],config:"",codec:""},n.samples=[],n.aac=new ne(O(n)),n}return m(i,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.codec="",this.mp4track.channelCount="",this.mp4track.config="",this.mp4track.timescale=this.timescale,this.nextDts=0,this.dts=0}},{key:"remux",value:function(r){if(r.length>0)for(var n=0;n0&&this.readyToDecode&&(this.mp4track.len+=c,this.samples.push({units:a,size:c,keyFrame:u.keyFrame,duration:u.duration,compositionTimeOffset:u.compositionTimeOffset}))}}catch(p){s.e(p)}finally{s.f()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var r,n,s=new Uint8Array(this.mp4track.len),o=0,u=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var a=this.samples.shift(),c=a.units;if((n=a.duration)<=0)b("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(n)),this.mp4track.len-=a.size;else{this.nextDts+=n,r={size:a.size,duration:n,cts:a.compositionTimeOffset||0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,isNonSync:a.keyFrame?0:1,dependsOn:a.keyFrame?2:1}};var f,l=U(c);try{for(l.s();!(f=l.n()).done;){var p=f.value;s.set(p.getData(),o),o+=p.getSize()}}catch(w){l.e(w)}finally{l.f()}u.push(r)}}return u.length?new Uint8Array(s.buffer,0,this.mp4track.len):null}}]),i}(j),oe=function(t){L(i,t);var e=R(i);function i(r){var n;return h(this,i),(n=e.call(this,"remuxer")).initialized=!1,n.trackTypes=[],n.tracks={},n.seq=1,n.env=r,n.timescale=1e3,n.mediaDuration=0,n.aacParser=null,n}return m(i,[{key:"addTrack",value:function(r){if(r!=="video"&&r!=="both"||(this.tracks.video=new ae(this.timescale),this.trackTypes.push("video")),r==="audio"||r==="both"){var n=new se(this.timescale);this.aacParser=n.getAacParser(),this.tracks.audio=n,this.trackTypes.push("audio")}}},{key:"reset",value:function(){var r,n=U(this.trackTypes);try{for(n.s();!(r=n.n()).done;){var s=r.value;this.tracks[s].resetTrack()}}catch(o){n.e(o)}finally{n.f()}this.initialized=!1}},{key:"destroy",value:function(){this.tracks={},this.offAll()}},{key:"flush",value:function(){if(this.initialized){var r,n=U(this.trackTypes);try{for(n.s();!(r=n.n()).done;){var s=r.value,o=this.tracks[s],u=o.getPayload();if(u&&u.byteLength){var a={type:s,payload:H(I.moof(this.seq,o.dts,o.mp4track),I.mdat(u)),dts:o.dts};s==="video"&&(a.fps=o.mp4track.fps),this.dispatch("buffer",a);var c=(f=o.dts/this.timescale,l=void 0,p=void 0,w=void 0,S=void 0,S="",l=Math.floor(f),(p=parseInt(l/3600,10)%24)>0&&(S+=(p<10?"0"+p:p)+":"),S+=((w=parseInt(l/60,10)%60)<10?"0"+w:w)+":"+((l=l<0?0:l%60)<10?"0"+l:l));b("put segment (".concat(s,"): dts: ").concat(o.dts," frames: ").concat(o.mp4track.samples.length," second: ").concat(c)),o.flush(),this.seq++}}}catch(E){n.e(E)}finally{n.f()}}else this.isReady()&&(this.dispatch("ready"),this.initSegment(),this.initialized=!0,this.flush());var f,l,p,w,S}},{key:"initSegment",value:function(){var r,n=[],s=U(this.trackTypes);try{for(s.s();!(r=s.n()).done;){var o=r.value,u=this.tracks[o];if(this.env=="browser"){var a={type:o,payload:I.initSegment([u.mp4track],this.mediaDuration,this.timescale)};this.dispatch("buffer",a)}else n.push(u.mp4track)}}catch(f){s.e(f)}finally{s.f()}if(this.env=="node"){var c={type:"all",payload:I.initSegment(n,this.mediaDuration,this.timescale)};this.dispatch("buffer",c)}b("Initial segment generated.")}},{key:"isReady",value:function(){var r,n=U(this.trackTypes);try{for(n.s();!(r=n.n()).done;){var s=r.value;if(!this.tracks[s].readyToDecode||!this.tracks[s].samples.length)return!1}}catch(o){n.e(o)}finally{n.f()}return!0}},{key:"remux",value:function(r){var n,s=U(this.trackTypes);try{for(s.s();!(n=s.n()).done;){var o=n.value,u=r[o];o==="audio"&&this.tracks.video&&!this.tracks.video.readyToDecode||u.length>0&&this.tracks[o].remux(u)}}catch(a){s.e(a)}finally{s.f()}this.flush()}}]),i}(V),ue=function(t){L(i,t);var e=R(i);function i(r,n){var s;return h(this,i),(s=e.call(this,"buffer")).type=n,s.queue=new Uint8Array,s.cleaning=!1,s.pendingCleaning=0,s.cleanOffset=30,s.cleanRanges=[],s.sourceBuffer=r,s.sourceBuffer.addEventListener("updateend",function(){s.pendingCleaning>0&&(s.initCleanup(s.pendingCleaning),s.pendingCleaning=0),s.cleaning=!1,s.cleanRanges.length&&s.doCleanup()}),s.sourceBuffer.addEventListener("error",function(){s.dispatch("error",{type:s.type,name:"buffer",error:"buffer error"})}),s}return m(i,[{key:"destroy",value:function(){this.queue=null,this.sourceBuffer=null,this.offAll()}},{key:"doCleanup",value:function(){if(this.cleanRanges.length){var r=this.cleanRanges.shift();b("".concat(this.type," remove range [").concat(r[0]," - ").concat(r[1],")")),this.cleaning=!0,this.sourceBuffer.remove(r[0],r[1])}else this.cleaning=!1}},{key:"initCleanup",value:function(r){try{if(this.sourceBuffer.updating)return void(this.pendingCleaning=r);if(this.sourceBuffer.buffered&&this.sourceBuffer.buffered.length&&!this.cleaning){for(var n=0;nthis.cleanOffset&&s<(o=r-this.cleanOffset)&&this.cleanRanges.push([s,o])}this.doCleanup()}}catch(u){C("Error occured while cleaning ".concat(this.type," buffer - ").concat(u.name,": ").concat(u.message))}}},{key:"doAppend",value:function(){if(this.queue.length&&this.sourceBuffer&&!this.sourceBuffer.updating)try{this.sourceBuffer.appendBuffer(this.queue),this.queue=new Uint8Array}catch(n){var r="unexpectedError";n.name==="QuotaExceededError"?(b("".concat(this.type," buffer quota full")),r="QuotaExceeded"):(C("Error occured while appending ".concat(this.type," buffer - ").concat(n.name,": ").concat(n.message)),r="InvalidStateError"),this.dispatch("error",{type:this.type,name:r,error:"buffer error"})}}},{key:"feed",value:function(r){this.queue=H(this.queue,r)}}]),i}(V);return function(t){L(i,t);var e=R(i);function i(r){var n;return h(this,i),(n=e.call(this,"jmuxer")).isReset=!1,n.options=Object.assign({},{node:"",mode:"both",flushingTime:500,maxDelay:500,clearBuffer:!0,fps:30,readFpsFromTrack:!1,debug:!1,onReady:function(){},onError:function(){},onMissingVideoFrames:function(){},onMissingAudioFrames:function(){}},r),n.env=(typeof process>"u"?"undefined":k(process))==="object"&&typeof window>"u"?"node":"browser",n.options.debug&&(z=console.log,N=console.error),n.options.fps||(n.options.fps=30),n.frameDuration=1e3/n.options.fps|0,n.remuxController=new oe(n.env),n.remuxController.addTrack(n.options.mode),n.initData(),n.remuxController.on("buffer",n.onBuffer.bind(O(n))),n.env=="browser"&&(n.remuxController.on("ready",n.createBuffer.bind(O(n))),n.initBrowser()),n}return m(i,[{key:"initData",value:function(){this.lastCleaningTime=Date.now(),this.kfPosition=[],this.kfCounter=0,this.pendingUnits={},this.remainingData=new Uint8Array,this.startInterval()}},{key:"initBrowser",value:function(){typeof this.options.node=="string"&&this.options.node==""&&C("no video element were found to render, provide a valid video element"),this.node=typeof this.options.node=="string"?document.getElementById(this.options.node):this.options.node,this.mseReady=!1,this.setupMSE()}},{key:"createStream",value:function(){var r=this.feed.bind(this),n=this.destroy.bind(this);return this.stream=new v.Duplex({writableObjectMode:!0,read:function(s){},write:function(s,o,u){r(s),u()},final:function(s){n(),s()}}),this.stream}},{key:"setupMSE",value:function(){if(window.MediaSource=window.MediaSource||window.WebKitMediaSource,!window.MediaSource)throw"Oops! Browser does not support media source extension.";this.isMSESupported=!!window.MediaSource,this.mediaSource=new MediaSource,this.url=URL.createObjectURL(this.mediaSource),this.node.src=this.url,this.mseEnded=!1,this.mediaSource.addEventListener("sourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("sourceclose",this.onMSEClose.bind(this)),this.mediaSource.addEventListener("webkitsourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("webkitsourceclose",this.onMSEClose.bind(this))}},{key:"endMSE",value:function(){if(!this.mseEnded)try{this.mseEnded=!0,this.mediaSource.endOfStream()}catch{C("mediasource is not available to end")}}},{key:"feed",value:function(r){var n,s,o,u=!1,a={video:[],audio:[]};if(r&&this.remuxController){if(o=r.duration?parseInt(r.duration):0,r.video){r.video=H(this.remainingData,r.video);var c=re(q.extractNALu(r.video),2);if(n=c[0],s=c[1],this.remainingData=s||new Uint8Array,!(n.length>0))return C("Failed to extract any NAL units from video data:",s),void(typeof this.options.onMissingVideoFrames=="function"&&this.options.onMissingVideoFrames.call(null,r));a.video=this.getVideoFrames(n,o,r.compositionTimeOffset),u=!0}if(r.audio){if(!((n=this.remuxController.aacParser.extractAAC(r.audio)).length>0))return C("Failed to extract audio data from:",r.audio),void(typeof this.options.onMissingAudioFrames=="function"&&this.options.onMissingAudioFrames.call(null,r));a.audio=this.getAudioFrames(n,o),u=!0}u?this.remuxController.remux(a):C("Input object must have video and/or audio property. Make sure it is a valid typed array")}}},{key:"getVideoFrames",value:function(r,n,s){var o,u=this,a=[],c=[],f=0,l=!1,p=!1;this.pendingUnits.units&&(a=this.pendingUnits.units,p=this.pendingUnits.vcl,l=this.pendingUnits.keyFrame,this.pendingUnits={});var w,S=U(r);try{for(S.s();!(w=S.n()).done;){var E=w.value,x=new B(E);x.type()!==B.IDR&&x.type()!==B.NDR||q.parseHeader(x),a.length&&p&&(x.isfmb||!x.isvcl)&&(c.push({units:a,keyFrame:l}),a=[],l=!1,p=!1),a.push(x),l=l||x.isKeyframe(),p=p||x.isvcl}}catch(D){S.e(D)}finally{S.f()}if(a.length)if(n)if(p)c.push({units:a,keyFrame:l});else{var T=c.length-1;T>=0&&(c[T].units=c[T].units.concat(a))}else this.pendingUnits={units:a,keyFrame:l,vcl:p};return o=n?n/c.length|0:this.frameDuration,f=n?n-o*c.length:0,c.map(function(D){D.duration=o,D.compositionTimeOffset=s,f>0&&(D.duration++,f--),u.kfCounter++,D.keyFrame&&u.options.clearBuffer&&u.kfPosition.push(u.kfCounter*o/1e3)}),b("jmuxer: No. of frames of the last chunk: ".concat(c.length)),c}},{key:"getAudioFrames",value:function(r,n){var s,o,u=[],a=0,c=U(r);try{for(c.s();!(o=c.n()).done;){var f=o.value;u.push({units:f})}}catch(l){c.e(l)}finally{c.f()}return s=n?n/u.length|0:this.frameDuration,a=n?n-s*u.length:0,u.map(function(l){l.duration=s,a>0&&(l.duration++,a--)}),u}},{key:"destroy",value:function(){if(this.stopInterval(),this.stream&&(this.remuxController.flush(),this.stream.push(null),this.stream=null),this.remuxController&&(this.remuxController.destroy(),this.remuxController=null),this.bufferControllers){for(var r in this.bufferControllers)this.bufferControllers[r].destroy();this.bufferControllers=null,this.endMSE()}this.node=!1,this.mseReady=!1,this.videoStarted=!1,this.mediaSource=null}},{key:"reset",value:function(){if(this.stopInterval(),this.isReset=!0,this.node.pause(),this.remuxController&&this.remuxController.reset(),this.bufferControllers){for(var r in this.bufferControllers)this.bufferControllers[r].destroy();this.bufferControllers=null,this.endMSE()}this.initData(),this.env=="browser"&&this.initBrowser(),b("JMuxer was reset")}},{key:"createBuffer",value:function(){if(this.mseReady&&this.remuxController&&this.remuxController.isReady()&&!this.bufferControllers)for(var r in this.bufferControllers={},this.remuxController.tracks){var n=this.remuxController.tracks[r];if(!i.isSupported("".concat(r,'/mp4; codecs="').concat(n.mp4track.codec,'"')))return C("Browser does not support codec"),!1;var s=this.mediaSource.addSourceBuffer("".concat(r,'/mp4; codecs="').concat(n.mp4track.codec,'"'));this.bufferControllers[r]=new ue(s,r),this.bufferControllers[r].on("error",this.onBufferError.bind(this))}}},{key:"startInterval",value:function(){var r=this;this.interval=setInterval(function(){r.options.flushingTime?r.applyAndClearBuffer():r.bufferControllers&&r.cancelDelay()},this.options.flushingTime||1e3)}},{key:"stopInterval",value:function(){this.interval&&clearInterval(this.interval)}},{key:"cancelDelay",value:function(){if(this.node.buffered&&this.node.buffered.length>0&&!this.node.seeking){var r=this.node.buffered.end(0);r-this.node.currentTime>this.options.maxDelay/1e3&&(console.log("delay"),this.node.currentTime=r-.001)}}},{key:"releaseBuffer",value:function(){for(var r in this.bufferControllers)this.bufferControllers[r].doAppend()}},{key:"applyAndClearBuffer",value:function(){this.bufferControllers&&(this.releaseBuffer(),this.clearBuffer())}},{key:"getSafeClearOffsetOfBuffer",value:function(r){for(var n,s=this.options.mode==="audio"&&r||0,o=0;o=r);o++)n=this.kfPosition[o];return n&&(this.kfPosition=this.kfPosition.filter(function(u){return u=n})),s}},{key:"clearBuffer",value:function(){if(this.options.clearBuffer&&Date.now()-this.lastCleaningTime>1e4){for(var r in this.bufferControllers){var n=this.getSafeClearOffsetOfBuffer(this.node.currentTime);this.bufferControllers[r].initCleanup(n)}this.lastCleaningTime=Date.now()}}},{key:"onBuffer",value:function(r){this.options.readFpsFromTrack&&r.fps!==void 0&&this.options.fps!=r.fps&&(this.options.fps=r.fps,this.frameDuration=Math.ceil(1e3/r.fps),b("JMuxer changed FPS to ".concat(r.fps," from track data"))),this.env=="browser"?this.bufferControllers&&this.bufferControllers[r.type]&&this.bufferControllers[r.type].feed(r.payload):this.stream&&this.stream.push(r.payload),this.options.flushingTime===0&&this.applyAndClearBuffer()}},{key:"onMSEOpen",value:function(){this.mseReady=!0,URL.revokeObjectURL(this.url),typeof this.options.onReady=="function"&&this.options.onReady.call(null,this.isReset)}},{key:"onMSEClose",value:function(){this.mseReady=!1,this.videoStarted=!1}},{key:"onBufferError",value:function(r){if(r.name=="QuotaExceeded")return b("JMuxer cleaning ".concat(r.type," buffer due to QuotaExceeded error")),void this.bufferControllers[r.type].initCleanup(this.node.currentTime);r.name=="InvalidStateError"?(b("JMuxer is reseting due to InvalidStateError"),this.reset()):this.endMSE(),typeof this.options.onError=="function"&&this.options.onError.call(null,r)}}],[{key:"isSupported",value:function(r){return window.MediaSource&&window.MediaSource.isTypeSupported(r)}}]),i}(V)})})(ee);var xe=ee.exports;const Ue=he(xe);var Ae=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,F=(d,g,v,k)=>{for(var h=k>1?void 0:k?Ce(g,v):g,A=d.length-1,m;A>=0;A--)(m=d[A])&&(h=(k?m(g,v,h):m(h))||h);return k&&h&&Ae(g,v,h),h};let _=class extends pe(ye,ve){constructor(){super(...arguments),this.jmuxer=null,this.status="connecting"}get url(){var d;return this.convertUrl((d=this.camSettings)==null?void 0:d.stream_url,this.printerUrl)}get webcamStyle(){var d,g,v;return{transform:this.generateTransform((d=this.camSettings.flip_horizontal)!=null?d:!1,(g=this.camSettings.flip_vertical)!=null?g:!1,(v=this.camSettings.rotation)!=null?v:0)}}mounted(){this.play()}play(){var k;if(this.status="connecting",(k=this.jmuxer)==null||k.destroy(),!this.url.startsWith("ws://")&&!this.url.startsWith("wss://")){console.error("jmuxer error: only websocket streams supported (ws://.. or wss://..)"),this.status="error";return}const d=this.$refs.video,g=this.camSettings.target_fps||10;this.jmuxer=new Ue({node:d,mode:"video",flushingTime:0,fps:g,onReady:h=>{this.status="connected",console.log("jmuxer ready:",h)},onError:h=>{this.status="error",console.log("jmuxer error:",h)}});const v=new WebSocket(this.url);v.binaryType="arraybuffer",v.addEventListener("message",h=>{var A;(A=this.jmuxer)==null||A.feed({video:new Uint8Array(h.data)})}),v.addEventListener("error",h=>{this.status="error",console.log("jmuxer ws error:",h)})}beforeUnmount(){var d;(d=this.jmuxer)==null||d.destroy()}onCamSettingsChanged(){this.play()}};F([X({required:!0})],_.prototype,"camSettings",2);F([X({default:null})],_.prototype,"printerUrl",2);F([me("camSettings",{deep:!0})],_.prototype,"onCamSettingsChanged",1);_=F([ge],_);var Be=function(){var d=this,g=d.$createElement,v=d._self._c||g;return v("div",[v("video",{ref:"video",staticClass:"webcamImage",style:d.webcamStyle,attrs:{autoplay:""}}),d.status!=="connected"?v(be,[v(Se,{staticClass:"_webcam_jmuxer_output text-center d-flex flex-column justify-center align-center"},[d.status==="connecting"?v(we,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):d._e(),v("span",{staticClass:"mt-3"},[d._v(d._s(d.status))])],1)],1):d._e()],1)},De=[];const Q={};var Ee=ke(_,Be,De,!1,Te,"03ec43aa",null,null);function Te(d){for(let g in Q)this[g]=Q[g]}const Re=function(){return Ee.exports}();export{Re as default}; diff --git a/dirs/mainsail/assets/JMuxerStream-baf633f9.css b/dirs/mainsail/assets/JMuxerStream-baf633f9.css deleted file mode 100644 index 4988b97..0000000 --- a/dirs/mainsail/assets/JMuxerStream-baf633f9.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-03ec43aa]{width:100%}._webcam_jmuxer_output[data-v-03ec43aa]{aspect-ratio:1.5} diff --git a/dirs/mainsail/assets/JanusStreamer-1b43ec62.js b/dirs/mainsail/assets/JanusStreamer-1b43ec62.js deleted file mode 100644 index c2ea002..0000000 --- a/dirs/mainsail/assets/JanusStreamer-1b43ec62.js +++ /dev/null @@ -1,8 +0,0 @@ -import{m as cv,B as fv,G as lv,P as Hu,W as dv,R as pv,j as hv,n as gv}from"./index-97b4652c.js";import{g as qu,c as Kn}from"./overlayscrollbars-44d87bcf.js";import{a4 as Uo,a5 as fi,a6 as li,a7 as er}from"./echarts-9bc570b0.js";import{l as mv,m as vv,p as yv}from"./vuetify-52f40ce5.js";function _v(i,s){for(var n=0;no[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}f.sessions=new Map;f.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){let i=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),s=33;return window.navigator.userAgent.match("Linux")&&(s=35),i>=26&&i<=s?!0:f.extension.isInstalled()}else return!0};var Ju={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return document.querySelector("#janus-extension-installed")!==null},getScreen:function(i){let s=window.setTimeout(function(){let n=new Error("NavigatorUserMediaError");return n.name='The required Chrome extension is not installed: click here to install it. (NOTE: this will need you to refresh the page)',i(n)},1e3);this.cache[s]=i,window.postMessage({type:"janusGetScreen",id:s},"*")},init:function(){let i={};this.cache=i,window.addEventListener("message",function(s){if(s.origin==window.location.origin)if(s.data.type=="janusGotScreen"&&i[s.data.id]){let n=i[s.data.id];if(delete i[s.data.id],s.data.sourceId===""){let o=new Error("NavigatorUserMediaError");o.name="You cancelled the request for permission, giving up...",n(o)}else n(null,s.data.sourceId)}else s.data.type=="janusGetScreenPending"&&window.clearTimeout(s.data.id)})}};f.useDefaultDependencies=function(i){let s=i&&i.fetch||fetch,n=i&&i.Promise||Promise,o=i&&i.WebSocket||WebSocket;return{newWebSocket:function(a,u){return new o(a,u)},extension:i&&i.extension||Ju,isArray:function(a){return Array.isArray(a)},webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(a,u){let p={method:u.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};u.verb==="POST"&&(p.headers["Content-Type"]="application/json"),typeof u.withCredentials<"u"&&(p.credentials=u.withCredentials===!0?"include":u.withCredentials?u.withCredentials:"omit"),u.body&&(p.body=JSON.stringify(u.body));let g=s(a,p).catch(function(T){return n.reject({message:"Probably a network error, is the server down?",error:T})});if(u.timeout){let T=new n(function(l,_){let D=setTimeout(function(){return clearTimeout(D),_({message:"Request timed out",timeout:u.timeout})},u.timeout)});g=n.race([g,T])}return g.then(function(T){if(T.ok){if(typeof u.success==typeof f.noop)return T.json().then(function(l){try{u.success(l)}catch(_){f.error("Unhandled httpAPICall success callback error",_)}},function(l){return n.reject({message:"Failed to parse response body",error:l,response:T})})}else return n.reject({message:"API call failed",response:T})}).catch(function(T){typeof u.error==typeof f.noop&&u.error(T.message||"<< internal error >>",T)}),g}}};f.useOldDependencies=function(i){let s=i&&i.jQuery||jQuery,n=i&&i.WebSocket||WebSocket;return{newWebSocket:function(o,a){return new n(o,a)},isArray:function(o){return s.isArray(o)},extension:i&&i.extension||Ju,webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(o,a){let u=typeof a.body<"u"?{contentType:"application/json",data:JSON.stringify(a.body)}:{},p=typeof a.withCredentials<"u"?{xhrFields:{withCredentials:a.withCredentials}}:{};return s.ajax(s.extend(u,p,{url:o,type:a.verb,cache:!1,dataType:"json",async:a.async,timeout:a.timeout,success:function(g){typeof a.success==typeof f.noop&&a.success(g)},error:function(g,T,l){typeof a.error==typeof f.noop&&a.error(T,l)}}))}}};f.mediaToTracks=function(i){let s=[];if(!i)s.push({type:"audio",capture:!0,recv:!0}),s.push({type:"video",capture:!0,recv:!0});else{if(!i.keepAudio&&i.audio!==!1&&(typeof i.audio>"u"||i.audio||i.audioSend||i.audioRecv||i.addAudio||i.replaceAudio||i.removeAudio)){let n={type:"audio"};i.removeAudio?n.remove=!0:(i.addAudio?n.add=!0:i.replaceAudio&&(n.replace=!0),i.audioSend!==!1&&(n.capture=i.audio||!0),i.audioRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}if(!i.keepVideo&&i.video!==!1&&(typeof i.video>"u"||i.video||i.videoSend||i.videoRecv||i.addVideo||i.replaceVideo||i.removeVideo)){let n={type:"video"};i.removeVideo?n.remove=!0:(i.addVideo?n.add=!0:i.replaceVideo&&(n.replace=!0),i.videoSend!==!1&&(n.capture=i.video||!0,["screen","window","desktop"].includes(n.capture)&&(n.type="screen",n.capture={video:{}},i.screenshareFrameRate&&(n.capture.frameRate=i.screenshareFrameRate),i.screenshareHeight&&(n.capture.height=i.screenshareHeight),i.screenshareWidth&&(n.capture.width=i.screenshareWidth))),i.videoRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}i.data&&s.push({type:"data"})}return s};f.trackConstraints=function(i){let s={};if(!i||!i.capture)return s;if(i.type==="audio")s.audio=i.capture;else if(i.type==="video")if((i.simulcast||i.svc)&&i.capture===!0&&(i.capture="hires"),i.capture===!0||typeof i.capture=="object")s.video=i.capture;else{let n=0,o=0;i.capture==="lowres"?(n=320,o=240):i.capture==="lowres-16:9"?(n=320,o=180):i.capture==="hires"||i.capture==="hires-16:9"||i.capture==="hdres"?(n=1280,o=720):i.capture==="fhdres"?(n=1920,o=1080):i.capture==="4kres"?(n=3840,o=2160):i.capture==="stdres"?(n=640,o=480):i.capture==="stdres-16:9"?(n=640,o=360):(f.log("Default video setting is stdres 4:3"),n=640,o=480),s.video={width:{ideal:n},height:{ideal:o}}}else i.type==="screen"&&(s.video=i.capture);return s};f.noop=function(){};f.dataChanDefaultLabel="JanusDataChannel";f.endOfCandidates=null;f.stopAllTracks=function(i){try{let s=i.getTracks();for(let n of s)f.log(n),n&&n.dontStop!==!0&&n.stop()}catch{}};f.init=function(i){if(i=i||{},i.callback=typeof i.callback=="function"?i.callback:f.noop,f.initDone)i.callback();else{if(typeof console.log>"u"&&(console.log=function(){}),f.trace=f.noop,f.debug=f.noop,f.vdebug=f.noop,f.log=f.noop,f.warn=f.noop,f.error=f.noop,i.debug===!0||i.debug==="all")f.trace=console.trace.bind(console),f.debug=console.debug.bind(console),f.vdebug=console.debug.bind(console),f.log=console.log.bind(console),f.warn=console.warn.bind(console),f.error=console.error.bind(console);else if(Array.isArray(i.debug))for(let u of i.debug)switch(u){case"trace":f.trace=console.trace.bind(console);break;case"debug":f.debug=console.debug.bind(console);break;case"vdebug":f.vdebug=console.debug.bind(console);break;case"log":f.log=console.log.bind(console);break;case"warn":f.warn=console.warn.bind(console);break;case"error":f.error=console.error.bind(console);break}f.log("Initializing library");let s=i.dependencies||f.useDefaultDependencies();f.isArray=s.isArray,f.webRTCAdapter=s.webRTCAdapter,f.httpAPICall=s.httpAPICall,f.newWebSocket=s.newWebSocket,f.extension=s.extension,f.extension.init(),f.listDevices=function(u,p){u=typeof u=="function"?u:f.noop,p||(p={audio:!0,video:!0}),f.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(p).then(function(g){navigator.mediaDevices.enumerateDevices().then(function(T){f.debug(T),u(T),f.stopAllTracks(g)})}).catch(function(g){f.error(g),u([])}):(f.warn("navigator.mediaDevices unavailable"),u([]))},f.attachMediaStream=function(u,p){try{u.srcObject=p}catch{try{u.src=URL.createObjectURL(p)}catch(T){f.error("Error attaching stream to element",T)}}},f.reattachMediaStream=function(u,p){try{u.srcObject=p.srcObject}catch{try{u.src=p.src}catch(T){f.error("Error reattaching stream to element",T)}}};let o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,function(){f.log("Closing window");for(const[u,p]of f.sessions)p&&p.destroyOnUnload&&(f.log("Destroying session "+u),p.destroy({unload:!0,notifyDestroyed:!1}));a&&typeof a=="function"&&a()}),f.safariVp8=!1,f.safariVp9=!1,f.webRTCAdapter.browserDetails.browser==="safari"&&f.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(let u of RTCRtpSender.getCapabilities("video").codecs)u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp8"?f.safariVp8=!0:u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp9"&&(f.safariVp9=!0);f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{let u=new RTCPeerConnection({});u.createOffer({offerToReceiveVideo:!0}).then(function(p){f.safariVp8=p.sdp.indexOf("VP8")!==-1,f.safariVp9=p.sdp.indexOf("VP9")!==-1,f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),u.close(),u=null})}f.initDone=!0,i.callback()}};f.isWebrtcSupported=function(){return!!window.RTCPeerConnection};f.isGetUserMediaAvailable=function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia};f.randomString=function(i){let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let o=0;o3){_e=!1,i.error("Lost connection to the server (is it down?)");return}mt()}})}function Zt(v,C){if(Ze=0,!s&&typeof $<"u"&&$!==null&&C!==!0&&mt(),!s&&f.isArray(v)){for(let b=0;b0)for(let A in x){let B=x[A];if(B&&B.sender&&B.sender.track&&B.sender.track.kind==="video"){let re=B.sender.getParameters();re&&re.encodings&&re.encodings[0]&&re.encodings[0].scalabilityMode&&(W||(W=[]),W.push({mindex:parseInt(A),mid:B.mid,svc:re.encodings[0].scalabilityMode}))}}}W&&(w.jsep.svc=W)}if(f.debug("Sending message to plugin (handle="+v+"):"),f.debug(w),s){w.session_id=$,w.handle_id=v,me.set(I,function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()}),n.send(JSON.stringify(w));return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()},error:function(W,F){f.error(W+":",F),C.error(W+": "+F)}})}function or(v,C){if(!_e){f.warn("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle");return}let y={janus:"trickle",candidate:C,transaction:f.randomString(12)};if(b.token&&(y.token=b.token),j&&(y.apisecret=j),f.vdebug("Sending trickle candidate (handle="+v+"):"),f.vdebug(y),s){y.session_id=$,y.handle_id=v,n.send(JSON.stringify(y));return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:y,success:function(O){if(f.vdebug("Candidate sent!"),f.vdebug(O),O.janus!=="ack"){f.error("Ooops: "+O.error.code+" "+O.error.reason);return}},error:function(O,I){f.error(O+":",I)}})}function at(v,C,b,y,O){let I=X.get(v);if(!I||!I.webrtcStuff){f.warn("Invalid handle");return}let w=I.webrtcStuff;if(!w.pc){f.warn("Invalid PeerConnection");return}let W=function(A){f.log("Received message on data channel:",A);let B=A.target.label;I.ondata(A.data,B)},F=function(A){f.log("Received state change on data channel:",A);let B=A.target.label,re=A.target.protocol,fe=w.dataChannel[B]?w.dataChannel[B].readyState:"null";if(f.log("State change on <"+B+"> data channel: "+fe),fe==="open"){if(w.dataChannel[B].pending&&w.dataChannel[B].pending.length>0){f.log("Sending pending messages on <"+B+">:",w.dataChannel[B].pending.length);for(let lt of w.dataChannel[B].pending)f.log("Sending data on data channel <"+B+">"),f.debug(lt),w.dataChannel[B].send(lt);w.dataChannel[B].pending=[]}I.ondataopen(B,re)}},x=function(A){f.error("Got error on data channel:",A)};if(y)w.dataChannel[C]=y;else{let A=w.dataChannelOptions;b&&(A.protocol=b),w.dataChannel[C]=w.pc.createDataChannel(C,A)}w.dataChannel[C].onmessage=W,w.dataChannel[C].onopen=F,w.dataChannel[C].onclose=F,w.dataChannel[C].onerror=x,w.dataChannel[C].pending=[],O&&w.dataChannel[C].pending.push(O)}function ut(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff,O=C.text||C.data;if(!O){f.warn("Invalid data"),C.error("Invalid data");return}let I=C.label?C.label:f.dataChanDefaultLabel;if(!y.dataChannel[I]){at(v,I,C.protocol,!1,O,C.protocol),C.success();return}if(y.dataChannel[I].readyState!=="open"){y.dataChannel[I].pending.push(O),C.success();return}f.log("Sending data on data channel <"+I+">"),f.debug(O),y.dataChannel[I].send(O),C.success()}function sr(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff;if(!y.dtmfSender){if(y.pc){let x=y.pc.getSenders().find(function(A){return A.track&&A.track.kind==="audio"});if(!x){f.warn("Invalid DTMF configuration (no audio track)"),C.error("Invalid DTMF configuration (no audio track)");return}y.dtmfSender=x.dtmf,y.dtmfSender&&(f.log("Created DTMF Sender"),y.dtmfSender.ontonechange=function(A){f.debug("Sent DTMF tone: "+A.tone)})}if(!y.dtmfSender){f.warn("Invalid DTMF configuration"),C.error("Invalid DTMF configuration");return}}let O=C.dtmf;if(!O){f.warn("Invalid DTMF parameters"),C.error("Invalid DTMF parameters");return}let I=O.tones;if(!I){f.warn("Invalid DTMF string"),C.error("Invalid DTMF string");return}let w=typeof O.duration=="number"?O.duration:500,W=typeof O.gap=="number"?O.gap:50;f.debug("Sending DTMF string "+I+" (duration "+w+"ms, gap "+W+"ms)"),y.dtmfSender.insertDTMF(I,w,W),C.success()}function Lt(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=C.noRequest===!0;f.log("Destroying handle "+v+" (only-locally="+b+")"),qe(v);let y=X.get(v);if(!y||y.detached){X.delete(v),C.success();return}if(y.detached=!0,b){X.delete(v),C.success();return}if(!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let O={janus:"detach",transaction:f.randomString(12)};if(y.token&&(O.token=y.token),j&&(O.apisecret=j),s){O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O)),X.delete(v),C.success();return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed handle:"),f.debug(I),I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),X.delete(v),C.success()},error:function(I,w){f.error(I+":",w),X.delete(v),C.success()}})}function Xe(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(y.pc)return;let O={iceServers:T,iceTransportPolicy:l,bundlePolicy:_};O.sdpSemantics="unified-plan";let I=!1;if(C.tracks){for(let w of C.tracks)if(w.transforms&&(w.transforms.sender||w.transforms.receiver)){I=!0;break}}RTCRtpSender&&(RTCRtpSender.prototype.createEncodedStreams||RTCRtpSender.prototype.createEncodedAudioStreams&&RTCRtpSender.prototype.createEncodedVideoStreams)&&I&&(y.insertableStreams=!0,O.forceEncodedAudioInsertableStreams=!0,O.forceEncodedVideoInsertableStreams=!0,O.encodedInsertableStreams=!0),f.log("Creating PeerConnection"),y.pc=new RTCPeerConnection(O),f.debug(y.pc),y.pc.getStats&&(y.volume={},y.bitrate.value="0 kbits/sec"),f.log("Preparing local SDP and gathering candidates (trickle="+y.trickle+")"),y.pc.oniceconnectionstatechange=function(){y.pc&&b.iceState(y.pc.iceConnectionState)},y.pc.onicecandidate=function(w){if(!w.candidate||w.candidate.candidate&&w.candidate.candidate.indexOf("endOfCandidates")>0)f.log("End of candidates."),y.iceDone=!0,y.trickle===!0?or(v,{completed:!0}):hn(v,C);else{let W={candidate:w.candidate.candidate,sdpMid:w.candidate.sdpMid,sdpMLineIndex:w.candidate.sdpMLineIndex};y.trickle===!0&&or(v,W)}},y.pc.ontrack=function(w){if(f.log("Handling Remote Track",w),!w.streams||!w.track)return;let W=w.transceiver?w.transceiver.mid:w.track.id;try{b.onremotetrack(w.track,W,!0,{reason:"created"})}catch(x){f.error("Error calling onremotetrack",x)}if(w.track.onended)return;let F=null;f.log("Adding onended callback to track:",w.track),w.track.onended=function(x){f.log("Remote track removed:",x),clearTimeout(F);let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"ended"})}catch(fe){f.error("Error calling onremotetrack on removal",fe)}},w.track.onmute=function(x){f.log("Remote track muted:",x),F||(F=setTimeout(function(){f.log("Removing remote track");let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"mute"})}catch(fe){f.error("Error calling onremotetrack on mute",fe)}F=null},3*840))},w.track.onunmute=function(x){if(f.log("Remote track flowing again:",x),F!=null)clearTimeout(F),F=null;else try{let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;b.onremotetrack(x.target,re,!0,{reason:"unmute"})}catch(A){f.error("Error calling onremotetrack on unmute",A)}}}}async function pn(v,C,b){b=b||{},b.success=typeof b.success=="function"?b.success:f.noop,b.error=typeof b.error=="function"?b.error:fr;let y=b.jsep;if(C&&y){f.error("Provided a JSEP to a createOffer"),b.error("Provided a JSEP to a createOffer");return}else if(!C&&(!y||!y.type||!y.sdp)){f.error("A valid JSEP is required for createAnswer"),b.error("A valid JSEP is required for createAnswer");return}if(b.media&&!b.tracks){if(b.tracks=f.mediaToTracks(b.media),b.simulcast===!0||b.simulcast2===!0||b.svc){for(let w of b.tracks)if(w.type==="video"){b.simulcast===!0||b.simulcast2===!0?w.simulcast=!0:b.svc&&(w.svc=b.svc);break}}f.warn("Deprecated media object passed, use tracks instead. Automatically translated to:",b.tracks)}if(b.tracks&&!Array.isArray(b.tracks)){f.error("Tracks must be an array"),b.error("Tracks must be an array");return}let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),b.error("Invalid handle");return}let I=O.webrtcStuff;I.trickle=lr(b.trickle);try{if(Xe(v,b),C&&await bt(v,b),y){if(await I.pc.setRemoteDescription(y),f.log("Remote description accepted!"),I.remoteSdp=y.sdp,I.candidates&&I.candidates.length>0){for(let W=0;W0){for(let I=0;I"u"||x.add===null)&&(typeof x.remove>"u"||x.remove===null)&&(typeof x.replace>"u"||x.replace===null)&&(x.add=!0),x.add&&x.remove||x.add&&x.remove&&x.replace){f.warn("Conflicting actions for track, ignoring:",x);continue}x.add&&x.replace?(f.warn("Both add and replace provided, falling back to replace:",x),delete x.add):x.remove&&x.replace&&(f.warn("Both remove and replace provided, falling back to remove:",x),delete x.replace);let A=x.type;x.type==="screen"&&(A="video");let B=null,re=null;if(x.mid?B=y.pc.getTransceivers().find(N=>N.mid===x.mid&&N.receiver.track.kind===A):B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),x.replace||x.remove){if(!B){f.warn("Couldn't find a transceiver for track:",x);continue}if(!B.sender){f.warn("No sender in the transceiver for track:",x);continue}re=B.sender}if(F&&!B&&(B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),!B)){f.warn("Couldn't find a transceiver for track:",x);continue}let fe=null,lt=null;if((x.remove||x.replace)&&(f.log("Removing track from PeerConnection",x),lt=re.track?re.track.id:null,await re.replaceTrack(null),lt&&y.myStream)){let N=null;if(A==="audio"&&y.myStream.getAudioTracks()&&y.myStream.getAudioTracks().length)for(let ne of y.myStream.getAudioTracks())ne.id===lt&&(N=ne,f.log("Removing audio track:",N));else if(A==="video"&&y.myStream.getVideoTracks()&&y.myStream.getVideoTracks().length)for(let ne of y.myStream.getVideoTracks())ne.id===lt&&(N=ne,f.log("Removing video track:",N));if(N){try{y.myStream.removeTrack(N),b.onlocaltrack(N,!1)}catch(ne){f.error("Error calling onlocaltrack on removal for renegotiation",ne)}if(N.dontStop!==!0)try{N.stop()}catch{}}}if(x.capture){if(x.gumGroup&&w[x.gumGroup]&&w[x.gumGroup].stream){let N=w[x.gumGroup].stream;fe=x.type==="audio"?N.getAudioTracks()[0]:N.getVideoTracks()[0],delete w[x.gumGroup].stream,delete w[x.gumGroup],delete x.gumGroup}else if(x.capture instanceof MediaStreamTrack)fe=x.capture;else{I||(I=!0,b.consentDialog(!0));let N=f.trackConstraints(x),ne=null;if(x.type==="audio"||x.type==="video"){if(x.gumGroup){let be=x.type==="audio"?"video":"audio";if(w[x.gumGroup]&&w[x.gumGroup][be]){let vt=w[x.gumGroup][be],yi=f.trackConstraints(vt);N[be]=yi[be]}}ne=await navigator.mediaDevices.getUserMedia(N),x.gumGroup&&N.audio&&N.video&&(w[x.gumGroup].stream=ne,delete x.gumGroup)}else ne=await navigator.mediaDevices.getDisplayMedia(N);fe=x.type==="audio"?ne.getAudioTracks()[0]:ne.getVideoTracks()[0]}if(x.replace){await re.replaceTrack(fe);let N="sendrecv";(x.recv===!1||B.direction==="inactive"||B.direction==="sendonly")&&(N="sendonly"),B.setDirection?B.setDirection(N):B.direction=N}else{if(y.myStream||(y.myStream=new MediaStream),A==="audio"||!x.simulcast&&!x.svc)re=y.pc.addTrack(fe,y.myStream),B=y.pc.getTransceivers().find(N=>N.sender===re);else if(x.simulcast){if(f.webRTCAdapter.browserDetails.browser!=="firefox"){f.log("Enabling rid-based simulcasting:",fe);let N=Ye(x.simulcastMaxBitrates);B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:x.sendEncodings||[{rid:"h",active:!0,scalabilityMode:"L1T2",maxBitrate:N.high},{rid:"m",active:!0,scalabilityMode:"L1T2",maxBitrate:N.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,scalabilityMode:"L1T2",maxBitrate:N.low,scaleResolutionDownBy:4}]})}else if(f.log("Enabling Simulcasting for Firefox (RID)"),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream]}),re=B?B.sender:null,re){let N=re.getParameters();N||(N={});let ne=Ye(x.simulcastMaxBitrates);N.encodings=x.sendEncodings||[{rid:"h",active:!0,maxBitrate:ne.high},{rid:"m",active:!0,maxBitrate:ne.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:ne.low,scaleResolutionDownBy:4}],re.setParameters(N)}}else f.log("Enabling SVC ("+x.svc+"):",fe),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:[{scalabilityMode:x.svc}]});if(re||(re=B?B.sender:null),x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else if(B)try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(x.bitrate){if(x.simulcast||x.svc)f.warn("Ignoring bitrate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.bitrate)||x.bitrate<0)f.warn("Ignoring invalid bitrate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring bitrate for track:",x):(N.encodings[0].maxBitrate=x.bitrate,await re.setParameters(N))}}if(A==="video"&&x.framerate){if(x.simulcast||x.svc)f.warn("Ignoring framerate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.framerate)||x.framerate<0)f.warn("Ignoring invalid framerate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring framerate for track:",x):(N.encodings[0].maxFramerate=x.framerate,await re.setParameters(N))}}if(x.transforms){if(re&&x.transforms.sender){let N=null;RTCRtpSender.prototype.createEncodedStreams?N=re.createEncodedStreams():(RTCRtpSender.prototype.createAudioEncodedStreams||RTCRtpSender.prototype.createEncodedVideoStreams)&&(A==="audio"?N=re.createEncodedAudioStreams():A==="video"&&(N=re.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.sender).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.sender).pipeTo(N.writable))}if(B&&B.receiver&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}}fe&&x.dontStop===!0&&(fe.dontStop=!0)}else if(x.recv&&(B||(B=y.pc.addTransceiver(A)),B)){if(x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(B.receiver&&x.transforms&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}if(fe){y.myStream.addTrack(fe),fe.onended=function(N){f.log("Local track removed:",N);try{b.onlocaltrack(N.target,!1)}catch(ne){f.error("Error calling onlocaltrack following end",ne)}};try{b.onlocaltrack(fe,!0)}catch(N){f.error("Error calling onlocaltrack for track add",N)}}if(B){let N=B.direction,ne=null,be=fe&&B.sender.track,vt=x.recv!==!1&&B.receiver.track;be&&vt?ne="sendrecv":be&&!vt?ne="sendonly":!be&&vt?ne="recvonly":!be&&!vt&&(ne="inactive"),ne&&ne!==N&&(f.warn("Changing direction of transceiver to "+ne+" (was "+N+")",x),B.setDirection?B.setDirection(ne):B.direction=ne)}}I&&b.consentDialog(!1)}function Ut(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.sender&&I.sender.track&&(w={mid:I.mid},w.type=I.sender.track.kind,w.id=I.sender.track.id,w.label=I.sender.track.label),w&&y.push(w)}return y}function cr(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.receiver&&I.receiver.track&&(w={mid:I.mid},w.type=I.receiver.track.kind,w.id=I.receiver.track.id,w.label=I.receiver.track.label),w&&y.push(w)}return y}function ct(v,C,b,y){y=typeof y=="function"?y:f.noop;let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),y(0);return}let I=b?"remote":"local",w=O.webrtcStuff;if(w.volume[I]||(w.volume[I]={value:0}),w.pc&&w.pc.getStats&&(f.webRTCAdapter.browserDetails.browser==="chrome"||f.webRTCAdapter.browserDetails.browser==="safari")){let W=w.pc;if(C){let F=w.pc.getTransceivers().find(x=>x.mid===C&&x.receiver.track.kind==="audio");if(!F){f.warn("No audio transceiver with mid "+C),y(0);return}if(b&&!F.receiver){f.warn("Remote transceiver track unavailable"),y(0);return}else if(!b&&!F.sender){f.warn("Local transceiver track unavailable"),y(0);return}W=b?F.receiver:F.sender}return W.getStats().then(function(F){F.forEach(function(x){!x||x.kind!=="audio"||b&&!x.remoteSource||!b&&x.type!=="media-source"||y(x.audioLevel?x.audioLevel:0)})}),w.volume[I].value}else{f.warn("Getting the "+I+" volume unsupported by browser"),y(0);return}}function Tt(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff)return f.warn("Invalid handle"),!0;let O=y.webrtcStuff;if(!O.pc)return f.warn("Invalid PeerConnection"),!0;if(!O.myStream)return f.warn("Invalid local MediaStream"),!0;if(b){if(!O.myStream.getVideoTracks()||O.myStream.getVideoTracks().length===0)return f.warn("No video track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="video");return I?!I.sender||!I.sender.track?(f.warn("No video sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No video transceiver with mid "+C),!0)}else return!O.myStream.getVideoTracks()[0].enabled}else{if(!O.myStream.getAudioTracks()||O.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="audio");return I?!I.sender||!I.sender.track?(f.warn("No audio sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No audio transceiver with mid "+C),!0)}else return!O.myStream.getAudioTracks()[0].enabled}}function ft(v,C,b,y){let O=X.get(v);if(!O||!O.webrtcStuff)return f.warn("Invalid handle"),!1;let I=O.webrtcStuff;if(!I.pc)return f.warn("Invalid PeerConnection"),!1;if(!I.myStream)return f.warn("Invalid local MediaStream"),!1;if(b){if(!I.myStream.getVideoTracks()||I.myStream.getVideoTracks().length===0)return f.warn("No video track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No video sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getVideoTracks())w.enabled=!y}else{if(!I.myStream.getAudioTracks()||I.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="audio");if(!w)return f.warn("No audio transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No audio sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getAudioTracks())w.enabled=!y}return!0}function Ne(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)return f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)return"Invalid PeerConnection";if(y.pc.getStats){let O=y.pc,I=C||"default";if(C){let w=y.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),"No video transceiver with mid "+C;if(!w.receiver)return f.warn("No video receiver with mid "+C),"No video receiver with mid "+C;O=w.receiver}return y.bitrate[I]||(y.bitrate[I]={timer:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,value:"0 kbits/sec"}),y.bitrate[I].timer?y.bitrate[I].value:(f.log("Starting bitrate timer"+(C?" for mid "+C:"")+" (via getStats)"),y.bitrate[I].timer=setInterval(function(){O.getStats().then(function(w){w.forEach(function(W){if(!W)return;let F=!1;if(((W.mediaType==="video"||W.id.toLowerCase().indexOf("video")>-1)&&W.type==="inbound-rtp"&&W.id.indexOf("rtcp")<0||W.type=="ssrc"&&W.bytesReceived&&(W.googCodecName==="VP8"||W.googCodecName===""))&&(F=!0),F)if(y.bitrate[I].bsnow=W.bytesReceived,y.bitrate[I].tsnow=W.timestamp,y.bitrate[I].bsbefore===null||y.bitrate[I].tsbefore===null)y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow;else{let x=y.bitrate[I].tsnow-y.bitrate[I].tsbefore;f.webRTCAdapter.browserDetails.browser==="safari"&&(x=x/1e3);let A=Math.round((y.bitrate[I].bsnow-y.bitrate[I].bsbefore)*8/x);f.webRTCAdapter.browserDetails.browser==="safari"&&(A=parseInt(A/1e3)),y.bitrate[I].value=A+" kbits/sec",y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow}})})},1e3),"0 kbits/sec")}else return f.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser"}function Ft(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle");return}let O=y.webrtcStuff;if(!O.pc){f.warn("Invalid PeerConnection");return}let I=O.pc.getTransceivers().find(W=>W.mid===C);if(!I){f.warn("No transceiver with mid",C);return}if(!I.sender){f.warn("No sender for transceiver with mid",C);return}let w=I.sender.getParameters();!w||!w.encodings||w.encodings.length===0?f.warn("No parameters encodings"):w.encodings.length>1?f.warn("Ignoring bitrate for simulcast track, use sendEncodings for that"):isNaN(b)||b<0?f.warn("Invalid bitrate (must be a positive integer)"):(w.encodings[0].maxBitrate=b,I.sender.setParameters(w))}function fr(v){f.error("WebRTC error:",v)}function qe(v,C){f.log("Cleaning WebRTC stuff");let b=X.get(v);if(!b)return;let y=b.webrtcStuff;if(y){if(C===!0){let O={janus:"hangup",transaction:f.randomString(12)};b.token&&(O.token=b.token),j&&(O.apisecret=j),f.debug("Sending hangup request (handle="+v+"):"),f.debug(O),s?(O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O))):f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O})}y.volume&&(y.volume.local&&y.volume.local.timer&&clearInterval(y.volume.local.timer),y.volume.remote&&y.volume.remote.timer&&clearInterval(y.volume.remote.timer));for(let O in y.bitrate)y.bitrate[O].timer&&clearInterval(y.bitrate[O].timer);y.bitrate={},!y.streamExternal&&y.myStream&&(f.log("Stopping local stream tracks"),f.stopAllTracks(y.myStream)),y.streamExternal=!1,y.myStream=null;try{y.pc.close()}catch{}y.pc=null,y.candidates=null,y.mySdp=null,y.remoteSdp=null,y.iceDone=!1,y.dataChannel={},y.dtmfSender=null,y.insertableStreams=!1}b.oncleanup()}function lr(v){return f.debug("isTrickleEnabled:",v),v!==!1}}let zu=!0,Vu=!0;function ri(i,s,n){const o=i.match(s);return o&&o.length>=n&&parseInt(o[n],10)}function In(i,s,n){if(!i.RTCPeerConnection)return;const o=i.RTCPeerConnection.prototype,a=o.addEventListener;o.addEventListener=function(p,g){if(p!==s)return a.apply(this,arguments);const T=l=>{const _=n(l);_&&(g.handleEvent?g.handleEvent(_):g(_))};return this._eventMap=this._eventMap||{},this._eventMap[s]||(this._eventMap[s]=new Map),this._eventMap[s].set(g,T),a.apply(this,[p,T])};const u=o.removeEventListener;o.removeEventListener=function(p,g){if(p!==s||!this._eventMap||!this._eventMap[s])return u.apply(this,arguments);if(!this._eventMap[s].has(g))return u.apply(this,arguments);const T=this._eventMap[s].get(g);return this._eventMap[s].delete(g),this._eventMap[s].size===0&&delete this._eventMap[s],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[p,T])},Object.defineProperty(o,"on"+s,{get(){return this["_on"+s]},set(p){this["_on"+s]&&(this.removeEventListener(s,this["_on"+s]),delete this["_on"+s]),p&&this.addEventListener(s,this["_on"+s]=p)},enumerable:!0,configurable:!0})}function Sv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(zu=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function Cv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(Vu=!i,"adapter.js deprecation warnings "+(i?"disabled":"enabled"))}function $u(){if(typeof window=="object"){if(zu)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Vo(i,s){Vu&&console.warn(i+" is deprecated, please use "+s+" instead.")}function bv(i){const s={browser:null,version:null};if(typeof i>"u"||!i.navigator)return s.browser="Not a browser.",s;const{navigator:n}=i;if(n.mozGetUserMedia)s.browser="firefox",s.version=ri(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||i.isSecureContext===!1&&i.webkitRTCPeerConnection&&!i.RTCIceGatherer)s.browser="chrome",s.version=ri(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))s.browser="safari",s.version=ri(n.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=i.RTCRtpTransceiver&&"currentDirection"in i.RTCRtpTransceiver.prototype;else return s.browser="Not a supported browser.",s;return s}function bu(i){return Object.prototype.toString.call(i)==="[object Object]"}function ju(i){return bu(i)?Object.keys(i).reduce(function(s,n){const o=bu(i[n]),a=o?ju(i[n]):i[n],u=o&&!Object.keys(a).length;return a===void 0||u?s:Object.assign(s,{[n]:a})},{}):i}function Fo(i,s,n){!s||n.has(s.id)||(n.set(s.id,s),Object.keys(s).forEach(o=>{o.endsWith("Id")?Fo(i,i.get(s[o]),n):o.endsWith("Ids")&&s[o].forEach(a=>{Fo(i,i.get(a),n)})}))}function Tu(i,s,n){const o=n?"outbound-rtp":"inbound-rtp",a=new Map;if(s===null)return a;const u=[];return i.forEach(p=>{p.type==="track"&&p.trackIdentifier===s.id&&u.push(p)}),u.forEach(p=>{i.forEach(g=>{g.type===o&&g.trackId===p.id&&Fo(i,g,a)})}),a}const Ru=$u;function Ku(i,s){const n=i&&i.navigator;if(!n.mediaDevices)return;const o=function(g){if(typeof g!="object"||g.mandatory||g.optional)return g;const T={};return Object.keys(g).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const _=typeof g[l]=="object"?g[l]:{ideal:g[l]};_.exact!==void 0&&typeof _.exact=="number"&&(_.min=_.max=_.exact);const D=function(H,z){return H?H+z.charAt(0).toUpperCase()+z.slice(1):z==="deviceId"?"sourceId":z};if(_.ideal!==void 0){T.optional=T.optional||[];let H={};typeof _.ideal=="number"?(H[D("min",l)]=_.ideal,T.optional.push(H),H={},H[D("max",l)]=_.ideal,T.optional.push(H)):(H[D("",l)]=_.ideal,T.optional.push(H))}_.exact!==void 0&&typeof _.exact!="number"?(T.mandatory=T.mandatory||{},T.mandatory[D("",l)]=_.exact):["min","max"].forEach(H=>{_[H]!==void 0&&(T.mandatory=T.mandatory||{},T.mandatory[D(H,l)]=_[H])})}),g.advanced&&(T.optional=(T.optional||[]).concat(g.advanced)),T},a=function(g,T){if(s.version>=61)return T(g);if(g=JSON.parse(JSON.stringify(g)),g&&typeof g.audio=="object"){const l=function(_,D,H){D in _&&!(H in _)&&(_[H]=_[D],delete _[D])};g=JSON.parse(JSON.stringify(g)),l(g.audio,"autoGainControl","googAutoGainControl"),l(g.audio,"noiseSuppression","googNoiseSuppression"),g.audio=o(g.audio)}if(g&&typeof g.video=="object"){let l=g.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const _=s.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!_)){delete g.video.facingMode;let D;if(l.exact==="environment"||l.ideal==="environment"?D=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(D=["front"]),D)return n.mediaDevices.enumerateDevices().then(H=>{H=H.filter(j=>j.kind==="videoinput");let z=H.find(j=>D.some(ee=>j.label.toLowerCase().includes(ee)));return!z&&H.length&&D.includes("back")&&(z=H[H.length-1]),z&&(g.video.deviceId=l.exact?{exact:z.deviceId}:{ideal:z.deviceId}),g.video=o(g.video),Ru("chrome: "+JSON.stringify(g)),T(g)})}g.video=o(g.video)}return Ru("chrome: "+JSON.stringify(g)),T(g)},u=function(g){return s.version>=64?g:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[g.name]||g.name,message:g.message,constraint:g.constraint||g.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},p=function(g,T,l){a(g,_=>{n.webkitGetUserMedia(_,T,D=>{l&&l(u(D))})})};if(n.getUserMedia=p.bind(n),n.mediaDevices.getUserMedia){const g=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(T){return a(T,l=>g(l).then(_=>{if(l.audio&&!_.getAudioTracks().length||l.video&&!_.getVideoTracks().length)throw _.getTracks().forEach(D=>{D.stop()}),new DOMException("","NotFoundError");return _},_=>Promise.reject(u(_))))}}}function Tv(i,s){if(!(i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices)&&i.navigator.mediaDevices){if(typeof s!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}i.navigator.mediaDevices.getDisplayMedia=function(o){return s(o).then(a=>{const u=o.video&&o.video.width,p=o.video&&o.video.height,g=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:a,maxFrameRate:g||3}},u&&(o.video.mandatory.maxWidth=u),p&&(o.video.mandatory.maxHeight=p),i.navigator.mediaDevices.getUserMedia(o)})}}}function Yu(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function Zu(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(g=>g.track&&g.track.id===a.track.id):u={track:a.track};const p=new Event("track");p.track=a.track,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)}),o.stream.getTracks().forEach(a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(g=>g.track&&g.track.id===a.id):u={track:a};const p=new Event("track");p.track=a,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)})},this.addEventListener("addstream",this._ontrackpoly)),s.apply(this,arguments)}}else In(i,"track",s=>(s.transceiver||Object.defineProperty(s,"transceiver",{value:{receiver:s.receiver}}),s))}function Xu(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){const s=function(a,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=a.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:a}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const a=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(g,T){let l=a.apply(this,arguments);return l||(l=s(this,g),this._senders.push(l)),l};const u=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(g){u.apply(this,arguments);const T=this._senders.indexOf(g);T!==-1&&this._senders.splice(T,1)}}const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(p=>{this._senders.push(s(this,p))})};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],o.apply(this,[u]),u.getTracks().forEach(p=>{const g=this._senders.find(T=>T.track===p);g&&this._senders.splice(this._senders.indexOf(g),1)})}}else if(typeof i=="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){const s=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Qu(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[o,a,u]=arguments;if(arguments.length>0&&typeof o=="function")return s.apply(this,arguments);if(s.length===0&&(arguments.length===0||typeof o!="function"))return s.apply(this,[]);const p=function(T){const l={};return T.result().forEach(D=>{const H={id:D.id,timestamp:D.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[D.type]||D.type};D.names().forEach(z=>{H[z]=D.stat(z)}),l[H.id]=H}),l},g=function(T){return new Map(Object.keys(T).map(l=>[l,T[l]]))};if(arguments.length>=2){const T=function(l){a(g(p(l)))};return s.apply(this,[T,o])}return new Promise((T,l)=>{s.apply(this,[function(_){T(g(p(_)))},l])}).then(a,u)}}function ec(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver))return;if(!("getStats"in i.RTCRtpSender.prototype)){const n=i.RTCPeerConnection.prototype.getSenders;n&&(i.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(p=>p._pc=this),u});const o=i.RTCPeerConnection.prototype.addTrack;o&&(i.RTCPeerConnection.prototype.addTrack=function(){const u=o.apply(this,arguments);return u._pc=this,u}),i.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(p=>Tu(p,u.track,!0))}}if(!("getStats"in i.RTCRtpReceiver.prototype)){const n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){const a=n.apply(this,[]);return a.forEach(u=>u._pc=this),a}),In(i,"track",o=>(o.receiver._pc=o.srcElement,o)),i.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(u=>Tu(u,a.track,!1))}}if(!("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype))return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){const o=arguments[0];let a,u,p;return this.getSenders().forEach(g=>{g.track===o&&(a?p=!0:a=g)}),this.getReceivers().forEach(g=>(g.track===o&&(u?p=!0:u=g),g.track===o)),p||a&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return s.apply(this,arguments)}}function tc(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(p=>this._shimmedLocalStreams[p][0])};const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(p,g){if(!g)return s.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const T=s.apply(this,arguments);return this._shimmedLocalStreams[g.id]?this._shimmedLocalStreams[g.id].indexOf(T)===-1&&this._shimmedLocalStreams[g.id].push(T):this._shimmedLocalStreams[g.id]=[g,T],T};const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(p){this._shimmedLocalStreams=this._shimmedLocalStreams||{},p.getTracks().forEach(l=>{if(this.getSenders().find(D=>D.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const g=this.getSenders();n.apply(this,arguments);const T=this.getSenders().filter(l=>g.indexOf(l)===-1);this._shimmedLocalStreams[p.id]=[p].concat(T)};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[p.id],o.apply(this,arguments)};const a=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},p&&Object.keys(this._shimmedLocalStreams).forEach(g=>{const T=this._shimmedLocalStreams[g].indexOf(p);T!==-1&&this._shimmedLocalStreams[g].splice(T,1),this._shimmedLocalStreams[g].length===1&&delete this._shimmedLocalStreams[g]}),a.apply(this,arguments)}}function nc(i,s){if(!i.RTCPeerConnection)return;if(i.RTCPeerConnection.prototype.addTrack&&s.version>=65)return tc(i);const n=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){const _=n.apply(this);return this._reverseStreams=this._reverseStreams||{},_.map(D=>this._reverseStreams[D.id])};const o=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(_){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},_.getTracks().forEach(D=>{if(this.getSenders().find(z=>z.track===D))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[_.id]){const D=new i.MediaStream(_.getTracks());this._streams[_.id]=D,this._reverseStreams[D.id]=_,_=D}o.apply(this,[_])};const a=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(_){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[_.id]||_]),delete this._reverseStreams[this._streams[_.id]?this._streams[_.id].id:_.id],delete this._streams[_.id]},i.RTCPeerConnection.prototype.addTrack=function(_,D){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const H=[].slice.call(arguments,1);if(H.length!==1||!H[0].getTracks().find(ee=>ee===_))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(ee=>ee.track===_))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const j=this._streams[D.id];if(j)j.addTrack(_),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const ee=new i.MediaStream([_]);this._streams[D.id]=ee,this._reverseStreams[ee.id]=D,this.addStream(ee)}return this.getSenders().find(ee=>ee.track===_)};function u(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(j.id,"g"),z.id)}),new RTCSessionDescription({type:_.type,sdp:D})}function p(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(z.id,"g"),j.id)}),new RTCSessionDescription({type:_.type,sdp:D})}["createOffer","createAnswer"].forEach(function(l){const _=i.RTCPeerConnection.prototype[l],D={[l](){const H=arguments;return arguments.length&&typeof arguments[0]=="function"?_.apply(this,[j=>{const ee=u(this,j);H[0].apply(null,[ee])},j=>{H[1]&&H[1].apply(null,j)},arguments[2]]):_.apply(this,arguments).then(j=>u(this,j))}};i.RTCPeerConnection.prototype[l]=D[l]});const g=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?g.apply(this,arguments):(arguments[0]=p(this,arguments[0]),g.apply(this,arguments))};const T=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get(){const l=T.get.apply(this);return l.type===""?l:u(this,l)}}),i.RTCPeerConnection.prototype.removeTrack=function(_){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!_._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(_._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let H;Object.keys(this._streams).forEach(z=>{this._streams[z].getTracks().find(ee=>_.track===ee)&&(H=this._streams[z])}),H&&(H.getTracks().length===1?this.removeStream(this._reverseStreams[H.id]):H.removeTrack(_.track),this.dispatchEvent(new Event("negotiationneeded")))}}function No(i,s){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const o=i.RTCPeerConnection.prototype[n],a={[n](){return arguments[0]=new(n==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};i.RTCPeerConnection.prototype[n]=a[n]})}function rc(i,s){In(i,"negotiationneeded",n=>{const o=n.target;if(!((s.version<72||o.getConfiguration&&o.getConfiguration().sdpSemantics==="plan-b")&&o.signalingState!=="stable"))return n})}const xu=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:rc,shimAddTrackRemoveTrack:nc,shimAddTrackRemoveTrackWithNative:tc,shimGetDisplayMedia:Tv,shimGetSendersWithDtmf:Xu,shimGetStats:Qu,shimGetUserMedia:Ku,shimMediaStream:Yu,shimOnTrack:Zu,shimPeerConnection:No,shimSenderReceiverGetStats:ec},Symbol.toStringTag,{value:"Module"}));function ic(i,s){const n=i&&i.navigator,o=i&&i.MediaStreamTrack;if(n.getUserMedia=function(a,u,p){Vo("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(a).then(u,p)},!(s.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const a=function(p,g,T){g in p&&!(T in p)&&(p[T]=p[g],delete p[g])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(p){return typeof p=="object"&&typeof p.audio=="object"&&(p=JSON.parse(JSON.stringify(p)),a(p.audio,"autoGainControl","mozAutoGainControl"),a(p.audio,"noiseSuppression","mozNoiseSuppression")),u(p)},o&&o.prototype.getSettings){const p=o.prototype.getSettings;o.prototype.getSettings=function(){const g=p.apply(this,arguments);return a(g,"mozAutoGainControl","autoGainControl"),a(g,"mozNoiseSuppression","noiseSuppression"),g}}if(o&&o.prototype.applyConstraints){const p=o.prototype.applyConstraints;o.prototype.applyConstraints=function(g){return this.kind==="audio"&&typeof g=="object"&&(g=JSON.parse(JSON.stringify(g)),a(g,"autoGainControl","mozAutoGainControl"),a(g,"noiseSuppression","mozNoiseSuppression")),p.apply(this,[g])}}}}function Rv(i,s){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(o){if(!(o&&o.video)){const a=new DOMException("getDisplayMedia without video constraints is undefined");return a.name="NotFoundError",a.code=8,Promise.reject(a)}return o.video===!0?o.video={mediaSource:s}:o.video.mediaSource=s,i.navigator.mediaDevices.getUserMedia(o)})}function oc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Go(i,s){if(typeof i!="object"||!(i.RTCPeerConnection||i.mozRTCPeerConnection))return;!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(a){const u=i.RTCPeerConnection.prototype[a],p={[a](){return arguments[0]=new(a==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};i.RTCPeerConnection.prototype[a]=p[a]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[u,p,g]=arguments;return o.apply(this,[u||null]).then(T=>{if(s.version<53&&!p)try{T.forEach(l=>{l.type=n[l.type]||l.type})}catch(l){if(l.name!=="TypeError")throw l;T.forEach((_,D)=>{T.set(D,Object.assign({},_,{type:n[_.type]||_.type}))})}return T}).then(p,g)}}function sc(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpSender.prototype)return;const s=i.RTCPeerConnection.prototype.getSenders;s&&(i.RTCPeerConnection.prototype.getSenders=function(){const a=s.apply(this,[]);return a.forEach(u=>u._pc=this),a});const n=i.RTCPeerConnection.prototype.addTrack;n&&(i.RTCPeerConnection.prototype.addTrack=function(){const a=n.apply(this,arguments);return a._pc=this,a}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ac(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpReceiver.prototype)return;const s=i.RTCPeerConnection.prototype.getReceivers;s&&(i.RTCPeerConnection.prototype.getReceivers=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o}),In(i,"track",n=>(n.receiver._pc=n.srcElement,n)),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function uc(i){!i.RTCPeerConnection||"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){Vo("removeStream","removeTrack"),this.getSenders().forEach(o=>{o.track&&n.getTracks().includes(o.track)&&this.removeTrack(o)})})}function cc(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function fc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.addTransceiver;s&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const o=arguments[1],a=o&&"sendEncodings"in o;a&&o.sendEncodings.forEach(p=>{if("rid"in p&&!/^[a-z0-9]{0,16}$/i.test(p.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in p&&!(parseFloat(p.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in p&&!(parseFloat(p.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=s.apply(this,arguments);if(a){const{sender:p}=u,g=p.getParameters();(!("encodings"in g)||g.encodings.length===1&&Object.keys(g.encodings[0]).length===0)&&(g.encodings=o.sendEncodings,p.sendEncodings=o.sendEncodings,this.setParametersPromises.push(p.setParameters(g).then(()=>{delete p.sendEncodings}).catch(()=>{delete p.sendEncodings})))}return u})}function lc(i){if(!(typeof i=="object"&&i.RTCRtpSender))return;const s=i.RTCRtpSender.prototype.getParameters;s&&(i.RTCRtpSender.prototype.getParameters=function(){const o=s.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function dc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}function pc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}const Pu=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:fc,shimCreateAnswer:pc,shimCreateOffer:dc,shimGetDisplayMedia:Rv,shimGetParameters:lc,shimGetUserMedia:ic,shimOnTrack:oc,shimPeerConnection:Go,shimRTCDataChannel:cc,shimReceiverGetStats:ac,shimRemoveStream:uc,shimSenderGetStats:sc},Symbol.toStringTag,{value:"Module"}));function hc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(o){this._localStreams||(this._localStreams=[]),this._localStreams.includes(o)||this._localStreams.push(o),o.getAudioTracks().forEach(a=>s.call(this,a,o)),o.getVideoTracks().forEach(a=>s.call(this,a,o))},i.RTCPeerConnection.prototype.addTrack=function(o,...a){return a&&a.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),s.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const o=this._localStreams.indexOf(n);if(o===-1)return;this._localStreams.splice(o,1);const a=n.getTracks();this.getSenders().forEach(u=>{a.includes(u.track)&&this.removeTrack(u)})})}}function gc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=o=>{o.streams.forEach(a=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(a))return;this._remoteStreams.push(a);const u=new Event("addstream");u.stream=a,this.dispatchEvent(u)})})}});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){const o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(a){a.streams.forEach(u=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(u)>=0)return;o._remoteStreams.push(u);const p=new Event("addstream");p.stream=u,o.dispatchEvent(p)})}),s.apply(o,arguments)}}}function mc(i){if(typeof i!="object"||!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype,n=s.createOffer,o=s.createAnswer,a=s.setLocalDescription,u=s.setRemoteDescription,p=s.addIceCandidate;s.createOffer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=n.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H},s.createAnswer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=o.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H};let g=function(T,l,_){const D=a.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D};s.setLocalDescription=g,g=function(T,l,_){const D=u.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.setRemoteDescription=g,g=function(T,l,_){const D=p.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.addIceCandidate=g}function vc(i){const s=i&&i.navigator;if(s.mediaDevices&&s.mediaDevices.getUserMedia){const n=s.mediaDevices,o=n.getUserMedia.bind(n);s.mediaDevices.getUserMedia=a=>o(yc(a))}!s.getUserMedia&&s.mediaDevices&&s.mediaDevices.getUserMedia&&(s.getUserMedia=(function(o,a,u){s.mediaDevices.getUserMedia(o).then(a,u)}).bind(s))}function yc(i){return i&&i.video!==void 0?Object.assign({},i,{video:ju(i.video)}):i}function _c(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection;i.RTCPeerConnection=function(o,a){if(o&&o.iceServers){const u=[];for(let p=0;pp.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):o.offerToReceiveAudio===!0&&!a&&this.addTransceiver("audio",{direction:"recvonly"}),typeof o.offerToReceiveVideo<"u"&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);const u=this.getTransceivers().find(p=>p.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):o.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return s.apply(this,arguments)}}function bc(i){typeof i!="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}const wu=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:bc,shimCallbacksAPI:mc,shimConstraints:yc,shimCreateOfferLegacy:Cc,shimGetUserMedia:vc,shimLocalStreamsAPI:hc,shimRTCIceServerUrls:_c,shimRemoteStreamsAPI:gc,shimTrackEventTransceiver:Sc},Symbol.toStringTag,{value:"Module"}));var Tc={exports:{}};(function(i){const s={};s.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},s.localCName=s.generateIdentifier(),s.splitLines=function(n){return n.trim().split("\n").map(o=>o.trim())},s.splitSections=function(n){return n.split("\nm=").map((a,u)=>(u>0?"m="+a:a).trim()+"\r\n")},s.getDescription=function(n){const o=s.splitSections(n);return o&&o[0]},s.getMediaSections=function(n){const o=s.splitSections(n);return o.shift(),o},s.matchPrefix=function(n,o){return s.splitLines(n).filter(a=>a.indexOf(o)===0)},s.parseCandidate=function(n){let o;n.indexOf("a=candidate:")===0?o=n.substring(12).split(" "):o=n.substring(10).split(" ");const a={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let u=8;u0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}},s.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+"\r\n"},s.parseFmtp=function(n){const o={};let a;const u=n.substring(n.indexOf(" ")+1).split(";");for(let p=0;p{n.parameters[p]!==void 0?u.push(p+"="+n.parameters[p]):u.push(p)}),o+="a=fmtp:"+a+" "+u.join(";")+"\r\n"}return o},s.parseRtcpFb=function(n){const o=n.substring(n.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}},s.writeRtcpFb=function(n){let o="",a=n.payloadType;return n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{o+="a=rtcp-fb:"+a+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+"\r\n"}),o},s.parseSsrcMedia=function(n){const o=n.indexOf(" "),a={ssrc:parseInt(n.substring(7,o),10)},u=n.indexOf(":",o);return u>-1?(a.attribute=n.substring(o+1,u),a.value=n.substring(u+1)):a.attribute=n.substring(o+1),a},s.parseSsrcGroup=function(n){const o=n.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(a=>parseInt(a,10))}},s.getMid=function(n){const o=s.matchPrefix(n,"a=mid:")[0];if(o)return o.substring(6)},s.parseFingerprint=function(n){const o=n.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}},s.getDtlsParameters=function(n,o){return{role:"auto",fingerprints:s.matchPrefix(n+o,"a=fingerprint:").map(s.parseFingerprint)}},s.writeDtlsParameters=function(n,o){let a="a=setup:"+o+"\r\n";return n.fingerprints.forEach(u=>{a+="a=fingerprint:"+u.algorithm+" "+u.value+"\r\n"}),a},s.parseCryptoLine=function(n){const o=n.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}},s.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?s.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+"\r\n"},s.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const o=n.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}},s.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},s.getCryptoParameters=function(n,o){return s.matchPrefix(n+o,"a=crypto:").map(s.parseCryptoLine)},s.getIceParameters=function(n,o){const a=s.matchPrefix(n+o,"a=ice-ufrag:")[0],u=s.matchPrefix(n+o,"a=ice-pwd:")[0];return a&&u?{usernameFragment:a.substring(12),password:u.substring(10)}:null},s.writeIceParameters=function(n){let o="a=ice-ufrag:"+n.usernameFragment+"\r\na=ice-pwd:"+n.password+"\r\n";return n.iceLite&&(o+="a=ice-lite\r\n"),o},s.parseRtpParameters=function(n){const o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=s.splitLines(n)[0].split(" ");o.profile=u[2];for(let g=3;g{o.headerExtensions.push(s.parseExtmap(g))});const p=s.matchPrefix(n,"a=rtcp-fb:* ").map(s.parseRtcpFb);return o.codecs.forEach(g=>{p.forEach(T=>{g.rtcpFeedback.find(_=>_.type===T.type&&_.parameter===T.parameter)||g.rtcpFeedback.push(T)})}),o},s.writeRtpDescription=function(n,o){let a="";a+="m="+n+" ",a+=o.codecs.length>0?"9":"0",a+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",a+=o.codecs.map(p=>p.preferredPayloadType!==void 0?p.preferredPayloadType:p.payloadType).join(" ")+"\r\n",a+="c=IN IP4 0.0.0.0\r\n",a+="a=rtcp:9 IN IP4 0.0.0.0\r\n",o.codecs.forEach(p=>{a+=s.writeRtpMap(p),a+=s.writeFmtp(p),a+=s.writeRtcpFb(p)});let u=0;return o.codecs.forEach(p=>{p.maxptime>u&&(u=p.maxptime)}),u>0&&(a+="a=maxptime:"+u+"\r\n"),o.headerExtensions&&o.headerExtensions.forEach(p=>{a+=s.writeExtmap(p)}),a},s.parseRtpEncodingParameters=function(n){const o=[],a=s.parseRtpParameters(n),u=a.fecMechanisms.indexOf("RED")!==-1,p=a.fecMechanisms.indexOf("ULPFEC")!==-1,g=s.matchPrefix(n,"a=ssrc:").map(H=>s.parseSsrcMedia(H)).filter(H=>H.attribute==="cname"),T=g.length>0&&g[0].ssrc;let l;const _=s.matchPrefix(n,"a=ssrc-group:FID").map(H=>H.substring(17).split(" ").map(j=>parseInt(j,10)));_.length>0&&_[0].length>1&&_[0][0]===T&&(l=_[0][1]),a.codecs.forEach(H=>{if(H.name.toUpperCase()==="RTX"&&H.parameters.apt){let z={ssrc:T,codecPayloadType:parseInt(H.parameters.apt,10)};T&&l&&(z.rtx={ssrc:l}),o.push(z),u&&(z=JSON.parse(JSON.stringify(z)),z.fec={ssrc:T,mechanism:p?"red+ulpfec":"red"},o.push(z))}}),o.length===0&&T&&o.push({ssrc:T});let D=s.matchPrefix(n,"b=");return D.length&&(D[0].indexOf("b=TIAS:")===0?D=parseInt(D[0].substring(7),10):D[0].indexOf("b=AS:")===0?D=parseInt(D[0].substring(5),10)*1e3*.95-50*40*8:D=void 0,o.forEach(H=>{H.maxBitrate=D})),o},s.parseRtcpParameters=function(n){const o={},a=s.matchPrefix(n,"a=ssrc:").map(g=>s.parseSsrcMedia(g)).filter(g=>g.attribute==="cname")[0];a&&(o.cname=a.value,o.ssrc=a.ssrc);const u=s.matchPrefix(n,"a=rtcp-rsize");o.reducedSize=u.length>0,o.compound=u.length===0;const p=s.matchPrefix(n,"a=rtcp-mux");return o.mux=p.length>0,o},s.writeRtcpParameters=function(n){let o="";return n.reducedSize&&(o+="a=rtcp-rsize\r\n"),n.mux&&(o+="a=rtcp-mux\r\n"),n.ssrc!==void 0&&n.cname&&(o+="a=ssrc:"+n.ssrc+" cname:"+n.cname+"\r\n"),o},s.parseMsid=function(n){let o;const a=s.matchPrefix(n,"a=msid:");if(a.length===1)return o=a[0].substring(7).split(" "),{stream:o[0],track:o[1]};const u=s.matchPrefix(n,"a=ssrc:").map(p=>s.parseSsrcMedia(p)).filter(p=>p.attribute==="msid");if(u.length>0)return o=u[0].value.split(" "),{stream:o[0],track:o[1]}},s.parseSctpDescription=function(n){const o=s.parseMLine(n),a=s.matchPrefix(n,"a=max-message-size:");let u;a.length>0&&(u=parseInt(a[0].substring(19),10)),isNaN(u)&&(u=65536);const p=s.matchPrefix(n,"a=sctp-port:");if(p.length>0)return{port:parseInt(p[0].substring(12),10),protocol:o.fmt,maxMessageSize:u};const g=s.matchPrefix(n,"a=sctpmap:");if(g.length>0){const T=g[0].substring(10).split(" ");return{port:parseInt(T[0],10),protocol:T[1],maxMessageSize:u}}},s.writeSctpDescription=function(n,o){let a=[];return n.protocol!=="DTLS/SCTP"?a=["m="+n.kind+" 9 "+n.protocol+" "+o.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+o.port+"\r\n"]:a=["m="+n.kind+" 9 "+n.protocol+" "+o.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+o.port+" "+o.protocol+" 65535\r\n"],o.maxMessageSize!==void 0&&a.push("a=max-message-size:"+o.maxMessageSize+"\r\n"),a.join("")},s.generateSessionId=function(){return Math.random().toString().substr(2,22)},s.writeSessionBoilerplate=function(n,o,a){let u;const p=o!==void 0?o:2;return n?u=n:u=s.generateSessionId(),"v=0\r\no="+(a||"thisisadapterortc")+" "+u+" "+p+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},s.getDirection=function(n,o){const a=s.splitLines(n);for(let u=0;u(n.candidate&&Object.defineProperty(n,"candidate",{value:new i.RTCIceCandidate(n.candidate),writable:"false"}),n))}function oi(i,s){if(!i.RTCPeerConnection)return;"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(g){if(!g||!g.sdp)return!1;const T=Xn.splitSections(g.sdp);return T.shift(),T.some(l=>{const _=Xn.parseMLine(l);return _&&_.kind==="application"&&_.protocol.indexOf("SCTP")!==-1})},o=function(g){const T=g.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(T===null||T.length<2)return-1;const l=parseInt(T[1],10);return l!==l?-1:l},a=function(g){let T=65536;return s.browser==="firefox"&&(s.version<57?g===-1?T=16384:T=2147483637:s.version<60?T=s.version===57?65535:65536:T=2147483637),T},u=function(g,T){let l=65536;s.browser==="firefox"&&s.version===57&&(l=65535);const _=Xn.matchPrefix(g.sdp,"a=max-message-size:");return _.length>0?l=parseInt(_[0].substr(19),10):s.browser==="firefox"&&T!==-1&&(l=2147483637),l},p=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,s.browser==="chrome"&&s.version>=76){const{sdpSemantics:T}=this.getConfiguration();T==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const T=o(arguments[0]),l=a(T),_=u(arguments[0],T);let D;l===0&&_===0?D=Number.POSITIVE_INFINITY:l===0||_===0?D=Math.max(l,_):D=Math.min(l,_);const H={};Object.defineProperty(H,"maxMessageSize",{get(){return D}}),this._sctp=H}return p.apply(this,arguments)}}function si(i){if(!(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype))return;function s(o,a){const u=o.send;o.send=function(){const g=arguments[0],T=g.length||g.size||g.byteLength;if(o.readyState==="open"&&a.sctp&&T>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return u.apply(o,arguments)}}const n=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){const a=n.apply(this,arguments);return s(a,this),a},In(i,"datachannel",o=>(s(o.channel,o.target),o))}function Wo(i){if(!i.RTCPeerConnection||"connectionState"in i.RTCPeerConnection.prototype)return;const s=i.RTCPeerConnection.prototype;Object.defineProperty(s,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(s,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const o=s[n];s[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=a=>{const u=a.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const p=new Event("connectionstatechange",a);u.dispatchEvent(p)}return a},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),o.apply(this,arguments)}})}function Bo(i,s){if(!i.RTCPeerConnection||s.browser==="chrome"&&s.version>=71||s.browser==="safari"&&s.version>=605)return;const n=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(a){if(a&&a.sdp&&a.sdp.indexOf("\na=extmap-allow-mixed")!==-1){const u=a.sdp.split("\n").filter(p=>p.trim()!=="a=extmap-allow-mixed").join("\n");i.RTCSessionDescription&&a instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:a.type,sdp:u}):a.sdp=u}return n.apply(this,arguments)}}function ai(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(s.browser==="chrome"&&s.version<78||s.browser==="firefox"&&s.version<68||s.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ui(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(i.RTCPeerConnection.prototype.setLocalDescription=function(){let a=arguments[0]||{};if(typeof a!="object"||a.type&&a.sdp)return n.apply(this,arguments);if(a={type:a.type,sdp:a.sdp},!a.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":a.type="offer";break;default:a.type="answer";break}return a.sdp||a.type!=="offer"&&a.type!=="answer"?n.apply(this,[a]):(a.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(p=>n.apply(this,[p]))})}const Pv=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Bo,shimAddIceCandidateNullOrEmpty:ai,shimConnectionState:Wo,shimMaxMessageSize:oi,shimParameterlessSetLocalDescription:ui,shimRTCIceCandidate:ii,shimSendThrowTypeError:si},Symbol.toStringTag,{value:"Module"}));function wv({window:i}={},s={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=$u,o=bv(i),a={browserDetails:o,commonShim:Pv,extractVersion:ri,disableLog:Sv,disableWarnings:Cv,sdp:xv};switch(o.browser){case"chrome":if(!xu||!No||!s.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(o.version===null)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=xu,ai(i,o),ui(i),Ku(i,o),Yu(i),No(i,o),Zu(i),nc(i,o),Xu(i),Qu(i),ec(i),rc(i,o),ii(i),Wo(i),oi(i,o),si(i),Bo(i,o);break;case"firefox":if(!Pu||!Go||!s.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=Pu,ai(i,o),ui(i),ic(i,o),Go(i,o),oc(i),uc(i),sc(i),ac(i),cc(i),fc(i),lc(i),dc(i),pc(i),ii(i),Wo(i),oi(i,o),si(i);break;case"safari":if(!wu||!s.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=wu,ai(i,o),ui(i),_c(i),Cc(i),mc(i),hc(i),gc(i),Sc(i),vc(i),bc(i),ii(i),oi(i,o),si(i),Bo(i,o);break;default:n("Unsupported browser!");break}return a}const Eu=wv({window:typeof window>"u"?void 0:window});function Mt(i){return typeof i=="function"}function xc(i){var s=function(o){Error.call(o),o.stack=new Error().stack},n=i(s);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Do=xc(function(i){return function(n){i(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map(function(o,a){return a+1+") "+o.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}});function Ho(i,s){if(i){var n=i.indexOf(s);0<=n&&i.splice(n,1)}}var hi=function(){function i(s){this.initialTeardown=s,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var s,n,o,a,u;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var g=Uo(p),T=g.next();!T.done;T=g.next()){var l=T.value;l.remove(this)}}catch(ee){s={error:ee}}finally{try{T&&!T.done&&(n=g.return)&&n.call(g)}finally{if(s)throw s.error}}else p.remove(this);var _=this.initialTeardown;if(Mt(_))try{_()}catch(ee){u=ee instanceof Do?ee.errors:[ee]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var H=Uo(D),z=H.next();!z.done;z=H.next()){var j=z.value;try{Ou(j)}catch(ee){u=u!=null?u:[],ee instanceof Do?u=fi(fi([],li(u)),li(ee.errors)):u.push(ee)}}}catch(ee){o={error:ee}}finally{try{z&&!z.done&&(a=H.return)&&a.call(H)}finally{if(o)throw o.error}}}if(u)throw new Do(u)}},i.prototype.add=function(s){var n;if(s&&s!==this)if(this.closed)Ou(s);else{if(s instanceof i){if(s.closed||s._hasParent(this))return;s._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(s)}},i.prototype._hasParent=function(s){var n=this._parentage;return n===s||Array.isArray(n)&&n.includes(s)},i.prototype._addParent=function(s){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(s),n):n?[n,s]:s},i.prototype._removeParent=function(s){var n=this._parentage;n===s?this._parentage=null:Array.isArray(n)&&Ho(n,s)},i.prototype.remove=function(s){var n=this._finalizers;n&&Ho(n,s),s instanceof i&&s._removeParent(this)},i.EMPTY=function(){var s=new i;return s.closed=!0,s}(),i}(),Pc=hi.EMPTY;function wc(i){return i instanceof hi||i&&"closed"in i&&Mt(i.remove)&&Mt(i.add)&&Mt(i.unsubscribe)}function Ou(i){Mt(i)?i():i.unsubscribe()}var Ec={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},qo={setTimeout:function(i,s){for(var n=[],o=2;o0},enumerable:!1,configurable:!0}),s.prototype._trySubscribe=function(n){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,n)},s.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},s.prototype._innerSubscribe=function(n){var o=this,a=this,u=a.hasError,p=a.isStopped,g=a.observers;return u||p?Pc:(this.currentObservers=null,g.push(n),new hi(function(){o.currentObservers=null,Ho(g,n)}))},s.prototype._checkFinalizedStatuses=function(n){var o=this,a=o.hasError,u=o.thrownError,p=o.isStopped;a?n.error(u):p&&n.complete()},s.prototype.asObservable=function(){var n=new Iu;return n.source=this,n},s.create=function(n,o){return new Mu(n,o)},s}(Iu),Mu=function(i){er(s,i);function s(n,o){var a=i.call(this)||this;return a.destination=n,a.source=o,a}return s.prototype.next=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.next)===null||a===void 0||a.call(o,n)},s.prototype.error=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.error)===null||a===void 0||a.call(o,n)},s.prototype.complete=function(){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||o===void 0||o.call(n)},s.prototype._subscribe=function(n){var o,a;return(a=(o=this.source)===null||o===void 0?void 0:o.subscribe(n))!==null&&a!==void 0?a:Pc},s}(cn),Ct=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o._value=n,o}return Object.defineProperty(s.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),s.prototype._subscribe=function(n){var o=i.prototype._subscribe.call(this,n);return!o.closed&&n.next(this._value),o},s.prototype.getValue=function(){var n=this,o=n.hasError,a=n.thrownError,u=n._value;if(o)throw a;return this._throwIfClosed(),u},s.prototype.next=function(n){i.prototype.next.call(this,this._value=n)},s}(cn),di={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */di.exports;(function(i,s){(function(){var n,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",g="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",l=500,_="__lodash_placeholder__",D=1,H=2,z=4,j=1,ee=2,xe=1,Ye=2,_e=4,$=8,X=16,Oe=32,Ze=64,me=128,mt=256,Zt=512,nr=30,dn="...",gi=800,mi=16,rr=1,ir=2,or=3,at=1/0,ut=9007199254740991,sr=17976931348623157e292,Lt=0/0,Xe=4294967295,pn=Xe-1,ar=Xe>>>1,vi=[["ary",me],["bind",xe],["bindKey",Ye],["curry",$],["curryRight",X],["flip",Zt],["partial",Oe],["partialRight",Ze],["rearg",mt]],kt="[object Arguments]",hn="[object Array]",ur="[object AsyncFunction]",bt="[object Boolean]",Ut="[object Date]",cr="[object DOMException]",ct="[object Error]",Tt="[object Function]",ft="[object GeneratorFunction]",Ne="[object Map]",Ft="[object Number]",fr="[object Null]",qe="[object Object]",lr="[object Promise]",v="[object Proxy]",C="[object RegExp]",b="[object Set]",y="[object String]",O="[object Symbol]",I="[object Undefined]",w="[object WeakMap]",W="[object WeakSet]",F="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",B="[object Float64Array]",re="[object Int8Array]",fe="[object Int16Array]",lt="[object Int32Array]",N="[object Uint8Array]",ne="[object Uint8ClampedArray]",be="[object Uint16Array]",vt="[object Uint32Array]",yi=/\b__p \+= '';/g,Ac=/\b(__p \+=) '' \+/g,Ic=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,jo=/[&<>"']/g,Dc=RegExp($o.source),Mc=RegExp(jo.source),Lc=/<%-([\s\S]+?)%>/g,kc=/<%([\s\S]+?)%>/g,Ko=/<%=([\s\S]+?)%>/g,Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fc=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_i=/[\\^$.*+?()[\]{}|]/g,Gc=RegExp(_i.source),Si=/^\s+/,Wc=/\s/,Bc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hc=/\{\n\/\* \[wrapped with (.+)\] \*/,qc=/,? & /,Jc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zc=/[()=,{}\[\]\/\s]/,Vc=/\\(\\)?/g,$c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,jc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,Yc=/^\[object .+?Constructor\]$/,Zc=/^0o[0-7]+$/i,Xc=/^(?:0|[1-9]\d*)$/,Qc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,ef=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",tf="\\u0300-\\u036f",nf="\\ufe20-\\ufe2f",rf="\\u20d0-\\u20ff",Zo=tf+nf+rf,Xo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",sf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",af="\\u2000-\\u206f",uf=" \\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",es="A-Z\\xc0-\\xd6\\xd8-\\xde",ts="\\ufe0e\\ufe0f",ns=of+sf+af+uf,Ci="['’]",cf="["+pr+"]",rs="["+ns+"]",hr="["+Zo+"]",is="\\d+",ff="["+Xo+"]",os="["+Qo+"]",ss="[^"+pr+ns+is+Xo+Qo+es+"]",bi="\\ud83c[\\udffb-\\udfff]",lf="(?:"+hr+"|"+bi+")",as="[^"+pr+"]",Ti="(?:\\ud83c[\\udde6-\\uddff]){2}",Ri="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="["+es+"]",us="\\u200d",cs="(?:"+os+"|"+ss+")",df="(?:"+gn+"|"+ss+")",fs="(?:"+Ci+"(?:d|ll|m|re|s|t|ve))?",ls="(?:"+Ci+"(?:D|LL|M|RE|S|T|VE))?",ds=lf+"?",ps="["+ts+"]?",pf="(?:"+us+"(?:"+[as,Ti,Ri].join("|")+")"+ps+ds+")*",hf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hs=ps+ds+pf,mf="(?:"+[ff,Ti,Ri].join("|")+")"+hs,vf="(?:"+[as+hr+"?",hr,Ti,Ri,cf].join("|")+")",yf=RegExp(Ci,"g"),_f=RegExp(hr,"g"),xi=RegExp(bi+"(?="+bi+")|"+vf+hs,"g"),Sf=RegExp([gn+"?"+os+"+"+fs+"(?="+[rs,gn,"$"].join("|")+")",df+"+"+ls+"(?="+[rs,gn+cs,"$"].join("|")+")",gn+"?"+cs+"+"+fs,gn+"+"+ls,gf,hf,is,mf].join("|"),"g"),Cf=RegExp("["+us+pr+Zo+ts+"]"),bf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["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"],Rf=-1,ve={};ve[A]=ve[B]=ve[re]=ve[fe]=ve[lt]=ve[N]=ve[ne]=ve[be]=ve[vt]=!0,ve[kt]=ve[hn]=ve[F]=ve[bt]=ve[x]=ve[Ut]=ve[ct]=ve[Tt]=ve[Ne]=ve[Ft]=ve[qe]=ve[C]=ve[b]=ve[y]=ve[w]=!1;var ge={};ge[kt]=ge[hn]=ge[F]=ge[x]=ge[bt]=ge[Ut]=ge[A]=ge[B]=ge[re]=ge[fe]=ge[lt]=ge[Ne]=ge[Ft]=ge[qe]=ge[C]=ge[b]=ge[y]=ge[O]=ge[N]=ge[ne]=ge[be]=ge[vt]=!0,ge[ct]=ge[Tt]=ge[w]=!1;var xf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Pf={"&":"&","<":"<",">":">",'"':""","'":"'"},wf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ef={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Of=parseFloat,Af=parseInt,gs=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,If=typeof self=="object"&&self&&self.Object===Object&&self,Ae=gs||If||Function("return this")(),Pi=s&&!s.nodeType&&s,Xt=Pi&&!0&&i&&!i.nodeType&&i,ms=Xt&&Xt.exports===Pi,wi=ms&&gs.process,Qe=function(){try{var P=Xt&&Xt.require&&Xt.require("util").types;return P||wi&&wi.binding&&wi.binding("util")}catch{}}(),vs=Qe&&Qe.isArrayBuffer,ys=Qe&&Qe.isDate,_s=Qe&&Qe.isMap,Ss=Qe&&Qe.isRegExp,Cs=Qe&&Qe.isSet,bs=Qe&&Qe.isTypedArray;function Je(P,L,M){switch(M.length){case 0:return P.call(L);case 1:return P.call(L,M[0]);case 2:return P.call(L,M[0],M[1]);case 3:return P.call(L,M[0],M[1],M[2])}return P.apply(L,M)}function Df(P,L,M,J){for(var Q=-1,le=P==null?0:P.length;++Q-1}function Ei(P,L,M){for(var J=-1,Q=P==null?0:P.length;++J-1;);return M}function As(P,L){for(var M=P.length;M--&&mn(L,P[M],0)>-1;);return M}function Bf(P,L){for(var M=P.length,J=0;M--;)P[M]===L&&++J;return J}var Hf=Di(xf),qf=Di(Pf);function Jf(P){return"\\"+Ef[P]}function zf(P,L){return P==null?n:P[L]}function vn(P){return Cf.test(P)}function Vf(P){return bf.test(P)}function $f(P){for(var L,M=[];!(L=P.next()).done;)M.push(L.value);return M}function Ui(P){var L=-1,M=Array(P.size);return P.forEach(function(J,Q){M[++L]=[Q,J]}),M}function Is(P,L){return function(M){return P(L(M))}}function Wt(P,L){for(var M=-1,J=P.length,Q=0,le=[];++M-1}function Ll(e,t){var r=this.__data__,c=Dr(r,e);return c<0?(++this.size,r.push([e,t])):r[c][1]=t,this}Rt.prototype.clear=Al,Rt.prototype.delete=Il,Rt.prototype.get=Dl,Rt.prototype.has=Ml,Rt.prototype.set=Ll;function xt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function rt(e,t,r,c,d,m){var S,R=t&D,E=t&H,k=t&z;if(r&&(S=d?r(e,c,d,m):r(e)),S!==n)return S;if(!Se(e))return e;var U=te(e);if(U){if(S=Nd(e),!R)return Ge(e,S)}else{var G=Me(e),q=G==Tt||G==ft;if(Vt(e))return pa(e,R);if(G==qe||G==kt||q&&!d){if(S=E||q?{}:Da(e),!R)return E?wd(e,Yl(S,e)):Pd(e,qs(S,e))}else{if(!ge[G])return d?e:{};S=Gd(e,G,R)}}m||(m=new pt);var V=m.get(e);if(V)return V;m.set(e,S),au(e)?e.forEach(function(Z){S.add(rt(Z,t,r,Z,e,m))}):ou(e)&&e.forEach(function(Z,ae){S.set(ae,rt(Z,t,r,ae,e,m))});var Y=k?E?uo:ao:E?Be:Ee,oe=U?n:Y(e);return et(oe||e,function(Z,ae){oe&&(ae=Z,Z=e[ae]),Wn(S,ae,rt(Z,t,r,ae,e,m))}),S}function Zl(e){var t=Ee(e);return function(r){return Js(r,e,t)}}function Js(e,t,r){var c=r.length;if(e==null)return!c;for(e=he(e);c--;){var d=r[c],m=t[d],S=e[d];if(S===n&&!(d in e)||!m(S))return!1}return!0}function zs(e,t,r){if(typeof e!="function")throw new tt(p);return $n(function(){e.apply(n,r)},t)}function Bn(e,t,r,c){var d=-1,m=gr,S=!0,R=e.length,E=[],k=t.length;if(!R)return E;r&&(t=ye(t,ze(r))),c?(m=Ei,S=!1):t.length>=a&&(m=Ln,S=!1,t=new tn(t));e:for(;++dd?0:d+r),c=c===n||c>d?d:ie(c),c<0&&(c+=d),c=r>c?0:cu(c);r0&&r(R)?t>1?Ie(R,t-1,r,c,d):Gt(d,R):c||(d[d.length]=R)}return d}var qi=_a(),js=_a(!0);function yt(e,t){return e&&qi(e,t,Ee)}function Ji(e,t){return e&&js(e,t,Ee)}function Lr(e,t){return Nt(t,function(r){return At(e[r])})}function rn(e,t){t=Jt(t,e);for(var r=0,c=t.length;e!=null&&rt}function ed(e,t){return e!=null&&pe.call(e,t)}function td(e,t){return e!=null&&t in he(e)}function nd(e,t,r){return e>=De(t,r)&&e=120&&U.length>=120)?new tn(S&&U):n}U=e[0];var G=-1,q=R[0];e:for(;++G-1;)R!==e&&xr.call(R,E,1),xr.call(e,E,1);return e}function oa(e,t){for(var r=e?t.length:0,c=r-1;r--;){var d=t[r];if(r==c||d!==m){var m=d;Ot(d)?xr.call(e,d,1):eo(e,d)}}return e}function Zi(e,t){return e+Er(Gs()*(t-e+1))}function gd(e,t,r,c){for(var d=-1,m=we(wr((t-e)/(r||1)),0),S=M(m);m--;)S[c?m:++d]=e,e+=r;return S}function Xi(e,t){var r="";if(!e||t<1||t>ut)return r;do t%2&&(r+=e),t=Er(t/2),t&&(e+=e);while(t);return r}function se(e,t){return mo(ka(e,t,He),e+"")}function md(e){return Hs(En(e))}function vd(e,t){var r=En(e);return zr(r,nn(t,0,r.length))}function Jn(e,t,r,c){if(!Se(e))return e;t=Jt(t,e);for(var d=-1,m=t.length,S=m-1,R=e;R!=null&&++dd?0:d+t),r=r>d?d:r,r<0&&(r+=d),d=t>r?0:r-t>>>0,t>>>=0;for(var m=M(d);++c>>1,S=e[m];S!==null&&!$e(S)&&(r?S<=t:S=a){var k=t?null:Id(e);if(k)return vr(k);S=!1,d=Ln,E=new tn}else E=t?[]:R;e:for(;++c=c?e:it(e,t,r)}var da=ul||function(e){return Ae.clearTimeout(e)};function pa(e,t){if(t)return e.slice();var r=e.length,c=Ls?Ls(r):new e.constructor(r);return e.copy(c),c}function io(e){var t=new e.constructor(e.byteLength);return new Tr(t).set(new Tr(e)),t}function bd(e,t){var r=t?io(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Td(e){var t=new e.constructor(e.source,Yo.exec(e));return t.lastIndex=e.lastIndex,t}function Rd(e){return Gn?he(Gn.call(e)):{}}function ha(e,t){var r=t?io(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ga(e,t){if(e!==t){var r=e!==n,c=e===null,d=e===e,m=$e(e),S=t!==n,R=t===null,E=t===t,k=$e(t);if(!R&&!k&&!m&&e>t||m&&S&&E&&!R&&!k||c&&S&&E||!r&&E||!d)return 1;if(!c&&!m&&!k&&e=R)return E;var k=r[c];return E*(k=="desc"?-1:1)}}return e.index-t.index}function ma(e,t,r,c){for(var d=-1,m=e.length,S=r.length,R=-1,E=t.length,k=we(m-S,0),U=M(E+k),G=!c;++R1?r[d-1]:n,S=d>2?r[2]:n;for(m=e.length>3&&typeof m=="function"?(d--,m):n,S&&ke(r[0],r[1],S)&&(m=d<3?n:m,d=1),t=he(t);++c-1?d[m?t[S]:S]:n}}function ba(e){return Et(function(t){var r=t.length,c=r,d=nt.prototype.thru;for(e&&t.reverse();c--;){var m=t[c];if(typeof m!="function")throw new tt(p);if(d&&!S&&qr(m)=="wrapper")var S=new nt([],!0)}for(c=S?c:r;++c1&&ce.reverse(),U&&ER))return!1;var k=m.get(e),U=m.get(t);if(k&&U)return k==t&&U==e;var G=-1,q=!0,V=r&ee?new tn:n;for(m.set(e,t),m.set(t,e);++G1?"& ":"")+t[c],t=t.join(r>2?", ":" "),e.replace(Bc,"{\n/* [wrapped with "+t+"] */\n")}function Bd(e){return te(e)||an(e)||!!(Fs&&e&&e[Fs])}function Ot(e,t){var r=typeof e;return t=t==null?ut:t,!!t&&(r=="number"||r!="symbol"&&Xc.test(e))&&e>-1&&e%1==0&&e0){if(++t>=gi)return arguments[0]}else t=0;return e.apply(n,arguments)}}function zr(e,t){var r=-1,c=e.length,d=c-1;for(t=t===n?c:t;++r1?e[t-1]:n;return r=typeof r=="function"?(e.pop(),r):n,$a(e,r)});function ja(e){var t=h(e);return t.__chain__=!0,t}function Xp(e,t){return t(e),e}function Vr(e,t){return t(e)}var Qp=Et(function(e){var t=e.length,r=t?e[0]:0,c=this.__wrapped__,d=function(m){return Hi(m,e)};return t>1||this.__actions__.length||!(c instanceof ue)||!Ot(r)?this.thru(d):(c=c.slice(r,+r+(t?1:0)),c.__actions__.push({func:Vr,args:[d],thisArg:n}),new nt(c,this.__chain__).thru(function(m){return t&&!m.length&&m.push(n),m}))});function eh(){return ja(this)}function th(){return new nt(this.value(),this.__chain__)}function nh(){this.__values__===n&&(this.__values__=uu(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function rh(){return this}function ih(e){for(var t,r=this;r instanceof Ir;){var c=Ba(r);c.__index__=0,c.__values__=n,t?d.__wrapped__=c:t=c;var d=c;r=r.__wrapped__}return d.__wrapped__=e,t}function oh(){var e=this.__wrapped__;if(e instanceof ue){var t=e;return this.__actions__.length&&(t=new ue(this)),t=t.reverse(),t.__actions__.push({func:Vr,args:[vo],thisArg:n}),new nt(t,this.__chain__)}return this.thru(vo)}function sh(){return fa(this.__wrapped__,this.__actions__)}var ah=Nr(function(e,t,r){pe.call(e,r)?++e[r]:Pt(e,r,1)});function uh(e,t,r){var c=te(e)?Ts:Xl;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}function ch(e,t){var r=te(e)?Nt:$s;return r(e,K(t,3))}var fh=Ca(Ha),lh=Ca(qa);function dh(e,t){return Ie($r(e,t),1)}function ph(e,t){return Ie($r(e,t),at)}function hh(e,t,r){return r=r===n?1:ie(r),Ie($r(e,t),r)}function Ka(e,t){var r=te(e)?et:Ht;return r(e,K(t,3))}function Ya(e,t){var r=te(e)?Mf:Vs;return r(e,K(t,3))}var gh=Nr(function(e,t,r){pe.call(e,r)?e[r].push(t):Pt(e,r,[t])});function mh(e,t,r,c){e=We(e)?e:En(e),r=r&&!c?ie(r):0;var d=e.length;return r<0&&(r=we(d+r,0)),Xr(e)?r<=d&&e.indexOf(t,r)>-1:!!d&&mn(e,t,r)>-1}var vh=se(function(e,t,r){var c=-1,d=typeof t=="function",m=We(e)?M(e.length):[];return Ht(e,function(S){m[++c]=d?Je(t,S,r):Hn(S,t,r)}),m}),yh=Nr(function(e,t,r){Pt(e,r,t)});function $r(e,t){var r=te(e)?ye:Qs;return r(e,K(t,3))}function _h(e,t,r,c){return e==null?[]:(te(t)||(t=t==null?[]:[t]),r=c?n:r,te(r)||(r=r==null?[]:[r]),ra(e,t,r))}var Sh=Nr(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});function Ch(e,t,r){var c=te(e)?Oi:ws,d=arguments.length<3;return c(e,K(t,4),r,d,Ht)}function bh(e,t,r){var c=te(e)?Lf:ws,d=arguments.length<3;return c(e,K(t,4),r,d,Vs)}function Th(e,t){var r=te(e)?Nt:$s;return r(e,Yr(K(t,3)))}function Rh(e){var t=te(e)?Hs:md;return t(e)}function xh(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=ie(t);var c=te(e)?$l:vd;return c(e,t)}function Ph(e){var t=te(e)?jl:_d;return t(e)}function wh(e){if(e==null)return 0;if(We(e))return Xr(e)?yn(e):e.length;var t=Me(e);return t==Ne||t==b?e.size:ji(e).length}function Eh(e,t,r){var c=te(e)?Ai:Sd;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}var Oh=se(function(e,t){if(e==null)return[];var r=t.length;return r>1&&ke(e,t[0],t[1])?t=[]:r>2&&ke(t[0],t[1],t[2])&&(t=[t[0]]),ra(e,Ie(t,1),[])}),jr=cl||function(){return Ae.Date.now()};function Ah(e,t){if(typeof t!="function")throw new tt(p);return e=ie(e),function(){if(--e<1)return t.apply(this,arguments)}}function Za(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,wt(e,me,n,n,n,n,t)}function Xa(e,t){var r;if(typeof t!="function")throw new tt(p);return e=ie(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var _o=se(function(e,t,r){var c=xe;if(r.length){var d=Wt(r,Pn(_o));c|=Oe}return wt(e,c,t,r,d)}),Qa=se(function(e,t,r){var c=xe|Ye;if(r.length){var d=Wt(r,Pn(Qa));c|=Oe}return wt(t,c,e,r,d)});function eu(e,t,r){t=r?n:t;var c=wt(e,$,n,n,n,n,n,t);return c.placeholder=eu.placeholder,c}function tu(e,t,r){t=r?n:t;var c=wt(e,X,n,n,n,n,n,t);return c.placeholder=tu.placeholder,c}function nu(e,t,r){var c,d,m,S,R,E,k=0,U=!1,G=!1,q=!0;if(typeof e!="function")throw new tt(p);t=st(t)||0,Se(r)&&(U=!!r.leading,G="maxWait"in r,m=G?we(st(r.maxWait)||0,t):m,q="trailing"in r?!!r.trailing:q);function V(Re){var gt=c,Dt=d;return c=d=n,k=Re,S=e.apply(Dt,gt),S}function Y(Re){return k=Re,R=$n(ae,t),U?V(Re):S}function oe(Re){var gt=Re-E,Dt=Re-k,Cu=t-gt;return G?De(Cu,m-Dt):Cu}function Z(Re){var gt=Re-E,Dt=Re-k;return E===n||gt>=t||gt<0||G&&Dt>=m}function ae(){var Re=jr();if(Z(Re))return ce(Re);R=$n(ae,oe(Re))}function ce(Re){return R=n,q&&c?V(Re):(c=d=n,S)}function je(){R!==n&&da(R),k=0,c=E=d=R=n}function Ue(){return R===n?S:ce(jr())}function Ke(){var Re=jr(),gt=Z(Re);if(c=arguments,d=this,E=Re,gt){if(R===n)return Y(E);if(G)return da(R),R=$n(ae,t),V(E)}return R===n&&(R=$n(ae,t)),S}return Ke.cancel=je,Ke.flush=Ue,Ke}var Ih=se(function(e,t){return zs(e,1,t)}),Dh=se(function(e,t,r){return zs(e,st(t)||0,r)});function Mh(e){return wt(e,Zt)}function Kr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new tt(p);var r=function(){var c=arguments,d=t?t.apply(this,c):c[0],m=r.cache;if(m.has(d))return m.get(d);var S=e.apply(this,c);return r.cache=m.set(d,S)||m,S};return r.cache=new(Kr.Cache||xt),r}Kr.Cache=xt;function Yr(e){if(typeof e!="function")throw new tt(p);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Lh(e){return Xa(2,e)}var kh=Cd(function(e,t){t=t.length==1&&te(t[0])?ye(t[0],ze(K())):ye(Ie(t,1),ze(K()));var r=t.length;return se(function(c){for(var d=-1,m=De(c.length,r);++d=t}),an=Ys(function(){return arguments}())?Ys:function(e){return Ce(e)&&pe.call(e,"callee")&&!Us.call(e,"callee")},te=M.isArray,Yh=vs?ze(vs):id;function We(e){return e!=null&&Zr(e.length)&&!At(e)}function Te(e){return Ce(e)&&We(e)}function Zh(e){return e===!0||e===!1||Ce(e)&&Le(e)==bt}var Vt=ll||Io,Xh=ys?ze(ys):od;function Qh(e){return Ce(e)&&e.nodeType===1&&!jn(e)}function eg(e){if(e==null)return!0;if(We(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||wn(e)||an(e)))return!e.length;var t=Me(e);if(t==Ne||t==b)return!e.size;if(Vn(e))return!ji(e).length;for(var r in e)if(pe.call(e,r))return!1;return!0}function tg(e,t){return qn(e,t)}function ng(e,t,r){r=typeof r=="function"?r:n;var c=r?r(e,t):n;return c===n?qn(e,t,n,r):!!c}function Co(e){if(!Ce(e))return!1;var t=Le(e);return t==ct||t==cr||typeof e.message=="string"&&typeof e.name=="string"&&!jn(e)}function rg(e){return typeof e=="number"&&Ns(e)}function At(e){if(!Se(e))return!1;var t=Le(e);return t==Tt||t==ft||t==ur||t==v}function iu(e){return typeof e=="number"&&e==ie(e)}function Zr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ut}function Se(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ce(e){return e!=null&&typeof e=="object"}var ou=_s?ze(_s):ad;function ig(e,t){return e===t||$i(e,t,fo(t))}function og(e,t,r){return r=typeof r=="function"?r:n,$i(e,t,fo(t),r)}function sg(e){return su(e)&&e!=+e}function ag(e){if(Jd(e))throw new Q(u);return Zs(e)}function ug(e){return e===null}function cg(e){return e==null}function su(e){return typeof e=="number"||Ce(e)&&Le(e)==Ft}function jn(e){if(!Ce(e)||Le(e)!=qe)return!1;var t=Rr(e);if(t===null)return!0;var r=pe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==ol}var bo=Ss?ze(Ss):ud;function fg(e){return iu(e)&&e>=-ut&&e<=ut}var au=Cs?ze(Cs):cd;function Xr(e){return typeof e=="string"||!te(e)&&Ce(e)&&Le(e)==y}function $e(e){return typeof e=="symbol"||Ce(e)&&Le(e)==O}var wn=bs?ze(bs):fd;function lg(e){return e===n}function dg(e){return Ce(e)&&Me(e)==w}function pg(e){return Ce(e)&&Le(e)==W}var hg=Hr(Ki),gg=Hr(function(e,t){return e<=t});function uu(e){if(!e)return[];if(We(e))return Xr(e)?dt(e):Ge(e);if(kn&&e[kn])return $f(e[kn]());var t=Me(e),r=t==Ne?Ui:t==b?vr:En;return r(e)}function It(e){if(!e)return e===0?e:0;if(e=st(e),e===at||e===-at){var t=e<0?-1:1;return t*sr}return e===e?e:0}function ie(e){var t=It(e),r=t%1;return t===t?r?t-r:t:0}function cu(e){return e?nn(ie(e),0,Xe):0}function st(e){if(typeof e=="number")return e;if($e(e))return Lt;if(Se(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Se(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Es(e);var r=Kc.test(e);return r||Zc.test(e)?Af(e.slice(2),r?2:8):jc.test(e)?Lt:+e}function fu(e){return _t(e,Be(e))}function mg(e){return e?nn(ie(e),-ut,ut):e===0?e:0}function de(e){return e==null?"":Ve(e)}var vg=Rn(function(e,t){if(Vn(t)||We(t)){_t(t,Ee(t),e);return}for(var r in t)pe.call(t,r)&&Wn(e,r,t[r])}),lu=Rn(function(e,t){_t(t,Be(t),e)}),Qr=Rn(function(e,t,r,c){_t(t,Be(t),e,c)}),yg=Rn(function(e,t,r,c){_t(t,Ee(t),e,c)}),_g=Et(Hi);function Sg(e,t){var r=Tn(e);return t==null?r:qs(r,t)}var Cg=se(function(e,t){e=he(e);var r=-1,c=t.length,d=c>2?t[2]:n;for(d&&ke(t[0],t[1],d)&&(c=1);++r1),m}),_t(e,uo(e),r),c&&(r=rt(r,D|H|z,Dd));for(var d=t.length;d--;)eo(r,t[d]);return r});function Gg(e,t){return pu(e,Yr(K(t)))}var Wg=Et(function(e,t){return e==null?{}:pd(e,t)});function pu(e,t){if(e==null)return{};var r=ye(uo(e),function(c){return[c]});return t=K(t),ia(e,r,function(c,d){return t(c,d[0])})}function Bg(e,t,r){t=Jt(t,e);var c=-1,d=t.length;for(d||(d=1,e=n);++ct){var c=e;e=t,t=c}if(r||e%1||t%1){var d=Gs();return De(e+d*(t-e+Of("1e-"+((d+"").length-1))),t)}return Zi(e,t)}var Xg=xn(function(e,t,r){return t=t.toLowerCase(),e+(r?mu(t):t)});function mu(e){return xo(de(e).toLowerCase())}function vu(e){return e=de(e),e&&e.replace(Qc,Hf).replace(_f,"")}function Qg(e,t,r){e=de(e),t=Ve(t);var c=e.length;r=r===n?c:nn(ie(r),0,c);var d=r;return r-=t.length,r>=0&&e.slice(r,d)==t}function em(e){return e=de(e),e&&Mc.test(e)?e.replace(jo,qf):e}function tm(e){return e=de(e),e&&Gc.test(e)?e.replace(_i,"\\$&"):e}var nm=xn(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),rm=xn(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),im=Sa("toLowerCase");function om(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;if(!t||c>=t)return e;var d=(t-c)/2;return Br(Er(d),r)+e+Br(wr(d),r)}function sm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c>>0,r?(e=de(e),e&&(typeof t=="string"||t!=null&&!bo(t))&&(t=Ve(t),!t&&vn(e))?zt(dt(e),0,r):e.split(t,r)):[]}var pm=xn(function(e,t,r){return e+(r?" ":"")+xo(t)});function hm(e,t,r){return e=de(e),r=r==null?0:nn(ie(r),0,e.length),t=Ve(t),e.slice(r,r+t.length)==t}function gm(e,t,r){var c=h.templateSettings;r&&ke(e,t,r)&&(t=n),e=de(e),t=Qr({},t,c,wa);var d=Qr({},t.imports,c.imports,wa),m=Ee(d),S=ki(d,m),R,E,k=0,U=t.interpolate||dr,G="__p += '",q=Fi((t.escape||dr).source+"|"+U.source+"|"+(U===Ko?$c:dr).source+"|"+(t.evaluate||dr).source+"|$","g"),V="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rf+"]")+"\n";e.replace(q,function(Z,ae,ce,je,Ue,Ke){return ce||(ce=je),G+=e.slice(k,Ke).replace(ef,Jf),ae&&(R=!0,G+="' +\n__e("+ae+") +\n'"),Ue&&(E=!0,G+="';\n"+Ue+";\n__p += '"),ce&&(G+="' +\n((__t = ("+ce+")) == null ? '' : __t) +\n'"),k=Ke+Z.length,Z}),G+="';\n";var Y=pe.call(t,"variable")&&t.variable;if(!Y)G="with (obj) {\n"+G+"\n}\n";else if(zc.test(Y))throw new Q(g);G=(E?G.replace(yi,""):G).replace(Ac,"$1").replace(Ic,"$1;"),G="function("+(Y||"obj")+") {\n"+(Y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(R?", __e = _.escape":"")+(E?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+G+"return __p\n}";var oe=_u(function(){return le(m,V+"return "+G).apply(n,S)});if(oe.source=G,Co(oe))throw oe;return oe}function mm(e){return de(e).toLowerCase()}function vm(e){return de(e).toUpperCase()}function ym(e,t,r){if(e=de(e),e&&(r||t===n))return Es(e);if(!e||!(t=Ve(t)))return e;var c=dt(e),d=dt(t),m=Os(c,d),S=As(c,d)+1;return zt(c,m,S).join("")}function _m(e,t,r){if(e=de(e),e&&(r||t===n))return e.slice(0,Ds(e)+1);if(!e||!(t=Ve(t)))return e;var c=dt(e),d=As(c,dt(t))+1;return zt(c,0,d).join("")}function Sm(e,t,r){if(e=de(e),e&&(r||t===n))return e.replace(Si,"");if(!e||!(t=Ve(t)))return e;var c=dt(e),d=Os(c,dt(t));return zt(c,d).join("")}function Cm(e,t){var r=nr,c=dn;if(Se(t)){var d="separator"in t?t.separator:d;r="length"in t?ie(t.length):r,c="omission"in t?Ve(t.omission):c}e=de(e);var m=e.length;if(vn(e)){var S=dt(e);m=S.length}if(r>=m)return e;var R=r-yn(c);if(R<1)return c;var E=S?zt(S,0,R).join(""):e.slice(0,R);if(d===n)return E+c;if(S&&(R+=E.length-R),bo(d)){if(e.slice(R).search(d)){var k,U=E;for(d.global||(d=Fi(d.source,de(Yo.exec(d))+"g")),d.lastIndex=0;k=d.exec(U);)var G=k.index;E=E.slice(0,G===n?R:G)}}else if(e.indexOf(Ve(d),R)!=R){var q=E.lastIndexOf(d);q>-1&&(E=E.slice(0,q))}return E+c}function bm(e){return e=de(e),e&&Dc.test(e)?e.replace($o,Zf):e}var Tm=xn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),xo=Sa("toUpperCase");function yu(e,t,r){return e=de(e),t=r?n:t,t===n?Vf(e)?el(e):Ff(e):e.match(t)||[]}var _u=se(function(e,t){try{return Je(e,n,t)}catch(r){return Co(r)?r:new Q(r)}}),Rm=Et(function(e,t){return et(t,function(r){r=St(r),Pt(e,r,_o(e[r],e))}),e});function xm(e){var t=e==null?0:e.length,r=K();return e=t?ye(e,function(c){if(typeof c[1]!="function")throw new tt(p);return[r(c[0]),c[1]]}):[],se(function(c){for(var d=-1;++dut)return[];var r=Xe,c=De(e,Xe);t=K(t),e-=Xe;for(var d=Li(c,t);++r0||t<0)?new ue(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=ie(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},ue.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ue.prototype.toArray=function(){return this.take(Xe)},yt(ue.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),c=/^(?:head|last)$/.test(t),d=h[c?"take"+(t=="last"?"Right":""):t],m=c||/^find/.test(t);d&&(h.prototype[t]=function(){var S=this.__wrapped__,R=c?[1]:arguments,E=S instanceof ue,k=R[0],U=E||te(S),G=function(ae){var ce=d.apply(h,Gt([ae],R));return c&&q?ce[0]:ce};U&&r&&typeof k=="function"&&k.length!=1&&(E=U=!1);var q=this.__chain__,V=!!this.__actions__.length,Y=m&&!q,oe=E&&!V;if(!m&&U){S=oe?S:new ue(this);var Z=e.apply(S,R);return Z.__actions__.push({func:Vr,args:[G],thisArg:n}),new nt(Z,q)}return Y&&oe?e.apply(this,R):(Z=this.thru(G),Y?c?Z.value()[0]:Z.value():Z)})}),et(["pop","push","shift","sort","splice","unshift"],function(e){var t=yr[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var d=arguments;if(c&&!this.__chain__){var m=this.value();return t.apply(te(m)?m:[],d)}return this[r](function(S){return t.apply(te(S)?S:[],d)})}}),yt(ue.prototype,function(e,t){var r=h[t];if(r){var c=r.name+"";pe.call(bn,c)||(bn[c]=[]),bn[c].push({name:t,func:r})}}),bn[Gr(n,Ye).name]=[{name:"wrapper",func:n}],ue.prototype.clone=bl,ue.prototype.reverse=Tl,ue.prototype.value=Rl,h.prototype.at=Qp,h.prototype.chain=eh,h.prototype.commit=th,h.prototype.next=nh,h.prototype.plant=ih,h.prototype.reverse=oh,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=sh,h.prototype.first=h.prototype.head,kn&&(h.prototype[kn]=rh),h},_n=tl();Xt?((Xt.exports=_n)._=_n,Pi._=_n):Ae._=_n}).call(Kn)})(di,di.exports);var Gv=di.exports;const fn=qu(Gv);var un=globalThis&&globalThis.__assign||function(){return un=Object.assign||function(i){for(var s,n=1,o=arguments.length;n0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]{for(var a=o>1?void 0:o?Kv(s,n):s,u=i.length-1,p;u>=0;u--)(p=i[u])&&(a=(o?p(s,n,a):p(a))||a);return o&&a&&jv(s,n,a),a};let ln=class extends cv(fv,lv){constructor(){super(...arguments),this.janusClient=null,this.session=null,this.handle=null,this.useStun=!1,this.aspectRatio=null,this.status="connecting"}get url(){var o;const s=this.camSettings.stream_url;let n=new URL(s,this.printerUrl===null?this.hostUrl.toString():this.printerUrl);if(n.port="8188",n.protocol=(o=this.printerUrl)!=null&&o.startsWith("https")?"wss":"ws",s.startsWith("ws")||s.startsWith("http")){n=new URL(s);const a=n.pathname.split("/");n.pathname=a.slice(0,a.length-1).join("/")}return n}get streamId(){const s=new URL(this.camSettings.stream_url).pathname.split("/");return s[s.length-1]}get webcamStyle(){var n,o,a;const s={transform:this.generateTransform((n=this.camSettings.flip_horizontal)!=null?n:!1,(o=this.camSettings.flip_vertical)!=null?o:!1,(a=this.camSettings.rotation)!=null?a:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(s.aspectRatio=this.aspectRatio),s}get streamConfig(){let s={server:this.url.toString()};return this.useStun&&(s.iceServers=[{urls:["stun:stun.l.google.com:19302"]}]),s}async startStream(){var n,o;this.janusClient=new zo(this.streamConfig),await this.janusClient.init({debug:!1}),this.session=await this.janusClient.createSession(),this.handle=await this.session.attach(Jv,{}),(n=this.handle)==null||n.onMessage.subscribe(async({message:a,jsep:u})=>{var p,g,T;if((p=a==null?void 0:a.result)!=null&&p.status&&(this.status=a.result.status),u){const l=await((g=this.handle)==null?void 0:g.createAnswer({jsep:u}));(T=this.handle)==null||T.send({message:{request:"start"},jsep:l})}});const s=new MediaStream;zo.attachMediaStream(this.stream,s),(o=this.handle)==null||o.onRemoteTrack.subscribe(({on:a,track:u})=>{a?s.addTrack(u):s.removeTrack(u)}),this.handle.onIceState.subscribe(a=>{console.log("ICE state changed to ".concat(a))}),this.handle.onError.subscribe(a=>{this.status="errored: ".concat(JSON.stringify(a))}),await this.handle.send({message:{request:"watch",id:parseInt(this.streamId)}})}mounted(){this.startStream()}updateAspectRatio(){this.aspectRatio=this.stream.videoWidth/this.stream.videoHeight}beforeDestroy(){var s;(s=this.session)==null||s.destroy({})}async changedUrl(){var s;await((s=this.session)==null?void 0:s.destroy({})),await this.startStream()}};tr([Hu({required:!0})],ln.prototype,"camSettings",2);tr([Hu({default:null})],ln.prototype,"printerUrl",2);tr([pv()],ln.prototype,"stream",2);tr([dv("url")],ln.prototype,"changedUrl",1);ln=tr([hv],ln);var Yv=function(){var i=this,s=i.$createElement,n=i._self._c||s;return n("div",[n("video",{directives:[{name:"show",rawName:"v-show",value:i.status==="started",expression:"status === 'started'"}],ref:"stream",staticClass:"webcamStream",style:i.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{playing:i.updateAspectRatio}}),i.status!=="started"?n(mv,[n(vv,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[i.status==="connecting"?n(yv,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):i._e(),n("span",{staticClass:"mt-3"},[i._v(i._s(i.status))])],1)],1):i._e()],1)},Zv=[];const Bu={};var Xv=gv(ln,Yv,Zv,!1,Qv,"5fed87a3",null,null);function Qv(i){for(let s in Bu)this[s]=Bu[s]}const oy=function(){return Xv.exports}();export{oy as default}; diff --git a/dirs/mainsail/assets/JanusStreamer-3206d816.css b/dirs/mainsail/assets/JanusStreamer-3206d816.css deleted file mode 100644 index cc8fddd..0000000 --- a/dirs/mainsail/assets/JanusStreamer-3206d816.css +++ /dev/null @@ -1 +0,0 @@ -.webcamStream[data-v-5fed87a3]{width:100%}._webcam_webrtc_output[data-v-5fed87a3]{aspect-ratio:1.5}video[data-v-5fed87a3]{width:100%} diff --git a/dirs/mainsail/assets/Mjpegstreamer-60c9a3d3.js b/dirs/mainsail/assets/Mjpegstreamer-60c9a3d3.js deleted file mode 100644 index 8e09a93..0000000 --- a/dirs/mainsail/assets/Mjpegstreamer-60c9a3d3.js +++ /dev/null @@ -1 +0,0 @@ -import{m as y,B as w,G as C,P as d,W as R,j as P,n as x}from"./index-97b4652c.js";import"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var F=Object.defineProperty,V=Object.getOwnPropertyDescriptor,m=(s,t,e,a)=>{for(var i=a>1?void 0:a?V(t,e):t,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(t,e,i):n(i))||i);return a&&i&&F(t,e,i),i};const j="content-length",L="image/jpeg";let h=class extends y(w,C){constructor(){super(...arguments),this.currentFPS=0,this.streamState=!1,this.aspectRatio=null,this.timerFPS=null,this.timerRestart=null,this.stream=null,this.controller=null,this.isVisibleViewport=!1,this.isVisibleDocument=!0}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var e,a,i;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(a=this.camSettings.flip_vertical)!=null?a:!1,(i=this.camSettings.rotation)!=null?i:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}get fpsOutput(){return this.currentFPS<10?"0"+this.currentFPS.toString():this.currentFPS}get showFpsCounter(){var t,e;return this.showFps?!((e=(t=this.camSettings.extra_data)==null?void 0:t.hideFps)!=null&&e):!1}startStream(){if(this.streamState)return;this.streamState=!0;const t=new Uint8Array(2);t[0]=255,t[1]=216;function e(i){let r=-1;return i.split("\n").forEach(n=>{const o=n.split(":");o[0].toLowerCase()===j&&(r=o[1])}),r}this.controller=new AbortController;const{signal:a}=this.controller;fetch(this.url,{signal:a,mode:"cors"}).then(i=>i.body).then(i=>{const r=i==null?void 0:i.getReader();let n="",o=-1,p=null,f=0;const u=this.$refs.image;let g=0;this.timerFPS=setInterval(()=>{this.currentFPS=g,g=0},1e3),this.timerRestart=setInterval(()=>{this.restartStream()},6e4),this.stream=new ReadableStream({start(S){const b=()=>r==null?void 0:r.read().then(({done:_,value:l})=>{if(_){S.close();return}if(S.enqueue(l),l)for(let c=0;cURL.revokeObjectURL(u.src)),g++,o=0,f=0,n="");return b()});return b()}})})}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged),this.startStream()}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged),this.stopStream()}stopStream(){var t,e;this.streamState=!1,URL.revokeObjectURL(this.url),this.timerFPS&&clearTimeout(this.timerFPS),this.timerRestart&&clearTimeout(this.timerRestart),(t=this.controller)==null||t.abort(),(e=this.stream)==null||e.cancel()}async restartStream(){this.stopStream(),this.startStream()}camSettingsChanged(){this.aspectRatio=null,this.restartStream()}documentVisibilityChanged(){const t=document.visibilityState;this.isVisibleDocument=t==="visible",this.isVisibleDocument||this.stopStream(),this.visibilityChanged()}viewportVisibilityChanged(t){this.isVisibleViewport=t,this.visibilityChanged()}visibilityChanged(){if(this.isVisibleViewport&&this.isVisibleDocument){this.startStream();return}this.stopStream()}onload(){this.aspectRatio!==null||!this.$refs.image||(this.aspectRatio=this.$refs.image.naturalWidth/this.$refs.image.naturalHeight)}};m([d({required:!0})],h.prototype,"camSettings",2);m([d({default:null})],h.prototype,"printerUrl",2);m([d({default:!0})],h.prototype,"showFps",2);m([R("camSettings",{immediate:!0,deep:!0})],h.prototype,"camSettingsChanged",1);h=m([P],h);var O=function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("div",{staticClass:"d-flex justify-center",staticStyle:{position:"relative"}},[e("img",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:s.viewportVisibilityChanged,expression:"viewportVisibilityChanged"}],ref:"image",staticClass:"webcamImage",style:s.webcamStyle,on:{load:s.onload}}),s.showFpsCounter?e("span",{staticClass:"webcamFpsOutput"},[s._v(s._s(s.$t("Panels.WebcamPanel.FPS"))+": "+s._s(s.fpsOutput))]):s._e()])},U=[];const v={};var E=x(h,O,U,!1,D,"d03b4202",null,null);function D(s){for(let t in v)this[t]=v[t]}const H=function(){return E.exports}();export{H as default}; diff --git a/dirs/mainsail/assets/Mjpegstreamer-c7e864b6.css b/dirs/mainsail/assets/Mjpegstreamer-c7e864b6.css deleted file mode 100644 index cf950e4..0000000 --- a/dirs/mainsail/assets/Mjpegstreamer-c7e864b6.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-d03b4202]{width:100%;background:lightgray}.webcamFpsOutput[data-v-d03b4202]{display:inline-block;position:absolute;bottom:0;right:0;background:rgba(0,0,0,.8);padding:3px 10px;border-top-left-radius:5px} diff --git a/dirs/mainsail/assets/MjpegstreamerAdaptive-2e7c6467.js b/dirs/mainsail/assets/MjpegstreamerAdaptive-2e7c6467.js deleted file mode 100644 index 6adb0c7..0000000 --- a/dirs/mainsail/assets/MjpegstreamerAdaptive-2e7c6467.js +++ /dev/null @@ -1 +0,0 @@ -import{m as u,B as p,G as d,P as m,j as _,n as g}from"./index-97b4652c.js";import{p as f}from"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,h=(r,t,e,i)=>{for(var s=i>1?void 0:i?w(t,e):t,a=r.length-1,n;a>=0;a--)(n=r[a])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&v(t,e,s),s};let o=class extends u(p,d){constructor(){super(...arguments),this.refresh=Math.ceil(Math.random()*Math.pow(10,12)),this.isVisible=!0,this.isVisibleDocument=!0,this.isVisibleViewport=!1,this.isLoaded=!0,this.timer=void 0,this.request_start_time=performance.now(),this.start_time=performance.now(),this.time=0,this.request_time=0,this.time_smoothing=.6,this.request_time_smoothing=.1,this.currentFPS=0,this.aspectRatio=null}get webcamStyle(){var e,i,s;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(i=this.camSettings.flip_vertical)!=null?i:!1,(s=this.camSettings.rotation)!=null?s:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}get fpsOutput(){return this.currentFPS<10?"0"+this.currentFPS.toString():this.currentFPS}get showFpsCounter(){var t,e;return this.showFps?!((e=(t=this.camSettings.extra_data)==null?void 0:t.hideFps)!=null&&e):!1}get rotate(){var t;return[90,270].includes((t=this.camSettings.rotation)!=null?t:0)}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.snapshot_url,this.printerUrl)}refreshFrame(){this.isVisible&&(this.refresh=new Date().getTime(),this.setFrame())}async setFrame(){let t=new URL(this.url);t.searchParams.append("bypassCache",this.refresh.toString()),this.request_start_time=performance.now(),this.currentFPS=this.time>0?Math.round(1e3/this.time):0;let e=this.$refs.image;if(e){const i=e.getContext("2d"),s=await this.loadImage(t.toString());if(this.aspectRatio=s.naturalWidth/s.naturalHeight,this.rotate&&(this.aspectRatio=1/this.aspectRatio),e.width=e.clientWidth,e.height=e.clientWidth/this.aspectRatio,this.rotate){const a=e.height/s.width,n=e.width/2,c=e.height/2;i.translate(n,c),i.rotate(this.camSettings.rotation*Math.PI/180),await(i==null?void 0:i.drawImage(s,-s.width/2*a,-s.height/2*a,s.width*a,s.height*a)),i.rotate(-(this.camSettings.rotation*Math.PI/180)),i.translate(-n,-c)}else await(i==null?void 0:i.drawImage(s,0,0,s.width,s.height,0,0,e.width,e.height));this.isLoaded=!0}this.$nextTick(()=>{this.onLoad()})}onLoad(){this.isLoaded=!0;const t=this.camSettings.target_fps||10,e=performance.now(),i=e-this.start_time;this.time=this.time*this.time_smoothing+i*(1-this.time_smoothing),this.start_time=e;const s=1e3/t,a=performance.now()-this.request_start_time;this.request_time=this.request_time*this.request_time_smoothing+a*(1-this.request_time_smoothing);const n=Math.max(0,s-this.request_time);this.$nextTick(()=>{this.timer=setTimeout(this.refreshFrame,n)})}loadImage(t){return new Promise(e=>{let i=new Image;i.onload=()=>e(i),i.onerror=()=>setTimeout(this.refreshFrame,1e3),i.src=t})}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged),this.refreshFrame()}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged)}documentVisibilityChanged(){const t=document.visibilityState;this.isVisibleDocument=t==="visible",this.isVisibleDocument||this.stopStream(),this.visibilityChanged()}viewportVisibilityChanged(t){this.isVisibleViewport=t,this.visibilityChanged()}visibilityChanged(){if(this.isVisibleViewport&&this.isVisibleDocument){this.startStream();return}this.stopStream()}startStream(){this.isVisible||(this.isVisible=!0,this.refreshFrame())}stopStream(){this.isVisible=!1,clearTimeout(this.timer),this.timer=void 0}};h([m({required:!0})],o.prototype,"camSettings",2);h([m({default:null})],o.prototype,"printerUrl",2);h([m({default:!0})],o.prototype,"showFps",2);o=h([_],o);var b=function(){var r=this,t=r.$createElement,e=r._self._c||t;return e("div",{staticClass:"d-flex justify-center",staticStyle:{position:"relative"}},[r.isLoaded?r._e():e("div",{staticClass:"text-center py-5"},[e(f,{attrs:{indeterminate:"",color:"primary"}})],1),e("canvas",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:r.viewportVisibilityChanged,expression:"viewportVisibilityChanged"}],ref:"image",class:"webcamImage "+(r.isLoaded?"":"hiddenWebcam"),style:r.webcamStyle,attrs:{width:"600",height:"400"}}),r.isLoaded&&r.showFpsCounter?e("span",{staticClass:"webcamFpsOutput"},[r._v(" "+r._s(r.$t("Panels.WebcamPanel.FPS"))+": "+r._s(r.fpsOutput)+" ")]):r._e()])},y=[];const l={};var S=g(o,b,y,!1,F,"72cc9e9c",null,null);function F(r){for(let t in l)this[t]=l[t]}const q=function(){return S.exports}();export{q as default}; diff --git a/dirs/mainsail/assets/MjpegstreamerAdaptive-33a0e59f.css b/dirs/mainsail/assets/MjpegstreamerAdaptive-33a0e59f.css deleted file mode 100644 index 829b6f3..0000000 --- a/dirs/mainsail/assets/MjpegstreamerAdaptive-33a0e59f.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-72cc9e9c]{width:100%}.webcamFpsOutput[data-v-72cc9e9c]{display:inline-block;position:absolute;bottom:0;right:0;background:rgba(0,0,0,.8);padding:3px 10px;border-top-left-radius:5px} diff --git a/dirs/mainsail/assets/Uv4lMjpeg-486d8a68.css b/dirs/mainsail/assets/Uv4lMjpeg-486d8a68.css deleted file mode 100644 index 0e82716..0000000 --- a/dirs/mainsail/assets/Uv4lMjpeg-486d8a68.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-3177fd01]{width:100%;background:lightgray} diff --git a/dirs/mainsail/assets/Uv4lMjpeg-d2ae09fd.js b/dirs/mainsail/assets/Uv4lMjpeg-d2ae09fd.js deleted file mode 100644 index 012730d..0000000 --- a/dirs/mainsail/assets/Uv4lMjpeg-d2ae09fd.js +++ /dev/null @@ -1 +0,0 @@ -import{m as h,B as p,G as u,P as m,W as v,j as g,n as b}from"./index-97b4652c.js";import"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var f=Object.defineProperty,d=Object.getOwnPropertyDescriptor,n=(e,t,s,a)=>{for(var i=a>1?void 0:a?d(t,s):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=(a?o(t,s,i):o(i))||i);return a&&i&&f(t,s,i),i};let r=class extends h(p,u){constructor(){super(...arguments),this.aspectRatio=null,this.isVisible=!1,this.isVisibleViewport=!1,this.isVisibleDocument=!0}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var s,a,i;const t={transform:this.generateTransform((s=this.camSettings.flip_horizontal)!=null?s:!1,(a=this.camSettings.flip_vertical)!=null?a:!1,(i=this.camSettings.rotation)!=null?i:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged)}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged),this.stopStream()}startStream(){this.isVisible||this.$refs.webcamUv4lMjpegImage&&this.$refs.webcamUv4lMjpegImage.setAttribute("src",this.url)}stopStream(){this.$refs.webcamUv4lMjpegImage&&(this.$refs.webcamUv4lMjpegImage.removeAttribute("src"),URL.revokeObjectURL(this.url))}documentVisibilityChanged(){const t=document.visibilityState;this.isVisibleDocument=t==="visible",this.isVisibleDocument||this.stopStream(),this.visibilityChanged()}viewportVisibilityChanged(t){this.isVisibleViewport=t,this.visibilityChanged()}visibilityChanged(){if(this.isVisibleViewport&&this.isVisibleDocument){this.startStream();return}this.stopStream()}onload(){this.aspectRatio===null&&this.$refs.webcamUv4lMjpegImage&&(this.aspectRatio=this.$refs.webcamUv4lMjpegImage.naturalWidth/this.$refs.webcamUv4lMjpegImage.naturalHeight)}async urlChanged(){await this.stopStream(),await this.startStream()}};n([m({required:!0})],r.prototype,"camSettings",2);n([m({default:null})],r.prototype,"printerUrl",2);n([v("url")],r.prototype,"urlChanged",1);r=n([g],r);var _=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"d-flex justify-center"},[s("img",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.viewportVisibilityChanged,expression:"viewportVisibilityChanged"}],ref:"webcamUv4lMjpegImage",staticClass:"webcamImage",style:e.webcamStyle,on:{load:e.onload}})])},y=[];const c={};var w=b(r,_,y,!1,j,"3177fd01",null,null);function j(e){for(let t in c)this[t]=c[t]}const M=function(){return w.exports}();export{M as default}; diff --git a/dirs/mainsail/assets/Viewer-3e5b07dd.css b/dirs/mainsail/assets/Viewer-3e5b07dd.css deleted file mode 100644 index c9c2bc6..0000000 --- a/dirs/mainsail/assets/Viewer-3e5b07dd.css +++ /dev/null @@ -1 +0,0 @@ -[data-v-7831183a] .cm-activeLine{background-color:#333!important}.codeview[data-v-7831183a]{height:100%;overflow:auto}.viewer{width:100%;height:calc(var(--app-height) - 240px);border:1px solid #3f3f3f}.withScrubber .viewer{height:calc(var(--app-height) - 300px)}@media (min-width: 600px) and (max-width: 959px){.viewer{height:calc(var(--app-height) - 295px)}.withScrubber .viewer{height:calc(var(--app-height) - 360px)}}@media (max-width: 599px){.viewer,.withScrubber .viewer{height:calc(var(--app-height) - 340px)}}.scrubber[data-v-0de79293]{position:relative;left:0;right:0;bottom:5px} diff --git a/dirs/mainsail/assets/Viewer-8db94310.js b/dirs/mainsail/assets/Viewer-8db94310.js deleted file mode 100644 index 0a8461c..0000000 --- a/dirs/mainsail/assets/Viewer-8db94310.js +++ /dev/null @@ -1 +0,0 @@ -import{k as cc,l as uc,W as ot,j as i0,P as Hr,n as s0,m as al,B as ol,o as dc,p as fc,q as _c,r as pc,s as gc,t as mc,u as vc,v as xc,w as bc,x as yc,y as Tc,z as Sc,A as Ac,D as X0,E as ll,_ as hl,R as cl}from"./index-97b4652c.js";import{V as Ec,f as zt,c as Oi,i as K0,l as hr,m as xs,z as Cc,T as Rc,B as Y0,C as Ic,D as Mc,s as qi,E as ji,w as Pc,a2 as q0,j as ga,h as wc,_ as Dc,a as Fc,b as Oc,o as Lc,d as Bc}from"./vuetify-52f40ce5.js";import{E as Nc,b as Uc,a as kc}from"./codemirror-0a1db0c7.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";function Vc(a,e){return e===void 0&&(e={}),function(t,i){cc(e,t,i),uc(function(s,n){(s.props||(s.props={}))[a]=e,(s.computed||(s.computed={}))[n]={get:function(){return this[a]},set:function(r){this.$emit("update:"+a,r)}}})(t,i)}}class Gc{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class Wc{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1}}class ee{static FromPromise(e,t){const i=new ee;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new Gc(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,n=!1){if(!e)return null;const r=new Wc(e,t,s);return r.unregisterOnNextCall=n,i?this._observers.unshift(r):this._observers.push(r),this._onObserverAdded&&this._onObserverAdded(r),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(r,this._lastNotifiedValue),r}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e&&this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1}removeCallback(e,t){for(let i=0;i{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,s,n){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const r=this._eventState;r.mask=t,r.target=i,r.currentTarget=s,r.skipNextObservers=!1,r.lastReturnValue=e,r.userInfo=n;for(const o of this._observers)if(!o._willBeUnregistered&&(o.mask&t&&(o.unregisterOnNextCall&&this._deferUnregister(o),o.scope?r.lastReturnValue=o.callback.apply(o.scope,[e,r]):r.lastReturnValue=o.callback(e,r)),r.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){this._observers.length=0,this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new ee;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}class zc{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,s=1,n=2,r=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=n,this._comparisonFunction=r,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}var ze;(function(a){a[a.Unknown=0]="Unknown",a[a.Url=1]="Url",a[a.Temp=2]="Temp",a[a.Raw=3]="Raw",a[a.Dynamic=4]="Dynamic",a[a.RenderTarget=5]="RenderTarget",a[a.MultiRenderTarget=6]="MultiRenderTarget",a[a.Cube=7]="Cube",a[a.CubeRaw=8]="CubeRaw",a[a.CubePrefiltered=9]="CubePrefiltered",a[a.Raw3D=10]="Raw3D",a[a.Raw2DArray=11]="Raw2DArray",a[a.DepthStencil=12]="DepthStencil",a[a.CubeRawRGBD=13]="CubeRawRGBD",a[a.Depth=14]="Depth"})(ze||(ze={}));class Dt extends zc{get useMipMaps(){return this.generateMipMaps}set useMipMaps(e){this.generateMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,i=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new ee,this.onErrorObservable=new ee,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=ze.Unknown,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._engine=e,this._source=t,this._uniqueId=Dt._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){var e;if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const i=this.onRebuildCallback(this),s=n=>{n._swapAndDie(this,!1),this.isReady=i.isReady};i.isAsync?i.proxy.then(s):s(i.proxy);return}let t;switch(this.source){case ze.Temp:break;case ze.Url:t=this._engine.createTexture((e=this._originalUrl)!==null&&e!==void 0?e:this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,i=>{i._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case ze.Raw:t=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,void 0,this._useSRGBBuffer),t._swapAndDie(this,!1),this.isReady=!0;break;case ze.Raw3D:t=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),t._swapAndDie(this,!1),this.isReady=!0;break;case ze.Raw2DArray:t=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),t._swapAndDie(this,!1),this.isReady=!0;break;case ze.Dynamic:t=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),t._swapAndDie(this,!1),this._engine.updateDynamicTexture(this,this._engine.getRenderingCanvas(),this.invertY,void 0,void 0,!0);break;case ze.Cube:t=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{t._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer);return;case ze.CubeRaw:t=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),t._swapAndDie(this,!1),this.isReady=!0;break;case ze.CubeRawRGBD:return;case ze.CubePrefiltered:t=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,i=>{i&&i._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),t._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){var i;(i=this._hardwareTexture)===null||i===void 0||i.setUsage(e._source,this.generateMipMaps,this.isCube,this.width,this.height),e._hardwareTexture=this._hardwareTexture,t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const s=this._engine.getLoadedTexturesCache();let n=s.indexOf(this);n!==-1&&s.splice(n,1),n=s.indexOf(e),n===-1&&s.push(e)}dispose(){this._references--,this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._references===0&&(this._engine._releaseTexture(this),this._hardwareTexture=null)}}Dt._Counter=0;function Pt(){return typeof window<"u"}function n0(){return typeof navigator<"u"}function kn(){return typeof document<"u"}function Xr(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}const Da={IsWindowObjectExist:Pt,IsNavigatorAvailable:n0,IsDocumentAvailable:kn,GetDOMTextContent:Xr};class Ie{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}Ie.Instances=new Array;Ie.OnEnginesDisposedObservable=new ee;Ie._LastCreatedScene=null;Ie.UseFallbackTexture=!0;Ie.FallbackTexture="";function Ae(a){return"".concat(a," needs to be imported before as it contains a side-effect required by your code.")}class H{static _CheckLimit(e,t){let i=H._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},H._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){var i;const s=H._LogLimitOutputs[e];if(!s||!H.MessageLimitReached)return;const n=this._Levels[t];s.current===s.limit&&H[n.name](H.MessageLimitReached.replace(/%LIMIT%/g,""+s.limit).replace(/%TYPE%/g,(i=n.name)!==null&&i!==void 0?i:""))}static _AddLogEntry(e){H._LogCache=e+H._LogCache,H.OnNewCacheEntry&&H.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){if(i!==void 0&&!H._CheckLimit(t,i))return;const s=H._FormatMessage(t),n=this._Levels[e];n.logFunc&&n.logFunc("BJS - "+s);const r="
").concat(s,"

");H._AddLogEntry(r),H._GenerateLimitMessage(t,e)}static get LogCache(){return H._LogCache}static ClearLogCache(){H._LogCache="",H._LogLimitOutputs={},H.errorsCount=0}static set LogLevels(e){H.Log=H._LogDisabled,H.Warn=H._LogDisabled,H.Error=H._LogDisabled,[H.MessageLogLevel,H.WarningLogLevel,H.ErrorLogLevel].forEach(t=>{if((e&t)===t){const i=this._Levels[t];H[i.name]=H._LogEnabled.bind(H,t)}})}}H.NoneLogLevel=0;H.MessageLogLevel=1;H.WarningLogLevel=2;H.ErrorLogLevel=4;H.AllLogLevel=7;H.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";H._LogCache="";H._LogLimitOutputs={};H._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];H.errorsCount=0;H.Log=H._LogEnabled.bind(H,H.MessageLogLevel);H.Warn=H._LogEnabled.bind(H,H.WarningLogLevel);H.Error=H._LogEnabled.bind(H,H.ErrorLogLevel);const Hc="attribute",Xc="varying";class wn{constructor(){this.children=[]}isValid(e){return!0}process(e,t){var i,s,n,r,o,l;let h="";if(this.line){let c=this.line;const u=t.processor;if(u){u.lineProcessor&&(c=u.lineProcessor(c,t.isFragment,t.processingContext));const d=(s=(i=t.processor)===null||i===void 0?void 0:i.attributeKeywordName)!==null&&s!==void 0?s:Hc,_=t.isFragment&&(!((n=t.processor)===null||n===void 0)&&n.varyingFragmentKeywordName)?(r=t.processor)===null||r===void 0?void 0:r.varyingFragmentKeywordName:!t.isFragment&&(!((o=t.processor)===null||o===void 0)&&o.varyingVertexKeywordName)?(l=t.processor)===null||l===void 0?void 0:l.varyingVertexKeywordName:Xc;!t.isFragment&&u.attributeProcessor&&this.line.startsWith(d)?c=u.attributeProcessor(this.line,e,t.processingContext):u.varyingProcessor&&this.line.startsWith(_)?c=u.varyingProcessor(this.line,t.isFragment,e,t.processingContext):u.uniformProcessor&&u.uniformRegexp&&u.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(c=u.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):u.uniformBufferProcessor&&u.uniformBufferRegexp&&u.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(c=u.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):u.textureProcessor&&u.textureRegexp&&u.textureRegexp.test(this.line)?c=u.textureProcessor(this.line,t.isFragment,e,t.processingContext):(u.uniformProcessor||u.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?u.uniformProcessor&&(c=u.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):u.uniformBufferProcessor&&(c=u.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,u.endOfUniformBufferProcessor&&(c=u.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}h+=c+"\r\n"}return this.children.forEach(c=>{h+=c.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),h}}class Kc{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex{h=h.trim(),h!==""&&(t.push(h),h="")},n=c=>{iii._Stack[i],o=()=>i===-1?"!!INVALID EXPRESSION!!":ii._Stack[i--];let l=0,h="";for(;l1){for(s();i!==-1&&ii._OperatorPriority[r()]>=ii._OperatorPriority[u];)t.push(o());n(u),l++}else h+=c;l++}for(s();i!==-1;)r()==="("?o():t.push(o());return t}}ii._OperatorPriority={")":0,"(":1,"||":2,"&&":3};ii._Stack=["","","","","","","","","","","","","","","","","","","",""];class cr extends ii{constructor(e,t=!1){super(),this.define=e,this.not=t}isTrue(e){let t=e[this.define]!==void 0;return this.not&&(t=!t),t}}class qc extends ii{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class jc extends ii{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class $c extends ii{constructor(e,t,i){super(),this.define=e,this.operand=t,this.testValue=i}isTrue(e){let t=e[this.define];t===void 0&&(t=this.define);let i=!1;const s=parseInt(t),n=parseInt(this.testValue);switch(this.operand){case">":i=s>n;break;case"<":i=s=":i=s>=n;break;case"==":i=s===n;break}return i}}var at;(function(a){a[a.GLSL=0]="GLSL",a[a.WGSL=1]="WGSL"})(at||(at={}));const Zc=/defined\s*?\((.+?)\)/g,va=/defined\s*?\[(.+?)\]/g,j0=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g;class Qi{static Initialize(e){e.processor&&e.processor.initializeShaders&&e.processor.initializeShaders(e.processingContext)}static Process(e,t,i,s){var n;!((n=t.processor)===null||n===void 0)&&n.preProcessShaderCode&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),this._ProcessIncludes(e,t,r=>{t.processCodeAfterIncludes&&(r=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",r));const o=this._ProcessShaderConversion(r,t,s);i(o,r)})}static PreProcess(e,t,i,s){var n;!((n=t.processor)===null||n===void 0)&&n.preProcessShaderCode&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),this._ProcessIncludes(e,t,r=>{t.processCodeAfterIncludes&&(r=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",r));const o=this._ApplyPreProcessing(r,t,s);i(o,r)})}static Finalize(e,t,i){return!i.processor||!i.processor.finalizeShaders?{vertexCode:e,fragmentCode:t}:i.processor.finalizeShaders(e,t,i.processingContext)}static _ProcessPrecision(e,t){var i;if(!((i=t.processor)===null||i===void 0)&&i.noPrecision)return e;const s=t.shouldUseHighPrecisionShader;return e.indexOf("precision highp float")===-1?s?e="precision highp float;\n"+e:e="precision mediump float;\n"+e:s||(e=e.replace("precision highp float","precision mediump float")),e}static _ExtractOperation(e){const i=/defined\((.+)\)/.exec(e);if(i&&i.length)return new cr(i[1].trim(),e[0]==="!");const s=["==",">=","<=","<",">"];let n="",r=0;for(n of s)if(r=e.indexOf(n),r>-1)break;if(r===-1)return new cr(e);const o=e.substring(0,r).trim(),l=e.substring(r+n.length).trim();return new $c(o,n,l)}static _BuildSubExpression(e){e=e.replace(Zc,"defined[$1]");const t=ii.infixToPostfix(e),i=[];for(const n of t)if(n!=="||"&&n!=="&&")i.push(n);else if(i.length>=2){let r=i[i.length-1],o=i[i.length-2];i.length-=2;const l=n=="&&"?new jc:new qc;typeof r=="string"&&(r=r.replace(va,"defined($1)")),typeof o=="string"&&(o=o.replace(va,"defined($1)")),l.leftOperand=typeof o=="string"?this._ExtractOperation(o):o,l.rightOperand=typeof r=="string"?this._ExtractOperation(r):r,i.push(l)}let s=i[i.length-1];return typeof s=="string"&&(s=s.replace(va,"defined($1)")),typeof s=="string"?this._ExtractOperation(s):s}static _BuildExpression(e,t){const i=new Yc,s=e.substring(0,t);let n=e.substring(t);return n=n.substring(0,(n.indexOf("//")+1||n.length+1)-1).trim(),s==="#ifdef"?i.testExpression=new cr(n):s==="#ifndef"?i.testExpression=new cr(n,!0):i.testExpression=this._BuildSubExpression(n),i}static _MoveCursorWithinIf(e,t,i){let s=e.currentLine;for(;this._MoveCursor(e,i);){s=e.currentLine;const n=s.substring(0,5).toLowerCase();if(n==="#else"){const r=new wn;t.children.push(r),this._MoveCursor(e,r);return}else if(n==="#elif"){const r=this._BuildExpression(s,5);t.children.push(r),i=r}}}static _MoveCursor(e,t){for(;e.canRead;){e.lineIndex++;const i=e.currentLine,n=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(i);if(n&&n.length)switch(n[0]){case"#ifdef":{const o=new ma;t.children.push(o);const l=this._BuildExpression(i,6);o.children.push(l),this._MoveCursorWithinIf(e,o,l);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const o=new ma;t.children.push(o);const l=this._BuildExpression(i,7);o.children.push(l),this._MoveCursorWithinIf(e,o,l);break}case"#if":{const o=new ma,l=this._BuildExpression(i,3);t.children.push(o),o.children.push(l),this._MoveCursorWithinIf(e,o,l);break}}else{const r=new wn;if(r.line=i,t.children.push(r),i[0]==="#"&&i[1]==="d"){const o=i.replace(";","").split(" ");r.additionalDefineKey=o[1],o.length===3&&(r.additionalDefineValue=o[2])}}}return!1}static _EvaluatePreProcessors(e,t,i){const s=new wn,n=new Kc;return n.lineIndex=-1,n.lines=e.split("\n"),this._MoveCursor(n,s),s.process(t,i)}static _PreparePreProcessors(e,t){var i;const s=e.defines,n={};for(const r of s){const l=r.replace("#define","").replace(";","").trim().split(" ");n[l[0]]=l.length>1?l[1]:""}return((i=e.processor)===null||i===void 0?void 0:i.shaderLanguage)===at.GLSL&&(n.GL_ES="true"),n.__VERSION__=e.version,n[e.platformName]="true",t._getGlobalDefines(n),n}static _ProcessShaderConversion(e,t,i){let s=this._ProcessPrecision(e,t);if(!t.processor||t.processor.shaderLanguage===at.GLSL&&s.indexOf("#version 3")!==-1&&(s=s.replace("#version 300 es",""),!t.processor.parseGLES3))return s;const n=t.defines,r=this._PreparePreProcessors(t,i);return t.processor.preProcessor&&(s=t.processor.preProcessor(s,n,t.isFragment,t.processingContext)),s=this._EvaluatePreProcessors(s,r,t),t.processor.postProcessor&&(s=t.processor.postProcessor(s,n,t.isFragment,t.processingContext,i)),i._features.needShaderCodeInlining&&(s=i.inlineShaderCode(s)),s}static _ApplyPreProcessing(e,t,i){var s,n;let r=e;const o=t.defines,l=this._PreparePreProcessors(t,i);return!((s=t.processor)===null||s===void 0)&&s.preProcessor&&(r=t.processor.preProcessor(r,o,t.isFragment,t.processingContext)),r=this._EvaluatePreProcessors(r,l,t),!((n=t.processor)===null||n===void 0)&&n.postProcessor&&(r=t.processor.postProcessor(r,o,t.isFragment,t.processingContext,i)),i._features.needShaderCodeInlining&&(r=i.inlineShaderCode(r)),r}static _ProcessIncludes(e,t,i){let s=j0.exec(e),n=new String(e),r=!1;for(;s!=null;){let o=s[1];if(o.indexOf("__decl__")!==-1&&(o=o.replace(/__decl__/,""),t.supportsUniformBuffers&&(o=o.replace(/Vertex/,"Ubo"),o=o.replace(/Fragment/,"Ubo")),o=o+"Declaration"),t.includesShadersStore[o]){let l=t.includesShadersStore[o];if(s[2]){const h=s[3].split(",");for(let c=0;cp+"{X}")),l+=_.replace(/\{X\}/g,f.toString())+"\n"}else t.supportsUniformBuffers||(l=l.replace(/light\{X\}.(\w*)/g,(c,u)=>u+"{X}")),l=l.replace(/\{X\}/g,h)}n=n.replace(s[0],l),r=r||l.indexOf("#include<")>=0||l.indexOf("#include <")>=0}else{const l=t.shadersRepository+"ShadersInclude/"+o+".fx";Qi._FileToolsLoadFile(l,h=>{t.includesShadersStore[o]=h,this._ProcessIncludes(n,t,i)});return}s=j0.exec(e)}r?this._ProcessIncludes(n.toString(),t,i):i(n)}static _FileToolsLoadFile(e,t,i,s,n,r){throw Ae("FileTools")}}class te{static GetShadersRepository(e=at.GLSL){return e===at.GLSL?te.ShadersRepository:te.ShadersRepositoryWGSL}static GetShadersStore(e=at.GLSL){return e===at.GLSL?te.ShadersStore:te.ShadersStoreWGSL}static GetIncludesShadersStore(e=at.GLSL){return e===at.GLSL?te.IncludesShadersStore:te.IncludesShadersStoreWGSL}}te.ShadersRepository="src/Shaders/";te.ShadersStore={};te.IncludesShadersStore={};te.ShadersRepositoryWGSL="src/ShadersWGSL/";te.ShadersStoreWGSL={};te.IncludesShadersStoreWGSL={};class wt{static get ShadersRepository(){return te.ShadersRepository}static set ShadersRepository(e){te.ShadersRepository=e}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new ee),this._onBindObservable}constructor(e,t,i,s=null,n,r=null,o=null,l=null,h=null,c,u="",d=at.GLSL){var _,f,g;this.name=null,this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new ee,this.onErrorObservable=new ee,this._onBindObservable=null,this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!1,this._wasPreviouslyUsingInstances=null,this._isDisposed=!1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this.name=e,this._key=u;let p,x=null;if(t.attributes){const P=t;if(this._engine=i,this._attributesNames=P.attributes,this._uniformsNames=P.uniformsNames.concat(P.samplers),this._samplerList=P.samplers.slice(),this.defines=P.defines,this.onError=P.onError,this.onCompiled=P.onCompiled,this._fallbacks=P.fallbacks,this._indexParameters=P.indexParameters,this._transformFeedbackVaryings=P.transformFeedbackVaryings||null,this._multiTarget=!!P.multiTarget,this._shaderLanguage=(_=P.shaderLanguage)!==null&&_!==void 0?_:at.GLSL,P.uniformBuffersNames){this._uniformBuffersNamesList=P.uniformBuffersNames.slice();for(let C=0;C{if(y[0]&&y[1]){b.isFragment=!0;const[P,C]=y;Qi.Process(C,b,(R,w)=>{this._fragmentSourceCodeBeforeMigration=w,x&&(R=x("fragment",R));const D=Qi.Finalize(P,R,b);b=null,this._useFinalCode(D.vertexCode,D.fragmentCode,e)},this._engine)}};this._loadShader(m,"Vertex","",P=>{Qi.Initialize(b),Qi.Process(P,b,(C,R)=>{this._rawVertexSourceCode=P,this._vertexSourceCodeBeforeMigration=R,x&&(C=x("vertex",C)),y[0]=C,E()},this._engine)}),this._loadShader(T,"Fragment","Pixel",P=>{this._rawFragmentSourceCode=P,y[1]=P,E()})}_useFinalCode(e,t,i){if(i){const s=i.vertexElement||i.vertex||i.spectorName||i,n=i.fragmentElement||i.fragment||i.spectorName||i;this._vertexSourceCode=(this._shaderLanguage===at.WGSL?"//":"")+"#define SHADER_NAME vertex:"+s+"\n"+e,this._fragmentSourceCode=(this._shaderLanguage===at.WGSL?"//":"")+"#define SHADER_NAME fragment:"+n+"\n"+t}else this._vertexSourceCode=e,this._fragmentSourceCode=t;this._prepareEffect()}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getAttributesNames(){return this._attributesNames}getAttributeLocation(e){return this._attributes[e]}getAttributeLocationByName(e){return this._attributeLocationByName[e]}getAttributesCount(){return this._attributes.length}getUniformIndex(e){return this._uniformsNames.indexOf(e)}getUniform(e){return this._uniforms[e]}getSamplers(){return this._samplerList}getUniformNames(){return this._uniformsNames}getUniformBuffersNames(){return this._uniformBuffersNamesList}getIndexParameters(){return this._indexParameters}getCompilationError(){return this._compilationError}allFallbacksProcessed(){return this._allFallbacksProcessed}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&setTimeout(()=>{this._checkIsReady(null)},16)}_checkIsReady(e){try{if(this._isReadyInternal())return}catch(t){this._processCompilationErrors(t,e);return}this._isDisposed||setTimeout(()=>{this._checkIsReady(e)},16)}_loadShader(e,t,i,s){if(typeof HTMLElement<"u"&&e instanceof HTMLElement){const o=Xr(e);s(o);return}if(e.substr(0,7)==="source:"){s(e.substr(7));return}if(e.substr(0,7)==="base64:"){const o=window.atob(e.substr(7));s(o);return}const n=te.GetShadersStore(this._shaderLanguage);if(n[e+t+"Shader"]){s(n[e+t+"Shader"]);return}if(i&&n[e+i+"Shader"]){s(n[e+i+"Shader"]);return}let r;e[0]==="."||e[0]==="/"||e.indexOf("http")>-1?r=e:r=te.GetShadersRepository(this._shaderLanguage)+e,this._engine._loadFile(r+"."+t.toLowerCase()+".fx",s)}get vertexSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:(t=(e=this._pipelineContext)===null||e===void 0?void 0:e._getVertexShaderCode())!==null&&t!==void 0?t:this._vertexSourceCode}get fragmentSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:(t=(e=this._pipelineContext)===null||e===void 0?void 0:e._getFragmentShaderCode())!==null&&t!==void 0?t:this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}_rebuildProgram(e,t,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(n,r)=>{s&&s(r)},this.onCompiled=()=>{const n=this.getEngine().scenes;if(n)for(let r=0;r{if(this._attributes=[],this._pipelineContext._fillEffectInformation(this,this._uniformBuffersNames,this._uniformsNames,this._uniforms,this._samplerList,this._samplers,e,this._attributes),e)for(let r=0;r=o&&(n="Offending line [".concat(o,"] in ").concat(i?"fragment":"vertex"," code: ").concat(l[o-1]))}}return[e,n]}_processCompilationErrors(e,t=null){var i,s,n;this._compilationError=e.message;const r=this._attributesNames,o=this._fallbacks;if(H.Error("Unable to compile effect:"),H.Error("Uniforms: "+this._uniformsNames.map(function(h){return" "+h})),H.Error("Attributes: "+r.map(function(h){return" "+h})),H.Error("Defines:\r\n"+this.defines),wt.LogShaderCodeOnCompilationError){let h=null,c=null,u=null;!((i=this._pipelineContext)===null||i===void 0)&&i._getVertexShaderCode()&&([u,h]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),u&&(H.Error("Vertex code:"),H.Error(u))),!((s=this._pipelineContext)===null||s===void 0)&&s._getFragmentShaderCode()&&([u,c]=this._getShaderCodeAndErrorLine((n=this._pipelineContext)===null||n===void 0?void 0:n._getFragmentShaderCode(),this._compilationError,!0),u&&(H.Error("Fragment code:"),H.Error(u))),h&&H.Error(h),c&&H.Error(c)}H.Error("Error: "+this._compilationError);const l=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)};t&&(this._pipelineContext=t,this._isReady=!0,l()),o?(this._pipelineContext=null,o.hasMoreFallbacks?(this._allFallbacksProcessed=!1,H.Error("Trying next fallback."),this.defines=o.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,l(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||l())}get isSupported(){return this._compilationError===""}_bindTexture(e,t){this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setDepthStencilTexture(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){const i=e+"Ex";if(this._samplerList.indexOf(i+"0")===-1){const s=this._samplerList.indexOf(e);for(let r=1;r{s[i[_]]=d}),this._uniforms=s;let u;for(u=0;u{r[d]=_});for(const d of h.getAttributes(this,o))l.push(d)}dispose(){this._uniforms={}}_cacheMatrix(e,t){const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_cacheFloat2(e,t,i){let s=this._valueCache[e];if(!s||s.length!==2)return s=[t,i],this._valueCache[e]=s,!0;let n=!1;return s[0]!==t&&(s[0]=t,n=!0),s[1]!==i&&(s[1]=i,n=!0),n}_cacheFloat3(e,t,i,s){let n=this._valueCache[e];if(!n||n.length!==3)return n=[t,i,s],this._valueCache[e]=n,!0;let r=!1;return n[0]!==t&&(n[0]=t,r=!0),n[1]!==i&&(n[1]=i,r=!0),n[2]!==s&&(n[2]=s,r=!0),r}_cacheFloat4(e,t,i,s,n){let r=this._valueCache[e];if(!r||r.length!==4)return r=[t,i,s,n],this._valueCache[e]=r,!0;let o=!1;return r[0]!==t&&(r[0]=t,o=!0),r[1]!==i&&(r[1]=i,o=!0),r[2]!==s&&(r[2]=s,o=!0),r[3]!==n&&(r[3]=n,o=!0),o}setInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setIntArray(e,t){this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setUInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setUInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setUInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setUIntArray(e,t){this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){t&&(this._valueCache[e]=null,this.engine.setMatrices(this._uniforms[e],t))}setMatrix(e,t){this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.toArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setFloat3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setVector4(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setFloat4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setColor3(e,t){this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}class Mt{static SetMatrixPrecision(e){if(Mt.MatrixTrackPrecisionChange=!1,e&&!Mt.MatrixUse64Bits&&Mt.MatrixTrackedMatrices)for(let t=0;t1&&!this.disableUniformBuffers}getCreationOptions(){return this._creationOptions}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get activeRenderLoops(){return this._activeRenderLoops}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}get currentViewport(){return this._cachedViewport}get emptyTexture(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}get isWebGPU(){return this._isWebGPU}get shaderPlatformName(){return this._shaderPlatformName}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return this._snapshotRenderingMode}set snapshotRenderingMode(e){this._snapshotRenderingMode=e}snapshotRenderingReset(){this.snapshotRendering=!1}static _CreateCanvas(e,t){if(typeof document>"u")return new OffscreenCanvas(e,t);const i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){return Ee._CreateCanvas(e,t)}createCanvasImage(){return document.createElement("img")}constructor(e,t,i,s){var n,r,o,l,h,c,u,d,_,f,g;this._name="WebGL",this._isDisposed=!1,this.forcePOTTextures=!1,this.isFullscreen=!1,this.cullBackFaces=null,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this.validateShaderPrograms=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this.disableUniformBuffers=!1,this.onDisposeObservable=new ee,this._frameId=0,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._webGLVersion=1,this._windowIsBackground=!1,this._highPrecisionShadersAllowed=!0,this._badOS=!1,this._badDesktopOS=!1,this._renderingQueueLaunched=!1,this._activeRenderLoops=new Array,this.onContextLostObservable=new ee,this.onContextRestoredObservable=new ee,this._contextWasLost=!1,this._doNotHandleContextLost=!1,this.disableVertexArrayObjects=!1,this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new ul,this._stencilStateComposer=new fl,this._stencilState=new ls,this._alphaState=new Qc,this._alphaMode=1,this._alphaEquation=0,this._internalTexturesCache=new Array,this._renderTargetWrapperCache=new Array,this._activeChannel=0,this._currentTextureChannel=-1,this._boundTexturesCache={},this._compiledEffects={},this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._activeRequests=new Array,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._transformTextureUrl=null,this.hostInformation={isMobile:!1},this.premultipliedAlpha=!0,this.onBeforeTextureInitObservable=new ee,this._isWebGPU=!1,this._snapshotRenderingMode=0,this._viewportCached={x:0,y:0,z:0,w:0},this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},this.startTime=Pi.Now;let p=null;i=i||{},this._creationOptions=i,this.adaptToDeviceRatio=s!=null?s:!1,this._stencilStateComposer.stencilGlobal=this._stencilState,Mt.SetMatrixPrecision(!!i.useHighPrecisionMatrix),i.antialias=t!=null?t:i.antialias,i.deterministicLockstep=(n=i.deterministicLockstep)!==null&&n!==void 0?n:!1,i.lockstepMaxSteps=(r=i.lockstepMaxSteps)!==null&&r!==void 0?r:4,i.timeStep=(o=i.timeStep)!==null&&o!==void 0?o:1/60,i.audioEngine=(l=i.audioEngine)!==null&&l!==void 0?l:!0,i.stencil=(h=i.stencil)!==null&&h!==void 0?h:!0,this._audioContext=(u=(c=i.audioEngineOptions)===null||c===void 0?void 0:c.audioContext)!==null&&u!==void 0?u:null,this._audioDestination=(_=(d=i.audioEngineOptions)===null||d===void 0?void 0:d.audioDestination)!==null&&_!==void 0?_:null,this.premultipliedAlpha=(f=i.premultipliedAlpha)!==null&&f!==void 0?f:!0,this.useExactSrgbConversions=(g=i.useExactSrgbConversions)!==null&&g!==void 0?g:!1,this._doNotHandleContextLost=!!i.doNotHandleContextLost,this._isStencilEnable=!!i.stencil,s=s||i.adaptToDeviceRatio||!1;const x=Pt()&&window.devicePixelRatio||1,m=i.limitDeviceRatio||x;if(this._hardwareScalingLevel=s?1/Math.min(m,x):1,this._lastDevicePixelRatio=x,!e)return;if(e.getContext){if(p=e,this._renderingCanvas=p,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!0),navigator&&navigator.userAgent){this._setupMobileChecks();const S=navigator.userAgent;for(const b of Ee.ExceptionList){const y=b.key,E=b.targets;if(new RegExp(y).test(S)){if(b.capture&&b.captureConstraint){const C=b.capture,R=b.captureConstraint,D=new RegExp(C).exec(S);if(D&&D.length>0&&parseInt(D[D.length-1])>=R)continue}for(const C of E)switch(C){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost||(this._onContextLost=S=>{S.preventDefault(),this._contextWasLost=!0,H.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(this._initGLContext.bind(this))},p.addEventListener("webglcontextlost",this._onContextLost,!1),p.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=p.getContext("webgl2",i)||p.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!p)throw new Error("The provided canvas is null or undefined.");try{this._gl=p.getContext("webgl",i)||p.getContext("experimental-webgl",i)}catch{throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,this._renderingCanvas=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const S=this._gl.getContextAttributes();S&&(i.stencil=S.stencil)}this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),i.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let S=0;S1?new eu:new Jc,this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent);const T="Babylon.js v".concat(Ee.Version);console.log(T+" - ".concat(this.description)),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",T)}_setupMobileChecks(){navigator&&navigator.userAgent&&(this._checkForMobile=()=>{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&kn()&&"ontouchend"in document},this._checkForMobile(),Pt()&&window.addEventListener("resize",this._checkForMobile))}_restoreEngineAfterContextLost(e){setTimeout(async()=>{var t;this._dummyFramebuffer=null;const i=this._depthCullingState.depthTest,s=this._depthCullingState.depthFunc,n=this._depthCullingState.depthMask,r=this._stencilState.stencilTest;await e(),this.wipeCaches(!0),this._rebuildEffects(),(t=this._rebuildComputeEffects)===null||t===void 0||t.call(this),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0),this._depthCullingState.depthTest=i,this._depthCullingState.depthFunc=s,this._depthCullingState.depthMask=n,this._stencilState.stencilTest=r,H.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1},0)}_sharedInit(e){this._renderingCanvas=e}_getShaderProcessingContext(e){return null}_rebuildInternalTextures(){const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){const e=this._renderTargetWrapperCache.slice();for(const t of e)t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._wasPreviouslyReady=!1,t._prepareEffect()}wt.ResetCache()}areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuild();for(const e of this._storageBuffers)e._rebuild()}_initGLContext(){var e;this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||this._gl.getExtension("OES_standard_derivatives")!==null,maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||this._gl.getExtension("OES_element_index_uint")!==null,fragmentDepthSupported:this._webGLVersion>1||this._gl.getExtension("EXT_frag_depth")!==null,highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:this._webGLVersion!==1,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1},this._glVersion=this._gl.getParameter(this._gl.VERSION);const t=this._gl.getExtension("WEBGL_debug_renderer_info");if(t!=null&&(this._glRenderer=this._gl.getParameter(t.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(t.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),this._gl.HALF_FLOAT_OES!==36193&&(this._gl.HALF_FLOAT_OES=36193),this._gl.RGBA16F!==34842&&(this._gl.RGBA16F=34842),this._gl.RGBA32F!==34836&&(this._gl.RGBA32F=34836),this._gl.DEPTH24_STENCIL8!==35056&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(this._webGLVersion===1&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=((e=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT))!==null&&e!==void 0?e:0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&this._gl.HALF_FLOAT_OES!==5131&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._maxMSAASamplesOverride!==null?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES);else{const i=this._gl.getExtension("WEBGL_draw_buffers");if(i!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let s=0;s<16;s++)this._gl["COLOR_ATTACHMENT"+s+"_WEBGL"]=i["COLOR_ATTACHMENT"+s+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const i=this._gl.getExtension("WEBGL_depth_texture");i!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=i.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const i=this._gl.getExtension("OES_vertex_array_object");i!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const i=this._gl.getExtension("ANGLE_instanced_arrays");i!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=i.drawArraysInstancedANGLE.bind(i),this._gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i),this._gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const i=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);i&&s&&(this._caps.highPrecisionShaderSupported=i.precision!==0&&s.precision!==0)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const i=this._gl.getExtension("EXT_blend_minmax");i!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=i.MAX_EXT,this._gl.MIN=i.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0;else{const i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._gl.SRGB=i.SRGB_EXT,this._gl.SRGB8=i.SRGB_ALPHA_EXT,this._gl.SRGB8_ALPHA8=i.SRGB_ALPHA_EXT)}this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&!!(this._creationOptions&&this._creationOptions.forceSRGBBufferSupportState)}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let i=0;i=0&&this._activeRenderLoops.splice(t,1)}_renderLoop(){if(!this._contextWasLost){let e=!0;if((this._isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e){this.beginFrame();for(let t=0;t0?this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}getHostWindow(){return Pt()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}_queueNewFrame(e,t){return Ee.QueueNewFrame(e,t)}runRenderLoop(e){this._activeRenderLoops.indexOf(e)===-1&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._boundRenderFunction=this._renderLoop.bind(this),this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))}clear(e,t,i,s=!1){const n=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=n;let r=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),r|=this._gl.COLOR_BUFFER_BIT),i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),r|=this._gl.DEPTH_BUFFER_BIT),s&&(this._gl.clearStencil(0),r|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(r)}_viewport(e,t,i,s){(e!==this._viewportCached.x||t!==this._viewportCached.y||i!==this._viewportCached.z||s!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=s,this._gl.viewport(e,t,i,s))}setViewport(e,t,i){const s=t||this.getRenderWidth(),n=i||this.getRenderHeight(),r=e.x||0,o=e.y||0;this._cachedViewport=e,this._viewport(r*s,o*n,s*e.width,n*e.height)}beginFrame(){}endFrame(){this._badOS&&this.flushFramebuffer(),this._frameId++}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=Pt()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=n}Pt()?(t=this._renderingCanvas?this._renderingCanvas.clientWidth||this._renderingCanvas.width:window.innerWidth,i=this._renderingCanvas?this._renderingCanvas.clientHeight||this._renderingCanvas.height:window.innerHeight):(t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100),this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){return!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t)?!1:(this._renderingCanvas.width=e,this._renderingCanvas.height=t,!0)}bindFramebuffer(e,t=0,i,s,n,r=0,o=0){var l,h,c,u,d;const _=e;this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(_._MSAAFramebuffer?_._MSAAFramebuffer:_._framebuffer);const f=this._gl;e.isMulti||(e.is2DArray?f.framebufferTextureLayer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,(l=e.texture._hardwareTexture)===null||l===void 0?void 0:l.underlyingResource,r,o):e.isCube&&f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,(h=e.texture._hardwareTexture)===null||h===void 0?void 0:h.underlyingResource,r));const g=e._depthStencilTexture;if(g){const p=e._depthStencilTextureWithStencil?f.DEPTH_STENCIL_ATTACHMENT:f.DEPTH_ATTACHMENT;e.is2DArray?f.framebufferTextureLayer(f.FRAMEBUFFER,p,(c=g._hardwareTexture)===null||c===void 0?void 0:c.underlyingResource,r,o):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,p,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,(u=g._hardwareTexture)===null||u===void 0?void 0:u.underlyingResource,r):f.framebufferTexture2D(f.FRAMEBUFFER,p,f.TEXTURE_2D,(d=g._hardwareTexture)===null||d===void 0?void 0:d.underlyingResource,r)}this._cachedViewport&&!n?this.setViewport(this._cachedViewport,i,s):(i||(i=e.width,r&&(i=i/Math.pow(2,r))),s||(s=e.height,r&&(s=s/Math.pow(2,r))),this._viewport(0,0,i,s)),this.wipeCaches()}setState(e,t=0,i,s=!1,n,r,o=0){var l,h;(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e);const c=!((h=(l=this.cullBackFaces)!==null&&l!==void 0?l:n)!==null&&h!==void 0)||h?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==c||i)&&(this._depthCullingState.cullFace=c),this.setZOffset(t),this.setZOffsetUnits(o);const u=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==u||i)&&(this._depthCullingState.frontFace=u),this._stencilStateComposer.stencilMaterial=r}getDepthBuffer(){return this._depthCullingState.depthTest}setDepthBuffer(e){this._depthCullingState.depthTest=e}setZOffset(e){this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e}getZOffset(){const e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e}setZOffsetUnits(e){this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e}getZOffsetUnits(){const e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)}unBindFramebuffer(e,t=!1,i){var s;const n=e;this._currentRenderTarget=null;const r=this._gl;if(n._MSAAFramebuffer){if(e.isMulti){this.unBindMultiColorAttachmentFramebuffer(e,t,i);return}r.bindFramebuffer(r.READ_FRAMEBUFFER,n._MSAAFramebuffer),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,n._framebuffer),r.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r.COLOR_BUFFER_BIT,r.NEAREST)}!((s=e.texture)===null||s===void 0)&&s.generateMipMaps&&!t&&!e.isCube&&this.generateMipmaps(e.texture),i&&(n._MSAAFramebuffer&&this._bindUnboundFramebuffer(n._framebuffer),i()),this._bindUnboundFramebuffer(null)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const s=new Vn(i);return this.bindArrayBuffer(s),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t){const i=this._gl.createBuffer(),s=new Vn(i);if(!i)throw new Error("Unable to create index buffer");this.bindIndexBuffer(s);const n=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),s.references=1,s.is32Bits=n.BYTES_PER_ELEMENT===4,s}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let i=0;i=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,i){const s=e.program,n=this._gl.getUniformBlockIndex(s,t);this._gl.uniformBlockBinding(s,n,i)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,i,s,n,r,o){const l=this._currentBufferPointers[t];if(!l)return;let h=!1;l.active?(l.buffer!==e&&(l.buffer=e,h=!0),l.size!==i&&(l.size=i,h=!0),l.type!==s&&(l.type=s,h=!0),l.normalized!==n&&(l.normalized=n,h=!0),l.stride!==r&&(l.stride=r,h=!0),l.offset!==o&&(l.offset=o,h=!0)):(h=!0,l.active=!0,l.index=t,l.size=i,l.type=s,l.normalized=n,l.stride=r,l.offset=o,l.buffer=e),(h||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),s===this._gl.UNSIGNED_INT||s===this._gl.INT?this._gl.vertexAttribIPointer(t,i,s,r,o):this._gl.vertexAttribPointer(t,i,s,n,r,o))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){const s=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let n=0;n=0){const o=s[n];let l=null;if(i&&(l=i[o]),l||(l=e[o]),!l)continue;this._gl.enableVertexAttribArray(r),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[r]=!0);const h=l.getBuffer();h&&(this._vertexAttribPointer(h,r,l.getSize(),l.type,l.normalized,l.byteStride,l.byteOffset),l.getIsInstanced()&&(this._gl.vertexAttribDivisor(r,l.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(r),this._currentInstanceBuffers.push(h))))}}}recordVertexArrayObject(e,t,i,s){const n=this._gl.createVertexArray();if(!n)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,s),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=t!=null&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,i,s,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;const r=n.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let o=0;for(let l=0;l=0&&(this._gl.enableVertexAttribArray(h),this._vertexAttribArraysEnabled[h]=!0,this._vertexAttribPointer(e,h,i[l],this._gl.FLOAT,!1,s,o)),o+=i[l]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,s){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,s)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,i=this._currentInstanceLocations.length;t1?"#version 300 es\n#define WEBGL2 \n":"",l=this._compileShader(t,"vertex",s,o),h=this._compileShader(i,"fragment",s,o);return this._createShaderProgram(e,l,h,n,r)}inlineShaderCode(e){return e}createPipelineContext(e){const t=new tu;return t.engine=this,this._caps.parallelShaderCompile&&(t.isParallelCompiled=!0),t}createMaterialContext(){}createDrawContext(){}_createShaderProgram(e,t,i,s,n=null){const r=s.createProgram();if(e.program=r,!r)throw new Error("Unable to create program");return s.attachShader(r,t),s.attachShader(r,i),s.linkProgram(r),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),r}_finalizePipelineContext(e){const t=e.context,i=e.vertexShader,s=e.fragmentShader,n=e.program;if(!t.getProgramParameter(n,t.LINK_STATUS)){if(!this._gl.getShaderParameter(i,this._gl.COMPILE_STATUS)){const l=this._gl.getShaderInfoLog(i);if(l)throw e.vertexCompilationError=l,new Error("VERTEX SHADER "+l)}if(!this._gl.getShaderParameter(s,this._gl.COMPILE_STATUS)){const l=this._gl.getShaderInfoLog(s);if(l)throw e.fragmentCompilationError=l,new Error("FRAGMENT SHADER "+l)}const o=t.getProgramInfoLog(n);if(o)throw e.programLinkError=o,new Error(o)}if(this.validateShaderPrograms&&(t.validateProgram(n),!t.getProgramParameter(n,t.VALIDATE_STATUS))){const l=t.getProgramInfoLog(n);if(l)throw e.programValidationError=l,new Error(l)}t.deleteShader(i),t.deleteShader(s),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)}_preparePipelineContext(e,t,i,s,n,r,o,l,h,c){const u=e;s?u.program=this.createRawShaderProgram(u,t,i,void 0,h):u.program=this.createShaderProgram(u,t,i,l,void 0,h),u.program.__SPECTOR_rebuildProgram=o}_isRenderingStateCompiled(e){const t=e;return this._gl.getProgramParameter(t.program,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)?(this._finalizePipelineContext(t),!0):!1}_executeWhenRenderingStateIsCompiled(e,t){const i=e;if(!i.isParallelCompiled){t();return}const s=i.onCompiled;s?i.onCompiled=()=>{s(),t()}:i.onCompiled=t}getUniforms(e,t){const i=new Array,s=e;for(let n=0;n1||this.isWebGPU)),(o===1&&!this._caps.textureFloatLinearFiltering||o===2&&!this._caps.textureHalfFloatLinearFiltering)&&(l=1),o===1&&!this._caps.textureFloat&&(o=0,H.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const _=this._gl,f=new Dt(this,s),g=e.width||e,p=e.height||e,x=e.layers||0,m=this._getSamplingParameters(l,r),T=x!==0?_.TEXTURE_2D_ARRAY:_.TEXTURE_2D,S=this._getRGBABufferInternalSizedFormat(o,h,c),b=this._getInternalFormat(h),y=this._getWebGLTextureType(o);return this._bindTextureDirectly(T,f),x!==0?(f.is2DArray=!0,_.texImage3D(T,0,S,g,p,x,0,b,y,null)):_.texImage2D(T,0,S,g,p,0,b,y,null),_.texParameteri(T,_.TEXTURE_MAG_FILTER,m.mag),_.texParameteri(T,_.TEXTURE_MIN_FILTER,m.min),_.texParameteri(T,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(T,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),r&&this._gl.generateMipmap(T),this._bindTextureDirectly(T,null),f._useSRGBBuffer=c,f.baseWidth=g,f.baseHeight=p,f.width=g,f.height=p,f.depth=x,f.isReady=!0,f.samples=u,f.generateMipMaps=r,f.samplingMode=l,f.type=o,f.format=h,f.label=d,this._internalTexturesCache.push(f),f}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU||t)}_createTextureBase(e,t,i,s,n=3,r=null,o=null,l,h,c=null,u=null,d=null,_=null,f,g,p){e=e||"";const x=e.substr(0,5)==="data:",m=e.substr(0,5)==="blob:",T=x&&e.indexOf(";base64,")!==-1,S=u||new Dt(this,ze.Url);S!==u&&(S.label=e.substring(0,60));const b=e;this._transformTextureUrl&&!T&&!u&&!c&&(e=this._transformTextureUrl(e)),b!==e&&(S._originalUrl=b);const y=e.lastIndexOf(".");let E=_||(y>-1?e.substring(y).toLowerCase():""),P=null;E.indexOf("?")>-1&&(E=E.split("?")[0]);for(const D of Ee._TextureLoaders)if(D.canLoad(E,f)){P=D;break}s&&s.addPendingData(S),S.url=e,S.generateMipMaps=!t,S.samplingMode=n,S.invertY=i,S._useSRGBBuffer=this._getUseSRGBBuffer(!!p,t),this._doNotHandleContextLost||(S._buffer=c);let R=null;r&&!u&&(R=S.onLoadedObservable.add(r)),u||this._internalTexturesCache.push(S);const w=(D,W)=>{s&&s.removePendingData(S),e===b?(R&&S.onLoadedObservable.remove(R),Ie.UseFallbackTexture&&this._createTextureBase(Ie.FallbackTexture,t,S.invertY,s,n,null,o,l,h,c,S),D=(D||"Unknown error")+(Ie.UseFallbackTexture?" - Fallback texture was used":""),S.onErrorObservable.notifyObservers({message:D,exception:W}),o&&o(D,W)):(H.Warn("Failed to load ".concat(e,", falling back to ").concat(b)),this._createTextureBase(b,t,S.invertY,s,n,r,o,l,h,c,S,d,_,f,g,p))};if(P){const D=W=>{P.loadData(W,S,(L,z,K,ae,$,U)=>{U?w("TextureLoader failed to load data"):l(S,E,s,{width:L,height:z},S.invertY,!K,ae,()=>($(),!1),n)},g)};c?c instanceof ArrayBuffer?D(new Uint8Array(c)):ArrayBuffer.isView(c)?D(c):o&&o("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(e,W=>D(new Uint8Array(W)),void 0,s?s.offlineProvider:void 0,!0,(W,L)=>{w("Unable to load "+(W&&W.responseURL,L))})}else{const D=W=>{m&&!this._doNotHandleContextLost&&(S._buffer=W),l(S,E,s,W,S.invertY,t,!1,h,n)};!x||T?c&&(typeof c.decoding=="string"||c.close)?D(c):Ee._FileToolsLoadImage(e,D,w,s?s.offlineProvider:null,f,S.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)||c instanceof Blob?Ee._FileToolsLoadImage(c,D,w,s?s.offlineProvider:null,f,S.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):c&&D(c)}return S}createTexture(e,t,i,s,n=3,r=null,o=null,l=null,h=null,c=null,u=null,d,_,f,g){return this._createTextureBase(e,t,i,s,n,r,o,this._prepareWebGLTexture.bind(this),(p,x,m,T,S,b)=>{const y=this._gl,E=m.width===p&&m.height===x,P=c?this._getInternalFormat(c,S._useSRGBBuffer):T===".jpg"&&!S._useSRGBBuffer?y.RGB:S._useSRGBBuffer?y.SRGB8_ALPHA8:y.RGBA;let C=c?this._getInternalFormat(c):T===".jpg"&&!S._useSRGBBuffer?y.RGB:y.RGBA;if(S._useSRGBBuffer&&this.webGLVersion===1&&(C=P),E)return y.texImage2D(y.TEXTURE_2D,0,P,C,y.UNSIGNED_BYTE,m),!1;const R=this._caps.maxTextureSize;if(m.width>R||m.height>R||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=p,this._workingCanvas.height=x,this._workingContext.drawImage(m,0,0,m.width,m.height,0,0,p,x),y.texImage2D(y.TEXTURE_2D,0,P,C,y.UNSIGNED_BYTE,this._workingCanvas),S.width=p,S.height=x),!1;{const w=new Dt(this,ze.Temp);this._bindTextureDirectly(y.TEXTURE_2D,w,!0),y.texImage2D(y.TEXTURE_2D,0,P,C,y.UNSIGNED_BYTE,m),this._rescaleTexture(w,S,s,P,()=>{this._releaseTexture(w),this._bindTextureDirectly(y.TEXTURE_2D,S,!0),b()})}return!0},l,h,c,u,d,_,g)}static _FileToolsLoadImage(e,t,i,s,n,r){throw Ae("FileTools")}_rescaleTexture(e,t,i,s,n){}createRawTexture(e,t,i,s,n,r,o,l=null,h=0,c=0,u=!1){throw Ae("Engine.RawTexture")}createRawCubeTexture(e,t,i,s,n,r,o,l=null){throw Ae("Engine.RawTexture")}createRawTexture3D(e,t,i,s,n,r,o,l,h=null,c=0){throw Ae("Engine.RawTexture")}createRawTexture2DArray(e,t,i,s,n,r,o,l,h=null,c=0){throw Ae("Engine.RawTexture")}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,i=!1){const s=this._getTextureTarget(t),n=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(s,this._gl.TEXTURE_MAG_FILTER,n.mag,t),this._setTextureParameterInteger(s,this._gl.TEXTURE_MIN_FILTER,n.min),i&&(t.generateMipMaps=!0,this._gl.generateMipmap(s)),this._bindTextureDirectly(s,null),t.samplingMode=e}updateTextureDimensions(e,t,i,s=1){}updateTextureWrappingMode(e,t,i=null,s=null){const n=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),i!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(s),e),e._cachedWrapR=s),this._bindTextureDirectly(n,null)}_setupDepthStencilTexture(e,t,i,s,n,r=1){const o=t.width||t,l=t.height||t,h=t.layers||0;e.baseWidth=o,e.baseHeight=l,e.width=o,e.height=l,e.is2DArray=h>0,e.depth=h,e.isReady=!0,e.samples=r,e.generateMipMaps=!1,e.samplingMode=s?2:1,e.type=0,e._comparisonFunction=n;const c=this._gl,u=this._getTextureTarget(e),d=this._getSamplingParameters(e.samplingMode,!1);c.texParameteri(u,c.TEXTURE_MAG_FILTER,d.mag),c.texParameteri(u,c.TEXTURE_MIN_FILTER,d.min),c.texParameteri(u,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(u,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),this.webGLVersion>1&&(n===0?(c.texParameteri(u,c.TEXTURE_COMPARE_FUNC,515),c.texParameteri(u,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(u,c.TEXTURE_COMPARE_FUNC,n),c.texParameteri(u,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE)))}_uploadCompressedDataToTextureDirectly(e,t,i,s,n,r=0,o=0){const l=this._gl;let h=l.TEXTURE_2D;if(e.isCube&&(h=l.TEXTURE_CUBE_MAP_POSITIVE_X+r),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=l.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 33776:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1;break}this._gl.compressedTexImage2D(h,o,t,i,s,0,n)}_uploadDataToTextureDirectly(e,t,i=0,s=0,n,r=!1){const o=this._gl,l=this._getWebGLTextureType(e.type),h=this._getInternalFormat(e.format),c=n===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(n,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=o.TEXTURE_2D;e.isCube&&(u=o.TEXTURE_CUBE_MAP_POSITIVE_X+i);const d=Math.round(Math.log(e.width)*Math.LOG2E),_=Math.round(Math.log(e.height)*Math.LOG2E),f=r?e.width:Math.pow(2,Math.max(d-s,0)),g=r?e.height:Math.pow(2,Math.max(_-s,0));o.texImage2D(u,s,c,f,g,0,h,l,t)}updateTextureData(e,t,i,s,n,r,o=0,l=0,h=!1){const c=this._gl,u=this._getWebGLTextureType(e.type),d=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let _=c.TEXTURE_2D,f=c.TEXTURE_2D;e.isCube&&(f=c.TEXTURE_CUBE_MAP_POSITIVE_X+o,_=c.TEXTURE_CUBE_MAP),this._bindTextureDirectly(_,e,!0),c.texSubImage2D(f,l,i,s,n,r,d,u,t),h&&this._gl.generateMipmap(f),this._bindTextureDirectly(_,null)}_uploadArrayBufferViewToTexture(e,t,i=0,s=0){const n=this._gl,r=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(r,e,!0),this._uploadDataToTextureDirectly(e,t,i,s),this._bindTextureDirectly(r,null,!0)}_prepareWebGLTextureContinuation(e,t,i,s,n){const r=this._gl;if(!r)return;const o=this._getSamplingParameters(n,!i);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,o.mag),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,o.min),!i&&!s&&r.generateMipmap(r.TEXTURE_2D),this._bindTextureDirectly(r.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,s,n,r,o,l,h=3){const c=this.getCaps().maxTextureSize,u=Math.min(c,this.needPOTTextures?Ee.GetExponentOfTwo(s.width,c):s.width),d=Math.min(c,this.needPOTTextures?Ee.GetExponentOfTwo(s.height,c):s.height),_=this._gl;if(_){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(_.TEXTURE_2D,e,!0),this._unpackFlipY(n===void 0?!0:!!n),e.baseWidth=s.width,e.baseHeight=s.height,e.width=u,e.height=d,e.isReady=!0,!l(u,d,s,t,e,()=>{this._prepareWebGLTextureContinuation(e,i,r,o,h)})&&this._prepareWebGLTextureContinuation(e,i,r,o,h)}}_setupFramebufferDepthAttachments(e,t,i,s,n=1){const r=this._gl;if(e&&t)return this._createRenderBuffer(i,s,n,r.DEPTH_STENCIL,r.DEPTH24_STENCIL8,r.DEPTH_STENCIL_ATTACHMENT);if(t){let o=r.DEPTH_COMPONENT16;return this._webGLVersion>1&&(o=r.DEPTH_COMPONENT32F),this._createRenderBuffer(i,s,n,o,o,r.DEPTH_ATTACHMENT)}return e?this._createRenderBuffer(i,s,n,r.STENCIL_INDEX8,r.STENCIL_INDEX8,r.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,s,n,r,o=!0){const h=this._gl.createRenderbuffer();return this._updateRenderBuffer(h,e,t,i,s,n,r,o)}_updateRenderBuffer(e,t,i,s,n,r,o,l=!0){const h=this._gl;return h.bindRenderbuffer(h.RENDERBUFFER,e),s>1&&h.renderbufferStorageMultisample?h.renderbufferStorageMultisample(h.RENDERBUFFER,s,r,t,i):h.renderbufferStorage(h.RENDERBUFFER,n,t,i),h.framebufferRenderbuffer(h.FRAMEBUFFER,o,h.RENDERBUFFER,e),l&&h.bindRenderbuffer(h.RENDERBUFFER,null),e}_releaseTexture(e){var t;this._deleteTexture((t=e._hardwareTexture)===null||t===void 0?void 0:t.underlyingResource),this.unbindAllTextures();const i=this._internalTexturesCache.indexOf(e);i!==-1&&this._internalTexturesCache.splice(i,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_releaseRenderTargetWrapper(e){const t=this._renderTargetWrapperCache.indexOf(e);t!==-1&&this._renderTargetWrapperCache.splice(t,1)}_deleteTexture(e){e&&this._gl.deleteTexture(e)}_setProgram(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let s=0;s-1;if(i&&l&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw console.error(e,t),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,(r=(n=t==null?void 0:t._hardwareTexture)===null||n===void 0?void 0:n.underlyingResource)!==null&&r!==void 0?r:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(o=!0,this._activateCurrentTexture());return l&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),o}_bindTexture(e,t,i){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const s=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(s,t)}unbindAllTextures(){for(let e=0;e1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){const i=this._boundUniforms[e];!i||i._currentState===t||(this._gl.uniform1i(i,t),i._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,i=!1,s=!1,n=""){if(!t)return this._boundTexturesCache[e]!=null&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===4)return t.delayLoad(),!1;let r;s?r=t.depthStencilTexture:t.isReady()?r=t.getInternalTexture():t.isCube?r=this.emptyCubeTexture:t.is3D?r=this.emptyTexture3D:t.is2DArray?r=this.emptyTexture2DArray:r=this.emptyTexture,!i&&r&&(r._associatedChannel=e);let o=!0;this._boundTexturesCache[e]===r&&(i||this._bindSamplerUniformToChannel(r._associatedChannel,e),o=!1),this._activeChannel=e;const l=this._getTextureTarget(r);if(o&&this._bindTextureDirectly(l,r,i),r&&!r.isMultiview){if(r.isCube&&r._cachedCoordinatesMode!==t.coordinatesMode){r._cachedCoordinatesMode=t.coordinatesMode;const h=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=h,t.wrapV=h}r._cachedWrapU!==t.wrapU&&(r._cachedWrapU=t.wrapU,this._setTextureParameterInteger(l,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),r)),r._cachedWrapV!==t.wrapV&&(r._cachedWrapV=t.wrapV,this._setTextureParameterInteger(l,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),r)),r.is3D&&r._cachedWrapR!==t.wrapR&&(r._cachedWrapR=t.wrapR,this._setTextureParameterInteger(l,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),r)),this._setAnisotropicLevel(l,r,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,s){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==i.length)&&(this._textureUnits=new Int32Array(i.length));for(let n=0;n=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e].getPipelineContext();this._deletePipelineContext(t)}this._compiledEffects={}}dispose(){var e;this._isDisposed=!0,this.stopRenderLoop(),this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.releaseEffects(),(e=this.releaseComputeEffects)===null||e===void 0||e.call(this),this.unbindAllAttributes(),this._boundUniforms={},Pt()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),window.removeEventListener("resize",this._checkForMobile)),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._renderingCanvas=null,this._currentProgram=null,this._boundRenderFunction=null,wt.ResetCache();for(const t of this._activeRequests)t.abort();this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let i=!0;const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);const r=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&r===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const o=t.RGBA,l=t.UNSIGNED_BYTE,h=new Uint8Array(4);t.readPixels(0,0,1,1,o,l,h),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(s),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_getWebGLTextureType(e){if(this._webGLVersion===1){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let i=t?this._gl.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:i=this._gl.RED;break;case 7:i=this._gl.RG;break;case 4:i=t?this._gl.SRGB:this._gl.RGB;break;case 5:i=t?this._gl.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER;break}return i}_getRGBABufferInternalSizedFormat(e,t,i=!1){if(this._webGLVersion===1){if(t!==void 0)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return i?this._gl.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return i?this._gl.SRGB8:this._gl.RGB8;case 5:return i?this._gl.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;case 11:return this._gl.RGBA16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;case 11:return this._gl.RGBA16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;case 11:return this._gl.RGBA32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;case 11:return this._gl.RGBA32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;case 5:return this._gl.RGBA32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;case 5:return this._gl.RGBA16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return i?this._gl.SRGB8_ALPHA8:this._gl.RGBA8}_getRGBAMultiSampleBufferFormat(e){return e===1?this._gl.RGBA32F:e===2?this._gl.RGBA16F:this._gl.RGBA8}_loadFile(e,t,i,s,n,r){const o=Ee._FileToolsLoadFile(e,t,i,s,n,r);return this._activeRequests.push(o),o.onCompleteObservable.add(l=>{this._activeRequests.splice(this._activeRequests.indexOf(l),1)}),o}static _FileToolsLoadFile(e,t,i,s,n,r){throw Ae("FileTools")}readPixels(e,t,i,s,n=!0,r=!0){const o=n?4:3,l=n?this._gl.RGBA:this._gl.RGB,h=new Uint8Array(s*i*o);return r&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,s,l,this._gl.UNSIGNED_BYTE,h),Promise.resolve(h)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(this._HasMajorPerformanceCaveat!==null)return!this._HasMajorPerformanceCaveat;if(this._IsSupported===null)try{const e=this._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=t!=null&&!!window.WebGLRenderingContext}catch{this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(this._HasMajorPerformanceCaveat===null)try{const e=this._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch{this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}static CeilingPOT(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}static FloorPOT(e){return e=e|e>>1,e=e|e>>2,e=e|e>>4,e=e|e>>8,e=e|e>>16,e-(e>>1)}static NearestPOT(e){const t=Ee.CeilingPOT(e),i=Ee.FloorPOT(e);return t-e>e-i?i:t}static GetExponentOfTwo(e,t,i=2){let s;switch(i){case 1:s=Ee.FloorPOT(e);break;case 2:s=Ee.NearestPOT(e);break;case 3:default:s=Ee.CeilingPOT(e);break}return Math.min(s,t)}static QueueNewFrame(e,t){if(Pt()){const{requestPostAnimationFrame:i,requestAnimationFrame:s}=t||window;if(typeof i=="function")return i(e);if(typeof s=="function")return s(e)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(e);return setTimeout(e,16)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:kn()?document:null}}Ee.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}];Ee._TextureLoaders=[];Ee.CollisionsEpsilon=.001;Ee._IsSupported=null;Ee._HasMajorPerformanceCaveat=null;class su{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new nu(e)}sampleFrame(e=Pi.Now){if(this._enabled){if(this._lastFrameTimeMs!=null){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){const e=this._rollingFrameTime.history(0);return e===0?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class nu{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){const t=this._samples.length;return(e%t+t)%t}}class Gi{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._lastSecValueCount++}addCount(e,t){Gi.Enabled&&(this._current+=e,t&&this._fetchResult())}beginMonitoring(){Gi.Enabled&&(this._startMonitoringTime=Pi.Now)}endMonitoring(e=!0){if(!Gi.Enabled)return;e&&this.fetchNewFrame();const t=Pi.Now;this._current=t-this._startMonitoringTime,e&&this._fetchResult()}_fetchResult(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;const e=Pi.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}Gi.Enabled=!0;Ee.prototype.setAlphaConstants=function(a,e,t,i){this._alphaState.setAlphaBlendConstants(a,e,t,i)};Ee.prototype.setAlphaMode=function(a,e=!1){if(this._alphaMode===a){if(!e){const t=a===0;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}switch(a){case 0:this._alphaState.alphaBlend=!1;break;case 7:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 8:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 2:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 6:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 1:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 3:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 4:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 5:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 9:this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR,this._gl.ONE_MINUS_CONSTANT_COLOR,this._gl.CONSTANT_ALPHA,this._gl.ONE_MINUS_CONSTANT_ALPHA),this._alphaState.alphaBlend=!0;break;case 10:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 11:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 12:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case 13:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE_MINUS_DST_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 14:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 15:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case 16:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 17:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break}e||(this.depthCullingState.depthMask=a===0),this._alphaMode=a};Ee.prototype.getAlphaMode=function(){return this._alphaMode};Ee.prototype.setAlphaEquation=function(a){if(this._alphaEquation!==a){switch(a){case 0:this._alphaState.setAlphaEquationParameters(32774,32774);break;case 1:this._alphaState.setAlphaEquationParameters(32778,32778);break;case 2:this._alphaState.setAlphaEquationParameters(32779,32779);break;case 3:this._alphaState.setAlphaEquationParameters(32776,32776);break;case 4:this._alphaState.setAlphaEquationParameters(32775,32775);break;case 5:this._alphaState.setAlphaEquationParameters(32775,32774);break}this._alphaEquation=a}};Ee.prototype.getAlphaEquation=function(){return this._alphaEquation};function Fa(a,e,t=!1,i){switch(a){case 3:{const n=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e);return i&&n.set(new Int8Array(i)),n}case 0:{const n=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return i&&n.set(new Uint8Array(i)),n}case 4:{const n=e instanceof ArrayBuffer?new Int16Array(e):new Int16Array(t?e/2:e);return i&&n.set(new Int16Array(i)),n}case 5:case 8:case 9:case 10:case 2:{const n=e instanceof ArrayBuffer?new Uint16Array(e):new Uint16Array(t?e/2:e);return i&&n.set(new Uint16Array(i)),n}case 6:{const n=e instanceof ArrayBuffer?new Int32Array(e):new Int32Array(t?e/4:e);return i&&n.set(new Int32Array(i)),n}case 7:case 11:case 12:case 13:case 14:case 15:{const n=e instanceof ArrayBuffer?new Uint32Array(e):new Uint32Array(t?e/4:e);return i&&n.set(new Uint32Array(i)),n}case 1:{const n=e instanceof ArrayBuffer?new Float32Array(e):new Float32Array(t?e/4:e);return i&&n.set(new Float32Array(i)),n}}const s=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return i&&s.set(new Uint8Array(i)),s}Ee.prototype._readTexturePixelsSync=function(a,e,t,i=-1,s=0,n=null,r=!0,o=!1,l=0,h=0){var c,u;const d=this._gl;if(!d)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const f=d.createFramebuffer();if(!f)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=f}d.bindFramebuffer(d.FRAMEBUFFER,this._dummyFramebuffer),i>-1?d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+i,(c=a._hardwareTexture)===null||c===void 0?void 0:c.underlyingResource,s):d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,(u=a._hardwareTexture)===null||u===void 0?void 0:u.underlyingResource,s);let _=a.type!==void 0?this._getWebGLTextureType(a.type):d.UNSIGNED_BYTE;if(o)n||(n=Fa(a.type,4*e*t));else switch(_){case d.UNSIGNED_BYTE:n||(n=new Uint8Array(4*e*t)),_=d.UNSIGNED_BYTE;break;default:n||(n=new Float32Array(4*e*t)),_=d.FLOAT;break}return r&&this.flushFramebuffer(),d.readPixels(l,h,e,t,d.RGBA,_,n),d.bindFramebuffer(d.FRAMEBUFFER,this._currentFramebuffer),n};Ee.prototype._readTexturePixels=function(a,e,t,i=-1,s=0,n=null,r=!0,o=!1,l=0,h=0){return Promise.resolve(this._readTexturePixelsSync(a,e,t,i,s,n,r,o,l,h))};Ee.prototype.updateDynamicIndexBuffer=function(a,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(a);let i;a.is32Bits?i=e instanceof Uint32Array?e:new Uint32Array(e):i=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()};Ee.prototype.updateDynamicVertexBuffer=function(a,e,t,i){this.bindArrayBuffer(a),t===void 0&&(t=0);const s=e.byteLength||e.length;i===void 0||i>=s&&t===0?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,new Float32Array(e).subarray(t,t+i)):(e instanceof ArrayBuffer?e=new Uint8Array(e,t,i):e=new Uint8Array(e.buffer,e.byteOffset+t,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)),this._resetVertexBufferBinding()};class Y extends Ee{static get NpmPackage(){return Ee.NpmPackage}static get Version(){return Ee.Version}static get Instances(){return Ie.Instances}static get LastCreatedEngine(){return Ie.LastCreatedEngine}static get LastCreatedScene(){return Ie.LastCreatedScene}_createImageBitmapFromSource(e,t){return new Promise((s,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{this.createImageBitmap(r,t).then(o=>{s(o)})})},r.onerror=()=>{n("Error loading image ".concat(r.src))},r.src=e})}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){const n=this.createCanvas(t,i).getContext("2d");if(!n)throw new Error("Unable to get 2d context for resizeImageBitmap");return n.drawImage(e,0,0),n.getImageData(0,0,t,i).data}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i{this.onCanvasFocusObservable.notifyObservers(this)},this._onCanvasBlur=()=>{this.onCanvasBlurObservable.notifyObservers(this)},this._onCanvasContextMenu=i=>{this.disableContextMenu&&i.preventDefault()},e.addEventListener("focus",this._onCanvasFocus),e.addEventListener("blur",this._onCanvasBlur),e.addEventListener("contextmenu",this._onCanvasContextMenu),this._onBlur=()=>{this.disablePerformanceMonitorInBackground&&this._performanceMonitor.disable(),this._windowIsBackground=!0},this._onFocus=()=>{this.disablePerformanceMonitorInBackground&&this._performanceMonitor.enable(),this._windowIsBackground=!1},this._onCanvasPointerOut=i=>{document.elementFromPoint(i.clientX,i.clientY)!==e&&this.onCanvasPointerOutObservable.notifyObservers(i)};const t=this.getHostWindow();t&&typeof t.addEventListener=="function"&&(t.addEventListener("blur",this._onBlur),t.addEventListener("focus",this._onFocus)),e.addEventListener("pointerout",this._onCanvasPointerOut),this._creationOptions.doNotHandleTouchAction||this._disableTouchAction(),!Y.audioEngine&&this._creationOptions.audioEngine&&Y.AudioEngineFactory&&(Y.audioEngine=Y.AudioEngineFactory(this.getRenderingCanvas(),this.getAudioContext(),this.getAudioDestination())),kn()&&(this._onFullscreenChange=()=>{this.isFullscreen=!!document.fullscreenElement,this.isFullscreen&&this._pointerLockRequested&&e&&Y._RequestPointerlock(e)},document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),this._onPointerLockChange=()=>{this.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",this._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",this._onPointerLockChange,!1)),this.enableOfflineSupport=Y.OfflineProviderFactory!==void 0,this._deterministicLockstep=!!this._creationOptions.deterministicLockstep,this._lockstepMaxSteps=this._creationOptions.lockstepMaxSteps||0,this._timeStep=this._creationOptions.timeStep||1/60}_verifyPointerLock(){var e;(e=this._onPointerLockChange)===null||e===void 0||e.call(this)}getAspectRatio(e,t=!1){const i=e.viewport;return this.getRenderWidth(t)*i.width/(this.getRenderHeight(t)*i.height)}getScreenAspectRatio(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)}getRenderingCanvasClientRect(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null}getInputElementClientRect(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}generateMipMapsForCubemap(e,t=!0){if(e.generateMipMaps){const i=this._gl;this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,e,!0),i.generateMipmap(i.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)}}getDepthWrite(){return this._depthCullingState.depthMask}setDepthWrite(e){this._depthCullingState.depthMask=e}getStencilBuffer(){return this._stencilState.stencilTest}setStencilBuffer(e){this._stencilState.stencilTest=e}getStencilMask(){return this._stencilState.stencilMask}setStencilMask(e){this._stencilState.stencilMask=e}getStencilFunction(){return this._stencilState.stencilFunc}getStencilFunctionReference(){return this._stencilState.stencilFuncRef}getStencilFunctionMask(){return this._stencilState.stencilFuncMask}setStencilFunction(e){this._stencilState.stencilFunc=e}setStencilFunctionReference(e){this._stencilState.stencilFuncRef=e}setStencilFunctionMask(e){this._stencilState.stencilFuncMask=e}getStencilOperationFail(){return this._stencilState.stencilOpStencilFail}getStencilOperationDepthFail(){return this._stencilState.stencilOpDepthFail}getStencilOperationPass(){return this._stencilState.stencilOpStencilDepthPass}setStencilOperationFail(e){this._stencilState.stencilOpStencilFail=e}setStencilOperationDepthFail(e){this._stencilState.stencilOpDepthFail=e}setStencilOperationPass(e){this._stencilState.stencilOpStencilDepthPass=e}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}getDepthFunction(){return this._depthCullingState.depthFunc}setDepthFunction(e){this._depthCullingState.depthFunc=e}setDepthFunctionToGreater(){this.setDepthFunction(516)}setDepthFunctionToGreaterOrEqual(){this.setDepthFunction(518)}setDepthFunctionToLess(){this.setDepthFunction(513)}setDepthFunctionToLessOrEqual(){this.setDepthFunction(515)}cacheStencilState(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()}restoreStencilState(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)}setDirectViewport(e,t,i,s){const n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,s),n}scissorClear(e,t,i,s,n){this.enableScissor(e,t,i,s),this.clear(n,!0,!0,!0),this.disableScissor()}enableScissor(e,t,i,s){const n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,i,s)}disableScissor(){const e=this._gl;e.disable(e.SCISSOR_TEST)}_reportDrawCall(e=1){this._drawCalls.addCount(e,!1)}initWebVR(){throw Ae("WebVRCamera")}_prepareVRComponent(){}_connectVREvents(e,t){}_submitVRFrame(){}disableVR(){}isVRPresenting(){return!1}_requestVRFrame(){}_loadFileAsync(e,t,i){return new Promise((s,n)=>{this._loadFile(e,r=>{s(r)},void 0,t,i,(r,o)=>{n(o)})})}getVertexShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}setDepthStencilTexture(e,t,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),!i||!i.depthStencilTexture?this._setTexture(e,null,void 0,void 0,s):this._setTexture(e,i,!1,!0,s))}setTextureFromPostProcess(e,t,i){var s;let n=null;t&&(t._textures.data[t._currentRenderTextureInd]?n=t._textures.data[t._currentRenderTextureInd]:t._forcedOutputTexture&&(n=t._forcedOutputTexture)),this._bindTexture(e,(s=n==null?void 0:n.texture)!==null&&s!==void 0?s:null,i)}setTextureFromPostProcessOutput(e,t,i){var s,n;this._bindTexture(e,(n=(s=t==null?void 0:t._outputTexture)===null||s===void 0?void 0:s.texture)!==null&&n!==void 0?n:null,i)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries(),e._rebuildTextures();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries(),e._rebuildTextures();super._rebuildBuffers()}_renderFrame(){for(let e=0;e0?this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this.isVRPresenting()?this._requestVRFrame():this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1}_renderViews(){return!1}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&Y._RequestFullscreen(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&Y._ExitFullscreen()}enterPointerlock(){this._renderingCanvas&&Y._RequestPointerlock(this._renderingCanvas)}exitPointerlock(){Y._ExitPointerlock()}beginFrame(){this._measureFps(),this.onBeginFrameObservable.notifyObservers(this),super.beginFrame()}endFrame(){super.endFrame(),this._submitVRFrame(),this.onEndFrameObservable.notifyObservers(this)}resize(e=!1){this.isVRPresenting()||super.resize(e)}setSize(e,t,i=!1){if(!this._renderingCanvas||!super.setSize(e,t,i))return!1;if(this.scenes){for(let s=0;s1&&n){const o=this.createTransformFeedback();this.bindTransformFeedback(o),this.setTranformFeedbackVaryings(r,n),e.transformFeedback=o}return s.linkProgram(r),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),r}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e),this.scenes.forEach(t=>{t.postProcesses.forEach(i=>{i._outputTexture===e&&(i._outputTexture=null)}),t.cameras.forEach(i=>{i._postProcesses.forEach(s=>{s&&s._outputTexture===e&&(s._outputTexture=null)})})})}getRenderPassNames(){return this._renderPassNames}getCurrentRenderPassName(){return this._renderPassNames[this.currentRenderPassId]}createRenderPassId(e){const t=++Y._RenderPassIdCounter;return this._renderPassNames[t]=e!=null?e:"NONAME",t}releaseRenderPassId(e){this._renderPassNames[e]=void 0;for(let t=0;t{this._rescalePostProcess.onApply=function(l){l._bindTexture("textureSampler",e)};let o=i;o||(o=this.scenes[this.scenes.length-1]),o.postProcessManager.directRender([this._rescalePostProcess],r,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,s,0,0,t.width,t.height,0),this.unBindFramebuffer(r),r.dispose(),n&&n()}))}getFps(){return this._fps}getDeltaTime(){return this._deltaTime}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}wrapWebGLTexture(e,t=!1,i=3){const s=new dl(e,this._gl),n=new Dt(this,ze.Unknown,!0);return n._hardwareTexture=s,n.isReady=!0,n.useMipMaps=t,this.updateTextureSamplingMode(i,n),n}_uploadImageToTexture(e,t,i=0,s=0){const n=this._gl,r=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format),l=this._getRGBABufferInternalSizedFormat(e.type,o),h=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(h,e,!0),this._unpackFlipY(e.invertY);let c=n.TEXTURE_2D;e.isCube&&(c=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(c,s,l,o,r,t),this._bindTextureDirectly(h,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){H.Error("WebGL 1 does not support texture comparison.");return}const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const i=new Vn(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}_clientWaitAsync(e,t=0,i=10){const s=this._gl;return new Promise((n,r)=>{const o=()=>{const l=s.clientWaitSync(e,t,0);if(l==s.WAIT_FAILED){r();return}if(l==s.TIMEOUT_EXPIRED){setTimeout(o,i);return}n()};o()})}_readPixelsAsync(e,t,i,s,n,r,o){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const l=this._gl,h=l.createBuffer();l.bindBuffer(l.PIXEL_PACK_BUFFER,h),l.bufferData(l.PIXEL_PACK_BUFFER,o.byteLength,l.STREAM_READ),l.readPixels(e,t,i,s,n,r,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);const c=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);return c?(l.flush(),this._clientWaitAsync(c,0,10).then(()=>(l.deleteSync(c),l.bindBuffer(l.PIXEL_PACK_BUFFER,h),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,o),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.deleteBuffer(h),o))):null}dispose(){for(this.hideLoadingUI(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();Ie.Instances.length===1&&Y.audioEngine&&(Y.audioEngine.dispose(),Y.audioEngine=null),this.disableVR();const e=this.getHostWindow();e&&typeof e.removeEventListener=="function"&&(e.removeEventListener("blur",this._onBlur),e.removeEventListener("focus",this._onFocus)),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut),this._renderingCanvas.removeEventListener("contextmenu",this._onCanvasContextMenu)),kn()&&(document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange)),super.dispose();const t=Ie.Instances.indexOf(this);t>=0&&Ie.Instances.splice(t,1),Y.Instances.length||(Ie.OnEnginesDisposedObservable.notifyObservers(this),Ie.OnEnginesDisposedObservable.clear()),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}_disableTouchAction(){!this._renderingCanvas||!this._renderingCanvas.setAttribute||(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.webkitTapHighlightColor="transparent")}displayLoadingUI(){if(!Pt())return;const e=this.loadingScreen;e&&e.displayLoadingUI()}hideLoadingUI(){if(!Pt())return;const e=this._loadingScreen;e&&e.hideLoadingUI()}get loadingScreen(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=Y.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen}set loadingScreen(e){this._loadingScreen=e}set loadingUIText(e){this.loadingScreen.loadingUIText=e}set loadingUIBackgroundColor(e){this.loadingScreen.loadingUIBackgroundColor=e}createVideoElement(e){return document.createElement("video")}static _RequestPointerlock(e){if(e.requestPointerLock){const t=e.requestPointerLock();t instanceof Promise?t.then(()=>{e.focus()}).catch(()=>{}):e.focus()}}static _ExitPointerlock(){document.exitPointerLock&&document.exitPointerLock()}static _RequestFullscreen(e){const t=e.requestFullscreen||e.webkitRequestFullscreen;t&&t.call(e)}static _ExitFullscreen(){const e=document;document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}getFontOffset(e){const t=document.createElement("span");t.innerHTML="Hg",t.setAttribute("style","font: ".concat(e," !important"));const i=document.createElement("div");i.style.display="inline-block",i.style.width="1px",i.style.height="0px",i.style.verticalAlign="bottom";const s=document.createElement("div");s.style.whiteSpace="nowrap",s.appendChild(t),s.appendChild(i),document.body.appendChild(s);let n=0,r=0;try{r=i.getBoundingClientRect().top-t.getBoundingClientRect().top,i.style.verticalAlign="baseline",n=i.getBoundingClientRect().top-t.getBoundingClientRect().top}finally{document.body.removeChild(s)}return{ascent:n,height:r,descent:r-n}}}Y.ALPHA_DISABLE=0;Y.ALPHA_ADD=1;Y.ALPHA_COMBINE=2;Y.ALPHA_SUBTRACT=3;Y.ALPHA_MULTIPLY=4;Y.ALPHA_MAXIMIZED=5;Y.ALPHA_ONEONE=6;Y.ALPHA_PREMULTIPLIED=7;Y.ALPHA_PREMULTIPLIED_PORTERDUFF=8;Y.ALPHA_INTERPOLATE=9;Y.ALPHA_SCREENMODE=10;Y.DELAYLOADSTATE_NONE=0;Y.DELAYLOADSTATE_LOADED=1;Y.DELAYLOADSTATE_LOADING=2;Y.DELAYLOADSTATE_NOTLOADED=4;Y.NEVER=512;Y.ALWAYS=519;Y.LESS=513;Y.EQUAL=514;Y.LEQUAL=515;Y.GREATER=516;Y.GEQUAL=518;Y.NOTEQUAL=517;Y.KEEP=7680;Y.REPLACE=7681;Y.INCR=7682;Y.DECR=7683;Y.INVERT=5386;Y.INCR_WRAP=34055;Y.DECR_WRAP=34056;Y.TEXTURE_CLAMP_ADDRESSMODE=0;Y.TEXTURE_WRAP_ADDRESSMODE=1;Y.TEXTURE_MIRROR_ADDRESSMODE=2;Y.TEXTUREFORMAT_ALPHA=0;Y.TEXTUREFORMAT_LUMINANCE=1;Y.TEXTUREFORMAT_LUMINANCE_ALPHA=2;Y.TEXTUREFORMAT_RGB=4;Y.TEXTUREFORMAT_RGBA=5;Y.TEXTUREFORMAT_RED=6;Y.TEXTUREFORMAT_R=6;Y.TEXTUREFORMAT_RG=7;Y.TEXTUREFORMAT_RED_INTEGER=8;Y.TEXTUREFORMAT_R_INTEGER=8;Y.TEXTUREFORMAT_RG_INTEGER=9;Y.TEXTUREFORMAT_RGB_INTEGER=10;Y.TEXTUREFORMAT_RGBA_INTEGER=11;Y.TEXTURETYPE_UNSIGNED_BYTE=0;Y.TEXTURETYPE_UNSIGNED_INT=0;Y.TEXTURETYPE_FLOAT=1;Y.TEXTURETYPE_HALF_FLOAT=2;Y.TEXTURETYPE_BYTE=3;Y.TEXTURETYPE_SHORT=4;Y.TEXTURETYPE_UNSIGNED_SHORT=5;Y.TEXTURETYPE_INT=6;Y.TEXTURETYPE_UNSIGNED_INTEGER=7;Y.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;Y.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;Y.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;Y.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;Y.TEXTURETYPE_UNSIGNED_INT_24_8=12;Y.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;Y.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;Y.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;Y.TEXTURE_NEAREST_SAMPLINGMODE=1;Y.TEXTURE_BILINEAR_SAMPLINGMODE=2;Y.TEXTURE_TRILINEAR_SAMPLINGMODE=3;Y.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;Y.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;Y.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;Y.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;Y.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;Y.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;Y.TEXTURE_NEAREST_LINEAR=7;Y.TEXTURE_NEAREST_NEAREST=1;Y.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;Y.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;Y.TEXTURE_LINEAR_LINEAR=2;Y.TEXTURE_LINEAR_NEAREST=12;Y.TEXTURE_EXPLICIT_MODE=0;Y.TEXTURE_SPHERICAL_MODE=1;Y.TEXTURE_PLANAR_MODE=2;Y.TEXTURE_CUBIC_MODE=3;Y.TEXTURE_PROJECTION_MODE=4;Y.TEXTURE_SKYBOX_MODE=5;Y.TEXTURE_INVCUBIC_MODE=6;Y.TEXTURE_EQUIRECTANGULAR_MODE=7;Y.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;Y.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;Y.SCALEMODE_FLOOR=1;Y.SCALEMODE_NEAREST=2;Y.SCALEMODE_CEILING=3;Y._RescalePostProcessFactory=null;Y._RenderPassIdCounter=0;class me{static WithinEpsilon(e,t,i=1401298e-51){return Math.abs(e-t)<=i}static ToHex(e){const t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()}static Sign(e){return e=+e,e===0||isNaN(e)?e:e>0?1:-1}static Clamp(e,t=0,i=1){return Math.min(i,Math.max(t,e))}static Log2(e){return Math.log(e)*Math.LOG2E}static ILog2(e){if(Math.log2)return Math.floor(Math.log2(e));if(e<0)return NaN;if(e===0)return-1/0;let t=0;if(e<1){for(;e<1;)t++,e=e*2;t=-t}else if(e>1)for(;e>1;)t++,e=Math.floor(e/2);return t}static Repeat(e,t){return e-Math.floor(e/t)*t}static Normalize(e,t,i){return(e-t)/(i-t)}static Denormalize(e,t,i){return e*(i-t)+t}static DeltaAngle(e,t){let i=me.Repeat(t-e,360);return i>180&&(i-=360),i}static PingPong(e,t){const i=me.Repeat(e,t*2);return t-Math.abs(i-t)}static SmoothStep(e,t,i){let s=me.Clamp(i);return s=-2*s*s*s+3*s*s,t*s+e*(1-s)}static MoveTowards(e,t,i){let s=0;return Math.abs(t-e)<=i?s=t:s=e+me.Sign(t-e)*i,s}static MoveTowardsAngle(e,t,i){const s=me.DeltaAngle(e,t);let n=0;return-i180&&(s-=360),e+s*me.Clamp(i)}static InverseLerp(e,t,i){let s=0;return e!=t?s=me.Clamp((i-e)/(t-e)):s=0,s}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,l=2*o-3*r+1,h=-2*o+3*r,c=o-2*r+n,u=o-r;return e*l+i*h+t*c+s*u}static Hermite1stDerivative(e,t,i,s,n){const r=n*n;return(r-n)*6*e+(3*r-4*n+1)*t+(-r+n)*6*i+(3*r-2*n)*s}static RandomRange(e,t){return e===t?e:Math.random()*(t-e)+e}static RangeToPercent(e,t,i){return(e-t)/(i-t)}static PercentToRange(e,t,i){return(i-t)*e+t}static NormalizeRadians(e){return e-=me.TwoPi*Math.floor((e+Math.PI)/me.TwoPi),e}static HCF(e,t){const i=e%t;return i===0?t:me.HCF(t,i)}}me.TwoPi=Math.PI*2;const ru=1/2.2,au=2.2,xt=(1+Math.sqrt(5))/2,Ge=.001;class kt{static BuildArray(e,t){const i=[];for(let s=0;s{const n=s.previous;if(!n)return;const r=s.next;r?(n.next=r,r.previous=n):(n.next=void 0,a[e]=n),s.next=void 0,s.previous=void 0}}const lu=["push","splice","pop","shift","unshift"];function _l(a,e){const t=lu.map(i=>ou(a,i,e));return()=>{t.forEach(i=>{i==null||i()})}}const pl={};function Vt(a,e){pl[a]=e}function $s(a){return pl[a]}const hi=a=>parseInt(a.toString().replace(/\W/g,""));class fe{constructor(e=0,t=0){this.x=e,this.y=t}toString(){return"{X: ".concat(this.x," Y: ").concat(this.y,"}")}getClassName(){return"Vector2"}getHashCode(){const e=hi(this.x),t=hi(this.y);let i=e;return i=i*397^t,i}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return fe.FromArrayToRef(e,t,this),this}asArray(){const e=new Array;return this.toArray(e,0),e}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){return this.x=e,this.y=t,this}set(e,t){return this.copyFromFloats(e,t)}add(e){return new this.constructor(this.x+e.x,this.y+e.y)}addToRef(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addVector3(e){return new this.constructor(this.x+e.x,this.y+e.y)}subtract(e){return new this.constructor(this.x-e.x,this.y-e.y)}subtractToRef(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new this.constructor(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){return new this.constructor(this.x*e,this.y*t)}divide(e){return new this.constructor(this.x/e.x,this.y/e.y)}divideToRef(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){return this.divideToRef(e,this)}negate(){return new this.constructor(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.copyFromFloats(this.x*-1,this.y*-1)}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){const t=new this.constructor(0,0);return this.scaleToRef(e,t),t}scaleToRef(e,t){return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=Ge){return e&&me.WithinEpsilon(this.x,e.x,t)&&me.WithinEpsilon(this.y,e.y,t)}floor(){return new this.constructor(Math.floor(this.x),Math.floor(this.y))}fract(){return new this.constructor(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}rotateToRef(e,t){const i=Math.cos(e),s=Math.sin(e),n=i*this.x-s*this.y,r=s*this.x+i*this.y;return t.x=n,t.y=r,t}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return fe.NormalizeToRef(this,this),this}clone(){return new this.constructor(this.x,this.y)}static Zero(){return new fe(0,0)}static One(){return new fe(1,1)}static Random(e=0,t=1){return new fe(me.RandomRange(e,t),me.RandomRange(e,t))}static get ZeroReadOnly(){return fe._ZeroReadOnly}static FromArray(e,t=0){return new fe(e[t],e[t+1])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i}static CatmullRom(e,t,i,s,n){const r=n*n,o=n*r,l=.5*(2*t.x+(-e.x+i.x)*n+(2*e.x-5*t.x+4*i.x-s.x)*r+(-e.x+3*t.x-3*i.x+s.x)*o),h=.5*(2*t.y+(-e.y+i.y)*n+(2*e.y-5*t.y+4*i.y-s.y)*r+(-e.y+3*t.y-3*i.y+s.y)*o);return new e.constructor(l,h)}static Clamp(e,t,i){let s=e.x;s=s>i.x?i.x:s,s=si.y?i.y:n,n=nt.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new e.constructor(i,s)}static Transform(e,t){const i=new e.constructor;return fe.TransformToRef(e,t,i),i}static TransformToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+s[12],r=e.x*s[1]+e.y*s[5]+s[13];return i.x=n,i.y=r,i}static PointInTriangle(e,t,i,s){const n=.5*(-i.y*s.x+t.y*(-i.x+s.x)+t.x*(i.y-s.y)+i.x*s.y),r=n<0?-1:1,o=(t.y*s.x-t.x*s.y+(s.y-t.y)*e.x+(t.x-s.x)*e.y)*r,l=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*r;return o>0&&l>0&&o+l<2*n*r}static Distance(e,t){return Math.sqrt(fe.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y;return i*i+s*s}static Center(e,t){const i=new e.constructor;return fe.CenterToRef(e,t,i)}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){const s=fe.DistanceSquared(t,i);if(s===0)return fe.Distance(e,t);const n=i.subtract(t),r=Math.max(0,Math.min(1,fe.Dot(e.subtract(t),n)/s)),o=t.add(n.multiplyByFloats(r,r));return fe.Distance(e,o)}}fe._ZeroReadOnly=fe.Zero();class v{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,t=0,i=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z,"}")}getClassName(){return"Vector3"}getHashCode(){const e=hi(this._x),t=hi(this._y),i=hi(this._z);let s=e;return s=s*397^t,s=s*397^i,s}asArray(){const e=[];return this.toArray(e,0),e}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){return v.FromArrayToRef(e,t,this),this}toQuaternion(){return ue.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)}addInPlaceFromFloats(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new this.constructor(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new this.constructor(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,i){return new this.constructor(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,s){return s.copyFromFloats(this._x-e,this._y-t,this._z-i)}negate(){return new this.constructor(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e.copyFromFloats(this._x*-1,this._y*-1,this._z*-1)}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new this.constructor(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)}getNormalToRef(e){const t=this.length();let i=Math.acos(this.y/t);const s=Math.atan2(this.z,this.x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const n=t*Math.sin(i)*Math.cos(s),r=t*Math.cos(i),o=t*Math.sin(i)*Math.sin(s);return e.set(n,r,o),e}applyRotationQuaternionToRef(e,t){const i=e._w*this._x+e._y*this._z-e._z*this._y,s=e._w*this._y+e._z*this._x-e._x*this._z,n=e._w*this._z+e._x*this._y-e._y*this._x,r=-e._x*this._x-e._y*this._y-e._z*this._z;return t._x=i*e._w+r*-e._x+s*-e._z-n*-e._y,t._y=s*e._w+r*-e._y+n*-e._x-i*-e._z,t._z=n*e._w+r*-e._z+i*-e._y-s*-e._x,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new this.constructor)}scaleAndAddToRef(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)}projectOnPlane(e,t){const i=new this.constructor;return this.projectOnPlaneToRef(e,t,i),i}projectOnPlaneToRef(e,t,i){const s=e.normal,n=e.d,r=_e.Vector3[0];this.subtractToRef(t,r),r.normalize();const o=v.Dot(r,s);if(Math.abs(o)this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),i=Math.abs(this._y);if(!me.WithinEpsilon(t,i,e))return!0;const s=Math.abs(this._z);return!me.WithinEpsilon(t,s,e)||!me.WithinEpsilon(i,s,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const i=Math.abs(this._z);return e!==i}floor(){return new this.constructor(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fract(){return new this.constructor(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){return e=e.toLowerCase(),e==="xyz"?this:(_e.Vector3[0].copyFrom(this),["x","y","z"].forEach((t,i)=>{this[t]=_e.Vector3[0][e[i]]}),this)}rotateByQuaternionToRef(e,t){return e.toRotationMatrix(_e.Matrix[0]),v.TransformCoordinatesToRef(this,_e.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){return this.subtractToRef(t,_e.Vector3[0]),_e.Vector3[0].rotateByQuaternionToRef(e,_e.Vector3[0]),t.addToRef(_e.Vector3[0],i),i}cross(e){const t=new this.constructor;return v.CrossToRef(this,e,t)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new this.constructor(0,0,0);return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)}clone(){return new this.constructor(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,s){const n=v.Dot(e,i)-s,r=v.Dot(t,i)-s;return n/(n-r)}static GetAngleBetweenVectors(e,t,i){const s=e.normalizeToRef(_e.Vector3[1]),n=t.normalizeToRef(_e.Vector3[2]);let r=v.Dot(s,n);r=me.Clamp(r,-1,1);const o=Math.acos(r),l=_e.Vector3[3];return v.CrossToRef(s,n,l),v.Dot(l,i)>0?isNaN(o)?0:o:isNaN(o)?-Math.PI:-Math.acos(r)}static GetAngleBetweenVectorsOnPlane(e,t,i){_e.Vector3[0].copyFrom(e);const s=_e.Vector3[0];_e.Vector3[1].copyFrom(t);const n=_e.Vector3[1];_e.Vector3[2].copyFrom(i);const r=_e.Vector3[2],o=_e.Vector3[3],l=_e.Vector3[4];s.normalize(),n.normalize(),r.normalize(),v.CrossToRef(r,s,o),v.CrossToRef(o,r,l);const h=Math.atan2(v.Dot(n,o),v.Dot(n,l));return me.NormalizeRadians(h)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=G.Vector3[0];return t.subtractToRef(e,s),i._y=Math.atan2(s.x,s.z)||0,i._x=Math.atan2(Math.sqrt(s.x**2+s.z**2),s.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){const i=v.Zero();return v.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,s){i=me.Clamp(i,0,1);const n=_e.Vector3[0],r=_e.Vector3[1];n.copyFrom(e);const o=n.length();n.normalizeFromLength(o),r.copyFrom(t);const l=r.length();r.normalizeFromLength(l);const h=v.Dot(n,r);let c,u;if(h<1-Ge){const d=Math.acos(h),_=1/Math.sin(d);c=Math.sin((1-i)*d)*_,u=Math.sin(i*d)*_}else c=1-i,u=i;return n.scaleInPlace(c),r.scaleInPlace(u),s.copyFrom(n).addInPlace(r),s.scaleInPlace(me.Lerp(o,l,i)),s}static SmoothToRef(e,t,i,s,n){return v.SlerpToRef(e,t,s===0?1:i/s,n),n}static FromArray(e,t=0){return new v(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return v.FromArray(e,t)}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){return v.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,s){return s.copyFromFloats(e,t,i),s}static Zero(){return new v(0,0,0)}static One(){return new v(1,1,1)}static Up(){return new v(0,1,0)}static get UpReadOnly(){return v._UpReadOnly}static get DownReadOnly(){return v._DownReadOnly}static get RightReadOnly(){return v._RightReadOnly}static get LeftReadOnly(){return v._LeftReadOnly}static get LeftHandedForwardReadOnly(){return v._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return v._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return v._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return v._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return v._ZeroReadOnly}static Down(){return new v(0,-1,0)}static Forward(e=!1){return new v(0,0,e?-1:1)}static Backward(e=!1){return new v(0,0,e?1:-1)}static Right(){return new v(1,0,0)}static Left(){return new v(-1,0,0)}static Random(e=0,t=1){return new v(me.RandomRange(e,t),me.RandomRange(e,t),me.RandomRange(e,t))}static TransformCoordinates(e,t){const i=v.Zero();return v.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return v.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const r=s.m,o=e*r[0]+t*r[4]+i*r[8]+r[12],l=e*r[1]+t*r[5]+i*r[9]+r[13],h=e*r[2]+t*r[6]+i*r[10]+r[14],c=1/(e*r[3]+t*r[7]+i*r[11]+r[15]);return n._x=o*c,n._y=l*c,n._z=h*c,n._isDirty=!0,n}static TransformNormal(e,t){const i=v.Zero();return v.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,s,n){const r=s.m;return n._x=e*r[0]+t*r[4]+i*r[8],n._y=e*r[1]+t*r[5]+i*r[9],n._z=e*r[2]+t*r[6]+i*r[10],n._isDirty=!0,n}static CatmullRom(e,t,i,s,n){const r=n*n,o=n*r,l=.5*(2*t._x+(-e._x+i._x)*n+(2*e._x-5*t._x+4*i._x-s._x)*r+(-e._x+3*t._x-3*i._x+s._x)*o),h=.5*(2*t._y+(-e._y+i._y)*n+(2*e._y-5*t._y+4*i._y-s._y)*r+(-e._y+3*t._y-3*i._y+s._y)*o),c=.5*(2*t._z+(-e._z+i._z)*n+(2*e._z-5*t._z+4*i._z-s._z)*r+(-e._z+3*t._z-3*i._z+s._z)*o);return new e.constructor(l,h,c)}static Clamp(e,t,i){const s=new e.constructor;return v.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){let n=e._x;n=n>i._x?i._x:n,n=ni._y?i._y:r,r=ri._z?i._z:o,o=o0&&R<0?(D.copyFrom(r),W=t,L=i):R>0&&w<0?(D.copyFrom(l),W=i,L=s):(D.copyFrom(o).scaleInPlace(-1),W=s,L=t);const z=_e.Vector3[9],K=_e.Vector3[4];if(W.subtractToRef(m,y),L.subtractToRef(m,z),v.CrossToRef(y,z,K),!(v.Dot(K,h)<0))return n.copyFrom(m),Math.abs(g*p);const $=_e.Vector3[5];v.CrossToRef(D,K,$),$.normalize();const U=_e.Vector3[9];U.copyFrom(W).subtractInPlace(m);const V=U.length();if(Vthis.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this}floor(){return new this.constructor(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))}fract(){return new this.constructor(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}normalize(){const e=this.length();return e===0?this:this.scaleInPlace(1/e)}toVector3(){return new v(this.x,this.y,this.z)}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.x=this.y=this.z=this.w=e,this}static FromArray(e,t){return t||(t=0),new Ye(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){return Ye.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,s,n){return n.x=e,n.y=t,n.z=i,n.w=s,n}static Zero(){return new Ye(0,0,0,0)}static One(){return new Ye(1,1,1,1)}static Random(e=0,t=1){return new Ye(me.RandomRange(e,t),me.RandomRange(e,t),me.RandomRange(e,t),me.RandomRange(e,t))}static get ZeroReadOnly(){return Ye._ZeroReadOnly}static Normalize(e){const t=Ye.Zero();return Ye.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return t.copyFrom(e),t.normalize(),t}static Minimize(e,t){const i=new e.constructor;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new e.constructor;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(Ye.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,r=e.w-t.w;return i*i+s*s+n*n+r*r}static Center(e,t){return Ye.CenterToRef(e,t,Ye.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}static TransformCoordinates(e,t){const i=Ye.Zero();return Ye.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return Ye.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const r=s.m,o=e*r[0]+t*r[4]+i*r[8]+r[12],l=e*r[1]+t*r[5]+i*r[9]+r[13],h=e*r[2]+t*r[6]+i*r[10]+r[14],c=e*r[3]+t*r[7]+i*r[11]+r[15];return n.x=o,n.y=l,n.z=h,n.w=c,n}static TransformNormal(e,t){const i=new e.constructor;return Ye.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+e.z*s[8],r=e.x*s[1]+e.y*s[5]+e.z*s[9],o=e.x*s[2]+e.y*s[6]+e.z*s[10];return i.x=n,i.y=r,i.z=o,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,s,n,r){const o=n.m;return r.x=e*o[0]+t*o[4]+i*o[8],r.y=e*o[1]+t*o[5]+i*o[9],r.z=e*o[2]+t*o[6]+i*o[10],r.w=s,r}static FromVector3(e,t=0){return new Ye(e._x,e._y,e._z,t)}}Ye._ZeroReadOnly=Ye.Zero();class ue{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=1){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z," W: ").concat(this._w,"}")}getClassName(){return"Quaternion"}getHashCode(){const e=hi(this._x),t=hi(this._y),i=hi(this._z),s=hi(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=Ge){return e&&me.WithinEpsilon(this._x,e._x,t)&&me.WithinEpsilon(this._y,e._y,t)&&me.WithinEpsilon(this._z,e._z,t)&&me.WithinEpsilon(this._w,e._w,t)}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._isDirty=!0,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}add(e){return new this.constructor(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}subtract(e){return new this.constructor(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new this.constructor(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){const t=new this.constructor(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,s=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,n=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,r=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,s,n,r),t}multiplyInPlace(e){return this.multiplyToRef(e,this),this}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new this.constructor(-this._x,-this._y,-this._z,this._w)}invert(){const e=this.conjugate(),t=this.lengthSquared();return t==0||t==1||e.scaleInPlace(1/t),e}invertInPlace(){this.conjugateInPlace();const e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){const e=this.length();if(e===0)return this;const t=1/e;return this.scaleInPlace(t),this}normalizeToNew(){const e=this.length();if(e===0)return this.clone();const t=1/e;return this.scale(t)}toEulerAngles(){const e=v.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,r=s*t-i*n,o=.4999999;if(r<-o)e._y=2*Math.atan2(s,n),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(r>o)e._y=2*Math.atan2(s,n),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const l=n*n,h=t*t,c=i*i,u=s*s;e._z=Math.atan2(2*(i*s+t*n),-h-c+u+l),e._x=Math.asin(-2*r),e._y=Math.atan2(2*(t*i+s*n),h-c-u+l),e._isDirty=!0}return e}toRotationMatrix(e){return N.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return ue.FromRotationMatrixToRef(e,this),this}static FromRotationMatrix(e){const t=new ue;return ue.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const i=e.m,s=i[0],n=i[4],r=i[8],o=i[1],l=i[5],h=i[9],c=i[2],u=i[6],d=i[10],_=s+l+d;let f;return _>0?(f=.5/Math.sqrt(_+1),t._w=.25/f,t._x=(u-h)*f,t._y=(r-c)*f,t._z=(o-n)*f,t._isDirty=!0):s>l&&s>d?(f=2*Math.sqrt(1+s-l-d),t._w=(u-h)/f,t._x=.25*f,t._y=(n+o)/f,t._z=(r+c)/f,t._isDirty=!0):l>d?(f=2*Math.sqrt(1+l-s-d),t._w=(r-c)/f,t._x=(n+o)/f,t._y=.25*f,t._z=(h+u)/f,t._isDirty=!0):(f=2*Math.sqrt(1+d-s-l),t._w=(o-n)/f,t._x=(r+c)/f,t._y=(h+u)/f,t._z=.25*f,t._isDirty=!0),t}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,i=.1){const s=ue.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,n){let r=s===0?1:i/s;return r=me.Clamp(r,0,1),ue.SlerpToRef(e,t,r,n),n}static Zero(){return new ue(0,0,0,0)}static Inverse(e){return new e.constructor(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){return new ue(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,t){return ue.RotationAxisToRef(e,t,new ue)}static RotationAxisToRef(e,t,i){const s=Math.sin(t/2);return e.normalize(),i._w=Math.cos(t/2),i._x=e._x*s,i._y=e._y*s,i._z=e._z*s,i._isDirty=!0,i}static FromArray(e,t){return t||(t=0),new ue(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromEulerAngles(e,t,i){const s=new ue;return ue.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return ue.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new ue;return ue.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return ue.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i){const s=v.Dot(e,t)+1;return sMath.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(v.CrossToRef(e,t,G.Vector3[0]),i.set(G.Vector3[0].x,G.Vector3[0].y,G.Vector3[0].z,s)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new ue;return ue.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){const n=i*.5,r=t*.5,o=e*.5,l=Math.sin(n),h=Math.cos(n),c=Math.sin(r),u=Math.cos(r),d=Math.sin(o),_=Math.cos(o);return s._x=_*c*h+d*u*l,s._y=d*u*h-_*c*l,s._z=_*u*l-d*c*h,s._w=_*u*h+d*c*l,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new ue;return ue.RotationAlphaBetaGammaToRef(e,t,i,s),s}static RotationAlphaBetaGammaToRef(e,t,i,s){const n=(i+e)*.5,r=(i-e)*.5,o=t*.5;return s._x=Math.cos(r)*Math.sin(o),s._y=Math.sin(r)*Math.sin(o),s._z=Math.sin(n)*Math.cos(o),s._w=Math.cos(n)*Math.cos(o),s._isDirty=!0,s}static RotationQuaternionFromAxis(e,t,i){const s=new ue(0,0,0,0);return ue.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const n=_e.Matrix[0];return N.FromXYZAxesToRef(e.normalize(),t.normalize(),i.normalize(),n),ue.FromRotationMatrixToRef(n,s),s}static FromLookDirectionLH(e,t){const i=new ue;return ue.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=_e.Matrix[0];return N.LookDirectionLHToRef(e,t,s),ue.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new ue;return ue.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=_e.Matrix[0];return N.LookDirectionRHToRef(e,t,s),ue.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=ue.Identity();return ue.SlerpToRef(e,t,i,s),s}static SlerpToRef(e,t,i,s){let n,r,o=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,l=!1;if(o<0&&(l=!0,o=-o),o>.999999)r=1-i,n=l?-i:i;else{const h=Math.acos(o),c=1/Math.sin(h);r=Math.sin((1-i)*h)*c,n=l?-Math.sin(i*h)*c:Math.sin(i*h)*c}return s._x=r*e._x+n*t._x,s._y=r*e._y+n*t._y,s._z=r*e._z+n*t._z,s._w=r*e._w+n*t._w,s._isDirty=!0,s}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,l=2*o-3*r+1,h=-2*o+3*r,c=o-2*r+n,u=o-r,d=e._x*l+i._x*h+t._x*c+s._x*u,_=e._y*l+i._y*h+t._y*c+s._y*u,f=e._z*l+i._z*h+t._z*c+s._z*u,g=e._w*l+i._w*h+t._w*c+s._w*u;return new e.constructor(d,_,f,g)}static Hermite1stDerivative(e,t,i,s,n){const r=new e.constructor;return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;return r._x=(o-n)*6*e._x+(3*o-4*n+1)*t._x+(-o+n)*6*i._x+(3*o-2*n)*s._x,r._y=(o-n)*6*e._y+(3*o-4*n+1)*t._y+(-o+n)*6*i._y+(3*o-2*n)*s._y,r._z=(o-n)*6*e._z+(3*o-4*n+1)*t._z+(-o+n)*6*i._z+(3*o-2*n)*s._z,r._w=(o-n)*6*e._w+(3*o-4*n+1)*t._w+(-o+n)*6*i._w+(3*o-2*n)*s._w,r._isDirty=!0,r}}class N{static get Use64Bits(){return Mt.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=N._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,s=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:s}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Mt.MatrixTrackPrecisionChange&&Mt.MatrixTrackedMatrices.push(this),this._m=new Mt.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;const e=this._m,t=e[0],i=e[1],s=e[2],n=e[3],r=e[4],o=e[5],l=e[6],h=e[7],c=e[8],u=e[9],d=e[10],_=e[11],f=e[12],g=e[13],p=e[14],x=e[15],m=d*x-p*_,T=u*x-g*_,S=u*p-g*d,b=c*x-f*_,y=c*p-d*f,E=c*g-f*u,P=+(o*m-l*T+h*S),C=-(r*m-l*b+h*y),R=+(r*T-o*b+h*E),w=-(r*S-o*y+l*E);return t*P+i*C+s*R+n*w}toArray(){return this._m}asArray(){return this._m}invert(){return this.invertToRef(this),this}reset(){return N.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){const t=new this.constructor;return this.addToRef(e,t),t}addToRef(e,t){const i=this._m,s=t._m,n=e.m;for(let r=0;r<16;r++)s[r]=i[r]+n[r];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}invertToRef(e){if(this._isIdentity===!0)return N.IdentityToRef(e),e;const t=this._m,i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],l=t[5],h=t[6],c=t[7],u=t[8],d=t[9],_=t[10],f=t[11],g=t[12],p=t[13],x=t[14],m=t[15],T=_*m-x*f,S=d*m-p*f,b=d*x-p*_,y=u*m-g*f,E=u*x-_*g,P=u*p-g*d,C=+(l*T-h*S+c*b),R=-(o*T-h*y+c*E),w=+(o*S-l*y+c*P),D=-(o*b-l*E+h*P),W=i*C+s*R+n*w+r*D;if(W===0)return e.copyFrom(this),e;const L=1/W,z=h*m-x*c,K=l*m-p*c,ae=l*x-p*h,$=o*m-g*c,U=o*x-g*h,V=o*p-g*l,M=h*f-_*c,k=l*f-d*c,X=l*_-d*h,Q=o*f-u*c,ge=o*_-u*h,ye=o*d-u*l,Te=-(s*T-n*S+r*b),Pe=+(i*T-n*y+r*E),De=-(i*S-s*y+r*P),nt=+(i*b-s*E+n*P),Ce=+(s*z-n*K+r*ae),le=-(i*z-n*$+r*U),Fe=+(i*K-s*$+r*V),ke=-(i*ae-s*U+n*V),Xe=-(s*M-n*k+r*X),tt=+(i*M-n*Q+r*ge),Gt=-(i*k-s*Q+r*ye),Rt=+(i*X-s*ge+n*ye);return N.FromValuesToRef(C*L,Te*L,Ce*L,Xe*L,R*L,Pe*L,le*L,tt*L,w*L,De*L,Fe*L,Gt*L,D*L,nt*L,ke*L,Rt*L,e),e}addAtIndex(e,t){return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new v(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){const e=this.m;return N.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}multiply(e){const t=new this.constructor;return this.multiplyToRef(e,t),t}copyFrom(e){e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){const i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this}multiplyToRef(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,i){const s=this._m,n=e.m,r=s[0],o=s[1],l=s[2],h=s[3],c=s[4],u=s[5],d=s[6],_=s[7],f=s[8],g=s[9],p=s[10],x=s[11],m=s[12],T=s[13],S=s[14],b=s[15],y=n[0],E=n[1],P=n[2],C=n[3],R=n[4],w=n[5],D=n[6],W=n[7],L=n[8],z=n[9],K=n[10],ae=n[11],$=n[12],U=n[13],V=n[14],M=n[15];return t[i]=r*y+o*R+l*L+h*$,t[i+1]=r*E+o*w+l*z+h*U,t[i+2]=r*P+o*D+l*K+h*V,t[i+3]=r*C+o*W+l*ae+h*M,t[i+4]=c*y+u*R+d*L+_*$,t[i+5]=c*E+u*w+d*z+_*U,t[i+6]=c*P+u*D+d*K+_*V,t[i+7]=c*C+u*W+d*ae+_*M,t[i+8]=f*y+g*R+p*L+x*$,t[i+9]=f*E+g*w+p*z+x*U,t[i+10]=f*P+g*D+p*K+x*V,t[i+11]=f*C+g*W+p*ae+x*M,t[i+12]=m*y+T*R+S*L+b*$,t[i+13]=m*E+T*w+S*z+b*U,t[i+14]=m*P+T*D+S*K+b*V,t[i+15]=m*C+T*W+S*ae+b*M,this}equals(e){const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const i=this.m,s=t.m;return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]&&i[3]===s[3]&&i[4]===s[4]&&i[5]===s[5]&&i[6]===s[6]&&i[7]===s[7]&&i[8]===s[8]&&i[9]===s[9]&&i[10]===s[10]&&i[11]===s[11]&&i[12]===s[12]&&i[13]===s[13]&&i[14]===s[14]&&i[15]===s[15]}clone(){const e=new this.constructor;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=hi(this._m[0]);for(let t=1;t<16;t++)e=e*397^hi(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new ue,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const n=this._m;if(i&&i.copyFromFloats(n[12],n[13],n[14]),e=e||_e.Vector3[0],e.x=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]),e.y=Math.sqrt(n[4]*n[4]+n[5]*n[5]+n[6]*n[6]),e.z=Math.sqrt(n[8]*n[8]+n[9]*n[9]+n[10]*n[10]),s){const r=s.scaling.x<0?-1:1,o=s.scaling.y<0?-1:1,l=s.scaling.z<0?-1:1;e.x*=r,e.y*=o,e.z*=l}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const r=1/e._x,o=1/e._y,l=1/e._z;N.FromValuesToRef(n[0]*r,n[1]*r,n[2]*r,0,n[4]*o,n[5]*o,n[6]*o,0,n[8]*l,n[9]*l,n[10]*l,0,0,0,0,1,_e.Matrix[0]),ue.FromRotationMatrixToRef(_e.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new Ye(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){if(e>=0&&e<3){const i=e*4;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new this.constructor;return N.TransposeToRef(this,e),e}transposeToRef(e){return N.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,s,n){if(e<0||e>3)return this;const r=e*4;return this._m[r+0]=t,this._m[r+1]=i,this._m[r+2]=s,this._m[r+3]=n,this.markAsUpdated(),this}scale(e){const t=new this.constructor;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}toNormalMatrix(e){const t=_e.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return N.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new this.constructor;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=_e.Vector3[0];if(!this.decompose(t))return N.IdentityToRef(e),e;const i=this._m,s=1/t._x,n=1/t._y,r=1/t._z;return N.FromValuesToRef(i[0]*s,i[1]*s,i[2]*s,0,i[4]*n,i[5]*n,i[6]*n,0,i[8]*r,i[9]*r,i[10]*r,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}static FromArray(e,t=0){const i=new N;return N.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){for(let s=0;s<16;s++)i._m[s]=e[s+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,s){for(let n=0;n<16;n++)s._m[n]=e[n+t]*i;return s.markAsUpdated(),s}static get IdentityReadOnly(){return N._IdentityReadOnly}static FromValuesToRef(e,t,i,s,n,r,o,l,h,c,u,d,_,f,g,p,x){const m=x._m;m[0]=e,m[1]=t,m[2]=i,m[3]=s,m[4]=n,m[5]=r,m[6]=o,m[7]=l,m[8]=h,m[9]=c,m[10]=u,m[11]=d,m[12]=_,m[13]=f,m[14]=g,m[15]=p,x.markAsUpdated()}static FromValues(e,t,i,s,n,r,o,l,h,c,u,d,_,f,g,p){const x=new N,m=x._m;return m[0]=e,m[1]=t,m[2]=i,m[3]=s,m[4]=n,m[5]=r,m[6]=o,m[7]=l,m[8]=h,m[9]=c,m[10]=u,m[11]=d,m[12]=_,m[13]=f,m[14]=g,m[15]=p,x.markAsUpdated(),x}static Compose(e,t,i){const s=new N;return N.ComposeToRef(e,t,i,s),s}static ComposeToRef(e,t,i,s){const n=s._m,r=t._x,o=t._y,l=t._z,h=t._w,c=r+r,u=o+o,d=l+l,_=r*c,f=r*u,g=r*d,p=o*u,x=o*d,m=l*d,T=h*c,S=h*u,b=h*d,y=e._x,E=e._y,P=e._z;return n[0]=(1-(p+m))*y,n[1]=(f+b)*y,n[2]=(g-S)*y,n[3]=0,n[4]=(f-b)*E,n[5]=(1-(_+m))*E,n[6]=(x+T)*E,n[7]=0,n[8]=(g+S)*P,n[9]=(x-T)*P,n[10]=(1-(_+p))*P,n[11]=0,n[12]=i._x,n[13]=i._y,n[14]=i._z,n[15]=1,s.markAsUpdated(),s}static Identity(){const e=N.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return N.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){const e=N.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){const t=new N;return N.RotationXToRef(e,t),t}static Invert(e){const t=new e.constructor;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return N.FromValuesToRef(1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationY(e){const t=new N;return N.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return N.FromValuesToRef(s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationZ(e){const t=new N;return N.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return N.FromValuesToRef(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationAxis(e,t){const i=new N;return N.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){const s=Math.sin(-t),n=Math.cos(-t),r=1-n;e.normalize();const o=i._m;return o[0]=e._x*e._x*r+n,o[1]=e._x*e._y*r-e._z*s,o[2]=e._x*e._z*r+e._y*s,o[3]=0,o[4]=e._y*e._x*r+e._z*s,o[5]=e._y*e._y*r+n,o[6]=e._y*e._z*r-e._x*s,o[7]=0,o[8]=e._z*e._x*r-e._y*s,o[9]=e._z*e._y*r+e._x*s,o[10]=e._z*e._z*r+n,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i){const s=v.Dot(t,e),n=i._m;if(s<-1+Ge)n[0]=-1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0;else{const r=v.Cross(t,e),o=1/(1+s);n[0]=r._x*r._x*o+s,n[1]=r._y*r._x*o-r._z,n[2]=r._z*r._x*o+r._y,n[3]=0,n[4]=r._x*r._y*o+r._z,n[5]=r._y*r._y*o+s,n[6]=r._z*r._y*o-r._x,n[7]=0,n[8]=r._x*r._z*o-r._y,n[9]=r._y*r._z*o+r._x,n[10]=r._z*r._z*o+s,n[11]=0}return n[12]=0,n[13]=0,n[14]=0,n[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new N;return N.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return ue.RotationYawPitchRollToRef(e,t,i,_e.Quaternion[0]),_e.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new N;return N.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return N.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,s),s._updateIdentityStatus(e===1&&t===1&&i===1),s}static Translation(e,t,i){const s=new N;return N.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return N.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,s),s._updateIdentityStatus(e===0&&t===0&&i===0),s}static Lerp(e,t,i){const s=new e.constructor;return N.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){const n=s._m,r=e.m,o=t.m;for(let l=0;l<16;l++)n[l]=r[l]*(1-i)+o[l]*i;return s.markAsUpdated(),s}static DecomposeLerp(e,t,i){const s=new e.constructor;return N.DecomposeLerpToRef(e,t,i,s),s}static DecomposeLerpToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Quaternion[0],o=_e.Vector3[1];e.decompose(n,r,o);const l=_e.Vector3[2],h=_e.Quaternion[1],c=_e.Vector3[3];t.decompose(l,h,c);const u=_e.Vector3[4];v.LerpToRef(n,l,i,u);const d=_e.Quaternion[2];ue.SlerpToRef(r,h,i,d);const _=_e.Vector3[5];return v.LerpToRef(o,c,i,_),N.ComposeToRef(u,d,_,s),s}static LookAtLH(e,t,i){const s=new N;return N.LookAtLHToRef(e,t,i,s),s}static LookAtLHToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Vector3[1],o=_e.Vector3[2];t.subtractToRef(e,o),o.normalize(),v.CrossToRef(i,o,n);const l=n.lengthSquared();l===0?n.x=1:n.normalizeFromLength(Math.sqrt(l)),v.CrossToRef(o,n,r),r.normalize();const h=-v.Dot(n,e),c=-v.Dot(r,e),u=-v.Dot(o,e);N.FromValuesToRef(n._x,r._x,o._x,0,n._y,r._y,o._y,0,n._z,r._z,o._z,0,h,c,u,1,s)}static LookAtRH(e,t,i){const s=new N;return N.LookAtRHToRef(e,t,i,s),s}static LookAtRHToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Vector3[1],o=_e.Vector3[2];e.subtractToRef(t,o),o.normalize(),v.CrossToRef(i,o,n);const l=n.lengthSquared();l===0?n.x=1:n.normalizeFromLength(Math.sqrt(l)),v.CrossToRef(o,n,r),r.normalize();const h=-v.Dot(n,e),c=-v.Dot(r,e),u=-v.Dot(o,e);return N.FromValuesToRef(n._x,r._x,o._x,0,n._y,r._y,o._y,0,n._z,r._z,o._z,0,h,c,u,1,s),s}static LookDirectionLH(e,t){const i=new N;return N.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){const s=_e.Vector3[0];s.copyFrom(e),s.scaleInPlace(-1);const n=_e.Vector3[1];return v.CrossToRef(t,s,n),N.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){const i=new N;return N.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=_e.Vector3[2];return v.CrossToRef(t,e,s),N.FromValuesToRef(s._x,s._y,s._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,s,n){const r=new N;return N.OrthoLHToRef(e,t,i,s,r,n),r}static OrthoLHToRef(e,t,i,s,n,r){const o=i,l=s,h=2/e,c=2/t,u=2/(l-o),d=-(l+o)/(l-o);return N.FromValuesToRef(h,0,0,0,0,c,0,0,0,0,u,0,0,0,d,1,n),r&&n.multiplyToRef(bs,n),n._updateIdentityStatus(h===1&&c===1&&u===1&&d===0),n}static OrthoOffCenterLH(e,t,i,s,n,r,o){const l=new N;return N.OrthoOffCenterLHToRef(e,t,i,s,n,r,l,o),l}static OrthoOffCenterLHToRef(e,t,i,s,n,r,o,l){const h=n,c=r,u=2/(t-e),d=2/(s-i),_=2/(c-h),f=-(c+h)/(c-h),g=(e+t)/(e-t),p=(s+i)/(i-s);return N.FromValuesToRef(u,0,0,0,0,d,0,0,0,0,_,0,g,p,f,1,o),l&&o.multiplyToRef(bs,o),o.markAsUpdated(),o}static OrthoOffCenterRH(e,t,i,s,n,r,o){const l=new N;return N.OrthoOffCenterRHToRef(e,t,i,s,n,r,l,o),l}static OrthoOffCenterRHToRef(e,t,i,s,n,r,o,l){return N.OrthoOffCenterLHToRef(e,t,i,s,n,r,o,l),o._m[10]*=-1,o}static PerspectiveLH(e,t,i,s,n,r=0){const o=new N,l=i,h=s,c=2*l/e,u=2*l/t,d=(h+l)/(h-l),_=-2*h*l/(h-l),f=Math.tan(r);return N.FromValuesToRef(c,0,0,0,0,u,0,f,0,0,d,1,0,0,_,0,o),n&&o.multiplyToRef(bs,o),o._updateIdentityStatus(!1),o}static PerspectiveFovLH(e,t,i,s,n,r=0,o=!1){const l=new N;return N.PerspectiveFovLHToRef(e,t,i,s,l,!0,n,r,o),l}static PerspectiveFovLHToRef(e,t,i,s,n,r=!0,o,l=0,h=!1){const c=i,u=s,d=1/Math.tan(e*.5),_=r?d/t:d,f=r?d:d*t,g=h&&c===0?-1:u!==0?(u+c)/(u-c):1,p=h&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,x=Math.tan(l);return N.FromValuesToRef(_,0,0,0,0,f,0,x,0,0,g,1,0,0,p,0,n),o&&n.multiplyToRef(bs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseLHToRef(e,t,i,s,n,r=!0,o,l=0){const h=1/Math.tan(e*.5),c=r?h/t:h,u=r?h:h*t,d=Math.tan(l);return N.FromValuesToRef(c,0,0,0,0,u,0,d,0,0,-i,1,0,0,1,0,n),o&&n.multiplyToRef(bs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovRH(e,t,i,s,n,r=0,o=!1){const l=new N;return N.PerspectiveFovRHToRef(e,t,i,s,l,!0,n,r,o),l}static PerspectiveFovRHToRef(e,t,i,s,n,r=!0,o,l=0,h=!1){const c=i,u=s,d=1/Math.tan(e*.5),_=r?d/t:d,f=r?d:d*t,g=h&&c===0?1:u!==0?-(u+c)/(u-c):-1,p=h&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,x=Math.tan(l);return N.FromValuesToRef(_,0,0,0,0,f,0,x,0,0,g,-1,0,0,p,0,n),o&&n.multiplyToRef(bs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseRHToRef(e,t,i,s,n,r=!0,o,l=0){const h=1/Math.tan(e*.5),c=r?h/t:h,u=r?h:h*t,d=Math.tan(l);return N.FromValuesToRef(c,0,0,0,0,u,0,d,0,0,-i,-1,0,0,-1,0,n),o&&n.multiplyToRef(bs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovWebVRToRef(e,t,i,s,n=!1,r,o=0){const l=n?-1:1,h=Math.tan(e.upDegrees*Math.PI/180),c=Math.tan(e.downDegrees*Math.PI/180),u=Math.tan(e.leftDegrees*Math.PI/180),d=Math.tan(e.rightDegrees*Math.PI/180),_=2/(u+d),f=2/(h+c),g=Math.tan(o),p=s._m;return p[0]=_,p[1]=p[2]=p[3]=p[4]=0,p[5]=f,p[6]=0,p[7]=g,p[8]=(u-d)*_*.5,p[9]=-((h-c)*f*.5),p[10]=-i/(t-i),p[11]=1*l,p[12]=p[13]=p[15]=0,p[14]=-(2*i*t)/(i-t),r&&s.multiplyToRef(bs,s),s.markAsUpdated(),s}static GetFinalMatrix(e,t,i,s,n,r){const o=e.width,l=e.height,h=e.x,c=e.y,u=N.FromValues(o/2,0,0,0,0,-l/2,0,0,0,0,r-n,0,h+o/2,l/2+c,n,1),d=new t.constructor;return t.multiplyToRef(i,d),d.multiplyToRef(s,d),d.multiplyToRef(u,d)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Mt.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return Mt.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new e.constructor;return N.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=t._m,s=e.m;return i[0]=s[0],i[1]=s[4],i[2]=s[8],i[3]=s[12],i[4]=s[1],i[5]=s[5],i[6]=s[9],i[7]=s[13],i[8]=s[2],i[9]=s[6],i[10]=s[10],i[11]=s[14],i[12]=s[3],i[13]=s[7],i[14]=s[11],i[15]=s[15],t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new N;return N.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const i=e.normal.x,s=e.normal.y,n=e.normal.z,r=-2*i,o=-2*s,l=-2*n;return N.FromValuesToRef(r*i+1,o*i,l*i,0,r*s,o*s+1,l*s,0,r*n,o*n,l*n+1,0,r*e.d,o*e.d,l*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,s){return N.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,s),s}static FromQuaternionToRef(e,t){const i=e._x*e._x,s=e._y*e._y,n=e._z*e._z,r=e._x*e._y,o=e._z*e._w,l=e._z*e._x,h=e._y*e._w,c=e._y*e._z,u=e._x*e._w;return t._m[0]=1-2*(s+n),t._m[1]=2*(r+o),t._m[2]=2*(l-h),t._m[3]=0,t._m[4]=2*(r-o),t._m[5]=1-2*(n+i),t._m[6]=2*(c+u),t._m[7]=0,t._m[8]=2*(l+h),t._m[9]=2*(c-u),t._m[10]=1-2*(s+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}N._UpdateFlagSeed=0;N._IdentityReadOnly=N.Identity();class _e{}_e.Vector3=kt.BuildTuple(11,v.Zero);_e.Matrix=kt.BuildTuple(2,N.Identity);_e.Quaternion=kt.BuildTuple(3,ue.Zero);class G{}G.Vector2=kt.BuildTuple(3,fe.Zero);G.Vector3=kt.BuildTuple(13,v.Zero);G.Vector4=kt.BuildTuple(3,Ye.Zero);G.Quaternion=kt.BuildTuple(2,ue.Zero);G.Matrix=kt.BuildTuple(8,N.Identity);Vt("BABYLON.Vector2",fe);Vt("BABYLON.Vector3",v);Vt("BABYLON.Vector4",Ye);Vt("BABYLON.Matrix",N);const bs=N.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);var Nt;(function(a){a[a.LOCAL=0]="LOCAL",a[a.WORLD=1]="WORLD",a[a.BONE=2]="BONE"})(Nt||(Nt={}));class Qt{}Qt.X=new v(1,0,0);Qt.Y=new v(0,1,0);Qt.Z=new v(0,0,1);var $0;(function(a){a[a.X=0]="X",a[a.Y=1]="Y",a[a.Z=2]="Z"})($0||($0={}));function un(a){return Math.pow(a,au)}function dn(a){return a<=.04045?.0773993808*a:Math.pow(.947867299*(a+.055),2.4)}function fn(a){return Math.pow(a,ru)}function _n(a){return a<=.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class he{constructor(e=0,t=0,i=0){this.r=e,this.g=t,this.b=i}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){return"Color3"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){return he.FromArrayToRef(e,t,this),this}toColor4(e=1){return new q(this.r,this.g,this.b,e)}asArray(){return[this.r,this.g,this.b]}toLuminance(){return this.r*.3+this.g*.59+this.b*.11}multiply(e){return new he(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}scale(e){return new he(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this}clampToRef(e=0,t=1,i){return i.r=me.Clamp(this.r,e,t),i.g=me.Clamp(this.g,e,t),i.b=me.Clamp(this.b,e,t),this}add(e){return new he(this.r+e.r,this.g+e.g,this.b+e.b)}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this}subtract(e){return new he(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this}clone(){return new he(this.r,this.g,this.b)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,i){return this.r=e,this.g=t,this.b=i,this}set(e,t,i){return this.copyFromFloats(e,t,i)}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),i=Math.round(this.b*255);return"#"+me.ToHex(e)+me.ToHex(t)+me.ToHex(i)}toHSV(){const e=new he;return this.toHSVToRef(e),e}toHSVToRef(e){const t=this.r,i=this.g,s=this.b,n=Math.max(t,i,s),r=Math.min(t,i,s);let o=0,l=0;const h=n,c=n-r;n!==0&&(l=c/n),n!=r&&(n==t?(o=(i-s)/c,i=0&&r<=1?(l=n,h=o):r>=1&&r<=2?(l=o,h=n):r>=2&&r<=3?(h=n,c=o):r>=3&&r<=4?(h=o,c=n):r>=4&&r<=5?(l=o,c=n):r>=5&&r<=6&&(l=n,c=o);const u=i-n;s.set(l+u,h+u,c+u)}static FromHSV(e,t,i){const s=new he(0,0,0);return he.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){if(e.substring(0,1)!=="#"||e.length!==7)return new he(0,0,0);const t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16);return he.FromInts(t,i,s)}static FromArray(e,t=0){return new he(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){return new he(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new he(0,0,0);return he.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,l=2*o-3*r+1,h=-2*o+3*r,c=o-2*r+n,u=o-r,d=e.r*l+i.r*h+t.r*c+s.r*u,_=e.g*l+i.g*h+t.g*c+s.g*u,f=e.b*l+i.b*h+t.b*c+s.b*u;return new he(d,_,f)}static Hermite1stDerivative(e,t,i,s,n){const r=he.Black();return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;r.r=(o-n)*6*e.r+(3*o-4*n+1)*t.r+(-o+n)*6*i.r+(3*o-2*n)*s.r,r.g=(o-n)*6*e.g+(3*o-4*n+1)*t.g+(-o+n)*6*i.g+(3*o-2*n)*s.g,r.b=(o-n)*6*e.b+(3*o-4*n+1)*t.b+(-o+n)*6*i.b+(3*o-2*n)*s.b}static Red(){return new he(1,0,0)}static Green(){return new he(0,1,0)}static Blue(){return new he(0,0,1)}static Black(){return new he(0,0,0)}static get BlackReadOnly(){return he._BlackReadOnly}static White(){return new he(1,1,1)}static Purple(){return new he(.5,0,.5)}static Magenta(){return new he(1,0,1)}static Yellow(){return new he(1,1,0)}static Gray(){return new he(.5,.5,.5)}static Teal(){return new he(0,1,1)}static Random(){return new he(Math.random(),Math.random(),Math.random())}}he._BlackReadOnly=he.Black();let q=class Ht{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}asArray(){return[this.r,this.g,this.b,this.a]}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){return Ht.FromArrayToRef(e,t,this),this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){return new Ht(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}subtract(e){return new Ht(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this}scale(e){return new Ht(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this}clampToRef(e=0,t=1,i){return i.r=me.Clamp(this.r,e,t),i.g=me.Clamp(this.g,e,t),i.b=me.Clamp(this.b,e,t),i.a=me.Clamp(this.a,e,t),this}multiply(e){return new Ht(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){return"Color4"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e}clone(){return new Ht(this.r,this.g,this.b,this.a)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}toHexString(e=!1){const t=Math.round(this.r*255),i=Math.round(this.g*255),s=Math.round(this.b*255);if(e)return"#"+me.ToHex(t)+me.ToHex(i)+me.ToHex(s);const n=Math.round(this.a*255);return"#"+me.ToHex(t)+me.ToHex(i)+me.ToHex(s)+me.ToHex(n)}toLinearSpace(e=!1){const t=new Ht;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=dn(this.r),e.g=dn(this.g),e.b=dn(this.b)):(e.r=un(this.r),e.g=un(this.g),e.b=un(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new Ht;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=_n(this.r),e.g=_n(this.g),e.b=_n(this.b)):(e.r=fn(this.r),e.g=fn(this.g),e.b=fn(this.b)),e.a=this.a,this}static FromHexString(e){if(e.substring(0,1)!=="#"||e.length!==9&&e.length!==7)return new Ht(0,0,0,0);const t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),n=e.length===9?parseInt(e.substring(7,9),16):255;return Ht.FromInts(t,i,s,n)}static Lerp(e,t,i){const s=new Ht(0,0,0,0);return Ht.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i,s.a=e.a+(t.a-e.a)*i}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,l=2*o-3*r+1,h=-2*o+3*r,c=o-2*r+n,u=o-r,d=e.r*l+i.r*h+t.r*c+s.r*u,_=e.g*l+i.g*h+t.g*c+s.g*u,f=e.b*l+i.b*h+t.b*c+s.b*u,g=e.a*l+i.a*h+t.a*c+s.a*u;return new Ht(d,_,f,g)}static Hermite1stDerivative(e,t,i,s,n){const r=new Ht;return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;r.r=(o-n)*6*e.r+(3*o-4*n+1)*t.r+(-o+n)*6*i.r+(3*o-2*n)*s.r,r.g=(o-n)*6*e.g+(3*o-4*n+1)*t.g+(-o+n)*6*i.g+(3*o-2*n)*s.g,r.b=(o-n)*6*e.b+(3*o-4*n+1)*t.b+(-o+n)*6*i.b+(3*o-2*n)*s.b,r.a=(o-n)*6*e.a+(3*o-4*n+1)*t.a+(-o+n)*6*i.a+(3*o-2*n)*s.a}static FromColor3(e,t=1){return new Ht(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new Ht(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,s){return new Ht(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;snew q(0,0,0,0));Vt("BABYLON.Color3",he);Vt("BABYLON.Color4",q);class ni{constructor(e,t,i,s){this.normal=new v(e,t,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new ni(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return e=e*397^(this.d|0),e}normalize(){const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return e!==0&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){const t=ni._TmpMatrix;e.invertToRef(t);const i=t.m,s=this.normal.x,n=this.normal.y,r=this.normal.z,o=this.d,l=s*i[0]+n*i[1]+r*i[2]+o*i[3],h=s*i[4]+n*i[5]+r*i[6]+o*i[7],c=s*i[8]+n*i[9]+r*i[10]+o*i[11],u=s*i[12]+n*i[13]+r*i[14]+o*i[15];return new ni(l,h,c,u)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){const s=t.x-e.x,n=t.y-e.y,r=t.z-e.z,o=i.x-e.x,l=i.y-e.y,h=i.z-e.z,c=n*h-r*l,u=r*o-s*h,d=s*l-n*o,_=Math.sqrt(c*c+u*u+d*d);let f;return _!==0?f=1/_:f=0,this.normal.x=c*f,this.normal.y=u*f,this.normal.z=d*f,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return v.Dot(this.normal,e)<=t}signedDistanceTo(e){return v.Dot(e,this.normal)+this.d}static FromArray(e){return new ni(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new ni(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new ni(0,0,0,0);return t.normalize(),i.normal=t,i.d=-(t.x*e.x+t.y*e.y+t.z*e.z),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){const s=-(t.x*e.x+t.y*e.y+t.z*e.z);return v.Dot(i,t)+s}}ni._TmpMatrix=N.Identity();class Ri{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new ni(0,0,0,0));return Ri.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){Ri.GetNearPlaneToRef(e,t[0]),Ri.GetFarPlaneToRef(e,t[1]),Ri.GetLeftPlaneToRef(e,t[2]),Ri.GetRightPlaneToRef(e,t[3]),Ri.GetTopPlaneToRef(e,t[4]),Ri.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}var pn;(function(a){a[a.CW=0]="CW",a[a.CCW=1]="CCW"})(pn||(pn={}));class Is{constructor(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return this._radians*180/Math.PI}radians(){return this._radians}static BetweenTwoPoints(e,t){const i=t.subtract(e),s=Math.atan2(i.y,i.x);return new Is(s)}static FromRadians(e){return new Is(e)}static FromDegrees(e){return new Is(e*Math.PI/180)}}class hu{constructor(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;const s=Math.pow(t.x,2)+Math.pow(t.y,2),n=(Math.pow(e.x,2)+Math.pow(e.y,2)-s)/2,r=(s-Math.pow(i.x,2)-Math.pow(i.y,2))/2,o=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new fe((n*(t.y-i.y)-r*(e.y-t.y))/o,((e.x-t.x)*r-(t.x-i.x)*n)/o),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=Is.BetweenTwoPoints(this.centerPoint,this.startPoint);const l=this.startAngle.degrees();let h=Is.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),c=Is.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();h-l>180&&(h-=360),h-l<-180&&(h+=360),c-h>180&&(c-=360),c-h<-180&&(c+=360),this.orientation=h-l<0?pn.CW:pn.CCW,this.angle=Is.FromDegrees(this.orientation===pn.CW?l-c:c-l)}}class r0{constructor(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new fe(e,t))}addLineTo(e,t){if(this.closed)return this;const i=new fe(e,t),s=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(s).length(),this}addArcTo(e,t,i,s,n=36){if(this.closed)return this;const r=this._points[this._points.length-1],o=new fe(e,t),l=new fe(i,s),h=new hu(r,o,l);let c=h.angle.radians()/n;h.orientation===pn.CW&&(c*=-1);let u=h.startAngle.radians()+c;for(let d=0;d1)return fe.Zero();const t=e*this.length();let i=0;for(let s=0;s=i&&t<=h){const c=l.normalize(),u=t-i;return new fe(r.x+c.x*u,r.y+c.y*u)}i=h}return fe.Zero()}static StartingAt(e,t){return new r0(e,t)}}class Gn{constructor(e,t=null,i,s=!1){this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:v.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:N.Identity()};for(let n=0;nt){const h=e;e=t,t=h}const i=this.getCurve(),s=this.getPointAt(e);let n=this.getPreviousPointIndexAt(e);const r=this.getPointAt(t),o=this.getPreviousPointIndexAt(t)+1,l=[];return e!==0&&(n++,l.push(s)),l.push(...i.slice(n,o)),(t!==1||e===1)&&l.push(r),new Gn(l,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){for(let s=0;st+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){let i,s=e.length();if(s===0&&(s=1),t==null){let n;me.WithinEpsilon(Math.abs(e.y)/s,1,Ge)?me.WithinEpsilon(Math.abs(e.x)/s,1,Ge)?me.WithinEpsilon(Math.abs(e.z)/s,1,Ge)?n=v.Zero():n=new v(0,0,1):n=new v(1,0,0):n=new v(0,-1,0),i=v.Cross(e,n)}else i=v.Cross(e,t),v.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let s=i[0],n,r=0;const o=e*this.length();for(let l=1;lo){const u=(r-o)/h,d=s.subtract(n),_=n.add(d.scaleInPlace(u));return this._setPointAtData(e,1-u,_,l-1,t)}s=n}return this._pointAtData}_setPointAtData(e,t,i,s,n){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=s,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=N.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),s=this._normals[e].clone(),n=this._binormals[e].clone(),r=this._tangents[t].clone(),o=this._normals[t].clone(),l=this._binormals[t].clone(),h=ue.RotationQuaternionFromAxis(s,n,i),c=ue.RotationQuaternionFromAxis(o,l,r);ue.Slerp(h,c,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class Ui{constructor(e,t){this.width=e,this.height=t}toString(){return"{W: ".concat(this.width,", H: ").concat(this.height,"}")}getClassName(){return"Size"}getHashCode(){let e=this.width|0;return e=e*397^(this.height|0),e}copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,t){return new Ui(this.width*e,this.height*t)}clone(){return new Ui(this.width,this.height)}equals(e){return e?this.width===e.width&&this.height===e.height:!1}get surface(){return this.width*this.height}static Zero(){return new Ui(0,0)}add(e){return new Ui(this.width+e.width,this.height+e.height)}subtract(e){return new Ui(this.width-e.width,this.height-e.height)}static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,n=e.height+(t.height-e.height)*i;return new Ui(s,n)}}class mn{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new mn(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new mn(this.x,this.y,this.width,this.height)}}var Z0;(function(a){a.LowPower="low-power",a.HighPerformance="high-performance"})(Z0||(Z0={}));var Ss;(function(a){a.DepthClipControl="depth-clip-control",a.Depth32FloatStencil8="depth32float-stencil8",a.TextureCompressionBC="texture-compression-bc",a.TextureCompressionETC2="texture-compression-etc2",a.TextureCompressionASTC="texture-compression-astc",a.TimestampQuery="timestamp-query",a.IndirectFirstInstance="indirect-first-instance",a.ShaderF16="shader-f16",a.RG11B10UFloatRenderable="rg11b10ufloat-renderable",a.BGRA8UnormStorage="bgra8unorm-storage",a.Float32Filterable="float32-filterable"})(Ss||(Ss={}));var Q0;(function(a){a.Unmapped="unmapped",a.Pending="pending",a.Mapped="mapped"})(Q0||(Q0={}));var Je;(function(a){a[a.MapRead=1]="MapRead",a[a.MapWrite=2]="MapWrite",a[a.CopySrc=4]="CopySrc",a[a.CopyDst=8]="CopyDst",a[a.Index=16]="Index",a[a.Vertex=32]="Vertex",a[a.Uniform=64]="Uniform",a[a.Storage=128]="Storage",a[a.Indirect=256]="Indirect",a[a.QueryResolve=512]="QueryResolve"})(Je||(Je={}));var Xs;(function(a){a[a.Read=1]="Read",a[a.Write=2]="Write"})(Xs||(Xs={}));var Mi;(function(a){a.E1d="1d",a.E2d="2d",a.E3d="3d"})(Mi||(Mi={}));var it;(function(a){a[a.CopySrc=1]="CopySrc",a[a.CopyDst=2]="CopyDst",a[a.TextureBinding=4]="TextureBinding",a[a.StorageBinding=8]="StorageBinding",a[a.RenderAttachment=16]="RenderAttachment"})(it||(it={}));var $e;(function(a){a.E1d="1d",a.E2d="2d",a.E2dArray="2d-array",a.Cube="cube",a.CubeArray="cube-array",a.E3d="3d"})($e||($e={}));var $i;(function(a){a.All="all",a.StencilOnly="stencil-only",a.DepthOnly="depth-only"})($i||($i={}));var I;(function(a){a.R8Unorm="r8unorm",a.R8Snorm="r8snorm",a.R8Uint="r8uint",a.R8Sint="r8sint",a.R16Uint="r16uint",a.R16Sint="r16sint",a.R16Float="r16float",a.RG8Unorm="rg8unorm",a.RG8Snorm="rg8snorm",a.RG8Uint="rg8uint",a.RG8Sint="rg8sint",a.R32Uint="r32uint",a.R32Sint="r32sint",a.R32Float="r32float",a.RG16Uint="rg16uint",a.RG16Sint="rg16sint",a.RG16Float="rg16float",a.RGBA8Unorm="rgba8unorm",a.RGBA8UnormSRGB="rgba8unorm-srgb",a.RGBA8Snorm="rgba8snorm",a.RGBA8Uint="rgba8uint",a.RGBA8Sint="rgba8sint",a.BGRA8Unorm="bgra8unorm",a.BGRA8UnormSRGB="bgra8unorm-srgb",a.RGB9E5UFloat="rgb9e5ufloat",a.RGB10A2Unorm="rgb10a2unorm",a.RG11B10UFloat="rg11b10ufloat",a.RG32Uint="rg32uint",a.RG32Sint="rg32sint",a.RG32Float="rg32float",a.RGBA16Uint="rgba16uint",a.RGBA16Sint="rgba16sint",a.RGBA16Float="rgba16float",a.RGBA32Uint="rgba32uint",a.RGBA32Sint="rgba32sint",a.RGBA32Float="rgba32float",a.Stencil8="stencil8",a.Depth16Unorm="depth16unorm",a.Depth24Plus="depth24plus",a.Depth24PlusStencil8="depth24plus-stencil8",a.Depth32Float="depth32float",a.BC1RGBAUnorm="bc1-rgba-unorm",a.BC1RGBAUnormSRGB="bc1-rgba-unorm-srgb",a.BC2RGBAUnorm="bc2-rgba-unorm",a.BC2RGBAUnormSRGB="bc2-rgba-unorm-srgb",a.BC3RGBAUnorm="bc3-rgba-unorm",a.BC3RGBAUnormSRGB="bc3-rgba-unorm-srgb",a.BC4RUnorm="bc4-r-unorm",a.BC4RSnorm="bc4-r-snorm",a.BC5RGUnorm="bc5-rg-unorm",a.BC5RGSnorm="bc5-rg-snorm",a.BC6HRGBUFloat="bc6h-rgb-ufloat",a.BC6HRGBFloat="bc6h-rgb-float",a.BC7RGBAUnorm="bc7-rgba-unorm",a.BC7RGBAUnormSRGB="bc7-rgba-unorm-srgb",a.ETC2RGB8Unorm="etc2-rgb8unorm",a.ETC2RGB8UnormSRGB="etc2-rgb8unorm-srgb",a.ETC2RGB8A1Unorm="etc2-rgb8a1unorm",a.ETC2RGB8A1UnormSRGB="etc2-rgb8a1unorm-srgb",a.ETC2RGBA8Unorm="etc2-rgba8unorm",a.ETC2RGBA8UnormSRGB="etc2-rgba8unorm-srgb",a.EACR11Unorm="eac-r11unorm",a.EACR11Snorm="eac-r11snorm",a.EACRG11Unorm="eac-rg11unorm",a.EACRG11Snorm="eac-rg11snorm",a.ASTC4x4Unorm="astc-4x4-unorm",a.ASTC4x4UnormSRGB="astc-4x4-unorm-srgb",a.ASTC5x4Unorm="astc-5x4-unorm",a.ASTC5x4UnormSRGB="astc-5x4-unorm-srgb",a.ASTC5x5Unorm="astc-5x5-unorm",a.ASTC5x5UnormSRGB="astc-5x5-unorm-srgb",a.ASTC6x5Unorm="astc-6x5-unorm",a.ASTC6x5UnormSRGB="astc-6x5-unorm-srgb",a.ASTC6x6Unorm="astc-6x6-unorm",a.ASTC6x6UnormSRGB="astc-6x6-unorm-srgb",a.ASTC8x5Unorm="astc-8x5-unorm",a.ASTC8x5UnormSRGB="astc-8x5-unorm-srgb",a.ASTC8x6Unorm="astc-8x6-unorm",a.ASTC8x6UnormSRGB="astc-8x6-unorm-srgb",a.ASTC8x8Unorm="astc-8x8-unorm",a.ASTC8x8UnormSRGB="astc-8x8-unorm-srgb",a.ASTC10x5Unorm="astc-10x5-unorm",a.ASTC10x5UnormSRGB="astc-10x5-unorm-srgb",a.ASTC10x6Unorm="astc-10x6-unorm",a.ASTC10x6UnormSRGB="astc-10x6-unorm-srgb",a.ASTC10x8Unorm="astc-10x8-unorm",a.ASTC10x8UnormSRGB="astc-10x8-unorm-srgb",a.ASTC10x10Unorm="astc-10x10-unorm",a.ASTC10x10UnormSRGB="astc-10x10-unorm-srgb",a.ASTC12x10Unorm="astc-12x10-unorm",a.ASTC12x10UnormSRGB="astc-12x10-unorm-srgb",a.ASTC12x12Unorm="astc-12x12-unorm",a.ASTC12x12UnormSRGB="astc-12x12-unorm-srgb",a.Depth24UnormStencil8="depth24unorm-stencil8",a.Depth32FloatStencil8="depth32float-stencil8"})(I||(I={}));var hn;(function(a){a.ClampToEdge="clamp-to-edge",a.Repeat="repeat",a.MirrorRepeat="mirror-repeat"})(hn||(hn={}));var Be;(function(a){a.Nearest="nearest",a.Linear="linear"})(Be||(Be={}));var J0;(function(a){a.Nearest="nearest",a.Linear="linear"})(J0||(J0={}));var It;(function(a){a.Never="never",a.Less="less",a.Equal="equal",a.LessEqual="less-equal",a.Greater="greater",a.NotEqual="not-equal",a.GreaterEqual="greater-equal",a.Always="always"})(It||(It={}));var As;(function(a){a[a.Vertex=1]="Vertex",a[a.Fragment=2]="Fragment",a[a.Compute=4]="Compute"})(As||(As={}));var Ps;(function(a){a.Uniform="uniform",a.Storage="storage",a.ReadOnlyStorage="read-only-storage"})(Ps||(Ps={}));var ws;(function(a){a.Filtering="filtering",a.NonFiltering="non-filtering",a.Comparison="comparison"})(ws||(ws={}));var pi;(function(a){a.Float="float",a.UnfilterableFloat="unfilterable-float",a.Depth="depth",a.Sint="sint",a.Uint="uint"})(pi||(pi={}));var Oa;(function(a){a.WriteOnly="write-only"})(Oa||(Oa={}));var eo;(function(a){a.Error="error",a.Warning="warning",a.Info="info"})(eo||(eo={}));var to;(function(a){a.Validation="validation",a.Internal="internal"})(to||(to={}));var Wn;(function(a){a.Auto="auto"})(Wn||(Wn={}));var _i;(function(a){a.PointList="point-list",a.LineList="line-list",a.LineStrip="line-strip",a.TriangleList="triangle-list",a.TriangleStrip="triangle-strip"})(_i||(_i={}));var Er;(function(a){a.CCW="ccw",a.CW="cw"})(Er||(Er={}));var Dn;(function(a){a.None="none",a.Front="front",a.Back="back"})(Dn||(Dn={}));var io;(function(a){a[a.Red=1]="Red",a[a.Green=2]="Green",a[a.Blue=4]="Blue",a[a.Alpha=8]="Alpha",a[a.All=15]="All"})(io||(io={}));var Xt;(function(a){a.Zero="zero",a.One="one",a.Src="src",a.OneMinusSrc="one-minus-src",a.SrcAlpha="src-alpha",a.OneMinusSrcAlpha="one-minus-src-alpha",a.Dst="dst",a.OneMinusDst="one-minus-dst",a.DstAlpha="dst-alpha",a.OneMinusDstAlpha="one-minus-dst-alpha",a.SrcAlphaSaturated="src-alpha-saturated",a.Constant="constant",a.OneMinusConstant="one-minus-constant"})(Xt||(Xt={}));var Es;(function(a){a.Add="add",a.Subtract="subtract",a.ReverseSubtract="reverse-subtract",a.Min="min",a.Max="max"})(Es||(Es={}));var Li;(function(a){a.Keep="keep",a.Zero="zero",a.Replace="replace",a.Invert="invert",a.IncrementClamp="increment-clamp",a.DecrementClamp="decrement-clamp",a.IncrementWrap="increment-wrap",a.DecrementWrap="decrement-wrap"})(Li||(Li={}));var Ds;(function(a){a.Uint16="uint16",a.Uint32="uint32"})(Ds||(Ds={}));var ht;(function(a){a.Uint8x2="uint8x2",a.Uint8x4="uint8x4",a.Sint8x2="sint8x2",a.Sint8x4="sint8x4",a.Unorm8x2="unorm8x2",a.Unorm8x4="unorm8x4",a.Snorm8x2="snorm8x2",a.Snorm8x4="snorm8x4",a.Uint16x2="uint16x2",a.Uint16x4="uint16x4",a.Sint16x2="sint16x2",a.Sint16x4="sint16x4",a.Unorm16x2="unorm16x2",a.Unorm16x4="unorm16x4",a.Snorm16x2="snorm16x2",a.Snorm16x4="snorm16x4",a.Float16x2="float16x2",a.Float16x4="float16x4",a.Float32="float32",a.Float32x2="float32x2",a.Float32x3="float32x3",a.Float32x4="float32x4",a.Uint32="uint32",a.Uint32x2="uint32x2",a.Uint32x3="uint32x3",a.Uint32x4="uint32x4",a.Sint32="sint32",a.Sint32x2="sint32x2",a.Sint32x3="sint32x3",a.Sint32x4="sint32x4"})(ht||(ht={}));var Cr;(function(a){a.Vertex="vertex",a.Instance="instance"})(Cr||(Cr={}));var so;(function(a){a.Beginning="beginning",a.End="end"})(so||(so={}));var no;(function(a){a.Beginning="beginning",a.End="end"})(no||(no={}));var bt;(function(a){a.Load="load",a.Clear="clear"})(bt||(bt={}));var mi;(function(a){a.Store="store",a.Discard="discard"})(mi||(mi={}));var Rr;(function(a){a.Occlusion="occlusion",a.Timestamp="timestamp"})(Rr||(Rr={}));var Ir;(function(a){a.Opaque="opaque",a.Premultiplied="premultiplied"})(Ir||(Ir={}));var ro;(function(a){a.Unknown="unknown",a.Destroyed="destroyed"})(ro||(ro={}));var ao;(function(a){a.Validation="validation",a.OutOfMemory="out-of-memory",a.Internal="internal"})(ao||(ao={}));class zn{constructor(e,t,i,s=0,n=!1,r=!1,o=!1,l){this._isAlreadyOwned=!1,e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=r,this._divisor=l||1,t instanceof Sn?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=o?s:s*Float32Array.BYTES_PER_ELEMENT,n||this.create()}createVertexBuffer(e,t,i,s,n,r=!1,o){const l=r?t:t*Float32Array.BYTES_PER_ELEMENT,h=s?r?s:s*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new A(this._engine,this,e,this._updatable,!0,h,n===void 0?this._instanced:n,l,i,void 0,void 0,!0,this._divisor||o)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(e=null){!e&&this._buffer||(e=e||this._data,e&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e),this._data=e):this._buffer=this._engine.createVertexBuffer(e)))}_rebuild(){this._buffer=null,this.create(this._data)}update(e){this.create(e)}updateDirectly(e,t,i,s=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,s?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),t===0&&i===void 0?this._data=e:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null,this._data=null)}}class A{get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}constructor(e,t,i,s,n,r,o,l,h,c,u=!1,d=!1,_=1,f=!1){if(t instanceof zn?(this._buffer=t,this._ownsBuffer=f):(this._buffer=new zn(e,t,s,r,n,o,d),this._ownsBuffer=!0),this.uniqueId=A._Counter++,this._kind=i,c==null){const p=this.getData();this.type=A.FLOAT,p instanceof Int8Array?this.type=A.BYTE:p instanceof Uint8Array?this.type=A.UNSIGNED_BYTE:p instanceof Int16Array?this.type=A.SHORT:p instanceof Uint16Array?this.type=A.UNSIGNED_SHORT:p instanceof Int32Array?this.type=A.INT:p instanceof Uint32Array&&(this.type=A.UNSIGNED_INT)}else this.type=c;const g=A.GetTypeByteLength(this.type);d?(this._size=h||(r?r/g:A.DeduceStride(i)),this.byteStride=r||this._buffer.byteStride||this._size*g,this.byteOffset=l||0):(this._size=h||r||A.DeduceStride(i),this.byteStride=r?r*g:this._buffer.byteStride||this._size*g,this.byteOffset=(l||0)*g),this.normalized=u,this._instanced=o!==void 0?o:!1,this._instanceDivisor=o?_:0,this._computeHashCode()}_computeHashCode(){this.hashCode=(this.type-5120<<0)+((this.normalized?1:0)<<3)+(this._size<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){this._buffer&&this._buffer._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const i=this.getData();if(!i)return null;const s=this.getSize()*A.GetTypeByteLength(this.type),n=e*this.getSize();if(this.type!==A.FLOAT||this.byteStride!==s){const r=new Float32Array(n);return this.forEach(n,(o,l)=>r[l]=o),r}if(!(i instanceof Array||i instanceof Float32Array)||this.byteOffset!==0||i.length!==n)if(i instanceof Array){const r=this.byteOffset/4;return i.slice(r,r+n)}else{if(i instanceof ArrayBuffer)return new Float32Array(i,this.byteOffset,n);{let r=i.byteOffset+this.byteOffset;if(t){const l=new Float32Array(n),h=new Float32Array(i.buffer,r,n);return l.set(h),l}const o=r%4;return o&&(r=Math.max(0,r-o)),new Float32Array(i.buffer,r,n)}}return t?i.slice():i}getBuffer(){return this._buffer.getBuffer()}getStrideSize(){return this.byteStride/A.GetTypeByteLength(this.type)}getOffset(){return this.byteOffset/A.GetTypeByteLength(this.type)}getSize(e=!1){return e?this._size*A.GetTypeByteLength(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e)}update(e){this._buffer.update(e)}updateDirectly(e,t,i=!1){this._buffer.updateDirectly(e,t,void 0,i)}dispose(){this._ownsBuffer&&this._buffer.dispose()}forEach(e,t){A.ForEach(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,t)}static DeduceStride(e){switch(e){case A.UVKind:case A.UV2Kind:case A.UV3Kind:case A.UV4Kind:case A.UV5Kind:case A.UV6Kind:return 2;case A.NormalKind:case A.PositionKind:return 3;case A.ColorKind:case A.MatricesIndicesKind:case A.MatricesIndicesExtraKind:case A.MatricesWeightsKind:case A.MatricesWeightsExtraKind:case A.TangentKind:return 4;default:throw new Error("Invalid kind '"+e+"'")}}static GetTypeByteLength(e){switch(e){case A.BYTE:case A.UNSIGNED_BYTE:return 1;case A.SHORT:case A.UNSIGNED_SHORT:return 2;case A.INT:case A.UNSIGNED_INT:case A.FLOAT:return 4;default:throw new Error("Invalid type '".concat(e,"'"))}}static ForEach(e,t,i,s,n,r,o,l){if(e instanceof Array){let h=t/4;const c=i/4;for(let u=0;u!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&a.getClassName()==="SubMesh"?a.clone(e):a.clone?a.clone():null;function cu(a){const e=[];do Object.getOwnPropertyNames(a).forEach(function(t){e.indexOf(t)===-1&&e.push(t)});while(a=Object.getPrototypeOf(a));return e}class a0{static DeepCopy(e,t,i,s){const n=cu(e);for(const r of n){if(r[0]==="_"&&(!s||s.indexOf(r)===-1)||r.endsWith("Observable")||i&&i.indexOf(r)!==-1)continue;const o=e[r],l=typeof o;if(l!=="function")try{if(l==="object")if(o instanceof Array){if(t[r]=[],o.length>0)if(typeof o[0]=="object")for(let h=0;hs.status!==0||n>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,n)*t}}class vn extends Error{}vn._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const Ks={MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class hs extends vn{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",vn._setPrototypeOf(this,hs.prototype)}}const gl=a=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,n,r,o,l,h,c=0;const u=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a);for(;c>2,o=(i&3)<<4|s>>4,l=(s&15)<<2|n>>6,h=n&63,isNaN(s)?l=h=64:isNaN(n)&&(h=64),t+=e.charAt(r)+e.charAt(o)+e.charAt(l)+e.charAt(h);return t},ml=a=>atob(a),fu=a=>{const e=ml(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;sa},xl=a=>(a=a.replace(/#/gm,"%23"),a),l0=(a,e)=>{if(!(a&&a.indexOf("data:")===0)&&Ut.CorsBehavior)if(typeof Ut.CorsBehavior=="string"||Ut.CorsBehavior instanceof String)e.crossOrigin=Ut.CorsBehavior;else{const t=Ut.CorsBehavior(a);t&&(e.crossOrigin=t)}},h0=(a,e,t,i,s="",n)=>{var r;let o,l=!1;a instanceof ArrayBuffer||ArrayBuffer.isView(a)?typeof Blob<"u"&&typeof URL<"u"?(o=URL.createObjectURL(new Blob([a],{type:s})),l=!0):o="data:".concat(s,";base64,")+gl(a):a instanceof Blob?(o=URL.createObjectURL(a),l=!0):(o=xl(a),o=Ut.PreprocessUrl(a));const h=Ie.LastCreatedEngine,c=y=>{if(t){const E=o||a.toString();t("Error while trying to load image: ".concat(E.indexOf("http")===0||E.length<=128?E:E.slice(0,128)+"..."),y)}};if(typeof Image>"u"||(r=h==null?void 0:h._features.forceBitmapOverHTMLImageElement)!==null&&r!==void 0&&r)return Fs(o,y=>{h.createImageBitmap(new Blob([y],{type:s}),{premultiplyAlpha:"none",...n}).then(E=>{e(E),l&&URL.revokeObjectURL(o)}).catch(E=>{t&&t("Error while trying to load image: "+a,E)})},void 0,i||void 0,!0,(y,E)=>{c(E)}),null;const u=new Image;l0(o,u);const d=[],_=()=>{d.forEach(y=>{y.target.addEventListener(y.name,y.handler)})},f=()=>{d.forEach(y=>{y.target.removeEventListener(y.name,y.handler)}),d.length=0},g=()=>{f(),e(u),l&&u.src&&URL.revokeObjectURL(u.src)},p=y=>{f(),c(y),l&&u.src&&URL.revokeObjectURL(u.src)},x=y=>{if(y.blockedURI!==u.src)return;f();const E=new Error("CSP violation of policy ".concat(y.effectiveDirective," ").concat(y.blockedURI,". Current policy is ").concat(y.originalPolicy));Ie.UseFallbackTexture=!1,c(E),l&&u.src&&URL.revokeObjectURL(u.src),u.src=""};d.push({target:u,name:"load",handler:g}),d.push({target:u,name:"error",handler:p}),d.push({target:document,name:"securitypolicyviolation",handler:x}),_();const m=o.substring(0,5)==="blob:",T=o.substring(0,5)==="data:",S=()=>{m||T?u.src=o:Fs(o,(y,E,P)=>{const C=!s&&P?P:s,R=new Blob([y],{type:C}),w=URL.createObjectURL(R);l=!0,u.src=w},void 0,i||void 0,!0,(y,E)=>{c(E)})},b=()=>{i&&i.loadImage(o,u)};if(!m&&!T&&i&&i.enableTexturesOffline)i.open(b,S);else{if(o.indexOf("file:")!==-1){const y=decodeURIComponent(o.substring(5).toLowerCase());if(Fn.FilesToLoad[y]&&typeof URL<"u"){try{let E;try{E=URL.createObjectURL(Fn.FilesToLoad[y])}catch{E=URL.createObjectURL(Fn.FilesToLoad[y])}u.src=E,l=!0}catch{u.src=""}return u}}S()}return u},Hn=(a,e,t,i,s)=>{const n=new FileReader,r={onCompleteObservable:new ee,abort:()=>n.abort()};return n.onloadend=()=>r.onCompleteObservable.notifyObservers(r),s&&(n.onerror=()=>{s(new o0("Unable to read ".concat(a.name),a))}),n.onload=o=>{e(o.target.result)},t&&(n.onprogress=t),i?n.readAsArrayBuffer(a):n.readAsText(a),r},Fs=(a,e,t,i,s,n,r)=>{if(a.name)return Hn(a,e,t,s,n?c=>{n(void 0,c)}:void 0);const o=a;if(o.indexOf("file:")!==-1){let c=decodeURIComponent(o.substring(5).toLowerCase());c.indexOf("./")===0&&(c=c.substring(2));const u=Fn.FilesToLoad[c];if(u)return Hn(u,e,t,s,n?d=>n(void 0,new Pr(d.message,d.file)):void 0)}const{match:l,type:h}=_u(o);if(l){const c={onCompleteObservable:new ee,abort:()=>()=>{}};try{const u=s?d0(o):yl(o);e(u,void 0,h)}catch(u){n?n(void 0,u):H.Error(u.message||"Failed to parse the Data URL")}return Mr.SetImmediate(()=>{c.onCompleteObservable.notifyObservers(c)}),c}return c0(o,(c,u)=>{e(c,u==null?void 0:u.responseURL,u==null?void 0:u.getResponseHeader("content-type"))},t,i,s,n?c=>{n(c.request,new Pr(c.message,c.request))}:void 0,r)},c0=(a,e,t,i,s,n,r)=>{a=xl(a),a=Ut.PreprocessUrl(a);const o=Ut.BaseUrl+a;let l=!1;const h={onCompleteObservable:new ee,abort:()=>l=!0},c=()=>{let u=new Jt,d=null,_;const f=()=>{u&&(t&&u.removeEventListener("progress",t),_&&u.removeEventListener("readystatechange",_),u.removeEventListener("loadend",g))};let g=()=>{f(),h.onCompleteObservable.notifyObservers(h),h.onCompleteObservable.clear(),t=void 0,_=null,g=null,n=void 0,r=void 0,e=void 0};h.abort=()=>{l=!0,g&&g(),u&&u.readyState!==(XMLHttpRequest.DONE||4)&&u.abort(),d!==null&&(clearTimeout(d),d=null),u=null};const p=m=>{const T=m.message||"Unknown error";n&&u?n(new wr(T,u)):H.Error(T)},x=m=>{if(u){if(u.open("GET",o),r)try{r(u)}catch(T){p(T);return}s&&(u.responseType="arraybuffer"),t&&u.addEventListener("progress",t),g&&u.addEventListener("loadend",g),_=()=>{if(!(l||!u)&&u.readyState===(XMLHttpRequest.DONE||4)){if(_&&u.removeEventListener("readystatechange",_),u.status>=200&&u.status<300||u.status===0&&(!Pt()||bl())){try{e&&e(s?u.response:u.responseText,u)}catch(b){p(b)}return}const T=Ut.DefaultRetryStrategy;if(T){const b=T(o,u,m);if(b!==-1){f(),u=new Jt,d=setTimeout(()=>x(m+1),b);return}}const S=new wr("Error status: "+u.status+" "+u.statusText+" - Unable to load "+o,u);n&&n(S)}},u.addEventListener("readystatechange",_),u.send()}};x(0)};if(i&&i.enableSceneOffline){const u=_=>{_&&_.status>400?n&&n(_):c()},d=()=>{i&&i.loadFile(Ut.BaseUrl+a,_=>{!l&&e&&e(_),h.onCompleteObservable.notifyObservers(h)},t?_=>{!l&&t&&t(_)}:void 0,u,s)};i.open(d,u)}else c();return h},bl=()=>typeof location<"u"&&location.protocol==="file:",u0=a=>vl.test(a),_u=a=>{const e=vl.exec(a);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace("base64,","")}};function d0(a){return fu(a.split(",")[1])}const yl=a=>ml(a.split(",")[1]),pu=()=>{Ee._FileToolsLoadImage=h0,Ee._FileToolsLoadFile=Fs,Qi._FileToolsLoadFile=Fs};pu();let Cn;const gu=(a,e,t,i,s,n,r,o,l,h)=>{Cn={DecodeBase64UrlToBinary:a,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:i,IsFileURL:s,LoadFile:n,LoadImage:r,ReadFile:o,RequestFile:l,SetCorsBehavior:h},Object.defineProperty(Cn,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(c){t.DefaultRetryStrategy=c}}),Object.defineProperty(Cn,"BaseUrl",{get:function(){return t.BaseUrl},set:function(c){t.BaseUrl=c}}),Object.defineProperty(Cn,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(c){t.PreprocessUrl=c}}),Object.defineProperty(Cn,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(c){t.CorsBehavior=c}})};gu(d0,yl,Ut,u0,bl,Fs,h0,Hn,c0,l0);class On{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=$s(e);if(t)return t;H.Warn(e+" not found, you may have missed an import.");const i=e.split(".");let s=window||this;for(let n=0,r=i.length;n{const e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}class re{static get BaseUrl(){return Ut.BaseUrl}static set BaseUrl(e){Ut.BaseUrl=e}static get DefaultRetryStrategy(){return Ut.DefaultRetryStrategy}static set DefaultRetryStrategy(e){Ut.DefaultRetryStrategy=e}static get CorsBehavior(){return Ut.CorsBehavior}static set CorsBehavior(e){Ut.CorsBehavior=e}static get UseFallbackTexture(){return Ie.UseFallbackTexture}static set UseFallbackTexture(e){Ie.UseFallbackTexture=e}static get RegisteredExternalClasses(){return On.RegisteredExternalClasses}static set RegisteredExternalClasses(e){On.RegisteredExternalClasses=e}static get fallbackTexture(){return Ie.FallbackTexture}static set fallbackTexture(e){Ie.FallbackTexture=e}static FetchToRef(e,t,i,s,n,r){const o=Math.abs(e)*i%i|0,l=Math.abs(t)*s%s|0,h=(o+l*i)*4;r.r=n[h]/255,r.g=n[h+1]/255,r.b=n[h+2]/255,r.a=n[h+3]/255}static Mix(e,t,i){return e*(1-i)+t*i}static Instantiate(e){return On.Instantiate(e)}static SetImmediate(e){Mr.SetImmediate(e)}static IsExponentOfTwo(e){let t=1;do t*=2;while(t{Fs(e,n=>{i(n)},void 0,void 0,t,(n,r)=>{s(r)})})}static LoadScript(e,t,i,s){if(typeof importScripts=="function"){try{importScripts(e),t()}catch(o){i==null||i("Unable to load script '".concat(e,"' in worker"),o)}return}else if(!Pt()){i==null||i("Cannot load script '".concat(e,"' outside of a window or a worker"));return}const n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",e),s&&(r.id=s),r.onload=()=>{t&&t()},r.onerror=o=>{i&&i("Unable to load script '".concat(e,"'"),o)},n.appendChild(r)}static LoadScriptAsync(e){return new Promise((t,i)=>{this.LoadScript(e,()=>{t()},(s,n)=>{i(n||new Error(s))})})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,n={onCompleteObservable:new ee,abort:()=>s.abort()};return s.onloadend=()=>{n.onCompleteObservable.notifyObservers(n)},s.onload=r=>{t(r.target.result)},s.onprogress=i,s.readAsDataURL(e),n}static ReadFile(e,t,i,s,n){return Hn(e,t,i,s,n)}static FileAsURL(e){const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,i,s){a0.DeepCopy(e,t,i,s)}static IsEmpty(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let i=0;i{const l=atob(this.toDataURL(r,o).split(",")[1]),h=l.length,c=new Uint8Array(h);for(let u=0;u"u")return;const i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=i,s.download=t,s.addEventListener("click",()=>{s.parentElement&&s.parentElement.removeChild(s)}),s.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,i,s,n="image/png"){throw Ae("ScreenshotTools")}static CreateScreenshotAsync(e,t,i,s="image/png"){throw Ae("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,n="image/png",r=1,o=!1,l){throw Ae("ScreenshotTools")}static CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",n=1,r=!1,o){throw Ae("ScreenshotTools")}static RandomId(){return Tl()}static IsBase64(e){return u0(e)}static DecodeBase64(e){return d0(e)}static get errorsCount(){return H.errorsCount}static Log(e){H.Log(e)}static Warn(e){H.Warn(e)}static Error(e){H.Error(e)}static get LogCache(){return H.LogCache}static ClearLogCache(){H.ClearLogCache()}static set LogLevels(e){H.LogLevels=e}static set PerformanceLogLevel(e){if((e&re.PerformanceUserMarkLogLevel)===re.PerformanceUserMarkLogLevel){re.StartPerformanceCounter=re._StartUserMark,re.EndPerformanceCounter=re._EndUserMark;return}if((e&re.PerformanceConsoleLogLevel)===re.PerformanceConsoleLogLevel){re.StartPerformanceCounter=re._StartPerformanceConsole,re.EndPerformanceCounter=re._EndPerformanceConsole;return}re.StartPerformanceCounter=re._StartPerformanceCounterDisabled,re.EndPerformanceCounter=re._EndPerformanceCounterDisabled}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!re._Performance){if(!Pt())return;re._Performance=window.performance}!t||!re._Performance.mark||re._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!re._Performance.mark||(re._Performance.mark(e+"-End"),re._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(re._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(re._EndUserMark(e,t),console.timeEnd(e))}static get Now(){return Pi.Now}static GetClassName(e,t=!1){let i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i}static First(e,t){for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){let i=null,s=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const n=t?e:Object.getPrototypeOf(e);i=n.constructor.__bjsclassName__,s=n.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(s!=null?s+".":"")+i:null}static DelayAsync(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return n0()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}re.UseCustomRequestHeaders=!1;re.CustomRequestHeaders=Jt.CustomRequestHeaders;re._TmpFloatArray=new Float32Array(1);re.GetDOMTextContent=Xr;re.GetAbsoluteUrl=typeof document=="object"?a=>{const e=document.createElement("a");return e.href=a,e.href}:typeof URL=="function"&&typeof location=="object"?a=>new URL(a,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};re.NoneLogLevel=H.NoneLogLevel;re.MessageLogLevel=H.MessageLogLevel;re.WarningLogLevel=H.WarningLogLevel;re.ErrorLogLevel=H.ErrorLogLevel;re.AllLogLevel=H.AllLogLevel;re.IsWindowObjectExist=Pt;re.PerformanceNoneLogLevel=0;re.PerformanceUserMarkLogLevel=1;re.PerformanceConsoleLogLevel=2;re.StartPerformanceCounter=re._StartPerformanceCounterDisabled;re.EndPerformanceCounter=re._EndPerformanceCounterDisabled;class Dr{constructor(e,t,i,s=0){this.iterations=e,this.index=s-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){this._done||(this.index+1{n&&n()?o.breakLoop():setTimeout(()=>{for(let l=0;l=e)break;if(i(h),n&&n()){o.breakLoop();break}}o.executeNext()},r)},s)}}Ie.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z";Ee.prototype.createUniformBuffer=function(a){const e=this._gl.createBuffer();if(!e)throw new Error("Unable to create uniform buffer");const t=new Vn(e);return this.bindUniformBuffer(t),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),t.references=1,t};Ee.prototype.createDynamicUniformBuffer=function(a){const e=this._gl.createBuffer();if(!e)throw new Error("Unable to create dynamic uniform buffer");const t=new Vn(e);return this.bindUniformBuffer(t),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),t.references=1,t};Ee.prototype.updateUniformBuffer=function(a,e,t,i){this.bindUniformBuffer(a),t===void 0&&(t=0),i===void 0?e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,e):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,new Float32Array(e)):e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,e.subarray(t,t+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(e).subarray(t,t+i)),this.bindUniformBuffer(null)};Ee.prototype.bindUniformBuffer=function(a){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,a?a.underlyingResource:null)};Ee.prototype.bindUniformBufferBase=function(a,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,a?a.underlyingResource:null)};Ee.prototype.bindUniformBlock=function(a,e,t){const i=a.program,s=this._gl.getUniformBlockIndex(i,e);s!==4294967295&&this._gl.uniformBlockBinding(i,s,t)};class oe{constructor(e,t,i,s,n=!1){this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||n,this._dynamic=i,this._name=s!=null?s:"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._engine._features.trackUbosInFrame&&(this._buffers=[],this._bufferIndex=-1,this._createBufferOnWrite=!1,this._currentFrameId=0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic!==void 0}getData(){return this._bufferData}getBuffer(){return this._buffer}_fillAlignment(e){let t;if(e<=2?t=e:t=4,this._uniformLocationPointer%t!==0){const i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const s=this._uniformLocationPointer-i;for(let n=0;n0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),this._uniformArraySizes[e]={strideSize:t,arraySize:i},t==16)t=t*i;else{const r=(4-t)*i;t=t*i+r}s=[];for(let n=0;n1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._engine._features.trackUbosInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._engine._features._collectUbosUpdatedInFrame&&(oe._UpdatedUbosInFrame[this._name]||(oe._UpdatedUbosInFrame[this._name]=0),oe._UpdatedUbosInFrame[this._name]++),this._needSync=!1,this._createBufferOnWrite=this._engine._features.trackUbosInFrame}}_createNewBuffer(){this._bufferIndex+10?(this._needSync=this._bufferIndex!==0,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,i){this._checkNewFrame();let s=this._uniformLocations[e];if(s===void 0){if(this._buffer){H.Error("Cannot add an uniform after UBO has been created.");return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let n=0;n=0&&(d.push(o[u]),_.push(f))}this.shaderProcessingContext.attributeNamesFromEffect=d,this.shaderProcessingContext.attributeLocationsFromEffect=_}buildUniformLayout(){if(this.shaderProcessingContext.leftOverUniforms.length){this.uniformBuffer=new oe(this.engine,void 0,void 0,"leftOver-"+this._name);for(const e of this.shaderProcessingContext.leftOverUniforms){const t=e.type.replace(/^(.*?)(<.*>)?$/,"$1"),i=rt.UniformSizes[t];this.uniformBuffer.addUniform(e.name,i,e.length),this._leftOverUniformsByName[e.name]=e.type}this.uniformBuffer.create()}}dispose(){this.uniformBuffer&&this.uniformBuffer.dispose()}setInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt(e,t)}setInt2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt2(e,t,i)}setInt3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt3(e,t,i,s)}setInt4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt4(e,t,i,s,n)}setIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateIntArray(e,t)}setIntArray2(e,t){this.setIntArray(e,t)}setIntArray3(e,t){this.setIntArray(e,t)}setIntArray4(e,t){this.setIntArray(e,t)}setUInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt(e,t)}setUInt2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt2(e,t,i)}setUInt3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt3(e,t,i,s)}setUInt4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt4(e,t,i,s,n)}setUIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUIntArray(e,t)}setUIntArray2(e,t){this.setUIntArray(e,t)}setUIntArray3(e,t){this.setUIntArray(e,t)}setUIntArray4(e,t){this.setUIntArray(e,t)}setArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateArray(e,t)}setArray2(e,t){this.setArray(e,t)}setArray3(e,t){this.setArray(e,t)}setArray4(e,t){this.setArray(e,t)}setMatrices(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrices(e,t)}setMatrix(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix(e,t)}setMatrix3x3(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix3x3(e,t)}setMatrix2x2(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix2x2(e,t)}setFloat(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat(e,t)}setVector2(e,t){this.setFloat2(e,t.x,t.y)}setFloat2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat2(e,t,i)}setVector3(e,t){this.setFloat3(e,t.x,t.y,t.z)}setFloat3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat3(e,t,i,s)}setVector4(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setQuaternion(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setFloat4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat4(e,t,i,s,n)}setColor3(e,t){this.setFloat3(e,t.r,t.g,t.b)}setColor4(e,t,i){this.setFloat4(e,t.r,t.g,t.b,i)}setDirectColor4(e,t){this.setFloat4(e,t.r,t.g,t.b,t.a)}_getVertexShaderCode(){var e;return(e=this.sources)===null||e===void 0?void 0:e.vertex}_getFragmentShaderCode(){var e;return(e=this.sources)===null||e===void 0?void 0:e.fragment}}const vu=4,xu=65536,lo={mat2:2,mat3:3,mat4:4,mat2x2:2,mat3x3:3,mat4x4:4};class bi{static get KnownUBOs(){return bi._SimplifiedKnownBindings?bi._SimplifiedKnownUBOs:bi._KnownUBOs}constructor(e){this.shaderLanguage=e,this._attributeNextLocation=0,this._varyingNextLocation=0,this.freeGroupIndex=0,this.freeBindingIndex=0,this.availableVaryings={},this.availableAttributes={},this.availableBuffers={},this.availableTextures={},this.availableSamplers={},this.orderedAttributes=[],this.bindGroupLayoutEntries=[],this.bindGroupLayoutEntryInfo=[],this.bindGroupEntries=[],this.bufferNames=[],this.textureNames=[],this.samplerNames=[],this.leftOverUniforms=[],this._findStartingGroupBinding()}_findStartingGroupBinding(){const e=bi.KnownUBOs,t=[];for(const i in e){const s=e[i].binding;s.groupIndex!==-1&&(t[s.groupIndex]===void 0?t[s.groupIndex]=s.bindingIndex:t[s.groupIndex]=Math.max(t[s.groupIndex],s.bindingIndex))}this.freeGroupIndex=t.length-1,this.freeGroupIndex===0?(this.freeGroupIndex++,this.freeBindingIndex=0):this.freeBindingIndex=t[t.length-1]+1}getAttributeNextLocation(e,t=0){var i;const s=this._attributeNextLocation;return this._attributeNextLocation+=((i=lo[e])!==null&&i!==void 0?i:1)*(t||1),s}getVaryingNextLocation(e,t=0){var i;const s=this._varyingNextLocation;return this._varyingNextLocation+=((i=lo[e])!==null&&i!==void 0?i:1)*(t||1),s}getNextFreeUBOBinding(){return this._getNextFreeBinding(1)}_getNextFreeBinding(e){if(this.freeBindingIndex>xu-e&&(this.freeGroupIndex++,this.freeBindingIndex=0),this.freeGroupIndex===vu)throw"Too many textures or UBOs have been declared and it is not supported in WebGPU.";const t={groupIndex:this.freeGroupIndex,bindingIndex:this.freeBindingIndex};return this.freeBindingIndex+=e,t}}bi._SimplifiedKnownBindings=!0;bi._SimplifiedKnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:-1,bindingIndex:-1}},Light1:{binding:{groupIndex:-1,bindingIndex:-1}},Light2:{binding:{groupIndex:-1,bindingIndex:-1}},Light3:{binding:{groupIndex:-1,bindingIndex:-1}},Light4:{binding:{groupIndex:-1,bindingIndex:-1}},Light5:{binding:{groupIndex:-1,bindingIndex:-1}},Light6:{binding:{groupIndex:-1,bindingIndex:-1}},Light7:{binding:{groupIndex:-1,bindingIndex:-1}},Light8:{binding:{groupIndex:-1,bindingIndex:-1}},Light9:{binding:{groupIndex:-1,bindingIndex:-1}},Light10:{binding:{groupIndex:-1,bindingIndex:-1}},Light11:{binding:{groupIndex:-1,bindingIndex:-1}},Light12:{binding:{groupIndex:-1,bindingIndex:-1}},Light13:{binding:{groupIndex:-1,bindingIndex:-1}},Light14:{binding:{groupIndex:-1,bindingIndex:-1}},Light15:{binding:{groupIndex:-1,bindingIndex:-1}},Light16:{binding:{groupIndex:-1,bindingIndex:-1}},Light17:{binding:{groupIndex:-1,bindingIndex:-1}},Light18:{binding:{groupIndex:-1,bindingIndex:-1}},Light19:{binding:{groupIndex:-1,bindingIndex:-1}},Light20:{binding:{groupIndex:-1,bindingIndex:-1}},Light21:{binding:{groupIndex:-1,bindingIndex:-1}},Light22:{binding:{groupIndex:-1,bindingIndex:-1}},Light23:{binding:{groupIndex:-1,bindingIndex:-1}},Light24:{binding:{groupIndex:-1,bindingIndex:-1}},Light25:{binding:{groupIndex:-1,bindingIndex:-1}},Light26:{binding:{groupIndex:-1,bindingIndex:-1}},Light27:{binding:{groupIndex:-1,bindingIndex:-1}},Light28:{binding:{groupIndex:-1,bindingIndex:-1}},Light29:{binding:{groupIndex:-1,bindingIndex:-1}},Light30:{binding:{groupIndex:-1,bindingIndex:-1}},Light31:{binding:{groupIndex:-1,bindingIndex:-1}},Material:{binding:{groupIndex:-1,bindingIndex:-1}},Mesh:{binding:{groupIndex:-1,bindingIndex:-1}},Internals:{binding:{groupIndex:-1,bindingIndex:-1}}};bi._KnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:1,bindingIndex:0}},Light1:{binding:{groupIndex:1,bindingIndex:1}},Light2:{binding:{groupIndex:1,bindingIndex:2}},Light3:{binding:{groupIndex:1,bindingIndex:3}},Light4:{binding:{groupIndex:1,bindingIndex:4}},Light5:{binding:{groupIndex:1,bindingIndex:5}},Light6:{binding:{groupIndex:1,bindingIndex:6}},Light7:{binding:{groupIndex:1,bindingIndex:7}},Light8:{binding:{groupIndex:1,bindingIndex:8}},Light9:{binding:{groupIndex:1,bindingIndex:9}},Light10:{binding:{groupIndex:1,bindingIndex:10}},Light11:{binding:{groupIndex:1,bindingIndex:11}},Light12:{binding:{groupIndex:1,bindingIndex:12}},Light13:{binding:{groupIndex:1,bindingIndex:13}},Light14:{binding:{groupIndex:1,bindingIndex:14}},Light15:{binding:{groupIndex:1,bindingIndex:15}},Light16:{binding:{groupIndex:1,bindingIndex:16}},Light17:{binding:{groupIndex:1,bindingIndex:17}},Light18:{binding:{groupIndex:1,bindingIndex:18}},Light19:{binding:{groupIndex:1,bindingIndex:19}},Light20:{binding:{groupIndex:1,bindingIndex:20}},Light21:{binding:{groupIndex:1,bindingIndex:21}},Light22:{binding:{groupIndex:1,bindingIndex:22}},Light23:{binding:{groupIndex:1,bindingIndex:23}},Light24:{binding:{groupIndex:1,bindingIndex:24}},Light25:{binding:{groupIndex:1,bindingIndex:25}},Light26:{binding:{groupIndex:1,bindingIndex:26}},Light27:{binding:{groupIndex:1,bindingIndex:27}},Light28:{binding:{groupIndex:1,bindingIndex:28}},Light29:{binding:{groupIndex:1,bindingIndex:29}},Light30:{binding:{groupIndex:1,bindingIndex:30}},Light31:{binding:{groupIndex:1,bindingIndex:31}},Material:{binding:{groupIndex:2,bindingIndex:0}},Mesh:{binding:{groupIndex:2,bindingIndex:1}},Internals:{binding:{groupIndex:2,bindingIndex:2}}};class bu extends rt{constructor(){super(...arguments),this._missingVaryings=[],this._textureArrayProcessing=[],this._vertexIsGLES3=!1,this._fragmentIsGLES3=!1,this.shaderLanguage=at.GLSL,this.parseGLES3=!0}_getArraySize(e,t,i){let s=0;const n=e.indexOf("["),r=e.indexOf("]");if(n>0&&r>0){const o=e.substring(n+1,r);s=+o,isNaN(s)&&(s=+i[o.trim()]),e=e.substr(0,n)}return[e,t,s]}initializeShaders(e){this._webgpuProcessingContext=e,this._missingVaryings.length=0,this._textureArrayProcessing.length=0,this.attributeKeywordName=void 0,this.varyingVertexKeywordName=void 0,this.varyingFragmentKeywordName=void 0}preProcessShaderCode(e,t){const i="// Internals UBO\r\nuniform ".concat(rt.InternalsUBOName," {\nfloat yFactor_;\nfloat textureOutputHeight_;\n};\n"),s=e.indexOf("// Internals UBO")!==-1;return t?(this._fragmentIsGLES3=e.indexOf("#version 3")!==-1,this._fragmentIsGLES3&&(this.varyingFragmentKeywordName="in"),s?e:i+"##INJECTCODE##\n"+e):(this._vertexIsGLES3=e.indexOf("#version 3")!==-1,this._vertexIsGLES3&&(this.attributeKeywordName="in",this.varyingVertexKeywordName="out"),s?e:i+e)}varyingProcessor(e,t,i){this._preProcessors=i;const s=/\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,n=/\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,r=/\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,l=(t&&this._fragmentIsGLES3?n:!t&&this._vertexIsGLES3?s:r).exec(e);if(l!==null){const h=l[1],c=l[2];let u;t?(u=this._webgpuProcessingContext.availableVaryings[c],this._missingVaryings[u]="",u===void 0&&H.Warn('Invalid fragment shader: The varying named "'.concat(c,'" is not declared in the vertex shader! This declaration will be ignored.'))):(u=this._webgpuProcessingContext.getVaryingNextLocation(h,this._getArraySize(c,h,i)[2]),this._webgpuProcessingContext.availableVaryings[c]=u,this._missingVaryings[u]="layout(location = ".concat(u,") in ").concat(h," ").concat(c,";")),e=e.replace(l[0],u===void 0?"":"layout(location = ".concat(u,") ").concat(t?"in":"out"," ").concat(h," ").concat(c,";"))}return e}attributeProcessor(e,t){this._preProcessors=t;const i=/\s*in\s+(\S+)\s+(\S+)\s*;/gm,s=/\s*attribute\s+(\S+)\s+(\S+)\s*;/gm,r=(this._vertexIsGLES3?i:s).exec(e);if(r!==null){const o=r[1],l=r[2],h=this._webgpuProcessingContext.getAttributeNextLocation(o,this._getArraySize(l,o,t)[2]);this._webgpuProcessingContext.availableAttributes[l]=h,this._webgpuProcessingContext.orderedAttributes[h]=l,e=e.replace(r[0],"layout(location = ".concat(h,") in ").concat(o," ").concat(l,";"))}return e}uniformProcessor(e,t,i){var s;this._preProcessors=i;const r=/\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);if(r!==null){let o=r[1],l=r[2];if(o.indexOf("sampler")===0||o.indexOf("sampler")===1){let h=0;[l,o,h]=this._getArraySize(l,o,i);let c=this._webgpuProcessingContext.availableTextures[l];if(!c){c={autoBindSampler:!0,isTextureArray:h>0,isStorageTexture:!1,textures:[],sampleType:pi.Float};for(let P=0;P<(h||1);++P)c.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}const u=(s=rt._SamplerTypeByWebGLSamplerType[o])!==null&&s!==void 0?s:"sampler",d=!!rt._IsComparisonSamplerByWebGPUSamplerType[u],_=d?ws.Comparison:ws.Filtering,f=l+rt.AutoSamplerSuffix;let g=this._webgpuProcessingContext.availableSamplers[f];g||(g={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:_});const p=o.charAt(0)==="u"?"u":o.charAt(0)==="i"?"i":"";p&&(o=o.substr(1));const x=d?pi.Depth:p==="u"?pi.Uint:p==="i"?pi.Sint:pi.Float;c.sampleType=x;const m=h>0,T=g.binding.groupIndex,S=g.binding.bindingIndex,b=rt._SamplerFunctionByWebGLSamplerType[o],y=rt._TextureTypeByWebGLSamplerType[o],E=rt._GpuTextureViewDimensionByWebGPUTextureType[y];if(!m)h=1,e="layout(set = ".concat(T,", binding = ").concat(S,") uniform ").concat(p).concat(u," ").concat(f,";\n layout(set = ").concat(c.textures[0].groupIndex,", binding = ").concat(c.textures[0].bindingIndex,") uniform ").concat(y," ").concat(l,"Texture;\n #define ").concat(l," ").concat(p).concat(b,"(").concat(l,"Texture, ").concat(f,")");else{const P=[];P.push("layout(set = ".concat(T,", binding = ").concat(S,") uniform ").concat(p).concat(u," ").concat(f,";")),e="\r\n";for(let C=0;C0?"\r\n":"","#define ").concat(l).concat(C," ").concat(p).concat(b,"(").concat(l,"Texture").concat(C,", ").concat(f,")")}e=P.join("\r\n")+e,this._textureArrayProcessing.push(l)}this._webgpuProcessingContext.availableTextures[l]=c,this._webgpuProcessingContext.availableSamplers[f]=g,this._addSamplerBindingDescription(f,g,!t);for(let P=0;P=0,h="\n glFragCoord_ = gl_FragCoord;\n if (yFactor_ == 1.) {\n glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;\n }\n ",c=l?"vec4 glFragCoord_;\n":"";if(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/gl_FragCoord/g,"glFragCoord_"),!this._fragmentIsGLES3)e=e.replace(/void\s+?main\s*\(/g,(r?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(");else{const u=/^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);u!==null&&(e=e.substring(0,u.index)+"layout(location = 0) "+e.substring(u.index))}e=e.replace(/dFdy/g,"(-yFactor_)*dFdy"),e=e.replace("##INJECTCODE##",c),l&&(e=this._injectStartingAndEndingCode(e,"void main",h))}else if(e=e.replace(/gl_InstanceID/g,"gl_InstanceIndex"),e=e.replace(/gl_VertexID/g,"gl_VertexIndex"),t.indexOf("#define MULTIVIEW")!==-1)return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;if(!i){const l=e.lastIndexOf("}");e=e.substring(0,l),e+="gl_Position.y *= yFactor_;\n",n.isNDCHalfZRange||(e+="gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0;\n"),e+="}"}return e}_applyTextureArrayProcessing(e,t){const i=new RegExp(t+"\\s*\\[(.+)?\\]","gm");let s=i.exec(e);for(;s!==null;){const n=s[1];let r=+n;this._preProcessors&&isNaN(r)&&(r=+this._preProcessors[n.trim()]),e=e.replace(s[0],t+r),s=i.exec(e)}return e}_generateLeftOverUBOCode(e,t){let i="layout(set = ".concat(t.binding.groupIndex,", binding = ").concat(t.binding.bindingIndex,") uniform ").concat(e," {\n ");for(const s of this._webgpuProcessingContext.leftOverUniforms)s.length>0?i+=" ".concat(s.type," ").concat(s.name,"[").concat(s.length,"];\n"):i+=" ".concat(s.type," ").concat(s.name,";\n");return i+="};\n\n",i}finalizeShaders(e,t){for(let s=0;s0&&(t=n+"\n"+t)}const i=this._buildLeftOverUBO();return e=i+e,t=i+t,this._collectBindingNames(),this._preCreateBindGroupEntries(),this._preProcessors=null,{vertexCode:e,fragmentCode:t}}}function ur(a,e,t,i){let s=i,n=0,r="";for(;s=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e==95}function La(a){let e=0,t="",i=!1;const s=[];for(;e=0&&a.charAt(e)!==t;)e--;return e}function Tu(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Su="bonesDeclaration",Au="#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4;\nattribute matricesWeights : vec4;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4;\nattribute matricesWeightsExtra : vec4;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d;\nuniform boneTextureWidth : f32;\n#else\nuniform mBones : array;\n#ifdef BONES_VELOCITY_ENABLED\nuniform mPreviousBones : array;\n#endif\n#endif\n#ifdef BONETEXTURE\nfn readMatrixFromRawSampler(smp : texture_2d,index : f32)->mat4x4\n{\nlet offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2(offset+0,0),0);\nlet m1=textureLoad(smp,vec2(offset+1,0),0);\nlet m2=textureLoad(smp,vec2(offset+2,0),0);\nlet m3=textureLoad(smp,vec2(offset+3,0),0);\nreturn mat4x4(m0,m1,m2,m3);\n}\n#endif\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Su]=Au;const Eu="bonesVertex",Cu="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Eu]=Cu;const Ru="bakedVertexAnimationDeclaration",Iu="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;\nuniform bakedVertexAnimationTextureSizeInverted: vec2;\nuniform bakedVertexAnimationSettings: vec4;\nvar bakedVertexAnimationTexture : texture_2d;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d,index : f32,frame : f32)->mat4x4\n{\nlet offset=i32(index)*4;\nlet frameUV=i32(frame);\nlet m0=textureLoad(smp,vec2(offset+0,frameUV),0);\nlet m1=textureLoad(smp,vec2(offset+1,frameUV),0);\nlet m2=textureLoad(smp,vec2(offset+2,frameUV),0);\nlet m3=textureLoad(smp,vec2(offset+3,frameUV),0);\nreturn mat4x4(m0,m1,m2,m3);\n}\n#endif\n";te.IncludesShadersStoreWGSL[Ru]=Iu;const Mu="bakedVertexAnimation",Pu="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;\nlet VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;\nlet VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;\nlet VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;\nlet VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;\nlet VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;\nlet VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;\nlet time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;\nlet frameCorrection: f32=select(1.0,0.0,time<1.0);\nlet numOfFrames: f32=totalFrames-frameCorrection;\nvar VATFrameNum: f32=fract(time)*numOfFrames;\nVATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;\nVATFrameNum=floor(VATFrameNum);\nVATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;\nvar VATInfluence : mat4x4;\nVATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;\n}\n#endif\n";te.IncludesShadersStoreWGSL[Mu]=Pu;const wu="clipPlaneFragment",Du="#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\n#endif\n#ifdef CLIPPLANE\nelse if (fragmentInputs.fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nelse if (fragmentInputs.fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nelse if (fragmentInputs.fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nelse if (fragmentInputs.fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE5\nelse if (fragmentInputs.fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nelse if (fragmentInputs.fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif\n";te.IncludesShadersStoreWGSL[wu]=Du;const Fu="clipPlaneFragmentDeclaration",Ou="#ifdef CLIPPLANE\nvarying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nvarying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nvarying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nvarying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nvarying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nvarying fClipDistance6: f32;\n#endif\n";te.IncludesShadersStoreWGSL[Fu]=Ou;const Lu="clipPlaneVertex",Bu="#ifdef CLIPPLANE\nvertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nvertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nvertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nvertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nvertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nvertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);\n#endif\n";te.IncludesShadersStoreWGSL[Lu]=Bu;const Nu="clipPlaneVertexDeclaration",Uu="#ifdef CLIPPLANE\nuniform vClipPlane: vec4;\nvarying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nuniform vClipPlane2: vec4;\nvarying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nuniform vClipPlane3: vec4;\nvarying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nuniform vClipPlane4: vec4;\nvarying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nuniform vClipPlane5: vec4;\nvarying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nuniform vClipPlane6: vec4;\nvarying fClipDistance6: f32;\n#endif\n";te.IncludesShadersStoreWGSL[Nu]=Uu;const ku="instancesDeclaration",Vu="#ifdef INSTANCES\nattribute world0 : vec4;\nattribute world1 : vec4;\nattribute world2 : vec4;\nattribute world3 : vec4;\n#ifdef INSTANCESCOLOR\nattribute instanceColor : vec4;\n#endif\n#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)\nuniform world : mat4x4;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY)\nattribute previousWorld0 : vec4;\nattribute previousWorld1 : vec4;\nattribute previousWorld2 : vec4;\nattribute previousWorld3 : vec4;\n#ifdef THIN_INSTANCES\nuniform previousWorld : mat4x4;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nuniform world : mat4x4;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY)\nuniform previousWorld : mat4x4;\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[ku]=Vu;const Gu="instancesVertex",Wu="#ifdef INSTANCES\nvar finalWorld=mat4x4(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=mat4x4(previousWorld0,previousWorld1,previousWorld2,previousWorld3);\n#endif\n#ifdef THIN_INSTANCES\n#if !defined(WORLD_UBO)\nfinalWorld=uniforms.world*finalWorld;\n#else\nfinalWorld=mesh.world*finalWorld;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nfinalPreviousWorld=previousWorld*finalPreviousWorld;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nvar finalWorld=uniforms.world;\n#else\nvar finalWorld=mesh.world;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=previousWorld;\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Gu]=Wu;const zu="meshUboDeclaration",Hu="struct Mesh {\nworld : mat4x4,\nvisibility : f32,\n};\nvar mesh : Mesh;\n#define WORLD_UBO\n";te.IncludesShadersStoreWGSL[zu]=Hu;const Xu="morphTargetsVertex",Ku="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE \nvertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;\npositionUpdated=positionUpdated+(readVector3FromRawSampler({X},vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];\nvertexID=vertexID+1.0;\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated=normalUpdated+(readVector3FromRawSampler({X},vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated=uvUpdated+(readVector3FromRawSampler({X},vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz=tangentUpdated.xyz+(readVector3FromRawSampler({X},vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}];\n#endif\n#else\npositionUpdated=positionUpdated+(position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz=tangentUpdated.xyz+(tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated=uvUpdated+(uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];\n#endif\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Xu]=Ku;const Yu="morphTargetsVertexDeclaration",qu="#ifdef MORPHTARGETS\n#ifndef MORPHTARGETS_TEXTURE\nattribute position{X} : vec3;\n#ifdef MORPHTARGETS_NORMAL\nattribute normal{X} : vec3;\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute tangent{X} : vec3;\n#endif\n#ifdef MORPHTARGETS_UV\nattribute uv_{X} : vec2;\n#endif\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Yu]=qu;const ju="morphTargetsVertexGlobal",$u="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\nvar vertexID : f32;\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[ju]=$u;const Zu="morphTargetsVertexGlobalDeclaration",Qu="#ifdef MORPHTARGETS\nuniform morphTargetInfluences : array;\n#ifdef MORPHTARGETS_TEXTURE \nuniform morphTargetTextureIndices : array;\nuniform morphTargetTextureInfo : vec3;\nvar morphTargets : texture_2d_array;\nvar morphTargetsSampler : sampler;\nfn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3\n{ \nlet y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);\nlet x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;\nlet textureUV=vec2((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);\nreturn textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;\n}\n#endif\n#endif\n";te.IncludesShadersStoreWGSL[Zu]=Qu;const Ju="sceneUboDeclaration",ed="struct Scene {\nviewProjection : mat4x4,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4,\n#endif \nview : mat4x4,\nprojection : mat4x4,\nvEyePosition : vec4,\n};\nvar scene : Scene;\n";te.IncludesShadersStoreWGSL[Ju]=ed;const co="fragmentOutputs.fragDepth",td="uniforms",id="internals",sd={texture_1d:$e.E1d,texture_2d:$e.E2d,texture_2d_array:$e.E2dArray,texture_3d:$e.E3d,texture_cube:$e.Cube,texture_cube_array:$e.CubeArray,texture_multisampled_2d:$e.E2d,texture_depth_2d:$e.E2d,texture_depth_2d_array:$e.E2dArray,texture_depth_cube:$e.Cube,texture_depth_cube_array:$e.CubeArray,texture_depth_multisampled_2d:$e.E2d,texture_storage_1d:$e.E1d,texture_storage_2d:$e.E2d,texture_storage_2d_array:$e.E2dArray,texture_storage_3d:$e.E3d,texture_external:null};class nd extends rt{constructor(){super(...arguments),this.shaderLanguage=at.WGSL,this.uniformRegexp=/uniform\s+(\w+)\s*:\s*(.+)\s*;/,this.textureRegexp=/var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/,this.noPrecision=!0}_getArraySize(e,t,i){let s=0;const n=t.lastIndexOf(">");if(t.indexOf("array")>=0&&n>0){let r=n;for(;r>0&&t.charAt(r)!==" "&&t.charAt(r)!==",";)r--;const o=t.substring(r+1,n);for(s=+o,isNaN(s)&&(s=+i[o.trim()]);r>0&&(t.charAt(r)===" "||t.charAt(r)===",");)r--;t=t.substring(t.indexOf("<")+1,r+1)}return[e,t,s]}initializeShaders(e){this._webgpuProcessingContext=e,this._attributesWGSL=[],this._varyingsWGSL=[],this._varyingNamesWGSL=[],this._stridedUniformArrays=[]}preProcessShaderCode(e){return"struct ".concat(rt.InternalsUBOName," {\n yFactor_: f32,\n textureOutputHeight_: f32,\n};\nvar ").concat(id," : ").concat(rt.InternalsUBOName,";\n")+La(e)}varyingProcessor(e,t,i){const n=/\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(n!==null){const r=n[2],o=n[1];let l;t?(l=this._webgpuProcessingContext.availableVaryings[o],l===void 0&&H.Warn('Invalid fragment shader: The varying named "'.concat(o,'" is not declared in the vertex shader! This declaration will be ignored.'))):(l=this._webgpuProcessingContext.getVaryingNextLocation(r,this._getArraySize(o,r,i)[2]),this._webgpuProcessingContext.availableVaryings[o]=l,this._varyingsWGSL.push(" @location(".concat(l,") ").concat(o," : ").concat(r,",")),this._varyingNamesWGSL.push(o)),e=""}return e}attributeProcessor(e,t){const s=/\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(s!==null){const n=s[2],r=s[1],o=this._webgpuProcessingContext.getAttributeNextLocation(n,this._getArraySize(r,n,t)[2]);this._webgpuProcessingContext.availableAttributes[r]=o,this._webgpuProcessingContext.orderedAttributes[o]=r,this._attributesWGSL.push("@location(".concat(o,") ").concat(r," : ").concat(n,",")),e=""}return e}uniformProcessor(e,t,i){const s=this.uniformRegexp.exec(e);if(s!==null){const n=s[2],r=s[1];this._addUniformToLeftOverUBO(r,n,i),e=""}return e}textureProcessor(e,t,i){const s=this.textureRegexp.exec(e);if(s!==null){const n=s[1],r=s[2],o=!!s[3],l=s[4],h=l.indexOf("storage")>0,c=s[6],u=h?c.substring(0,c.indexOf(",")).trim():null;let d=o?this._getArraySize(n,r,i)[2]:0,_=this._webgpuProcessingContext.availableTextures[n];if(_)d=_.textures.length;else{_={isTextureArray:d>0,isStorageTexture:h,textures:[],sampleType:pi.Float},d=d||1;for(let x=0;x0,g=sd[l],p=f?pi.Depth:c==="u32"?pi.Uint:c==="i32"?pi.Sint:pi.Float;if(_.sampleType=p,g===void 0)throw"Can't get the texture dimension corresponding to the texture function \"".concat(l,'"!');for(let x=0;x=0?"\n if (internals.yFactor_ == 1.) {\n fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;\n }\n ":"";e=this._processSamplers(e,!0),t=this._processSamplers(t,!1),e=this._processCustomBuffers(e,!0),t=this._processCustomBuffers(t,!1);const s=this._buildLeftOverUBO();e=s+e,t=s+t,e=e.replace(/#define /g,"//#define "),e=this._processStridedUniformArrays(e);let n="struct VertexInputs {\n @builtin(vertex_index) vertexIndex : u32,\n @builtin(instance_index) instanceIndex : u32,\n";this._attributesWGSL.length>0&&(n+=this._attributesWGSL.join("\n")),n+="\n};\nvar vertexInputs : VertexInputs;\n";let r="struct FragmentInputs {\n @builtin(position) position : vec4,\n";this._varyingsWGSL.length>0&&(r+=this._varyingsWGSL.join("\n")),r+="\n};\nvar vertexOutputs : FragmentInputs;\n",e=n+r+e;const o="\n vertexInputs = input;\n",l=" vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\n return vertexOutputs;";e=this._injectStartingAndEndingCode(e,"fn main",o,l),t=t.replace(/#define /g,"//#define "),t=this._processStridedUniformArrays(t),t=t.replace(/dpdy/g,"(-internals.yFactor_)*dpdy");let h="struct FragmentInputs {\n @builtin(position) position : vec4,\n @builtin(front_facing) frontFacing : bool,\n";this._varyingsWGSL.length>0&&(h+=this._varyingsWGSL.join("\n")),h+="\n};\nvar fragmentInputs : FragmentInputs;\n";let c="struct FragmentOutputs {\n @location(0) color : vec4,\n",u=!1,d=0;for(;!u&&(d=t.indexOf(co,d),!(d<0));){const g=d;for(u=!0;d>1&&t.charAt(d)!=="\n";){if(t.charAt(d)==="/"&&t.charAt(d-1)==="/"){u=!1;break}d--}d=g+co.length}u&&(c+=" @builtin(frag_depth) fragDepth: f32,\n"),c+="};\nvar fragmentOutputs : FragmentOutputs;\n",t=h+c+t;const _=" fragmentInputs = input;\n "+i,f=" return fragmentOutputs;";return t=this._injectStartingAndEndingCode(t,"fn main",_,f),this._collectBindingNames(),this._preCreateBindGroupEntries(),{vertexCode:e,fragmentCode:t}}_generateLeftOverUBOCode(e,t){let i="",s="struct ".concat(e," {\n");for(const n of this._webgpuProcessingContext.leftOverUniforms){const r=n.type.replace(/^(.*?)(<.*>)?$/,"$1"),o=rt.UniformSizes[r];if(n.length>0)if(o<=2){const l="".concat(e,"_").concat(this._stridedUniformArrays.length,"_strided_arr");i+="struct ".concat(l," {\n @size(16)\n el: ").concat(r,",\n }"),this._stridedUniformArrays.push(n.name),s+=" @align(16) ".concat(n.name," : array<").concat(l,", ").concat(n.length,">,\n")}else s+=" ".concat(n.name," : array<").concat(n.type,", ").concat(n.length,">,\n");else s+=" ".concat(n.name," : ").concat(n.type,",\n")}return s+="};\n",s="".concat(i,"\n").concat(s),s+="@group(".concat(t.binding.groupIndex,") @binding(").concat(t.binding.bindingIndex,") var ").concat(td," : ").concat(e,";\n"),s}_processSamplers(e,t){const i=/var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;for(;;){const s=i.exec(e);if(s===null)break;const n=s[1],r=s[2],o=n.indexOf(rt.AutoSamplerSuffix)===n.length-rt.AutoSamplerSuffix.length?n.substring(0,n.indexOf(rt.AutoSamplerSuffix)):null,l=r==="sampler_comparison"?ws.Comparison:ws.Filtering;if(o){const _=this._webgpuProcessingContext.availableTextures[o];_&&(_.autoBindSampler=!0)}let h=this._webgpuProcessingContext.availableSamplers[n];h||(h={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:l},this._webgpuProcessingContext.availableSamplers[n]=h),this._addSamplerBindingDescription(n,h,t);const c=e.substring(0,s.index),u="@group(".concat(h.binding.groupIndex,") @binding(").concat(h.binding.bindingIndex,") "),d=e.substring(s.index);e=c+u+d,i.lastIndex+=u.length}return e}_processCustomBuffers(e,t){const i=/var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;for(;;){const s=i.exec(e);if(s===null)break;const n=s[1],r=s[3];let o=s[4];const l=s[5];let h=this._webgpuProcessingContext.availableBuffers[o];if(!h){const g=n==="uniform"?bi.KnownUBOs[l]:null;let p;g?(o=l,p=g.binding,p.groupIndex===-1&&(p=this._webgpuProcessingContext.getNextFreeUBOBinding())):p=this._webgpuProcessingContext.getNextFreeUBOBinding(),h={binding:p},this._webgpuProcessingContext.availableBuffers[o]=h}this._addBufferBindingDescription(o,this._webgpuProcessingContext.availableBuffers[o],r==="read_write"?Ps.Storage:n==="storage"?Ps.ReadOnlyStorage:Ps.Uniform,t);const c=h.binding.groupIndex,u=h.binding.bindingIndex,d=e.substring(0,s.index),_="@group(".concat(c,") @binding(").concat(u,") "),f=e.substring(s.index);e=d+_+f,i.lastIndex+=_.length}return e}_processStridedUniformArrays(e){for(const t of this._stridedUniformArrays)e=e.replace(new RegExp("".concat(t,"\\s*\\[(.*)\\]"),"g"),"".concat(t,"[$1].el"));return e}}class xr{get underlyingResource(){return this._webgpuTexture}get msaaTexture(){return this._webgpuMSAATexture}set msaaTexture(e){this._webgpuMSAATexture=e}constructor(e=null){this.format=I.RGBA8Unorm,this.textureUsages=0,this.textureAdditionalUsages=0,this._webgpuTexture=e,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}set(e){this._webgpuTexture=e}setUsage(e,t,i,s,n){t=e===ze.RenderTarget?!1:t,this.createView({format:this.format,dimension:i?$e.Cube:$e.E2d,mipLevelCount:t?me.ILog2(Math.max(s,n))+1:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:i?6:1,aspect:$i.All})}createView(e,t=!1){if(this.view=this._webgpuTexture.createView(e),t&&e){const i=e.mipLevelCount;e.mipLevelCount=1,this.viewForWriting=this._webgpuTexture.createView(e),e.mipLevelCount=i}}reset(){this._webgpuTexture=null,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}release(){var e,t,i;(e=this._webgpuTexture)===null||e===void 0||e.destroy(),(t=this._webgpuMSAATexture)===null||t===void 0||t.destroy(),(i=this._copyInvertYTempTexture)===null||i===void 0||i.destroy(),this.reset()}}const rd="\n const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));\n const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));\n\n layout(location = 0) out vec2 vTex;\n\n void main() {\n vTex = tex[gl_VertexIndex];\n gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);\n }\n ",ad="\n layout(set = 0, binding = 0) uniform sampler imgSampler;\n layout(set = 0, binding = 1) uniform texture2D img;\n\n layout(location = 0) in vec2 vTex;\n layout(location = 0) out vec4 outColor;\n\n void main() {\n outColor = texture(sampler2D(img, imgSampler), vTex);\n }\n ",Sl="\n #extension GL_EXT_samplerless_texture_functions : enable\n\n const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));\n const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f));\n\n layout(set = 0, binding = 0) uniform texture2D img;\n\n #ifdef INVERTY\n layout(location = 0) out flat ivec2 vTextureSize;\n #endif\n\n void main() {\n #ifdef INVERTY\n vTextureSize = textureSize(img, 0);\n #endif\n gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);\n }\n ",od="\n #extension GL_EXT_samplerless_texture_functions : enable\n\n layout(set = 0, binding = 0) uniform texture2D img;\n\n #ifdef INVERTY\n layout(location = 0) in flat ivec2 vTextureSize;\n #endif\n layout(location = 0) out vec4 outColor;\n\n void main() {\n #ifdef INVERTY\n vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, vTextureSize.y - gl_FragCoord.y), 0);\n #else\n vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n color.rgb *= color.a;\n #endif\n outColor = color;\n }\n ",ld=Sl,hd="\n #extension GL_EXT_samplerless_texture_functions : enable\n\n layout(set = 0, binding = 0) uniform texture2D img;\n layout(set = 0, binding = 1) uniform Params {\n float ofstX;\n float ofstY;\n float width;\n float height;\n };\n\n #ifdef INVERTY\n layout(location = 0) in flat ivec2 vTextureSize;\n #endif\n layout(location = 0) out vec4 outColor;\n\n void main() {\n if (gl_FragCoord.x < ofstX || gl_FragCoord.x >= ofstX + width) {\n discard;\n }\n if (gl_FragCoord.y < ofstY || gl_FragCoord.y >= ofstY + height) {\n discard;\n }\n #ifdef INVERTY\n vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, ofstY + height - (gl_FragCoord.y - ofstY)), 0);\n #else\n vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n color.rgb *= color.a;\n #endif\n outColor = color;\n }\n ",cd="\n const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f));\n\n void main() {\n gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);\n }\n ",ud="\n layout(set = 0, binding = 0) uniform Uniforms {\n uniform vec4 color;\n };\n\n layout(location = 0) out vec4 outColor;\n\n void main() {\n outColor = color;\n }\n ",dd="\n struct VertexOutput {\n @builtin(position) Position : vec4,\n @location(0) fragUV : vec2\n }\n \n @vertex\n fn main(\n @builtin(vertex_index) VertexIndex : u32\n ) -> VertexOutput {\n var pos = array, 4>(\n vec2(-1.0, 1.0),\n vec2( 1.0, 1.0),\n vec2(-1.0, -1.0),\n vec2( 1.0, -1.0)\n );\n var tex = array, 4>(\n vec2(0.0, 0.0),\n vec2(1.0, 0.0),\n vec2(0.0, 1.0),\n vec2(1.0, 1.0)\n );\n\n var output: VertexOutput;\n\n output.Position = vec4(pos[VertexIndex], 0.0, 1.0);\n output.fragUV = tex[VertexIndex];\n\n return output;\n }\n ",fd="\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2\n ) -> @location(0) vec4 {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);\n }\n ",_d="\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2\n ) -> @location(0) vec4 {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2(fragUV.x, 1.0 - fragUV.y));\n }\n ";var Ci;(function(a){a[a.MipMap=0]="MipMap",a[a.InvertYPremultiplyAlpha=1]="InvertYPremultiplyAlpha",a[a.Clear=2]="Clear",a[a.InvertYPremultiplyAlphaWithOfst=3]="InvertYPremultiplyAlphaWithOfst"})(Ci||(Ci={}));var cn;(function(a){a[a.DontInvertY=0]="DontInvertY",a[a.InvertY=1]="InvertY"})(cn||(cn={}));const uo=[{vertex:rd,fragment:ad},{vertex:Sl,fragment:od},{vertex:cd,fragment:ud},{vertex:ld,fragment:hd}],Ln={"":0,r8unorm:1,r8uint:2,r8sint:3,r16uint:4,r16sint:5,r16float:6,rg8unorm:7,rg8uint:8,rg8sint:9,r32uint:10,r32sint:11,r32float:12,rg16uint:13,rg16sint:14,rg16float:15,rgba8unorm:16,"rgba8unorm-srgb":17,rgba8uint:18,rgba8sint:19,bgra8unorm:20,"bgra8unorm-srgb":21,rgb10a2unorm:22,rg32uint:23,rg32sint:24,rg32float:25,rgba16uint:26,rgba16sint:27,rgba16float:28,rgba32uint:29,rgba32sint:30,rgba32float:31,stencil8:32,depth16unorm:33,depth24plus:34,"depth24plus-stencil8":35,depth32float:36,"depth24unorm-stencil8":37,"depth32float-stencil8":38};class Qe{static ComputeNumMipmapLevels(e,t){return me.ILog2(Math.max(e,t))+1}constructor(e,t,i,s){this._pipelines={},this._compiledShaders=[],this._videoPipelines={},this._videoCompiledShaders=[],this._deferredReleaseTextures=[],this._device=e,this._glslang=t,this._tintWASM=i,this._bufferManager=s,this._mipmapSampler=e.createSampler({minFilter:Be.Linear}),this._videoSampler=e.createSampler({minFilter:Be.Linear}),this._ubCopyWithOfst=this._bufferManager.createBuffer(4*4,Je.Uniform|Je.CopyDst).underlyingResource,this._getPipeline(I.RGBA8Unorm),this._getVideoPipeline(I.RGBA8Unorm)}_getPipeline(e,t=Ci.MipMap,i){const s=t===Ci.MipMap?1:t===Ci.InvertYPremultiplyAlpha?((i.invertY?1:0)<<1)+((i.premultiplyAlpha?1:0)<<2):t===Ci.Clear?8:t===Ci.InvertYPremultiplyAlphaWithOfst?((i.invertY?1:0)<<4)+((i.premultiplyAlpha?1:0)<<5):0;this._pipelines[e]||(this._pipelines[e]=[]);let n=this._pipelines[e][s];if(!n){let r="#version 450\r\n";(t===Ci.InvertYPremultiplyAlpha||t===Ci.InvertYPremultiplyAlphaWithOfst)&&(i.invertY&&(r+="#define INVERTY\r\n"),i.premultiplyAlpha&&(r+="#define PREMULTIPLYALPHA\r\n"));let o=this._compiledShaders[s];if(!o){let h=this._glslang.compileGLSL(r+uo[t].vertex,"vertex"),c=this._glslang.compileGLSL(r+uo[t].fragment,"fragment");this._tintWASM&&(h=this._tintWASM.convertSpirV2WGSL(h),c=this._tintWASM.convertSpirV2WGSL(c));const u=this._device.createShaderModule({code:h}),d=this._device.createShaderModule({code:c});o=this._compiledShaders[s]=[u,d]}const l=this._device.createRenderPipeline({layout:Wn.Auto,vertex:{module:o[0],entryPoint:"main"},fragment:{module:o[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:_i.TriangleStrip,stripIndexFormat:Ds.Uint16}});n=this._pipelines[e][s]=[l,l.getBindGroupLayout(0)]}return n}_getVideoPipeline(e,t=cn.DontInvertY){const i=t===cn.InvertY?1:0;this._videoPipelines[e]||(this._videoPipelines[e]=[]);let s=this._videoPipelines[e][i];if(!s){let n=this._videoCompiledShaders[i];if(!n){const o=this._device.createShaderModule({code:dd}),l=this._device.createShaderModule({code:i===0?fd:_d});n=this._videoCompiledShaders[i]=[o,l]}const r=this._device.createRenderPipeline({label:"CopyVideoToTexture_".concat(e,"_").concat(i===0?"DontInvertY":"InvertY"),layout:Wn.Auto,vertex:{module:n[0],entryPoint:"main"},fragment:{module:n[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:_i.TriangleStrip,stripIndexFormat:Ds.Uint16}});s=this._videoPipelines[e][i]=[r,r.getBindGroupLayout(0)]}return s}static _GetTextureTypeFromFormat(e){switch(e){case I.R8Unorm:case I.R8Snorm:case I.R8Uint:case I.R8Sint:case I.RG8Unorm:case I.RG8Snorm:case I.RG8Uint:case I.RG8Sint:case I.RGBA8Unorm:case I.RGBA8UnormSRGB:case I.RGBA8Snorm:case I.RGBA8Uint:case I.RGBA8Sint:case I.BGRA8Unorm:case I.BGRA8UnormSRGB:case I.RGB10A2Unorm:case I.RGB9E5UFloat:case I.RG11B10UFloat:case I.Depth24UnormStencil8:case I.Depth32FloatStencil8:case I.BC7RGBAUnorm:case I.BC7RGBAUnormSRGB:case I.BC6HRGBUFloat:case I.BC6HRGBFloat:case I.BC5RGUnorm:case I.BC5RGSnorm:case I.BC3RGBAUnorm:case I.BC3RGBAUnormSRGB:case I.BC2RGBAUnorm:case I.BC2RGBAUnormSRGB:case I.BC4RUnorm:case I.BC4RSnorm:case I.BC1RGBAUnorm:case I.BC1RGBAUnormSRGB:case I.ETC2RGB8Unorm:case I.ETC2RGB8UnormSRGB:case I.ETC2RGB8A1Unorm:case I.ETC2RGB8A1UnormSRGB:case I.ETC2RGBA8Unorm:case I.ETC2RGBA8UnormSRGB:case I.EACR11Unorm:case I.EACR11Snorm:case I.EACRG11Unorm:case I.EACRG11Snorm:case I.ASTC4x4Unorm:case I.ASTC4x4UnormSRGB:case I.ASTC5x4Unorm:case I.ASTC5x4UnormSRGB:case I.ASTC5x5Unorm:case I.ASTC5x5UnormSRGB:case I.ASTC6x5Unorm:case I.ASTC6x5UnormSRGB:case I.ASTC6x6Unorm:case I.ASTC6x6UnormSRGB:case I.ASTC8x5Unorm:case I.ASTC8x5UnormSRGB:case I.ASTC8x6Unorm:case I.ASTC8x6UnormSRGB:case I.ASTC8x8Unorm:case I.ASTC8x8UnormSRGB:case I.ASTC10x5Unorm:case I.ASTC10x5UnormSRGB:case I.ASTC10x6Unorm:case I.ASTC10x6UnormSRGB:case I.ASTC10x8Unorm:case I.ASTC10x8UnormSRGB:case I.ASTC10x10Unorm:case I.ASTC10x10UnormSRGB:case I.ASTC12x10Unorm:case I.ASTC12x10UnormSRGB:case I.ASTC12x12Unorm:case I.ASTC12x12UnormSRGB:return 0;case I.R16Uint:case I.R16Sint:case I.RG16Uint:case I.RG16Sint:case I.RGBA16Uint:case I.RGBA16Sint:case I.Depth16Unorm:return 5;case I.R16Float:case I.RG16Float:case I.RGBA16Float:return 2;case I.R32Uint:case I.R32Sint:case I.RG32Uint:case I.RG32Sint:case I.RGBA32Uint:case I.RGBA32Sint:return 7;case I.R32Float:case I.RG32Float:case I.RGBA32Float:case I.Depth32Float:return 1;case I.Stencil8:throw"No fixed size for Stencil8 format!";case I.Depth24Plus:throw"No fixed size for Depth24Plus format!";case I.Depth24PlusStencil8:throw"No fixed size for Depth24PlusStencil8 format!"}return 0}static _GetBlockInformationFromFormat(e){switch(e){case I.R8Unorm:case I.R8Snorm:case I.R8Uint:case I.R8Sint:return{width:1,height:1,length:1};case I.R16Uint:case I.R16Sint:case I.R16Float:case I.RG8Unorm:case I.RG8Snorm:case I.RG8Uint:case I.RG8Sint:return{width:1,height:1,length:2};case I.R32Uint:case I.R32Sint:case I.R32Float:case I.RG16Uint:case I.RG16Sint:case I.RG16Float:case I.RGBA8Unorm:case I.RGBA8UnormSRGB:case I.RGBA8Snorm:case I.RGBA8Uint:case I.RGBA8Sint:case I.BGRA8Unorm:case I.BGRA8UnormSRGB:case I.RGB9E5UFloat:case I.RGB10A2Unorm:case I.RG11B10UFloat:return{width:1,height:1,length:4};case I.RG32Uint:case I.RG32Sint:case I.RG32Float:case I.RGBA16Uint:case I.RGBA16Sint:case I.RGBA16Float:return{width:1,height:1,length:8};case I.RGBA32Uint:case I.RGBA32Sint:case I.RGBA32Float:return{width:1,height:1,length:16};case I.Stencil8:throw"No fixed size for Stencil8 format!";case I.Depth16Unorm:return{width:1,height:1,length:2};case I.Depth24Plus:throw"No fixed size for Depth24Plus format!";case I.Depth24PlusStencil8:throw"No fixed size for Depth24PlusStencil8 format!";case I.Depth32Float:return{width:1,height:1,length:4};case I.Depth24UnormStencil8:return{width:1,height:1,length:4};case I.Depth32FloatStencil8:return{width:1,height:1,length:5};case I.BC7RGBAUnorm:case I.BC7RGBAUnormSRGB:case I.BC6HRGBUFloat:case I.BC6HRGBFloat:case I.BC5RGUnorm:case I.BC5RGSnorm:case I.BC3RGBAUnorm:case I.BC3RGBAUnormSRGB:case I.BC2RGBAUnorm:case I.BC2RGBAUnormSRGB:return{width:4,height:4,length:16};case I.BC4RUnorm:case I.BC4RSnorm:case I.BC1RGBAUnorm:case I.BC1RGBAUnormSRGB:return{width:4,height:4,length:8};case I.ETC2RGB8Unorm:case I.ETC2RGB8UnormSRGB:case I.ETC2RGB8A1Unorm:case I.ETC2RGB8A1UnormSRGB:case I.EACR11Unorm:case I.EACR11Snorm:return{width:4,height:4,length:8};case I.ETC2RGBA8Unorm:case I.ETC2RGBA8UnormSRGB:case I.EACRG11Unorm:case I.EACRG11Snorm:return{width:4,height:4,length:16};case I.ASTC4x4Unorm:case I.ASTC4x4UnormSRGB:return{width:4,height:4,length:16};case I.ASTC5x4Unorm:case I.ASTC5x4UnormSRGB:return{width:5,height:4,length:16};case I.ASTC5x5Unorm:case I.ASTC5x5UnormSRGB:return{width:5,height:5,length:16};case I.ASTC6x5Unorm:case I.ASTC6x5UnormSRGB:return{width:6,height:5,length:16};case I.ASTC6x6Unorm:case I.ASTC6x6UnormSRGB:return{width:6,height:6,length:16};case I.ASTC8x5Unorm:case I.ASTC8x5UnormSRGB:return{width:8,height:5,length:16};case I.ASTC8x6Unorm:case I.ASTC8x6UnormSRGB:return{width:8,height:6,length:16};case I.ASTC8x8Unorm:case I.ASTC8x8UnormSRGB:return{width:8,height:8,length:16};case I.ASTC10x5Unorm:case I.ASTC10x5UnormSRGB:return{width:10,height:5,length:16};case I.ASTC10x6Unorm:case I.ASTC10x6UnormSRGB:return{width:10,height:6,length:16};case I.ASTC10x8Unorm:case I.ASTC10x8UnormSRGB:return{width:10,height:8,length:16};case I.ASTC10x10Unorm:case I.ASTC10x10UnormSRGB:return{width:10,height:10,length:16};case I.ASTC12x10Unorm:case I.ASTC12x10UnormSRGB:return{width:12,height:10,length:16};case I.ASTC12x12Unorm:case I.ASTC12x12UnormSRGB:return{width:12,height:12,length:16}}return{width:1,height:1,length:4}}static _IsHardwareTexture(e){return!!e.release}static _IsInternalTexture(e){return!!e.dispose}static IsImageBitmap(e){return e.close!==void 0}static IsImageBitmapArray(e){return Array.isArray(e)&&e[0].close!==void 0}setCommandEncoder(e){this._commandEncoderForCreation=e}static IsCompressedFormat(e){switch(e){case I.BC7RGBAUnormSRGB:case I.BC7RGBAUnorm:case I.BC6HRGBFloat:case I.BC6HRGBUFloat:case I.BC5RGSnorm:case I.BC5RGUnorm:case I.BC4RSnorm:case I.BC4RUnorm:case I.BC3RGBAUnormSRGB:case I.BC3RGBAUnorm:case I.BC2RGBAUnormSRGB:case I.BC2RGBAUnorm:case I.BC1RGBAUnormSRGB:case I.BC1RGBAUnorm:case I.ETC2RGB8Unorm:case I.ETC2RGB8UnormSRGB:case I.ETC2RGB8A1Unorm:case I.ETC2RGB8A1UnormSRGB:case I.ETC2RGBA8Unorm:case I.ETC2RGBA8UnormSRGB:case I.EACR11Unorm:case I.EACR11Snorm:case I.EACRG11Unorm:case I.EACRG11Snorm:case I.ASTC4x4Unorm:case I.ASTC4x4UnormSRGB:case I.ASTC5x4Unorm:case I.ASTC5x4UnormSRGB:case I.ASTC5x5Unorm:case I.ASTC5x5UnormSRGB:case I.ASTC6x5Unorm:case I.ASTC6x5UnormSRGB:case I.ASTC6x6Unorm:case I.ASTC6x6UnormSRGB:case I.ASTC8x5Unorm:case I.ASTC8x5UnormSRGB:case I.ASTC8x6Unorm:case I.ASTC8x6UnormSRGB:case I.ASTC8x8Unorm:case I.ASTC8x8UnormSRGB:case I.ASTC10x5Unorm:case I.ASTC10x5UnormSRGB:case I.ASTC10x6Unorm:case I.ASTC10x6UnormSRGB:case I.ASTC10x8Unorm:case I.ASTC10x8UnormSRGB:case I.ASTC10x10Unorm:case I.ASTC10x10UnormSRGB:case I.ASTC12x10Unorm:case I.ASTC12x10UnormSRGB:case I.ASTC12x12Unorm:case I.ASTC12x12UnormSRGB:return!0}return!1}static GetWebGPUTextureFormat(e,t,i=!1){switch(t){case 15:return I.Depth16Unorm;case 16:return I.Depth24Plus;case 13:return I.Depth24PlusStencil8;case 14:return I.Depth32Float;case 17:return I.Depth24UnormStencil8;case 18:return I.Depth32FloatStencil8;case 19:return I.Stencil8;case 36492:return i?I.BC7RGBAUnormSRGB:I.BC7RGBAUnorm;case 36495:return I.BC6HRGBUFloat;case 36494:return I.BC6HRGBFloat;case 33779:return i?I.BC3RGBAUnormSRGB:I.BC3RGBAUnorm;case 33778:return i?I.BC2RGBAUnormSRGB:I.BC2RGBAUnorm;case 33777:case 33776:return i?I.BC1RGBAUnormSRGB:I.BC1RGBAUnorm;case 37808:return i?I.ASTC4x4UnormSRGB:I.ASTC4x4Unorm;case 36196:case 37492:return i?I.ETC2RGB8UnormSRGB:I.ETC2RGB8Unorm;case 37496:return i?I.ETC2RGBA8UnormSRGB:I.ETC2RGBA8Unorm}switch(e){case 3:switch(t){case 6:return I.R8Snorm;case 7:return I.RG8Snorm;case 4:throw"RGB format not supported in WebGPU";case 8:return I.R8Sint;case 9:return I.RG8Sint;case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA8Sint;default:return I.RGBA8Snorm}case 0:switch(t){case 6:return I.R8Unorm;case 7:return I.RG8Unorm;case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return i?I.RGBA8UnormSRGB:I.RGBA8Unorm;case 12:return i?I.BGRA8UnormSRGB:I.BGRA8Unorm;case 8:return I.R8Uint;case 9:return I.RG8Uint;case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA8Uint;case 0:throw"TEXTUREFORMAT_ALPHA format not supported in WebGPU";case 1:throw"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";case 2:throw"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";default:return I.RGBA8Unorm}case 4:switch(t){case 8:return I.R16Sint;case 9:return I.RG16Sint;case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA16Sint;default:return I.RGBA16Sint}case 5:switch(t){case 8:return I.R16Uint;case 9:return I.RG16Uint;case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA16Uint;default:return I.RGBA16Uint}case 6:switch(t){case 8:return I.R32Sint;case 9:return I.RG32Sint;case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA32Sint;default:return I.RGBA32Sint}case 7:switch(t){case 8:return I.R32Uint;case 9:return I.RG32Uint;case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return I.RGBA32Uint;default:return I.RGBA32Uint}case 1:switch(t){case 6:return I.R32Float;case 7:return I.RG32Float;case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return I.RGBA32Float;default:return I.RGBA32Float}case 2:switch(t){case 6:return I.R16Float;case 7:return I.RG16Float;case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return I.RGBA16Float;default:return I.RGBA16Float}case 10:throw"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:throw"TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV format not supported in WebGPU";case 14:throw"TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV format not supported in WebGPU";case 8:throw"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";case 9:throw"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";case 11:switch(t){case 5:return I.RGB10A2Unorm;case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV";default:return I.RGB10A2Unorm}}return i?I.RGBA8UnormSRGB:I.RGBA8Unorm}static GetNumChannelsFromWebGPUTextureFormat(e){switch(e){case I.R8Unorm:case I.R8Snorm:case I.R8Uint:case I.R8Sint:case I.BC4RUnorm:case I.BC4RSnorm:case I.R16Uint:case I.R16Sint:case I.Depth16Unorm:case I.R16Float:case I.R32Uint:case I.R32Sint:case I.R32Float:case I.Depth32Float:case I.Stencil8:case I.Depth24Plus:case I.EACR11Unorm:case I.EACR11Snorm:return 1;case I.RG8Unorm:case I.RG8Snorm:case I.RG8Uint:case I.RG8Sint:case I.Depth24UnormStencil8:case I.Depth32FloatStencil8:case I.BC5RGUnorm:case I.BC5RGSnorm:case I.RG16Uint:case I.RG16Sint:case I.RG16Float:case I.RG32Uint:case I.RG32Sint:case I.RG32Float:case I.Depth24PlusStencil8:case I.EACRG11Unorm:case I.EACRG11Snorm:return 2;case I.RGB9E5UFloat:case I.RG11B10UFloat:case I.BC6HRGBUFloat:case I.BC6HRGBFloat:case I.ETC2RGB8Unorm:case I.ETC2RGB8UnormSRGB:return 3;case I.RGBA8Unorm:case I.RGBA8UnormSRGB:case I.RGBA8Snorm:case I.RGBA8Uint:case I.RGBA8Sint:case I.BGRA8Unorm:case I.BGRA8UnormSRGB:case I.RGB10A2Unorm:case I.BC7RGBAUnorm:case I.BC7RGBAUnormSRGB:case I.BC3RGBAUnorm:case I.BC3RGBAUnormSRGB:case I.BC2RGBAUnorm:case I.BC2RGBAUnormSRGB:case I.BC1RGBAUnorm:case I.BC1RGBAUnormSRGB:case I.RGBA16Uint:case I.RGBA16Sint:case I.RGBA16Float:case I.RGBA32Uint:case I.RGBA32Sint:case I.RGBA32Float:case I.ETC2RGB8A1Unorm:case I.ETC2RGB8A1UnormSRGB:case I.ETC2RGBA8Unorm:case I.ETC2RGBA8UnormSRGB:case I.ASTC4x4Unorm:case I.ASTC4x4UnormSRGB:case I.ASTC5x4Unorm:case I.ASTC5x4UnormSRGB:case I.ASTC5x5Unorm:case I.ASTC5x5UnormSRGB:case I.ASTC6x5Unorm:case I.ASTC6x5UnormSRGB:case I.ASTC6x6Unorm:case I.ASTC6x6UnormSRGB:case I.ASTC8x5Unorm:case I.ASTC8x5UnormSRGB:case I.ASTC8x6Unorm:case I.ASTC8x6UnormSRGB:case I.ASTC8x8Unorm:case I.ASTC8x8UnormSRGB:case I.ASTC10x5Unorm:case I.ASTC10x5UnormSRGB:case I.ASTC10x6Unorm:case I.ASTC10x6UnormSRGB:case I.ASTC10x8Unorm:case I.ASTC10x8UnormSRGB:case I.ASTC10x10Unorm:case I.ASTC10x10UnormSRGB:case I.ASTC12x10Unorm:case I.ASTC12x10UnormSRGB:case I.ASTC12x12Unorm:case I.ASTC12x12UnormSRGB:return 4}throw"Unknown format ".concat(e,"!")}static HasStencilAspect(e){switch(e){case I.Stencil8:case I.Depth24UnormStencil8:case I.Depth32FloatStencil8:case I.Depth24PlusStencil8:return!0}return!1}static HasDepthAndStencilAspects(e){switch(e){case I.Depth24UnormStencil8:case I.Depth32FloatStencil8:case I.Depth24PlusStencil8:return!0}return!1}static GetDepthFormatOnly(e){switch(e){case I.Depth16Unorm:return I.Depth16Unorm;case I.Depth24Plus:return I.Depth24Plus;case I.Depth24PlusStencil8:return I.Depth24Plus;case I.Depth24UnormStencil8:return I.Depth24Plus;case I.Depth32Float:return I.Depth32Float;case I.Depth32FloatStencil8:return I.Depth32Float}return e}copyVideoToTexture(e,t,i,s=!1,n){var r,o,l,h;const c=n===void 0,[u,d]=this._getVideoPipeline(i,s?cn.InvertY:cn.DontInvertY);c&&(n=this._device.createCommandEncoder({})),(o=(r=n).pushDebugGroup)===null||o===void 0||o.call(r,"copy video to texture - invertY=".concat(s));const f={colorAttachments:[{view:t._hardwareTexture.underlyingResource.createView({format:i,dimension:$e.E2d,mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:$i.All}),loadOp:bt.Load,storeOp:mi.Store}]},g=n.beginRenderPass(f),p={layout:d,entries:[{binding:0,resource:this._videoSampler},{binding:1,resource:this._device.importExternalTexture({source:e.underlyingResource})}]},x=this._device.createBindGroup(p);g.setPipeline(u),g.setBindGroup(0,x),g.draw(4,1,0,0),g.end(),(h=(l=n).popDebugGroup)===null||h===void 0||h.call(l),c&&(this._device.queue.submit([n.finish()]),n=null)}invertYPreMultiplyAlpha(e,t,i,s,n=!1,r=!1,o=0,l=0,h=1,c=0,u=0,d=0,_=0,f,g){var p,x,m,T,S,b;const y=d!==0,E=f===void 0,[P,C]=this._getPipeline(s,y?Ci.InvertYPremultiplyAlphaWithOfst:Ci.InvertYPremultiplyAlpha,{invertY:n,premultiplyAlpha:r});o=Math.max(o,0),E&&(f=this._device.createCommandEncoder({})),(x=(p=f).pushDebugGroup)===null||x===void 0||x.call(p,"internal process texture - invertY=".concat(n," premultiplyAlpha=").concat(r));let R;if(Qe._IsHardwareTexture(e)?(R=e.underlyingResource,n&&!r&&h===1&&o===0||(e=void 0)):(R=e,e=void 0),!R)return;y&&this._bufferManager.setRawData(this._ubCopyWithOfst,0,new Float32Array([c,u,d,_]),0,4*4);const w=e,D=(m=w==null?void 0:w._copyInvertYTempTexture)!==null&&m!==void 0?m:this.createTexture({width:t,height:i,layers:1},!1,!1,!1,!1,!1,s,1,f,it.CopySrc|it.RenderAttachment|it.TextureBinding,void 0,"TempTextureForCopyWithInvertY"),W=(T=w==null?void 0:w._copyInvertYRenderPassDescr)!==null&&T!==void 0?T:{colorAttachments:[{view:D.createView({format:s,dimension:$e.E2d,baseMipLevel:0,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:0}),loadOp:bt.Load,storeOp:mi.Store}]},L=f.beginRenderPass(W);let z=y?w==null?void 0:w._copyInvertYBindGroupWithOfst:w==null?void 0:w._copyInvertYBindGroup;if(!z){const K={layout:C,entries:[{binding:0,resource:R.createView({format:s,dimension:$e.E2d,baseMipLevel:l,mipLevelCount:1,arrayLayerCount:h,baseArrayLayer:o})}]};y&&K.entries.push({binding:1,resource:{buffer:this._ubCopyWithOfst}}),z=this._device.createBindGroup(K)}L.setPipeline(P),L.setBindGroup(0,z),L.draw(4,1,0,0),L.end(),f.copyTextureToTexture({texture:D},{texture:R,mipLevel:l,origin:{x:0,y:0,z:o}},{width:t,height:i,depthOrArrayLayers:1}),w?(w._copyInvertYTempTexture=D,w._copyInvertYRenderPassDescr=W,y?w._copyInvertYBindGroupWithOfst=z:w._copyInvertYBindGroup=z):this._deferredReleaseTextures.push([D,null]),(b=(S=f).popDebugGroup)===null||b===void 0||b.call(S),E&&(this._device.queue.submit([f.finish()]),f=null)}copyWithInvertY(e,t,i,s){var n,r,o,l;const h=s===void 0,[c,u]=this._getPipeline(t,Ci.InvertYPremultiplyAlpha,{invertY:!0,premultiplyAlpha:!1});h&&(s=this._device.createCommandEncoder({})),(r=(n=s).pushDebugGroup)===null||r===void 0||r.call(n,"internal copy texture with invertY");const d=s.beginRenderPass(i),_=this._device.createBindGroup({layout:u,entries:[{binding:0,resource:e}]});d.setPipeline(c),d.setBindGroup(0,_),d.draw(4,1,0,0),d.end(),(l=(o=s).popDebugGroup)===null||l===void 0||l.call(o),h&&(this._device.queue.submit([s.finish()]),s=null)}createTexture(e,t=!1,i=!1,s=!1,n=!1,r=!1,o=I.RGBA8Unorm,l=1,h,c=-1,u=0,d){l>1&&(l=4);const _=e.layers||1,f={width:e.width,height:e.height,depthOrArrayLayers:_},g=Qe.IsCompressedFormat(o),p=t?Qe.ComputeNumMipmapLevels(e.width,e.height):1,x=c>=0?c:it.CopySrc|it.CopyDst|it.TextureBinding;u|=t&&!g?it.CopySrc|it.RenderAttachment:0,!g&&!r&&(u|=it.RenderAttachment|it.CopyDst);const m=this._device.createTexture({label:"Texture_".concat(d?d+"_":"").concat(f.width,"x").concat(f.height,"x").concat(f.depthOrArrayLayers,"_").concat(t?"wmips":"womips","_").concat(o,"_samples").concat(l),size:f,dimension:r?Mi.E3d:Mi.E2d,format:o,usage:x|u,sampleCount:l,mipLevelCount:p});return Qe.IsImageBitmap(e)&&(this.updateTexture(e,m,e.width,e.height,_,o,0,0,s,n,0,0),t&&i&&this.generateMipmaps(m,o,p,0,h)),m}createCubeTexture(e,t=!1,i=!1,s=!1,n=!1,r=I.RGBA8Unorm,o=1,l,h=-1,c=0,u){o>1&&(o=4);const d=Qe.IsImageBitmapArray(e)?e[0].width:e.width,_=Qe.IsImageBitmapArray(e)?e[0].height:e.height,f=Qe.IsCompressedFormat(r),g=t?Qe.ComputeNumMipmapLevels(d,_):1,p=h>=0?h:it.CopySrc|it.CopyDst|it.TextureBinding;c|=t&&!f?it.CopySrc|it.RenderAttachment:0,f||(c|=it.RenderAttachment|it.CopyDst);const x=this._device.createTexture({label:"TextureCube_".concat(u?u+"_":"").concat(d,"x").concat(_,"x6_").concat(t?"wmips":"womips","_").concat(r,"_samples").concat(o),size:{width:d,height:_,depthOrArrayLayers:6},dimension:Mi.E2d,format:r,usage:p|c,sampleCount:o,mipLevelCount:g});return Qe.IsImageBitmapArray(e)&&(this.updateCubeTextures(e,x,d,_,r,s,n,0,0),t&&i&&this.generateCubeMipmaps(x,r,g,l)),x}generateCubeMipmaps(e,t,i,s){var n,r,o,l;const h=s===void 0;h&&(s=this._device.createCommandEncoder({})),(r=(n=s).pushDebugGroup)===null||r===void 0||r.call(n,"create cube mipmaps - ".concat(i," levels"));for(let c=0;c<6;++c)this.generateMipmaps(e,t,i,c,s);(l=(o=s).popDebugGroup)===null||l===void 0||l.call(o),h&&(this._device.queue.submit([s.finish()]),s=null)}generateMipmaps(e,t,i,s=0,n){var r,o,l,h,c,u,d,_;const f=n===void 0,[g,p]=this._getPipeline(t);s=Math.max(s,0),f&&(n=this._device.createCommandEncoder({})),(o=(r=n).pushDebugGroup)===null||o===void 0||o.call(r,"create mipmaps for face #".concat(s," - ").concat(i," levels"));let x;if(Qe._IsHardwareTexture(e)?(x=e.underlyingResource,e._mipmapGenRenderPassDescr=e._mipmapGenRenderPassDescr||[],e._mipmapGenBindGroup=e._mipmapGenBindGroup||[]):(x=e,e=void 0),!x)return;const m=e;for(let T=1;T=0;o--)(r=a[o])&&(n=(s<3?r(n):s>3?r(e,t,n):r(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}class Ws{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),Ws._HandleParenthesisContent(i,t))):e=Ws._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:Ws.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(n=>n==="true");let i;const s=e.split("||");for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){let r=Ws._SimplifyNegation(s[n].trim());const o=r.split("&&");if(o.length>1)for(let l=0;l(t=t.replace(/[\s]/g,()=>""),t.length%2?"!":"")),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e}}class Ve{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>Ve.HasTags(e),e.addTags=t=>Ve.AddTagsTo(e,t),e.removeTags=t=>Ve.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>Ve.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;const t=e._tags;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const i=[];for(const s in e._tags)Object.prototype.hasOwnProperty.call(e._tags,s)&&e._tags[s]===!0&&i.push(s);return i.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;t.split(" ").forEach(function(s){Ve._AddTagTo(e,s)})}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(Ve.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!Ve.HasTags(e))return;const i=t.split(" ");for(const s in i)Ve._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?Ve.HasTags(e):Ws.Eval(t,i=>Ve.HasTags(e)&&e._tags[i])}}const br={},dr={},fo=function(a,e,t){const i=a();Ve&&Ve.HasTags(e)&&Ve.AddTagsTo(i,Ve.GetTags(e,!0));const s=Ba(i);for(const n in s){const r=s[n],o=e[n],l=r.type;if(o!=null&&(n!=="uniqueId"||Se.AllowLoadingUniqueId))switch(l){case 0:case 6:case 11:i[n]=o;break;case 1:i[n]=t||o.isRenderTarget?o:o.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:i[n]=t?o:o.clone();break}}return i};function gd(a){const e=a.getClassName();return br[e]||(br[e]={}),br[e]}function Ba(a){const e=a.getClassName();if(dr[e])return dr[e];dr[e]={};const t=dr[e];let i=a,s=e;for(;s;){const n=br[s];for(const l in n)t[l]=n[l];let r,o=!1;do{if(r=Object.getPrototypeOf(i),!r.getClassName){o=!0;break}if(r.getClassName()!==s)break;i=r}while(r);if(o)break;s=r.getClassName(),i=r}return t}function Xi(a,e){return(t,i)=>{const s=gd(t);s[i]||(s[i]={type:a,sourceName:e})}}function md(a,e=null){return(t,i)=>{const s=e||"_"+i;Object.defineProperty(t,i,{get:function(){return this[s]},set:function(n){typeof this.equals=="function"&&this.equals(n)||this[s]!==n&&(this[s]=n,t[a].apply(this))},enumerable:!0,configurable:!0})}}function je(a,e=null){return md(a,e)}function B(a){return Xi(0,a)}function Si(a){return Xi(1,a)}function _s(a){return Xi(2,a)}function Jn(a){return Xi(3,a)}function Al(a){return Xi(4,a)}function wi(a){return Xi(5,a)}function El(a){return Xi(6,a)}function vd(a){return Xi(7,a)}function f0(a){return Xi(8,a)}function xd(a){return Xi(10,a)}function bd(a){return Xi(11,a)}class Se{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i{throw Ae("ImageProcessingConfiguration")};Se._FresnelParametersParser=a=>{throw Ae("FresnelParameters")};Se._ColorCurvesParser=a=>{throw Ae("ColorCurves")};Se._TextureParser=(a,e,t)=>{throw Ae("Texture")};function Os(a,e,t,i){const s=t.value;t.value=(...n)=>{let r=s;if(typeof _native<"u"&&_native[e]){const o=_native[e];i?r=(...l)=>i(...l)?o(...l):s(...l):r=o}return a[e]=r,r(...n)}}Os.filter=function(a){return(e,t,i)=>Os(e,t,i,a)};class _0{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return this._texture?this._texture.isCube:!1}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return(e==null?void 0:e._shareDepth)!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=Ui.Zero(),this._cachedBaseSize=Ui.Zero(),this._initialSamplingMode=2,this._texture=_0._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine())}isReady(){return this.delayLoadState===4?(this.delayLoad(),!1):this._texture?this._texture.isReady:!1}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){return!this.isReady()||!this._texture?(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize):this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize)}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}class ft extends _0{set hasAlpha(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(e){this._getAlphaFromRGB!==e&&(this._getAlphaFromRGB=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(e){this._coordinatesIndex!==e&&(this._coordinatesIndex=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(e){this._texture?this._texture.isCube=e:this._isCube=e}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}get gammaSpace(){if(this._texture)this._texture._gammaSpace===null&&(this._texture._gammaSpace=this._gammaSpace);else return this._gammaSpace;return this._texture._gammaSpace&&!this._texture._useSRGBBuffer}set gammaSpace(e){if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}this._markAllSubMeshesAsTexturesDirty()}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(e){this._texture&&(this._texture._isRGBD=e)}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(e){this._texture&&(this._texture._lodGenerationOffset=e)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(e){this._texture&&(this._texture._lodGenerationScale=e)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(e){this._texture&&(this._texture._linearSpecularLOD=e)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(e){this._texture&&(this._texture._irradianceTexture=e)}get uid(){return this._uid||(this._uid=Tl()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(e,t=null){super(null),this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this._getAlphaFromRGB=!1,this.level=1,this._coordinatesIndex=0,this.optimizeUVAllocation=!0,this._coordinatesMode=0,this.wrapR=1,this.anisotropicFilteringLevel=ft.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this._isCube=!1,this._gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this.isRenderTarget=!1,this._prefiltered=!1,this._forceSerialize=!1,this.animations=new Array,this.onDisposeObservable=new ee,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,e?ft._IsScene(e)?this._scene=e:this._engine=e:this._scene=Ie.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=t,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}checkTransformsAreIdentical(e){return e!==null}getTextureMatrix(){return N.IdentityReadOnly}getReflectionTextureMatrix(){return N.IdentityReadOnly}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(e){}get canRescale(){return!1}_getFromCache(e,t,i,s,n,r){const o=this._getEngine();if(!o)return null;const l=o._getUseSRGBBuffer(!!n,t),h=o.getLoadedTexturesCache();for(let c=0;c=0&&this._scene.textures.splice(e,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const t=this._parentContainer.textures.indexOf(this);t>-1&&this._parentContainer.textures.splice(t,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(e=!1){if(!this.name&&!e)return null;const t=Se.Serialize(this);return Se.AppendSerializedAnimations(this,t),t}static WhenAllReady(e,t){let i=e.length;if(i===0){t();return}for(let s=0;s{--i===0&&t()}):--i===0&&t()}}}static _IsScene(e){return e.getClassName()==="Scene"}}ft.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4;F([B()],ft.prototype,"uniqueId",void 0);F([B()],ft.prototype,"name",void 0);F([B()],ft.prototype,"metadata",void 0);F([B("hasAlpha")],ft.prototype,"_hasAlpha",void 0);F([B("getAlphaFromRGB")],ft.prototype,"_getAlphaFromRGB",void 0);F([B()],ft.prototype,"level",void 0);F([B("coordinatesIndex")],ft.prototype,"_coordinatesIndex",void 0);F([B()],ft.prototype,"optimizeUVAllocation",void 0);F([B("coordinatesMode")],ft.prototype,"_coordinatesMode",void 0);F([B()],ft.prototype,"wrapU",null);F([B()],ft.prototype,"wrapV",null);F([B()],ft.prototype,"wrapR",void 0);F([B()],ft.prototype,"anisotropicFilteringLevel",void 0);F([B()],ft.prototype,"isCube",null);F([B()],ft.prototype,"is3D",null);F([B()],ft.prototype,"is2DArray",null);F([B()],ft.prototype,"gammaSpace",null);F([B()],ft.prototype,"invertZ",void 0);F([B()],ft.prototype,"lodLevelInAlpha",void 0);F([B()],ft.prototype,"lodGenerationOffset",null);F([B()],ft.prototype,"lodGenerationScale",null);F([B()],ft.prototype,"linearSpecularLOD",null);F([Si()],ft.prototype,"irradianceTexture",null);F([B()],ft.prototype,"isRenderTarget",void 0);function Cl(a,e,t=!1){const i=e.width,s=e.height;if(a instanceof Float32Array){let h=a.byteLength/a.BYTES_PER_ELEMENT;const c=new Uint8Array(h);for(;--h>=0;){let u=a[h];u<0?u=0:u>1&&(u=1),c[h]=u*255}a=c}const n=document.createElement("canvas");n.width=i,n.height=s;const r=n.getContext("2d");if(!r)return null;const o=r.createImageData(i,s);if(o.data.set(a),r.putImageData(o,0,0),t){const h=document.createElement("canvas");h.width=i,h.height=s;const c=h.getContext("2d");return c?(c.translate(0,s),c.scale(1,-1),c.drawImage(n,0,0),h.toDataURL("image/png")):null}return n.toDataURL("image/png")}function yd(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=a._readPixelsSync(e,t);return s?Cl(s,a.getSize(),i.invertY):null}async function Td(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=await a.readPixels(e,t);return s?Cl(s,a.getSize(),i.invertY):null}class Ne{}Ne.UseOpenGLOrientationForUV=!1;class se extends ft{get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,i,s,n=se.TRILINEAR_SAMPLINGMODE,r=null,o=null,l=null,h=!1,c,u,d,_,f){var g,p,x,m,T,S,b,y,E;super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new ee,this._isBlocking=!0,this.name=e||"",this.url=e;let P,C=!1,R=null;typeof i=="object"&&i!==null?(P=(g=i.noMipmap)!==null&&g!==void 0?g:!1,s=(p=i.invertY)!==null&&p!==void 0?p:!Ne.UseOpenGLOrientationForUV,n=(x=i.samplingMode)!==null&&x!==void 0?x:se.TRILINEAR_SAMPLINGMODE,r=(m=i.onLoad)!==null&&m!==void 0?m:null,o=(T=i.onError)!==null&&T!==void 0?T:null,l=(S=i.buffer)!==null&&S!==void 0?S:null,h=(b=i.deleteBuffer)!==null&&b!==void 0?b:!1,c=i.format,u=i.mimeType,d=i.loaderOptions,_=i.creationFlags,C=(y=i.useSRGBBuffer)!==null&&y!==void 0?y:!1,R=(E=i.internalTexture)!==null&&E!==void 0?E:null):P=!!i,this._noMipmap=P,this._invertY=s===void 0?!Ne.UseOpenGLOrientationForUV:s,this._initialSamplingMode=n,this._buffer=l,this._deleteBuffer=h,this._mimeType=u,this._loaderOptions=d,this._creationFlags=_,this._useSRGBBuffer=C,this._forcedExtension=f,c&&(this._format=c);const w=this.getScene(),D=this._getEngine();if(!D)return;D.onBeforeTextureInitObservable.notifyObservers(this);const W=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),this._texture._cachedWrapU!==null&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),this._texture._cachedWrapV!==null&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),this._texture._cachedWrapR!==null&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),r&&r(),!this.isBlocking&&w&&w.resetCachedMaterial()},L=(z,K)=>{this._loadingError=!0,this._errorObject={message:z,exception:K},o&&o(z,K),se.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!R){this._delayedOnLoad=W,this._delayedOnError=L;return}if(this._texture=R!=null?R:this._getFromCache(this.url,P,n,this._invertY,C),this._texture)if(this._texture.isReady)Mr.SetImmediate(()=>W());else{const z=this._texture.onLoadedObservable.add(W);this._texture.onErrorObservable.add(K=>{var ae;L(K.message,K.exception),(ae=this._texture)===null||ae===void 0||ae.onLoadedObservable.remove(z)})}else if(!w||!w.useDelayedTextureLoading){try{this._texture=D.createTexture(this.url,P,this._invertY,w,n,W,L,this._buffer,void 0,this._format,this._forcedExtension,u,d,_,C)}catch(z){throw L("error loading",z),z}h&&(this._buffer=null)}else this.delayLoadState=4,this._delayedOnLoad=W,this._delayedOnError=L}updateURL(e,t=null,i,s){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1)),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=s,this.delayLoadState=4,i&&(this._delayedOnLoad=i),this.delayLoad()}delayLoad(){if(this.delayLoadState!==4)return;const e=this.getScene();e&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer),this._texture?this._delayedOnLoad&&(this._texture.isReady?Mr.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null)}_prepareRowForTextureGeneration(e,t,i,s){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,v.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,s),s.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,s.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,s.z+=this.wRotationCenter}checkTransformsAreIdentical(e){return e!==null&&this.uOffset===e.uOffset&&this.vOffset===e.vOffset&&this.uScale===e.uScale&&this.vScale===e.vScale&&this.uAng===e.uAng&&this.vAng===e.vAng&&this.wAng===e.wAng}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,(!this._cachedTextureMatrix||!this._rowGenerationMatrix)&&(this._cachedTextureMatrix=N.Zero(),this._rowGenerationMatrix=new N,this._t0=v.Zero(),this._t1=v.Zero(),this._t2=v.Zero()),N.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(N.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,G.Matrix[0]),N.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,G.Matrix[1]),N.ScalingToRef(this._cachedUScale,this._cachedVScale,0,G.Matrix[2]),N.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,G.Matrix[3]),G.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(G.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(G.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(G.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),N.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));const t=this.getScene();return t?(this.optimizeUVAllocation&&t.markAllMaterialsAsDirty(1,i=>i.hasTexture(this)),this._cachedTextureMatrix):this._cachedTextureMatrix}getReflectionTextureMatrix(){const e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode)if(this.coordinatesMode===se.PROJECTION_MODE){if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}else return this._cachedReflectionTextureMatrix;this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=N.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=N.Zero());const t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case se.PLANAR_MODE:{N.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break}case se.PROJECTION_MODE:{N.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);const i=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=i.updateFlag,i.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:N.IdentityToRef(this._cachedReflectionTextureMatrix);break}return t&&e.markAllMaterialsAsDirty(1,i=>i.getActiveTextures().indexOf(this)!==-1),this._cachedReflectionTextureMatrix}clone(){const e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return Se.Clone(()=>new se(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){var e,t;const i=this.name;se.SerializeBuffers||this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");const s=super.serialize(se._SerializeInternalTextureUniqueId);return s?((se.SerializeBuffers||se.ForceSerializeBuffers)&&(typeof this._buffer=="string"&&this._buffer.substr(0,5)==="data:"?(s.base64String=this._buffer,s.name=s.name.replace("data:","")):this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array?s.base64String="data:image/png;base64,"+gl(this._buffer):(se.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(s.base64String=!this._engine||this._engine._features.supportSyncTextureRead?yd(this):Td(this))),s.invertY=this._invertY,s.samplingMode=this.samplingMode,s._creationFlags=this._creationFlags,s._useSRGBBuffer=this._useSRGBBuffer,se._SerializeInternalTextureUniqueId&&(s.internalTextureUniqueId=(t=(e=this._texture)===null||e===void 0?void 0:e.uniqueId)!==null&&t!==void 0?t:void 0),this.name=i,s):null}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){if(e.customType){const h=On.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&h.updateSamplingMode&&h._samplingMode&&h._samplingMode!==e.samplingMode&&h.updateSamplingMode(e.samplingMode),h}if(e.isCube&&!e.isRenderTarget)return se._CubeTextureParser(e,t,i);const s=e.internalTextureUniqueId!==void 0;if(!e.name&&!e.isRenderTarget&&!s)return null;let n;if(s){const l=t.getEngine().getLoadedTexturesCache();for(const h of l)if(h.uniqueId===e.internalTextureUniqueId){n=h;break}}const r=l=>{var h;if(l&&l._texture&&(l._texture._cachedWrapU=null,l._texture._cachedWrapV=null,l._texture._cachedWrapR=null),e.samplingMode){const c=e.samplingMode;l&&l.samplingMode!==c&&l.updateSamplingMode(c)}if(l&&e.animations)for(let c=0;c{var l,h,c;let u=!0;if(e.noMipmap&&(u=!1),e.mirrorPlane){const d=se._CreateMirror(e.name,e.renderTargetSize,t,u);return d._waitingRenderList=e.renderList,d.mirrorPlane=ni.FromArray(e.mirrorPlane),r(d),d}else if(e.isRenderTarget){let d=null;if(e.isCube){if(t.reflectionProbes)for(let _=0;_{r(d)},(h=e._creationFlags)!==null&&h!==void 0?h:0,(c=e._useSRGBBuffer)!==null&&c!==void 0?c:!1),d.name=e.name;else{let _;e.name&&e.name.indexOf("://")>0?_=e.name:_=i+e.name,e.url&&(e.url.startsWith("data:")||se.UseSerializedUrlIfAny)&&(_=e.url);const f={noMipmap:!u,invertY:e.invertY,samplingMode:e.samplingMode,onLoad:()=>{r(d)},internalTexture:n};d=new se(_,t,f)}return d}},e,t)}static CreateFromBase64String(e,t,i,s,n,r=se.TRILINEAR_SAMPLINGMODE,o=null,l=null,h=5,c){return new se("data:"+t,i,s,n,r,o,l,e,!1,h,void 0,void 0,c)}static LoadFromDataString(e,t,i,s=!1,n,r=!0,o=se.TRILINEAR_SAMPLINGMODE,l=null,h=null,c=5,u){return e.substr(0,5)!=="data:"&&(e="data:"+e),new se(e,i,n,r,o,l,h,t,s,c,void 0,void 0,u)}}se.SerializeBuffers=!0;se.ForceSerializeBuffers=!1;se.OnTextureLoadErrorObservable=new ee;se._SerializeInternalTextureUniqueId=!1;se._CubeTextureParser=(a,e,t)=>{throw Ae("CubeTexture")};se._CreateMirror=(a,e,t,i)=>{throw Ae("MirrorTexture")};se._CreateRenderTargetTexture=(a,e,t,i,s)=>{throw Ae("RenderTargetTexture")};se.NEAREST_SAMPLINGMODE=1;se.NEAREST_NEAREST_MIPLINEAR=8;se.BILINEAR_SAMPLINGMODE=2;se.LINEAR_LINEAR_MIPNEAREST=11;se.TRILINEAR_SAMPLINGMODE=3;se.LINEAR_LINEAR_MIPLINEAR=3;se.NEAREST_NEAREST_MIPNEAREST=4;se.NEAREST_LINEAR_MIPNEAREST=5;se.NEAREST_LINEAR_MIPLINEAR=6;se.NEAREST_LINEAR=7;se.NEAREST_NEAREST=1;se.LINEAR_NEAREST_MIPNEAREST=9;se.LINEAR_NEAREST_MIPLINEAR=10;se.LINEAR_LINEAR=2;se.LINEAR_NEAREST=12;se.EXPLICIT_MODE=0;se.SPHERICAL_MODE=1;se.PLANAR_MODE=2;se.CUBIC_MODE=3;se.PROJECTION_MODE=4;se.SKYBOX_MODE=5;se.INVCUBIC_MODE=6;se.EQUIRECTANGULAR_MODE=7;se.FIXED_EQUIRECTANGULAR_MODE=8;se.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;se.CLAMP_ADDRESSMODE=0;se.WRAP_ADDRESSMODE=1;se.MIRROR_ADDRESSMODE=2;se.UseSerializedUrlIfAny=!1;F([B()],se.prototype,"url",void 0);F([B()],se.prototype,"uOffset",void 0);F([B()],se.prototype,"vOffset",void 0);F([B()],se.prototype,"uScale",void 0);F([B()],se.prototype,"vScale",void 0);F([B()],se.prototype,"uAng",void 0);F([B()],se.prototype,"vAng",void 0);F([B()],se.prototype,"wAng",void 0);F([B()],se.prototype,"uRotationCenter",void 0);F([B()],se.prototype,"vRotationCenter",void 0);F([B()],se.prototype,"wRotationCenter",void 0);F([B()],se.prototype,"homogeneousRotationInUVTransform",void 0);F([B()],se.prototype,"isBlocking",null);Vt("BABYLON.Texture",se);Se._TextureParser=se.Parse;class Na{constructor(e){this._vertexBuffers={},this._scene=e}_prepareBuffers(){if(this._vertexBuffers[A.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[A.PositionKind]=new A(this._scene.getEngine(),e,A.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_rebuild(){const e=this._vertexBuffers[A.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const i=this._scene.activeCamera;return!i||(t=t||i._postProcesses.filter(s=>s!=null),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(i,e,t!=null),!0)}directRender(e,t=null,i=!1,s=0,n=0,r=!1){var o;const l=this._scene.getEngine();for(let h=0;hh!=null),s.length===0||!this._scene.postProcessesEnabled))return;const l=this._scene.getEngine();for(let h=0,c=s.length;hthis.data.length&&(this.data.length*=2)}forEach(e){for(let t=0;tthis.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t=this.length?-1:t}contains(e){return this.indexOf(e)!==-1}}qt._GlobalId=0;class Vs extends qt{constructor(){super(...arguments),this._duplicateId=0}push(e){super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){return e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId?!1:(this.push(e),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;tt._alphaIndex?1:e._alphaIndext._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamerat._distanceToCamera?1:0}static PainterSortCompare(e,t){const i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),i===void 0&&(i=e.getMaterial()),i!=null&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTesting()?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(this._particleSystems.length===0)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i0}get size(){return this.width}get width(){return this._size.width||this._size}get height(){return this._size.height||this._size}get layers(){return this._size.layers||0}get texture(){var e,t;return(t=(e=this._textures)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;const s=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,s}constructor(e,t,i,s){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=s,this._depthStencilTexture=null}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),i!==void 0&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,r){var o;return(o=this._depthStencilTexture)===null||o===void 0||o.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:s,depthTextureFormat:n,label:r},this),this._depthStencilTexture}_shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){var e,t,i,s,n,r,o,l;let h=null;if(this._isMulti){const c=this.textures;if(c&&c.length>0){let u=!1,d=c.length;const _=c[c.length-1]._source;(_===ze.Depth||_===ze.DepthStencil)&&(u=!0,d--);const f=[],g=[],p=[],x=[],m=[],T=[],S=[],b={};for(let P=0;P1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){var e,t;if(this._textures)for(let i=0;(t=i<((e=this._textures)===null||e===void 0?void 0:e.length))!==null&&t!==void 0&&t;++i)this._textures[i].dispose();this._textures=null}dispose(e=!1){var t;e||((t=this._depthStencilTexture)===null||t===void 0||t.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class Ad extends Rl{constructor(e,t,i,s,n){super(e,t,i,s),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._context=n}_cloneRenderTargetWrapper(){let e=null;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height),e.texture.isReady=!0):e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}_shareDepth(e){super._shareDepth(e);const t=this._context,i=this._depthStencilBuffer,s=e._MSAAFramebuffer||e._framebuffer;e._depthStencilBuffer&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=this._depthStencilBuffer,this._engine._bindUnboundFramebuffer(s),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,i),this._engine._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,s=0){var n,r,o,l;if(!e._hardwareTexture)return;const h=this._framebuffer,c=this._engine._currentFramebuffer;if(this._engine._bindUnboundFramebuffer(h),this._engine.webGLVersion>1){const u=this._context,d=u["COLOR_ATTACHMENT"+t];e.is2DArray||e.is3D?(i=(r=i!=null?i:(n=this.layerIndices)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0,u.framebufferTextureLayer(u.FRAMEBUFFER,d,e._hardwareTexture.underlyingResource,s,i)):e.isCube?(i=(l=i!=null?i:(o=this.faceIndices)===null||o===void 0?void 0:o[t])!==null&&l!==void 0?l:0,u.framebufferTexture2D(u.FRAMEBUFFER,d,u.TEXTURE_CUBE_MAP_POSITIVE_X+i,e._hardwareTexture.underlyingResource,s)):u.framebufferTexture2D(u.FRAMEBUFFER,d,u.TEXTURE_2D,e._hardwareTexture.underlyingResource,s)}else{const u=this._context,d=u["COLOR_ATTACHMENT"+t+"_WEBGL"],_=i!==void 0?u.TEXTURE_CUBE_MAP_POSITIVE_X+i:u.TEXTURE_2D;u.framebufferTexture2D(u.FRAMEBUFFER,d,_,e._hardwareTexture.underlyingResource,s)}this._engine._bindUnboundFramebuffer(c)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){var i,s;if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const n=(s=(i=this._attachments)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:this.textures.length;for(let r=0;r1&&(r.format===15?u=i.DEPTH_COMPONENT16:r.format===16?u=i.DEPTH_COMPONENT24:r.format===17||r.format===13?u=i.DEPTH24_STENCIL8:r.format===14?u=i.DEPTH_COMPONENT32F:r.format===18&&(u=i.DEPTH32F_STENCIL8)),r.is2DArray?i.texImage3D(n,0,u,r.width,r.height,s,0,c,h,null):i.texImage2D(n,0,u,r.width,r.height,0,c,h,null),this._bindTextureDirectly(n,null),this._internalTexturesCache.push(r);const d=t;if(d._depthStencilBuffer){const _=this._currentFramebuffer;this._bindUnboundFramebuffer(d._framebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.STENCIL_ATTACHMENT,i.RENDERBUFFER,null),this._bindUnboundFramebuffer(_),i.deleteRenderbuffer(d._depthStencilBuffer),d._depthStencilBuffer=null}return r};Ee.prototype.updateRenderTargetTextureSampleCount=function(a,e){if(this.webGLVersion<2||!a||!a.texture)return 1;if(a.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),a._depthStencilBuffer&&(t.deleteRenderbuffer(a._depthStencilBuffer),a._depthStencilBuffer=null),a._MSAAFramebuffer&&(t.deleteFramebuffer(a._MSAAFramebuffer),a._MSAAFramebuffer=null);const i=a.texture._hardwareTexture;if(i.releaseMSAARenderBuffers(),e>1&&typeof t.renderbufferStorageMultisample=="function"){const s=t.createFramebuffer();if(!s)throw new Error("Unable to create multi sampled framebuffer");a._MSAAFramebuffer=s,this._bindUnboundFramebuffer(a._MSAAFramebuffer);const n=this._createRenderBuffer(a.texture.width,a.texture.height,e,-1,this._getRGBAMultiSampleBufferFormat(a.texture.type),t.COLOR_ATTACHMENT0,!1);if(!n)throw new Error("Unable to create multi sampled framebuffer");i.addMSAARenderBuffer(n)}else this._bindUnboundFramebuffer(a._framebuffer);return a.texture.samples=e,a._samples=e,a._depthStencilBuffer=this._setupFramebufferDepthAttachments(a._generateStencilBuffer,a._generateDepthBuffer,a.texture.width,a.texture.height,e),this._bindUnboundFramebuffer(null),e};Ee.prototype.createRenderTargetCubeTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type===1&&!this._caps.textureFloatLinearFiltering||i.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(i.samplingMode=1);const s=this._gl,n=new Dt(this,ze.RenderTarget);this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,n,!0);const r=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type===1&&!this._caps.textureFloat&&(i.type=0,H.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,r.mag),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,r.min),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE);for(let l=0;l<6;l++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),a,a,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);const o=s.createFramebuffer();return this._bindUnboundFramebuffer(o),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,a,a),i.generateMipMaps&&s.generateMipmap(s.TEXTURE_CUBE_MAP),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=o,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer,n.width=a,n.height=a,n.isReady=!0,n.isCube=!0,n.samples=1,n.generateMipMaps=i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n.format=i.format,this._internalTexturesCache.push(n),t.setTextures(n),t};const Ed="postprocessVertexShader",Cd="attribute vec2 position;\nuniform vec2 scale;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";te.ShadersStore[Ed]=Cd;const ba={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class Rd{constructor(e,t=ba){var i,s;this._fullscreenViewport=new mn(0,0,1,1);const n=(i=t.positions)!==null&&i!==void 0?i:ba.positions,r=(s=t.indices)!==null&&s!==void 0?s:ba.indices;this.engine=e,this._vertexBuffers={[A.PositionKind]:new A(e,n,A.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(r),this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{this._indexBuffer=e.createIndexBuffer(r);for(const o in this._vertexBuffers)this._vertexBuffers[o]._rebuild()})}setViewport(e=this._fullscreenViewport){this.engine.setViewport(e)}bindBuffers(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)}applyEffectWrapper(e){this.engine.setState(!0),this.engine.depthCullingState.depthTest=!1,this.engine.stencilState.stencilTest=!1,this.engine.enableEffect(e._drawWrapper),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})}restoreStates(){this.engine.depthCullingState.depthTest=!0,this.engine.stencilState.stencilTest=!0}draw(){this.engine.drawElementsType(0,0,6)}_isRenderTargetTexture(e){return e.renderTarget!==void 0}render(e,t=null){if(!e.effect.isReady())return;this.setViewport();const i=t===null?null:this._isRenderTargetTexture(t)?t.renderTarget:t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}dispose(){const e=this._vertexBuffers[A.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[A.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class Id{get effect(){return this._drawWrapper.effect}set effect(e){this._drawWrapper.effect=e}constructor(e){this.onApplyObservable=new ee;let t;const i=e.uniformNames||[];e.vertexShader?t={fragmentSource:e.fragmentShader,vertexSource:e.vertexShader,spectorName:e.name||"effectWrapper"}:(i.push("scale"),t={fragmentSource:e.fragmentShader,vertex:"postprocess",spectorName:e.name||"effectWrapper"},this.onApplyObservable.add(()=>{this.effect.setFloat2("scale",1,1)}));const s=e.defines?e.defines.join("\n"):"";this._drawWrapper=new Ns(e.engine),e.useShaderStore?(t.fragment=t.fragmentSource,t.vertex||(t.vertex=t.vertexSource),delete t.fragmentSource,delete t.vertexSource,this.effect=e.engine.createEffect(t,e.attributeNames||["position"],i,e.samplerNames,s,void 0,e.onCompiled,void 0,void 0,e.shaderLanguage)):(this.effect=new wt(t,e.attributeNames||["position"],i,e.samplerNames,e.engine,s,void 0,e.onCompiled,void 0,void 0,void 0,e.shaderLanguage),this._onContextRestoredObserver=e.engine.onContextRestoredObservable.add(()=>{this.effect._pipelineContext=null,this.effect._wasPreviouslyReady=!1,this.effect._prepareEffect()}))}dispose(){this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),this.effect.dispose()}}const Il="passPixelShader",Ml="varying vec2 vUV;\nuniform sampler2D textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}";te.ShadersStore[Il]=Ml;const _o={name:Il,shader:Ml};class Yt{static _CreateDumpRenderer(){if(!Yt._DumpToolsEngine){const e=document.createElement("canvas"),t=new Ee(e,!1,{preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1});t.getCaps().parallelShaderCompile=void 0;const i=new Rd(t),s=new Id({engine:t,name:_o.name,fragmentShader:_o.shader,samplerNames:["textureSampler"]});Yt._DumpToolsEngine={canvas:e,engine:t,renderer:i,wrapper:s}}return Yt._DumpToolsEngine}static async DumpFramebuffer(e,t,i,s,n="image/png",r){const o=await i.readPixels(0,0,e,t),l=new Uint8Array(o.buffer);Yt.DumpData(e,t,l,s,n,r,!0)}static DumpDataAsync(e,t,i,s="image/png",n,r=!1,o=!1,l){return new Promise(h=>{Yt.DumpData(e,t,i,c=>h(c),s,n,r,o,l)})}static DumpData(e,t,i,s,n="image/png",r,o=!1,l=!1,h){const c=Yt._CreateDumpRenderer();if(c.engine.setSize(e,t,!0),i instanceof Float32Array){const d=new Uint8Array(i.length);let _=i.length;for(;_--;){const f=i[_];d[_]=f<0?0:f>1?1:Math.round(f*255)}i=d}const u=c.engine.createRawTexture(i,e,t,5,!1,!o,1);c.renderer.setViewport(),c.renderer.applyEffectWrapper(c.wrapper),c.wrapper.effect._bindTexture("textureSampler",u),c.renderer.draw(),l?re.ToBlob(c.canvas,d=>{const _=new FileReader;_.onload=f=>{const g=f.target.result;s&&s(g)},_.readAsArrayBuffer(d)},n,h):re.EncodeScreenshotCanvasData(c.canvas,s,n,r,h),u.dispose()}static Dispose(){Yt._DumpToolsEngine&&(Yt._DumpToolsEngine.wrapper.dispose(),Yt._DumpToolsEngine.renderer.dispose(),Yt._DumpToolsEngine.engine.dispose()),Yt._DumpToolsEngine=null}}const Md=()=>{re.DumpData=Yt.DumpData,re.DumpDataAsync=Yt.DumpDataAsync,re.DumpFramebuffer=Yt.DumpFramebuffer};Md();class zi extends se{get renderList(){return this._renderList}set renderList(e){this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=_l(e,this._renderListHasChanged)),this._renderList=e}get postProcesses(){return this._postProcesses}get _prePassEnabled(){return!!this._prePassRenderTarget&&this._prePassRenderTarget.enabled}set onAfterUnbind(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}set onClear(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)}get renderPassIds(){return this._renderPassIds}get currentRefreshId(){return this._currentRefreshId}setMaterialForRendering(e,t){let i;Array.isArray(e)?i=e:i=[e];for(let s=0;s{var D;const W=this._renderList?this._renderList.length:0;(w===0&&W>0||W===0)&&((D=this.getScene())===null||D===void 0||D.meshes.forEach(L=>{L._markSubMeshesAsLightDirty()}))},this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new ee,this.onAfterUnbindObservable=new ee,this.onBeforeRenderObservable=new ee,this.onAfterRenderObservable=new ee,this.onClearObservable=new ee,this.onResizeObservable=new ee,this._cleared=!1,this.skipInitialClear=!1,this._currentRefreshId=-1,this._refreshRate=1,this._samples=1,this._canRescale=!0,this._renderTarget=null,this.boundingBoxPosition=v.Zero(),i=this.getScene(),!i)return;const C=this.getScene().getEngine();this._coordinatesMode=se.PROJECTION_MODE,this.renderList=new Array,this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=t,this._renderPassIds=[],this._isCubeData=o,this._processSizeParameter(t),this.renderPassId=this._renderPassIds[0],this._resizeObserver=C.onResizeObservable.add(()=>{}),this._generateMipMaps=!!s,this._doNotChangeAspectRatio=n,this._renderingManager=new Kt(i),this._renderingManager._useSceneAutoClearSetup=!0,!u&&(this._renderTargetOptions={generateMipMaps:s,type:r,format:(E=this._format)!==null&&E!==void 0?E:void 0,samplingMode:this.samplingMode,generateDepthBuffer:h,generateStencilBuffer:c,samples:f,creationFlags:g,noColorAttachment:p,useSRGBBuffer:x,colorAttachment:P,label:this.name},this.samplingMode===se.NEAREST_SAMPLINGMODE&&(this.wrapU=se.CLAMP_ADDRESSMODE,this.wrapV=se.CLAMP_ADDRESSMODE),_||(o?(this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=se.INVCUBIC_MODE,this._textureMatrix=N.Identity()):this._renderTarget=i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,f!==void 0&&(this.samples=f)))}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14){var r;(r=this._renderTarget)===null||r===void 0||r.createDepthStencilTexture(e,t,i,s,n)}_releaseRenderPassId(){if(this._scene){const e=this._scene.getEngine();for(let t=0;t0&&(this._postProcesses[0].autoClear=!1))}_shouldRender(){return this._currentRefreshId===-1?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)}getRenderSize(){return this.getRenderWidth()}getRenderWidth(){return this._size.width?this._size.width:this._size}getRenderHeight(){return this._size.width?this._size.height:this._size}getRenderLayers(){const e=this._size.layers;return e||0}disableRescaling(){this._canRescale=!1}get canRescale(){return this._canRescale}scale(e){const t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){var t;const i=this.isCube;(t=this._renderTarget)===null||t===void 0||t.dispose(),this._renderTarget=null;const s=this.getScene();s&&(this._processSizeParameter(e),i?this._renderTarget=s.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=s.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,this._renderTargetOptions.samples!==void 0&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){this._render(e,t)}isReadyForRendering(){return this._render(!1,!1,!0)}_render(e=!1,t=!1,i=!1){var s;const n=this.getScene();if(!n)return i;const r=n.getEngine();if(this.useCameraPostProcesses!==void 0&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(let u=0;u1||this.activeCamera&&this.activeCamera!==n.activeCamera)&&n.setTransformMatrix(n.activeCamera.getViewMatrix(),n.activeCamera.getProjectionMatrix(!0)),r.setViewport(n.activeCamera.viewport)),n.resetCachedMaterial(),c}_bestReflectionRenderTargetDimension(e,t){const s=e*t,n=Y.NearestPOT(s+128*128/(128+s));return Math.min(Y.FloorPOT(e),n)}_prepareRenderingManager(e,t,i,s){const n=this.getScene();if(!n)return;this._renderingManager.reset();const r=n.getRenderId();for(let o=0;o{this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,i,s){this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses):(!s||!e.postProcessManager._prepareFrame(this._texture))&&this._bindFrameBuffer(t,i)}_renderToTarget(e,t,i,s=0,n=null){var r,o,l,h,c,u;const d=this.getScene();if(!d)return;const _=d.getEngine();if((r=_._debugPushGroup)===null||r===void 0||r.call(_,"render to face #".concat(e," layer #").concat(s),1),this._prepareFrame(d,e,s,t),this.is2DArray?(_.currentRenderPassId=this._renderPassIds[s],this.onBeforeRenderObservable.notifyObservers(s)):(_.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e)),_.snapshotRendering&&_.snapshotRenderingMode===1)this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(_):this.skipInitialClear||_.clear(this.clearColor||d.clearColor,!0,!0,!0);else{let g=null;const p=this.renderList?this.renderList:d.getActiveMeshes().data,x=this.renderList?this.renderList.length:d.getActiveMeshes().length;this.getCustomRenderList&&(g=this.getCustomRenderList(this.is2DArray?s:e,p,x)),g?this._prepareRenderingManager(g,g.length,n,this.forceLayerMaskCheck):(this._defaultRenderListPrepared||(this._prepareRenderingManager(p,x,n,!this.renderList||this.forceLayerMaskCheck),this._defaultRenderListPrepared=!0),g=p);for(const T of d._beforeRenderTargetClearStage)T.action(this,e,s);this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(_):this.skipInitialClear||_.clear(this.clearColor||d.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||d.updateTransformMatrix(!0);for(const T of d._beforeRenderTargetDrawStage)T.action(this,e,s);this._renderingManager.render(this.customRenderFunction,g,this.renderParticles,this.renderSprites);for(const T of d._afterRenderTargetDrawStage)T.action(this,e,s);const m=(l=(o=this._texture)===null||o===void 0?void 0:o.generateMipMaps)!==null&&l!==void 0?l:!1;this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,(h=this._renderTarget)!==null&&h!==void 0?h:void 0,e,this._postProcesses,this.ignoreCameraViewport):t&&d.postProcessManager._finalizeFrame(!1,(c=this._renderTarget)!==null&&c!==void 0?c:void 0,e);for(const T of d._afterRenderTargetPostProcessStage)T.action(this,e,s);this._texture&&(this._texture.generateMipMaps=m),this._doNotChangeAspectRatio||d.updateTransformMatrix(!0),i&&Yt.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),_)}this._unbindFrameBuffer(_,e),this._texture&&this.isCube&&e===5&&_.generateMipMapsForCubemap(this._texture),(u=_._debugPopGroup)===null||u===void 0||u.call(_,1)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t){this._renderingManager.setRenderingAutoClearDepthStencil(e,t),this._renderingManager._useSceneAutoClearSetup=!1}clone(){const e=this.getSize(),t=new zi(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){if(!this.name)return null;const e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t=0&&t.customRenderTargets.splice(i,1);for(const s of t.cameras)i=s.customRenderTargets.indexOf(this),i>=0&&s.customRenderTargets.splice(i,1);(e=this._renderTarget)===null||e===void 0||e.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this.refreshRate===zi.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=zi.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._renderingManager&&this._renderingManager.freeRenderingGroups()}getViewCount(){return 1}}zi.REFRESHRATE_RENDER_ONCE=0;zi.REFRESHRATE_RENDER_ONEVERYFRAME=1;zi.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2;se._CreateRenderTargetTexture=(a,e,t,i,s)=>new zi(a,e,t,i);class st{static RegisterShaderCodeProcessing(e,t){if(!t){delete st._CustomShaderCodeProcessing[e!=null?e:""];return}st._CustomShaderCodeProcessing[e!=null?e:""]=t}static _GetShaderCodeProcessing(e){var t;return(t=st._CustomShaderCodeProcessing[e])!==null&&t!==void 0?t:st._CustomShaderCodeProcessing[""]}get samples(){return this._samples}set samples(e){this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(t=>{t.setSamples(this._samples)})}getEffectName(){return this._fragmentUrl}set onActivate(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))}set onSizeChanged(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)}set onApply(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get inputTexture(){return this._textures.data[this._currentRenderTextureInd]}set inputTexture(e){this._forcedOutputTexture=e}restoreDefaultInputTexture(){this._forcedOutputTexture&&(this._forcedOutputTexture=null,this.markTextureDirty())}getCamera(){return this._camera}get texelSize(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)}constructor(e,t,i,s,n,r,o=1,l,h,c=null,u=0,d="postprocess",_,f=!1,g=5,p=at.GLSL){this._parentContainer=null,this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.forceAutoClearInAlphaMode=!1,this.alphaMode=0,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=1,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._renderId=0,this.externalTextureSamplerBinding=!1,this._textures=new qt(2),this._textureCache=[],this._currentRenderTextureInd=0,this._scaleRatio=new fe(1,1),this._texelSize=fe.Zero(),this.onActivateObservable=new ee,this.onSizeChangedObservable=new ee,this.onApplyObservable=new ee,this.onBeforeRenderObservable=new ee,this.onAfterRenderObservable=new ee,this.name=e,r!=null?(this._camera=r,this._scene=r.getScene(),r.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this),this.uniqueId=this._scene.getUniqueId()):l&&(this._engine=l,this._engine.postProcesses.push(this)),this._options=n,this.renderTargetSamplingMode=o||1,this._reusable=h||!1,this._textureType=u,this._textureFormat=g,this._shaderLanguage=p,this._samplers=s||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=d,this._parameters=i||[],this._parameters.push("scale"),this._indexParameters=_,this._drawWrapper=new Ns(this._engine),f||this.updateEffect(c)}getClassName(){return"PostProcess"}getEngine(){return this._engine}getEffect(){return this._drawWrapper.effect}shareOutputWith(e){return this._disposeTextures(),this._shareOutputWithPostProcess=e,this}useOwnOutput(){this._textures.length==0&&(this._textures=new qt(2)),this._shareOutputWithPostProcess=null}updateEffect(e=null,t=null,i=null,s,n,r,o,l){var h,c;const u=st._GetShaderCodeProcessing(this.name);if(u!=null&&u.defineCustomBindings){const d=(h=t==null?void 0:t.slice())!==null&&h!==void 0?h:[];d.push(...this._parameters);const _=(c=i==null?void 0:i.slice())!==null&&c!==void 0?c:[];_.push(...this._samplers),e=u.defineCustomBindings(this.name,e,d,_),t=d,i=_}this._postProcessDefines=e,this._drawWrapper.effect=this._engine.createEffect({vertex:o!=null?o:this._vertexUrl,fragment:l!=null?l:this._fragmentUrl},{attributes:["position"],uniformsNames:t||this._parameters,uniformBuffersNames:[],samplers:i||this._samplers,defines:e!==null?e:"",fallbacks:null,onCompiled:n!=null?n:null,onError:r!=null?r:null,indexParameters:s||this._indexParameters,processCodeAfterIncludes:u!=null&&u.processCodeAfterIncludes?(d,_)=>u.processCodeAfterIncludes(this.name,d,_):null,processFinalCode:u!=null&&u.processFinalCode?(d,_)=>u.processFinalCode(this.name,d,_):null,shaderLanguage:this._shaderLanguage},this._engine)}isReusable(){return this._reusable}markTextureDirty(){this.width=-1}_createRenderTargetTexture(e,t,i=0){for(let n=0;n=0;t--)if(e-this._textureCache[t].lastUsedRenderId>100){let i=!1;for(let s=0;s0&&this._textures.reset(),this.width=e,this.height=t;let r=null;for(let h=0;h{p.samples!==this.samples&&this._engine.updateRenderTargetTextureSampleCount(p,this.samples)}),this._flushTextureCache(),this._renderId++}let g;if(this._shareOutputWithPostProcess)g=this._shareOutputWithPostProcess.inputTexture;else if(this._forcedOutputTexture)g=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height;else{g=this.inputTexture;let p;for(let x=0;x=0;e--)this._textureCache[e].texture.dispose();this._textureCache.length=0}setPrePassRenderer(e){return this._prePassEffectConfiguration?(this._prePassEffectConfiguration=e.addEffectConfiguration(this._prePassEffectConfiguration),this._prePassEffectConfiguration.enabled=!0,!0):!1}dispose(e){e=e||this._camera,this._disposeTextures();let t;if(this._scene&&(t=this._scene.postProcesses.indexOf(this),t!==-1&&this._scene.postProcesses.splice(t,1)),this._parentContainer){const i=this._parentContainer.postProcesses.indexOf(this);i>-1&&this._parentContainer.postProcesses.splice(i,1),this._parentContainer=null}if(t=this._engine.postProcesses.indexOf(this),t!==-1&&this._engine.postProcesses.splice(t,1),!!e){if(e.detachPostProcess(this),t=e._postProcesses.indexOf(this),t===0&&e._postProcesses.length>0){const i=this._camera._getFirstPostProcess();i&&i.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear()}}serialize(){const e=Se.Serialize(this),t=this.getCamera()||this._scene&&this._scene.activeCamera;return e.customType="BABYLON."+this.getClassName(),e.cameraId=t?t.id:null,e.reusable=this._reusable,e.textureType=this._textureType,e.fragmentUrl=this._fragmentUrl,e.parameters=this._parameters,e.samplers=this._samplers,e.options=this._options,e.defines=this._postProcessDefines,e.textureFormat=this._textureFormat,e.vertexUrl=this._vertexUrl,e.indexParameters=this._indexParameters,e}clone(){const e=this.serialize();e._engine=this._engine,e.cameraId=null;const t=st.Parse(e,this._scene,"");return t?(t.onActivateObservable=this.onActivateObservable.clone(),t.onSizeChangedObservable=this.onSizeChangedObservable.clone(),t.onApplyObservable=this.onApplyObservable.clone(),t.onBeforeRenderObservable=this.onBeforeRenderObservable.clone(),t.onAfterRenderObservable=this.onAfterRenderObservable.clone(),t._prePassEffectConfiguration=this._prePassEffectConfiguration,t):null}static Parse(e,t,i){const s=$s(e.customType);if(!s||!s._Parse)return null;const n=t?t.getCameraById(e.cameraId):null;return s._Parse(e,n,t,i)}static _Parse(e,t,i,s){return Se.Parse(()=>new st(e.name,e.fragmentUrl,e.parameters,e.samplers,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable,e.defines,e.textureType,e.vertexUrl,e.indexParameters,!1,e.textureFormat),e,i,s)}}st._CustomShaderCodeProcessing={};F([B()],st.prototype,"uniqueId",void 0);F([B()],st.prototype,"name",void 0);F([B()],st.prototype,"width",void 0);F([B()],st.prototype,"height",void 0);F([B()],st.prototype,"renderTargetSamplingMode",void 0);F([f0()],st.prototype,"clearColor",void 0);F([B()],st.prototype,"autoClear",void 0);F([B()],st.prototype,"forceAutoClearInAlphaMode",void 0);F([B()],st.prototype,"alphaMode",void 0);F([B()],st.prototype,"alphaConstants",void 0);F([B()],st.prototype,"enablePixelPerfectMode",void 0);F([B()],st.prototype,"forceFullscreenViewport",void 0);F([B()],st.prototype,"scaleMode",void 0);F([B()],st.prototype,"alwaysForcePOT",void 0);F([B("samples")],st.prototype,"_samples",void 0);F([B()],st.prototype,"adaptScaleToCurrentViewport",void 0);Vt("BABYLON.PostProcess",st);const Pd="passCubePixelShader",wd="varying vec2 vUV;\nuniform samplerCube textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";te.ShadersStore[Pd]=wd;class er extends st{getClassName(){return"PassPostProcess"}constructor(e,t,i=null,s,n,r,o=0,l=!1){super(e,"pass",null,null,t,i,s,n,r,void 0,o,void 0,null,l)}static _Parse(e,t,i,s){return Se.Parse(()=>new er(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,i,s)}}Vt("BABYLON.PassPostProcess",er);Y._RescalePostProcessFactory=a=>new er("rescale",1,null,2,a,!1,0);function Dd(a,e,t,i,s,n,r,o){const l=e.getEngine();return e.isReady=!1,s=s!=null?s:e.samplingMode,i=i!=null?i:e.type,n=n!=null?n:e.format,r=r!=null?r:e.width,o=o!=null?o:e.height,i===-1&&(i=0),new Promise(h=>{const c=new st("postprocess",a,null,null,1,null,s,l,!1,void 0,i,void 0,null,!1,n);c.externalTextureSamplerBinding=!0;const u=l.createRenderTargetTexture({width:r,height:o},{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:s,type:i,format:n});c.getEffect().executeWhenCompiled(()=>{c.onApply=d=>{d._bindTexture("textureSampler",e),d.setFloat2("scale",1,1)},t.postProcessManager.directRender([c],u,!0),l.restoreDefaultFramebuffer(),l._releaseTexture(e),c&&c.dispose(),u._swapAndDie(e),e.type=i,e.format=5,e.isReady=!0,h(e)})})}function Fd(a){const e=(a&32768)>>15,t=(a&31744)>>10,i=a&1023;return t===0?(e?-1:1)*Math.pow(2,-14)*(i/Math.pow(2,10)):t==31?i?NaN:(e?-1:1)*(1/0):(e?-1:1)*Math.pow(2,t-15)*(1+i/Math.pow(2,10))}class p0{static _IsGPUBuffer(e){return e.underlyingResource===void 0}constructor(e){this._deferredReleaseBuffers=[],this._device=e}createRawBuffer(e,t,i=!1){const s=e.byteLength!==void 0?e.byteLength+3&-4:e+3&-4,n={mappedAtCreation:i,size:s,usage:t};return this._device.createBuffer(n)}createBuffer(e,t){const i=e.byteLength!==void 0,s=this.createRawBuffer(e,t),n=new pd(s);return n.references=1,n.capacity=i?e.byteLength:e,i&&this.setSubData(n,0,e),n}setRawData(e,t,i,s,n){this._device.queue.writeBuffer(e,t,i.buffer,s,n)}setSubData(e,t,i,s=0,n=0){const r=e.underlyingResource;n=n||i.byteLength,n=Math.min(n,e.capacity-t);let o=i.byteOffset+s,l=o+n;const h=n+3&-4;if(h!==n){const d=new Uint8Array(i.buffer.slice(o,l));i=new Uint8Array(h),i.set(d),s=0,o=0,l=h,n=h}const c=1024*1024*15;let u=0;for(;l-(o+u)>c;)this._device.queue.writeBuffer(r,t+u,i.buffer,o+u,c),u+=c;this._device.queue.writeBuffer(r,t+u,i.buffer,o+u,n-u)}_getHalfFloatAsFloatRGBAArrayBuffer(e,t,i){i||(i=new Float32Array(e));const s=new Uint16Array(t);for(;e--;)i[e]=Fd(s[e]);return i}readDataFromBuffer(e,t,i,s,n,r,o=0,l=0,h=null,c=!0,u=!1){const d=o===1?2:o===2?1:0;return new Promise((_,f)=>{e.mapAsync(Xs.Read,l,t).then(()=>{const g=e.getMappedRange(l,t);let p=h;if(u)p===null?p=Fa(o,t,!0,g):p=Fa(o,p.buffer,void 0,g);else if(p===null)switch(d){case 0:p=new Uint8Array(t),p.set(new Uint8Array(g));break;case 1:p=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,g);break;case 2:p=new Float32Array(t/4),p.set(new Float32Array(g));break}else switch(d){case 0:p=new Uint8Array(p.buffer),p.set(new Uint8Array(g));break;case 1:p=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,g,h);break;case 2:p=new Float32Array(p.buffer),p.set(new Float32Array(g));break}if(n!==r){d===1&&!u&&(n*=2,r*=2);const x=new Uint8Array(p.buffer);let m=n,T=0;for(let S=1;Sf(g))})}releaseBuffer(e){return p0._IsGPUBuffer(e)?(this._deferredReleaseBuffers.push(e),!0):(e.references--,e.references===0?(this._deferredReleaseBuffers.push(e.underlyingResource),!0):!1)}destroyDeferredBuffers(){for(let e=0;e1?4:1;return Od[e.samplingMode]+Ld[(e._comparisonFunction||514)-512+1]+Bd[e.samplingMode]+(((t=e._cachedWrapU)!==null&&t!==void 0?t:1)<<8)+(((i=e._cachedWrapV)!==null&&i!==void 0?i:1)<<10)+(((s=e._cachedWrapR)!==null&&s!==void 0?s:1)<<12)+((e.useMipMaps?1:0)<<14)+(n<<15)}static _GetSamplerFilterDescriptor(e,t){let i,s,n,r,o;const l=e.useMipMaps;switch(e.samplingMode){case 11:i=Be.Linear,s=Be.Linear,n=Be.Nearest,l||(r=o=0);break;case 3:case 3:i=Be.Linear,s=Be.Linear,l?n=Be.Linear:(n=Be.Nearest,r=o=0);break;case 8:i=Be.Nearest,s=Be.Nearest,l?n=Be.Linear:(n=Be.Nearest,r=o=0);break;case 4:i=Be.Nearest,s=Be.Nearest,n=Be.Nearest,l||(r=o=0);break;case 5:i=Be.Nearest,s=Be.Linear,n=Be.Nearest,l||(r=o=0);break;case 6:i=Be.Nearest,s=Be.Linear,l?n=Be.Linear:(n=Be.Nearest,r=o=0);break;case 7:i=Be.Nearest,s=Be.Linear,n=Be.Nearest,r=o=0;break;case 1:case 1:i=Be.Nearest,s=Be.Nearest,n=Be.Nearest,r=o=0;break;case 9:i=Be.Linear,s=Be.Nearest,n=Be.Nearest,l||(r=o=0);break;case 10:i=Be.Linear,s=Be.Nearest,l?n=Be.Linear:(n=Be.Nearest,r=o=0);break;case 2:case 2:i=Be.Linear,s=Be.Linear,n=Be.Nearest,r=o=0;break;case 12:i=Be.Linear,s=Be.Nearest,n=Be.Nearest,r=o=0;break;default:i=Be.Nearest,s=Be.Nearest,n=Be.Nearest,r=o=0;break}return t>1&&(r!==0||o!==0)?{magFilter:Be.Linear,minFilter:Be.Linear,mipmapFilter:Be.Linear,anisotropyEnabled:!0}:{magFilter:i,minFilter:s,mipmapFilter:n,lodMinClamp:r,lodMaxClamp:o}}static _GetWrappingMode(e){switch(e){case 1:return hn.Repeat;case 0:return hn.ClampToEdge;case 2:return hn.MirrorRepeat}return hn.Repeat}static _GetSamplerWrappingDescriptor(e){return{addressModeU:this._GetWrappingMode(e._cachedWrapU),addressModeV:this._GetWrappingMode(e._cachedWrapV),addressModeW:this._GetWrappingMode(e._cachedWrapR)}}static _GetSamplerDescriptor(e){const t=e.useMipMaps&&e._cachedAnisotropicFilteringLevel&&e._cachedAnisotropicFilteringLevel>1?4:1,i=this._GetSamplerFilterDescriptor(e,t);return{...i,...this._GetSamplerWrappingDescriptor(e),compare:e._comparisonFunction?zs.GetCompareFunction(e._comparisonFunction):void 0,maxAnisotropy:i.anisotropyEnabled?t:1}}static GetCompareFunction(e){switch(e){case 519:return It.Always;case 514:return It.Equal;case 516:return It.Greater;case 518:return It.GreaterEqual;case 513:return It.Less;case 515:return It.LessEqual;case 512:return It.Never;case 517:return It.NotEqual;default:return It.Less}}getSampler(e,t=!1,i=0){if(this.disabled)return this._device.createSampler(zs._GetSamplerDescriptor(e));t?i=0:i===0&&(i=zs.GetSamplerHashCode(e));let s=t?void 0:this._samplers[i];return s||(s=this._device.createSampler(zs._GetSamplerDescriptor(e)),t||(this._samplers[i]=s)),s}}var gt;(function(a){a[a.StencilReadMask=0]="StencilReadMask",a[a.StencilWriteMask=1]="StencilWriteMask",a[a.DepthBias=2]="DepthBias",a[a.DepthBiasSlopeScale=3]="DepthBiasSlopeScale",a[a.DepthStencilState=4]="DepthStencilState",a[a.MRTAttachments1=5]="MRTAttachments1",a[a.MRTAttachments2=6]="MRTAttachments2",a[a.RasterizationState=7]="RasterizationState",a[a.ColorStates=8]="ColorStates",a[a.ShaderStage=9]="ShaderStage",a[a.TextureStage=10]="TextureStage",a[a.VertexState=11]="VertexState",a[a.NumStates=12]="NumStates"})(gt||(gt={}));const fr={0:1,1:2,768:3,769:4,770:5,771:6,772:7,773:8,774:9,775:10,776:11,32769:12,32770:13,32771:12,32772:13},sn={0:0,7680:1,7681:2,7682:3,7683:4,5386:5,34055:6,34056:7};class ct{constructor(e,t,i){this.mrtTextureCount=0,this._device=e,this._useTextureStage=i,this._states=new Array(30),this._statesLength=0,this._stateDirtyLowestIndex=0,this._emptyVertexBuffer=t,this._mrtFormats=[],this._parameter={token:void 0,pipeline:null},this.disabled=!1,this.vertexBuffers=[],this._kMaxVertexBufferStride=e.limits.maxVertexBufferArrayStride||2048,this.reset()}reset(){this._isDirty=!0,this.vertexBuffers.length=0,this.setAlphaToCoverage(!1),this.resetDepthCullingState(),this.setClampDepth(!1),this.setDepthBias(0),this._webgpuColorFormat=[I.BGRA8Unorm],this.setColorFormat(I.BGRA8Unorm),this.setMRT([]),this.setAlphaBlendEnabled(!1),this.setAlphaBlendFactors([null,null,null,null],[null,null]),this.setWriteMask(15),this.setDepthStencilFormat(I.Depth24PlusStencil8),this.setStencilEnabled(!1),this.resetStencilState(),this.setBuffers(null,null,null),this._setTextureState(0)}get colorFormats(){return this._mrtAttachments1>0?this._mrtFormats:this._webgpuColorFormat}getRenderPipeline(e,t,i,s=0){if(i>1&&(i=4),this.disabled){const r=ct._GetTopology(e);return this._setVertexState(t),this._parameter.pipeline=this._createRenderPipeline(t,r,i),ct.NumCacheMiss++,ct._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}if(this._setShaderStage(t.uniqueId),this._setRasterizationState(e,i),this._setColorStates(),this._setDepthStencilState(),this._setVertexState(t),this._setTextureState(s),this.lastStateDirtyLowestIndex=this._stateDirtyLowestIndex,!this._isDirty&&this._parameter.pipeline)return this._stateDirtyLowestIndex=this._statesLength,ct.NumCacheHitWithoutHash++,this._parameter.pipeline;if(this._getRenderPipeline(this._parameter),this._isDirty=!1,this._stateDirtyLowestIndex=this._statesLength,this._parameter.pipeline)return ct.NumCacheHitWithHash++,this._parameter.pipeline;const n=ct._GetTopology(e);return this._parameter.pipeline=this._createRenderPipeline(t,n,i),this._setRenderPipeline(this._parameter),ct.NumCacheMiss++,ct._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}endFrame(){ct.NumPipelineCreationLastFrame=ct._NumPipelineCreationCurrentFrame,ct._NumPipelineCreationCurrentFrame=0}setAlphaToCoverage(e){this._alphaToCoverageEnabled=e}setFrontFace(e){this._frontFace=e}setCullEnabled(e){this._cullEnabled=e}setCullFace(e){this._cullFace=e}setClampDepth(e){this._clampDepth=e}resetDepthCullingState(){this.setDepthCullingState(!1,2,1,0,0,!0,!0,519)}setDepthCullingState(e,t,i,s,n,r,o,l){this._depthWriteEnabled=o,this._depthTestEnabled=r,this._depthCompare=(l!=null?l:519)-512,this._cullFace=i,this._cullEnabled=e,this._frontFace=t,this.setDepthBiasSlopeScale(s),this.setDepthBias(n)}setDepthBias(e){this._depthBias!==e&&(this._depthBias=e,this._states[gt.DepthBias]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.DepthBias))}setDepthBiasSlopeScale(e){this._depthBiasSlopeScale!==e&&(this._depthBiasSlopeScale=e,this._states[gt.DepthBiasSlopeScale]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.DepthBiasSlopeScale))}setColorFormat(e){this._webgpuColorFormat[0]=e,this._colorFormat=Ln[e!=null?e:""]}setMRTAttachments(e){this.mrtAttachments=e;let t=0;for(let i=0;i10)throw"Can't handle more than 10 attachments for a MRT in cache render pipeline!";this.mrtTextureArray=e,this.mrtTextureCount=t,this._mrtEnabledMask=65535;const n=[0,0];let r=0,o=0,l=0;for(let h=0;h=32&&(o=0,r++)}this._mrtFormats.length=l,(this._mrtAttachments1!==n[0]||this._mrtAttachments2!==n[1])&&(this._mrtAttachments1=n[0],this._mrtAttachments2=n[1],this._states[gt.MRTAttachments1]=n[0],this._states[gt.MRTAttachments2]=n[1],this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.MRTAttachments1))}setAlphaBlendEnabled(e){this._alphaBlendEnabled=e}setAlphaBlendFactors(e,t){this._alphaBlendFuncParams=e,this._alphaBlendEqParams=t}setWriteMask(e){this._writeMask=e}setDepthStencilFormat(e){this._webgpuDepthStencilFormat=e,this._depthStencilFormat=e===void 0?0:Ln[e]}setDepthTestEnabled(e){this._depthTestEnabled=e}setDepthWriteEnabled(e){this._depthWriteEnabled=e}setDepthCompare(e){this._depthCompare=(e!=null?e:519)-512}setStencilEnabled(e){this._stencilEnabled=e}setStencilCompare(e){this._stencilFrontCompare=(e!=null?e:519)-512}setStencilDepthFailOp(e){this._stencilFrontDepthFailOp=e===null?1:sn[e]}setStencilPassOp(e){this._stencilFrontPassOp=e===null?2:sn[e]}setStencilFailOp(e){this._stencilFrontFailOp=e===null?1:sn[e]}setStencilReadMask(e){this._stencilReadMask!==e&&(this._stencilReadMask=e,this._states[gt.StencilReadMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.StencilReadMask))}setStencilWriteMask(e){this._stencilWriteMask!==e&&(this._stencilWriteMask=e,this._states[gt.StencilWriteMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.StencilWriteMask))}resetStencilState(){this.setStencilState(!1,519,7680,7681,7680,255,255)}setStencilState(e,t,i,s,n,r,o){this._stencilEnabled=e,this._stencilFrontCompare=(t!=null?t:519)-512,this._stencilFrontDepthFailOp=i===null?1:sn[i],this._stencilFrontPassOp=s===null?2:sn[s],this._stencilFrontFailOp=n===null?1:sn[n],this.setStencilReadMask(r),this.setStencilWriteMask(o)}setBuffers(e,t,i){this._vertexBuffers=e,this._overrideVertexBuffers=i,this._indexBuffer=t}static _GetTopology(e){switch(e){case 0:return _i.TriangleList;case 2:return _i.PointList;case 1:return _i.LineList;case 3:return _i.PointList;case 4:return _i.LineList;case 5:throw"LineLoop is an unsupported fillmode in WebGPU";case 6:return _i.LineStrip;case 7:return _i.TriangleStrip;case 8:throw"TriangleFan is an unsupported fillmode in WebGPU";default:return _i.TriangleList}}static _GetAphaBlendOperation(e){switch(e){case 32774:return Es.Add;case 32778:return Es.Subtract;case 32779:return Es.ReverseSubtract;case 32775:return Es.Min;case 32776:return Es.Max;default:return Es.Add}}static _GetAphaBlendFactor(e){switch(e){case 0:return Xt.Zero;case 1:return Xt.One;case 768:return Xt.Src;case 769:return Xt.OneMinusSrc;case 770:return Xt.SrcAlpha;case 771:return Xt.OneMinusSrcAlpha;case 772:return Xt.DstAlpha;case 773:return Xt.OneMinusDstAlpha;case 774:return Xt.Dst;case 775:return Xt.OneMinusDst;case 776:return Xt.SrcAlphaSaturated;case 32769:return Xt.Constant;case 32770:return Xt.OneMinusConstant;case 32771:return Xt.Constant;case 32772:return Xt.OneMinusConstant;default:return Xt.One}}static _GetCompareFunction(e){switch(e){case 0:return It.Never;case 1:return It.Less;case 2:return It.Equal;case 3:return It.LessEqual;case 4:return It.Greater;case 5:return It.NotEqual;case 6:return It.GreaterEqual;case 7:return It.Always}return It.Never}static _GetStencilOpFunction(e){switch(e){case 0:return Li.Zero;case 1:return Li.Keep;case 2:return Li.Replace;case 3:return Li.IncrementClamp;case 4:return Li.DecrementClamp;case 5:return Li.Invert;case 6:return Li.IncrementWrap;case 7:return Li.DecrementWrap}return Li.Keep}static _GetVertexInputDescriptorFormat(e){const t=e.type,i=e.normalized,s=e.getSize();switch(t){case A.BYTE:switch(s){case 1:case 2:return i?ht.Snorm8x2:ht.Sint8x2;case 3:case 4:return i?ht.Snorm8x4:ht.Sint8x4}break;case A.UNSIGNED_BYTE:switch(s){case 1:case 2:return i?ht.Unorm8x2:ht.Uint8x2;case 3:case 4:return i?ht.Unorm8x4:ht.Uint8x4}break;case A.SHORT:switch(s){case 1:case 2:return i?ht.Snorm16x2:ht.Sint16x2;case 3:case 4:return i?ht.Snorm16x4:ht.Sint16x4}break;case A.UNSIGNED_SHORT:switch(s){case 1:case 2:return i?ht.Unorm16x2:ht.Uint16x2;case 3:case 4:return i?ht.Unorm16x4:ht.Uint16x4}break;case A.INT:switch(s){case 1:return ht.Sint32;case 2:return ht.Sint32x2;case 3:return ht.Sint32x3;case 4:return ht.Sint32x4}break;case A.UNSIGNED_INT:switch(s){case 1:return ht.Uint32;case 2:return ht.Uint32x2;case 3:return ht.Uint32x3;case 4:return ht.Uint32x4}break;case A.FLOAT:switch(s){case 1:return ht.Float32;case 2:return ht.Float32x2;case 3:return ht.Float32x3;case 4:return ht.Float32x4}break}throw new Error("Invalid Format '".concat(e.getKind(),"' - type=").concat(t,", normalized=").concat(i,", size=").concat(s))}_getAphaBlendState(){return this._alphaBlendEnabled?{srcFactor:ct._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),dstFactor:ct._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),operation:ct._GetAphaBlendOperation(this._alphaBlendEqParams[1])}:null}_getColorBlendState(){return this._alphaBlendEnabled?{srcFactor:ct._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),dstFactor:ct._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),operation:ct._GetAphaBlendOperation(this._alphaBlendEqParams[0])}:null}_setShaderStage(e){this._shaderId!==e&&(this._shaderId=e,this._states[gt.ShaderStage]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.ShaderStage))}_setRasterizationState(e,t){const i=this._frontFace,s=this._cullEnabled?this._cullFace:0,n=this._clampDepth?1:0,r=this._alphaToCoverageEnabled?1:0,o=i-1+(s<<1)+(n<<3)+(r<<4)+(e<<5)+(t<<8);this._rasterizationState!==o&&(this._rasterizationState=o,this._states[gt.RasterizationState]=this._rasterizationState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.RasterizationState))}_setColorStates(){let e=((this._writeMask?1:0)<<22)+(this._colorFormat<<23)+((this._depthWriteEnabled?1:0)<<29);this._alphaBlendEnabled&&(e+=((this._alphaBlendFuncParams[0]===null?2:fr[this._alphaBlendFuncParams[0]])<<0)+((this._alphaBlendFuncParams[1]===null?2:fr[this._alphaBlendFuncParams[1]])<<4)+((this._alphaBlendFuncParams[2]===null?2:fr[this._alphaBlendFuncParams[2]])<<8)+((this._alphaBlendFuncParams[3]===null?2:fr[this._alphaBlendFuncParams[3]])<<12)+((this._alphaBlendEqParams[0]===null?1:this._alphaBlendEqParams[0]-32773)<<16)+((this._alphaBlendEqParams[1]===null?1:this._alphaBlendEqParams[1]-32773)<<19)),e!==this._colorStates&&(this._colorStates=e,this._states[gt.ColorStates]=this._colorStates,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.ColorStates))}_setDepthStencilState(){const e=this._stencilEnabled?this._stencilFrontCompare+(this._stencilFrontDepthFailOp<<3)+(this._stencilFrontPassOp<<6)+(this._stencilFrontFailOp<<9):591,t=this._depthStencilFormat+((this._depthTestEnabled?this._depthCompare:7)<<6)+(e<<10);this._depthStencilState!==t&&(this._depthStencilState=t,this._states[gt.DepthStencilState]=this._depthStencilState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,gt.DepthStencilState))}_setVertexState(e){var t,i;const s=this._statesLength;let n=gt.VertexState;const r=e._pipelineContext,o=r.shaderProcessingContext.attributeNamesFromEffect,l=r.shaderProcessingContext.attributeLocationsFromEffect;let h,c=0;for(let u=0;u0)for(let p=0;p=this._video.HAVE_CURRENT_DATA}dispose(){}}class Kr{get forceBindGroupCreation(){return this._numExternalTextures>0}get hasFloatTextures(){return this._numFloatTextures>0}constructor(){this.uniqueId=Kr._Counter++,this.updateId=0,this.reset()}reset(){this.samplers={},this.textures={},this.isDirty=!0,this._numFloatTextures=0,this._numExternalTextures=0}setSampler(e,t){let i=this.samplers[e],s=-1;i?s=i.hashCode:this.samplers[e]=i={sampler:t,hashCode:0},i.sampler=t,i.hashCode=t?zs.GetSamplerHashCode(t):0;const n=s!==i.hashCode;n&&this.updateId++,this.isDirty||(this.isDirty=n)}setTexture(e,t){var i,s,n;let r=this.textures[e],o=-1;r?o=(s=(i=r.texture)===null||i===void 0?void 0:i.uniqueId)!==null&&s!==void 0?s:-1:this.textures[e]=r={texture:t,isFloatTexture:!1,isExternalTexture:!1},r.isExternalTexture&&this._numExternalTextures--,r.isFloatTexture&&this._numFloatTextures--,t?(r.isFloatTexture=t.type===1,r.isExternalTexture=wl.IsExternalTexture(t),r.isFloatTexture&&this._numFloatTextures++,r.isExternalTexture&&this._numExternalTextures++):(r.isFloatTexture=!1,r.isExternalTexture=!1),r.texture=t;const l=o!==((n=t==null?void 0:t.uniqueId)!==null&&n!==void 0?n:-1);l&&this.updateId++,this.isDirty||(this.isDirty=l)}}Kr._Counter=0;class Yr{isDirty(e){return this._isDirty||this._materialContextUpdateId!==e}resetIsDirty(e){this._isDirty=!1,this._materialContextUpdateId=e}get useInstancing(){return this._useInstancing}set useInstancing(e){this._useInstancing!==e&&(e?(this.indirectDrawBuffer=this._bufferManager.createRawBuffer(40,Je.CopyDst|Je.Indirect),this._indirectDrawData=new Uint32Array(5),this._indirectDrawData[3]=0,this._indirectDrawData[4]=0):(this.indirectDrawBuffer&&this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this._useInstancing=e,this._currentInstanceCount=-1)}constructor(e){this._bufferManager=e,this.uniqueId=Yr._Counter++,this._useInstancing=!1,this._currentInstanceCount=0,this.reset()}reset(){this.buffers={},this._isDirty=!0,this._materialContextUpdateId=0,this.fastBundle=void 0,this.bindGroups=void 0}setBuffer(e,t){var i;this._isDirty||(this._isDirty=(t==null?void 0:t.uniqueId)!==((i=this.buffers[e])===null||i===void 0?void 0:i.uniqueId)),this.buffers[e]=t}setIndirectData(e,t,i){t===this._currentInstanceCount||!this.indirectDrawBuffer||!this._indirectDrawData||(this._currentInstanceCount=t,this._indirectDrawData[0]=e,this._indirectDrawData[1]=t,this._indirectDrawData[2]=i,this._bufferManager.setRawData(this.indirectDrawBuffer,0,this._indirectDrawData,0,20))}dispose(){this.indirectDrawBuffer&&(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this.fastBundle=void 0,this.bindGroups=void 0,this.buffers=void 0}}Yr._Counter=0;class yr{constructor(){this.values={}}}class _t{static get Statistics(){return{totalCreated:_t.NumBindGroupsCreatedTotal,lastFrameCreated:_t.NumBindGroupsCreatedLastFrame,lookupLastFrame:_t.NumBindGroupsLookupLastFrame,noLookupLastFrame:_t.NumBindGroupsNoLookupLastFrame}}constructor(e,t,i){this.disabled=!1,this._device=e,this._cacheSampler=t,this._engine=i}endFrame(){_t.NumBindGroupsCreatedLastFrame=_t._NumBindGroupsCreatedCurrentFrame,_t.NumBindGroupsLookupLastFrame=_t._NumBindGroupsLookupCurrentFrame,_t.NumBindGroupsNoLookupLastFrame=_t._NumBindGroupsNoLookupCurrentFrame,_t._NumBindGroupsCreatedCurrentFrame=0,_t._NumBindGroupsLookupCurrentFrame=0,_t._NumBindGroupsNoLookupCurrentFrame=0}getBindGroups(e,t,i){var s,n,r,o,l,h,c,u,d,_;let f,g=_t._Cache;const p=this.disabled||i.forceBindGroupCreation;if(!p){if(!t.isDirty(i.updateId)&&!i.isDirty)return _t._NumBindGroupsNoLookupCurrentFrame++,t.bindGroups;for(const m of e.shaderProcessingContext.bufferNames){const T=(n=(s=t.buffers[m])===null||s===void 0?void 0:s.uniqueId)!==null&&n!==void 0?n:0;let S=g.values[T];S||(S=new yr,g.values[T]=S),g=S}for(const m of e.shaderProcessingContext.samplerNames){const T=(o=(r=i.samplers[m])===null||r===void 0?void 0:r.hashCode)!==null&&o!==void 0?o:0;let S=g.values[T];S||(S=new yr,g.values[T]=S),g=S}for(const m of e.shaderProcessingContext.textureNames){const T=(c=(h=(l=i.textures[m])===null||l===void 0?void 0:l.texture)===null||h===void 0?void 0:h.uniqueId)!==null&&c!==void 0?c:0;let S=g.values[T];S||(S=new yr,g.values[T]=S),g=S}f=g.bindGroups}if(t.resetIsDirty(i.updateId),i.isDirty=!1,f)return t.bindGroups=f,_t._NumBindGroupsLookupCurrentFrame++,f;f=[],t.bindGroups=f,p||(g.bindGroups=f),_t.NumBindGroupsCreatedTotal++,_t._NumBindGroupsCreatedCurrentFrame++;const x=e.bindGroupLayouts;for(let m=0;m":W),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}S[y].resource=this._cacheSampler.getSampler(w,!1,R.hashCode)}else H.Error('Sampler "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(E),", materialContext=").concat(JSON.stringify(i,(w,D)=>w==="texture"||w==="sampler"?"":D)),50)}else if(E.texture||E.storageTexture){const R=i.textures[C];if(R){if(this._engine.dbgSanityChecks&&R.texture===null){H.Error("Trying to bind a null texture! entry=".concat(JSON.stringify(E),", bindingInfo=").concat(JSON.stringify(R,(D,W)=>D==="texture"?"":W),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=R.texture._hardwareTexture;if(this._engine.dbgSanityChecks&&(!w||E.texture&&!w.view||E.storageTexture&&!w.viewForWriting)){H.Error("Trying to bind a null gpu texture or view! entry=".concat(JSON.stringify(E),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(R,(D,W)=>D==="texture"?"":W),", isReady=").concat((d=R.texture)===null||d===void 0?void 0:d.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}S[y].resource=E.storageTexture?w.viewForWriting:w.view}else H.Error('Texture "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(E),", materialContext=").concat(JSON.stringify(i,(w,D)=>w==="texture"||w==="sampler"?"":D)),50)}else if(E.externalTexture){const R=i.textures[C];if(R){if(this._engine.dbgSanityChecks&&R.texture===null){H.Error("Trying to bind a null external texture! entry=".concat(JSON.stringify(E),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(R,(D,W)=>D==="texture"?"":W),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=R.texture.underlyingResource;if(this._engine.dbgSanityChecks&&!w){H.Error("Trying to bind a null gpu external texture! entry=".concat(JSON.stringify(E),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(R,(D,W)=>D==="texture"?"":W),", isReady=").concat((_=R.texture)===null||_===void 0?void 0:_.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}S[y].resource=this._device.importExternalTexture({source:w})}else H.Error('Texture "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(E),", materialContext=").concat(JSON.stringify(i,(w,D)=>w==="texture"||w==="sampler"?"":D)),50)}else if(E.buffer){const R=t.buffers[C];if(R){const w=R.underlyingResource;S[y].resource.buffer=w,S[y].resource.size=R.capacity}else H.Error("Can't find buffer \"".concat(C,'". entry=').concat(JSON.stringify(E),", buffers=").concat(JSON.stringify(t.buffers),", drawContext.uniqueId=").concat(t.uniqueId),50)}}const b=x[m];f[m]=this._device.createBindGroup({layout:b,entries:S})}return f}}_t.NumBindGroupsCreatedTotal=0;_t.NumBindGroupsCreatedLastFrame=0;_t.NumBindGroupsLookupLastFrame=0;_t.NumBindGroupsNoLookupLastFrame=0;_t._Cache=new yr;_t._NumBindGroupsCreatedCurrentFrame=0;_t._NumBindGroupsLookupCurrentFrame=0;_t._NumBindGroupsNoLookupCurrentFrame=0;const kd="clearQuadVertexShader",Vd="uniform float depthValue;\nconst vec2 pos[4]={\nvec2(-1.0,1.0),\nvec2(1.0,1.0),\nvec2(-1.0,-1.0),\nvec2(1.0,-1.0)\n};\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=vec4(pos[gl_VertexID],depthValue,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";te.ShadersStore[kd]=Vd;const Gd="clearQuadPixelShader",Wd="uniform vec4 color;\nvoid main() {\ngl_FragColor=color;\n}\n";te.ShadersStore[Gd]=Wd;class zd{setDepthStencilFormat(e){this._depthTextureFormat=e,this._cacheRenderPipeline.setDepthStencilFormat(e)}setColorFormat(e){this._cacheRenderPipeline.setColorFormat(e)}setMRTAttachments(e,t,i){this._cacheRenderPipeline.setMRT(t,i),this._cacheRenderPipeline.setMRTAttachments(e)}constructor(e,t,i){this._bindGroups={},this._bundleCache={},this._keyTemp=[],this._device=e,this._engine=t,this._cacheRenderPipeline=new as(this._device,i,!t._caps.textureFloatLinearFiltering),this._cacheRenderPipeline.setDepthTestEnabled(!1),this._cacheRenderPipeline.setStencilReadMask(255),this._effect=t.createEffect("clearQuad",[],["color","depthValue"])}clear(e,t,i,s,n=1){var r,o;let l,h=null,c;const u=!!this._engine._currentRenderTarget;if(e)l=e;else{let m=0;this._keyTemp.length=0;for(let S=0;S1?2**36:0)+T*2**37,c=this._keyTemp.join("_"),h=this._bundleCache[c],h)return h;l=this._device.createRenderBundleEncoder({colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:n})}this._cacheRenderPipeline.setDepthWriteEnabled(!!i),this._cacheRenderPipeline.setStencilEnabled(!!s&&!!this._depthTextureFormat&&Qe.HasStencilAspect(this._depthTextureFormat)),this._cacheRenderPipeline.setStencilWriteMask(s?255:0),this._cacheRenderPipeline.setStencilCompare(s?519:512),this._cacheRenderPipeline.setStencilPassOp(s?7681:7680),this._cacheRenderPipeline.setWriteMask(t?15:0);const d=this._cacheRenderPipeline.getRenderPipeline(7,this._effect,n),_=this._effect._pipelineContext;t&&this._effect.setDirectColor4("color",t),this._effect.setFloat("depthValue",this._engine.useReverseDepthBuffer?this._engine._clearReverseDepthValue:this._engine._clearDepthValue),_.uniformBuffer.update();const f=u?this._engine._ubInvertY:this._engine._ubDontInvertY,g=_.uniformBuffer.getBuffer(),p=g.uniqueId+"-"+f.uniqueId;let x=this._bindGroups[p];if(!x){const m=_.bindGroupLayouts;x=this._bindGroups[p]=[],x.push(this._device.createBindGroup({layout:m[0],entries:[]})),bi._SimplifiedKnownBindings||x.push(this._device.createBindGroup({layout:m[1],entries:[]})),x.push(this._device.createBindGroup({layout:m[bi._SimplifiedKnownBindings?1:2],entries:[{binding:0,resource:{buffer:f.underlyingResource,size:f.capacity}},{binding:1,resource:{buffer:g.underlyingResource,size:g.capacity}}]}))}l.setPipeline(d);for(let m=0;m{t!==null&&t>=0&&(this._gpuFrameTimeCounter.fetchNewFrame(),this._gpuFrameTimeCounter.addCount(t,!0)),this._measureDurationState=0}))}}class Xd{constructor(e,t){this._querySet=new Dl(2,Rr.Timestamp,e,t)}start(e){e.writeTimestamp(this._querySet.querySet,0)}async stop(e){return e.writeTimestamp(this._querySet.querySet,1),this._querySet.readTwoValuesAndSubtract(0)}dispose(){this._querySet.dispose()}}class Kd{get querySet(){return this._querySet.querySet}get hasQueries(){return this._currentTotalIndices!==this._availableIndices.length}get canBeginQuery(){switch(this._engine._getCurrentRenderPassIndex()){case 0:return this._engine._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet!==void 0;case 1:return this._engine._rttRenderPassWrapper.renderPassDescriptor.occlusionQuerySet!==void 0}return!1}constructor(e,t,i,s=50,n=100){this._availableIndices=[],this._engine=e,this._device=t,this._bufferManager=i,this._frameLastBuffer=-1,this._currentTotalIndices=0,this._countIncrement=n,this._allocateNewIndices(s)}createQuery(){this._availableIndices.length===0&&this._allocateNewIndices();const e=this._availableIndices[this._availableIndices.length-1];return this._availableIndices.length--,e}deleteQuery(e){this._availableIndices[this._availableIndices.length-1]=e}isQueryResultAvailable(e){return this._retrieveQueryBuffer(),!!this._lastBuffer&&e{this._lastBuffer=e}))}_allocateNewIndices(e){e=e!=null?e:this._countIncrement,this._delayQuerySetDispose();for(let t=0;te.dispose,1e3)}dispose(){var e;(e=this._querySet)===null||e===void 0||e.dispose(),this._availableIndices.length=0}}class qr{get code(){return this._sourceCode}constructor(e,t=20){this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}processCode(){this.debug&&console.log("Start inlining process (code size=".concat(this._sourceCode.length,")...")),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&console.log("End of inlining process.")}_collectFunctions(){let e=0;for(;e=0&&_.push(x.substring(m+1))}n!=="void"&&_.push("return"),this._functionDescr.push({name:r,type:n,parameters:_,body:u,callIndex:0}),e=c+1;const f=t>0?this._sourceCode.substring(0,t):"",g=c+1=0}_replaceFunctionCallsByCode(){let e=!1;for(const t of this._functionDescr){const{name:i,type:s,parameters:n,body:r}=t;let o=0;for(;o{const c=h[0];return xa(e.charAt(c-1))||xa(e.charAt(c+r))?t[s]:o})}return e}}qr._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/;class vi{async initTwgsl(e){if(!vi._twgsl)return e=e||{},e={...vi._TWgslDefaultOptions,...e},e.twgsl?(vi._twgsl=e.twgsl,Promise.resolve()):(e.jsPath&&e.wasmPath&&(Pt()?await re.LoadScriptAsync(e.jsPath):importScripts(e.jsPath)),self.twgsl?(vi._twgsl=await self.twgsl(e.wasmPath),Promise.resolve()):Promise.reject("twgsl is not available."))}convertSpirV2WGSL(e,t=!1){const i=vi._twgsl.convertSpirV2WGSL(e);return vi.ShowWGSLShaderCode&&(console.log(i),console.log("***********************************************")),vi.DisableUniformityAnalysis||t?"diagnostic(off, derivative_uniformity);\n"+i:i}}vi._TWgslDefaultOptions={jsPath:"https://preview.babylonjs.com/twgsl/twgsl.js",wasmPath:"https://preview.babylonjs.com/twgsl/twgsl.wasm"};vi.ShowWGSLShaderCode=!1;vi.DisableUniformityAnalysis=!1;vi._twgsl=null;class Yd{constructor(e,t,i,s){this._record=!1,this._play=!1,this._mainPassBundleList=[],this._enabled=!1,this._engine=e,this._mode=t,this._bundleList=i,this._bundleListRenderTarget=s}get enabled(){return this._enabled}get play(){return this._play}get record(){return this._record}set enabled(e){this._mainPassBundleList.length=0,this._record=this._enabled=e,this._play=!1,e&&(this._modeSaved=this._mode,this._mode=0)}get mode(){return this._mode}set mode(e){this._record?this._modeSaved=e:this._mode=e}endMainRenderPass(){this._record&&this._mainPassBundleList.push(this._bundleList.clone())}endRenderTargetPass(e,t){var i,s,n,r;if(this._play)(s=(i=t._bundleLists)===null||i===void 0?void 0:i[t._currentLayer])===null||s===void 0||s.run(e),this._mode===1&&this._engine._reportDrawCall((r=(n=t._bundleLists)===null||n===void 0?void 0:n[t._currentLayer])===null||r===void 0?void 0:r.numDrawCalls);else if(this._record)t._bundleLists||(t._bundleLists=[]),t._bundleLists[t._currentLayer]=this._bundleListRenderTarget.clone(),t._bundleLists[t._currentLayer].run(e),this._bundleListRenderTarget.reset();else return!1;return!0}endFrame(e){if(this._record&&(this._mainPassBundleList.push(this._bundleList.clone()),this._record=!1,this._play=!0,this._mode=this._modeSaved),e!==null&&this._play)for(let t=0;t!!e,()=>!1).catch(()=>!1):Promise.resolve(!1)}static get IsSupported(){return H.Warn("You must call IsSupportedAsync for WebGPU!"),!1}get supportsUniformBuffers(){return!0}get supportedExtensions(){return this._adapterSupportedExtensions}get enabledExtensions(){return this._deviceEnabledExtensions}get supportedLimits(){return this._adapterSupportedLimits}get currentLimits(){return this._deviceLimits}get description(){return this.name+this.version}get version(){return 1}getInfo(){return{vendor:this._adapterInfo.vendor||"unknown vendor",renderer:this._adapterInfo.architecture||"unknown renderer",version:this._adapterInfo.description||"unknown version"}}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=e}get currentSampleCount(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._mainPassSampleCount}static CreateAsync(e,t={}){const i=new pe(e,t);return new Promise(s=>{i.initAsync(t.glslangOptions,t.twgslOptions).then(()=>s(i))})}constructor(e,t={}){var i,s;if(super(null,(i=t.antialias)!==null&&i!==void 0?i:!0,t),this._uploadEncoderDescriptor={label:"upload"},this._renderEncoderDescriptor={label:"render"},this._renderTargetEncoderDescriptor={label:"renderTarget"},this._clearDepthValue=1,this._clearReverseDepthValue=0,this._clearStencilValue=0,this._defaultSampleCount=4,this._glslang=null,this._tintWASM=null,this._adapterInfo={vendor:"",architecture:"",device:"",description:""},this._compiledComputeEffects={},this._counters={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.countersLastFrame={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.numMaxUncapturedErrors=20,this._commandBuffers=[null,null,null],this._currentRenderPass=null,this._mainRenderPassWrapper=new po,this._rttRenderPassWrapper=new po,this._pendingDebugCommands=[],this._onAfterUnbindFrameBufferObservable=new ee,this._currentOverrideVertexBuffers=null,this._currentIndexBuffer=null,this._colorWriteLocal=!0,this._forceEnableEffect=!1,this.dbgShowShaderCode=!1,this.dbgSanityChecks=!0,this.dbgVerboseLogsForFirstFrames=!1,this.dbgVerboseLogsNumFrames=10,this.dbgLogIfNotDrawWrapper=!0,this.dbgShowEmptyEnableEffectCalls=!0,this.isNDCHalfZRange=!0,this.hasOriginBottomLeft=!1,this._viewportsCurrent=[{x:0,y:0,w:0,h:0},{x:0,y:0,w:0,h:0}],this._scissorsCurrent=[{x:0,y:0,w:0,h:0},{x:0,y:0,w:0,h:0}],this._scissorCached={x:0,y:0,z:0,w:0},this._stencilRefsCurrent=[-1,-1],this._blendColorsCurrent=[[null,null,null,null],[null,null,null,null]],this._name="WebGPU",t.deviceDescriptor=t.deviceDescriptor||{},t.enableGPUDebugMarkers=(s=t.enableGPUDebugMarkers)!==null&&s!==void 0?s:!1,H.Log("Babylon.js v".concat(Y.Version," - ").concat(this.description," engine")),!navigator.gpu){H.Error("WebGPU is not supported by your browser.");return}t.swapChainFormat=t.swapChainFormat||navigator.gpu.getPreferredCanvasFormat(),this._isWebGPU=!0,this._shaderPlatformName="WEBGPU",this._renderingCanvas=e,this._options=t,this._mainPassSampleCount=t.antialias?this._defaultSampleCount:1,this._setupMobileChecks(),this._sharedInit(e),this._shaderProcessor=new bu,this._shaderProcessorWGSL=new nd}initAsync(e,t){var i;return this._initGlslang(e!=null?e:(i=this._options)===null||i===void 0?void 0:i.glslangOptions).then(s=>{var n;return this._glslang=s,this._tintWASM=pe.UseTWGSL?new vi:null,this._tintWASM?this._tintWASM.initTwgsl(t!=null?t:(n=this._options)===null||n===void 0?void 0:n.twgslOptions).then(()=>navigator.gpu.requestAdapter(this._options),r=>{throw H.Error("Can not initialize twgsl!"),H.Error(r),Error("WebGPU initializations stopped.")}):navigator.gpu.requestAdapter(this._options)},s=>{throw H.Error("Can not initialize glslang!"),H.Error(s),Error("WebGPU initializations stopped.")}).then(s=>{var n,r,o;if(s){this._adapter=s,this._adapterSupportedExtensions=[],(n=this._adapter.features)===null||n===void 0||n.forEach(c=>this._adapterSupportedExtensions.push(c)),this._adapterSupportedLimits=this._adapter.limits,this._adapter.requestAdapterInfo().then(c=>{this._adapterInfo=c});const l=(r=this._options.deviceDescriptor)!==null&&r!==void 0?r:{},h=(o=l==null?void 0:l.requiredFeatures)!==null&&o!==void 0?o:this._options.enableAllFeatures?this._adapterSupportedExtensions:void 0;if(h){const c=h,u=[];for(const d of c)this._adapterSupportedExtensions.indexOf(d)!==-1&&u.push(d);l.requiredFeatures=u}if(this._options.setMaximumLimits&&!l.requiredLimits){l.requiredLimits={};for(const c in this._adapterSupportedLimits)l.requiredLimits[c]=this._adapterSupportedLimits[c]}return this._adapter.requestDevice(l)}else throw"Could not retrieve a WebGPU adapter (adapter is null)."}).then(s=>{var n,r;this._device=s,this._deviceEnabledExtensions=[],(n=this._device.features)===null||n===void 0||n.forEach(l=>this._deviceEnabledExtensions.push(l)),this._deviceLimits=s.limits;let o=-1;this._device.addEventListener("uncapturederror",l=>{++o{this._isDisposed||(this._contextWasLost=!0,H.Warn("WebGPU context lost. "+l),this.onContextLostObservable.notifyObservers(this),this._restoreEngineAfterContextLost(this.initAsync.bind(this)))})},s=>{H.Error("Could not retrieve a WebGPU device."),H.Error(s)}).then(()=>{this._bufferManager=new p0(this._device),this._textureHelper=new Qe(this._device,this._glslang,this._tintWASM,this._bufferManager),this._cacheSampler=new zs(this._device),this._cacheBindGroups=new _t(this._device,this._cacheSampler,this),this._timestampQuery=new Hd(this._device,this._bufferManager),this._occlusionQuery=this._device.createQuerySet?new Kd(this,this._device,this._bufferManager):void 0,this._bundleList=new Fr(this._device),this._bundleListRenderTarget=new Fr(this._device),this._snapshotRendering=new Yd(this,this._snapshotRenderingMode,this._bundleList,this._bundleListRenderTarget),this._ubInvertY=this._bufferManager.createBuffer(new Float32Array([-1,0]),Je.Uniform|Je.CopyDst),this._ubDontInvertY=this._bufferManager.createBuffer(new Float32Array([1,0]),Je.Uniform|Je.CopyDst),this.dbgVerboseLogsForFirstFrames&&this._count===void 0&&(this._count=0,console.log("%c frame #"+this._count+" - begin","background: #ffff00")),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._renderTargetEncoder=this._device.createCommandEncoder(this._renderTargetEncoderDescriptor),this._emptyVertexBuffer=new A(this,[0],"",!1,!1,1,!1,0,1),this._initializeLimits(),this._cacheRenderPipeline=new as(this._device,this._emptyVertexBuffer,!this._caps.textureFloatLinearFiltering),this._depthCullingState=new Ud(this._cacheRenderPipeline),this._stencilStateComposer=new Nd(this._cacheRenderPipeline),this._stencilStateComposer.stencilGlobal=this._stencilState,this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=515,this._depthCullingState.depthMask=!0,this._textureHelper.setCommandEncoder(this._uploadEncoder),this._clearQuad=new zd(this._device,this,this._emptyVertexBuffer),this._defaultDrawContext=this.createDrawContext(),this._currentDrawContext=this._defaultDrawContext,this._defaultMaterialContext=this.createMaterialContext(),this._currentMaterialContext=this._defaultMaterialContext,this._initializeContextAndSwapChain(),this._initializeMainAttachments(),this.resize()}).catch(s=>{H.Error("Can not create WebGPU Device and/or context."),H.Error(s),console.trace&&console.trace()})}_initGlslang(e){return e=e||{},e={...pe._GLSLslangDefaultOptions,...e},e.glslang?Promise.resolve(e.glslang):self.glslang?self.glslang(e.wasmPath):e.jsPath&&e.wasmPath?Pt()?re.LoadScriptAsync(e.jsPath).then(()=>self.glslang(e.wasmPath)):(importScripts(e.jsPath),self.glslang(e.wasmPath)):Promise.reject("gslang is not available.")}_initializeLimits(){this._caps={maxTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxVertexTextureImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxCombinedTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage*2,maxTextureSize:this._deviceLimits.maxTextureDimension2D,maxCubemapTextureSize:this._deviceLimits.maxTextureDimension2D,maxRenderTextureSize:this._deviceLimits.maxTextureDimension2D,maxVertexAttribs:this._deviceLimits.maxVertexAttributes,maxVaryingVectors:this._deviceLimits.maxInterStageShaderVariables,maxFragmentUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),maxVertexUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),standardDerivatives:!0,astc:this._deviceEnabledExtensions.indexOf(Ss.TextureCompressionASTC)>=0?!0:void 0,s3tc:this._deviceEnabledExtensions.indexOf(Ss.TextureCompressionBC)>=0?!0:void 0,pvrtc:null,etc1:null,etc2:this._deviceEnabledExtensions.indexOf(Ss.TextureCompressionETC2)>=0?!0:void 0,bptc:this._deviceEnabledExtensions.indexOf(Ss.TextureCompressionBC)>=0?!0:void 0,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!0,highPrecisionShaderSupported:!0,colorBufferFloat:!0,textureFloat:!0,textureFloatLinearFiltering:this._deviceEnabledExtensions.indexOf(Ss.Float32Filterable)>=0,textureFloatRender:!0,textureHalfFloat:!0,textureHalfFloatLinearFiltering:!0,textureHalfFloatRender:!0,textureLOD:!0,texelFetch:!0,drawBuffersExtension:!0,depthTextureExtension:!0,vertexArrayObject:!1,instancedArrays:!0,timerQuery:typeof BigUint64Array<"u"&&this._deviceEnabledExtensions.indexOf(Ss.TimestampQuery)!==-1?!0:void 0,supportOcclusionQuery:typeof BigUint64Array<"u",canUseTimestampForTimerQuery:!0,multiview:!1,oculusMultiview:!1,parallelShaderCompile:void 0,blendMinMax:!0,maxMSAASamples:4,canUseGLInstanceID:!0,canUseGLVertexID:!0,supportComputeShaders:!0,supportSRGBBuffers:!0,supportTransformFeedbacks:!1,textureMaxLevel:!0,texture2DArrayMaxLayerCount:this._deviceLimits.maxTextureArrayLayers,disableMorphTargetTexture:!1},this._caps.parallelShaderCompile=null,this._features={forceBitmapOverHTMLImageElement:!0,supportRenderAndCopyToLodForFloatTextures:!0,supportDepthStencilTexture:!0,supportShadowSamplers:!0,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!0,trackUbosInFrame:!0,checkUbosContentBeforeUpload:!0,supportCSM:!0,basisNeedsPOT:!1,support3DTextures:!0,needTypeSuffixInShaderConstants:!0,supportMSAA:!0,supportSSAO2:!0,supportExtendedTextureFormats:!0,supportSwitchCaseInShader:!0,supportSyncTextureRead:!1,needsInvertingBitmap:!1,useUBOBindingCache:!1,needShaderCodeInlining:!0,needToAlwaysBindUniformBuffers:!0,supportRenderPasses:!0,supportSpriteInstancing:!0,_collectUbosUpdatedInFrame:!1}}_initializeContextAndSwapChain(){if(!this._renderingCanvas)throw"The rendering canvas has not been set!";this._context=this._renderingCanvas.getContext("webgpu"),this._configureContext(),this._colorFormat=this._options.swapChainFormat,this._mainRenderPassWrapper.colorAttachmentGPUTextures=[new xr],this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format=this._colorFormat}_initializeMainAttachments(){if(!this._bufferManager)return;this.flushFramebuffer(!1),this._mainTextureExtends={width:this.getRenderWidth(!0),height:this.getRenderHeight(!0),depthOrArrayLayers:1};const e=new Float32Array([this.getRenderHeight(!0)]);this._bufferManager.setSubData(this._ubInvertY,4,e),this._bufferManager.setSubData(this._ubDontInvertY,4,e);let t;if(this._options.antialias){const n={label:"Texture_MainColor_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height,"_antialiasing"),size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:Mi.E2d,format:this._options.swapChainFormat,usage:it.RenderAttachment};this._mainTexture&&this._textureHelper.releaseTexture(this._mainTexture),this._mainTexture=this._device.createTexture(n),t=[{view:this._mainTexture.createView({label:"TextureView_MainColor_antialiasing",dimension:Mi.E2d,format:this._options.swapChainFormat,mipLevelCount:1,arrayLayerCount:1}),clearValue:new q(0,0,0,1),loadOp:bt.Clear,storeOp:mi.Store}]}else t=[{view:void 0,clearValue:new q(0,0,0,1),loadOp:bt.Clear,storeOp:mi.Store}];this._mainRenderPassWrapper.depthTextureFormat=this.isStencilEnable?I.Depth24PlusStencil8:I.Depth32Float,this._setDepthTextureFormat(this._mainRenderPassWrapper);const i={label:"Texture_MainDepthStencil_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height),size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:Mi.E2d,format:this._mainRenderPassWrapper.depthTextureFormat,usage:it.RenderAttachment};this._depthTexture&&this._textureHelper.releaseTexture(this._depthTexture),this._depthTexture=this._device.createTexture(i);const s={view:this._depthTexture.createView({label:"TextureView_MainDepthStencil_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height),dimension:Mi.E2d,format:this._depthTexture.format,mipLevelCount:1,arrayLayerCount:1}),depthClearValue:this._clearDepthValue,depthLoadOp:bt.Clear,depthStoreOp:mi.Store,stencilClearValue:this._clearStencilValue,stencilLoadOp:this.isStencilEnable?bt.Clear:void 0,stencilStoreOp:this.isStencilEnable?mi.Store:void 0};this._mainRenderPassWrapper.renderPassDescriptor={colorAttachments:t,depthStencilAttachment:s}}_configureContext(){this._context.configure({device:this._device,format:this._options.swapChainFormat,usage:it.RenderAttachment|it.CopySrc,alphaMode:this.premultipliedAlpha?Ir.Premultiplied:Ir.Opaque})}setSize(e,t,i=!1){return super.setSize(e,t,i)?(this.dbgVerboseLogsForFirstFrames&&(this._count===void 0&&(this._count=0),(!this._count||this._count=0,n=t.indexOf(_r)>=0,r=i===at.GLSL?this._compileRawShaderToSpirV(e,"vertex"):e,o=i===at.GLSL?this._compileRawShaderToSpirV(t,"fragment"):t;return this._createPipelineStageDescriptor(r,o,i,s,n)}_compilePipelineStageDescriptor(e,t,i,s){this.onBeforeShaderCompilationObservable.notifyObservers(this);const n=e.indexOf(_r)>=0,r=t.indexOf(_r)>=0,o="#version 450\n",l=s===at.GLSL?this._compileShaderToSpirV(e,"vertex",i,o):this._getWGSLShader(e,"vertex",i),h=s===at.GLSL?this._compileShaderToSpirV(t,"fragment",i,o):this._getWGSLShader(t,"fragment",i),c=this._createPipelineStageDescriptor(l,h,s,n,r);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}createRawShaderProgram(){throw"Not available on WebGPU"}createShaderProgram(){throw"Not available on WebGPU"}inlineShaderCode(e){const t=new qr(e);return t.debug=!1,t.processCode(),t.code}createPipelineContext(e){return new mu(e,this)}createMaterialContext(){return new Kr}createDrawContext(){return new Yr(this._bufferManager)}_preparePipelineContext(e,t,i,s,n,r,o,l){const h=e,c=h.shaderProcessingContext.shaderLanguage;this.dbgShowShaderCode&&(console.log(l),console.log(t),console.log(i),console.log("***********************************************")),h.sources={fragment:i,vertex:t,rawVertex:n,rawFragment:r},s?h.stages=this._compileRawPipelineStageDescriptor(t,i,c):h.stages=this._compilePipelineStageDescriptor(t,i,l,c)}getAttributes(e,t){const i=new Array(t.length),s=e;for(let n=0;n0,h._cachedWrapU=0,h._cachedWrapV=0,h._useSRGBBuffer=l.useSRGBBuffer,h.label=l.label,this._internalTexturesCache.push(h),i||this._textureHelper.createGPUTextureForInternalTexture(h,c,u,d||1,l.creationFlags),h}createTexture(e,t,i,s,n=3,r=null,o=null,l=null,h=null,c=null,u=null,d,_,f,g){return this._createTextureBase(e,t,i,s,n,r,o,(p,x,m,T,S,b,y,E)=>{var P;const C=T;if(p.baseWidth=C.width,p.baseHeight=C.height,p.width=C.width,p.height=C.height,p.format=c!=null?c:-1,E(p.width,p.height,C,x,p,()=>{}),!((P=p._hardwareTexture)===null||P===void 0)&&P.underlyingResource)!b&&!y&&this._generateMipmaps(p,this._uploadEncoder);else{const R=this._textureHelper.createGPUTextureForInternalTexture(p,C.width,C.height,void 0,f);Qe.IsImageBitmap(C)&&(this._textureHelper.updateTexture(C,p,C.width,C.height,p.depth,R.format,0,0,S,!1,0,0),!b&&!y&&this._generateMipmaps(p,this._uploadEncoder))}m&&m.removePendingData(p),p.isReady=!0,p.onLoadedObservable.notifyObservers(p),p.onLoadedObservable.clear()},()=>!1,l,h,c,u,d,_,g)}wrapWebGPUTexture(e){const t=new xr(e),i=new Dt(this,ze.Unknown,!0);return i._hardwareTexture=t,i.isReady=!0,i}wrapWebGLTexture(){throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.")}generateMipMapsForCubemap(e){var t;e.generateMipMaps&&(!((t=e._hardwareTexture)===null||t===void 0)&&t.underlyingResource||this._textureHelper.createGPUTextureForInternalTexture(e),this._generateMipmaps(e,e.source===ze.RenderTarget||e.source===ze.MultiRenderTarget?this._renderTargetEncoder:void 0))}updateTextureSamplingMode(e,t,i=!1){i&&(t.generateMipMaps=!0,this._generateMipmaps(t)),t.samplingMode=e}updateTextureWrappingMode(e,t,i=null,s=null){t!==null&&(e._cachedWrapU=t),i!==null&&(e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(e._cachedWrapR=s)}updateTextureDimensions(e,t,i,s=1){if(!e._hardwareTexture||e.width===t&&e.height===i&&e.depth===s)return;const n=e._hardwareTexture.textureAdditionalUsages;e._hardwareTexture.release(),this._textureHelper.createGPUTextureForInternalTexture(e,t,i,s,n)}_setInternalTexture(e,t,i){if(i=i!=null?i:e,this._currentEffect){const n=this._currentEffect._pipelineContext.shaderProcessingContext.availableTextures[i];if(this._currentMaterialContext.setTexture(e,t),n&&n.autoBindSampler){const r=i+rt.AutoSamplerSuffix;this._currentMaterialContext.setSampler(r,t)}}}setTexture(e,t,i,s){this._setTexture(e,i,!1,!1,s,s)}setTextureArray(e,t,i,s){for(let n=0;nthis.add(t,i))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let i=this.get(e);return i!==void 0||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){const i=this.get(e);return i!==void 0?i:(this.add(e,t),t)}contains(e){return this._data[e]!==void 0}add(e,t){return this._data[e]!==void 0?!1:(this._data[e]=t,++this._count,!0)}set(e,t){return this._data[e]===void 0?!1:(this._data[e]=t,!0)}getAndRemove(e){const t=this.get(e);return t!==void 0?(delete this._data[e],--this._count,t):null}remove(e){return this.contains(e)?(delete this._data[e],--this._count,!0):!1}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(const t in this._data){const i=this._data[t];e(t,i)}}first(e){for(const t in this._data){const i=this._data[t],s=e(t,i);if(s)return s}return null}}class ps{constructor(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}static AddParser(e,t){this._BabylonFileParsers[e]=t}static GetParser(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null}static AddIndividualParser(e,t){this._IndividualBabylonFileParsers[e]=t}static GetIndividualParser(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null}static Parse(e,t,i,s){for(const n in this._BabylonFileParsers)Object.prototype.hasOwnProperty.call(this._BabylonFileParsers,n)&&this._BabylonFileParsers[n](e,t,i,s)}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture=e}getNodes(){let e=new Array;return e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes),this.skeletons.forEach(t=>e=e.concat(t.bones)),e}}ps._BabylonFileParsers={};ps._IndividualBabylonFileParsers={};class y0{constructor(e){if(this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){return this._isDirty}markAsProcessed(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){this._isDirty=!0}markAllAsDirty(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){this._keys.length=0;for(const e of Object.keys(this))e[0]!=="_"&&this._keys.push(e);if(this._externalProperties)for(const e in this._externalProperties)this._keys.indexOf(e)===-1&&this._keys.push(e)}isEqual(e){if(this._keys.length!==e._keys.length)return!1;for(let t=0;tthis._setDefaultValue(e))}_setDefaultValue(e){var t,i,s,n,r;const o=(s=(i=(t=this._externalProperties)===null||t===void 0?void 0:t[e])===null||i===void 0?void 0:i.type)!==null&&s!==void 0?s:typeof this[e],l=(r=(n=this._externalProperties)===null||n===void 0?void 0:n[e])===null||r===void 0?void 0:r.default;switch(o){case"number":this[e]=l!=null?l:0;break;case"string":this[e]=l!=null?l:"";break;default:this[e]=l!=null?l:!1;break}}toString(){let e="";for(let t=0;tnew dt,this)}serialize(){return Se.Serialize(this)}static Parse(e){return Se.Parse(()=>new dt,e,null,null)}}F([B()],dt.prototype,"_globalHue",void 0);F([B()],dt.prototype,"_globalDensity",void 0);F([B()],dt.prototype,"_globalSaturation",void 0);F([B()],dt.prototype,"_globalExposure",void 0);F([B()],dt.prototype,"_highlightsHue",void 0);F([B()],dt.prototype,"_highlightsDensity",void 0);F([B()],dt.prototype,"_highlightsSaturation",void 0);F([B()],dt.prototype,"_highlightsExposure",void 0);F([B()],dt.prototype,"_midtonesHue",void 0);F([B()],dt.prototype,"_midtonesDensity",void 0);F([B()],dt.prototype,"_midtonesSaturation",void 0);F([B()],dt.prototype,"_midtonesExposure",void 0);Se._ColorCurvesParser=dt.Parse;class He{constructor(){this.colorCurves=new dt,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=He.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCenterX=0,this.vignetteCenterY=0,this.vignetteWeight=1.5,this.vignetteColor=new q(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=He.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._ditheringEnabled=!1,this._ditheringIntensity=1/255,this._skipFinalColorClamp=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.onUpdateParameters=new ee}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(e){this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())}get exposure(){return this._exposure}set exposure(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())}get contrast(){return this._contrast}set contrast(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(e){this.vignetteCenterY=e}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(e){this.vignetteCenterX=e}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(e){this._ditheringEnabled!==e&&(this._ditheringEnabled=e,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(e){this._ditheringIntensity!==e&&(this._ditheringIntensity=e,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(e){this._skipFinalColorClamp!==e&&(this._skipFinalColorClamp=e,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}static PrepareUniforms(e,t){t.EXPOSURE&&e.push("exposureLinear"),t.CONTRAST&&e.push("contrast"),t.COLORGRADING&&e.push("colorTransformSettings"),(t.VIGNETTE||t.DITHER)&&e.push("vInverseScreenSize"),t.VIGNETTE&&(e.push("vignetteSettings1"),e.push("vignetteSettings2")),t.COLORCURVES&&dt.PrepareUniforms(e),t.DITHER&&e.push("ditherIntensity")}static PrepareSamplers(e,t){t.COLORGRADING&&e.push("txColorTransform")}prepareDefines(e,t=!1){if(t!==this.applyByPostProcess||!this._isEnabled){e.VIGNETTE=!1,e.TONEMAPPING=!1,e.TONEMAPPING_ACES=!1,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.DITHER=!1,e.IMAGEPROCESSING=!1,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}switch(e.VIGNETTE=this.vignetteEnabled,e.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===He._VIGNETTEMODE_MULTIPLY,e.VIGNETTEBLENDMODEOPAQUE=!e.VIGNETTEBLENDMODEMULTIPLY,e.TONEMAPPING=this.toneMappingEnabled,this._toneMappingType){case He.TONEMAPPING_ACES:e.TONEMAPPING_ACES=!0;break;default:e.TONEMAPPING_ACES=!1;break}e.CONTRAST=this.contrast!==1,e.EXPOSURE=this.exposure!==1,e.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,e.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,e.COLORGRADING?e.COLORGRADING3D=this.colorGradingTexture.is3D:e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,e.SAMPLER3DBGRMAP=this.colorGradingBGR,e.DITHER=this._ditheringEnabled,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSING=e.VIGNETTE||e.TONEMAPPING||e.CONTRAST||e.EXPOSURE||e.COLORCURVES||e.COLORGRADING||e.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(e,t){if(this._colorCurvesEnabled&&this.colorCurves&&dt.Bind(this.colorCurves,e),this._vignetteEnabled||this._ditheringEnabled){const i=1/e.getEngine().getRenderWidth(),s=1/e.getEngine().getRenderHeight();if(e.setFloat2("vInverseScreenSize",i,s),this._ditheringEnabled&&e.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const n=t!=null?t:s/i;let r=Math.tan(this.vignetteCameraFov*.5),o=r*n;const l=Math.sqrt(o*r);o=re.Mix(o,l,this.vignetteStretch),r=re.Mix(r,l,this.vignetteStretch),e.setFloat4("vignetteSettings1",o,r,-o*this.vignetteCenterX,-r*this.vignetteCenterY);const h=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,h)}}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);const i=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(i-1)/i,.5/i,i,this.colorGradingTexture.level)}}clone(){return Se.Clone(()=>new He,this)}serialize(){return Se.Serialize(this)}static Parse(e){const t=Se.Parse(()=>new He,e,null,null);return e.vignetteCentreX!==void 0&&(t.vignetteCenterX=e.vignetteCentreX),e.vignetteCentreY!==void 0&&(t.vignetteCenterY=e.vignetteCentreY),t}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}}He.TONEMAPPING_STANDARD=0;He.TONEMAPPING_ACES=1;He._VIGNETTEMODE_MULTIPLY=0;He._VIGNETTEMODE_OPAQUE=1;F([vd()],He.prototype,"colorCurves",void 0);F([B()],He.prototype,"_colorCurvesEnabled",void 0);F([Si("colorGradingTexture")],He.prototype,"_colorGradingTexture",void 0);F([B()],He.prototype,"_colorGradingEnabled",void 0);F([B()],He.prototype,"_colorGradingWithGreenDepth",void 0);F([B()],He.prototype,"_colorGradingBGR",void 0);F([B()],He.prototype,"_exposure",void 0);F([B()],He.prototype,"_toneMappingEnabled",void 0);F([B()],He.prototype,"_toneMappingType",void 0);F([B()],He.prototype,"_contrast",void 0);F([B()],He.prototype,"vignetteStretch",void 0);F([B()],He.prototype,"vignetteCenterX",void 0);F([B()],He.prototype,"vignetteCenterY",void 0);F([B()],He.prototype,"vignetteWeight",void 0);F([f0()],He.prototype,"vignetteColor",void 0);F([B()],He.prototype,"vignetteCameraFov",void 0);F([B()],He.prototype,"_vignetteBlendMode",void 0);F([B()],He.prototype,"_vignetteEnabled",void 0);F([B()],He.prototype,"_ditheringEnabled",void 0);F([B()],He.prototype,"_ditheringIntensity",void 0);F([B()],He.prototype,"_skipFinalColorClamp",void 0);F([B()],He.prototype,"_applyByPostProcess",void 0);F([B()],He.prototype,"_isEnabled",void 0);Se._ImageProcessingConfigurationParser=He.Parse;class cs{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(A.NormalKind))return null;const i=this.pickedMesh.getIndices();if(!i)return null;let s;if(t){const r=this.pickedMesh.getVerticesData(A.NormalKind);let o=v.FromArray(r,i[this.faceId*3]*3),l=v.FromArray(r,i[this.faceId*3+1]*3),h=v.FromArray(r,i[this.faceId*3+2]*3);o=o.scale(this.bu),l=l.scale(this.bv),h=h.scale(1-this.bu-this.bv),s=new v(o.x+l.x+h.x,o.y+l.y+h.y,o.z+l.z+h.z)}else{const r=this.pickedMesh.getVerticesData(A.PositionKind),o=v.FromArray(r,i[this.faceId*3]*3),l=v.FromArray(r,i[this.faceId*3+1]*3),h=v.FromArray(r,i[this.faceId*3+2]*3),c=o.subtract(l),u=h.subtract(l);s=v.Cross(c,u)}const n=(r,o)=>{let l=r.getWorldMatrix();r.nonUniformScaling&&(G.Matrix[0].copyFrom(l),l=G.Matrix[0],l.setTranslationFromFloats(0,0,0),l.invert(),l.transposeToRef(G.Matrix[1]),l=G.Matrix[1]),v.TransformNormalToRef(o,l,o)};if(e&&n(this.pickedMesh,s),this.ray){const r=G.Vector3[0].copyFrom(s);e||n(this.pickedMesh,r),v.Dot(r,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=A.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=fe.FromArray(i,t[this.faceId*3]*2),n=fe.FromArray(i,t[this.faceId*3+1]*2),r=fe.FromArray(i,t[this.faceId*3+2]*2);return s=s.scale(this.bu),n=n.scale(this.bv),r=r.scale(1-this.bu-this.bv),new fe(s.x+n.x+r.x,s.y+n.y+r.y)}}class Lt{constructor(e,t,i,s,n,r){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=n,this.additionalData=r}static CreateNew(e,t,i){const s=e.getScene();return new Lt(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Lt(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Lt(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Lt(e,t.x,t.y,null,i,s)}}class ve{}ve.NAME_EFFECTLAYER="EffectLayer";ve.NAME_LAYER="Layer";ve.NAME_LENSFLARESYSTEM="LensFlareSystem";ve.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";ve.NAME_PARTICLESYSTEM="ParticleSystem";ve.NAME_GAMEPAD="Gamepad";ve.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";ve.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";ve.NAME_PREPASSRENDERER="PrePassRenderer";ve.NAME_DEPTHRENDERER="DepthRenderer";ve.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";ve.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";ve.NAME_SPRITE="Sprite";ve.NAME_SUBSURFACE="SubSurface";ve.NAME_OUTLINERENDERER="Outline";ve.NAME_PROCEDURALTEXTURE="ProceduralTexture";ve.NAME_SHADOWGENERATOR="ShadowGenerator";ve.NAME_OCTREE="Octree";ve.NAME_PHYSICSENGINE="PhysicsEngine";ve.NAME_AUDIO="Audio";ve.NAME_FLUIDRENDERER="FluidRenderer";ve.STEP_ISREADYFORMESH_EFFECTLAYER=0;ve.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;ve.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;ve.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;ve.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;ve.STEP_BEFORECAMERADRAW_PREPASS=0;ve.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;ve.STEP_BEFORECAMERADRAW_LAYER=2;ve.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;ve.STEP_BEFORERENDERTARGETDRAW_LAYER=1;ve.STEP_BEFORERENDERINGMESH_PREPASS=0;ve.STEP_BEFORERENDERINGMESH_OUTLINE=1;ve.STEP_AFTERRENDERINGMESH_PREPASS=0;ve.STEP_AFTERRENDERINGMESH_OUTLINE=1;ve.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;ve.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;ve.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;ve.STEP_BEFORECAMERAUPDATE_GAMEPAD=1;ve.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;ve.STEP_BEFORECLEAR_PREPASS=1;ve.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;ve.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;ve.STEP_AFTERRENDERTARGETDRAW_LAYER=1;ve.STEP_AFTERCAMERADRAW_PREPASS=0;ve.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;ve.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;ve.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;ve.STEP_AFTERCAMERADRAW_LAYER=4;ve.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;ve.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;ve.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;ve.STEP_AFTERRENDER_AUDIO=0;ve.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;ve.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;ve.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;ve.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;ve.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;ve.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;ve.STEP_POINTERMOVE_SPRITE=0;ve.STEP_POINTERDOWN_SPRITE=0;ve.STEP_POINTERUP_SPRITE=0;class mt extends Array{constructor(e){super(...e)}static Create(){return Object.create(mt.prototype)}registerStep(e,t,i){let s=0,n=Number.MAX_VALUE;for(;s=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in xi.Triggers)if(Object.prototype.hasOwnProperty.call(xi.Triggers,t)&&parseInt(t)===e)return!0;return!1}}xi.Triggers={};class Xn{}Xn.KEYDOWN=1;Xn.KEYUP=2;class Ua{constructor(e,t){this.type=e,this.event=t}}class xo extends Ua{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}var ce;(function(a){a[a.Generic=0]="Generic",a[a.Keyboard=1]="Keyboard",a[a.Mouse=2]="Mouse",a[a.Touch=3]="Touch",a[a.DualShock=4]="DualShock",a[a.Xbox=5]="Xbox",a[a.Switch=6]="Switch",a[a.DualSense=7]="DualSense"})(ce||(ce={}));var xe;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.Move=12]="Move"})(xe||(xe={}));var Or;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.DeltaHorizontal=10]="DeltaHorizontal",a[a.DeltaVertical=11]="DeltaVertical"})(Or||(Or={}));var bo;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Share=8]="Share",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(bo||(bo={}));var yo;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Create=8]="Create",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(yo||(yo={}));var To;(function(a){a[a.A=0]="A",a[a.B=1]="B",a[a.X=2]="X",a[a.Y=3]="Y",a[a.LB=4]="LB",a[a.RB=5]="RB",a[a.LT=6]="LT",a[a.RT=7]="RT",a[a.Back=8]="Back",a[a.Start=9]="Start",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.LStickXAxis=17]="LStickXAxis",a[a.LStickYAxis=18]="LStickYAxis",a[a.RStickXAxis=19]="RStickXAxis",a[a.RStickYAxis=20]="RStickYAxis"})(To||(To={}));var So;(function(a){a[a.B=0]="B",a[a.A=1]="A",a[a.Y=2]="Y",a[a.X=3]="X",a[a.L=4]="L",a[a.R=5]="R",a[a.ZL=6]="ZL",a[a.ZR=7]="ZR",a[a.Minus=8]="Minus",a[a.Plus=9]="Plus",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.Capture=17]="Capture",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(So||(So={}));var Ao;(function(a){a[a.PointerMove=0]="PointerMove",a[a.PointerDown=1]="PointerDown",a[a.PointerUp=2]="PointerUp"})(Ao||(Ao={}));class tr{}tr.DOM_DELTA_PIXEL=0;tr.DOM_DELTA_LINE=1;tr.DOM_DELTA_PAGE=2;class Gs{static CreateDeviceEvent(e,t,i,s,n,r,o){switch(e){case ce.Keyboard:return this._CreateKeyboardEvent(i,s,n,r);case ce.Mouse:if(i===xe.MouseWheelX||i===xe.MouseWheelY||i===xe.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,n,r);case ce.Touch:return this._CreatePointerEvent(e,t,i,s,n,r,o);default:throw"Unable to generate event for device ".concat(ce[e])}}static _CreatePointerEvent(e,t,i,s,n,r,o){const l=this._CreateMouseEvent(e,t,i,s,n,r);return e===ce.Mouse?(l.deviceType=ce.Mouse,l.pointerId=1,l.pointerType="mouse"):(l.deviceType=ce.Touch,l.pointerId=o!=null?o:t,l.pointerType="touch"),i===xe.Move?l.type="pointermove":i>=xe.LeftClick&&i<=xe.RightClick&&(l.type=s===1?"pointerdown":"pointerup",l.button=i-2),l}static _CreateWheelEvent(e,t,i,s,n,r){const o=this._CreateMouseEvent(e,t,i,s,n,r);switch(o.pointerId=1,o.type="wheel",o.deltaMode=tr.DOM_DELTA_PIXEL,o.deltaX=0,o.deltaY=0,o.deltaZ=0,i){case xe.MouseWheelX:o.deltaX=s;break;case xe.MouseWheelY:o.deltaY=s;break;case xe.MouseWheelZ:o.deltaZ=s;break}return o}static _CreateMouseEvent(e,t,i,s,n,r){const o=this._CreateEvent(r),l=n.pollInput(e,t,xe.Horizontal),h=n.pollInput(e,t,xe.Vertical);return r?(o.movementX=0,o.movementY=0,o.offsetX=o.movementX-r.getBoundingClientRect().x,o.offsetY=o.movementY-r.getBoundingClientRect().y):(o.movementX=n.pollInput(e,t,Or.DeltaHorizontal),o.movementY=n.pollInput(e,t,Or.DeltaVertical),o.offsetX=0,o.offsetY=0),this._CheckNonCharacterKeys(o,n),o.clientX=l,o.clientY=h,o.x=l,o.y=h,o.deviceType=e,o.deviceSlot=t,o.inputIndex=i,o}static _CreateKeyboardEvent(e,t,i,s){const n=this._CreateEvent(s);return this._CheckNonCharacterKeys(n,i),n.deviceType=ce.Keyboard,n.deviceSlot=0,n.inputIndex=e,n.type=t===1?"keydown":"keyup",n.key=String.fromCharCode(e),n.keyCode=e,n}static _CheckNonCharacterKeys(e,t){const i=t.isDeviceAvailable(ce.Keyboard),s=i&&t.pollInput(ce.Keyboard,0,18)===1,n=i&&t.pollInput(ce.Keyboard,0,17)===1,r=i&&(t.pollInput(ce.Keyboard,0,91)===1||t.pollInput(ce.Keyboard,0,92)===1||t.pollInput(ce.Keyboard,0,93)===1),o=i&&t.pollInput(ce.Keyboard,0,16)===1;e.altKey=s,e.ctrlKey=n,e.metaKey=r,e.shiftKey=o}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class jd{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,n,r,o)=>{const l=Gs.CreateDeviceEvent(s,n,r,o,this);i(s,n,l)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===ce.Mouse||e===ce.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const Eo=255,Co=Object.keys(xe).length/2;class $d{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=re.IsSafari(),this._usingMacOS=n0()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=n=>{},this._keyboardUpEvent=n=>{},this._keyboardBlurEvent=n=>{},this._pointerMoveEvent=n=>{},this._pointerDownEvent=n=>{},this._pointerUpEvent=n=>{},this._pointerCancelEvent=n=>{},this._pointerWheelEvent=n=>{},this._pointerBlurEvent=n=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=Da.IsNavigatorAvailable()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=n=>{},this._gamepadDisconnectedEvent=n=>{},this._eventPrefix=re.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOS&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){const s=this._inputs[e][t];if(!s)throw"Unable to find device ".concat(ce[e]);e>=ce.DualShock&&e<=ce.DualSense&&this._updateDevice(e,t,i);const n=s[i];if(n===void 0)throw"Unable to find input ".concat(i," for device ").concat(ce[e]," in slot ").concat(t);return i===xe.Move&&re.Warn("Unable to provide information for PointerInput.Move. Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),n}isDeviceAvailable(e){return this._inputs[e]!==void 0}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){const e=this===null||this===void 0?void 0:this._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(const t of this._inputs)if(t)for(const i in t){const s=+i,n=t[s];if(n)for(let r=0;r{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(ce.Keyboard,0,Eo));const t=this._inputs[ce.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOS&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(ce.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(ce.Keyboard,0,Eo));const t=this._inputs[ce.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOS&&e.key==="Meta"&&this._metaKeys.length>0){for(const s of this._metaKeys){const n=Gs.CreateDeviceEvent(ce.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(ce.Keyboard,0,n)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(ce.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[ce.Keyboard][0];for(let t=0;t{const s=this._getPointerType(i),n=s===ce.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]||this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=i;o.inputIndex=xe.Move,r[xe.Horizontal]=i.clientX,r[xe.Vertical]=i.clientY,i.pointerId===void 0&&(i.pointerId=this._mouseId),this._onInputChanged(s,n,o),!this._usingSafari&&i.button!==-1&&(o.inputIndex=i.button+2,r[i.button+2]=r[i.button+2]?0:1,this._onInputChanged(s,n,o))}},this._pointerDownEvent=i=>{const s=this._getPointerType(i);let n=s===ce.Mouse?0:i.pointerId;if(s===ce.Touch){const o=this._activeTouchIds.indexOf(-1);if(o>=0)n=o,this._activeTouchIds[o]=i.pointerId;else{re.Warn("Max number of touches exceeded. Ignoring touches in excess of ".concat(this._maxTouchPoints));return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]?s===ce.Touch&&this._onDeviceConnected(s,n):this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=r[xe.Horizontal],l=r[xe.Vertical];if(s===ce.Mouse){if(i.pointerId===void 0&&(i.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(i.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(i.pointerId)}catch{}r[xe.Horizontal]=i.clientX,r[xe.Vertical]=i.clientY,r[i.button+2]=1;const h=i;h.inputIndex=i.button+2,this._onInputChanged(s,n,h),(o!==i.clientX||l!==i.clientY)&&(h.inputIndex=xe.Move,this._onInputChanged(s,n,h))}},this._pointerUpEvent=i=>{var s,n,r,o,l;const h=this._getPointerType(i),c=h===ce.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(h===ce.Touch){if(c===-1)return;this._activeTouchIds[c]=-1}const u=(s=this._inputs[h])===null||s===void 0?void 0:s[c];if(u&&u[i.button+2]!==0){const d=u[xe.Horizontal],_=u[xe.Vertical];u[xe.Horizontal]=i.clientX,u[xe.Vertical]=i.clientY,u[i.button+2]=0;const f=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(d!==i.clientX||_!==i.clientY)&&(f.inputIndex=xe.Move,this._onInputChanged(h,c,f)),f.inputIndex=i.button+2,h===ce.Mouse&&this._mouseId>=0&&(!((r=(n=this._elementToAttachTo).hasPointerCapture)===null||r===void 0)&&r.call(n,this._mouseId))?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&(!((l=(o=this._elementToAttachTo).hasPointerCapture)===null||l===void 0)&&l.call(o,i.pointerId))&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(h,c,f),h===ce.Touch&&this._onDeviceDisconnected(h,c)}},this._pointerCancelEvent=i=>{var s,n,r,o;if(i.pointerType==="mouse"){const l=this._inputs[ce.Mouse][0];this._mouseId>=0&&(!((n=(s=this._elementToAttachTo).hasPointerCapture)===null||n===void 0)&&n.call(s,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let h=xe.LeftClick;h<=xe.BrowserForward;h++)if(l[h]===1){l[h]=0;const c=Gs.CreateDeviceEvent(ce.Mouse,0,h,0,this,this._elementToAttachTo);this._onInputChanged(ce.Mouse,0,c)}}else{const l=this._activeTouchIds.indexOf(i.pointerId);!((o=(r=this._elementToAttachTo).hasPointerCapture)===null||o===void 0)&&o.call(r,i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._inputs[ce.Touch][l][xe.LeftClick]=0;const h=Gs.CreateDeviceEvent(ce.Touch,l,xe.LeftClick,0,this,this._elementToAttachTo,i.pointerId);this._onInputChanged(ce.Touch,l,h),this._activeTouchIds[l]=-1,this._onDeviceDisconnected(ce.Touch,l)}},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch{}this._pointerBlurEvent=()=>{var i,s,n,r,o;if(this.isDeviceAvailable(ce.Mouse)){const l=this._inputs[ce.Mouse][0];this._mouseId>=0&&(!((s=(i=this._elementToAttachTo).hasPointerCapture)===null||s===void 0)&&s.call(i,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let h=xe.LeftClick;h<=xe.BrowserForward;h++)if(l[h]===1){l[h]=0;const c=Gs.CreateDeviceEvent(ce.Mouse,0,h,0,this,this._elementToAttachTo);this._onInputChanged(ce.Mouse,0,c)}}if(this.isDeviceAvailable(ce.Touch)){const l=this._inputs[ce.Touch];for(let h=0;h{const s=ce.Mouse,n=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][n]||(this._pointerActive=!0,this._registerDevice(s,n,Co));const r=this._inputs[s][n];if(r){r[xe.MouseWheelX]=i.deltaX||0,r[xe.MouseWheelY]=i.deltaY||i.wheelDelta||0,r[xe.MouseWheelZ]=i.deltaZ||0;const o=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),r[xe.MouseWheelX]!==0&&(o.inputIndex=xe.MouseWheelX,this._onInputChanged(s,n,o)),r[xe.MouseWheelY]!==0&&(o.inputIndex=xe.MouseWheelY,this._onInputChanged(s,n,o)),r[xe.MouseWheelZ]!==0&&(o.inputIndex=xe.MouseWheelZ,this._onInputChanged(s,n,o))}},this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,e?{passive:!1}:!1),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(ce.Mouse)){const i=this._inputs[ce.Mouse][0];i[xe.MouseWheelX]=0,i[xe.MouseWheelY]=0,i[xe.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){const s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){const n=this._inputs[e][t];i>=s.buttons.length?n[i]=s.axes[i-s.buttons.length].valueOf():n[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?ce.DualSense:ce.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1?ce.Xbox:e.indexOf("057e")!==-1?ce.Switch:ce.Generic}_getPointerType(e){let t=ce.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=ce.Touch),t}}class Ro{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new ee,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class Zd{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=r=>{for(let o=0;o{const o=this._registeredManagers.indexOf(r);o>-1&&this._registeredManagers.splice(o,1)};const t=Object.keys(ce).length/2;this._devices=new Array(t);const i=(r,o)=>{this._devices[r]||(this._devices[r]=new Array),this._devices[r][o]||(this._devices[r][o]=o);for(const l of this._registeredManagers){const h=new Ro(this._deviceInputSystem,r,o);l._addDevice(h)}},s=(r,o)=>{var l;!((l=this._devices[r])===null||l===void 0)&&l[o]&&delete this._devices[r][o];for(const h of this._registeredManagers)h._removeDevice(r,o)},n=(r,o,l)=>{if(l)for(const h of this._registeredManagers)h._onInputChanged(r,o,l)};typeof _native<"u"?this._deviceInputSystem=new jd(i,s,n):this._deviceInputSystem=new $d(e,i,s,n)}dispose(){this._deviceInputSystem.dispose()}}class Qd{getDeviceSource(e,t){if(t===void 0){if(this._firstDevice[e]===void 0)return null;t=this._firstDevice[e]}return!this._devices[e]||this._devices[e][t]===void 0?null:this._devices[e][t]}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(t=>!!t):[]}constructor(e){const t=Object.keys(ce).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new Zd(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new ee(i=>{for(const s of this._devices)if(s)for(const n of s)n&&this.onDeviceConnectedObservable.notifyObserver(i,n)}),this.onDeviceDisconnectedObservable=new ee,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=new Array),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){var i,s;const n=(i=this._devices[e])===null||i===void 0?void 0:i[t];this.onDeviceDisconnectedObservable.notifyObservers(n),!((s=this._devices[e])===null||s===void 0)&&s[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){var s,n;(n=(s=this._devices[e])===null||s===void 0?void 0:s[t])===null||n===void 0||n.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case ce.Keyboard:case ce.Mouse:this._firstDevice[e]=0;break;case ce.Touch:case ce.DualSense:case ce.DualShock:case ce.Xbox:case ce.Switch:case ce.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i=xe.MouseWheelX&&t.inputIndex<=xe.MouseWheelZ?Re.POINTERWHEEL:Re.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,r));let o;e?(o=new ss(r,t,e),this._setRayOnPointerInfo(e,t)):(o=new ss(r,t,null,this),this._movePointerInfo=o),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(o,r)}_setRayOnPointerInfo(e,t){const i=this._scene;e&&i._pickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,N.Identity(),i.activeCamera)))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){const s=this._scene,n=new qd(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.originalPickingInfo=e,n.ray=e.ray,e.originMesh&&(n.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(n,i),!!n.skipOnPointerObservable}_pickMove(e){const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,!1,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){const n=i.getEngine().getInputElement();if(e!=null&&e.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&n&&this._pointerOverMesh){const r=this._pointerOverMesh._getActionManagerForTrigger();r&&r.hasPointerTriggers&&(n.style.cursor=r.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const i=new PointerEvent("pointermove",t);i.inputIndex=xe.Move,!this._checkPrePointerObservable(e,i,Re.POINTERMOVE)&&this._processPointerMove(e,i)}simulatePointerDown(e,t){const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,!this._checkPrePointerObservable(e,i,Re.POINTERDOWN)&&this._processPointerDown(e,i)}_processPointerDown(e,t){const i=this._scene;if(e!=null&&e.pickedMesh){this._pickedDownMesh=e.pickedMesh;const r=e.pickedMesh._getActionManagerForTrigger();if(r){if(r.hasPickTriggers)switch(r.processTrigger(5,Lt.CreateNew(e.pickedMesh,t)),t.button){case 0:r.processTrigger(2,Lt.CreateNew(e.pickedMesh,t));break;case 1:r.processTrigger(4,Lt.CreateNew(e.pickedMesh,t));break;case 2:r.processTrigger(3,Lt.CreateNew(e.pickedMesh,t));break}r.hasSpecificTrigger(8)&&window.setTimeout(()=>{const o=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,l=>l.isPickable&&l.isVisible&&l.isReady()&&l.actionManager&&l.actionManager.hasSpecificTrigger(8)&&l===this._pickedDownMesh,!1,i.cameraToUseForPointers);o!=null&&o.pickedMesh&&r&&this._totalPointersPressed!==0&&Date.now()-this._startingPointerTime>vt.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,r.processTrigger(8,Lt.CreateNew(o.pickedMesh,t)))},vt.LongPressDelay)}}else for(const r of i._pointerDownStage)e=r.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let s;const n=Re.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,n),s=new ss(n,t,e),this._setRayOnPointerInfo(e,t)):s=new ss(n,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(s,n)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){const s=new PointerEvent("pointerup",t);s.inputIndex=xe.Move;const n=new Io;i?n.doubleClick=!0:n.singleClick=!0,!this._checkPrePointerObservable(e,s,Re.POINTERUP)&&this._processPointerUp(e,s,n)}_processPointerUp(e,t,i){const s=this._scene;if(e!=null&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){const r=Re.POINTERPICK,o=new ss(r,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(o,r)}const n=e.pickedMesh._getActionManagerForTrigger();if(n&&!i.ignore){n.processTrigger(7,Lt.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&n.processTrigger(1,Lt.CreateNew(e.pickedMesh,t,e));const r=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&r&&r.processTrigger(6,Lt.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const n of s._pointerUpStage)e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const n=this._pickedDownMesh._getActionManagerForTrigger(16);n&&n.processTrigger(16,Lt.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const n=new ss(Re.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(n,Re.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,Re.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let r=0;if(i.singleClick?r=Re.POINTERTAP:i.doubleClick&&(r=Re.POINTERDOUBLETAP),r){const o=new ss(r,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(r)&&s.onPointerObservable.notifyObservers(o,r)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){const n=this._scene,r=n.getEngine();s||(s=r.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new Qd(r),this._initActionManager=o=>{if(!this._meshPickProceed){const l=n.skipPointerUpPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerUp?null:n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerUpPredicate,!1,n.cameraToUseForPointers);this._currentPickResult=l,l&&(o=l.hit&&l.pickedMesh?l.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return o},this._delayedSimpleClick=(o,l,h)=>{if((Date.now()-this._previousStartingPointerTime>vt.DoubleClickDelay&&!this._doubleClickOccured||o!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,l.singleClick=!0,l.ignore=!1,this._delayedClicks[o])){const c=this._delayedClicks[o].evt,u=Re.POINTERTAP,d=new ss(u,c,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(u)&&n.onPointerObservable.notifyObservers(d,u),this._delayedClicks[o]=null}},this._initClickEvent=(o,l,h,c)=>{var u,d;const _=new Io;this._currentPickResult=null;let f=null,g=o.hasSpecificMask(Re.POINTERPICK)||l.hasSpecificMask(Re.POINTERPICK)||o.hasSpecificMask(Re.POINTERTAP)||l.hasSpecificMask(Re.POINTERTAP)||o.hasSpecificMask(Re.POINTERDOUBLETAP)||l.hasSpecificMask(Re.POINTERDOUBLETAP);!g&&xi&&(f=this._initActionManager(f,_),f&&(g=f.hasPickTriggers));let p=!1;if(g){const x=h.button;if(_.hasSwiped=this._isPointerSwiping(),!_.hasSwiped){let m=!vt.ExclusiveDoubleClickMode;if(m||(m=!o.hasSpecificMask(Re.POINTERDOUBLETAP)&&!l.hasSpecificMask(Re.POINTERDOUBLETAP),m&&!xi.HasSpecificTrigger(6)&&(f=this._initActionManager(f,_),f&&(m=!f.hasSpecificTrigger(6)))),m)(Date.now()-this._previousStartingPointerTime>vt.DoubleClickDelay||x!==this._previousButtonPressed)&&(_.singleClick=!0,c(_,this._currentPickResult),p=!0);else{const S={evt:h,clickInfo:_,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,x,_,c),vt.DoubleClickDelay)};this._delayedClicks[x]=S}let T=o.hasSpecificMask(Re.POINTERDOUBLETAP)||l.hasSpecificMask(Re.POINTERDOUBLETAP);!T&&xi.HasSpecificTrigger(6)&&(f=this._initActionManager(f,_),f&&(T=f.hasSpecificTrigger(6))),T&&(x===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime{if(this._updatePointerPosition(o),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>vt.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>vt.DragMovementThreshold),r.isPointerLock&&r._verifyPointerLock(),this._checkPrePointerObservable(null,o,o.inputIndex>=xe.MouseWheelX&&o.inputIndex<=xe.MouseWheelZ?Re.POINTERWHEEL:Re.POINTERMOVE)||!n.cameraToUseForPointers&&!n.activeCamera)return;if(n.skipPointerMovePicking){this._processPointerMove(new cs,o);return}n.pointerMovePredicate||(n.pointerMovePredicate=h=>h.isPickable&&h.isVisible&&h.isReady()&&h.isEnabled()&&(h.enablePointerMoveEvents||n.constantlyUpdateMeshUnderPointer||h._getActionManagerForTrigger()!==null)&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&h.layerMask)!==0));const l=n._registeredActions>0?this._pickMove(o):null;this._processPointerMove(l,o)},this._onPointerDown=o=>{var l;if(this._totalPointersPressed++,this._pickedDownMesh=null,this._meshPickProceed=!1,vt.ExclusiveDoubleClickMode){for(let c=0;cc.isPickable&&c.isVisible&&c.isReady()&&c.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&c.layerMask)!==0)),this._pickedDownMesh=null;let h;n.skipPointerDownPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerDown?h=new cs:h=n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerDownPredicate,!1,n.cameraToUseForPointers),this._processPointerDown(h,o)},this._onPointerUp=o=>{this._totalPointersPressed!==0&&(this._totalPointersPressed--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(o),n.preventDefaultOnPointerUp&&s&&(o.preventDefault(),s.focus()),this._initClickEvent(n.onPrePointerObservable,n.onPointerObservable,o,(l,h)=>{if(n.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!l.ignore)){if(this._checkPrePointerObservable(null,o,Re.POINTERUP)){this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}l.hasSwiped||(l.singleClick&&n.onPrePointerObservable.hasSpecificMask(Re.POINTERTAP)&&this._checkPrePointerObservable(null,o,Re.POINTERTAP)&&(this._skipPointerTap=!0),l.doubleClick&&n.onPrePointerObservable.hasSpecificMask(Re.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,o,Re.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[o.pointerId]){this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}o.buttons===0&&(this._pointerCaptures[o.pointerId]=!1),!(!n.cameraToUseForPointers&&!n.activeCamera)&&(n.pointerUpPredicate||(n.pointerUpPredicate=c=>c.isPickable&&c.isVisible&&c.isReady()&&c.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&c.layerMask)!==0)),!this._meshPickProceed&&(xi&&xi.HasTriggers||this._checkForPicking()||n.onPointerUp)&&this._initActionManager(null,l),h||(h=this._currentPickResult),this._processPointerUp(h,o,l),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=o=>{const l=Xn.KEYDOWN;if(n.onPreKeyboardObservable.hasObservers()){const h=new xo(l,o);if(n.onPreKeyboardObservable.notifyObservers(h,l),h.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const h=new Ua(l,o);n.onKeyboardObservable.notifyObservers(h,l)}n.actionManager&&n.actionManager.processTrigger(14,Lt.CreateNewFromScene(n,o))},this._onKeyUp=o=>{const l=Xn.KEYUP;if(n.onPreKeyboardObservable.hasObservers()){const h=new xo(l,o);if(n.onPreKeyboardObservable.notifyObservers(h,l),h.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const h=new Ua(l,o);n.onKeyboardObservable.notifyObservers(h,l)}n.actionManager&&n.actionManager.processTrigger(15,Lt.CreateNewFromScene(n,o))},this._deviceSourceManager.onDeviceConnectedObservable.add(o=>{o.deviceType===ce.Mouse?o.onInputChangedObservable.add(l=>{l.inputIndex===xe.LeftClick||l.inputIndex===xe.MiddleClick||l.inputIndex===xe.RightClick||l.inputIndex===xe.BrowserBack||l.inputIndex===xe.BrowserForward?t&&o.getInput(l.inputIndex)===1?this._onPointerDown(l):e&&o.getInput(l.inputIndex)===0&&this._onPointerUp(l):i&&(l.inputIndex===xe.Move?this._onPointerMove(l):(l.inputIndex===xe.MouseWheelX||l.inputIndex===xe.MouseWheelY||l.inputIndex===xe.MouseWheelZ)&&this._onPointerMove(l))}):o.deviceType===ce.Touch?o.onInputChangedObservable.add(l=>{l.inputIndex===xe.LeftClick&&(t&&o.getInput(l.inputIndex)===1?(this._onPointerDown(l),this._totalPointersPressed>1&&(this._isMultiTouchGesture=!0)):e&&o.getInput(l.inputIndex)===0&&(this._onPointerUp(l),this._totalPointersPressed===0&&(this._isMultiTouchGesture=!1))),i&&l.inputIndex===xe.Move&&this._onPointerMove(l)}):o.deviceType===ce.Keyboard&&o.onInputChangedObservable.add(l=>{l.type==="keydown"?this._onKeyDown(l):l.type==="keyup"&&this._onKeyUp(l)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,s){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const n=this._meshUnderPointerId[t];let r;n&&(r=n._getActionManagerForTrigger(10),r&&r.processTrigger(10,Lt.CreateNew(n,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,r=e._getActionManagerForTrigger(9),r&&r.processTrigger(9,Lt.CreateNew(e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null)}getPointerOverMesh(){return this.meshUnderPointer}_invalidateMesh(e){this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}vt.DragMovementThreshold=10;vt.LongPressDelay=500;vt.DoubleClickDelay=300;vt.ExclusiveDoubleClickMode=!1;class Ol{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}Ol._UniqueIdCounter=1;class Ke{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Ke.FALLOFF_DEFAULT=0;Ke.FALLOFF_PHYSICAL=1;Ke.FALLOFF_GLTF=2;Ke.FALLOFF_STANDARD=3;Ke.LIGHTMAP_DEFAULT=0;Ke.LIGHTMAP_SPECULAR=1;Ke.LIGHTMAP_SHADOWSONLY=2;Ke.INTENSITYMODE_AUTOMATIC=0;Ke.INTENSITYMODE_LUMINOUSPOWER=1;Ke.INTENSITYMODE_LUMINOUSINTENSITY=2;Ke.INTENSITYMODE_ILLUMINANCE=3;Ke.INTENSITYMODE_LUMINANCE=4;Ke.LIGHTTYPEID_POINTLIGHT=0;Ke.LIGHTTYPEID_DIRECTIONALLIGHT=1;Ke.LIGHTTYPEID_SPOTLIGHT=2;Ke.LIGHTTYPEID_HEMISPHERICLIGHT=3;var Wi;(function(a){a[a.BackwardCompatible=0]="BackwardCompatible",a[a.Intermediate=1]="Intermediate",a[a.Aggressive=2]="Aggressive"})(Wi||(Wi={}));class Me extends ps{static DefaultMaterialFactory(e){throw Ae("StandardMaterial")}static CollisionCoordinatorFactory(){throw Ae("DefaultCollisionCoordinator")}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.markAllMaterialsAsDirty(1))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case Wi.BackwardCompatible:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case Wi.Intermediate:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case Wi.Aggressive:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1;break}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return vt.DragMovementThreshold}static set DragMovementThreshold(e){vt.DragMovementThreshold=e}static get LongPressDelay(){return vt.LongPressDelay}static set LongPressDelay(e){vt.LongPressDelay=e}static get DoubleClickDelay(){return vt.DoubleClickDelay}static set DoubleClickDelay(e){vt.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return vt.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){vt.ExclusiveDoubleClickMode=e}bindEyePosition(e,t="vEyePosition",i=!1){var s;const n=this._forcedViewPosition?this._forcedViewPosition:this._mirroredCameraPosition?this._mirroredCameraPosition:(s=this.activeCamera.globalPosition)!==null&&s!==void 0?s:this.activeCamera.devicePosition,r=this.useRightHandedSystem===(this._mirroredCameraPosition!=null);return G.Vector4[0].set(n.x,n.y,n.z,r?-1:1),e&&(i?e.setFloat3(t,G.Vector4[0].x,G.Vector4[0].y,G.Vector4[0].z):e.setVector4(t,G.Vector4[0])),G.Vector4[0]}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null);return e.updateFloat4("vEyePosition",t.x,t.y,t.z,t.w),e.update(),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=_l(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=Me.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=Me.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){for(const t of this._components)if(t.name===e)return t;return null}constructor(e,t){super(),this._inputManager=new vt(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this.clearColor=new q(.2,.2,.3,1),this.ambientColor=new he(0,0,0),this.environmentIntensity=1,this._performancePriority=Wi.BackwardCompatible,this.onScenePerformancePriorityChangedObservable=new ee,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCursor="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=new Array,this.onDisposeObservable=new ee,this._onDisposeObserver=null,this.onBeforeRenderObservable=new ee,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new ee,this.onAfterRenderCameraObservable=new ee,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new ee,this.onAfterAnimationsObservable=new ee,this.onBeforeDrawPhaseObservable=new ee,this.onAfterDrawPhaseObservable=new ee,this.onReadyObservable=new ee,this.onBeforeCameraRenderObservable=new ee,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new ee,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new ee,this.onAfterActiveMeshesEvaluationObservable=new ee,this.onBeforeParticlesRenderingObservable=new ee,this.onAfterParticlesRenderingObservable=new ee,this.onDataLoadedObservable=new ee,this.onNewCameraAddedObservable=new ee,this.onCameraRemovedObservable=new ee,this.onNewLightAddedObservable=new ee,this.onLightRemovedObservable=new ee,this.onNewGeometryAddedObservable=new ee,this.onGeometryRemovedObservable=new ee,this.onNewTransformNodeAddedObservable=new ee,this.onTransformNodeRemovedObservable=new ee,this.onNewMeshAddedObservable=new ee,this.onMeshRemovedObservable=new ee,this.onNewSkeletonAddedObservable=new ee,this.onSkeletonRemovedObservable=new ee,this.onNewMaterialAddedObservable=new ee,this.onNewMultiMaterialAddedObservable=new ee,this.onMaterialRemovedObservable=new ee,this.onMultiMaterialRemovedObservable=new ee,this.onNewTextureAddedObservable=new ee,this.onTextureRemovedObservable=new ee,this.onBeforeRenderTargetsRenderObservable=new ee,this.onAfterRenderTargetsRenderObservable=new ee,this.onBeforeStepObservable=new ee,this.onAfterStepObservable=new ee,this.onActiveCameraChanged=new ee,this.onActiveCamerasChanged=new ee,this.onBeforeRenderingGroupObservable=new ee,this.onAfterRenderingGroupObservable=new ee,this.onMeshImportedObservable=new ee,this.onAnimationFileImportedObservable=new ee,this._registeredForLateAnimationBindings=new Vs(256),this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1,this.onPrePointerObservable=new ee,this.onPointerObservable=new ee,this.onPreKeyboardObservable=new ee,this.onKeyboardObservable=new ee,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=Me.FOGMODE_NONE,this.fogColor=new he(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new v(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=new Array,this.importedMeshesFiles=new Array,this.probesEnabled=!0,this._meshesForIntersections=new Vs(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new Gi,this._activeIndices=new Gi,this._activeParticles=new Gi,this._activeBones=new Gi,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._pendingData=new Array,this._isDisposed=!1,this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new qt(256),this._processedMaterials=new qt(256),this._renderTargets=new Vs(256),this._materialsRenderTargets=new Vs(256),this._activeParticleSystems=new qt(256),this._activeSkeletons=new Vs(32),this._softwareSkinnedMeshes=new Vs(32),this._activeAnimatables=new Array,this._transformMatrix=N.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=mt.Create(),this._beforeClearStage=mt.Create(),this._beforeRenderTargetClearStage=mt.Create(),this._gatherRenderTargetsStage=mt.Create(),this._gatherActiveCameraRenderTargetsStage=mt.Create(),this._isReadyForMeshStage=mt.Create(),this._beforeEvaluateActiveMeshStage=mt.Create(),this._evaluateSubMeshStage=mt.Create(),this._preActiveMeshStage=mt.Create(),this._cameraDrawRenderTargetStage=mt.Create(),this._beforeCameraDrawStage=mt.Create(),this._beforeRenderTargetDrawStage=mt.Create(),this._beforeRenderingGroupDrawStage=mt.Create(),this._beforeRenderingMeshStage=mt.Create(),this._afterRenderingMeshStage=mt.Create(),this._afterRenderingGroupDrawStage=mt.Create(),this._afterCameraDrawStage=mt.Create(),this._afterCameraPostProcessStage=mt.Create(),this._afterRenderTargetDrawStage=mt.Create(),this._afterRenderTargetPostProcessStage=mt.Create(),this._afterRenderStage=mt.Create(),this._pointerMoveStage=mt.Create(),this._pointerDownStage=mt.Create(),this._pointerUpStage=mt.Create(),this._geometriesByUniqueId=null,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=new Array;const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,...t};this._engine=e||Ie.LastCreatedEngine,i.virtual?this._engine._virtualScenes.push(this):(Ie._LastCreatedScene=this,this._engine.scenes.push(this)),this._uid=null,this._renderingManager=new Kt(this),Na&&(this.postProcessManager=new Na(this)),Pt()&&this.attachControl(),this._createUbo(),He&&(this._imageProcessingConfiguration=new He),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,(!t||!t.virtual)&&this._engine.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=this._getDefaultMeshCandidates.bind(this),this.getActiveSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getIntersectingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getCollidingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return this._animationRatio!==void 0?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){if(this._isDisposed)return!1;let t;const i=this.getEngine();let s=!0;for(this._pendingData.length>0&&(s=!1),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t0;for(const l of this._isReadyForMeshStage)l.action(n,r)||(s=!1);if(!e)continue;const o=n.material||this.defaultMaterial;if(o)if(o._storeEffectOnSubMeshes)for(const l of n.subMeshes){const h=l.getMaterial();h&&h.hasRenderTargetTextures&&h.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(h)===-1&&(this._processedMaterials.push(h),this._materialsRenderTargets.concatWithNoDuplicate(h.getRenderTargetTextures()))}else o.hasRenderTargetTextures&&o.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(o)===-1&&(this._processedMaterials.push(o),this._materialsRenderTargets.concatWithNoDuplicate(o.getRenderTargetTextures()))}if(!s||!i.areAllEffectsReady())return!1;if(e){for(t=0;t0){for(const n of this.activeCameras)if(!n.isReady(!0))return!1}else if(this.activeCamera&&!this.activeCamera.isReady(!0))return!1;for(const n of this.particleSystems)if(!n.isReady())return!1;return!0}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){const t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){t!==void 0?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){const t=this.isLoading,i=this._pendingData.indexOf(e);i!==-1&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),this._executeWhenReadyTimeoutId===null&&this._checkIsReady(t)}whenReadyAsync(e=!1){return new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_checkIsReady(e=!1){if(this._registerTransientComponents(),this.isReady(e)){this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null;return}if(this._isDisposed){this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null;return}this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=Pi.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){!i&&!s&&this._multiviewSceneUbo&&(this._multiviewSceneUbo.dispose(),this._multiviewSceneUbo=null),!(this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?Ri.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Ri.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e){const t=new oe(this._engine,void 0,!1,e!=null?e:"scene");return t.addUniform("viewProjection",16),t.addUniform("view",16),t.addUniform("projection",16),t.addUniform("vEyePosition",4),t}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}getUniqueId(){return Ol.UniqueId}addMesh(e,t=!1){this._blockEntityCollection||(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(i=>{this.addMesh(i)}))}removeMesh(e,t=!1){const i=this.meshes.indexOf(e);return i!==-1&&(this.meshes[i]=this.meshes[this.meshes.length-1],this.meshes.pop(),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(s=>{this.removeMesh(s)}),i}addTransformNode(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneTransformNodesArray!==-1||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){const t=e._indexInSceneTransformNodesArray;if(t!==-1){if(t!==this.transformNodes.length-1){const i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){const t=this.skeletons.indexOf(e);return t!==-1&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){const t=this.morphTargetManagers.indexOf(e);return t!==-1&&this.morphTargetManagers.splice(t,1),t}removeLight(e){const t=this.lights.indexOf(e);if(t!==-1){for(const i of this.meshes)i._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes()}return this.onLightRemovedObservable.notifyObservers(e),t}removeCamera(e){const t=this.cameras.indexOf(e);if(t!==-1&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const i=this.activeCameras.indexOf(e);i!==-1&&this.activeCameras.splice(i,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){const t=this.particleSystems.indexOf(e);return t!==-1&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),t}removeAnimation(e){const t=this.animations.indexOf(e);return t!==-1&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){const t=this.animationGroups.indexOf(e);return t!==-1&&this.animationGroups.splice(t,1),t}removeMultiMaterial(e){const t=this.multiMaterials.indexOf(e);return t!==-1&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){const t=e._indexInSceneMaterialArray;if(t!==-1&&ti.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,i=>i.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,i=>i.name===e)}getLastMaterialById(e,t=!1){for(let i=this.materials.length-1;i>=0;i--)if(this.materials[i].id===e)return this.materials[i];if(t){for(let i=this.multiMaterials.length-1;i>=0;i--)if(this.multiMaterials[i].id===e)return this.multiMaterials[i]}return null}getTextureByUniqueId(e){for(let t=0;t=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const s=this.getLightById(e);if(s)return s;const n=this.getCameraById(e);if(n)return n;const r=this.getBoneById(e);return r||null}getNodeByName(e){const t=this.getMeshByName(e);if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const s=this.getLightByName(e);if(s)return s;const n=this.getCameraByName(e);if(n)return n;const r=this.getBoneByName(e);return r||null}getMeshByName(e){for(let t=0;t=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,s)for(let r=0;re.dispose())}_evaluateActiveMeshes(){var e;if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&((e=this.activeCamera)===null||e===void 0||e._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const s=this._activeMeshes.length;for(let n=0;n0&&n.layerMask&this.activeCamera.layerMask&&(this._skipFrustumClipping||n.alwaysSelectAsActiveMesh||n.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(n),this.activeCamera._activeMeshes.push(n),r!==n&&r._activate(this._renderId,!1);for(const o of this._preActiveMeshStage)o.action(n);n._activate(this._renderId,!1)&&(n.isAnInstance?n._internalAbstractMeshDataInfo._actAsRegularMesh&&(r=n):r._internalAbstractMeshDataInfo._onlyForInstances=!1,r._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(n,r)),n._postActivate()}}if(this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let s=0;s0){const s=this.getActiveSubMeshCandidates(t),n=s.length;i=i||n===1;for(let r=0;r0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const h of this._gatherActiveCameraRenderTargetsStage)h.action(this._renderTargets);let l=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){re.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(let h=0;h0),this._renderId++}for(const h of this._cameraDrawRenderTargetStage)l=h.action(this.activeCamera)||l;this._intermediateRendering=!1}this._engine.currentRenderPassId=(r=(n=(s=e.outputRenderTarget)===null||s===void 0?void 0:s.renderPassId)!==null&&n!==void 0?n:e.renderPassId)!==null&&r!==void 0?r:0,l&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const h of this._beforeCameraDrawStage)h.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this),o.snapshotRendering&&o.snapshotRenderingMode===1&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const h of this._afterCameraDrawStage)h.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const h=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,h)}for(const h of this._afterCameraPostProcessStage)h.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(e.cameraRigMode===0||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let i=0;i-1&&(s.trigger===13&&s._executeCurrent(Lt.CreateNew(t,void 0,r)),(!t.actionManager.hasSpecificTrigger(13,h=>{const c=h.mesh?h.mesh:h;return r===c})||s.trigger===13)&&t._intersectionsInProgress.splice(l,1))}}}}_advancePhysicsEngineStep(e){}_animate(){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(Me.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Me.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let s=0;const n=this._engine.getLockstepMaxSteps();let r=Math.floor(e/t);for(r=Math.min(r,n);e>0&&s0)for(let l=0;l0),this._intermediateRendering=!0;for(let l=0;l0),this._intermediateRendering=!1,this._renderId++}this._engine.currentRenderPassId=(n=o==null?void 0:o.renderPassId)!==null&&n!==void 0?n:0,this.activeCamera=o,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const l of this._beforeClearStage)l.action();this._clearFrameBuffer(this.activeCamera);for(const l of this._gatherRenderTargetsStage)l.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let l=0;l0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}this._checkIntersections();for(const l of this._afterRenderStage)l.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let l=0;ln.dispose(!0)),this._disposeList(this.transformNodes,n=>n.dispose(!0));const i=this.cameras;this._disposeList(i),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let s=this._engine.scenes.indexOf(this);s>-1&&this._engine.scenes.splice(s,1),Ie._LastCreatedScene===this&&(this._engine.scenes.length>0?Ie._LastCreatedScene=this._engine.scenes[this._engine.scenes.length-1]:Ie._LastCreatedScene=null),s=this._engine._virtualScenes.indexOf(this),s>-1&&this._engine._virtualScenes.splice(s,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){const i=e.slice(0);t=t!=null?t:s=>s.dispose();for(const s of i)t(s);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e!0),this.meshes.filter(e).forEach(s=>{if(s.computeWorldMatrix(!0),!s.subMeshes||s.subMeshes.length===0||s.infiniteDistance)return;const n=s.getBoundingInfo(),r=n.boundingBox.minimumWorld,o=n.boundingBox.maximumWorld;v.CheckExtends(r,t,i),v.CheckExtends(o,t,i)}),{min:t,max:i}}createPickingRay(e,t,i,s,n=!1){throw Ae("Ray")}createPickingRayToRef(e,t,i,s,n,r=!1,o=!1){throw Ae("Ray")}createPickingRayInCameraSpace(e,t,i){throw Ae("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw Ae("Ray")}get _pickingAvailable(){return!1}pick(e,t,i,s,n,r){return new cs}pickWithBoundingInfo(e,t,i,s,n){return new cs}pickWithRay(e,t,i,s){throw Ae("Ray")}multiPick(e,t,i,s,n){throw Ae("Ray")}multiPickWithRay(e,t,i){throw Ae("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(const e of this.textures)e._rebuild();this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(t===void 0)return e;const s=[];i=i||(n=>{});for(const n in e){const r=e[n];Ve&&Ve.MatchesQuery(r,t)&&(s.push(r),i(r))}return s}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(63))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(const i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,s,n,r,o){const l=Fs(e,t,i,s?this.offlineProvider:void 0,n,r,o);return this._activeRequests.push(l),l.onCompleteObservable.add(h=>{this._activeRequests.splice(this._activeRequests.indexOf(h),1)}),l}_loadFileAsync(e,t,i,s,n){return new Promise((r,o)=>{this._loadFile(e,l=>{r(l)},t,i,s,(l,h)=>{o(h)},n)})}_requestFile(e,t,i,s,n,r,o){const l=c0(e,t,i,s?this.offlineProvider:void 0,n,r,o);return this._activeRequests.push(l),l.onCompleteObservable.add(h=>{this._activeRequests.splice(this._activeRequests.indexOf(h),1)}),l}_requestFileAsync(e,t,i,s,n){return new Promise((r,o)=>{this._requestFile(e,l=>{r(l)},t,i,s,l=>{o(l)},n)})}_readFile(e,t,i,s,n){const r=Hn(e,t,i,s,n);return this._activeRequests.push(r),r.onCompleteObservable.add(o=>{this._activeRequests.splice(this._activeRequests.indexOf(o),1)}),r}_readFileAsync(e,t,i){return new Promise((s,n)=>{this._readFile(e,r=>{s(r)},t,i,r=>{n(r)})})}getPerfCollector(){throw Ae("performanceViewerSceneExtension")}}Me.FOGMODE_NONE=0;Me.FOGMODE_EXP=1;Me.FOGMODE_EXP2=2;Me.FOGMODE_LINEAR=3;Me.MinDeltaTime=1;Me.MaxDeltaTime=1e3;Me.prototype.setActiveCameraByID=function(a){return this.setActiveCameraById(a)};Me.prototype.getLastMaterialByID=function(a){return this.getLastMaterialById(a)};Me.prototype.getMaterialByID=function(a){return this.getMaterialById(a)};Me.prototype.getTextureByUniqueID=function(a){return this.getTextureByUniqueId(a)};Me.prototype.getCameraByID=function(a){return this.getCameraById(a)};Me.prototype.getCameraByUniqueID=function(a){return this.getCameraByUniqueId(a)};Me.prototype.getBoneByID=function(a){return this.getBoneById(a)};Me.prototype.getLightByID=function(a){return this.getLightById(a)};Me.prototype.getLightByUniqueID=function(a){return this.getLightByUniqueId(a)};Me.prototype.getParticleSystemByID=function(a){return this.getParticleSystemById(a)};Me.prototype.getGeometryByID=function(a){return this.getGeometryById(a)};Me.prototype.getMeshByID=function(a){return this.getMeshById(a)};Me.prototype.getMeshesByID=function(a){return this.getMeshesById(a)};Me.prototype.getTransformNodeByID=function(a){return this.getTransformNodeById(a)};Me.prototype.getTransformNodeByUniqueID=function(a){return this.getTransformNodeByUniqueId(a)};Me.prototype.getTransformNodesByID=function(a){return this.getTransformNodesById(a)};Me.prototype.getMeshByUniqueID=function(a){return this.getMeshByUniqueId(a)};Me.prototype.getLastMeshByID=function(a){return this.getLastMeshById(a)};Me.prototype.getLastEntryByID=function(a){return this.getLastEntryById(a)};Me.prototype.getNodeByID=function(a){return this.getNodeById(a)};Me.prototype.getLastSkeletonByID=function(a){return this.getLastSkeletonById(a)};class Jd{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new ee,this._onClonedObservable=new ee}}class At{static AddNodeConstructor(e,t){this._NodeConstructors[e]=t}static Construct(e,t,i,s){const n=this._NodeConstructors[e];return n?n(t,i,s):null}set accessibilityTag(e){this._accessibilityTag=e,this.onAccessibilityTagChangedObservable.notifyObservers(e)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return this._nodeDataStorage._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1}set doNotSerialize(e){this._nodeDataStorage._doNotSerialize=e}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(e){if(this._parentNode===e)return;const t=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const i=this._parentNode._children.indexOf(this);i!==-1&&this._parentNode._children.splice(i,1),!e&&!this._nodeDataStorage._isDisposed&&this._addToSceneRootNodes()}this._parentNode=e,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}_serializeAsParent(e){e.parentId=this.uniqueId}_addToSceneRootNodes(){this._nodeDataStorage._sceneRootNodesIndex===-1&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(this._nodeDataStorage._sceneRootNodesIndex!==-1){const e=this._scene.rootNodes,t=e.length-1;e[this._nodeDataStorage._sceneRootNodesIndex]=e[t],e[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}getClassName(){return"Node"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(e,t=null){this._isDirty=!1,this._nodeDataStorage=new Jd,this.state="",this.metadata=null,this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new ee,this._parentContainer=null,this.animations=new Array,this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=N.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new ee,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||Ie.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(e,t=!1){return this._behaviors.indexOf(e)!==-1?this:(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(()=>{e.attach(this)}):e.attach(this),this._behaviors.push(e),this)}removeBehavior(e){const t=this._behaviors.indexOf(e);return t===-1?this:(this._behaviors[t].detach(),this._behaviors.splice(t,1),this)}get behaviors(){return this._behaviors}getBehaviorByName(e){for(const t of this._behaviors)if(t.name===e)return t;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={},this._cache.parent=void 0}updateCache(e){!e&&this.isSynchronized()||(this._cache.parent=this.parent,this._updateCache())}_getActionManagerForTrigger(e,t=!0){return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_updateCache(e){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return this._parentNode?this._parentNode._isDirty||this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0}isSynchronized(){return this._cache.parent!==this._parentNode?(this._cache.parent=this._parentNode,!1):this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()}isReady(e=!1){return this._nodeDataStorage._isReady}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(e=!0){return e===!1?this._nodeDataStorage._isEnabled:this._nodeDataStorage._isEnabled?this._nodeDataStorage._isParentEnabled:!1}_syncParentEnabledState(){this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children&&this._children.forEach(e=>{e._syncParentEnabledState()})}setEnabled(e){this._nodeDataStorage._isEnabled!==e&&(this._nodeDataStorage._isEnabled=e,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(e))}isDescendantOf(e){return this.parent?this.parent===e?!0:this.parent.isDescendantOf(e):!1}_getDescendants(e,t=!1,i){if(this._children)for(let s=0;s(!t||t(s))&&s.cullingStrategy!==void 0),i}getChildren(e,t=!0){return this.getDescendants(t,e)}_setReady(e){if(e!==this._nodeDataStorage._isReady){if(!e){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(e){for(let t=0;t{throw Ae("AnimationRange")};At._NodeConstructors={};F([B()],At.prototype,"name",void 0);F([B()],At.prototype,"id",void 0);F([B()],At.prototype,"uniqueId",void 0);F([B()],At.prototype,"state",void 0);F([B()],At.prototype,"metadata",void 0);class be extends At{get billboardMode(){return this._billboardMode}set billboardMode(e){this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=(this._billboardMode&be.BILLBOARDMODE_USE_POSITION)!==0,this._computeUseBillboardPath())}get preserveParentRotationForBillboard(){return this._preserveParentRotationForBillboard}set preserveParentRotationForBillboard(e){e!==this._preserveParentRotationForBillboard&&(this._preserveParentRotationForBillboard=e,this._computeUseBillboardPath())}_computeUseBillboardPath(){this._cache.useBillboardPath=this._billboardMode!==be.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)}constructor(e,t=null,i=!0){super(e,t),this._forward=new v(0,0,1),this._up=new v(0,1,0),this._right=new v(1,0,0),this._position=v.Zero(),this._rotation=v.Zero(),this._rotationQuaternion=null,this._scaling=v.One(),this._transformToBoneReferal=null,this._isAbsoluteSynced=!1,this._billboardMode=be.BILLBOARDMODE_NONE,this._preserveParentRotationForBillboard=!1,this.scalingDeterminant=1,this._infiniteDistance=!1,this.ignoreNonUniformScaling=!1,this.reIntegrateRotationIntoRotationQuaternion=!1,this._poseMatrix=null,this._localMatrix=N.Zero(),this._usePivotMatrix=!1,this._absolutePosition=v.Zero(),this._absoluteScaling=v.Zero(),this._absoluteRotationQuaternion=ue.Identity(),this._pivotMatrix=N.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new ee,this._nonUniformScaling=!1,i&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(e){this._position=e,this._isDirty=!0}isUsingPivotMatrix(){return this._usePivotMatrix}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._rotationQuaternion=null,this._isDirty=!0}get scaling(){return this._scaling}set scaling(e){this._scaling=e,this._isDirty=!0}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._isDirty=!0}get forward(){return v.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return v.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return v.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(e){return this._poseMatrix?(this._poseMatrix.copyFrom(e),this):(this._poseMatrix=e.clone(),this)}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=N.Identity()),this._poseMatrix}_isSynchronized(){const e=this._cache;return!(this._billboardMode!==e.billboardMode||this._billboardMode!==be.BILLBOARDMODE_NONE||e.pivotMatrixUpdated||this._infiniteDistance||this._position._isDirty||this._scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)}_initCache(){super._initCache();const e=this._cache;e.localMatrixUpdated=!1,e.billboardMode=-1,e.infiniteDistance=!1,e.useBillboardPosition=!1,e.useBillboardPath=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(e){return this.setPivotMatrix(e,!1)}setPivotMatrix(e,t=!0){return this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=N.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(e=null,t,i){const s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);s&&i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.instantiateHierarchy(s,t,i);return s}freezeWorldMatrix(e=null,t=!1){return e?t?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||ue.Identity(),e.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=e,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(e){if(!e)return this;let t,i,s;if(e.x===void 0){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],s=arguments[2]}else t=e.x,i=e.y,s=e.z;if(this.parent){const n=G.Matrix[0];this.parent.getWorldMatrix().invertToRef(n),v.TransformCoordinatesFromFloatsToRef(t,i,s,n,this.position)}else this.position.x=t,this.position.y=i,this.position.z=s;return this._absolutePosition.copyFrom(e),this}setPositionWithLocalVector(e){return this.computeWorldMatrix(),this.position=v.TransformNormal(e,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();const e=G.Matrix[0];return this._localMatrix.invertToRef(e),v.TransformNormal(this.position,e)}locallyTranslate(e){return this.computeWorldMatrix(!0),this.position=v.TransformCoordinates(e,this._localMatrix),this}lookAt(e,t=0,i=0,s=0,n=Nt.LOCAL){const r=be._LookAtVectorCache,o=n===Nt.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(o,r),this.setDirection(r,t,i,s),n===Nt.WORLD&&this.parent)if(this.rotationQuaternion){const l=G.Matrix[0];this.rotationQuaternion.toRotationMatrix(l);const h=G.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(h),h.invert(),l.multiplyToRef(h,l),this.rotationQuaternion.fromRotationMatrix(l)}else{const l=G.Quaternion[0];ue.FromEulerVectorToRef(this.rotation,l);const h=G.Matrix[0];l.toRotationMatrix(h);const c=G.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(c),c.invert(),h.multiplyToRef(c,h),l.fromRotationMatrix(h),l.toEulerAnglesToRef(this.rotation)}return this}getDirection(e){const t=v.Zero();return this.getDirectionToRef(e,t),t}getDirectionToRef(e,t){return v.TransformNormalToRef(e,this.getWorldMatrix(),t),this}setDirection(e,t=0,i=0,s=0){const n=-Math.atan2(e.z,e.x)+Math.PI/2,r=Math.sqrt(e.x*e.x+e.z*e.z),o=-Math.atan2(e.y,r);return this.rotationQuaternion?ue.RotationYawPitchRollToRef(n+t,o+i,s,this.rotationQuaternion):(this.rotation.x=o+i,this.rotation.y=n+t,this.rotation.z=s),this}setPivotPoint(e,t=Nt.LOCAL){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const i=this.getWorldMatrix();if(t==Nt.WORLD){const s=G.Matrix[0];i.invertToRef(s),e=v.TransformCoordinates(e,s)}return this.setPivotMatrix(N.Translation(-e.x,-e.y,-e.z),!0)}getPivotPoint(){const e=v.Zero();return this.getPivotPointToRef(e),e}getPivotPointToRef(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){const e=v.Zero();return this.getAbsolutePivotPointToRef(e),e}getAbsolutePivotPointToRef(e){return this.getPivotPointToRef(e),v.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this}markAsDirty(e){if(this._isDirty)return this;if(this._children)for(const t of this._children)t.markAsDirty(e);return super.markAsDirty(e)}setParent(e,t=!1,i=!1){if(!e&&!this.parent)return this;const s=G.Quaternion[0],n=G.Vector3[0],r=G.Vector3[1],o=G.Matrix[1];N.IdentityToRef(o);const l=G.Matrix[0];this.computeWorldMatrix(!0);let h=this.rotationQuaternion;return h||(h=be._TmpRotation,ue.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,h)),N.ComposeToRef(this.scaling,h,this.position,l),this.parent&&l.multiplyToRef(this.parent.computeWorldMatrix(!0),l),e&&(e.computeWorldMatrix(!0).invertToRef(o),l.multiplyToRef(o,l)),l.decompose(r,s,n,t?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(s):s.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(r),this.position.copyFrom(n),this.parent=e,i&&this.setPivotMatrix(N.Identity()),this}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(e){return this._nonUniformScaling===e?!1:(this._nonUniformScaling=e,!0)}attachToBone(e,t){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(),e.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(e=!1){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,e?this.parent=this._currentParentWhenAttachingToBone:this.parent=null,this):(e&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(e,t,i){e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0));let s;if(!i||i===Nt.LOCAL)s=ue.RotationAxisToRef(e,t,be._RotationAxisCache),this.rotationQuaternion.multiplyToRef(s,this.rotationQuaternion);else{if(this.parent){const n=G.Matrix[0];this.parent.getWorldMatrix().invertToRef(n),e=v.TransformNormal(e,n)}s=ue.RotationAxisToRef(e,t,be._RotationAxisCache),s.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=ue.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const s=G.Vector3[0],n=G.Vector3[1],r=G.Vector3[2],o=G.Quaternion[0],l=G.Matrix[0],h=G.Matrix[1],c=G.Matrix[2],u=G.Matrix[3];return e.subtractToRef(this.position,s),N.TranslationToRef(s.x,s.y,s.z,l),N.TranslationToRef(-s.x,-s.y,-s.z,h),N.RotationAxisToRef(t,i,c),h.multiplyToRef(c,u),u.multiplyToRef(l,u),u.decompose(n,o,r),this.position.addInPlace(r),o.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(e,t,i){const s=e.scale(t);if(!i||i===Nt.LOCAL){const n=this.getPositionExpressedInLocalSpace().add(s);this.setPositionWithLocalVector(n)}else this.setAbsolutePosition(this.getAbsolutePosition().add(s));return this}addRotation(e,t,i){let s;this.rotationQuaternion?s=this.rotationQuaternion:(s=G.Quaternion[1],ue.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s));const n=G.Quaternion[0];return ue.RotationYawPitchRollToRef(t,e,i,n),s.multiplyInPlace(n),this.rotationQuaternion||s.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==be.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard}computeWorldMatrix(e=!1,t=null){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const i=this.getScene().getRenderId();if(!this._isDirty&&!e&&(this._currentRenderId===i||this.isSynchronized()))return this._currentRenderId=i,this._worldMatrix;t=t||this.getScene().activeCamera,this._updateCache();const s=this._cache;s.pivotMatrixUpdated=!1,s.billboardMode=this.billboardMode,s.infiniteDistance=this.infiniteDistance,s.parent=this._parentNode,this._currentRenderId=i,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const n=this._getEffectiveParent(),r=be._TmpScaling;let o=this._position;if(this._infiniteDistance&&!this.parent&&t){const h=t.getWorldMatrix(),c=new v(h.m[12],h.m[13],h.m[14]);o=be._TmpTranslation,o.copyFromFloats(this._position.x+c.x,this._position.y+c.y,this._position.z+c.z)}r.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant);let l;if(this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,l=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(ue.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(l=be._TmpRotation,ue.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),this._usePivotMatrix){const h=G.Matrix[1];N.ScalingToRef(r.x,r.y,r.z,h);const c=G.Matrix[0];l.toRotationMatrix(c),this._pivotMatrix.multiplyToRef(h,G.Matrix[4]),G.Matrix[4].multiplyToRef(c,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(o.x,o.y,o.z)}else N.ComposeToRef(r,l,o,this._localMatrix);if(n&&n.getWorldMatrix){if(e&&n.computeWorldMatrix(e),s.useBillboardPath){this._transformToBoneReferal?n.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),G.Matrix[7]):G.Matrix[7].copyFrom(n.getWorldMatrix());const h=G.Vector3[5],c=G.Vector3[6],u=G.Quaternion[0];G.Matrix[7].decompose(c,u,h),N.ScalingToRef(c.x,c.y,c.z,G.Matrix[7]),G.Matrix[7].setTranslation(h),be.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(u,h),this._localMatrix.setTranslation(h)),this._localMatrix.multiplyToRef(G.Matrix[7],this._worldMatrix)}else this._transformToBoneReferal?(this._localMatrix.multiplyToRef(n.getWorldMatrix(),G.Matrix[6]),G.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(n.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(s.useBillboardPath&&t&&this.billboardMode&&!s.useBillboardPosition){const h=G.Vector3[0];if(this._worldMatrix.getTranslationToRef(h),G.Matrix[1].copyFrom(t.getViewMatrix()),G.Matrix[1].setTranslationFromFloats(0,0,0),G.Matrix[1].invertToRef(G.Matrix[0]),(this.billboardMode&be.BILLBOARDMODE_ALL)!==be.BILLBOARDMODE_ALL){G.Matrix[0].decompose(void 0,G.Quaternion[0],void 0);const c=G.Vector3[1];G.Quaternion[0].toEulerAnglesToRef(c),(this.billboardMode&be.BILLBOARDMODE_X)!==be.BILLBOARDMODE_X&&(c.x=0),(this.billboardMode&be.BILLBOARDMODE_Y)!==be.BILLBOARDMODE_Y&&(c.y=0),(this.billboardMode&be.BILLBOARDMODE_Z)!==be.BILLBOARDMODE_Z&&(c.z=0),N.RotationYawPitchRollToRef(c.y,c.x,c.z,G.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(G.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(G.Vector3[0])}else if(s.useBillboardPath&&t&&s.useBillboardPosition){const h=G.Vector3[0];this._worldMatrix.getTranslationToRef(h);const c=t.globalPosition;this._worldMatrix.invertToRef(G.Matrix[1]);const u=G.Vector3[1];v.TransformCoordinatesToRef(c,G.Matrix[1],u),u.normalize();const d=-Math.atan2(u.z,u.x)+Math.PI/2,_=Math.sqrt(u.x*u.x+u.z*u.z),f=-Math.atan2(u.y,_);if(ue.RotationYawPitchRollToRef(d,f,0,G.Quaternion[0]),(this.billboardMode&be.BILLBOARDMODE_ALL)!==be.BILLBOARDMODE_ALL){const g=G.Vector3[1];G.Quaternion[0].toEulerAnglesToRef(g),(this.billboardMode&be.BILLBOARDMODE_X)!==be.BILLBOARDMODE_X&&(g.x=0),(this.billboardMode&be.BILLBOARDMODE_Y)!==be.BILLBOARDMODE_Y&&(g.y=0),(this.billboardMode&be.BILLBOARDMODE_Z)!==be.BILLBOARDMODE_Z&&(g.z=0),N.RotationYawPitchRollToRef(g.y,g.x,g.z,G.Matrix[0])}else N.FromQuaternionToRef(G.Quaternion[0],G.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(G.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(G.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):n&&n._nonUniformScaling?this._updateNonUniformScalingState(n._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=N.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if(this.computeWorldMatrix(),e){const t=this.getChildren();for(let i=0;inew be(e,this.getScene()),this);if(s.name=e,s.id=e,t&&(s.parent=t),!i){const n=this.getDescendants(!0);for(let r=0;rnew be(e.name,t),e,t,i);return e.localMatrix?s.setPreTransformMatrix(N.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(N.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s._waitingParsedUniqueId=e.uniqueId,e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),s}getChildTransformNodes(e,t){const i=[];return this._getDescendants(i,e,s=>(!t||t(s))&&s instanceof be),i}dispose(e,t=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const i=this._parentContainer.transformNodes.indexOf(this);i>-1&&this._parentContainer.transformNodes.splice(i,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),e){const i=this.getChildTransformNodes(!0);for(const s of i)s.parent=null,s.computeWorldMatrix(!0)}super.dispose(e,t)}normalizeToUnitCube(e=!0,t=!1,i){let s=null,n=null;t&&(this.rotationQuaternion?(n=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(s=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const r=this.getHierarchyBoundingVectors(e,i),o=r.max.subtract(r.min),l=Math.max(o.x,o.y,o.z);if(l===0)return this;const h=1/l;return this.scaling.scaleInPlace(h),t&&(this.rotationQuaternion&&n?this.rotationQuaternion.copyFrom(n):this.rotation&&s&&this.rotation.copyFrom(s)),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}}be.BILLBOARDMODE_NONE=0;be.BILLBOARDMODE_X=1;be.BILLBOARDMODE_Y=2;be.BILLBOARDMODE_Z=4;be.BILLBOARDMODE_ALL=7;be.BILLBOARDMODE_USE_POSITION=128;be.BillboardUseParentOrientation=!1;be._TmpRotation=ue.Zero();be._TmpScaling=v.Zero();be._TmpTranslation=v.Zero();be._LookAtVectorCache=new v(0,0,0);be._RotationAxisCache=new ue;F([wi("position")],be.prototype,"_position",void 0);F([wi("rotation")],be.prototype,"_rotation",void 0);F([xd("rotationQuaternion")],be.prototype,"_rotationQuaternion",void 0);F([wi("scaling")],be.prototype,"_scaling",void 0);F([B("billboardMode")],be.prototype,"_billboardMode",void 0);F([B()],be.prototype,"scalingDeterminant",void 0);F([B("infiniteDistance")],be.prototype,"_infiniteDistance",void 0);F([B()],be.prototype,"ignoreNonUniformScaling",void 0);F([B()],be.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0);function ka(a,e,t){try{const i=a.next();i.done?e(i):i.value?i.value.then(()=>{i.value=void 0,e(i)},t):e(i)}catch(i){t(i)}}function ef(a=25){let e;return(t,i,s)=>{const n=performance.now();e===void 0||n-e>a?(e=n,setTimeout(()=>{ka(t,i,s)},0)):ka(t,i,s)}}function Ll(a,e,t,i,s){const n=()=>{let r;const o=l=>{l.done?t(l.value):r===void 0?r=!0:n()};do r=void 0,!s||!s.aborted?e(a,o,i):i(new Error("Aborted")),r===void 0&&(r=!1);while(r)};n()}function T0(a,e){let t;return Ll(a,ka,i=>t=i,i=>{throw i},e),t}function tf(a,e,t){return new Promise((i,s)=>{Ll(a,e,i,s,t)})}function sf(a,e){return(...t)=>T0(a(...t),e)}class de extends At{get position(){return this._position}set position(e){this._position=e}set upVector(e){this._upVector=e}get upVector(){return this._upVector}get screenArea(){var e,t,i,s;let n=0,r=0;if(this.mode===de.PERSPECTIVE_CAMERA)this.fovMode===de.FOVMODE_VERTICAL_FIXED?(r=this.minZ*2*Math.tan(this.fov/2),n=this.getEngine().getAspectRatio(this)*r):(n=this.minZ*2*Math.tan(this.fov/2),r=n/this.getEngine().getAspectRatio(this));else{const o=this.getEngine().getRenderWidth()/2,l=this.getEngine().getRenderHeight()/2;n=((e=this.orthoRight)!==null&&e!==void 0?e:o)-((t=this.orthoLeft)!==null&&t!==void 0?t:-o),r=((i=this.orthoTop)!==null&&i!==void 0?i:l)-((s=this.orthoBottom)!==null&&s!==void 0?s:-l)}return n*r}set orthoLeft(e){this._orthoLeft=e;for(const t of this._rigCameras)t.orthoLeft=e}get orthoLeft(){return this._orthoLeft}set orthoRight(e){this._orthoRight=e;for(const t of this._rigCameras)t.orthoRight=e}get orthoRight(){return this._orthoRight}set orthoBottom(e){this._orthoBottom=e;for(const t of this._rigCameras)t.orthoBottom=e}get orthoBottom(){return this._orthoBottom}set orthoTop(e){this._orthoTop=e;for(const t of this._rigCameras)t.orthoTop=e}get orthoTop(){return this._orthoTop}set mode(e){this._mode=e;for(const t of this._rigCameras)t.mode=e}get mode(){return this._mode}constructor(e,t,i,s=!0){super(e,i),this._position=v.Zero(),this._upVector=v.Up(),this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=.8,this.projectionPlaneTilt=0,this.minZ=1,this.maxZ=1e4,this.inertia=.9,this._mode=de.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new mn(0,0,1,1),this.layerMask=268435455,this.fovMode=de.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=de.RIG_MODE_NONE,this.customRenderTargets=new Array,this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new ee,this.onProjectionMatrixChangedObservable=new ee,this.onAfterCheckInputsObservable=new ee,this.onRestoreStateObservable=new ee,this.isRigCamera=!1,this._rigCameras=new Array,this._webvrViewMatrix=N.Identity(),this._skipRendering=!1,this._projectionMatrix=new N,this._postProcesses=new Array,this._activeMeshes=new qt(256),this._globalPosition=v.Zero(),this._computedViewMatrix=N.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=N.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=ue.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.getScene().addCamera(this),s&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=t,this.renderPassId=this.getScene().getEngine().createRenderPassId("Camera ".concat(e))}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}_restoreStateValues(){return this._stateStored?(this.fov=this._storedFov,!0):!1}restoreState(){return this._restoreStateValues()?(this.onRestoreStateObservable.notifyObservers(this),!0):!1}getClassName(){return"Camera"}toString(e){let t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(let i=0;i-1?(H.Error("You're trying to reuse a post process not defined as reusable."),0):(t==null||t<0?this._postProcesses.push(e):this._postProcesses[t]===null?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(e))}detachPostProcess(e){const t=this._postProcesses.indexOf(e);t!==-1&&(this._postProcesses[t]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return N.Identity()}getViewMatrix(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._computedViewMatrix)}freezeProjectionMatrix(e){this._doNotComputeProjectionMatrix=!0,e!==void 0&&(this._projectionMatrix=e)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(e){var t,i,s,n,r,o,l,h;if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;const c=this.getEngine(),u=this.getScene(),d=c.useReverseDepthBuffer;if(this.mode===de.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=c.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let _;u.useRightHandedSystem?_=N.PerspectiveFovRHToRef:_=N.PerspectiveFovLHToRef,_(this.fov,c.getAspectRatio(this),d?this.maxZ:this.minZ,d?this.minZ:this.maxZ,this._projectionMatrix,this.fovMode===de.FOVMODE_VERTICAL_FIXED,c.isNDCHalfZRange,this.projectionPlaneTilt,d)}else{const _=c.getRenderWidth()/2,f=c.getRenderHeight()/2;u.useRightHandedSystem?N.OrthoOffCenterRHToRef((t=this.orthoLeft)!==null&&t!==void 0?t:-_,(i=this.orthoRight)!==null&&i!==void 0?i:_,(s=this.orthoBottom)!==null&&s!==void 0?s:-f,(n=this.orthoTop)!==null&&n!==void 0?n:f,d?this.maxZ:this.minZ,d?this.minZ:this.maxZ,this._projectionMatrix,c.isNDCHalfZRange):N.OrthoOffCenterLHToRef((r=this.orthoLeft)!==null&&r!==void 0?r:-_,(o=this.orthoRight)!==null&&o!==void 0?o:_,(l=this.orthoBottom)!==null&&l!==void 0?l:-f,(h=this.orthoTop)!==null&&h!==void 0?h:f,d?this.maxZ:this.minZ,d?this.minZ:this.maxZ,this._projectionMatrix,c.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.renderWidth=c.getRenderWidth(),this._cache.renderHeight=c.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?Ri.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Ri.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(e,t=!1){if(this._updateFrustumPlanes(),t&&this.rigCameras.length>0){let i=!1;return this.rigCameras.forEach(s=>{s._updateFrustumPlanes(),i=i||e.isInFrustum(s._frustumPlanes)}),i}else return e.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(e=100,t,i){throw Ae("Ray")}getForwardRayToRef(e,t=100,i,s){throw Ae("Ray")}dispose(e,t=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const s=this._rigCameras.pop();s&&s.dispose()}if(this._parentContainer){const s=this._parentContainer.cameras.indexOf(this);s>-1&&this._parentContainer.cameras.splice(s,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==de.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let s=this._postProcesses.length;for(;--s>=0;){const n=this._postProcesses[s];n&&n.dispose(this)}}let i=this.customRenderTargets.length;for(;--i>=0;)this.customRenderTargets[i].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(e,t)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(e,t){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){const i=this._rigCameras.pop();i&&i.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=t.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=re.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==de.RIG_MODE_NONE){const i=this.createRigCamera(this.name+"_L",0);i&&(i._isLeftCamera=!0);const s=this.createRigCamera(this.name+"_R",1);s&&(s._isRightCamera=!0),i&&s&&(this._rigCameras.push(i),this._rigCameras.push(s))}this._setRigMode(t),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(e){}_getVRProjectionMatrix(){return N.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}_updateCameraRotationMatrix(){}_updateWebVRCameraRotationMatrix(){}_getWebVRProjectionMatrix(){return N.Identity()}_getWebVRViewMatrix(){return N.Identity()}setCameraRigParameter(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,e==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=re.ToRadians(t/.0637))}createRigCamera(e,t){return null}_updateRigCameras(){for(let e=0;ede._CreateDefaultParsedCamera(t,i))}computeWorldMatrix(){return this.getWorldMatrix()}static Parse(e,t){const i=e.type,s=de.GetConstructorFromName(i,e.name,t,e.interaxial_distance,e.isStereoscopicSideBySide),n=Se.Parse(s,e,t);if(e.parentId!==void 0&&(n._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),n.inputs&&(n.inputs.parse(e),n._setupInputs()),e.upVector&&(n.upVector=v.FromArray(e.upVector)),n.setPosition&&(n.position.copyFromFloats(0,0,0),n.setPosition(v.FromArray(e.position))),e.target&&n.setTarget&&n.setTarget(v.FromArray(e.target)),e.cameraRigMode){const r=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};n.setCameraRigMode(e.cameraRigMode,r)}if(e.animations){for(let r=0;r{throw Ae("UniversalCamera")};de.PERSPECTIVE_CAMERA=0;de.ORTHOGRAPHIC_CAMERA=1;de.FOVMODE_VERTICAL_FIXED=0;de.FOVMODE_HORIZONTAL_FIXED=1;de.RIG_MODE_NONE=0;de.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10;de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11;de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12;de.RIG_MODE_STEREOSCOPIC_OVERUNDER=13;de.RIG_MODE_STEREOSCOPIC_INTERLACED=14;de.RIG_MODE_VR=20;de.RIG_MODE_WEBVR=21;de.RIG_MODE_CUSTOM=22;de.ForceAttachControlToAlwaysPreventDefault=!1;F([wi("position")],de.prototype,"_position",void 0);F([wi("upVector")],de.prototype,"_upVector",void 0);F([B()],de.prototype,"orthoLeft",null);F([B()],de.prototype,"orthoRight",null);F([B()],de.prototype,"orthoBottom",null);F([B()],de.prototype,"orthoTop",null);F([B()],de.prototype,"fov",void 0);F([B()],de.prototype,"projectionPlaneTilt",void 0);F([B()],de.prototype,"minZ",void 0);F([B()],de.prototype,"maxZ",void 0);F([B()],de.prototype,"inertia",void 0);F([B()],de.prototype,"mode",null);F([B()],de.prototype,"layerMask",void 0);F([B()],de.prototype,"fovMode",void 0);F([B()],de.prototype,"cameraRigMode",void 0);F([B()],de.prototype,"interaxialDistance",void 0);F([B()],de.prototype,"isStereoscopicSideBySide",void 0);class J{constructor(){this._applyTo=sf(this._applyToCoroutine.bind(this))}set(e,t){switch(e.length||H.Warn("Setting vertex data kind '".concat(t,"' with an empty array")),t){case A.PositionKind:this.positions=e;break;case A.NormalKind:this.normals=e;break;case A.TangentKind:this.tangents=e;break;case A.UVKind:this.uvs=e;break;case A.UV2Kind:this.uvs2=e;break;case A.UV3Kind:this.uvs3=e;break;case A.UV4Kind:this.uvs4=e;break;case A.UV5Kind:this.uvs5=e;break;case A.UV6Kind:this.uvs6=e;break;case A.ColorKind:this.colors=e;break;case A.MatricesIndicesKind:this.matricesIndices=e;break;case A.MatricesWeightsKind:this.matricesWeights=e;break;case A.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case A.MatricesWeightsExtraKind:this.matricesWeightsExtra=e;break}}applyToMesh(e,t){return this._applyTo(e,t,!1),this}applyToGeometry(e,t){return this._applyTo(e,t,!1),this}updateMesh(e){return this._update(e),this}updateGeometry(e){return this._update(e),this}*_applyToCoroutine(e,t=!1,i){return this.positions&&(e.setVerticesData(A.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(A.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(A.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(A.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(A.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(A.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(A.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(A.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(A.UV6Kind,this.uvs6,t),i&&(yield)),this.colors&&(e.setVerticesData(A.ColorKind,this.colors,t),i&&(yield)),this.matricesIndices&&(e.setVerticesData(A.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(A.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(A.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(A.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),this}_update(e,t,i){return this.positions&&e.updateVerticesData(A.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(A.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(A.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(A.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(A.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(A.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(A.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(A.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(A.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(A.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(A.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(A.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(A.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(A.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,s=e.length){const n=G.Vector3[0],r=G.Vector3[1];for(let o=i;o({vertexData:n})):[{vertexData:e}];return T0(this._mergeCoroutine(void 0,s,t,!1,i))}*_mergeCoroutine(e,t,i=!1,s,n){var r,o,l,h;this._validate();const c=t.map(f=>f.vertexData);for(const f of c)if(f._validate(),!this.normals!=!f.normals||!this.tangents!=!f.tangents||!this.uvs!=!f.uvs||!this.uvs2!=!f.uvs2||!this.uvs3!=!f.uvs3||!this.uvs4!=!f.uvs4||!this.uvs5!=!f.uvs5||!this.uvs6!=!f.uvs6||!this.colors!=!f.colors||!this.matricesIndices!=!f.matricesIndices||!this.matricesWeights!=!f.matricesWeights||!this.matricesIndicesExtra!=!f.matricesIndicesExtra||!this.matricesWeightsExtra!=!f.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes");const u=c.reduce((f,g)=>{var p,x;return f+((x=(p=g.indices)===null||p===void 0?void 0:p.length)!==null&&x!==void 0?x:0)},(o=(r=this.indices)===null||r===void 0?void 0:r.length)!==null&&o!==void 0?o:0);let _=n||c.some(f=>f.indices===this.indices)?(l=this.indices)===null||l===void 0?void 0:l.slice():this.indices;if(u>0){let f=(h=_==null?void 0:_.length)!==null&&h!==void 0?h:0;if(_||(_=new Array(u)),_.length!==u){if(Array.isArray(_))_.length=u;else{const p=i||_ instanceof Uint32Array?new Uint32Array(u):new Uint16Array(u);p.set(_),_=p}e&&e.determinant()<0&&J._FlipFaces(_,0,f)}let g=this.positions?this.positions.length/3:0;for(const{vertexData:p,transform:x}of t)if(p.indices){for(let m=0;m[f.vertexData.positions,f.transform])),s&&(yield),this.normals=J._MergeElement(A.NormalKind,this.normals,e,t.map(f=>[f.vertexData.normals,f.transform])),s&&(yield),this.tangents=J._MergeElement(A.TangentKind,this.tangents,e,t.map(f=>[f.vertexData.tangents,f.transform])),s&&(yield),this.uvs=J._MergeElement(A.UVKind,this.uvs,e,t.map(f=>[f.vertexData.uvs,f.transform])),s&&(yield),this.uvs2=J._MergeElement(A.UV2Kind,this.uvs2,e,t.map(f=>[f.vertexData.uvs2,f.transform])),s&&(yield),this.uvs3=J._MergeElement(A.UV3Kind,this.uvs3,e,t.map(f=>[f.vertexData.uvs3,f.transform])),s&&(yield),this.uvs4=J._MergeElement(A.UV4Kind,this.uvs4,e,t.map(f=>[f.vertexData.uvs4,f.transform])),s&&(yield),this.uvs5=J._MergeElement(A.UV5Kind,this.uvs5,e,t.map(f=>[f.vertexData.uvs5,f.transform])),s&&(yield),this.uvs6=J._MergeElement(A.UV6Kind,this.uvs6,e,t.map(f=>[f.vertexData.uvs6,f.transform])),s&&(yield),this.colors=J._MergeElement(A.ColorKind,this.colors,e,t.map(f=>[f.vertexData.colors,f.transform])),s&&(yield),this.matricesIndices=J._MergeElement(A.MatricesIndicesKind,this.matricesIndices,e,t.map(f=>[f.vertexData.matricesIndices,f.transform])),s&&(yield),this.matricesWeights=J._MergeElement(A.MatricesWeightsKind,this.matricesWeights,e,t.map(f=>[f.vertexData.matricesWeights,f.transform])),s&&(yield),this.matricesIndicesExtra=J._MergeElement(A.MatricesIndicesExtraKind,this.matricesIndicesExtra,e,t.map(f=>[f.vertexData.matricesIndicesExtra,f.transform])),s&&(yield),this.matricesWeightsExtra=J._MergeElement(A.MatricesWeightsExtraKind,this.matricesWeightsExtra,e,t.map(f=>[f.vertexData.matricesWeightsExtra,f.transform])),this}static _MergeElement(e,t,i,s){const n=s.filter(l=>l[0]!==null&&l[0]!==void 0);if(!t&&n.length==0)return t;if(!t)return this._MergeElement(e,n[0][0],n[0][1],n.slice(1));const r=n.reduce((l,h)=>l+h[0].length,t.length),o=e===A.PositionKind?J._TransformVector3Coordinates:e===A.NormalKind?J._TransformVector3Normals:e===A.TangentKind?J._TransformVector4Normals:()=>{};if(t instanceof Float32Array){const l=new Float32Array(r);l.set(t),i&&o(l,i,0,t.length);let h=t.length;for(const[c,u]of n)l.set(c,h),u&&o(l,u,h,c.length),h+=c.length;return l}else{const l=new Array(r);for(let c=0;c{const r=A.DeduceStride(s);if(n.length%r!==0)throw new Error("The "+s+"s array count must be a multiple of "+r);return n.length/r},t=e(A.PositionKind,this.positions),i=(s,n)=>{const r=e(s,n);if(r!==t)throw new Error("The "+s+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(A.NormalKind,this.normals),this.tangents&&i(A.TangentKind,this.tangents),this.uvs&&i(A.UVKind,this.uvs),this.uvs2&&i(A.UV2Kind,this.uvs2),this.uvs3&&i(A.UV3Kind,this.uvs3),this.uvs4&&i(A.UV4Kind,this.uvs4),this.uvs5&&i(A.UV5Kind,this.uvs5),this.uvs6&&i(A.UV6Kind,this.uvs6),this.colors&&i(A.ColorKind,this.colors),this.matricesIndices&&i(A.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(A.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(A.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(A.MatricesWeightsExtraKind,this.matricesWeightsExtra)}serialize(){const e={};return this.positions&&(e.positions=this.positions),this.normals&&(e.normals=this.normals),this.tangents&&(e.tangents=this.tangents),this.uvs&&(e.uvs=this.uvs),this.uvs2&&(e.uvs2=this.uvs2),this.uvs3&&(e.uvs3=this.uvs3),this.uvs4&&(e.uvs4=this.uvs4),this.uvs5&&(e.uvs5=this.uvs5),this.uvs6&&(e.uvs6=this.uvs6),this.colors&&(e.colors=this.colors),this.matricesIndices&&(e.matricesIndices=this.matricesIndices,e.matricesIndices._isExpanded=!0),this.matricesWeights&&(e.matricesWeights=this.matricesWeights),this.matricesIndicesExtra&&(e.matricesIndicesExtra=this.matricesIndicesExtra,e.matricesIndicesExtra._isExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=this.matricesWeightsExtra),e.indices=this.indices,e}static ExtractFromMesh(e,t,i){return J._ExtractFrom(e,t,i)}static ExtractFromGeometry(e,t,i){return J._ExtractFrom(e,t,i)}static _ExtractFrom(e,t,i){const s=new J;return e.isVerticesDataPresent(A.PositionKind)&&(s.positions=e.getVerticesData(A.PositionKind,t,i)),e.isVerticesDataPresent(A.NormalKind)&&(s.normals=e.getVerticesData(A.NormalKind,t,i)),e.isVerticesDataPresent(A.TangentKind)&&(s.tangents=e.getVerticesData(A.TangentKind,t,i)),e.isVerticesDataPresent(A.UVKind)&&(s.uvs=e.getVerticesData(A.UVKind,t,i)),e.isVerticesDataPresent(A.UV2Kind)&&(s.uvs2=e.getVerticesData(A.UV2Kind,t,i)),e.isVerticesDataPresent(A.UV3Kind)&&(s.uvs3=e.getVerticesData(A.UV3Kind,t,i)),e.isVerticesDataPresent(A.UV4Kind)&&(s.uvs4=e.getVerticesData(A.UV4Kind,t,i)),e.isVerticesDataPresent(A.UV5Kind)&&(s.uvs5=e.getVerticesData(A.UV5Kind,t,i)),e.isVerticesDataPresent(A.UV6Kind)&&(s.uvs6=e.getVerticesData(A.UV6Kind,t,i)),e.isVerticesDataPresent(A.ColorKind)&&(s.colors=e.getVerticesData(A.ColorKind,t,i)),e.isVerticesDataPresent(A.MatricesIndicesKind)&&(s.matricesIndices=e.getVerticesData(A.MatricesIndicesKind,t,i)),e.isVerticesDataPresent(A.MatricesWeightsKind)&&(s.matricesWeights=e.getVerticesData(A.MatricesWeightsKind,t,i)),e.isVerticesDataPresent(A.MatricesIndicesExtraKind)&&(s.matricesIndicesExtra=e.getVerticesData(A.MatricesIndicesExtraKind,t,i)),e.isVerticesDataPresent(A.MatricesWeightsExtraKind)&&(s.matricesWeightsExtra=e.getVerticesData(A.MatricesWeightsExtraKind,t,i)),s.indices=e.getIndices(t,i),s}static CreateRibbon(e){throw Ae("ribbonBuilder")}static CreateBox(e){throw Ae("boxBuilder")}static CreateTiledBox(e){throw Ae("tiledBoxBuilder")}static CreateTiledPlane(e){throw Ae("tiledPlaneBuilder")}static CreateSphere(e){throw Ae("sphereBuilder")}static CreateCylinder(e){throw Ae("cylinderBuilder")}static CreateTorus(e){throw Ae("torusBuilder")}static CreateLineSystem(e){throw Ae("linesBuilder")}static CreateDashedLines(e){throw Ae("linesBuilder")}static CreateGround(e){throw Ae("groundBuilder")}static CreateTiledGround(e){throw Ae("groundBuilder")}static CreateGroundFromHeightMap(e){throw Ae("groundBuilder")}static CreatePlane(e){throw Ae("planeBuilder")}static CreateDisc(e){throw Ae("discBuilder")}static CreatePolygon(e,t,i,s,n,r,o){throw Ae("polygonBuilder")}static CreateIcoSphere(e){throw Ae("icoSphereBuilder")}static CreatePolyhedron(e){throw Ae("polyhedronBuilder")}static CreateCapsule(e={orientation:v.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw Ae("capsuleBuilder")}static CreateTorusKnot(e){throw Ae("torusKnotBuilder")}static ComputeNormals(e,t,i,s){let n=0,r=0,o=0,l=0,h=0,c=0,u=0,d=0,_=0,f=0,g=0,p=0,x=0,m=0,T=0,S=0,b=0,y=0,E=0,P=0,C=!1,R=!1,w=!1,D=!1,W=1,L=0,z=null;s&&(C=!!s.facetNormals,R=!!s.facetPositions,w=!!s.facetPartitioning,W=s.useRightHandedSystem===!0?-1:1,L=s.ratio||0,D=!!s.depthSort,z=s.distanceTo,D&&z===void 0&&(z=v.Zero()));let K=0,ae=0,$=0,U=0;for(w&&s&&s.bbSize&&(K=s.subDiv.X*L/s.bbSize.x,ae=s.subDiv.Y*L/s.bbSize.y,$=s.subDiv.Z*L/s.bbSize.z,U=s.subDiv.max*s.subDiv.max,s.facetPartitioning.length=0),n=0;n!Array.isArray(a))],J,"_TransformVector3Coordinates",null);F([Os.filter((...[a])=>!Array.isArray(a))],J,"_TransformVector3Normals",null);F([Os.filter((...[a])=>!Array.isArray(a))],J,"_TransformVector4Normals",null);F([Os.filter((...[a])=>!Array.isArray(a))],J,"_FlipFaces",null);class Va{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0}}class os{constructor(e,t,i){this.vectors=kt.BuildArray(8,v.Zero),this.center=v.Zero(),this.centerWorld=v.Zero(),this.extendSize=v.Zero(),this.extendSizeWorld=v.Zero(),this.directions=kt.BuildArray(3,v.Zero),this.vectorsWorld=kt.BuildArray(8,v.Zero),this.minimumWorld=v.Zero(),this.maximumWorld=v.Zero(),this.minimum=v.Zero(),this.maximum=v.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){const s=e.x,n=e.y,r=e.z,o=t.x,l=t.y,h=t.z,c=this.vectors;this.minimum.copyFromFloats(s,n,r),this.maximum.copyFromFloats(o,l,h),c[0].copyFromFloats(s,n,r),c[1].copyFromFloats(o,l,h),c[2].copyFromFloats(o,n,r),c[3].copyFromFloats(s,l,r),c[4].copyFromFloats(s,n,h),c[5].copyFromFloats(o,l,r),c[6].copyFromFloats(s,l,h),c[7].copyFromFloats(o,n,h),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||N.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=os._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const n=s*e,r=i.scaleInPlace(n*.5),o=this.center.subtractToRef(r,t[1]),l=this.center.addToRef(r,t[2]);return this.reConstruct(o,l,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,i=this.maximumWorld,s=this.directions,n=this.vectorsWorld,r=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let o=0;o<8;++o)n[o].copyFrom(r[o]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let o=0;o<8;++o){const l=n[o];v.TransformCoordinatesToRef(r[o],e,l),t.minimizeInPlace(l),i.maximizeInPlace(l)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}v.FromArrayToRef(e.m,0,s[0]),v.FromArrayToRef(e.m,4,s[1]),v.FromArrayToRef(e.m,8,s[2]),this._worldMatrix=e}isInFrustum(e){return os.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return os.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,i=this.maximumWorld,s=t.x,n=t.y,r=t.z,o=i.x,l=i.y,h=i.z,c=e.x,u=e.y,d=e.z,_=-Ge;return!(o-c<_||_>c-s||l-u<_||_>u-n||h-d<_||_>d-r)}intersectsSphere(e){return os.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const i=this.minimumWorld,s=this.maximumWorld,n=i.x,r=i.y,o=i.z,l=s.x,h=s.y,c=s.z,u=e.x,d=e.y,_=e.z,f=t.x,g=t.y,p=t.z;return!(lf||hg||c<_||o>p)}dispose(){var e,t;(e=this._drawWrapperFront)===null||e===void 0||e.dispose(),(t=this._drawWrapperBack)===null||t===void 0||t.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const n=os._TmpVector3[0];return v.ClampToRef(i,e,t,n),v.DistanceSquared(i,n)<=s*s}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){const s=t[i];for(let n=0;n<8;++n)if(s.dotCoordinate(e[n])<0)return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let s=!0;const n=t[i];for(let r=0;r<8;++r)if(n.dotCoordinate(e[r])>=0){s=!1;break}if(s)return!1}return!0}}os._TmpVector3=kt.BuildArray(3,v.Zero);class Ys{constructor(e,t,i){this.center=v.Zero(),this.centerWorld=v.Zero(),this.minimum=v.Zero(),this.maximum=v.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const s=v.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=s*.5,this._update(i||N.IdentityReadOnly)}scale(e){const t=this.radius*e,i=Ys._TmpVector3,s=i[0].setAll(t),n=this.center.subtractToRef(s,i[1]),r=this.center.addToRef(s,i[2]);return this.reConstruct(n,r,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{v.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=Ys._TmpVector3[0];v.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){const t=this.centerWorld,i=this.radiusWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=v.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld{const i=v.Dot(e.centerWorld,a),s=Math.abs(v.Dot(e.directions[0],a))*e.extendSize.x,n=Math.abs(v.Dot(e.directions[1],a))*e.extendSize.y,r=Math.abs(v.Dot(e.directions[2],a))*e.extendSize.z,o=s+n+r;t.min=i-o,t.max=i+o},oi=(a,e,t)=>(Mo(a,e,ya),Mo(a,t,Ta),!(ya.min>Ta.max||Ta.min>ya.max));class yi{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new os(e,t,i),this.boundingSphere=new Ys(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){const i=yi._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=yi._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=v.Minimize(this.minimum,e),i=v.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=G.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=G.Vector3[0];return v.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),v.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return(t===2||t===3)&&this.boundingSphere.isCenterInFrustum(e)?!0:this.boundingSphere.isInFrustum(e)?t===1||t===3?!0:this.boundingBox.isInFrustum(e):!1}get diagonalLength(){const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,yi._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!(!this.boundingSphere.centerWorld||!this.boundingSphere.intersectsPoint(e)||!this.boundingBox.intersectsPoint(e))}intersects(e,t){if(!Ys.Intersects(this.boundingSphere,e.boundingSphere)||!os.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!oi(i.directions[0],i,s)||!oi(i.directions[1],i,s)||!oi(i.directions[2],i,s)||!oi(s.directions[0],i,s)||!oi(s.directions[1],i,s)||!oi(s.directions[2],i,s)||!oi(v.Cross(i.directions[0],s.directions[0]),i,s)||!oi(v.Cross(i.directions[0],s.directions[1]),i,s)||!oi(v.Cross(i.directions[0],s.directions[2]),i,s)||!oi(v.Cross(i.directions[1],s.directions[0]),i,s)||!oi(v.Cross(i.directions[1],s.directions[1]),i,s)||!oi(v.Cross(i.directions[1],s.directions[2]),i,s)||!oi(v.Cross(i.directions[2],s.directions[0]),i,s)||!oi(v.Cross(i.directions[2],s.directions[1]),i,s)||!oi(v.Cross(i.directions[2],s.directions[2]),i,s))}}yi._TmpVector3=kt.BuildArray(2,v.Zero);class jr{static extractMinAndMaxIndexed(e,t,i,s,n,r){for(let o=i;o!Array.isArray(a)&&!Array.isArray(e))],jr,"extractMinAndMaxIndexed",null);F([Os.filter((...[a])=>!Array.isArray(a))],jr,"extractMinAndMax",null);function nf(a,e,t,i,s=null){const n=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return jr.extractMinAndMaxIndexed(a,e,t,i,n,r),s&&(n.x-=n.x*s.x+s.y,n.y-=n.y*s.x+s.y,n.z-=n.z*s.x+s.y,r.x+=r.x*s.x+s.y,r.y+=r.y*s.x+s.y,r.z+=r.z*s.x+s.y),{minimum:n,maximum:r}}function Bl(a,e,t,i=null,s){const n=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),jr.extractMinAndMax(a,e,t,s,n,r),i&&(n.x-=n.x*i.x+i.y,n.y-=n.y*i.x+i.y,n.z-=n.z*i.x+i.y,r.x+=r.x*i.x+i.y,r.y+=r.y*i.x+i.y,r.z+=r.z*i.x+i.y),{minimum:n,maximum:r}}class Ii{get materialDefines(){var e;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:(e=this._getDrawWrapper())===null||e===void 0?void 0:e.defines}set materialDefines(e){var t;const i=(t=this._mainDrawWrapperOverride)!==null&&t!==void 0?t:this._getDrawWrapper(void 0,!0);i.defines=e}_getDrawWrapper(e,t=!1){e=e!=null?e:this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new Ns(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0){var i;t&&((i=this._drawWrappers[e])===null||i===void 0||i.dispose()),this._drawWrappers[e]=void 0}get effect(){var e,t;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:(t=(e=this._getDrawWrapper())===null||e===void 0?void 0:e.effect)!==null&&t!==void 0?t:null}get _drawWrapper(){var e;return(e=this._mainDrawWrapperOverride)!==null&&e!==void 0?e:this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,s=!0){const n=this._drawWrapper;n.setEffect(e,t,s),i!==void 0&&(n.materialContext=i),e||(n.defines=null,n.materialContext=void 0)}resetDrawCache(e){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e);return}else for(const t of this._drawWrappers)t==null||t.dispose();this._drawWrappers=[]}static AddToMesh(e,t,i,s,n,r,o,l=!0){return new Ii(e,t,i,s,n,r,o,l)}constructor(e,t,i,s,n,r,o,l=!0,h=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=s,this.indexCount=n,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=r,this._renderingMesh=o||r,h&&r.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=r.subMeshes.length-1,l&&(this.refreshBoundingInfo(),r.computeWorldMatrix(!0))}get IsGlobal(){return this.verticesStart===0&&this.verticesCount===this._mesh.getTotalVertices()&&this.indexStart===0&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){var t;const i=(t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId))!==null&&t!==void 0?t:this._renderingMesh.material;if(i){if(this._isMultiMaterial(i)){const s=i.getSubMaterial(this.materialIndex);return this._currentMaterial!==s&&(this._currentMaterial=s,this.resetDrawCache()),s}}else return e?this._mesh.getScene().defaultMaterial:null;return i}_isMultiMaterial(e){return e.getSubMaterial!==void 0}refreshBoundingInfo(e=null){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(A.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(this.indexStart===0&&this.indexCount===t.length){const s=this._renderingMesh.getBoundingInfo();i={minimum:s.minimum.clone(),maximum:s.maximum.clone()}}else i=nf(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new yi(i.minimum,i.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){const t=this.getBoundingInfo();return t?t.isInFrustum(e,this._mesh.cullingStrategy):!1}isCompletelyInFrustum(e){const t=this.getBoundingInfo();return t?t.isCompletelyInFrustum(e):!1}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){const i=[];for(let s=this.indexStart;sl&&(l=d)}return new Ii(e,o,l-o+1,t,i,s,n,r)}}class Tt{static get ForceFullSceneLoadingForIncremental(){return Tt._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){Tt._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return Tt._ShowLoadingScreen}static set ShowLoadingScreen(e){Tt._ShowLoadingScreen=e}static get loggingLevel(){return Tt._LoggingLevel}static set loggingLevel(e){Tt._LoggingLevel=e}static get CleanBoneMatrixWeights(){return Tt._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){Tt._CleanBoneMatrixWeights=e}}Tt._ForceFullSceneLoadingForIncremental=!1;Tt._ShowLoadingScreen=!0;Tt._CleanBoneMatrixWeights=!1;Tt._LoggingLevel=0;class si{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){const t=new si(si.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,n=null){this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||Ie.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,i?this.setAllVerticesData(i,s):this._totalVertices=0,this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),n&&(this.applyToMesh(n),n.computeWorldMatrix(!0)))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return this.delayLoadState===1||this.delayLoadState===0}get doNotSerialize(){for(let e=0;e0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable)),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const t of this._meshes)t._markSubMeshesAsAttributesDirty()}load(e,t){if(this.delayLoadState!==2){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),e._loadFile(this.delayLoadingFile,i=>{if(!this._delayLoadingFunction)return;this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const s=this._meshes,n=s.length;for(let r=0;r0){for(let s=0;s0){for(let s=0;s0){for(let s=0;s-1&&this._parentContainer.geometries.splice(s,1),this._parentContainer=null}this._isDisposed=!0}copy(e){const t=new J;t.indices=[];const i=this.getIndices();if(i)for(let l=0;l0){const o=new Float32Array(e,r.positionsAttrDesc.offset,r.positionsAttrDesc.count);t.setVerticesData(A.PositionKind,o,!1)}if(r.normalsAttrDesc&&r.normalsAttrDesc.count>0){const o=new Float32Array(e,r.normalsAttrDesc.offset,r.normalsAttrDesc.count);t.setVerticesData(A.NormalKind,o,!1)}if(r.tangetsAttrDesc&&r.tangetsAttrDesc.count>0){const o=new Float32Array(e,r.tangetsAttrDesc.offset,r.tangetsAttrDesc.count);t.setVerticesData(A.TangentKind,o,!1)}if(r.uvsAttrDesc&&r.uvsAttrDesc.count>0){const o=new Float32Array(e,r.uvsAttrDesc.offset,r.uvsAttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs2AttrDesc.offset,r.uvs2AttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs3AttrDesc.offset,r.uvs3AttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs4AttrDesc.offset,r.uvs4AttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs5AttrDesc.offset,r.uvs5AttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs6AttrDesc.offset,r.uvs6AttrDesc.count);if(Ne.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.colorsAttrDesc.offset,r.colorsAttrDesc.count);t.setVerticesData(A.ColorKind,o,!1,r.colorsAttrDesc.stride)}if(r.matricesIndicesAttrDesc&&r.matricesIndicesAttrDesc.count>0){const o=new Int32Array(e,r.matricesIndicesAttrDesc.offset,r.matricesIndicesAttrDesc.count),l=[];for(let h=0;h>8),l.push((c&16711680)>>16),l.push(c>>24&255)}t.setVerticesData(A.MatricesIndicesKind,l,!1)}if(r.matricesIndicesExtraAttrDesc&&r.matricesIndicesExtraAttrDesc.count>0){const o=new Int32Array(e,r.matricesIndicesExtraAttrDesc.offset,r.matricesIndicesExtraAttrDesc.count),l=[];for(let h=0;h>8),l.push((c&16711680)>>16),l.push(c>>24&255)}t.setVerticesData(A.MatricesIndicesExtraKind,l,!1)}if(r.matricesWeightsAttrDesc&&r.matricesWeightsAttrDesc.count>0){const o=new Float32Array(e,r.matricesWeightsAttrDesc.offset,r.matricesWeightsAttrDesc.count);t.setVerticesData(A.MatricesWeightsKind,o,!1)}if(r.indicesAttrDesc&&r.indicesAttrDesc.count>0){const o=new Int32Array(e,r.indicesAttrDesc.offset,r.indicesAttrDesc.count);t.setIndices(o,null)}if(r.subMeshesAttrDesc&&r.subMeshesAttrDesc.count>0){const o=new Int32Array(e,r.subMeshesAttrDesc.offset,r.subMeshesAttrDesc.count*5);t.subMeshes=[];for(let l=0;l>8),r.push((l&16711680)>>16),r.push(l>>24&255)}t.setVerticesData(A.MatricesIndicesKind,r,e.matricesIndices._updatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,t.setVerticesData(A.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable);else{const r=[];for(let o=0;o>8),r.push((l&16711680)>>16),r.push(l>>24&255)}t.setVerticesData(A.MatricesIndicesExtraKind,r,e.matricesIndicesExtra._updatable)}e.matricesWeights&&(si._CleanMatricesWeights(e,t),t.setVerticesData(A.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(A.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let r=0;r-1){const u=t.getScene().getLastSkeletonById(e.skeletonId);if(!u)return;s=u.bones.length}else return;const n=t.getVerticesData(A.MatricesIndicesKind),r=t.getVerticesData(A.MatricesIndicesExtraKind),o=e.matricesWeights,l=e.matricesWeightsExtra,h=e.numBoneInfluencer,c=o.length;for(let u=0;uh-1)&&(_=h-1),d>.001){const f=1/d;for(let g=0;g<4;g++)o[u+g]*=f;if(l)for(let g=0;g<4;g++)l[u+g]*=f}else _>=4?(l[u+_-4]=1-d,r[u+_-4]=s):(o[u+_]=1-d,n[u+_]=s)}t.setVerticesData(A.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(A.MatricesIndicesExtraKind,r)}static Parse(e,t,i){const s=new si(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,Ve&&Ve.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new yi(v.FromArray(e.boundingBoxMinimum),v.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(A.UVKind),e.hasUVs2&&s._delayInfo.push(A.UV2Kind),e.hasUVs3&&s._delayInfo.push(A.UV3Kind),e.hasUVs4&&s._delayInfo.push(A.UV4Kind),e.hasUVs5&&s._delayInfo.push(A.UV5Kind),e.hasUVs6&&s._delayInfo.push(A.UV6Kind),e.hasColors&&s._delayInfo.push(A.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(A.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(A.MatricesWeightsKind),s._delayLoadingFunction=J.ImportVertexData):J.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}class rf{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new v(0,0,0),this._diffPositionForCollisions=new v(0,0,0),this._collisionResponse=!0}}class af{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=v.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class of{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new af,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=null,this._currentLODIsUpToDate=!1,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new rf,this._enableDistantPicking=!1,this._rawBoundingInfo=null}}class ei extends be{static get BILLBOARDMODE_NONE(){return be.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return be.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return be.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return be.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return be.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return be.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(e){this._internalAbstractMeshDataInfo._collisionRetryCount=e}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(e){this._internalAbstractMeshDataInfo._morphTargetManager!==e&&(this._internalAbstractMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(e){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==e&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=e,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(e){return super._updateNonUniformScalingState(e)?(this._markSubMeshesAsMiscDirty(),!0):!1}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(e){this._internalAbstractMeshDataInfo._rawBoundingInfo=e}set onCollide(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)}set onCollisionPositionChange(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(e){if(this._internalAbstractMeshDataInfo._visibility===e)return;const t=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=e,(t===1&&e!==1||t!==1&&e===1)&&this._markSubMeshesAsMiscDirty()}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(e){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=e}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(e){this._internalAbstractMeshDataInfo._renderingGroupId=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){this._internalAbstractMeshDataInfo._material!==e&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(),this._unBindEffect()))}getMaterialForRenderPass(e){var t;return(t=this._internalAbstractMeshDataInfo._materialForRenderPass)===null||t===void 0?void 0:t[e]}setMaterialForRenderPass(e,t){this.resetDrawCache(e),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]),this._internalAbstractMeshDataInfo._materialForRenderPass[e]=t}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(e){this._internalAbstractMeshDataInfo._enableDistantPicking=e}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(e)?-1:e}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=e}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(e)?-1:e}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(e){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=e}get lightSources(){return this._lightSources}get _positions(){return null}set skeleton(e){const t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(e,t=null){switch(super(e,t,!1),this._internalAbstractMeshDataInfo=new of,this._waitingMaterialId=null,this.cullingStrategy=ei.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new ee,this.onCollisionPositionChangeObservable=new ee,this.onMaterialChangedObservable=new ee,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isVisible=!0,this.isPickable=!0,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=he.Red(),this.outlineWidth=.02,this.overlayColor=he.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new v(.5,1,.5),this.ellipsoidOffset=new v(0,0,0),this.edgesWidth=1,this.edgesColor=new q(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new ee,this._onCollisionPositionChange=(i,s,n=null)=>{s.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>Y.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),n&&this.onCollideObservable.notifyObservers(n),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},t=this.getScene(),t.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new oe(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case Wi.Aggressive:this.doNotSyncBoundingInfo=!0;case Wi.Intermediate:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1;break}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(e){const t=this._uniformBuffer;t.updateMatrix("world",e),t.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),t.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(e){let t="Name: "+this.name+", isInstance: "+(this.getClassName()!=="InstancedMesh"?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==be.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(e,t=!0){if(this.actionManager&&(t||this.actionManager.isRecursive))if(e){if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}else return this.actionManager;return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_rebuild(e=!1){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery!==null&&(this._occlusionQuery=null),!!this.subMeshes)for(const t of this.subMeshes)t._rebuild()}_resyncLightSources(){this._lightSources.length=0;for(const e of this.getScene().lights)e.isEnabled()&&e.canAffectMesh(this)&&this._lightSources.push(e);this._markSubMeshesAsLightDirty()}_resyncLightSource(e){const t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e);let s=!1;if(i===-1){if(!t)return;this._lightSources.push(e)}else{if(t)return;s=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(s)}_unBindEffect(){for(const e of this.subMeshes)e.setEffect(null)}_removeLightSource(e,t){const i=this._lightSources.indexOf(e);i!==-1&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))}_markSubMeshesAsDirty(e){if(this.subMeshes)for(const t of this.subMeshes)for(let i=0;it.markAsLightDirty(e))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(e=>e.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(e=>e.markAsMiscDirty())}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}resetDrawCache(e){if(this.subMeshes)for(const t of this.subMeshes)t.resetDrawCache(e)}get isBlocked(){return!1}getLOD(e){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(e){return null}setVerticesData(e,t,i,s){return this}updateVerticesData(e,t,i,s){return this}setIndices(e,t){return this}isVerticesDataPresent(e){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){var e;return(e=this.rawBoundingInfo)!==null&&e!==void 0?e:this.getBoundingInfo()}setBoundingInfo(e){return this._boundingInfo=e,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(e,t,i){return this._boundingInfo=new yi(e,t,i),this._boundingInfo}normalizeToUnitCube(e=!0,t=!1,i){return super.normalizeToUnitCube(e,t,i)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(A.MatricesIndicesKind)&&this.isVerticesDataPresent(A.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===be.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(e,t,i){return this.position.addInPlace(this.calcMovePOV(e,t,i)),this}calcMovePOV(e,t,i){const s=new N;(this.rotationQuaternion?this.rotationQuaternion:ue.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(s);const r=v.Zero(),o=this.definedFacingForward?-1:1;return v.TransformCoordinatesFromFloatsToRef(e*o,t,i*o,s,r),r}rotatePOV(e,t,i){return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this}calcRotatePOV(e,t,i){const s=this.definedFacingForward?1:-1;return new v(e*s,t,i*s)}refreshBoundingInfo(e=!1,t=!1){return this._boundingInfo&&this._boundingInfo.isLocked?this:(this._refreshBoundingInfo(this._getPositionData(e,t),null),this)}_refreshBoundingInfo(e,t){if(e){const i=Bl(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new yi(i.minimum,i.maximum)}if(this.subMeshes)for(let i=0;i0){const u=h.getPositions();u&&(i[o]+=(u[o]-i[o])*c)}}if(n++,s===A.PositionKind&&this._positions&&n===3){n=0;const l=r*3;this._positions[r++].copyFromFloats(i[l],i[l+1],i[l+2])}}}if(i&&e&&this.skeleton){const n=this.getVerticesData(A.MatricesIndicesKind),r=this.getVerticesData(A.MatricesWeightsKind);if(r&&n){const o=this.numBoneInfluencers>4,l=o?this.getVerticesData(A.MatricesIndicesExtraKind):null,h=o?this.getVerticesData(A.MatricesWeightsExtraKind):null,c=this.skeleton.getTransformMatrices(this),u=G.Vector3[0],d=G.Matrix[0],_=G.Matrix[1];let f=0;for(let g=0;g0&&(N.FromFloat32ArrayToRefScaled(c,Math.floor(n[f+p]*16),x,_),d.addToSelf(_));if(o)for(p=0;p<4;p++)x=h[f+p],x>0&&(N.FromFloat32ArrayToRefScaled(c,Math.floor(l[f+p]*16),x,_),d.addToSelf(_));s===A.NormalKind?v.TransformNormalFromFloatsToRef(i[g],i[g+1],i[g+2],d,u):v.TransformCoordinatesFromFloatsToRef(i[g],i[g+1],i[g+2],d,u),u.toArray(i,g),s===A.PositionKind&&this._positions&&this._positions[g/3].copyFrom(u)}}}return i}getNormalsData(e=!1,t=!1){return this._getData(e,t,null,A.NormalKind)}getPositionData(e=!1,t=!1,i){return this._getData(e,t,i,A.PositionKind)}_getPositionData(e,t){var i;let s=this.getVerticesData(A.PositionKind);if(this._internalAbstractMeshDataInfo._positions&&(this._internalAbstractMeshDataInfo._positions=null),s&&(e&&this.skeleton||t&&this.morphTargetManager)){if(s=s.slice(),this._generatePointsArray(),this._positions){const n=this._positions;this._internalAbstractMeshDataInfo._positions=new Array(n.length);for(let r=0;r1||!s.IsGlobal)&&s.updateBoundingInfo(e)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(e){return this.getBoundingInfo().isInFrustum(e,this.cullingStrategy)}isCompletelyInFrustum(e){return this.getBoundingInfo().isCompletelyInFrustum(e)}intersectsMesh(e,t=!1,i){const s=this.getBoundingInfo(),n=e.getBoundingInfo();if(s.intersects(n,t))return!0;if(i){for(const r of this.getChildMeshes())if(r.intersectsMesh(e,t,!0))return!0}return!1}intersectsPoint(e){return this.getBoundingInfo().intersectsPoint(e)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(e){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=e}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(e){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const i=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=i.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,i.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,e,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId),this}_collideForSubMesh(e,t,i){var s;if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];const n=e.verticesStart,r=e.verticesStart+e.verticesCount;for(let o=n;o1&&!r._checkCollision(e)||this._collideForSubMesh(r,t,e)}return this}_shouldConvertRHS(){return!1}_checkCollision(e){if(!this.getBoundingInfo()._checkCollision(e))return this;const t=G.Matrix[0],i=G.Matrix[1];return N.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this}_generatePointsArray(){return!1}intersects(e,t,i,s=!1,n,r=!1){const o=new cs,l=this.getClassName()==="InstancedLinesMesh"||this.getClassName()==="LinesMesh"?this.intersectionThreshold:0,h=this.getBoundingInfo();if(!this.subMeshes||!r&&(!e.intersectsSphere(h.boundingSphere,l)||!e.intersectsBox(h.boundingBox,l)))return o;if(s)return o.hit=!r,o.pickedMesh=r?null:this,o.distance=r?0:v.Distance(e.origin,h.boundingSphere.center),o.subMeshId=0,o;if(!this._generatePointsArray())return o;let c=null;const u=this._scene.getIntersectingSubMeshCandidates(this,e),d=u.length;let _=!1;for(let f=0;f1&&!g.canIntersects(e))continue;const p=g.intersects(e,this._positions,this.getIndices(),t,i);if(p&&(t||!c||p.distance{let o=r.includedOnlyMeshes.indexOf(this);o!==-1&&r.includedOnlyMeshes.splice(o,1),o=r.excludedMeshes.indexOf(this),o!==-1&&r.excludedMeshes.splice(o,1);const l=r.getShadowGenerators();if(l){const h=l.values();for(let c=h.next();c.done!==!0;c=h.next()){const d=c.value.getShadowMap();d&&d.renderList&&(o=d.renderList.indexOf(this),o!==-1&&d.renderList.splice(o,1))}}}),(this.getClassName()!=="InstancedMesh"||this.getClassName()!=="InstancedLinesMesh")&&this.releaseSubMeshes();const n=this.getScene().getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,n.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),n.wipeCaches(),this.getScene().removeMesh(this),this._parentContainer){const r=this._parentContainer.meshes.indexOf(this);r>-1&&this._parentContainer.meshes.splice(r,1),this._parentContainer=null}if(t&&this.material&&(this.material.getClassName()==="MultiMaterial"?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!e)for(i=0;i65535){o=!0;break}o?e.depthSortedIndices=new Uint32Array(i):e.depthSortedIndices=new Uint16Array(i)}if(e.facetDepthSortFunction=function(o,l){return l.sqDistance-o.sqDistance},!e.facetDepthSortFrom){const o=this.getScene().activeCamera;e.facetDepthSortFrom=o?o.position:v.Zero()}e.depthSortedFacets=[];for(let o=0;oGe?n.maximum.x-n.minimum.x:Ge,e.bbSize.y=n.maximum.y-n.minimum.y>Ge?n.maximum.y-n.minimum.y:Ge,e.bbSize.z=n.maximum.z-n.minimum.z>Ge?n.maximum.z-n.minimum.z:Ge;let r=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(r=r>e.bbSize.z?r:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/r),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/r),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/r),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=n,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),v.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,s&&J.ComputeNormals(t,i,s,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);const o=e.depthSortedIndices.length/3|0;for(let l=0;ln.subDiv.max||o<0||o>n.subDiv.max||l<0||l>n.subDiv.max?null:n.facetPartitioning[r+n.subDiv.max*o+n.subDiv.max*n.subDiv.max*l]}getClosestFacetAtCoordinates(e,t,i,s,n=!1,r=!0){const o=this.getWorldMatrix(),l=G.Matrix[5];o.invertToRef(l);const h=G.Vector3[8];v.TransformCoordinatesFromFloatsToRef(e,t,i,l,h);const c=this.getClosestFacetAtLocalCoordinates(h.x,h.y,h.z,s,n,r);return s&&v.TransformCoordinatesFromFloatsToRef(s.x,s.y,s.z,o,s),c}getClosestFacetAtLocalCoordinates(e,t,i,s,n=!1,r=!0){let o=null,l=0,h=0,c=0,u=0,d=0,_=0,f=0,g=0;const p=this.getFacetLocalPositions(),x=this.getFacetLocalNormals(),m=this.getFacetsAtLocalCoordinates(e,t,i);if(!m)return null;let T=Number.MAX_VALUE,S=T,b,y,E;for(let P=0;P=0||n&&!r&&u<=0)&&(u=y.x*E.x+y.y*E.y+y.z*E.z,d=-(y.x*e+y.y*t+y.z*i-u)/(y.x*y.x+y.y*y.y+y.z*y.z),_=e+y.x*d,f=t+y.y*d,g=i+y.z*d,l=_-e,h=f-t,c=g-i,S=l*l+h*h+c*c,Se.emitter===this)}}ei.OCCLUSION_TYPE_NONE=0;ei.OCCLUSION_TYPE_OPTIMISTIC=1;ei.OCCLUSION_TYPE_STRICT=2;ei.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0;ei.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1;ei.CULLINGSTRATEGY_STANDARD=0;ei.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1;ei.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2;ei.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3;Vt("BABYLON.AbstractMesh",ei);function S0(a){a.indexOf("vClipPlane")===-1&&a.push("vClipPlane"),a.indexOf("vClipPlane2")===-1&&a.push("vClipPlane2"),a.indexOf("vClipPlane3")===-1&&a.push("vClipPlane3"),a.indexOf("vClipPlane4")===-1&&a.push("vClipPlane4"),a.indexOf("vClipPlane5")===-1&&a.push("vClipPlane5"),a.indexOf("vClipPlane6")===-1&&a.push("vClipPlane6")}function Nl(a,e,t){var i,s,n,r,o,l;const h=!!((i=a.clipPlane)!==null&&i!==void 0?i:e.clipPlane),c=!!((s=a.clipPlane2)!==null&&s!==void 0?s:e.clipPlane2),u=!!((n=a.clipPlane3)!==null&&n!==void 0?n:e.clipPlane3),d=!!((r=a.clipPlane4)!==null&&r!==void 0?r:e.clipPlane4),_=!!((o=a.clipPlane5)!==null&&o!==void 0?o:e.clipPlane5),f=!!((l=a.clipPlane6)!==null&&l!==void 0?l:e.clipPlane6);h&&t.push("#define CLIPPLANE"),c&&t.push("#define CLIPPLANE2"),u&&t.push("#define CLIPPLANE3"),d&&t.push("#define CLIPPLANE4"),_&&t.push("#define CLIPPLANE5"),f&&t.push("#define CLIPPLANE6")}function lf(a,e,t){var i,s,n,r,o,l;let h=!1;const c=!!((i=a.clipPlane)!==null&&i!==void 0?i:e.clipPlane),u=!!((s=a.clipPlane2)!==null&&s!==void 0?s:e.clipPlane2),d=!!((n=a.clipPlane3)!==null&&n!==void 0?n:e.clipPlane3),_=!!((r=a.clipPlane4)!==null&&r!==void 0?r:e.clipPlane4),f=!!((o=a.clipPlane5)!==null&&o!==void 0?o:e.clipPlane5),g=!!((l=a.clipPlane6)!==null&&l!==void 0?l:e.clipPlane6);return t.CLIPPLANE!==c&&(t.CLIPPLANE=c,h=!0),t.CLIPPLANE2!==u&&(t.CLIPPLANE2=u,h=!0),t.CLIPPLANE3!==d&&(t.CLIPPLANE3=d,h=!0),t.CLIPPLANE4!==_&&(t.CLIPPLANE4=_,h=!0),t.CLIPPLANE5!==f&&(t.CLIPPLANE5=f,h=!0),t.CLIPPLANE6!==g&&(t.CLIPPLANE6=g,h=!0),h}function A0(a,e,t){var i,s,n,r,o,l;let h=(i=e.clipPlane)!==null&&i!==void 0?i:t.clipPlane;nn(a,"vClipPlane",h),h=(s=e.clipPlane2)!==null&&s!==void 0?s:t.clipPlane2,nn(a,"vClipPlane2",h),h=(n=e.clipPlane3)!==null&&n!==void 0?n:t.clipPlane3,nn(a,"vClipPlane3",h),h=(r=e.clipPlane4)!==null&&r!==void 0?r:t.clipPlane4,nn(a,"vClipPlane4",h),h=(o=e.clipPlane5)!==null&&o!==void 0?o:t.clipPlane5,nn(a,"vClipPlane5",h),h=(l=e.clipPlane6)!==null&&l!==void 0?l:t.clipPlane6,nn(a,"vClipPlane6",h)}function nn(a,e,t){t&&a.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d)}class we{static BindSceneUniformBuffer(e,t){t.bindToEffect(e,"Scene")}static PrepareDefinesForMergedUV(e,t,i){t._needUVs=!0,t[i]=!0,e.optimizeUVAllocation&&e.getTextureMatrix().isIdentityAs3x2()?(t[i+"DIRECTUV"]=e.coordinatesIndex+1,t["MAINUV"+(e.coordinatesIndex+1)]=!0):t[i+"DIRECTUV"]=0}static BindTextureMatrix(e,t,i){const s=e.getTextureMatrix();t.updateMatrix(i+"Matrix",s)}static GetFogState(e,t){return t.fogEnabled&&e.applyFog&&t.fogMode!==Me.FOGMODE_NONE}static PrepareDefinesForMisc(e,t,i,s,n,r,o){o._areMiscDirty&&(o.LOGARITHMICDEPTH=i,o.POINTSIZE=s,o.FOG=n&&this.GetFogState(e,t),o.NONUNIFORMSCALING=e.nonUniformScaling,o.ALPHATEST=r)}static PrepareDefinesForCamera(e,t){let i=!1;if(e.activeCamera){const s=t.CAMERA_ORTHOGRAPHIC?1:0,n=t.CAMERA_PERSPECTIVE?1:0,r=e.activeCamera.mode===de.ORTHOGRAPHIC_CAMERA?1:0,o=e.activeCamera.mode===de.PERSPECTIVE_CAMERA?1:0;(s^r||n^o)&&(t.CAMERA_ORTHOGRAPHIC=r===1,t.CAMERA_PERSPECTIVE=o===1,i=!0)}return i}static PrepareDefinesForFrameBoundValues(e,t,i,s,n,r=null,o=!1){let l=we.PrepareDefinesForCamera(e,s);r!==!1&&(l=lf(i,e,s)),s.DEPTHPREPASS!==!t.getColorWrite()&&(s.DEPTHPREPASS=!s.DEPTHPREPASS,l=!0),s.INSTANCES!==n&&(s.INSTANCES=n,l=!0),s.THIN_INSTANCES!==o&&(s.THIN_INSTANCES=o,l=!0),l&&s.markAsUnprocessed()}static PrepareDefinesForBones(e,t){if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;const i=t.BONETEXTURE!==void 0;if(e.skeleton.isUsingTextureForMatrices&&i)t.BONETEXTURE=!0;else{t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=i?!1:void 0;const s=e.getScene().prePassRenderer;if(s&&s.enabled){const n=s.excludedSkinnedMesh.indexOf(e)===-1;t.BONES_VELOCITY_ENABLED=n}}}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE!==void 0&&(t.BONETEXTURE=!1)}static PrepareDefinesForMorphTargets(e,t){const i=e.morphTargetManager;i?(t.MORPHTARGETS_UV=i.supportsUVs&&t.UV1,t.MORPHTARGETS_TANGENT=i.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=i.supportsNormals&&t.NORMAL,t.MORPHTARGETS=i.numInfluencers>0,t.NUM_MORPH_INFLUENCERS=i.numInfluencers,t.MORPHTARGETS_TEXTURE=i.isUsingTextureForTargets):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)}static PrepareDefinesForBakedVertexAnimation(e,t){const i=e.bakedVertexAnimationManager;t.BAKED_VERTEX_ANIMATION_TEXTURE=!!(i&&i.isEnabled)}static PrepareDefinesForAttributes(e,t,i,s,n=!1,r=!0,o=!0){if(!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent(A.NormalKind),t._needNormals&&e.isVerticesDataPresent(A.TangentKind)&&(t.TANGENT=!0);for(let l=1;l<=6;++l)t["UV"+l]=t._needUVs?e.isVerticesDataPresent("uv".concat(l===1?"":l)):!1;if(i){const l=e.useVertexColors&&e.isVerticesDataPresent(A.ColorKind);t.VERTEXCOLOR=l,t.VERTEXALPHA=e.hasVertexAlpha&&l&&r}return e.isVerticesDataPresent(A.ColorInstanceKind)&&(e.hasInstances||e.hasThinInstances)&&(t.INSTANCESCOLOR=!0),s&&this.PrepareDefinesForBones(e,t),n&&this.PrepareDefinesForMorphTargets(e,t),o&&this.PrepareDefinesForBakedVertexAnimation(e,t),!0}static PrepareDefinesForMultiview(e,t){if(e.activeCamera){const i=t.MULTIVIEW;t.MULTIVIEW=e.activeCamera.outputRenderTarget!==null&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=i&&t.markAsUnprocessed()}}static PrepareDefinesForOIT(e,t,i){const s=t.ORDER_INDEPENDENT_TRANSPARENCY,n=t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;t.ORDER_INDEPENDENT_TRANSPARENCY=e.useOrderIndependentTransparency&&i,t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!e.getEngine().getCaps().textureFloatLinearFiltering,(s!==t.ORDER_INDEPENDENT_TRANSPARENCY||n!==t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&t.markAsUnprocessed()}static PrepareDefinesForPrePass(e,t,i){const s=t.PREPASS;if(!t._arePrePassDirty)return;const n=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"}];if(e.prePassRenderer&&e.prePassRenderer.enabled&&i){t.PREPASS=!0,t.SCENE_MRT_COUNT=e.prePassRenderer.mrtCount;for(let r=0;r0&&(o.shadowEnabled=!0,h.prepareDefines(n,s))}}i.lightmapMode!=Ke.LIGHTMAP_DEFAULT?(o.lightmapMode=!0,n["LIGHTMAPEXCLUDED"+s]=!0,n["LIGHTMAPNOSPECULAR"+s]=i.lightmapMode==Ke.LIGHTMAP_SHADOWSONLY):(n["LIGHTMAPEXCLUDED"+s]=!1,n["LIGHTMAPNOSPECULAR"+s]=!1)}static PrepareDefinesForLights(e,t,i,s,n=4,r=!1){if(!i._areLightsDirty)return i._needNormals;let o=0;const l={needNormals:i._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!r){for(const c of t.lightSources)if(this.PrepareDefinesForLight(e,t,c,o,i,s,l),o++,o===n)break}i.SPECULARTERM=l.specularEnabled,i.SHADOWS=l.shadowEnabled;for(let c=o;c0&&(n=s+r,t.addFallback(n,"LIGHT"+r)),e.SHADOWS||(e["SHADOW"+r]&&t.addFallback(s,"SHADOW"+r),e["SHADOWPCF"+r]&&t.addFallback(s,"SHADOWPCF"+r),e["SHADOWPCSS"+r]&&t.addFallback(s,"SHADOWPCSS"+r),e["SHADOWPOISSON"+r]&&t.addFallback(s,"SHADOWPOISSON"+r),e["SHADOWESM"+r]&&t.addFallback(s,"SHADOWESM"+r),e["SHADOWCLOSEESM"+r]&&t.addFallback(s,"SHADOWCLOSEESM"+r));return n++}static PrepareAttributesForMorphTargetsInfluencers(e,t,i){this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS=i,this.PrepareAttributesForMorphTargets(e,t,this._TmpMorphInfluencers)}static PrepareAttributesForMorphTargets(e,t,i){const s=i.NUM_MORPH_INFLUENCERS;if(s>0&&Ie.LastCreatedEngine){const n=Ie.LastCreatedEngine.getCaps().maxVertexAttribs,r=t.morphTargetManager;if(r!=null&&r.isUsingTextureForTargets)return;const o=r&&r.supportsNormals&&i.NORMAL,l=r&&r.supportsTangents&&i.TANGENT,h=r&&r.supportsUVs&&i.UV1;for(let c=0;cn&&H.Error("Cannot add more vertex attributes for mesh "+t.name)}}static PrepareAttributesForBakedVertexAnimation(e,t,i){i.BAKED_VERTEX_ANIMATION_TEXTURE&&i.INSTANCES&&e.push("bakedVertexAnimationSettingsInstanced")}static PrepareAttributesForBones(e,t,i,s){i.NUM_BONE_INFLUENCERS>0&&(s.addCPUSkinningFallback(0,t),e.push(A.MatricesIndicesKind),e.push(A.MatricesWeightsKind),i.NUM_BONE_INFLUENCERS>4&&(e.push(A.MatricesIndicesExtraKind),e.push(A.MatricesWeightsExtraKind)))}static PrepareAttributesForInstances(e,t){(t.INSTANCES||t.THIN_INSTANCES)&&this.PushAttributesForInstances(e,!!t.PREPASS_VELOCITY),t.INSTANCESCOLOR&&e.push(A.ColorInstanceKind)}static PushAttributesForInstances(e,t=!1){e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"),t&&(e.push("previousWorld0"),e.push("previousWorld1"),e.push("previousWorld2"),e.push("previousWorld3"))}static BindLightProperties(e,t,i){e.transferToEffect(t,i+"")}static BindLight(e,t,i,s,n,r=!0){e._bindLight(t,i,s,n,r)}static BindLights(e,t,i,s,n=4){const r=Math.min(t.lightSources.length,n);for(let o=0;o-1){const n=s.getTransformMatrixTexture(e);t.setTexture("boneSampler",n),t.setFloat("boneTextureWidth",4*(s.bones.length+1))}else{const n=s.getTransformMatrices(e);n&&(t.setMatrices("mBones",n),i&&e.getScene().prePassRenderer&&e.getScene().prePassRenderer.getIndex(2)&&(i.previousBones[e.uniqueId]||(i.previousBones[e.uniqueId]=n.slice()),t.setMatrices("mPreviousBones",i.previousBones[e.uniqueId]),we._CopyBonesTransformationMatrices(n,i.previousBones[e.uniqueId])))}}}static _CopyBonesTransformationMatrices(e,t){return t.set(e),t}static BindMorphTargetParameters(e,t){const i=e.morphTargetManager;!e||!i||t.setFloatArray("morphTargetInfluences",i.influences)}static BindLogDepth(e,t,i){if(!e||e.LOGARITHMICDEPTH||e.indexOf&&e.indexOf("LOGARITHMICDEPTH")>=0){const s=i.activeCamera;s.mode===de.ORTHOGRAPHIC_CAMERA&&H.Error("Logarithmic depth is not compatible with orthographic cameras!",20),t.setFloat("logarithmicDepthConstant",2/(Math.log(s.maxZ+1)/Math.LN2))}}}we._TmpMorphInfluencers={NUM_MORPH_INFLUENCERS:0};we._TempFogColor=he.Black();class gs{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.func=519,this.funcRef=1,this.funcMask=255,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681}get func(){return this._func}set func(e){this._func=e}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef=e}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask=e}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail=e}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail=e}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass=e}get mask(){return this._mask}set mask(e){this._mask=e}get enabled(){return this._enabled}set enabled(e){this._enabled=e}getClassName(){return"MaterialStencilState"}copyTo(e){Se.Clone(()=>e,this)}serialize(){return Se.Serialize(this)}parse(e,t,i){Se.Parse(()=>this,e,t,i)}}F([B()],gs.prototype,"func",null);F([B()],gs.prototype,"funcRef",null);F([B()],gs.prototype,"funcMask",null);F([B()],gs.prototype,"opStencilFail",null);F([B()],gs.prototype,"opDepthFail",null);F([B()],gs.prototype,"opStencilDepthPass",null);F([B()],gs.prototype,"mask",null);F([B()],gs.prototype,"enabled",null);var Zt;(function(a){a[a.Created=1]="Created",a[a.Disposed=2]="Disposed",a[a.GetDefineNames=4]="GetDefineNames",a[a.PrepareUniformBuffer=8]="PrepareUniformBuffer",a[a.IsReadyForSubMesh=16]="IsReadyForSubMesh",a[a.PrepareDefines=32]="PrepareDefines",a[a.BindForSubMesh=64]="BindForSubMesh",a[a.PrepareEffect=128]="PrepareEffect",a[a.GetAnimatables=256]="GetAnimatables",a[a.GetActiveTextures=512]="GetActiveTextures",a[a.HasTexture=1024]="HasTexture",a[a.FillRenderTargetTextures=2048]="FillRenderTargetTextures",a[a.HasRenderTargetTextures=4096]="HasRenderTargetTextures",a[a.HardBindForSubMesh=8192]="HardBindForSubMesh"})(Zt||(Zt={}));class j{get canRenderToMRT(){return!1}set alpha(e){if(this._alpha===e)return;const t=this._alpha;this._alpha=e,(t===1||e===1)&&this.markAsDirty(j.MiscDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,this.markAsDirty(j.TextureDirtyFlag))}get backFaceCulling(){return this._backFaceCulling}set cullBackFaces(e){this._cullBackFaces!==e&&(this._cullBackFaces=e,this.markAsDirty(j.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(e){this._blockDirtyMechanism!==e&&(this._blockDirtyMechanism=e,e||this.markDirty())}atomicMaterialsUpdate(e){this.blockDirtyMechanism=!0;try{e(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new ee),this._onBindObservable}set onBind(e){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new ee),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new ee),this._onEffectCreatedObservable}set alphaMode(e){this._alphaMode!==e&&(this._alphaMode=e,this.markAsDirty(j.TextureDirtyFlag))}get alphaMode(){return this._alphaMode}set needDepthPrePass(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAsDirty(j.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case j.WireFrameFillMode:case j.LineListDrawMode:case j.LineLoopDrawMode:case j.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(e){this.fillMode=e?j.WireFrameFillMode:j.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case j.PointFillMode:case j.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(e){this.fillMode=e?j.PointFillMode:j.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(e){this._fillMode!==e&&(this._fillMode=e,this.markAsDirty(j.MiscDirtyFlag))}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(e){this._drawWrapper=e}constructor(e,t,i){this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this._cullBackFaces=!0,this._blockDirtyMechanism=!1,this.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new ee,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=2,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.disableColorWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this.zOffsetUnits=0,this.stencil=new gs,this._useUBO=!1,this._fillMode=j.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{},this._callbackPluginEventFillRenderTargetTextures=()=>{},this._forceAlphaTest=!1,this._transparencyMode=null,this.name=e;const s=t||Ie.LastCreatedScene;s&&(this._scene=s,this._dirtyCallbacks={},this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[63]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=e||re.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new Ns(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._scene.useRightHandedSystem?this.sideOrientation=j.ClockWiseSideOrientation:this.sideOrientation=j.CounterClockWiseSideOrientation,this._uniformBuffer=new oe(this._scene.getEngine(),void 0,void 0,e),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,i||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),j.OnEventObservable.notifyObservers(this,Zt.Created))}toString(e){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(e,t){return!0}isReadyForSubMesh(e,t,i){const s=t.materialDefines;return s?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=s,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}get transparencyMode(){return this._transparencyMode}set transparencyMode(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._forceAlphaTest=e===j.MATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _disableAlphaBlending(){return this._transparencyMode===j.MATERIAL_OPAQUE||this._transparencyMode===j.MATERIAL_ALPHATEST}needAlphaBlending(){return this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(e){return e.visibility<1?!0:this._disableAlphaBlending?!1:e.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return!!this._forceAlphaTest}_shouldTurnAlphaTestOn(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(e=!1){const t=this.getScene().meshes;for(const i of t)if(i.subMeshes)for(const s of i.subMeshes)s.getMaterial()===this&&s.effect&&(s.effect._wasPreviouslyReady=!1,s.effect._wasPreviouslyUsingInstances=null,s.effect._forceRebindOnNextCall=e);e&&this.markAsDirty(j.AllDirtyFlag)}_preBind(e,t=null){const i=this._scene.getEngine(),n=(t==null?this.sideOrientation:t)===j.ClockWiseSideOrientation;return i.enableEffect(e||this._getDrawWrapper()),i.setState(this.backFaceCulling,this.zOffset,!1,n,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),n}bind(e,t){}buildUniformLayout(){const e=this._uniformBuffer;this._eventInfo.ubo=e,this._callbackPluginEventGeneric(Zt.PrepareUniformBuffer,this._eventInfo),e.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(e,t,i){const s=i.effect;s&&(this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),s._forceRebindOnNextCall=!1)}bindOnlyWorldMatrix(e){}bindView(e){this._useUBO?this._needToBindSceneUbo=!0:e.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(e){this._useUBO?this._needToBindSceneUbo=!0:(e.setMatrix("viewProjection",this.getScene().getTransformMatrix()),e.setMatrix("projection",this.getScene().getProjectionMatrix()))}bindEyePosition(e,t){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(e,t)}_afterBind(e,t=null){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&t&&(this._needToBindSceneUbo=!1,we.BindSceneUniformBuffer(t,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),e?this._scene._cachedVisibility=e.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){const i=this._scene.getEngine();this._cachedDepthWriteState=i.getDepthWrite(),i.setDepthWrite(!1)}if(this.disableColorWrite){const i=this._scene.getEngine();this._cachedColorWriteState=i.getColorWrite(),i.setColorWrite(!1)}if(this.depthFunction!==0){const i=this._scene.getEngine();this._cachedDepthFunctionState=i.getDepthFunction()||0,i.setDepthFunction(this.depthFunction)}}unbind(){this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.depthFunction!==0&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(Zt.GetAnimatables,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(Zt.GetActiveTextures,this._eventInfo),this._eventInfo.activeTextures}hasTexture(e){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=e,this._callbackPluginEventGeneric(Zt.HasTexture,this._eventInfo),this._eventInfo.hasTexture}clone(e){return null}getBindedMeshes(){if(this.meshMap){const e=new Array;for(const t in this.meshMap){const i=this.meshMap[t];i&&e.push(i)}return e}else return this._scene.meshes.filter(t=>t.material===this)}forceCompilation(e,t,i,s){const n={clipPlane:!1,useInstances:!1,...i},r=this.getScene(),o=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const l=()=>{if(!this._scene||!this._scene.getEngine())return;const h=r.clipPlane;if(n.clipPlane&&(r.clipPlane=new ni(0,0,0,1)),this._storeEffectOnSubMeshes){let c=!0,u=null;if(e.subMeshes){const d=new Ii(0,0,0,0,0,e,void 0,!1,!1);d.materialDefines&&(d.materialDefines._renderId=-1),this.isReadyForSubMesh(e,d,n.useInstances)||(d.effect&&d.effect.getCompilationError()&&d.effect.allFallbacksProcessed()?u=d.effect.getCompilationError():(c=!1,setTimeout(l,16)))}c&&(this.allowShaderHotSwapping=o,u&&s&&s(u),t&&t(this))}else this.isReady()?(this.allowShaderHotSwapping=o,t&&t(this)):setTimeout(l,16);n.clipPlane&&(r.clipPlane=h)};l()}forceCompilationAsync(e,t){return new Promise((i,s)=>{this.forceCompilation(e,()=>{i()},t,n=>{s(n)})})}markAsDirty(e){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(j._DirtyCallbackArray.length=0,e&j.TextureDirtyFlag&&j._DirtyCallbackArray.push(j._TextureDirtyCallBack),e&j.LightDirtyFlag&&j._DirtyCallbackArray.push(j._LightsDirtyCallBack),e&j.FresnelDirtyFlag&&j._DirtyCallbackArray.push(j._FresnelDirtyCallBack),e&j.AttributesDirtyFlag&&j._DirtyCallbackArray.push(j._AttributeDirtyCallBack),e&j.MiscDirtyFlag&&j._DirtyCallbackArray.push(j._MiscDirtyCallBack),e&j.PrePassDirtyFlag&&j._DirtyCallbackArray.push(j._PrePassDirtyCallBack),j._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(j._RunDirtyCallBacks),this.getScene().resetCachedMaterial())}resetDrawCache(){const e=this.getScene().meshes;for(const t of e)if(t.subMeshes)for(const i of t.subMeshes)i.getMaterial()===this&&i.resetDrawCache()}_markAllSubMeshesAsDirty(e){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const t=this.getScene().meshes;for(const i of t)if(i.subMeshes){for(const s of i.subMeshes)if(s.getMaterial(!1)===this)for(const n of s._drawWrappers)!n||!n.defines||!n.defines.markAllAsDirty||this._materialContext===n.materialContext&&e(n.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(j._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(j._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(j._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(j._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(j._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(j._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(j._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(j._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(j._MiscDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(j._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==Wi.BackwardCompatible){this.checkReadyOnlyOnce=!0;const e=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(e)})}}setPrePassRenderer(e){return!1}dispose(e,t,i){const s=this.getScene();if(s.stopAnimation(this),s.freeProcessedMaterials(),s.removeMaterial(this),this._eventInfo.forceDisposeTextures=t,this._callbackPluginEventGeneric(Zt.Disposed,this._eventInfo),this._parentContainer){const n=this._parentContainer.materials.indexOf(this);n>-1&&this._parentContainer.materials.splice(n,1),this._parentContainer=null}if(i!==!0)if(this.meshMap)for(const n in this.meshMap){const r=this.meshMap[n];r&&(r.material=null,this.releaseVertexArrayObject(r,e))}else{const n=s.meshes;for(const r of n)r.material===this&&!r.sourceMesh&&(r.material=null,this.releaseVertexArrayObject(r,e))}this._uniformBuffer.dispose(),e&&this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}releaseVertexArrayObject(e,t){if(e.geometry){const i=e.geometry;if(this._storeEffectOnSubMeshes)for(const s of e.subMeshes)i._releaseVertexArrayObject(s.effect),t&&s.effect&&s.effect.dispose();else i._releaseVertexArrayObject(this._drawWrapper.effect)}}serialize(){const e=Se.Serialize(this);return e.stencil=this.stencil.serialize(),e.uniqueId=this.uniqueId,e}static Parse(e,t,i){if(!e.customType)e.customType="BABYLON.StandardMaterial";else if(e.customType==="BABYLON.PBRMaterial"&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return H.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const n=re.Instantiate(e.customType).Parse(e,t,i);return n._loadedUniqueId=e.uniqueId,n}}j.TriangleFillMode=0;j.WireFrameFillMode=1;j.PointFillMode=2;j.PointListDrawMode=3;j.LineListDrawMode=4;j.LineLoopDrawMode=5;j.LineStripDrawMode=6;j.TriangleStripDrawMode=7;j.TriangleFanDrawMode=8;j.ClockWiseSideOrientation=0;j.CounterClockWiseSideOrientation=1;j.TextureDirtyFlag=1;j.LightDirtyFlag=2;j.FresnelDirtyFlag=4;j.AttributesDirtyFlag=8;j.MiscDirtyFlag=16;j.PrePassDirtyFlag=32;j.AllDirtyFlag=63;j.MATERIAL_OPAQUE=0;j.MATERIAL_ALPHATEST=1;j.MATERIAL_ALPHABLEND=2;j.MATERIAL_ALPHATESTANDBLEND=3;j.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0;j.MATERIAL_NORMALBLENDMETHOD_RNM=1;j.OnEventObservable=new ee;Ie.OnEnginesDisposedObservable.addOnce(()=>{j.OnEventObservable.clear()});j._AllDirtyCallBack=a=>a.markAllAsDirty();j._ImageProcessingDirtyCallBack=a=>a.markAsImageProcessingDirty();j._TextureDirtyCallBack=a=>a.markAsTexturesDirty();j._FresnelDirtyCallBack=a=>a.markAsFresnelDirty();j._MiscDirtyCallBack=a=>a.markAsMiscDirty();j._PrePassDirtyCallBack=a=>a.markAsPrePassDirty();j._LightsDirtyCallBack=a=>a.markAsLightDirty();j._AttributeDirtyCallBack=a=>a.markAsAttributesDirty();j._FresnelAndMiscDirtyCallBack=a=>{j._FresnelDirtyCallBack(a),j._MiscDirtyCallBack(a)};j._TextureAndMiscDirtyCallBack=a=>{j._TextureDirtyCallBack(a),j._MiscDirtyCallBack(a)};j._DirtyCallbackArray=[];j._RunDirtyCallBacks=a=>{for(const e of j._DirtyCallbackArray)e(a)};F([B()],j.prototype,"id",void 0);F([B()],j.prototype,"uniqueId",void 0);F([B()],j.prototype,"name",void 0);F([B()],j.prototype,"metadata",void 0);F([B()],j.prototype,"checkReadyOnEveryCall",void 0);F([B()],j.prototype,"checkReadyOnlyOnce",void 0);F([B()],j.prototype,"state",void 0);F([B("alpha")],j.prototype,"_alpha",void 0);F([B("backFaceCulling")],j.prototype,"_backFaceCulling",void 0);F([B("cullBackFaces")],j.prototype,"_cullBackFaces",void 0);F([B()],j.prototype,"sideOrientation",void 0);F([B("alphaMode")],j.prototype,"_alphaMode",void 0);F([B()],j.prototype,"_needDepthPrePass",void 0);F([B()],j.prototype,"disableDepthWrite",void 0);F([B()],j.prototype,"disableColorWrite",void 0);F([B()],j.prototype,"forceDepthWrite",void 0);F([B()],j.prototype,"depthFunction",void 0);F([B()],j.prototype,"separateCullingPass",void 0);F([B("fogEnabled")],j.prototype,"_fogEnabled",void 0);F([B()],j.prototype,"pointSize",void 0);F([B()],j.prototype,"zOffset",void 0);F([B()],j.prototype,"zOffsetUnits",void 0);F([B()],j.prototype,"pointsCloud",null);F([B()],j.prototype,"fillMode",null);F([B()],j.prototype,"transparencyMode",null);class xn extends j{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().multiMaterials.push(this),this.subMaterials=new Array,this._storeEffectOnSubMeshes=!0}_hookArray(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._markAllSubMeshesAsTexturesDirty(),n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);return this._markAllSubMeshesAsTexturesDirty(),r}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){var t;if(super.hasTexture(e))return!0;for(let i=0;i=0&&s.multiMaterials.splice(n,1),super.dispose(e,t)}static ParseMultiMaterial(e,t){const i=new xn(e.name,t);return i.id=e.id,i._loadedUniqueId=e.uniqueId,Ve&&Ve.AddTagsTo(i,e.tags),e.materialsUniqueIds?i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds:e.materials.forEach(s=>i.subMaterials.push(t.getLastMaterialById(s))),i}}Vt("BABYLON.MultiMaterial",xn);class hf{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}class Ul{}class cf{constructor(){this.visibleInstances={},this.batchCache=new Po,this.batchCacheReplacementModeInFrozenMode=new Po,this.instancesBufferSize=32*16*4}}class Po{constructor(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array,this.hardwareInstancedRendering=new Array}}class uf{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=32*16,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class df{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}class O extends ei{static _GetDefaultSideOrientation(e){return e||O.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(A.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(A.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new ee),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new ee),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new ee),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new ee),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new ee),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){var e;return((e=this._thinInstanceDataStorage.instancesCount)!==null&&e!==void 0?e:0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){return this._instanceDataStorage.instancesData}get previousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.instancesPreviousData}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}constructor(e,t=null,i=null,s=null,n,r=!0){if(super(e,t),this._internalMeshDataInfo=new df,this.delayLoadState=0,this.instances=new Array,this._creationDataStorage=null,this._geometry=null,this._instanceDataStorage=new cf,this._thinInstanceDataStorage=new uf,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=O.DEFAULTSIDE,this.overrideMaterialSideOrientation=null,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._onBeforeDraw=(o,l,h)=>{o&&h&&(this._uniformBuffer?this.transferToEffect(l):h.bindOnlyWorldMatrix(l))},s){if(s._geometry&&s._geometry.applyToMesh(this),a0.DeepCopy(s,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo"],["_poseMatrix"]),this._internalMeshDataInfo._source=s,t.useClonedMeshMap&&(s._internalMeshDataInfo.meshMap||(s._internalMeshDataInfo.meshMap={}),s._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=s._originalBuilderSideOrientation,this._creationDataStorage=s._creationDataStorage,s._ranges){const o=s._ranges;for(const l in o)Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&this.createAnimationRange(l,o[l].from,o[l].to)}if(s.metadata&&s.metadata.clone?this.metadata=s.metadata.clone():this.metadata=s.metadata,this._internalMetadata=s._internalMetadata,Ve&&Ve.HasTags(s)&&Ve.AddTagsTo(this,Ve.GetTags(s,!0)),this.setEnabled(s.isEnabled(!1)),this.parent=s.parent,this.setPivotMatrix(s.getPivotMatrix()),this.id=e+"."+s.id,this.material=s.material,!n){const o=s.getDescendants(!0);for(let l=0;l{o.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new ee(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){const s=this.getTotalVertices()===0||t&&t.doNotInstantiate&&(t.doNotInstantiate===!0||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.getClassName()==="InstancedMesh"&&s.getClassName()==="Mesh"&&n.sourceMesh===this?n.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):n.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoveragei.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return H.Warn("You cannot use a mesh as LOD level twice"),this;const i=new hf(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){const t=this._internalMeshDataInfo;for(let i=0;io*r)return this.onLODLevelSelection&&this.onLODLevelSelection(r,this,this),this;for(let l=0;l0||this.hasThinInstances);this.computeWorldMatrix();const d=this.material||c.defaultMaterial;if(d){if(d._storeEffectOnSubMeshes)for(const f of this.subMeshes){const g=f.getMaterial();if(g){if(g._storeEffectOnSubMeshes){if(!g.isReadyForSubMesh(this,f,u))return!1}else if(!g.isReady(this,u))return!1}}else if(!d.isReady(this,u))return!1}const _=h.currentRenderPassId;for(const f of this.lightSources){const g=f.getShadowGenerators();if(!g)continue;const p=g.values();for(let x=p.next();x.done!==!0;x=p.next()){const m=x.value;if(m&&(!(!((i=m.getShadowMap())===null||i===void 0)&&i.renderList)||!((s=m.getShadowMap())===null||s===void 0)&&s.renderList&&((r=(n=m.getShadowMap())===null||n===void 0?void 0:n.renderList)===null||r===void 0?void 0:r.indexOf(this))!==-1)){m.getShadowMap()&&(h.currentRenderPassId=m.getShadowMap().renderPassId);for(const T of this.subMeshes)if(!m.isReady(T,u,(l=(o=T.getMaterial())===null||o===void 0?void 0:o.needAlphaBlendingForMesh(this))!==null&&l!==void 0?l:!1))return h.currentRenderPassId=_,!1;h.currentRenderPassId=_}}}for(const f of this._internalMeshDataInfo._LODLevels)if(f.mesh&&!f.mesh.isReady(u))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_preActivate(){const e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t?this:(e._preActivateId=t,this._instanceDataStorage.visibleInstances=null,this)}_preActivateForIntermediateRendering(e){return this._instanceDataStorage.visibleInstances&&(this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){return this._instanceDataStorage.visibleInstances||(this._instanceDataStorage.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId}),this._instanceDataStorage.visibleInstances[t]||(this._instanceDataStorage.previousRenderId!==void 0&&this._instanceDataStorage.isFrozen&&(this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId]=null),this._instanceDataStorage.previousRenderId=t,this._instanceDataStorage.visibleInstances[t]=new Array),this._instanceDataStorage.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;const i=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getPositionData(e,t),i),this}_createGlobalSubMesh(e){const t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){const i=this.getIndices();if(!i)return null;const s=i.length;let n=!1;if(e)n=!0;else for(const r of this.subMeshes){if(r.indexStart+r.indexCount>s){n=!0;break}if(r.verticesStart+r.verticesCount>t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new Ii(0,0,t,0,this.getTotalIndices(),this)}subdivide(e){if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,s=0;for(;i%3!==0;)i++;this.releaseSubMeshes();for(let n=0;n=t);n++)Ii.CreateFromIndices(0,s,n===e-1?t-s:i,this),s+=i;this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{const n=new J;n.set(t,e);const r=this.getScene();new si(si.RandomId(),r,n,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){const i=this.getVertexBuffer(e);!i||i.isUpdatable()===t||this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0){return this._geometry||(this._geometry=si.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,null,t),this}updateVerticesData(e,t,i,s){return this._geometry?(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){const i=this.getVerticesData(A.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(A.PositionKind,i,!1,!1),t){const s=this.getIndices(),n=this.getVerticesData(A.NormalKind);if(!n)return this;J.ComputeNormals(i,s,n),this.updateVerticesData(A.NormalKind,n,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry)return this;if(this._geometry.meshes.length===1)return this;const e=this._geometry,t=this._geometry.copy(si.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndices(e,t=null,i=!1){if(this._geometry)this._geometry.setIndices(e,t,i);else{const s=new J;s.indices=e;const n=this.getScene();new si(si.RandomId(),n,s,i,this)}return this}updateIndices(e,t,i=!1){return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,s=!0){if(!this._geometry)return this;const n=this.getScene().getEngine();this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(t);let r;if(this._unIndexed)r=null;else switch(this._getRenderingFillMode(i)){case j.PointFillMode:r=null;break;case j.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case j.TriangleFillMode:r=this._geometry.getIndexBuffer();break}return!s||!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,r):this._geometry._bind(t,r,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const n=this.getScene().getEngine();return this._unIndexed||t==j.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==j.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):n.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){if(this._instanceDataStorage.isFrozen){if(t)return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;if(this._instanceDataStorage.previousBatch)return this._instanceDataStorage.previousBatch}const i=this.getScene(),s=i._isInIntermediateRendering(),n=s?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,r=this._instanceDataStorage.batchCache;if(r.mustReturn=!1,r.renderSelf[e]=t||!n&&this.isEnabled()&&this.isVisible,r.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances&&!t){const o=this._instanceDataStorage.visibleInstances,l=i.getRenderId(),h=s?o.intermediateDefaultRenderId:o.defaultRenderId;r.visibleInstances[e]=o[l],!r.visibleInstances[e]&&h&&(r.visibleInstances[e]=o[h])}return r.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&r.visibleInstances[e]!==null&&r.visibleInstances[e]!==void 0,this._instanceDataStorage.previousBatch=r,r}_renderWithInstances(e,t,i,s,n){var r;const o=i.visibleInstances[e._id],l=o?o.length:0,h=this._instanceDataStorage,c=h.instancesBufferSize;let u=h.instancesBuffer,d=h.instancesPreviousBuffer;const f=(l+1)*16*4;for(;h.instancesBufferSizeb._distanceToCamera>y._distanceToCamera?-1:b._distanceToCamerax&&s++,b!==0&&T++,m+=b,x=b}if(h[T]++,T>r&&(r=T),m===0)n++;else{const S=1/m;let b=0;for(let y=0;yc&&o++}}const u=this.skeleton.bones.length,d=this.getVerticesData(A.MatricesIndicesKind),_=this.getVerticesData(A.MatricesIndicesExtraKind);let f=0;for(let p=0;p=u||m<0)&&f++}const g="Number of Weights = "+i/4+"\nMaximum influences = "+r+"\nMissing Weights = "+n+"\nNot Sorted = "+s+"\nNot Normalized = "+o+"\nWeightCounts = ["+h+"]\nNumber of bones = "+u+"\nBad Bone Indices = "+f;return{skinned:!0,valid:n===0&&o===0&&f===0,report:g}}_checkDelayState(){const e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===4&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);const t=this.delayLoadingFile.indexOf(".babylonbinarymeshdata")!==-1;return re.LoadFile(this.delayLoadingFile,i=>{i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this),this.instances.forEach(s=>{s.refreshBoundingInfo(),s._syncSubMeshes()}),this.delayLoadState=1,e.removePendingData(this)},()=>{},e.offlineProvider,t),this}isInFrustum(e){return this.delayLoadState===2||!super.isInFrustum(e)?!1:(this._checkDelayState(),!0)}setMaterialById(e){const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const s=this.getScene().multiMaterials;for(i=s.length-1;i>-1;i--)if(s[i].id===e)return this.material=s[i],this;return this}getAnimatables(){const e=new Array;return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(A.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(A.PositionKind);const s=v.Zero();let n;for(n=0;n{const u=c.width,d=c.height,f=this.getEngine().createCanvas(u,d).getContext("2d");f.drawImage(c,0,0);const g=f.getImageData(0,0,u,d).data;this.applyDisplacementMapFromBuffer(g,u,d,t,i,n,r,o),s&&s(this)};return re.LoadImage(e,h,()=>{},l.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,n,r,o,l=!1){if(!this.isVerticesDataPresent(A.PositionKind)||!this.isVerticesDataPresent(A.NormalKind)||!this.isVerticesDataPresent(A.UVKind))return H.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const h=this.getVerticesData(A.PositionKind,!0,!0),c=this.getVerticesData(A.NormalKind),u=this.getVerticesData(A.UVKind);let d=v.Zero();const _=v.Zero(),f=fe.Zero();r=r||fe.Zero(),o=o||new fe(1,1);for(let g=0;g{const o=s.length-1-r,l=s[o];for(let h=0;h{for(let o=0;o-1&&(s.morphTargetManager=t.getMorphTargetManagerById(e.morphTargetManagerId)),e.skeletonId!==void 0&&e.skeletonId!==null&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(let n=0;n4,h=l?this.getVerticesData(A.MatricesIndicesExtraKind):null,c=l?this.getVerticesData(A.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),d=v.Zero(),_=new N,f=new N;let g=0,p;for(let x=0;x0&&(N.FromFloat32ArrayToRefScaled(u,Math.floor(r[g+p]*16),m,f),_.addToSelf(f));if(l)for(p=0;p<4;p++)m=c[g+p],m>0&&(N.FromFloat32ArrayToRefScaled(u,Math.floor(h[g+p]*16),m,f),_.addToSelf(f));v.TransformCoordinatesFromFloatsToRef(i._sourcePositions[x],i._sourcePositions[x+1],i._sourcePositions[x+2],_,d),d.toArray(s,x),t&&(v.TransformNormalFromFloatsToRef(i._sourceNormals[x],i._sourceNormals[x+1],i._sourceNormals[x+2],_,d),d.toArray(n,x)),_.reset()}return this.updateVerticesData(A.PositionKind,s),t&&this.updateVerticesData(A.NormalKind,n),this}static MinMax(e){let t=null,i=null;return e.forEach(function(s){const r=s.getBoundingInfo().boundingBox;!t||!i?(t=r.minimumWorld,i=r.maximumWorld):(t.minimizeInPlace(r.minimumWorld),i.maximizeInPlace(r.maximumWorld))}),!t||!i?{min:v.Zero(),max:v.Zero()}:{min:t,max:i}}static Center(e){const t=e instanceof Array?O.MinMax(e):e;return v.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,n,r){return T0(O._MergeMeshesCoroutine(e,t,i,s,n,r,!1))}static MergeMeshesAsync(e,t=!0,i,s,n,r){return tf(O._MergeMeshesCoroutine(e,t,i,s,n,r,!0),ef())}static*_MergeMeshesCoroutine(e,t=!0,i,s,n,r,o){if(e=e.filter(Boolean),e.length===0)return null;let l;if(!i){let E=0;for(l=0;l=65536)return H.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}r&&(n=!1);const h=new Array,c=new Array,u=new Array,d=e[0].overrideMaterialSideOrientation;for(l=0;l{const P=E.computeWorldMatrix(!0);return{vertexData:J.ExtractFromMesh(E,!1,!1),transform:P}},{vertexData:g,transform:p}=f(_);o&&(yield);const x=new Array(e.length-1);for(let E=1;E{throw Ae("GroundMesh")};O._GoldbergMeshParser=(a,e)=>{throw Ae("GoldbergMesh")};O._LinesMeshParser=(a,e)=>{throw Ae("LinesMesh")};Vt("BABYLON.Mesh",O);O.prototype.setMaterialByID=function(a){return this.setMaterialById(a)};O.CreateDisc=O.CreateDisc||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateBox=O.CreateBox||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateSphere=O.CreateSphere||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateCylinder=O.CreateCylinder||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateTorusKnot=O.CreateTorusKnot||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateTorus=O.CreateTorus||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreatePlane=O.CreatePlane||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateGround=O.CreateGround||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateTiledGround=O.CreateTiledGround||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateGroundFromHeightMap=O.CreateGroundFromHeightMap||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateTube=O.CreateTube||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreatePolyhedron=O.CreatePolyhedron||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateIcoSphere=O.CreateIcoSphere||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateDecal=O.CreateDecal||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.CreateCapsule=O.CreateCapsule||(()=>{throw new Error("Import MeshBuilder to populate this function")});O.ExtendToGoldberg=O.ExtendToGoldberg||(()=>{throw new Error("Import MeshBuilder to populate this function")});class ff{constructor(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){return"AutoRotation"}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set idleRotationSpeed(e){this._idleRotationSpeed=e}get idleRotationSpeed(){return this._idleRotationSpeed}set idleRotationWaitTime(e){this._idleRotationWaitTime=e}get idleRotationWaitTime(){return this._idleRotationWaitTime}set idleRotationSpinupTime(e){this._idleRotationSpinupTime=e}get idleRotationSpinupTime(){return this._idleRotationSpinupTime}get rotationInProgress(){return Math.abs(this._cameraRotationSpeed)>0}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===Re.POINTERDOWN){this._isPointerDown=!0;return}i.type===Re.POINTERUP&&(this._isPointerDown=!1)}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{if(this._reachTargetAlpha())return;const i=Pi.Now;let s=0;this._lastFrameTime!=null&&(s=i-this._lastFrameTime),this._lastFrameTime=i,this._applyUserInteraction();const n=i-this._lastInteractionTime-this._idleRotationWaitTime,r=Math.max(Math.min(n/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*r,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(s/1e3))})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null}resetLastInteractionTime(e){this._lastInteractionTime=e!=null?e:Pi.Now}_reachTargetAlpha(){return this._attachedCamera&&this.targetAlpha?Math.abs(this._attachedCamera.alpha-this.targetAlpha)=.5?(1-this.easeInCore((1-e)*2))*.5+.5:this.easeInCore(e*2)*.5}}Hi.EASINGMODE_EASEIN=0;Hi.EASINGMODE_EASEOUT=1;Hi.EASINGMODE_EASEINOUT=2;class _f extends Hi{constructor(e=1){super(),this.amplitude=e}easeInCore(e){const t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)}}class pf extends Hi{constructor(e=2){super(),this.exponent=e}easeInCore(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)}}var Ga;(function(a){a[a.NONE=0]="NONE",a[a.STEP=1]="STEP"})(Ga||(Ga={}));class $r{constructor(e,t,i){this.name=e,this.from=t,this.to=i}clone(){return new $r(this.name,this.from,this.to)}}class ne{static _PrepareAnimation(e,t,i,s,n,r,o,l){let h;if(!isNaN(parseFloat(n))&&isFinite(n)?h=ne.ANIMATIONTYPE_FLOAT:n instanceof ue?h=ne.ANIMATIONTYPE_QUATERNION:n instanceof v?h=ne.ANIMATIONTYPE_VECTOR3:n instanceof fe?h=ne.ANIMATIONTYPE_VECTOR2:n instanceof he?h=ne.ANIMATIONTYPE_COLOR3:n instanceof q?h=ne.ANIMATIONTYPE_COLOR4:n instanceof Ui&&(h=ne.ANIMATIONTYPE_SIZE),h==null)return null;const c=new ne(e,t,i,h,o),u=[{frame:0,value:n},{frame:s,value:r}];return c.setKeys(u),l!==void 0&&c.setEasingFunction(l),c}static CreateAnimation(e,t,i,s){const n=new ne(e+"Animation",e,i,t,ne.ANIMATIONLOOPMODE_CONSTANT);return n.setEasingFunction(s),n}static CreateAndStartAnimation(e,t,i,s,n,r,o,l,h,c,u){const d=ne._PrepareAnimation(e,i,s,n,r,o,l,h);return!d||(t.getScene&&(u=t.getScene()),!u)?null:u.beginDirectAnimation(t,[d],0,n,d.loopMode===1,1,c)}static CreateAndStartHierarchyAnimation(e,t,i,s,n,r,o,l,h,c,u){const d=ne._PrepareAnimation(e,s,n,r,o,l,h,c);return d?t.getScene().beginDirectHierarchyAnimation(t,i,[d],0,r,d.loopMode===1,1,u):null}static CreateMergeAndStartAnimation(e,t,i,s,n,r,o,l,h,c){const u=ne._PrepareAnimation(e,i,s,n,r,o,l,h);return u?(t.animations.push(u),t.getScene().beginAnimation(t,0,n,u.loopMode===1,1,c)):null}static MakeAnimationAdditive(e,t=0,i,s=!1,n){let r=e;if(s&&(r=e.clone(),r.name=n||r.name),!r._keys.length)return r;t=t>=0?t:0;let o=0;const l=r._keys[0];let h=r._keys.length-1;const c=r._keys[h],u={referenceValue:l.value,referencePosition:G.Vector3[0],referenceQuaternion:G.Quaternion[0],referenceScaling:G.Vector3[1],keyPosition:G.Vector3[2],keyQuaternion:G.Quaternion[1],keyScaling:G.Vector3[3]};let d=!1,_=l.frame,f=c.frame;if(i){const m=r.getRange(i);m&&(_=m.from,f=m.to)}let g=l.frame===_,p=c.frame===f;if(r._keys.length===1){const m=r._getKeyValue(r._keys[0]);u.referenceValue=m.clone?m.clone():m,d=!0}else if(t<=l.frame){const m=r._getKeyValue(l.value);u.referenceValue=m.clone?m.clone():m,d=!0}else if(t>=c.frame){const m=r._getKeyValue(c.value);u.referenceValue=m.clone?m.clone():m,d=!0}let x=0;for(;!d||!g||!p&&x=m.frame&&t<=T.frame){let S;if(t===m.frame)S=r._getKeyValue(m.value);else if(t===T.frame)S=r._getKeyValue(T.value);else{const b={key:x,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};S=r._interpolate(t,b)}u.referenceValue=S.clone?S.clone():S,d=!0}if(!g&&_>=m.frame&&_<=T.frame){if(_===m.frame)o=x;else if(_===T.frame)o=x+1;else{const S={key:x,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},b=r._interpolate(_,S),y={frame:_,value:b.clone?b.clone():b};r._keys.splice(x+1,0,y),o=x+1}g=!0}if(!p&&f>=m.frame&&f<=T.frame){if(f===m.frame)h=x;else if(f===T.frame)h=x+1;else{const S={key:x,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},b=r._interpolate(f,S),y={frame:f,value:b.clone?b.clone():b};r._keys.splice(x+1,0,y),h=x+1}p=!0}x++}for(r.dataType===ne.ANIMATIONTYPE_QUATERNION?u.referenceValue.normalize().conjugateInPlace():r.dataType===ne.ANIMATIONTYPE_MATRIX&&(u.referenceValue.decompose(u.referenceScaling,u.referenceQuaternion,u.referencePosition),u.referenceQuaternion.normalize().conjugateInPlace()),x=o;x<=h;x++){const m=r._keys[x];if(!(x&&r.dataType!==ne.ANIMATIONTYPE_FLOAT&&m.value===l.value))switch(r.dataType){case ne.ANIMATIONTYPE_MATRIX:m.value.decompose(u.keyScaling,u.keyQuaternion,u.keyPosition),u.keyPosition.subtractInPlace(u.referencePosition),u.keyScaling.divideInPlace(u.referenceScaling),u.referenceQuaternion.multiplyToRef(u.keyQuaternion,u.keyQuaternion),N.ComposeToRef(u.keyScaling,u.keyQuaternion,u.keyPosition,m.value);break;case ne.ANIMATIONTYPE_QUATERNION:u.referenceValue.multiplyToRef(m.value,m.value);break;case ne.ANIMATIONTYPE_VECTOR2:case ne.ANIMATIONTYPE_VECTOR3:case ne.ANIMATIONTYPE_COLOR3:case ne.ANIMATIONTYPE_COLOR4:m.value.subtractToRef(u.referenceValue,m.value);break;case ne.ANIMATIONTYPE_SIZE:m.value.width-=u.referenceValue.width,m.value.height-=u.referenceValue.height;break;default:m.value-=u.referenceValue}}return r}static TransitionTo(e,t,i,s,n,r,o,l=null){if(o<=0)return i[e]=t,l&&l(),null;const h=n*(o/1e3);r.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:h,value:t}]),i.animations||(i.animations=[]),i.animations.push(r);const c=s.beginAnimation(i,0,h,!1);return c.onAnimationEnd=l,c}get runtimeAnimations(){return this._runtimeAnimations}get hasRunningRuntimeAnimations(){for(const e of this._runtimeAnimations)if(!e.isStopped())return!0;return!1}constructor(e,t,i,s,n,r){this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=s,this.loopMode=n,this.enableBlending=r,this._easingFunction=null,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=t.split("."),this.dataType=s,this.loopMode=n===void 0?ne.ANIMATIONLOOPMODE_CYCLE:n,this.uniqueId=ne._UniqueIdGenerator++}toString(e){let t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";let i=!0;for(const s in this._ranges)i&&(t+=", ",i=!1),t+=s;t+="}"}return t}addEvent(e){this._events.push(e),this._events.sort((t,i)=>t.frame-i.frame)}removeEvents(e){for(let t=0;t=0;r--)this._keys[r].frame>=s&&this._keys[r].frame<=n&&this._keys.splice(r,1)}this._ranges[e]=null}}getRange(e){return this._ranges[e]}getKeys(){return this._keys}getHighestFrame(){let e=0;for(let t=0,i=this._keys.length;t0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;const i=this._keys,s=i.length;let n=t.key;for(;n>=0&&e=i[n+1].frame;)++n;if(t.key=n,n<0)return this._getKeyValue(i[0].value);if(n+1>s-1)return this._getKeyValue(i[s-1].value);const r=i[n],o=i[n+1],l=this._getKeyValue(r.value),h=this._getKeyValue(o.value);if(r.interpolation===Ga.STEP)return o.frame>e?l:h;const c=r.outTangent!==void 0&&o.inTangent!==void 0,u=o.frame-r.frame;let d=(e-r.frame)/u;const _=this.getEasingFunction();switch(_!==null&&(d=_.ease(d)),this.dataType){case ne.ANIMATIONTYPE_FLOAT:{const f=c?this.floatInterpolateFunctionWithTangents(l,r.outTangent*u,h,o.inTangent*u,d):this.floatInterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return t.offsetValue*t.repeatCount+f}break}case ne.ANIMATIONTYPE_QUATERNION:{const f=c?this.quaternionInterpolateFunctionWithTangents(l,r.outTangent.scale(u),h,o.inTangent.scale(u),d):this.quaternionInterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return f.addInPlace(t.offsetValue.scale(t.repeatCount))}return f}case ne.ANIMATIONTYPE_VECTOR3:{const f=c?this.vector3InterpolateFunctionWithTangents(l,r.outTangent.scale(u),h,o.inTangent.scale(u),d):this.vector3InterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return f.add(t.offsetValue.scale(t.repeatCount))}break}case ne.ANIMATIONTYPE_VECTOR2:{const f=c?this.vector2InterpolateFunctionWithTangents(l,r.outTangent.scale(u),h,o.inTangent.scale(u),d):this.vector2InterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return f.add(t.offsetValue.scale(t.repeatCount))}break}case ne.ANIMATIONTYPE_SIZE:{switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(l,h,d);case ne.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(l,h,d).add(t.offsetValue.scale(t.repeatCount))}break}case ne.ANIMATIONTYPE_COLOR3:{const f=c?this.color3InterpolateFunctionWithTangents(l,r.outTangent.scale(u),h,o.inTangent.scale(u),d):this.color3InterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return f.add(t.offsetValue.scale(t.repeatCount))}break}case ne.ANIMATIONTYPE_COLOR4:{const f=c?this.color4InterpolateFunctionWithTangents(l,r.outTangent.scale(u),h,o.inTangent.scale(u),d):this.color4InterpolateFunction(l,h,d);switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return f;case ne.ANIMATIONLOOPMODE_RELATIVE:return f.add(t.offsetValue.scale(t.repeatCount))}break}case ne.ANIMATIONTYPE_MATRIX:{switch(t.loopMode){case ne.ANIMATIONLOOPMODE_CYCLE:case ne.ANIMATIONLOOPMODE_CONSTANT:return ne.AllowMatricesInterpolation?this.matrixInterpolateFunction(l,h,d,t.workValue):l;case ne.ANIMATIONLOOPMODE_RELATIVE:return l}break}}return 0}matrixInterpolateFunction(e,t,i,s){return ne.AllowMatrixDecomposeForInterpolation?s?(N.DecomposeLerpToRef(e,t,i,s),s):N.DecomposeLerp(e,t,i):s?(N.LerpToRef(e,t,i,s),s):N.Lerp(e,t,i)}clone(){const e=new ne(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys),this._ranges){e._ranges={};for(const t in this._ranges){const i=this._ranges[t];i&&(e._ranges[t]=i.clone())}}return e}setKeys(e){this._keys=e.slice(0)}serialize(){const e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;const t=this.dataType;e.keys=[];const i=this.getKeys();for(let s=0;s=2&&(l=o.values[1]),o.values.length>=3&&(h=o.values[2]),o.values.length>=4&&(c=o.values[3]);break;case ne.ANIMATIONTYPE_QUATERNION:if(n=ue.FromArray(o.values),o.values.length>=8){const d=ue.FromArray(o.values.slice(4,8));d.equals(ue.Zero())||(l=d)}if(o.values.length>=12){const d=ue.FromArray(o.values.slice(8,12));d.equals(ue.Zero())||(h=d)}o.values.length>=13&&(c=o.values[12]);break;case ne.ANIMATIONTYPE_MATRIX:n=N.FromArray(o.values),o.values.length>=17&&(c=o.values[16]);break;case ne.ANIMATIONTYPE_COLOR3:n=he.FromArray(o.values),o.values[3]&&(l=he.FromArray(o.values[3])),o.values[4]&&(h=he.FromArray(o.values[4])),o.values[5]&&(c=o.values[5]);break;case ne.ANIMATIONTYPE_COLOR4:n=q.FromArray(o.values),o.values[4]&&(l=q.FromArray(o.values[4])),o.values[5]&&(h=q.FromArray(o.values[5])),o.values[6]&&(c=q.FromArray(o.values[6]));break;case ne.ANIMATIONTYPE_VECTOR3:default:n=v.FromArray(o.values),o.values[3]&&(l=v.FromArray(o.values[3])),o.values[4]&&(h=v.FromArray(o.values[4])),o.values[5]&&(c=o.values[5]);break}const u={};u.frame=o.frame,u.value=n,l!=null&&(u.inTangent=l),h!=null&&(u.outTangent=h),c!=null&&(u.interpolation=c),s.push(u)}if(t.setKeys(s),e.ranges)for(r=0;r{const n=new Jt;n.addEventListener("readystatechange",()=>{if(n.readyState==4)if(n.status==200){let r=JSON.parse(n.responseText);if(r.animations&&(r=r.animations),r.length){const o=new Array;for(const l of r)o.push(this.Parse(l));i(o)}else{const o=this.Parse(r);e&&(o.name=e),i(o)}}else s("Unable to load the animation")}),n.open("GET",t),n.send()})}static ParseFromSnippetAsync(e){return new Promise((t,i)=>{const s=new Jt;s.addEventListener("readystatechange",()=>{if(s.readyState==4)if(s.status==200){const n=JSON.parse(JSON.parse(s.responseText).jsonPayload);if(n.animations){const r=JSON.parse(n.animations),o=new Array;for(const l of r.animations){const h=this.Parse(l);h.snippetId=e,o.push(h)}t(o)}else{const r=JSON.parse(n.animation),o=this.Parse(r);o.snippetId=e,t(o)}}else i("Unable to load the snippet "+e)}),s.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})}}ne._UniqueIdGenerator=0;ne.AllowMatricesInterpolation=!1;ne.AllowMatrixDecomposeForInterpolation=!0;ne.SnippetUrl="https://snippet.babylonjs.com";ne.ANIMATIONTYPE_FLOAT=0;ne.ANIMATIONTYPE_VECTOR3=1;ne.ANIMATIONTYPE_QUATERNION=2;ne.ANIMATIONTYPE_MATRIX=3;ne.ANIMATIONTYPE_COLOR3=4;ne.ANIMATIONTYPE_COLOR4=7;ne.ANIMATIONTYPE_VECTOR2=5;ne.ANIMATIONTYPE_SIZE=6;ne.ANIMATIONLOOPMODE_RELATIVE=0;ne.ANIMATIONLOOPMODE_CYCLE=1;ne.ANIMATIONLOOPMODE_CONSTANT=2;ne.CreateFromSnippetAsync=ne.ParseFromSnippetAsync;Vt("BABYLON.Animation",ne);At._AnimationRangeFactory=(a,e,t)=>new $r(a,e,t);class qs{constructor(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}get name(){return"Bouncing"}get autoTransitionRange(){return this._autoTransitionRange}set autoTransitionRange(e){if(this._autoTransitionRange===e)return;this._autoTransitionRange=e;const t=this._attachedCamera;t&&(e?this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(i=>{if(!i)return;i.computeWorldMatrix(!0);const s=i.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=s*.05,this.upperRadiusTransitionRange=s*.05}):this._onMeshTargetChangedObserver&&t.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}init(){}attach(e){this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(e){return this._attachedCamera?this._attachedCamera.radius===e&&!this._radiusIsAnimating:!1}_applyBoundRadiusAnimation(e){if(!this._attachedCamera)return;this._radiusBounceTransition||(qs.EasingFunction.setEasingMode(qs.EasingMode),this._radiusBounceTransition=ne.CreateAnimation("radius",ne.ANIMATIONTYPE_FLOAT,60,qs.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const t=ne.TransitionTo("radius",this._attachedCamera.radius+e,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());t&&this._animatables.push(t)}_clearAnimationLocks(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}qs.EasingFunction=new _f(.3);qs.EasingMode=Hi.EASINGMODE_EASEOUT;class li{constructor(){this.onTargetFramingAnimationEndObservable=new ee,this._mode=li.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}get name(){return"Framing"}set mode(e){this._mode=e}get mode(){return this._mode}set radiusScale(e){this._radiusScale=e}get radiusScale(){return this._radiusScale}set positionScale(e){this._positionScale=e}get positionScale(){return this._positionScale}set defaultElevation(e){this._defaultElevation=e}get defaultElevation(){return this._defaultElevation}set elevationReturnTime(e){this._elevationReturnTime=e}get elevationReturnTime(){return this._elevationReturnTime}set elevationReturnWaitTime(e){this._elevationReturnWaitTime=e}get elevationReturnWaitTime(){return this._elevationReturnWaitTime}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set framingTime(e){this._framingTime=e}get framingTime(){return this._framingTime}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();li.EasingFunction.setEasingMode(li.EasingMode),this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===Re.POINTERDOWN){this._isPointerDown=!0;return}i.type===Re.POINTERUP&&(this._isPointerDown=!1)}),this._onMeshTargetChangedObserver=e.onMeshTargetChangedObservable.add(i=>{i&&this.zoomOnMesh(i,void 0,()=>{this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(s.minimumWorld,s.maximumWorld,t,i)}zoomOnMeshHierarchy(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(s.min,s.max,t,i)}zoomOnMeshesHierarchy(e,t=!1,i=null){const s=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let r=0;r{this.stopAllAnimations(),s&&s(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}),c&&this._animatables.push(c)}_calculateLowerRadiusFromModelBoundingSphere(e,t){const s=t.subtract(e).length(),n=this._getFrustumSlope(),o=s*.5*this._radiusScale,l=o*Math.sqrt(1+1/(n.x*n.x)),h=o*Math.sqrt(1+1/(n.y*n.y));let c=Math.max(l,h);const u=this._attachedCamera;return u?(u.lowerRadiusLimit&&this._mode===li.IgnoreBoundsSizeMode&&(c=cu.upperRadiusLimit?u.upperRadiusLimit:c),c):0}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;const e=Pi.Now-this._lastInteractionTime,t=Math.PI*.5-this._defaultElevation,i=Math.PI*.5;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&e>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=ne.CreateAnimation("beta",ne.ANIMATIONTYPE_FLOAT,60,li.EasingFunction));const s=ne.TransitionTo("beta",t,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});s&&this._animatables.push(s)}}_getFrustumSlope(){const e=this._attachedCamera;if(!e)return fe.Zero();const i=e.getScene().getEngine().getAspectRatio(e),s=Math.tan(e.fov/2),n=s*i;return new fe(n,s)}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=Pi.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}li.EasingFunction=new pf;li.EasingMode=Hi.EASINGMODE_EASEINOUT;li.IgnoreBoundsSizeMode=0;li.FitFrustumSidesMode=1;class Bt extends de{constructor(e,t,i,s=!0){super(e,t,i,s),this._tmpUpVector=v.Zero(),this._tmpTargetVector=v.Zero(),this.cameraDirection=new v(0,0,0),this.cameraRotation=new fe(0,0),this.ignoreParentScaling=!1,this.updateUpVectorFromRotation=!1,this._tmpQuaternion=new ue,this.rotation=new v(0,0,0),this.speed=2,this.noRotationConstraint=!1,this.invertRotation=!1,this.inverseRotationSpeed=.2,this.lockedTarget=null,this._currentTarget=v.Zero(),this._initialFocalDistance=1,this._viewMatrix=N.Zero(),this._camMatrix=N.Zero(),this._cameraTransformMatrix=N.Zero(),this._cameraRotationMatrix=N.Zero(),this._referencePoint=new v(0,0,1),this._transformedReferencePoint=v.Zero(),this._defaultUp=v.Up(),this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0}getFrontPosition(e){this.getWorldMatrix();const t=this.getTarget().subtract(this.position);return t.normalize(),t.scaleInPlace(e),this.globalPosition.add(t)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const e=this.lockedTarget;e.computeWorldMatrix().getTranslationToRef(e.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0):!1}_initCache(){super._initCache(),this._cache.lockedTarget=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new ue(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(e){e||super._updateCache();const t=this._getLockedTargetPosition();t?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(t):this._cache.lockedTarget=t.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;const e=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(e):!e)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(e.getFps()*100))}setTarget(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=Ge),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),N.LookAtLHToRef(this.position,e,this._defaultUp,this._camMatrix),this._camMatrix.invert(),this.rotation.x=Math.atan(this._camMatrix.m[6]/this._camMatrix.m[10]);const t=e.subtract(this.position);t.x>=0?this.rotation.y=-Math.atan(t.z/t.x)+Math.PI/2:this.rotation.y=-Math.atan(t.z/t.x)-Math.PI/2,this.rotation.z=0,isNaN(this.rotation.x)&&(this.rotation.x=0),isNaN(this.rotation.y)&&(this.rotation.y=0),isNaN(this.rotation.z)&&(this.rotation.z=0),this.rotationQuaternion&&ue.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(G.Matrix[0]),v.TransformNormalToRef(this.cameraDirection,G.Matrix[0],G.Vector3[0]),this.position.addInPlace(G.Vector3[0]);return}this.position.addInPlace(this.cameraDirection)}_checkInputs(){const e=this.invertRotation?-this.inverseRotationSpeed:1,t=this._decideIfNeedsToMove(),i=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;t&&this._updatePosition(),i&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this.rotation),this.rotation.x+=this.cameraRotation.x*e,this.rotation.y+=this.cameraRotation.y*e,this.noRotationConstraint||(this.rotation.x>1.570796&&(this.rotation.x=1.570796),this.rotation.x<-1.570796&&(this.rotation.x=-1.570796)),this.rotationQuaternion&&this.rotation.lengthSquared()&&ue.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)),t&&(Math.abs(this.cameraDirection.x){}}add(e){const t=e.getSimpleName();if(this.attached[t]){H.Warn("camera input of type "+t+" already exists on camera");return}this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault)}remove(e){for(const t in this.attached){const i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){const t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement){e=de.ForceAttachControlToAlwaysPreventDefault?!1:e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){const t={};for(const i in this.attached){const s=this.attached[i],n=Se.Serialize(s);t[s.getClassName()]=n}e.inputsmgr=t}parse(e){const t=e.inputsmgr;if(t){this.clear();for(const i in t){const s=Kn[i];if(s){const n=t[i],r=Se.Parse(()=>new s,n,null);this.add(r)}}}else for(const i in this.attached){const s=Kn[this.attached[i].getClassName()];if(s){const n=Se.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(n)}}}}class kl{constructor(){this._currentActiveButton=-1,this.buttons=[0,1,2]}attachControl(e){e=re.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),i=t.getInputElement();let s=0,n=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=o=>{var l,h;const c=o.event,u=c.pointerType==="touch";if(t.isInVRExclusivePointerMode||o.type!==Re.POINTERMOVE&&this.buttons.indexOf(c.button)===-1)return;const d=c.target;if(this._altKey=c.altKey,this._ctrlKey=c.ctrlKey,this._metaKey=c.metaKey,this._shiftKey=c.shiftKey,this._buttonsPressed=c.buttons,t.isPointerLock){const _=c.movementX,f=c.movementY;this.onTouch(null,_,f),this._pointA=null,this._pointB=null}else{if(o.type!==Re.POINTERDOWN&&u&&((l=this._pointA)===null||l===void 0?void 0:l.pointerId)!==c.pointerId&&((h=this._pointB)===null||h===void 0?void 0:h.pointerId)!==c.pointerId)return;if(o.type===Re.POINTERDOWN&&(this._currentActiveButton===-1||u)){try{d==null||d.setPointerCapture(c.pointerId)}catch{}if(this._pointA===null)this._pointA={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType};else if(this._pointB===null)this._pointB={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType};else return;this._currentActiveButton===-1&&!u&&(this._currentActiveButton=c.button),this.onButtonDown(c),e||(c.preventDefault(),i&&i.focus())}else if(o.type===Re.POINTERDOUBLETAP)this.onDoubleTap(c.pointerType);else if(o.type===Re.POINTERUP&&(this._currentActiveButton===c.button||u)){try{d==null||d.releasePointerCapture(c.pointerId)}catch{}u||(this._pointB=null),t._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==c.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==c.pointerId?this._pointB=null:this._pointA=this._pointB=null,(s!==0||n)&&(this.onMultiTouch(this._pointA,this._pointB,s,0,n,null),s=0,n=null),this._currentActiveButton=-1,this.onButtonUp(c),e||c.preventDefault()}else if(o.type===Re.POINTERMOVE){if(e||c.preventDefault(),this._pointA&&this._pointB===null){const _=c.clientX-this._pointA.x,f=c.clientY-this._pointA.y;this.onTouch(this._pointA,_,f),this._pointA.x=c.clientX,this._pointA.y=c.clientY}else if(this._pointA&&this._pointB){const _=this._pointA.pointerId===c.pointerId?this._pointA:this._pointB;_.x=c.clientX,_.y=c.clientY;const f=this._pointA.x-this._pointB.x,g=this._pointA.y-this._pointB.y,p=f*f+g*g,x={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:c.pointerId,type:o.type};this.onMultiTouch(this._pointA,this._pointB,s,p,n,x),n=x,s=p}}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,Re.POINTERDOWN|Re.POINTERUP|Re.POINTERMOVE|Re.POINTERDOUBLETAP),this._onLostFocus=()=>{this._pointA=this._pointB=null,s=0,n=null,this.onLostFocus()},this._contextMenuBind=this.onContextMenu.bind(this),i&&i.addEventListener("contextmenu",this._contextMenuBind,!1);const r=this.camera.getScene().getEngine().getHostWindow();r&&re.RegisterTopRootEvents(r,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){const e=this.camera.getScene().getEngine().getHostWindow();e&&re.UnregisterTopRootEvents(e,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){const e=this.camera.getScene().getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentActiveButton=-1}getClassName(){return"BaseCameraPointersInput"}getSimpleName(){return"pointers"}onDoubleTap(e){}onTouch(e,t,i){}onMultiTouch(e,t,i,s,n,r){}onContextMenu(e){e.preventDefault()}onButtonDown(e){}onButtonUp(e){}onLostFocus(){}}F([B()],kl.prototype,"buttons",void 0);class ui extends kl{constructor(){super(...arguments),this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.useNaturalPinchZoom=!1,this.pinchZoom=!0,this.panningSensibility=1e3,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this.pinchInwards=!0,this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}getClassName(){return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(e,t){if(this.panningSensibility!==0&&e&&t){const i=t.x-e.x,s=t.y-e.y;this.camera.inertialPanningX+=-i/this.panningSensibility,this.camera.inertialPanningY+=s/this.panningSensibility}}_computePinchZoom(e,t){const i=this.camera.radius||ui.MinimumRadiusForPinch;this.useNaturalPinchZoom?this.camera.radius=i*Math.sqrt(e)/Math.sqrt(t):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=(t-e)*.001*i*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(t-e)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2)}onTouch(e,t,i){this.panningSensibility!==0&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=i/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=i/this.angularSensibilityY)}onDoubleTap(){this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(e,t,i,s,n,r){i===0&&n===null||s===0&&r===null||(this.multiTouchPanAndZoom?(this._computePinchZoom(i,s),this._computeMultiTouchPanning(n,r)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(s)-Math.sqrt(i))>this.camera.pinchToPanMaxDistance?(this._computePinchZoom(i,s),this._isPinching=!0):this._computeMultiTouchPanning(n,r)):this.multiTouchPanning?this._computeMultiTouchPanning(n,r):this.pinchZoom&&this._computePinchZoom(i,s))}onButtonDown(e){this._isPanClick=e.button===this.camera._panningMouseButton}onButtonUp(){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}}ui.MinimumRadiusForPinch=.001;F([B()],ui.prototype,"buttons",void 0);F([B()],ui.prototype,"angularSensibilityX",void 0);F([B()],ui.prototype,"angularSensibilityY",void 0);F([B()],ui.prototype,"pinchPrecision",void 0);F([B()],ui.prototype,"pinchDeltaPercentage",void 0);F([B()],ui.prototype,"useNaturalPinchZoom",void 0);F([B()],ui.prototype,"pinchZoom",void 0);F([B()],ui.prototype,"panningSensibility",void 0);F([B()],ui.prototype,"multiTouchPanning",void 0);F([B()],ui.prototype,"multiTouchPanAndZoom",void 0);Kn.ArcRotateCameraPointersInput=ui;class Ki{constructor(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}attachControl(e){e=re.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{const i=t.event;if(!i.metaKey){if(t.type===Xn.KEYDOWN)this._ctrlPressed=i.ctrlKey,this._altPressed=i.altKey,(this.keysUp.indexOf(i.keyCode)!==-1||this.keysDown.indexOf(i.keyCode)!==-1||this.keysLeft.indexOf(i.keyCode)!==-1||this.keysRight.indexOf(i.keyCode)!==-1||this.keysReset.indexOf(i.keyCode)!==-1)&&(this._keys.indexOf(i.keyCode)===-1&&this._keys.push(i.keyCode),i.preventDefault&&(e||i.preventDefault()));else if(this.keysUp.indexOf(i.keyCode)!==-1||this.keysDown.indexOf(i.keyCode)!==-1||this.keysLeft.indexOf(i.keyCode)!==-1||this.keysRight.indexOf(i.keyCode)!==-1||this.keysReset.indexOf(i.keyCode)!==-1){const s=this._keys.indexOf(i.keyCode);s>=0&&this._keys.splice(s,1),i.preventDefault&&(e||i.preventDefault())}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t0?i=s/(1+this.wheelDeltaPercentage):i=s*(1+this.wheelDeltaPercentage),i}attachControl(e){e=re.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==Re.POINTERWHEEL)return;const i=t.event;let s=0;const n=i.deltaMode===tr.DOM_DELTA_LINE?mf:1,r=-(i.deltaY*n);if(this.customComputeDeltaFromMouseWheel)s=this.customComputeDeltaFromMouseWheel(r,this,i);else if(this.wheelDeltaPercentage){if(s=this._computeDeltaFromMouseWheelLegacyEvent(r,this.camera.radius),s>0){let o=this.camera.radius,l=this.camera.inertialRadiusOffset+s;for(let h=0;h<20&&Math.abs(l)>.001;h++)o-=l,l*=this.camera.inertia;o=me.Clamp(o,0,Number.MAX_VALUE),s=this._computeDeltaFromMouseWheelLegacyEvent(r,o)}}else s=r/(this.wheelPrecision*40);s&&(this.zoomToMouseLocation&&this._hitPlane?this._zoomToMouse(s):this.camera.inertialRadiusOffset+=s),i.preventDefault&&(e||i.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,Re.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){if(!this.zoomToMouseLocation)return;const e=this.camera;0+e.inertialAlphaOffset+e.inertialBetaOffset+e.inertialRadiusOffset&&(this._updateHitPlane(),e.target.addInPlace(this._inertialPanning),this._inertialPanning.scaleInPlace(e.inertia),this._zeroIfClose(this._inertialPanning))}getClassName(){return"ArcRotateCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}_updateHitPlane(){const e=this.camera,t=e.target.subtract(e.position);this._hitPlane=ni.FromPositionAndNormal(e.target,t)}_getPosition(){var e;const t=this.camera,i=t.getScene(),s=i.createPickingRay(i.pointerX,i.pointerY,N.Identity(),t,!1);let n=0;return this._hitPlane&&(n=(e=s.intersectsPlane(this._hitPlane))!==null&&e!==void 0?e:0),s.origin.addInPlace(s.direction.scaleInPlace(n))}_zoomToMouse(e){var t,i;const s=this.camera,n=1-s.inertia;if(s.lowerRadiusLimit){const c=(t=s.lowerRadiusLimit)!==null&&t!==void 0?t:0;s.radius-(s.inertialRadiusOffset+e)/nc&&(e=(s.radius-c)*n-s.inertialRadiusOffset)}const o=e/n/s.radius,l=this._getPosition(),h=G.Vector3[6];l.subtractToRef(s.target,h),h.scaleInPlace(o),h.scaleInPlace(n),this._inertialPanning.addInPlace(h),s.inertialRadiusOffset+=e}_zeroIfClose(e){Math.abs(e.x)()=>new lt(a,0,0,1,v.Zero(),e));class lt extends Bt{get target(){return this._target}set target(e){this.setTarget(e)}get targetHost(){return this._targetHost}set targetHost(e){e&&this.setTarget(e)}getTarget(){return this.target}get position(){return this._position}set position(e){this.setPosition(e)}set upVector(e){this._upToYMatrix||(this._yToUpMatrix=new N,this._upToYMatrix=new N,this._upVector=v.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){N.RotationAlignToRef(v.UpReadOnly,this._upVector,this._yToUpMatrix),N.RotationAlignToRef(this._upVector,v.UpReadOnly,this._upToYMatrix)}get angularSensibilityX(){const e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0}set angularSensibilityX(e){const t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)}get angularSensibilityY(){const e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0}set angularSensibilityY(e){const t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)}get pinchPrecision(){const e=this.inputs.attached.pointers;return e?e.pinchPrecision:0}set pinchPrecision(e){const t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)}get pinchDeltaPercentage(){const e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0}set pinchDeltaPercentage(e){const t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)}get useNaturalPinchZoom(){const e=this.inputs.attached.pointers;return e?e.useNaturalPinchZoom:!1}set useNaturalPinchZoom(e){const t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)}get panningSensibility(){const e=this.inputs.attached.pointers;return e?e.panningSensibility:0}set panningSensibility(e){const t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)}get keysUp(){const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysDown(){const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysLeft(){const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get wheelPrecision(){const e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0}set wheelPrecision(e){const t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)}get zoomToMouseLocation(){const e=this.inputs.attached.mousewheel;return e?e.zoomToMouseLocation:!1}set zoomToMouseLocation(e){const t=this.inputs.attached.mousewheel;t&&(t.zoomToMouseLocation=e)}get wheelDeltaPercentage(){const e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0}set wheelDeltaPercentage(e){const t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)}get bouncingBehavior(){return this._bouncingBehavior}get useBouncingBehavior(){return this._bouncingBehavior!=null}set useBouncingBehavior(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new qs,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){return this._framingBehavior}get useFramingBehavior(){return this._framingBehavior!=null}set useFramingBehavior(e){e!==this.useFramingBehavior&&(e?(this._framingBehavior=new li,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){return this._autoRotationBehavior}get useAutoRotationBehavior(){return this._autoRotationBehavior!=null}set useAutoRotationBehavior(e){e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new ff,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(e,t,i,s,n,r,o=!0){super(e,v.Zero(),r,o),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.lowerAlphaLimit=null,this.upperAlphaLimit=null,this.lowerBetaLimit=.01,this.upperBetaLimit=Math.PI-.01,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.inertialPanningX=0,this.inertialPanningY=0,this.pinchToPanMaxDistance=20,this.panningDistanceLimit=null,this.panningOriginTarget=v.Zero(),this.panningInertia=.9,this.zoomOnFactor=1,this.targetScreenOffset=fe.Zero(),this.allowUpsideDown=!0,this.useInputToRestoreState=!0,this._viewMatrix=new N,this.panningAxis=new v(1,1,0),this._transformedDirection=new v,this.mapPanning=!1,this.onMeshTargetChangedObservable=new ee,this.checkCollisions=!1,this.collisionRadius=new v(.5,.5,.5),this._previousPosition=v.Zero(),this._collisionVelocity=v.Zero(),this._newPosition=v.Zero(),this._computationVector=v.Zero(),this._onCollisionPositionChange=(l,h,c=null)=>{c?(this.setPosition(h),this.onCollide&&this.onCollide(c)):this._previousPosition.copyFrom(this._position);const u=Math.cos(this.alpha),d=Math.sin(this.alpha),_=Math.cos(this.beta);let f=Math.sin(this.beta);f===0&&(f=1e-4);const g=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*u*f,this.radius*_,this.radius*d*f),g.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let p=this.upVector;this.allowUpsideDown&&this.beta<0&&(p=p.clone(),p=p.negate()),this._computeViewMatrix(this._position,g,p),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=v.Zero(),n&&this.setTarget(n),this.alpha=t,this.beta=i,this.radius=s,this.getViewMatrix(),this.inputs=new vf(this),this.inputs.addKeyboard().addMouseWheel().addPointers()}_initCache(){super._initCache(),this._cache._target=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=fe.Zero()}_updateCache(e){e||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){if(this._targetHost&&this._targetHost.getAbsolutePosition){const t=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?t.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(t)}const e=this._getLockedTargetPosition();return e||this._target}storeState(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0):!1}_isSynchronizedViewMatrix(){return super._isSynchronizedViewMatrix()?this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset):!1}attachControl(e,t,i=!0,s=2){const n=arguments;t=re.BackCompatCameraNoPreventDefault(n),this._useCtrlForPanning=i,this._panningMouseButton=s,typeof n[0]=="boolean"&&(n.length>1&&(this._useCtrlForPanning=n[1]),n.length>2&&(this._panningMouseButton=n[2])),this.inputs.attachElement(t),this._reset=()=>{this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){this.inputs.detachElement(),this._reset&&this._reset()}_checkInputs(){if(!this._collisionTriggered){if(this.inputs.checkInputs(),this.inertialAlphaOffset!==0||this.inertialBetaOffset!==0||this.inertialRadiusOffset!==0){const e=this.invertRotation?-1:1;let t=this.inertialAlphaOffset;this.beta<=0&&(t*=-1),this.getScene().useRightHandedSystem&&(t*=-1),this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(t*=-1),this.alpha+=t*e,this.beta+=this.inertialBetaOffset*e,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)Math.PI&&(this.beta=this.beta-2*Math.PI):this.betathis.upperBetaLimit&&(this.beta=this.upperBetaLimit),this.lowerAlphaLimit!==null&&this.alphathis.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),this.lowerRadiusLimit!==null&&this.radiusthis.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0)}rebuildAnglesAndRadius(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&v.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),this.radius===0&&(this.radius=1e-4);const e=this.alpha;this._computationVector.x===0&&this._computationVector.z===0?this.alpha=Math.PI/2:this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha);const t=Math.round((e-this.alpha)/(2*Math.PI));this.alpha+=t*2*Math.PI,this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()}setPosition(e){this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())}setTarget(e,t=!1,i=!1,s=!1){var n;if(s=(n=this.overrideCloneAlphaBetaRadius)!==null&&n!==void 0?n:s,e.getBoundingInfo)t?this._targetBoundingCenter=e.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{const r=e,o=this._getTargetPosition();if(o&&!i&&o.equals(r))return;this._targetHost=null,this._target=r,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}s||this.rebuildAnglesAndRadius()}_getViewMatrix(){const e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta);let s=Math.sin(this.beta);s===0&&(s=1e-4),this.radius===0&&(this.radius=1e-4);const n=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*s,this.radius*i,this.radius*t*s),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&v.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),n.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){const r=this.getScene().collisionCoordinator;this._collider||(this._collider=r.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,r.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let r=this.upVector;this.allowUpsideDown&&s<0&&(r=r.negate()),this._computeViewMatrix(this._position,n,r),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=n,this._viewMatrix}zoomOn(e,t=!1){e=e||this.getScene().meshes;const i=O.MinMax(e),s=v.Distance(i.min,i.max);this.radius=s*this.zoomOnFactor,this.focusOn({min:i.min,max:i.max,distance:s},t)}focusOn(e,t=!1){let i,s;if(e.min===void 0){const n=e||this.getScene().meshes;i=O.MinMax(n),s=v.Distance(i.min,i.max)}else{const n=e;i=n,s=n.distance}this._target=O.Center(i),t||(this.maxZ=s*2)}createRigCamera(e,t){let i=0;switch(this.cameraRigMode){case de.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case de.RIG_MODE_STEREOSCOPIC_OVERUNDER:case de.RIG_MODE_STEREOSCOPIC_INTERLACED:case de.RIG_MODE_VR:i=this._cameraRigParams.stereoHalfAngle*(t===0?1:-1);break;case de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:i=this._cameraRigParams.stereoHalfAngle*(t===0?-1:1);break}const s=new lt(e,this.alpha+i,this.beta,this.radius,this._target,this.getScene());return s._cameraRigParams={},s.isRigCamera=!0,s.rigParent=this,s.upVector=this.upVector,s.mode=this.mode,s.orthoLeft=this.orthoLeft,s.orthoRight=this.orthoRight,s.orthoBottom=this.orthoBottom,s.orthoTop=this.orthoTop,s}_updateRigCameras(){const e=this._rigCameras[0],t=this._rigCameras[1];switch(e.beta=t.beta=this.beta,this.cameraRigMode){case de.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case de.RIG_MODE_STEREOSCOPIC_OVERUNDER:case de.RIG_MODE_STEREOSCOPIC_INTERLACED:case de.RIG_MODE_VR:e.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case de.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:e.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle;break}super._updateRigCameras()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}}F([B()],lt.prototype,"alpha",void 0);F([B()],lt.prototype,"beta",void 0);F([B()],lt.prototype,"radius",void 0);F([B()],lt.prototype,"overrideCloneAlphaBetaRadius",void 0);F([wi("target")],lt.prototype,"_target",void 0);F([El("targetHost")],lt.prototype,"_targetHost",void 0);F([B()],lt.prototype,"inertialAlphaOffset",void 0);F([B()],lt.prototype,"inertialBetaOffset",void 0);F([B()],lt.prototype,"inertialRadiusOffset",void 0);F([B()],lt.prototype,"lowerAlphaLimit",void 0);F([B()],lt.prototype,"upperAlphaLimit",void 0);F([B()],lt.prototype,"lowerBetaLimit",void 0);F([B()],lt.prototype,"upperBetaLimit",void 0);F([B()],lt.prototype,"lowerRadiusLimit",void 0);F([B()],lt.prototype,"upperRadiusLimit",void 0);F([B()],lt.prototype,"inertialPanningX",void 0);F([B()],lt.prototype,"inertialPanningY",void 0);F([B()],lt.prototype,"pinchToPanMaxDistance",void 0);F([B()],lt.prototype,"panningDistanceLimit",void 0);F([wi()],lt.prototype,"panningOriginTarget",void 0);F([B()],lt.prototype,"panningInertia",void 0);F([B()],lt.prototype,"zoomToMouseLocation",null);F([B()],lt.prototype,"zoomOnFactor",void 0);F([Al()],lt.prototype,"targetScreenOffset",void 0);F([B()],lt.prototype,"allowUpsideDown",void 0);F([B()],lt.prototype,"useInputToRestoreState",void 0);class Le extends At{get range(){return this._range}set range(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)}get intensityMode(){return this._intensityMode}set intensityMode(e){this._intensityMode=e,this._computePhotometricScale()}get radius(){return this._radius}set radius(e){this._radius=e,this._computePhotometricScale()}get shadowEnabled(){return this._shadowEnabled}set shadowEnabled(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())}get includedOnlyMeshes(){return this._includedOnlyMeshes}set includedOnlyMeshes(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)}get excludedMeshes(){return this._excludedMeshes}set excludedMeshes(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)}get excludeWithLayerMask(){return this._excludeWithLayerMask}set excludeWithLayerMask(e){this._excludeWithLayerMask=e,this._resyncMeshes()}get includeOnlyWithLayerMask(){return this._includeOnlyWithLayerMask}set includeOnlyWithLayerMask(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()}get lightmapMode(){return this._lightmapMode}set lightmapMode(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())}constructor(e,t){super(e,t),this.diffuse=new he(1,1,1),this.specular=new he(1,1,1),this.falloffType=Le.FALLOFF_DEFAULT,this.intensity=1,this._range=Number.MAX_VALUE,this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=Le.INTENSITYMODE_AUTOMATIC,this._radius=1e-5,this.renderPriority=0,this._shadowEnabled=!0,this._excludeWithLayerMask=0,this._includeOnlyWithLayerMask=0,this._lightmapMode=0,this._shadowGenerators=null,this._excludedMeshesIds=new Array,this._includedOnlyMeshesIds=new Array,this._isLight=!0,this.getScene().addLight(this),this._uniformBuffer=new oe(this.getScene().getEngine(),void 0,void 0,e),this._buildUniformLayout(),this.includedOnlyMeshes=new Array,this.excludedMeshes=new Array,this._resyncMeshes()}transferTexturesToEffect(e,t){return this}_bindLight(e,t,i,s,n=!0){var r;const o=e.toString();let l=!1;if(this._uniformBuffer.bindToEffect(i,"Light"+o),this._renderId!==t.getRenderId()||this._lastUseSpecular!==s||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId(),this._lastUseSpecular=s;const h=this.getScaledIntensity();this.transferToEffect(i,o),this.diffuse.scaleToRef(h,ln.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",ln.Color3[0],this.range,o),s&&(this.specular.scaleToRef(h,ln.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",ln.Color3[1],this.radius,o)),l=!0}if(this.transferTexturesToEffect(i,o),t.shadowsEnabled&&this.shadowEnabled&&n){const h=(r=this.getShadowGenerator(t.activeCamera))!==null&&r!==void 0?r:this.getShadowGenerator();h&&(h.bindShadowLight(o,i),l=!0)}l?this._uniformBuffer.update():this._uniformBuffer.bindUniformBuffer()}getClassName(){return"Light"}toString(e){let t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(let i=0;i0&&this.includedOnlyMeshes.indexOf(e)===-1||this.excludedMeshes&&this.excludedMeshes.length>0&&this.excludedMeshes.indexOf(e)!==-1||this.includeOnlyWithLayerMask!==0&&!(this.includeOnlyWithLayerMask&e.layerMask)||this.excludeWithLayerMask!==0&&this.excludeWithLayerMask&e.layerMask):!0}dispose(e,t=!1){if(this._shadowGenerators){const i=this._shadowGenerators.values();for(let s=i.next();s.done!==!0;s=i.next())s.value.dispose();this._shadowGenerators=null}if(this.getScene().stopAnimation(this),this._parentContainer){const i=this._parentContainer.lights.indexOf(this);i>-1&&this._parentContainer.lights.splice(i,1),this._parentContainer=null}for(const i of this.getScene().meshes)i._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),super.dispose(e,t)}getTypeID(){return 0}getScaledIntensity(){return this._photometricScale*this.intensity}clone(e,t=null){const i=Le.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!i)return null;const s=Se.Clone(i,this);return e&&(s.name=e),t&&(s.parent=t),s.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(s),s}serialize(){const e=Se.Serialize(this);return e.uniqueId=this.uniqueId,e.type=this.getTypeID(),this.parent&&this.parent._serializeAsParent(e),this.excludedMeshes.length>0&&(e.excludedMeshesIds=[],this.excludedMeshes.forEach(t=>{e.excludedMeshesIds.push(t.id)})),this.includedOnlyMeshes.length>0&&(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes.forEach(t=>{e.includedOnlyMeshesIds.push(t.id)})),Se.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}static GetConstructorFromName(e,t,i){const s=At.Construct("Light_Type_"+e,t,i);return s||null}static Parse(e,t){const i=Le.GetConstructorFromName(e.type,e.name,t);if(!i)return null;const s=Se.Parse(i,e,t);if(e.excludedMeshesIds&&(s._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(s._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.falloffType!==void 0&&(s.falloffType=e.falloffType),e.lightmapMode!==void 0&&(s.lightmapMode=e.lightmapMode),e.animations){for(let n=0;n{const n=t.apply(e,s);for(const r of s)r._resyncLightSource(this);return n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);for(const o of r)o._resyncLightSource(this);return r};for(const s of e)s._resyncLightSource(this)}_hookArrayForIncludedOnly(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._resyncMeshes(),n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);return this._resyncMeshes(),r},this._resyncMeshes()}_resyncMeshes(){for(const e of this.getScene().meshes)e._resyncLightSource(this)}_markMeshesAsLightDirty(){for(const e of this.getScene().meshes)e.lightSources.indexOf(this)!==-1&&e._markSubMeshesAsLightDirty()}_computePhotometricScale(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()}_getPhotometricScale(){let e=0;const t=this.getTypeID();let i=this.intensityMode;switch(i===Le.INTENSITYMODE_AUTOMATIC&&(t===Le.LIGHTTYPEID_DIRECTIONALLIGHT?i=Le.INTENSITYMODE_ILLUMINANCE:i=Le.INTENSITYMODE_LUMINOUSINTENSITY),t){case Le.LIGHTTYPEID_POINTLIGHT:case Le.LIGHTTYPEID_SPOTLIGHT:switch(i){case Le.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case Le.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case Le.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius;break}break;case Le.LIGHTTYPEID_DIRECTIONALLIGHT:switch(i){case Le.INTENSITYMODE_ILLUMINANCE:e=1;break;case Le.INTENSITYMODE_LUMINANCE:{let s=this.radius;s=Math.max(s,.001),e=2*Math.PI*(1-Math.cos(s));break}}break;case Le.LIGHTTYPEID_HEMISPHERICLIGHT:e=1;break}return e}_reorderLightsInScene(){const e=this.getScene();this._renderPriority!=0&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()}}Le.FALLOFF_DEFAULT=Ke.FALLOFF_DEFAULT;Le.FALLOFF_PHYSICAL=Ke.FALLOFF_PHYSICAL;Le.FALLOFF_GLTF=Ke.FALLOFF_GLTF;Le.FALLOFF_STANDARD=Ke.FALLOFF_STANDARD;Le.LIGHTMAP_DEFAULT=Ke.LIGHTMAP_DEFAULT;Le.LIGHTMAP_SPECULAR=Ke.LIGHTMAP_SPECULAR;Le.LIGHTMAP_SHADOWSONLY=Ke.LIGHTMAP_SHADOWSONLY;Le.INTENSITYMODE_AUTOMATIC=Ke.INTENSITYMODE_AUTOMATIC;Le.INTENSITYMODE_LUMINOUSPOWER=Ke.INTENSITYMODE_LUMINOUSPOWER;Le.INTENSITYMODE_LUMINOUSINTENSITY=Ke.INTENSITYMODE_LUMINOUSINTENSITY;Le.INTENSITYMODE_ILLUMINANCE=Ke.INTENSITYMODE_ILLUMINANCE;Le.INTENSITYMODE_LUMINANCE=Ke.INTENSITYMODE_LUMINANCE;Le.LIGHTTYPEID_POINTLIGHT=Ke.LIGHTTYPEID_POINTLIGHT;Le.LIGHTTYPEID_DIRECTIONALLIGHT=Ke.LIGHTTYPEID_DIRECTIONALLIGHT;Le.LIGHTTYPEID_SPOTLIGHT=Ke.LIGHTTYPEID_SPOTLIGHT;Le.LIGHTTYPEID_HEMISPHERICLIGHT=Ke.LIGHTTYPEID_HEMISPHERICLIGHT;F([_s()],Le.prototype,"diffuse",void 0);F([_s()],Le.prototype,"specular",void 0);F([B()],Le.prototype,"falloffType",void 0);F([B()],Le.prototype,"intensity",void 0);F([B()],Le.prototype,"range",null);F([B()],Le.prototype,"intensityMode",null);F([B()],Le.prototype,"radius",null);F([B()],Le.prototype,"_renderPriority",void 0);F([je("_reorderLightsInScene")],Le.prototype,"renderPriority",void 0);F([B("shadowEnabled")],Le.prototype,"_shadowEnabled",void 0);F([B("excludeWithLayerMask")],Le.prototype,"_excludeWithLayerMask",void 0);F([B("includeOnlyWithLayerMask")],Le.prototype,"_includeOnlyWithLayerMask",void 0);F([B("lightmapMode")],Le.prototype,"_lightmapMode",void 0);class sr extends Le{constructor(){super(...arguments),this._needProjectionMatrixCompute=!0}_setPosition(e){this._position=e}get position(){return this._position}set position(e){this._setPosition(e)}_setDirection(e){this._direction=e}get direction(){return this._direction}set direction(e){this._setDirection(e)}get shadowMinZ(){return this._shadowMinZ}set shadowMinZ(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()}get shadowMaxZ(){return this._shadowMaxZ}set shadowMaxZ(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()}computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(this.transformedPosition||(this.transformedPosition=v.Zero()),v.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=v.Zero()),v.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),!0):!1}getDepthScale(){return 50}getShadowDirection(e){return this.transformedDirection?this.transformedDirection:this.direction}getAbsolutePosition(){return this.transformedPosition?this.transformedPosition:this.position}setDirectionToTarget(e){return this.direction=v.Normalize(e.subtract(this.position)),this.direction}getRotation(){this.direction.normalize();const e=v.Cross(this.direction,Qt.Y),t=v.Cross(e,this.direction);return v.RotationFromAxis(e,t,this.direction)}needCube(){return!1}needProjectionMatrixCompute(){return this._needProjectionMatrixCompute}forceProjectionMatrixCompute(){this._needProjectionMatrixCompute=!0}_initCache(){super._initCache(),this._cache.position=v.Zero()}_isSynchronized(){return!!this._cache.position.equals(this.position)}computeWorldMatrix(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=N.Identity()),N.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix)}getDepthMinZ(e){return this.shadowMinZ!==void 0?this.shadowMinZ:e.minZ}getDepthMaxZ(e){return this.shadowMaxZ!==void 0?this.shadowMaxZ:e.maxZ}setShadowProjectionMatrix(e,t,i){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this}_syncParentEnabledState(){super._syncParentEnabledState(),(!this.parent||!this.parent.getWorldMatrix)&&(this.transformedPosition=null,this.transformedDirection=null)}}F([wi()],sr.prototype,"position",null);F([wi()],sr.prototype,"direction",null);F([B()],sr.prototype,"shadowMinZ",null);F([B()],sr.prototype,"shadowMaxZ",null);At.AddNodeConstructor("Light_Type_0",(a,e)=>()=>new E0(a,v.Zero(),e));class E0 extends sr{get shadowAngle(){return this._shadowAngle}set shadowAngle(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(e){const t=this.needCube();if(this._direction=e,this.needCube()!==t&&this._shadowGenerators){const i=this._shadowGenerators.values();for(let s=i.next();s.done!==!0;s=i.next())s.value.recreateShadowMap()}}constructor(e,t,i){super(e,i),this._shadowAngle=Math.PI/2,this.position=t}getClassName(){return"PointLight"}getTypeID(){return Le.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(e){if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new v(1,0,0);case 1:return new v(-1,0,0);case 2:return new v(0,-1,0);case 3:return new v(0,1,0);case 4:return new v(0,0,1);case 5:return new v(0,0,-1)}return v.Zero()}_setDefaultShadowProjectionMatrix(e,t,i){const s=this.getScene().activeCamera;if(!s)return;const n=this.shadowMinZ!==void 0?this.shadowMinZ:s.minZ,r=this.shadowMaxZ!==void 0?this.shadowMaxZ:s.maxZ,o=this.getScene().getEngine().useReverseDepthBuffer;N.PerspectiveFovLHToRef(this.shadowAngle,1,o?r:n,o?n:r,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,o)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this}transferToNodeMaterialEffect(e,t){return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this}prepareLightSpecificDefines(e,t){e["POINTLIGHT"+t]=!0}}F([B()],E0.prototype,"shadowAngle",null);class wo{constructor(){this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,s,n){if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&t.prePassRenderer.getIndex(2)!==-1){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=s.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());const r=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==r.frameId&&(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=s.clone()}}}class C0 extends j{constructor(e,t,i=!0){super(e,t),this._normalMatrix=new N,this._storeEffectOnSubMeshes=i}getEffect(){return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(e,t){return e?!this._storeEffectOnSubMeshes||!e.subMeshes||e.subMeshes.length===0?!0:this.isReadyForSubMesh(e,e.subMeshes[0],t):!1}_isReadyForSubMesh(e){const t=e.materialDefines;return!!(!this.checkReadyOnEveryCall&&e.effect&&t&&t._renderId===this.getScene().getRenderId())}bindOnlyWorldMatrix(e){this._activeEffect.setMatrix("world",e)}bindOnlyNormalMatrix(e){this._activeEffect.setMatrix("normalMatrix",e)}bind(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])}_afterBind(e,t=null){super._afterBind(e,t),this.getScene()._cachedEffect=t,t&&(t._forceRebindOnNextCall=!1)}_mustRebind(e,t,i=1){return e.isCachedMaterialInvalid(this,t,i)}dispose(e,t,i){this._activeEffect=void 0,super.dispose(e,t,i)}}class Oe{static get DiffuseTextureEnabled(){return this._DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get DetailTextureEnabled(){return this._DetailTextureEnabled}static set DetailTextureEnabled(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get DecalMapEnabled(){return this._DecalMapEnabled}static set DecalMapEnabled(e){this._DecalMapEnabled!==e&&(this._DecalMapEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get AmbientTextureEnabled(){return this._AmbientTextureEnabled}static set AmbientTextureEnabled(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get OpacityTextureEnabled(){return this._OpacityTextureEnabled}static set OpacityTextureEnabled(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get ReflectionTextureEnabled(){return this._ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get EmissiveTextureEnabled(){return this._EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get SpecularTextureEnabled(){return this._SpecularTextureEnabled}static set SpecularTextureEnabled(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get BumpTextureEnabled(){return this._BumpTextureEnabled}static set BumpTextureEnabled(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get LightmapTextureEnabled(){return this._LightmapTextureEnabled}static set LightmapTextureEnabled(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get RefractionTextureEnabled(){return this._RefractionTextureEnabled}static set RefractionTextureEnabled(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get ColorGradingTextureEnabled(){return this._ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get FresnelEnabled(){return this._FresnelEnabled}static set FresnelEnabled(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,Y.MarkAllMaterialsAsDirty(4))}static get ClearCoatTextureEnabled(){return this._ClearCoatTextureEnabled}static set ClearCoatTextureEnabled(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get ClearCoatBumpTextureEnabled(){return this._ClearCoatBumpTextureEnabled}static set ClearCoatBumpTextureEnabled(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get ClearCoatTintTextureEnabled(){return this._ClearCoatTintTextureEnabled}static set ClearCoatTintTextureEnabled(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get SheenTextureEnabled(){return this._SheenTextureEnabled}static set SheenTextureEnabled(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get AnisotropicTextureEnabled(){return this._AnisotropicTextureEnabled}static set AnisotropicTextureEnabled(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get ThicknessTextureEnabled(){return this._ThicknessTextureEnabled}static set ThicknessTextureEnabled(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get RefractionIntensityTextureEnabled(){return this._ThicknessTextureEnabled}static set RefractionIntensityTextureEnabled(e){this._RefractionIntensityTextureEnabled!==e&&(this._RefractionIntensityTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get TranslucencyIntensityTextureEnabled(){return this._ThicknessTextureEnabled}static set TranslucencyIntensityTextureEnabled(e){this._TranslucencyIntensityTextureEnabled!==e&&(this._TranslucencyIntensityTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}static get IridescenceTextureEnabled(){return this._IridescenceTextureEnabled}static set IridescenceTextureEnabled(e){this._IridescenceTextureEnabled!==e&&(this._IridescenceTextureEnabled=e,Y.MarkAllMaterialsAsDirty(1))}}Oe._DiffuseTextureEnabled=!0;Oe._DetailTextureEnabled=!0;Oe._DecalMapEnabled=!0;Oe._AmbientTextureEnabled=!0;Oe._OpacityTextureEnabled=!0;Oe._ReflectionTextureEnabled=!0;Oe._EmissiveTextureEnabled=!0;Oe._SpecularTextureEnabled=!0;Oe._BumpTextureEnabled=!0;Oe._LightmapTextureEnabled=!0;Oe._RefractionTextureEnabled=!0;Oe._ColorGradingTextureEnabled=!0;Oe._FresnelEnabled=!0;Oe._ClearCoatTextureEnabled=!0;Oe._ClearCoatBumpTextureEnabled=!0;Oe._ClearCoatTintTextureEnabled=!0;Oe._SheenTextureEnabled=!0;Oe._AnisotropicTextureEnabled=!0;Oe._ThicknessTextureEnabled=!0;Oe._RefractionIntensityTextureEnabled=!0;Oe._TranslucencyIntensityTextureEnabled=!0;Oe._IridescenceTextureEnabled=!0;const xf="decalFragmentDeclaration",bf="#ifdef DECAL\nuniform vec4 vDecalInfos;\n#endif\n";te.IncludesShadersStore[xf]=bf;const yf="defaultFragmentDeclaration",Tf="uniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform vec3 vAmbientColor;\nuniform float visibility;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)\nuniform vec3 vRefractionPosition;\nuniform vec3 vRefractionSize; \n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize; \n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;\n#endif\n#include\n#define ADDITIONAL_FRAGMENT_DECLARATION\n";te.IncludesShadersStore[yf]=Tf;const Sf="sceneUboDeclaration",Af="layout(std140,column_major) uniform;\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif \nmat4 view;\nmat4 projection;\nvec4 vEyePosition;\n};\n";te.IncludesShadersStore[Sf]=Af;const Ef="meshUboDeclaration",Cf="#ifdef WEBGL2\nuniform mat4 world;\nuniform float visibility;\n#else\nlayout(std140,column_major) uniform;\nuniform Mesh\n{\nmat4 world;\nfloat visibility;\n};\n#endif\n#define WORLD_UBO\n";te.IncludesShadersStore[Ef]=Cf;const Rf="defaultUboDeclaration",If="layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nfloat alphaCutOff;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec3 vRefractionPosition;\nvec3 vRefractionSize;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nvec4 vDiffuseColor;\nvec3 vAmbientColor;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include\n#include\n";te.IncludesShadersStore[Rf]=If;const Mf="prePassDeclaration",Pf="#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;\n#ifdef PREPASS_DEPTH\nvarying highp vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nvarying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;\n#endif\n#endif\n";te.IncludesShadersStore[Mf]=Pf;const wf="oitDeclaration",Df="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out vec2 depth; \nlayout(location=1) out vec4 frontColor;\nlayout(location=2) out vec4 backColor;\n#define MAX_DEPTH 99999.0\nhighp vec4 gl_FragColor;\nuniform sampler2D oitDepthSampler;\nuniform sampler2D oitFrontColorSampler;\n#endif\n";te.IncludesShadersStore[wf]=Df;const Ff="mainUVVaryingDeclaration",Of="#ifdef MAINUV{X}\nvarying vec2 vMainUV{X};\n#endif\n";te.IncludesShadersStore[Ff]=Of;const Lf="helperFunctions",Bf="const float PI=3.1415926535897932384626433832795;\nconst float HALF_MIN=5.96046448e-08; \nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nconst float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\n#if USE_EXACT_SRGB_CONVERSIONS\nvec3 toLinearSpaceExact(vec3 color)\n{\nvec3 nearZeroSection=0.0773993808*color;\nvec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));\n#else\nreturn\nvec3(\ncolor.r<=0.04045 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.04045 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.04045 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\nvec3 toGammaSpaceExact(vec3 color)\n{\nvec3 nearZeroSection=12.92*color;\nvec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));\n#else\nreturn\nvec3(\ncolor.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\n#endif\nfloat toLinearSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=0.0773993808*color;\nfloat remainingSection=pow(0.947867299*(color+0.055),2.4);\nreturn color<=0.04045 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nvec3 toLinearSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nvec4 toLinearSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfloat toGammaSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=12.92*color;\nfloat remainingSection=1.055*pow(color,0.41666)-0.055;\nreturn color<=0.0031308 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,GammaEncodePowerApprox);\n#endif\n}\nvec3 toGammaSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nvec4 toGammaSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nvec3 square(vec3 value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat normVariance=varianceAmount/255.0;\nfloat dither=mix(-normVariance,normVariance,rand);\nreturn dither;\n}\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D =max(rgbdMaxRange/maxRGB,1.);\nD =clamp(floor(D)/255.0,0.,1.);\nvec3 rgb=color.rgb*D;\nrgb=toGammaSpace(rgb);\nreturn vec4(clamp(rgb,0.,1.),D); \n}\nvec3 fromRGBD(vec4 rgbd) {\nrgbd.rgb=toLinearSpace(rgbd.rgb);\nreturn rgbd.rgb/rgbd.a;\n}\nvec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\nvec3 intersectPositionWS=vertexPos+origVec*distance;\nreturn intersectPositionWS-cubePos;\n}\n";te.IncludesShadersStore[Lf]=Bf;const Nf="lightFragmentDeclaration",Uf="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif\n";te.IncludesShadersStore[Nf]=Uf;const kf="lightUboDeclaration",Vf="#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X}; \n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";te.IncludesShadersStore[kf]=Vf;const Gf="lightsFragmentFunctions",Wf="struct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w==0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}";te.IncludesShadersStore[Gf]=Wf;const zf="shadowsFragmentFunctions",Hf="#ifdef SHADOWS\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\n#ifndef SHADOWFLOAT\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\n#define inline\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;\n}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n#ifndef SHADOWFLOAT\nif (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#ifdef IS_NDC_HALF_ZRANGE\n#define ZINCLIP clipSpace.z\n#else\n#define ZINCLIP uvDepth.z\n#endif\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define GREATEST_LESS_THAN_ONE 0.99999994\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat shadow=texture2D(shadowSampler,uvDepthLayer);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=ZINCLIP;\nfloat shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=ZINCLIP;\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);\nshadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);\nshadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);\nshadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=ZINCLIP;\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);\nshadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);\nshadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);\nshadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);\nshadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);\nshadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);\nshadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);\nshadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);\nshadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=ZINCLIP;\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; ithis._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){this._mesh=t,ethis._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let s=0;s0&&(n.computeBonesUsingShaders=!1);continue}if(!(!n.computeBonesUsingShaders||n.numBoneInfluencers===0)){if(n.material.getEffect()===t)n.computeBonesUsingShaders=!1;else if(n.subMeshes){for(const r of n.subMeshes)if(r.effect===t){n.computeBonesUsingShaders=!1;break}}}}}else{const i=this._defines[this._currentRank];if(i)for(let s=0;ss.priority-n.priority),this._codeInjectionPoints={};const i={};i[Ms._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0};for(const s of this._plugins)s.collectDefines(i),this._collectPointNames("vertex",s.getCustomCode("vertex")),this._collectPointNames("fragment",s.getCustomCode("fragment"));this._defineNamesFromPlugins=i}_activatePlugin(e){this._activePlugins.indexOf(e)===-1&&(this._activePlugins.push(e),this._activePlugins.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRenderTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){for(let t=0;t0&&s.uniforms.push(...this._uniformList),this._samplerList.length>0&&s.samplers.push(...this._samplerList),this._uboList.length>0&&s.uniformBuffersNames.push(...this._uboList),s.customCode=this._injectCustomCode(s.customCode);break}case Zt.PrepareUniformBuffer:{const s=t;this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];for(const n of this._plugins){const r=n.getUniforms();if(r){if(r.ubo)for(const o of r.ubo){if(o.size&&o.type){const l=(i=o.arraySize)!==null&&i!==void 0?i:0;s.ubo.addUniform(o.name,o.size,l),this._uboDeclaration+="".concat(o.type," ").concat(o.name).concat(l>0?"[".concat(l,"]"):"",";\r\n")}this._uniformList.push(o.name)}r.vertex&&(this._vertexDeclaration+=r.vertex+"\r\n"),r.fragment&&(this._fragmentDeclaration+=r.fragment+"\r\n")}n.getSamplers(this._samplerList),n.getUniformBuffersNames(this._uboList)}break}}}_collectPointNames(e,t){if(t)for(const i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e){return(t,i)=>{var s;e&&(i=e(t,i)),this._uboDeclaration&&(i=i.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(i=i.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(i=i.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const n=(s=this._codeInjectionPoints)===null||s===void 0?void 0:s[t];if(!n)return i;for(let r in n){let o="";for(const l of this._activePlugins){const h=l.getCustomCode(t);h!=null&&h[r]&&(o+=h[r]+"\r\n")}if(o.length>0)if(r.charAt(0)==="!"){r=r.substring(1);let l="g";if(r.charAt(0)==="!")l="",r=r.substring(1);else{const d=Np.exec(r);d&&d.length>=2&&(l=d[1],r=r.substring(l.length+1))}l.indexOf("g")<0&&(l+="g");const h=i,c=new RegExp(r,l);let u=c.exec(h);for(;u!==null;){let d=o;for(let _=0;_{e.pluginManager=void 0})),this._pluginDefineNames=s,this._pluginManager=e.pluginManager,n&&this._pluginManager._addPlugin(this),r&&this._enable(!0),this.markAllDefinesAsDirty=e._dirtyCallbacks[63]}getClassName(){return"MaterialPluginBase"}isReadyForSubMesh(e,t,i,s){return!0}hardBindForSubMesh(e,t,i,s){}bindForSubMesh(e,t,i,s){}dispose(e){}getCustomCode(e){return null}collectDefines(e){if(this._pluginDefineNames)for(const t of Object.keys(this._pluginDefineNames)){if(t[0]==="_")continue;const i=typeof this._pluginDefineNames[t];e[t]={type:i==="number"?"number":i==="string"?"string":i==="boolean"?"boolean":"object",default:this._pluginDefineNames[t]}}}prepareDefinesBeforeAttributes(e,t,i){}prepareDefines(e,t,i){}hasTexture(e){return!1}hasRenderTargetTextures(){return!1}fillRenderTargetTextures(e){}getActiveTextures(e){}getAnimatables(e){}addFallbacks(e,t,i){return i}getSamplers(e){}getAttributes(e,t,i){}getUniformBuffersNames(e){}getUniforms(){return{}}copyTo(e){Se.Clone(()=>e,this)}serialize(){return Se.Serialize(this)}parse(e,t,i){Se.Parse(()=>this,e,t,i)}}F([B()],Zr.prototype,"name",void 0);F([B()],Zr.prototype,"priority",void 0);F([B()],Zr.prototype,"registerForExtraEvents",void 0);class Up extends y0{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}class Js extends Zr{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}constructor(e,t=!0){super(e,"DetailMap",140,new Up,t),this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=j.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){return this._isEnabled?!(e._areTexturesDirty&&t.texturesEnabled&&i.getCaps().standardDerivatives&&this._texture&&Oe.DetailTextureEnabled&&!this._texture.isReady()):!0}prepareDefines(e,t){if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;const i=t.getEngine();e._areTexturesDirty&&(i.getCaps().standardDerivatives&&this._texture&&Oe.DetailTextureEnabled&&this._isEnabled?(we.PrepareDefinesForMergedUV(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1}bindForSubMesh(e,t){if(!this._isEnabled)return;const i=this._material.isFrozen;(!e.useUbo||!i||!e.isSync)&&this._texture&&Oe.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),we.BindTextureMatrix(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&Oe.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture)}hasTexture(e){return this._texture===e}getActiveTextures(e){this._texture&&e.push(this._texture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){var t;e&&((t=this._texture)===null||t===void 0||t.dispose())}getClassName(){return"DetailMapConfiguration"}getSamplers(e){e.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}}F([Si("detailTexture"),je("_markAllSubMeshesAsTexturesDirty")],Js.prototype,"texture",void 0);F([B()],Js.prototype,"diffuseBlendLevel",void 0);F([B()],Js.prototype,"roughnessBlendLevel",void 0);F([B()],Js.prototype,"bumpLevel",void 0);F([B(),je("_markAllSubMeshesAsTexturesDirty")],Js.prototype,"normalBlendMethod",void 0);F([B(),je("_markAllSubMeshesAsTexturesDirty")],Js.prototype,"isEnabled",void 0);const Sa={effect:null,subMesh:null};class kp extends y0{constructor(e){super(e),this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.PREPASS=!1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=!1,this.TONEMAPPING_ACES=!1,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.EXPOSURE=!1,this.rebuild()}setReflectionMode(e){const t=["REFLECTIONMAP_CUBIC","REFLECTIONMAP_EXPLICIT","REFLECTIONMAP_PLANAR","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_SKYBOX","REFLECTIONMAP_SPHERICAL","REFLECTIONMAP_EQUIRECTANGULAR","REFLECTIONMAP_EQUIRECTANGULAR_FIXED","REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"];for(const i of t)this[i]=i===e}}class ie extends C0{get imageProcessingConfiguration(){return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()}_attachImageProcessingConfiguration(e){e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e?this._imageProcessingConfiguration=e:this._imageProcessingConfiguration=this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{this._markAllSubMeshesAsImageProcessingDirty()})))}get isPrePassCapable(){return!this.disableDepthWrite}get cameraColorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){return this._imageProcessingConfiguration.exposure}set cameraExposure(e){this._imageProcessingConfiguration.exposure=e}get cameraContrast(){return this._imageProcessingConfiguration.contrast}set cameraContrast(e){this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){this._imageProcessingConfiguration.colorCurves=e}get canRenderToMRT(){return!0}constructor(e,t){super(e,t),this._diffuseTexture=null,this._ambientTexture=null,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._specularTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._refractionTexture=null,this.ambientColor=new he(0,0,0),this.diffuseColor=new he(1,1,1),this.specularColor=new he(1,1,1),this.emissiveColor=new he(0,0,0),this.specularPower=64,this._useAlphaFromDiffuseTexture=!1,this._useEmissiveAsIllumination=!1,this._linkEmissiveWithDiffuse=!1,this._useSpecularOverAlpha=!1,this._useReflectionOverAlpha=!1,this._disableLighting=!1,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this._roughness=0,this.indexOfRefraction=.98,this.invertRefractionY=!0,this.alphaCutOff=.4,this._useLightmapAsShadowmap=!1,this._useReflectionFresnelFromSpecular=!1,this._useGlossinessFromSpecularMapAlpha=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._renderTargets=new qt(16),this._worldViewProjectionMatrix=N.Zero(),this._globalAmbientColor=new he(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new Js(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new wo,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),ie.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),ie.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return ie.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||ie.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported,this._markAllSubMeshesAsMiscDirty()}needAlphaBlending(){return this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled}needAlphaTesting(){return this._forceAlphaTest?!0:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===j.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==j.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(e,t,i=!1){if(this._uniformBufferLayoutBuilt||this.buildUniformLayout(),t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady&&t.effect._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(this._callbackPluginEventGeneric(Zt.GetDefineNames,this._eventInfo),t.materialDefines=new kp(this._eventInfo.defineNames));const s=this.getScene(),n=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const r=s.getEngine();n._needNormals=we.PrepareDefinesForLights(s,e,n,!0,this._maxSimultaneousLights,this._disableLighting),we.PrepareDefinesForMultiview(s,n);const o=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if(we.PrepareDefinesForPrePass(s,n,this.canRenderToMRT&&!o),we.PrepareDefinesForOIT(s,n,o),n._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,n._needUVs=!1;for(let h=1;h<=6;++h)n["MAINUV"+h]=!1;if(s.texturesEnabled){if(n.DIFFUSEDIRECTUV=0,n.BUMPDIRECTUV=0,n.AMBIENTDIRECTUV=0,n.OPACITYDIRECTUV=0,n.EMISSIVEDIRECTUV=0,n.SPECULARDIRECTUV=0,n.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&ie.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._diffuseTexture,n,"DIFFUSE");else return!1;else n.DIFFUSE=!1;if(this._ambientTexture&&ie.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._ambientTexture,n,"AMBIENT");else return!1;else n.AMBIENT=!1;if(this._opacityTexture&&ie.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._opacityTexture,n,"OPACITY"),n.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else n.OPACITY=!1;if(this._reflectionTexture&&ie.ReflectionTextureEnabled)if(this._reflectionTexture.isReadyOrNotBlocking()){switch(n._needNormals=!0,n.REFLECTION=!0,n.ROUGHNESS=this._roughness>0,n.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,n.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===se.INVCUBIC_MODE,n.REFLECTIONMAP_3D=this._reflectionTexture.isCube,n.REFLECTIONMAP_OPPOSITEZ=n.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!this._reflectionTexture.invertZ:this._reflectionTexture.invertZ,n.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case se.EXPLICIT_MODE:n.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case se.PLANAR_MODE:n.setReflectionMode("REFLECTIONMAP_PLANAR");break;case se.PROJECTION_MODE:n.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case se.SKYBOX_MODE:n.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case se.SPHERICAL_MODE:n.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case se.EQUIRECTANGULAR_MODE:n.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case se.FIXED_EQUIRECTANGULAR_MODE:n.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case se.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:n.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case se.CUBIC_MODE:case se.INVCUBIC_MODE:default:n.setReflectionMode("REFLECTIONMAP_CUBIC");break}n.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else return!1;else n.REFLECTION=!1,n.REFLECTIONMAP_OPPOSITEZ=!1;if(this._emissiveTexture&&ie.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._emissiveTexture,n,"EMISSIVE");else return!1;else n.EMISSIVE=!1;if(this._lightmapTexture&&ie.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._lightmapTexture,n,"LIGHTMAP"),n.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,n.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else n.LIGHTMAP=!1;if(this._specularTexture&&ie.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())we.PrepareDefinesForMergedUV(this._specularTexture,n,"SPECULAR"),n.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else n.SPECULAR=!1;if(s.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&ie.BumpTextureEnabled){if(this._bumpTexture.isReady())we.PrepareDefinesForMergedUV(this._bumpTexture,n,"BUMP"),n.PARALLAX=this._useParallax,n.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;n.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else n.BUMP=!1,n.PARALLAX=!1,n.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&ie.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())n._needUVs=!0,n.REFRACTION=!0,n.REFRACTIONMAP_3D=this._refractionTexture.isCube,n.RGBDREFRACTION=this._refractionTexture.isRGBD,n.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else n.REFRACTION=!1;n.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else n.DIFFUSE=!1,n.AMBIENT=!1,n.OPACITY=!1,n.REFLECTION=!1,n.EMISSIVE=!1,n.LIGHTMAP=!1,n.BUMP=!1,n.REFRACTION=!1;n.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),n.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,n.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,n.SPECULAROVERALPHA=this._useSpecularOverAlpha,n.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,n.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,n.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(e)}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=n,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(n._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(n),n.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,n.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}n._areFresnelDirty&&(ie.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(n.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,n.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,n.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,n.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,n.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,n.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,n._needNormals=!0,n.FRESNEL=!0):n.FRESNEL=!1),we.PrepareDefinesForMisc(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,n),we.PrepareDefinesForFrameBoundValues(s,r,this,n,i,null,t.getRenderingMesh().hasThinInstances),this._eventInfo.defines=n,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),we.PrepareDefinesForAttributes(e,n,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let l=!1;if(n.isDirty){const h=n._areLightsDisposed;n.markAsProcessed();const c=new R0;n.REFLECTION&&c.addFallback(0,"REFLECTION"),n.SPECULAR&&c.addFallback(0,"SPECULAR"),n.BUMP&&c.addFallback(0,"BUMP"),n.PARALLAX&&c.addFallback(1,"PARALLAX"),n.PARALLAXOCCLUSION&&c.addFallback(0,"PARALLAXOCCLUSION"),n.SPECULAROVERALPHA&&c.addFallback(0,"SPECULAROVERALPHA"),n.FOG&&c.addFallback(1,"FOG"),n.POINTSIZE&&c.addFallback(0,"POINTSIZE"),n.LOGARITHMICDEPTH&&c.addFallback(0,"LOGARITHMICDEPTH"),we.HandleFallbacksForShadows(n,c,this._maxSimultaneousLights),n.SPECULARTERM&&c.addFallback(0,"SPECULARTERM"),n.DIFFUSEFRESNEL&&c.addFallback(1,"DIFFUSEFRESNEL"),n.OPACITYFRESNEL&&c.addFallback(2,"OPACITYFRESNEL"),n.REFLECTIONFRESNEL&&c.addFallback(3,"REFLECTIONFRESNEL"),n.EMISSIVEFRESNEL&&c.addFallback(4,"EMISSIVEFRESNEL"),n.FRESNEL&&c.addFallback(4,"FRESNEL"),n.MULTIVIEW&&c.addFallback(0,"MULTIVIEW");const u=[A.PositionKind];n.NORMAL&&u.push(A.NormalKind),n.TANGENT&&u.push(A.TangentKind);for(let S=1;S<=6;++S)n["UV"+S]&&u.push("uv".concat(S===1?"":S));n.VERTEXCOLOR&&u.push(A.ColorKind),we.PrepareAttributesForBones(u,e,n,c),we.PrepareAttributesForInstances(u,n),we.PrepareAttributesForMorphTargets(u,e,n),we.PrepareAttributesForBakedVertexAnimation(u,e,n);let d="default";const _=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth","morphTargetTextureInfo","morphTargetTextureIndices"],f=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler"],g=["Material","Scene","Mesh"];this._eventInfo.fallbacks=c,this._eventInfo.fallbackRank=0,this._eventInfo.defines=n,this._eventInfo.uniforms=_,this._eventInfo.attributes=u,this._eventInfo.samplers=f,this._eventInfo.uniformBuffersNames=g,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._callbackPluginEventGeneric(Zt.PrepareEffect,this._eventInfo),wo.AddUniforms(_),He&&(He.PrepareUniforms(_,n),He.PrepareSamplers(f,n)),we.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:g,samplers:f,defines:n,maxSimultaneousLights:this._maxSimultaneousLights}),S0(_);const p={};this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,_,g,f,n,u,p));const x=n.toString(),m=t.effect;let T=s.getEngine().createEffect(d,{attributes:u,uniformsNames:_,uniformBuffersNames:g,samplers:f,defines:x,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:n.NUM_MORPH_INFLUENCERS},processFinalCode:p.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:n.PREPASS},r);if(this._eventInfo.customCode=void 0,T)if(this._onEffectCreatedObservable&&(Sa.effect=T,Sa.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Sa)),this.allowShaderHotSwapping&&m&&!T.isReady()){if(T=m,n.markAsUnprocessed(),l=this.isFrozen,h)return n._areLightsDisposed=!0,!1}else s.resetCachedMaterial(),t.setEffect(T,n,this._materialContext)}return!t.effect||!t.effect.isReady()?!1:(n._renderId=s.getRenderId(),t.effect._wasPreviouslyReady=!l,t.effect._wasPreviouslyUsingInstances=i,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("alphaCutOff",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vRefractionPosition",3),e.addUniform("vRefractionSize",3),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vDiffuseColor",4),e.addUniform("vAmbientColor",3),super.buildUniformLayout()}bindForSubMesh(e,t,i){var s;const n=this.getScene(),r=i.materialDefines;if(!r)return;const o=i.effect;if(!o)return;this._activeEffect=o,t.getMeshUniformBuffer().bindToEffect(o,"Mesh"),t.transferToEffect(e),this._uniformBuffer.bindToEffect(o,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,n,t,e,this.isFrozen),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),r.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const l=o._forceRebindOnNextCall||this._mustRebind(n,o,t.visibility);we.BindBonesParameters(t,o);const h=this._uniformBuffer;if(l){if(this.bindViewProjection(o),!h.useUbo||!this.isFrozen||!h.isSync||o._forceRebindOnNextCall){if(ie.FresnelEnabled&&r.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(h.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),h.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&h.updateColor4("opacityParts",new he(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(h.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),h.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(h.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),h.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(h.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),h.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),n.texturesEnabled){if(this._diffuseTexture&&ie.DiffuseTextureEnabled&&(h.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),we.BindTextureMatrix(this._diffuseTexture,h,"diffuse")),this._ambientTexture&&ie.AmbientTextureEnabled&&(h.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),we.BindTextureMatrix(this._ambientTexture,h,"ambient")),this._opacityTexture&&ie.OpacityTextureEnabled&&(h.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),we.BindTextureMatrix(this._opacityTexture,h,"opacity")),this._hasAlphaChannel()&&h.updateFloat("alphaCutOff",this.alphaCutOff),this._reflectionTexture&&ie.ReflectionTextureEnabled&&(h.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),h.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){const c=this._reflectionTexture;h.updateVector3("vReflectionPosition",c.boundingBoxPosition),h.updateVector3("vReflectionSize",c.boundingBoxSize)}if(this._emissiveTexture&&ie.EmissiveTextureEnabled&&(h.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),we.BindTextureMatrix(this._emissiveTexture,h,"emissive")),this._lightmapTexture&&ie.LightmapTextureEnabled&&(h.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),we.BindTextureMatrix(this._lightmapTexture,h,"lightmap")),this._specularTexture&&ie.SpecularTextureEnabled&&(h.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),we.BindTextureMatrix(this._specularTexture,h,"specular")),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&ie.BumpTextureEnabled&&(h.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),we.BindTextureMatrix(this._bumpTexture,h,"bump"),n._mirroredCameraPosition?h.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):h.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&ie.RefractionTextureEnabled){let c=1;if(this._refractionTexture.isCube||(h.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(c=this._refractionTexture.depth)),h.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,c,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const u=this._refractionTexture;h.updateVector3("vRefractionPosition",u.boundingBoxPosition),h.updateVector3("vRefractionSize",u.boundingBoxSize)}}}this.pointsCloud&&h.updateFloat("pointSize",this.pointSize),r.SPECULARTERM&&h.updateColor4("vSpecularColor",this.specularColor,this.specularPower),h.updateColor3("vEmissiveColor",ie.EmissiveTextureEnabled?this.emissiveColor:he.BlackReadOnly),h.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),n.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),h.updateColor3("vAmbientColor",this._globalAmbientColor)}n.texturesEnabled&&(this._diffuseTexture&&ie.DiffuseTextureEnabled&&o.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&ie.AmbientTextureEnabled&&o.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&ie.OpacityTextureEnabled&&o.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&ie.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?o.setTexture("reflectionCubeSampler",this._reflectionTexture):o.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&ie.EmissiveTextureEnabled&&o.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&ie.LightmapTextureEnabled&&o.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&ie.SpecularTextureEnabled&&o.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&ie.BumpTextureEnabled&&o.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&ie.RefractionTextureEnabled&&(this._refractionTexture.isCube?o.setTexture("refractionCubeSampler",this._refractionTexture):o.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(o),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),A0(o,this,n),this.bindEyePosition(o)}else n.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(l||!this.isFrozen)&&(n.lightsEnabled&&!this._disableLighting&&we.BindLights(n,t,o,r,this._maxSimultaneousLights),(n.fogEnabled&&t.applyFog&&n.fogMode!==Me.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||t.receiveShadows||r.PREPASS)&&this.bindView(o),we.BindFogParameters(n,t,o),r.NUM_MORPH_INFLUENCERS&&we.BindMorphTargetParameters(t,o),r.BAKED_VERTEX_ANIMATION_TEXTURE&&((s=t.bakedVertexAnimationManager)===null||s===void 0||s.bind(o,r.INSTANCES)),this.useLogarithmicDepth&&we.BindLogDepth(r,o,n),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect),h.update()}getAnimatables(){const e=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e}getActiveTextures(){const e=super.getActiveTextures();return this._diffuseTexture&&e.push(this._diffuseTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._specularTexture&&e.push(this._specularTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),this._refractionTexture&&e.push(this._refractionTexture),e}hasTexture(e){return!!(super.hasTexture(e)||this._diffuseTexture===e||this._ambientTexture===e||this._opacityTexture===e||this._reflectionTexture===e||this._emissiveTexture===e||this._specularTexture===e||this._bumpTexture===e||this._lightmapTexture===e||this._refractionTexture===e)}dispose(e,t){var i,s,n,r,o,l,h,c,u;t&&((i=this._diffuseTexture)===null||i===void 0||i.dispose(),(s=this._ambientTexture)===null||s===void 0||s.dispose(),(n=this._opacityTexture)===null||n===void 0||n.dispose(),(r=this._reflectionTexture)===null||r===void 0||r.dispose(),(o=this._emissiveTexture)===null||o===void 0||o.dispose(),(l=this._specularTexture)===null||l===void 0||l.dispose(),(h=this._bumpTexture)===null||h===void 0||h.dispose(),(c=this._lightmapTexture)===null||c===void 0||c.dispose(),(u=this._refractionTexture)===null||u===void 0||u.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}clone(e){const t=Se.Clone(()=>new ie(e,this.getScene()),this);return t.name=e,t.id=e,this.stencil.copyTo(t.stencil),t}static Parse(e,t,i){const s=Se.Parse(()=>new ie(e.name,t),e,t,i);return e.stencil&&s.stencil.parse(e.stencil,t,i),s}static get DiffuseTextureEnabled(){return Oe.DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){Oe.DiffuseTextureEnabled=e}static get DetailTextureEnabled(){return Oe.DetailTextureEnabled}static set DetailTextureEnabled(e){Oe.DetailTextureEnabled=e}static get AmbientTextureEnabled(){return Oe.AmbientTextureEnabled}static set AmbientTextureEnabled(e){Oe.AmbientTextureEnabled=e}static get OpacityTextureEnabled(){return Oe.OpacityTextureEnabled}static set OpacityTextureEnabled(e){Oe.OpacityTextureEnabled=e}static get ReflectionTextureEnabled(){return Oe.ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){Oe.ReflectionTextureEnabled=e}static get EmissiveTextureEnabled(){return Oe.EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){Oe.EmissiveTextureEnabled=e}static get SpecularTextureEnabled(){return Oe.SpecularTextureEnabled}static set SpecularTextureEnabled(e){Oe.SpecularTextureEnabled=e}static get BumpTextureEnabled(){return Oe.BumpTextureEnabled}static set BumpTextureEnabled(e){Oe.BumpTextureEnabled=e}static get LightmapTextureEnabled(){return Oe.LightmapTextureEnabled}static set LightmapTextureEnabled(e){Oe.LightmapTextureEnabled=e}static get RefractionTextureEnabled(){return Oe.RefractionTextureEnabled}static set RefractionTextureEnabled(e){Oe.RefractionTextureEnabled=e}static get ColorGradingTextureEnabled(){return Oe.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){Oe.ColorGradingTextureEnabled=e}static get FresnelEnabled(){return Oe.FresnelEnabled}static set FresnelEnabled(e){Oe.FresnelEnabled=e}}F([Si("diffuseTexture")],ie.prototype,"_diffuseTexture",void 0);F([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ie.prototype,"diffuseTexture",void 0);F([Si("ambientTexture")],ie.prototype,"_ambientTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"ambientTexture",void 0);F([Si("opacityTexture")],ie.prototype,"_opacityTexture",void 0);F([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ie.prototype,"opacityTexture",void 0);F([Si("reflectionTexture")],ie.prototype,"_reflectionTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"reflectionTexture",void 0);F([Si("emissiveTexture")],ie.prototype,"_emissiveTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"emissiveTexture",void 0);F([Si("specularTexture")],ie.prototype,"_specularTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"specularTexture",void 0);F([Si("bumpTexture")],ie.prototype,"_bumpTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"bumpTexture",void 0);F([Si("lightmapTexture")],ie.prototype,"_lightmapTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"lightmapTexture",void 0);F([Si("refractionTexture")],ie.prototype,"_refractionTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"refractionTexture",void 0);F([_s("ambient")],ie.prototype,"ambientColor",void 0);F([_s("diffuse")],ie.prototype,"diffuseColor",void 0);F([_s("specular")],ie.prototype,"specularColor",void 0);F([_s("emissive")],ie.prototype,"emissiveColor",void 0);F([B()],ie.prototype,"specularPower",void 0);F([B("useAlphaFromDiffuseTexture")],ie.prototype,"_useAlphaFromDiffuseTexture",void 0);F([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ie.prototype,"useAlphaFromDiffuseTexture",void 0);F([B("useEmissiveAsIllumination")],ie.prototype,"_useEmissiveAsIllumination",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useEmissiveAsIllumination",void 0);F([B("linkEmissiveWithDiffuse")],ie.prototype,"_linkEmissiveWithDiffuse",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"linkEmissiveWithDiffuse",void 0);F([B("useSpecularOverAlpha")],ie.prototype,"_useSpecularOverAlpha",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useSpecularOverAlpha",void 0);F([B("useReflectionOverAlpha")],ie.prototype,"_useReflectionOverAlpha",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useReflectionOverAlpha",void 0);F([B("disableLighting")],ie.prototype,"_disableLighting",void 0);F([je("_markAllSubMeshesAsLightsDirty")],ie.prototype,"disableLighting",void 0);F([B("useObjectSpaceNormalMap")],ie.prototype,"_useObjectSpaceNormalMap",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useObjectSpaceNormalMap",void 0);F([B("useParallax")],ie.prototype,"_useParallax",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useParallax",void 0);F([B("useParallaxOcclusion")],ie.prototype,"_useParallaxOcclusion",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useParallaxOcclusion",void 0);F([B()],ie.prototype,"parallaxScaleBias",void 0);F([B("roughness")],ie.prototype,"_roughness",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"roughness",void 0);F([B()],ie.prototype,"indexOfRefraction",void 0);F([B()],ie.prototype,"invertRefractionY",void 0);F([B()],ie.prototype,"alphaCutOff",void 0);F([B("useLightmapAsShadowmap")],ie.prototype,"_useLightmapAsShadowmap",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useLightmapAsShadowmap",void 0);F([Jn("diffuseFresnelParameters")],ie.prototype,"_diffuseFresnelParameters",void 0);F([je("_markAllSubMeshesAsFresnelDirty")],ie.prototype,"diffuseFresnelParameters",void 0);F([Jn("opacityFresnelParameters")],ie.prototype,"_opacityFresnelParameters",void 0);F([je("_markAllSubMeshesAsFresnelAndMiscDirty")],ie.prototype,"opacityFresnelParameters",void 0);F([Jn("reflectionFresnelParameters")],ie.prototype,"_reflectionFresnelParameters",void 0);F([je("_markAllSubMeshesAsFresnelDirty")],ie.prototype,"reflectionFresnelParameters",void 0);F([Jn("refractionFresnelParameters")],ie.prototype,"_refractionFresnelParameters",void 0);F([je("_markAllSubMeshesAsFresnelDirty")],ie.prototype,"refractionFresnelParameters",void 0);F([Jn("emissiveFresnelParameters")],ie.prototype,"_emissiveFresnelParameters",void 0);F([je("_markAllSubMeshesAsFresnelDirty")],ie.prototype,"emissiveFresnelParameters",void 0);F([B("useReflectionFresnelFromSpecular")],ie.prototype,"_useReflectionFresnelFromSpecular",void 0);F([je("_markAllSubMeshesAsFresnelDirty")],ie.prototype,"useReflectionFresnelFromSpecular",void 0);F([B("useGlossinessFromSpecularMapAlpha")],ie.prototype,"_useGlossinessFromSpecularMapAlpha",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"useGlossinessFromSpecularMapAlpha",void 0);F([B("maxSimultaneousLights")],ie.prototype,"_maxSimultaneousLights",void 0);F([je("_markAllSubMeshesAsLightsDirty")],ie.prototype,"maxSimultaneousLights",void 0);F([B("invertNormalMapX")],ie.prototype,"_invertNormalMapX",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"invertNormalMapX",void 0);F([B("invertNormalMapY")],ie.prototype,"_invertNormalMapY",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"invertNormalMapY",void 0);F([B("twoSidedLighting")],ie.prototype,"_twoSidedLighting",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ie.prototype,"twoSidedLighting",void 0);F([B()],ie.prototype,"useLogarithmicDepth",null);Vt("BABYLON.StandardMaterial",ie);Me.DefaultMaterialFactory=a=>new ie("default material",a);var Cs;(function(a){a[a.Clean=0]="Clean",a[a.Stop=1]="Stop",a[a.Sync=2]="Sync",a[a.NoSync=3]="NoSync"})(Cs||(Cs={}));class Ue{static get ForceFullSceneLoadingForIncremental(){return Tt.ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){Tt.ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return Tt.ShowLoadingScreen}static set ShowLoadingScreen(e){Tt.ShowLoadingScreen=e}static get loggingLevel(){return Tt.loggingLevel}static set loggingLevel(e){Tt.loggingLevel=e}static get CleanBoneMatrixWeights(){return Tt.CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){Tt.CleanBoneMatrixWeights=e}static GetDefaultPlugin(){return Ue._RegisteredPlugins[".babylon"]}static _GetPluginForExtension(e){const t=Ue._RegisteredPlugins[e];return t||(H.Warn("Unable to find a plugin to load "+e+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"),Ue.GetDefaultPlugin())}static _GetPluginForDirectLoad(e){for(const t in Ue._RegisteredPlugins){const i=Ue._RegisteredPlugins[t].plugin;if(i.canDirectLoad&&i.canDirectLoad(e))return Ue._RegisteredPlugins[t]}return Ue.GetDefaultPlugin()}static _GetPluginForFilename(e){const t=e.indexOf("?");t!==-1&&(e=e.substring(0,t));const i=e.lastIndexOf("."),s=e.substring(i,e.length).toLowerCase();return Ue._GetPluginForExtension(s)}static _GetDirectLoad(e){return e.substr(0,5)==="data:"?e.substr(5):null}static _FormatErrorMessage(e,t,i){let s="Unable to load from "+e.url;return t?s+=": ".concat(t):i&&(s+=": ".concat(i)),s}static _LoadData(e,t,i,s,n,r,o){const l=Ue._GetDirectLoad(e.url),h=o?Ue._GetPluginForExtension(o):l?Ue._GetPluginForDirectLoad(e.url):Ue._GetPluginForFilename(e.url);let c;if(h.plugin.createPlugin!==void 0?c=h.plugin.createPlugin():c=h.plugin,!c)throw"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";if(Ue.OnPluginActivatedObservable.notifyObservers(c),l&&(c.canDirectLoad&&c.canDirectLoad(e.url)||!u0(e.url))){if(c.directLoad){const T=c.directLoad(t,l);T.then?T.then(S=>{i(c,S)}).catch(S=>{n("Error in directLoad of _loadData: "+S,S)}):i(c,T)}else i(c,l);return c}const u=h.isBinary,d=(T,S)=>{if(t.isDisposed){n("Scene has been disposed");return}i(c,T,S)};let _=null,f=!1;const g=c.onDisposeObservable;g&&g.add(()=>{f=!0,_&&(_.abort(),_=null),r()});const p=()=>{if(f)return;const T=(b,y)=>{n(b==null?void 0:b.statusText,y)},S=e.file||e.url;_=c.loadFile?c.loadFile(t,S,d,s,u,T):t._loadFile(S,d,s,!0,u,T)},x=t.getEngine();let m=x.enableOfflineSupport;if(m){let T=!1;for(const S of t.disableOfflineSupportExceptionRules)if(S.test(e.url)){T=!0;break}m=!T}return m&&Y.OfflineProviderFactory?t.offlineProvider=Y.OfflineProviderFactory(e.url,p,x.disableManifestCheck):p(),c}static _GetFileInfo(e,t){let i,s,n=null;if(!t)i=e,s=re.GetFilename(e),e=re.GetFolderPath(e);else if(t.name){const r=t;i="file:".concat(r.name),s=r.name,n=r}else if(typeof t=="string"&&t.startsWith("data:"))i=t,s="";else{const r=t;if(r.substr(0,1)==="/")return re.Error("Wrong sceneFilename parameter"),null;i=e+r,s=r}return{url:i,rootUrl:e,name:s,file:n}}static GetPluginForExtension(e){return Ue._GetPluginForExtension(e).plugin}static IsPluginForExtensionAvailable(e){return!!Ue._RegisteredPlugins[e]}static RegisterPlugin(e){if(typeof e.extensions=="string"){const t=e.extensions;Ue._RegisteredPlugins[t.toLowerCase()]={plugin:e,isBinary:!1}}else{const t=e.extensions;Object.keys(t).forEach(i=>{Ue._RegisteredPlugins[i.toLowerCase()]={plugin:e,isBinary:t[i].isBinary}})}}static ImportMesh(e,t,i="",s=Ie.LastCreatedScene,n=null,r=null,o=null,l=null){if(!s)return H.Error("No scene available to import mesh to"),null;const h=Ue._GetFileInfo(t,i);if(!h)return null;const c={};s.addPendingData(c);const u=()=>{s.removePendingData(c)},d=(g,p)=>{const x=Ue._FormatErrorMessage(h,g,p);o?o(s,x,new hs(x,Ks.SceneLoaderError,p)):H.Error(x),u()},_=r?g=>{try{r(g)}catch(p){d("Error in onProgress callback: "+p,p)}}:void 0,f=(g,p,x,m,T,S,b)=>{if(s.importedMeshesFiles.push(h.url),n)try{n(g,p,x,m,T,S,b)}catch(y){d("Error in onSuccess callback: "+y,y)}s.removePendingData(c)};return Ue._LoadData(h,s,(g,p,x)=>{if(g.rewriteRootURL&&(h.rootUrl=g.rewriteRootURL(h.rootUrl,x)),g.importMesh){const m=g,T=new Array,S=new Array,b=new Array;if(!m.importMesh(e,s,p,h.rootUrl,T,S,b,d))return;s.loadingPluginName=g.name,f(T,S,b,[],[],[],[])}else g.importMeshAsync(e,s,p,h.rootUrl,_,h.name).then(T=>{s.loadingPluginName=g.name,f(T.meshes,T.particleSystems,T.skeletons,T.animationGroups,T.transformNodes,T.geometries,T.lights)}).catch(T=>{d(T.message,T)})},_,d,u,l)}static ImportMeshAsync(e,t,i="",s=Ie.LastCreatedScene,n=null,r=null){return new Promise((o,l)=>{Ue.ImportMesh(e,t,i,s,(h,c,u,d,_,f,g)=>{o({meshes:h,particleSystems:c,skeletons:u,animationGroups:d,transformNodes:_,geometries:f,lights:g})},n,(h,c,u)=>{l(u||new Error(c))},r)})}static Load(e,t="",i=Ie.LastCreatedEngine,s=null,n=null,r=null,o=null){return i?Ue.Append(e,t,new Me(i),s,n,r,o):(re.Error("No engine available"),null)}static LoadAsync(e,t="",i=Ie.LastCreatedEngine,s=null,n=null){return new Promise((r,o)=>{Ue.Load(e,t,i,l=>{r(l)},s,(l,h,c)=>{o(c||new Error(h))},n)})}static Append(e,t="",i=Ie.LastCreatedScene,s=null,n=null,r=null,o=null){if(!i)return H.Error("No scene available to append to"),null;const l=Ue._GetFileInfo(e,t);if(!l)return null;const h={};i.addPendingData(h);const c=()=>{i.removePendingData(h)};Ue.ShowLoadingScreen&&!this._ShowingLoadingScreen&&(this._ShowingLoadingScreen=!0,i.getEngine().displayLoadingUI(),i.executeWhenReady(()=>{i.getEngine().hideLoadingUI(),this._ShowingLoadingScreen=!1}));const u=(f,g)=>{const p=Ue._FormatErrorMessage(l,f,g);r?r(i,p,new hs(p,Ks.SceneLoaderError,g)):H.Error(p),c()},d=n?f=>{try{n(f)}catch(g){u("Error in onProgress callback",g)}}:void 0,_=()=>{if(s)try{s(i)}catch(f){u("Error in onSuccess callback",f)}i.removePendingData(h)};return Ue._LoadData(l,i,(f,g)=>{if(f.load){if(!f.load(i,g,l.rootUrl,u))return;i.loadingPluginName=f.name,_()}else f.loadAsync(i,g,l.rootUrl,d,l.name).then(()=>{i.loadingPluginName=f.name,_()}).catch(x=>{u(x.message,x)})},d,u,c,o)}static AppendAsync(e,t="",i=Ie.LastCreatedScene,s=null,n=null){return new Promise((r,o)=>{Ue.Append(e,t,i,l=>{r(l)},s,(l,h,c)=>{o(c||new Error(h))},n)})}static LoadAssetContainer(e,t="",i=Ie.LastCreatedScene,s=null,n=null,r=null,o=null){if(!i)return H.Error("No scene available to load asset container to"),null;const l=Ue._GetFileInfo(e,t);if(!l)return null;const h={};i.addPendingData(h);const c=()=>{i.removePendingData(h)},u=(f,g)=>{const p=Ue._FormatErrorMessage(l,f,g);r?r(i,p,new hs(p,Ks.SceneLoaderError,g)):H.Error(p),c()},d=n?f=>{try{n(f)}catch(g){u("Error in onProgress callback",g)}}:void 0,_=f=>{if(s)try{s(f)}catch(g){u("Error in onSuccess callback",g)}i.removePendingData(h)};return Ue._LoadData(l,i,(f,g)=>{if(f.loadAssetContainer){const x=f.loadAssetContainer(i,g,l.rootUrl,u);if(!x)return;i.loadingPluginName=f.name,_(x)}else f.loadAssetContainerAsync?f.loadAssetContainerAsync(i,g,l.rootUrl,d,l.name).then(x=>{i.loadingPluginName=f.name,_(x)}).catch(x=>{u(x.message,x)}):u("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")},d,u,c,o)}static LoadAssetContainerAsync(e,t="",i=Ie.LastCreatedScene,s=null,n=null){return new Promise((r,o)=>{Ue.LoadAssetContainer(e,t,i,l=>{r(l)},s,(l,h,c)=>{o(c||new Error(h))},n)})}static ImportAnimations(e,t="",i=Ie.LastCreatedScene,s=!0,n=Cs.Clean,r=null,o=null,l=null,h=null,c=null){if(!i){H.Error("No scene available to load animations to");return}if(s){for(const f of i.animatables)f.reset();i.stopAllAnimations(),i.animationGroups.slice().forEach(f=>{f.dispose()}),i.getNodes().forEach(f=>{f.animations&&(f.animations=[])})}else switch(n){case Cs.Clean:i.animationGroups.slice().forEach(_=>{_.dispose()});break;case Cs.Stop:i.animationGroups.forEach(_=>{_.stop()});break;case Cs.Sync:i.animationGroups.forEach(_=>{_.reset(),_.restart()});break;case Cs.NoSync:break;default:H.Error("Unknown animation group loading mode value '"+n+"'");return}const u=i.animatables.length,d=_=>{_.mergeAnimationsTo(i,i.animatables.slice(u),r),_.dispose(),i.onAnimationFileImportedObservable.notifyObservers(i),o&&o(i)};this.LoadAssetContainer(e,t,i,d,l,h,c)}static ImportAnimationsAsync(e,t="",i=Ie.LastCreatedScene,s=!0,n=Cs.Clean,r=null,o=null,l=null,h=null,c=null){return new Promise((u,d)=>{Ue.ImportAnimations(e,t,i,s,n,r,_=>{u(_)},l,(_,f,g)=>{d(g||new Error(f))},c)})}}Ue.NO_LOGGING=0;Ue.MINIMAL_LOGGING=1;Ue.SUMMARY_LOGGING=2;Ue.DETAILED_LOGGING=3;Ue.OnPluginActivatedObservable=new ee;Ue._RegisteredPlugins={};Ue._ShowingLoadingScreen=!1;const Vp="fxaaPixelShader",Gp="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\nuniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan) \n{\nlumaS=lumaE;\n}\nif (horzSpan) \n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan) \n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));\nif (!pairN) \n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) \n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN) \n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP) \n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan) \n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN{const c=this.texelSize;h.setFloat2("texelSize",c.x,c.y)})}_getDefines(){const e=this.getEngine();if(!e)return null;const t=e.getGlInfo();return t&&t.renderer&&t.renderer.toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null}static _Parse(e,t,i,s){return Se.Parse(()=>new Qr(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,s)}}Vt("BABYLON.FxaaPostProcess",Qr);let ys=null;function Jr(a,e,t,i,s="image/png",n=!1){const{height:r,width:o}=Wl(a,e,t);if(!(r&&o)){H.Error("Invalid 'size' parameter !");return}ys||(ys=document.createElement("canvas")),ys.width=o,ys.height=r;const l=ys.getContext("2d"),h=a.getRenderWidth()/a.getRenderHeight();let c=o,u=c/h;u>r&&(u=r,c=u*h);const d=Math.max(0,o-c)/2,_=Math.max(0,r-u)/2;e.getScene().activeCamera!==e?ea(a,e,t,g=>{if(n){const p=new Blob([g]);re.DownloadBlob(p),i&&i("")}else i&&i(g)},s,1,a.getCreationOptions().antialias):a.onEndFrameObservable.addOnce(()=>{const g=a.getRenderingCanvas();l&&g&&l.drawImage(g,d,_,c,u),ys&&(n?(re.EncodeScreenshotCanvasData(ys,void 0,s),i&&i("")):re.EncodeScreenshotCanvasData(ys,i,s))})}function Vl(a,e,t,i="image/png"){return new Promise((s,n)=>{Jr(a,e,t,r=>{typeof r<"u"?s(r):n(new Error("Data is undefined"))},i)})}function Hp(a,e,t,i,s="image/png"){return new Promise(n=>{Jr(a,e,{width:t,height:i},()=>{n()},s,!0)})}function ea(a,e,t,i,s="image/png",n=1,r=!1,o,l=!1,h=!1,c=!0){const{height:u,width:d,finalWidth:_,finalHeight:f}=Wl(a,e,t),g={width:d,height:u};if(!(u&&d)){H.Error("Invalid 'size' parameter !");return}const p={width:a.getRenderWidth(),height:a.getRenderHeight()};a.setSize(d,u);const x=e.getScene(),m=new zi("screenShot",g,x,!1,!1,0,!1,se.BILINEAR_SAMPLINGMODE,void 0,h,void 0,void 0,void 0,n);m.renderList=x.meshes.slice(),m.samples=n,m.renderSprites=l,m.activeCamera=e,m.forceLayerMaskCheck=c;const T=()=>{a.onEndFrameObservable.addOnce(()=>{_===d&&f===u?m.readPixels(void 0,void 0,void 0,!1).then(S=>{Yt.DumpData(d,u,S,i,s,o,!0),m.dispose()}):Dd("pass",m.getInternalTexture(),x,void 0,void 0,void 0,_,f).then(S=>{a._readTexturePixels(S,_,f,-1,0,null,!0,!1,0,0).then(b=>{Yt.DumpData(_,f,b,i,s,o,!0),S.dispose()})})}),x.incrementRenderId(),x.resetCachedMaterial(),m.render(!0),x.incrementRenderId(),x.resetCachedMaterial(),a.setSize(p.width,p.height),e.getProjectionMatrix(!0),x.render()};if(r){const S=new Qr("antialiasing",1,x.activeCamera);m.addPostProcess(S),S.getEffect().isReady()?T():S.getEffect().onCompiled=()=>{T()}}else T()}function Gl(a,e,t,i="image/png",s=1,n=!1,r,o=!1,l=!1,h=!0){return new Promise((c,u)=>{ea(a,e,t,d=>{typeof d<"u"?c(d):u(new Error("Data is undefined"))},i,s,n,r,o,l,h)})}function Wl(a,e,t){let i=0,s=0,n=0,r=0;if(typeof t=="object"){const o=t.precision?Math.abs(t.precision):1;t.width&&t.height?(i=t.height*o,s=t.width*o):t.width&&!t.height?(s=t.width*o,i=Math.round(s/a.getAspectRatio(e))):t.height&&!t.width?(i=t.height*o,s=Math.round(i*a.getAspectRatio(e))):(s=Math.round(a.getRenderWidth()*o),i=Math.round(s/a.getAspectRatio(e))),t.finalWidth&&t.finalHeight?(r=t.finalHeight,n=t.finalWidth):t.finalWidth&&!t.finalHeight?(n=t.finalWidth,r=Math.round(n/a.getAspectRatio(e))):t.finalHeight&&!t.finalWidth?(r=t.finalHeight,n=Math.round(r*a.getAspectRatio(e))):(n=s,r=i)}else isNaN(t)||(i=t,s=t,n=t,r=t);return s&&(s=Math.floor(s)),i&&(i=Math.floor(i)),n&&(n=Math.floor(n)),r&&(r=Math.floor(r)),{height:i|0,width:s|0,finalWidth:n|0,finalHeight:r|0}}const Xp={CreateScreenshot:Jr,CreateScreenshotAsync:Vl,CreateScreenshotWithResizeAsync:Hp,CreateScreenshotUsingRenderTarget:ea,CreateScreenshotUsingRenderTargetAsync:Gl},Kp=()=>{re.CreateScreenshot=Jr,re.CreateScreenshotAsync=Vl,re.CreateScreenshotUsingRenderTarget=ea,re.CreateScreenshotUsingRenderTargetAsync=Gl};Kp();O._instancedMeshFactory=(a,e)=>{const t=new I0(a,e);if(e.instancedBuffers){t.instancedBuffers={};for(const i in e.instancedBuffers)t.instancedBuffers[i]=e.instancedBuffers[i]}return t};class I0 extends ei{constructor(e,t){super(e,t.getScene()),this._indexInSourceMeshInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const i of t.getAnimationRanges())i!=null&&this.createAnimationRange(i.name,i.from,i.to);this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),this.refreshBoundingInfo(!0,!0),this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){var t;((t=this._sourceMesh)===null||t===void 0?void 0:t.receiveShadows)!==e&&re.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){var t;((t=this._sourceMesh)===null||t===void 0?void 0:t.material)!==e&&re.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){var t;((t=this._sourceMesh)===null||t===void 0?void 0:t.visibility)!==e&&re.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){var t;((t=this._sourceMesh)===null||t===void 0?void 0:t.skeleton)!==e&&re.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||H.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}setVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,s),this.sourceMesh}updateVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,s),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;const i=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getPositionData(e,t),i),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||H.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD.billboardMode!==be.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new N);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,G.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(G.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const i=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,i.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e(s.toArray(i,i.length),i),[]),this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){this._checkUniform(e);const i=new Float32Array(t.length*16);for(let s=0;s1&&(this._multiview=!0,u.push("#define MULTIVIEW"),this._options.uniforms.indexOf("viewProjection")!==-1&&this._options.uniforms.indexOf("viewProjectionR")===-1&&this._options.uniforms.push("viewProjectionR"));for(let C=0;C4&&(d.push(A.MatricesIndicesExtraKind),d.push(A.MatricesWeightsExtraKind));const C=e.skeleton;u.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),_.addCPUSkinningFallback(0,e),C.isUsingTextureForMatrices?(u.push("#define BONETEXTURE"),this._options.uniforms.indexOf("boneTextureWidth")===-1&&this._options.uniforms.push("boneTextureWidth"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(u.push("#define BonesPerMesh "+(C.bones.length+1)),this._options.uniforms.indexOf("mBones")===-1&&this._options.uniforms.push("mBones"))}else u.push("#define NUM_BONE_INFLUENCERS 0");let m=0;const T=e?e.morphTargetManager:null;if(T){const C=T.supportsUVs&&u.indexOf("#define UV1")!==-1,R=T.supportsTangents&&u.indexOf("#define TANGENT")!==-1,w=T.supportsNormals&&u.indexOf("#define NORMAL")!==-1;m=T.numInfluencers,C&&u.push("#define MORPHTARGETS_UV"),R&&u.push("#define MORPHTARGETS_TANGENT"),w&&u.push("#define MORPHTARGETS_NORMAL"),m>0&&u.push("#define MORPHTARGETS"),T.isUsingTextureForTargets&&(u.push("#define MORPHTARGETS_TEXTURE"),this._options.uniforms.indexOf("morphTargetTextureIndices")===-1&&this._options.uniforms.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),u.push("#define NUM_MORPH_INFLUENCERS "+m);for(let D=0;D0&&(g=g.slice(),g.push("morphTargetInfluences"),g.push("morphTargetTextureInfo"),g.push("morphTargetTextureIndices"))}else u.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const C=e.bakedVertexAnimationManager;C&&C.isEnabled&&(u.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),this._options.uniforms.indexOf("bakedVertexAnimationSettings")===-1&&this._options.uniforms.push("bakedVertexAnimationSettings"),this._options.uniforms.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&this._options.uniforms.push("bakedVertexAnimationTextureSizeInverted"),this._options.uniforms.indexOf("bakedVertexAnimationTime")===-1&&this._options.uniforms.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture")),we.PrepareAttributesForBakedVertexAnimation(d,e,u)}for(const C in this._textures)if(!this._textures[C].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&u.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(S0(g),Nl(this,h,u)),this.customShaderNameResolve&&(g=g.slice(),p=p.slice(),x=x.slice(),f=this.customShaderNameResolve(f,g,p,x,u,d));const S=l?i._getDrawWrapper():this._drawWrapper,b=(s=S==null?void 0:S.effect)!==null&&s!==void 0?s:null,y=(n=S==null?void 0:S.defines)!==null&&n!==void 0?n:null,E=u.join("\n");let P=b;return y!==E&&(P=c.createEffect(f,{attributes:d,uniformsNames:g,uniformBuffersNames:p,samplers:x,defines:E,fallbacks:_,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:m},shaderLanguage:this._options.shaderLanguage},c),l?i.setEffect(P,E,this._materialContext):S&&S.setEffect(P,E),this._onEffectCreatedObservable&&(Aa.effect=P,Aa.subMesh=(r=i!=null?i:e==null?void 0:e.subMeshes[0])!==null&&r!==void 0?r:null,this._onEffectCreatedObservable.notifyObservers(Aa))),P._wasPreviouslyUsingInstances=!!t,!((o=!(P!=null&&P.isReady()))!==null&&o!==void 0)||o?!1:(b!==P&&h.resetCachedMaterial(),P._wasPreviouslyReady=!0,!0)}bindOnlyWorldMatrix(e,t){const i=this.getScene(),s=t!=null?t:this.getEffect();s&&(this._options.uniforms.indexOf("world")!==-1&&s.setMatrix("world",e),this._options.uniforms.indexOf("worldView")!==-1&&(e.multiplyToRef(i.getViewMatrix(),this._cachedWorldViewMatrix),s.setMatrix("worldView",this._cachedWorldViewMatrix)),this._options.uniforms.indexOf("worldViewProjection")!==-1&&(e.multiplyToRef(i.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),s.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)))}bindForSubMesh(e,t,i){var s;this.bind(e,t,(s=i._drawWrapperOverride)===null||s===void 0?void 0:s.effect,i)}bind(e,t,i,s){var n;const r=s&&this._storeEffectOnSubMeshes,o=i!=null?i:r?s.effect:this.getEffect();if(!o)return;this._activeEffect=o,this.bindOnlyWorldMatrix(e,i);const l=this._options.uniformBuffers;let h=!1;if(o&&l&&l.length>0&&this.getScene().getEngine().supportsUniformBuffers)for(let u=0;u0&&we.BindMorphTargetParameters(t,o);const d=t.bakedVertexAnimationManager;d&&d.isEnabled&&((n=t.bakedVertexAnimationManager)===null||n===void 0||n.bind(o,!!o._wasPreviouslyUsingInstances))}this._afterBind(t,o)}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let s=0;snew us(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,typeof t._shaderPath=="object"&&(t._shaderPath={...t._shaderPath}),this._options={...this._options},Object.keys(this._options).forEach(i=>{const s=this._options[i];Array.isArray(s)&&(this._options[i]=s.slice(0))}),this.stencil.copyTo(t.stencil);for(const i in this._textures)t.setTexture(i,this._textures[i]);for(const i in this._textureArrays)t.setTextureArray(i,this._textureArrays[i]);for(const i in this._externalTextures)t.setExternalTexture(i,this._externalTextures[i]);for(const i in this._ints)t.setInt(i,this._ints[i]);for(const i in this._uints)t.setUInt(i,this._uints[i]);for(const i in this._floats)t.setFloat(i,this._floats[i]);for(const i in this._floatsArrays)t.setFloats(i,this._floatsArrays[i]);for(const i in this._colors3)t.setColor3(i,this._colors3[i]);for(const i in this._colors3Arrays)t._colors3Arrays[i]=this._colors3Arrays[i];for(const i in this._colors4)t.setColor4(i,this._colors4[i]);for(const i in this._colors4Arrays)t._colors4Arrays[i]=this._colors4Arrays[i];for(const i in this._vectors2)t.setVector2(i,this._vectors2[i]);for(const i in this._vectors3)t.setVector3(i,this._vectors3[i]);for(const i in this._vectors4)t.setVector4(i,this._vectors4[i]);for(const i in this._quaternions)t.setQuaternion(i,this._quaternions[i]);for(const i in this._quaternionsArrays)t._quaternionsArrays[i]=this._quaternionsArrays[i];for(const i in this._matrices)t.setMatrix(i,this._matrices[i]);for(const i in this._matrixArrays)t._matrixArrays[i]=this._matrixArrays[i].slice();for(const i in this._matrices3x3)t.setMatrix3x3(i,this._matrices3x3[i]);for(const i in this._matrices2x2)t.setMatrix2x2(i,this._matrices2x2[i]);for(const i in this._vectors2Arrays)t.setArray2(i,this._vectors2Arrays[i]);for(const i in this._vectors3Arrays)t.setArray3(i,this._vectors3Arrays[i]);for(const i in this._vectors4Arrays)t.setArray4(i,this._vectors4Arrays[i]);for(const i in this._uniformBuffers)t.setUniformBuffer(i,this._uniformBuffers[i]);for(const i in this._textureSamplers)t.setTextureSampler(i,this._textureSamplers[i]);for(const i in this._storageBuffers)t.setStorageBuffer(i,this._storageBuffers[i]);return t}dispose(e,t,i){if(t){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._textureArrays){const n=this._textureArrays[s];for(let r=0;rnew us(e.name,t,e.shaderPath,e.options,e.storeEffectOnSubMeshes),e,t,i);let n;e.stencil&&s.stencil.parse(e.stencil,t,i);for(n in e.textures)s.setTexture(n,se.Parse(e.textures[n],t,i));for(n in e.textureArrays){const r=e.textureArrays[n],o=new Array;for(let l=0;l(h%3===0?o.push([l]):o[o.length-1].push(l),o),[]).map(o=>he.FromArray(o));s.setColor3Array(n,r)}for(n in e.colors4)s.setColor4(n,q.FromArray(e.colors4[n]));for(n in e.colors4Arrays){const r=e.colors4Arrays[n].reduce((o,l,h)=>(h%4===0?o.push([l]):o[o.length-1].push(l),o),[]).map(o=>q.FromArray(o));s.setColor4Array(n,r)}for(n in e.vectors2)s.setVector2(n,fe.FromArray(e.vectors2[n]));for(n in e.vectors3)s.setVector3(n,v.FromArray(e.vectors3[n]));for(n in e.vectors4)s.setVector4(n,Ye.FromArray(e.vectors4[n]));for(n in e.quaternions)s.setQuaternion(n,ue.FromArray(e.quaternions[n]));for(n in e.matrices)s.setMatrix(n,N.FromArray(e.matrices[n]));for(n in e.matrixArray)s._matrixArrays[n]=new Float32Array(e.matrixArray[n]);for(n in e.matrices3x3)s.setMatrix3x3(n,e.matrices3x3[n]);for(n in e.matrices2x2)s.setMatrix2x2(n,e.matrices2x2[n]);for(n in e.vectors2Arrays)s.setArray2(n,e.vectors2Arrays[n]);for(n in e.vectors3Arrays)s.setArray3(n,e.vectors3Arrays[n]);for(n in e.vectors4Arrays)s.setArray4(n,e.vectors4Arrays[n]);for(n in e.quaternionsArrays)s.setArray4(n,e.quaternionsArrays[n]);return s}static ParseFromFileAsync(e,t,i,s=""){return new Promise((n,r)=>{const o=new Jt;o.addEventListener("readystatechange",()=>{if(o.readyState==4)if(o.status==200){const l=JSON.parse(o.responseText),h=this.Parse(l,i||Ie.LastCreatedScene,s);e&&(h.name=e),n(h)}else r("Unable to load the ShaderMaterial")}),o.open("GET",t),o.send()})}static ParseFromSnippetAsync(e,t,i=""){return new Promise((s,n)=>{const r=new Jt;r.addEventListener("readystatechange",()=>{if(r.readyState==4)if(r.status==200){const o=JSON.parse(JSON.parse(r.responseText).jsonPayload),l=JSON.parse(o.shaderMaterial),h=this.Parse(l,t||Ie.LastCreatedScene,i);h.snippetId=e,s(h)}else n("Unable to load the snippet "+e)}),r.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),r.send()})}}us.SnippetUrl="https://snippet.babylonjs.com";us.CreateFromSnippetAsync=us.ParseFromSnippetAsync;Vt("BABYLON.ShaderMaterial",us);const Yp="colorPixelShader",qp="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}";te.ShadersStore[Yp]=qp;const jp="colorVertexShader",$p="attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n#include\n#include\n#include\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include\n#include\n#define CUSTOM_VERTEX_MAIN_END\n}";te.ShadersStore[jp]=$p;O._LinesMeshParser=(a,e)=>Ls.Parse(a,e);class Ls extends O{_isShaderMaterial(e){return e.getClassName()==="ShaderMaterial"}constructor(e,t=null,i=null,s=null,n,r,o,l){super(e,t,i,s,n),this.useVertexColor=r,this.useVertexAlpha=o,this.color=new he(1,1,1),this.alpha=1,s&&(this.color=s.color.clone(),this.alpha=s.alpha,this.useVertexColor=s.useVertexColor,this.useVertexAlpha=s.useVertexAlpha),this.intersectionThreshold=.1;const h=[],c={attributes:[A.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:h,useClipPlane:null};o===!1?c.needAlphaBlending=!1:c.defines.push("#define VERTEXALPHA"),r?(c.defines.push("#define VERTEXCOLOR"),c.attributes.push(A.ColorKind)):(c.uniforms.push("color"),this._color4=new q),l?this.material=l:(this.material=new us("colorShader",this.getScene(),"color",c,!1),this.material.doNotSerialize=!0)}isReady(){return this._lineMaterial.isReady(this,!!this._userInstancedBuffersStorage)?super.isReady():!1}getClassName(){return"LinesMesh"}get material(){return this._lineMaterial}set material(e){this._lineMaterial=e,this._lineMaterial.fillMode=j.LineListDrawMode}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(this._userInstancedBuffersStorage?this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects):this._geometry._bind(t,i),!this.useVertexColor&&this._isShaderMaterial(this._lineMaterial)){const{r:s,g:n,b:r}=this.color;this._color4.set(s,n,r,this.alpha),this._lineMaterial.setColor4("color",this._color4)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const s=this.getScene().getEngine();return this._unIndexed?s.drawArraysType(j.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(j.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){i||this._lineMaterial.dispose(!1,!1,!0),super.dispose(e)}clone(e,t=null,i){return new Ls(e,this.getScene(),t,this,i)}createInstance(e){const t=new zl(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const i in this.instancedBuffers)t.instancedBuffers[i]=this.instancedBuffers[i]}return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){const i=new Ls(e.name,t);return i.color=he.FromArray(e.color),i.alpha=e.alpha,i}}class zl extends I0{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}const Zp="linePixelShader",Qp="#include\nuniform vec4 color;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";te.ShadersStore[Zp]=Qp;const Jp="lineVertexShader",eg="#include\n#include\nattribute vec3 position;\nattribute vec4 normal;\nuniform mat4 viewProjection;\nuniform float width;\nuniform float aspectRatio;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include\nmat4 worldViewProjection=viewProjection*finalWorld;\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";te.ShadersStore[Jp]=eg;ei.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this};ei.prototype.enableEdgesRendering=function(a=.95,e=!1,t){return this.disableEdgesRendering(),this._edgesRenderer=new ta(this,a,e,!0,t),this};Object.defineProperty(ei.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0});Ls.prototype.enableEdgesRendering=function(a=.95,e=!1){return this.disableEdgesRendering(),this._edgesRenderer=new ig(this,a,e),this};zl.prototype.enableEdgesRendering=function(a=.95,e=!1){return Ls.prototype.enableEdgesRendering.apply(this,arguments),this};class tg{constructor(){this.edges=new Array,this.edgesConnectedCount=0}}class ta{get linesPositions(){return this._linesPositions}get linesNormals(){return this._linesNormals}get linesIndices(){return this._linesIndices}get lineShader(){return this._lineShader}set lineShader(e){this._lineShader=e}static _GetShader(e){if(!e._edgeRenderLineShader){const t=new us("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"]},!1);t.disableDepthWrite=!0,t.backFaceCulling=!1,t.checkReadyOnEveryCall=e.getEngine().isWebGPU,e._edgeRenderLineShader=t}return e._edgeRenderLineShader}constructor(e,t=.95,i=!1,s=!0,n){var r;this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._buffersForInstances={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this.customInstances=new qt(32),this._source=e,this._checkVerticesInsteadOfIndices=i,this._options=n!=null?n:null,this._epsilon=t,this._source.getScene().getEngine().isWebGPU&&(this._drawWrapper=new Ns(e.getEngine())),this._prepareRessources(),s&&(!((r=n==null?void 0:n.useAlternateEdgeFinder)!==null&&r!==void 0)||r?this._generateEdgesLinesAlternate():this._generateEdgesLines()),this._meshRebuildObserver=this._source.onRebuildObservable.add(()=>{this._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(()=>{this.dispose()})}_prepareRessources(){this._lineShader||(this._lineShader=ta._GetShader(this._source.getScene()))}_rebuild(){let e=this._buffers[A.PositionKind];e&&e._rebuild(),e=this._buffers[A.NormalKind],e&&e._rebuild();const i=this._source.getScene().getEngine();this._ib=i.createIndexBuffer(this._linesIndices)}dispose(){var e;this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);let t=this._buffers[A.PositionKind];t&&(t.dispose(),this._buffers[A.PositionKind]=null),t=this._buffers[A.NormalKind],t&&(t.dispose(),this._buffers[A.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose(),(e=this._drawWrapper)===null||e===void 0||e.dispose()}_processEdgeForAdjacencies(e,t,i,s,n){return e===i&&t===s||e===s&&t===i?0:e===s&&t===n||e===n&&t===s?1:e===n&&t===i||e===i&&t===n?2:-1}_processEdgeForAdjacenciesWithVertices(e,t,i,s,n){return e.equalsWithEpsilon(i,1e-10)&&t.equalsWithEpsilon(s,1e-10)||e.equalsWithEpsilon(s,1e-10)&&t.equalsWithEpsilon(i,1e-10)?0:e.equalsWithEpsilon(s,1e-10)&&t.equalsWithEpsilon(n,1e-10)||e.equalsWithEpsilon(n,1e-10)&&t.equalsWithEpsilon(s,1e-10)?1:e.equalsWithEpsilon(n,1e-10)&&t.equalsWithEpsilon(i,1e-10)||e.equalsWithEpsilon(i,1e-10)&&t.equalsWithEpsilon(n,1e-10)?2:-1}_checkEdge(e,t,i,s,n){let r;t===void 0?r=!0:r=v.Dot(i[e],i[t]){R>=0&&C.push(R);for(let w=0;w=e[0].length&&e[1].length>=e[2].length?r=1:e[2].length>=e[0].length&&e[2].length>=e[1].length&&(r=2);for(let P=0;P<3;++P)P===r?e[P].sort((C,R)=>C[1]R[1]?1:0):e[P].sort((C,R)=>C[1]>R[1]?-1:C[1]=r+1;--P)n(e[P%3],l,P!==r+2?s[i[t+(P+1)%3]]:-1);const c=l.length,u=0,d=0;i.push(s[i[t+r]],o[0],l[0]),i.push(s[i[t+(r+1)%3]],l[c-1],o[h-1]);const _=h<=c,f=_?h:c,g=_?c:h,p=_?h-1:c-1,x=_?0:1;let m=h+c-2,T=_?u:d,S=_?d:u;const b=_?o:l,y=_?l:o;let E=0;for(;m-- >0;){x?i.push(b[T],y[S]):i.push(y[S],b[T]),E+=f;let P;E>=g&&TE){const w=y;y=E,E=w}const C=y+"_"+E,R=x[C];R?R.done||(v.Dot(S,R.normal)0||this._source.hasThinInstances)}render(){const e=this._source.getScene(),t=this._lineShader._getDrawWrapper();if(this._drawWrapper&&this._lineShader._setDrawWrapper(this._drawWrapper),!this.isReady()||!e.activeCamera){this._lineShader._setDrawWrapper(t);return}const i=this._source.hasInstances&&this.customInstances.length>0,s=i||this._source.hasThinInstances;let n=0;if(s)if(this._buffersForInstances.world0=this._source.getVertexBuffer("world0"),this._buffersForInstances.world1=this._source.getVertexBuffer("world1"),this._buffersForInstances.world2=this._source.getVertexBuffer("world2"),this._buffersForInstances.world3=this._source.getVertexBuffer("world3"),i){const o=this._source._instanceDataStorage;if(n=this.customInstances.length,!o.instancesData){this._source.getScene()._activeMeshesFrozen||this.customInstances.reset();return}if(!o.isFrozen){let l=0;for(let h=0;h=0?c.substring(0,u):c;d=d.toLowerCase();const _=u>=0?c.substring(u+1).trim():"";if(d==="newmtl")l&&this.materials.push(l),e._blockEntityCollection=!!s,l=new ie(_,e),l._parentContainer=s,e._blockEntityCollection=!1;else if(d==="kd"&&l)o=_.split(r,3).map(parseFloat),l.diffuseColor=he.FromArray(o);else if(d==="ka"&&l)o=_.split(r,3).map(parseFloat),l.ambientColor=he.FromArray(o);else if(d==="ks"&&l)o=_.split(r,3).map(parseFloat),l.specularColor=he.FromArray(o);else if(d==="ke"&&l)o=_.split(r,3).map(parseFloat),l.emissiveColor=he.FromArray(o);else if(d==="ns"&&l)l.specularPower=parseFloat(_);else if(d==="d"&&l)l.alpha=parseFloat(_);else if(d==="map_ka"&&l)l.ambientTexture=ki._GetTexture(i,_,e);else if(d==="map_kd"&&l)l.diffuseTexture=ki._GetTexture(i,_,e);else if(d==="map_ks"&&l)l.specularTexture=ki._GetTexture(i,_,e);else if(d!=="map_ns")if(d==="map_bump"&&l){const f=_.split(r),g=f.indexOf("-bm");let p=null;g>=0&&(p=f[g+1],f.splice(g,2)),l.bumpTexture=ki._GetTexture(i,f.join(" "),e),l.bumpTexture&&p!==null&&(l.bumpTexture.level=parseFloat(p))}else d==="map_d"&&l&&(l.opacityTexture=ki._GetTexture(i,_,e))}l&&this.materials.push(l)}static _GetTexture(e,t,i){if(!t)return null;let s=e;if(e==="file:"){let n=t.lastIndexOf("\\");n===-1&&(n=t.lastIndexOf("/")),n>-1?s+=t.substr(n+1):s+=t}else s+=t;return new se(s,i,!1,ki.INVERT_TEXTURE_Y)}}ki.INVERT_TEXTURE_Y=!0;class pt{constructor(e,t,i){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new q(.5,.5,.5,1),this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=i}_isInArray(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});const i=e[t[0]].normals.indexOf(t[1]);return i===-1?-1:e[t[0]].idx[i]}_isInArrayUV(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});const i=e[t[0]].normals.indexOf(t[1]);return i!=1&&t[2]===e[t[0]].uv[i]?e[t[0]].idx[i]:-1}_setData(e,t,i,s,n,r,o){let l;this._loadingOptions.optimizeWithUV?l=this._isInArrayUV(this._tuplePosNorm,[e,i,t]):l=this._isInArray(this._tuplePosNorm,[e,i]),l===-1?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(s),this._wrappedUvsForBabylon.push(n),this._wrappedNormalsForBabylon.push(r),o!==void 0&&this._wrappedColorsForBabylon.push(o),this._tuplePosNorm[e].normals.push(i),this._tuplePosNorm[e].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e].uv.push(t)):this._indicesForBabylon.push(l)}_unwrapData(){for(let e=0;e0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice(),this._handledMesh.uvs=this._unwrappedUVForBabylon.slice(),this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0)}_optimizeNormals(e){const t=e.getVerticesData(A.PositionKind),i=e.getVerticesData(A.NormalKind),s={};if(!t||!i)return;for(let r=0;r=7){const u=parseFloat(c[4]),d=parseFloat(c[5]),_=parseFloat(c[6]);this._colors.push(new q(u>1?u/255:u,d>1?d/255:d,_>1?_/255:_,c.length===7||c[7]===void 0?1:parseFloat(c[7])))}else this._colors.push(this._grayColor)}else if((c=pt.NormalPattern.exec(h))!==null)this._normals.push(new v(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3])));else if((c=pt.UVPattern.exec(h))!==null)this._uvs.push(new fe(parseFloat(c[1])*this._loadingOptions.UVScaling.x,parseFloat(c[2])*this._loadingOptions.UVScaling.y));else if((c=pt.FacePattern3.exec(h))!==null)this._setDataForCurrentFaceWithPattern3(c[1].trim().split(" "),1);else if((c=pt.FacePattern4.exec(h))!==null)this._setDataForCurrentFaceWithPattern4(c[1].trim().split(" "),1);else if((c=pt.FacePattern5.exec(h))!==null)this._setDataForCurrentFaceWithPattern5(c[1].trim().split(" "),1);else if((c=pt.FacePattern2.exec(h))!==null)this._setDataForCurrentFaceWithPattern2(c[1].trim().split(" "),1);else if((c=pt.FacePattern1.exec(h))!==null)this._setDataForCurrentFaceWithPattern1(c[1].trim().split(" "),1);else if(pt.GroupDescriptor.test(h)||pt.ObjectDescriptor.test(h)){const u={name:h.substring(2).trim(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:this._materialNameFromObj};this._addPreviousObjMesh(),this._meshesFromObj.push(u),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(pt.UseMtlDescriptor.test(h)){if(this._materialNameFromObj=h.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const u={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:this._materialNameFromObj};this._increment++,this._meshesFromObj.push(u),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else pt.MtlLibGroupDescriptor.test(h)?n(h.substring(7).trim()):pt.SmoothDescriptor.test(h)||console.log("Unhandled expression at line : "+h)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._handledMesh.normals=this._unwrappedNormalsForBabylon,this._handledMesh.uvs=this._unwrappedUVForBabylon,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon)),!this._hasMeshes){let l=null;if(this._indicesForBabylon.length)this._indicesForBabylon.reverse(),this._unwrapData();else{for(const h of this._positions)this._unwrappedPositionsForBabylon.push(h.x,h.y,h.z);if(this._normals.length)for(const h of this._normals)this._unwrappedNormalsForBabylon.push(h.x,h.y,h.z);if(this._uvs.length)for(const h of this._uvs)this._unwrappedUVForBabylon.push(h.x,h.y);if(this._colors.length)for(const h of this._colors)this._unwrappedColorsForBabylon.push(h.r,h.g,h.b,h.a);this._materialNameFromObj||(l=new ie(si.RandomId(),i),l.pointsCloud=!0,this._materialNameFromObj=l.name,this._normals.length||(l.disableLighting=!0,l.emissiveColor=he.White()))}this._meshesFromObj.push({name:si.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:l})}for(let l=0;l{e.dispose()}),this.rootNodes.length=0,this.skeletons.slice(0).forEach(e=>{e.dispose()}),this.skeletons.length=0,this.animationGroups.slice(0).forEach(e=>{e.dispose()}),this.animationGroups.length=0}}class rg extends ps{constructor(e){super(),this._wasAddedToScene=!1,e=e||Ie.LastCreatedScene,e&&(this.scene=e,this.sounds=[],this.effectLayers=[],this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.reflectionProbes=[],e.onDisposeObservable.add(()=>{this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{for(const t of this.geometries)t._rebuild();for(const t of this.meshes)t._rebuild();for(const t of this.particleSystems)t.rebuild();for(const t of this.textures)t._rebuild()}))}_topologicalSort(e){const t=new Map;for(const o of e)t.set(o.uniqueId,o);const i={dependsOn:new Map,dependedBy:new Map};for(const o of e){const l=o.uniqueId;i.dependsOn.set(l,new Set),i.dependedBy.set(l,new Set)}for(const o of e){const l=o.uniqueId,h=i.dependsOn.get(l);if(o instanceof I0){const u=o.sourceMesh;t.has(u.uniqueId)&&(h.add(u.uniqueId),i.dependedBy.get(u.uniqueId).add(l))}const c=i.dependedBy.get(l);for(const u of o.getDescendants()){const d=u.uniqueId;t.has(d)&&(c.add(d),i.dependsOn.get(d).add(l))}}const s=[],n=[];for(const o of e){const l=o.uniqueId;i.dependsOn.get(l).size===0&&(n.push(o),t.delete(l))}const r=n;for(;r.length>0;){const o=r.shift();s.push(o);const l=i.dependedBy.get(o.uniqueId);for(const h of Array.from(l.values())){const c=i.dependsOn.get(h);c.delete(o.uniqueId),c.size===0&&t.get(h)&&(r.push(t.get(h)),t.delete(h))}}return t.size>0&&(console.error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(o=>console.error(o.name))),s}_addNodeAndDescendantsToList(e,t,i,s){if(!(!i||s&&!s(i)||t.has(i.uniqueId))){e.push(i),t.add(i.uniqueId);for(const n of i.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,n,s)}}_isNodeInContainer(e){return e instanceof O&&this.meshes.indexOf(e)!==-1||e instanceof be&&this.transformNodes.indexOf(e)!==-1||e instanceof Le&&this.lights.indexOf(e)!==-1||e instanceof de&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return H.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return H.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return H.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return H.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;return!0}instantiateModelsToScene(e,t=!1,i){this._isValidHierarchy()||re.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const s={},n={},r=new ng,o=[],l=[],h={doNotInstantiate:!0,...i},c=(g,p)=>{if(s[g.uniqueId]=p.uniqueId,n[p.uniqueId]=p,e&&(p.name=e(g.name)),p instanceof O){const x=p;if(x.morphTargetManager){const m=g.morphTargetManager;x.morphTargetManager=m.clone();for(let T=0;T{if(c(g,p),g.parent){const x=s[g.parent.uniqueId],m=n[x];m?p.parent=m:p.parent=g.parent}if(p.position.copyFrom(g.position),p.rotation.copyFrom(g.rotation),p.scaling.copyFrom(g.scaling),p.material){const x=p;if(x.material)if(t){const m=g.material;if(l.indexOf(m)===-1){let T=m.clone(e?e(m.name):"Clone of "+m.name);if(l.push(m),s[m.uniqueId]=T.uniqueId,n[T.uniqueId]=T,m.getClassName()==="MultiMaterial"){const S=m;for(const b of S.subMaterials)b&&(T=b.clone(e?e(b.name):"Clone of "+b.name),l.push(b),s[b.uniqueId]=T.uniqueId,n[T.uniqueId]=T);S.subMaterials=S.subMaterials.map(b=>b&&n[s[b.uniqueId]])}}x.getClassName()!=="InstancedMesh"&&(x.material=n[s[m.uniqueId]])}else x.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(x.material)===-1&&this.scene.addMultiMaterial(x.material):this.scene.materials.indexOf(x.material)===-1&&this.scene.addMaterial(x.material)}p.parent===null&&r.rootNodes.push(p)};return _.forEach(g=>{if(g.getClassName()==="InstancedMesh"){const p=g,x=p.sourceMesh,m=s[x.uniqueId],S=(typeof m=="number"?n[m]:x).createInstance(p.name);f(p,S)}else{let p=!0;g.getClassName()==="TransformNode"||g.skeleton||g.getTotalVertices()===0?p=!1:h.doNotInstantiate&&(typeof h.doNotInstantiate=="function"?p=!h.doNotInstantiate(g):p=!h.doNotInstantiate);const x=p?g.createInstance("instance of ".concat(g.name)):g.clone("Clone of ".concat(g.name),null,!0);if(!x)throw new Error("Could not clone or instantiate node on Asset Container ".concat(g.name));f(g,x)}}),this.skeletons.forEach(g=>{if(h.predicate&&!h.predicate(g))return;const p=g.clone(e?e(g.name):"Clone of "+g.name);for(const x of this.meshes)if(x.skeleton===g&&!x.isAnInstance){const m=n[s[x.uniqueId]];if(!m||m.isAnInstance||(m.skeleton=p,o.indexOf(p)!==-1))continue;o.push(p);for(const T of p.bones)T._linkedTransformNode&&(T._linkedTransformNode=n[s[T._linkedTransformNode.uniqueId]])}r.skeletons.push(p)}),this.animationGroups.forEach(g=>{if(h.predicate&&!h.predicate(g))return;const p=g.clone(e?e(g.name):"Clone of "+g.name,x=>n[s[x.uniqueId]]||x);r.animationGroups.push(p)}),r}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||re.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){this.cameras.forEach(t=>{e&&!e(t)||this.scene.addCamera(t)}),this.lights.forEach(t=>{e&&!e(t)||this.scene.addLight(t)}),this.meshes.forEach(t=>{e&&!e(t)||this.scene.addMesh(t)}),this.skeletons.forEach(t=>{e&&!e(t)||this.scene.addSkeleton(t)}),this.animations.forEach(t=>{e&&!e(t)||this.scene.addAnimation(t)}),this.animationGroups.forEach(t=>{e&&!e(t)||this.scene.addAnimationGroup(t)}),this.multiMaterials.forEach(t=>{e&&!e(t)||this.scene.addMultiMaterial(t)}),this.materials.forEach(t=>{e&&!e(t)||this.scene.addMaterial(t)}),this.morphTargetManagers.forEach(t=>{e&&!e(t)||this.scene.addMorphTargetManager(t)}),this.geometries.forEach(t=>{e&&!e(t)||this.scene.addGeometry(t)}),this.transformNodes.forEach(t=>{e&&!e(t)||this.scene.addTransformNode(t)}),this.actionManagers.forEach(t=>{e&&!e(t)||this.scene.addActionManager(t)}),this.textures.forEach(t=>{e&&!e(t)||this.scene.addTexture(t)}),this.reflectionProbes.forEach(t=>{e&&!e(t)||this.scene.addReflectionProbe(t)})}removeAllFromScene(){this._isValidHierarchy()||re.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){this.cameras.forEach(t=>{e&&!e(t)||this.scene.removeCamera(t)}),this.lights.forEach(t=>{e&&!e(t)||this.scene.removeLight(t)}),this.meshes.forEach(t=>{e&&!e(t)||this.scene.removeMesh(t)}),this.skeletons.forEach(t=>{e&&!e(t)||this.scene.removeSkeleton(t)}),this.animations.forEach(t=>{e&&!e(t)||this.scene.removeAnimation(t)}),this.animationGroups.forEach(t=>{e&&!e(t)||this.scene.removeAnimationGroup(t)}),this.multiMaterials.forEach(t=>{e&&!e(t)||this.scene.removeMultiMaterial(t)}),this.materials.forEach(t=>{e&&!e(t)||this.scene.removeMaterial(t)}),this.morphTargetManagers.forEach(t=>{e&&!e(t)||this.scene.removeMorphTargetManager(t)}),this.geometries.forEach(t=>{e&&!e(t)||this.scene.removeGeometry(t)}),this.transformNodes.forEach(t=>{e&&!e(t)||this.scene.removeTransformNode(t)}),this.actionManagers.forEach(t=>{e&&!e(t)||this.scene.removeActionManager(t)}),this.textures.forEach(t=>{e&&!e(t)||this.scene.removeTexture(t)}),this.reflectionProbes.forEach(t=>{e&&!e(t)||this.scene.removeReflectionProbe(t)})}dispose(){this.cameras.slice(0).forEach(e=>{e.dispose()}),this.cameras.length=0,this.lights.slice(0).forEach(e=>{e.dispose()}),this.lights.length=0,this.meshes.slice(0).forEach(e=>{e.dispose()}),this.meshes.length=0,this.skeletons.slice(0).forEach(e=>{e.dispose()}),this.skeletons.length=0,this.animationGroups.slice(0).forEach(e=>{e.dispose()}),this.animationGroups.length=0,this.multiMaterials.slice(0).forEach(e=>{e.dispose()}),this.multiMaterials.length=0,this.materials.slice(0).forEach(e=>{e.dispose()}),this.materials.length=0,this.geometries.slice(0).forEach(e=>{e.dispose()}),this.geometries.length=0,this.transformNodes.slice(0).forEach(e=>{e.dispose()}),this.transformNodes.length=0,this.actionManagers.slice(0).forEach(e=>{e.dispose()}),this.actionManagers.length=0,this.textures.slice(0).forEach(e=>{e.dispose()}),this.textures.length=0,this.reflectionProbes.slice(0).forEach(e=>{e.dispose()}),this.reflectionProbes.length=0,this.morphTargetManagers.slice(0).forEach(e=>{e.dispose()}),this.morphTargetManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,i){if(!(!e||!t))for(const s of e){let n=!0;if(i){for(const r of i)if(s===r){n=!1;break}}n&&(t.push(s),s._parentContainer=this)}}moveAllFromScene(e){this._wasAddedToScene=!1,e===void 0&&(e=new sg);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||(t==="_environmentTexture"?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){const e=new O("assetContainerRootMesh",this.scene);return this.meshes.forEach(t=>{t.parent||e.addChild(t)}),this.meshes.unshift(e),e}mergeAnimationsTo(e=Ie.LastCreatedScene,t,i=null){if(!e)return H.Error("No scene available to merge animations to"),[];const s=i||(o=>{let l=null;const h=o.animations.length?o.animations[0].targetProperty:"",c=o.name.split(".").join("").split("_primitive")[0];switch(h){case"position":case"rotationQuaternion":l=e.getTransformNodeByName(o.name)||e.getTransformNodeByName(c);break;case"influence":l=e.getMorphTargetByName(o.name)||e.getMorphTargetByName(c);break;default:l=e.getNodeByName(o.name)||e.getNodeByName(c)}return l});this.getNodes().forEach(o=>{const l=s(o);if(l!==null){for(const h of o.animations){const c=l.animations.filter(u=>u.targetProperty===h.targetProperty);for(const u of c){const d=l.animations.indexOf(u,0);d>-1&&l.animations.splice(d,1)}}l.animations=l.animations.concat(o.animations)}});const r=new Array;return this.animationGroups.slice().forEach(o=>{r.push(o.clone(o.name,s)),o.animatables.forEach(l=>{l.stop()})}),t.forEach(o=>{const l=s(o.target);l&&(e.beginAnimation(l,o.fromFrame,o.toFrame,o.loopAnimation,o.speedRatio,o.onAnimationEnd?o.onAnimationEnd:void 0,void 0,!0,void 0,o.onAnimationLoop?o.onAnimationLoop:void 0),e.stopAnimation(o.target))}),r}}class St{static get INVERT_TEXTURE_Y(){return ki.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(e){ki.INVERT_TEXTURE_Y=e}constructor(e){this.name="obj",this.extensions=".obj",this._assetContainer=null,this._loadingOptions=e||St._DefaultLoadingOptions}static get _DefaultLoadingOptions(){return{computeNormals:St.COMPUTE_NORMALS,optimizeNormals:St.OPTIMIZE_NORMALS,importVertexColors:St.IMPORT_VERTEX_COLORS,invertY:St.INVERT_Y,invertTextureY:St.INVERT_TEXTURE_Y,UVScaling:St.UV_SCALING,materialLoadingFailsSilently:St.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:St.OPTIMIZE_WITH_UV,skipMaterials:St.SKIP_MATERIALS}}_loadMTL(e,t,i,s){const n=t+e;re.LoadFile(n,i,void 0,void 0,!1,(r,o)=>{s(n,o)})}createPlugin(){return new St(St._DefaultLoadingOptions)}canDirectLoad(){return!1}importMeshAsync(e,t,i,s){return this._parseSolid(e,t,i,s).then(n=>({meshes:n,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[]}))}loadAsync(e,t,i){return this.importMeshAsync(null,e,t,i).then(()=>{})}loadAssetContainerAsync(e,t,i){const s=new rg(e);return this._assetContainer=s,this.importMeshAsync(null,e,t,i).then(n=>(n.meshes.forEach(r=>s.meshes.push(r)),n.meshes.forEach(r=>{const o=r.material;o&&s.materials.indexOf(o)==-1&&(s.materials.push(o),o.getActiveTextures().forEach(h=>{s.textures.indexOf(h)==-1&&s.textures.push(h)}))}),this._assetContainer=null,s)).catch(n=>{throw this._assetContainer=null,n})}_parseSolid(e,t,i,s){let n="";const r=new ki,o=new Array,l=[];new pt(o,l,this._loadingOptions).parse(e,i,t,this._assetContainer,u=>{n=u});const c=[];return n!==""&&!this._loadingOptions.skipMaterials&&c.push(new Promise((u,d)=>{this._loadMTL(n,s,_=>{try{r.parseMTL(t,_,s,this._assetContainer);for(let f=0;f-1;)p.push(x),g=x+1;if(x===-1&&p.length===0)r.materials[f].dispose();else for(let m=0;m{re.Warn("Error downloading MTL file: '".concat(n,"'")),this._loadingOptions.materialLoadingFailsSilently?u():d(f)})})),Promise.all(c).then(()=>l)}}St.OPTIMIZE_WITH_UV=!0;St.INVERT_Y=!1;St.IMPORT_VERTEX_COLORS=!1;St.COMPUTE_NORMALS=!1;St.OPTIMIZE_NORMALS=!1;St.UV_SCALING=new fe(1,1);St.SKIP_MATERIALS=!1;St.MATERIAL_LOADING_FAILS_SILENTLY=!0;Ue&&Ue.RegisterPlugin(new St);class We{constructor(e,t,i=Number.MAX_VALUE){this.origin=e,this.direction=t,this.length=i}clone(){return new We(this.origin.clone(),this.direction.clone(),this.length)}intersectsBoxMinMax(e,t,i=0){const s=We._TmpVector3[0].copyFromFloats(e.x-i,e.y-i,e.z-i),n=We._TmpVector3[1].copyFromFloats(t.x+i,t.y+i,t.z+i);let r=0,o=Number.MAX_VALUE,l,h,c,u;if(Math.abs(this.direction.x)<1e-7){if(this.origin.xn.x)return!1}else if(l=1/this.direction.x,h=(s.x-this.origin.x)*l,c=(n.x-this.origin.x)*l,c===-1/0&&(c=1/0),h>c&&(u=h,h=c,c=u),r=Math.max(h,r),o=Math.min(c,o),r>o)return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.yn.y)return!1}else if(l=1/this.direction.y,h=(s.y-this.origin.y)*l,c=(n.y-this.origin.y)*l,c===-1/0&&(c=1/0),h>c&&(u=h,h=c,c=u),r=Math.max(h,r),o=Math.min(c,o),r>o)return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.zn.z)return!1}else if(l=1/this.direction.z,h=(s.z-this.origin.z)*l,c=(n.z-this.origin.z)*l,c===-1/0&&(c=1/0),h>c&&(u=h,h=c,c=u),r=Math.max(h,r),o=Math.min(c,o),r>o)return!1;return!0}intersectsBox(e,t=0){return this.intersectsBoxMinMax(e.minimum,e.maximum,t)}intersectsSphere(e,t=0){const i=e.center.x-this.origin.x,s=e.center.y-this.origin.y,n=e.center.z-this.origin.z,r=i*i+s*s+n*n,o=e.radius+t,l=o*o;if(r<=l)return!0;const h=i*this.direction.x+s*this.direction.y+n*this.direction.z;return h<0?!1:r-h*h<=l}intersectsTriangle(e,t,i){const s=We._TmpVector3[0],n=We._TmpVector3[1],r=We._TmpVector3[2],o=We._TmpVector3[3],l=We._TmpVector3[4];t.subtractToRef(e,s),i.subtractToRef(e,n),v.CrossToRef(this.direction,n,r);const h=v.Dot(s,r);if(h===0)return null;const c=1/h;this.origin.subtractToRef(e,o);const u=v.Dot(o,r)*c;if(u<0||u>1)return null;v.CrossToRef(o,s,l);const d=v.Dot(this.direction,l)*c;if(d<0||u+d>1)return null;const _=v.Dot(n,l)*c;return _>this.length?null:new Va(1-u-d,u,_)}intersectsPlane(e){let t;const i=v.Dot(e.normal,this.direction);if(Math.abs(i)<999999997475243e-21)return null;{const s=v.Dot(e.normal,this.origin);return t=(-e.d-s)/i,t<0?t<-999999997475243e-21?null:0:t}}intersectsAxis(e,t=0){switch(e){case"y":{const i=(this.origin.y-t)/this.direction.y;return i>0?null:new v(this.origin.x+this.direction.x*-i,t,this.origin.z+this.direction.z*-i)}case"x":{const i=(this.origin.x-t)/this.direction.x;return i>0?null:new v(t,this.origin.y+this.direction.y*-i,this.origin.z+this.direction.z*-i)}case"z":{const i=(this.origin.z-t)/this.direction.z;return i>0?null:new v(this.origin.x+this.direction.x*-i,this.origin.y+this.direction.y*-i,t)}default:return null}}intersectsMesh(e,t){const i=G.Matrix[0];return e.getWorldMatrix().invertToRef(i),this._tmpRay?We.TransformToRef(this,i,this._tmpRay):this._tmpRay=We.Transform(this,i),e.intersects(this._tmpRay,t)}intersectsMeshes(e,t,i){i?i.length=0:i=[];for(let s=0;st.distance?1:0}intersectionSegment(e,t,i){const s=this.origin,n=G.Vector3[0],r=G.Vector3[1],o=G.Vector3[2],l=G.Vector3[3];t.subtractToRef(e,n),this.direction.scaleToRef(We._Rayl,o),s.addToRef(o,r),e.subtractToRef(s,l);const h=v.Dot(n,n),c=v.Dot(n,o),u=v.Dot(o,o),d=v.Dot(n,l),_=v.Dot(o,l),f=h*u-c*c;let g,p=f,x,m=f;fp&&(g=p,x=_+c,m=u)),x<0?(x=0,-d<0?g=0:-d>h?g=p:(g=-d,p=h)):x>m&&(x=m,-d+c<0?g=0:-d+c>h?g=p:(g=-d+c,p=h));const T=Math.abs(g)0&&S<=this.length&&E.lengthSquared()=a.distance?null:h};Me.prototype._internalPick=function(a,e,t,i,s){let n=null;const r=!!(this.activeCameras&&this.activeCameras.length>1&&this.cameraToUseForPointers!==this.activeCamera),o=this.cameraToUseForPointers||this.activeCamera;for(let l=0;l1&&this.cameraToUseForPointers!==this.activeCamera),n=this.cameraToUseForPointers||this.activeCamera;for(let r=0;r(this._tempPickingRay||(this._tempPickingRay=We.Zero()),this.createPickingRayToRef(a,e,r,this._tempPickingRay,s||null),this._tempPickingRay),t,i,!0);return n&&(n.ray=this.createPickingRay(a,e,N.Identity(),s||null)),n};Object.defineProperty(Me.prototype,"_pickingAvailable",{get:()=>!0,enumerable:!1,configurable:!1});Me.prototype.pick=function(a,e,t,i,s,n,r=!1){const o=this._internalPick((l,h)=>(this._tempPickingRay||(this._tempPickingRay=We.Zero()),this.createPickingRayToRef(a,e,l,this._tempPickingRay,s||null,!1,h),this._tempPickingRay),t,i,!1,n);return o&&(o.ray=this.createPickingRay(a,e,N.Identity(),s||null)),o};Me.prototype.pickWithRay=function(a,e,t,i){const s=this._internalPick(n=>(this._pickWithRayInverseMatrix||(this._pickWithRayInverseMatrix=N.Identity()),n.invertToRef(this._pickWithRayInverseMatrix),this._cachedRayForTransform||(this._cachedRayForTransform=We.Zero()),We.TransformToRef(a,this._pickWithRayInverseMatrix,this._cachedRayForTransform),this._cachedRayForTransform),e,t,!1,i);return s&&(s.ray=a),s};Me.prototype.multiPick=function(a,e,t,i,s){return this._internalMultiPick(n=>this.createPickingRay(a,e,n,i||null),t,s)};Me.prototype.multiPickWithRay=function(a,e,t){return this._internalMultiPick(i=>(this._pickWithRayInverseMatrix||(this._pickWithRayInverseMatrix=N.Identity()),i.invertToRef(this._pickWithRayInverseMatrix),this._cachedRayForTransform||(this._cachedRayForTransform=We.Zero()),We.TransformToRef(a,this._pickWithRayInverseMatrix,this._cachedRayForTransform),this._cachedRayForTransform),e,t)};de.prototype.getForwardRay=function(a=100,e,t){return this.getForwardRayToRef(new We(v.Zero(),v.Zero(),a),a,e,t)};de.prototype.getForwardRayToRef=function(a,e=100,t,i){return t||(t=this.getWorldMatrix()),a.length=e,i?a.origin.copyFrom(i):a.origin.copyFrom(this.position),G.Vector3[2].set(0,0,this._scene.useRightHandedSystem?-1:1),v.TransformNormalToRef(G.Vector3[2],t,G.Vector3[3]),v.NormalizeToRef(G.Vector3[3],a.direction),a};pe.prototype.setAlphaMode=function(a,e=!1){if(this._alphaMode===a&&(a===0&&!this._alphaState.alphaBlend||a!==0&&this._alphaState.alphaBlend)){if(!e){const t=a===0;this.depthCullingState.depthMask!==t&&(this.setDepthWrite(t),this._cacheRenderPipeline.setDepthWriteEnabled(t))}return}switch(a){case 0:this._alphaState.alphaBlend=!1;break;case 7:this._alphaState.setAlphaBlendFunctionParameters(1,771,1,1),this._alphaState.alphaBlend=!0;break;case 8:this._alphaState.setAlphaBlendFunctionParameters(1,771,1,771),this._alphaState.alphaBlend=!0;break;case 2:this._alphaState.setAlphaBlendFunctionParameters(770,771,1,1),this._alphaState.alphaBlend=!0;break;case 6:this._alphaState.setAlphaBlendFunctionParameters(1,1,0,1),this._alphaState.alphaBlend=!0;break;case 1:this._alphaState.setAlphaBlendFunctionParameters(770,1,0,1),this._alphaState.alphaBlend=!0;break;case 3:this._alphaState.setAlphaBlendFunctionParameters(0,769,1,1),this._alphaState.alphaBlend=!0;break;case 4:this._alphaState.setAlphaBlendFunctionParameters(774,0,1,1),this._alphaState.alphaBlend=!0;break;case 5:this._alphaState.setAlphaBlendFunctionParameters(770,769,1,1),this._alphaState.alphaBlend=!0;break;case 9:this._alphaState.setAlphaBlendFunctionParameters(32769,32770,32771,32772),this._alphaState.alphaBlend=!0;break;case 10:this._alphaState.setAlphaBlendFunctionParameters(1,769,1,771),this._alphaState.alphaBlend=!0;break;case 11:this._alphaState.setAlphaBlendFunctionParameters(1,1,1,1),this._alphaState.alphaBlend=!0;break;case 12:this._alphaState.setAlphaBlendFunctionParameters(772,1,0,0),this._alphaState.alphaBlend=!0;break;case 13:this._alphaState.setAlphaBlendFunctionParameters(775,769,773,771),this._alphaState.alphaBlend=!0;break;case 14:this._alphaState.setAlphaBlendFunctionParameters(1,771,1,771),this._alphaState.alphaBlend=!0;break;case 15:this._alphaState.setAlphaBlendFunctionParameters(1,1,1,0),this._alphaState.alphaBlend=!0;break;case 16:this._alphaState.setAlphaBlendFunctionParameters(775,769,0,1),this._alphaState.alphaBlend=!0;break;case 17:this._alphaState.setAlphaBlendFunctionParameters(770,771,1,771),this._alphaState.alphaBlend=!0;break}e||(this.setDepthWrite(a===Y.ALPHA_DISABLE),this._cacheRenderPipeline.setDepthWriteEnabled(a===Y.ALPHA_DISABLE)),this._alphaMode=a,this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)};pe.prototype.setAlphaEquation=function(a){Y.prototype.setAlphaEquation.call(this,a),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)};class bn{constructor(e,t,i,s=""){var n,r;this.name=null,this.defines="",this.onCompiled=null,this.onError=null,this.uniqueId=0,this.onCompileObservable=new ee,this.onErrorObservable=new ee,this.onBindObservable=new ee,this._wasPreviouslyReady=!1,this._isReady=!1,this._compilationError="",this._key="",this._computeSourceCodeOverride="",this._pipelineContext=null,this._computeSourceCode="",this._rawComputeSourceCode="",this._shaderLanguage=at.WGSL,this.name=e,this._key=s,this._engine=i,this.uniqueId=bn._UniqueIdSeed++,this.defines=(n=t.defines)!==null&&n!==void 0?n:"",this.onError=t.onError,this.onCompiled=t.onCompiled,this._entryPoint=(r=t.entryPoint)!==null&&r!==void 0?r:"main",this._shaderStore=te.GetShadersStore(this._shaderLanguage),this._shaderRepository=te.GetShadersRepository(this._shaderLanguage),this._includeShaderStore=te.GetIncludesShadersStore(this._shaderLanguage);let o;const l=Pt()?this._engine.getHostDocument():null;e.computeSource?o="source:"+e.computeSource:e.computeElement?(o=l?l.getElementById(e.computeElement):null,o||(o=e.computeElement)):o=e.compute||e;const h={defines:this.defines.split("\n"),indexParameters:void 0,isFragment:!1,shouldUseHighPrecisionShader:!1,processor:null,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:this._shaderRepository,includesShadersStore:this._includeShaderStore,version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:null,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer};this._loadShader(o,"Compute","",c=>{Qi.Initialize(h),Qi.PreProcess(c,h,u=>{this._rawComputeSourceCode=c,t.processFinalCode&&(u=t.processFinalCode(u));const d=Qi.Finalize(u,"",h);this._useFinalCode(d.vertexCode,e)},this._engine)})}_useFinalCode(e,t){if(t){const i=t.computeElement||t.compute||t.spectorName||t;this._computeSourceCode="//#define SHADER_NAME compute:"+i+"\n"+e}else this._computeSourceCode=e;this._prepareEffect()}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getCompilationError(){return this._compilationError}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&setTimeout(()=>{this._checkIsReady(null)},16)}_checkIsReady(e){try{if(this._isReadyInternal())return}catch(t){this._processCompilationErrors(t,e);return}setTimeout(()=>{this._checkIsReady(e)},16)}_loadShader(e,t,i,s){if(typeof HTMLElement<"u"&&e instanceof HTMLElement){const r=Xr(e);s(r);return}if(e.substr(0,7)==="source:"){s(e.substr(7));return}if(e.substr(0,7)==="base64:"){const r=window.atob(e.substr(7));s(r);return}if(this._shaderStore[e+t+"Shader"]){s(this._shaderStore[e+t+"Shader"]);return}if(i&&this._shaderStore[e+i+"Shader"]){s(this._shaderStore[e+i+"Shader"]);return}let n;e[0]==="."||e[0]==="/"||e.indexOf("http")>-1?n=e:n=this._shaderRepository+e,this._engine._loadFile(n+"."+t.toLowerCase()+".fx",s)}get computeSourceCode(){var e,t;return this._computeSourceCodeOverride?this._computeSourceCodeOverride:(t=(e=this._pipelineContext)===null||e===void 0?void 0:e._getComputeShaderCode())!==null&&t!==void 0?t:this._computeSourceCode}get rawComputeSourceCode(){return this._rawComputeSourceCode}_prepareEffect(){const e=this.defines,t=this._pipelineContext;this._isReady=!1;try{const i=this._engine;this._pipelineContext=i.createComputePipelineContext(),this._pipelineContext._name=this._key,i._prepareComputePipelineContext(this._pipelineContext,this._computeSourceCodeOverride?this._computeSourceCodeOverride:this._computeSourceCode,this._rawComputeSourceCode,this._computeSourceCodeOverride?null:e,this._entryPoint),i._executeWhenComputeStateIsCompiled(this._pipelineContext,()=>{this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),t&&this.getEngine()._deleteComputePipelineContext(t)}),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t){const i=/COMPUTE SHADER ERROR: 0:(\d+?):/;let s=null;if(t&&e){const n=t.match(i);if(n&&n.length===2){const r=parseInt(n[1]),o=e.split("\n",-1);o.length>=r&&(s="Offending line [".concat(r,"] in compute code: ").concat(o[r-1]))}}return[e,s]}_processCompilationErrors(e,t=null){var i;if(this._compilationError=e.message,H.Error("Unable to compile compute effect:"),H.Error("Defines:\r\n"+this.defines),bn.LogShaderCodeOnCompilationError){let s=null,n=null;!((i=this._pipelineContext)===null||i===void 0)&&i._getComputeShaderCode()&&([n,s]=this._getShaderCodeAndErrorLine(this._pipelineContext._getComputeShaderCode(),this._compilationError),n&&(H.Error("Compute code:"),H.Error(n))),s&&H.Error(s)}H.Error("Error: "+this._compilationError),t&&(this._pipelineContext=t,this._isReady=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this))}dispose(){this._pipelineContext&&this._pipelineContext.dispose(),this._engine._releaseComputeEffect(this)}static RegisterShader(e,t){te.GetShadersStore(at.WGSL)["".concat(e,"ComputeShader")]=t}}bn._UniqueIdSeed=0;bn.LogShaderCodeOnCompilationError=!0;var Bi;(function(a){a[a.Texture=0]="Texture",a[a.StorageTexture=1]="StorageTexture",a[a.UniformBuffer=2]="UniformBuffer",a[a.StorageBuffer=3]="StorageBuffer",a[a.TextureWithoutSampler=4]="TextureWithoutSampler",a[a.Sampler=5]="Sampler"})(Bi||(Bi={}));Ee.prototype.createComputeEffect=function(a,e){throw new Error("createComputeEffect: This engine does not support compute shaders!")};Ee.prototype.createComputePipelineContext=function(){throw new Error("createComputePipelineContext: This engine does not support compute shaders!")};Ee.prototype.createComputeContext=function(){};Ee.prototype.computeDispatch=function(a,e,t,i,s,n,r){throw new Error("computeDispatch: This engine does not support compute shaders!")};Ee.prototype.areAllComputeEffectsReady=function(){return!0};Ee.prototype.releaseComputeEffects=function(){};Ee.prototype._prepareComputePipelineContext=function(a,e,t,i,s){};Ee.prototype._rebuildComputeEffects=function(){};Ee.prototype._executeWhenComputeStateIsCompiled=function(a,e){e()};Ee.prototype._releaseComputeEffect=function(a){};Ee.prototype._deleteComputePipelineContext=function(a){};class ia{getBindGroups(e,t,i){if(!i)throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");if(this._bindGroups.length===0){const s=this._bindGroupEntries.length>0;for(const n in e){const r=e[n],o=i[n],l=o.group,h=o.binding,c=r.type,u=r.object;let d=r.indexInGroupEntries,_=this._bindGroupEntries[l];switch(_||(_=this._bindGroupEntries[l]=[]),c){case Bi.Sampler:{const f=u;d!==void 0&&s?_[d].resource=this._cacheSampler.getSampler(f):(r.indexInGroupEntries=_.length,_.push({binding:h,resource:this._cacheSampler.getSampler(f)}));break}case Bi.Texture:case Bi.TextureWithoutSampler:{const f=u,g=f._texture._hardwareTexture;d!==void 0&&s?(c===Bi.Texture&&(_[d++].resource=this._cacheSampler.getSampler(f._texture)),_[d].resource=g.view):(r.indexInGroupEntries=_.length,c===Bi.Texture&&_.push({binding:h-1,resource:this._cacheSampler.getSampler(f._texture)}),_.push({binding:h,resource:g.view}));break}case Bi.StorageTexture:{const f=u,g=f._texture._hardwareTexture;g.textureAdditionalUsages&it.StorageBinding||H.Error("computeDispatch: The texture (name=".concat(f.name,", uniqueId=").concat(f.uniqueId,") is not a storage texture!"),50),d!==void 0&&s?_[d].resource=g.viewForWriting:(r.indexInGroupEntries=_.length,_.push({binding:h,resource:g.viewForWriting}));break}case Bi.UniformBuffer:case Bi.StorageBuffer:{const g=(c===Bi.UniformBuffer,u).getBuffer(),p=g.underlyingResource;d!==void 0&&s?(_[d].resource.buffer=p,_[d].resource.size=g.capacity):(r.indexInGroupEntries=_.length,_.push({binding:h,resource:{buffer:p,offset:0,size:g.capacity}}));break}}}for(let n=0;n{this.computeDispatch(a,e,t,i,s,n,r)});return}const o=a._pipelineContext,l=e;o.computePipeline||(o.computePipeline=this._device.createComputePipeline({layout:Wn.Auto,compute:o.stage}));const c=this._renderTargetEncoder.beginComputePass();c.setPipeline(o.computePipeline);const u=l.getBindGroups(t,o.computePipeline,r);for(let d=0;d{const g=f,p=g[0].width,x=p;this._setCubeMapTextureParams(_,!i),_.format=r!=null?r:-1;const m=this._textureHelper.createGPUTextureForInternalTexture(_,p,x);this._textureHelper.updateCubeTextures(g,m.underlyingResource,p,x,m.format,!1,!1,0,0),i||this._generateMipmaps(_,this._uploadEncoder),_.isReady=!0,_.onLoadedObservable.notifyObservers(_),_.onLoadedObservable.clear(),s&&s()},!!d)};pe.prototype._setCubeMapTextureParams=function(a,e,t){a.samplingMode=e?3:2,a._cachedWrapU=0,a._cachedWrapV=0,t&&(a._maxLodLevel=t)};pe.prototype._debugPushGroup=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?(e===0?this._renderEncoder:this._renderTargetEncoder).pushDebugGroup(a):this._currentRenderPass?this._currentRenderPass.pushDebugGroup(a):this._pendingDebugCommands.push(["push",a]))};pe.prototype._debugPopGroup=function(a){this._options.enableGPUDebugMarkers&&(a===0||a===1?(a===0?this._renderEncoder:this._renderTargetEncoder).popDebugGroup():this._currentRenderPass?this._currentRenderPass.popDebugGroup():this._pendingDebugCommands.push(["pop",null]))};pe.prototype._debugInsertMarker=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?(e===0?this._renderEncoder:this._renderTargetEncoder).insertDebugMarker(a):this._currentRenderPass?this._currentRenderPass.insertDebugMarker(a):this._pendingDebugCommands.push(["insert",a]))};pe.prototype._debugFlushPendingCommands=function(){for(let a=0;a{e==null||e.removePendingData(d),h&&g&&h(g.status+" "+g.statusText,p)},f=g=>{const p=d.width,x=r(g);if(!x)return;const m=[0,2,4,1,3,5];if(o){const T=i===4,S=o(x),b=d._hardwareTexture,y=[0,1,2,3,4,5];for(let E=0;E>E,C=[];for(let R=0;R<6;R++){let w=S[E][y[R]];T&&(w=nr(w,P,P,s)),C.push(new Uint8Array(w.buffer,w.byteOffset,w.byteLength))}this._textureHelper.updateCubeTextures(C,b.underlyingResource,P,P,b.format,u,!1,0,0)}}else{const T=[];for(let S=0;S<6;S++)T.push(x[m[S]]);this.updateRawCubeTexture(d,T,i,s,u)}d.isReady=!0,e==null||e.removePendingData(d),l&&l()};return this._loadFile(a,g=>{f(g)},void 0,e==null?void 0:e.offlineProvider,!0,_),d};pe.prototype.createRawTexture3D=function(a,e,t,i,s,n,r,o,l=null,h=0,c=0){const u=ze.Raw3D,d=new Dt(this,u);return d.baseWidth=e,d.baseHeight=t,d.baseDepth=i,d.width=e,d.height=t,d.depth=i,d.format=s,d.type=h,d.generateMipMaps=n,d.samplingMode=o,d.is3D=!0,this._doNotHandleContextLost||(d._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(d,e,t,void 0,c),this.updateRawTexture3D(d,a,s,r,l,h),this._internalTexturesCache.push(d),d};pe.prototype.updateRawTexture3D=function(a,e,t,i,s=null,n=0){if(this._doNotHandleContextLost||(a._bufferView=e,a.format=t,a.invertY=i,a._compression=s),e){const r=a._hardwareTexture;t===4&&(e=nr(e,a.width,a.height,n));const l=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(l,a,a.width,a.height,a.depth,r.format,0,0,i,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder)}a.isReady=!0};pe.prototype.createRawTexture2DArray=function(a,e,t,i,s,n,r,o,l=null,h=0,c=0){const u=ze.Raw2DArray,d=new Dt(this,u);return d.baseWidth=e,d.baseHeight=t,d.baseDepth=i,d.width=e,d.height=t,d.depth=i,d.format=s,d.type=h,d.generateMipMaps=n,d.samplingMode=o,d.is2DArray=!0,this._doNotHandleContextLost||(d._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(d,e,t,i,c),this.updateRawTexture2DArray(d,a,s,r,l,h),this._internalTexturesCache.push(d),d};pe.prototype.updateRawTexture2DArray=function(a,e,t,i,s=null,n=0){if(this._doNotHandleContextLost||(a._bufferView=e,a.format=t,a.invertY=i,a._compression=s),e){const r=a._hardwareTexture;t===4&&(e=nr(e,a.width,a.height,n));const l=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(l,a,a.width,a.height,a.depth,r.format,0,0,i,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder)}a.isReady=!0};function nr(a,e,t,i){let s,n=1;i===1?s=new Float32Array(e*t*4):i===2?(s=new Uint16Array(e*t*4),n=15360):i===7?s=new Uint32Array(e*t*4):s=new Uint8Array(e*t*4);for(let r=0;r0,a.depth=l,a.isReady=!0,a.samples=n,a.generateMipMaps=!1,a.samplingMode=i?2:1,a.type=1,a._comparisonFunction=s,a._cachedWrapU=0,a._cachedWrapV=0};pe.prototype.updateRenderTargetTextureSampleCount=function(a,e){return!a||!a.texture||a.samples===e||(e=Math.min(e,this.getCaps().maxMSAASamples),this._textureHelper.createMSAATexture(a.texture,e),a._depthStencilTexture&&(this._textureHelper.createMSAATexture(a._depthStencilTexture,e),a._depthStencilTexture.samples=e),a._samples=e,a.texture.samples=e),e};pe.prototype.createRenderTargetCubeTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,samples:1,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer;const s=new Dt(this,ze.RenderTarget);return s.width=a,s.height=a,s.depth=0,s.isReady=!0,s.isCube=!0,s.samples=i.samples,s.generateMipMaps=i.generateMipMaps,s.samplingMode=i.samplingMode,s.type=i.type,s.format=i.format,this._internalTexturesCache.push(s),t.setTextures(s),(t._generateDepthBuffer||t._generateStencilBuffer)&&t.createDepthStencilTexture(0,i.samplingMode===void 0||i.samplingMode===2||i.samplingMode===2||i.samplingMode===3||i.samplingMode===3||i.samplingMode===5||i.samplingMode===6||i.samplingMode===7||i.samplingMode===11,t._generateStencilBuffer,t.samples),e&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(s),e&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!1),t};wt.prototype.setTextureSampler=function(a,e){this._engine.setTextureSampler(a,e)};pe.prototype.setTextureSampler=function(a,e){var t;(t=this._currentMaterialContext)===null||t===void 0||t.setSampler(a,e)};wt.prototype.setStorageBuffer=function(a,e){this._engine.setStorageBuffer(a,e)};pe.prototype.createStorageBuffer=function(a,e){return this._createBuffer(a,e|32)};pe.prototype.updateStorageBuffer=function(a,e,t,i){const s=a;t===void 0&&(t=0);let n;i===void 0?(e instanceof Array?n=new Float32Array(e):e instanceof ArrayBuffer?n=new Uint8Array(e):n=e,i=n.byteLength):e instanceof Array?n=new Float32Array(e):e instanceof ArrayBuffer?n=new Uint8Array(e):n=e,this._bufferManager.setSubData(s,t,n,0,i)};pe.prototype.readFromStorageBuffer=function(a,e,t,i){t=t||a.capacity;const s=this._bufferManager.createRawBuffer(t,Je.MapRead|Je.CopyDst);return this._renderTargetEncoder.copyBufferToBuffer(a.underlyingResource,e!=null?e:0,s,0,t),new Promise((n,r)=>{this.onEndFrameObservable.addOnce(()=>{s.mapAsync(Xs.Read,0,t).then(()=>{const o=s.getMappedRange(0,t);let l=i;if(l===void 0)l=new Uint8Array(t),l.set(new Uint8Array(o));else{const h=l.constructor;l=new h(l.buffer),l.set(new h(o))}s.unmap(),this._bufferManager.releaseBuffer(s),n(l)},o=>r(o))})})};pe.prototype.setStorageBuffer=function(a,e){var t,i;(t=this._currentDrawContext)===null||t===void 0||t.setBuffer(a,(i=e==null?void 0:e.getBuffer())!==null&&i!==void 0?i:null)};pe.prototype.createUniformBuffer=function(a){let e;return a instanceof Array?e=new Float32Array(a):e=a,this._bufferManager.createBuffer(e,Je.Uniform|Je.CopyDst)};pe.prototype.createDynamicUniformBuffer=function(a){return this.createUniformBuffer(a)};pe.prototype.updateUniformBuffer=function(a,e,t,i){t===void 0&&(t=0);const s=a;let n;i===void 0?(e instanceof Float32Array?n=e:n=new Float32Array(e),i=n.byteLength):e instanceof Float32Array?n=e:n=new Float32Array(e),this._bufferManager.setSubData(s,t,n,0,i)};pe.prototype.bindUniformBufferBase=function(a,e,t){this._currentDrawContext.setBuffer(t,a)};pe.prototype.bindUniformBlock=function(){};function hg(a){return!!(a&&a.underlyingResource!==void 0)}pe.prototype.updateVideoTexture=function(a,e,t){var i;if(!a||a._isDisabled)return;this._videoTextureSupported===void 0&&(this._videoTextureSupported=!0);let s=a._hardwareTexture;!((i=a._hardwareTexture)===null||i===void 0)&&i.underlyingResource||(s=this._textureHelper.createGPUTextureForInternalTexture(a)),hg(e)?(this._textureHelper.copyVideoToTexture(e,a,s.format,!t),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder),a.isReady=!0):e&&this.createImageBitmap(e).then(n=>{this._textureHelper.updateTexture(n,a,a.width,a.height,a.depth,s.format,0,0,!t,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder),a.isReady=!0}).catch(()=>{a.isReady=!0})};var cg={value:()=>{}};function Hl(){for(var a=0,e=arguments.length,t={},i;a=0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}Tr.prototype=Hl.prototype={constructor:Tr,on:function(a,e){var t=this._,i=ug(a+"",t),s,n=-1,r=i.length;if(arguments.length<2){for(;++n0)for(var t=new Array(s),i=0,s,n;i=0&&(e=a.slice(0,t))!=="xmlns"&&(a=a.slice(t+1)),Fo.hasOwnProperty(e)?{space:Fo[e],local:a}:a}function fg(a){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Wa&&e.documentElement.namespaceURI===Wa?e.createElement(a):e.createElementNS(t,a)}}function _g(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function M0(a){var e=sa(a);return(e.local?_g:fg)(e)}function pg(){}function P0(a){return a==null?pg:function(){return this.querySelector(a)}}function gg(a){typeof a!="function"&&(a=P0(a));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=T&&(T=m+1);!(b=p[T])&&++T=0;)(r=i[s])&&(n&&r.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(r,n),n=r);return this}function Gg(a){a||(a=Wg);function e(u,d){return u&&d?a(u.__data__,d.__data__):!u-!d}for(var t=this._groups,i=t.length,s=new Array(i),n=0;ne?1:a>=e?0:NaN}function zg(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function Hg(){return Array.from(this)}function Xg(){for(var a=this._groups,e=0,t=a.length;e1?this.each((e==null?i1:typeof e=="function"?n1:s1)(a,e,t==null?"":t)):yn(this.node(),a)}function yn(a,e){return a.style.getPropertyValue(e)||jl(a).getComputedStyle(a,null).getPropertyValue(e)}function a1(a){return function(){delete this[a]}}function o1(a,e){return function(){this[a]=e}}function l1(a,e){return function(){var t=e.apply(this,arguments);t==null?delete this[a]:this[a]=t}}function h1(a,e){return arguments.length>1?this.each((e==null?a1:typeof e=="function"?l1:o1)(a,e)):this.node()[a]}function $l(a){return a.trim().split(/^|\s+/)}function w0(a){return a.classList||new Zl(a)}function Zl(a){this._node=a,this._names=$l(a.getAttribute("class")||"")}Zl.prototype={add:function(a){var e=this._names.indexOf(a);e<0&&(this._names.push(a),this._node.setAttribute("class",this._names.join(" ")))},remove:function(a){var e=this._names.indexOf(a);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};function Ql(a,e){for(var t=w0(a),i=-1,s=e.length;++i=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function N1(a){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,n;t>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?pr(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?pr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Y1.exec(a))?new gi(e[1],e[2],e[3],1):(e=q1.exec(a))?new gi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=j1.exec(a))?pr(e[1],e[2],e[3],e[4]):(e=$1.exec(a))?pr(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Z1.exec(a))?Vo(e[1],e[2]/100,e[3]/100,1):(e=Q1.exec(a))?Vo(e[1],e[2]/100,e[3]/100,e[4]):Oo.hasOwnProperty(a)?No(Oo[a]):a==="transparent"?new gi(NaN,NaN,NaN,0):null}function No(a){return new gi(a>>16&255,a>>8&255,a&255,1)}function pr(a,e,t,i){return i<=0&&(a=e=t=NaN),new gi(a,e,t,i)}function tm(a){return a instanceof ar||(a=jn(a)),a?(a=a.rgb(),new gi(a.r,a.g,a.b,a.opacity)):new gi}function za(a,e,t,i){return arguments.length===1?tm(a):new gi(a,e,t,i==null?1:i)}function gi(a,e,t,i){this.r=+a,this.g=+e,this.b=+t,this.opacity=+i}D0(gi,za,sh(ar,{brighter(a){return a=a==null?Br:Math.pow(Br,a),new gi(this.r*a,this.g*a,this.b*a,this.opacity)},darker(a){return a=a==null?Yn:Math.pow(Yn,a),new gi(this.r*a,this.g*a,this.b*a,this.opacity)},rgb(){return this},clamp(){return new gi(js(this.r),js(this.g),js(this.b),Nr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Uo,formatHex:Uo,formatHex8:im,formatRgb:ko,toString:ko}));function Uo(){return"#".concat(Hs(this.r)).concat(Hs(this.g)).concat(Hs(this.b))}function im(){return"#".concat(Hs(this.r)).concat(Hs(this.g)).concat(Hs(this.b)).concat(Hs((isNaN(this.opacity)?1:this.opacity)*255))}function ko(){const a=Nr(this.opacity);return"".concat(a===1?"rgb(":"rgba(").concat(js(this.r),", ").concat(js(this.g),", ").concat(js(this.b)).concat(a===1?")":", ".concat(a,")"))}function Nr(a){return isNaN(a)?1:Math.max(0,Math.min(1,a))}function js(a){return Math.max(0,Math.min(255,Math.round(a)||0))}function Hs(a){return a=js(a),(a<16?"0":"")+a.toString(16)}function Vo(a,e,t,i){return i<=0?a=e=t=NaN:t<=0||t>=1?a=e=NaN:e<=0&&(a=NaN),new Vi(a,e,t,i)}function nh(a){if(a instanceof Vi)return new Vi(a.h,a.s,a.l,a.opacity);if(a instanceof ar||(a=jn(a)),!a)return new Vi;if(a instanceof Vi)return a;a=a.rgb();var e=a.r/255,t=a.g/255,i=a.b/255,s=Math.min(e,t,i),n=Math.max(e,t,i),r=NaN,o=n-s,l=(n+s)/2;return o?(e===n?r=(t-i)/o+(t0&&l<1?0:r,new Vi(r,o,l,a.opacity)}function sm(a,e,t,i){return arguments.length===1?nh(a):new Vi(a,e,t,i==null?1:i)}function Vi(a,e,t,i){this.h=+a,this.s=+e,this.l=+t,this.opacity=+i}D0(Vi,sm,sh(ar,{brighter(a){return a=a==null?Br:Math.pow(Br,a),new Vi(this.h,this.s,this.l*a,this.opacity)},darker(a){return a=a==null?Yn:Math.pow(Yn,a),new Vi(this.h,this.s,this.l*a,this.opacity)},rgb(){var a=this.h%360+(this.h<0)*360,e=isNaN(a)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new gi(Ea(a>=240?a-240:a+120,s,i),Ea(a,s,i),Ea(a<120?a+240:a-120,s,i),this.opacity)},clamp(){return new Vi(Go(this.h),gr(this.s),gr(this.l),Nr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const a=Nr(this.opacity);return"".concat(a===1?"hsl(":"hsla(").concat(Go(this.h),", ").concat(gr(this.s)*100,"%, ").concat(gr(this.l)*100,"%").concat(a===1?")":", ".concat(a,")"))}}));function Go(a){return a=(a||0)%360,a<0?a+360:a}function gr(a){return Math.max(0,Math.min(1,a||0))}function Ea(a,e,t){return(a<60?e+(t-e)*a/60:a<180?t:a<240?e+(t-e)*(240-a)/60:e)*255}const rh=a=>()=>a;function nm(a,e){return function(t){return a+t*e}}function rm(a,e,t){return a=Math.pow(a,t),e=Math.pow(e,t)-a,t=1/t,function(i){return Math.pow(a+i*e,t)}}function am(a){return(a=+a)==1?ah:function(e,t){return t-e?rm(e,t,a):rh(isNaN(e)?t:e)}}function ah(a,e){var t=e-a;return t?nm(a,t):rh(isNaN(a)?e:a)}const Wo=function a(e){var t=am(e);function i(s,n){var r=t((s=za(s)).r,(n=za(n)).r),o=t(s.g,n.g),l=t(s.b,n.b),h=ah(s.opacity,n.opacity);return function(c){return s.r=r(c),s.g=o(c),s.b=l(c),s.opacity=h(c),s+""}}return i.gamma=a,i}(1);function Rs(a,e){return a=+a,e=+e,function(t){return a*(1-t)+e*t}}var Ha=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ca=new RegExp(Ha.source,"g");function om(a){return function(){return a}}function lm(a){return function(e){return a(e)+""}}function hm(a,e){var t=Ha.lastIndex=Ca.lastIndex=0,i,s,n,r=-1,o=[],l=[];for(a=a+"",e=e+"";(i=Ha.exec(a))&&(s=Ca.exec(e));)(n=s.index)>t&&(n=e.slice(t,n),o[r]?o[r]+=n:o[++r]=n),(i=i[0])===(s=s[0])?o[r]?o[r]+=s:o[++r]=s:(o[++r]=null,l.push({i:r,x:Rs(i,s)})),t=Ca.lastIndex;return t180?c+=360:c-h>180&&(h+=360),d.push({i:u.push(s(u)+"rotate(",null,i)-2,x:Rs(h,c)})):c&&u.push(s(u)+"rotate("+c+i)}function o(h,c,u,d){h!==c?d.push({i:u.push(s(u)+"skewX(",null,i)-2,x:Rs(h,c)}):c&&u.push(s(u)+"skewX("+c+i)}function l(h,c,u,d,_,f){if(h!==u||c!==d){var g=_.push(s(_)+"scale(",null,",",null,")");f.push({i:g-4,x:Rs(h,u)},{i:g-2,x:Rs(c,d)})}else(u!==1||d!==1)&&_.push(s(_)+"scale("+u+","+d+")")}return function(h,c){var u=[],d=[];return h=a(h),c=a(c),n(h.translateX,h.translateY,c.translateX,c.translateY,u,d),r(h.rotate,c.rotate,u,d),o(h.skewX,c.skewX,u,d),l(h.scaleX,h.scaleY,c.scaleX,c.scaleY,u,d),h=c=null,function(_){for(var f=-1,g=d.length,p;++f=0&&a._call.call(void 0,e),a=a._next;--Tn}function Ho(){Zs=(kr=$n.now())+na,Tn=In=0;try{pm()}finally{Tn=0,mm(),Zs=0}}function gm(){var a=$n.now(),e=a-kr;e>hh&&(na-=e,kr=a)}function mm(){for(var a,e=Ur,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),a=e,e=e._next):(t=e._next,e._next=null,e=a?a._next=t:Ur=t);Mn=a,Ka(i)}function Ka(a){if(!Tn){In&&(In=clearTimeout(In));var e=a-Zs;e>24?(a<1/0&&(In=setTimeout(Ho,a-$n.now()-na)),Rn&&(Rn=clearInterval(Rn))):(Rn||(kr=$n.now(),Rn=setInterval(gm,hh)),Tn=1,ch(Ho))}}function Xo(a,e,t){var i=new Vr;return e=e==null?0:+e,i.restart(s=>{i.stop(),a(s+e)},e,t),i}var vm=Hl("start","end","cancel","interrupt"),xm=[],dh=0,Ko=1,Ya=2,Sr=3,Yo=4,qa=5,Ar=6;function ra(a,e,t,i,s,n){var r=a.__transition;if(!r)a.__transition={};else if(t in r)return;bm(a,t,{name:e,index:i,group:s,on:vm,tween:xm,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:dh})}function O0(a,e){var t=Yi(a,e);if(t.state>dh)throw new Error("too late; already scheduled");return t}function es(a,e){var t=Yi(a,e);if(t.state>Sr)throw new Error("too late; already running");return t}function Yi(a,e){var t=a.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function bm(a,e,t){var i=a.__transition,s;i[e]=t,t.timer=uh(n,0,t.time);function n(h){t.state=Ko,t.timer.restart(r,t.delay,t.time),t.delay<=h&&r(h-t.delay)}function r(h){var c,u,d,_;if(t.state!==Ko)return l();for(c in i)if(_=i[c],_.name===t.name){if(_.state===Sr)return Xo(r);_.state===Yo?(_.state=Ar,_.timer.stop(),_.on.call("interrupt",a,a.__data__,_.index,_.group),delete i[c]):+cYa&&i.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function Zm(a,e,t){var i,s,n=$m(e)?O0:es;return function(){var r=n(this,a),o=r.on;o!==i&&(s=(i=o).copy()).on(e,t),r.on=s}}function Qm(a,e){var t=this._id;return arguments.length<2?Yi(this.node(),t).on.on(a):this.each(Zm(t,a,e))}function Jm(a){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==a)return;e&&e.removeChild(this)}}function ev(){return this.on("end.remove",Jm(this._id))}function tv(a){var e=this._name,t=this._id;typeof a!="function"&&(a=P0(a));for(var i=this._groups,s=i.length,n=new Array(s),r=0;rn?n:Math.floor(r);const o=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,l=a.uvs,h=a.colors,c=[],u=[],d=[],_=[],f=[],g=[],p=[],x=[];let m;const T=[],S=[];let b,y,E;if(e.length<2){const Ce=[],le=[];for(y=0;y0&&(D=R[E].subtract(R[E-1]).length(),W=D+p[b],f[b].push(W),p[b]=W),E++;i&&(E--,c.push(R[0].x,R[0].y,R[0].z),D=R[E].subtract(R[0]).length(),W=D+p[b],f[b].push(W),p[b]=W),T[b]=w+C,S[b]=P,P+=w+C}let L,z,K=null,ae=null;for(y=0;y{let f=i[0].length;const g=o;let p=0;const x=g._originalBuilderSideOrientation===O.DOUBLESIDE?2:1;for(let m=1;m<=x;++m)for(let T=0;TQs(a,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:r,sideOrientation:o,instance:l},n);function mh(a){const e=new Array,t=new Array,i=new Array,s=new Array,n=a.radius||.5,r=a.tessellation||64,o=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,l=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE;e.push(0,0,0),s.push(.5,.5);const h=Math.PI*2*o,c=o===1?h/r:h/(r-1);let u=0;for(let f=0;fvh(a,{radius:e,tessellation:t,sideOrientation:n,updatable:s},i);function xh(a){let t=[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];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,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],s=[];let n=[];const r=a.width||a.size||1,o=a.height||a.size||1,l=a.depth||a.size||1,h=a.wrap||!1;let c=a.topBaseAt===void 0?1:a.topBaseAt,u=a.bottomBaseAt===void 0?0:a.bottomBaseAt;c=(c+4)%4,u=(u+4)%4;const d=[2,0,3,1],_=[2,0,1,3];let f=d[c],g=_[u],p=[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];if(h){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],p=[-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];let E=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],P=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const C=[17,18,19,16],R=[22,23,20,21];for(;f>0;)E.unshift(E.pop()),C.unshift(C.pop()),f--;for(;g>0;)P.unshift(P.pop()),R.unshift(R.pop()),g--;E=E.flat(),P=P.flat(),p=p.concat(E).concat(P),t.push(C[0],C[2],C[3],C[0],C[1],C[2]),t.push(R[0],R[2],R[3],R[0],R[1],R[2])}const x=[r/2,o/2,l/2];n=p.reduce((E,P,C)=>E.concat(P*x[C%3]),[]);const m=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,T=a.faceUV||new Array(6),S=a.faceColors,b=[];for(let E=0;E<6;E++)T[E]===void 0&&(T[E]=new Ye(0,0,1,1)),S&&S[E]===void 0&&(S[E]=new q(1,1,1,1));for(let E=0;E<6;E++)if(s.push(T[E].z,Ne.UseOpenGLOrientationForUV?1-T[E].w:T[E].w),s.push(T[E].x,Ne.UseOpenGLOrientationForUV?1-T[E].w:T[E].w),s.push(T[E].x,Ne.UseOpenGLOrientationForUV?1-T[E].y:T[E].y),s.push(T[E].z,Ne.UseOpenGLOrientationForUV?1-T[E].y:T[E].y),S)for(let P=0;P<4;P++)b.push(S[E].r,S[E].g,S[E].b,S[E].a);J._ComputeSides(m,n,t,i,s,a.frontUVs,a.backUVs);const y=new J;if(y.indices=t,y.positions=n,y.normals=i,y.uvs=s,S){const E=m===J.DOUBLESIDE?b.concat(b):b;y.colors=E}return y}function bh(a,e={},t=null){const i=new O(a,t);return e.sideOrientation=O._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,xh(e).applyToMesh(i,e.updatable),i}J.CreateBox=xh;O.CreateBox=(a,e,t=null,i,s)=>bh(a,{size:e,sideOrientation:s,updatable:i},t);function Un(a){const e=a.pattern||O.NO_FLIP,t=a.tileWidth||a.tileSize||1,i=a.tileHeight||a.tileSize||1,s=a.alignHorizontal||0,n=a.alignVertical||0,r=a.width||a.size||1,o=Math.floor(r/t);let l=r-o*t;const h=a.height||a.size||1,c=Math.floor(h/i);let u=h-c*i;const d=t*o/2,_=i*c/2;let f=0,g=0,p=0,x=0,m=0,T=0;if(l>0||u>0){switch(p=-d,x=-_,m=d,T=_,s){case O.CENTER:l/=2,p-=l,m+=l;break;case O.LEFT:m+=l,f=-l/2;break;case O.RIGHT:p-=l,f=l/2;break}switch(n){case O.CENTER:u/=2,x-=u,T+=u;break;case O.BOTTOM:T+=u,g=-u/2;break;case O.TOP:x-=u,g=u/2;break}}const S=[],b=[],y=[];y[0]=[0,0,1,0,1,1,0,1],y[1]=[0,0,1,0,1,1,0,1],(e===O.ROTATE_TILE||e===O.ROTATE_ROW)&&(y[1]=[1,1,0,1,0,0,1,0]),(e===O.FLIP_TILE||e===O.FLIP_ROW)&&(y[1]=[1,0,0,0,0,1,1,1]),(e===O.FLIP_N_ROTATE_TILE||e===O.FLIP_N_ROTATE_ROW)&&(y[1]=[0,1,1,1,1,0,0,0]);let E=[];const P=[],C=[];let R=0;for(let L=0;L0||u>0){const L=u>0&&(n===O.CENTER||n===O.TOP),z=u>0&&(n===O.CENTER||n===O.BOTTOM),K=l>0&&(s===O.CENTER||s===O.RIGHT),ae=l>0&&(s===O.CENTER||s===O.LEFT);let $=[],U,V,M,k;if(L&&K&&(S.push(p+f,x+g,0),S.push(-d+f,x+g,0),S.push(-d+f,x+u+g,0),S.push(p+f,x+u+g,0),C.push(R,R+1,R+3,R+1,R+2,R+3),R+=4,U=1-l/t,V=1-u/i,M=1,k=1,$=[U,V,M,V,M,k,U,k],e===O.ROTATE_ROW&&($=[1-U,1-V,1-M,1-V,1-M,1-k,1-U,1-k]),e===O.FLIP_ROW&&($=[1-U,V,1-M,V,1-M,k,1-U,k]),e===O.FLIP_N_ROTATE_ROW&&($=[U,1-V,M,1-V,M,1-k,U,1-k]),E=E.concat($),P.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),b.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&ae&&(S.push(d+f,x+g,0),S.push(m+f,x+g,0),S.push(m+f,x+u+g,0),S.push(d+f,x+u+g,0),C.push(R,R+1,R+3,R+1,R+2,R+3),R+=4,U=0,V=1-u/i,M=l/t,k=1,$=[U,V,M,V,M,k,U,k],(e===O.ROTATE_ROW||e===O.ROTATE_TILE&&o%2===0)&&($=[1-U,1-V,1-M,1-V,1-M,1-k,1-U,1-k]),(e===O.FLIP_ROW||e===O.FLIP_TILE&&o%2===0)&&($=[1-U,V,1-M,V,1-M,k,1-U,k]),(e===O.FLIP_N_ROTATE_ROW||e===O.FLIP_N_ROTATE_TILE&&o%2===0)&&($=[U,1-V,M,1-V,M,1-k,U,1-k]),E=E.concat($),P.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),b.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),z&&K&&(S.push(p+f,_+g,0),S.push(-d+f,_+g,0),S.push(-d+f,T+g,0),S.push(p+f,T+g,0),C.push(R,R+1,R+3,R+1,R+2,R+3),R+=4,U=1-l/t,V=0,M=1,k=u/i,$=[U,V,M,V,M,k,U,k],(e===O.ROTATE_ROW&&c%2===1||e===O.ROTATE_TILE&&c%1===0)&&($=[1-U,1-V,1-M,1-V,1-M,1-k,1-U,1-k]),(e===O.FLIP_ROW&&c%2===1||e===O.FLIP_TILE&&c%2===0)&&($=[1-U,V,1-M,V,1-M,k,1-U,k]),(e===O.FLIP_N_ROTATE_ROW&&c%2===1||e===O.FLIP_N_ROTATE_TILE&&c%2===0)&&($=[U,1-V,M,1-V,M,1-k,U,1-k]),E=E.concat($),P.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),b.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),z&&ae&&(S.push(d+f,_+g,0),S.push(m+f,_+g,0),S.push(m+f,T+g,0),S.push(d+f,T+g,0),C.push(R,R+1,R+3,R+1,R+2,R+3),R+=4,U=0,V=0,M=l/t,k=u/i,$=[U,V,M,V,M,k,U,k],(e===O.ROTATE_ROW&&c%2===1||e===O.ROTATE_TILE&&(c+o)%2===1)&&($=[1-U,1-V,1-M,1-V,1-M,1-k,1-U,1-k]),(e===O.FLIP_ROW&&c%2===1||e===O.FLIP_TILE&&(c+o)%2===1)&&($=[1-U,V,1-M,V,1-M,k,1-U,k]),(e===O.FLIP_N_ROTATE_ROW&&c%2===1||e===O.FLIP_N_ROTATE_TILE&&(c+o)%2===1)&&($=[U,1-V,M,1-V,M,1-k,U,1-k]),E=E.concat($),P.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),b.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L){const X=[];U=0,V=1-u/i,M=1,k=1,X[0]=[U,V,M,V,M,k,U,k],X[1]=[U,V,M,V,M,k,U,k],(e===O.ROTATE_TILE||e===O.ROTATE_ROW)&&(X[1]=[1-U,1-V,1-M,1-V,1-M,1-k,1-U,1-k]),(e===O.FLIP_TILE||e===O.FLIP_ROW)&&(X[1]=[1-U,V,1-M,V,1-M,k,1-U,k]),(e===O.FLIP_N_ROTATE_TILE||e===O.FLIP_N_ROTATE_ROW)&&(X[1]=[U,1-V,M,1-V,M,1-k,U,1-k]);for(let Q=0;QX+w)),w+=E[M].length,i)for(let X=0;X<4;X++)y.push(i[M].r,i[M].g,i[M].b,i[M].a)}const D=new v(0,0,g),W=N.RotationY(Math.PI);m=E[0].map(M=>v.TransformNormal(M,W).add(D)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]),T=P[0].map(M=>v.TransformNormal(M,W)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]),m=m.concat(E[1].map(M=>M.subtract(D)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),T=T.concat(P[1].map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]));const L=new v(_,0,0),z=N.RotationY(-Math.PI/2);m=m.concat(E[2].map(M=>v.TransformNormal(M,z).add(L)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),T=T.concat(P[2].map(M=>v.TransformNormal(M,z)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]));const K=N.RotationY(Math.PI/2);m=m.concat(E[3].map(M=>v.TransformNormal(M,K).subtract(L)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),T=T.concat(P[3].map(M=>v.TransformNormal(M,K)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]));const ae=new v(0,f,0),$=N.RotationX(Math.PI/2);m=m.concat(E[4].map(M=>v.TransformNormal(M,$).add(ae)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),T=T.concat(P[4].map(M=>v.TransformNormal(M,$)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[]));const U=N.RotationX(-Math.PI/2);m=m.concat(E[5].map(M=>v.TransformNormal(M,U).subtract(ae)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),T=T.concat(P[5].map(M=>v.TransformNormal(M,U)).map(M=>[M.x,M.y,M.z]).reduce((M,k)=>M.concat(k),[])),J._ComputeSides(d,m,b,T,S);const V=new J;if(V.indices=b,V.positions=m,V.normals=T,V.uvs=S,i){const M=d===J.DOUBLESIDE?y.concat(y):y;V.colors=M}return V}function Rv(a,e,t=null){const i=new O(a,t);return e.sideOrientation=O._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,yh(e).applyToMesh(i,e.updatable),i}J.CreateTiledBox=yh;function Th(a){const e=a.segments||32,t=a.diameterX||a.diameter||1,i=a.diameterY||a.diameter||1,s=a.diameterZ||a.diameter||1,n=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,r=a.slice&&a.slice<=0?1:a.slice||1,o=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,l=!!a.dedupTopBottomIndices,h=new v(t/2,i/2,s/2),c=2+e,u=2*c,d=[],_=[],f=[],g=[];for(let x=0;x<=c;x++){const m=x/c,T=m*Math.PI*r;for(let S=0;S<=u;S++){const b=S/u,y=b*Math.PI*2*n,E=N.RotationZ(-T),P=N.RotationY(y),C=v.TransformCoordinates(v.Up(),E),R=v.TransformCoordinates(C,P),w=R.multiply(h),D=R.divide(h).normalize();_.push(w.x,w.y,w.z),f.push(D.x,D.y,D.z),g.push(b,Ne.UseOpenGLOrientationForUV?1-m:m)}if(x>0){const S=_.length/3;for(let b=S-2*(u+1);b+u+21&&(d.push(b),d.push(b+1),d.push(b+u+1)),(xSh(a,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:n,updatable:s},i);function Ah(a){const e=a.height||2;let t=a.diameterTop===0?0:a.diameterTop||a.diameter||1,i=a.diameterBottom===0?0:a.diameterBottom||a.diameter||1;t=t||1e-5,i=i||1e-5;const s=a.tessellation||24,n=a.subdivisions||1,r=!!a.hasRings,o=!!a.enclose,l=a.cap===0?0:a.cap||O.CAP_ALL,h=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,c=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,u=a.faceUV||new Array(3),d=a.faceColors,_=h!==1&&o?2:0,f=r?n:1,g=2+(1+_)*f;let p;for(p=0;p{const Pe=Te?t/2:i/2;if(Pe===0)return;let De,nt,Ce;const le=Te?u[g-1]:u[0];let Fe=null;d&&(Fe=Te?d[g-1]:d[0]);const ke=m.length/3,Xe=Te?e/2:-e/2,tt=new v(0,Xe,0);m.push(tt.x,tt.y,tt.z),T.push(0,Te?1:-1,0);const Gt=le.y+(le.w-le.y)*.5;S.push(le.x+(le.z-le.x)*.5,Ne.UseOpenGLOrientationForUV?1-Gt:Gt),Fe&&b.push(Fe.r,Fe.g,Fe.b,Fe.a);const Rt=new fe(.5,.5);for(Ce=0;Ce<=s;Ce++){De=Math.PI*2*Ce*h/s;const di=Math.cos(-De),ti=Math.sin(-De);nt=new v(di*Pe,Xe,ti*Pe);const Wt=new fe(di*Rt.x+.5,ti*Rt.y+.5);m.push(nt.x,nt.y,nt.z),T.push(0,Te?1:-1,0);const Ft=le.y+(le.w-le.y)*Wt.y;S.push(le.x+(le.z-le.x)*Wt.x,Ne.UseOpenGLOrientationForUV?1-Ft:Ft),Fe&&b.push(Fe.r,Fe.g,Fe.b,Fe.a)}for(Ce=0;Ce((r===void 0||!(r instanceof Me))&&(r!==void 0&&(l=o||O.DEFAULTSIDE,o=r),r=n,n=1),Eh(a,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:n,sideOrientation:l,updatable:o},r));function Ch(a){const e=[],t=[],i=[],s=[],n=a.diameter||1,r=a.thickness||.5,o=a.tessellation||16,l=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,h=o+1;for(let u=0;u<=o;u++){const d=u/o,_=u*Math.PI*2/o-Math.PI/2,f=N.Translation(n/2,0,0).multiply(N.RotationY(_));for(let g=0;g<=o;g++){const p=1-g/o,x=g*Math.PI*2/o+Math.PI,m=Math.cos(x),T=Math.sin(x);let S=new v(m,T,0),b=S.scale(r/2);const y=new fe(d,p);b=v.TransformCoordinates(b,f),S=v.TransformNormal(S,f),t.push(b.x,b.y,b.z),i.push(S.x,S.y,S.z),s.push(y.x,Ne.UseOpenGLOrientationForUV?1-y.y:y.y);const E=(u+1)%h,P=(g+1)%h;e.push(u*h+g),e.push(u*h+P),e.push(E*h+g),e.push(u*h+P),e.push(E*h+P),e.push(E*h+g)}}J._ComputeSides(l,t,e,i,s,a.frontUVs,a.backUVs);const c=new J;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function Rh(a,e={},t){const i=new O(a,t);return e.sideOrientation=O._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Ch(e).applyToMesh(i,e.updatable),i}J.CreateTorus=Ch;O.CreateTorus=(a,e,t,i,s,n,r)=>Rh(a,{diameter:e,thickness:t,tessellation:i,sideOrientation:r,updatable:n},s);function Ih(a){const e=new Array,t=new Array,i=new Array,s=new Array,n=a.radius||2,r=a.tube||.5,o=a.radialSegments||32,l=a.tubularSegments||32,h=a.p||2,c=a.q||3,u=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,d=p=>{const x=Math.cos(p),m=Math.sin(p),T=c/h*p,S=Math.cos(T),b=n*(2+S)*.5*x,y=n*(2+S)*m*.5,E=n*Math.sin(T)*.5;return new v(b,y,E)};let _,f;for(_=0;_<=o;_++){const x=_%o/o*2*h*Math.PI,m=d(x),T=d(x+.01),S=T.subtract(m);let b=T.add(m);const y=v.Cross(S,b);for(b=v.Cross(y,S),y.normalize(),b.normalize(),f=0;fMh(a,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:n,q:r,sideOrientation:h,updatable:l},o);function Ph(a){const e=[],t=[],i=a.lines,s=a.colors,n=[];let r=0;for(let l=0;l0&&(e.push(r-1),e.push(r)),r++}}const o=new J;return o.indices=e,o.positions=t,s&&(o.colors=n),o}function wh(a){const e=a.dashSize||3,t=a.gapSize||1,i=a.dashNb||200,s=a.points,n=new Array,r=new Array,o=v.Zero();let l=0,h=0,c=0,u=0,d=0,_=0,f=0;for(f=0;f{const u=v.Zero(),d=c.length/6;let _=0,f=0,g=0,p=0,x=0,m=0,T=0,S=0;for(T=0;TFh(a,{points:e,updatable:i,instance:s},t);O.CreateDashedLines=(a,e,t,i,s,n=null,r,o)=>Oh(a,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:r,instance:o},n);class Iv extends fe{constructor(e,t){super(e.x,e.y),this.index=t}}class Ra{constructor(){this.elements=new Array}add(e){const t=new Array;return e.forEach(i=>{const s=new Iv(i,this.elements.length);t.push(s),this.elements.push(s)}),t}computeBounds(){const e=new fe(this.elements[0].x,this.elements[0].y),t=new fe(this.elements[0].x,this.elements[0].y);return this.elements.forEach(i=>{i.xt.x&&(t.x=i.x),i.yt.y&&(t.y=i.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class Mv{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new Ra,this._outlinepoints=new Ra,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||Ie.LastCreatedScene;let n;t instanceof r0?n=t.getPoints():n=t,this._addToepoint(n),this._points.add(n),this._outlinepoints.add(n),typeof this.bjsEarcut>"u"&&H.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new Ra;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){const s=new O(this._name,this._scene),n=this.buildVertexData(t,i);return s.setVerticesData(A.PositionKind,n.positions,e),s.setVerticesData(A.NormalKind,n.normals,e),s.setVerticesData(A.UVKind,n.uvs,e),s.setIndices(n.indices),s}buildVertexData(e=0,t=2){const i=new J,s=new Array,n=new Array,r=new Array,o=this._points.computeBounds();this._points.elements.forEach(c=>{s.push(0,1,0),n.push(c.x,0,c.y),r.push((c.x-o.min.x)/o.width,(c.y-o.min.y)/o.height)});const l=new Array,h=this.bjsEarcut(this._epoints,this._eholes,2);for(let c=0;c0){const c=n.length/3;this._points.elements.forEach(d=>{s.push(0,-1,0),n.push(d.x,-e,d.y),r.push(1-(d.x-o.min.x)/o.width,1-(d.y-o.min.y)/o.height)});const u=l.length;for(let d=0;d{this._addSide(n,s,r,l,o,d,e,!0,t)})}return i.indices=l,i.positions=n,i.normals=s,i.uvs=r,i}_addSide(e,t,i,s,n,r,o,l,h){let c=e.length/3,u=0;for(let d=0;dh?Eh?PB0(a,{shape:e,holes:i,updatable:s,sideOrientation:n},t,r);O.ExtrudePolygon=(a,e,t,i,s,n,r,o=earcut)=>Bh(a,{shape:e,holes:s,depth:t,updatable:n,sideOrientation:r},i,o);function Nh(a,e,t=null){const i=e.path,s=e.shape,n=e.scale||1,r=e.rotation||0,o=e.cap===0?0:e.cap||O.NO_CAP,l=e.updatable,h=O._GetDefaultSideOrientation(e.sideOrientation),c=e.instance||null,u=e.invertUV||!1,d=e.closeShape||!1,_=e.closePath||!1;return kh(a,s,i,n,r,null,null,_,d,o,!1,t,!!l,h,c,u,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame)}function Uh(a,e,t=null){const i=e.path,s=e.shape,n=e.scaleFunction||(()=>1),r=e.rotationFunction||(()=>0),o=e.closePath||e.ribbonCloseArray||!1,l=e.closeShape||e.ribbonClosePath||!1,h=e.cap===0?0:e.cap||O.NO_CAP,c=e.updatable,u=e.firstNormal||null,d=e.adjustFrame||!1,_=O._GetDefaultSideOrientation(e.sideOrientation),f=e.instance,g=e.invertUV||!1;return kh(a,s,i,null,null,n,r,o,l,h,!0,t,!!c,_,f||null,g,e.frontUVs||null,e.backUVs||null,u,d)}function kh(a,e,t,i,s,n,r,o,l,h,c,u,d,_,f,g,p,x,m,T){const S=(C,R,w,D,W,L,z,K,ae,$,U)=>{const V=w.getTangents(),M=w.getNormals(),k=w.getBinormals(),X=w.getDistances();if(U){for(let le=0;le0){let Fe=V[le-1];v.Dot(Fe,V[le])<0&&V[le].scaleInPlace(-1),Fe=M[le-1],v.Dot(Fe,M[le])<0&&M[le].scaleInPlace(-1),Fe=k[le-1],v.Dot(Fe,k[le])<0&&k[le].scaleInPlace(-1)}}let Q=0;const ge=()=>W!==null?W:1,Te=$&&K?K:()=>L!==null?L:0,Pe=$&&z?z:ge;let De=ae===O.NO_CAP||ae===O.CAP_END?0:2;const nt=G.Matrix[0];for(let le=0;le{const Fe=Array(),ke=v.Zero();let Xe;for(Xe=0;Xe3?0:h,y=S(e,t,b,E,i,s,n,r,h,c,T);const P=Qs(a,{pathArray:y,closeArray:o,closePath:l,updatable:d,sideOrientation:_,invertUV:g,frontUVs:p||void 0,backUVs:x||void 0},u);return P._creationDataStorage.pathArray=y,P._creationDataStorage.path3D=b,P._creationDataStorage.cap=h,P}O.ExtrudeShape=(a,e,t,i,s,n,r=null,o,l,h)=>{const c={shape:e,path:t,scale:i,rotation:s,cap:n===0?0:n||O.NO_CAP,sideOrientation:l,instance:h,updatable:o};return Nh(a,c,r)};O.ExtrudeShapeCustom=(a,e,t,i,s,n,r,o,l,h,c,u)=>{const d={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:n,ribbonClosePath:r,cap:o===0?0:o||O.NO_CAP,sideOrientation:c,instance:u,updatable:h};return Uh(a,d,l)};function Vh(a,e,t=null){const i=e.arc?e.arc<=0||e.arc>1?1:e.arc:1,s=e.closed===void 0?!0:e.closed,n=e.shape,r=e.radius||1,o=e.tessellation||64,l=e.clip||0,h=e.updatable,c=O._GetDefaultSideOrientation(e.sideOrientation),u=e.cap||O.NO_CAP,d=Math.PI*2,_=new Array,f=e.invertUV||!1;let g=0,p=0;const x=d/o*i;let m,T;for(g=0;g<=o-l;g++){for(T=[],(u==O.CAP_START||u==O.CAP_ALL)&&(T.push(new v(0,n[0].y,0)),T.push(new v(Math.cos(g*x)*n[0].x*r,n[0].y,Math.sin(g*x)*n[0].x*r))),p=0;pVh(a,{shape:e,radius:t,tessellation:i,sideOrientation:r,updatable:n},s);function Gh(a){const e=[],t=[],i=[],s=[],n=a.width||a.size||1,r=a.height||a.size||1,o=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,l=n/2,h=r/2;t.push(-l,-h,0),i.push(0,0,-1),s.push(0,Ne.UseOpenGLOrientationForUV?1:0),t.push(l,-h,0),i.push(0,0,-1),s.push(1,Ne.UseOpenGLOrientationForUV?1:0),t.push(l,h,0),i.push(0,0,-1),s.push(1,Ne.UseOpenGLOrientationForUV?0:1),t.push(-l,h,0),i.push(0,0,-1),s.push(0,Ne.UseOpenGLOrientationForUV?0:1),e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),J._ComputeSides(o,t,e,i,s,a.frontUVs,a.backUVs);const c=new J;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function Wh(a,e={},t=null){const i=new O(a,t);return e.sideOrientation=O._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Gh(e).applyToMesh(i,e.updatable),e.sourcePlane&&(i.translate(e.sourcePlane.normal,-e.sourcePlane.d),i.setDirection(e.sourcePlane.normal.scale(-1))),i}J.CreatePlane=Gh;O.CreatePlane=(a,e,t,i,s)=>Wh(a,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t);O._GroundMeshParser=(a,e)=>or.Parse(a,e);class or extends O{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;i.createOrUpdateSubmeshesOctree&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){const i=this.getWorldMatrix(),s=G.Matrix[5];i.invertToRef(s);const n=G.Vector3[8];if(v.TransformCoordinatesFromFloatsToRef(e,0,t,s,n),e=n.x,t=n.z,e=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const r=this._getFacetAt(e,t),o=-(r.x*e+r.z*t+r.w)/r.y;return v.TransformCoordinatesFromFloatsToRef(0,o,0,i,n),n.y}getNormalAtCoordinates(e,t){const i=new v(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){const s=this.getWorldMatrix(),n=G.Matrix[5];s.invertToRef(n);const r=G.Vector3[8];if(v.TransformCoordinatesFromFloatsToRef(e,0,t,n,r),e=r.x,t=r.z,ethis._maxX||tthis._maxZ)return this;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t);return v.TransformNormalFromFloatsToRef(o.x,o.y,o.z,s,i),this}updateCoordinateHeights(){return(!this._heightQuads||this._heightQuads.length==0)&&this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),s=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[s*this._subdivisionsX+i];let r;return ta.maxHeight){h=!0;const u=a.maxHeight;a.maxHeight=a.minHeight,a.minHeight=u}for(n=0;n<=a.subdivisions;n++)for(r=0;r<=a.subdivisions;r++){const u=new v(r*a.width/a.subdivisions-a.width/2,0,(a.subdivisions-n)*a.height/a.subdivisions-a.height/2),d=(u.x+a.width/2)/a.width*(a.bufferWidth-1)|0,_=(1-(u.z+a.height/2)/a.height)*(a.bufferHeight-1)|0,f=(d+_*a.bufferWidth)*4;let g=a.buffer[f]/255,p=a.buffer[f+1]/255,x=a.buffer[f+2]/255;const m=a.buffer[f+3]/255;h&&(g=1-g,p=1-p,x=1-x);const T=g*o.r+p*o.g+x*o.b;m>=l?u.y=a.minHeight+(a.maxHeight-a.minHeight)*T:u.y=a.minHeight-Ge,t.push(u.x,u.y,u.z),i.push(0,0,0),s.push(r/a.subdivisions,1-n/a.subdivisions)}for(n=0;n=a.minHeight,p=t[d*3+1]>=a.minHeight,x=t[_*3+1]>=a.minHeight;g&&p&&x&&(e.push(u),e.push(d),e.push(_)),t[f*3+1]>=a.minHeight&&g&&x&&(e.push(f),e.push(u),e.push(_))}J.ComputeNormals(t,e,i);const c=new J;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function Kh(a,e={},t){const i=new or(a,t);return i._setReady(!1),i._subdivisionsX=e.subdivisionsX||e.subdivisions||1,i._subdivisionsY=e.subdivisionsY||e.subdivisions||1,i._width=e.width||1,i._height=e.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,zh(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function Yh(a,e,t=null){const i=new O(a,t);return Hh(e).applyToMesh(i,e.updatable),i}function qh(a,e,t={},i=null){const s=t.width||10,n=t.height||10,r=t.subdivisions||1,o=t.minHeight||0,l=t.maxHeight||1,h=t.colorFilter||new he(.3,.59,.11),c=t.alphaFilter||0,u=t.updatable,d=t.onReady;i=i||Ie.LastCreatedScene;const _=new or(a,i);_._subdivisionsX=r,_._subdivisionsY=r,_._width=s,_._height=n,_._maxX=_._width/2,_._maxZ=_._height/2,_._minX=-_._maxX,_._minZ=-_._maxZ,_._setReady(!1);const f=g=>{const p=g.width,x=g.height;if(i.isDisposed)return;const m=i==null?void 0:i.getEngine().resizeImageBitmap(g,p,x);Xh({width:s,height:n,subdivisions:r,minHeight:o,maxHeight:l,colorFilter:h,buffer:m,bufferWidth:p,bufferHeight:x,alphaFilter:c}).applyToMesh(_,u),d&&d(_),_._setReady(!0)};return re.LoadImage(e,f,()=>{},i.offlineProvider),_}J.CreateGround=zh;J.CreateTiledGround=Hh;J.CreateGroundFromHeightMap=Xh;O.CreateGround=(a,e,t,i,s,n)=>Kh(a,{width:e,height:t,subdivisions:i,updatable:n},s);O.CreateTiledGround=(a,e,t,i,s,n,r,o,l)=>Yh(a,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:n,precision:r,updatable:l},o);O.CreateGroundFromHeightMap=(a,e,t,i,s,n,r,o,l,h,c)=>qh(a,e,{width:t,height:i,subdivisions:s,minHeight:n,maxHeight:r,updatable:l,onReady:h,alphaFilter:c},o);function jh(a,e,t=null){const i=e.path;let s=e.instance,n=1;e.radius!==void 0?n=e.radius:s&&(n=s._creationDataStorage.radius);const r=e.tessellation||64,o=e.radiusFunction||null;let l=e.cap||O.NO_CAP;const h=e.invertUV||!1,c=e.updatable,u=O._GetDefaultSideOrientation(e.sideOrientation);e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const d=(x,m,T,S,b,y,E,P)=>{const C=m.getTangents(),R=m.getNormals(),w=m.getDistances(),W=Math.PI*2/b*P,z=y||(()=>S);let K,ae,$,U;const V=G.Matrix[0];let M=E===O.NO_CAP||E===O.CAP_END?0:2;for(let X=0;X{const ge=Array();for(let ye=0;ye3?0:l,f=d(i,_,g,n,r,o,l,e.arc);const p=Qs(a,{pathArray:f,closePath:!0,closeArray:!1,updatable:c,sideOrientation:u,invertUV:h,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return p._creationDataStorage.pathArray=f,p._creationDataStorage.path3D=_,p._creationDataStorage.tessellation=r,p._creationDataStorage.cap=l,p._creationDataStorage.arc=e.arc,p._creationDataStorage.radius=n,p}O.CreateTube=(a,e,t,i,s,n,r,o,l,h)=>jh(a,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:n,updatable:o,sideOrientation:l,instance:h},r);function $h(a){const e=[];e[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},e[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},e[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},e[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},e[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},e[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},e[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},e[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},e[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},e[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},e[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},e[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},e[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},e[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},e[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const t=a.type&&(a.type<0||a.type>=e.length)?0:a.type||0,i=a.size,s=a.sizeX||i||1,n=a.sizeY||i||1,r=a.sizeZ||i||1,o=a.custom||e[t],l=o.face.length,h=a.faceUV||new Array(l),c=a.faceColors,u=a.flat===void 0?!0:a.flat,d=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,_=new Array,f=new Array,g=new Array,p=new Array,x=new Array;let m=0,T=0;const S=new Array;let b=0,y=0,E,P,C,R,w,D;if(u)for(y=0;yN0(a,e,t);function Zh(a){const e=a.sideOrientation||J.DEFAULTSIDE,t=a.radius||1,i=a.flat===void 0?!0:a.flat,s=a.subdivisions||4,n=a.radiusX||t,r=a.radiusY||t,o=a.radiusZ||t,l=(1+Math.sqrt(5))/2,h=[-1,l,-0,1,l,0,-1,-l,0,1,-l,0,0,-1,-l,0,1,-l,0,-1,l,0,1,l,l,0,1,l,0,-1,-l,0,1,-l,0,-1],c=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],u=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],d=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],_=138/1024,f=239/1024,g=60/1024,p=26/1024,x=-40/1024,m=20/1024,T=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],S=new Array,b=new Array,y=new Array,E=new Array;let P=0;const C=new Array(3),R=new Array(3);let w;for(w=0;w<3;w++)C[w]=v.Zero(),R[w]=fe.Zero();for(let W=0;W<20;W++){for(w=0;w<3;w++){const z=c[3*W+w];C[w].copyFromFloats(h[3*u[z]],h[3*u[z]+1],h[3*u[z]+2]),C[w].normalize(),R[w].copyFromFloats(d[2*z]*_+g+T[W]*x,d[2*z+1]*f+p+T[W]*m)}const L=(z,K,ae,$)=>{const U=v.Lerp(C[0],C[2],K/s),V=v.Lerp(C[1],C[2],K/s),M=s===K?C[2]:v.Lerp(U,V,z/(s-K));M.normalize();let k;if(i){const ye=v.Lerp(C[0],C[2],$/s),Te=v.Lerp(C[1],C[2],$/s);k=v.Lerp(ye,Te,ae/(s-$))}else k=new v(M.x,M.y,M.z);k.x/=n,k.y/=r,k.z/=o,k.normalize();const X=fe.Lerp(R[0],R[2],K/s),Q=fe.Lerp(R[1],R[2],K/s),ge=s===K?R[2]:fe.Lerp(X,Q,z/(s-K));b.push(M.x*n,M.y*r,M.z*o),y.push(k.x,k.y,k.z),E.push(ge.x,Ne.UseOpenGLOrientationForUV?1-ge.y:ge.y),S.push(P),P++};for(let z=0;zQh(a,e,t);const Pv=new v(1,0,0),wv=new v(-1,0,0),Dv=new v(0,1,0),Fv=new v(0,-1,0),Ov=new v(0,0,1),Lv=new v(0,0,-1);class Gr{constructor(e=v.Zero(),t=v.Up(),i=fe.Zero(),s=0,n=0,r=null,o=null,l=null,h=null){this.position=e,this.normal=t,this.uv=i,this.vertexIdx=s,this.vertexIdxForBones=n,this.localPositionOverride=r,this.localNormalOverride=o,this.matrixIndicesOverride=l,this.matrixWeightsOverride=h}clone(){var e,t,i,s;return new Gr(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,(e=this.localPositionOverride)===null||e===void 0?void 0:e.slice(),(t=this.localNormalOverride)===null||t===void 0?void 0:t.slice(),(i=this.matrixIndicesOverride)===null||i===void 0?void 0:i.slice(),(s=this.matrixWeightsOverride)===null||s===void 0?void 0:s.slice())}}function Jh(a,e,t){const i=!!e.skeleton,s=t.localMode||i,n=e.overrideMaterialSideOrientation!==null&&e.overrideMaterialSideOrientation!==void 0,r=e.getIndices(),o=i?e.getPositionData(!0,!0):e.getVerticesData(A.PositionKind),l=i?e.getNormalsData(!0,!0):e.getVerticesData(A.NormalKind),h=s?i?e.getVerticesData(A.PositionKind):o:null,c=s?i?e.getVerticesData(A.NormalKind):l:null,u=e.getVerticesData(A.UVKind),d=i?e.getVerticesData(A.MatricesIndicesKind):null,_=i?e.getVerticesData(A.MatricesWeightsKind):null,f=i?e.getVerticesData(A.MatricesIndicesExtraKind):null,g=i?e.getVerticesData(A.MatricesWeightsExtraKind):null,p=t.position||v.Zero();let x=t.normal||v.Up();const m=t.size||v.One(),T=t.angle||0;if(!x){const $=new v(0,0,1),U=e.getScene().activeCamera,V=v.TransformCoordinates($,U.getWorldMatrix());x=U.globalPosition.subtract(V)}const S=-Math.atan2(x.z,x.x)-Math.PI/2,b=Math.sqrt(x.x*x.x+x.z*x.z),y=Math.atan2(x.y,b),E=N.RotationYawPitchRoll(S,y,T).multiply(N.Translation(p.x,p.y,p.z)),P=N.Invert(E),R=e.getWorldMatrix().multiply(P),w=new J;w.indices=[],w.positions=[],w.normals=[],w.uvs=[],w.matricesIndices=i?[]:null,w.matricesWeights=i?[]:null,w.matricesIndicesExtra=f?[]:null,w.matricesWeightsExtra=g?[]:null;let D=0;const W=$=>{const U=new Gr;if(!r||!o||!l)return U;const V=r[$];if(U.vertexIdx=V*3,U.vertexIdxForBones=V*4,U.position=new v(o[V*3],o[V*3+1],o[V*3+2]),v.TransformCoordinatesToRef(U.position,R,U.position),U.normal=new v(l[V*3],l[V*3+1],l[V*3+2]),v.TransformNormalToRef(U.normal,R,U.normal),t.captureUVS&&u){const M=u[V*2+1];U.uv=new fe(u[V*2],Ne.UseOpenGLOrientationForUV?1-M:M)}return U},L=[0,0,0,0],z=($,U)=>{if($.length===0)return $;const V=.5*Math.abs(v.Dot(m,U)),M=(Q,ge,ye,Te)=>{for(let Pe=0;Pe{var ye,Te,Pe,De,nt,Ce,le,Fe,ke,Xe,tt,Gt,Rt,di,ti,Wt;const Ft=v.GetClipFactor(Q.position,ge.position,U,V);let ms=L,Ot=L;if(d&&_){const An=Q.matrixIndicesOverride?0:Q.vertexIdxForBones,_a=(ye=Q.matrixIndicesOverride)!==null&&ye!==void 0?ye:d,W0=(Te=Q.matrixWeightsOverride)!==null&&Te!==void 0?Te:_,pa=ge.matrixIndicesOverride?0:ge.vertexIdxForBones,z0=(Pe=ge.matrixIndicesOverride)!==null&&Pe!==void 0?Pe:d,H0=(De=ge.matrixWeightsOverride)!==null&&De!==void 0?De:_;ms=[0,0,0,0],Ot=[0,0,0,0];let Us=0;for(let Fi=0;Fi<4;++Fi)if(W0[An+Fi]>0){const En=M(z0,_a[An+Fi],pa,4);ms[Us]=_a[An+Fi],Ot[Us]=me.Lerp(W0[An+Fi],En>=0?H0[En]:0,Ft),Us++}for(let Fi=0;Fi<4&&Us<4;++Fi){const En=z0[pa+Fi];M(_a,En,An,4)===-1&&(ms[Us]=En,Ot[Us]=me.Lerp(0,H0[pa+Fi],Ft),Us++)}const lr=Ot[0]+Ot[1]+Ot[2]+Ot[3];Ot[0]/=lr,Ot[1]/=lr,Ot[2]/=lr,Ot[3]/=lr}const ai=Q.localPositionOverride?Q.localPositionOverride[0]:(nt=h==null?void 0:h[Q.vertexIdx])!==null&&nt!==void 0?nt:0,Ai=Q.localPositionOverride?Q.localPositionOverride[1]:(Ce=h==null?void 0:h[Q.vertexIdx+1])!==null&&Ce!==void 0?Ce:0,$t=Q.localPositionOverride?Q.localPositionOverride[2]:(le=h==null?void 0:h[Q.vertexIdx+2])!==null&&le!==void 0?le:0,fi=ge.localPositionOverride?ge.localPositionOverride[0]:(Fe=h==null?void 0:h[ge.vertexIdx])!==null&&Fe!==void 0?Fe:0,vs=ge.localPositionOverride?ge.localPositionOverride[1]:(ke=h==null?void 0:h[ge.vertexIdx+1])!==null&&ke!==void 0?ke:0,ha=ge.localPositionOverride?ge.localPositionOverride[2]:(Xe=h==null?void 0:h[ge.vertexIdx+2])!==null&&Xe!==void 0?Xe:0,k0=Q.localNormalOverride?Q.localNormalOverride[0]:(tt=c==null?void 0:c[Q.vertexIdx])!==null&&tt!==void 0?tt:0,V0=Q.localNormalOverride?Q.localNormalOverride[1]:(Gt=c==null?void 0:c[Q.vertexIdx+1])!==null&&Gt!==void 0?Gt:0,G0=Q.localNormalOverride?Q.localNormalOverride[2]:(Rt=c==null?void 0:c[Q.vertexIdx+2])!==null&&Rt!==void 0?Rt:0,oc=ge.localNormalOverride?ge.localNormalOverride[0]:(di=c==null?void 0:c[ge.vertexIdx])!==null&&di!==void 0?di:0,lc=ge.localNormalOverride?ge.localNormalOverride[1]:(ti=c==null?void 0:c[ge.vertexIdx+1])!==null&&ti!==void 0?ti:0,hc=ge.localNormalOverride?ge.localNormalOverride[2]:(Wt=c==null?void 0:c[ge.vertexIdx+2])!==null&&Wt!==void 0?Wt:0,ca=k0+(oc-k0)*Ft,ua=V0+(lc-V0)*Ft,da=G0+(hc-G0)*Ft,fa=Math.sqrt(ca*ca+ua*ua+da*da);return new Gr(v.Lerp(Q.position,ge.position,Ft),v.Lerp(Q.normal,ge.normal,Ft).normalize(),fe.Lerp(Q.uv,ge.uv,Ft),-1,-1,h?[ai+(fi-ai)*Ft,Ai+(vs-Ai)*Ft,$t+(ha-$t)*Ft]:null,c?[ca/fa,ua/fa,da/fa]:null,ms,Ot)};let X=null;$.length>3&&(X=new Array);for(let Q=0;Q<$.length;Q+=3){let ge=0,ye=null,Te=null,Pe=null,De=null;const nt=v.Dot($[Q].position,U)-V,Ce=v.Dot($[Q+1].position,U)-V,le=v.Dot($[Q+2].position,U)-V,Fe=nt>0,ke=Ce>0,Xe=le>0;switch(ge=(Fe?1:0)+(ke?1:0)+(Xe?1:0),ge){case 0:$.length>3?(X.push($[Q]),X.push($[Q+1]),X.push($[Q+2])):X=$;break;case 1:if(X=X!=null?X:new Array,Fe&&(ye=$[Q+1],Te=$[Q+2],Pe=k($[Q],ye),De=k($[Q],Te)),ke){ye=$[Q],Te=$[Q+2],Pe=k($[Q+1],ye),De=k($[Q+1],Te),X.push(Pe),X.push(Te.clone()),X.push(ye.clone()),X.push(Te.clone()),X.push(Pe.clone()),X.push(De);break}Xe&&(ye=$[Q],Te=$[Q+1],Pe=k($[Q+2],ye),De=k($[Q+2],Te)),ye&&Te&&Pe&&De&&(X.push(ye.clone()),X.push(Te.clone()),X.push(Pe),X.push(De),X.push(Pe.clone()),X.push(Te.clone()));break;case 2:X=X!=null?X:new Array,Fe||(ye=$[Q].clone(),Te=k(ye,$[Q+1]),Pe=k(ye,$[Q+2]),X.push(ye),X.push(Te),X.push(Pe)),ke||(ye=$[Q+1].clone(),Te=k(ye,$[Q+2]),Pe=k(ye,$[Q]),X.push(ye),X.push(Te),X.push(Pe)),Xe||(ye=$[Q+2].clone(),Te=k(ye,$[Q]),Pe=k(ye,$[Q+1]),X.push(ye),X.push(Te),X.push(Pe));break}}return X},K=new Array(3);for(let $=0;$Jh(a,e,{position:t,normal:i,size:s,angle:n});function ec(a={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(a.subdivisions?a.subdivisions:2,1),t=Math.max(a.tessellation?a.tessellation:16,3),i=Math.max(a.height?a.height:1,0),s=Math.max(a.radius?a.radius:.25,0),n=Math.max(a.capSubdivisions?a.capSubdivisions:6,1),r=t,o=e,l=Math.max(a.radiusTop?a.radiusTop:s,0),h=Math.max(a.radiusBottom?a.radiusBottom:s,0),c=i-(l+h),u=0,d=2*Math.PI,_=Math.max(a.topCapSubdivisions?a.topCapSubdivisions:n,1),f=Math.max(a.bottomCapSubdivisions?a.bottomCapSubdivisions:n,1),g=Math.acos((h-l)/i);let p=[];const x=[],m=[],T=[];let S=0;const b=[],y=c*.5,E=Math.PI*.5;let P,C;const R=v.Zero(),w=v.Zero(),D=Math.cos(g),W=Math.sin(g),L=new fe(l*W,y+l*D).subtract(new fe(h*W,-y+h*D)).length(),z=l*g+L+h*(E-g);let K=0;for(C=0;C<=_;C++){const V=[],M=E-g*(C/_);K+=l*g/_;const k=Math.cos(M),X=Math.sin(M),Q=k*l;for(P=0;P<=r;P++){const ge=P/r,ye=ge*d+u,Te=Math.sin(ye),Pe=Math.cos(ye);w.x=Q*Te,w.y=y+X*l,w.z=Q*Pe,x.push(w.x,w.y,w.z),R.set(k*Te,X,k*Pe),m.push(R.x,R.y,R.z),T.push(ge,Ne.UseOpenGLOrientationForUV?K/z:1-K/z),V.push(S),S++}b.push(V)}const ae=i-l-h+D*l-D*h,$=W*(h-l)/ae;for(C=1;C<=o;C++){const V=[];K+=L/o;const M=W*(C*(h-l)/o+l);for(P=0;P<=r;P++){const k=P/r,X=k*d+u,Q=Math.sin(X),ge=Math.cos(X);w.x=M*Q,w.y=y+D*l-C*ae/o,w.z=M*ge,x.push(w.x,w.y,w.z),R.set(Q,$,ge).normalize(),m.push(R.x,R.y,R.z),T.push(k,Ne.UseOpenGLOrientationForUV?K/z:1-K/z),V.push(S),S++}b.push(V)}for(C=1;C<=f;C++){const V=[],M=E-g-(Math.PI-g)*(C/f);K+=h*g/f;const k=Math.cos(M),X=Math.sin(M),Q=k*h;for(P=0;P<=r;P++){const ge=P/r,ye=ge*d+u,Te=Math.sin(ye),Pe=Math.cos(ye);w.x=Q*Te,w.y=-y+X*h,w.z=Q*Pe,x.push(w.x,w.y,w.z),R.set(k*Te,X,k*Pe),m.push(R.x,R.y,R.z),T.push(ge,Ne.UseOpenGLOrientationForUV?K/z:1-K/z),V.push(S),S++}b.push(V)}for(P=0;Ptc(a,e,t);J.CreateCapsule=ec;class ut{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&H.Warn("x is not an integer, floor(x) used"),t!==Math.floor(t)&&H.Warn("y is not an integer, floor(y) used")}clone(){return new ut(this.x,this.y)}rotate60About(e){const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&H.Warn("m not an integer only floor(m) used"),t!==Math.floor(t)&&H.Warn("n not an integer only floor(n) used");const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){e!==Math.floor(e)&&H.Warn("m is not an integer, floor(m) used"),t!==Math.floor(t)&&H.Warn("n is not an integer, floor(n) used");const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){const i=v.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){return new ut(0,0)}}class ic{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new ja("icosahedron","Regular",[[0,xt,-1],[-xt,1,0],[-1,0,-xt],[1,0,-xt],[xt,1,0],[0,xt,1],[-1,0,xt],[-xt,-1,0],[0,-xt,-1],[xt,-1,0],[1,0,xt],[0,-xt,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){let e=12;const t={},i=this.m,s=this.n;let n=i,r=1,o=0;s!==0&&(n=me.HCF(i,s)),r=i/n,o=s/n;let l,h,c,u,d;const _=ut.Zero(),f=new ut(i,s),g=new ut(-s,i+s),p=ut.Zero(),x=ut.Zero(),m=ut.Zero();let T=[],S,b,y,E;const P=[],C=this.vertByDist,R=(w,D,W,L)=>{S=w+"|"+W,b=D+"|"+L,S in t||b in t?S in t&&!(b in t)?t[b]=t[S]:b in t&&!(S in t)&&(t[S]=t[b]):(t[S]=e,t[b]=e,e++),C[W][0]>2?P[t[S]]=[-C[W][0],C[W][1],t[S]]:P[t[S]]=[T[C[W][0]],C[W][1],t[S]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let w=0;w<20;w++){if(T=this.IDATA.face[w],c=T[2],u=T[1],d=T[0],y=_.x+"|"+_.y,S=w+"|"+y,S in t||(t[S]=c,P[c]=[T[C[y][0]],C[y][1]]),y=f.x+"|"+f.y,S=w+"|"+y,S in t||(t[S]=u,P[u]=[T[C[y][0]],C[y][1]]),y=g.x+"|"+g.y,S=w+"|"+y,S in t||(t[S]=d,P[d]=[T[C[y][0]],C[y][1]]),l=this.IDATA.edgematch[w][0],h=this.IDATA.edgematch[w][1],h==="B")for(let D=1;D2?P[t[S]]=[-C[y][0],C[y][1],t[S]]:P[t[S]]=[T[C[y][0]],C[y][1],t[S]])}this.closestTo=P,this.vecToidx=t}calcCoeffs(){const e=this.m,t=this.n,i=Math.sqrt(3)/3,s=e*e+t*t+e*t;this.coau=(e+t)/s,this.cobu=-t/s,this.coav=-i*(e-t)/s,this.cobv=i*(2*e+t)/s}createInnerFacets(){const e=this.m,t=this.n;for(let i=0;i0&&s0){const b=me.HCF(e,t),y=e/b,E=t/b;for(let C=1;Cb.x-y.x),i.sort((b,y)=>b.y-y.y);const o=new Array(e+t+1),l=new Array(e+t+1);for(let b=0;b{const E=b.clone();return y==="A"&&E.rotateNeg120(e,t),y==="B"&&E.rotate120(e,t),E.x<0?E.y:E.x+E.y},_=[],f=[],g=[],p=[],x={},m=[];let T=-1,S=-1;for(let b=0;bb[2]-y[2]),m.sort((b,y)=>b[3]-y[3]),m.sort((b,y)=>b[1]-y[1]),m.sort((b,y)=>b[0]-y[0]);for(let b=0;bt.vecToidx[e+s]))}mapABOBtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s-1?i[r][1]>0&&t[i[r][0]].push([r,i[r][1]]):t[12].push([r,i[r][0]]);const s=[];for(let r=0;r<12;r++)s[r]=r;let n=12;for(let r=0;r<12;r++){t[r].sort((o,l)=>o[1]-l[1]);for(let o=0;or[3]-o[3]);for(let r=0;r0;)n=t[l],this.face[n].indexOf(o)>-1?(r=(this.face[n].indexOf(o)+1)%3,o=this.face[n][r],i.push(o),s.push(n),t.splice(l,1),l=0):l++;return this.adjacentFaces.push(i),s}toGoldbergPolyhedronData(){const e=new ja("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let h=0;h{s=0,n=0,r=0,o=this.face[c];for(let u=0;u<3;u++)l=this.vertex[o[u]],s+=l[0],n+=l[1],r+=l[2];e.vertex[c]=[s/3,n/3,r/3]});return e}static BuildGeodesicData(e){const t=new aa("Geodesic-m-n","Geodesic",[[0,xt,-1],[-xt,1,0],[-1,0,-xt],[1,0,-xt],[xt,1,0],[0,xt,1],[-1,0,xt],[-xt,-1,0],[0,-xt,-1],[xt,-1,0],[1,0,xt],[0,-xt,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;si){const h=s;s=i,i=h,H.Warn("n > m therefore m and n swapped")}const n=new ic;n.build(i,s);const o={custom:aa.BuildGeodesicData(n),size:e.size,sizeX:e.sizeX,sizeY:e.sizeY,sizeZ:e.sizeZ,faceUV:e.faceUV,faceColors:e.faceColors,flat:e.flat,updatable:e.updatable,sideOrientation:e.sideOrientation,frontUVs:e.frontUVs,backUVs:e.backUVs};return N0(a,o,t)}O._GoldbergMeshParser=(a,e)=>oa.Parse(a,e);class oa extends O{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return t===void 0?(e>this.goldbergData.nbUnsharedFaces-1&&(H.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(H.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(H.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let i=0;i1&&(u=1),h.push(u,d);for(let _=0;_<6;_++)u=r.x+o*Math.cos(l+_*Math.PI/3),d=r.y+o*Math.sin(l+_*Math.PI/3),u<0&&(u=0),u>1&&(u=1),c.push(u,d);for(let _=s;_q.FromArray(n)),i.faceCenters=i.faceCenters.map(n=>v.FromArray(n)),i.faceZaxis=i.faceZaxis.map(n=>v.FromArray(n)),i.faceXaxis=i.faceXaxis.map(n=>v.FromArray(n)),i.faceYaxis=i.faceYaxis.map(n=>v.FromArray(n));const s=new oa(e.name,t);return s.goldbergData=i,s}}function Nv(a,e){const t=a.size,i=a.sizeX||t||1,s=a.sizeY||t||1,n=a.sizeZ||t||1,r=a.sideOrientation===0?0:a.sideOrientation||J.DEFAULTSIDE,o=new Array,l=new Array,h=new Array,c=new Array;let u=1/0,d=-1/0,_=1/0,f=-1/0;for(let x=0;xo){const f=l;l=o,o=f,H.Warn("n > m therefore m and n swapped")}const h=new ic;h.build(o,l);const c=aa.BuildGeodesicData(h),u=c.toGoldbergPolyhedronData(),d=new oa(a,t);e.sideOrientation=O._GetDefaultSideOrientation(e.sideOrientation),d._originalBuilderSideOrientation=e.sideOrientation,Nv(e,u).applyToMesh(d,e.updatable),d.goldbergData.nbSharedFaces=c.sharedNodes,d.goldbergData.nbUnsharedFaces=c.poleNodes,d.goldbergData.adjacentFaces=c.adjacentFaces,d.goldbergData.nbFaces=d.goldbergData.nbSharedFaces+d.goldbergData.nbUnsharedFaces,d.goldbergData.nbFacesAtPole=(d.goldbergData.nbUnsharedFaces-12)/12;for(let f=0;f=this._thinInstanceDataStorage.instancesCount)return!1;const i=this._thinInstanceDataStorage.matrixData;return e.copyToArray(i,a*16),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[a]=e),t&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0};O.prototype.thinInstanceSetAttributeAt=function(a,e,t,i=!0){return a===A.ColorKind&&(a=A.ColorInstanceKind),!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[a]||e>=this._thinInstanceDataStorage.instancesCount?!1:(this._thinInstanceUpdateBufferSize(a,0),this._userThinInstanceBuffersStorage.data[a].set(t,e*this._userThinInstanceBuffersStorage.strides[a]),i&&this.thinInstanceBufferUpdated(a),!0)};Object.defineProperty(O.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(a){var e,t;const i=(e=this._thinInstanceDataStorage.matrixData)!==null&&e!==void 0?e:(t=this.source)===null||t===void 0?void 0:t._thinInstanceDataStorage.matrixData,s=i?i.length/16:0;a<=s&&(this._thinInstanceDataStorage.instancesCount=a)},enumerable:!0,configurable:!0});O.prototype._thinInstanceCreateMatrixBuffer=function(a,e,t=!1){a===A.ColorKind&&(a=A.ColorInstanceKind);const i=new zn(this.getEngine(),e,!t,16,!1,!0);for(let s=0;s<4;s++)this.setVerticesBuffer(i.createVertexBuffer(a+s,s*4,4));return i};O.prototype.thinInstanceSetBuffer=function(a,e,t=0,i=!1){var s,n,r;t=t||16,a==="matrix"?((s=this._thinInstanceDataStorage.matrixBuffer)===null||s===void 0||s.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*t,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,e!==null?(this._thinInstanceDataStorage.instancesCount=e.length/t,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,i),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo())):a==="previousMatrix"?((n=this._thinInstanceDataStorage.previousMatrixBuffer)===null||n===void 0||n.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,e!==null&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,i))):(a===A.ColorKind&&(a=A.ColorInstanceKind),e===null?!((r=this._userThinInstanceBuffersStorage)===null||r===void 0)&&r.data[a]&&(this.removeVerticesData(a),delete this._userThinInstanceBuffersStorage.data[a],delete this._userThinInstanceBuffersStorage.strides[a],delete this._userThinInstanceBuffersStorage.sizes[a],delete this._userThinInstanceBuffersStorage.vertexBuffers[a]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[a]=e,this._userThinInstanceBuffersStorage.strides[a]=t,this._userThinInstanceBuffersStorage.sizes[a]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[a]=new A(this.getEngine(),e,a,!i,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[a])))};O.prototype.thinInstanceBufferUpdated=function(a){var e,t,i;a==="matrix"?(e=this._thinInstanceDataStorage.matrixBuffer)===null||e===void 0||e.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount):a==="previousMatrix"?(t=this._thinInstanceDataStorage.previousMatrixBuffer)===null||t===void 0||t.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount):(a===A.ColorKind&&(a=A.ColorInstanceKind),!((i=this._userThinInstanceBuffersStorage)===null||i===void 0)&&i.vertexBuffers[a]&&this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(this._userThinInstanceBuffersStorage.data[a],0))};O.prototype.thinInstancePartialBufferUpdate=function(a,e,t){var i;a==="matrix"?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,t):(a===A.ColorKind&&(a=A.ColorInstanceKind),!((i=this._userThinInstanceBuffersStorage)===null||i===void 0)&&i.vertexBuffers[a]&&this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(e,t))};O.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const a=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=new Array;for(let e=0;e{this._outputTexture?_.setFloat2("delta",1/this._outputTexture.width*this.direction.x,1/this._outputTexture.height*this.direction.y):_.setFloat2("delta",1/this.width*this.direction.x,1/this.height*this.direction.y)}),this.kernel=i}updateEffect(e=null,t=null,i=null,s,n,r){this._updateParameters(n,r)}_updateParameters(e,t){const i=this._kernel,s=(i-1)/2;let n=[],r=[],o=0;for(let p=0;p0)return Math.max(i,3);return Math.max(t,3)}_gaussianWeight(e){const t=.3333333333333333,i=Math.sqrt(2*Math.PI)*t,s=-(e*e/(2*t*t));return 1/i*Math.exp(s)}_glslFloat(e,t=8){return e.toFixed(t).replace(/0+$/,"")}static _Parse(e,t,i,s){return Se.Parse(()=>new Bs(e.name,e.direction,e.kernel,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType,void 0,!1),e,i,s)}}F([B("kernel")],Bs.prototype,"_kernel",void 0);F([B("packedFloat")],Bs.prototype,"_packedFloat",void 0);F([Al()],Bs.prototype,"direction",void 0);Vt("BABYLON.BlurPostProcess",Bs);const Qv="glowMapGenerationPixelShader",Jv="#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)\n#include\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;\n#include\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#include\nvec4 finalColor=glowColor;\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef DIFFUSE_ISLINEAR\nalbedoTexture=toGammaSpace(albedoTexture);\n#endif\n#ifdef GLOW\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a{if((i||t===0)&&e.subMeshes)for(let s=0;s{this.onBeforeRenderMainTextureObservable.notifyObservers(this);let n;const r=this._scene.getEngine();if(s.length){for(r.setColorWrite(!1),n=0;n{e.clear(this.neutralColor,!0,!0,!0)}),this._scene.getBoundingBoxRenderer){const e=this._scene.getBoundingBoxRenderer().enabled;this._mainTexture.onBeforeBindObservable.add(()=>{this._scene.getBoundingBoxRenderer().enabled=!this.disableBoundingBoxesFromEffectLayer&&e}),this._mainTexture.onAfterUnbindObservable.add(()=>{this._scene.getBoundingBoxRenderer().enabled=e})}}_addCustomEffectDefines(e){}_isReady(e,t,i){var s;const n=this._scene.getEngine(),r=e.getMesh(),o=(s=r._internalAbstractMeshDataInfo._materialForRenderPass)===null||s===void 0?void 0:s[n.currentRenderPassId];if(o)return o.isReadyForSubMesh(r,e,t);const l=e.getMaterial();if(!l)return!1;if(this._useMeshMaterial(e.getRenderingMesh()))return l.isReadyForSubMesh(e.getMesh(),e,t);const h=[],c=[A.PositionKind];let u=!1,d=!1;if(l){const T=l.needAlphaTesting(),S=l.getAlphaTestTexture(),b=S&&S.hasAlpha&&(l.useAlphaFromDiffuseTexture||l._useAlphaFromAlbedoTexture);S&&(T||b)&&(h.push("#define DIFFUSE"),r.isVerticesDataPresent(A.UV2Kind)&&S.coordinatesIndex===1?(h.push("#define DIFFUSEUV2"),d=!0):r.isVerticesDataPresent(A.UVKind)&&(h.push("#define DIFFUSEUV1"),u=!0),T&&(h.push("#define ALPHATEST"),h.push("#define ALPHATESTVALUE 0.4")),S.gammaSpace||h.push("#define DIFFUSE_ISLINEAR"));const y=l.opacityTexture;y&&(h.push("#define OPACITY"),r.isVerticesDataPresent(A.UV2Kind)&&y.coordinatesIndex===1?(h.push("#define OPACITYUV2"),d=!0):r.isVerticesDataPresent(A.UVKind)&&(h.push("#define OPACITYUV1"),u=!0))}i&&(h.push("#define EMISSIVE"),r.isVerticesDataPresent(A.UV2Kind)&&i.coordinatesIndex===1?(h.push("#define EMISSIVEUV2"),d=!0):r.isVerticesDataPresent(A.UVKind)&&(h.push("#define EMISSIVEUV1"),u=!0),i.gammaSpace||h.push("#define EMISSIVE_ISLINEAR")),r.useVertexColors&&r.isVerticesDataPresent(A.ColorKind)&&r.hasVertexAlpha&&l.transparencyMode!==j.MATERIAL_OPAQUE&&(c.push(A.ColorKind),h.push("#define VERTEXALPHA")),u&&(c.push(A.UVKind),h.push("#define UV1")),d&&(c.push(A.UV2Kind),h.push("#define UV2"));const _=new R0;if(r.useBones&&r.computeBonesUsingShaders){c.push(A.MatricesIndicesKind),c.push(A.MatricesWeightsKind),r.numBoneInfluencers>4&&(c.push(A.MatricesIndicesExtraKind),c.push(A.MatricesWeightsExtraKind)),h.push("#define NUM_BONE_INFLUENCERS "+r.numBoneInfluencers);const T=r.skeleton;T&&T.isUsingTextureForMatrices?h.push("#define BONETEXTURE"):h.push("#define BonesPerMesh "+(T?T.bones.length+1:0)),r.numBoneInfluencers>0&&_.addCPUSkinningFallback(0,r)}else h.push("#define NUM_BONE_INFLUENCERS 0");const f=r.morphTargetManager;let g=0;f&&f.numInfluencers>0&&(h.push("#define MORPHTARGETS"),g=f.numInfluencers,h.push("#define NUM_MORPH_INFLUENCERS "+g),f.isUsingTextureForTargets&&h.push("#define MORPHTARGETS_TEXTURE"),we.PrepareAttributesForMorphTargetsInfluencers(c,r,g)),t&&(h.push("#define INSTANCES"),we.PushAttributesForInstances(c),e.getRenderingMesh().hasThinInstances&&h.push("#define THIN_INSTANCES")),Nl(l,this._scene,h),this._addCustomEffectDefines(h);const p=e._getDrawWrapper(void 0,!0),x=p.defines,m=h.join("\n");if(x!==m){const T=["world","mBones","viewProjection","glowColor","morphTargetInfluences","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity","morphTargetTextureInfo","morphTargetTextureIndices"];S0(T),p.setEffect(this._engine.createEffect("glowMapGeneration",c,T,["diffuseSampler","emissiveSampler","opacitySampler","boneSampler","morphTargets"],m,_,void 0,void 0,{maxSimultaneousMorphTargets:g}),m)}return p.effect.isReady()}render(){for(let r=0;rT.setMatrix("world",b))}else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(r)}_useMeshMaterial(e){return!1}_rebuild(){const e=this._vertexBuffers[A.PositionKind];e&&e._rebuild(),this._generateIndexBuffer()}_disposeTextureAndPostProcesses(){this._mainTexture.dispose();for(let e=0;e-1&&this._scene.effectLayers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()}getClassName(){return"EffectLayer"}static Parse(e,t,i){return re.Instantiate(e.customType).Parse(e,t,i)}}Di._SceneComponentInitialization=a=>{throw Ae("EffectLayerSceneComponent")};F([B()],Di.prototype,"name",void 0);F([f0()],Di.prototype,"neutralColor",void 0);F([B()],Di.prototype,"isEnabled",void 0);F([bd()],Di.prototype,"camera",null);F([B()],Di.prototype,"renderingGroupId",null);F([B()],Di.prototype,"disableBoundingBoxesFromEffectLayer",void 0);const i2="glowMapMergePixelShader",s2="varying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\nuniform float offset;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\n#if LDR\nbaseColor=clamp(baseColor,0.,1.0);\n#endif\ngl_FragColor=baseColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";te.ShadersStore[i2]=s2;const n2="glowMapMergeVertexShader",r2="attribute vec2 position;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";te.ShadersStore[n2]=r2;const a2="glowBlurPostProcessPixelShader",o2="varying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}";te.ShadersStore[a2]=o2;ps.AddParser(ve.NAME_EFFECTLAYER,(a,e,t,i)=>{if(a.effectLayers){t.effectLayers||(t.effectLayers=new Array);for(let s=0;s{this.scene.addEffectLayer(t)})}removeFromContainer(e,t){e.effectLayers&&e.effectLayers.forEach(i=>{this.scene.removeEffectLayer(i),t&&i.dispose()})}dispose(){const e=this.scene.effectLayers;for(;e.length;)e[0].dispose()}_isReadyForMesh(e,t){const i=this._engine.currentRenderPassId,s=this.scene.effectLayers;for(const n of s){if(!n.hasMesh(e))continue;const r=n._mainTexture;this._engine.currentRenderPassId=r.renderPassId;for(const o of e.subMeshes)if(!n.isReady(o,t))return this._engine.currentRenderPassId=i,!1}return this._engine.currentRenderPassId=i,!0}_renderMainTexture(e){this._renderEffects=!1,this._needStencil=!1;let t=!1;const i=this.scene.effectLayers;if(i&&i.length>0){this._previousStencilState=this._engine.getStencilBuffer();for(const s of i)if(s.shouldRender()&&(!s.camera||s.camera.cameraRigMode===de.RIG_MODE_NONE&&e===s.camera||s.camera.cameraRigMode!==de.RIG_MODE_NONE&&s.camera._rigCameras.indexOf(e)>-1)){this._renderEffects=!0,this._needStencil=this._needStencil||s.needStencil();const n=s._mainTexture;n._shouldRender()&&(this.scene.incrementRenderId(),n.render(!1,!1),t=!0)}this.scene.incrementRenderId()}return t}_setStencil(){this._needStencil&&this._engine.setStencilBuffer(!0)}_setStencilBack(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)}_draw(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);const t=this.scene.effectLayers;for(let i=0;i{let e=a._getComponent(ve.NAME_EFFECTLAYER);e||(e=new l2(a),a._addComponent(e))};ps.prototype.getHighlightLayerByName=function(a){var e;for(let t=0;t<((e=this.effectLayers)===null||e===void 0?void 0:e.length);t++)if(this.effectLayers[t].name===a&&this.effectLayers[t].getEffectName()===jt.EffectName)return this.effectLayers[t];return null};class qo extends st{constructor(e,t,i,s,n,r=se.BILINEAR_SAMPLINGMODE,o,l){super(e,"glowBlurPostProcess",["screenSize","direction","blurWidth"],null,s,n,r,o,l),this.direction=t,this.kernel=i,this.onApplyObservable.add(h=>{h.setFloat2("screenSize",this.width,this.height),h.setVector2("direction",this.direction),h.setFloat("blurWidth",this.kernel)})}}class jt extends Di{set blurHorizontalSize(e){this._horizontalBlurPostprocess.kernel=e,this._options.blurHorizontalSize=e}set blurVerticalSize(e){this._verticalBlurPostprocess.kernel=e,this._options.blurVerticalSize=e}get blurHorizontalSize(){return this._horizontalBlurPostprocess.kernel}get blurVerticalSize(){return this._verticalBlurPostprocess.kernel}constructor(e,t,i){super(e,t),this.name=e,this.innerGlow=!0,this.outerGlow=!0,this.onBeforeBlurObservable=new ee,this.onAfterBlurObservable=new ee,this._instanceGlowingMeshStencilReference=jt.GlowingMeshStencilReference++,this._meshes={},this._excludedMeshes={},this.neutralColor=jt.NeutralColor,this._engine.isStencilEnable||H.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"),this._options={mainTextureRatio:.5,blurTextureSizeRatio:.5,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:2,camera:null,renderingGroupId:-1,mainTextureType:0,...i},this._init({alphaBlendingMode:this._options.alphaBlendingMode,camera:this._options.camera,mainTextureFixedSize:this._options.mainTextureFixedSize,mainTextureRatio:this._options.mainTextureRatio,renderingGroupId:this._options.renderingGroupId,mainTextureType:this._options.mainTextureType}),this._shouldRender=!1}getEffectName(){return jt.EffectName}_numInternalDraws(){return 2}_createMergeEffect(){return this._engine.createEffect("glowMapMerge",[A.PositionKind],["offset"],["textureSampler"],this._options.isStroke?"#define STROKE \n":void 0)}_createTextureAndPostProcesses(){let e=this._mainTextureDesiredSize.width*this._options.blurTextureSizeRatio,t=this._mainTextureDesiredSize.height*this._options.blurTextureSizeRatio;e=this._engine.needPOTTextures?Y.GetExponentOfTwo(e,this._maxSize):e,t=this._engine.needPOTTextures?Y.GetExponentOfTwo(t,this._maxSize):t;let i=0;this._engine.getCaps().textureHalfFloatRender?i=2:i=0,this._blurTexture=new zi("HighlightLayerBlurRTT",{width:e,height:t},this._scene,!1,!0,i),this._blurTexture.wrapU=se.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=se.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(se.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._options.alphaBlendingMode===2?(this._downSamplePostprocess=new er("HighlightLayerPPP",this._options.blurTextureSizeRatio,null,se.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._downSamplePostprocess.externalTextureSamplerBinding=!0,this._downSamplePostprocess.onApplyObservable.add(s=>{s.setTexture("textureSampler",this._mainTexture)}),this._horizontalBlurPostprocess=new qo("HighlightLayerHBP",new fe(1,0),this._options.blurHorizontalSize,1,null,se.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._horizontalBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",e,t)}),this._verticalBlurPostprocess=new qo("HighlightLayerVBP",new fe(0,1),this._options.blurVerticalSize,1,null,se.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._verticalBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",e,t)}),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess]):(this._horizontalBlurPostprocess=new Bs("HighlightLayerHBP",new fe(1,0),this._options.blurHorizontalSize/2,{width:e,height:t},null,se.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,i),this._horizontalBlurPostprocess.width=e,this._horizontalBlurPostprocess.height=t,this._horizontalBlurPostprocess.externalTextureSamplerBinding=!0,this._horizontalBlurPostprocess.onApplyObservable.add(s=>{s.setTexture("textureSampler",this._mainTexture)}),this._verticalBlurPostprocess=new Bs("HighlightLayerVBP",new fe(0,1),this._options.blurVerticalSize/2,{width:e,height:t},null,se.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,i),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess]),this._mainTexture.onAfterUnbindObservable.add(()=>{this.onBeforeBlurObservable.notifyObservers(this);const s=this._blurTexture.renderTarget;s&&(this._scene.postProcessManager.directRender(this._postProcesses,s,!0),this._engine.unBindFramebuffer(s,!0)),this.onAfterBlurObservable.notifyObservers(this)}),this._postProcesses.map(s=>{s.autoClear=!1})}needStencil(){return!0}isReady(e,t){const i=e.getMaterial(),s=e.getRenderingMesh();if(!i||!s||!this._meshes)return!1;let n=null;const r=this._meshes[s.uniqueId];return r&&r.glowEmissiveOnly&&i&&(n=i.emissiveTexture),super._isReady(e,t,n)}_internalRender(e,t){e.setTexture("textureSampler",this._blurTexture);const i=this._engine;i.cacheStencilState(),i.setStencilOperationPass(7681),i.setStencilOperationFail(7680),i.setStencilOperationDepthFail(7680),i.setStencilMask(0),i.setStencilBuffer(!0),i.setStencilFunctionReference(this._instanceGlowingMeshStencilReference),this.outerGlow&&t===0&&(e.setFloat("offset",0),i.setStencilFunction(517),i.drawElementsType(j.TriangleFillMode,0,6)),this.innerGlow&&t===1&&(e.setFloat("offset",1),i.setStencilFunction(514),i.drawElementsType(j.TriangleFillMode,0,6)),i.restoreStencilState()}shouldRender(){return super.shouldRender()?!!this._meshes:!1}_shouldRenderMesh(e){return!(this._excludedMeshes&&this._excludedMeshes[e.uniqueId]||!super.hasMesh(e))}_canRenderMesh(e,t){return!0}_addCustomEffectDefines(e){e.push("#define HIGHLIGHT")}_setEmissiveTextureAndColor(e,t,i){const s=this._meshes[e.uniqueId];s?this._emissiveTextureAndColor.color.set(s.color.r,s.color.g,s.color.b,1):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a),s&&s.glowEmissiveOnly&&i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.color.set(1,1,1,1)):this._emissiveTextureAndColor.texture=null}addExcludedMesh(e){if(!this._excludedMeshes)return;if(!this._excludedMeshes[e.uniqueId]){const i={mesh:e,beforeBind:null,afterRender:null,stencilState:!1};i.beforeBind=e.onBeforeBindObservable.add(s=>{i.stencilState=s.getEngine().getStencilBuffer(),s.getEngine().setStencilBuffer(!1)}),i.afterRender=e.onAfterRenderObservable.add(s=>{s.getEngine().setStencilBuffer(i.stencilState)}),this._excludedMeshes[e.uniqueId]=i}}removeExcludedMesh(e){if(!this._excludedMeshes)return;const t=this._excludedMeshes[e.uniqueId];t&&(t.beforeBind&&e.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&e.onAfterRenderObservable.remove(t.afterRender)),this._excludedMeshes[e.uniqueId]=null}hasMesh(e){return!this._meshes||!super.hasMesh(e)?!1:this._meshes[e.uniqueId]!==void 0&&this._meshes[e.uniqueId]!==null}addMesh(e,t,i=!1){if(!this._meshes)return;const s=this._meshes[e.uniqueId];s?s.color=t:(this._meshes[e.uniqueId]={mesh:e,color:t,observerHighlight:e.onBeforeBindObservable.add(n=>{this.isEnabled&&(this._excludedMeshes&&this._excludedMeshes[n.uniqueId]?this._defaultStencilReference(n):n.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference))}),observerDefault:e.onAfterRenderObservable.add(n=>{this.isEnabled&&this._defaultStencilReference(n)}),glowEmissiveOnly:i},e.onDisposeObservable.add(()=>{this._disposeMesh(e)})),this._shouldRender=!0}removeMesh(e){if(!this._meshes)return;const t=this._meshes[e.uniqueId];t&&(t.observerHighlight&&e.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&e.onAfterRenderObservable.remove(t.observerDefault),delete this._meshes[e.uniqueId]),this._shouldRender=!1;for(const i in this._meshes)if(this._meshes[i]){this._shouldRender=!0;break}}removeAllMeshes(){if(this._meshes){for(const e in this._meshes)if(Object.prototype.hasOwnProperty.call(this._meshes,e)){const t=this._meshes[e];t&&this.removeMesh(t.mesh)}}}_defaultStencilReference(e){e.getScene().getEngine().setStencilFunctionReference(jt.NormalMeshStencilReference)}_disposeMesh(e){this.removeMesh(e),this.removeExcludedMesh(e)}dispose(){if(this._meshes){for(const e in this._meshes){const t=this._meshes[e];t&&t.mesh&&(t.observerHighlight&&t.mesh.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&t.mesh.onAfterRenderObservable.remove(t.observerDefault))}this._meshes=null}if(this._excludedMeshes){for(const e in this._excludedMeshes){const t=this._excludedMeshes[e];t&&(t.beforeBind&&t.mesh.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&t.mesh.onAfterRenderObservable.remove(t.afterRender))}this._excludedMeshes=null}super.dispose()}getClassName(){return"HighlightLayer"}serialize(){const e=Se.Serialize(this);if(e.customType="BABYLON.HighlightLayer",e.meshes=[],this._meshes)for(const t in this._meshes){const i=this._meshes[t];i&&e.meshes.push({glowEmissiveOnly:i.glowEmissiveOnly,color:i.color.asArray(),meshId:i.mesh.id})}if(e.excludedMeshes=[],this._excludedMeshes)for(const t in this._excludedMeshes){const i=this._excludedMeshes[t];i&&e.excludedMeshes.push(i.mesh.id)}return e}static Parse(e,t,i){const s=Se.Parse(()=>new jt(e.name,t,e.options),e,t,i);let n;for(n=0;nnew ri(e,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.GridMaterial",e}getClassName(){return"GridMaterial"}static Parse(e,t,i){return Se.Parse(()=>new ri(e.name,t),e,t,i)}}F([_s()],ri.prototype,"mainColor",void 0);F([_s()],ri.prototype,"lineColor",void 0);F([B()],ri.prototype,"gridRatio",void 0);F([wi()],ri.prototype,"gridOffset",void 0);F([B()],ri.prototype,"majorUnitFrequency",void 0);F([B()],ri.prototype,"minorUnitVisibility",void 0);F([B()],ri.prototype,"opacity",void 0);F([B()],ri.prototype,"preMultiplyAlpha",void 0);F([B()],ri.prototype,"useMaxLine",void 0);F([Si("opacityTexture")],ri.prototype,"_opacityTexture",void 0);F([je("_markAllSubMeshesAsTexturesDirty")],ri.prototype,"opacityTexture",void 0);Vt("BABYLON.GridMaterial",ri);Ee.prototype.createDynamicTexture=function(a,e,t,i){const s=new Dt(this,ze.Dynamic);return s.baseWidth=a,s.baseHeight=e,t&&(a=this.needPOTTextures?Ee.GetExponentOfTwo(a,this._caps.maxTextureSize):a,e=this.needPOTTextures?Ee.GetExponentOfTwo(e,this._caps.maxTextureSize):e),s.width=a,s.height=e,s.isReady=!1,s.generateMipMaps=t,s.samplingMode=i,this.updateTextureSamplingMode(i,s),this._internalTexturesCache.push(s),s};Ee.prototype.updateDynamicTexture=function(a,e,t,i=!1,s,n=!1,r=!1){if(!a)return;const o=this._gl,l=o.TEXTURE_2D,h=this._bindTextureDirectly(l,a,!0,n);this._unpackFlipY(t===void 0?a.invertY:t),i&&o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);const c=this._getWebGLTextureType(a.type),u=this._getInternalFormat(s||a.format),d=this._getRGBABufferInternalSizedFormat(a.type,u);o.texImage2D(l,0,d,u,c,e),a.generateMipMaps&&o.generateMipmap(l),h||this._bindTextureDirectly(l,null),i&&o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),a.isReady=!0};class Zn extends se{constructor(e,t,i=null,s=!1,n=3,r=5,o){super(null,i,!s,o,n,void 0,void 0,void 0,void 0,r),this.name=e,this.wrapU=se.CLAMP_ADDRESSMODE,this.wrapV=se.CLAMP_ADDRESSMODE,this._generateMipMaps=s;const l=this._getEngine();if(!l)return;t.getContext?(this._canvas=t,this._texture=l.createDynamicTexture(t.width,t.height,s,n)):(this._canvas=l.createCanvas(1,1),t.width||t.width===0?this._texture=l.createDynamicTexture(t.width,t.height,s,n):this._texture=l.createDynamicTexture(t,t,s,n));const h=this.getSize();this._canvas.width!==h.width&&(this._canvas.width=h.width),this._canvas.height!==h.height&&(this._canvas.height=h.height),this._context=this._canvas.getContext("2d")}getClassName(){return"DynamicTexture"}get canRescale(){return!0}_recreate(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)}scale(e){const t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)}scaleTo(e,t){const i=this.getSize();i.width=e,i.height=t,this._recreate(i)}getContext(){return this._context}clear(){const e=this.getSize();this._context.fillRect(0,0,e.width,e.height)}update(e,t=!1,i=!1){this._getEngine().updateDynamicTexture(this._texture,this._canvas,e===void 0?!0:e,t,this._format||void 0,void 0,i)}drawText(e,t,i,s,n,r,o,l=!0){const h=this.getSize();if(r&&(this._context.fillStyle=r,this._context.fillRect(0,0,h.width,h.height)),this._context.font=s,t==null){const c=this._context.measureText(e);t=(h.width-c.width)/2}if(i==null){const c=parseInt(s.replace(/\D/g,""));i=h.height/2+c/3.65}this._context.fillStyle=n||"",this._context.fillText(e,t,i),l&&this.update(o)}clone(){const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new Zn(this.name,t,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i}serialize(){const e=this.getScene();e&&!e.isReady()&&H.Warn("The scene must be ready before serializing the dynamic texture");const t=super.serialize();return Zn._IsCanvasElement(this._canvas)&&(t.base64String=this._canvas.toDataURL()),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t}static _IsCanvasElement(e){return e.toDataURL!==void 0}_rebuild(){this.update()}}At.AddNodeConstructor("Light_Type_3",(a,e)=>()=>new Qn(a,v.Zero(),e));class Qn extends Le{constructor(e,t,i){super(e,i),this.groundColor=new he(0,0,0),this.direction=t||v.Up()}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}getClassName(){return"HemisphericLight"}setDirectionToTarget(e){return this.direction=v.Normalize(e.subtract(v.Zero())),this.direction}getShadowGenerator(){return null}transferToEffect(e,t){const i=v.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this}transferToNodeMaterialEffect(e,t){const i=v.Normalize(this.direction);return e.setFloat3(t,i.x,i.y,i.z),this}computeWorldMatrix(){return this._worldMatrix||(this._worldMatrix=N.Identity()),this._worldMatrix}getTypeID(){return Le.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(e,t){e["HEMILIGHT"+t]=!0}}F([_s()],Qn.prototype,"groundColor",void 0);F([wi()],Qn.prototype,"direction",void 0);function yt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */yt=()=>a;var a={},e=Object.prototype,t=e.hasOwnProperty,i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",r=i.toStringTag||"@@toStringTag";function o(R,w,D){return Object.defineProperty(R,w,{value:D,enumerable:!0,configurable:!0,writable:!0}),R[w]}try{o({},"")}catch{o=(w,D,W)=>w[D]=W}function l(R,w,D,W){var L=w&&w.prototype instanceof u?w:u,z=Object.create(L.prototype),K=new E(W||[]);return z._invoke=((ae,$,U)=>{var V="suspendedStart";return(M,k)=>{if(V==="executing")throw new Error("Generator is already running");if(V==="completed"){if(M==="throw")throw k;return C()}for(U.method=M,U.arg=k;;){var X=U.delegate;if(X){var Q=S(X,U);if(Q){if(Q===c)continue;return Q}}if(U.method==="next")U.sent=U._sent=U.arg;else if(U.method==="throw"){if(V==="suspendedStart")throw V="completed",U.arg;U.dispatchException(U.arg)}else U.method==="return"&&U.abrupt("return",U.arg);V="executing";var ge=h(ae,$,U);if(ge.type==="normal"){if(V=U.done?"completed":"suspendedYield",ge.arg===c)continue;return{value:ge.arg,done:U.done}}ge.type==="throw"&&(V="completed",U.method="throw",U.arg=ge.arg)}}})(R,D,K),z}function h(R,w,D){try{return{type:"normal",arg:R.call(w,D)}}catch(W){return{type:"throw",arg:W}}}a.wrap=l;var c={};function u(){}function d(){}function _(){}var f={};o(f,s,function(){return this});var g=Object.getPrototypeOf,p=g&&g(g(P([])));p&&p!==e&&t.call(p,s)&&(f=p);var x=_.prototype=u.prototype=Object.create(f);function m(R){["next","throw","return"].forEach(function(w){o(R,w,function(D){return this._invoke(w,D)})})}function T(R,w){function D(L,z,K,ae){var $=h(R[L],R,z);if($.type!=="throw"){var U=$.arg,V=U.value;return V&&typeof V=="object"&&t.call(V,"__await")?w.resolve(V.__await).then(M=>{D("next",M,K,ae)},M=>{D("throw",M,K,ae)}):w.resolve(V).then(M=>{U.value=M,K(U)},M=>D("throw",M,K,ae))}ae($.arg)}var W;this._invoke=(L,z)=>{function K(){return new w((ae,$)=>{D(L,z,ae,$)})}return W=W?W.then(K,K):K()}}function S(R,w){var D=R.iterator[w.method];if(D===void 0){if(w.delegate=null,w.method==="throw"){if(R.iterator.return&&(w.method="return",w.arg=void 0,S(R,w),w.method==="throw"))return c;w.method="throw",w.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var W=h(D,R.iterator,w.arg);if(W.type==="throw")return w.method="throw",w.arg=W.arg,w.delegate=null,c;var L=W.arg;return L?L.done?(w[R.resultName]=L.value,w.next=R.nextLoc,w.method!=="return"&&(w.method="next",w.arg=void 0),w.delegate=null,c):L:(w.method="throw",w.arg=new TypeError("iterator result is not an object"),w.delegate=null,c)}function b(R){var w={tryLoc:R[0]};1 in R&&(w.catchLoc=R[1]),2 in R&&(w.finallyLoc=R[2],w.afterLoc=R[3]),this.tryEntries.push(w)}function y(R){var w=R.completion||{};w.type="normal",delete w.arg,R.completion=w}function E(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(b,this),this.reset(!0)}function P(R){if(R){var w=R[s];if(w)return w.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var D=-1,W=function L(){for(;++D{var w=typeof R=="function"&&R.constructor;return!!w&&(w===d||(w.displayName||w.name)==="GeneratorFunction")},a.mark=R=>(Object.setPrototypeOf?Object.setPrototypeOf(R,_):(R.__proto__=_,o(R,r,"GeneratorFunction")),R.prototype=Object.create(x),R),a.awrap=R=>({__await:R}),m(T.prototype),o(T.prototype,n,function(){return this}),a.AsyncIterator=T,a.async=(R,w,D,W,L)=>{L===void 0&&(L=Promise);var z=new T(l(R,w,D,W),L);return a.isGeneratorFunction(w)?z:z.next().then(K=>K.done?K.value:z.next())},m(x),o(x,r,"Generator"),o(x,s,function(){return this}),o(x,"toString",()=>"[object Generator]"),a.keys=R=>{var w=[];for(var D in R)w.push(D);return w.reverse(),function W(){for(;w.length;){var L=w.pop();if(L in R)return W.value=L,W.done=!1,W}return W.done=!0,W}},a.values=P,E.prototype={constructor:E,reset:function(R){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(y),!R)for(var w in this)w.charAt(0)==="t"&&t.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=void 0)},stop:function(){this.done=!0;var R=this.tryEntries[0].completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(R){if(this.done)throw R;var w=this;function D($,U){return z.type="throw",z.arg=R,w.next=$,U&&(w.method="next",w.arg=void 0),!!U}for(var W=this.tryEntries.length-1;W>=0;--W){var L=this.tryEntries[W],z=L.completion;if(L.tryLoc==="root")return D("end");if(L.tryLoc<=this.prev){var K=t.call(L,"catchLoc"),ae=t.call(L,"finallyLoc");if(K&&ae){if(this.prev=0;--D){var W=this.tryEntries[D];if(W.tryLoc<=this.prev&&t.call(W,"finallyLoc")&&this.prev=0;--w){var D=this.tryEntries[w];if(D.finallyLoc===R)return this.complete(D.completion,D.afterLoc),y(D),c}},catch:function(R){for(var w=this.tryEntries.length-1;w>=0;--w){var D=this.tryEntries[w];if(D.tryLoc===R){var W=D.completion;if(W.type==="throw"){var L=W.arg;y(D)}return L}}throw new Error("illegal catch attempt")},delegateYield:function(R,w,D){return this.delegate={iterator:P(R),resultName:w,nextLoc:D},this.method==="next"&&(this.arg=void 0),c}},a}function $a(a){return $a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=>typeof e:e=>e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e,$a(a)}function jo(a,e,t,i,s,n,r){try{var o=a[n](r),l=o.value}catch(h){return void t(h)}o.done?e(l):Promise.resolve(l).then(i,s)}function Zi(a){return function(){var e=this,t=arguments;return new Promise((i,s)=>{var n=a.apply(e,t);function r(l){jo(n,i,s,r,o,"next",l)}function o(l){jo(n,i,s,r,o,"throw",l)}r(void 0)})}}function Et(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function $o(a,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],()=>{})),!0}catch{return!1}}();return function(){var t,i=Wr(a);if(e){var s=Wr(this).constructor;t=Reflect.construct(i,arguments,s)}else t=i.apply(this,arguments);return g2(this,t)}}function Zo(a,e){return function(t){if(Array.isArray(t))return t}(a)||function(t,i){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var n,r,o=[],l=!0,h=!1;try{for(s=s.call(t);!(l=(n=s.next()).done)&&(o.push(n.value),!i||o.length!==i);l=!0);}catch(c){h=!0,r=c}finally{try{l||s.return==null||s.return()}finally{if(h)throw r}}return o}}(a,e)||U0(a,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qo(a){return function(e){if(Array.isArray(e))return Qa(e)}(a)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(a)||U0(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U0(a,e){if(a){if(typeof a=="string")return Qa(a,e);var t=Object.prototype.toString.call(a).slice(8,-1);return t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set"?Array.from(a):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Qa(a,e):void 0}}function Qa(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,i=new Array(e);tsetTimeout(a)).then(()=>Date.now())}var m2=Math.PI/2,v2=new v(2,2,2),Jo=function(){function a(){Et(this,a),this.tool=0,this.start=v.Zero(),this.end=v.Zero(),this.extruding=!1,this.gcodeLineNumber=0,this.gcodeFilePosition=0,this.color=null,this.feedRate=0,this.layerHeight=0,this.isPerimeter=!1}return Ct(a,[{key:"length",value:function(){return v.Distance(this.start,this.end)}},{key:"renderLine",value:function(e){var t=[this.start,this.end],i=ci.CreateLines("lines",t,e);i.enableEdgesRendering(),i.edgesWidth=10,i.edgesColor=new q(1,1,0,1)}},{key:"renderLinev4",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:.4,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.layerHeight===0&&(this.layerHeight=this.start.y);var i={},s=this.length()+t,n=this.start.add(this.end).divide(v2),r=this.end.subtract(this.start),o=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)+Math.pow(r.z,2)),l=Math.atan2(r.z,r.x),h=Math.acos(r.y/o);return i.matrix=N.Compose(new v(s,this.layerHeight,e),ue.FromEulerVector(new v(0,-l,m2-h)),n),i.color=this.color,i.props={gcodeLineNumber:this.gcodeLineNumber,gcodeFilePosition:this.gcodeFilePosition,originalColor:this.color},i}},{key:"renderParticle",value:function(e){e.position.x=this.start.x,e.position.y=this.start.y,e.position.z=this.start.z,e.color=this.color}},{key:"getPoints",value:function(){return{points:[this.start,this.end],colors:[this.color,this.color]}}},{key:"getColor",value:function(){return this.extruding?new q(1,1,1,1):new q(1,0,0,1)}},{key:"getVoxelSegments",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0,n=new Array,r=v.Distance(this.start,this.end);if(!(r<.1)){var o=Math.round(100*(r/(e/2)-1))/100,l=Math.atan2(this.end.z-this.start.z,this.end.x-this.start.x);s&&(this.start.y-=e/2,this.end.y-=e/2);var h=this.start.clone(),c=0;n.push(h.clone());var u=e/2*Math.cos(l),d=e/2*Math.sin(l),_=0;for(o!==0&&(_=(this.end.y-this.start.y)/o);ce)for(var f=h.x-i;f<=h.x+i;f+=e)for(var g=h.z-i;gt&&s){for(var p=[],x=0;x5e4||this.currentFilePositionthis.scrubDistance&&e>=t-1e3&&e<=i+1e3}},{key:"getTransparentValue",value:function(){return this.vertexAlpha?this.transparentValue:0}},{key:"canUpdateColor",value:function(){return this.colorMode==rs.Color&&!this.hasMixing}},{key:"forceDraw",value:function(){this.timeStamp=0}}]),a}(),x2=function(a){ts(t,la);var e=is(t);function t(i,s,n,r,o,l){var h;return Et(this,t),(h=e.call(this,i,s,n,r,o)).meshIndex=l!=null?l:0,h.lostInSpace=N.Identity().setTranslation(new v(1e4,1e4,1e4)),h.additiveColor=new q(0,1,0,.8),h}return Ct(t,[{key:"buildBox",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{console.warn("nothing to dispose")}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{console.warn("nothing to dispose")}var i=ci.CreateBox("box",{width:1,height:1,depth:1,sideOrientation:O.FRONTSIDE},this.scene);return this.material=new ie("mat",this.scene),this.material.specularColor=this.specularColor,i.material=this.material,this.vertexAlpha&&(i.hasVertexAlpha=!0,i.material.forceDepthWrite=!0,i.material.alpha=.99),i}},{key:"render",value:function(i){for(var s=this,n=new Array(i.length),r=0,o=new Array(i.length),l=0;l.5&&f[L+3]<1){f[L+3]+=.02;var z=10*(f[L+3]-.9);f[L]=s.lerp(s.progressColor.r,n[D].color.r,z),f[L+1]=s.lerp(s.progressColor.g,n[D].color.g,z),f[L+2]=s.lerp(s.progressColor.b,n[D].color.b,z),R=!0}f[L+3]>=1&&!g[D]&&(n[D].color.toArray(f,L),f[L+3]=1,g[D]=!0,R=!0)}}else o[D]<=s.currentFilePosition?(n[D].color.toArray(f,L),n[D].matrix.copyToArray(_,16*D),f[L+3]=1,g[D]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(_,16*D):n[D].matrix.copyToArray(_,16*D),f[L+3]=s.getTransparentValue(),g[D]=!1)}R&&m.thinInstanceBufferUpdated("color"),w&&(m.thinInstanceBufferUpdated("matrix"),m.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var S=i[0].gcodeFilePosition,b=i.slice(-1)[0].gcodeFilePosition,y=0,E=!1,P=!1;this.timeStamp=Date.now();var C=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(y,S,b)||s.forceRedraw){E=!0,s.forceRedraw=!1,y=0;for(var R=0;R=S-3e4&&s.currentFilePosition<=b+3e4?(E=!1,P&&m.unfreezeWorldMatrix(),T()):P||(m.freezeWorldMatrix(),P=!0);y=s.currentFilePosition}};this.renderFuncs.push(C),this.scene.registerBeforeRender(C)}}}]),t}(),b2=function(a){ts(t,la);var e=is(t);function t(i,s,n,r,o,l){var h;return Et(this,t),(h=e.call(this,i,s,n,r,o)).meshIndex=l!=null?l:0,h.lostInSpace=N.Identity().setTranslation(new v(1e4,1e4,1e4)),h.additiveColor=new q(0,1,0,.8),h}return Ct(t,[{key:"buildCylinder",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{console.warn("nothing to dispose")}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{console.warn("nothing to dispose")}var i=ci.CreateCylinder("box",{height:1,diameter:1},this.scene);return i.locallyTranslate(new v(0,0,0)),i.rotate(new v(0,0,1),Math.PI/2,Nt.WORLD),i.bakeCurrentTransformIntoVertices(),this.material=new ie("mat",this.scene),this.material.specularColor=this.specularColor,i.material=this.material,this.vertexAlpha&&(i.hasVertexAlpha=!0,i.material.forceDepthWrite=!0,i.material.alpha=.99),i}},{key:"render",value:function(i){for(var s=this,n=new Array(i.length),r=0,o=new Array(i.length),l=0;l.5&&f[L+3]<1){f[L+3]+=.02;var z=10*(f[L+3]-.9);f[L]=s.lerp(s.progressColor.r,n[D].color.r,z),f[L+1]=s.lerp(s.progressColor.g,n[D].color.g,z),f[L+2]=s.lerp(s.progressColor.b,n[D].color.b,z)}f[L+3]>=1&&!g[D]&&(n[D].color.toArray(f,L),f[L+3]=1,g[D]=!0,R=!0)}}else o[D]<=s.currentFilePosition?(n[D].color.toArray(f,L),n[D].matrix.copyToArray(_,W),f[L+3]=1,g[D]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(_,W):n[D].matrix.copyToArray(_,W),f[L+3]=s.getTransparentValue(),g[D]=!1)}R&&m.thinInstanceBufferUpdated("color"),w&&(m.thinInstanceBufferUpdated("matrix"),m.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var S=i[0].gcodeFilePosition,b=i.slice(-1)[0].gcodeFilePosition,y=0,E=!1,P=!1;this.timeStamp=Date.now();var C=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(y,S,b)||s.forceRedraw){E=!0,s.forceRedraw=!1,y=0;for(var R=0;R=S-3e4&&s.currentFilePosition<=b+3e4?(E=!1,P&&m.unfreezeWorldMatrix(),T()):P||(P=!0,m.freezeWorldMatrix());y=s.currentFilePosition}};this.renderFuncs.push(C),this.scene.registerBeforeRender(C)}}}]),t}(),y2=Ct(function a(e,t){Et(this,a),this.filePosition=e,this.add=t,this.complete=!1}),nc=function(a){ts(i,la);var e,t=is(i);function i(s,n,r,o,l,h,c){var u;return Et(this,i),(u=t.call(this,s,n,r,o,l)).voxelWidth=parseFloat(h),u.voxelHeight=parseFloat(c),u.solidMat,u.transparentMat,u.hasSubtractive=!1,u.lostInSpace=N.Identity().setTranslation(new v(1e4,1e4,1e4)),u.clearColor=new q(1,0,0,0),u.additiveColor=new q(0,1,0,.8),u.subtractiveColor=new q(1,0,0,.8),u}return Ct(i,[{key:"buildBox",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{}var s=ci.CreateBox("box",{width:this.voxelWidth,height:this.voxelHeight,depth:this.voxelWidth},this.scene);return s.hasVertexAlpha=!0,s.updateFacetData=!0,this.material=new ie("mat",this.scene),this.material.needDepthPrePass=!0,this.material.forceDepthWrite=!0,this.material.backFaceCulling=!1,s.material=this.material,s}},{key:"render",value:(e=Zi(yt().mark(function s(n){var r,o,l,h,c,u,d,_,f,g,p,x,m,T,S,b,y,E,P,C,R,w=this;return yt().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:for(this.isLoading=!0,r=parseInt(300/this.voxelWidth)+1,o=r,l=parseInt(300/this.voxelHeight)+1,h=new Array(o),c=0;c<=l;c++)h[c]=new Object;u=0,d=new Date,_=0;case 10:if(!(_5e3)){D.next=57;break}return d=new Date,this.loadingProgressCallback(_/n.length,"Generating Voxel Map..."),D.next=57,zr();case 57:m++,D.next=22;break;case 60:_++,D.next=10;break;case 63:this.loadingProgressCallback(_/n.length,"Rendering Voxel..."),C=yt().mark(function W(L){var z,K,ae,$,U,V,M,k,X,Q,ge,ye,Te,Pe,De,nt,Ce,le,Fe,ke,Xe,tt,Gt,Rt,di,ti,Wt,Ft,ms;return yt().wrap(Ot=>{for(;;)switch(Ot.prev=Ot.next){case 0:if(z=[],h[L]!==void 0){Ot.next=3;break}return Ot.abrupt("return","continue");case 3:for(K=999999999999,ae=-999999999999,$=[],U=0,V=Object.entries(h[L]);Uae&&(ae=De.voxelEvents[0].filePosition),(ye=$).push.apply(ye,Qo(De.voxelEvents.map(ai=>ai.filePosition))),De.color.a=1,(nt={matrix:N.Identity(),color:De.color.clone(),voxelEvents:De.voxelEvents,lastDrawnCount:0}).matrix.setTranslation(new v(k*w.voxelWidth,L*w.voxelHeight,Pe*w.voxelWidth)),z.push(nt);for(Ce=0,$=$.sort((ai,Ai)=>ai-Ai),$=Qo(new Set($)),z.length,h[L]=null,(le=w.buildBox()).alphaIndex=L,le.renderingGroupId=1,Fe=new Float32Array(16*z.length),ke=new Float32Array(4*z.length),Xe=0;Xe{for(var ai=!1,Ai=!1,$t=0;$tha.filePositionRt&&vs.filePosition<=w.currentFilePosition&&(fi.lastDrawnCount=0,w.hasSubtractive&&fi.matrix.copyToArray(Fe,16*$t)),ti&&(fi.lastDrawnCount=i.drawDelay),fi.lastDrawnCount=Rt&&vs.filePosition<=w.currentFilePosition&&(fi.lastDrawnCount=0),ti&&(fi.lastDrawnCount=i.drawDelay),fi.lastDrawnCount{if(!(w.isLoading||Date.now()-Ft<200)){if(Ft=Date.now(),w.doScrub(Rt,K,ae)||di||w.forceRedraw){Ce=0,ti=!0,w.forceRedraw=!1;for(var ai=0;ai$t.complete=!1);Gt(),di=!1}else if(Ce<$.length-1&&$[Ce]w.currentFilePosition));Ai++);}else Wt<10&&(Wt++,Gt());Rt=w.currentFilePosition}},w.loadingProgressCallback&&w.loadingProgressCallback(L/u,"Rendering Voxels..."),w.renderFuncs.push(ms),w.scene.registerBeforeRender(ms),!(new Date-d>1e3)){Ot.next=36;break}return d=new Date,Ot.next=36,zr();case 36:case"end":return Ot.stop()}},W,this)}),R=0;case 67:if(!(RU===!1);z<=R;z++){var K=8*z;if(l[z]){if(h[z])continue;s.progressMode||C[K+3]<=.5?(C[K]=s.progressColor.r,C[K+1]=s.progressColor.g,C[K+2]=s.progressColor.b,C[K+3]=.9,C[K+4]=s.progressColor.r,C[K+5]=s.progressColor.g,C[K+6]=s.progressColor.b,C[K+7]=.9):C[K+3]<1?(C[K+3]+=.02,C[K+7]+=.02):C[K+3]>=1&&(C[K]=o[z][0].r,C[K+1]=o[z][0].g,C[K+2]=o[z][0].b,C[K+3]=1,C[K+4]=o[z][1].r,C[K+5]=o[z][1].g,C[K+6]=o[z][1].b,C[K+7]=1,h[z]=!0)}else{if(h[z])continue;C[K+3]===0?(C[K]=1,C[K+1]=0,C[K+2]=0,C[K+3]=.9,C[K+4]=1,C[K+5]=0,C[K+6]=0,C[K+7]=.9):C[K+3]<1?(C[K+3]+=.02,C[K+7]+=.02):(C[K+3]=1e-4,C[K+7]=1e-4,h[z]=!0)}b=z}for(var ae=R;ae=x-3e4&&s.currentFilePosition<=m+3e4&&(S=!1,y());T=s.currentFilePosition}};this.renderFuncs.push(P),this.scene.registerBeforeRender(P)}}]),t}(),en=function(){function a(){Et(this,a),this.feature=null,this.perimeter=!0,this.support=!1,this.missingFeatures=[]}return Ct(a,[{key:"isTypeComment",value:function(e){return!1}},{key:"getFeatureColor",value:function(e){return new Color4(1,1,1,1)}},{key:"isPerimeter",value:function(){return this.perimeter}},{key:"isSupport",value:function(){return this.support}},{key:"processComments",value:function(e,t){}},{key:"reportMissingFeature",value:function(e){this.missingFeatures.includes(e)||(console.error("Missing feature ".concat(e)),this.missingFeatures.push(e))}}]),a}(),T2=function(a){ts(t,en);var e=is(t);function t(){var i;return Et(this,t),(i=e.call(this)).featureList={Perimeter:{color:new q(1,.9,.3,1),perimeter:!1,support:!1},"External perimeter":{color:new q(1,.5,.2,1),perimeter:!0,support:!1},"Internal infill":{color:new q(.59,.19,.16,1),perimeter:!1,support:!1},"Solid infill":{color:new q(.59,.19,.8,1),perimeter:!1,support:!1},"Top solid infill":{color:new q(.95,.25,.25,1),perimeter:!0,support:!1},"Bridge infill":{color:new q(.3,.5,.73,1),perimeter:!1,support:!1},"Gap fill":{color:new q(1,1,1,1),perimeter:!1,support:!1},Skirt:{color:new q(0,.53,.43,1),perimeter:!1,support:!1},"Skirt/Brim":{color:new q(0,.53,.43,1),perimeter:!1,support:!1},"Supported material":{color:new q(0,1,0,1),perimeter:!1,support:!0},"Supported material interface":{color:new q(0,.5,0,1),perimeter:!1,support:!0},Custom:{color:new q(.5,.5,.5,1),perimeter:!1,support:!1},Unknown:{color:new q(.5,.5,.5,1),perimeter:!1,support:!1},"Support material":{color:new q(.5,.5,.5,1),perimeter:!1,support:!0},"Support material interface":{color:new q(.5,.5,.5,1),perimeter:!1,support:!0},"Overhang perimeter":{color:new q(.5,.5,.5,1),perimeter:!0,support:!1},"Wipe tower":{color:new q(.5,.5,.5,1),perimeter:!0,support:!1}},i}return Ct(t,[{key:"isTypeComment",value:function(i){return!!i.trim().startsWith(";TYPE:")&&(this.feature=i.substring(6).trim(),!0)}},{key:"getFeatureColor",value:function(){if(Object.prototype.hasOwnProperty.call(this.featureList,this.feature))try{return this.featureList[this.feature].color}catch{this.reportMissingFeature(this.feature)}return this.featureList.Unknown.color}},{key:"isPerimeter",value:function(){try{return this.featureList[this.feature].perimeter}catch{return this.reportMissingFeature(this.feature),!0}}},{key:"isSupport",value:function(){try{return this.featureList[this.feature].support}catch{return this.reportMissingFeature(this.feature),!1}}},{key:"processComments",value:function(i,s){try{for(var n=i.length-350;n{},this.hasSpindle=!1,this.voxelWidth=1,this.voxelHeight=1,this.forceVoxels=!1,this.renderInstances=new Array,this.meshIndex=0,this.highQualityExtrusion=!1,this.perimeterOnly=!1,this.lastUpdate=Date.now(),this.g1AsExtrusion=!1,this.firstGCodeByte=0,this.lastGCodeByte=0,this.zBelt=!1,this.gantryAngle=45*Math.PI/180,this.hyp=Math.cos(this.gantryAngle),this.adj=Math.tan(this.gantryAngle),this.currentZ=0,this.beltLength=100,this.nozzleStartPosition=new v(0,0,0),this.nozzlePosition=new v(0,0,0),this.nozzleFeedRate=0,this.firmwareRetraction=!1,this.inches=!1,this.fixRadius=!1,this.csysContainers=new Array,this.lastCommand="G0",this.arcPlane="XY",this.workplaceOffsets=[new v(0,0,0),new v(0,0,0)],this.currentWorkplace=0,this.progressMode=!1,this.transparentValue=.25,this.hasMixing=!1,this.renderAnimation=!0}var e,t,i,s,n;return Ct(a,[{key:"doUpdate",value:function(){this.lastUpdate=Date.now()}},{key:"setProgressColor",value:function(r){var o=this;this.progressColor=q.FromHexString(r.padEnd(9,"F")),this.renderInstances.forEach(l=>l.progressColor=o.progressColor)}},{key:"getMaxHeight",value:function(){return this.maxHeight+1}},{key:"getMinHeight",value:function(){return this.minHeight}},{key:"setRenderQualitySettings",value:function(r,o){if(this.forceVoxels)return this.renderVersion=ks.Voxel,this.meshBreakPoint=tl,void(this.lines=new Array(tl));this.lines=new Array(1.5*this.meshBreakPoint),o===void 0&&(o=1);var l=0,h=this.forceWireMode?2:1,c=2;switch(this.refreshTime=5e3,this.everyNthRow=1,this.renderTravels=!0,o){case 1:h=2,this.refreshTime=3e4,l=25e3,c=50,this.renderTravels=!1;break;case 2:h=2,this.refreshTime=3e4,l=5e5,c=10,this.renderTravels=!1;break;case 3:l=1e6,c=3;break;case 4:l=15e6,c=2;break;case 5:l=25e6;break;default:return this.renderVersion=ks.Block,void(this.everyNthRow=1)}for(var u=h;u<4;u++){var d=void 0;switch(u){case 1:d=24;break;case 2:d=2;break;case 3:d=1}for(var _=this.everyNthRow;_<=c;_++)if(this.debug&&console.log("Mode: "+u+" NRow: "+_+" vertexcount: "+r*d/_),r*d/_0&&(f.extruding=!0,this.maxHeight=this.currentPosition.y);break;case"F":if(this.currentFeedRate=Number(x.substring(1)),f.feedRate=this.currentFeedRate,this.currentFeedRate>this.maxFeedRate&&(this.maxFeedRate=this.currentFeedRate),this.currentFeedRate=1?this.maxFeedColor:m<=0?this.minFeedColor:q.Lerp(this.minFeedColor,this.maxFeedColor,m)}}}if(this.zBelt&&(this.beltLength=this.currentPosition.z1&&f.extruding&&(this.currentPosition.y>this.currentZ&&(this.currentRowIdx++,this.currentRowIdx%3==0&&this.currentRowIdx++,this.currentZ=this.currentPosition.y),this.currentRowIdx%this.everyNthRow==0&&this.currentRowIdx>2)))){var T=this.hasSpindle&&c[0]==="G1",S=this.g1AsExtrusion||f.length()>=this.lineLengthTolerance;h&&(this.renderedLines.push(f),f.extruding&&this.lastZExtrusionthis.currentLayerHeight&&!this.isSupport&&g&&(this.previousLayerHeight=this.currentLayerHeight,this.currentLayerHeight=this.currentPosition.y)):this.renderTravels&&!f.extruding&&(f.color=new q(1,0,0,1),this.travels.push(f)),this.zBelt?f.layerHeight=Math.abs(this.currentLayerHeight-this.previousLayerHeight):this.g1AsExtrusion?f.layerHeight=1:f.layerHeight=this.currentLayerHeight-this.previousLayerHeight)}}},{key:"g2g3",value:function(r,o,l,h){var c=this,u=r.split(/(?=[GXYZIJKFRE])/),d=r.indexOf("E")>0||this.g1AsExtrusion,_=u.filter(p=>p==="G2"||p==="G02"),f={position:this.currentPosition.clone(),points:[]};try{f=function(p,x,m,T,S,b,y){for(var E=new v(x.x,x.z,x.y),P=E.clone(),C=0,R=0,w=0,D=p.some(Ft=>Ft.includes("G2")),W=0;W=0)X=Math.sqrt(k/M);else if(k<-.02*Math.pow(w,2)){if(!S)return console.error("G2/G3: Radius too small"),{position:{x:P.x,y:P.z,z:P.y},points:[]};var Q=Math.sqrt(Math.pow(U/2,2)+Math.pow(V/2,2));k=Math.pow(Q,2)-M/4,X=Math.sqrt(k/M)}(D&&w<0||!D&&w>0)&&(X=-X),C=U/2+V*X,R=V/2-U*X}else if(C===0&&R===0)return{position:E.clone(),points:[]};var ge,ye=E[z]===P[z]&&E[K]===P[K],Te=E[z]+C,Pe=E[K]+R,De=Math.sqrt(C*C+R*R),nt=Math.atan2(-R,-C),Ce=Math.atan2(P[K]-Pe,P[z]-Te);ye?ge=2*Math.PI:(ge=D?nt-Ce:Ce-nt)<0&&(ge+=2*Math.PI);var le=De*ge/T;le<1&&(le=1);var Fe=ge/le;Fe*=D?-1:1;for(var ke=new Array,Xe=(P[ae]-E[ae])/le,tt=E[z],Gt=E[K],Rt=E[ae],di=nt,ti=0;ti{var m=new Jo;m.tool=c.currentTool,m.gcodeLineNumber=o,m.gcodeFilePosition=l,m.feedRate=c.currentFeedRate,m.isPerimeter=c.slicer.isPerimeter(),c.g1AsExtrusion?m.layerHeight=1:m.layerHeight=c.currentLayerHeight-c.previousLayerHeight,m.start=g.clone(),m.end=new v(p.x,p.y,p.z),m.extruding=d,m.color=d?c.currentColor.clone():new q(1,0,0,1),c.debug&&(m.color=_?new q(0,1,1,1):new q(1,1,0,1),x===0&&(m.color=new q(0,1,0,1))),g=m.end.clone(),c.debug&&console.log(m),h&&(c.renderedLines.push(m),m.extruding?c.lines[c.linesIndex++]=m:c.travels.push(m))}),this.currentPosition=new v(g.x,g.y,g.z),this.currentPosition.y>this.currentLayerHeight&&!this.isSupport&&(this.previousLayerHeight=this.currentLayerHeight,this.currentLayerHeight=this.currentPosition.y)}},{key:"m567",value:function(r){var o=r.split(/(?=[PE])/),l=[1,1,1];if(this.colorMode!==rs.Feed){for(var h=1;h0&&(this.firstGCodeByte=d),this.lastGCodeByte=d,this.processLine(f,_,d,g)),!(Date.now()-this.timeStamp>10)){p.next=33;break}return this.loadingProgressCallback&&this.loadingProgressCallback(d/o.length,"Loading File..."),p.next=32,zr();case 32:this.timeStamp=p.sent;case 33:this.doUpdate(),p.next=19;break;case 36:if(this.layerDictionary.push(o.length),!this.renderTravels){p.next=40;break}return p.next=40,this.createTravelLines(this.scene);case 40:this.loadingProgressCallback&&this.loadingProgressCallback(1),o={};case 42:case"end":return p.stop()}},r,this)})),function(r,o,l){return n.apply(this,arguments)})},{key:"loadingComplete",value:function(){this.renderInstances.forEach(r=>r.isLoading=!1),this.updateFilePosition(Number.MAX_VALUE-1),this.updateFilePosition(Number.MAX_VALUE)}},{key:"processLine",value:(s=Zi(yt().mark(function r(o,l,h){var c,u,d,_,f,g,p,x,m,T,S,b,y=arguments;return yt().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(c=!(y.length>3&&y[3]!==void 0)||y[3],(u=o.indexOf(";"))>-1&&(o=o.substring(0,u-1).trim()),o=o.toUpperCase(),(_=o.match(/[GM]+[0-9.]+/g))===null&&o.match(/[XYZ]+[+-]?[0-9.]+/g)!==null&&(_=this.lastCommand),!_){E.next=61;break}f=0;case 8:if(!(f<_.length)){E.next=59;break}E.t0=_[f],E.next=E.t0==="G0"||E.t0==="G1"||E.t0==="G00"||E.t0==="G01"?12:E.t0==="G2"||E.t0==="G3"||E.t0==="G02"||E.t0==="G03"?14:E.t0==="G10"?16:E.t0==="G11"?18:E.t0==="G17"?20:E.t0==="G18"?22:E.t0==="G19"?24:E.t0==="G20"?26:E.t0==="G28"?28:E.t0==="G53"?31:E.t0==="G54"||E.t0==="G55"||E.t0==="G56"||E.t0==="G57"||E.t0==="G58"||E.t0==="G59"?32:E.t0==="G59.1"||E.t0==="G59.2"||E.t0==="G59.2"?35:E.t0==="G90"?38:E.t0==="G91"?40:E.t0==="G92"?42:E.t0==="S"?43:E.t0==="M3"||E.t0==="M4"?45:E.t0==="M567"?50:E.t0==="M600"?53:55;break;case 12:return this.g0g1(o,l,h,c,_),E.abrupt("break",55);case 14:return this.g2g3(o,l,h,c),E.abrupt("break",55);case 16:return this.firmwareRetraction=!0,E.abrupt("break",55);case 18:return this.firmwareRetraction=!1,E.abrupt("break",55);case 20:return this.arcPlane="XY",E.abrupt("break",55);case 22:return this.arcPlane="XZ",E.abrupt("break",55);case 24:return this.arcPlane="YZ",E.abrupt("break",55);case 26:return this.inches=!0,E.abrupt("break",55);case 28:return(d=o.split(/(?=[GXYZ])/)).length===1||o==="G28 W"?this.currentPosition=new v(this.workplaceOffsets[this.currentWorkplace].x,this.workplaceOffsets[this.currentWorkplace].z,this.workplaceOffsets[this.currentWorkplace].y):(d.some(P=>P.trim()==="X")&&(this.currentPosition.x=this.workplaceOffsets[this.currentWorkplace].x),d.some(P=>P.trim()==="Y")&&(this.currentPosition.z=this.workplaceOffsets[this.currentWorkplace].y),d.some(P=>P.trim()==="Z")&&(this.currentPosition.y=this.workplaceOffsets[this.currentWorkplace].z)),E.abrupt("break",55);case 31:return E.abrupt("break",55);case 32:return this.currentWorkplace=54-Number(_[f].substring(1)),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),E.abrupt("break",55);case 35:return this.currentWorkplace=10*(58.6-Number(_[f].substring(1))),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),E.abrupt("break",55);case 38:return this.absolute=!0,E.abrupt("break",55);case 40:return this.absolute=!1,E.abrupt("break",55);case 42:return E.abrupt("break",55);case 43:return this.hasSpindle=!0,E.abrupt("break",55);case 45:return g=o.split(/(?=[SM])/),(p=(p=g.filter(P=>P.startsWith("S")))[0]?Number(p[0].substring(1)):0)>0&&(this.hasSpindle=!0),E.abrupt("break",55);case 50:return this.hasMixing=!0,this.m567(o),E.abrupt("break",55);case 53:try{this.currentTool++,this.currentTool>=this.tools.length&&(this.currentTool=0),this.colorMode!==rs.Feed&&(this.currentColor=this.tools[this.currentTool].color.clone())}catch(P){console.log(P)}return E.abrupt("break",55);case 55:this.lastCommand=_;case 56:f++,E.next=8;break;case 59:E.next=63;break;case 61:o.startsWith("T")&&(x=Number.parseInt(o.substring(1),10),isNaN(x)||(this.currentPosition.z+=10,this.currentTool=x,this.currentTool>=this.tools.length?this.currentTool=this.currentTool%this.tools.length:x<0&&(this.currentTool=0),this.colorMode!==rs.Feed&&((b=Number(o.substring(1))%this.extruderCount)<0&&(b=0),this.currentColor=(m=(T=this.tools[b])===null||T===void 0||(S=T.color)===null||S===void 0?void 0:S.clone())!==null&&m!==void 0?m:new he(1,0,0)))),this.debug&&console.log(o);case 63:if(!(this.linesIndex>=this.meshBreakPoint)){E.next=70;break}return E.next=66,this.createMesh(this.scene);case 66:return E.next=68,zr();case 68:this.doUpdate(),this.meshIndex++;case 70:case"end":return E.stop()}},r,this)})),function(r,o,l){return s.apply(this,arguments)})},{key:"createMesh",value:(i=Zi(yt().mark(function r(o){var l,h,c;return yt().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.zBelt&&(l=this.lines[this.linesIndex-1].layerHeight,this.lines.forEach(d=>{d.layerHeight=l})),this.renderVersion===ks.Line||this.renderVersion===ks.Point?h=new el(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===ks.Block?h=this.highQualityExtrusion?new b2(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):new x2(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===ks.Voxel&&(h=new nc(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.voxelWidth,this.voxelHeight)),h.progressColor=this.progressColor,h.vertexAlpha=this.vertexAlpha,h.g1AsExtrusion=this.g1AsExtrusion,h.progressMode=this.progressMode,h.transparentValue=this.transparentValue,h.hasMixing=this.hasMixing,h.colorMode=this.colorMode,h.renderAnimation=this.renderAnimation,this.renderInstances.push(h),!((c=this.lines.slice(0,this.linesIndex-1))!=null&&c.length>0)){u.next=15;break}return u.next=15,h.render(c);case 15:this.linesIndex=0;case 16:case"end":return u.stop()}},r,this)})),function(r){return i.apply(this,arguments)})},{key:"chunk",value:function(r,o){for(var l=[],h=0,c=r.length;hl.updateFilePosition(r));try{rr+5);o++)this.currentLineNumber=this.renderedLines[o].gcodeLineNumber,this.nozzleStartPosition=this.renderedLines[o].start,this.nozzlePosition=this.renderedLines[o].end,this.nozzleFeedRate=this.renderedLines[o].feedRate,this.lastFilePositionIndex=o;this.doUpdate()}},{key:"updateFilePositionIndex",value:function(r){var o=this;r>=this.renderedLines.length||(this.currentLineNumber=this.renderedLines[r].gcodeLineNumber,this.nozzleStartPosition=this.renderedLines[r].start,this.nozzlePosition=this.renderedLines[r].end,this.nozzleFeedRate=this.renderedLines[r].feedRate,this.lastFilePositionIndex=r,this.renderInstances.forEach(l=>l.updateFilePosition(o.renderedLines[r].gcodeFilePosition)),this.doUpdate())}},{key:"doFinalPass",value:function(){var r=this;this.liveTracking=!0,this.gcodeFilePosition=Number.MAX_VALUE,setTimeout(()=>{r.liveTracking=!1},this.refreshTime+200)}},{key:"updateMesh",value:function(){this.renderVersion===1?console.log("Version 1"):this.renderVersion===2&&console.log("Version 2")}},{key:"unregisterEvents",value:function(){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:Ja.Extruder,h=new vr;h.color=q.FromHexString(r.padEnd(9,"F")),h.updateDarkerValue(),h.diameter=o,h.toolType=l,this.tools.push(h)}},{key:"updateTool",value:function(r,o,l){l{if(l.material!==null&&Object.prototype.hasOwnProperty.call(l.material,"specularColor"))try{l.material.specularColor=o}catch(h){console.error(h)}}),this.scene&&this.scene.render(!0,!0)}},{key:"g1AsExtrusion",value:function(r){this.g1AsExtrusion=r}},{key:"cancel",value:(e=Zi(yt().mark(function r(){return yt().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.cancelLoad=!0,o.next=3,this.pauseProcessing();case 3:case"end":return o.stop()}},r,this)})),function(){return e.apply(this,arguments)})},{key:"setZBeltAngle",value:function(r){this.gantryAngle=(90-r)*Math.PI/180,this.hyp=Math.cos(this.gantryAngle),this.adj=Math.tan(this.gantryAngle)}},{key:"setTransparencyValue",value:function(r){this.transparentValue=r,this.renderInstances.forEach(o=>{o.transparentValue=r})}},{key:"setRenderAnimation",value:function(r){var o=this;this.renderAnimation=r,this.renderInstances.forEach(l=>l.renderAnimation=o.renderAnimation)}}]),a}(),il=0,P2=1,w2=function(){function a(e){Et(this,a),this.buildVolume={x:{min:0,max:100},y:{min:0,max:100},z:{min:0,max:100}};var t=localStorage.getItem("buildVolume");t!==null&&(this.buildVolume=JSON.parse(t)),this.renderMode=Number.parseInt(localStorage.getItem("renderBedMode"),10),this.renderMode||(this.renderMode=il),this.bedMesh,this.isDelta=!1,this.scene=e,this.registerClipIgnore=()=>{},this.bedLineColor="#0000FF",this.getBedColor()||this.setBedColor("#0000FF"),this.planeMaterial=this.buildGridMaterial(),this.boxMaterial=new ie("bedBoxMaterial",this.scene),this.boxMaterial.alpha=0,this.debug=!1}return Ct(a,[{key:"setRenderMode",value:function(e){this.renderMode=e,localStorage.setItem("renderBedMode",this.renderMode),this.bedMesh&&(this.scene.removeMesh(this.bedMesh),this.bedMesh.dispose(!1,!0)),this.buildBed(),this.scene.render()}},{key:"buildBed",value:function(){if(!(this.renderMode>1||this.debug)){if(this.bedMesh&&this.bedMesh.isDisposed()&&(this.bedMesh=null),this.bedMesh)return this.bedMesh;switch(this.renderMode){case il:this.buildFlatBed();break;case P2:this.buildBox()}return this.bedMesh}}},{key:"setDelta",value:function(e){this.isDelta=e,this.setRenderMode(this.renderMode)}},{key:"buildFlatBed",value:function(){var e=this.getCenter(),t=this.getSize();if(this.isDelta){var i=Math.abs(this.buildVolume.x.max-this.buildVolume.x.min)/2;this.bedMesh=ci.CreateDisc("BuildPlate",{radius:i},this.scene),this.bedMesh.rotationQuaternion=ue.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.material=this.planeMaterial}else{var s=t.x,n=t.y;this.bedMesh=ci.CreatePlane("BuildPlate",{width:s,height:n},this.scene),this.bedMesh.material=this.planeMaterial,this.bedMesh.rotationQuaternion=ue.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.translate(new v(e.x,0,e.y),1,Nt.WORLD)}this.registerClipIgnore(this.bedMesh)}},{key:"getCenter",value:function(){return{x:(this.buildVolume.x.max+this.buildVolume.x.min)/2,y:(this.buildVolume.y.max+this.buildVolume.y.min)/2,z:(this.buildVolume.z.max+this.buildVolume.z.min)/2}}},{key:"getSize",value:function(){return{x:Math.abs(this.buildVolume.x.max-this.buildVolume.x.min),y:Math.abs(this.buildVolume.y.max-this.buildVolume.y.min),z:Math.abs(this.buildVolume.z.max-this.buildVolume.z.min)}}},{key:"buildBox",value:function(){var e=this,t=this.getSize(),i=this.getCenter();if(this.isDelta)this.bedMesh=ci.CreateCylinder("bed",{diameterTop:t.x,diameterBottom:t.x,height:t.z},this.scene),this.bedMesh.position.x=i.x,this.bedMesh.position.y=i.z,this.bedMesh.position.z=i.x,this.bedMesh.alpha=0,this.bedMesh.diffuseColor=new q(0,0,0,0),this.bedMesh.isPickable=!1,this.bedMesh.enableEdgesRendering(void 0,!0),this.bedMesh.renderingGroupId=2,this.scene.setRenderingAutoClearDepthStencil(2,!1,!1,!1),new jt("hl",this.scene,{isStroke:!0,blurTextureSizeRatio:3}).addMesh(this.bedMesh,this.getBedColor4()),this.bedMesh.onBeforeRenderObservable.add(()=>{e.scene.getEngine().setColorWrite(!1)}),this.bedMesh.onAfterRenderObservable.add(()=>{e.scene.getEngine().setColorWrite(!0)}),this.registerClipIgnore(this.bedMesh);else{this.bedMesh=ci.CreateBox("bed",{width:t.x,depth:t.y,height:t.z},this.scene);var s=this.getCenter();this.bedMesh.position.x=s.x-this.buildVolume.x.min,this.bedMesh.position.y=s.z-this.buildVolume.z.min,this.bedMesh.position.z=s.y-this.buildVolume.y.min,this.bedMesh.diffuseColor=new q(0,0,0,0),this.bedMesh.enableEdgesRendering(),this.bedMesh.edgesWidth=100,this.bedMesh.material=this.boxMaterial,this.bedMesh.isPickable=!1,this.bedMesh.edgesColor=this.getBedColor4(),this.registerClipIgnore(this.bedMesh)}}},{key:"setVisibility",value:function(e){this.bedMesh&&this.bedMesh.setEnabled(e)}},{key:"commitBedSize",value:function(){localStorage.setItem("buildVolume",JSON.stringify(this.buildVolume)),this.setRenderMode(this.renderMode)}},{key:"buildGridMaterial",value:function(){var e=new ri("bedMaterial",this.scene);return e.mainColor=new q(0,0,0,0),e.lineColor=he.FromHexString(this.getBedColor()),e.gridRatio=5,e.opacity=.8,e.majorUnitFrequency=10,e.minorUnitVisibility=.6,e.gridOffset=new v(0,0,0),e}},{key:"getBedColor",value:function(){return localStorage.getItem("bedLineColor")}},{key:"setBedColor",value:function(e){localStorage.setItem("bedLineColor",e),this.renderMode>1||this.planeMaterial&&(this.planeMaterial=this.buildGridMaterial(),this.dispose(),this.buildBed(),this.scene.render())}},{key:"getBedColor4",value:function(){return q.FromHexString(this.getBedColor().padEnd(9,"F"))}},{key:"dispose",value:function(){this.bedMesh&&!this.bedMesh.isDisposed&&this.bedMesh.dispose(!1,!0)}}]),a}(),D2=function(){function a(e){Et(this,a),this.scene=e,this.checkerBoard="iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAIAAAD3joeqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALnSURBVHhe7dZBEYQwFAVBWBtogAv+IhIEsZd4yGG6L/lPwFRl31jqPM/neeZghd98oUoD1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjb7/ueJyscxzHGmIMV9u/75skK7/te1zUHK/gLUacB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA7Rt2x+drw1hSNi5LQAAAABJRU5ErkJggg==",this.xmark="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPQAAADPCAMAAAD1TAyiAAAAkFBMVEX39/eZAAD8//+TAACWAACRAAD4+vr5/PyaAAD39fX18vLy6enr29v18PDm0dG1Y2PewMDYtbWuUFDkzc2jLy+iKSnLlpbRpKS/enrIjo6hJCTbu7u8dHSxWFi4a2vEh4eoOzudEhKdEBDPn5+pQUHq2dmsSUmnODjUqqqhJye0YGCeGRnIk5OrTEy6b2+fHh7/wUBWAAAIiElEQVR4nO2d2ULbOhRF4yNFijNAQiCBMoShhBTo7f//3bUc2kLIIOnsI6ut90v7hLS8ZCVWZJ1Op02bNm3atGnTps0fGGOsizGm6Z4kiiHqDMeT+Wo1vxwPS6IGwI2lqt3qqlf/WPH2DZnpYqnVz3SL5cXUpuWumnucL66Xp1WW14v5UUlWsDlDw0VPaV28i9aqWAyTYRsqJ8fVRdfrXlT/VP9/nvTFOkDDY/UB+Be4uhmSUKMbXRgsis990EqfD0Q6YMvz7cjrZs9Ledm2v7MLVQdG+EFO07udyC7q5UhaNk2KPV3QxSW6A/TQ3Yfs0n0QpTblsTrQgRvsRyhdHWiwln0lSG0Hp3tHWi37dASkpkMX+Y36WIzaDvVBZjeZD2HUXp5r6nMhajPw64C+R7mmC09mMeqK2cNzTX2HoaaJN7MQtRn0PJkr6q+ITy4zCGAWmc2st2dYB2gZ0GIhMJvZR3/PdQcu2a7tKkg0nrqatwM70Otz2yx7gU2Cqe1jcPuaO6/QLFQ0ljrcs2t/wJvBTXiTSGr7GMHMVW0uI0TjqKM8u+ZHnFbpOK5VDHWcZ9f6ijWBxzVaU7MXr2I9V+N7ybjk5ihudNfUJ8wHPZrGMlfUjPFt5/HQheZRc5gLNY5vmv5jNMyjpinjehf6Nf6mpu8c6Io6+r5mea5afo6/qc0Lp2WGa57nKreMmYzXcrRrpucqvXjmzsHVwMPUEa7Znqt2m4SOoeZ7Lopuo9CFvg38GYDGbM88aP4ld9SdEGoIc6HimeOesTYT5JrGgNFVJR6aviJUF/rJ2zXGc1F8Y3w5iX3I2oi3a5RnfR3/OW0fMNC+rlGeC71gfCPjf2D+7IXPbAZjLtSE8UBdgkx7ucYx81bJ6BpHfdrf3xGKXJraljPOuk3sGtm26LO9s1nQr0eHmprx1vvDl713d+V0DzVdYubtOsw1YHrFXf/K9c4RThMgM+dpuk4fdlMXe1wj7+dK9BFzTZI4y2SfssM11DPrm8lb7OG9HiEd2uYa67lQ/D0YZgjt0RbXWM+FmiF+oF5B+6RfNqZWCv4xeP/f5yyPvevVObZXdx+oaQ69pkXB/MnyV7+usdTvXWMnSjdzo3ZLWjD1b9doz2qM2xBgT2So0Z670P2hMq7hnsF7YiVc5+25pvbbH+qbajbL3bML3YBd++++9IqaSmzRBFOHbAP0iAwznhoZKeacqeWY86WWZM6VWpY5T2ppZrf5JjdqeWb4kyY7WvyFsJra9z2WJNGwZ8kD1Bm5TsWck2vcmoEHdSau03muqbNwndJzTZ2B67Se86BO7bmmvgCv3YZmmJ456B3Mv4a5YdcNMTfpWjfG3KDrBpkbc90oc0OuG2ZuwLVuntnrNBAo8/2geWZHndB1xZzHeWAJXWfDnNB1RszJXGfFnMj1xm6V5pPAtdaZMeN3Unxmzs2zC3gP3CfmL8gjqGARpd6zg7jZCFLrL5kyC1Jn69kF+U7Ce+Z8PbuIuM7as4uA68w9u9AEu2uoKJ6yZ+4Yc4Zl1qs0p88yYvpPaNMqd2pTQl/5WEf4GFZuTAn37AJ5LUMqIp5dMnYt5NlF5Upt+kKeXbp5jnCxsb1Olq7N6Ickc5auTf+LLHOGrsU9u2TmOoFnF/WaEXUSzzX1RTbUiTzX1Lm4Tua5ps7DdVLmTKjNwKeEwN9F7X+cPo666fvaDO5TMzfuOqSEAJKacQgVgLkBzzW1VMEPH+ZGPDdK3ZjnBqltc54bo7bD5J9VjVPHH7P+51JXnptPYuoMPLskpc7Cs4u6SUadiWcXwWJsm8xNo75LItfRJUFkksQ1HWXFnMR1dswJXGfILO46S2Zh15ky1+WL/jlmV75IiJoYNZXEo05E9l0hymN86Cb2cVzENU3BR6bNRi9garhrQOmXD+nOCL3cpNGu8Z4Jv0kF/Mkl4Nn9WTP6hqVG/gpgJTyvqbGuu2PYCDfg5+d32yjQrgvU2y2mDzy4v9jY9Ai+rzXqtgbWpXDZ2C5jRmfIP9/lHl3/xow9f/vTRmasa1Ydz9+BlioouvNPncK6ZlcpcKFz6OjbtmHdjDAlquog7urAkvIHssVz3UgJpOaVJK5Dr0DRWz3X1B0cNauC0jr2HtWZnZ5rapxr/vjGVcza47luCOeaU8izDi1ww27/Szc46i63+AjdYjriccw6jJpTh7lOH1ag7fAx6yhq9cCbyWC3tNdx+qZzC6keytxwZUGvi3oep286iK/5mvmrtcV8SnuXTTB0wm+QC42ZvEPKJli+azY04ot3WHkMvuscoEPLY7Af37kTGQC6G1zih+tazXkfWfx7OqasEbNUFffLiZ0xoeNKOfEK+XSZx/1YZkm+2PJVLNcvzG+hzG9k8SW76Dm6Yf6jZcmB5pQpi6fmLyJwCqzzSrNFU6s+k5kzfWtmOTqKK9AFWBiMv6k1uyRIHDViCZheIpkBJUFiRjigUG3V8CxukEHKoES4hqz1d0YxN7UClX4Jdq2vMEVbIw44xpW7CS3adM+eutcpg5lRnl3CCn50p6Af5W1otXdsWaOQ0hfAoyLoJui2Rpdy8neNfaUj6K1w+JHjvq6xm4HNwB9aomwCLXxuMPSrO/bRc4QJHS3vc+Qu/vVi67f/V/eEjtOn8YEzCLREoVo79Dj5QP8QO6LY9vcuK6jlQGKbux08HRpiail47KOhy7tdHVB6RTItG7P/o0OrC6GW32JpdaY+Dzet7mcduXoNNL7fja1u5SstWju90kr/vtG0Vur6siPasDUPxVZsrV6kBtjHGLJHDzdf77RL7/Z6Ni7l26Vy/qQ2prTqai8nJllBEGOJyr5LSWTTnB1r6XH2vVBK1RdbqW7veT6gHGqgiKa61J3H8fzi9fX1YjIedFJd7sZjjF3H/CPAbdq0adOmTZs2bbD5H8lJpKRvNiuNAAAAAElFTkSuQmCC",this.buildObjectMeshes=new Array,this.labels=new Array,this.labelSVGS=new Array,this.baseMaterial=null,this.highlightMaterial=null,this.cancelledMaterial=null,this.cancelledHighlightMaterial=null,this.showCancelObjects=!1,this.objectCallback=null,this.renderFailedCallback=null,this.labelCallback=null,this.registerClipIgnore=null,this.getMaxHeight=null,this.alphaLevel=.5,this.observableControls=null,this.showLabel=localStorage.getItem("showObjectLabels"),this.showLabel===null?this.showLabel=!0:this.showLabel=JSON.parse(this.showLabel),this.rebuildMaterials()}return Ct(a,[{key:"setBuildMaterial",value:function(e,t,i){i||(i=this.alphaLevel);var s=new ie(e,this.scene);return s.diffuseColor=t,s.specularColor=new he(0,0,0),s.alpha=i,s.needAlphaTesting=()=>!0,s.separateCullingPass=!0,s.backFaceCulling=!0,s}},{key:"rebuildMaterials",value:function(){this.baseMaterial=this.setBuildMaterial("BuildObjectBaseMaterial",new q(.1,.5,.1),.25),this.highlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new he(.8,.8,.8)),this.cancelledMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new he(1,0,0),.4),this.cancelledHighlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new he(1,1,0),.6);var e=se.CreateFromBase64String(this.xmark,"checkerboard",this.scene);this.cancelledMaterial.diffuseTexture=e,this.cancelledHighlightMaterial.diffuseTexture=e}},{key:"loadObjectBoundaries",value:function(e){if(this.rebuildMaterials(),this.buildObjectMeshes.length>0){for(var t=0;twindow.URL.revokeObjectURL(o)),this.buildObjectMeshes=new Array,this.labels=new Array}if(e)for(var i=0;i'+r],{type:"image/svg+xml"}),l=window.URL.createObjectURL(o);this.labelSVGS.push(l);var h=ci.CreatePlane("TextPlane",{width:i,height:8},this.scene);return h.material=new ie("TextPlaneMaterial",this.scene),h.material.backFaceCulling=!1,h.material.specularColor=new he(0,0,0),h.material.diffuseTexture=new se(l,this.scene),h.material.diffuseTexture.hasAlpha=!0,h.billboardMode=7,this.registerClipIgnore(h),h}},{key:"buildObservables",value:function(){var e=this;if(!this.observableControls){var t=0,i=!1,s=0;this.observableControls=this.scene.onPointerObservable.add(n=>{var r=n.pickInfo;switch(n.type){case Re.POINTERDOWN:i=!0,s=Date.now();break;case Re.POINTERUP:if(i=!1,Date.now()-s>200)return;e.handleClick(r);break;case Re.POINTERMOVE:if(i||Date.now()-t<100)return;t=Date.now(),e.handlePointerMove(r)}})}}},{key:"clearObservables",value:function(){this.observableControls&&(this.scene.onPointerObservable.remove(this.observableControls),this.observableControls=null)}},{key:"showObjectSelection",value:function(e){this.showCancelObjects=e,this.buildObjectMeshes.forEach(t=>t.setEnabled(e)),e?this.buildObservables():this.clearObservables()}},{key:"setObjectTexture",value:function(e){e.metadata&&(e.metadata.cancelled?(e.material=this.cancelledMaterial,e.enableEdgesRendering(),e.edgesWidth=15,e.edgesColor=new q(1,0,0,1)):(e.material=this.baseMaterial,e.enableEdgesRendering(),e.edgesWidth=15,e.edgesColor=new q(0,1,0,1)))}},{key:"handleClick",value:function(e){this.showCancelObjects&&e.hit&&e.pickedMesh&&e.pickedMesh.name.includes("OBJECTMESH")&&this.objectCallback&&this.objectCallback(e.pickedMesh.metadata)}},{key:"handlePointerMove",value:function(e){var t=this;this.showCancelObjects&&(this.buildObjectMeshes.forEach(i=>t.setObjectTexture(i)),e.hit&&e.pickedMesh&&e.pickedMesh.name.includes("OBJECTMESH")?(e.pickedMesh.material=e.pickedMesh.metadata.cancelled?this.cancelledHighlightMaterial:this.highlightMaterial,this.labelCallback&&this.labelCallback(e.pickedMesh.metadata.name)):this.labelCallback&&this.labelCallback(""))}},{key:"showLabels",value:function(e){localStorage.setItem("showObjectLabels",e),this.showLabel=e,this.labels.forEach(t=>t.setEnabled(e))}}]),a}(),F2=function(){function a(e){Et(this,a),this.visible=localStorage.getItem("axesVisible"),this.visible===null?this.visible=!0:this.visible=JSON.parse(this.visible),this.scene=e,this.registerClipIgnore=()=>{},this.axesMesh=null,this.axesMeshPosition=null,this.size=50,this.debug=!1}return Ct(a,[{key:"show",value:function(e){localStorage.setItem("axesVisible",e),this.axesMesh&&this.axesMesh.setEnabled(e),this.scene.render()}},{key:"makeTextPlane",value:function(e,t,i){var s=new Zn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=O.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new ie("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new he(0,0,0),n.material.diffuseTexture=s,n}},{key:"resize",value:function(e){this.size=e,this.axesMesh.dispose(!1,!0),this.render()}},{key:"render",value:function(e){var t=this;if(!this.debug)if(!this.axesMesh||this.axesMesh.isDisposed()){this.axesMesh=new O("axis",this.scene),this.registerClipIgnore(this.axesMesh);var i=O.CreateLines("axisX",[v.Zero(),new v(this.size,0,0),new v(.95*this.size,.05*this.size,0),new v(this.size,0,0),new v(.95*this.size,-.05*this.size,0)],this.scene);i.color=new he(1,0,0),i.parent=this.axesMesh;var s=this.makeTextPlane("X","red",this.size/10);s.billboardMode=7,s.position=new v(.9*this.size,.05*this.size,0),s.parent=this.axesMesh;var n=O.CreateLines("axisZ",[v.Zero(),new v(0,0,this.size),new v(0,-.05*this.size,.95*this.size),new v(0,0,this.size),new v(0,.05*this.size,.95*this.size)],this.scene);n.color=new he(0,1,0),n.parent=this.axesMesh;var r=this.makeTextPlane("Y","green",this.size/10);r.billboardMode=7,r.position=new v(0,.05*this.size,.9*this.size),r.parent=this.axesMesh;var o=O.CreateLines("axisY",[v.Zero(),new v(0,this.size,0),new v(-.05*this.size,.95*this.size,0),new v(0,this.size,0),new v(.05*this.size,.95*this.size,0)],this.scene);o.color=new he(0,0,1),o.parent=this.axesMesh;var l=this.makeTextPlane("Z","blue",this.size/10);l.billboardMode=7,l.position=new v(0,.9*this.size,-.05*this.size),l.parent=this.axesMesh,this.axesMesh.setEnabled(this.visible),this.axesMesh.getChildren().forEach(h=>t.registerClipIgnore(h)),e&&(this.axesMesh.position=e)}else e&&(this.axesMesh.position=e)}},{key:"dispose",value:function(){this.axesMesh&&this.axesMesh.dispose(!1,!0)}}]),a}(),Ze=null;function on(a,e,t){var i=function(s,n,r,o,l,h){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:75,u=ih("svg").attr("width",400).attr("height",300);u.append("rect").attr("x",0).attr("y",0).attr("width",400).attr("height",300).attr("fill","#333333"),u.append("text").attr("x",200).attr("y",150).attr("font-family","Roboto").attr("font-size",c+"px").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("fill",o).attr("stroke",r).attr("stroke-width",2).attr("text-rendering","optimizeLegibility").text(n);var d=u.attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node(),_='',f=new XMLSerializer().serializeToString(d),g=new Blob([_+f],{type:"image/svg+xml"}),p=window.URL.createObjectURL(g),x=ci.CreatePlane("TextPlane",{width:l,height:h},s);return x.material=new ie("TextPlaneMaterial",s),x.material.backFaceCulling=!1,x.material.specularColor=new he(0,0,0),x.material.diffuseTexture=new se(p,s),x.material.diffuseTexture.hasAlpha=!1,x}(a,e,"white","white",6,6,90);i.name=e,i.lookAt(t),i.position=t.scale(-3),e==="Top"&&i.rotate(Qt.Z,Math.PI/2,Nt.LOCAL),e==="Bottom"&&i.rotate(Qt.Z,-Math.PI/2,Nt.LOCAL),i.metadata={x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)},i.isPickable=!0}function Ts(a,e,t){var i=ci.CreateSphere(e,{diameter:1.1},a),s=v.Zero();s.x=t.x-.25*Math.sign(t.x),s.y=t.y-.1*Math.sign(t.y),s.z=t.z-.25*Math.sign(t.z),i.metadata={x:-1*Math.sign(t.x),y:-1*Math.sign(t.y),z:-1*Math.sign(t.z)},i.position=s,i.isPickable=!0}var e0,wa=null;function Ei(a,e,t){wa||((wa=new ie("edgematerial",a)).diffuseColor=new he(.5,.5,.5));var i=ci.CreateBox(e,{width:.35,height:5.8,depth:.35},a),s=v.Zero();t.y!==0&&(i.rotate(Qt.Z,Math.PI/2,Nt.WORLD),t.x!==0&&i.rotate(Qt.Y,Math.PI/2,Nt.WORLD),i.bakeCurrentTransformIntoVertices()),s.x=t.x-Math.sign(t.x),s.y=t.y-Math.sign(t.y),s.z=t.z-Math.sign(t.z),i.metadata={x:-1*Math.sign(t.x),y:-1*Math.sign(t.y),z:-1*Math.sign(t.z)},i.position=s,i.material=wa}function O2(a,e,t){(Ze=new Me(a)).autoClear=!1;var i=new lt("camera1",5*Math.PI/8,5*Math.PI/8,13,new v(0,0,0),Ze);i.viewport=new mn(.85,.85,.15,.15),i.viewport.toGlobal(200,200),e.afterRender=()=>{Ze.render(),i.alpha=t.alpha,i.beta=t.beta,i.radius=15},new Qn("light1",new v(0,1,0),Ze).intensity=.8,new Qn("light2",new v(-1,-.5,0),Ze).intensity=.8;var s=3.9;Ei(Ze,"FrontLeft",new v(-s,0,-s)),Ei(Ze,"BackLeft",new v(-s,0,s)),Ei(Ze,"BackRight",new v(s,0,s)),Ei(Ze,"FrontRight",new v(s,0,-s)),Ei(Ze,"TopFront",new v(0,s,-s)),Ei(Ze,"TopBack",new v(0,s,s)),Ei(Ze,"TopLeft",new v(-s,s,0)),Ei(Ze,"TopRight",new v(s,s,0)),Ei(Ze,"BottomFront",new v(0,-s,-s)),Ei(Ze,"BottomBack",new v(0,-s,s)),Ei(Ze,"BottomLeft",new v(-s,-s,0)),Ei(Ze,"BottomRight",new v(s,-s,0)),Ts(Ze,"FrontTopLeft",new v(-3,3,-3)),Ts(Ze,"FrontTopRight",new v(3,3,-3)),Ts(Ze,"BackTopLeft",new v(-3,3,3)),Ts(Ze,"BackTopRight",new v(3,3,3)),Ts(Ze,"FrontBottomLeft",new v(-3,-3,-3)),Ts(Ze,"FrontBottomRight",new v(3,-3,-3)),Ts(Ze,"BackBottomLeft",new v(-3,-3,3)),Ts(Ze,"BackBottomRight",new v(3,-3,3)),on(Ze,"Front",new v(0,0,1)),on(Ze,"Right",new v(-1,0,0)),on(Ze,"Back",new v(0,0,-1)),on(Ze,"Left",new v(1,0,0)),on(Ze,"Top",new v(0,-1,0)),on(Ze,"Bottom",new v(0,1,0)),Ze.onPointerDown=(n,r)=>{r.distance>0&&e0&&(e0(r.pickedMesh.metadata),Ze.render(!0))}}var L2=function(){function a(e){Et(this,a),this.visible=!0,this.scene=e,this.workplacePoints=[],this.workplaceMeshes=[],this.registerClipIgnore=()=>{}}return Ct(a,[{key:"setOffsets",value:function(e){this.workplacePoints=e,this.render()}},{key:"makeTextPlane",value:function(e,t,i){var s=new Zn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=O.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new ie("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new he(0,0,0),n.material.diffuseTexture=s,n}},{key:"render",value:function(){if(this.workplaceMeshes.length>0){for(var e=0;e{},this.simulationStopped=()=>{},this.simLine=v.Zero(),this.isMMS=!1}var e,t,i,s;return Ct(a,[{key:"getMaxHeight",value:function(){return this.maxHeight}},{key:"getMinHeight",value:function(){return this.minHeight}},{key:"setCameraType",value:function(n){this.scene.activeCamera=n?this.orbitCamera:this.flyCamera}},{key:"setZClipPlane",value:function(n,r){this.zTopClipValue=-n,this.zBottomClipValue=r,r>n&&(this.zTopClipValue=r+1),this.scene.clipPlane=new ni(0,1,0,this.zTopClipValue),this.scene.clipPlane2=new ni(0,-1,0,this.zBottomClipValue),this.scene.render()}},{key:"isArcRotateCameraStopped",value:function(n){return n.inertialAlphaOffset===0&&n.inertialBetaOffset===0&&n.inertialRadiusOffset===0&&n.inertialPanningX===0&&n.inertialPanningY===0}},{key:"init",value:(s=Zi(yt().mark(function n(r){var o,l,h=this;return yt().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r===void 0&&(r=!1),console.info("GCode Viewer - Sindarius - ".concat("3.7.6"," ")),c.next=4,pe.IsSupportedAsync;case 4:if(!c.sent||!r){c.next=13;break}return console.log("WebGPU Supported"),this.engine=new pe(this.canvas,{doNotHandleContextLost:!0}),c.next=10,this.engine.initAsync();case 10:console.log(this.engine),c.next=15;break;case 13:console.log("WebGPU Not Supported"),this.engine=new Y(this.canvas,!0,{doNotHandleContextLost:!0});case 15:this.engine.enableOfflineSupport=!1,this.scene=new Me(this.engine),this.scene.performancePriority=Wi.BackwardCompatible,this.debug,this.scene.clearColor=he.FromHexString(this.getBackgroundColor()),this.bed=new w2(this.scene),this.bed.registerClipIgnore=u=>{h.registerClipIgnore(u)},o=this.bed.getCenter(),this.orbitCamera=new lt("Camera",Math.PI/2,2.356194,250,new v(o.x,-2,o.y),this.scene),this.orbitCamera.attachControl(!1),this.orbitCamera.invertRotation=!1,this.orbitCamera.attachControl(this.canvas,!1),this.orbitCamera.maxZ=1e5,this.orbitCamera.lowerRadiusLimit=5,this.updateCameraInertiaProperties(),(l=new E0("light2",new v(0,1,-1),this.scene)).diffuse=new he(1,1,1),l.specular=new he(1,1,1),this.engine.runRenderLoop(()=>{if(!document.hidden){if(h.simulation){if(h.pause)return}else if(h.pause||Date.now()-h.gcodeProcessor.lastUpdate>h.renderTimeout&&h.isArcRotateCameraStopped(h.orbitCamera))return;if(h.simulation)try{h.runSimulation(),h.gcodeProcessor.doUpdate()}catch{h.simulation=!1,h.simulationStopped()}h.scene.render(!0),l.position=h.scene.cameras[0].position}}),this.buildObjects=new D2(this.scene),this.buildObjects.getMaxHeight=()=>h.gcodeProcessor.getMaxHeight(),this.buildObjects.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.bed.buildBed(),this.axes=new F2(this.scene),this.axes.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.axes.render(),this.workplace=new L2(this.scene),this.workplace.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.workplace.setOffsets(this.gcodeProcessor.workplaceOffsets),this.workplace.render(),this.resetCamera(),O2(this.engine,this.scene,this.orbitCamera),e0=u=>{h.setCameraPosition(u)},setTimeout(()=>{h.forceRender()},1e3);case 49:case"end":return c.stop()}},n,this)})),function(n){return s.apply(this,arguments)})},{key:"setCameraPosition",value:function(n,r,o){console.log(this.scene.activeCamera.position);var l=Number(n),h=Number(r),c=Number(o);l!==NaN&&h!==NaN&&c!==NaN&&(this.scene.activeCamera.position=new v(Number(n),Number(o),Number(r)),this.forceRender())}},{key:"resize",value:function(){this.engine.resize(),this.scene.render(!0)}},{key:"refreshUI",value:function(){setTimeout(()=>{},0)}},{key:"resetCamera",value:function(){var n=this.bed.getCenter(),r=this.bed.getSize();this.bed.isDelta?(this.scene.activeCamera.radius=n.x,this.scene.activeCamera.target=new v(n.x,-2,n.y),this.scene.activeCamera.position=new v(-r.x,r.z,-r.x)):(this.scene.activeCamera.radius=3*n.x,this.scene.activeCamera.target=new v(n.x,-2,n.y),this.scene.activeCamera.position=new v(-r.x/2,r.z,-r.y/2)),this.scene.render(!0),this.scene.render(!0)}},{key:"lastLoadFailed",value:function(){return!!localStorage&&localStorage.getItem(this.lastLoadKey)==="true"}},{key:"setLoadFlag",value:function(){localStorage&&localStorage.setItem(this.lastLoadKey,"true")}},{key:"clearLoadFlag",value:function(){localStorage&&(localStorage.setItem(this.lastLoadKey,""),localStorage.removeItem(this.lastLoadKey))}},{key:"processFile",value:(i=Zi(yt().mark(function n(r){return yt().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.clearScene(),this.refreshUI(),r?(this.fileData=r,this.fileSize=r.length):(this.fileData=0,this.fileSize=0),this.fileDataArray=[];try{this.fileData===null&&this.fileData===""||(this.fileDataArray=this.fileData.split("\n"))}catch{this.fileDataArray=[]}return this.gcodeProcessor.setProgressColor(this.getProgressColor()),this.gcodeProcessor.scene=this.scene,this.lastLoadFailed()&&(console.error("Last rendering failed dropping to SBC quality"),this.updateRenderQuality(1),this.clearLoadFlag()),this.setLoadFlag(),o.next=11,this.gcodeProcessor.processGcodeFile(r,this.renderQuality);case 11:return this.clearLoadFlag(),o.next=14,this.gcodeProcessor.createMesh(this.scene);case 14:this.gcodeProcessor.loadingComplete(),this.maxHeight=this.gcodeProcessor.getMaxHeight(),this.minHeight=this.gcodeProcessor.getMinHeight(),this.toggleTravels(this.travelVisible),this.setCursorVisiblity(this.toolCursorVisible),this.gcodeProcessor.zBelt&&(this.bed.buildVolume.y.min=this.gcodeProcessor.beltLength,this.bed.buildVolume.y.max=0,this.bed.dispose(),this.bed.buildBed());case 20:case"end":return o.stop()}},n,this)})),function(n){return i.apply(this,arguments)})},{key:"toggleTravels",value:function(n){var r,o=function(h,c){var u=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!u){if(Array.isArray(h)||(u=U0(h))||c&&h&&typeof h.length=="number"){u&&(h=u);var d=0,_=()=>{};return{s:_,n:()=>d>=h.length?{done:!0}:{done:!1,value:h[d++]},e:x=>{throw x},f:_}}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 f,g=!0,p=!1;return{s:()=>{u=u.call(h)},n:()=>{var x=u.next();return g=x.done,x},e:x=>{p=!0,f=x},f:()=>{try{g||u.return==null||u.return()}finally{if(p)throw f}}}}(this.scene.meshes);try{for(o.s();!(r=o.n()).done;){var l=r.value;l.name==="travels"&&(l.isVisible=n)}}catch(h){o.e(h)}finally{o.f()}this.travelVisible=n,this.scene.render(!0)}},{key:"getProgressColor",value:function(){var n=localStorage.getItem("progressColor");return n===null&&(n="#FFFFFF"),n}},{key:"setProgressColor",value:function(n){localStorage.setItem("progressColor",n),this.gcodeProcessor.setProgressColor(n)}},{key:"getBackgroundColor",value:function(){var n=localStorage.getItem("sceneBackgroundColor");return n===null&&(n="#000000"),n}},{key:"setBackgroundColor",value:function(n){this.scene!==null&&this.scene!==void 0&&(n.length>7&&(n=n.substring(0,7)),this.scene.clearColor=he.FromHexString(n),this.scene.render()),localStorage.setItem("sceneBackgroundColor",n)}},{key:"clearScene",value:function(n){this.fileData&&n&&(this.fileData=""),this.gcodeProcessor.unregisterEvents();for(var r=this.scene.meshes.length-1;r>=0;r--){var o=this.scene.meshes[r];o&&this.debug&&console.log("Disposing ".concat(o.name)),this.scene.removeMesh(o),o&&typeof o.dispose=="function"&&o.dispose(!1,!0)}for(var l=this.scene.materials.length-1;l>=0;l--){var h=this.scene.materials[l];h.name==="solidMaterial"&&(h&&this.debug&&console.log("Disposing ".concat(h.name)),this.scene.removeMaterial(h),h&&typeof h.dispose=="function"&&h.dispose(!1,!0))}this.toolCursor&&(this.toolCursor.dispose(!1,!0),this.toolCursor=void 0),this.buildtoolCursor(),this.bed.buildBed(),this.axes.render(),this.workplace.render()}},{key:"reload",value:(t=Zi(yt().mark(function n(){return yt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.clearScene(),r.next=3,this.processFile(this.fileData);case 3:case"end":return r.stop()}},n,this)})),function(){return t.apply(this,arguments)})},{key:"getRenderMode",value:function(){return this.gcodeProcessor.renderMode}},{key:"setCursorVisiblity",value:function(n){this.scene!==void 0&&(this.toolCursor===void 0&&this.buildtoolCursor(),this.toolCursorMesh.isVisible=n,this.toolCursorVisible=n,this.scene.render())}},{key:"updateToolPosition",value:function(n){var r=0,o=0,l=0;if(this.buildtoolCursor(),n instanceof v)r=n.x,o=n.z,l=n.y;else for(var h=0;h{r.scene.clipPlane=null,r.scene.clipPlane2=null}),n.onAfterRenderObservable.add(()=>{r.scene.clipPlane=new ni(0,1,0,r.zTopClipValue),r.scene.clipPlane2=new ni(0,-1,0,r.zBottomClipValue)}))}},{key:"updateCameraInertiaProperties",value:function(){this.cameraInertia?(this.orbitCamera.speed=2,this.orbitCamera.inertia=.9,this.orbitCamera.panningInertia=.9,this.orbitCamera.inputs.attached.keyboard.angularSpeed=.005,this.orbitCamera.inputs.attached.keyboard.zoomingSensibility=2,this.orbitCamera.inputs.attached.keyboard.panningSensibility=2,this.orbitCamera.angularSensibilityX=1e3,this.orbitCamera.angularSensibilityY=1e3,this.orbitCamera.panningSensibility=10,this.orbitCamera.wheelPrecision=1):(this.orbitCamera.speed=500,this.orbitCamera.inertia=0,this.orbitCamera.panningInertia=0,this.orbitCamera.inputs.attached.keyboard.angularSpeed=.05,this.orbitCamera.inputs.attached.keyboard.zoomingSensibility=.5,this.orbitCamera.inputs.attached.keyboard.panningSensibility=.5,this.orbitCamera.angularSensibilityX=200,this.orbitCamera.angularSensibilityY=200,this.orbitCamera.panningSensibility=2,this.orbitCamera.wheelPrecision=.25)}},{key:"setCameraInertia",value:function(n){this.cameraInertia=n,localStorage.setItem("cameraInertia",n),this.updateCameraInertiaProperties()}},{key:"forceRender",value:function(){this.scene&&this.scene.render(!0)}},{key:"getLayers",value:function(){return this.gcodeProcessor.layerDictionary}},{key:"getGCodeLine",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5;try{var r=Math.max(0,this.gcodeProcessor.currentLineNumber-n),o=Math.min(this.gcodeProcessor.currentLineNumber,this.fileDataArray.length-1);return this.fileDataArray.slice(r,o).join("\r\n").trim()}catch{return""}}},{key:"getGCodeLineNumber",value:function(){return this.gcodeProcessor.currentLineNumber}},{key:"goToGCodeLine",value:function(n){}},{key:"simulateToolPosition",value:function(){this.updateToolPosition(this.gcodeProcessor.nozzlePosition)}},{key:"setZBelt",value:function(n,r){this.gcodeProcessor.zBelt=n,n&&(this.gcodeProcessor.setZBeltAngle(r),this.toolCursorMesh.rotate(Qt.X,Math.PI/2-r*Math.PI/180,Nt.LOCAL))}},{key:"setWorkplaceVisiblity",value:function(n){this.workplace.visible=n,this.workplace.setOffsets(this.gcodeProcessor.workplaceOffsets),this.workplace.render(),this.scene.render()}},{key:"startSimulation",value:function(){this.gcodeProcessor.lastFilePositionIndex>=this.gcodeProcessor.renderedLines.length-1&&this.gcodeProcessor.updateFilePositionIndex(1),this.simulation=!0,this.gcodeProcessor.doUpdate()}},{key:"stopSimulation",value:function(){this.simulation=!1,this.simulationStopped()}},{key:"clamp",value:function(n,r,o){return Math.min(Math.max(n,r),o)}},{key:"runSimulation",value:function(){if(this.gcodeProcessor.renderedLines.length!==0){if(this.gcodeProcessor.lastFilePositionIndex>=this.gcodeProcessor.renderedLines.length-1&&(this.simulation=!1,this.simulationStopped()),this.simulationCurrentLine!=this.gcodeProcessor.renderedLines[this.gcodeProcessor.lastFilePositionIndex]){this.simulationCurrentLine=this.gcodeProcessor.renderedLines[this.gcodeProcessor.lastFilePositionIndex],this.updateToolPosition(this.simulationCurrentLine.start),this.simulationLastUpdate=0;var n=this.isMMS?this.simulationCurrentLine.feedRate:this.simulationCurrentLine.feedRate/60;this.simulationTimeToMove=this.simulationCurrentLine.length()/n*1e3,this.simulationUpdatePosition(this.simulationCurrentLine.gcodeFilePosition)}this.simLine=this.simulationCurrentLine.start.clone(),this.simulationLastUpdate+=this.engine.getDeltaTime()*this.simulationMultiplier*this.scene.getAnimationRatio();var r=this.clamp(this.simulationLastUpdate/this.simulationTimeToMove,0,1);if(v.LerpToRef(this.simulationCurrentLine.start,this.simulationCurrentLine.end,r,this.simLine),this.updateToolPosition(this.simLine),this.simulationLastUpdate>=this.simulationTimeToMove||this.simulationTimeToMove==1/0||this.simulationTimeToMove==0){var o=this.simulationMultiplier>10?this.simulationMultiplier:1,l=this.scene.getAnimationRatio();l>3&&(o+=~~l),this.gcodeProcessor.updateFilePositionIndex(this.gcodeProcessor.lastFilePositionIndex+o)}}}},{key:"getCameraPosition",value:function(){return this.scene.cameras[0].position}},{key:"getCameraTarget",value:function(){return this.scene.cameras[0].target}},{key:"setCameraTarget",value:function(n,r,o){var l=Number(n),h=Number(r),c=Number(o);l!==NaN&&h!==NaN&&c!==NaN&&(this.scene.activeCamera.target=new v(Number(n),Number(o),Number(r)),this.forceRender())}},{key:"createScreenshot",value:(e=Zi(yt().mark(function n(){var r,o,l,h,c=arguments;return yt().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r=c.length>0&&c[0]!==void 0?c[0]:1920,o=c.length>1&&c[1]!==void 0?c[1]:1080,l=this.scene.clearColor,this.scene.clearColor=new q(0,0,0,0),this.displayViewBox(!1),this.gcodeProcessor.forceRender(),this.gcodeProcessor.doUpdate(),this.scene.render(!0,!0),this.scene.onAfterRenderObservable.addOnce(()=>{}),u.next=13,Xp.CreateScreenshotAsync(this.engine,this.scene.activeCamera,{width:r,height:o});case 13:return h=u.sent,this.scene.clearColor=l,u.abrupt("return",h);case 16:case"end":return u.stop()}},n,this)})),function(){return e.apply(this,arguments)})},{key:"displayViewBox",value:function(n){(function(r){Ze.meshes.forEach(o=>{o.setEnabled(r)})})(n)}}]),a}(),N2=Object.defineProperty,U2=Object.getOwnPropertyDescriptor,tn=(a,e,t,i)=>{for(var s=i>1?void 0:i?U2(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&N2(e,t,s),s};let fs=class extends Ec{constructor(){super(...arguments),this.view=void 0}mounted(){this.view=new Nc({doc:this.document,extensions:[Uc,kc.readOnly.of(!0)],parent:this.$refs.view})}mouseUp(){if(this.view){let a=this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from);this.$emit("update:currentline",a.to),this.view.contentDOM.blur(),this.$emit("got-focus")}}keyPress(){if(this.view){let a=this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from);this.$emit("update:currentline",a.to),this.$emit("got-focus")}}documentUpdated(){this.view&&this.shown&&this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.document}})}currentlineUpdated(a){if(this.view&&this.shown){let e=this.view.state.doc.lineAt(a);this.view.dispatch({selection:{anchor:e.from,head:e.from},scrollIntoView:!0})}}};tn([Vc("currentline")],fs.prototype,"currentLineNumber",2);tn([Hr({type:String,default:""})],fs.prototype,"document",2);tn([Hr({type:Boolean,default:!1})],fs.prototype,"isSimulating",2);tn([Hr({type:Boolean,default:!1})],fs.prototype,"shown",2);tn([ot("document")],fs.prototype,"documentUpdated",1);tn([ot("currentLineNumber")],fs.prototype,"currentlineUpdated",1);fs=tn([i0({})],fs);var k2=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",{ref:"view",staticClass:"codeview",on:{mouseup:a.mouseUp,keydown:a.keyPress}})},V2=[];const sl={};var G2=s0(fs,k2,V2,!1,W2,"7831183a",null,null);function W2(a){for(let e in sl)this[e]=sl[e]}const rc=function(){return G2.exports}();var z2=Object.defineProperty,H2=Object.getOwnPropertyDescriptor,et=(a,e,t,i)=>{for(var s=i>1?void 0:i?H2(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&z2(e,t,s),s};let Z=null,qe=class extends al(ol){constructor(){super(...arguments),this.mdiReloadAlert=dc,this.mdiCameraRetake=fc,this.mdiToggleSwitch=_c,this.mdiToggleSwitchOffOutline=pc,this.mdiClose=gc,this.mdiCog=mc,this.mdiVideo3d=vc,this.mdiPlay=xc,this.mdiPause=bc,this.mdiFastForward=yc,this.mdiBroom=Tc,this.mdiSelectionRemove=Sc,this.formatFilesize=Ac,this.isBusy=!1,this.loading=!1,this.loadingPercent=0,this.tracking=!1,this.loadedFile=null,this.reloadRequired=!1,this.fileSize=0,this.renderQuality=this.renderQualities[2],this.scrubPosition=0,this.scrubPlaying=!1,this.scrubSpeed=1,this.scrubInterval=void 0,this.scrubFileSize=0,this.downloadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,cancelTokenSource:{},lastProgress:{time:0,loaded:0}},this.excludeObject={bool:!1,name:""},this.fileData="",this.colorModes=[{text:"Extruder",value:0},{text:"Feed Rate",value:1},{text:"Feature",value:2}]}get renderQualities(){return[{label:this.$t("GCodeViewer.Low"),value:2},{label:this.$t("GCodeViewer.Medium"),value:3},{label:this.$t("GCodeViewer.High"),value:4},{label:this.$t("GCodeViewer.Ultra"),value:5},{label:this.$t("GCodeViewer.Max"),value:6}]}async mounted(){var e,t,i,s;this.loadedFile=(t=(e=this.$store.state.gcodeviewer)==null?void 0:e.loadedFileBackup)!=null?t:null,Z=(s=(i=this.$store.state.gcodeviewer)==null?void 0:i.viewerBackup)!=null?s:null,await this.init(),this.loadedFile!==null&&(this.scrubFileSize=Z.fileSize),Z&&(this.fileData=Z.fileData)}beforeDestroy(){Z&&(Z.gcodeProcessor.loadingProgressCallback=null,this.$store.dispatch("gcodeviewer/setLoadedFileBackup",this.loadedFile),this.$store.dispatch("gcodeviewer/setViewerBackup",Z)),this.scrubPlaying=!1,this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0)}handleResize(){this.$nextTick(()=>{Z==null||Z.resize()})}get panelTitle(){let e=this.$t("GCodeViewer.Title").toString();return this.loadedFile&&(e+=": ".concat(this.loadedFile)),e}get filePosition(){return this.printerIsPrinting?this.$store.state.printer.virtual_sdcard.file_position:0}get sdCardFilePath(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filename)!=null?t:""}get livePosition(){var e,t;return(t=(e=this.$store.state.printer.motion_report)==null?void 0:e.live_position)!=null?t:[0,0,0,0]}get gcodeOffset(){var e,t,i;return(i=(t=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:t.homing_origin)!=null?i:[0,0,0]}get currentPosition(){return[this.livePosition[0]-this.gcodeOffset[0],this.livePosition[1]-this.gcodeOffset[1],this.livePosition[2]-this.gcodeOffset[2],this.livePosition[3]]}get showTrackingButton(){return this.printerIsPrinting&&this.sdCardFilePath===this.loadedFile}get printing_objects(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.objects)!=null?t:[]}printing_objectsChanged(){this.refreshPrintingObjects()}get excluded_objects(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.excluded_objects)!=null?t:[]}excluded_objectsChanged(){this.refreshPrintingObjects()}get nozzle_diameter(){var e,t,i,s;return(s=(i=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.extruder)==null?void 0:i.nozzle_diameter)!=null?s:.4}async init(){var t,i,s,n,r;let e=(i=(t=this.$store.state.gcodeviewer)==null?void 0:t.canvasBackup)!=null?i:null;e===null?(e=document.createElement("canvas"),e.className="viewer",this.$refs.viewerCanvasContainer.appendChild(e),await this.$store.dispatch("gcodeviewer/setCanvasBackup",e)):(this.$refs.viewerCanvasContainer.appendChild(e),Z!=null&&Z.gcodeProcessor&&Z.gcodeProcessor.updateFilePosition(Z==null?void 0:Z.fileSize)),Z===null&&await this.viewerInit(e),this.registerProgressCallback(),(s=this.$route.query)!=null&&s.filename&&this.loadedFile!==((r=(n=this.$route.query)==null?void 0:n.filename)==null?void 0:r.toString())&&(await this.sleep(1e3),await this.loadFile(this.$route.query.filename.toString()))}async viewerInit(e){Z=new B2(e),await Z.init(),Z.setBackgroundColor(this.backgroundColor),Z.bed.setBedColor(this.gridColor),Z.setCursorVisiblity(this.showCursor),Z.setZClipPlane(1e6,-1e6),Z.axes.show(this.showAxes),Z.bed.setDelta(this.kinematics.includes("delta")),this.bedMaxSize!==null&&(Z.bed.buildVolume.x.max=this.bedMaxSize[0],Z.bed.buildVolume.y.max=this.bedMaxSize[1],Z.bed.buildVolume.z.max=this.bedMaxSize[2]),this.bedMinSize!==null&&(Z.bed.buildVolume.x.min=this.bedMinSize[0],Z.bed.buildVolume.y.min=this.bedMinSize[1],Z.bed.buildVolume.z.min=this.bedMinSize[2]),Z.gcodeProcessor.useHighQualityExtrusion(this.hdRendering),Z.gcodeProcessor.updateForceWireMode(this.forceLineRendering||this.cncMode),Z.gcodeProcessor.setAlpha(this.transparency),Z.gcodeProcessor.setVoxelMode(this.voxelMode),Z.gcodeProcessor.voxelWidth=this.voxelWidth,Z.gcodeProcessor.voxelHeight=this.voxelHeight,Z.gcodeProcessor.useSpecularColor(this.specularLighting),Z.gcodeProcessor.setLiveTracking(!1),Z.gcodeProcessor.g1AsExtrusion=this.cncMode,Z.buildObjects.objectCallback=this.objectCallback,this.loadToolColors(this.extruderColors),Z.lastLoadFailed()&&(this.renderQuality=this.renderQualities[0],Z.updateRenderQuality(1),Z.clearLoadFlag())}registerProgressCallback(){Z&&(Z.gcodeProcessor.loadingProgressCallback=e=>{this.loadingPercent=Math.ceil(e*100),this.loading=this.loadingPercent<=99})}async cancelRendering(){Z&&(Z.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3))}clearLoadedFile(){Z&&(this.scrubPlaying=!1,this.scrubFileSize=0,Z.clearScene(!0),this.loadedFile=null,this.tracking=!1)}chooseFile(){this.isBusy||this.fileInput.click()}finishLoad(){this.loading=!1,Z.setCursorVisiblity(this.showCursor),this.refreshPrintingObjects(),this.scrubFileSize=Z.fileSize,Z.gcodeProcessor.updateFilePosition(Z.fileSize)}refreshPrintingObjects(){let e=[];this.loadedFile===this.sdCardFilePath&&this.printing_objects.length&&this.printing_objects.forEach(t=>{const i=t.polygon.map(n=>n[0]),s=t.polygon.map(n=>n[1]);e.push({cancelled:this.excluded_objects.includes(t.name),name:t.name,x:[Math.min(...i),Math.max(...i)],y:[Math.min(...s),Math.max(...s)]})}),Z.buildObjects.loadObjectBoundaries(e),Z.buildObjects.showObjectSelection(this.showObjectSelection)}async fileSelected(e){var i,s;const t=new FileReader;t.addEventListener("load",async n=>{if(!n||!n.target)return;const r=n.target.result;typeof r=="string"&&(this.fileSize=r.length,await Z.processFile(r),this.fileData=Z.fileData),this.finishLoad()}),this.tracking=!1,(i=e.target.files)!=null&&i.length&&(this.loadedFile=(s=e==null?void 0:e.target)==null?void 0:s.files[0].name,t.readAsText(e.target.files[0])),e.target.value=""}async loadFile(e){this.downloadSnackbar.status=!0,this.downloadSnackbar.speed=0,this.downloadSnackbar.lastProgress.time=0,this.downloadSnackbar.filename=e.startsWith("gcodes/")?e.slice(7):e;const t=X0.CancelToken;this.downloadSnackbar.cancelTokenSource=t.source();const i=await X0.get(this.apiUrl+"/server/files/"+encodeURI(e),{cancelToken:this.downloadSnackbar.cancelTokenSource.token,responseType:"blob",onDownloadProgress:s=>{if(this.downloadSnackbar.percent=s.loaded*100/s.total,this.downloadSnackbar.lastProgress.time){const n=s.timeStamp-this.downloadSnackbar.lastProgress.time,r=s.loaded-this.downloadSnackbar.lastProgress.loaded;(n>1e3||this.downloadSnackbar.speed===0)&&(this.downloadSnackbar.speed=r/(n/1e3),this.downloadSnackbar.lastProgress.time=s.timeStamp,this.downloadSnackbar.lastProgress.loaded=s.loaded)}else this.downloadSnackbar.lastProgress.time=s.timeStamp;this.downloadSnackbar.total=s.total}}).then(s=>s.data.text()).catch(s=>{window.console.error(s.message)});this.downloadSnackbar.status=!1,this.loadedFile=this.downloadSnackbar.filename,Z.updateRenderQuality(this.renderQuality.value),await Z.processFile(i),this.fileData=Z.fileData,this.loadingPercent=100,this.finishLoad(),this.scrubFileSize=Z.fileSize}cancelDownload(){this.downloadSnackbar.cancelTokenSource.cancel("User canceled download gcode file")}async sleep(e){await new Promise(t=>setTimeout(t,e))}async loadCurrentFile(){await this.loadFile("gcodes/"+this.sdCardFilePath),this.loadedFile=this.sdCardFilePath}async reloadViewer(){this.loading&&(Z.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3)),this.reloadRequired=!1,this.loading=!0,this.loadingPercent=0,await Z.reload(),this.fileData=Z.fileData,this.loadingPercent=100,this.finishLoad()}resetCamera(){Z.resetCamera()}setReloadRequiredFlag(){this.loadedFile&&this.loadedFile!=""&&(this.reloadRequired=!0)}async renderQualityChanged(e){Z&&Z.renderQuality!==e&&(Z.updateRenderQuality(e),await this.reloadViewer())}currentPositionChanged(e){if(Z){const t=[{axes:"X",position:e[0]},{axes:"Y",position:e[1]},{axes:"Z",position:e[2]}];Z.updateToolPosition(t)}}filePositionChanged(e){if(!Z)return;const t=350;e>0&&this.printerIsPrinting&&this.tracking&&e>t?(Z.gcodeProcessor.updateFilePosition(e-t),this.scrubPosition=e-t):Z.gcodeProcessor.updateFilePosition(Z.fileSize)}async trackingChanged(e){Z&&(e?(this.scrubPlaying=!1,Z.gcodeProcessor.updateFilePosition(0),Z==null||Z.forceRender()):(Z.gcodeProcessor.setLiveTracking(!1),await this.reloadViewer()))}printerIsPrintingChanged(){this.tracking=!1}get showCursor(){var e;return(e=this.$store.state.gui.gcodeViewer.showCursor)!=null?e:!1}set showCursor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showCursor",value:e})}showCursorChanged(e){Z==null||Z.setCursorVisiblity(e)}get showTravelMoves(){var e;return(e=this.$store.state.gui.gcodeViewer.showTravelMoves)!=null?e:!1}set showTravelMoves(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showTravelMoves",value:e})}get showGCode(){var e;return(e=this.$store.state.gui.gcodeViewer.showGCode)!=null?e:!1}set showGCode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showGCode",value:e}),e&&Z&&(this.fileData=Z.fileData),this.handleResize()}showTravelMovesChanged(e){Z==null||Z.toggleTravels(e)}get showObjectSelection(){var e;return(e=this.$store.state.gui.gcodeViewer.showObjectSelection)!=null?e:!1}set showObjectSelection(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showObjectSelection",value:e})}showObjectSelectionChanged(e){Z==null||Z.buildObjects.showObjectSelection(e)}get hdRendering(){return this.$store.state.gui.gcodeViewer.hdRendering}set hdRendering(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.hdRendering",value:e})}async hdRenderingChanged(e){Z&&(Z.gcodeProcessor.useHighQualityExtrusion(e),await this.reloadViewer())}get forceLineRendering(){return this.$store.state.gui.gcodeViewer.forceLineRendering}set forceLineRendering(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.forceLineRendering",value:e})}async forceLineRenderingChanged(e){Z&&(Z.gcodeProcessor.updateForceWireMode(e||this.cncMode),await this.reloadViewer())}get transparency(){return this.$store.state.gui.gcodeViewer.transparency}set transparency(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.transparency",value:e})}async transparencyChanged(e){Z&&(Z.gcodeProcessor.setAlpha(e),await this.reloadViewer())}get voxelMode(){return this.$store.state.gui.gcodeViewer.voxelMode}set voxelMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelMode",value:e})}async voxelModeChanged(e){Z&&(Z.gcodeProcessor.setVoxelMode(e),Z.gcodeProcessor.voxelWidth=this.voxelWidth,Z.gcodeProcessor.voxelHeight=this.voxelHeight,await this.reloadViewer())}get voxelWidth(){var e;return(e=this.$store.state.gui.gcodeViewer.voxelWidth)!=null?e:1}set voxelWidth(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelWidth",value:e})}get voxelHeight(){var e;return(e=this.$store.state.gui.gcodeViewer.voxelHeight)!=null?e:1}set voxelHeight(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelHeight",value:e})}get specularLighting(){return this.$store.state.gui.gcodeViewer.specularLighting}set specularLighting(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.specularLighting",value:e})}async specularLightingChanged(e){Z&&Z.gcodeProcessor.useSpecularColor(e)}get cncMode(){return this.$store.state.gui.gcodeViewer.cncMode}set cncMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.cncMode",value:e}),Z.gcodeProcessor.g1AsExtrusion=e,Z.gcodeProcessor.updateForceWireMode(this.forceLineRendering||e),this.reloadViewer()}get extruderColors(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.extruderColors)!=null?t:!1}loadToolColors(e){Z&&e.length&&(Z.gcodeProcessor.resetTools(),e.forEach(t=>{Z.gcodeProcessor.addTool(t,this.nozzle_diameter)}),this.setReloadRequiredFlag())}extruderColorsChanged(e){Z&&e&&e.length&&(this.loadToolColors(e),this.setReloadRequiredFlag())}get colorMode(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.colorMode)!=null?t:2}set colorMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.colorMode",value:e}),Z&&Z.gcodeProcessor.colorMode!==e&&(Z.gcodeProcessor.setColorMode(e),this.reloadViewer())}get backgroundColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.backgroundColor)!=null?t:"#121212"}backgroundColorChanged(e){Z&&Z.setBackgroundColor(e)}get gridColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.gridColor)!=null?t:"#B3B3B3"}gridColorChanged(e){Z&&Z.bed.setBedColor(e)}get showAxes(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.showAxes)!=null?t:!0}showAxesChanged(e){Z&&Z.axes.show(e)}get minFeed(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.minFeed)!=null?t:20}minFeedChanged(e){Z&&Z.gcodeProcessor.updateColorRate(e*60,this.maxFeed*60)}get maxFeed(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.maxFeed)!=null?t:100}maxFeedChanged(e){Z&&Z.gcodeProcessor.updateColorRate(this.minFeed*60,e*60)}get minFeedColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.minFeedColor)!=null?t:"#0000FF"}minFeedColorUpdated(e){Z&&(Z.gcodeProcessor.updateMinFeedColor(e),this.setReloadRequiredFlag())}get maxFeedColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.maxFeedColor)!=null?t:"#FF0000"}maxFeedColorUpdated(e){Z&&(Z.gcodeProcessor.updateMaxFeedColor(e),this.setReloadRequiredFlag())}get kinematics(){var e,t,i,s,n,r,o,l;return(l=(o=(i=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.printer)==null?void 0:i.kinematics)!=null?o:(r=(n=(s=this.$store.state.gui)==null?void 0:s.gcodeViewer)==null?void 0:n.klipperCache)==null?void 0:r.kinematics)!=null?l:""}get bedMaxSize(){var e,t,i,s,n,r;return(r=(n=(e=this.$store.state.printer.toolhead)==null?void 0:e.axis_maximum)!=null?n:(s=(i=(t=this.$store.state.gui)==null?void 0:t.gcodeViewer)==null?void 0:i.klipperCache)==null?void 0:s.axis_maximum)!=null?r:null}get bedMinSize(){var e,t,i,s,n,r;return(r=(n=(e=this.$store.state.printer.toolhead)==null?void 0:e.axis_minimum)!=null?n:(s=(i=(t=this.$store.state.gui)==null?void 0:t.gcodeViewer)==null?void 0:i.klipperCache)==null?void 0:s.axis_minimum)!=null?r:null}kinematicsChanged(e){Z&&e&&Z.bed.setDelta(e.includes("delta"))}bedMinSizeChanged(e){Z&&e&&(Z.bed.buildVolume.x.min=e[0],Z.bed.buildVolume.y.min=e[1],Z.bed.buildVolume.z.min=e[2])}bedMaxSizeChanged(e){e&&Z&&(Z.bed.buildVolume.x.max=e[0],Z.bed.buildVolume.y.max=e[1],Z.bed.buildVolume.z.max=e[2])}get progressColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.progressColor)!=null?t:"#FFFFFF"}progressColorChanged(e){Z==null||Z.setProgressColor(e)}scrubPlayingChanged(e){e?(this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0),this.scrubPlaying=!0,this.scrubPosition>=this.scrubFileSize&&(this.scrubPosition=0),Z.gcodeProcessor.updateFilePosition(this.scrubPosition-3e4),this.scrubInterval=setInterval(()=>{this.scrubPosition+=100*this.scrubSpeed,Z.gcodeProcessor.updateFilePosition(this.scrubPosition),Z.simulateToolPosition(),(this.tracking||this.scrubPosition>=this.scrubFileSize)&&(this.scrubPlaying=!1)},200)):(this.scrubInterval&&clearInterval(this.scrubInterval),this.scrubPlaying=!1,this.scrubInterval=void 0)}get showScrubber(){return!this.tracking&&this.scrubFileSize>0}updateScrubPosition(e){this.tracking||(Z.gcodeProcessor.updateFilePosition(e),Z.simulateToolPosition())}fastForward(){this.scrubPosition=this.scrubFileSize,Z.gcodeProcessor.updateFilePosition(this.scrubPosition)}objectCallback(e){var t;(e==null?void 0:e.cancelled)===!1&&(this.excludeObject.name=(t=e.name)!=null?t:"UNKNOWN",this.excludeObject.bool=!0)}cancelObject(){this.$socket.emit("printer.gcode.script",{script:"EXCLUDE_OBJECT NAME="+this.excludeObject.name}),this.excludeObject.bool=!1}};et([Hr({type:String,default:"",required:!1})],qe.prototype,"filename",2);et([cl("fileInput")],qe.prototype,"fileInput",2);et([cl("viewerCanvasContainer")],qe.prototype,"viewerCanvasContainer",2);et([ll(200)],qe.prototype,"handleResize",1);et([ot("printing_objects")],qe.prototype,"printing_objectsChanged",1);et([ot("excluded_objects")],qe.prototype,"excluded_objectsChanged",1);et([ot("renderQuality")],qe.prototype,"renderQualityChanged",1);et([ot("currentPosition")],qe.prototype,"currentPositionChanged",1);et([ot("filePosition")],qe.prototype,"filePositionChanged",1);et([ot("tracking")],qe.prototype,"trackingChanged",1);et([ot("printerIsPrinting")],qe.prototype,"printerIsPrintingChanged",1);et([ot("showCursor")],qe.prototype,"showCursorChanged",1);et([ot("showTravelMoves")],qe.prototype,"showTravelMovesChanged",1);et([ot("showObjectSelection")],qe.prototype,"showObjectSelectionChanged",1);et([ot("hdRendering")],qe.prototype,"hdRenderingChanged",1);et([ot("forceLineRendering")],qe.prototype,"forceLineRenderingChanged",1);et([ot("transparency")],qe.prototype,"transparencyChanged",1);et([ot("voxelMode")],qe.prototype,"voxelModeChanged",1);et([ot("specularLighting")],qe.prototype,"specularLightingChanged",1);et([ot("extruderColors")],qe.prototype,"extruderColorsChanged",1);et([ot("backgroundColor")],qe.prototype,"backgroundColorChanged",1);et([ot("gridColor")],qe.prototype,"gridColorChanged",1);et([ot("showAxes")],qe.prototype,"showAxesChanged",1);et([ot("minFeed")],qe.prototype,"minFeedChanged",1);et([ot("maxFeed")],qe.prototype,"maxFeedChanged",1);et([ot("minFeedColor")],qe.prototype,"minFeedColorUpdated",1);et([ot("maxFeedColor")],qe.prototype,"maxFeedColorUpdated",1);et([ot("kinematics")],qe.prototype,"kinematicsChanged",1);et([ot("bedMinSize",{deep:!0})],qe.prototype,"bedMinSizeChanged",1);et([ot("bedMaxSize",{deep:!0})],qe.prototype,"bedMaxSizeChanged",1);et([ot("progressColor")],qe.prototype,"progressColorChanged",1);et([ot("scrubPlaying")],qe.prototype,"scrubPlayingChanged",1);et([ll(200),ot("scrubPosition")],qe.prototype,"updateScrubPosition",1);qe=et([i0({components:{Panel:hl,CodeStream:rc}})],qe);var X2=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",[t(hl,{attrs:{title:a.panelTitle,icon:a.mdiVideo3d,"card-class":"gcode-viewer-panel","margin-bottom":!1},scopedSlots:a._u([{key:"buttons",fn:function(){return[t(zt,{directives:[{name:"show",rawName:"v-show",value:a.reloadRequired,expression:"reloadRequired"}],staticClass:"ml-3",attrs:{icon:a.$vuetify.breakpoint.xs,text:a.$vuetify.breakpoint.smAndUp,tile:"",color:"info"},on:{click:a.reloadViewer}},[t("span",{staticClass:"d-none d-sm-block"},[a._v(a._s(a.$t("GCodeViewer.ReloadRequired")))]),t(Oi,{staticClass:"d-sm-none"},[a._v(a._s(a.mdiReloadAlert))])],1),t(zt,{attrs:{icon:"",tile:""},on:{click:a.resetCamera}},[t(Oi,[a._v(a._s(a.mdiCameraRetake))])],1)]},proxy:!0}])},[t(K0,[t(hr,{class:a.showScrubber?"withScrubber":""},[t(xs,{attrs:{cols:a.showGCode?8:12}},[t("div",{ref:"viewerCanvasContainer"})]),t(xs,{directives:[{name:"show",rawName:"v-show",value:a.showGCode,expression:"showGCode"}],attrs:{cols:"4"}},[t("div",{staticClass:"viewer"},[t(rc,{ref:"gcodestream",attrs:{shown:a.showGCode,currentline:a.scrubPosition,document:a.fileData,"is-simulating":!a.printerIsPrinting},on:{"update:currentline":function(i){a.scrubPosition=i}}})],1)])],1),t(hr,{directives:[{name:"show",rawName:"v-show",value:a.showScrubber,expression:"showScrubber"}],staticClass:"scrubber"},[t(xs,{staticClass:"pt-0"},[t(Cc,{attrs:{hint:a.scrubPosition+"/"+a.scrubFileSize,max:a.scrubFileSize,dense:"",min:"0","persistent-hint":""},model:{value:a.scrubPosition,callback:function(i){a.scrubPosition=i},expression:"scrubPosition"}})],1),t(xs,{staticClass:"col-auto pt-0 text-center"},[t(zt,{staticClass:"px-2 minwidth-0",attrs:{color:"primary"},on:{click:function(i){a.scrubPlaying=!a.scrubPlaying}}},[a.scrubPlaying?t(Oi,[a._v(a._s(a.mdiPause))]):t(Oi,[a._v(a._s(a.mdiPlay))])],1),t(zt,{staticClass:"px-2 minwidth-0 mx-3",attrs:{color:"primary"},on:{click:a.fastForward}},[t(Oi,[a._v(a._s(a.mdiFastForward))])],1),t(Rc,{staticClass:"mt-3 mt-sm-0",attrs:{dense:"",mandatory:"",rounded:""},model:{value:a.scrubSpeed,callback:function(i){a.scrubSpeed=i},expression:"scrubSpeed"}},[t(zt,{attrs:{value:1}},[a._v("1x")]),t(zt,{attrs:{value:2}},[a._v("2x")]),t(zt,{attrs:{value:5}},[a._v("5x")]),t(zt,{attrs:{value:10}},[a._v("10x")]),t(zt,{attrs:{value:20}},[a._v("20x")])],1)],1)],1),t(hr,{staticClass:"mt-0 d-flex align-top"},[t(xs,[t(hr,[t(xs,{staticClass:"d-flex align-content-space-around justify-center flex-wrap flex-md-nowrap col-12 col-md-4",attrs:{"order-md":"2"}},[a.loadedFile===null?[a.sdCardFilePath!==""&&a.sdCardFilePath!==a.loadedFile?t(zt,{staticClass:"mr-3",on:{click:a.loadCurrentFile}},[a._v(" "+a._s(a.$t("GCodeViewer.LoadCurrentFile"))+" ")]):a._e(),t(zt,{on:{click:a.chooseFile}},[a._v(a._s(a.$t("GCodeViewer.LoadLocal")))])]:[a.showTrackingButton?t(zt,{staticClass:"mr-3",on:{click:function(i){a.tracking=!a.tracking}}},[t(Oi,{staticClass:"mr-2",domProps:{innerHTML:a._s(a.tracking?a.mdiToggleSwitch:a.mdiToggleSwitchOffOutline)}}),a._v(" "+a._s(a.$t("GCodeViewer.Tracking"))+" ")],1):a._e(),t(zt,{on:{click:a.clearLoadedFile}},[t(Oi,{attrs:{left:""}},[a._v(a._s(a.mdiBroom))]),a._v(" "+a._s(a.$t("GCodeViewer.ClearLoadedFile"))+" ")],1)]],2),t(xs,{staticClass:"col-12 col-sm-6 col-md-4"},[t(Y0,{attrs:{items:a.colorModes,label:a.$t("GCodeViewer.ColorMode"),"item-text":"text",dense:"","hide-details":"",outlined:""},model:{value:a.colorMode,callback:function(i){a.colorMode=i},expression:"colorMode"}})],1),t(xs,{staticClass:"col-12 col-sm-6 col-md-4 d-flex",attrs:{"order-md":"3"}},[t(Y0,{attrs:{items:a.renderQualities,label:a.$t("GCodeViewer.RenderQuality"),"item-text":"label",dense:"","hide-details":"",outlined:""},model:{value:a.renderQuality,callback:function(i){a.renderQuality=i},expression:"renderQuality"}}),t(Ic,{attrs:{"offset-y":!0,"offset-x":!0,top:"","close-on-content-click":!1,title:a.$t("Files.SetupCurrentList")},scopedSlots:a._u([{key:"activator",fn:function(i){var s=i.on,n=i.attrs;return[t(zt,a._g(a._b({staticClass:"minwidth-0 px-2 ml-3"},"v-btn",n,!1),s),[t(Oi,[a._v(a._s(a.mdiCog))])],1)]}}])},[t(Mc,[t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.ShowToolhead")},model:{value:a.showCursor,callback:function(i){a.showCursor=i},expression:"showCursor"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.ShowTravelMoves")},model:{value:a.showTravelMoves,callback:function(i){a.showTravelMoves=i},expression:"showTravelMoves"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.ShowGCode")},model:{value:a.showGCode,callback:function(i){a.showGCode=i},expression:"showGCode"}})],1),a.loadedFile===a.sdCardFilePath&&a.printing_objects.length?t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.ShowObjectSelection")},model:{value:a.showObjectSelection,callback:function(i){a.showObjectSelection=i},expression:"showObjectSelection"}})],1):a._e(),t(Pc),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.HDRendering")},model:{value:a.hdRendering,callback:function(i){a.hdRendering=i},expression:"hdRendering"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.ForceLineRendering")},model:{value:a.forceLineRendering,callback:function(i){a.forceLineRendering=i},expression:"forceLineRendering"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.Transparency")},model:{value:a.transparency,callback:function(i){a.transparency=i},expression:"transparency"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.VoxelMode")},model:{value:a.voxelMode,callback:function(i){a.voxelMode=i},expression:"voxelMode"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.SpecularLighting")},model:{value:a.specularLighting,callback:function(i){a.specularLighting=i},expression:"specularLighting"}})],1),t(qi,{staticClass:"minHeight36"},[t(ji,{staticClass:"mt-0",attrs:{"hide-details":"",label:a.$t("GCodeViewer.CNCMode")},model:{value:a.cncMode,callback:function(i){a.cncMode=i},expression:"cncMode"}})],1)],1)],1)],1)],1)],1)],1),t("input",{ref:"fileInput",attrs:{accept:".g,.gcode,.gc,.gco,.nc,.ngc,.tap",hidden:"",multiple:"",type:"file"},on:{change:a.fileSelected}})],1),t("resize-observer",{on:{notify:a.handleResize}})],1),t(q0,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:a._u([{key:"action",fn:function(i){var s=i.attrs;return[t(zt,a._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:function(n){return a.cancelRendering()}}},"v-btn",s,!1),[t(Oi,{staticClass:"0"},[a._v(a._s(a.mdiClose))])],1)]}}]),model:{value:a.loading,callback:function(i){a.loading=i},expression:"loading"}},[t("div",[a._v(" "+a._s(a.$t("GCodeViewer.Rendering"))+" - "+a._s(a.loadingPercent)+"% "),t("br"),t("strong",[a._v(a._s(a.loadedFile))])]),t(ga,{staticClass:"mt-2",attrs:{value:a.loadingPercent}})],1),t(q0,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:a._u([{key:"action",fn:function(i){var s=i.attrs;return[t(zt,a._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:a.cancelDownload}},"v-btn",s,!1),[t(Oi,{staticClass:"0"},[a._v(a._s(a.mdiClose))])],1)]}}]),model:{value:a.downloadSnackbar.status,callback:function(i){a.$set(a.downloadSnackbar,"status",i)},expression:"downloadSnackbar.status"}},[a.downloadSnackbar.total>0?[t("div",[a._v(" "+a._s(a.$t("GCodeViewer.Downloading"))+" - "+a._s(Math.round(a.downloadSnackbar.percent))+" % @ "+a._s(a.formatFilesize(Math.round(a.downloadSnackbar.speed)))+"/s "),t("br"),t("strong",[a._v(a._s(a.downloadSnackbar.filename))])]),t(ga,{staticClass:"mt-2",attrs:{value:a.downloadSnackbar.percent}})]:[t("div",[a._v(" "+a._s(a.$t("GCodeViewer.Downloading"))+" "),t("br"),t("strong",[a._v(a._s(a.downloadSnackbar.filename))])]),t(ga,{staticClass:"mt-2",attrs:{indeterminate:""}})]],2),t(wc,{attrs:{"max-width":"400"},model:{value:a.excludeObject.bool,callback:function(i){a.$set(a.excludeObject,"bool",i)},expression:"excludeObject.bool"}},[t(Dc,[t(Fc,{attrs:{flat:"",dense:""}},[t(Oc,[t("span",{staticClass:"subheading"},[t(Oi,{attrs:{left:""}},[a._v(a._s(a.mdiSelectionRemove))]),a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline"))+" ")],1)])],1),t(K0,{staticClass:"mt-3"},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText",{name:a.excludeObject.name}))+" ")]),t(Lc,[t(Bc),t(zt,{attrs:{text:""},on:{click:function(i){a.excludeObject.bool=!1}}},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.Cancel"))+" ")]),t(zt,{attrs:{color:"primary",text:""},on:{click:a.cancelObject}},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"))+" ")])],1)],1)],1)],1)},K2=[];const nl={};var Y2=s0(qe,X2,K2,!1,q2,"0de79293",null,null);function q2(a){for(let e in nl)this[e]=nl[e]}const ac=function(){return Y2.exports}();var j2=Object.defineProperty,$2=Object.getOwnPropertyDescriptor,Z2=(a,e,t,i)=>{for(var s=i>1?void 0:i?$2(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&j2(e,t,s),s};let t0=class extends al(ol){};t0=Z2([i0({components:{Viewer:ac}})],t0);var Q2=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t(ac)},J2=[];const rl={};var ex=s0(t0,Q2,J2,!1,tx,null,null,null);function tx(a){for(let e in rl)this[e]=rl[e]}const lx=function(){return ex.exports}();export{lx as default}; diff --git a/dirs/mainsail/assets/WebrtcCameraStreamer-1fb7b328.js b/dirs/mainsail/assets/WebrtcCameraStreamer-1fb7b328.js deleted file mode 100644 index e2c9ecc..0000000 --- a/dirs/mainsail/assets/WebrtcCameraStreamer-1fb7b328.js +++ /dev/null @@ -1 +0,0 @@ -import{m as u,B as h,G as d,P as p,W as _,R as f,j as v,n as S}from"./index-97b4652c.js";import{l as y,m as g,p as w}from"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var T=Object.defineProperty,b=Object.getOwnPropertyDescriptor,c=(r,e,i,t)=>{for(var s=t>1?void 0:t?b(e,i):e,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(t?n(e,i,s):n(s))||s);return t&&s&&T(e,i,s),s};let a=class extends u(h,d){constructor(){super(...arguments),this.pc=null,this.useStun=!1,this.remote_pc_id=null,this.aspectRatio=null,this.status="connecting",this.restartTimer=null}get url(){var e;return this.convertUrl((e=this.camSettings)==null?void 0:e.stream_url,this.printerUrl)}get webcamStyle(){var i,t,s;const e={transform:this.generateTransform((i=this.camSettings.flip_horizontal)!=null?i:!1,(t=this.camSettings.flip_vertical)!=null?t:!1,(s=this.camSettings.rotation)!=null?s:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(e.aspectRatio=this.aspectRatio),e}startStream(){const e=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=this.useStun?[{urls:["stun:stun.l.google.com:19302"]}]:null;fetch(this.url,{body:JSON.stringify({type:"request",iceServers:i}),headers:{"Content-Type":"application/json"},method:"POST"}).then(t=>t.json()).then(t=>{var o;let s={sdpSemantics:"unified-plan"};return t.iceServers&&(s.iceServers=t.iceServers),this.pc=new RTCPeerConnection(s),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.addEventListener("track",n=>{n.track.kind=="video"&&this.$refs.stream&&(this.$refs.stream.srcObject=n.streams[0])},!1),this.pc.addEventListener("connectionstatechange",()=>{var n,l;this.status=((l=(n=this.pc)==null?void 0:n.connectionState)!=null?l:"").toString(),this.restartTimer&&window.clearTimeout(this.restartTimer),["failed","disconnected"].includes(this.status)&&(this.restartTimer=window.setTimeout(()=>{this.restartStream()},5e3))}),this.pc.addEventListener("icecandidate",n=>{if(n.candidate)return fetch(this.url,{body:JSON.stringify({type:"remote_candidate",id:this.remote_pc_id,candidates:[n.candidate]}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(function(l){window.console.error(l)})}),this.remote_pc_id=t.id,(o=this.pc)==null?void 0:o.setRemoteDescription(t)}).then(()=>{var t;return(t=this.pc)==null?void 0:t.createAnswer()}).then(t=>{var s;return(s=this.pc)==null?void 0:s.setLocalDescription(t)}).then(()=>{var s;const t=(s=this.pc)==null?void 0:s.localDescription;return fetch(this.url,{body:JSON.stringify({type:t==null?void 0:t.type,id:this.remote_pc_id,sdp:t==null?void 0:t.sdp}),headers:{"Content-Type":"application/json"},method:"POST"})}).then(t=>(e&&(this.status="connected"),t.json())).catch(t=>{window.console.error(t),this.restartTimer&&window.clearTimeout(this.restartTimer),this.restartTimer=window.setTimeout(()=>{this.restartStream()},5e3)})}mounted(){this.startStream()}beforeDestroy(){var e;(e=this.pc)==null||e.close(),this.restartTimer&&window.clearTimeout(this.restartTimer)}restartStream(){var e;(e=this.pc)==null||e.close(),setTimeout(async()=>{this.startStream()},500)}async changedUrl(){this.restartStream()}};c([p({required:!0})],a.prototype,"camSettings",2);c([p({default:null})],a.prototype,"printerUrl",2);c([f()],a.prototype,"stream",2);c([_("url")],a.prototype,"changedUrl",1);a=c([v],a);var C=function(){var r=this,e=r.$createElement,i=r._self._c||e;return i("div",[i("video",{directives:[{name:"show",rawName:"v-show",value:r.status==="connected",expression:"status === 'connected'"}],ref:"stream",staticClass:"webcamStream",style:r.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0}}),r.status!=="connected"?i(y,[i(g,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[r.status==="connecting"?i(w,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):r._e(),i("span",{staticClass:"mt-3"},[r._v(r._s(r.status))])],1)],1):r._e()],1)},x=[];const m={};var O=S(a,C,x,!1,j,"a89db62a",null,null);function j(r){for(let e in m)this[e]=m[e]}const U=function(){return O.exports}();export{U as default}; diff --git a/dirs/mainsail/assets/WebrtcCameraStreamer-7e0e004c.css b/dirs/mainsail/assets/WebrtcCameraStreamer-7e0e004c.css deleted file mode 100644 index 562b240..0000000 --- a/dirs/mainsail/assets/WebrtcCameraStreamer-7e0e004c.css +++ /dev/null @@ -1 +0,0 @@ -.webcamStream[data-v-a89db62a]{width:100%}._webcam_webrtc_output[data-v-a89db62a]{aspect-ratio:1.5}video[data-v-a89db62a]{width:100%} diff --git a/dirs/mainsail/assets/WebrtcGo2rtc-4ca7d296.css b/dirs/mainsail/assets/WebrtcGo2rtc-4ca7d296.css deleted file mode 100644 index 4219054..0000000 --- a/dirs/mainsail/assets/WebrtcGo2rtc-4ca7d296.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-9a120824]{width:100%}._webcam_webrtc_output[data-v-9a120824]{aspect-ratio:1.5}video[data-v-9a120824]{width:100%} diff --git a/dirs/mainsail/assets/WebrtcGo2rtc-ddbe76a4.js b/dirs/mainsail/assets/WebrtcGo2rtc-ddbe76a4.js deleted file mode 100644 index 2585fb7..0000000 --- a/dirs/mainsail/assets/WebrtcGo2rtc-ddbe76a4.js +++ /dev/null @@ -1 +0,0 @@ -import{m as p,B as m,G as g,P as d,W as l,R as f,j as _,n as v}from"./index-97b4652c.js";import{l as w,m as b,p as S}from"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var y=Object.defineProperty,x=Object.getOwnPropertyDescriptor,c=(r,t,e,i)=>{for(var s=i>1?void 0:i?x(t,e):t,n=r.length-1,a;n>=0;n--)(a=r[n])&&(s=(i?a(t,e,s):a(s))||s);return i&&s&&y(t,e,s),s};let o=class extends p(m,g){constructor(){super(...arguments),this.pc=null,this.ws=null,this.restartPause=2e3,this.restartTimeout=null,this.status="connecting"}mounted(){this.start()}beforeDestroy(){this.terminate(),this.restartTimeout&&clearTimeout(this.restartTimeout)}get webcamStyle(){var t,e,i;return{transform:this.generateTransform((t=this.camSettings.flip_horizontal)!=null?t:!1,(e=this.camSettings.flip_vertical)!=null?e:!1,(i=this.camSettings.rotation)!=null?i:0)}}get url(){let t="",e=new URL(location.href);try{t=new URL(this.camSettings.stream_url).search.toString(),e=new URL("api/ws"+t,this.camSettings.stream_url)}catch{this.log("invalid url",this.camSettings.stream_url)}const i=["video"];return this.enableAudio&&i.push("audio"),e.searchParams.set("media",i.join("+")),e.protocol=this.$store.state.socket.protocol+":",e.searchParams.has("src")||this.log("no src set in url"),this.convertUrl(e.toString(),this.printerUrl)}get enableAudio(){var t,e;return(e=(t=this.camSettings.extra_data)==null?void 0:t.enableAudio)!=null?e:!1}changedUrl(){this.terminate(),this.start()}changedEnableAudio(){this.terminate(),this.start()}get expanded(){var t;return(t=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?t:!1}expandChanged(t){if(!t){this.terminate();return}this.start()}log(t,e){if(e){window.console.log("[WebRTC go2rtc] ".concat(t),e);return}window.console.log("[WebRTC go2rtc] ".concat(t))}start(){if(!this.video){this.scheduleRestart();return}this.log("connecting to "+this.url),this.status="connecting",this.pc=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});let t=[];["video","audio"].forEach(i=>{var n;const s=(n=this.pc)==null?void 0:n.addTransceiver(i,{direction:"recvonly"}).receiver.track;s&&t.push(s)}),this.video.srcObject=new MediaStream(t),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>this.onWebSocketOpen()),this.ws.addEventListener("message",i=>this.onWebSocketMessage(i)),this.ws.addEventListener("close",i=>this.onWebSocketClose(i))}onWebSocketOpen(){var t,e,i;this.log("open"),this.restartTimeout!==null&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),(t=this.pc)==null||t.addEventListener("icecandidate",s=>{var a;if(!s.candidate)return;const n={type:"webrtc/candidate",value:s.candidate.candidate};(a=this.ws)==null||a.send(JSON.stringify(n))}),(e=this.pc)==null||e.addEventListener("connectionstatechange",()=>{var s,n;this.status=((n=(s=this.pc)==null?void 0:s.connectionState)!=null?n:"").toString(),this.log("connection state changed",this.status),["failed","disconnected"].includes(this.status)&&this.scheduleRestart()}),(i=this.pc)==null||i.createOffer().then(s=>{var n;return(n=this.pc)==null?void 0:n.setLocalDescription(s)}).then(()=>{var n,a,u;const s={type:"webrtc/offer",value:(a=(n=this.pc)==null?void 0:n.localDescription)==null?void 0:a.sdp};(u=this.ws)==null||u.send(JSON.stringify(s))})}onWebSocketMessage(t){var i,s;const e=JSON.parse(t.data);e.type==="webrtc/candidate"?(i=this.pc)==null||i.addIceCandidate({candidate:e.value,sdpMid:"0"}):e.type==="webrtc/answer"&&((s=this.pc)==null||s.setRemoteDescription({type:"answer",sdp:e.value}))}onWebSocketClose(t){this.log("close"),this.status="disconnected",t.wasClean||this.scheduleRestart()}terminate(){this.log("terminating"),this.pc!==null&&(this.pc.close(),this.pc=null),this.ws!==null&&(this.ws.close(),this.ws=null)}scheduleRestart(){this.restartTimeout===null&&(this.terminate(),this.restartTimeout=window.setTimeout(()=>{this.restartTimeout=null,this.start()},this.restartPause))}};c([d({required:!0})],o.prototype,"camSettings",2);c([d({default:null})],o.prototype,"printerUrl",2);c([f()],o.prototype,"video",2);c([l("url")],o.prototype,"changedUrl",1);c([l("enableAudio")],o.prototype,"changedEnableAudio",1);c([l("expanded",{immediate:!0})],o.prototype,"expandChanged",1);o=c([_],o);var T=function(){var r=this,t=r.$createElement,e=r._self._c||t;return e("div",[e("video",{directives:[{name:"show",rawName:"v-show",value:r.status==="connected",expression:"status === 'connected'"}],ref:"video",staticClass:"webcamImage",style:r.webcamStyle,attrs:{autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}}),r.status!=="connected"?e(w,[e(b,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[r.status==="connecting"?e(S,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):r._e(),e("span",{staticClass:"mt-3"},[r._v(r._s(r.status))])],1)],1):r._e()],1)},C=[];const h={};var W=v(o,T,C,!1,R,"9a120824",null,null);function R(r){for(let t in h)this[t]=h[t]}const U=function(){return W.exports}();export{U as default}; diff --git a/dirs/mainsail/assets/WebrtcMediaMTX-089db774.css b/dirs/mainsail/assets/WebrtcMediaMTX-089db774.css deleted file mode 100644 index 684a5e6..0000000 --- a/dirs/mainsail/assets/WebrtcMediaMTX-089db774.css +++ /dev/null @@ -1 +0,0 @@ -.webcamImage[data-v-781d4888]{width:100%}._webcam_webrtc_output[data-v-781d4888]{aspect-ratio:1.5}video[data-v-781d4888]{width:100%} diff --git a/dirs/mainsail/assets/WebrtcMediaMTX-d62a8a77.js b/dirs/mainsail/assets/WebrtcMediaMTX-d62a8a77.js deleted file mode 100644 index dbb7aa6..0000000 --- a/dirs/mainsail/assets/WebrtcMediaMTX-d62a8a77.js +++ /dev/null @@ -1 +0,0 @@ -import{m as p,B as m,G as f,P as h,W as u,R as g,j as _,n as T}from"./index-97b4652c.js";import{l as w,m as v,p as C}from"./vuetify-52f40ce5.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-9bc570b0.js";var S=Object.defineProperty,y=Object.getOwnPropertyDescriptor,d=(n,e,t,i)=>{for(var s=i>1?void 0:i?y(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(e,t,s):a(s))||s);return i&&s&&S(e,t,s),s};let o=class extends p(m,f){constructor(){super(...arguments),this.pc=null,this.restartTimeout=null,this.status="connecting",this.eTag=null,this.queuedCandidates=[],this.offerData={iceUfrag:"",icePwd:"",medias:[]},this.RESTART_PAUSE=2e3,this.unquoteCredential=e=>JSON.parse('"'.concat(e,'"'))}beforeDestroy(){this.terminate(),this.restartTimeout&&clearTimeout(this.restartTimeout)}get webcamStyle(){var e,t,i;return{transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(t=this.camSettings.flip_vertical)!=null?t:!1,(i=this.camSettings.rotation)!=null?i:0)}}get url(){let e=this.camSettings.stream_url;return e.endsWith("/")||(e+="/"),e=new URL("whep",e).toString(),this.convertUrl(e,this.printerUrl)}changedUrl(){this.terminate(),this.start()}get expanded(){var e;return(e=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?e:!1}expandChanged(e){if(!e){this.terminate();return}this.start()}log(e,t){if(t){window.console.log("[WebRTC mediamtx] ".concat(e),t);return}window.console.log("[WebRTC mediamtx] ".concat(e))}linkToIceServers(e){return e===null?[]:e.split(", ").map(t=>{const i=t.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);if(i===null)return{urls:""};const s={urls:[i[1]]};return i.length>3&&(s.username=this.unquoteCredential(i[3]),s.credential=this.unquoteCredential(i[4]),s.credentialType="password"),s})}parseOffer(e){const t={iceUfrag:"",icePwd:"",medias:[]};for(const i of e.split("\r\n"))i.startsWith("m=")?t.medias.push(i.slice(2)):t.iceUfrag===""&&i.startsWith("a=ice-ufrag:")?t.iceUfrag=i.slice(12):t.icePwd===""&&i.startsWith("a=ice-pwd:")&&(t.icePwd=i.slice(10));return t}generateSdpFragment(e,t){const i={};for(const a of t){const c=a.sdpMLineIndex;c!==null&&(c in i||(i[c]=[]),i[c].push(a))}let s="a=ice-ufrag:"+e.iceUfrag+"\r\na=ice-pwd:"+e.icePwd+"\r\n",r=0;for(const a of e.medias){if(i[r]!==void 0){s+="m="+a+"\r\na=mid:"+r+"\r\n";for(const c of i[r])s+="a="+c.candidate+"\r\n"}r++}return s}start(){this.log("requesting ICE servers from "+this.url),fetch(this.url,{method:"OPTIONS"}).then(e=>this.onIceServers(e)).catch(e=>{this.log("error: "+e),this.scheduleRestart()})}onIceServers(e){const t=this.linkToIceServers(e.headers.get("Link"));this.log("ice servers:",t),this.pc=new RTCPeerConnection({iceServers:t});const i="sendrecv";this.pc.addTransceiver("video",{direction:i}),this.pc.addTransceiver("audio",{direction:i}),this.pc.onicecandidate=s=>this.onLocalCandidate(s),this.pc.oniceconnectionstatechange=()=>this.onConnectionState(),this.pc.ontrack=s=>{this.log("new track:",s.track.kind),this.video.srcObject=s.streams[0]},this.pc.createOffer().then(s=>this.onLocalOffer(s))}onLocalOffer(e){var t,i;this.offerData=this.parseOffer((t=e.sdp)!=null?t:""),(i=this.pc)==null||i.setLocalDescription(e),fetch(this.url,{method:"POST",headers:{"Content-Type":"application/sdp"},body:e.sdp}).then(s=>{if(s.status!==201)throw new Error("bad status code");return this.eTag=s.headers.get("ETag"),s.headers.has("E-Tag")&&(this.eTag=s.headers.get("E-Tag")),s.text()}).then(s=>{this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:s}))}).catch(s=>{this.log(s),this.scheduleRestart()})}onRemoteAnswer(e){var t;this.restartTimeout===null&&((t=this.pc)==null||t.setRemoteDescription(e),this.queuedCandidates.length!==0&&(this.sendLocalCandidates(this.queuedCandidates),this.queuedCandidates=[]))}onConnectionState(){var e,t;if(this.restartTimeout===null)switch(this.status=(t=(e=this.pc)==null?void 0:e.iceConnectionState)!=null?t:"",this.log("peer connection state:",this.status),this.status){case"disconnected":this.scheduleRestart()}}onLocalCandidate(e){if(this.restartTimeout===null&&e.candidate!==null){if(this.eTag===""){this.queuedCandidates.push(e.candidate);return}this.sendLocalCandidates([e.candidate])}}sendLocalCandidates(e){fetch(this.url,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this.eTag},body:this.generateSdpFragment(this.offerData,e)}).then(t=>{if(t.status!==204)throw new Error("bad status code")}).catch(t=>{this.log(t),this.scheduleRestart()})}terminate(){this.log("terminating"),this.pc!==null&&(this.pc.close(),this.pc=null)}scheduleRestart(){this.restartTimeout===null&&(this.terminate(),this.restartTimeout=window.setTimeout(()=>{this.log("scheduling restart"),this.restartTimeout=null,this.start()},this.RESTART_PAUSE),this.eTag="",this.queuedCandidates=[])}};d([h({required:!0})],o.prototype,"camSettings",2);d([h({default:null})],o.prototype,"printerUrl",2);d([g()],o.prototype,"video",2);d([u("url")],o.prototype,"changedUrl",1);d([u("expanded",{immediate:!0})],o.prototype,"expandChanged",1);o=d([_],o);var b=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("video",{directives:[{name:"show",rawName:"v-show",value:n.status==="connected",expression:"status === 'connected'"}],ref:"video",staticClass:"webcamImage",style:n.webcamStyle,attrs:{autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}}),n.status!=="connected"?t(w,[t(v,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[n.status==="connecting"?t(C,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):n._e(),t("span",{staticClass:"mt-3"},[n._v(n._s(n.status))])],1)],1):n._e()],1)},x=[];const l={};var R=T(o,b,x,!1,P,"781d4888",null,null);function P(n){for(let e in l)this[e]=l[e]}const q=function(){return R.exports}();export{q as default}; diff --git a/dirs/mainsail/assets/codemirror-0a1db0c7.js b/dirs/mainsail/assets/codemirror-0a1db0c7.js deleted file mode 100644 index e6085bb..0000000 --- a/dirs/mainsail/assets/codemirror-0a1db0c7.js +++ /dev/null @@ -1 +0,0 @@ -class Q{lineAt(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),qe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),qe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new di(this),r=new di(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new di(this,e)}iterRange(e,t=this.length){return new oa(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new la(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Q.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends Q{constructor(e,t=gf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new yf(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(ao(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=cn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=cn(this.text,cn(i.text,ao(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):qe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i="\n"){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class qe extends Q{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new qe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof qe)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:qe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new qe(l,t)}}Q.empty=new G([""],0);function gf(n){let e=-1;for(let t of n)e+=t.length+1;return e}function cn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value="\n",this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class oa{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new di(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class la{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Q.prototype[Symbol.iterator]=function(){return this.iter()},di.prototype[Symbol.iterator]=oa.prototype[Symbol.iterator]=la.prototype[Symbol.iterator]=function(){return this});class yf{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Vt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Vt[e-1]<=n;return!1}function ho(n){return n>=127462&&n<=127487}const co=8205;function ue(n,e,t=!0,i=!0){return(t?aa:xf)(n,e,i)}function aa(n,e,t){if(e==n.length)return e;e&&ha(n.charCodeAt(e))&&ca(n.charCodeAt(e-1))&&e--;let i=re(n,e);for(e+=De(i);e=0&&ho(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function xf(n,e,t){for(;e>0;){let i=aa(n,e-2,t);if(i=56320&&n<57344}function ca(n){return n>=55296&&n<56320}function re(n,e){let t=n.charCodeAt(e);if(!ca(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return ha(i)?(t-55296<<10)+(i-56320)+65536:t}function vr(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function De(n){return n<65536?1:2}const Ds=/\r\n?|\n/;var pe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(pe||(pe={}));class Ke{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=pe.Simple&&h>=e&&(i==pe.TrackDel&&se||i==pe.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(s));return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ke(e)}static create(e){return new Ke(e)}}class J extends Ke{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Rs(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Bs(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&ht(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError("Invalid change range ".concat(f," to ").concat(u," (in doc of length ").concat(t,")"));let p=d?typeof d=="string"?Q.of(d.split(i||Ds)):d:Q.empty,g=p.length;if(f==u&&g==0)return;fo&&ce(s,f-o,-1),ce(s,u-f,g),ht(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new J(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function ht(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function Bs(n,e,t,i=!1){let s=[],r=i?[]:null,o=new yi(n),l=new yi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ce(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class yi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Q.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Q.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class At{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new At(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(e.anchor,e.head)}static create(e,t,i){return new At(e,t,i)}}class x{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:x.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new x(e.ranges.map(t=>At.fromJSON(t)),e.main)}static single(e,t=e){return new x([x.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?x.range(a,l):x.range(l,a))}}return new x(e,t)}}function ua(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Cr=0;class A{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Cr++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ar),!!e.static,e.enables)}of(e){return new fn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Ar(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class fn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Cr++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Es(f,c)){let d=i(f);if(l?!fo(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=wn(u,p);if(this.dependencies.every(m=>m instanceof A?u.facet(m)===f.facet(m):m instanceof le?u.field(m,!1)==f.field(m,!1):!0)||(l?fo(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function fo(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(uo).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,uo.of({field:this,create:e})]}get extension(){return this}}const vt={lowest:4,low:3,default:2,high:1,highest:0};function ii(n){return e=>new da(e,n)}const Zt={highest:ii(vt.highest),high:ii(vt.high),default:ii(vt.default),low:ii(vt.low),lowest:ii(vt.lowest)};class da{constructor(e,t){this.inner=e,this.prec=t}}class Un{of(e){return new Ls(this,e)}reconfigure(e){return Un.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ls{constructor(e,t){this.compartment=e,this.inner=t}}class kn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of kf(e,t,o))u instanceof le?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,Ar(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(y=>m.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(m=>Of(m,p,d))}}let f=h.map(u=>u(l));return new kn(e,o,f,l,a,r)}}function kf(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Ls&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Ls){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof da)r(o.inner,o.prec);else if(o instanceof le)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof fn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,vt.default);else{let h=o.extension;if(!h)throw new Error("Unrecognized extension value in extension set (".concat(o,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));r(h,l)}}return r(n,vt.default),i.reduce((o,l)=>o.concat(l))}function pi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function wn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const pa=A.define(),ma=A.define({combine:n=>n.some(e=>e),static:!0}),ga=A.define({combine:n=>n.length?n[0]:void 0,static:!0}),ya=A.define(),ba=A.define(),xa=A.define(),Oa=A.define({combine:n=>n.length?n[0]:!1});class st{constructor(e,t){this.type=e,this.value=t}static define(){return new wf}}class wf{of(e){return new st(this,e)}}class Sf{constructor(e){this.map=e}of(e){return new R(this,e)}}class R{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new R(this.type,t)}is(e){return this.type==e}static define(e={}){return new Sf(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}R.reconfigure=R.define();R.appendConfig=R.define();class te{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ua(i,t.newLength),r.some(l=>l.type==te.time)||(this.annotations=r.concat(te.time.of(Date.now())))}static create(e,t,i,s,r,o){return new te(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(te.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}te.time=st.define();te.userEvent=st.define();te.addToHistory=st.define();te.remote=st.define();function vf(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof te?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof te?n=r[0]:n=wa(e,Ft(r),!1)}return n}function Af(n){let e=n.startState,t=e.facet(xa),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=ka(i,Is(e,r,n.changes.newLength),!0))}return i==n?n:te.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Pf=[];function Ft(n){return n==null?Pf:Array.isArray(n)?n:[n]}var U=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(U||(U={}));const Mf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ns;try{Ns=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Tf(n){if(Ns)return Ns.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Mf.test(t)))return!0}return!1}function Df(n){return e=>{if(!/\S/.test(e))return U.Space;if(Tf(e))return U.Word;for(let t=0;t-1)return U.Word;return U.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(R.reconfigure)?(t=null,i=o.value):o.is(R.appendConfig)&&(t=null,i=Ft(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=kn.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Ft(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=kn.resolve(e.extensions||[],new Map),i=e.doc instanceof Q?e.doc:Q.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Ds)),s=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return ua(s,i.length),t.staticFacet(ma)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||"\n"}get readOnly(){return this.facet(Oa)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(pa))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Df(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ue(t,o,!1);if(r(t.slice(a,o))!=U.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=ga;N.readOnly=Oa;N.phrases=A.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=pa;N.changeFilter=ya;N.transactionFilter=ba;N.transactionExtender=xa;Un.reconfigure=R.define();function _e(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Dt{eq(e){return this==e}range(e,t=e){return Qs.create(e,t,this)}}Dt.prototype.startSide=Dt.prototype.endSide=0;Dt.prototype.point=!1;Dt.prototype.mapMode=pe.TrackDel;let Qs=class Sa{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sa(e,t,i)}};function Ws(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Pr{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Pr(s,r,i,l):null,pos:o}}}class W{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new W(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Ws)),this.isEmpty)return t.length?W.of(t):this;let l=new va(this,null,-1).goto(0),a=0,h=[],c=new mt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return bi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return bi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=po(o,l,i),h=new ni(o,a,r),c=new ni(l,a,r);i.iterGaps((f,u,d)=>mo(h,f,c,u,d,s)),i.empty&&i.length==0&&mo(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=po(r,o),a=new ni(r,l,0).goto(i),h=new ni(o,l,0).goto(i);for(;;){if(a.to!=h.to||!$s(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new ni(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new mt;for(let s of e instanceof Qs?[e]:t?Rf(e):e)i.add(s.from,s.to,s.value);return i.finish()}}W.empty=new W([],[],null,-1);function Rf(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(Ws);e=i}return n}W.empty.nextLayer=W.empty;class mt{finishChunk(e){this.chunks.push(new Pr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new mt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(W.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=W.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function po(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new va(o,t,i,r));return s.length==1?s[0]:new bi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ss(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ss(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ss(this.heap,0)}}}function ss(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class ni{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=bi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Fi(this.active,e),Fi(this.activeTo,e),Fi(this.activeRank,e),this.minActive=go(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Fi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function mo(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&$s(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!$s(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function $s(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function go(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ue(n,s)}return i===!0?-1:n.length}const Vs="ͼ",yo=typeof Symbol>"u"?"__"+Vs:Symbol.for(Vs),Fs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class gt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=bo[yo]||1;return bo[yo]=e+1,Vs+e.toString(36)}static mount(e,t,i){let s=e[Fs],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Bf(e,r),s.mount(Array.isArray(t)?t:[t])}}let xo=new Map;class Bf{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=xo.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[Fs]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],xo.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[Fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ef=typeof navigator<"u"&&/Mac/.test(navigator.platform),Lf=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var oe=0;oe<10;oe++)yt[48+oe]=yt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)yt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)yt[oe]=String.fromCharCode(oe+32),xi[oe]=String.fromCharCode(oe);for(var rs in yt)xi.hasOwnProperty(rs)||(xi[rs]=yt[rs]);function If(n){var e=Ef&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Lf&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?xi:yt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Sn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Hs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Nf(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function un(n,e){if(!e.anchorNode)return!1;try{return Hs(n,e.anchorNode)}catch{return!1}}function Oi(n){return n.nodeType==3?Rt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function vn(n,e,t,i){return t?Oo(n,e,t,i,-1)||Oo(n,e,t,i,1):!1}function ki(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Oo(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:et(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=ki(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?et(n):0}else return!1}}function et(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Mr(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Qf(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Wf(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,g=1;if(d)u=Qf(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let w=c.getBoundingClientRect();p=w.width/c.offsetWidth,g=w.height/c.offsetHeight,u={left:w.left,right:w.left+c.clientWidth*p,top:w.top,bottom:w.top+c.clientHeight*g}}let m=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+m&&(m=e.right-u.right+m+r)):e.right>u.right&&(m=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class zf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?et(t):0),i,Math.min(e.focusOffset,i?et(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Nt=null;function Ca(n){if(n.setActive)return n.setActive();if(Nt)return n.focus(Nt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Nt==null?{get preventScroll(){return Nt={preventScroll:!0},!0}}:void 0),!Nt){Nt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class fe{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new fe(e.parentNode,ki(e),t)}static after(e,t){return new fe(e.parentNode,ki(e)+1,t)}}const Tr=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=q.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=wo(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=wo(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=et(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!q.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Tr){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ta(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var M={mac:Co||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:Xn,ie_version:Ra?qs.documentMode||6:Xs?+Xs[1]:Us?+Us[1]:0,gecko:So,gecko_version:So?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!os,chrome_version:os?+os[1]:0,ios:Co,android:/Android\b/.test(Me.userAgent),webkit:vo,safari:Ba,webkit_version:vo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:qs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Hf=256;class tt extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof tt)||this.length-(t-e)+i.length>Hf||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new tt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new fe(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return qf(this.dom,e,t)}}class it extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Aa(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof it&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new it(this.mark,t,o)}domAtPos(e){return Ea(this,e)}coordsAt(e,t){return Ia(this,e,t)}}function qf(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Mr(a,o<0):a||null}class ct extends q{static create(e,t,i){return new ct(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ct.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof ct)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?fe.before(this.dom):fe.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?fe.before(this.dom):fe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Q.empty}get isHidden(){return!0}}tt.prototype.children=ct.prototype.children=jt.prototype.children=Tr;function Ea(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof it&&s.length&&(i=s[s.length-1])instanceof it&&i.mark.eq(e.mark)?La(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Ia(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Gs(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Xf(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Dr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){La(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=js(t,this.attrs||{})),i&&(this.attrs=js({class:i},this.attrs||{}))}domAtPos(e){return Ea(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Aa(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Gs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof it;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof tt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof tt)||/[^ -~]/.test(i.text))return null;let s=Oi(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Ia(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof Z)return r;if(o>t)break}s=o+r.breakAfter}return null}}class ut extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof ut)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Ot{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}destroy(e){}}var me=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(me||(me={}));class D extends Dt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Ii(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Na(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new bt(e,i,s,t,e.widget||null,!0)}static line(e){return new Ni(e)}static set(e,t=!1){return W.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}D.none=W.empty;class Ii extends D{constructor(e){let{start:t,end:i}=Na(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof Ii&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Dr(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ii.prototype.point=!1;class Ni extends D{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ni&&this.spec.class==e.spec.class&&Dr(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ni.prototype.mapMode=pe.TrackBefore;Ni.prototype.point=!0;class bt extends D{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?pe.TrackBefore:pe.TrackAfter:pe.TrackDel}get type(){return this.startSide!=this.endSide?me.WidgetRange:this.startSide<=0?me.WidgetBefore:me.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bt&&jf(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bt.prototype.point=!0;function Na(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t!=null?t:e,end:i!=null?i:e}}function jf(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ks(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class mi{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ut&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Z),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qi(new jt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ut)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(qi(new tt(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof bt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof bt)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ut(i.widget||new Po("div"),l,i));else{let a=ct.create(i.widget||new Po("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(qi(new jt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(qi(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new mi(e,t,i,r);return o.openEnd=W.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function qi(n,e){for(let t of e)n=new it(t,[n],n.length);return n}class Po extends Ot{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Qa=A.define(),Wa=A.define(),$a=A.define(),za=A.define(),Ys=A.define(),Va=A.define(),Fa=A.define(),Ha=A.define({combine:n=>n.some(e=>e)}),qa=A.define({combine:n=>n.some(e=>e)});class Cn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new Cn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Mo=R.define({map:(n,e)=>n.map(e)});function Ie(n,e,t){let i=n.facet(za);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const jn=A.define({combine:n=>n.length?n[0]:!0});let Gf=0;const li=A.define();class K{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new K(Gf++,e,i,s,l=>{let a=[li.of(l)];return o&&a.push(wi.of(h=>{let c=h.plugin(l);return c?o(c):D.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return K.define(i=>new e(i),t)}}class ls{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ie(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ie(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ua=A.define(),Rr=A.define(),wi=A.define(),Br=A.define(),Xa=A.define();function To(n,e,t){let i=n.state.facet(Xa);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return W.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const ja=A.define();function Ga(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(ja)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ai=A.define();class Ee{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Ee(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Ee(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class An{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=J.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Ee(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new An(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var X=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(X||(X={}));const Si=X.LTR,Ka=X.RTL;function Ya(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function _a(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;g-=3)if($e[g+1]==-d){let m=$e[g+2],y=m&2?s:m&4?m&1?r:s:0;y&&($[f]=$[$e[g]]=y),l=g;break}}else{if($e.length==189)break;$e[l++]=f,$e[l++]=u,$e[l++]=a}else if((p=$[f])==2||p==1){let g=p==s;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=$e[m+2];if(y&2)break;if(g)$e[m+2]|=2;else{if(y&4)break;$e[m+2]|=4}}}}}function tu(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==m&&(p=t[--g].from,m=g?t[g-1].to:n),$[--p]=d;a=c}else r=h,a++}}}function Zs(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new ft(a,g.from,d));let m=g.direction==Si!=!(d%2);Js(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(c?$[p]!=l:$[p]==l))break;p++}u?Zs(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=$[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let g=r[--h];if(!c)for(let m=g.from,y=h;;){if(m==e)break e;if(y&&r[y-1].to==m)m=r[--y].from;else{if($[m-1]==l)break e;break}}if(u)u.push(g);else{g.to$.length;)$[$.length]=256;let i=[],s=e==Si?0:1;return Js(n,s,s,t,0,n.length,i),i}function Za(n){return[new ft(0,n,0)]}let Ja="";function nu(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=ft.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=ue(n.text,o,h);if(Ja=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return x.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?x.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let s=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!cu(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?ru(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Ee(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(M.ie||M.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=au(o,l,e.changes);return i=Ee.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,g;if(i&&i.range.fromBc){let O=mi.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),k=mi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=O.breakAtStart,p=O.openStart,g=k.openEnd;let S=this.compositionView(i);k.breakAtStart?S.breakAfter=1:k.content.length&&S.merge(S.length,S.length,k.content[0],!1,k.openStart,0)&&(S.breakAfter=k.content[0].breakAfter,k.content.shift()),O.content.length&&S.merge(0,0,O.content[O.content.length-1],!0,0,O.openEnd)&&O.content.pop(),u=O.content.concat(S).concat(k.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=mi.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(h,1),{i:w,off:C}=r.findPos(a,-1);Ta(this,w,C,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new tt(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new it(s,[t],t.length);let i=new Z;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&un(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(M.gecko&&l.empty&&!this.hasComposition&&su(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new fe(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!vn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!vn(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&hu(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Sn(this.view.root);if(f)if(l.empty){if(M.gecko){let u=ou(a.node,a.offset);if(u&&u!=3){let d=th(a.node,a.offset,u==1?1:-1);d&&(a=new fe(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new fe(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new fe(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Sn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=Z.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=q.get(t.childNodes[s]);r instanceof Z&&(i=r.domAtPos(r.length))}return i?new fe(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof Z&&!(i instanceof Z&&t>=0))&&(i=l,s=h),r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof Z))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof tt))return null;let r=ue(s.text,i);if(r==i)return null;let o=Rt(s.dom,i,r).getClientRects();return!o.length||o[0].top>=o[0].bottom?null:o[0]}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,g=p?Oi(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Z){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Oi(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ma(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(D.replace({widget:new Ro(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return D.set(e)}updateDeco(){let e=this.view.state.facet(wi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Ga(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};Wf(this.view.scrollDOM,o,t.head0)i=i.childNodes[s-1],s=et(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return{node:i,offset:s};if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function ou(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function fu(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return x.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=ue(s.text,r,!1):l=ue(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=ue(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function du(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function as(n,e){return n.tope.top+1}function Bo(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function er(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=Oi(p);for(let m=0;mC||o==C&&r>w){i=p,s=y,r=w,o=C;let O=C?t0?m0)}w==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&as(c,y)?c=Eo(c,y.bottom):f&&as(f,y)&&(f=Bo(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Lo(i,u,t);if(l&&i.contentEditable!="false")return er(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Lo(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&Rt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function ih(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let O=n.viewState.heightOracle.textHeight/2,k=!1;a=n.elementAtHeight(u),a.type!=me.Text;)for(;u=i>0?a.bottom+O:a.top-O,!(u>=0&&u<=h);){if(k)return t?null:0;k=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Io(n,o,a,c,f);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(c,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(c=Math.max(o.left+1,Math.min(o.right-1,c)),m=g.elementFromPoint(c,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,w=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let O=p.caretPositionFromPoint(c,f);O&&({offsetNode:y,offset:w}=O)}else if(p.caretRangeFromPoint){let O=p.caretRangeFromPoint(c,f);O&&({startContainer:y,startOffset:w}=O,(!n.contentDOM.contains(y)||M.safari&&pu(y,w,c)||M.chrome&&mu(y,w,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let O=Z.find(n.docView,d);if(!O)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=er(O.dom,c,f))}let C=n.docView.nearest(y);if(!C)return null;if(C.isWidget&&((r=C.dom)===null||r===void 0?void 0:r.nodeType)==1){let O=C.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+zs(o,r,n.state.tabSize)}function pu(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Rt(n,i-1,i).getBoundingClientRect().left>t}function mu(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Rt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function tr(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==me.Text))return i}return t}function gu(n,e,t,i){let s=tr(n,e.head),r=!i||s.type!=me.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return x.cursor(a,t?-1:1)}return x.cursor(t?s.to:s.from,t?-1:1)}function No(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=nu(s,r,o,l,t),c=Ja;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c="\n",s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=x.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function yu(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==U.Space&&(s=o),s==o}}function bu(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return x.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i!=null?i:n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=ih(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs)){let m=n.docView.coordsForChar(g),y=!m||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:x.cursor(i,i{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let i=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=i,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null),M.gecko&&Iu(e.contentDOM.ownerDocument)}handleEvent(e){!Pu(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Ou(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||ku.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ht(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Qo(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Ie(t.state,s)}}}function Ou(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(Qo(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(Qo(i.value,o))}}for(let i in Ye)t(i).handlers.push(Ye[i]);for(let i in Ne)t(i).observers.push(Ne[i]);return e}const nh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ku="dthko",sh=[16,17,18,20,91,92,224,225],Ui=6;function Xi(n){return Math.max(0,n)*.7+8}function wu(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Su{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=$f(e.contentDOM),this.atoms=e.state.facet(Br).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&vu(e,t),this.dragging=Au(e,t)&&ah(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&wu(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Ga(this.view);e.clientX-o.left<=r.left+Ui?i=-Xi(r.left-e.clientX):e.clientX+o.right>=r.right-Ui&&(i=Xi(e.clientX-r.right)),e.clientY-o.top<=r.top+Ui?s=-Xi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ui&&(s=Xi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function vu(n,e){let t=n.state.facet(Qa);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Cu(n,e){let t=n.state.facet(Wa);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function Au(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Sn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Pu(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const Ye=Object.create(null),Ne=Object.create(null),rh=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function Mu(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),oh(n,t.value)},50)}function oh(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(ir!=null&&t.selection.ranges.every(a=>a.empty)&&ir==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:x.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:x.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ne.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ye.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Ne.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ne.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ye.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet($a))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Ru(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Su(n,e,t,i)),i&&n.observer.ignore(()=>Ca(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function Wo(n,e,t,i){if(i==1)return x.cursor(e,t);if(i==2)return fu(n.state,e,t);{let s=Z.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,$o=(n,e,t)=>lh(e,t)&&n>=t.left&&n<=t.right;function Tu(n,e,t,i){let s=Z.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&$o(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&$o(t,i,l)?1:o&&lh(i,o)?-1:1}function zo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Tu(n,t,e.clientX,e.clientY)}}const Du=M.ie&&M.ie_version<=11;let Vo=null,Fo=0,Ho=0;function ah(n){if(!Du)return n.detail;let e=Vo,t=Ho;return Vo=n,Ho=Date.now(),Fo=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Fo+1)%3:1}function Ru(n,e){let t=zo(n,e),i=ah(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=zo(n,r),h,c=Wo(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=Wo(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Bu(s,a.pos))?h:l?s.addRange(c):x.create([c])}}}function Bu(n,e){for(let t=0;t=e)return x.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Ye.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;return i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function qo(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&Cu(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Ye.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&qo(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return qo(n,e,i,!0),!0}return!1};Ye.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=rh?null:e.clipboardData;return t?(oh(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Mu(n),!1)};function Eu(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function Lu(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let ir=null;Ye.copy=Ye.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=Lu(n.state);if(!t&&!s)return!1;ir=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=rh?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Eu(n,t),!1)};const hh=st.define();function ch(n,e){let t=[];for(let i of n.facet(Fa)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:hh.of(!0)}):null}function fh(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=ch(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ne.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),fh(n)};Ne.blur=n=>{n.observer.clearSelectionRange(),fh(n)};Ne.compositionstart=Ne.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Ne.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Ne.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ye.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=nh.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const Uo=new Set;function Iu(n){Uo.has(n)||(Uo.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Xo=["pre-wrap","normal","pre-line","break-spaces"];class Nu{constructor(e){this.lineWrapping=e,this.doc=Q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Xo.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>pn&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ge.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,H.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,H.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return"block(".concat(this.length,")")}}class Ae extends uh{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Ue(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof se&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof se?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ge.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}class se extends ge{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new Ue(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new Ue(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new Ue(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new Ue(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new Ue(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof se?i[i.length-1]=new se(r.length+s):i.push(null,new se(s-1))}if(e>0){let r=i[0];r instanceof se?i[0]=new se(e+r.length):i.unshift(new se(e-1),null)}return ge.of(i)}decomposeLeft(e,t){t.push(new se(e-1),null)}decomposeRight(e,t){t.push(null,new se(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new se(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=pn&&(a=-2);let u=new Ae(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new se(r-l).updateHeight(e,l));let h=ge.of(o);return(a<0||Math.abs(h.height-this.height)>=pn||Math.abs(a-this.heightMetrics(e,t).perLine)>=pn)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return"gap(".concat(this.length,")")}}class Wu extends ge{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,H.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&jo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?ge.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function jo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof se&&(i=n[e+1])instanceof se&&n.splice(e-1,3,new se(t.length+1+i.length))}const $u=5;class Er{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=$u)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new se(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Hu(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class cs{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new Nu(t),this.stateDeco=e.facet(wi).filter(i=>typeof i!="function"),this.heightMap=ge.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle.setDoc(e.doc),[new Ee(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=D.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new ji(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?Ko:new ju(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:hi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(wi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Ee.extendWithRanges(s,zu(i,this.stateDeco,e?e.changes:J.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(qa)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let O=l.width/t.offsetWidth,k=l.height/t.offsetHeight;(O>.995&&O<1.005||!isFinite(O)||Math.abs(l.width-t.offsetWidth)<1)&&(O=1),(k>.995&&k<1.005||!isFinite(k)||Math.abs(l.height-t.offsetHeight)<1)&&(k=1),(this.scaleX!=O||this.scaleY!=k)&&(this.scaleX=O,this.scaleY=k,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Pa(e.scrollDOM);let p=(this.printing?Hu:Fu)(t,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let O=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(O)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:k,charWidth:S,textHeight:T}=e.docView.measureTextSize();o=k>0&&s.refresh(r,k,S,T,w/S,O),o&&(e.docView.minWidth=0,h|=8)}g>0&&m>0?c=Math.max(g,m):g<0&&m<0&&(c=Math.min(g,m)),s.heightChanged=!1;for(let k of this.viewports){let S=k.from==this.viewport.from?O:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?ge.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle,[new Ee(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Qu(k.from,S))}s.heightChanged&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ji(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&mm.from>=f.from&&m.to<=f.to&&Math.abs(m.from-h)m.fromy));if(!g){if(cm.from<=c&&m.to>=c)){let m=t.moveToLineBoundary(x.cursor(c),!1,!0).head;m>h&&(c=m)}g=new cs(h,c,this.gapSize(f,h,c,u))}l.push(g)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];W.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||hi(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return hi(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return hi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ji{constructor(e,t){this.from=e,this.to=t}}function Uu(n,e,t){let i=[],s=n,r=0;return W.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Ki(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Xu(n,e){for(let t of n)if(e(t))return t}const Ko={toDOM(n){return n},fromDOM(n){return n},scale:1};class ju{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(a,H.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=thi(s,e)):n._content)}const Yi=A.define({combine:n=>n.join(" ")}),nr=A.define({combine:n=>n.indexOf(!0)>-1}),sr=gt.newName(),dh=gt.newName(),ph=gt.newName(),mh={"&light":"."+dh,"&dark":"."+ph};function rr(n,e,t){return new gt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError("Unsupported selector: ".concat(s));return t[s]}):n+" "+i}})}const Gu=rr("."+sr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},mh),ci="￿";class Ku{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(N.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ci}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=q.get(s),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Yo(s))||Yo(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Yu(e,i.node,i.offset)?t:0))}}function Yu(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:ed(e),a=new Ku(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=td(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Hs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Hs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=x.single(h,a)}}}function gh(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Q.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()=="\n "&&n.lineWrapping&&(i&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Q.of([" "])}),t){if(M.ios&&n.inputState.flushIOSKey()||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Ht(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Ht(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Ht(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Zu(n,t,i));return n.state.facet(Va).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Zu(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c,f=t&&eh(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-h.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let y=s.changes({from:m,to:g,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?x.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Ju(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function ed(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new _o(t,i)),(s!=t||r!=i)&&e.push(new _o(s,r))),e}function td(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?x.single(t+e,i+e):null}const id={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},fs=M.ie&&M.ie_version<=11;class nd{constructor(e){this.view=e,this.active=!1,this.selectionRange=new zf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),fs&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(jn)?i.root.activeElement!=this.dom:!un(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&vn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&Nf(this.dom.ownerDocument)==this.dom&&sd(this.view)||Sn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=un(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ht(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&un(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new _u(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=gh(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=Zo(t,e.previousSibling||e.target.previousSibling,-1),s=Zo(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Zo(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function sd(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return vn(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class P{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Vf(e.parent)||document,this.viewState=new Go(e.state||N.create(e)),this.plugins=this.state.facet(li).map(i=>new ls(i));for(let i of this.plugins)i.update(this);this.observer=new nd(this),this.inputState=new xu(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Do(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof te?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(hh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ch(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=An.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Cn(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Mo)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=Pn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ai)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Yi)!=s.state.facet(Yi)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ys))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!gh(this,c)&&h.force&&Ht(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Go(e),this.plugins=e.facet(li).map(i=>new ls(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Do(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(li),i=e.state.facet(li);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new ls(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Pa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ie(this.state,p),Jo}}),f=An.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ys))l(t)}get themeClasses(){return sr+" "+(this.state.facet(nr)?ph:dh)+" "+this.state.facet(Yi)}updateAttrs(){let e=el(this,Ua,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(jn)?"true":"false",class:"cm-content",style:"".concat(M.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),el(this,Rr,t);let i=this.observer.ignore(()=>{let s=Gs(this.contentDOM,this.contentAttrs,t),r=Gs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(P.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ai);let e=this.state.facet(P.cspNonce);gt.mount(this.root,this.styleModules.concat(Gu).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return hs(this,e,No(this,e,t,i))}moveByGroup(e,t){return hs(this,e,No(this,e,t,i=>yu(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return gu(this,e,t,i)}moveVertically(e,t,i){return hs(this,e,bu(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ih(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ft.find(r,e-s.from,-1,t)];return Mr(i,o.dir==X.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Ha)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>rd)return Za(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||_a(r.isolates,i=To(this,e.from,e.to))))return r.order;i||(i=To(this,e.from,e.to));let s=iu(e.text,t,i);return this.bidiCache.push(new Pn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ca(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Mo.of(new Cn(typeof e=="number"?x.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return K.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return K.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=gt.newName(),s=[Yi.of(i),ai.of(rr(".".concat(i),e))];return t&&t.dark&&s.push(nr.of(!0)),s}static baseTheme(e){return Zt.lowest(ai.of(rr("."+sr,e,mh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}P.styleModule=ai;P.inputHandler=Va;P.focusChangeEffect=Fa;P.perLineTextDirection=Ha;P.exceptionSink=za;P.updateListener=Ys;P.editable=jn;P.mouseSelectionStyle=$a;P.dragMovesSelection=Wa;P.clickAddsSelectionRange=Qa;P.decorations=wi;P.atomicRanges=Br;P.bidiIsolatedRanges=Xa;P.scrollMargins=ja;P.darkTheme=nr;P.cspNonce=A.define({combine:n=>n.length?n[0]:""});P.contentAttributes=Rr;P.editorAttributes=Ua;P.lineWrapping=P.contentAttributes.of({class:"cm-lineWrapping"});P.announce=R.define();const rd=4096,Jo={};class Pn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:X.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&js(o,t)}return t}const od=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function ld(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function hd(n,e,t){return bh(yh(n.state),e,n,t)}let at=null;const cd=4e3;function fd(n,e=od){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>ld(y,e));for(let y=1;y{let O=at={view:C,prefix:w,scope:o};return setTimeout(()=>{at==O&&(at=null)},cd),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function bh(n,e,t,i){let s=If(e),r=re(s,0),o=De(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;at&&at.view==t&&at.scope==i&&(l=at.prefix+" ",sh.indexOf(e.keyCode)<0&&(h=!0,at=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(t,e)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,g;return d&&(u(d[l+_i(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=yt[e.keyCode])&&p!=s?(u(d[l+_i(p,e,!0)])||e.shiftKey&&(g=xi[e.keyCode])!=s&&g!=p&&u(d[l+_i(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+_i(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Qi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=xh(e);return[new Qi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return ud(e,t,i)}}function xh(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==X.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function il(n,e,t){let i=x.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:me.Text}}function ud(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==X.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=xh(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=tr(n,i),p=tr(n,s),g=d.type==me.Text?d:null,m=p.type==me.Text?p:null;if(g&&(n.lineWrapping||d.widgetLineBreaks)&&(g=il(n,i,g)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=il(n,s,m)),g&&m&&g.from==m.from)return w(C(t.from,t.to,g));{let k=g?C(t.from,null,g):O(d,!1),S=m?C(null,t.to,m):O(p,!0),T=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&k.bottom+n.defaultLineHeight/2Y&&be.from=he)break;_>ne&&F(Math.max(j,ne),k==null&&j<=Y,Math.min(_,he),S==null&&_>=ae,xe.dir)}if(ne=We.to+1,ne>=he)break}return E.length==0&&F(Y,k==null,ae,S==null,n.textDirection),{top:I,bottom:B,horizontal:E}}function O(k,S){let T=l.top+(S?k.top:k.bottom);return{top:T,bottom:T,horizontal:[]}}}function dd(n,e){return n.constructor==e.constructor&&n.eq(e)}class pd{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(mn)!=e.state.facet(mn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(mn);for(;t!dd(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const mn=A.define();function Oh(n){return[K.define(e=>new pd(e,n)),mn.of(n)]}const kh=!M.ios,vi=A.define({combine(n){return _e(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function md(n={}){return[vi.of(n),gd,yd,bd,qa.of(!0)]}function wh(n){return n.startState.facet(vi)!=n.state.facet(vi)}const gd=Oh({above:!0,markers(n){let{state:e}=n,t=e.facet(vi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||kh:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:x.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Qi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=wh(n);return t&&nl(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){nl(e.state,n)},class:"cm-cursorLayer"});function nl(n,e){e.style.animationDuration=n.facet(vi).cursorBlinkRate+"ms"}const yd=Oh({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Qi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||wh(n)},class:"cm-selectionLayer"}),Sh={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};kh&&(Sh[".cm-line"].caretColor="transparent !important");const bd=Zt.highest(P.theme(Sh)),vh=R.define({map(n,e){return n==null?null:e.mapPos(n)}}),fi=le.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(vh)?i.value:t,n)}}),xd=K.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(fi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(fi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(fi),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(fi)!=n&&this.view.dispatch({effects:vh.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Od(){return[fi,xd]}function sl(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function kd(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class wd{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new mt,i=t.add.bind(t);for(let{from:s,to:r}of kd(e,this.maxLength))sl(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(g,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,m)=>gf,add:u})}}return t}}const or=/x/.unicode!=null?"gu":"g",Sd=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",or),vd={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let us=null;function Cd(){var n;if(us==null&&typeof document<"u"&&document.body){let e=document.body.style;us=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return us||!1}const gn=A.define({combine(n){let e=_e(n,{render:null,specialChars:Sd,addSpecialChars:null});return(e.replaceTabs=!Cd())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,or)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,or)),e}});function Ad(n={}){return[gn.of(n),Pd()]}let rl=null;function Pd(){return rl||(rl=K.fromClass(class{constructor(n){this.view=n,this.decorations=D.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new wd({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Jt(o.text,l,i-o.from);return D.replace({widget:new Rd((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=D.replace({widget:new Dd(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(gn);n.startState.facet(gn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Md="•";function Td(n){return n>=32?Md:n==10?"␤":String.fromCharCode(9216+n)}class Dd extends Ot{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Td(this.code),i=e.state.phrase("Control character")+" "+(vd[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Rd extends Ot{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Bd(){return Ld}const Ed=D.line({class:"cm-activeLine"}),Ld=K.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(Ed.range(s.from)),e=s.from)}return D.set(t)}},{decorations:n=>n.decorations}),lr=2e3;function Id(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>lr||t.off>lr||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(x.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=zs(h.text,o,n.tabSize,!0);if(c<0)r.push(x.cursor(h.to));else{let f=zs(h.text,l,n.tabSize);r.push(x.range(h.from+c,h.from+f))}}}return r}function Nd(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function ol(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>lr?-1:s==i.length?Nd(n,e.clientX):Jt(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Qd(n,e){let t=ol(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=ol(n,s);if(!l)return i;let a=Id(n.state,t,l);return a.length?o?x.create(a.concat(i.ranges)):x.create(a):i}}:null}function Wd(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return P.mouseSelectionStyle.of((t,i)=>e(i)?Qd(t,i):null)}const $d={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},zd={style:"cursor: crosshair"};function Vd(n={}){let[e,t]=$d[n.key||"Alt"],i=K.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,P.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?zd:null})]}const Zi="-10000px";class Ch{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Fd}}}),ll=new WeakMap,Ah=K.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(ds);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Ch(n,Ir,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(ds);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Zi,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{offsetParent:s}=this.manager.tooltipViews[0].dom;i=!!(s&&s!=this.container.ownerDocument.body)}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(ds).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1){c.style.top=Zi;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(e=ll.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||qd,w=this.view.textDirection==X.LTR,C=u.width>i.right-i.left?w?i.left:i.right-u.width:w?Math.min(f.left-(d?14:0)+y.x,i.right-g):Math.max(i.left,f.left-g+(d?14:0)-y.x),O=!!a.above;!a.strictSide&&(O?f.top-(u.bottom-u.top)-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-p;if(kC&&I.topS&&(S=O?I.top-m-2-p:I.bottom+p+2);if(this.position=="absolute"?(c.style.top=(S-n.parent.top)/r+"px",c.style.left=(C-n.parent.left)/s+"px"):(c.style.top=S/r+"px",c.style.left=C/s+"px"),d){let I=f.left+(w?y.x:-y.x)-(C+14-7);d.style.left=I/s+"px"}h.overlap!==!0&&o.push({left:C,top:S,right:T,bottom:S+m}),c.classList.toggle("cm-tooltip-above",O),c.classList.toggle("cm-tooltip-below",!O),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Zi}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Hd=P.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"".concat(7*2,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qd={x:0,y:0},Ir=A.define({enables:[Ah,Hd]}),Mn=A.define();class Nr{static create(e){return new Nr(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ch(e,Mn,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const Ud=Ir.compute([Mn],n=>{let e=n.facet(Mn).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Nr.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class Xd{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(c=>c.from<=s&&c.to>=s),h=a&&a.dir==X.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&e.dispatch({effects:this.setHover.of(a)}))},a=>Ie(e.state,a,"hover tooltip"))}else o&&e.dispatch({effects:this.setHover.of(o)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!al(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,r=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:s;(s==r?this.view.posAtCoords(this.lastMove)!=s:!jd(this.view,s,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!al(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function al(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function jd(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rights||Math.min(o.bottom,l)=e&&a<=t}function Gd(n,e={}){let t=R.define(),i=le.define({create(){return null},update(s,r){if(s&&(e.hideOnChange&&(r.docChanged||r.selection)||e.hideOn&&e.hideOn(r,s)))return null;if(s&&r.docChanged){let o=r.changes.mapPos(s.pos,-1,pe.TrackDel);if(o==null)return null;let l=Object.assign(Object.create(null),s);l.pos=o,s.end!=null&&(l.end=r.changes.mapPos(s.end)),s=l}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(Kd)&&(s=null);return s},provide:s=>Mn.from(s)});return[i,K.define(s=>new Xd(s,n,i,t,e.hoverTime||300)),Ud]}function Ph(n,e){let t=n.plugin(Ah);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Kd=R.define(),hl=A.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ci(n,e){let t=n.plugin(Mh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Mh=K.fromClass(class{constructor(n){this.input=n.state.facet(Ai),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(hl);this.top=new Ji(n,!0,e.topContainer),this.bottom=new Ji(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(hl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ji(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ji(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Ai);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ji{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=cl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=cl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function cl(n){let e=n.nextSibling;return n.remove(),e}const Ai=A.define({enables:Mh});class nt extends Dt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}nt.prototype.elementClass="";nt.prototype.toDOM=void 0;nt.prototype.mapMode=pe.TrackBefore;nt.prototype.startSide=nt.prototype.endSide=-1;nt.prototype.point=!0;const yn=A.define(),Yd={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>W.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},gi=A.define();function _d(n){return[Th(),gi.of(Object.assign(Object.assign({},Yd),n))]}const ar=A.define({combine:n=>n.some(e=>e)});function Th(n){let e=[Zd];return n&&n.fixed===!1&&e.push(ar.of(!0)),e}const Zd=K.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(gi).map(e=>new ul(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(ar),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(ar)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=W.iter(this.view.state.facet(yn),this.view.viewport.from),i=[],s=this.gutters.map(r=>new Jd(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==me.Text&&o){hr(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==me.Text){hr(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(gi),t=n.state.facet(gi),i=n.docChanged||n.heightChanged||n.viewportChanged||!W.eq(n.startState.facet(yn),n.state.facet(yn),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new ul(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==X.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function fl(n){return Array.isArray(n)?n:[n]}function hr(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class Jd{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=W.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new Dh(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];hr(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);i&&this.addElement(e,t,[i])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ul{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=fl(t.markers(e)),t.initialSpacer&&(this.spacer=new Dh(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=fl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!W.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Dh{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),ep(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class ps extends nt{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ms(n,e){return n.state.facet($t).formatNumber(e,n.state)}const ip=gi.compute([$t],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(tp)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new ps(ms(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet($t)!=e.state.facet($t),initialSpacer(e){return new ps(ms(e,dl(e.state.doc.lines)))},updateSpacer(e,t){let i=ms(t.view,dl(t.view.state.doc.lines));return i==e.number?e:new ps(i)},domEventHandlers:n.facet($t).domEventHandlers}));function np(n={}){return[$t.of(n),Th(),ip]}function dl(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(sp.range(s)))}return W.of(e)});function op(){return rp}const Rh=1024;let lp=0;class gs{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=lp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ye.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Tn{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[L.mounted.id]}}const ap=Object.create(null);class ye{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):ap,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ye(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ye.none=new ye("",Object.create(null),0,8);class Gn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|ee.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:$r(ye.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new z(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new z(ye.none,t,i,s)))}static build(e){return up(e)}}z.empty=new z(ye.none,[],[],0);class Qr{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Qr(this.buffer,this.index)}}class Lt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ye.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Pi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Bh(s,i,f,f+c.length)){if(c instanceof Lt){if(r&ee.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new Xe(new hp(o,c,e,f),null,u)}else if(r&ee.IncludeAnonymous||!c.type.isAnonymous||Wr(c)){let u;if(!(r&ee.IgnoreMounts)&&(u=Tn.get(c))&&!u.overlay)return new Se(u.tree,f,e,o);let d=new Se(c,f,e,o);return r&ee.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&ee.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&ee.IgnoreOverlays)&&(s=Tn.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Se(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ml(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function cr(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class hp{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Xe extends Eh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Xe(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&ee.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Xe(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Xe(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Xe(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new z(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Lh(n){if(!n.length)return null;if(n.length==1)return n[0];let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new Se(o.tree,o.overlay[0].from+r.from,0,null);(s||(s=[i])).push(Pi(l,e,t,!1))}}return s?Lh(s):i}class fr{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Se)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Se?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&ee.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ee.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ee.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&ee.IncludeAnonymous||l instanceof Lt||!l.type.isAnonymous||Wr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return cr(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Wr(n){return n.children.some(e=>e instanceof Lt||!e.type.isAnonymous||Wr(e))}function up(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Rh,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Qr(t,t.length):t,a=i.types,h=0,c=0;function f(O,k,S,T,I){let{id:B,start:E,end:F,size:Y}=l,ae=c;for(;Y<0;)if(l.next(),Y==-1){let xe=r[B];S.push(xe),T.push(E-O);return}else if(Y==-3){h=B;return}else if(Y==-4){c=B;return}else throw new RangeError("Unrecognized record size: ".concat(Y));let be=a[B],ne,he,We=E-O;if(F-E<=s&&(he=g(l.pos-k,I))){let xe=new Uint16Array(he.size-he.skip),j=l.pos-he.size,_=xe.length;for(;l.pos>j;)_=m(he.start,xe,_);ne=new Lt(xe,F-he.start,i),We=he.start-O}else{let xe=l.pos-Y;l.next();let j=[],_=[],wt=B>=o?B:-1,It=0,Vi=F;for(;l.pos>xe;)wt>=0&&l.id==wt&&l.size>=0?(l.end<=Vi-s&&(d(j,_,E,It,l.end,Vi,wt,ae),It=j.length,Vi=l.end),l.next()):f(E,xe,j,_,wt);if(wt>=0&&It>0&&It-1&&It>0){let lo=u(be);ne=$r(be,j,_,0,j.length,0,F-E,lo,lo)}else ne=p(be,j,_,F-E,ae-F)}S.push(ne),T.push(We)}function u(O){return(k,S,T)=>{let I=0,B=k.length-1,E,F;if(B>=0&&(E=k[B])instanceof z){if(!B&&E.type==O&&E.length==T)return E;(F=E.prop(L.lookAhead))&&(I=S[B]+E.length+F)}return p(O,k,S,T,I)}}function d(O,k,S,T,I,B,E,F){let Y=[],ae=[];for(;O.length>T;)Y.push(O.pop()),ae.push(k.pop()+S-I);O.push(p(i.types[E],Y,ae,B-I,F-B)),k.push(I-S)}function p(O,k,S,T,I=0,B){if(h){let E=[L.contextHash,h];B=B?[E].concat(B):[E]}if(I>25){let E=[L.lookAhead,I];B=B?[E].concat(B):[E]}return new z(O,k,S,T,B)}function g(O,k){let S=l.fork(),T=0,I=0,B=0,E=S.end-s,F={size:0,start:0,skip:0};e:for(let Y=S.pos-O;S.pos>Y;){let ae=S.size;if(S.id==k&&ae>=0){F.size=T,F.start=I,F.skip=B,B+=4,T+=4,S.next();continue}let be=S.pos-ae;if(ae<0||be=o?4:0,he=S.start;for(S.next();S.pos>be;){if(S.size<0)if(S.size==-3)ne+=4;else break e;else S.id>=o&&(ne+=4);S.next()}I=he,T+=ae,B+=ne}return(k<0||T==O)&&(F.size=T,F.start=I,F.skip=B),F.size>4?F:void 0}function m(O,k,S){let{id:T,start:I,end:B,size:E}=l;if(l.next(),E>=0&&T4){let Y=l.pos-(E-4);for(;l.pos>Y;)S=m(O,k,S)}k[--S]=F,k[--S]=B-O,k[--S]=I-O,k[--S]=T}else E==-3?h=T:E==-4&&(c=T);return S}let y=[],w=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,w,-1);let C=(e=n.length)!==null&&e!==void 0?e:y.length?w[0]+y[0].length:0;return new z(a[n.topID],y.reverse(),w.reverse(),C)}const gl=new WeakMap;function bn(n,e){if(!n.isAnonymous||e instanceof Lt||e.type!=n)return 1;let t=gl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof z)){t=1;break}t+=bn(n,i)}gl.set(e,t)}return t}function $r(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;S+=T}if(C==O+1){if(S>c){let T=p[O];d(T.children,T.positions,0,T.children.length,g[O]+w);continue}f.push(p[O])}else{let T=g[C-1]+p[C-1].length-k;f.push($r(n,p,g,O,C,k,T,null,a))}u.push(k+w-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class dp{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Xe?this.setBuffer(e.context.buffer,e.index,t):e instanceof Se&&this.map.set(e.tree,t)}get(e){return e instanceof Xe?this.getBuffer(e.context.buffer,e.index):e instanceof Se?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Tt{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Tt(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Tt(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew gs(s.from,s.to)):[new gs(0,0)]:[new gs(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class pp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new L({perNode:!0});let mp=0;class He{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=mp++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new He([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new Dn;return t=>t.modified.indexOf(e)>-1?t:Dn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let gp=0;class Dn{constructor(){this.instances=[],this.id=gp++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&yp(t,l.modified));if(i)return i;let s=[],r=new He(s,e,t);for(let l of t)l.instances.push(r);let o=bp(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(Dn.get(l,a));return r}}function yp(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function bp(n){let e=[[]];for(let t=0;ti.length-t.length)}function Vr(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new Rn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Ih.add(e)}const Ih=new L;class Rn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function xp(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Op(n,e,t,i=0,s=n.length){let r=new kp(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class kp{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=wp(e)||Rn.empty,f=xp(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,y=l;;m++){let w=m=C||!e.nextSibling())););if(!w||C>i)break;y=w.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,w.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}g&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function wp(n){let e=n.type.prop(Ih);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const v=He.define,tn=v(),ot=v(),yl=v(ot),bl=v(ot),lt=v(),nn=v(lt),ys=v(lt),Fe=v(),St=v(Fe),ze=v(),Ve=v(),ur=v(),si=v(ur),sn=v(),b={comment:tn,lineComment:v(tn),blockComment:v(tn),docComment:v(tn),name:ot,variableName:v(ot),typeName:yl,tagName:v(yl),propertyName:bl,attributeName:v(bl),className:v(ot),labelName:v(ot),namespace:v(ot),macroName:v(ot),literal:lt,string:nn,docString:v(nn),character:v(nn),attributeValue:v(nn),number:ys,integer:v(ys),float:v(ys),bool:v(lt),regexp:v(lt),escape:v(lt),color:v(lt),url:v(lt),keyword:ze,self:v(ze),null:v(ze),atom:v(ze),unit:v(ze),modifier:v(ze),operatorKeyword:v(ze),controlKeyword:v(ze),definitionKeyword:v(ze),moduleKeyword:v(ze),operator:Ve,derefOperator:v(Ve),arithmeticOperator:v(Ve),logicOperator:v(Ve),bitwiseOperator:v(Ve),compareOperator:v(Ve),updateOperator:v(Ve),definitionOperator:v(Ve),typeOperator:v(Ve),controlOperator:v(Ve),punctuation:ur,separator:v(ur),bracket:si,angleBracket:v(si),squareBracket:v(si),paren:v(si),brace:v(si),content:Fe,heading:St,heading1:v(St),heading2:v(St),heading3:v(St),heading4:v(St),heading5:v(St),heading6:v(St),contentSeparator:v(Fe),list:v(Fe),quote:v(Fe),emphasis:v(Fe),strong:v(Fe),link:v(Fe),monospace:v(Fe),strikethrough:v(Fe),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:sn,documentMeta:v(sn),annotation:v(sn),processingInstruction:v(sn),definition:He.defineModifier(),constant:He.defineModifier(),function:He.defineModifier(),standard:He.defineModifier(),local:He.defineModifier(),special:He.defineModifier()};Nh([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var bs;const Pt=new L;function Qh(n){return A.define({combine:n?e=>e.concat(n):void 0})}const Sp=new L;class Re{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ie(this)}}),this.parser=t,this.extension=[xt.of(this),N.languageData.of((r,o,l)=>{let a=xl(r,o,l),h=a.type.prop(Pt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Sp);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return xl(e,t,i).type.prop(Pt)==this.data}findRegions(e){let t=e.facet(xt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Pt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Pt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Mi(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ie(n){let e=n.field(Re.state,!1);return e?e.tree:z.empty}class vp{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ri=null;class Gt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Gt(e,t,[],z.empty,0,i,[],null)}startParse(){return this.parser.startParse(new vp(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=z.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Tt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ri;ri=this;try{return e()}finally{ri=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ol(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Tt.applyChanges(i,a),s=z.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ol(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends zr{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=ri;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new z(ye.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ri}}function Ol(n,e,t){return Tt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Kt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Kt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Gt.create(e.facet(xt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Kt(i)}}Re.state=le.define({create:Kt.init,update(n,e){for(let t of e.effects)if(t.is(Re.setState))return t.value;return e.startState.facet(xt)!=e.state.facet(xt)?Kt.init(e.state):n.apply(e)}});let Wh=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Wh=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const xs=typeof navigator<"u"&&(!((bs=navigator.scheduling)===null||bs===void 0)&&bs.isInputPending)?()=>navigator.scheduling.isInputPending():null,Cp=K.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Re.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Re.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Wh(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>xs&&xs()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Re.setState.of(new Kt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xt=A.define({combine(n){return n.length?n[0]:null},enables:n=>[Re.state,Cp,P.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class $h{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const zh=A.define(),Fr=A.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Bt(n){let e=n.facet(Fr);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Ti(n,e){let t="",i=n.tabSize,s=n.facet(Fr)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?Ap(n,t,e):null}class Kn{constructor(e,t={}){this.state=e,this.options=t,this.unit=Bt(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Jt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const qr=new L;function Ap(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Vh(i,n,t)}function Vh(n,e,t){for(let i=n;i;i=i.next){let s=Mp(i.node);if(s)return s(Ur.create(e,t,i))}return 0}function Pp(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Mp(n){let e=n.type.prop(qr);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Bp(o,!0,1,void 0,r&&!Pp(o)?s.from:void 0)}return n.parent==null?Tp:null}function Tp(){return 0}class Ur extends Kn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Ur(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Dp(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Vh(this.context.next,this.base,this.pos)}}function Dp(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Rp(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Ep=200;function Lp(){return N.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+Ep)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=Hr(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Ti(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const Ip=A.define(),Xr=new L;function Fh(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function Qp(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Bn(n,e,t){for(let i of n.facet(Ip)){let s=i(n,e,t);if(s)return s}return Np(n,e,t)}function Hh(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Yn=R.define({map:Hh}),Wi=R.define({map:Hh});function qh(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Et=le.define({create(){return D.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(Yn)&&!Wp(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(jr),s=i?D.replace({widget:new Up(i(e.state,t.value))}):kl;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(Wi)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(s,r)=>{si&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,r)=>r<=i||s>=i}))}return n},provide:n=>P.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Wp(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function Uh(n,e){return n.field(Et,!1)?e:e.concat(R.appendConfig.of(jh()))}const $p=n=>{for(let e of qh(n)){let t=Bn(n.state,e.from,e.to);if(t)return n.dispatch({effects:Uh(n.state,[Yn.of(t),Xh(n,t)])}),!0}return!1},zp=n=>{if(!n.state.field(Et,!1))return!1;let e=[];for(let t of qh(n)){let i=En(n.state,t.from,t.to);i&&e.push(Wi.of(i),Xh(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Xh(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return P.announce.of("".concat(n.state.phrase(t?"Folded lines":"Unfolded lines")," ").concat(i," ").concat(n.state.phrase("to")," ").concat(s,"."))}const Vp=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(Et,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(Wi.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},Hp=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:$p},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:zp},{key:"Ctrl-Alt-[",run:Vp},{key:"Ctrl-Alt-]",run:Fp}],qp={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},jr=A.define({combine(n){return _e(n,qp)}});function jh(n){let e=[Et,Gp];return n&&e.push(jr.of(n)),e}function Gh(n,e){let{state:t}=n,i=t.facet(jr),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=En(n.state,l.from,l.to);a&&n.dispatch({effects:Wi.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const kl=D.replace({widget:new class extends Ot{toDOM(n){return Gh(n,null)}}});class Up extends Ot{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Gh(e,this.value)}}const Xp={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Os extends nt{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function jp(n={}){let e=Object.assign(Object.assign({},Xp),n),t=new Os(e,!0),i=new Os(e,!1),s=K.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(xt)!=o.state.facet(xt)||o.startState.field(Et,!1)!=o.state.field(Et,!1)||ie(o.startState)!=ie(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new mt;for(let a of o.viewportLineBlocks){let h=En(o.state,a.from,a.to)?i:Bn(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,_d({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||W.empty},initialSpacer(){return new Os(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=En(o.state,l.from,l.to);if(h)return o.dispatch({effects:Wi.of(h)}),!0;let c=Bn(o.state,l.from,l.to);return c?(o.dispatch({effects:Yn.of(c)}),!0):!1}})}),jh()]}const Gp=P.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class _n{constructor(e,t){this.specs=e;let i;function s(l){let a=gt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Re?l=>l.prop(Pt)==o.data:o?l=>l==o:void 0,this.style=Nh(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new gt(i):null,this.themeType=t.themeType}static define(e,t){return new _n(e,t||{})}}const pr=A.define(),Kh=A.define({combine(n){return n.length?[n[0]]:null}});function ks(n){let e=n.facet(pr);return e.length?e:n.facet(Kh)}function Kp(n,e){let t=[_p],i;return n instanceof _n&&(n.module&&t.push(P.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Kh.of(n)):i?t.push(pr.computeN([P.darkTheme],s=>s.facet(P.darkTheme)==(i=="dark")?[n]:[])):t.push(pr.of(n)),t}class Yp{constructor(e){this.markCache=Object.create(null),this.tree=ie(e.state),this.decorations=this.buildDeco(e,ks(e.state))}update(e){let t=ie(e.state),i=ks(e.state),s=i!=ks(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=D.mark({class:a})))},s,r);return i.finish()}}const _p=Zt.high(K.fromClass(Yp,{decorations:n=>n.decorations})),Zp=_n.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Jp=P.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Yh=1e4,_h="()[]{}",Zh=A.define({combine(n){return _e(n,{afterCursor:!0,brackets:_h,maxScanDistance:Yh,renderMatch:im})}}),em=D.mark({class:"cm-matchingBracket"}),tm=D.mark({class:"cm-nonmatchingBracket"});function im(n){let e=[],t=n.matched?em:tm;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const nm=le.define({create(){return D.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Zh);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=je(e.state,s.head,-1,i)||s.head>0&&je(e.state,s.head-1,1,i)||i.afterCursor&&(je(e.state,s.head,1,i)||s.headP.decorations.from(n)}),sm=[nm,Jp];function rm(n={}){return[Zh.of(n),sm]}const om=new L;function mr(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function gr(n){let e=n.type.prop(om);return e?e(n.node):n}function je(n,e,t,i={}){let s=i.maxScanDistance||Yh,r=i.brackets||_h,o=ie(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=mr(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return lm(n,e,t,a,c,h,r)}}return am(n,e,t,o,l.type,s,r)}function lm(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,m=t>0?d.length:-1;g!=m;g+=t){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function wl(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function hm(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||cm,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Kr}}function cm(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Sl=new WeakMap;class ec extends Re{constructor(e){let t=Qh(e.languageData),i=hm(e),s,r=new class extends zr{createParse(o,l,a){return new um(s,o,l,a)}};super(t,r,[zh.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=mm(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new sc(i.tokenTable):pm}static define(e){return new ec(e)}getIndent(e,t){let i=ie(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Sl.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof z&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&Gr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=tc(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?Bt(i):4),tree:z.empty}}let um=class{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Gt.get(),o=s[0].from,{state:l,tree:a}=fm(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t=="\n"&&(t="");else{let i=t.indexOf("\n");i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Jh(t,e?e.state.tabSize:4,e?Bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=ic(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const Kr=Object.create(null),Di=[ye.none],dm=new Gn(Di),vl=[],nc=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])nc[n]=rc(Kr,e);class sc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),nc)}resolve(e){return e?this.table[e]||(this.table[e]=rc(this.extra,e)):0}}const pm=new sc(Kr);function ws(n,e){vl.indexOf(n)>-1||(vl.push(n),console.warn(e))}function rc(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||b[r];o?typeof o=="function"?t?t=o(t):ws(r,"Modifier ".concat(r," used at start of tag")):t?ws(r,"Tag ".concat(r," used as modifier")):t=o:ws(r,"Unknown highlighting tag ".concat(r))}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ye.define({id:Di.length,name:i,props:[Vr({[i]:t})]});return Di.push(s),s.id}function mm(n){let e=ye.define({id:Di.length,name:"Document",props:[Pt.add(()=>n)],top:!0});return Di.push(e),e}const gm=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=_r(n.state,t.from);return i.line?ym(n):i.block?xm(n):!1};function Yr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ym=Yr(wm,0),bm=Yr(oc,0),xm=Yr((n,e)=>oc(n,e,km(e)),0);function _r(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const oi=50;function Om(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-oi,i),o=n.sliceDoc(s,s+oi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*oi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+oi),f=n.sliceDoc(s-oi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function km(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function oc(n,e,t=e.selection.ranges){let i=t.map(r=>_r(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Om(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const yr=st.define(),Sm=st.define(),vm=A.define(),lc=A.define({combine(n){return _e(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Cm(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const ac=le.define({create(){return Ge.empty},update(n,e){let t=e.state.facet(lc),i=e.annotation(yr);if(i){let a=e.docChanged?x.single(Cm(e.changes)):void 0,h=ke.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=Ln(f,f.length,t.minDepth,h):f=fc(f,e.startState.selection),new Ge(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Sm);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(te.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ke.fromTransaction(e),o=e.annotation(te.time),l=e.annotation(te.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ge(n.done.map(ke.fromJSON),n.undone.map(ke.fromJSON))}});function Am(n={}){return[ac,lc.of(n),P.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?hc:e.inputType=="historyRedo"?br:null;return i?(e.preventDefault(),i(t)):!1}})]}function Zn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(ac,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const hc=Zn(0,!1),br=Zn(1,!1),Pm=Zn(0,!0),Mm=Zn(1,!0);class ke{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ke(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ke(e.changes&&J.fromJSON(e.changes),[],e.mapped&&Ke.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=Be;for(let s of e.startState.facet(vm)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Be)}static selection(e){return new ke(void 0,Be,void 0,void 0,e)}}function Ln(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Tm(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Dm(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function cc(n,e){return n.length?e.length?n.concat(e):n:e}const Be=[],Rm=200;function fc(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Rm));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Ln(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function Bm(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Ss(n,e){if(!n.length)return n;let t=n.length,i=Be;for(;t;){let s=Em(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ke.selection(i)]:Be}function Em(n,e,t){let i=cc(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Be,t);if(!n.changes)return ke.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ke(s,R.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Lm=/^(input\.type|delete)($|\.)/;class Ge{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ge(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Lm.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Jn(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==X.LTR}const dc=n=>uc(n,!de(n)),pc=n=>uc(n,de(n));function mc(n,e){return Qe(n,t=>t.empty?n.moveByGroup(t,e):Jn(t,e))}const Nm=n=>mc(n,!de(n)),Qm=n=>mc(n,de(n));function Wm(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function es(n,e,t){let i=ie(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Wm(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?je(n,i.from,1):je(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}const $m=n=>Qe(n,e=>es(n.state,e,!de(n))),zm=n=>Qe(n,e=>es(n.state,e,de(n)));function gc(n,e){return Qe(n,t=>{if(!t.empty)return Jn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const yc=n=>gc(n,!1),bc=n=>gc(n,!0);function xc(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Jn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomOc(n,!1),xr=n=>Oc(n,!0);function kt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=x.cursor(i.from+r))}return s}const Vm=n=>Qe(n,e=>kt(n,e,!0)),Fm=n=>Qe(n,e=>kt(n,e,!1)),Hm=n=>Qe(n,e=>kt(n,e,!de(n))),qm=n=>Qe(n,e=>kt(n,e,de(n))),Um=n=>Qe(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),Xm=n=>Qe(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function jm(n,e,t){let i=!1,s=ei(n.selection,r=>{let o=je(n,r.head,-1)||je(n,r.head,1)||r.head>0&&je(n,r.head-1,1)||r.headjm(n,e,!1);function Le(n,e){let t=ei(n.state.selection,i=>{let s=e(i);return x.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ze(n.state,t)),!0)}function kc(n,e){return Le(n,t=>n.moveByChar(t,e))}const wc=n=>kc(n,!de(n)),Sc=n=>kc(n,de(n));function vc(n,e){return Le(n,t=>n.moveByGroup(t,e))}const Km=n=>vc(n,!de(n)),Ym=n=>vc(n,de(n)),_m=n=>Le(n,e=>es(n.state,e,!de(n))),Zm=n=>Le(n,e=>es(n.state,e,de(n)));function Cc(n,e){return Le(n,t=>n.moveVertically(t,e))}const Ac=n=>Cc(n,!1),Pc=n=>Cc(n,!0);function Mc(n,e){return Le(n,t=>n.moveVertically(t,e,xc(n).height))}const Al=n=>Mc(n,!1),Pl=n=>Mc(n,!0),Jm=n=>Le(n,e=>kt(n,e,!0)),eg=n=>Le(n,e=>kt(n,e,!1)),tg=n=>Le(n,e=>kt(n,e,!de(n))),ig=n=>Le(n,e=>kt(n,e,de(n))),ng=n=>Le(n,e=>x.cursor(n.lineBlockAt(e.head).from)),sg=n=>Le(n,e=>x.cursor(n.lineBlockAt(e.head).to)),Ml=({state:n,dispatch:e})=>(e(Ze(n,{anchor:0})),!0),Tl=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.doc.length})),!0),Dl=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.selection.main.anchor,head:0})),!0),Rl=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),rg=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),og=({state:n,dispatch:e})=>{let t=ts(n).map(({from:i,to:s})=>x.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:"select"})),!0},lg=({state:n,dispatch:e})=>{let t=ei(n.selection,i=>{var s;let r=ie(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return x.range(l.to,l.from)}return i});return e(Ze(n,t)),!0},ag=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Ze(n,i)),!0):!1};function $i(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=rn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=rn(n,o,!1),l=rn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:x.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Tc=(n,e)=>$i(n,t=>{let i=t.from,{state:s}=n,r=s.doc.lineAt(i),o,l;if(!e&&i>r.from&&iTc(n,!1),Dc=n=>Tc(n,!0),Rc=(n,e)=>$i(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ue(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Bc=n=>Rc(n,!1),hg=n=>Rc(n,!0),cg=n=>$i(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head$i(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ug=n=>$i(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Q.of(["",""])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},pg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ue(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ue(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ts(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Ec(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of ts(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const mg=({state:n,dispatch:e})=>Ec(n,e,!1),gg=({state:n,dispatch:e})=>Ec(n,e,!0);function Lc(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of ts(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const yg=({state:n,dispatch:e})=>Lc(n,e,!1),bg=({state:n,dispatch:e})=>Lc(n,e,!0),xg=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(ts(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Og(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ie(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const kg=Ic(!1),wg=Ic(!0);function Ic(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Og(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Kn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Hr(h,r);for(c==null&&(c=Jt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:x.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Sg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Kn(n,{overrideIndentation:r=>{let o=t[r];return o==null?-1:o}}),s=Zr(n,(r,o,l)=>{let a=Hr(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Ti(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(Zr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Fr)})}),{userEvent:"input.indent"})),!0),Qc=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Zr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Jt(s,n.tabSize),o=0,l=Ti(n,Math.max(0,r-Bt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Ag=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$m,shift:_m},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:zm,shift:Zm},{key:"Alt-ArrowUp",run:mg},{key:"Shift-Alt-ArrowUp",run:yg},{key:"Alt-ArrowDown",run:gg},{key:"Shift-Alt-ArrowDown",run:bg},{key:"Escape",run:ag},{key:"Mod-Enter",run:wg},{key:"Alt-l",mac:"Ctrl-l",run:og},{key:"Mod-i",run:lg,preventDefault:!0},{key:"Mod-[",run:Qc},{key:"Mod-]",run:Nc},{key:"Mod-Alt-\\",run:Sg},{key:"Shift-Mod-k",run:xg},{key:"Shift-Mod-\\",run:Gm},{key:"Mod-/",run:gm},{key:"Alt-A",run:bm}].concat(Cg),Iy={key:"Tab",run:Nc,shift:Qc};function V(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Yt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Bl(l)):Bl,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return re(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=vr(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=De(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=In(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new qt(t,e.sliceString(t,i));return vs.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=In(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=qt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(zc.prototype[Symbol.iterator]=Vc.prototype[Symbol.iterator]=function(){return this});function Pg(n){try{return new RegExp(n,Jr),!0}catch{return!1}}function In(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function kr(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=V("input",{class:"cm-textfield",name:"line",value:e}),i=V("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Nn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},V("label",n.state.phrase("Go to line"),": ",t)," ",V("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=x.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Nn.of(!1),P.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:i}}const Nn=R.define(),El=le.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Nn)&&(n=t.value);return n},provide:n=>Ai.from(n,e=>e?kr:null)}),Mg=n=>{let e=Ci(n,kr);if(!e){let t=[Nn.of(!0)];n.state.field(El,!1)==null&&t.push(R.appendConfig.of([El,Tg])),n.dispatch({effects:t}),e=Ci(n,kr)}return e&&e.dom.querySelector("input").select(),!0},Tg=P.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Dg={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Fc=A.define({combine(n){return _e(n,Dg,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Rg(n){let e=[Ng,Ig];return n&&e.push(Fc.of(n)),e}const Bg=D.mark({class:"cm-selectionMatch"}),Eg=D.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ll(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=U.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=U.Word)}function Lg(n,e,t,i){return n(e.sliceDoc(t,t+1))==U.Word&&n(e.sliceDoc(i-1,i))==U.Word}const Ig=K.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Fc),{state:t}=n,i=t.selection;if(i.ranges.length>1)return D.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return D.none;let a=t.wordAt(s.head);if(!a)return D.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return D.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Ll(o,t,s.from,s.to)&&Lg(o,t,s.from,s.to)))return D.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return D.none}let l=[];for(let a of n.visibleRanges){let h=new Yt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Ll(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Eg.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Bg.range(c,f)),l.length>e.maxMatches))return D.none}}return D.set(l)}},{decorations:n=>n.decorations}),Ng=P.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Qg=({state:n,dispatch:e})=>{let{selection:t}=n,i=x.create(t.ranges.map(s=>n.wordAt(s.head)||x.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Wg(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Yt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Yt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const $g=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Qg({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Wg(n,i);return s?(e(n.update({selection:n.selection.addRange(x.range(s.from,s.to),!1),effects:P.scrollIntoView(s.to)})),!0):!1},ti=A.define({combine(n){return _e(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new _g(e),scrollToMatch:e=>P.scrollIntoView(e)})}});class Hc{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Pg(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?"\n":i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Hg(this):new Vg(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Wt(this,s,t,i):Qt(this,s,t,i)}}class qc{constructor(e){this.spec=e}}function Qt(n,e,t,i){return new Yt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?zg(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function zg(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Qt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Wt(n,e,t,i){return new zc(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Fg(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Qn(n,e){return n.slice(ue(n,e,!1),e)}function Wn(n,e){return n.slice(e,ue(n,e))}function Fg(n){return(e,t,i)=>!i[0].length||(n(Qn(i.input,i.index))!=U.Word||n(Wn(i.input,i.index))!=U.Word)&&(n(Wn(i.input,i.index+i[0].length))!=U.Word||n(Qn(i.input,i.index+i[0].length))!=U.Word)}class Hg extends qc{nextMatch(e,t,i){let s=Wt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Wt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Wt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Wt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ri=R.define(),eo=R.define(),dt=le.define({create(n){return new Cs(wr(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ri)?n=new Cs(t.value.create(),n.panel):t.is(eo)&&(n=new Cs(n.query,t.value?to:null));return n},provide:n=>Ai.from(n,e=>e.panel)});class Cs{constructor(e,t){this.query=e,this.panel=t}}const qg=D.mark({class:"cm-searchMatch"}),Ug=D.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Xg=K.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(dt))}update(n){let e=n.state.field(dt);(e!=n.startState.field(dt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return D.none;let{view:t}=this,i=new mt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Ug:qg)})}return i.finish()}},{decorations:n=>n.decorations});function zi(n){return e=>{let t=e.state.field(dt,!1);return t&&t.query.spec.valid?n(e,t):jc(e)}}const $n=zi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=x.single(i.from,i.to),r=n.state.facet(ti);return n.dispatch({selection:s,effects:[io(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Xc(n),!0}),zn=zi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=x.single(s.from,s.to),o=n.state.facet(ti);return n.dispatch({selection:r,effects:[io(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Xc(n),!0}),jg=zi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:x.create(t.map(i=>x.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Gg=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Yt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(x.range(l.value.from,l.value.to))}return e(n.update({selection:x.create(r,o),userEvent:"select.search.matches"})),!0},Il=zi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(P.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=x.single(r.from-c,r.to-c),h.push(io(n,r)),h.push(t.facet(ti).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Kg=zi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:P.announce.of(i),userEvent:"input.replace.all"}),!0});function to(n){return n.state.facet(ti).createPanel(n)}function wr(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(ti);return new Hc({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Uc(n){let e=Ci(n,to);return e&&e.dom.querySelector("[main-field]")}function Xc(n){let e=Uc(n);e&&e==n.root.activeElement&&e.select()}const jc=n=>{let e=n.state.field(dt,!1);if(e&&e.panel){let t=Uc(n);if(t&&t!=n.root.activeElement){let i=wr(n.state,e.query.spec);i.valid&&n.dispatch({effects:Ri.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[eo.of(!0),e?Ri.of(wr(n.state,e.query.spec)):R.appendConfig.of(Jg)]});return!0},Gc=n=>{let e=n.state.field(dt,!1);if(!e||!e.panel)return!1;let t=Ci(n,to);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:eo.of(!1)}),!0},Yg=[{key:"Mod-f",run:jc,scope:"editor search-panel"},{key:"F3",run:$n,shift:zn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:$n,shift:zn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Gc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Gg},{key:"Alt-g",run:Mg},{key:"Mod-d",run:$g,preventDefault:!0}];class _g{constructor(e){this.view=e;let t=this.query=e.state.field(dt).query.spec;this.commit=this.commit.bind(this),this.searchField=V("input",{value:t.search,placeholder:ve(e,"Find"),"aria-label":ve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=V("input",{value:t.replace,placeholder:ve(e,"Replace"),"aria-label":ve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=V("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=V("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=V("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return V("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=V("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>$n(e),[ve(e,"next")]),i("prev",()=>zn(e),[ve(e,"previous")]),i("select",()=>jg(e),[ve(e,"all")]),V("label",null,[this.caseField,ve(e,"match case")]),V("label",null,[this.reField,ve(e,"regexp")]),V("label",null,[this.wordField,ve(e,"by word")]),...e.state.readOnly?[]:[V("br"),this.replaceField,i("replace",()=>Il(e),[ve(e,"replace")]),i("replaceAll",()=>Kg(e),[ve(e,"replace all")])],V("button",{name:"close",onclick:()=>Gc(e),"aria-label":ve(e,"close"),type:"button"},["×"])])}commit(){let e=new Hc({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ri.of(e)}))}keydown(e){hd(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zn:$n)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Il(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Ri)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ti).top}}function ve(n,e){return n.state.phrase(e)}const on=30,ln=/[\s\.,:;?!]/;function io(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-on),o=Math.min(s,t+on),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-on;a--)if(!ln.test(l[a-1])&&ln.test(l[a])){l=l.slice(0,a);break}}return P.announce.of("".concat(n.state.phrase("current match"),". ").concat(l," ").concat(n.state.phrase("on line")," ").concat(i.number,"."))}const Zg=P.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Jg=[dt,Zt.low(Xg),Zg];class Kc{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ie(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Yc(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Nl(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),"[".concat(t?"\\w":"").concat(e.replace(/[^\w\s]/g,"\\$&"),"]")}function e0(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:e0(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}class Ql{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function pt(n){return n.selection.main.from}function Yc(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp("".concat(s?"^":"","(?:").concat(i,")").concat(r?"$":""),(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const i0=st.define();function n0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:x.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Wl=new WeakMap;function s0(n){if(!Array.isArray(n))return n;let e=Wl.get(n);return e||Wl.set(n,e=t0(n)),e}const no=R.define(),Bi=R.define();class r0{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=vr(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||T==1&&m||O==0&&T!=0)&&(t[f]==k||i[f]==k&&(u=!0)?o[f++]=w:o.length&&(y=!1)),O=T,w+=De(k)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?De(re(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const we=A.define({combine(n){return _e(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:o0,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>$l(e(i),t(i)),optionClass:(e,t)=>i=>$l(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function $l(n,e){return n?e?n+" "+e:n:e}function o0(n,e,t,i,s,r){let o=n.textDirection==X.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u=g||w>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let m=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:"".concat(h,": ").concat(c/m,"px; max-width: ").concat(f/y,"px"),class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function l0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function zl(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class a0{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(we);this.optionContent=l0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=zl(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(we).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Bi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=zl(t.options.length,t.selected,this.view.state.facet(we).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ie(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&c0(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew a0(t,n,e)}function c0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function Vl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function f0(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new Ql(c,a.source,h?h(c):[],1e9-t.length));else{let c=new r0(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new Ql(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):Vl(a.completion)>Vl(o)&&(r[r.length-1]=a),o=a.completion}return r}class zt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new zt(this.options,Fl(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=f0(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new zt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(we).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:h0(Pe,Jc),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new zt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Vn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Vn(p0,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(we),r=(i.override||t.languageDataAt("autocomplete",pt(t)).map(s0)).map(l=>(this.active.find(h=>h.source==l)||new Oe(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!u0(r,this.active)?o=zt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new Oe(l.source,0):l));for(let l of e.effects)l.is(Zc)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:d0}}function u0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const p0=[];function Sr(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Oe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Sr(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new Oe(s.source,0));for(let r of e.effects)if(r.is(no))s=new Oe(s.source,1,r.value?pt(e.state):-1);else if(r.is(Bi))s=new Oe(s.source,0);else if(r.is(_c))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Oe(this.source,1)}handleChange(e){return e.changes.touchesRange(pt(e.startState))?new Oe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Oe(this.source,this.state,e.mapPos(this.explicitPos))}}class Ut extends Oe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=pt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&pt(e.startState)==this.from)return new Oe(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return m0(this.result.validFor,e.state,r,o)?new Ut(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Kc(e.state,l,a>=0)))?new Ut(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:pt(e.state)):new Oe(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Oe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ut(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function m0(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Yc(n,!0).test(s)}const _c=R.define({map(n,e){return n.map(t=>t.map(e))}}),Zc=R.define(),Pe=le.define({create(){return Vn.start()},update(n,e){return n.update(e)},provide:n=>[Ir.from(n,e=>e.tooltip),P.contentAttributes.from(n,e=>e.attrs)]});function Jc(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Pe).active.find(s=>s.source==e.source);return i instanceof Ut?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},n0(n.state,t,i.from,i.to)),{annotations:i0.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function an(n,e="option"){return t=>{let i=t.state.field(Pe,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Zc.of(l)}),!0}}const g0=n=>{let e=n.state.field(Pe,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Pe,!1)?(n.dispatch({effects:no.of(!0)}),!0):!1,b0=n=>{let e=n.state.field(Pe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Bi.of(null)}),!0)};class x0{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Hl=50,O0=50,k0=1e3,w0=K.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Pe).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Pe);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Pe)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Sr(i));for(let i=0;iO0&&Date.now()-s.time>k0){for(let r of s.context.abortListeners)try{r()}catch(o){Ie(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),Hl):-1,this.composing!=0)for(let i of n.transactions)Sr(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Pe);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=pt(e),i=new Kc(e,t,n.explicitPos==t),s=new x0(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Hl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(we);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new Oe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:_c.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Pe,!1);if(e&&e.tooltip&&this.view.state.facet(we).closeOnBlur){let t=e.open&&Ph(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:Bi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:no.of(!1)}),20),this.composing=0}}}),S0=P.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Ei={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Mt=R.define({map(n,e){let t=e.mapPos(n,-1,pe.TrackAfter);return t==null?void 0:t}}),so=new class extends Dt{};so.startSide=1;so.endSide=-1;const ef=le.define({create(){return W.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=W.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(Mt)&&(n=n.update({add:[so.range(t.value,t.value+1)]}));return n}});function v0(){return[A0,ef]}const As="()[]{}<>";function tf(n){for(let e=0;e{if((C0?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&De(re(i,0))==1||e!=s.from||t!=s.to)return!1;let r=T0(n.state,i);return r?(n.dispatch(r),!0):!1}),P0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=nf(n,n.selection.main.head).brackets||Ei.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=D0(n.doc,o.head);for(let a of i)if(a==l&&is(n.doc,o.head)==tf(re(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:x.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},M0=[{key:"Backspace",run:P0}];function T0(n,e){let t=nf(n,n.selection.main.head),i=t.brackets||Ei.brackets;for(let s of i){let r=tf(re(s,0));if(e==s)return r==s?E0(n,s,i.indexOf(s+s+s)>-1,t):R0(n,s,r,t.before||Ei.before);if(e==r&&sf(n,n.selection.main.from))return B0(n,s,r)}return null}function sf(n,e){let t=!1;return n.field(ef).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function is(n,e){let t=n.sliceString(e,e+2);return t.slice(0,De(re(t,0)))}function D0(n,e){let t=n.sliceString(e-2,e);return De(re(t,0))==t.length?t:t.slice(1)}function R0(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Mt.of(o.to+e.length),range:x.range(o.anchor+e.length,o.head+e.length)};let l=is(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Mt.of(o.head+e.length),range:x.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function B0(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&is(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:x.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function E0(n,e,t,i){let s=i.stringPrefixes||Ei.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Mt.of(l.to+e.length),range:x.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=is(n.doc,a),c;if(h==e){if(ql(n,a))return{changes:{insert:e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)};if(sf(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:x.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=Ul(n,a-2*e.length,s))>-1&&ql(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=U.Word&&Ul(n,a,s)>-1&&!L0(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ql(n,e){let t=ie(n).resolveInner(e+1);return t.parent&&t.from==e}function L0(n,e,t,i){let s=ie(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Ul(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=U.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=U.Word)return r}return-1}function I0(n={}){return[Pe,we.of(n),w0,N0,S0]}const rf=[{key:"Ctrl-Space",run:y0},{key:"Escape",run:b0},{key:"ArrowDown",run:an(!0)},{key:"ArrowUp",run:an(!1)},{key:"PageDown",run:an(!0,"page")},{key:"PageUp",run:an(!1,"page")},{key:"Enter",run:g0}],N0=Zt.highest(Lr.computeN([we],n=>n.facet(we).defaultKeymap?[rf]:[]));class Q0{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Ct{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,r=i.facet(af).markerFilter;r&&(s=r(s));let o=D.set(s.map(l=>l.from==l.to||l.from==l.to-1&&i.doc.lineAt(l.from).to==l.from?D.widget({widget:new X0(l),diagnostic:l}).range(l.from):D.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Ct(o,t,_t(o))}}function _t(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostic!=e))return i=new Q0(s,r,o.diagnostic),!1}),i}function W0(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(of))||n.changes.touchesRange(t.from,t.to))}function $0(n,e){return n.field(Te,!1)?e:e.concat(R.appendConfig.of(K0))}const of=R.define(),ro=R.define(),lf=R.define(),Te=le.define({create(){return new Ct(D.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=_t(t,n.selected.diagnostic,s)||_t(t,null,s)}n=new Ct(t,n.panel,i)}for(let t of e.effects)t.is(of)?n=Ct.init(t.value,n.panel,e.state):t.is(ro)?n=new Ct(n.diagnostics,t.value?ns.open:null,n.selected):t.is(lf)&&(n=new Ct(n.diagnostics,n.panel,t.value));return n},provide:n=>[Ai.from(n,e=>e.panel),P.decorations.from(n,e=>e.diagnostics)]}),z0=D.mark({class:"cm-lintRange cm-lintRange-active"});function V0(n,e,t){let{diagnostics:i}=n.state.field(Te),s=[],r=2e8,o=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{e>=a&&e<=h&&(a==h||(e>a||t>0)&&(ecf(n,t,!1)))}const H0=n=>{let e=n.state.field(Te,!1);(!e||!e.panel)&&n.dispatch({effects:$0(n.state,[ro.of(!0)])});let t=Ci(n,ns.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Xl=n=>{let e=n.state.field(Te,!1);return!e||!e.panel?!1:(n.dispatch({effects:ro.of(!1)}),!0)},q0=n=>{let e=n.state.field(Te,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},U0=[{key:"Mod-Shift-m",run:H0,preventDefault:!0},{key:"F8",run:q0}],af=A.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},_e(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function hf(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function cf(n,e,t){var i;let s=t?hf(e.actions):[];return V("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},V("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=_t(n.state.field(Te).diagnostics,e);d&&r.apply(n,d.from,d.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),V("u",h.slice(c,c+1)),h.slice(c+1)];return V("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":" Action: ".concat(h).concat(c<0?"":' (access key "'.concat(s[o],')"'),".")},f)}),e.source&&V("div",{class:"cm-diagnosticSource"},e.source))}class X0 extends Ot{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return V("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class jl{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=cf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ns{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)Xl(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=hf(r.actions);for(let l=0;l{for(let r=0;rXl(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Te).selected;if(!e)return-1;for(let t=0;t{let h=-1,c;for(let f=i;fi&&(this.items.splice(i,h-i),s=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),r=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),i++});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Te),i=_t(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:lf.of(i)})}static open(e){return new ns(e)}}function j0(n,e='viewBox="0 0 40 40"'){return'url(\'data:image/svg+xml,").concat(encodeURIComponent(n),"')")}function hn(n){return j0(''),'width="6" height="3"')}const G0=P.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:hn("#d11")},".cm-lintRange-warning":{backgroundImage:hn("orange")},".cm-lintRange-info":{backgroundImage:hn("#999")},".cm-lintRange-hint":{backgroundImage:hn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),K0=[Te,P.decorations.compute([Te],n=>{let{selected:e,panel:t}=n.field(Te);return!e||!t||e.from==e.to?D.none:D.set([z0.range(e.from,e.to)])}),Gd(V0,{hideOn:W0}),G0],Ny=(()=>[np(),op(),Ad(),Am(),jp(),md(),Od(),N.allowMultipleSelections.of(!0),Lp(),Kp(Zp,{fallback:!0}),rm(),v0(),I0(),Wd(),Vd(),Bd(),Rg(),Lr.of([...M0,...Ag,...Yg,...Im,...Hp,...rf,...U0])])();class Fn{constructor(e,t,i,s,r,o,l,a,h,c=0,f){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return"[".concat(this.stack.filter((e,t)=>t%3==0).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}static start(e,t,i=0){let s=e.parser.context;return new Fn(e,[],t,i,i,0,[],0,s?new Gl(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p,o=r.dynamicPrecedence(s);if(o&&(this.score+=o),i==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(s,a)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==i)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i,s){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=s,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,s,4);else{let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,i),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,s,4)}}apply(e,t,i,s){e&65536?this.reduce(e):this.shift(e,t,i,s)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new Fn(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Y0(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Gl{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Y0{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class Hn{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Hn(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Hn(this.stack,this.pos,this.index)}}function ui(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,s=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class xn{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Kl=new xn;class _0{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Kl,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Kl,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}}class Xt{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;uf(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Xt.prototype.contextual=Xt.prototype.fallback=Xt.prototype.extend=!1;class ff{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?ui(e):e}token(e,t){let i=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(uf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(i,e.token),e.acceptToken(this.elseToken,s))}}ff.prototype.contextual=Xt.prototype.fallback=Xt.prototype.extend=!1;class oo{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function uf(n,e,t,i,s,r){let o=0,l=1<0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||Z0(p,e.token.value,s,r))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f>1,p=h+d+(d<<1),g=n[p],m=n[p+1]||65536;if(c=m)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function Yl(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function Z0(n,e,t,i){let s=Yl(t,i,e);return s<0||Yl(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class J0{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?_l(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_l(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof z){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class ey{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new xn)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new xn,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new xn,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;re.bufferLength*4?new J0(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(l);else{if(this.advanceStack(l,i,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=s&&ny(s);if(o)return Ce&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ce&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return Ce&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(L.contextHash)||0)==c))return e.useNode(f,u),Ce&&console.log(o+this.stackID(e)+" (via reuse of ".concat(r.getName(f.type.id),")")),!0;if(!(f instanceof z)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof z&&f.positions[0]==0)f=d;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ce&&console.log(o+this.stackID(e)+" (via always-reduce ".concat(r.getName(l&65535),")")),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hs?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Zl(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Ce&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;f.forceReduce()&&d<10&&(Ce&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)Ce&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Ce&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ce&&console.log(c+this.stackID(l)+" (via recover-delete ".concat(this.parser.getName(a),")")),Zl(l,i)):(!s||s.scoree.topRules[l][1]),s=[];for(let l=0;l=0)r(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)r(l[h++],a,f);h++}}}this.nodeSet=new Gn(t.map((l,a)=>ye.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rh;let o=ui(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Xt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new ty(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&i)return a;for(let h=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Je(this.data,r+2);else break;s=t(Je(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Je(this.data,i+2);else break;if(!(this.data[i+2]&1)){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(Li.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError("Invalid top rule name ".concat(e.top));t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=Jl(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;ri)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const sy=Vr({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),ry=Li.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[sy],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),oy=Mi.define({name:"json",parser:ry.configure({props:[qr.add({Object:dr({except:/^\s*\}/}),Array:dr({except:/^\s*\]/})}),Xr.add({"Object Array":Fh})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Qy(){return new $h(oy)}const ly=96,ea=1,ay=97,hy=98,ta=2,df=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],cy=58,fy=40,pf=95,uy=91,On=45,dy=46,py=35,my=37;function qn(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function gy(n){return n>=48&&n<=57}const yy=new oo((n,e)=>{for(let t=!1,i=0,s=0;;s++){let{next:r}=n;if(qn(r)||r==On||r==pf||t&&gy(r))!t&&(r!=On||s>0)&&(t=!0),i===s&&r==On&&i++,n.advance();else{t&&n.acceptToken(r==fy?ay:i==2&&e.canShift(ta)?ta:hy);break}}}),by=new oo(n=>{if(df.includes(n.peek(-1))){let{next:e}=n;(qn(e)||e==pf||e==py||e==dy||e==uy||e==cy||e==On)&&n.acceptToken(ly)}}),xy=new oo(n=>{if(!df.includes(n.peek(-1))){let{next:e}=n;if(e==my&&(n.advance(),n.acceptToken(ea)),qn(e)){do n.advance();while(qn(n.next));n.acceptToken(ea)}}}),Oy=Vr({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),ky={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},wy={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Sy={__proto__:null,not:128,only:128},vy=Li.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[by,xy,yy,1,2,3,4,new ff("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:n=>ky[n]||-1},{term:56,get:n=>wy[n]||-1},{term:98,get:n=>Sy[n]||-1}],tokenPrec:1169});let Ms=null;function Ts(){if(!Ms&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Ms=e.sort().map(i=>({type:"property",label:i}))}return Ms||[]}const ia=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),na=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),Cy=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),rt=/^(\w[\w-]*|-\w[\w-]*|)$/,Ay=/^-(-[\w-]*)?$/;function Py(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const sa=new dp,My=["Declaration"];function Ty(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function mf(n,e,t){if(e.to-e.from>4096){let i=sa.get(e);if(i)return i;let s=[],r=new Set,o=e.cursor(ee.IncludeAnonymous);if(o.firstChild())do for(let l of mf(n,o.node,t))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return sa.set(e,s),s}else{let i=[],s=new Set;return e.cursor().iterate(r=>{var o;if(t(r)&&r.matchContext(My)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=n.sliceString(r.from,r.to);s.has(l)||(s.add(l),i.push({label:l,type:"variable"}))}}),i}}const Dy=n=>e=>{let{state:t,pos:i}=e,s=ie(t).resolveInner(i,-1),r=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Ts(),validFor:rt};if(s.name=="ValueName")return{from:s.from,options:na,validFor:rt};if(s.name=="PseudoClassName")return{from:s.from,options:ia,validFor:rt};if(n(s)||(e.explicit||r)&&Py(s,t.doc))return{from:n(s)||r?s.from:i,options:mf(t.doc,Ty(s),n),validFor:Ay};if(s.name=="TagName"){for(let{parent:a}=s;a;a=a.parent)if(a.name=="Block")return{from:s.from,options:Ts(),validFor:rt};return{from:s.from,options:Cy,validFor:rt}}if(!e.explicit)return null;let o=s.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:ia,validFor:rt}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:na,validFor:rt}:o.name=="Block"||o.name=="Styles"?{from:i,options:Ts(),validFor:rt}:null},Ry=Dy(n=>n.name=="VariableName"),ra=Mi.define({name:"css",parser:vy.configure({props:[qr.add({Declaration:dr()}),Xr.add({"Block KeyframeList":Fh})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Wy(){return new $h(ra,ra.data.of({autocomplete:Ry}))}export{P as E,_n as H,ec as S,N as a,Ny as b,Iy as c,Wy as d,Fr as i,Qy as j,Lr as k,Kp as s,b as t}; diff --git a/dirs/mainsail/assets/cz-285b76fb.js b/dirs/mainsail/assets/cz-285b76fb.js deleted file mode 100644 index 0b96537..0000000 --- a/dirs/mainsail/assets/cz-285b76fb.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{DependencyDescription:"Aktuální verze {name} nepodporuje všechny funkce aplikace Mainsail. Aktualizujte {name} alespoň na verzi {neededVersion}.",DependencyName:"Závislost: {name}",DismissAll:"Zrušit vše",KlipperWarnings:{DeprecatedOption:"Volba '{option}' v sekci '{section}' je zastaralá a bude odstraněna v budoucí verzi.",DeprecatedOptionHeadline:"Zastaralá volba Klipper",DeprecatedValue:"Hodnota '{value}' v volbě '{option}' v sekci '{section}' je zastaralá a bude odstraněna v budoucí verzi.",DeprecatedValueHeadline:"Zastaralá hodnota Klipper",KlipperWarning:"Upozornění Klipperu"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Při načítání komponenty Moonraker '{component}' byla zjištěna chyba. Zkontrolujte prosím log soubor a opravte problém.",MoonrakerWarning:"Upozornění Moonrakeru",UnparsedConfigOption:"V sekci [{section}] byla detekována nepřeložená konfigurační volba '{option}: {value}'. Může se jednat o zastaralou volbu nebo o výsledek modulu, který se nepodařilo načíst. V budoucnu to bude způsobovat chybu při spuštění.",UnparsedConfigSection:"Detekována nepřeložená konfigurační sekce [{section}]. Může se jednat o výsledek komponenty, která se nepodařilo načíst. V budoucnu to bude způsobovat chybu při spuštění."},Never:"nikdy",NextReboot:"příští restart",NoNotification:"Žádné upozornění není k dispozici",Notifications:"Upozornění",Remind:"Připomenutí:"},NumberInput:{GreaterOrEqualError:"Musí být větší nebo rovno {min}!",MustBeBetweenError:"Musí být mezi {min} a {max}!",NoEmptyAllowedError:"Vstup nesmí být prázdný!"},Printers:"Tiskárny",ThrottledStates:{DescriptionCurrentlyThrottled:"Jádro/jádra ARM rPi jsou aktuálně zpomalená.",DescriptionFrequencyCapped:"Maximální frekvence jádra/jader ARM rPi je aktuálně omezena na 1,2 GHz.",DescriptionPreviouslyFrequencyCapped:"Maximální frekvence jádra/jader ARM rPi byla alespoň jednou omezena na 1,2 GHz od posledního spuštění.",DescriptionPreviouslyTemperatureLimited:"Teplota mikrokontroléru rPi (jen 3A+/3B+) byla alespoň jednou od posledního spuštění vyšší než mezní teplota (výchozí hodnota 60 °C).",DescriptionPreviouslyThrottled:"Jádro/jádra ARM rPi byla alespoň jednou od posledního spuštění zpomalena.",DescriptionPreviouslyUnderVolted:"Napájecí napětí rPi kleslo alespoň jednou pod 4,65 V od posledního spuštění.",DescriptionTemperatureLimitActive:"Teplota mikrokontroléru rPi (jen 3A+/3B+) je aktuálně vyšší než mezní teplota (výchozí hodnota 60 °C).",DescriptionUnderVoltageDetected:"Napájecí napětí rPi je aktuálně nižší než 4,65 V.",TitleCurrentlyThrottled:"Aktuálně zpomaleno",TitleFrequencyCapped:"Frekvence omezena",TitlePreviouslyFrequencyCapped:"Frekvence dříve omezena",TitlePreviouslyTemperatureLimited:"Teplota dříve omezena",TitlePreviouslyThrottled:"Dříve zpomaleno",TitlePreviouslyUnderVolted:"Dříve podnapájecí napětí",TitleTemperatureLimitActive:"Omezení teploty aktivní",TitleUnderVoltageDetected:"Detekováno podnapájecí napětí"},Titles:{Complete:"Dokončeno - {filename}",Error:"CHYBA",Pause:"Pozastavit tisk",PrinterOff:"Tiskárna vypnuta",Printing:"{percent}% Tisk - {filename}",PrintingETA:"{percent}% Tisk - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Soubor nelze nahrát!",EmergencyStop:"Nouzové zastavení",SAVE_CONFIG:"ULOŽIT KONFIGURACI",Uploading:"Nahrávání",UploadOfFileSuccessful:"Soubor {file} byl úspěšně nahrán!",UploadPrint:"Nahrát a tisknout"},TopCornerMenu:{Cancel:"Zrušit",ConfirmationDialog:{Description:{HostReboot:"Rebootování hosta způsobí, že aktuální tisk selže!",HostShutdown:"Vypnutí hosta způsobí, že aktuální tisk selže!",KlipperFirmwareRestart:"Restartování firmware Klipperu způsobí, že aktuální tisk selže!",KlipperRestart:"Restartování Klipperu způsobí, že aktuální tisk selže!",KlipperStop:"Zastavení Klipperu způsobí, že aktuální tisk selže!",ServiceRestart:"Restartování této služby může způsobit, že aktuální tisk selže!",ServiceStart:"Spuštění této služby může způsobit, že aktuální tisk selže!",ServiceStop:"Zastavení této služby může způsobit, že aktuální tisk selže!"},Title:{HostReboot:"Rebootování hosta",HostShutdown:"Vypnutí hosta",KlipperFirmwareRestart:"Restartování firmware Klipperu",KlipperRestart:"Restartování Klipperu",ServiceRestart:"Restartování služby",ServiceStart:"Spuštění služby",ServiceStop:"Zastavení služby"}},HostControl:"Ovládání hosta",KlipperControl:"Ovládání Klipperu",KlipperFirmwareRestart:"Restartovat firmware",KlipperRestart:"Restartovat",PowerDevices:"Napájecí zařízení",Reboot:"Rebootovat",Restart:"Restartovat",ServiceControl:"Ovládání služby",Shutdown:"Vypnout",Start:"Spuštění",Stop:"Zastavení"},UpdateDialog:{Close:"Zavřít",Empty:"Prázdné",Recovering:"Obnovování {software}...",RecoveringDone:"Obnova {software} dokončena!",Updating:"Aktualizace {software}...",UpdatingDone:"Aktualizace {software} dokončena!"}},o={Abort:"Přerušit",Accept:"Přijmout",Adjusted:"Upraveno",Description:"Pokud byl aktuální šroub upraven, klikněte na UPRAVENO. Pokud nebyla žádná úprava provedena, klikněte na PŘIJMOUT.",Headline:"Šrouby podložky",ScrewAccepted:"Šrouby přijaty",ScrewIndex:"Index šroubu",ScrewName:"Název šroubu",ScrewOutput:"{current} z {max}"},t={CannotConnectTo:"Nelze se připojit k Moonraker ({host}).",CheckMoonrakerLog:"Pokud se tato zpráva opakovaně zobrazuje, prosím podívejte se do souboru logu umístěného na:",Connecting:"Připojuji se k {host}",Failed:"Spojení selhalo",Initializing:"Inicializuji",TryAgain:"zkuste to znovu"},a={CommandList:"Seznam příkazů",Empty:"Prázdné",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt záznam",SendCode:"Odeslat kód...",SetupConsole:"Nastavení konzole"},n={StartPrint:{Cancel:"Zrušit",DoYouWantToStartFilename:"Chcete začít tisk {filename}?",Headline:"Začít tisk",Print:"tisk",Timelapse:"Záznam"}},r={ConfigReference:"Odkaz na konfiguraci",DontSave:"Neukládat",Downloading:"Stahování",FailedSave:"{filename} nelze nahrát!",FileReadOnly:"jen ke čtení",SaveClose:"Uložit a zavřít",SaveRestart:"Uložit a restartovat",SuccessfullySaved:"{filename} úspěšně uloženo.",UnsavedChanges:"Neuložené změny",UnsavedChangesMessage:"Chcete uložit změny provedené v {filename}?",UnsavedChangesSubMessage:"Vaše změny budou ztraceny, pokud je neuložíte. Tuto zprávu lze vypnout v nastavení editoru.",Uploading:"Nahrávání"},i={AreYouSure:"Jste si jisti?",EmergencyStop:"Nouzové zastavení",No:"Ne",Yes:"Ano"},s={AddBatchToQueue:"Přidat dávku do fronty",AddToQueue:"Přidat do fronty",AllFiles:"Vše",BedTemp:"Teplota podložky",Cancel:"Zrušit",ChamberTemp:"Teplota komory",Count:"Počet",Create:"Vytvořit",CreateNewDirectory:"Vytvořit nový adresář",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Opravdu chcete smazat adresář "{name}" včetně všech jeho obsahů?',DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybrané soubory?",Download:"Stáhnout",EditFile:"Upravit soubor",Empty:"Prázdný",ExtruderTemp:"Teplota extrudéru",Filament:"Filament",FilamentName:"Název filamentu",FilamentType:"Typ filamentu",FilamentUsage:"Spotřeba filamentu",FilamentWeight:"Hmotnost filamentu",Files:"Soubory",Filesize:"Velikost souboru",Free:"Volné",FreeDisk:"Volné místo na disku",GCodeFiles:"Soubory G-Code",GcodesRootDirectoryDoesntExists:'Adresář s G-Code soubory neexistuje. Prosím zkontrolujte volbu "{path}" v sekci [virtual_sdcard] konfigurace Klipperu.',HiddenFiles:"Skryté soubory",InvalidNameAlreadyExists:"Název již existuje, zvolte prosím jiný název.",InvalidNameEmpty:"Vstup nesmí být prázdný!",LastEndTime:"Poslední čas ukončení",LastFilamentUsed:"Poslední použitý filament",LastModified:"Poslední změna",LastPrintDuration:"Doba posledního tisku",LastStartTime:"Poslední čas spuštění",LastTotalDuration:"Celková doba posledního tisku",LayerHeight:"Výška vrstvy",Name:"Název",NewDirectory:"Nový adresář",NozzleDiameter:"Průměr trysky",ObjectHeight:"Výška objektu",Preheat:"Předehřátí",PrintedFiles:"Vytisknuté soubory",PrintStart:"Začátek tisku",PrintTime:"Čas tisku",RefreshCurrentDirectory:"Obnovit aktuální adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Search:"Hledat",SetupCurrentList:"Nastavit aktuální seznam",Slicer:"Slicer",SuccessfullyCreated:"Úspěšně vytvořen soubor {filename}.",SuccessfullyDeleted:"Úspěšně smazán soubor {filename}.",SuccessfullyMoved:"Úspěšně přesunut soubor {filename}.",SuccessfullyRenamed:"Úspěšně přejmenován soubor {filename}.",SuccessfullyUploaded:"Nahrávání souboru {filename} úspěšné!",Total:"Celkem",UploadNewGcode:"Nahrát nový G-Code",Used:"Použito",View3D:"Zobrazit 3D"},l={CannotUploadFile:"Soubor nelze nahrát!",DropFilesToUploadFiles:"Přetáhněte soubory pro nahrání"},u={ClearLoadedFile:"Vymazat",CNCMode:"Režim CNC",ColorMode:"Režim barev",Downloading:"Stahování",ForceLineRendering:"Vynutit vykreslování čar",HDRendering:"HD vykreslování (zaoblené extruze)",High:"Vysoké",LoadCurrentFile:"Aktuální soubor",LoadLocal:"Lokální soubor",Low:"Nízké",Max:"Maximální",Medium:"Střední",ReloadRequired:"Je nutné znovu načíst",Rendering:"Vykreslování",RenderQuality:"Kvalita vykreslování",ShowGCode:"Zobrazit G-Code",ShowObjectSelection:"Zobrazit výběr objektu",ShowToolhead:"Zobrazit nástrojovou hlavu",ShowTravelMoves:"Zobrazit přesuny",SpecularLighting:"Zrcadlové osvětlení",Title:"Prohlížeč G-Code",Tracking:"Sledování",Transparency:"Průhlednost",Ultra:"Ultra",VoxelMode:"Voxelový režim (ASMBL)"},d={Abort:"Zrušit",BedMeshCalibrate:"Vytvořit drátěný model podložky",BedMeshRemove:"Odebrat model podložky",Calibrate:"Vytvořit",Clear:"Vymazat",CurrentMesh:{Headline:"Aktuální model podložky",Max:"Maximální",Min:"Minimální",Name:"Název",Range:"Rozsah",Size:"Velikost"},DeleteBedMeshProfile:"Smazat profil modelu podložky",DoYouReallyWantToDelete:'Opravdu chcete smazat profil "{name}"?',ErrorKlipperNotReady:"Klipper není připraven. Drátěný model podložky je vypnut.",Flat:"Rovina",Heightmap:"Výšková mapa",InvalidNameAlreadyExists:"Název profilu již existuje, zvolte prosím jiný název profilu.",InvalidNameEmpty:"Vstup nesmí být prázdný!",InvalidNameReserved:"Profil 'default' je rezervován, zvolte prosím jiný název profilu.",Later:"Později",Mesh:"Síť",Name:"Název",NoBedMeshHasBeenLoadedYet:"Dosud nebyla načtena žádná síť podložky.",NoProfile:"Žádný profil není k dispozici",Ok:"OK",Probed:"Změřeno",Profiles:"Profily",Remove:"smazat",RemoveSaveDescription:"Profil bed_mesh byl označen jako smazaný. K odstranění ze souboru printer.cfg a restartování Klipperu klikněte na SAVE_CONFIG.",Rename:"přejmenovat",RenameBedMeshProfile:"Přejmenovat profil sítě podložky",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Škálovat gradient",ScaleZMax:"Škálovat z-max.",TitleCalibrate:"Nastavit novou síť podložky",TitleClear:"Vymazat síť podložky",TitleHomeAll:"Homing všech os",Wireframe:"Drátěný model"},p={AddNote:"Přidat poznámku",AllJobs:"Všechny",AvgPrinttime:"Průměrný čas tisku",Cancel:"Zrušit",Chart:"Graf",CreateNote:"Vytvořit poznámku",Delete:"Smazat",DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybraných tisků?",Details:"Detaily",EditNote:"Upravit poznámku",Empty:"prázdný",EndTime:"Čas konce",EstimatedFilament:"Odhadovaná spotřeba filamentu",EstimatedFilamentWeight:"Odhadovaná hmotnost filamentu",EstimatedTime:"Odhadovaný čas",FilamentCalc:"Kalkulace filamentu",FilamentUsage:"Spotřeba filamentu",FilamentUsed:"Spotřebovaný filament",Filename:"Název souboru",Filesize:"Velikost souboru",FirstLayerBedTemp:"Teplota podložky 1. vrstvy",FirstLayerExtTemp:"Teplota extrudéru 1. vrstvy",FirstLayerHeight:"Výška 1. vrstvy",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Tisky",JobDetails:"Detaily tisku",Jobs:"Tisky",LastModified:"Poslední změna",LayerHeight:"Výška vrstvy",LongestPrinttime:"Nejdelší doba tisku",Note:"Poznámka",ObjectHeight:"Výška objektu",PrintDuration:"Čas tisku",PrintHistory:"Historie tisků",PrintTime:"Čas tisku",PrinttimeAvg:"Průměrný čas tisku",Reprint:"Opakovaný tisk",Save:"Uložit",Search:"Hledat",SelectedFilamentUsed:"Spotřeba vybraného filamentu",SelectedJobs:"Vybrané tisky",SelectedPrinttime:"Vybraný čas tisku",Slicer:"Slicer",SlicerVersion:"Verze sliceru",StartTime:"Čas začátku",Statistics:"Statistiky",Status:"Stav",StatusValues:{cancelled:"Zrušeno",completed:"Dokončeno",error:"Chyba",in_progress:"Probíhá",klippy_disconnect:"Odpojení Klippy",klippy_shutdown:"Vypnutí Klippy",Others:"Jiné",server_exit:"Ukončení serveru"},Table:"Tabulka",TitleExportHistory:"Exportovat historii",TitleRefreshHistory:"Obnovit historii",TitleSettings:"Nastavení",TotalDuration:"Celkový čas",TotalFilamentUsed:"Celkově spotřebovaný filament",TotalJobs:"Celkový počet tisků",TotalPrinttime:"Celkový čas tisku",TotalTime:"Celkový čas"},m={AllJobs:"Všechny tisky",Cancel:"Zrušit",ChangeCount:"Změnit počet",Count:"Počet",Empty:"Prázdné",InvalidCountEmpty:"Vstup nemůže být prázdný!",InvalidCountGreaterZero:"Vstup musí být větší než 0!",JobQueue:"Fronta tisků",Jobs:"Tisky",Pause:"Pozastavit",RemoveFromQueue:"Odebrat z fronty",Start:"Spustit"},v={ConfigFilesPanel:{AllFiles:"Vše",Cancel:"Zrušit",ConfigFiles:"Konfigurační soubory",ConfigRootDirectoryDoesntExists:'Nenalezen adresář s konfiguracemi. Zkontrolujte prosím volbu "config_path" v sekci [file_manager] konfigurace Moonraker.',Create:"Vytvořit",CreateDirectory:"Vytvořit adresář",CreateFile:"Vytvořit soubor",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Smazat adresář "{name}" a všechny jeho obsahy?',DeleteSelectedQuestion:"Smazat {count} vybrané položky?",Download:"Stáhnout",EditFile:"Upravit soubor",Empty:"Prázdné",Files:"Soubory",Filesize:"Velikost souboru",Free:"Volné",FreeDisk:"Volné místo",HiddenFiles:"Skryté soubory",HideBackupFiles:"Skrýt záložní soubory",LastModified:"Poslední úprava",Name:"Název",RefreshDirectory:"Obnovit adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Root:"Kořenový adresář",SetupCurrentList:"Nastavit aktuální seznam",ShowFile:"Zobrazit soubor",Total:"Celkově",UploadFile:"Nahrát soubor",Uploading:"Nahrávám",Used:"Použité"},EndstopPanel:{Endstop:"Koncový spínač",EndstopInfo:"Stiskněte tlačítko synchronizace v pravém dolním rohu pro načtení aktuálního stavu koncových spínačů.",Endstops:"Koncové spínače",open:"OTEVŘENO",TRIGGERED:"AKTIVOVÁNO"},LogfilesPanel:{Accept:"potvrdit",Cancel:"zrušit",Logfiles:"Log soubory",Rollover:"Převést logy",RolloverDescription:"Vyberte, které logy by měly být resetovány:",RolloverToastFailed:'Chyba při převodu logu pro "{name}": {message}',RolloverToastSuccessful:'Log pro "{name}" byl úspěšně resetován.'},SystemPanel:{Constants:"Konstanty",Cpu:"CPU",HostDetails:"Podrobnosti hostitele",LastStats:"Poslední statistiky",Load:"Zátěž",Memory:"PAMĚŤ",NoMoreInfos:"Žádné další informace",SystemLoad:"Zatížení systému",Values:{Awake:"Bdělý: {awake}",Bandwidth:"Propustnost: {bandwidth}/s",Distro:"Distribuce: {name} {version_id}",Frequency:"Frekvence: {frequency}",Load:"Zátěž: {load}",Memory:"Paměť: {memory}",Os:"OS: {os}",Received:"Přijato: {received}",Temp:"Teplota: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Přeneseno: {transmitted}",Version:"Verze: {version}"}},UpdatePanel:{CheckForUpdates:"Kontrola aktualizací",Commits:"Commit(y)",CommitsAvailable:"žádné commity k dispozici | {count} commit k dispozici | {count} commity k dispozici",CommitsOnDate:"Commity z {date}",CommittedDaysAgo:"commitováno před {days} dny",CommittedHoursAgo:"commitováno před {hours} hodinami",CommittedOnDate:"commitováno dne {date}",CommittedYesterday:"commitováno včera",Detached:"odpojený",Dirty:"upravený",ERROR:"CHYBA",Invalid:"neplatný",OSPackages:"OS balíčky",PackagesCanBeUpgraded:"balíčky lze aktualizovat",System:"Systém",Unknown:"neznámý",Update:"aktualizace",UpdateAll:"Aktualizovat všechny komponenty",UpdateManager:"Správce aktualizací",Upgrade:"upgradovat",UpToDate:"aktualizováno"}},c={Abort:"Zrušit",Accept:"Přijmout",Advanced:"Pokročilé",Headline:"Manuální měření"},k={ExtruderControlPanel:{Allowed:"Povoleno",EstimatedExtrusion:"Odhadovaná extruze:",Extrude:"Extrudovat",ExtruderTempTooLow:"Teplota extruderu <",ExtrusionFactor:"Extruze",ExtrusionFeedrate:"Rychlost extruze",FilamentLength:"Délka extruze filamentu",FirmwareRetractionSettings:{RetractLength:"Délka retrakce",RetractSpeed:"Rychlost retrakce",UnretractExtraLength:"Dod. délka při deretrakci",UnretractSpeed:"Rychlost deretrakce"},Headline:"Extruder",LoadFilament:"Naložit filament",PressureAdvanceSettings:{Advance:"Přetlak",Extruder:"Extruder",SmoothTime:"Čas vyhlazování"},Requested:"Požadováno",Retract:"Vytáhnout",TooLargeExtrusion:"Příliš velká extruze!",UnloadFilament:"Vyjmout filament"},FarmPrinterPanel:{ReconnectToPrinter:"Připojit znovu",SwitchToPrinter:"Přepnout na tiskárnu",WebcamOff:"Vypnuto"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Prosím zkontrolujte, zda služba Klipper běží a jestli je klippy_uds_address správně nakonfigurován v moonraker.conf.",FirmwareRestart:"Restartovat firmware",MoonrakerCannotConnect:"Moonraker nemůže navázat spojení s Klipperem!",PowerOn:"Zapnout",PrinterSwitchedOff:"Tiskárna je vypnuta",PrinterSwitchedOffDescription:"Tiskárna je momentálně vypnutá a Klipper nemůže navázat spojení. Pro zapnutí tiskárny klikněte na tlačítko níže:",Restart:"Restartovat",ServiceReports:"{service} hlásí"},MachineSettingsPanel:{Headline:"Tiskárna",MotionSettings:{Acceleration:"Zrychlení",MaxAccelToDecel:"Max. zrychlení pro zpomalení",SquareCornerVelocity:"Rychlost v rohových bodech",Velocity:"Rychlost"}},MacrosPanel:{Headline:"Makra",Send:"odeslat"},MiniconsolePanel:{Headline:"Konzole",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt Timelapse",SendCode:"Odeslat kód...",SetupConsole:"Nastavit konzoli"},MinSettingsPanel:{IncludeMainsailCfg:"Ujistěte se, že jste v souboru printer.cfg zahrnuli mainsail.cfg.",IsNotDefinedInConfig:"není definován v konfiguraci.",MissingConfiguration:"Chybějící konfigurace",MoreInformation:"více informací"},MiscellaneousPanel:{Headline:"Různé",Light:{Blue:"modrá",Green:"zelená",Red:"červená",White:"bílá"},RunoutSensor:{Detected:"detekováno",Disabled:"vypnuto",Empty:"prázdné"}},PowerControlPanel:{Error:"Chyba",Off:"Vypnuto",On:"Zapnuto",PowerControl:"Řízení napájení"},StatusPanel:{CancelPrint:"Zrušit tisk",ClearPrintStats:"Vymazat statistiky tisku",Difference:"Rozdíl",EmptyGcodes:"Žádné G-kódy k dispozici.",EmptyJobqueue:"V seznamu úloh momentálně není žádný soubor.",Estimate:"Předpokládaný čas",ETA:"Odhadovaný čas dokončení",ExcludeObject:{Cancel:"Zrušit",Excluded:"Vyloučený",ExcludeObject:"Vyloučit objekt",ExcludeObjectHeadline:"Vyloučit objekt",ExcludeObjectText:'Opravdu chcete vyloučit objekt "{name}"?'},Filament:"Filament",File:"Soubor",Files:"Soubory",Flow:"Průtok",Headline:"Stav",Jobqueue:"Seznam úloh",JobqueueMoreFiles:"žádné další úlohy | jedna další úloha | {count} dalších úloh",Layer:"Vrstva",Max:"max",ObjectHeight:"Výška objektu",PauseAtLayer:{Abort:"Zrušit",Accept:"Přijmout",AtLayer:"na vrstvě",Call:"Volat",DescriptionPauseAtLayerActive:'Tato funkce již aktivní a zavolá "{call}" na vrstvě {layer}. Pokud příkaz zavoláte znovu, tyto nastavení budou přepsána.',DescriptionPauseNextLayerActive:'Tato funkce již aktivní a zavolá "{call}" na následující vrstvě.',Layer:"Vrstva",NextLayer:"následující vrstva",PauseAtLayer:"Pozastavit na vrstvě",Type:"Typ"},PausePrint:"Pozastavit tisk",Print:"Tisknout",PrintTime:"Doba tisku",ReprintJob:"Znovu vytisknout úlohu",Requested:"Požadováno",ResumePrint:"Pokračovat v tisku",Slicer:"Slicer",Speed:"Rychlost",Status:"Stav",Total:"Celkem",Unknown:"Neznámý"},TemperaturePanel:{AutoscaleChart:"Automaticky škálovat graf",Avg:"Průměr",Cooldown:"Zchladnutí",Current:"Aktuální",Dataset:{Power:"PWM-výkon",Speed:"PWM-rychlost",Target:"Cílová teplota",Temperature:"Aktuální teplota"},Headline:"Teploty",Max:"Max.",Min:"Min.",Name:"Název",Presets:"Předvolby",SetupTemperatures:"Nastavit teploty",ShowChart:"Zobrazit graf",ShowNameInChart:"Zobrazit {name} v grafu",ShowNameInList:"Zobrazit {name} v seznamu",State:"Stav",Target:"Cíl",TemperaturesInChart:"Teplota [°C]",TempTooHigh:"Teplota pro {name} je příliš vysoká! (max.: {max})",TempTooLow:"Teplota pro {name} je příliš nízká! (min.: {min})"},ToolheadControlPanel:{Absolute:"absolutní",ALL:"VŠE",Headline:"Nástroj",PleaseConfigureSteps:"Prosím nakonfigurujte kroky",Position:"Pozice",QGL:"QGL",Relative:"relativní",SettingsInterfaceControl:"Nastavení > Rozhraní > Ovládání",SpeedFactor:"Rychlost",ZTilt:"Z-tilt"},WebcamPanel:{All:"Vše",FPS:"FPS",Headline:"Webkamera",NoWebcam:'Žádná webkamera není k dispozici. Přidejte webkameru v sekci "Nastavení rozhraní" -> "Webkamery".',UnknownWebcamService:"Neznámá služba webkamery"},ZoffsetPanel:{Clear:"Smazat",Headline:"Z-offset",Later:"Později",Ok:"OK",Save:"Uložit",SaveConfig:"ULOŽIT KONFIGURACI",SaveInfoDescription:'Nový Z-offset byl vypočítán a uložen. Klikněte na tlačítko "ULOŽIT KONFIGURACI" pro uložení do printer.cfg a restart Klipperu.',SaveInfoDescriptionPrint:'Nový Z-offset byl vypočítán a uložen. Po dokončení tisku klikněte na tlačítko "ULOŽIT KONFIGURACI" v horní liště pro uložení do printer.cfg a restart Klipperu.',SaveInfoHeadline:"Informace",ToEndstop:"ke koncovému spínači",ToProbe:"ke snímači"}},y={AreYouSure:"Jste si jisti?",No:"Ne",TurnDeviceOff:"Vypnout {device}",TurnDeviceOn:"Zapnout {device}",Yes:"Ano"},b={Console:"Konzole",Dashboard:"Nástěnka","G-Code Files":"Soubory G-Code","G-Code Viewer":"Prohlížeč G-Code",Heightmap:"Výšková mapa",History:"Historie",Machine:"Zařízení",Printers:"Tiskárny",Timelapse:"Time-lapse",Webcam:"Webkamera"},z={Accept:"Přijmout",Base:"Základna",ErrorText:"Při procesu sondování došlo k chybě.",Headline:"Naklonění šroubů"},h={AddPrinter:"Přidat tiskárnu",AddPrintersToJson:"Prosím, přidejte tiskárny do config.json.",CannotConnectTo:"Nelze se připojit k {host}.",ChangePrinter:"Změnit tiskárnu",Connecting:"Připojování k {host}",ConnectionFailed:"Připojení selhalo",EditPrinter:"Upravit tiskárnu",Hello:"Vítejte v dálkovém režimu Mainsail!",HostnameInvalid:"Neplatný hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Je vyžadován hostname",Port:"Port",PortRequired:"Je vyžadován port",RememberToAdd:"Nezapomeňte přidat '{cors}' do moonraker.conf v 'cors_domains'.",SelectPrinter:"Vybrat tiskárnu",TryAgain:"zkusit znovu",UpdatePrinter:"Aktualizovat tiskárnu",YouCanFindMore:"Další informace naleznete na"},P={Cancel:"Zrušit",Close:"Zavřít",ConsoleTab:{AddFilter:"Přidat filtr",Console:"Konzole",CreateHeadline:"Vytvořit filtr",Direction:"Směr",DirectionShell:"Poslední vstup dole",DirectionTable:"Poslední vstup nahoře",EditHeadline:"Upravit filtr",EntryStyle:"Styl zápisu",EntryStyleCompact:"Kompaktní",EntryStyleDefault:"Výchozí",Filters:"Filtry",Height:"Výška",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt timelapse",Name:"Název",Regex:"Regulární výraz",StoreButton:"Uložit filtr",UpdateButton:"Aktualizovat filtr"},ControlTab:{Bars:"Lišty",Circle:"Kruh",Control:"Ovládání",Cross:"Kříž",EnableXYHoming:"Povolit společné homování osy X a Y",EstimatedExtrusionInfo:"Zobrazit informace o odhadované extruzi",EstimatedExtrusionInfoDescription:"Zobrazit / skrýt informace o odhadované extruzi na základě množství extrudovaného materiálu a rychlosti podávání",InvertXMovement:"Invertovat směr pohybu osy X",InvertYMovement:"Invertovat směr pohybu osy Y",InvertZMovement:"Invertovat směr pohybu osy Z",IsDefault:" (výchozí)",MaximumValues:"Maximální hodnoty: {maximum}",MaximumValuesVisibility:"Pro nejlepší viditelnost se doporučuje maximálně {maximum} hodnot",MinimumValues:"Minimální hodnoty: {minimum}",MotorsOff:"Vypnout motory{isDefault}",MoveDistancesEInMm:"Přednastavení množství extruze (v mm)",MoveDistancesInMm:"Přírůstky vzdálenosti při pohybu (v mm)",MoveDistancesXYInMm:"Přírůstky vzdálenosti při pohybu osami X a Y (v mm)",MoveDistancesZInMm:"Přírůstky vzdálenosti při pohybu osou Z (v mm)",QuadGantryLevel:"Vyrovnání čtyřech os{isDefault}",SpeedEInMms:"Přednastavení rychlosti extruze (v mm/s)",SpeedXY:"Rychlost pohybu os X a Y",SpeedZ:"Rychlost pohybu osou Z",Style:"Styl",ValueGreaterThan:"Hodnota musí být větší než {value}",ZOffsetIncrements:"Přírůstky Z-offsetu (v mm)",ZTiltAdjust:"Nastavení Z-tiltu{isDefault}"},DashboardTab:{Dashboard:"Nástěnka",Desktop:"Desktop",Mobile:"Mobilní",ResetLayout:"Resetovat rozložení",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Upravit",EditorTab:{ConfirmUnsavedChanges:"Upozornit na neuložené změny",ConfirmUnsavedChangesDescription:"Pokud je aktivováno, editor vyžaduje potvrzení, zda chcete uložit nebo zrušit změny. Pokud je deaktivováno, změny budou tiché.",Editor:"Editor",KlipperRestartMethod:"Metoda restartu Klipperu",KlipperRestartMethodDescription:'Vyberte metodu restartu, která se použije při editaci konfiguračních souborů Klipperu v "Uložit a restartovat".',UseEscToClose:"Použít ESC pro zavření editoru",UseEscToCloseDescription:"Umožňuje použití klávesy ESC k zavření editoru"},GCodeViewerTab:{BackgroundColor:"Barva pozadí",ExtruderColor:"Barvy extrudérů",GCodeViewer:"Prohlížeč G-kódu",GridColor:"Barva mřížky",MaxFeed:"Maximální podávací rychlost",MinFeed:"Minimální podávací rychlost",ProgressColor:"Barva postupu",ShowAxes:"Zobrazit osy"},GeneralTab:{"12hours":"12-hodinový formát ({time})","24hours":"24-hodinový formát ({time})",Backup:"Záloha",BackupDialog:"Prosím zvolte všechny sekce, které chcete zazálohovat:",CalcEstimateTime:"Výpočet odhadovaného času",CalcEstimateTimeDescription:"Pokud je vybráno více možností, bude spočítán průměr",CalcEtaTime:"Výpočet ETA",CalcEtaTimeDescription:"Pokud je vybráno více možností, bude spočítán průměr",CalcPrintProgress:"Výpočet průběhu tisku",CalcPrintProgressDescription:"Metoda pro výpočet průběhu tisku.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Poloha souboru (absolutní)",FileRelative:"Poloha souboru (relativní)",Slicer:"Slicer (M73)"},CannotReadJson:"Nepodařilo se načíst/zpracovat soubor s zálohou.",DateFormat:"Formát data",DbConsoleHistory:"Historie konzole",DbHistoryJobs:"Historie úloh",DbHistoryTotals:"Historie celkových hodnot",DbTimelapseSettings:"Nastavení časosběrného videa",DbView:"Nastavení zobrazení",DbWebcams:"Webkamery",EstimateValues:{Filament:"Filament",File:"Soubor",Slicer:"Slicer"},FactoryDialog:"Prosím zvolte všechny sekce, které chcete resetovat:",FactoryReset:"Reset na tovární hodnoty",General:"Obecné",Language:"Jazyk",MoonrakerDb:"Moonraker databáze",PrinterName:"Název tiskárny",Reset:"Resetovat",Restore:"Obnovit",RestoreDialog:"Prosím zvolte všechny sekce, které chcete obnovit:",TimeFormat:"Formát času"},InterfaceSettings:"Nastavení rozhraní",MacrosTab:{Add:"přidat",AddGroup:"přidat skupinu",AvailableMacros:"Dostupné makra",ChangeMacroColor:"Změnit barvu tlačítka",Color:"Barva",CountMacros:"žádná makra přidána | {count} makro | {count} maker",Custom:"vlastní",CustomColor:"Vlastní barva",DeletedMacro:"Makro smazáno",DeleteMacroFromGroup:"Smazat makro ze skupiny",EditGroup:"Upravit skupinu",Error:"chyba",Expert:"Expert",General:"Obecné",Group:"Skupina",GroupMacros:"Seskupit makra",Macrogroups:"Skupiny maker",Macros:"Makra",Management:"Správa",Name:"Jméno",NoAvailableMacros:"Nejsou dostupná žádná makra.",NoGroups:"Nenalezena žádná skupina...",NOMacros:"Nenalezena žádná makra...",NoMacrosInGroup:"V této skupině nejsou žádná makra.",Primary:"primární",Secondary:"sekundární",ShowInStatePaused:"Zobrazovat/skrýt, pokud je tiskárna pozastavena",ShowInStatePrinting:"Zobrazovat/skrýt, pokud tiskárna tiskne",ShowInStateStandby:"Zobrazovat/skrýt, pokud je tiskárna v pohotovostním režimu",Simple:"Jednoduchý",Status:"Stav",Success:"úspěch",UnknownGroup:"Neznámá skupina",Warning:"varování"},MiscellaneousTab:{AddGroup:"Přidat skupinu",AddPreset:"Přidat předvolbu",Color:"Barva",CreateGroup:"Vytvořit skupinu",CreatePreset:"Vytvořit předvolbu",End:"Konec",EndDescription:"Poslední LED této skupiny.",Groups:"Skupiny",GroupSubTitle:"Start: {start}, Konec: {end}",LightGroups:"{name} - Skupiny",LightPresets:"{name} - Předvolby",Miscellaneous:"Různé",Name:"Název",NoDevicesFound:"Nenalezena žádná zařízení",NoGroupFound:"Nebyla nalezena žádná skupina",NoPresetFound:"Nebyla nalezena žádná předvolba",Presets:"Předvolby",Start:"Start",StartDescription:"První LED této skupiny.",UnableToLoadLight:"Nelze načíst světlo",UnableToLoadPreset:"Nelze načíst předvolbu"},PresetsTab:{AddPreset:"Přidat předvolbu",Cooldown:"Zchladnutí",CreateHeadline:"Vytvořit předvolbu",CustomGCode:"Vlastní G-kód",EditCooldown:"Upravit zchladnutí",EditHeadline:"Upravit předvolbu",ErrorInvalidValue:"Neplatná hodnota",ErrorNameNotUnique:"Název již existuje",ErrorNameRequired:"Název je povinný",Name:"Název",PreheatPresets:"Předvolby",PresetInfo:"Nastavte alespoň cílovou teplotu nebo vlastní G-kód.",PresetNamePlaceholder:"Název předvolby (povinný)",StoreButton:"Uložit předvolbu",UpdateButton:"Aktualizovat předvolbu",UpdateCooldown:"Aktualizovat zchladnutí"},RemotePrintersTab:{AddPrinter:"Přidat tiskárnu",EditPrinter:"Upravit tiskárnu",Hostname:"Hostname",Port:"Port",RemotePrinters:"Vzdálené tiskárny",UpdatePrinter:"Aktualizovat tiskárnu",UseConfigJson:"Byla zjištěna InstanceDB = JSON. Pro úpravu seznamu tiskáren použijte prosím config.json."},Store:"uložit",TimelapseTab:{Autorender:"Automatické vygenerování časosběrného videa",AutorenderDescription:"Pokud povoleno, časosběrné video se automaticky vygeneruje na konci tisku",Camera:"Kamera",CameraDescription:"Vyberte, která kamera se má použít",ConstantRateFactor:"Konstantní rychlost faktoru",ConstantRateFactorDescription:"Toto nastavuje poměr kvality a velikosti výstupního videa. Rozsah stupnice CRF je 0–51, kde 0 znamená bez ztráty, 23 je výchozí hodnota a 51 je nejhorší možná kvalita. Nižší hodnota obvykle znamená vyšší kvalitu a obvykle se používají hodnoty 17-28, kde 17 nebo 18 jsou považovány za vizuálně bezeztrátové.",duplicatelastframe:"Duplikovat poslední snímek",duplicatelastframeDescription:"Duplikuje poslední snímek na konci videa",Enabled:"Povoleno",EnabledDescription:"Pokud zakázáno, G-Code makra jsou ignorována a automatické vygenerování časosběrného videa se přeskočí.",Extraoutputparams:"Další výstupní parametry",ExtraoutputparamsDescription:"Definuje další výstupní parametry pro FFMPEG. Poznámka: Zadání cokoli sem vypne nastavení rotace",FwRetract:"FW zatažení",FwRetractDescription:"Použít firmware retrakci v časosběrném makru",GcodeVerbose:"Podrobné G-kódy",GcodeVerboseDescription:"Pokud je povoleno, G-kódy v makrech zobrazují informace v konzoli",General:"Obecné",HyperlapseCycle:"Hyperlapse doba cyklu",HyperlapseCycleDescription:"Snímek se pořídí každých X sekund",Mode:"Režim",ModeDescription:"Vyberte mezi makrem vrstvy a hyperlapse (časovým) režimem",OutputFramerate:"Výstupní snímková frekvence",OutputFramerateDescription:"Definuje snímkovou frekvenci videa. Poznámka: Toto bude ignorováno, pokud je povolena proměnná snímková frekvence",Parkhead:"Parkovat hlavu nástroje",ParkheadDescription:"Pokud povoleno, hlava nástroje se parkuje před pořízením snímku.",Parkpos:"Pozice parkování",ParkposDescription:"Vyberte pozici parkování",ParkTime:"Doba parkování",ParkTimeDescription:"Přidat další nečinnost při parkování.",Pixelformat:"Formát pixelů",PixelformatDescription:"Definuje formát pixelů výstupního videa",PosDZ:"Pozice Z",PosDZDescription:"Parkovací pozice Z (relativní)",PosX:"Pozice X",PosXDescription:"Parkovací pozice X (absolutní)",PosY:"Pozice Y",PosYDescription:"Parkovací pozice Y (absolutní)",PreviewImage:"Náhledový obrázek",PreviewImageDescription:"Uloží náhledový obrázek se stejným názvem jako video",RenderingOptions:"Možnosti vykreslování",RetractDistance:"Vzdálenost zpětného tahání",RetractDistanceDescription:"Délka filamentu, který extruder zpětně táhne.",RetractSpeed:"Rychlost zpětného tahání",RetractSpeedDescription:"Rychlost, kterou extruder zpětně táhne filament.",SaveFrames:"Uložit snímky",SaveFramesDescription:"Uloží snímky do zip souboru pro externí vykreslování",StreamDelayCompensation:"Kompensace zpoždění streamu",StreamDelayCompensationDescription:"Zpoždění zachycení snímku",Targetlength:"Cílová délka",TargetlengthDescription:"Cílová délka při povoleném proměnném počtu snímků za sekundu",TimeFormatCode:"Kód formátu času",TimeFormatCodeDescription:"Definuje, jak bude časové razítko výstupního souboru zakódováno",Timelapse:"Timelapse",TravelSpeed:"Rychlost pohybu",TravelSpeedDescription:"Rychlost pohybu při přesunu na parkovací pozici a obnovení tisku",UnretractDistance:"Vzdálenost roztažení",UnretractDistanceDescription:"Délka filamentu, který extruder roztažený zpět vrací",UnretractSpeed:"Rychlost roztažení",UnretractSpeedDescription:"Rychlost, kterou extruder roztažený filament vrací zpět",VariableFps:"Proměnný počet snímků za sekundu",VariableFpsDescription:"Pokud je povoleno, rychlost snímků výstupního videa bude vypočítána na základě cílové délky",VariableFpsMax:"Proměnný FPS max",VariableFpsMaxDescription:"",VariableFpsMin:"Minimální počet snímků na sekundu při proměnné rychlosti",VariableFpsMinDescription:""},UiSettingsTab:{BoolBigThumbnail:"Velký náhled",BoolBigThumbnailDescription:"Zobrazit velký náhled v panelu stavu během tisku.",BoolHideUploadAndPrintButton:"Skrýt tlačítko Nahrát a Tisknout",BoolHideUploadAndPrintButtonDescription:'Zobrazit nebo skrýt tlačítko "Nahrát a Tisknout" v horní liště.',ConfirmOnEmergencyStop:"Potvrdit nouzové zastavení",ConfirmOnEmergencyStopDescription:"Zobrazit potvrzovací dialog při nouzovém zastavení.",ConfirmOnPowerDeviceChange:"Potvrdit změnu napájecího zařízení",ConfirmOnPowerDeviceChangeDescription:"Zobrazit potvrzovací dialog při změně napájecího zařízení.",DisableFanAnimation:"Vypnout animaci ventilátorů",DisableFanAnimationDescription:"Toto může snížit zátěž pro váš prohlížeč.",DisplayCANCEL_PRINT:"Zobrazit CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Zobrazuje tlačítko CANCEL_PRINT trvale - není třeba druhé potvrzení pro druhou vrstvu.",GcodeThumbnails:"Náhledy G-Code",GcodeThumbnailsDescription:"Klikněte na tlačítko, abyste se dostali k návodům.",Guide:"Průvodce",HideSaveConfigButtonForBedMesh:"Skrýt tlačítko Uložit konfiguraci pro změny bed_mesh",HideSaveConfigButtonForBedMeshDescription:"Skrýt tlačítko Uložit konfiguraci, pokud jsou pouze změny bed_mesh čekající na uložení v Klipperu.",LockSliders:"Uzamknout posuvníky na dotykových zařízeních",LockSlidersDelay:"Prodleva uzamčení posuvníků",LockSlidersDelayDescription:"Posuvníky se uzamknou po určité prodlevě. Pokud je nastaveno na 0 nebo ponecháno prázdné, posuvníky se uzamknou pouze při změně/obnovení stránky.",LockSlidersDescription:"Posuvníky na dotykových zařízeních musí být odemknuty před povolením změn.",Logo:"Logo",NavigationStyle:"Styl navigace",NavigationStyleDescription:"Změnit vzhled navigace",NavigationStyleIconsAndText:"Ikony + Text",NavigationStyleIconsOnly:"Pouze ikony",PowerDeviceName:"Napájecí zařízení tiskárny",PowerDeviceNameDescription:"Vyberte, které zařízení pro napájení tiskárny v Moonrakeru se má použít.",Primary:"Primární",ShowWebcamInNavigation:"Zobrazit webkameru v navigaci",UiSettings:"Nastavení uživatelského rozhraní"},Update:"Aktualizovat",WebcamsTab:{AddWebcam:"Přidat webkameru",CreateWebcam:"Vytvořit webkameru",EditCrowsnestConf:"Upravit crowsnest.conf",EditWebcam:"Upravit webkameru",FlipWebcam:"Obrátit obrázek kamery:",Hlsstream:"HLS stream",Horizontally:"horizontálně",IconBed:"Postel",IconCam:"Kamera",IconDoor:"Dveře",IconFilament:"Filament",IconHot:"Horké",IconMcu:"MCU",IconNozzle:"Tryska",IconPrinter:"Tiskárna",Ipstream:"IP kamera",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptivní MJPEG-Streamer (experimentální)",Name:"Jméno",NameAlreadyExists:"Jméno již existuje",Required:"vyžadováno",Rotate:"Otočit",SaveWebcam:"Uložit webkameru",Service:"Služba",TargetFPS:"Cílové FPS",UpdateWebcam:"Aktualizovat webkameru",UrlSnapshot:"URL snímku",UrlStream:"URL streamu",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikálně",Webcams:"Webkamery",WebrtcCameraStreamer:"WebRTC (streamer z kamery)"}},S={AllFiles:"Všechny",Autorender:"Automatické vykreslování",Cancel:"Zrušit",Create:"Vytvořit",CreateNewDirectory:"vytvořit adresář",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Opravdu chcete smazat adresář "{name}" se všemi jeho obsahy?',DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybrané soubory?",Download:"Stáhnout",DuplicateLastframe:"Duplikovat poslední snímek",Empty:"Nebyly nalezeny žádné dokončené časosběrné snímky.",Enabled:"Zapnuto",EstimatedLength:"Předpokládaná délka",Files:"Soubory",Filesize:"Velikost",Fixed:"Pevný",Framerate:"Snímkovací frekvence",Frames:"Snímky",Free:"Volný",FreeDisk:"Volné místo",LastModified:"Naposledy upraveno",MaxFramerate:"Max. snímkovací frekvence",MinFramerate:"Min. snímkovací frekvence",Name:"Název",NewDirectory:"Nový adresář",NoActiveTimelapse:"Nejsou k dispozici žádné záznamy.",Preview:"Náhled",RefreshCurrentDirectory:"Obnovit adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Render:"Vykreslit",RenderSettings:"Nastavení vykreslování",SaveFrames:"Uložit snímky",Search:"Hledat",StartRender:"Spustit vykreslování",Status:"Stav",TargetFps:"Cílová snímkovací frekvence",Targetlength:"Cílová délka",TimelapseFiles:"Soubory časosběrných snímků",TimelapseRendering:"Vykreslování časosběrných snímků",TimelapseRenderingSuccessful:"Vykreslování časosběrných snímků úspěšné",Total:"Celkem",Type:"Typ",Used:"Použité",Variable:"Proměnný",Video:"Video"},C="Čeština",D={App:e,BedScrews:o,ConnectionDialog:t,Console:a,Dialogs:n,Editor:r,EmergencyStopDialog:i,Files:s,FullscreenUpload:l,GCodeViewer:u,Heightmap:d,History:p,JobQueue:m,Machine:v,ManualProbe:c,Panels:k,PowerDeviceChangeDialog:y,Router:b,ScrewsTiltAdjust:z,SelectPrinterDialog:h,Settings:P,Timelapse:S,title:C};export{e as App,o as BedScrews,t as ConnectionDialog,a as Console,n as Dialogs,r as Editor,i as EmergencyStopDialog,s as Files,l as FullscreenUpload,u as GCodeViewer,d as Heightmap,p as History,m as JobQueue,v as Machine,c as ManualProbe,k as Panels,y as PowerDeviceChangeDialog,b as Router,z as ScrewsTiltAdjust,h as SelectPrinterDialog,P as Settings,S as Timelapse,D as default,C as title}; diff --git a/dirs/mainsail/assets/da-6721996d.js b/dirs/mainsail/assets/da-6721996d.js deleted file mode 100644 index da40905..0000000 --- a/dirs/mainsail/assets/da-6721996d.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{BrowserWarnings:{Description:"{name} er forældet og ikke længere fuldt understøttet. Den nuværende version er {version}, men Mainsail kræver version {minVersion} eller højere.",Headline:"Forældet browser"},DependencyDescription:"Den nuværende version af {name} understøtter ikke alle funktioner i Mainsail. Opdatér {name} til minimum version: {neededVersion}.",DependencyName:"Afhængighed: {name}",DismissAll:"Fjern alle",KlipperWarnings:{DeprecatedOption:'Funktionen "{option}" i sektion "{section}" er forældet.',DeprecatedOptionHeadline:"Forældet Klipper mulighed",DeprecatedValue:'Værdien "{value}" i muligheden "{option}" i sektion "{section}" er forældet.',DeprecatedValueHeadline:"Forældet Klipper værdi",KlipperWarning:"Klipper advarsel"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Der blev fundet en fejl under indlæsning af Moonraker komponenten '{component}'. Tjek logfilen og løs problemet.",MoonrakerWarning:"Moonraker advarsel",UnparsedConfigOption:"Upareret mulighed '{option}: {value}' fundet i sektionen: [{section}]. Denne mulighed er måske ikke længere tilgængelig, eller der kan være et problem under indlæsning af et modul. Dette vil resultere i en opstartsfejl.",UnparsedConfigSection:"Upareret konfigurationssektion [{section}] fundet. Dette kan være på grund af en fejl under indlæsning af en komponent. Dette vil resultere i en opstartsfejl."},Never:"aldrig",NextReboot:"næste genstart",NoNotification:"Ingen tilgængelig notifikationer",Notifications:"Notifikationer",Remind:"Påmind mig om:"},NumberInput:{GreaterOrEqualError:"Skal være større eller lig med {min}!",MustBeBetweenError:"Skal være mellem {min} og {max}!",NoEmptyAllowedError:"Må ikke være tom!"},Printers:"Printere",TheServiceWorker:{DescriptionNeedUpdate:"Den lokale cahce er forældet og skal opdateres. Tryk venligst nedenfor for at opdatere.",TitleNeedUpdate:"PWA skal opdateres",Update:"Opdater"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM kerne(r) er i øjeblikket begrænset .",DescriptionFrequencyCapped:"rPi ARM maks. frekvens er i øjeblikket begrænset til 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"rPi ARM maks. frekvens var mindst en gang begrænset til 1.2 GHz siden sidste opstart.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only) temperatur var mindst en gang over advarselsgrænsen siden sidste opstart.",DescriptionPreviouslyThrottled:"rPI ARM kerne(r) var begrænset mindst en gang siden sidste opstart.",DescriptionPreviouslyUnderVolted:"rPI strømforsyning faldt til under 4,65V mindst en gang siden sidste opstart.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ only) temperatur er i øjeblikket over advarselsgrænsen (standard 60°C).",DescriptionUnderVoltageDetected:"rPI strømforsyning i øjeblikket under 4,65V",TitleCurrentlyThrottled:"Begrænset i øjeblikket",TitleFrequencyCapped:"Maks. frekvens formindsket",TitlePreviouslyFrequencyCapped:"Maks. frekvens formindsket tidligere",TitlePreviouslyTemperatureLimited:"Temperaturgrænse nået tidligere",TitlePreviouslyThrottled:"Tidligere begrænset",TitlePreviouslyUnderVolted:"Lav spænding opdaget tidligere",TitleTemperatureLimitActive:"Temperaturgrænse nået",TitleUnderVoltageDetected:"Lav spænding opdaget"},Titles:{Complete:"Færdig - {filename}",Error:"Fejl",Pause:"Pause",PrinterOff:"Printer slukket",Printing:"{percent}% printet",PrintingETA:"{percent}% printet - ETA {eta}"},TopBar:{CannotUploadTheFile:"Kan ikke uploade filen!",EmergencyStop:"Nødstop",SAVE_CONFIG:"GEM KONFIGURATION",Uploading:"Uploader",UploadOfFileSuccessful:"Upload af {file} udført",UploadPrint:"Upload & Print"},TopCornerMenu:{Cancel:"Annuller",ConfirmationDialog:{Description:{HostReboot:"Hvis du genstarter værten nu, vil det igangværende print fejle.",HostShutdown:"Hvis du lukker værten ned nu, vil det igangværende print fejle.",KlipperFirmwareRestart:"Hvis du genstarter Klipper firmware nu, vil det igangværende print fejle.",KlipperRestart:"Hvis du genstarter Klipper nu, vil det igangværende print fejle.",KlipperStop:"Hvis du stopper Klipper nu, vil det igangværende print fejle.",ServiceRestart:"Hvis du genstarter denne service nu, er der stor risiko for at dit igangværende print vil fejle.",ServiceStart:"Hvis du starter denne service nu, er der stor risiko for at dit igangværende print vil fejle.",ServiceStop:"Hvis du stopper denne service nu, er der stor risiko for at dit igangværende print vil fejle."},Title:{HostReboot:"Genstart vært",HostShutdown:"Luk vært ned",KlipperFirmwareRestart:"Genstart Klipper firmware",KlipperRestart:"Genstart Klipper",ServiceRestart:"Genstart service",ServiceStart:"Start service",ServiceStop:"Stop service"}},HostControl:"Værtsstyring",KlipperControl:"Klipper styring",KlipperFirmwareRestart:"Genstart firmware",KlipperRestart:"Genstart",PowerDevices:"Strømstyring",Reboot:"Genstart",Restart:"Genstart",ServiceControl:"Services",Shutdown:"Luk ned",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Luk",Empty:"Tøm",Recovering:"Gendanner {software}...",RecoveringDone:"Gendannelse af {software} udført!",Updating:"Opdaterer {software}...",UpdatingDone:"Opdatering af {software} udført!"}},t={Abort:"Afbryd",Accept:"Acceptér",Adjusted:"Justeret",Description:"Klik på Justeret hvis skruen blev justeret. Klik på Acceptér for at fortsætte uden justering.",Headline:"Bed skruer",ScrewAccepted:"Skrue accepteret",ScrewIndex:"Skrue Index",ScrewName:"Skrue Navn",ScrewOutput:"{current} af {max}"},r={CannotConnectTo:"Kan ikke forbinde med Moonraker ({host}).",CheckMoonrakerLog:"Hvis denne besked vises flere gange, kig da i logfilen her:",Connecting:"Forbinder med {host}",Failed:"Forbindelse fejlede",Initializing:"Initialiserer",TryAgain:"Prøv igen"},i={CommandList:"Liste over kommandoer",Empty:"Tom",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",SendCode:"Send kode...",SetupConsole:"Terminalindstillinger"},n={StartPrint:{Cancel:"Annuller",DoYouWantToStartFilename:"Vil du begynde at printe: {filename}?",DoYouWantToStartFilenameFilament:"Vil du begynde at printe {filename} med dette filament?",Headline:"Start print",Print:"print",Timelapse:"Timelapse"}},a={ConfigReference:"Konfigurationsreference",DontSave:"Gem ikke",Downloading:"Downloader",FailedSave:"{filename} blev IKKE gemt!",FileReadOnly:"Skrivebeskyttet",SaveClose:"Gem & luk",SaveRestart:"Gem & genstart",SuccessfullySaved:"{filename} blev gemt.",UnsavedChanges:"Ugemte ændringer",UnsavedChangesMessage:"Ønsker du at gemme ændringerne i filen {filename}?",UnsavedChangesSubMessage:'Dine ændringer går tabt hvis du ikke gemmer. Du kan deaktivere denne besked i "editor-settings".',Uploading:"Uploader"},l={AreYouSure:"Er du sikker?",EmergencyStop:"Nødstop",No:"Nej",Yes:"Ja"},o={AddBatchToQueue:"tilføj batch til kø",AddToQueue:"Tilføj til kø",AllFiles:"Alle",BedTemp:"Bed temperatur",Cancel:"Annuller",ChamberTemp:"Indelukke temperatur",Count:"Tæl",Create:"Opret",CreateNewDirectory:"Ny mappe",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Vil du slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",Duplicate:"Dupliker",DuplicateFile:"Dupliker fil",EditFile:"Rediger Fil",Empty:"Tom",ExtruderTemp:"Hotend temperatur",Filament:"Filament",FilamentName:"Filament navn",FilamentType:"Filament type",FilamentUsage:"Filament forbrug",FilamentWeight:"Filament vægt",Files:"Filer",Filesize:"Filstørrelse",Free:"Ledig",FreeDisk:"Ledig plads",GCodeFiles:"G-Kode Filer",GcodesRootDirectoryDoesntExists:'Ingen mappe med g-koder fundet. Tjek at opsætning af "path" under [virtual_sdcard] sektionen i printer.cfg er korrekt.',HiddenFiles:"Skjulte filer",InvalidNameAlreadyExists:"Navnet eksisterer allerede, vælg venligst et andet navn.",InvalidNameEmpty:"Feltet må ikke være tomt!",LastEndTime:"Sidste slut tid",LastFilamentUsed:"Sidste filament forbrug",LastModified:"Sidst ændret",LastPrintDuration:"Sidste printtid",LastStartTime:"Sidste start tid",LastTotalDuration:"Sidste totale tid",LayerHeight:"Laghøjde",Name:"Navn",NewDirectory:"Ny mappe",NozzleDiameter:"Nozzle diameter",ObjectHeight:"Total højde",Preheat:"Forvarm",PrintedFiles:"Printede filer",PrintStart:"Start print",PrintTime:"Printtid",RefreshCurrentDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb Fil",ScanMeta:"Skan metadata",ScanMetaSuccess:"Metadata skannet fra: {filename}.",Search:"Søg",SetupCurrentList:"Rediger visning",Slicer:"Slicer",SuccessfullyCreated:"{filename} oprettet.",SuccessfullyDeleted:"{filename} slettet.",SuccessfullyMoved:"{filename} flyttet.",SuccessfullyRenamed:"{filename} omdøbt.",SuccessfullyUploaded:"Upload af {filename} udført!",Total:"Total",UploadNewGcode:"Upload ny G-Code",Used:"Brugt",View3D:"Vis i 3D"},s={CannotUploadFile:"Kan ikke uploade filen!",DropFilesToUploadFiles:"Drop filer her for at uploade"},d={ClearLoadedFile:"Fjern",CNCMode:"CNC Mode",ColorMode:"Farvevisning",Downloading:"Downloader",ForceLineRendering:"Gennemtving Linje Rendering",HDRendering:"HD Rendering (Runde Extrusions)",High:"Høj",LoadCurrentFile:"Aktuel fil",LoadLocal:"Lokal Fil",Low:"Lav",Max:"Maks",Medium:"Medium",ReloadRequired:"Opdatering påkrævet",Rendering:"Rendering",RenderQuality:"Renderingskvalitet",ShowGCode:"Vis G-kode",ShowObjectSelection:"Vis Objekt valg",ShowToolhead:"Vis nozzle",ShowTravelMoves:"Vis Travel",SpecularLighting:"Spejlende belysning",Title:"G-Code Viser",Tracking:"Sporing",Transparency:"Transparens",Ultra:"Ultra",VoxelMode:"Voxel Mode (ASMBL)"},p={Abort:"Afbryd",BedMeshCalibrate:"Kalibrer Bed Mesh",BedMeshRemove:"Slet Bed Mesh",Calibrate:"Kalibrer",Clear:"Slet",CurrentMesh:{Headline:"Nuværende Bed Mesh",Max:"Maks",Min:"Min",Name:"Navn",Range:"Variation",Size:"Størrelse"},DeleteBedMeshProfile:"Slet Bed Mesh profil",DoYouReallyWantToDelete:'Vil du slette "{name}"?',ErrorKlipperNotReady:"Klipper er ikke klar. Kan ikke vise højdekort.",Flat:"Fladt",Heightmap:"Højdekort",InvalidNameAlreadyExists:"Profilnavnet bruges allerede, vælg venligst et andet profilnavn.",InvalidNameAscii:"Navnet er ugyldigt. Der kan kun bruges ascii karakterer",InvalidNameEmpty:"Feltet må ikke være tomt!",InvalidNameReserved:"Profilnavnet 'default' er reserveret af systemet, vælg venligst et andet profilnavn",Later:"Senere",Mesh:"Mesh",Name:"Navn",NoBedMeshHasBeenLoadedYet:"Intet Bed Mesh indlæst.",NoProfile:"Ingen profil tilgængelig",Ok:"Ok",Probed:"Målt",Profiles:"Profiler",Remove:"Fjern",RemoveSaveDescription:"Profilen er markeret til sletning. Klik på GEM KONFIGURATIONfor at fjerne den fra printer.cfg og genstarte Klipper.",Rename:"Omdøb",RenameBedMeshProfile:"Omdøb Bed Mesh profil",SAVE_CONFIG:"GEM KONFIGURATION",ScaleGradient:"Skala graduering",ScaleZMax:"Skalér til z-max.",TitleCalibrate:"Kalibrer nyt Bed Mesh",TitleClear:"Slet bed mesh",TitleHomeAll:"Home alle",Wireframe:"Wireframe"},g={AddNote:"Tilføj note",AllJobs:"Alle job",AvgPrinttime:"Gns. printtid",Cancel:"Annuller",Chart:"Skema",CreateNote:"Gem note",Delete:"Slet",DeleteSelectedQuestion:"Er du sikker på du vil slette alle {count} valgte jobs?",DeleteSingleJobQuestion:"Er du sikker på du vil slette dette job?",Details:"Detaljer",EditNote:"Redigér note",Empty:"Tom",EndTime:"Sluttid",EstimatedFilament:"Estimeret filament",EstimatedFilamentWeight:"Estimeret filament vægt",EstimatedTime:"Estimeret tid",FilamentCalc:"Filament beregnet",FilamentUsage:"Filament brugt",FilamentUsed:"Filament brugt",Filename:"Filnavn",Filesize:"Filstørrelse",FirstLayerBedTemp:"Første lag Bed Temp.",FirstLayerExtTemp:"Første lag Nozzle Temp.",FirstLayerHeight:"Første lag højde",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Antal print",JobDetails:"Jobdetaljer",Jobs:"Job",LastModified:"Sidst ændret",LayerHeight:"Laghøjde",LongestPrinttime:"Længste print",Note:"Note",ObjectHeight:"Objekt Højde",PrintDuration:"Print varighed",PrintHistory:"Print historik",PrintTime:"Print Tid",PrinttimeAvg:"Printtid gns.",Reprint:"Print igen",Save:"Gem",Search:"Søg",SelectedFilamentUsed:"Filament brugt på valgte",SelectedJobs:"Valgte jobs",SelectedPrinttime:"Printtid for valgte",Slicer:"Slicer",SlicerVersion:"Slicer Version",StartTime:"Starttid",Statistics:"Statistik",Status:"Status",StatusValues:{cancelled:"Annulleret",completed:"Færdige",error:"Fejl",in_progress:"Igangværende",klippy_disconnect:"Klippy afbrudt",klippy_shutdown:"Klippy lukket ned",Others:"Andre",server_exit:"Server exit"},Table:"Tabel",TitleExportHistory:"Export History",TitleRefreshHistory:"Opdater historik",TitleSettings:"Indstillinger",TotalDuration:"Total varighed",TotalFilamentUsed:"Filament brugt ialt",TotalJobs:"Totale antal print",TotalPrinttime:"Total printtid",TotalTime:"Total Tid"},m={AllJobs:"Alle Jobs",Cancel:"Annuller",ChangeCount:"Ændre antal",Count:"Tæl",Empty:"Tom",InvalidCountEmpty:"Input må ikke være tom!",InvalidCountGreaterZero:"Input skal være over 0!",JobQueue:"Jobkø",Jobs:"Jobs",Pause:"Pause",RemoveFromQueue:"Fjern fra køen",Start:"Start"},u={ConfigFilesPanel:{AllFiles:"Alle",Cancel:"Annuller",ConfigFiles:"Konfigurationsfiler",ConfigRootDirectoryDoesntExists:'Ingen konfiguration fundet. Tjek venligst opsætningen af "config_path" under [file_manager] sektionen af Moonraker konfigurationen.',Create:"Ny",CreateDirectory:"Ny mappe",CreateFile:"Ny Fil",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Vil du slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",Duplicate:"Dupliker",DuplicateFile:"Dupliker fil",EditFile:"Rediger fil",Empty:"Tom",Files:"Filer",Filesize:"Filstørrelse",Free:"Ledig",FreeDisk:"Ledig plads",HiddenFiles:"Skjulte filer",HideBackupFiles:"Skjul backupfiler",LastModified:"Sidst ændret",Name:"Navn",RefreshDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb fil",Root:"Rod",SetupCurrentList:"Indstil visning",ShowFile:"Vis fil",Total:"Total",UploadFile:"Upload Fil",Uploading:"Uploader",Used:"Brugt"},EndstopPanel:{Endstop:"Endstop",EndstopInfo:'Klik på "Sync"-knappen nederst til højre for at opdatere Endstop status.',Endstops:"Endstops",open:"Åben",TRIGGERED:"Aktiveret"},LogfilesPanel:{Accept:"Acceptér",Cancel:"Annuller",Logfiles:"Logfiler",Rollover:"Nulstil log-filer",RolloverDescription:"Vælg hvilke log-filer der skal nulstilles",RolloverToastFailed:'Nulstillings fejl-log for "{name}": {message}',RolloverToastSuccessful:'Filen: "{name}" blev nulstillet.'},SystemPanel:{Constants:"Konstanter",Cpu:"CPU",HostDetails:"Værtsdetaljer",LastStats:"Sidste detaljer",Load:"Belastning",Memory:"RAM",NoMoreInfos:"Ikke mere info",SystemLoad:"Systembelastninger",Values:{Awake:"Vågen/Aktiv: {awake}",Bandwidth:"Båndbredde: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Frekvens: {frequency}",Load:"Belastning: {load}",Memory:"Hukkommelse: {memory}",Os:"OS: {os}",Received:"Modtaget: {received}",Temp:"Temp: {temp}°C",TempMax:"maks: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Sendt: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Afbryd",AreYouSure:"Er du sikker?",CheckForUpdates:"Tjek for opdateringer",Close:"Luk",CommitHistory:"Forpligtelseshistorik",Commits:"Forpligtelse",CommitsAvailable:"Ingen commits tilgængelige | {count} commits tilgængelige | {count} commits tilgængelige",CommitsOnDate:" Forpligtelse af {date}",CommittedDaysAgo:"Forpligtelse delt for {days} dage siden",CommittedHoursAgo:"Forpligtelse delt for {hours} timer siden",CommittedOnDate:"Forpligtelse delt d. {date}",CommittedYesterday:"Forpligtelse delt igår",ConfigChanges:"Konfigurationsændringer",Corrupt:"Ødelagt",CountPackagesCanBeUpgraded:"{count} pakker der kan opgraderes",Detached:"Løsrevet",Dirty:"Uren-kode",GenericUpdateQuestion:"Tjek Forpligtelseshistorikken (hvis tilgængelig) og GitHub siden for dette projekt, for at se om der er behov for manuelle justeringer for denne opdatering.",GitHubPage:"GitHub side",HardRecovery:"Hård nulstilling",InitUpdateManager:'Opdateringsmanageren er ikke initialiseret endnu. Dette er normalt ved første opstart. Klik venligst på "Opdater" for at initialisere alle komponenter.',Invalid:"Ugyldig",IUnderstandTheRisks:"Jeg forstår risisci",KlipperUpdateQuestionConfig:"Denne opdatering kan indeholde ændringer til konfigurationsparametre, som efterfølgende skal modificeres i printer.cfg filen. Tjek ændringsloggen for yderligere detaljer",KlipperUpdateQuestionFirmware:"Denne opdatering kan indeholde ændringer til værts-firmwaren. Bundkortet skal muligvis flashes med opdateret firmware før printeren kan bruges igen.",LinkToGithub:"Link til GitHub",MoonrakerUpdateQuestion:"Dette vil opdatere Moonraker API. Det kan være nødvendigt at ændre i moonraker.conf filen før printeren kan bruges igen.",MoreCommitsInfo:"Der kan maksimalt vises 30 forpligtelser her. For at se dem alle, tryk her:",OSPackages:"OS-Pakker",SoftRecovery:"Blød nulstilling",StartUpdate:"Start opdatering",System:"System",ThesePackagesCanBeUpgrade:"Pakker kan opgraderes",Unknown:"Ukendt",Update:"Opdater",UpdateAll:"Opdater alle komponenter",UpdateManager:"Opdateringsmanager",UpdateWarning:"Opdateringsadvarsel: {name}",Upgrade:"Opgrader",UpgradeableSystemPackages:"Systempakker med opdateringer",UpToDate:"up-to-date",WebClientUpdateQuestion:"I visse tilfælde kan opdateringer til webklienten forårsage problemer med inkompatibilitet. Se ændingsloggen for yderligere information"}},c={Abort:"Afbryd",Accept:"Acceptér",Advanced:"Avanceret",Headline:"Manuel Probing"},k={ExtruderControlPanel:{Allowed:"Tilladt",EstimatedExtrusion:"Estimeret ekstrudering",Extrude:"Extrude",ExtruderTempTooLow:"Hotend temp. <",ExtrusionFactor:"Ekstruderingsfaktor",ExtrusionFeedrate:"Ekstruderingsfødehastighed",FilamentLength:"Filamentlængde",FirmwareRetractionSettings:{RetractLength:"Retract længde",RetractSpeed:"Retract hastighed",UnretractExtraLength:"Unretract ekstra længde",UnretractSpeed:"Unretract hastighed"},Headline:"Ekstruder Kontrolpanel",LoadFilament:"Fød filament",PressureAdvanceSettings:{Advance:"Advance",Extruder:"Ekstruder",SmoothTime:"Smooth Time"},Requested:"Anmodet",Retract:"Retract",TooLargeExtrusion:"Ekstruderingen er for lang!",UnloadFilament:"Fjern filament"},FarmPrinterPanel:{ReconnectToPrinter:"Genopret forbindelse",SwitchToPrinter:"Skift til printer",WebcamOff:"Sluk"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Tjek at Klipper-servicen kører, samt at klippy_uds_address er korrekt konfigureret i moonraker.conf.",FirmwareRestart:"Genstart alt",MoonrakerCannotConnect:"Moonraker kan ikke forbinde til Klipper!",PowerOn:"Tænd",PrinterSwitchedOff:"Printeren er slukket",PrinterSwitchedOffDescription:"Printeren er slukket og Klipper kan ikke forbinde til den. Tryk på nedenstående knap for at tænde printeren",Restart:"Genstart",ServiceReports:"{service} rapporter"},MachineSettingsPanel:{Headline:"Printer indstillinger",MotionSettings:{Acceleration:"Acceleration",MaxAccelToDecel:"Maks. accel. til decel.",SquareCornerVelocity:"Hastighed for 90° hjørne",Velocity:"Hastighed (Feedrate)"}},MacrosPanel:{Headline:"Makroer",Send:"Send"},MiniconsolePanel:{Autoscroll:"Automatisk rulning",Headline:"Terminal",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",SendCode:"Send kode...",SetupConsole:"Terminalindstillinger"},MinSettingsPanel:{IncludeMainsailCfg:"Husk at inkludere mainsail.cfg i din CONFIG fil.",IsNotDefinedInConfig:"er ikke defineret i CONFIG.",MissingConfiguration:"Konfiguration mangler",MoreInformation:"Mere information"},MiscellaneousPanel:{Headline:"Diverse",Light:{Blue:"blå",Green:"grøn",Red:"rød",White:"hvid"},RunoutSensor:{Detected:"Fundet",Disabled:"Deaktiveret",Empty:"Tom"}},PowerControlPanel:{Error:"Fejl",Off:"Sluk",On:"Tænd",PowerControl:"Strømstyring"},SpoolmanPanel:{Cancel:"Annuller",ChangeSpool:"Skift spool",DaysAgo:"{days} dage siden",EjectSpool:"Afmontér spole",EjectSpoolQuestion:"Er du sikker på du ønsker at afmontere spolen?",Filament:"Filament",FilamentTypeMismatch:"Materialet på den aktive spole({spoolType}) matcher ikke materialet i G-koden ({fileType}).",Headline:"Spoolman",LastUsed:"Sidst brugt",Location:"Placering",Material:"Materiale",Never:"Aldrig",NoActiveSpool:"Filamentforbrug registreres ikke. Vælg en spole for at begynde.",NoResults:"Ingen spole fundet der matcher søgekriterierne.",NoSpools:"Ingen spoler tilgængelige",NoSpoolSelected:"Ingen spole valgt. Vælg en spole for at registrere filamentforbrug.",OpenSpoolManager:"Åben SpoolMan",Refresh:"Opdatér",Search:"Søg",SelectSpool:"Vælg spole",Today:"I dag",TooLessFilament:"Den nuværende spole har muligvis ikke nok filament til det valgte print. ({spoolWeight}g af {fileWeight}g)",Weight:"vægt",Yesterday:"Igår"},StatusPanel:{CancelPrint:"Afbryd print",ClearPrintStats:"Slet printstatistik",Difference:"Opvarmning",EmptyGcodes:"Ingen G-kode tilgængelig.",EmptyJobqueue:"Der er ingen jobs i kø.",Estimate:"Estimeret",ETA:"ETA",ExcludeObject:{Cancel:"Annuller",Excluded:"Ekskluderet",ExcludeObject:"Ekskluder objekt",ExcludeObjectHeadline:"Ekskluder objekt",ExcludeObjectText:'Vil du ekskludere "{name}"?'},Filament:"Filament",File:"Fil",Files:"Filer",Flow:"Flow",Headline:"Status",Jobqueue:"Jobkø",JobqueueMoreFiles:"Ikke flere jobs | Et job til | {count} jobs tilbage",Layer:"Lag",Max:"maks",ObjectHeight:"Objekt Højde",PauseAtLayer:{Abort:"Afbryd",Accept:"Acceptér",AtLayer:"ved lag",Call:"Kør",DescriptionPauseAtLayerActive:'Denne funktion er allerede aktiv og vil køre "{call}" ved lag: {layer}. Hvis du kører kommandoen igen overskrives disse indstillinger.',DescriptionPauseNextLayerActive:'Denne funktion er allerede aktiv og vil køre "{call}" ved næste lag.',Layer:"Lag",NextLayer:"Næste lag",PauseAtLayer:"Pause ved lag",Type:"Type"},PausePrint:"Pause print",Print:"Reel printtid",PrintTime:"Print Tid",ReprintJob:"Print job igen",Requested:"Anmodet",ResumePrint:"Genoptag print",Slicer:"Slicer",Speed:"Hastighed",Status:"Status",Total:"Total",Unknown:"Ukendt"},TemperaturePanel:{AutoscaleChart:"Autoskalér diagram",Avg:"Gns",Cooldown:"Nedkøling",Current:"Nuværende",Dataset:{Power:"PWM-power",Speed:"PWM-hastighed",Target:"Indstillet temperatur",Temperature:"Nuværende temperatur"},Headline:"Temperaturer",HideMcuHostSensors:"Skjul værts/MCU sensorer",HideMonitors:"Skjul overvågere",Max:"maks",Min:"min",Name:"Navn",Presets:"Forudindstillinger",SetupTemperatures:"Temperaturvisningsindstillinger",ShowChart:"Vis diagram",ShowNameInChart:"Vis {name} i diagram",ShowNameInList:"Vis {name} på liste",State:"Status",Target:"Indstillet",TemperaturesInChart:"Temperatur [°C]",TempTooHigh:"Temperaturen er for høj for {name}! (max: {max})",TempTooLow:"Temperaturen er for lav for {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absolut",ALL:"Alle",Headline:"Kontrolpanel",PleaseConfigureSteps:"Konfigurer steps",Position:"Position",QGL:"QGL",Relative:"relativ",SettingsInterfaceControl:"Indstillinger > Interface > Control",SpeedFactor:"Hastighed",ZTilt:"Z Tilt"},WebcamPanel:{All:"Alle",FPS:"FPS",Headline:"Webcam",NoWebcam:'Intet webcam tilgængeligt. Tilføj et under "Interfaceindstillinger" -> "Webcams".',UnknownWebcamService:"Ukendt Webcam service"},ZoffsetPanel:{Clear:"Nulstil",Headline:"Z-Offset",Later:"Senere",Ok:"OK",Save:"Gem",SaveConfig:"GEM KONFIGURATION",SaveInfoDescription:'Det nye z-offset er blevet beregnet og registreret. Klik på "GEM KONFIGURATION" for at gemme det nye z-offset i CONFIG og genstarte Klipper.',SaveInfoDescriptionPrint:'Det nye z-offset er blevet beregnet og registreret. Klik på "GEM KONFIGURATION" i topbaren efter endt print for at gemme det nye z-offset i CONFIG og genstarte Klipper.',SaveInfoHeadline:"Information"}},f={AreYouSure:"Er du sikker?",No:"Nej",TurnDeviceOff:"Sluk {device}",TurnDeviceOn:"Tænd {device}",Yes:"Ja"},v={Console:"Terminal",Dashboard:"Kontrolpanel","G-Code Files":"G-Code Filer","G-Code Viewer":"G-Code Viser",Heightmap:"Højdekort",History:"Historik",Machine:"Printer",Printers:"Printere",Timelapse:"Timelapse",Webcam:"Webcam"},S={Accept:"Acceptér",Base:"Udgangspunkt",ErrorText:"Noget gik galt under målingsprocessen",Headline:"Bed-skrue justering",Retry:"Forsøg igen"},b={AddPrinter:"Tilføj Printer",AddPrintersToJson:"Tilføj venligst Printere til config.json.",CannotConnectTo:"Kan ikke forbinde med {host}.",ChangePrinter:"Skift Printer",Connecting:"Forbinder med {host}",ConnectionFailed:"Forbindelse fejlede",EditPrinter:"Rediger Printer",Hello:"Hej og velkommen til fjernbetjeningsversionen af Mainsail!",HostnameInvalid:"Ugyldigt værtsnavn/IP",HostnameIp:"Værtsnavn/IP",HostnameRequired:"Værtsnavn er påkrævet",Port:"Port",PortRequired:"Port er påkrævet",RememberToAdd:'Husk at tilføje {cors} i moonraker.conf under "cors_domains".',SelectPrinter:"Vælg printer",TryAgain:"Prøv igen",UpdatePrinter:"Opdater Printer",YouCanFindMore:"Du kan finde flere detaljer her"},D={Cancel:"Annuller",Close:"Luk",ConsoleTab:{AddFilter:"Tilføj filter",Console:"Terminal",CreateHeadline:"Nyt filter",Direction:"Retning",DirectionShell:"Sidste handling nederst",DirectionTable:"Sidste handling øverst",EditHeadline:"Rediger filter",EntryStyle:"Indtastnings-Design",EntryStyleCompact:"Kompakt",EntryStyleDefault:"Standard",Filters:"Filtre",Height:"Højde",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",Name:"Navn",Regex:"Regex",StoreButton:"Gem filter",UpdateButton:"Opdater filter"},ControlTab:{Bars:"Barer",Circle:"Cirkel",Control:"Kontrol",Cross:"Kryds",EnableXYHoming:"Aktivér kombineret X & Y homing",EstimatedExtrusionInfo:"Vis estimerede ekstruderingsinformationer",EstimatedExtrusionInfoDescription:"Vis/Skjul information om estimerede ekstruderinger baseret på ekstruderingsmængde og hastighed",HideDuringPrint:"Skjul akse kontrol under print",InvertXMovement:"Invertér X",InvertYMovement:"Invertér Y",InvertZMovement:"Invertér Z",IsDefault:"Standard",MaximumValues:"Maksimumværdier",MaximumValuesVisibility:"Vis maksimumværdier",MinimumValues:"Minimumsværdier",MotorsOff:"Slukkede motorer{isDefault}",MoveDistancesEInMm:"Distance E i mm",MoveDistancesInMm:"Distance i mm",MoveDistancesXYInMm:"Distance XY i mm",MoveDistancesZInMm:"Distance Z i mm",QuadGantryLevel:"Firarms nivellering {isDefault}",SpeedEInMms:"Hastighed E i mm/s",SpeedXY:"Hastighed XY",SpeedZ:"Hastighed Z",Style:"Stil",ValueGreaterThan:"Værdi større end {value}",ZOffsetIncrements:"Z-offset trin (i mm)",ZTiltAdjust:"Z-Tilt justering{isDefault}"},DashboardTab:{Dashboard:"Kontrolpanel",Desktop:"Desktop",Mobile:"Mobil",ResetLayout:"Nulstil layout",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Rediger",EditorTab:{ConfirmUnsavedChanges:"Spørg om at gemme ændringer",ConfirmUnsavedChangesDescription:"Hvis aktiv beder Editor om bekræftelse på at gemme eller kassere. Ellers bliver ændringer automatisk kasseret.",Editor:"Editor",KlipperRestartMethod:"Metode for genstart af Klipper",KlipperRestartMethodDescription:"Vælg hvilken metode der skal bruges ved brug af 'Gem & Genstart' når der redigeres i Klipper config filer.",Spaces:"Mellemrum: {count}",TabSize:"Tabuleringsstørrelse",TabSizeDescription:"Juster hvor mange mellemrum der skal tilføjes ved tryk på TAB",UseEscToClose:"Tryk ESC for at lukke Editor.",UseEscToCloseDescription:"Tillader at ESC lukker Editor"},GCodeViewerTab:{BackgroundColor:"Baggrundsfarve",ExtruderColor:"Ekstruder farve",GCodeViewer:"G-Code viser",GridColor:"Grid farve",MaxFeed:"Maksimum hastighed",MinFeed:"Minimum hastighed",ProgressColor:"Fremgangsfarve",ShowAxes:"Vis akser"},GeneralTab:{"12hours":"12-timers ({time})","24hours":"24-timers ({time})",Backup:"Backup",BackupDialog:"Vælg de sektioner du ønsker at lave backup af:",CalcEstimateTime:"Beregn estimeret printtid",CalcEstimateTimeDescription:"Hvis flere er valgt vil et gennemsnit blive brugt",CalcEtaTime:"Beregn sluttidspunkt for print",CalcEtaTimeDescription:"Hvis flere er valgt vil et gennemsnit blive brugt",CalcPrintProgress:"Fremgangsberegning",CalcPrintProgressDescription:"Metode til beregning af fremgang.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Filposition (absolut)",FileRelative:"Filposition (relativ)",Slicer:"Slicer (M73)"},CannotReadJson:"Kan ikke læse backup-fil",DateFormat:"Datoformat",DbConsoleHistory:"Terminal Historik",DbHistoryJobs:"Jobhistorik",DbHistoryTotals:"Totalhistorik",DBNavigation:"Navigation",DbTimelapseSettings:"Timelapse indstillinger",DbView:"Vis indstillinger",EstimateValues:{Filament:"Filament",File:"Fil",Slicer:"Slicer"},Everything:"Alt",FactoryDialog:"Vælg venligst de sektioner du ønsker at nulstille:",FactoryReset:"Komplet nulstilling",General:"Generelt",Language:"Sprog",MainsailSettingsMoonrakerDb:"Mainsails indstillinger i Moonrakers database",PrinterName:"Printernavn",Reset:"Nulstil",Restore:"Gendan",RestoreDialog:"Vælg de sektioner du ønsker at gendanne fra backup:",TimeFormat:"Tidsformat"},InterfaceSettings:"Interfaceindstillinger",MacrosTab:{Add:"Tilføj",AddGroup:"Tilføj gruppe",AvailableMacros:"Tilgængelige makroer",ChangeMacroColor:"Skift farve på knappen.",Color:"Farve",CountMacros:"Ingen Makroer tilføjet | {count} Makro | {count} Makroer",Custom:"Brugerdefineret",CustomColor:"Brugerdefineret farve",DeletedMacro:"Makro fjernet",DeleteMacroFromGroup:"Fjern makro fra gruppe.",EditGroup:"Edit Gruppe",Error:"Fejl",Expert:"Ekspert",General:"Generelt",Group:"Gruppe",GroupMacros:"Gruppér makroer",Macrogroups:"Grupper",Macros:"Makroer",Management:"Håndtering",Name:"Navn",NoAvailableMacros:"Ingen tilgængelige makroer.",NoGroups:"Ingen grupper fundet...",NOMacros:"Ingen makroer fundet...",NoMacrosInGroup:"Ingen makroer i denne gruppe.",Primary:"Primær",Secondary:"Sekundær",ShowInStatePaused:"Vis/skjul hvis printer er på pause.",ShowInStatePrinting:"Vis/skjul hvis printer er aktiv.",ShowInStateStandby:"Vis/skjul hvis printer er inaktiv.",Simple:"Simpel",Status:"Status",Success:"Succes",UnknownGroup:"Ukendt gruppe",Warning:"Advarsel"},MiscellaneousTab:{AddGroup:"Tilføj gruppe",AddPreset:"Tilføj forudindstilling",Color:"Farve",CreateGroup:"Tilføj gruppe",CreatePreset:"Tilføj forudindstilling",End:"Slut",EndDescription:"Sidste LED i denne gruppe.",Groups:"Grupper",GroupSubTitle:"Start: {start}, Slut: {end}",LightGroups:"{name} - Grupper",LightPresets:"{name} - Forudindstillinger",Miscellaneous:"Diverse",Name:"Navn",NoDevicesFound:"Ingen enheder fundet",NoGroupFound:"Ingen gruppe fundet",NoPresetFound:"Ingen forudindstilling fundet",Presets:"Forudindstillinger",Start:"Første",StartDescription:"Første LED i denne gruppe.",UnableToLoadLight:"Kunne ikke indlæse LED",UnableToLoadPreset:"Kunne ikke indlæse forudindstilling"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"Tilføj forudindstilling",Cooldown:"Nedkøling",CreateHeadline:"Ny forudindstilling",CustomGCode:"Brugerdefineret G-Code",EditCooldown:"Rediger nedkøling",EditHeadline:"Rediger forudindstilling",ErrorInvalidValue:"Ugyldig værdi",ErrorNameNotUnique:"Navnet er allerede i brug",ErrorNameRequired:"Navn skal udfyldes",Name:"Navn",PreheatPresets:"Forudindstillinger",PresetInfo:"Du skal indstille mindst én temperatur eller g-kode.",PresetNamePlaceholder:"Navn (skal udfyldes)",StoreButton:"Gem forudindstilling",UpdateButton:"Opdater forudindstilling",UpdateCooldown:"Opdater nedkøling"},RemotePrintersTab:{AddPrinter:"Tilføj printer",EditPrinter:"Rediger printer",Hostname:"Værtsnavn",Port:"Port",RemotePrinters:"Printere",UpdatePrinter:"Opdater printer",UseConfigJson:"InstanceDB = JSON fundet. Brug venligst config.json til at ændre på printerlisten."},Store:"Gem",TimelapseTab:{Autorender:"Autorendering",AutorenderDescription:"Hvis aktiv, vil Timelapse video automatisk blive renderet efter afsluttet print.",Camera:"Kamera",CameraDescription:"Vælg hvilket kamera der skal bruges",ConstantRateFactor:"Constant Rate Faktor",ConstantRateFactorDescription:'Konfigurerer Kvalitet / Filstørrelse af den renderede video. Kan justeres mellem 0-51, Hvor 0 er tabsfri, 23 er standard og 51 er værste kvalitet (mindste filstørrelse). En lavere værdi giver højere kvalitet, og et "normalt" område er 17-28. 17 eller 18 kan betragtes som visuelt tabsfrit.',duplicatelastframe:"Kopier sidste frame",duplicatelastframeDescription:"Kopierer sidste frame i videoen",Enabled:"Aktiveret",EnabledDescription:"Hvis inaktiv, bliver G-Kode makroer ignoreret og AutoRendering bliver sprunget over.",Extraoutputparams:"Ekstra output parametre",ExtraoutputparamsDescription:"Definerer ekstra output parametre til FFMPEG. Bemærk: Udfyldning af dette felt vil deaktivere rotationsindstillinger",FwRetract:"Firmware Retract",FwRetractDescription:"Brug firmware retraction i timelapse makroen",GcodeVerbose:"Beskrevet G-Kode",GcodeVerboseDescription:"Hvis aktiv, vil G-Code skrive informationer i terminalen",General:"Generelt",HyperlapseCycle:"Hyperlapse cyklus tid",HyperlapseCycleDescription:"Frames optages med det angivne tidsmellemrum (sek.)",Mode:"Modus",ModeDescription:'Vælg mellem "Layermacro" og "Hyperlapse" (tidsbaseret) modus',OutputFramerate:"Output Framerate",OutputFramerateDescription:'Definerer framerate i videoen. Bemærk: Dette ignoreres hvis "variable_fps" er aktiveret',Parkhead:"Parker Hotend",ParkheadDescription:"Hvis aktiv, vil hotend blive parkeret før der tages billeder.",Parkpos:"Parkeringsposition",ParkposDescription:"Vælg parkeringsposition",ParkTime:"Parkeringstid",ParkTimeDescription:"Tilføj yderligere tid til parkering for bedre præcision.",Pixelformat:"Pixelformat",PixelformatDescription:"Definerer pixelformatet i videoen",PosDZ:"Position Z",PosDZDescription:"Parkeringspostion Z (relativ)",PosX:"Position X",PosXDescription:"Parkeringspostion X (absolut)",PosY:"Position Y",PosYDescription:"Parkeringspostion Y (absolut)",PreviewImage:"Forhåndsvisning af billede",PreviewImageDescription:"Gem en forhåndsvisning med samme navn som videoen",RenderingOptions:"Renderingsindstillinger",RetractDistance:"Retract distance",RetractDistanceDescription:"Længden af retractions.",RetractSpeed:"Retract hastighed",RetractSpeedDescription:"Hastighed der bruges til retractions.",SaveFrames:"Gem Frames",SaveFramesDescription:"Gem frames til zip-fil for ekstern rendering",StreamDelayCompensation:'Kompensering for "Stream-Delay" forsinkelse',StreamDelayCompensationDescription:'Kompenser "frame capture"',Targetlength:"Ønsket længde",TargetlengthDescription:"Den ænskede længde på videoen når Variabel FPS er aktiveret",TimeFormatCode:"Tidsformat kode",TimeFormatCodeDescription:"Angiver hvordan tid skal defineres i output filen",Timelapse:"Timelapse",TravelSpeed:"Travel-hastighed",TravelSpeedDescription:"Travel-hastighed til og fra parkeringsposition",UnretractDistance:"Unretract distance",UnretractDistanceDescription:"Længden af unretracts.",UnretractSpeed:"Unretract hastighed",UnretractSpeedDescription:"Hastigheden der bruges til unretracts.",VariableFps:"Variabel FPS",VariableFpsDescription:"Hvis aktiv, vil framrate blive beregnet ud fra ønsket længde.",VariableFpsMax:"Variabel FPS maks",VariableFpsMaxDescription:"Største værdi for variabel FPS",VariableFpsMin:"Variabel FPS min",VariableFpsMinDescription:"Mindste værdi for variabel FPS"},UiSettingsTab:{BedScrewsDialog:"Bed-skrue justeringsvindue",BedScrewsDialogDescription:"Viser vindue til hjælp med Bed-skrue justering.",BigThumbnailBackground:"vælg baggrundsfarver for stor forhåndsvisning",BoolBigThumbnail:"Stor forhåndsvisning",BoolBigThumbnailDescription:"Vis et stort billede i statuspanelet under print.",BoolHideUploadAndPrintButton:'Skjul "Upload og Print" knap',BoolHideUploadAndPrintButtonDescription:'Vis eller skjul "Upload and Print" knappen i top-baren.',ConfirmOnEmergencyStop:"Kræv bekræftelse før Nødstop",ConfirmOnEmergencyStopDescription:"Viser en bekræftelses dialogboks ved tryk på Nødstop",ConfirmOnPowerDeviceChange:"Kræv bekræftelse ved ændringer på Enhedens strømtilstand",ConfirmOnPowerDeviceChangeDescription:"Vis bekræftelse ved ændringer på Enhedens strømtilstand",DefaultNavigationState:"Standard for Navigationsfanen",DefaultNavigationStateAlwaysClosed:"Altid lukket",DefaultNavigationStateAlwaysOpen:"Altid åben",DefaultNavigationStateDescription:"Vælg standardindstilling for navigationsfanen.",DefaultNavigationStateLastState:"Sidste tilstand",DisableFanAnimation:"Deaktivér animation af blæsere",DisableFanAnimationDescription:"Dette kan fjerne lidt af belastningen for nogle browsere.",DisplayCANCEL_PRINT:"Vis Afbryd print",DisplayCANCEL_PRINTDescription:"Viser Afbryd print knappen konstant - ingen tofaktor godkendelse nødvendig.",GcodeThumbnails:"G-Kode forhåndsvisninger",GcodeThumbnailsDescription:"Klik på knappen for mere information.",Guide:"Guide",HideSaveConfigButtonForBedMesh:"Skjul GEM KONFIGURATION knap for ændringer i højdekort",HideSaveConfigButtonForBedMeshDescription:"Skjul GEM KONFIGURATION, hvis det kun er ændringer i højdekort der venter på at blive gemt i Klipper.",HideUpdateWarnings:"Skjul opdateringsadvarsler",HideUpdateWarningsDescription:"Dette vil skjule alle advarsler om opdateringer i Opdateringsmanageren.",LockSliders:"Lås sliders på touch-enheder",LockSlidersDelay:"Forsinkelse på låsning af sliders",LockSlidersDelayDescription:"Sliders vil låse efter det angivne tidsrum (sek). Hvis sat til 0 eller efterladt tomt, vil Sliders kun låse ved opdatering/genindlæsning af siden.",LockSlidersDescription:"Sliders skal låses op på touchenheder før de kan ændres.",Logo:"Logo",ManualProbeDialog:"Probe justeringsvindue",ManualProbeDialogDescription:"Viser vindue til hjælp med justering af Proge/Z-offset",NavigationStyle:"Navigationsstil",NavigationStyleDescription:"Skift navigationens udseende",NavigationStyleIconsAndText:"Ikoner + Tekst",NavigationStyleIconsOnly:"Kun ikoner",PowerDeviceName:"Printer strømenhed",PowerDeviceNameDescription:"Vælg hvilken strømenhed i Moonraker der styrer printerens strøm.",Primary:"Primær",ScrewsTiltAdjustDialog:"Bed-skrue justeringsvindue til Probe",ScrewsTiltAdjustDialogDescription:"Viser vindue til hjælp med Bed-skrue justeringer ved brug af proben.",TempchartHeight:"Temperaturgrafens højde",TempchartHeightDescription:"Ændrer højden på grafen i Temperaturvisningen.",UiSettings:"UI-indstillinger"},Update:"Opdater",WebcamsTab:{AddWebcam:"Tilføj webcam",CreateWebcam:"Nyt Webcam",EditCrowsnestConf:"Redigér crowsnest.conf",EditWebcam:"Rediger Webcam",FlipWebcam:"Vend webcam-billedet:",HideFps:"Skjul FPS",Hlsstream:"HLS Stream",Horizontally:"horisontalt",IconBed:"Bed",IconCam:"Kamera",IconDoor:"Dør",IconFilament:"Filament",IconHot:"Bål",IconMcu:"MCU",IconNozzle:"Dyse",IconPrinter:"Printer",Ipstream:"IP Kamera",JMuxerStream:"Rå h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptiv MJPEG-Streamer (eksperimental)",Name:"Navn",NameAlreadyExists:"Navnet bruges allerede",Required:"Krævet",Rotate:"Rotér",SaveWebcam:"Gem Webcam",Service:"Service",TargetFPS:"Ønsket FPS",UpdateWebcam:"Opdater Webcam",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikalt",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},T={AllFiles:"Alle",Autorender:"Autorendering",Cancel:"Annuller",Create:"Opret",CreateNewDirectory:"Ny mappe",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Er du sikker på du vil slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",DuplicateLastframe:"Dupliker sidste frame",Empty:"Ingen færdige Timelapse filer fundet.",Enabled:"Aktiv",EstimatedLength:"Estimeret længde",Files:"Filer",Filesize:"Filstørrelse",Fixed:"Fast",Framerate:"Framerate",Frames:"Frames",Free:"Ledig",FreeDisk:"Ledig plads",LastModified:"Sidst ændret",MaxFramerate:"Maks. framerate",MinFramerate:"Min. framerate",Name:"Navn",NewDirectory:"Ny mappe",NoActiveTimelapse:"Ingen aktive Timelapse",Preview:"Forhåndsvisning",RefreshCurrentDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb fil",Render:"Rendering",RenderSettings:"Indstillinger for rendering",SaveFrames:"Gem frames",Search:"Søg",StartRender:"Start rendering",Status:"Status",TargetFps:"Ønsket FPS",Targetlength:"Ønsket længde",TimelapseFiles:"Timelapse Filer",TimelapseRendering:"Timelapse rendering",TimelapseRenderingSuccessful:"Timelapse rendering succesfuld",Total:"Total",Type:"Type",Used:"Brugt",Variable:"Variabel",Video:"Video"},F="Dansk",h={App:e,BedScrews:t,ConnectionDialog:r,Console:i,Dialogs:n,Editor:a,EmergencyStopDialog:l,Files:o,FullscreenUpload:s,GCodeViewer:d,Heightmap:p,History:g,JobQueue:m,Machine:u,ManualProbe:c,Panels:k,PowerDeviceChangeDialog:f,Router:v,ScrewsTiltAdjust:S,SelectPrinterDialog:b,Settings:D,Timelapse:T,title:F};export{e as App,t as BedScrews,r as ConnectionDialog,i as Console,n as Dialogs,a as Editor,l as EmergencyStopDialog,o as Files,s as FullscreenUpload,d as GCodeViewer,p as Heightmap,g as History,m as JobQueue,u as Machine,c as ManualProbe,k as Panels,f as PowerDeviceChangeDialog,v as Router,S as ScrewsTiltAdjust,b as SelectPrinterDialog,D as Settings,T as Timelapse,h as default,F as title}; diff --git a/dirs/mainsail/assets/de-1c7e5778.js b/dirs/mainsail/assets/de-1c7e5778.js deleted file mode 100644 index cf468bd..0000000 --- a/dirs/mainsail/assets/de-1c7e5778.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{BrowserWarnings:{Description:"Die verwendete {name} Version ({version}) ist veraltet und wird nicht vollständig unterstützt. Mainsail benötigt die Version {minVersion} oder höher.",Headline:"Veralteter Browser"},DependencyDescription:"Die momentane {name} Version unterstützt nicht alle Funktionen von Mainsail. Aktualisiere {name} mindestens auf Version {neededVersion}.",DependencyName:"Abhängigkeit: {name}",DismissAll:"Alles verwerfen",KlipperWarnings:{DeprecatedOption:"Option '{option}' im Abschnitt '{section}' ist veraltet und wird in einem zukünftigen Release entfernt.",DeprecatedOptionHeadline:"Veralterte Klipper Option",DeprecatedValue:"Wert '{value}' in Option '{option}' im Abschnitt '{section}' ist veraltet und wird in einem zukünftigen Release entfernt.",DeprecatedValueHeadline:"Veralteter Klipper Wert",KlipperWarning:"Klipper Warnung"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Beim Laden der Moonraker-Komponente '{component}' wurde ein Fehler festgestellt. Bitte prüfe die Logdatei und behebe das Problem.",MoonrakerFailedInitComponentDescription:"Beim Initialisieren der Moonraker-Komponente '{component}' wurde ein Fehler festgestellt. Bitte prüfe die Logdatei und behebe das Problem.",MoonrakerInitComponent:"Init. Moonraker: {component}",MoonrakerWarning:"Moonraker Warnung",UnparsedConfigOption:"Nicht erkannte Config-Option '{option}: {value}' in Abschnitt [{section}] entdeckt. Dies kann eine Option sein, die nicht mehr verfügbar ist, oder das Ergebnis eines Moduls sein, das nicht geladen werden konnte. In Zukunft wird dies zu einem Startfehler führen.",UnparsedConfigSection:"Nicht erkannter Config-Abschnitt [{section}] gefunden. Dies kann das Ergebnis einer Komponente sein, die nicht geladen werden konnte. In Zukunft wird dies zu einem Startfehler führen."},Never:"nie",NextReboot:"nächsten Reboot",NoNotification:"Keine Benachrichtigung vorhanden",Notifications:"Benachrichtigungen",Remind:"Errinnere:"},NumberInput:{GreaterOrEqualError:"Muss größer oder gleich {min} sein!",MustBeBetweenError:"Muss zwischen {min} und {max} liegen!",NoEmptyAllowedError:"Feld darf nicht leer sein!"},Printers:"Drucker",TheServiceWorker:{DescriptionNeedUpdate:"Der lokale Cache ist veraltet und muss aktualisiert werden. Bitte klicke auf den Button unten, um den Cache zu aktualisieren.",TitleNeedUpdate:"PWA benötigt ein Update",Update:"aktualisieren"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM-Kern(e) sind derzeit gedrosselt.",DescriptionFrequencyCapped:"rPi ARM max Frequenz ist derzeit auf 1,2 GHz begrenzt.",DescriptionPreviouslyFrequencyCapped:"Die maximale ARM-Frequenz des rPi war seit dem letzten Einschalten mindestens einmal auf 1,2 GHz begrenzt.",DescriptionPreviouslyTemperatureLimited:"Die Temperatur des rPi uC (nur 3A+/3B+) lag seit dem letzten Einschalten mindestens einmal über dem Soft-Limit (Standard 60C).",DescriptionPreviouslyThrottled:"rPI ARM-Kern(e) wurde(n) seit dem letzten Einschalten mindestens einmal gedrosselt.",DescriptionPreviouslyUnderVolted:"rPI-Versorgungsspannung ist seit dem letzten Einschalten mindestens einmal unter 4,65 V gefallen.",DescriptionTemperatureLimitActive:"Die Temperatur des rPi uC (nur 3A+/3B+) liegt derzeit über dem Soft-Limit (Standard 60C).",DescriptionUnderVoltageDetected:"rPI-Versorgungsspannung derzeit unter 4,65V",TitleCurrentlyThrottled:"Drosselung aktiv",TitleFrequencyCapped:"Frequenz begrenzt",TitlePreviouslyFrequencyCapped:"Vorh. Frequenzbegrenzung registriert",TitlePreviouslyTemperatureLimited:"Vorh. Temperaturbegrenzung registriert",TitlePreviouslyThrottled:"Vorh. Drosselung registriert",TitlePreviouslyUnderVolted:"Vorh. Unterspannung registriert",TitleTemperatureLimitActive:"Temperaturgrenze aktiv",TitleUnderVoltageDetected:"Unterspannung erkannt"},Titles:{Complete:"Fertiggestellt - {filename}",Error:"FEHLER",Pause:"Druck pausiert",PrinterOff:"Drucker AUS",Printing:"{percent}% Drucken - {filename}",PrintingETA:"{percent}% Drucken - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Hochladen nicht möglich!",EmergencyStop:"Notaus",SAVE_CONFIG:"SAVE CONFIG",Uploading:"Hochladen",UploadOfFileSuccessful:"Hochladen von {file} erfolgreich!",UploadPrint:"Hochladen & Drucken"},TopCornerMenu:{Cancel:"Abbrechen",ConfirmationDialog:{Description:{HostReboot:"Ein Neustart des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",HostShutdown:"Ein Herunterfahren des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperFirmwareRestart:"Ein Neustart der Klipper Firmware wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperRestart:"Ein Neustart von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperStop:"Ein Stopp von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",ServiceRestart:"Ein Neustart dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",ServiceStart:"Ein Start dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",ServiceStop:"Ein Stopp dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!"},Title:{HostReboot:"Host Neustart",HostShutdown:"Host Herunterfahren",KlipperFirmwareRestart:"Klipper Firmware Neustart",KlipperRestart:"Klipper Neustart",ServiceRestart:"Dienst Neustart",ServiceStart:"Dienst Start",ServiceStop:"Dienst Stop"}},HostControl:"Host-Steuerung",KlipperControl:"Klipper-Steuerung",KlipperFirmwareRestart:"Firmware Neustart",KlipperRestart:"Neustart",PowerDevices:"Stromversorgung",Reboot:"Neustart",Restart:"Neustart",ServiceControl:"Dienst-Steuerung",Shutdown:"Herunterfahren",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Schließen",Empty:"Leer",Recovering:"Wiederherstellung {software}...",RecoveringDone:"Wiederherstellung {software} abgeschlossen!",Updating:"Aktualisiere {software}...",UpdatingDone:"Aktualisierung {software} abgeschlossen!"}},n={Abort:"abbrechen",Accept:"bestätigen",Adjusted:"angepasst",Description:"Klick auf ANGEPASST wenn die aktuelle Schraube eingestellt wurde. Klick auf BESTÄTIGEN um fortzufahren ohne Anpassung.",Headline:"Bettschrauben",ScrewAccepted:"bestätigte Schrauben",ScrewIndex:"Index der Schraube",ScrewName:"Name der Schraube",ScrewOutput:"{current} von {max}"},t={CannotConnectTo:"Kann keine Verbindung zu Moonraker ({host}) herstellen.",CheckMoonrakerLog:"Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:",Connecting:"Verbinde zu {host}",Failed:"Verbindung fehlgeschlagen",Initializing:"Initialisieren",TryAgain:"Erneut versuchen"},r={CommandList:"Kommandoliste",Empty:"Leer",HideTemperatures:"Temperaturen ausblenden",HideTimelapse:"Timelapse ausblenden",SendCode:"Code senden...",SetupConsole:"Einstellungen"},i={StartPrint:{Cancel:"abbrechen",DoYouWantToStartFilename:"Willst du {filename} starten?",DoYouWantToStartFilenameFilament:"Willst du {filename} mit dem folgenden Filament starten?",Headline:"Starte Job",Print:"drucken",Timelapse:"Zeitraffer"}},a={ConfigReference:"Konfig-Referenz",DontSave:"Nicht speichern",Downloading:"Herunterladen",FailedSave:"{filename} konnte nicht hochgeladen werden!",FileReadOnly:"schreibgeschützt",SaveClose:"Speichern & schließen",SaveRestart:"Speichern & Neustart",SuccessfullySaved:"{filename} erfolgreich gespeichert.",UnsavedChanges:"Ungespeicherte Änderungen",UnsavedChangesMessage:"Möchtest du die Änderungen an {filename} speichern?",UnsavedChangesSubMessage:"Deine Änderungen werden verloren gehen wenn du sie nicht speicherst. Du kannst diese Meldung in den Editor-Einstellungen deaktivieren.",Uploading:"Hochladen"},s={AreYouSure:"Bist du sicher?",EmergencyStop:"Notaus",No:"Nein",Yes:"Ja"},o={AddBatchToQueue:"Stapel zur Auftragswarteschlange hinzufügen",AddToQueue:"Zur Auftragswarteschlange hinzufügen",AllFiles:"Alle",BedTemp:"Bett Temp.",Cancel:"Abbrechen",ChamberTemp:"Kammer Temp.",Count:"Anzahl",Create:"Erstellen",CreateNewDirectory:"Ordner erstellen",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Willst du wirklich das Verzeichnis "{name}" mit seinem gesamten Inhalt löschen?',DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Herunterladen",Duplicate:"duplizieren",DuplicateFile:"Datei duplizieren",EditFile:"Datei bearbeiten",Empty:"Leer",ExtruderTemp:"Extruder Temp.",Filament:"Filament",FilamentName:"Filament Name",FilamentType:"Filament Typ",FilamentUsage:"Filamentverbrauch",FilamentWeight:"Filamentgewicht",Files:"Dateien",Filesize:"Dateigröße",Free:"Frei",FreeDisk:"Freier Speicherplatz",GCodeFiles:"G-Code Dateien",GcodesRootDirectoryDoesntExists:'Keinen G-Code Ordner gefunden. Bitte überprüfe die Option "path" im Abschnitt [virtual_sdcard] in der Klipper Konfiguration.',HiddenFiles:"Versteckte Dateien",InvalidNameAlreadyExists:"Name existiert bereits, bitte wähle einen anderen Namen.",InvalidNameEmpty:"Feld darf nicht leer sein!",LastEndTime:"Letzte Endzeit",LastFilamentUsed:"Letzter Filamentverbrauch",LastModified:"Zuletzt geändert",LastPrintDuration:"Letzte Druckzeit",LastStartTime:"Letzte Startzeit",LastTotalDuration:"Letzte Gesamtzeit",LayerHeight:"Schichthöhe",Name:"Name",NewDirectory:"Neues Verzeichnis",NozzleDiameter:"Düsendurchmesser",ObjectHeight:"Objekthöhe",Preheat:"Vorheizen",PrintedFiles:"Bereits gedruckt",PrintStart:"Druck starten",PrintTime:"Druckdauer",RefreshCurrentDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",ScanMeta:"Metadaten scannen",ScanMetaSuccess:"Metadaten von {filename} wurden erfolgreich gescannt.",Search:"Suchen",SetupCurrentList:"Einstellungen",Slicer:"Slicer",SuccessfullyCreated:"{filename} erfolgreich erstellt.",SuccessfullyDeleted:"{filename} erfolgreich gelöscht.",SuccessfullyMoved:"{filename} erfolgreich verschoben.",SuccessfullyRenamed:"{filename} erfolgreich umbenannt.",SuccessfullyUploaded:"Hochladen von {filename} erfolgreich!",Total:"Gesamt",UploadNewGcode:"G-Code hochladen",Used:"Belegt",View3D:"3D Betrachtung"},l={CannotUploadFile:"Datei konnte nicht hochgeladen werden!",DropFilesToUploadFiles:"Datei ablegen zum Hochladen"},u={ClearLoadedFile:"Löschen",CNCMode:"CNC Modus",ColorMode:"Farbmodus",Downloading:"Downloaden",ForceLineRendering:"Erzwinge Liniendarstellung",HDRendering:"HD Darstellung (Runde Extrusionen)",High:"Hoch",LoadCurrentFile:"Momentane Datei",LoadLocal:"Lokale Datei",Low:"Gering",Max:"Max",Medium:"Mittel",ReloadRequired:"Neu laden erforderlich",Rendering:"Rendering",RenderQuality:"Darstellungsqualität",ShowGCode:"Zeige G-Code",ShowObjectSelection:"Zeige Objektauswahl",ShowToolhead:"Zeige Werkzeugkopf",ShowTravelMoves:"Zeige Bewegungen im Eilgang",SpecularLighting:"Glanzlichter",Title:"G-Code Betrachter",Tracking:"Tracking",Transparency:"Transparenz",Ultra:"Ultra",VoxelMode:"Voxel Modus (ASMBL)"},d={Abort:"abbruch",BedMeshCalibrate:"Bed Mesh Kalibrierung",BedMeshRemove:"Bed Mesh entfernen",Calibrate:"kalibrieren",Clear:"Löschen",CurrentMesh:{Headline:"Aktuelles Mesh",Max:"Max",Min:"Min",Name:"Name",Range:"Spannweite",Size:"Größe"},DeleteBedMeshProfile:"Lösche Bed Mesh",DoYouReallyWantToDelete:'Möchtest du das Profil "{name}" wirklich löschen?',ErrorKlipperNotReady:"Klipper nicht bereit. Heightmap deaktiviert.",Flat:"Flach",Heightmap:"Heightmap",InvalidNameAlreadyExists:"Das Profil existiert bereits, bitte wähle einen anderen Profilnamen.",InvalidNameAscii:"Name ist ungültig. Nur ASCII Zeichen sind erlaubt.",InvalidNameEmpty:"Feld darf nicht leer sein!",InvalidNameReserved:"Das Profil 'default' ist reserviert, bitte wähle einen anderen Profilnamen.",Later:"später",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"Es wurde noch kein Bed Mesh geladen.",NoProfile:"Kein Profil verfügbar",Ok:"Ok",Probed:"Abgetastet",Profiles:"Profile",Remove:"löschen",RemoveSaveDescription:"Das Löschen des Höhenprofils wurde registriert. Mit einem Klick auf SAVE_CONFIG wird es aus der printer.cfg gelöscht und Klipper neu gestartet.",Rename:"umbenennen",RenameBedMeshProfile:"Bed Mesh umbenennen",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Farbverlauf skalieren",ScaleZMax:"Skaliere z-max.",TitleCalibrate:"Neues Bed Mesh kalibrieren",TitleClear:"Lösche Bed Mesh",TitleHomeAll:"Home alle",Wireframe:"Drahtgitter"},c={AddNote:"Notiz hinzufügen",AllJobs:"Alle",AvgPrinttime:"Druckzeit - Ø",Cancel:"abbrechen",Chart:"Diagramm",CreateNote:"Notiz anlegen",Delete:"Löschen",DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Jobs gelöscht werden?",DeleteSingleJobQuestion:"Soll der Job wirklich gelöscht werden?",Details:"Details",EditNote:"Notiz bearbeiten",Empty:"leer",EndTime:"Endzeit",EstimatedFilament:"Geschätztes Filament",EstimatedFilamentWeight:"Geschätztes Filamentgewicht",EstimatedTime:"Geschätzte Zeit",FilamentCalc:"Geschätztes Filament",FilamentUsage:"Filamentverbrauch",FilamentUsed:"Filament verwendet - gesamt",Filename:"Dateiname",Filesize:"Dateigröße",FirstLayerBedTemp:"Erste Schicht Bett Temp.",FirstLayerExtTemp:"Erste Schicht Ext. Temp.",FirstLayerHeight:"Erste Schicht Höhe",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Drucke",JobDetails:"Job Details",Jobs:"Drucke",LastModified:"Zuletzt geändert",LayerHeight:"Schichthöhe",LoadCompleteHistory:"Lade vollständige Historie",LongestPrinttime:"Druckzeit - längste",Note:"Notiz",ObjectHeight:"Objekthöhe",PrintDuration:"Druckdauer",PrintHistory:"Historie",PrintTime:"Druckzeit",PrinttimeAvg:"Druckzeit - Ø",Reprint:"Erneut drucken",Save:"speichern",Search:"Suchen",SelectedFilamentUsed:"Ausg. Filamentverbrauch",SelectedJobs:"Ausg. Drucke",SelectedPrinttime:"Ausg. Druckzeit",Slicer:"Slicer",SlicerVersion:"Slicer Version",StartTime:"Startzeit",Statistics:"Statistik",Status:"Status",StatusValues:{cancelled:"Abgebrochen",completed:"Abgeschlossen",error:"Fehler",in_progress:"In Arbeit",klippy_disconnect:"Klippy getrennt",klippy_shutdown:"Klippy heruntergefahren",Others:"Sonstige",server_exit:"Server-Exit"},Table:"Tabelle",TitleExportHistory:"Historie exportieren",TotalDuration:"Gesamtdauer",TotalFilamentUsed:"Filament verwendet - gesamt",TotalJobs:"Druckvorgänge - gesamt",TotalPrinttime:"Druckzeit - gesamt",TotalTime:"Gesamtzeit"},g={AllJobs:"Alle Aufträge",Cancel:"abbrechen",ChangeCount:"Anzahl ändern",Count:"Anzahl",Empty:"Leer",InvalidCountEmpty:"Die Eingabe darf nicht leer sein!",InvalidCountGreaterZero:"Die Eingabe muss größer als 0 sein!",JobQueue:"Auftragswarteschlange",Jobs:"Aufträge",Pause:"Pause",RemoveFromQueue:"Von Auftragswarteschlange entfernen",Start:"Start"},m={ConfigFilesPanel:{AllFiles:"Alle",Cancel:"Abbruch",ConfigFiles:"Konfigurationsdateien",ConfigRootDirectoryDoesntExists:'Keinen Konfigurations-Ordner gefunden. Bitte überprüfe die Option "config_path" im Abschnitt [file_manager] in der Moonraker Konfiguration.',Create:"Erstellen",CreateDirectory:"Verzeichnis erstellen",CreateFile:"Datei erstellen",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Verzeichnis "{name}" und den gesamten Inhalt löschen?',DeleteSelectedQuestion:"{count} ausgewählte Elemente löschen?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Herunterladen",Duplicate:"duplizieren",DuplicateFile:"Datei duplizieren",EditFile:"Bearbeite Datei",Empty:"Leer",Files:"Dateien",Filesize:"Dateigröße",Free:"Frei",FreeDisk:"Freier Speicherplatz",HiddenFiles:"Versteckte Dateien",HideBackupFiles:"Sicherungsdateien ausblenden",LastModified:"zuletzt geändert",Name:"Name",RefreshDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",Root:"Stammverzeichnis",SetupCurrentList:"Einstellungen",ShowFile:"Zeige Dateien",Total:"Gesamt",UploadFile:"Datei hochladen",Uploading:"Hochladen",Used:"Belegt"},EndstopPanel:{Endstop:"Endschalter",EndstopInfo:"Drücke die Sync-Schaltfläche in der rechten Ecke, um den aktuellen Zustand abzufragen.",Endstops:"Endschalter",open:"OFFEN",TRIGGERED:"AUSGELÖST"},LogfilesPanel:{Accept:"akzeptieren",Cancel:"abbrechen",Logfiles:"Logdateien",Rollover:"Logdatei zurücksetzen",RolloverDescription:"Wähle Logs zum zurücksetzen:",RolloverToastFailed:'Logdatei reset "{name}": {message}',RolloverToastSuccessful:'Logdatei für "{name}" wurde erfolgreich zurückgesetzt.'},SystemPanel:{Constants:"Konstanten",Cpu:"CPU",HostDetails:"Host-Details",LastStats:"Letzte Statistik",Load:"Auslastung",Memory:"MEM",NoMoreInfos:"Keine weiteren Informationen",SystemLoad:"Systemauslastung",Values:{Awake:"Wach: {awake}",Bandwidth:"Bandbreite: {bandwidth}/s",Distro:"Distribution: {name} {version_id}",Frequency:"Freq: {frequency}",Load:"Auslastung: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Empfangen: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Versendet: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"abbrechen",AreYouSure:"Bist du dir sicher?",CheckForUpdates:"auf Aktualisierungen prüfen",Close:"schließen",CommitHistory:"Commit Verlauf",Commits:"Commits",CommitsAvailable:"keine Einreichung verfügbar | {count} Einreichung verfügbar | {count} Einreichungen verfügbar",CommitsOnDate:"Eingereicht am {date}",CommittedDaysAgo:"eingereicht vor {days} Tagen",CommittedHoursAgo:"eingereicht vor {hours} Stunden",CommittedOnDate:"eingereicht am {date}",CommittedYesterday:"eingereicht gestern",ConfigChanges:"Konfigurationsänderungen",Corrupt:"Korrupt",CountPackagesCanBeUpgraded:"{count} Pakete können aktualisiert werden",Detached:"abgetrennt",Dirty:"kompromittiert",GenericUpdateQuestion:"Überprüfe den Commit-Verlauf (falls verfügbar) und die GitHub-Projektseite von diesem Projekt, um festzustellen, ob manuelle Anpassungen nach dieser Aktualisierung erforderlich sind.",GitHubPage:"GitHub Projektseite",HardRecovery:"Harte Wiederherstellung",InitUpdateManager:"Der Update Manager ist noch nicht initialisiert. Dies ist normal, wenn das System zum ersten Mal gestartet wird. Bitte klicke auf die Aktualisierungsschaltfläche, um alle Komponenten zu initialisieren.",Invalid:"ungültig",IUnderstandTheRisks:"Ich habe die Risiken verstanden",KlipperUpdateQuestionConfig:"Dieses Update kann Änderungen an den Konfigurationsparametern enthalten, die in der Datei printer.cfg geändert werden müssen; Informationen hierzu findest du im Änderungsprotokoll.",KlipperUpdateQuestionFirmware:"Dadurch wird die Klipper-Host-Software aktualisiert. Steuerplatinen, auf denen die Klipper-Firmware läuft, müssen möglicherweise mit einer neu kompilierten Firmware geflasht werden, bevor die Maschine wieder in Betrieb genommen werden kann.",LinkToGithub:"Link zu GitHub",MoonrakerUpdateQuestion:"Dadurch wird die Moonraker-API aktualisiert. Möglicherweise sind Änderungen an der Datei moonraker.conf erforderlich, damit die Maschine wieder verwendet werden kann.",MoreCommitsInfo:"Hier können maximal 30 Commits angezeigt werden. Um alle Commits zu sehen, klicke bitte auf den folgenden Link:",OSPackages:"OS-Pakete",SoftRecovery:"einfache Wiederherstellung",StartUpdate:"Aktualisierung starten",System:"System",ThesePackagesCanBeUpgrade:"Diese Systempakete können aktualisiert werden:",Unknown:"unbekannt",Update:"update",UpdateAll:"Alle Komponenten updaten",UpdateManager:"Update Manager",UpdateWarning:"Aktualisierungswarnung: {name}",Upgrade:"upgrade",UpgradeableSystemPackages:"Aktualisierbare Systempakete",UpToDate:"aktuell",WebClientUpdateQuestion:"In einigen Fällen kann die Aktualisierung des Webclients Änderungen mit sich bringen, die zu Inkompatibilitäten führen können. Weitere Informationen sind in den Veröffentlichungshinweisen zu finden."}},h={Abort:"abbrechen",Accept:"akzeptieren",Advanced:"Erweitert",Headline:"Manuelle Messung"},p={ExtruderControlPanel:{Allowed:"Erlaubt",CleanNozzle:"Düse reinigen",EstimatedExtrusion:"Extrusion:",Extrude:"Extrudieren",ExtruderControl:"Extruder Control",ExtruderTempTooLow:"Extruder Temp. <",ExtrusionFactor:"Extrusionsfaktor",ExtrusionFeedrate:"Extrusionsgeschwindigkeit",FilamentLength:"Filamentlänge",FirmwareRetraction:"Firmware Rückzug",FirmwareRetractionSettings:{RetractLength:"Rückzugslänge",RetractSpeed:"Rückzuggeschwindigkeit",UnretractExtraLength:"Zusätzliche Ausfahrlänge",UnretractSpeed:"Ausfahrgeschwindigkeit"},Headline:"Extruder",LoadFilament:"Filament laden",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Pressure Advance",Extruder:"Extruder",SmoothTime:"Smooth Time"},PurgeFilament:"Filament reinigen",Requested:"Angefordert",Retract:"Rückzug",TooLargeExtrusion:"Extrusion zu groß!",Tools:"Werkzeuge",UnloadFilament:"Filament entladen"},FarmPrinterPanel:{ReconnectToPrinter:"Neu verbinden",SwitchToPrinter:"Zum Drucker wechseln",WebcamOff:"Aus"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Bitte überprüfen, ob der Klipper-Dienst läuft und klippy_uds_address in der moonraker.conf korrekt konfiguriert ist.",FirmwareRestart:"Firmware Neustart",MoonrakerCannotConnect:"Moonraker kann keine Verbindung zu Klipper herstellen!",PowerOn:"Drucker einschalten",PrinterSwitchedOff:"Drucker ist ausgeschaltet",PrinterSwitchedOffDescription:"Der Drucker ist ausgeschaltet und es kann keine Verbindung zu Klipper hergestellt werden. Um den Drucker einzuschalten, auf die Schaltfläche unten klicken:",Restart:"Neustart",ServiceReports:"{service} meldet"},MachineSettingsPanel:{Headline:"Maschine",MotionSettings:{Acceleration:"Beschleunigung",MaxAccelToDecel:"Max. Beschl. zu Verz.",MinimumCruiseRatio:"Min. Kreuzfahr Quote",SquareCornerVelocity:"Eck-Geschwindigkeit",Velocity:"Geschwindigkeit"}},MacrosPanel:{Headline:"Makros",Send:"senden"},MiniconsolePanel:{Autoscroll:"Autoscroll",Headline:"Konsole",HideTemperatures:"Temperaturmeldungen ausblenden",HideTimelapse:"Timelapse ausblenden",SendCode:"Befehl senden...",SetupConsole:"Einstellungen"},MinSettingsPanel:{IncludeMainsailCfg:"Stelle sicher dass die Datei mainsail.cfg in der printer.cfg-Datei aufgeführt ist.",IsNotDefinedInConfig:"ist nicht in der Konfig definiert.",MissingConfiguration:"Fehlende Konfiguration",MoreInformation:"mehr Informationen"},MiscellaneousPanel:{Headline:"Sonstiges",Light:{Blue:"blau",Green:"grün",Red:"rot",White:"weiß"},RunoutSensor:{Detected:"erkannt",Empty:"leer"}},PowerControlPanel:{Error:"Fehler",Off:"Aus",On:"An",PowerControl:"Stromversorgung"},SpoolmanPanel:{Cancel:"Abbrechen",ChangeSpool:"Rolle wechseln",DaysAgo:"vor {days} Tagen",EjectSpool:"Rolle auswerfen",EjectSpoolQuestion:"Sind Sie sicher, dass Sie die Filamentrolle auswerfen wollen?",Filament:"Filament",FilamentTypeMismatch:"Das Material der aktiven Filamentrolle ({spoolType}) stimmt nicht mit dem Material des G-Codes ({fileType}) überein.",Headline:"Spoolman",LastUsed:"Zuletzt verwendet",Location:"Standort",Material:"Material",Never:"Nie",NoActiveSpool:"Die Filamentverfolgung ist inaktiv. Um zu beginnen, wählen Sie bitte eine Rolle aus.",NoResults:"Keine Rolle mit den aktuellen Suchkriterien gefunden.",NoSpools:"Keine Rolle verfügbar",NoSpoolSelected:"Keine Rolle ausgewählt. Bitte wählen Sie eine Spule aus, sonst kann dieser Druck nicht verfolgt werden.",OpenSpoolManager:"Rollenverwaltung öffnen",Refresh:"aktualisieren",Search:"Suchen",SelectSpool:"Rolle auswählen",Today:"Heute",TooLessFilament:"Die aktuelle Rolle hat möglicherweise nicht genug Filament für diesen Druck. ({spoolWeight}g von {fileWeight}g)",Weight:"Gewicht",Yesterday:"Gestern"},StatusPanel:{CancelPrint:"Druck abbrechen",ClearPrintStats:"Druckstatistiken löschen",Difference:"Unterschied",EmptyGcodes:"Kein G-Code verfügbar.",EmptyJobqueue:"Aktuell keine Datei in der Warteschlange.",Estimate:"Schätzung",ETA:"ETA",ExcludeObject:{Cancel:"abbrechen",Excluded:"ausgeschlossen",ExcludeObject:"Objekt ausschließen",ExcludeObjectHeadline:"Objekt ausschließen",ExcludeObjectText:'Willst du wirklich "{name}" ausschließen?'},Filament:"Filament",File:"Datei",Files:"Dateien",Flow:"Fluss",Headline:"Status",Jobqueue:"Warteschlange",JobqueueMoreFiles:"keine weiteren Aufträge | einen weiteren Auftrag | {count} weitere Aufträge",Layer:"Schicht",Max:"max",ObjectHeight:"Objekthöhe",PauseAtLayer:{Abort:"abbrechen",Accept:"akzeptieren",AtLayer:"bei Schicht",Call:"Ausführen",DescriptionPauseAtLayerActive:'Diese Funktion ist bereits aktiv und wird "{call}" bei Schicht {layer} ausführen. Wenn der Befehl nochmal ausgeführt wird, werden die Einstellungen überschreiben.',DescriptionPauseNextLayerActive:'Diese Funktion ist bereits aktiv und bei der nächsten Schicht wird "{call}" ausgeführt.',Layer:"Schicht",NextLayer:"nächste Schicht",PauseAtLayer:"Pause bei Schicht",Type:"Art"},PausePrint:"Druck pausieren",Print:"Druck",PrintTime:"Druckzeit",ReprintJob:"Auftrag erneut drucken",Requested:"Angefordert",ResumePrint:"Druck fortführen",Slicer:"Slicer",Speed:"Geschwindigkeit",Status:"Status",Total:"Gesamt",Unknown:"Unbekannt"},TemperaturePanel:{AutoscaleChart:"Autoskalierung",Avg:"Ø",Cooldown:"Abkühlen",Current:"Aktuell",Dataset:{Power:"PWM-Leistung",Speed:"PWM-Geschwindigkeit",Target:"Zieltemperatur",Temperature:"Aktuelle Temperatur"},Headline:"Temperaturen",HideMcuHostSensors:"Host/MCU Sensoren ausblenden",HideMonitors:"Monitore ausblenden",Max:"max",Min:"min",Name:"Name",Presets:"Presets",SetupTemperatures:"Temperaturen einstellen",ShowChart:"Diagramm anzeigen",ShowNameInChart:"Zeige {name} in Diagramm",ShowNameInList:"Zeige {name} in Liste",State:"Status",Target:"Ziel",TemperaturesInChart:"Temperatur [°C]",TempTooHigh:"Temperature von {name} zu hoch! (max: {max})",TempTooLow:"Temperature von {name} zu niedrig! (min: {min})"},ToolheadControlPanel:{Absolute:"absolut",ALL:"ALLE",ControlButtons:"Kontrollknöpfe",CoordinateFields:"Koordinatenfelder",Headline:"Werkzeugkopf",PleaseConfigureSteps:"Bitte Schritte konfigurieren",Position:"Position",PositionOutput:"Positionsausgabe",QGL:"QGL",Relative:"relativ",SettingsInterfaceControl:"Einstellungen > Interface > Steuerung",SpeedFactor:"Geschwindigkeitsfaktor",ZOffset:"Z-Versatz",ZTilt:"Z Tilt"},WebcamPanel:{All:"Alle",FPS:"FPS",Headline:"Webcam",NoWebcam:'Keine Webcam verfügbar. Füge eine Webcam unter "Interface Einstellungen" -> "Webcams".',UnknownWebcamService:"Unbekannter Webcam Dienst"},ZoffsetPanel:{Clear:"Löschen",Headline:"Z-Versatz",Later:"Später",Ok:"OK",Save:"Speichern",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'Der neue Z-Versatz wurde berechnet und registriert. Auf "SAVE CONFIG", klicken um den neuen Z-Versatz in der printer.cfg zu speichern und Klipper neu zu starten.',SaveInfoDescriptionPrint:'Der neue Z-Versatz wurde berechnet und registriert. Nach dem Drucken auf "SAVE CONFIG" in der oberen Leiste klicken um den neuen Z-Versatz in der printer.cfg zu speichern und Klipper neu zu starten.',SaveInfoHeadline:"Information"}},f={AreYouSure:"Bist du sicher?",No:"Nein",TurnDeviceOff:"{device} ausschalten",TurnDeviceOn:"{device} anschalten",Yes:"Ja"},b={Console:"Konsole",Dashboard:"Dashboard","G-Code Files":"G-Code Dateien","G-Code Viewer":"G-Code-Betrachter",Heightmap:"Heightmap",History:"Verlauf",Machine:"Maschine",Printers:"Drucker",Timelapse:"Zeitraffer",Webcam:"Webcam"},D={Accept:"akzeptieren",Base:"Basis",ErrorText:"Ein Fehler ist beim Abtasten aufgetreten.",Headline:"Neigungsverstellung",Retry:"wiederholen"},S={AddPrinter:"Drucker hinzufügen",AddPrintersToJson:"Bitte füge einen Drucker in der config.json hinzu.",CannotConnectTo:"Kann keine Verbindung zu {host} herstellen.",ChangePrinter:"Drucker ändern",Connecting:"Verbinde zu {host}",ConnectionFailed:"Verbindung fehlgeschlagen",EditPrinter:"Drucker bearbeiten",Hello:"Hallo und willkommen im Remote-Modus von Mainsail!",HostnameInvalid:"ungültiger Hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Hostname ist erforderlich",Port:"Port",PortRequired:"Port ist erforderlich",RememberToAdd:"Bitte denk daran, {cors} in moonraker.conf unter 'cors_domains' hinzuzufügen.",SelectPrinter:"Drucker auswählen",TryAgain:"Erneut versuchen",UpdatePrinter:"Drucker aktualisieren",YouCanFindMore:"Weitere Details findest du unter"},k={Cancel:"Abbruch",Close:"Schließen",ConsoleTab:{AddFilter:"Filter hinzufügen",Console:"Konsole",CreateHeadline:"Filter erstellen",Direction:"Richtung",DirectionShell:"Letzter Eintrag unten",DirectionTable:"Letzter Eintrag oben",EditHeadline:"Filter bearbeiten",EntryStyle:"Stil der Einträge",EntryStyleCompact:"kompakt",EntryStyleDefault:"standard",Filters:"Filter",Height:"Höhe",HideTemperatures:"Temperaturen ausblenden",HideTimelapse:"Timelapse ausblenden",Name:"Name",Regex:"Regex",StoreButton:"Filter speichern",UpdateButton:"Filter aktualisieren"},ControlTab:{Bars:"Balken",Circle:"Kreis",Control:"Steuerung",Cross:"Kreuz",EnableXYHoming:"Aktiviere kombiniertes X & Y homing",EstimatedExtrusionInfo:"Zeige Info zur geschätzten Extrusion",EstimatedExtrusionInfoDescription:"Anzeigen/ausblenden der Info zur geschätzten Extrusion, basierend auf Extrusionmenge und Extrusionsgeschwindigkeit",HideDuringPrint:"Achsensteuerung während des Drucks ausblenden",InvertXMovement:"Bewegung der X-Achse invertieren",InvertYMovement:"Bewegung der Y-Achse invertieren",InvertZMovement:"Bewegung der Z-Achse invertieren",IsDefault:" (standard)",MaximumValues:"Maximum: {maximum} Einträge",MaximumValuesVisibility:"Maximal {maximum} Einträge für beste Darstellung",MinimumValues:"Minimum: {minimum} Eintrag",MotorsOff:"Motoren aus{isDefault}",MoveDistancesEInMm:"Extrusionslängen (in mm)",MoveDistancesInMm:"Schrittweiten (in mm)",MoveDistancesXYInMm:"Schrittweiten X & Y-Achse (in mm)",MoveDistancesZInMm:"Schrittweiten Z-Achse (in mm)",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Extrusions-Geschwindigkeit (in mm/s)",SpeedXY:"Geschwindigkeit X & Y-Achse (in mm/s)",SpeedZ:"Geschwindigkeit Z-Achse (in mm/s)",Style:"Stil",ValueGreaterThan:"Wert muss größer als {value} sein",ZOffsetIncrements:"Schrittweiten Z-Versatz (in mm)",ZOffsetSaveOption:"Z-Versatz Speicheroption",ZOffsetSaveOptionDescription:"Wechsel die Option zum Speichern des Z-Versatzes.",ZTiltAdjust:"Z-Tilt Adjust{isDefault}"},DashboardTab:{Dashboard:"Dashboard",Desktop:"Desktop",Mobile:"Mobile",ResetLayout:"Layout zurücksetzen",Tablet:"Tablet",Widescreen:"Breitbild"},Edit:"Bearbeiten",EditorTab:{ConfirmUnsavedChanges:"Aufforderung zum Speichern oder Verwerfen nicht gespeicherter Änderungen",ConfirmUnsavedChangesDescription:"Wenn aktiviert, dann ist eine Bestätigung notwendig um ungespeicherte Änderungen zu speichern/verwerfen. Wenn deaktiviert,dann werden Änderungen im Hintergrund verworfen.",Editor:"Editor",KlipperRestartMethod:"Klipper Neustartmethode",KlipperRestartMethodDescription:"Wähle aus, welche Neustartmethode verwendet werden soll wenn 'Speichern & Neustarten' geklickt wir im Editor.",Spaces:"Leerzeichen: {count}",TabSize:"TAB Größe",TabSizeDescription:"Legt fest, um wie viele Leerzeichen für TAB eingerückt werden sollen",UseEscToClose:"ESC drücken um Editor zu schließen",UseEscToCloseDescription:"Erlaubt es den Editor mit ESC zu schließen."},GCodeViewerTab:{BackgroundColor:"Hintergrundfarbe",ExtruderColor:"Extruder Farben",GCodeViewer:"G-Code Betrachter",GridColor:"Gitterfarbe",MaxFeed:"Max Vorschub",MinFeed:"Min Vorschub",ProgressColor:"Fortschrittsfarbe",ShowAxes:"Zeige Achsen an"},GeneralTab:{"12hours":"12-Stunden ({time})","24hours":"24-Stunden ({time})",Backup:"Datensicherung",BackupDialog:"Bitte wähle alle Abschnitte aus, die du sichern möchtest:",CalcEstimateTime:"Berechnung der geschätzten Zeit",CalcEstimateTimeDescription:"Bei Mehrfachauswahl wird ein Durchschnitt berechnet",CalcEtaTime:"ETA Berechnung",CalcEtaTimeDescription:"Bei Mehrfachauswahl wird ein Durchschnitt berechnet",CalcPrintProgress:"Berechnung des Druckfortschritts",CalcPrintProgressDescription:"Methode zur Berechnung des Druckfortschritts.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Dateiposition (absolut)",FileRelative:"Dateiposition (relativ)",Slicer:"Slicer (M73)"},CannotReadJson:"Sicherungsdatei kann nicht gelesen/analysiert werden.",DateFormat:"Datumsformat",DbConsoleHistory:"Verlauf der Konsole",DbHistoryJobs:"Historie Druckvorgänge",DbHistoryTotals:"Historie Gesamtzähler",DBNavigation:"Navigation",DbTimelapseSettings:"Zeitraffer Einstellungen",DbView:"Ansichtseinstellungen",EstimateValues:{Filament:"Filament",File:"Datei",Slicer:"Slicer"},Everything:"Alle",FactoryDialog:"Bitte wähle alle Abschnitte die du zurücksetzen möchtest:",FactoryReset:"Werkseinstellungen",General:"Allgemein",Language:"Sprache",MainsailSettingsMoonrakerDb:"Mainsail Einstellungen in Moonraker DB",PrinterName:"Druckername",Reset:"zurücksetzen",Restore:"Wiederherstellung",RestoreDialog:"Bitte wähle alle Abschnitte aus, die du wiederherstellen möchtest:",TimeFormat:"Zeitformat"},HeightmapTab:{ColorSchemes:"Farbschemen",Heightmap:"Höhenkarte",IsDefault:"(Standard)",Schemes:{GrayScale:"Graustufen",Hot:"Heiß",Hsv:"Hsv",Portland:"Portland",Spring:"Frühling"}},InterfaceSettings:"Interface Einstellungen",MacrosTab:{Add:"hinzufügen",AddGroup:"Gruppe hinzufügen",AvailableMacros:"Vorhandene Makros",ChangeMacroColor:"Farbe der Schaltfläche ändern.",Color:"Farbe",CountMacros:"keine Makros hinzugefügt | {count} Makro | {count} Makros",Custom:"benutzerdefiniert",CustomColor:"Benutzerdefinierte Farbe",DeletedMacro:"Makro gelöscht",DeleteMacroFromGroup:"Makro aus Gruppe entfernen.",EditGroup:"Gruppe bearbeiten",Error:"Fehler",Expert:"Experte",General:"Allgemein",Group:"Gruppe",GroupMacros:"Makros gruppieren",Macrogroups:"Gruppen",Macros:"Makros",Management:"Verwaltung",Name:"Name",NoAvailableMacros:"Keine verfügbaren Makros.",NoGroups:"Keine Gruppen gefunden...",NOMacros:"keine Makros gefunden...",NoMacrosInGroup:"Keine Makros in dieser Gruppe.",Primary:"primär",Secondary:"sekundär",ShowInStatePaused:"Anzeigen/ausblenden wenn der Drucker pausiert ist.",ShowInStatePrinting:"Anzeigen/ausblenden wenn der Drucker am drucken ist.",ShowInStateStandby:"Anzeigen/ausblenden wenn der Drucker im Standby ist.",Simple:"Einfach",Status:"Status",Success:"Erfolg",UnknownGroup:"Unbekannte Gruppe",Warning:"Warnung"},MiscellaneousTab:{AddGroup:"Gruppe hinzufügen",AddPreset:"Voreinstellung hinzufügen",Color:"Farbe",CreateGroup:"Gruppe erstellen",CreatePreset:"Voreinstellung erstellen",End:"Ende",EndDescription:"Letzte LED von dieser Gruppe.",Groups:"Gruppen",GroupSubTitle:"Start: {start}, Ende: {end}",LightGroups:"{name} - Gruppen",LightPresets:"{name} - Voreinstellungen",Miscellaneous:"Sonstiges",Name:"Name",NoDevicesFound:"Keine Komponente gefunden",NoGroupFound:"Keine Gruppe gefunden",NoPresetFound:"Keine Voreinstellungen gefunden",Presets:"Voreinstellungen",Start:"Start",StartDescription:"Erste LED von dieser Gruppe.",UnableToLoadLight:"Licht konnte nicht geladen werden",UnableToLoadPreset:"Voreinstellung konnte nicht geladen werden"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"Preset hinzufügen",Cooldown:"Abkühlen",CreateHeadline:"Voreinstellung erstellen",CustomGCode:"Benutzerdefinierter G-Code",EditCooldown:"Abkühlen bearbeiten",EditHeadline:"Voreinstellung bearbeiten",ErrorInvalidValue:"Ungültiger Wert",ErrorNameNotUnique:"Name existiert bereits",ErrorNameRequired:"Name erforderlich",Name:"Name",PreheatPresets:"Presets",PresetInfo:"Bitte mindestens eine Zieltemperatur oder einen benutzerdefinierten G-Code festlegen.",PresetNamePlaceholder:"Voreinstellungs-Name (erforderlich)",StoreButton:"Voreinstellung speichern",UpdateButton:"Voreinstellung ändern",UpdateCooldown:"Abkühlen ändern"},RemotePrintersTab:{AddPrinter:"Drucker hinzufügen",EditPrinter:"Drucker bearbeiten",Hostname:"Hostname",Port:"Port",RemotePrinters:"Remote Drucker",UpdatePrinter:"Drucker aktualisieren",UseConfigJson:"InstanceDB = JSON erkannt. Bitte bearbeite die config.json um die Druckerliste zu modifizieren."},Store:"anlegen",TimelapseTab:{Autorender:"Autorender",AutorenderDescription:"Wenn diese Option aktiviert ist, wird das Zeitraffervideo am Ende des Druckvorgangs automatisch gerendert",Camera:"Kamera",CameraDescription:"Legt fest, welche Kamera verwendet werden soll",ConstantRateFactor:"Constant Rate Factor",ConstantRateFactorDescription:"Damit wird die Qualität im Verhältnis zur Dateigröße des gerenderten Videos konfiguriert. Die CRF-Skala reicht von 0-51, wobei 0 für verlustfrei, 23 für die Standardeinstellung und 51 für die schlechtestmögliche Qualität steht. Ein niedrigerer Wert führt im Allgemeinen zu höherer Qualität, und ein subjektiv vernünftiger Bereich ist 17-28. 17 oder 18 gelten als visuell verlustfrei.",duplicatelastframe:"Letztes Bild duplizieren",duplicatelastframeDescription:"Dupliziert das letzte Bild am Ende des Videos",Enabled:"Aktiviert",EnabledDescription:"Wenn diese Option deaktiviert ist, werden G-Code Makros ignoriert und Autorender wird übersprungen.",Extraoutputparams:"Extra-Ausgabeparameter",ExtraoutputparamsDescription:"Legt zusätzliche Ausgabeparameter für FFMPEG fest. Hinweis: Wenn Sie hier etwas angeben, wird die Rotationseinstellung deaktiviert",FwRetract:"Firmware Rückzug",FwRetractDescription:"Benutze Firmware Rückzug im Timelapse Makro",GcodeVerbose:"Ausführliche G-Codes",GcodeVerboseDescription:"Wenn aktiviert, schreiben G-Code Makros Informationen in die Konsole",General:"Allgemein",HyperlapseCycle:"Hyperlapse-Zyklusdauer",HyperlapseCycleDescription:"Es wird alle X Sekunden ein Schnappschuss gemacht",Mode:"Modus",ModeDescription:"Wähle zwischen Layermacro und Hyperlapse (zeitbasiert) Modus",OutputFramerate:"Ausgabe Bildrate",OutputFramerateDescription:"Bestimmt die Framerate des Videos. Hinweis: Dies wird ignoriert, wenn variable_fps aktiviert ist",Parkhead:"Druckkopf parken",ParkheadDescription:"Wenn diese Option aktiviert ist, wird der Druckkopf vor der Aufnahme eines Bildes geparkt.",Parkpos:"Park-Position",ParkposDescription:"Wähle Park-Position",ParkTime:"Park Dauer",ParkTimeDescription:"Verlängern der Park Dauer",Pixelformat:"Pixelformat",PixelformatDescription:"Definiert das Pixelformat des Ausgabevideos",PosDZ:"Position Z",PosDZDescription:"Park-Postion Z (relativ)",PosX:"Position X",PosXDescription:"Park-Postion X (absolut)",PosY:"Position Y",PosYDescription:"Park-Postion Y (absolut)",PreviewImage:"Vorschaubild",PreviewImageDescription:"Speichert ein Vorschaubild mit demselben Namen wie das Video",RenderingOptions:"Rendering-Optionen",RetractDistance:"Rückzugslänge",RetractDistanceDescription:"Die Länge an Filament die der Extruder zurückzieht.",RetractSpeed:"Rückzuggeschwindigkeit",RetractSpeedDescription:"Geschwindigkeit mit der der Extruder das Filament zurückzieht.",SaveFrames:"Bilder speichern",SaveFramesDescription:"Speichern der Bilder in einer Zip-Datei für externes Rendern",StreamDelayCompensation:"Stream-Verzögerungs-Kompensation",StreamDelayCompensationDescription:"Verzögern der Bildaufnahme",Targetlength:"Zieldauer",TargetlengthDescription:"Die Zieldauer wenn Variable FPS aktiviert ist",TimeFormatCode:"Zeitformat-Code",TimeFormatCodeDescription:"Legt fest, wie der Zeitstempel in der Ausgabedatei kodiert werden soll",Timelapse:"Zeitraffer",TravelSpeed:"Eilgang Geschwindigkeit",TravelSpeedDescription:"Eilgang Geschwindigkeit für die Fahrt zur Park-Position und Wiederaufnahme des Drucks",UnretractDistance:"Ausfahrlänge",UnretractDistanceDescription:"Die Länge an Filament die der Extruder nach einem Rückzuck vorschiebt.",UnretractSpeed:"Ausfahrgeschwindigkeit",UnretractSpeedDescription:"Geschwindigkeit mit der der Extruder das Filament nach einem Rückzug vorschiebt.",VariableFps:"Variable FPS",VariableFpsDescription:"Wenn diese Option aktiviert ist, wird die Framerate des Ausgabevideos anhand der Zieldauer berechnet.",VariableFpsMax:"Max. Variable FPS",VariableFpsMaxDescription:"",VariableFpsMin:"Min. Variable FPS",VariableFpsMinDescription:""},UiSettingsTab:{BedScrewsDialog:"Hilfsfenster für Bettschraubenjustierung",BedScrewsDialogDescription:"Zeige ein Hilfsfenster für die Bettschraubenjustierung an.",BigThumbnailBackground:"Hintergrundfarbe vom großen Vorschaubild",BoolBigThumbnail:"Große Vorschaubilder",BoolBigThumbnailDescription:"Zeige ein großes Thumbnail in der Status-Anzeige während eines Drucks.",BoolHideUploadAndPrintButton:'"Hochladen & Drucken" Schaltfläche ausblenden',BoolHideUploadAndPrintButtonDescription:'Blendet die "Hochladen & Drucken" Schaltfläche in der Kopfleiste ein oder aus.',ConfirmOnEmergencyStop:"Bestätigung für Notstopp erforderlich",ConfirmOnEmergencyStopDescription:"Zeige vor einem Notstop einen Bestätigungsdialog.",ConfirmOnPowerDeviceChange:"Bestätigung für Änderung der Stromversorgung von Geräten",ConfirmOnPowerDeviceChangeDescription:"Zeige vor Änderung der Stromversorgung von Geräten einen Bestätigungsdialog.",DefaultNavigationState:"Standard Navigationszustand",DefaultNavigationStateAlwaysClosed:"immer geschlossen",DefaultNavigationStateAlwaysOpen:"immer geöffnet",DefaultNavigationStateDescription:"Welchen zustand soll die Navigation normalerweise haben?",DefaultNavigationStateLastState:"letzter Zustand",DisableFanAnimation:"Lüfteranimation deaktivieren",DisableFanAnimationDescription:"Dies kann die Last im Browser senken.",DisplayCANCEL_PRINT:"Zeige CANCEL_PRINT an",DisplayCANCEL_PRINTDescription:"Zeigt die CANCEL_PRINT Schaltfläche dauerhaft an - keine weitere Bestätigung erforderlich.",GcodeThumbnails:"G-Code Vorschaubilder",GcodeThumbnailsDescription:"Klicke auf die Schaltfläche um zum Leitfaden zu gelangen.",Guide:"Leitfaden",HideSaveConfigButtonForBedMesh:"SAVE_CONFIG Schaltfläche ausblenden bei bed_mesh Änderungen",HideSaveConfigButtonForBedMeshDescription:"SAVE_CONFIG nicht anzeigen, wenn nur das Speichern eines bed_mesh in Klipper aussteht.",HideUpdateWarnings:"Aktualisierungswarnungen ausblenden",HideUpdateWarningsDescription:"Mit dieser Option werden alle Aktualisierungswarnungen im Aktualisierungsmanager ausgeblendet.",LockSliders:"Sperre Schieberegler auf Touchscreen Geräten",LockSlidersDelay:"Verzögerung der Sperre für Schieberegler",LockSlidersDelayDescription:"Schieberegler werden nach einer bestimmten Verzögerung gesperrt. Wenn 0 oder leer, dann sperren Schieberegler nur nach wechseln/neuladen der Seite.",LockSlidersDescription:"Schieberegler müssen zuerst entsperrt werden bevor Änderungen erlaubt werden.",Logo:"Logo",ManualProbeDialog:"Hilfsfenster für manuelle Messung",ManualProbeDialogDescription:"Zeige ein Hilfsfenster für PROBE_CALIBRATE oder Z_ENDSTOP_CALIBRATE an.",NavigationStyle:"Stil der Navigation",NavigationStyleDescription:"Erscheinungsbild der Navigation ändern",NavigationStyleIconsAndText:"Icons + Text",NavigationStyleIconsOnly:"Nur Icons",PowerDeviceName:"Stromversorgung für Drucker",PowerDeviceNameDescription:"Wähle aus, welches Moonraker Power-Device zum Einschalten des Druckers verwendet werden soll.",Primary:"Primärfarbe",ScrewsTiltAdjustDialog:"Hilfsfenster für Schrauben Neigunganpassung",ScrewsTiltAdjustDialogDescription:"Zeige ein Hilfsfenster für SCREWS_TILT_CALCULATE an.",TempchartHeight:"Temperatur-Chart Höhe",TempchartHeightDescription:"Verändert die Höhe vom Temperatur-Chart auf dem Dashboard.",Theme:"Theme",ThemeDark:"Dunkel",ThemeDescription:"Ändern Sie das allgemeine Erscheinungsbild der Anwendung.",ThemeLight:"Hell",UiSettings:"UI-Einstellungen"},Update:"speichern",WebcamsTab:{AddWebcam:"Webcam hinzufügen",CreateWebcam:"Erstelle Webcam",EditCrowsnestConf:"crowsnest.conf bearbeiten",EditWebcam:"Webcam bearbeiten",EnableAudio:"Ton einschalten",FlipWebcam:"Webcam-Bild spiegeln:",HideFps:"FPS-Anzeige verstecken",Hlsstream:"HLS-Stream",Horizontally:"horizontal",IconBed:"Bett",IconCam:"Kamera",IconDoor:"Tür",IconFilament:"Filament",IconHot:"Heiß",IconMcu:"MCU",IconNozzle:"Düse",IconPrinter:"Drucker",Ipstream:"IP Kamera",JMuxerStream:"Roher h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptive MJPEG-Streamer (experimental)",Name:"Name",NameAlreadyExists:"Name existiert bereits",Required:"benötigt",Rotate:"Drehen",SaveWebcam:"Webcam speichern",Service:"Dienst",TargetFPS:"Ziel FPS",UpdateWebcam:"Webcam aktualisieren",UrlSnapshot:"Schnappschuss URL",UrlStream:"Stream URL",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikal",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},w={AllFiles:"Alle",Autorender:"Autorender",Cancel:"Abbrechen",Create:"Erstellen",CreateNewDirectory:"Neues Verzeichnis",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Willst du wirklich das Verzeichnis "{name}" mit seinem gesamten Inhalt löschen?',DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Download",DuplicateLastframe:"Letztes Bild duplizieren",Empty:"Keine fertigen Zeitraffer gefunden.",Enabled:"Aktiviert",EstimatedLength:"Geschätzte Länge",Files:"Dateien",Filesize:"Dateigröße",Fixed:"fix",Framerate:"Bildwiederholrate",Frames:"Bilder",Free:"Frei",FreeDisk:"Freier Speicherplatz",LastModified:"Zuletzt geändert",MaxFramerate:"Max. Bildwiederholrate",MinFramerate:"Min. Bildwiederholrate",Name:"Name",NewDirectory:"Neues Verzeichnis",NoActiveTimelapse:"Keine Aufzeichnungen verfügbar.",Preview:"Vorschau",RefreshCurrentDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",Render:"render",RenderSettings:"Render Einstellungen",SaveFrames:"Bilder speichern",Search:"suche",StartRender:"Rendering starten",Status:"Status",TargetFps:"Ziel-FPS",Targetlength:"Zieldauer",TimelapseFiles:"Zeitraffer Dateien",TimelapseRendering:"Zeitraffer-Rendering",TimelapseRenderingSuccessful:"Zeitraffer-Rendering erfolgreich",Total:"Gesamt",Type:"Typ",Used:"Belegt",Variable:"Variabel",Video:"Video"},C="Deutsch",v={App:e,BedScrews:n,ConnectionDialog:t,Console:r,Dialogs:i,Editor:a,EmergencyStopDialog:s,Files:o,FullscreenUpload:l,GCodeViewer:u,Heightmap:d,History:c,JobQueue:g,Machine:m,ManualProbe:h,Panels:p,PowerDeviceChangeDialog:f,Router:b,ScrewsTiltAdjust:D,SelectPrinterDialog:S,Settings:k,Timelapse:w,title:C};export{e as App,n as BedScrews,t as ConnectionDialog,r as Console,i as Dialogs,a as Editor,s as EmergencyStopDialog,o as Files,l as FullscreenUpload,u as GCodeViewer,d as Heightmap,c as History,g as JobQueue,m as Machine,h as ManualProbe,p as Panels,f as PowerDeviceChangeDialog,b as Router,D as ScrewsTiltAdjust,S as SelectPrinterDialog,k as Settings,w as Timelapse,v as default,C as title}; diff --git a/dirs/mainsail/assets/echarts-9bc570b0.js b/dirs/mainsail/assets/echarts-9bc570b0.js deleted file mode 100644 index f4296d7..0000000 --- a/dirs/mainsail/assets/echarts-9bc570b0.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Hu=function(r,t){return Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Hu(r,t)};function B(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hu(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function TR(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function MR(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),n,a=[],o;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function CR(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,a;i"u"&&typeof self<"u"?li.worker=!0:typeof navigator>"u"?(li.node=!0,li.svgSupported=!0):C1(navigator.userAgent,li);function C1(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}const j=li;var th=12,Rg="sans-serif",Or=th+"px "+Rg,D1=20,A1=100,L1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function I1(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e=0)s=o*e.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return e}function eS(r,t,e){for(var i=e?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=r[u].getBoundingClientRect(),h=2*u,c=f.left,v=f.top;o.push(c,v),l=l&&a&&c===a[h]&&v===a[h+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(t.srcCoords=o,t[i]=e?bv(s,o):bv(o,s))}function zg(r){return r.nodeName.toUpperCase()==="CANVAS"}var rS=/([&<>"'])/g,iS={"&":"&","<":"<",">":">",'"':""","'":"'"};function ie(r){return r==null?"":(r+"").replace(rS,function(t,e){return iS[e]})}var nS=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,dl=[],aS=j.browser.firefox&&+j.browser.version.split(".")[0]<39;function Xu(r,t,e,i){return e=e||{},i?Tv(r,t,e):aS&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):Tv(r,t,e),e}function Tv(r,t,e){if(j.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(zg(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(Yu(dl,r,i,n)){e.zrX=dl[0],e.zrY=dl[1];return}}e.zrX=e.zrY=0}function ah(r){return r||window.event}function he(r,t,e){if(t=ah(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Xu(r,o,t,e)}else{Xu(r,t,t,e);var a=oS(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&nS.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function oS(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var n=Math.abs(i!==0?i:e),a=i>0?-1:i<0?1:e>0?-1:1;return 3*n*a}function sS(r,t,e,i){r.addEventListener(t,e,i)}function lS(r,t,e,i){r.removeEventListener(t,e,i)}var ua=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0},uS=function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,s=n.length;o1&&i&&i.length>1){var a=Mv(i)/Mv(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=fS(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function fa(){return[1,0,0,1,0,0]}function oh(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function hS(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function rn(r,t,e){var i=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function Zu(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function sh(r,t,e){var i=t[0],n=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(e),f=Math.cos(e);return r[0]=i*f+o*u,r[1]=-i*u+o*f,r[2]=n*f+s*u,r[3]=-n*u+f*s,r[4]=f*a+u*l,r[5]=f*l-u*a,r}function vS(r,t,e){var i=e[0],n=e[1];return r[0]=t[0]*i,r[1]=t[1]*n,r[2]=t[2]*i,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*n,r}function ks(r,t){var e=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],l=e*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=e*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-e*s)*l,r):null}var cS=function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},r.lerp=function(t,e,i,n){var a=1-n;t.x=a*e.x+n*i.x,t.y=a*e.y+n*i.y},r}();const Y=cS;var Ga=Math.min,Wa=Math.max,Fr=new Y,Vr=new Y,zr=new Y,Hr=new Y,Sn=new Y,wn=new Y,dS=function(){function r(t,e,i,n){i<0&&(t=t+i,i=-i),n<0&&(e=e+n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}return r.prototype.union=function(t){var e=Ga(t.x,this.x),i=Ga(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Wa(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Wa(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,a=fa();return Zu(a,a,[-e.x,-e.y]),vS(a,a,[i,n]),Zu(a,a,[t.x,t.y]),a},r.prototype.intersect=function(t,e){if(!t)return!1;t instanceof r||(t=r.create(t));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,f=t.y,h=t.y+t.height,c=!(ad&&(d=_,gd&&(d=S,y=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=e.x*n+o,t.y=e.y*a+s,t.width=e.width*n,t.height=e.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Fr.x=zr.x=e.x,Fr.y=Hr.y=e.y,Vr.x=Hr.x=e.x+e.width,Vr.y=zr.y=e.y+e.height,Fr.transform(i),Hr.transform(i),Vr.transform(i),zr.transform(i),t.x=Ga(Fr.x,Vr.x,zr.x,Hr.x),t.y=Ga(Fr.y,Vr.y,zr.y,Hr.y);var l=Wa(Fr.x,Vr.x,zr.x,Hr.x),u=Wa(Fr.y,Vr.y,zr.y,Hr.y);t.width=l-t.x,t.height=u-t.y},r}();const nt=dS;var Hg="silent";function pS(r,t,e){return{type:r,event:e,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:e.zrX,offsetY:e.zrY,gestureEvent:e.gestureEvent,pinchX:e.pinchX,pinchY:e.pinchY,pinchScale:e.pinchScale,wheelDelta:e.zrDelta,zrByTouch:e.zrByTouch,which:e.which,stop:gS}}function gS(){ua(this.event)}var yS=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.handler=null,e}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(rr),bn=function(){function r(t,e){this.x=t,this.y=e}return r}(),mS=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],gl=new nt(0,0,0,0),Gg=function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this)||this;return s._hovered=new bn(0,0),s.storage=e,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new yS,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new K1(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(A(mS,function(i){e.on&&e.on(i,this[i],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var i=e.zrX,n=e.zrY,a=Wg(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new bn(i,n):this.findHover(i,n),u=l.target,f=this.proxy;f.setCursor&&f.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",e),this.dispatchToElement(l,"mousemove",e),u&&u!==s&&this.dispatchToElement(l,"mouseover",e)},t.prototype.mouseout=function(e){var i=e.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",e),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new bn(0,0)},t.prototype.dispatch=function(e,i){var n=this[e];n&&n.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var i=this.proxy;i.setCursor&&i.setCursor(e)},t.prototype.dispatchToElement=function(e,i,n){e=e||{};var a=e.target;if(!(a&&a.silent)){for(var o="on"+i,s=pS(i,e,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},t.prototype.findHover=function(e,i,n){var a=this.storage.getDisplayList(),o=new bn(e,i);if(Cv(a,o,e,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new nt(e-u,i-u,l,l),h=a.length-1;h>=0;h--){var c=a[h];c!==n&&!c.ignore&&!c.ignoreCoarsePointer&&(!c.parent||!c.parent.ignoreCoarsePointer)&&(gl.copy(c.getBoundingRect()),c.transform&&gl.applyTransform(c.transform),gl.intersect(f)&&s.push(c))}if(s.length)for(var v=4,d=Math.PI/12,g=Math.PI*2,p=0;p4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function _S(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1;i.silent&&(n=!0)}var s=i.__hostTarget;i=s||i.parent}return n?Hg:!0}return!1}function Cv(r,t,e,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=_S(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==Hg)){t.target=o;break}}}function Wg(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}const SS=Gg;var Ug=32,xn=7;function wS(r){for(var t=0;r>=Ug;)t|=r&1,r>>=1;return r+t}function Dv(r,t,e,i){var n=t+1;if(n===e)return 1;if(i(r[n++],r[t])<0){for(;n=0;)n++;return n-t}function bS(r,t,e){for(e--;t>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function yl(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(r,t[e+f])>0?o=f+1:l=f}return l}function ml(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(r,t[e+f])<0?l=f:o=f+1}return l}function xS(r,t){var e=xn,i,n,a=0;r.length;var o=[];i=[],n=[];function s(v,d){i[a]=v,n[a]=d,a+=1}function l(){for(;a>1;){var v=a-2;if(v>=1&&n[v-1]<=n[v]+n[v+1]||v>=2&&n[v-2]<=n[v]+n[v-1])n[v-1]n[v+1])break;f(v)}}function u(){for(;a>1;){var v=a-2;v>0&&n[v-1]=xn||x>=xn);if(T)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),d===1){for(y=0;y=0;y--)r[w+y]=r[b+y];r[S]=o[_];return}for(var x=e;;){var T=0,C=0,D=!1;do if(t(o[_],r[m])<0){if(r[S--]=r[m--],T++,C=0,--d===0){D=!0;break}}else if(r[S--]=o[_--],C++,T=0,--p===1){D=!0;break}while((T|C)=0;y--)r[w+y]=r[b+y];if(d===0){D=!0;break}}if(r[S--]=o[_--],--p===1){D=!0;break}if(C=p-yl(r[m],o,0,p,p-1,t),C!==0){for(S-=C,_-=C,p-=C,w=S+1,b=_+1,y=0;y=xn||C>=xn);if(D)break;x<0&&(x=0),x+=2}if(e=x,e<1&&(e=1),p===1){for(S-=d,m-=d,w=S+1,b=m+1,y=d-1;y>=0;y--)r[w+y]=r[b+y];r[S]=o[_]}else{if(p===0)throw new Error;for(b=S-(p-1),y=0;ys&&(l=s),Av(r,e,e+l,e+a,t),a=l}o.pushRun(e,a),o.mergeRuns(),n-=a,e+=a}while(n!==0);o.forceMergeRuns()}}var ne=1,Gn=2,Yi=4,Lv=!1;function _l(){Lv||(Lv=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Iv(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var TS=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Iv}return r.prototype.traverse=function(t,e){for(var i=0;i0&&(f.__clipPaths=[]),isNaN(f.z)&&(_l(),f.z=0),isNaN(f.z2)&&(_l(),f.z2=0),isNaN(f.zlevel)&&(_l(),f.zlevel=0),this._displayList[this._displayListLen++]=f}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,i);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,i);var v=t.getTextContent();v&&this._updateAndAddDisplayable(v,e,i)}},r.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},r.prototype.delRoot=function(t){if(t instanceof Array){for(var e=0,i=t.length;e=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}();const MS=TS;var $g;$g=j.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};const qu=$g;var ko={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-ko.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?ko.bounceIn(r*2)*.5:ko.bounceOut(r*2-1)*.5+.5}};const Yg=ko;var Ua=Math.pow,Er=Math.sqrt,Jo=1e-8,Xg=1e-4,Pv=Er(3),$a=1/3,Ue=pn(),de=pn(),nn=pn();function Lr(r){return r>-Jo&&rJo||r<-Jo}function Dt(r,t,e,i,n){var a=1-n;return a*a*(a*r+3*n*t)+n*n*(n*i+3*a*e)}function Rv(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function jo(r,t,e,i,n,a){var o=i+3*(t-e)-r,s=3*(e-t*2+r),l=3*(t-r),u=r-n,f=s*s-3*o*l,h=s*l-9*o*u,c=l*l-3*s*u,v=0;if(Lr(f)&&Lr(h))if(Lr(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[v++]=d)}else{var g=h*h-4*f*c;if(Lr(g)){var p=h/f,d=-s/o+p,y=-p/2;d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y)}else if(g>0){var m=Er(g),_=f*s+1.5*o*(-h+m),S=f*s+1.5*o*(-h-m);_<0?_=-Ua(-_,$a):_=Ua(_,$a),S<0?S=-Ua(-S,$a):S=Ua(S,$a);var d=(-s-(_+S))/(3*o);d>=0&&d<=1&&(a[v++]=d)}else{var b=(2*f*s-3*o*h)/(2*Er(f*f*f)),w=Math.acos(b)/3,x=Er(f),T=Math.cos(w),d=(-s-2*x*T)/(3*o),y=(-s+x*(T+Pv*Math.sin(w)))/(3*o),C=(-s+x*(T-Pv*Math.sin(w)))/(3*o);d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y),C>=0&&C<=1&&(a[v++]=C)}}return v}function qg(r,t,e,i,n){var a=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,l=0;if(Lr(o)){if(Zg(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Lr(f))n[0]=-a/(2*o);else if(f>0){var h=Er(f),u=(-a+h)/(2*o),c=(-a-h)/(2*o);u>=0&&u<=1&&(n[l++]=u),c>=0&&c<=1&&(n[l++]=c)}}return l}function ts(r,t,e,i,n,a){var o=(t-r)*n+r,s=(e-t)*n+t,l=(i-e)*n+e,u=(s-o)*n+o,f=(l-s)*n+s,h=(f-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=i}function Kg(r,t,e,i,n,a,o,s,l,u,f){var h,c=.005,v=1/0,d,g,p,y;Ue[0]=l,Ue[1]=u;for(var m=0;m<1;m+=.05)de[0]=Dt(r,e,n,o,m),de[1]=Dt(t,i,a,s,m),p=en(Ue,de),p=0&&p=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Lr(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var h=Er(f),u=(-o+h)/(2*a),c=(-o-h)/(2*a);u>=0&&u<=1&&(n[l++]=u),c>=0&&c<=1&&(n[l++]=c)}}return l}function Qg(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function es(r,t,e,i,n){var a=(t-r)*i+r,o=(e-t)*i+t,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=e}function Jg(r,t,e,i,n,a,o,s,l){var u,f=.005,h=1/0;Ue[0]=o,Ue[1]=s;for(var c=0;c<1;c+=.05){de[0]=Vt(r,e,n,c),de[1]=Vt(t,i,a,c);var v=en(Ue,de);v=0&&v=1?1:jo(0,i,a,1,l,s)&&Dt(0,n,o,1,s[0])}}}var IS=function(){function r(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Ht,this.ondestroy=t.ondestroy||Ht,this.onrestart=t.onrestart||Ht,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=X(t)?t:Yg[t]||lh(t)},r}();const PS=IS;var jg=function(){function r(t){this.value=t}return r}(),RS=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new jg(t);return this.insertEntry(e),e},r.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),ES=function(){function r(t){this._list=new RS,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new jg(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}();const Pa=ES;var kv={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Re(r){return r=Math.round(r),r<0?0:r>255?255:r}function kS(r){return r=Math.round(r),r<0?0:r>360?360:r}function ha(r){return r<0?0:r>1?1:r}function Sl(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Re(parseFloat(t)/100*255):Re(parseInt(t,10))}function gi(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?ha(parseFloat(t)/100):ha(parseFloat(t))}function wl(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function Ir(r,t,e){return r+(t-r)*e}function fe(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function Ku(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var ty=new Pa(20),Ya=null;function Pi(r,t){Ya&&Ku(Ya,t),Ya=ty.put(r,Ya||t.slice())}function ae(r,t){if(r){t=t||[];var e=ty.get(r);if(e)return Ku(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in kv)return Ku(t,kv[i]),Pi(r,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){fe(t,0,0,0,1);return}return fe(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Pi(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){fe(t,0,0,0,1);return}return fe(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Pi(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?fe(t,+u[0],+u[1],+u[2],1):fe(t,0,0,0,1);f=gi(u.pop());case"rgb":if(u.length>=3)return fe(t,Sl(u[0]),Sl(u[1]),Sl(u[2]),u.length===3?f:gi(u[3])),Pi(r,t),t;fe(t,0,0,0,1);return;case"hsla":if(u.length!==4){fe(t,0,0,0,1);return}return u[3]=gi(u[3]),Qu(u,t),Pi(r,t),t;case"hsl":if(u.length!==3){fe(t,0,0,0,1);return}return Qu(u,t),Pi(r,t),t;default:return}}fe(t,0,0,0,1)}}function Qu(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=gi(r[1]),n=gi(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],fe(t,Re(wl(o,a,e+1/3)*255),Re(wl(o,a,e)*255),Re(wl(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function OS(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),a=Math.max(t,e,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-t)/6+o/2)/o,h=((a-e)/6+o/2)/o,c=((a-i)/6+o/2)/o;t===a?l=c-h:e===a?l=1/3+f-c:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var v=[l*360,u,s];return r[3]!=null&&v.push(r[3]),v}}function Ov(r,t){var e=ae(r);if(e){for(var i=0;i<3;i++)t<0?e[i]=e[i]*(1-t)|0:e[i]=(255-e[i])*t+e[i]|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return cr(e,e.length===4?"rgba":"rgb")}}function bl(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],l=i-n;return e[0]=Re(Ir(o[0],s[0],l)),e[1]=Re(Ir(o[1],s[1],l)),e[2]=Re(Ir(o[2],s[2],l)),e[3]=ha(Ir(o[3],s[3],l)),e}}function BS(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=ae(t[n]),s=ae(t[a]),l=i-n,u=cr([Re(Ir(o[0],s[0],l)),Re(Ir(o[1],s[1],l)),Re(Ir(o[2],s[2],l)),ha(Ir(o[3],s[3],l))],"rgba");return e?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function xl(r,t,e,i){var n=ae(r);if(r)return n=OS(n),t!=null&&(n[0]=kS(t)),e!=null&&(n[1]=gi(e)),i!=null&&(n[2]=gi(i)),cr(Qu(n),"rgba")}function NS(r,t){var e=ae(r);if(e&&t!=null)return e[3]=ha(t),cr(e,"rgba")}function cr(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function rs(r,t){var e=ae(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}var is=Math.round;function va(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=ae(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t==null?1:t}}var Bv=1e-4;function Pr(r){return r-Bv}function Xa(r){return is(r*1e3)/1e3}function Ju(r){return is(r*1e4)/1e4}function FS(r){return"matrix("+Xa(r[0])+","+Xa(r[1])+","+Xa(r[2])+","+Xa(r[3])+","+Ju(r[4])+","+Ju(r[5])+")"}var VS={left:"start",right:"end",center:"middle",middle:"middle"};function zS(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function HS(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function GS(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function ey(r){return r&&!!r.image}function WS(r){return r&&!!r.svgElement}function uh(r){return ey(r)||WS(r)}function ry(r){return r.type==="linear"}function iy(r){return r.type==="radial"}function ny(r){return r&&(r.type==="linear"||r.type==="radial")}function Os(r){return"url(#"+r+")"}function ay(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function oy(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*Ro,n=K(r.scaleX,1),a=K(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(t||e)&&l.push("translate("+t+"px,"+e+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+is(o*Ro)+"deg, "+is(s*Ro)+"deg)"),l.join(" ")}var US=function(){return j.hasGlobalWindow&&X(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),ju=Array.prototype.slice;function lr(r,t,e){return(t-r)*e+r}function Tl(r,t,e,i){for(var n=t.length,a=0;ai?t:r,a=Math.min(e,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=Fv,l=e;if(ee(e)){var u=ZS(e);s=u,(u===1&&!ct(e[0])||u===2&&!ct(e[0][0]))&&(o=!0)}else if(ct(e)&&!Ko(e))s=qa;else if(z(e))if(!isNaN(+e))s=qa;else{var f=ae(e);f&&(l=f,s=Wn)}else if(Rs(e)){var h=k({},l);h.colorStops=V(e.colorStops,function(v){return{offset:v.offset,color:ae(v.color)}}),ry(e)?s=tf:iy(e)&&(s=ef),l=h}a===0?this.valType=s:(s!==this.valType||s===Fv)&&(o=!0),this.discrete=this.discrete||o;var c={time:t,value:l,rawValue:e,percent:0};return i&&(c.easing=i,c.easingFunc=X(i)?i:Yg[i]||lh(i)),n.push(c),c},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(g,p){return g.time-p.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Ka(n),u=Vv(n),f=0;f=0&&!(o[f].percent<=e);f--);f=c(f,s-2)}else{for(f=h;fe);f++);f=c(f-1,s-2)}d=o[f+1],v=o[f]}if(v&&d){this._lastFr=f,this._lastFrP=e;var p=d.percent-v.percent,y=p===0?1:c((e-v.percent)/p,1);d.easingFunc&&(y=d.easingFunc(y));var m=i?this._additiveValue:u?Tn:t[l];if((Ka(a)||u)&&!m&&(m=this._additiveValue=[]),this.discrete)t[l]=y<1?v.rawValue:d.rawValue;else if(Ka(a))a===No?Tl(m,v[n],d[n],y):$S(m,v[n],d[n],y);else if(Vv(a)){var _=v[n],S=d[n],b=a===tf;t[l]={type:b?"linear":"radial",x:lr(_.x,S.x,y),y:lr(_.y,S.y,y),colorStops:V(_.colorStops,function(x,T){var C=S.colorStops[T];return{offset:lr(x.offset,C.offset,y),color:Bo(Tl([],x.color,C.color,y))}}),global:S.global},b?(t[l].x2=lr(_.x2,S.x2,y),t[l].y2=lr(_.y2,S.y2,y)):t[l].r=lr(_.r,S.r,y)}else if(u)Tl(m,v[n],d[n],y),i||(t[l]=Bo(m));else{var w=lr(v[n],d[n],y);i?this._additiveValue=w:t[l]=w}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;e===qa?t[i]=t[i]+n:e===Wn?(ae(t[i],Tn),Za(Tn,Tn,n,1),t[i]=Bo(Tn)):e===No?Za(t[i],t[i],n,1):e===sy&&Nv(t[i],t[i],n,1)},r}(),KS=function(){function r(t,e,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n){ih("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,et(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Oo(u),n),this._trackKeys.push(s)}l.addKeyframe(t,Oo(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();const fh=KS;function Qi(){return new Date().getTime()}var QS=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,n=e.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=Qi()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(qu(i),!e._paused&&e.update())}qu(i)},t.prototype.start=function(){this._running||(this._time=Qi(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Qi(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Qi()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var n=new fh(e,i.loop);return this.addAnimator(n),n},t}(rr);const JS=QS;var jS=300,Ml=j.domSupported,Cl=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=V(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}}(),zv={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Hv=!1;function rf(r){var t=r.pointerType;return t==="pen"||t==="touch"}function tw(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function Dl(r){r&&(r.zrByTouch=!0)}function ew(r,t){return he(r.dom,new rw(r,t),!0)}function ly(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var rw=function(){function r(t,e){this.stopPropagation=Ht,this.stopImmediatePropagation=Ht,this.preventDefault=Ht,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r}(),De={mousedown:function(r){r=he(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=he(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=he(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=he(this.dom,r);var t=r.toElement||r.relatedTarget;ly(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Hv=!0,r=he(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Hv||(r=he(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=he(this.dom,r),Dl(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),De.mousemove.call(this,r),De.mousedown.call(this,r)},touchmove:function(r){r=he(this.dom,r),Dl(r),this.handler.processGesture(r,"change"),De.mousemove.call(this,r)},touchend:function(r){r=he(this.dom,r),Dl(r),this.handler.processGesture(r,"end"),De.mouseup.call(this,r),+new Date-+this.__lastTouchMomentUv||r<-Uv}var Wr=[],Ri=[],Ll=fa(),Il=Math.abs,lw=function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return Gr(this.rotation)||Gr(this.x)||Gr(this.y)||Gr(this.scaleX-1)||Gr(this.scaleY-1)||Gr(this.skewX)||Gr(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(Wv(i),this.invTransform=null);return}i=i||fa(),e?this.getLocalTransform(i):Wv(i),t&&(e?rn(i,t,i):hS(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(Wr);var i=Wr[0]<0?-1:1,n=Wr[1]<0?-1:1,a=((Wr[0]-i)*e+i)/Wr[0]||0,o=((Wr[1]-n)*e+n)/Wr[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||fa(),ks(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),e=Math.sqrt(e),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(rn(Ri,t.invTransform,e),e=Ri);var i=this.originX,n=this.originY;(i||n)&&(Ll[4]=i,Ll[5]=n,rn(Ri,e,Ll),Ri[4]-=i,Ri[5]-=n,e=Ri),this.setLocalTransform(e)}},r.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&me(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&me(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&Il(t[0]-1)>1e-10&&Il(t[3]-1)>1e-10?Math.sqrt(Il(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){fy(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,f=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,v=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||l){var d=i+s,g=n+l;e[4]=-d*a-c*g*o,e[5]=-g*o-v*d*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=v*a,e[2]=c*o,u&&sh(e,e,u),e[4]+=i+f,e[5]+=n+h,e},r.initDefaultProps=function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),r}(),ca=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function fy(r,t){for(var e=0;e=0?parseFloat(r)/100*t:parseFloat(r):r}function as(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,l=e.x,u=e.y,f="left",h="top";if(i instanceof Array)l+=Je(i[0],e.width),u+=Je(i[1],e.height),f=null,h=null;else switch(i){case"left":l-=n,u+=s,f="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",h="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=f,r.verticalAlign=h,r}var Pl="__zr_normal__",Rl=ca.concat(["ignore"]),uw=Br(ca,function(r,t){return r[t]=!0,r},{ignore:!1}),Ei={},fw=new nt(0,0,0,0),vh=function(){function r(t){this.id=Og(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(e),i.position!=null){var f=fw;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ei,i,f):as(Ei,i,f),a.x=Ei.x,a.y=Ei.y,o=Ei.align,s=Ei.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var c=void 0,v=void 0;h==="center"?(c=f.width*.5,v=f.height*.5):(c=Je(h[0],f.width),v=Je(h[1],f.height)),u=!0,a.originX=-a.x+c+(n?0:f.x),a.originY=-a.y+v+(n?0:f.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,p=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,m=void 0,_=void 0;g&&this.canBeInsideText()?(y=i.insideFill,m=i.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(m==null||m==="auto")&&(m=this.getInsideTextStroke(y),_=!0)):(y=i.outsideFill,m=i.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(m==null||m==="auto")&&(m=this.getOutsideStroke(y),_=!0)),y=y||"#000",(y!==p.fill||m!==p.stroke||_!==p.autoStroke||o!==p.align||s!==p.verticalAlign)&&(l=!0,p.fill=y,p.stroke=m,p.autoStroke=_,p.align=o,p.verticalAlign=s,e.setDefaultTextStyle(p)),e.__dirty|=ne,l&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?sf:of},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&ae(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,cr(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},k(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(H(t))for(var i=t,n=et(i),a=0;a0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(Pl,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===Pl,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(ft(s,t)>=0&&(e||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){ih("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||n);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,c=this._textGuide;return h&&h.useState(t,e,i,f),c&&c.useState(t,e,i,f),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ne),u}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,d);var g=this._textContent,p=this._textGuide;g&&g.useStates(t,e,c),p&&p.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ne)}},r.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),a=ft(n,t),o=ft(n,e)>=0;a>=0?o?n.splice(a,1):n[a]=e:i&&!o&&n.push(e),this.useStates(n)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,a=[],o=0;o0&&e.during&&a[0].during(function(d,g){e.during(g)});for(var c=0;c0||n.force&&!o.length){var T=void 0,C=void 0,D=void 0;if(s){C={},c&&(T={});for(var S=0;S<_;S++){var y=g[S];C[y]=e[y],c?T[y]=i[y]:e[y]=i[y]}}else if(c){D={};for(var S=0;S<_;S++){var y=g[S];D[y]=Oo(e[y]),vw(e,i,y)}}var b=new fh(e,!1,!1,h?At(d,function(L){return L.targetName===t}):null);b.targetName=t,n.scope&&(b.scope=n.scope),c&&T&&b.whenWithKeys(0,T,g),D&&b.whenWithKeys(0,D,g),b.whenWithKeys(u==null?500:u,s?C:i,g).delay(f||0),r.addAnimator(b,t),o.push(b)}}const vy=vh;var cy=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var i=this._children,n=0;n=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=ft(this._children,e);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(e,i){var n=this._children,a=n[i];if(e&&e!==this&&e.parent!==this&&e!==a){n[i]=e,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,n=this._children,a=ft(n,e);return a<0?this:(n.splice(a,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},r.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},r.prototype.clearAnimation=function(){this.animation.clear()},r.prototype.getWidth=function(){return this.painter.getWidth()},r.prototype.getHeight=function(){return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this.handler.off(t,e)},r.prototype.trigger=function(t,e){this.handler.trigger(t,e)},r.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function dt(r,t){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return z(r)?_w(r).match(/%$/)?parseFloat(r)/100*t:parseFloat(r):r==null?NaN:+r}function Tt(r,t,e){return t==null&&(t=10),t=Math.min(Math.max(0,t),py),r=(+r).toFixed(t),e?r:+r}function gy(r){return r.sort(function(t,e){return t-e}),r}function ur(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var t=1,e=0;e<15;e++,t*=10)if(Math.round(r*t)/t===r)return e}return Sw(r)}function Sw(r){var t=r.toString().toLowerCase(),e=t.indexOf("e"),i=e>0?+t.slice(e+1):0,n=e>0?e:t.length,a=t.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function ww(r,t){var e=Math.log,i=Math.LN10,n=Math.floor(e(r[1]-r[0])/i),a=Math.round(e(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function bw(r,t){var e=Br(r,function(v,d){return v+(isNaN(d)?0:d)},0);if(e===0)return[];for(var i=Math.pow(10,t),n=V(r,function(v){return(isNaN(v)?0:v)/e*i*100}),a=i*100,o=V(n,function(v){return Math.floor(v)}),s=Br(o,function(v,d){return v+d},0),l=V(n,function(v,d){return v-o[d]});su&&(u=l[h],f=h);++o[f],l[f]=0,++s}return V(o,function(v){return v/i})}function xw(r,t){var e=Math.max(ur(r),ur(t)),i=r+t;return e>py?i:Tt(i,e)}function yy(r){var t=Math.PI*2;return(r%t+t)%t}function os(r){return r>-Zv&&r=10&&t++,t}function my(r,t){var e=ch(r),i=Math.pow(10,e),n=r/i,a;return t?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,e>=-20?+r.toFixed(e<0?-e:0):r}function qv(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,e=1,i=0;i=0||a&&ft(a,l)<0)){var u=i.getShallow(l,t);u!=null&&(o[r[s][0]]=u)}}return o}}var Kw=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Qw=pa(Kw),Jw=function(){function r(){}return r.prototype.getAreaStyle=function(t,e){return Qw(this,t,e)},r}(),uf=new Pa(50);function jw(r){if(typeof r=="string"){var t=uf.get(r);return t&&t.image}else return r}function yh(r,t,e,i,n){if(r)if(typeof r=="string"){if(t&&t.__zrImageSrc===r||!e)return t;var a=uf.get(r),o={hostEl:e,cb:i,cbPayload:n};return a?(t=a.image,!Vs(t)&&a.pending.push(o)):(t=dn.loadImage(r,jv,jv),t.__zrImageSrc=r,uf.put(r,t.__cachedImgObj={image:t,pending:[o]})),t}else return r;else return t}function jv(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var u=oe(e,t);return u>s&&(e="",u=0),s=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function Ay(r,t){var e=t.containerWidth,i=t.font,n=t.contentWidth;if(!e)return"";var a=oe(r,i);if(a<=e)return r;for(var o=0;;o++){if(a<=n||o>=t.maxIterations){r+=t.ellipsis;break}var s=o===0?eb(r,n,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=oe(r,i)}return r===""&&(r=t.placeholder),r}function eb(r,t,e,i){for(var n=0,a=0,o=r.length;av&&u){var d=Math.floor(v/s);h=h.slice(0,d)}if(r&&a&&f!=null)for(var g=Dy(f,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),p=0;ps&&Nl(e,r.substring(s,u),t,o),Nl(e,l[2],t,o,l[1]),s=Bl.lastIndex}sn){b>0?(m.tokens=m.tokens.slice(0,b),p(m,S,_),e.lines=e.lines.slice(0,y+1)):e.lines=e.lines.slice(0,y);break t}var L=x.width,I=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")w.percentWidth=L,f.push(w),w.contentWidth=oe(w.text,D);else{if(I){var P=x.backgroundColor,R=P&&P.image;R&&(R=jw(R),Vs(R)&&(w.width=Math.max(w.width,R.width*M/R.height)))}var E=d&&i!=null?i-S:null;E!=null&&E0&&d+i.accumWidth>i.width&&(f=t.split("\n"),u=!0),i.accumWidth=d}else{var g=Ly(t,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+v,h=g.linesWidths,f=g.lines}}else f=t.split("\n");for(var p=0;p=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var sb=Br(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function lb(r){return ob(r)?!!sb[r]:!0}function Ly(r,t,e,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,h=0;he:n+f+v>e){f?(s||l)&&(d?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=c,u+=v,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=c,f=v)):d?(a.push(l),o.push(u),l=c,u=v):(a.push(c),o.push(v));continue}f+=v,d?(l+=c,u+=v):(l&&(s+=l,l="",u=0),s+=c)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}var ff="__zr_style_"+Math.round(Math.random()*10),yi={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},zs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};yi[ff]=!0;var ec=["z","z2","invisible"],ub=["invisible"],fb=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=et(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,l[0]=r+e,l[1]=t+i;return}if(Qa[0]=Hl(n)*e+r,Qa[1]=zl(n)*i+t,Ja[0]=Hl(a)*e+r,Ja[1]=zl(a)*i+t,u(s,Qa,Ja),f(l,Qa,Ja),n=n%$r,n<0&&(n=n+$r),a=a%$r,a<0&&(a=a+$r),n>a&&!o?a+=$r:nn&&(ja[0]=Hl(v)*e+r,ja[1]=zl(v)*i+t,u(s,ja,s),f(l,ja,l))}var ut={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Yr=[],Xr=[],Fe=[],_r=[],Ve=[],ze=[],Gl=Math.min,Wl=Math.max,Zr=Math.cos,qr=Math.sin,or=Math.abs,hf=Math.PI,Dr=hf*2,Ul=typeof Float32Array<"u",Mn=[];function $l(r){var t=Math.round(r/hf*1e8)/1e8;return t%2*hf}function pb(r,t){var e=$l(r[0]);e<0&&(e+=Dr);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=Dr?n=e+Dr:t&&e-n>=Dr?n=e-Dr:!t&&e>n?n=e+(Dr-$l(e-n)):t&&e0&&(this._ux=or(i/ns/t)||0,this._uy=or(i/ns/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(ut.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=or(t-this._xi),n=or(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(ut.L,t,e),this._ctx&&a&&this._ctx.lineTo(t,e),a)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){return this._drawPendingPt(),this.addData(ut.C,t,e,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(ut.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(t,e,i,n,a,o){this._drawPendingPt(),Mn[0]=n,Mn[1]=a,pb(Mn,o),n=Mn[0],a=Mn[1];var s=a-n;return this.addData(ut.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=Zr(a)*i+t,this._yi=qr(a)*i+e,this},r.prototype.arcTo=function(t,e,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},r.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(ut.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(ut.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){var e=t.length;!(this.data&&this.data.length===e)&&Ul&&(this.data=new Float32Array(e));for(var i=0;if.length&&(this._expandData(),f=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){Fe[0]=Fe[1]=Ve[0]=Ve[1]=Number.MAX_VALUE,_r[0]=_r[1]=ze[0]=ze[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,n=0,a=0,o;for(o=0;oi||or(_)>n||c===e-1)&&(g=Math.sqrt(m*m+_*_),a=p,o=y);break}case ut.C:{var S=t[c++],b=t[c++],p=t[c++],y=t[c++],w=t[c++],x=t[c++];g=CS(a,o,S,b,p,y,w,x,10),a=w,o=x;break}case ut.Q:{var S=t[c++],b=t[c++],p=t[c++],y=t[c++];g=AS(a,o,S,b,p,y,10),a=p,o=y;break}case ut.A:var T=t[c++],C=t[c++],D=t[c++],M=t[c++],L=t[c++],I=t[c++],P=I+L;c+=1,t[c++],d&&(s=Zr(L)*D+T,l=qr(L)*M+C),g=Wl(D,M)*Gl(Dr,Math.abs(I)),a=Zr(P)*D+T,o=qr(P)*M+C;break;case ut.R:{s=a=t[c++],l=o=t[c++];var R=t[c++],E=t[c++];g=R*2+E*2;break}case ut.Z:{var m=s-a,_=l-o;g=Math.sqrt(m*m+_*_),a=s,o=l;break}}g>=0&&(u[h++]=g,f+=g)}return this._pathLen=f,f},r.prototype.rebuildPath=function(t,e){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,f,h,c,v=e<1,d,g,p=0,y=0,m,_=0,S,b;if(!(v&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,g=this._pathLen,m=e*g,!m)))t:for(var w=0;w0&&(t.lineTo(S,b),_=0),x){case ut.M:s=u=i[w++],l=f=i[w++],t.moveTo(u,f);break;case ut.L:{h=i[w++],c=i[w++];var C=or(h-u),D=or(c-f);if(C>n||D>a){if(v){var M=d[y++];if(p+M>m){var L=(m-p)/M;t.lineTo(u*(1-L)+h*L,f*(1-L)+c*L);break t}p+=M}t.lineTo(h,c),u=h,f=c,_=0}else{var I=C*C+D*D;I>_&&(S=h,b=c,_=I)}break}case ut.C:{var P=i[w++],R=i[w++],E=i[w++],W=i[w++],O=i[w++],F=i[w++];if(v){var M=d[y++];if(p+M>m){var L=(m-p)/M;ts(u,P,E,O,L,Yr),ts(f,R,W,F,L,Xr),t.bezierCurveTo(Yr[1],Xr[1],Yr[2],Xr[2],Yr[3],Xr[3]);break t}p+=M}t.bezierCurveTo(P,R,E,W,O,F),u=O,f=F;break}case ut.Q:{var P=i[w++],R=i[w++],E=i[w++],W=i[w++];if(v){var M=d[y++];if(p+M>m){var L=(m-p)/M;es(u,P,E,L,Yr),es(f,R,W,L,Xr),t.quadraticCurveTo(Yr[1],Xr[1],Yr[2],Xr[2]);break t}p+=M}t.quadraticCurveTo(P,R,E,W),u=E,f=W;break}case ut.A:var G=i[w++],q=i[w++],$=i[w++],Q=i[w++],it=i[w++],wt=i[w++],vt=i[w++],Bt=!i[w++],Pt=$>Q?$:Q,mt=or($-Q)>.001,gt=it+wt,U=!1;if(v){var M=d[y++];p+M>m&&(gt=it+wt*(m-p)/M,U=!0),p+=M}if(mt&&t.ellipse?t.ellipse(G,q,$,Q,vt,it,gt,Bt):t.arc(G,q,Pt,it,gt,Bt),U)break t;T&&(s=Zr(it)*$+G,l=qr(it)*Q+q),u=Zr(gt)*$+G,f=qr(gt)*Q+q;break;case ut.R:s=u=i[w],l=f=i[w+1],h=i[w++],c=i[w++];var J=i[w++],Zt=i[w++];if(v){var M=d[y++];if(p+M>m){var _t=m-p;t.moveTo(h,c),t.lineTo(h+Gl(_t,J),c),_t-=J,_t>0&&t.lineTo(h+J,c+Gl(_t,Zt)),_t-=Zt,_t>0&&t.lineTo(h+Wl(J-_t,0),c+Zt),_t-=J,_t>0&&t.lineTo(h,c+Wl(Zt-_t,0));break t}p+=M}t.rect(h,c,J,Zt);break;case ut.Z:if(v){var M=d[y++];if(p+M>m){var L=(m-p)/M;t.lineTo(u*(1-L)+s*L,f*(1-L)+l*L);break t}p+=M}t.closePath(),u=s,f=l}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.CMD=ut,r.initDefaultProps=function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),r}();const dr=gb;function ki(r,t,e,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>t+s&&o>i+s||or+s&&a>e+s||at+h&&f>i+h&&f>a+h&&f>s+h||fr+h&&u>e+h&&u>n+h&&u>o+h||ut+u&&l>i+u&&l>a+u||lr+u&&s>e+u&&s>n+u||se||f+un&&(n+=Cn);var c=Math.atan2(l,s);return c<0&&(c+=Cn),c>=i&&c<=n||c+Cn>=i&&c+Cn<=n}function Kr(r,t,e,i,n,a){if(a>t&&a>i||an?s:0}var Sr=dr.CMD,Qr=Math.PI*2,Sb=1e-4;function wb(r,t){return Math.abs(r-t)t&&u>i&&u>a&&u>s||u1&&bb(),v=Dt(t,i,a,s,ce[0]),c>1&&(d=Dt(t,i,a,s,ce[1]))),c===2?pt&&s>i&&s>a||s=0&&u<=1){for(var f=0,h=Vt(t,i,a,u),c=0;ce||s<-e)return 0;var l=Math.sqrt(e*e-s*s);Ut[0]=-l,Ut[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=Qr-1e-4){i=0,n=Qr;var f=a?1:-1;return o>=Ut[0]+r&&o<=Ut[1]+r?f:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=Qr,n+=Qr);for(var c=0,v=0;v<2;v++){var d=Ut[v];if(d+r>o){var g=Math.atan2(s,d),f=a?1:-1;g<0&&(g=Qr+g),(g>=i&&g<=n||g+Qr>=i&&g+Qr<=n)&&(g>Math.PI/2&&g1&&(e||(s+=Kr(l,u,f,h,i,n))),p&&(l=a[d],u=a[d+1],f=l,h=u),g){case Sr.M:f=a[d++],h=a[d++],l=f,u=h;break;case Sr.L:if(e){if(ki(l,u,a[d],a[d+1],t,i,n))return!0}else s+=Kr(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sr.C:if(e){if(yb(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=xb(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sr.Q:if(e){if(mb(l,u,a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=Tb(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Sr.A:var y=a[d++],m=a[d++],_=a[d++],S=a[d++],b=a[d++],w=a[d++];d+=1;var x=!!(1-a[d++]);c=Math.cos(b)*_+y,v=Math.sin(b)*S+m,p?(f=c,h=v):s+=Kr(l,u,c,v,i,n);var T=(i-y)*S/_+y;if(e){if(_b(y,m,S,b,b+w,x,t,T,n))return!0}else s+=Mb(y,m,S,b,b+w,x,T,n);l=Math.cos(b+w)*_+y,u=Math.sin(b+w)*S+m;break;case Sr.R:f=l=a[d++],h=u=a[d++];var C=a[d++],D=a[d++];if(c=f+C,v=h+D,e){if(ki(f,h,c,h,t,i,n)||ki(c,h,c,v,t,i,n)||ki(c,v,f,v,t,i,n)||ki(f,v,f,h,t,i,n))return!0}else s+=Kr(c,h,c,v,i,n),s+=Kr(f,v,f,h,i,n);break;case Sr.Z:if(e){if(ki(l,u,f,h,t,i,n))return!0}else s+=Kr(l,u,f,h,i,n);l=f,u=h;break}}return!e&&!wb(u,h)&&(s+=Kr(l,u,f,h,i,n)||0),s!==0}function Cb(r,t,e){return Iy(r,0,!1,t,e)}function Db(r,t,e,i){return Iy(r,t,!0,e,i)}var ls=st({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},yi),Ab={style:st({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},zs.style)},Yl=ca.concat(["invisible","culling","z","z2","zlevel","parent"]),Lb=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(l){e.buildPath(l,e.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?of:i>.2?sw:sf}else if(e)return sf}return of},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(z(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=rs(e,0)0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,n=!e;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Yi)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){s.copy(e);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f==null?4:f)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return e},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect(),o=this.style;if(e=n[0],i=n[1],a.contain(e,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Db(s,l/u,e,i)))return!0}if(this.hasFill())return Cb(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Yi,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var n=this.shape;return n||(n=this.shape={}),typeof e=="string"?n[e]=i:k(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Yi)},t.prototype.createStyle=function(e){return Es(ls,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=k({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=k({},n.shape),k(u,i.shape)):(u=k({},a?this.shape:n.shape),k(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=k({},this.shape);for(var f={},h=et(u),c=0;c0},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(e){return Es(Ib,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var i=e.text;i!=null?i+="":i="";var n=hh(i,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var a=e.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},t.initDefaultProps=function(){var e=t.prototype;e.dirtyRectTolerance=10}(),t}(ka);Py.prototype.type="tspan";const us=Py;var Pb=st({x:0,y:0},yi),Rb={style:st({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},zs.style)};function Eb(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var Ry=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return Es(Pb,e)},t.prototype._getSize=function(e){var i=this.style,n=i[e];if(n!=null)return n;var a=Eb(i.image)?i.image:this.__image;if(!a)return 0;var o=e==="width"?"height":"width",s=i[o];return s==null?a[e]:a[e]/a[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return Rb},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new nt(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(ka);Ry.prototype.type="image";const ir=Ry;function kb(r,t){var e=t.x,i=t.y,n=t.width,a=t.height,o=t.r,s,l,u,f;n<0&&(e=e+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=f=o:o instanceof Array?o.length===1?s=l=u=f=o[0]:o.length===2?(s=u=o[0],l=f=o[1]):o.length===3?(s=o[0],l=f=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],f=o[3]):s=l=u=f=0;var h;s+l>n&&(h=s+l,s*=n/h,l*=n/h),u+f>n&&(h=u+f,u*=n/h,f*=n/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),r.moveTo(e+s,i),r.lineTo(e+n-l,i),l!==0&&r.arc(e+n-l,i+l,l,-Math.PI/2,0),r.lineTo(e+n,i+a-u),u!==0&&r.arc(e+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(e+f,i+a),f!==0&&r.arc(e+f,i+a-f,f,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var Ji=Math.round;function Ey(r,t,e){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=e&&e.lineWidth;return s&&(Ji(i*2)===Ji(n*2)&&(r.x1=r.x2=ci(i,s,!0)),Ji(a*2)===Ji(o*2)&&(r.y1=r.y2=ci(a,s,!0))),r}}function ky(r,t,e){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=ci(i,s,!0),r.y=ci(n,s,!0),r.width=Math.max(ci(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(ci(n+o,s,!1)-r.y,o===0?0:1)),r}}function ci(r,t,e){if(!t)return r;var i=Ji(r*2);return(i+Ji(t))%2===0?i/2:(i+(e?1:-1))/2}var Ob=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Bb={},Oy=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Ob},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=ky(Bb,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?kb(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(lt);Oy.prototype.type="rect";const Mt=Oy;var oc={fill:"#000"},sc=2,Nb={style:st({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},zs.style)},By=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=oc,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,L=e.width!=null&&(e.overflow==="truncate"||e.overflow==="break"||e.overflow==="breakAll"),I=o.calculatedLineHeight,P=0;P=0&&(P=w[I],P.align==="right");)this._placeToken(P,e,T,y,L,"right",_),C-=P.width,L-=P.width,I--;for(M+=(a-(M-p)-(m-L)-C)/2;D<=I;)P=w[D],this._placeToken(P,e,T,y,M+P.width/2,"center",_),M+=P.width,D++;y+=T}},t.prototype._placeToken=function(e,i,n,a,o,s,l){var u=i.rich[e.styleName]||{};u.text=e.text;var f=e.verticalAlign,h=a+n/2;f==="top"?h=a+e.height/2:f==="bottom"&&(h=a+n-e.height/2);var c=!e.isLineHolder&&Xl(u);c&&this._renderBackground(u,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,h-e.height/2,e.width,e.height);var v=!!u.backgroundColor,d=e.textPadding;d&&(o=cc(o,s,d),h-=e.height/2-d[0]-e.innerHeight/2);var g=this._getOrCreateChild(us),p=g.createStyle();g.useStyle(p);var y=this._defaultStyle,m=!1,_=0,S=vc("fill"in u?u.fill:"fill"in i?i.fill:(m=!0,y.fill)),b=hc("stroke"in u?u.stroke:"stroke"in i?i.stroke:!v&&!l&&(!y.autoStroke||m)?(_=sc,y.stroke):null),w=u.textShadowBlur>0||i.textShadowBlur>0;p.text=e.text,p.x=o,p.y=h,w&&(p.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,p.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",p.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,p.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),p.textAlign=s,p.textBaseline="middle",p.font=e.font||Or,p.opacity=Qn(u.opacity,i.opacity,1),uc(p,u),b&&(p.lineWidth=Qn(u.lineWidth,i.lineWidth,_),p.lineDash=K(u.lineDash,i.lineDash),p.lineDashOffset=i.lineDashOffset||0,p.stroke=b),S&&(p.fill=S);var x=e.contentWidth,T=e.contentHeight;g.setBoundingRect(new nt(Un(p.x,x,p.textAlign),Xi(p.y,T,p.textBaseline),x,T))},t.prototype._renderBackground=function(e,i,n,a,o,s){var l=e.backgroundColor,u=e.borderWidth,f=e.borderColor,h=l&&l.image,c=l&&!h,v=e.borderRadius,d=this,g,p;if(c||e.lineHeight||u&&f){g=this._getOrCreateChild(Mt),g.useStyle(g.createStyle()),g.style.fill=null;var y=g.shape;y.x=n,y.y=a,y.width=o,y.height=s,y.r=v,g.dirtyShape()}if(c){var m=g.style;m.fill=l||null,m.fillOpacity=K(e.fillOpacity,1)}else if(h){p=this._getOrCreateChild(ir),p.onload=function(){d.dirtyStyle()};var _=p.style;_.image=l.image,_.x=n,_.y=a,_.width=o,_.height=s}if(u&&f){var m=g.style;m.lineWidth=u,m.stroke=f,m.strokeOpacity=K(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var S=(g||p).style;S.shadowBlur=e.shadowBlur||0,S.shadowColor=e.shadowColor||"transparent",S.shadowOffsetX=e.shadowOffsetX||0,S.shadowOffsetY=e.shadowOffsetY||0,S.opacity=Qn(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Fy(e)&&(i=[e.fontStyle,e.fontWeight,Ny(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&Ye(i)||e.textFont||e.font},t}(ka),Fb={left:!0,right:1,center:1},Vb={top:1,bottom:1,middle:1},lc=["fontStyle","fontWeight","fontSize","fontFamily"];function Ny(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?th+"px":r+"px"}function uc(r,t){for(var e=0;e=0,a=!1;if(r instanceof lt){var o=Vy(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(Oi(s)||Oi(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=k({},i),u=k({},u),u.fill=s):!Oi(u.fill)&&Oi(s)?(a=!0,i=k({},i),u=k({},u),u.fill=mc(s)):!Oi(u.stroke)&&Oi(l)&&(a||(i=k({},i),u=k({},u)),u.stroke=mc(l)),i.style=u}}if(i&&i.z2==null){a||(i=k({},i));var f=r.z2EmphasisLift;i.z2=r.z2+(f!=null?f:Gb)}return i}function Zb(r,t,e){if(e&&e.z2==null){e=k({},e);var i=r.z2SelectLift;e.z2=r.z2+(i!=null?i:Wb)}return e}function qb(r,t,e){var i=ft(r.currentStates,t)>=0,n=r.style.opacity,a=i?null:Yb(r,["opacity"],t,{opacity:1});e=e||{};var o=e.style||{};return o.opacity==null&&(e=k({},e),o=k({opacity:i?n:a.opacity*.1},o),e.style=o),e}function Zl(r,t){var e=this.states[r];if(this.style){if(r==="emphasis")return Xb(this,r,t,e);if(r==="blur")return qb(this,r,e);if(r==="select")return Zb(this,r,e)}return e}function Kb(r){r.stateProxy=Zl;var t=r.getTextContent(),e=r.getTextGuideLine();t&&(t.stateProxy=Zl),e&&(e.stateProxy=Zl)}function wc(r,t){!Yy(r,t)&&!r.__highByOuter&&gr(r,zy)}function bc(r,t){!Yy(r,t)&&!r.__highByOuter&&gr(r,Hy)}function hs(r,t){r.__highByOuter|=1<<(t||0),gr(r,zy)}function vs(r,t){!(r.__highByOuter&=~(1<<(t||0)))&&gr(r,Hy)}function Qb(r){gr(r,Sh)}function Wy(r){gr(r,Gy)}function Uy(r){gr(r,Ub)}function $y(r){gr(r,$b)}function Yy(r,t){return r.__highDownSilentOnTouch&&t.zrByTouch}function Xy(r){var t=r.getModel(),e=[],i=[];t.eachComponent(function(n,a){var o=mh(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){Gy(u)}),s&&e.push(a)),o.isBlured=!1}),A(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(e,!1,t)})}function vf(r,t,e,i){var n=i.getModel();e=e||"coordinateSystem";function a(u,f){for(var h=0;h0){var s={dataIndex:o,seriesIndex:e.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function df(r,t,e){bh(r,!0),gr(r,Kb),nx(r,t,e)}function ix(r){bh(r,!1)}function ga(r,t,e,i){i?ix(r):df(r,t,e)}function nx(r,t,e){var i=ot(r);t!=null?(i.focus=t,i.blurScope=e):i.focus&&(i.focus=null)}var Tc=["emphasis","blur","select"],ax={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function cs(r,t,e,i){e=e||"itemStyle";for(var n=0;n1&&(o*=ql(d),s*=ql(d));var g=(n===a?-1:1)*ql((o*o*(s*s)-o*o*(v*v)-s*s*(c*c))/(o*o*(v*v)+s*s*(c*c)))||0,p=g*o*v/s,y=g*-s*c/o,m=(r+e)/2+eo(h)*p-to(h)*y,_=(t+i)/2+to(h)*p+eo(h)*y,S=Ac([1,0],[(c-p)/o,(v-y)/s]),b=[(c-p)/o,(v-y)/s],w=[(-1*c-p)/o,(-1*v-y)/s],x=Ac(b,w);if(yf(b,w)<=-1&&(x=Dn),yf(b,w)>=1&&(x=0),x<0){var T=Math.round(x/Dn*1e6)/1e6;x=Dn*2+T%2*Dn}f.addData(u,m,_,o,s,S,x,h,a)}var hx=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,vx=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function cx(r){var t=new dr;if(!r)return t;var e=0,i=0,n=e,a=i,o,s=dr.CMD,l=r.match(hx);if(!l)return t;for(var u=0;uP*P+R*R&&(T=D,C=M),{cx:T,cy:C,x0:-f,y0:-h,x1:T*(n/b-1),y1:C*(n/b-1)}}function bx(r){var t;if(N(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function xx(r,t){var e,i=$n(t.r,0),n=$n(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var f=t.cx,h=t.cy,c=!!t.clockwise,v=Ic(u-l),d=v>Kl&&v%Kl;if(d>Ce&&(v=d),!(i>Ce))r.moveTo(f,h);else if(v>Kl-Ce)r.moveTo(f+i*Ni(l),h+i*Jr(l)),r.arc(f,h,i,l,u,!c),n>Ce&&(r.moveTo(f+n*Ni(u),h+n*Jr(u)),r.arc(f,h,n,u,l,c));else{var g=void 0,p=void 0,y=void 0,m=void 0,_=void 0,S=void 0,b=void 0,w=void 0,x=void 0,T=void 0,C=void 0,D=void 0,M=void 0,L=void 0,I=void 0,P=void 0,R=i*Ni(l),E=i*Jr(l),W=n*Ni(u),O=n*Jr(u),F=v>Ce;if(F){var G=t.cornerRadius;G&&(e=bx(G),g=e[0],p=e[1],y=e[2],m=e[3]);var q=Ic(i-n)/2;if(_=He(q,y),S=He(q,m),b=He(q,g),w=He(q,p),C=x=$n(_,S),D=T=$n(b,w),(x>Ce||T>Ce)&&(M=i*Ni(u),L=i*Jr(u),I=n*Ni(l),P=n*Jr(l),vCe){var mt=He(y,C),gt=He(m,C),U=ro(I,P,R,E,i,mt,c),J=ro(M,L,W,O,i,gt,c);r.moveTo(f+U.cx+U.x0,h+U.cy+U.y0),C0&&r.arc(f+U.cx,h+U.cy,mt,Nt(U.y0,U.x0),Nt(U.y1,U.x1),!c),r.arc(f,h,i,Nt(U.cy+U.y1,U.cx+U.x1),Nt(J.cy+J.y1,J.cx+J.x1),!c),gt>0&&r.arc(f+J.cx,h+J.cy,gt,Nt(J.y1,J.x1),Nt(J.y0,J.x0),!c))}else r.moveTo(f+R,h+E),r.arc(f,h,i,l,u,!c);if(!(n>Ce)||!F)r.lineTo(f+W,h+O);else if(D>Ce){var mt=He(g,D),gt=He(p,D),U=ro(W,O,M,L,n,-gt,c),J=ro(R,E,I,P,n,-mt,c);r.lineTo(f+U.cx+U.x0,h+U.cy+U.y0),D0&&r.arc(f+U.cx,h+U.cy,gt,Nt(U.y0,U.x0),Nt(U.y1,U.x1),!c),r.arc(f,h,n,Nt(U.cy+U.y1,U.cx+U.x1),Nt(J.cy+J.y1,J.cx+J.x1),c),mt>0&&r.arc(f+J.cx,h+J.cy,mt,Nt(J.y1,J.x1),Nt(J.y0,J.x0),!c))}else r.lineTo(f+W,h+O),r.arc(f,h,n,u,l,c)}r.closePath()}}}var Tx=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),em=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Tx},t.prototype.buildPath=function(e,i){xx(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(lt);em.prototype.type="sector";const Ci=em;var Mx=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),rm=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Mx},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.PI*2;e.moveTo(n+i.r,a),e.arc(n,a,i.r,0,o,!1),e.moveTo(n+i.r0,a),e.arc(n,a,i.r0,0,o,!0)},t}(lt);rm.prototype.type="ring";const im=rm;function Cx(r,t,e,i){var n=[],a=[],o=[],s=[],l,u,f,h;if(i){f=[1/0,1/0],h=[-1/0,-1/0];for(var c=0,v=r.length;c=2){if(i){var a=Cx(n,i,e,t.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(e?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,h=n.length;sti[1]){if(s=!1,a)return s;var f=Math.abs(ti[0]-jr[1]),h=Math.abs(jr[0]-ti[1]);Math.min(f,h)>n.len()&&(f0){var h=f.duration,c=f.delay,v=f.easing,d={duration:h,delay:c||0,easing:v,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?t.animateFrom(e,d):t.animateTo(e,d)}else t.stopAnimation(),!s&&t.attr(e),o&&o(1),a&&a()}function Et(r,t,e,i,n,a){Dh("update",r,t,e,i,n,a)}function Xt(r,t,e,i,n,a){Dh("enter",r,t,e,i,n,a)}function an(r){if(!r.__zr)return!0;for(var t=0;tMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Ec(r){return!r.isGroup}function Qx(r){return r.shape!=null}function ym(r,t,e){if(!r||!t)return;function i(o){var s={};return o.traverse(function(l){Ec(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Qx(o)&&(s.shape=k({},o.shape)),s}var a=i(r);t.traverse(function(o){if(Ec(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Et(o,l,e,ot(o).dataIndex)}}})}function Jx(r,t){return V(r,function(e){var i=e[0];i=ys(i,t.x),i=ms(i,t.x+t.width);var n=e[1];return n=ys(n,t.y),n=ms(n,t.y+t.height),[i,n]})}function jx(r,t){var e=ys(r.x,t.x),i=ms(r.x+r.width,t.x+t.width),n=ys(r.y,t.y),a=ms(r.y+r.height,t.y+t.height);if(i>=e&&a>=n)return{x:e,y:n,width:i-e,height:a-n}}function Ih(r,t,e){var i=k({rectHover:!0},t),n=i.style={strokeNoScale:!0};if(e=e||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),st(n,e),new ir(i)):Lh(r.replace("path://",""),i,e,"center")}function tT(r,t,e,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var p=Ql(v,d,f,h)/c;return!(p<0||p>1)}function Ql(r,t,e,i){return r*i-e*t}function eT(r){return r<=1e-6&&r>=-1e-6}function Ph(r){var t=r.itemTooltipOption,e=r.componentModel,i=r.itemName,n=z(t)?{formatter:t}:t,a=e.mainType,o=e.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&A(et(l),function(f){hn(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=ot(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:st({content:i,formatterParams:s},n)}}function kc(r,t){var e;r.isGroup&&(e=t(r)),e||r.traverse(t)}function $s(r,t){if(r)if(N(r))for(var e=0;e=0&&s.push(l)}),s}}function Zs(r,t){return at(at({},r,!0),t,!0)}const mT={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},_T={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var _s="ZH",Rh="EN",ma=Rh,Wo={},Eh={},bm=j.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return r.indexOf(_s)>-1?_s:ma}():ma;function xm(r,t){r=r.toUpperCase(),Eh[r]=new Rt(t),Wo[r]=t}function ST(r){if(z(r)){var t=Wo[r.toUpperCase()]||{};return r===_s||r===Rh?Z(t):at(Z(t),Z(Wo[ma]),!1)}else return at(Z(r),Z(Wo[ma]),!1)}function wT(r){return Eh[r]}function bT(){return Eh[ma]}xm(Rh,mT);xm(_s,_T);var kh=1e3,Oh=kh*60,ia=Oh*60,ye=ia*24,zc=ye*365,Yn={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},ao="{yyyy}-{MM}-{dd}",Hc={year:"{yyyy}",month:"{yyyy}-{MM}",day:ao,hour:ao+" "+Yn.hour,minute:ao+" "+Yn.minute,second:ao+" "+Yn.second,millisecond:Yn.none},tu=["year","month","day","hour","minute","second","millisecond"],Tm=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function $t(r,t){return r+="","0000".substr(0,t-r.length)+r}function sn(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function xT(r){return r===sn(r)}function TT(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function qs(r,t,e,i){var n=tr(r),a=n[Bh(e)](),o=n[ln(e)]()+1,s=Math.floor((o-1)/3)+1,l=n[Ks(e)](),u=n["get"+(e?"UTC":"")+"Day"](),f=n[_a(e)](),h=(f-1)%12+1,c=n[Qs(e)](),v=n[Js(e)](),d=n[js(e)](),g=i instanceof Rt?i:wT(i||bm)||bT(),p=g.getModel("time"),y=p.get("month"),m=p.get("monthAbbr"),_=p.get("dayOfWeek"),S=p.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,$t(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[o-1]).replace(/{MMM}/g,m[o-1]).replace(/{MM}/g,$t(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,$t(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$t(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,$t(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,$t(c,2)).replace(/{m}/g,c+"").replace(/{ss}/g,$t(v,2)).replace(/{s}/g,v+"").replace(/{SSS}/g,$t(d,3)).replace(/{S}/g,d+"")}function MT(r,t,e,i,n){var a=null;if(z(e))a=e;else if(X(e))a=e(r.value,t,{level:r.level});else{var o=k({},Yn);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(N(a)){var h=r.level==null?0:r.level>=0?r.level:a.length+r.level;h=Math.min(h,a.length-1),a=a[h]}}return qs(new Date(r.value),a,n,i)}function Mm(r,t){var e=tr(r),i=e[ln(t)]()+1,n=e[Ks(t)](),a=e[_a(t)](),o=e[Qs(t)](),s=e[Js(t)](),l=e[js(t)](),u=l===0,f=u&&s===0,h=f&&o===0,c=h&&a===0,v=c&&n===1,d=v&&i===1;return d?"year":v?"month":c?"day":h?"hour":f?"minute":u?"second":"millisecond"}function Gc(r,t,e){var i=ct(r)?tr(r):r;switch(t=t||Mm(r,e),t){case"year":return i[Bh(e)]();case"half-year":return i[ln(e)]()>=6?1:0;case"quarter":return Math.floor((i[ln(e)]()+1)/4);case"month":return i[ln(e)]();case"day":return i[Ks(e)]();case"half-day":return i[_a(e)]()/24;case"hour":return i[_a(e)]();case"minute":return i[Qs(e)]();case"second":return i[Js(e)]();case"millisecond":return i[js(e)]()}}function Bh(r){return r?"getUTCFullYear":"getFullYear"}function ln(r){return r?"getUTCMonth":"getMonth"}function Ks(r){return r?"getUTCDate":"getDate"}function _a(r){return r?"getUTCHours":"getHours"}function Qs(r){return r?"getUTCMinutes":"getMinutes"}function Js(r){return r?"getUTCSeconds":"getSeconds"}function js(r){return r?"getUTCMilliseconds":"getMilliseconds"}function CT(r){return r?"setUTCFullYear":"setFullYear"}function Cm(r){return r?"setUTCMonth":"setMonth"}function Dm(r){return r?"setUTCDate":"setDate"}function Am(r){return r?"setUTCHours":"setHours"}function Lm(r){return r?"setUTCMinutes":"setMinutes"}function Im(r){return r?"setUTCSeconds":"setSeconds"}function Pm(r){return r?"setUTCMilliseconds":"setMilliseconds"}function Rm(r){if(!Cw(r))return z(r)?r:"-";var t=(r+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Em(r,t){return r=(r||"").toLowerCase().replace(/-(.)/g,function(e,i){return i.toUpperCase()}),t&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Na=Bg;function Sf(r,t,e){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&Ye(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=t==="time",s=r instanceof Date;if(o||s){var l=o?tr(r):r;if(isNaN(+l)){if(s)return"-"}else return qs(l,i,e)}if(t==="ordinal")return Gu(r)?n(r):ct(r)&&a(r)?r+"":"-";var u=ss(r);return a(u)?Rm(u):Gu(r)?n(r):typeof r=="boolean"?r+"":"-"}var Wc=["a","b","c","d","e","f","g"],eu=function(r,t){return"{"+r+(t==null?"":t)+"}"};function km(r,t,e){N(t)||(t=[t]);var i=t.length;if(!i)return"";for(var n=t[0].$vars||[],a=0;a':'';var o=e.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function DR(r,t,e){(r==="week"||r==="month"||r==="quarter"||r==="half-year"||r==="year")&&(r="MM-dd\nyyyy");var i=tr(t),n=e?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),h=i[n+"Milliseconds"]();return r=r.replace("MM",$t(o,2)).replace("M",o).replace("yyyy",a).replace("yy",$t(a%100+"",2)).replace("dd",$t(s,2)).replace("d",s).replace("hh",$t(l,2)).replace("h",l).replace("mm",$t(u,2)).replace("m",u).replace("ss",$t(f,2)).replace("s",f).replace("SSS",$t(h,3)),r}function xi(r,t){return t=t||"transparent",z(r)?r:H(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}var Uo=A,AT=["left","right","top","bottom","width","height"],oo=[["width","left","right"],["height","top","bottom"]];function Nh(r,t,e,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;t.eachChild(function(l,u){var f=l.getBoundingRect(),h=t.childAt(u+1),c=h&&h.getBoundingRect(),v,d;if(r==="horizontal"){var g=f.width+(c?-c.x+f.x:0);v=a+g,v>i||l.newline?(a=0,v=g,o+=s+e,s=f.height):s=Math.max(s,f.height)}else{var p=f.height+(c?-c.y+f.y:0);d=o+p,d>n||l.newline?(a+=s+e,o=0,d=p,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=v+e:o=d+e)})}var un=Nh;xt(Nh,"vertical");xt(Nh,"horizontal");function Ti(r,t,e){e=Na(e||0);var i=t.width,n=t.height,a=dt(r.left,i),o=dt(r.top,n),s=dt(r.right,i),l=dt(r.bottom,n),u=dt(r.width,i),f=dt(r.height,n),h=e[2]+e[0],c=e[1]+e[3],v=r.aspect;switch(isNaN(u)&&(u=i-s-c-a),isNaN(f)&&(f=n-l-h-o),v!=null&&(isNaN(u)&&isNaN(f)&&(v>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=v*f),isNaN(f)&&(f=u/v)),isNaN(a)&&(a=i-s-u-c),isNaN(o)&&(o=n-l-f-h),r.left||r.right){case"center":a=i/2-u/2-e[3];break;case"right":a=i-u-c;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-f/2-e[0];break;case"bottom":o=n-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-c-a-(s||0)),isNaN(f)&&(f=n-h-o-(l||0));var d=new nt(a+e[3],o+e[0],u,f);return d.margin=e,d}function LT(r,t,e,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new nt(0,0,+t.width||0,+t.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var f=r.getLocalTransform();u=u.clone(),u.applyTransform(f)}var h=Ti(st({width:u.width,height:u.height},t),e,i),c=o?h.x-u.x:0,v=s?h.y-u.y:0;return l==="raw"?(a.x=c,a.y=v):(a.x+=c,a.y+=v),a===r&&r.markRedraw(),!0}function Sa(r){var t=r.layoutMode||r.constructor.layoutMode;return H(t)?t:t?{type:t}:null}function vn(r,t,e){var i=e&&e.ignoreSize;!N(i)&&(i=[i,i]);var n=o(oo[0],0),a=o(oo[1],1);u(oo[0],r,n),u(oo[1],r,a);function o(f,h){var c={},v=0,d={},g=0,p=2;if(Uo(f,function(_){d[_]=r[_]}),Uo(f,function(_){s(t,_)&&(c[_]=d[_]=t[_]),l(c,_)&&v++,l(d,_)&&g++}),i[h])return l(t,f[1])?d[f[2]]=null:l(t,f[2])&&(d[f[1]]=null),d;if(g===p||!v)return d;if(v>=p)return c;for(var y=0;y=0;l--)s=at(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return Ea(this.ecModel,e,{index:this.get(n,!0),id:this.get(a,!0)},i)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Rt);Cy(yn,Rt);Fs(yn);gT(yn);yT(yn,RT);function RT(r){var t=[];return A(yn.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=V(t,function(e){return Xe(e).main}),r!=="dataset"&&ft(t,"dataset")<=0&&t.unshift("dataset"),t}const pt=yn;var Om="";typeof navigator<"u"&&(Om=navigator.platform||"");var Fi="rgba(0, 0, 0, 0.2)";const ET={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Fi,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Fi,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Fi,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Fi,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Fi,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Fi,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Om.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var Bm=tt(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),we="original",re="arrayRows",Ne="objectRows",nr="keyedColumns",kr="typedArray",Nm="unknown",Ke="column",mn="row",kt={Must:1,Might:2,Not:3},Fm=yt();function kT(r){Fm(r).datasetMap=tt()}function OT(r,t,e){var i={},n=Fh(t);if(!n||!r)return i;var a=[],o=[],s=t.ecModel,l=Fm(s).datasetMap,u=n.uid+"_"+e.seriesLayoutBy,f,h;r=r.slice(),A(r,function(g,p){var y=H(g)?g:r[p]={name:g};y.type==="ordinal"&&f==null&&(f=p,h=d(y)),i[y.name]=[]});var c=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});A(r,function(g,p){var y=g.name,m=d(g);if(f==null){var _=c.valueWayDim;v(i[y],_,m),v(o,_,m),c.valueWayDim+=m}else if(f===p)v(i[y],0,m),v(a,0,m);else{var _=c.categoryWayDim;v(i[y],_,m),v(o,_,m),c.categoryWayDim+=m}});function v(g,p,y){for(var m=0;mt)return r[i];return r[e-1]}function HT(r,t,e,i,n,a,o){a=a||r;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var f=o==null||!i?e:zT(i,o);if(f=f||e,!(!f||!f.length)){var h=f[l];return n&&(u[n]=h),s.paletteIdx=(l+1)%f.length,h}}function GT(r,t){t(r).paletteIdx=0,t(r).paletteNameMap={}}var so,An,$c,Yc="\0_ec_inner",WT=1,Hm=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Rt(a),this._locale=new Rt(o),this._optionManager=s},t.prototype.setOption=function(e,i,n){var a=qc(i);this._optionManager.setOption(e,n,a),this._resetOption(null,a)},t.prototype.resetOption=function(e,i){return this._resetOption(e,qc(i))},t.prototype._resetOption=function(e,i){var n=!1,a=this._optionManager;if(!e||e==="recreate"){var o=a.mountOption(e==="recreate");!this.option||e==="recreate"?$c(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((e==="timeline"||e==="media")&&this.restoreData(),!e||e==="recreate"||e==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!e||e==="recreate"||e==="media"){var l=a.getMediaOption(this);l.length&&A(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=tt(),u=i&&i.replaceMergeMainTypeMap;kT(this),A(e,function(h,c){h!=null&&(pt.hasClass(c)?c&&(s.push(c),l.set(c,!0)):n[c]=n[c]==null?Z(h):at(n[c],h,!0))}),u&&u.each(function(h,c){pt.hasClass(c)&&!l.get(c)&&(s.push(c),l.set(c,!0))}),pt.topologicalTravel(s,pt.getAllClassMainTypes(),f,this);function f(h){var c=VT(this,h,Ot(e[h])),v=a.get(h),d=v?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=Lw(v,c,d);Bw(g,h,pt),n[h]=null,a.set(h,null),o.set(h,0);var p=[],y=[],m=0,_;A(g,function(S,b){var w=S.existing,x=S.newOption;if(!x)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=h==="series",C=pt.getClass(h,S.keyInfo.subType,!T);if(!C)return;if(h==="tooltip"){if(_)return;_=!0}if(w&&w.constructor===C)w.name=S.keyInfo.name,w.mergeOption(x,this),w.optionUpdated(x,!1);else{var D=k({componentIndex:b},S.keyInfo);w=new C(x,this,this,D),k(w,D),S.brandNew&&(w.__requireNewView=!0),w.init(x,this,this),w.optionUpdated(null,!0)}}w?(p.push(w.option),y.push(w),m++):(p.push(void 0),y.push(void 0))},this),n[h]=p,a.set(h,y),o.set(h,m),h==="series"&&so(this)}this._seriesIndices||so(this)},t.prototype.getOption=function(){var e=Z(this.option);return A(e,function(i,n){if(pt.hasClass(n)){for(var a=Ot(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!da(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,e[n]=a}}),delete e[Yc],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,i){var n=this._componentsMap.get(e);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=t:e==="max"?r<=t:r===t}function tM(r,t){return r.join(",")===t.join(",")}const eM=KT;var Te=A,wa=H,Kc=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function iu(r){var t=r&&r.itemStyle;if(t)for(var e=0,i=Kc.length;e=0;p--){var y=r[p];if(s||(d=y.data.rawIndexOf(y.stackedByDimension,v)),d>=0){var m=y.data.getByRawIndex(y.stackResultDimension,d);if(l==="all"||l==="positive"&&m>0||l==="negative"&&m<0||l==="samesign"&&c>=0&&m>0||l==="samesign"&&c<=0&&m<0){c=xw(c,m),g=m;break}}}return i[0]=c,i[1]=g,i})})}var rl=function(){function r(t){this.data=t.data||(t.sourceFormat===nr?{}:[]),this.sourceFormat=t.sourceFormat||Nm,this.seriesLayoutBy=t.seriesLayoutBy||Ke,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var i=0;ig&&(g=_)}v[0]=d,v[1]=g}},n=function(){return this._data?this._data.length/this._dimSize:0};id=(t={},t[re+"_"+Ke]={pure:!0,appendData:a},t[re+"_"+mn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Ne]={pure:!0,appendData:a},t[nr]={pure:!0,appendData:function(o){var s=this._data;A(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},t[we]={appendData:a},t[kr]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[p])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(t,e){return cn(this.getData(e),t)},r.prototype.formatTooltip=function(t,e,i){},r}();function sd(r){var t,e;return H(r)?r.type&&(e=r):t=r,{text:t,frag:e}}function na(r){return new _M(r)}var _M=function(){function r(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return r.prototype.perform=function(t){var e=this._upstream,i=t&&t.skip;if(this._dirty&&e){var n=this.context;n.data=n.outputData=e.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(m){return!(m>=1)&&(m=1),m}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(e?this._dueEnd=e._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var v=this._dueIndex,d=Math.min(c!=null?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(h||v1&&i>0?s:o}};return a;function o(){return t=r?null:ln?-this._resultLT:0},r}(),wM=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(t){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(t){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(t,e){},r.prototype.retrieveValueFromItem=function(t,e){},r.prototype.convertValue=function(t,e){return $o(t,e)},r}();function bM(r,t){var e=new wM,i=r.data,n=e.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Ke&&Jt(o);var s=[],l={},u=r.dimensionsDefine;if(u)A(u,function(g,p){var y=g.name,m={index:p,name:y,displayName:g.displayName};if(s.push(m),y!=null){var _="";hn(l,y)&&Jt(_),l[y]=m}});else for(var f=0;f65535?IM:PM}function Vi(){return[1/0,-1/0]}function RM(r){var t=r.constructor;return t===Array?r.slice():new t(r)}function fd(r,t,e,i,n){var a=t0[e||"float"];if(n){var o=r[t],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;up[1]&&(p[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=V(o,function(m){return m.property}),f=0;fy[1]&&(y[1]=p)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(i!=null&&it)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks,a=n[t],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,f=0,h=this.count();f=0&&l<0)&&(s=d,l=v,u=0),v===l&&(o[u++]=f))}return o.length=u,o},r.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var a=0;a=h&&m<=c||isNaN(m))&&(l[u++]=g),g++}d=!0}else if(a===2){for(var p=v[n[0]],_=v[n[1]],S=t[n[1]][0],b=t[n[1]][1],y=0;y=h&&m<=c||isNaN(m))&&(w>=S&&w<=b||isNaN(w))&&(l[u++]=g),g++}d=!0}}if(!d)if(a===1)for(var y=0;y=h&&m<=c||isNaN(m))&&(l[u++]=x)}else for(var y=0;yt[D][1])&&(T=!1)}T&&(l[u++]=e.getRawIndex(y))}return uy[1]&&(y[1]=p)}}}},r.prototype.lttbDownSample=function(t,e){var i=this.clone([t],!0),n=i._chunks,a=n[t],o=this.count(),s=0,l=Math.floor(1/e),u=this.getRawIndex(0),f,h,c,v=new(In(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));v[s++]=u;for(var d=1;df&&(f=h,c=S)}M>0&&Mf-d&&(l=f-d,s.length=l);for(var g=0;gh[1]&&(h[1]=y),c[v++]=m}return a._count=v,a._indices=c,a._updateGetRawIdx(),a},r.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[t]=o,o},r.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,a=0;a=0?this._indices[t]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function t(e,i,n,a){return $o(e[a],this._dimensions[a])}ou={arrayRows:t,objectRows:function(e,i,n,a){return $o(e[i],this._dimensions[a])},keyedColumns:t,original:function(e,i,n,a){var o=e&&(e.value==null?e:e.value);return $o(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(e,i,n,a){return e[a]}}}(),r}(),e0=function(){function r(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,e=this._getUpstreamSourceManagers(),i=!!e.length,n,a;if(lo(t)){var o=t,s=void 0,l=void 0,u=void 0;if(i){var f=e[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=se(s)?kr:we,a=[];var h=this._getSourceMetaRawOption()||{},c=u&&u.metaRawOption||{},v=K(h.seriesLayoutBy,c.seriesLayoutBy)||null,d=K(h.sourceHeader,c.sourceHeader),g=K(h.dimensions,c.dimensions),p=v!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||g;n=p?[wf(s,{seriesLayoutBy:v,sourceHeader:d,dimensions:g},l)]:[]}else{var y=t;if(i){var m=this._applyTransform(e);n=m.sourceList,a=m.upstreamSignList}else{var _=y.get("source",!0);n=[wf(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(t){var e=this._sourceHost,i=e.get("transform",!0),n=e.get("fromTransformResult",!0);if(n!=null){var a="";t.length!==1&&vd(a)}var o,s=[],l=[];return A(t,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&vd(h),s.push(f),l.push(u._getVersionSign())}),i?o=AM(i,s,{datasetIndex:e.componentIndex}):n!=null&&(o=[hM(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||e>0&&!r.noHeader;return A(r.blocks,function(n){var a=a0(n);a>=t&&(t=a+ +(i&&(!a||xf(n)&&!n.noHeader)))}),t}return 0}function OM(r,t,e,i){var n=t.noHeader,a=NM(a0(t)),o=[],s=t.blocks||[];_e(!s||N(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(hn(u,l)){var f=new SM(u[l],null);s.sort(function(d,g){return f.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(d,g){var p=t.valueFormatter,y=n0(d)(p?k(k({},r),{valueFormatter:p}):r,d,g>0?a.html:0,i);y!=null&&o.push(y)});var h=r.renderMode==="richText"?o.join(a.richText):Tf(o.join(""),n?e:a.html);if(n)return h;var c=Sf(t.header,"ordinal",r.useUTC),v=i0(i,r.renderMode).nameStyle;return r.renderMode==="richText"?o0(r,c,v)+a.richText+h:Tf('
'+ie(c)+"
"+h,e)}function BM(r,t,e,i){var n=r.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=r.useUTC,f=t.valueFormatter||r.valueFormatter||function(S){return S=N(S)?S:[S],V(S,function(b,w){return Sf(b,N(v)?v[w]:v,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),c=a?"":Sf(l,"ordinal",u),v=t.valueType,d=o?[]:f(t.value),g=!s||!a,p=!s&&a,y=i0(i,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":h)+(a?"":o0(r,c,m))+(o?"":zM(r,d,g,p,_)):Tf((s?"":h)+(a?"":FM(c,!s,m))+(o?"":VM(d,g,p,_)),e)}}function cd(r,t,e,i,n,a){if(r){var o=n0(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function NM(r){return{html:EM[r],richText:kM[r]}}function Tf(r,t){var e='
',i="margin: "+t+"px 0 0";return'
'+r+e+"
"}function FM(r,t,e){var i=t?"margin-left:2px":"";return''+ie(r)+""}function VM(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=N(r)?r:[r],''+V(r,function(o){return ie(o)}).join("  ")+""}function o0(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function zM(r,t,e,i,n){var a=[n],o=i?10:20;return e&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(N(t)?t.join(" "):t,a)}function HM(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return xi(i)}function s0(r,t){var e=r.get("padding");return e!=null?e:t==="richText"?[8,10]:10}var su=function(){function r(){this.richTextStyles={},this._nextStyleNameId=_y()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(t,e,i){var n=i==="richText"?this._generateStyleName():null,a=DT({color:e,type:t,renderMode:i,markerId:n});return z(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};N(e)?A(e,function(a){return k(i,a)}):k(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r}();function GM(r){var t=r.series,e=r.dataIndex,i=r.multipleSeries,n=t.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(e),l=N(s),u=HM(t,e),f,h,c,v;if(o>1||l&&!o){var d=WM(s,t,e,a,u);f=d.inlineValues,h=d.inlineValueTypes,c=d.blocks,v=d.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);v=f=cn(n,e,a[0]),h=g.type}else v=f=l?s[0]:s;var p=dh(t),y=p&&t.name||"",m=n.getName(e),_=i?y:m;return ba("section",{header:y,noHeader:i||!p,sortParam:v,blocks:[ba("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Ye(_),value:f,valueType:h})].concat(c||[])})}function WM(r,t,e,i,n){var a=t.getData(),o=Br(r,function(h,c,v){var d=a.getDimensionInfo(v);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?A(i,function(h){f(cn(a,e,h),h)}):A(r,f);function f(h,c){var v=a.getDimensionInfo(c);!v||v.otherDims.tooltip===!1||(o?u.push(ba("nameValue",{markerType:"subItem",markerColor:n,name:v.displayName,value:h,valueType:v.type})):(s.push(h),l.push(v.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var wr=yt();function uo(r,t){return r.getName(t)||r.getId(t)}var UM="__universalTransitionEnabled",nl=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return t.prototype.init=function(e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=na({count:YM,reset:XM}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=wr(this).sourceManager=new e0(this);a.prepareSource();var o=this.getInitialData(e,n);pd(o,this),this.dataTask.context.data=o,wr(this).dataBeforeProcessed=o,dd(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=Sa(this),a=n?tl(e):{},o=this.subType;pt.hasClass(o)&&(o+="Series"),at(e,i.getTheme().get(this.subType)),at(e,this.getDefaultOption()),lf(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&vn(e,a,n)},t.prototype.mergeOption=function(e,i){e=at(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Sa(this);n&&vn(this.option,e,n);var a=wr(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(e,i);pd(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,wr(this).dataBeforeProcessed=o,dd(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(e){if(e&&!se(e))for(var i=["show"],n=0;nthis.getShallow("animationThreshold")&&(i=!1),!!i},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,i,n){var a=this.ecModel,o=Vh.prototype.getColorFromPalette.call(this,e,i,n);return o||(o=a.getColorFromPalette(e,i,n)),o},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,i){this._innerSelect(this.getData(i),e)},t.prototype.unselect=function(e,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},t.prototype.isSelected=function(e,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[uo(a,e)])&&!a.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[UM])return!0;var e=this.option.universalTransition;return e?e===!0?!0:e&&e.enabled:!1},t.prototype._innerSelect=function(e,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){H(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f0&&this._innerSelect(e,i)}},t.registerClass=function(e){return pt.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(pt);Oe(nl,mM);Oe(nl,Vh);Cy(nl,pt);function dd(r){var t=r.name;dh(r)||(r.name=$M(r)||t)}function $M(r){var t=r.getRawData(),e=t.mapDimensionsAll("seriesName"),i=[];return A(e,function(n){var a=t.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function YM(r){return r.model.getRawData().count()}function XM(r){var t=r.model;return t.setData(t.getRawData().cloneShallow()),ZM}function ZM(r,t){t.outputData&&r.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function pd(r,t){A(G1(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(e){r.wrapMethod(e,xt(qM,t))})}function qM(r,t){var e=Mf(r);return e&&e.setOutputEnd((t||this).count()),t}function Mf(r){var t=(r.ecModel||{}).scheduler,e=t&&t.getPipeline(r.uid);if(e){var i=e.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}const Nr=nl;var Uh=function(){function r(){this.group=new Ct,this.uid=Xs("viewComponent")}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){},r.prototype.updateLayout=function(t,e,i,n){},r.prototype.updateVisual=function(t,e,i,n){},r.prototype.toggleBlurSeries=function(t,e,i){},r.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},r}();gh(Uh);Fs(Uh);const er=Uh;function $h(){var r=yt();return function(t){var e=r(t),i=t.pipelineContext,n=!!e.large,a=!!e.progressiveRender,o=e.large=!!(i&&i.large),s=e.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var l0=yt(),KM=$h(),Yh=function(){function r(){this.group=new Ct,this.uid=Xs("viewChart"),this.renderTask=na({plan:QM,reset:JM}),this.renderTask.context={view:this}}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.highlight=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&yd(a,n,"emphasis")},r.prototype.downplay=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&yd(a,n,"normal")},r.prototype.remove=function(t,e){this.group.removeAll()},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateLayout=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.eachRendered=function(t){$s(this.group,t)},r.markUpdateMethod=function(t,e){l0(t).updateMethod=e},r.protoInitialize=function(){var t=r.prototype;t.type="chart"}(),r}();function gd(r,t,e){r&&pf(r)&&(t==="emphasis"?hs:vs)(r,e)}function yd(r,t,e){var i=wi(r,t),n=t&&t.highlightKey!=null?ox(t.highlightKey):null;i!=null?A(Ot(i),function(a){gd(r.getItemGraphicEl(a),e,n)}):r.eachItemGraphicEl(function(a){gd(a,e,n)})}gh(Yh);Fs(Yh);function QM(r){return KM(r.model)}function JM(r){var t=r.model,e=r.ecModel,i=r.api,n=r.payload,a=t.pipelineContext.progressiveRender,o=r.view,s=n&&l0(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,e,i,n),jM[l]}var jM={incrementalPrepareRender:{progress:function(r,t){t.view.incrementalRender(r,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(r,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}};const Qe=Yh;var Ss="\0__throttleOriginMethod",md="\0__throttleRate",_d="\0__throttleType";function Xh(r,t,e){var i,n=0,a=0,o=null,s,l,u,f;t=t||0;function h(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var c=function(){for(var v=[],d=0;d=0?h():o=setTimeout(h,-s),n=i};return c.clear=function(){o&&(clearTimeout(o),o=null)},c.debounceNextCall=function(v){f=v},c}function u0(r,t,e,i){var n=r[t];if(n){var a=n[Ss]||n,o=n[_d],s=n[md];if(s!==e||o!==i){if(e==null||!i)return r[t]=a;n=r[t]=Xh(a,e,i==="debounce"),n[Ss]=a,n[_d]=i,n[md]=e}return n}}function Cf(r,t){var e=r[t];e&&e[Ss]&&(e.clear&&e.clear(),r[t]=e[Ss])}var Sd=yt(),wd={itemStyle:pa(wm,!0),lineStyle:pa(Sm,!0)},tC={lineStyle:"stroke",itemStyle:"fill"};function f0(r,t){var e=r.visualStyleMapper||wd[t];return e||(console.warn("Unknown style type '"+t+"'."),wd.itemStyle)}function h0(r,t){var e=r.visualDrawType||tC[t];return e||(console.warn("Unknown style type '"+t+"'."),"fill")}var eC={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=f0(r,i),o=a(n),s=n.getShallow("decal");s&&(e.setVisual("decal",s),s.dirty=!0);var l=h0(r,i),u=o[l],f=X(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var c=r.getColorFromPalette(r.name,null,t.getSeriesCount());o[l]||(o[l]=c,e.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||X(o.fill)?c:o.fill,o.stroke=o.stroke==="auto"||X(o.stroke)?c:o.stroke}if(e.setVisual("style",o),e.setVisual("drawType",l),!t.isSeriesFiltered(r)&&f)return e.setVisual("colorFromPalette",!1),{dataEach:function(v,d){var g=r.getDataParams(d),p=k({},o);p[l]=f(g),v.setItemVisual(d,"style",p)}}}},Pn=new Rt,rC={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!(r.ignoreStyleOnData||t.isSeriesFiltered(r))){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=f0(r,i),a=e.getVisual("drawType");return{dataEach:e.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){Pn.option=l[i];var u=n(Pn),f=o.ensureUniqueItemVisual(s,"style");k(f,u),Pn.option.decal&&(o.setItemVisual(s,"decal",Pn.option.decal),Pn.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},iC={performRawSeries:!0,overallReset:function(r){var t=tt();r.eachSeries(function(e){var i=e.getColorBy();if(!e.isColorBySeries()){var n=e.type+"-"+i,a=t.get(n);a||(a={},t.set(n,a)),Sd(e).scope=a}}),r.eachSeries(function(e){if(!(e.isColorBySeries()||r.isSeriesFiltered(e))){var i=e.getRawData(),n={},a=e.getData(),o=Sd(e).scope,s=e.visualStyleAccessPath||"itemStyle",l=h0(e,s);a.each(function(u){var f=a.getRawIndex(u);n[f]=u}),i.each(function(u){var f=n[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var c=a.ensureUniqueItemVisual(f,"style"),v=i.getName(u)||u+"",d=i.count();c[l]=e.getColorFromPalette(v,o,d)}})}})}},fo=Math.PI;function nC(r,t){t=t||{},st(t,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var e=new Ct,i=new Mt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});e.add(i);var n=new It({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Mt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});e.add(a);var o;return t.showSpinner&&(o=new Mh({shape:{startAngle:-fo/2,endAngle:-fo/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:fo*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:fo*3/2}).delay(300).start("circularInOut"),e.add(o)),e.resize=function(){var s=n.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(r.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),f=r.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},e.resize(),e}var aC=function(){function r(t,e,i,n){this._stageTaskMap=tt(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,a=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},r.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData(),a=n.count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&a>=i.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=tt();t.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),e._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;A(this._allHandlers,function(n){var a=t.get(n.uid)||t.set(n.uid,{}),o="";_e(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,e,i),n.overallReset&&this._createOverallStageTask(n,a,e,i)},this)},r.prototype.prepareView=function(t,e,i,n){var a=t.renderTask,o=a.context;o.model=e,o.ecModel=i,o.api=n,a.__block=!t.incrementalPrepareRender,this._pipe(e,a)},r.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},r.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},r.prototype._performStageTasks=function(t,e,i,n){n=n||{};var a=!1,o=this;A(t,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,c=f.overallTask;if(c){var v,d=c.agentStubMap;d.each(function(p){s(n,p)&&(p.dirty(),v=!0)}),v&&c.dirty(),o.updatePayload(c,i);var g=o.getPerformArgs(c,n.block);d.each(function(p){p.perform(g)}),c.perform(g)&&(a=!0)}else h&&h.each(function(p,y){s(n,p)&&p.dirty();var m=o.getPerformArgs(p,n.block);m.skip=!l.performRawSeries&&e.isSeriesFiltered(p.context.model),o.updatePayload(p,i),p.perform(m)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(i){e=i.dataTask.perform()||e}),this.unfinished=e||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},r.prototype.updatePayload=function(t,e){e!=="remain"&&(t.context.payload=e)},r.prototype._createSeriesStageTask=function(t,e,i,n){var a=this,o=e.seriesTaskMap,s=e.seriesTaskMap=tt(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?i.eachRawSeries(f):l?i.eachRawSeriesByType(l,f):u&&u(i,n).each(f);function f(h){var c=h.uid,v=s.set(c,o&&o.get(c)||na({plan:fC,reset:hC,count:cC}));v.context={model:h,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,v)}},r.prototype._createOverallStageTask=function(t,e,i,n){var a=this,o=e.overallTask=e.overallTask||na({reset:oC});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=tt(),u=t.seriesType,f=t.getTargetSeries,h=!0,c=!1,v="";_e(!t.createOnAllSeries,v),u?i.eachRawSeriesByType(u,d):f?f(i,n).each(d):(h=!1,A(i.getSeries(),d));function d(g){var p=g.uid,y=l.set(p,s&&s.get(p)||(c=!0,na({reset:sC,onDirty:uC})));y.context={model:g,overallProgress:h},y.agent=o,y.__block=h,a._pipe(g,y)}c&&o.dirty()},r.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},r.wrapStageHandler=function(t,e){return X(t)&&(t={overallReset:t,seriesType:dC(t)}),t.uid=Xs("stageHandler"),e&&(t.visualType=e),t},r}();function oC(r){r.overallReset(r.ecModel,r.api,r.payload)}function sC(r){return r.overallProgress&&lC}function lC(){this.agent.dirty(),this.getDownstream().dirty()}function uC(){this.agent&&this.agent.dirty()}function fC(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function hC(r){r.useClearVisual&&r.data.clearAllVisual();var t=r.resetDefines=Ot(r.reset(r.model,r.ecModel,r.api,r.payload));return t.length>1?V(t,function(e,i){return v0(i)}):vC}var vC=v0(0);function v0(r){return function(t,e){var i=e.data,n=e.resetDefines[r];if(n&&n.dataEach)for(var a=t.start;a0&&v===u.length-c.length){var d=u.slice(0,v);d!=="data"&&(e.mainType=d,e[c.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(i[u]=l,f=!0),f||(n[u]=l)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},r.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,a));function f(h,c,v,d){return h[v]==null||c[d||v]===h[v]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),Df=["symbol","symbolSize","symbolRotate","symbolOffset"],Md=Df.concat(["symbolKeepAspect"]),mC={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData();if(r.legendIcon&&e.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&di(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function Lf(r,t,e){for(var i=t.type==="radial"?NC(r,t,e):BC(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:ct(r)?[r]:N(r)?r:null}function Zh(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&VC(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=V(e,function(a){return a/n}),i/=n)}return[e,i]}var zC=new dr(!0);function bs(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function Cd(r){return typeof r=="string"&&r!=="none"}function xs(r){var t=r.fill;return t!=null&&t!=="none"}function Dd(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Ad(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function If(r,t,e){var i=yh(t.image,t.__image,e);if(Vs(i)){var n=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Ro),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function HC(r,t,e,i){var n,a=bs(e),o=xs(e),s=e.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var f=t.path||zC,h=t.__dirty;if(!i){var c=e.fill,v=e.stroke,d=o&&!!c.colorStops,g=a&&!!v.colorStops,p=o&&!!c.image,y=a&&!!v.image,m=void 0,_=void 0,S=void 0,b=void 0,w=void 0;(d||g)&&(w=t.getBoundingRect()),d&&(m=h?Lf(r,c,w):t.__canvasFillGradient,t.__canvasFillGradient=m),g&&(_=h?Lf(r,v,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),p&&(S=h||!t.__canvasFillPattern?If(r,c,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(b=h||!t.__canvasStrokePattern?If(r,v,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),d?r.fillStyle=m:p&&(S?r.fillStyle=S:o=!1),g?r.strokeStyle=_:y&&(b?r.strokeStyle=b:a=!1)}var x=t.getGlobalScale();f.setScale(x[0],x[1],t.segmentIgnoreThreshold);var T,C;r.setLineDash&&e.lineDash&&(n=Zh(t),T=n[0],C=n[1]);var D=!0;(u||h&Yi)&&(f.setDPR(r.dpr),l?f.setContext(null):(f.setContext(r),D=!1),f.reset(),t.buildPath(f,t.shape,i),f.toStatic(),t.pathUpdated()),D&&f.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),i||(e.strokeFirst?(a&&Ad(r,e),o&&Dd(r,e)):(o&&Dd(r,e),a&&Ad(r,e))),T&&r.setLineDash([])}function GC(r,t,e){var i=t.__image=yh(e.image,t.__image,t,t.onload);if(!(!i||!Vs(i))){var n=e.x||0,a=e.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var u=e.sx||0,f=e.sy||0;r.drawImage(i,u,f,e.sWidth,e.sHeight,n,a,o,s)}else if(e.sx&&e.sy){var u=e.sx,f=e.sy,h=o-u,c=s-f;r.drawImage(i,u,f,h,c,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function WC(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||Or,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=Zh(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(bs(e)&&r.strokeText(n,e.x,e.y),xs(e)&&r.fillText(n,e.x,e.y)):(xs(e)&&r.fillText(n,e.x,e.y),bs(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Ld=["shadowBlur","shadowOffsetX","shadowOffsetY"],Id=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function S0(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){jt(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?yi.opacity:o}(i||t.blend!==e.blend)&&(a||(jt(r,n),a=!0),r.globalCompositeOperation=t.blend||yi.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,i,n){if(!this[Ft]){if(this._disposed){this.id;return}var a,o,s;if(H(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Ft]=!0,!this._model||i){var l=new eM(this._api),u=this._theme,f=this._model=new Gm;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(e,{replaceMerge:o},Ef);var h={seriesTransition:s,optionChanged:!0};if(n)this[Qt]={silent:a,updateParams:h},this[Ft]=!1,this.getZr().wakeUp();else{try{Hi(this),br.update.call(this,null,h)}catch(c){throw this[Qt]=null,this[Ft]=!1,c}this._ssr||this._zr.flush(),this[Qt]=null,this[Ft]=!1,Rn.call(this,a),En.call(this,a)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||j.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var i=this._zr.painter;return i.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(j.svgSupported){var e=this._zr,i=e.storage.getDisplayList();return A(i,function(n){n.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e=e||{};var i=e.excludeComponents,n=this._model,a=[],o=this;A(i,function(l){n.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return A(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var i=e.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if($d[n]){var l=s,u=s,f=-s,h=-s,c=[],v=e&&e.pixelRatio||this.getDevicePixelRatio();A(oa,function(_,S){if(_.group===n){var b=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(Z(e)),w=_.getDom().getBoundingClientRect();l=a(w.left,l),u=a(w.top,u),f=o(w.right,f),h=o(w.bottom,h),c.push({dom:b,left:w.left,top:w.top})}}),l*=v,u*=v,f*=v,h*=v;var d=f-l,g=h-u,p=dn.createCanvas(),y=Xv(p,{renderer:i?"svg":"canvas"});if(y.resize({width:d,height:g}),i){var m="";return A(c,function(_){var S=_.left-l,b=_.top-u;m+=''+_.dom+""}),y.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return e.connectedBackgroundColor&&y.add(new Mt({shape:{x:0,y:0,width:d,height:g},style:{fill:e.connectedBackgroundColor}})),A(c,function(_){var S=new ir({style:{x:_.left*v-l,y:_.top*v-u,image:_.dom}});y.add(S)}),y.refreshImmediately(),p.toDataURL("image/"+(e&&e.type||"png"))}else return this.getDataURL(e)},t.prototype.convertToPixel=function(e,i){return vu(this,"convertToPixel",e,i)},t.prototype.convertFromPixel=function(e,i){return vu(this,"convertFromPixel",e,i)},t.prototype.containPixel=function(e,i){if(this._disposed){this.id;return}var n=this._model,a,o=Ol(n,e);return A(o,function(s,l){l.indexOf("Models")>=0&&A(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(i,u))}},this)},this),!!a},t.prototype.getVisual=function(e,i){var n=this._model,a=Ol(n,e,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?y0(s,l,i):m0(s,i)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;A(pD,function(i){var n=function(a){var o=e.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&ji(s,function(d){var g=ot(d);if(g&&g.dataIndex!=null){var p=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=p&&p.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=k({},g.eventData),!0},!0),l){var f=l.componentType,h=l.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=l.seriesIndex);var c=f&&h!=null&&o.getComponent(f,h),v=c&&e[c.mainType==="series"?"_chartsMap":"_componentsMap"][c.__viewId];l.event=a,l.type=i,e._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:c,view:v},e.trigger(i,l)}};n.zrEventfulCallAtLast=!0,e._zr.on(i,n,e)}),A(aa,function(i,n){e._messageCenter.on(n,function(a){this.trigger(n,a)},e)}),A(["selectchanged"],function(i){e._messageCenter.on(i,function(n){this.trigger(i,n)},e)}),bC(this._messageCenter,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var e=this.getDom();e&&xy(this.getDom(),Qh,"");var i=this,n=i._api,a=i._model;A(i._componentsViews,function(o){o.dispose(a,n)}),A(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete oa[i.id]},t.prototype.resize=function(e){if(!this[Ft]){if(this._disposed){this.id;return}this._zr.resize(e);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=e&&e.silent;this[Qt]&&(a==null&&(a=this[Qt].silent),n=!0,this[Qt]=null),this[Ft]=!0;try{n&&Hi(this),br.update.call(this,{type:"resize",animation:k({duration:0},e&&e.animation)})}catch(o){throw this[Ft]=!1,o}this[Ft]=!1,Rn.call(this,a),En.call(this,a)}}},t.prototype.showLoading=function(e,i){if(this._disposed){this.id;return}if(H(e)&&(i=e,e=""),e=e||"default",this.hideLoading(),!!kf[e]){var n=kf[e](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var i=k({},e);return i.type=aa[e.type],i},t.prototype.dispatchAction=function(e,i){if(this._disposed){this.id;return}if(H(i)||(i={silent:!!i}),!!Ts[e.type]&&this._model){if(this[Ft]){this._pendingActions.push(e);return}var n=i.silent;du.call(this,e,n);var a=i.flush;a?this._zr.flush():a!==!1&&j.browser.weChat&&this._throttledZrFlush(),Rn.call(this,n),En.call(this,n)}},t.prototype.updateLabelLayout=function(){Ae.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var i=e.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){Hi=function(h){var c=h._scheduler;c.restorePipelines(h._model),c.prepareStageTasks(),hu(h,!0),hu(h,!1),c.plan()},hu=function(h,c){for(var v=h._model,d=h._scheduler,g=c?h._componentsViews:h._chartsViews,p=c?h._componentsMap:h._chartsMap,y=h._zr,m=h._api,_=0;_c.get("hoverLayerThreshold")&&!j.node&&!j.worker&&c.eachSeries(function(p){if(!p.preventUsingHoverLayer){var y=h._chartsMap[p.__viewId];y.__alive&&y.eachRendered(function(m){m.states.emphasis&&(m.states.emphasis.hoverLayer=!0)})}})}function o(h,c){var v=h.get("blendMode")||null;c.eachRendered(function(d){d.isGroup||(d.style.blend=v)})}function s(h,c){if(!h.preventAutoZ){var v=h.get("z")||0,d=h.get("zlevel")||0;c.eachRendered(function(g){return l(g,v,d,-1/0),!0})}}function l(h,c,v,d){var g=h.getTextContent(),p=h.getTextGuideLine(),y=h.isGroup;if(y)for(var m=h.childrenRef(),_=0;_0?{duration:g,delay:v.get("delay"),easing:v.get("easing")}:null;c.eachRendered(function(y){if(y.states&&y.states.emphasis){if(an(y))return;if(y instanceof lt&&sx(y),y.__dirty){var m=y.prevStates;m&&y.useStates(m)}if(d){y.stateTransition=p;var _=y.getTextContent(),S=y.getTextGuideLine();_&&(_.stateTransition=p),S&&(S.stateTransition=p)}y.__dirty&&n(y)}})}Wd=function(h){return new(function(c){B(v,c);function v(){return c!==null&&c.apply(this,arguments)||this}return v.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},v.prototype.getComponentByElement=function(d){for(;d;){var g=d.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);d=d.parent}},v.prototype.enterEmphasis=function(d,g){hs(d,g),le(h)},v.prototype.leaveEmphasis=function(d,g){vs(d,g),le(h)},v.prototype.enterBlur=function(d){Qb(d),le(h)},v.prototype.leaveBlur=function(d){Wy(d),le(h)},v.prototype.enterSelect=function(d){Uy(d),le(h)},v.prototype.leaveSelect=function(d){$y(d),le(h)},v.prototype.getModel=function(){return h.getModel()},v.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},v.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},v}(Wm))(h)},O0=function(h){function c(v,d){for(var g=0;g=0)){Yd.push(e);var a=p0.wrapStageHandler(e,n);a.__prio=t,a.__raw=e,r.push(a)}}function H0(r,t){kf[r]=t}function bD(r,t,e){var i=tD("registerMap");i&&i(r,t,e)}var xD=DM;Ai(qh,eC);Ai(al,rC);Ai(al,iC);Ai(qh,mC);Ai(al,_C);Ai(L0,QC);V0($m);z0(iD,uM);H0("default",nC);_n({type:mi,event:mi,update:mi},Ht);_n({type:zo,event:zo,update:zo},Ht);_n({type:ta,event:ta,update:ta},Ht);_n({type:Ho,event:Ho,update:Ho},Ht);_n({type:ea,event:ea,update:ea},Ht);F0("light",pC);F0("dark",gC);function kn(r){return r==null?0:r.length||1}function Xd(r){return r}var TD=function(){function r(t,e,i,n,a,o){this._old=t,this._new=e,this._oldKeyGetter=i||Xd,this._newKeyGetter=n||Xd,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(t){return this._add=t,this},r.prototype.update=function(t){return this._update=t,this},r.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},r.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},r.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},r.prototype.remove=function(t){return this._remove=t,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var t=this._old,e=this._new,i={},n=new Array(t.length),a=new Array(e.length);this._initIndexMap(t,null,n,"_oldKeyGetter"),this._initIndexMap(e,i,a,"_newKeyGetter");for(var o=0;o1){var f=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(f,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},a=[],o=[];this._initIndexMap(t,i,a,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s1&&c===1)this._updateManyToOne&&this._updateManyToOne(f,u),n[l]=null;else if(h===1&&c>1)this._updateOneToMany&&this._updateOneToMany(f,u),n[l]=null;else if(h===1&&c===1)this._update&&this._update(f,u),n[l]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(f,u),n[l]=null;else if(h>1)for(var v=0;v1)for(var s=0;s30}var On=H,xr=V,ED=typeof Int32Array>"u"?Array:Int32Array,kD="e\0\0",Zd=-1,OD=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],BD=["_approximateExtent"],qd,go,Bn,Nn,yu,yo,mu,ND=function(){function r(t,e){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;W0(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f=e)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===we;if(l&&!n.pure)for(var u=[],f=t;f0},r.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var a=n[e];return a==null&&(a=this.getVisual(e),N(a)?a=a.slice():On(a)&&(a=k({},a)),n[e]=a),a},r.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,On(e)?k(n,e):n[e]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(t,e){On(t)?k(this._layout,t):this._layout[t]=e},r.prototype.getLayout=function(t){return this._layout[t]},r.prototype.getItemLayout=function(t){return this._itemLayouts[t]},r.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?k(this._itemLayouts[t]||{},e):e},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(t,e){var i=this.hostModel&&this.hostModel.seriesIndex;Hb(i,this.dataType,t,e),this._graphicEls[t]=e},r.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},r.prototype.eachItemGraphicEl=function(t,e){A(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},r.prototype.cloneShallow=function(t){return t||(t=new r(this._schema?this._schema:xr(this.dimensions,this._getDimInfo,this),this.hostModel)),yu(t,this),t._store=this._store,t},r.prototype.wrapMethod=function(t,e){var i=this[t];X(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var n=i.apply(this,arguments);return e.apply(this,[n].concat(nh(arguments)))})},r.internalField=function(){qd=function(t){var e=t._invertedIndicesMap;A(e,function(i,n){var a=t._dimInfos[n],o=a.ordinalMeta,s=t._store;if(o){i=e[n]=new ED(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),n[e]=l}}}(),r}();const X0=ND;function IR(r,t){return tv(r,t).dimensions}function tv(r,t){zh(r)||(r=Hh(r)),t=t||{};var e=t.coordDimensions||[],i=t.dimensionsDefine||r.dimensionsDefine||[],n=tt(),a=[],o=VD(r,e,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Y0(o),l=i===r.dimensionsDefine,u=l?$0(r):U0(i),f=t.encodeDefine;!f&&t.encodeDefaulter&&(f=t.encodeDefaulter(r,o));for(var h=tt(f),c=new jm(o),v=0;v0&&(i.name=n+(a-1)),a++,t.set(n,a)}}function VD(r,t,e,i){var n=Math.max(r.dimensionsDetectedCount||1,t.length,e.length,i||0);return A(t,function(a){var o;H(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function zD(r,t,e){if(e||t.hasKey(r)){for(var i=0;t.hasKey(r+i);)i++;r+=i}return t.set(r,!0),r}var HD=function(){function r(t){this.coordSysDims=[],this.axisMap=tt(),this.categoryAxisMap=tt(),this.coordSysName=t}return r}();function GD(r){var t=r.get("coordinateSystem"),e=new HD(t),i=WD[t];if(i)return i(r,e,e.axisMap,e.categoryAxisMap),e}var WD={cartesian2d:function(r,t,e,i){var n=r.getReferringComponents("xAxis",Ie).models[0],a=r.getReferringComponents("yAxis",Ie).models[0];t.coordSysDims=["x","y"],e.set("x",n),e.set("y",a),Gi(n)&&(i.set("x",n),t.firstCategoryDimIndex=0),Gi(a)&&(i.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(r,t,e,i){var n=r.getReferringComponents("singleAxis",Ie).models[0];t.coordSysDims=["single"],e.set("single",n),Gi(n)&&(i.set("single",n),t.firstCategoryDimIndex=0)},polar:function(r,t,e,i){var n=r.getReferringComponents("polar",Ie).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],e.set("radius",a),e.set("angle",o),Gi(a)&&(i.set("radius",a),t.firstCategoryDimIndex=0),Gi(o)&&(i.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(r,t,e,i){t.coordSysDims=["lng","lat"]},parallel:function(r,t,e,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();A(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];e.set(f,u),Gi(u)&&(i.set(f,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})}};function Gi(r){return r.get("type")==="category"}function Z0(r,t,e){e=e||{};var i=e.byIndex,n=e.stackedCoordDimension,a,o,s;UD(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(r&&r.get("stack")),u,f,h,c;if(A(a,function(m,_){z(m)&&(a[_]=m={name:m}),l&&!m.isExtraCoord&&(!i&&!u&&m.ordinalMeta&&(u=m),!f&&m.type!=="ordinal"&&m.type!=="time"&&(!n||n===m.coordDim)&&(f=m))}),f&&!i&&!u&&(i=!0),f){h="__\0ecstackresult_"+r.id,c="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var v=f.coordDim,d=f.type,g=0;A(a,function(m){m.coordDim===v&&g++});var p={name:h,coordDim:v,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:c,coordDim:c,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(p.storeDimIndex=s.ensureCalculationDimension(c,d),y.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(p),o.appendCalculationDimension(y)):(a.push(p),a.push(y))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:c,stackResultDimension:h}}function UD(r){return!W0(r.schema)}function Mi(r,t){return!!t&&t===r.getCalculationInfo("stackedDimension")}function q0(r,t){return Mi(r,t)?r.getCalculationInfo("stackResultDimension"):t}function $D(r,t){var e=r.get("coordinateSystem"),i=el.get(e),n;return t&&t.coordSysDims&&(n=V(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=AD(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function YD(r,t,e){var i,n;return e&&A(r,function(a,o){var s=a.coordDim,l=e.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function ev(r,t,e){e=e||{};var i=t.getSourceManager(),n,a=!1;r?(a=!0,n=Hh(r)):(n=i.getSource(),a=n.sourceFormat===we);var o=GD(t),s=$D(t,o),l=e.useEncodeDefaulter,u=X(l)?l:l?xt(OT,s,t):null,f={coordDimensions:s,generateCoord:e.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=tv(n,f),c=YD(h.dimensions,e.createInvertedIndices,o),v=a?null:i.getSharedDataStore(h),d=Z0(t,{schema:h,store:v}),g=new X0(h,t);g.setCalculationInfo(d);var p=c!=null&&XD(n)?function(y,m,_,S){return S===c?_:this.defaultDimValueGetter(y,m,_,S)}:null;return g.hasItemOption=!1,g.initData(a?n:v,null,p),g}function XD(r){if(r.sourceFormat===we){var t=ZD(r.data||[]);return!N(Ra(t))}}function ZD(r){for(var t=0;te[1]&&(e[1]=t[1])},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},r.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(t){this._isBlank=t},r}();Fs(K0);const yr=K0;var qD=0,KD=function(){function r(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++qD}return r.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&V(i,QD);return new r({categories:n,needCollect:!n,deduplication:e.dedplication!==!1})},r.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},r.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!z(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return e=n.get(t),e==null&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},r.prototype._getOrCreateMap=function(){return this._map||(this._map=tt(this.categories))},r}();function QD(r){return H(r)&&r.value!=null?r.value:r+""}const Of=KD;function Bf(r){return r.type==="interval"||r.type==="log"}function JD(r,t,e,i){var n={},a=r[1]-r[0],o=n.interval=my(a/t,!0);e!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=Q0(o),l=n.niceTickExtent=[Tt(Math.ceil(r[0]/o)*o,s),Tt(Math.floor(r[1]/o)*o,s)];return jD(l,r),n}function _u(r){var t=Math.pow(10,ch(r)),e=r/t;return e?e===2?e=3:e===3?e=5:e*=2:e=1,Tt(e*t)}function Q0(r){return ur(r)+2}function Kd(r,t,e){r[t]=Math.max(Math.min(r[t],e[1]),e[0])}function jD(r,t){!isFinite(r[0])&&(r[0]=t[0]),!isFinite(r[1])&&(r[1]=t[1]),Kd(r,0,t),Kd(r,1,t),r[0]>r[1]&&(r[0]=r[1])}function ol(r,t){return r>=t[0]&&r<=t[1]}function sl(r,t){return t[1]===t[0]?.5:(r-t[0])/(t[1]-t[0])}function ll(r,t){return r*(t[1]-t[0])+t[0]}var J0=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new Of({})),N(n)&&(n=new Of({categories:V(n,function(a){return H(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return t.prototype.parse=function(e){return e==null?NaN:z(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return e=this.parse(e),ol(e,this._extent)&&this._ordinalMeta.categories[e]!=null},t.prototype.normalize=function(e){return e=this._getTickNumber(this.parse(e)),sl(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(ll(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],i=this._extent,n=i[0];n<=i[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(yr);yr.registerClass(J0);const j0=J0;var ni=Tt,t_=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return ol(e,this._extent)},t.prototype.normalize=function(e){return sl(e,this._extent)},t.prototype.scale=function(e){return ll(e,this._extent)},t.prototype.setExtent=function(e,i){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(i)||(n[1]=parseFloat(i))},t.prototype.unionExtent=function(e){var i=this._extent;e[0]i[1]&&(i[1]=e[1]),this.setExtent(i[0],i[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Q0(e)},t.prototype.getTicks=function(e){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]l)return[];var f=s.length?s[s.length-1].value:a[1];return n[1]>f&&(e?s.push({value:ni(f+i,o)}):s.push({value:n[1]})),s},t.prototype.getMinorTicks=function(e){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;oa[0]&&v0&&(a=a===null?s:Math.min(a,s))}e[i]=a}}return e}function i_(r){var t=rA(r),e=[];return A(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),c=Math.abs(h[1]-h[0]);s=u?f/c*u:f}else{var v=i.getData();s=Math.abs(o[1]-o[0])/v.count()}var d=dt(i.get("barWidth"),s),g=dt(i.get("barMaxWidth"),s),p=dt(i.get("barMinWidth")||(a_(i)?.5:1),s),y=i.get("barGap"),m=i.get("barCategoryGap");e.push({bandWidth:s,barWidth:d,barMaxWidth:g,barMinWidth:p,barGap:y,barCategoryGap:m,axisKey:iv(a),stackId:rv(i)})}),iA(e)}function iA(r){var t={};A(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;t[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=i.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var c=i.barMinWidth;c&&(l[u].minWidth=c);var v=i.barGap;v!=null&&(s.gap=v);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var e={};return A(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=et(a).length;s=Math.max(35-l*4,15)+"%"}var u=dt(s,o),f=dt(i.gap,1),h=i.remainedWidth,c=i.autoWidthCount,v=(h-u)/(c+(c-1)*f);v=Math.max(v,0),A(a,function(y){var m=y.maxWidth,_=y.minWidth;if(y.width){var S=y.width;m&&(S=Math.min(S,m)),_&&(S=Math.max(S,_)),y.width=S,h-=S+f*S,c--}else{var S=v;m&&mS&&(S=_),S!==v&&(y.width=S,h-=S+f*S,c--)}}),v=(h-u)/(c+(c-1)*f),v=Math.max(v,0);var d=0,g;A(a,function(y,m){y.width||(y.width=v),g=y,d+=y.width*(1+f)}),g&&(d-=g.width*f);var p=-d/2;A(a,function(y,m){e[n][m]=e[n][m]||{bandWidth:o,offset:p,width:y.width},p+=y.width*(1+f)})}),e}function nA(r,t,e){if(r&&t){var i=r[iv(t)];return i!=null&&e!=null?i[rv(e)]:i}}function aA(r,t){var e=r_(r,t),i=i_(e);A(e,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=rv(n),u=i[iv(s)][l],f=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:f,size:h})})}function oA(r){return{seriesType:r,plan:$h(),reset:function(t){if(n_(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=e.getDimensionIndex(e.mapDimension(a.dim)),s=e.getDimensionIndex(e.mapDimension(n.dim)),l=t.get("showBackground",!0),u=e.mapDimension(a.dim),f=e.getCalculationInfo("stackResultDimension"),h=Mi(e,u)&&!!e.getCalculationInfo("stackedOnSeries"),c=a.isHorizontal(),v=sA(n,a),d=a_(t),g=t.get("barMinHeight")||0,p=f&&e.getDimensionIndex(f),y=e.getLayout("size"),m=e.getLayout("offset");return{progress:function(_,S){for(var b=_.count,w=d&&hr(b*3),x=d&&l&&hr(b*3),T=d&&hr(b),C=i.master.getRect(),D=c?C.width:C.height,M,L=S.getStore(),I=0;(M=_.next())!=null;){var P=L.get(h?p:o,M),R=L.get(s,M),E=v,W=void 0;h&&(W=+P-L.get(o,M));var O=void 0,F=void 0,G=void 0,q=void 0;if(c){var $=i.dataToPoint([P,R]);if(h){var Q=i.dataToPoint([W,R]);E=Q[0]}O=E,F=$[1]+m,G=$[0]-E,q=y,Math.abs(G)>>1;r[n][1]n&&(this._approxInterval=n);var s=mo.length,l=Math.min(lA(mo,this._approxInterval,0,s),s-1);this._interval=mo[l][1],this._minLevelUnit=mo[Math.max(l-1,0)][0]},t.prototype.parse=function(e){return ct(e)?e:+tr(e)},t.prototype.contain=function(e){return ol(this.parse(e),this._extent)},t.prototype.normalize=function(e){return sl(this.parse(e),this._extent)},t.prototype.scale=function(e){return ll(e,this._extent)},t.type="time",t}(Fa),mo=[["second",kh],["minute",Oh],["hour",ia],["quarter-day",ia*6],["half-day",ia*12],["day",ye*1.2],["half-week",ye*3.5],["week",ye*7],["month",ye*31],["quarter",ye*95],["half-year",zc/2],["year",zc]];function uA(r,t,e,i){var n=tr(t),a=tr(e),o=function(d){return Gc(n,d,i)===Gc(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},f=function(){return u()&&o("hour")},h=function(){return f()&&o("minute")},c=function(){return h()&&o("second")},v=function(){return c()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return f();case"minute":return h();case"second":return c();case"millisecond":return v()}}function fA(r,t){return r/=ye,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function hA(r){var t=30*ye;return r/=t,r>6?6:r>3?3:r>2?2:1}function vA(r){return r/=ia,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function Qd(r,t){return r/=t?Oh:kh,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function cA(r){return my(r,!0)}function dA(r,t,e){var i=new Date(r);switch(sn(t)){case"year":case"month":i[Cm(e)](0);case"day":i[Dm(e)](1);case"hour":i[Am(e)](0);case"minute":i[Lm(e)](0);case"second":i[Im(e)](0),i[Pm(e)](0)}return i.getTime()}function pA(r,t,e,i){var n=1e4,a=Tm,o=0;function s(D,M,L,I,P,R,E){for(var W=new Date(M),O=M,F=W[I]();O1&&R===0&&L.unshift({value:L[0].value-O})}}for(var R=0;R=i[0]&&m<=i[1]&&h++)}var _=(i[1]-i[0])/t;if(h>_*1.5&&c>_/1.5||(u.push(p),h>_||r===a[v]))break}f=[]}}}for(var S=At(V(u,function(D){return At(D,function(M){return M.value>=i[0]&&M.value<=i[1]&&!M.notAdd})}),function(D){return D.length>0}),b=[],w=S.length-1,v=0;v0;)a*=10;var s=[Tt(_A(i[0]/a)*a),Tt(mA(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},t.prototype.calcNiceExtent=function(e){sa.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=Me(e)/Me(this.base),ol(e,this._extent)},t.prototype.normalize=function(e){return e=Me(e)/Me(this.base),sl(e,this._extent)},t.prototype.scale=function(e){return e=ll(e,this._extent),_o(this.base,e)},t.type="log",t}(yr),s_=nv.prototype;s_.getMinorTicks=sa.getMinorTicks;s_.getLabel=sa.getLabel;function So(r,t){return yA(r,ur(t))}yr.registerClass(nv);const SA=nv;var wA=function(){function r(t,e,i){this._prepareParams(t,e,i)}return r.prototype._prepareParams=function(t,e,i){i[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var c=this._determinedMin,v=this._determinedMax;return c!=null&&(s=c,u=!0),v!=null&&(l=v,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},r.prototype.modifyDataMinMax=function(t,e){this[xA[t]]=e},r.prototype.setDeterminedMinMax=function(t,e){var i=bA[t];this[i]=e},r.prototype.freeze=function(){this.frozen=!0},r}(),bA={min:"_determinedMin",max:"_determinedMax"},xA={min:"_dataMin",max:"_dataMax"};function TA(r,t,e){var i=r.rawExtentInfo;return i||(i=new wA(r,t,e),r.rawExtentInfo=i,i)}function wo(r,t){return t==null?null:Ko(t)?NaN:r.parse(t)}function l_(r,t){var e=r.type,i=TA(r,t,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=t.ecModel;if(o&&e==="time"){var s=r_("bar",o),l=!1;if(A(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=i_(s),f=MA(n,a,t,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function MA(r,t,e,i){var n=e.axis.getExtent(),a=n[1]-n[0],o=nA(i,e.axis);if(o===void 0)return{min:r,max:t};var s=1/0;A(o,function(v){s=Math.min(v.offset,s)});var l=-1/0;A(o,function(v){l=Math.max(v.offset+v.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=t-r,h=1-(s+l)/a,c=f/h-f;return t+=c*(l/u),r-=c*(s/u),{min:r,max:t}}function Nf(r,t){var e=t,i=l_(r,e),n=i.extent,a=e.get("splitNumber");r instanceof SA&&(r.base=e.get("logBase"));var o=r.type,s=e.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?e.get("minInterval"):null,maxInterval:l?e.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function u_(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new j0({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new gA({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(yr.getClass(t)||Fa)}}function CA(r){var t=r.scale.getExtent(),e=t[0],i=t[1];return!(e>0&&i>0||e<0&&i<0)}function Va(r){var t=r.getLabelModel().get("formatter"),e=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(t):z(t)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a!=null?a:"");return o}}(t):X(t)?function(i){return function(n,a){return e!=null&&(a=n.value-e),i(av(r,n),a,n.level!=null?{level:n.level}:null)}}(t):function(i){return r.scale.getLabel(i)}}function av(r,t){return r.type==="category"?r.scale.getLabel(t):t.value}function DA(r){var t=r.model,e=r.scale;if(!(!t.get(["axisLabel","show"])||e.isBlank())){var i,n,a=e.getExtent();e instanceof j0?n=e.count():(i=e.getTicks(),n=i.length);var o=r.getLabelModel(),s=Va(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var f=0;f=0||(jd.push(r),X(r)&&(r={install:r}),r.install(IA))}var Ma=yt();function PA(r){return r.type==="category"?EA(r):OA(r)}function RA(r,t){return r.type==="category"?kA(r,t):{ticks:V(r.scale.getTicks(),function(e){return e.value})}}function EA(r){var t=r.getLabelModel(),e=v_(r,t);return!t.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:e.labelCategoryInterval}:e}function v_(r,t){var e=c_(r,"labels"),i=ov(t),n=d_(e,i);if(n)return n;var a,o;return X(i)?a=y_(r,i):(o=i==="auto"?BA(r):i,a=g_(r,o)),p_(e,i,{labels:a,labelCategoryInterval:o})}function kA(r,t){var e=c_(r,"ticks"),i=ov(t),n=d_(e,i);if(n)return n;var a,o;if((!t.get("show")||r.scale.isBlank())&&(a=[]),X(i))a=y_(r,i,!0);else if(i==="auto"){var s=v_(r,r.getLabelModel());o=s.labelCategoryInterval,a=V(s.labels,function(l){return l.tickValue})}else o=i,a=g_(r,o,!0);return p_(e,i,{ticks:a,tickCategoryInterval:o})}function OA(r){var t=r.scale.getTicks(),e=Va(r);return{labels:V(t,function(i,n){return{level:i.level,formattedLabel:e(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function c_(r,t){return Ma(r)[t]||(Ma(r)[t]=[])}function d_(r,t){for(var e=0;e40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),f=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),c=0,v=0;l<=a[1];l+=s){var d=0,g=0,p=hh(e({value:l}),t.font,"center","top");d=p.width*1.3,g=p.height*1.3,c=Math.max(c,d,7),v=Math.max(v,g,7)}var y=c/f,m=v/h;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),S=Ma(r.model),b=r.getExtent(),w=S.lastAutoInterval,x=S.lastTickCount;return w!=null&&x!=null&&Math.abs(w-_)<=1&&Math.abs(x-o)<=1&&w>_&&S.axisExtent0===b[0]&&S.axisExtent1===b[1]?_=w:(S.lastTickCount=o,S.lastAutoInterval=_,S.axisExtent0=b[0],S.axisExtent1=b[1]),_}function FA(r){var t=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function g_(r,t,e){var i=Va(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],f=n.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=f_(r),c=o.get("showMinLabel")||h,v=o.get("showMaxLabel")||h;c&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);v&&d-l!==a[1]&&g(a[1]);function g(p){var y={value:p};s.push(e?p:{formattedLabel:i(y),rawLabel:n.getLabel(y),tickValue:p})}return s}function y_(r,t,e){var i=r.scale,n=Va(r),a=[];return A(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;t(o.value,s)&&a.push(e?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var tp=[0,1],VA=function(){function r(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return r.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},r.prototype.containData=function(t){return this.scale.contain(t)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(t){return ww(t||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},r.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&n.type==="ordinal"&&(i=i.slice(),ep(i,n.count())),je(t,tp,i,e)},r.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),ep(i,n.count()));var a=je(t,i,tp,e);return this.scale.scale(a)},r.prototype.pointToData=function(t,e){},r.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),i=RA(this,e),n=i.ticks,a=V(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=e.get("alignWithLabel");return zA(this,a,o,t.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var i=this.scale.getMinorTicks(e),n=V(i,function(a){return V(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return PA(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return NA(this)},r}();function ep(r,t){var e=r[1]-r[0],i=t,n=e/i/2;r[0]+=n,r[1]-=n}function zA(r,t,e,i){var n=t.length;if(!r.onBand||e||!n)return;var a=r.getExtent(),o,s;if(n===1)t[0].coord=a[0],o=t[1]={coord:a[1]};else{var l=t[n-1].tickValue-t[0].tickValue,u=(t[n-1].coord-t[0].coord)/l;A(t,function(v){v.coord-=u/2});var f=r.scale.getExtent();s=1+f[1]-t[n-1].tickValue,o={coord:t[n-1].coord+u*s},t.push(o)}var h=a[0]>a[1];c(t[0].coord,a[0])&&(i?t[0].coord=a[0]:t.shift()),i&&c(a[0],t[0].coord)&&t.unshift({coord:a[0]}),c(a[1],o.coord)&&(i?o.coord=a[1]:t.pop()),i&&c(o.coord,a[1])&&t.push({coord:a[1]});function c(v,d){return v=Tt(v),d=Tt(d),h?v>d:vn&&(n+=Fn);var v=Math.atan2(s,o);if(v<0&&(v+=Fn),v>=i&&v<=n||v+Fn>=i&&v+Fn<=n)return l[0]=f,l[1]=h,u-e;var d=e*Math.cos(i)+r,g=e*Math.sin(i)+t,p=e*Math.cos(n)+r,y=e*Math.sin(n)+t,m=(d-o)*(d-o)+(g-s)*(g-s),_=(p-o)*(p-o)+(y-s)*(y-s);return m<_?(l[0]=d,l[1]=g,Math.sqrt(m)):(l[0]=p,l[1]=y,Math.sqrt(_))}function Cs(r,t,e,i,n,a,o,s){var l=n-r,u=a-t,f=e-r,h=i-t,c=Math.sqrt(f*f+h*h);f/=c,h/=c;var v=l*f+u*h,d=v/c;s&&(d=Math.min(Math.max(d,0),1)),d*=c;var g=o[0]=r+d*f,p=o[1]=t+d*h;return Math.sqrt((g-n)*(g-n)+(p-a)*(p-a))}function m_(r,t,e,i,n,a,o){e<0&&(r=r+e,e=-e),i<0&&(t=t+i,i=-i);var s=r+e,l=t+i,u=o[0]=Math.min(Math.max(n,r),s),f=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-n)*(u-n)+(f-a)*(f-a))}var Le=[];function $A(r,t,e){var i=m_(t.x,t.y,t.width,t.height,r.x,r.y,Le);return e.set(Le[0],Le[1]),i}function YA(r,t,e){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,f=t.data,h=r.x,c=r.y,v=0;v0){t=t/180*Math.PI,Pe.fromArray(r[0]),ht.fromArray(r[1]),St.fromArray(r[2]),Y.sub(Ze,Pe,ht),Y.sub($e,St,ht);var e=Ze.len(),i=$e.len();if(!(e<.001||i<.001)){Ze.scale(1/e),$e.scale(1/i);var n=Ze.dot($e),a=Math.cos(t);if(a1&&Y.copy(Yt,St),Yt.toArray(r[1])}}}}function XA(r,t,e){if(e<=180&&e>0){e=e/180*Math.PI,Pe.fromArray(r[0]),ht.fromArray(r[1]),St.fromArray(r[2]),Y.sub(Ze,ht,Pe),Y.sub($e,St,ht);var i=Ze.len(),n=$e.len();if(!(i<.001||n<.001)){Ze.scale(1/i),$e.scale(1/n);var a=Ze.dot(t),o=Math.cos(e);if(a=l)Y.copy(Yt,St);else{Yt.scaleAndAdd($e,s/Math.tan(Math.PI/2-f));var h=St.x!==ht.x?(Yt.x-ht.x)/(St.x-ht.x):(Yt.y-ht.y)/(St.y-ht.y);if(isNaN(h))return;h<0?Y.copy(Yt,ht):h>1&&Y.copy(Yt,St)}Yt.toArray(r[1])}}}}function ip(r,t,e,i){var n=e==="normal",a=n?r:r.ensureState(e);a.ignore=t;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function ZA(r,t){var e=t.smooth,i=t.points;if(i)if(r.moveTo(i[0][0],i[0][1]),e>0&&i.length>=3){var n=Uu(i[0],i[1]),a=Uu(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*e,s=vl([],i[1],i[0],o/n),l=vl([],i[1],i[2],o/a),u=vl([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var f=1;f0&&a&&b(-f/o,0,o);var g=r[0],p=r[o-1],y,m;_(),y<0&&w(-y,.8),m<0&&w(m,.8),_(),S(y,m,1),S(m,y,-1),_(),y<0&&x(-y),m<0&&x(m);function _(){y=g.rect[t]-i,m=n-p.rect[t]-p.rect[e]}function S(T,C,D){if(T<0){var M=Math.min(C,-T);if(M>0){b(M*D,0,o);var L=M+T;L<0&&w(-L*D,1)}else w(-T*D,1)}}function b(T,C,D){T!==0&&(u=!0);for(var M=C;M0)for(var L=0;L0;L--){var E=D[L-1]*R;b(-E,L,o)}}}function x(T){var C=T<0?-1:1;T=Math.abs(T);for(var D=Math.ceil(T/(o-1)),M=0;M0?b(D,0,M+1):b(-D,o-M-1,o),T-=D,T<=0)return}return u}function qA(r,t,e,i){return x_(r,"x","width",t,e,i)}function T_(r,t,e,i){return x_(r,"y","height",t,e,i)}function M_(r){var t=[];r.sort(function(g,p){return p.priority-g.priority});var e=new nt(0,0,0,0);function i(g){if(!g.ignore){var p=g.ensureState("emphasis");p.ignore==null&&(p.ignore=!1)}g.ignore=!0}for(var n=0;n=0&&i.attr(a.oldLayoutSelect),ft(c,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Et(i,u,e,l)}else if(i.attr(u),!gn(i).valueAnimation){var h=K(i.style.opacity,1);i.style.opacity=0,Xt(i,{style:{opacity:h}},e,l)}if(a.oldLayout=u,i.states.select){var v=a.oldLayoutSelect={};bo(v,u,xo),bo(v,i.states.select,xo)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};bo(d,u,xo),bo(d,i.states.emphasis,xo)}sT(i,l,f,e,e)}if(n&&!n.ignore&&!n.invisible){var a=JA(n),o=a.oldLayout,g={points:n.shape.points};o?(n.attr({shape:o}),Et(n,{shape:g},e)):(n.setShape(g),n.style.strokePercent=0,Xt(n,{style:{strokePercent:1}},e)),a.oldLayout=g}},r}();const tL=jA;var wu=yt();function eL(r){r.registerUpdateLifecycle("series:beforeupdate",function(t,e,i){var n=wu(e).labelManager;n||(n=wu(e).labelManager=new tL),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(t,e,i){var n=wu(e).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),n.updateLayoutConfig(e),n.layout(e),n.processLabelsOverall()})}var bu=Math.sin,xu=Math.cos,C_=Math.PI,oi=Math.PI*2,rL=180/C_,iL=function(){function r(){}return r.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},r.prototype.moveTo=function(t,e){this._add("M",t,e)},r.prototype.lineTo=function(t,e){this._add("L",t,e)},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){this._add("C",t,e,i,n,a,o)},r.prototype.quadraticCurveTo=function(t,e,i,n){this._add("Q",t,e,i,n)},r.prototype.arc=function(t,e,i,n,a,o){this.ellipse(t,e,i,i,0,n,a,o)},r.prototype.ellipse=function(t,e,i,n,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),c=Pr(h-oi)||(f?u>=oi:-u>=oi),v=u>0?u%oi:u%oi+oi,d=!1;c?d=!0:Pr(h)?d=!1:d=v>=C_==!!f;var g=t+i*xu(o),p=e+n*bu(o);this._start&&this._add("M",g,p);var y=Math.round(a*rL);if(c){var m=1/this._p,_=(f?1:-1)*(oi-m);this._add("A",i,n,y,1,+f,t+i*xu(o+_),e+n*bu(o+_)),m>.01&&this._add("A",i,n,y,0,+f,g,p)}else{var S=t+i*xu(s),b=e+n*bu(s);this._add("A",i,n,y,+d,+f,S,b)}},r.prototype.rect=function(t,e,i,n){this._add("M",t,e),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(t,e,i,n,a,o,s,l,u){for(var f=[],h=this._p,c=1;c"}function vL(r){return""}function sv(r,t){t=t||{};var e=t.newline?"\n":"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return hL(o,s)+(o!=="style"?ie(l):l||"")+(a?""+e+V(a,function(u){return i(u)}).join(e)+e:"")+vL(o)}return i(r)}function cL(r,t,e){e=e||{};var i=e.newline?"\n":"",n=" {"+i,a=i+"}",o=V(et(r),function(l){return l+n+V(et(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=V(et(t),function(l){return"@keyframes "+l+n+V(et(t[l]),function(u){return u+n+V(et(t[l][u]),function(f){var h=t[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function Vf(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function ap(r,t,e,i){return Lt("svg","root",{width:r,height:t,xmlns:A_,"xmlns:xlink":L_,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var op={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},ui="transform-origin";function dL(r,t,e){var i=k({},r.shape);k(i,t),r.buildPath(e,i);var n=new D_;return n.reset(ay(r)),e.rebuildPath(n,1),n.generateStr(),n.getStr()}function pL(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[ui]=e+"px "+i+"px")}var gL={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function P_(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function yL(r,t,e){var i=r.shape.paths,n={},a,o;if(A(i,function(l){var u=Vf(e.zrId);u.animation=!0,ul(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,c=et(f),v=c.length;if(v){o=c[v-1];var d=f[o];for(var g in d){var p=d[g];n[g]=n[g]||{d:""},n[g].d+=p.d||""}for(var y in h){var m=h[y].animation;m.indexOf(o)>=0&&(a=m)}}}),!!a){t.d=!1;var s=P_(n,e);return a.replace(o,s)}}function sp(r){return z(r)?op[r]?"cubic-bezier("+op[r]+")":lh(r)?r:"":""}function ul(r,t,e,i){var n=r.animators,a=n.length,o=[];if(r instanceof hm){var s=yL(r,t,e);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Bt=P_(x,e);return Bt+" "+m[0]+" both"}}for(var p in l){var s=g(l[p]);s&&o.push(s)}if(o.length){var y=e.zrId+"-cls-"+e.cssClassIdx++;e.cssNodes["."+y]={animation:o.join(",")},t.class=y}}var Ca=Math.round;function R_(r){return r&&z(r.src)}function E_(r){return r&&X(r.toDataURL)}function lv(r,t,e,i){lL(function(n,a){var o=n==="fill"||n==="stroke";o&&ny(a)?O_(t,r,n,i):o&&uh(a)?B_(e,r,n,i):r[n]=a},t,e,!1),TL(e,r,i)}function lp(r){return Pr(r[0]-1)&&Pr(r[1])&&Pr(r[2])&&Pr(r[3]-1)}function mL(r){return Pr(r[4])&&Pr(r[5])}function uv(r,t,e){if(t&&!(mL(t)&&lp(t))){var i=e?10:1e4;r.transform=lp(t)?"translate("+Ca(t[4]*i)/i+" "+Ca(t[5]*i)/i+")":FS(t)}}function up(r,t,e){for(var i=r.points,n=[],a=0;a"u"){var p="Image width/height must been given explictly in svg-ssr renderer.";_e(c,p),_e(v,p)}else if(c==null||v==null){var y=function(D,M){if(D){var L=D.elm,I=c||M.width,P=v||M.height;D.tag==="pattern"&&(u?(P=1,I/=a.width):f&&(I=1,P/=a.height)),D.attrs.width=I,D.attrs.height=P,L&&(L.setAttribute("width",I),L.setAttribute("height",P))}},m=yh(d,null,r,function(D){l||y(w,D),y(h,D)});m&&m.width&&m.height&&(c=c||m.width,v=v||m.height)}h=Lt("image","img",{href:d,width:c,height:v}),o.width=c,o.height=v}else n.svgElement&&(h=Z(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(h){var _,S;l?_=S=1:u?(S=1,_=o.width/a.width):f?(_=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),S!=null&&!isNaN(S)&&(o.height=S);var b=oy(n);b&&(o.patternTransform=b);var w=Lt("pattern","",o,[h]),x=sv(w),T=i.patternCache,C=T[x];C||(C=i.zrId+"-p"+i.patternIdx++,T[x]=C,o.id=C,w=i.defs[C]=Lt("pattern",C,o,[h])),t[e]=Os(C)}}function ML(r,t,e){var i=e.clipPathCache,n=e.defs,a=i[r.id];if(!a){a=e.zrId+"-c"+e.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=Lt("clipPath",a,o,[k_(r,e)])}t["clip-path"]=Os(a)}function vp(r){return document.createTextNode(r)}function hi(r,t,e){r.insertBefore(t,e)}function cp(r,t){r.removeChild(t)}function dp(r,t){r.appendChild(t)}function N_(r){return r.parentNode}function F_(r){return r.nextSibling}function Tu(r,t){r.textContent=t}var pp=58,CL=120,DL=Lt("","");function zf(r){return r===void 0}function We(r){return r!==void 0}function AL(r,t,e){for(var i={},n=t;n<=e;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function Zn(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function Da(r){var t,e=r.children,i=r.tag;if(We(i)){var n=r.elm=I_(i);if(fv(DL,r),N(e))for(t=0;ta?(d=e[l+1]==null?null:e[l+1].elm,V_(r,d,e,n,l)):As(r,t,i,a))}function Zi(r,t){var e=t.elm=r.elm,i=r.children,n=t.children;r!==t&&(fv(r,t),zf(t.text)?We(i)&&We(n)?i!==n&&LL(e,i,n):We(n)?(We(r.text)&&Tu(e,""),V_(e,null,n,0,n.length-1)):We(i)?As(e,i,0,i.length-1):We(r.text)&&Tu(e,""):r.text!==t.text&&(We(i)&&As(e,i,0,i.length-1),Tu(e,t.text)))}function IL(r,t){if(Zn(r,t))Zi(r,t);else{var e=r.elm,i=N_(e);Da(t),i!==null&&(hi(i,t.elm,F_(e)),As(i,[r],0,0))}return t}var PL=0,RL=function(){function r(t,e,i){if(this.type="svg",this.refreshHover=gp(),this.configLayer=gp(),this.storage=e,this._opts=i=k({},i),this.root=t,this._id="zr"+PL++,this._oldVNode=ap(i.width,i.height),t&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=I_("svg");fv(null,this._oldVNode),n.appendChild(a),t.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",IL(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return hp(t,Vf(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Vf(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress;var o=[],s=this._bgVNode=EL(i,n,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Lt("g","main",{},[]);this._paintList(e,a,l?l.children:o),l&&o.push(l);var u=V(et(a.defs),function(c){return a.defs[c]});if(u.length&&o.push(Lt("defs","defs",{},u)),t.animation){var f=cL(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Lt("style","stl",{},[],f);o.push(h)}}return ap(i,n,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},sv(this.renderToVNode({animation:K(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:K(t.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(t,e,i){for(var n=t.length,a=[],o=0,s,l,u=0,f=0;f=0&&!(c&&l&&c[g]===l[g]);g--);for(var p=d-1;p>g;p--)o--,s=a[o-1];for(var y=g+1;y=s)}}for(var h=this.__startIndex;h15)break}}P.prevElClipPaths&&y.restore()};if(m)if(m.length===0)T=p.__endIndex;else for(var D=v.dpr,M=0;M0&&t>n[0]){for(l=0;lt);l++);s=i[n[l]]}if(n.splice(l+1,0,t),i[t]=e,!e.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(e.dom,u.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?To:0),this._needsManuallyCompositing),f.__builtin__||ih("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,e(l),a=f),n.__dirty&ne&&!n.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}e(l),this.eachBuiltinLayer(function(h,c){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(t){t.clear()},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t,A(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?at(i[t],e,!0):i[t]=e;for(var n=0;n-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Nr);const WL=GL;function hv(r,t){var e=r.mapDimensionsAll("defaultedLabel"),i=e.length;if(i===1){var n=cn(r,t,e[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(t[a])}return i.join(" ")}var UL=function(r){B(t,r);function t(e,i,n,a){var o=r.call(this)||this;return o.updateData(e,i,n,a),o}return t.prototype._createSymbol=function(e,i,n,a,o){this.removeAll();var s=pr(e,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=$L,this._symbolType=e,this.add(s)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){hs(this.childAt(0))},t.prototype.downplay=function(){vs(this.childAt(0))},t.prototype.setZ=function(e,i){var n=this.childAt(0);n.zlevel=e,n.z=i},t.prototype.setDraggable=function(e,i){var n=this.childAt(0);n.draggable=e,n.cursor=!i&&e?"move":n.cursor},t.prototype.updateData=function(e,i,n,a){this.silent=!1;var o=e.getItemVisual(i,"symbol")||"circle",s=e.hostModel,l=t.getSymbolSize(e,i),u=o!==this._symbolType,f=a&&a.disableAnimation;if(u){var h=e.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,e,i,l,h)}else{var c=this.childAt(0);c.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?c.attr(v):Et(c,v,s,i),Ah(c)}if(this._updateCommon(e,i,l,n,a),u){var c=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,Xt(c,v,s,i)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,i,n,a,o){var s=this.childAt(0),l=e.hostModel,u,f,h,c,v,d,g,p,y;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,c=a.focus,v=a.blurScope,g=a.labelStatesModels,p=a.hoverScale,y=a.cursorStyle,d=a.emphasisDisabled),!a||e.hasItemOption){var m=a&&a.itemModel?a.itemModel:e.getItemModel(i),_=m.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=m.getModel(["select","itemStyle"]).getItemStyle(),f=m.getModel(["blur","itemStyle"]).getItemStyle(),c=_.get("focus"),v=_.get("blurScope"),d=_.get("disabled"),g=Ba(m),p=_.getShallow("scale"),y=m.getShallow("cursor")}var S=e.getItemVisual(i,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var b=_0(e.getItemVisual(i,"symbolOffset"),n);b&&(s.x=b[0],s.y=b[1]),y&&s.attr("cursor",y);var w=e.getItemVisual(i,"style"),x=w.fill;if(s instanceof ir){var T=s.style;s.useStyle(k({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(k({},w)):s.useStyle(w),s.style.decal=null,s.setColor(x,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=e.getItemVisual(i,"liftZ"),D=this._z2;C!=null?D==null&&(this._z2=s.z2,s.z2+=C):D!=null&&(s.z2=D,this._z2=null);var M=o&&o.useNameLabel;Oa(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:L,inheritColor:x,defaultOpacity:w.opacity});function L(R){return M?e.getName(R):hv(e,R)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=s.ensureState("emphasis");I.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var P=p==null||p===!0?Math.max(1.1,3/this._sizeY):isFinite(p)&&p>0?+p:1;I.scaleX=this._sizeX*P,I.scaleY=this._sizeY*P,this.setSymbolScale(1),ga(this,c,v,d)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,i,n){var a=this.childAt(0),o=ot(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&ps(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();ps(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:e,removeOpt:s})},t.getSymbolSize=function(e,i){return OC(e.getItemVisual(i,"symbolSize"))},t}(Ct);function $L(r,t){this.parent.drift(r,t)}const vv=UL;function Cu(r,t,e,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(e))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&r.getItemVisual(e,"symbol")!=="none"}function _p(r){return r!=null&&!H(r)&&(r={isIgnore:r}),r||{}}function Sp(r){var t=r.hostModel,e=t.getModel("emphasis");return{emphasisItemStyle:e.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:e.get("focus"),blurScope:e.get("blurScope"),emphasisDisabled:e.get("disabled"),hoverScale:e.get("scale"),labelStatesModels:Ba(t),cursorStyle:t.get("cursor")}}var YL=function(){function r(t){this.group=new Ct,this._SymbolCtor=t||vv}return r.prototype.updateData=function(t,e){this._progressiveEls=null,e=_p(e);var i=this.group,n=t.hostModel,a=this._data,o=this._SymbolCtor,s=e.disableAnimation,l=Sp(t),u={disableAnimation:s},f=e.getSymbolPoint||function(h){return t.getItemLayout(h)};a||i.removeAll(),t.diff(a).add(function(h){var c=f(h);if(Cu(t,c,h,e)){var v=new o(t,h,l,u);v.setPosition(c),t.setItemGraphicEl(h,v),i.add(v)}}).update(function(h,c){var v=a.getItemGraphicEl(c),d=f(h);if(!Cu(t,d,h,e)){i.remove(v);return}var g=t.getItemVisual(h,"symbol")||"circle",p=v&&v.getSymbolType&&v.getSymbolType();if(!v||p&&p!==g)i.remove(v),v=new o(t,h,l,u),v.setPosition(d);else{v.updateData(t,h,l,u);var y={x:d[0],y:d[1]};s?v.attr(y):Et(v,y,n)}i.add(v),t.setItemGraphicEl(h,v)}).remove(function(h){var c=a.getItemGraphicEl(h);c&&c.fadeOut(function(){i.remove(c)},n)}).execute(),this._getSymbolPoint=f,this._data=t},r.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(i,n){var a=t._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Sp(t),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e,i){this._progressiveEls=[],i=_p(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?e=i[0]:i[1]<0&&(e=i[1]),e}function G_(r,t,e,i){var n=NaN;r.stacked&&(n=e.get(e.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=e.get(r.baseDim,i),o[1-a]=n,t.dataToPoint(o)}function qL(r,t){var e=[];return t.diff(r).add(function(i){e.push({cmd:"+",idx:i})}).update(function(i,n){e.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){e.push({cmd:"-",idx:i})}).execute(),e}function KL(r,t,e,i,n,a,o,s){for(var l=qL(r,t),u=[],f=[],h=[],c=[],v=[],d=[],g=[],p=H_(n,t,o),y=r.getLayout("points")||[],m=t.getLayout("points")||[],_=0;_=n||g<0)break;if(_i(y,m)){if(l){g+=a;continue}break}if(g===e)r[a>0?"moveTo":"lineTo"](y,m),h=y,c=m;else{var _=y-u,S=m-f;if(_*_+S*S<.5){g+=a;continue}if(o>0){for(var b=g+a,w=t[b*2],x=t[b*2+1];w===y&&x===m&&p=i||_i(w,x))v=y,d=m;else{D=w-u,M=x-f;var P=y-u,R=w-y,E=m-f,W=x-m,O=void 0,F=void 0;if(s==="x"){O=Math.abs(P),F=Math.abs(R);var G=D>0?1:-1;v=y-G*O*o,d=m,L=y+G*F*o,I=m}else if(s==="y"){O=Math.abs(E),F=Math.abs(W);var q=M>0?1:-1;v=y,d=m-q*O*o,L=y,I=m+q*F*o}else O=Math.sqrt(P*P+E*E),F=Math.sqrt(R*R+W*W),C=F/(F+O),v=y-D*o*(1-C),d=m-M*o*(1-C),L=y+D*o*C,I=m+M*o*C,L=Tr(L,Mr(w,y)),I=Tr(I,Mr(x,m)),L=Mr(L,Tr(w,y)),I=Mr(I,Tr(x,m)),D=L-y,M=I-m,v=y-D*O/F,d=m-M*O/F,v=Tr(v,Mr(u,y)),d=Tr(d,Mr(f,m)),v=Mr(v,Tr(u,y)),d=Mr(d,Tr(f,m)),D=y-v,M=m-d,L=y+D*F/O,I=m+M*F/O}r.bezierCurveTo(h,c,v,d,y,m),h=L,c=I}else r.lineTo(y,m)}u=y,f=m,g+=a}return p}var W_=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),QL=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polyline",i}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new W_},t.prototype.buildPath=function(e,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&_i(n[o*2-2],n[o*2-1]);o--);for(;a=0){var S=u?(d-l)*_+l:(v-s)*_+s;return u?[e,S]:[S,e]}s=v,l=d;break;case o.C:v=a[h++],d=a[h++],g=a[h++],p=a[h++],y=a[h++],m=a[h++];var b=u?jo(s,v,g,y,e,f):jo(l,d,p,m,e,f);if(b>0)for(var w=0;w=0){var S=u?Dt(l,d,p,m,x):Dt(s,v,g,y,x);return u?[e,S]:[S,e]}}s=y,l=m;break}}},t}(lt),JL=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(W_),jL=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polygon",i}return t.prototype.getDefaultShape=function(){return new JL},t.prototype.buildPath=function(e,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&_i(n[s*2-2],n[s*2-1]);s--);for(;ot){a?e.push(o(a,l,t)):n&&e.push(o(n,l,0),o(n,l,t));break}else n&&(e.push(o(n,l,0)),n=null),e.push(l),a=l}return e}function iI(r,t,e){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&t.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=t.getAxis(n),u=V(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var c=rI(u,n==="x"?e.getWidth():e.getHeight()),v=c.length;if(!v&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,g=c[0].coord-d,p=c[v-1].coord+d,y=p-g;if(y<.001)return"transparent";A(c,function(_){_.offset=(_.coord-g)/y}),c.push({offset:v?c[v-1].offset:.5,color:h[1]||"transparent"}),c.unshift({offset:v?c[0].offset:.5,color:h[0]||"transparent"});var m=new Ch(0,0,0,0,c,!0);return m[n]=g,m[n+"2"]=p,m}}}function nI(r,t,e){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=e.getAxesByScale("ordinal")[0];if(a&&!(n&&aI(a,t))){var o=t.mapDimension(a.dim),s={};return A(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function aI(r,t){var e=r.getExtent(),i=Math.abs(e[1]-e[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=t.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function oI(r,t){return isNaN(r)||isNaN(t)}function sI(r){for(var t=r.length/2;t>0&&oI(r[t*2-2],r[t*2-1]);t--);return t-1}function Mp(r,t){return[r[t*2],r[t*2+1]]}function lI(r,t,e){for(var i=r.length/2,n=e==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function Y_(r){if(r.get(["endLabel","show"]))return!0;for(var t=0;t0&&e.get(["emphasis","lineStyle","width"])==="bolder"){var G=g.getState("emphasis").style;G.lineWidth=+g.style.lineWidth+1}ot(g).seriesIndex=e.seriesIndex,ga(g,W,O,F);var q=Tp(e.get("smooth")),$=e.get("smoothMonotone");if(g.setShape({smooth:q,smoothMonotone:$,connectNulls:T}),p){var Q=l.getCalculationInfo("stackedOnSeries"),it=0;p.useStyle(st(f.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),Q&&(it=Tp(Q.get("smooth"))),p.setShape({smooth:q,stackedOnSmooth:it,smoothMonotone:$,connectNulls:T}),cs(p,e,"areaStyle"),ot(p).seriesIndex=e.seriesIndex,ga(p,W,O,F)}var wt=function(vt){a._changePolyState(vt)};l.eachItemGraphicEl(function(vt){vt&&(vt.onHoverStateChange=wt)}),this._polyline.onHoverStateChange=wt,this._data=l,this._coordSys=o,this._stackedOnPoints=w,this._points=h,this._step=M,this._valueOrigin=S,e.get("triggerLineEvent")&&(this.packEventData(e,g),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,i){ot(i).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,i,n,a){var o=e.getData(),s=wi(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var c=e.get("zlevel")||0,v=e.get("z")||0;u=new vv(o,s),u.x=f,u.y=h,u.setZ(c,v);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=v,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Qe.prototype.highlight.call(this,e,i,n,a)},t.prototype.downplay=function(e,i,n,a){var o=e.getData(),s=wi(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Qe.prototype.downplay.call(this,e,i,n,a)},t.prototype._changePolyState=function(e){var i=this._polygon;Sc(this._polyline,e),i&&Sc(i,e)},t.prototype._newPolyline=function(e){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new QL({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},t.prototype._newPolygon=function(e,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new jL({shape:{points:e,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=e.hostModel,f=u.get("animationDuration");X(f)&&(f=f(null));var h=u.get("animationDelay")||0,c=X(h)?h(null):h;e.eachItemGraphicEl(function(v,d){var g=v;if(g){var p=[v.x,v.y],y=void 0,m=void 0,_=void 0;if(n)if(o){var S=n,b=i.pointToCoord(p);a?(y=S.startAngle,m=S.endAngle,_=-b[1]/180*Math.PI):(y=S.r0,m=S.r,_=b[0])}else{var w=n;a?(y=w.x,m=w.x+w.width,_=v.x):(y=w.y+w.height,m=w.y,_=v.y)}var x=m===y?0:(_-y)/(m-y);l&&(x=1-x);var T=X(h)?h(d):f*x+c,C=g.getSymbolPath(),D=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,i,n){var a=e.getModel("endLabel");if(Y_(e)){var o=e.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new It({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=sI(l);f>=0&&(Oa(s,Ba(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:f,defaultText:function(h,c,v){return v!=null?z_(o,v):hv(o,h)},enableTextSetter:!0},uI(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,i,n,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){e<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=n.getLayout("points"),c=n.hostModel,v=c.get("connectNulls"),d=s.get("precision"),g=s.get("distance")||0,p=l.getBaseAxis(),y=p.isHorizontal(),m=p.inverse,_=i.shape,S=m?y?_.x:_.y+_.height:y?_.x+_.width:_.y,b=(y?g:0)*(m?-1:1),w=(y?0:-g)*(m?-1:1),x=y?"x":"y",T=lI(h,S,x),C=T.range,D=C[1]-C[0],M=void 0;if(D>=1){if(D>1&&!v){var L=Mp(h,C[0]);u.attr({x:L[0]+b,y:L[1]+w}),o&&(M=c.getRawValue(C[0]))}else{var L=f.getPointOn(S,x);L&&u.attr({x:L[0]+b,y:L[1]+w});var I=c.getRawValue(C[0]),P=c.getRawValue(C[1]);o&&(M=Ty(n,d,I,P,T.t))}a.lastFrameIndex=C[0]}else{var R=e===1||a.lastFrameIndex>0?C[0]:0,L=Mp(h,R);o&&(M=c.getRawValue(R)),u.attr({x:L[0]+b,y:L[1]+w})}if(o){var E=gn(u);typeof E.setLabelText=="function"&&E.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,h=e.hostModel,c=KL(this._data,e,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),v=c.current,d=c.stackedOnCurrent,g=c.next,p=c.stackedOnNext;if(o&&(v=Cr(c.current,n,o,l),d=Cr(c.stackedOnCurrent,n,o,l),g=Cr(c.next,n,o,l),p=Cr(c.stackedOnNext,n,o,l)),xp(v,g)>3e3||f&&xp(d,p)>3e3){u.stopAnimation(),u.setShape({points:g}),f&&(f.stopAnimation(),f.setShape({points:g,stackedOnPoints:p}));return}u.shape.__points=c.current,u.shape.points=v;var y={shape:{points:g}};c.current!==v&&(y.shape.__points=c.next),u.stopAnimation(),Et(u,y,h),f&&(f.setShape({points:v,stackedOnPoints:d}),f.stopAnimation(),Et(f,{shape:{stackedOnPoints:p}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var m=[],_=c.status,S=0;S<_.length;S++){var b=_[S].cmd;if(b==="="){var w=e.getItemGraphicEl(_[S].idx1);w&&m.push({el:w,ptIdx:S})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var x=u.shape.__points,T=0;Tt&&(t=r[e]);return isFinite(t)?t:NaN},min:function(r){for(var t=1/0,e=0;e10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=i.getDevicePixelRatio(),c=Math.abs(f[1]-f[0])*(h||1),v=Math.round(s/c);if(isFinite(v)&&v>1){a==="lttb"&&t.setData(n.lttbDownSample(n.mapDimension(u.dim),1/v));var d=void 0;z(a)?d=cI[a]:X(a)&&(d=a),d&&t.setData(n.downSample(n.mapDimension(u.dim),1/v,d,dI))}}}}}function OR(r){r.registerChartView(hI),r.registerSeriesModel(WL),r.registerLayout(vI("line",!0)),r.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),i=t.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,X_("line"))}var Z_=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,i){return ev(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(e),s=a.dataToPoint(o);if(n)A(a.getAxes(),function(c,v){if(c.type==="category"&&i!=null){var d=c.getTicksCoords(),g=o[v],p=i[v]==="x1"||i[v]==="y1";if(p&&(g+=1),d.length<2)return;if(d.length===2){s[v]=c.toGlobalCoord(c.getExtent()[p?1:0]);return}for(var y=void 0,m=void 0,_=1,S=0;Sg){m=(b+y)/2;break}S===1&&(_=w-d[0].tickValue)}m==null&&(y?y&&(m=d[d.length-1].coord):m=d[0].coord),s[v]=c.toGlobalCoord(m)}});else{var l=this.getData(),u=l.getLayout("offset"),f=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+f/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Nr);Nr.registerClass(Z_);const Cp=Z_;var pI=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(){return ev(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>e&&(e=i),e},t.prototype.brushSelector=function(e,i,n){return n.rect(i.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Zs(Cp.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(Cp);const gI=pI;var yI=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),mI=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="sausage",i}return t.prototype.getDefaultShape=function(){return new yI},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,f=i.startAngle,h=i.endAngle,c=i.clockwise,v=Math.PI*2,d=c?h-fMath.PI/2&&fs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(e,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(e.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(e,i,n,a){if(this._isOrderChangedWithinSameData(e,i,n)){var o=this._dataSort(e,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(e,i,n){var a=i.baseAxis,o=this._dataSort(e,a,function(s){return e.get(e.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(e,i){this._clear(this._model),this._removeOnRenderedListener(i)},t.prototype.dispose=function(e,i){this._removeOnRenderedListener(i)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var i=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){gs(a,e,ot(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(Qe),Ap={cartesian2d:function(r,t){var e=t.width<0?-1:1,i=t.height<0?-1:1;e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var n=r.x+r.width,a=r.y+r.height,o=Au(t.x,r.x),s=Lu(t.x+t.width,n),l=Au(t.y,r.y),u=Lu(t.y+t.height,a),f=sn?s:o,t.y=h&&l>a?u:l,t.width=f?0:s-o,t.height=h?0:u-l,e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),f||h},polar:function(r,t){var e=t.r0<=t.r?1:-1;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}var n=Lu(t.r,r.r),a=Au(t.r0,r.r0);t.r=n,t.r0=a;var o=n-a<0;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}return o}},Lp={cartesian2d:function(r,t,e,i,n,a,o,s,l){var u=new Mt({shape:k({},i),z2:1});if(u.__dataIndex=e,u.name="item",a){var f=u.shape,h=n?"height":"width";f[h]=0}return u},polar:function(r,t,e,i,n,a,o,s,l){var u=!n&&l?Dp:Ci,f=new u({shape:i,z2:1});f.name="item";var h=q_(n);if(f.calculateTextPosition=_I(h,{isRoundCap:u===Dp}),a){var c=f.shape,v=n?"r":"endAngle",d={};c[v]=n?i.r0:i.startAngle,d[v]=i[v],(s?Et:Xt)(f,{shape:d},a)}return f}};function xI(r,t){var e=r.get("realtimeSort",!0),i=t.getBaseAxis();if(e&&i.type==="category"&&t.type==="cartesian2d")return{baseAxis:i,otherAxis:t.getOtherAxis(i)}}function Ip(r,t,e,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Et:Xt)(e,{shape:l},t,n,null);var f=t?r.baseAxis.model:null;(o?Et:Xt)(e,{shape:u},f,n)}function Pp(r,t){for(var e=0;e0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,t,e){var i=r.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function CI(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function q_(r){return function(t){var e=t?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+e;default:return i}}}(r)}function Ep(r,t,e,i,n,a,o,s){var l=t.getItemVisual(e,"style");if(s){if(!a.get("roundCap")){var f=r.shape,h=qn(i.getModel("itemStyle"),f,!0);k(f,h),r.setShape(f)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var c=i.getShallow("cursor");c&&r.attr("cursor",c);var v=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=Ba(i);Oa(r,d,{labelFetcher:a,labelDataIndex:e,defaultText:hv(a.getData(),e),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:v});var g=r.getTextContent();if(s&&g){var p=i.get(["label","position"]);r.textConfig.inside=p==="middle"?!0:null,SI(r,p==="outside"?v:p,q_(o),i.get(["label","rotate"]))}oT(g,d,a.getRawValue(e),function(m){return z_(t,m)});var y=i.getModel(["emphasis"]);ga(r,y.get("focus"),y.get("blurScope"),y.get("disabled")),cs(r,i),CI(n)&&(r.style.fill="none",r.style.stroke="none",A(r.states,function(m){m.style&&(m.style.fill=m.style.stroke="none")}))}function DI(r,t){var e=r.get(["itemStyle","borderColor"]);if(!e||e==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,a)}var AI=function(){function r(){}return r}(),kp=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="largeBar",i}return t.prototype.getDefaultShape=function(){return new AI},t.prototype.buildPath=function(e,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,f=0;f=0?e:null},30,!1);function LI(r,t,e){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,f=0,h=a.length/3;f=s[0]&&t<=s[0]+l[0]&&e>=s[1]&&e<=s[1]+l[1])return o[f]}return-1}function K_(r,t,e){if(cv(e,"cartesian2d")){var i=t,n=e.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=e.getArea(),a=t;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function II(r,t,e){var i=r.type==="polar"?Ci:Mt;return new i({shape:K_(t,e,r),silent:!0,z2:0})}const PI=bI;function BR(r){r.registerChartView(PI),r.registerSeriesModel(gI),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,xt(aA,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,oA("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,X_("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(n){t.sortInfo&&n.axis.setCategorySortInfo(t.sortInfo)})})}var Ao=Math.PI*2,Np=Math.PI/180;function Q_(r,t){return Ti(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function J_(r,t){var e=Q_(r,t),i=r.get("center"),n=r.get("radius");N(n)||(n=[0,n]);var a=dt(e.width,t.getWidth()),o=dt(e.height,t.getHeight()),s=Math.min(a,o),l=dt(n[0],s/2),u=dt(n[1],s/2),f,h,c=r.coordinateSystem;if(c){var v=c.dataToPoint(i);f=v[0]||0,h=v[1]||0}else N(i)||(i=[i,i]),f=dt(i[0],a)+e.x,h=dt(i[1],o)+e.y;return{cx:f,cy:h,r0:l,r:u}}function RI(r,t,e){t.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=Q_(i,e),s=J_(i,e),l=s.cx,u=s.cy,f=s.r,h=s.r0,c=-i.get("startAngle")*Np,v=i.get("minAngle")*Np,d=0;n.each(a,function(D){!isNaN(D)&&d++});var g=n.getSum(a),p=Math.PI/(g||d)*2,y=i.get("clockwise"),m=i.get("roseType"),_=i.get("stillShowZeroSum"),S=n.getDataExtent(a);S[0]=0;var b=Ao,w=0,x=c,T=y?1:-1;if(n.setLayout({viewRect:o,r:f}),n.each(a,function(D,M){var L;if(isNaN(D)){n.setItemLayout(M,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:y,cx:l,cy:u,r0:h,r:m?NaN:f});return}m!=="area"?L=g===0&&_?p:D*p:L=Ao/d,Le?y:p,b=Math.abs(_.label.y-e);if(b>=S.maxY){var w=_.label.x-t-_.len2*n,x=i+_.len,T=Math.abs(w)r.unconstrainedWidth?null:v:null;i.setStyle("width",d)}var g=i.getBoundingRect();a.width=g.width;var p=(i.style.margin||0)+2.1;a.height=g.height+p,a.y-=(a.height-h)/2}}}function Iu(r){return r.position==="center"}function BI(r){var t=r.getData(),e=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*kI,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,f=s.x,h=s.y,c=s.height;function v(w){w.ignore=!0}function d(w){if(!w.ignore)return!0;for(var x in w.states)if(w.states[x].ignore===!1)return!0;return!1}t.each(function(w){var x=t.getItemGraphicEl(w),T=x.shape,C=x.getTextContent(),D=x.getTextGuideLine(),M=t.getItemModel(w),L=M.getModel("label"),I=L.get("position")||M.get(["emphasis","label","position"]),P=L.get("distanceToLabelLine"),R=L.get("alignTo"),E=dt(L.get("edgeDistance"),u),W=L.get("bleedMargin"),O=M.getModel("labelLine"),F=O.get("length");F=dt(F,u);var G=O.get("length2");if(G=dt(G,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":$>0?"left":"right"}var be=Math.PI,qt=0,ar=L.get("rotate");if(ct(ar))qt=ar*(be/180);else if(I==="center")qt=0;else if(ar==="radial"||ar===!0){var Li=$<0?-q+be:-q;qt=Li}else if(ar==="tangential"&&I!=="outside"&&I!=="outer"){var xe=Math.atan2($,Q);xe<0&&(xe=be*2+xe);var za=Q>0;za&&(xe=be+xe),qt=xe-be}if(a=!!qt,C.x=it,C.y=wt,C.rotation=qt,C.setStyle({verticalAlign:"middle"}),Pt){C.setStyle({align:Bt});var fl=C.states.select;fl&&(fl.x+=C.x,fl.y+=C.y)}else{var mr=C.getBoundingRect().clone();mr.applyTransform(C.getComputedTransform());var mv=(C.style.margin||0)+2.1;mr.y-=mv/2,mr.height+=mv,e.push({label:C,labelLine:D,position:I,len:F,len2:G,minTurnAngle:O.get("minTurnAngle"),maxSurfaceAngle:O.get("maxSurfaceAngle"),surfaceNormal:new Y($,Q),linePoints:vt,textAlign:Bt,labelDistance:P,labelAlignTo:R,edgeDistance:E,bleedMargin:W,rect:mr,unconstrainedWidth:mr.width,labelStyleWidth:C.style.width})}x.setTextConfig({inside:Pt})}}),!a&&r.get("avoidLabelOverlap")&&OI(e,i,n,l,u,c,f,h);for(var g=0;g0){for(var f=o.getItemLayout(0),h=1;isNaN(f&&f.startAngle)&&h=a.r0}},t.type="pie",t}(Qe);const VI=FI;function zI(r,t,e){t=N(t)&&{coordDimensions:t}||k({encodeDefine:r.getEncode()},t);var i=r.getSource(),n=tv(i,t).dimensions,a=new X0(n,r);return a.initData(i,e),a}var HI=function(){function r(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return r.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},r.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},r.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},r.prototype.getItemVisual=function(t,e){var i=this._getDataWithEncodedVisual();return i.getItemVisual(t,e)},r}();const GI=HI;var WI=yt(),UI=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new GI(rt(this.getData,this),rt(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return zI(this,{coordDimensions:["value"],encodeDefaulter:xt(BT,this)})},t.prototype.getDataParams=function(e){var i=this.getData(),n=WI(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=bw(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,e);return s.percent=a[e]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(e){lf(e,"labelLine",["show"]);var i=e.labelLine,n=e.emphasis.labelLine;i.show=i.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Nr);const $I=UI;function YI(r){return{seriesType:r,reset:function(t,e){var i=t.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(ct(o)&&!isNaN(o)&&o<0)})}}}function NR(r){r.registerChartView(VI),r.registerSeriesModel($I),wC("pie",r.registerAction),r.registerLayout(xt(RI,"pie")),r.registerProcessor(EI("pie")),r.registerProcessor(YI("pie"))}var XI=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(pt);const ZI=XI;var Gf=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ie).models[0]},t.type="cartesian2dAxis",t}(pt);Oe(Gf,h_);var t1={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},qI=at({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},t1),dv=at({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},t1),KI=at({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},dv),QI=st({logBase:10},dv);const JI={category:qI,value:dv,time:KI,log:QI};var jI={value:1,category:1,time:1,log:1};function Vp(r,t,e,i){A(jI,function(n,a){var o=at(at({},JI[a],!0),i,!0),s=function(l){B(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=t+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var c=Sa(this),v=c?tl(f):{},d=h.getTheme();at(f,d.get(a+"Axis")),at(f,this.getDefaultOption()),f.type=zp(f),c&&vn(f,v,c)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Of.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=t+"Axis."+a,u.defaultOption=o,u}(e);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(t+"Axis",zp)}function zp(r){return r.type||(r.data?"category":"value")}var tP=function(){function r(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return r.prototype.getAxis=function(t){return this._axes[t]},r.prototype.getAxes=function(){return V(this._dimList,function(t){return this._axes[t]},this)},r.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),At(this.getAxes(),function(e){return e.scale.type===t})},r.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},r}();const eP=tP;var Wf=["x","y"];function Hp(r){return r.type==="interval"||r.type==="time"}var rP=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Wf,e}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!Hp(e)||!Hp(i))){var n=e.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,c=o[0]-n[0]*f,v=o[1]-a[0]*h,d=this._transform=[f,0,0,h,c,v];this._invTransform=ks([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,i){var n=this.dataToPoint(e),a=this.dataToPoint(i),o=this.getArea(),s=new nt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},t.prototype.dataToPoint=function(e,i,n){n=n||[];var a=e[0],o=e[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return me(n,e,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},t.prototype.clampData=function(e,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(e[0]),u=a.parse(e[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},t.prototype.pointToData=function(e,i){var n=[];if(this._invTransform)return me(n,e,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(e[0]),i),n[1]=o.coordToData(o.toLocalCoord(e[1]),i),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim==="x"?"y":"x")},t.prototype.getArea=function(){var e=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),n=Math.min(e[0],e[1]),a=Math.min(i[0],i[1]),o=Math.max(e[0],e[1])-n,s=Math.max(i[0],i[1])-a;return new nt(n,a,o,s)},t}(eP),iP=function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this,e,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var e=this.position;return e==="top"||e==="bottom"},t.prototype.getGlobalExtent=function(e){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),e&&i[0]>i[1]&&i.reverse(),i},t.prototype.pointToData=function(e,i){return this.coordToData(this.toLocalCoord(e[this.dim==="x"?0:1]),i)},t.prototype.setCategorySortInfo=function(e){if(this.type!=="category")return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(HA);const nP=iP;function Uf(r,t,e){e=e||{};var i=r.coordinateSystem,n=t.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,f=i.getRect(),h=[f.x,f.x+f.width,f.y,f.y+f.height],c={left:0,right:1,top:0,bottom:1,onZero:2},v=t.get("offset")||0,d=u==="x"?[h[2]-v,h[3]+v]:[h[0]-v,h[1]+v];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));d[c.onZero]=Math.max(Math.min(g,d[1]),d[0])}a.position=[u==="y"?d[c[l]]:h[0],u==="x"?d[c[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var p={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=p[s],a.labelOffset=o?d[c[s]]-d[c.onZero]:0,t.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),fn(e.labelInside,t.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var y=t.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-y:y,a.z2=1,a}function Gp(r){return r.get("coordinateSystem")==="cartesian2d"}function Wp(r){var t={xAxisModel:null,yAxisModel:null};return A(t,function(e,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Ie).models[0];t[i]=a}),t}var Pu=Math.log;function aP(r,t,e){var i=Fa.prototype,n=i.getTicks.call(e),a=i.getTicks.call(e,!0),o=n.length-1,s=i.getInterval.call(e),l=l_(r,t),u=l.extent,f=l.fixMin,h=l.fixMax;if(r.type==="log"){var c=Pu(r.base);u=[Pu(u[0])/c,Pu(u[1])/c]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:f,fixMax:h});var v=i.getExtent.call(r);f&&(u[0]=v[0]),h&&(u[1]=v[1]);var d=i.getInterval.call(r),g=u[0],p=u[1];if(f&&h)d=(p-g)/o;else if(f)for(p=u[0]+d*o;pu[0]&&isFinite(g)&&isFinite(u[0]);)d=_u(d),g=u[1]-d*o;else{var y=r.getTicks().length-1;y>o&&(d=_u(d));var m=d*o;p=Math.ceil(u[1]/d)*d,g=Tt(p-m),g<0&&u[0]>=0?(g=0,p=Tt(m)):p>0&&u[1]<=0&&(p=0,g=-Tt(m))}var _=(n[0].value-a[0].value)/s,S=(n[o].value-a[o].value)/s;i.setExtent.call(r,g+d*_,p+d*S),i.setInterval.call(r,d),(_||S)&&i.setNiceExtent.call(r,g+d,p-d)}var oP=function(){function r(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Wf,this._initCartesian(t,e,i),this.model=t}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model);function n(o){var s,l=et(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var c=+l[h],v=o[c],d=v.model,g=v.scale;Bf(g)&&d.get("alignTicks")&&d.get("interval")==null?f.push(v):(Nf(g,d),Bf(g)&&(s=v))}f.length&&(s||(s=f.pop(),Nf(s.scale,s.model)),A(f,function(p){aP(p.scale,p.model,s.scale)}))}}n(i.x),n(i.y);var a={};A(i.x,function(o){Up(i,"y",o,a)}),A(i.y,function(o){Up(i,"x",o,a)}),this.resize(this.model,e)},r.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),a=!i&&t.get("containLabel"),o=Ti(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(A(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=DA(u);if(f){var h=u.isHorizontal()?"height":"width",c=u.model.get(["axisLabel","margin"]);o[h]-=f[h]+c,u.position==="top"?o.y+=f.height+c:u.position==="left"&&(o.x+=f.width+c)}}}),l()),A(this._coordsList,function(u){u.calcAffineTransform()});function l(){A(s,function(u){var f=u.isHorizontal(),h=f?[0,o.width]:[0,o.height],c=u.inverse?1:0;u.setExtent(h[c],h[1-c]),sP(u,f?o.x:o.y)})}},r.prototype.getAxis=function(t,e){var i=this._axesMap[t];if(i!=null)return i[e||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(t,e){if(t!=null&&e!=null){var i="x"+t+"y"+e;return this._coordsMap[i]}H(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,a=this._coordsList;n0?"top":"bottom",a="center"):os(n-Rr)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},r.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},r}(),Yp={axisLine:function(r,t,e,i){var n=t.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(me(s,s,o),me(l,l,o));var f=k({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new bi({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});ya(h.shape,h.style.lineWidth),h.anid="line",e.add(h);var c=t.get(["axisLine","symbol"]);if(c!=null){var v=t.get(["axisLine","symbolSize"]);z(c)&&(c=[c,c]),(z(v)||ct(v))&&(v=[v,v]);var d=_0(t.get(["axisLine","symbolOffset"])||0,v),g=v[0],p=v[1];A([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(y,m){if(c[m]!=="none"&&c[m]!=null){var _=pr(c[m],-g/2,-p/2,g,p,f.stroke,!0),S=y.r+y.offset,b=u?l:s;_.attr({rotation:y.rotate,x:b[0]+S*Math.cos(r.rotation),y:b[1]-S*Math.sin(r.rotation),silent:!0,z2:11}),e.add(_)}})}}},axisTickLabel:function(r,t,e,i){var n=hP(e,i,t,r),a=cP(e,i,t,r);if(fP(t,a,n),vP(e,i,t,r.tickDirection),t.get(["axisLabel","hideOverlap"])){var o=b_(V(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));M_(o)}},axisName:function(r,t,e,i){var n=fn(r.axisName,t.get("name"));if(n){var a=t.get("nameLocation"),o=r.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=t.axis.getExtent(),f=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-f*l:a==="end"?u[1]+f*l:(u[0]+u[1])/2,Zp(a)?r.labelOffset+o*l:0],c,v=t.get("nameRotate");v!=null&&(v=v*Rr/180);var d;Zp(a)?c=Si.innerTextLayout(r.rotation,v!=null?v:r.rotation,o):(c=uP(r.rotation,a,v||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(c.rotation)),!isFinite(d)&&(d=null)));var g=s.getFont(),p=t.get("nameTruncate",!0)||{},y=p.ellipsis,m=fn(r.nameTruncateMaxWidth,p.maxWidth,d),_=new It({x:h[0],y:h[1],rotation:c.rotation,silent:Si.isLabelSilent(t),style:qe(s,{text:n,font:g,overflow:"truncate",width:m,ellipsis:y,fill:s.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:s.get("align")||c.textAlign,verticalAlign:s.get("verticalAlign")||c.textVerticalAlign}),z2:1});if(Ph({el:_,componentModel:t,itemName:n}),_.__fullText=n,_.anid="name",t.get("triggerEvent")){var S=Si.makeAxisEventDataBase(t);S.targetType="axisName",S.name=n,ot(_).eventData=S}i.add(_),_.updateTransform(),e.add(_),_.decomposeTransform()}}};function uP(r,t,e,i){var n=yy(e-r),a,o,s=i[0]>i[1],l=t==="start"&&!s||t!=="start"&&s;return os(n-Rr/2)?(o=l?"bottom":"top",a="center"):os(n-Rr*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nRr/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function fP(r,t,e){if(!f_(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);t=t||[],e=e||[];var a=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=e[0],f=e[1],h=e[e.length-1],c=e[e.length-2];i===!1?(ue(a),ue(u)):Xp(a,o)&&(i?(ue(o),ue(f)):(ue(a),ue(u))),n===!1?(ue(s),ue(h)):Xp(l,s)&&(n?(ue(l),ue(c)):(ue(s),ue(h)))}}function ue(r){r&&(r.ignore=!0)}function Xp(r,t){var e=r&&r.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(!(!e||!i)){var n=oh([]);return sh(n,n,-r.rotation),e.applyTransform(rn([],n,r.getLocalTransform())),i.applyTransform(rn([],n,t.getLocalTransform())),e.intersect(i)}}function Zp(r){return r==="middle"||r==="center"}function e1(r,t,e,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===t}function _P(r){var t=pv(r);if(t){var e=t.axisPointerModel,i=t.axis.scale,n=e.option,a=e.get("status"),o=e.get("value");o!=null&&(o=i.parse(o));var s=$f(e);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o=0;a--)i[a]==null&&(delete e[t[a]],t.pop())}function ku(r,t){var e=r.visual,i=[];H(e)?La(e,function(a){i.push(a)}):e!=null&&i.push(e);var n={color:1,symbol:1};!t&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),o1(r,i)}function Lo(r){return{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);i("color",r(e("color"),n))},_normalizedToVisual:Xf([0,1])}}function Qp(r){var t=this.option.visual;return t[Math.round(je(r,[0,1],[0,t.length-1],!0))]||{}}function Vn(r){return function(t,e,i){i(r,this.mapValueToVisual(t))}}function Kn(r){var t=this.option.visual;return t[this.option.loop&&r!==Ls?r%t.length:r]}function fi(){return this.option.visual[0]}function Xf(r){return{linear:function(t){return je(t,r,this.option.visual,!0)},category:Kn,piecewise:function(t,e){var i=Zf.call(this,e);return i==null&&(i=je(t,r,this.option.visual,!0)),i},fixed:fi}}function Zf(r){var t=this.option,e=t.pieceList;if(t.hasSpecialVisual){var i=gv.findPieceIndex(r,e),n=e[i];if(n&&n.visual)return n.visual[this.type]}}function o1(r,t){return r.visual=t,r.type==="color"&&(r.parsedVisual=V(t,function(e){var i=ae(e);return i||[0,0,0,1]})),t}var EP={linear:function(r){return je(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var t=this.option.pieceList,e=gv.findPieceIndex(r,t,!0);if(e!=null)return je(e,[0,t.length-1],[0,1],!0)},category:function(r){var t=this.option.categories?this.option.categoryMap[r]:r;return t==null?Ls:t},fixed:Ht};function Io(r,t,e){return r?t<=e:ta&&(t[1-i]=t[i]+h.sign*a),t}function Ou(r,t){var e=r[t]-r[1-t];return{span:Math.abs(e),sign:e>0?-1:e<0?1:t?-1:1}}function Wi(r,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,r))}var vi=yt(),Jp=Z,Bu=rt,OP=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(t,e,i,n){var a=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,e,i);var f=u.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var h=this._moveAnimation=this.determineAnimation(t,e);if(!s)s=this._group=new Ct,this.createPointerEl(s,u,t,e),this.createLabelEl(s,u,t,e),i.getZr().add(s);else{var c=xt(jp,e,h);this.updatePointerEl(s,u,c),this.updateLabelEl(s,u,c,e)}eg(s,e,!0),this._renderHandle(a)}},r.prototype.remove=function(t){this.clear(t)},r.prototype.dispose=function(t){this.clear(t)},r.prototype.determineAnimation=function(t,e){var i=e.get("animation"),n=t.axis,a=n.type==="category",o=e.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=pv(t).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(t,e,i,n,a){},r.prototype.createPointerEl=function(t,e,i,n){var a=e.pointer;if(a){var o=vi(t).pointerEl=new rT[a.type](Jp(e.pointer));t.add(o)}},r.prototype.createLabelEl=function(t,e,i,n){if(e.label){var a=vi(t).labelEl=new It(Jp(e.label));t.add(a),tg(a,n)}},r.prototype.updatePointerEl=function(t,e,i){var n=vi(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},r.prototype.updateLabelEl=function(t,e,i,n){var a=vi(t).labelEl;a&&(a.setStyle(e.label.style),i(a,{x:e.label.x,y:e.label.y}),tg(a,n))},r.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=e.getModel("handle"),o=e.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Ih(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ua(u.event)},onmousedown:Bu(this._onHandleDragMove,this,0,0),drift:Bu(this._onHandleDragMove,this),ondragend:Bu(this._onHandleDragEnd,this)}),i.add(n)),eg(n,e,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");N(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,u0(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},r.prototype._moveHandleToValue=function(t,e){jp(this._axisPointerModel,!e&&this._moveAnimation,this._handle,Nu(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(Nu(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(Nu(n)),vi(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),Cf(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}},r}();function jp(r,t,e,i){s1(vi(e).lastProp,i)||(vi(e).lastProp=i,t?Et(e,i,r):(e.stopAnimation(),e.attr(i)))}function s1(r,t){if(H(r)&&H(t)){var e=!0;return A(t,function(i,n){e=e&&s1(r[n],i)}),!!e}else return r===t}function tg(r,t){r[t.get(["label","show"])?"show":"hide"]()}function Nu(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function eg(r,t,e){var i=t.get("z"),n=t.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=e)})}const BP=OP;function NP(r){var t=r.get("type"),e=r.getModel(t+"Style"),i;return t==="line"?(i=e.getLineStyle(),i.fill=null):t==="shadow"&&(i=e.getAreaStyle(),i.stroke=null),i}function FP(r,t,e,i,n){var a=e.get("value"),o=l1(a,t.axis,t.ecModel,e.get("seriesDataIndices"),{precision:e.get(["label","precision"]),formatter:e.get(["label","formatter"])}),s=e.getModel("label"),l=Na(s.get("padding")||0),u=s.getFont(),f=hh(o,u),h=n.position,c=f.width+l[1]+l[3],v=f.height+l[0]+l[2],d=n.align;d==="right"&&(h[0]-=c),d==="center"&&(h[0]-=c/2);var g=n.verticalAlign;g==="bottom"&&(h[1]-=v),g==="middle"&&(h[1]-=v/2),VP(h,c,v,i);var p=s.get("backgroundColor");(!p||p==="auto")&&(p=t.get(["axisLine","lineStyle","color"])),r.label={x:h[0],y:h[1],style:qe(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:p}),z2:10}}function VP(r,t,e,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+t,n)-t,r[1]=Math.min(r[1]+e,a)-e,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function l1(r,t,e,i,n){r=t.scale.parse(r);var a=t.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:av(t,{value:r}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};A(i,function(l){var u=e.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),z(o)?a=o.replace("{value}",a):X(o)&&(a=o(s))}return a}function u1(r,t,e){var i=fa();return sh(i,i,e.rotation),Zu(i,i,e.position),on([r.dataToCoord(t),(e.labelOffset||0)+(e.labelDirection||1)*(e.labelMargin||0)],i)}function zP(r,t,e,i,n,a){var o=r1.innerTextLayout(e.rotation,0,e.labelDirection);e.labelMargin=n.get(["label","margin"]),FP(t,i,n,a,{position:u1(i.axis,r,e),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function HP(r,t,e){return e=e||0,{x1:r[e],y1:r[1-e],x2:t[e],y2:t[1-e]}}function GP(r,t,e){return e=e||0,{x:r[e],y:r[1-e],width:t[e],height:t[1-e]}}var WP=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),f=rg(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var c=NP(a),v=UP[u](s,h,f);v.style=c,e.graphicKey=v.type,e.pointer=v}var d=Uf(l.model,n);zP(i,e,d,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=Uf(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=u1(i.axis,e,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=rg(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[e.x,e.y];h[f]+=i[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var c=(u[1]+u[0])/2,v=[c,c];v[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:e.rotation,cursorPoint:v,tooltipOption:d[f]}},t}(BP);function rg(r,t){var e={};return e[t.dim+"AxisIndex"]=t.index,r.getCartesian(e)}var UP={line:function(r,t,e){var i=HP([t,e[0]],[t,e[1]],ig(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,t,e){var i=Math.max(1,r.getBandWidth()),n=e[1]-e[0];return{type:"Rect",shape:GP([t-i/2,e[0]],[i,n],ig(r))}}};function ig(r){return r.dim==="x"?0:1}const $P=WP;var YP=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(pt);const XP=YP;var vr=yt(),ZP=A;function f1(r,t,e){if(!j.node){var i=t.getZr();vr(i).records||(vr(i).records={}),qP(i,t);var n=vr(i).records[r]||(vr(i).records[r]={});n.handler=e}}function qP(r,t){if(vr(r).initialized)return;vr(r).initialized=!0,e("click",xt(ng,"click")),e("mousemove",xt(ng,"mousemove")),e("globalout",QP);function e(i,n){r.on(i,function(a){var o=JP(t);ZP(vr(r).records,function(s){s&&n(s,a,o.dispatchAction)}),KP(o.pendings,t)})}}function KP(r,t){var e=r.showTip.length,i=r.hideTip.length,n;e?n=r.showTip[e-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function QP(r,t,e){r.handler("leave",null,e)}function ng(r,t,e,i){t.handler(r,e,i)}function JP(r){var t={showTip:[],hideTip:[]},e=function(i){var n=t[i.type];n?n.push(i):(i.dispatchAction=e,r.dispatchAction(i))};return{dispatchAction:e,pendings:t}}function qf(r,t){if(!j.node){var e=t.getZr(),i=(vr(e).records||{})[r];i&&(vr(e).records[r]=null)}}var jP=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=i.getComponent("tooltip"),o=e.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";f1("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(e,i){qf("axisPointer",i)},t.prototype.dispose=function(e,i){qf("axisPointer",i)},t.type="axisPointer",t}(er);const t2=jP;function h1(r,t){var e=[],i=r.seriesIndex,n;if(i==null||!(n=t.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=wi(a,r);if(o==null||o<0||N(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)e=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,c=u.dim,v=h==="x"||h==="radius"?1:0,d=a.mapDimension(c),g=[];g[v]=a.get(d,o),g[1-v]=a.get(a.getCalculationInfo("stackResultDimension"),o),e=l.dataToPoint(g)||[]}else e=l.dataToPoint(a.getValues(V(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var p=s.getBoundingRect().clone();p.applyTransform(s.transform),e=[p.x+p.width/2,p.y+p.height/2]}return{point:e,el:s}}var ag=yt();function e2(r,t,e){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||rt(e.dispatchAction,e),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Xo(n)&&(n=h1({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Xo(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||Xo(n),c={},v={},d={list:[],map:{}},g={showPointer:xt(i2,v),showTooltip:xt(n2,d)};A(s.coordSysMap,function(y,m){var _=l||y.containPoint(n);A(s.coordSysAxesInfo[m],function(S,b){var w=S.axis,x=l2(u,S);if(!h&&_&&(!u||x)){var T=x&&x.value;T==null&&!l&&(T=w.pointToData(n)),T!=null&&og(S,T,g,!1,c)}})});var p={};return A(f,function(y,m){var _=y.linkGroup;_&&!v[m]&&A(_.axesInfo,function(S,b){var w=v[b];if(S!==y&&w){var x=w.value;_.mapper&&(x=y.axis.scale.parse(_.mapper(x,sg(S),sg(y)))),p[y.key]=x}})}),A(p,function(y,m){og(f[m],y,g,!0,c)}),a2(v,f,c),o2(d,n,r,o),s2(f,o,e),c}}function og(r,t,e,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!r.involveSeries){e.showPointer(r,t);return}var o=r2(t,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&k(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(t=l),e.showPointer(r,t,s),e.showTooltip(r,o,l)}}function r2(r,t){var e=t.axis,i=e.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return A(t.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(i),h,c;if(l.getAxisTooltipData){var v=l.getAxisTooltipData(f,r,e);c=v.dataIndices,h=v.nestestValue}else{if(c=l.getData().indicesOfNearest(f[0],r,e.type==="category"?.5:null),!c.length)return;h=l.getData().get(f[0],c[0])}if(!(h==null||!isFinite(h))){var d=r-h,g=Math.abs(d);g<=o&&((g=0&&s<0)&&(o=g,s=d,n=h,a.length=0),A(c,function(p){a.push({seriesIndex:l.seriesIndex,dataIndexInside:p,dataIndex:l.getData().getRawIndex(p)})}))}}),{payloadBatch:a,snapToValue:n}}function i2(r,t,e,i){r[t.key]={value:e,payloadBatch:i}}function n2(r,t,e,i){var n=e.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!n.length)){var l=t.coordSys.model,u=Aa(l),f=r.map[u];f||(f=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function a2(r,t,e){var i=e.axesInfo=[];A(t,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function o2(r,t,e,i){if(Xo(t)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:e.tooltipOption,position:e.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function s2(r,t,e){var i=e.getZr(),n="axisPointerLastHighlights",a=ag(i)[n]||{},o=ag(i)[n]={};A(r,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&A(h.seriesDataIndices,function(c){var v=c.seriesIndex+" | "+c.dataIndex;o[v]=c})});var s=[],l=[];A(a,function(u,f){!o[f]&&l.push(u)}),A(o,function(u,f){!a[f]&&s.push(u)}),l.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function l2(r,t){for(var e=0;e<(r||[]).length;e++){var i=r[e];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function sg(r){var t=r.axis.model,e={},i=e.axisDim=r.axis.dim;return e.axisIndex=e[i+"AxisIndex"]=t.componentIndex,e.axisName=e[i+"AxisName"]=t.name,e.axisId=e[i+"AxisId"]=t.id,e}function Xo(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function v1(r){i1.registerAxisPointerClass("CartesianAxisPointer",$P),r.registerComponentModel(XP),r.registerComponentView(t2),r.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!N(e)&&(t.axisPointer.link=[e])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=dP(t,e)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},e2)}function FR(r){ke(LP),ke(v1)}function u2(r,t){var e=Na(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),r=new Mt({shape:{x:r.x-e[3],y:r.y-e[0],width:r.width+e[1]+e[3],height:r.height+e[0]+e[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var f2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(pt);const h2=f2;function c1(r){var t=r.get("confine");return t!=null?!!t:r.get("renderMode")==="richText"}function d1(r){if(j.domSupported){for(var t=document.documentElement.style,e=0,i=r.length;e-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+n,c=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),v=Math.round(((c-Math.SQRT2*n)/2+Math.SQRT2*n-(c-h)/2)*100)/100;s+=";"+a+":-"+v+"px";var d=t+" solid "+n+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'
'}function m2(r,t){var e="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+e,n="opacity"+i+",visibility"+i;return t||(i=" "+r+"s "+e,n+=j.transformSupported?","+yv+i:",left"+i+",top"+i),d2+":"+n}function lg(r,t,e){var i=r.toFixed(0)+"px",n=t.toFixed(0)+"px";if(!j.transformSupported)return e?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=j.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return e?"top:0;left:0;"+yv+":"+o+";":[["top",0],["left",0],[p1,o]]}function _2(r){var t=[],e=r.get("fontSize"),i=r.getTextColor();i&&t.push("color:"+i),t.push("font:"+r.getFont()),e&&t.push("line-height:"+Math.round(e*3/2)+"px");var n=r.get("textShadowColor"),a=r.get("textShadowBlur")||0,o=r.get("textShadowOffsetX")||0,s=r.get("textShadowOffsetY")||0;return n&&a&&t.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),A(["decoration","align"],function(l){var u=r.get(l);u&&t.push("text-"+l+":"+u)}),t.join(";")}function S2(r,t,e){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),f=r.getModel("textStyle"),h=s0(r,"html"),c=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+c),t&&n&&i.push(m2(n,e)),a&&i.push("background-color:"+a),A(["width","color","radius"],function(v){var d="border-"+v,g=Em(d),p=r.get(g);p!=null&&i.push(d+":"+p+(v==="color"?"":"px"))}),i.push(_2(f)),h!=null&&i.push("padding:"+Na(h).join("px ")+"px"),i.join(";")+";"}function ug(r,t,e,i,n){var a=t&&t.painter;if(e){var o=a&&a.getViewportRoot();o&&j1(r,o,document.body,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/t.getWidth(),r[3]=r[1]/t.getHeight()}var w2=function(){function r(t,e,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,j.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=e.getZr(),o=this._appendToBody=i&&i.appendToBody;ug(this._styleCoord,a,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(n):t.appendChild(n),this._container=t;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=a.handler,f=a.painter.getViewportRoot();he(f,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(t){var e=this._container,i=c2(e,"position"),n=e.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative");var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=t.get("className")||""},r.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=p2+S2(t,!this._firstShow,this._longHide)+lg(a[0],a[1],!0)+("border-color:"+xi(e)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(t,e,i,n,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(z(a)&&i.get("trigger")==="item"&&!c1(i)&&(s=y2(i,n,a)),z(t))o.innerHTML=t+s;else if(t){o.innerHTML="",N(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,i=this._ecModel,n=this._api,a=e.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(e,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,i,n,a){if(!(a.from===this.uid||j.node||!n.getDom())){var o=vg(a,n);this._ticket="";var s=a.dataByCoordSys,l=I2(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=M2;f.x=a.x,f.y=a.y,f.update(),ot(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(e,i,n,a))return;var h=h1(a,i),c=h.point[0],v=h.point[1];c!=null&&v!=null&&this._tryShow({offsetX:c,offsetY:v,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(e,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(vg(a,n))},t.prototype._manuallyAxisShowTip=function(e,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var f=u.getData(),h=zn([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(e,i){var n=e.target,a=this._tooltipModel;if(a){this._lastX=e.offsetX,this._lastY=e.offsetY;var o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){this._lastDataByCoordSys=null;var s,l;ji(n,function(u){if(ot(u).dataIndex!=null)return s=u,!0;if(ot(u).tooltipConfig!=null)return l=u,!0},!0),s?this._showSeriesItemTooltip(e,s,i):l?this._showComponentItemTooltip(e,l,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},t.prototype._showOrMove=function(e,i){var n=e.get("showDelay");i=rt(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},t.prototype._showAxisTooltip=function(e,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=zn([i.tooltipOption],a),l=this._renderMode,u=[],f=ba("section",{blocks:[],noHeader:!0}),h=[],c=new su;A(e,function(m){A(m.dataByAxis,function(_){var S=n.getComponent(_.axisDim+"Axis",_.axisIndex),b=_.value;if(!(!S||b==null)){var w=l1(b,S.axis,n,_.seriesDataIndices,_.valueLabelOpt),x=ba("section",{header:w,noHeader:!Ye(w),sortBlocks:!0,blocks:[]});f.blocks.push(x),A(_.seriesDataIndices,function(T){var C=n.getSeriesByIndex(T.seriesIndex),D=T.dataIndexInside,M=C.getDataParams(D);if(!(M.dataIndex<0)){M.axisDim=_.axisDim,M.axisIndex=_.axisIndex,M.axisType=_.axisType,M.axisId=_.axisId,M.axisValue=av(S.axis,{value:b}),M.axisValueLabel=w,M.marker=c.makeTooltipMarker("item",xi(M.color),l);var L=sd(C.formatTooltip(D,!0,null)),I=L.frag;if(I){var P=zn([C],a).get("valueFormatter");x.blocks.push(P?k({valueFormatter:P},I):I)}L.text&&h.push(L.text),u.push(M)}})}})}),f.blocks.reverse(),h.reverse();var v=i.position,d=s.get("order"),g=cd(f,c,l,d,n.get("useUTC"),s.get("textStyle"));g&&h.unshift(g);var p=l==="richText"?"\n\n":"
",y=h.join(p);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(e,u)?this._updatePosition(s,v,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],v,null,c)})},t.prototype._showSeriesItemTooltip=function(e,i,n){var a=this._ecModel,o=ot(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,c=u.getData(h),v=this._renderMode,d=e.positionDefault,g=zn([c.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=g.get("trigger");if(!(p!=null&&p!=="item")){var y=u.getDataParams(f,h),m=new su;y.marker=m.makeTooltipMarker("item",xi(y.color),v);var _=sd(u.formatTooltip(f,!1,h)),S=g.get("order"),b=g.get("valueFormatter"),w=_.frag,x=w?cd(b?k({valueFormatter:b},w):w,m,v,S,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(g,function(){this._showTooltipContent(g,x,y,T,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:f,dataIndex:c.getRawIndex(f),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,i,n){var a=ot(i),o=a.tooltipConfig,s=o.option||{};if(z(s)){var l=s;s={content:l,formatter:l}}var u=[s],f=this._ecModel.getComponent(a.componentMainType,a.componentIndex);f&&u.push(f),u.push({formatter:s.content});var h=e.positionDefault,c=zn(u,this._tooltipModel,h?{position:h}:null),v=c.get("content"),d=Math.random()+"",g=new su;this._showOrMove(c,function(){var p=Z(c.get("formatterParams")||{});this._showTooltipContent(c,v,p,d,e.offsetX,e.offsetY,e.position,i,g)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,i,n,a,o,s,l,u,f){if(this._ticket="",!(!e.get("showContent")||!e.get("show"))){var h=this._tooltipContent;h.setEnterable(e.get("enterable"));var c=e.get("formatter");l=l||e.get("position");var v=i,d=this._getNearestPoint([o,s],n,e.get("trigger"),e.get("borderColor")),g=d.color;if(c)if(z(c)){var p=e.ecModel.get("useUTC"),y=N(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;v=c,m&&(v=qs(y.axisValue,v,p)),v=km(v,n,!0)}else if(X(c)){var _=rt(function(S,b){S===this._ticket&&(h.setContent(b,f,e,g,l),this._updatePosition(e,l,o,s,h,n,u))},this);this._ticket=a,v=c(n,a,_)}else v=c;h.setContent(v,f,e,g,l),h.show(e,g),this._updatePosition(e,l,o,s,h,n,u)}},t.prototype._getNearestPoint=function(e,i,n,a){if(n==="axis"||N(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!N(i))return{color:a||i.color||i.borderColor}},t.prototype._updatePosition=function(e,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||e.get("position");var h=o.getSize(),c=e.get("align"),v=e.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),X(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),N(i))n=dt(i[0],u),a=dt(i[1],f);else if(H(i)){var g=i;g.width=h[0],g.height=h[1];var p=Ti(g,{width:u,height:f});n=p.x,a=p.y,c=null,v=null}else if(z(i)&&l){var y=L2(i,d,h,e.get("borderWidth"));n=y[0],a=y[1]}else{var y=D2(n,a,o,u,f,c?null:20,v?null:20);n=y[0],a=y[1]}if(c&&(n-=cg(c)?h[0]/2:c==="right"?h[0]:0),v&&(a-=cg(v)?h[1]/2:v==="bottom"?h[1]:0),c1(e)){var y=A2(n,a,o,u,f);n=y[0],a=y[1]}o.moveTo(n,a)},t.prototype._updateContentNotChangedOnAxis=function(e,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===e.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],f=e[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&A(u,function(c,v){var d=h[v]||{},g=c.seriesDataIndices||[],p=d.seriesDataIndices||[];o=o&&c.value===d.value&&c.axisType===d.axisType&&c.axisId===d.axisId&&g.length===p.length,o&&A(g,function(y,m){var _=p[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),a&&A(c.seriesDataIndices,function(y){var m=y.seriesIndex,_=i[m],S=a[m];_&&S&&S.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=i,!!o},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,i){j.node||!i.getDom()||(Cf(this,"_updatePosition"),this._tooltipContent.dispose(),qf("itemTooltip",i))},t.type="tooltip",t}(er);function zn(r,t,e){var i=t.ecModel,n;e?(n=new Rt(e,i,i),n=new Rt(t.option,n,i)):n=t;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Rt&&(o=o.get("tooltip",!0)),z(o)&&(o={formatter:o}),o&&(n=new Rt(o,n,i)))}return n}function vg(r,t){return r.dispatchAction||rt(t.dispatchAction,t)}function D2(r,t,e,i,n,a,o){var s=e.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(t+u+o>n?t-=u+o:t+=o),[r,t]}function A2(r,t,e,i,n){var a=e.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,t=Math.min(t+s,n)-s,r=Math.max(r,0),t=Math.max(t,0),[r,t]}function L2(r,t,e,i){var n=e[0],a=e[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,f=t.height;switch(r){case"inside":s=t.x+u/2-n/2,l=t.y+f/2-a/2;break;case"top":s=t.x+u/2-n/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-n/2,l=t.y+f+o;break;case"left":s=t.x-n-o,l=t.y+f/2-a/2;break;case"right":s=t.x+u+o,l=t.y+f/2-a/2}return[s,l]}function cg(r){return r==="center"||r==="middle"}function I2(r,t,e){var i=ph(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=Ea(t,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=e.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=ot(u).tooltipConfig;if(f&&f.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}const P2=C2;function VR(r){ke(v1),r.registerComponentModel(h2),r.registerComponentView(P2),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ht),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ht)}var dg=A;function pg(r){if(r){for(var t in r)if(r.hasOwnProperty(t))return!0}}function gg(r,t,e){var i={};return dg(t,function(a){var o=i[a]=n();dg(r[a],function(s,l){if(te.isValidType(l)){var u={type:l,visual:s};e&&e(u,a),o[l]=new te(u),l==="opacity"&&(u=Z(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new te(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function R2(r,t,e){var i;A(e,function(n){t.hasOwnProperty(n)&&pg(t[n])&&(i=!0)}),i&&A(e,function(n){t.hasOwnProperty(n)&&pg(t[n])?r[n]=Z(t[n]):delete r[n]})}function E2(r,t,e,i){var n={};return A(r,function(a){var o=te.prepareVisualTypes(t[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(b){return y0(s,h,b)}function f(b,w){SC(s,h,b,w)}for(var h,c=s.getStore();(h=o.next())!=null;){var v=s.getRawDataItem(h);if(!(v&&v.visualMap===!1))for(var d=i!=null?c.get(l,h):h,g=e(d),p=t[g],y=n[g],m=0,_=y.length;m<_;m++){var S=y[m];p[S]&&p[S].applyVisual(d,u,f)}}}}}var k2=function(r,t){if(t==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},O2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode={type:"box",ignoreSize:!0},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},t.prototype._updateSelector=function(e){var i=e.selector,n=this.ecModel;i===!0&&(i=e.selector=["all","inverse"]),N(i)&&A(i,function(a,o){z(a)&&(a={type:a}),i[o]=at(a,k2(n,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(pt);const Kf=O2;var Ui=xt,Qf=A,Po=Ct,B2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.newlineDisabled=!1,e}return t.prototype.init=function(){this.group.add(this._contentGroup=new Po),this.group.add(this._selectorGroup=new Po),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!e.get("show",!0)){var o=e.get("align"),s=e.get("orient");(!o||o==="auto")&&(o=e.get("left")==="right"&&s==="vertical"?"right":"left");var l=e.get("selector",!0),u=e.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,e,i,n,l,s,u);var f=e.getBoxLayoutParams(),h={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),v=Ti(f,h,c),d=this.layoutInner(e,o,v,a,l,u),g=Ti(st({width:d.width,height:d.height},f),h,c);this.group.x=g.x-d.x,this.group.y=g.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=u2(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,i,n,a,o,s,l){var u=this.getContentGroup(),f=tt(),h=i.get("selectedMode"),c=[];n.eachRawSeries(function(v){!v.get("legendHoverLink")&&c.push(v.id)}),Qf(i.getData(),function(v,d){var g=v.get("name");if(!this.newlineDisabled&&(g===""||g==="\n")){var p=new Po;p.newline=!0,u.add(p);return}var y=n.getSeriesByName(g)[0];if(!f.get(g))if(y){var m=y.getData(),_=m.getVisual("legendLineStyle")||{},S=m.getVisual("legendIcon"),b=m.getVisual("style"),w=this._createItem(y,g,d,v,i,e,_,b,S,h,a);w.on("click",Ui(yg,g,null,a,c)).on("mouseover",Ui(Jf,y.name,null,a,c)).on("mouseout",Ui(jf,y.name,null,a,c)),f.set(g,!0)}else n.eachRawSeries(function(x){if(!f.get(g)&&x.legendVisualProvider){var T=x.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),D=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),L=ae(D.fill);L&&L[3]===0&&(L[3]=.2,D=k(k({},D),{fill:cr(L,"rgba")}));var I=this._createItem(x,g,d,v,i,e,{},D,M,h,a);I.on("click",Ui(yg,null,g,a,c)).on("mouseover",Ui(Jf,null,g,a,c)).on("mouseout",Ui(jf,null,g,a,c)),f.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},t.prototype._createSelector=function(e,i,n,a,o){var s=this.getSelectorGroup();Qf(e,function(u){var f=u.type,h=new It({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var c=i.getModel("selectorLabel"),v=i.getModel(["emphasis","selectorLabel"]);Oa(h,{normal:c,emphasis:v},{defaultText:u.title}),df(h)})},t.prototype._createItem=function(e,i,n,a,o,s,l,u,f,h,c){var v=e.visualDrawType,d=o.get("itemWidth"),g=o.get("itemHeight"),p=o.isSelected(i),y=a.get("symbolRotate"),m=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var S=N2(f,a,l,u,v,p,c),b=new Po,w=a.getModel("textStyle");if(X(e.getLegendIcon)&&(!_||_==="inherit"))b.add(e.getLegendIcon({itemWidth:d,itemHeight:g,icon:f,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}));else{var x=_==="inherit"&&e.getData().getVisual("symbol")?y==="inherit"?e.getData().getVisual("symbolRotate"):y:0;b.add(F2({itemWidth:d,itemHeight:g,icon:f,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,C=s,D=o.get("formatter"),M=i;z(D)&&D?M=D.replace("{name}",i!=null?i:""):X(D)&&(M=D(i));var L=p?w.getTextColor():a.get("inactiveColor");b.add(new It({style:qe(w,{text:M,x:T,y:g/2,fill:L,align:C,verticalAlign:"middle"},{inheritColor:L})}));var I=new Mt({shape:b.getBoundingRect(),invisible:!0}),P=a.getModel("tooltip");return P.get("show")&&Ph({el:I,componentModel:o,itemName:i,itemTooltipOption:P.option}),b.add(I),b.eachChild(function(R){R.silent=!0}),I.silent=!h,this.getContentGroup().add(b),df(b),b.__legendDataIndex=n,b},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();un(e.get("orient"),l,e.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){un("horizontal",u,e.get("selectorItemGap",!0));var c=u.getBoundingRect(),v=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),g=e.getOrient().index,p=g===0?"width":"height",y=g===0?"height":"width",m=g===0?"y":"x";s==="end"?v[g]+=f[p]+d:h[g]+=c[p]+d,v[1-g]+=f[y]/2-c[y]/2,u.x=v[0],u.y=v[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[p]=f[p]+d+c[p],_[y]=Math.max(f[y],c[y]),_[m]=Math.min(0,c[m]+v[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(er);function N2(r,t,e,i,n,a,o){function s(p,y){p.lineWidth==="auto"&&(p.lineWidth=y.lineWidth>0?2:0),Qf(p,function(m,_){p[_]==="inherit"&&(p[_]=y[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),f=r.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:Pf(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:e).opacity),s(u,i);var c=t.getModel("lineStyle"),v=c.getLineStyle();if(s(v,e),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),v.stroke==="auto"&&(v.stroke=i.fill),!a){var d=t.get("inactiveBorderWidth"),g=u[f];u.lineWidth=d==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),v.stroke=c.get("inactiveColor"),v.lineWidth=c.get("inactiveWidth")}return{itemStyle:u,lineStyle:v}}function F2(r){var t=r.icon||"roundRect",e=pr(t,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return e.setStyle(r.itemStyle),e.rotation=(r.iconRotate||0)*Math.PI/180,e.setOrigin([r.itemWidth/2,r.itemHeight/2]),t.indexOf("empty")>-1&&(e.style.stroke=e.style.fill,e.style.fill="#fff",e.style.lineWidth=2),e}function yg(r,t,e,i){jf(r,t,e,i),e.dispatchAction({type:"legendToggleSelect",name:r!=null?r:t}),Jf(r,t,e,i)}function y1(r){for(var t=r.getZr().storage.getDisplayList(),e,i=0,n=t.length;in[o],p=[-v.x,-v.y];i||(p[a]=f[u]);var y=[0,0],m=[-d.x,-d.y],_=K(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(g){var S=e.get("pageButtonPosition",!0);S==="end"?m[a]+=n[o]-d[o]:y[a]+=d[o]+_}m[1-a]+=v[s]/2-d[s]/2,f.setPosition(p),h.setPosition(y),c.setPosition(m);var b={x:0,y:0};if(b[o]=g?n[o]:v[o],b[s]=Math.max(v[s],d[s]),b[l]=Math.min(0,d[l]+m[1-a]),h.__rectSize=n[o],g){var w={x:0,y:0};w[o]=Math.max(n[o]-d[o]-_,0),w[s]=b[s],h.setClipPath(new Mt({shape:w})),h.__rectSize=w[o]}else c.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(e);return x.pageIndex!=null&&Et(f,{x:x.contentPosition[0],y:x.contentPosition[1]},g?e:null),this._updatePageInfoView(e,x),b},t.prototype._pageGo=function(e,i,n){var a=this._getPageInfo(i)[e];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},t.prototype._updatePageInfoView=function(e,i){var n=this._controllerGroup;A(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",c=i[h]!=null,v=n.childOfName(f);v&&(v.setStyle("fill",c?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),v.cursor=c?"pointer":"default")});var a=n.childOfName("pageText"),o=e.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",z(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(e){var i=e.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=e.getOrient().index,s=Fu[o],l=Vu[o],u=this._findTargetItemIndex(i),f=n.children(),h=f[u],c=f.length,v=c?1:0,d={contentPosition:[n.x,n.y],pageCount:v,pageIndex:v-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var g=S(h);d.contentPosition[o]=-g.s;for(var p=u+1,y=g,m=g,_=null;p<=c;++p)_=S(f[p]),(!_&&m.e>y.s+a||_&&!b(_,y.s))&&(m.i>y.i?y=m:y=_,y&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=y.i),++d.pageCount)),m=_;for(var p=u-1,y=g,m=g,_=null;p>=-1;--p)_=S(f[p]),(!_||!b(m,_.s))&&y.i=x&&w.s<=x+a}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===e&&(i=s)}),i!=null?i:a},t.type="legend.scroll",t}(m1);const U2=W2;function $2(r){r.registerAction("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;i!=null&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(n){n.setScrollDataIndex(i)})})}function Y2(r){ke(_1),r.registerComponentModel(G2),r.registerComponentView(U2),$2(r)}function zR(r){ke(_1),ke(Y2)}var X2={get:function(r,t,e){var i=Z((Z2[r]||{})[t]);return e&&N(i)?i[i.length-1]:i}},Z2={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const S1=X2;var Sg=te.mapVisual,q2=te.eachVisual,K2=N,wg=A,Q2=gy,J2=je,j2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.stateList=["inRange","outOfRange"],e.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],e.layoutMode={type:"box",ignoreSize:!0},e.dataBound=[-1/0,1/0],e.targetVisuals={},e.controllerVisuals={},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,i){var n=this.option;!i&&R2(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var i=this.stateList;e=rt(e,this),this.controllerVisuals=gg(this.option.controller,i,e),this.targetVisuals=gg(this.option.target,i,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,i=[];return e==null||e==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=Ot(e),i},t.prototype.eachTargetSeries=function(e,i){A(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&e.call(i,a)},this)},t.prototype.isTargetSeries=function(e){var i=!1;return this.eachTargetSeries(function(n){n===e&&(i=!0)}),i},t.prototype.formatValueText=function(e,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],N(e)&&(e=e.slice(),u=!0);var f=i?e:u?[h(e[0]),h(e[1])]:h(e);if(z(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(X(l))return u?l(e[0],e[1]):l(e);if(u)return e[0]===s[0]?n[0]+" "+f[1]:e[1]===s[1]?n[1]+" "+f[0]:f[0]+" - "+f[1];return f;function h(c){return c===s[0]?"min":c===s[1]?"max":(+c).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,i=Q2([e.min,e.max]);this._dataExtent=i},t.prototype.getDataDimensionIndex=function(e){var i=this.option.dimension;if(i!=null)return e.getDimensionIndex(i);for(var n=e.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=e.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});at(a,n),at(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),f.call(this,o);function l(h){K2(i.color)&&!h.inRange&&(h.inRange={color:i.color.slice().reverse()}),h.inRange=h.inRange||{color:e.get("gradientColor")}}function u(h,c,v){var d=h[c],g=h[v];d&&!g&&(g=h[v]={},wg(d,function(p,y){if(te.isValidType(y)){var m=S1.get(y,"inactive",s);m!=null&&(g[y]=m,y==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function f(h){var c=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,v=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),g=this.getItemSymbol(),p=g||"roundRect";wg(this.stateList,function(y){var m=this.itemSize,_=h[y];_||(_=h[y]={color:s?d:[d]}),_.symbol==null&&(_.symbol=c&&Z(c)||(s?p:[p])),_.symbolSize==null&&(_.symbolSize=v&&Z(v)||(s?m[0]:[m[0],m[0]])),_.symbol=Sg(_.symbol,function(w){return w==="none"?p:w});var S=_.symbolSize;if(S!=null){var b=-1/0;q2(S,function(w){w>b&&(b=w)}),_.symbolSize=Sg(S,function(w){return J2(w,[0,b],[0,m[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(pt);const Is=j2;var bg=[20,140],tR=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(e[0]==null||isNaN(e[0]))&&(e[0]=bg[0]),(e[1]==null||isNaN(e[1]))&&(e[1]=bg[1])},t.prototype._resetRange=function(){var e=this.getExtent(),i=this.option.range;!i||i.auto?(e.auto=1,this.option.range=e):N(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],e[0]),i[1]=Math.min(i[1],e[1]))},t.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),A(this.stateList,function(e){var i=this.option.controller[e].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),i=gy((this.get("range")||[]).slice());return i[0]>e[1]&&(i[0]=e[1]),i[1]>e[1]&&(i[1]=e[1]),i[0]=n[1]||e<=i[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){e[0]<=s&&s<=e[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},t.prototype.getVisualMeta=function(e){var i=xg(this,"outOfRange",this.getExtent()),n=xg(this,"inRange",this.option.range.slice()),a=[];function o(v,d){a.push({value:v,color:e(v,d)})}for(var s=0,l=0,u=n.length,f=i.length;le[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(e[1],"color",i),offset:1}),a},t.prototype._createBarPoints=function(e,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-i[1],e[1]]]},t.prototype._createBarGroup=function(e){var i=this._orient,n=this.visualMapModel.get("inverse");return new Ct(i==="horizontal"&&!n?{scaleX:e==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:e==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:e==="left"?1:-1,scaleY:-1}:{scaleX:e==="left"?1:-1})},t.prototype._updateHandle=function(e,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();iR([0,1],function(f){var h=o[f];h.setStyle("fill",i.handlesColor[f]),h.y=e[f];var c=Ge(e[f],[0,l[1]],u,!0),v=this.getControllerVisual(c,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var d=on(n.handleLabelPoints[f],Go(h,this.group));s[f].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],f=this._shapes,h=f.indicator;if(h){h.attr("invisible",!1);var c={convertOpacityToAlpha:!0},v=this.getControllerVisual(e,"color",c),d=this.getControllerVisual(e,"symbolSize"),g=Ge(e,s,u,!0),p=l[0]-d/2,y={x:h.x,y:h.y};h.y=g,h.x=p;var m=on(f.indicatorLabelPoint,Go(h,this.group)),_=f.indicatorLabel;_.attr("invisible",!1);var S=this._applyTransform("left",f.mainGroup),b=this._orient,w=b==="horizontal";_.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:w?S:"middle",align:w?"center":S});var x={x:p,y:g,style:{fill:v}},T={style:{x:m[0],y:m[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};h.x=y.x,h.y=y.y,h.animateTo(x,C),_.animateTo(T,C)}else h.attr(x),_.attr(T);this._firstShowIndicator=!1;var D=this._shapes.handleLabels;if(D)for(var M=0;Mo[1]&&(h[1]=1/0),i&&(h[0]===-1/0?this._showIndicator(f,h[1],"< ",l):h[1]===1/0?this._showIndicator(f,h[0],"> ",l):this._showIndicator(f,f,"≈ ",l));var c=this._hoverLinkDataIndices,v=[];(i||Dg(n))&&(v=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=Fw(c,v);this._dispatchHighDown("downplay",Zo(d[0],n)),this._dispatchHighDown("highlight",Zo(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var i;if(ji(e.target,function(l){var u=ot(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function vR(r,t,e,i){for(var n=t.targetVisuals[i],a=te.prepareVisualTypes(n),o={color:m0(r.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),r.registerAction(uR,fR),A(hR,function(t){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,t)}),r.registerPreprocessor(cR))}function dR(r){r.registerComponentModel(eR),r.registerComponentView(lR),x1(r)}var pR=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._pieceList=[],e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],gR[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=Z(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=V(this._pieceList,function(l){return l=Z(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var e=this.option,i={},n=te.listVisualTypes(),a=this.isCategory();A(e.pieces,function(s){A(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),A(i,function(s,l){var u=!1;A(this.stateList,function(f){u=u||o(e,f,l)||o(e.target,f,l)},this),!u&&A(this.stateList,function(f){(e[f]||(e[f]={}))[l]=S1.get(l,f==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,i){var n=this.option,a=this._pieceList,o=(i?n:e).selected||{};if(n.selected=o,A(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;A(a,function(l,u){var f=this.getSelectedMapKey(l);o[f]&&(s?o[f]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return this._mode==="categories"?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=Z(e)},t.prototype.getValueState=function(e){var i=te.findPieceIndex(e,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var f=te.findPieceIndex(l,n);f===e&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},t.prototype.getRepresentValue=function(e){var i;if(this.isCategory())i=e.value;else if(e.value!=null)i=e.value;else{var n=e.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(f,h){var c=a.getRepresentValue({interval:f});h||(h=a.getValueState(c));var v=e(c,h);f[0]===-1/0?n[0]=v:f[1]===1/0?n[1]=v:i.push({value:f[0],color:v},{value:f[1],color:v})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return A(s,function(f){var h=f.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:i,outerColors:n}},t.type="visualMap.piecewise",t.defaultOption=Zs(Is.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(Is),gR={splitNumber:function(r){var t=this.option,e=Math.min(t.precision,20),i=this.getExtent(),n=t.splitNumber;n=Math.max(parseInt(n,10),1),t.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(e)!==a&&e<5;)e++;t.precision=e,a=+a.toFixed(e),t.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][i[0]]];e.text=e.text||this.formatValueText(e.value!=null?e.value:e.interval,!1,n)},this)}};function Pg(r,t){var e=r.inverse;(r.orient==="vertical"?!e:e)&&t.reverse()}const yR=pR;var mR=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,f=this._getViewData(),h=f.endsText,c=fn(i.get("showLabel",!0),!h);h&&this._renderEndsText(e,h[0],u,c,l),A(f.viewPieceList,function(v){var d=v.piece,g=new Ct;g.onclick=rt(this._onItemClick,this,d),this._enableHoverLink(g,v.indexInModelPieceList);var p=i.getRepresentValue(d);if(this._createItemSymbol(g,p,[0,0,u[0],u[1]]),c){var y=this.visualMapModel.getValueState(p);g.add(new It({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:y==="outOfRange"?.5:1}}))}e.add(g)},this),h&&this._renderEndsText(e,h[1],u,c,l),un(i.get("orient"),e,i.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,i){var n=this;e.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:Zo(s.findTargetDataIndices(i),s)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,i=e.option;if(i.orient==="vertical")return b1(e,this.api,e.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},t.prototype._renderEndsText=function(e,i,n,a,o){if(i){var s=new Ct,l=this.visualMapModel.textStyleModel;s.add(new It({style:qe(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),e.add(s)}},t.prototype._getViewData=function(){var e=this.visualMapModel,i=V(e.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=e.get("text"),a=e.get("orient"),o=e.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},t.prototype._createItemSymbol=function(e,i,n){e.add(pr(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},t.prototype._onItemClick=function(e){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=Z(n.selected),s=i.getSelectedMapKey(e);a==="single"||a===!0?(o[s]=!0,A(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(w1);const _R=mR;function SR(r){r.registerComponentModel(yR),r.registerComponentView(_R),x1(r)}function HR(r){ke(dR),ke(SR)}var wR=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="dataset",e}return t.prototype.init=function(e,i,n){r.prototype.init.call(this,e,i,n),this._sourceManager=new e0(this),hd(this)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),hd(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:Ke},t}(pt),bR=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="dataset",e}return t.type="dataset",t}(er);function xR(r){r.registerComponentModel(wR),r.registerComponentView(bR)}ke([HL,xR]);ke(eL);export{Nr as $,fh as A,qe as B,pt as C,er as D,Sw as E,eP as F,B1 as G,HA as H,Ti as I,RR as J,ER as K,Pa as L,Rt as M,Z as N,Of as O,xt as P,ie as Q,Mt as R,Rm as S,H as T,DT as U,DR as V,LR as W,IR as X,PR as Y,ir as Z,X0 as _,kR as a,Tt as a0,Qe as a1,HL as a2,HR as a3,TR as a4,CR as a5,MR as a6,B as a7,OR as b,BR as c,zR as d,NR as e,xR as f,FR as g,VR as h,AR as i,N as j,ot as k,A as l,V as m,ft as n,mD as o,ae as p,_D as q,qu as r,V0 as s,Xh as t,ke as u,at as v,st as w,Xv as x,b0 as y,It as z}; diff --git a/dirs/mainsail/assets/es-8a2d24bf.js b/dirs/mainsail/assets/es-8a2d24bf.js deleted file mode 100644 index 8728b34..0000000 --- a/dirs/mainsail/assets/es-8a2d24bf.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{DependencyDescription:"La versión actual de {name} no es compatible con todas las funciones de Mainsail. Actualice {name} a al menos {neededVersion}.",DependencyName:"Dependencia: {name}",DismissAll:"Descartar todo",KlipperWarnings:{DeprecatedOption:"La opción '{option}' en la sección '{section}' está discontinuada y será removida en la próxima versión.",DeprecatedOptionHeadline:"Opción de Klipper en desuso",DeprecatedValue:"El valor '{value}' en la opción '{option}' en la sección '{section}' está discontinuado y será removido en la próxima versión.",DeprecatedValueHeadline:"Valor de Klipper en desuso",KlipperWarning:"Advertencia de Klipper"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Se detectó un error al cargar el componente moonraker '{componente}'. Verifique el archivo de registro y solucione el problema.",MoonrakerWarning:"Advertencia de Moonraker",UnparsedConfigOption:"Opción de configuración no analizada '{option}: {value}' detectada en la sección [{section}]. Esta puede ser una opción que ya no está disponible o puede ser el resultado de un módulo que no se pudo cargar. En el futuro, esto dará un error de inicio.",UnparsedConfigSection:"Sección de configuración no analizada [{section}] detectada. Esto puede ser por un componente que no se pudo cargar. En el futuro, esto dará un error de inicio."},Never:"nunca",NextReboot:"próximo reinicio",NoNotification:"No hay notificación disponible",Notifications:"Notificaciones",Remind:"Recordar:"},NumberInput:{GreaterOrEqualError:"¡Debe ser mayor o igual a {min}!",MustBeBetweenError:"¡Debe estar entre {min} y {max}!",NoEmptyAllowedError:"¡No puede estar vacío!"},Printers:"Impresoras",TheServiceWorker:{DescriptionNeedUpdate:"El caché local necesita ser actualizado. Por favor, haga click en el botón de abajo para actualizar el caché.",TitleNeedUpdate:"PWA necesita actualizarse",Update:"actualizar"},ThrottledStates:{DescriptionCurrentlyThrottled:"Los núcleos rPi ARM tienen la frecuencia reducida.",DescriptionFrequencyCapped:"La frecuencia máxima de los núcleos rPi ARM está actualmente limitada a 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"La frecuencia máxima de los núcleos rPi ARM fue limitada al menos una vez a 1.2 GHz desde el último encendido.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only). La temperatura estuvo por lo menos una vez por encima del límite (default 60C) desde el último encendido.",DescriptionPreviouslyThrottled:"La frecuencia de los núcleos rPI ARM se redujo al menos una vez desde el último encendido.",DescriptionPreviouslyUnderVolted:"El voltaje de entrada de rPi se redujo a menos de 4.65V por lo menos una vez desde el último encendido.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ solamente). La temperatura está actualmente por encima del límite (default 60C).",DescriptionUnderVoltageDetected:"El voltaje de alimentación del rPi está actualmente por debajo de los 4.65V",TitleCurrentlyThrottled:"Actualmente limitado",TitleFrequencyCapped:"Limitado por frecuencia",TitlePreviouslyFrequencyCapped:"Limitado anteriormente por frecuencia",TitlePreviouslyTemperatureLimited:"Limitado anteriormente por temperatura",TitlePreviouslyThrottled:"Anteriormente limitado",TitlePreviouslyUnderVolted:"Anteriormente bajo voltaje",TitleTemperatureLimitActive:"Límite de temperatura activo",TitleUnderVoltageDetected:"Bajo voltaje detectado"},Titles:{Complete:"Completado - {filename}",Error:"ERROR",Pause:"Pausar impresión",PrinterOff:"Impresora Apagada",Printing:"{percent}% impreso - {filename}",PrintingETA:"{percent}% impreso - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"¡No se pudo subir el Archivo!",EmergencyStop:"Parada de emergencia",SAVE_CONFIG:"GUARDAR CONFIG.",Uploading:"Cargando",UploadOfFileSuccessful:"¡{file} cargado con éxito!",UploadPrint:"Cargar e imprimir"},TopCornerMenu:{Cancel:"Cancelar",ConfirmationDialog:{Description:{HostReboot:"¡Reiniciar el Host causará que la impresión en curso falle!",HostShutdown:"¡Apagar el Host causará que la impresión en curso falle!",KlipperFirmwareRestart:"¡Reiniciar el firmware de Klipper causará que la impresión en curso falle!",KlipperRestart:"¡Reiniciar Klipper causará que la impresión en curso falle!",KlipperStop:"¡Detener Klipper causará que la impresión en curso falle!",ServiceRestart:"¡Reiniciar este servicio puede causar que la impresión en curso falle!",ServiceStart:"¡Iniciar este servicio puede causar que la impresión en curso falle!",ServiceStop:"¡Detener este servicio puede causar que la impresión en curso falle!"},Title:{HostReboot:"Reiniciar Host",HostShutdown:"Apagar Host",KlipperFirmwareRestart:"Reiniciar firmware de Klipper",KlipperRestart:"Reiniciar Klipper",ServiceRestart:"Reiniciar servicio",ServiceStart:"Iniciar servicio",ServiceStop:"Detener servicio"}},HostControl:"Control del Host",KlipperControl:"Control de Klipper",KlipperFirmwareRestart:"Reiniciar firmware",KlipperRestart:"Reiniciar",PowerDevices:"Encender dispositivos",Reboot:"Reiniciar",Restart:"Reiniciar",ServiceControl:"Control de servicios",Shutdown:"Apagar",Start:"Iniciar",Stop:"Parar"},UpdateDialog:{Close:"Cerrar",Empty:"Vacío",Recovering:"Recuperando {software}...",RecoveringDone:"¡Recuperación de {software} realizada!",Updating:"Actualizando {software}...",UpdatingDone:"¡Actualización de {software} realizada!"}},a={Abort:"abortar",Accept:"aceptar",Adjusted:"ajustar",Description:"Haz click en AJUSTADO si el tornillo actual ha sido ajustado. Haz click en ACEPTAR para continuar sin ajustar.",Headline:"Tornillos de la Cama",ScrewAccepted:"Tornillos aceptados",ScrewIndex:"Índice de Tornillos",ScrewName:"Nombre de Tornillo",ScrewOutput:"{current} de {max}"},r={CannotConnectTo:"No se pudo conectar a ({host}) Moonraker.",CheckMoonrakerLog:"Si este mensaje aparece repetidamente, por favor dé un vistazo al archivo de registro ubicado en:",Connecting:"Conectando a {host}",Failed:"Conexión Fallida",Initializing:"Inicializando",TryAgain:"Intentar nuevamente"},o={CommandList:"Lista de comandos",Empty:"Vacío",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar timelapse",SendCode:"Enviar código...",SetupConsole:"Configurar consola"},i={StartPrint:{Cancel:"Cancelar",DoYouWantToStartFilename:"¿Desea iniciar {filename}?",Headline:"Iniciar trabajo",Print:"imprimir",Timelapse:"Lapso de tiempo"}},t={ConfigReference:"Configuración de referencia",DontSave:"No guardar",Downloading:"Descargando",FailedSave:"¡{filename} no pudo cargarse!",FileReadOnly:"Sólo lectura",SaveClose:"Guardar y cerrar",SaveRestart:"Guardar y reiniciar",SuccessfullySaved:"{filename} guardado con éxito.",UnsavedChanges:"Cambios sin guardar",UnsavedChangesMessage:"¿Quiere guardar los cambios realizados al archivo {filename}?",UnsavedChangesSubMessage:"Sus cambios se perderán si no los guarda. Puede desactivar este mensaje en la configuración del editor.",Uploading:"Cargando"},n={AreYouSure:"¿Está seguro?",EmergencyStop:"Parada de emergencia",No:"No",Yes:"Sí"},s={AddBatchToQueue:"Añadir lote a la fila",AddToQueue:"Añadir a la fila",AllFiles:"Todos",BedTemp:"Temp. Cama",Cancel:"Cancelar",ChamberTemp:"Temp. Cámara",Count:"Contador",Create:"Crear",CreateNewDirectory:"Crear nuevo directorio",CurrentPath:"Ruta actual",Delete:"Borrar",DeleteDirectory:"Borrar directorio",DeleteDirectoryQuestion:'¿Realmente quiere borrar la carpeta "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Realmente desea eliminar {count} archivos seleccionados?",DeleteSingleFileQuestion:'¿Realmente quiere eliminar el archivo "{name}"?',Download:"Descargar",Duplicate:"Duplicar",DuplicateFile:"Duplicar Archivo",EditFile:"Editar archivo",Empty:"Vacío",ExtruderTemp:"Temp. Extructor",Filament:"Filamento",FilamentName:"Nombre del filamento",FilamentType:"Tipo de filamento",FilamentUsage:"Uso de filamento",FilamentWeight:"Peso del filamento",Files:"Archivos",Filesize:"Tamaño del archivo",Free:"Libre",FreeDisk:"Espacio libre en disco",GCodeFiles:"Archivos G-Code",GcodesRootDirectoryDoesntExists:'No existe un directorio de archivos G-Code. Por favor, habilita la opción "path" en la sección [virtual_sdcard] de la configuración de Klipper.',HiddenFiles:"Archivos ocultos",InvalidNameAlreadyExists:"El nombre ya existe, por favor escoge otro nombre.",InvalidNameEmpty:"¡La entrada no puede estar vacía!",LastEndTime:"Ultima hora de finalización",LastFilamentUsed:"Ultimo filamento usado",LastModified:"Ultima modificación",LastPrintDuration:"Duración de la ultima impresión",LastStartTime:"Ultima hora de inicio",LastTotalDuration:"Ultima duración total",LayerHeight:"Altura de capa",Name:"Nombre",NewDirectory:"Nuevo directorio",NozzleDiameter:"Diámetro de la boquilla",ObjectHeight:"Altura del objeto",Preheat:"Precalentar",PrintedFiles:"Archivos impresos",PrintStart:"Iniciar impresión",PrintTime:"Tiempo de impresión",RefreshCurrentDirectory:"Actualizar directorio actual",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",ScanMeta:"Escanear Metadatos",ScanMetaSuccess:"Los metadatos de {filename} han sido escaneados de forma exitosa.",Search:"Buscar",SetupCurrentList:"Configurar lista actual",Slicer:"Laminador",SuccessfullyCreated:"{filename} creado con éxito.",SuccessfullyDeleted:"{filename} eliminado con éxito.",SuccessfullyMoved:"{filename} movido con éxito.",SuccessfullyRenamed:"{filename} renombrado con éxito.",SuccessfullyUploaded:"{filename} subido con éxito!",Total:"Total",UploadNewGcode:"Cargar nuevo G-Code",Used:"Usado",View3D:"Vista 3D"},l={CannotUploadFile:"No se pudo cargar el erchivo!",DropFilesToUploadFiles:"Borrar archivos para subir"},c={ClearLoadedFile:"Borrar",CNCMode:"Modo CNC",ColorMode:"Modo de color",Downloading:"Descargando",ForceLineRendering:"Forzar renderizado de líneas ",HDRendering:"Renderizado HD (extrusiones redondas)",High:"Alto",LoadCurrentFile:"Archivo actual",LoadLocal:"Archivo local",Low:"Bajo",Max:"Máximo",Medium:"Medio",ReloadRequired:"Recarga requerida",Rendering:"Renderizando",RenderQuality:"Calidad de render",ShowGCode:"Mostrar G-Code",ShowObjectSelection:"Mostrar selección de objeto",ShowToolhead:"Mostrar cabezal",ShowTravelMoves:"Mostrar desplazamientos",SpecularLighting:"Iluminación especular",Title:"Visor de G-Code",Tracking:"Seguimiento",Transparency:"Transparencia",Ultra:"Ultra",VoxelMode:"Modo Voxel (ASMBL)"},d={Abort:"Abortar",BedMeshCalibrate:"Calibrar malla de la cama",BedMeshRemove:"Borrar malla de cama",Calibrate:"Calibrar",Clear:"Limpiar",CurrentMesh:{Headline:"Malla actual",Max:"Max",Min:"Min",Name:"Nombre",Range:"Rango",Size:"Tamaño",Variance:"Variación"},DeleteBedMeshProfile:"Borrar perfil de la malla de cama",DoYouReallyWantToDelete:'¿Realmente quiere eliminar el perfil "{name}"?',ErrorKlipperNotReady:"Klipper no disponible. Mapa de altura deshabilitado.",Flat:"Plana",Heightmap:"Mapa de altura",InvalidNameAlreadyExists:"El nombre del perfil ya existe, por favor escoge otro nombre de perfil.",InvalidNameAscii:"El nombre es inválido. Solo caracteres ascii son permitidos.",InvalidNameEmpty:"¡La entrada no puede estar vacía!",InvalidNameReserved:"El perfil 'default' está reservado, por favor escoge otro nombre de perfil.",Later:"Más tarde",Mesh:"Malla",Name:"Nombre",NoBedMeshHasBeenLoadedYet:"bed_mesh no ha sido cargado aún.",NoProfile:"No hay perfil disponible",Ok:"OK",Probed:"Sondeada",Profiles:"Perfil",Remove:"remover",RemoveSaveDescription:"El perfil bed_mesh se ha registrado como eliminado. Haga click en SAVE_CONFIG para removerlo del archivo printer.cfg y reinicie Klipper.",Rename:"renombrar",RenameBedMeshProfile:"Renombrar perfil de BED_MESH",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Gradiente de escala",ScaleZMax:"Escalar Z-Max",TitleCalibrate:"Calibrar nueva malla de cama",TitleClear:"Limpiar la malla de cama",TitleHomeAll:"Llevar al origen",Wireframe:"Estructura de hilos"},m={AddNote:"Agregar Nota",AllJobs:"Todos",AvgPrinttime:"Tiempo promedio de imp.",Cancel:"Cancelar",Chart:"Gráfico",CreateNote:"Crear Nota",Delete:"Eliminar",DeleteSelectedQuestion:"¿Está seguro de que desea eliminar los {count} trabajos seleccionados?",DeleteSingleJobQuestion:"¿Está seguro de que desea eliminar este trabajo?",Details:"Detalles",EditNote:"Editar Nota",Empty:"Vacío",EndTime:"Hora de finalización",EstimatedFilament:"Filamento estimado",EstimatedFilamentWeight:"Peso de filamento estimado",EstimatedTime:"Tiempo estimado",FilamentCalc:"Filamento calculado",FilamentUsage:"Uso de filamento",FilamentUsed:"Filamento utilizado",Filename:"Nombre de archivo",Filesize:"Tamaño de archivo",FirstLayerBedTemp:"Temp. cama primer capa",FirstLayerExtTemp:"Temp. Primera capa",FirstLayerHeight:"Altura primera capa",HistoryFilamentUsage:"Filamento",HistoryPrinttimeAVG:"Impresiones",JobDetails:"Detalles del trabajo",Jobs:"Trabajos",LastModified:"Última modificación",LayerHeight:"Altura de capa",LongestPrinttime:"Impresión más larga",Note:"Nota",ObjectHeight:"Altura del objeto",PrintDuration:"Duración de la impresión",PrintHistory:"Historial de impresiones",PrintTime:"Tiempo de impresión",PrinttimeAvg:"Tiempo promedio de imp.",Reprint:"Reimprimir",Save:"guardar",Search:"Buscar",SelectedFilamentUsed:"Elija el filamento usado",SelectedJobs:"Tareas elegidas",SelectedPrinttime:"Tiempo de impresion elegido",Slicer:"Laminador",SlicerVersion:"Versión del laminador",StartTime:"Hora de inicio",Statistics:"Estadísticas",Status:"Estado",StatusValues:{cancelled:"Cancelado",completed:"Completado",error:"Error",in_progress:"En progreso",klippy_disconnect:"Klippy desconectado",klippy_shutdown:"Klippy apagado",Others:"Otros",server_exit:"salida del servidor"},Table:"Tabla",TitleExportHistory:"Exportar historial",TitleRefreshHistory:"Actualizar historial",TitleSettings:"Configuración",TotalDuration:"Duración total",TotalFilamentUsed:"Filamento utilizado en total",TotalJobs:"Trabajos totales",TotalPrinttime:"Tiempo total de impresión",TotalTime:"Tiempo total"},u={AllJobs:"Todas las tareas",Cancel:"Cancelar",ChangeCount:"Cambiar contador",Count:"Contador",Empty:"Vacía",InvalidCountEmpty:"¡La entrada no puede estar vacía!",InvalidCountGreaterZero:"¡La entrada debe ser mayor que 0!",JobQueue:"Cola de tareas",Jobs:"Tareas",Pause:"Pausar",RemoveFromQueue:"Remover de la cola",Start:"Iniciar"},p={ConfigFilesPanel:{AllFiles:"Todos",Cancel:"Cancelar",ConfigFiles:"Archivos de configuración",ConfigRootDirectoryDoesntExists:'Ningún directorio encontrado. Por favor habilita la opción "config_path" en la sección [file_manager] de la configuración de Moonraker.',Create:"Crear",CreateDirectory:"Crear directorio",CreateFile:"Crear archivo",CurrentPath:"Ruta actual",Delete:"Eliminar",DeleteDirectory:"Eliminar carpeta",DeleteDirectoryQuestion:'¿Realmente quiere eliminar "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Eliminar {count} elementos seleccionados?",DeleteSingleFileQuestion:'¿Realmente quieres borrar el archivo "{name}"?',Download:"Descargar",Duplicate:"Duplicar",DuplicateFile:"Duplicar Archivo",EditFile:"Editar archivo",Empty:"Vacío",Files:"Archivos",Filesize:"Tamaño",Free:"Libre",FreeDisk:"Espacio libre en el disco",HiddenFiles:"Archivos ocultos",HideBackupFiles:"Ocultar archivos de backup",LastModified:"Última modificación",Name:"Nombre",RefreshDirectory:"Actualizar directorio",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",Root:"Raiz",SetupCurrentList:"Configurar lista actual",ShowFile:"Mostrar archivo",Total:"Total",UploadFile:"Cargar archivo",Uploading:"Cargando",Used:"Usado"},EndstopPanel:{Endstop:"Fin de carrera",EndstopInfo:"Presione el botón Sincronizar en la parte inferior derecha para cargar el estado actual de los fines de carrera.",Endstops:"Fines de carrera",open:"ABIERTO",TRIGGERED:"ACTIVADO"},LogfilesPanel:{Accept:"Aceptar",Cancel:"Cancelar",Logfiles:"Archivos de registro",Rollover:"Registros de Rotación",RolloverDescription:"Por favor seleciona los registros que deben ser reseteados:",RolloverToastFailed:'Registros de rotación de "{name}": {message}',RolloverToastSuccessful:'El registro de "{name}" ha sido reseteado exitosamente'},SystemPanel:{Constants:"Constantes",Cpu:"Cpu",HostDetails:"Detalles del host",LastStats:"Últimas estadísticas",Load:"Carga",Memory:"Mem.",NoMoreInfos:"No hay mas Info",SystemLoad:"Cargas del sistema",Values:{Awake:"Despierto: {awake}",Bandwidth:"Ancho de banda: {bandwidth}/s",Distro:"Distribucion: {name} {version_id}",Frequency:"Frec: {frequency}",Load:"Carga: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Recibidos: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmitidos: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abortar",AreYouSure:"¿Estás seguro?",CheckForUpdates:"Comprobar actualizaciones",Close:"Cerrar",CommitHistory:"Historial de Commits",Commits:"Commits",CommitsAvailable:"no hay commits disponibles | {count} commit disponible | {count} commits disponibles",CommitsOnDate:"Commits en {date}",CommittedDaysAgo:"Hizo commits hace {days} días",CommittedHoursAgo:"Hizo commits hace {hours} horas",CommittedOnDate:"Hizo commits el día {date}",CommittedYesterday:"Hizo commits ayer",ConfigChanges:"Configurar Cambios",Corrupt:"corrupto",CountPackagesCanBeUpgraded:"{count} paquetes pueden ser actualizados",Detached:"separado",Dirty:"sucio",GenericUpdateQuestion:"Comprueba el historial de commits (si está disponible) y la página de GitHub de este proyecto para ver si es necesario hacer algún ajuste manual con el fin de poder implementar la actualización",GitHubPage:"Página de GitHub",HardRecovery:"Hard Recovery",InitUpdateManager:"El Mánager de Actualizaciones no ha sido iniciado. Esto suele pasar cuando inicias el sistema por primera vez. Por favor haz click en el botón de refrescar para iniciar todos los componentes.",Invalid:"inválido",IUnderstandTheRisks:"Entiendo los riesgos",KlipperUpdateQuestionConfig:"This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",KlipperUpdateQuestionFirmware:"Esto va a actualizar el software cliente de Klipper. Tal vez se necesite resetear las placas de control que ejecuten Klipper con el firmware compilado antes de que la máquina pueda volver a funcionar.",LinkToGithub:"Link a GitHub",MoonrakerUpdateQuestion:"This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",MoreCommitsInfo:"A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",OSPackages:"Paquetes del sistema",SoftRecovery:"Recuperación Suave",StartUpdate:"Empezar Actualización",System:"Sistema",ThesePackagesCanBeUpgrade:"Estos paquetes del sistema puede ser actualizados:",Unknown:"desconocido",Update:"actualizar",UpdateAll:"actualizar todos los componentes",UpdateManager:"Mánager de actualizaciones",UpdateWarning:"Aviso de actualización: {name}",Upgrade:"mejorar",UpgradeableSystemPackages:"Paquetes del Sistema Mejorables",UpToDate:"al día",WebClientUpdateQuestion:"En algunos casos la actualización del cliente web podría tener cambios que podrían causar incompatibilidad. Consulte las notas de la versión para obtener más información."}},g={Abort:"abortar",Accept:"aceptar",Advanced:"Avanzado",Headline:"Sondeada Manual"},C={ExtruderControlPanel:{Allowed:"Permitida",EstimatedExtrusion:"Extrusion estimada",Extrude:"Extruir",ExtruderTempTooLow:"Temp del extrusor. <",ExtrusionFactor:"Factor de extrusión",ExtrusionFeedrate:"Velocidad de avance de extrusión",FilamentLength:"Largo del filamento",FirmwareRetractionSettings:{RetractLength:"Distancia de retracción",RetractSpeed:"Velocidad de retracción",UnretractExtraLength:"Distancia adicional post-retracción",UnretractSpeed:"Velocidad de post-retracción"},Headline:"Extrusor",LoadFilament:"Cargar filamento",PressureAdvanceSettings:{Advance:"Avance",Extruder:"Extrusor",SmoothTime:"Tiempo de suavizado"},Requested:"Solicitada",Retract:"Retraer",TooLargeExtrusion:"¡Extrusión muy grande!",UnloadFilament:"Descargar Filamento"},FarmPrinterPanel:{ReconnectToPrinter:"Reconectar",SwitchToPrinter:"Cambiar a impresora",WebcamOff:"Apagar"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Por favor comprueba si el servicio de Klipper se está ejecutando y klippy_uds_address está correctamente configurado en moonraker.conf.",FirmwareRestart:"Reiniciar Firmware",KlipperCheck:"Verifique que el servicio Klipper está corriendo y que un UDS (Unix Domain Socket) esta configurado.",MoonrakerCannotConnect:"¡Moonraker no se pudo conectar a Klipper!",PowerOn:"Encender",PrinterSwitchedOff:"La impresora está apagada",PrinterSwitchedOffDescription:"La impresora está actualmente apagada y Klipper no se puede conectar. Para encender la impresora, haz click en el botón de abajo:",Restart:"Reiniciar",ServiceReports:"reporta {service}"},MachineSettingsPanel:{Headline:"Configuración de impresora",MotionSettings:{Acceleration:"Aceleración",MaxAccelToDecel:"Max. Acel. a Decel.",SquareCornerVelocity:"Velocidad esquinas rectas",Velocity:"Velocidad"}},MacrosPanel:{Headline:"Macros",Send:"Enviar"},MiniconsolePanel:{Headline:"Consola",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar timelapse",SendCode:"Enviar código...",SetupConsole:"Configurar consola"},MinSettingsPanel:{IncludeMainsailCfg:"Asegúrese de incluir mainsail.cfg en su archivo printer.cfg.",IsNotDefinedInConfig:"no está definida en la configuración.",MissingConfiguration:"Configuración no encontrada",MoreInformation:"más información"},MiscellaneousPanel:{Headline:"Varios",Light:{Blue:"azul",Green:"verde",Red:"rojo",White:"blanco"},RunoutSensor:{Detected:"detectado",Disabled:"deshabilitado",Empty:"Vacío"}},PowerControlPanel:{Error:"Error",Off:"Apagado",On:"Encendido",PowerControl:"Control de energía"},StatusPanel:{CancelPrint:"Cancelar impresión",ClearPrintStats:"Limpiar estadísticas de impresión",Difference:"Diferencia",EmptyGcodes:"No hay código G disponible.",EmptyJobqueue:"No hay ningún archivo en la cola de trabajos.",Estimate:"Estimación",ETA:"ETA",ExcludeObject:{Cancel:"Cancelar",Excluded:"Excluido",ExcludeObject:"Excluir objeto",ExcludeObjectHeadline:"Excluir objeto",ExcludeObjectText:'¿Realmente quiere excluir a "{name}"?'},Filament:"Filamento",File:"Archivo",Files:"Archivos",Flow:"Flujo",Headline:"Estado",Jobqueue:"Cola de trabajo",JobqueueMoreFiles:"no mas trabajos | un trabajo mas | {count} trabajos mas",Layer:"Capa",Max:"max",ObjectHeight:"Altura del objeto",PauseAtLayer:{Abort:"Abortar",Accept:"Aceptar",AtLayer:"a La Capa",Call:"Llamar",DescriptionPauseAtLayerActive:'Esta función ya está activa y va a llamar "{call}" a la capa {layer}. Si vuelves a ejecutar el comando, estas opciones se sobrescribirán.',DescriptionPauseNextLayerActive:'Esta función ya está activa y llamará "{call}" en la siguiente capa.',Layer:"Capa",NextLayer:"siguiente Capa",PauseAtLayer:"Para en la Capa",Type:"Tipo"},PausePrint:"Pausar impresión",Print:"Imprimir",PrintTime:"Tiempo de impresion",ReprintJob:"Reimprimir trabajo",Requested:"Solicitada",ResumePrint:"Reanudar impresión",Slicer:"Laminador",Speed:"Velocidad",Status:"Estado",Total:"Total",Unknown:"Desconocido"},TemperaturePanel:{AutoscaleChart:"Autoescalar gráfico",Avg:"Promedio",Cooldown:"Enfriar",Current:"Actual",Dataset:{Power:"Potencia PWM",Speed:"Velocidad PWM",Target:"temperatura objetivo",Temperature:"temperatura actual"},Headline:"Temperaturas",HideMcuHostSensors:"Ocultar Sensores Host/MCU",Max:"max",Min:"min",Name:"Nombre",Presets:"Preestab.",SetupTemperatures:"Configurar temperaturas",ShowChart:"Mostrar gráfico",ShowNameInChart:"Mostrar {name} en el gráfico",ShowNameInList:"Mostrar {name} en el listado",State:"Estado",Target:"Objetivo",TemperaturesInChart:"Temperatura [°C]",TempTooHigh:"¡Temperatura muy alta para {name}! (max: {max})",TempTooLow:"¡Temperatura muy baja para {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absoluta",ALL:"TODO",Headline:"Toolhead",PleaseConfigureSteps:"Por favor configure los pasos",Position:"Posición",QGL:"QGL",Relative:"relativa",SettingsInterfaceControl:"Configuración > Interfaz > Control",SpeedFactor:"Factor de velocidad",ZTilt:"Z Tilt"},WebcamPanel:{All:"Todos",FPS:"FPS",Headline:"Cámara web",NoWebcam:'No hay cámara web disponible. Agregue una cámara web en "Configuración" -> "Cámaras web".',UnknownWebcamService:"Servicio de cámara web desconocido"},ZoffsetPanel:{Clear:"Limpiar",Headline:"Z-Offset",Later:"Más tarde",Ok:"OK",Save:"Guardar",SaveConfig:"SAVEE CONFIG",SaveInfoDescription:'El nuervo Z-Offset fue calculado y registrado. Haga click en "SAVE CONFIG" para guardar el nuevo Z-Offset en su archivo printer.cfg y reiniciar Klipper.',SaveInfoDescriptionPrint:'El nuevo Z-Offset fue calculado y registrado. Después de imprimir, haga click en "SAVE CONFIG" en la barra superior para guardarlo en printer.cfg y reiniciar Klipper.',SaveInfoHeadline:"Información",ToEndstop:"al fin de carrera",ToProbe:"a la sonda"}},b={AreYouSure:"¿Está seguro?",No:"No",TurnDeviceOff:"Apagar {device}",TurnDeviceOn:"Encender {device}",Yes:"Si"},v={Console:"Consola",Dashboard:"Panel de control","G-Code Files":"Archivos G-Code","G-Code Viewer":"Visor de G-Code",Heightmap:"Mapa de altura",History:"Historial",Machine:"Máquina",Printers:"Impresoras",Timelapse:"Timelapse",Webcam:"Cámara web"},f={Accept:"aceptar",Base:"Base",ErrorText:"Algo salió mal durante el proceso de sondeo.",Headline:"Ajuste de inclinación de tornillos",Retry:"reintentar"},D={AddPrinter:"Agregar impresora",AddPrintersToJson:"Por favor, añade Impresoras al config.json.",CannotConnectTo:"No es posible conectarse a {host}.",ChangePrinter:"Cambiar impresora",Connecting:"Conectando a {host}",ConnectionFailed:"Conexión fallida",EditPrinter:"Editar impresora",Hello:"¡Hola y bienvenido al modo remoto de Mainsail!",HostnameInvalid:"Nombre de host o IP inválida",HostnameIp:"Nombre del host/IP",HostnameRequired:"El nombre del host es obligatorio",Port:"Puerto",PortRequired:"El puerto es obligatorio",RememberToAdd:"Por favor recuerde agregar {cors} en moonraker.conf dentro de 'cors_domains'.",SelectPrinter:"Elegir impresora",TryAgain:"Intentar nuevamente",UpdatePrinter:"Actualizar impresora",YouCanFindMore:"Puede encontrar más detalles en"},S={Cancel:"Cancelar",Close:"Cerrar",ConsoleTab:{AddFilter:"Agregar filtro",Console:"Consola",CreateHeadline:"Crear filtro",Direction:"Dirección",DirectionShell:"Última entrada abajo",DirectionTable:"Última entrada arriba",EditHeadline:"Editar filtro",EntryStyle:"Estilo",EntryStyleCompact:"Compacto",EntryStyleDefault:"Predeterminado",Filters:"Filtros",Height:"Altura",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar Timelapse",Name:"Nombre",Regex:"Regex",StoreButton:"Guardar filtro",UpdateButton:"Actualizar filtro"},ControlTab:{Bars:"Barras",Circle:"Círculo",Control:"Control",Cross:"Cruz",EnableXYHoming:"Habilitar homing X Y combinado ",EstimatedExtrusionInfo:"Mostrar info de extrusion estimada",EstimatedExtrusionInfoDescription:"Mostrar / Ocultar informacion de extrusion estimada basado en la candidad de extrusion y el avance",HideDuringPrint:"Ocultar los controles de los ejes durante la impresión",InvertXMovement:"Invertir movimiento X",InvertYMovement:"Invertir movimiento Y",InvertZMovement:"Invertir movimiento Z",IsDefault:" (default)",MaximumValues:"Valores máximos: {maximum}",MaximumValuesVisibility:"Máximo valor de {maximum} se recomienda para mejor visibilidad",MinimumValues:"Valores mínimos: {minimum}",MotorsOff:"Motores apagados{isDefault}",MoveDistancesEInMm:"Distancia recorrido E en mm",MoveDistancesInMm:"Distancia recorrido en mm",MoveDistancesXYInMm:"Distancia recorrido XY en mm",MoveDistancesZInMm:"Distancia recorrido Z en mm",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Velocidad E en mm/s",SpeedXY:"Velocidad XY",SpeedZ:"Velocidad Z",Style:"Estilo",ValueGreaterThan:"El valor debe ser mayor a {value}",ZOffsetIncrements:"Incrementos de Z-Offset (en mm)",ZTiltAdjust:"Ajuste de Z-Tilt{isDefault}"},DashboardTab:{Dashboard:"Tablero de control",Desktop:"Escritorio",Mobile:"Celular",ResetLayout:"Restablecer diseño",Tablet:"Tableta",Widescreen:"Pantalla ancha"},Edit:"Editar",EditorTab:{ConfirmUnsavedChanges:"Preguntar si guardar o descartar cambios",ConfirmUnsavedChangesDescription:"Si está activa, el editor requerirá una confirmación para guardar o descartar los cambio realizados. Si está desactivada, los cambios serán descartados.",Editor:"Editor",KlipperRestartMethod:"Metodo de reinicio de klipper",KlipperRestartMethodDescription:'Elija metodo de reinicio que sera usado cuando editamos configuracion de klipper y presionamos "Guardar y Reiniciar"',Spaces:"Espacios: {count}",TabSize:"Tamaño TAB",TabSizeDescription:"Ajusta cuántos espacios deben sangrarse para TAB",UseEscToClose:"Use ESC para cerrar",UseEscToCloseDescription:"Permite que la tecla ESC cierre el editor"},GCodeViewerTab:{BackgroundColor:"Color de fondo",ExtruderColor:"Color extrusor",GCodeViewer:"Visor de G-Code",GridColor:"Color grilla",MaxFeed:"Alimentación máxima",MinFeed:"Alimentación mínima",ProgressColor:"Color de Progreso",ShowAxes:"Mostrar ejes"},GeneralTab:{"12hours":"12-horas ({time})","24hours":"24-horas ({time})",Backup:"Backup",BackupDialog:"Elija todas las secciones a las que quiere hacer backup:",CalcEstimateTime:"Cálculo de tiempo estimado",CalcEstimateTimeDescription:"Si se selecciona muchos, un promedio será calculado",CalcEtaTime:"Cálculo de ETA",CalcEtaTimeDescription:"Si se seleccionan varios, se calculará una media",CalcPrintProgress:"Cálculo del progreso de impresión",CalcPrintProgressDescription:"Método para calcular el progreso de impresión",CalcPrintProgressItems:{Filament:"Filamento",FileAbsolute:"Posición del archivo (absoluta)",FileRelative:"Posición del archivo (relativa)",Slicer:"Slicer (M73)"},CannotReadJson:"No se puede leer el archivo de backup.",DateFormat:"Formato de Fecha",DbConsoleHistory:"Historial de la Consola",DbHistoryJobs:"Historial de Trabajos",DbHistoryTotals:"Historial Totales",DBNavigation:"Navegación",DbTimelapseSettings:"Ajustes de Timelapse",DbView:"Ajustes de Vista",DbWebcams:"Cámaras web",EstimateValues:{Filament:"Filamento",File:"Archivo",Slicer:"Slicer"},Everything:"Todo",FactoryDialog:"Elija las secciones que quiere reiniciar:",FactoryReset:"Restablecimiento de fábrica",General:"General",Language:"Idioma",MainsailSettingsMoonrakerDb:"Ajustes de Mainsail en Moonraker DB",MoonrakerDb:"Moonraker DB",PrinterName:"Nombre de la impresora",Reset:"Reiniciar",Restore:"Restaurar",RestoreDialog:"Elija las secciones que quiere restaurar:",TimeFormat:"Formato de Tiempo"},InterfaceSettings:"Configuración de la interfaz",MacrosTab:{Add:"Agregar",AddGroup:"Agregar grupo",AvailableMacros:"Macros disponibles",ChangeMacroColor:"Cambiar el color del botón.",Color:"Color",CountMacros:"No se agregaron macros | {count} Macro | {count} Macros",Custom:"Personalizado",CustomColor:"Color personalizado",DeletedMacro:"Macro eliminada",DeleteMacroFromGroup:"Eliminar macro del grupo",EditGroup:"Editar grupo",Error:"Error",Expert:"Experto",General:"General",Group:"Grupo",GroupMacros:"Grupos de macros",Macrogroups:"Grupos",Macros:"Macros",Management:"Gestión",Name:"Nombre",NoAvailableMacros:"No hay macros disponibles.",NoGroups:"No se encontraron grupos...",NOMacros:"No se encontraron macros...",NoMacrosInGroup:"No hay Macros en este grupo.",Primary:"Primario",Secondary:"Secundario",ShowInStatePaused:"Mostrar/Ocultar si la impresora está pausada.",ShowInStatePrinting:"Mostrar/Ocultar si la impresora está imprimiendo.",ShowInStateStandby:"Mostrar/Ocultar si la impresora está en espera.",Simple:"Simple",Status:"Estado",Success:"Éxito",UnknownGroup:"Grupo desconocido",Warning:"Alerta"},MiscellaneousTab:{AddGroup:"añadir grupo",AddPreset:"añadir preset",Color:"Color",CreateGroup:"Crear grupo",CreatePreset:"Crear preset",End:"Fin",EndDescription:"Último LED de este grupo.",Groups:"Grupos",GroupSubTitle:"Comienzo: {start}, Final: {end}",LightGroups:"{name} - Grupos",LightPresets:"{name} - Presets",Miscellaneous:"Varios",Name:"Nombre",NoDevicesFound:"Ningún dispositivo encontrado",NoGroupFound:"Ningún grupo encontrado",NoPresetFound:"Ningún preset encontrado",Presets:"Presets",Start:"Comenzar",StartDescription:"Primer LED de este grupo.",UnableToLoadLight:"No se puede cargar la luz",UnableToLoadPreset:"No se puede cargar el preset"},NavigationTab:{Navigation:"Navegación"},PresetsTab:{AddPreset:"Agregar config. preestablecida",Cooldown:"Enfriamiento",CreateHeadline:"Crear config. preestablecida",CustomGCode:"G-Code personalizado",EditCooldown:"Editar enfriamiento",EditHeadline:"Editar config. preestablecida",ErrorInvalidValue:"Valor invalido",ErrorNameNotUnique:"Nombre ya existente",ErrorNameRequired:"nombre requerido",Name:"Nombre",PreheatPresets:"Precalentamiento",PresetInfo:"Debe configurar como mínimo una temperatura objetivo o un G-code personalizado.",PresetNamePlaceholder:"Nombre preestablecido (requerido)",StoreButton:"Guardar config. preestablecida",UpdateButton:"Actualizar config. preestablecida",UpdateCooldown:"Actualizar enfriamiento"},RemotePrintersTab:{AddPrinter:"Agregar impresora",EditPrinter:"Editar impresora",Hostname:"Nombre del Host",Port:"Puerto",RemotePrinters:"Impresoras remotas",UpdatePrinter:"Actualizar impresora",UseConfigJson:"InstanceDB = JSON detectado. Por favor, utilice el config.json para modificar la lista de impresoras."},Store:"tienda",TimelapseTab:{Autorender:"Autorrenderizado",AutorenderDescription:"Si está activa, el video del timelapse será renderizado automáticamente al finalizar la impresión.",Camera:"Cámara",CameraDescription:"Elija qué cámara será utilizada.",ConstantRateFactor:"Factor de tasa constante",ConstantRateFactorDescription:"Configura la calidad vs. el tamaño del archivo del video renderizado. El rango de la escala de FTC es de 0-51, donde 0 es sin pérdidas, 23 es predeterminado y 51 es la peor calidad posible. Un valor más bajo generalmente conduce a una mayor calidad y un rango subjetivamente sensato es 17-28. Considere que 17 o 18 no tienen pérdida visual. ",duplicatelastframe:"Duplicar último cuadro",duplicatelastframeDescription:"Duplica el ultimo cuadro al final de video.",Enabled:"Activado",EnabledDescription:"Si está desactivado, las macros de G-code son ignoradas y el autorrender es salteado.",Extraoutputparams:"Parámetros adicionales",ExtraoutputparamsDescription:"Defina parámetros adicionales para FFMPEG. Nota: Especificar cualquier dato aquí deshabilita la configuración de rotación.",FwRetract:"Retracción de firmware",FwRetractDescription:"Usar la retracción de firmware en la macro de Timelapse.",GcodeVerbose:"G-code verboso",GcodeVerboseDescription:"Si está activo, las macros de G-Code escribirán información en la consola.",General:"General",HyperlapseCycle:"Tiempo de ciclo Hyperlapse",HyperlapseCycleDescription:"Se tomará una foto cada X segundos.",Mode:"Modo",ModeDescription:"Elija en modo entre LayerMacro e Hyperlape (basado en tiempo).",OutputFramerate:"Framerate",OutputFramerateDescription:"Define los cuadros por segundo del video. Nota: Puede ser ignorado si variable_fps está activado.",Parkhead:"Apartar cabezal",ParkheadDescription:"Si está activado, el cabezal será apartado antes de tomar la foto para el Timelapse.",Parkpos:"Posición donde apartar",ParkposDescription:"Seleccione la posición donde apartar el cabezal.",ParkTime:"Park time",ParkTimeDescription:"Agregue tiempo de inactividad adicional al apartar el cabezal.",Pixelformat:"Formato de pixel",PixelformatDescription:"Define el formato de pixeles del video.",PosDZ:"Posición Z",PosDZDescription:"Posición donde apartar Z (relativa)",PosX:"Posición X",PosXDescription:"Posición donde apartar X (absoluta)",PosY:"Posición Y",PosYDescription:"Posición donde apartar Y (absoluta)",PreviewImage:"Imagen previsualización",PreviewImageDescription:"Guarda una imagen de previsualización con el mismo nombre que el video.",RenderingOptions:"Opciones de renderizado",RetractDistance:"Distancia de retracción",RetractDistanceDescription:"El largo del filamento que el extrusor retrae.",RetractSpeed:"Velocidad de retracción",RetractSpeedDescription:"Velocidad con que el extrusor retrae el filamento.",SaveFrames:"Guardar cuadros",SaveFramesDescription:"Guardar los cuadros como archivo .zip para render externo.",StreamDelayCompensation:"Compensación de retraso de stream",StreamDelayCompensationDescription:"Retraso de captura de cuadros.",Targetlength:"Duración del video",TargetlengthDescription:"Indica la duración del video cuando FPS variable está activado.",TimeFormatCode:"Formato de fecha",TimeFormatCodeDescription:"Define el formato de la fecha en el archivo de salida.",Timelapse:"Timelapse",TravelSpeed:"Velocidad de movimiento",TravelSpeedDescription:"Velocidad del movimiento con que se aparta y retorna el cabezal.",UnretractDistance:"Distancia de post-retracción",UnretractDistanceDescription:"Largo del filamento que el extrusor devuelve al cabezal después de la retracción.",UnretractSpeed:"Velocidad de post-retracción",UnretractSpeedDescription:"Velocidad con la que el extrusor devuelve el filamento después de la retracción.",VariableFps:"FPS Variable",VariableFpsDescription:'Si está activo, los cuadros por segundo del video serán calculado según el "Largo del video".',VariableFpsMax:"FPS Variable máximo",VariableFpsMaxDescription:"",VariableFpsMin:"FPS Variable mínimo",VariableFpsMinDescription:""},UiSettingsTab:{BedScrewsDialog:"Diálogo de tornillos de cama",BedScrewsDialogDescription:"Mostrar diálogo de ayuda para BED_SCREWS_ADJUST.",BoolBigThumbnail:"Miniatura grande",BoolBigThumbnailDescription:"Mostrar una miniatura grande en el panel de estado durante una impresión.",BoolHideUploadAndPrintButton:"Ocultar botón de Subir e Imprimir",BoolHideUploadAndPrintButtonDescription:'Mostrar u ocultar el botón de "Upload and Print" en la barra de arriba',ConfirmOnEmergencyStop:"Requerir confirmación en Parada de Emergencia",ConfirmOnEmergencyStopDescription:"Mostrar un diálogo de confirmación en Parada de Emergencia",ConfirmOnPowerDeviceChange:"Solicitar confirmación para cambios en Alimentación del Dispositivo",ConfirmOnPowerDeviceChangeDescription:"Mostrar un diálogo de confirmación en Alimentación del Dispositivo",DefaultNavigationState:"Estado por defecto de la navegación",DefaultNavigationStateAlwaysClosed:"siempre cerrado",DefaultNavigationStateAlwaysOpen:"siempre abierto",DefaultNavigationStateDescription:"Qué estado debe tener la navegación por defecto.",DefaultNavigationStateLastState:"último estado",DisableFanAnimation:"Desactivar la animación del ventilador",DisableFanAnimationDescription:"Esto puede reducir la carga de su navegador.",DisplayCANCEL_PRINT:"Mostrar CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Muestra el botón CANCEL_PRINT permanentemente - no necesita confirmación de segunda capa.",GcodeThumbnails:"Miniaturas de G-Code",GcodeThumbnailsDescription:"Haga clic en el botón para acceder a las instrucciones.",Guide:"Guía",HideSaveConfigButtonForBedMesh:"Ocultar el botón SAVE_CONFIG para los cambios en bed_mesh",HideSaveConfigButtonForBedMeshDescription:"Ocultar SAVE_CONFIG, si sólo están pendientes de guardar en Klipper los cambios en bed_mesh.",HideUpdateWarnings:"Ocultar avisos de actualización",HideUpdateWarningsDescription:"Esta opción ocultará todos los avisos de actualización en el gestor de actualizaciones.",LockSliders:"Bloquear deslizadores en dispositivos con pantalla táctil",LockSlidersDelay:"Retraso de bloqueo de deslizadores",LockSlidersDelayDescription:"Los deslizadores se bloquearán después de un retardo determinado. Si se establece en 0 o se deja en blanco, los deslizadores sólo se bloquearán al cambiar/recargar la página.",LockSlidersDescription:"Los controles deslizantes de las pantallas táctiles deben desbloquearse antes de permitir cambios.",Logo:"Logo",ManualProbeDialog:"Diálogo Manual del Ayudante de Sonda",ManualProbeDialogDescription:"Mostrar diálogo de ayuda para PROBE_CALIBRATE o Z_ENDSTOP_CALIBRATE.",NavigationStyle:"Estilo de Navegación",NavigationStyleDescription:"Modificar el aspecto de la navegación",NavigationStyleIconsAndText:"Iconos + Texto",NavigationStyleIconsOnly:"Solo Iconos",PowerDeviceName:"Dispositivo de alimentación de la impresora",PowerDeviceNameDescription:"Seleccione qué dispositivo de alimentación Moonraker debe utilizarse para encender la impresora.",Primary:"Primario",ScrewsTiltAdjustDialog:"Diálogo de Ajuste de Inclinación de los Tornillos",ScrewsTiltAdjustDialogDescription:"Mostrar diálogo de ayuda para SCREWS_TILT_CALCULATE.",TempchartHeight:"Gráfico de Temperaturas de Altura",TempchartHeightDescription:"Modifica la altura del gráfico de temperatura en el Cuadro De Mandos.",UiSettings:"Ajustes de UI"},Update:"actualizar",WebcamsTab:{AddWebcam:"Agregar cámara web",CreateWebcam:"Crear cámara web",EditCrowsnestConf:"Editar crowsnest.conf",EditWebcam:"Editar cámara web",FlipWebcam:"Voltear la imagen de la cámara web:",HideFps:"Ocultar contador de FPS",Hlsstream:"Stream HLS",Horizontally:"horizontalmente",IconBed:"Cama",IconCam:"Cámara",IconDoor:"Puerta",IconFilament:"Filamento",IconHot:"Caliente",IconMcu:"MCU",IconNozzle:"Boquilla",IconPrinter:"Impresora",Ipstream:"Cámara IP",JMuxerStream:"stream h264 crudo (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"MJPEG-Streamer Adaptativo (experimental)",Name:"Nombre",NameAlreadyExists:"El nombre ya existe",Required:"Requerido",Rotate:"rotar",SaveWebcam:"Guardar cámara web",Service:"Servicio",TargetFPS:"FPS Objetivo",UpdateWebcam:"Actualizar cámara web",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"verticalmente",Webcams:"Cámaras web",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX / rtsp-simple-server)"}},T={AllFiles:"Todos",Autorender:"Autorrenderizado",Cancel:"Cancelar",Create:"Crear",CreateNewDirectory:"Crear directorio",CurrentPath:"Ruta actual",Delete:"Eliminar",DeleteDirectory:"Eliminar directorio",DeleteDirectoryQuestion:'¿Está seguro de que desea eliminar la carpeta "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Realmente quieres borrar {count} archivos selecionados?",DeleteSingleFileQuestion:'¿Realmente quieres borrar el archivo "{name}"?',Download:"Descargar",DuplicateLastframe:"Duplicar último cuadro",Empty:"No se encontró Timelapse finalizado.",Enabled:"Activada",EstimatedLength:"Longitud estimada",Files:"Archivos",Filesize:"Tamaño del archivo",Fixed:"Fijo",Framerate:"Cuadros por segundo",Frames:"Cuadros",Free:"Libre",FreeDisk:"Espacio libre en el disco",LastModified:"Ultima modificación",MaxFramerate:"Máx. Cuadros por segundo",MinFramerate:"Mín. Cuadros por segundo",Name:"Nombre",NewDirectory:"Nuevo directorio",NoActiveTimelapse:"Sin registros disponibles.",Preview:"Previsualizar",RefreshCurrentDirectory:"Actualizar directorio",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",Render:"Renderizar",RenderSettings:"Configuración Render",SaveFrames:"Guardar cuadros",Search:"Buscar",StartRender:"Iniciar render",Status:"Estado",TargetFps:"Objetivo FPS",Targetlength:"Longitud objetivo",TimelapseFiles:"Archivo Timelapse",TimelapseRendering:"Renderizando Timelapse",TimelapseRenderingSuccessful:"Timelapse renderizado con éxito",Total:"Total",Type:"Tipo",Used:"Usado",Variable:"Variable",Video:"Video"},E="Español",h={App:e,BedScrews:a,ConnectionDialog:r,Console:o,Dialogs:i,Editor:t,EmergencyStopDialog:n,Files:s,FullscreenUpload:l,GCodeViewer:c,Heightmap:d,History:m,JobQueue:u,Machine:p,ManualProbe:g,Panels:C,PowerDeviceChangeDialog:b,Router:v,ScrewsTiltAdjust:f,SelectPrinterDialog:D,Settings:S,Timelapse:T,title:E};export{e as App,a as BedScrews,r as ConnectionDialog,o as Console,i as Dialogs,t as Editor,n as EmergencyStopDialog,s as Files,l as FullscreenUpload,c as GCodeViewer,d as Heightmap,m as History,u as JobQueue,p as Machine,g as ManualProbe,C as Panels,b as PowerDeviceChangeDialog,v as Router,f as ScrewsTiltAdjust,D as SelectPrinterDialog,S as Settings,T as Timelapse,h as default,E as title}; diff --git a/dirs/mainsail/assets/fr-ab90ab77.js b/dirs/mainsail/assets/fr-ab90ab77.js deleted file mode 100644 index c387b0c..0000000 --- a/dirs/mainsail/assets/fr-ab90ab77.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{BrowserWarnings:{Description:"{name} est obsolète et n'est pas entièrement pris en charge. La version actuelle est {version}, mais Mainsail requiert la version {minVersion} ou une version supérieure.",Headline:"Navigateur obsolète"},DependencyDescription:"La version actuelle de {name} ne supporte pas toutes les fonctionnalités de Mainsail. Mettez {name} à jour vers la version {neededVersion}.",DependencyName:"Dépendance: {name}",DismissAll:"Annuler tout",KlipperWarnings:{DeprecatedOption:"L'option '{option}' dans la section '{section}' est obsolète et sera supprimée dans une prochaine version.",DeprecatedOptionHeadline:"Option Klipper obsolète",DeprecatedValue:"La valeur '{value}' dans l'option '{option}' de la section '{section}' est obsolète et sera supprimée dans une prochaine version.",DeprecatedValueHeadline:"Valeur d'une option Klipper obsolète",KlipperWarning:"Avertissement Klipper"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Une erreur a été détectée lors du chargement du composant moonraker '{component}'. Veuillez vérifier le fichier log et corriger le problème.",MoonrakerWarning:"Avertissement Moonraker",UnparsedConfigOption:"Option de configuration non analysée '{option} : {value}' détectée dans la section [{section}]. Il peut s'agir d'une option qui n'est plus disponible ou d'un module dont le chargement a échoué. À l'avenir, cela se traduira par une erreur de démarrage.",UnparsedConfigSection:"Section de configuration non analysée [{section}] détectée. Cela peut être le résultat d'un composant qui n'a pas réussi à se charger. À l'avenir, cela se traduira par une erreur de démarrage."},Never:"jamais",NextReboot:"prochain redémarrage",NoNotification:"Pas de notification disponible",Notifications:"Notifications",Remind:"Rappel:"},NumberInput:{GreaterOrEqualError:"Doit être supérieur ou égal à {min}!",MustBeBetweenError:"Doit être compris entre {min} et {max}!",NoEmptyAllowedError:"L'entrée ne doit pas être vide !"},Printers:"Imprimantes",TheServiceWorker:{DescriptionNeedUpdate:"Le cache local est obsolète et doit être mis à jour. Veuillez cliquer sur le bouton ci-dessous pour mettre à jour le cache.",TitleNeedUpdate:"PWA a besoin d'une mise à jour",Update:"mise à jour"},ThrottledStates:{DescriptionCurrentlyThrottled:"Le(s) coeur(s) du rPi ARM est (sont) actuellement bridé(s).",DescriptionFrequencyCapped:"La fréquence maximale du rPi ARM est actuellement limitée à 1,2 GHz.",DescriptionPreviouslyFrequencyCapped:"La fréquence maximale du rPi ARM a été limitée au moins une fois à 1,2 GHz depuis la dernière mise sous tension.",DescriptionPreviouslyTemperatureLimited:"La température du rPi uC (3A+/3B+ uniquement) a dépassé au moins une fois la limite souple (par défaut 60C) depuis la dernière mise sous tension.",DescriptionPreviouslyThrottled:"Le(s) coeur(s) du rPi ARM a(ont) été ralenti(s) au moins une fois depuis la dernière mise sous tension.",DescriptionPreviouslyUnderVolted:"La tension d'alimentation du rPi a chuté en dessous de 4,65 V au moins une fois depuis la dernière mise sous tension.",DescriptionTemperatureLimitActive:"La température du rPi uC (3A+/3B+ uniquement) est actuellement supérieure à la limite souple (60C par défaut).",DescriptionUnderVoltageDetected:"Tension d'alimentation du rPi actuellement inférieure à 4,65V",TitleCurrentlyThrottled:"actuellement en mode réduit",TitleFrequencyCapped:"fréquence réduite",TitlePreviouslyFrequencyCapped:"a été limité en fréquence",TitlePreviouslyTemperatureLimited:"a été limité par la température",TitlePreviouslyThrottled:"Précédemment fréquence réduite",TitlePreviouslyUnderVolted:"précédemment alimentation faible",TitleTemperatureLimitActive:"Limite de température active",TitleUnderVoltageDetected:"Alimentation faible détectée"},Titles:{Complete:"Terminé - {filename}",Error:"ERREUR",Pause:"Pause impression",PrinterOff:"Imprimante OFF",Printing:"{percent}% imprimé - {filename}",PrintingETA:"{percent}% imprimé - TEA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Chargement du fichier impossible!",EmergencyStop:"Arrêt d'urgence",SAVE_CONFIG:"Sauvegarde de la configuration",Uploading:"Chargement",UploadOfFileSuccessful:"le fichier {file} a été chargé!",UploadPrint:"Charger et imprimer"},TopCornerMenu:{Cancel:"Annuler",ConfirmationDialog:{Description:{HostReboot:"Le redémarrage de l'hôte entraînera l'échec de l'impression en cours!",HostShutdown:"L'arrêt de l'hôte entraînera l'échec de l'impression en cours!",KlipperFirmwareRestart:"Le redémarrage du micrologiciel Klipper entraînera l'échec de l'impression en cours!",KlipperRestart:"Le redémarrage de Klipper entraînera l'échec de l'impression en cours!",KlipperStop:"L'arrêt de Klipper entraînera l'échec de l'impression en cours!",ServiceRestart:"Le redémarrage de ce service peut entraîner l'échec de l'impression en cours!",ServiceStart:"Le démarrage de ce service peut entraîner l'échec de l'impression en cours!",ServiceStop:"L'arrêt de ce service peut entraîner l'échec de l'impression en cours!"},Title:{HostReboot:"Redémarrage de l'hôte",HostShutdown:"Fermeture de l'hôte",KlipperFirmwareRestart:"Redémarrage du firmware Klipper",KlipperRestart:"Redémarrage de Klipper",ServiceRestart:"Redémarrage du Service",ServiceStart:"Démarrage du Service",ServiceStop:"Arrêt du Service"}},HostControl:"Contrôle de l'hôte",KlipperControl:"Contrôle de klipper",KlipperFirmwareRestart:"Redémarrage du firmware",KlipperRestart:"Redémarrage",PowerDevices:"Modules d'alimentation",Reboot:"Redémarrer",Restart:"Redémarrage",ServiceControl:"Contrôle des services",Shutdown:"Arrêt",Start:"Démarrage",Stop:"Arrêter"},UpdateDialog:{Close:"Fermer",Empty:"Vide",Recovering:"Récupération {software}...",RecoveringDone:"Récupération {software} effectuée!",Updating:"Mise à jour {software}...",UpdatingDone:"Mise à jour {software} effectuée!"}},r={Abort:"annuler",Accept:"accepter",Adjusted:"ajusté",Description:"Cliquez sur Ajusté si la vis courante a été ajustée. Cliquez sur Accepter pour continuer sans ajustement.",Headline:"Vis du plateau",ScrewAccepted:"Vis acceptées",ScrewIndex:"Index des vis",ScrewName:"Nom de la vis",ScrewOutput:"{current} de {max}"},i={CannotConnectTo:"Impossible de se connecter à Moonraker ({host}).",CheckMoonrakerLog:"Si ce message apparaît de manière répétée, veuillez consulter le fichier log situé à l'adresse suivante:",Connecting:"Se connecter à {host}",Failed:"Échec de la connexion",Initializing:"Initialisation",TryAgain:"Réessayez"},t={CommandList:"Liste des commandes",Empty:"Vide",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",SendCode:"Envoyer le code...",SetupConsole:"Configuration console"},a={StartPrint:{Cancel:"Annuler",DoYouWantToStartFilename:"Voulez-vous commencer {filename}?",DoYouWantToStartFilenameFilament:"Voulez-vous démarrer {filename} avec le filament suivant?",Headline:"Démarrage Impression",Print:"imprimer",Timelapse:"Timelapse"}},n={ConfigReference:"Référence de la configuration",DontSave:"Ne pas sauvegarder",Downloading:"Téléchargement",FailedSave:"{filename} n'a pas pu être téléchargé!",FileReadOnly:"lecture seule",SaveClose:"Enregistrer et fermer",SaveRestart:"Sauvegarder et Redémarrer",SuccessfullySaved:"{filename} sauvegardé avec succès.",UnsavedChanges:"Modifications non sauvegardées",UnsavedChangesMessage:"Souhaitez-vous enregistrer les modifications apportées à {filename}?",UnsavedChangesSubMessage:"Vos modifications seront perdues si vous ne les enregistrez pas. Vous pouvez désactiver ce message dans les paramètres de l'éditeur.",Uploading:"Chargement"},o={AreYouSure:"Êtes-vous sûr?",EmergencyStop:"Arrêt d'urgence",No:"Non",Yes:"Oui"},s={AddBatchToQueue:"Ajouter un lot à la file d'attente",AddToQueue:"Ajouter à la file d'attente",AllFiles:"Tous",BedTemp:"Température plateau",Cancel:"Annuler",ChamberTemp:"Température chambre",Count:"Nombre",Create:"Créer",CreateNewDirectory:"Créer un nouveau répertoire",CurrentPath:"Répertoire actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Voulez-vous vraiment supprimer "{name}" avec tout son contenu?',DeleteSelectedQuestion:"Voulez-vous vraiment supprimer les {count} fichiers sélectionnés ?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",Duplicate:"Dupliquer",DuplicateFile:"Fichiers en double",EditFile:"Editer le fichier",Empty:"Vide",ExtruderTemp:"Température Extrudeur",Filament:"Filament",FilamentName:"Nom du filament",FilamentType:"Type de filament",FilamentUsage:"Utilisation du filament",FilamentWeight:"Poids du filament",Files:"Fichiers",Filesize:"Taille du fichier",Free:"Gratuit",FreeDisk:"Disque libre",GCodeFiles:"Fichiers G-Code",GcodesRootDirectoryDoesntExists:"Aucun répertoire G-Code n'a été trouvé. Veuillez vérifier l'option \"path\" dans la section [virtual_sdcard] de la configuration de Klipper.",HiddenFiles:"Fichiers cachés",InvalidNameAlreadyExists:"Le nom existe déjà, veuillez choisir un autre nom.",InvalidNameEmpty:"L'entrée ne doit pas être vide!",LastEndTime:"Dernière heure de fin",LastFilamentUsed:"Dernier filament utilisé",LastModified:"Dernière modification",LastPrintDuration:"Durée de la dernière impression",LastStartTime:"Dernière heure de début",LastTotalDuration:"Dernière Durée totale",LayerHeight:"Hauteur de la couche",Name:"Nom",NewDirectory:"Nouveau répertoire",NozzleDiameter:"Diamètre de la buse",ObjectHeight:"Hauteur de l'objet",Preheat:"Préchauffage",PrintedFiles:"Fichiers imprimés",PrintStart:"Début de l'impression",PrintTime:"Temps d'impression",RefreshCurrentDirectory:"Actualiser le répertoire actuel",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer un fichier",ScanMeta:"Scanner les métadonnées",ScanMetaSuccess:"L'analyse des métadonnées a été effectuée avec succès à partir de: {filename}.",Search:"Recherche",SetupCurrentList:"Configuration de la liste actuelle",Slicer:"Trancheur",SuccessfullyCreated:"{filename} créé avec succès.",SuccessfullyDeleted:"Suppression de {filename} réussie.",SuccessfullyMoved:"Déplacement réussi de {filename}.",SuccessfullyRenamed:"{filename} renommé avec succès.",SuccessfullyUploaded:"Chargement de {filename} réussi!",Total:"Total",UploadNewGcode:"Charger un nouveau G-Code",Used:"Utilisé",View3D:"Vue 3D"},l={CannotUploadFile:"Impossible de télécharger le fichier!",DropFilesToUploadFiles:"Déposer des fichiers à télécharger"},u={ClearLoadedFile:"Effacer",CNCMode:"Mode CNC",ColorMode:"Mode couleur",Downloading:"Téléchargement",ForceLineRendering:"Rendu de la ligne de force",HDRendering:"Rendu HD (Extrusions rondes)",High:"Haut",LoadCurrentFile:"Charge le fichier courant",LoadLocal:"Fichier local",Low:"Faible",Max:"Max",Medium:"Moyen",ReloadRequired:"Recharge nécessaire",Rendering:"Rendu",RenderQuality:"Qualité du rendu",ShowGCode:"Afficher le G-Code",ShowObjectSelection:"Afficher la sélection d'objets",ShowToolhead:"Afficher la tête d'outil",ShowTravelMoves:"Montrer les déplacements",SpecularLighting:"Éclairage spéculaire",Title:"Visionneuse G-Code",Tracking:"Suivi",Transparency:"Transparence",Ultra:"Ultra",VoxelMode:"Mode Voxel (ASMBL)"},d={Abort:"annuler",BedMeshCalibrate:"Calibrage du maillage",BedMeshRemove:"Supprimer le maillage",Calibrate:"calibrer",Clear:"Effacer",CurrentMesh:{Headline:"Maillage actuel",Max:"Max",Min:"Min",Name:"Nom",Range:"Gamme",Size:"Taille"},DeleteBedMeshProfile:"Supprimer le profil du maillage",DoYouReallyWantToDelete:'Voulez-vous vraiment supprimer le profil "{name}"?',ErrorKlipperNotReady:"Klipper n'est pas prêt. Maillage désactivé.",Flat:"Plat",Heightmap:"Maillage",InvalidNameAlreadyExists:"Le nom du profil existe déjà, veuillez choisir un autre nom de profil.",InvalidNameAscii:"Le nom n'est pas valide. Seuls les caractères ascii sont autorisés.",InvalidNameEmpty:"L'entrée ne doit pas être vide!",InvalidNameReserved:"Le profil 'par défaut' est réservé, veuillez choisir un autre nom de profil.",Later:"Plus tard",Mesh:"Calculé",Name:"Nom",NoBedMeshHasBeenLoadedYet:"Aucun maillage chargé",NoProfile:"Pas de profil disponible",Ok:"OK",Probed:"Mesuré",Profiles:"Profils",Remove:"supprimer",RemoveSaveDescription:"Le maillage a été enregistré comme supprimé. Cliquez sur SAVE_CONFIG pour le retirer du fichier printer.cfg et redémarrez Klipper.",Rename:"renommer",RenameBedMeshProfile:"Renommer le maillage",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Facteur d'échelle",ScaleZMax:"Maximum axe Z.",TitleCalibrate:"Calibrage du nouveau maillage",TitleClear:"Effacer maillage",TitleHomeAll:"Réf. tous",Wireframe:"Maillage"},c={AddNote:"Ajouter une note",AllJobs:"Tous",AvgPrinttime:"Temps d'impression - Ø",Cancel:"Annuler",Chart:"Graphique",CreateNote:"Créer une note",Delete:"Supprimer",DeleteSelectedQuestion:"Voulez-vous vraiment effacer {count} travaux?",DeleteSingleJobQuestion:"Voulez vous vraimetn supprimer le travail?",Details:"Détails",EditNote:"Editer la Note",Empty:"vide",EndTime:"Heure de fin",EstimatedFilament:"Estimation de la longueur du filament",EstimatedFilamentWeight:"Estimation du poids du filament",EstimatedTime:"Estimation de la durée d'impression",FilamentCalc:"Filament Calculé",FilamentUsage:"Filament Consommé",FilamentUsed:"Filament Utilisé",Filename:"Fichier",Filesize:"Taille",FirstLayerBedTemp:"Temp. plateau 1ère couche",FirstLayerExtTemp:"Temp. extrudeur 1ère couche",FirstLayerHeight:"Hauteur 1ère couche",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Impressions",JobDetails:"Détails impression",Jobs:"Travaux",LastModified:"Dernière modification",LayerHeight:"Hauteur de la couche",LongestPrinttime:"Temps d'impression le plus long",Note:"Note",ObjectHeight:"Hauteur de l'objet",PrintDuration:"Temps d'impression",PrintHistory:"Historique d'impression",PrintTime:"Durée d'impression",PrinttimeAvg:"Temps moyen d'impression",Reprint:"Réimpression",Save:"sauvegarder",Search:"recherche",SelectedFilamentUsed:"Filament sélectionné utilisé",SelectedJobs:"Travaux sélectionnés",SelectedPrinttime:"Temps d'impression sélectionné",Slicer:"Trancheur",SlicerVersion:"Version slicer",StartTime:"Heure de début",Statistics:"Statistiques",Status:"Statut",StatusValues:{cancelled:"Annulé",completed:"Terminé",error:"Erreur",in_progress:"En cours",klippy_disconnect:"Déconnexion de Klippy",klippy_shutdown:"Arrêt Klippy",Others:"Autres",server_exit:"Sortie du serveur"},Table:"Table",TitleExportHistory:"Exporter l'historique",TitleRefreshHistory:"Rafraîchir l'historique",TitleSettings:"Paramètres",TotalDuration:"Durée totale",TotalFilamentUsed:"Total du filament utilisé",TotalJobs:"Nombre travaux",TotalPrinttime:"Total temps d'impression",TotalTime:"Durée totale"},m={AllJobs:"Tous",Cancel:"Annuler",ChangeCount:"Nombre de changements",Count:"Nombre",Empty:"Vide",InvalidCountEmpty:"L'entrée ne doit pas être vide!",InvalidCountGreaterZero:"L'entrée doit être supérieure à 0!",JobQueue:"File d'attente",Jobs:"Jobs",Pause:"Pause",RemoveFromQueue:"Retirer de la file d'attente",Start:"Démarrage"},p={ConfigFilesPanel:{AllFiles:"Tous",Cancel:"Annuler",ConfigFiles:"Fichiers de configuration",ConfigRootDirectoryDoesntExists:"Aucun répertoire de configuration n'a été trouvé. Veuillez vérifier l'option \"config_path\" dans la section [file_manager] de la configuration de Moonraker.",Create:"Créer",CreateDirectory:"Créer un répertoire",CreateFile:"Créer un fichier",CurrentPath:"Chemin actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Supprimer le répertoire "{name}" et tout son contenu?',DeleteSelectedQuestion:"Supprimer les {count} élements sélectionnés?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",Duplicate:"Dupliquer",DuplicateFile:"Fichiers en double",EditFile:"Editer le fichier",Empty:"Vide",Files:"Fichiers",Filesize:"Taille des fichiers",Free:"Libre",FreeDisk:"Disque libre",HiddenFiles:"Fichiers cachés",HideBackupFiles:"Cacher les fichiers de sauvegarde",LastModified:"Dernière modification",Name:"Nom",RefreshDirectory:"Actualiser le répertoire",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer un fichier",Root:"Racine",SetupCurrentList:"Configuration de la liste actuelle",ShowFile:"Afficher le fichier",Total:"Total",UploadFile:"Charger le fichier",Uploading:"Chargement",Used:"Utilisé"},EndstopPanel:{Endstop:"Fin de course",EndstopInfo:"Appuyez sur le bouton de synchronisation en bas à droite pour charger l'état actuel des fins de course.",Endstops:"Fins de course",open:"inactif",TRIGGERED:"actif"},LogfilesPanel:{Accept:"accepter",Cancel:"annuler",Logfiles:"Fichiers logs",Rollover:"Logs glissants",RolloverDescription:"Veuillez sélectionner les logs à réinitialiser:",RolloverToastFailed:'Message du log "{name}": {message}',RolloverToastSuccessful:'Le log "{name}" a été réinitialisé avec succès.'},SystemPanel:{Constants:"Constantes",Cpu:"CPU",HostDetails:"Détails hôte",LastStats:"Dernières statistiques",Load:"Chargement",Memory:"Mémoire",NoMoreInfos:"Pas d'infos supplémentaires",SystemLoad:"Charge Système",Values:{Awake:"Eveillé: {awake}",Bandwidth:"Bande passante: {bandwidth}/s",Distro:"Distribution: {name} {version_id}",Frequency:"Fréquence: {frequency}",Load:"Chargement: {load}",Memory:"Mémoire: {memory}",Os:"OS: {os}",Received:"Reçu: {received}",Temp:"Température: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmis: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abandonner",AreYouSure:"Êtes-vous sûr?",CheckForUpdates:"Vérifier les mises à jour",Close:"Fermer",CommitHistory:"Historique des publications",Commits:"Publications",CommitsAvailable:"pas de publications disponibles | {count} publication disponible | {count} publications disponibles",CommitsOnDate:"Publications le {date}",CommittedDaysAgo:"publié {days} jours avant",CommittedHoursAgo:"publié {hours} heures avant",CommittedOnDate:"publié le {date}",CommittedYesterday:"publié hier",ConfigChanges:"Changements de configuration",Corrupt:"corrompu",CountPackagesCanBeUpgraded:"{count} paquets peuvent être mis à jour",Detached:"détaché",Dirty:"différent",GenericUpdateQuestion:"Vérifiez l'historique des publications (s'il est disponible) et la page GitHub de ce projet pour voir si des ajustements manuels sont nécessaires pour cette mise à jour.",GitHubPage:"Page GitHub",HardRecovery:"Récupération difficile",InitUpdateManager:"Le gestionnaire de mise à jour n'a pas encore été initialisé. C'est normal lorsque vous démarrez le système pour la première fois. Veuillez cliquer sur le bouton d'actualisation pour initialiser tous les composants.",Invalid:"invalide",IUnderstandTheRisks:"Je comprends les risques",KlipperUpdateQuestionConfig:"Cette mise à jour peut également contenir des changements dans les paramètres de configuration qui devront être modifiés dans le fichier printer.cfg, voir le journal des changements pour plus de détails.",KlipperUpdateQuestionFirmware:"Cette opération met à jour le logiciel hôte de Klipper. Les cartes de contrôle fonctionnant avec le micrologiciel Klipper peuvent avoir besoin d'être flashées avec un micrologiciel recompilé avant que la machine ne puisse être remise en service.",LinkToGithub:"Lien vers GitHub",MoonrakerUpdateQuestion:"Cette opération met à jour l'API Moonraker. Des modifications du fichier moonraker.conf peuvent être nécessaires pour continuer à utiliser la machine.",MoreCommitsInfo:"Un maximum de 30 publications peuvent être affichées ici. Pour voir toutes les publications, veuillez cliquer sur le lien suivant:",OSPackages:"Paquets OS",SoftRecovery:"Récupération douce",StartUpdate:"Démarrer la mise à jour",System:"Système",ThesePackagesCanBeUpgrade:"Ces paquets système peuvent être mis à jour:",Unknown:"inconnue",Update:"mise à jour",UpdateAll:"Mise à jour de tous les composants",UpdateManager:"Gestionnaire de mise à jour",UpdateWarning:"Avertissement de mise à jour: {name}",Upgrade:"mise à niveau",UpgradeableSystemPackages:"Packs de systèmes évolutifs",UpToDate:"à jour",WebClientUpdateQuestion:"Dans certains cas, la mise à jour du client web peut entraîner des modifications susceptibles de provoquer une incompatibilité. Voir les notes de version pour plus d'informations."}},g={Abort:"annuler",Accept:"accepter",Advanced:"Avancé",Headline:"Sonde manuelle"},f={ExtruderControlPanel:{Allowed:"Autorisé",CleanNozzle:"Nettoyage de la buse",EstimatedExtrusion:"Extrusion:",Extrude:"Extrusion",ExtruderTempTooLow:"Température d'extrusion trop basse",ExtrusionFactor:"Facteur d'extrusion",ExtrusionFeedrate:"Vitesse d'extrusion",FilamentLength:"Longueur du filament",FirmwareRetractionSettings:{RetractLength:"Longueur de rétraction",RetractSpeed:"Vitesse de rétraction",UnretractExtraLength:"Distance de dérétraction supplémentaire",UnretractSpeed:"Vitesse de dérétraction"},Headline:"Contrôles d'Extrudeur",LoadFilament:"Chargement du filament",PressureAdvanceSettings:{Advance:"Avance de la pression",Extruder:"Extrudeur",SmoothTime:"Temps de lissage"},PurgeFilament:"Purge du filament",Requested:"Demandé",Retract:"Rétraction",TooLargeExtrusion:"Extrusion trop importante!",UnloadFilament:"Décharger le filament"},FarmPrinterPanel:{ReconnectToPrinter:"Se reconnecter",SwitchToPrinter:"Changer d'imprimante",WebcamOff:"Arrêt"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Veuillez vérifier que le service Klipper fonctionne et que l'adresse klippy_uds_address est correctement configurée dans le fichier moonraker.conf..",FirmwareRestart:"Redémarrage du firmware",MoonrakerCannotConnect:"Moonraker ne peut pas se connecter à Klipper!",PowerOn:"Mise sous tension",PrinterSwitchedOff:"L'imprimante est hors tension",PrinterSwitchedOffDescription:"L'imprimante est actuellement hors tension et Klipper ne peut pas se connecter. Pour mettre l'imprimante sous tension, cliquez sur le bouton ci-dessous:",Restart:"Redémarrage",ServiceReports:"rapports de {service}"},MachineSettingsPanel:{Headline:"Réglages machine",MotionSettings:{Acceleration:"Accélération",MaxAccelToDecel:"Décélération maximale",SquareCornerVelocity:"Vitesse des angles droits",Velocity:"Vitesse"}},MacrosPanel:{Headline:"Macros",Send:"envoyer"},MiniconsolePanel:{Autoscroll:"Défilement automatique",Headline:"Console",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",SendCode:"Envoyer le code...",SetupConsole:"Réglage Console"},MinSettingsPanel:{IncludeMainsailCfg:"Veillez à inclure le fichier mainsail.cfg dans votre fichier printer.cfg.",IsNotDefinedInConfig:"n'est pas défini dans la configuration.",MissingConfiguration:"Configuration manquante",MoreInformation:"Plus d'informations"},MiscellaneousPanel:{Headline:"Divers",Light:{Blue:"bleu",Green:"vert",Red:"rouge",White:"blanc"},RunoutSensor:{Detected:"détecté",Disabled:"inactif",Empty:"Vide"}},PowerControlPanel:{Error:"Erreur",Off:"Arrêt",On:"Marche",PowerControl:"Alimentation"},SpoolmanPanel:{Cancel:"Annuler",ChangeSpool:"Changer de bobine",DaysAgo:"{days} jours avant",EjectSpool:"Ejecter la bobine",EjectSpoolQuestion:"Êtes-vous sûr de vouloir éjecter la bobine de filament?",Filament:"Filament",FilamentTypeMismatch:"Le matériau de la bobine active ({spoolType}) ne correspond pas au matériau du G-Code ({fileType}).",Headline:"Spoolman",LastUsed:"Dernière utilisation",Location:"Localisation",Material:"Matériau",Never:"Jamais",NoActiveSpool:"Le suivi du filament est inactif. Pour commencer, veuillez sélectionner une bobine.",NoResults:"Aucune bobine n'a été trouvée avec les critères de recherche actuels.",NoSpools:"Pas de bobines disponibles",NoSpoolSelected:"Aucune bobine sélectionnée. Veuillez sélectionner une bobine ou cette impression ne sera pas suivie.",OpenSpoolManager:"ouvrir le gestionnaire de bobines",Refresh:"rafraîchir",Search:"Recherche",SelectSpool:"Sélectionner une bobine",Today:"Aujourd'hui",TooLessFilament:"Il se peut que la bobine actuelle ne contienne pas assez de filament pour cette impression. ({spoolWeight}g pour {fileWeight}g)",Weight:"Poids",Yesterday:"Hier"},StatusPanel:{CancelPrint:"Annuler l'impression",ClearPrintStats:"Effacer les statistiques d'impression",Difference:"Différence",EmptyGcodes:"Pas de G-Codes disponibles.",EmptyJobqueue:"Il n'y a actuellement aucun fichier dans la file d'attente.",Estimate:"Estimation",ETA:"TEA",ExcludeObject:{Cancel:"annuler",Excluded:"Exclus",ExcludeObject:"Exclure un objet",ExcludeObjectHeadline:"Exclure un objet",ExcludeObjectText:'Voulez-vous vraiment exclure "{name}"?'},Filament:"Filament",File:"Fichier",Files:"Fichiers",Flow:"Débit",Headline:"Statut",Jobqueue:"File d'attente",JobqueueMoreFiles:"pas de travaux | un travail | {count} travaux",Layer:"Couche",Max:"max",ObjectHeight:"Hauteur de l'objet",PauseAtLayer:{Abort:"annuler",Accept:"accepter",AtLayer:"à la couche",Call:"Appeler",DescriptionPauseAtLayerActive:"Cette fonction est déjà active et appellera '{call}' à la couche {layer}. Si vous appelez à nouveau la commande, ces paramètres seront écrasés.",DescriptionPauseNextLayerActive:"Cette fonction est déjà active et appellera '{call}' à la couche suivante.",Layer:"Couche",NextLayer:"Couche suivante",PauseAtLayer:"Pause à la couche",Type:"Type"},PausePrint:"Pause de l'impression",Print:"Imprimer",PrintTime:"Temps d'impression",ReprintJob:"Réimpression",Requested:"Requis",ResumePrint:"Reprendre l'impression",Slicer:"Trancheur",Speed:"Vitesse",Status:"Statut",Total:"Total",Unknown:"Inconnu"},TemperaturePanel:{AutoscaleChart:"Echelle automatique",Avg:"Moyenne",Cooldown:"Refroidissement",Current:"Actuel",Dataset:{Power:"Puissance-PWM",Speed:"Vitesse-PWM",Target:"température cible",Temperature:"température actuelle"},Headline:"Températures",HideMcuHostSensors:"Cacher les capteurs hôte/MCU",HideMonitors:"Cacher les moniteurs",Max:"max",Min:"min",Name:"Nom",Presets:"Préréglages",SetupTemperatures:"Réglages Températures",ShowChart:"Afficher graphique",ShowNameInChart:"Afficher {name} dans le graphique",ShowNameInList:"Afficher {name} dans la liste",State:"État",Target:"Cible",TemperaturesInChart:"Température [°C]",TempTooHigh:"Température trop élevée pour {name}! (max: {max})",TempTooLow:"Température trop basse pour {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absolue",ALL:"Tous",ControlButtons:"Boutons de commande",CoordinateFields:"Champs de coordonnées",Headline:"Tête d'impression",PleaseConfigureSteps:"Veuillez configurer les Pas",Position:"Position",PositionOutput:"Position de sortie",QGL:"QGL",Relative:"relative",SettingsInterfaceControl:"Réglages > Interface > Contrôle",SpeedFactor:"Facteur de vitesse",ZOffset:"Offset Z",ZTilt:"Z-Tilt"},WebcamPanel:{All:"Tous",FPS:"IPS",Headline:"Caméra",NoWebcam:'Aucune webcam n\'est disponible. Ajouter une webcam sous "Réglages interface" -> "Caméras".',UnknownWebcamService:"Service Caméra inconnu"},ZoffsetPanel:{Clear:"Effacer",Headline:"Offset Z",Later:"Plus tard",Ok:"OK",Save:"Sauvegarder",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'Le nouveau décalage Z a été calculé et enregistré. Cliquez sur "SAVE CONFIG" pour l\'enregistrer dans le fichier printer.cfg et redémarrer Klipper.',SaveInfoDescriptionPrint:"Le nouveau décalage Z a été calculé et enregistré. Après l'impression, cliquez sur \"SAVE CONFIG\" dans la barre supérieure pour l'enregistrer dans le fichier printer.cfg et redémarrer Klipper.",SaveInfoHeadline:"Information"}},v={AreYouSure:"Êtes-vous sûr?",No:"Non",TurnDeviceOff:"Arrêter {device}",TurnDeviceOn:"Mettre en marche {device}",Yes:"Oui"},h={Console:"Console",Dashboard:"Tableau de bord","G-Code Files":"Fichiers G-Code","G-Code Viewer":"Visionneuse G-Code",Heightmap:"Maillage",History:"Historique",Machine:"Machine",Printers:"Imprimantes",Timelapse:"Timelapse",Webcam:"Caméra"},C={Accept:"accepter",Base:"Base",ErrorText:"Un problème s'est produit au cours du processus de sondage.",Headline:"Ajustement de niveau par vis",Retry:"réessayer"},S={AddPrinter:"Ajouter une imprimante",AddPrintersToJson:"Veuillez ajouter les imprimantes au fichier config.json.",CannotConnectTo:"Impossible de se connecter à {host}.",ChangePrinter:"Changer d'imprimante",Connecting:"Se connecter à {host}",ConnectionFailed:"Échec de la connexion",EditPrinter:"Editer l'imprimante",Hello:"Bonjour et bienvenue dans le mode à distance de Mainsail!",HostnameInvalid:"nom d'hôte/IP non valide",HostnameIp:"Nom d'hôte/IP",HostnameRequired:"Le nom d'hôte est requis",Port:"Port",PortRequired:"Le port est nécessaire",RememberToAdd:"N'oubliez pas d'ajouter '{cors}' dans moonraker.conf à l'intérieur de 'cors_domains'.",SelectPrinter:"Sélectionner l'imprimante",TryAgain:"Réessayez",UpdatePrinter:"Mise à jour de l'imprimante",YouCanFindMore:"Vous trouverez plus d'informations à l'adresse suivante"},D={Cancel:"Annuler",Close:"Fermer",ConsoleTab:{AddFilter:"ajouter un filtre",Console:"Console",CreateHeadline:"Créer un filtre",Direction:"Direction",DirectionShell:"Défilement de bas en haut",DirectionTable:"Défilement de haut en bas",EditHeadline:"Editer le filtre",EntryStyle:"Style de dialogue d'entrée",EntryStyleCompact:"compact",EntryStyleDefault:"par défaut",Filters:"Filtres",Height:"Hauteur",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",Name:"Nom",Regex:"Regex",StoreButton:"Ajouter un filtre",UpdateButton:"Mise à jour du filtre"},ControlTab:{Bars:"Barres",Circle:"Cercle",Control:"Contrôle",Cross:"Croix",EnableXYHoming:"Activer les m.a.z. simultanées des axes X & Y",EstimatedExtrusionInfo:"Afficher les estimations d'extrusion",EstimatedExtrusionInfoDescription:"Afficher / Cacher les estimations d'extrusions basées sur la quantité et le débit.",HideDuringPrint:"Masquer les commandes d'axe pendant l'impression",InvertXMovement:"Inverser le sens de déplacement de l'axe X",InvertYMovement:"Inverser le sens de déplacement de l'axe Y",InvertZMovement:"Inverser le sens de déplacement de l'axe Z",IsDefault:" (défaut)",MaximumValues:"Valeurs maximales: {maximum}",MaximumValuesVisibility:"Maximum de {maximum} est recommandée pour une meilleure visibilité",MinimumValues:"Valeurs minimales: {minimum}",MotorsOff:"Moteurs éteints{isDefault}",MoveDistancesEInMm:"Déplacement E (en mm)",MoveDistancesInMm:"Déplacement (en mm)",MoveDistancesXYInMm:"Déplacement X & Y (en mm)",MoveDistancesZInMm:"Déplacement Z (in mm)",QuadGantryLevel:"Portique à quatre niveaux{isDefault}",SpeedEInMms:"Vitesse E (en mm/s)",SpeedXY:"Vitesse X & Y",SpeedZ:"Vitesse Z",Style:"Style",ValueGreaterThan:"La valeur doit être supérieure à {value}",ZOffsetIncrements:"Increments Offset Z (en mm)",ZOffsetSaveOption:"Option de sauvegarde de l'Offset Z",ZOffsetSaveOptionDescription:"Modifier l'option d'enregistrement de l'Offset Z",ZTiltAdjust:"Réglage du Z-Tilt{isDefault}"},DashboardTab:{Dashboard:"Tableau de bord",Desktop:"Ecran standard",Mobile:"Mobile",ResetLayout:"Réinitialisation de la mise en page",Tablet:"Tablette",Widescreen:"Écran large"},Edit:"Edition",EditorTab:{ConfirmUnsavedChanges:"Confirmation pour sauvegarder ou annuler des changements",ConfirmUnsavedChangesDescription:"Si cette option est activée, l'éditeur demande une confirmation pour enregistrer ou rejeter les modifications apportées. S'il est désactivé, les modifications sont ignorées en silence.",Editor:"Éditeur",KlipperRestartMethod:"Méthode de redémarrage de klipper",KlipperRestartMethodDescription:"Sélectionnez la méthode de redémarrage qui sera utilisée lors de l'opération 'Enregistrer et redémarrer' lorsque vous modifiez les fichiers de configuration de Klipper.",Spaces:"Espaces: {count}",TabSize:"Taille de la fonction TAB",TabSizeDescription:"Règle le nombre d'espaces qui doivent être indentés pour les TAB",UseEscToClose:"Utiliser ESC pour fermer l'éditeur",UseEscToCloseDescription:"Permet de fermer l'éditeur à l'aide de la touche ESC"},GCodeViewerTab:{BackgroundColor:"Couleur de l'arrière-plan",ExtruderColor:"Couleur de l'extrudeur",GCodeViewer:"Visionneuse G-Code",GridColor:"Couleur de la grille",MaxFeed:"Débit maximum",MinFeed:"Débit minimum",ProgressColor:"Couleur d'avancement",ShowAxes:"Afficher les axes"},GeneralTab:{"12hours":"12 heures ({time})","24hours":"24 heures ({time})",Backup:"Sauvegarde",BackupDialog:"Choisissez les sections que vous désirez sauvegarder:",CalcEstimateTime:"Calcul du temps estimé",CalcEstimateTimeDescription:"Si plusieurs sont sélectionnés, une moyenne sera calculée.",CalcEtaTime:"Calcul du TEA",CalcEtaTimeDescription:"Si plusieurs sont sélectionnés, une moyenne sera calculée.",CalcPrintProgress:"Calcul de la progression de l'impression",CalcPrintProgressDescription:"Méthode de calcul de l'avancement de l'impression.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Position absolue dans le fichier",FileRelative:"Position relative dans le fichier",Slicer:"Trancheur (M73)"},CannotReadJson:"Lecture/interprétation du fichier de sauvegarde impossible.",DateFormat:"Format de la date",DbConsoleHistory:"Historique de la console",DbHistoryJobs:"Historique des travaux",DbHistoryTotals:"Historique Totaux",DBNavigation:"Navigation",DbTimelapseSettings:"Réglages Timelapse",DbView:"Voir les paramètres",EstimateValues:{Filament:"Filament",File:"Fichier",Slicer:"Trancheur"},Everything:"Tout",FactoryDialog:"Veuillez sélectionner toutes les sections que vous souhaitez réinitialiser:",FactoryReset:"Réinitialisation d'usine",General:"Général",Language:"Langue",MainsailSettingsMoonrakerDb:"Réglages de Mainsail dans Moonraker DB",PrinterName:"Nom de l'imprimante",Reset:"réinitialiser",Restore:"Restaurer",RestoreDialog:"Veuillez sélectionner toutes les sections que vous souhaitez restaurer:",TimeFormat:"Format de l'heure"},HeightmapTab:{ColorSchemes:"Schémas de couleurs",Heightmap:"Maillage",IsDefault:"(Défaut)",Schemes:{GrayScale:"Niveaux de gris",Hot:"Chaud",Hsv:"Hsv",Portland:"Portland",Spring:"Printemps"}},InterfaceSettings:"Réglages interface",MacrosTab:{Add:"ajouter",AddGroup:"ajouter un groupe",AvailableMacros:"Macros disponibles",ChangeMacroColor:"Modifier la couleur du bouton.",Color:"Couleur",CountMacros:"pas de macro ajoutée | {count} Macro | {count} Macros",Custom:"personnalisé",CustomColor:"Couleur personnalisée",DeletedMacro:"Macro supprimée",DeleteMacroFromGroup:"Supprimer une macro du groupe.",EditGroup:"Edition du groupe",Error:"erreur",Expert:"Expert",General:"Général",Group:"Groupe",GroupMacros:"Macros du groupe",Macrogroups:"Groupes",Macros:"Macros",Management:"Gestion",Name:"Nom",NoAvailableMacros:"Pas de macros disponibles.",NoGroups:"Pas de groupe trouvé...",NOMacros:"Pas de macros trouvées...",NoMacrosInGroup:"Pas de macros dans ce groupe.",Primary:"primaire",Secondary:"secondaire",ShowInStatePaused:"Afficher/masquer si l'imprimante est en pause.",ShowInStatePrinting:"Afficher/masquer si l'imprimante est en cours d'impression.",ShowInStateStandby:"Afficher/masquer si l'imprimante est en veille.",Simple:"Simple",Status:"Statut",Success:"succès",UnknownGroup:"Groupe inconnu",Warning:"avertissement"},MiscellaneousTab:{AddGroup:"ajouter un groupe",AddPreset:"ajouter un préréglage",Color:"Couleur",CreateGroup:"Créer un groupe",CreatePreset:"Créer un préréglage",End:"Fin",EndDescription:"Dernière DEL de ce groupe.",Groups:"Groupes",GroupSubTitle:"Début: {start}, Fin: {end}",LightGroups:"{name} - Groupes",LightPresets:"{name} - Préréglages",Miscellaneous:"Divers",Name:"Nom",NoDevicesFound:"Aucun dispositif trouvé",NoGroupFound:"Pas de groupe trouvé",NoPresetFound:"Pas de préréglage trouvé",Presets:"Préréglages",Start:"Démarrage",StartDescription:"Première DEL de ce groupe.",UnableToLoadLight:"Impossible de charger la lumière",UnableToLoadPreset:"Impossible de charger la présélection"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"ajouter un préréglage",Cooldown:"Refroidissement",CreateHeadline:"Créer un préréglage",CustomGCode:"G-Code personnalisé",EditCooldown:"Editer refroidissement",EditHeadline:"Editer préréglage",ErrorInvalidValue:"Valeur non valide",ErrorNameNotUnique:"Le nom existe déjà",ErrorNameRequired:"Nom requis",Name:"Nom",PreheatPresets:"Préréglages",PresetInfo:"Vous devez définir une température cible ou un G-Code utilisateur.",PresetNamePlaceholder:"Nom de la présélection (requis)",StoreButton:"Mémoriser les préréglages",UpdateButton:"Mise à jour de la présélection",UpdateCooldown:"Mise à jour refroidissement"},RemotePrintersTab:{AddPrinter:"Ajouter une imprimante",EditPrinter:"Editer l'imprimante",Hostname:"Nom d'hôte",Port:"Port",RemotePrinters:"Imprimantes",UpdatePrinter:"Mise à jour de l'imprimante",UseConfigJson:"InstanceDB = JSON détectée. Veuillez utiliser le fichier config.json pour modifier la liste des imprimantes."},Store:"magasin",TimelapseTab:{Autorender:"Rendu automatique",AutorenderDescription:"Si cette option est activée, la vidéo du timelapse sera automatiquement calculée à la fin de l'impression.",Camera:"Caméra",CameraDescription:"Sélectionner la caméra à utiliser",ConstantRateFactor:"Facteur d'échantillonnage",ConstantRateFactorDescription:"Il configure la qualité par rapport à la taille du fichier de la vidéo rendue. L'échelle CRF va de 0 à 51, où 0 correspond à une qualité sans perte, 23 est la valeur par défaut et 51 est la pire qualité possible.. Une valeur plus faible est généralement synonyme de meilleure qualité et une fourchette subjectivement saine se situe entre 17 et 28. Les valeurs 17 et 18 sont considérées comme étant visuellement sans perte.",duplicatelastframe:"Dupliquer la dernière image",duplicatelastframeDescription:"Duplique la dernière image à la fin de la vidéo",Enabled:"Activé",EnabledDescription:"Si cette option est désactivée, les macros G-Code sont ignorées et le rendu automatique est ignoré.",Extraoutputparams:"Paramètres de sortie supplémentaires",ExtraoutputparamsDescription:"Définit des paramètres de sortie supplémentaires pour FFMPEG. Note : Si vous spécifiez quelque chose ici, le paramètre de rotation sera désactivé.",FwRetract:"Rétraction Firmware",FwRetractDescription:"Utiliser la rétraction du firmware dans la macro timelapse",GcodeVerbose:"Verbose G-Code",GcodeVerboseDescription:"Si cette option est activée, les macros G-Code écriront des informations sur la console.",General:"Général",HyperlapseCycle:"Temps de cycle Hyperlapse",HyperlapseCycleDescription:"Un instantané sera pris toutes les X secondes.",Mode:"Mode",ModeDescription:"Choix entre le mode macro-couche et le mode hyperlapse (basé sur le temps)",OutputFramerate:"Images par seconde",OutputFramerateDescription:"Définit le taux de rafraîchissement de la vidéo. Remarque : ce paramètre sera ignoré si l'option variable_fps est activée.",Parkhead:"Parking de la tête",ParkheadDescription:"Si cette option est activée, la tête de l'outil sera garée avant de prendre une image.",Parkpos:"Position de parking",ParkposDescription:"Sélectionner la position de parking",ParkTime:"Temps de parking",ParkTimeDescription:"Ajoutez un temps d'inactivité supplémentaire lors du stationnement.",Pixelformat:"Format des pixel",PixelformatDescription:"Définit le format des pixels de la sortie vidéo (yuv420p)",PosDZ:"Position Z",PosDZDescription:"Position de parking Z (relative)",PosX:"Position X",PosXDescription:"Position de parking X (absolute)",PosY:"Position Y",PosYDescription:"Position de parking Y (absolute)",PreviewImage:"Image de prévisualisation",PreviewImageDescription:"Enregistrer une image de prévisualisation portant le même nom que la vidéo",RenderingOptions:"Options de rendu",RetractDistance:"Distance de rétraction",RetractDistanceDescription:"Distance de rétraction du filament avant parking.",RetractSpeed:"Vitesse de rétraction",RetractSpeedDescription:"Vitesse de rétraction du filament avant parking.",SaveFrames:"Sauvegarde des images",SaveFramesDescription:"Sauvegarder les images dans un fichier zip pour un traitement externe",StreamDelayCompensation:"Délai de compensation du flux",StreamDelayCompensationDescription:"Délai avant capture d'une image du flux",Targetlength:"Durée de la vidéo",TargetlengthDescription:"La longueur de la vidéo lorsque l'option Variable IPS est activée",TimeFormatCode:"Format du code horaire",TimeFormatCodeDescription:"Ceci définit comment l'horodatage dans le fichier de sortie doit être encodé",Timelapse:"Timelapse",TravelSpeed:"Vitesse de déplacement",TravelSpeedDescription:"Vitesse de déplacement pour se rendre à la position de parking et pour reprendre l'impression.",UnretractDistance:"Distance de dérétraction",UnretractDistanceDescription:"Distance de dérétraction du filament après parking et avant reprise d'impression.",UnretractSpeed:"Vitesse de dérétraction",UnretractSpeedDescription:"Vitesse de dérétraction du filament après parking et avant reprise d'impression.",VariableFps:"IPS variable",VariableFpsDescription:"Si activé, le nombre d'images par seconde (IPS) sera calculé tenant compte de la taille du fichier de sortie.",VariableFpsMax:"IPS variable max",VariableFpsMaxDescription:"",VariableFpsMin:"IPS variable min",VariableFpsMinDescription:""},UiSettingsTab:{BedScrewsDialog:"Bed Screws",BedScrewsDialogDescription:"Affiche la boîte de dialogue d'aide pour BED_SCREWS_ADJUST.",BigThumbnailBackground:"Couleur d'arrière-plan de la grande miniature",BoolBigThumbnail:"Grande miniature",BoolBigThumbnailDescription:"Affichage d'une grande miniature dans le panneau d'état lors d'une impression.",BoolHideUploadAndPrintButton:"Masquer le bouton de Chargement et d'impression",BoolHideUploadAndPrintButtonDescription:"Afficher ou masquer le bouton 'Charger et imprimer' dans la barre supérieure.",ConfirmOnEmergencyStop:"Confirmation obligatoire de l'arrêt d'urgence",ConfirmOnEmergencyStopDescription:"Affiche un dialogue de confirmation sur l'arrêt d'urgence",ConfirmOnPowerDeviceChange:"Requiert une confirmation pour changement de mode de modules de puissance",ConfirmOnPowerDeviceChangeDescription:"Affiche une boîte de dialogue de confirmation en cas de modification de l'alimentation de l'appareil",DefaultNavigationState:"État par défaut de la navigation",DefaultNavigationStateAlwaysClosed:"toujours fermé",DefaultNavigationStateAlwaysOpen:"toujours ouvert",DefaultNavigationStateDescription:"Quel état devrait avoir la navigation par défaut.",DefaultNavigationStateLastState:"dernier état",DisableFanAnimation:"Désactiver l'animation du ventilateur",DisableFanAnimationDescription:"Cela peut réduire la charge de votre navigateur.",DisplayCANCEL_PRINT:"Affichage de CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Affiche le bouton CANCEL_PRINT de manière permanente. Pas de confirmation demandée.",GcodeThumbnails:"Miniature G-Code",GcodeThumbnailsDescription:"Cliquez sur le bouton pour accéder aux instructions.",Guide:"Guide",HideSaveConfigButtonForBedMesh:"Cacher le bouton SAVE_CONFIG lors de changements de maillage",HideSaveConfigButtonForBedMeshDescription:"Cache le bouton SAVE_CONFIG si seulement des changements de maillages sont en attente de sauvegarde vers Klipper",HideUpdateWarnings:"Masquer les avertissements de mise à jour",HideUpdateWarningsDescription:"Cette option permet de masquer tous les avertissements de mise à jour dans le gestionnaire de mise à jour.",LockSliders:"Verrouiller les curseurs sur les appareils à écran tactile",LockSlidersDelay:"Délai de verrouillage du curseur",LockSlidersDelayDescription:"Les curseurs se verrouillent après un délai donné. S'ils sont réglés sur 0 ou laissés vides, les curseurs ne se verrouilleront que lors du changement ou du chargement de la page.",LockSlidersDescription:"Les curseurs des écrans tactiles doivent être déverrouillés avant que les modifications ne soient autorisées.",Logo:"Logo",ManualProbeDialog:"Aide à la sonde manuelle",ManualProbeDialogDescription:"Affiche une boîte de dialogue d'aide pour PROBE_CALIBRATE ou Z_ENDSTOP_CALIBRATE.",NavigationStyle:"Style de navigation",NavigationStyleDescription:"Modifie l'apparence de la navigation",NavigationStyleIconsAndText:"Icônes + Textes",NavigationStyleIconsOnly:"Icônes uniquement",PowerDeviceName:"Dispositif d'alimentation de l'imprimante",PowerDeviceNameDescription:"Choisissez quel appareil de puissance Moonraker doit utiliser pour l'alimentation de l'imprimante.",Primary:"Primaire",ScrewsTiltAdjustDialog:"Screws Tilt Adjust",ScrewsTiltAdjustDialogDescription:"Affiche une boîte de dialogue d'aide pour SCREWS_TILT_CALCULATE.",TempchartHeight:"Hauteur dans le tableau des températures",TempchartHeightDescription:"Modifie la hauteur du graphique de température sur le tableau de bord.",UiSettings:"Interface"},Update:"mise à jour",WebcamsTab:{AddWebcam:"ajouter une caméra",CreateWebcam:"Créer une caméra",EditCrowsnestConf:"Editer crowsnest.conf",EditWebcam:"Editer caméra",FlipWebcam:"Retourner l'image de la caméra:",HideFps:"Hide FPS counter",Hlsstream:"Flux HLS",Horizontally:"horizontalement",IconBed:"Plateau",IconCam:"Caméra",IconDoor:"Porte",IconFilament:"Filament",IconHot:"Chaud",IconMcu:"MCU",IconNozzle:"Buse",IconPrinter:"Imprimante",Ipstream:"Caméra IP",JMuxerStream:"Flux de données brutes h264 (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Streamer MJPEG adaptatif (experimental)",Name:"Nom",NameAlreadyExists:"Le nom existe déjà",Required:"requis",Rotate:"Rotation",SaveWebcam:"Sauvegarde caméra",Service:"Service",TargetFPS:"IPS cible",UpdateWebcam:"Mise à jour de la caméra",UrlSnapshot:"Aperçu de l'URL",UrlStream:"Flux d'URL",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"verticalement",Webcams:"Caméras",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},b={AllFiles:"Tous",Autorender:"Rendu automatique",Cancel:"Annuler",Create:"Créer",CreateNewDirectory:"créer un répertoire",CurrentPath:"Chemin actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Voulez-vous vraiment supprimer le répertoire "{name}" avec tout son contenu?',DeleteSelectedQuestion:"Voulez-vous vraiment supprimer les {count} fichiers sélectionnés ?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",DuplicateLastframe:"Dupliquer la dernière image",Empty:"Aucun timelapse terminé n'a été trouvé.",Enabled:"Activé",EstimatedLength:"Taille estimée",Files:"Fichiers",Filesize:"Taille des fichiers",Fixed:"constant",Framerate:"IPS",Frames:"images",Free:"Libre",FreeDisk:"Disque libre",LastModified:"Dernière modification",MaxFramerate:"IPS max",MinFramerate:"IPS min",Name:"Nom",NewDirectory:"Nouveau répertoire",NoActiveTimelapse:"Pas d'enregistrement disponible.",Preview:"Prévisualisation",RefreshCurrentDirectory:"rafraîchir le répertoire",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer le fichier",Render:"calculer",RenderSettings:"Paramètres de calcul de la vidéo",SaveFrames:"Sauvegarder les images",Search:"recherche",StartRender:"commencer le rendu",Status:"Statut",TargetFps:"IPS cible",Targetlength:"Longueur cible",TimelapseFiles:"Fichiers Timelapse",TimelapseRendering:"Rendu Timelapse",TimelapseRenderingSuccessful:"Rendu en timelapse réussi",Total:"Total",Type:"Type",Used:"Utilisé",Variable:"Variable",Video:"Vidéo"},T="Français",P={App:e,BedScrews:r,ConnectionDialog:i,Console:t,Dialogs:a,Editor:n,EmergencyStopDialog:o,Files:s,FullscreenUpload:l,GCodeViewer:u,Heightmap:d,History:c,JobQueue:m,Machine:p,ManualProbe:g,Panels:f,PowerDeviceChangeDialog:v,Router:h,ScrewsTiltAdjust:C,SelectPrinterDialog:S,Settings:D,Timelapse:b,title:T};export{e as App,r as BedScrews,i as ConnectionDialog,t as Console,a as Dialogs,n as Editor,o as EmergencyStopDialog,s as Files,l as FullscreenUpload,u as GCodeViewer,d as Heightmap,c as History,m as JobQueue,p as Machine,g as ManualProbe,f as Panels,v as PowerDeviceChangeDialog,h as Router,C as ScrewsTiltAdjust,S as SelectPrinterDialog,D as Settings,b as Timelapse,P as default,T as title}; diff --git a/dirs/mainsail/assets/hu-a56cb065.js b/dirs/mainsail/assets/hu-a56cb065.js deleted file mode 100644 index e1593e8..0000000 --- a/dirs/mainsail/assets/hu-a56cb065.js +++ /dev/null @@ -1 +0,0 @@ -const e={Notifications:{DependencyDescription:"Ez a verzió {name} nem támogat minden Mainsail funkciót. Frissítsd az újra {neededVersion} a jelenlegit {name}.",DependencyName:"Függőség: {name}",DismissAll:"Mind elvetése",KlipperWarnings:{DeprecatedOption:"'{section}' / '{option}' opcióját leírtuk, és a következő verzióban már nem lesz benne.",DeprecatedOptionHeadline:"Elavult Klipper Opció",DeprecatedValue:"'{section}' / '{option}' / Value '{value}' opcióját leírtuk, és a következő verzióban már nem lesz benne.",DeprecatedValueHeadline:"Elavult Klipper Érték",KlipperWarning:"Klipper figyelmeztetés"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Hiba a betöltés során, Moonraker '{component}'. Kérlek ellenőrizd a logokat, és javítsd a hibát.",MoonrakerWarning:"Moonraker figyelmeztetés",UnparsedConfigOption:"A [{section}] szekcióban helytelen konfig opciót '{option}: {value}' detektáltam. Ez lehet egy már nem elérhető opció, vagy egy hibásan betöltődő modul is okozhatja. A jövőben ez egy indítási hibaként fog jelentkezni.",UnparsedConfigSection:"Helytelen konfig szekciót [{section}] detektáltam. Ezt egy egy hibásan betöltődő komponens okozhatja. A jövőben ez egy indítási hibaként fog jelentkezni."},Never:"Soha",NextReboot:"Következő reboot",NoNotification:"Értesítés nem elérhető",Remind:"Emlékeztető:"},NumberInput:{GreaterOrEqualError:"Nagyobbnak vagy egyenlőnek kell lennie mint {min}!",MustBeBetweenError:"A {min} és {max} között kell lennie!",NoEmptyAllowedError:"Nem lehet üres a bemenet!"},Printers:"Nyomtatók",ThrottledStates:{DescriptionCurrentlyThrottled:"Az rPi ARM mag(ok) jelenleg túlterheltek.",DescriptionFrequencyCapped:"Az rPi ARM max frekvenciája jelenleg 1,2 GHz -re korlátozódik.",DescriptionPreviouslyFrequencyCapped:"Az rPi ARM maximális frekvenciája legalább egyszer 1,2 GHz-re korlátozódott az utolsó bekapcsolás óta.",DescriptionPreviouslyTemperatureLimited:"rPi uC(csak 3A+/3B+) hőmérséklete legalább egyszer meghaladta az első korlátot (alapértelmezett 60C) az utolsó bekapcsolás óta.",DescriptionPreviouslyThrottled:"rPI ARM magot(okat), ahol az utolsó bekapcsolás óta legalább egyszer túlterhelték.",DescriptionPreviouslyUnderVolted:"Az rPI tápfeszültsége az utolsó bekapcsolás óta legalább egyszer 4,65 V alá esett.",DescriptionTemperatureLimitActive:"Az rPi uC(csak 3A+/3B+) hőmérséklete jelenleg az első határérték felett van (alapértelmezett 60C).",DescriptionUnderVoltageDetected:"Az rPI tápfeszültsége jelenleg 4,65 V alatt van",TitleCurrentlyThrottled:"Jelenleg leterhelt",TitleFrequencyCapped:"Frekvencia-korlátozások",TitlePreviouslyFrequencyCapped:"Korábbi frekvencia-korlátozások",TitlePreviouslyTemperatureLimited:"Korábbi hőmérséklet-korlátozás",TitlePreviouslyThrottled:"Korábban túlterhelt",TitlePreviouslyUnderVolted:"Korábbi alacsony tápfesz",TitleTemperatureLimitActive:"Jelenleg leterhelt",TitleUnderVoltageDetected:"Alacsony tápfeszültség!"},Titles:{Complete:"Elkészült - {filename}",Error:"HIBA",Pause:"Nyomtatás Állj",Printing:"{percent}% Nyomtatás - {filename}",PrintingETA:"{percent}% Nyomtatás - IDŐ: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"A fájl nem feltölthető!",EmergencyStop:"Vészstop",SAVE_CONFIG:"BÁLLÍTÁS_MENTÉSE",Uploading:"Feltöltés",UploadOfFileSuccessful:" {file} feltöltése sikeres!",UploadPrint:"Feltöltés és nyomtatás"},TopCornerMenu:{Cancel:"Mégsem",ConfirmationDialog:{Description:{HostReboot:"A gazda újraindítása a jelenlegi nyomtatás kudarcával fog járni!",HostShutdown:"A gazda leállítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperFirmwareRestart:"A Klipper firmware újraindítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperRestart:"A Klipper újraindítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperStop:"A Klipper leállítása a jelenlegi nyomtatás kudarcával fog járni!",ServiceRestart:"A szolgáltatás újraindítása a jelenlegi nyomtatás kudarcával járhat!",ServiceStart:"A szolgáltatás elindítása a jelenlegi nyomtatás kudarcával járhat!",ServiceStop:"A szolgáltatás leállítása a jelenlegi nyomtatás kudarcával járhat!"},Title:{HostReboot:"Gazda Újraindítása",HostShutdown:"Gazda Leállítása",KlipperFirmwareRestart:"Klipper Firmware Újraindítás",KlipperRestart:"Klipper Újraindítás",ServiceRestart:"Szolgáltatás Újraindítása",ServiceStart:"Szolgáltatás Start",ServiceStop:"Szolgáltatás Stop"}},HostControl:"Gazda vezérlése",KlipperControl:"Klipper vezérlés",KlipperFirmwareRestart:"Firmware újraindítása",KlipperRestart:"Újraindítás",PowerDevices:"Tápegységek",Reboot:"Újraindítás",Restart:"Újraindítás",ServiceControl:"Szolgáltatások vezérlése",Shutdown:"Leállítás",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Bezárás",Empty:"Üres",Recovering:"{software} helyreállítása...",RecoveringDone:"{software} helyreállítása kész!",Updating:"{software} frissítése ...",UpdatingDone:"{software} frissítése kész!"}},t={CannotConnectTo:"Nem lehet csatlakozni a Moonrakerhez ({host}).",CheckMoonrakerLog:"Ha ez az üzenet többször is megjelenik, nézd meg a naplófájlt, itt:",Connecting:"Csatlakozás ehhez: {host}",Failed:"Kapcsolódás sikeretelen ",Initializing:"Inicializálás",TryAgain:"Próbáld újra"},a={CommandList:"Parancslista",Empty:"Üres",HideTemperatures:"Hőmérséklet elrejtése",HideTimelapse:"Idővonal Elrejtése",SendCode:"Kód küldése...",SetupConsole:"Konzol beállítás"},s={StartPrint:{Cancel:"Mégsem",DoYouWantToStartFilename:"{filename} kezdése?",Headline:"Feladat kezdése",Print:"nyomtat",Timelapse:"Idővonal"}},l={ConfigReference:"Konfigurációs refencia",DontSave:"Ne mentsd",Downloading:"Letöltés",FailedSave:"Nem tölthető fel: {filename}!",FileReadOnly:"csak olvasható",SaveClose:"Ment és bezár",SaveRestart:"Ment és újraindít",SuccessfullySaved:"Sikeresen mentve: {filename}",UnsavedChanges:"Mentetlen Változások",UnsavedChangesMessage:"Szeretnéd menteni a következőn végzett változtatásokat?: {filename}",UnsavedChangesSubMessage:"A változtatásaid elvesznek ha nem mented őket. Ezt az üzenetet az Editor beállításokban kikapcsolhatod.",Uploading:"Feltöltés"},r={AreYouSure:"Biztos?",EmergencyStop:"Vészstop",No:"Nem",Yes:"Igen"},i={AddToQueue:"Várólistához adva",AllFiles:"Mind",Cancel:"Mégsem",Create:"Létrehoz",CreateNewDirectory:"Új mappa létrehozása",CurrentPath:"Jelenlegi útvonal",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd törölni a következő mappát és minden tartalmát? "{name}" ',DeleteSelectedQuestion:"Tényleg szeretnél törölni {count} darab fájlt?",Download:"Letöltés",EditFile:"Fájl szerkesztése",Empty:"Üres",Filament:"Filament",FilamentName:"Filament Neve",FilamentType:"Filament Típus",FilamentUsage:"Filament Felhasználás",FilamentWeight:"Filament Súlya",Files:"Fájlok",Filesize:"Fájl méret",Free:"Szabad",FreeDisk:"Szabad terület",GCodeFiles:"G-Code Fájlok",HiddenFiles:"Rejtett fájlok",LastEndTime:"Legutóbbi Elégzési Idő",LastFilamentUsed:"Legutóbb Használt Filament",LastModified:"Legutóbb módosítva",LastPrintDuration:"Legutóbbi Nyomtatási Idő",LastStartTime:"Legutóbbi Start Ideje",LastTotalDuration:"Legutóbbi Teljes Nyomtatási Idő",LayerHeight:"Rétegmagasság",Name:"Név",NewDirectory:"Új mappa",NozzleDiameter:"Fúvóka Átmérője",ObjectHeight:"Tárgymagasság",Preheat:"Előhevítés",PrintedFiles:"Nyomtatott fájlok",PrintStart:"Nyomtatás kezdete",PrintTime:"Nyomtatási idő",RefreshCurrentDirectory:"Aktuális mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",Search:"Keresés",SetupCurrentList:"Aktuális lista készítése",Slicer:"Slicer",SuccessfullyCreated:"Sikeresen létrehozva: {filename}",SuccessfullyDeleted:"Sikeresen törölve: {filename}",SuccessfullyMoved:"Sikeresen áthelyezve: {filename}",SuccessfullyRenamed:"Sikeresen átnevezve: {filename}",SuccessfullyUploaded:"Sikeres feltöltés: {filename}",Total:"Összesen",UploadNewGcode:"Új Gcode feltöltése",Used:"Felhasznált",View3D:"3D nézet"},n={CannotUploadFile:"Nem tudom feltölteni a fájlt!",DropFilesToUploadFiles:"Húzd át a fájlokat feltöltéshez"},o={ClearLoadedFile:"Kitakarít",ColorMode:"Színes Mód",Downloading:"Letöltés",ForceLineRendering:"Vonalas renderelés Erőltetése",HDRendering:"HD Renderelés (Íves nyomatok)",High:"Magas",LoadCurrentFile:"Jelenlegi fájl",LoadLocal:"Helyi Fájl",Low:"Alacsony",Max:"Max",Medium:"Közepes",ReloadRequired:"Újratöltés szükséges",Rendering:"Renderelés",RenderQuality:"Renderelési minőség",ShowObjectSelection:"Mutasd a kijelölt objektumokat",ShowToolhead:"Fej mutatása",ShowTravelMoves:"Fej mozgásának mutatása",SpecularLighting:"Tükröződő fényvetülés",Title:"G-Code Nézegető",Tracking:"Követés",Transparency:"Áttetszőség",Ultra:"Ultra",VoxelMode:"Voxel Mód (ASMBL)"},m={Abort:"megszakítás",BedMeshCalibrate:"Síkrács kalibrálása",BedMeshRemove:"Síkrács eltávolítása",Calibrate:"kalibrálás",Clear:"kinullázás",CurrentMesh:{Headline:"Aktuális rács",Max:"Max",Min:"Min",Name:"Név",Size:"Méret",Variance:"Eltérés"},DeleteBedMeshProfile:"Síkrács profil törlése",DoYouReallyWantToDelete:'Tényleg törölni akarod a profilt?: "{name}"',ErrorKlipperNotReady:"A Klipper nem áll készen. Magasságtérkép letiltva.",Flat:"Lapos",Heightmap:"Magasságtérkép",Later:"Később",Mesh:"Síkrács",Name:"Név",NoBedMeshHasBeenLoadedYet:"Még nincs betöltve a síkrács.",NoProfile:"Nincs elérhető profil",Ok:"OK",Probed:"Bemért",Profiles:"Profilok",Remove:"eltávolítás",RemoveSaveDescription:"A bed_mesh profil töröltként került megjegyzésre.Klikkelj a BÁLLÍTÁS_MENTÉS-ÉRE, hogy eltávolítsd a printer.cfg-ből és újraindítsd a Klippert.",Rename:"átnevez",RenameBedMeshProfile:"Síkrács profil átnevezése",SAVE_CONFIG:"BÁLLÍTÁS_MENTÉSE",ScaleGradient:"Gradiens skálázása",ScaleZMax:"Z-max. skálázása",TitleCalibrate:"Új síkrács kalibrálása",TitleClear:"Síkrács kinullázása",TitleHomeAll:"Kezdőpontba áll",Wireframe:"Drótháló"},d={AddNote:"Megjegyzés hozzáadása",AllJobs:"Mind",AvgPrinttime:"Átlag nyomtatási idő - Ø",Cancel:"Mégsem",CreateNote:"Megjegyzés létrehozása",Delete:"Törlés",DeleteSelectedQuestion:"Tényleg törölni akarsz {count} kiválasztott munkát?",Details:"Részletek",EditNote:"Megjegyzés módosítása",Empty:"üres",EndTime:"Befejezés",EstimatedFilament:"Becsült filament",EstimatedFilamentWeight:"Becsült filament súly",EstimatedTime:"Becsült idő",FilamentCalc:"Filament számolt",FilamentUsage:"Filament használat",FilamentUsed:"Elhasznált filament",Filename:"Fájl név",Filesize:"Fájl méret",FirstLayerBedTemp:"Első réteg asztal hőm.",FirstLayerExtTemp:"Első réteg extr. hőm.",FirstLayerHeight:"Első réteg magassága",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Nyomatok",JobDetails:"Munka részletei",Jobs:"Munkák",LastModified:"Utolsó módosított",LayerHeight:"Rétegmagasság",LongestPrinttime:"Leghosszabb nyomtatási idő",Note:"Megjegyzés",ObjectHeight:"Tárgy magassága",PrintDuration:"Nyomtatás ideje",PrintHistory:"Nyomtatási előzmények",PrintTime:"Nyomtatási idő",PrinttimeAvg:"Nyomtatási átlag",Reprint:"Újranyomtat",Save:"ment",Search:"keresés",SelectedFilamentUsed:"Kiválasztott Filament Felhasználásra",SelectedJobs:"Kiválasztott Munkák",SelectedPrinttime:"Kiválasztott Nyomtatási Idő",Slicer:"Slicer",SlicerVersion:"Slicer verzió",StartTime:"Kezdés",Statistics:"Statisztikák",Status:"Státusz",StatusValues:{cancelled:"Megszakított",completed:"Elkészült",error:"Hiba",in_progress:"Folyamatban",klippy_disconnect:"Klippy lecsatlakotatás",klippy_shutdown:"Klippy leállítás",server_exit:"Szerverből kilépés"},TitleExportHistory:"Export Előzmények",TitleRefreshHistory:"Előzmények frissítése",TitleSettings:"Beállítások",TotalDuration:"Teljes idő",TotalFilamentUsed:"Összes elhasznált filament",TotalJobs:"Összes munka",TotalPrinttime:"Össznyomtatott idő",TotalTime:"Teljes idő"},z={AllJobs:"Minden Feladat",Empty:"Üres",JobQueue:"Feladatlista",Jobs:"Feladatok",Pause:"Szünet",RemoveFromQueue:"Eltávolítás a Listáról",Start:"Start"},k={ConfigFilesPanel:{AllFiles:"Mind",Cancel:"Mégsem",ConfigFiles:"Konfig fájlok",Create:"Létrehoz",CreateDirectory:"Mappa létrehozása",CreateFile:"Fájl létrehozása",CurrentPath:"Aktuális útvonal",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd törölni a(z) "{name}" mappát és minden tartalmát?',DeleteSelectedQuestion:"Töröljem a kiválasztott {count} elemeket?",Download:"Letöltés",EditFile:"Fájl szerkesztése",Empty:"Üres",Files:"Fájlok",Filesize:"Fájlméret",Free:"Szabad",FreeDisk:"Szabad lemez",HiddenFiles:"Rejtett fájlok",HideBackupFiles:"Backup fájlok elrejtése",LastModified:"Utoljára módosítva",Name:"Név",RefreshDirectory:"Mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",Root:"Root",SetupCurrentList:"Jelenlegi lista beállítása",ShowFile:"Fájl megjelenítése",Total:"Összesen",UploadFile:"Fájl feltöltése",Uploading:"Feltöltés...",Used:"Felhasznált"},EndstopPanel:{Endstop:"Végállás",EndstopInfo:"Nyomd meg a jobb-alsó szinkronizáló gombot jelenlegi a végállásállapot betöltéséhez.",Endstops:"Végállások",open:"NYITVA",TRIGGERED:"AKTÍV"},LogfilesPanel:{Logfiles:"Logfájlok"},SystemPanel:{Constants:"Állandók",Cpu:"CPU",HostDetails:"Gazdagép részletei",LastStats:"Utolsó statisztikák",Load:"Betöltés",Memory:"MEM",NoMoreInfos:"Nincs több Info",SystemLoad:"Rendszerterhelések",Values:{Awake:"Ébredés: {awake}",Bandwidth:"Sávszélesség: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Frek: {frequency}",Load:"Terh: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Kapott: {received}",Temp:"Hőm: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Elküldött: {transmitted}",Version:"Verzió: {version}"}},UpdatePanel:{CheckForUpdates:"Frissítések keresése",Commits:"Véglegesítés",CommitsAvailable:"nincs elérhető véglegesítés | {count} véglegesítés elérhető | {count} véglegesítés elérhető",CommitsOnDate:"véglegesítés ekkor:{date}",CommittedDaysAgo:"véglegesítve {days} nappal ezelőtt",CommittedHoursAgo:"véglegesítve {hours} órával ezelőtt",CommittedOnDate:"véglegesítve ekkor: {date}",CommittedYesterday:"véglegesítve tegnap",Detached:"leválasztva",Dirty:"megváltoztatott",ERROR:"HIBA",Invalid:"érvénytelen",OSPackages:"Oprendszer csomagok",PackagesCanBeUpgraded:"a csomagok frissíthetőek",System:"Rendszer",Unknown:"ismeretlen",Update:"frissítés",UpdateAll:"Minden elem frissítése",UpdateManager:"Frissítéskezelő",Upgrade:"upgradelés",UpToDate:"legfrissebb"}},p={ExtruderControlPanel:{Allowed:"Megengedett",EstimatedExtrusion:"Becsült Extrudálás:",Extrude:"Extrudálás",ExtruderTempTooLow:"Extruder hőm. <",ExtrusionFactor:"Extrudálási szorzó",ExtrusionFeedrate:"Extruder Előtolása",FilamentLength:"Filament Hossz",FirmwareRetractionSettings:{RetractLength:"Visszahúzás hossza",RetractSpeed:"Visszahúzás sebessége",UnretractExtraLength:"Eresztés Extra Hossza",UnretractSpeed:"Eresztés Sebessége"},Headline:"Extruder",LoadFilament:"Filament Behúzása",PressureAdvanceSettings:{Advance:"Fejlett mód",Extruder:"Extruder",SmoothTime:"Simítás ideje"},Requested:"Kért",Retract:"Visszahúzás",TooLargeExtrusion:"A visszahúzás túl nagy!",UnloadFilament:"Filament kihúzása"},FarmPrinterPanel:{ReconnectToPrinter:"Újracsatlakozás",SwitchToPrinter:"Váltás a nyomtatóra",WebcamOff:"Ki"},KlippyStatePanel:{FirmwareRestart:"Firmware újraindítása",KlipperCheck:"Kérjük, ellenőrizd, a Klipper szolgáltatás fut-e, konfigurálva van-e UDS (Unix Domain Socket).",MoonrakerCannotConnect:"A Moonraker nem tud csatlakozni a Klipperhez!",Restart:"Újraindítás"},MachineSettingsPanel:{Headline:"Gép beállításai",MotionSettings:{Acceleration:"Gyorsulás",MaxAccelToDecel:"Lassulás Max Gyorsulása",SquareCornerVelocity:"Sebesség a sarkokban",Velocity:"Gyorsaság"}},MacrosPanel:{Headline:"Makrók",Send:"küldés"},MiniconsolePanel:{Headline:"Konzol",HideTemperatures:"Hőmérséklet elrejtése",HideTimelapse:"Idővonal elrejtése",SendCode:"Kód küldése...",SetupConsole:"Konzol beállítása"},MinSettingsPanel:{IncludeMainsailCfg:"Tedd bele a mainsail.cfg fájlt a printer.cfg fájlba!",IsNotDefinedInConfig:"nincs definiálva a konfigban.",MissingConfiguration:"Hiányzó konfiguráció",MoreInformation:"több információ"},MiscellaneousPanel:{Headline:"Kiegészítők",RunoutSensor:{Detected:"érzékelt",Disabled:"letiltott",Empty:"Üres"}},PowerControlPanel:{Error:"Hiba",Off:"KI",On:"BE",PowerControl:"Tápellátás vezérlés"},StatusPanel:{CancelPrint:"Nyomtatás megszakítása",ClearPrintStats:"Nyomt. statisztikák törlése",Difference:"Különbség",EmptyGcodes:"Nincs elérhető G-Code.",EmptyJobqueue:"Jelenleg nincs munka a várólistán.",Estimate:"Becslés",ETA:"Becs.Idő",ExcludeObject:{Cancel:"mégsem",Excluded:"Kizárva",ExcludeObject:"Test kizárása",ExcludeObjectHeadline:"Test kizárása",ExcludeObjectText:'Tényleg ki akarod zárni ezt?: "{name}"'},Filament:"Filament",File:"Fájl",Files:"Fájlok",Flow:"Anyagáramlás",Headline:"Állapot",Jobqueue:"Várólista",JobqueueMoreFiles:"Nincs több munka | Még egy munka | {count} munka hátra",Layer:"Réteg",Max:"max",ObjectHeight:"Tárgy magassága",PausePrint:"Nyomtatás szüneteltetése",Print:"Nyomtatás",PrintTime:"Nyomtatási Idő",ReprintJob:"Munka újranyomtatása",Requested:"Kért",ResumePrint:"Nyomtatás folytatása",Slicer:"Slicer",Speed:"Sebesség",Status:"Státusz",Total:"Összesen",Unknown:"Ismeretlen"},TemperaturePanel:{AutoscaleChart:"Grafikon automatikus méretezése",Avg:"Átl.",Cooldown:"Lehűtés",Current:"Jelenlegi",Dataset:{Power:"PWM-táp",Speed:"PWM-sebesség",Target:"célhőmérséklet",Temperature:"aktuális hőmérséklet"},Headline:"Hőmérsékletek",Max:"max",Min:"min",Name:"Név",Presets:"Előzetes értékek",SetupTemperatures:"Hőmérsékletek beállítása",ShowChart:"Grafikon megjelenítése",ShowNameInChart:" {name} megjelenítése a diagramon",ShowNameInList:" {name} megjelenítése a listában",State:"Állapot",Target:"Cél",TemperaturesInChart:"Hőmérséklet [°C]",TempTooHigh:"A {name} hőmérséklete túl magas! (max: {max})",TempTooLow:"A {name} hőmérséklete túl alacsony! (min: {min})"},ToolheadControlPanel:{Absolute:"abszolút",ALL:"MIND",Headline:"Fúvókafej",PleaseConfigureSteps:"Kérlek állítsd be a step értékét",Position:"Pozíció",QGL:"QGL",Relative:"relatív",SettingsInterfaceControl:"Beállítások > Kezelőfelület > Vezérlés",SpeedFactor:"Sebességállítás",ZTilt:"Z-dőlésszög"},WebcamPanel:{All:"Mind",FPS:"FPS",Headline:"Webkamera",UnknownWebcamService:"Ismeretlen webkamera szolg."},ZoffsetPanel:{Headline:"Z-eltolás",Later:"Később",Ok:"OK",Save:"Mentés",SaveConfig:"BÁLLÍTÁS_MENTÉSE",SaveInfoDescription:'Új Z-eltolás kiszámítva és regisztrálva. Kattints a "BÁLLÍTÁS_MENTÉSE" gombra az új Z-eltolás eltárolásához a printer.cfg-be és indítsd újra a Klippert.',SaveInfoDescriptionPrint:'Új Z-eltolás kiszámítva és regisztrálva. Nyomtatás után kattints a "BÁLLÍTÁS_MENTÉSE"-re a felső sávban, a printer.cfg-be eltárolásához és a Klipper újraindításához.',SaveInfoHeadline:"Információ",ToEndstop:"a végállásig",ToProbe:"szondáig"}},c={AreYouSure:"Biztos?",No:"Nem",TurnDeviceOff:"{device} kikapcsolása",TurnDeviceOn:"{device} bekapcsolása",Yes:"Igen"},g={Console:"Konzol",Dashboard:"Irányítópult","G-Code Files":"G-kód fájlok","G-Code Viewer":"G-kód Nézegető",Heightmap:"Magasságtérkép",History:"Előzmények",Machine:"Gép",Printers:"Nyomtatók",Timelapse:"Idővonal",Webcam:"Webkamera"},u={AddPrinter:"Nyomtató hozzáadása",CannotConnectTo:"Kapcsolódás sikertelen ehhez: {host}.",ChangePrinter:"Nyomtatóváltás",Connecting:"Kapcsolódás ehhez: {host}",ConnectionFailed:"Kapcsolódás sikertelen",EditPrinter:"Nyomtató beállítása",Hello:"Szia, üdvözlünk a távoli hozzáférésű Mainsailben",HostnameInvalid:"Gazdanév/IP érvénytelen",HostnameIp:"Gazdanév/IP",HostnameRequired:"Gazdanév szükséges",Port:"Port",PortRequired:"Port szükséges",RememberToAdd:"Add hozzá a moonraker.conf-ban a 'cors_domains'-en belül ezt: {cors}",SelectPrinter:"Nyomtató választása",TryAgain:"próbáld újra",UpdatePrinter:"Nyomtató frissítése",YouCanFindMore:"További részleteket itt talál:"},b={Cancel:"Mégsem",Close:"Close",ConsoleTab:{AddFilter:"szűrő hozzáad.",Console:"Konzol",CreateHeadline:"Szűrő létrehozása",Direction:"Irány",DirectionShell:"Alul az utolsó bejegyzés",DirectionTable:"Utolsó bejegyzés a tetején",EditHeadline:"Szűrő szerkesztése",EntryStyle:"Alapstílus",EntryStyleCompact:"kompakt",EntryStyleDefault:"alapstílus",Filters:"Filterek",Height:"Magasság",HideTemperatures:"Hőmérsékletek elrejtése",HideTimelapse:"Idővonal elrejtése",Name:"Név",Regex:"Reguláris kif.",StoreButton:"Szűrő mentése",UpdateButton:"Szűrő frissítése"},ControlTab:{Bars:"Sávok",Circle:"Kör",Control:"Vezérlés",Cross:"Kereszt",EnableXYHoming:"Kombinált X és Y tengely alapállapot engedélyezése",EstimatedExtrusionInfo:"Mutatsd a becsült extrudálási időt",EstimatedExtrusionInfoDescription:"Mutasd / rejdtsd el az extrudálás mennyisége és előtolása alapján becsült extrudálási infókat",InvertXMovement:"X-mozgás invertálása",InvertYMovement:"Y-mozgás invertálása",InvertZMovement:"Z-mozgás invertálása",IsDefault:" (alapértelmezett)",MaximumValues:"Maximum értékek: {maximum}",MaximumValuesVisibility:"A legjobb láthatósághoz ajánlott Maximum érték: {maximum}",MinimumValues:"Minimum értékek: {minimum}",MotorsOff:"Motorok KI {isDefault}",MoveDistancesEInMm:"E-mozgás táv. mm-ben",MoveDistancesInMm:"Mozgás táv. mm-ben",MoveDistancesXYInMm:"XY mozgás táv. mm-ben",MoveDistancesZInMm:"Z mozdítás mm-ben",QuadGantryLevel:"4 tengelyes szintezés {isDefault}",SpeedEInMms:"E sebessége mm/s-ban",SpeedXY:"XY sebessége",SpeedZ:"Z sebessége",Style:"Stílus",ValueGreaterThan:"Az értéknek nagyobbnak kell lennie mint {value}",ZOffsetIncrements:"Z-Eltolás mérései (in mm)",ZTiltAdjust:"Z-dőlésszög Beállítása{isDefault}"},DashboardTab:{Dashboard:"Irányítópult",Desktop:"Asztal",Mobile:"Mobil",ResetLayout:"Elrendezés visszaállítása",Tablet:"Tablet",Widescreen:"Szélesvásznú"},Edit:"Szerkeszt",EditorTab:{ConfirmUnsavedChanges:"Az új változások mentésének vagy elvetésének kijelzése",ConfirmUnsavedChangesDescription:"Ha engedélyezed, az új változások mentéséhez vagy elvetéséhez megerősítés szükséges. Ha kikapcsolod a változásokat némán eldobja.",Editor:"Szerkesztő",KlipperRestartMethod:"Klipper újraindítási mód",KlipperRestartMethodDescription:"Válaszd ki milyen újraindítási módot használjunk a 'Ment és Újraindít' esetén, amikor a klipper konfig fájlait szerkeszted.",Spaces:"Szóközök: {count}",TabSize:"TAB Méret",TabSizeDescription:"Beállítja, hogy hány szóközzel legyen behúzva a TAB-oknál",UseEscToClose:"Kilépéshez nyomd meg az ESC gombot",UseEscToCloseDescription:"Az ESC gomb megnyomása bezárja a szerkesztőt"},GCodeViewerTab:{BackgroundColor:"Háttérszín",ExtruderColor:"Extruder Színek",GCodeViewer:"G-Code Nézegető",GridColor:"Rács Színe",MaxFeed:"Max Behúzási Ráta",MinFeed:"Min Behúzási Ráta",ProgressColor:"Haladás színei",ShowAxes:"Tengelyek mutatása"},GeneralTab:{Backup:"Bizt. mentés",BackupDialog:"Kérlek jelöld ki az összes biztonsági mentésre jelölt szekciót:",CalcEstimateTime:"Nagyjából becsült idő",CalcEstimateTimeDescription:"Ha többet jelölsz ki, az átlagból számolok",CalcEtaTime:"ETA számítás",CalcEtaTimeDescription:"Ha többet jelölsz ki, az átlagból számolok",CannotReadJson:"Nem beolvasható/parseolható a fájl.",DbConsoleHistory:"Konzol előzmények",DbHistoryJobs:"Elvégzett feladatok",DbHistoryTotals:"Feladatok összesen",DbTimelapseSettings:"Idővonal beállítások",DbView:"Beállítások mutatása",DbWebcams:"Webkamerák",EstimateValues:{Filament:"Filament",File:"Fájl",Slicer:"Slicer"},FactoryDialog:"Kérlek válaszd ki a visszaállítandó részeket:",FactoryReset:"Gyári visszaállítás",General:"Általános",Language:"Nyelv",MoonrakerDb:"Moonraker DB",PrinterName:"Nyomtató neve",Reset:"Visszaállítás",Restore:"Helyreállítás",RestoreDialog:"Kérlek jelöld ki az összes helyreállításra kijelölt szekciót:"},InterfaceSettings:"Interfész beállításai",MacrosTab:{Add:"hozzáad",AddGroup:"Csoporthoz adás",AvailableMacros:"Elérhető Makrók",ChangeMacroColor:"Változtasd meg a gomb színét.",Color:"Szín",CountMacros:"Nincs Makró | {count} Makró | {count} Makró ",Custom:"egyedi",CustomColor:"Alapértemezett szín",DeletedMacro:"Törölt Makrók",DeleteMacroFromGroup:"Makró törlése a csoportból.",EditGroup:"Csoport Szerkesztése",Error:"hiba",Expert:"Szakértői",General:"Általános",Group:"Csoport",GroupMacros:"Makrók Csoportjai",Macrogroups:"Csoportok",Macros:"Makrók",Management:"Menedzselés",Name:"Név",NoAvailableMacros:"Nincs elérhető makró.",NoGroups:"Csoport nem található...",NOMacros:"Nem található makró ...",NoMacrosInGroup:"Ebben a csoportban nincsenek makrók.",Primary:"elsődleges",Secondary:"másodlagos",ShowInStatePaused:"Mutasd/Rejtsd el, ha a printer szünetel.",ShowInStatePrinting:"Mutasd/Rejtsd el, ha a printer nyomtat.",ShowInStateStandby:"Mutasd/Rejtsd el, ha a printer készenlétben áll.",Simple:"Egyszerű",Status:"Állapot",Success:"sikeres",UnknownGroup:"Ismeretlen Csoport",Warning:"figyelmeztetés"},PresetsTab:{AddPreset:"Készérték hozzáadása",Cooldown:"Visszahűtés",CreateHeadline:"Készérték beállítása",CustomGCode:"Egyedi G-kód",EditCooldown:"Visszahűtés szerkesztése",EditHeadline:"Előzetes értékek szerkesztése",ErrorInvalidValue:"Helytelen érték",ErrorNameNotUnique:"A név már létezik",ErrorNameRequired:"A név kötelező",Name:"Név",PreheatPresets:"Előzetes érték",PresetInfo:"Választanod kell min hőmérsékletet, vagy egyedi Gcode-ot.",PresetNamePlaceholder:"Eredeti név(kötelező)",StoreButton:"Előzetes értékek tárolása",UpdateButton:"Előzetes értékek frissítése",UpdateCooldown:"Visszahűtés frissítése"},RemotePrintersTab:{AddPrinter:"Nyomtató hozzáadása",EditPrinter:"Nyomtató beállítása",Hostname:"Gazdagép neve",Port:"Port",RemotePrinters:"Nyomtatók",UpdatePrinter:"Nyomtató frissítése"},TimelapseTab:{Autorender:"Auto renderelés",AutorenderDescription:"Az idővonal renderélése a nyomtatás végén automatikusan elkezdődik, ha engedélyezed",Camera:"Kamera",CameraDescription:"Válassz melyik kamerát akarod használni",ConstantRateFactor:"Videóráta állandó",ConstantRateFactorDescription:"A minőség kontra fájlméret állítását végzi a renderelésben. A CRF értéke 0–51 közötti, ahol 0 iveszteségmentes, 23 az alapértelmezett és 51 a legkisebb méretű(rossz minőség).",duplicatelastframe:"utolsókockaduplázás",duplicatelastframeDescription:"Megduplázza a videó utolsó képkockáját",Enabled:"Engedélyezve",EnabledDescription:"Kikapcsoláskor: G-Code makrókat kihagyása, nincs auto renderelés.",Extraoutputparams:"Extraparaméterekki",ExtraoutputparamsDescription:"Az FFMPEG extra kimeneti beállításait állítja be. Megjegyzés: Bármely itteni beállítás kikapcsolja a forgatási beállításokat",FwRetract:"FW Visszahúzás",FwRetractDescription:"Használt a Firmware visszahúzási sebességét a makróképekhez",GcodeVerbose:"Részletes G-Code",GcodeVerboseDescription:"Bekapcsolás után, a G-Code makrók a konzolra ki lesznek írva",General:"Általános",HyperlapseCycle:"Hyperlapse Ciklus Idő",HyperlapseCycleDescription:"Egy képkocka készül minden x másodpercben",Mode:"Mód",ModeDescription:"Válassza az alábbiak közül: Rétegmakró vagy Hyperlapse (idő alapú) mód",OutputFramerate:"Kimenő Képsebesség",OutputFramerateDescription:"Beállítja a videó képsebességét. Megjegyzés: az Állítható FPS bekapcsolása érvényteleníti",Parkhead:"Fej parkoltatása",ParkheadDescription:"Bekapcsolás után, a fej leparkol minden képkocka készítése előtt.",Parkpos:"Parkolási pozíció",ParkposDescription:"Válaszd ki a parkolás helyét",ParkTime:"Parkolási Idő",ParkTimeDescription:"Plusz várakozási idő hozzáadása parkoláskor.",Pixelformat:"Pixelformátum",PixelformatDescription:"Beállítja a kimenő videó pixelformátumát",PosDZ:"Z Pozíció",PosDZDescription:"Z Parkolási Pozíció(relatív)",PosX:"X Pozíció",PosXDescription:"X Parkolási Pozíció(abszolút)",PosY:"Y Pozíció",PosYDescription:"Y Parkolási Pozíció(abszolút)",PreviewImage:"Előnézet",PreviewImageDescription:"Előnézeti kép mentése a videóval egyező néven",RenderingOptions:"Renderelési beállítások",RetractDistance:"Visszahúzási hossz",RetractDistanceDescription:"A filament hossza amennyit az extruder visszahúz.",RetractSpeed:"Visszahúzás Sebessége",RetractSpeedDescription:"A sebesség amellyel az extruder visszahúzza a filamentet.",SaveFrames:"Kocka mentése",SaveFramesDescription:"A képkockák mentése zip-fájlba külső rendereléshez",StreamDelayCompensation:"Stream Késés Kompenzáció",StreamDelayCompensationDescription:"Kép mentés késése",Targetlength:"Célhossz",TargetlengthDescription:"A célhossz, ha az állítható FPS be van állítva",TimeFormatCode:"Idő Formátum kódolás",TimeFormatCodeDescription:"Ez írja le a képkocka a kimeneten hogyan legyen kódolva.",Timelapse:"Idővonal",TravelSpeed:"Utazási sebesség",TravelSpeedDescription:"A parkolás és a folytatás során használt utazási sebesség",UnretractDistance:"Eresztési hossz",UnretractDistanceDescription:"A hossz amennyit a filemneten ereszt az extruder miután visszahúzta.",UnretractSpeed:"Eresztés Sebessége",UnretractSpeedDescription:"A sebesség amennyivel a filemnetet ereszti az extruder miután visszahúzta.",VariableFps:"Állítható FPS",VariableFpsDescription:"Bekapcsolva a célhossz alapján kalkulálja a kimeneti videó képsebességét.",VariableFpsMax:"Állítható maxFPS",VariableFpsMaxDescription:"",VariableFpsMin:"Állítható minFPS",VariableFpsMinDescription:""},UiSettingsTab:{BoolBigThumbnail:"Nagy előnézet",BoolBigThumbnailDescription:"Nagy előnézet mutatása a státusz panelben a nyomtatás alatt.",BoolHideUploadAndPrintButton:"A feltöltés és nyomtatás gombok elrejtése",BoolHideUploadAndPrintButtonDescription:'Mutasd/Rejtsd el a "Feltöltés és Nyomtatás" gombot a felső menüben.',ConfirmOnEmergencyStop:"A Vészleállításhoz megerősítés szükséges",ConfirmOnEmergencyStopDescription:"Megerősítő párbeszéd megjelenítése Vészleállításhoz",ConfirmOnPowerDeviceChange:"Az Eszköz Tápellátásának változásához megerősítés szükséges",ConfirmOnPowerDeviceChangeDescription:"Megerősítő párbeszéd megjelenítése az Eszköz Tápellátásának változtatásához",DisplayCANCEL_PRINT:"Nyomtatás_megszakítása mutatása",DisplayCANCEL_PRINTDescription:"A Nyomtatás megszakítása gomb véglegesítése, megerősítést nem kér.",GcodeThumbnails:"G-Code előképek",GcodeThumbnailsDescription:"Kattints a gombra útmutatásért",Guide:"Útmutató",LockSliders:"Az érintőképernyők csúszkáinak lezárása",LockSlidersDelay:"Csúszkák lezárásái eltelt idő",LockSlidersDelayDescription:"A csúszkák lezárásra kerülnek a megadott idő után. Ha 0 vagy üres az érték, a csúszkák csak az oldal változtatásnál/újratöltésnél záródnak le.",LockSlidersDescription:"Az érintőképernyők csúszkáinak lezárását meg kell szüntetned mielőtt állítani tudnál.",Logo:"Logó",NavigationStyle:"Menü Stílusa",NavigationStyleDescription:"Menü megjelenésének megváltoztatása",NavigationStyleIconsAndText:"Ikonok + Szöveg",NavigationStyleIconsOnly:"Csak ikonok",Primary:"Elsődleges",ShowWebcamInNavigation:"Webkamera mutatása a menüben",UiSettings:"Nézet beállítások"},WebcamsTab:{AddWebcam:"Webkamera hozzáadása",CreateWebcam:"Webkamera létrehozása",EditWebcam:"Webkamera szerkesztése",FlipWebcam:"Webkamera tükrözése:",Horizontally:"vízszintes",IconBed:"Asztal",IconCam:"Kamera",IconDoor:"Ajtó",IconFilament:"Filament",IconHot:"Forró",IconMcu:"MCU",IconNozzle:"Fúvóka",IconPrinter:"Nyomtató",Ipstream:"IP kamera",Mjpegstreamer:"MJPEG-Streamelő",MjpegstreamerAdaptive:"Adaptív MJPEG-Streamelő (kísérleti)",Name:"Név",NameAlreadyExists:"A név már létezik",Required:"Szükséges",SaveWebcam:"Webkamera mentése",Service:"Szolgáltatás",TargetFPS:"Cél FPS",UpdateWebcam:"Webkamera frissítése",UrlSnapshot:"Snapshot URL-je ",UrlStream:"Stream URL-je ",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"függőleges",Webcams:"Webkamerák"}},v={AllFiles:"Mind",Autorender:"Automatikus renderelés",Cancel:"Mégsem",Create:"Létrehoz",CreateNewDirectory:"mappa létrehozása",CurrentPath:"Jelenlegi elérési út",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd minden összetevőjével együtt törölni a következő mappát?: "{name}"',Download:"Letöltés",DuplicateLastframe:"Utolsó képkocka duplikálása",Empty:"Nem találhatóak idővonal fájlok",Enabled:"Engedélyezve",EstimatedLength:"Becsült hossz",Files:"Fájlok",Filesize:"Fájlméret",Fixed:"fixált",Framerate:"Képsebesség",Frames:"Képkockák",Free:"Szabad",FreeDisk:"Szabad terület",LastModified:"Legutóbb módosítva",MaxFramerate:"Max. képsebesség",MinFramerate:"Min. képsebesség",Name:"Név",NewDirectory:"Új mappa",NoActiveTimelapse:"Nincs felvétel.",Preview:"Előnézet",RefreshCurrentDirectory:"mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",Render:"renderel",RenderSettings:"Renderelési beáll.",SaveFrames:"Képkockák mentése",Search:"keresés",StartRender:"Renderelés megkezdése",Status:"Állapot",TargetFps:"Cél FPS",Targetlength:"Célhossz",TimelapseFiles:"Idővonal fájlok",TimelapseRendering:"Idővonal renderelése",TimelapseRenderingSuccessful:"Idővonal renderelése sikeres",Total:"Összes",Type:"Típus",Used:"Felhasznált",Variable:"Variálható",Video:"Videó"},y="Magyar",h={App:e,ConnectionDialog:t,Console:a,Dialogs:s,Editor:l,EmergencyStopDialog:r,Files:i,FullscreenUpload:n,GCodeViewer:o,Heightmap:m,History:d,JobQueue:z,Machine:k,Panels:p,PowerDeviceChangeDialog:c,Router:g,SelectPrinterDialog:u,Settings:b,Timelapse:v,title:y};export{e as App,t as ConnectionDialog,a as Console,s as Dialogs,l as Editor,r as EmergencyStopDialog,i as Files,n as FullscreenUpload,o as GCodeViewer,m as Heightmap,d as History,z as JobQueue,k as Machine,p as Panels,c as PowerDeviceChangeDialog,g as Router,u as SelectPrinterDialog,b as Settings,v as Timelapse,h as default,y as title}; diff --git a/dirs/mainsail/assets/index-57af1108.css b/dirs/mainsail/assets/index-57af1108.css deleted file mode 100644 index 17d4510..0000000 --- a/dirs/mainsail/assets/index-57af1108.css +++ /dev/null @@ -1 +0,0 @@ -.expanded header.v-toolbar[data-v-3cfcc6d8]{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.btn-collapsible>*[data-v-3cfcc6d8]{will-change:transform;transition:transform .5s}.icon-rotate-90[data-v-3cfcc6d8]{transform:rotate(90deg)}.panel-toolbar[data-v-3cfcc6d8]{overflow-y:hidden}[data-v-3cfcc6d8] .panel-toolbar .v-btn{height:100%!important;max-height:none}.v-card.panel .v-toolbar__content{padding-right:0}.v-card.panel .v-toolbar__content .subheading{-webkit-user-select:none;user-select:none}.panel-toolbar .v-btn.v-btn--icon{width:var(--panel-toolbar-icon-btn-width)!important}.klipper-logo[data-v-24513c96]{transform:rotate(90deg)}.moonraker-logo[data-v-24513c96]{transform:rotate(45deg);color:#ebc815}.version-container[data-v-24513c96]{display:grid;grid-template-columns:20px auto}.small-list-item[data-v-99ab1bec]{height:var(--sidebar-menu-item-height)}.active-nav-item[data-v-99ab1bec]{border-right:4px solid var(--v-primary-base)}.menu-item-icon[data-v-99ab1bec]{opacity:.85}.menu-item-title[data-v-99ab1bec]{line-height:30px;font-size:14px;font-weight:600;text-transform:uppercase;opacity:.85}._spin_button_group[data-v-799eadb6]{width:24px;margin-top:-6px;margin-left:-6px;margin-bottom:-6px}.v-input--has-state[data-v-799eadb6]{margin-bottom:-18px!important}._tool-slider-subheader[data-v-2b843f9d]{height:auto}._lock-button[data-v-2b843f9d]{margin-left:-6px}._error-msg[data-v-2b843f9d]{color:#ff5252;font-size:12px;padding:4px 16px 2px 0}.fade-enter-active[data-v-2b843f9d]{animation:slide-in-data-v-2b843f9d .15s reverse;opacity:1}.fade-leave-active[data-v-2b843f9d]{animation:slide-in-data-v-2b843f9d .15s;opacity:1}@keyframes slide-in-data-v-2b843f9d{to{transform:translateY(-5px)}}._slider-input[data-v-2b843f9d]{min-width:4.2rem;max-width:5rem;margin-left:12px}._slider-input[data-v-2b843f9d] .v-input__slot{min-height:1rem!important}._slider-input[data-v-2b843f9d] .v-text-field__slot input{padding-top:4px;padding-bottom:4px}._slider-input[data-v-2b843f9d] .v-input__append-inner{margin:auto -5px auto 0!important}._btn-group[data-v-eba60532]{border-radius:4px;display:inline-flex;flex-wrap:nowrap;max-width:100%;min-width:100%;width:100%}._btn-group .v-btn[data-v-eba60532]{border-radius:0;border-color:#ffffff1f;border-style:solid;border-width:thin;box-shadow:none;height:28px;opacity:.8;min-width:auto!important}._btn-group .v-btn[data-v-eba60532]:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}._btn-group .v-btn[data-v-eba60532]:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}._btn-group .v-btn[data-v-eba60532]:not(:first-child){border-left-width:0}html.theme--light ._btn-group .v-btn[data-v-eba60532]{border-color:#0000001f!important}._btn-qs[data-v-eba60532]{font-size:.8rem!important;max-height:24px}._btn-extruder-cmd[data-v-eba60532]{min-width:135px!important}._extruderColorState[data-v-956e3986]{width:15px;height:15px;border-radius:50%;border:1px solid lightgray}._btn-group[data-v-2b552b14]{border-radius:4px;display:inline-flex;flex-wrap:nowrap;max-width:100%;min-width:100%}._btn-group .v-btn[data-v-2b552b14]{border-radius:0;border-color:#ffffff1f;border-style:solid;border-width:thin;box-shadow:none;height:28px;opacity:.8;min-width:auto!important}._btn-group .v-btn[data-v-2b552b14]:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}._btn-group .v-btn[data-v-2b552b14]:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}._btn-group .v-btn[data-v-2b552b14]:not(:first-child){border-left-width:0}html.theme--light ._btn-group .v-btn[data-v-2b552b14]{border-color:#0000001f}.btnMacroMenu[data-v-029e4e5c]{border-top-left-radius:0;border-bottom-left-radius:0}.macroWithParameters[data-v-029e4e5c]{border-top-right-radius:0;border-bottom-right-radius:0}.btn-collapsible>*[data-v-28d7b868]{will-change:transform;transition:transform .5s}.icon-rotate-n90[data-v-28d7b868]{transform:rotate(-90deg)}.consoleTableRow[data-v-b5bd1d04]{font-family:Roboto Mono,monospace;font-size:.95em}.consoleTableRow.default .col[data-v-b5bd1d04]{padding-top:8px!important;padding-bottom:8px!important}.consoleTableRow.default+.consoleTableRow .col[data-v-b5bd1d04]{border-top:1px solid rgba(255,255,255,.12)}.consoleTableRow.compact .col[data-v-b5bd1d04]{padding-top:2px!important;padding-bottom:2px!important}html.theme--light .consoleTableRow.default+.consoleTableRow .col[data-v-b5bd1d04]{border-top:1px solid rgba(0,0,0,.12)}.command-help-content[data-v-06867a20]{overflow-x:hidden}.command-help-content.height300[data-v-06867a20]{height:300px}.command-help-content.mobileHeight[data-v-06867a20]{height:calc(var(--app-height) - 48px - 73px)}.consoleTable[data-v-4b06e9de]{border-top:1px solid rgba(255,255,255,.12)}html.theme--light .consoleTable[data-v-4b06e9de]{border-top:1px solid rgba(0,0,0,.12)}.gcode-command-field[data-v-4b06e9de]{font-family:Roboto Mono,monospace}.content span[data-v-05f4d966],.content strong[data-v-05f4d966]{padding-left:8px;padding-right:8px;white-space:pre-wrap}._fan-slider-subheader[data-v-291ea388]{height:auto}._lock-button[data-v-291ea388]{margin-left:-6px}._error-msg[data-v-291ea388]{color:#ff5252;font-size:12px;padding:4px 16px 2px 0}.fade-enter-active[data-v-291ea388]{animation:slide-in-data-v-291ea388 .15s reverse;opacity:1}.fade-leave-active[data-v-291ea388]{animation:slide-in-data-v-291ea388 .15s;opacity:1}@keyframes slide-in-data-v-291ea388{to{transform:translateY(-5px)}}._slider-input[data-v-291ea388]{min-width:4.2rem;max-width:5rem;margin-left:12px}._slider-input[data-v-291ea388] .v-input__slot{min-height:1rem!important}._slider-input[data-v-291ea388] .v-text-field__slot input{padding:4px 0}._light-subheader[data-v-aca41388]{height:auto}._currentState[data-v-aca41388]{width:15px;height:15px;border-radius:50%;border:1px solid lightgray;cursor:pointer}.light-presets-container[data-v-aca41388]{gap:6px}.light-presets-container>div[data-v-aca41388]{width:28px;height:28px;border-radius:4px;cursor:pointer}._filamentRunout-subheader[data-v-0d751882]{height:auto}.text--filament[data-v-6caf4e0e]{font-size:1.1rem}.no--padding[data-v-6caf4e0e]{padding:0}.line-height-auto[data-v-dfb564f4]{line-height:1}.filesJobqueue[data-v-2c9673dc]{position:relative}._spin_button_group[data-v-2c9673dc]{width:24px;margin-top:-6px;margin-left:-6px;margin-bottom:-6px}.filesJobqueue[data-v-3d360c2d]{position:relative}.settings-row-title[data-v-ac415fda]{display:block;width:100%;font-weight:700}.settings-row-subtitle[data-v-ac415fda]{display:block;font-size:.8em;line-height:1.3;margin-top:3px}.settings-row-slot[data-v-ac415fda]{min-height:64px}.filesGcodeCard[data-v-556064d8]{position:relative}._spin_button_group[data-v-556064d8]{width:24px;margin-top:-6px;margin-left:-6px;margin-bottom:-6px}svg[data-v-71825b43]{border:2px solid #888}#tooltipObjectMap[data-v-71825b43]{display:none;position:absolute;background:black;border-radius:3px;color:#fff;padding:3px 7px;z-index:100}#tooltipObjectMap[data-v-71825b43]:before{display:block;content:" ";width:0;height:0;position:absolute;bottom:-10px;left:10px;border-top:10px solid black;border-left:10px solid transparent;border-right:10px solid transparent}.statusPanel-big-thumbnail[data-v-7c42fe44]{transition:height .25s ease-out}.statusPanel-printstatus-thumbnail[data-v-7c42fe44]{position:relative}._border-radius[data-v-4b30acc0]{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.btnHomeAxis[data-v-23a679bf]{width:36px;min-width:36px!important}.btnGroup[data-v-23a679bf]{height:28px!important}.btnMinWidthAuto[data-v-23a679bf]{min-width:auto!important}._btn-group[data-v-23a679bf]{border-radius:4px;display:inline-flex;flex-wrap:nowrap;max-width:100%;min-width:100%;width:100%}._btn-group .v-btn[data-v-23a679bf]{border-radius:0;border-color:#ffffff1f;border-style:solid;border-width:thin;box-shadow:none;height:28px;opacity:.8;min-width:auto!important}._btn-group .v-btn[data-v-23a679bf]:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}._btn-group .v-btn[data-v-23a679bf]:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}._btn-group .v-btn[data-v-23a679bf]:not(:first-child){border-left-width:0}html.theme--light ._btn-group .v-btn[data-v-23a679bf]{border-color:#0000001f}svg[data-v-8e4f3fa8]{max-height:350px;min-height:275px;-webkit-user-select:none;user-select:none;filter:drop-shadow(0px 10px 10px rgba(0,0,0,.3))}svg a[data-v-8e4f3fa8]{stroke:#1a1a1a;stroke-width:.3px}svg a.step[data-v-8e4f3fa8]{transition:fill .75s ease-out}svg a.step[data-v-8e4f3fa8]:hover{fill:gray!important;transition:fill .1s ease-in}svg a.step[data-v-8e4f3fa8]:active{fill:#b3b3b3!important}svg a.step.inner[data-v-8e4f3fa8]{fill:#666}svg a.step.inner-mid[data-v-8e4f3fa8]{fill:#555}svg a.step.outer-mid[data-v-8e4f3fa8]{fill:#444}svg a.step.outer[data-v-8e4f3fa8]{fill:#333}html.theme--light svg a.step.inner[data-v-8e4f3fa8]{fill:#ccc}html.theme--light svg a.step.inner-mid[data-v-8e4f3fa8]{fill:#ddd}html.theme--light svg a.step.outer-mid[data-v-8e4f3fa8]{fill:#eee}html.theme--light svg a.step.outer[data-v-8e4f3fa8]{fill:#fff}svg .disabled a.step[data-v-8e4f3fa8]{pointer-events:none}svg g#stepsZ[data-v-8e4f3fa8],svg g#stepsXY[data-v-8e4f3fa8]{pointer-events:none;-webkit-user-select:none;user-select:none;font-family:Roboto-Regular,Roboto,sans-serif;font-size:3px;fill:#fff}html.theme--light svg g#stepsZ[data-v-8e4f3fa8],html.theme--light svg g#stepsXY[data-v-8e4f3fa8]{fill:#000}svg a#tilt_adjust text[data-v-8e4f3fa8]{font-family:Roboto-Regular,Roboto,sans-serif;font-size:3px;display:none}svg g#home_buttons text[data-v-8e4f3fa8]{font-family:Roboto-Regular,Roboto,sans-serif;font-size:5px;fill:#000}svg g.home_button[data-v-8e4f3fa8],svg a#home_all_center[data-v-8e4f3fa8]{fill:var(--color-warning);transition:opacity .25s}svg a.disabled[data-v-8e4f3fa8]{pointer-events:none}svg a.disabled .home_button path[data-v-8e4f3fa8],svg a.disabled circle[data-v-8e4f3fa8]{fill:#5c5c5c}svg g#stepsXY.disabled text[data-v-8e4f3fa8],svg g#stepsZ.disabled text[data-v-8e4f3fa8]{fill:#ffffff4d}html.theme--light svg g#stepsXY.disabled text[data-v-8e4f3fa8],html.theme--light svg g#stepsZ.disabled text[data-v-8e4f3fa8]{fill:#00000080}svg a#tilt_adjust[data-v-8e4f3fa8],svg a#stepper_off[data-v-8e4f3fa8]{transition:opacity .25s}svg a#tilt_adjust.warning[data-v-8e4f3fa8],svg a#stepper_off.warning[data-v-8e4f3fa8]{fill:var(--color-warning)}svg a#tilt_adjust.primary[data-v-8e4f3fa8],svg a#stepper_off.primary[data-v-8e4f3fa8]{fill:var(--color-primary)}svg .homed g.home_button[data-v-8e4f3fa8],svg .homed a#home_all_center[data-v-8e4f3fa8]{fill:var(--color-primary)}svg g.home_button[data-v-8e4f3fa8]:hover,svg a#home_all_center[data-v-8e4f3fa8]:hover,svg a#tilt_adjust[data-v-8e4f3fa8]:hover,svg a#stepper_off[data-v-8e4f3fa8]:hover{opacity:.8}svg a#tilt_adjust text[data-v-8e4f3fa8],svg a#tilt_adjust #tilt_icon[data-v-8e4f3fa8],svg a#stepper_off #stepper_off_icon[data-v-8e4f3fa8],svg g#home_buttons .home_icon[data-v-8e4f3fa8]{pointer-events:none;-webkit-user-select:none;user-select:none}svg a#tilt_adjust #tilt_icon[data-v-8e4f3fa8],svg a#stepper_off #stepper_off_icon[data-v-8e4f3fa8]{fill:#000}.btnMinWidthAuto[data-v-8c5676c8]{min-width:auto!important}.v-btn-toggle[data-v-51065007]{width:100%}._btn-group[data-v-51065007]{border-radius:4px;display:inline-flex;flex-wrap:nowrap;max-width:100%;min-width:100%;width:100%}._btn-group .v-btn[data-v-51065007]{border-radius:0;border-color:#ffffff1f;border-style:solid;border-width:thin;box-shadow:none;height:28px;opacity:.8;min-width:auto!important}._btn-group .v-btn[data-v-51065007]:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}._btn-group .v-btn[data-v-51065007]:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}._btn-group .v-btn[data-v-51065007]:not(:first-child){border-left-width:0}html.theme--light ._btn-group .v-btn[data-v-51065007]{border-color:#0000001f}._btn-qs[data-v-51065007]{font-size:.8rem!important;font-weight:400;max-height:28px}.tempchart[data-v-47f9c3f0]{width:100%}._temp-input[data-v-5e5067e7]{min-width:4.2rem;max-width:5rem}._temp-input[data-v-5e5067e7] .v-input__slot{min-height:1rem!important;padding-left:8px!important;padding-right:8px!important}._temp-input[data-v-5e5067e7] .v-text-field__slot input{padding-top:4px;padding-bottom:4px}._preset[data-v-5e5067e7]{font-size:.875rem}._preset-icon[data-v-5e5067e7]{margin-top:-1px;margin-right:4px}._preset-title[data-v-3edd7172]{font-size:.8125rem;font-weight:500}._fix_transparency[data-v-3edd7172]{background-color:#1e1e1e}[data-v-2263111c] .v-icon._no-focus-style:focus:after{opacity:0!important}[data-v-2263111c] .cursor-pointer{cursor:pointer}[data-v-8977b3c0] .v-icon._no-focus-style:focus:after{opacity:0!important}[data-v-8977b3c0] .cursor-pointer{cursor:pointer}.temperature-panel-table th[data-v-080ca807],.temperature-panel-table[data-v-080ca807] td{padding-top:5px!important;padding-bottom:5px!important;height:auto!important}.temperature-panel-table[data-v-080ca807] tr:hover{background:none!important}.temperature-panel-table[data-v-080ca807] .icon{width:24px;padding-right:0!important;text-align:center}.temperature-panel-table[data-v-080ca807] .state,.temperature-panel-table[data-v-080ca807] .current{width:100px;text-align:right!important}.temperature-panel-table[data-v-080ca807] .target{width:140px}.v-card.disabledPrinter[data-v-a9292318]{opacity:.6;filter:grayscale(70%)}.webcamContainer[data-v-a9292318],.webcamContainer .vue-load-image[data-v-a9292318],.webcamContainer>div[data-v-a9292318],.webcamContainer img[data-v-a9292318]{position:absolute!important;top:0;left:0;right:0;bottom:0}.webcamContainer img[data-v-a9292318]{height:100%}.webcamContainer .webcamFpsOutput[data-v-a9292318]{display:none}.v-overlay[data-v-a9292318]{top:48px}[data-v-a9292318] .farmprinter-panel{position:relative}.consoleScrollContainer[data-v-546b63d4]{min-height:200px;height:calc(var(--app-height) - 180px)}.gcode-command-field[data-v-546b63d4]{font-family:Roboto Mono,monospace}.navigation-divider[data-v-4b5d1549]{padding:0 2px}.navigation-segment[data-v-4b5d1549]:hover{text-decoration:underline}.navigation-container[data-v-4b5d1549]:last-child{font-weight:700}._spin_button_group[data-v-622b678e]{width:24px;margin-top:-6px;margin-left:-6px;margin-bottom:-6px}.files-table .v-data-table-header__icon{margin-left:7px}.files-table .file-list-cursor:hover{cursor:pointer}.file-list--select-td{width:20px}.files-table th.text-start{padding-right:0!important}.v-chip.minimum-chip{padding:0;min-width:24px}.v-chip.minimum-chip .v-chip__content{margin:0 auto}.file-list__count_printed{position:relative;top:1px}.handle{cursor:move}.jobqueue-panel[data-v-5e3c80e6]{position:relative}[data-v-bd1884ac] .history-jobs-table th{white-space:nowrap}[data-v-bd1884ac] .history-jobs-table th.text-start{padding-right:0!important}.v-data-table .v-data-table-header__icon[data-v-45e836df]{margin-left:7px}.v-data-table th[data-v-45e836df]{white-space:nowrap}.v-data-table .file-list-cursor[data-v-45e836df]:hover{cursor:pointer}li.commit[data-v-84e7ff68]{border-color:#30363d;border-style:solid;border-width:1px;border-bottom-width:0}li.commit[data-v-84e7ff68]:first-child{border-top-left-radius:6px;border-top-right-radius:6px}li.commit[data-v-84e7ff68]:last-child{border-bottom-width:1px;border-bottom-left-radius:6px;border-bottom-right-radius:6px}ul.commits[data-v-0afc8caa]{list-style:none}.groupedCommits[data-v-6e2f7877]{padding-top:0}[data-v-6e2f7877] .git-commit-list-day{padding-top:24px;padding-bottom:0}[data-v-6e2f7877] .git-commit-list-day .v-timeline-item__dot--small{width:18px;height:15px;margin-top:2px}[data-v-6e2f7877] .git-commit-list-day .v-timeline-item__dot--small:before{display:block;content:" ";position:relative;width:18px;height:2px;top:7px;background:rgba(255,255,255,.5);z-index:1}[data-v-6e2f7877] .git-commit-list-day .v-timeline-item__inner-dot{background-color:#1e1e1e!important;border:2px solid rgba(255,255,255,.5)!important;width:8px;height:8px;position:relative;z-index:2;margin-left:5px;margin-top:2px}[data-v-6e2f7877] .git-commit-list-day.git-commit-list-warning .v-timeline-item__dot--small{margin-top:10px}.system-packages-list[data-v-61fb1dc8]{font-family:monospace;margin-bottom:0!important}[data-v-8e04f428] .update-manager-list>div:last-child>div.row{padding-bottom:0!important}.cursor--pointer[data-v-d23ebeea],.cursor--pointer[data-v-0449534b]{cursor:pointer}.no-text-decoration[data-v-1a6ff80c]{text-decoration:none;background-color:transparent}.no-background[data-v-1a6ff80c]:before{background-color:#fff0!important}.no-border[data-v-1a6ff80c]{border:0!important}.nav-logo[data-v-1a6ff80c]{height:32px}.menu-item-icon[data-v-1a6ff80c]{opacity:.85}.nav-scrollbar[data-v-1a6ff80c]{height:100%}.minheight30[data-v-371c81fd]{min-height:30px}[data-v-3a5b3bca] ._transition svg{transition:transform .5s}[data-v-3a5b3bca] ._rotate-180 svg{transform:rotate(180deg)}.v-item-group button[data-v-3a5b3bca]:hover:before,.v-item-group button[data-v-3a5b3bca]:focus:before{opacity:0!important}.v-item-group ._menu-button[data-v-3a5b3bca]{height:40px;width:62px;border:1px solid rgba(255,255,255,.25)!important}.v-item-group ._menu-button[data-v-3a5b3bca]:hover{border-color:#fff!important}.v-item-group ._menu-button[data-v-3a5b3bca]:focus{border:2px solid var(--color-primary)!important}._webcam-settings-name-field[data-v-3a5b3bca] .v-text-field__details{margin-bottom:-12px!important}.handle[data-v-bd581aaa]{cursor:move}[data-v-021a8703] .ghost{opacity:.5;background:#c8ebfb}.v-list-item-group>span[data-v-021a8703]{display:block;height:100%}.dashboard-rows-container[data-v-50943ad9] .v-list-item-group{min-height:80px}.settings-tabs[data-v-0df340c4]{min-height:100%;height:calc(var(--app-height) - 96px)}.settings-tabs-bar[data-v-0df340c4]{border-right:1px solid rgba(255,255,255,.12);height:100%}html.theme--light .settings-tabs-bar[data-v-0df340c4]{border-right:1px solid rgba(0,0,0,.12)}.settings-tabs.height500[data-v-0df340c4]{height:500px;max-height:calc(var(--app-height) - 111px)}.settings-tabs .v-select__selections input{width:100px}.notification-menu-entry__headline[data-v-43cc0975]{line-height:1.2}.notification-menu-entry__description[data-v-43cc0975]{max-width:292px}.notification-menu-entry--priority-critical .notification-menu-entry__description[data-v-43cc0975]{max-width:336px}.announcement-menu__scrollbar[data-v-af5e252a]{max-height:500px}[data-v-569ec1a4] .topbar .v-toolbar__content{padding-top:0!important;padding-bottom:0!important}.button-min-width-auto[data-v-569ec1a4]{min-width:auto!important}.topbar .v-btn[data-v-569ec1a4]{height:100%!important;max-height:none}.topbar .v-btn.v-btn--icon[data-v-569ec1a4]{width:var(--topbar-icon-btn-width)!important}@media (min-width: 768px){header.topbar[data-v-569ec1a4]{z-index:8!important}}.updaterLogScroll[data-v-de6f962a]{height:350px;max-height:350px;overflow-x:hidden}.updaterLog .title-cell[data-v-de6f962a]{white-space:nowrap;vertical-align:top}.updaterLog.v-data-table>.v-data-table__wrapper>table>tbody>tr>td[data-v-de6f962a]{height:auto}[data-v-4d8cae4d] .ͼ1 .cm-panel.cm-search *:focus:not(.focus-visible){outline:none}[data-v-4d8cae4d] .ͼ1 .cm-panel.cm-search input[type=checkbox]{width:2.2em;height:2.2em;color:#1e90ff;vertical-align:middle;-webkit-appearance:none;border:10px;outline:0;flex-grow:0;border-radius:4px;background:var(--v-toolbar-base);transition:background .3s;cursor:pointer;margin-right:.5em}[data-v-4d8cae4d] .ͼ1 .cm-panel.cm-search input[type=checkbox]:before{content:"";color:transparent;display:block;width:inherit;height:inherit;border-radius:inherit;border:2px;background-color:transparent;background-size:contain;box-shadow:inset 0 0 0 1px #ccd3d8;font-size:16px}[data-v-4d8cae4d] .ͼ1 .cm-panel.cm-search input[type=checkbox]:checked{background-color:var(--color-primary)}[data-v-4d8cae4d] .ͼ1 .cm-panel.cm-search input[type=checkbox]:checked:before{box-shadow:none;background-color:var(--color-primary);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath d='M15.88 8.29L10 14.17l-1.88-1.88a.996.996 0 1 0-1.41 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0z' fill='%23fffff'/%3E %3C/svg%3E")}.fullscreen-upload__dragzone{position:fixed;top:0;right:0;bottom:0;left:0;height:100%;background:rgba(0,0,0,.5);z-index:99999;visibility:hidden;opacity:0;transition:visibility .2s,opacity .2s;font:700 42px Oswald,DejaVu Sans,Tahoma,sans-serif}.fullscreen-upload__dragzone--visible{opacity:1;visibility:visible}.fullscreen-upload__dragzone:before{display:block;content:" ";position:absolute;top:1em;right:1em;bottom:1em;left:1em;border:3px dashed white;border-radius:1em}.fullscreen-upload__icon .v-icon__svg{width:250px;height:250px}.fullscreen-upload__dragzone .textnode{text-align:center;transition:font-size 175ms;font-size:82px}.v-btn-toggle[data-v-01252f2e]{width:100%}._btn-group[data-v-01252f2e]{border-radius:4px;display:inline-flex;flex-wrap:nowrap;max-width:100%;min-width:100%;width:100%}._btn-group .v-btn[data-v-01252f2e]{border-radius:0;border-color:#ffffff1f!important;border-style:solid;border-width:thin;box-shadow:none;height:28px;opacity:.8;min-width:auto!important}._btn-group .v-btn[data-v-01252f2e]:first-child{border-top-left-radius:inherit;border-bottom-left-radius:inherit}._btn-group .v-btn[data-v-01252f2e]:last-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}._btn-group .v-btn[data-v-01252f2e]:not(:first-child){border-left-width:0}._btn-qs[data-v-01252f2e]{font-size:.8rem!important;font-weight:400;max-height:28px}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:100;src:local("Roboto Thin"),local("Roboto-Thin"),url(/fonts/roboto-thin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:300;src:local("Roboto Light"),local("Roboto-Light"),url(/fonts/roboto-light.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(/fonts/roboto-regular.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(/fonts/roboto-medium.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:local("Roboto Bold"),local("Roboto-Bold"),url(/fonts/roboto-bold.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:900;src:local("Roboto Black"),local("Roboto-Black"),url(/fonts/roboto-black.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:local("Roboto Mono"),local("Roboto-Mono"),url(/fonts/robotoMono-regular.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.v-toast__item--error{background-color:#f56565!important}.v-toast__item--success{background-color:#38a169!important}.v-toast__item--warning{background-color:#ed8936!important}.v-toast__text{font-family:Roboto,sans-serif}.fullscreenUpload--active .v-toast--bottom{bottom:88px}html{overflow:auto;scrollbar-color:#6b6b6b #272727}body{background:#121212}#page-container{max-width:1800px}.overflowingContentWidgets{visibility:hidden}.fill-width{width:100%}.mb-fix-2{margin-bottom:-8px!important}.mr-fix-2{margin-right:-8px!important}.mr-fix-1{margin-right:-4px!important}.gutter-2{margin:-2px!important}.gutter-2>.col,.gutter-2>[class*=col-]{padding:1px!important}.w-100{width:100%!important}.h-100{height:100%!important}.p-abs{position:absolute!important}.p-rel{position:relative!important}.settings-tabs{height:500px}.settings-tabs .v-window{overflow-y:auto!important}.editor-dialog .cm-editor{height:calc(100vh - 48px)}::-webkit-scrollbar{background-color:#272727;width:14px;height:14px}::-webkit-scrollbar-thumb{background-color:#6b6b6b;border-radius:7px;border:4px solid #272727;min-width:100px;min-height:100px}html.theme--light{scrollbar-color:rgba(0,0,0,.55) #ffffff}html.theme--light body{background:#ffffff!important}html.theme--light ::-webkit-scrollbar{background-color:#fff}html.theme--light ::-webkit-scrollbar-thumb{background-color:#0006;border-color:#fff}html.theme--light .os-theme-light>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle{background:rgba(0,0,0,.4)!important}html.theme--light .os-theme-light>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle:hover{background:rgba(0,0,0,.55)!important}#nav-header{text-align:center;border-bottom:1px solid #ffffff40;margin-bottom:1em;padding:.75em 0;display:flex;align-items:center;justify-content:center}#nav-header img{height:40px;margin-right:1em}#nav-header .v-toolbar__title{font-size:24px;vertical-align:middle}.v-navigation-drawer__content{z-index:10;padding-bottom:1em}nav ul.navi{list-style:none;padding:0;margin:0}nav ul.navi li.nav-item{padding:0;margin:0}nav ul.navi .nav-link{display:block;color:#fff;border-radius:.5em;line-height:30px;font-size:14px;font-weight:600;padding:10px 15px;opacity:.85;transition:all .15s ease-in;text-decoration:none;margin:.5em 1em}nav ul.navi .nav-link:hover,nav ul.navi li.active>.nav-link,nav ul.navi .nav-link.router-link-active{background:rgba(255,255,255,.3);opacity:1}nav ul.navi li.active>.nav-link i.nav-arrow,nav ul.navi .nav-link.router-link-active i.nav-arrow{transform:rotate(0)}nav ul.navi .nav-link>i.v-icon{color:#fff;font-size:1.7em;margin-right:.5em}nav ul.navi .nav-link>span.nav-title{line-height:30px;font-weight:600;text-transform:uppercase;white-space:nowrap;letter-spacing:1px}nav ul.navi .nav-link>.nav-arrow{float:right;margin-top:5px;margin-right:0;transform:rotate(90deg)}nav ul.navi .nav-link>.nav-arrow.right{transform:rotate(-90deg)}nav ul.navi>li>ul.child{display:none;list-style:none;padding:0;margin:0}nav ul.navi>li>a.router-link-active+ul.child,nav ul.navi>li.active>ul.child{display:block}nav ul.navi>li>ul.child .nav-link{padding:5px 15px}nav ul.navi>li>ul.child .nav-link:hover,nav ul.navi>li>ul.child .nav-link.router-link-active{background:rgba(255,255,255,.2)}nav ul.navi>li>ul.child .nav-link>span.nav-title{text-transform:capitalize;font-weight:400;font-size:14px}.user-select-none{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mainsail-editor{height:92%;width:100%;overflow:hidden;-webkit-overflow-scrolling:touch;user-select:auto;-webkit-user-select:auto}.echarts-tooltip{z-index:5!important}.tooltip__content-opacity1{opacity:1!important}.v-btn.minwidth-0{min-width:auto!important}.minHeight36{min-height:36px}.cursor-pointer{cursor:pointer!important}.icon-rotate{animation-name:spin;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear}.v-toast{padding:8px!important}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}@media screen and (max-width: 480px){.v-application--is-ltr .updateManager.v-timeline--dense:not(.v-timeline--reverse):before{left:23px}.updateManager .v-timeline-item__divider{min-width:48px}.updateManager.v-timeline--dense .v-timeline-item__body{max-width:calc(100% - 48px)}}:root{--app-height: 100%}#content{background-attachment:fixed;background-size:cover;background-repeat:no-repeat}.v-btn:not(.v-btn--outlined).primary{color:var(--v-btn-text-primary)}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.v-toast--fade-out{animation-name:fadeOut}@keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}.v-toast--fade-in-down{animation-name:fadeInDown}@keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}.v-toast--fade-in-up{animation-name:fadeInUp}.fade-enter-active,.fade-leave-active{transition:opacity .15s ease-out}.fade-enter,.fade-leave-to{opacity:0}.v-toast{position:fixed;display:flex;top:0;bottom:0;left:0;right:0;padding:2em;overflow:hidden;z-index:1052;pointer-events:none}.v-toast__item{display:inline-flex;align-items:center;animation-duration:.15s;margin:.5em 0;box-shadow:0 1px 4px #0000001f,0 0 6px #0000000a;border-radius:.25em;pointer-events:auto;opacity:.92;color:#fff;min-height:3em;cursor:pointer}.v-toast__item--success{background-color:#47d78a}.v-toast__item--info{background-color:#1c85d5}.v-toast__item--warning{background-color:#febc22}.v-toast__item--error{background-color:#f7471c}.v-toast__item--default{background-color:#343a40}.v-toast__item.v-toast__item--top,.v-toast__item.v-toast__item--bottom{align-self:center}.v-toast__item.v-toast__item--top-right,.v-toast__item.v-toast__item--bottom-right{align-self:flex-end}.v-toast__item.v-toast__item--top-left,.v-toast__item.v-toast__item--bottom-left{align-self:flex-start}.v-toast__text{margin:0;padding:.5em 1em;word-break:break-word}.v-toast__icon{display:none}.v-toast.v-toast--top{flex-direction:column}.v-toast.v-toast--bottom{flex-direction:column-reverse}.v-toast.v-toast--custom-parent{position:absolute}@media screen and (max-width: 768px){.v-toast{padding:0;position:fixed!important}}.v-toast__item{opacity:1;min-height:4em}.v-toast__item .v-toast__text{padding:1.5em 1em}.v-toast__item .v-toast__icon{display:block;width:27px;min-width:27px;height:27px;margin-left:1em;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 45.999 45.999'%3e %3cpath fill='%23fff' d='M39.264 6.736c-8.982-8.981-23.545-8.982-32.528 0-8.982 8.982-8.981 23.545 0 32.528 8.982 8.98 23.545 8.981 32.528 0 8.981-8.983 8.98-23.545 0-32.528zM25.999 33a3 3 0 11-6 0V21a3 3 0 116 0v12zm-3.053-17.128c-1.728 0-2.88-1.224-2.844-2.735-.036-1.584 1.116-2.771 2.879-2.771 1.764 0 2.88 1.188 2.917 2.771-.001 1.511-1.152 2.735-2.952 2.735z'/%3e %3c/svg%3e") no-repeat}.v-toast__item.v-toast__item--success .v-toast__icon{background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3e %3cpath fill='%23fff' d='M26 0C11.664 0 0 11.663 0 26s11.664 26 26 26 26-11.663 26-26S40.336 0 26 0zm14.495 17.329l-16 18a1.997 1.997 0 01-2.745.233l-10-8a2 2 0 012.499-3.124l8.517 6.813L37.505 14.67a2.001 2.001 0 012.99 2.659z'/%3e %3c/svg%3e") no-repeat}.v-toast__item.v-toast__item--error .v-toast__icon{background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 51.976 51.976'%3e %3cpath fill='%23fff' d='M44.373 7.603c-10.137-10.137-26.632-10.138-36.77 0-10.138 10.138-10.137 26.632 0 36.77s26.632 10.138 36.77 0c10.137-10.138 10.137-26.633 0-36.77zm-8.132 28.638a2 2 0 01-2.828 0l-7.425-7.425-7.778 7.778a2 2 0 11-2.828-2.828l7.778-7.778-7.425-7.425a2 2 0 112.828-2.828l7.425 7.425 7.071-7.071a2 2 0 112.828 2.828l-7.071 7.071 7.425 7.425a2 2 0 010 2.828z'/%3e %3c/svg%3e") no-repeat}.v-toast__item.v-toast__item--warning .v-toast__icon{background:url("data:image/svg+xml,%3csvg viewBox='0 0 52 52' xmlns='http://www.w3.org/2000/svg'%3e %3cpath fill='%23fff' d='M49.466 41.26L29.216 6.85c-.69-1.16-1.89-1.85-3.22-1.85-1.32 0-2.53.69-3.21 1.85L2.536 41.26c-.71 1.2-.72 2.64-.03 3.85.68 1.18 1.89 1.89 3.24 1.89h40.51c1.35 0 2.56-.71 3.23-1.89.7-1.21.69-2.65-.02-3.85zm-25.53-21.405h3.381v3.187l-.724 8.92H24.66l-.725-8.92v-3.187zm2.97 17.344a1.712 1.712 0 01-1.267.543c-.491 0-.914-.181-1.268-.543a1.788 1.788 0 01-.531-1.297c0-.502.176-.935.53-1.297a1.712 1.712 0 011.269-.544c.49 0 .914.181 1.268.544s.53.795.53 1.297c0 .503-.176.934-.53 1.297z'/%3e %3c/svg%3e") no-repeat}.resize-observer[data-v-8859cc6c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-8859cc6c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1} diff --git a/dirs/mainsail/assets/index-97b4652c.js b/dirs/mainsail/assets/index-97b4652c.js deleted file mode 100644 index 3a0d4f2..0000000 --- a/dirs/mainsail/assets/index-97b4652c.js +++ /dev/null @@ -1,50 +0,0 @@ -import{V as y,_ as De,a as oa,b as ki,c as v,d as le,e as zx,f as g,g as jl,h as oe,i as q,j as bs,k as Lr,l as S,m as _,n as re,o as ne,p as at,q as pe,r as ke,s as K,t as Rs,u as Gt,v as rt,w as E,x as Zx,y as Js,z as Nl,A as Nt,B as Le,C as $e,D as Oe,E as we,F as dt,G as vt,H as up,I as Ai,J as Ns,K as qx,L as Vl,M as Te,N as ns,O as Bu,P as mn,Q as $b,R as Xx,S as au,T as ho,U as ss,W as dp,X as Yx,Y as Jx,Z as Kx,$ as ai,a0 as xb,a1 as Qx,a2 as oi,a3 as ew,a4 as tw,a5 as Gr,a6 as br,a7 as Zs,a8 as sw,a9 as rw,aa as iw,ab as nw,ac as wb,ad as aw,ae as ow,af as lw,ag as Ta,ah as Da,ai as cw,aj as uw,ak as Ma,al as of,am as dw,an as hw,ao as lf,ap as pw,aq as mw}from"./vuetify-52f40ce5.js";import{g as Fi,c as xr,a as hp,O as za}from"./overlayscrollbars-44d87bcf.js";import{i as fw,t as gw,u as vw,a as _w,b as bw,c as yw,d as Cw,e as $w,f as xw,g as ww,h as Sw}from"./echarts-9bc570b0.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();var Pw={exports:{}};(function(e){var s=function(t){var r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(F,G,x){F[G]=x.value},a,o=typeof Symbol=="function"?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(F,G,x){return Object.defineProperty(F,G,{value:x,enumerable:!0,configurable:!0,writable:!0}),F[G]}try{d({},"")}catch{d=function(G,x,P){return G[x]=P}}function h(F,G,x,P){var L=G&&G.prototype instanceof M?G:M,Y=Object.create(L.prototype),ae=new Q(P||[]);return n(Y,"_invoke",{value:ee(F,x,ae)}),Y}t.wrap=h;function p(F,G,x){try{return{type:"normal",arg:F.call(G,x)}}catch(P){return{type:"throw",arg:P}}}var m="suspendedStart",f="suspendedYield",b="executing",C="completed",w={};function M(){}function H(){}function A(){}var $={};d($,l,function(){return this});var T=Object.getPrototypeOf,I=T&&T(T(te([])));I&&I!==r&&i.call(I,l)&&($=I);var R=A.prototype=M.prototype=Object.create($);H.prototype=A,n(R,"constructor",{value:A,configurable:!0}),n(A,"constructor",{value:H,configurable:!0}),H.displayName=d(A,u,"GeneratorFunction");function W(F){["next","throw","return"].forEach(function(G){d(F,G,function(x){return this._invoke(G,x)})})}t.isGeneratorFunction=function(F){var G=typeof F=="function"&&F.constructor;return G?G===H||(G.displayName||G.name)==="GeneratorFunction":!1},t.mark=function(F){return Object.setPrototypeOf?Object.setPrototypeOf(F,A):(F.__proto__=A,d(F,u,"GeneratorFunction")),F.prototype=Object.create(R),F},t.awrap=function(F){return{__await:F}};function B(F,G){function x(Y,ae,de,ge){var ye=p(F[Y],F,ae);if(ye.type==="throw")ge(ye.arg);else{var tt=ye.arg,lt=tt.value;return lt&&typeof lt=="object"&&i.call(lt,"__await")?G.resolve(lt.__await).then(function(_t){x("next",_t,de,ge)},function(_t){x("throw",_t,de,ge)}):G.resolve(lt).then(function(_t){tt.value=_t,de(tt)},function(_t){return x("throw",_t,de,ge)})}}var P;function L(Y,ae){function de(){return new G(function(ge,ye){x(Y,ae,ge,ye)})}return P=P?P.then(de,de):de()}n(this,"_invoke",{value:L})}W(B.prototype),d(B.prototype,c,function(){return this}),t.AsyncIterator=B,t.async=function(F,G,x,P,L){L===void 0&&(L=Promise);var Y=new B(h(F,G,x,P),L);return t.isGeneratorFunction(G)?Y:Y.next().then(function(ae){return ae.done?ae.value:Y.next()})};function ee(F,G,x){var P=m;return function(Y,ae){if(P===b)throw new Error("Generator is already running");if(P===C){if(Y==="throw")throw ae;return se()}for(x.method=Y,x.arg=ae;;){var de=x.delegate;if(de){var ge=D(de,x);if(ge){if(ge===w)continue;return ge}}if(x.method==="next")x.sent=x._sent=x.arg;else if(x.method==="throw"){if(P===m)throw P=C,x.arg;x.dispatchException(x.arg)}else x.method==="return"&&x.abrupt("return",x.arg);P=b;var ye=p(F,G,x);if(ye.type==="normal"){if(P=x.done?C:f,ye.arg===w)continue;return{value:ye.arg,done:x.done}}else ye.type==="throw"&&(P=C,x.method="throw",x.arg=ye.arg)}}}function D(F,G){var x=G.method,P=F.iterator[x];if(P===a)return G.delegate=null,x==="throw"&&F.iterator.return&&(G.method="return",G.arg=a,D(F,G),G.method==="throw")||x!=="return"&&(G.method="throw",G.arg=new TypeError("The iterator does not provide a '"+x+"' method")),w;var L=p(P,F.iterator,G.arg);if(L.type==="throw")return G.method="throw",G.arg=L.arg,G.delegate=null,w;var Y=L.arg;if(!Y)return G.method="throw",G.arg=new TypeError("iterator result is not an object"),G.delegate=null,w;if(Y.done)G[F.resultName]=Y.value,G.next=F.nextLoc,G.method!=="return"&&(G.method="next",G.arg=a);else return Y;return G.delegate=null,w}W(R),d(R,u,"Generator"),d(R,l,function(){return this}),d(R,"toString",function(){return"[object Generator]"});function z(F){var G={tryLoc:F[0]};1 in F&&(G.catchLoc=F[1]),2 in F&&(G.finallyLoc=F[2],G.afterLoc=F[3]),this.tryEntries.push(G)}function X(F){var G=F.completion||{};G.type="normal",delete G.arg,F.completion=G}function Q(F){this.tryEntries=[{tryLoc:"root"}],F.forEach(z,this),this.reset(!0)}t.keys=function(F){var G=Object(F),x=[];for(var P in G)x.push(P);return x.reverse(),function L(){for(;x.length;){var Y=x.pop();if(Y in G)return L.value=Y,L.done=!1,L}return L.done=!0,L}};function te(F){if(F||F===""){var G=F[l];if(G)return G.call(F);if(typeof F.next=="function")return F;if(!isNaN(F.length)){var x=-1,P=function L(){for(;++x=0;--P){var L=this.tryEntries[P],Y=L.completion;if(L.tryLoc==="root")return x("end");if(L.tryLoc<=this.prev){var ae=i.call(L,"catchLoc"),de=i.call(L,"finallyLoc");if(ae&&de){if(this.prev=0;--x){var P=this.tryEntries[x];if(P.tryLoc<=this.prev&&i.call(P,"finallyLoc")&&this.prev=0;--G){var x=this.tryEntries[G];if(x.finallyLoc===F)return this.complete(x.completion,x.afterLoc),X(x),w}},catch:function(F){for(var G=this.tryEntries.length-1;G>=0;--G){var x=this.tryEntries[G];if(x.tryLoc===F){var P=x.completion;if(P.type==="throw"){var L=P.arg;X(x)}return L}}throw new Error("illegal catch attempt")},delegateYield:function(F,G,x){return this.delegate={iterator:te(F),resultName:G,nextLoc:x},this.method==="next"&&(this.arg=a),w}},t}(e.exports);try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}})(Pw);var Sb=function(){if(typeof Map<"u")return Map;function e(s,t){var r=-1;return s.some(function(i,n){return i[0]===t?(r=n,!0):!1}),r}return function(){function s(){this.__entries__=[]}return Object.defineProperty(s.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),s.prototype.get=function(t){var r=e(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},s.prototype.set=function(t,r){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},s.prototype.delete=function(t){var r=this.__entries__,i=e(r,t);~i&&r.splice(i,1)},s.prototype.has=function(t){return!!~e(this.__entries__,t)},s.prototype.clear=function(){this.__entries__.splice(0)},s.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,n=this.__entries__;i0},e.prototype.connect_=function(){!Wu||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Lw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Wu||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(s){var t=s.propertyName,r=t===void 0?"":t,i=Ow.some(function(n){return!!~r.indexOf(n)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Pb=function(e,s){for(var t=0,r=Object.keys(s);t"u"||!(Element instanceof Object))){if(!(s instanceof li(s).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(s)||(t.set(s,new Vw(s)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(s){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(s instanceof li(s).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(s)&&(t.delete(s),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var s=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&s.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var s=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new Uw(r.target,r.broadcastRect())});this.callback_.call(s,t,s),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Db=typeof WeakMap<"u"?new WeakMap:new Sb,Mb=function(){function e(s){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=kw.getInstance(),r=new Bw(s,t,this);Db.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Mb.prototype[e]=function(){var s;return(s=Db.get(this))[e].apply(s,arguments)}});(function(){return typeof po.ResizeObserver<"u"?po.ResizeObserver:Mb})();/** - * vue-class-component v7.2.6 - * (c) 2015-present Evan You - * @license MIT - */function Za(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Za=function(s){return typeof s}:Za=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Za(e)}function Ww(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Gw(e){return zw(e)||Zw(e)||qw()}function zw(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s1&&arguments[1]!==void 0?arguments[1]:{};s.name=s.name||e._componentTag||e.name;var t=e.prototype;Object.getOwnPropertyNames(t).forEach(function(o){if(o!=="constructor"){if(Gu.indexOf(o)>-1){s[o]=t[o];return}var l=Object.getOwnPropertyDescriptor(t,o);l.value!==void 0?typeof l.value=="function"?(s.methods||(s.methods={}))[o]=l.value:(s.mixins||(s.mixins=[])).push({data:function(){return Ww({},o,l.value)}}):(l.get||l.set)&&((s.computed||(s.computed={}))[o]={get:l.get,set:l.set})}}),(s.mixins||(s.mixins=[])).push({data:function(){return eS(this,e)}});var r=e.__decorators__;r&&(r.forEach(function(o){return o(s)}),delete e.__decorators__);var i=Object.getPrototypeOf(e.prototype),n=i instanceof y?i.constructor:y,a=n.extend(s);return sS(a,e,n),Xw()&&Yw(a,e),a}var tS={prototype:!0,arguments:!0,callee:!0,caller:!0};function sS(e,s,t){Object.getOwnPropertyNames(s).forEach(function(r){if(!tS[r]){var i=Object.getOwnPropertyDescriptor(e,r);if(!(i&&!i.configurable)){var n=Object.getOwnPropertyDescriptor(s,r);if(!Kw){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!Qw(n.value)&&a&&a.value===n.value)return}Object.defineProperty(e,r,n)}}})}function O(e){return typeof e=="function"?uf(e):function(s){return uf(s,e)}}O.registerHooks=function(s){Gu.push.apply(Gu,Gw(s))};globalThis&&globalThis.__spreadArrays;var rS=typeof Reflect<"u"&&typeof Reflect.getMetadata<"u";function iS(e,s,t){if(rS&&!Array.isArray(e)&&typeof e!="function"&&!e.hasOwnProperty("type")&&typeof e.type>"u"){var r=Reflect.getMetadata("design:type",s,t);r!==Object&&(e.type=r)}}function k(e){return e===void 0&&(e={}),function(s,t){iS(e,s,t),Bl(function(r,i){(r.props||(r.props={}))[i]=e})(s,t)}}function Eb(e){return Bl(function(s,t){s.computed=s.computed||{},s.computed[t]={cache:!1,get:function(){return this.$refs[e||t]}}})}function nS(e){e===void 0&&(e={});var s="value";return Bl(function(t,r){(t.props||(t.props={}))[s]=e,(t.computed||(t.computed={}))[r]={get:function(){return this[s]},set:function(i){this.$emit("input",i)}}})}function me(e,s){s===void 0&&(s={});var t=s.deep,r=t===void 0?!1:t,i=s.immediate,n=i===void 0?!1:i;return Bl(function(a,o){typeof a.watch!="object"&&(a.watch=Object.create(null));var l=a.watch;typeof l[e]=="object"&&!Array.isArray(l[e])?l[e]=[l[e]]:typeof l[e]>"u"&&(l[e]=[]),l[e].push({handler:o,deep:r,immediate:n})})}var aS=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,lS=(e,s,t,r)=>{for(var i=r>1?void 0:r?oS(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&aS(s,t,i),i};let V=class extends y{get apiUrl(){return this.$store.getters["socket/getUrl"]}get hostUrl(){return this.$store.getters["socket/getHostUrl"]}get hostPort(){var e;return parseInt((e=this.$store.state.socket.port)!=null?e:80)}get instancesDB(){var e;return(e=this.$store.state.instancesDB)!=null?e:"moonraker"}get socketIsConnected(){var e;return(e=this.$store.state.socket.isConnected)!=null?e:!1}get guiIsReady(){return this.$store.state.socket.initializationList.length===0}get klippyIsConnected(){var e;return(e=this.$store.state.server.klippy_connected)!=null?e:!1}get klipperState(){var e;return this.klippyIsConnected?(e=this.$store.state.server.klippy_state)!=null?e:"":"disconnected"}get klipperReadyForGui(){return this.socketIsConnected&&this.klipperState==="ready"}get printerIsPrinting(){return this.klipperReadyForGui&&["printing","paused"].includes(this.printer_state)}get printerIsPrintingOnly(){return this.klipperReadyForGui&&this.printer_state==="printing"}get printerPowerDevice(){var s;let e=(s=this.$store.state.gui.uiSettings.powerDeviceName)!=null?s:null;return e===null&&(e="printer"),e}get isPrinterPowerOff(){var r;const e=(r=this.$store.getters["server/power/getDevices"])!=null?r:[];if(e.length===0)return!1;const s=e.findIndex(i=>i.device===this.printerPowerDevice);return s===-1||e[s].status!=="off"?!1:!this.klippyIsConnected}get loadings(){var e;return(e=this.$store.state.socket.loadings)!=null?e:[]}get printer_state(){var t,r,i,n,a,o;const e=(n=(i=(t=this.$store.state.printer.print_stats)==null?void 0:t.state)!=null?i:(r=this.$store.state.printer.idle_timeout)==null?void 0:r.state)!=null?n:"",s=(o=(a=this.$store.state.printer["gcode_macro TIMELAPSE_TAKE_FRAME"])==null?void 0:a.is_paused)!=null?o:!1;return e==="paused"&&s?"printing":e}get isMobile(){return this.$vuetify.breakpoint.mobile}get isTablet(){return this.$vuetify.breakpoint.smAndUp&&!this.isDesktop&&!this.isWidescreen}get isDesktop(){return this.$vuetify.breakpoint.lgAndUp&&!this.isWidescreen}get isWidescreen(){return this.$vuetify.breakpoint.xl}get viewport(){return this.isMobile?"mobile":this.isTablet?"tablet":this.isDesktop?"desktop":"widescreen"}get isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0&&navigator.maxTouchPoints!==256}get isIOS(){return!!(navigator.userAgent.match(/(iPad|iPhone|iPod)/)||navigator.platform==="MacIntel"&&typeof navigator.standalone<"u")}get moonrakerComponents(){var e,s;return(s=(e=this.$store.state.server)==null?void 0:e.components)!=null?s:[]}get existGcodesRootDirectory(){return this.$store.state.server.registered_directories.findIndex(s=>s==="gcodes")>=0}get formatDateOptions(){switch(this.$store.state.gui.general.dateFormat){case"2-digits":return{day:"2-digit",month:"2-digit",year:"numeric"};case"short":return{day:"2-digit",month:"short",year:"numeric"};default:return{dateStyle:"medium"}}}get formatTimeOptions(){switch(this.$store.state.gui.general.timeFormat){case"24hours":return{hour:"2-digit",minute:"2-digit",hourCycle:"h23"};case"12hours":return{hour:"2-digit",minute:"2-digit",hourCycle:"h12"};default:return{timeStyle:"short"}}}get formatTimeWithSecondsOptions(){switch(this.$store.state.gui.general.timeFormat){case"24hours":return{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"};case"12hours":return{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h12"};default:return{timeStyle:"short"}}}get browserLocale(){return navigator.language}get hours12Format(){return this.$store.getters["gui/getHours12Format"]}formatDate(e){let s=null;try{s=typeof e.getMonth=="function"?e:new Date(e)}catch{return"UNKNOWN"}return s.toLocaleDateString(this.browserLocale,this.formatDateOptions)}formatTime(e,s=!1){let t=null;try{t=typeof e.getMonth=="function"?e:new Date(e)}catch{return"UNKNOWN"}return s?t.toLocaleTimeString(this.browserLocale,this.formatTimeWithSecondsOptions):t.toLocaleTimeString(this.browserLocale,this.formatTimeOptions)}formatDateTime(e,s=!1){const t=this.formatDate(e),r=this.formatTime(e,s);return"".concat(t," ").concat(r)}};V=lS([O],V);const Ob="dark",$n="#D41216",pp="#2196f3",zt="#1e1e1e",df="v0.11.0-257",hf="v0.8.0-137",cS=[{name:"safari",version:"16.5.2"}],uS=["#F44336","#8e379d","#03DAC5","#3F51B5","#ffde03","#009688","#E91E63"],dS="#2196F3",hS="#4CAF50",Lb="99",kb="44",xn=".theme",pS=1e3,on=["temperature","target","power","speed"],wn=["power","speed"],mS=["bme280","aht10","htu21d"],ci=[".gcode",".g",".gco",".ufp",".nc"],Ab=["history","power","updateManager","timelapse","jobQueue","announcements","spoolman"],fS=["virtual_sdcard","pause_resume","gcode_macro pause","gcode_macro resume","gcode_macro cancel_print"],gS=["uuid","estimated_time","filament_name","filament_type","filament_total","filament_weight_total","nozzle_diameter","first_layer_bed_temp","first_layer_extr_temp","chamber_temp","first_layer_height","gcode_end_byte","gcode_start_byte","job_id","layer_height","object_height","print_start_time","size","slicer","slicer_version","thumbnails"],Ea=500,vS=50,_S=["toolhead-control","extruder-control","macros","machine-settings","miniconsole","miscellaneous","spoolman","temperature","webcam"],ms=30,fs=64,Os=128,bS=220,yS=48,zu=48,fn=48,CS=["^_TIMELAPSE_NEW_FRAME","^TIMELAPSE_TAKE_FRAME","^TIMELAPSE_RENDER","^_SET_TIMELAPSE_SETUP","^HYPERLAPSE ACTION=","^SET_GCODE_VARIABLE MACRO=TIMELAPSE_"],$S=["gcodes","timelapse","timelapse_frames"],xS=[".git"],wS=["it","hu","zh"],SS=["klippy","moonraker","crowsnest","mmu","sonar"],PS=["klipper","moonraker"];var Fb="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12Z",TS="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",DS="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",Rb="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",MS="M8.27,3L3,8.27V15.73L8.27,21H15.73C17.5,19.24 21,15.73 21,15.73V8.27L15.73,3M9.1,5H14.9L19,9.1V14.9L14.9,19H9.1L5,14.9V9.1M11,15H13V17H11V15M11,7H13V13H11V7",Sn="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",Wl="M19.92,12.08L12,20L4.08,12.08L5.5,10.67L11,16.17V2H13V16.17L18.5,10.66L19.92,12.08M12,20H2V22H22V20H12Z",ES="M4,12H20V14H4V12M4,9H20V11H4V9M16,4L12,8L8,4H11V1H13V4H16M8,19L12,15L16,19H13V22H11V19H8Z",OS="M9,4H15V12H19.84L12,19.84L4.16,12H9V4Z",Ib="M2,20V22H22V20H13V5.83L18.5,11.33L19.92,9.92L12,2L4.08,9.92L5.5,11.33L11,5.83V20H2Z",LS="M13,9V15H16L12,19L8,15H11V9H8L12,5L16,9H13M4,2H20V4H4V2M4,20H20V22H4V20Z",kS="M15,20H9V12H4.16L12,4.16L19.84,12H15V20Z",AS="M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21",FS="M22.11,21.46L2.39,1.73L1.11,3L5.83,7.72C5.29,8.73 5,9.86 5,11V17L3,19V20H18.11L20.84,22.73L22.11,21.46M7,18V11C7,10.39 7.11,9.79 7.34,9.23L16.11,18H7M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M8.29,5.09C8.82,4.75 9.4,4.5 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V15.8L17,13.8V11A5,5 0 0,0 12,6C11.22,6 10.45,6.2 9.76,6.56L8.29,5.09Z",RS="M10 21H14C14 22.1 13.1 23 12 23S10 22.1 10 21M21 19V20H3V19L5 17V11C5 7.9 7 5.2 10 4.3V4C10 2.9 10.9 2 12 2S14 2.9 14 4V4.3C17 5.2 19 7.9 19 11V17L21 19M17 11C17 8.2 14.8 6 12 6S7 8.2 7 11V18H17V11Z",Hb="M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z",rre="M20,5H17L15,3H9L7,5H4A2,2 0 0,0 2,7V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V7A2,2 0 0,0 20,5M12,18C10.92,18 9.86,17.65 9,17L10.44,15.56C10.91,15.85 11.45,16 12,16A3,3 0 0,0 15,13A3,3 0 0,0 12,10C10.74,10 9.6,10.8 9.18,12H11L8,15L5,12H7.1C7.65,9.29 10.29,7.55 13,8.1C15.7,8.65 17.45,11.29 16.9,14C16.42,16.33 14.38,18 12,18Z",IS="M15.9,18.5L21.9,20.1L21.5,22L12.1,19.5L2.7,22L2.2,20.1L8.2,18.5L2.1,16.9L2.6,15L12,17.5L21.4,15L21.9,16.9L15.9,18.5M16.07,7.92C15.91,7.7 15.71,7.5 15.5,7.33C15.05,6.9 14.5,6.59 14.06,6.13C13,5.08 12.79,3.34 13.44,2C12.79,2.17 12.18,2.54 11.67,2.95C9.84,4.46 9.11,7.1 10,9.38C10,9.45 10.04,9.53 10.04,9.62C10.04,9.78 9.93,9.92 9.79,10C9.63,10.05 9.46,10 9.33,9.9C9.28,9.86 9.25,9.82 9.22,9.77C8.42,8.74 8.29,7.26 8.84,6.07C7.65,7.06 7,8.72 7.11,10.29C7.13,10.65 7.18,11 7.3,11.36C7.41,11.8 7.59,12.23 7.82,12.61C8.57,13.86 9.9,14.76 11.32,14.94C12.84,15.14 14.46,14.85 15.63,13.79C16.93,12.59 17.4,10.67 16.71,9L16.61,8.83C16.47,8.5 16.28,8.2 16.04,7.93L16.07,7.92M13.83,12.47C13.63,12.65 13.31,12.83 13.05,12.91C12.26,13.19 11.46,12.79 11,12.31C11.84,12.11 12.34,11.47 12.5,10.83C12.61,10.25 12.39,9.78 12.29,9.22C12.21,8.69 12.22,8.23 12.42,7.73C12.55,8 12.69,8.28 12.86,8.5C13.41,9.22 14.27,9.54 14.45,10.5C14.47,10.63 14.5,10.72 14.5,10.83C14.5,11.43 14.26,12.07 13.82,12.47",jb="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",HS="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z",jS="M17.45,15.18L22,7.31V19L22,21H2V3H4V15.54L9.5,6L16,9.78L20.24,2.45L21.97,3.45L16.74,12.5L10.23,8.75L4.31,19H6.57L10.96,11.44L17.45,15.18Z",Nb="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",mp="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",fp="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",Vb="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",NS="M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z",Ub="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z",Vs="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",VS="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",US="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",BS="M9.42,7.41L4.83,12L9.42,16.59L8,18L2,12L8,6L9.42,7.41M15.42,7.41L10.83,12L15.42,16.59L14,18L8,12L14,6L15.42,7.41M21.42,7.41L16.83,12L21.42,16.59L20,18L14,12L20,6L21.42,7.41Z",WS="M14.58,16.59L19.17,12L14.58,7.41L16,6L22,12L16,18L14.58,16.59M8.58,16.59L13.17,12L8.58,7.41L10,6L16,12L10,18L8.58,16.59M2.58,16.59L7.17,12L2.58,7.41L4,6L10,12L4,18L2.58,16.59Z",la="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",GS="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",ca="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",zS="M20 2H8C6.9 2 6 2.9 6 4V16C6 17.11 6.9 18 8 18H20C21.11 18 22 17.11 22 16V4C22 2.9 21.11 2 20 2M20 16H8V4H20V16M4 6V20H18V22H4C2.9 22 2 21.11 2 20V6H4M9.77 12.84L12.6 10L9.77 7.15L11.17 5.75L14 8.6L16.84 5.77L18.24 7.17L15.4 10L18.23 12.84L16.83 14.24L14 11.4L11.17 14.24L9.77 12.84Z",fo="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",ZS="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z",Ce="M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z",Pn="M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.83 7.13 7.39 5.75 8.95 4.38 11 4.08V12.15L9.4 10.6L8 12L12 16L16 12L14.6 10.6L13 12.15V4.08Q15.58 4.43 17.29 6.39 19 8.35 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20Z",Tn="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z",Us="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",qS="M15.9,18.45C17.25,18.45 18.35,17.35 18.35,16C18.35,14.65 17.25,13.55 15.9,13.55C14.54,13.55 13.45,14.65 13.45,16C13.45,17.35 14.54,18.45 15.9,18.45M21.1,16.68L22.58,17.84C22.71,17.95 22.75,18.13 22.66,18.29L21.26,20.71C21.17,20.86 21,20.92 20.83,20.86L19.09,20.16C18.73,20.44 18.33,20.67 17.91,20.85L17.64,22.7C17.62,22.87 17.47,23 17.3,23H14.5C14.32,23 14.18,22.87 14.15,22.7L13.89,20.85C13.46,20.67 13.07,20.44 12.71,20.16L10.96,20.86C10.81,20.92 10.62,20.86 10.54,20.71L9.14,18.29C9.05,18.13 9.09,17.95 9.22,17.84L10.7,16.68L10.65,16L10.7,15.31L9.22,14.16C9.09,14.05 9.05,13.86 9.14,13.71L10.54,11.29C10.62,11.13 10.81,11.07 10.96,11.13L12.71,11.84C13.07,11.56 13.46,11.32 13.89,11.15L14.15,9.29C14.18,9.13 14.32,9 14.5,9H17.3C17.47,9 17.62,9.13 17.64,9.29L17.91,11.15C18.33,11.32 18.73,11.56 19.09,11.84L20.83,11.13C21,11.07 21.17,11.13 21.26,11.29L22.66,13.71C22.75,13.86 22.71,14.05 22.58,14.16L21.1,15.31L21.15,16L21.1,16.68M6.69,8.07C7.56,8.07 8.26,7.37 8.26,6.5C8.26,5.63 7.56,4.92 6.69,4.92A1.58,1.58 0 0,0 5.11,6.5C5.11,7.37 5.82,8.07 6.69,8.07M10.03,6.94L11,7.68C11.07,7.75 11.09,7.87 11.03,7.97L10.13,9.53C10.08,9.63 9.96,9.67 9.86,9.63L8.74,9.18L8,9.62L7.81,10.81C7.79,10.92 7.7,11 7.59,11H5.79C5.67,11 5.58,10.92 5.56,10.81L5.4,9.62L4.64,9.18L3.5,9.63C3.41,9.67 3.3,9.63 3.24,9.53L2.34,7.97C2.28,7.87 2.31,7.75 2.39,7.68L3.34,6.94L3.31,6.5L3.34,6.06L2.39,5.32C2.31,5.25 2.28,5.13 2.34,5.03L3.24,3.47C3.3,3.37 3.41,3.33 3.5,3.37L4.63,3.82L5.4,3.38L5.56,2.19C5.58,2.08 5.67,2 5.79,2H7.59C7.7,2 7.79,2.08 7.81,2.19L8,3.38L8.74,3.82L9.86,3.37C9.96,3.33 10.08,3.37 10.13,3.47L11.03,5.03C11.09,5.13 11.07,5.25 11,5.32L10.03,6.06L10.06,6.5L10.03,6.94Z",gp="M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z",ua="M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z",Bb="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",vp="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",XS="M4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M4,6V18H11V6H4M20,18V6H18.76C19,6.54 18.95,7.07 18.95,7.13C18.88,7.8 18.41,8.5 18.24,8.75L15.91,11.3L19.23,11.28L19.24,12.5L14.04,12.47L14,11.47C14,11.47 17.05,8.24 17.2,7.95C17.34,7.67 17.91,6 16.5,6C15.27,6.05 15.41,7.3 15.41,7.3L13.87,7.31C13.87,7.31 13.88,6.65 14.25,6H13V18H15.58L15.57,17.14L16.54,17.13C16.54,17.13 17.45,16.97 17.46,16.08C17.5,15.08 16.65,15.08 16.5,15.08C16.37,15.08 15.43,15.13 15.43,15.95H13.91C13.91,15.95 13.95,13.89 16.5,13.89C19.1,13.89 18.96,15.91 18.96,15.91C18.96,15.91 19,17.16 17.85,17.63L18.37,18H20M8.92,16H7.42V10.2L5.62,10.76V9.53L8.76,8.41H8.92V16Z",YS="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z",JS="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",Wb="M20 13.09V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19L13 18.95C12.68 19 12.35 19 12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.65 16 13.27 15.96 13.88 15.89C14.93 14.16 16.83 13 19 13C19.34 13 19.67 13.04 20 13.09M18 12.45C16.7 13.4 14.42 14 12 14S7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5 18 6.5 18 7 15.87 9 12 9M22 20L19 23L16 20H18V16H20V20H22Z",KS="M17.86 18L18.9 19C17.5 20.2 14.94 21 12 21C7.59 21 4 19.21 4 17V7C4 4.79 7.58 3 12 3C14.95 3 17.5 3.8 18.9 5L17.86 6L17.5 6.4C16.65 5.77 14.78 5 12 5C8.13 5 6 6.5 6 7S8.13 9 12 9C13.37 9 14.5 8.81 15.42 8.54L16.38 9.5H13.5V10.92C13 10.97 12.5 11 12 11C9.61 11 7.47 10.47 6 9.64V12.45C7.3 13.4 9.58 14 12 14C12.5 14 13 13.97 13.5 13.92V14.5H16.38L15.38 15.5L15.5 15.61C14.41 15.86 13.24 16 12 16C9.72 16 7.61 15.55 6 14.77V17C6 17.5 8.13 19 12 19C14.78 19 16.65 18.23 17.5 17.61L17.86 18M18.92 7.08L17.5 8.5L20 11H15V13H20L17.5 15.5L18.92 16.92L23.84 12L18.92 7.08Z",Ye="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",QS="M4.15,21.46L5.47,19.58C3.35,17.74 2,15.03 2,12A10,10 0 0,1 12,2C13.78,2 15.44,2.46 16.89,3.27L18.21,1.39L19.85,2.54L18.53,4.42C20.65,6.26 22,8.97 22,12A10,10 0 0,1 12,22C10.22,22 8.56,21.54 7.11,20.73L5.79,22.61L4.15,21.46M12,4A8,8 0 0,0 4,12C4,14.35 5,16.46 6.63,17.93L15.73,4.92C14.62,4.33 13.35,4 12,4M12,20A8,8 0 0,0 20,12C20,9.65 19,7.54 17.37,6.07L8.27,19.08C9.38,19.67 10.65,20 12,20Z",_p="M3,4H7A1,1 0 0,1 8,5V19A1,1 0 0,1 7,20H3A1,1 0 0,1 2,19V5A1,1 0 0,1 3,4M10,4H14A1,1 0 0,1 15,5V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V5A1,1 0 0,1 10,4M17,4H21A1,1 0 0,1 22,5V19A1,1 0 0,1 21,20H17A1,1 0 0,1 16,19V5A1,1 0 0,1 17,4M4,18H6V13H4V18M11,11H13V6H11V11M18,18H20V13H18V18Z",eP="M8,3C6.89,3 6,3.89 6,5V21H18V5C18,3.89 17.11,3 16,3H8M8,5H16V19H8V5M13,11V13H15V11H13Z",tP="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",Gl="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",Gb="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",zl="M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z",zb="M12,5L5.33,15H18.67M5,17H19V19H5V17Z",Zb="M7,4V6H10V8H7L5,10V13H3V10H1V18H3V15H5V18H8L10,20H18V16H20V19H23V9H20V12H18V8H12V6H15V4H7Z",bp="M3.78,2.5L21.5,20.22L20.23,21.5L18,19.27V20H10L8,18H5V15H3V18H1V10H3V13H5V10L6.87,8.14L2.5,3.77L3.78,2.5M20,9V12H18V8H12V6H15V4H7.82L22.82,19H23V9H20Z",sP="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",yp="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",ire="M13,6V18L21.5,12M4,18L12.5,12L4,6V18Z",dr="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",rP="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M10.5,11C8,11 6,13 6,15.5C6,18 8,20 10.5,20C13,20 15,18 15,15.5C15,13 13,11 10.5,11M10.5,12.5A3,3 0 0,1 13.5,15.5C13.5,16.06 13.35,16.58 13.08,17L9,12.92C9.42,12.65 9.94,12.5 10.5,12.5M7.5,15.5C7.5,14.94 7.65,14.42 7.92,14L12,18.08C11.58,18.35 11.06,18.5 10.5,18.5A3,3 0 0,1 7.5,15.5Z",iP="M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V20.09L12.09,18H6V16H14.09L16.09,14H6V12H18.09L20,10.09V8L14,2H6M13,3.5L18.5,9H13V3.5M20.15,13C20,13 19.86,13.05 19.75,13.16L18.73,14.18L20.82,16.26L21.84,15.25C22.05,15.03 22.05,14.67 21.84,14.46L20.54,13.16C20.43,13.05 20.29,13 20.15,13M18.14,14.77L12,20.92V23H14.08L20.23,16.85L18.14,14.77Z",da="M8,12H16V14H8V12M10,20H6V4H13V9H18V12.1L20,10.1V8L14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H10V20M8,18H12.1L13,17.1V16H8V18M20.2,13C20.3,13 20.5,13.1 20.6,13.2L21.9,14.5C22.1,14.7 22.1,15.1 21.9,15.3L20.9,16.3L18.8,14.2L19.8,13.2C19.9,13.1 20,13 20.2,13M20.2,16.9L14.1,23H12V20.9L18.1,14.8L20.2,16.9Z",Zl="M16 0H8C6.9 0 6 .9 6 2V18C6 19.1 6.9 20 8 20H20C21.1 20 22 19.1 22 18V6L16 0M20 18H8V2H15V7H20V18M4 4V22H20V24H4C2.9 24 2 23.1 2 22V4H4M10 10V12H18V10H10M10 14V16H15V14H10Z",nP="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z",aP="M15,7H20.5L15,1.5V7M8,0H16L22,6V18A2,2 0 0,1 20,20H8C6.89,20 6,19.1 6,18V2A2,2 0 0,1 8,0M4,4V22H20V24H4A2,2 0 0,1 2,22V4H4Z",qb="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",oP="M14 2H6C4.89 2 4 2.89 4 4V20C4 21.11 4.89 22 6 22H13.81C13.28 21.09 13 20.05 13 19C13 15.69 15.69 13 19 13C19.34 13 19.67 13.03 20 13.08V8L14 2M13 9V3.5L18.5 9H13M23 20H20V23H18V20H15V18H18V15H20V18H23V20Z",Xb="M12.8 22H6C4.9 22 4 21.1 4 20V4C4 2.9 4.9 2 6 2H14L20 8V11.5C19.4 11.2 18.7 11.1 18 11V9H13V4H6V20H11.5C11.8 20.7 12.3 21.4 12.8 22M17 12L14.8 14.2L17 16.4V15C18.4 15 19.5 16.1 19.5 17.5C19.5 17.9 19.4 18.3 19.2 18.6L20.3 19.7C20.7 19.1 21 18.3 21 17.5C21 15.3 19.2 13.5 17 13.5V12M19.2 20.8L17 18.5V20C15.6 20 14.5 18.9 14.5 17.5C14.5 17.1 14.6 16.7 14.8 16.4L13.7 15.3C13.3 15.9 13 16.7 13 17.5C13 19.7 14.8 21.5 17 21.5V23L19.2 20.8Z",Yb="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z",lP="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M17,19V13L14,15.2V13H7V19H14V16.8L17,19Z",cP="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",uP="M2.39 1.73L1.11 3L9.5 11.37L9.97 12H10V17.87C9.96 18.16 10.06 18.47 10.29 18.7L12.3 20.71C12.69 21.1 13.32 21.1 13.71 20.71C13.94 20.5 14.04 20.18 14 19.88V15.89L20.84 22.73L22.11 21.46L14 13.35L9.41 8.76L4.15 3.5L2.39 1.73M6.21 3L14.54 11.34L19.79 4.62C20.13 4.19 20.05 3.56 19.62 3.22C19.43 3.08 19.22 3 19 3H6.21Z",Ri="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",Cp="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",$p="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.12 13.3 20.1 13 19 13C15.69 13 13 15.69 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",xp="M20,6A2,2 0 0,1 22,8V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H10L12,6H20M10.75,13H14V17H16V13H19.25L15,8.75",dP="M20 6H12L10 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6M20 18H16V16H14V18H4V8H14V10H16V8H20V18M16 12V10H18V12H16M14 12H16V14H14V12M18 16H16V14H18V16Z",wp="M16.5,9L13.5,12L16.5,15H22V9M9,16.5V22H15V16.5L12,13.5M7.5,9H2V15H7.5L10.5,12M15,7.5V2H9V7.5L12,10.5L15,7.5Z",ql="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z",Jb="M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z",Xl="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",Kb="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",hP="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3",Qb="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",At="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",pP="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",mP="M12,18.54L19.37,12.8L21,14.07L12,21.07L3,14.07L4.62,12.81L12,18.54M12,16L3,9L12,2L21,9L12,16M12,4.53L6.26,9L12,13.47L17.74,9L12,4.53Z",Zu="M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z",e0="M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M11,18H13V15.87C14.73,15.43 16,13.86 16,12A4,4 0 0,0 12,8A4,4 0 0,0 8,12C8,13.86 9.27,15.43 11,15.87V18Z",Sp="M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",t0="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z",fP="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",s0="M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17S8 16.11 8 15 8.9 13 10 13M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.9 2 10V20C2 21.1 2.9 22 4 22H16C17.1 22 18 21.1 18 20V10C18 8.9 17.1 8 16 8H15V6C15 4.34 16.34 3 18 3S21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M16 10V20H4V10H16Z",Yl="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",Jl="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",r0="M17,17H7V7H17M21,11V9H19V7C19,5.89 18.1,5 17,5H15V3H13V5H11V3H9V5H7C5.89,5 5,5.89 5,7V9H3V11H5V13H3V15H5V17A2,2 0 0,0 7,19H9V21H11V19H13V21H15V19H17A2,2 0 0,0 19,17V15H21V13H19V11M13,13H11V11H13M15,9H9V15H15V9Z",gP="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",hr="M7,10L12,15L17,10H7Z",vP="M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M20 16H5.2L4 17.2V4H20V16Z",_P="M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M20 16H5.2L4 17.2V4H20V16M17 11H15V9H17M13 11H11V9H13M9 11H7V9H9",i0="M19,13H5V11H19V13Z",bP="M20 14H4V10H20",Pp="M21,16V4H3V16H21M21,2A2,2 0 0,1 23,4V16A2,2 0 0,1 21,18H14V20H16V22H8V20H10V18H3C1.89,18 1,17.1 1,16V4C1,2.89 1.89,2 3,2H21M5,6H14V11H5V6M15,6H19V8H15V6M19,9V14H15V9H19M5,12H9V14H5V12M10,12H14V14H10V12Z",yP="M9,6H5V10H7V8H9M19,10H17V12H15V14H19M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2",CP="M2 12A10 10 0 0 0 15 21.54A10 10 0 0 1 15 2.46A10 10 0 0 0 2 12Z",$P="M3,7V5H5V4C5,2.89 5.9,2 7,2H13V9L15.5,7.5L18,9V2H19C20.05,2 21,2.95 21,4V20C21,21.05 20.05,22 19,22H7C5.95,22 5,21.05 5,20V19H3V17H5V13H3V11H5V7H3M7,11H5V13H7V11M7,7V5H5V7H7M7,19V17H5V19H7Z",xP="M21.04 13.13C21.18 13.13 21.31 13.19 21.42 13.3L22.7 14.58C22.92 14.79 22.92 15.14 22.7 15.35L21.7 16.35L19.65 14.3L20.65 13.3C20.76 13.19 20.9 13.13 21.04 13.13M19.07 14.88L21.12 16.93L15.06 23H13V20.94L19.07 14.88M3 7V5H5V4C5 2.89 5.9 2 7 2H13V9L15.5 7.5L18 9V2H19C20.05 2 21 2.95 21 4V10L11 20V22H7C5.95 22 5 21.05 5 20V19H3V17H5V13H3V11H5V7H3M5 7H7V5H5V7M5 11V13H7V11H5M5 17V19H7V17H5Z",wP="M3 7V5H5V4C5 2.9 5.9 2 7 2H13V9L15.5 7.5L18 9V2H19C20 2 21 3 21 4V13.8C20.1 13.3 19.1 13 18 13C14.7 13 12 15.7 12 19C12 20.1 12.3 21.1 12.8 22H7C5.9 22 5 21 5 20V19H3V17H5V13H3V11H5V7H3M5 5V7H7V5H5M5 19H7V17H5V19M5 13H7V11H5V13M17 15V18H14V20H17V23H19V20H22V18H19V15H17Z",n0="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",SP="M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L10.11,5.22L16,8.61L17.96,7.5L12,4.15M6.04,7.5L12,10.85L13.96,9.75L8.08,6.35L6.04,7.5M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z",Kl="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",Tp="M14,19H18V5H14M6,19H10V5H6V19Z",xt="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Ii="M8,5.14V19.14L19,12.14L8,5.14Z",a0="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z",PP="M14 10H3V12H14V10M14 6H3V8H14V6M3 16H10V14H3V16M14.4 22L17 19.4L19.6 22L21 20.6L18.4 18L21 15.4L19.6 14L17 16.6L14.4 14L13 15.4L15.6 18L13 20.6L14.4 22Z",Dp="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",TP="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",o0="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",DP="M13,3H11V13H13V3M17.83,5.17L16.41,6.59C18.05,7.91 19,9.9 19,12A7,7 0 0,1 12,19C8.14,19 5,15.88 5,12C5,9.91 5.95,7.91 7.58,6.58L6.17,5.17C2.38,8.39 1.92,14.07 5.14,17.86C8.36,21.64 14.04,22.1 17.83,18.88C19.85,17.17 21,14.65 21,12C21,9.37 19.84,6.87 17.83,5.17Z",l0="M18,3H6V7H18M19,12A1,1 0 0,1 18,11A1,1 0 0,1 19,10A1,1 0 0,1 20,11A1,1 0 0,1 19,12M16,19H8V14H16M19,8H5A3,3 0 0,0 2,11V17H6V21H18V17H22V11A3,3 0 0,0 19,8Z",ha="M19,6A1,1 0 0,0 20,5A1,1 0 0,0 19,4A1,1 0 0,0 18,5A1,1 0 0,0 19,6M19,2A3,3 0 0,1 22,5V11H18V7H6V11H2V5A3,3 0 0,1 5,2H19M18,18.25C18,18.63 17.79,18.96 17.47,19.13L12.57,21.82C12.4,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L6.53,19.13C6.21,18.96 6,18.63 6,18.25V13C6,12.62 6.21,12.29 6.53,12.12L11.43,9.68C11.59,9.56 11.79,9.5 12,9.5C12.21,9.5 12.4,9.56 12.57,9.68L17.47,12.12C17.79,12.29 18,12.62 18,13V18.25M12,11.65L9.04,13L12,14.6L14.96,13L12,11.65M8,17.66L11,19.29V16.33L8,14.71V17.66M16,17.66V14.71L13,16.33V19.29L16,17.66Z",Bs="M7,2H17V8H19V13H16.5L13,17H11L7.5,13H5V8H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22Z",c0="M7 2H17V8H19V13H16.5L13 17H11L7.5 13H5V8H7V2M10 22H2V20H10C10.6 20 11 19.5 11 19V18H13V19C13 20.7 11.7 22 10 22M21 13V7H23V13H21M21 17V15H23V17H21Z",MP="M7,2H17V7H19V13H16.5L13,17H11L7.5,13H5V7H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22M7,9V11H8.5L12,15L15.5,11H17V9H15V4H9V9H7Z",EP="M13,2.03V2.05L13,4.05C17.39,4.59 20.5,8.58 19.96,12.97C19.5,16.61 16.64,19.5 13,19.93V21.93C18.5,21.38 22.5,16.5 21.95,11C21.5,6.25 17.73,2.5 13,2.03M11,2.06C9.05,2.25 7.19,3 5.67,4.26L7.1,5.74C8.22,4.84 9.57,4.26 11,4.06V2.06M4.26,5.67C3,7.19 2.25,9.04 2.05,11H4.05C4.24,9.58 4.8,8.23 5.69,7.1L4.26,5.67M2.06,13C2.26,14.96 3.03,16.81 4.27,18.33L5.69,16.9C4.81,15.77 4.24,14.42 4.06,13H2.06M7.1,18.37L5.67,19.74C7.18,21 9.04,21.79 11,22V20C9.58,19.82 8.23,19.25 7.1,18.37M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",u0="M13 18H11V16H13V18M13 15H11C11 11.75 14 12 14 10C14 8.9 13.1 8 12 8C10.9 8 10 8.9 10 10H8C8 7.79 9.79 6 12 6C14.21 6 16 7.79 16 10C16 12.5 13 12.75 13 15M22 12C22 17.18 18.05 21.45 13 21.95V19.94C16.95 19.45 20 16.08 20 12C20 7.92 16.95 4.55 13 4.06V2.05C18.05 2.55 22 6.82 22 12M11 2.05V4.06C9.54 4.24 8.2 4.82 7.09 5.68L5.67 4.26C7.15 3.05 9 2.25 11 2.05M4.06 11H2.05C2.25 9 3.05 7.15 4.26 5.67L5.68 7.1C4.82 8.2 4.24 9.54 4.06 11M11 19.94V21.95C9 21.75 7.15 20.96 5.67 19.74L7.09 18.32C8.2 19.18 9.54 19.76 11 19.94M2.05 13H4.06C4.24 14.46 4.82 15.8 5.68 16.91L4.26 18.33C3.05 16.85 2.25 15 2.05 13Z",Mp="M13,2.03C17.73,2.5 21.5,6.25 21.95,11C22.5,16.5 18.5,21.38 13,21.93V19.93C16.64,19.5 19.5,16.61 19.96,12.97C20.5,8.58 17.39,4.59 13,4.05V2.05L13,2.03M11,2.06V4.06C9.57,4.26 8.22,4.84 7.1,5.74L5.67,4.26C7.19,3 9.05,2.25 11,2.06M4.26,5.67L5.69,7.1C4.8,8.23 4.24,9.58 4.05,11H2.05C2.25,9.04 3,7.19 4.26,5.67M2.06,13H4.06C4.24,14.42 4.81,15.77 5.69,16.9L4.27,18.33C3.03,16.81 2.26,14.96 2.06,13M7.1,18.37C8.23,19.25 9.58,19.82 11,20V22C9.04,21.79 7.18,21 5.67,19.74L7.1,18.37M12,7.5L7.5,12H11V16H13V12H16.5L12,7.5Z",OP="M7.95,3L6.53,5.19L7.95,7.4H7.94L5.95,10.5L4.22,9.6L5.64,7.39L4.22,5.19L6.22,2.09L7.95,3M13.95,2.89L12.53,5.1L13.95,7.3L13.94,7.31L11.95,10.4L10.22,9.5L11.64,7.3L10.22,5.1L12.22,2L13.95,2.89M20,2.89L18.56,5.1L20,7.3V7.31L18,10.4L16.25,9.5L17.67,7.3L16.25,5.1L18.25,2L20,2.89M2,22V14A2,2 0 0,1 4,12H20A2,2 0 0,1 22,14V22H20V20H4V22H2M6,14A1,1 0 0,0 5,15V17A1,1 0 0,0 6,18A1,1 0 0,0 7,17V15A1,1 0 0,0 6,14M10,14A1,1 0 0,0 9,15V17A1,1 0 0,0 10,18A1,1 0 0,0 11,17V15A1,1 0 0,0 10,14M14,14A1,1 0 0,0 13,15V17A1,1 0 0,0 14,18A1,1 0 0,0 15,17V15A1,1 0 0,0 14,14M18,14A1,1 0 0,0 17,15V17A1,1 0 0,0 18,18A1,1 0 0,0 19,17V15A1,1 0 0,0 18,14Z",d0="M20,12H4A2,2 0 0,0 2,14V22H4V20H20V22H22V14A2,2 0 0,0 20,12M7,17A1,1 0 0,1 6,18A1,1 0 0,1 5,17V15A1,1 0 0,1 6,14A1,1 0 0,1 7,15V17M11,17A1,1 0 0,1 10,18A1,1 0 0,1 9,17V15A1,1 0 0,1 10,14A1,1 0 0,1 11,15V17M15,17A1,1 0 0,1 14,18A1,1 0 0,1 13,17V15A1,1 0 0,1 14,14A1,1 0 0,1 15,15V17M19,17A1,1 0 0,1 18,18A1,1 0 0,1 17,17V15A1,1 0 0,1 18,14A1,1 0 0,1 19,15V17Z",LP="M20,8H22V10H20V8M4,5H20A2,2 0 0,1 22,7H19V9H5V13H8V16H19V17H22A2,2 0 0,1 20,19H16V20H14V19H11V20H7V19H4A2,2 0 0,1 2,17V7A2,2 0 0,1 4,5M19,15H9V10H19V11H22V13H19V15M13,12V14H15V12H13M5,6V8H6V6H5M7,6V8H8V6H7M9,6V8H10V6H9M11,6V8H12V6H11M13,6V8H14V6H13M15,6V8H16V6H15M20,14H22V16H20V14Z",Hi="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",kP="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",nre="M2 12C2 17 6 21 11 21C13.4 21 15.7 20.1 17.4 18.4L15.9 16.9C14.6 18.3 12.9 19 11 19C4.8 19 1.6 11.5 6.1 7.1S18 5.8 18 12H15L19 16H19.1L23 12H20C20 7 16 3 11 3S2 7 2 12M10 15H12V17H10V15M10 7H12V13H10V7",Ql="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",jr="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z",AP="M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",FP="M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39C21.61 2.39 16.66 .269 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.79 17.45 10.61 17.63 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z",RP="M13,4.07V1L8.45,5.55L13,10V6.09C15.84,6.57 18,9.03 18,12C18,14.97 15.84,17.43 13,17.91V19.93C16.95,19.44 20,16.08 20,12C20,7.92 16.95,4.56 13,4.07M7.1,18.32C8.26,19.22 9.61,19.76 11,19.93V17.9C10.13,17.75 9.29,17.41 8.54,16.87L7.1,18.32M6.09,13H4.07C4.24,14.39 4.79,15.73 5.69,16.89L7.1,15.47C6.58,14.72 6.23,13.88 6.09,13M7.11,8.53L5.7,7.11C4.8,8.27 4.24,9.61 4.07,11H6.09C6.23,10.13 6.58,9.28 7.11,8.53Z",IP="M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z",go="M20 20V17H22V20C22 21.11 21.1 22 20 22H17V20H20M2 20V17H4V20H7V22H4C2.9 22 2 21.1 2 20M10 20H14V22H10V20M14.59 8L12 10.59L9.41 8L8 9.41L10.59 12L8 14.59L9.41 16L12 13.41L14.59 16L16 14.59L13.41 12L16 9.41L14.59 8M20 10H22V14H20V10M2 10H4V14H2V10M2 4C2 2.89 2.9 2 4 2H7V4H4V7H2V4M22 4V7H20V4H17V2H20C21.1 2 22 2.9 22 4M10 2H14V4H10V2Z",h0="M2,21L23,12L2,3V10L17,12L2,14V21Z",HP="M23,12H17V10L20.39,6H17V4H23V6L19.62,10H23V12M15,16H9V14L12.39,10H9V8H15V10L11.62,14H15V16M7,20H1V18L4.39,14H1V12H7V14L3.62,18H7V20Z",p0="M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",jP="M12,16A3,3 0 0,1 9,13C9,11.88 9.61,10.9 10.5,10.39L20.21,4.77L14.68,14.35C14.18,15.33 13.17,16 12,16M12,3C13.81,3 15.5,3.5 16.97,4.32L14.87,5.53C14,5.19 13,5 12,5A8,8 0 0,0 4,13C4,15.21 4.89,17.21 6.34,18.65H6.35C6.74,19.04 6.74,19.67 6.35,20.06C5.96,20.45 5.32,20.45 4.93,20.07V20.07C3.12,18.26 2,15.76 2,13A10,10 0 0,1 12,3M22,13C22,15.76 20.88,18.26 19.07,20.07V20.07C18.68,20.45 18.05,20.45 17.66,20.06C17.27,19.67 17.27,19.04 17.66,18.65V18.65C19.11,17.2 20,15.21 20,13C20,12 19.81,11 19.46,10.1L20.67,8C21.5,9.5 22,11.18 22,13Z",are="M17.36,20.2V14.82H19.15V22H3V14.82H4.8V20.2H17.36M6.77,14.32L7.14,12.56L15.93,14.41L15.56,16.17L6.77,14.32M7.93,10.11L8.69,8.5L16.83,12.28L16.07,13.9L7.93,10.11M10.19,6.12L11.34,4.74L18.24,10.5L17.09,11.87L10.19,6.12M14.64,1.87L20,9.08L18.56,10.15L13.2,2.94L14.64,1.87M6.59,18.41V16.61H15.57V18.41H6.59Z",m0="M18,18H6V6H18V18Z",NP="M9,3L5,7H8V14H10V7H13M16,17V10H14V17H11L15,21L19,17H16Z",f0="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z",VP="M19,18H5V6H19M21,4H3C1.89,4 1,4.89 1,6V18A2,2 0 0,0 3,20H21A2,2 0 0,0 23,18V6C23,4.89 22.1,4 21,4Z",UP="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.21 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M7,15V17H9C9.14,18.55 9.8,19.94 10.81,21H5C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H19A2,2 0 0,1 21,5V13.03C19.85,11.21 17.82,10 15.5,10C14.23,10 13.04,10.37 12.04,11H7V13H10C9.64,13.6 9.34,14.28 9.17,15H7M17,9V7H7V9H17Z",g0="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.21 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M5,3H19C20.11,3 21,3.89 21,5V13.03C20.5,12.23 19.81,11.54 19,11V5H5V19H9.5C9.81,19.75 10.26,20.42 10.81,21H5C3.89,21 3,20.11 3,19V5C3,3.89 3.89,3 5,3M7,7H17V9H7V7M7,11H12.03C11.23,11.5 10.54,12.19 10,13H7V11M7,15H9.17C9.06,15.5 9,16 9,16.5V17H7V15Z",BP="M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",v0="M17 3H21V5H17V3M17 7H21V9H17V7M17 11H21V13H17.75L17 12.1V11M21 15V17H19C19 16.31 18.9 15.63 18.71 15H21M7 3V5H3V3H7M7 7V9H3V7H7M7 11V12.1L6.25 13H3V11H7M3 15H5.29C5.1 15.63 5 16.31 5 17H3V15M15 13V5C15 3.34 13.66 2 12 2S9 3.34 9 5V13C6.79 14.66 6.34 17.79 8 20S12.79 22.66 15 21 17.66 16.21 16 14C15.72 13.62 15.38 13.28 15 13M12 4C12.55 4 13 4.45 13 5V8H11V5C11 4.45 11.45 4 12 4Z",_0="M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.24,7.76C15.07,6.58 13.53,6 12,6V12L7.76,16.24C10.1,18.58 13.9,18.58 16.24,16.24C18.59,13.9 18.59,10.1 16.24,7.76Z",WP="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z",Ep="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z",GP="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M7,15A3,3 0 0,1 4,12A3,3 0 0,1 7,9A3,3 0 0,1 10,12A3,3 0 0,1 7,15Z",b0="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",y0="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",zP="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",ZP="M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z",qP="M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z",pa="M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z",XP="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",ec="M5,7H9A2,2 0 0,1 11,9V15A2,2 0 0,1 9,17H5V15H9V13H6V11H9V9H5V7M13,7H16A3,3 0 0,1 19,10V14A3,3 0 0,1 16,17H13V7M16,15A1,1 0 0,0 17,14V10A1,1 0 0,0 16,9H15V15H16Z",YP="M19,5V7H15V5H19M9,5V11H5V5H9M19,13V19H15V13H19M9,17V19H5V17H9M21,3H13V9H21V3M11,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z",pf="M3,11H11V3H3M3,21H11V13H3M13,21H21V13H13M13,3V11H21V3",ji="M12,2A7,7 0 0,1 19,9A7,7 0 0,1 12,16A7,7 0 0,1 5,9A7,7 0 0,1 12,2M12,4A5,5 0 0,0 7,9A5,5 0 0,0 12,14A5,5 0 0,0 17,9A5,5 0 0,0 12,4M12,6A3,3 0 0,1 15,9A3,3 0 0,1 12,12A3,3 0 0,1 9,9A3,3 0 0,1 12,6M6,22A2,2 0 0,1 4,20C4,19.62 4.1,19.27 4.29,18.97L6.11,15.81C7.69,17.17 9.75,18 12,18C14.25,18 16.31,17.17 17.89,15.81L19.71,18.97C19.9,19.27 20,19.62 20,20A2,2 0 0,1 18,22H6Z",JP="M12 6C13.66 6 15 7.34 15 9C15 9.78 14.7 10.5 14.21 11L10 6.79C10.5 6.3 11.22 6 12 6M12 4C14.76 4 17 6.24 17 9C17 10.33 16.47 11.53 15.62 12.42L17.04 13.84C18.25 12.59 19 10.88 19 9C19 5.13 15.87 2 12 2C10.12 2 8.41 2.75 7.16 3.96L8.58 5.38C9.47 4.53 10.67 4 12 4M22.11 21.46L20.84 22.73L19.46 21.35C19.1 21.75 18.58 22 18 22H6C4.89 22 4 21.11 4 20C4 19.62 4.1 19.27 4.29 18.97L6.11 15.81C7.69 17.17 9.75 18 12 18C13.21 18 14.37 17.75 15.43 17.32L13.85 15.74C13.26 15.91 12.64 16 12 16C8.13 16 5 12.87 5 9C5 8.36 5.09 7.74 5.26 7.15L1.11 3L2.39 1.73L22.11 21.46M12.1 14L7 8.9C7 8.93 7 8.97 7 9C7 11.76 9.24 14 12 14C12.03 14 12.07 14 12.1 14Z",KP="M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z",QP=Object.defineProperty,eT=Object.getOwnPropertyDescriptor,$s=(e,s,t,r)=>{for(var i=r>1?void 0:r?eT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&QP(s,t,i),i};let Zt=class extends j(V){constructor(){super(...arguments),this.mdiChevronDown=Vs,this.panelToolbarHeight=zu}get expand(){return this.$store.getters["gui/getPanelExpand"](this.cardClass,this.viewport)}set expand(s){this.$store.dispatch("gui/saveExpandPanel",{name:this.cardClass,value:s,viewport:this.viewport})}get hasIconSlot(){return!!this.$slots.icon}get hasButtonsSlot(){return!!this.$slots.buttons}get getToolbarClass(){let s=this.toolbarClass;return this.collapsible&&(s+=" collapsible"),s}get additionalStyle(){return this.$vuetify.theme.dark?"":"border-bottom: 1px solid #A8A8A8"}};$s([k({default:null})],Zt.prototype,"icon",2);$s([k({required:!0,default:""})],Zt.prototype,"title",2);$s([k({default:!1})],Zt.prototype,"collapsible",2);$s([k({required:!0})],Zt.prototype,"cardClass",2);$s([k({default:""})],Zt.prototype,"toolbarColor",2);$s([k({default:""})],Zt.prototype,"toolbarClass",2);$s([k({default:!1})],Zt.prototype,"loading",2);$s([k({default:!0})],Zt.prototype,"marginBottom",2);$s([k({default:!1})],Zt.prototype,"hideButtonsOnCollapse",2);Zt=$s([O],Zt);var tT=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{class:"panel "+e.cardClass+" "+(e.marginBottom?"mb-3 mb-md-6":"")+" "+(e.expand?"":"expanded"),attrs:{loading:e.loading}},[t(oa,{staticClass:"panel-toolbar",class:e.getToolbarClass,style:e.additionalStyle,attrs:{flat:"",dense:"",color:e.toolbarColor,height:e.panelToolbarHeight}},[e._t("buttons-left"),t(ki,{staticClass:"d-flex align-center"},[e.hasIconSlot?e._t("icon"):e._e(),e.icon!==null&&!e.hasIconSlot?t(v,{attrs:{left:""}},[e._v(e._s(e.icon))]):e._e(),e.title?t("span",{staticClass:"subheading"},[e._v(e._s(e.title))]):e._e()],2),e._t("buttons-title"),t(le),t(zx,{directives:[{name:"show",rawName:"v-show",value:e.hasButtonsSlot||e.collapsible,expression:"hasButtonsSlot || collapsible"}]},[e.expand||!e.hideButtonsOnCollapse?t("div",{staticClass:"d-flex align-center"},[e._t("buttons")],2):e._e(),e.collapsible?t(g,{staticClass:"btn-collapsible",attrs:{icon:"",ripple:!0},on:{click:function(r){e.expand=!e.expand}}},[t(v,{class:e.expand?"":"icon-rotate-90"},[e._v(e._s(e.mdiChevronDown))])],1):e._e()],1)],2),t(jl,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand||!e.collapsible,expression:"expand || !collapsible"}]},[e._t("default")],2)])],1)},sT=[];function N(e,s,t,r,i,n,a,o){var l=typeof e=="function"?e.options:e;s&&(l.render=s,l.staticRenderFns=t,l._compiled=!0),r&&(l.functional=!0),n&&(l._scopeId="data-v-"+n);var c;if(a?(c=function(h){h=h||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!h&&typeof __VUE_SSR_CONTEXT__<"u"&&(h=__VUE_SSR_CONTEXT__),i&&i.call(this,h),h&&h._registeredComponents&&h._registeredComponents.add(a)},l._ssrRegister=c):i&&(c=o?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(p,m){return c.call(m),u(p,m)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}const mf={};var rT=N(Zt,tT,sT,!1,iT,"3cfcc6d8",null,null);function iT(e){for(let s in mf)this[s]=mf[s]}const Z=function(){return rT.exports}();var nT=Object.defineProperty,aT=Object.getOwnPropertyDescriptor,oT=(e,s,t,r)=>{for(var i=r>1?void 0:r?aT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&nT(s,t,i),i};let qu=class extends j(V){constructor(){super(...arguments),this.addPrinterValid=!1,this.dialogAddPrinter={bool:!1,hostname:"",port:7125},this.editPrinterValid=!1,this.dialogEditPrinter={bool:!1,id:"",hostname:"",port:0},this.mdiConnection=gp,this.mdiCloseThick=Ce,this.mdiSync=f0,this.mdiDelete=Ye,this.mdiPencil=xt,this.mdiCheckboxMarkedCircle=Vb,this.mdiCancel=jb}get printers(){var e;return(e=this.$store.getters["gui/remoteprinters/getRemoteprinters"])!=null?e:[]}get canAddPrinters(){return this.instancesDB!=="json"}get protocol(){return this.$store.state.socket.protocol}get defaultMoonrakerPort(){return this.protocol==="wss"?7130:7125}get hostname(){return this.$store.state.socket.hostname}get port(){return this.$store.state.socket.port}get formatHostname(){return parseInt(this.port)!==80&&this.port!==""?this.hostname+":"+this.port:this.hostname}get isConnected(){return this.$store.state.socket.isConnected}get isConnecting(){return this.$store.state.socket.isConnecting}get connectingFailed(){return this.$store.state.socket.connectingFailed}get showDialog(){return!this.isConnected||this.isConnected&&!this.guiIsReady}get currentUrl(){let e=document.location.protocol+"//"+window.location.hostname;return parseInt(window.location.port)!==80&&window.location.port!==""&&(e+=":"+window.location.port),e}get showCorsInfo(){return this.printers.length?(this.printers.forEach(e=>{var s;if(e&&!((s=e.socket)!=null&&s.isConnected))return!0}),!1):!0}get panelTitle(){return this.dialogAddPrinter.bool?this.$t("SelectPrinterDialog.AddPrinter"):this.dialogEditPrinter.bool?this.$t("SelectPrinterDialog.EditPrinter"):this.isConnecting?this.$t("SelectPrinterDialog.Connecting",{host:this.formatHostname}):this.isConnected&&!this.guiIsReady?this.$t("ConnectionDialog.Initializing"):this.connectingFailed?this.$t("SelectPrinterDialog.ConnectionFailed",{host:this.formatHostname}):this.$t("SelectPrinterDialog.SelectPrinter")}getPrinterName(e){return this.$store.getters["farm/getPrinterName"](e)}createPrinter(){this.dialogAddPrinter.hostname="",this.dialogAddPrinter.port=this.defaultMoonrakerPort,this.dialogAddPrinter.bool=!0}addPrinter(){const e={hostname:this.dialogAddPrinter.hostname,port:this.dialogAddPrinter.port};this.$store.dispatch("gui/remoteprinters/store",{values:e}),this.dialogAddPrinter.hostname="",this.dialogAddPrinter.bool=!1}editPrinter(e){var s;this.dialogEditPrinter.hostname=e.hostname,this.dialogEditPrinter.port=e.port,this.dialogEditPrinter.id=(s=e.id)!=null?s:"",this.dialogEditPrinter.bool=!0}updatePrinter(){const e={hostname:this.dialogEditPrinter.hostname,port:this.dialogEditPrinter.port};this.$store.dispatch("gui/remoteprinters/update",{id:this.dialogEditPrinter.id,values:e}),this.dialogEditPrinter.bool=!1}delPrinter(){this.$store.dispatch("gui/remoteprinters/delete",this.dialogEditPrinter.id),this.dialogEditPrinter.bool=!1}connect(e){this.$store.dispatch("socket/setData",{hostname:e.socket.hostname,port:e.socket.port}),this.$socket.setUrl(this.protocol+"://"+e.socket.hostname+":"+e.socket.port+"/websocket"),this.$socket.connect()}reconnect(){this.$store.dispatch("socket/setData",{connectingFailed:!1}),this.$socket.connect()}switchToChangePrinter(){this.$store.dispatch("socket/setData",{connectingFailed:!1})}checkPrinters(){this.printers.forEach(e=>{var s,t;e&&!((s=e.socket)!=null&&s.isConnected)&&!((t=e.socket)!=null&&t.isConnecting)&&this.$store.dispatch("farm/"+e.id+"/connect")})}mounted(){this.$store.dispatch("gui/remoteprinters/initFromLocalstorage")}};qu=oT([O({components:{Panel:Z}})],qu);var lT=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"",width:400},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{"card-class":"select-printer-dialog",icon:e.mdiConnection,title:e.panelTitle,"margin-bottom":!1,"toolbar-color":"toolbar"},scopedSlots:e._u([{key:"buttons",fn:function(){return[!e.isConnecting&&!e.connectingFailed?[e.dialogEditPrinter.bool?[t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:""},on:{click:function(r){e.dialogEditPrinter.bool=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]:e.dialogAddPrinter.bool?[e.dialogAddPrinter.bool?t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:""},on:{click:function(r){e.dialogAddPrinter.bool=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1):e._e()]:e.printers.length>0?[t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:"",color:"primary"},on:{click:e.checkPrinters}},[t(v,[e._v(e._s(e.mdiSync))])],1)]:e._e()]:e._e()]},proxy:!0}])},[e.isConnecting||e.isConnected&&!e.guiIsReady?[t(q,[t(bs,{attrs:{color:"primary",indeterminate:""}})],1)]:e.connectingFailed?[t(q,[t("p",[e._v(" "+e._s(e.$t("SelectPrinterDialog.CannotConnectTo",{host:parseInt(e.port)!==80?e.hostname+":"+e.port:e.hostname}))+" ")]),t("div",{staticClass:"text-center"},[t(g,{staticClass:"mr-3",attrs:{text:"",color:"white"},on:{click:e.switchToChangePrinter}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.ChangePrinter"))+" ")]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.reconnect}},[e._v(e._s(e.$t("SelectPrinterDialog.TryAgain")))])],1)])]:e.dialogAddPrinter.bool?[t(Lr,{on:{submit:function(r){return r.preventDefault(),e.addPrinter.apply(null,arguments)}},model:{value:e.addPrinterValid,callback:function(r){e.addPrinterValid=r},expression:"addPrinterValid"}},[t(q,[t(S,[t(_,{staticClass:"col-8"},[t(re,{attrs:{rules:[function(r){return!!r||e.$t("SelectPrinterDialog.HostnameRequired")},function(r){return!r.startsWith("http:")||e.$t("SelectPrinterDialog.HostnameInvalid")},function(r){return!r.startsWith("https:")||e.$t("SelectPrinterDialog.HostnameInvalid")}],label:e.$t("SelectPrinterDialog.HostnameIp"),required:"",outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogAddPrinter.hostname,callback:function(r){e.$set(e.dialogAddPrinter,"hostname",r)},expression:"dialogAddPrinter.hostname"}})],1),t(_,{staticClass:"col-4"},[t(re,{attrs:{rules:[function(r){return!!r||e.$t("SelectPrinterDialog.PortRequired")}],label:e.$t("SelectPrinterDialog.Port"),"hide-details":"auto",required:"",outlined:"",dense:""},model:{value:e.dialogAddPrinter.port,callback:function(r){e.$set(e.dialogAddPrinter,"port",r)},expression:"dialogAddPrinter.port"}})],1)],1)],1),t(ne,[t(le),t(g,{staticClass:"middle",attrs:{color:"primary",text:"",type:"submit",disabled:!e.addPrinterValid}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrinter"))+" ")])],1)],1)]:e.dialogEditPrinter.bool?[t(Lr,{on:{submit:function(r){return r.preventDefault(),e.updatePrinter.apply(null,arguments)}},model:{value:e.editPrinterValid,callback:function(r){e.editPrinterValid=r},expression:"editPrinterValid"}},[t(q,[t(S,[t(_,{staticClass:"col-8"},[t(re,{attrs:{rules:[function(r){return!!r||e.$t("SelectPrinterDialog.HostnameRequired")},function(r){return!r.startsWith("http:")||e.$t("SelectPrinterDialog.HostnameInvalid")},function(r){return!r.startsWith("https:")||e.$t("SelectPrinterDialog.HostnameInvalid")}],label:e.$t("SelectPrinterDialog.HostnameIp"),required:"",outlined:"",dense:"","hide-details":"auto"},model:{value:e.dialogEditPrinter.hostname,callback:function(r){e.$set(e.dialogEditPrinter,"hostname",r)},expression:"dialogEditPrinter.hostname"}})],1),t(_,{staticClass:"col-4"},[t(re,{attrs:{rules:[function(r){return!!r||e.$t("SelectPrinterDialog.PortRequired")}],label:e.$t("SelectPrinterDialog.Port"),required:"",outlined:"",dense:"","hide-details":"auto"},model:{value:e.dialogEditPrinter.port,callback:function(r){e.$set(e.dialogEditPrinter,"port",r)},expression:"dialogEditPrinter.port"}})],1)],1)],1),t(ne,[t(g,{staticClass:"minwidth-0 rounded",attrs:{color:"red",icon:"",tile:""},on:{click:e.delPrinter}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1),t(le),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.editPrinterValid}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.UpdatePrinter"))+" ")])],1)],1)]:[t(q,{staticClass:"mt-3"},[e.printers.length?t(S,[t(_,{staticClass:"px-6"},e._l(e.printers,function(r,i){return t(S,{key:i},[t(_,{staticClass:"rounded transition-swing toolbar py-2 px-2 mb-2 overflow-hidden",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.connect(r)}}},[t(S,{attrs:{align:"center"}},[t(_,{staticClass:"col-auto pr-0"},[r.socket.isConnecting?t(at,{attrs:{indeterminate:"",color:"primary",size:"24",width:"2.5"}}):e._e(),r.socket.isConnecting?e._e():t(v,{attrs:{color:r.socket.isConnected?"green":"red"}},[e._v(" "+e._s(r.socket.isConnected?e.mdiCheckboxMarkedCircle:e.mdiCancel)+" ")])],1),t(_,[e._v(e._s(e.getPrinterName(r.id)))]),e.canAddPrinters?t(_,{staticClass:"col-auto pa-0"},[t(g,{staticClass:"mr-1",attrs:{tile:"",text:"",icon:"",large:""},on:{click:function(n){return n.stopPropagation(),n.preventDefault(),e.editPrinter(r)}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiPencil))])],1)],1):e._e()],1)],1)],1)}),1)],1):e._e(),e.instancesDB==="browser"?[e.showCorsInfo?t(S,[t(_,[e.printers.length===0?t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.Hello"))+" ")]):e._e(),t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.RememberToAdd",{cors:e.currentUrl}))+" ")]),t("p",{staticClass:"text-center mb-0"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.YouCanFindMore"))+" "),t("br"),t("a",{attrs:{href:"https://docs.mainsail.xyz/remotemode",target:"_blank"}},[e._v(" https://docs.mainsail.xyz/remotemode ")]),e._v(" . ")])])],1):e._e(),t(S,[t(_,{staticClass:"text-center mt-0"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPrinter}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrinter"))+" ")])],1)],1)]:e.instancesDB==="json"&&e.printers.length===0?t(S,[t(_,{staticClass:"text-center mt-0"},[t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrintersToJson"))+" ")])])],1):e._e()],2)]],2)],1)},cT=[];const ff={};var uT=N(qu,lT,cT,!1,dT,null,null,null);function dT(e){for(let s in ff)this[s]=ff[s]}const Op=function(){return uT.exports}();var hT=Object.defineProperty,pT=Object.getOwnPropertyDescriptor,mT=(e,s,t,r)=>{for(var i=r>1?void 0:r?pT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&hT(s,t,i),i};let Xu=class extends j(V){constructor(){super(...arguments),this.mdiHelpCircleOutline=Kb,this.mdiCloseThick=Ce,this.mdiMoonWaningCrescent=CP}get mainsailVersion(){return this.$store.state.packageVersion}get klipperVersion(){var e,s;return(s=(e=this.$store.state.printer)==null?void 0:e.software_version)!=null?s:""}get moonrakerVersion(){var e,s;return(s=(e=this.$store.state.server)==null?void 0:e.moonraker_version)!=null?s:""}};Xu=mT([O({})],Xu);var fT=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(pe,{attrs:{right:"",color:"panel"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({},"v-icon",n,!1),i),[e._v(" "+e._s(e.mdiHelpCircleOutline)+" ")])]}}])},[t(ke,{staticClass:"version-container pa-0"},[t("div",[t("img",{attrs:{height:"12",src:"/img/logo.svg",alt:"mainsail-logo"}})]),t("div",[e._v("v"+e._s(e.mainsailVersion))]),t("div",[t(v,{staticClass:"moonraker-logo",attrs:{small:""}},[e._v(e._s(e.mdiMoonWaningCrescent))])],1),t("div",[e._v(e._s(e.moonrakerVersion))]),t("div",[t("img",{staticClass:"klipper-logo",attrs:{height:"12",src:"/img/klipper.svg",alt:"klipper-logo"}})]),t("div",[e._v(e._s(e.klipperVersion))])])],1)},gT=[];const gf={};var vT=N(Xu,fT,gT,!1,_T,"24513c96",null,null);function _T(e){for(let s in gf)this[s]=gf[s]}const C0=function(){return vT.exports}();var bT=Object.defineProperty,yT=Object.getOwnPropertyDescriptor,Lp=(e,s,t,r)=>{for(var i=r>1?void 0:r?yT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&bT(s,t,i),i};let Dn=class extends j(V){constructor(){super(...arguments),this.internalColor=$n}colorChanged(e){this.internalColor=e!==""?e:$n}created(){this.color!==""&&(this.internalColor=this.color)}};Lp([k({required:!1,default:""})],Dn.prototype,"color",2);Lp([me("color")],Dn.prototype,"colorChanged",1);Dn=Lp([O],Dn);var CT=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 599.38 523.11","xml:space":"preserve"}},[t("g",[t("path",{style:"fill:"+e.color+";",attrs:{d:"M382.29,142.98L132.98,522.82L0,522.68L344.3,0l0,0C352.18,49.06,365.2,97.68,382.29,142.98"}}),t("path",{style:"fill:"+e.color+";",attrs:{d:"M413.28,213.54L208.5,522.92l132.94,0.19l135.03-206.33l0,0C452.69,284.29,431.53,249.77,413.28,213.54 L413.28,213.54"}}),t("path",{style:"fill:"+e.color+";",attrs:{d:"M599.38,447.69l-49.25,75.42L417,522.82l101.6-153.67l0,0C543.48,397.35,570.49,423.61,599.38,447.69 L599.38,447.69z"}})])])},$T=[];const vf={};var xT=N(Dn,CT,$T,!1,wT,null,null,null);function wT(e){for(let s in vf)this[s]=vf[s]}const Ni=function(){return xT.exports}();var ST=Object.defineProperty,PT=Object.getOwnPropertyDescriptor,$0=(e,s,t,r)=>{for(var i=r>1?void 0:r?PT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ST(s,t,i),i};let vo=class extends j(V){get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get icon(){return this.item.icon}get title(){return this.item.title}get to(){var e;return(e=this.item.to)!=null?e:void 0}get href(){var e;return(e=this.item.href)!=null?e:void 0}get target(){var e;return(e=this.item.target)!=null?e:void 0}get borderBottom(){return this.item.to==="/allPrinters"}};$0([k({type:Object,required:!0})],vo.prototype,"item",2);vo=$0([O],vo);var TT=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(pe,{attrs:{right:"","open-delay":500,disabled:e.navigationStyle!=="iconsOnly"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(K,e._g(e._b({staticClass:"small-list-item",attrs:{router:"",to:e.to,href:e.href,target:e.target}},"v-list-item",n,!1),i),[t(Rs,{staticClass:"my-3 mr-3 menu-item-icon"},[t(v,[e._v(e._s(e.icon))])],1),t(Gt,[t(rt,{staticClass:"menu-item-title",attrs:{tile:""}},[e._v(" "+e._s(e.title)+" ")])],1)],1)]}}])},[t("span",[e._v(e._s(e.title))])]),e.borderBottom?t(E,{staticClass:"my-1"}):e._e()],1)},DT=[];const _f={};var MT=N(vo,TT,DT,!1,ET,"99ab1bec",null,null);function ET(e){for(let s in _f)this[s]=_f[s]}const x0=function(){return MT.exports}(),OT="modulepreload",LT=function(e){return"/"+e},bf={},he=function(s,t,r){if(!t||t.length===0)return s();const i=document.getElementsByTagName("link");return Promise.all(t.map(n=>{if(n=LT(n),n in bf)return;bf[n]=!0;const a=n.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(!!r)for(let u=i.length-1;u>=0;u--){const d=i[u];if(d.href===n&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(n,'"]').concat(o)))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":OT,a||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),a)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error("Unable to preload CSS for ".concat(n))))})})).then(()=>s()).catch(n=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=n,window.dispatchEvent(a),!a.defaultPrevented)throw n})};var kT=Object.defineProperty,AT=Object.getOwnPropertyDescriptor,FT=(e,s,t,r)=>{for(var i=r>1?void 0:r?AT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&kT(s,t,i),i};let Je=class extends y{get absolute_coordinates(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:s.absolute_coordinates)!=null?t:!0}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get feedrateXY(){var e,s;return(s=(e=this.$store.state.gui.control)==null?void 0:e.feedrateXY)!=null?s:100}get feedrateZ(){var e,s;return(s=(e=this.$store.state.gui.control)==null?void 0:e.feedrateZ)!=null?s:10}get existsQGL(){return this.$store.getters["printer/existsQGL"]}get existsZtilt(){return this.$store.getters["printer/existsZtilt"]}get existsBedTilt(){return this.$store.getters["printer/existsBedTilt"]}get existsBedScrews(){return this.$store.getters["printer/existsBedScrews"]}get existsDeltaCalibrate(){return this.$store.getters["printer/existsDeltaCalibrate"]}get existsScrewsTilt(){return this.$store.getters["printer/existsScrewsTilt"]}get existsFirmwareRetraction(){return this.$store.getters["printer/existsFirmwareRetraction"]}get colorQuadGantryLevel(){var s,t;return((t=(s=this.$store.state.printer.quad_gantry_level)==null?void 0:s.applied)!=null?t:!0)?"primary":"warning"}get colorZTilt(){var s,t;return((t=(s=this.$store.state.printer.z_tilt)==null?void 0:s.applied)!=null?t:!0)?"primary":"warning"}get defaultActionButton(){return this.$store.getters["gui/getDefaultControlActionButton"]}get homedAxes(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.toolhead)==null?void 0:s.homed_axes)!=null?t:""}get xAxisHomed(){return this.homedAxes.includes("x")}get yAxisHomed(){return this.homedAxes.includes("y")}get zAxisHomed(){return this.homedAxes.includes("z")}get macros(){return this.$store.getters["printer/getMacros"]}get toolchangeMacros(){return this.macros.filter(e=>e.name.toUpperCase().match(/^T\d+/)).sort((e,s)=>{const t=parseInt(e.name.slice(1)),r=parseInt(s.name.slice(1));return t-r})}doHome(){this.$store.dispatch("server/addEvent",{message:"G28",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28"},{loading:"homeAll"})}doHomeX(){this.$store.dispatch("server/addEvent",{message:"G28 X",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 X"},{loading:"homeX"})}doHomeY(){this.$store.dispatch("server/addEvent",{message:"G28 Y",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 Y"},{loading:"homeY"})}doHomeXY(){this.$store.dispatch("server/addEvent",{message:"G28 X Y",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 X Y"},{loading:"homeXY"})}doHomeZ(){this.$store.dispatch("server/addEvent",{message:"G28 Z",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 Z"},{loading:"homeZ"})}doQGL(){this.$store.dispatch("server/addEvent",{message:"QUAD_GANTRY_LEVEL",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"QUAD_GANTRY_LEVEL"},{loading:"qgl"})}doZtilt(){this.$store.dispatch("server/addEvent",{message:"Z_TILT_ADJUST",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"Z_TILT_ADJUST"},{loading:"zTilt"})}doSendMove(e,s){e="G91\nG1 "+e+" F"+s*60,this.absolute_coordinates&&(e+="\nG90"),this.doSend(e)}doSend(e){this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}};Je=FT([O],Je);var RT=Object.defineProperty,IT=Object.getOwnPropertyDescriptor,HT=(e,s,t,r)=>{for(var i=r>1?void 0:r?IT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&RT(s,t,i),i};let ui=class extends y{get extruders(){return this.$store.getters["printer/getExtruders"]}get activeExtruder(){var e;return(e=this.$store.state.printer.toolhead)==null?void 0:e.extruder}get activeExtruderSettings(){var e,s;return(s=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:s[this.activeExtruder]}get filamentDiameter(){var e,s;return(s=(e=this.activeExtruderSettings)==null?void 0:e.filament_diameter)!=null?s:1.75}get nozzleDiameter(){var e,s;return(s=(e=this.activeExtruderSettings)==null?void 0:e.nozzle_diameter)!=null?s:.4}get feedamount(){return parseFloat(this.$store.state.gui.control.extruder.feedamount)}get feedrate(){return parseFloat(this.$store.state.gui.control.extruder.feedrate)}get extrudeFactor(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:s.extrude_factor)!=null?t:1}get extrudePossible(){return this.$store.getters["printer/getExtrudePossible"]}get minExtrudeTemp(){var e,s;return(s=(e=this.activeExtruderSettings)==null?void 0:e.min_extrude_temp)!=null?s:170}};ui=HT([O],ui);var jT=Object.defineProperty,NT=Object.getOwnPropertyDescriptor,VT=(e,s,t,r)=>{for(var i=r>1?void 0:r?NT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&jT(s,t,i),i};let Yu=class extends j(V,Je,ui){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Bs,this.mdiDotsVertical=Gl,this.heatWaitGcodes=["printer.extruder.can_extrude","TEMPERATURE_WAIT","M109"]}get showPanel(){return this.klipperReadyForGui&&this.extruders.length>0}get macros(){return this.$store.getters["printer/getMacros"]}get loadFilamentMacro(){const s=["LOAD_FILAMENT","FILAMENT_LOAD"];return this.macros.find(t=>s.includes(t.name.toUpperCase()))}get unloadFilamentMacro(){const s=["UNLOAD_FILAMENT","FILAMENT_UNLOAD"];return this.macros.find(t=>s.includes(t.name.toUpperCase()))}get purgeFilamentMacro(){const s=["PURGE_FILAMENT","FILAMENT_PURGE"];return this.macros.find(t=>s.includes(t.name.toUpperCase()))}get cleanNozzleMacro(){const s=["CLEAN_NOZZLE","NOZZLE_CLEAN","WIPE_NOZZLE","NOZZLE_WIPE"];return this.macros.find(t=>s.includes(t.name.toUpperCase()))}get canExecuteLoadMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(s=>{var t;return(t=this.loadFilamentMacro)==null?void 0:t.prop.gcode.includes(s)})}get canExecuteUnloadMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(s=>{var t;return(t=this.unloadFilamentMacro)==null?void 0:t.prop.gcode.includes(s)})}get canExecutePurgeMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(s=>{var t;return(t=this.purgeFilamentMacro)==null?void 0:t.prop.gcode.includes(s)})}get showFilamentMacros(){return this.loadFilamentMacro!==void 0||this.unloadFilamentMacro!==void 0}get showTools(){var s;return this.toolchangeMacros.length<1?!1:(s=this.$store.state.gui.view.extruder.showTools)!=null?s:!0}get showExtrusionFactor(){var s;return(s=this.$store.state.gui.view.extruder.showExtrusionFactor)!=null?s:!0}get existsPressureAdvance(){return!(this.$store.getters["printer/getExtruderSteppers"].length>0)}get showPressureAdvance(){var s;return this.existsPressureAdvance?(s=this.$store.state.gui.view.extruder.showPressureAdvance)!=null?s:!0:!1}get showFirmwareRetraction(){var s;return this.existsFirmwareRetraction?(s=this.$store.state.gui.view.extruder.showFirmwareRetraction)!=null?s:!0:!1}get showExtruderControl(){var s;return(s=this.$store.state.gui.view.extruder.showExtruderControl)!=null?s:!0}};Yu=VT([O({components:{Panel:Z}})],Yu);var UT=Object.defineProperty,BT=Object.getOwnPropertyDescriptor,wt=(e,s,t,r)=>{for(var i=r>1?void 0:r?BT(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&UT(s,t,i),i};let ht=class extends j(V){constructor(){super(...arguments),this.mdiRestart=jr,this.mdiChevronUp=la,this.mdiChevronDown=Vs,this.value="0",this.error=!1,this.invalidChars=["e","E","+"]}created(){this.value=this.target.toString()}updateTarget(){this.value=this.target.toString()}incrementValue(){this.inputValue+this.step*this.spinnerFactorthis.min?this.value=(Math.round((this.inputValue-this.step*this.spinnerFactor)*10**this.dec)/10**this.dec).toString():this.value=this.min.toString(),this.submit()}resetToDefault(){this.value=this.defaultValue.toString(),this.submit()}submit(){this.invalidInput||this.$emit("submit",{name:this.param,value:this.inputValue})}checkInvalidChars(e){this.min>=0&&this.invalidChars.push("-"),this.invalidChars.includes(e.key)&&e.preventDefault()}get inputValue(){return this.value.toString()===""?0:parseFloat(this.value.replace(",","."))}get invalidInput(){return this.inputErrors.length>0}get inputErrors(){if(!this.outputErrorMsg)return[];const e=[];return this.max===null&&this.inputValuethis.max||this.inputValue=e.max&&e.max!==null||e.error||e.disabled,icon:"",plain:"",small:""},on:{click:e.incrementValue}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.value<=e.min||e.error||e.disabled,icon:"",plain:"",small:""},on:{click:e.decrementValue}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}:null],null,!0),model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)},GT=[];const yf={};var zT=N(ht,WT,GT,!1,ZT,"799eadb6",null,null);function ZT(e){for(let s in yf)this[s]=yf[s]}const Ie=function(){return zT.exports}();var w0="Expected a function",Cf=0/0,qT="[object Symbol]",XT=/^\s+|\s+$/g,YT=/^[-+]0x[0-9a-f]+$/i,JT=/^0b[01]+$/i,KT=/^0o[0-7]+$/i,QT=parseInt,eD=typeof xr=="object"&&xr&&xr.Object===Object&&xr,tD=typeof self=="object"&&self&&self.Object===Object&&self,sD=eD||tD||Function("return this")(),rD=Object.prototype,iD=rD.toString,nD=Math.max,aD=Math.min,lu=function(){return sD.Date.now()};function oD(e,s,t){var r,i,n,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(w0);s=$f(s)||0,_o(t)&&(u=!!t.leading,d="maxWait"in t,n=d?nD($f(t.maxWait)||0,s):n,h="trailing"in t?!!t.trailing:h);function p($){var T=r,I=i;return r=i=void 0,c=$,a=e.apply(I,T),a}function m($){return c=$,o=setTimeout(C,s),u?p($):a}function f($){var T=$-l,I=$-c,R=s-T;return d?aD(R,n-I):R}function b($){var T=$-l,I=$-c;return l===void 0||T>=s||T<0||d&&I>=n}function C(){var $=lu();if(b($))return w($);o=setTimeout(C,f($))}function w($){return o=void 0,h&&r?p($):(r=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function H(){return o===void 0?a:w(lu())}function A(){var $=lu(),T=b($);if(r=arguments,i=this,l=$,T){if(o===void 0)return m(l);if(d)return o=setTimeout(C,s),p(l)}return o===void 0&&(o=setTimeout(C,s)),a}return A.cancel=M,A.flush=H,A}function lD(e,s,t){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(w0);return _o(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),oD(e,s,{leading:r,maxWait:s,trailing:i})}function _o(e){var s=typeof e;return!!e&&(s=="object"||s=="function")}function cD(e){return!!e&&typeof e=="object"}function uD(e){return typeof e=="symbol"||cD(e)&&iD.call(e)==qT}function $f(e){if(typeof e=="number")return e;if(uD(e))return Cf;if(_o(e)){var s=typeof e.valueOf=="function"?e.valueOf():e;e=_o(s)?s+"":s}if(typeof e!="string")return e===0?e:+e;e=e.replace(XT,"");var t=JT.test(e);return t||KT.test(e)?QT(e.slice(2),t?2:8):YT.test(e)?Cf:+e}var dD=lD;const S0=Fi(dD);var hD=Object.defineProperty,pD=Object.getOwnPropertyDescriptor,P0=(e,s,t,r)=>{for(var i=r>1?void 0:r?pD(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&hD(s,t,i),i};let bo=class extends V{constructor(){super(...arguments),this.el={is:{}}}mounted(){this.breakpoints&&this.$nextTick(()=>{this.observer=new ResizeObserver(S0(this.onResize,50)),this.$el instanceof Element&&this.observer.observe(this.$el)})}beforeDestroy(){var e;this.$el instanceof Element&&((e=this.observer)==null||e.unobserve(this.$el))}onResize(e){if(e[0].contentRect.height===0&&e[0].contentRect.width===0)return;const s=e[0].contentRect,t=this.breakpoints;for(const r in t)this.$set(this.el.is,r,t[r](s))}};P0([k()],bo.prototype,"breakpoints",2);bo=P0([O],bo);var mD=Object.defineProperty,fD=Object.getOwnPropertyDescriptor,T0=(e,s,t,r)=>{for(var i=r>1?void 0:r?fD(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&mD(s,t,i),i};let yo=class extends j(bo){constructor(){super(...arguments),this.init=!1}mounted(){this.init=!0}};T0([k({default:!1})],yo.prototype,"noHide",2);yo=T0([O],yo);var gD=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[!e.noHide&&!e.init?t("div",{staticStyle:{visibility:"hidden"}},[e._t("default",null,{el:e.el})],2):e._e(),e._t("default",null,{el:e.el})],2)},vD=[];const xf={};var _D=N(yo,gD,vD,!1,bD,null,null,null);function bD(e){for(let s in xf)this[s]=xf[s]}const Qe=function(){return _D.exports}();var tc={};const yD=hp(Zx);/** - * vue-class-component v6.3.2 - * (c) 2015-present Evan You - * @license MIT - */Object.defineProperty(tc,"__esModule",{value:!0});function CD(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ju=CD(yD),$D=typeof Reflect<"u"&&Reflect.defineMetadata;function xD(e,s){cu(e,s),Object.getOwnPropertyNames(s.prototype).forEach(function(t){cu(e.prototype,s.prototype,t)}),Object.getOwnPropertyNames(s).forEach(function(t){cu(e,s,t)})}function cu(e,s,t){var r=t?Reflect.getOwnMetadataKeys(s,t):Reflect.getOwnMetadataKeys(s);r.forEach(function(i){var n=t?Reflect.getOwnMetadata(i,s,t):Reflect.getOwnMetadata(i,s);t?Reflect.defineMetadata(i,n,e,t):Reflect.defineMetadata(i,n,e)})}var wD={__proto__:[]},SD=wD instanceof Array;function PD(e){return function(s,t,r){var i=typeof s=="function"?s:s.constructor;i.__decorators__||(i.__decorators__=[]),typeof r!="number"&&(r=void 0),i.__decorators__.push(function(n){return e(n,t,r)})}}function TD(){for(var e=[],s=0;s-1){s[o]=t[o];return}var l=Object.getOwnPropertyDescriptor(t,o);l.value!==void 0?typeof l.value=="function"?(s.methods||(s.methods={}))[o]=l.value:(s.mixins||(s.mixins=[])).push({data:function(){var c;return c={},c[o]=l.value,c}}):(l.get||l.set)&&((s.computed||(s.computed={}))[o]={get:l.get,set:l.set})}}),(s.mixins||(s.mixins=[])).push({data:function(){return MD(this,e)}});var r=e.__decorators__;r&&(r.forEach(function(o){return o(s)}),delete e.__decorators__);var i=Object.getPrototypeOf(e.prototype),n=i instanceof Ju?i.constructor:Ju,a=n.extend(s);return ED(a,e,n),$D&&xD(a,e),a}function ED(e,s,t){Object.getOwnPropertyNames(s).forEach(function(r){if(r!=="prototype"){var i=Object.getOwnPropertyDescriptor(e,r);if(!(i&&!i.configurable)){var n=Object.getOwnPropertyDescriptor(s,r);if(!SD){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!DD(n.value)&&a&&a.value===n.value)return}Object.defineProperty(e,r,n)}}})}function D0(e){return typeof e=="function"?wf(e):function(s){return wf(s,e)}}D0.registerHooks=function(s){Ku.push.apply(Ku,s)};tc.default=D0;var OD=tc.createDecorator=PD;tc.mixins=TD;function Ze(e){return OD(function(s,t){if(!s.methods)throw new Error("This decorator must be used on a vue component method.");var r=typeof e=="number"?e:e.time,i=s.methods[t],n=0,a=function(){n&&(clearTimeout(n),n=0)};s.methods[t]=function(){for(var o=this,l=[],c=0;c{for(var i=r>1?void 0:r?kD(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&LD(s,t,i),i};let ze=class extends j(V){constructor(){super(...arguments),this.mdiRestart=jr,this.mdiLockOutline=Yl,this.mdiLockOpenVariantOutline=s0,this.mdiMinus=i0,this.mdiPlus=Dp,this.isLocked=!1,this.invalidChars=["e","E","+"],this.value=0,this.numInput=0,this.startValue=0,this.processedMax=100,this.dynamicStep=50}created(){this.value=this.target*this.multi,this.numInput=this.value,this.startValue=this.target*this.multi,this.dynamicStep=Math.floor(this.max/2),this.value>=this.processedMax&&(this.processedMax=(Math.ceil(this.value/this.dynamicStep)+1)*this.dynamicStep)}lockSlidersChanged(){this.isLocked=this.lockSliders&&this.isTouchDevice}startLockTimer(){let e=this.lockSlidersDelay;!this.isTouchDevice||!this.lockSliders||e<=0||(this.timeout=setTimeout(()=>this.isLocked=!0,e*1e3))}resetLockTimer(){clearTimeout(this.timeout)}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}get colorBar(){return this.max=this.processedMax&&(this.processedMax=this.value+this.dynamicStep)}valueChanged(e){this.numInput=e}targetChanged(e){this.value=Math.round(e*this.multi),this.dynamicRange&&this.value>=this.processedMax&&(this.processedMax=this.value+this.dynamicStep)}maxChanged(e){this.processedMax=e>this.value?e:Math.ceil(this.value/this.dynamicStep)*this.dynamicStep}checkInvalidChars(e){this.min>=0&&this.invalidChars.push("-"),this.invalidChars.includes(e.key)&&e.preventDefault()}errors(){const e=[];return this.numInput.toString()===""&&e.push(this.$t("App.NumberInput.NoEmptyAllowedError")),this.numInputthis.max||this.numInput0||(!this.dynamicRange&&this.numInput>this.max?this.value=this.max:this.value=this.numInput,this.sendCmd())}resetSlider(){this.value=this.defaultValue,this.numInput=this.defaultValue,this.processedMax=this.max,this.value>=this.processedMax&&(this.processedMax=(Math.ceil(this.value/this.dynamicStep)+1)*this.dynamicStep),this.sendCmd()}sendCmd(){const e=(Math.max(1,this.value)*this.attributeScale).toFixed(0),s="".concat(this.command," ").concat(this.attributeName).concat(e);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s}),this.startLockTimer()}decrement(){this.value=this.value>this.min?Math.round(this.value-this.step):this.min,this.sendCmd()}increment(){this.value=this.value0,suffix:e.unit,type:"number","hide-spin-buttons":"","hide-details":"",outlined:"",dense:""},on:{blur:function(r){e.numInput=e.value},focus:function(r){return r.target.select()},keydown:e.checkInvalidChars},scopedSlots:e._u([e.value!==e.defaultValue||e.value!==e.numInput?{key:"append",fn:function(){return[t(v,{attrs:{small:""},on:{click:e.resetSlider}},[e._v(e._s(e.mdiRestart))])]},proxy:!0}:null],null,!0),model:{value:e.numInput,callback:function(r){e.numInput=r},expression:"numInput"}}):e._e()],1)],1),t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.errors().length>0,expression:"errors().length > 0"}],staticClass:"_error-msg d-flex justify-end"},[e._v(" "+e._s(e.errors()[0])+" ")])]),t(q,{staticClass:"pa-0 d-flex align-center"},[e.lockSliders&&e.isTouchDevice?t(g,{staticClass:"_lock-button",attrs:{plain:"",small:"",icon:""},on:{click:function(r){e.isLocked=!e.isLocked}}},[t(v,{attrs:{small:"",color:e.isLocked?"red":""}},[e._v(" "+e._s(e.isLocked?e.mdiLockOutline:e.mdiLockOpenVariantOutline)+" ")])],1):e._e(),t(Nl,{directives:[{name:"touch",rawName:"v-touch",value:{start:e.resetLockTimer},expression:"{ start: resetLockTimer }"}],attrs:{disabled:e.isLocked,min:e.min,max:e.processedMax,color:e.colorBar,"hide-details":""},on:{change:e.changeSlider},scopedSlots:e._u([{key:"prepend",fn:function(){return[t(v,{attrs:{disabled:e.isLocked||e.value<=e.min},on:{click:e.decrement}},[e._v(e._s(e.mdiMinus))])]},proxy:!0},{key:"append",fn:function(){return[t(v,{attrs:{disabled:e.isLocked||e.value>=e.max&&!e.dynamicRange},on:{click:e.increment}},[e._v(" "+e._s(e.mdiPlus)+" ")])]},proxy:!0}]),model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)],1)},FD=[];const Sf={};var RD=N(ze,AD,FD,!1,ID,"2b843f9d",null,null);function ID(e){for(let s in Sf)this[s]=Sf[s]}const sc=function(){return RD.exports}();var HD=Object.defineProperty,jD=Object.getOwnPropertyDescriptor,M0=(e,s,t,r)=>{for(var i=r>1?void 0:r?jD(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&HD(s,t,i),i};let Co=class extends j(V,ui){constructor(){super(...arguments),this.mdiArrowDownBold=OS,this.mdiArrowUpBold=kS,this.mdiPrinter3dNozzle=Bs}get feedamounts(){var s,t;return(t=(s=this.$store.state.gui.control.extruder)==null?void 0:s.feedamounts)!=null?t:[]}get feedrates(){var s,t;return(t=(s=this.$store.state.gui.control.extruder)==null?void 0:s.feedrates)!=null?t:[]}get feedamountsSorted(){return[...this.feedamounts].sort((s,t)=>t-s)}get feedratesSorted(){return[...this.feedrates].sort((s,t)=>t-s)}setFeedamount(s){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedamount",value:s.value})}setFeedrate(s){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedrate",value:s.value})}get maxExtrudeOnlyDistance(){var s,t;return(t=(s=this.activeExtruderSettings)==null?void 0:s.max_extrude_only_distance)!=null?t:50}get tooLargeExtrusion(){return this.feedamount*this.extrudeFactor>this.maxExtrudeOnlyDistance}onMaxExtrudeOnlyDistanceChange(){this.feedamount>this.maxExtrudeOnlyDistance&&this.setFeedamount({value:this.maxExtrudeOnlyDistance})}sendRetract(){const s="M83\nG1 E-".concat(this.feedamount," F").concat(this.feedrate*60);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"btnRetract"})}sendExtrude(){const s="M83\nG1 E".concat(this.feedamount," F").concat(this.feedrate*60);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"btnDetract"})}};M0([me("maxExtrudeOnlyDistance",{immediate:!0})],Co.prototype,"onMaxExtrudeOnlyDistanceChange",1);Co=M0([O({components:{NumberInput:Ie,Responsive:Qe,ToolSlider:sc}})],Co);var ND=Object.defineProperty,VD=Object.getOwnPropertyDescriptor,UD=(e,s,t,r)=>{for(var i=r>1?void 0:r?VD(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ND(s,t,i),i};let Qu=class extends j(V,ui){constructor(){super(...arguments),this.mdiDiameterVariant=QS}get showEstimatedExtrusion(){var s;return(s=this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo)!=null?s:!0}get extrudedLength(){return Math.round(this.feedamount*this.extrudeFactor*(Math.pow(this.filamentDiameter,2)/Math.pow(this.nozzleDiameter,2)))}get volumetricFlow(){return Math.round(Math.pow(this.filamentDiameter/2,2)*Math.PI*this.feedrate*10)/10}};Qu=UD([O({})],Qu);var BD=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showEstimatedExtrusion?t(ke,{staticClass:"pa-0 ma-0 pb-2"},[t("div",{staticClass:"text--disabled text-caption font-weight-light d-flex justify-center",staticStyle:{"font-size":"0.8em"}},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.EstimatedExtrusion"))+" ~ "+e._s(e.extrudedLength)+" mm @ "+e._s(e.volumetricFlow)+" mm³/s - "),t(v,{staticStyle:{opacity:"0.4","margin-top":"-2px"},attrs:{"x-small":""}},[e._v(" "+e._s(e.mdiDiameterVariant)+" ")]),e._v(" "+e._s(e.nozzleDiameter)+" mm ")],1)])]):e._e()},WD=[];const Pf={};var GD=N(Qu,BD,WD,!1,zD,null,null,null);function zD(e){for(let s in Pf)this[s]=Pf[s]}const ZD=function(){return GD.exports}();var qD=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Qe,{attrs:{breakpoints:{large:function(r){return r.width>=640}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(ke,[t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FilamentLength"),param:"feedamount",target:e.feedamount,disabled:e.printerIsPrintingOnly,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:.01,min:.01,max:e.maxExtrudeOnlyDistance,dec:2,unit:"mm","submit-on-blur":!0},on:{submit:e.setFeedamount}}),t(Nt,{staticClass:"_btn-group pt-3"},e._l(e.feedamountsSorted,function(n){return t(g,{key:n,staticClass:"_btn-qs flex-grow-1 px-0",attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:function(a){return e.setFeedamount({value:n})}}},[e._v(" "+e._s(n)+" ")])}),1)],1),t(_,[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.ExtrusionFeedrate"),param:"feedrate",target:e.feedrate,disabled:e.printerIsPrintingOnly,"has-spinner":!0,"output-error-msg":!0,"spinner-factor":100,step:.01,min:.01,max:null,dec:2,type:"number",unit:"mm/s"},on:{submit:e.setFeedrate}}),t(Nt,{staticClass:"_btn-group pt-3"},e._l(e.feedratesSorted,function(n){return t(g,{key:n,staticClass:"_btn-qs flex-grow-1 px-0",attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:function(a){return e.setFeedrate({value:n})}}},[e._v(" "+e._s(n)+" ")])}),1)],1),i.is.large?t(_,{staticClass:"col-3 d-flex align-center flex-column justify-center"},[t(pe,{attrs:{left:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on;return[t("div",e._g({staticClass:"mb-4"},a),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnRetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(o){return e.sendRetract()}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowUpBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Retract"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])]),t(pe,{attrs:{left:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on;return[t("div",e._g({},a),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnDetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(o){return e.sendExtrude()}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowDownBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Extrude"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])])],1):e._e()],1),i.is.large?e._e():t(S,[t(_,{staticClass:"pa-0"},[t("div",{staticClass:"d-flex justify-space-around"},[t("div",{staticClass:"d-flex align-center"},[t(pe,{attrs:{top:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on;return[t("div",e._g({staticClass:"pt-1 pb-2 px-3"},a),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnRetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(o){return e.sendRetract()}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowUpBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Retract"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])]),t(pe,{attrs:{top:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on;return[t("div",e._g({staticClass:"pt-1 pb-2 px-3"},a),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnDetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(o){return e.sendExtrude()}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowDownBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Extrude"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])])],1)])])],1)],1),t(ZD)]}}])})},XD=[];const Tf={};var YD=N(Co,qD,XD,!1,JD,"eba60532",null,null);function JD(e){for(let s in Tf)this[s]=Tf[s]}const KD=function(){return YD.exports}();var QD=Object.defineProperty,e3=Object.getOwnPropertyDescriptor,E0=(e,s,t,r)=>{for(var i=r>1?void 0:r?e3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&QD(s,t,i),i};let $o=class extends j(V,Je){get retractLength(){var e,s,t;return Math.floor(((t=(s=(e=this.$store.state.printer)==null?void 0:e.firmware_retraction)==null?void 0:s.retract_length)!=null?t:0)*100)/100}get retractSpeed(){var e,s,t;return Math.trunc((t=(s=(e=this.$store.state.printer)==null?void 0:e.firmware_retraction)==null?void 0:s.retract_speed)!=null?t:20)}get unretractExtraLength(){var e,s,t;return Math.floor(((t=(s=(e=this.$store.state.printer)==null?void 0:e.firmware_retraction)==null?void 0:s.unretract_extra_length)!=null?t:0)*100)/100}get unretractSpeed(){var e,s,t;return Math.trunc((t=(s=(e=this.$store.state.printer)==null?void 0:e.firmware_retraction)==null?void 0:s.unretract_speed)!=null?t:10)}get defaultRetractLength(){var e,s,t,r,i;return Math.floor(((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.retract_length)!=null?i:0)*100)/100}get defaultRetractSpeed(){var e,s,t,r,i;return Math.trunc((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.retract_speed)!=null?i:20)}get defaultUnretractExtraLength(){var e,s,t,r,i;return Math.floor(((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.unretract_extra_length)!=null?i:0)*100)/100}get defaultUnretractSpeed(){var e,s,t,r,i;return Math.trunc((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.unretract_speed)!=null?i:0)}sendCmd(e){const s="SET_RETRACTION ".concat(e.name,"=").concat(e.value);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}};E0([Ze(500)],$o.prototype,"sendCmd",1);$o=E0([O({components:{Panel:Z,NumberInput:Ie,Responsive:Qe}})],$o);var t3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.existsFirmwareRetraction?t("div",[t(ke,[t(Qe,{attrs:{breakpoints:{small:function(r){return r.width<=350}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(S,[t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractLength"),param:"RETRACT_LENGTH",target:e.retractLength,"default-value":e.defaultRetractLength,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,step:.01,min:0,max:null,dec:2,unit:"mm"},on:{submit:e.sendCmd}})],1),t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractSpeed"),param:"RETRACT_SPEED",target:e.retractSpeed,"default-value":e.defaultRetractSpeed,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1),t(S,[t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractExtraLength"),param:"UNRETRACT_EXTRA_LENGTH",target:e.unretractExtraLength,"default-value":e.defaultUnretractExtraLength,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,step:.01,min:0,max:null,dec:2,unit:"mm"},on:{submit:e.sendCmd}})],1),t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractSpeed"),param:"UNRETRACT_SPEED",target:e.unretractSpeed,"default-value":e.defaultUnretractSpeed,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1)]}}],null,!1,259554286)})],1)],1):e._e()},s3=[];const Df={};var r3=N($o,t3,s3,!1,i3,null,null,null);function i3(e){for(let s in Df)this[s]=Df[s]}const n3=function(){return r3.exports}();var a3=Object.defineProperty,o3=Object.getOwnPropertyDescriptor,O0=(e,s,t,r)=>{for(var i=r>1?void 0:r?o3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&a3(s,t,i),i};let xo=class extends j(V){constructor(){super(...arguments),this.mdiRestart=jr,this.extruders=[],this.selectedExtruder=""}resetToActiveExtruder(){var s;this.selectedExtruder=(s=this.$store.state.printer.toolhead)==null?void 0:s.extruder}get allExtruders(){return Object.keys(this.$store.state.printer).forEach(s=>{s.startsWith("extruder")&&!this.extruders.includes(s)&&this.extruders.push(s)}),this.extruders.length===1&&this.resetToActiveExtruder(),this.extruders}get activeExtruder(){var s;return this.resetToActiveExtruder(),(s=this.$store.state.printer.toolhead)==null?void 0:s.extruder}get pressureAdvance(){var s,t,r;return Math.floor(((r=(t=(s=this.$store.state.printer)==null?void 0:s[this.selectedExtruder])==null?void 0:t.pressure_advance)!=null?r:0)*1e3)/1e3}get smoothTime(){var s,t,r;return Math.floor(((r=(t=(s=this.$store.state.printer)==null?void 0:s[this.selectedExtruder])==null?void 0:t.smooth_time)!=null?r:.04)*1e3)/1e3}get defaultPressureAdvance(){var s,t,r,i;return Math.floor(((i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t[this.selectedExtruder])==null?void 0:r.pressure_advance)!=null?i:0)*1e3)/1e3}get defaultSmoothTime(){var s,t,r,i;return Math.floor(((i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t[this.selectedExtruder])==null?void 0:r.pressure_advance_smooth_time)!=null?i:.04)*1e3)/1e3}sendCmd(s){const t="SET_PRESSURE_ADVANCE EXTRUDER=".concat(this.selectedExtruder," ").concat(s.name,"=").concat(s.value);this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t})}};O0([Ze(500)],xo.prototype,"sendCmd",1);xo=O0([O({components:{NumberInput:Ie,Panel:Z,Responsive:Qe}})],xo);var l3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Qe,{attrs:{breakpoints:{small:function(r){return r.width<=350},medium:function(r){return r.width>350&&r.width<=500}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(ke,[t(S,[e.allExtruders.length>1?t(_,{class:{"col-12":i.is.small||i.is.medium}},[t("div",{staticClass:"d-flex align-center"},[e.selectedExtruder!==e.activeExtruder?t(g,{attrs:{icon:"",plain:""},on:{click:e.resetToActiveExtruder}},[t(v,[e._v(e._s(e.mdiRestart))])],1):e._e(),t(Le,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder"),items:e.allExtruders,value:e.activeExtruder,"hide-details":"",outlined:"",dense:""},model:{value:e.selectedExtruder,callback:function(n){e.selectedExtruder=n},expression:"selectedExtruder"}})],1)]):e._e(),t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance"),param:"ADVANCE",target:e.pressureAdvance,"default-value":e.defaultPressureAdvance,extruder:e.selectedExtruder,"output-error-msg":!0,"has-spinner":!0,min:0,max:null,step:.001,dec:3,unit:"s"},on:{submit:e.sendCmd}})],1),t(_,{class:{"col-12":i.is.small}},[t(Ie,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime"),param:"SMOOTH_TIME",target:e.smoothTime,"default-value":e.defaultSmoothTime,extruder:e.selectedExtruder,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,min:0,max:.2,step:.001,dec:3,unit:"s"},on:{submit:e.sendCmd}})],1)],1)],1)]}}])})},c3=[];const Mf={};var u3=N(xo,l3,c3,!1,d3,null,null,null);function d3(e){for(let s in Mf)this[s]=Mf[s]}const h3=function(){return u3.exports}();var p3=Object.defineProperty,m3=Object.getOwnPropertyDescriptor,f3=(e,s,t,r)=>{for(var i=r>1?void 0:r?m3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&p3(s,t,i),i};let ed=class extends j(V,ui){constructor(){super(...arguments),this.mdiPrinter3dNozzleOutline=MP}};ed=f3([O({})],ed);var g3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ke,[t(sc,{attrs:{label:e.$t("Panels.ExtruderControlPanel.ExtrusionFactor"),icon:e.mdiPrinter3dNozzleOutline,target:e.extrudeFactor,min:1,max:200,multi:100,step:1,"has-input-field":!0,command:"M221","attribute-name":"S"}})],1)},v3=[];const Ef={};var _3=N(ed,g3,v3,!1,b3,null,null,null);function b3(e){for(let s in Ef)this[s]=Ef[s]}const y3=function(){return _3.exports}();var C3=Object.defineProperty,$3=Object.getOwnPropertyDescriptor,x3=(e,s,t,r)=>{for(var i=r>1?void 0:r?$3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&C3(s,t,i),i};let td=class extends j(V,Je){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Bs}get rows(){let t=[];for(let r=0;r{for(var i=r>1?void 0:r?S3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&w3(s,t,i),i};let wo=class extends j(V,Je){get active(){var s;return(s=this.macro.variables.active)!=null?s:!1}get color(){var t,r;const s=(r=(t=this.macro.variables.color)!=null?t:this.macro.variables.colour)!=null?r:null;return s===""||s==="undefined"?null:s}get primaryColor(){return this.$store.state.gui.uiSettings.primary}get primaryTextColor(){let s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor);if(s){const t=parseInt(s[1],16)*.2126,r=parseInt(s[2],16)*.7152,i=parseInt(s[3],16)*.0722;return(t+r+i)/255>.7?"#222":"#fff"}return"#ffffff"}get warningColor(){var s,t,r,i,n;return(n=(i=(r=(t=(s=this.$vuetify)==null?void 0:s.theme)==null?void 0:t.currentTheme)==null?void 0:r.warning)==null?void 0:i.toString())!=null?n:"#ff8300"}get buttonStyle(){let s="";return this.active&&(s=this.homedAxes.includes("xyz")?this.primaryColor:this.warningColor),{color:this.active?this.primaryTextColor:"","background-color":s}}get dotStyle(){return{"border-color":this.active?this.primaryTextColor:"","background-color":"#"+this.color}}};L0([k({type:Object})],wo.prototype,"macro",2);wo=L0([O({components:{}})],wo);var P3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(g,{staticClass:"flex-grow-1 px-0",style:e.buttonStyle,attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:function(r){return e.doSend(e.macro.name)}}},[e.color!=null?t("span",{staticClass:"_extruderColorState mr-1",style:e.dotStyle}):e._e(),e._v(" "+e._s(e.macro.name)+" ")])},T3=[];const Of={};var D3=N(wo,P3,T3,!1,M3,"956e3986",null,null);function M3(e){for(let s in Of)this[s]=Of[s]}const E3=function(){return D3.exports}();var O3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"mb-3"},e._l(e.rows,function(r,i){return t(S,{key:"row_"+i,staticClass:"mt-0"},[t(_,[t(Nt,{staticClass:"_btn-group py-0 px-3"},e._l(r,function(n){return t(E3,{key:n.name,attrs:{macro:n}})}),1)],1)],1)}),1)},L3=[];const Lf={};var k3=N(td,O3,L3,!1,A3,"2b552b14",null,null);function A3(e){for(let s in Lf)this[s]=Lf[s]}const F3=function(){return k3.exports}();var R3=Object.defineProperty,I3=Object.getOwnPropertyDescriptor,H3=(e,s,t,r)=>{for(var i=r>1?void 0:r?I3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&R3(s,t,i),i};let sd=class extends j(V,Je){constructor(){super(...arguments),this.mdiCog=Us}get showTools(){var e;return(e=this.$store.state.gui.view.extruder.showTools)!=null?e:!0}set showTools(e){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showTools",value:e})}get showExtrusionFactor(){var e;return(e=this.$store.state.gui.view.extruder.showExtrusionFactor)!=null?e:!0}set showExtrusionFactor(e){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showExtrusionFactor",value:e})}get existsPressureAdvance(){return!(this.$store.getters["printer/getExtruderSteppers"].length>0)}get showPressureAdvance(){var e;return(e=this.$store.state.gui.view.extruder.showPressureAdvance)!=null?e:!0}set showPressureAdvance(e){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showPressureAdvance",value:e})}get showFirmwareRetraction(){var e;return(e=this.$store.state.gui.view.extruder.showFirmwareRetraction)!=null?e:!0}set showFirmwareRetraction(e){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showFirmwareRetraction",value:e})}get showExtruderControl(){var e;return(e=this.$store.state.gui.view.extruder.showExtruderControl)!=null?e:!0}set showExtruderControl(e){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showExtruderControl",value:e})}};sd=H3([O],sd);var j3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($e,{attrs:{"offset-y":!0,left:!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[e.toolchangeMacros.length?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.Tools")},model:{value:e.showTools,callback:function(r){e.showTools=r},expression:"showTools"}})],1):e._e(),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.ExtrusionFactor")},model:{value:e.showExtrusionFactor,callback:function(r){e.showExtrusionFactor=r},expression:"showExtrusionFactor"}})],1),e.existsPressureAdvance?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.PressureAdvance")},model:{value:e.showPressureAdvance,callback:function(r){e.showPressureAdvance=r},expression:"showPressureAdvance"}})],1):e._e(),e.existsFirmwareRetraction?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.FirmwareRetraction")},model:{value:e.showFirmwareRetraction,callback:function(r){e.showFirmwareRetraction=r},expression:"showFirmwareRetraction"}})],1):e._e(),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.ExtruderControl")},model:{value:e.showExtruderControl,callback:function(r){e.showExtruderControl=r},expression:"showExtruderControl"}})],1)],1)],1)},N3=[];const kf={};var V3=N(sd,j3,N3,!1,U3,null,null,null);function U3(e){for(let s in kf)this[s]=kf[s]}const B3=function(){return V3.exports}();var W3=Object.defineProperty,G3=Object.getOwnPropertyDescriptor,Vi=(e,s,t,r)=>{for(var i=r>1?void 0:r?G3(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&W3(s,t,i),i};let lr=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiMenuDown=hr,this.mdiRefresh=Hi,this.paramArray=[],this.params={},this.paramsDialog=!1}get klipperMacro(){return this.$store.getters["printer/getMacro"](this.macro.name)}get isGcodeStyle(){return this.macro.name.match(/[G|M]\d{1,3}/gm)}get paramCols(){if(this.isMobile)return 1;const e=Math.ceil(this.paramArray.length/5);return e>4?4:e}get paramCssCols(){return 12/this.paramCols}get paramsOverlayWidth(){return 200*this.paramCols}klipperMacroChange(){this.refreshParams()}refreshParams(){var e;this.paramArray.splice(0,this.paramArray.length),this.params={},((e=this.klipperMacro)==null?void 0:e.params)!==null&&Object.keys(this.klipperMacro.params).forEach(s=>{s.startsWith("_")||(this.paramArray.push(s),this.params[s]={type:this.klipperMacro.params[s].type,default:this.klipperMacro.params[s].default,value:""})})}doSendMacro(e){this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"macro_"+e})}sendWithParams(){let e=[];this.paramArray.forEach(t=>{var i;let r=(i=this.params[t].value)==null?void 0:i.toString().trim();if(this.params[t].value!==null&&r!==""){let n=t;r!=null&&r.includes(" ")&&(r='"'.concat(r,'"')),n+=this.isGcodeStyle?r:"=".concat(r),e.push(n)}});const s=this.macro.name+" "+e.join(" ");this.doSendMacro(s)}mounted(){this.refreshParams()}};Vi([k({required:!0})],lr.prototype,"macro",2);Vi([k({default:"primary"})],lr.prototype,"color",2);Vi([k({default:null})],lr.prototype,"alias",2);Vi([k({default:!1})],lr.prototype,"disabled",2);Vi([me("klipperMacro")],lr.prototype,"klipperMacroChange",1);lr=Vi([O({components:{Panel:Z}})],lr);var z3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Nt,{staticClass:"d-inline-block"},[t(g,{class:e.paramArray.length?"macroWithParameters":"",attrs:{small:"",color:e.color,loading:e.loadings.includes("macro_"+e.macro.name),disabled:e.disabled},on:{click:function(r){return e.doSendMacro(e.macro.name)}}},[e._v(" "+e._s(e.alias?e.alias:e.macro.name.replace(/_/g," "))+" ")]),e.paramArray.length?[e.isMobile?[t(g,{staticClass:"minwidth-0 px-1 btnMacroMenu",attrs:{disabled:e.disabled,color:e.color,small:""},on:{click:function(r){e.paramsDialog=!0}}},[t(v,[e._v(e._s(e.mdiMenuDown))])],1),t(oe,{model:{value:e.paramsDialog,callback:function(r){e.paramsDialog=r},expression:"paramsDialog"}},[t(Z,{attrs:{title:e.macro.name,"card-class":"macro-params-mobile-".concat(e.macro.name),"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.paramsDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}],null,!1,2576054633)},[t(q,[t(S,e._l(e.paramArray,function(r,i){return t(_,{key:"param_mobile_"+i,attrs:{cols:6}},[t(re,{attrs:{label:r,placeholder:e.params[r].default,"persistent-placeholder":!0,"hide-details":"",outlined:"",dense:"",clearable:"","clear-icon":e.mdiRefresh},on:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.sendWithParams.apply(null,arguments)}},model:{value:e.params[r].value,callback:function(n){e.$set(e.params[r],"value",n)},expression:"params[name].value"}})],1)}),1)],1),t(ne,{staticClass:"px-4 pb-4"},[t(g,{staticClass:"text-uppercase",attrs:{color:"primary",block:""},on:{click:e.sendWithParams}},[e._v(" "+e._s(e.$t("Panels.MacrosPanel.Send"))+" ")])],1)],1)],1)]:t($e,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0 px-1 btnMacroMenu",attrs:{disabled:e.disabled,color:e.color,small:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,3313662284)},[t(De,{attrs:{"max-width":e.paramsOverlayWidth}},[t(q,{staticClass:"py-2"},[t(S,{staticClass:"my-2"},e._l(e.paramArray,function(r,i){return t(_,{key:"param_"+i,attrs:{cols:e.paramCssCols}},[t(re,{attrs:{label:r,placeholder:e.params[r].default,"persistent-placeholder":!0,"hide-details":"",outlined:"",dense:"",clearable:"","clear-icon":e.mdiRefresh},on:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.sendWithParams.apply(null,arguments)}},model:{value:e.params[r].value,callback:function(n){e.$set(e.params[r],"value",n)},expression:"params[name].value"}})],1)}),1),t(S,{staticClass:"my-2"},[t(_,{staticClass:"py-0"},[t(g,{staticClass:"text-uppercase",attrs:{color:"primary",block:""},on:{click:e.sendWithParams}},[e._v(" "+e._s(e.$t("Panels.MacrosPanel.Send"))+" ")])],1)],1)],1)],1)],1)]:e._e()],2)},Z3=[];const Af={};var q3=N(lr,z3,Z3,!1,X3,"029e4e5c",null,null);function X3(e){for(let s in Af)this[s]=Af[s]}const Ks=function(){return q3.exports}();var Y3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showPanel?t(Z,{attrs:{icon:e.mdiPrinter3dNozzle,title:e.$t("Panels.ExtruderControlPanel.Headline"),collapsible:!0,"card-class":"extruder-control-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showFilamentMacros?t($e,{attrs:{"offset-y":!0,"close-on-content-click":!1,left:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,2883138713)},[t(Oe,{attrs:{dense:""}},[e.unloadFilamentMacro?t(K,[t(pe,{attrs:{top:"",disabled:e.canExecuteUnloadMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return[t("div",e._g({},i),[t(Ks,{attrs:{macro:e.unloadFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.UnloadFilament"),disabled:!e.canExecuteUnloadMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,3835858943)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.loadFilamentMacro?t(K,[t(pe,{attrs:{top:"",disabled:e.canExecuteLoadMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return[t("div",e._g({},i),[t(Ks,{attrs:{macro:e.loadFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.LoadFilament"),disabled:!e.canExecuteLoadMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,1294394980)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.purgeFilamentMacro?t(K,[t(pe,{attrs:{top:"",disabled:e.canExecutePurgeMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return[t("div",e._g({},i),[t(Ks,{attrs:{macro:e.purgeFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.PurgeFilament"),disabled:!e.canExecutePurgeMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,2789275863)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.cleanNozzleMacro?t(K,[t(Ks,{attrs:{macro:e.cleanNozzleMacro,alias:e.$t("Panels.ExtruderControlPanel.CleanNozzle"),disabled:e.printerIsPrintingOnly,color:"#272727"}})],1):e._e()],1)],1):e._e(),t(B3)]},proxy:!0}],null,!1,40833120)},[e.showTools&&e.toolchangeMacros.length?t(F3):e._e(),e.showExtrusionFactor?[e.showTools?t(E):e._e(),t(y3)]:e._e(),e.showPressureAdvance?[e.showTools||e.showExtrusionFactor?t(E):e._e(),t(h3)]:e._e(),e.showFirmwareRetraction?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance?t(E):e._e(),t(n3)]:e._e(),e.showExtruderControl?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance||e.showFirmwareRetraction?t(E):e._e(),t(KD)]:e._e()],2):e._e()},J3=[];const Ff={};var K3=N(Yu,Y3,J3,!1,Q3,null,null,null);function Q3(e){for(let s in Ff)this[s]=Ff[s]}const e5=function(){return K3.exports}(),rc=(e,s)=>{s!==null&&typeof s=="object"&&Object.keys(s).forEach(t=>{const r=s[t];typeof r=="object"&&!Array.isArray(r)&&t in e&&r!==null&&e[t]!==null?rc(e[t],r):y.set(e,t,r)})},Rt=(e,s)=>{if(e!=null&&s.length){const t=e==null?void 0:e.find(r=>r.isDirectory&&r.filename===s[0]);if(t){if(s.shift(),t.childrens&&s.length)return Rt(t.childrens,s);if(t.childrens)return t.childrens}return e}return null},$t=(e,s)=>e.sort((t,r)=>{const i=t[s].toLowerCase(),n=r[s].toLowerCase();return in?1:0}),kr=e=>e.charAt(0).toUpperCase()+e.slice(1),t5=e=>e.replace(/_/g," ").replace(/(?:^\w|[A-Z]|\b\w)/g,(s,t)=>t===0?s.toLowerCase():s.toUpperCase()).replace(/\s+/g,"");function kp(e){return e=e.replace(/^!! /g,""),e=e.replace(/\n!! /g,"\n"),e=e.replace(/^\/\/ /g,""),e=e.replace(/\n\/\/ /g,"\n"),e=e.replace(/^echo:/g,""),e=e.replace(/^echo: /g,""),e=e.replace("\n// ","
"),e=e.replace(/\r\n|\r|\n/g,"
"),e}const gt=e=>{let s="";return e=e.replace(/_/g," "),e.split(" ").forEach(t=>{s+=" "+t.charAt(0).toUpperCase()+t.slice(1)}),s=s.slice(1),s},it=e=>{let s=-1;const t=[" kB"," MB"," GB"," TB"," PB"," EB"," ZB"," YB"];do e=e/1024,s++;while(e>1024);return Math.max(e,.1).toFixed(1)+t[s]},s5=e=>{let s=-1;const t=[" kHz"," MHz"," GHz"];do e=e/1e3,s++;while(e>1e3);return Math.max(e,.1).toFixed()+t[s]},r5=e=>{if(e){let s="";const t=Math.floor(e/86400);t&&(e%=3600*24,s+=t+"d");const r=Math.floor(e/3600);e%=3600,r&&(s+=" "+r+"h");const i=Math.floor(e/60);i&&(s+=" "+i+"m");const n=e%60;return n&&(s+=" "+n.toFixed(0)+"s"),s}return"--"},Ap=(e,s,t)=>{const r=s.length?s[0]:"filename",i=t[0];return e!==null&&(e.sort(function(n,a){if(n[r]===a[r])return 0;if(n[r]===null||n[r]===void 0)return-1;if(a[r]===null||a[r]===void 0)return 1;if(n[r].constructor===String&&a[r].constructor===String)return n[r].localeCompare(a[r],void 0,{sensivity:"base"});if(n[r]instanceof Array&&a[r]instanceof Array){const o=n[r].length?n.filament.reduce((c,u)=>c+u):0,l=a[r].length?a.filament.reduce((c,u)=>c+u):0;return o-l}return n[r]-a[r]}),i&&e.reverse(),e.sort((n,a)=>n.isDirectory===a.isDirectory?0:n.isDirectory?-1:1)),e!=null?e:[]};function So(e,s){var i,n;const t=Math.min((i=e==null?void 0:e.length)!=null?i:Number.MAX_VALUE,(n=s==null?void 0:s.length)!=null?n:Number.MAX_VALUE);let r=0;for(;r{for(var i=r>1?void 0:r?a5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&n5(s,t,i),i};let Is=class extends V{get macrogroups(){var e;return(e=this.$store.getters["gui/macros/getAllMacrogroups"])!=null?e:[]}get webcams(){var e;return(e=this.$store.getters["gui/webcams/getWebcams"])!=null?e:[]}getPanelName(e){var s;if(e.startsWith("macrogroup_")){const t=(s=e.split("_")[1])!=null?s:"",r=this.macrogroups.find(i=>i.id===t);return r?r.name:"Macrogroup"}if(e.includes("-")){let t="";return e.split("-").forEach(i=>{t+=kr(i)}),this.$t("Panels.".concat(t,"Panel.Headline"))}return this.$t("Panels.".concat(kr(e),"Panel.Headline"))}convertPanelnameToIcon(e){if(e.startsWith("macrogroup_"))return Tn;switch(e){case"webcam":return ji;case"zoffset":return ES;case"toolhead-control":return wp;case"macros":return Tn;case"miscellaneous":return _p;case"temperature":return v0;case"miniconsole":return ua;case"machine-settings":return Zb;case"extruder-control":return Bs;default:return At}}};Is=o5([O],Is);var l5=Object.defineProperty,c5=Object.getOwnPropertyDescriptor,Rp=(e,s,t,r)=>{for(var i=r>1?void 0:r?c5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&l5(s,t,i),i};let Mn=class extends j(V){get colorMainsail(){return"200,200,200"}get colorMoonraker(){return this.moonraker?"200,200,200":"115,115,115"}get colorKlipper(){return this.klipper?"200,200,200":"115,115,115"}};Rp([k({default:!1})],Mn.prototype,"moonraker",2);Rp([k({default:!1})],Mn.prototype,"klipper",2);Mn=Rp([O],Mn);var u5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("svg",{staticStyle:{"fill-rule":"evenodd","clip-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2"},attrs:{width:"100%",height:"100%",viewBox:"0 0 430 70",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","xml:space":"preserve","xmlns:serif":"http://www.serif.com/"}},[t("g",{attrs:{id:"Mainsail",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Mainsail_text",transform:"matrix(1,0,0,1,-54.2745,6.1424)"}},[t("text",{style:"font-family:Roboto;font-size:16px;fill:rgb("+e.colorMainsail+");",attrs:{x:"47.429px",y:"60.749px"}},[e._v(" Mainsail ")])]),t("g",{attrs:{id:"Mainsail_icon",transform:"matrix(1.00478,0,0,1.00478,-1.35436,-0.18202)"}},[t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M286.718,107.235L99.735,392.115L0,392.01L258.225,0C264.135,36.795 273.9,73.26 286.718,107.235"}})]),t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M309.96,160.155L156.375,392.19L256.08,392.332L357.353,237.585C339.518,213.218 323.648,187.328 309.96,160.155"}})]),t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M449.535,335.768L412.597,392.332L312.75,392.115L388.95,276.862C407.61,298.012 427.868,317.707 449.535,335.767L449.535,335.768Z"}})])])]),t("g",{attrs:{id:"Mainsail_Moonraker",transform:"matrix(1,0,0,1,1.49628,0)"}},[t("g",{attrs:{id:"arrow_left1","serif:id":"arrow_left",transform:"matrix(0.687874,0,0,0.721154,20.3568,-15.8811)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+")",attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),t("g",{attrs:{id:"arrow_right1","serif:id":"arrow_right",transform:"matrix(-0.687874,-8.42403e-17,8.83159e-17,-0.721154,217.125,59.8811)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+")",attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),e.moonraker?t("g",{attrs:{id:"success1","serif:id":"success",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(38, 203, 124)","fill-rule":"nonzero"},attrs:{d:"M20,12C20,16.389 16.389,20 12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}})]):t("g",{attrs:{id:"alert1","serif:id":"alert",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(245, 124, 5)","fill-rule":"nonzero"},attrs:{d:"M11,15L13,15L13,17L11,17L11,15M11,7L13,7L13,13L11,13L11,7M12,2C6.47,2 2,6.5 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C16.389,4 20,7.611 20,12C20,16.389 16.389,20 12,20Z"}})])]),t("g",{attrs:{id:"Moonraker",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Moonraker_text",transform:"matrix(1,0,0,1,120.368,6.1424)"}},[t("text",{style:"fill:rgb("+e.colorMoonraker+");font-family:Roboto;font-size:16px;",attrs:{x:"45.429px",y:"60.749px"}},[e._v(" Moonraker ")])]),t("g",{attrs:{id:"Moonraker_icon",transform:"matrix(2,0,0,2,181,-5)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+");fill-rule:nonzero;",attrs:{d:"M13,19L14,19C14.549,19 15,19.451 15,20L22,20L22,22L15,22C15,22.549 14.549,23 14,23L10,23C9.451,23 9,22.549 9,22L2,22L2,20L9,20C9,19.451 9.451,19 10,19L11,19L11,17L4,17C3.451,17 3,16.549 3,16L3,12C3,11.451 3.451,11 4,11L20,11C20.549,11 21,11.451 21,12L21,16C21,16.549 20.549,17 20,17L13,17L13,19M4,3L20,3C20.549,3 21,3.451 21,4L21,8C21,8.549 20.549,9 20,9L4,9C3.451,9 3,8.549 3,8L3,4C3,3.451 3.451,3 4,3M9,7L10,7L10,5L9,5L9,7M9,15L10,15L10,13L9,13L9,15M5,5L5,7L7,7L7,5L5,5M5,13L5,15L7,15L7,13L5,13Z"}})])]),t("g",{attrs:{id:"Moonraker_Klipper",transform:"matrix(1,0,0,1,194.593,0)"}},[t("g",{attrs:{id:"arrow_left",transform:"matrix(0.687874,0,0,0.721154,20.3568,-15.8811)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)"},attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),t("g",{attrs:{id:"arrow_right",transform:"matrix(-0.687874,-8.42403e-17,8.83159e-17,-0.721154,217.125,59.8811)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)"},attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),e.moonraker?[e.klipper?t("g",{attrs:{id:"success",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(38, 203, 124)","fill-rule":"nonzero"},attrs:{d:"M20,12C20,16.389 16.389,20 12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}})]):t("g",{attrs:{id:"alert",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(245, 124, 5)","fill-rule":"nonzero"},attrs:{d:"M11,15L13,15L13,17L11,17L11,15M11,7L13,7L13,13L11,13L11,7M12,2C6.47,2 2,6.5 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C16.389,4 20,7.611 20,12C20,16.389 16.389,20 12,20Z"}})])]:[t("g",{attrs:{id:"unknown",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)","fill-rule":"nonzero"},attrs:{d:"M11,18L13,18L13,16L11,16L11,18M12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6C9.806,6 8,7.806 8,10L10,10C10,8.903 10.903,8 12,8C13.097,8 14,8.903 14,10C14,12 11,11.75 11,15L13,15C13,12.75 16,12.5 16,10C16,7.806 14.194,6 12,6Z"}})])]],2),t("g",{attrs:{id:"Klipper",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Klipper_text",transform:"matrix(1,0,0,1,317.036,6.1424)"}},[t("text",{style:"font-family:Roboto;font-size:16px;fill:rgb("+e.colorKlipper+");",attrs:{x:"48.429px",y:"60.749px"}},[e._v(" Klipper ")])]),t("g",{attrs:{id:"Klipper_icon",transform:"matrix(2,0,0,2,366,-3)"}},[t("path",{style:"fill:rgb("+e.colorKlipper+");fill-rule:nonzero;",attrs:{d:"M19,6C19.549,6 20,5.549 20,5C20,4.451 19.549,4 19,4C18.451,4 18,4.451 18,5C18,5.549 18.451,6 19,6M19,2C20.646,2 22,3.354 22,5L22,11L18,11L18,7L6,7L6,11L2,11L2,5C2,3.354 3.354,2 5,2L19,2M18,18.25C18,18.63 17.79,18.96 17.47,19.13L12.57,21.82C12.4,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L6.53,19.13C6.21,18.96 6,18.63 6,18.25L6,13C6,12.62 6.21,12.29 6.53,12.12L11.43,9.68C11.59,9.56 11.79,9.5 12,9.5C12.21,9.5 12.4,9.56 12.57,9.68L17.47,12.12C17.79,12.29 18,12.62 18,13L18,18.25M12,11.65L9.04,13L12,14.6L14.96,13L12,11.65M8,17.66L11,19.29L11,16.33L8,14.71L8,17.66M16,17.66L16,14.71L13,16.33L13,19.29L16,17.66Z"}})])])])},d5=[];const Rf={};var h5=N(Mn,u5,d5,!1,p5,null,null,null);function p5(e){for(let s in Rf)this[s]=Rf[s]}const ic=function(){return h5.exports}();var m5=Object.defineProperty,f5=Object.getOwnPropertyDescriptor,g5=(e,s,t,r)=>{for(var i=r>1?void 0:r?f5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&m5(s,t,i),i};let id=class extends j(V){constructor(){super(...arguments),this.mdiPrinter3d=ha,this.mdiRestart=jr,this.mdiDownload=Gb,this.mdiPower=o0}get klippy_message(){var e;return(e=this.$store.state.server.klippy_message)!=null?e:null}get messageType(){switch(this.klipperState){case"startup":return{color:"info",icon:FP};case"shutdown":return{color:"warning",icon:Sn};case"error":return{color:"error",icon:Sn};case"disconnected":return{color:"",icon:gp};default:return{color:"",icon:vP}}}restart(){this.$socket.emit("printer.restart",{},{loading:"restart"})}firmwareRestart(){this.$socket.emit("printer.firmware_restart",{},{loading:"firmwareRestart"})}downloadLog(e){e.preventDefault();let s="";"href"in e.target.attributes&&(s=e.target.attributes.href.value),"href"in e.target.parentElement.attributes&&(s=e.target.parentElement.attributes.href.value),window.open(s)}powerOn(){this.$socket.emit("machine.device_power.post_device",{device:this.printerPowerDevice,action:"on"},{action:"server/power/responseToggle"})}};id=g5([O({components:{Panel:Z,ConnectionStatus:ic}})],id);var v5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperState!=="ready"&&e.socketIsConnected?t("div",[e.klippyIsConnected?[t(dt,{staticClass:"mb-0 mb-6",attrs:{color:e.messageType.color,dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(v,{staticClass:"pr-2",attrs:{color:e.messageType.color}},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Klipper"}))+": "+e._s(e.klipperState.toUpperCase())+" ")],1),e.klippy_message!==null?t("div",[t("pre",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.klippy_message.trim()))]),t(E,{staticClass:"mt-2 pb-3"}),t(S,[t(_,[t(g,{class:"".concat(e.messageType.color,"--text my-1"),staticStyle:{width:"100%"},attrs:{small:"",outlined:"",text:""},on:{click:e.restart}},[t(v,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.Restart"))+" ")],1),t(g,{class:"".concat(e.messageType.color,"--text my-1"),staticStyle:{width:"100%"},attrs:{small:"",outlined:"",text:""},on:{click:e.firmwareRestart}},[t(v,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.FirmwareRestart"))+" ")],1)],1),t(_,[t(g,{class:"".concat(e.messageType.color,"--text my-1"),staticStyle:{width:"100%"},attrs:{href:e.apiUrl+"/server/files/klippy.log",small:"",outlined:"",text:""},on:{click:e.downloadLog}},[t(v,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" Klipper Log ")],1),t(g,{class:"".concat(e.messageType.color,"--text my-1"),staticStyle:{width:"100%"},attrs:{href:e.apiUrl+"/server/files/moonraker.log",small:"",outlined:"",text:""},on:{click:e.downloadLog}},[t(v,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" Moonraker Log ")],1)],1)],1)],1):t(q,{staticClass:"text-center py-3"},[t(at,{attrs:{indeterminate:"",color:e.messageType.color}})],1)],1)]:e.isPrinterPowerOff?[t(dt,{staticClass:"mb-6",attrs:{dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(v,{staticClass:"pr-2"},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.PrinterSwitchedOff"))+" ")],1),t("p",[e._v(e._s(e.$t("Panels.KlippyStatePanel.PrinterSwitchedOffDescription")))]),t(S,[t(_,{staticClass:"text-center"},[t(g,{class:"".concat(e.messageType.color,"--text my-1"),attrs:{small:"",outlined:"",text:""},on:{click:e.powerOn}},[t(v,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiPower))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.PowerOn"))+" ")],1)],1)],1)],1)]:e.klipperState==="disconnected"?[t(dt,{staticClass:"mb-6",attrs:{dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(v,{staticClass:"pr-2"},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Moonraker"}))+": "+e._s(e.klipperState.toUpperCase())+" ")],1),t(ic,{attrs:{moonraker:!0,klipper:!1}}),t("p",{staticClass:"mt-2 mb-0 text-center"},[e._v(e._s(e.$t("Panels.KlippyStatePanel.MoonrakerCannotConnect")))]),t("p",{staticClass:"mb-0 text-center"},[e._v(e._s(e.$t("Panels.KlippyStatePanel.CheckKlippyAndUdsAddress")))])],1)]:e._e()],2):e._e()},_5=[];const If={};var b5=N(id,v5,_5,!1,y5,null,null,null);function y5(e){for(let s in If)this[s]=If[s]}const ma=function(){return b5.exports}();var C5=Object.defineProperty,$5=Object.getOwnPropertyDescriptor,fa=(e,s,t,r)=>{for(var i=r>1?void 0:r?$5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&C5(s,t,i),i};let Ar=class extends j(V){get expand(){return this.$store.getters["gui/getPanelExpand"](this.subPanelClass,this.viewport)}set expand(e){this.$store.dispatch("gui/saveExpandPanel",{name:this.subPanelClass,value:e,viewport:this.viewport})}};fa([k({required:!1,default:Vs})],Ar.prototype,"iconExpanded",2);fa([k({required:!1,default:Vs})],Ar.prototype,"iconCollapsed",2);fa([k({required:!0,default:""})],Ar.prototype,"title",2);fa([k({required:!0})],Ar.prototype,"subPanelClass",2);Ar=fa([O],Ar);var x5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t("div",{staticClass:"px-3 d-flex align-center"},[t(g,{staticClass:"px-0 btn-collapsible",attrs:{plain:"",small:"",ripple:!1},on:{click:function(r){e.expand=!e.expand}}},[t(v,{class:e.expand?"":"icon-rotate-n90",attrs:{small:""}},[e._v(" "+e._s(e.expand?e.iconExpanded:e.iconCollapsed)+" ")]),t("span",{staticClass:"pl-1"},[e._v(e._s(e.title))])],1),t(E,{staticClass:"ml-3"})],1),t(jl,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}]},[e._t("default")],2)])],1)},w5=[];const Hf={};var S5=N(Ar,x5,w5,!1,P5,"28d7b868",null,null);function P5(e){for(let s in Hf)this[s]=Hf[s]}const k0=function(){return S5.exports}();var T5=Object.defineProperty,D5=Object.getOwnPropertyDescriptor,A0=(e,s,t,r)=>{for(var i=r>1?void 0:r?D5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&T5(s,t,i),i};let Po=class extends j(V){get velocity(){var e,s,t;return Math.trunc((t=(s=(e=this.$store.state.printer)==null?void 0:e.toolhead)==null?void 0:s.max_velocity)!=null?t:300)}get accel(){var e,s,t;return Math.trunc((t=(s=(e=this.$store.state.printer)==null?void 0:e.toolhead)==null?void 0:s.max_accel)!=null?t:3e3)}get accelToDecel(){var e,s,t;return Math.trunc((t=(s=(e=this.$store.state.printer)==null?void 0:e.toolhead)==null?void 0:s.max_accel_to_decel)!=null?t:this.accel/2)}get minimumCruiseRatio(){var s,t,r;const e=(r=(t=(s=this.$store.state.printer)==null?void 0:s.toolhead)==null?void 0:t.minimum_cruise_ratio)!=null?r:null;return e===null?null:Math.round(e*100)/100}get squareCornerVelocity(){var e,s,t;return Math.floor(((t=(s=(e=this.$store.state.printer)==null?void 0:e.toolhead)==null?void 0:s.square_corner_velocity)!=null?t:8)*10)/10}get defaultVelocity(){var e,s,t,r,i;return Math.trunc((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.printer)==null?void 0:r.max_velocity)!=null?i:300)}get defaultAccel(){var e,s,t,r,i;return Math.trunc((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.printer)==null?void 0:r.max_accel)!=null?i:3e3)}get defaultAccelToDecel(){var e,s,t,r,i;return Math.trunc((i=(r=(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)==null?void 0:t.printer)==null?void 0:r.max_accel_to_decel)!=null?i:1500)}get defaultMinimumCruiseRatio(){var s,t,r,i,n;const e=(n=(i=(r=(t=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:t.settings)==null?void 0:r.printer)==null?void 0:i.minimum_cruise_ratio)!=null?n:.5;return Math.round(e/10)*10}get defaultSquareCornerVelocity(){var s,t,r,i,n;const e=(n=(i=(r=(t=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:t.settings)==null?void 0:r.printer)==null?void 0:i.square_corner_velocity)!=null?n:8;return Math.floor(e*10)/10}sendCmd(e){const s="SET_VELOCITY_LIMIT ".concat(e.name,"=").concat(e.value);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}};A0([Ze(500)],Po.prototype,"sendCmd",1);Po=A0([O({components:{Panel:Z,NumberInput:Ie,Responsive:Qe}})],Po);var M5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ke,[t(Qe,{attrs:{breakpoints:{small:function(r){return r.width<375},medium:function(r){return r.width>=375}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(S,[t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[t(Ie,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.Velocity"),param:"VELOCITY",target:e.velocity,"default-value":e.defaultVelocity,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1),t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[t(Ie,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.SquareCornerVelocity"),param:"SQUARE_CORNER_VELOCITY",target:e.squareCornerVelocity,"default-value":e.defaultSquareCornerVelocity,"output-error-msg":!0,"has-spinner":!0,step:.1,min:.1,max:null,dec:1,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1),t(S,[t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[t(Ie,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.Acceleration"),param:"ACCEL",target:e.accel,"default-value":e.defaultAccel,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:1,min:1,max:null,dec:0,unit:"mm/s²"},on:{submit:e.sendCmd}})],1),t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[e.minimumCruiseRatio===null?t(Ie,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.MaxAccelToDecel"),param:"ACCEL_TO_DECEL",target:e.accelToDecel,"default-value":e.defaultAccelToDecel,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:1,min:1,max:null,dec:0,unit:"mm/s²"},on:{submit:e.sendCmd}}):t(Ie,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.MinimumCruiseRatio"),param:"MINIMUM_CRUISE_RATIO",target:e.minimumCruiseRatio,"default-value":e.defaultMinimumCruiseRatio,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:.01,min:0,max:.99,dec:2},on:{submit:e.sendCmd}})],1)],1)]}}])})],1)},E5=[];const jf={};var O5=N(Po,M5,E5,!1,L5,null,null,null);function L5(e){for(let s in jf)this[s]=jf[s]}const F0=function(){return O5.exports}();var k5=Object.defineProperty,A5=Object.getOwnPropertyDescriptor,F5=(e,s,t,r)=>{for(var i=r>1?void 0:r?A5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&k5(s,t,i),i};let nd=class extends j(V){constructor(){super(...arguments),this.mdiEngine=Zb}};nd=F5([O({components:{Panel:Z,SubPanel:k0,MotionSettings:F0}})],nd);var R5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(Z,{attrs:{icon:e.mdiEngine,title:e.$t("Panels.MachineSettingsPanel.Headline").toString(),collapsible:!0,"card-class":"machine-settings-panel"}},[t("div",[t(F0)],1)]):e._e()},I5=[];const Nf={};var H5=N(nd,R5,I5,!1,j5,null,null,null);function j5(e){for(let s in Nf)this[s]=Nf[s]}const N5=function(){return H5.exports}();var V5=Object.defineProperty,U5=Object.getOwnPropertyDescriptor,R0=(e,s,t,r)=>{for(var i=r>1?void 0:r?U5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&V5(s,t,i),i};let To=class extends j(V){constructor(){super(...arguments),this.mdiCodeTags=Tn}get macrogroup(){return this.$store.getters["gui/macros/getMacrogroup"](this.panelId)}get allMacros(){var s;return(s=this.$store.getters["printer/getMacros"])!=null?s:[]}get macros(){var t,r;let s=(r=(t=this.macrogroup)==null?void 0:t.macros)!=null?r:[];return s=s.filter(i=>this.allMacros.find(n=>n.name.toLowerCase()===i.name.toLowerCase())?i.showInStandby&&["standby","cancelled","complete","error"].includes(this.printer_state)||i.showInPause&&this.printer_state==="paused"||i.showInPrinting&&this.printer_state==="printing":!1),s.sort((i,n)=>i.pos-n.pos)}get macrogroupStatus(){return this.macrogroup.showInStandby&&["standby","cancelled","complete","error"].includes(this.printer_state)||this.macrogroup.showInPause&&this.printer_state==="paused"||this.macrogroup.showInPrinting&&this.printer_state==="printing"}getColor(s){return s.color==="group"?this.macrogroup.color==="custom"?this.macrogroup.colorCustom:this.macrogroup.color:s.color}};R0([k({required:!0})],To.prototype,"panelId",2);To=R0([O({components:{MacroButton:Ks,Panel:Z}})],To);var B5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui&&e.macros.length>0&&e.macrogroupStatus?t(Z,{attrs:{icon:e.mdiCodeTags,title:e.macrogroup.name,collapsible:!0,"card-class":"macrogroup_"+e.panelId+"_panel"}},[t(q,{staticClass:"py-2"},[t(S,[t(_,{staticClass:"text-center"},e._l(e.macros,function(r,i){return t(Ks,{key:"macroparam_"+i,staticClass:"mx-1 my-1",attrs:{macro:r,color:e.getColor(r)}})}),1)],1)],1)],1):e._e()},W5=[];const Vf={};var G5=N(To,B5,W5,!1,z5,null,null,null);function z5(e){for(let s in Vf)this[s]=Vf[s]}const Z5=function(){return G5.exports}();var q5=Object.defineProperty,X5=Object.getOwnPropertyDescriptor,Y5=(e,s,t,r)=>{for(var i=r>1?void 0:r?X5(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&q5(s,t,i),i};let ad=class extends j(V){constructor(){super(...arguments),this.mdiCodeTags=Tn}get hiddenMacros(){var s,t,r;return((r=(t=(s=this.$store.state.gui)==null?void 0:s.macros)==null?void 0:t.hiddenMacros)!=null?r:[]).map(i=>i.toLowerCase())}get macros(){return this.$store.getters["printer/getMacros"].filter(t=>!this.hiddenMacros.includes(t.name.toLowerCase()))}};ad=Y5([O({components:{MacroButton:Ks,Panel:Z}})],ad);var J5=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui&&e.macros.length>0?t(Z,{attrs:{icon:e.mdiCodeTags,title:e.$t("Panels.MacrosPanel.Headline"),collapsible:!0,"card-class":"macros-panel"}},[t(q,{staticClass:"py-2"},[t(S,[t(_,{staticClass:"text-center"},e._l(e.macros,function(r,i){return t(Ks,{key:"macro_"+i,staticClass:"mx-1 my-1",attrs:{macro:r,color:"primary"}})}),1)],1)],1)],1):e._e()},K5=[];const Uf={};var Q5=N(ad,J5,K5,!1,eM,null,null,null);function eM(e){for(let s in Uf)this[s]=Uf[s]}const tM=function(){return Q5.exports}();var sM=Object.defineProperty,rM=Object.getOwnPropertyDescriptor,I0=(e,s,t,r)=>{for(var i=r>1?void 0:r?rM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&sM(s,t,i),i};let Do=class extends j(V){get entryStyle(){var s;const e=["ma-0"];return e.push((s=this.$store.state.gui.console.entryStyle)!=null?s:"default"),this.event.type==="action"&&e.push("text--disabled"),e}get entryFormatTime(){return this.formatTime(this.event.date.getTime(),!0)}get messageClass(){const e=["console-message"];return this.event.type==="action"?e.push("text--disabled"):this.event.message.startsWith("!! ")?e.push("error--text"):e.push("text--primary"),e}commandClick(e){const s=e.target;if(s.localName==="a"&&s.className.indexOf("command")!==-1){const t=s.innerHTML.replace(/
/g,"\n");this.$emit("command-click",t)}}};I0([k({required:!0})],Do.prototype,"event",2);Do=I0([O],Do);var iM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,{class:e.entryStyle},[t(_,{staticClass:"col-auto pr-0 text--disabled console-time"},[e._v(e._s(e.entryFormatTime))]),t(_,{class:e.messageClass,domProps:{innerHTML:e._s(e.event.formatMessage)},on:{"!click":function(r){return e.commandClick.apply(null,arguments)}}})],1)},nM=[];const Bf={};var aM=N(Do,iM,nM,!1,oM,"b5bd1d04",null,null);function oM(e){for(let s in Bf)this[s]=Bf[s]}const H0=function(){return aM.exports}();var lM=Object.defineProperty,cM=Object.getOwnPropertyDescriptor,Ip=(e,s,t,r)=>{for(var i=r>1?void 0:r?cM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&lM(s,t,i),i};let En=class extends y{commandClick(e){this.$emit("command-click",e)}};Ip([k({required:!0})],En.prototype,"events",2);Ip([k({required:!1,default:!1})],En.prototype,"isMini",2);En=Ip([O({components:{ConsoleTableEntry:H0}})],En);var uM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{class:"consoleTable "+(e.isMini?"mini":"")},[e.events.length===0?[t(S,{staticClass:"pa-0 ma-0"},[t(_,{staticClass:"text-center py-3"},[e._v(e._s(e.$t("Console.Empty")))])],1)]:e._l(e.events,function(r,i){return t(H0,{key:i,staticClass:"consoleTableRow",attrs:{event:r},on:{"command-click":e.commandClick}})})],2)},dM=[];const Wf={};var hM=N(En,uM,dM,!1,pM,null,null,null);function pM(e){for(let s in Wf)this[s]=Wf[s]}const nc=function(){return hM.exports}();var mM=Object.defineProperty,fM=Object.getOwnPropertyDescriptor,ac=(e,s,t,r)=>{for(var i=r>1?void 0:r?fM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&mM(s,t,i),i};let di=class extends j(V){constructor(){super(...arguments),this.cmdListSearch="",this.isOpen=!1,this.mdiHelp=Jb,this.mdiCloseThick=Ce}get helplist(){var e;return(e=this.$store.state.printer.helplist)!=null?e:[]}get helplistFiltered(){return this.helplist.filter(e=>typeof e.description=="string"&&(!this.cmdListSearch||e.commandLow.includes(this.cmdListSearch.toLowerCase()))).sort((e,s)=>e.commandLow.localeCompare(s.commandLow))}onIsOpen(e){e||(this.cmdListSearch="")}};ac([k({required:!1,default:!1})],di.prototype,"isMini",2);ac([k({required:!1,default:!1})],di.prototype,"inToolbar",2);ac([me("isOpen")],di.prototype,"onIsOpen",1);di=ac([O({components:{Panel:Z}})],di);var gM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{transition:"dialog-bottom-transition","max-width":"600",fullscreen:e.isMobile},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[e.inToolbar?[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiHelp))])],1)]:[t(g,e._g(e._b({staticClass:"gcode-command-btn px-2 minwidth-0",attrs:{color:"lightgray",small:e.isMini}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiHelp))])],1)]]}},{key:"default",fn:function(){return[t(Z,{attrs:{title:e.$t("Console.CommandList"),icon:e.mdiHelp,"card-class":"command-help-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.isOpen=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(vt,[t(S,[t(_,[t(re,{attrs:{label:"Search",outlined:"","hide-details":"",clearable:"",dense:""},model:{value:e.cmdListSearch,callback:function(r){e.cmdListSearch=r},expression:"cmdListSearch"}})],1)],1)],1),t(E),t("overlay-scrollbars",{staticClass:"command-help-content",class:e.isMobile?"mobileHeight":"height300"},[t(q,{staticClass:"pt-0"},[t(S,[t(_,[t(Oe,e._l(e.helplistFiltered,function(r){return t(K,{key:r.commandLow,staticClass:"px-0",attrs:{"two-line":""}},[t(Gt,{staticClass:"px-0"},[t(rt,{staticClass:"blue--text font-weight-bold cursor-pointer",on:{click:function(i){e.$emit("onCommand",r.command),e.isOpen=!1}}},[e._v(" "+e._s(r.command)+" ")]),t(up,{staticClass:"text-wrap"},[e._v(" "+e._s(r.description)+" ")])],1)],1)}),1)],1)],1)],1)],1)],1)]},proxy:!0}]),model:{value:e.isOpen,callback:function(r){e.isOpen=r},expression:"isOpen"}})},vM=[];const Gf={};var _M=N(di,gM,vM,!1,bM,"06867a20",null,null);function bM(e){for(let s in Gf)this[s]=Gf[s]}const oc=function(){return _M.exports}();var yM=Object.defineProperty,CM=Object.getOwnPropertyDescriptor,Hp=(e,s,t,r)=>{for(var i=r>1?void 0:r?CM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&yM(s,t,i),i};let On=class extends j(V){constructor(){super(...arguments),this.mdiTrashCan=y0,this.mdiConsoleLine=ua,this.mdiCog=Us,this.mdiSend=h0,this.mdiChevronDoubleRight=Ub,this.gcode="",this.lastCommandNumber=null,this.items=[],this.cmdListSearch=null}get helplist(){var s;return(s=this.$store.state.printer.helplist)!=null?s:[]}get consoleDirection(){var s;return(s=this.$store.state.gui.console.direction)!=null?s:"table"}get consoleHeight(){var s;return(s=this.$store.state.gui.console.height)!=null?s:300}get events(){return this.$store.getters["server/getConsoleEvents"](this.consoleDirection==="table",250)}eventsChanged(){this.consoleDirection==="shell"&&this.autoscroll&&setTimeout(()=>{this.scrollToBottom()},50)}autoscrollChanged(s){s&&this.scrollToBottom()}clearConsole(){this.$store.dispatch("gui/console/clear")}get hideWaitTemperatures(){return this.$store.state.gui.console.hideWaitTemperatures}set hideWaitTemperatures(s){this.$store.dispatch("gui/saveSetting",{name:"console.hideWaitTemperatures",value:s})}get hideTlCommands(){return this.$store.state.gui.console.hideTlCommands}set hideTlCommands(s){this.$store.dispatch("gui/saveSetting",{name:"console.hideTlCommands",value:s})}get customFilters(){return this.$store.state.gui.console.consolefilters}get rows(){var s,t;return(t=(s=this.gcode)==null?void 0:s.split("\n").length)!=null?t:1}get lastCommands(){var s;return(s=this.$store.state.gui.gcodehistory.entries)!=null?s:[]}get autoscroll(){var s;return(s=this.$store.state.gui.console.autoscroll)!=null?s:!0}set autoscroll(s){this.$store.dispatch("gui/saveSetting",{name:"console.autoscroll",value:s})}commandClick(s){this.gcode=s,this.$nextTick(()=>{this.$refs.gcodeCommandField.focus()})}doSend(s){s.shiftKey?this.gcode+="\n":this.gcode!==""&&(this.$store.dispatch("printer/sendGcode",this.gcode),this.$store.dispatch("gui/gcodehistory/addToHistory",this.gcode),this.gcode="",this.lastCommandNumber=null,setTimeout(()=>{this.$refs.console.$el.scroll({top:0,left:0,behavior:"smooth"})},20))}onKeyUp(){this.lastCommandNumber===null&&this.lastCommands.length?(this.lastCommandNumber=this.lastCommands.length-1,this.gcode=this.lastCommands[this.lastCommandNumber]):this.lastCommandNumber&&this.lastCommandNumber>0&&(this.lastCommandNumber--,this.gcode=this.lastCommands[this.lastCommandNumber])}onKeyDown(){this.lastCommandNumber!==null&&this.lastCommandNumber-1?i.indexOf("\n",o)-1:Number.MAX_SAFE_INTEGER;this.rows>1&&(t=i.substr(o,l-o));let c=this.helplist.filter(u=>u.commandLow.startsWith(t.toLowerCase()));if((c==null?void 0:c.length)===1)this.rows>1?this.gcode=this.gcode.replace(t,c[0].command):this.gcode=c[0].command;else if((c==null?void 0:c.length)>1){let u=this.helplist.filter(d=>d.commandLow.startsWith(t.toLowerCase()));if(this.rows>1?this.gcode=this.gcode.replace(t,u.reduce((d,h)=>So(d,h.command),u[0].command)):this.gcode=u.reduce((d,h)=>So(d,h.command),u[0].command),u&&u.length){let d="";u.forEach(h=>d+=''+h.command+": "+h.description+"
"),this.$store.dispatch("server/addEvent",{message:d,type:"autocomplete"})}}}this.$refs.gcodeCommandField.focus()}toggleFilter(s){this.$store.dispatch("gui/updateConsoleFilter",s)}mounted(){this.consoleDirection==="shell"&&this.scrollToBottom()}scrollToBottom(){this.$nextTick(()=>{if(this.$refs.miniConsoleScroll){const s=this.$refs.miniConsoleScroll.osInstance();s==null||s.scroll({y:"100%"})}})}scrollToTop(){this.$nextTick(()=>{if(this.$refs.miniConsoleScroll){const s=this.$refs.miniConsoleScroll.osInstance();s==null||s.scroll({y:"0%"})}})}};Hp([me("events")],On.prototype,"eventsChanged",1);Hp([me("autoscroll")],On.prototype,"autoscrollChanged",1);On=Hp([O({components:{Panel:Z,ConsoleTable:nc,CommandHelpModal:oc}})],On);var $M=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.socketIsConnected&&e.klipperState!=="disconnected"?t(Z,{attrs:{icon:e.mdiConsoleLine,title:e.$t("Panels.MiniconsolePanel.Headline"),collapsible:!0,"card-class":"miniconsole-panel","hide-buttons-on-collapse":!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.clearConsole}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiTrashCan))])],1),t(oc,{attrs:{"in-toolbar":!0},on:{onCommand:function(r){e.gcode=r}}}),t($e,{attrs:{"offset-y":!0,"close-on-content-click":!1,title:e.$t("Panels.MiniconsolePanel.SetupConsole")},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}],null,!1,3210076863)},[t(Oe,[e.consoleDirection==="shell"?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.Autoscroll")},model:{value:e.autoscroll,callback:function(r){e.autoscroll=r},expression:"autoscroll"}})],1):e._e(),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.HideTemperatures")},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.HideTimelapse")},model:{value:e.hideTlCommands,callback:function(r){e.hideTlCommands=r},expression:"hideTlCommands"}})],1):e._e(),e._l(e.customFilters,function(r,i){return t(K,{key:i,staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.name},on:{change:function(n){return e.toggleFilter(r)}},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"filter.bool"}})],1)})],2)],1)]},proxy:!0}],null,!1,1546623836)},[t("div",{staticClass:"d-flex flex-column"},[t(q,{class:e.consoleDirection==="table"?"order-1":"order-2"},[t(Ai,{ref:"gcodeCommandField",staticClass:"gcode-command-field",attrs:{items:e.items,label:e.$t("Panels.MiniconsolePanel.SendCode"),solo:"",autocomplete:"off","no-resize":"","auto-grow":"",rows:e.rows,"hide-details":"",outlined:"",dense:"","prepend-icon":e.isTouchDevice?e.mdiChevronDoubleRight:"","append-icon":e.mdiSend},on:{keydown:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),r.stopPropagation(),e.doSend.apply(null,arguments))},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"tab",9,r.key,"Tab")?null:e.getAutocomplete.apply(null,arguments)}],keyup:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"up",38,r.key,["Up","ArrowUp"])?null:e.onKeyUp.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"down",40,r.key,["Down","ArrowDown"])?null:e.onKeyDown.apply(null,arguments)}],"click:prepend":e.getAutocomplete,"click:append":e.doSend},model:{value:e.gcode,callback:function(r){e.gcode=r},expression:"gcode"}})],1),t(q,{class:(e.consoleDirection==="table"?"order-2":"order-1")+" pa-0"},[t(S,[t(_,[t("overlay-scrollbars",{ref:"miniConsoleScroll",style:"height: "+e.consoleHeight+"px;",attrs:{options:{}}},[t(nc,{ref:"console",attrs:{events:e.events,"is-mini":!0},on:{"command-click":e.commandClick}}),t(E)],1)],1)],1)],1)],1)]):e._e()},xM=[];const zf={};var wM=N(On,$M,xM,!1,SM,"4b06e9de",null,null);function SM(e){for(let s in zf)this[s]=zf[s]}const PM=function(){return wM.exports}();var TM=Object.defineProperty,DM=Object.getOwnPropertyDescriptor,MM=(e,s,t,r)=>{for(var i=r>1?void 0:r?DM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&TM(s,t,i),i};let od=class extends j(V){constructor(){super(...arguments),this.mdiAlertCircle=Rb,this.mdiInformation=At}get existsPrinterConfig(){var s;return(s=this.$store.getters["printer/existPrinterConfig"])!=null?s:!1}get missingConfigs(){var s;return(s=this.$store.getters["printer/checkNecessaryConfig"])!=null?s:[]}get mainsailCfgExists(){var s;return(s=this.$store.getters["files/checkConfigFile"]("mainsail.cfg"))!=null?s:!1}};od=MM([O({components:{Panel:Z}})],od);var EM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperState==="ready"&&e.existsPrinterConfig&&e.missingConfigs.length?t(Z,{attrs:{icon:e.mdiAlertCircle,title:e.$t("Panels.MinSettingsPanel.MissingConfiguration"),collapsible:!0,"card-class":"min-settings-panel","toolbar-color":"orange darken-2"}},[t(q,[t(S,[t(_,[t("ul",{},e._l(e.missingConfigs,function(r){return t("li",{key:r,staticClass:"orange--text"},[t("code",[e._v(e._s(r))]),e._v(" "+e._s(e.$t("Panels.MinSettingsPanel.IsNotDefinedInConfig"))+" ")])}),0)])],1)],1),e.mainsailCfgExists?[t(E),t(q,[t(S,[t(_,[t("p",{staticClass:"orange--text mb-0"},[e._v(e._s(e.$t("Panels.MinSettingsPanel.IncludeMainsailCfg")))])])],1)],1),t(E,{staticClass:"mb-2"})]:e._e(),t(ne,{staticClass:"justify-center pb-3"},[t(g,{attrs:{small:"",href:"https://docs.mainsail.xyz/setup/configuration",target:"_blank"}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiInformation))]),e._v(" "+e._s(e.$t("Panels.MinSettingsPanel.MoreInformation"))+" ")],1)],1)],2):e._e()},OM=[];const Zf={};var LM=N(od,EM,OM,!1,kM,"05f4d966",null,null);function kM(e){for(let s in Zf)this[s]=Zf[s]}const jp=function(){return LM.exports}();var AM=Object.defineProperty,FM=Object.getOwnPropertyDescriptor,St=(e,s,t,r)=>{for(var i=r>1?void 0:r?FM(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&AM(s,t,i),i};let pt=class extends j(V){constructor(){super(...arguments),this.mdiFan=yp,this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOffOutline=b0,this.mdiLockOutline=Yl,this.mdiLockOpenVariantOutline=s0,this.mdiMinus=i0,this.mdiPlus=Dp,this.mdiLightbulbOutline=Sp,this.mdiLightbulbOnOutline=e0,this.convertName=gt,this.isLocked=!1,this.invalidChars=["e","E","+"],this.min=0,this.inputValue=0,this.sliderValue=0}get value(){return Math.round(this.target/this.max*100)/100}lockSlidersChanged(){this.isLocked=this.lockSliders&&this.isTouchDevice}startLockTimer(){let e=this.lockSlidersDelay;!this.isTouchDevice||!this.lockSliders||e<=0||(this.timeout=setTimeout(()=>this.isLocked=!0,e*1e3))}resetLockTimer(){clearTimeout(this.timeout)}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}changeSliderValue(){this.value!==this.sliderValue&&(this.sliderValuethis.value&&this.sliderValue0?Math.round((this.value-.01)*100)/100:0;this.value=0&&this.invalidChars.push("-"),this.invalidChars.includes(e.key)&&e.preventDefault()}get errors(){const e=[],s=this.inputValue/100;return this.inputValue.toString()===""&&e.push(this.$t("App.NumberInput.NoEmptyAllowedError")),s=this.off_below&&this.value>0&&e.push("icon-rotate"),e}get rpmClasses(){const e=[];return this.controllable?e.push(["mt-2"]):e.push(["mr-3","mt-1"]),this.rpm===0&&this.value>0&&e.push("red--text"),e}get ledChannelName(){return this.colorOrder==="R"?"RED":this.colorOrder==="G"?"GREEN":this.colorOrder==="B"?"BLUE":"WHITE"}submitInput(){if(this.errors.length>0)return;let e=this.inputValue/100;this.value===0&&e=this.off_below&&e0?i(v,{staticClass:"mr-2",attrs:{small:"","retain-focus-on-click":!0},on:{click:t.ledOff}},[t._v(" "+t._s(t.mdiLightbulbOnOutline)+" ")]):t.type==="led"?i(v,{staticClass:"mr-2",attrs:{small:"","retain-focus-on-click":!0},on:{click:t.ledOn}},[t._v(" "+t._s(t.mdiLightbulbOutline)+" ")]):t.type!=="output_pin"?i(v,{class:t.fanClasses,attrs:{small:""}},[t._v(t._s(t.mdiFan))]):t._e(),i("span",[t._v(t._s(t.convertName(t.name)))]),i(le),t.rpm!==null?i("small",{class:t.rpmClasses},[t._v(t._s(Math.round((e=t.rpm)!==null&&e!==void 0?e:0))+" RPM")]):t._e(),t.controllable?t._e():i("span",{staticClass:"font-weight-bold"},[t._v(" "+t._s(Math.round(parseFloat(t.value)*100))+" % ")]),t.controllable&&!t.pwm?i(v,{on:{click:t.switchOutputPin}},[t._v(" "+t._s(t.value?t.mdiToggleSwitch:t.mdiToggleSwitchOffOutline)+" ")]):t._e(),i("form",{on:{submit:function(n){return n.preventDefault(),t.submitInput.apply(null,arguments)}}},[t.controllable&&t.pwm?i(re,{staticClass:"_slider-input pt-1",attrs:{error:t.errors.length>0,suffix:"%",type:"number","hide-spin-buttons":"","hide-details":"",outlined:"",dense:""},on:{blur:function(n){t.inputValue=Math.round(parseFloat(t.sliderValue)*100)},focus:function(n){return n.target.select()},keydown:t.checkInvalidChars},model:{value:t.inputValue,callback:function(n){t.inputValue=n},expression:"inputValue"}}):t._e()],1)],1),t.controllable&&t.pwm?i("transition",{attrs:{name:"fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.errors.length>0,expression:"errors.length > 0"}],staticClass:"_error-msg d-flex justify-end"},[t._v(" "+t._s((s=t.errors[0])!==null&&s!==void 0?s:"")+" ")])]):t._e(),t.controllable&&t.pwm?i(q,{staticClass:"py-0 pb-2 d-flex align-center"},[t.lockSliders&&t.isTouchDevice&&t.pwm?i(g,{staticClass:"_lock-button",attrs:{plain:"",small:"",icon:""},on:{click:function(n){t.isLocked=!t.isLocked}}},[i(v,{attrs:{small:"",color:t.isLocked?"red":""}},[t._v(" "+t._s(t.isLocked?t.mdiLockOutline:t.mdiLockOpenVariantOutline)+" ")])],1):t._e(),i(Nl,{directives:[{name:"touch",rawName:"v-touch",value:{start:t.resetLockTimer},expression:"{ start: resetLockTimer }"}],attrs:{disabled:t.isLocked,min:0,max:1,step:.01,color:t.sliderValue0?"red":void 0,"hide-details":""},on:{change:t.changeSliderValue},scopedSlots:t._u([{key:"prepend",fn:function(){return[i(v,{attrs:{disabled:t.isLocked||t.sliderValue<=t.min},on:{click:t.decrement}},[t._v(" "+t._s(t.mdiMinus)+" ")])]},proxy:!0},{key:"append",fn:function(){return[i(v,{attrs:{disabled:t.isLocked||t.sliderValue>=1},on:{click:t.increment}},[t._v(t._s(t.mdiPlus))])]},proxy:!0}],null,!1,3774030646),model:{value:t.sliderValue,callback:function(n){t.sliderValue=n},expression:"sliderValue"}})],1):t._e()],1)],1)],1)},IM=[];const qf={};var HM=N(pt,RM,IM,!1,jM,"291ea388",null,null);function jM(e){for(let s in qf)this[s]=qf[s]}const ld=function(){return HM.exports}();/*! - * iro.js v5.5.2 - * 2016-2021 James Daniel - * Licensed under MPL 2.0 - * github.com/jaames/iro.js - */var Ue,Mo,j0,cd,N0,sr={},Np=[],NM=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function Qs(e,s){for(var t in s)e[t]=s[t];return e}function V0(e){var s=e.parentNode;s&&s.removeChild(e)}function Fe(e,s,t){var r,i,n,a,o=arguments;if(s=Qs({},s),arguments.length>3)for(t=[t],r=3;r-1,r=parseFloat(e);return t?s/100*r:r}function Dt(e){return parseInt(e,16)}function gr(e){return e.toString(16).padStart(2,"0")}var ei=function(){function e(t,r){this.$={h:0,s:0,v:0,a:1},t&&this.set(t),this.onChange=r,this.initialValue=Et({},this.$)}var s=e.prototype;return s.set=function(r){if(typeof r=="string")/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(r)?this.hexString=r:/^rgba?/.test(r)?this.rgbString=r:/^hsla?/.test(r)&&(this.hslString=r);else if(typeof r=="object")r instanceof e?this.hsva=r.hsva:"r"in r&&"g"in r&&"b"in r?this.rgb=r:"h"in r&&"s"in r&&"v"in r?this.hsv=r:"h"in r&&"s"in r&&"l"in r?this.hsl=r:"kelvin"in r&&(this.kelvin=r.kelvin);else throw new Error("Invalid color value")},s.setChannel=function(r,i,n){var a;this[r]=Et({},this[r],(a={},a[i]=n,a))},s.reset=function(){this.hsva=this.initialValue},s.clone=function(){return new e(this)},s.unbind=function(){this.onChange=void 0},e.hsvToRgb=function(r){var i=r.h/60,n=r.s/100,a=r.v/100,o=Xi(i),l=i-o,c=a*(1-n),u=a*(1-l*n),d=a*(1-(1-l)*n),h=o%6,p=[a,u,c,c,d,a][h],m=[d,a,a,u,c,c][h],f=[c,c,d,a,a,u][h];return{r:Ut(p*255,0,255),g:Ut(m*255,0,255),b:Ut(f*255,0,255)}},e.rgbToHsv=function(r){var i=r.r/255,n=r.g/255,a=r.b/255,o=Math.max(i,n,a),l=Math.min(i,n,a),c=o-l,u=0,d=o,h=o===0?0:c/o;switch(o){case l:u=0;break;case i:u=(n-a)/c+(na;){c=(l+o)*.5;var u=e.kelvinToRgb(c);u.b/u.r>=n/i?l=c:o=c}return c},ZM(e,[{key:"hsv",get:function(){var r=this.$;return{h:r.h,s:r.s,v:r.v}},set:function(r){var i=this.$;if(r=Et({},i,r),this.onChange){var n={h:!1,v:!1,s:!1,a:!1};for(var a in i)n[a]=r[a]!=i[a];this.$=r,(n.h||n.s||n.v||n.a)&&this.onChange(this,n)}else this.$=r}},{key:"hsva",get:function(){return Et({},this.$)},set:function(r){this.hsv=r}},{key:"hue",get:function(){return this.$.h},set:function(r){this.hsv={h:r}}},{key:"saturation",get:function(){return this.$.s},set:function(r){this.hsv={s:r}}},{key:"value",get:function(){return this.$.v},set:function(r){this.hsv={v:r}}},{key:"alpha",get:function(){return this.$.a},set:function(r){this.hsv=Et({},this.hsv,{a:r})}},{key:"kelvin",get:function(){return e.rgbToKelvin(this.rgb)},set:function(r){this.rgb=e.kelvinToRgb(r)}},{key:"red",get:function(){var r=this.rgb;return r.r},set:function(r){this.rgb=Et({},this.rgb,{r})}},{key:"green",get:function(){var r=this.rgb;return r.g},set:function(r){this.rgb=Et({},this.rgb,{g:r})}},{key:"blue",get:function(){var r=this.rgb;return r.b},set:function(r){this.rgb=Et({},this.rgb,{b:r})}},{key:"rgb",get:function(){var r=e.hsvToRgb(this.$),i=r.r,n=r.g,a=r.b;return{r:zr(i),g:zr(n),b:zr(a)}},set:function(r){this.hsv=Et({},e.rgbToHsv(r),{a:r.a===void 0?1:r.a})}},{key:"rgba",get:function(){return Et({},this.rgb,{a:this.alpha})},set:function(r){this.rgb=r}},{key:"hsl",get:function(){var r=e.hsvToHsl(this.$),i=r.h,n=r.s,a=r.l;return{h:zr(i),s:zr(n),l:zr(a)}},set:function(r){this.hsv=Et({},e.hslToHsv(r),{a:r.a===void 0?1:r.a})}},{key:"hsla",get:function(){return Et({},this.hsl,{a:this.alpha})},set:function(r){this.hsl=r}},{key:"rgbString",get:function(){var r=this.rgb;return"rgb("+r.r+", "+r.g+", "+r.b+")"},set:function(r){var i,n,a,o,l=1;if((i=YM.exec(r))?(n=Tt(i[1],255),a=Tt(i[2],255),o=Tt(i[3],255)):(i=JM.exec(r))&&(n=Tt(i[1],255),a=Tt(i[2],255),o=Tt(i[3],255),l=Tt(i[4],1)),i)this.rgb={r:n,g:a,b:o,a:l};else throw new Error("Invalid rgb string")}},{key:"rgbaString",get:function(){var r=this.rgba;return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},set:function(r){this.rgbString=r}},{key:"hexString",get:function(){var r=this.rgb;return"#"+gr(r.r)+gr(r.g)+gr(r.b)},set:function(r){var i,n,a,o,l=255;if((i=eE.exec(r))?(n=Dt(i[1])*17,a=Dt(i[2])*17,o=Dt(i[3])*17):(i=tE.exec(r))?(n=Dt(i[1])*17,a=Dt(i[2])*17,o=Dt(i[3])*17,l=Dt(i[4])*17):(i=sE.exec(r))?(n=Dt(i[1]),a=Dt(i[2]),o=Dt(i[3])):(i=rE.exec(r))&&(n=Dt(i[1]),a=Dt(i[2]),o=Dt(i[3]),l=Dt(i[4])),i)this.rgb={r:n,g:a,b:o,a:l/255};else throw new Error("Invalid hex string")}},{key:"hex8String",get:function(){var r=this.rgba;return"#"+gr(r.r)+gr(r.g)+gr(r.b)+gr(Xi(r.a*255))},set:function(r){this.hexString=r}},{key:"hslString",get:function(){var r=this.hsl;return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},set:function(r){var i,n,a,o,l=1;if((i=KM.exec(r))?(n=Tt(i[1],360),a=Tt(i[2],100),o=Tt(i[3],100)):(i=QM.exec(r))&&(n=Tt(i[1],360),a=Tt(i[2],100),o=Tt(i[3],100),l=Tt(i[4],1)),i)this.hsl={h:n,s:a,l:o,a:l};else throw new Error("Invalid hsl string")}},{key:"hslaString",get:function(){var r=this.hsla;return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},set:function(r){this.hslString=r}}]),e}(),aE={sliderShape:"bar",sliderType:"value",minTemperature:2200,maxTemperature:11e3};function Bp(e){var s,t=e.width,r=e.sliderSize,i=e.borderWidth,n=e.handleRadius,a=e.padding,o=e.sliderShape,l=e.layoutDirection==="horizontal";return r=(s=r)!=null?s:a*2+n*2,o==="circle"?{handleStart:e.padding+e.handleRadius,handleRange:t-a*2-n*2,width:t,height:t,cx:t/2,cy:t/2,radius:t/2-i/2}:{handleStart:r/2,handleRange:t-r,radius:r/2,x:0,y:0,width:l?r:t,height:l?t:r}}function oE(e,s){var t=s.hsva,r=s.rgb;switch(e.sliderType){case"red":return r.r/2.55;case"green":return r.g/2.55;case"blue":return r.b/2.55;case"alpha":return t.a*100;case"kelvin":var i=e.minTemperature,n=e.maxTemperature,a=n-i,o=(s.kelvin-i)/a*100;return Math.max(0,Math.min(o,100));case"hue":return t.h/=3.6;case"saturation":return t.s;case"value":default:return t.v}}function lE(e,s,t){var r=Bp(e),i=r.handleRange,n=r.handleStart,a;e.layoutDirection==="horizontal"?a=-1*t+i+n:a=s-n,a=Math.max(Math.min(a,i),0);var o=Math.round(100/i*a);switch(e.sliderType){case"kelvin":var l=e.minTemperature,c=e.maxTemperature,u=c-l;return l+u*(o/100);case"alpha":return o/100;case"hue":return o*3.6;case"red":case"blue":case"green":return o*2.55;default:return o}}function cE(e,s){var t=Bp(e),r=t.width,i=t.height,n=t.handleRange,a=t.handleStart,o=e.layoutDirection==="horizontal",l=oE(e,s),c=o?r/2:i/2,u=a+l/100*n;return o&&(u=-1*u+n+a*2),{x:o?c:u,y:o?u:c}}function uE(e,s){var t=s.hsv,r=s.rgb;switch(e.sliderType){case"red":return[[0,"rgb(0,"+r.g+","+r.b+")"],[100,"rgb(255,"+r.g+","+r.b+")"]];case"green":return[[0,"rgb("+r.r+",0,"+r.b+")"],[100,"rgb("+r.r+",255,"+r.b+")"]];case"blue":return[[0,"rgb("+r.r+","+r.g+",0)"],[100,"rgb("+r.r+","+r.g+",255)"]];case"alpha":return[[0,"rgba("+r.r+","+r.g+","+r.b+",0)"],[100,"rgb("+r.r+","+r.g+","+r.b+")"]];case"kelvin":for(var i=[],n=e.minTemperature,a=e.maxTemperature,o=8,l=a-n,c=n,u=0;c0?i.protocol+"//"+i.host+i.pathname+i.search+e:e}function Q0(e,s,t,r){for(var i=0;i0&&(l[a?"marginLeft":"marginTop"]=o),Fe(lc,null,r.children(this.uid,n,l))},s.prototype.handleEvent=function(r){var i=this,n=this.props.onInput,a=this.base.getBoundingClientRect();r.preventDefault();var o=r.touches?r.changedTouches[0]:r,l=o.clientX-a.left,c=o.clientY-a.top;switch(r.type){case"mousedown":case"touchstart":var u=n(l,c,0);u!==!1&&tg.forEach(function(d){document.addEventListener(d,i,{passive:!1})});break;case"mousemove":case"touchmove":n(l,c,1);break;case"mouseup":case"touchend":n(l,c,2),tg.forEach(function(d){document.removeEventListener(d,i,{passive:!1})});break}},s}(ii);function Fr(e){var s=e.r,t=e.url,r=s,i=s;return Fe("svg",{className:"IroHandle IroHandle--"+e.index+" "+(e.isActive?"IroHandle--isActive":""),style:{"-webkit-tap-highlight-color":"rgba(0, 0, 0, 0);",transform:"translate("+Ct(e.x)+", "+Ct(e.y)+")",willChange:"transform",top:Ct(-s),left:Ct(-s),width:Ct(s*2),height:Ct(s*2),position:"absolute",overflow:"visible"}},t&&Fe("use",Object.assign({xlinkHref:gE(t)},e.props)),!t&&Fe("circle",{cx:r,cy:i,r:s,fill:"none","stroke-width":2,stroke:"#000"}),!t&&Fe("circle",{cx:r,cy:i,r:s-2,fill:e.fill,"stroke-width":2,stroke:"#fff"}))}Fr.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}};function Oo(e){var s=e.activeIndex,t=s!==void 0&&s0?t.colors:[t.color];i.forEach(function(n){return r.addColor(n)}),this.setActiveColor(0),this.state=Object.assign({},t,{color:this.color,colors:this.colors,layout:t.layout})}return e&&(s.__proto__=e),s.prototype=Object.create(e&&e.prototype),s.prototype.constructor=s,s.prototype.addColor=function(r,i){i===void 0&&(i=this.colors.length);var n=new ei(r,this.onColorChange.bind(this));this.colors.splice(i,0,n),this.colors.forEach(function(a,o){return a.index=o}),this.state&&this.setState({colors:this.colors}),this.deferredEmit("color:init",n)},s.prototype.removeColor=function(r){var i=this.colors.splice(r,1)[0];i.unbind(),this.colors.forEach(function(n,a){return n.index=a}),this.state&&this.setState({colors:this.colors}),i.index===this.color.index&&this.setActiveColor(0),this.emit("color:remove",i)},s.prototype.setActiveColor=function(r){this.color=this.colors[r],this.state&&this.setState({color:this.color}),this.emit("color:setActive",this.color)},s.prototype.setColors=function(r,i){var n=this;i===void 0&&(i=0),this.colors.forEach(function(a){return a.unbind()}),this.colors=[],r.forEach(function(a){return n.addColor(a)}),this.setActiveColor(i),this.emit("color:setAll",this.colors)},s.prototype.on=function(r,i){var n=this,a=this.events;(Array.isArray(r)?r:[r]).forEach(function(o){(a[o]||(a[o]=[])).push(i),n.deferredEvents[o]&&(n.deferredEvents[o].forEach(function(l){i.apply(null,l)}),n.deferredEvents[o]=[])})},s.prototype.off=function(r,i){var n=this;(Array.isArray(r)?r:[r]).forEach(function(a){var o=n.events[a];o&&o.splice(o.indexOf(i),1)})},s.prototype.emit=function(r){for(var i=this,n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];var o=this.activeEvents,l=o.hasOwnProperty(r)?o[r]:!1;if(!l){o[r]=!0;var c=this.events[r]||[];c.forEach(function(u){return u.apply(i,n)}),o[r]=!1}},s.prototype.deferredEmit=function(r){for(var i,n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];var o=this.deferredEvents;(i=this).emit.apply(i,[r].concat(n)),(o[r]||(o[r]=[])).push(n)},s.prototype.setOptions=function(r){this.setState(r)},s.prototype.resize=function(r){this.setOptions({width:r})},s.prototype.reset=function(){this.colors.forEach(function(r){return r.reset()}),this.setState({colors:this.colors})},s.prototype.onMount=function(r){this.el=r,this.deferredEmit("mount",this)},s.prototype.onColorChange=function(r,i){this.setState({color:this.color}),this.inputActive&&(this.inputActive=!1,this.emit("input:change",r,i)),this.emit("color:change",r,i)},s.prototype.emitInputEvent=function(r,i){r===0?this.emit("input:start",this.color,i):r===1?this.emit("input:move",this.color,i):r===2&&this.emit("input:end",this.color,i)},s.prototype.render=function(r,i){var n=this,a=i.layout;if(!Array.isArray(a)){switch(a){default:a=[{component:ey},{component:Oo}]}i.transparency&&a.push({component:Oo,options:{sliderType:"alpha"}})}return Fe("div",{class:"IroColorPicker",id:i.id,style:{display:i.display}},a.map(function(o,l){var c=o.component,u=o.options;return Fe(c,Object.assign({},i,u,{ref:void 0,onInput:n.emitInputEvent.bind(n),parent:n,index:l}))}))},s}(ii);ty.defaultProps=Object.assign({},vE,{colors:[],display:"block",id:null,layout:"default",margin:null});var $E=CE(ty),hd;(function(e){e.version="5.5.2",e.Color=ei,e.ColorPicker=$E,function(s){s.h=Fe,s.ComponentBase=dc,s.Handle=Fr,s.Slider=Oo,s.Wheel=ey,s.Box=_E}(e.ui||(e.ui={}))})(hd||(hd={}));var jt=hd,xE=Object.defineProperty,wE=Object.getOwnPropertyDescriptor,ga=(e,s,t,r)=>{for(var i=r>1?void 0:r?wE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&xE(s,t,i),i};let Rr=class extends j(V){constructor(){super(...arguments),this.colorPicker=null}colorChanged(e){this.colorPicker&&this.colorPicker.color.rgbString!==e&&(this.colorPicker.color.rgbString=e)}get internalOptions(){return{...this.options,color:this.color,borderWidth:2,sliderSize:16}}emitColorChange(e){this.$emit("change",e),this.$emit("update:color",e)}onColorChange(e){this.emitColorChange(e)}mounted(){this.colorPicker=jt.ColorPicker(this.picker,this.internalOptions),this.colorPicker.on("color:change",this.onColorChange)}beforeDestroy(){var e;(e=this.colorPicker)==null||e.off("color:change",this.onColorChange)}};ga([Eb("picker")],Rr.prototype,"picker",2);ga([k({type:[Object,String],default:"#ffffff"})],Rr.prototype,"color",2);ga([k({type:Object,default:()=>({})})],Rr.prototype,"options",2);ga([me("color",{deep:!0})],Rr.prototype,"colorChanged",1);Rr=ga([O],Rr);var SE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t("div",{ref:"picker"})])},PE=[];const sg={};var TE=N(Rr,SE,PE,!1,DE,null,null,null);function DE(e){for(let s in sg)this[s]=sg[s]}const Ln=function(){return TE.exports}();var ME=Object.defineProperty,EE=Object.getOwnPropertyDescriptor,Nr=(e,s,t,r)=>{for(var i=r>1?void 0:r?EE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ME(s,t,i),i};let Hs=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiLightbulbOutline=Sp,this.mdiLightbulbOnOutline=e0,this.boolDialog=!1,this.inputValue=0}get name(){return this.group?gt(this.group.name):gt(this.object.name)}get colorPickerOptions(){let s={width:200,margin:15,layout:[]};return this.existRed&&(s==null||s.layout.push({component:jt.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(s==null||s.layout.push({component:jt.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(s==null||s.layout.push({component:jt.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(s.layout=[{component:jt.ui.Wheel},{component:jt.ui.Slider,options:{sliderType:"value"}}]),s}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:jt.ui.Slider,options:{sliderType:"alpha"}}]}}get optionsColors(){let s=[];return this.presets.forEach(t=>{s.push("rgb(".concat(t.red,"%, ").concat(t.green,"%, ").concat(t.blue,"%)"))}),s}get current(){var r,i;const s={red:0,green:0,blue:0,white:null};if(this.existWhite&&(s.white=0),this.object.colorData.length===0)return s;const t=this.object.colorData[((i=(r=this.group)==null?void 0:r.start)!=null?i:1)-1];return s.red=t[0]*255,s.green=t[1]*255,s.blue=t[2]*255,this.object.colorOrder.indexOf("W")!==-1&&(s.white=t[3]*255),s}get isOn(){var s,t,r,i,n;return((s=this.current.red)!=null?s:0)+((r=(t=this.current)==null?void 0:t.green)!=null?r:0)+((i=this.current.blue)!=null?i:0)+((n=this.current.white)!=null?n:0)>0}get existRed(){return this.object.colorOrder.indexOf("R")!==-1}get existGreen(){return this.object.colorOrder.indexOf("G")!==-1}get existBlue(){return this.object.colorOrder.indexOf("B")!==-1}get existWhite(){return this.object.colorOrder.indexOf("W")!==-1}get currentStateStyle(){let s=this.colorRGB;return this.current.white!==null&&this.current.red==0&&this.current.green==0&&this.current.blue==0&&(s="rgb(".concat(this.current.white*255,", ").concat(this.current.white*255,", ").concat(this.current.white*255,")")),{"background-color":s}}get colorRGB(){var s,t,r;return"rgb(".concat(Math.round((s=this.current.red)!=null?s:0),", ").concat(Math.round((t=this.current.green)!=null?t:0),", ").concat(Math.round((r=this.current.blue)!=null?r:0),")")}get colorRGBW(){var s;return"rgba(255, 255, 255, ".concat(((s=this.current.white)!=null?s:0)/255,")")}get redInt(){var s;return Math.round((s=this.current.red)!=null?s:0)}get greenInt(){var s;return Math.round((s=this.current.green)!=null?s:0)}get blueInt(){var s;return Math.round((s=this.current.blue)!=null?s:0)}get whiteInt(){var s;return Math.round((s=this.current.white)!=null?s:0)}get groups(){var s;return this.root?(s=this.$store.getters["gui/miscellaneous/getEntryLightgroups"]({type:this.object.type,name:this.object.name}))!=null?s:[]:[]}get presets(){var s;return(s=this.$store.getters["gui/miscellaneous/getEntryPresets"]({type:this.object.type,name:this.object.name}))!=null?s:[]}get containerClass(){let s=["px-0"];return s.push(this.root?"py-2":"pt-2 pb-0"),s}colorChanged(s){var o,l,c,u,d,h,p,m,f,b,C,w;if(Math.round((o=s.red)!=null?o:0)===Math.round((l=this.current.red)!=null?l:0)&&Math.round((c=s.green)!=null?c:0)===Math.round((u=this.current.green)!=null?u:0)&&Math.round((d=s.blue)!=null?d:0)===Math.round((h=this.current.blue)!=null?h:0)&&Math.round((p=s.white)!=null?p:0)===Math.round((m=this.current.white)!=null?m:0))return;const t=Math.round(((f=s.red)!=null?f:0)/255*1e4)/1e4,r=Math.round(((b=s.green)!=null?b:0)/255*1e4)/1e4,i=Math.round(((C=s.blue)!=null?C:0)/255*1e4)/1e4,n=Math.round(((w=s.white)!=null?w:0)/255*1e4)/1e4;let a='SET_LED LED="'.concat(this.object.name,'" RED=').concat(t," GREEN=").concat(r," BLUE=").concat(i);if(this.existWhite&&(a+=" WHITE=".concat(n)),a+=" SYNC=0",this.group){const M=a;for(let H=this.group.start;H<=this.group.end;H++){if(H===this.group.start){a+=" INDEX=".concat(H);continue}a+="\n".concat(M," INDEX=").concat(H)}}a+=" TRANSMIT=1",this.$store.dispatch("server/addEvent",{message:a,type:"command"}),this.$socket.emit("printer.gcode.script",{script:a})}onColorRGBChanged(s){const t={red:s.red,green:s.green,blue:s.blue,white:this.current.white};this.colorChanged(t)}onColorWhiteChanged(s){const t={red:this.current.red,green:this.current.green,blue:this.current.blue,white:this.current.white};t.white=s.alpha*255,this.colorChanged(t)}onColorInput(s){const t={red:this.current.red,green:this.current.green,blue:this.current.blue,white:this.current.white};t[s.name]=s.value,this.colorChanged(t)}off(){const s={red:0,green:0,blue:0,white:0};this.colorChanged(s)}on(){const s={red:255,green:255,blue:255,white:255};this.colorChanged(s)}presetStyle(s){var t,r,i,n;return((t=s==null?void 0:s.red)!=null?t:0)+((r=s==null?void 0:s.green)!=null?r:0)+((i=s==null?void 0:s.blue)!=null?i:0)===0&&((n=s==null?void 0:s.white)!=null?n:0)>0?{backgroundColor:"rgb(".concat(s.white,"%, ").concat(s.white,"%, ").concat(s.white,"%)")}:{backgroundColor:"rgb(".concat(s.red,"%, ").concat(s.green,"%, ").concat(s.blue,"%)")}}usePreset(s){const t={...s};this.colorChanged(t)}};Nr([k({type:Object,required:!0})],Hs.prototype,"object",2);Nr([k({type:Boolean,default:!1})],Hs.prototype,"root",2);Nr([k(Object)],Hs.prototype,"group",2);Nr([Ze({time:500})],Hs.prototype,"onColorRGBChanged",1);Nr([Ze({time:500})],Hs.prototype,"onColorWhiteChanged",1);Nr([Ze({time:500})],Hs.prototype,"onColorInput",1);Hs=Nr([O({components:{ColorPicker:Ln,MiscellaneousLight:()=>he(()=>Promise.resolve().then(()=>FE),void 0)}})],Hs);var OE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ke,{class:e.containerClass},[t(S,[t(_,{staticClass:"pb-3"},[t(Js,{staticClass:"_light-subheader"},[(!e.root||e.groups.length===0)&&e.isOn?t(v,{attrs:{small:"",left:""},on:{click:e.off}},[e._v(" "+e._s(e.mdiLightbulbOnOutline)+" ")]):!e.root||e.groups.length===0?t(v,{attrs:{small:"",left:""},on:{click:e.on}},[e._v(" "+e._s(e.mdiLightbulbOutline)+" ")]):e._e(),t("span",[e._v(e._s(e.name))]),t(le),!e.root||e.groups.length===0?t("span",{staticClass:"_currentState",style:e.currentStateStyle,on:{click:function(r){e.boolDialog=!0}}}):e._e()],1)],1)],1),e._l(e.groups,function(r){return t("miscellaneous-light",{key:r.id,attrs:{object:e.object,group:r}})}),t(oe,{attrs:{persistent:"",width:400},model:{value:e.boolDialog,callback:function(r){e.boolDialog=r},expression:"boolDialog"}},[t(Z,{attrs:{title:e.name,icon:e.mdiLightbulbOutline,"card-class":"temperature-edit-heater-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.boolDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-6"},[e.presets.length?[t(S,[t(_,{staticClass:"light-presets-container pt-0 d-flex flex-wrap flex-row justify-center"},e._l(e.presets,function(r){return t(pe,{key:r.id,attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[t("div",e._g(e._b({style:e.presetStyle(r),on:{click:function(o){return e.usePreset(r)}}},"div",a,!1),n))]}}],null,!0)},[t("span",[e._v(e._s(r.name))])])}),1)],1),t(E,{staticClass:"my-3"})]:e._e(),t(S,[t(_,{staticClass:"text-center"},[t(Ln,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(Ln,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(_,[e.existRed?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Red"),param:"red",target:e.redInt,"default-value":Math.round(e.object.initialRed*255),min:0,max:255,dec:1,step:1,"output-error-msg":!0,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existGreen?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Green"),param:"green",target:e.greenInt,"default-value":Math.round(e.object.initialGreen*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existBlue?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Blue"),param:"blue",target:e.blueInt,"default-value":Math.round(e.object.initialBlue*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existWhite?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.White"),param:"white",target:e.whiteInt,"default-value":Math.round(e.object.initialWhite*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e()],1)],1)],2)],1)],1)],2)},LE=[];const rg={};var kE=N(Hs,OE,LE,!1,AE,"aca41388",null,null);function AE(e){for(let s in rg)this[s]=rg[s]}const zp=function(){return kE.exports}(),FE=Object.freeze(Object.defineProperty({__proto__:null,default:zp},Symbol.toStringTag,{value:"Module"}));var RE=Object.defineProperty,IE=Object.getOwnPropertyDescriptor,hc=(e,s,t,r)=>{for(var i=r>1?void 0:r?IE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&RE(s,t,i),i};let hi=class extends j(V){constructor(){super(...arguments),this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOffOutline=b0,this.mdiPrinter3dNozzleAlert=c0,this.convertName=gt}get statusColor(){if(this.enabled){if(this.filament_detected)return"success"}else return"gray";return"warning"}get statusText(){return this.filament_detected?this.$t("Panels.MiscellaneousPanel.RunoutSensor.Detected"):this.$t("Panels.MiscellaneousPanel.RunoutSensor.Empty")}changeSensor(){const e="SET_FILAMENT_SENSOR SENSOR="+this.name+" ENABLE="+(this.enabled?0:1);this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}};hc([k({type:String,required:!0})],hi.prototype,"name",2);hc([k({type:Boolean,required:!0})],hi.prototype,"enabled",2);hc([k({type:Boolean,required:!0})],hi.prototype,"filament_detected",2);hi=hc([O],hi);var HE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ke,{staticClass:"px-0 py-2"},[t(S,[t(_,{staticClass:"pb-3"},[t(Js,{staticClass:"_filamentRunout-subheader"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzleAlert))]),t("span",[e._v(e._s(e.convertName(e.name)))]),t(le),t("small",{class:"mr-3 "+e.statusColor+"--text"},[e._v(e._s(e.statusText))]),t(v,{on:{click:e.changeSensor}},[e._v(" "+e._s(e.enabled?e.mdiToggleSwitch:e.mdiToggleSwitchOffOutline)+" ")])],1)],1)],1)],1)},jE=[];const ig={};var NE=N(hi,HE,jE,!1,VE,"0d751882",null,null);function VE(e){for(let s in ig)this[s]=ig[s]}const sy=function(){return NE.exports}();var UE=Object.defineProperty,BE=Object.getOwnPropertyDescriptor,WE=(e,s,t,r)=>{for(var i=r>1?void 0:r?BE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&UE(s,t,i),i};let pd=class extends j(V){constructor(){super(...arguments),this.mdiDipSwitch=_p}get filamentSensors(){var s;return(s=this.$store.getters["printer/getFilamentSensors"])!=null?s:[]}get miscellaneous(){var s;return(s=this.$store.getters["printer/getMiscellaneous"])!=null?s:[]}get lights(){var s;return(s=this.$store.getters["printer/getLights"])!=null?s:[]}get showMiscellaneousPanel(){return this.klipperReadyForGui&&(this.miscellaneous.length||this.filamentSensors.length||this.lights.length)}};pd=WE([O({components:{Panel:Z,FilamentSensor:sy,MiscellaneousSlider:ld,MiscellaneousLight:zp}})],pd);var GE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showMiscellaneousPanel?t(Z,{attrs:{icon:e.mdiDipSwitch,title:e.$t("Panels.MiscellaneousPanel.Headline"),collapsible:!0,"card-class":"miscellaneous-panel"}},[e._l(e.miscellaneous,function(r,i){return t("div",{key:i},[i?t(E):e._e(),t(ld,{attrs:{name:r.name,type:r.type,target:r.power,rpm:r.rpm,controllable:r.controllable,pwm:r.pwm,off_below:r.off_below,max:r.max_power,multi:parseInt(r.scale)}})],1)}),e._l(e.lights,function(r,i){return t("div",{key:"light_"+r.name},[i||e.miscellaneous.length?t(E):e._e(),r.type==="led"&&r.colorOrder.length===1?t(ld,{attrs:{name:r.name,type:"led",rpm:null,controllable:!0,pwm:!0,target:r.singleChannelTarget,"color-order":r.colorOrder}}):t(zp,{attrs:{object:r,root:!0}})],1)}),e._l(e.filamentSensors,function(r,i){return t("div",{key:"sensor_"+i},[i||e.miscellaneous.length||e.lights.length?t(E):e._e(),t(sy,{attrs:{name:r.name,enabled:r.enabled,filament_detected:r.filament_detected}})],1)})],2):e._e()},zE=[];const ng={};var ZE=N(pd,GE,zE,!1,qE,null,null,null);function qE(e){for(let s in ng)this[s]=ng[s]}const XE=function(){return ZE.exports}();var YE=Object.defineProperty,JE=Object.getOwnPropertyDescriptor,Zp=(e,s,t,r)=>{for(var i=r>1?void 0:r?JE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&YE(s,t,i),i};let kn=class extends j(V){get color(){var s,t;const e=(t=(s=this.spool.filament)==null?void 0:s.color_hex)!=null?t:"000";return"#".concat(e)}get id(){let e=this.spool.id.toString();for(;e.length{for(var i=r>1?void 0:r?QE(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&KE(s,t,i),i};let Lo=class extends j(V){get styleCircle1(){return{fill:this.color}}get styleCircle2(){return{fill:"#bebebe"}}get styleCircle3(){return{fill:"#343434"}}clickSpool(){this.$emit("click-spool")}};ry([k({required:!1,default:"#ff0"})],Lo.prototype,"color",2);Lo=ry([O({})],Lo);var eO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("svg",{staticClass:"cursor-pointer",attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 487.04 487.04","xml:space":"preserve"},on:{click:e.clickSpool}},[t("g",[t("circle",{style:e.styleCircle1,attrs:{cx:"243.52",cy:"243.52",r:"232.97"}}),t("circle",{style:e.styleCircle2,attrs:{cx:"243.52",cy:"243.52",r:"112.5"}}),t("path",{style:e.styleCircle3,attrs:{d:"M0,243.52c0,134.42,109.1,243.52,243.52,243.52,134.42,0,243.52-109.1,243.52-243.52S377.95,0,243.52,0C109.1,0,0,109.1,0,243.52Zm115.73,181.78c-52.4-39.5-86.52-98.59-94.52-163.72v-.09c-.68-5.43,1-10.89,4.6-15,3.6-4.12,8.79-6.51,14.26-6.57l118.36-1.33c18.99-.21,36.63,9.83,46.12,26.29,9.5,16.45,9.38,36.74-.3,53.09l-60.29,101.76c-2.8,4.73-7.48,8.03-12.87,9.1-5.39,1.06-10.98-.22-15.36-3.52ZM450.22,238.8c5.49,.06,10.7,2.46,14.31,6.59,3.62,4.13,5.3,9.61,4.63,15.06-8.01,65.13-42.12,124.22-94.52,163.72l-.07,.05c-4.37,3.29-9.93,4.57-15.3,3.51-5.37-1.06-10.03-4.36-12.82-9.06l-60.33-101.84c-9.68-16.34-9.8-36.64-.3-53.09,9.5-16.45,27.13-26.5,46.12-26.29l118.27,1.33ZM338.12,40.02c5.04,2.14,8.92,6.32,10.69,11.49,1.77,5.18,1.24,10.86-1.44,15.63l-58.03,103.17c-9.31,16.56-26.83,26.8-45.83,26.8-19,0-36.51-10.25-45.83-26.8l-57.99-103.09c-2.69-4.79-3.22-10.49-1.45-15.69,1.77-5.2,5.68-9.4,10.73-11.54,60.41-25.63,128.64-25.63,189.05,0l.08,.04Z"}})])])},tO=[];const ag={};var sO=N(Lo,eO,tO,!1,rO,null,null,null);function rO(e){for(let s in ag)this[s]=ag[s]}const iy=function(){return sO.exports}();var iO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("tr",{staticClass:"cursor-pointer",on:{click:e.setSpoolRow}},[t("td",{staticClass:"pr-0 py-2",staticStyle:{width:"50px"}},[t(iy,{staticClass:"mr-3",staticStyle:{width:"50px",float:"left"},attrs:{color:e.color}})],1),t("td",{staticClass:"py-2",staticStyle:{"min-width":"300px"}},[t(K,{attrs:{"two-line":""}},[t(Gt,{staticClass:"no--padding"},[t("div",{staticClass:"text--disabled mb-1"},[e._v("#"+e._s(e.id)+" | "+e._s(e.vendor))]),t(rt,{staticClass:"mb-1"},[t("span",{staticClass:"text--filament"},[e._v(e._s(e.name))]),e.location?[t("br"),t("small",[e._v(e._s(e.$t("Panels.SpoolmanPanel.Location"))+": "+e._s(e.location))])]:e._e(),e.spool.comment?[t("br"),t("small",[e._v(e._s(e.spool.comment))])]:e._e()],2)],1)],1)],1),t("td",{staticClass:"text-center text-no-wrap"},[e._v(e._s(e.material))]),t("td",{staticClass:"text-right text-no-wrap"},[e._v(e._s(e.last_used))]),t("td",{staticClass:"text-right text-no-wrap"},[t("strong",[e._v(e._s(e.remaining_weight_format))]),t("small",{staticClass:"ml-1"},[e._v("/ "+e._s(e.total_weight_format))])])])},nO=[];const og={};var aO=N(kn,iO,nO,!1,oO,"6caf4e0e",null,null);function oO(e){for(let s in og)this[s]=og[s]}const ny=function(){return aO.exports}();var lO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,qp=(e,s,t,r)=>{for(var i=r>1?void 0:r?cO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&lO(s,t,i),i};let An=class extends j(V){constructor(){super(...arguments),this.mdiAdjust=Fb,this.mdiCloseThick=Ce,this.mdiDatabase=JS,this.mdiMagnify=Jl,this.mdiRefresh=Hi,this.search=""}get spools(){var e;return(e=this.$store.state.server.spoolman.spools)!=null?e:[]}get max_spool_id_digits(){return this.$store.state.server.spoolman.spools.reduce((s,t)=>Math.max(s,t.id),0).toString().length}get headers(){return[{text:" ",align:"start",sortable:!1},{text:this.$t("Panels.SpoolmanPanel.Filament"),align:"start",value:"filament.name",sortable:!1},{text:this.$t("Panels.SpoolmanPanel.Material"),align:"center",value:"filament.material"},{text:this.$t("Panels.SpoolmanPanel.LastUsed"),align:"end",value:"last_used"},{text:this.$t("Panels.SpoolmanPanel.Weight"),align:"end",value:"remaining_weight"}]}get spoolManagerUrl(){var e,s,t;return(t=(s=(e=this.$store.state.server.config.config)==null?void 0:e.spoolman)==null?void 0:s.server)!=null?t:null}openSpoolManager(){window.open(this.spoolManagerUrl,"_blank")}mounted(){this.refresh()}refresh(){this.$store.dispatch("server/spoolman/refreshSpools")}close(){this.$emit("close")}refreshSpools(){this.$store.dispatch("server/spoolman/refreshSpools")}customFilter(e,s,t){const r=s.toLowerCase().split(" "),i=[t.comment,t.filament.name,t.filament.vendor.name,t.filament.material,t.location];for(const n of r)if(!i.some(o=>o==null?void 0:o.toLowerCase().includes(n)))return!1;return!0}setSpool(e){this.$store.dispatch("server/spoolman/setActiveSpool",e.id),this.close()}onShowDialogChanged(e){e&&(this.search="")}};qp([k({required:!0})],An.prototype,"showDialog",2);qp([me("showDialog")],An.prototype,"onShowDialogChanged",1);An=qp([O({components:{SpoolmanChangeSpoolDialogRow:ny,Panel:Z}})],An);var uO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(oe,{attrs:{width:"800",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Panels.SpoolmanPanel.ChangeSpool"),icon:e.mdiAdjust,"card-class":"spoolman-change-spool-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(vt,[t(re,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Panels.SpoolmanPanel.Search"),outlined:"",dense:"","hide-details":""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(le),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Panels.SpoolmanPanel.Refresh"),loading:e.loadings.includes("refreshSpools")},on:{click:e.refreshSpools}},[t(v,[e._v(e._s(e.mdiRefresh))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Panels.SpoolmanPanel.OpenSpoolManager")},on:{click:e.openSpoolManager}},[t(v,[e._v(e._s(e.mdiDatabase))])],1)],1),t(q,{staticClass:"px-0 pb-0"},[t(Ns,{attrs:{headers:e.headers,items:e.spools,"item-key":"id",search:e.search,"sort-by":"last_used","sort-desc":!0,"custom-filter":e.customFilter},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoSpools")))])]},proxy:!0},{key:"no-results",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoResults")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item;return[t(ny,{key:i.id,attrs:{spool:i,max_id_digits:e.max_spool_id_digits},on:{"set-spool":e.setSpool}})]}}])})],1)],1)],1)],1)},dO=[];const lg={};var hO=N(An,uO,dO,!1,pO,null,null,null);function pO(e){for(let s in lg)this[s]=lg[s]}const pc=function(){return hO.exports}();var mO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,ay=(e,s,t,r)=>{for(var i=r>1?void 0:r?fO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&mO(s,t,i),i};let ko=class extends j(V){constructor(){super(...arguments),this.mdiEject=zb,this.mdiCloseThick=Ce}close(){this.$emit("close")}removeSpool(){this.$store.dispatch("server/spoolman/setActiveSpool",null),this.close()}};ay([k({required:!0})],ko.prototype,"showDialog",2);ko=ay([O({components:{Panel:Z}})],ko);var gO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{width:"400",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Panels.SpoolmanPanel.EjectSpool"),icon:e.mdiEject,"card-class":"spoolman-eject-spool-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",{staticClass:"body-2"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.EjectSpoolQuestion")))])])],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.close}},[e._v(e._s(e.$t("Panels.SpoolmanPanel.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.removeSpool}},[e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.EjectSpool"))+" ")])],1)],1)],1)},vO=[];const cg={};var _O=N(ko,gO,vO,!1,bO,null,null,null);function bO(e){for(let s in cg)this[s]=cg[s]}const Xp=function(){return _O.exports}();var yO=Object.defineProperty,CO=Object.getOwnPropertyDescriptor,oy=(e,s,t,r)=>{for(var i=r>1?void 0:r?CO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&yO(s,t,i),i};let Ao=class extends j(V){get listItemContentClass(){return this.small?"my-0":""}get overlineClass(){const e=["text-overline","mb-1"];return this.small&&e.push("line-height-auto"),e}get listItemTitleClass(){return this.small?["text-h6","mb-1"]:["text-h5","mb-1"]}get avatarSize(){return this.small?60:80}get active_spool(){var e;return(e=this.$store.state.server.spoolman.active_spool)!=null?e:null}get color(){var s,t;const e=(t=(s=this.active_spool)==null?void 0:s.filament.color_hex)!=null?t:null;return e===null?"#000":"#".concat(e)}get id(){var e,s;return(s=(e=this.active_spool)==null?void 0:e.id)!=null?s:"XX"}get vendor(){var e,s,t,r;return(r=(t=(s=(e=this.active_spool)==null?void 0:e.filament)==null?void 0:s.vendor)==null?void 0:t.name)!=null?r:"Unknown"}get name(){var e,s;return(s=(e=this.active_spool)==null?void 0:e.filament.name)!=null?s:"Unknown"}get materialOutput(){var s,t;const e=(t=(s=this.active_spool)==null?void 0:s.filament.material)!=null?t:null;return e===null?null:e}get weightOutput(){var i,n,a,o;let e=(n=(i=this.active_spool)==null?void 0:i.remaining_weight)!=null?n:null,s=(o=(a=this.active_spool)==null?void 0:a.filament.weight)!=null?o:null,t="g";if(e===null||s===null)return null;e=Math.round(e);let r=Math.floor(s/1e3);return s>=1e3?(r!==s/1e3&&(r=Math.round(s/100)/10),"".concat(e,"g / ").concat(r,"kg")):"".concat(e," / ").concat(s).concat(t)}get lengthOutput(){var s,t;let e=(t=(s=this.active_spool)==null?void 0:s.remaining_length)!=null?t:null;return e===null?null:(e=Math.round(e/1e3),"".concat(e,"m"))}get subtitle(){return[this.materialOutput,this.weightOutput,this.lengthOutput].filter(e=>e!==null).join(" | ")}clickSpool(){this.$emit("change-spool")}};oy([k({required:!1,default:!1})],Ao.prototype,"small",2);Ao=oy([O({components:{Panel:Z,SpoolmanChangeSpoolDialog:pc,SpoolmanEjectSpoolDialog:Xp}})],Ao);var $O=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(K,{attrs:{"three-line":""}},[t(Gt,{class:e.listItemContentClass},[t("div",{class:e.overlineClass},[e._v("#"+e._s(e.id)+" | "+e._s(e.vendor))]),t(rt,{class:e.listItemTitleClass},[t("span",{staticClass:"cursor-pointer",on:{click:e.clickSpool}},[e._v(e._s(e.name))])]),t(up,[e._v(e._s(e.subtitle))])],1),t(qx,{attrs:{tile:"",size:e.avatarSize}},[t(iy,{attrs:{color:e.color},on:{"click-spool":e.clickSpool}})],1)],1)},xO=[];const ug={};var wO=N(Ao,$O,xO,!1,SO,"dfb564f4",null,null);function SO(e){for(let s in ug)this[s]=ug[s]}const mc=function(){return wO.exports}();var PO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,DO=(e,s,t,r)=>{for(var i=r>1?void 0:r?TO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&PO(s,t,i),i};let md=class extends j(V){constructor(){super(...arguments),this.mdiAdjust=Fb,this.mdiDotsVertical=Gl,this.mdiEject=zb,this.mdiOpenInNew=n0,this.mdiSwapVertical=NP,this.showChangeSpoolDialog=!1,this.showEjectSpoolDialog=!1}get health(){var s;return(s=this.$store.state.server.spoolman.health)!=null?s:""}get title(){const s=this.$t("Panels.SpoolmanPanel.Headline");return this.health===""||this.health==="healthy"?s:"".concat(s," (").concat(this.health,")")}get changeSpoolTooltip(){return this.active_spool===null?this.$t("Panels.SpoolmanPanel.SelectSpool"):this.$t("Panels.SpoolmanPanel.ChangeSpool")}get active_spool(){var s;return(s=this.$store.state.server.spoolman.active_spool)!=null?s:null}get spoolManagerUrl(){var s,t,r;return(r=(t=(s=this.$store.state.server.config.config)==null?void 0:s.spoolman)==null?void 0:t.server)!=null?r:null}openSpoolManager(){window.open(this.spoolManagerUrl,"_blank")}};md=DO([O({components:{SpoolmanPanelActiveSpool:mc,Panel:Z,SpoolmanChangeSpoolDialog:pc,SpoolmanEjectSpoolDialog:Xp}})],md);var MO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{attrs:{icon:e.mdiAdjust,title:e.title,"card-class":"spoolman-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:"",title:e.changeSpoolTooltip},on:{click:function(r){e.showChangeSpoolDialog=!0}}},[t(v,[e._v(e._s(e.mdiSwapVertical))])],1),t($e,{attrs:{"offset-y":!0,"close-on-content-click":!1,left:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDotsVertical))])],1)]}}])},[t(Oe,{attrs:{dense:""}},[t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){e.showEjectSpoolDialog=!0}}},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiEject))]),e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.EjectSpool"))+" ")],1)],1),t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.openSpoolManager}},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiOpenInNew))]),e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.OpenSpoolManager"))+" ")],1)],1)],1)],1)]},proxy:!0}])},[e.active_spool===null?t(q,[t(S,[t(_,{staticClass:"text-center"},[t("p",{staticClass:"text--disabled"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoActiveSpool")))]),t(g,{attrs:{small:"",color:"primary"},on:{click:function(r){e.showChangeSpoolDialog=!0}}},[e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.SelectSpool"))+" ")])],1)],1)],1):t(mc,{on:{"change-spool":function(r){e.showChangeSpoolDialog=!0}}})],1),t(pc,{attrs:{"show-dialog":e.showChangeSpoolDialog},on:{close:function(r){e.showChangeSpoolDialog=!1}}}),t(Xp,{attrs:{"show-dialog":e.showEjectSpoolDialog},on:{close:function(r){e.showEjectSpoolDialog=!1}}})],1)},EO=[];const dg={};var OO=N(md,MO,EO,!1,LO,null,null,null);function LO(e){for(let s in dg)this[s]=dg[s]}const kO=function(){return OO.exports}();var AO=Object.defineProperty,FO=Object.getOwnPropertyDescriptor,fc=(e,s,t,r)=>{for(var i=r>1?void 0:r?FO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&AO(s,t,i),i};let pi=class extends j(V){constructor(){super(...arguments),this.mdiChevronDown=Vs,this.mdiChevronUp=la,this.mdiCloseThick=Ce,this.mdiCounter=XS,this.mdiFile=dr,this.mdiPlay=Ii,this.mdiPlaylistRemove=PP,this.contextMenu={shown:!1,x:0,y:0,item:{}},this.dialogChangeCount={show:!1,count:1,item:{}},this.countInputRules=[e=>!!e||this.$t("JobQueue.InvalidCountEmpty"),e=>parseInt(e)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}get styleContentTdWidth(){return"width: ".concat(this.contentTdWidth,"px;")}get smallThumbnail(){return this.$store.getters["server/jobQueue/getSmallThumbnail"](this.item)}get bigThumbnail(){return this.$store.getters["server/jobQueue/getBigThumbnail"](this.item)}get description(){var s,t,r,i,n;let e="";return e+=this.$t("Panels.StatusPanel.Filament")+": ",(s=this.item.metadata)!=null&&s.filament_total||this.item.metadata.filament_weight_total?((t=this.item.metadata)!=null&&t.filament_total&&(e+=this.item.metadata.filament_total.toFixed()+" mm"),(r=this.item.metadata)!=null&&r.filament_total&&this.item.metadata.filament_weight_total&&(e+=" / "),(i=this.item.metadata)!=null&&i.filament_weight_total&&(e+=this.item.metadata.filament_weight_total.toFixed(2)+" g")):e+="--",e+=", "+this.$t("Panels.StatusPanel.PrintTime")+": ",(n=this.item.metadata)!=null&&n.estimated_time?e+=this.formatPrintTime(this.item.metadata.estimated_time):e+="--",e}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:zt}get bigThumbnailTooltipColor(){if(zt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}formatPrintTime(e){if(e){let s="";const t=Math.floor(e/86400);t&&(e%=3600*24,s+=t+"d");const r=Math.floor(e/3600);e%=3600,r&&(s+=" "+r+"h");const i=Math.floor(e/60);i&&(s+=" "+i+"m");const n=e%60;return n&&(s+=" "+n.toFixed(0)+"s"),s}return"--"}showContextMenu(e,s){this.contextMenu.shown||(e==null||e.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenu.y=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.contextMenu.item=s,this.$nextTick(()=>{this.contextMenu.shown=!0}))}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}removeFromJobqueue(e){var t;const s=[...(t=e.combinedIds)!=null?t:[]];s.push(e.job_id),this.$store.dispatch("server/jobQueue/deleteFromQueue",s)}openChangeCountDialog(e){var s,t;this.dialogChangeCount.show=!0,this.dialogChangeCount.count=((t=(s=e.combinedIds)==null?void 0:s.length)!=null?t:0)+1,this.dialogChangeCount.item=e}changeCountAction(){this.$store.dispatch("server/jobQueue/changeCount",{job_id:this.dialogChangeCount.item.job_id,count:this.dialogChangeCount.count}),this.dialogChangeCount.show=!1}};fc([k({type:Object,required:!0})],pi.prototype,"item",2);fc([k({type:Number,required:!0})],pi.prototype,"contentTdWidth",2);fc([k({type:Boolean,default:!1})],pi.prototype,"isFirst",2);pi=fc([O({components:{NumberInput:Ie}})],pi);var RO=function(){var e,s,t=this,r=t.$createElement,i=t._self._c||r;return i("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(n){return t.showContextMenu(n,t.item)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],staticClass:"cursor-pointer",on:{contextmenu:function(n){return t.showContextMenu(n,t.item)}}},[i("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[t.smallThumbnail&&t.bigThumbnail?[t.smallThumbnail&&t.bigThumbnail?i(pe,{attrs:{top:"","content-class":"tooltip__content-opacity1",color:t.bigThumbnailTooltipColor},scopedSlots:t._u([{key:"activator",fn:function(n){var a=n.on,o=n.attrs;return[i("vue-load-image",[i("img",t._g(t._b({attrs:{slot:"image",src:t.smallThumbnail,width:"32",height:"32"},slot:"image"},"img",o,!1),a)),i("div",{attrs:{slot:"preloader"},slot:"preloader"},[i(at,{attrs:{indeterminate:"",color:"primary"}})],1),i("div",{attrs:{slot:"error"},slot:"error"},[i(v,[t._v(t._s(t.mdiFile))])],1)])]}}],null,!1,309331284)},[i("span",[i("img",{attrs:{src:t.bigThumbnail,width:"250"}})])]):t._e()]:t.smallThumbnail?[i("vue-load-image",[i("img",{attrs:{slot:"image",src:t.smallThumbnail,width:"32",height:"32"},slot:"image"}),i("div",{attrs:{slot:"preloader"},slot:"preloader"},[i(at,{attrs:{indeterminate:"",color:"primary"}})],1),i("div",{attrs:{slot:"error"},slot:"error"},[i(v,[t._v(t._s(t.mdiFile))])],1)])]:[i(v,[t._v(t._s(t.mdiFile))])]],2),i("td",{staticClass:"pr-2"},[t.isFirst&&!t.printerIsPrinting?[i(g,{staticClass:"float-right minwidth-0 mt-1",attrs:{icon:"",color:"success"},on:{click:t.startJobqueue}},[i(v,[t._v(t._s(t.mdiPlay))])],1)]:t._e(),i("div",{staticClass:"d-block text-truncate",style:t.styleContentTdWidth},[t.item.combinedIds.length?i("strong",[t._v(t._s(t.item.combinedIds.length+1)+"x")]):t._e(),t._v(" "+t._s(t.item.filename)+" ")]),(e=t.item)!==null&&e!==void 0&&(s=e.metadata)!==null&&s!==void 0&&s.metadataPulled?i("small",[t._v(t._s(t.description))]):t._e()],2),i($e,{attrs:{"position-x":t.contextMenu.x,"position-y":t.contextMenu.y,absolute:"","offset-y":""},model:{value:t.contextMenu.shown,callback:function(n){t.$set(t.contextMenu,"shown",n)},expression:"contextMenu.shown"}},[i(Oe,[i(K,{on:{click:function(n){return t.openChangeCountDialog(t.contextMenu.item)}}},[i(v,{staticClass:"mr-1"},[t._v(t._s(t.mdiCounter))]),t._v(" "+t._s(t.$t("JobQueue.ChangeCount"))+" ")],1),i(K,{on:{click:function(n){return t.removeFromJobqueue(t.contextMenu.item)}}},[i(v,{staticClass:"mr-1"},[t._v(t._s(t.mdiPlaylistRemove))]),t._v(" "+t._s(t.$t("JobQueue.RemoveFromQueue"))+" ")],1)],1)],1),i(oe,{attrs:{"max-width":"400"},model:{value:t.dialogChangeCount.show,callback:function(n){t.$set(t.dialogChangeCount,"show",n)},expression:"dialogChangeCount.show"}},[i(Z,{attrs:{title:t.$t("JobQueue.ChangeCount").toString(),icon:t.mdiCounter,"card-class":"jobqueue-change-count-dialog","margin-bottom":!1},scopedSlots:t._u([{key:"buttons",fn:function(){return[i(g,{attrs:{icon:"",tile:""},on:{click:function(n){t.dialogChangeCount.show=!1}}},[i(v,[t._v(t._s(t.mdiCloseThick))])],1)]},proxy:!0}])},[i(q,[i(re,{ref:"inputFieldAddToQueueCount",attrs:{label:t.$t("JobQueue.Count"),required:"",rules:t.countInputRules,"hide-spin-buttons":"",type:"number"},on:{keyup:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.changeCountAction.apply(null,arguments)}},scopedSlots:t._u([{key:"append-outer",fn:function(){return[i("div",{staticClass:"_spin_button_group"},[i(g,{staticClass:"mt-n3",attrs:{icon:"",plain:"",small:""},on:{click:function(n){t.dialogChangeCount.count++}}},[i(v,[t._v(t._s(t.mdiChevronUp))])],1),i(g,{staticClass:"mb-n3",attrs:{disabled:t.dialogChangeCount.count<=1,icon:"",plain:"",small:""},on:{click:function(n){t.dialogChangeCount.count--}}},[i(v,[t._v(t._s(t.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:t.dialogChangeCount.count,callback:function(n){t.$set(t.dialogChangeCount,"count",n)},expression:"dialogChangeCount.count"}})],1),i(ne,[i(le),i(g,{attrs:{color:"",text:""},on:{click:function(n){t.dialogChangeCount.show=!1}}},[t._v(t._s(t.$t("JobQueue.Cancel")))]),i(g,{attrs:{color:"primary",text:""},on:{click:t.changeCountAction}},[t._v(t._s(t.$t("JobQueue.ChangeCount")))])],1)],1)],1)],1)},IO=[];const hg={};var HO=N(pi,RO,IO,!1,jO,"2c9673dc",null,null);function jO(e){for(let s in hg)this[s]=hg[s]}const gc=function(){return HO.exports}();var NO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,UO=(e,s,t,r)=>{for(var i=r>1?void 0:r?VO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&NO(s,t,i),i};let fd=class extends j(V){constructor(){super(...arguments),this.mdiFileMultiple=aP,this.contentTdWidth=100}get jobs(){var s;return(s=this.$store.getters["server/jobQueue/getJobs"])!=null?s:[]}get jobsTable(){return this.jobs.slice(0,5)}get jobsRest(){return this.jobs.slice(5)}get restJobsLength(){let s=0;return this.jobsRest.forEach(t=>{var r,i;s+=((i=(r=t.combinedIds)==null?void 0:r.length)!=null?i:0)+1}),s}get descriptionRestJobs(){let s=0,t=0,r=0;this.jobsRest.forEach(n=>{var o,l,c,u,d,h,p;const a=((l=(o=n.combinedIds)==null?void 0:o.length)!=null?l:0)+1;(c=n.metadata)!=null&&c.filament_total&&(s+=((u=n.metadata)==null?void 0:u.filament_total)*a),(d=n.metadata)!=null&&d.filament_weight_total&&(t+=((h=n.metadata)==null?void 0:h.filament_weight_total)*a),(p=n.metadata)!=null&&p.estimated_time&&(r+=n.metadata.estimated_time*a)});let i="";return i+=this.$t("Files.Filament")+": ",s||t?(s&&(i+=s.toFixed()+" mm"),s&&t&&(i+=" / "),t&&(i+=t.toFixed(2)+" g")):i+="--",i+=", "+this.$t("Files.PrintTime")+": ",r?i+=this.formatPrintTime(r):i+="--",i}formatPrintTime(s){if(s){let t="";const r=Math.floor(s/86400);r&&(s%=3600*24,t+=r+"d");const i=Math.floor(s/3600);s%=3600,i&&(t+=" "+i+"h");const n=Math.floor(s/60);n&&(t+=" "+n+"m");const a=s%60;return a&&(t+=" "+a.toFixed(0)+"s"),t}return"--"}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}mounted(){setTimeout(()=>{this.calcContentTdWidth()},200)}calcContentTdWidth(){var s,t;this.contentTdWidth=((t=(s=this.$refs.filesJobqueue)==null?void 0:s.$el)==null?void 0:t.clientWidth)-48-48-32}handleResize(){this.$nextTick(()=>{this.calcContentTdWidth()})}};fd=UO([O({components:{JobqueueEntry:gc}})],fd);var BO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{ref:"filesJobqueue",staticClass:"filesJobqueue",attrs:{flat:""}},[t(Ns,{staticClass:"dashboard-jobqueue-table",attrs:{items:e.jobsTable,"hide-default-footer":"","sort-by":"time_added","mobile-breakpoint":"0"},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyJobqueue")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item,n=r.index;return[t(gc,{key:i.job_id,attrs:{item:i,"is-first":n===0,"content-td-width":e.contentTdWidth}})]}},e.jobsRest.length?{key:"body.append",fn:function(){return[t("tr",[t("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[t(v,[e._v(e._s(e.mdiFileMultiple))])],1),t("td",{staticClass:"pr-2"},[e._v(" "+e._s(e.$tc("Panels.StatusPanel.JobqueueMoreFiles",e.restJobsLength,{count:e.restJobsLength}))+" "),t("br"),t("small",[e._v(e._s(e.descriptionRestJobs))])])])]},proxy:!0}:null],null,!0)}),t("resize-observer",{on:{notify:e.handleResize}})],1)},WO=[];const pg={};var GO=N(fd,BO,WO,!1,zO,"3d360c2d",null,null);function zO(e){for(let s in pg)this[s]=pg[s]}const ly=function(){return GO.exports}();var ZO=Object.defineProperty,qO=Object.getOwnPropertyDescriptor,Vr=(e,s,t,r)=>{for(var i=r>1?void 0:r?qO(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ZO(s,t,i),i};let js=class extends j(V){get firstColClasses(){const s=" d-flex justify-center";return this.dynamicSlotWidth?"col"+s:this.mobileSecondRow?"col-12 col-md-6"+s:"col-6"+s}get secondColClasses(){const s=" d-flex justify-end align-center settings-row-slot";return this.dynamicSlotWidth?"col-auto"+s:this.mobileSecondRow?"col-12 col-md-6 pt-0 pt-md-3"+s:"col-6"+s}};Vr([k({required:!1,default:!1})],js.prototype,"loading",2);Vr([k({required:!1,default:""})],js.prototype,"icon",2);Vr([k({required:!0})],js.prototype,"title",2);Vr([k({required:!1})],js.prototype,"subTitle",2);Vr([k({required:!1,default:!1})],js.prototype,"dynamicSlotWidth",2);Vr([k({required:!1,default:!1})],js.prototype,"mobileSecondRow",2);js=Vr([O],js);var XO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,{class:e.firstColClasses},[t(S,{staticClass:"d-flex flex-row"},[e.loading?t(_,{staticClass:"col-auto d-flex justify-center align-center pr-0"},[t(at,{attrs:{indeterminate:"",color:"primary",size:24}})],1):e.icon?t(_,{staticClass:"col-auto d-flex justify-center align-center pr-0"},[t(v,[e._v(e._s(e.icon))])],1):e._e(),t(_,{staticClass:"col d-flex justify-center flex-column"},[t("span",{staticClass:"settings-row-title"},[e._v(e._s(e.title))]),e.subTitle?t("span",{staticClass:"settings-row-subtitle"},[e._v(e._s(e.subTitle))]):e._e()])],1)],1),t(_,{class:e.secondColClasses},[e._t("default")],2)],1)},YO=[];const mg={};var JO=N(js,XO,YO,!1,KO,"ac415fda",null,null);function KO(e){for(let s in mg)this[s]=mg[s]}const U=function(){return JO.exports}();var QO=Object.defineProperty,e4=Object.getOwnPropertyDescriptor,vc=(e,s,t,r)=>{for(var i=r>1?void 0:r?e4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&QO(s,t,i),i};let mi=class extends j(V){constructor(){super(...arguments),this.mdiPrinter3d=ha}get timelapseEnabled(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.enabled)!=null?t:!1}set timelapseEnabled(e){this.$socket.emit("machine.timelapse.post_settings",{enabled:e},{action:"server/timelapse/initSettings"})}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:zt}get bigThumbnailStyle(){return zt.toLowerCase()===this.bigThumbnailBackground.toLowerCase()?{}:{backgroundColor:this.bigThumbnailBackground}}get active_spool(){var e;return(e=this.$store.state.server.spoolman.active_spool)!=null?e:null}get filamentVendor(){var e,s,t,r;return(r=(t=(s=(e=this.active_spool)==null?void 0:e.filament)==null?void 0:s.vendor)==null?void 0:t.name)!=null?r:"Unknown"}get filamentName(){var e,s;return(s=(e=this.active_spool)==null?void 0:e.filament.name)!=null?s:"Unknown"}get filament(){return"".concat(this.filamentVendor," - ").concat(this.filamentName)}get question(){var e,s,t,r;return this.active_spool?this.$t("Dialogs.StartPrint.DoYouWantToStartFilenameFilament",{filename:(s=(e=this.file)==null?void 0:e.filename)!=null?s:"unknown"}):this.$t("Dialogs.StartPrint.DoYouWantToStartFilename",{filename:(r=(t=this.file)==null?void 0:t.filename)!=null?r:"unknown"})}get maxThumbnailWidth(){var e,s;return(s=(e=this.file)==null?void 0:e.big_thumbnail_width)!=null?s:400}startPrint(e=""){e=(this.currentPath+"/"+e).substring(1),this.closeDialog(),this.$socket.emit("printer.print.start",{filename:e},{action:"switchToDashboard"})}closeDialog(){this.$emit("closeDialog")}};vc([k({required:!0,default:!1})],mi.prototype,"bool",2);vc([k({required:!0,default:""})],mi.prototype,"currentPath",2);vc([k({required:!0})],mi.prototype,"file",2);mi=vc([O({components:{SettingsRow:U}})],mi);var t4=Object.defineProperty,s4=Object.getOwnPropertyDescriptor,cy=(e,s,t,r)=>{for(var i=r>1?void 0:r?s4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&t4(s,t,i),i};let Fo=class extends j(V){constructor(){super(...arguments),this.showChangeSpoolDialog=!1}get activeSpoolId(){var s,t;let e=(t=(s=this.$store.state.server.spoolman)==null?void 0:s.active_spool_id)!=null?t:null;return e===0&&(e=null),e}get activeSpool(){var e,s;return(s=(e=this.$store.state.server.spoolman)==null?void 0:e.active_spool)!=null?s:null}get classSecondDivider(){const e=["mt-4"];return e.push(this.moonrakerComponents.includes("timelapse")?"mb-2":"mb-0"),e}get buttonText(){return this.activeSpoolId===null?this.$t("Panels.SpoolmanPanel.SelectSpool"):this.$t("Panels.SpoolmanPanel.ChangeSpool")}get alerts(){var i,n,a,o,l,c,u,d,h;let e=[];if(this.activeSpoolId===null)return e.push({text:this.$t("Panels.SpoolmanPanel.NoSpoolSelected"),color:"orange"}),e;let s=(i=this.file.filament_type)!=null?i:"";s.includes(";")&&(s=s.split(";")[0]),s!==""&&((o=(a=(n=this.activeSpool)==null?void 0:n.filament)==null?void 0:a.material)==null?void 0:o.toLowerCase())!==s.toLowerCase()&&e.push({text:this.$t("Panels.SpoolmanPanel.FilamentTypeMismatch",{fileType:s,spoolType:(c=(l=this.activeSpool)==null?void 0:l.filament)==null?void 0:c.material}),color:"warning"});const t=Math.round((u=this.file.filament_weight_total)!=null?u:0),r=Math.round((h=(d=this.activeSpool)==null?void 0:d.remaining_weight)!=null?h:0);return r{for(var i=r>1?void 0:r?p4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&h4(s,t,i),i};let gd=class extends j(V,Je){constructor(){super(...arguments),this.mdiChevronDown=Vs,this.mdiChevronUp=la,this.mdiFile=dr,this.mdiPlay=Ii,this.mdiPlaylistPlus=a0,this.mdiFire=Ri,this.mdiVideo3d=ec,this.mdiCloudDownload=Pn,this.mdiFileDocumentEditOutline=da,this.mdiRenameBox=Ql,this.mdiDelete=Ye,this.mdiCloseThick=Ce,this.deleteDialog=!1,this.showDialogBool=!1,this.dialogFile={isDirectory:!1,filename:"",modified:new Date,permissions:"",small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,count_printed:0,last_end_time:null,last_filament_used:null,last_print_duration:null,last_status:null,last_start_time:null,last_total_duration:null,preheat_gcode:null},this.currentPath="",this.contentTdWidth=100,this.contextMenu={shown:!1,touchTimer:void 0,x:0,y:0,item:{...this.dialogFile}},this.dialogRenameFile={show:!1,newName:"",item:{...this.dialogFile}},this.dialogAddBatchToQueue={show:!1,count:1,item:{...this.contextMenu.item}},this.countInputRules=[s=>!!s||this.$t("JobQueue.InvalidCountEmpty"),s=>parseInt(s)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}get gcodeFiles(){var r;let s=(r=this.$store.getters["files/getAllGcodes"])!=null?r:[];return s=s.slice().sort((i,n)=>n.modified.getTime()-i.modified.getTime()).slice(0,5),s.filter(i=>!i.metadataRequested&&!i.metadataPulled).forEach(i=>{this.$store.dispatch("files/requestMetadata",{filename:"gcodes/"+i.filename})}),s}get filename(){const s=this.contextMenu.item.filename.split("/");return s[s.length-1]}get styleContentTdWidth(){return"width: ".concat(this.contentTdWidth,"px;")}get bigThumbnailBackground(){var s;return(s=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?s:zt}get bigThumbnailTooltipColor(){if(zt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}showContextMenu(s,t){this.contextMenu.shown||(s==null||s.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenu.y=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.contextMenu.item=t,this.$nextTick(()=>{this.contextMenu.shown=!0}))}getDescription(s){let t="";return t+=this.$t("Panels.StatusPanel.Filament")+": ",s.filament_total||s.filament_weight_total?(s.filament_total&&(t+=s.filament_total.toFixed()+" mm"),s.filament_total&&s.filament_weight_total&&(t+=" / "),s.filament_weight_total&&(t+=s.filament_weight_total.toFixed(2)+" g")):t+="--",t+=", "+this.$t("Panels.StatusPanel.PrintTime")+": ",s.estimated_time?t+=this.formatPrintTime(s.estimated_time):t+="--",t}existMetadata(s){return s==null?void 0:s.metadataPulled}setFirst(s){s.length&&(s.forEach(t=>t.isFirst=!1),s[0].isFirst=!0)}formatPrintTime(s){if(s){let t="";const r=Math.floor(s/86400);r&&(s%=3600*24,t+=r+"d");const i=Math.floor(s/3600);s%=3600,i&&(t+=" "+i+"h");const n=Math.floor(s/60);n&&(t+=" "+n+"m");const a=s%60;return a&&(t+=" "+a.toFixed(0)+"s"),t}return"--"}getStatusIcon(s){return this.$store.getters["server/history/getPrintStatusIcon"](s)}getStatusColor(s){return this.$store.getters["server/history/getPrintStatusIconColor"](s)}showDialog(s){this.currentPath=s.filename.lastIndexOf("/")>=0?"/"+s.filename.slice(0,s.filename.lastIndexOf("/")):"",this.dialogFile={...s},s.filename.lastIndexOf("/")>=0&&(this.dialogFile.filename=s.filename.slice(s.filename.lastIndexOf("/")+1)),this.showDialogBool=!0}closeDialog(){this.showDialogBool=!1}addToQueue(s){this.$store.dispatch("server/jobQueue/addToQueue",[s.filename])}openAddBatchToQueueDialog(s){this.dialogAddBatchToQueue.show=!0,this.dialogAddBatchToQueue.count=1,this.dialogAddBatchToQueue.item=s}async addBatchToQueueAction(){let s=[this.currentPath,this.dialogAddBatchToQueue.item.filename].join("/");s.startsWith("/")&&(s=s.slice(1));const t=[];for(let r=0;r0?s.filename.slice(0,t+1):"",i=t>0?s.filename.slice(t+1):s.filename;this.$store.dispatch("editor/openFile",{root:"gcodes",path:r,filename:i,size:s.size,permissions:s.permissions})}renameFile(s){this.dialogRenameFile.item=s;const t=s.filename.lastIndexOf("/");this.dialogRenameFile.newName=t>0?s.filename.slice(t+1):s.filename,this.dialogRenameFile.show=!0,setTimeout(()=>{var r;(r=this.$refs.inputFieldRenameFile)==null||r.focus()},200)}renameFileAction(){this.dialogRenameFile.show=!1;const s=this.dialogRenameFile.item.filename.lastIndexOf("/"),t=s>0?this.dialogRenameFile.item.filename.slice(0,s+1):"";this.$socket.emit("server.files.move",{source:"gcodes/"+this.dialogRenameFile.item.filename,dest:"gcodes/"+t+this.dialogRenameFile.newName},{action:"files/getMove"})}removeFile(){this.$socket.emit("server.files.delete_file",{path:"gcodes/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),this.deleteDialog=!1}mounted(){setTimeout(()=>{this.calcContentTdWidth()},200)}calcContentTdWidth(){var s,t;this.contentTdWidth=((t=(s=this.$refs.filesGcodeCard)==null?void 0:s.$el)==null?void 0:t.clientWidth)-48-48-32}handleResize(){this.$nextTick(()=>{this.calcContentTdWidth()})}};gd=m4([O({components:{Panel:Z,StartPrintDialog:_c}})],gd);var f4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{ref:"filesGcodeCard",staticClass:"filesGcodeCard",attrs:{flat:""}},[t(Ns,{staticClass:"dashboard-gcodes-table",attrs:{items:e.gcodeFiles,"hide-default-footer":"","sort-by":"time_added","mobile-breakpoint":"0"},on:{"current-items":e.setFirst},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyGcodes")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item;return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(n){return e.showContextMenu(n,i)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:i.filename,staticClass:"cursor-pointer",on:{contextmenu:function(n){return e.showContextMenu(n,i)},click:function(n){return e.showDialog(i)}}},[t("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[i.small_thumbnail?[t(pe,{attrs:{top:"","content-class":"tooltip__content-opacity1",disabled:!i.big_thumbnail,color:e.bigThumbnailTooltipColor},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on,o=n.attrs;return[t("vue-load-image",{staticClass:"d-flex"},[t("img",e._g(e._b({attrs:{slot:"image",src:i.small_thumbnail,alt:i.filename,width:"32",height:"32"},slot:"image"},"img",o,!1),a)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!0)},[t("span",[t("img",{attrs:{src:i.big_thumbnail,alt:i.filename,width:"250"}})])])]:[t(v,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:"pr-2"},[t("div",{staticClass:"d-block text-truncate",style:e.styleContentTdWidth},[e._v(e._s(i.filename))]),e.existMetadata(i)?t("div",[t("small",[e._v(e._s(e.getDescription(i)))])]):e._e()]),t("td",[i.last_status?t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(n){var a=n.on,o=n.attrs;return[t("span",e._g(e._b({},"span",o,!1),a),[t(v,{attrs:{small:"",color:e.getStatusColor(i.last_status)}},[e._v(" "+e._s(e.getStatusIcon(i.last_status))+" ")])],1)]}}],null,!0)},[t("span",[e._v(e._s(i.last_status.replace(/_/g," ")))])]):e._e()],1)])]}}])}),t("resize-observer",{on:{notify:e.handleResize}}),t(_c,{attrs:{bool:e.showDialogBool,file:e.dialogFile,"current-path":e.currentPath},on:{closeDialog:e.closeDialog}}),t($e,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Oe,[t(K,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:function(r){return e.showDialog(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlay))]),e._v(" "+e._s(e.$t("Files.PrintStart"))+" ")],1),e.moonrakerComponents.includes("job_queue")?t(K,{on:{click:function(r){return e.addToQueue(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),e.moonrakerComponents.includes("job_queue")?t(K,{on:{click:function(r){return e.openAddBatchToQueueDialog(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),e.contextMenu.item.preheat_gcode!==null?t(K,{attrs:{disabled:["error","printing","paused"].includes(e.printer_state)},on:{click:function(r){return e.doSend(e.contextMenu.item.preheat_gcode)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiFire))]),e._v(" "+e._s(e.$t("Files.Preheat"))+" ")],1):e._e(),t(K,{on:{click:function(r){return e.view3D(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiVideo3d))]),e._v(" "+e._s(e.$t("Files.View3D"))+" ")],1),t(K,{on:{click:function(r){return e.downloadFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Files.Download"))+" ")],1),t(K,{on:{click:function(r){return e.editFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiFileDocumentEditOutline))]),e._v(" "+e._s(e.$t("Files.EditFile"))+" ")],1),t(K,{on:{click:function(r){return e.renameFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1),t(K,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1)],1)],1),t(oe,{attrs:{"max-width":400},model:{value:e.dialogRenameFile.show,callback:function(r){e.$set(e.dialogRenameFile,"show",r)},expression:"dialogRenameFile.show"}},[t(Z,{attrs:{title:e.$t("Files.RenameFile"),"card-class":"dashboard-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Files.Name"),required:""},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(r){e.$set(e.dialogRenameFile,"newName",r)},expression:"dialogRenameFile.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(e._s(e.$t("Files.Rename")))])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(Z,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.filename}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Files.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Files.Delete"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogAddBatchToQueue.show,callback:function(r){e.$set(e.dialogAddBatchToQueue,"show",r)},expression:"dialogAddBatchToQueue.show"}},[t(Z,{attrs:{title:e.$t("Files.AddToQueue"),"card-class":"gcode-files-add-to-queue-dialog",icon:e.mdiPlaylistPlus,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogAddBatchToQueue.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("Files.Count"),required:"","hide-spin-buttons":"",type:"number",rules:e.countInputRules},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.addBatchToQueueAction.apply(null,arguments)}},scopedSlots:e._u([{key:"append-outer",fn:function(){return[t("div",{staticClass:"_spin_button_group"},[t(g,{staticClass:"mt-n3",attrs:{icon:"",plain:"",small:""},on:{click:function(r){e.dialogAddBatchToQueue.count++}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.dialogAddBatchToQueue.count<=1,icon:"",plain:"",small:""},on:{click:function(r){e.dialogAddBatchToQueue.count--}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.dialogAddBatchToQueue.count,callback:function(r){e.$set(e.dialogAddBatchToQueue,"count",r)},expression:"dialogAddBatchToQueue.count"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogAddBatchToQueue.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.addBatchToQueueAction}},[e._v(e._s(e.$t("Files.AddToQueue")))])],1)],1)],1)],1)},g4=[];const vg={};var v4=N(gd,f4,g4,!1,_4,"556064d8",null,null);function _4(e){for(let s in vg)this[s]=vg[s]}const uy=function(){return v4.exports}();var b4=Object.defineProperty,y4=Object.getOwnPropertyDescriptor,C4=(e,s,t,r)=>{for(var i=r>1?void 0:r?y4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&b4(s,t,i),i};let vd=class extends j(V){constructor(){super(...arguments),this.maxFlow=0}get current_file(){var s;return(s=this.$store.state.printer.current_file)!=null?s:{}}get live_velocity(){var s,t,r;return(r=Math.abs((t=(s=this.$store.state.printer.motion_report)==null?void 0:s.live_velocity)==null?void 0:t.toFixed(0)))!=null?r:null}get live_extruder_velocity(){var t,r;const s=(r=(t=this.$store.state.printer.motion_report)==null?void 0:t.live_extruder_velocity)!=null?r:null;return s===null?null:s>0?s:0}get live_flow(){if(this.live_extruder_velocity===null)return null;const t=Math.pow(this.filament_diameter/2,2)*Math.PI*this.live_extruder_velocity;return t&&this.maxFlowr?r:i.toFixed(0)}get max_layers(){var s;return(s=this.$store.getters["printer/getPrintMaxLayers"])!=null?s:0}get current_layer(){var s;return(s=this.$store.getters["printer/getPrintCurrentLayer"])!=null?s:0}get estimated_time_file(){return this.$store.getters["printer/getEstimatedTimeFile"]}get estimated_time_filament(){return this.$store.getters["printer/getEstimatedTimeFilament"]}get estimated_time_slicer(){return this.$store.getters["printer/getEstimatedTimeSlicer"]}get estimated_time_avg(){return this.$store.getters["printer/getEstimatedTimeAvg"]}get eta(){return this.$store.getters["printer/getEstimatedTimeETAFormat"]}get filament_diameter(){var s,t,r,i;return(i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t.extruder)==null?void 0:r.filament_diameter)!=null?i:1.75}get print_time(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.print_duration)!=null?t:0}get print_time_total(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.total_duration)!=null?t:0}get filament_used(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.filament_used)!=null?t:0}get outputFilamentUsed(){return this.filament_used>=1e3?(this.filament_used/1e3).toFixed(2)+" m":this.filament_used.toFixed(2)+" mm"}formatDuration(s){let t=s<0?"-":"",r=Math.abs(s),i=Math.floor(r/3600);r%=3600;let n=("0"+Math.floor(r/60)).slice(-2),a=("0"+(r%60).toFixed(0)).slice(-2);return t+i+":"+n+":"+a}};vd=C4([O({components:{StatusPanelFilesJobqueue:ly,StatusPanelFilesGcodes:uy}})],vd);var $4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,{staticClass:"pa-0"},[t(ke,{staticClass:"py-0"},[t(S,{staticClass:"text-center py-5",attrs:{align:"center"}},[t(_,{staticClass:"col-3 pa-0"},[e.live_velocity!==null?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Speed")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.live_velocity)+" mm/s")])])]}}],null,!1,1141285171)},[t("span",[e._v(e._s(e.$t("Panels.StatusPanel.Requested"))+": "+e._s(e.requested_speed+" mm/s"))])])]:[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Speed")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.requested_speed)+" mm/s")])]],2),t(_,{staticClass:"col-3 pa-0"},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Flow")))]),t("br"),t("span",{staticClass:"d-block text-center text-no-wrap"},[e._v(" "+e._s(e.live_flow+" mm³/s")+" ")])])]}}])},[t("span",[e._v(e._s(e.$t("Panels.StatusPanel.Max"))+": "+e._s(e.outputMaxFlow))])])],1),t(_,{staticClass:"col-3 pa-0"},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Filament")))]),t("br"),t("span",{staticClass:"d-block text-center text-no-wrap"},[e._v(" "+e._s(e.outputFilamentUsed)+" ")])])]}}])},["filament_total"in e.current_file?t("span",[e._v(" "+e._s((e.filament_used/1e3).toFixed(2))+" / "+e._s((e.current_file.filament_total/1e3).toFixed(2))+" m = "+e._s((100/e.current_file.filament_total*e.filament_used).toFixed(0))+" % ")]):e._e()])],1),t(_,{staticClass:"col-3 pa-0 text-center"},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({staticClass:"text-center"},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Layer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.current_layer)+" of "+e._s(e.max_layers))])])]}}])},["object_height"in e.current_file&&e.current_file.object_height>0?t("span",[e._v(" "+e._s(e.$t("Panels.StatusPanel.ObjectHeight"))+": "+e._s(e.current_file.object_height)+" mm ")]):e._e()])],1)],1)],1),t(E,{staticClass:"my-0"}),t(ke,{staticClass:"py-0"},[t(S,{staticClass:"text-center pt-5 pb-2 mb-0",attrs:{align:"center"}},[t(_,{staticClass:"col-3 pa-0"},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({staticClass:"text-center"},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Estimate")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.estimated_time_avg?e.formatDuration(e.estimated_time_avg):"--")+" ")])])]}}])},[t("div",{staticClass:"text-right"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.File"))+": "+e._s(e.estimated_time_file?e.formatDuration(e.estimated_time_file):"--")+" "),t("br"),e._v(" "+e._s(e.$t("Panels.StatusPanel.Filament"))+": "+e._s(e.estimated_time_filament?e.formatDuration(e.estimated_time_filament):"--")+" ")])])],1),t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Slicer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.estimated_time_slicer?e.formatDuration(e.estimated_time_slicer):"--")+" ")])]),t(_,{staticClass:"col-3 pa-0"},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({staticClass:"text-center"},"div",n,!1),i),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Total")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.print_time_total?e.formatDuration(e.print_time_total):"--")+" ")])])]}}])},[t("div",{staticClass:"text-right"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Print"))+": "+e._s(e.print_time?e.formatDuration(e.print_time):"--")+" "),t("br"),e._v(" "+e._s(e.$t("Panels.StatusPanel.Difference"))+": "+e._s(e.print_time&&e.print_time_total?e.formatDuration(e.print_time_total-e.print_time):"--")+" ")])])],1),t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.ETA")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.eta))])])],1)],1)],1)},x4=[];const _g={};var w4=N(vd,$4,x4,!1,S4,null,null,null);function S4(e){for(let s in _g)this[s]=_g[s]}const P4=function(){return w4.exports}();var T4=Object.defineProperty,D4=Object.getOwnPropertyDescriptor,M4=(e,s,t,r)=>{for(var i=r>1?void 0:r?D4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&T4(s,t,i),i};let _d=class extends j(V){get current_file(){var s;return(s=this.$store.state.printer.current_file)!=null?s:{}}get filament_used(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.filament_used)!=null?t:0}get outputFilamentUsed(){return this.filament_used>=1e3?(this.filament_used/1e3).toFixed(2)+" m":this.filament_used.toFixed(2)+" mm"}get print_time(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.print_duration)!=null?t:0}get print_time_total(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.total_duration)!=null?t:0}formatTime(s){let t=Math.floor(s/3600);s%=3600;let r=("0"+Math.floor(s/60)).slice(-2),i=("0"+(s%60).toFixed(0)).slice(-2);return t+":"+r+":"+i}};_d=M4([O({components:{}})],_d);var E4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,{staticClass:"pa-0"},[t(ke,{staticClass:"py-0"},[t(S,{staticClass:"text-center pt-5 pb-2 mb-0",attrs:{align:"center"}},[t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Filament")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.outputFilamentUsed)+" ")])]),t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Slicer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s("estimated_time"in e.current_file?e.formatTime(e.current_file.estimated_time):"--")+" ")])]),t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Print")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.print_time?e.formatTime(e.print_time):"--"))])]),t(_,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Total")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.print_time_total?e.formatTime(e.print_time_total):"--")+" ")])])],1)],1)],1)},O4=[];const bg={};var L4=N(_d,E4,O4,!1,k4,null,null,null);function k4(e){for(let s in bg)this[s]=bg[s]}const A4=function(){return L4.exports}();var F4=Object.defineProperty,R4=Object.getOwnPropertyDescriptor,I4=(e,s,t,r)=>{for(var i=r>1?void 0:r?R4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&F4(s,t,i),i};let bd=class extends j(V){};bd=I4([O({components:{StatusPanelPrintstatusPrinting:P4,StatusPanelPrintstatusComplete:A4}})],bd);var H4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[["printing","paused","error","cancelled"].includes(e.printer_state)?[t("status-panel-printstatus-printing")]:e._e(),["complete"].includes(e.printer_state)?[t("status-panel-printstatus-complete")]:e._e()],2)},j4=[];const yg={};var N4=N(bd,H4,j4,!1,V4,null,null,null);function V4(e){for(let s in yg)this[s]=yg[s]}const U4=function(){return N4.exports}();var B4=Object.defineProperty,W4=Object.getOwnPropertyDescriptor,dy=(e,s,t,r)=>{for(var i=r>1?void 0:r?W4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&B4(s,t,i),i};let Ro=class extends j(V){constructor(){super(...arguments),this.coordinationCrossColor="#888",this.stripesOffset=50}get printing_objects(){var e,s;return((s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.objects)!=null?s:[]).map(t=>{let r=0;if("polygon"in t)for(let i=0;ir.size-t.size)}get printing_objects_with_polygons(){return this.printing_objects.filter(e=>"polygon"in e)}get current_object(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.current_object)!=null?s:null}get excluded_objects(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.excluded_objects)!=null?s:[]}get viewBox(){return this.convertX(this.stepperXmin)+" "+this.convertY(this.stepperYmax)+" "+this.absoluteX+" "+this.absoluteY}get toolhead(){var e;return(e=this.$store.state.printer.toolhead)!=null?e:{}}get axis_minimum(){var e;return(e=this.toolhead.axis_minimum)!=null?e:[]}get axis_maximum(){var e;return(e=this.toolhead.axis_maximum)!=null?e:[]}get stepperXmin(){var e;return(e=this.axis_minimum[0])!=null?e:0}get stepperXmax(){var e;return(e=this.axis_maximum[0])!=null?e:200}get stepperYmin(){var e;return(e=this.axis_minimum[1])!=null?e:0}get stepperYmax(){var e;return(e=this.axis_maximum[1])!=null?e:200}get absoluteX(){return Math.abs(this.stepperXmin)+Math.abs(this.stepperXmax)}get absoluteY(){return Math.abs(this.stepperYmin)+Math.abs(this.stepperYmax)}get xStripes(){const e=[],s=Math.floor(this.stepperXmin/this.stripesOffset)*this.stripesOffset,t=Math.floor(this.stepperXmax/this.stripesOffset)*this.stripesOffset;for(let r=s;r<=t;r=r+this.stripesOffset)e.push(r);return e}get yStripes(){const e=[],s=Math.floor(this.stepperYmin/this.stripesOffset)*this.stripesOffset,t=Math.floor(this.stepperYmax/this.stripesOffset)*this.stripesOffset;for(let r=s;r<=t;r=r+this.stripesOffset)e.push(r);return e}get primaryColor(){var e,s;return(s=(e=this.$store.state.gui.theme)==null?void 0:e.primary)!=null?s:pp}convertX(e){return e}convertY(e){return e*-1}showObjectTooltip(e){this.$refs.tooltipObjectMap&&(this.$refs.tooltipObjectMap.innerHTML=e,this.$refs.tooltipObjectMap.style.display="block",window.addEventListener("mousemove",this.moveTooltip))}hideObjectTooltip(){this.$refs.tooltipObjectMap&&(this.$refs.tooltipObjectMap.style.display="none",window.removeEventListener("mousemove",this.moveTooltip))}moveTooltip(e){if(!this.$refs.tooltipObjectMap)return;const s=e.offsetY-this.$refs.tooltipObjectMap.clientHeight-15;this.$refs.tooltipObjectMap.style.left="".concat(e.offsetX-20,"px"),this.$refs.tooltipObjectMap.style.top="".concat(s,"px")}openExcludeObjectDialog(e){this.$emit("update:name",e),this.$emit("update:bool",!0)}};dy([k({required:!1,default:""})],Ro.prototype,"hoverName",2);Ro=dy([O],Ro);var G4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticStyle:{position:"relative"}},[t("div",{ref:"tooltipObjectMap",attrs:{id:"tooltipObjectMap"}}),t("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:e.viewBox,"xml:space":"preserve"}},[t("defs",[t("marker",{attrs:{id:"arrowhead",markerWidth:"5",markerHeight:"4",refX:"2",refY:"2",orient:"auto"}},[t("polygon",{attrs:{points:"0 0, 5 2, 0 4",fill:e.coordinationCrossColor}})])]),t("line",{attrs:{x1:e.convertX(0),y1:e.convertY(1),x2:e.convertX(e.stepperXmax/4),y2:e.convertY(1),stroke:e.coordinationCrossColor,"stroke-width":"2","marker-end":"url(#arrowhead)"}}),t("line",{attrs:{x1:e.convertX(1),y1:e.convertY(0),x2:e.convertX(1),y2:e.convertY(e.stepperYmax/4),stroke:e.coordinationCrossColor,"stroke-width":"2","marker-end":"url(#arrowhead)"}}),t("g",[e._l(e.xStripes,function(r){return t("line",{key:"xLines"+r,attrs:{x1:e.convertX(r),x2:e.convertX(r),y1:e.convertY(e.stepperYmin),y2:e.convertY(e.stepperYmax),stroke:e.coordinationCrossColor,"stroke-opacity":.25,"stroke-width":"1"}})}),e._l(e.yStripes,function(r){return t("line",{key:"yLines"+r,attrs:{x1:e.convertX(e.stepperXmin),x2:e.convertX(e.stepperXmax),y1:e.convertY(r),y2:e.convertY(r),stroke:e.coordinationCrossColor,"stroke-opacity":.25,"stroke-width":"1"}})})],2),e._l(e.printing_objects_with_polygons,function(r,i){return t("g",{key:i},[t("polygon",{staticStyle:{cursor:"pointer"},attrs:{points:r.polygon.map(function(n){return e.convertX(n[0])+","+e.convertY(n[1])}).join(" "),stroke:e.current_object===r.name?e.primaryColor:"#666","stroke-width":"2","fill-rule":"evenodd",fill:e.hoverName===r.name?e.primaryColor:e.excluded_objects.includes(r.name)?"#6668":"#bbb"},on:{mouseover:function(n){return e.showObjectTooltip(r.name)},mouseout:e.hideObjectTooltip,click:function(n){return e.openExcludeObjectDialog(r.name)}}})])})],2)])},z4=[];const Cg={};var Z4=N(Ro,G4,z4,!1,q4,"71825b43",null,null);function q4(e){for(let s in Cg)this[s]=Cg[s]}const hy=function(){return Z4.exports}();var X4=Object.defineProperty,Y4=Object.getOwnPropertyDescriptor,py=(e,s,t,r)=>{for(var i=r>1?void 0:r?Y4(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&X4(s,t,i),i};let Io=class extends j(V){constructor(){super(...arguments),this.mdiCloseCircle=fo}get printing_objects(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.objects)!=null?s:[]}get current_object(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.current_object)!=null?s:null}get excluded_objects(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.excluded_objects)!=null?s:[]}openExcludeObjectDialog(e){this.$emit("update:name",e),this.$emit("update:bool",!0)}mouseOverObject(e){this.$emit("update:hoverName",e)}};py([k({required:!1,default:""})],Io.prototype,"hoverName",2);Io=py([O],Io);var J4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e._l(e.printing_objects,function(r){return[t(S,{key:"div_"+r.name,staticClass:"py-3 d-flex",on:{click:function(i){return e.mouseOverObject(r.name)},mouseover:function(i){return e.mouseOverObject(r.name)},mouseleave:function(i){return e.mouseOverObject("")}}},[t(_,{class:"py-2 subtitle-2 text-truncate "+(e.hoverName===r.name?"text--white":"text--disabled")},[e._v(" "+e._s(r.name)+" ")]),t(_,{staticClass:"col-auto py-2"},[e.excluded_objects.includes(r.name)?t(ns,{staticClass:"text--disabled",attrs:{pill:"",small:""}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.Excluded"))+" ")]):t(v,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:function(i){return e.openExcludeObjectDialog(r.name)}}},[e._v(" "+e._s(e.mdiCloseCircle)+" ")])],1)],1),t(E,{key:"divider_"+r.name})]})],2)},K4=[];const $g={};var Q4=N(Io,J4,K4,!1,e6,null,null,null);function e6(e){for(let s in $g)this[s]=$g[s]}const my=function(){return Q4.exports}();var t6=Object.defineProperty,s6=Object.getOwnPropertyDescriptor,bc=(e,s,t,r)=>{for(var i=r>1?void 0:r?s6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&t6(s,t,i),i};let fi=class extends j(V){constructor(){super(...arguments),this.hoverName="",this.mdiSelectionRemove=go,this.mdiCloseThick=Ce}hideDialog(){this.$emit("update:showDialog",!1)}get passName(){return this.excludeObjectDialogName}set passName(s){this.$emit("update:name",s)}updateExcludeObjectDialogBool(s){this.$emit("update:bool",s)}updateExcludeObjectDialogName(s){this.$emit("update:name",s)}updateHoverObjectDialogName(s){this.hoverName=s}};bc([k({required:!0})],fi.prototype,"showDialog",2);bc([k({required:!0})],fi.prototype,"excludeObjectDialogBool",2);bc([k({required:!0})],fi.prototype,"excludeObjectDialogName",2);fi=bc([O({components:{Panel:Z,StatusPanelExcludeObjectDialogList:my,StatusPanelExcludeObjectDialogMap:hy}})],fi);var r6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(oe,{attrs:{width:"900",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),icon:e.mdiSelectionRemove,"card-class":"exclude-object-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.hideDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(ke,[t(S,[t(_,{staticClass:"col-12 col-sm-6 pb-0 pb-sm-3"},[t("status-panel-exclude-object-dialog-map",{attrs:{"hover-name":e.hoverName},on:{"update:name":e.updateExcludeObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1),t(_,{staticClass:"col-12 col-sm-6 pt-0 pt-sm-3"},[t("status-panel-exclude-object-dialog-list",{attrs:{"exclude-object-dialog-name":e.excludeObjectDialogName,"exclude-object-dialog-bool":e.excludeObjectDialogBool,"hover-name":e.hoverName},on:{"update:excludeObjectDialogName":function(r){e.excludeObjectDialogName=r},"update:exclude-object-dialog-name":function(r){e.excludeObjectDialogName=r},"update:excludeObjectDialogBool":function(r){e.excludeObjectDialogBool=r},"update:exclude-object-dialog-bool":function(r){e.excludeObjectDialogBool=r},"update:name":e.updateExcludeObjectDialogName,"update:hoverName":e.updateHoverObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1)],1)],1)],1)],1)],1)},i6=[];const xg={};var n6=N(fi,r6,i6,!1,a6,null,null,null);function a6(e){for(let s in xg)this[s]=xg[s]}const o6=function(){return n6.exports}();var l6=Object.defineProperty,c6=Object.getOwnPropertyDescriptor,fy=(e,s,t,r)=>{for(var i=r>1?void 0:r?c6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&l6(s,t,i),i};let Ho=class extends j(V){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Bs,this.mdiSelectionRemove=go,this.boolShowExcludeObjectDialog=!1,this.excludeObjectDialogName=""}get showDialogPass(){return this.showDialog}set showDialogPass(s){this.$emit("update:showDialog",s)}get printing_objects(){var s,t;return(t=(s=this.$store.state.printer.exclude_object)==null?void 0:s.objects)!=null?t:[]}get current_object(){var s,t;return(t=(s=this.$store.state.printer.exclude_object)==null?void 0:s.current_object)!=null?t:null}get excluded_objects(){var s,t;return(t=(s=this.$store.state.printer.exclude_object)==null?void 0:s.excluded_objects)!=null?t:[]}updateExcludeObjectDialogName(s){this.excludeObjectDialogName=s}updateExcludeObjectDialogBool(s){this.boolShowExcludeObjectDialog=s}openCancelObjectDialog(s){this.excludeObjectDialogName=s,this.boolShowExcludeObjectDialog=!0}cancelObject(){this.$socket.emit("printer.gcode.script",{script:"EXCLUDE_OBJECT NAME="+this.excludeObjectDialogName}),this.boolShowExcludeObjectDialog=!1}};fy([k({required:!0})],Ho.prototype,"showDialog",2);Ho=fy([O({components:{StatusPanelExcludeObjectDialog:o6}})],Ho);var u6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return["printing","paused"].includes(e.printer_state)&&e.printing_objects.length?t("div",[t(ke,{staticClass:"py-0"},[t("div",{staticClass:"d-flex flex-row flex-nowrap justify-space-between"},[t("div",{staticClass:"py-2",staticStyle:{width:"calc(100% - 25px)"}},[t("span",{staticClass:"subtitle-2 d-block px-0 text--disabled text-truncate"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzle))]),e._v(" "+e._s(e.current_object!==null?e.current_object:"--")+" ")],1)]),t("div",{staticClass:"py-2 pl-0"},[e.current_object!==null?t(v,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:function(r){return e.openCancelObjectDialog(e.current_object)}}},[e._v(" "+e._s(e.mdiSelectionRemove)+" ")]):e._e()],1)])]),t(E,{staticClass:"mt-0 mb-0"}),t(oe,{attrs:{"max-width":"400"},model:{value:e.boolShowExcludeObjectDialog,callback:function(r){e.boolShowExcludeObjectDialog=r},expression:"boolShowExcludeObjectDialog"}},[t(De,[t(oa,{attrs:{flat:"",dense:""}},[t(ki,[t("span",{staticClass:"subheading"},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiSelectionRemove))]),e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline"))+" ")],1)])],1),t(q,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText",{name:e.excludeObjectDialogName}))+" ")]),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:function(r){e.boolShowExcludeObjectDialog=!1}}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.cancelObject}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"))+" ")])],1)],1)],1),t("status-panel-exclude-object-dialog",{attrs:{"show-dialog":e.showDialogPass,"exclude-object-dialog-name":e.excludeObjectDialogName,"exclude-object-dialog-bool":e.boolShowExcludeObjectDialog},on:{"update:showDialog":function(r){e.showDialogPass=r},"update:show-dialog":function(r){e.showDialogPass=r},"update:excludeObjectDialogName":function(r){e.excludeObjectDialogName=r},"update:exclude-object-dialog-name":function(r){e.excludeObjectDialogName=r},"update:excludeObjectDialogBool":function(r){e.boolShowExcludeObjectDialog=r},"update:exclude-object-dialog-bool":function(r){e.boolShowExcludeObjectDialog=r},"update:name":e.updateExcludeObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1):e._e()},d6=[];const wg={};var h6=N(Ho,u6,d6,!1,p6,null,null,null);function p6(e){for(let s in wg)this[s]=wg[s]}const m6=function(){return h6.exports}();var f6=Object.defineProperty,g6=Object.getOwnPropertyDescriptor,gy=(e,s,t,r)=>{for(var i=r>1?void 0:r?g6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&f6(s,t,i),i};let jo=class extends j(V){constructor(){super(...arguments),this.mdiFileOutline=qb,this.mdiFile=dr}get current_filename(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.filename)!=null?t:""}get current_file(){var s;return(s=this.$store.state.printer.current_file)!=null?s:{}}get thumbnailBig(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const s=this.current_file.thumbnails.find(t=>t.width>=Os);if(s&&"relative_path"in s){let t="";if(this.current_file.filename.lastIndexOf("/")!==-1&&(t=this.current_file.filename.substr(0,this.current_file.filename.lastIndexOf("/")+1)),s&&"relative_path"in s)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+s.relative_path),"?timestamp=").concat(this.current_file.modified)}}return""}get thumbnailBigHeight(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const s=this.current_file.thumbnails.find(t=>t.width>=Os);if(s&&"height"in s)return s.height}return 200}get thumbnailBigWidth(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const s=this.current_file.thumbnails.find(t=>t.width>=Os);if(s&&"width"in s)return s.width}return 300}get thumbnailSmall(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const s=this.current_file.thumbnails.find(t=>t.width>=ms&&t.width<=fs&&t.height>=ms&&t.height<=fs);if(s&&"relative_path"in s){let t="";if(this.current_file.filename.lastIndexOf("/")!==-1&&(t=this.current_file.filename.substr(0,this.current_file.filename.lastIndexOf("/")+1)),s&&"relative_path"in s)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+s.relative_path),"?timestamp=").concat(this.current_file.modified)}}return""}get boolBigThumbnail(){var t;const s=(t=this.$store.state.gui.uiSettings.boolBigThumbnail)!=null?t:!0;return this.current_filename&&s&&this.thumbnailBig}get bigThumbnailBackground(){var s;return(s=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?s:zt}get thumbnailStyle(){return zt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase()?{backgroundColor:this.bigThumbnailBackground}:{}}focusBigThumbnail(){if(this.$refs.bigThumbnail){const s=this.$refs.bigThumbnail.$el.clientWidth,t=this.thumbnailBigWidth,r=s/t;this.$refs.bigThumbnail.$el.style.height=(this.thumbnailBigHeight*r).toFixed()+"px"}}blurBigThumbnail(){this.$refs.bigThumbnail&&(this.$refs.bigThumbnail.$el.style.height="200px")}handleResize(){this.$nextTick(()=>{var t;document.activeElement===((t=this.$refs.bigThumbnail)==null?void 0:t.$el)&&this.focusBigThumbnail()})}};gy([Ze(200)],jo.prototype,"handleResize",1);jo=gy([O({})],jo);var v6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.current_filename?t("div",{staticClass:"statusPanel-printstatus-thumbnail"},[e.boolBigThumbnail?t(Vl,{ref:"bigThumbnail",staticClass:"d-flex align-end statusPanel-big-thumbnail",style:e.thumbnailStyle,attrs:{src:e.thumbnailBig,tabindex:"-1",height:"200"},on:{focus:e.focusBigThumbnail,blur:e.blurBigThumbnail}},[t(vt,{staticClass:"white--text py-2 px-2",staticStyle:{"background-color":"rgba(0, 0, 0, 0.3)","backdrop-filter":"blur(3px)"}},[t(S,[t(_,{staticStyle:{width:"100px"}},[t("span",{staticClass:"subtitle-2 text-truncate px-0 text--disabled d-block"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.current_filename)+" ")],1)])],1)],1)],1):[t(ke,[t(S,[t(_,{class:e.thumbnailSmall?"py-3":"py-2",style:e.thumbnailSmall?"width: calc(100% - 40px);":""},[t("span",{staticClass:"subtitle-2 text-truncate d-block px-0 text--disabled"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.current_filename)+" ")],1)]),e.thumbnailSmall?t(_,{staticClass:"pa-2 pl-0 col-auto"},[e.thumbnailSmall&&e.thumbnailBig?[t(pe,{attrs:{top:"","content-class":"tooltip__content-opacity1"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("vue-load-image",{staticClass:"d-flex"},[t("img",e._g(e._b({attrs:{slot:"image",src:e.thumbnailSmall,width:"32",height:"32",alt:e.current_filename},slot:"image"},"img",n,!1),i)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!1,4119397588)},[t("span",[t("img",{attrs:{src:e.thumbnailBig,width:"250",alt:e.current_filename}})])])]:e.thumbnailSmall?[t("vue-load-image",[t("img",{attrs:{slot:"image",src:e.thumbnailSmall,width:"32",height:"32",alt:e.current_filename},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]:e._e()],2):e._e()],1)],1)],t("resize-observer",{on:{notify:e.handleResize}})],2):e._e()},_6=[];const Sg={};var b6=N(jo,v6,_6,!1,y6,"7c42fe44",null,null);function y6(e){for(let s in Sg)this[s]=Sg[s]}const C6=function(){return b6.exports}();var $6=Object.defineProperty,x6=Object.getOwnPropertyDescriptor,yc=(e,s,t,r)=>{for(var i=r>1?void 0:r?x6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&$6(s,t,i),i};let gi=class extends j(V){constructor(){super(...arguments),this.mdiLayersPlus=Zu,this.mdiCloseThick=Ce,this.type="atLayer",this.layer=0,this.call="PAUSE"}hideDialog(){this.$emit("update:showDialog",!1)}get items(){return[{text:this.$t("Panels.StatusPanel.PauseAtLayer.AtLayer"),value:"atLayer",status:this.existsSetPauseAtLayer},{text:this.$t("Panels.StatusPanel.PauseAtLayer.NextLayer"),value:"nextLayer",status:this.existsSetPauseNextLayer}]}get itemsFiltered(){return this.items.filter(s=>s.status)}get itemsCall(){return[{text:"PAUSE",value:"PAUSE"},{text:"M600",value:"M600"}]}get current_layer(){var s,t,r;return(r=(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.info)==null?void 0:t.current_layer)!=null?r:0}get total_layer(){var s,t,r;return(r=(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.info)==null?void 0:t.total_layer)!=null?r:0}get macros(){var s;return(s=this.$store.getters["printer/getMacros"])!=null?s:[]}get existsSetPauseAtLayer(){return this.macros.findIndex(s=>s.name==="SET_PAUSE_AT_LAYER")!==-1}get existsSetPauseNextLayer(){return this.macros.findIndex(s=>s.name==="SET_PAUSE_NEXT_LAYER")!==-1}get macroSetPrintStatsInfo(){var s;return(s=this.$store.state.printer["gcode_macro SET_PRINT_STATS_INFO"])!=null?s:{}}get macroSettingsPauseAtLayer(){var s;return(s=this.macroSetPrintStatsInfo.pause_at_layer)!=null?s:{}}get macroSettingsPauseAtLayerEnable(){var s;return(s=this.macroSettingsPauseAtLayer.enable)!=null?s:!1}get macroSettingsPauseAtLayerCall(){var s;return(s=this.macroSettingsPauseAtLayer.call)!=null?s:"PAUSE"}get macroSettingsPauseAtLayerLayer(){var s;return(s=this.macroSettingsPauseAtLayer.layer)!=null?s:0}get macroSettingsPauseNextLayer(){var s;return(s=this.macroSetPrintStatsInfo.pause_next_layer)!=null?s:{}}get macroSettingsPauseNextLayerEnable(){var s;return(s=this.macroSettingsPauseNextLayer.enable)!=null?s:!1}get macroSettingsPauseNextLayerCall(){var s;return(s=this.macroSettingsPauseNextLayer.call)!=null?s:"PAUSE"}sendCommand(){if(this.type==="atLayer"){this.doSend("SET_PAUSE_AT_LAYER ENABLE=1 LAYER=".concat(this.layer," MACRO=").concat(this.call)),this.hideDialog();return}this.doSend("SET_PAUSE_NEXT_LAYER ENABLE=1 MACRO=".concat(this.call)),this.hideDialog()}doSend(s){this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}showDialogChanged(s){s&&(this.layer=this.current_layer+1,this.type="atLayer",this.existsSetPauseAtLayer||(this.type="nextLayer"))}typeChanged(s){s==="atLayer"?this.call=this.macroSettingsPauseAtLayerCall:s==="nextLayer"&&(this.call=this.macroSettingsPauseNextLayerCall)}};yc([k({required:!0})],gi.prototype,"showDialog",2);yc([me("showDialog")],gi.prototype,"showDialogChanged",1);yc([me("type")],gi.prototype,"typeChanged",1);gi=yc([O({components:{Panel:Z,StatusPanelExcludeObjectDialogList:my,StatusPanelExcludeObjectDialogMap:hy}})],gi);var w6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(oe,{attrs:{width:"400",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer").toString(),icon:e.mdiLayersPlus,"card-class":"pause-at-layer-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.hideDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e.type==="atLayer"&&e.macroSettingsPauseAtLayerEnable?t(S,[t(_,[t(dt,{attrs:{text:"",type:"warning",border:"left"}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.DescriptionPauseAtLayerActive",{layer:e.macroSettingsPauseAtLayerLayer,call:e.macroSettingsPauseAtLayerCall}))+" ")])],1)],1):e._e(),e.type==="nextLayer"&&e.macroSettingsPauseNextLayerEnable?t(S,[t(_,[t(dt,{attrs:{text:"",type:"warning",border:"left"}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.DescriptionPauseNextLayerActive",{call:e.macroSettingsPauseAtLayerCall}))+" ")])],1)],1):e._e(),t(S,[t(_,[t(Le,{attrs:{items:e.itemsFiltered,label:e.$t("Panels.StatusPanel.PauseAtLayer.Type"),outlined:"","hide-details":""},model:{value:e.type,callback:function(r){e.type=r},expression:"type"}})],1),e.type==="atLayer"?t(_,[t(re,{attrs:{label:e.$t("Panels.StatusPanel.PauseAtLayer.Layer"),outlined:"","hide-details":""},model:{value:e.layer,callback:function(r){e.layer=r},expression:"layer"}})],1):e._e()],1),t(S,{staticClass:"mt-0"},[t(_,[t(Le,{attrs:{items:e.itemsCall,label:e.$t("Panels.StatusPanel.PauseAtLayer.Call"),outlined:"","hide-details":""},model:{value:e.call,callback:function(r){e.call=r},expression:"call"}})],1)],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.hideDialog}},[e._v(e._s(e.$t("Panels.StatusPanel.PauseAtLayer.Abort")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.sendCommand}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.Accept"))+" ")])],1)],1)],1)],1)},S6=[];const Pg={};var P6=N(gi,w6,S6,!1,T6,null,null,null);function T6(e){for(let s in Pg)this[s]=Pg[s]}const D6=function(){return P6.exports}();var M6=Object.defineProperty,E6=Object.getOwnPropertyDescriptor,vy=(e,s,t,r)=>{for(var i=r>1?void 0:r?E6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&M6(s,t,i),i};let No=class extends j(V){constructor(){super(...arguments),this.mdiInformation=At,this.mdiMessageProcessingOutline=_P,this.mdiCloseCircle=fo,this.mdiDotsVertical=Gl,this.mdiAlertOutline=Sn,this.boolShowObjects=!1,this.boolShowPauseAtLayer=!1,this.activeTab="files",this.lastFilename=""}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get jobsCount(){var e;return(e=this.jobs.length)!=null?e:0}get jobQueueBadgeColor(){return this.jobsCount>0?"primary darken-2":"grey darken-2"}get current_filename(){var e,s;return(s=(e=this.$store.state.printer.print_stats)==null?void 0:e.filename)!=null?s:""}get current_file(){var e;return(e=this.$store.state.printer.current_file)!=null?e:{}}get printPercent(){return Math.floor(this.$store.getters["printer/getPrintPercent"]*100)}get printerStateOutput(){var e;if(this.printer_state!==""){const s=(e=this.$store.state.printer.idle_timeout)==null?void 0:e.state;return this.printer_state==="standby"&&s==="Printing"?"Busy":this.printer_state!==""&&["paused","printing"].includes(this.printer_state)?this.printPercent+"% "+this.printer_state.charAt(0).toUpperCase()+this.printer_state.slice(1):this.printer_state.charAt(0).toUpperCase()+this.printer_state.slice(1)}return this.$t("Panels.StatusPanel.Unknown")}get toolbarButtons(){return[{text:this.$t("Panels.StatusPanel.PausePrint"),color:"warning",icon:Tp,loadingName:"statusPrintPause",status:()=>["printing"].includes(this.printer_state),click:this.btnPauseJob},{text:this.$t("Panels.StatusPanel.ResumePrint"),color:"success",icon:Ii,loadingName:"statusPrintResume",status:()=>["paused"].includes(this.printer_state),click:this.btnResumeJob},{text:this.$t("Panels.StatusPanel.CancelPrint"),color:"error",icon:m0,loadingName:"statusPrintCancel",status:()=>this.$store.state.gui.uiSettings.displayCancelPrint?["paused","printing"].includes(this.printer_state):["paused"].includes(this.printer_state),click:this.btnCancelJob},{text:this.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),color:"warning",icon:go,loadingName:"excludeObjectButton",status:()=>this.multiFunctionButton||this.printing_objects.length<2?!1:["paused","printing"].includes(this.printer_state),click:this.btnExcludeObject},{text:this.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer"),color:"warning",icon:Zu,loadingName:"pauseAtLayer",status:()=>this.multiFunctionButton||this.layer_count===null?!1:["paused","printing"].includes(this.printer_state),click:this.btnPauseAtLayer},{text:this.$t("Panels.StatusPanel.ClearPrintStats"),color:"primary",icon:Hb,loadingName:"statusPrintClear",status:()=>["error","complete","cancelled"].includes(this.printer_state),click:this.btnClearJob},{text:this.$t("Panels.StatusPanel.ReprintJob"),color:"primary",icon:l0,loadingName:"statusPrintReprint",status:()=>["error","complete","cancelled"].includes(this.printer_state),click:this.btnReprintJob}]}get filteredToolbarButtons(){return this.toolbarButtons.filter(e=>e.status())}get printing_objects(){var e,s;return(s=(e=this.$store.state.printer.exclude_object)==null?void 0:e.objects)!=null?s:[]}get display_message(){var e,s;return(s=(e=this.$store.state.printer.display_status)==null?void 0:e.message)!=null?s:null}get print_stats_message(){var e,s;return(s=(e=this.$store.state.printer.print_stats)==null?void 0:e.message)!=null?s:null}get layer_count(){var e,s,t;return(t=(s=(e=this.$store.state.printer.print_stats)==null?void 0:e.info)==null?void 0:s.total_layer)!=null?t:null}get multiFunctionMenuButtons(){return[{text:this.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),loadingName:"excludeObjectButton",icon:go,status:()=>this.printing_objects.length>1,disabled:()=>["paused","printing"].includes(this.printer_state),click:this.btnExcludeObject},{text:this.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer")+" - "+this.displayPauseAtLayerButton,loadingName:"pauseAtLayer",icon:Zu,status:()=>this.displayPauseAtLayerButton,disabled:()=>["paused","printing"].includes(this.printer_state),click:this.btnPauseAtLayer}]}get multiFunctionMenuButtonsFiltered(){return this.multiFunctionMenuButtons.filter(e=>e.status())}get multiFunctionButton(){return["paused","printing"].includes(this.printer_state)?this.multiFunctionMenuButtonsFiltered.length>1:!1}get macros(){var e;return(e=this.$store.getters["printer/getMacros"])!=null?e:[]}get existsSetPauseAtLayer(){return this.macros.findIndex(e=>e.name==="SET_PAUSE_AT_LAYER")!==-1}get existsSetPauseNextLayer(){return this.macros.findIndex(e=>e.name==="SET_PAUSE_NEXT_LAYER")!==-1}get displayPauseAtLayerButton(){return this.layer_count!==null&&(this.existsSetPauseAtLayer||this.existsSetPauseNextLayer)}mounted(){this.current_filename!==""&&(this.activeTab="status")}current_filenameChanged(e){e===""?this.activeTab="files":this.lastFilename!==e&&(this.activeTab="status"),this.lastFilename=e}clearDisplayMessage(){this.$socket.emit("printer.gcode.script",{script:"M117"})}updateShowDialog(e){this.boolShowObjects=e}btnPauseJob(){this.$socket.emit("printer.print.pause",{},{loading:"statusPrintPause"})}btnResumeJob(){this.$socket.emit("printer.print.resume",{},{loading:"statusPrintResume"})}btnExcludeObject(){this.boolShowObjects=!0}btnPauseAtLayer(){this.boolShowPauseAtLayer=!0}btnCancelJob(){this.$socket.emit("printer.print.cancel",{},{loading:"statusPrintCancel"})}btnClearJob(){this.$socket.emit("printer.gcode.script",{script:"SDCARD_RESET_FILE"},{loading:"statusPrintClear"})}btnReprintJob(){this.$socket.emit("printer.print.start",{filename:this.current_filename},{loading:"statusPrintReprint"})}};vy([me("current_filename")],No.prototype,"current_filenameChanged",1);No=vy([O({components:{KlippyStatePanel:ma,MinSettingsPanel:jp,Panel:Z,StatusPanelExcludeObject:m6,StatusPanelGcodefiles:uy,StatusPanelJobqueue:ly,StatusPanelPrintstatus:U4,StatusPanelPrintstatusThumbnail:C6,StatusPanelPauseAtLayerDialog:D6}})],No);var O6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(jp),t(ma),e.klipperReadyForGui?t(Z,{attrs:{icon:e.mdiInformation,title:e.printerStateOutput,collapsible:!0,"card-class":"status-panel"},scopedSlots:e._u([{key:"icon",fn:function(){return[["paused","printing"].includes(e.printer_state)?t(at,{staticClass:"mr-3",attrs:{rotate:-90,size:30,width:5,value:e.printPercent,color:"primary"}}):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[e._l(e.filteredToolbarButtons,function(r){return t(g,{key:r.loadingName,attrs:{color:r.color,loading:e.loadings.includes(r.loadingName),icon:"",tile:""},on:{click:r.click}},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[t(v,e._g(e._b({},"v-icon",a,!1),n),[e._v(e._s(r.icon))])]}}],null,!0)},[t("span",[e._v(e._s(r.text))])])],1)}),e.multiFunctionButton?t($e,{staticClass:"pa-0",attrs:{left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,2883138713)},[t(Oe,{attrs:{dense:""}},e._l(e.multiFunctionMenuButtonsFiltered,function(r,i){return t(K,{key:"multiFunction_"+i},[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(n){return r.click()}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(r.icon))]),e._v(" "+e._s(r.text)+" ")],1)],1)}),1)],1):e._e()]},proxy:!0}],null,!1,3390704979)},[t("status-panel-printstatus-thumbnail"),t("status-panel-exclude-object",{attrs:{"show-dialog":e.boolShowObjects},on:{"update:showDialog":[function(r){e.boolShowObjects=r},e.updateShowDialog],"update:show-dialog":function(r){e.boolShowObjects=r}}}),t("status-panel-pause-at-layer-dialog",{attrs:{"show-dialog":e.boolShowPauseAtLayer},on:{"update:showDialog":function(r){e.boolShowPauseAtLayer=r},"update:show-dialog":function(r){e.boolShowPauseAtLayer=r}}}),e.print_stats_message?[t(ke,[t(S,[t(_,{staticClass:"py-2"},[t("span",{staticClass:"subtitle-2 d-block px-0 text--disabled"},[t(v,{staticClass:"mr-2",attrs:{color:"warning",small:""}},[e._v(e._s(e.mdiAlertOutline))]),e._v(" "+e._s(e.print_stats_message)+" ")],1)])],1)],1),t(E,{staticClass:"mt-0 mb-0"})]:e._e(),e.display_message?[t(ke,[t(S,[t(_,{staticClass:"py-2"},[t("span",{staticClass:"subtitle-2 d-block px-0 text--disabled"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiMessageProcessingOutline))]),e._v(" "+e._s(e.display_message)+" ")],1)]),t(_,{staticClass:"col-auto py-2"},[t(v,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:e.clearDisplayMessage}},[e._v(" "+e._s(e.mdiCloseCircle)+" ")])],1)],1)],1),t(E,{staticClass:"mt-0 mb-0"})]:e._e(),t(Bu,{attrs:{"fixed-tabs":""},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(mn,{attrs:{href:"#status"}},[e._v(e._s(e.$t("Panels.StatusPanel.Status")))]):e._e(),t(mn,{attrs:{href:"#files"}},[e._v(e._s(e.$t("Panels.StatusPanel.Files")))]),t(mn,{attrs:{href:"#jobqueue"}},[t($b,{attrs:{color:e.jobQueueBadgeColor,content:e.jobsCount.toString(),inline:!0}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Jobqueue"))+" ")])],1)],1),t(E,{staticClass:"my-0"}),t(Xx,{staticClass:"_border-radius",model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(au,{attrs:{value:"status"}},[t("status-panel-printstatus")],1):e._e(),t(au,{attrs:{value:"files"}},[t("status-panel-gcodefiles")],1),t(au,{attrs:{value:"jobqueue"}},[t("status-panel-jobqueue")],1)],1)],2):e._e()],1)},L6=[];const Tg={};var k6=N(No,O6,L6,!1,A6,"4b30acc0",null,null);function A6(e){for(let s in Tg)this[s]=Tg[s]}const ln=function(){return k6.exports}();var F6=Object.defineProperty,R6=Object.getOwnPropertyDescriptor,I6=(e,s,t,r)=>{for(var i=r>1?void 0:r?R6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&F6(s,t,i),i};let yd=class extends j(V,Je){constructor(){super(...arguments),this.mdiEngineOff=bp,this.mdiHome=Qb}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get stepsXYsorted(){return[...this.$store.state.gui.control.stepsXY].sort(function(s,t){return t-s})}get stepsXYsortedReverse(){return[...this.$store.state.gui.control.stepsXY].sort(function(s,t){return s-t})}get stepsZsorted(){return[...this.$store.state.gui.control.stepsZ].sort(function(s,t){return t-s})}get stepsZsortedReverse(){return[...this.$store.state.gui.control.stepsZ].sort(function(s,t){return s-t})}};yd=I6([O],yd);var H6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{attrs:{"no-gutters":""}},[t(_,{staticClass:"col-12 pb-0 text-center"},[t(g,{attrs:{small:"",disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning"},on:{click:e.doHome}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiHome))]),e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ALL"))+" ")],1),e.enableXYHoming?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xy")?"primary":"warning",small:""},on:{click:e.doHomeXY}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiHome))]),e._v(" XY ")],1):e._e(),e.existsQGL?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),small:"",loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e._e(),e.existsZtilt?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),small:"",loading:e.loadings.includes("zTilt"),color:e.colorZTilt},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):e._e(),t(g,{staticClass:"ml-2",attrs:{small:"",disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning"},on:{click:function(r){return e.doSend("M84")}}},[t(v,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(S,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Nt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsXYsorted,function(r){return t(g,{key:"x-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X-"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("x")?"primary":"warning",loading:e.loadings.includes("homeX")},on:{click:e.doHomeX}},[e._v(" X ")]),e._l(e.stepsXYsortedReverse,function(r){return t(g,{key:"x+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X+"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1),t(S,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Nt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsXYsorted,function(r){return t(g,{key:"y-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y-"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("y")?"primary":"warning",loading:e.loadings.includes("homeY")},on:{click:e.doHomeY}},[e._v(" Y ")]),e._l(e.stepsXYsortedReverse,function(r){return t(g,{key:"y+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y+"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1),t(S,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Nt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsZsorted,function(r){return t(g,{key:"z-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z-"+r,e.feedrateZ)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("z")?"primary":"warning",loading:e.loadings.includes("homeZ")},on:{click:e.doHomeZ}},[e._v(" Z ")]),e._l(e.stepsZsortedReverse,function(r){return t(g,{key:"z+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z+"+r,e.feedrateZ)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1)],1)},j6=[];const Dg={};var N6=N(yd,H6,j6,!1,V6,"23a679bf",null,null);function V6(e){for(let s in Dg)this[s]=Dg[s]}const U6=function(){return N6.exports}();var B6=Object.defineProperty,W6=Object.getOwnPropertyDescriptor,G6=(e,s,t,r)=>{for(var i=r>1?void 0:r?W6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&B6(s,t,i),i};let Cd=class extends j(V,Je){constructor(){super(...arguments),this.homeIcon="M10,20L10,14L14,14L14,20L19,20L19,12L22,12L12,3L2,12L5,12L5,20L10,20Z",this.pathHomeButtonTop="M9.188,-0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,-0Z",this.pathHomeButtonBottom="M9.188,0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,0Z",this.xyStepOuter="M43.181,8.535C43.262,8.453 43.373,8.409 43.488,8.412C43.602,8.415 43.711,8.466 43.787,8.551C47.661,12.933 50,18.695 50,25C50,31.291 47.672,37.042 43.811,41.42C43.735,41.505 43.627,41.556 43.512,41.559C43.398,41.562 43.287,41.518 43.206,41.437C42.343,40.575 39.981,38.213 39.981,38.213C43.11,34.7 45,30.069 45,25C45,19.918 43.1,15.276 39.956,11.759C39.956,11.759 42.319,9.397 43.181,8.535Z",this.xyStepOuterMid="M47.418,4.777C57.663,18.688 57.829,31.029 47.304,45.072L39.308,37.098C42.081,33.838 43.75,29.612 43.75,25C43.75,20.371 42.069,16.132 39.277,12.868L47.418,4.777Z",this.xyStepInnerMid="M54.897,-1.964C68.991,16.277 68.542,32.764 54.738,51.763L44.077,41.131L38.115,35.169C40.361,32.389 41.667,28.846 41.667,25C41.667,21.132 40.346,17.57 38.076,14.784L54.897,-1.964Z",this.xyStepInner="M36.096,19.243C35.88,18.839 35.954,18.342 36.278,18.019C40.686,13.619 69.84,-15.445 69.84,-15.445C90.891,13.786 89.845,38.467 69.564,65.144C69.564,65.144 40.684,36.265 36.318,31.899C35.996,31.576 35.922,31.081 36.134,30.678C37.008,28.975 37.5,27.044 37.5,25C37.5,22.925 36.993,20.967 36.096,19.243Z",this.zStepOuter="M66.037,2.5C66.037,1.672 66.709,1 67.537,1L74.537,1C75.365,1 76.037,1.672 76.037,2.5L76.037,7.521C74.428,7.179 72.759,7 71.048,7C69.33,7 67.654,7.181 66.037,7.525L66.037,2.5Z",this.zStepOuterMid="M66.037,7.221C69.367,6.597 72.7,6.583 76.037,7.192L76.037,13.702C74.453,13.245 72.778,13 71.048,13C69.309,13 67.627,13.247 66.037,13.708L66.037,7.221Z",this.zStepInnerMid="M66.037,13.244C69.353,12.66 72.687,12.7 76.037,13.355L76.037,20.099C74.523,19.39 72.831,19 71.048,19C69.256,19 67.556,19.393 66.037,20.109L66.037,13.244Z",this.zStepInner="M66.037,19.186C69.409,18.542 72.742,18.52 76.037,19.102L76.037,23.682C76.037,23.815 75.984,23.942 75.891,24.036C75.564,24.362 74.774,25.153 74.359,25.567C74.204,25.722 73.967,25.757 73.773,25.656C72.955,25.236 72.029,25 71.048,25C70.051,25 69.112,25.243 68.284,25.674C68.09,25.777 67.852,25.742 67.697,25.586C67.283,25.175 66.506,24.395 66.183,24.071C66.09,23.977 66.037,23.85 66.037,23.718C66.037,22.806 66.037,19.186 66.037,19.186Z",this.zTiltIcon1="M74.189,31.503L67.751,30.009L67.638,30.496L74.076,31.99L74.189,31.503Z",this.zTiltIcon2="M74.361,32.85L74.034,32.676L74.939,32.188L75.039,33.211L74.745,33.055C74.386,33.724 73.858,34.288 73.213,34.69L72.983,34.321C73.563,33.959 74.038,33.452 74.361,32.85ZM67.193,28.75C67.586,28.1 68.142,27.564 68.807,27.196L69.018,27.576C68.42,27.907 67.919,28.389 67.565,28.974L67.883,29.165L66.954,29.605L66.907,28.578L67.193,28.75Z",this.engineOffIcon="M3.78 2.5L21.5 20.22l-1.27 1.28L18 19.27V20h-8l-2-2H5v-3H3v3H1v-8h2v3h2v-3l1.87-1.86L2.5 3.77L3.78 2.5M20 9v3h-2V8h-6V6h3V4H7.82l15 15H23V9h-3Z"}get actionButton(){var s;return(s=this.$store.state.gui.control.actionButton)!=null?s:this.defaultActionButton}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get reverseX(){return this.$store.state.gui.control.reverseX}get reverseY(){return this.$store.state.gui.control.reverseY}get reverseZ(){return this.$store.state.gui.control.reverseZ}get stepsXY(){var t,r;const s=(r=(t=this.$store.state.gui.control)==null?void 0:t.stepsCircleXY)!=null?r:[];return Array.from(new Set([...s!=null?s:[]])).sort((i,n)=>i-n)}get stepsZ(){var t,r;const s=(r=(t=this.$store.state.gui.control)==null?void 0:t.stepsCircleZ)!=null?r:[];return Array.from(new Set([...s!=null?s:[]])).sort((i,n)=>i-n)}get isPrinting(){return["printing"].includes(this.printer_state)}get stepTextClass(){return!this.homedAxes.includes("xy")||this.isPrinting?["disabled"]:[]}get xStepClass(){return!this.homedAxes.includes("x")||this.isPrinting?["disabled"]:[]}get yStepClass(){return!this.homedAxes.includes("y")||this.isPrinting?["disabled"]:[]}get zStepClass(){return!this.homedAxes.includes("z")||this.isPrinting?["disabled"]:[]}get xHomeClass(){let s=[];return this.homedAxes.includes("x")&&s.push("homed"),this.isPrinting&&s.push("disabled"),s}get yHomeClass(){let s=[];return this.homedAxes.includes("y")&&s.push("homed"),this.isPrinting&&s.push("disabled"),s}get xyHomeClass(){let s=[];return this.homedAxes.includes("xy")&&s.push("homed"),this.isPrinting&&s.push("disabled"),s}get xyzHomeClass(){let s=[];return this.homedAxes.includes("xyz")&&s.push("homed"),this.isPrinting&&s.push("disabled"),s}get zHomeClass(){let s=[];return this.homedAxes.includes("z")&&s.push("homed"),this.isPrinting&&s.push("disabled"),s}get colorSpecialButton(){let s=[];return this.isPrinting&&s.push("disabled"),this.existsQGL?s.push(this.colorQuadGantryLevel):this.existsZtilt&&s.push(this.colorZTilt),s}get motorsOffClass(){let s=[];return s.push(this.homedAxes!==""?"primary":"warning"),this.isPrinting&&s.push("disabled"),s}clickSpecialButton(){if(this.existsQGL)this.doQGL();else if(this.existsZtilt)return this.doZtilt()}};Cd=G6([O],Cd);var z6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,[t(_,{staticClass:"pa-0 mt-1"},[t("svg",{staticStyle:{"fill-rule":"evenodd","clip-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2"},attrs:{width:"100%",height:"100%",viewBox:"0 0 78 62",xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve"}},[t("g",{attrs:{id:"ArtBoard1",transform:"matrix(1.24239,0,0,1,0,0)"}},[t("rect",{staticStyle:{fill:"none"},attrs:{x:"0",y:"0",width:"62",height:"62"}}),t("g",{attrs:{id:"home_buttons",transform:"matrix(0.804902,0,0,1,0.0430241,0)"}},[t("a",{class:e.xHomeClass,on:{click:e.doHomeX}},[t("g",{attrs:{id:"home_x",transform:"matrix(0.707107,-0.707107,0.707107,0.707107,-1.41799,4.05689)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_x",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonTop}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.789px",y:"6.089px"}},[e._v("X")])]),t("g",{staticClass:"home_icon",attrs:{id:"Icon",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),t("a",{class:e.yHomeClass,on:{click:e.doHomeY}},[t("g",{attrs:{id:"home_y",transform:"matrix(0.707107,0.707107,-0.707107,0.707107,57.8807,-1.41799)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_y",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonTop}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.789px",y:"6.089px"}},[e._v("Y")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),t("a",{class:e.zHomeClass,on:{click:e.doHomeZ}},[t("g",{attrs:{id:"home_z",transform:"matrix(-0.707107,0.707107,-0.707107,-0.707107,63.3555,57.8807)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_z",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.93px",y:"6.089px"}},[e._v("Z")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon1",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),e.enableXYHoming?t("a",{class:e.xyHomeClass,on:{click:e.doHomeXY}},[t("g",{attrs:{id:"home_xy",transform:"matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_xy",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"2.3px",y:"6.089px"}},[e._v("XY")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon2",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]):t("a",{class:e.xyzHomeClass,on:{click:e.doHome}},[t("g",{attrs:{id:"home_all",transform:"matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_all",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{staticClass:"home_icon",attrs:{id:"icon3",transform:"matrix(0.29377,0,0,0.29377,0.346087,1.64241)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),e.enableXYHoming?t("a",{class:e.xyzHomeClass,on:{click:e.doHome}},[t("g",{staticClass:"home_button",attrs:{id:"home_all_center"}},[t("circle",{attrs:{id:"home_button_all_center",cx:"31",cy:"31",r:"5"}})]),t("g",{staticClass:"home-icon",attrs:{id:"icon4",transform:"scale(0.3) translate(91.25,91.25)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])]):e._e()]),t("g",{attrs:{id:"step_buttons",transform:"matrix(0.804902,0,0,1,0.0430241,0)"}},[t("g",{attrs:{id:"Z",transform:"matrix(1.24239,0,0,1,-0.0534526,0)"}},[t("g",{class:e.zStepClass,attrs:{id:"Bottom",transform:"matrix(-1,-1.52149e-16,9.85721e-17,-1,114.34,62)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=0?e.stepsZ[0]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=1?e.stepsZ[1]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,1.2326e-32,-9.92118e-33,1,-5.71917e-15,-7.10543e-15)"}},[t("path",{attrs:{d:e.zStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=2?e.stepsZ[2]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=3?e.stepsZ[3]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuter}})])])]),t("g",{class:e.zStepClass,attrs:{id:"Top"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=0?e.stepsZ[0]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=1?e.stepsZ[1]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,1.2326e-32,-9.92118e-33,1,-5.71917e-15,-7.10543e-15)"}},[t("path",{attrs:{d:e.zStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=2?e.stepsZ[2]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=3?e.stepsZ[3]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuter}})])])])]),t("g",{class:e.zStepClass,attrs:{id:"stepsZ",transform:"matrix(1,0,0,1,40,0)"}},[t("g",{attrs:{transform:"matrix(1,0,0,1,0.483899,4.07983)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=0?e.stepsZ[0]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-1.95729)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=1?e.stepsZ[1]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-7.99441)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=2?e.stepsZ[2]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-14.0315)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=3?e.stepsZ[3]:"--")+" ")])])]),t("g",{attrs:{id:"XY"}},[t("g",{class:e.xStepClass,attrs:{id:"Right"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.xStepClass,attrs:{id:"Left",transform:"matrix(-1,-1.22465e-16,1.22465e-16,-1,61.9767,61.9767)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.yStepClass,attrs:{id:"Bottom1",transform:"matrix(6.12323e-17,1,-1,6.12323e-17,61.9767,-1.77705e-14)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.yStepClass,attrs:{id:"Top1",transform:"matrix(6.12323e-17,-1,1,6.12323e-17,7.10543e-15,61.9767)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])])]),t("g",{class:e.stepTextClass,attrs:{id:"stepsXY"}},[t("g",{attrs:{transform:"matrix(1,0,0,1,0.483899,4.07983)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=0?e.stepsXY[0]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-1.95729)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=1?e.stepsXY[1]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-7.99441)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=2?e.stepsXY[2]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-14.0315)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=3?e.stepsXY[3]:"--")+" ")])])])])]),e.existsQGL&&e.actionButton==="qgl"?t("a",{class:e.colorSpecialButton,attrs:{id:"tilt_adjust"},on:{click:e.clickSpecialButton}},[t("circle",{attrs:{id:"qgl_button",cx:"70.92",cy:"31",r:"5"}}),t("text",{attrs:{x:"66.776px",y:"32.066px"}},[e._v("QGL")]),t("g",{attrs:{id:"tilt_icon"}},[t("path",{attrs:{d:e.zTiltIcon1}}),t("path",{attrs:{d:e.zTiltIcon2}})])]):e.existsZtilt&&e.actionButton==="ztilt"?t("a",{class:e.colorSpecialButton,attrs:{id:"tilt_adjust"},on:{click:e.clickSpecialButton}},[t("circle",{attrs:{id:"tilt_button",cx:"70.92",cy:"31",r:"5"}}),t("text",{attrs:{x:"66.776px",y:"32.066px"}},[e._v("Z-TILT")]),t("g",{attrs:{id:"tilt_icon"}},[t("path",{attrs:{d:e.zTiltIcon1}}),t("path",{attrs:{d:e.zTiltIcon2}})])]):t("a",{class:e.motorsOffClass,attrs:{id:"stepper_off"},on:{click:function(r){return e.doSend("M84")}}},[t("circle",{attrs:{id:"stepper_off_button",cx:"70.92",cy:"31",r:"5"}}),t("g",{attrs:{id:"stepper_off_icon",transform:"scale(0.3) translate(224,91)"}},[t("path",{attrs:{d:e.engineOffIcon}})])])])])],1)],1)},Z6=[];const Mg={};var q6=N(Cd,z6,Z6,!1,X6,"8e4f3fa8",null,null);function X6(e){for(let s in Mg)this[s]=Mg[s]}const Y6=function(){return q6.exports}();var J6=Object.defineProperty,K6=Object.getOwnPropertyDescriptor,Q6=(e,s,t,r)=>{for(var i=r>1?void 0:r?K6(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&J6(s,t,i),i};let $d=class extends j(V,Je){constructor(){super(...arguments),this.mdiChevronUp=la,this.mdiChevronLeft=VS,this.mdiChevronRight=US,this.mdiChevronDown=Vs,this.mdiEngineOff=bp,this.mdiHome=Qb}get actionButton(){var s;return(s=this.$store.state.gui.control.actionButton)!=null?s:this.defaultActionButton}get selectedCrossStep(){return this.$store.state.gui.control.selectedCrossStep}set selectedCrossStep(s){this.$store.dispatch("gui/saveSetting",{name:"control.selectedCrossStep",value:s})}get stepSize(){return this.stepsReversed[this.selectedCrossStep]}get reverseX(){return this.$store.state.gui.control.reverseX}get reverseY(){return this.$store.state.gui.control.reverseY}get reverseZ(){return this.$store.state.gui.control.reverseZ}get stepsAll(){var s,t;return(t=(s=this.$store.state.gui.control)==null?void 0:s.stepsAll)!=null?t:[]}get stepsReversed(){var s;return Array.from(new Set([...(s=this.stepsAll)!=null?s:[]])).sort((t,r)=>t-r)}};$d=Q6([O({components:{Responsive:Qe}})],$d);var eL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Qe,{attrs:{breakpoints:{small:function(r){return r.width<=300}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t("div",[t(S,[t(_,[t(S,{staticClass:"mb-1",attrs:{dense:""}},[t(_,{attrs:{cols:"3"}}),t(_,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.yAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepSize),e.feedrateXY)}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1)],1),t(_,{attrs:{cols:"3"}}),t(_,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.zAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepSize),e.feedrateZ)}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1)],1)],1),t(S,{attrs:{dense:""}},[t(_,{staticClass:"p-rel",attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width p-abs",staticStyle:{top:"-50%",width:"calc(100% - 8px)"},attrs:{disabled:!e.xAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepSize),e.feedrateXY)}}},[t(v,[e._v(e._s(e.mdiChevronLeft))])],1)],1),t(_,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.yAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepSize),e.feedrateXY)}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1),t(_,{staticClass:"p-rel",attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width p-abs",staticStyle:{top:"-50%",width:"calc(100% - 8px)"},attrs:{disabled:!e.xAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepSize),e.feedrateXY)}}},[t(v,[e._v(e._s(e.mdiChevronRight))])],1)],1),t(_,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.zAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(n){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepSize),e.feedrateZ)}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)],1)],1),i.is.small?e._e():t(_,{staticClass:"d-flex align-center"},[t("div",{staticClass:"flex-grow-1",staticStyle:{"border-radius":"4px",overflow:"hidden"}},[t(S,{staticStyle:{"margin-bottom":"-2px !important"},attrs:{dense:""}},[t(_,{attrs:{cols:"6"}},[t(g,{staticClass:"w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning",height:"30",tile:""},on:{click:e.doHome}},[t("div",{staticClass:"d-flex align-center"},[t(v,[e._v(e._s(e.mdiHome))]),t("span",[e._v(e._s(e.$t("Panels.ToolheadControlPanel.ALL")))])],1)])],1),t(_,{staticClass:"d-flex",attrs:{cols:"6"}},[e.actionButton==="qgl"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel,height:"30",dense:"",tile:""},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e.actionButton==="ztilt"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("zTilt"),color:e.colorZTilt,height:"30",dense:"",tile:""},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):t(g,{staticClass:"flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning",height:"30",dense:"",tile:""},on:{click:function(n){return e.doSend("M84")}}},[t(v,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(S,{attrs:{dense:""}},[e.enableXYHoming?e._e():t(_,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeX"),color:e.homedAxes.includes("x")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeX}},[e._v(" X ")])],1),e.enableXYHoming?t(_,{staticClass:"flex-grow-1",attrs:{cols:"6"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("xy")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeXY}},[e._v(" XY ")])],1):t(_,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("y")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeY}},[e._v(" Y ")])],1),t(_,{staticClass:"flex-grow-1",class:e.enableXYHoming?"col-6":"col-4"},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeZ"),color:e.homedAxes.includes("z")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeZ}},[e._v(" Z ")])],1)],1)],1)])],1),i.is.small?t(S,[t(_,{staticClass:"d-flex align-center"},[t("div",{staticClass:"flex-grow-1",staticStyle:{"border-radius":"4px",overflow:"hidden"}},[t(S,{staticStyle:{"margin-bottom":"-2px !important"},attrs:{dense:""}},[t(_,{attrs:{cols:"6"}},[t(g,{staticClass:"w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning",height:"30",tile:""},on:{click:e.doHome}},[t("div",{staticClass:"d-flex align-center"},[t(v,[e._v(e._s(e.mdiHome))]),t("span",[e._v(e._s(e.$t("Panels.ToolheadControlPanel.ALL")))])],1)])],1),t(_,{staticClass:"d-flex",attrs:{cols:"6"}},[e.actionButton==="qgl"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel,height:"30",dense:"",tile:""},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e.actionButton==="ztilt"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("zTilt"),color:e.colorZTilt,height:"30",dense:"",tile:""},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):t(g,{staticClass:"flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning",height:"30",dense:"",tile:""},on:{click:function(n){return e.doSend("M84")}}},[t(v,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(S,{attrs:{dense:""}},[e.enableXYHoming?e._e():t(_,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeX"),color:e.homedAxes.includes("x")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeX}},[e._v(" X ")])],1),e.enableXYHoming?t(_,{staticClass:"flex-grow-1",attrs:{cols:"6"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("xy")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeXY}},[e._v(" XY ")])],1):t(_,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("y")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeY}},[e._v(" Y ")])],1),t(_,{staticClass:"flex-grow-1",class:e.enableXYHoming?"col-6":"col-4"},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeZ"),color:e.homedAxes.includes("z")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeZ}},[e._v(" Z ")])],1)],1)],1)])],1):e._e(),t(S,{staticClass:"mt-3",attrs:{"no-gutters":""}},[t(_,[e.stepsReversed.length>0?t(ho,{key:"all-steps-".concat(e.stepsReversed.join("_")),staticStyle:{"flex-wrap":"nowrap",width:"100%"},attrs:{dense:"",mandatory:""},model:{value:e.selectedCrossStep,callback:function(n){e.selectedCrossStep=n},expression:"selectedCrossStep"}},e._l(e.stepsReversed,function(n){return t(g,{key:"step-".concat(n),staticClass:"btnMinWidthAuto flex-grow-1 px-0",staticStyle:{height:"28px"},attrs:{disabled:["printing"].includes(e.printer_state),dense:""}},[t("span",{staticClass:"body-2"},[e._v(e._s(n))])])}),1):t("div",{staticClass:"font-weight-bold warning rounded pa-2"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.PleaseConfigureSteps"))+" "),t("br"),t("router-link",{staticStyle:{color:"white"},attrs:{to:"/settings/interface"}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.SettingsInterfaceControl"))+" ")])],1)],1)],1)],1)]}}])})},tL=[];const Eg={};var sL=N($d,eL,tL,!1,rL,"8c5676c8",null,null);function rL(e){for(let s in Eg)this[s]=Eg[s]}const iL=function(){return sL.exports}();var nL=Object.defineProperty,aL=Object.getOwnPropertyDescriptor,pr=(e,s,t,r)=>{for(var i=r>1?void 0:r?aL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&nL(s,t,i),i};let ys=class extends j(V){onBlur(){this.position!==this.currentPos&&(this.position=this.currentPos)}submit(){this.$emit("submit")}};pr([nS({type:String})],ys.prototype,"position",2);pr([k({type:String,required:!0})],ys.prototype,"currentPos",2);pr([k({type:String,required:!1})],ys.prototype,"label",2);pr([k({type:String,required:!1})],ys.prototype,"suffix",2);pr([k({type:Number,required:!1,default:1})],ys.prototype,"step",2);pr([k({type:Boolean,required:!1})],ys.prototype,"disabled",2);pr([k({type:Boolean,required:!1})],ys.prototype,"readonly",2);ys=pr([O({components:{}})],ys);var oL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t(re,{attrs:{label:"[ ".concat(e.label," ]"),suffix:e.suffix,disabled:e.disabled,step:e.step,readonly:e.readonly,"hide-details":"auto",type:"number","hide-spin-buttons":"",outlined:"",reverse:"",dense:""},on:{blur:e.onBlur,focus:function(r){e.readonly||r.target.select()}},model:{value:e.position,callback:function(r){e.position=r},expression:"position"}})],1)},lL=[];const Og={};var cL=N(ys,oL,lL,!1,uL,null,null,null);function uL(e){for(let s in Og)this[s]=Og[s]}const qa=function(){return cL.exports}();var dL=Object.defineProperty,hL=Object.getOwnPropertyDescriptor,Cc=(e,s,t,r)=>{for(var i=r>1?void 0:r?hL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&dL(s,t,i),i};let vi=class extends j(V,Je){constructor(){super(...arguments),this.mdiCrosshairsGps=YS,this.mdiGrid=ql,this.input={x:{pos:"",valid:!0},y:{pos:"",valid:!0},z:{pos:"",valid:!0}}}updatePositionX(e){this.input.x.pos=e}updatePositionY(e){this.input.y.pos=e}updatePositionZ(e){this.input.z.pos=e}get displayPositionAbsolute(){return this.positionAbsolute?this.$t("Panels.ToolheadControlPanel.Absolute"):this.$t("Panels.ToolheadControlPanel.Relative")}get positionAbsolute(){var e,s;return(s=(e=this.$store.state.printer.gcode_move)==null?void 0:e.absolute_coordinates)!=null?s:!0}get livePositions(){var s,t,r,i,n,a,o,l;const e=(t=(s=this.$store.state.printer.motion_report)==null?void 0:s.live_position)!=null?t:[0,0,0];return{x:(i=(r=e[0])==null?void 0:r.toFixed(2))!=null?i:"--",y:(a=(n=e[1])==null?void 0:n.toFixed(2))!=null?a:"--",z:(l=(o=e[2])==null?void 0:o.toFixed(3))!=null?l:"--"}}get gcodePositions(){var s,t,r,i,n,a,o,l;const e=(t=(s=this.$store.state.printer.gcode_move)==null?void 0:s.gcode_position)!=null?t:[0,0,0];return{x:(i=(r=e[0])==null?void 0:r.toFixed(2))!=null?i:"--",y:(a=(n=e[1])==null?void 0:n.toFixed(2))!=null?a:"--",z:(l=(o=e[2])==null?void 0:o.toFixed(3))!=null?l:"--"}}get bed_mesh(){var e;return(e=this.$store.state.printer.bed_mesh)!=null?e:null}get currentProfileName(){var e,s;return(s=(e=this.bed_mesh)==null?void 0:e.profile_name)!=null?s:""}get showPosition(){var e;return(e=this.$store.state.gui.view.toolhead.showPosition)!=null?e:!0}get showCoordinates(){var e;return(e=this.$store.state.gui.view.toolhead.showCoordinates)!=null?e:!0}get showControl(){var e;return(e=this.$store.state.gui.view.toolhead.showControl)!=null?e:!0}get containerClass(){return this.showControl?"pb-0":""}sendCmd(){const e=this.input.x.pos!==this.gcodePositions.x?" X".concat(this.input.x.pos):"",s=this.input.y.pos!==this.gcodePositions.y?" Y".concat(this.input.y.pos):"",t=this.input.z.pos!==this.gcodePositions.z?" Z".concat(this.input.z.pos):"";let r="";this.positionAbsolute||(r+="G90\n"),t!==""&&(r+="G1".concat(t," F").concat(this.feedrateZ*60,"\n")),(e!==""||s!=="")&&(r+="G1".concat(e).concat(s," F").concat(this.feedrateXY*60)),r!==""&&this.input.x.valid&&this.input.y.valid&&this.input.z.valid&&(this.$store.dispatch("server/addEvent",{message:r,type:"command"}),this.$socket.emit("printer.gcode.script",{script:r}))}};Cc([me("gcodePositions.x",{immediate:!0})],vi.prototype,"updatePositionX",1);Cc([me("gcodePositions.y",{immediate:!0})],vi.prototype,"updatePositionY",1);Cc([me("gcodePositions.z",{immediate:!0})],vi.prototype,"updatePositionZ",1);vi=Cc([O({components:{MoveToInput:qa,Responsive:Qe}})],vi);var pL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showCoordinates||e.showPosition?t(ke,{class:e.containerClass},[t(Qe,{attrs:{breakpoints:{xsmall:function(r){return r.width<=320},small:function(r){return r.width>320&&r.width<=460},medium:function(r){return r.width>460&&r.width<=560},large:function(r){return r.width>560}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[e.showPosition?t(S,{staticClass:"flex-nowrap pb-1"},[t(_,{staticClass:"v-subheader text--secondary mr-2",class:{"col-5":i.is.small,"col-4":i.is.xsmall||i.is.medium,"col-3":i.is.large}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(" "+e._s(e.mdiCrosshairsGps)+" ")]),i.is.xsmall?e._e():t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.Position"))+":  ")]),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.displayPositionAbsolute))])],1),e.currentProfileName?t(_,{staticClass:"v-subheader text--secondary pl-2 justify-end text-no-wrap text-truncate"},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(" "+e._s(e.mdiGrid)+" ")]),t("span",{staticClass:"text-no-wrap text-truncate"},[e._v(" "+e._s(e.currentProfileName)+" ")])],1):e._e()],1):e._e(),e.showCoordinates?t(S,{attrs:{dense:""}},[t(_,{class:i.is.xsmall?"col-12":"col-4"},[t(qa,{attrs:{label:e.livePositions.x,suffix:"X",step:.01,"current-pos":e.gcodePositions.x,readonly:["printing"].includes(e.printer_state),disabled:!e.xAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.x.pos,callback:function(n){e.$set(e.input.x,"pos",n)},expression:"input.x.pos"}})],1),t(_,{class:i.is.xsmall?"col-12":"col-4"},[t(qa,{attrs:{label:e.livePositions.y,suffix:"Y",step:.01,"current-pos":e.gcodePositions.y,readonly:["printing"].includes(e.printer_state),disabled:!e.yAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.y.pos,callback:function(n){e.$set(e.input.y,"pos",n)},expression:"input.y.pos"}})],1),t(_,{class:i.is.xsmall?"col-12":"col-4"},[t(qa,{attrs:{label:e.livePositions.z,suffix:"Z",step:.001,"current-pos":e.gcodePositions.z,readonly:["printing"].includes(e.printer_state),disabled:!e.zAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.z.pos,callback:function(n){e.$set(e.input.z,"pos",n)},expression:"input.z.pos"}})],1)],1):e._e()]}}],null,!1,2435385659)})],1):e._e()},mL=[];const Lg={};var fL=N(vi,pL,mL,!1,gL,null,null,null);function gL(e){for(let s in Lg)this[s]=Lg[s]}const _y=function(){return fL.exports}();var vL=Object.defineProperty,_L=Object.getOwnPropertyDescriptor,bL=(e,s,t,r)=>{for(var i=r>1?void 0:r?_L(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&vL(s,t,i),i};let Vo=class extends y{get homing_origin(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:s.homing_origin)!=null?t:[]}get z_gcode_offset(){return this.homing_origin.length>1?Math.round(this.homing_origin[2]*1e3)/1e3:0}get helplist(){var e;return(e=this.$store.state.printer.helplist)!=null?e:[]}get settings(){var e,s;return(s=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)!=null?s:{}}get kinematics(){var e,s;return(s=(e=this.settings.printer)==null?void 0:e.kinematics)!=null?s:"cartesian"}get stepper_name(){return this.kinematics==="delta"?"stepper_a":"stepper_z"}get endstop_pin(){var s;const e=(s=this.settings[this.stepper_name])!=null?s:{};return e==null?void 0:e.endstop_pin}get zOffset(){var e,s;return(s=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:s.homing_origin[2].toFixed(3)}get isEndstopProbe(){return this.endstop_pin.search("probe:z_virtual_endstop")!==-1}get existZOffsetApplyProbe(){return this.helplist.findIndex(e=>e.commandLow==="z_offset_apply_probe")!==-1}get existZOffsetApplyEndstop(){return this.helplist.findIndex(e=>e.commandLow==="z_offset_apply_endstop")!==-1}get showSaveButton(){return this.z_gcode_offset===0?!1:this.isEndstopProbe&&this.existZOffsetApplyProbe?!0:!this.isEndstopProbe&&this.existZOffsetApplyEndstop}get autoSaveZOffsetOption(){return this.isEndstopProbe&&this.existZOffsetApplyProbe?"Z_OFFSET_APPLY_PROBE":"Z_OFFSET_APPLY_ENDSTOP"}};Vo=bL([O],Vo);var yL=Object.defineProperty,CL=Object.getOwnPropertyDescriptor,$L=(e,s,t,r)=>{for(var i=r>1?void 0:r?CL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&yL(s,t,i),i};let xd=class extends j(V,Vo){constructor(){super(...arguments),this.mdiBroom=Hb,this.mdiContentSave=vp,this.mdiArrowCollapseDown=Wl,this.mdiInformation=At,this.mdiArrowExpandUp=Ib,this.mdiLayersOutline=mP,this.saveOffsetDialog=!1}get offsetsZ(){return this.$store.state.gui.control.offsetsZ}get homed_axis(){var e,s;return(s=(e=this.$store.state.printer.toolhead)==null?void 0:e.homed_axes)!=null?s:""}get offsetZSaveOption(){var e;return(e=this.$store.state.gui.control.offsetZSaveOption)!=null?e:null}sendBabyStepDown(e){const s="SET_GCODE_OFFSET Z_ADJUST=-".concat(e," ").concat(this.homed_axis==="xyz"?"MOVE=1":"");this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"babyStepDown"})}sendBabyStepUp(e){const s="SET_GCODE_OFFSET Z_ADJUST=+".concat(e," ").concat(this.homed_axis==="xyz"?"MOVE=1":"");this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"babyStepUp"})}clearZOffset(){const e="SET_GCODE_OFFSET Z=0"+(this.homed_axis==="xyz"?" MOVE=1":"");this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"babySteppingClear"})}saveZOffset(){let e=this.offsetZSaveOption;e===null&&(e=this.autoSaveZOffsetOption),this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e}),this.saveOffsetDialog=!0}saveConfig(){const e="SAVE_CONFIG";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"topbarSaveConfig"}),this.saveOffsetDialog=!1}};xd=$L([O({components:{Panel:Z,Responsive:Qe}})],xd);var xL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Qe,{attrs:{breakpoints:{xsmall:function(r){return r.width<=285},medium:function(r){return r.width<=510}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(ke,{staticClass:"pa-0"},[t(S,[t(_,{staticClass:"v-subheader text--secondary pr-0"},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(" "+e._s(e.mdiLayersOutline)+" ")]),t("span",[e._v(e._s(e.$t("Panels.ZoffsetPanel.Headline"))+": "+e._s(e.zOffset))])],1),t(_,{staticClass:"v-subheader justify-end pl-0"},[t("div",{staticClass:"d-flex align-center"},[e.z_gcode_offset!==0?t(g,{staticClass:"px-2 mr-1",attrs:{loading:e.loadings.includes("babySteppingClear"),text:"",small:"",plain:""},on:{click:function(n){return e.clearZOffset()}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiBroom))]),i.is.xsmall?e._e():t("span",{staticClass:"ml-1"},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Clear")))])],1):e._e(),e.showSaveButton?t(g,{staticClass:"px-2",attrs:{color:"primary",text:"",small:"",plain:""},on:{click:e.saveZOffset}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiContentSave))]),i.is.xsmall?e._e():t("span",{staticClass:"ml-1"},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Save")))])],1):e._e()],1)])],1),t(S,{attrs:{dense:""}},[t(_,{class:i.is.medium?"col-12":"order-1 col-6"},[t("div",{staticClass:"d-flex align-center"},[t(Nt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(n,a){return t(g,{key:"offsetsUp-".concat(a),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(o){return e.sendBabyStepUp(n)}}},[a===0&&!i.is.xsmall?t(v,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowExpandUp)+" ")]):e._e(),t("span",[e._v("+"+e._s(n))])],1)}),1)],1)]),t(_,{class:i.is.medium?"col-12":"order-0 col-6"},[i.is.medium?t(Nt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(n,a){return t(g,{key:"offsetsDown-".concat(a),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(o){return e.sendBabyStepDown(n)}}},[a===0&&!i.is.xsmall?t(v,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e(),t("span",[e._v("−"+e._s(n))])],1)}),1):t(Nt,{staticClass:"_btn-group"},e._l(e.offsetsZ.slice().reverse(),function(n,a){return t(g,{key:"offsetsDown-".concat(a),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(o){return e.sendBabyStepDown(n)}}},[t("span",[e._v("−"+e._s(n))]),a===e.offsetsZ.length-1&&!i.is.xsmall?t(v,{staticClass:"mr-n1 ml-1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e()],1)}),1)],1)],1),t(oe,{attrs:{"max-width":"290"},model:{value:e.saveOffsetDialog,callback:function(n){e.saveOffsetDialog=n},expression:"saveOffsetDialog"}},[t(Z,{attrs:{title:e.$t("Panels.ZoffsetPanel.SaveInfoHeadline"),icon:e.mdiInformation,"card-class":"zoffset-saveinfo-dialog","margin-bottom":!1}},[e.printerIsPrinting?t(q,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveInfoDescriptionPrint"))+" ")]):t(q,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveInfoDescription"))+" ")]),e.printerIsPrinting?t(ne,[t(le),t(g,{attrs:{text:""},on:{click:function(n){e.saveOffsetDialog=!1}}},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Ok")))])],1):t(ne,[t(le),t(g,{attrs:{color:"primary",text:""},on:{click:e.saveConfig}},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveConfig"))+" ")]),t(g,{attrs:{text:""},on:{click:function(n){e.saveOffsetDialog=!1}}},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Later")))])],1)],1)],1)],1)]}}])})},wL=[];const kg={};var SL=N(xd,xL,wL,!1,PL,"51065007",null,null);function PL(e){for(let s in kg)this[s]=kg[s]}const by=function(){return SL.exports}();var TL=Object.defineProperty,DL=Object.getOwnPropertyDescriptor,ML=(e,s,t,r)=>{for(var i=r>1?void 0:r?DL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&TL(s,t,i),i};let wd=class extends j(V,Je){constructor(){super(...arguments),this.mdiDotsVertical=Gl,this.mdiEngineOff=bp,this.mdiGamepad=wp,this.mdiSpeedometer=jP,this.mdiRestore=AP,this.mdiMenuDown=hr}get controlStyle(){var s;return(s=this.$store.state.gui.control.style)!=null?s:"bars"}get actionButton(){var s;return(s=this.$store.state.gui.control.actionButton)!=null?s:this.defaultActionButton}get speedFactor(){var s,t,r;return(r=(t=(s=this.$store.state.printer)==null?void 0:s.gcode_move)==null?void 0:t.speed_factor)!=null?r:1}get isPrinting(){return["printing"].includes(this.printer_state)}get axisControlVisible(){var s;return this.showControl?!(this.isPrinting&&((s=this.$store.state.gui.control.hideDuringPrint)!=null&&s)):!1}get showButtons(){return this.controlStyle!=="bars"&&(this.existsZtilt||this.existsQGL)?!0:this.existsBedScrews||this.existsBedTilt||this.existsDeltaCalibrate||this.existsScrewsTilt}get showControl(){var s;return(s=this.$store.state.gui.view.toolhead.showControl)!=null?s:!0}get showZOffset(){var s;return(s=this.$store.state.gui.view.toolhead.showZOffset)!=null?s:!0}get showSpeedFactor(){var s;return(s=this.$store.state.gui.view.toolhead.showSpeedFactor)!=null?s:!0}};wd=ML([O({components:{BarsControl:U6,CircleControl:Y6,CrossControl:iL,MoveToControl:_y,Panel:Z,ToolSlider:sc,ZoffsetControl:by}})],wd);var EL=Object.defineProperty,OL=Object.getOwnPropertyDescriptor,LL=(e,s,t,r)=>{for(var i=r>1?void 0:r?OL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&EL(s,t,i),i};let Sd=class extends j(V){constructor(){super(...arguments),this.mdiCog=Us}get showPosition(){var e;return(e=this.$store.state.gui.view.toolhead.showPosition)!=null?e:!0}set showPosition(e){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showPosition",value:e})}get showCoordinates(){var e;return(e=this.$store.state.gui.view.toolhead.showCoordinates)!=null?e:!0}set showCoordinates(e){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showCoordinates",value:e})}get showControl(){var e;return(e=this.$store.state.gui.view.toolhead.showControl)!=null?e:!0}set showControl(e){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showControl",value:e})}get showZOffset(){var e;return(e=this.$store.state.gui.view.toolhead.showZOffset)!=null?e:!0}set showZOffset(e){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showZOffset",value:e})}get showSpeedFactor(){var e;return(e=this.$store.state.gui.view.toolhead.showSpeedFactor)!=null?e:!0}set showSpeedFactor(e){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showSpeedFactor",value:e})}};Sd=LL([O],Sd);var kL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($e,{attrs:{"offset-y":!0,left:!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.PositionOutput")},model:{value:e.showPosition,callback:function(r){e.showPosition=r},expression:"showPosition"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.CoordinateFields")},model:{value:e.showCoordinates,callback:function(r){e.showCoordinates=r},expression:"showCoordinates"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.ControlButtons")},model:{value:e.showControl,callback:function(r){e.showControl=r},expression:"showControl"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.ZOffset")},model:{value:e.showZOffset,callback:function(r){e.showZOffset=r},expression:"showZOffset"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.SpeedFactor")},model:{value:e.showSpeedFactor,callback:function(r){e.showSpeedFactor=r},expression:"showSpeedFactor"}})],1)],1)],1)},AL=[];const Ag={};var FL=N(Sd,kL,AL,!1,RL,null,null,null);function RL(e){for(let s in Ag)this[s]=Ag[s]}const IL=function(){return FL.exports}();var HL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(Z,{attrs:{icon:e.mdiGamepad,title:e.$t("Panels.ToolheadControlPanel.Headline"),collapsible:!0,"card-class":"toolhead-control-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showButtons?t($e,{staticClass:"pa-0",attrs:{left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:"",disabled:["printing"].includes(e.printer_state)}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,3697264518)},[t(Oe,{attrs:{dense:""}},[e.controlStyle!=="bars"&&e.actionButton!=="m84"?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("M84")}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiEngineOff))]),e._v(" "+e._s(e.$t("Settings.ControlTab.MotorsOff",{isDefault:""}))+" ")],1)],1):e._e(),e.controlStyle!=="bars"&&e.existsZtilt&&e.actionButton!=="ztilt"?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.doZtilt}},[e._v("Z-Tilt Adjust")])],1):e._e(),e.controlStyle!=="bars"&&e.existsQGL&&e.actionButton!=="qgl"?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.doQGL}},[e._v("Quad Gantry Level")])],1):e._e(),e.existsBedTilt?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("BED_TILT_CALIBRATE")}}},[e._v(" BED TILT CALIBRATE ")])],1):e._e(),e.existsBedScrews?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("BED_SCREWS_ADJUST")}}},[e._v("BED SCREWS ADJUST")])],1):e._e(),e.existsDeltaCalibrate?t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("DELTA_CALIBRATE")}}},[e._v("DELTA CALIBRATE")])],1):e._e(),e.existsScrewsTilt?t(K,[t("div",{staticClass:"d-flex align-center",staticStyle:{width:"100%"}},[t(g,{staticStyle:{"border-top-right-radius":"0","border-bottom-right-radius":"0"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE")}}},[e._v(" SCREWS TILT CALCULATE ")]),t($e,{attrs:{"offset-y":"",left:"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-0",staticStyle:{"min-width":"32px","border-top-left-radius":"0","border-bottom-left-radius":"0"},attrs:{small:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,274928364)},[t(Oe,{attrs:{dense:""}},[t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE DIRECTION=CW")}}},[t(v,{staticStyle:{transform:"scaleX(-1)"},attrs:{left:"",small:""}},[e._v(e._s(e.mdiRestore))]),t("span",[e._v("CW")])],1)],1),t(K,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE DIRECTION=CCW")}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiRestore))]),t("span",[e._v("CCW")])],1)],1)],1)],1)],1)]):e._e()],1)],1):e._e(),t(IL)]},proxy:!0}],null,!1,2619595342)},[t(_y),e.axisControlVisible?t(ke,[t("".concat(e.controlStyle,"-control"),{tag:"component"})],1):e._e(),e.showZOffset?t(E):e._e(),e.showZOffset?t(ke,[t(by)],1):e._e(),e.showSpeedFactor?t(E):e._e(),e.showSpeedFactor?t(ke,[t(sc,{attrs:{label:e.$t("Panels.ToolheadControlPanel.SpeedFactor"),icon:e.mdiSpeedometer,target:e.speedFactor,min:1,max:200,multi:100,step:5,"dynamic-range":!0,"has-input-field":!0,command:"M220","attribute-name":"S"}})],1):e._e()],1):e._e()},jL=[];const Fg={};var NL=N(wd,HL,jL,!1,VL,null,null,null);function VL(e){for(let s in Fg)this[s]=Fg[s]}const UL=function(){return NL.exports}();var BL=Object.defineProperty,WL=Object.getOwnPropertyDescriptor,GL=(e,s,t,r)=>{for(var i=r>1?void 0:r?WL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&BL(s,t,i),i};let kt=class extends y{fgColor(e=1,s=this.$vuetify.theme.dark){const t=s?255:0;return"rgba(".concat(t,", ").concat(t,", ").concat(t,", ").concat(e,")")}bgColor(e=1){return this.fgColor(e,!this.$vuetify.theme.dark)}get fgColorHi(){return this.fgColor(.8)}get fgColorMid(){return this.fgColor(.5)}get fgColorLow(){return this.fgColor(.2)}get fgColorFaint(){return this.fgColor(.1)}get machineButtonCol(){return this.$vuetify.theme.dark?"grey darken-3":"grey lighten-1"}get draggableBgStyle(){const e=this.$vuetify.theme.dark?"#282828":"#e7e7e7";return"background-color: ".concat(e)}get progressBarColor(){return this.$vuetify.theme.dark?"white":"primary"}get sidebarBgImage(){return this.$vuetify.theme.dark?"/img/sidebar-background.svg":"/img/sidebar-background-light.svg"}};kt=GL([O],kt);var zL=Object.defineProperty,ZL=Object.getOwnPropertyDescriptor,Yp=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&zL(s,t,i),i};let Fn=class extends j(V,kt){constructor(){super(...arguments),this.hoverChart=!1,this.isVisible=!0}get chartOptions(){return{renderer:"svg",animation:!1,tooltip:this.tooltip,grid:{top:35,right:this.gridRight,bottom:30,left:25},legend:{animation:!1,show:!1,selected:this.selectedLegends},xAxis:{type:"time",splitNumber:5,minInterval:60*1e3,splitLine:{show:!0,lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorLow,margin:10,formatter:this.timeFormat}},yAxis:this.yAxis,media:this.media,dataset:{source:[]},series:this.series}}get tooltip(){return{animation:!1,trigger:"axis",backgroundColor:this.bgColor(1),borderWidth:0,textStyle:{color:this.fgColorHi,fontSize:"14px"},padding:15,formatter:this.tooltipFormatter,confine:!0,className:"echarts-tooltip",position:function(e,s,t,r,i){const n={top:60};return n[["left","right"][+(e[0]this.autoscale?Math.ceil((e.max+5)/20)*20:this.maxTemp,minInterval:20,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorMid,align:"left"},splitLine:{lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorMid,formatter:"{value}",rotate:90,showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}},{show:this.boolDisplayPwmAxis,name:"PWM [%]",min:0,max:1,minInterval:.25,type:"value",nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorMid,align:"right"},splitLine:{show:!1},axisLabel:{color:this.fgColorMid,formatter:e=>e*100,showMinLabel:!0,rotate:90,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}}]}get media(){return[{query:{minWidth:500},option:{grid:{right:this.optionGridRight,left:40},yAxis:[{maxInterval:50,axisLabel:{showMinLabel:!1,showMaxLabel:!0,rotate:0}},{maxInterval:25,axisLabel:{showMinLabel:!1,rotate:0}}]}}]}get chart(){var e,s;return(s=(e=this.$refs.tempchart)==null?void 0:e.chart)!=null?s:null}get maxHistory(){return this.$store.getters["printer/tempHistory/getTemperatureStoreSize"]}get series(){var e;return(e=this.$store.state.printer.tempHistory.series)!=null?e:{}}get source(){var e;return(e=this.$store.state.printer.tempHistory.source)!=null?e:[]}get autoscale(){var e;return(e=this.$store.state.gui.view.tempchart.autoscale)!=null?e:!0}get maxTemp(){var e;return(e=this.$store.getters["printer/getMaxTemp"])!=null?e:300}get boolDisplayPwmAxis(){return this.$store.getters["printer/tempHistory/getBoolDisplayPwmAxis"]}get selectedLegends(){return this.$store.getters["printer/tempHistory/getSelectedLegends"]}get timeFormat(){return this.hours12Format?"{hh}:{mm}":"{HH}:{mm}"}get tempchartHeight(){var e;return(e=this.$store.state.gui.uiSettings.tempchartHeight)!=null?e:250}get tempchartStyle(){return{height:this.tempchartHeight+"px"}}get gridRight(){return this.boolDisplayPwmAxis?25:15}get optionGridRight(){return this.boolDisplayPwmAxis?35:15}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}visibilityChanged(e){this.isVisible=e}tooltipFormatter(e){let s="";const t=e.filter(r=>r.seriesName.endsWith("-temperature"));if(e.length){let r=e[0].axisValueLabel;r=r.substring(r.indexOf(" "));const i=this.$vuetify.theme.dark?"theme-dark":"";s+='
')+r+"
"}return t.forEach(r=>{const i=r.seriesName.substring(0,r.seriesName.lastIndexOf("-"));let n=i;n.indexOf(" ")!==-1&&(n=n.substring(n.indexOf(" ")+1)),s+='
',s+='
',s+=r.marker,s+=""+gt(n)+":",s+="
",s+='
';const a="".concat(i,"-temperature"),o="".concat(i,"-target");if(a in r.value){const l=r.value[a];s+=l!==null?l.toFixed(1):"--"}if(o in r.value){s+=" / ";const l=r.value[o];s+=l!==null?l.toFixed(1):"--"}s+="°C",wn.forEach(l=>{const c="".concat(i,"-").concat(l);if(!(c in r.value))return;let u=r.value[c];u=u!==null?(r.value[c]*100).toFixed(0):"--",s+=" [ ".concat(u,"% ]")}),s+="
",s+="
"}),s}selectedLegendsChanged(e,s){var t;((t=this.chart)==null?void 0:t.isDisposed())!==!0&&Object.keys(e).forEach(r=>{var i;if(e[r]!==s[r]){const n=e[r]?"legendSelect":"legendUnSelect";(i=this.chart)==null||i.dispatchAction({type:n,name:r})}})}sourceChanged(e){var r;if(!this.chart||!this.isVisible||this.hoverChart)return;(r=this.chart)==null||r.setOption({dataset:{source:e}});const s=new Date(Date.now()-this.maxHistory*1e3);let t=e.filter(i=>i.date>=s);e.length>0&&t.length{for(var i=r>1?void 0:r?QL(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&KL(s,t,i),i};let as=class extends j(V,Je){constructor(){super(...arguments),this.mdiSnowflake=p0,this.mdiFire=Ri,this.mdiMenuDown=hr,this.value=0}setTemps(){var e;if(typeof this.value=="object"&&(this.value=(e=this.value.value)!=null?e:0),this.value===null&&(this.value=0),this.value>this.max_temp)this.value={value:this.target,text:this.target},this.$toast.error(this.$t("Panels.TemperaturePanel.TempTooHigh",{name:this.name,max:this.max_temp})+"");else if(this.value{for(var i=r>1?void 0:r?nk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ik(s,t,i),i};let Pd=class extends j(V){constructor(){super(...arguments),this.mdiFire=Ri,this.mdiMenuDown=hr,this.mdiSnowflake=p0}get presets(){var e;return(e=this.$store.getters["gui/presets/getPresets"])!=null?e:[]}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}preheat(e){var s;for(const[t,r]of Object.entries(e.values))if(r.bool){const i=t.split(" "),n=i[0];let a=(s=i[1])!=null?s:i[0],o="SET_HEATER_TEMPERATURE",l="HEATER";n==="temperature_fan"&&(o="SET_TEMPERATURE_FAN_TARGET",l="TEMPERATURE_FAN");const c="".concat(o," ").concat(l,"=").concat(a," TARGET=").concat(r.value);this.$store.dispatch("server/addEvent",{message:c,type:"command"}),this.$socket.emit("printer.gcode.script",{script:c})}e.gcode!==""&&setTimeout(()=>{this.$store.dispatch("server/addEvent",{message:e.gcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e.gcode})},100)}cooldown(){this.$store.dispatch("server/addEvent",{message:this.cooldownGcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.cooldownGcode})}};Pd=ak([O],Pd);var ok=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticStyle:{height:"100%"}},[e.presets.length?t($e,{attrs:{"offset-y":!0,left:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"pa-1",attrs:{text:"",tile:"",color:"primary",disabled:["printing","paused"].includes(e.printer_state)}},"v-btn",n,!1),i),[t("span",{staticClass:"d-none ml-1 d-md-block"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Presets")))]),t(v,{staticClass:"d-md-none"},[e._v(e._s(e.mdiFire))]),t(v,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,1208155870)},[t(Oe,{staticClass:"py-0",attrs:{dense:""}},e._l(e.presets,function(r,i){return t(K,{key:i,attrs:{link:""},on:{click:function(n){return e.preheat(r)}}},[t("div",{staticClass:"d-flex align-center _preset-title"},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiFire))]),t("span",{staticStyle:{"padding-top":"2px"}},[e._v(e._s(r.name))])],1)])}),1),t(E,{staticClass:"_fix_transparency"}),t(Oe,{staticClass:"py-0",attrs:{dense:""}},[t(K,{attrs:{link:""},on:{click:e.cooldown}},[t("div",{staticClass:"d-flex align-center _preset-title"},[t(v,{staticClass:"mr-1",attrs:{small:"",color:"primary"}},[e._v(e._s(e.mdiSnowflake))]),t("span",{staticClass:"primary--text"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Cooldown")))])],1)])],1)],1):t(g,{attrs:{icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,tile:"",color:"primary"},on:{click:e.cooldown}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiSnowflake))]),t("span",{staticClass:"d-none ml-1 d-md-inline"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Cooldown")))])],1)],1)},lk=[];const Hg={};var ck=N(Pd,ok,lk,!1,uk,"3edd7172",null,null);function uk(e){for(let s in Hg)this[s]=Hg[s]}const $y=function(){return ck.exports}();var dk=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,pk=(e,s,t,r)=>{for(var i=r>1?void 0:r?hk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&dk(s,t,i),i};let Td=class extends j(V,Je){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiThermometerLines=v0,this.convertName=gt,this.capitalize=kr}get boolTempchart(){var s;return(s=this.$store.state.gui.view.tempchart.boolTempchart)!=null?s:!1}};Td=pk([O({components:{Panel:Z,TempChart:yy,TemperatureInput:Cy,Responsive:Qe,TemperaturePanelPresets:$y}})],Td);var mk=Object.defineProperty,fk=Object.getOwnPropertyDescriptor,xy=(e,s,t,r)=>{for(var i=r>1?void 0:r?fk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&mk(s,t,i),i};let Uo=class extends j(V){constructor(){super(...arguments),this.mdiFan=yp,this.showEditDialog=!1,this.nevermoreValues=["temperature","pressure","humidity"]}get printerObject(){var e;return(e=this.$store.state.printer.nevermore)!=null?e:{}}get color(){var e,s,t,r,i,n;return(n=(i=(r=(t=(s=(e=this.$store.state.gui)==null?void 0:e.view)==null?void 0:s.tempchart)==null?void 0:t.datasetSettings)==null?void 0:r.nevermore)==null?void 0:i.color)!=null?n:"#ffffff"}get iconColor(){return this.state===null||this.state>0?"".concat(this.color).concat(Lb):"".concat(this.color).concat(kb)}get iconClass(){var t,r,i;const e=["_no-focus-style","cursor-pointer"];return!((r=(t=this.$store.state.gui)==null?void 0:t.uiSettings.disableFanAnimation)!=null?r:!1)&&((i=this.state)!=null?i:0)>0&&e.push("icon-rotate"),e}get state(){var e;return(e=this.printerObject.speed)!=null?e:null}get rpm(){var s;return((s=this.printerObject.rpm)!=null?s:null)===null?null:parseInt(this.printerObject.rpm)}get rpmClass(){var e;return this.rpm===0&&((e=this.printerObject.speed)!=null?e:0)>0?"red--text":""}};xy([k({type:Boolean,required:!0})],Uo.prototype,"isResponsiveMobile",2);Uo=xy([O],Uo);var gk=Object.defineProperty,vk=Object.getOwnPropertyDescriptor,Jp=(e,s,t,r)=>{for(var i=r>1?void 0:r?vk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&gk(s,t,i),i};let Rn=class extends j(V){get value(){return this.$store.getters["gui/getDatasetValue"]({name:this.objectName,type:this.serieName})}get label(){return this.$t("Panels.TemperaturePanel.ShowNameInChart",{name:this.formatSerieName})}set value(e){this.$store.dispatch("gui/setChartDatasetStatus",{objectName:this.objectName,dataset:this.serieName,value:e})}get formatSerieName(){return kr(this.serieName)}};Jp([k({type:String,required:!0})],Rn.prototype,"objectName",2);Jp([k({type:String,required:!0})],Rn.prototype,"serieName",2);Rn=Jp([O],Rn);var _k=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,{staticClass:"py-1"},[t(we,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},bk=[];const jg={};var yk=N(Rn,_k,bk,!1,Ck,null,null,null);function Ck(e){for(let s in jg)this[s]=jg[s]}const wy=function(){return yk.exports}();var $k=Object.defineProperty,xk=Object.getOwnPropertyDescriptor,Kp=(e,s,t,r)=>{for(var i=r>1?void 0:r?xk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&$k(s,t,i),i};let In=class extends j(V){get value(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,type:this.additionalSensor})}set value(e){this.$store.dispatch("gui/setDatasetAdditionalSensorStatus",{objectName:this.objectName,dataset:this.additionalSensor,value:e})}get label(){return this.$t("Panels.TemperaturePanel.ShowNameInList",{name:this.additionalSensor})}};Kp([k({type:String,required:!0})],In.prototype,"objectName",2);Kp([k({type:String,required:!0})],In.prototype,"additionalSensor",2);In=Kp([O],In);var wk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,{staticClass:"col-12 py-1"},[t(we,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},Sk=[];const Ng={};var Pk=N(In,wk,Sk,!1,Tk,null,null,null);function Tk(e){for(let s in Ng)this[s]=Ng[s]}const Sy=function(){return Pk.exports}();var Dk=Object.defineProperty,Mk=Object.getOwnPropertyDescriptor,Gs=(e,s,t,r)=>{for(var i=r>1?void 0:r?Mk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Dk(s,t,i),i};let os=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce}get chartSeries(){var e;return(e=this.$store.getters["printer/tempHistory/getSerieNames"](this.objectName))!=null?e:[]}get printerObjectAdditionalSensor(){return this.additionalSensorName===null||!(this.additionalSensorName in this.$store.state.printer)?{}:this.$store.state.printer[this.additionalSensorName]}get additionalValues(){return this.objectName==="z_thermal_adjust"?["current_z_adjust"]:this.objectName==="nevermore"?["temperature","pressure","humidity","rpm"]:Object.keys(this.printerObjectAdditionalSensor).filter(e=>e!=="temperature")}setChartColor(e){typeof e=="object"&&"hex"in e&&(e=e.hex),this.$store.dispatch("gui/setChartColor",{objectName:this.objectName,value:e}),this.$store.dispatch("printer/tempHistory/setColor",{name:this.objectName,value:e})}closeDialog(){this.$emit("close-dialog")}};Gs([k({type:Boolean,required:!0})],os.prototype,"boolShow",2);Gs([k({type:String,required:!0})],os.prototype,"objectName",2);Gs([k({type:String,required:!0})],os.prototype,"name",2);Gs([k({required:!0})],os.prototype,"additionalSensorName",2);Gs([k({type:String,required:!0})],os.prototype,"formatName",2);Gs([k({type:String,required:!0})],os.prototype,"icon",2);Gs([k({type:String,required:!0})],os.prototype,"color",2);Gs([Ze(500)],os.prototype,"setChartColor",1);os=Gs([O({components:{TemperaturePanelListItemEditAdditionalSensor:Sy,TemperaturePanelListItemEditChartSerie:wy}})],os);var Ek=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"",width:400},model:{value:e.boolShow,callback:function(r){e.boolShow=r},expression:"boolShow"}},[t(Z,{attrs:{title:e.formatName,icon:e.icon,"card-class":"temperature-edit-heater-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-6"},[e._l(e.chartSeries,function(r){return t(wy,{key:r,attrs:{"object-name":e.objectName,"serie-name":r}})}),e._l(e.additionalValues,function(r){return t(Sy,{key:r,attrs:{"object-name":e.objectName,"additional-sensor":r}})}),t(S,[t(_,{staticClass:"col-12 text-center pb-0"},[t(ss,{staticClass:"mx-auto",attrs:{"hide-mode-switch":"",mode:"hexa",value:e.color},on:{"update:color":e.setChartColor}})],1)],1)],2)],1)],1)},Ok=[];const Vg={};var Lk=N(os,Ek,Ok,!1,kk,null,null,null);function kk(e){for(let s in Vg)this[s]=Vg[s]}const Py=function(){return Lk.exports}();var Ak=Object.defineProperty,Fk=Object.getOwnPropertyDescriptor,va=(e,s,t,r)=>{for(var i=r>1?void 0:r?Fk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Ak(s,t,i),i};let Ir=class extends j(V){get cssStyle(){let e={cursor:"default",fontSize:"1em"};return this.small&&(e.fontSize="0.8em"),e}get value(){var s;const e=(s=this.printerObject[this.keyName])!=null?s:null;return isNaN(e)?null:e}get intake_value(){var s;const e="intake_".concat(this.keyName);return(s=this.printerObject[e])!=null?s:null}get intake_value_min(){var s;const e="intake_".concat(this.keyName,"_min");return(s=this.printerObject[e])!=null?s:null}get intake_value_max(){var s;const e="intake_".concat(this.keyName,"_max");return(s=this.printerObject[e])!=null?s:null}get exhaust_value(){var s;const e="exhaust_".concat(this.keyName);return(s=this.printerObject[e])!=null?s:null}get exhaust_value_min(){var s;const e="exhaust_".concat(this.keyName,"_min");return(s=this.printerObject[e])!=null?s:null}get exhaust_value_max(){var s;const e="exhaust_".concat(this.keyName,"_max");return(s=this.printerObject[e])!=null?s:null}get unit(){switch(this.keyName){case"temperature":return"°C";case"pressure":return"hPa";case"humidity":return"%"}return null}get digits(){return["gas","pressure"].includes(this.keyName)?0:1}get formatValue(){return this.getFormatedValue(this.intake_value,this.exhaust_value)}get formatValue_min(){return this.getFormatedValue(this.intake_value_min,this.exhaust_value_min)}get formatValue_max(){return this.getFormatedValue(this.intake_value_max,this.exhaust_value_max)}getFormatedValue(e,s){let t=e==null?void 0:e.toFixed(this.digits),r=s==null?void 0:s.toFixed(this.digits);return this.intake_value===null&&(t="--"),this.exhaust_value===null&&(r="--"),this.unit===null?"".concat(t," > ").concat(r):"".concat(t," ").concat(this.unit," > ").concat(r," ").concat(this.unit)}get disableTooltip(){return this.intake_value_min===null||this.exhaust_value_min===null||this.intake_value_max===null||this.exhaust_value_max===null}get guiSetting(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,sensor:this.keyName})}get isVisible(){return this.intake_value===null&&this.exhaust_value===null?!1:this.guiSetting}};va([k({type:Object,required:!0})],Ir.prototype,"printerObject",2);va([k({type:String,required:!0})],Ir.prototype,"objectName",2);va([k({type:String,required:!0})],Ir.prototype,"keyName",2);va([k({type:Boolean,required:!1,default:!0})],Ir.prototype,"small",2);Ir=va([O],Ir);var Rk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.isVisible?t("div",[t(pe,{attrs:{top:"",disabled:e.disableTooltip},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({style:e.cssStyle},"span",n,!1),i),[e._v(e._s(e.formatValue))])]}}],null,!1,2376366562)},[t("span",[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Max"))+": "+e._s(e.formatValue_max)+" "),t("br"),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Min"))+": "+e._s(e.formatValue_min)+" ")])])],1):e._e()},Ik=[];const Ug={};var Hk=N(Ir,Rk,Ik,!1,jk,null,null,null);function jk(e){for(let s in Ug)this[s]=Ug[s]}const Bg=function(){return Hk.exports}();var Nk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("tr",[t("td",{staticClass:"icon"},[t(v,{class:e.iconClass,attrs:{color:e.iconColor,tabindex:"-1"},on:{click:function(r){e.showEditDialog=!0}}},[e._v(" "+e._s(e.mdiFan)+" ")])],1),t("td",{staticClass:"name"},[t("span",{staticClass:"cursor-pointer",on:{click:function(r){e.showEditDialog=!0}}},[e._v("Nevermore")])]),t("td",{staticClass:"text-no-wrap text-center",attrs:{colspan:"3"}},[t(Bg,{attrs:{"printer-object":e.printerObject,small:!1,"object-name":"nevermore","key-name":"gas"}}),e._l(e.nevermoreValues,function(r){return t(Bg,{key:r,attrs:{"printer-object":e.printerObject,"object-name":"nevermore","key-name":r}})}),e.rpm!==null?t("div",[t("small",{class:e.rpmClass},[e._v(e._s(e.rpm)+" RPM")])]):e._e()],2),t(Py,{attrs:{"bool-show":e.showEditDialog,"object-name":"nevermore",name:"nevermore","format-name":"Nevermore","additional-sensor-name":"nevermore",icon:e.mdiFan,color:e.color},on:{"close-dialog":function(r){e.showEditDialog=!1}}})],1)},Vk=[];const Wg={};var Uk=N(Uo,Nk,Vk,!1,Bk,"2263111c",null,null);function Bk(e){for(let s in Wg)this[s]=Wg[s]}const Ty=function(){return Uk.exports}();var Wk=Object.defineProperty,Gk=Object.getOwnPropertyDescriptor,zk=(e,s,t,r)=>{for(var i=r>1?void 0:r?Gk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Wk(s,t,i),i};let Dd=class extends j(V){get available_heaters(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.heaters)==null?void 0:s.available_heaters)!=null?t:[]}get filteredHeaters(){return this.available_heaters.filter(e=>{const s=e.split(" ");let t=s[0];return s.length>1&&(t=s[1]),!t.startsWith("_")}).sort(this.sortObjectName)}get available_sensors(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.heaters)==null?void 0:s.available_sensors)!=null?t:[]}get available_monitors(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.heaters)==null?void 0:s.available_monitors)!=null?t:[]}get monitors(){return this.available_monitors.sort(this.sortObjectName)}get temperature_fans(){return this.available_sensors.filter(e=>e.startsWith("temperature_fan")&&!e.startsWith("temperature_fan _")).sort(this.sortObjectName)}get existsNevermoreFilter(){return"nevermore"in this.$store.state.printer}get hideMcuHostSensors(){var e;return(e=this.$store.state.gui.view.tempchart.hideMcuHostSensors)!=null?e:!1}get hideMonitors(){var e;return(e=this.$store.state.gui.view.tempchart.hideMonitors)!=null?e:!1}get temperature_sensors(){return this.available_sensors.filter(e=>{if(this.available_heaters.includes(e)||this.temperature_fans.includes(e)||this.hideMcuHostSensors&&this.checkMcuHostSensor(e))return!1;const s=e.split(" ");let t=s[0];return s.length>1&&(t=s[1]),!t.startsWith("_")}).sort(this.sortObjectName)}get heaterObjects(){return[...this.filteredHeaters,...this.temperature_fans]}get settings(){var e,s,t;return(t=(s=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:s.settings)!=null?t:{}}checkMcuHostSensor(e){var r,i;const t=(i=((r=this.settings[e.toLowerCase()])!=null?r:{}).sensor_type)!=null?i:"";return["temperature_mcu","temperature_host"].includes(t)}sortObjectName(e,s){const t=e.split(" ");let r=t[0];t.length>1&&(r=t[1]),r=r.toUpperCase();const i=s.split(" ");let n=i[0];return i.length>1&&(n=i[1]),n=n.toUpperCase(),rn?1:0}};Dd=zk([O({components:{TemperaturePanelListItemNevermore:Ty}})],Dd);var Zk=Object.defineProperty,qk=Object.getOwnPropertyDescriptor,Qp=(e,s,t,r)=>{for(var i=r>1?void 0:r?qk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Zk(s,t,i),i};let Hn=class extends j(V){constructor(){super(...arguments),this.showEditDialog=!1}get printerObject(){return this.objectName in this.$store.state.printer?this.$store.state.printer[this.objectName]:{}}get printerObjectSettings(){var s,t,r,i,n;const e=this.objectName.toLowerCase();return e in((r=(t=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:t.settings)!=null?r:{})?(n=(i=this.$store.state.printer)==null?void 0:i.configfile)==null?void 0:n.settings[e]:{}}get name(){const e=this.objectName.split(" ");return e.length===1?this.objectName:e[1]}get formatName(){return gt(this.name)}get icon(){var e;return this.objectName.startsWith("extruder")?(e=this.printerObject.can_extrude)!=null&&e?Bs:c0:this.objectName==="heater_bed"?this.temperature!==null&&this.temperature>50||this.target&&this.temperature&&this.temperature>this.target-5?OP:d0:this.objectName.startsWith("heater_generic")?Ri:this.objectName.startsWith("tmc")?r0:this.isFan?yp:BP}get color(){var e;return(e=this.$store.getters["printer/tempHistory/getDatasetColor"](this.objectName))!=null?e:"#FFFFFF"}get iconColor(){return this.target===null||this.target>0?"".concat(this.color).concat(Lb):"".concat(this.color).concat(kb)}get iconClass(){var s,t,r;const e=["_no-focus-style","cursor-pointer"];return this.isFan&&!((t=(s=this.$store.state.gui)==null?void 0:s.uiSettings.disableFanAnimation)!=null&&t)&&((r=this.state)!=null?r:0)>0&&e.push("icon-rotate"),e}get isFan(){return this.objectName.startsWith("temperature_fan")}get state(){var e,s;return(s=(e=this.printerObject.power)!=null?e:this.printerObject.speed)!=null?s:null}get formatState(){return this.state===null?null:this.target===0&&this.state===0?"off":"".concat(Math.round(this.state*100)," %")}get avgPower(){var e;return(e=this.$store.getters["printer/tempHistory/getAvgPower"](this.name))!=null?e:0}get avgSpeed(){var e;return(e=this.$store.getters["printer/tempHistory/getAvgSpeed"](this.name))!=null?e:0}get avgState(){return"power"in this.printerObject?Math.round(this.avgPower):"speed"in this.printerObject?Math.round(this.avgSpeed):null}get temperature(){var e,s;return(s=(e=this.printerObject)==null?void 0:e.temperature)!=null?s:null}get formatTemperature(){var e,s;return"".concat((s=(e=this.temperature)==null?void 0:e.toFixed(1))!=null?s:"--","°C")}get min_temp(){var e;return parseInt((e=this.printerObjectSettings.min_temp)!=null?e:0)}get max_temp(){var e;return parseInt((e=this.printerObjectSettings.max_temp)!=null?e:0)}get measured_min_temp(){var e,s,t;return(t=(s=(e=this.printerObject)==null?void 0:e.measured_min_temp)==null?void 0:s.toFixed(1))!=null?t:null}get measured_max_temp(){var e,s,t;return(t=(s=(e=this.printerObject)==null?void 0:e.measured_max_temp)==null?void 0:s.toFixed(1))!=null?t:null}get target(){var e,s;return(s=(e=this.printerObject)==null?void 0:e.target)!=null?s:null}get additionalSensorName(){if(this.objectName==="z_thermal_adjust")return"z_thermal_adjust";const e=mS.find(s=>{if("".concat(s," ").concat(this.name)in this.$store.state.printer)return!0});return e?"".concat(e," ").concat(this.name):null}get rpm(){var s;return((s=this.printerObject.rpm)!=null?s:null)===null?null:parseInt(this.printerObject.rpm)}get rpmClass(){var e;return this.rpm===0&&((e=this.printerObject.speed)!=null?e:0)>0?"red--text":""}get presets(){var e;return(e=this.$store.getters["gui/presets/getPresetsFromHeater"]({name:this.objectName}))!=null?e:[]}get command(){return this.objectName.startsWith("temperature_fan")?"SET_TEMPERATURE_FAN_TARGET":this.objectName.startsWith("extruder")||this.objectName.startsWith("heater_")?"SET_HEATER_TEMPERATURE":null}get commandAttributeName(){return this.command==="SET_HEATER_TEMPERATURE"?"HEATER":this.command==="SET_TEMPERATURE_FAN_TARGET"?"TEMPERATURE_FAN":""}};Qp([k({type:String,required:!0})],Hn.prototype,"objectName",2);Qp([k({type:Boolean,required:!0})],Hn.prototype,"isResponsiveMobile",2);Hn=Qp([O],Hn);var Xk=Object.defineProperty,Yk=Object.getOwnPropertyDescriptor,em=(e,s,t,r)=>{for(var i=r>1?void 0:r?Yk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Xk(s,t,i),i};let jn=class extends j(V){get printerObject(){return this.additionalObjectName in this.$store.state.printer?this.$store.state.printer[this.additionalObjectName]:{}}get additionalValues(){return this.objectName==="z_thermal_adjust"?["current_z_adjust"]:Object.keys(this.printerObject).filter(e=>e!=="temperature")}};em([k({type:String,required:!0})],jn.prototype,"objectName",2);em([k({type:String,required:!0})],jn.prototype,"additionalObjectName",2);jn=em([O],jn);var Jk=Object.defineProperty,Kk=Object.getOwnPropertyDescriptor,$c=(e,s,t,r)=>{for(var i=r>1?void 0:r?Kk(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Jk(s,t,i),i};let _i=class extends j(V){get value(){var s;const e=(s=this.printerObject[this.keyName])!=null?s:null;return isNaN(e)?null:e}get formatValue(){var t;let e=(t=this.value)==null?void 0:t.toFixed(1);this.value===null&&(e="--");let s=null;switch(this.keyName){case"pressure":s="hPa";break;case"humidity":s="%";break;case"current_z_adjust":s="mm";break}return this.keyName==="current_z_adjust"&&this.value&&(e=this.value.toFixed(3),Math.abs(this.value)<.1&&(e=Math.round(this.value*1e3).toString(),s="μm")),s?"".concat(e," ").concat(s):e}get guiSetting(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,sensor:this.keyName})}get isVisible(){return this.value===null?!1:this.guiSetting}};$c([k({type:Object,required:!0})],_i.prototype,"printerObject",2);$c([k({type:String,required:!0})],_i.prototype,"objectName",2);$c([k({type:String,required:!0})],_i.prototype,"keyName",2);_i=$c([O],_i);var Qk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.isVisible?t("div",[t("small",[e._v(e._s(e.formatValue))])]):e._e()},eA=[];const Gg={};var tA=N(_i,Qk,eA,!1,sA,null,null,null);function sA(e){for(let s in Gg)this[s]=Gg[s]}const rA=function(){return tA.exports}();var iA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",e._l(e.additionalValues,function(r){return t(rA,{key:r,attrs:{"printer-object":e.printerObject,"object-name":e.objectName,"key-name":r}})}),1)},nA=[];const zg={};var aA=N(jn,iA,nA,!1,oA,null,null,null);function oA(e){for(let s in zg)this[s]=zg[s]}const lA=function(){return aA.exports}();var cA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("tr",[t("td",{staticClass:"icon"},[t(v,{class:e.iconClass,attrs:{color:e.iconColor,tabindex:"-1"},on:{click:function(r){e.showEditDialog=!0}}},[e._v(" "+e._s(e.icon)+" ")])],1),t("td",{staticClass:"name"},[t("span",{staticClass:"cursor-pointer",on:{click:function(r){e.showEditDialog=!0}}},[e._v(e._s(e.formatName))])]),e.isResponsiveMobile?e._e():t("td",{staticClass:"state"},[e.state!==null?t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("div",e._g(e._b({},"div",n,!1),i),[e._v(e._s(e.formatState))])]}}],null,!1,938967334)},[t("span",[e._v(e._s(e.$t("Panels.TemperaturePanel.Avg"))+": "+e._s(e.avgState)+" %")])]):e._e()],1),t("td",{staticClass:"current"},[t(pe,{attrs:{top:"",disabled:!(e.measured_min_temp!==null||e.measured_max_temp!==null)},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({staticStyle:{cursor:"default"}},"span",n,!1),i),[e._v(" "+e._s(e.formatTemperature)+" ")])]}}])},[t("span",[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Max"))+": "+e._s(e.measured_max_temp)+"°C "),t("br"),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Min"))+": "+e._s(e.measured_min_temp)+"°C ")])]),e.rpm!==null?t("div",[t("small",{class:e.rpmClass},[e._v(e._s(e.rpm)+" RPM")])]):e._e(),e.additionalSensorName?t(lA,{attrs:{"object-name":e.objectName,"additional-object-name":e.additionalSensorName}}):e._e()],1),t("td",{staticClass:"target"},[e.command!==null?t(Cy,{attrs:{name:e.name,target:e.target,presets:e.presets,min_temp:e.min_temp,max_temp:e.max_temp,command:e.command,"attribute-name":e.commandAttributeName}}):e._e()],1),t(Py,{attrs:{"bool-show":e.showEditDialog,"object-name":e.objectName,name:e.name,"format-name":e.formatName,"additional-sensor-name":e.additionalSensorName,icon:e.icon,color:e.color},on:{"close-dialog":function(r){e.showEditDialog=!1}}})],1)},uA=[];const Zg={};var dA=N(Hn,cA,uA,!1,hA,"8977b3c0",null,null);function hA(e){for(let s in Zg)this[s]=Zg[s]}const hu=function(){return dA.exports}();var pA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Qe,{attrs:{breakpoints:{mobile:function(r){return r.width<=395}}},scopedSlots:e._u([{key:"default",fn:function(r){var i,n=r.el;return[t(dp,{staticClass:"temperature-panel-table"},[t("thead",[t("tr",[t("th",{staticClass:"icon"},[e._v(" ")]),t("th",{staticClass:"name"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Name")))]),n.is.mobile?e._e():t("th",{staticClass:"state"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.State"))+" ")]),t("th",{staticClass:"current"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Current"))+" ")]),t("th",{staticClass:"target"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Target"))+" ")])])]),t("tbody",[e._l(e.heaterObjects,function(a){var o;return t(hu,{key:a,attrs:{"object-name":a,"is-responsive-mobile":(o=n.is.mobile)!==null&&o!==void 0?o:!1}})}),e.existsNevermoreFilter?t(Ty,{attrs:{"is-responsive-mobile":(i=n.is.mobile)!==null&&i!==void 0?i:!1}}):e._e(),e._l(e.temperature_sensors,function(a){var o;return t(hu,{key:a,attrs:{"object-name":a,"is-responsive-mobile":(o=n.is.mobile)!==null&&o!==void 0?o:!1}})}),e.hideMonitors?e._e():e._l(e.monitors,function(a){var o;return t(hu,{key:a,attrs:{"object-name":a,"is-responsive-mobile":(o=n.is.mobile)!==null&&o!==void 0?o:!1}})})],2)])]}}])})},mA=[];const qg={};var fA=N(Dd,pA,mA,!1,gA,"080ca807",null,null);function gA(e){for(let s in qg)this[s]=qg[s]}const vA=function(){return fA.exports}();var _A=Object.defineProperty,bA=Object.getOwnPropertyDescriptor,yA=(e,s,t,r)=>{for(var i=r>1?void 0:r?bA(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&_A(s,t,i),i};let Md=class extends j(V){constructor(){super(...arguments),this.mdiCog=Us}get boolTempchart(){var e;return(e=this.$store.state.gui.view.tempchart.boolTempchart)!=null?e:!1}set boolTempchart(e){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.boolTempchart",value:e})}get autoscaleTempchart(){var e;return(e=this.$store.state.gui.view.tempchart.autoscale)!=null?e:!1}set autoscaleTempchart(e){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.autoscale",value:e})}get hideMcuHostSensors(){var e;return(e=this.$store.state.gui.view.tempchart.hideMcuHostSensors)!=null?e:!1}set hideMcuHostSensors(e){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.hideMcuHostSensors",value:e})}get hideMonitors(){var e;return(e=this.$store.state.gui.view.tempchart.hideMonitors)!=null?e:!1}set hideMonitors(e){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.hideMonitors",value:e})}};Md=yA([O],Md);var CA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($e,{attrs:{"offset-y":!0,"close-on-content-click":!1,title:e.$t("Panels.TemperaturePanel.SetupTemperatures")},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.ShowChart")},model:{value:e.boolTempchart,callback:function(r){e.boolTempchart=r},expression:"boolTempchart"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.HideMcuHostSensors")},model:{value:e.hideMcuHostSensors,callback:function(r){e.hideMcuHostSensors=r},expression:"hideMcuHostSensors"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.HideMonitors")},model:{value:e.hideMonitors,callback:function(r){e.hideMonitors=r},expression:"hideMonitors"}})],1),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.AutoscaleChart")},model:{value:e.autoscaleTempchart,callback:function(r){e.autoscaleTempchart=r},expression:"autoscaleTempchart"}})],1)],1)],1)},$A=[];const Xg={};var xA=N(Md,CA,$A,!1,wA,null,null,null);function wA(e){for(let s in Xg)this[s]=Xg[s]}const SA=function(){return xA.exports}();var PA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(Z,{attrs:{icon:e.mdiThermometerLines,title:e.$t("Panels.TemperaturePanel.Headline"),collapsible:!0,"card-class":"temperature-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t($y),t(SA)]},proxy:!0}],null,!1,3208382191)},[t(q,{staticClass:"pa-0"},[t(vA),e.boolTempchart?[t(E,{staticClass:"my-0"}),t(yy)]:e._e()],2)],1):e._e()},TA=[];const Yg={};var DA=N(Td,PA,TA,!1,MA,null,null,null);function MA(e){for(let s in Yg)this[s]=Yg[s]}const EA=function(){return DA.exports}();var OA=Object.defineProperty,LA=Object.getOwnPropertyDescriptor,kA=(e,s,t,r)=>{for(var i=r>1?void 0:r?LA(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&OA(s,t,i),i};let cr=class extends j(V){convertUrl(e,s){var r,i,n,a,o,l,c,u;let t=new URL(e,this.hostUrl.toString());if(s!==null&&(t=new URL(e,s)),(e.startsWith("http")||e.startsWith("://"))&&(t=new URL(e)),e.startsWith("/webcam")){const d=[80];d.push((a=(n=(i=(r=this.$store.state.server.config)==null?void 0:r.config)==null?void 0:i.server)==null?void 0:n.port)!=null?a:7125),d.push((u=(c=(l=(o=this.$store.state.server.config)==null?void 0:o.config)==null?void 0:l.server)==null?void 0:c.ssl_port)!=null?u:7130),d.includes(this.hostPort)||(t.port=this.hostPort.toString())}return decodeURIComponent(t.toString())}convertWebcamIcon(e){switch(e){case"mdiAlbum":return TS;case"mdiCampfire":return IS;case"mdiDoor":return eP;case"mdiRadiatorDisabled":return d0;case"mdiPrinter3d":return ha;case"mdiPrinter3dNozzle":return Bs;case"mdiRaspberryPi":return LP;default:return ji}}generateTransform(e,s,t){let r="";return e&&(r+=" scaleX(-1)"),s&&(r+=" scaleY(-1)"),t===180&&(r+=" rotate(180deg)"),r.trimStart().length?r.trimStart():"none"}};cr=kA([O],cr);var AA=Object.defineProperty,FA=Object.getOwnPropertyDescriptor,Dy=(e,s,t,r)=>{for(var i=r>1?void 0:r?FA(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&AA(s,t,i),i};let Bo=class extends j(V,cr){constructor(){super(...arguments),this.mdiWebcam=ji,this.mdiMenuDown=hr,this.mdiViewGrid=pf}get webcams(){return this.$store.getters["gui/webcams/getWebcams"]}get showSwitch(){return this.webcams.length>1}get currentCamId(){var s,t,r,i;if(this.webcams.length===1)return(s=this.webcams[0].name)!=null?s:"all";let e=(r=this.$store.state.gui.view.webcam.currentCam[(t=this.currentPage)!=null?t:""])!=null?r:"all";return this.webcams.findIndex(n=>n.name===e)!==-1?e:e!==void 0&&this.webcams.length===1?(i=this.webcams[0].name)!=null?i:"":"all"}set currentCamId(e){this.$store.dispatch("gui/setCurrentWebcam",{page:this.currentPage,value:e})}get currentCam(){const e=this.webcams.find(s=>s.name===this.currentCamId);return e!=null?e:{name:this.$t("Panels.WebcamPanel.All"),service:"grid",icon:pf}}};Dy([k({default:"dashboard"})],Bo.prototype,"currentPage",2);Bo=Dy([O({components:{Panel:Z}})],Bo);function RA(e){switch(e){case"Hlsstreamer":return()=>he(()=>import("./Hlsstreamer-886899b4.js"),["assets/Hlsstreamer-886899b4.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/Hlsstreamer-f9f189cf.css"]);case"Ipstreamer":return()=>he(()=>import("./Ipstreamer-dd27a9e8.js"),["assets/Ipstreamer-dd27a9e8.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/Ipstreamer-f951d43b.css"]);case"JanusStreamer":return()=>he(()=>import("./JanusStreamer-1b43ec62.js"),["assets/JanusStreamer-1b43ec62.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/JanusStreamer-3206d816.css"]);case"JMuxerStream":return()=>he(()=>import("./JMuxerStream-7e36ed89.js"),["assets/JMuxerStream-7e36ed89.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/echarts-9bc570b0.js","assets/JMuxerStream-baf633f9.css"]);case"Mjpegstreamer":return()=>he(()=>import("./Mjpegstreamer-60c9a3d3.js"),["assets/Mjpegstreamer-60c9a3d3.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/Mjpegstreamer-c7e864b6.css"]);case"MjpegstreamerAdaptive":return()=>he(()=>import("./MjpegstreamerAdaptive-2e7c6467.js"),["assets/MjpegstreamerAdaptive-2e7c6467.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/MjpegstreamerAdaptive-33a0e59f.css"]);case"Uv4lMjpeg":return()=>he(()=>import("./Uv4lMjpeg-d2ae09fd.js"),["assets/Uv4lMjpeg-d2ae09fd.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/Uv4lMjpeg-486d8a68.css"]);case"WebrtcCameraStreamer":return()=>he(()=>import("./WebrtcCameraStreamer-1fb7b328.js"),["assets/WebrtcCameraStreamer-1fb7b328.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/WebrtcCameraStreamer-7e0e004c.css"]);case"WebrtcMediaMTX":return()=>he(()=>import("./WebrtcMediaMTX-d62a8a77.js"),["assets/WebrtcMediaMTX-d62a8a77.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/WebrtcMediaMTX-089db774.css"]);case"WebrtcGo2rtc":return()=>he(()=>import("./WebrtcGo2rtc-ddbe76a4.js"),["assets/WebrtcGo2rtc-ddbe76a4.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/WebrtcGo2rtc-4ca7d296.css"])}}const hs=e=>y.component(e,RA(e));var IA=Object.defineProperty,HA=Object.getOwnPropertyDescriptor,xc=(e,s,t,r)=>{for(var i=r>1?void 0:r?HA(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&IA(s,t,i),i};let bi=class extends j(V){get service(){var e,s;return(s=(e=this.webcam)==null?void 0:e.service)!=null?s:"unknown"}};xc([k({type:Object,required:!0})],bi.prototype,"webcam",2);xc([k({type:Boolean,default:!0})],bi.prototype,"showFps",2);xc([k({default:null})],bi.prototype,"printerUrl",2);bi=xc([O({components:{HlsstreamerAsync:hs("Hlsstreamer"),IpstreamerAsync:hs("Ipstreamer"),JanusStreamerAsync:hs("JanusStreamer"),JMuxerStreamAsync:hs("JMuxerStream"),MjpegstreamerAsync:hs("Mjpegstreamer"),MjpegstreamerAdaptiveAsync:hs("MjpegstreamerAdaptive"),Uv4lMjpegAsync:hs("Uv4lMjpeg"),WebrtcCameraStreamerAsync:hs("WebrtcCameraStreamer"),WebrtcMediaMTXAsync:hs("WebrtcMediaMTX"),WebrtcGo2rtcAsync:hs("WebrtcGo2rtc")}})],bi);var jA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.service==="mjpegstreamer"?[t("mjpegstreamer-async",{attrs:{"cam-settings":e.webcam,"show-fps":e.showFps,"printer-url":e.printerUrl}})]:e.service==="mjpegstreamer-adaptive"?[t("mjpegstreamer-adaptive-async",{attrs:{"cam-settings":e.webcam,"show-fps":e.showFps,"printer-url":e.printerUrl}})]:e.service==="uv4l-mjpeg"?[t("uv4l-mjpeg-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="ipstream"?[t("ipstreamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="hlsstream"?[t("hlsstreamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="jmuxer-stream"?[t("j-muxer-stream-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-camerastreamer"?[t("webrtc-camera-streamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-janus"?[t("janus-streamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-mediamtx"?[t("webrtc-media-m-t-x-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-go2rtc"?[t("webrtc-go2rtc-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:[t("p",{staticClass:"text-center py-3 font-italic"},[e._v(e._s(e.$t("Panels.WebcamPanel.UnknownWebcamService")))])]],2)},NA=[];const Jg={};var VA=N(bi,jA,NA,!1,UA,null,null,null);function UA(e){for(let s in Jg)this[s]=Jg[s]}const Ed=function(){return VA.exports}();var BA=Object.defineProperty,WA=Object.getOwnPropertyDescriptor,wc=(e,s,t,r)=>{for(var i=r>1?void 0:r?WA(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&BA(s,t,i),i};let yi=class extends j(V){get webcams(){return this.$store.getters["gui/webcams/getWebcams"]}};wc([k({type:Object,required:!0})],yi.prototype,"webcam",2);wc([k({type:Boolean,default:!0})],yi.prototype,"showFps",2);wc([k({type:String,default:null})],yi.prototype,"printerUrl",2);yi=wc([O({components:{WebcamWrapperItem:Ed}})],yi);var GA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.webcam.service==="grid"?[e.webcams?t(ke,{staticClass:"pb-4",attrs:{fluid:""}},[t(S,{attrs:{dense:""}},e._l(e.webcams,function(r){return t(_,{key:r.name,attrs:{cols:"6"}},[t(Ed,{attrs:{webcam:r,"printer-url":e.printerUrl,"show-fps":e.showFps}})],1)}),1)],1):e._e()]:[t(Ed,{attrs:{webcam:e.webcam,"printer-url":e.printerUrl,"show-fps":e.showFps}})]],2)},zA=[];const Kg={};var ZA=N(yi,GA,zA,!1,qA,null,null,null);function qA(e){for(let s in Kg)this[s]=Kg[s]}const Sc=function(){return ZA.exports}();var XA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.socketIsConnected?t(Z,{attrs:{icon:e.mdiWebcam,title:e.$t("Panels.WebcamPanel.Headline"),collapsible:e.$route.fullPath!=="/cam","card-class":"webcam-panel","margin-bottom":e.currentPage!=="page"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showSwitch?t($e,{attrs:{"offset-y":!0},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{text:"",tile:""}},"v-btn",n,!1),i),["icon"in e.currentCam?t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(" "+e._s(e.convertWebcamIcon(e.currentCam.icon))+" ")]):e._e(),t("span",{staticClass:"d-none d-md-block"},[e._v(e._s("name"in e.currentCam?e.currentCam.name:"unknown"))]),t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,150688541)},[t(Oe,{staticClass:"py-0",attrs:{dense:""}},[t(K,{attrs:{link:""},on:{click:function(r){e.currentCamId="all"}}},[t(Rs,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiViewGrid))])],1),t(Gt,[t(rt,[e._v(e._s(e.$t("Panels.WebcamPanel.All")))])],1)],1),e._l(e.webcams,function(r){return t(K,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamId=r.name}}},[t(Rs,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(Gt,[t(rt,{domProps:{textContent:e._s(r.name)}})],1)],1)})],2)],1):e._e()]},proxy:!0}],null,!1,467766518)},[e.webcams.length?t(q,{staticClass:"px-0 py-0 content d-inline-block"},[t(S,[t(_,{staticClass:"pb-0",staticStyle:{position:"relative"}},[t(Sc,{attrs:{webcam:e.currentCam}})],1)],1)],1):t(q,[t("p",{staticClass:"text-center mb-0 text--disabled"},[e._v(e._s(e.$t("Panels.WebcamPanel.NoWebcam")))])])],1):e._e()},YA=[];const Qg={};var JA=N(Bo,XA,YA,!1,KA,null,null,null);function KA(e){for(let s in Qg)this[s]=Qg[s]}const tm=function(){return JA.exports}();var QA=Object.defineProperty,eF=Object.getOwnPropertyDescriptor,tF=(e,s,t,r)=>{for(var i=r>1?void 0:r?eF(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&QA(s,t,i),i};let Od=class extends j(Is){get mobileLayout(){return this.$store.getters["gui/getPanels"]("mobile",0,!0)}get tabletLayout1(){return this.$store.getters["gui/getPanels"]("tablet",1,!0)}get tabletLayout2(){return this.$store.getters["gui/getPanels"]("tablet",2,!0)}get desktopLayout1(){return this.$store.getters["gui/getPanels"]("desktop",1,!0)}get desktopLayout2(){return this.$store.getters["gui/getPanels"]("desktop",2,!0)}get widescreenLayout1(){return this.$store.getters["gui/getPanels"]("widescreen",1,!0)}get widescreenLayout2(){return this.$store.getters["gui/getPanels"]("widescreen",2,!0)}get widescreenLayout3(){return this.$store.getters["gui/getPanels"]("widescreen",3,!0)}extractPanelName(e){return e.split("_")[0]+"-panel"}extractPanelId(e){var s;return(s=e.split("_")[1])!=null?s:null}};Od=tF([O({components:{ExtruderControlPanel:e5,KlippyStatePanel:ma,MachineSettingsPanel:N5,MacrogroupPanel:Z5,MacrosPanel:tM,MiniconsolePanel:PM,MinSettingsPanel:jp,MiscellaneousPanel:XE,SpoolmanPanel:kO,StatusPanel:ln,ToolheadControlPanel:UL,TemperaturePanel:EA,WebcamPanel:tm}})],Od);var sF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.isMobile?t(S,[t(_,[t(ln),e._l(e.mobileLayout,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-mobileLayout-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isTablet?t(S,[t(_,{staticClass:"col-6"},[t(ln),e._l(e.tabletLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-tabletLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(_,{staticClass:"col-6"},[e._l(e.tabletLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-tabletLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isDesktop?t(S,[t(_,{staticClass:"col-5"},[t(ln),e._l(e.desktopLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(_,{staticClass:"col-7"},[e._l(e.desktopLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isWidescreen?t(S,[t(_,{staticClass:"col-3"},[t(ln),e._l(e.widescreenLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(_,{staticClass:"col-5"},[e._l(e.widescreenLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(_,{staticClass:"col-4"},[e._l(e.widescreenLayout3,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout3-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e._e()],1)},rF=[];const e1={};var iF=N(Od,sF,rF,!1,nF,null,null,null);function nF(e){for(let s in e1)this[s]=e1[s]}const aF=function(){return iF.exports}();var oF=Object.defineProperty,lF=Object.getOwnPropertyDescriptor,cF=(e,s,t,r)=>{for(var i=r>1?void 0:r?lF(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&oF(s,t,i),i};let Ld=class extends j(V){};Ld=cF([O({components:{WebcamPanel:tm}})],Ld);var uF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,[t(_,{attrs:{"col-12":""}},[t(tm,{attrs:{"current-page":"page"}})],1)],1)],1)},dF=[];const t1={};var hF=N(Ld,uF,dF,!1,pF,null,null,null);function pF(e){for(let s in t1)this[s]=t1[s]}const mF=function(){return hF.exports}();var fF=Object.defineProperty,gF=Object.getOwnPropertyDescriptor,Pc=(e,s,t,r)=>{for(var i=r>1?void 0:r?gF(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&fF(s,t,i),i};let Ci=class extends j(V,kt,cr){constructor(){super(...arguments),this.mdiPrinter3d=ha,this.mdiWebcam=ji,this.mdiMenuDown=hr,this.mdiWebcamOff=JP,this.mdiFileOutline=qb,this.imageHeight=200}get printerUrl(){let t=window.location.href.split("/")[0]+"//"+this.printer.socket.hostname;return this.printer.socket.webPort!==80&&(t+=":"+this.printer.socket.webPort),t}get isCurrentPrinter(){return this.$store.getters["farm/"+this.printer._namespace+"/isCurrentPrinter"]}get currentCamName(){return this.$store.getters["farm/"+this.printer._namespace+"/getSetting"]("currentCamName","off")}set currentCamName(e){this.$store.dispatch("farm/"+this.printer._namespace+"/setSettings",{currentCamName:e})}get printer_name(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterName"]}get printer_status(){return this.$store.getters["farm/"+this.printer._namespace+"/getStatus"]}get printer_current_filename(){return this.$store.getters["farm/"+this.printer._namespace+"/getCurrentFilename"]}get printer_image(){var e;return this.currentWebcam?this.sidebarBgImage:(e=this.$store.getters["farm/"+this.printer._namespace+"/getImage"])!=null?e:this.sidebarBgImage}get printer_logo(){return this.$store.getters["farm/"+this.printer._namespace+"/getLogo"]}get printerLogoColor(){return this.$store.getters["farm/"+this.printer._namespace+"/getLogoColor"]}get printer_position(){return this.$store.getters["farm/"+this.printer._namespace+"/getPosition"]}get printer_preview(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterPreview"]}get showWebcamSwitch(){return this.printer_webcams.length==0?!1:this.printer.socket.isConnected}get printer_webcams(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterWebcams"]}get currentWebcam(){var s;const e=(s=this.printer_webcams)==null?void 0:s.find(t=>t.name===this.currentCamName);return e||null}get panelClass(){let e=[];return!this.printer.socket.isConnected&&!this.printer.socket.isConnecting&&e.push("disabledPrinter"),e}clickPrinter(){this.printer.socket.isConnected?this.$store.dispatch("changePrinter",{printer:this.printer._namespace}):this.$store.dispatch("farm/"+this.printer._namespace+"/reconnect")}mounted(){this.calcImageHeight()}calcImageHeight(){var e,s;if((s=(e=this.imageDiv)==null?void 0:e.$el)!=null&&s.clientWidth){this.imageHeight=Math.round(this.imageDiv.$el.clientWidth/3*2);return}this.imageHeight=200}handleResize(){this.$nextTick(()=>{this.calcImageHeight()})}};Pc([k({type:Object,required:!0})],Ci.prototype,"printer",2);Pc([Eb()],Ci.prototype,"imageDiv",2);Pc([Ze(200)],Ci.prototype,"handleResize",1);Ci=Pc([O({components:{Panel:Z,"webcam-wrapper":Sc,"mainsail-logo":Ni}})],Ci);var vF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Z,{class:e.panelClass,attrs:{icon:e.mdiPrinter3d,title:e.printer_name,"card-class":"farmprinter-panel",loading:e.printer.socket.isConnecting,"toolbar-color":e.isCurrentPrinter?"primary":""},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showWebcamSwitch?t($e,{attrs:{"offset-y":!0,title:"Webcam"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{text:""}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiWebcam))]),t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,505444931)},[t(Oe,{staticClass:"py-0",attrs:{dense:""}},[t(K,{attrs:{link:""},on:{click:function(r){e.currentCamName="off"}}},[t(Rs,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiWebcamOff))])],1),t(Gt,[t(rt,[e._v(e._s(e.$t("Panels.FarmPrinterPanel.WebcamOff")))])],1)],1),e._l(e.printer_webcams,function(r){return t(K,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamName=r.name}}},[t(Rs,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(Gt,[t(rt,{domProps:{textContent:e._s(r.name)}})],1)],1)})],2)],1):e._e()]},proxy:!0}])},[t(Yx,{scopedSlots:e._u([{key:"default",fn:function(r){var i=r.hover;return[t("div",[t(Vl,{ref:"imageDiv",staticClass:"d-flex align-end",attrs:{height:e.imageHeight,src:e.printer_image}},[e.printer.socket.isConnected&&e.currentCamName!=="off"&&e.currentWebcam&&"service"in e.currentWebcam?t("div",{staticClass:"webcamContainer"},[t(Sc,{attrs:{webcam:e.currentWebcam,"printer-url":e.printerUrl,"show-fps":!1}})],1):e._e(),t(vt,{staticClass:"white--text py-2",staticStyle:{"background-color":"rgba(0, 0, 0, 0.3)","backdrop-filter":"blur(3px)"}},[t(S,[t(_,{staticClass:"col-auto pr-0 d-flex align-center",staticStyle:{width:"58px"}},[e.printer_logo?t("img",{staticClass:"my-auto",staticStyle:{width:"100%"},attrs:{src:e.printer_logo,alt:"Logo"}}):t(Ni,{staticClass:"my-auto",staticStyle:{width:"100%"},attrs:{color:e.printerLogoColor}})],1),t(_,{staticClass:"col",staticStyle:{width:"100px"}},[t("h3",{staticClass:"font-weight-regular"},[e._v(e._s(e.printer_status))]),e.printer_current_filename!==""?t("span",{staticClass:"subtitle-2 text-truncate px-0 text--disabled d-block"},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.printer_current_filename)+" ")],1):e._e()])],1)],1)],1),e.printer_preview.length?t(q,{staticClass:"px-0 py-2"},[t(ke,{staticClass:"py-0"},[t(S,e._l(e.printer_preview,function(n){return t(_,{key:n.name,class:n.name==="ETA"?"col-auto":"col px-2"},[t("strong",{staticClass:"d-block text-center"},[e._v(e._s(n.name))]),t("span",{staticClass:"d-block text-center"},[e._v(e._s(n.value))])])}),1)],1)],1):e._e(),t(Jx,[i?t(Kx,{attrs:{absolute:"","z-index":4}},[t(g,{attrs:{color:"primary"},on:{click:e.clickPrinter}},[e._v(" "+e._s(e.printer.socket.isConnected?e.$t("Panels.FarmPrinterPanel.SwitchToPrinter"):e.$t("Panels.FarmPrinterPanel.ReconnectToPrinter"))+" ")])],1):e._e()],1)],1)]}}])}),t("resize-observer",{on:{notify:e.handleResize}})],1)},_F=[];const s1={};var bF=N(Ci,vF,_F,!1,yF,"a9292318",null,null);function yF(e){for(let s in s1)this[s]=s1[s]}const My=function(){return bF.exports}();var CF=Object.defineProperty,$F=Object.getOwnPropertyDescriptor,xF=(e,s,t,r)=>{for(var i=r>1?void 0:r?$F(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&CF(s,t,i),i};let kd=class extends j(V){get printers(){return this.$store.getters["farm/getPrinters"]}};kd=xF([O({components:{FarmPrinterPanel:My}})],kd);var wF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,e._l(e.printers,function(r,i){return t(_,{key:i,staticClass:"col-12 col-sm-6 col-md-4 pb-0"},[t(My,{attrs:{printer:r}})],1)}),1)},SF=[];const r1={};var PF=N(kd,wF,SF,!1,TF,null,null,null);function TF(e){for(let s in r1)this[s]=r1[s]}const DF=function(){return PF.exports}();var MF=Object.defineProperty,EF=Object.getOwnPropertyDescriptor,sm=(e,s,t,r)=>{for(var i=r>1?void 0:r?EF(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&MF(s,t,i),i};let Nn=class extends j(V){constructor(){super(...arguments),this.gcode="",this.lastCommandNumber=null,this.items=[],this.mdiChevronDoubleRight=Ub,this.mdiSend=h0,this.mdiCog=Us,this.mdiTrashCan=y0}get helplist(){var e;return(e=this.$store.state.printer.helplist)!=null?e:[]}get consoleDirection(){var e;return(e=this.$store.state.gui.console.direction)!=null?e:"table"}get events(){return this.$store.getters["server/getConsoleEvents"](this.consoleDirection==="table")}eventsChanged(){this.consoleDirection==="shell"&&this.autoscroll&&setTimeout(()=>{this.scrollToBottom()},50)}autoscrollChanged(e){e&&this.scrollToBottom()}get hideWaitTemperatures(){return this.$store.state.gui.console.hideWaitTemperatures}set hideWaitTemperatures(e){this.$store.dispatch("gui/saveSetting",{name:"console.hideWaitTemperatures",value:e})}clearConsole(){this.$store.dispatch("gui/console/clear")}get hideTlCommands(){return this.$store.state.gui.console.hideWaitTemperatures}set hideTlCommands(e){this.$store.dispatch("gui/saveSetting",{name:"console.hideTlCommands",value:e})}get rows(){var e,s;return(s=(e=this.gcode)==null?void 0:e.split("\n").length)!=null?s:1}get customFilters(){return this.$store.state.gui.console.consolefilters}get lastCommands(){var e;return(e=this.$store.state.gui.gcodehistory.entries)!=null?e:[]}get autoscroll(){var e;return(e=this.$store.state.gui.console.autoscroll)!=null?e:!0}set autoscroll(e){this.$store.dispatch("gui/saveSetting",{name:"console.autoscroll",value:e})}commandClick(e){this.gcode=e,this.$nextTick(()=>{this.$refs.gcodeCommandField.focus()})}doSend(e){e.shiftKey?this.gcode+="\n":this.gcode!==""&&(this.$store.dispatch("printer/sendGcode",this.gcode),this.$store.dispatch("gui/gcodehistory/addToHistory",this.gcode),this.gcode="",this.lastCommandNumber=null,setTimeout(()=>{this.$refs.console.$el.scroll({top:0,left:0,behavior:"smooth"})},20))}onKeyUp(){this.lastCommandNumber===null&&this.lastCommands.length?(this.lastCommandNumber=this.lastCommands.length-1,this.gcode=this.lastCommands[this.lastCommandNumber]):this.lastCommandNumber&&this.lastCommandNumber>0&&(this.lastCommandNumber--,this.gcode=this.lastCommands[this.lastCommandNumber])}onKeyDown(){this.lastCommandNumber!==null&&this.lastCommandNumber-1?r.indexOf("\n",a)-1:Number.MAX_SAFE_INTEGER;this.rows>1&&(s=r.substr(a,o-a));let l=this.helplist.filter(c=>c.commandLow.startsWith(s.toLowerCase()));if((l==null?void 0:l.length)===1)this.rows>1?this.gcode=this.gcode.replace(s,l[0].command):this.gcode=l[0].command;else if((l==null?void 0:l.length)>1){let c=this.helplist.filter(u=>u.commandLow.startsWith(s.toLowerCase()));if(this.rows>1?this.gcode=this.gcode.replace(s,c.reduce((u,d)=>So(u,d.command),c[0].command)):this.gcode=c.reduce((u,d)=>So(u,d.command),c[0].command),c&&c.length){let u="";c.forEach(d=>u+=""+d.command+": "+d.description+"
"),this.$store.dispatch("server/addEvent",{message:u,type:"autocomplete"})}}}this.$refs.gcodeCommandField.focus()}toggleFilter(e){this.$store.dispatch("gui/updateConsoleFilter",e)}mounted(){this.consoleDirection==="shell"&&this.scrollToBottom()}scrollToBottom(){this.$nextTick(()=>{if(this.$refs.consoleScroll){const e=this.$refs.consoleScroll.osInstance();e==null||e.scroll({y:"100%"})}})}};sm([me("events")],Nn.prototype,"eventsChanged",1);sm([me("autoscroll")],Nn.prototype,"autoscrollChanged",1);Nn=sm([O({components:{CommandHelpModal:oc,ConsoleTable:nc}})],Nn);var OF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"d-flex flex-column"},[t(S,{class:e.consoleDirection==="table"?"order-0":"order-1 mt-3"},[t(_,[t(Ai,{ref:"gcodeCommandField",staticClass:"gcode-command-field",attrs:{items:e.items,label:e.$t("Console.SendCode"),solo:"",autocomplete:"off","no-resize":"","auto-grow":"",rows:e.rows,"hide-details":"",outlined:"",dense:"","prepend-icon":e.isTouchDevice?e.mdiChevronDoubleRight:"","append-icon":e.mdiSend},on:{keydown:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),r.stopPropagation(),e.doSend.apply(null,arguments))},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"tab",9,r.key,"Tab")?null:e.getAutocomplete.apply(null,arguments)}],keyup:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"up",38,r.key,["Up","ArrowUp"])?null:e.onKeyUp.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"down",40,r.key,["Down","ArrowDown"])?null:e.onKeyDown.apply(null,arguments)}],"click:prepend":e.getAutocomplete,"click:append":e.doSend},model:{value:e.gcode,callback:function(r){e.gcode=r},expression:"gcode"}})],1),t(_,{staticClass:"col-auto d-flex align-center"},[t(g,{staticClass:"mr-3 px-2 minwidth-0",attrs:{color:"lightgray"},on:{click:e.clearConsole}},[t(v,[e._v(e._s(e.mdiTrashCan))])],1),t(oc,{on:{onCommand:function(r){e.gcode=r}}}),t($e,{attrs:{"offset-y":"",top:e.consoleDirection==="shell","close-on-content-click":!1,title:e.$t("Console.SetupConsole")},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"ml-3 px-2 minwidth-0",attrs:{color:"lightgray"}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[e.consoleDirection==="shell"?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.Autoscroll")},model:{value:e.autoscroll,callback:function(r){e.autoscroll=r},expression:"autoscroll"}})],1):e._e(),t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Console.HideTemperatures")},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?t(K,{staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Console.HideTimelapse")},model:{value:e.hideTlCommands,callback:function(r){e.hideTlCommands=r},expression:"hideTlCommands"}})],1):e._e(),e._l(e.customFilters,function(r,i){return t(K,{key:i,staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.name},on:{change:function(n){return e.toggleFilter(r)}},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"filter.bool"}})],1)})],2)],1)],1)],1),t(S,{class:e.consoleDirection==="table"?"order-1":"order-0 mt-0"},[t(_,{class:e.consoleDirection==="table"?"col":"col pt-0"},[t(De,[t(q,{staticClass:"pa-0"},[t("overlay-scrollbars",{ref:"consoleScroll",staticClass:"consoleScrollContainer d-flex flex-column"},[t(nc,{ref:"console",attrs:{"is-mini":!1,events:e.events},on:{"command-click":e.commandClick}})],1)],1)],1)],1)],1)],1)},LF=[];const i1={};var kF=N(Nn,OF,LF,!1,AF,"546b63d4",null,null);function AF(e){for(let s in i1)this[s]=i1[s]}const FF=function(){return kF.exports}();var Ey={exports:{}};/**! - * Sortable 1.10.2 - * @author RubaXa - * @author owenm - * @license MIT - */function Xa(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xa=function(s){return typeof s}:Xa=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Xa(e)}function RF(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function qt(){return qt=Object.assign||function(e){for(var s=1;s=0)&&(t[i]=e[i]);return t}function HF(e,s){if(e==null)return{};var t=IF(e,s),r,i;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function jF(e){return NF(e)||VF(e)||UF()}function NF(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s"&&(s=s.substring(1)),e)try{if(e.matches)return e.matches(s);if(e.msMatchesSelector)return e.msMatchesSelector(s);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(s)}catch{return!1}return!1}}function GF(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ts(e,s,t,r){if(e){t=t||document;do{if(s!=null&&(s[0]===">"?e.parentNode===t&&Wo(e,s):Wo(e,s))||r&&e===t)return e;if(e===t)break}while(e=GF(e))}return null}var a1=/\s+/g;function Ne(e,s,t){if(e&&s)if(e.classList)e.classList[t?"add":"remove"](s);else{var r=(" "+e.className+" ").replace(a1," ").replace(" "+s+" "," ");e.className=(r+(t?" "+s:"")).replace(a1," ")}}function ue(e,s,t){var r=e&&e.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),s===void 0?t:t[s];!(s in r)&&s.indexOf("webkit")===-1&&(s="-webkit-"+s),r[s]=t+(typeof t=="string"?"":"px")}}function Mr(e,s){var t="";if(typeof e=="string")t=e;else do{var r=ue(e,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!s&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function ky(e,s,t){if(e){var r=e.getElementsByTagName(s),i=0,n=r.length;if(t)for(;i=n:a=i<=n,!a)return r;if(r===vs())break;r=er(r,!1)}return!1}function Go(e,s,t){for(var r=0,i=0,n=e.children;i2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,n=HF(r,["evt"]);ba.pluginEvent.bind(fe)(s,t,ur({dragEl:ie,parentEl:qe,ghostEl:_e,rootEl:je,nextEl:yr,lastDownEl:Ya,cloneEl:Be,cloneHidden:Ys,dragStarted:un,putSortable:ut,activeSortable:fe.active,originalEvent:i,oldIndex:ti,oldDraggableIndex:vn,newIndex:Ht,newDraggableIndex:Xs,hideGhostForTarget:jy,unhideGhostForTarget:Ny,cloneNowHidden:function(){Ys=!0},cloneNowShown:function(){Ys=!1},dispatchSortableEvent:function(o){bt({sortable:t,name:o,originalEvent:i})}},n))};function bt(e){cn(ur({putSortable:ut,cloneEl:Be,targetEl:ie,rootEl:je,oldIndex:ti,oldDraggableIndex:vn,newIndex:Ht,newDraggableIndex:Xs},e))}var ie,qe,_e,je,yr,Ya,Be,Ys,ti,Ht,vn,Xs,La,ut,Qr=!1,zo=!1,Zo=[],vr,Jt,gu,vu,u1,d1,un,Zr,_n,bn=!1,ka=!1,Ja,mt,_u=[],Fd=!1,qo=[],Tc=typeof document<"u",Aa=Oy,h1=_a||zs?"cssFloat":"float",KF=Tc&&!WF&&!Oy&&"draggable"in document.createElement("div"),Ry=function(){if(Tc){if(zs)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Iy=function(s,t){var r=ue(s),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),n=Go(s,0,t),a=Go(s,1,t),o=n&&ue(n),l=a&&ue(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Ge(n).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ge(a).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&o.float&&o.float!=="none"){var d=o.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return n&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||c>=i&&r[h1]==="none"||a&&r[h1]==="none"&&c+u>i)?"vertical":"horizontal"},QF=function(s,t,r){var i=r?s.left:s.top,n=r?s.right:s.bottom,a=r?s.width:s.height,o=r?t.left:t.top,l=r?t.right:t.bottom,c=r?t.width:t.height;return i===o||n===l||i+a/2===o+c/2},e9=function(s,t){var r;return Zo.some(function(i){if(!rm(i)){var n=Ge(i),a=i[ft].options.emptyInsertThreshold,o=s>=n.left-a&&s<=n.right+a,l=t>=n.top-a&&t<=n.bottom+a;if(a&&o&&l)return r=i}}),r},Hy=function(s){function t(n,a){return function(o,l,c,u){var d=o.options.group.name&&l.options.group.name&&o.options.group.name===l.options.group.name;if(n==null&&(a||d))return!0;if(n==null||n===!1)return!1;if(a&&n==="clone")return n;if(typeof n=="function")return t(n(o,l,c,u),a)(o,l,c,u);var h=(a?o:l).options.group.name;return n===!0||typeof n=="string"&&n===h||n.join&&n.indexOf(h)>-1}}var r={},i=s.group;(!i||Xa(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,s.group=r},jy=function(){!Ry&&_e&&ue(_e,"display","none")},Ny=function(){!Ry&&_e&&ue(_e,"display","")};Tc&&document.addEventListener("click",function(e){if(zo)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),zo=!1,!1},!0);var _r=function(s){if(ie){s=s.touches?s.touches[0]:s;var t=e9(s.clientX,s.clientY);if(t){var r={};for(var i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[ft]._onDragOver(r)}}},t9=function(s){ie&&ie.parentNode[ft]._isOutsideThisEl(s.target)};function fe(e,s){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=s=qt({},s),e[ft]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Iy(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:fe.supportPointer!==!1&&"PointerEvent"in window,emptyInsertThreshold:5};ba.initializePlugins(this,e,t);for(var r in t)!(r in s)&&(s[r]=t[r]);Hy(s);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=s.forceFallback?!1:KF,this.nativeDraggable&&(this.options.touchStartThreshold=1),s.supportPointer?Pe(e,"pointerdown",this._onTapStart):(Pe(e,"mousedown",this._onTapStart),Pe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Pe(e,"dragover",this),Pe(e,"dragenter",this)),Zo.push(this.el),s.store&&s.store.get&&this.sort(s.store.get(this)||[]),qt(this,XF())}fe.prototype={constructor:fe,_isOutsideThisEl:function(s){!this.el.contains(s)&&s!==this.el&&(Zr=null)},_getDirection:function(s,t){return typeof this.options.direction=="function"?this.options.direction.call(this,s,t,ie):this.options.direction},_onTapStart:function(s){if(s.cancelable){var t=this,r=this.el,i=this.options,n=i.preventOnFilter,a=s.type,o=s.touches&&s.touches[0]||s.pointerType&&s.pointerType==="touch"&&s,l=(o||s).target,c=s.target.shadowRoot&&(s.path&&s.path[0]||s.composedPath&&s.composedPath()[0])||l,u=i.filter;if(l9(r),!ie&&!(/mousedown|pointerdown/.test(a)&&s.button!==0||i.disabled)&&!c.isContentEditable&&(l=ts(l,i.draggable,r,!1),!(l&&l.animated)&&Ya!==l)){if(ti=We(l),vn=We(l,i.draggable),typeof u=="function"){if(u.call(this,s,l,this)){bt({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),Mt("filter",t,{evt:s}),n&&s.cancelable&&s.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=ts(c,d.trim(),r,!1),d)return bt({sortable:t,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),Mt("filter",t,{evt:s}),!0}),u)){n&&s.cancelable&&s.preventDefault();return}i.handle&&!ts(c,i.handle,r,!1)||this._prepareDragStart(s,o,l)}}},_prepareDragStart:function(s,t,r){var i=this,n=i.el,a=i.options,o=n.ownerDocument,l;if(r&&!ie&&r.parentNode===n){var c=Ge(r);if(je=n,ie=r,qe=ie.parentNode,yr=ie.nextSibling,Ya=r,La=a.group,fe.dragged=ie,vr={target:ie,clientX:(t||s).clientX,clientY:(t||s).clientY},u1=vr.clientX-c.left,d1=vr.clientY-c.top,this._lastX=(t||s).clientX,this._lastY=(t||s).clientY,ie.style["will-change"]="all",l=function(){if(Mt("delayEnded",i,{evt:s}),fe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!n1&&i.nativeDraggable&&(ie.draggable=!0),i._triggerDragStart(s,t),bt({sortable:i,name:"choose",originalEvent:s}),Ne(ie,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){ky(ie,u.trim(),yu)}),Pe(o,"dragover",_r),Pe(o,"mousemove",_r),Pe(o,"touchmove",_r),Pe(o,"mouseup",i._onDrop),Pe(o,"touchend",i._onDrop),Pe(o,"touchcancel",i._onDrop),n1&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ie.draggable=!0),Mt("delayStart",this,{evt:s}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(_a||zs))){if(fe.eventCanceled){this._onDrop();return}Pe(o,"mouseup",i._disableDelayedDrag),Pe(o,"touchend",i._disableDelayedDrag),Pe(o,"touchcancel",i._disableDelayedDrag),Pe(o,"mousemove",i._delayedDragTouchMoveHandler),Pe(o,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Pe(o,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(s){var t=s.touches?s.touches[0]:s;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ie&&yu(ie),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var s=this.el.ownerDocument;xe(s,"mouseup",this._disableDelayedDrag),xe(s,"touchend",this._disableDelayedDrag),xe(s,"touchcancel",this._disableDelayedDrag),xe(s,"mousemove",this._delayedDragTouchMoveHandler),xe(s,"touchmove",this._delayedDragTouchMoveHandler),xe(s,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(s,t){t=t||s.pointerType=="touch"&&s,!this.nativeDraggable||t?this.options.supportPointer?Pe(document,"pointermove",this._onTouchMove):t?Pe(document,"touchmove",this._onTouchMove):Pe(document,"mousemove",this._onTouchMove):(Pe(ie,"dragend",this),Pe(je,"dragstart",this._onDragStart));try{document.selection?Ka(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(s,t){if(Qr=!1,je&&ie){Mt("dragStarted",this,{evt:t}),this.nativeDraggable&&Pe(document,"dragover",t9);var r=this.options;!s&&Ne(ie,r.dragClass,!1),Ne(ie,r.ghostClass,!0),fe.active=this,s&&this._appendGhost(),bt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Jt){this._lastX=Jt.clientX,this._lastY=Jt.clientY,jy();for(var s=document.elementFromPoint(Jt.clientX,Jt.clientY),t=s;s&&s.shadowRoot&&(s=s.shadowRoot.elementFromPoint(Jt.clientX,Jt.clientY),s!==t);)t=s;if(ie.parentNode[ft]._isOutsideThisEl(s),t)do{if(t[ft]){var r=void 0;if(r=t[ft]._onDragOver({clientX:Jt.clientX,clientY:Jt.clientY,target:s,rootEl:t}),r&&!this.options.dragoverBubble)break}s=t}while(t=t.parentNode);Ny()}},_onTouchMove:function(s){if(vr){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,n=s.touches?s.touches[0]:s,a=_e&&Mr(_e,!0),o=_e&&a&&a.a,l=_e&&a&&a.d,c=Aa&&mt&&l1(mt),u=(n.clientX-vr.clientX+i.x)/(o||1)+(c?c[0]-_u[0]:0)/(o||1),d=(n.clientY-vr.clientY+i.y)/(l||1)+(c?c[1]-_u[1]:0)/(l||1);if(!fe.active&&!Qr){if(r&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))=0&&(bt({rootEl:qe,name:"add",toEl:qe,fromEl:je,originalEvent:s}),bt({sortable:this,name:"remove",toEl:qe,originalEvent:s}),bt({rootEl:qe,name:"sort",toEl:qe,fromEl:je,originalEvent:s}),bt({sortable:this,name:"sort",toEl:qe,originalEvent:s})),ut&&ut.save()):Ht!==ti&&Ht>=0&&(bt({sortable:this,name:"update",toEl:qe,originalEvent:s}),bt({sortable:this,name:"sort",toEl:qe,originalEvent:s})),fe.active&&((Ht==null||Ht===-1)&&(Ht=ti,Xs=vn),bt({sortable:this,name:"end",toEl:qe,originalEvent:s}),this.save()))),this._nulling()},_nulling:function(){Mt("nulling",this),je=ie=qe=_e=yr=Be=Ya=Ys=vr=Jt=un=Ht=Xs=ti=vn=Zr=_n=ut=La=fe.dragged=fe.ghost=fe.clone=fe.active=null,qo.forEach(function(s){s.checked=!0}),qo.length=gu=vu=0},handleEvent:function(s){switch(s.type){case"drop":case"dragend":this._onDrop(s);break;case"dragenter":case"dragover":ie&&(this._onDragOver(s),s9(s));break;case"selectstart":s.preventDefault();break}},toArray:function(){for(var s=[],t,r=this.el.children,i=0,n=r.length,a=this.options;ir.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function n9(e,s,t,r,i,n,a,o){var l=r?e.clientY:e.clientX,c=r?t.height:t.width,u=r?t.top:t.left,d=r?t.bottom:t.right,h=!1;if(!a){if(o&&Jau+c*n/2:ld-Ja)return-_n}else if(l>u+c*(1-i)/2&&ld-c*n/2)?l>u+c/2?1:-1:0}function a9(e){return We(ie)1&&(ve.forEach(function(o){n.addAnimationState({target:o,rect:Ft?Ge(o):a}),mu(o),o.fromRect=a,r.removeAnimationState(o)}),Ft=!1,p9(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,n=t.insertion,a=t.activeSortable,o=t.parentEl,l=t.putSortable,c=this.options;if(n){if(i&&a._hideClone(),Ki=!1,c.animation&&ve.length>1&&(Ft||!i&&!a.options.sort&&!l)){var u=Ge(Re,!1,!0,!0);ve.forEach(function(h){h!==Re&&(c1(h,u),o.appendChild(h))}),Ft=!0}if(!i)if(Ft||Ra(),ve.length>1){var d=Fa;a._showClone(r),a.options.animation&&!Fa&&d&&It.forEach(function(h){a.addAnimationState({target:h,rect:Qi}),h.fromRect=Qi,h.thisAnimationDuration=null})}else a._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,n=t.activeSortable;if(ve.forEach(function(o){o.thisAnimationDuration=null}),n.options.animation&&!i&&n.multiDrag.isMultiDrag){Qi=qt({},r);var a=Mr(Re,!0);Qi.top-=a.f,Qi.left-=a.e}},dragOverAnimationComplete:function(){Ft&&(Ft=!1,Ra())},drop:function(t){var r=t.originalEvent,i=t.rootEl,n=t.parentEl,a=t.sortable,o=t.dispatchSortableEvent,l=t.oldIndex,c=t.putSortable,u=c||this.sortable;if(r){var d=this.options,h=n.children;if(!qr)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Ne(Re,d.selectedClass,!~ve.indexOf(Re)),~ve.indexOf(Re))ve.splice(ve.indexOf(Re),1),Ji=null,cn({sortable:a,rootEl:i,name:"deselect",targetEl:Re,originalEvt:r});else{if(ve.push(Re),cn({sortable:a,rootEl:i,name:"select",targetEl:Re,originalEvt:r}),r.shiftKey&&Ji&&a.el.contains(Ji)){var p=We(Ji),m=We(Re);if(~p&&~m&&p!==m){var f,b;for(m>p?(b=p,f=m):(b=m,f=p+1);b1){var C=Ge(Re),w=We(Re,":not(."+this.options.selectedClass+")");if(!Ki&&d.animation&&(Re.thisAnimationDuration=null),u.captureAnimationState(),!Ki&&(d.animation&&(Re.fromRect=C,ve.forEach(function(H){if(H.thisAnimationDuration=null,H!==Re){var A=Ft?Ge(H):C;H.fromRect=A,u.addAnimationState({target:H,rect:A})}})),Ra(),ve.forEach(function(H){h[w]?n.insertBefore(H,h[w]):n.appendChild(H),w++}),l===We(Re))){var M=!1;ve.forEach(function(H){if(H.sortableIndex!==We(H)){M=!0;return}}),M&&o("update")}ve.forEach(function(H){mu(H)}),u.animateAll()}Kt=u}(i===n||c&&c.lastPutMode!=="clone")&&It.forEach(function(H){H.parentNode&&H.parentNode.removeChild(H)})}},nullingGlobal:function(){this.isMultiDrag=qr=!1,It.length=0},destroyGlobal:function(){this._deselectMultiDrag(),xe(document,"pointerup",this._deselectMultiDrag),xe(document,"mouseup",this._deselectMultiDrag),xe(document,"touchend",this._deselectMultiDrag),xe(document,"keydown",this._checkKeyDown),xe(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof qr<"u"&&qr)&&Kt===this.sortable&&!(t&&ts(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;ve.length;){var r=ve[0];Ne(r,this.options.selectedClass,!1),ve.shift(),cn({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},qt(e,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[ft];!r||!r.options.multiDrag||~ve.indexOf(t)||(Kt&&Kt!==r&&(Kt.multiDrag._deselectMultiDrag(),Kt=r),Ne(t,r.options.selectedClass,!0),ve.push(t))},deselect:function(t){var r=t.parentNode[ft],i=ve.indexOf(t);!r||!r.options.multiDrag||!~i||(Ne(t,r.options.selectedClass,!1),ve.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return ve.forEach(function(n){r.push({multiDragElement:n,index:n.sortableIndex});var a;Ft&&n!==Re?a=-1:Ft?a=We(n,":not(."+t.options.selectedClass+")"):a=We(n),i.push({multiDragElement:n,index:a})}),{items:jF(ve),clones:[].concat(It),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function p9(e,s){ve.forEach(function(t,r){var i=s.children[t.sortableIndex+(e?Number(r):0)];i?s.insertBefore(t,i):s.appendChild(t)})}function m1(e,s){It.forEach(function(t,r){var i=s.children[t.sortableIndex+(e?Number(r):0)];i?s.insertBefore(t,i):s.appendChild(t)})}function Ra(){ve.forEach(function(e){e!==Re&&e.parentNode&&e.parentNode.removeChild(e)})}fe.mount(new c9);fe.mount(am,nm);const m9=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:h9,Sortable:fe,Swap:u9,default:fe},Symbol.toStringTag,{value:"Module"})),f9=hp(m9);(function(e,s){(function(r,i){e.exports=i(f9)})(typeof self<"u"?self:xr,function(t){return function(r){var i={};function n(a){if(i[a])return i[a].exports;var o=i[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=i,n.d=function(a,o,l){n.o(a,o)||Object.defineProperty(a,o,{enumerable:!0,get:l})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,o){if(o&1&&(a=n(a)),o&8||o&4&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),o&2&&typeof a!="string")for(var c in a)n.d(l,c,(function(u){return a[u]}).bind(null,c));return l},n.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(o,"a",o),o},n.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},n.p="",n(n.s="fb15")}({"01f9":function(r,i,n){var a=n("2d00"),o=n("5ca1"),l=n("2aba"),c=n("32e9"),u=n("84f2"),d=n("41a0"),h=n("7f20"),p=n("38fd"),m=n("2b4c")("iterator"),f=!([].keys&&"next"in[].keys()),b="@@iterator",C="keys",w="values",M=function(){return this};r.exports=function(H,A,$,T,I,R,W){d($,A,T);var B=function(L){if(!f&&L in X)return X[L];switch(L){case C:return function(){return new $(this,L)};case w:return function(){return new $(this,L)}}return function(){return new $(this,L)}},ee=A+" Iterator",D=I==w,z=!1,X=H.prototype,Q=X[m]||X[b]||I&&X[I],te=Q||B(I),se=I?D?B("entries"):te:void 0,F=A=="Array"&&X.entries||Q,G,x,P;if(F&&(P=p(F.call(new H)),P!==Object.prototype&&P.next&&(h(P,ee,!0),!a&&typeof P[m]!="function"&&c(P,m,M))),D&&Q&&Q.name!==w&&(z=!0,te=function(){return Q.call(this)}),(!a||W)&&(f||z||!X[m])&&c(X,m,te),u[A]=te,u[ee]=M,I)if(G={values:D?te:B(w),keys:R?te:B(C),entries:se},W)for(x in G)x in X||l(X,x,G[x]);else o(o.P+o.F*(f||z),A,G);return G}},"02f4":function(r,i,n){var a=n("4588"),o=n("be13");r.exports=function(l){return function(c,u){var d=String(o(c)),h=a(u),p=d.length,m,f;return h<0||h>=p?l?"":void 0:(m=d.charCodeAt(h),m<55296||m>56319||h+1===p||(f=d.charCodeAt(h+1))<56320||f>57343?l?d.charAt(h):m:l?d.slice(h,h+2):(m-55296<<10)+(f-56320)+65536)}}},"0390":function(r,i,n){var a=n("02f4")(!0);r.exports=function(o,l,c){return l+(c?a(o,l).length:1)}},"0bfb":function(r,i,n){var a=n("cb7c");r.exports=function(){var o=a(this),l="";return o.global&&(l+="g"),o.ignoreCase&&(l+="i"),o.multiline&&(l+="m"),o.unicode&&(l+="u"),o.sticky&&(l+="y"),l}},"0d58":function(r,i,n){var a=n("ce10"),o=n("e11e");r.exports=Object.keys||function(c){return a(c,o)}},1495:function(r,i,n){var a=n("86cc"),o=n("cb7c"),l=n("0d58");r.exports=n("9e1e")?Object.defineProperties:function(u,d){o(u);for(var h=l(d),p=h.length,m=0,f;p>m;)a.f(u,f=h[m++],d[f]);return u}},"214f":function(r,i,n){n("b0c5");var a=n("2aba"),o=n("32e9"),l=n("79e5"),c=n("be13"),u=n("2b4c"),d=n("520a"),h=u("species"),p=!l(function(){var f=/./;return f.exec=function(){var b=[];return b.groups={a:"7"},b},"".replace(f,"$")!=="7"}),m=function(){var f=/(?:)/,b=f.exec;f.exec=function(){return b.apply(this,arguments)};var C="ab".split(f);return C.length===2&&C[0]==="a"&&C[1]==="b"}();r.exports=function(f,b,C){var w=u(f),M=!l(function(){var R={};return R[w]=function(){return 7},""[f](R)!=7}),H=M?!l(function(){var R=!1,W=/a/;return W.exec=function(){return R=!0,null},f==="split"&&(W.constructor={},W.constructor[h]=function(){return W}),W[w](""),!R}):void 0;if(!M||!H||f==="replace"&&!p||f==="split"&&!m){var A=/./[w],$=C(c,w,""[f],function(W,B,ee,D,z){return B.exec===d?M&&!z?{done:!0,value:A.call(B,ee,D)}:{done:!0,value:W.call(ee,B,D)}:{done:!1}}),T=$[0],I=$[1];a(String.prototype,f,T),o(RegExp.prototype,w,b==2?function(R,W){return I.call(R,this,W)}:function(R){return I.call(R,this)})}}},"230e":function(r,i,n){var a=n("d3f4"),o=n("7726").document,l=a(o)&&a(o.createElement);r.exports=function(c){return l?o.createElement(c):{}}},"23c6":function(r,i,n){var a=n("2d95"),o=n("2b4c")("toStringTag"),l=a(function(){return arguments}())=="Arguments",c=function(u,d){try{return u[d]}catch{}};r.exports=function(u){var d,h,p;return u===void 0?"Undefined":u===null?"Null":typeof(h=c(d=Object(u),o))=="string"?h:l?a(d):(p=a(d))=="Object"&&typeof d.callee=="function"?"Arguments":p}},2621:function(r,i){i.f=Object.getOwnPropertySymbols},"2aba":function(r,i,n){var a=n("7726"),o=n("32e9"),l=n("69a8"),c=n("ca5a")("src"),u=n("fa5b"),d="toString",h=(""+u).split(d);n("8378").inspectSource=function(p){return u.call(p)},(r.exports=function(p,m,f,b){var C=typeof f=="function";C&&(l(f,"name")||o(f,"name",m)),p[m]!==f&&(C&&(l(f,c)||o(f,c,p[m]?""+p[m]:h.join(String(m)))),p===a?p[m]=f:b?p[m]?p[m]=f:o(p,m,f):(delete p[m],o(p,m,f)))})(Function.prototype,d,function(){return typeof this=="function"&&this[c]||u.call(this)})},"2aeb":function(r,i,n){var a=n("cb7c"),o=n("1495"),l=n("e11e"),c=n("613b")("IE_PROTO"),u=function(){},d="prototype",h=function(){var p=n("230e")("iframe"),m=l.length,f="<",b=">",C;for(p.style.display="none",n("fab2").appendChild(p),p.src="javascript:",C=p.contentWindow.document,C.open(),C.write(f+"script"+b+"document.F=Object"+f+"/script"+b),C.close(),h=C.F;m--;)delete h[d][l[m]];return h()};r.exports=Object.create||function(m,f){var b;return m!==null?(u[d]=a(m),b=new u,u[d]=null,b[c]=m):b=h(),f===void 0?b:o(b,f)}},"2b4c":function(r,i,n){var a=n("5537")("wks"),o=n("ca5a"),l=n("7726").Symbol,c=typeof l=="function",u=r.exports=function(d){return a[d]||(a[d]=c&&l[d]||(c?l:o)("Symbol."+d))};u.store=a},"2d00":function(r,i){r.exports=!1},"2d95":function(r,i){var n={}.toString;r.exports=function(a){return n.call(a).slice(8,-1)}},"2fdb":function(r,i,n){var a=n("5ca1"),o=n("d2c8"),l="includes";a(a.P+a.F*n("5147")(l),"String",{includes:function(u){return!!~o(this,u,l).indexOf(u,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(r,i,n){var a=n("86cc"),o=n("4630");r.exports=n("9e1e")?function(l,c,u){return a.f(l,c,o(1,u))}:function(l,c,u){return l[c]=u,l}},"38fd":function(r,i,n){var a=n("69a8"),o=n("4bf8"),l=n("613b")("IE_PROTO"),c=Object.prototype;r.exports=Object.getPrototypeOf||function(u){return u=o(u),a(u,l)?u[l]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?c:null}},"41a0":function(r,i,n){var a=n("2aeb"),o=n("4630"),l=n("7f20"),c={};n("32e9")(c,n("2b4c")("iterator"),function(){return this}),r.exports=function(u,d,h){u.prototype=a(c,{next:o(1,h)}),l(u,d+" Iterator")}},"456d":function(r,i,n){var a=n("4bf8"),o=n("0d58");n("5eda")("keys",function(){return function(c){return o(a(c))}})},4588:function(r,i){var n=Math.ceil,a=Math.floor;r.exports=function(o){return isNaN(o=+o)?0:(o>0?a:n)(o)}},4630:function(r,i){r.exports=function(n,a){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:a}}},"4bf8":function(r,i,n){var a=n("be13");r.exports=function(o){return Object(a(o))}},5147:function(r,i,n){var a=n("2b4c")("match");r.exports=function(o){var l=/./;try{"/./"[o](l)}catch{try{return l[a]=!1,!"/./"[o](l)}catch{}}return!0}},"520a":function(r,i,n){var a=n("0bfb"),o=RegExp.prototype.exec,l=String.prototype.replace,c=o,u="lastIndex",d=function(){var m=/a/,f=/b*/g;return o.call(m,"a"),o.call(f,"a"),m[u]!==0||f[u]!==0}(),h=/()??/.exec("")[1]!==void 0,p=d||h;p&&(c=function(f){var b=this,C,w,M,H;return h&&(w=new RegExp("^"+b.source+"$(?!\\s)",a.call(b))),d&&(C=b[u]),M=o.call(b,f),d&&M&&(b[u]=b.global?M.index+M[0].length:C),h&&M&&M.length>1&&l.call(M[0],w,function(){for(H=1;H1?arguments[1]:void 0)}}),n("9c6c")("includes")},6821:function(r,i,n){var a=n("626a"),o=n("be13");r.exports=function(l){return a(o(l))}},"69a8":function(r,i){var n={}.hasOwnProperty;r.exports=function(a,o){return n.call(a,o)}},"6a99":function(r,i,n){var a=n("d3f4");r.exports=function(o,l){if(!a(o))return o;var c,u;if(l&&typeof(c=o.toString)=="function"&&!a(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!a(u=c.call(o))||!l&&typeof(c=o.toString)=="function"&&!a(u=c.call(o)))return u;throw TypeError("Can't convert object to primitive value")}},7333:function(r,i,n){var a=n("0d58"),o=n("2621"),l=n("52a7"),c=n("4bf8"),u=n("626a"),d=Object.assign;r.exports=!d||n("79e5")(function(){var h={},p={},m=Symbol(),f="abcdefghijklmnopqrst";return h[m]=7,f.split("").forEach(function(b){p[b]=b}),d({},h)[m]!=7||Object.keys(d({},p)).join("")!=f})?function(p,m){for(var f=c(p),b=arguments.length,C=1,w=o.f,M=l.f;b>C;)for(var H=u(arguments[C++]),A=w?a(H).concat(w(H)):a(H),$=A.length,T=0,I;$>T;)M.call(H,I=A[T++])&&(f[I]=H[I]);return f}:d},7726:function(r,i){var n=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=n)},"77f1":function(r,i,n){var a=n("4588"),o=Math.max,l=Math.min;r.exports=function(c,u){return c=a(c),c<0?o(c+u,0):l(c,u)}},"79e5":function(r,i){r.exports=function(n){try{return!!n()}catch{return!0}}},"7f20":function(r,i,n){var a=n("86cc").f,o=n("69a8"),l=n("2b4c")("toStringTag");r.exports=function(c,u,d){c&&!o(c=d?c:c.prototype,l)&&a(c,l,{configurable:!0,value:u})}},8378:function(r,i){var n=r.exports={version:"2.6.5"};typeof __e=="number"&&(__e=n)},"84f2":function(r,i){r.exports={}},"86cc":function(r,i,n){var a=n("cb7c"),o=n("c69a"),l=n("6a99"),c=Object.defineProperty;i.f=n("9e1e")?Object.defineProperty:function(d,h,p){if(a(d),h=l(h,!0),a(p),o)try{return c(d,h,p)}catch{}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(d[h]=p.value),d}},"9b43":function(r,i,n){var a=n("d8e8");r.exports=function(o,l,c){if(a(o),l===void 0)return o;switch(c){case 1:return function(u){return o.call(l,u)};case 2:return function(u,d){return o.call(l,u,d)};case 3:return function(u,d,h){return o.call(l,u,d,h)}}return function(){return o.apply(l,arguments)}}},"9c6c":function(r,i,n){var a=n("2b4c")("unscopables"),o=Array.prototype;o[a]==null&&n("32e9")(o,a,{}),r.exports=function(l){o[a][l]=!0}},"9def":function(r,i,n){var a=n("4588"),o=Math.min;r.exports=function(l){return l>0?o(a(l),9007199254740991):0}},"9e1e":function(r,i,n){r.exports=!n("79e5")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},a352:function(r,i){r.exports=t},a481:function(r,i,n){var a=n("cb7c"),o=n("4bf8"),l=n("9def"),c=n("4588"),u=n("0390"),d=n("5f1b"),h=Math.max,p=Math.min,m=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,b=/\$([$&`']|\d\d?)/g,C=function(w){return w===void 0?w:String(w)};n("214f")("replace",2,function(w,M,H,A){return[function(I,R){var W=w(this),B=I==null?void 0:I[M];return B!==void 0?B.call(I,W,R):H.call(String(W),I,R)},function(T,I){var R=A(H,T,this,I);if(R.done)return R.value;var W=a(T),B=String(this),ee=typeof I=="function";ee||(I=String(I));var D=W.global;if(D){var z=W.unicode;W.lastIndex=0}for(var X=[];;){var Q=d(W,B);if(Q===null||(X.push(Q),!D))break;var te=String(Q[0]);te===""&&(W.lastIndex=u(B,l(W.lastIndex),z))}for(var se="",F=0,G=0;G=F&&(se+=B.slice(F,P)+ge,F=P+x.length)}return se+B.slice(F)}];function $(T,I,R,W,B,ee){var D=R+T.length,z=W.length,X=b;return B!==void 0&&(B=o(B),X=f),H.call(ee,X,function(Q,te){var se;switch(te.charAt(0)){case"$":return"$";case"&":return T;case"`":return I.slice(0,R);case"'":return I.slice(D);case"<":se=B[te.slice(1,-1)];break;default:var F=+te;if(F===0)return Q;if(F>z){var G=m(F/10);return G===0?Q:G<=z?W[G-1]===void 0?te.charAt(1):W[G-1]+te.charAt(1):Q}se=W[F-1]}return se===void 0?"":se})}})},aae3:function(r,i,n){var a=n("d3f4"),o=n("2d95"),l=n("2b4c")("match");r.exports=function(c){var u;return a(c)&&((u=c[l])!==void 0?!!u:o(c)=="RegExp")}},ac6a:function(r,i,n){for(var a=n("cadf"),o=n("0d58"),l=n("2aba"),c=n("7726"),u=n("32e9"),d=n("84f2"),h=n("2b4c"),p=h("iterator"),m=h("toStringTag"),f=d.Array,b={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},C=o(b),w=0;wf;)if(b=p[f++],b!=b)return!0}else for(;m>f;f++)if((c||f in p)&&p[f]===d)return c||f||0;return!c&&-1}}},c649:function(r,i,n){(function(a){n.d(i,"c",function(){return p}),n.d(i,"a",function(){return d}),n.d(i,"b",function(){return l}),n.d(i,"d",function(){return h}),n("a481");function o(){return typeof window<"u"?window.console:a.console}var l=o();function c(m){var f=Object.create(null);return function(C){var w=f[C];return w||(f[C]=m(C))}}var u=/-(\w)/g,d=c(function(m){return m.replace(u,function(f,b){return b?b.toUpperCase():""})});function h(m){m.parentElement!==null&&m.parentElement.removeChild(m)}function p(m,f,b){var C=b===0?m.children[0]:m.children[b-1].nextSibling;m.insertBefore(f,C)}}).call(this,n("c8ba"))},c69a:function(r,i,n){r.exports=!n("9e1e")&&!n("79e5")(function(){return Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a!=7})},c8ba:function(r,i){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}r.exports=n},ca5a:function(r,i){var n=0,a=Math.random();r.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++n+a).toString(36))}},cadf:function(r,i,n){var a=n("9c6c"),o=n("d53b"),l=n("84f2"),c=n("6821");r.exports=n("01f9")(Array,"Array",function(u,d){this._t=c(u),this._i=0,this._k=d},function(){var u=this._t,d=this._k,h=this._i++;return!u||h>=u.length?(this._t=void 0,o(1)):d=="keys"?o(0,h):d=="values"?o(0,u[h]):o(0,[h,u[h]])},"values"),l.Arguments=l.Array,a("keys"),a("values"),a("entries")},cb7c:function(r,i,n){var a=n("d3f4");r.exports=function(o){if(!a(o))throw TypeError(o+" is not an object!");return o}},ce10:function(r,i,n){var a=n("69a8"),o=n("6821"),l=n("c366")(!1),c=n("613b")("IE_PROTO");r.exports=function(u,d){var h=o(u),p=0,m=[],f;for(f in h)f!=c&&a(h,f)&&m.push(f);for(;d.length>p;)a(h,f=d[p++])&&(~l(m,f)||m.push(f));return m}},d2c8:function(r,i,n){var a=n("aae3"),o=n("be13");r.exports=function(l,c,u){if(a(c))throw TypeError("String#"+u+" doesn't accept regex!");return String(o(l))}},d3f4:function(r,i){r.exports=function(n){return typeof n=="object"?n!==null:typeof n=="function"}},d53b:function(r,i){r.exports=function(n,a){return{value:a,done:!!n}}},d8e8:function(r,i){r.exports=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n}},e11e:function(r,i){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f559:function(r,i,n){var a=n("5ca1"),o=n("9def"),l=n("d2c8"),c="startsWith",u=""[c];a(a.P+a.F*n("5147")(c),"String",{startsWith:function(h){var p=l(this,h,c),m=o(Math.min(arguments.length>1?arguments[1]:void 0,p.length)),f=String(h);return u?u.call(p,f,m):p.slice(m,m+f.length)===f}})},f6fd:function(r,i){(function(n){var a="currentScript",o=n.getElementsByTagName("script");a in n||Object.defineProperty(n,a,{get:function(){try{throw new Error}catch(u){var l,c=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(u.stack)||[!1])[1];for(l in o)if(o[l].src==c||o[l].readyState=="interactive")return o[l];return null}}})})(document)},f751:function(r,i,n){var a=n("5ca1");a(a.S+a.F,"Object",{assign:n("7333")})},fa5b:function(r,i,n){r.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(r,i,n){var a=n("7726").document;r.exports=a&&a.documentElement},fb15:function(r,i,n){if(n.r(i),typeof window<"u"){n("f6fd");var a;(a=window.document.currentScript)&&(a=a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=a[1])}n("f751"),n("f559"),n("ac6a"),n("cadf"),n("456d");function o(x){if(Array.isArray(x))return x}function l(x,P){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(x)))){var L=[],Y=!0,ae=!1,de=void 0;try{for(var ge=x[Symbol.iterator](),ye;!(Y=(ye=ge.next()).done)&&(L.push(ye.value),!(P&&L.length===P));Y=!0);}catch(tt){ae=!0,de=tt}finally{try{!Y&&ge.return!=null&&ge.return()}finally{if(ae)throw de}}return L}}function c(x,P){(P==null||P>x.length)&&(P=x.length);for(var L=0,Y=new Array(P);L=de?ae.length:ae.indexOf(ye)});return L?ge.filter(function(ye){return ye!==-1}):ge}function T(x,P){var L=this;this.$nextTick(function(){return L.$emit(x.toLowerCase(),P)})}function I(x){var P=this;return function(L){P.realList!==null&&P["onDrag"+x](L),T.call(P,x,L)}}function R(x){return["transition-group","TransitionGroup"].includes(x)}function W(x){if(!x||x.length!==1)return!1;var P=h(x,1),L=P[0].componentOptions;return L?R(L.tag):!1}function B(x,P,L){return x[L]||(P[L]?P[L]():void 0)}function ee(x,P,L){var Y=0,ae=0,de=B(P,L,"header");de&&(Y=de.length,x=x?[].concat(b(de),b(x)):b(de));var ge=B(P,L,"footer");return ge&&(ae=ge.length,x=x?[].concat(b(x),b(ge)):b(ge)),{children:x,headerOffset:Y,footerOffset:ae}}function D(x,P){var L=null,Y=function(lt,_t){L=H(L,lt,_t)},ae=Object.keys(x).filter(function(tt){return tt==="id"||tt.startsWith("data-")}).reduce(function(tt,lt){return tt[lt]=x[lt],tt},{});if(Y("attrs",ae),!P)return L;var de=P.on,ge=P.props,ye=P.attrs;return Y("on",de),Y("props",ge),Object.assign(L.attrs,ye),L}var z=["Start","Add","Remove","Update","End"],X=["Choose","Unchoose","Sort","Filter","Clone"],Q=["Move"].concat(z,X).map(function(x){return"on"+x}),te=null,se={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(P){return P}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},F={name:"draggable",inheritAttrs:!1,props:se,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render:function(P){var L=this.$slots.default;this.transitionMode=W(L);var Y=ee(L,this.$slots,this.$scopedSlots),ae=Y.children,de=Y.headerOffset,ge=Y.footerOffset;this.headerOffset=de,this.footerOffset=ge;var ye=D(this.$attrs,this.componentData);return P(this.getTag(),ye,ae)},created:function(){this.list!==null&&this.value!==null&&M.b.error("Value and list props are mutually exclusive! Please set one or another."),this.element!=="div"&&M.b.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),this.options!==void 0&&M.b.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var P=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var L={};z.forEach(function(de){L["on"+de]=I.call(P,de)}),X.forEach(function(de){L["on"+de]=T.bind(P,de)});var Y=Object.keys(this.$attrs).reduce(function(de,ge){return de[Object(M.a)(ge)]=P.$attrs[ge],de},{}),ae=Object.assign({},this.options,Y,L,{onMove:function(ge,ye){return P.onDragMove(ge,ye)}});!("draggable"in ae)&&(ae.draggable=">*"),this._sortable=new w.a(this.rootContainer,ae),this.computeIndexes()},beforeDestroy:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(P){this.updateOptions(P)},deep:!0},$attrs:{handler:function(P){this.updateOptions(P)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var P=this._vnode.fnOptions;return P&&P.functional},getTag:function(){return this.tag||this.element},updateOptions:function(P){for(var L in P){var Y=Object(M.a)(L);Q.indexOf(Y)===-1&&this._sortable.option(Y,P[L])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var P=this.$slots.default;return this.transitionMode?P[0].child.$slots.default:P},computeIndexes:function(){var P=this;this.$nextTick(function(){P.visibleIndexes=$(P.getChildrenNodes(),P.rootContainer.children,P.transitionMode,P.footerOffset)})},getUnderlyingVm:function(P){var L=A(this.getChildrenNodes()||[],P);if(L===-1)return null;var Y=this.realList[L];return{index:L,element:Y}},getUnderlyingPotencialDraggableComponent:function(P){var L=P.__vue__;return!L||!L.$options||!R(L.$options._componentTag)?!("realList"in L)&&L.$children.length===1&&"realList"in L.$children[0]?L.$children[0]:L:L.$parent},emitChanges:function(P){var L=this;this.$nextTick(function(){L.$emit("change",P)})},alterList:function(P){if(this.list){P(this.list);return}var L=b(this.value);P(L),this.$emit("input",L)},spliceList:function(){var P=arguments,L=function(ae){return ae.splice.apply(ae,b(P))};this.alterList(L)},updatePosition:function(P,L){var Y=function(de){return de.splice(L,0,de.splice(P,1)[0])};this.alterList(Y)},getRelatedContextFromMoveEvent:function(P){var L=P.to,Y=P.related,ae=this.getUnderlyingPotencialDraggableComponent(L);if(!ae)return{component:ae};var de=ae.realList,ge={list:de,component:ae};if(L!==Y&&de&&ae.getUnderlyingVm){var ye=ae.getUnderlyingVm(Y);if(ye)return Object.assign(ye,ge)}return ge},getVmIndex:function(P){var L=this.visibleIndexes,Y=L.length;return P>Y-1?Y:L[P]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(P){if(!(!this.noTransitionOnDrag||!this.transitionMode)){var L=this.getChildrenNodes();L[P].data=null;var Y=this.getComponent();Y.children=[],Y.kept=void 0}},onDragStart:function(P){this.context=this.getUnderlyingVm(P.item),P.item._underlying_vm_=this.clone(this.context.element),te=P.item},onDragAdd:function(P){var L=P.item._underlying_vm_;if(L!==void 0){Object(M.d)(P.item);var Y=this.getVmIndex(P.newIndex);this.spliceList(Y,0,L),this.computeIndexes();var ae={element:L,newIndex:Y};this.emitChanges({added:ae})}},onDragRemove:function(P){if(Object(M.c)(this.rootContainer,P.item,P.oldIndex),P.pullMode==="clone"){Object(M.d)(P.clone);return}var L=this.context.index;this.spliceList(L,1);var Y={element:this.context.element,oldIndex:L};this.resetTransitionData(L),this.emitChanges({removed:Y})},onDragUpdate:function(P){Object(M.d)(P.item),Object(M.c)(P.from,P.item,P.oldIndex);var L=this.context.index,Y=this.getVmIndex(P.newIndex);this.updatePosition(L,Y);var ae={element:this.context.element,oldIndex:L,newIndex:Y};this.emitChanges({moved:ae})},updateProperty:function(P,L){P.hasOwnProperty(L)&&(P[L]+=this.headerOffset)},computeFutureIndex:function(P,L){if(!P.element)return 0;var Y=b(L.to.children).filter(function(ye){return ye.style.display!=="none"}),ae=Y.indexOf(L.related),de=P.component.getVmIndex(ae),ge=Y.indexOf(te)!==-1;return ge||!L.willInsertAfter?de:de+1},onDragMove:function(P,L){var Y=this.move;if(!Y||!this.realList)return!0;var ae=this.getRelatedContextFromMoveEvent(P),de=this.context,ge=this.computeFutureIndex(ae,P);Object.assign(de,{futureIndex:ge});var ye=Object.assign({},P,{relatedContext:ae,draggedContext:de});return Y(ye,L)},onDragEnd:function(){this.computeIndexes(),te=null}}};typeof window<"u"&&"Vue"in window&&window.Vue.component("draggable",F);var G=F;i.default=G}}).default})})(Ey);var g9=Ey.exports;const Ui=Fi(g9);var v9=Object.defineProperty,_9=Object.getOwnPropertyDescriptor,Dc=(e,s,t,r)=>{for(var i=r>1?void 0:r?_9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&v9(s,t,i),i};let $i=class extends j(V){constructor(){super(...arguments),this.segmentSeparator="/"}get pathSegments(){const[e,...s]=(this.path||"").split(this.segmentSeparator),t={directoryName:e,location:e};return s.reduce((r,i)=>{const n=r[r.length-1].location,a="".concat(n).concat(this.segmentSeparator).concat(i),o={directoryName:i,location:a};return r.push(o),r},[t])}};Dc([k({default:!1})],$i.prototype,"path",2);Dc([k({default:!1})],$i.prototype,"baseDirectoryLabel",2);Dc([k({default:!1})],$i.prototype,"onSegmentClick",2);$i=Dc([O],$i);var b9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("span",e._l(e.pathSegments,function(r,i){var n=r.directoryName,a=r.location;return t("span",{key:a,staticClass:"navigation-container"},[i!==0?[t("span",{staticClass:"navigation-divider text--disabled"},[e._v(e._s(e.segmentSeparator))])]:e._e(),i!==e.pathSegments.length-1?[t("span",{staticClass:"cursor-pointer navigation-segment",attrs:{tabindex:"0",role:"button"},on:{click:function(o){return e.onSegmentClick({location:a})},keyup:function(o){return!o.type.indexOf("key")&&e._k(o.keyCode,"enter",13,o.key,"Enter")?null:e.onSegmentClick({location:a})}}},[n?[e._v(e._s(n))]:[e._v(e._s(e.baseDirectoryLabel))]],2)]:[t("span",[n?[e._v(e._s(n))]:[e._v(e._s(e.baseDirectoryLabel))]],2)]],2)}),0)},y9=[];const f1={};var C9=N($i,b9,y9,!1,$9,"4b5d1549",null,null);function $9(e){for(let s in f1)this[s]=f1[s]}const Bi=function(){return C9.exports}();var x9=Object.defineProperty,w9=Object.getOwnPropertyDescriptor,Uy=(e,s,t,r)=>{for(var i=r>1?void 0:r?w9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&x9(s,t,i),i};let Yo=class extends j(V,Je){constructor(){super(...arguments),this.mdiChevronDown=Vs,this.mdiChevronUp=la,this.mdiContentCopy=Bb,this.mdiFile=dr,this.mdiFileDocumentMultipleOutline=Zl,this.mdiMagnify=Jl,this.mdiUpload=XP,this.mdiFolderPlus=$p,this.mdiRefresh=Hi,this.mdiCog=Us,this.mdiFolderUpload=xp,this.mdiFolder=Cp,this.mdiPlay=Ii,this.mdiPlaylistPlus=a0,this.mdiFire=Ri,this.mdiVideo3d=ec,this.mdiCloudDownload=Pn,this.mdiRenameBox=Ql,this.mdiFileDocumentEditOutline=da,this.mdiDelete=Ye,this.mdiCloseThick=Ce,this.mdiCheckboxBlankOutline=mp,this.mdiCheckboxMarked=fp,this.mdiDragVertical=zl,this.formatFilesize=it,this.formatPrintTime=r5,this.sortFiles=Ap,this.search="",this.dialogCreateDirectory={show:!1,name:""},this.contextMenu={shown:!1,isDirectory:!1,touchTimer:void 0,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,count_printed:0,last_filament_used:null,last_start_time:null,last_end_time:null,last_print_duration:null,last_status:null,last_total_duration:null}},this.draggingFile={item:{...this.contextMenu.item}},this.dialogPrintFile={show:!1,item:{...this.contextMenu.item}},this.dialogAddBatchToQueue={show:!1,count:1,item:{...this.contextMenu.item}},this.dialogRenameFile={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogDuplicateFile={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogRenameDirectory={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogDeleteDirectory={show:!1,newName:"",item:{...this.contextMenu.item}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[e=>!!e||this.$t("Files.InvalidNameEmpty"),e=>!this.existsFilename(e)||this.$t("Files.InvalidNameAlreadyExists")],this.countInputRules=[e=>!!e||this.$t("JobQueue.InvalidCountEmpty"),e=>parseInt(e)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}existsFilename(e){return this.files.findIndex(s=>s.filename===e)>=0}get gcodeInputFileAccept(){return this.isIOS?[]:ci}get currentPath(){const e=this.$store.state.gui.view.gcodefiles.currentPath;return e==="gcodes"?"":e}set currentPath(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.gcodefiles.currentPath",value:e})}get selectedFiles(){var e;return(e=this.$store.state.gui.view.gcodefiles.selectedFiles)!=null?e:[]}set selectedFiles(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.gcodefiles.selectedFiles",value:e})}get fixedHeaders(){return[{text:"",value:"",visible:!0,sortable:!1},{text:this.$t("Files.Name").toString(),value:"filename",visible:!0,class:"text-no-wrap"},{text:"",value:"status",visible:!0,class:"text-no-wrap",sortable:!1}]}get configurableHeaders(){const e=[{text:this.$t("Files.Filesize").toString(),value:"size",visible:!0,class:"text-no-wrap",outputType:"filesize"},{text:this.$t("Files.LastModified").toString(),value:"modified",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.ObjectHeight").toString(),value:"object_height",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.LayerHeight").toString(),value:"layer_height",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.NozzleDiameter").toString(),value:"nozzle_diameter",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.ExtruderTemp").toString(),value:"first_layer_extr_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.BedTemp").toString(),value:"first_layer_bed_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.ChamberTemp").toString(),value:"chamber_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.FilamentName").toString(),value:"filament_name",visible:!0,class:"text-no-wrap"},{text:this.$t("Files.FilamentType").toString(),value:"filament_type",visible:!0,class:"text-no-wrap",outputType:"string"},{text:this.$t("Files.FilamentUsage").toString(),value:"filament_total",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.FilamentWeight").toString(),value:"filament_weight_total",visible:!0,class:"text-no-wrap",outputType:"weight"},{text:this.$t("Files.PrintTime").toString(),value:"estimated_time",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastStartTime").toString(),value:"last_start_time",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.LastEndTime").toString(),value:"last_end_time",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.LastPrintDuration").toString(),value:"last_print_duration",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastTotalDuration").toString(),value:"last_total_duration",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastFilamentUsed").toString(),value:"last_filament_used",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.Slicer").toString(),value:"slicer",visible:!0,class:"text-no-wrap",outputType:"string"}];let s=0;return e.forEach(t=>{var i;t.visible=!this.hideMetadataColumns.includes(t.value);let r=(i=this.orderMetadataColumns)==null?void 0:i.findIndex(n=>n===t.value);r===-1&&(s++,r=this.orderMetadataColumns.length+s),t.pos=r}),e.sort((t,r)=>{var i,n;return((i=t.pos)!=null?i:0)-((n=r.pos)!=null?n:0)})}set configurableHeaders(e){const s=[];e.forEach(t=>s.push(t.value)),this.orderMetadataColumns=s}get headers(){return[...this.fixedHeaders,...this.configurableHeaders]}get tableColumns(){return this.configurableHeaders.filter(e=>e.visible)}get directory(){return this.$store.getters["files/getDirectory"]("gcodes"+this.currentPath)}get disk_usage(){var e,s;return(s=(e=this.directory)==null?void 0:e.disk_usage)!=null?s:{used:0,free:0,total:0}}get files(){return this.$store.getters["files/getGcodeFiles"](this.currentPath,this.showHiddenFiles,this.showPrintedFiles)}get filteredHeaders(){return this.headers.filter(e=>e.visible)}get orderMetadataColumns(){var e;return(e=this.$store.state.gui.view.gcodefiles.orderMetadataColumns)!=null?e:[]}set orderMetadataColumns(e){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.orderMetadataColumns",value:e})}get hideMetadataColumns(){var e;return(e=this.$store.state.gui.view.gcodefiles.hideMetadataColumns)!=null?e:[]}set hideMetadataColumns(e){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.hideMetadataColumns",value:e})}get showHiddenFiles(){return this.$store.state.gui.view.gcodefiles.showHiddenFiles}set showHiddenFiles(e){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.showHiddenFiles",value:e})}get showPrintedFiles(){return this.$store.state.gui.view.gcodefiles.showPrintedFiles}set showPrintedFiles(e){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.showPrintedFiles",value:e})}get sortBy(){return this.$store.state.gui.view.gcodefiles.sortBy}set sortBy(e){e===void 0&&(e="modified"),this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.sortBy",value:e})}get sortDesc(){return this.$store.state.gui.view.gcodefiles.sortDesc}set sortDesc(e){e===void 0&&(e=!1),this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.sortDesc",value:e})}get countPerPage(){return this.$store.state.gui.view.gcodefiles.countPerPage}set countPerPage(e){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.countPerPage",value:e})}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:zt}get bigThumbnailTooltipColor(){if(zt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}getStatusIcon(e){return this.$store.getters["server/history/getPrintStatusIcon"](e)}getStatusTextColor(e){return this.$store.getters["server/history/getPrintStatusTextColor"](e)}getStatusColor(e){return this.$store.getters["server/history/getPrintStatusIconColor"](e)}dragOverFilelist(e,s){e.preventDefault(),s.isDirectory&&(e.target.parentElement.style.backgroundColor="#43A04720")}dragLeaveFilelist(e){e.preventDefault(),e.stopPropagation(),e.target.parentElement.style.backgroundColor="transparent"}async dragDropFilelist(e,s){e.preventDefault(),e.target.parentElement.style.backgroundColor="transparent";let t;s.filename===".."?t=this.currentPath.substring(0,this.currentPath.lastIndexOf("/")+1)+this.draggingFile.item.filename:t=this.currentPath+"/"+s.filename+"/"+this.draggingFile.item.filename,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.draggingFile.item.filename,dest:"gcodes"+t},{action:"files/getMove"})}async uploadFile(){var e;if((e=this.$refs.fileUpload.files)!=null&&e.length){const s=[...this.$refs.fileUpload.files];this.$refs.fileUpload.value="",await this.$store.dispatch("socket/addLoading",{name:"gcodeUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",this.$refs.fileUpload.files.length);for(const t of s){await this.$store.dispatch("files/uploadIncrementCurrentNumber");const r=this.currentPath.slice(0,1)==="/"?this.currentPath.slice(1):this.currentPath,i=await this.$store.dispatch("files/uploadFile",{file:t,path:r,root:"gcodes"});i!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:i}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"})}}clickUploadButton(){this.$refs.fileUpload.click()}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldCreateDirectory)==null||e.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.name.length&&(this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:"gcodes"+this.currentPath+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"}))}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:"gcodes"+this.currentPath},{action:"files/getDirectory"})}advancedSearch(e,s){if(s===null||typeof e!="string")return!1;e=e.toString().toLowerCase();const t=s.toLowerCase().split(" ");for(const r of t)if(!e.includes(r))return!1;return!0}refreshMetadata(e){e.filter(t=>!t.isDirectory&&!t.metadataRequested&&!t.metadataPulled).forEach(t=>{this.$store.dispatch("files/requestMetadata",{filename:"gcodes"+this.currentPath+"/"+t.filename})})}clickRow(e,s=!1){(!this.contextMenu.shown||s)&&(s&&(this.contextMenu.shown=!1),e.isDirectory?this.currentPath+="/"+e.filename:!["error","printing","paused"].includes(this.printer_state)&&this.isGcodeFile(e)&&(this.dialogPrintFile.show=!0,this.dialogPrintFile.item=e))}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(e){this.currentPath=e.location}async addToQueue(e){let s=[this.currentPath,e.filename].join("/");s.startsWith("/")&&(s=s.slice(1)),await this.$store.dispatch("server/jobQueue/addToQueue",[s])}openAddBatchToQueueDialog(e){this.dialogAddBatchToQueue.show=!0,this.dialogAddBatchToQueue.count=1,this.dialogAddBatchToQueue.item=e}async addBatchToQueueAction(){let e=[this.currentPath,this.dialogAddBatchToQueue.item.filename].join("/");e.startsWith("/")&&(e=e.slice(1));const s=[];for(let t=0;t{this.contextMenu.shown=!0}))}editFile(e){this.$store.dispatch("editor/openFile",{root:"gcodes",path:this.currentPath,filename:e.filename,size:e.size,permissions:e.permissions})}downloadFile(){const e=this.currentPath+"/"+this.contextMenu.item.filename,s=this.apiUrl+"/server/files/gcodes"+encodeURI(e);window.open(s)}async downloadSelectedFiles(){let e=[];const s=async(i,n)=>{for(const a of n){const o="".concat(i,"/").concat(a.filename);if(a.isDirectory&&a.childrens){await s(o,a.childrens);continue}e.push(o)}};await s("gcodes/"+this.currentPath,this.selectedFiles);const t=new Date,r="".concat(t.getFullYear()).concat(t.getMonth()).concat(t.getDate(),"-").concat(t.getHours()).concat(t.getMinutes()).concat(t.getSeconds());this.$socket.emit("server.files.zip",{items:e,dest:"config/gcodes-".concat(r,".zip")},{action:"files/downloadZip",loading:"gcodeDownloadZip"}),this.selectedFiles=[]}renameFile(e){this.dialogRenameFile.item=e,this.dialogRenameFile.newName=e.filename,this.dialogRenameFile.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldRenameFile)==null||s.focus()},200)}renameFileAction(){this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.dialogRenameFile.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogRenameFile.newName},{action:"files/getMove"})}duplicateFile(e){this.dialogDuplicateFile.item=e,this.dialogDuplicateFile.newName=e.filename,this.dialogDuplicateFile.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldDuplicateFile)==null||s.focus()},200)}duplicateFileAction(){this.dialogDuplicateFile.show=!1,this.$socket.emit("server.files.copy",{source:"gcodes"+this.currentPath+"/"+this.dialogDuplicateFile.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogDuplicateFile.newName})}renameDirectory(e){this.dialogRenameDirectory.item=e,this.dialogRenameDirectory.newName=e.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldRenameDirectory)==null||s.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.dialogRenameDirectory.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogRenameDirectory.newName},{action:"files/getMove"})}removeFile(){this.$socket.emit("server.files.delete_file",{path:"gcodes"+this.currentPath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteDirectory(e){this.dialogDeleteDirectory.item=e,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:"gcodes"+this.currentPath+"/"+this.contextMenu.item.filename,force:!0},{action:"files/getDeleteDir"})}closeStartPrint(){this.dialogPrintFile.show=!1}dragFile(e,s){e.preventDefault(),this.draggingFile.item=s}dragendFile(e){e.preventDefault(),this.draggingFile.item={isDirectory:!1,filename:"",permissions:"",modified:new Date,count_printed:0,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,last_filament_used:null,last_start_time:null,last_end_time:null,last_print_duration:null,last_status:null,last_total_duration:null}}hideMetadataColumsCanged(e){e.forEach(s=>{let t=this.headers.find(r=>r.value===s);t&&(t.visible=!1)})}isGcodeFile(e){const s=e.filename.slice(e.filename.lastIndexOf("."));return ci.includes(s)}view3D(e){this.$router.push({path:"/viewer",query:{filename:"gcodes"+this.currentPath+"/"+e.filename}})}scanMeta(e){this.$store.dispatch("files/scanMetadata",{filename:"gcodes"+this.currentPath+"/"+e.filename})}deleteSelectedFiles(){this.selectedFiles.forEach(e=>{e.isDirectory?this.$socket.emit("server.files.delete_directory",{path:"gcodes"+this.currentPath+"/"+e.filename,force:!0},{action:"files/getDeleteDir"}):this.$socket.emit("server.files.delete_file",{path:"gcodes"+this.currentPath+"/"+e.filename},{action:"files/getDeleteFile"})}),this.selectedFiles=[],this.deleteSelectedDialog=!1}outputValue(e,s){const t=e.value in s?s[e.value]:null;if(t!==null)switch(e.outputType){case"filesize":return it(t);case"date":return this.formatDateTime(t);case"time":return this.formatPrintTime(t);case"temp":return t.toFixed()+" °C";case"length":return t>1e3?(t/1e3).toFixed(2)+" m":t.toFixed(2)+" mm";case"weight":return t.toFixed(2)+" g";default:return t}else return"--"}};Uy([me("hideMetadataColums")],Yo.prototype,"hideMetadataColumsCanged",1);Yo=Uy([O({components:{StartPrintDialog:_c,Panel:Z,SettingsRow:U,PathNavigation:Bi,draggable:Ui}})],Yo);var S9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{attrs:{title:e.$t("Files.GCodeFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"gcode-files-panel"}},[t(q,[t(S,[t(_,{staticClass:"col-12 d-flex align-center"},[t(re,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Files.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(le),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.Download"),color:"primary",loading:e.loadings.includes("gcodeDownloadZip")},on:{click:e.downloadSelectedFiles}},[t(v,[e._v(e._s(e.mdiCloudDownload))])],1):e._e(),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.Delete"),color:"error"},on:{click:function(r){e.deleteSelectedDialog=!0}}},[t(v,[e._v(e._s(e.mdiDelete))])],1):e._e(),t("input",{ref:"fileUpload",staticStyle:{display:"none"},attrs:{type:"file",accept:e.gcodeInputFileAccept.join(", "),multiple:""},on:{change:e.uploadFile}}),t(g,{staticClass:"primary--text px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.UploadNewGcode"),loading:e.loadings.includes("gcodeUpload")},on:{click:e.clickUploadButton}},[t(v,[e._v(e._s(e.mdiUpload))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.CreateNewDirectory")},on:{click:e.createDirectory}},[t(v,[e._v(e._s(e.mdiFolderPlus))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.RefreshCurrentDirectory")},on:{click:e.refreshFileList}},[t(v,[e._v(e._s(e.mdiRefresh))])],1),t($e,{attrs:{"offset-y":"",left:"","close-on-content-click":!1,title:e.$t("Files.SetupCurrentList")},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[t(K,{staticClass:"minHeight36",attrs:{link:""}},[t(S,[t(_,{staticClass:"pr-0"},[e._v(" "+e._s(e.$t("Files.HiddenFiles"))+" ")]),t(_,{staticClass:"col-auto pl-0"},[e.showHiddenFiles?t(v,{attrs:{color:"primary"},on:{click:function(r){r.stopPropagation(),e.showHiddenFiles=!1}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(v,{attrs:{color:"grey lighten-1"},on:{click:function(r){r.stopPropagation(),e.showHiddenFiles=!0}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1),t(K,{staticClass:"minHeight36",attrs:{link:""}},[t(S,[t(_,{staticClass:"pr-0"},[e._v(" "+e._s(e.$t("Files.PrintedFiles"))+" ")]),t(_,{staticClass:"col-auto pl-0"},[e.showPrintedFiles?t(v,{attrs:{color:"primary"},on:{click:function(r){r.stopPropagation(),e.showPrintedFiles=!1}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(v,{attrs:{color:"grey lighten-1"},on:{click:function(r){r.stopPropagation(),e.showPrintedFiles=!0}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1),t(E),t("draggable",{staticClass:"v-list-item-group",attrs:{handle:".handle","ghost-class":"ghost",group:"gcodeFilesColumnOrder"},model:{value:e.configurableHeaders,callback:function(r){e.configurableHeaders=r},expression:"configurableHeaders"}},e._l(e.configurableHeaders,function(r){return t(K,{key:r.value,staticClass:"minHeight36"},[t(S,[t(_,{staticClass:"col-auto pr-0"},[t(v,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1),t(_,[e._v(" "+e._s(r.text)+" ")]),t(_,{staticClass:"col-auto pl-0"},[r.visible?t(v,{attrs:{color:"primary"},on:{click:function(i){return i.stopPropagation(),e.changeMetadataVisible(r.value,!1)}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(v,{attrs:{color:"grey lighten-1"},on:{click:function(i){return i.stopPropagation(),e.changeMetadataVisible(r.value,!0)}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1)}),1)],1)],1)],1)],1)],1),t(q,[t(S,[t(_,{staticClass:"col-12 py-2 d-flex align-center"},[t("span",[t("b",{staticClass:"mr-1"},[e._v(e._s(e.$t("Files.CurrentPath"))+":")]),t(Bi,{attrs:{path:e.currentPath,"base-directory-label":"/gcodes","on-segment-click":e.clickPathNavGoToDirectory}})],1),t(le),e.disk_usage!==null?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({},"span",n,!1),i),[t("b",[e._v(e._s(e.$t("Files.FreeDisk"))+":")]),e._v(" "+e._s(e.formatFilesize(e.disk_usage.free))+" ")])]}}],null,!1,1145199616)},[t("span",[e._v(" "+e._s(e.$t("Files.Used"))+": "+e._s(e.formatFilesize(e.disk_usage.used))+" "),t("br"),e._v(" "+e._s(e.$t("Files.Free"))+": "+e._s(e.formatFilesize(e.disk_usage.free))+" "),t("br"),e._v(" "+e._s(e.$t("Files.Total"))+": "+e._s(e.formatFilesize(e.disk_usage.total))+" ")])])]:e._e()],2)],1)],1),t(E,{staticClass:"mb-3"}),t(Ns,{staticClass:"files-table",attrs:{items:e.files,headers:e.filteredHeaders,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("Files.Files"),itemsPerPageAllText:e.$t("Files.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"filename",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r},"current-items":e.refreshMetadata},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Files.Empty")))])]},proxy:!0},e.currentPath!==""?{key:"body.prepend",fn:function(){return[t("tr",{staticClass:"file-list-cursor",on:{click:e.clickRowGoBack,dragover:function(r){return e.dragOverFilelist(r,{isDirectory:!0,filename:".."})},dragleave:e.dragLeaveFilelist,drop:function(r){return r.preventDefault(),r.stopPropagation(),e.dragDropFilelist(r,{isDirectory:!0,filename:".."})}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{disabled:""}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[t(v,[e._v(e._s(e.mdiFolderUpload))])],1),t("td",{staticClass:"",attrs:{colspan:e.filteredHeaders.length}},[e._v("..")])])]},proxy:!0}:null,{key:"item",fn:function(r){var i=r.index,n=r.item,a=r.isSelected,o=r.select;return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(l){return e.showContextMenu(l,n)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(i," ").concat(n.filename),staticClass:"file-list-cursor user-select-none",attrs:{draggable:"true","data-name":n.filename},on:{contextmenu:function(l){return e.showContextMenu(l,n)},click:function(l){return e.clickRow(n)},drag:function(l){return e.dragFile(l,n)},dragend:function(l){return e.dragendFile(l)},dragover:function(l){return e.dragOverFilelist(l,n)},dragleave:e.dragLeaveFilelist,drop:function(l){return l.preventDefault(),l.stopPropagation(),e.dragDropFilelist(l,n)}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:a},on:{click:function(l){return l.stopPropagation(),o(!a)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[n.isDirectory?[t(v,[e._v(e._s(e.mdiFolder))])]:n.small_thumbnail?[t(pe,{attrs:{top:"","content-class":"tooltip__content-opacity1",color:e.bigThumbnailTooltipColor,disabled:!n.big_thumbnail},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:n.small_thumbnail,width:"32",height:"32",alt:n.filename},slot:"image"},"img",u,!1),c)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!0)},[t("span",[t("img",{attrs:{src:n.big_thumbnail,width:"250",alt:n.filename}})])])]:[t(v,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:""},[e._v(e._s(n.filename))]),t("td",{staticClass:"text-right text-no-wrap"},[n.last_status?t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t("span",e._g(e._b({},"span",u,!1),c),[n.count_printed>0?t("span",{class:"file-list__count_printed ".concat(e.getStatusTextColor(n.last_status))},[e._v(" "+e._s(n.count_printed)+" ")]):e._e(),t(v,{attrs:{small:"",color:e.getStatusColor(n.last_status)}},[e._v(" "+e._s(e.getStatusIcon(n.last_status))+" ")])],1)]}}],null,!0)},[t("span",[e._v(e._s(n.last_status.replace(/_/g," ")))])]):e._e()],1),e._l(e.tableColumns,function(l){return t("td",{key:l.value,class:l.outputType!=="date"?"text-no-wrap":""},[e._v(" "+e._s(e.outputValue(l,n))+" "),l.value==="slicer"?[t("br"),n.slicer_version?t("small",[e._v(e._s(n.slicer_version))]):e._e()]:e._e()],2)})],2)]}}],null,!0),model:{value:e.selectedFiles,callback:function(r){e.selectedFiles=r},expression:"selectedFiles"}})],1),t(_c,{attrs:{bool:e.dialogPrintFile.show,file:e.dialogPrintFile.item,"current-path":e.currentPath},on:{closeDialog:e.closeStartPrint}}),t($e,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Oe,[e.contextMenu.item.isDirectory?e._e():t(K,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui||!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.clickRow(e.contextMenu.item,!0)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlay))]),e._v(" "+e._s(e.$t("Files.PrintStart"))+" ")],1),!e.contextMenu.item.isDirectory&&e.moonrakerComponents.includes("job_queue")?t(K,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.addToQueue(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.moonrakerComponents.includes("job_queue")?t(K,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.openAddBatchToQueueDialog(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),e.contextMenu.item.preheat_gcode!==null?t(K,{attrs:{disabled:["error","printing","paused"].includes(e.printer_state)},on:{click:function(r){return e.doSend(e.contextMenu.item.preheat_gcode)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiFire))]),e._v(" "+e._s(e.$t("Files.Preheat"))+" ")],1):e._e(),e.contextMenu.item.isDirectory?e._e():t(K,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.view3D(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiVideo3d))]),e._v(" "+e._s(e.$t("Files.View3D"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(K,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.scanMeta(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiMagnify))]),e._v(" "+e._s(e.$t("Files.ScanMeta"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(K,{on:{click:e.downloadFile}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Files.Download"))+" ")],1),e.contextMenu.item.isDirectory?t(K,{on:{click:function(r){return e.renameDirectory(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1):e._e(),e.contextMenu.item.isDirectory?e._e():t(K,{on:{click:function(r){return e.editFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiFileDocumentEditOutline))]),e._v(" "+e._s(e.$t("Files.EditFile"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(K,{on:{click:function(r){return e.renameFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(K,{on:{click:function(r){return e.duplicateFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiContentCopy))]),e._v(" "+e._s(e.$t("Files.Duplicate"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(K,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1),e.contextMenu.item.isDirectory?t(K,{staticClass:"red--text",on:{click:function(r){return e.deleteDirectory(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1):e._e()],1)],1),t(oe,{attrs:{"max-width":400},model:{value:e.dialogCreateDirectory.show,callback:function(r){e.$set(e.dialogCreateDirectory,"show",r)},expression:"dialogCreateDirectory.show"}},[t(Z,{attrs:{title:e.$t("Files.NewDirectory"),"card-class":"gcode-files-new-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldCreateDirectory",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.createDirectoryAction.apply(null,arguments)}},model:{value:e.dialogCreateDirectory.name,callback:function(r){e.$set(e.dialogCreateDirectory,"name",r)},expression:"dialogCreateDirectory.name"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createDirectoryAction}},[e._v(" "+e._s(e.$t("Files.Create"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":400},model:{value:e.dialogRenameFile.show,callback:function(r){e.$set(e.dialogRenameFile,"show",r)},expression:"dialogRenameFile.show"}},[t(Z,{attrs:{title:e.$t("Files.RenameFile"),"card-class":"gcode-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(r){e.$set(e.dialogRenameFile,"newName",r)},expression:"dialogRenameFile.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(" "+e._s(e.$t("Files.Rename"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":400},model:{value:e.dialogDuplicateFile.show,callback:function(r){e.$set(e.dialogDuplicateFile,"show",r)},expression:"dialogDuplicateFile.show"}},[t(Z,{attrs:{title:e.$t("Files.DuplicateFile"),"card-class":"gcode-files-duplicate-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDuplicateFile.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldDuplicateFile",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.duplicateFileAction.apply(null,arguments)}},model:{value:e.dialogDuplicateFile.newName,callback:function(r){e.$set(e.dialogDuplicateFile,"newName",r)},expression:"dialogDuplicateFile.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDuplicateFile.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.duplicateFileAction}},[e._v(" "+e._s(e.$t("Files.Duplicate"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogRenameDirectory.show,callback:function(r){e.$set(e.dialogRenameDirectory,"show",r)},expression:"dialogRenameDirectory.show"}},[t(Z,{attrs:{title:e.$t("Files.RenameDirectory"),"card-class":"gcode-files-rename-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldRenameDirectory",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameDirectoryAction.apply(null,arguments)}},model:{value:e.dialogRenameDirectory.newName,callback:function(r){e.$set(e.dialogRenameDirectory,"newName",r)},expression:"dialogRenameDirectory.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameDirectoryAction}},[e._v(" "+e._s(e.$t("Files.Rename"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogDeleteDirectory.show,callback:function(r){e.$set(e.dialogDeleteDirectory,"show",r)},expression:"dialogDeleteDirectory.show"}},[t(Z,{attrs:{title:e.$t("Files.DeleteDirectory"),"card-class":"gcode-files-delete-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteDirectoryQuestion",{name:e.dialogDeleteDirectory.item.filename}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteDirectoryAction}},[e._v(e._s(e.$t("Files.Delete")))])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(Z,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.contextMenu.item.filename}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Files.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Files.Delete"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(r){e.deleteSelectedDialog=r},expression:"deleteSelectedDialog"}},[t(Z,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e.selectedFiles.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.selectedFiles[0].filename}))+" ")]):t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Files.DeleteSelectedQuestion",{count:e.selectedFiles.length})))])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedFiles}},[e._v(e._s(e.$t("Files.Delete")))])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogAddBatchToQueue.show,callback:function(r){e.$set(e.dialogAddBatchToQueue,"show",r)},expression:"dialogAddBatchToQueue.show"}},[t(Z,{attrs:{title:e.$t("Files.AddToQueue"),"card-class":"gcode-files-add-to-queue-dialog",icon:e.mdiPlaylistPlus,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogAddBatchToQueue.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("Files.Count"),required:"","hide-spin-buttons":"",type:"number",rules:e.countInputRules},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.addBatchToQueueAction.apply(null,arguments)}},scopedSlots:e._u([{key:"append-outer",fn:function(){return[t("div",{staticClass:"_spin_button_group"},[t(g,{staticClass:"mt-n3",attrs:{icon:"",plain:"",small:""},on:{click:function(r){e.dialogAddBatchToQueue.count++}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.dialogAddBatchToQueue.count<=1,icon:"",plain:"",small:""},on:{click:function(r){e.dialogAddBatchToQueue.count--}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.dialogAddBatchToQueue.count,callback:function(r){e.$set(e.dialogAddBatchToQueue,"count",r)},expression:"dialogAddBatchToQueue.count"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogAddBatchToQueue.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.addBatchToQueueAction}},[e._v(e._s(e.$t("Files.AddToQueue")))])],1)],1)],1)],1)},P9=[];const g1={};var T9=N(Yo,S9,P9,!1,D9,"622b678e",null,null);function D9(e){for(let s in g1)this[s]=g1[s]}const By=function(){return T9.exports}();var M9=Object.defineProperty,E9=Object.getOwnPropertyDescriptor,O9=(e,s,t,r)=>{for(var i=r>1?void 0:r?E9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&M9(s,t,i),i};let jd=class extends j(V){constructor(){super(...arguments),this.mdiPlay=Ii,this.mdiPause=Tp,this.mdiTrayFull=ZP,this.contentTdWidth=100}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get queueState(){var e;return(e=this.$store.state.server.jobQueue.queue_state)!=null?e:""}get countPerPage(){return this.$store.state.gui.view.jobqueue.countPerPage}set countPerPage(e){this.$store.dispatch("gui/saveSetting",{name:"view.jobqueue.countPerPage",value:e})}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}pauseJobqueue(){this.$store.dispatch("server/jobQueue/pause")}mounted(){this.calcContentTdWidth()}calcContentTdWidth(){var e,s;this.contentTdWidth=((s=(e=this.$refs.jobqueuePanel)==null?void 0:e.$el)==null?void 0:s.clientWidth)-48-32}handleResize(){this.$nextTick(()=>{this.calcContentTdWidth()})}};jd=O9([O({components:{JobqueueEntry:gc,Panel:Z}})],jd);var L9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{ref:"jobqueuePanel",attrs:{icon:e.mdiTrayFull,title:e.$t("JobQueue.JobQueue").toString(),"card-class":"jobqueue-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.queueState==="paused"?t(g,{attrs:{color:"success",loading:e.loadings.includes("startJobqueue"),icon:"",tile:"",disabled:!e.klipperReadyForGui},on:{click:e.startJobqueue}},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({},"v-icon",n,!1),i),[e._v(e._s(e.mdiPlay))])]}}],null,!1,2134053718)},[t("span",[e._v(e._s(e.$t("JobQueue.Start")))])])],1):e._e(),["ready","loading"].includes(e.queueState)?t(g,{attrs:{color:"warning",loading:e.loadings.includes("pauseJobqueue"),icon:"",tile:""},on:{click:e.pauseJobqueue}},[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({},"v-icon",n,!1),i),[e._v(e._s(e.mdiPause))])]}}],null,!1,1749587264)},[t("span",[e._v(e._s(e.$t("JobQueue.Pause")))])])],1):e._e()]},proxy:!0}])},[t(Ns,{staticClass:"jobqueue-table",attrs:{items:e.jobs,"sort-by":"time_added","items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("JobQueue.Jobs"),itemsPerPageAllText:e.$t("JobQueue.AllJobs"),itemsPerPageOptions:[10,25,50,100,-1]},"mobile-breakpoint":"0"},on:{"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r}},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("JobQueue.Empty")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item;return[t(gc,{key:i.job_id,attrs:{item:i,"content-td-width":e.contentTdWidth}})]}}])}),t("resize-observer",{on:{notify:e.handleResize}})],1)],1)},k9=[];const v1={};var A9=N(jd,L9,k9,!1,F9,"5e3c80e6",null,null);function F9(e){for(let s in v1)this[s]=v1[s]}const Wy=function(){return A9.exports}();var R9=Object.defineProperty,I9=Object.getOwnPropertyDescriptor,H9=(e,s,t,r)=>{for(var i=r>1?void 0:r?I9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&R9(s,t,i),i};let Nd=class extends j(V){constructor(){super(...arguments),this.mdiLockOutline=Yl}get queued_jobs(){var e;return(e=this.$store.state.server.jobQueue.queued_jobs)!=null?e:[]}get showJobQueue(){return this.moonrakerComponents.includes("job_queue")&&this.queued_jobs.length}};Nd=H9([O({components:{JobqueuePanel:Wy,GcodefilesPanel:By}})],Nd);var j9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.existGcodesRootDirectory?t(S,[t(_,{class:e.showJobQueue?"col-12 col-md-8 pt-0 pt-md-3 order-1 order-md-0":"col-12"},[t(By)],1),e.showJobQueue?t(_,{staticClass:"col-12 col-md-4 pb-0 pb-sm-3 order-0 order-md-1"},[t(Wy)],1):e._e()],1):t(S,[t(dt,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:e.mdiLockOutline}},[e._v(" "+e._s(e.$t("Files.GcodesRootDirectoryDoesntExists"))+" ")])],1)},N9=[];const _1={};var V9=N(Nd,j9,N9,!1,U9,null,null,null);function U9(e){for(let s in _1)this[s]=_1[s]}const B9=function(){return V9.exports}();var W9=Object.defineProperty,G9=Object.getOwnPropertyDescriptor,z9=(e,s,t,r)=>{for(var i=r>1?void 0:r?G9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&W9(s,t,i),i};let Vd=class extends j(V){constructor(){super(...arguments),this.mdiDatabaseExportOutline=KS,this.mdiDelete=Ye,this.mdiDatabaseArrowDownOutline=Wb,this.mdiCog=Us,this.mdiPrinter=l0,this.mdiFileDocumentMultipleOutline=Zl,this.mdiTextBoxSearch=UP,this.mdiFile=dr,this.mdiMagnify=Jl,this.mdiUpdate=pa,this.mdiCloseThick=Ce,this.mdiNotebookPlus=wP,this.mdiNotebookEdit=xP,this.mdiNotebook=$P,this.mdiFileCancel=rP,this.formatFilesize=it,this.search="",this.sortBy="start_time",this.sortDesc=!0,this.options={},this.contextMenu={shown:!1,touchTimer:void 0,x:0,y:0,item:{}},this.detailsDialog={item:{},boolShow:!1},this.noteDialog={item:null,note:"",boolShow:!1,type:"create"},this.deleteDialog=!1,this.deleteSelectedDialog=!1}get allLoaded(){var e;return(e=this.$store.state.server.history.all_loaded)!=null?e:!1}get jobs(){var e;return(e=this.$store.getters["server/history/getFilterdJobList"])!=null?e:[]}get selectedJobs(){var e;return(e=this.$store.state.gui.view.history.selectedJobs)!=null?e:[]}set selectedJobs(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.history.selectedJobs",value:e})}get headers(){const e=[{text:"",value:"",align:"left",configable:!1,visible:!0,filterable:!1},{text:this.$t("History.Filename"),value:"filename",align:"left",configable:!1,visible:!0},{text:"",value:"status",align:"left",configable:!1,visible:!0,filterable:!1},{text:this.$t("History.Filesize"),value:"size",align:"left",configable:!0,visible:!0,outputType:"filesize"},{text:this.$t("History.LastModified"),value:"modified",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.StartTime"),value:"start_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EndTime"),value:"end_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EstimatedTime"),value:"estimated_time",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.PrintTime"),value:"print_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.TotalTime"),value:"total_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.FilamentCalc"),value:"filament_total",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FilamentUsed"),value:"filament_used",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FirstLayerExtTemp"),value:"first_layer_extr_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerBedTemp"),value:"first_layer_bed_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerHeight"),value:"first_layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.LayerHeight"),value:"layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.ObjectHeight"),value:"object_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.Slicer"),value:"slicer",align:"left",configable:!0,visible:!0}];return e.forEach(s=>{s.visible&&this.hideColums.includes(s.value)?s.visible=!1:!s.visible&&!this.hideColums.includes(s.value)&&(s.visible=!0)}),e}get tableFields(){return this.filteredHeaders.filter(e=>!["filename","status","slicer"].includes(e.value)&&e.value!=="")}get configHeaders(){return this.headers.filter(e=>e.configable===!0)}get filteredHeaders(){return this.headers.filter(e=>e.visible===!0)}get allPrintStatusArray(){var e;return $t((e=this.$store.getters["server/history/getAllPrintStatusArray"])!=null?e:[],"name")}get countPerPage(){return this.$store.state.gui.view.historycountPerPage}set countPerPage(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.countPerPage",value:e})}get hideColums(){return this.$store.state.gui.view.history.hideColums}set hideColums(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.hideColums",value:e})}get currentLanguage(){var e,s;return(s=(e=this.$store.state.gui.general)==null?void 0:e.language)!=null?s:"en"}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}formatPrintTime(e){if(e){let s="";const t=Math.floor(e/86400);t&&(e%=3600*24,s+=t+"d");const r=Math.floor(e/3600);e%=3600,r&&(s+=" "+r+"h");const i=Math.floor(e/60);i&&(s+=" "+i+"m");const n=e%60;return n&&(s+=" "+n.toFixed(0)+"s"),s}return"--"}clickRow(e){this.detailsDialog.item=e,this.detailsDialog.boolShow=!0}showContextMenu(e,s){this.contextMenu.shown||(e==null||e.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenu.y=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.contextMenu.item=s,this.$nextTick(()=>{this.contextMenu.shown=!0}))}sortFiles(e,s,t){const r=s.length?s[0]:"filename",i=t[0];return e!==void 0&&(e.sort(function(n,a){if(n[r]===a[r])return 0;if(n[r]===null||n[r]===void 0)return-1;if(a[r]===null||a[r]===void 0)return 1;if(n[r].constructor===String&&a[r].constructor===String)return n[r].localeCompare(a[r],void 0,{sensivity:"base"});if(n[r]instanceof Array&&a[r]instanceof Array){const o=n[r].length?n.filament.reduce((c,u)=>c+u):0,l=a[r].length?a.filament.reduce((c,u)=>c+u):0;return o-l}return n[r]-a[r]}),i&&e.reverse()),e}advancedSearch(e,s){return e!=null&&s!=null&&e.toString().toLowerCase().indexOf(s.toLowerCase())!==-1}getSmallThumbnail(e){if("metadata"in e&&"thumbnails"in e.metadata&&e.metadata.thumbnails.length){const s=e.metadata.thumbnails.find(r=>r.width>=ms&&r.width<=fs&&r.height>=ms&&r.height<=fs);let t="";if(e.filename.lastIndexOf("/")!==-1&&(t=e.filename.substr(0,e.filename.lastIndexOf("/")+1)),s&&"relative_path"in s)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+s.relative_path),"?timestamp=").concat(e.metadata.modified)}return!1}getBigThumbnail(e){if("metadata"in e&&"thumbnails"in e.metadata&&e.metadata.thumbnails.length){const s=e.metadata.thumbnails.find(r=>r.width>=Os);let t="";if(e.filename.lastIndexOf("/")!==-1&&(t=e.filename.substr(0,e.filename.lastIndexOf("/")+1)),s&&"relative_path"in s)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+s.relative_path),"?timestamp=").concat(e.metadata.modified)}return!1}getThumbnailWidth(e){if(this.getBigThumbnail(e)){const s=e.metadata.thumbnails.find(t=>t.width>=Os);if(s)return s.width}return 400}changeColumnVisible(e){if(this.headers.filter(s=>s.value===e).length){let s=this.headers.filter(t=>t.value===e)[0].visible;this.$store.dispatch("gui/setHistoryColumns",{name:e,value:s})}}changeStatusVisible(e){e.showInTable?this.$store.dispatch("gui/hideStatusInHistoryList",e.name):this.$store.dispatch("gui/showStatusInHistoryList",e.name)}startPrint(e){e.exists&&this.$socket.emit("printer.print.start",{filename:e.filename},{action:"switchToDashboard"})}deleteJob(){this.$socket.emit("server.history.delete_job",{uid:this.contextMenu.item.job_id},{action:"server/history/getDeletedJobs"}),this.deleteDialog=!1}deleteSelectedJobs(){this.selectedJobs.forEach(e=>{this.$socket.emit("server.history.delete_job",{uid:e.job_id},{action:"server/history/getDeletedJobs"})}),this.selectedJobs=[],this.deleteSelectedDialog=!1}exportHistory(){var l;const t=(parseFloat("1.23").toLocaleString(this.browserLocale).indexOf(",")>=0?",":".")===","?";":",",r=[],i=[];i.push("filename"),i.push("status"),this.tableFields.forEach(c=>{i.push(c.value)}),(l=this.headers.find(c=>c.value==="slicer"))!=null&&l.visible&&i.push("slicer"),r.push(i);let n=[...this.jobs];this.selectedJobs.length&&(n=[...this.selectedJobs]),n.length&&n.forEach(c=>{var h;const u=[];let d=c.filename;if(d.includes(t)&&(d='"'+d+'"'),u.push(d),u.push(c.status),this.tableFields.forEach(p=>{u.push(this.outputValue(p,c,!1,t))}),(h=this.headers.find(p=>p.value==="slicer"))!=null&&h.visible){let p="slicer"in c.metadata&&c.metadata.slicer?c.metadata.slicer:"--";"slicer_version"in c.metadata&&c.metadata.slicer_version&&(p+=" "+c.metadata.slicer_version),u.push(p)}r.push(u)});const a="data:text/csv;charset=utf-8,"+r.map(c=>c.map(u=>u.indexOf(t)===-1?u:'"'.concat(u,'"')).join(t)).join("\n"),o=document.createElement("a");o.setAttribute("href",encodeURI(a)),o.setAttribute("download","print_history.csv"),document.body.appendChild(o),o.click(),o.remove()}getStatusIcon(e){return this.$store.getters["server/history/getPrintStatusIcon"](e)}getStatusColor(e){return this.$store.getters["server/history/getPrintStatusIconColor"](e)}outputValue(e,s,t=!0,r=null){var n,a;let i=e.value in s?s[e.value]:null;if(i===null&&(i=e.value in s.metadata?s.metadata[e.value]:null),t)if(i>0)switch(e.outputType){case"filesize":return it(i);case"date":return this.formatDateTime(i*1e3);case"time":return this.formatPrintTime(i);case"temp":return(i==null?void 0:i.toFixed())+" °C";case"length":return i>1e3?(i/1e3).toFixed(2)+" m":(i==null?void 0:i.toFixed(2))+" mm";default:return i}else return"--";else switch(e.outputType){case"date":return this.formatDateTime(i*1e3);case"time":return(n=i==null?void 0:i.toFixed())!=null?n:"";default:switch(typeof i){case"number":return(a=i==null?void 0:i.toLocaleString(this.browserLocale,{useGrouping:!1}))!=null?a:0;case"string":return r!==null&&i.includes(r)&&(i='"'+i+'"'),i;default:return i}}}createNote(e){this.noteDialog.item=e,this.noteDialog.note="",this.noteDialog.type="create",this.noteDialog.boolShow=!0}editNote(e){var s;this.noteDialog.item=e,this.noteDialog.note=(s=e.note)!=null?s:"",this.noteDialog.type="edit",this.noteDialog.boolShow=!0}saveNote(){var e;this.$store.dispatch("server/history/saveHistoryNote",{job_id:(e=this.noteDialog.item)==null?void 0:e.job_id,note:this.noteDialog.note}),this.noteDialog.boolShow=!1}};Vd=z9([O({components:{Panel:Z}})],Vd);var Z9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{attrs:{icon:e.mdiFileDocumentMultipleOutline,title:e.$t("History.PrintHistory"),"card-class":"history-list-panel"}},[t(q,[t(S,[t(_,{staticClass:"col-4 d-flex align-center"},[t(re,{attrs:{"append-icon":e.mdiMagnify,label:e.$t("History.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}})],1),t(_,{staticClass:"offset-4 col-4 d-flex align-center justify-end"},[e.selectedJobs.length?[t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("History.Delete"),color:"error"},on:{click:function(r){e.deleteSelectedDialog=!0}}},[t(v,[e._v(e._s(e.mdiDelete))])],1)]:e._e(),e.allLoaded?e._e():t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",attrs:{loading:e.loadings.includes("historyLoadAll")},on:{click:e.refreshHistory}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDatabaseArrowDownOutline))])],1)]}}],null,!1,788240949)},[t("span",[e._v(e._s(e.$t("History.LoadCompleteHistory")))])]),t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",on:{click:e.exportHistory}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiDatabaseExportOutline))])],1)]}}])},[t("span",[e._v(e._s(e.$t("History.TitleExportHistory")))])]),t($e,{attrs:{"offset-y":!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Oe,[e.allPrintStatusArray.length?[e._l(e.allPrintStatusArray,function(r){return t(K,{key:r.key,staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":r.showInTable,label:"".concat(r.displayName," (").concat(r.value,")")},on:{change:function(i){return e.changeStatusVisible(r)}}})],1)}),t(E)]:e._e(),e._l(e.configHeaders,function(r){return t(K,{key:r.key,staticClass:"minHeight36"},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.text},on:{change:function(i){return e.changeColumnVisible(r.value)}},model:{value:r.visible,callback:function(i){e.$set(r,"visible",i)},expression:"header.visible"}})],1)})],2)],1)],2)],1)],1),t(E,{staticClass:"mb-3"}),t(Ns,{staticClass:"history-jobs-table",attrs:{items:e.jobs,headers:e.filteredHeaders,options:e.options,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("History.Jobs"),itemsPerPageAllText:e.$t("History.AllJobs"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"job_id",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r}},scopedSlots:e._u([{key:"item",fn:function(r){var i=r.index,n=r.item,a=r.isSelected,o=r.select;return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(l){return e.showContextMenu(l,n)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(i," ").concat(n.filename),class:"file-list-cursor user-select-none "+(n.exists?"":"text--disabled"),on:{contextmenu:function(l){return e.showContextMenu(l,n)},click:function(l){return e.clickRow(n)}}},[t("td",{staticClass:"pr-0"},[t(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:a},on:{click:function(l){return l.stopPropagation(),o(!a)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[n.exists?e.getSmallThumbnail(n)&&e.getBigThumbnail(n)?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:e.getSmallThumbnail(n),width:"32",height:"32"},slot:"image"},"img",u,!1),c)),t(at,{attrs:{slot:"preloader",indeterminate:"",color:"primary"},slot:"preloader"}),t(v,{attrs:{slot:"error"},slot:"error"},[e._v(e._s(e.mdiFile))])],1)]}}],null,!0)},[t("span",[t("img",{attrs:{src:e.getBigThumbnail(n),width:"250"}})])])]:e.getSmallThumbnail(n)?[t("vue-load-image",[t("img",{attrs:{slot:"image",src:e.getSmallThumbnail(n),width:"32",height:"32"},slot:"image"}),t(at,{attrs:{slot:"preloader",indeterminate:"",color:"primary"},slot:"preloader"}),t(v,{attrs:{slot:"error"},slot:"error"},[e._v(e._s(e.mdiFile))])],1)]:[t(v,[e._v(e._s(e.mdiFile))])]:[t(v,{staticClass:"text--disabled"},[e._v(e._s(e.mdiFileCancel))])]],2),t("td",{staticClass:""},[e._v(e._s(n.filename))]),t("td",{staticClass:"text-right text-no-wrap"},["note"in n&&n.note?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t(v,e._g(e._b({staticClass:"mr-2",attrs:{small:""}},"v-icon",u,!1),c),[e._v(" "+e._s(e.mdiNotebook)+" ")])]}}],null,!0)},[t("span",{domProps:{innerHTML:e._s(n.note.replaceAll("\n","
"))}})])]:e._e(),t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t("span",e._g(e._b({},"span",u,!1),c),[t(v,{attrs:{small:"",color:e.getStatusColor(n.status),disabled:!n.exists}},[e._v(" "+e._s(e.getStatusIcon(n.status))+" ")])],1)]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$te("History.StatusValues.".concat(n.status),"en")?e.$t("History.StatusValues.".concat(n.status)):n.status.replace(/_/g," "))+" ")])])],2),e._l(e.tableFields,function(l){return t("td",{key:l.value,class:l.outputType!=="date"?"text-no-wrap":""},[e._v(" "+e._s(e.outputValue(l,n))+" ")])}),e.headers.find(function(l){return l.value==="slicer"}).visible?t("td",{staticClass:""},[e._v(" "+e._s("slicer"in n.metadata&&n.metadata.slicer?n.metadata.slicer:"--")+" "),"slicer_version"in n.metadata&&n.metadata.slicer_version?t("small",[t("br"),e._v(" "+e._s(n.metadata.slicer_version)+" ")]):e._e()]):e._e()],2)]}}]),model:{value:e.selectedJobs,callback:function(r){e.selectedJobs=r},expression:"selectedJobs"}},[t("template",{slot:"no-data"},[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("History.Empty")))])])],2)],1),t($e,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Oe,[t(K,{on:{click:function(r){return e.clickRow(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiTextBoxSearch))]),e._v(" "+e._s(e.$t("History.Details"))+" ")],1),"note"in e.contextMenu.item&&e.contextMenu.item.note?t(K,{on:{click:function(r){return e.editNote(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiNotebookEdit))]),e._v(" "+e._s(e.$t("History.EditNote"))+" ")],1):t(K,{on:{click:function(r){return e.createNote(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiNotebookPlus))]),e._v(" "+e._s(e.$t("History.AddNote"))+" ")],1),e.contextMenu.item.exists?t(K,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:function(r){return e.startPrint(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPrinter))]),e._v(" "+e._s(e.$t("History.Reprint"))+" ")],1):e._e(),t(K,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("History.Delete"))+" ")],1)],1)],1),t(oe,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;e.detailsDialog.boolShow=!1}},model:{value:e.detailsDialog.boolShow,callback:function(r){e.$set(e.detailsDialog,"boolShow",r)},expression:"detailsDialog.boolShow"}},[t(Z,{attrs:{title:e.$t("History.JobDetails"),icon:e.mdiUpdate,"card-class":"history-detail-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.detailsDialog.boolShow=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"px-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[t(S,[t(_,[e._v(e._s(e.$t("History.Filename")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.detailsDialog.item.filename))])],1),"metadata"in e.detailsDialog.item&&"size"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.Filesize")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.formatFilesize(e.detailsDialog.item.metadata.size)))])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"modified"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.LastModified")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.formatDateTime(e.detailsDialog.item.metadata.modified*1e3))+" ")])],1)]:e._e(),t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.Status")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.$te("History.StatusValues.".concat(e.detailsDialog.item.status),"en")?e.$t("History.StatusValues.".concat(e.detailsDialog.item.status)):e.detailsDialog.item.status)+" ")])],1),t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.StartTime")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.formatDateTime(e.detailsDialog.item.start_time*1e3)))])],1),"end_time"in e.detailsDialog.item&&e.detailsDialog.item.end_time>0?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.EndTime")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.formatDateTime(e.detailsDialog.item.end_time*1e3))+" ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"estimated_time"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.EstimatedTime")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.formatPrintTime(e.detailsDialog.item.metadata.estimated_time))+" ")])],1)]:e._e(),e.detailsDialog.item.print_duration>0?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.PrintDuration")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.formatPrintTime(e.detailsDialog.item.print_duration))+" ")])],1)]:e._e(),e.detailsDialog.item.total_duration>0?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.TotalDuration")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.formatPrintTime(e.detailsDialog.item.total_duration))+" ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"filament_total"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.EstimatedFilamentWeight")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(Math.round(e.detailsDialog.item.metadata.filament_weight_total*100)/100)+" g ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"filament_total"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.EstimatedFilament")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(Math.round(e.detailsDialog.item.metadata.filament_total))+" mm ")])],1)]:e._e(),e.detailsDialog.item.filament_used>0?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.FilamentUsed")))]),t(_,{staticClass:"text-right"},[e._v(e._s(Math.round(e.detailsDialog.item.filament_used))+" mm")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"first_layer_extr_temp"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.FirstLayerExtTemp")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.detailsDialog.item.metadata.first_layer_extr_temp)+" °C ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"first_layer_bed_temp"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.FirstLayerBedTemp")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.detailsDialog.item.metadata.first_layer_bed_temp)+" °C ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"first_layer_height"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.FirstLayerHeight")))]),t(_,{staticClass:"text-right"},[e._v(" "+e._s(e.detailsDialog.item.metadata.first_layer_height)+" mm ")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"layer_height"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.LayerHeight")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.detailsDialog.item.metadata.layer_height)+" mm")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"object_height"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.ObjectHeight")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.detailsDialog.item.metadata.object_height)+" mm")])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"slicer"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.Slicer")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.detailsDialog.item.metadata.slicer))])],1)]:e._e(),"metadata"in e.detailsDialog.item&&"slicer_version"in e.detailsDialog.item.metadata?[t(E,{staticClass:"my-3"}),t(S,[t(_,[e._v(e._s(e.$t("History.SlicerVersion")))]),t(_,{staticClass:"text-right"},[e._v(e._s(e.detailsDialog.item.metadata.slicer_version))])],1)]:e._e()],2)],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(Z,{attrs:{title:e.$t("History.Delete"),"card-class":"history-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("History.DeleteSingleJobQuestion"))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("History.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteJob}},[e._v(" "+e._s(e.$t("History.Delete"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(r){e.deleteSelectedDialog=r},expression:"deleteSelectedDialog"}},[t(Z,{attrs:{title:e.$t("History.Delete"),"card-class":"history-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e.selectedJobs.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("History.DeleteSingleJobQuestion"))+" ")]):t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("History.DeleteSelectedQuestion",{count:e.selectedJobs.length}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedJobs}},[e._v(e._s(e.$t("History.Delete")))])],1)],1)],1),t(oe,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;e.noteDialog.boolShow=!1}},model:{value:e.noteDialog.boolShow,callback:function(r){e.$set(e.noteDialog,"boolShow",r)},expression:"noteDialog.boolShow"}},[t(Z,{attrs:{title:e.noteDialog.type==="create"?e.$t("History.CreateNote"):e.$t("History.EditNote"),icon:e.noteDialog.type==="create"?e.mdiNotebookPlus:e.mdiNotebookEdit,"card-class":"history-note-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.noteDialog.boolShow=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pb-0"},[t(S,[t(_,[t(Ai,{attrs:{outlined:"","hide-details":"",label:e.$t("History.Note")},model:{value:e.noteDialog.note,callback:function(r){e.$set(e.noteDialog,"note",r)},expression:"noteDialog.note"}})],1)],1)],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.noteDialog.boolShow=!1}}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.saveNote}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)],1)},q9=[];const b1={};var X9=N(Vd,Z9,q9,!1,Y9,"bd1884ac",null,null);function Y9(e){for(let s in b1)this[s]=b1[s]}const Gy=function(){return X9.exports}();var J9=Object.defineProperty,K9=Object.getOwnPropertyDescriptor,zy=(e,s,t,r)=>{for(var i=r>1?void 0:r?K9(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&J9(s,t,i),i};let Jo=class extends j(V,kt){get chartOptions(){return{animation:!1,grid:{top:25,right:40,bottom:30,left:40},tooltip:{trigger:"axis",borderWidth:0,formatter:s=>{let t="";if(s.length){t=s[0].marker;const i=s[0].axisValueLabel.split(/[^0-9]/),n=new Date(i[0],i[1]-1,i[2]),a=Math.round(s[0].data[1]*10)/10;t+=n.toLocaleDateString()+": "+a+"m"}return t}},xAxis:{type:"time",min:new Date().setHours(0,0,0)-60*60*24*14*1e3,max:new Date().setHours(0,0,0),minInterval:60*60*24*1e3,splitLine:{show:!0,lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,margin:10}},yAxis:{name:this.$t("History.HistoryFilamentUsage"),type:"value",minInterval:10,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorLow,align:"left"},splitLine:{lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,formatter:"{value}",showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorMid}}},color:["#BDBDBD"],series:[{type:"bar",data:this.filamentUsageArray,showSymbol:!1}]}}get filamentUsageArray(){return this.$store.getters["server/history/getFilamentUsageArray"]}get chart(){var s,t;return(t=(s=this.$refs.historyFilamentUsage)==null?void 0:s.chart)!=null?t:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}filamentUsageArrayChanged(s){var t;(t=this.chart)==null||t.setOption({series:{data:s}},!1,!0)}visibilityChanged(s){var t;s&&((t=this.chart)==null||t.resize())}};zy([me("filamentUsageArray")],Jo.prototype,"filamentUsageArrayChanged",1);Jo=zy([O({})],Jo);var Q9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyFilamentUsage",staticStyle:{height:"175px",width:"100%"},attrs:{option:e.chartOptions,autoresize:!0,"init-options":{renderer:"svg"}}})},e7=[];const y1={};var t7=N(Jo,Q9,e7,!1,s7,null,null,null);function s7(e){for(let s in y1)this[s]=y1[s]}const Zy=function(){return t7.exports}();var r7=Object.defineProperty,i7=Object.getOwnPropertyDescriptor,qy=(e,s,t,r)=>{for(var i=r>1?void 0:r?i7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&r7(s,t,i),i};let Ko=class extends j(V,kt){get chartOptions(){return{animation:!1,grid:{top:25,right:40,bottom:30,left:40},tooltip:{trigger:"item",borderWidth:0},xAxis:{type:"category",data:["0-2h","2-6h","6-12h","12-24h",">24h"],splitLine:{show:!0,lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorLow,margin:10}},yAxis:{name:this.$t("History.HistoryPrinttimeAVG"),type:"value",minInterval:10,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorLow,align:"left"},splitLine:{lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,formatter:"{value}",showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}},series:[{type:"bar",data:this.printtimeAvgArray,itemStyle:{color:"#BDBDBD"}}]}}get printtimeAvgArray(){return this.$store.getters["server/history/getPrinttimeAvgArray"]}get chart(){var e,s;return(s=(e=this.$refs.historyPrinttimeAvg)==null?void 0:e.chart)!=null?s:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}printtimeAvgArrayChanged(e){var s;(s=this.chart)==null||s.setOption({series:{data:e}},!1,!0)}visibilityChanged(e){var s;e&&((s=this.chart)==null||s.resize())}};qy([me("printtimeAvgArray")],Ko.prototype,"printtimeAvgArrayChanged",1);Ko=qy([O({components:{}})],Ko);var n7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyPrinttimeAvg",staticStyle:{height:"175px",width:"100%"},attrs:{option:e.chartOptions,"init-options":{renderer:"svg"}}})},a7=[];const C1={};var o7=N(Ko,n7,a7,!1,l7,null,null,null);function l7(e){for(let s in C1)this[s]=C1[s]}const Xy=function(){return o7.exports}();var c7=Object.defineProperty,u7=Object.getOwnPropertyDescriptor,Yy=(e,s,t,r)=>{for(var i=r>1?void 0:r?u7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&c7(s,t,i),i};let Qo=class extends j(V,kt){get chartOptions(){return{animation:!1,grid:{top:10,right:0,bottom:0,left:10},tooltip:{trigger:"item",borderWidth:0},series:[{type:"pie",data:this.printStatusArray,avoidLabelOverlap:!1,radius:["35%","60%"],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{color:this.fgColorHi}}]}}get selectedJobs(){var e;return(e=this.$store.state.gui.view.history.selectedJobs)!=null?e:[]}get allPrintStatusArray(){return this.$store.getters["server/history/getAllPrintStatusArray"]}get selectedPrintStatusArray(){return this.$store.getters["server/history/getSelectedPrintStatusArray"]}get printStatusArray(){const e=[];return(this.selectedJobs.length?this.selectedPrintStatusArray:this.allPrintStatusArray).forEach(t=>{const r={...t};r.name=t.displayName,e.push(r)}),e}get chart(){var e,s;return(s=(e=this.$refs.historyAllPrintStatus)==null?void 0:e.chart)!=null?s:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}printStatusArrayChanged(e){var s;(s=this.chart)==null||s.setOption({series:{data:e}},!1,!0)}visibilityChanged(e){var s;e&&((s=this.chart)==null||s.resize())}};Yy([me("printStatusArray")],Qo.prototype,"printStatusArrayChanged",1);Qo=Yy([O({components:{}})],Qo);var d7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyAllPrintStatus",staticStyle:{height:"200px",width:"100%"},attrs:{option:e.chartOptions,autoresize:!0,"init-options":{renderer:"svg"}}})},h7=[];const $1={};var p7=N(Qo,d7,h7,!1,m7,null,null,null);function m7(e){for(let s in $1)this[s]=$1[s]}const Jy=function(){return p7.exports}();var f7=Object.defineProperty,g7=Object.getOwnPropertyDescriptor,v7=(e,s,t,r)=>{for(var i=r>1?void 0:r?g7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&f7(s,t,i),i};let Ud=class extends j(V){constructor(){super(...arguments),this.mdiChartAreaspline=jS,this.mdiDatabaseArrowDownOutline=Wb}get selectedJobs(){var e;return(e=this.$store.state.gui.view.history.selectedJobs)!=null?e:[]}get existsSelectedJobs(){return this.selectedJobs.length>0}get totalPrintTime(){return"total_print_time"in this.$store.state.server.history.job_totals?this.$store.state.server.history.job_totals.total_print_time:0}get selectedPrintTime(){let e=0;return this.selectedJobs.forEach(s=>{e+=s.print_duration}),e}get longestPrintTime(){return"longest_print"in this.$store.state.server.history.job_totals?this.$store.state.server.history.job_totals.longest_print:0}get selectedLongestPrintTime(){let e=0;return this.selectedJobs.forEach(s=>{s.print_duration>e&&(e=s.print_duration)}),e}get avgPrintTime(){return this.totalJobsCount>0&&this.totalPrintTime>0?Math.round(this.totalPrintTime/this.totalJobsCount):0}get selectedAvgPrintTime(){return this.selectedJobs.length>0&&this.selectedPrintTime>0?Math.round(this.selectedPrintTime/this.selectedJobs.length):0}get totalFilamentUsed(){return"total_filament_used"in this.$store.state.server.history.job_totals?this.$store.state.server.history.job_totals.total_filament_used:0}get selectedFilamentUsed(){let e=0;return this.selectedJobs.forEach(s=>{e+=s.filament_used}),e}get totalJobsCount(){return"total_jobs"in this.$store.state.server.history.job_totals?this.$store.state.server.history.job_totals.total_jobs:0}get toggleChart(){return this.$store.state.gui.view.history.toggleChartCol3}set toggleChart(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.toggleChartCol3",value:e})}get togglePrintStatus(){return this.$store.state.gui.view.history.toggleChartCol2}set togglePrintStatus(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.toggleChartCol2",value:e})}get allLoaded(){var e;return(e=this.$store.state.server.history.all_loaded)!=null?e:!1}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}formatPrintTime(e){if(e){let s="";const t=Math.floor(e/3600);e%=3600,t&&(s+=" "+t+"h");const r=Math.floor(e/60);r&&(s+=" "+r+"m");const i=e%60;return i&&(s+=" "+i.toFixed(0)+"s"),s}return"--"}};Ud=v7([O({components:{Panel:Z,HistoryFilamentUsage:Zy,HistoryPrinttimeAvg:Xy,HistoryAllPrintStatusChart:Jy}})],Ud);var _7=Object.defineProperty,b7=Object.getOwnPropertyDescriptor,y7=(e,s,t,r)=>{for(var i=r>1?void 0:r?b7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&_7(s,t,i),i};let Bd=class extends j(V){get selectedJobs(){var e;return(e=this.$store.state.gui.view.history.selectedJobs)!=null?e:[]}get allPrintStatusArray(){return this.$store.getters["server/history/getAllPrintStatusArrayAll"]}get selectedPrintStatusArray(){return this.$store.getters["server/history/getSelectedPrintStatusArray"]}get printStatusArray(){const e=[];return(this.selectedJobs.length?this.selectedPrintStatusArray:this.allPrintStatusArray).forEach(t=>{const r={...t};r.name=t.displayName,e.push(r)}),e}};Bd=y7([O({components:{}})],Bd);var C7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(dp,[t("tbody",e._l(e.printStatusArray,function(r){return t("tr",{key:r.name},[t("td",[e._v(e._s(r.displayName))]),t("td",{staticClass:"text-right"},[e._v(e._s(r.value))])])}),0)])},$7=[];const x1={};var x7=N(Bd,C7,$7,!1,w7,null,null,null);function w7(e){for(let s in x1)this[s]=x1[s]}const S7=function(){return x7.exports}();var P7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Z,{attrs:{icon:e.mdiChartAreaspline,title:e.$t("History.Statistics"),"card-class":"history-statistics-panel",collapsible:!0}},[t(q,{staticClass:"pa-0"},[t(S,{attrs:{align:"center"}},[t(_,{staticClass:"col-12 col-sm-6 col-md-4"},[t(dp,[t("tbody",[e.existsSelectedJobs?[t("tr",[t("td",[e._v(e._s(e.$t("History.SelectedPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.selectedPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.LongestPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.selectedLongestPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.AvgPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.selectedAvgPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.SelectedFilamentUsed")))]),t("td",{staticClass:"text-right"},[e._v(e._s(Math.round(e.selectedFilamentUsed/100)/10)+" m")])]),t("tr",[t("td",[e._v(e._s(e.$t("History.SelectedJobs")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.selectedJobs.length))])])]:[t("tr",[t("td",[e._v(e._s(e.$t("History.TotalPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.totalPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.LongestPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.longestPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.AvgPrinttime")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatPrintTime(e.avgPrintTime)))])]),t("tr",[t("td",[e._v(e._s(e.$t("History.TotalFilamentUsed")))]),t("td",{staticClass:"text-right"},[e._v(e._s(Math.round(e.totalFilamentUsed/100)/10)+" m")])]),t("tr",[t("td",[e._v(e._s(e.$t("History.TotalJobs")))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.totalJobsCount))])])]],2)])],1),t(_,{staticClass:"col-12 col-sm-6 col-md-4"},[e.togglePrintStatus==="chart"?t(Jy):t(S7),t("div",{staticClass:"text-center mb-3"},[t(ho,{attrs:{small:"",mandatory:""},model:{value:e.togglePrintStatus,callback:function(r){e.togglePrintStatus=r},expression:"togglePrintStatus"}},[t(g,{attrs:{small:"",value:"chart"}},[e._v(" "+e._s(e.$t("History.Chart"))+" ")]),t(g,{attrs:{small:"",value:"table"}},[e._v(" "+e._s(e.$t("History.Table"))+" ")])],1),e.allLoaded?e._e():t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{outlined:"",small:"",loading:e.loadings.includes("historyLoadAll"),color:"primary"},on:{click:e.refreshHistory}},"v-btn",n,!1),i),[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDatabaseArrowDownOutline))])],1)]}}],null,!1,1343318810)},[t("span",[e._v(e._s(e.$t("History.LoadCompleteHistory")))])])],1)],1),t(_,{staticClass:"col-12 col-sm-12 col-md-4"},[e.toggleChart==="filament_usage"?t(Zy):e.toggleChart==="printtime_avg"?t(Xy):e._e(),t("div",{staticClass:"text-center mt-3"},[t(ho,{attrs:{small:"",mandatory:""},model:{value:e.toggleChart,callback:function(r){e.toggleChart=r},expression:"toggleChart"}},[t(g,{attrs:{small:"",value:"filament_usage"}},[e._v(" "+e._s(e.$t("History.FilamentUsage"))+" ")]),t(g,{attrs:{small:"",value:"printtime_avg"}},[e._v(" "+e._s(e.$t("History.PrinttimeAvg"))+" ")])],1)],1)],1)],1)],1)],1)},T7=[];const w1={};var D7=N(Ud,P7,T7,!1,M7,null,null,null);function M7(e){for(let s in w1)this[s]=w1[s]}const Ky=function(){return D7.exports}();var E7=Object.defineProperty,O7=Object.getOwnPropertyDescriptor,L7=(e,s,t,r)=>{for(var i=r>1?void 0:r?O7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&E7(s,t,i),i};let Wd=class extends j(V){};Wd=L7([O({components:{HistoryStatisticsPanel:Ky,HistoryListPanel:Gy}})],Wd);var k7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,[t(_,[t(Ky)],1)],1),t(S,{staticClass:"mt-0"},[t(_,[t(Gy)],1)],1)],1)},A7=[];const S1={};var F7=N(Wd,k7,A7,!1,R7,null,null,null);function R7(e){for(let s in S1)this[s]=S1[s]}const I7=function(){return F7.exports}();var H7=Object.defineProperty,j7=Object.getOwnPropertyDescriptor,N7=(e,s,t,r)=>{for(var i=r>1?void 0:r?j7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&H7(s,t,i),i};let Gd=class extends j(V){constructor(){super(...arguments),this.formatFilesize=it,this.sortFiles=Ap,this.mdiFileVideo=lP,this.mdiCloseThick=Ce,this.mdiFileDocumentMultipleOutline=Zl,this.mdiMagnify=Jl,this.mdiFolderPlus=$p,this.mdiRefresh=Hi,this.mdiFolderUpload=xp,this.mdiFolder=Cp,this.mdiFolderZipOutline=dP,this.mdiFile=dr,this.mdiCloudDownload=Pn,this.mdiRenameBox=Ql,this.mdiDelete=Ye,this.search="",this.boolVideoDialog=!1,this.videoDialogFilename="",this.dialogCreateDirectory={show:!1,name:""},this.contextMenu={shown:!1,isDirectory:!1,touchTimer:void 0,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogRenameFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogRenameDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDeleteDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[e=>!!e||this.$t("Files.InvalidNameEmpty"),e=>!this.existsFilename(e)||this.$t("Files.InvalidNameAlreadyExists")],this.rootDirectory="timelapse"}existsFilename(e){return this.files.findIndex(s=>s.filename===e)>=0}get headers(){return[{text:"",value:"",align:"left",configable:!1,visible:!0,sortable:!1},{text:this.$t("Timelapse.Name"),value:"filename",align:"left",configable:!1,visible:!0},{text:this.$t("Timelapse.Filesize"),value:"size",align:"right",configable:!0,visible:!0},{text:this.$t("Timelapse.LastModified"),value:"modified",align:"right",configable:!0,visible:!0}]}get directory(){return this.$store.getters["files/getDirectory"](this.currentPath)}get disk_usage(){var e,s;return(s=(e=this.directory)==null?void 0:e.disk_usage)!=null?s:{used:0,free:0,total:0}}get directoryPermissions(){var e,s;return(s=(e=this.directory)==null?void 0:e.permissions)!=null?s:"r"}get files(){var e,s;return[...(s=(e=this.directory)==null?void 0:e.childrens)!=null?s:[]]}get sortBy(){var e;return(e=this.$store.state.gui.view.gcodefiles.sortBy)!=null?e:"modified"}set sortBy(e){e===void 0&&(e="modified"),this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.sortBy",value:e})}get sortDesc(){var e;return(e=this.$store.state.gui.view.gcodefiles.sortDesc)!=null?e:!0}set sortDesc(e){e===void 0&&(e=!1),this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.sortDesc",value:e})}get countPerPage(){var e,s;return(s=(e=this.$store.state.gui.view.gcodefiles)==null?void 0:e.countPerPage)!=null?s:10}set countPerPage(e){this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.countPerPage",value:e})}get displayFiles(){var e,s;return(s=(e=this.files)==null?void 0:e.filter(t=>t.isDirectory?!0:t.filename.endsWith("mp4")||t.filename.endsWith("zip")))!=null?s:[]}get currentPath(){return this.$store.state.gui.view.timelapse.currentPath}get currentPathForNavigation(){return this.currentPath===this.rootDirectory?"":this.currentPath.substring(this.rootDirectory.length)}set currentPath(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.timelapse.currentPath",value:e})}get selectedFiles(){var e;return(e=this.$store.state.gui.view.timelapse.selectedFiles)!=null?e:[]}set selectedFiles(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.timelapse.selectedFiles",value:e})}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldCreateDirectory)==null||e.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:this.currentPath+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"})}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:this.currentPath},{action:"files/getDirectory"})}advancedSearch(e,s){return e!=null&&s!=null&&typeof e=="string"&&e.toString().toLowerCase().indexOf(s.toLowerCase())!==-1}getThumbnail(e){var r;const s=e.filename.slice(0,e.filename.lastIndexOf(".")),t=(r=this.files)==null?void 0:r.find(i=>i.filename===s+".jpg");return t?"".concat(this.apiUrl,"/server/files/").concat(encodeURI(this.currentPath),"/").concat(encodeURI(t.filename),"?timestamp=").concat(t.modified.getTime()):""}clickRow(e,s=!1){(!this.contextMenu.shown||s)&&(s&&(this.contextMenu.shown=!1),e.isDirectory?this.currentPath+="/"+e.filename:e.filename.endsWith("zip")?this.downloadFile(e.filename):e.filename.endsWith("mp4")&&(this.videoDialogFilename=encodeURI("".concat(this.currentPath,"/").concat(e.filename)),this.boolVideoDialog=!0))}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(e){this.currentPath="".concat(this.rootDirectory).concat(e.location)}showContextMenu(e,s){this.contextMenu.shown||(e==null||e.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenu.y=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.contextMenu.item=s,this.$nextTick(()=>{this.contextMenu.shown=!0}))}existsFramesZip(e){const s=e.filename.lastIndexOf("."),t=e.filename.slice(0,s)+".zip";return this.files.findIndex(r=>r.filename===t)!==-1}downloadFile(e){const s=this.currentPath+"/"+e,t=this.apiUrl+"/server/files/"+encodeURI(s);window.open(t)}async downloadSelectedFiles(){let e=[];const s=async(i,n)=>{for(const a of n){const o="".concat(i,"/").concat(a.filename);if(a.isDirectory&&a.childrens){await s(o,a.childrens);continue}if(e.push(o),a.filename.endsWith(".mp4")){const l=a.filename.lastIndexOf("."),c=a.filename.slice(0,l),u="".concat(c,".jpg");this.files.indexOf(d=>d.filename===u)!==-1&&e.push("".concat(i,"/").concat(u))}}};await s(this.currentPath,this.selectedFiles);const t=new Date,r="".concat(t.getFullYear()).concat(t.getMonth()).concat(t.getDate(),"-").concat(t.getHours()).concat(t.getMinutes()).concat(t.getSeconds());this.$socket.emit("server.files.zip",{items:e,dest:"timelapse/timelapse-".concat(r,".zip")},{action:"files/downloadZip",loading:"timelapseDownloadZip"}),this.selectedFiles=[]}renameFile(e){const s=e.filename.lastIndexOf(".");this.dialogRenameFile.newName=e.filename.slice(0,s),this.dialogRenameFile.item=e,this.dialogRenameFile.show=!0,setTimeout(()=>{var t;(t=this.$refs.inputFieldRenameFile)==null||t.focus()},200)}renameFileAction(){const e=this.dialogRenameFile.item.filename.lastIndexOf("."),s=this.dialogRenameFile.item.filename.slice(0,e),t=this.dialogRenameFile.item.filename.split(".").pop();if(this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.item.filename),dest:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.newName,".").concat(t)},{action:"files/getMove"}),t!=="mp4")return;this.files.find(i=>i.filename==="".concat(s,".jpg"))&&this.$socket.emit("server.files.move",{source:"".concat(this.currentPath,"/").concat(s,".jpg"),dest:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.newName,".jpg")})}renameDirectory(e){this.dialogRenameDirectory.item=e,this.dialogRenameDirectory.newName=e.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldRenameDirectory)==null||s.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:this.currentPath+"/"+this.dialogRenameDirectory.item.filename,dest:this.currentPath+"/"+this.dialogRenameDirectory.newName},{action:"files/getMove"})}removeFile(){const e=this.contextMenu.item.filename.slice(0,this.contextMenu.item.filename.lastIndexOf(".")),s=this.contextMenu.item.filename.split(".").pop();if(this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),s!=="mp4")return;const t=e+".jpg";this.files.findIndex(i=>i.filename===t)!==-1&&this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+t},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteDirectory(e){this.dialogDeleteDirectory.item=e,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:this.currentPath+"/"+this.contextMenu.item.filename,force:!0},{action:"files/getDeleteDir"})}deleteSelectedFiles(){this.selectedFiles.forEach(e=>{if(e.isDirectory)this.$socket.emit("server.files.delete_directory",{path:this.currentPath+"/"+e.filename,force:!0},{action:"files/getDeleteDir"});else{const s=e.filename.slice(0,e.filename.lastIndexOf(".")),t=e.filename.split(".").pop();if(this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+e.filename},{action:"files/getDeleteFile"}),t!=="mp4")return;const r=s+".jpg";this.files.findIndex(n=>n.filename===r)!==-1&&this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+r},{action:"files/getDeleteFile"})}}),this.selectedFiles=[],this.deleteSelectedDialog=!1}};Gd=N7([O({components:{Panel:Z,PathNavigation:Bi}})],Gd);var V7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{attrs:{title:e.$t("Timelapse.TimelapseFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"timelapse-files-panel"}},[t(q,[t(S,[t(_,{staticClass:"col-12 d-flex align-center"},[t(re,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Timelapse.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(le),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.Download"),color:"primary",loading:e.loadings.includes("timelapseDownloadZip")},on:{click:e.downloadSelectedFiles}},[t(v,[e._v(e._s(e.mdiCloudDownload))])],1):e._e(),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.Delete"),color:"error"},on:{click:function(r){e.deleteSelectedDialog=!0}}},[t(v,[e._v(e._s(e.mdiDelete))])],1):e._e(),e.directoryPermissions.includes("w")?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.CreateNewDirectory")},on:{click:e.createDirectory}},[t(v,[e._v(e._s(e.mdiFolderPlus))])],1):e._e(),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.RefreshCurrentDirectory")},on:{click:e.refreshFileList}},[t(v,[e._v(e._s(e.mdiRefresh))])],1)],1)],1)],1),t(q,[t(S,[t(_,{staticClass:"col-12 py-2 d-flex align-center"},[t("span",[t("b",{staticClass:"mr-1"},[e._v(e._s(e.$t("Timelapse.CurrentPath"))+":")]),t(Bi,{attrs:{path:e.currentPathForNavigation,"base-directory-label":"/".concat(e.rootDirectory),"on-segment-click":e.clickPathNavGoToDirectory}})],1),t(le),e.disk_usage!==null?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({},"span",n,!1),i),[t("b",[e._v(e._s(e.$t("Timelapse.FreeDisk"))+":")]),e._v(" "+e._s(e.formatFilesize(e.disk_usage.free))+" ")])]}}],null,!1,2240604619)},[t("span",[e._v(" "+e._s(e.$t("Timelapse.Used"))+": "+e._s(e.formatFilesize(e.disk_usage.used))+" "),t("br"),e._v(" "+e._s(e.$t("Timelapse.Free"))+": "+e._s(e.formatFilesize(e.disk_usage.free))+" "),t("br"),e._v(" "+e._s(e.$t("Timelapse.Total"))+": "+e._s(e.formatFilesize(e.disk_usage.total))+" ")])])]:e._e()],2)],1)],1),t(E,{staticClass:"mb-3"}),t(Ns,{staticClass:"files-table",attrs:{items:e.displayFiles,headers:e.headers,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("Timelapse.Files"),itemsPerPageAllText:e.$t("Timelapse.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"filename",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r}},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center font-italic"},[e._v(e._s(e.$t("Timelapse.Empty")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.index,n=r.item,a=r.isSelected,o=r.select;return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(l){return e.showContextMenu(l,n)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(i," ").concat(n.filename),staticClass:"file-list-cursor user-select-none",on:{contextmenu:function(l){return e.showContextMenu(l,n)},click:function(l){return e.clickRow(n)}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:a},on:{click:function(l){return l.stopPropagation(),o(!a)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[n.isDirectory?[t(v,{attrs:{width:"32"}},[e._v(e._s(e.mdiFolder))])]:n.filename.endsWith("zip")?[t(v,{attrs:{width:"32"}},[e._v(e._s(e.mdiFolderZipOutline))])]:e.getThumbnail(n)?[!n.isDirectory&&e.getThumbnail(n)?t(pe,{attrs:{top:"","content-class":"tooltip__content-opacity1"},scopedSlots:e._u([{key:"activator",fn:function(l){var c=l.on,u=l.attrs;return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:e.getThumbnail(n),alt:n.filename,width:"32"},slot:"image"},"img",u,!1),c)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{slot:"preloader",indeterminate:"",color:"primary"},slot:"preloader"})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!0)},[t("span",[t("img",{attrs:{src:e.getThumbnail(n),alt:n.filename,width:"250"}})])]):e._e()]:[t(v,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:""},[e._v(e._s(n.filename))]),e.headers.find(function(l){return l.value==="size"}).visible?t("td",{staticClass:"text-no-wrap text-right"},[e._v(" "+e._s(n.isDirectory?"--":e.formatFilesize(n.size))+" ")]):e._e(),e.headers.find(function(l){return l.value==="modified"}).visible?t("td",{staticClass:"text-right"},[e._v(" "+e._s(e.formatDateTime(n.modified))+" ")]):e._e()])]}}]),model:{value:e.selectedFiles,callback:function(r){e.selectedFiles=r},expression:"selectedFiles"}},[t("template",{slot:"items"},e._l(e.headers,function(r){return t("td",{key:r.value},[e._v(e._s(r.text))])}),0),e.currentPath!==e.rootDirectory?t("template",{slot:"body.prepend"},[t("tr",{staticClass:"file-list-cursor",on:{click:e.clickRowGoBack}},[t("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[t(v,[e._v(e._s(e.mdiFolderUpload))])],1),t("td",{staticClass:"",attrs:{colspan:e.headers.length}},[e._v("..")])])]):e._e()],2)],1),t($e,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Oe,[e.contextMenu.item.isDirectory?e._e():t(K,{on:{click:function(r){return e.downloadFile(e.contextMenu.item.filename)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Timelapse.Download"))+" ")],1),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(K,{on:{click:function(r){return e.renameDirectory(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(K,{on:{click:function(r){return e.renameFile(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(K,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")],1):e._e(),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(K,{staticClass:"red--text",on:{click:function(r){return e.deleteDirectory(e.contextMenu.item)}}},[t(v,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")],1):e._e()],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogRenameFile.show,callback:function(r){e.$set(e.dialogRenameFile,"show",r)},expression:"dialogRenameFile.show"}},[t(Z,{attrs:{title:e.$t("Timelapse.RenameFile"),"card-class":"gcode-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(r){e.$set(e.dialogRenameFile,"newName",r)},expression:"dialogRenameFile.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogCreateDirectory.show,callback:function(r){e.$set(e.dialogCreateDirectory,"show",r)},expression:"dialogCreateDirectory.show"}},[t(Z,{attrs:{title:e.$t("Timelapse.NewDirectory"),"card-class":"gcode-files-new-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldCreateDirectory",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.createDirectoryAction.apply(null,arguments)}},model:{value:e.dialogCreateDirectory.name,callback:function(r){e.$set(e.dialogCreateDirectory,"name",r)},expression:"dialogCreateDirectory.name"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createDirectoryAction}},[e._v(" "+e._s(e.$t("Timelapse.Create"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogRenameDirectory.show,callback:function(r){e.$set(e.dialogRenameDirectory,"show",r)},expression:"dialogRenameDirectory.show"}},[t(Z,{attrs:{title:e.$t("Timelapse.RenameDirectory"),"card-class":"gcode-files-rename-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(re,{ref:"inputFieldRenameDirectory",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":function(r){return e.isInvalidName=r},keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameDirectoryAction.apply(null,arguments)}},model:{value:e.dialogRenameDirectory.newName,callback:function(r){e.$set(e.dialogRenameDirectory,"newName",r)},expression:"dialogRenameDirectory.newName"}})],1),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameDirectoryAction}},[e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.dialogDeleteDirectory.show,callback:function(r){e.$set(e.dialogDeleteDirectory,"show",r)},expression:"dialogDeleteDirectory.show"}},[t(Z,{attrs:{title:e.$t("Timelapse.DeleteDirectory"),"card-class":"gcode-files-delete-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteDirectoryQuestion",{name:e.dialogDeleteDirectory.item.filename}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteDirectoryAction}},[e._v(e._s(e.$t("Timelapse.Delete")))])],1)],1)],1),t(oe,{attrs:{"max-width":700},model:{value:e.boolVideoDialog,callback:function(r){e.boolVideoDialog=r},expression:"boolVideoDialog"}},[t(Z,{attrs:{title:e.$t("Timelapse.Video"),icon:e.mdiFileVideo,"card-class":"timelapse-video-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.boolVideoDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{},[t(S,[t(_,{staticClass:"pb-0"},[t("video",{staticStyle:{width:"100%"},attrs:{src:e.apiUrl+"/server/files/"+e.videoDialogFilename,controls:""}},[e._v(" Sorry, your browser doesn't support embedded videos, but don't worry, you can "),t("a",{attrs:{href:e.apiUrl+"/server/files/"+e.videoDialogFilename}},[e._v("download it")]),e._v(" and watch it with your favorite video player! ")])])],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{text:"",color:"primary",href:e.apiUrl+"/server/files/"+e.videoDialogFilename,target:"_blank"}},[e._v(" "+e._s(e.$t("Timelapse.Download"))+" ")])],1)],1)],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(Z,{attrs:{title:e.$t("Timelapse.Delete"),"card-class":"timelapse-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSingleFileQuestion",{name:e.contextMenu.item.filename}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")])],1)],1)],1),t(oe,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(r){e.deleteSelectedDialog=r},expression:"deleteSelectedDialog"}},[t(Z,{attrs:{title:e.$t("Timelapse.Delete"),"card-class":"timelapse-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e.selectedFiles.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSingleFileQuestion",{name:e.selectedFiles[0].filename}))+" ")]):t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSelectedQuestion",{count:e.selectedFiles.length}))+" ")])]),t(ne,[t(le),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedFiles}},[e._v(e._s(e.$t("Timelapse.Delete")))])],1)],1)],1)],1)},U7=[];const P1={};var B7=N(Gd,V7,U7,!1,W7,"45e836df",null,null);function W7(e){for(let s in P1)this[s]=P1[s]}const Qy=function(){return B7.exports}();var G7=Object.defineProperty,z7=Object.getOwnPropertyDescriptor,Z7=(e,s,t,r)=>{for(var i=r>1?void 0:r?z7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&G7(s,t,i),i};let zd=class extends j(V,cr){constructor(){super(...arguments),this.mdiInformation=At,this.mdiFile=dr,this.mdiCloseThick=Ce,this.mdiTextBoxSearchOutline=g0,this.boolDialogRendersettings=!1,this.scale=1}get frameUrl(){var s,t,r;const e=(r=(t=(s=this.$store.state.server.timelapse)==null?void 0:s.lastFrame)==null?void 0:t.file)!=null?r:null;return e?this.apiUrl+"/server/files/timelapse_frames/"+e:null}get framesCount(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.lastFrame)==null?void 0:s.count)!=null?t:0}get enabled(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.enabled)!=null?t:!1}set enabled(e){this.$socket.emit("machine.timelapse.post_settings",{enabled:e},{action:"server/timelapse/initSettings"})}get autorender(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.autorender)!=null?t:!1}set autorender(e){this.$socket.emit("machine.timelapse.post_settings",{autorender:e},{action:"server/timelapse/initSettings"})}get variable_fps(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.variable_fps)!=null?t:!1}set variable_fps(e){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps:e})}get framerateTypeOptions(){return[{value:!1,text:this.$t("Timelapse.Fixed")},{value:!0,text:this.$t("Timelapse.Variable")}]}get variable_fps_min(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.variable_fps_min)!=null?t:5}set variable_fps_min(e){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_min:e})}get variable_fps_max(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.variable_fps_max)!=null?t:60}set variable_fps_max(e){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_max:e})}get targetlength(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.targetlength)!=null?t:10}set targetlength(e){this.$store.dispatch("server/timelapse/saveSetting",{targetlength:e})}get output_framerate(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.output_framerate)!=null?t:30}set output_framerate(e){this.$store.dispatch("server/timelapse/saveSetting",{output_framerate:e})}get duplicatelastframe(){var e,s,t;return(t=(s=(e=this.$store.state.server.timelapse)==null?void 0:e.settings)==null?void 0:s.duplicatelastframe)!=null?t:0}set duplicatelastframe(e){this.$store.dispatch("server/timelapse/saveSetting",{duplicatelastframe:e})}get estimatedVideoLength(){let e=Math.round((this.framesCount+this.duplicatelastframe)/this.output_framerate);return this.variable_fps&&(e=Math.round((this.framesCount+this.duplicatelastframe)/this.variableTargetFps),e60?Math.floor(e/60)+"m "+(e-Math.floor(e/60)*60)+"s":e+"s"}get variableTargetFps(){let e=Math.floor(this.framesCount/this.targetlength);return e=Math.max(e,this.variable_fps_min),e=Math.min(e,this.variable_fps_max),e}get disableRenderButton(){var e,s;return((s=(e=this.$store.state.server.timelapse)==null?void 0:e.rendering.status)!=null?s:"")==="running"}get camId(){var e;return(e=this.$store.state.server.timelapse.settings.camera)!=null?e:""}get camSettings(){return this.$store.getters["gui/webcams/getWebcam"](this.camId)}get webcamStyle(){var e,s,t;return{transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(t=this.camSettings.rotation)!=null?t:0)}}startRender(){this.boolDialogRendersettings=!1,this.$socket.emit("machine.timelapse.render",{})}saveFrames(){this.$socket.emit("machine.timelapse.saveframes",{},{loading:"timelapse_saveframes"})}calcRatio(){this.$refs.timelapsePreview&&(this.scale=this.$refs.timelapsePreview.naturalHeight/this.$refs.timelapsePreview.naturalWidth,this.scale>1&&(this.scale=this.$refs.timelapsePreview.naturalWidth/this.$refs.timelapsePreview.naturalHeight))}};zd=Z7([O({components:{Panel:Z,SettingsRow:U}})],zd);var q7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{staticClass:"mb-3"},[t(oa,{attrs:{flat:"",dense:""}},[t(ki,[t("span",{staticClass:"subheading align-baseline"},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiInformation))]),e._v(" "+e._s(e.$t("Timelapse.Status"))+" ")],1)])],1),t(S,{attrs:{"no-gutters":""}},[t(_,{staticClass:"col-12 col-sm-6 col-md-12 pb-3 pb-md-0 text--secondary"},[e.frameUrl?t(q,{staticClass:"pb-0"},[t(S,[t(_,[t("vue-load-image",[t("img",{ref:"timelapsePreview",staticClass:"w-100",style:e.webcamStyle,attrs:{slot:"image",src:e.frameUrl,alt:e.$t("Timelapse.Preview")},on:{load:e.calcRatio},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(at,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])],1)],1)],1):e._e()],1),e.framesCount>0?t(_,{staticClass:"col-12 col-sm-6 col-md-12 pt-3 pt-md-0 text--secondary",attrs:{"align-self":"center"}},[t(q,{class:e.framesCount?"pt-0":""},[e.framesCount>0?[t(U,{attrs:{title:e.$t("Timelapse.Frames").toString()}},[e._v(" "+e._s(e.framesCount)+" ")]),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Timelapse.EstimatedLength").toString(),"dynamic-slot-width":!0}},[e._v(" "+e._s(e.estimatedVideoLength)+" ")])]:e._e(),["printing","paused"].includes(e.printer_state)?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Timelapse.Enabled").toString(),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.enabled,callback:function(r){e.enabled=r},expression:"enabled"}})],1),e.enabled?[e.framesCount>0?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:e.$t("Timelapse.Autorender").toString(),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.autorender,callback:function(r){e.autorender=r},expression:"autorender"}})],1)]:e._e()]:e._e(),e.framesCount>0&&!["printing","paused"].includes(e.printer_state)?[t(E,{staticClass:"mt-2 mb-4"}),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{text:"",color:"primary",disabled:e.disableRenderButton},on:{click:function(r){e.boolDialogRendersettings=!0}}},[e._v(" "+e._s(e.$t("Timelapse.Render"))+" ")]),t(g,{attrs:{text:"",color:"primary",loading:e.loadings.includes("timelapse_saveframes")},on:{click:e.saveFrames}},[e._v(" "+e._s(e.$t("Timelapse.SaveFrames"))+" ")])],1)],1)]:e._e()],2)],1):t(_,{staticClass:"col-12 text--secondary",attrs:{"align-self":"center"}},[t(q,{staticClass:"pt-0 pt-md-3"},[t("p",{staticClass:"text-center my-0 font-italic"},[e._v(e._s(e.$t("Timelapse.NoActiveTimelapse")))])])],1)],1)],1),t(oe,{attrs:{"max-width":700,"max-height":500},model:{value:e.boolDialogRendersettings,callback:function(r){e.boolDialogRendersettings=r},expression:"boolDialogRendersettings"}},[t(Z,{attrs:{title:e.$t("Timelapse.RenderSettings").toString(),icon:e.mdiTextBoxSearchOutline,"card-class":"timelapse-rendersettings-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:""},on:{click:function(r){e.boolDialogRendersettings=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{},[t(S,[t(_,{staticClass:"col-4"},[t(Le,{attrs:{label:e.$t("Timelapse.Type"),items:e.framerateTypeOptions,outlined:"",dense:"","hide-details":""},model:{value:e.variable_fps,callback:function(r){e.variable_fps=r},expression:"variable_fps"}})],1),t(_,{staticClass:"col-4"},[e.variable_fps?[t(re,{attrs:{label:e.$t("Timelapse.MinFramerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.variable_fps_min,callback:function(r){e.variable_fps_min=r},expression:"variable_fps_min"}}),t(re,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.MaxFramerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.variable_fps_max,callback:function(r){e.variable_fps_max=r},expression:"variable_fps_max"}}),t(re,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.Targetlength"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.targetlength,callback:function(r){e.targetlength=r},expression:"targetlength"}})]:[t(re,{attrs:{label:e.$t("Timelapse.Framerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.output_framerate,callback:function(r){e.output_framerate=r},expression:"output_framerate"}})],t(re,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.DuplicateLastframe"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.duplicatelastframe,callback:function(r){e.duplicatelastframe=r},expression:"duplicatelastframe"}})],2),t(_,{staticClass:"col-4"},[e.variable_fps?[t(re,{staticClass:"mb-3",attrs:{label:e.$t("Timelapse.TargetFps"),type:"number",outlined:"",dense:"","hide-details":"",readonly:""},model:{value:e.variableTargetFps,callback:function(r){e.variableTargetFps=r},expression:"variableTargetFps"}})]:e._e(),t(re,{attrs:{label:e.$t("Timelapse.EstimatedLength"),outlined:"",dense:"","hide-details":"",readonly:""},model:{value:e.estimatedVideoLength,callback:function(r){e.estimatedVideoLength=r},expression:"estimatedVideoLength"}})],2)],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:function(r){e.boolDialogRendersettings=!1}}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.startRender}},[e._v(e._s(e.$t("Timelapse.StartRender")))])],1)],1)],1)],1)},X7=[];const T1={};var Y7=N(zd,q7,X7,!1,J7,null,null,null);function J7(e){for(let s in T1)this[s]=T1[s]}const e2=function(){return Y7.exports}();var K7=Object.defineProperty,Q7=Object.getOwnPropertyDescriptor,e8=(e,s,t,r)=>{for(var i=r>1?void 0:r?Q7(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&K7(s,t,i),i};let Zd=class extends j(V){};Zd=e8([O({components:{TimelapseStatusPanel:e2,TimelapseFilesPanel:Qy}})],Zd);var t8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,{staticClass:"col-12 col-md-8 pt-0 pt-md-3",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"2"}},[t(Qy)],1),t(_,{staticClass:"col-12 col-md-4",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"1"}},[t(e2)],1)],1)},s8=[];const D1={};var r8=N(Zd,t8,s8,!1,i8,null,null,null);function i8(e){for(let s in D1)this[s]=D1[s]}const n8=function(){return r8.exports}();var qd={exports:{}};const a8="2.0.0",t2=256,o8=Number.MAX_SAFE_INTEGER||9007199254740991,l8=16,c8=t2-6,u8=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Mc={MAX_LENGTH:t2,MAX_SAFE_COMPONENT_LENGTH:l8,MAX_SAFE_BUILD_LENGTH:c8,MAX_SAFE_INTEGER:o8,RELEASE_TYPES:u8,SEMVER_SPEC_VERSION:a8,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const d8=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ec=d8;(function(e,s){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Mc,n=Ec;s=e.exports={};const a=s.re=[],o=s.safeRe=[],l=s.src=[],c=s.t={};let u=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[d,r]],p=f=>{for(const[b,C]of h)f=f.split("".concat(b,"*")).join("".concat(b,"{0,").concat(C,"}")).split("".concat(b,"+")).join("".concat(b,"{1,").concat(C,"}"));return f},m=(f,b,C)=>{const w=p(b),M=u++;n(f,M,b),c[f]=M,l[M]=b,a[M]=new RegExp(b,C?"g":void 0),o[M]=new RegExp(w,C?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(d,"*")),m("MAINVERSION","(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")")),m("MAINVERSIONLOOSE","(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")")),m("PRERELEASEIDENTIFIER","(?:".concat(l[c.NUMERICIDENTIFIER],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),m("PRERELEASEIDENTIFIERLOOSE","(?:".concat(l[c.NUMERICIDENTIFIERLOOSE],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),m("PRERELEASE","(?:-(".concat(l[c.PRERELEASEIDENTIFIER],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIER],")*))")),m("PRERELEASELOOSE","(?:-?(".concat(l[c.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIERLOOSE],")*))")),m("BUILDIDENTIFIER","".concat(d,"+")),m("BUILD","(?:\\+(".concat(l[c.BUILDIDENTIFIER],"(?:\\.").concat(l[c.BUILDIDENTIFIER],")*))")),m("FULLPLAIN","v?".concat(l[c.MAINVERSION]).concat(l[c.PRERELEASE],"?").concat(l[c.BUILD],"?")),m("FULL","^".concat(l[c.FULLPLAIN],"$")),m("LOOSEPLAIN","[v=\\s]*".concat(l[c.MAINVERSIONLOOSE]).concat(l[c.PRERELEASELOOSE],"?").concat(l[c.BUILD],"?")),m("LOOSE","^".concat(l[c.LOOSEPLAIN],"$")),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE","".concat(l[c.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),m("XRANGEIDENTIFIER","".concat(l[c.NUMERICIDENTIFIER],"|x|X|\\*")),m("XRANGEPLAIN","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:".concat(l[c.PRERELEASE],")?").concat(l[c.BUILD],"?")+")?)?"),m("XRANGEPLAINLOOSE","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(l[c.PRERELEASELOOSE],")?").concat(l[c.BUILD],"?")+")?)?"),m("XRANGE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAIN],"$")),m("XRANGELOOSE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAINLOOSE],"$")),m("COERCE","(^|[^\\d])(\\d{1,".concat(t,"})")+"(?:\\.(\\d{1,".concat(t,"}))?")+"(?:\\.(\\d{1,".concat(t,"}))?")+"(?:$|[^\\d])"),m("COERCERTL",l[c.COERCE],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM","(\\s*)".concat(l[c.LONETILDE],"\\s+"),!0),s.tildeTrimReplace="$1~",m("TILDE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAIN],"$")),m("TILDELOOSE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAINLOOSE],"$")),m("LONECARET","(?:\\^)"),m("CARETTRIM","(\\s*)".concat(l[c.LONECARET],"\\s+"),!0),s.caretTrimReplace="$1^",m("CARET","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAIN],"$")),m("CARETLOOSE","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAINLOOSE],"$")),m("COMPARATORLOOSE","^".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],")$|^$")),m("COMPARATOR","^".concat(l[c.GTLT],"\\s*(").concat(l[c.FULLPLAIN],")$|^$")),m("COMPARATORTRIM","(\\s*)".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],"|").concat(l[c.XRANGEPLAIN],")"),!0),s.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE","^\\s*(".concat(l[c.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAIN],")")+"\\s*$"),m("HYPHENRANGELOOSE","^\\s*(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s*$"),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(qd,qd.exports);var ya=qd.exports;const h8=Object.freeze({loose:!0}),p8=Object.freeze({}),m8=e=>e?typeof e!="object"?h8:e:p8;var om=m8;const M1=/^[0-9]+$/,s2=(e,s)=>{const t=M1.test(e),r=M1.test(s);return t&&r&&(e=+e,s=+s),e===s?0:t&&!r?-1:r&&!t?1:es2(s,e);var r2={compareIdentifiers:s2,rcompareIdentifiers:f8};const Ia=Ec,{MAX_LENGTH:E1,MAX_SAFE_INTEGER:Ha}=Mc,{safeRe:O1,t:L1}=ya,g8=om,{compareIdentifiers:Xr}=r2;let v8=class ps{constructor(s,t){if(t=g8(t),s instanceof ps){if(s.loose===!!t.loose&&s.includePrerelease===!!t.includePrerelease)return s;s=s.version}else if(typeof s!="string")throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof s,'".'));if(s.length>E1)throw new TypeError("version is longer than ".concat(E1," characters"));Ia("SemVer",s,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=s.trim().match(t.loose?O1[L1.LOOSE]:O1[L1.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(s));if(this.raw=s,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ha||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ha||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ha||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const n=+i;if(n>=0&&n=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),Xr(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error("invalid increment argument: ".concat(s))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}};var Pt=v8;const k1=Pt,_8=(e,s,t=!1)=>{if(e instanceof k1)return e;try{return new k1(e,s)}catch(r){if(!t)return null;throw r}};var Wi=_8;const b8=Wi,y8=(e,s)=>{const t=b8(e,s);return t?t.version:null};var C8=y8;const $8=Wi,x8=(e,s)=>{const t=$8(e.trim().replace(/^[=v]+/,""),s);return t?t.version:null};var w8=x8;const A1=Pt,S8=(e,s,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new A1(e instanceof A1?e.version:e,t).inc(s,r,i).version}catch{return null}};var P8=S8;const F1=Wi,T8=(e,s)=>{const t=F1(e,null,!0),r=F1(s,null,!0),i=t.compare(r);if(i===0)return null;const n=i>0,a=n?t:r,o=n?r:t,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l)return!o.patch&&!o.minor?"major":a.patch?"patch":a.minor?"minor":"major";const u=l?"pre":"";return t.major!==r.major?u+"major":t.minor!==r.minor?u+"minor":t.patch!==r.patch?u+"patch":"prerelease"};var D8=T8;const M8=Pt,E8=(e,s)=>new M8(e,s).major;var O8=E8;const L8=Pt,k8=(e,s)=>new L8(e,s).minor;var A8=k8;const F8=Pt,R8=(e,s)=>new F8(e,s).patch;var I8=R8;const H8=Wi,j8=(e,s)=>{const t=H8(e,s);return t&&t.prerelease.length?t.prerelease:null};var N8=j8;const R1=Pt,V8=(e,s,t)=>new R1(e,t).compare(new R1(s,t));var ls=V8;const U8=ls,B8=(e,s,t)=>U8(s,e,t);var W8=B8;const G8=ls,z8=(e,s)=>G8(e,s,!0);var Z8=z8;const I1=Pt,q8=(e,s,t)=>{const r=new I1(e,t),i=new I1(s,t);return r.compare(i)||r.compareBuild(i)};var lm=q8;const X8=lm,Y8=(e,s)=>e.sort((t,r)=>X8(t,r,s));var J8=Y8;const K8=lm,Q8=(e,s)=>e.sort((t,r)=>K8(r,t,s));var eR=Q8;const tR=ls,sR=(e,s,t)=>tR(e,s,t)>0;var Oc=sR;const rR=ls,iR=(e,s,t)=>rR(e,s,t)<0;var cm=iR;const nR=ls,aR=(e,s,t)=>nR(e,s,t)===0;var i2=aR;const oR=ls,lR=(e,s,t)=>oR(e,s,t)!==0;var n2=lR;const cR=ls,uR=(e,s,t)=>cR(e,s,t)>=0;var um=uR;const dR=ls,hR=(e,s,t)=>dR(e,s,t)<=0;var dm=hR;const pR=i2,mR=n2,fR=Oc,gR=um,vR=cm,_R=dm,bR=(e,s,t,r)=>{switch(s){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return pR(e,t,r);case"!=":return mR(e,t,r);case">":return fR(e,t,r);case">=":return gR(e,t,r);case"<":return vR(e,t,r);case"<=":return _R(e,t,r);default:throw new TypeError("Invalid operator: ".concat(s))}};var a2=bR;const yR=Pt,CR=Wi,{safeRe:ja,t:Na}=ya,$R=(e,s)=>{if(e instanceof yR)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;s=s||{};let t=null;if(!s.rtl)t=e.match(ja[Na.COERCE]);else{let r;for(;(r=ja[Na.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||r.index+r[0].length!==t.index+t[0].length)&&(t=r),ja[Na.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;ja[Na.COERCERTL].lastIndex=-1}return t===null?null:CR("".concat(t[2],".").concat(t[3]||"0",".").concat(t[4]||"0"),s)};var xR=$R,wu,H1;function wR(){return H1||(H1=1,wu=function(e){e.prototype[Symbol.iterator]=function*(){for(let s=this.head;s;s=s.next)yield s.value}}),wu}var SR=Ee;Ee.Node=Hr;Ee.create=Ee;function Ee(e){var s=this;if(s instanceof Ee||(s=new Ee),s.tail=null,s.head=null,s.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){s.push(i)});else if(arguments.length>0)for(var t=0,r=arguments.length;t1)t=s;else if(this.head)r=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)t=e(t,r.value,i),r=r.next;return t};Ee.prototype.reduceReverse=function(e,s){var t,r=this.tail;if(arguments.length>1)t=s;else if(this.tail)r=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)t=e(t,r.value,i),r=r.prev;return t};Ee.prototype.toArray=function(){for(var e=new Array(this.length),s=0,t=this.head;t!==null;s++)e[s]=t.value,t=t.next;return e};Ee.prototype.toArrayReverse=function(){for(var e=new Array(this.length),s=0,t=this.tail;t!==null;s++)e[s]=t.value,t=t.prev;return e};Ee.prototype.slice=function(e,s){s=s||this.length,s<0&&(s+=this.length),e=e||0,e<0&&(e+=this.length);var t=new Ee;if(sthis.length&&(s=this.length);for(var r=0,i=this.head;i!==null&&rthis.length&&(s=this.length);for(var r=this.length,i=this.tail;i!==null&&r>s;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)t.push(i.value);return t};Ee.prototype.splice=function(e,s,...t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r1;class ER{constructor(s){if(typeof s=="number"&&(s={max:s}),s||(s={}),s.max&&(typeof s.max!="number"||s.max<0))throw new TypeError("max must be a non-negative number");this[$r]=s.max||1/0;const t=s.length||Su;if(this[Yr]=typeof t!="function"?Su:t,this[yn]=s.stale||!1,s.maxAge&&typeof s.maxAge!="number")throw new TypeError("maxAge must be a number");this[Tr]=s.maxAge||0,this[Ts]=s.dispose,this[j1]=s.noDisposeOnSet||!1,this[o2]=s.updateAgeOnGet||!1,this.reset()}set max(s){if(typeof s!="number"||s<0)throw new TypeError("max must be a non-negative number");this[$r]=s||1/0,en(this)}get max(){return this[$r]}set allowStale(s){this[yn]=!!s}get allowStale(){return this[yn]}set maxAge(s){if(typeof s!="number")throw new TypeError("maxAge must be a non-negative number");this[Tr]=s,en(this)}get maxAge(){return this[Tr]}set lengthCalculator(s){typeof s!="function"&&(s=Su),s!==this[Yr]&&(this[Yr]=s,this[Ms]=0,this[st].forEach(t=>{t.length=this[Yr](t.value,t.key),this[Ms]+=t.length})),en(this)}get lengthCalculator(){return this[Yr]}get length(){return this[Ms]}get itemCount(){return this[st].length}rforEach(s,t){t=t||this;for(let r=this[st].tail;r!==null;){const i=r.prev;N1(this,s,r,t),r=i}}forEach(s,t){t=t||this;for(let r=this[st].head;r!==null;){const i=r.next;N1(this,s,r,t),r=i}}keys(){return this[st].toArray().map(s=>s.key)}values(){return this[st].toArray().map(s=>s.value)}reset(){this[Ts]&&this[st]&&this[st].length&&this[st].forEach(s=>this[Ts](s.key,s.value)),this[es]=new Map,this[st]=new MR,this[Ms]=0}dump(){return this[st].map(s=>el(this,s)?!1:{k:s.key,v:s.value,e:s.now+(s.maxAge||0)}).toArray().filter(s=>s)}dumpLru(){return this[st]}set(s,t,r){if(r=r||this[Tr],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,n=this[Yr](t,s);if(this[es].has(s)){if(n>this[$r])return ni(this,this[es].get(s)),!1;const l=this[es].get(s).value;return this[Ts]&&(this[j1]||this[Ts](s,l.value)),l.now=i,l.maxAge=r,l.value=t,this[Ms]+=n-l.length,l.length=n,this.get(s),en(this),!0}const a=new OR(s,t,n,i,r);return a.length>this[$r]?(this[Ts]&&this[Ts](s,t),!1):(this[Ms]+=a.length,this[st].unshift(a),this[es].set(s,this[st].head),en(this),!0)}has(s){if(!this[es].has(s))return!1;const t=this[es].get(s).value;return!el(this,t)}get(s){return Pu(this,s,!0)}peek(s){return Pu(this,s,!1)}pop(){const s=this[st].tail;return s?(ni(this,s),s.value):null}del(s){ni(this,this[es].get(s))}load(s){this.reset();const t=Date.now();for(let r=s.length-1;r>=0;r--){const i=s[r],n=i.e||0;if(n===0)this.set(i.k,i.v);else{const a=n-t;a>0&&this.set(i.k,i.v,a)}}}prune(){this[es].forEach((s,t)=>Pu(this,t,!1))}}const Pu=(e,s,t)=>{const r=e[es].get(s);if(r){const i=r.value;if(el(e,i)){if(ni(e,r),!e[yn])return}else t&&(e[o2]&&(r.value.now=Date.now()),e[st].unshiftNode(r));return i.value}},el=(e,s)=>{if(!s||!s.maxAge&&!e[Tr])return!1;const t=Date.now()-s.now;return s.maxAge?t>s.maxAge:e[Tr]&&t>e[Tr]},en=e=>{if(e[Ms]>e[$r])for(let s=e[st].tail;e[Ms]>e[$r]&&s!==null;){const t=s.prev;ni(e,s),s=t}},ni=(e,s)=>{if(s){const t=s.value;e[Ts]&&e[Ts](t.key,t.value),e[Ms]-=t.length,e[es].delete(t.key),e[st].removeNode(s)}};class OR{constructor(s,t,r,i,n){this.key=s,this.value=t,this.length=r,this.now=i,this.maxAge=n||0}}const N1=(e,s,t,r)=>{let i=t.value;el(e,i)&&(ni(e,t),e[yn]||(i=void 0)),i&&s.call(r,i.value,i.key,e)};var LR=ER,Tu,V1;function cs(){if(V1)return Tu;V1=1;class e{constructor(z,X){if(X=r(X),z instanceof e)return z.loose===!!X.loose&&z.includePrerelease===!!X.includePrerelease?z:new e(z.raw,X);if(z instanceof i)return this.raw=z.value,this.set=[[z]],this.format(),this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=z.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(Q=>this.parseRange(Q.trim())).filter(Q=>Q.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const Q=this.set[0];if(this.set=this.set.filter(te=>!m(te[0])),this.set.length===0)this.set=[Q];else if(this.set.length>1){for(const te of this.set)if(te.length===1&&f(te[0])){this.set=[te];break}}}this.format()}format(){return this.range=this.set.map(z=>z.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(z){const Q=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+z,te=t.get(Q);if(te)return te;const se=this.options.loose,F=se?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];z=z.replace(F,B(this.options.includePrerelease)),n("hyphen replace",z),z=z.replace(o[l.COMPARATORTRIM],c),n("comparator trim",z),z=z.replace(o[l.TILDETRIM],u),n("tilde trim",z),z=z.replace(o[l.CARETTRIM],d),n("caret trim",z);let G=z.split(" ").map(Y=>C(Y,this.options)).join(" ").split(/\s+/).map(Y=>W(Y,this.options));se&&(G=G.filter(Y=>(n("loose invalid filter",Y,this.options),!!Y.match(o[l.COMPARATORLOOSE])))),n("range list",G);const x=new Map,P=G.map(Y=>new i(Y,this.options));for(const Y of P){if(m(Y))return[Y];x.set(Y.value,Y)}x.size>1&&x.has("")&&x.delete("");const L=[...x.values()];return t.set(Q,L),L}intersects(z,X){if(!(z instanceof e))throw new TypeError("a Range is required");return this.set.some(Q=>b(Q,X)&&z.set.some(te=>b(te,X)&&Q.every(se=>te.every(F=>se.intersects(F,X)))))}test(z){if(!z)return!1;if(typeof z=="string")try{z=new a(z,this.options)}catch{return!1}for(let X=0;XD.value==="<0.0.0-0",f=D=>D.value==="",b=(D,z)=>{let X=!0;const Q=D.slice();let te=Q.pop();for(;X&&Q.length;)X=Q.every(se=>te.intersects(se,z)),te=Q.pop();return X},C=(D,z)=>(n("comp",D,z),D=A(D,z),n("caret",D),D=M(D,z),n("tildes",D),D=T(D,z),n("xrange",D),D=R(D,z),n("stars",D),D),w=D=>!D||D.toLowerCase()==="x"||D==="*",M=(D,z)=>D.trim().split(/\s+/).map(X=>H(X,z)).join(" "),H=(D,z)=>{const X=z.loose?o[l.TILDELOOSE]:o[l.TILDE];return D.replace(X,(Q,te,se,F,G)=>{n("tilde",D,Q,te,se,F,G);let x;return w(te)?x="":w(se)?x=">=".concat(te,".0.0 <").concat(+te+1,".0.0-0"):w(F)?x=">=".concat(te,".").concat(se,".0 <").concat(te,".").concat(+se+1,".0-0"):G?(n("replaceTilde pr",G),x=">=".concat(te,".").concat(se,".").concat(F,"-").concat(G," <").concat(te,".").concat(+se+1,".0-0")):x=">=".concat(te,".").concat(se,".").concat(F," <").concat(te,".").concat(+se+1,".0-0"),n("tilde return",x),x})},A=(D,z)=>D.trim().split(/\s+/).map(X=>$(X,z)).join(" "),$=(D,z)=>{n("caret",D,z);const X=z.loose?o[l.CARETLOOSE]:o[l.CARET],Q=z.includePrerelease?"-0":"";return D.replace(X,(te,se,F,G,x)=>{n("caret",D,te,se,F,G,x);let P;return w(se)?P="":w(F)?P=">=".concat(se,".0.0").concat(Q," <").concat(+se+1,".0.0-0"):w(G)?se==="0"?P=">=".concat(se,".").concat(F,".0").concat(Q," <").concat(se,".").concat(+F+1,".0-0"):P=">=".concat(se,".").concat(F,".0").concat(Q," <").concat(+se+1,".0.0-0"):x?(n("replaceCaret pr",x),se==="0"?F==="0"?P=">=".concat(se,".").concat(F,".").concat(G,"-").concat(x," <").concat(se,".").concat(F,".").concat(+G+1,"-0"):P=">=".concat(se,".").concat(F,".").concat(G,"-").concat(x," <").concat(se,".").concat(+F+1,".0-0"):P=">=".concat(se,".").concat(F,".").concat(G,"-").concat(x," <").concat(+se+1,".0.0-0")):(n("no pr"),se==="0"?F==="0"?P=">=".concat(se,".").concat(F,".").concat(G).concat(Q," <").concat(se,".").concat(F,".").concat(+G+1,"-0"):P=">=".concat(se,".").concat(F,".").concat(G).concat(Q," <").concat(se,".").concat(+F+1,".0-0"):P=">=".concat(se,".").concat(F,".").concat(G," <").concat(+se+1,".0.0-0")),n("caret return",P),P})},T=(D,z)=>(n("replaceXRanges",D,z),D.split(/\s+/).map(X=>I(X,z)).join(" ")),I=(D,z)=>{D=D.trim();const X=z.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return D.replace(X,(Q,te,se,F,G,x)=>{n("xRange",D,Q,te,se,F,G,x);const P=w(se),L=P||w(F),Y=L||w(G),ae=Y;return te==="="&&ae&&(te=""),x=z.includePrerelease?"-0":"",P?te===">"||te==="<"?Q="<0.0.0-0":Q="*":te&&ae?(L&&(F=0),G=0,te===">"?(te=">=",L?(se=+se+1,F=0,G=0):(F=+F+1,G=0)):te==="<="&&(te="<",L?se=+se+1:F=+F+1),te==="<"&&(x="-0"),Q="".concat(te+se,".").concat(F,".").concat(G).concat(x)):L?Q=">=".concat(se,".0.0").concat(x," <").concat(+se+1,".0.0-0"):Y&&(Q=">=".concat(se,".").concat(F,".0").concat(x," <").concat(se,".").concat(+F+1,".0-0")),n("xRange return",Q),Q})},R=(D,z)=>(n("replaceStars",D,z),D.trim().replace(o[l.STAR],"")),W=(D,z)=>(n("replaceGTE0",D,z),D.trim().replace(o[z.includePrerelease?l.GTE0PRE:l.GTE0],"")),B=D=>(z,X,Q,te,se,F,G,x,P,L,Y,ae,de)=>(w(Q)?X="":w(te)?X=">=".concat(Q,".0.0").concat(D?"-0":""):w(se)?X=">=".concat(Q,".").concat(te,".0").concat(D?"-0":""):F?X=">=".concat(X):X=">=".concat(X).concat(D?"-0":""),w(P)?x="":w(L)?x="<".concat(+P+1,".0.0-0"):w(Y)?x="<".concat(P,".").concat(+L+1,".0-0"):ae?x="<=".concat(P,".").concat(L,".").concat(Y,"-").concat(ae):D?x="<".concat(P,".").concat(L,".").concat(+Y+1,"-0"):x="<=".concat(x),"".concat(X," ").concat(x).trim()),ee=(D,z,X)=>{for(let Q=0;Q0){const te=D[Q].semver;if(te.major===z.major&&te.minor===z.minor&&te.patch===z.patch)return!0}return!1}return!0};return Tu}var Du,U1;function Lc(){if(U1)return Du;U1=1;const e=Symbol("SemVer ANY");class s{static get ANY(){return e}constructor(u,d){if(d=t(d),u instanceof s){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),a("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(u){const d=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],h=u.match(d);if(!h)throw new TypeError("Invalid comparator: ".concat(u));this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new o(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(a("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new o(u,this.options)}catch{return!1}return n(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof s))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,d).test(u.semver):(d=t(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||n(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||n(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Du=s;const t=om,{safeRe:r,t:i}=ya,n=a2,a=Ec,o=Pt,l=cs();return Du}const kR=cs(),AR=(e,s,t)=>{try{s=new kR(s,t)}catch{return!1}return s.test(e)};var kc=AR;const FR=cs(),RR=(e,s)=>new FR(e,s).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" "));var IR=RR;const HR=Pt,jR=cs(),NR=(e,s,t)=>{let r=null,i=null,n=null;try{n=new jR(s,t)}catch{return null}return e.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new HR(r,t))}),r};var VR=NR;const UR=Pt,BR=cs(),WR=(e,s,t)=>{let r=null,i=null,n=null;try{n=new BR(s,t)}catch{return null}return e.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new UR(r,t))}),r};var GR=WR;const Mu=Pt,zR=cs(),B1=Oc,ZR=(e,s)=>{e=new zR(e,s);let t=new Mu("0.0.0");if(e.test(t)||(t=new Mu("0.0.0-0"),e.test(t)))return t;t=null;for(let r=0;r{const o=new Mu(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||B1(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(a.operator))}}),n&&(!t||B1(t,n))&&(t=n)}return t&&e.test(t)?t:null};var qR=ZR;const XR=cs(),YR=(e,s)=>{try{return new XR(e,s).range||"*"}catch{return null}};var JR=YR;const KR=Pt,l2=Lc(),{ANY:QR}=l2,eI=cs(),tI=kc,W1=Oc,G1=cm,sI=dm,rI=um,iI=(e,s,t,r)=>{e=new KR(e,r),s=new eI(s,r);let i,n,a,o,l;switch(t){case">":i=W1,n=sI,a=G1,o=">",l=">=";break;case"<":i=G1,n=rI,a=W1,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tI(e,s,r))return!1;for(let c=0;c{p.semver===QR&&(p=new l2(">=0.0.0")),d=d||p,h=h||p,i(p.semver,d.semver,r)?d=p:a(p.semver,h.semver,r)&&(h=p)}),d.operator===o||d.operator===l||(!h.operator||h.operator===o)&&n(e,h.semver))return!1;if(h.operator===l&&a(e,h.semver))return!1}return!0};var hm=iI;const nI=hm,aI=(e,s,t)=>nI(e,s,">",t);var oI=aI;const lI=hm,cI=(e,s,t)=>lI(e,s,"<",t);var uI=cI;const z1=cs(),dI=(e,s,t)=>(e=new z1(e,t),s=new z1(s,t),e.intersects(s,t));var hI=dI;const pI=kc,mI=ls;var fI=(e,s,t)=>{const r=[];let i=null,n=null;const a=e.sort((u,d)=>mI(u,d,t));for(const u of a)pI(u,s,t)?(n=u,i||(i=u)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);const o=[];for(const[u,d]of r)u===d?o.push(u):!d&&u===a[0]?o.push("*"):d?u===a[0]?o.push("<=".concat(d)):o.push("".concat(u," - ").concat(d)):o.push(">=".concat(u));const l=o.join(" || "),c=typeof s.raw=="string"?s.raw:String(s);return l.length{if(e===s)return!0;e=new Z1(e,t),s=new Z1(s,t);let r=!1;e:for(const i of e.set){for(const n of s.set){const a=_I(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},vI=[new pm(">=0.0.0-0")],q1=[new pm(">=0.0.0")],_I=(e,s,t)=>{if(e===s)return!0;if(e.length===1&&e[0].semver===Eu){if(s.length===1&&s[0].semver===Eu)return!0;t.includePrerelease?e=vI:e=q1}if(s.length===1&&s[0].semver===Eu){if(t.includePrerelease)return!0;s=q1}const r=new Set;let i,n;for(const p of e)p.operator===">"||p.operator===">="?i=X1(i,p,t):p.operator==="<"||p.operator==="<="?n=Y1(n,p,t):r.add(p.semver);if(r.size>1)return null;let a;if(i&&n){if(a=mm(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(const p of r){if(i&&!tn(p,String(i),t)||n&&!tn(p,String(n),t))return null;for(const m of s)if(!tn(p,String(m),t))return!1;return!0}let o,l,c,u,d=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,h=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const p of s){if(u=u||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator===">"||p.operator===">="){if(o=X1(i,p,t),o===p&&o!==i)return!1}else if(i.operator===">="&&!tn(i.semver,String(p),t))return!1}if(n){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(l=Y1(n,p,t),l===p&&l!==n)return!1}else if(n.operator==="<="&&!tn(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&a!==0)return!1}return!(i&&c&&!n&&a!==0||n&&u&&!i&&a!==0||h||d)},X1=(e,s,t)=>{if(!e)return s;const r=mm(e.semver,s.semver,t);return r>0?e:r<0||s.operator===">"&&e.operator===">="?s:e},Y1=(e,s,t)=>{if(!e)return s;const r=mm(e.semver,s.semver,t);return r<0?e:r>0||s.operator==="<"&&e.operator==="<="?s:e};var bI=gI;const Ou=ya,J1=Mc,yI=Pt,K1=r2,CI=Wi,$I=C8,xI=w8,wI=P8,SI=D8,PI=O8,TI=A8,DI=I8,MI=N8,EI=ls,OI=W8,LI=Z8,kI=lm,AI=J8,FI=eR,RI=Oc,II=cm,HI=i2,jI=n2,NI=um,VI=dm,UI=a2,BI=xR,WI=Lc(),GI=cs(),zI=kc,ZI=IR,qI=VR,XI=GR,YI=qR,JI=JR,KI=hm,QI=oI,eH=uI,tH=hI,sH=fI,rH=bI;var iH={parse:CI,valid:$I,clean:xI,inc:wI,diff:SI,major:PI,minor:TI,patch:DI,prerelease:MI,compare:EI,rcompare:OI,compareLoose:LI,compareBuild:kI,sort:AI,rsort:FI,gt:RI,lt:II,eq:HI,neq:jI,gte:NI,lte:VI,cmp:UI,coerce:BI,Comparator:WI,Range:GI,satisfies:zI,toComparators:ZI,maxSatisfying:qI,minSatisfying:XI,minVersion:YI,validRange:JI,outside:KI,gtr:QI,ltr:eH,intersects:tH,simplifyRange:sH,subset:rH,SemVer:yI,re:Ou.re,src:Ou.src,tokens:Ou.t,SEMVER_SPEC_VERSION:J1.SEMVER_SPEC_VERSION,RELEASE_TYPES:J1.RELEASE_TYPES,compareIdentifiers:K1.compareIdentifiers,rcompareIdentifiers:K1.rcompareIdentifiers};const Ve=Fi(iH);var nH=Object.defineProperty,aH=Object.getOwnPropertyDescriptor,fm=(e,s,t,r)=>{for(var i=r>1?void 0:r?aH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&nH(s,t,i),i};let Vn=class extends j(V){constructor(){super(...arguments),this.mdiDotsHorizontal=tP,this.showDetails=!1}get title(){return this.commit.subject}get message(){return this.commit.message}get author(){return this.commit.author}get commitFormatDate(){const e=new Date(this.commit.date*1e3);e.setHours(0,0,0,0);const s=new Date;s.setHours(0,0,0,0);const t=Math.floor((s.getTime()-e.getTime())/(1e3*60*60*24));if(t===0){const r=Math.floor((new Date().getTime()-this.commit.date*1e3)/36e5);return this.$t("Machine.UpdatePanel.CommittedHoursAgo",{hours:r})}else return t===1?this.$t("Machine.UpdatePanel.CommittedYesterday"):t<29?this.$t("Machine.UpdatePanel.CommittedDaysAgo",{days:t}):this.$t("Machine.UpdatePanel.CommittedOnDate",{date:e.toLocaleDateString(this.browserLocale,{year:"numeric",month:"short",day:"numeric"})})}get repo_name(){var e,s;return(s=(e=this.repo.repo_name)!=null?e:this.repo.name)!=null?s:""}get commitHref(){return"https://github.com/".concat(this.repo.owner,"/").concat(this.repo_name,"/commit/").concat(this.commit.sha)}get commitShortSha(){return this.commit.sha.substring(0,6)}};fm([k({required:!0})],Vn.prototype,"commit",2);fm([k({required:!0})],Vn.prototype,"repo",2);Vn=fm([O({components:{Panel:Z}})],Vn);var oH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("li",{staticClass:"commit px-3 py-2"},[t(S,[t(_,[t("h4",{staticClass:"subtitle-2 text--white mb-0"},[e._v(" "+e._s(e.title)+" "),t(ns,{staticClass:"ml-2 px-2",attrs:{outlined:"",label:"","x-small":""},on:{click:function(r){e.showDetails=!e.showDetails}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDotsHorizontal))])],1)],1),e.showDetails?t("p",{staticClass:"caption text--secondary mb-2",staticStyle:{"white-space":"pre-line"},domProps:{innerHTML:e._s(e.message)}}):e._e(),t("p",{staticClass:"caption mb-0"},[t("span",{staticClass:"font-weight-bold text-decoration-none white--text"},[e._v(" "+e._s(e.author)+" ")]),t("span",[e._v(e._s(e.commitFormatDate))])])]),t(_,{staticClass:"col-auto pt-4"},[t(ns,{attrs:{outlined:"",label:"",small:"",href:e.commitHref,target:"_blank"}},[e._v(" "+e._s(e.commitShortSha)+" ")])],1)],1)],1)},lH=[];const Q1={};var cH=N(Vn,oH,lH,!1,uH,"84e7ff68",null,null);function uH(e){for(let s in Q1)this[s]=Q1[s]}const c2=function(){return cH.exports}();var dH=Object.defineProperty,hH=Object.getOwnPropertyDescriptor,gm=(e,s,t,r)=>{for(var i=r>1?void 0:r?hH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&dH(s,t,i),i};let Un=class extends j(V){get groupedCommitsDate(){return new Date(this.groupedCommits.date).toLocaleDateString(this.browserLocale,{year:"numeric",month:"short",day:"numeric"})}};gm([k({required:!0})],Un.prototype,"groupedCommits",2);gm([k({required:!0})],Un.prototype,"repo",2);Un=gm([O({components:{Panel:Z,GitCommitsListDayCommit:c2}})],Un);var pH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xb,{staticClass:"git-commit-list-day",attrs:{small:""}},[t(S,{staticClass:"pt-0"},[t(_,{staticClass:"pr-12"},[t("h3",{staticClass:"caption"},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.CommitsOnDate",{date:e.groupedCommitsDate}))+" ")]),t("ul",{staticClass:"commits mt-3 pl-0"},e._l(e.groupedCommits.commits,function(r){return t(c2,{key:r.sha,attrs:{commit:r,repo:e.repo}})}),1)])],1)],1)],1)},mH=[];const ev={};var fH=N(Un,pH,mH,!1,gH,"0afc8caa",null,null);function gH(e){for(let s in ev)this[s]=ev[s]}const Ca=function(){return fH.exports}();var vH=Object.defineProperty,_H=Object.getOwnPropertyDescriptor,vm=(e,s,t,r)=>{for(var i=r>1?void 0:r?_H(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&vH(s,t,i),i};let Bn=class extends j(V){constructor(){super(...arguments),this.mdiUpdate=pa,this.mdiCloseThick=Ce}get commitsBehind(){var e,s;return(s=(e=this.repo)==null?void 0:e.commits_behind)!=null?s:[]}get groupedCommits(){let e=[],s=null;return this.commitsBehind.forEach(t=>{var n;const r=new Date(((n=s==null?void 0:s.date)!=null?n:0)*1e3),i=new Date(t.date*1e3);(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth()||i.getDate()!==r.getDate())&&e.push({date:i,commits:[]}),e[e.length-1].commits.push(t),s=t}),e}get displayFullHistoryWaring(){return this.commitsBehind.length>=30}get lastCommit(){return this.commitsBehind.slice(-1)[0]}get linkToGithub(){var e,s,t,r;return"https://github.com/".concat((e=this.repo)==null?void 0:e.owner,"/").concat((s=this.repo)==null?void 0:s.name,"/commits/").concat((t=this.repo)==null?void 0:t.branch,"/?after=").concat((r=this.lastCommit)==null?void 0:r.sha,"+0")}closeDialog(){this.$emit("close-dialog")}};vm([k({required:!0})],Bn.prototype,"boolShowDialog",2);vm([k({required:!0})],Bn.prototype,"repo",2);Bn=vm([O({components:{GitCommitsListDay:Ca,Panel:Z}})],Bn);var bH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"","max-width":"800"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(Z,{attrs:{title:e.$t("Machine.UpdatePanel.Commits"),icon:e.mdiUpdate,"margin-bottom":!1,"card-class":"machine-update-commits-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"py-0 px-0"},[t("overlay-scrollbars",{staticStyle:{"max-height":"400px"},attrs:{options:{overflowBehavior:{x:"hidden"}}}},[t(S,[t(_,[t(Qx,{staticClass:"groupedCommits",attrs:{"align-top":"",dense:""}},[e._l(e.groupedCommits,function(r){return t(Ca,{key:r.date.getTime(),attrs:{repo:e.repo,"grouped-commits":r}})}),e.displayFullHistoryWaring?t(xb,{staticClass:"git-commit-list-day git-commit-list-warning",attrs:{small:""}},[t(S,{staticClass:"pt-0"},[t(_,{staticClass:"pr-12"},[t(dt,{attrs:{dense:"",text:"",type:"info"}},[t("p",[e._v(e._s(e.$t("Machine.UpdatePanel.MoreCommitsInfo")))]),t("div",{staticClass:"text-center mb-3"},[t(g,{attrs:{href:e.linkToGithub,target:"_blank"}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.LinkToGithub"))+" ")])],1)])],1)],1)],1):e._e()],2)],1)],1)],1)],1)],1)],1)},yH=[];const tv={};var CH=N(Bn,bH,yH,!1,$H,"6e2f7877",null,null);function $H(e){for(let s in tv)this[s]=tv[s]}const _m=function(){return CH.exports}();var xH=Object.defineProperty,wH=Object.getOwnPropertyDescriptor,bm=(e,s,t,r)=>{for(var i=r>1?void 0:r?wH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&xH(s,t,i),i};let Wn=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiAlertCircle=Rb,this.mdiEye=sP,this.mdiOpenInNew=n0}get name(){var e,s;return(s=(e=this.repo)==null?void 0:e.name)!=null?s:"UNKNOWN"}get formatName(){return kr(this.name)}get configured_type(){var e,s;return(s=(e=this.repo)==null?void 0:e.configured_type)!=null?s:"UNKNOWN"}get description1(){return this.name==="klipper"?this.$t("Machine.UpdatePanel.KlipperUpdateQuestionFirmware"):this.name==="moonraker"?this.$t("Machine.UpdatePanel.MoonrakerUpdateQuestion"):this.configured_type==="web"?this.$t("Machine.UpdatePanel.WebClientUpdateQuestion"):this.$t("Machine.UpdatePanel.GenericUpdateQuestion")}get description2(){return this.name==="klipper"?this.$t("Machine.UpdatePanel.KlipperUpdateQuestionConfig"):null}get repo_name(){var e,s;return(s=(e=this.repo.repo_name)!=null?e:this.repo.name)!=null?s:""}get externalLink(){var e;return this.name==="klipper"?"//www.klipper3d.org/Config_Changes.html":this.name==="moonraker"?"//moonraker.readthedocs.io/en/latest/changelog/":((e=this.repo)==null?void 0:e.configured_type)==="web"?"//github.com/".concat(this.repo.owner,"/").concat(this.repo_name,"/releases/tag/").concat(this.repo.remote_version):"//github.com/".concat(this.repo.owner,"/").concat(this.repo_name)}get externalLinkText(){return["klipper","moonraker"].includes(this.name)?this.$t("Machine.UpdatePanel.ConfigChanges"):this.$t("Machine.UpdatePanel.GitHubPage")}openCommitHistory(){this.$emit("open-commit-history")}};bm([k({required:!0})],Wn.prototype,"repo",2);bm([k({required:!1,default:!1})],Wn.prototype,"boolTitle",2);Wn=bm([O({components:{GitCommitsListDay:Ca,Panel:Z}})],Wn);var SH=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r(dt,{attrs:{text:"",dense:"",border:"left",color:"orange",icon:s.mdiAlertCircle}},[s.boolTitle?[r("strong",[s._v(s._s(s.$t("Machine.UpdatePanel.UpdateWarning",{name:s.formatName})))]),r("br")]:s._e(),s.description1?r("p",[s._v(s._s(s.description1))]):s._e(),s.description2?r("p",[s._v(s._s(s.description2))]):s._e(),r("div",{staticClass:"text-center"},[s.configured_type==="git_repo"&&(e=s.repo.commits_behind)!==null&&e!==void 0&&e.length?r(g,{staticClass:"mx-2 mt-3 mt-sm-0",on:{click:s.openCommitHistory}},[r(v,{attrs:{left:"",small:""}},[s._v(s._s(s.mdiEye))]),s._v(" "+s._s(s.$t("Machine.UpdatePanel.CommitHistory"))+" ")],1):s._e(),s.externalLink?r(g,{staticClass:"mx-2 mt-3 mt-sm-0",attrs:{href:s.externalLink,target:"_blank"}},[r(v,{attrs:{left:"",small:""}},[s._v(s._s(s.mdiOpenInNew))]),s._v(" "+s._s(s.externalLinkText)+" ")],1):s._e()],1)],2)},PH=[];const sv={};var TH=N(Wn,SH,PH,!1,DH,null,null,null);function DH(e){for(let s in sv)this[s]=sv[s]}const Ac=function(){return TH.exports}();var MH=Object.defineProperty,EH=Object.getOwnPropertyDescriptor,ym=(e,s,t,r)=>{for(var i=r>1?void 0:r?EH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&MH(s,t,i),i};let Gn=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiProgressQuestion=u0,this.checkboxUpdateQuestion=!1}doUpdate(){this.$emit("do-update")}openCommitHistory(){this.$emit("open-commit-history")}closeDialog(){this.$emit("close-dialog")}};ym([k({required:!0})],Gn.prototype,"boolShowDialog",2);ym([k({required:!0})],Gn.prototype,"repo",2);Gn=ym([O({components:{GitCommitsListDay:Ca,Panel:Z,UpdateHintAlert:Ac}})],Gn);var OH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"","max-width":"600"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(Z,{attrs:{title:e.$t("Machine.UpdatePanel.AreYouSure"),icon:e.mdiProgressQuestion,"margin-bottom":!1,"card-class":"machine-update-hint-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t(Ac,{attrs:{repo:e.repo},on:{"open-commit-history":e.openCommitHistory}}),t("div",[t(we,{attrs:{label:e.$t("Machine.UpdatePanel.IUnderstandTheRisks"),"hide-details":""},model:{value:e.checkboxUpdateQuestion,callback:function(r){e.checkboxUpdateQuestion=r},expression:"checkboxUpdateQuestion"}})],1)],1)],1)],1),t(E),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Abort")))]),t(g,{attrs:{text:"",color:"primary",disabled:!e.checkboxUpdateQuestion},on:{click:e.doUpdate}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.StartUpdate"))+" ")])],1)],1)],1)},LH=[];const rv={};var kH=N(Gn,OH,LH,!1,AH,null,null,null);function AH(e){for(let s in rv)this[s]=rv[s]}const u2=function(){return kH.exports}();var FH=Object.defineProperty,RH=Object.getOwnPropertyDescriptor,d2=(e,s,t,r)=>{for(var i=r>1?void 0:r?RH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&FH(s,t,i),i};let tl=class extends j(V){constructor(){super(...arguments),this.mdiInformation=At,this.mdiMenuDown=hr,this.mdiReload=kP,this.mdiCloseCircle=fo,this.mdiUpdate=pa,this.mdiInformationOutline=pP,this.boolShowCommitList=!1,this.boolShowUpdateHint=!1,this.toggleAnomalies=!1}get name(){var s;return(s=this.repo.name)!=null?s:"UNKNOWN"}get type(){return this.repo.configured_type}get localVersion(){var t;const s=(t=this.repo.version)!=null?t:"?";return Ve.valid(s)?s:null}get remoteVersion(){var t;const s=(t=this.repo.remote_version)!=null?t:"?";return Ve.valid(s)?s:null}get branch(){var s;return(s=this.repo.branch)!=null?s:"master"}get remoteAlias(){var s;return(s=this.repo.remote_alias)!=null?s:"origin"}get branchOutput(){return this.remoteAlias!=="origin"?"".concat(this.remoteAlias,"/").concat(this.branch):["master","main"].includes(this.branch)?null:this.branch}get commitsBehind(){var s;return(s=this.repo.commits_behind)!=null?s:[]}get fullVersionString(){var s;return(s=this.repo.full_version_string)!=null?s:null}get versionOutput(){let s=this.branchOutput?"".concat(this.branchOutput,": "):"";if(this.localVersion&&this.remoteVersion&&Ve.gt(this.remoteVersion,this.localVersion))return"".concat(s).concat(this.localVersion," > ").concat(this.remoteVersion);if(this.commitsBehind.length){const t=this.$tc("Machine.UpdatePanel.CommitsAvailable",this.commitsBehind.length,{count:this.commitsBehind.length}).toString();return this.localVersion?"".concat(s).concat(this.localVersion," > ").concat(t):"".concat(s).concat(t)}return this.fullVersionString?this.fullVersionString:this.localVersion?this.localVersion:"UNKNOWN"}get configuredType(){var s;return(s=this.repo.configured_type)!=null?s:"git_repo"}get isValid(){var s;return(s=this.repo.is_valid)!=null?s:!0}get isDirty(){var s;return(s=this.repo.is_dirty)!=null?s:!1}get isCorrupt(){var s;return(s=this.repo.corrupt)!=null?s:!1}get debugEnabled(){var s;return(s=this.repo.debug_enabled)!=null?s:!1}get isDetached(){var s;return this.configuredType!=="git_repo"?!1:!this.debugEnabled&&((s=this.repo.detached)!=null?s:!1)}get existsRecoveryUrl(){var t;return((t=this.repo.recovery_url)!=null?t:"?")!=="?"}get btnDisabled(){return["printing","paused"].includes(this.printer_state)?!0:!this.isValid||this.isCorrupt||this.isDirty||this.commitsBehind.length?!1:!(this.localVersion&&this.remoteVersion&&Ve.gt(this.remoteVersion,this.localVersion))}get btnIcon(){return this.isDetached||!this.isValid||this.isCorrupt||this.isDirty?fo:this.commitsBehind.length||this.localVersion&&this.remoteVersion&&Ve.gt(this.remoteVersion,this.localVersion)?Mp:this.localVersion===null||this.remoteVersion===null?Kb:Nb}get btnColor(){return this.isCorrupt||this.isDetached||this.isDirty||!this.isValid?"orange":this.commitsBehind.length||this.localVersion&&this.remoteVersion&&Ve.gt(this.remoteVersion,this.localVersion)?"primary":"green"}get btnText(){return this.isCorrupt?this.$t("Machine.UpdatePanel.Corrupt"):this.isDetached?this.$t("Machine.UpdatePanel.Detached"):this.isDirty?this.$t("Machine.UpdatePanel.Dirty"):this.isValid?this.commitsBehind.length||this.localVersion&&this.remoteVersion&&Ve.gt(this.remoteVersion,this.localVersion)?this.$t("Machine.UpdatePanel.Update"):this.localVersion===null||this.remoteVersion===null?this.$t("Machine.UpdatePanel.Unknown"):this.$t("Machine.UpdatePanel.UpToDate"):this.$t("Machine.UpdatePanel.Invalid")}get anomalies(){var s;return(s=this.repo.anomalies)!=null?s:[]}get warnings(){var s;return(s=this.repo.warnings)!=null?s:[]}get webUpdatable(){return!this.localVersion||!this.remoteVersion?!1:Ve.gt(this.remoteVersion,this.localVersion)}get repo_name(){var s,t;return(t=(s=this.repo.repo_name)!=null?s:this.repo.name)!=null?t:""}get webLinkRelease(){return"https://github.com/".concat(this.repo.owner,"/").concat(this.repo_name,"/releases/tag/").concat(this.repo.remote_version)}get hideUpdateWarning(){var s;return(s=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?s:!1}clickUpdate(){if(this.hideUpdateWarning){this.doUpdate();return}this.boolShowUpdateHint=!0}doUpdate(){if(["klipper","moonraker"].includes(this.repo.name)){this.$socket.emit("machine.update."+this.repo.name,{});return}this.$socket.emit("machine.update.client",{name:this.repo.name})}doRecovery(s){this.$socket.emit("machine.update.recover",{name:this.repo.name,hard:s})}closeCommitList(){this.boolShowCommitList=!1}closeShowUpdateHint(){this.boolShowUpdateHint=!1}};d2([k({required:!0})],tl.prototype,"repo",2);tl=d2([O({components:{GitCommitsList:_m,UpdateHint:u2}})],tl);var IH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{staticClass:"py-2"},[t(_,{staticClass:"pl-6"},[t("strong",[e._v(e._s(e.repo.name))]),t("br"),e.type==="git_repo"&&e.commitsBehind.length?[t("a",{staticClass:"info--text cursor--pointer",on:{click:function(r){e.boolShowCommitList=!0}}},[t(v,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiUpdate))]),e._v(" "+e._s(e.versionOutput)+" ")],1)]:e.type==="web"&&e.webUpdatable?[t("a",{staticClass:"info--text text-decoration-none",attrs:{href:e.webLinkRelease,target:"_blank"}},[t(v,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiUpdate))]),e._v(" "+e._s(e.versionOutput)+" ")],1)]:t("span",[e._v(e._s(e.versionOutput))])],2),t(_,{staticClass:"col-auto pr-6 text-right",attrs:{"align-self":"center"}},[e.anomalies.length>0?t(ns,{staticClass:"minwidth-0 px-1 mr-2",attrs:{small:"",label:"",outlined:!e.toggleAnomalies,color:"grey"},on:{click:function(r){e.toggleAnomalies=!e.toggleAnomalies}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.toggleAnomalies?e.mdiInformationOutline:e.mdiInformation))])],1):e._e(),e.isValid?t(ns,{staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled},on:{click:e.clickUpdate}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" ")],1):[t($e,{attrs:{"offset-y":!0},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(ns,e._g(e._b({staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled}},"v-chip",n,!1),i),[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" "),t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,56479232)},[t(Oe,{staticClass:"py-0",attrs:{dense:""}},[e.isCorrupt?e._e():t(K,{on:{click:function(r){return e.doRecovery(!1)}}},[t(Rs,{staticClass:"mr-0 pt-1"},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(Gt,[t(rt,[e._v(e._s(e.$t("Machine.UpdatePanel.SoftRecovery")))])],1)],1),t(K,{attrs:{disabled:!e.existsRecoveryUrl},on:{click:function(r){return e.doRecovery(!0)}}},[t(Rs,{staticClass:"mr-0 pt-1"},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(Gt,[t(rt,[e._v(e._s(e.$t("Machine.UpdatePanel.HardRecovery")))])],1)],1)],1)],1)]],2)],1),e.warnings.length?t(S,{staticClass:"mt-0"},[t(_,{staticClass:"px-6 pt-0"},e._l(e.warnings,function(r,i){return t(dt,{key:"warnings_"+i,attrs:{dense:"",text:"",color:"orange",border:"left",icon:e.mdiCloseCircle}},[t("p",{staticClass:"text--disabled mb-0"},[e._v(e._s(r))])])}),1)],1):e._e(),t(S,{directives:[{name:"show",rawName:"v-show",value:e.toggleAnomalies,expression:"toggleAnomalies"}],staticClass:"mt-0"},[t(_,{staticClass:"px-6 pt-0"},e._l(e.anomalies,function(r,i){return t(dt,{key:"anomalies_"+i,attrs:{dense:"",text:"",color:"grey",border:"left",icon:e.mdiInformation}},[e._v(" "+e._s(r)+" ")])}),1)],1),e.type==="git_repo"?t(_m,{attrs:{"bool-show-dialog":e.boolShowCommitList,repo:e.repo},on:{"close-dialog":e.closeCommitList}}):e._e(),t(u2,{attrs:{"bool-show-dialog":e.boolShowUpdateHint,repo:e.repo},on:{"open-commit-history":function(r){e.boolShowCommitList=!0},"do-update":e.doUpdate,"close-dialog":e.closeShowUpdateHint}})],1)},HH=[];const iv={};var jH=N(tl,IH,HH,!1,NH,null,null,null);function NH(e){for(let s in iv)this[s]=iv[s]}const VH=function(){return jH.exports}();var UH=Object.defineProperty,BH=Object.getOwnPropertyDescriptor,WH=(e,s,t,r)=>{for(var i=r>1?void 0:r?BH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&UH(s,t,i),i};let Xd=class extends j(V){constructor(){super(...arguments),this.mdiInformation=At,this.boolShowPackageList=!1}get package_count(){var s,t,r;return(r=(t=(s=this.$store.state.server.updateManager)==null?void 0:s.system)==null?void 0:t.package_count)!=null?r:0}get package_list(){var s,t,r;return(r=(t=(s=this.$store.state.server.updateManager)==null?void 0:s.system)==null?void 0:t.package_list)!=null?r:[]}get btnDisabled(){return["printing","paused"].includes(this.printer_state)?!0:this.package_count===0}get btnIcon(){return this.package_count?Mp:Nb}get btnColor(){return this.package_count?"primary":"green"}get btnText(){return this.package_count?this.$t("Machine.UpdatePanel.Upgrade"):this.$t("Machine.UpdatePanel.UpToDate")}doUpdate(){this.$socket.emit("machine.update.system",{})}closePackagesList(){this.boolShowPackageList=!1}};Xd=WH([O],Xd);var GH=Object.defineProperty,zH=Object.getOwnPropertyDescriptor,Cm=(e,s,t,r)=>{for(var i=r>1?void 0:r?zH(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&GH(s,t,i),i};let zn=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiPackageVariantClosed=SP}closeDialog(){this.$emit("close-dialog")}};Cm([k({required:!0})],zn.prototype,"boolShowDialog",2);Cm([k({required:!0})],zn.prototype,"packagesList",2);zn=Cm([O({components:{Panel:Z}})],zn);var ZH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"","max-width":"800"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(Z,{attrs:{title:e.$t("Machine.UpdatePanel.UpgradeableSystemPackages"),icon:e.mdiPackageVariantClosed,"margin-bottom":!1,"card-class":"machine-update-system-packages-list-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",[e._v(e._s(e.$t("Machine.UpdatePanel.ThesePackagesCanBeUpgrade")))]),t("p",{staticClass:"system-packages-list"},[e._v(e._s(e.packagesList.join(", ")))])])],1)],1),t(ne,[t(le),t(g,{attrs:{text:"",color:"primary"},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Close")))])],1)],1)],1)},qH=[];const nv={};var XH=N(zn,ZH,qH,!1,YH,"61fb1dc8",null,null);function YH(e){for(let s in nv)this[s]=nv[s]}const JH=function(){return XH.exports}();var KH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{staticClass:"py-2"},[t(_,{staticClass:"pl-6"},[t("strong",[e._v(e._s(e.$t("Machine.UpdatePanel.System")))]),t("br"),e.package_count?[t("a",{staticClass:"info--text cursor--pointer",on:{click:function(r){e.boolShowPackageList=!0}}},[t(v,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiInformation))]),e._v(" "+e._s(e.$t("Machine.UpdatePanel.CountPackagesCanBeUpgraded",{count:e.package_count}))+" ")],1)]:t("span",[e._v(e._s(e.$t("Machine.UpdatePanel.OSPackages")))])],2),t(_,{staticClass:"col-auto pr-6 text-right",attrs:{"align-self":"center"}},[t(ns,{staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled},on:{click:e.doUpdate}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" ")],1)],1)],1),t(JH,{attrs:{"bool-show-dialog":e.boolShowPackageList,"packages-list":e.package_list},on:{"close-dialog":e.closePackagesList}})],1)},QH=[];const av={};var ej=N(Xd,KH,QH,!1,tj,null,null,null);function tj(e){for(let s in av)this[s]=av[s]}const sj=function(){return ej.exports}();var rj=Object.defineProperty,ij=Object.getOwnPropertyDescriptor,h2=(e,s,t,r)=>{for(var i=r>1?void 0:r?ij(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&rj(s,t,i),i};let sl=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiProgressQuestion=u0,this.checkboxUpdateQuestion=!1,this.boolShowCommitHistory=!1,this.showCommitsRepo=null}get modules(){var e;return(e=this.$store.getters["server/updateManager/getUpdateManagerList"])!=null?e:[]}get filteredModules(){return this.modules.filter(e=>{var s,t,r,i,n,a;return!!(e.type==="git"&&((t=(s=e.data)==null?void 0:s.commits_behind)!=null&&t.length)||e.type==="web"&&Ve.valid((r=e.data)==null?void 0:r.remote_version)&&Ve.valid((i=e.data)==null?void 0:i.version)&&Ve.gt((n=e.data)==null?void 0:n.remote_version,(a=e.data)==null?void 0:a.version))})}openCommitHistory(e){this.showCommitsRepo=e,this.boolShowCommitHistory=!0}closeDialog(){this.$emit("close-dialog")}updateAll(){this.$emit("update-all")}};h2([k({required:!0})],sl.prototype,"boolShowDialog",2);sl=h2([O({components:{GitCommitsListDay:Ca,Panel:Z,UpdateHintAlert:Ac}})],sl);var nj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"","max-width":"600"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(Z,{attrs:{title:e.$t("Machine.UpdatePanel.AreYouSure"),icon:e.mdiProgressQuestion,"margin-bottom":!1,"card-class":"machine-update-hint-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[e._l(e.filteredModules,function(r){return t(Ac,{key:r.name,attrs:{repo:r.data,"bool-title":!0},on:{"open-commit-history":function(i){return e.openCommitHistory(r.data)}}})}),t("div",[t(we,{attrs:{label:e.$t("Machine.UpdatePanel.IUnderstandTheRisks"),"hide-details":""},model:{value:e.checkboxUpdateQuestion,callback:function(r){e.checkboxUpdateQuestion=r},expression:"checkboxUpdateQuestion"}})],1)],2)],1)],1),t(E),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Abort")))]),t(g,{attrs:{text:"",color:"primary",disabled:!e.checkboxUpdateQuestion},on:{click:e.updateAll}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.StartUpdate"))+" ")])],1)],1),t(_m,{attrs:{"bool-show-dialog":e.boolShowCommitHistory,repo:e.showCommitsRepo},on:{"close-dialog":function(r){e.boolShowCommitHistory=!1}}})],1)},aj=[];const ov={};var oj=N(sl,nj,aj,!1,lj,null,null,null);function lj(e){for(let s in ov)this[s]=ov[s]}const p2=function(){return oj.exports}();var cj=Object.defineProperty,uj=Object.getOwnPropertyDescriptor,dj=(e,s,t,r)=>{for(var i=r>1?void 0:r?uj(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&cj(s,t,i),i};let Yd=class extends j(V){constructor(){super(...arguments),this.mdiProgressUpload=Mp,this.boolShowDialog=!1}get hideUpdateWarning(){var s;return(s=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?s:!1}clickUpdate(){if(this.hideUpdateWarning){this.updateAll();return}this.boolShowDialog=!0}updateAll(){this.$socket.emit("machine.update.full",{})}};Yd=dj([O({components:{UpdateHintAll:p2}})],Yd);var hj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{staticClass:"pt-3"},[t(_,{staticClass:"text-center"},[t(g,{attrs:{text:"",color:"primary",small:"",disabled:["printing","paused"].includes(e.printer_state)},on:{click:e.clickUpdate}},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiProgressUpload))]),e._v(" "+e._s(e.$t("Machine.UpdatePanel.UpdateAll"))+" ")],1)],1)],1),t(p2,{attrs:{"bool-show-dialog":e.boolShowDialog},on:{"close-dialog":function(r){e.boolShowDialog=!1},"update-all":e.updateAll}})],1)},pj=[];const lv={};var mj=N(Yd,hj,pj,!1,fj,null,null,null);function fj(e){for(let s in lv)this[s]=lv[s]}const gj=function(){return mj.exports}();var vj=Object.defineProperty,_j=Object.getOwnPropertyDescriptor,bj=(e,s,t,r)=>{for(var i=r>1?void 0:r?_j(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&vj(s,t,i),i};let Jd=class extends j(V){constructor(){super(...arguments),this.mdiRefresh=Hi,this.mdiInformation=At,this.mdiCloseThick=Ce,this.mdiUpdate=pa}get enableUpdateManager(){return this.$store.state.server.components.includes("update_manager")}get modules(){var e;return(e=this.$store.getters["server/updateManager/getUpdateManagerList"])!=null?e:[]}get existsSystemModul(){return"system"in this.$store.state.server.updateManager}get systemPackagesCount(){var e,s,t;return(t=(s=(e=this.$store.state.server.updateManager)==null?void 0:e.system)==null?void 0:s.package_count)!=null?t:0}get checkInitState(){return this.modules.filter(s=>s.data.remote_version!=="?").length>0}get showUpdateAll(){let e=0;return this.modules.forEach(s=>{var t,r,i,n,a,o;if(s.type==="git"&&((r=(t=s.data)==null?void 0:t.commits_behind)!=null&&r.length)){e++;return}if(s.type==="web"&&Ve.valid((i=s.data)==null?void 0:i.remote_version)&&Ve.valid((n=s.data)==null?void 0:n.version)&&Ve.gt((a=s.data)==null?void 0:a.remote_version,(o=s.data)==null?void 0:o.version)){e++;return}}),this.systemPackagesCount>0&&e++,e>1}btnSync(){this.$socket.emit("machine.update.status",{refresh:!0},{action:"server/updateManager/onUpdateStatus",loading:"loadingBtnSyncUpdateManager"})}};Jd=bj([O({components:{Panel:Z,UpdatePanelEntry:VH,UpdatePanelEntrySystem:sj,UpdatePanelEntryAll:gj}})],Jd);var yj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.enableUpdateManager?t(Z,{attrs:{title:e.$t("Machine.UpdatePanel.UpdateManager"),icon:e.mdiUpdate,"card-class":"machine-update-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:"",color:"primary",ripple:!0,loading:e.loadings.includes("loadingBtnSyncUpdateManager"),disabled:["printing","paused"].includes(e.printer_state)},on:{click:e.btnSync}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiRefresh))])],1)]}}],null,!1,3363156462)},[t("span",[e._v(e._s(e.$t("Machine.UpdatePanel.CheckForUpdates")))])])]},proxy:!0}],null,!1,150962712)},[t(q,{staticClass:"px-0 py-0 update-manager-list"},[e.checkInitState?[e._l(e.modules,function(r,i){return[i?t(E,{key:"divider_"+r.name,staticClass:"my-0"}):e._e(),t("update-panel-entry",{key:r.name,attrs:{repo:r.data}})]}),e.existsSystemModul?[e.modules.length?t(E,{staticClass:"my-0"}):e._e(),t("update-panel-entry-system")]:e._e(),e.showUpdateAll?[t(E,{staticClass:"mb-0 mt-2 border-top-2"}),t("update-panel-entry-all")]:e._e()]:[t(S,{staticClass:"mt-0 mb-0"},[t(_,{staticClass:"px-6"},[t(dt,{staticClass:"mb-0",attrs:{text:"",dense:"",type:"info",border:"left"}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.InitUpdateManager"))+" ")])],1)],1)]],2)],1):e._e()],1)},Cj=[];const cv={};var $j=N(Jd,yj,Cj,!1,xj,"8e04f428",null,null);function xj(e){for(let s in cv)this[s]=cv[s]}const m2=function(){return $j.exports}();var wj=Object.defineProperty,Sj=Object.getOwnPropertyDescriptor,f2=(e,s,t,r)=>{for(var i=r>1?void 0:r?Sj(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&wj(s,t,i),i};let rl=class extends j(V){constructor(){super(...arguments),this.mdiDownload=Gb}get logfiles(){var s,t;return(t=(s=this.$store.getters["files/getDirectory"]("logs"))==null?void 0:s.childrens)!=null?t:[]}get filename(){return this.name+".log"}get exists(){return["klippy","moonraker"].includes(this.name)?!0:this.logfiles.findIndex(s=>s.filename===this.filename)!==-1}get href(){let s="/server/files/logs/";return["klippy","moonraker"].includes(this.name)&&(s="/server/files/"),this.apiUrl+s+this.filename}get classes(){const s=["col-12","pt-0"];return this.klipperState!=="ready"?(s.push("col-md-6"),s.push("mt-md-3")):s.push("col-md-12"),s}downloadLog(s){s.preventDefault();let t="";"href"in s.target.attributes&&(t=s.target.attributes.href.value),"href"in s.target.parentElement.attributes&&(t=s.target.parentElement.attributes.href.value),window.open(t)}};f2([k({type:String,required:!0})],rl.prototype,"name",2);rl=f2([O({components:{Panel:Z}})],rl);var Pj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.exists?t(_,{class:e.classes},[t(g,{staticClass:"primary--text",attrs:{href:e.href,block:""},on:{click:e.downloadLog}},[t(v,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" "+e._s(e.name)+" ")],1)],1):e._e()},Tj=[];const uv={};var Dj=N(rl,Pj,Tj,!1,Mj,null,null,null);function Mj(e){for(let s in uv)this[s]=uv[s]}const $m=function(){return Dj.exports}();var Ej=Object.defineProperty,Oj=Object.getOwnPropertyDescriptor,Lj=(e,s,t,r)=>{for(var i=r>1?void 0:r?Oj(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Ej(s,t,i),i};let Kd=class extends j(V){constructor(){super(...arguments),this.mdiFileDocumentEdit=iP,this.mdiFileSyncOutline=Xb,this.genericLogfiles=SS,this.showRolloverDialog=!1}};Kd=Lj([O({components:{LogfilesPanelGenericLog:$m,Panel:Z}})],Kd);var kj=Object.defineProperty,Aj=Object.getOwnPropertyDescriptor,xm=(e,s,t,r)=>{for(var i=r>1?void 0:r?Aj(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&kj(s,t,i),i};let Zn=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiFileSyncOutline=Xb,this.rolloverLogfiles=PS,this.capitalize=kr,this.selectedRolloverLogs=[]}get loadingRolloverLogs(){return this.loadings.filter(e=>e.startsWith("rolloverLog_")).length>0}loadingRolloverLogsChanged(e){e&&this.closeDialog()}btnRolloverLogs(){this.selectedRolloverLogs.length!==0&&(this.selectedRolloverLogs.forEach(e=>{this.$socket.emit("server.logs.rollover",{application:e},{loading:"rolloverLog_"+e,action:"files/rolloverLog"})}),this.selectedRolloverLogs=[])}closeDialog(){this.$emit("close-dialog")}};xm([k({type:Boolean,default:!1})],Zn.prototype,"show",2);xm([me("loadingRolloverLogs")],Zn.prototype,"loadingRolloverLogsChanged",1);Zn=xm([O({components:{LogfilesPanelGenericLog:$m,Panel:Z}})],Zn);var Fj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,persistent:"",width:"400",fullscreen:e.isMobile}},[t(Z,{attrs:{title:e.$t("Machine.LogfilesPanel.Rollover"),"card-class":"machine_rollover_logfiles-dialog",icon:e.mdiFileSyncOutline,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Machine.LogfilesPanel.RolloverDescription")))])])],1),t(S,{staticClass:"mt-0"},[t(_,e._l(e.rolloverLogfiles,function(r){return t(we,{key:r,staticClass:"mt-0",attrs:{label:e.capitalize(r),value:r,"hide-details":""},model:{value:e.selectedRolloverLogs,callback:function(i){e.selectedRolloverLogs=i},expression:"selectedRolloverLogs"}})}),1)],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(" "+e._s(e.$t("Machine.LogfilesPanel.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.btnRolloverLogs}},[e._v(" "+e._s(e.$t("Machine.LogfilesPanel.Accept"))+" ")])],1)],1)],1)},Rj=[];const dv={};var Ij=N(Zn,Fj,Rj,!1,Hj,null,null,null);function Hj(e){for(let s in dv)this[s]=dv[s]}const jj=function(){return Ij.exports}();var Nj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Z,{attrs:{title:e.$t("Machine.LogfilesPanel.Logfiles"),icon:e.mdiFileDocumentEdit,"card-class":"machine-logfiles-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:"",color:"primary",ripple:!0,loading:e.loadings.includes("loadingBtnRolloverLogs"),disabled:["printing","paused"].includes(e.printer_state)},on:{click:function(a){e.showRolloverDialog=!0}}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiFileSyncOutline))])],1)]}}])},[t("span",[e._v(e._s(e.$t("Machine.LogfilesPanel.Rollover")))])])]},proxy:!0}])},[t(q,{class:"text-center text-lg-left"},[t(S,{staticClass:"pt-3"},e._l(e.genericLogfiles,function(r){return t($m,{key:r,attrs:{name:r}})}),1)],1)],1),t(jj,{attrs:{show:e.showRolloverDialog},on:{"close-dialog":function(r){e.showRolloverDialog=!1}}})],1)},Vj=[];const hv={};var Uj=N(Kd,Nj,Vj,!1,Bj,null,null,null);function Bj(e){for(let s in hv)this[s]=hv[s]}const g2=function(){return Uj.exports}();var Wj=Object.defineProperty,Gj=Object.getOwnPropertyDescriptor,zj=(e,s,t,r)=>{for(var i=r>1?void 0:r?Gj(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Wj(s,t,i),i};let Qd=class extends j(V){constructor(){super(...arguments),this.mdiArrowExpandVertical=LS,this.mdiSync=f0,this.sortEndstops={}}get endstops(){var s;const e=(s=this.$store.state.printer.endstops)!=null?s:{};return Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{})}get existProbe(){return"probe"in this.$store.state.printer.configfile.settings}get probe(){return"probe"in this.$store.state.printer&&"last_query"in this.$store.state.printer.probe?this.$store.state.printer.probe.last_query:!1}syncEndstops(){this.$socket.emit("printer.query_endstops.status",{},{action:"printer/getEndstopStatus",loading:"queryEndstops"}),this.existProbe&&(this.$store.dispatch("server/addEvent",{message:"QUERY_PROBE",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"QUERY_PROBE"}))}};Qd=zj([O({components:{Panel:Z}})],Qd);var Zj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Z,{attrs:{title:e.$t("Machine.EndstopPanel.Endstops"),icon:e.mdiArrowExpandVertical,"card-class":"machine-endstop-panel",collapsible:!0}},[t(q,{staticClass:"pb-0"},[t(ke,{attrs:{"px-0":"","py-0":""}},[Object.keys(e.endstops).length?[e._l(Object.keys(e.endstops),function(r){return t(S,{key:r},[t(_,{staticClass:"py-1"},[t("label",{staticClass:"mt-1 d-inline-block"},[e._v(" "+e._s(e.$t("Machine.EndstopPanel.Endstop"))+" "),t("b",[e._v(e._s(r.toUpperCase()))])]),t(ns,{staticClass:"float-right",attrs:{small:"",label:"",color:e.endstops[r]==="open"?"green":"red","text-color":"white"}},[e.endstops[r]==="open"?[e._v(" "+e._s(e.$t("Machine.EndstopPanel.open"))+" ")]:[e._v(" "+e._s(e.$t("Machine.EndstopPanel.TRIGGERED"))+" ")]],2)],1)],1)}),e.existProbe?t(S,[t(_,{staticClass:"py-1"},[t("label",{staticClass:"mt-1 d-inline-block"},[e._v("Probe")]),t(ns,{staticClass:"float-right",attrs:{small:"",label:"",color:e.probe?"red":"green","text-color":"white"}},[e.probe?[e._v(" "+e._s(e.$t("Machine.EndstopPanel.TRIGGERED"))+" ")]:[e._v(" "+e._s(e.$t("Machine.EndstopPanel.open"))+" ")]],2)],1)],1):e._e()]:[t(S,[t(_,[t("p",[e._v(e._s(e.$t("Machine.EndstopPanel.EndstopInfo")))])])],1)]],2)],1),t(ne,{staticClass:"pt-3"},[t(le),t(g,{attrs:{icon:"",loading:e.loadings.includes("queryEndstops")},on:{click:e.syncEndstops}},[t(v,[e._v(e._s(e.mdiSync))])],1)],1)],1)},qj=[];const pv={};var Xj=N(Qd,Zj,qj,!1,Yj,null,null,null);function Yj(e){for(let s in pv)this[s]=pv[s]}const v2=function(){return Xj.exports}();function _2(e,s){return function(){return e.apply(s,arguments)}}const{toString:Jj}=Object.prototype,{getPrototypeOf:wm}=Object,Fc=(e=>s=>{const t=Jj.call(s);return e[t]||(e[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),xs=e=>(e=e.toLowerCase(),s=>Fc(s)===e),Rc=e=>s=>typeof s===e,{isArray:Gi}=Array,qn=Rc("undefined");function Kj(e){return e!==null&&!qn(e)&&e.constructor!==null&&!qn(e.constructor)&&Wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const b2=xs("ArrayBuffer");function Qj(e){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(e):s=e&&e.buffer&&b2(e.buffer),s}const eN=Rc("string"),Wt=Rc("function"),y2=Rc("number"),Ic=e=>e!==null&&typeof e=="object",tN=e=>e===!0||e===!1,eo=e=>{if(Fc(e)!=="object")return!1;const s=wm(e);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sN=xs("Date"),rN=xs("File"),iN=xs("Blob"),nN=xs("FileList"),aN=e=>Ic(e)&&Wt(e.pipe),oN=e=>{let s;return e&&(typeof FormData=="function"&&e instanceof FormData||Wt(e.append)&&((s=Fc(e))==="formdata"||s==="object"&&Wt(e.toString)&&e.toString()==="[object FormData]"))},lN=xs("URLSearchParams"),cN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $a(e,s,{allOwnKeys:t=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Gi(e))for(r=0,i=e.length;r0;)if(i=t[r],s===i.toLowerCase())return i;return null}const $2=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),x2=e=>!qn(e)&&e!==$2;function eh(){const{caseless:e}=x2(this)&&this||{},s={},t=(r,i)=>{const n=e&&C2(s,i)||i;eo(s[n])&&eo(r)?s[n]=eh(s[n],r):eo(r)?s[n]=eh({},r):Gi(r)?s[n]=r.slice():s[n]=r};for(let r=0,i=arguments.length;r($a(s,(i,n)=>{t&&Wt(i)?e[n]=_2(i,t):e[n]=i},{allOwnKeys:r}),e),dN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hN=(e,s,t,r)=>{e.prototype=Object.create(s.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:s.prototype}),t&&Object.assign(e.prototype,t)},pN=(e,s,t,r)=>{let i,n,a;const o={};if(s=s||{},e==null)return s;do{for(i=Object.getOwnPropertyNames(e),n=i.length;n-- >0;)a=i[n],(!r||r(a,e,s))&&!o[a]&&(s[a]=e[a],o[a]=!0);e=t!==!1&&wm(e)}while(e&&(!t||t(e,s))&&e!==Object.prototype);return s},mN=(e,s,t)=>{e=String(e),(t===void 0||t>e.length)&&(t=e.length),t-=s.length;const r=e.indexOf(s,t);return r!==-1&&r===t},fN=e=>{if(!e)return null;if(Gi(e))return e;let s=e.length;if(!y2(s))return null;const t=new Array(s);for(;s-- >0;)t[s]=e[s];return t},gN=(e=>s=>e&&s instanceof e)(typeof Uint8Array<"u"&&wm(Uint8Array)),vN=(e,s)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const n=i.value;s.call(e,n[0],n[1])}},_N=(e,s)=>{let t;const r=[];for(;(t=e.exec(s))!==null;)r.push(t);return r},bN=xs("HTMLFormElement"),yN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,i){return r.toUpperCase()+i}),mv=(({hasOwnProperty:e})=>(s,t)=>e.call(s,t))(Object.prototype),CN=xs("RegExp"),w2=(e,s)=>{const t=Object.getOwnPropertyDescriptors(e),r={};$a(t,(i,n)=>{let a;(a=s(i,n,e))!==!1&&(r[n]=a||i)}),Object.defineProperties(e,r)},$N=e=>{w2(e,(s,t)=>{if(Wt(e)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=e[t];if(Wt(r)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},xN=(e,s)=>{const t={},r=i=>{i.forEach(n=>{t[n]=!0})};return Gi(e)?r(e):r(String(e).split(s)),t},wN=()=>{},SN=(e,s)=>(e=+e,Number.isFinite(e)?e:s),Lu="abcdefghijklmnopqrstuvwxyz",fv="0123456789",S2={DIGIT:fv,ALPHA:Lu,ALPHA_DIGIT:Lu+Lu.toUpperCase()+fv},PN=(e=16,s=S2.ALPHA_DIGIT)=>{let t="";const{length:r}=s;for(;e--;)t+=s[Math.random()*r|0];return t};function TN(e){return!!(e&&Wt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const DN=e=>{const s=new Array(10),t=(r,i)=>{if(Ic(r)){if(s.indexOf(r)>=0)return;if(!("toJSON"in r)){s[i]=r;const n=Gi(r)?[]:{};return $a(r,(a,o)=>{const l=t(a,i+1);!qn(l)&&(n[o]=l)}),s[i]=void 0,n}}return r};return t(e,0)},MN=xs("AsyncFunction"),EN=e=>e&&(Ic(e)||Wt(e))&&Wt(e.then)&&Wt(e.catch),J={isArray:Gi,isArrayBuffer:b2,isBuffer:Kj,isFormData:oN,isArrayBufferView:Qj,isString:eN,isNumber:y2,isBoolean:tN,isObject:Ic,isPlainObject:eo,isUndefined:qn,isDate:sN,isFile:rN,isBlob:iN,isRegExp:CN,isFunction:Wt,isStream:aN,isURLSearchParams:lN,isTypedArray:gN,isFileList:nN,forEach:$a,merge:eh,extend:uN,trim:cN,stripBOM:dN,inherits:hN,toFlatObject:pN,kindOf:Fc,kindOfTest:xs,endsWith:mN,toArray:fN,forEachEntry:vN,matchAll:_N,isHTMLForm:bN,hasOwnProperty:mv,hasOwnProp:mv,reduceDescriptors:w2,freezeMethods:$N,toObjectSet:xN,toCamelCase:yN,noop:wN,toFiniteNumber:SN,findKey:C2,global:$2,isContextDefined:x2,ALPHABET:S2,generateString:PN,isSpecCompliantForm:TN,toJSONObject:DN,isAsyncFn:MN,isThenable:EN};function Me(e,s,t,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",s&&(this.code=s),t&&(this.config=t),r&&(this.request=r),i&&(this.response=i)}J.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:J.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const P2=Me.prototype,T2={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{T2[e]={value:e}});Object.defineProperties(Me,T2);Object.defineProperty(P2,"isAxiosError",{value:!0});Me.from=(e,s,t,r,i,n)=>{const a=Object.create(P2);return J.toFlatObject(e,a,function(l){return l!==Error.prototype},o=>o!=="isAxiosError"),Me.call(a,e.message,s,t,r,i),a.cause=e,a.name=e.name,n&&Object.assign(a,n),a};const ON=null;function th(e){return J.isPlainObject(e)||J.isArray(e)}function D2(e){return J.endsWith(e,"[]")?e.slice(0,-2):e}function gv(e,s,t){return e?e.concat(s).map(function(i,n){return i=D2(i),!t&&n?"["+i+"]":i}).join(t?".":""):s}function LN(e){return J.isArray(e)&&!e.some(th)}const kN=J.toFlatObject(J,{},null,function(s){return/^is[A-Z]/.test(s)});function Hc(e,s,t){if(!J.isObject(e))throw new TypeError("target must be an object");s=s||new FormData,t=J.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,b){return!J.isUndefined(b[f])});const r=t.metaTokens,i=t.visitor||u,n=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&J.isSpecCompliantForm(s);if(!J.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(J.isDate(m))return m.toISOString();if(!l&&J.isBlob(m))throw new Me("Blob is not supported. Use a Buffer instead.");return J.isArrayBuffer(m)||J.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,f,b){let C=m;if(m&&!b&&typeof m=="object"){if(J.endsWith(f,"{}"))f=r?f:f.slice(0,-2),m=JSON.stringify(m);else if(J.isArray(m)&&LN(m)||(J.isFileList(m)||J.endsWith(f,"[]"))&&(C=J.toArray(m)))return f=D2(f),C.forEach(function(M,H){!(J.isUndefined(M)||M===null)&&s.append(a===!0?gv([f],H,n):a===null?f:f+"[]",c(M))}),!1}return th(m)?!0:(s.append(gv(b,f,n),c(m)),!1)}const d=[],h=Object.assign(kN,{defaultVisitor:u,convertValue:c,isVisitable:th});function p(m,f){if(!J.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+f.join("."));d.push(m),J.forEach(m,function(C,w){(!(J.isUndefined(C)||C===null)&&i.call(s,C,J.isString(w)?w.trim():w,f,h))===!0&&p(C,f?f.concat(w):[w])}),d.pop()}}if(!J.isObject(e))throw new TypeError("data must be an object");return p(e),s}function vv(e){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return s[r]})}function Sm(e,s){this._pairs=[],e&&Hc(e,this,s)}const M2=Sm.prototype;M2.append=function(s,t){this._pairs.push([s,t])};M2.toString=function(s){const t=s?function(r){return s.call(this,r,vv)}:vv;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function AN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function E2(e,s,t){if(!s)return e;const r=t&&t.encode||AN,i=t&&t.serialize;let n;if(i?n=i(s,t):n=J.isURLSearchParams(s)?s.toString():new Sm(s,t).toString(r),n){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}class FN{constructor(){this.handlers=[]}use(s,t,r){return this.handlers.push({fulfilled:s,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){J.forEach(this.handlers,function(r){r!==null&&s(r)})}}const _v=FN,O2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RN=typeof URLSearchParams<"u"?URLSearchParams:Sm,IN=typeof FormData<"u"?FormData:null,HN=typeof Blob<"u"?Blob:null,jN=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),NN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),gs={isBrowser:!0,classes:{URLSearchParams:RN,FormData:IN,Blob:HN},isStandardBrowserEnv:jN,isStandardBrowserWebWorkerEnv:NN,protocols:["http","https","file","blob","url","data"]};function VN(e,s){return Hc(e,new gs.classes.URLSearchParams,Object.assign({visitor:function(t,r,i,n){return gs.isNode&&J.isBuffer(t)?(this.append(r,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},s))}function UN(e){return J.matchAll(/\w+|\[(\w*)]/g,e).map(s=>s[0]==="[]"?"":s[1]||s[0])}function BN(e){const s={},t=Object.keys(e);let r;const i=t.length;let n;for(r=0;r=t.length;return a=!a&&J.isArray(i)?i.length:a,l?(J.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!o):((!i[a]||!J.isObject(i[a]))&&(i[a]=[]),s(t,r,i[a],n)&&J.isArray(i[a])&&(i[a]=BN(i[a])),!o)}if(J.isFormData(e)&&J.isFunction(e.entries)){const t={};return J.forEachEntry(e,(r,i)=>{s(UN(r),i,t,0)}),t}return null}function WN(e,s,t){if(J.isString(e))try{return(s||JSON.parse)(e),J.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(e)}const Pm={transitional:O2,adapter:["xhr","http"],transformRequest:[function(s,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=J.isObject(s);if(n&&J.isHTMLForm(s)&&(s=new FormData(s)),J.isFormData(s))return i&&i?JSON.stringify(L2(s)):s;if(J.isArrayBuffer(s)||J.isBuffer(s)||J.isStream(s)||J.isFile(s)||J.isBlob(s))return s;if(J.isArrayBufferView(s))return s.buffer;if(J.isURLSearchParams(s))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let o;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return VN(s,this.formSerializer).toString();if((o=J.isFileList(s))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Hc(o?{"files[]":s}:s,l&&new l,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),WN(s)):s}],transformResponse:[function(s){const t=this.transitional||Pm.transitional,r=t&&t.forcedJSONParsing,i=this.responseType==="json";if(s&&J.isString(s)&&(r&&!this.responseType||i)){const a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(s)}catch(o){if(a)throw o.name==="SyntaxError"?Me.from(o,Me.ERR_BAD_RESPONSE,this,null,this.response):o}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gs.classes.FormData,Blob:gs.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};J.forEach(["delete","get","head","post","put","patch"],e=>{Pm.headers[e]={}});const Tm=Pm,GN=J.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zN=e=>{const s={};let t,r,i;return e&&e.split("\n").forEach(function(a){i=a.indexOf(":"),t=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!t||s[t]&&GN[t])&&(t==="set-cookie"?s[t]?s[t].push(r):s[t]=[r]:s[t]=s[t]?s[t]+", "+r:r)}),s},bv=Symbol("internals");function sn(e){return e&&String(e).trim().toLowerCase()}function to(e){return e===!1||e==null?e:J.isArray(e)?e.map(to):String(e)}function ZN(e){const s=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(e);)s[r[1]]=r[2];return s}const qN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ku(e,s,t,r,i){if(J.isFunction(r))return r.call(this,s,t);if(i&&(s=t),!!J.isString(s)){if(J.isString(r))return s.indexOf(r)!==-1;if(J.isRegExp(r))return r.test(s)}}function XN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,t,r)=>t.toUpperCase()+r)}function YN(e,s){const t=J.toCamelCase(" "+s);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+t,{value:function(i,n,a){return this[r].call(this,s,i,n,a)},configurable:!0})})}class jc{constructor(s){s&&this.set(s)}set(s,t,r){const i=this;function n(o,l,c){const u=sn(l);if(!u)throw new Error("header name must be a non-empty string");const d=J.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=to(o))}const a=(o,l)=>J.forEach(o,(c,u)=>n(c,u,l));return J.isPlainObject(s)||s instanceof this.constructor?a(s,t):J.isString(s)&&(s=s.trim())&&!qN(s)?a(zN(s),t):s!=null&&n(t,s,r),this}get(s,t){if(s=sn(s),s){const r=J.findKey(this,s);if(r){const i=this[r];if(!t)return i;if(t===!0)return ZN(i);if(J.isFunction(t))return t.call(this,i,r);if(J.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,t){if(s=sn(s),s){const r=J.findKey(this,s);return!!(r&&this[r]!==void 0&&(!t||ku(this,this[r],r,t)))}return!1}delete(s,t){const r=this;let i=!1;function n(a){if(a=sn(a),a){const o=J.findKey(r,a);o&&(!t||ku(r,r[o],o,t))&&(delete r[o],i=!0)}}return J.isArray(s)?s.forEach(n):n(s),i}clear(s){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const n=t[r];(!s||ku(this,this[n],n,s,!0))&&(delete this[n],i=!0)}return i}normalize(s){const t=this,r={};return J.forEach(this,(i,n)=>{const a=J.findKey(r,n);if(a){t[a]=to(i),delete t[n];return}const o=s?XN(n):String(n).trim();o!==n&&delete t[n],t[o]=to(i),r[o]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const t=Object.create(null);return J.forEach(this,(r,i)=>{r!=null&&r!==!1&&(t[i]=s&&J.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,t])=>s+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...t){const r=new this(s);return t.forEach(i=>r.set(i)),r}static accessor(s){const r=(this[bv]=this[bv]={accessors:{}}).accessors,i=this.prototype;function n(a){const o=sn(a);r[o]||(YN(i,a),r[o]=!0)}return J.isArray(s)?s.forEach(n):n(s),this}}jc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);J.reduceDescriptors(jc.prototype,({value:e},s)=>{let t=s[0].toUpperCase()+s.slice(1);return{get:()=>e,set(r){this[t]=r}}});J.freezeMethods(jc);const ks=jc;function Au(e,s){const t=this||Tm,r=s||t,i=ks.from(r.headers);let n=r.data;return J.forEach(e,function(o){n=o.call(t,n,i.normalize(),s?s.status:void 0)}),i.normalize(),n}function k2(e){return!!(e&&e.__CANCEL__)}function xa(e,s,t){Me.call(this,e==null?"canceled":e,Me.ERR_CANCELED,s,t),this.name="CanceledError"}J.inherits(xa,Me,{__CANCEL__:!0});function JN(e,s,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?e(t):s(new Me("Request failed with status code "+t.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const KN=gs.isStandardBrowserEnv?function(){return{write:function(t,r,i,n,a,o){const l=[];l.push(t+"="+encodeURIComponent(r)),J.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),J.isString(n)&&l.push("path="+n),J.isString(a)&&l.push("domain="+a),o===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(t){const r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function QN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eV(e,s){return s?e.replace(/\/+$/,"")+"/"+s.replace(/^\/+/,""):e}function A2(e,s){return e&&!QN(s)?eV(e,s):s}const tV=gs.isStandardBrowserEnv?function(){const s=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function i(n){let a=n;return s&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=i(window.location.href),function(a){const o=J.isString(a)?i(a):a;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}();function sV(e){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return s&&s[1]||""}function rV(e,s){e=e||10;const t=new Array(e),r=new Array(e);let i=0,n=0,a;return s=s!==void 0?s:1e3,function(l){const c=Date.now(),u=r[n];a||(a=c),t[i]=l,r[i]=c;let d=n,h=0;for(;d!==i;)h+=t[d++],d=d%e;if(i=(i+1)%e,i===n&&(n=(n+1)%e),c-a{const n=i.loaded,a=i.lengthComputable?i.total:void 0,o=n-t,l=r(o),c=n<=a;t=n;const u={loaded:n,total:a,progress:a?n/a:void 0,bytes:o,rate:l||void 0,estimated:l&&a&&c?(a-n)/l:void 0,event:i};u[s?"download":"upload"]=!0,e(u)}}const iV=typeof XMLHttpRequest<"u",nV=iV&&function(e){return new Promise(function(t,r){let i=e.data;const n=ks.from(e.headers).normalize(),a=e.responseType;let o;function l(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}let c;J.isFormData(i)&&(gs.isStandardBrowserEnv||gs.isStandardBrowserWebWorkerEnv?n.setContentType(!1):n.getContentType(/^\s*multipart\/form-data/)?J.isString(c=n.getContentType())&&n.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):n.setContentType("multipart/form-data"));let u=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(m+":"+f))}const d=A2(e.baseURL,e.url);u.open(e.method.toUpperCase(),E2(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function h(){if(!u)return;const m=ks.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:m,config:e,request:u};JN(function(w){t(w),l()},function(w){r(w),l()},b),u=null}if("onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(h)},u.onabort=function(){u&&(r(new Me("Request aborted",Me.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new Me("Network Error",Me.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||O2;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),r(new Me(f,b.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,e,u)),u=null},gs.isStandardBrowserEnv){const m=tV(d)&&e.xsrfCookieName&&KN.read(e.xsrfCookieName);m&&n.set(e.xsrfHeaderName,m)}i===void 0&&n.setContentType(null),"setRequestHeader"in u&&J.forEach(n.toJSON(),function(f,b){u.setRequestHeader(b,f)}),J.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&a!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",yv(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",yv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=m=>{u&&(r(!m||m.type?new xa(null,e,u):m),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const p=sV(d);if(p&&gs.protocols.indexOf(p)===-1){r(new Me("Unsupported protocol "+p+":",Me.ERR_BAD_REQUEST,e));return}u.send(i||null)})},sh={http:ON,xhr:nV};J.forEach(sh,(e,s)=>{if(e){try{Object.defineProperty(e,"name",{value:s})}catch{}Object.defineProperty(e,"adapterName",{value:s})}});const Cv=e=>"- ".concat(e),aV=e=>J.isFunction(e)||e===null||e===!1,F2={getAdapter:e=>{e=J.isArray(e)?e:[e];const{length:s}=e;let t,r;const i={};for(let n=0;n"adapter ".concat(o," ")+(l===!1?"is not supported by the environment":"is not available in the build"));let a=s?n.length>1?"since :\n"+n.map(Cv).join("\n"):" "+Cv(n[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:sh};function Fu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xa(null,e)}function $v(e){return Fu(e),e.headers=ks.from(e.headers),e.data=Au.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),F2.getAdapter(e.adapter||Tm.adapter)(e).then(function(r){return Fu(e),r.data=Au.call(e,e.transformResponse,r),r.headers=ks.from(r.headers),r},function(r){return k2(r)||(Fu(e),r&&r.response&&(r.response.data=Au.call(e,e.transformResponse,r.response),r.response.headers=ks.from(r.response.headers))),Promise.reject(r)})}const xv=e=>e instanceof ks?e.toJSON():e;function xi(e,s){s=s||{};const t={};function r(c,u,d){return J.isPlainObject(c)&&J.isPlainObject(u)?J.merge.call({caseless:d},c,u):J.isPlainObject(u)?J.merge({},u):J.isArray(u)?u.slice():u}function i(c,u,d){if(J.isUndefined(u)){if(!J.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function n(c,u){if(!J.isUndefined(u))return r(void 0,u)}function a(c,u){if(J.isUndefined(u)){if(!J.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function o(c,u,d){if(d in s)return r(c,u);if(d in e)return r(void 0,c)}const l={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,u)=>i(xv(c),xv(u),!0)};return J.forEach(Object.keys(Object.assign({},e,s)),function(u){const d=l[u]||i,h=d(e[u],s[u],u);J.isUndefined(h)&&d!==o||(t[u]=h)}),t}const R2="1.6.0",Dm={};["object","boolean","number","function","string","symbol"].forEach((e,s)=>{Dm[e]=function(r){return typeof r===e||"a"+(s<1?"n ":" ")+e}});const wv={};Dm.transitional=function(s,t,r){function i(n,a){return"[Axios v"+R2+"] Transitional option '"+n+"'"+a+(r?". "+r:"")}return(n,a,o)=>{if(s===!1)throw new Me(i(a," has been removed"+(t?" in "+t:"")),Me.ERR_DEPRECATED);return t&&!wv[a]&&(wv[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),s?s(n,a,o):!0}};function oV(e,s,t){if(typeof e!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const n=r[i],a=s[n];if(a){const o=e[n],l=o===void 0||a(o,n,e);if(l!==!0)throw new Me("option "+n+" must be "+l,Me.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Me("Unknown option "+n,Me.ERR_BAD_OPTION)}}const rh={assertOptions:oV,validators:Dm},qs=rh.validators;class il{constructor(s){this.defaults=s,this.interceptors={request:new _v,response:new _v}}request(s,t){typeof s=="string"?(t=t||{},t.url=s):t=s||{},t=xi(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;r!==void 0&&rh.assertOptions(r,{silentJSONParsing:qs.transitional(qs.boolean),forcedJSONParsing:qs.transitional(qs.boolean),clarifyTimeoutError:qs.transitional(qs.boolean)},!1),i!=null&&(J.isFunction(i)?t.paramsSerializer={serialize:i}:rh.assertOptions(i,{encode:qs.function,serialize:qs.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&J.merge(n.common,n[t.method]);n&&J.forEach(["delete","get","head","post","put","patch","common"],m=>{delete n[m]}),t.headers=ks.concat(a,n);const o=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(l=l&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!l){const m=[$v.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,c),h=m.length,u=Promise.resolve(t);d{if(!r._listeners)return;let n=r._listeners.length;for(;n-- >0;)r._listeners[n](i);r._listeners=null}),this.promise.then=i=>{let n;const a=new Promise(o=>{r.subscribe(o),n=o}).then(i);return a.cancel=function(){r.unsubscribe(n)},a},s(function(n,a,o){r.reason||(r.reason=new xa(n,a,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const t=this._listeners.indexOf(s);t!==-1&&this._listeners.splice(t,1)}static source(){let s;return{token:new Mm(function(i){s=i}),cancel:s}}}const lV=Mm;function cV(e){return function(t){return e.apply(null,t)}}function uV(e){return J.isObject(e)&&e.isAxiosError===!0}const ih={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ih).forEach(([e,s])=>{ih[s]=e});const dV=ih;function I2(e){const s=new so(e),t=_2(so.prototype.request,s);return J.extend(t,so.prototype,s,{allOwnKeys:!0}),J.extend(t,s,null,{allOwnKeys:!0}),t.create=function(i){return I2(xi(e,i))},t}const Ke=I2(Tm);Ke.Axios=so;Ke.CanceledError=xa;Ke.CancelToken=lV;Ke.isCancel=k2;Ke.VERSION=R2;Ke.toFormData=Hc;Ke.AxiosError=Me;Ke.Cancel=Ke.CanceledError;Ke.all=function(s){return Promise.all(s)};Ke.spread=cV;Ke.isAxiosError=uV;Ke.mergeConfig=xi;Ke.AxiosHeaders=ks;Ke.formToJSON=e=>L2(J.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=F2.getAdapter;Ke.HttpStatusCode=dV;Ke.default=Ke;const Es=Ke;var hV=Object.defineProperty,pV=Object.getOwnPropertyDescriptor,mV=(e,s,t,r)=>{for(var i=r>1?void 0:r?pV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&hV(s,t,i),i};let nh=class extends j(V,kt){constructor(){super(...arguments),this.mdiInformation=At,this.mdiClose=ca,this.mdiCog=Us,this.mdiFolder=Cp,this.mdiFolderUpload=xp,this.mdiFileDocumentEditOutline=da,this.mdiFile=dr,this.mdiCloudDownload=Pn,this.mdiRenameBox=Ql,this.mdiDelete=Ye,this.mdiCloseThick=Ce,this.mdiLockOutline=Yl,this.mdiContentCopy=Bb,this.sortFiles=Ap,this.formatFilesize=it,this.currentPage=1,this.contextMenu={shown:!1,isDirectory:!1,touchTimer:null,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogImage={show:!1,item:{name:null,url:null,svg:null}},this.dialogCreateFile={show:!1,name:""},this.dialogRenameFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDuplicateFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogCreateDirectory={show:!1,name:""},this.dialogRenameDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDeleteDirectory={show:!1,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.uploadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,number:0,max:0,cancelTokenSource:{},lastProgress:{time:0,loaded:0}},this.draggingFile={item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[e=>!!e||this.$t("Files.InvalidNameEmpty"),e=>!this.existsFilename(e)||this.$t("Files.InvalidNameAlreadyExists")]}existsFilename(e){return this.files.findIndex(s=>s.filename===e)>=0}get blockFileUpload(){var e;return(e=this.$store.state.gui.view.blockFileUpload)!=null?e:!1}set blockFileUpload(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.blockFileUpload",value:e})}get toolbarButtons(){return[{text:this.$t("Machine.ConfigFilesPanel.Download"),color:"primary",icon:Pn,loadingName:"configDownloadZip",onlyWriteable:!1,condition:this.selectedFiles.length>0,click:()=>{this.downloadSelectedFiles()}},{text:this.$t("Machine.ConfigFilesPanel.Delete"),color:"error",icon:Ye,loadingName:null,onlyWriteable:!0,condition:this.selectedFiles.length>0,click:()=>{this.deleteSelectedDialog=!0}},{text:this.$t("Machine.ConfigFilesPanel.UploadFile"),color:this.machineButtonCol,icon:Yb,loadingName:null,onlyWriteable:!0,condition:!0,click:this.uploadFileButton},{text:this.$t("Machine.ConfigFilesPanel.CreateFile"),color:this.machineButtonCol,icon:oP,loadingName:null,onlyWriteable:!0,condition:!0,click:this.createFile},{text:this.$t("Machine.ConfigFilesPanel.CreateDirectory"),color:this.machineButtonCol,icon:$p,loadingName:null,onlyWriteable:!0,condition:!0,click:this.createDirectory},{text:this.$t("Machine.ConfigFilesPanel.RefreshDirectory"),color:this.machineButtonCol,icon:Hi,loadingName:null,onlyWriteable:!1,condition:!0,click:this.refreshFileList}].filter(e=>e.condition)}get filteredToolbarButtons(){return this.toolbarButtons.filter(e=>this.directoryPermissions.includes("w")&&e.onlyWriteable||!e.onlyWriteable)}get absolutePath(){let e="/"+this.root;return this.currentPath&&(e+=this.currentPath),e}get directory(){return this.$store.getters["files/getDirectory"](this.absolutePath)}get disk_usage(){var e,s;return(s=(e=this.directory)==null?void 0:e.disk_usage)!=null?s:{used:0,free:0,total:0}}get directoryPermissions(){var e,s;return(s=(e=this.directory)==null?void 0:e.permissions)!=null?s:"r"}get files(){var s,t;let e=[...(t=(s=this.directory)==null?void 0:s.childrens)!=null?t:[]];if(this.showHiddenFiles||(e=e.filter(r=>r.filename.slice(0,1)!==".")),this.hideBackupFiles){const r=/.*\/?printer-\d{8}_\d{6}\.cfg$/;e=e.filter(i=>!i.filename.match(r))}return e}get headers(){return[{text:"",value:"",sortable:!1},{text:this.$t("Machine.ConfigFilesPanel.Name"),value:"filename"},{text:this.$t("Machine.ConfigFilesPanel.Filesize"),value:"size",align:"right"},{text:this.$t("Machine.ConfigFilesPanel.LastModified"),value:"modified",align:"right"}]}get selectedFiles(){var e;return(e=this.$store.state.gui.view.configfiles.selectedFiles)!=null?e:[]}set selectedFiles(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.selectedFiles",value:e})}get countPerPage(){return this.$store.state.gui.view.configfiles.countPerPage}set countPerPage(e){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.countPerPage",value:e})}get showHiddenFiles(){return this.$store.state.gui.view.configfiles.showHiddenFiles}set showHiddenFiles(e){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.showHiddenFiles",value:e})}get hideBackupFiles(){return this.$store.state.gui.view.configfiles.hideBackupFiles}set hideBackupFiles(e){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.hideBackupFiles",value:e})}get sortBy(){return this.$store.state.gui.view.configfiles.sortBy}set sortBy(e){e===void 0&&(e="filename"),this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.sortBy",value:e})}get sortDesc(){return this.$store.state.gui.view.configfiles.sortDesc}set sortDesc(e){e===void 0&&(e=!1),this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.sortDesc",value:e})}get registeredDirectories(){var e;return(e=this.$store.state.server.registered_directories)!=null?e:[]}get existConfigRoot(){return this.registeredDirectories.findIndex(e=>e==="config")!==-1}get showMissingConfigRootWarning(){return this.absolutePath.startsWith("/config")&&!this.absolutePath.startsWith("/config_example")&&!this.existConfigRoot}get registeredDirectoriesSelectItems(){const e=this.registeredDirectories.filter(s=>!$S.includes(s)).sort();return this.existConfigRoot||e.push("config"),e}get root(){return this.$store.state.gui.view.configfiles.rootPath}set root(e){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.rootPath",value:e})}get currentPath(){return this.$store.state.gui.view.configfiles.currentPath}set currentPath(e){this.selectedFiles=[],this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.currentPath",value:e})}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:this.absolutePath.substring(1)},{action:"files/getDirectory"})}changeRoot(){this.currentPath=""}clickRow(e,s=!1){var t,r,i,n;if(!this.contextMenu.shown||s)if(s&&(this.contextMenu.shown=!1),e.isDirectory)this.currentPath+="/"+e.filename,this.currentPage=1;else if(["png","jpeg","jpg","gif","bmp","tif","svg"].includes((r=(t=e.filename.split(".").pop())==null?void 0:t.toLowerCase())!=null?r:"")){const a="".concat(this.apiUrl,"/server/files").concat(this.absolutePath,"/").concat(e.filename,"?t=").concat(Date.now());this.dialogImage.item.name=e.filename,["svg"].includes((n=(i=e.filename.split(".").pop())==null?void 0:i.toLowerCase())!=null?n:"")?fetch(a).then(o=>o.text()).then(o=>{this.dialogImage.show=!0,this.dialogImage.item.svg=o}):(this.dialogImage.show=!0,this.dialogImage.item.url=a)}else this.$store.dispatch("editor/openFile",{root:this.root,path:this.currentPath,filename:e.filename,size:e.size,permissions:e.permissions})}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(e){this.currentPath=e.location}showContextMenu(e,s){this.contextMenu.shown||(e==null||e.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenu.y=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.contextMenu.item=s,this.$nextTick(()=>{this.contextMenu.shown=!0}))}downloadFile(){const e=this.absolutePath+"/"+this.contextMenu.item.filename,s="".concat(this.apiUrl,"/server/files").concat(encodeURI(e));window.open(s)}async downloadSelectedFiles(){let e=[];const s=async(c,u)=>{for(const d of u){const h="".concat(c,"/").concat(d.filename);if(d.isDirectory&&d.childrens){await s(h,d.childrens);continue}e.push(h)}};await s(this.absolutePath,this.selectedFiles);const t=new Date,r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),n=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),l="".concat(t.getFullYear()).concat(r).concat(i,"-").concat(n).concat(a).concat(o);this.$socket.emit("server.files.zip",{items:e,dest:"config/".concat(this.root,"-").concat(l,".zip")},{action:"files/downloadZip",loading:"configDownloadZip"}),this.selectedFiles=[]}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputDialogCreateDirectoryName)==null||e.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:this.absolutePath.substring(1)+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"})}renameDirectory(e){this.dialogRenameDirectory.item=e,this.dialogRenameDirectory.newName=e.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputDialogRenameDirectoryName)==null||s.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:(this.absolutePath+"/"+this.dialogRenameDirectory.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogRenameDirectory.newName).slice(1)},{action:"files/getMove"})}deleteDirectory(e){this.dialogDeleteDirectory.item=e,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:this.absolutePath+"/"+this.dialogDeleteDirectory.item.filename,force:!0},{action:"files/getDeleteDir"})}createFile(){this.dialogCreateFile.name="",this.dialogCreateFile.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputDialogCreateFileName)==null||e.focus()},200)}createFileAction(){const e=new File([""],this.dialogCreateFile.name);let s=new FormData;s.append("file",e),s.append("root",this.root),this.currentPath.length&&s.append("path",this.currentPath.slice(1)),Es.post(this.apiUrl+"/server/files/upload",s,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{this.$toast.success(this.$t("Files.SuccessfullyCreated",{filename:this.dialogCreateFile.name}).toString()),this.dialogCreateFile.show=!1,this.dialogCreateFile.name=""}).catch(()=>{window.console.error("Error create file: "+this.dialogCreateFile.name)})}renameFile(e){this.dialogRenameFile.item=e,this.dialogRenameFile.newName=e.filename,this.dialogRenameFile.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputDialogRenameFileName)==null||s.focus()},200)}renameFileAction(){this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:(this.absolutePath+"/"+this.dialogRenameFile.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogRenameFile.newName).slice(1)},{action:"files/getMove"})}duplicateFile(e){this.dialogDuplicateFile.item=e,this.dialogDuplicateFile.newName=e.filename,this.dialogDuplicateFile.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputDialogDuplicateFileName)==null||s.focus()},200)}duplicateFileAction(){this.dialogDuplicateFile.show=!1,this.$socket.emit("server.files.copy",{source:(this.absolutePath+"/"+this.dialogDuplicateFile.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogDuplicateFile.newName).slice(1)})}removeFile(){this.$socket.emit("server.files.delete_file",{path:this.absolutePath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteSelectedFiles(){this.selectedFiles.forEach(e=>{e.isDirectory?this.$socket.emit("server.files.delete_directory",{path:this.absolutePath+"/"+e.filename,force:!0},{action:"files/getDeleteDir"}):this.$socket.emit("server.files.delete_file",{path:this.absolutePath+"/"+e.filename},{action:"files/getDeleteFile"})}),this.selectedFiles=[],this.deleteSelectedDialog=!1}uploadFileButton(){this.$refs.fileUpload.click()}async uploadFile(){var e;if((e=this.$refs.fileUpload.files)!=null&&e.length){const s=[...this.$refs.fileUpload.files];this.$refs.fileUpload.value="",await this.$store.dispatch("socket/addLoading",{name:"configFileUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",this.$refs.fileUpload.files.length);for(const t of s){await this.$store.dispatch("files/uploadIncrementCurrentNumber");const r=this.currentPath.slice(0,1)==="/"?this.currentPath.slice(1):this.currentPath,i=await this.$store.dispatch("files/uploadFile",{file:t,path:r,root:"config"});i!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:i}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"configFileUpload"})}}cancelUpload(){this.uploadSnackbar.cancelTokenSource.cancel(),this.uploadSnackbar.status=!1}dragFile(e,s){e.preventDefault(),this.blockFileUpload=!0,this.draggingFile.item=s}dragendFile(e){e.preventDefault(),this.blockFileUpload=!1,this.draggingFile.item={isDirectory:!1,filename:"",permissions:"",modified:new Date}}dragOverFilelist(e,s){this.blockFileUpload&&(e.preventDefault(),s.isDirectory&&(e.target.parentElement.style.backgroundColor="#43A04720"))}dragLeaveFilelist(e){this.blockFileUpload&&(e.preventDefault(),e.stopPropagation(),e.target.parentElement.style.backgroundColor="transparent")}async dragDropFilelist(e,s){if(this.blockFileUpload){e.preventDefault(),e.target.parentElement.style.backgroundColor="transparent";let t;s.filename===".."?t=this.absolutePath.slice(1,this.absolutePath.lastIndexOf("/")+1)+this.draggingFile.item.filename:t=this.absolutePath+"/"+s.filename+"/"+this.draggingFile.item.filename,this.$socket.emit("server.files.move",{source:this.absolutePath.slice(1)+"/"+this.draggingFile.item.filename,dest:t},{action:"files/getMove"})}}};nh=mV([O({components:{Panel:Z,PathNavigation:Bi}})],nh);var fV=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r("div",[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.ConfigFiles"),"card-class":"machine-configfiles-panel",icon:s.mdiInformation,collapsible:!0}},[r(q,[r(S,[r(_,{staticClass:"col-12 col-lg pr-lg-0"},[r(Le,{staticClass:"machine-configfiles-panel__root-select",attrs:{items:s.registeredDirectoriesSelectItems,label:s.$t("Machine.ConfigFilesPanel.Root"),outlined:"","hide-details":"",dense:"",attach:".machine-configfiles-panel__root-select"},on:{change:s.changeRoot},model:{value:s.root,callback:function(i){s.root=i},expression:"root"}})],1),r(_,{staticClass:"col col-lg-auto pl-lg-0 text-right"},[r("input",{ref:"fileUpload",staticStyle:{display:"none"},attrs:{type:"file",multiple:""},on:{change:s.uploadFile}}),s._l(s.filteredToolbarButtons,function(i){return r(g,{key:i.loadingName,staticClass:"px-2 minwidth-0 ml-3",attrs:{color:i.color,loading:i.loadingName!==null&&s.loadings.includes(i.loadingName)},on:{click:i.click}},[r(pe,{attrs:{top:""},scopedSlots:s._u([{key:"activator",fn:function(n){var a=n.on,o=n.attrs;return[r(v,s._g(s._b({},"v-icon",o,!1),a),[s._v(s._s(i.icon))])]}}],null,!0)},[r("span",[s._v(s._s(i.text))])])],1)}),r($e,{attrs:{"offset-y":"",left:"",title:s.$t("Machine.ConfigFilesPanel.SetupCurrentList")},scopedSlots:s._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[r(g,s._g(s._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",a,!1),n),[r(v,{staticClass:"machine-configfiles-panel__settings-icon"},[s._v(s._s(s.mdiCog))])],1)]}}])},[r(Oe,[r(K,{staticClass:"minHeight36"},[r(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:s.$t("Machine.ConfigFilesPanel.HiddenFiles")},model:{value:s.showHiddenFiles,callback:function(i){s.showHiddenFiles=i},expression:"showHiddenFiles"}})],1),r(K,{staticClass:"minHeight36"},[r(we,{staticClass:"mt-0",attrs:{"hide-details":"",label:s.$t("Machine.ConfigFilesPanel.HideBackupFiles")},model:{value:s.hideBackupFiles,callback:function(i){s.hideBackupFiles=i},expression:"hideBackupFiles"}})],1)],1)],1)],2)],1)],1),r(q,[r(S,[r(_,{staticClass:"col-12 py-2 d-flex align-center"},[r("span",[r("b",{staticClass:"mr-1"},[s._v(s._s(s.$t("Machine.ConfigFilesPanel.CurrentPath"))+":")]),r(Bi,{attrs:{path:s.currentPath,"base-directory-label":"/".concat(s.root),"on-segment-click":s.clickPathNavGoToDirectory}})],1),r(le),s.disk_usage!==null&&!s.showMissingConfigRootWarning?[r(pe,{attrs:{top:""},scopedSlots:s._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[r("span",s._g(s._b({},"span",a,!1),n),[r("b",[s._v(s._s(s.$t("Machine.ConfigFilesPanel.FreeDisk"))+":")]),s._v(" "+s._s(s.formatFilesize(s.disk_usage.free))+" ")])]}}],null,!1,3140322967)},[r("span",[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Used"))+": "+s._s(s.formatFilesize(s.disk_usage.used))+" "),r("br"),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Free"))+": "+s._s(s.formatFilesize(s.disk_usage.free))+" "),r("br"),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Total"))+": "+s._s(s.formatFilesize(s.disk_usage.total))+" ")])])]:s._e()],2)],1)],1),r(E),s.showMissingConfigRootWarning?r(q,[r(S,[r(_,{staticClass:"col-12 col-lg pr-lg-0"},[r(dt,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:s.mdiLockOutline}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.ConfigRootDirectoryDoesntExists"))+" ")])],1)],1)],1):r(Ns,{staticClass:"files-table",attrs:{items:s.files,headers:s.headers,page:s.currentPage,"custom-sort":s.sortFiles,"sort-by":s.sortBy,"sort-desc":s.sortDesc,"items-per-page":s.countPerPage,"footer-props":{itemsPerPageText:s.$t("Machine.ConfigFilesPanel.Files"),itemsPerPageAllText:s.$t("Machine.ConfigFilesPanel.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"mobile-breakpoint":"0","item-key":"filename","show-select":""},on:{"update:page":function(i){s.currentPage=i},"update:sortBy":function(i){s.sortBy=i},"update:sort-by":function(i){s.sortBy=i},"update:sortDesc":function(i){s.sortDesc=i},"update:sort-desc":function(i){s.sortDesc=i},"update:itemsPerPage":function(i){s.countPerPage=i},"update:items-per-page":function(i){s.countPerPage=i}},scopedSlots:s._u([{key:"no-data",fn:function(){return[r("div",{staticClass:"text-center"},[s._v(s._s(s.$t("Machine.ConfigFilesPanel.Empty")))])]},proxy:!0},{key:"item",fn:function(i){var n=i.index,a=i.item,o=i.isSelected,l=i.select;return[r("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(c){return s.showContextMenu(c,a)},expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(n," ").concat(a.filename),staticClass:"file-list-cursor user-select-none",attrs:{"data-name":a.filename,draggable:"true"},on:{contextmenu:function(c){return s.showContextMenu(c,a)},click:function(c){return s.clickRow(a)},drag:function(c){return s.dragFile(c,a)},dragend:function(c){return s.dragendFile(c)},dragover:function(c){return s.dragOverFilelist(c,a)},dragleave:s.dragLeaveFilelist,drop:function(c){return c.preventDefault(),c.stopPropagation(),s.dragDropFilelist(c,a)}}},[r("td",{staticClass:"file-list__select-td pr-0"},[r(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:o},on:{click:function(c){return c.stopPropagation(),l(!o)}}})],1),r("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[a.isDirectory?r(v,[s._v(s._s(s.mdiFolder))]):s._e(),a.isDirectory?s._e():r(v,[s._v(s._s(s.mdiFile))])],1),r("td",{staticClass:""},[s._v(s._s(a.filename))]),r("td",{staticClass:"text-no-wrap text-right"},[s._v(" "+s._s(a.isDirectory?"--":s.formatFilesize(a.size))+" ")]),r("td",{staticClass:"text-right"},[s._v(s._s(s.formatDateTime(a.modified)))])])]}}],null,!1,1962952882),model:{value:s.selectedFiles,callback:function(i){s.selectedFiles=i},expression:"selectedFiles"}},[s.currentPath!==""?r("template",{slot:"body.prepend"},[r("tr",{staticClass:"file-list-cursor",on:{click:s.clickRowGoBack,dragover:function(i){return s.dragOverFilelist(i,{isDirectory:!0,filename:".."})},dragleave:s.dragLeaveFilelist,drop:function(i){return i.preventDefault(),i.stopPropagation(),s.dragDropFilelist(i,{isDirectory:!0,filename:".."})}}},[r("td",{staticClass:"file-list__select-td pr-0"},[r(ai,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{disabled:""}})],1),r("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[r(v,[s._v(s._s(s.mdiFolderUpload))])],1),r("td",{staticClass:"",attrs:{colspan:"4"}},[s._v("..")])])]):s._e()],2)],1),r($e,{attrs:{"position-x":s.contextMenu.x,"position-y":s.contextMenu.y,absolute:"","offset-y":""},model:{value:s.contextMenu.shown,callback:function(i){s.$set(s.contextMenu,"shown",i)},expression:"contextMenu.shown"}},[r(Oe,[s.contextMenu.item.isDirectory?s._e():r(K,{on:{click:function(i){return s.clickRow(s.contextMenu.item,!0)}}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiFileDocumentEditOutline))]),s._v(" "+s._s(s.contextMenu.item.permissions.includes("w")?s.$t("Machine.ConfigFilesPanel.EditFile"):s.$t("Machine.ConfigFilesPanel.ShowFile"))+" ")],1),s.contextMenu.item.isDirectory?s._e():r(K,{on:{click:s.downloadFile}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiCloudDownload))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Download"))+" ")],1),!s.contextMenu.item.isDirectory&&s.contextMenu.item.permissions.includes("w")?r(K,{on:{click:function(i){return s.renameFile(s.contextMenu.item)}}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiRenameBox))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Rename"))+" ")],1):s._e(),s.contextMenu.item.isDirectory?s._e():r(K,{on:{click:function(i){return s.duplicateFile(s.contextMenu.item)}}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiContentCopy))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Duplicate"))+" ")],1),s.contextMenu.item.isDirectory&&s.contextMenu.item.permissions.includes("w")?r(K,{on:{click:function(i){return s.renameDirectory(s.contextMenu.item)}}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiRenameBox))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Rename"))+" ")],1):s._e(),!s.contextMenu.item.isDirectory&&s.contextMenu.item.permissions.includes("w")?r(K,{staticClass:"red--text",on:{click:function(i){s.deleteDialog=!0}}},[r(v,{staticClass:"mr-1",attrs:{color:"error"}},[s._v(s._s(s.mdiDelete))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Delete"))+" ")],1):s._e(),s.contextMenu.item.isDirectory&&s.contextMenu.item.permissions.includes("w")?r(K,{staticClass:"red--text",on:{click:function(i){return s.deleteDirectory(s.contextMenu.item)}}},[r(v,{staticClass:"mr-1",attrs:{color:"error"}},[s._v(s._s(s.mdiDelete))]),s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Delete"))+" ")],1):s._e()],1)],1),r(oe,{staticClass:"fill-height",attrs:{"hide-overlay":"",fullscreen:""},on:{keydown:function(i){if(!i.type.indexOf("key")&&s._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;s.dialogImage.show=!1,s.dialogImage.item.url=null,s.dialogImage.item.svg=null}},model:{value:s.dialogImage.show,callback:function(i){s.$set(s.dialogImage,"show",i)},expression:"dialogImage.show"}},[r(Z,{staticStyle:{position:"relative"},attrs:{title:(e=s.dialogImage.item.name)!==null&&e!==void 0?e:"","card-class":"maschine-configfiles-imageviewer-dialog"},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogImage.show=!1,s.dialogImage.item.url=null,s.dialogImage.item.svg=null}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r("div",{staticClass:"d-flex justify-center",staticStyle:{"max-height":"calc(var(--app-height) - 64px)",overflow:"auto"}},[s.dialogImage.item.url?r("img",{staticStyle:{"max-height":"100%",width:"auto"},attrs:{src:s.dialogImage.item.url,alt:"image"}}):s.dialogImage.item.svg?r("div",{staticClass:"fill-width",domProps:{innerHTML:s._s(s.dialogImage.item.svg)}}):s._e()])])],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogCreateFile.show,callback:function(i){s.$set(s.dialogCreateFile,"show",i)},expression:"dialogCreateFile.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.CreateFile"),"card-class":"maschine-configfiles-create-file-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogCreateFile.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r(re,{ref:"inputDialogCreateFileName",attrs:{label:s.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:s.nameInputRules},on:{"update:error":function(i){return s.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.createFileAction.apply(null,arguments)}},model:{value:s.dialogCreateFile.name,callback:function(i){s.$set(s.dialogCreateFile,"name",i)},expression:"dialogCreateFile.name"}})],1),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogCreateFile.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{disabled:s.isInvalidName,color:"primary",text:""},on:{click:s.createFileAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Create"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogRenameFile.show,callback:function(i){s.$set(s.dialogRenameFile,"show",i)},expression:"dialogRenameFile.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.RenameFile"),"card-class":"maschine-configfiles-rename-file-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogRenameFile.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r(re,{ref:"inputDialogRenameFileName",attrs:{label:s.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:s.nameInputRules},on:{"update:error":function(i){return s.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.renameFileAction.apply(null,arguments)}},model:{value:s.dialogRenameFile.newName,callback:function(i){s.$set(s.dialogRenameFile,"newName",i)},expression:"dialogRenameFile.newName"}})],1),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogRenameFile.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{disabled:s.isInvalidName,color:"primary",text:""},on:{click:s.renameFileAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Rename"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogDuplicateFile.show,callback:function(i){s.$set(s.dialogDuplicateFile,"show",i)},expression:"dialogDuplicateFile.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.DuplicateFile"),"card-class":"maschine-configfiles-duplicate-file-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogDuplicateFile.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r(re,{ref:"inputDialoDuplicateFileName",attrs:{label:s.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:s.nameInputRules},on:{"update:error":function(i){return s.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.duplicateFileAction.apply(null,arguments)}},model:{value:s.dialogDuplicateFile.newName,callback:function(i){s.$set(s.dialogDuplicateFile,"newName",i)},expression:"dialogDuplicateFile.newName"}})],1),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogDuplicateFile.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{disabled:s.isInvalidName,color:"primary",text:""},on:{click:s.duplicateFileAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Duplicate"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogCreateDirectory.show,callback:function(i){s.$set(s.dialogCreateDirectory,"show",i)},expression:"dialogCreateDirectory.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.CreateDirectory"),"card-class":"maschine-configfiles-create-directory-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogCreateDirectory.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r(re,{ref:"inputDialogCreateDirectoryName",attrs:{label:s.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:s.nameInputRules},on:{"update:error":function(i){return s.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.createDirectoryAction.apply(null,arguments)}},model:{value:s.dialogCreateDirectory.name,callback:function(i){s.$set(s.dialogCreateDirectory,"name",i)},expression:"dialogCreateDirectory.name"}})],1),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogCreateDirectory.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{disabled:s.isInvalidName,color:"primary",text:""},on:{click:s.createDirectoryAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Create"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogRenameDirectory.show,callback:function(i){s.$set(s.dialogRenameDirectory,"show",i)},expression:"dialogRenameDirectory.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.RenameDirectory"),"card-class":"maschine-configfiles-rename-directory-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogRenameDirectory.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r(re,{ref:"inputDialogRenameDirectoryName",attrs:{label:s.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:s.nameInputRules},on:{"update:error":function(i){return s.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.renameDirectoryAction.apply(null,arguments)}},model:{value:s.dialogRenameDirectory.newName,callback:function(i){s.$set(s.dialogRenameDirectory,"newName",i)},expression:"dialogRenameDirectory.newName"}})],1),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogRenameDirectory.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{disabled:s.isInvalidName,color:"primary",text:""},on:{click:s.renameDirectoryAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Rename"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.dialogDeleteDirectory.show,callback:function(i){s.$set(s.dialogDeleteDirectory,"show",i)},expression:"dialogDeleteDirectory.show"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.DeleteDirectory"),"card-class":"maschine-configfiles-delete-directory-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.dialogDeleteDirectory.show=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r("p",{staticClass:"mb-0"},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.DeleteDirectoryQuestion",{name:s.dialogDeleteDirectory.item.filename}))+" ")])]),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.dialogDeleteDirectory.show=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{color:"error",text:""},on:{click:s.deleteDirectoryAction}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.deleteDialog,callback:function(i){s.deleteDialog=i},expression:"deleteDialog"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.Delete"),"card-class":"maschine-configfiles-delete-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.deleteDialog=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[r("p",{staticClass:"mb-0"},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.DeleteSingleFileQuestion",{name:s.contextMenu.item.filename}))+" ")])]),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.deleteDialog=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{color:"error",text:""},on:{click:s.removeFile}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),r(oe,{attrs:{"max-width":"400"},model:{value:s.deleteSelectedDialog,callback:function(i){s.deleteSelectedDialog=i},expression:"deleteSelectedDialog"}},[r(Z,{attrs:{title:s.$t("Machine.ConfigFilesPanel.Delete"),"card-class":"maschine-configfiles-delete-selected-dialog","margin-bottom":!1},scopedSlots:s._u([{key:"buttons",fn:function(){return[r(g,{attrs:{icon:"",tile:""},on:{click:function(i){s.deleteSelectedDialog=!1}}},[r(v,[s._v(s._s(s.mdiCloseThick))])],1)]},proxy:!0}])},[r(q,[s.selectedFiles.length===1?r("p",{staticClass:"mb-0"},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.DeleteSingleFileQuestion",{name:s.selectedFiles[0].filename}))+" ")]):r("p",{staticClass:"mb-0"},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.DeleteSelectedQuestion",{count:s.selectedFiles.length}))+" ")])]),r(ne,[r(le),r(g,{attrs:{color:"",text:""},on:{click:function(i){s.deleteSelectedDialog=!1}}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),r(g,{attrs:{color:"error",text:""},on:{click:s.deleteSelectedFiles}},[s._v(" "+s._s(s.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),r(oi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:s._u([{key:"action",fn:function(i){var n=i.attrs;return[r(g,s._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:s.cancelUpload}},"v-btn",n,!1),[r(v,{staticClass:"0"},[s._v(s._s(s.mdiClose))])],1)]}}]),model:{value:s.uploadSnackbar.status,callback:function(i){s.$set(s.uploadSnackbar,"status",i)},expression:"uploadSnackbar.status"}},[s.uploadSnackbar.max>1?r("span",{staticClass:"mr-1"},[s._v(" ("+s._s(s.uploadSnackbar.number)+"/"+s._s(s.uploadSnackbar.max)+") ")]):s._e(),r("strong",[s._v(s._s(s.$t("Machine.ConfigFilesPanel.Uploading"))+" "+s._s(s.uploadSnackbar.filename))]),r("br"),s._v(" "+s._s(Math.round(s.uploadSnackbar.percent))+" % @ "+s._s(s.formatFilesize(Math.round(s.uploadSnackbar.speed)))+"/s "),r("br"),r(bs,{staticClass:"mt-2",attrs:{value:s.uploadSnackbar.percent}})],1)],1)},gV=[];const Sv={};var vV=N(nh,fV,gV,!1,_V,null,null,null);function _V(e){for(let s in Sv)this[s]=Sv[s]}const H2=function(){return vV.exports}();var bV=Object.defineProperty,yV=Object.getOwnPropertyDescriptor,CV=(e,s,t,r)=>{for(var i=r>1?void 0:r?yV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&bV(s,t,i),i};let ah=class extends j(V){constructor(){super(...arguments),this.formatFilesize=it,this.mdiCloseThick=Ce,this.mdiTextBoxSearchOutline=g0,this.hostDetailsDialog=!1}get hostStats(){var e;return(e=this.$store.getters["server/getHostStats"])!=null?e:null}get systemInfo(){var e,s;return(s=(e=this.$store.state.server)==null?void 0:e.system_info)!=null?s:{}}get releaseName(){var s,t,r,i;let e=(t=(s=this.hostStats.release_info)==null?void 0:s.name)!=null?t:"";return e.startsWith("#")?(i=(r=this.hostStats.release_info)==null?void 0:r.id)!=null?i:null:e.startsWith("0.")?null:e}get directory(){return this.$store.getters["files/getDirectory"]("gcodes")}get disk_usage(){var e,s;return(s=(e=this.directory)==null?void 0:e.disk_usage)!=null?s:{used:0,free:0,total:0}}get cpuUsage(){var e;return(e=this.$store.getters["server/getCpuUsage"])!=null?e:null}get cpuUsageColor(){let e="primary";return this.cpuUsage>95?e="error":this.cpuUsage>80&&(e="warning"),e}get networkInterfaces(){var e;return(e=this.$store.getters["server/getNetworkInterfaces"])!=null?e:null}getIpAddress(e){const s=e.find(r=>r.family==="ipv4");if(s)return" (".concat(s.address,")");const t=e.find(r=>r.family==="ipv6");return t?" (".concat(t.address,")"):null}get cpuDesc(){return this.hostStats.cpuDesc}get cpuName(){let e=this.hostStats.cpuName;return this.hostStats.bits&&(e+=", ".concat(this.hostStats.bits)),e}};ah=CV([O({components:{Panel:Z}})],ah);var $V=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{staticClass:"py-0 pr-4"},[t(_,{staticClass:"pl-6"},[t("strong",{staticStyle:{cursor:"pointer"},on:{click:function(r){e.hostDetailsDialog=!0}}},[e._v("Host")]),t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[e.hostStats.cpuName?t("small",e._g(e._b({staticClass:"ml-2"},"small",n,!1),i),[e._v("("+e._s(e.cpuName)+")")]):e._e()]}}])},[t("span",[e._v(e._s(e.cpuDesc))])]),t("br"),t("div",{staticClass:"text-body-2"},[e.hostStats.version?t("div",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Version",{version:e.hostStats.version}))+" ")]):e._e(),e.hostStats.os?t("div",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Os",{os:e.hostStats.os}))+" ")]):e._e(),e.releaseName?t("div",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Distro",{name:e.releaseName,version_id:e.hostStats.release_info.version_id}))+" "),e.hostStats.release_info.codename?[e._v(" ("+e._s(e.hostStats.release_info.codename)+") ")]:e._e()],2):e._e(),t("div",[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Load",{load:e.hostStats.load}))+", ")]),e.hostStats.memoryFormat?t("span",{staticClass:"d-inline-block text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Memory",{memory:e.hostStats.memoryFormat}))+", ")]):e._e(),t("span",{staticClass:"text-no-wrap"},[e.hostStats.tempSensor?[e.hostStats.tempSensor.measured_min_temp!==null&&e.hostStats.tempSensor.measured_max_temp!==null?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({},"span",n,!1),i),[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.hostStats.tempSensor.temperature}))+" ")])]}}],null,!1,2482253800)},[t("span",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMax",{temp:e.hostStats.tempSensor.measured_max_temp}))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMin",{temp:e.hostStats.tempSensor.measured_min_temp}))+" ")])])]:t("span",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.hostStats.tempSensor.temperature}))+" ")])]:e._e()],2)]),e.networkInterfaces?e._l(e.networkInterfaces,function(r,i){return t("div",{key:i},[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(i)+" "),"details"in r?[e._v(" "+e._s(e.getIpAddress(r.details.ip_addresses))+" ")]:e._e(),e._v(" : ")],2),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Bandwidth",{bandwidth:e.formatFilesize(r.bandwidth)}))+" ")]),e._v(" , "),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Received",{received:e.formatFilesize(r.rx_bytes)}))+" ")]),e._v(" , "),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Transmitted",{transmitted:e.formatFilesize(r.tx_bytes)}))+" ")])])}):e._e()],2)],1),e.cpuUsage!==null?t(_,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(at,{attrs:{rotate:-90,size:55,width:7,value:e.cpuUsage,color:e.cpuUsageColor}},[e._v(" "+e._s(e.cpuUsage)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Cpu")))])],1):t(_,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(at,{attrs:{rotate:-90,size:55,width:7,value:e.hostStats.loadPercent,color:e.hostStats.loadProgressColor}},[e._v(" "+e._s(e.hostStats.loadPercent)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Load")))])],1),e.hostStats.memUsage!==null?t(_,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(at,{attrs:{rotate:-90,size:55,width:7,value:e.hostStats.memUsage,color:e.hostStats.memUsageColor}},[e._v(" "+e._s(e.hostStats.memUsage)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Memory")))])],1):e._e()],1),t(oe,{attrs:{"max-width":600,"max-height":500,scrollable:""},model:{value:e.hostDetailsDialog,callback:function(r){e.hostDetailsDialog=r},expression:"hostDetailsDialog"}},[t(Z,{attrs:{title:e.$t("Machine.SystemPanel.HostDetails"),icon:e.mdiTextBoxSearchOutline,"card-class":"machine-systemload-host-details-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.hostDetailsDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-5 px-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[Object.keys(e.systemInfo).length?e._l(e.systemInfo,function(r,i,n){return t("div",{key:i},[i!=="available_services"?[t(S,{class:n?"mt-5":""},[t(_,[t("span",{staticClass:"headline"},[e._v(e._s(i))])])],1),e._l(r,function(a,o,l){return t("div",{key:o},[l?t(E,{staticClass:"my-3"}):e._e(),t(S,[t(_,[e._v(e._s(o))]),t(_,{staticClass:"text-right"},[e._v(e._s(a))])],1)],1)})]:e._e()],2)}):[t(S,{staticClass:"mt-5"},[t(_,[t("p",[e._v(e._s(e.$t("Machine.SystemPanel.NoMoreInfos")))])])],1)]],2)],1)],1)],1)],1)},xV=[];const Pv={};var wV=N(ah,$V,xV,!1,SV,"d23ebeea",null,null);function SV(e){for(let s in Pv)this[s]=Pv[s]}const j2=function(){return wV.exports}();var PV=Object.defineProperty,TV=Object.getOwnPropertyDescriptor,N2=(e,s,t,r)=>{for(var i=r>1?void 0:r?TV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&PV(s,t,i),i};let nl=class extends j(V){constructor(){super(...arguments),this.formatFilesize=it,this.mdiCloseThick=Ce,this.mcuDetailsDialog=!1}};N2([k({required:!0})],nl.prototype,"mcu",2);nl=N2([O({components:{Panel:Z}})],nl);var DV=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(S,{staticClass:"py-0 pr-4"},[t(_,{staticClass:"pl-6"},[t("strong",{staticStyle:{cursor:"pointer"},on:{click:function(r){e.mcuDetailsDialog=!0}}},[e._v(e._s(e.mcu.name))]),e.mcu.chip?t("small",{staticClass:"ml-2"},[e._v("("+e._s(e.mcu.chip)+")")]):e._e(),t("br"),t("div",{staticClass:"text-body-2"},[t("div",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Version",{version:e.mcu.version}))+" ")]),t("div",[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Load",{load:e.mcu.load}))+", ")]),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Awake",{awake:e.mcu.awake}))+", ")]),e.mcu.freq!==null?t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Frequency",{frequency:e.mcu.freqFormat}))+", ")]):e._e(),e.mcu.tempSensor?[e.mcu.tempSensor.measured_min_temp!==null&&e.mcu.tempSensor.measured_max_temp!==null?[t(pe,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("span",e._g(e._b({},"span",n,!1),i),[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.mcu.tempSensor.temperature}))+" ")])]}}],null,!1,1093946258)},[t("span",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMax",{temp:e.mcu.tempSensor.measured_max_temp}))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMin",{temp:e.mcu.tempSensor.measured_min_temp}))+" ")])])]:t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.mcu.tempSensor.temperature}))+" ")])]:e._e()],2)])]),t(_,{staticClass:"px-2 col-auto d-flex justify-center align-center"},[t(at,{attrs:{rotate:-90,size:55,width:7,value:e.mcu.loadPercent,color:e.mcu.loadProgressColor}},[e._v(" "+e._s(e.mcu.loadPercent)+" ")])],1)],1),t(oe,{attrs:{"max-width":400,"max-height":500,scrollable:""},model:{value:e.mcuDetailsDialog,callback:function(r){e.mcuDetailsDialog=r},expression:"mcuDetailsDialog"}},[t(Z,{attrs:{title:e.mcu.name,icon:"mdi-text-box-search-outline","card-class":"machine-systemload-mcu-details-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.mcuDetailsDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-5 px-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[e.mcu.mcu_constants?[t(S,[t(_,[t("span",{staticClass:"headline"},[e._v(e._s(e.$t("Machine.SystemPanel.Constants")))])])],1),e._l(e.mcu.mcu_constants,function(r,i,n){return t("div",{key:i},[n?t(E,{staticClass:"my-3"}):e._e(),t(S,[t(_,[e._v(e._s(i))]),t(_,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e(),e.mcu.last_stats?[t(S,{staticClass:"mt-5"},[t(_,[t("span",{staticClass:"headline"},[e._v(e._s(e.$t("Machine.SystemPanel.LastStats")))])])],1),e._l(e.mcu.last_stats,function(r,i,n){return t("div",{key:i},[n?t(E,{staticClass:"my-3"}):e._e(),t(S,[t(_,[e._v(e._s(i))]),t(_,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e()],2)],1)],1)],1)],1)},MV=[];const Tv={};var EV=N(nl,DV,MV,!1,OV,null,null,null);function OV(e){for(let s in Tv)this[s]=Tv[s]}const V2=function(){return EV.exports}();var LV=Object.defineProperty,kV=Object.getOwnPropertyDescriptor,AV=(e,s,t,r)=>{for(var i=r>1?void 0:r?kV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&LV(s,t,i),i};let oh=class extends j(V){constructor(){super(...arguments),this.mdiCloseThick=Ce,this.mdiMemory=r0}get mcus(){var s;const e=(s=this.$store.getters["printer/getMcus"])!=null?s:[];return $t(e,"name")}get hostStats(){var e;return(e=this.$store.getters["server/getHostStats"])!=null?e:null}};oh=AV([O({components:{SystemPanelMcu:V2,SystemPanelHost:j2,Panel:Z}})],oh);var FV=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Z,{attrs:{title:e.$t("Machine.SystemPanel.SystemLoad"),icon:e.mdiMemory,"card-class":"machine-systemload-panel",collapsible:!0}},[t(q,{staticClass:"px-0 py-2"},[e._l(e.mcus,function(r,i){return t("div",{key:r.name},[i?t(E,{staticClass:"my-2"}):e._e(),t(V2,{attrs:{mcu:r}})],1)}),e.hostStats?t("div",[e.mcus.length?t(E,{staticClass:"my-2"}):e._e(),t(j2)],1):e._e()],2)],1)},RV=[];const Dv={};var IV=N(oh,FV,RV,!1,HV,"0449534b",null,null);function HV(e){for(let s in Dv)this[s]=Dv[s]}const U2=function(){return IV.exports}();var jV=Object.defineProperty,NV=Object.getOwnPropertyDescriptor,VV=(e,s,t,r)=>{for(var i=r>1?void 0:r?NV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&jV(s,t,i),i};let lh=class extends j(V){};lh=VV([O({components:{SystemPanel:U2,ConfigFilesPanel:H2,EndstopPanel:v2,LogfilesPanel:g2,UpdatePanel:m2,KlippyStatePanel:ma}})],lh);var UV=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ke,{attrs:{fluid:"","py-0":"","px-0":""}},[t(S,[t(_,{staticClass:"col-12 col-md-6 pb-0 pb-md-3"},[t(H2)],1),t(_,{staticClass:"col-12 col-md-6 pt-0 pt-md-3"},[t(ma),t(U2),t(m2),t(S,[e.klipperState==="ready"?t(_,{staticClass:"col-12 col-sm-6 pb-0 pb-md-3"},[t(v2)],1):e._e(),t(_,{class:e.klipperState!=="ready"?"col-12":"col-12 col-sm-6 pt-0 pt-sm-3"},[t(g2)],1)],1)],1)],1)],1)},BV=[];const Mv={};var WV=N(lh,UV,BV,!1,GV,null,null,null);function GV(e){for(let s in Mv)this[s]=Mv[s]}const zV=function(){return WV.exports}(),B2=[{title:"Dashboard",path:"/",icon:Pp,component:aF,alwaysShow:!0,showInNavi:!0,position:10},{title:"Printers",path:"/allPrinters",component:DF,alwaysShow:!1,showInNavi:!1},{title:"Webcam",path:"/cam",icon:ji,component:mF,alwaysShow:!0,showInNavi:!0,position:20},{title:"Console",path:"/console",icon:ua,component:FF,alwaysShow:!0,showInNavi:!0,klipperIsConnected:!0,position:30},{title:"Heightmap",path:"/heightmap",icon:ql,component:()=>he(()=>import("./Heightmap-7418030f.js"),["assets/Heightmap-7418030f.js","assets/echarts-9bc570b0.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/Heightmap-0ea0fb44.css"]),alwaysShow:!1,showInNavi:!0,klipperComponent:"bed_mesh",position:40},{title:"G-Code Files",path:"/files",icon:Zl,component:B9,alwaysShow:!0,showInNavi:!0,registeredDirectory:"gcodes",position:50},{title:"G-Code Viewer",path:"/viewer",icon:ec,component:()=>he(()=>import("./Viewer-8db94310.js"),["assets/Viewer-8db94310.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/codemirror-0a1db0c7.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js","assets/Viewer-3e5b07dd.css"]),alwaysShow:!0,showInNavi:!0,position:60},{title:"History",path:"/history",icon:hP,component:I7,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"history",position:70},{title:"Timelapse",path:"/timelapse",icon:_0,component:n8,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"timelapse",position:80},{title:"Machine",path:"/config",icon:KP,component:zV,alwaysShow:!0,showInNavi:!0,position:90},{title:null,component:null,alwaysShow:!1,showInNavi:!1,path:"/settings/machine",redirect:"/config"}];var ZV=Object.defineProperty,qV=Object.getOwnPropertyDescriptor,W2=(e,s,t,r)=>{for(var i=r>1?void 0:r?qV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&ZV(s,t,i),i};let wi=class extends j(V){constructor(){super(...arguments),this.customNaviLinks=[]}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get routesNaviPoints(){const e=[];return this.countPrinters&&e.push({title:this.$t("App.Printers"),icon:YP,to:"/allPrinters",position:0,visible:!0}),B2.filter(s=>s.showInNavi&&this.showInNavi(s)).forEach(s=>{var i,n;const[t,r]=this.getUiSettings({type:"route",title:(i=s.title)!=null?i:"unknown",visible:!0,position:(n=s.position)!=null?n:999});e.push({type:"route",title:this.$t("Router.".concat(s.title)),orgTitle:s.title,icon:s.icon,to:s.path,position:t,visible:r})}),this.customNaviLinks.length&&this.customNaviLinks.forEach(s=>{var i,n,a;const[t,r]=this.getUiSettings({type:"link",title:(i=s.title)!=null?i:"unknown",visible:(n=s.visible)!=null?n:!0,position:(a=s.position)!=null?a:999});e.push({type:"link",title:s.title,icon:s.icon,href:s.href,target:s.target,position:t,visible:r})}),e}get naviPoints(){return this.routesNaviPoints.sort((e,s)=>e.position-s.position)}get visibleNaviPoints(){return this.naviPoints.filter(e=>e.visible)}get uiSettings(){return this.$store.state.gui.navigation.entries}get klippy_state(){return this.$store.state.server.klippy_state}get boolNaviWebcam(){return this.$store.state.gui.uiSettings.boolWebcamNavi}get moonrakerComponents(){return this.$store.state.server.components}get registeredDirectories(){return this.$store.state.server.registered_directories}get klipperConfigfileSettings(){var e,s;return(s=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)!=null?s:{}}get sidebarNaviFile(){return this.$store.getters["files/getCustomNaviPoints"]}get webcamCount(){return this.$store.getters["gui/webcams/getWebcams"].length}async sidebarNaviFileChanged(e){if(this.customNaviLinks=[],!e)return;(await fetch(e).then(t=>t.json()).catch(t=>{throw window.console.error("Unable to parse .theme/navi.json."),t})).forEach(t=>{var r,i,n,a,o;this.customNaviLinks.push({title:(r=t.title)!=null?r:"Unknown",icon:(i=t.icon)!=null?i:t0,href:(n=t.href)!=null?n:"#",target:(a=t.target)!=null?a:void 0,position:(o=t.position)!=null?o:999})})}showInNavi(e){return["shutdown","error","disconnected"].includes(this.klippy_state)&&!e.alwaysShow||e.title==="Webcam"&&this.webcamCount===0||e.moonrakerComponent&&!this.moonrakerComponents.includes(e.moonrakerComponent)||e.registeredDirectory&&!this.registeredDirectories.includes(e.registeredDirectory)||e.klipperComponent&&!(e.klipperComponent in this.klipperConfigfileSettings)?!1:!(e.klipperIsConnected&&!this.klippyIsConnected)}getUiSettings(e){const s=this.uiSettings.findIndex(t=>t.title===e.title&&t.type===e.type);return s===-1?[e.position,e.visible]:[this.uiSettings[s].position,this.uiSettings[s].visible]}};W2([me("sidebarNaviFile",{immediate:!0})],wi.prototype,"sidebarNaviFileChanged",1);wi=W2([O],wi);var XV=Object.defineProperty,YV=Object.getOwnPropertyDescriptor,JV=(e,s,t,r)=>{for(var i=r>1?void 0:r?YV(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&XV(s,t,i),i};let ch=class extends j(wi,V,kt){constructor(){super(...arguments),this.navigationWidth=bS,this.topbarHeight=fn}get naviDrawer(){return this.$store.state.naviDrawer}set naviDrawer(e){this.$store.dispatch("setNaviDrawer",e)}get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get sidebarBackground(){var e;return(e=this.$store.getters["files/getCustomSidebarBackground"])!=null?e:this.sidebarBgImage}get currentPage(){return this.$route.fullPath}get boolNaviTemp(){return!this.isMobile&&this.$vuetify.breakpoint.mdAndDown}get sidebarCssVars(){return this.boolNaviTemp?{top:"".concat(fn,"px !important"),"padding-bottom":"".concat(fn,"px")}:{}}get sidebarLogo(){return this.$store.getters["files/getSidebarLogo"]}get logoColor(){return this.$store.state.gui.uiSettings.logo}get printerName(){return this.$store.state.gui.general.printername.length?this.$store.state.gui.general.printername:this.$store.state.printer.hostname}get logoCssVars(){return this.navigationStyle!=="iconsOnly"?{"margin-right":"16px"}:{}}get mobileLogoClass(){const e=["sidebar-logo","no-text-decoration","no-background","no-border"];return this.navigationStyle==="iconsOnly"&&(e.push("pa-0"),e.push("justify-center")),e}};ch=JV([O({components:{SidebarItem:x0,TheSelectPrinterDialog:Op,AboutDialog:C0,MainsailLogo:Ni}})],ch);var KV=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(ew,{key:e.navigationStyle,style:e.sidebarCssVars,attrs:{"mini-variant":e.navigationStyle==="iconsOnly",width:e.navigationWidth,temporary:e.boolNaviTemp,clipped:"",app:""},scopedSlots:e._u([{key:"img",fn:function(){return[t(Vl,{attrs:{src:e.sidebarBackground,height:"100%"}})]},proxy:!0},{key:"append",fn:function(){return[t(K,{staticClass:"small-list-item mb-2"},[t(Rs,{staticClass:"menu-item-icon"},[t(C0)],1)],1)]},proxy:!0}]),model:{value:e.naviDrawer,callback:function(r){e.naviDrawer=r},expression:"naviDrawer"}},[t("overlay-scrollbars",{staticClass:"nav-scrollbar"},[t(Oe,{staticClass:"pr-0 pt-0 ml-0"},[t(tw,{attrs:{"active-class":"active-nav-item"}},[e.isMobile?t(K,{class:e.mobileLogoClass,style:"height: "+e.topbarHeight+"px",attrs:{router:"",to:"/",ripple:!1}},[e.sidebarLogo?[t("img",{staticClass:"nav-logo",style:e.logoCssVars,attrs:{src:e.sidebarLogo,alt:"Logo"}})]:[t(Ni,{staticClass:"nav-logo",style:e.logoCssVars,attrs:{color:e.logoColor,ripple:!1}})],e.navigationStyle!=="iconsOnly"?[t("span",{staticClass:"text-h6 font-weight-regular text-truncate"},[e._v(e._s(e.printerName))])]:e._e()],2):e._e(),e._l(e.visibleNaviPoints,function(r,i){return t(x0,{key:i,attrs:{item:r}})})],2)],1)],1)],1)},QV=[];const Ev={};var eU=N(ch,KV,QV,!1,tU,"1a6ff80c",null,null);function tU(e){for(let s in Ev)this[s]=Ev[s]}const G2=function(){return eU.exports}();var sU=Object.defineProperty,rU=Object.getOwnPropertyDescriptor,iU=(e,s,t,r)=>{for(var i=r>1?void 0:r?rU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&sU(s,t,i),i};let uh=class extends j(V){constructor(){super(...arguments),this.mdiAlert=DS,this.mdiCloseThick=Ce,this.mdiPowerStandby=DP,this.mdiRestart=jr,this.mdiPlay=Ii,this.mdiPower=o0,this.mdiStop=m0,this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOff=GP,this.showMenu=!1,this.dialogPowerDeviceChange={show:!1,device:"",value:""},this.dialogConfirmation={show:!1,serviceName:null,executableFunction:null,title:"",description:"",actionButtonText:""}}get services(){var s,t,r;const e=(r=(t=(s=this.$store.state.server.system_info)==null?void 0:s.available_services)==null?void 0:t.filter(i=>i!=="klipper_mcu"))!=null?r:[];return e.sort(),e}get powerDevices(){var s;return((s=this.$store.getters["server/power/getDevices"])!=null?s:[]).filter(t=>!t.device.startsWith("_"))}get service_states(){var e,s;return(s=(e=this.$store.state.server.system_info)==null?void 0:e.service_state)!=null?s:{}}getServiceState(e){return e in this.service_states?this.service_states[e].active_state:null}getServiceSubState(e){return e in this.service_states?this.service_states[e].sub_state:null}checkDialog(e,s,t){if(this.printerIsPrinting){this.dialogConfirmation.executableFunction=e,this.dialogConfirmation.serviceName=s;const r=t.trim().charAt(0).toUpperCase()+t.trim().slice(1);let i="App.TopCornerMenu.ConfirmationDialog.Title.Service"+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Service"+r,a="App.TopCornerMenu."+r;s==="klipper"&&["stop","restart","firmwareRestart"].includes(t)?(i="App.TopCornerMenu.ConfirmationDialog.Title."+(t!=="stop"?"Klipper":"Service")+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Klipper"+r,t==="firmwareRestart"&&(a="App.TopCornerMenu.KlipperFirmwareRestart")):s==="host"&&(i="App.TopCornerMenu.ConfirmationDialog.Title.Host"+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Host"+r),this.dialogConfirmation.title=this.$t(i).toString(),this.dialogConfirmation.description=this.$t(n).toString(),this.dialogConfirmation.actionButtonText=this.$t(a).toString(),this.dialogConfirmation.show=!0}else e(s)}executeDialog(){this.dialogConfirmation.executableFunction(this.dialogConfirmation.serviceName),this.dialogConfirmation.show=!1}klipperRestart(){this.showMenu=!1,this.$store.dispatch("server/addEvent",{message:"RESTART",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"RESTART"})}klipperFirmwareRestart(){this.showMenu=!1,this.$store.dispatch("server/addEvent",{message:"FIRMWARE_RESTART",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"FIRMWARE_RESTART"})}serviceStart(e){this.showMenu=!1,this.$socket.emit("machine.services.start",{service:e})}serviceRestart(e){this.showMenu=!1,this.$socket.emit("machine.services.restart",{service:e})}serviceStop(e){this.showMenu=!1,this.$socket.emit("machine.services.stop",{service:e})}changeSwitch(e,s){this.dialogPowerDeviceChange.device=e.device,this.dialogPowerDeviceChange.value=s,this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange?this.dialogPowerDeviceChange.show=!0:this.powerDeviceToggle()}powerDeviceToggle(){this.dialogPowerDeviceChange.show=!1;const e=this.dialogPowerDeviceChange.value==="off"?"machine.device_power.on":"machine.device_power.off";this.$socket.emit(e,{[this.dialogPowerDeviceChange.device]:null},{action:"server/power/responseToggle"})}hostReboot(){this.showMenu=!1,this.$socket.emit("machine.reboot",{})}hostShutdown(){this.showMenu=!1,this.$socket.emit("machine.shutdown",{})}};uh=iU([O({components:{Panel:Z}})],uh);var nU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($e,{attrs:{bottom:"",left:"","offset-y":!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiPowerStandby))])],1)]}}]),model:{value:e.showMenu,callback:function(r){e.showMenu=r},expression:"showMenu"}},[t(Oe,{attrs:{dense:""}},[e.klipperState!=="disconnected"?[t(Js,{staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.KlipperControl"))+" ")]),t(K,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperRestart,"klipper","restart")}}},[t(rt,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperRestart")))]),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1)],1),t(K,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperFirmwareRestart,"klipper","firmwareRestart")}}},[t(rt,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperFirmwareRestart")))]),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1)],1)]:e._e(),e.services.length?[e.klipperState!=="disconnected"?t(E,{staticClass:"mt-0"}):e._e(),t(Js,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.ServiceControl"))+" ")]),e._l(e.services,function(r){return t(K,{key:r,staticClass:"minheight30 pr-2"},[t(rt,[t(pe,{attrs:{left:""},scopedSlots:e._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[t("span",e._g(e._b({},"span",a,!1),n),[e._v(" "+e._s(r.charAt(0).toUpperCase()+r.slice(1))+" ")])]}}],null,!0)},[t("span",[e._v(e._s(e.getServiceState(r))+" ("+e._s(e.getServiceSubState(r))+")")])])],1),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[e.getServiceState(r)==="inactive"?t(g,{attrs:{icon:"",small:""},on:{click:function(i){return e.checkDialog(e.serviceStart,r,"start")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiPlay))])],1):t(g,{attrs:{icon:"",small:""},on:{click:function(i){return e.checkDialog(e.serviceRestart,r,"restart")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1),t(g,{style:r==="moonraker"?"visibility: hidden;":"",attrs:{icon:"",small:"",disabled:e.getServiceState(r)==="inactive"||r==="moonraker"},on:{click:function(i){return e.checkDialog(e.serviceStop,r,"stop")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiStop))])],1)],1)],1)})]:e._e(),e.powerDevices.length?[t(E,{staticClass:"mt-0"}),t(Js,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.PowerDevices"))+" ")]),e._l(e.powerDevices,function(r,i){return t(K,{key:i,staticClass:"minheight30 pr-2",attrs:{disabled:r.status==="error"||r.locked_while_printing&&["printing","paused"].includes(e.printer_state)},on:{click:function(n){return e.changeSwitch(r,r.status)}}},[t(rt,[e._v(e._s(r.device))]),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(v,{staticClass:"mr-2",attrs:{color:r.status==="on"?"":"grey darken-2"}},[e._v(" "+e._s(r.status==="on"?e.mdiToggleSwitch:e.mdiToggleSwitchOff)+" ")])],1)],1)})]:e._e(),t(E,{staticClass:"mt-0"}),t(Js,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(e._s(e.$t("App.TopCornerMenu.HostControl")))]),t(K,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostReboot,"host","reboot")}}},[t(rt,[e._v(e._s(e.$t("App.TopCornerMenu.Reboot")))]),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPower))])],1)],1),t(K,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostShutdown,"host","shutdown")}}},[t(rt,[e._v(e._s(e.$t("App.TopCornerMenu.Shutdown")))]),t(Gr,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(v,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPower))])],1)],1)],2)],1),t(oe,{attrs:{width:"400",fullscreen:e.isMobile},model:{value:e.dialogPowerDeviceChange.show,callback:function(r){e.$set(e.dialogPowerDeviceChange,"show",r)},expression:"dialogPowerDeviceChange.show"}},[t(De,[t(vt,{staticClass:"headline"},[e._v(" "+e._s(e.dialogPowerDeviceChange.value==="off"?e.$t("PowerDeviceChangeDialog.TurnDeviceOn",{device:e.dialogPowerDeviceChange.device}):e.$t("PowerDeviceChangeDialog.TurnDeviceOff",{device:e.dialogPowerDeviceChange.device}))+" ")]),t(q,[e._v(e._s(e.$t("PowerDeviceChangeDialog.AreYouSure")))]),t(ne,[t(le),t(g,{attrs:{color:"red darken-1",text:""},on:{click:function(r){e.dialogPowerDeviceChange.show=!1}}},[e._v(" "+e._s(e.$t("PowerDeviceChangeDialog.No"))+" ")]),t(g,{attrs:{color:"green darken-1",text:""},on:{click:e.powerDeviceToggle}},[e._v(" "+e._s(e.$t("PowerDeviceChangeDialog.Yes"))+" ")])],1)],1)],1),t(oe,{attrs:{width:"400",fullscreen:e.isMobile},model:{value:e.dialogConfirmation.show,callback:function(r){e.$set(e.dialogConfirmation,"show",r)},expression:"dialogConfirmation.show"}},[t(Z,{attrs:{"card-class":"confirm-top-corner-menu-dialog",icon:e.mdiAlert,title:e.dialogConfirmation.title,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogConfirmation.show=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-3"},[t(S,[t(_,[t("p",{staticClass:"body-2"},[e._v(e._s(e.dialogConfirmation.description))])])],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:function(r){e.dialogConfirmation.show=!1}}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.Cancel"))+" ")]),t(g,{attrs:{text:"",color:"error"},on:{click:e.executeDialog}},[e._v(" "+e._s(e.dialogConfirmation.actionButtonText)+" ")])],1)],1)],1)],1)},aU=[];const Ov={};var oU=N(uh,nU,aU,!1,lU,"371c81fd",null,null);function lU(e){for(let s in Ov)this[s]=Ov[s]}const z2=function(){return oU.exports}();var cU=Object.defineProperty,uU=Object.getOwnPropertyDescriptor,Em=(e,s,t,r)=>{for(var i=r>1?void 0:r?uU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&cU(s,t,i),i};let Xn=class extends j(V){constructor(){super(...arguments),this.selectedCheckboxes=[],this.selectAllIndeterminate=!1,this.selectAllModel=br({get:this.getSelectAll,set:this.setSelectAll})}getSelectAll(){return this.selectAllIndeterminate=!1,0t.value);return}this.selectedCheckboxes=[]}};Em([k({required:!0})],Xn.prototype,"options",2);Em([k({type:Boolean,required:!1,default:!1})],Xn.prototype,"selectAll",2);Xn=Em([O],Xn);var dU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(_,{staticClass:"pl-6"},[e.selectAll?[t(we,{staticClass:"mt-0",attrs:{label:e.$t("Settings.GeneralTab.Everything"),"hide-details":"",indeterminate:e.selectAllIndeterminate},on:{change:function(r){return e.$emit("update:selectedCheckboxes",e.selectedCheckboxes)}},model:{value:e.selectAllModel,callback:function(r){e.selectAllModel=r},expression:"selectAllModel"}}),t(E,{staticClass:"my-2"})]:e._e(),e._l(e.options,function(r){return[t(we,{key:r.value,staticClass:"mt-0",attrs:{label:r.label,"hide-details":"",value:r.value},on:{change:function(i){return e.$emit("update:selectedCheckboxes",e.selectedCheckboxes)}},model:{value:e.selectedCheckboxes,callback:function(i){e.selectedCheckboxes=i},expression:"selectedCheckboxes"}})]})],2)},hU=[];const Lv={};var pU=N(Xn,dU,hU,!1,mU,null,null,null);function mU(e){for(let s in Lv)this[s]=Lv[s]}const Ur=function(){return pU.exports}();var fU=Object.defineProperty,gU=Object.getOwnPropertyDescriptor,vU=(e,s,t,r)=>{for(var i=r>1?void 0:r?gU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&fU(s,t,i),i};let Si=class extends V{get availableKeys(){return[{value:"general",label:this.$t("Settings.GeneralTab.General")},{value:"control",label:this.$t("Settings.ControlTab.Control")},{value:"dashboard",label:this.$t("Settings.DashboardTab.Dashboard")},{value:"editor",label:this.$t("Settings.EditorTab.Editor")},{value:"gcodeViewer",label:this.$t("Settings.GCodeViewerTab.GCodeViewer")},{value:"navigation",label:this.$t("Settings.GeneralTab.DBNavigation")},{value:"uiSettings",label:this.$t("Settings.UiSettingsTab.UiSettings")},{value:"view",label:this.$t("Settings.GeneralTab.DbView")},{value:"console",label:this.$t("Settings.ConsoleTab.Console")},{value:"gcodehistory",label:this.$t("Settings.GeneralTab.DbConsoleHistory")},{value:"macros",label:this.$t("Settings.MacrosTab.Macros")},{value:"notifications",label:this.$t("App.Notifications.Notifications")},{value:"presets",label:this.$t("Settings.PresetsTab.PreheatPresets")},{value:"remoteprinters",label:this.$t("Settings.RemotePrintersTab.RemotePrinters")},{value:"timelapse",label:this.$t("Settings.TimelapseTab.Timelapse")}]}async loadBackupableNamespaces(){let e=[];const s=this.$store.getters["socket/getUrl"]+"/server/database/list",t=await fetch(s).then(r=>r==null?void 0:r.json()).then(r=>{var i,n;return(n=(i=r==null?void 0:r.result)==null?void 0:i.namespaces)!=null?n:[]}).catch(()=>(window.console.error("Cannot load Moonraker DB namespaces"),[]));if(t.includes("mainsail")){const r=this.$store.getters["socket/getUrl"]+"/server/database/item?namespace=mainsail";e=await fetch(r).then(i=>i==null?void 0:i.json()).then(i=>{var n,a;return(a=(n=i==null?void 0:i.result)==null?void 0:n.value)!=null?a:{}}).then(i=>Object.keys(i)).then(i=>i.filter(n=>n!=="initVersion")).then(i=>i.map(n=>{const a=this.availableKeys.find(o=>o.value===n);return a||{value:n,label:n}})),e=e.sort(this.sortNamespaces)}return t.includes("timelapse")&&e.push({value:"timelapse",label:this.$t("Settings.GeneralTab.DbTimelapseSettings")}),t.includes("webcams")&&e.push({value:"webcams",label:this.$t("Settings.WebcamsTab.Webcams")}),e}sortNamespaces(e,s){if(e.value==="general")return-1;if(s.value==="general")return 1;const t=e.label.toString().toLowerCase(),r=s.label.toString().toLowerCase();return tr?1:0}};Si=vU([O],Si);var _U=Object.defineProperty,bU=Object.getOwnPropertyDescriptor,yU=(e,s,t,r)=>{for(var i=r>1?void 0:r?bU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&_U(s,t,i),i};let dh=class extends j(V,Si){constructor(){super(...arguments),this.mdiHelpCircle=Xl,this.mdiCloseThick=Ce,this.showDialog=!1,this.backupableNamespaces=[],this.backupCheckboxes=[]}async mounted(){this.backupableNamespaces=await this.loadBackupableNamespaces()}onSelectBackupCheckboxes(s){this.backupCheckboxes=s}async backupMainsail(){await this.$store.dispatch("socket/addLoading","backupMainsail"),await this.$store.dispatch("gui/backupMoonrakerDB",this.backupCheckboxes),await this.$store.dispatch("socket/removeLoading","backupMainsail"),this.closeDialog()}async openDialog(){this.backupableNamespaces=await this.loadBackupableNamespaces(),this.showDialog=!0}closeDialog(){this.showDialog=!1}};dh=yU([O({components:{Panel:Z,SettingsRow:U,CheckboxList:Ur}})],dh);var CU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(g,{attrs:{loading:e.loadings.includes("backupDbButton"),small:""},on:{click:e.openDialog}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Backup"))+" ")]),t(oe,{attrs:{persistent:"",width:360},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Settings.GeneralTab.Backup"),"card-class":"mainsail-backup-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.BackupDialog")))])])],1),t(S,[t(Ur,{attrs:{options:e.backupableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectBackupCheckboxes}})],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("backupMainsail")},on:{click:e.backupMainsail}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Backup"))+" ")])],1)],1)],1)],1)],1)],1)},$U=[];const kv={};var xU=N(dh,CU,$U,!1,wU,null,null,null);function wU(e){for(let s in kv)this[s]=kv[s]}const Z2=function(){return xU.exports}();var SU=Object.defineProperty,PU=Object.getOwnPropertyDescriptor,TU=(e,s,t,r)=>{for(var i=r>1?void 0:r?PU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&SU(s,t,i),i};let hh=class extends j(V,Si){constructor(){super(...arguments),this.mdiHelpCircle=Xl,this.mdiCloseThick=Ce,this.showDialog=!1,this.restoreableNamespaces=[],this.restoreCheckboxes=[],this.restoreObjects={}}onSelectRestoreCheckboxes(s){this.restoreCheckboxes=s}async restoreDb(){var s,t;(t=(s=this.$refs)==null?void 0:s.uploadBackupFile)==null||t.click()}uploadRestore(){var r,i,n,a;if(((i=(r=this.$refs.uploadBackupFile.files)==null?void 0:r.length)!=null?i:0)===0){window.console.error("No json uploaded");return}const s=(a=(n=this.$refs)==null?void 0:n.uploadBackupFile)==null?void 0:a.files[0],t=new FileReader;t.readAsText(s,"UTF-8"),t.onload=o=>{var l;this.restoreableNamespaces=[];try{this.restoreObjects=JSON.parse(((l=o==null?void 0:o.target)==null?void 0:l.result)+"");const c=Object.keys(this.restoreObjects);this.restoreableNamespaces=c.map(u=>{const d=this.availableKeys.find(h=>h.value===u);return d||{value:u,label:u}}),this.restoreableNamespaces=this.restoreableNamespaces.sort(this.sortNamespaces),this.openDialog()}catch{y.$toast.error(this.$t("Settings.GeneralTab.CannotReadJson").toString())}},t.onerror=o=>{window.console.error(o)},this.$refs.uploadBackupFile.value=""}openDialog(){this.showDialog=!0}closeDialog(){this.showDialog=!1}restoreDbAction(){this.$store.dispatch("socket/addLoading","restoreDbAction"),this.$store.dispatch("gui/restoreMoonrakerDB",{dbCheckboxes:this.restoreCheckboxes,restoreObjects:this.restoreObjects})}};hh=TU([O({components:{SettingsGeneralTabBackupDatabase:Z2,Panel:Z,SettingsRow:U,CheckboxList:Ur}})],hh);var DU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t("input",{ref:"uploadBackupFile",staticClass:"d-none",attrs:{type:"file",accept:[".json"]},on:{change:e.uploadRestore}}),t(g,{staticClass:"ml-3",attrs:{small:"",loading:e.loadings.includes("restoreUploadButton")},on:{click:e.restoreDb}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Restore"))+" ")]),t(oe,{attrs:{value:e.showDialog,persistent:"",width:360}},[t(Z,{attrs:{title:e.$t("Settings.GeneralTab.Restore"),"card-class":"mainsail-restore-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.RestoreDialog")))])])],1),t(S,[t(Ur,{attrs:{options:e.restoreableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectRestoreCheckboxes}})],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("restoreMainsail")},on:{click:e.restoreDbAction}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Restore"))+" ")])],1)],1)],1)],1)],1)],1)},MU=[];const Av={};var EU=N(hh,DU,MU,!1,OU,null,null,null);function OU(e){for(let s in Av)this[s]=Av[s]}const LU=function(){return EU.exports}();var kU=Object.defineProperty,AU=Object.getOwnPropertyDescriptor,FU=(e,s,t,r)=>{for(var i=r>1?void 0:r?AU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&kU(s,t,i),i};let ph=class extends j(V,Si){constructor(){super(...arguments),this.mdiHelpCircle=Xl,this.mdiCloseThick=Ce,this.showDialog=!1,this.resetableNamespaces=[],this.resetCheckboxes=[]}async mounted(){await this.loadResetableNamespaces()}onSelectResetCheckboxes(s){this.resetCheckboxes=s}resetMainsailAction(){this.$store.dispatch("socket/addLoading","resetMainsail"),this.$store.dispatch("gui/resetMoonrakerDB",this.resetCheckboxes)}async openDialog(){await this.loadResetableNamespaces(),this.showDialog=!0}async loadResetableNamespaces(){this.resetableNamespaces=await this.loadBackupableNamespaces(),this.moonrakerComponents.includes("history")&&(this.resetableNamespaces.push({value:"history_jobs",label:this.$t("Settings.GeneralTab.DbHistoryJobs")}),this.resetableNamespaces.push({value:"history_totals",label:this.$t("Settings.GeneralTab.DbHistoryTotals")}))}closeDialog(){this.showDialog=!1}};ph=FU([O({components:{Panel:Z,SettingsRow:U,CheckboxList:Ur}})],ph);var RU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(g,{attrs:{color:"error",small:""},on:{click:e.openDialog}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.FactoryReset"))+" ")]),t(oe,{attrs:{persistent:"",width:360},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("Settings.GeneralTab.FactoryReset"),"card-class":"mainsail-reset-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.FactoryDialog")))])])],1),t(S,[t(Ur,{attrs:{options:e.resetableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectResetCheckboxes}})],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("resetMainsail")},on:{click:e.resetMainsailAction}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Reset"))+" ")])],1)],1)],1)],1)],1)],1)},IU=[];const Fv={};var HU=N(ph,RU,IU,!1,jU,null,null,null);function jU(e){for(let s in Fv)this[s]=Fv[s]}const NU=function(){return HU.exports}();var VU=Object.defineProperty,UU=Object.getOwnPropertyDescriptor,BU=(e,s,t,r)=>{for(var i=r>1?void 0:r?UU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&VU(s,t,i),i};let mh=class extends j(V,Si){constructor(){super(...arguments),this.availableLanguages=[]}async created(){const s=Object.assign({"../../locales/cz.json":()=>he(()=>import("./cz-285b76fb.js"),[]).then(r=>r.title),"../../locales/da.json":()=>he(()=>import("./da-6721996d.js"),[]).then(r=>r.title),"../../locales/de.json":()=>he(()=>import("./de-1c7e5778.js"),[]).then(r=>r.title),"../../locales/en.json":()=>he(()=>Promise.resolve().then(()=>T$),void 0).then(r=>r.title),"../../locales/es.json":()=>he(()=>import("./es-8a2d24bf.js"),[]).then(r=>r.title),"../../locales/fr.json":()=>he(()=>import("./fr-ab90ab77.js"),[]).then(r=>r.title),"../../locales/hu.json":()=>he(()=>import("./hu-a56cb065.js"),[]).then(r=>r.title),"../../locales/it.json":()=>he(()=>import("./it-85215c0c.js"),[]).then(r=>r.title),"../../locales/ja.json":()=>he(()=>import("./ja-a20a0276.js"),[]).then(r=>r.title),"../../locales/ko.json":()=>he(()=>import("./ko-0b8d811b.js"),[]).then(r=>r.title),"../../locales/nl.json":()=>he(()=>import("./nl-d64c7e44.js"),[]).then(r=>r.title),"../../locales/pl.json":()=>he(()=>import("./pl-d65989d8.js"),[]).then(r=>r.title),"../../locales/pt.json":()=>he(()=>import("./pt-880f8881.js"),[]).then(r=>r.title),"../../locales/ru.json":()=>he(()=>import("./ru-5f4aea5d.js"),[]).then(r=>r.title),"../../locales/se.json":()=>he(()=>import("./se-23883ae1.js"),[]).then(r=>r.title),"../../locales/tr.json":()=>he(()=>import("./tr-9777749c.js"),[]).then(r=>r.title),"../../locales/uk.json":()=>he(()=>import("./uk-644a4aa7.js"),[]).then(r=>r.title),"../../locales/zh.json":()=>he(()=>import("./zh-fcce6e53.js"),[]).then(r=>r.title),"../../locales/zh_TW.json":()=>he(()=>import("./zh_TW-7176daef.js"),[]).then(r=>r.title)}),t=[];for(const r in s){const i=r.slice(r.lastIndexOf("/")+1,r.lastIndexOf(".")),n=await s[r]();t.push({text:n,value:i})}this.availableLanguages=t}get printerName(){return this.$store.state.gui.general.printername}set printerName(s){this.$store.dispatch("gui/saveSetting",{name:"general.printername",value:s})}get currentLanguage(){return this.$store.state.gui.general.language}set currentLanguage(s){this.$store.dispatch("gui/saveSetting",{name:"general.language",value:s})}get dateFormat(){return this.$store.state.gui.general.dateFormat}set dateFormat(s){this.$store.dispatch("gui/saveSetting",{name:"general.dateFormat",value:s})}get dateFormatItems(){const s=new Date,t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;return[{value:null,text:"Browser (".concat(s.toLocaleDateString(t,{dateStyle:"medium"}),")")},{value:"2-digits",text:s.toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"})},{value:"short",text:s.toLocaleDateString(t,{day:"2-digit",month:"short",year:"numeric"})}]}get timeFormat(){return this.$store.state.gui.general.timeFormat}set timeFormat(s){this.$store.dispatch("gui/saveSetting",{name:"general.timeFormat",value:s})}get timeFormatItems(){const s=new Date,t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;return[{value:null,text:"Browser (".concat(s.toLocaleTimeString(t,{timeStyle:"short"}),")")},{value:"24hours",text:this.$t("Settings.GeneralTab.24hours",{time:s.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})})},{value:"12hours",text:this.$t("Settings.GeneralTab.12hours",{time:s.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hourCycle:"h12"})})}]}get calcPrintProgressItems(){return[{value:"file-relative",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.FileRelative")},{value:"file-absolute",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.FileAbsolute")},{value:"slicer",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.Slicer")},{value:"filament",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.Filament")}]}get calcPrintProgress(){var s;return(s=this.$store.state.gui.general.calcPrintProgress)!=null?s:"file-relative"}set calcPrintProgress(s){this.$store.dispatch("gui/saveSetting",{name:"general.calcPrintProgress",value:s})}get calcEstimateItems(){return[{value:"file",text:this.$t("Settings.GeneralTab.EstimateValues.File")},{value:"filament",text:this.$t("Settings.GeneralTab.EstimateValues.Filament")}]}get calcEstimateTime(){return this.$store.state.gui.general.calcEstimateTime}set calcEstimateTime(s){this.$store.dispatch("gui/saveSetting",{name:"general.calcEstimateTime",value:s})}get calcEtaTimeItems(){return[{value:"file",text:this.$t("Settings.GeneralTab.EstimateValues.File")},{value:"filament",text:this.$t("Settings.GeneralTab.EstimateValues.Filament")},{value:"slicer",text:this.$t("Settings.GeneralTab.EstimateValues.Slicer")}]}get calcEtaTime(){return this.$store.state.gui.general.calcEtaTime}set calcEtaTime(s){this.$store.dispatch("gui/saveSetting",{name:"general.calcEtaTime",value:s})}};mh=BU([O({components:{Panel:Z,SettingsRow:U,CheckboxList:Ur,SettingsGeneralTabBackupDatabase:Z2,SettingsGeneralTabRestoreDatabase:LU,SettingsGeneralTabResetDatabase:NU}})],mh);var WU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{attrs:{flat:""}},[t(q,[t(U,{attrs:{title:e.$t("Settings.GeneralTab.PrinterName")}},[t(re,{attrs:{"hide-details":"",outlined:"",dense:""},model:{value:e.printerName,callback:function(r){e.printerName=r},expression:"printerName"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.Language")}},[t(Le,{attrs:{items:e.availableLanguages,"hide-details":"",outlined:"",dense:""},model:{value:e.currentLanguage,callback:function(r){e.currentLanguage=r},expression:"currentLanguage"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.DateFormat")}},[t(Le,{attrs:{items:e.dateFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.dateFormat,callback:function(r){e.dateFormat=r},expression:"dateFormat"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.TimeFormat")}},[t(Le,{attrs:{items:e.timeFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.timeFormat,callback:function(r){e.timeFormat=r},expression:"timeFormat"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.CalcPrintProgress"),"sub-title":e.$t("Settings.GeneralTab.CalcPrintProgressDescription")}},[t(Le,{attrs:{items:e.calcPrintProgressItems,"hide-details":"",dense:"",outlined:""},model:{value:e.calcPrintProgress,callback:function(r){e.calcPrintProgress=r},expression:"calcPrintProgress"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.CalcEstimateTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEstimateTimeDescription")}},[t(Le,{attrs:{items:e.calcEstimateItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEstimateTime,callback:function(r){e.calcEstimateTime=r},expression:"calcEstimateTime"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.CalcEtaTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEtaTimeDescription")}},[t(Le,{attrs:{items:e.calcEtaTimeItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEtaTime,callback:function(r){e.calcEtaTime=r},expression:"calcEtaTime"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.MainsailSettingsMoonrakerDb"),"dynamic-slot-width":!0}},[t("settings-general-tab-backup-database"),t("settings-general-tab-restore-database")],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GeneralTab.FactoryReset"),"dynamic-slot-width":!0}},[t("settings-general-tab-reset-database")],1)],1)],1)],1)},GU=[];const Rv={};var zU=N(mh,WU,GU,!1,ZU,null,null,null);function ZU(e){for(let s in Rv)this[s]=Rv[s]}const qU=function(){return zU.exports}();var XU=Object.defineProperty,YU=Object.getOwnPropertyDescriptor,Om=(e,s,t,r)=>{for(var i=r>1?void 0:r?YU(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&XU(s,t,i),i};let Yn=class extends j(V,cr){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.mdiMenuDown=hr,this.selectIcon=!1,this.valid=!1,this.oldWebcamName="",this.rules={required:e=>e!==""||this.$t("Settings.WebcamsTab.Required"),unique:e=>!this.existsWebcamName(e)||this.$t("Settings.WebcamsTab.NameAlreadyExists")}}get webcams(){var e,s;return(s=(e=this.$store.state.gui.webcams)==null?void 0:e.webcams)!=null?s:[]}get title(){return this.type==="create"?this.$t("Settings.WebcamsTab.CreateWebcam"):this.$t("Settings.WebcamsTab.EditWebcam")}get actionButtonText(){return this.type==="create"?this.$t("Settings.WebcamsTab.SaveWebcam"):this.$t("Settings.WebcamsTab.UpdateWebcam")}get rotationItems(){const e=[0,90,180,270],s=[];return e.forEach(t=>{s.push({value:t,text:"".concat(t,"°")})}),s}get rulesStreamUrl(){let e=[];return this.webcam.service!=="mjpegstreamer-adaptive"&&e.push(this.rules.required),e}get rulesSnapshotUrl(){let e=[];return this.webcam.service==="mjpegstreamer-adaptive"&&e.push(this.rules.required),e}get serviceItems(){return[{value:"mjpegstreamer",text:this.$t("Settings.WebcamsTab.Mjpegstreamer")},{value:"mjpegstreamer-adaptive",text:this.$t("Settings.WebcamsTab.MjpegstreamerAdaptive")},{value:"uv4l-mjpeg",text:this.$t("Settings.WebcamsTab.Uv4lMjpeg")},{value:"ipstream",text:this.$t("Settings.WebcamsTab.Ipstream")},{value:"webrtc-camerastreamer",text:this.$t("Settings.WebcamsTab.WebrtcCameraStreamer")},{value:"webrtc-go2rtc",text:this.$t("Settings.WebcamsTab.WebrtcGo2rtc")},{value:"webrtc-mediamtx",text:this.$t("Settings.WebcamsTab.WebrtcMediaMTX")},{value:"hlsstream",text:this.$t("Settings.WebcamsTab.Hlsstream")},{value:"jmuxer-stream",text:this.$t("Settings.WebcamsTab.JMuxerStream")},{value:"webrtc-janus",text:this.$t("Settings.WebcamsTab.WebrtcJanus")}]}get iconItems(){return[{value:"mdiPrinter3d",text:this.$t("Settings.WebcamsTab.IconPrinter")},{value:"mdiPrinter3dNozzle",text:this.$t("Settings.WebcamsTab.IconNozzle")},{value:"mdiRadiatorDisabled",text:this.$t("Settings.WebcamsTab.IconBed")},{value:"mdiWebcam",text:this.$t("Settings.WebcamsTab.IconCam")},{value:"mdiAlbum",text:this.$t("Settings.WebcamsTab.IconFilament")},{value:"mdiDoor",text:this.$t("Settings.WebcamsTab.IconDoor")},{value:"mdiRaspberryPi",text:this.$t("Settings.WebcamsTab.IconMcu")},{value:"mdiCampfire",text:this.$t("Settings.WebcamsTab.IconHot")}]}get classIconButtonArrow(){let e=["_transition"];return this.selectIcon&&e.push("_rotate-180"),e}get hasFpsCounter(){return["mjpegstreamer","mjpegstreamer-adaptive"].includes(this.webcam.service)}get hasAudioOption(){return["webrtc-go2rtc"].includes(this.webcam.service)}get hideFps(){var e,s;return(s=(e=this.webcam.extra_data)==null?void 0:e.hideFps)!=null?s:!1}set hideFps(e){if(!("extra_data"in this.webcam)){this.webcam.extra_data={hideFps:e};return}this.webcam.extra_data.hideFps=e}get enableAudio(){var e,s;return(s=(e=this.webcam.extra_data)==null?void 0:e.enableAudio)!=null?s:!1}set enableAudio(e){if(!("extra_data"in this.webcam)){this.webcam.extra_data={enableAudio:e};return}this.webcam.extra_data.enableAudio=e}mounted(){this.oldWebcamName=this.webcam.name}existsWebcamName(e){var t,r;e=e.toLowerCase().trim();const s=(r=(t=this.webcams.find(i=>i.name.toLowerCase().trim()===e))==null?void 0:t.length)!=null?r:0;return this.type==="create"?s!==0:s>=1}submit(){if(this.type==="create"){this.save();return}this.update()}async save(){await this.$store.dispatch("gui/webcams/store",this.webcam),this.$emit("close")}async update(){await this.$store.dispatch("gui/webcams/update",{webcam:this.webcam,oldWebcamName:this.oldWebcamName}),this.$emit("close")}closeForm(){this.$emit("close")}};Om([k({type:Object,required:!0})],Yn.prototype,"webcam",2);Om([k({type:String,default:"create"})],Yn.prototype,"type",2);Yn=Om([O({components:{SettingsRow:U}})],Yn);var JU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Lr,{ref:"webcamForm",on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(vt,[e._v(e._s(e.title))]),t(q,[t(S,[t(_,{staticClass:"col-12 col-sm-6"},[t(S,[t(_,{staticClass:"d-flex"},[t(Nt,[t($e,{attrs:{"offset-y":!0,title:"Icon"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"px-2 mr-2 _transition _menu-button",attrs:{color:"transparent",elevation:"0",ripple:!1}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.convertWebcamIcon(e.webcam.icon)))]),t(v,{staticClass:"pl-1 mr-n2",class:e.classIconButtonArrow},[e._v(" "+e._s(e.mdiMenuDown)+" ")])],1)]}}]),model:{value:e.selectIcon,callback:function(r){e.selectIcon=r},expression:"selectIcon"}},[t(Oe,{staticClass:"py-0",attrs:{dense:""}},e._l(e.iconItems,function(r){return t(K,{key:r.value,attrs:{link:""},on:{click:function(i){e.webcam.icon=r.value}}},[t(Rs,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(" "+e._s(e.convertWebcamIcon(r.value))+" ")])],1),t(Gt,[t(rt,{domProps:{textContent:e._s(r.text)}})],1)],1)}),1)],1)],1),t(re,{staticClass:"_webcam-settings-name-field",attrs:{label:e.$t("Settings.WebcamsTab.Name"),"hide-details":"auto",outlined:"",rules:[e.rules.required,e.rules.unique],dense:""},model:{value:e.webcam.name,callback:function(r){e.$set(e.webcam,"name",r)},expression:"webcam.name"}})],1)],1),t(S,[t(_,{staticClass:"py-2"},[t(re,{attrs:{label:e.$t("Settings.WebcamsTab.UrlStream"),"hide-details":"auto",outlined:"",dense:"",rules:e.rulesStreamUrl},model:{value:e.webcam.stream_url,callback:function(r){e.$set(e.webcam,"stream_url",r)},expression:"webcam.stream_url"}})],1)],1),t(S,[t(_,{staticClass:"py-2"},[t(re,{attrs:{label:e.$t("Settings.WebcamsTab.UrlSnapshot"),"hide-details":"auto",outlined:"",dense:"",rules:e.rulesSnapshotUrl},model:{value:e.webcam.snapshot_url,callback:function(r){e.$set(e.webcam,"snapshot_url",r)},expression:"webcam.snapshot_url"}})],1)],1),t(S,[t(_,{staticClass:"py-2"},[t(Le,{attrs:{items:e.serviceItems,"hide-details":"",outlined:"",dense:"",label:e.$t("Settings.WebcamsTab.Service")},model:{value:e.webcam.service,callback:function(r){e.$set(e.webcam,"service",r)},expression:"webcam.service"}})],1)],1),["mjpegstreamer-adaptive","jmuxer-stream"].includes(e.webcam.service)?t(S,[t(_,{staticClass:"py-2 col-6"},[t(re,{attrs:{outlined:"",dense:"","hide-details":"",label:e.$t("Settings.WebcamsTab.TargetFPS")},model:{value:e.webcam.target_fps,callback:function(r){e.$set(e.webcam,"target_fps",r)},expression:"webcam.target_fps"}})],1),t(_,{staticClass:"py-2 col-6"},[t(Le,{attrs:{items:e.rotationItems,outlined:"",dense:"","hide-details":"",label:e.$t("Settings.WebcamsTab.Rotate")},model:{value:e.webcam.rotation,callback:function(r){e.$set(e.webcam,"rotation",r)},expression:"webcam.rotation"}})],1)],1):e._e(),e.hasFpsCounter?t(S,[t(_,{staticClass:"pt-1 pb-3"},[t(we,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.HideFps")},model:{value:e.hideFps,callback:function(r){e.hideFps=r},expression:"hideFps"}})],1)],1):e._e(),e.hasAudioOption?t(S,[t(_,{staticClass:"pt-1 pb-3"},[t(we,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.EnableAudio")},model:{value:e.enableAudio,callback:function(r){e.enableAudio=r},expression:"enableAudio"}})],1)],1):e._e(),t(S,[t(_,{staticClass:"pt-1 pb-3"},[t("div",{staticClass:"v-label v-label--active theme--dark text-subtitle-1"},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.FlipWebcam"))+" ")])])],1),t(S,{staticClass:"mt-0"},[t(_,{staticClass:"py-0"},[t(we,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.Horizontally")},model:{value:e.webcam.flip_horizontal,callback:function(r){e.$set(e.webcam,"flip_horizontal",r)},expression:"webcam.flip_horizontal"}})],1),t(_,{staticClass:"py-0"},[t(we,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.Vertically")},model:{value:e.webcam.flip_vertical,callback:function(r){e.$set(e.webcam,"flip_vertical",r)},expression:"webcam.flip_vertical"}})],1)],1)],1),t(_,{staticClass:"col-12 col-sm-6 text-center",attrs:{"align-self":"center"}},[t(Sc,{attrs:{webcam:e.webcam}})],1)],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.valid}},[e._v(e._s(e.actionButtonText))])],1)],1)},KU=[];const Iv={};var QU=N(Yn,JU,KU,!1,eB,"3a5b3bca",null,null);function eB(e){for(let s in Iv)this[s]=Iv[s]}const q2=function(){return QU.exports}();var tB=Object.defineProperty,sB=Object.getOwnPropertyDescriptor,Lm=(e,s,t,r)=>{for(var i=r>1?void 0:r?sB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&tB(s,t,i),i};let Jn=class extends j(V,cr){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.mdiLightbulbOutline=Sp}get icon(){return this.convertWebcamIcon(this.webcam.icon)}get subtitle(){return this.webcam.service==="mjpegstreamer-adaptive"?"URL: ".concat(this.webcam.snapshot_url):"URL: ".concat(this.webcam.stream_url)}toogleStatus(){let e={...this.webcam};e.enabled=!e.enabled,this.$store.dispatch("gui/webcams/update",{webcam:e,oldWebcamName:e.name})}edit(){this.$emit("edit-webcam",this.webcam)}deleteWebcam(){this.$store.dispatch("gui/webcams/delete",this.webcam.name)}};Lm([k({type:Object,default:()=>{}})],Jn.prototype,"webcam",2);Lm([k({type:Boolean,default:!1})],Jn.prototype,"boolBorderTop",2);Jn=Lm([O({components:{SettingsRow:U}})],Jn);var rB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolBorderTop?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:e.webcam.name,icon:e.icon,"sub-title":e.subtitle}},[e.webcam.source==="database"?[t(g,{staticClass:"minwidth-0 px-2",attrs:{small:"",outlined:"",color:e.webcam.enabled?"":"secondary"},on:{click:e.toogleStatus}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiLightbulbOutline))])],1),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.edit}},[t(v,{attrs:{small:"",left:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:e.deleteWebcam}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)]:e._e()],2)],1)},iB=[];const Hv={};var nB=N(Jn,rB,iB,!1,aB,null,null,null);function aB(e){for(let s in Hv)this[s]=Hv[s]}const X2=function(){return nB.exports}();var oB=Object.defineProperty,lB=Object.getOwnPropertyDescriptor,cB=(e,s,t,r)=>{for(var i=r>1?void 0:r?lB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&oB(s,t,i),i};let fh=class extends j(V,cr){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.boolForm=!1,this.typeForm="create",this.formWebcam={}}get webcams(){var s;return(s=this.$store.state.gui.webcams.webcams)!=null?s:[]}get configfiles(){var s,t;return(t=(s=this.$store.getters["files/getDirectory"]("config"))==null?void 0:s.childrens)!=null?t:[]}get crowsnestConf(){return this.configfiles.find(s=>s.filename==="crowsnest.conf")}get existCrowsnestConf(){return this.configfiles.findIndex(s=>s.filename==="crowsnest.conf")!==-1}openCrowsnestConf(){var s,t,r;this.$store.dispatch("editor/openFile",{root:"config",path:"/",filename:(s=this.crowsnestConf)==null?void 0:s.filename,size:(t=this.crowsnestConf)==null?void 0:t.size,permissions:(r=this.crowsnestConf)==null?void 0:r.permissions})}createWebcam(){this.formWebcam={name:"",enabled:!0,icon:"mdiWebcam",service:"mjpegstreamer-adaptive",target_fps:15,target_fps_idle:15,stream_url:"/webcam/?action=stream",snapshot_url:"/webcam/?action=snapshot",rotation:0,flip_horizontal:!1,flip_vertical:!1,extra_data:{}},this.typeForm="create",this.boolForm=!0}closeForm(){this.boolForm=!1}editWebcam(s){this.formWebcam={...s},this.typeForm="edit",this.boolForm=!0}};fh=cB([O({components:{SettingsRow:U,WebcamForm:q2,WebcamListEntry:X2}})],fh);var uB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?t(De,{attrs:{flat:""}},[t(q2,{attrs:{webcam:e.formWebcam,type:e.typeForm},on:{close:e.closeForm}})],1):t(De,{attrs:{flat:""}},[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.WebcamsTab.Webcams")))]),e._l(e.webcams,function(r,i){return t(X2,{key:r.name,attrs:{webcam:r,"bool-border-top":i>0},on:{"edit-webcam":e.editWebcam}})})],2),t(ne,[e.existCrowsnestConf?t(g,{attrs:{text:"",color:"primary"},on:{click:e.openCrowsnestConf}},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.EditCrowsnestConf"))+" ")]):e._e(),t(le),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createWebcam}},[e._v(e._s(e.$t("Settings.WebcamsTab.AddWebcam")))])],1)],1)],1)},dB=[];const jv={};var hB=N(fh,uB,dB,!1,pB,null,null,null);function pB(e){for(let s in jv)this[s]=jv[s]}const mB=function(){return hB.exports}();var fB=Object.defineProperty,gB=Object.getOwnPropertyDescriptor,vB=(e,s,t,r)=>{for(var i=r>1?void 0:r?gB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&fB(s,t,i),i};let gh=class extends j(V){get macros(){var e;return(e=this.$store.getters["printer/getMacros"])!=null?e:[]}get hiddenMacros(){var e;return(e=this.$store.state.gui.macros.hiddenMacros)!=null?e:[]}getMacroStatus(e){return!this.hiddenMacros.includes(e.toUpperCase())}changeMacroStatus(e){const s=[...this.hiddenMacros];this.hiddenMacros.includes(e.toUpperCase())?s.splice(s.indexOf(e.toUpperCase()),1):s.push(e.toUpperCase()),this.$store.dispatch("gui/macros/saveSetting",{name:"hiddenMacros",value:s})}};gh=vB([O({components:{SettingsRow:U}})],gh);var _B=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,[t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.Macros")))]),e.macros.length?e._l(e.macros,function(r,i){return t("div",{key:i},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:r.name,"sub-title":r.description,"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"input-value":e.getMacroStatus(r.name),"hide-details":""},on:{change:function(n){return e.changeMacroStatus(r.name)}}})],1)],1)}):[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NOMacros")))])])],1)]],2)},bB=[];const Nv={};var yB=N(gh,_B,bB,!1,CB,null,null,null);function CB(e){for(let s in Nv)this[s]=Nv[s]}const Y2=function(){return yB.exports}();var $B=Object.defineProperty,xB=Object.getOwnPropertyDescriptor,Nc=(e,s,t,r)=>{for(var i=r>1?void 0:r?xB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&$B(s,t,i),i};let Pi=class extends j(V,kt){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.mdiSleep=HP,this.mdiPause=Tp,this.mdiPrinter3dNozzle=Bs,this.mdiPlus=Dp,this.mdiDragVertical=zl,this.mdiPalette=Kl,this.rules={required:e=>e!==""||"required",groupUnique:e=>!this.existsGroupName(e)||"Name already exists"},this.boolFormEdit=!1,this.editGroupId=""}get groupColors(){return[{text:this.$t("Settings.MacrosTab.Primary"),value:"primary"},{text:this.$t("Settings.MacrosTab.Secondary"),value:"secondary"},{text:this.$t("Settings.MacrosTab.Success"),value:"success"},{text:this.$t("Settings.MacrosTab.Warning"),value:"warning"},{text:this.$t("Settings.MacrosTab.Error"),value:"error"},{text:this.$t("Settings.MacrosTab.Custom"),value:"custom"}]}get macroColors(){const e=[...this.groupColors],s=e.findIndex(t=>t.value==="custom");return s!==-1&&e.splice(s,1),e.push({text:this.$t("Settings.MacrosTab.Group"),value:"group"}),e}get allMacros(){var e;return(e=this.$store.getters["printer/getMacros"])!=null?e:[]}get availableMacros(){return this.allMacros.filter(e=>!this.editGroupUsedMacros.includes(e.name))}get groups(){var e;return(e=this.$store.getters["gui/macros/getAllMacrogroups"])!=null?e:[]}get editGroupUsedMacros(){var e,s,t;return(t=(s=(e=this.editGroup)==null?void 0:e.macros)==null?void 0:s.map(r=>r.name))!=null?t:[]}get editGroup(){return this.$store.getters["gui/macros/getMacrogroup"](this.editGroupId)}get editGroupMacros(){var s,t;const e=(t=(s=this.editGroup)==null?void 0:s.macros)!=null?t:[];return e.sort((r,i)=>r.pos-i.pos),e}set editGroupMacros(e){}existsGroupName(e){return this.groups.findIndex(s=>s.name===e&&s.id!=this.editGroupId)>=0}clearColorObject(e){return typeof e=="object"&&"hex"in e&&(e=e.hex),e.length>7&&(e=e.substr(0,7)),e}updateShowGeneral(e){this.$emit("update:showGeneral",e)}async addGroup(){const e={name:"",color:"primary",colorCustom:"#fff",showInStandby:!0,showInPause:!0,showInPrinting:!0};this.editGroupId=await this.$store.dispatch("gui/macros/groupStore",{values:e}),this.boolFormEdit=!0}editMacrogroup(e){this.boolFormEdit=!0,this.editGroupId=e.id}deleteMacrogroup(e){this.$store.dispatch("gui/macros/groupDelete",e)}addMacroToGroup(e){this.$store.dispatch("gui/macros/addMacroToMacrogroup",{id:this.editGroupId,macro:e.name})}updateMacroFromGroup(e,s,t){this.$store.dispatch("gui/macros/updateMacroFromMacrogroup",{id:this.editGroupId,macro:e.name,option:s,value:t})}updateMacroOrder(e){var n,a;const s=(n=e.moved.oldIndex)!=null?n:0,t=(a=e.moved.newIndex)!=null?a:0,r=this.editGroupMacros[s].pos,i=this.editGroupMacros[t].pos;this.updateMacroFromGroup(this.editGroupMacros[s],"pos",i),this.updateMacroFromGroup(this.editGroupMacros[t],"pos",r)}changeColorMacroFromGroup(e){let s=this.macroColors.findIndex(i=>i.value===e.color)+1;const t=this.macroColors.length-1;s>t&&(s=0);const r=this.macroColors[s].value;this.updateMacroFromGroup(e,"color",r)}removeMacroFromGroup(e){this.$store.dispatch("gui/macros/removeMacroFromMacrogroup",{id:this.editGroupId,macro:e.name})}existsMacro(e){return this.allMacros.findIndex(s=>s.name.toLowerCase()===e.toLowerCase())!==-1}getMacroDescription(e){var t;const s=this.allMacros.find(r=>r.name.toLowerCase()===e.toLowerCase());return s?(t=s==null?void 0:s.description)!=null?t:null:this.$t("Settings.MacrosTab.DeletedMacro")}updateMacrogroupOption(e,s){const t={};t[e]=s,this.$store.dispatch("gui/macros/groupUpdate",{id:this.editGroupId,values:t})}updateGroupOptionName(e){this.updateMacrogroupOption("name",e)}updateGroupOptionColor(e){this.updateMacrogroupOption("color",e)}updateGroupOptionColorCustom(e){this.updateMacrogroupOption("colorCustom",this.clearColorObject(e))}updateGroupOptionShowInStandby(e){this.updateMacrogroupOption("showInStandby",e)}updateGroupOptionShowInPause(e){this.updateMacrogroupOption("showInPause",e)}updateGroupOptionShowInPrinting(e){this.updateMacrogroupOption("showInPrinting",e)}updatedBoolFormEdit(e){this.updateShowGeneral(!e)}cancelEditMacrogroup(){this.boolFormEdit=!1,this.$emit("scrollToTop")}};Nc([Ze(250)],Pi.prototype,"updateGroupOptionName",1);Nc([Ze(250)],Pi.prototype,"updateGroupOptionColorCustom",1);Nc([me("boolFormEdit")],Pi.prototype,"updatedBoolFormEdit",1);Pi=Nc([O({components:{SettingsRow:U,draggable:Ui}})],Pi);var wB=function(){var e,s,t,r,i=this,n=i.$createElement,a=i._self._c||n;return a("div",[i.boolFormEdit===!1?[a(q,[a("h3",{staticClass:"text-h5 mb-3"},[i._v(i._s(i.$t("Settings.MacrosTab.Macrogroups")))]),i.groups.length?i._l(i.groups,function(o,l){return a("div",{key:l},[l?a(E,{staticClass:"my-2"}):i._e(),a(U,{attrs:{title:o.name!==""?o.name:"<"+i.$t("Settings.MacrosTab.UnknownGroup")+">","sub-title":i.$tc("Settings.MacrosTab.CountMacros","macros"in o?o.macros.length:0,{count:"macros"in o?o.macros.length:0}),"dynamic-slot-width":!0}},[a(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(c){return i.editMacrogroup(o)}}},[a(v,{attrs:{left:"",small:""}},[i._v(i._s(i.mdiPencil))]),i._v(" "+i._s(i.$t("Settings.Edit"))+" ")],1),a(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(c){return i.deleteMacrogroup(o.id)}}},[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiDelete))])],1)],1)],1)}):[a(S,[a(_,[a("p",{staticClass:"mb-0 text-center font-italic"},[i._v(i._s(i.$t("Settings.MacrosTab.NoGroups")))])])],1)]],2),a(ne,{staticClass:"d-flex justify-end"},[a(g,{attrs:{text:"",color:"primary"},on:{click:i.addGroup}},[i._v(i._s(i.$t("Settings.MacrosTab.AddGroup")))])],1)]:i.boolFormEdit?[a(q,[a("h3",{staticClass:"text-h5 mb-3"},[i._v(i._s(i.$t("Settings.MacrosTab.EditGroup")))]),a(U,{attrs:{title:i.$t("Settings.MacrosTab.Name")}},[a(re,{attrs:{"hide-details":"auto",rules:[i.rules.required,i.rules.groupUnique],dense:"",outlined:""},on:{change:i.updateGroupOptionName},model:{value:i.editGroup.name,callback:function(o){i.$set(i.editGroup,"name",o)},expression:"editGroup.name"}})],1),a(E,{staticClass:"my-2"}),a(U,{attrs:{title:i.$t("Settings.MacrosTab.Color")}},[a(Le,{attrs:{items:i.groupColors,outlined:"",dense:"","hide-details":"",attach:""},on:{change:i.updateGroupOptionColor},model:{value:i.editGroup.color,callback:function(o){i.$set(i.editGroup,"color",o)},expression:"editGroup.color"}})],1),((e=i.editGroup)===null||e===void 0?void 0:e.color)==="custom"?[a(E,{staticClass:"my-2"}),a(U,{attrs:{title:i.$t("Settings.MacrosTab.CustomColor")}},[a($e,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:i._u([{key:"activator",fn:function(o){var l=o.on,c=o.attrs;return[a(g,i._g(i._b({staticClass:"minwidth-0 px-5",attrs:{color:i.editGroup.colorCustom,small:""}},"v-btn",c,!1),l))]}}],null,!1,3888687373)},[a(ss,{attrs:{value:i.editGroup.colorCustom,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":i.updateGroupOptionColorCustom}})],1)],1)]:i._e(),a(E,{staticClass:"my-2"}),a(U,{attrs:{title:i.$t("Settings.MacrosTab.Status")}},[a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(o){var l,c=o.on,u=o.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(l=i.editGroup)!==null&&l!==void 0&&l.showInStandby?"":"secondary"},on:{click:function(d){var h;return i.updateGroupOptionShowInStandby(!((h=i.editGroup)!==null&&h!==void 0&&h.showInStandby))}}},"v-btn",u,!1),c),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiSleep))])],1)]}}])},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStateStandby")))])]),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(o){var l,c=o.on,u=o.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(l=i.editGroup)!==null&&l!==void 0&&l.showInPause?"":"secondary"},on:{click:function(d){var h;return i.updateGroupOptionShowInPause(!((h=i.editGroup)!==null&&h!==void 0&&h.showInPause))}}},"v-btn",u,!1),c),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiPause))])],1)]}}])},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStatePaused")))])]),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(o){var l,c=o.on,u=o.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(l=i.editGroup)!==null&&l!==void 0&&l.showInPrinting?"":"secondary"},on:{click:function(d){var h;return i.updateGroupOptionShowInPrinting(!((h=i.editGroup)!==null&&h!==void 0&&h.showInPrinting))}}},"v-btn",u,!1),c),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiPrinter3dNozzle))])],1)]}}])},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStatePrinting")))])])],1),a(E,{staticClass:"my-2"}),a("h3",{staticClass:"text-h5 mt-6 mb-3"},[i._v(i._s(i.$t("Settings.MacrosTab.GroupMacros")))]),(s=i.editGroup)!==null&&s!==void 0&&s.macros&&(t=i.editGroup)!==null&&t!==void 0&&(r=t.macros)!==null&&r!==void 0&&r.length?[a("draggable",{attrs:{handle:".handle","ghost-class":"ghost",group:"macros"},on:{change:i.updateMacroOrder},model:{value:i.editGroupMacros,callback:function(o){i.editGroupMacros=o},expression:"editGroupMacros"}},i._l(i.editGroupMacros,function(o,l){return a(S,{key:o.name,staticClass:"my-2 mx-0",style:i.draggableBgStyle},[a(_,{staticClass:"col-auto pr-0 d-flex py-2"},[a(v,{staticClass:"handle"},[i._v(i._s(i.mdiDragVertical))])],1),a(_,{staticClass:"py-2"},[a(U,{key:"groupMacro_macro_"+l,attrs:{title:o.name,"sub-title":i.getMacroDescription(o.name),"dynamic-slot-width":!0}},[i.existsMacro(o.name)?[a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(c){var u=c.on,d=c.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.color},on:{click:function(h){return i.changeColorMacroFromGroup(o)}}},"v-btn",d,!1),u),[a(v,{attrs:{small:"",left:""}},[i._v(i._s(i.mdiPalette))]),i._v(" "+i._s(o.color)+" ")],1)]}}],null,!0)},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ChangeMacroColor")))])]),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(c){var u=c.on,d=c.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInStandby?"":"secondary"},on:{click:function(h){return i.updateMacroFromGroup(o,"showInStandby",!o.showInStandby)}}},"v-btn",d,!1),u),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiSleep))])],1)]}}],null,!0)},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStateStandby")))])]),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(c){var u=c.on,d=c.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInPause?"":"secondary"},on:{click:function(h){return i.updateMacroFromGroup(o,"showInPause",!o.showInPause)}}},"v-btn",d,!1),u),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiPause))])],1)]}}],null,!0)},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStatePaused")))])]),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(c){var u=c.on,d=c.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInPrinting?"":"secondary"},on:{click:function(h){return i.updateMacroFromGroup(o,"showInPrinting",!o.showInPrinting)}}},"v-btn",d,!1),u),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiPrinter3dNozzle))])],1)]}}],null,!0)},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.ShowInStatePrinting")))])])]:i._e(),a(pe,{attrs:{top:""},scopedSlots:i._u([{key:"activator",fn:function(c){var u=c.on,d=c.attrs;return[a(g,i._g(i._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(h){return i.removeMacroFromGroup(o)}}},"v-btn",d,!1),u),[a(v,{attrs:{small:""}},[i._v(i._s(i.mdiDelete))])],1)]}}],null,!0)},[a("span",[i._v(i._s(i.$t("Settings.MacrosTab.DeleteMacroFromGroup")))])])],2)],1)],1)}),1)]:[a(S,[a(_,[a("p",{staticClass:"mb-0 text-center font-italic"},[i._v(i._s(i.$t("Settings.MacrosTab.NoMacrosInGroup")))])])],1)],a("h3",{staticClass:"text-h5 mt-6 mb-3"},[i._v(i._s(i.$t("Settings.MacrosTab.AvailableMacros")))]),i.availableMacros.length?[i._l(i.availableMacros,function(o,l){return[l?a(E,{key:"availableMacro_deliver_"+l,staticClass:"my-2"}):i._e(),a(U,{key:"availableMacro_macro_"+l,attrs:{title:o.name,"sub-title":o.description,"dynamic-slot-width":!0}},[a(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(c){return i.addMacroToGroup(o)}}},[a(v,{attrs:{left:"",small:""}},[i._v(i._s(i.mdiPlus))]),i._v(" "+i._s(i.$t("Settings.MacrosTab.Add"))+" ")],1)],1)]})]:[a(S,[a(_,[a("p",{staticClass:"mb-0 text-center font-italic"},[i._v(i._s(i.$t("Settings.MacrosTab.NoAvailableMacros")))])])],1)]],2),a(ne,{staticClass:"d-flex justify-end"},[a(g,{attrs:{text:""},on:{click:i.cancelEditMacrogroup}},[i._v(i._s(i.$t("Settings.Close")))])],1)]:i._e()],2)},SB=[];const Vv={};var PB=N(Pi,wB,SB,!1,TB,null,null,null);function TB(e){for(let s in Vv)this[s]=Vv[s]}const J2=function(){return PB.exports}();var DB=Object.defineProperty,MB=Object.getOwnPropertyDescriptor,EB=(e,s,t,r)=>{for(var i=r>1?void 0:r?MB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&DB(s,t,i),i};let vh=class extends j(V){constructor(){super(...arguments),this.showGeneral=!0}get modes(){return[{text:this.$t("Settings.MacrosTab.Simple"),value:"simple"},{text:this.$t("Settings.MacrosTab.Expert"),value:"expert"}]}get mode(){var s,t,r;return(r=(t=(s=this.$store.state.gui)==null?void 0:s.macros)==null?void 0:t.mode)!=null?r:"simple"}set mode(s){this.$store.dispatch("gui/macros/saveSetting",{name:"mode",value:s})}updateShowGeneral(s){this.showGeneral=s}scrollToTop(){this.$emit("scrollToTop")}};vh=EB([O({components:{SettingsMacrosTabExpert:J2,SettingsMacrosTabSimple:Y2,SettingsRow:U}})],vh);var OB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[e.showGeneral?t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.General")))]),t(U,{attrs:{title:e.$t("Settings.MacrosTab.Management")}},[t(Le,{attrs:{items:e.modes,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),t(E,{staticClass:"my-2"})],1):e._e(),e.mode==="expert"?[t(J2,{on:{"update:showGeneral":e.updateShowGeneral,scrollToTop:e.scrollToTop}})]:[t(Y2)]],2)},LB=[];const Uv={};var kB=N(vh,OB,LB,!1,AB,null,null,null);function AB(e){for(let s in Uv)this[s]=Uv[s]}const FB=function(){return kB.exports}();var RB=Object.defineProperty,IB=Object.getOwnPropertyDescriptor,HB=(e,s,t,r)=>{for(var i=r>1?void 0:r?IB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&RB(s,t,i),i};let _h=class extends j(V,Je,Vo){constructor(){super(...arguments),this.mdiGamepad=wp,this.mdiPrinter3dNozzle=Bs}get controlStyles(){return[{text:this.$t("Settings.ControlTab.Bars"),value:"bars"},{text:this.$t("Settings.ControlTab.Circle"),value:"circle"},{text:this.$t("Settings.ControlTab.Cross"),value:"cross"}]}get controlStyle(){var s;return(s=this.$store.state.gui.control.style)!=null?s:"bar"}set controlStyle(s){this.$store.dispatch("gui/saveSetting",{name:"control.style",value:s})}get hideDuringPrint(){var s;return(s=this.$store.state.gui.control.hideDuringPrint)!=null?s:!1}set hideDuringPrint(s){this.$store.dispatch("gui/saveSetting",{name:"control.hideDuringPrint",value:s})}get actionOptions(){let s=[{text:this.$t("Settings.ControlTab.MotorsOff",{isDefault:this.defaultActionButton==="m84"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"m84"}];return this.existsQGL&&s.push({text:this.$t("Settings.ControlTab.QuadGantryLevel",{isDefault:this.defaultActionButton==="qgl"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"qgl"}),this.existsZtilt&&s.push({text:this.$t("Settings.ControlTab.ZTiltAdjust",{isDefault:this.defaultActionButton==="ztilt"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"ztilt"}),s}get actionButton(){var s;return(s=this.$store.state.gui.control.actionButton)!=null?s:this.defaultActionButton}set actionButton(s){this.$store.dispatch("gui/saveSetting",{name:"control.actionButton",value:s})}get defaultActionButton(){return this.$store.getters["gui/getDefaultControlActionButton"]}get enableXYHoming(){var s;return(s=this.$store.state.gui.control.enableXYHoming)!=null?s:!1}set enableXYHoming(s){this.$store.dispatch("gui/saveSetting",{name:"control.enableXYHoming",value:s})}get reverseX(){return this.$store.state.gui.control.reverseX}set reverseX(s){this.$store.dispatch("gui/saveSetting",{name:"control.reverseX",value:s})}get reverseY(){return this.$store.state.gui.control.reverseY}set reverseY(s){this.$store.dispatch("gui/saveSetting",{name:"control.reverseY",value:s})}get reverseZ(){return this.$store.state.gui.control.reverseZ}set reverseZ(s){this.$store.dispatch("gui/saveSetting",{name:"control.reverseZ",value:s})}get feedrateXY(){return this.$store.state.gui.control.feedrateXY}set feedrateXY(s){this.$store.dispatch("gui/saveSetting",{name:"control.feedrateXY",value:s})}get feedrateZ(){return this.$store.state.gui.control.feedrateZ}set feedrateZ(s){this.$store.dispatch("gui/saveSetting",{name:"control.feedrateZ",value:s})}get offsetsZ(){return this.$store.state.gui.control.offsetsZ.sort(function(t,r){return t-r})}set offsetsZ(s){const t=new Set;for(const r of s)t.add(Math.abs(r));this.$store.dispatch("gui/saveSetting",{name:"control.offsetsZ",value:Array.from(t)})}get stepsAll(){const s=this.$store.state.gui.control.stepsAll;return(s!=null?s:[]).sort(function(t,r){return r-t})}set stepsAll(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsAll",value:r})}get stepsXY(){return this.$store.state.gui.control.stepsXY.sort(function(t,r){return r-t})}set stepsXY(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsXY",value:r})}get stepsZ(){return this.$store.state.gui.control.stepsZ.sort(function(t,r){return r-t})}set stepsZ(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsZ",value:r})}get stepsCircleXY(){return this.$store.state.gui.control.stepsCircleXY.sort(function(t,r){return r-t})}set stepsCircleXY(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsCircleXY",value:r})}get stepsCircleZ(){return this.$store.state.gui.control.stepsCircleZ.sort(function(t,r){return r-t})}set stepsCircleZ(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsCircleZ",value:r})}get feedamountsE(){return this.$store.state.gui.control.extruder.feedamounts.sort(function(t,r){return r-t})}set feedamountsE(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedamounts",value:r})}get feedratesE(){return this.$store.state.gui.control.extruder.feedrates.sort(function(t,r){return r-t})}set feedratesE(s){const t=[];for(const i of s)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedrates",value:r})}get showEstimatedExtrusionInfo(){return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo}set showEstimatedExtrusionInfo(s){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.showEstimatedExtrusionInfo",value:s})}get offsetZSaveOption(){var s;return(s=this.$store.state.gui.control.offsetZSaveOption)!=null?s:null}set offsetZSaveOption(s){this.$store.dispatch("gui/saveSetting",{name:"control.offsetZSaveOption",value:s})}get offsetZSaveOptions(){const s=this.autoSaveZOffsetOption.replace(/Z_OFFSET_APPLY_/g,""),t=[{value:null,text:"Auto (".concat(s,")")}];return this.existZOffsetApplyEndstop&&t.push({value:"Z_OFFSET_APPLY_ENDSTOP",text:"ENDSTOP"}),this.existZOffsetApplyProbe&&t.push({value:"Z_OFFSET_APPLY_PROBE",text:"PROBE"}),t}blurFeedrateXY(){this.feedrateXY>0||(this.feedrateXY=100)}blurFeedrateZ(){this.feedrateZ>0||(this.feedrateZ=25)}onlyUnique(s,t,r){return r.indexOf(s)===t}mounted(){this.$refs.formControlExtruder.validate()}};_h=HB([O({components:{SettingsRow:U}})],_h);var jB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(Lr,{ref:"formControlExtruder"},[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGamepad))]),t(vt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.Headline"))+" ")]),t(E,{staticClass:"ml-3"})],1),t(U,{attrs:{title:e.$t("Settings.ControlTab.Style")}},[t(Le,{attrs:{items:e.controlStyles,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.controlStyle,callback:function(r){e.controlStyle=r},expression:"controlStyle"}})],1),t(E,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)&&e.actionOptions.length>1?[t(U,{attrs:{title:"Overwrite action button"}},[t(Le,{attrs:{items:e.actionOptions,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.actionButton,callback:function(r){e.actionButton=r},expression:"actionButton"}})],1),t(E,{staticClass:"my-2"})]:e._e(),t(U,{attrs:{title:e.$t("Settings.ControlTab.HideDuringPrint"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideDuringPrint,callback:function(r){e.hideDuringPrint=r},expression:"hideDuringPrint"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.EnableXYHoming"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.enableXYHoming,callback:function(r){e.enableXYHoming=r},expression:"enableXYHoming"}})],1),t(E,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)?[t(U,{attrs:{title:e.$t("Settings.ControlTab.InvertXMovement"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseX,callback:function(r){e.reverseX=r},expression:"reverseX"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.InvertYMovement"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseY,callback:function(r){e.reverseY=r},expression:"reverseY"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.InvertZMovement"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseZ,callback:function(r){e.reverseZ=r},expression:"reverseZ"}})],1),t(E,{staticClass:"my-2"})]:e._e(),t(U,{attrs:{title:e.$t("Settings.ControlTab.SpeedXY")}},[t(re,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",rules:[function(r){return r>0||e.$t("Settings.ControlTab.ValueGreaterThan",{value:"0"})}],outlined:"",dense:"","hide-spin-buttons":""},on:{blur:e.blurFeedrateXY},model:{value:e.feedrateXY,callback:function(r){e.feedrateXY=r},expression:"feedrateXY"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.SpeedZ")}},[t(re,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",rules:[function(r){return r>0||e.$t("Settings.ControlTab.ValueGreaterThan",{value:"0"})}],outlined:"",dense:"","hide-spin-buttons":""},on:{blur:e.blurFeedrateZ},model:{value:e.feedrateZ,callback:function(r){e.feedrateZ=r},expression:"feedrateZ"}})],1),t(E,{staticClass:"my-2"}),e.controlStyle==="cross"?[t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=9||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"9"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsAll,callback:function(r){e.stepsAll=r},expression:"stepsAll"}})],1),t(E,{staticClass:"my-2"})]:e.controlStyle==="circle"?[t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=4||e.$t("Settings.ControlTab.MaximumValues",{maximum:"4"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsCircleXY,callback:function(r){e.stepsCircleXY=r},expression:"stepsCircleXY"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=4||e.$t("Settings.ControlTab.MaximumValues",{maximum:"4"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsCircleZ,callback:function(r){e.stepsCircleZ=r},expression:"stepsCircleZ"}})],1),t(E,{staticClass:"my-2"})]:[t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=3||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"3"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsXY,callback:function(r){e.stepsXY=r},expression:"stepsXY"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=3||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"3"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsZ,callback:function(r){e.stepsZ=r},expression:"stepsZ"}})],1),t(E,{staticClass:"my-2"})],t(U,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetSaveOption"),"sub-title":e.$t("Settings.ControlTab.ZOffsetSaveOptionDescription")}},[t(Le,{staticClass:"mt-0",attrs:{items:e.offsetZSaveOptions,"hide-details":"",outlined:"",dense:""},model:{value:e.offsetZSaveOption,callback:function(r){e.offsetZSaveOption=r},expression:"offsetZSaveOption"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetIncrements"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=4||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"4"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.offsetsZ,callback:function(r){e.offsetsZ=r},expression:"offsetsZ"}})],1),t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiPrinter3dNozzle))]),t(vt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Headline"))+" ")]),t(E,{staticClass:"ml-3"})],1),t(U,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesEInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=5||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"5"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.feedamountsE,callback:function(r){e.feedamountsE=r},expression:"feedamountsE"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.SpeedEInMms"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[function(r){return r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"})},function(r){return r.length<=5||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"5"})}],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.feedratesE,callback:function(r){e.feedratesE=r},expression:"feedratesE"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ControlTab.EstimatedExtrusionInfo"),"sub-title":e.$t("Settings.ControlTab.EstimatedExtrusionInfoDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.showEstimatedExtrusionInfo,callback:function(r){e.showEstimatedExtrusionInfo=r},expression:"showEstimatedExtrusionInfo"}})],1)],2)],1)],1)},NB=[];const Bv={};var VB=N(_h,jB,NB,!1,UB,null,null,null);function UB(e){for(let s in Bv)this[s]=Bv[s]}const BB=function(){return VB.exports}();var WB=Object.defineProperty,GB=Object.getOwnPropertyDescriptor,km=(e,s,t,r)=>{for(var i=r>1?void 0:r?GB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&WB(s,t,i),i};let Kn=class extends j(V){constructor(){super(...arguments),this.mdiFilter=cP,this.mdiFilterOff=uP,this.mdiPencil=xt,this.mdiDelete=Ye,this.mdiConsoleLine=ua,this.form={bool:!1,valid:!1,name:"",regex:"",id:null},this.rules={required:s=>s!==""||"required",unique:s=>!this.existsPresetName(s)||"Name already exists"},this.consoleHeightTmp=300}mounted(){this.consoleHeightTmp=this.consoleHeight}get consoleFilters(){var s;return(s=this.$store.getters["gui/console/getConsolefilters"])!=null?s:[]}get availableDirections(){return[{text:this.$t("Settings.ConsoleTab.DirectionTable"),value:"table"},{text:this.$t("Settings.ConsoleTab.DirectionShell"),value:"shell"}]}get consoleDirection(){var s;return(s=this.$store.state.gui.console.direction)!=null?s:"table"}set consoleDirection(s){this.$store.dispatch("gui/console/saveSetting",{name:"direction",value:s})}get availableEntryStyles(){return[{text:this.$t("Settings.ConsoleTab.EntryStyleDefault"),value:"default"},{text:this.$t("Settings.ConsoleTab.EntryStyleCompact"),value:"compact"}]}get entryStyle(){var s;return(s=this.$store.state.gui.console.entryStyle)!=null?s:"default"}set entryStyle(s){this.$store.dispatch("gui/console/saveSetting",{name:"entryStyle",value:s})}get consoleHeight(){var s;return(s=this.$store.state.gui.console.height)!=null?s:300}set consoleHeight(s){this.$store.dispatch("gui/console/saveSetting",{name:"height",value:s})}consoleHeightChanged(s){this.consoleHeightTmp=s}updateConsoleHeight(s){this.consoleHeight=s}get hideWaitTemperatures(){return this.$store.state.gui.console.hideWaitTemperatures}set hideWaitTemperatures(s){this.$store.dispatch("gui/console/saveSetting",{name:"hideWaitTemperatures",value:s})}get hideTimelapse(){return this.$store.state.gui.console.hideTlCommands}set hideTimelapse(s){this.$store.dispatch("gui/console/saveSetting",{name:"hideTlCommands",value:s})}existsPresetName(s){return this.consoleFilters.findIndex(t=>t.name===s&&t.id!==this.form.id)>=0}clearForm(){this.form.bool=!1,this.form.id=null,this.form.name="",this.form.regex=""}toggleFilter(s){const t={name:s.name,bool:!s.bool,regex:s.regex};this.$store.dispatch("gui/console/filterUpdate",{id:s.id,values:t})}createFilter(){this.clearForm(),this.form.bool=!0}editFilter(s){this.form.name=s.name,this.form.id=s.id,this.form.regex=s.regex,this.form.bool=!0}saveFilter(){if(this.form.valid){const s={name:this.form.name,bool:this.form.bool,regex:this.form.regex};this.form.id?this.$store.dispatch("gui/console/filterUpdate",{id:this.form.id,values:s}):this.$store.dispatch("gui/console/filterStore",{values:s}),this.clearForm()}}deleteFilter(s){this.$store.dispatch("gui/console/filterDelete",s)}};km([me("consoleHeight")],Kn.prototype,"consoleHeightChanged",1);km([Ze(500)],Kn.prototype,"updateConsoleHeight",1);Kn=km([O({components:{SettingsRow:U}})],Kn);var zB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.form.bool?t(De,{attrs:{flat:""}},[t(Lr,{on:{submit:function(r){return r.preventDefault(),e.saveFilter.apply(null,arguments)}},model:{value:e.form.valid,callback:function(r){e.$set(e.form,"valid",r)},expression:"form.valid"}},[t(vt,[e._v(" "+e._s(e.form.id===null?e.$t("Settings.ConsoleTab.CreateHeadline"):e.$t("Settings.ConsoleTab.EditHeadline"))+" ")]),t(q,[t(U,{attrs:{title:e.$t("Settings.ConsoleTab.Name").toString()}},[t(re,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.unique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.Regex").toString()}},[t(Ai,{attrs:{outlined:"","hide-details":"auto"},model:{value:e.form.regex,callback:function(r){e.$set(e.form,"regex",r)},expression:"form.regex"}})],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){e.form.bool=!1}}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit"}},[e._v(" "+e._s(e.form.id===null?e.$t("Settings.ConsoleTab.StoreButton"):e.$t("Settings.ConsoleTab.UpdateButton"))+" ")])],1)],1)],1):t(De,{attrs:{flat:""}},[t(q,[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiConsoleLine))]),t(vt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Console"))+" ")]),t(E,{staticClass:"ml-3"})],1),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.Direction").toString()}},[t(Le,{attrs:{items:e.availableDirections,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.consoleDirection,callback:function(r){e.consoleDirection=r},expression:"consoleDirection"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.EntryStyle").toString()}},[t(Le,{attrs:{items:e.availableEntryStyles,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.entryStyle,callback:function(r){e.entryStyle=r},expression:"entryStyle"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.Height").toString()}},[t(Nl,{attrs:{"hide-details":"",min:200,max:900,step:10,label:e.consoleHeightTmp+"px"},on:{change:e.updateConsoleHeight},model:{value:e.consoleHeightTmp,callback:function(r){e.consoleHeightTmp=r},expression:"consoleHeightTmp"}})],1),t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiFilter))]),t(vt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Filters"))+" ")]),t(E,{staticClass:"ml-3"})],1),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.HideTemperatures").toString(),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.ConsoleTab.HideTimelapse").toString(),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideTimelapse,callback:function(r){e.hideTimelapse=r},expression:"hideTimelapse"}})],1)]:e._e(),t(E,{staticClass:"my-2"}),e._l(e.consoleFilters,function(r,i){return t("div",{key:i},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:r.name}},[t(g,{staticClass:"minwidth-0 px-2",attrs:{small:"",outlined:"",color:r.bool?"white":"grey"},on:{click:function(n){return e.toggleFilter(r)}}},[t(v,{attrs:{small:""}},[e._v(e._s(r.bool?e.mdiFilter:e.mdiFilterOff))])],1),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editFilter(r)}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deleteFilter(r.id)}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)})],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createFilter}},[e._v(e._s(e.$t("Settings.ConsoleTab.AddFilter")))])],1)],1)],1)},ZB=[];const Wv={};var qB=N(Kn,zB,ZB,!1,XB,null,null,null);function XB(e){for(let s in Wv)this[s]=Wv[s]}const YB=function(){return qB.exports}();var JB=Object.defineProperty,KB=Object.getOwnPropertyDescriptor,K2=(e,s,t,r)=>{for(var i=r>1?void 0:r?KB(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&JB(s,t,i),i};let al=class extends j(V){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye}get subTitle(){let e=[];return Object.keys(this.preset.values).forEach(s=>{const t=this.preset.values[s];if(t.bool){const r=s.indexOf(" ")?s.slice(s.indexOf(" ")+1):s;e.push(gt(r)+": "+t.value+"°C")}}),this.preset.gcode&&e.push(this.$t("Settings.PresetsTab.CustomGCode").toString()),e.join(", ")}editPreset(){this.$emit("edit",this.preset)}deletePreset(){this.$store.dispatch("gui/presets/delete",this.preset.id)}};K2([k({required:!0})],al.prototype,"preset",2);al=K2([O({components:{SettingsRow:U}})],al);var QB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(U,{attrs:{title:e.preset.name,"sub-title":e.subTitle}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.editPreset}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:e.deletePreset}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)},eW=[];const Gv={};var tW=N(al,QB,eW,!1,sW,null,null,null);function sW(e){for(let s in Gv)this[s]=Gv[s]}const Q2=function(){return tW.exports}();var rW=Object.defineProperty,iW=Object.getOwnPropertyDescriptor,nW=(e,s,t,r)=>{for(var i=r>1?void 0:r?iW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&rW(s,t,i),i};let bh=class extends j(V){constructor(){super(...arguments),this.mdiPencil=xt}editCooldown(){this.$emit("edit")}};bh=nW([O({components:{SettingsRow:U}})],bh);var aW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(U,{attrs:{title:e.$t("Settings.PresetsTab.Cooldown")}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.editCooldown}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1)],1)},oW=[];const zv={};var lW=N(bh,aW,oW,!1,cW,null,null,null);function cW(e){for(let s in zv)this[s]=zv[s]}const eC=function(){return lW.exports}();var uW=Object.defineProperty,dW=Object.getOwnPropertyDescriptor,tC=(e,s,t,r)=>{for(var i=r>1?void 0:r?dW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&uW(s,t,i),i};let ol=class extends j(V){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.valid=!1,this.boolInvalidMin=!1,this.rules={required:e=>e!==""||this.$t("Settings.PresetsTab.ErrorNameRequired"),unique:e=>!this.existsPresetName(e)||this.$t("Settings.PresetsTab.ErrorNameNotUnique"),invalid:e=>parseFloat(e)>=0||this.$t("Settings.PresetsTab.ErrorInvalidValue")}}get title(){return this.preset.id===null?this.$t("Settings.PresetsTab.CreateHeadline"):this.$t("Settings.PresetsTab.EditHeadline")}get storeButtonText(){return this.preset.id===null?this.$t("Settings.PresetsTab.StoreButton"):this.$t("Settings.PresetsTab.UpdateButton")}get presets(){var e;return(e=this.$store.getters["gui/presets/getPresets"])!=null?e:[]}get available_heaters(){var e,s,t;return((t=(s=(e=this.$store.state.printer)==null?void 0:e.heaters)==null?void 0:s.available_heaters)!=null?t:[]).sort()}get available_temperature_fans(){var e,s,t;return((t=(s=(e=this.$store.state.printer)==null?void 0:e.heaters)==null?void 0:s.available_sensors)!=null?t:[]).filter(r=>r.startsWith("temperature_fan ")).sort()}mounted(){const e=Object.keys(this.preset.values);this.available_heaters.filter(s=>!e.includes(s)).forEach(s=>{this.preset.values[s]={bool:!1,type:"heater",value:0}}),this.available_temperature_fans.filter(s=>!e.includes(s)).forEach(s=>{this.preset.values[s]={bool:!1,type:"temperature_fan",value:0}}),e.filter(s=>!this.available_heaters.includes(s)&&!this.available_temperature_fans.includes(s)).forEach(s=>{delete this.preset.values[s]})}existsPresetName(e){return this.presets.findIndex(s=>s.name===e&&s.id!==this.preset.id)!==-1}converNameObject(e){return gt(e.replace("temperature_fan ",""))}closeForm(){this.$emit("close")}savePreset(){let e=0;for(const s of Object.keys(this.preset.values))this.preset.values[s].bool&&e++;if(this.preset.gcode.length&&e++,e===0){this.boolInvalidMin=!0;return}if(this.preset.id===null){this.$store.dispatch("gui/presets/store",{values:this.preset}),this.closeForm();return}this.$store.dispatch("gui/presets/update",{id:this.preset.id,values:this.preset}),this.closeForm()}};tC([k({required:!0})],ol.prototype,"preset",2);ol=tC([O({components:{SettingsRow:U}})],ol);var hW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(Lr,{on:{submit:function(r){return r.preventDefault(),e.savePreset.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(vt,[e._v(e._s(e.title))]),t(q,[e.boolInvalidMin?t(S,{staticClass:"mt-3"},[t(_,{staticClass:"py-0"},[t(dt,{attrs:{dense:"",text:"",type:"error"}},[e._v(e._s(e.$t("Settings.PresetsTab.PresetInfo")))])],1)],1):e._e(),t(U,{attrs:{title:e.$t("Settings.PresetsTab.Name")}},[t(re,{attrs:{placeholder:e.$t("Settings.PresetsTab.PresetNamePlaceholder"),"hide-details":"auto",rules:[e.rules.required,e.rules.unique],dense:"",outlined:""},model:{value:e.preset.name,callback:function(r){e.$set(e.preset,"name",r)},expression:"preset.name"}})],1),e._l(e.preset.values,function(r,i){return t("div",{key:i},[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.converNameObject(i)}},[t(we,{staticClass:"shrink mt-0",attrs:{"hide-details":""},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"value.bool"}}),t(re,{attrs:{"hide-details":"auto",rules:[e.rules.invalid],type:"number",suffix:"°C",dense:"",outlined:"","hide-spin-buttons":""},on:{focus:function(n){return n.target.select()}},model:{value:r.value,callback:function(n){e.$set(r,"value",n)},expression:"value.value"}})],1)],1)}),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(Ai,{attrs:{outlined:"","hide-details":""},model:{value:e.preset.gcode,callback:function(r){e.$set(e.preset,"gcode",r)},expression:"preset.gcode"}})],1)],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.valid}},[e._v(" "+e._s(e.storeButtonText)+" ")])],1)],1)],1)},pW=[];const Zv={};var mW=N(ol,hW,pW,!1,fW,null,null,null);function fW(e){for(let s in Zv)this[s]=Zv[s]}const sC=function(){return mW.exports}();var gW=Object.defineProperty,vW=Object.getOwnPropertyDescriptor,_W=(e,s,t,r)=>{for(var i=r>1?void 0:r?vW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&gW(s,t,i),i};let yh=class extends j(V){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.boolForm=!1,this.boolFormCooldown=!1,this.formPreset={}}get presets(){var s;return(s=this.$store.getters["gui/presets/getPresets"])!=null?s:[]}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}createPreset(){this.formPreset.id=null,this.formPreset.name="",this.formPreset.values={},this.formPreset.gcode="",this.boolForm=!0}edit(s){this.formPreset={...s},this.boolForm=!0}};yh=_W([O({components:{PresetsForm:sC,PresetsEntryCooldown:eC,PresetsEntry:Q2,SettingsRow:U}})],yh);var bW=Object.defineProperty,yW=Object.getOwnPropertyDescriptor,rC=(e,s,t,r)=>{for(var i=r>1?void 0:r?yW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&bW(s,t,i),i};let ll=class extends j(V){constructor(){super(...arguments),this.mdiPencil=xt,this.mdiDelete=Ye,this.gcode=""}mounted(){this.gcode=this.inputGcode}closeForm(){this.$emit("close")}saveCooldown(){this.$store.dispatch("gui/presets/saveSetting",{name:"cooldownGcode",value:this.gcode}),this.closeForm()}};rC([k({required:!0})],ll.prototype,"inputGcode",2);ll=rC([O({components:{SettingsRow:U}})],ll);var CW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(Lr,{on:{submit:function(r){return r.preventDefault(),e.saveCooldown.apply(null,arguments)}}},[t(vt,[e._v(e._s(e.$t("Settings.PresetsTab.EditCooldown")))]),t(q,[t(U,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(Ai,{attrs:{outlined:"","hide-details":""},model:{value:e.gcode,callback:function(r){e.gcode=r},expression:"gcode"}})],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit"}},[e._v(" "+e._s(e.$t("Settings.PresetsTab.UpdateCooldown"))+" ")])],1)],1)],1)},$W=[];const qv={};var xW=N(ll,CW,$W,!1,wW,null,null,null);function wW(e){for(let s in qv)this[s]=qv[s]}const SW=function(){return xW.exports}();var PW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?t(sC,{attrs:{preset:e.formPreset},on:{close:function(r){e.boolForm=!1}}}):e.boolFormCooldown?t(SW,{attrs:{"input-gcode":e.cooldownGcode},on:{close:function(r){e.boolFormCooldown=!1}}}):t(De,{attrs:{flat:""}},[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.PresetsTab.PreheatPresets")))]),e._l(e.presets,function(r,i){return t("div",{key:r.index},[i?t(E,{staticClass:"my-2"}):e._e(),t(Q2,{attrs:{preset:r},on:{edit:e.edit}})],1)}),e.presets.length?t(E,{staticClass:"my-2"}):e._e(),t(eC,{on:{edit:function(r){e.boolFormCooldown=!0}}})],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPreset}},[e._v(e._s(e.$t("Settings.PresetsTab.AddPreset")))])],1)],1)],1)},TW=[];const Xv={};var DW=N(yh,PW,TW,!1,MW,null,null,null);function MW(e){for(let s in Xv)this[s]=Xv[s]}const EW=function(){return DW.exports}();var OW=Object.defineProperty,LW=Object.getOwnPropertyDescriptor,kW=(e,s,t,r)=>{for(var i=r>1?void 0:r?LW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&OW(s,t,i),i};let Ch=class extends j(V){constructor(){super(...arguments),this.mdiCheckboxMarkedCircle=Vb,this.mdiCancel=jb,this.mdiPencil=xt,this.mdiDelete=Ye,this.mdiAlertOutline=Sn,this.form={bool:!1,hostname:"",port:7125,id:null,namespace:null}}get printers(){var s;return(s=this.$store.getters["gui/remoteprinters/getRemoteprinters"])!=null?s:[]}get canAddPrinters(){return this.$store.state.instancesDB!=="json"}get protocol(){var s;return(s=this.$store.state.socket.protocol)!=null?s:"ws"}formatPrinterName(s){return s.hostname+(s.port!==80?":"+s.port:"")}createPrinter(){this.form.hostname="",this.form.port=7125,this.form.id=null,this.form.namespace=null,this.form.bool=!0}storePrinter(){const s={hostname:this.form.hostname,port:this.form.port};this.$store.dispatch("gui/remoteprinters/store",{values:s}),this.form.hostname="",this.form.port=7125,this.form.id=null,this.form.bool=!1}editPrinter(s){var t;this.form.id=(t=s.id)!=null?t:null,this.form.hostname=s.hostname,this.form.port=s.port,this.form.bool=!0}updatePrinter(){const s={hostname:this.form.hostname,port:this.form.port};this.$store.dispatch("gui/remoteprinters/update",{id:this.form.id,values:s}),this.form.id=null,this.form.hostname="",this.form.port=7125,this.form.bool=!1}delPrinter(s){this.$store.dispatch("gui/remoteprinters/delete",s)}};Ch=kW([O({components:{SettingsRow:U}})],Ch);var AW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.form.bool?t(De,{attrs:{flat:""}},[t(vt,[e._v(" "+e._s(e.form.id!==null?e.$t("Settings.RemotePrintersTab.EditPrinter"):e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")]),t(q,[t(U,{attrs:{title:e.$t("Settings.RemotePrintersTab.Hostname")}},[t(re,{attrs:{rules:[function(r){return!!r||"Hostname is required"},function(r){return!r.startsWith("http:")||"invalid hostname/IP"},function(r){return!r.startsWith("https:")||"invalid hostname/IP"}],"hide-details":"auto",required:"",dense:"",outlined:""},model:{value:e.form.hostname,callback:function(r){e.$set(e.form,"hostname",r)},expression:"form.hostname"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.RemotePrintersTab.Port")}},[t(re,{attrs:{rules:[function(r){return!!r||"Port is required"}],"hide-details":"auto",required:"",dense:"",outlined:""},model:{value:e.form.port,callback:function(r){e.$set(e.form,"port",r)},expression:"form.port"}})],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){e.form.bool=!1}}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id===null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.storePrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.updatePrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.UpdatePrinter"))+" ")])],1)],1):t(De,{attrs:{flat:""}},[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.RemotePrintersTab.RemotePrinters")))]),e.canAddPrinters?e._e():t(dt,{attrs:{icon:e.mdiAlertOutline,type:"warning",text:""}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.UseConfigJson"))+" ")]),e._l(e.printers,function(r,i){return t("div",{key:r.id},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:e.formatPrinterName(r),loading:r.socket.isConnecting,icon:r.socket.isConnected?e.mdiCheckboxMarkedCircle:e.mdiCancel}},[t(g,{attrs:{small:"",outlined:"",disabled:!e.canAddPrinters},on:{click:function(n){return e.editPrinter(r)}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error",disabled:!e.canAddPrinters},on:{click:function(n){return e.delPrinter(r.id)}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)})],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary",disabled:!e.canAddPrinters},on:{click:e.createPrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")])],1)],1)],1)},FW=[];const Yv={};var RW=N(Ch,AW,FW,!1,IW,null,null,null);function IW(e){for(let s in Yv)this[s]=Yv[s]}const HW=function(){return RW.exports}();var jW=Object.defineProperty,NW=Object.getOwnPropertyDescriptor,Vc=(e,s,t,r)=>{for(var i=r>1?void 0:r?NW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&jW(s,t,i),i};let Ti=class extends j(V){constructor(){super(...arguments),this.mdiRestart=jr,this.mdiTimerOutline=WP,this.defaultLogoColor=$n,this.defaultPrimaryColor=pp,this.defaultBigThumbnailBackground=zt}get theme(){return this.$store.state.gui.uiSettings.theme}set theme(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.theme",value:s})}get themes(){return[{text:this.$t("Settings.UiSettingsTab.ThemeDark"),value:"dark"},{text:this.$t("Settings.UiSettingsTab.ThemeLight"),value:"light"}]}get logoColor(){return this.$store.state.gui.uiSettings.logo}set logoColor(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.logo",value:s})}get primaryColor(){return this.$store.state.gui.uiSettings.primary}set primaryColor(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.primary",value:s})}get boolBigThumbnail(){return this.$store.state.gui.uiSettings.boolBigThumbnail}set boolBigThumbnail(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolBigThumbnail",value:s})}get bigThumbnailBackground(){return this.$store.state.gui.uiSettings.bigThumbnailBackground}set bigThumbnailBackground(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.bigThumbnailBackground",value:s})}get displayCancelPrint(){return this.$store.state.gui.uiSettings.displayCancelPrint}set displayCancelPrint(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.displayCancelPrint",value:s})}get confirmOnEmergencyStop(){return this.$store.state.gui.uiSettings.confirmOnEmergencyStop}set confirmOnEmergencyStop(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnEmergencyStop",value:s})}get confirmOnPowerDeviceChange(){return this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange}set confirmOnPowerDeviceChange(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnPowerDeviceChange",value:s})}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}set lockSliders(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.lockSlidersOnTouchDevices",value:s})}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}set lockSlidersDelay(s){s>=0&&this.$store.dispatch("gui/saveSetting",{name:"uiSettings.lockSlidersDelay",value:s})}get boolWideNavDrawer(){var s;return(s=this.$store.state.gui.uiSettings.boolWideNavDrawer)!=null?s:!1}get navigationStyleSetting(){return this.$store.state.gui.uiSettings.navigationStyle}set navigationStyleSetting(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.navigationStyle",value:s})}get navigationStyles(){return[{text:this.$t("Settings.UiSettingsTab.NavigationStyleIconsOnly"),value:"iconsOnly"},{text:this.$t("Settings.UiSettingsTab.NavigationStyleIconsAndText"),value:"iconsAndText"}]}get defaultNavigationStateSetting(){return this.$store.state.gui.uiSettings.defaultNavigationStateSetting}set defaultNavigationStateSetting(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.defaultNavigationStateSetting",value:s})}get defaultNavigationStateSettings(){return[{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateAlwaysOpen"),value:"alwaysOpen"},{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateAlwaysClosed"),value:"alwaysClosed"},{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateLastState"),value:"lastState"}]}get boolHideUploadAndPrintButton(){var s;return(s=this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton)!=null?s:!1}set boolHideUploadAndPrintButton(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolHideUploadAndPrintButton",value:s})}get powerDevices(){var s;return(s=this.$store.getters["server/power/getDevices"])!=null?s:[]}get autoPowerDevice(){const s=this.powerDevices.findIndex(t=>t.device==="printer");return s===-1?"--":this.powerDevices[s].device}get powerDeviceName(){var s;return(s=this.$store.state.gui.uiSettings.powerDeviceName)!=null?s:null}set powerDeviceName(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.powerDeviceName",value:s})}get powerDeviceOptions(){const s=[{text:"Auto (".concat(this.autoPowerDevice,")"),value:null}];return this.powerDevices.forEach(t=>{s.push({text:"".concat(t.device," (").concat(t.type,")"),value:t.device.toString()})}),s}get hideSaveConfigForBedMash(){var s;return(s=this.$store.state.gui.uiSettings.hideSaveConfigForBedMash)!=null?s:!1}set hideSaveConfigForBedMash(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.hideSaveConfigForBedMash",value:s})}get disableFanAnimation(){var s;return(s=this.$store.state.gui.uiSettings.disableFanAnimation)!=null?s:!1}set disableFanAnimation(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.disableFanAnimation",value:s})}get boolManualProbeDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolManualProbeDialog)!=null?s:!0}set boolManualProbeDialog(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolManualProbeDialog",value:s})}get boolBedScrewsDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolBedScrewsDialog)!=null?s:!0}set boolBedScrewsDialog(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolBedScrewsDialog",value:s})}get boolScrewsTiltAdjustDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog)!=null?s:!0}set boolScrewsTiltAdjustDialog(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolScrewsTiltAdjustDialog",value:s})}get tempchartHeight(){var s;return(s=this.$store.state.gui.uiSettings.tempchartHeight)!=null?s:250}set tempchartHeight(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.tempchartHeight",value:s})}get hideUpdateWarnings(){var s;return(s=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?s:!1}set hideUpdateWarnings(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.hideUpdateWarnings",value:s})}clearColorObject(s){return typeof s=="object"&&"hex"in s&&(s=s.hex),s.length>7&&(s=s.substr(0,7)),s}updateLogoColor(s){this.logoColor=this.clearColorObject(s)}updatePrimaryColor(s){this.primaryColor=this.clearColorObject(s)}updateBigThumbnailBackground(s){this.bigThumbnailBackground=this.clearColorObject(s)}};Vc([Ze(500)],Ti.prototype,"updateLogoColor",1);Vc([Ze(500)],Ti.prototype,"updatePrimaryColor",1);Vc([Ze(500)],Ti.prototype,"updateBigThumbnailBackground",1);Ti=Vc([O({components:{SettingsRow:U}})],Ti);var VW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{attrs:{flat:""}},[t(q,[t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.Theme"),"sub-title":e.$t("Settings.UiSettingsTab.ThemeDescription")}},[t(Le,{staticClass:"mt-0",attrs:{items:e.themes,"hide-details":"",outlined:"",dense:""},model:{value:e.theme,callback:function(r){e.theme=r},expression:"theme"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.Logo")}},[e.logoColor.toLowerCase()!==e.defaultLogoColor.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.logoColor=e.defaultLogoColor}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t($e,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.logoColor,small:""}},"v-btn",n,!1),i))]}}])},[t(ss,{attrs:{value:e.logoColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateLogoColor}})],1)],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.Primary")}},[e.primaryColor.toLowerCase()!==e.defaultPrimaryColor.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.primaryColor=e.defaultPrimaryColor}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t($e,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.primaryColor,small:""}},"v-btn",n,!1),i))]}}])},[t(ss,{attrs:{value:e.primaryColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updatePrimaryColor}})],1)],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.GcodeThumbnails"),"sub-title":e.$t("Settings.UiSettingsTab.GcodeThumbnailsDescription"),"dynamic-slot-width":!0}},[t(g,{attrs:{outlined:"",small:"",color:"primary",href:"https://docs.mainsail.xyz/overview/features/thumbnails",target:"_blank"}},[e._v(" "+e._s(e.$t("Settings.UiSettingsTab.Guide"))+" ")])],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolBigThumbnail"),"sub-title":e.$t("Settings.UiSettingsTab.BoolBigThumbnailDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBigThumbnail,callback:function(r){e.boolBigThumbnail=r},expression:"boolBigThumbnail"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.BigThumbnailBackground")}},[e.bigThumbnailBackground.toLowerCase()!==e.defaultBigThumbnailBackground.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.bigThumbnailBackground=e.defaultBigThumbnailBackground}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t($e,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.bigThumbnailBackground,small:""}},"v-btn",n,!1),i))]}}])},[t(ss,{attrs:{value:e.bigThumbnailBackground,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateBigThumbnailBackground}})],1)],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINT"),"sub-title":e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.displayCancelPrint,callback:function(r){e.displayCancelPrint=r},expression:"displayCancelPrint"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.LockSliders"),"sub-title":e.$t("Settings.UiSettingsTab.LockSlidersDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.lockSliders,callback:function(r){e.lockSliders=r},expression:"lockSliders"}})],1),t(E,{staticClass:"my-2"}),t(jl,[t(U,{directives:[{name:"show",rawName:"v-show",value:e.lockSliders,expression:"lockSliders"}],attrs:{title:e.$t("Settings.UiSettingsTab.LockSlidersDelay"),"sub-title":e.$t("Settings.UiSettingsTab.LockSlidersDelayDescription"),"dynamic-slot-width":!0}},[t(re,{staticClass:"mt-0",style:e.isMobile?{"max-width":"140px"}:{},attrs:{"prepend-icon":e.mdiTimerOutline,label:"Timeout",type:"number",rules:[function(r){return r>=0}],min:"0",step:"0.5",suffix:"s","hide-details":"",outlined:"",dense:"","hide-spin-buttons":""},model:{value:e.lockSlidersDelay,callback:function(r){e.lockSlidersDelay=r},expression:"lockSlidersDelay"}})],1)],1),t(E,{directives:[{name:"show",rawName:"v-show",value:e.lockSliders,expression:"lockSliders"}],staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStop"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnEmergencyStop,callback:function(r){e.confirmOnEmergencyStop=r},expression:"confirmOnEmergencyStop"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChange"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnPowerDeviceChange,callback:function(r){e.confirmOnPowerDeviceChange=r},expression:"confirmOnPowerDeviceChange"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.NavigationStyle"),"sub-title":e.$t("Settings.UiSettingsTab.NavigationStyleDescription")}},[t(Le,{staticClass:"mt-0",attrs:{items:e.navigationStyles,"hide-details":"",outlined:"",dense:""},model:{value:e.navigationStyleSetting,callback:function(r){e.navigationStyleSetting=r},expression:"navigationStyleSetting"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.DefaultNavigationState"),"sub-title":e.$t("Settings.UiSettingsTab.DefaultNavigationStateDescription")}},[t(Le,{staticClass:"mt-0",attrs:{items:e.defaultNavigationStateSettings,"hide-details":"",outlined:"",dense:""},model:{value:e.defaultNavigationStateSetting,callback:function(r){e.defaultNavigationStateSetting=r},expression:"defaultNavigationStateSetting"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButton"),"sub-title":e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolHideUploadAndPrintButton,callback:function(r){e.boolHideUploadAndPrintButton=r},expression:"boolHideUploadAndPrintButton"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.PowerDeviceName"),"sub-title":e.$t("Settings.UiSettingsTab.PowerDeviceNameDescription"),"dynamic-slot-width":!0}},[t(Le,{staticClass:"mt-0",attrs:{items:e.powerDeviceOptions,"hide-details":"",outlined:"",dense:""},model:{value:e.powerDeviceName,callback:function(r){e.powerDeviceName=r},expression:"powerDeviceName"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh"),"sub-title":e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideSaveConfigForBedMash,callback:function(r){e.hideSaveConfigForBedMash=r},expression:"hideSaveConfigForBedMash"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.DisableFanAnimation"),"sub-title":e.$t("Settings.UiSettingsTab.DisableFanAnimationDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.disableFanAnimation,callback:function(r){e.disableFanAnimation=r},expression:"disableFanAnimation"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.ManualProbeDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ManualProbeDialogDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolManualProbeDialog,callback:function(r){e.boolManualProbeDialog=r},expression:"boolManualProbeDialog"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.BedScrewsDialog"),"sub-title":e.$t("Settings.UiSettingsTab.BedScrewsDialogDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBedScrewsDialog,callback:function(r){e.boolBedScrewsDialog=r},expression:"boolBedScrewsDialog"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolScrewsTiltAdjustDialog,callback:function(r){e.boolScrewsTiltAdjustDialog=r},expression:"boolScrewsTiltAdjustDialog"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.TempchartHeight"),"sub-title":e.$t("Settings.UiSettingsTab.TempchartHeightDescription")}},[t(Nl,{attrs:{"hide-details":"",min:100,max:500,step:1,label:e.tempchartHeight+"px"},model:{value:e.tempchartHeight,callback:function(r){e.tempchartHeight=r},expression:"tempchartHeight"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.UiSettingsTab.HideUpdateWarnings"),"sub-title":e.$t("Settings.UiSettingsTab.HideUpdateWarningsDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideUpdateWarnings,callback:function(r){e.hideUpdateWarnings=r},expression:"hideUpdateWarnings"}})],1)],1)],1)],1)},UW=[];const Jv={};var BW=N(Ti,VW,UW,!1,WW,null,null,null);function WW(e){for(let s in Jv)this[s]=Jv[s]}const GW=function(){return BW.exports}();var zW=Object.defineProperty,ZW=Object.getOwnPropertyDescriptor,Am=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZW(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&zW(s,t,i),i};let Qn=class extends j(Is){constructor(){super(...arguments),this.mdiInformation=At,this.mdiDragVertical=zl}get panelname(){return this.getPanelName(this.name)}get icon(){return this.convertPanelnameToIcon(this.name)}get checkboxColor(){return this.visible?"primary":"grey lighten-1"}get checkboxIcon(){return this.visible?fp:mp}};Am([k({type:String,required:!0})],Qn.prototype,"name",2);Am([k({type:Boolean,required:!0})],Qn.prototype,"visible",2);Qn=Am([O({components:{draggable:Ui}})],Qn);var qW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(K,[t(S,[t(_,{staticClass:"col-auto px-0"},[t(v,{staticClass:"handle pr-2"},[e._v(e._s(e.mdiDragVertical))]),t(v,[e._v(e._s(e.icon))])],1),t(_,{staticClass:"pr-0 text-truncate"},[e._v(" "+e._s(e.panelname)+" ")]),t(_,{staticClass:"col-auto pl-2"},[t(v,{attrs:{color:e.checkboxColor},domProps:{innerHTML:e._s(e.checkboxIcon)},on:{click:function(r){return r.stopPropagation(),e.$emit("change-visible",e.name,!e.visible)}}})],1)],1)],1)},XW=[];const Kv={};var YW=N(Qn,qW,XW,!1,JW,"bd581aaa",null,null);function JW(e){for(let s in Kv)this[s]=Kv[s]}const KW=function(){return YW.exports}();var QW=Object.defineProperty,eG=Object.getOwnPropertyDescriptor,Fm=(e,s,t,r)=>{for(var i=r>1?void 0:r?eG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&QW(s,t,i),i};let ea=class extends j(Is){constructor(){super(...arguments),this.mdiInformation=At,this.mdiLock=fP}get layoutname(){return this.column?"".concat(this.viewportName,"Layout").concat(this.column):"".concat(this.viewportName,"Layout")}get groupname(){return"".concat(this.viewportName,"Viewport")}get layout(){return this.$store.getters["gui/getPanels"](this.viewportName,this.column)}set layout(s){s=s.filter(t=>t!==void 0),this.$store.dispatch("gui/saveSetting",{name:"dashboard.".concat(this.layoutname),value:s})}changeVisible(s,t){const r=this.layout.findIndex(i=>i.name===s);r!==-1&&(this.layout[r].visible=t,this.$store.dispatch("gui/saveSetting",{name:"dashboard.".concat(this.layoutname),value:this.layout}))}};Fm([k({type:String,required:!0})],ea.prototype,"viewportName",2);Fm([k({type:Number,required:!1,default:1})],ea.prototype,"column",2);ea=Fm([O({components:{SettingsDashboardSortableItem:KW,draggable:Ui}})],ea);var tG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{staticClass:"mx-auto fill-height",attrs:{"max-width":"300",tile:""}},[t(Oe,{staticClass:"fill-height",attrs:{dense:""}},[e.column<2?t(K,[t(S,[t(_,{staticClass:"col-auto pr-0 pl-8"},[t(v,[e._v(e._s(e.mdiInformation))])],1),t(_,{staticClass:"pr-0 text-truncate"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Headline"))+" ")]),t(_,{staticClass:"col-auto pl-0"},[t(v,{attrs:{color:"grey lighten-1"}},[e._v(e._s(e.mdiLock))])],1)],1)],1):e._e(),t("draggable",{staticClass:"v-list-item-group fill-height",attrs:{handle:".handle","ghost-class":"ghost",group:e.groupname},model:{value:e.layout,callback:function(r){e.layout=r},expression:"layout"}},[t("transition-group",e._l(e.layout,function(r){return t("settings-dashboard-sortable-item",{key:"item-".concat(r.name),attrs:{name:r.name,visible:r.visible},on:{"change-visible":e.changeVisible}})}),1)],1)],1)],1)},sG=[];const Qv={};var rG=N(ea,tG,sG,!1,iG,"021a8703",null,null);function iG(e){for(let s in Qv)this[s]=Qv[s]}const Uc=function(){return rG.exports}();var nG=Object.defineProperty,aG=Object.getOwnPropertyDescriptor,oG=(e,s,t,r)=>{for(var i=r>1?void 0:r?aG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&nG(s,t,i),i};let $h=class extends j(Is){resetLayout(){this.$store.dispatch("gui/resetLayout","mobileLayout")}};$h=oG([O({components:{SettingsDashboardSortable:Uc}})],$h);var lG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(S,[t(_,[t("settings-dashboard-sortable",{attrs:{"viewport-name":"mobile",column:0}})],1)],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},cG=[];const e_={};var uG=N($h,lG,cG,!1,dG,null,null,null);function dG(e){for(let s in e_)this[s]=e_[s]}const hG=function(){return uG.exports}();var pG=Object.defineProperty,mG=Object.getOwnPropertyDescriptor,fG=(e,s,t,r)=>{for(var i=r>1?void 0:r?mG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&pG(s,t,i),i};let xh=class extends j(Is){resetLayout(){this.$store.dispatch("gui/resetLayout","tabletLayout1"),this.$store.dispatch("gui/resetLayout","tabletLayout2")}};xh=fG([O({components:{SettingsDashboardSortable:Uc}})],xh);var gG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(S,[t(_,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"tablet",column:1}})],1),t(_,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"tablet",column:2}})],1)],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},vG=[];const t_={};var _G=N(xh,gG,vG,!1,bG,null,null,null);function bG(e){for(let s in t_)this[s]=t_[s]}const yG=function(){return _G.exports}();var CG=Object.defineProperty,$G=Object.getOwnPropertyDescriptor,xG=(e,s,t,r)=>{for(var i=r>1?void 0:r?$G(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&CG(s,t,i),i};let wh=class extends j(Is){resetLayout(){this.$store.dispatch("gui/resetLayout","desktopLayout1"),this.$store.dispatch("gui/resetLayout","desktopLayout2")}};wh=xG([O({components:{SettingsDashboardSortable:Uc}})],wh);var wG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(S,[t(_,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"desktop",column:1}})],1),t(_,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"desktop",column:2}})],1)],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},SG=[];const s_={};var PG=N(wh,wG,SG,!1,TG,null,null,null);function TG(e){for(let s in s_)this[s]=s_[s]}const DG=function(){return PG.exports}();var MG=Object.defineProperty,EG=Object.getOwnPropertyDescriptor,OG=(e,s,t,r)=>{for(var i=r>1?void 0:r?EG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&MG(s,t,i),i};let Sh=class extends j(Is){resetLayout(){this.$store.dispatch("gui/resetLayout","widescreenLayout1"),this.$store.dispatch("gui/resetLayout","widescreenLayout2"),this.$store.dispatch("gui/resetLayout","widescreenLayout3")}};Sh=OG([O({components:{SettingsDashboardSortable:Uc}})],Sh);var LG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(S,[t(_,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:1}})],1),t(_,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:2}})],1),t(_,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:3}})],1)],1),t(S,[t(_,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},kG=[];const r_={};var AG=N(Sh,LG,kG,!1,FG,null,null,null);function FG(e){for(let s in r_)this[s]=r_[s]}const RG=function(){return AG.exports}();var IG=Object.defineProperty,HG=Object.getOwnPropertyDescriptor,jG=(e,s,t,r)=>{for(var i=r>1?void 0:r?HG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&IG(s,t,i),i};let Ph=class extends j(V){constructor(){super(...arguments),this.mdiCellphone=HS,this.mdiTablet=VP,this.mdiMonitorDashboard=Pp,this.mdiMonitorScreenshot=yP,this.currentViewport="desktop"}mounted(){this.isMobile?this.currentViewport="mobile":this.isTablet?this.currentViewport="tablet":this.isDesktop?this.currentViewport="desktop":this.isWidescreen?this.currentViewport="widescreen":this.currentViewport="desktop"}get currentTab(){return"settings-dashboard-tab-"+this.currentViewport}};Ph=jG([O({components:{SettingsDashboardTabMobile:hG,SettingsDashboardTabTablet:yG,SettingsDashboardTabDesktop:DG,SettingsDashboardTabWidescreen:RG}})],Ph);var NG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(De,{attrs:{flat:""}},[t(q,[t(S,[t(_,{staticClass:"text-center"},[t(ho,{staticClass:"mx-auto",attrs:{mandatory:""},model:{value:e.currentViewport,callback:function(r){e.currentViewport=r},expression:"currentViewport"}},[t(g,{attrs:{value:"mobile"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Mobile")))]),t(v,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiCellphone))]),t(v,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiCellphone))])],1),t(g,{attrs:{value:"tablet"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Tablet")))]),t(v,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiTablet))]),t(v,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiTablet))])],1),t(g,{attrs:{value:"desktop"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Desktop")))]),t(v,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiMonitorDashboard))]),t(v,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiMonitorDashboard))])],1),t(g,{attrs:{value:"widescreen"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Widescreen")))]),t(v,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiMonitorScreenshot))]),t(v,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiMonitorScreenshot))])],1)],1)],1)],1),t(S,[t(_,{staticClass:"dashboard-rows-container"},[t(e.currentTab,{tag:"component"})],1)],1)],1)],1)},VG=[];const i_={};var UG=N(Ph,NG,VG,!1,BG,"50943ad9",null,null);function BG(e){for(let s in i_)this[s]=i_[s]}const WG=function(){return UG.exports}();var GG=Object.defineProperty,zG=Object.getOwnPropertyDescriptor,Rm=(e,s,t,r)=>{for(var i=r>1?void 0:r?zG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&GG(s,t,i),i};let ta=class extends j(V){get showAxes(){return this.$store.state.gui.gcodeViewer.showAxes}set showAxes(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showAxes",value:s})}get extruderColors(){return this.$store.state.gui.gcodeViewer.extruderColors}colorsUpdated(s,t){let r=this.extruderColors;r[t]=s.hex,this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.extruderColors",value:r})}get backgroundColor(){return this.$store.state.gui.gcodeViewer.backgroundColor}set backgroundColor(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.backgroundColor",value:s})}get gridColor(){return this.$store.state.gui.gcodeViewer.gridColor}set gridColor(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.gridColor",value:s})}get progressColor(){return this.$store.state.gui.gcodeViewer.progressColor}set progressColor(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.progressColor",value:s})}updateColorValue(s,t){y.set(this,s,this.clearColorObject(t))}clearColorObject(s){return typeof s=="object"&&"hex"in s&&(s=s.hex),s.length>7&&(s=s.substr(0,7)),s}get minFeed(){return this.$store.state.gui.gcodeViewer.minFeed}set minFeed(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.minFeed",value:s})}get maxFeed(){return this.$store.state.gui.gcodeViewer.maxFeed}set maxFeed(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.maxFeed",value:s})}get minFeedColor(){return this.$store.state.gui.gcodeViewer.minFeedColor}set minFeedColor(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.minFeedColor",value:s})}get maxFeedColor(){return this.$store.state.gui.gcodeViewer.maxFeedColor}set maxFeedColor(s){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.maxFeedColor",value:s})}feedBlur(){this.minFeed<1&&(this.minFeed=1),this.maxFeed0||"Minimum speed is 1"}],dense:"","hide-details":"auto",outlined:"",suffix:"mm/s",type:"number","hide-spin-buttons":""},on:{blur:e.feedBlur},model:{value:e.minFeed,callback:function(r){e.minFeed=r},expression:"minFeed"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.GCodeViewerTab.MaxFeed")}},[t($e,{attrs:{"close-on-content-click":!1,bottom:"",left:"","offset-y":""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5 mr-3",attrs:{color:e.maxFeedColor,small:""}},"v-btn",n,!1),i))]}}])},[t(ss,{attrs:{value:e.maxFeedColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":function(r){return e.updateColorValue("maxFeedColor",r)}}})],1),t(re,{attrs:{rules:[function(r){return r>0||"Minimum speed is 1"}],dense:"","hide-details":"auto",outlined:"",suffix:"mm/s",type:"number","hide-spin-buttons":""},on:{blur:e.feedBlur},model:{value:e.maxFeed,callback:function(r){e.maxFeed=r},expression:"maxFeed"}})],1)],1)],1)],1)},qG=[];const n_={};var XG=N(ta,ZG,qG,!1,YG,null,null,null);function YG(e){for(let s in n_)this[s]=n_[s]}const JG=function(){return XG.exports}();var KG=Object.defineProperty,QG=Object.getOwnPropertyDescriptor,ez=(e,s,t,r)=>{for(var i=r>1?void 0:r?QG(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&KG(s,t,i),i};let Th=class extends j(V){constructor(){super(...arguments),this.klipperRestartMethods=[{text:"FIRMWARE_RESTART",value:"FIRMWARE_RESTART"},{text:"RESTART",value:"RESTART"}]}get tabSizes(){return[2,4,6,8].map(t=>({text:this.$t("Settings.EditorTab.Spaces",{count:t}),value:t}))}get escToClose(){return this.$store.state.gui.editor.escToClose}set escToClose(s){this.$store.dispatch("gui/saveSetting",{name:"editor.escToClose",value:s})}get confirmUnsavedChanges(){return this.$store.state.gui.editor.confirmUnsavedChanges}set confirmUnsavedChanges(s){this.$store.dispatch("gui/saveSetting",{name:"editor.confirmUnsavedChanges",value:s})}get tabSize(){return this.$store.state.gui.editor.tabSize||2}set tabSize(s){this.$store.dispatch("gui/saveSetting",{name:"editor.tabSize",value:s})}get klipperRestartMethod(){return this.$store.state.gui.editor.klipperRestartMethod}set klipperRestartMethod(s){this.$store.dispatch("gui/saveSetting",{name:"editor.klipperRestartMethod",value:s})}};Th=ez([O({components:{SettingsRow:U}})],Th);var tz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{attrs:{flat:""}},[t(q,[t(U,{attrs:{title:e.$t("Settings.EditorTab.UseEscToClose"),"sub-title":e.$t("Settings.EditorTab.UseEscToCloseDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.escToClose,callback:function(r){e.escToClose=r},expression:"escToClose"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.EditorTab.ConfirmUnsavedChanges"),"sub-title":e.$t("Settings.EditorTab.ConfirmUnsavedChangesDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmUnsavedChanges,callback:function(r){e.confirmUnsavedChanges=r},expression:"confirmUnsavedChanges"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.EditorTab.TabSize"),"sub-title":e.$t("Settings.EditorTab.TabSizeDescription"),"dynamic-slot-width":!0}},[t(Le,{attrs:{items:e.tabSizes,"hide-details":"",outlined:"",dense:"",attached:""},model:{value:e.tabSize,callback:function(r){e.tabSize=r},expression:"tabSize"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.EditorTab.KlipperRestartMethod"),"sub-title":e.$t("Settings.EditorTab.KlipperRestartMethodDescription")}},[t(Le,{attrs:{items:e.klipperRestartMethods,"hide-details":"",outlined:"",dense:"",attached:""},model:{value:e.klipperRestartMethod,callback:function(r){e.klipperRestartMethod=r},expression:"klipperRestartMethod"}})],1)],1)],1)],1)},sz=[];const a_={};var rz=N(Th,tz,sz,!1,iz,null,null,null);function iz(e){for(let s in a_)this[s]=a_[s]}const nz=function(){return rz.exports}();var az=Object.defineProperty,oz=Object.getOwnPropertyDescriptor,lz=(e,s,t,r)=>{for(var i=r>1?void 0:r?oz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&az(s,t,i),i};let Dh=class extends j(V){constructor(){super(...arguments),this.modeOptions=[{text:"layermacro",value:"layermacro"},{text:"hyperlapse",value:"hyperlapse"}],this.parkposOptions=[{text:"center",value:"center"},{text:"front_left",value:"front_left"},{text:"front_right",value:"front_right"},{text:"back_left",value:"back_left"},{text:"back_right",value:"back_right"},{text:"x_only",value:"x_only"},{text:"y_only",value:"y_only"},{text:"custom",value:"custom"}]}get cameraOptions(){const s=this.$store.getters["gui/webcams/getWebcams"],t=[];return s.filter(r=>r.snapshot_url!=="").forEach(r=>{t.push({text:r.name,value:r.name})}),$t(t,"text")}get blockedsettings(){var s;return(s=this.$store.state.server.timelapse.settings.blockedsettings)!=null?s:[]}get enabled(){return this.$store.state.server.timelapse.settings.enabled}set enabled(s){this.$store.dispatch("server/timelapse/saveSetting",{enabled:s})}get mode(){return this.$store.state.server.timelapse.settings.mode}set mode(s){this.$store.dispatch("server/timelapse/saveSetting",{mode:s})}get hyperlapseCycle(){return this.$store.state.server.timelapse.settings.hyperlapse_cycle}set hyperlapseCycle(s){this.$store.dispatch("server/timelapse/saveSetting",{hyperlapse_cycle:s})}get autorender(){return this.$store.state.server.timelapse.settings.autorender}set autorender(s){this.$store.dispatch("server/timelapse/saveSetting",{autorender:s})}get saveframes(){return this.$store.state.server.timelapse.settings.saveframes}set saveframes(s){this.$store.dispatch("server/timelapse/saveSetting",{saveframes:s})}get stream_delay_compensation(){return this.$store.state.server.timelapse.settings.stream_delay_compensation}set stream_delay_compensation(s){this.$store.dispatch("server/timelapse/saveSetting",{stream_delay_compensation:s})}get previewimage(){return this.$store.state.server.timelapse.settings.previewimage}set previewimage(s){this.$store.dispatch("server/timelapse/saveSetting",{previewimage:s})}get gcode_verbose(){return this.$store.state.server.timelapse.settings.gcode_verbose}set gcode_verbose(s){this.$store.dispatch("server/timelapse/saveSetting",{gcode_verbose:s})}get parkhead(){return this.$store.state.server.timelapse.settings.parkhead}set parkhead(s){this.$store.dispatch("server/timelapse/saveSetting",{parkhead:s})}get parkpos(){return this.$store.state.server.timelapse.settings.parkpos}set parkpos(s){this.$store.dispatch("server/timelapse/saveSetting",{parkpos:s})}get park_custom_pos_x(){return this.$store.state.server.timelapse.settings.park_custom_pos_x}set park_custom_pos_x(s){this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_x:s})}get park_custom_pos_y(){return this.$store.state.server.timelapse.settings.park_custom_pos_y}set park_custom_pos_y(s){this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_y:s})}get park_custom_pos_dz(){return this.$store.state.server.timelapse.settings.park_custom_pos_dz}set park_custom_pos_dz(s){this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_dz:s})}get park_travel_speed(){return this.$store.state.server.timelapse.settings.park_travel_speed}set park_travel_speed(s){this.$store.dispatch("server/timelapse/saveSetting",{park_travel_speed:s})}get park_retract_speed(){return this.$store.state.server.timelapse.settings.park_retract_speed}set park_retract_speed(s){this.$store.dispatch("server/timelapse/saveSetting",{park_retract_speed:s})}get park_extrude_speed(){return this.$store.state.server.timelapse.settings.park_extrude_speed}set park_extrude_speed(s){this.$store.dispatch("server/timelapse/saveSetting",{park_extrude_speed:s})}get park_retract_distance(){return this.$store.state.server.timelapse.settings.park_retract_distance}set park_retract_distance(s){this.$store.dispatch("server/timelapse/saveSetting",{park_retract_distance:s})}get park_extrude_distance(){return this.$store.state.server.timelapse.settings.park_extrude_distance}set park_extrude_distance(s){this.$store.dispatch("server/timelapse/saveSetting",{park_extrude_distance:s})}get park_time(){return this.$store.state.server.timelapse.settings.park_time}set park_time(s){this.$store.dispatch("server/timelapse/saveSetting",{park_time:s})}get fw_retract(){return this.$store.state.server.timelapse.settings.fw_retract}set fw_retract(s){this.$store.dispatch("server/timelapse/saveSetting",{fw_retract:s})}get constant_rate_factor(){return this.$store.state.server.timelapse.settings.constant_rate_factor}set constant_rate_factor(s){this.$store.dispatch("server/timelapse/saveSetting",{constant_rate_factor:s})}get output_framerate(){return this.$store.state.server.timelapse.settings.output_framerate}set output_framerate(s){this.$store.dispatch("server/timelapse/saveSetting",{output_framerate:s})}get pixelformat(){return this.$store.state.server.timelapse.settings.pixelformat}set pixelformat(s){this.$store.dispatch("server/timelapse/saveSetting",{pixelformat:s})}get extraoutputparams(){return this.$store.state.server.timelapse.settings.extraoutputparams}set extraoutputparams(s){this.$store.dispatch("server/timelapse/saveSetting",{extraoutputparams:s})}get variable_fps(){return this.$store.state.server.timelapse.settings.variable_fps}set variable_fps(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps:s})}get targetlength(){return this.$store.state.server.timelapse.settings.targetlength}set targetlength(s){this.$store.dispatch("server/timelapse/saveSetting",{targetlength:s})}get variable_fps_min(){return this.$store.state.server.timelapse.settings.variable_fps_min}set variable_fps_min(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_min:s})}get variable_fps_max(){return this.$store.state.server.timelapse.settings.variable_fps_max}set variable_fps_max(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_max:s})}get duplicatelastframe(){return this.$store.state.server.timelapse.settings.duplicatelastframe}set duplicatelastframe(s){this.$store.dispatch("server/timelapse/saveSetting",{duplicatelastframe:s})}get camera(){return this.$store.state.server.timelapse.settings.camera}set camera(s){this.$store.dispatch("server/timelapse/saveSetting",{camera:s})}get time_format_code(){return this.$store.state.server.timelapse.settings.time_format_code}set time_format_code(s){this.$store.dispatch("server/timelapse/saveSetting",{time_format_code:s})}};Dh=lz([O({components:{SettingsRow:U}})],Dh);var cz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{attrs:{flat:""}},[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.General")))]),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Enabled"),"sub-title":e.$t("Settings.TimelapseTab.EnabledDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("enabled")},model:{value:e.enabled,callback:function(r){e.enabled=r},expression:"enabled"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Autorender"),"sub-title":e.$t("Settings.TimelapseTab.AutorenderDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("autorender")},model:{value:e.autorender,callback:function(r){e.autorender=r},expression:"autorender"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Camera"),"sub-title":e.$t("Settings.TimelapseTab.CameraDescription")}},[t(Le,{attrs:{items:e.cameraOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("camera")||e.blockedsettings.includes("snapshoturl")},model:{value:e.camera,callback:function(r){e.camera=r},expression:"camera"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Mode"),"sub-title":e.$t("Settings.TimelapseTab.ModeDescription")}},[t(Le,{attrs:{items:e.modeOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("modeOptions")},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),e.mode==="hyperlapse"?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.HyperlapseCycle"),"sub-title":e.$t("Settings.TimelapseTab.HyperlapseCycleDescription")}},[t(re,{attrs:{type:"number",suffix:"s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("hyperlapseCycle"),"hide-spin-buttons":""},model:{value:e.hyperlapseCycle,callback:function(r){e.hyperlapseCycle=r},expression:"hyperlapseCycle"}})],1)]:e._e(),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.PreviewImage"),"sub-title":e.$t("Settings.TimelapseTab.PreviewImageDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("previewimage")},model:{value:e.previewimage,callback:function(r){e.previewimage=r},expression:"previewimage"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.SaveFrames"),"sub-title":e.$t("Settings.TimelapseTab.SaveFramesDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("saveframes")},model:{value:e.saveframes,callback:function(r){e.saveframes=r},expression:"saveframes"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.StreamDelayCompensation"),"sub-title":e.$t("Settings.TimelapseTab.StreamDelayCompensationDescription")}},[t(re,{attrs:{type:"number",suffix:"s",step:"0.01","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("stream_delay_compensation")},model:{value:e.stream_delay_compensation,callback:function(r){e.stream_delay_compensation=r},expression:"stream_delay_compensation"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.GcodeVerbose"),"sub-title":e.$t("Settings.TimelapseTab.GcodeVerboseDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("gcode_verbose")},model:{value:e.gcode_verbose,callback:function(r){e.gcode_verbose=r},expression:"gcode_verbose"}})],1),t(E,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.Parkhead")))]),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Parkhead"),"sub-title":e.$t("Settings.TimelapseTab.ParkheadDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("parkhead")},model:{value:e.parkhead,callback:function(r){e.parkhead=r},expression:"parkhead"}})],1),e.parkhead?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Parkpos"),"sub-title":e.$t("Settings.TimelapseTab.ParkposDescription")}},[t(Le,{attrs:{items:e.parkposOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("parkposOptions")},model:{value:e.parkpos,callback:function(r){e.parkpos=r},expression:"parkpos"}})],1),["x_only","custom"].includes(e.parkpos)?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.PosX"),"sub-title":e.$t("Settings.TimelapseTab.PosXDescription")}},[t(re,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_custom_pos_x"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_x,callback:function(r){e.park_custom_pos_x=r},expression:"park_custom_pos_x"}})],1)]:e._e(),["y_only","custom"].includes(e.parkpos)?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.PosY"),"sub-title":e.$t("Settings.TimelapseTab.PosYDescription")}},[t(re,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_custom_pos_y"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_y,callback:function(r){e.park_custom_pos_y=r},expression:"park_custom_pos_y"}})],1)]:e._e(),["x_only","y_only","custom"].includes(e.parkpos)?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.PosDZ"),"sub-title":e.$t("Settings.TimelapseTab.PosDZDescription")}},[t(re,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_custom_pos_dz"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_dz,callback:function(r){e.park_custom_pos_dz=r},expression:"park_custom_pos_dz"}})],1)]:e._e(),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.TravelSpeed"),"sub-title":e.$t("Settings.TimelapseTab.TravelSpeedDescription")}},[t(re,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_travel_speed"),"hide-spin-buttons":""},model:{value:e.park_travel_speed,callback:function(r){e.park_travel_speed=r},expression:"park_travel_speed"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.FwRetract"),"sub-title":e.$t("Settings.TimelapseTab.FwRetractDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("fw_retract")},model:{value:e.fw_retract,callback:function(r){e.fw_retract=r},expression:"fw_retract"}})],1),e.fw_retract?e._e():[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.RetractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.RetractSpeedDescription")}},[t(re,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_retract_speed"),"hide-spin-buttons":""},model:{value:e.park_retract_speed,callback:function(r){e.park_retract_speed=r},expression:"park_retract_speed"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.RetractDistance"),"sub-title":e.$t("Settings.TimelapseTab.RetractDistanceDescription")}},[t(re,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_retract_distance"),"hide-spin-buttons":""},model:{value:e.park_retract_distance,callback:function(r){e.park_retract_distance=r},expression:"park_retract_distance"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.UnretractSpeedDescription")}},[t(re,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_extrude_speed"),"hide-spin-buttons":""},model:{value:e.park_extrude_speed,callback:function(r){e.park_extrude_speed=r},expression:"park_extrude_speed"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractDistance"),"sub-title":e.$t("Settings.TimelapseTab.UnretractDistanceDescription")}},[t(re,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_extrude_distance"),"hide-spin-buttons":""},model:{value:e.park_extrude_distance,callback:function(r){e.park_extrude_distance=r},expression:"park_extrude_distance"}})],1)],t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.ParkTime"),"sub-title":e.$t("Settings.TimelapseTab.ParkTimeDescription")}},[t(re,{attrs:{type:"number",suffix:"s","hide-details":"auto",step:"0.1",outlined:"",dense:"",disabled:e.blockedsettings.includes("park_time")},model:{value:e.park_time,callback:function(r){e.park_time=r},expression:"park_time"}})],1)]:e._e(),t(E,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.RenderingOptions")))]),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFps"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsDescription"),"dynamic-slot-width":!0}},[t(Te,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("variable_fps")},model:{value:e.variable_fps,callback:function(r){e.variable_fps=r},expression:"variable_fps"}})],1),e.variable_fps?[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Targetlength"),"sub-title":e.$t("Settings.TimelapseTab.TargetlengthDescription")}},[t(re,{attrs:{type:"number",suffix:"s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("targetlength"),"hide-spin-buttons":""},model:{value:e.targetlength,callback:function(r){e.targetlength=r},expression:"targetlength"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMin"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMinDescription")}},[t(re,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("variable_fps_min"),"hide-spin-buttons":""},model:{value:e.variable_fps_min,callback:function(r){e.variable_fps_min=r},expression:"variable_fps_min"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMax"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMaxDescription")}},[t(re,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("variable_fps_max"),"hide-spin-buttons":""},model:{value:e.variable_fps_max,callback:function(r){e.variable_fps_max=r},expression:"variable_fps_max"}})],1)]:[t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.OutputFramerate"),"sub-title":e.$t("Settings.TimelapseTab.OutputFramerateDescription")}},[t(re,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("output_framerate"),"hide-spin-buttons":""},model:{value:e.output_framerate,callback:function(r){e.output_framerate=r},expression:"output_framerate"}})],1)],t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.duplicatelastframe"),"sub-title":e.$t("Settings.TimelapseTab.duplicatelastframeDescription")}},[t(re,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("duplicatelastframe"),"hide-spin-buttons":""},model:{value:e.duplicatelastframe,callback:function(r){e.duplicatelastframe=r},expression:"duplicatelastframe"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.ConstantRateFactor"),"sub-title":e.$t("Settings.TimelapseTab.ConstantRateFactorDescription")}},[t(re,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("constant_rate_factor"),"hide-spin-buttons":""},model:{value:e.constant_rate_factor,callback:function(r){e.constant_rate_factor=r},expression:"constant_rate_factor"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Pixelformat"),"sub-title":e.$t("Settings.TimelapseTab.PixelformatDescription")}},[t(re,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("pixelformat")},model:{value:e.pixelformat,callback:function(r){e.pixelformat=r},expression:"pixelformat"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.TimeFormatCode"),"sub-title":e.$t("Settings.TimelapseTab.TimeFormatCodeDescription")}},[t(re,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("time_format_code")},model:{value:e.time_format_code,callback:function(r){e.time_format_code=r},expression:"time_format_code"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.TimelapseTab.Extraoutputparams"),"sub-title":e.$t("Settings.TimelapseTab.ExtraoutputparamsDescription")}},[t(re,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("extraoutputparams")},model:{value:e.extraoutputparams,callback:function(r){e.extraoutputparams=r},expression:"extraoutputparams"}})],1)],2)],1)],1)},uz=[];const o_={};var dz=N(Dh,cz,uz,!1,hz,null,null,null);function hz(e){for(let s in o_)this[s]=o_[s]}const pz=function(){return dz.exports}();var mz=Object.defineProperty,fz=Object.getOwnPropertyDescriptor,iC=(e,s,t,r)=>{for(var i=r>1?void 0:r?fz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&mz(s,t,i),i};let cl=class extends j(wi,V,kt){constructor(){super(...arguments),this.mdiDragVertical=zl}get title(){return this.naviPoint.title}get subtitle(){var s;if(this.naviPoint.type==="link")return"URL: ".concat((s=this.naviPoint.href)!=null?s:"Unknown")}get checkboxColor(){return this.naviPoint.visible?"primary":"grey lighten-1"}get checkboxIcon(){return this.naviPoint.visible?fp:mp}changeVisibility(){this.$store.dispatch("gui/navigation/changeVisibility",this.naviPoint)}};iC([k({type:Object,required:!0})],cl.prototype,"naviPoint",2);cl=iC([O({components:{SettingsRow:U,draggable:Ui}})],cl);var gz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,{staticClass:"my-2 mx-0",style:e.draggableBgStyle},[t(_,{staticClass:"col-auto pr-0 d-flex py-2"},[t(v,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1),t(_,{staticClass:"py-2"},[t(U,{attrs:{title:e.title,"sub-title":e.subtitle,"dynamic-slot-width":!0}},[t(v,{attrs:{color:e.checkboxColor},domProps:{innerHTML:e._s(e.checkboxIcon)},on:{click:e.changeVisibility}})],1)],1)],1)},vz=[];const l_={};var _z=N(cl,gz,vz,!1,bz,null,null,null);function bz(e){for(let s in l_)this[s]=l_[s]}const nC=function(){return _z.exports}();var yz=Object.defineProperty,Cz=Object.getOwnPropertyDescriptor,$z=(e,s,t,r)=>{for(var i=r>1?void 0:r?Cz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&yz(s,t,i),i};let Mh=class extends j(wi,V,kt){get sortableNaviPoints(){return this.naviPoints.filter(s=>s.position>0)}set sortableNaviPoints(s){s.forEach((t,r)=>{var i;this.$store.dispatch("gui/navigation/updatePos",{type:t.type,title:(i=t.orgTitle)!=null?i:t.title,visible:t.visible,position:r+1})}),this.$store.dispatch("gui/navigation/upload")}};Mh=$z([O({components:{SettingsNavigationTabItem:nC,SettingsRow:U,draggable:Ui}})],Mh);var xz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.NavigationTab.Navigation")))]),t("draggable",{attrs:{handle:".handle","ghost-class":"ghost",group:"navigation-points"},model:{value:e.sortableNaviPoints,callback:function(r){e.sortableNaviPoints=r},expression:"sortableNaviPoints"}},e._l(e.sortableNaviPoints,function(r,i){return t(nC,{key:i,staticClass:"my-2 mx-0",style:e.draggableBgStyle,attrs:{"navi-point":r}})}),1)],1)],1)},wz=[];const c_={};var Sz=N(Mh,xz,wz,!1,Pz,null,null,null);function Pz(e){for(let s in c_)this[s]=c_[s]}const Tz=function(){return Sz.exports}();var Dz=Object.defineProperty,Mz=Object.getOwnPropertyDescriptor,aC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Mz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Dz(s,t,i),i};let ul=class extends j(V){constructor(){super(...arguments),this.mdiDelete=Ye,this.mdiPalette=Kl,this.mdiPencil=xt,this.convertName=gt,this.boolForm=!1,this.form={id:null,name:"",start:1,end:1},this.rules={required:e=>e!==""||"required",groupUnique:e=>!this.existsGroupName(e)||"Name already exists",minStart:e=>e>0||"smaller than 1",minEnd:e=>e>=this.form.start||"smaller than start value",max:e=>{var s,t;return e<=((t=(s=this.light)==null?void 0:s.chainCount)!=null?t:1)||"higher than chain_count"}}}get entry(){var e,s;return this.$store.getters["gui/miscellaneous/getEntry"]({type:(e=this.light)==null?void 0:e.type,name:(s=this.light)==null?void 0:s.name})}get groups(){if(!this.entry)return[];const e=[];return Object.entries(this.entry.lightgroups).forEach(([s,t])=>{e.push({name:t.name,start:t.start,end:t.end,id:s})}),window.console.log("getEntryLightgroups",e),$t(e,"name")}createGroup(){var e,s;this.form.id=null,this.form.name="",this.form.start=1,this.form.end=(s=(e=this.light)==null?void 0:e.chainCount)!=null?s:1,this.boolForm=!0}editGroup(e){var s;this.form.id=(s=e.id)!=null?s:null,this.form.name=e.name,this.form.start=e.start,this.form.end=e.end,this.boolForm=!0}closeForm(){this.boolForm=!1}storeGroup(){this.$store.dispatch("gui/miscellaneous/storeLightgroup",{entry:this.light,lightgroup:this.form}),this.boolForm=!1}updateGroup(){this.$store.dispatch("gui/miscellaneous/updateLightgroup",{entry:this.light,lightgroup:this.form}),this.boolForm=!1}deleteGroup(e){this.$store.dispatch("gui/miscellaneous/deleteLightgroup",{entry:this.light,lightgroupId:e})}existsGroupName(e){return this.groups.findIndex(s=>s.name===e&&s.id!=this.form.id)>=0}};aC([k({type:Object,default:null})],ul.prototype,"light",2);ul=aC([O({components:{SettingsRow:U}})],ul);var Ez=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.CreateGroup")))]),t(U,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(re,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.groupUnique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.MiscellaneousTab.Start").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.StartDescription").toString()}},[t(re,{attrs:{"hide-details":"auto",type:"number",step:"1",rules:[e.rules.minStart,e.rules.max],dense:"",outlined:""},model:{value:e.form.start,callback:function(r){e.$set(e.form,"start",r)},expression:"form.start"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.MiscellaneousTab.End").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.EndDescription").toString()}},[t(re,{attrs:{"hide-details":"auto",type:"number",step:"1",rules:[e.rules.minEnd,e.rules.max],dense:"",outlined:""},model:{value:e.form.end,callback:function(r){e.$set(e.form,"end",r)},expression:"form.end"}})],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id!==null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.updateGroup}},[e._v(" "+e._s(e.$t("Settings.Update"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.storeGroup}},[e._v(e._s(e.$t("Settings.Store")))])],1)]:[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.LightGroups",{name:e.light.name})))]),e.light?[e.groups.length?e._l(e.groups,function(r,i){return t("div",{key:r.id},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:r.name,"sub-title":e.$t("Settings.MiscellaneousTab.GroupSubTitle",{start:r.start,end:r.end}).toString(),"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editGroup(r)}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deleteGroup(r.id)}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)}):[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoGroupFound"))+" ")])])],1)]]:[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.UnableToLoadLight"))+" ")])])],1)]],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){return e.$emit("close")}}},[e._v(e._s(e.$t("Settings.Close")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createGroup}},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.AddGroup"))+" ")])],1)]],2)},Oz=[];const u_={};var Lz=N(ul,Ez,Oz,!1,kz,null,null,null);function kz(e){for(let s in u_)this[s]=u_[s]}const oC=function(){return Lz.exports}();var Az=Object.defineProperty,Fz=Object.getOwnPropertyDescriptor,Bc=(e,s,t,r)=>{for(var i=r>1?void 0:r?Fz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Az(s,t,i),i};let Di=class extends j(V){constructor(){super(...arguments),this.mdiDelete=Ye,this.mdiPencil=xt,this.convertName=gt,this.boolForm=!1,this.form={id:null,name:"",red:null,green:null,blue:null,white:null},this.rules={required:e=>e!==""||"required",presetUnique:e=>!this.existsPresetName(e)||"Name already exists",min:e=>e>=0||"Must be minimum 0",max:e=>e<=255||"Must be smaller then 256"}}get entry(){var e,s;return this.$store.getters["gui/miscellaneous/getEntry"]({type:(e=this.light)==null?void 0:e.type,name:(s=this.light)==null?void 0:s.name})}get presets(){if(!this.entry)return[];const e=[];return Object.entries(this.entry.presets).forEach(([s,t])=>{e.push({...t,id:s})}),window.console.log("getEntryPresets",e),$t(e,"name")}get existRed(){var e;return((e=this.light)==null?void 0:e.colorOrder.indexOf("R"))!==-1}get existGreen(){var e;return((e=this.light)==null?void 0:e.colorOrder.indexOf("G"))!==-1}get existBlue(){var e;return((e=this.light)==null?void 0:e.colorOrder.indexOf("B"))!==-1}get existWhite(){var e;return((e=this.light)==null?void 0:e.colorOrder.indexOf("W"))!==-1}get colorRGB(){var e,s,t;return"rgb(".concat(Math.round((e=this.form.red)!=null?e:0),", ").concat(Math.round((s=this.form.green)!=null?s:0),", ").concat(Math.round((t=this.form.blue)!=null?t:0),")")}get colorRGBW(){var e;return"rgba(255, 255, 255, ".concat(((e=this.form.white)!=null?e:0)/255,")")}get redInt(){var e;return Math.round((e=this.form.red)!=null?e:0)}get greenInt(){var e;return Math.round((e=this.form.green)!=null?e:0)}get blueInt(){var e;return Math.round((e=this.form.blue)!=null?e:0)}get whiteInt(){var e;return Math.round((e=this.form.white)!=null?e:0)}get colorPickerOptions(){let e={width:200,margin:15,layout:[]};return this.existRed&&(e==null||e.layout.push({component:jt.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(e==null||e.layout.push({component:jt.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(e==null||e.layout.push({component:jt.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(e.layout=[{component:jt.ui.Wheel},{component:jt.ui.Slider,options:{sliderType:"value"}}]),e}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:jt.ui.Slider,options:{sliderType:"alpha"}}]}}entryDescriptionText(e){var t,r,i,n;let s=[];return(t=this.light)!=null&&t.colorOrder.includes("R")&&s.push("R: ".concat(e.red)),(r=this.light)!=null&&r.colorOrder.includes("G")&&s.push("G: ".concat(e.green)),(i=this.light)!=null&&i.colorOrder.includes("B")&&s.push("B: ".concat(e.blue)),(n=this.light)!=null&&n.colorOrder.includes("W")&&s.push("W: ".concat(e.white)),s.join(", ")}createPreset(){var e,s,t,r;this.form.id=null,this.form.name="",this.form.red=((e=this.light)==null?void 0:e.colorOrder.indexOf("R"))!=-1?0:null,this.form.green=((s=this.light)==null?void 0:s.colorOrder.indexOf("G"))!=-1?0:null,this.form.blue=((t=this.light)==null?void 0:t.colorOrder.indexOf("B"))!=-1?0:null,this.form.white=((r=this.light)==null?void 0:r.colorOrder.indexOf("W"))!=-1?0:null,this.boolForm=!0}editPreset(e){var s,t,r,i,n;this.form.id=(s=e.id)!=null?s:null,this.form.name=e.name,this.form.red=((t=this.light)==null?void 0:t.colorOrder.indexOf("R"))!=-1?e.red:null,this.form.green=((r=this.light)==null?void 0:r.colorOrder.indexOf("G"))!=-1?e.green:null,this.form.blue=((i=this.light)==null?void 0:i.colorOrder.indexOf("B"))!=-1?e.blue:null,this.form.white=((n=this.light)==null?void 0:n.colorOrder.indexOf("W"))!=-1?e.white:null,this.boolForm=!0}closeForm(){this.boolForm=!1}storePreset(){this.$store.dispatch("gui/miscellaneous/storePreset",{entry:this.light,preset:this.form}),this.boolForm=!1}updatePreset(){this.$store.dispatch("gui/miscellaneous/updatePreset",{entry:this.light,preset:this.form}),this.boolForm=!1}deletePreset(e){this.$store.dispatch("gui/miscellaneous/deletePreset",{entry:this.light,presetId:e})}existsPresetName(e){return this.presets.findIndex(s=>s.name===e&&s.id!=this.form.id)>=0}onColorRGBChanged(e){const s={red:e.red,green:e.green,blue:e.blue,white:this.form.white};this.colorChanged(s)}onColorWhiteChanged(e){const s={red:this.form.red,green:this.form.green,blue:this.form.blue,white:this.form.white};s.white=e.alpha*255,this.colorChanged(s)}onColorInput(e){const s={red:this.form.red,green:this.form.green,blue:this.form.blue,white:this.form.white};s[e.name]=e.value,this.colorChanged(s)}colorChanged(e){this.form.red=e.red,this.form.green=e.green,this.form.blue=e.blue,this.form.white=e.white}};Bc([k({type:Object,default:null})],Di.prototype,"light",2);Bc([Ze({time:250})],Di.prototype,"onColorRGBChanged",1);Bc([Ze({time:250})],Di.prototype,"onColorWhiteChanged",1);Di=Bc([O({components:{SettingsRow:U}})],Di);var Rz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.CreatePreset")))]),t(U,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(re,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.presetUnique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(E,{staticClass:"my-2"}),t(U,{attrs:{title:e.$t("Settings.MiscellaneousTab.Color").toString()}},[t(S,[t(_,{staticClass:"text-center"},[t(Ln,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(Ln,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(_,[e.existRed?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Red"),param:"red",target:e.redInt,min:0,max:255,dec:1,step:1,"output-error-msg":!0,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existGreen?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Green"),param:"green",target:e.greenInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existBlue?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Blue"),param:"blue",target:e.blueInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existWhite?t(S,[t(_,[t(Ie,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.White"),param:"white",target:e.whiteInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e()],1)],1)],1)],1),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id!==null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.updatePreset}},[e._v(" "+e._s(e.$t("Settings.Update"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.storePreset}},[e._v(e._s(e.$t("Settings.Store")))])],1)]:[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.LightPresets",{name:e.light.name})))]),e.light?[e.presets.length?e._l(e.presets,function(r,i){return t("div",{key:r.id},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:r.name,"sub-title":e.entryDescriptionText(r),"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editPreset(r)}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deletePreset(r.id)}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)}):[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoPresetFound"))+" ")])])],1)]]:[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.UnableToLoadPreset"))+" ")])])],1)]],2),t(ne,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){return e.$emit("close")}}},[e._v(e._s(e.$t("Settings.Close")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPreset}},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.AddPreset"))+" ")])],1)]],2)},Iz=[];const d_={};var Hz=N(Di,Rz,Iz,!1,jz,null,null,null);function jz(e){for(let s in d_)this[s]=d_[s]}const lC=function(){return Hz.exports}();var Nz=Object.defineProperty,Vz=Object.getOwnPropertyDescriptor,Uz=(e,s,t,r)=>{for(var i=r>1?void 0:r?Vz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Nz(s,t,i),i};let Eh=class extends j(V){constructor(){super(...arguments),this.mdiDelete=Ye,this.mdiPalette=Kl,this.mdiPencil=xt,this.convertName=gt,this.editLightGroupObject=null,this.editLightPresetObject=null}get lights(){var s;return(s=this.$store.getters["printer/getLights"])!=null?s:[]}get filteredLights(){return this.lights.filter(s=>s.colorOrder.length>1)}};Eh=Uz([O({components:{SettingsRow:U,SettingsMiscellaneousTabLightGroups:oC,SettingsMiscellaneousTabLightPresets:lC}})],Eh);var Bz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.editLightGroupObject?t(oC,{attrs:{light:e.editLightGroupObject},on:{close:function(r){e.editLightGroupObject=null}}}):e.editLightPresetObject?t(lC,{attrs:{light:e.editLightPresetObject},on:{close:function(r){e.editLightPresetObject=null}}}):t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.Miscellaneous")))]),e.filteredLights.length?e._l(e.filteredLights,function(r,i){return t("div",{key:i},[i?t(E,{staticClass:"my-2"}):e._e(),t(U,{attrs:{title:e.convertName(r.name),"dynamic-slot-width":!0}},[r.chainCount>1?t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){e.editLightGroupObject=r}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.Groups"))+" ")],1):e._e(),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){e.editLightPresetObject=r}}},[t(v,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPalette))]),e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.Presets"))+" ")],1)],1)],1)}):[t(S,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.NoDevicesFound")))])])],1)]],2)],1)},Wz=[];const h_={};var Gz=N(Eh,Bz,Wz,!1,zz,null,null,null);function zz(e){for(let s in h_)this[s]=h_[s]}const Zz=function(){return Gz.exports}();var qz=Object.defineProperty,Xz=Object.getOwnPropertyDescriptor,cC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Xz(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&qz(s,t,i),i};let dl=class extends j(V){constructor(){super(...arguments),this.mdiGrid=ql}get availableColorSchemes(){return[{text:this.$t("Settings.HeightmapTab.Schemes.Portland")+" "+this.$t("Settings.HeightmapTab.IsDefault"),value:"portland"},{text:this.$t("Settings.HeightmapTab.Schemes.Spring"),value:"spring"},{text:this.$t("Settings.HeightmapTab.Schemes.Hot"),value:"hot"},{text:this.$t("Settings.HeightmapTab.Schemes.Hsv"),value:"hsv"},{text:this.$t("Settings.HeightmapTab.Schemes.GrayScale"),value:"grayScale"}]}get colorScheme(){return this.$store.state.gui.heightmap.activecolorscheme}set colorScheme(s){this.$store.dispatch("gui/heightmap/saveSetting",{name:"activecolorscheme",value:s})}colorSchemeChanged(s){this.colorScheme=s}};cC([me("colorScheme")],dl.prototype,"colorSchemeChanged",1);dl=cC([O({components:{Panel:Z,SettingsRow:U}})],dl);var Yz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(De,{attrs:{flat:""}},[t(q,[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGrid))]),t(vt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.HeightmapTab.Heightmap"))+" ")]),t(E,{staticClass:"ml-3"})],1),t(U,{attrs:{title:e.$t("Settings.HeightmapTab.ColorSchemes")}},[t(Le,{attrs:{items:e.availableColorSchemes,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.colorScheme,callback:function(r){e.colorScheme=r},expression:"colorScheme"}})],1)],1)],1)],1)},Jz=[];const p_={};var Kz=N(dl,Yz,Jz,!1,Qz,null,null,null);function Qz(e){for(let s in p_)this[s]=p_[s]}const eZ=function(){return Kz.exports}();var tZ=Object.defineProperty,sZ=Object.getOwnPropertyDescriptor,uC=(e,s,t,r)=>{for(var i=r>1?void 0:r?sZ(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&tZ(s,t,i),i};let hl=class extends j(V){constructor(){super(...arguments),this.showSettings=!1,this.activeTab="general",this.mdiCloseThick=Ce,this.mdiCogs=qS}get tabTitles(){const e=[{icon:Us,name:"general",title:this.$t("Settings.GeneralTab.General")},{icon:Kl,name:"ui-settings",title:this.$t("Settings.UiSettingsTab.UiSettings")},{icon:Pp,name:"dashboard",title:this.$t("Settings.DashboardTab.Dashboard")},{icon:ji,name:"webcams",title:this.$t("Settings.WebcamsTab.Webcams")},{icon:Tn,name:"macros",title:this.$t("Settings.MacrosTab.Macros")},{icon:qP,name:"control",title:this.$t("Settings.ControlTab.Control")},{icon:ua,name:"console",title:this.$t("Settings.ConsoleTab.Console")},{icon:Ri,name:"presets",title:this.$t("Settings.PresetsTab.PreheatPresets")},{icon:ha,name:"remote-printers",title:this.$t("Settings.RemotePrintersTab.RemotePrinters")},{icon:ec,name:"g-code-viewer",title:this.$t("Settings.GCodeViewerTab.GCodeViewer")},{icon:da,name:"editor",title:this.$t("Settings.EditorTab.Editor")},{icon:_p,name:"miscellaneous",title:this.$t("Settings.MiscellaneousTab.Miscellaneous")},{icon:gP,name:"navigation",title:this.$t("Settings.NavigationTab.Navigation")},{icon:ql,name:"heightmap",title:this.$t("Settings.HeightmapTab.Heightmap")}];return this.moonrakerComponents.includes("timelapse")&&e.push({icon:_0,name:"timelapse",title:this.$t("Settings.TimelapseTab.Timelapse")}),e.sort((s,t)=>{if(s.name==="general")return-1;if(t.name==="general")return 1;const r=s.title.toString().toLowerCase(),i=t.title.toString().toLowerCase();return ri?1:0})}activeTabWatch(){this.scrollToTop()}scrollToTop(){if(this.$refs.settingsScroll){const e=this.$refs.settingsScroll.osInstance();e==null||e.scroll({y:"0%"})}}};uC([me("activeTab")],hl.prototype,"activeTabWatch",1);hl=uC([O({components:{Panel:Z,SettingsUiSettingsTab:GW,SettingsRemotePrintersTab:HW,SettingsPresetsTab:EW,SettingsConsoleTab:YB,SettingsControlTab:BB,SettingsMacrosTab:FB,SettingsWebcamsTab:mB,SettingsGeneralTab:qU,SettingsDashboardTab:WG,SettingsGCodeViewerTab:JG,SettingsEditorTab:nz,SettingsTimelapseTab:pz,SettingsMiscellaneousTab:Zz,SettingsNavigationTab:Tz,SettingsHeightmapTab:eZ}})],hl);var rZ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showSettings=!0}}},[t(v,[e._v(e._s(e.mdiCogs))])],1),t(oe,{attrs:{width:"900",persistent:"",fullscreen:e.isMobile,scrollable:""},on:{keydown:function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;e.showSettings=!1}},model:{value:e.showSettings,callback:function(r){e.showSettings=r},expression:"showSettings"}},[t(Z,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("Settings.InterfaceSettings"),icon:e.mdiCogs,"card-class":"settings-menu-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showSettings=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[e.isMobile?[t(Bu,{attrs:{"center-active":!0,"show-arrows":!0},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},e._l(e.tabTitles,function(r,i){return t(mn,{key:i,staticClass:"justify-start",attrs:{href:"#"+r.name}},[t(v,{attrs:{left:""},domProps:{innerHTML:e._s(r.icon)}}),e._v(" "+e._s(r.title)+" ")],1)}),1)]:e._e(),t(S,{staticClass:"flex-row flex-nowrap"},[e.isMobile?e._e():t(_,{staticClass:"col-auto pr-0"},[t("overlay-scrollbars",{ref:"settingsTabsScroll",staticClass:"settings-tabs-bar height500"},[t(Bu,{attrs:{vertical:!0},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},e._l(e.tabTitles,function(r,i){return t(mn,{key:i,staticClass:"justify-start",staticStyle:{width:"200px"},attrs:{href:"#"+r.name}},[t(v,{attrs:{left:""},domProps:{innerHTML:e._s(r.icon)}}),t("span",{staticClass:"text-truncate"},[e._v(e._s(r.title))])],1)}),1)],1)],1),t(_,{class:e.isMobile?"":"pl-0",style:e.isMobile?"":"min-width: 500px;"},[t("overlay-scrollbars",{ref:"settingsScroll",class:"settings-tabs "+(e.isMobile?"":"height500"),attrs:{options:{overflowBehavior:{x:"hidden"}}}},[t("settings-"+e.activeTab+"-tab",{tag:"component",on:{scrollToTop:e.scrollToTop}})],1)],1)],1)],2)],1)],1)},iZ=[];const m_={};var nZ=N(hl,rZ,iZ,!1,aZ,"0df340c4",null,null);function aZ(e){for(let s in m_)this[s]=m_[s]}const dC=function(){return nZ.exports}();/*! - * vue-router v3.6.5 - * (c) 2022 Evan You - * @license MIT - */function rs(e,s){for(var t in s)e[t]=s[t];return e}var oZ=/[!'()*]/g,lZ=function(e){return"%"+e.charCodeAt(0).toString(16)},cZ=/%2C/g,Jr=function(e){return encodeURIComponent(e).replace(oZ,lZ).replace(cZ,",")};function Oh(e){try{return decodeURIComponent(e)}catch{}return e}function uZ(e,s,t){s===void 0&&(s={});var r=t||dZ,i;try{i=r(e||"")}catch{i={}}for(var n in s){var a=s[n];i[n]=Array.isArray(a)?a.map(f_):f_(a)}return i}var f_=function(e){return e==null||typeof e=="object"?e:String(e)};function dZ(e){var s={};return e=e.trim().replace(/^(\?|#|&)/,""),e&&e.split("&").forEach(function(t){var r=t.replace(/\+/g," ").split("="),i=Oh(r.shift()),n=r.length>0?Oh(r.join("=")):null;s[i]===void 0?s[i]=n:Array.isArray(s[i])?s[i].push(n):s[i]=[s[i],n]}),s}function hZ(e){var s=e?Object.keys(e).map(function(t){var r=e[t];if(r===void 0)return"";if(r===null)return Jr(t);if(Array.isArray(r)){var i=[];return r.forEach(function(n){n!==void 0&&(n===null?i.push(Jr(t)):i.push(Jr(t)+"="+Jr(n)))}),i.join("&")}return Jr(t)+"="+Jr(r)}).filter(function(t){return t.length>0}).join("&"):null;return s?"?"+s:""}var pl=/\/?$/;function ml(e,s,t,r){var i=r&&r.options.stringifyQuery,n=s.query||{};try{n=Lh(n)}catch{}var a={name:s.name||e&&e.name,meta:e&&e.meta||{},path:s.path||"/",hash:s.hash||"",query:n,params:s.params||{},fullPath:g_(s,i),matched:e?pZ(e):[]};return t&&(a.redirectedFrom=g_(t,i)),Object.freeze(a)}function Lh(e){if(Array.isArray(e))return e.map(Lh);if(e&&typeof e=="object"){var s={};for(var t in e)s[t]=Lh(e[t]);return s}else return e}var mr=ml(null,{path:"/"});function pZ(e){for(var s=[];e;)s.unshift(e),e=e.parent;return s}function g_(e,s){var t=e.path,r=e.query;r===void 0&&(r={});var i=e.hash;i===void 0&&(i="");var n=s||hZ;return(t||"/")+n(r)+i}function hC(e,s,t){return s===mr?e===s:s?e.path&&s.path?e.path.replace(pl,"")===s.path.replace(pl,"")&&(t||e.hash===s.hash&&ro(e.query,s.query)):e.name&&s.name?e.name===s.name&&(t||e.hash===s.hash&&ro(e.query,s.query)&&ro(e.params,s.params)):!1:!1}function ro(e,s){if(e===void 0&&(e={}),s===void 0&&(s={}),!e||!s)return e===s;var t=Object.keys(e).sort(),r=Object.keys(s).sort();return t.length!==r.length?!1:t.every(function(i,n){var a=e[i],o=r[n];if(o!==i)return!1;var l=s[i];return a==null||l==null?a===l:typeof a=="object"&&typeof l=="object"?ro(a,l):String(a)===String(l)})}function mZ(e,s){return e.path.replace(pl,"/").indexOf(s.path.replace(pl,"/"))===0&&(!s.hash||e.hash===s.hash)&&fZ(e.query,s.query)}function fZ(e,s){for(var t in s)if(!(t in e))return!1;return!0}function pC(e){for(var s=0;s=0&&(s=e.slice(r),e=e.slice(0,r));var i=e.indexOf("?");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{path:e,query:t,hash:s}}function rr(e){return e.replace(/\/(?:\s*\/)+/g,"/")}var fl=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"},zi=vC,bZ=Im,yZ=wZ,CZ=fC,$Z=gC,xZ=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function Im(e,s){for(var t=[],r=0,i=0,n="",a=s&&s.delimiter||"/",o;(o=xZ.exec(e))!=null;){var l=o[0],c=o[1],u=o.index;if(n+=e.slice(i,u),i=u+l.length,c){n+=c[1];continue}var d=e[i],h=o[2],p=o[3],m=o[4],f=o[5],b=o[6],C=o[7];n&&(t.push(n),n="");var w=h!=null&&d!=null&&d!==h,M=b==="+"||b==="*",H=b==="?"||b==="*",A=o[2]||a,$=m||f;t.push({name:p||r++,prefix:h||"",delimiter:A,optional:H,repeat:M,partial:w,asterisk:!!C,pattern:$?TZ($):C?".*":"[^"+io(A)+"]+?"})}return i1||!A.length)return A.length===0?s():s("span",{},A)}if(this.tag==="a")H.on=M,H.attrs={href:l,"aria-current":C};else{var $=_C(this.$slots.default);if($){$.isStatic=!1;var T=$.data=rs({},$.data);T.on=T.on||{};for(var I in T.on){var R=T.on[I];I in M&&(T.on[I]=Array.isArray(R)?R:[R])}for(var W in M)W in T.on?T.on[W].push(M[W]):T.on[W]=w;var B=$.data.attrs=rs({},$.data.attrs);B.href=l,B["aria-current"]=C}else H.on=M}return s(this.tag,H,this.$slots.default)}};function y_(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){var s=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(s))return}return e.preventDefault&&e.preventDefault(),!0}}function _C(e){if(e){for(var s,t=0;t-1&&(b.params[H]=m.params[H]);return b.path=no(w.path,b.params),h(w,b,f)}else if(b.path){b.params={};for(var A=0;A-1}function zc(e,s){return _l(e)&&e._isRouter&&(s==null||e.type===s)}function P_(e,s,t){var r=function(i){i>=e.length?t():e[i]?s(e[i],function(){r(i+1)}):r(i+1)};r(0)}function XZ(e){return function(s,t,r){var i=!1,n=0,a=null;SC(e,function(o,l,c,u){if(typeof o=="function"&&o.cid===void 0){i=!0,n++;var d=T_(function(f){JZ(f)&&(f=f.default),o.resolved=typeof f=="function"?f:gl.extend(f),c.components[u]=f,n--,n<=0&&r()}),h=T_(function(f){var b="Failed to resolve async component "+u+": "+f;a||(a=_l(f)?f:new Error(b),r(a))}),p;try{p=o(d,h)}catch(f){h(f)}if(p)if(typeof p.then=="function")p.then(d,h);else{var m=p.component;m&&typeof m.then=="function"&&m.then(d,h)}}}),i||r()}}function SC(e,s){return PC(e.map(function(t){return Object.keys(t.components).map(function(r){return s(t.components[r],t.instances[r],t,r)})}))}function PC(e){return Array.prototype.concat.apply([],e)}var YZ=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function JZ(e){return e.__esModule||YZ&&e[Symbol.toStringTag]==="Module"}function T_(e){var s=!1;return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(!s)return s=!0,e.apply(this,t)}}var us=function(s,t){this.router=s,this.base=KZ(t),this.current=mr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};us.prototype.listen=function(s){this.cb=s};us.prototype.onReady=function(s,t){this.ready?s():(this.readyCbs.push(s),t&&this.readyErrorCbs.push(t))};us.prototype.onError=function(s){this.errorCbs.push(s)};us.prototype.transitionTo=function(s,t,r){var i=this,n;try{n=this.router.match(s,this.current)}catch(o){throw this.errorCbs.forEach(function(l){l(o)}),o}var a=this.current;this.confirmTransition(n,function(){i.updateRoute(n),t&&t(n),i.ensureURL(),i.router.afterHooks.forEach(function(o){o&&o(n,a)}),i.ready||(i.ready=!0,i.readyCbs.forEach(function(o){o(n)}))},function(o){r&&r(o),o&&!i.ready&&(!zc(o,Br.redirected)||a!==mr)&&(i.ready=!0,i.readyErrorCbs.forEach(function(l){l(o)}))})};us.prototype.confirmTransition=function(s,t,r){var i=this,n=this.current;this.pending=s;var a=function(f){!zc(f)&&_l(f)&&(i.errorCbs.length?i.errorCbs.forEach(function(b){b(f)}):console.error(f)),r&&r(f)},o=s.matched.length-1,l=n.matched.length-1;if(hC(s,n)&&o===l&&s.matched[o]===n.matched[l])return this.ensureURL(),s.hash&&ir(this.router,n,s,!1),a(GZ(n,s));var c=QZ(this.current.matched,s.matched),u=c.updated,d=c.deactivated,h=c.activated,p=[].concat(tq(d),this.router.beforeHooks,sq(u),h.map(function(f){return f.beforeEnter}),XZ(h)),m=function(f,b){if(i.pending!==s)return a(S_(n,s));try{f(s,n,function(C){C===!1?(i.ensureURL(!0),a(zZ(n,s))):_l(C)?(i.ensureURL(!0),a(C)):typeof C=="string"||typeof C=="object"&&(typeof C.path=="string"||typeof C.name=="string")?(a(WZ(n,s)),typeof C=="object"&&C.replace?i.replace(C):i.push(C)):b(C)})}catch(C){a(C)}};P_(p,m,function(){var f=rq(h),b=f.concat(i.router.resolveHooks);P_(b,m,function(){if(i.pending!==s)return a(S_(n,s));i.pending=null,t(s),i.router.app&&i.router.app.$nextTick(function(){pC(s)})})})};us.prototype.updateRoute=function(s){this.current=s,this.cb&&this.cb(s)};us.prototype.setupListeners=function(){};us.prototype.teardown=function(){this.listeners.forEach(function(s){s()}),this.listeners=[],this.current=mr,this.pending=null};function KZ(e){if(!e)if(wa){var s=document.querySelector("base");e=s&&s.getAttribute("href")||"/",e=e.replace(/^https?:\/\/[^\/]+/,"")}else e="/";return e.charAt(0)!=="/"&&(e="/"+e),e.replace(/\/$/,"")}function QZ(e,s){var t,r=Math.max(e.length,s.length);for(t=0;t0)){var i=this.router,n=i.options.scrollBehavior,a=nr&&n;a&&this.listeners.push(xC());var o=function(){var l=r.current,c=pn(r.base);r.current===mr&&c===r._startLocation||r.transitionTo(c,function(u){a&&ir(i,u,l,!0)})};window.addEventListener("popstate",o),this.listeners.push(function(){window.removeEventListener("popstate",o)})}},s.prototype.go=function(r){window.history.go(r)},s.prototype.push=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(c){vl(rr(a.base+c.fullPath)),ir(a.router,c,l,!1),i&&i(c)},n)},s.prototype.replace=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(c){Fh(rr(a.base+c.fullPath)),ir(a.router,c,l,!1),i&&i(c)},n)},s.prototype.ensureURL=function(r){if(pn(this.base)!==this.current.fullPath){var i=rr(this.base+this.current.fullPath);r?vl(i):Fh(i)}},s.prototype.getCurrentLocation=function(){return pn(this.base)},s}(us);function pn(e){var s=window.location.pathname,t=s.toLowerCase(),r=e.toLowerCase();return e&&(t===r||t.indexOf(rr(r+"/"))===0)&&(s=s.slice(e.length)),(s||"/")+window.location.search+window.location.hash}var MC=function(e){function s(t,r,i){e.call(this,t,r),!(i&&nq(this.base))&&D_()}return e&&(s.__proto__=e),s.prototype=Object.create(e&&e.prototype),s.prototype.constructor=s,s.prototype.setupListeners=function(){var r=this;if(!(this.listeners.length>0)){var i=this.router,n=i.options.scrollBehavior,a=nr&&n;a&&this.listeners.push(xC());var o=function(){var c=r.current;D_()&&r.transitionTo(ao(),function(u){a&&ir(r.router,u,c,!0),nr||oo(u.fullPath)})},l=nr?"popstate":"hashchange";window.addEventListener(l,o),this.listeners.push(function(){window.removeEventListener(l,o)})}},s.prototype.push=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(c){M_(c.fullPath),ir(a.router,c,l,!1),i&&i(c)},n)},s.prototype.replace=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(c){oo(c.fullPath),ir(a.router,c,l,!1),i&&i(c)},n)},s.prototype.go=function(r){window.history.go(r)},s.prototype.ensureURL=function(r){var i=this.current.fullPath;ao()!==i&&(r?M_(i):oo(i))},s.prototype.getCurrentLocation=function(){return ao()},s}(us);function nq(e){var s=pn(e);if(!/^\/#/.test(s))return window.location.replace(rr(e+"/#"+s)),!0}function D_(){var e=ao();return e.charAt(0)==="/"?!0:(oo("/"+e),!1)}function ao(){var e=window.location.href,s=e.indexOf("#");return s<0?"":(e=e.slice(s+1),e)}function Rh(e){var s=window.location.href,t=s.indexOf("#"),r=t>=0?s.slice(0,t):s;return r+"#"+e}function M_(e){nr?vl(Rh(e)):window.location.hash=e}function oo(e){nr?Fh(Rh(e)):window.location.replace(Rh(e))}var aq=function(e){function s(t,r){e.call(this,t,r),this.stack=[],this.index=-1}return e&&(s.__proto__=e),s.prototype=Object.create(e&&e.prototype),s.prototype.constructor=s,s.prototype.push=function(r,i,n){var a=this;this.transitionTo(r,function(o){a.stack=a.stack.slice(0,a.index+1).concat(o),a.index++,i&&i(o)},n)},s.prototype.replace=function(r,i,n){var a=this;this.transitionTo(r,function(o){a.stack=a.stack.slice(0,a.index).concat(o),i&&i(o)},n)},s.prototype.go=function(r){var i=this,n=this.index+r;if(!(n<0||n>=this.stack.length)){var a=this.stack[n];this.confirmTransition(a,function(){var o=i.current;i.index=n,i.updateRoute(a),i.router.afterHooks.forEach(function(l){l&&l(a,o)})},function(o){zc(o,Br.duplicated)&&(i.index=n)})}},s.prototype.getCurrentLocation=function(){var r=this.stack[this.stack.length-1];return r?r.fullPath:"/"},s.prototype.ensureURL=function(){},s}(us),He=function(s){s===void 0&&(s={}),this.app=null,this.apps=[],this.options=s,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=RZ(s.routes||[],this);var t=s.mode||"hash";switch(this.fallback=t==="history"&&!nr&&s.fallback!==!1,this.fallback&&(t="hash"),wa||(t="abstract"),this.mode=t,t){case"history":this.history=new DC(this,s.base);break;case"hash":this.history=new MC(this,s.base,this.fallback);break;case"abstract":this.history=new aq(this,s.base);break}},EC={currentRoute:{configurable:!0}};He.prototype.match=function(s,t,r){return this.matcher.match(s,t,r)};EC.currentRoute.get=function(){return this.history&&this.history.current};He.prototype.init=function(s){var t=this;if(this.apps.push(s),s.$once("hook:destroyed",function(){var a=t.apps.indexOf(s);a>-1&&t.apps.splice(a,1),t.app===s&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=s;var r=this.history;if(r instanceof DC||r instanceof MC){var i=function(a){var o=r.current,l=t.options.scrollBehavior,c=nr&&l;c&&"fullPath"in a&&ir(t,a,o,!1)},n=function(a){r.setupListeners(),i(a)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen(function(a){t.apps.forEach(function(o){o._route=a})})}};He.prototype.beforeEach=function(s){return Um(this.beforeHooks,s)};He.prototype.beforeResolve=function(s){return Um(this.resolveHooks,s)};He.prototype.afterEach=function(s){return Um(this.afterHooks,s)};He.prototype.onReady=function(s,t){this.history.onReady(s,t)};He.prototype.onError=function(s){this.history.onError(s)};He.prototype.push=function(s,t,r){var i=this;if(!t&&!r&&typeof Promise<"u")return new Promise(function(n,a){i.history.push(s,n,a)});this.history.push(s,t,r)};He.prototype.replace=function(s,t,r){var i=this;if(!t&&!r&&typeof Promise<"u")return new Promise(function(n,a){i.history.replace(s,n,a)});this.history.replace(s,t,r)};He.prototype.go=function(s){this.history.go(s)};He.prototype.back=function(){this.go(-1)};He.prototype.forward=function(){this.go(1)};He.prototype.getMatchedComponents=function(s){var t=s?s.matched?s:this.resolve(s).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(r){return Object.keys(r.components).map(function(i){return r.components[i]})})):[]};He.prototype.resolve=function(s,t,r){t=t||this.history.current;var i=Nm(s,t,r,this),n=this.match(i,t),a=n.redirectedFrom||n.fullPath,o=this.history.base,l=oq(o,a,this.mode);return{location:i,route:n,href:l,normalizedTo:i,resolved:n}};He.prototype.getRoutes=function(){return this.matcher.getRoutes()};He.prototype.addRoute=function(s,t){this.matcher.addRoute(s,t),this.history.current!==mr&&this.history.transitionTo(this.history.getCurrentLocation())};He.prototype.addRoutes=function(s){this.matcher.addRoutes(s),this.history.current!==mr&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(He.prototype,EC);var OC=He;function Um(e,s){return e.push(s),function(){var t=e.indexOf(s);t>-1&&e.splice(t,1)}}function oq(e,s,t){var r=t==="hash"?"#"+s:s;return e?rr(e+"/"+r):r}He.install=kh;He.version="3.6.5";He.isNavigationFailure=zc;He.NavigationFailureType=Br;He.START_LOCATION=mr;wa&&window.Vue&&window.Vue.use(He);y.use(OC);const sa=new OC({mode:"history",routes:B2});var lq=Object.defineProperty,cq=Object.getOwnPropertyDescriptor,uq=(e,s,t,r)=>{for(var i=r>1?void 0:r?cq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&lq(s,t,i),i};let Ih=class extends j(V){constructor(){super(...arguments),this.mdiChevronDown=Vs}get displayMenuPoint(){return this.instancesDB!=="moonraker"&&this.countPrinters>1||this.instancesDB==="moonraker"&&this.countPrinters}get printers(){return this.$store.getters["farm/getPrinters"]}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get currentPage(){return this.$route.fullPath}switchToPrinters(){sa.push("/allPrinters")}getPrinterName(e){return this.$store.getters["farm/"+e+"/getPrinterName"]}getPrinterDescription(e){return this.$store.getters["farm/"+e._namespace+"/getStatus"]}changePrinter(e){e.socket.isConnected&&this.$store.dispatch("changePrinter",{printer:e._namespace})}};Ih=uq([O],Ih);var dq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($e,{attrs:{bottom:"","offset-x":!0},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({staticClass:"nav-arrow right"},"v-icon",n,!1),i),[e._v(e._s(e.mdiChevronDown))])]}}])},[t(Oe,{attrs:{dense:""}},e._l(e.printers,function(r){return t(K,{key:r._namespace,attrs:{"two-line":"",disabled:!r.socket.isConnected,link:""},on:{click:function(i){return e.changePrinter(r)}}},[t(Gt,[t(rt,[e._v(e._s(e.getPrinterName(r._namespace)))]),t(up,[e._v(e._s(e.getPrinterDescription(r)))])],1)],1)}),1)],1)},hq=[];const E_={};var pq=N(Ih,dq,hq,!1,mq,null,null,null);function mq(e){for(let s in E_)this[s]=E_[s]}const LC=function(){return pq.exports}();var fq=Object.defineProperty,gq=Object.getOwnPropertyDescriptor,Zc=(e,s,t,r)=>{for(var i=r>1?void 0:r?gq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&fq(s,t,i),i};let Ei=class extends j(V){constructor(){super(...arguments),this.mdiClose=ca,this.mdiLinkVariant=t0,this.mdiBellOffOutline=FS,this.expand=!1}get formatedText(){return this.entry.description.replace(/(\bhttps?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gim,'
$1')}get alertColor(){return this.entry.priority==="critical"?"error":this.entry.priority==="high"?"warning":"info"}get entryType(){const e=this.entry.id.indexOf("/");return e===-1?"":this.entry.id.slice(0,e)}close(){this.$store.dispatch("gui/notifications/close",{id:this.entry.id})}dismiss(e,s){this.$store.dispatch("gui/notifications/dismiss",{id:this.entry.id,type:e,time:s})}parentStateUpdate(e){e||(this.expand=!1)}};Zc([k({required:!0})],Ei.prototype,"entry",2);Zc([k({default:!0})],Ei.prototype,"parentState",2);Zc([me("parentState")],Ei.prototype,"parentStateUpdate",1);Ei=Zc([O({components:{}})],Ei);var vq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(dt,{class:"notification-menu-entry--priority-".concat(e.entry.priority),attrs:{text:"",color:e.alertColor,border:"left"}},[t(S,{attrs:{align:"start"}},[t(_,{staticClass:"grow"},[t("div",{staticClass:"notification-menu-entry__headline mb-1 text-subtitle-1"},["url"in e.entry?[t("a",{class:"text-decoration-none ".concat(e.alertColor,"--text"),attrs:{href:e.entry.url,target:"_blank"}},[t(v,{class:"".concat(e.alertColor,"--text pb-1"),attrs:{small:""}},[e._v(" "+e._s(e.mdiLinkVariant)+" ")]),e._v(" "+e._s(e.entry.title)+" ")],1)]:[t("span",{class:"".concat(e.alertColor,"--text")},[e._v(e._s(e.entry.title))])]],2),t("p",{staticClass:"notification-menu-entry__description text-body-2 mb-0 text--disabled font-weight-light",domProps:{innerHTML:e._s(e.formatedText)}})]),e.entry.priority!=="critical"?t(_,{staticClass:"shrink pl-0 pb-0 pt-1 pr-2 d-flex flex-column align-self-stretch justify-space-between"},[e.entryType==="announcement"?t(g,{staticClass:"mb-2",attrs:{icon:"",plain:"",color:e.alertColor},on:{click:e.close}},[t(v,[e._v(e._s(e.mdiClose))])],1):t(g,{staticClass:"mb-2",attrs:{icon:"",plain:"",color:e.alertColor},on:{click:function(r){return e.dismiss("reboot",null)}}},[t(v,[e._v(e._s(e.mdiClose))])],1),t(le),t(g,{staticClass:"pb-1",attrs:{icon:"",plain:"","retain-focus-on-click":"",color:e.alertColor},on:{click:function(r){e.expand=!e.expand}}},[t(v,[e._v(e._s(e.mdiBellOffOutline))])],1)],1):e._e()],1),e.entry.priority!=="critical"?t(S,[t(jl,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}],staticClass:"pt-1",staticStyle:{width:"100%"}},[t(E,{staticClass:"pb-1 ml-2"}),t("div",{staticClass:"text-right py-1",staticStyle:{"font-size":"0.875rem"}},[t("span",{staticClass:"text--disabled text-caption font-weight-light"},[e._v(" "+e._s(e.$t("App.Notifications.Remind"))+" ")]),e.entryType==="announcement"?[t(g,{staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:function(r){return e.dismiss("time",60*60)}}},[e._v(" 1H ")]),t(g,{staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:function(r){return e.dismiss("time",60*60*24)}}},[e._v(" 1D ")]),t(g,{staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:function(r){return e.dismiss("time",60*60*24*7)}}},[e._v(" 7D ")])]:[t(g,{staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:function(r){return e.dismiss("reboot",null)}}},[e._v(" "+e._s(e.$t("App.Notifications.NextReboot"))+" ")]),t(g,{staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:e.close}},[e._v(" "+e._s(e.$t("App.Notifications.Never"))+" ")])]],2)],1)])],1):e._e()],1)},_q=[];const O_={};var bq=N(Ei,vq,_q,!1,yq,"43cc0975",null,null);function yq(e){for(let s in O_)this[s]=O_[s]}const kC=function(){return bq.exports}();var Cq=Object.defineProperty,$q=Object.getOwnPropertyDescriptor,xq=(e,s,t,r)=>{for(var i=r>1?void 0:r?$q(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Cq(s,t,i),i};let Hh=class extends j(V){constructor(){super(...arguments),this.mdiBell=AS,this.mdiBellOutline=RS,this.mdiCloseBoxMultipleOutline=zS,this.boolMenu=!1}get notifications(){var e;return(e=this.$store.getters["gui/notifications/getNotifications"])!=null?e:[]}get existsCriticalAnnouncements(){return this.notifications.filter(e=>e.priority==="critical").length>0}get existsHighAnnouncements(){return this.notifications.filter(e=>e.priority==="high").length>0}get countNormalAnnouncements(){return this.notifications.filter(e=>e.priority==="normal").length}get colorBadge(){return this.existsCriticalAnnouncements?"error":this.existsHighAnnouncements?"warning":"primary"}dismissAll(){this.notifications.forEach(async e=>{e.id.startsWith("announcement")?await this.$store.dispatch("gui/notifications/close",{id:e.id}):await this.$store.dispatch("gui/notifications/dismiss",{id:e.id,type:"reboot",time:null})})}};Hh=xq([O({components:{NotificationMenuEntry:kC}})],Hh);var wq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($e,{attrs:{bottom:"",left:!e.isMobile,"offset-y":"","close-on-click":!0,"close-on-content-click":!1,origin:"center center",transition:"slide-y-transition","min-width":e.isMobile?"100%":null},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({staticClass:"minwidth-0",attrs:{icon:"",tile:""}},"v-btn",n,!1),i),[t($b,{attrs:{content:e.notifications.length<=9?e.notifications.length:"9+",value:e.notifications.length>0,color:e.colorBadge,overlap:""}},[t(v,[e._v(e._s(n["aria-expanded"]==="false"?e.mdiBellOutline:e.mdiBell))])],1)],1)]}}]),model:{value:e.boolMenu,callback:function(r){e.boolMenu=r},expression:"boolMenu"}},[t(De,{attrs:{flat:"","min-width":300,"max-width":e.isMobile?null:400}},[e.notifications.length?[t("overlay-scrollbars",{staticClass:"announcement-menu__scrollbar"},[t(q,[e._l(e.notifications,function(r,i){return[t(kC,{key:r.id,class:i1?[t(E),t(ne,[t(le),t(g,{staticClass:"mr-2",attrs:{text:"",color:"primary"},on:{click:e.dismissAll}},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiCloseBoxMultipleOutline))]),e._v(" "+e._s(e.$t("App.Notifications.DismissAll"))+" ")],1)],1)]:e._e()]:[t(q,{staticClass:"text-center"},[t("span",{staticClass:"text-disabled"},[e._v(e._s(e.$t("App.Notifications.NoNotification")))])])]],2)],1)},Sq=[];const L_={};var Pq=N(Hh,wq,Sq,!1,Tq,"af5e252a",null,null);function Tq(e){for(let s in L_)this[s]=L_[s]}const AC=function(){return Pq.exports}();var Dq=Object.defineProperty,Mq=Object.getOwnPropertyDescriptor,Eq=(e,s,t,r)=>{for(var i=r>1?void 0:r?Mq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Dq(s,t,i),i};let jh=class extends j(V){constructor(){super(...arguments),this.mdiAlertOctagonOutline=MS,this.mdiContentSave=vp,this.mdiFileUpload=Yb,this.mdiClose=ca,this.mdiCloseThick=Ce,this.topbarHeight=fn,this.showEmergencyStopDialog=!1,this.uploadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,cancelTokenSource:null,lastProgress:{time:0,loaded:0}},this.formatFilesize=it}get gcodeInputFileAccept(){return this.isIOS?[]:ci}get naviDrawer(){return this.$store.state.naviDrawer}set naviDrawer(e){this.$store.dispatch("setNaviDrawer",e)}get currentPage(){return this.$route.fullPath}get saveConfigPending(){var e,s;return(s=(e=this.$store.state.printer.configfile)==null?void 0:e.save_config_pending)!=null?s:!1}get hideSaveConfigForBedMash(){var e;return(e=this.$store.state.gui.uiSettings.hideSaveConfigForBedMash)!=null?e:!1}get showSaveConfigButton(){var s,t;if(!this.klipperReadyForGui)return!1;if(!this.hideSaveConfigForBedMash)return this.saveConfigPending;let e=Object.keys((t=(s=this.$store.state.printer.configfile)==null?void 0:s.save_config_pending_items)!=null?t:{});return e=e.filter(r=>!r.startsWith("bed_mesh ")),e.length>0}get printerName(){return this.$store.state.gui.general.printername.length?this.$store.state.gui.general.printername:this.$store.state.printer.hostname}get boolWideNavDrawer(){var e;return(e=this.$store.state.gui.uiSettings.boolWideNavDrawer)!=null?e:!1}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get boolHideUploadAndPrintButton(){var e;return(e=this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton)!=null?e:!1}get sidebarLogo(){return this.$store.getters["files/getSidebarLogo"]}get logoColor(){return this.$store.state.gui.uiSettings.logo}get boolShowUploadAndPrint(){return this.klippyIsConnected&&this.existGcodesRootDirectory&&["standby","complete","cancelled"].includes(this.printer_state)&&!this.boolHideUploadAndPrintButton}get defaultNavigationStateSetting(){var e,s,t;return(t=(s=(e=this.$store.state.gui)==null?void 0:e.uiSettings)==null?void 0:s.defaultNavigationStateSetting)!=null?t:"alwaysOpen"}mounted(){var e;switch(this.defaultNavigationStateSetting){case"alwaysClosed":this.naviDrawer=!1;break;case"lastState":this.naviDrawer=((e=localStorage.getItem("naviDrawer"))!=null?e:"true")==="true";break;default:this.naviDrawer=this.$vuetify.breakpoint.lgAndUp}}btnEmergencyStop(){if(this.$store.state.gui.uiSettings.confirmOnEmergencyStop){this.showEmergencyStopDialog=!0;return}this.emergencyStop()}emergencyStop(){this.showEmergencyStopDialog=!1,this.$socket.emit("printer.emergency_stop",{},{loading:"topbarEmergencyStop"})}saveConfig(){this.$store.dispatch("server/addEvent",{message:"SAVE_CONFIG",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"SAVE_CONFIG"},{loading:"topbarSaveConfig"})}btnUploadAndStart(){this.$refs.fileUploadAndStart.click()}async uploadAndStart(){var e,s;if((e=this.$refs.fileUploadAndStart)!=null&&e.files.length){await this.$store.dispatch("socket/addLoading",{name:"btnUploadAndStart"});let t=[];for(const r of((s=this.$refs.fileUploadAndStart)==null?void 0:s.files)||[]){const i=await this.doUploadAndStart(r);t.push(i)}await this.$store.dispatch("socket/removeLoading",{name:"btnUploadAndStart"});for(const r of t){const i=this.$t("App.TopBar.UploadOfFileSuccessful",{file:r}).toString();this.$toast.success(i)}this.$refs.fileUploadAndStart.value="",this.currentPage!=="/"&&await this.$router.push("/")}}doUploadAndStart(e){const s=new FormData,t=e.name;return this.uploadSnackbar.filename=t,this.uploadSnackbar.status=!0,this.uploadSnackbar.percent=0,this.uploadSnackbar.speed=0,this.uploadSnackbar.lastProgress.loaded=0,this.uploadSnackbar.lastProgress.time=0,s.append("file",e,t),s.append("print","true"),new Promise(r=>{this.uploadSnackbar.cancelTokenSource=Es.CancelToken.source(),Es.post(this.apiUrl+"/server/files/upload",s,{cancelToken:this.uploadSnackbar.cancelTokenSource.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:i=>{if(this.uploadSnackbar.percent=i.loaded*100/i.total,this.uploadSnackbar.lastProgress.time){const n=i.timeStamp-this.uploadSnackbar.lastProgress.time,a=i.loaded-this.uploadSnackbar.lastProgress.loaded;n&&(this.uploadSnackbar.speed=a/(n/1e3))}this.uploadSnackbar.lastProgress.time=i.timeStamp,this.uploadSnackbar.lastProgress.loaded=i.loaded,this.uploadSnackbar.total=i.total}}).then(i=>{this.uploadSnackbar.status=!1,r(i.data.result)}).catch(()=>{this.uploadSnackbar.status=!1,this.$store.dispatch("socket/removeLoading",{name:"btnUploadAndStart"});const i=this.$t("App.TopBar.CannotUploadTheFile").toString();this.$toast.error(i)})})}cancelUpload(){this.uploadSnackbar.cancelTokenSource.cancel(),this.uploadSnackbar.status=!1}};jh=Eq([O({components:{Panel:Z,TheSettingsMenu:dC,TheTopCornerMenu:z2,PrinterSelector:LC,MainsailLogo:Ni,TheNotificationMenu:AC}})],jh);var Oq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(sw,{staticClass:"topbar pa-0",attrs:{app:"","elevate-on-scroll":"",height:e.topbarHeight,"clipped-left":""}},[t(rw,{attrs:{tile:""},on:{click:function(r){r.stopPropagation(),e.naviDrawer=!e.naviDrawer}}}),t("router-link",{attrs:{to:"/"}},[e.sidebarLogo?[t("img",{staticClass:"nav-logo ml-4 mr-1 d-none d-sm-flex",staticStyle:{height:"32px"},attrs:{src:e.sidebarLogo,alt:"Logo"}})]:[t(Ni,{staticClass:"nav-logo ml-4 mr-1 d-none d-sm-flex",staticStyle:{height:"32px"},attrs:{color:e.logoColor,router:"",to:"/",ripple:!1}})]],2),t(ki,{staticClass:"text-no-wrap ml-0 pl-2 mr-2"},[e._v(e._s(e.printerName))]),e.countPrinters?t(LC):e._e(),t(le),t("input",{ref:"fileUploadAndStart",staticStyle:{display:"none"},attrs:{type:"file",accept:e.gcodeInputFileAccept.join(", ")},on:{change:e.uploadAndStart}}),e.showSaveConfigButton?t(g,{staticClass:"button-min-width-auto px-3 d-none d-sm-flex save-config-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"primary",disabled:e.printerIsPrinting,loading:e.loadings.includes("topbarSaveConfig")},on:{click:e.saveConfig}},[t(v,{staticClass:"d-md-none"},[e._v(e._s(e.mdiContentSave))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.SAVE_CONFIG")))])],1):e._e(),e.boolShowUploadAndPrint?t(g,{staticClass:"button-min-width-auto px-3 d-none d-sm-flex upload-and-start-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"primary",loading:e.loadings.includes("btnUploadAndStart")},on:{click:e.btnUploadAndStart}},[t(v,{staticClass:"mr-md-2"},[e._v(e._s(e.mdiFileUpload))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.UploadPrint")))])],1):e._e(),e.klippyIsConnected?t(g,{staticClass:"button-min-width-auto px-3 emergency-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"error",loading:e.loadings.includes("topbarEmergencyStop")},on:{click:e.btnEmergencyStop}},[t(v,{staticClass:"mr-md-2"},[e._v(e._s(e.mdiAlertOctagonOutline))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.EmergencyStop")))])],1):e._e(),t(AC),t(dC),t(z2)],1),t(oi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function(r){var i=r.attrs;return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelUpload}},"v-btn",i,!1),[t(v,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.uploadSnackbar.status,callback:function(r){e.$set(e.uploadSnackbar,"status",r)},expression:"uploadSnackbar.status"}},[t("strong",[e._v(e._s(e.$t("App.TopBar.Uploading"))+" "+e._s(e.uploadSnackbar.filename))]),t("br"),e._v(" "+e._s(Math.round(e.uploadSnackbar.percent))+" % @ "+e._s(e.formatFilesize(Math.round(e.uploadSnackbar.speed)))+"/s "),t("br"),t(bs,{staticClass:"mt-2",attrs:{value:e.uploadSnackbar.percent}})],1),t(oe,{attrs:{width:"400",fullscreen:e.isMobile},model:{value:e.showEmergencyStopDialog,callback:function(r){e.showEmergencyStopDialog=r},expression:"showEmergencyStopDialog"}},[t(Z,{attrs:{title:e.$t("EmergencyStopDialog.EmergencyStop"),"toolbar-color":"error","card-class":"emergency-stop-dialog",icon:e.mdiAlertOctagonOutline,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showEmergencyStopDialog=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e._v(e._s(e.$t("EmergencyStopDialog.AreYouSure")))]),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:function(r){e.showEmergencyStopDialog=!1}}},[e._v(e._s(e.$t("EmergencyStopDialog.No")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.emergencyStop}},[e._v(e._s(e.$t("EmergencyStopDialog.Yes")))])],1)],1)],1)],1)},Lq=[];const k_={};var kq=N(jh,Oq,Lq,!1,Aq,"569ec1a4",null,null);function Aq(e){for(let s in k_)this[s]=k_[s]}const FC=function(){return kq.exports}();var Fq=Object.defineProperty,Rq=Object.getOwnPropertyDescriptor,RC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Rq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Fq(s,t,i),i};let bl=class extends j(V){constructor(){super(...arguments),this.mdiUpdate=pa,this.headers=[{text:"Date",value:"date",width:"1%",dateType:"Date"},{text:"Message",sortable:!1,value:"message",width:"99%"}]}get application(){var e;return(e=this.$store.state.server.updateManager.updateResponse.application)!=null?e:""}get messages(){var e;return(e=this.$store.state.server.updateManager.updateResponse.messages)!=null?e:[]}get complete(){var e;return(e=this.$store.state.server.updateManager.updateResponse.complete)!=null?e:!0}customSort(e,s,t){return e.sort((r,i)=>{if(s[0]==="date")return t[0]?new Date(r[s]).getTime()-new Date(i[s]).getTime():new Date(i[s]).getTime()-new Date(r[s]).getTime();if(typeof r[s]<"u")return t[0]?i[s].toLowerCase().localeCompare(r[s].toLowerCase()):r[s].toLowerCase().localeCompare(i[s].toLowerCase())}),e}formatTime(e){const s=e.getHours()<10?"0"+e.getHours().toString():e.getHours(),t=e.getMinutes()<10?"0"+e.getMinutes().toString():e.getMinutes(),r=e.getSeconds()<10?"0"+e.getSeconds().toString():e.getSeconds();return s+":"+t+":"+r}close(){this.application!==null&&this.complete&&["client","mainsail","full"].includes(this.application.toLowerCase())?window.location.reload():(this.$store.commit("server/updateManager/resetUpdateResponse"),this.$socket.emit("machine.update.status",{refresh:!1},{action:"server/updateManager/onUpdateStatus"}))}messagesChanged(){setTimeout(()=>{this.$nextTick(()=>{if(this.$refs.updaterLogScroll){const e=this.$refs.updaterLogScroll.osInstance();e==null||e.scroll({y:"100%"})}})},50)}};RC([me("messages")],bl.prototype,"messagesChanged",1);bl=RC([O({components:{}})],bl);var Iq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{staticClass:"mx-0",attrs:{value:e.application!=="",persistent:"","max-width":"800"}},[t(De,{attrs:{loading:!e.complete}},[t("template",{slot:"progress"},[t(bs,{attrs:{color:"primary",indeterminate:""}})],1),t(oa,{attrs:{flat:"",dense:""}},[t(ki,[t("span",{staticClass:"subheading"},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiUpdate))]),e.application.substr(0,8)==="recover_"&&!e.complete?[e._v(" "+e._s(e.$t("App.UpdateDialog.Recovering",{software:e.application.substr(8)}))+" ")]:e.application.substr(0,8)==="recover_"?[e._v(" "+e._s(e.$t("App.UpdateDialog.RecoveringDone",{software:e.application.substr(8)}))+" ")]:e.complete?[e._v(" "+e._s(e.$t("App.UpdateDialog.UpdatingDone",{software:e.application}))+" ")]:[e._v(" "+e._s(e.$t("App.UpdateDialog.Updating",{software:e.application}))+" ")]],2)])],1),t(q,{staticClass:"px-3"},[t(S,[t(_,{staticClass:"py-6 px-0"},[t("overlay-scrollbars",{ref:"updaterLogScroll",staticClass:"updaterLogScroll"},[t(Ns,{ref:"updaterLog",staticClass:"updaterLog",attrs:{headers:e.headers,items:e.messages,"item-key":"date","hide-default-footer":"","hide-default-header":"","disable-pagination":"","custom-sort":e.customSort,"sort-by":"date","sort-desc":!0,color:"primary"},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"py-2"},[e._v(e._s(e.$t("App.UpdateDialog.Empty")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item;return[t("tr",[t("td",{staticClass:"log-cell title-cell py-2"},[e._v(" "+e._s(e.formatTime(i.date))+" ")]),t("td",{staticClass:"log-cell content-cell pl-0 py-2",staticStyle:{width:"100%"},attrs:{colspan:"2"}},[i.message?t("span",{staticClass:"message",domProps:{innerHTML:e._s(i.message)}}):e._e()])])]}}])})],1)],1)],1),t(S,[t(_,{staticClass:"text-center pt-5"},[t(g,{attrs:{text:"",disabled:!e.complete,color:"primary"},on:{click:e.close}},[e._v(" "+e._s(e.$t("App.UpdateDialog.Close"))+" ")])],1)],1)],1)],2)],1)},Hq=[];const A_={};var jq=N(bl,Iq,Hq,!1,Nq,"de6f962a",null,null);function Nq(e){for(let s in A_)this[s]=A_[s]}const IC=function(){return jq.exports}();var Vq=Object.defineProperty,Uq=Object.getOwnPropertyDescriptor,Bq=(e,s,t,r)=>{for(var i=r>1?void 0:r?Uq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Vq(s,t,i),i};let Nh=class extends j(V,kt){constructor(){super(...arguments),this.mdiConnection=gp,this.counter=0}get protocol(){return this.$store.state.socket.protocol}get hostname(){return this.$store.state.socket.hostname}get port(){return this.$store.state.socket.port}get formatHostname(){return parseInt(this.port)!==80&&this.port!==""?this.hostname+":"+this.port:this.hostname}get isConnecting(){return this.$store.state.socket.isConnecting}get connectingFailed(){return this.$store.state.socket.connectingFailed}get showDialog(){return!0}get titleText(){return this.connectingFailed?this.$t("ConnectionDialog.Failed",{host:this.formatHostname}):this.isConnecting?this.$t("ConnectionDialog.Connecting",{host:this.formatHostname}):this.guiIsReady?this.formatHostname:this.$t("ConnectionDialog.Initializing")}reconnect(){this.counter++,this.$store.dispatch("socket/setData",{connectingFailed:!1}),this.$socket.connect()}};Nh=Bq([O({components:{ConnectionStatus:ic}})],Nh);var Wq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"",width:400},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(De,[t(oa,{attrs:{flat:"",dense:""}},[t(ki,[t("span",{staticClass:"subheading"},[t(v,{attrs:{left:""}},[e._v(e._s(e.mdiConnection))]),e._v(" "+e._s(e.titleText)+" ")],1)])],1),e.connectingFailed?t(q,{staticClass:"pt-5"},[t(ic,{attrs:{moonraker:!1}}),t("p",{staticClass:"text-center mt-3"},[e._v(e._s(e.$t("ConnectionDialog.CannotConnectTo",{host:e.formatHostname})))]),e.counter>2?[t(E,{staticClass:"my-3"}),t("p",[e._v(e._s(e.$t("ConnectionDialog.CheckMoonrakerLog")))]),t("ul",[t("li",[e._v("~/klipper_logs/moonraker.log")]),t("li",[e._v("/tmp/moonraker.log")])]),t(E,{staticClass:"mt-4 mb-5"})]:e._e(),t("div",{staticClass:"text-center"},[t(g,{staticClass:"primary--text",on:{click:e.reconnect}},[e._v(e._s(e.$t("ConnectionDialog.TryAgain")))])],1)],2):t(q,{staticClass:"pt-5"},[t(bs,{attrs:{color:e.progressBarColor,indeterminate:""}})],1)],1)],1)},Gq=[];const F_={};var zq=N(Nh,Wq,Gq,!1,Zq,null,null,null);function Zq(e){for(let s in F_)this[s]=F_[s]}const HC=function(){return zq.exports}(),qq=y.component("CodemirrorAsync",()=>he(()=>import("./Codemirror-d2702935.js"),["assets/Codemirror-d2702935.js","assets/codemirror-0a1db0c7.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js"]));var Xq=Object.defineProperty,Yq=Object.getOwnPropertyDescriptor,jC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Yq(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&Xq(s,t,i),i};let yl=class extends j(V){constructor(){super(...arguments),this.dialogConfirmChange=!1,this.formatFilesize=it,this.mdiCloseThick=Ce,this.mdiHelp=Jb,this.mdiContentSave=vp,this.mdiRestart=jr,this.mdiClose=ca,this.mdiHelpCircle=Xl,this.mdiFileDocumentEditOutline=da,this.mdiFileDocumentOutline=nP,this.scrollbarOptions={scrollbars:{autoHide:"never"}}}get changed(){var e;return(e=this.$store.state.editor.changed)!=null?e:!1}get changedOutput(){return this.changed?"*":""}get show(){var e;return(e=this.$store.state.editor.bool)!=null?e:!1}get filepath(){var e;return(e=this.$store.state.editor.filepath)!=null?e:""}get filename(){var e;return(e=this.$store.state.editor.filename)!=null?e:""}get filenameWithoutExtension(){return this.filename.lastIndexOf(".")?this.filename.slice(0,this.filename.lastIndexOf(".")):this.filename}get fileExtension(){return this.filename.lastIndexOf(".")?this.filename.slice(this.filename.lastIndexOf(".")+1):""}get fileroot(){var e;return(e=this.$store.state.editor.fileroot)!=null?e:"gcodes"}get permissions(){var e;return(e=this.$store.state.editor.permissions)!=null?e:"r"}get isWriteable(){return this.permissions.includes("w")}get sourcecode(){var e;return(e=this.$store.state.editor.sourcecode)!=null?e:""}set sourcecode(e){this.$store.dispatch("editor/updateSourcecode",e)}get loaderBool(){var e;return(e=this.$store.state.editor.loaderBool)!=null?e:!1}get loaderProgress(){var e;return(e=this.$store.state.editor.loaderProgress)!=null?e:{}}get snackbarHeadline(){let e=this.$t("Editor.Downloading");return this.loaderProgress.direction&&(e=kr(this.loaderProgress.direction)),this.$t("Editor.".concat(e))}get availableServices(){var e,s;return(s=(e=this.$store.state.server.system_info)==null?void 0:e.available_services)!=null?s:[]}get restartServiceName(){return!this.isWriteable||["printing","paused"].includes(this.printer_state)?null:this.availableServices.includes(this.filenameWithoutExtension)&&this.fileExtension==="conf"?this.filenameWithoutExtension:this.filename.startsWith("webcam")&&["conf","txt"].includes(this.fileExtension)?"webcamd":this.filename.startsWith("mooncord")&&this.fileExtension==="json"?"mooncord":this.filename==="moonraker.conf"?"moonraker":this.fileExtension==="cfg"?"klipper":null}get restartServiceNameExists(){return this.restartServiceName===null?!1:["klipper","moonraker"].includes(this.restartServiceName)?!0:this.availableServices.includes(this.restartServiceName)}get confirmUnsavedChanges(){var e;return(e=this.$store.state.gui.editor.confirmUnsavedChanges)!=null?e:!1}get escToClose(){var e;return(e=this.$store.state.gui.editor.escToClose)!=null?e:!1}get title(){const e=this.filepath?"".concat(this.filepath,"/").concat(this.filename):this.filename;return this.isWriteable?"".concat(e," ").concat(this.changedOutput):"".concat(e," (").concat(this.$t("Editor.FileReadOnly"),")")}get currentLanguage(){return this.$store.state.gui.general.language}get klipperConfigReference(){const e=this.currentLanguage,s=wS;let t="https://www.klipper3d.org/Config_Reference.html";return s.includes(e)&&(t="https://www.klipper3d.org/".concat(e,"/Config_Reference.html")),t}cancelDownload(){this.$store.dispatch("editor/cancelLoad")}escClose(){this.escToClose&&this.close()}close(){this.confirmUnsavedChanges?this.promptUnsavedChanges():this.$store.dispatch("editor/close")}discardChanges(){this.dialogConfirmChange=!1,this.$store.dispatch("editor/close")}promptUnsavedChanges(){!this.changed||!this.isWriteable?this.$store.dispatch("editor/close"):this.dialogConfirmChange=!0}save(e=null){this.dialogConfirmChange=!1,this.$store.dispatch("editor/saveFile",{content:this.sourcecode,restartServiceName:e})}changedChanged(e){this.confirmUnsavedChanges&&(e?window.addEventListener("beforeunload",rd):window.removeEventListener("beforeunload",rd))}};jC([me("changed")],yl.prototype,"changedChanged",1);yl=jC([O({components:{Panel:Z,CodemirrorAsync:qq}})],yl);var Jq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(oe,{attrs:{persistent:"",fullscreen:"","hide-overlay":"",transition:!1},on:{close:e.close,keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.escClose.apply(null,arguments)}},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(Z,{attrs:{"card-class":"editor-dialog",icon:e.isWriteable?e.mdiFileDocumentEditOutline:e.mdiFileDocumentOutline,title:e.title},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.restartServiceName==="klipper"?t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:"",href:e.klipperConfigReference,target:"_blank"}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiHelp))]),e._v(" "+e._s(e.$t("Editor.ConfigReference"))+" ")],1):e._e(),e.isWriteable?t(g,{attrs:{text:"",tile:"",color:e.restartServiceName===null?"primary":""},on:{click:function(r){return e.save(null)}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiContentSave))]),t("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.$t("Editor.SaveClose")))])],1):e._e(),e.restartServiceNameExists?t(g,{staticClass:"d-none d-sm-flex",attrs:{color:"primary",text:"",tile:""},on:{click:function(r){return e.save(e.restartServiceName)}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Editor.SaveRestart"))+" ")],1):e._e(),t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pa-0"},[e.show?t("codemirror-async",{ref:"editor",attrs:{name:e.filename,"file-extension":e.fileExtension},model:{value:e.sourcecode,callback:function(r){e.sourcecode=r},expression:"sourcecode"}}):e._e()],1)],1)],1),t(oi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function(r){var i=r.attrs;return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:"",tile:""},on:{click:e.cancelDownload}},"v-btn",i,!1),[t(v,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.loaderBool,callback:function(r){e.loaderBool=r},expression:"loaderBool"}},[t("div",[e._v(" "+e._s(e.snackbarHeadline)+" "),t("br"),t("strong",[e._v(e._s(e.filename))])]),e.loaderProgress.total>0?[t("span",{staticClass:"mr-1"},[e._v(" ("+e._s(e.formatFilesize(e.loaderProgress.loaded))+"/"+e._s(e.formatFilesize(e.loaderProgress.total))+") ")]),e._v(" "+e._s(Math.round(100*e.loaderProgress.loaded/e.loaderProgress.total))+" % @ "+e._s(e.loaderProgress.speed)+"/s "),t("br"),t(bs,{staticClass:"mt-2",attrs:{value:100*e.loaderProgress.loaded/e.loaderProgress.total}})]:[t(bs,{staticClass:"mt-2",attrs:{indeterminate:""}})]],2),t(oe,{attrs:{persistent:"",width:600},model:{value:e.dialogConfirmChange,callback:function(r){e.dialogConfirmChange=r},expression:"dialogConfirmChange"}},[t(Z,{attrs:{"card-class":"editor-confirm-change-dialog",icon:e.mdiHelpCircle,title:e.$t("Editor.UnsavedChanges"),"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogConfirmChange=!1}}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pt-3"},[t(S,[t(_,[t("p",{staticClass:"body-1 mb-2"},[e._v(e._s(e.$t("Editor.UnsavedChangesMessage",{filename:e.filename})))]),t("p",{staticClass:"body-2"},[e._v(e._s(e.$t("Editor.UnsavedChangesSubMessage")))])])],1)],1),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.discardChanges}},[e._v(" "+e._s(e.$t("Editor.DontSave"))+" ")]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.save}},[e._v(" "+e._s(e.$t("Editor.SaveClose"))+" ")]),e.restartServiceNameExists?[t(g,{attrs:{text:"",color:"primary"},on:{click:function(r){return e.save(e.restartServiceName)}}},[e._v(" "+e._s(e.$t("Editor.SaveRestart"))+" ")])]:e._e()],2)],1)],1)],1)},Kq=[];const R_={};var Qq=N(yl,Jq,Kq,!1,eX,"4d8cae4d",null,null);function eX(e){for(let s in R_)this[s]=R_[s]}const NC=function(){return Qq.exports}();var tX=Object.defineProperty,sX=Object.getOwnPropertyDescriptor,rX=(e,s,t,r)=>{for(var i=r>1?void 0:r?sX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&tX(s,t,i),i};let Vh=class extends j(V){get boolShowDialogRunning(){return this.status==="running"}get boolShowDialogSuccess(){return this.status==="success"}set boolShowDialogSuccess(e){e||this.$store.dispatch("server/timelapse/resetSnackbar")}get status(){var e;return(e=this.$store.state.server.timelapse.rendering.status)!=null?e:""}get progress(){var e;return(e=this.$store.state.server.timelapse.rendering.progress)!=null?e:""}get filename(){var e;return(e=this.$store.state.server.timelapse.rendering.filename)!=null?e:""}};Vh=rX([O({components:{}})],Vh);var iX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(oi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},model:{value:e.boolShowDialogRunning,callback:function(r){e.boolShowDialogRunning=r},expression:"boolShowDialogRunning"}},[t("div",[e._v(e._s(e.$t("Timelapse.TimelapseRendering"))+"...")]),e.progress>0?t(bs,{staticClass:"mt-2",attrs:{value:e.progress,indeterminate:""}}):e._e(),e.progress===0?t(bs,{staticClass:"mt-2",attrs:{indeterminate:""}}):e._e()],1),t(oi,{attrs:{timeout:5e3,value:!0,fixed:"",right:"",bottom:""},model:{value:e.boolShowDialogSuccess,callback:function(r){e.boolShowDialogSuccess=r},expression:"boolShowDialogSuccess"}},[t("div",[e._v(" "+e._s(e.$t("Timelapse.TimelapseRenderingSuccessful"))+" "),t("br"),t("strong",[e._v(e._s(e.filename))])])])],1)},nX=[];const I_={};var aX=N(Vh,iX,nX,!1,oX,null,null,null);function oX(e){for(let s in I_)this[s]=I_[s]}const VC=function(){return aX.exports}();var lX=Object.defineProperty,cX=Object.getOwnPropertyDescriptor,uX=(e,s,t,r)=>{for(var i=r>1?void 0:r?cX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&lX(s,t,i),i};let Uh=class extends j(V){constructor(){super(...arguments),this.mdiTrayArrowDown=zP,this.visible=!1}get dropzoneClasses(){return{"fullscreen-upload__dragzone--visible":this.visible}}get currentRoute(){var e;return(e=this.$route.path)!=null?e:""}get currentPathGcodes(){var e;return(e=this.$store.state.gui.view.gcodefiles.currentPath)!=null?e:""}get currentPathConfig(){var e;return(e=this.$store.state.gui.view.configfiles.currentPath)!=null?e:""}mounted(){window.addEventListener("dragenter",this.onDragOverWindow),window.addEventListener("dragover",this.onDragOverWindow),window.addEventListener("dragleave",this.onDragLeaveWindow)}beforeDestroy(){window.removeEventListener("dragenter",this.onDragOverWindow),window.removeEventListener("dragover",this.onDragOverWindow),window.removeEventListener("dragleave",this.onDragLeaveWindow)}showDropZone(){this.visible=!0}hideDropZone(){this.visible=!1}onDragOverWindow(e){var t,r;((r=(t=e.dataTransfer)==null?void 0:t.types)!=null?r:[]).includes("Files")&&(e.preventDefault(),!this.visible&&this.showDropZone())}onDragLeaveWindow(e){e.preventDefault(),this.hideDropZone()}async onDrop(e){var s,t;if(e.preventDefault(),this.hideDropZone(),(t=(s=e.dataTransfer)==null?void 0:s.files)!=null&&t.length){const r=[...e.dataTransfer.files];await this.$store.dispatch("socket/addLoading",{name:"gcodeUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",r.length);for(const i of r){const n=i.name.lastIndexOf("."),a=i.name.slice(n),o=ci.includes(a);let l="";this.currentRoute==="/files"&&o?l=this.currentPathGcodes:this.currentRoute==="/config"&&!o&&(l=this.currentPathConfig);const c=o?"gcodes":"config";await this.$store.dispatch("files/uploadIncrementCurrentNumber");const u=await this.$store.dispatch("files/uploadFile",{file:i,path:l,root:c});u!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:u}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"})}}};Uh=uX([O],Uh);var dX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"d-flex justify-center flex-column fullscreen-upload__dragzone",class:e.dropzoneClasses,on:{drop:e.onDrop}},[t(v,{staticClass:"fullscreen-upload__icon"},[e._v(e._s(e.mdiTrayArrowDown))]),t("div",{staticClass:"textnode"},[e._v(e._s(e.$t("FullscreenUpload.DropFilesToUploadFiles")))])],1)},hX=[];const H_={};var pX=N(Uh,dX,hX,!1,mX,null,null,null);function mX(e){for(let s in H_)this[s]=H_[s]}const UC=function(){return pX.exports}();var fX=Object.defineProperty,gX=Object.getOwnPropertyDescriptor,BC=(e,s,t,r)=>{for(var i=r>1?void 0:r?gX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&fX(s,t,i),i};let Cl=class extends j(V){constructor(){super(...arguments),this.mdiClose=ca,this.formatFilesize=it}get show(){var e;return(e=this.$store.state.files.upload.show)!=null?e:!1}get cancelTokenSource(){return this.$store.state.files.upload.cancelTokenSource}get filename(){var e;return(e=this.$store.state.files.upload.filename)!=null?e:""}get currentNumber(){var e;return(e=this.$store.state.files.upload.currentNumber)!=null?e:0}get maxNumber(){var e;return(e=this.$store.state.files.upload.maxNumber)!=null?e:0}get speed(){var e;return it(Math.round((e=this.$store.state.files.upload.speed)!=null?e:0))}get percent(){var e;return Math.round((e=this.$store.state.files.upload.percent)!=null?e:0)}cancelUpload(){var e;(e=this.cancelTokenSource)==null||e.cancel(),this.$store.dispatch("files/uploadSetShow",!1),this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"}),this.$store.dispatch("socket/removeLoading",{name:"configFileUpload"})}showChanged(e){const s=document.getElementsByTagName("body")[0];e?s.classList.add("fullscreenUpload--active"):s.classList.remove("fullscreenUpload--active")}};BC([me("show")],Cl.prototype,"showChanged",1);Cl=BC([O({components:{}})],Cl);var vX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.show?t(oi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function(r){var i=r.attrs;return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelUpload}},"v-btn",i,!1),[t(v,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}],null,!1,2940317734)},[e.maxNumber>1?t("span",{staticClass:"mr-1"},[e._v("("+e._s(e.currentNumber)+"/"+e._s(e.maxNumber)+")")]):e._e(),t("strong",[e._v(e._s(e.$t("Editor.Uploading")+" "+e.filename))]),t("br"),e._v(" "+e._s(e.percent)+" % @ "+e._s(e.speed)+"/s "),t("br"),t(bs,{staticClass:"mt-2",attrs:{value:e.percent}})],1):e._e()},_X=[];const j_={};var bX=N(Cl,vX,_X,!1,yX,null,null,null);function yX(e){for(let s in j_)this[s]=j_[s]}const WC=function(){return bX.exports}();var CX=Object.defineProperty,$X=Object.getOwnPropertyDescriptor,xX=(e,s,t,r)=>{for(var i=r>1?void 0:r?$X(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&CX(s,t,i),i};let Bh=class extends j(V){constructor(){super(...arguments),this.mdiArrowCollapseDown=Wl,this.mdiArrowExpandUp=Ib,this.mdiInformation=At,this.mdiPlusThick=TP,this.mdiMinusThick=bP,this.mdiChevronTripleLeft=BS,this.mdiChevronTripleRight=WS,this.mdiCloseThick=Ce}get showDialog(){var e,s;return this.boolManualProbeDialog&&(s=(e=this.$store.state.printer.manual_probe)==null?void 0:e.is_active)!=null?s:!1}get boolManualProbeDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolManualProbeDialog)!=null?e:!0}get offsetsZ(){return[1,.1,.05,.01,.005].sort()}get z_position(){var e,s;return((s=(e=this.$store.state.printer.manual_probe)==null?void 0:e.z_position)!=null?s:0).toFixed(3)}get z_position_lower(){var s,t;const e=(t=(s=this.$store.state.printer.manual_probe)==null?void 0:s.z_position_lower)!=null?t:null;return e===null?"??????":e.toFixed(3)}get z_position_upper(){var s,t;const e=(t=(s=this.$store.state.printer.manual_probe)==null?void 0:s.z_position_upper)!=null?t:null;return e===null?"??????":e.toFixed(3)}get loadingAbort(){return this.loadings.includes("manualProbeAbort")}get loadingAccept(){return this.loadings.includes("manualProbeAccept")}sendTestZ(e){const s="TESTZ Z=".concat(e);this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}sendAbort(){const e="ABORT";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"manualProbeAbort"})}sendAccept(){const e="ACCEPT";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"manualProbeAccept"})}};Bh=xX([O({components:{Panel:Z,Responsive:Qe}})],Bh);var wX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(Z,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("ManualProbe.Headline").toString(),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.sendAbort}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(ke,[t(S,[t(_,{staticClass:"d-flex align-center justify-center"},[t("span",{staticClass:"text-h5"},[e._v(e._s(e.z_position_lower))]),t(v,{staticClass:"mx-2"},[e._v(e._s(e.mdiChevronTripleRight))]),t("span",{staticClass:"text-h4"},[e._v(e._s(e.z_position))]),t(v,{staticClass:"mx-2"},[e._v(e._s(e.mdiChevronTripleLeft))]),t("span",{staticClass:"text-h5"},[e._v(e._s(e.z_position_upper))])],1)],1),t(S,[t(_,{staticClass:"text-left"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("--")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))]),t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))])],1)],1),t(_,{staticClass:"text-left"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("-")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))])],1)],1),t(_,{staticClass:"text-right"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("+")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))])],1)],1),t(_,{staticClass:"text-right"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("++")}}},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))]),t(v,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))])],1)],1)],1)],1),t(k0,{staticClass:"mb-n2",attrs:{title:e.$t("ManualProbe.Advanced"),"sub-panel-class":"manual-probe-dialog-advanced"}},[t(ke,[t(Nt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(r,i){return t(g,{key:"offsetsUp-".concat(i),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(n){e.sendTestZ(r.toString())}}},[i===0?t(v,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowExpandUp)+" ")]):e._e(),t("span",[e._v("+"+e._s(r))])],1)}),1),t(Nt,{staticClass:"_btn-group mt-6 mt-sm-3"},e._l(e.offsetsZ,function(r,i){return t(g,{key:"offsetsDown-".concat(i),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(n){e.sendTestZ((r*-1).toString())}}},[i===0?t(v,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e(),t("span",[e._v("−"+e._s(r))])],1)}),1)],1)],1),t(ne,[t(le),t(g,{attrs:{text:"",loading:e.loadingAbort},on:{click:e.sendAbort}},[e._v(" "+e._s(e.$t("ManualProbe.Abort"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAccept},on:{click:e.sendAccept}},[e._v(" "+e._s(e.$t("ManualProbe.Accept"))+" ")])],1)],1)],1)},SX=[];const N_={};var PX=N(Bh,wX,SX,!1,TX,"01252f2e",null,null);function TX(e){for(let s in N_)this[s]=N_[s]}const GC=function(){return PX.exports}();var DX=Object.defineProperty,MX=Object.getOwnPropertyDescriptor,EX=(e,s,t,r)=>{for(var i=r>1?void 0:r?MX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&DX(s,t,i),i};let Wh=class extends j(V,Je){constructor(){super(...arguments),this.mdiArrowCollapseDown=Wl,this.mdiInformation=At,this.mdiCloseThick=Ce}get showDialog(){var s,t;return this.boolBedScrewsDialog?((t=(s=this.$store.state.printer.bed_screws)==null?void 0:s.is_active)!=null?t:!1)&&this.homedAxes.includes("xyz"):!1}get boolBedScrewsDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolBedScrewsDialog)!=null?e:!0}get config(){var e,s,t;return(t=(s=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:s.bed_screws)!=null?t:{}}get bed_screws_state(){var e;return(e=this.$store.state.printer.bed_screws)==null?void 0:e.state}get current_screw(){var e;return(e=this.$store.state.printer.bed_screws)==null?void 0:e.current_screw}get accepted_screws(){var e;return(e=this.$store.state.printer.bed_screws)==null?void 0:e.accepted_screws}get loadingAbort(){return this.loadings.includes("bedScrewsAbort")}get loadingAccept(){return this.loadings.includes("bedScrewsAccept")}get loadingAdjusted(){return this.loadings.includes("bedScrewsAdjusted")}get screwNames(){const s=Object.keys(this.config).filter(r=>r.startsWith("screw")&&r.endsWith("_name")),t=[];return s==null||s.forEach(r=>{var a;const i=r.indexOf("_"),n=parseInt(r.slice(5,i));t[n-1]=(a=this.config["screw".concat(n,"_name")])!=null?a:""}),t}get countScrews(){return this.screwNames.length}get currentScrewName(){var e;return(e=this.screwNames[this.current_screw])!=null?e:"UNKNOWN"}get currentScrewOutput(){return this.$t("BedScrews.ScrewOutput",{current:this.current_screw,max:this.countScrews})}get acceptedScrewOutput(){return this.$t("BedScrews.ScrewOutput",{current:this.accepted_screws,max:this.countScrews})}sendAbort(){const e="ABORT";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"manualProbeAbort"})}sendAccept(){const e="ACCEPT";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"manualProbeAccept"})}sendAdjusted(){const e="ADJUSTED";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"manualProbeAccept"})}};Wh=EX([O({components:{Panel:Z,Responsive:Qe}})],Wh);var OX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(Z,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("BedScrews.Headline").toString(),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.sendAbort}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t(S,[t(_,[t(re,{attrs:{label:e.$t("BedScrews.ScrewName"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.currentScrewName,callback:function(r){e.currentScrewName=r},expression:"currentScrewName"}})],1)],1),t(S,[t(_,{attrs:{cols:"6"}},[t(re,{attrs:{label:e.$t("BedScrews.ScrewIndex"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.currentScrewOutput,callback:function(r){e.currentScrewOutput=r},expression:"currentScrewOutput"}})],1),t(_,{attrs:{cols:"6"}},[t(re,{attrs:{label:e.$t("BedScrews.ScrewAccepted"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.acceptedScrewOutput,callback:function(r){e.acceptedScrewOutput=r},expression:"acceptedScrewOutput"}})],1)],1),t(S,[t(_,[t("p",{staticClass:"text-center mb-0",domProps:{innerHTML:e._s(e.$t("BedScrews.Description"))}})])],1)],1),t(ne,[t(le),t(g,{attrs:{text:"",loading:e.loadingAbort},on:{click:e.sendAbort}},[e._v(" "+e._s(e.$t("BedScrews.Abort"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAdjusted},on:{click:e.sendAdjusted}},[e._v(" "+e._s(e.$t("BedScrews.Adjusted"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAccept},on:{click:e.sendAccept}},[e._v(" "+e._s(e.$t("BedScrews.Accept"))+" ")])],1)],1)],1)},LX=[];const V_={};var kX=N(Wh,OX,LX,!1,AX,null,null,null);function AX(e){for(let s in V_)this[s]=V_[s]}const zC=function(){return kX.exports}();var FX=Object.defineProperty,RX=Object.getOwnPropertyDescriptor,Bm=(e,s,t,r)=>{for(var i=r>1?void 0:r?RX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&FX(s,t,i),i};let ra=class extends j(V,Je){constructor(){super(...arguments),this.mdiRotateLeft=RP,this.mdiCloseThick=Ce,this.mdiRotateRight=IP}get settings(){var e,s,t;return(t=(s=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:s.screws_tilt_adjust)!=null?t:{}}get outputName(){var e;return(e=this.settings[this.name+"_name"])!=null?e:"Unknown"}get coordinates(){var e;return(e=this.settings[this.name])!=null?e:[0,0]}get x(){var e;return(e=this.coordinates[0])!=null?e:0}get y(){var e;return(e=this.coordinates[1])!=null?e:0}get z(){return this.result.z.toFixed(3)}get subTitle(){return"(X: ".concat(this.x,", Y: ").concat(this.y,", Z: ").concat(this.z,")")}get sign(){var e;return(e=this.result.sign)!=null?e:""}get adjust(){var e;return(e=this.result.adjust)!=null?e:"00:00"}get is_base(){var e;return(e=this.result.is_base)!=null?e:!1}};Bm([k({required:!0})],ra.prototype,"name",2);Bm([k({required:!0})],ra.prototype,"result",2);ra=Bm([O({components:{Panel:Z,Responsive:Qe,SettingsRow:U}})],ra);var IX=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r(U,{attrs:{title:s.outputName,"sub-title":s.subTitle}},[(e=s.is_base)!==null&&e!==void 0&&e?r(ns,{attrs:{label:"",small:""}},[s._v(s._s(s.$t("ScrewsTiltAdjust.Base")))]):r(ns,{attrs:{label:"",small:""}},[s.sign==="CCW"?r(v,{attrs:{small:"",left:""}},[s._v(s._s(s.mdiRotateLeft))]):s._e(),s.sign==="CW"?r(v,{attrs:{small:"",left:""}},[s._v(s._s(s.mdiRotateRight))]):s._e(),s._v(" "+s._s(s.adjust)+" ")],1)],1)},HX=[];const U_={};var jX=N(ra,IX,HX,!1,NX,null,null,null);function NX(e){for(let s in U_)this[s]=U_[s]}const ZC=function(){return jX.exports}();var VX=Object.defineProperty,UX=Object.getOwnPropertyDescriptor,BX=(e,s,t,r)=>{for(var i=r>1?void 0:r?UX(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&VX(s,t,i),i};let Gh=class extends j(V,Je){constructor(){super(...arguments),this.mdiArrowCollapseDown=Wl,this.mdiCloseThick=Ce}get state(){var e;return(e=this.$store.state.printer.screws_tilt_adjust)!=null?e:{}}get error(){var e,s;return(s=(e=this.$store.state.printer.screws_tilt_adjust)==null?void 0:e.error)!=null?s:!1}get max_deviation(){var e,s;return(s=(e=this.$store.state.printer.screws_tilt_adjust)==null?void 0:e.max_deviation)!=null?s:null}get results(){var e,s;return(s=(e=this.$store.state.printer.screws_tilt_adjust)==null?void 0:e.results)!=null?s:{}}get showDialog(){return!this.boolScrewsTiltAdjustDialog||this.max_deviation!==null?!1:this.error||Object.keys(this.results).length}get boolScrewsTiltAdjustDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog)!=null?e:!0}clearScrewsTiltAdjust(){this.$store.dispatch("printer/clearScrewsTiltAdjust")}async retryScrewsTiltAdjust(){await this.$store.dispatch("printer/clearScrewsTiltAdjust"),this.doSend("SCREWS_TILT_CALCULATE")}};Gh=BX([O({components:{TheScrewsTiltAdjustDialogEntry:ZC,Panel:Z,Responsive:Qe,SettingsRow:U}})],Gh);var WX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(Z,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("ScrewsTiltAdjust.Headline"),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.clearScrewsTiltAdjust}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[e.error?t(q,[t(S,[t(_,[t(dt,{attrs:{border:"left",text:"",type:"error"}},[e._v(e._s(e.$t("ScrewsTiltAdjust.ErrorText")))])],1)],1)],1):e._e(),Object.keys(e.results).length?t(q,[e._l(e.results,function(r,i,n){return[n?t(E,{key:"result-divider-".concat(i),staticClass:"my-1"}):e._e(),t(ZC,{key:"result-".concat(i,"-").concat(i),attrs:{name:i.toString(),result:r}})]})],2):e._e(),t(ne,[t(le),t(g,{attrs:{text:""},on:{click:e.retryScrewsTiltAdjust}},[e._v(" "+e._s(e.$t("ScrewsTiltAdjust.Retry"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.clearScrewsTiltAdjust}},[e._v(" "+e._s(e.$t("ScrewsTiltAdjust.Accept"))+" ")])],1)],1)],1)},GX=[];const B_={};var zX=N(Gh,WX,GX,!1,ZX,null,null,null);function ZX(e){for(let s in B_)this[s]=B_[s]}const qC=function(){return zX.exports}(),qX=(e,s)=>{const t=e[s];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+s)))})};/*! - * vue-i18n v8.28.2 - * (c) 2022 kazuya kawaguchi - * Released under the MIT License. - */var XC=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"],XX=["dateStyle","timeStyle","calendar","localeMatcher","hour12","hourCycle","timeZone","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function Oi(e,s){typeof console<"u"&&(console.warn("[vue-i18n] "+e),s&&console.warn(s.stack))}function YX(e,s){typeof console<"u"&&(console.error("[vue-i18n] "+e),s&&console.error(s.stack))}var Cs=Array.isArray;function Xt(e){return e!==null&&typeof e=="object"}function JX(e){return typeof e=="boolean"}function ot(e){return typeof e=="string"}var KX=Object.prototype.toString,QX="[object Object]";function _s(e){return KX.call(e)===QX}function Lt(e){return e==null}function zh(e){return typeof e=="function"}function qc(){for(var e=[],s=arguments.length;s--;)e[s]=arguments[s];var t=null,r=null;return e.length===1?Xt(e[0])||Cs(e[0])?r=e[0]:typeof e[0]=="string"&&(t=e[0]):e.length===2&&(typeof e[0]=="string"&&(t=e[0]),(Xt(e[1])||Cs(e[1]))&&(r=e[1])),{locale:t,params:r}}function Zi(e){return JSON.parse(JSON.stringify(e))}function eY(e,s){if(e.delete(s))return e}function tY(e){var s=[];return e.forEach(function(t){return s.push(t)}),s}function Sa(e,s){return!!~e.indexOf(s)}var sY=Object.prototype.hasOwnProperty;function rY(e,s){return sY.call(e,s)}function Er(e){for(var s=arguments,t=Object(e),r=1;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function nY(e){return e!=null&&Object.keys(e).forEach(function(s){typeof e[s]=="string"&&(e[s]=iY(e[s]))}),e}function aY(e){e.prototype.hasOwnProperty("$i18n")||Object.defineProperty(e.prototype,"$i18n",{get:function(){return this._i18n}}),e.prototype.$t=function(s){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var i=this.$i18n;return i._t.apply(i,[s,i.locale,i._getMessages(),this].concat(t))},e.prototype.$tc=function(s,t){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var n=this.$i18n;return n._tc.apply(n,[s,n.locale,n._getMessages(),this,t].concat(r))},e.prototype.$te=function(s,t){var r=this.$i18n;return r._te(s,r.locale,r._getMessages(),t)},e.prototype.$d=function(s){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this.$i18n).d.apply(t,[s].concat(r))},e.prototype.$n=function(s){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this.$i18n).n.apply(t,[s].concat(r))}}function oY(e){e===void 0&&(e=!1);function s(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return e?{mounted:s}:{beforeCreate:function(){var r=this.$options;if(r.i18n=r.i18n||(r.__i18nBridge||r.__i18n?{}:null),r.i18n){if(r.i18n instanceof ce){if(r.__i18nBridge||r.__i18n)try{var i=r.i18n&&r.i18n.messages?r.i18n.messages:{},n=r.__i18nBridge||r.__i18n;n.forEach(function(d){i=Er(i,JSON.parse(d))}),Object.keys(i).forEach(function(d){r.i18n.mergeLocaleMessage(d,i[d])})}catch{}this._i18n=r.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(_s(r.i18n)){var a=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?this.$root.$i18n:null;if(a&&(r.i18n.root=this.$root,r.i18n.formatter=a.formatter,r.i18n.fallbackLocale=a.fallbackLocale,r.i18n.formatFallbackMessages=a.formatFallbackMessages,r.i18n.silentTranslationWarn=a.silentTranslationWarn,r.i18n.silentFallbackWarn=a.silentFallbackWarn,r.i18n.pluralizationRules=a.pluralizationRules,r.i18n.preserveDirectiveContent=a.preserveDirectiveContent),r.__i18nBridge||r.__i18n)try{var o=r.i18n&&r.i18n.messages?r.i18n.messages:{},l=r.__i18nBridge||r.__i18n;l.forEach(function(d){o=Er(o,JSON.parse(d))}),r.i18n.messages=o}catch{}var c=r.i18n,u=c.sharedMessages;u&&_s(u)&&(r.i18n.messages=Er(r.i18n.messages,u)),this._i18n=new ce(r.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(r.i18n.sync===void 0||r.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),a&&a.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?this._i18n=this.$root.$i18n:r.parent&&r.parent.$i18n&&r.parent.$i18n instanceof ce&&(this._i18n=r.parent.$i18n)},beforeMount:function(){var r=this.$options;r.i18n=r.i18n||(r.__i18nBridge||r.__i18n?{}:null),r.i18n?r.i18n instanceof ce?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):_s(r.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):r.parent&&r.parent.$i18n&&r.parent.$i18n instanceof ce&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:s,beforeDestroy:function(){if(this._i18n){var r=this;this.$nextTick(function(){r._subscribing&&(r._i18n.unsubscribeDataChanging(r),delete r._subscribing),r._i18nWatcher&&(r._i18nWatcher(),r._i18n.destroyVM(),delete r._i18nWatcher),r._localeWatcher&&(r._localeWatcher(),delete r._localeWatcher)})}}}}var W_={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(s,t){var r=t.data,i=t.parent,n=t.props,a=t.slots,o=i.$i18n;if(o){var l=n.path,c=n.locale,u=n.places,d=a(),h=o.i(l,c,lY(d)||u?cY(d.default,u):d),p=n.tag&&n.tag!==!0||n.tag===!1?n.tag:"span";return p?s(p,r,h):h}}};function lY(e){var s;for(s in e)if(s!=="default")return!1;return!!s}function cY(e,s){var t=s?uY(s):{};if(!e)return t;e=e.filter(function(i){return i.tag||i.text.trim()!==""});var r=e.every(hY);return e.reduce(r?dY:YC,t)}function uY(e){return Array.isArray(e)?e.reduce(YC,{}):Object.assign({},e)}function dY(e,s){return s.data&&s.data.attrs&&s.data.attrs.place&&(e[s.data.attrs.place]=s),e}function YC(e,s,t){return e[t]=s,e}function hY(e){return!!(e.data&&e.data.attrs&&e.data.attrs.place)}var G_={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(s,t){var r=t.props,i=t.parent,n=t.data,a=i.$i18n;if(!a)return null;var o=null,l=null;ot(r.format)?o=r.format:Xt(r.format)&&(r.format.key&&(o=r.format.key),l=Object.keys(r.format).reduce(function(p,m){var f;return Sa(XC,m)?Object.assign({},p,(f={},f[m]=r.format[m],f)):p},null));var c=r.locale||a.locale,u=a._ntp(r.value,c,o,l),d=u.map(function(p,m){var f,b=n.scopedSlots&&n.scopedSlots[p.type];return b?b((f={},f[p.type]=p.value,f.index=m,f.parts=u,f)):p.value}),h=r.tag&&r.tag!==!0||r.tag===!1?r.tag:"span";return h?s(h,{attrs:n.attrs,class:n.class,staticClass:n.staticClass},d):d}};function pY(e,s,t){JC(e,t)&&KC(e,s,t)}function mY(e,s,t,r){if(JC(e,t)){var i=t.context.$i18n;gY(e,t)&&$l(s.value,s.oldValue)&&$l(e._localeMessage,i.getLocaleMessage(i.locale))||KC(e,s,t)}}function fY(e,s,t,r){var i=t.context;if(!i){Oi("Vue instance does not exists in VNode context");return}var n=t.context.$i18n||{};!s.modifiers.preserve&&!n.preserveDirectiveContent&&(e.textContent=""),e._vt=void 0,delete e._vt,e._locale=void 0,delete e._locale,e._localeMessage=void 0,delete e._localeMessage}function JC(e,s){var t=s.context;return t?t.$i18n?!0:(Oi("VueI18n instance does not exists in Vue instance"),!1):(Oi("Vue instance does not exists in VNode context"),!1)}function gY(e,s){var t=s.context;return e._locale===t.$i18n.locale}function KC(e,s,t){var r,i,n=s.value,a=vY(n),o=a.path,l=a.locale,c=a.args,u=a.choice;if(!o&&!l&&!c){Oi("value type not supported");return}if(!o){Oi("`path` is required in v-t directive");return}var d=t.context;u!=null?e._vt=e.textContent=(r=d.$i18n).tc.apply(r,[o,u].concat(z_(l,c))):e._vt=e.textContent=(i=d.$i18n).t.apply(i,[o].concat(z_(l,c))),e._locale=d.$i18n.locale,e._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}function vY(e){var s,t,r,i;return ot(e)?s=e:_s(e)&&(s=e.path,t=e.locale,r=e.args,i=e.choice),{path:s,locale:t,args:r,choice:i}}function z_(e,s){var t=[];return e&&t.push(e),s&&(Array.isArray(s)||_s(s))&&t.push(s),t}var yt;function Wm(e,s){s===void 0&&(s={bridge:!1}),Wm.installed=!0,yt=e,yt.version&&Number(yt.version.split(".")[0]),aY(yt),yt.mixin(oY(s.bridge)),yt.directive("t",{bind:pY,update:mY,unbind:fY}),yt.component(W_.name,W_),yt.component(G_.name,G_);var t=yt.config.optionMergeStrategies;t.i18n=function(r,i){return i===void 0?r:i}}var QC=function(){this._caches=Object.create(null)};QC.prototype.interpolate=function(s,t){if(!t)return[s];var r=this._caches[s];return r||(r=yY(s),this._caches[s]=r),CY(r,t)};var _Y=/^(?:\d)+/,bY=/^(?:\w)+/;function yY(e){for(var s=[],t=0,r="";t0)i--,r=As,h[nt]();else{if(i=0,a===void 0||(a=PY(a),a===!1))return!1;h[si]()}};function p(){var m=e[t+1];if(r===Sl&&m==="'"||r===Pl&&m==='"')return t++,o="\\"+m,h[nt](),!0}for(;r!==null;)if(t++,n=e[t],!(n==="\\"&&p())){if(l=SY(n),d=fr[r],c=d[l]||d.else||ia,c===ia||(r=c[0],u=h[c[1]],u&&(o=c[2],o=o===void 0?n:o,u()===!1)))return;if(r===Xc)return s}}var Gm=function(){this._cache=Object.create(null)};Gm.prototype.parsePath=function(s){var t=this._cache[s];return t||(t=TY(s),t&&(this._cache[s]=t)),t||[]};Gm.prototype.getPathValue=function(s,t){if(!Xt(s))return null;var r=this.parsePath(t);if(r.length===0)return null;for(var i=r.length,n=s,a=0;a/,MY=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,EY=/^@(?:\.([a-zA-Z]+))?:/,OY=/[()]/g,Z_={upper:function(e){return e.toLocaleUpperCase()},lower:function(e){return e.toLocaleLowerCase()},capitalize:function(e){return""+e.charAt(0).toLocaleUpperCase()+e.substr(1)}},qh=new QC,ce=function(s){var t=this;s===void 0&&(s={}),!yt&&typeof window<"u"&&window.Vue&&Wm(window.Vue);var r=s.locale||"en-US",i=s.fallbackLocale===!1?!1:s.fallbackLocale||"en-US",n=s.messages||{},a=s.dateTimeFormats||s.datetimeFormats||{},o=s.numberFormats||{};this._vm=null,this._formatter=s.formatter||qh,this._modifiers=s.modifiers||{},this._missing=s.missing||null,this._root=s.root||null,this._sync=s.sync===void 0?!0:!!s.sync,this._fallbackRoot=s.fallbackRoot===void 0?!0:!!s.fallbackRoot,this._fallbackRootWithEmptyString=s.fallbackRootWithEmptyString===void 0?!0:!!s.fallbackRootWithEmptyString,this._formatFallbackMessages=s.formatFallbackMessages===void 0?!1:!!s.formatFallbackMessages,this._silentTranslationWarn=s.silentTranslationWarn===void 0?!1:s.silentTranslationWarn,this._silentFallbackWarn=s.silentFallbackWarn===void 0?!1:!!s.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Gm,this._dataListeners=new Set,this._componentInstanceCreatedListener=s.componentInstanceCreatedListener||null,this._preserveDirectiveContent=s.preserveDirectiveContent===void 0?!1:!!s.preserveDirectiveContent,this.pluralizationRules=s.pluralizationRules||{},this._warnHtmlInMessage=s.warnHtmlInMessage||"off",this._postTranslation=s.postTranslation||null,this._escapeParameterHtml=s.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in s&&(this.__VUE_I18N_BRIDGE__=s.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(l,c){var u=Object.getPrototypeOf(t);if(u&&u.getChoiceIndex){var d=u.getChoiceIndex;return d.call(t,l,c)}var h=function(p,m){return p=Math.abs(p),m===2?p?p>1?1:0:1:p?Math.min(p,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[l,c]):h(l,c)},this._exist=function(l,c){return!l||!c?!1:!!(!Lt(t._path.getPathValue(l,c))||l[c])},(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&Object.keys(n).forEach(function(l){t._checkLocaleMessage(l,t._warnHtmlInMessage,n[l])}),this._initVM({locale:r,fallbackLocale:i,messages:n,dateTimeFormats:a,numberFormats:o})},Ae={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};ce.prototype._checkLocaleMessage=function(s,t,r){var i=[],n=function(a,o,l,c){if(_s(l))Object.keys(l).forEach(function(h){var p=l[h];_s(p)?(c.push(h),c.push("."),n(a,o,p,c),c.pop(),c.pop()):(c.push(h),n(a,o,p,c),c.pop())});else if(Cs(l))l.forEach(function(h,p){_s(h)?(c.push("["+p+"]"),c.push("."),n(a,o,h,c),c.pop(),c.pop()):(c.push("["+p+"]"),n(a,o,h,c),c.pop())});else if(ot(l)){var u=DY.test(l);if(u){var d="Detected HTML in message '"+l+"' of keypath '"+c.join("")+"' at '"+o+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";a==="warn"?Oi(d):a==="error"&&YX(d)}}};n(t,s,r,i)};ce.prototype._initVM=function(s){var t=yt.config.silent;yt.config.silent=!0,this._vm=new yt({data:s,__VUE18N__INSTANCE__:!0}),yt.config.silent=t};ce.prototype.destroyVM=function(){this._vm.$destroy()};ce.prototype.subscribeDataChanging=function(s){this._dataListeners.add(s)};ce.prototype.unsubscribeDataChanging=function(s){eY(this._dataListeners,s)};ce.prototype.watchI18nData=function(){var s=this;return this._vm.$watch("$data",function(){for(var t=tY(s._dataListeners),r=t.length;r--;)yt.nextTick(function(){t[r]&&t[r].$forceUpdate()})},{deep:!0})};ce.prototype.watchLocale=function(s){if(s){if(!this.__VUE_I18N_BRIDGE__)return null;var r=this,i=this._vm;return this.vm.$watch("locale",function(n){i.$set(i,"locale",n),r.__VUE_I18N_BRIDGE__&&s&&(s.locale.value=n),i.$forceUpdate()},{immediate:!0})}else{if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(n){t.$set(t,"locale",n),t.$forceUpdate()},{immediate:!0})}};ce.prototype.onComponentInstanceCreated=function(s){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(s,this)};Ae.vm.get=function(){return this._vm};Ae.messages.get=function(){return Zi(this._getMessages())};Ae.dateTimeFormats.get=function(){return Zi(this._getDateTimeFormats())};Ae.numberFormats.get=function(){return Zi(this._getNumberFormats())};Ae.availableLocales.get=function(){return Object.keys(this.messages).sort()};Ae.locale.get=function(){return this._vm.locale};Ae.locale.set=function(e){this._vm.$set(this._vm,"locale",e)};Ae.fallbackLocale.get=function(){return this._vm.fallbackLocale};Ae.fallbackLocale.set=function(e){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",e)};Ae.formatFallbackMessages.get=function(){return this._formatFallbackMessages};Ae.formatFallbackMessages.set=function(e){this._formatFallbackMessages=e};Ae.missing.get=function(){return this._missing};Ae.missing.set=function(e){this._missing=e};Ae.formatter.get=function(){return this._formatter};Ae.formatter.set=function(e){this._formatter=e};Ae.silentTranslationWarn.get=function(){return this._silentTranslationWarn};Ae.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e};Ae.silentFallbackWarn.get=function(){return this._silentFallbackWarn};Ae.silentFallbackWarn.set=function(e){this._silentFallbackWarn=e};Ae.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent};Ae.preserveDirectiveContent.set=function(e){this._preserveDirectiveContent=e};Ae.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage};Ae.warnHtmlInMessage.set=function(e){var s=this,t=this._warnHtmlInMessage;if(this._warnHtmlInMessage=e,t!==e&&(e==="warn"||e==="error")){var r=this._getMessages();Object.keys(r).forEach(function(i){s._checkLocaleMessage(i,s._warnHtmlInMessage,r[i])})}};Ae.postTranslation.get=function(){return this._postTranslation};Ae.postTranslation.set=function(e){this._postTranslation=e};Ae.sync.get=function(){return this._sync};Ae.sync.set=function(e){this._sync=e};ce.prototype._getMessages=function(){return this._vm.messages};ce.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats};ce.prototype._getNumberFormats=function(){return this._vm.numberFormats};ce.prototype._warnDefault=function(s,t,r,i,n,a){if(!Lt(r))return r;if(this._missing){var o=this._missing.apply(null,[s,t,i,n]);if(ot(o))return o}if(this._formatFallbackMessages){var l=qc.apply(void 0,n);return this._render(t,a,l.params,t)}else return t};ce.prototype._isFallbackRoot=function(s){return(this._fallbackRootWithEmptyString?!s:Lt(s))&&!Lt(this._root)&&this._fallbackRoot};ce.prototype._isSilentFallbackWarn=function(s){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(s):this._silentFallbackWarn};ce.prototype._isSilentFallback=function(s,t){return this._isSilentFallbackWarn(t)&&(this._isFallbackRoot()||s!==this.fallbackLocale)};ce.prototype._isSilentTranslationWarn=function(s){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(s):this._silentTranslationWarn};ce.prototype._interpolate=function(s,t,r,i,n,a,o){if(!t)return null;var l=this._path.getPathValue(t,r);if(Cs(l)||_s(l))return l;var c;if(Lt(l))if(_s(t)){if(c=t[r],!(ot(c)||zh(c)))return null}else return null;else if(ot(l)||zh(l))c=l;else return null;return ot(c)&&(c.indexOf("@:")>=0||c.indexOf("@.")>=0)&&(c=this._link(s,t,c,i,"raw",a,o)),this._render(c,n,a,r)};ce.prototype._link=function(s,t,r,i,n,a,o){var l=r,c=l.match(MY);for(var u in c)if(c.hasOwnProperty(u)){var d=c[u],h=d.match(EY),p=h[0],m=h[1],f=d.replace(p,"").replace(OY,"");if(Sa(o,f))return l;o.push(f);var b=this._interpolate(s,t,f,i,n==="raw"?"string":n,n==="raw"?void 0:a,o);if(this._isFallbackRoot(b)){if(!this._root)throw Error("unexpected error");var C=this._root.$i18n;b=C._translate(C._getMessages(),C.locale,C.fallbackLocale,f,i,n,a)}b=this._warnDefault(s,f,b,i,Cs(a)?a:[a],n),this._modifiers.hasOwnProperty(m)?b=this._modifiers[m](b):Z_.hasOwnProperty(m)&&(b=Z_[m](b)),o.pop(),l=b?l.replace(d,b):l}return l};ce.prototype._createMessageContext=function(s,t,r,i){var n=this,a=Cs(s)?s:[],o=Xt(s)?s:{},l=function(h){return a[h]},c=function(h){return o[h]},u=this._getMessages(),d=this.locale;return{list:l,named:c,values:s,formatter:t,path:r,messages:u,locale:d,linked:function(h){return n._interpolate(d,u[d]||{},h,null,i,void 0,[h])}}};ce.prototype._render=function(s,t,r,i){if(zh(s))return s(this._createMessageContext(r,this._formatter||qh,i,t));var n=this._formatter.interpolate(s,r,i);return n||(n=qh.interpolate(s,r,i)),t==="string"&&!ot(n)?n.join(""):n};ce.prototype._appendItemToChain=function(s,t,r){var i=!1;return Sa(s,t)||(i=!0,t&&(i=t[t.length-1]!=="!",t=t.replace(/!/g,""),s.push(t),r&&r[t]&&(i=r[t]))),i};ce.prototype._appendLocaleToChain=function(s,t,r){var i,n=t.split("-");do{var a=n.join("-");i=this._appendItemToChain(s,a,r),n.splice(-1,1)}while(n.length&&i===!0);return i};ce.prototype._appendBlockToChain=function(s,t,r){for(var i=!0,n=0;n0;)a[o]=arguments[o+4];if(!s)return"";var l=qc.apply(void 0,a);this._escapeParameterHtml&&(l.params=nY(l.params));var c=l.locale||t,u=this._translate(r,c,this.fallbackLocale,s,i,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(n=this._root).$t.apply(n,[s].concat(a))}else return u=this._warnDefault(c,s,u,i,a,"string"),this._postTranslation&&u!==null&&u!==void 0&&(u=this._postTranslation(u,s)),u};ce.prototype.t=function(s){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this)._t.apply(t,[s,this.locale,this._getMessages(),null].concat(r))};ce.prototype._i=function(s,t,r,i,n){var a=this._translate(r,t,this.fallbackLocale,s,i,"raw",n);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(s,t,n)}else return this._warnDefault(t,s,a,i,[n],"raw")};ce.prototype.i=function(s,t,r){return s?(ot(t)||(t=this.locale),this._i(s,t,this._getMessages(),null,r)):""};ce.prototype._tc=function(s,t,r,i,n){for(var a,o=[],l=arguments.length-5;l-- >0;)o[l]=arguments[l+5];if(!s)return"";n===void 0&&(n=1);var c={count:n,n},u=qc.apply(void 0,o);return u.params=Object.assign(c,u.params),o=u.locale===null?[u.params]:[u.locale,u.params],this.fetchChoice((a=this)._t.apply(a,[s,t,r,i].concat(o)),n)};ce.prototype.fetchChoice=function(s,t){if(!s||!ot(s))return null;var r=s.split("|");return t=this.getChoiceIndex(t,r.length),r[t]?r[t].trim():s};ce.prototype.tc=function(s,t){for(var r,i=[],n=arguments.length-2;n-- >0;)i[n]=arguments[n+2];return(r=this)._tc.apply(r,[s,this.locale,this._getMessages(),null,t].concat(i))};ce.prototype._te=function(s,t,r){for(var i=[],n=arguments.length-3;n-- >0;)i[n]=arguments[n+3];var a=qc.apply(void 0,i).locale||t;return this._exist(r[a],s)};ce.prototype.te=function(s,t){return this._te(s,this.locale,this._getMessages(),t)};ce.prototype.getLocaleMessage=function(s){return Zi(this._vm.messages[s]||{})};ce.prototype.setLocaleMessage=function(s,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(s,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,s,t)};ce.prototype.mergeLocaleMessage=function(s,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(s,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,s,Er(typeof this._vm.messages[s]<"u"&&Object.keys(this._vm.messages[s]).length?Object.assign({},this._vm.messages[s]):{},t))};ce.prototype.getDateTimeFormat=function(s){return Zi(this._vm.dateTimeFormats[s]||{})};ce.prototype.setDateTimeFormat=function(s,t){this._vm.$set(this._vm.dateTimeFormats,s,t),this._clearDateTimeFormat(s,t)};ce.prototype.mergeDateTimeFormat=function(s,t){this._vm.$set(this._vm.dateTimeFormats,s,Er(this._vm.dateTimeFormats[s]||{},t)),this._clearDateTimeFormat(s,t)};ce.prototype._clearDateTimeFormat=function(s,t){for(var r in t){var i=s+"__"+r;this._dateTimeFormatters.hasOwnProperty(i)&&delete this._dateTimeFormatters[i]}};ce.prototype._localizeDateTime=function(s,t,r,i,n,a){for(var o=t,l=i[o],c=this._getLocaleChain(t,r),u=0;u0;)t[r]=arguments[r+1];var i=this.locale,n=null,a=null;return t.length===1?(ot(t[0])?n=t[0]:Xt(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(n=t[0].key)),a=Object.keys(t[0]).reduce(function(o,l){var c;return Sa(XX,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(ot(t[0])&&(n=t[0]),ot(t[1])&&(i=t[1])),this._d(s,i,n,a)};ce.prototype.getNumberFormat=function(s){return Zi(this._vm.numberFormats[s]||{})};ce.prototype.setNumberFormat=function(s,t){this._vm.$set(this._vm.numberFormats,s,t),this._clearNumberFormat(s,t)};ce.prototype.mergeNumberFormat=function(s,t){this._vm.$set(this._vm.numberFormats,s,Er(this._vm.numberFormats[s]||{},t)),this._clearNumberFormat(s,t)};ce.prototype._clearNumberFormat=function(s,t){for(var r in t){var i=s+"__"+r;this._numberFormatters.hasOwnProperty(i)&&delete this._numberFormatters[i]}};ce.prototype._getNumberFormatter=function(s,t,r,i,n,a){for(var o=t,l=i[o],c=this._getLocaleChain(t,r),u=0;u0;)t[r]=arguments[r+1];var i=this.locale,n=null,a=null;return t.length===1?ot(t[0])?n=t[0]:Xt(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(n=t[0].key),a=Object.keys(t[0]).reduce(function(o,l){var c;return Sa(XC,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(ot(t[0])&&(n=t[0]),ot(t[1])&&(i=t[1])),this._n(s,i,n,a)};ce.prototype._ntp=function(s,t,r,i){if(!ce.availabilities.numberFormat)return[];if(!r){var n=i?new Intl.NumberFormat(t,i):new Intl.NumberFormat(t);return n.formatToParts(s)}var a=this._getNumberFormatter(s,t,this.fallbackLocale,this._getNumberFormats(),r,i),o=a&&a.formatToParts(s);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(s,t,r,i)}else return o||[]};Object.defineProperties(ce.prototype,Ae);var Ru;Object.defineProperty(ce,"availabilities",{get:function(){if(!Ru){var s=typeof Intl<"u";Ru={dateTimeFormat:s&&typeof Intl.DateTimeFormat<"u",numberFormat:s&&typeof Intl.NumberFormat<"u"}}return Ru}});ce.install=Wm;ce.version="8.28.2";const s$=ce,r$={Notifications:{BrowserWarnings:{Description:"{name} is outdated and not fully supported. The current version is {version}, but Mainsail requires version {minVersion} or higher.",Headline:"Outdated Browser"},DependencyDescription:"The current {name} version does not support all features of Mainsail. Update {name} to at least {neededVersion}.",DependencyName:"Dependency: {name}",DismissAll:"Dismiss all",KlipperWarnings:{DeprecatedOption:"Option '{option}' in section '{section}' is deprecated and will be removed in a future release.",DeprecatedOptionHeadline:"Deprecated Klipper Option",DeprecatedValue:"Value '{value}' in option '{option}' in section '{section}' is deprecated and will be removed in a future release.",DeprecatedValueHeadline:"Deprecated Klipper Value",KlipperWarning:"Klipper warning"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"An error was detected while loading the moonraker component '{component}'. Please check the log file and fix the issue.",MoonrakerFailedInitComponentDescription:"An error was detected during initialization the moonraker component '{component}'. Please check the log file and fix the issue.",MoonrakerInitComponent:"Init. Moonraker: {component}",MoonrakerWarning:"Moonraker warning",UnparsedConfigOption:"Unparsed config option '{option}: {value}' detected in section [{section}]. This may be an option no longer available or could be the result of a module that failed to load. In the future this will result in a startup error.",UnparsedConfigSection:"Unparsed config section [{section}] detected. This may be the result of a component that failed to load. In the future this will result in a startup error."},Never:"never",NextReboot:"next reboot",NoNotification:"No Notification available",Notifications:"Notifications",Remind:"Remind:"},NumberInput:{GreaterOrEqualError:"Must be greater or equal than {min}!",MustBeBetweenError:"Must be between {min} and {max}!",NoEmptyAllowedError:"Input must not be empty!"},Printers:"Printers",TheServiceWorker:{DescriptionNeedUpdate:"The local cache is outdated and needs to be updated. Please click on the button below to update the cache.",TitleNeedUpdate:"PWA needs update",Update:"update"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM core(s) are currently throttled down.",DescriptionFrequencyCapped:"rPi ARM max frequency is currently limited to 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"rPi ARM max frequency was at least once limited to 1.2 GHz since last power-on.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only) temperature was at least once above the soft limit (default 60C) since last power-on.",DescriptionPreviouslyThrottled:"rPI ARM core(s) where throttled down at least once since last power-on.",DescriptionPreviouslyUnderVolted:"rPI supply voltage dropped below 4.65V at least once since the last power-on.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ only) temperature is currently above the soft limit (default 60C).",DescriptionUnderVoltageDetected:"rPI supply voltage currently below 4.65V",TitleCurrentlyThrottled:"Currently Throttled",TitleFrequencyCapped:"Frequency Capped",TitlePreviouslyFrequencyCapped:"Previously Frequency Capped",TitlePreviouslyTemperatureLimited:"Previously Temperature Limited",TitlePreviouslyThrottled:"Previously Throttled",TitlePreviouslyUnderVolted:"Previously Under-Volted",TitleTemperatureLimitActive:"Temperature Limit Active",TitleUnderVoltageDetected:"Under-Voltage Detected"},Titles:{Complete:"Complete - {filename}",Error:"ERROR",Pause:"Pause Print",PrinterOff:"Printer OFF",Printing:"{percent}% Printing - {filename}",PrintingETA:"{percent}% Printing - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Cannot upload the file!",EmergencyStop:"Emergency Stop",SAVE_CONFIG:"SAVE CONFIG",Uploading:"Uploading",UploadOfFileSuccessful:"Upload of {file} successful!",UploadPrint:"Upload & Print"},TopCornerMenu:{Cancel:"Cancel",ConfirmationDialog:{Description:{HostReboot:"Rebooting the Host will cause the current print to fail!",HostShutdown:"Shutting down the Host will cause the current print to fail!",KlipperFirmwareRestart:"Restarting the Klipper Firmware will cause the current print to fail!",KlipperRestart:"Restarting Klipper will cause the current print to fail!",KlipperStop:"Stopping Klipper will cause the current print to fail!",ServiceRestart:"Restarting this service may cause the current print to fail!",ServiceStart:"Starting this service may cause the current print to fail!",ServiceStop:"Stopping this service may cause the current print to fail!"},Title:{HostReboot:"Host Reboot",HostShutdown:"Host Shutdown",KlipperFirmwareRestart:"Klipper Firmware Restart",KlipperRestart:"Klipper Restart",ServiceRestart:"Service Restart",ServiceStart:"Service Start",ServiceStop:"Service Stop"}},HostControl:"Host Control",KlipperControl:"Klipper Control",KlipperFirmwareRestart:"Firmware Restart",KlipperRestart:"Restart",PowerDevices:"Power Devices",Reboot:"Reboot",Restart:"Restart",ServiceControl:"Service Control",Shutdown:"Shutdown",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Close",Empty:"Empty",Recovering:"Recovering {software}...",RecoveringDone:"Recovering {software} done!",Updating:"Updating {software}...",UpdatingDone:"Updating {software} done!"}},i$={Abort:"abort",Accept:"accept",Adjusted:"adjusted",Description:"Click on ADJUSTED if the current screw was adjusted. Click on ACCEPT to continue without adjustment.",Headline:"Bed Screws",ScrewAccepted:"Screws accepted",ScrewIndex:"Screw Index",ScrewName:"Screw Name",ScrewOutput:"{current} of {max}"},n$={CannotConnectTo:"Cannot connect to Moonraker ({host}).",CheckMoonrakerLog:"If this message appears repeatedly, please have a look in the log file located at:",Connecting:"Connecting to {host}",Failed:"Connection failed",Initializing:"Initializing",TryAgain:"try again"},a$={CommandList:"Command list",Empty:"Empty",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",SendCode:"Send code...",SetupConsole:"Setup Console"},o$={StartPrint:{Cancel:"Cancel",DoYouWantToStartFilename:"Do you want to start {filename}?",DoYouWantToStartFilenameFilament:"Do you want to start {filename} with the following filament?",Headline:"Start Job",Print:"print",Timelapse:"Timelapse"}},l$={ConfigReference:"Config Reference",DontSave:"Don't save",Downloading:"Downloading",FailedSave:"{filename} could not be uploaded!",FileReadOnly:"read-only",SaveClose:"Save & close",SaveRestart:"Save & Restart",SuccessfullySaved:"{filename} successfully saved.",UnsavedChanges:"Unsaved Changes",UnsavedChangesMessage:"Do you want to save your changes made to {filename}?",UnsavedChangesSubMessage:"Your changes will be lost if you don't save them. You can disable this message in the editor settings.",Uploading:"Uploading"},c$={AreYouSure:"Are you sure?",EmergencyStop:"Emergency Stop",No:"No",Yes:"Yes"},u$={AddBatchToQueue:"Add batch to Queue",AddToQueue:"Add to Queue",AllFiles:"All",BedTemp:"Bed Temp.",Cancel:"Cancel",ChamberTemp:"Chamber Temp.",Count:"Count",Create:"Create",CreateNewDirectory:"Create new Directory",CurrentPath:"Current path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Do you really want to delete the "{name}" directory with all its contents?',DeleteSelectedQuestion:"Do you really want to delete {count} selected files?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",Duplicate:"Duplicate",DuplicateFile:"Duplicate File",EditFile:"Edit File",Empty:"Empty",ExtruderTemp:"Extruder Temp.",Filament:"Filament",FilamentName:"Filament Name",FilamentType:"Filament Type",FilamentUsage:"Filament Usage",FilamentWeight:"Filament Weight",Files:"Files",Filesize:"File size",Free:"Free",FreeDisk:"Free disk",GCodeFiles:"G-Code Files",GcodesRootDirectoryDoesntExists:'No G-Code directory found. Please check option "path" in the [virtual_sdcard] section of the Klipper configuration.',HiddenFiles:"Hidden files",InvalidNameAlreadyExists:"Name already exists, please choose another name.",InvalidNameEmpty:"Input must not be empty!",LastEndTime:"Last End Time",LastFilamentUsed:"Last Filament Used",LastModified:"Last modified",LastPrintDuration:"Last Print Duration",LastStartTime:"Last Start Time",LastTotalDuration:"Last Total Duration",LayerHeight:"Layer Height",Name:"Name",NewDirectory:"New Directory",NozzleDiameter:"Nozzle Diameter",ObjectHeight:"Object Height",Preheat:"Preheat",PrintedFiles:"Printed files",PrintStart:"Print start",PrintTime:"Print Time",RefreshCurrentDirectory:"Refresh current Directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",ScanMeta:"Scan Metadata",ScanMetaSuccess:"Successfully scanned metadata from: {filename}.",Search:"Search",SetupCurrentList:"Setup current list",Slicer:"Slicer",SuccessfullyCreated:"Successfully created {filename}.",SuccessfullyDeleted:"Successfully deleted {filename}.",SuccessfullyMoved:"Successfully moved {filename}.",SuccessfullyRenamed:"Successfully renamed {filename}.",SuccessfullyUploaded:"Upload of {filename} successful!",Total:"Total",UploadNewGcode:"Upload new G-Code",Used:"Used",View3D:"View 3D"},d$={CannotUploadFile:"Cannot upload file!",DropFilesToUploadFiles:"Drop files to upload"},h$={ClearLoadedFile:"Clear",CNCMode:"CNC Mode",ColorMode:"Color Mode",Downloading:"Downloading",ForceLineRendering:"Force Line Rendering",HDRendering:"HD Rendering (Round Extrusions)",High:"High",LoadCurrentFile:"Current file",LoadLocal:"Local File",Low:"Low",Max:"Max",Medium:"Medium",ReloadRequired:"Reload required",Rendering:"Rendering",RenderQuality:"Render Quality",ShowGCode:"Show G-Code",ShowObjectSelection:"Show Object Selection",ShowToolhead:"Show Toolhead",ShowTravelMoves:"Show Travel Moves",SpecularLighting:"Specular Lighting",Title:"G-Code Viewer",Tracking:"Tracking",Transparency:"Transparency",Ultra:"Ultra",VoxelMode:"Voxel Mode (ASMBL)"},p$={Abort:"abort",BedMeshCalibrate:"Bed Mesh Calibrate",BedMeshRemove:"Bed Mesh Remove",Calibrate:"calibrate",Clear:"clear",CurrentMesh:{Headline:"Current Mesh",Max:"Max",Min:"Min",Name:"Name",Range:"Range",Size:"Size"},DeleteBedMeshProfile:"Delete Bed Mesh Profile",DoYouReallyWantToDelete:'Do you really want to delete the profile "{name}"?',ErrorKlipperNotReady:"Klipper not ready. Heightmap disabled.",Flat:"Flat",Heightmap:"Heightmap",InvalidNameAlreadyExists:"Profile name already exists, please choose another profile name.",InvalidNameAscii:"Name is invalid. Only ascii character are allowed.",InvalidNameEmpty:"Input must not be empty!",InvalidNameReserved:"Profile 'default' is reserved, please choose another profile name.",Later:"Later",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"No bed mesh has been loaded yet.",NoProfile:"No profile available",Ok:"OK",Probed:"Probed",Profiles:"Profiles",Remove:"delete",RemoveSaveDescription:"The bed_mesh profile has been registered as deleted. Click on SAVE_CONFIG to remove it from the printer.cfg and restart Klipper.",Rename:"rename",RenameBedMeshProfile:"Rename Bed Mesh Profile",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Scale gradient",ScaleZMax:"Scale z-max.",TitleCalibrate:"Calibrate new bed mesh",TitleClear:"Clear bed mesh",TitleHomeAll:"Home all",Wireframe:"Wireframe"},m$={AddNote:"Add note",AllJobs:"All",AvgPrinttime:"Print Time - Ø",Cancel:"Cancel",Chart:"Chart",CreateNote:"Create Note",Delete:"Delete",DeleteSelectedQuestion:"Do you really want to delete {count} selected jobs?",DeleteSingleJobQuestion:"Do you really want to delete the job?",Details:"Details",EditNote:"Edit Note",Empty:"empty",EndTime:"End Time",EstimatedFilament:"Estimated Filament",EstimatedFilamentWeight:"Estimated Filament Weight",EstimatedTime:"Estimated Time",FilamentCalc:"Filament Calc",FilamentUsage:"Filament usage",FilamentUsed:"Filament Used",Filename:"Filename",Filesize:"Filesize",FirstLayerBedTemp:"First Layer Bed Temp.",FirstLayerExtTemp:"First Layer Ext. Temp.",FirstLayerHeight:"First Layer Height",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Prints",JobDetails:"Job Details",Jobs:"Jobs",LastModified:"Last Modified",LayerHeight:"Layer Height",LoadCompleteHistory:"Load complete history",LongestPrinttime:"Longest Print Time",Note:"Note",ObjectHeight:"Object Height",PrintDuration:"Print Time",PrintHistory:"Print History",PrintTime:"Print Time",PrinttimeAvg:"Print Time - Ø",Reprint:"Reprint",Save:"save",Search:"search",SelectedFilamentUsed:"Selected Filament Used",SelectedJobs:"Selected Jobs",SelectedPrinttime:"Selected Print Time",Slicer:"Slicer",SlicerVersion:"Slicer Version",StartTime:"Start Time",Statistics:"Statistics",Status:"Status",StatusValues:{cancelled:"Cancelled",completed:"Completed",error:"Error",in_progress:"In progress",klippy_disconnect:"Klippy disconnect",klippy_shutdown:"Klippy shutdown",Others:"Others",server_exit:"Server exit"},Table:"Table",TitleExportHistory:"Export History",TotalDuration:"Total Time",TotalFilamentUsed:"Total Filament Used",TotalJobs:"Total Jobs",TotalPrinttime:"Total Print Time",TotalTime:"Total Time"},f$={AllJobs:"All Jobs",Cancel:"Cancel",ChangeCount:"Change count",Count:"Count",Empty:"Empty",InvalidCountEmpty:"Input must not be empty!",InvalidCountGreaterZero:"Input must be greater than 0!",JobQueue:"Job Queue",Jobs:"Jobs",Pause:"Pause",RemoveFromQueue:"Remove from Queue",Start:"Start"},g$={ConfigFilesPanel:{AllFiles:"All",Cancel:"Cancel",ConfigFiles:"Config Files",ConfigRootDirectoryDoesntExists:'No configuration directory found. Please check option "config_path" in the [file_manager] section of the Moonraker configuration.',Create:"Create",CreateDirectory:"Create Directory",CreateFile:"Create File",CurrentPath:"Current path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Delete directory "{name}" and all its contents?',DeleteSelectedQuestion:"Delete {count} selected elements?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",Duplicate:"Duplicate",DuplicateFile:"Duplicate File",EditFile:"Edit file",Empty:"Empty",Files:"Files",Filesize:"Filesize",Free:"Free",FreeDisk:"Free disk",HiddenFiles:"Hidden files",HideBackupFiles:"Hide backup files",LastModified:"Last modified",Name:"Name",RefreshDirectory:"Refresh Directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",Root:"Root",SetupCurrentList:"Setup current list",ShowFile:"Show file",Total:"Total",UploadFile:"Upload File",Uploading:"Uploading",Used:"Used"},EndstopPanel:{Endstop:"Endstop",EndstopInfo:"Press the sync-button on the right-bottom to load the current endstop status.",Endstops:"Endstops",open:"OPEN",TRIGGERED:"TRIGGERED"},LogfilesPanel:{Accept:"accept",Cancel:"cancel",Logfiles:"Log Files",Rollover:"Rollover Logs",RolloverDescription:"Please select which logs should be reset:",RolloverToastFailed:'Rollover log for "{name}": {message}',RolloverToastSuccessful:'Log for "{name}" was successfully reset.'},SystemPanel:{Constants:"Constants",Cpu:"CPU",HostDetails:"Host details",LastStats:"Last stats",Load:"Load",Memory:"MEM",NoMoreInfos:"No more Infos",SystemLoad:"System Loads",Values:{Awake:"Awake: {awake}",Bandwidth:"Bandwidth: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Freq: {frequency}",Load:"Load: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Received: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmitted: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abort",AreYouSure:"Are you sure?",CheckForUpdates:"Check for updates",Close:"Close",CommitHistory:"Commit History",Commits:"Commits",CommitsAvailable:"no commits available | {count} commit available | {count} commits available",CommitsOnDate:"Commits on {date}",CommittedDaysAgo:"committed {days} days ago",CommittedHoursAgo:"committed {hours} hours ago",CommittedOnDate:"committed on {date}",CommittedYesterday:"committed yesterday",ConfigChanges:"Config Changes",Corrupt:"corrupt",CountPackagesCanBeUpgraded:"{count} packages can be upgraded",Detached:"detached",Dirty:"dirty",GenericUpdateQuestion:"Check the commit history (if available) and the GitHub page for this project to see if any manual adjustments are necessary for this update.",GitHubPage:"GitHub Page",HardRecovery:"Hard Recovery",InitUpdateManager:"The Update Manager has not been initialized yet. This is normal when you start the system for the first time. Please click on the refresh button to initialize all components.",Invalid:"invalid",IUnderstandTheRisks:"I understand the risks",KlipperUpdateQuestionConfig:"This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",KlipperUpdateQuestionFirmware:"This will update the Klipper host software. Control boards running the Klipper firmware may need to be flashed with recompiled firmware before the machine can be put back into service.",LinkToGithub:"Link to GitHub",MoonrakerUpdateQuestion:"This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",MoreCommitsInfo:"A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",OSPackages:"OS-Packages",SoftRecovery:"Soft Recovery",StartUpdate:"Start Update",System:"System",ThesePackagesCanBeUpgrade:"These system packages can be upgraded:",Unknown:"unknown",Update:"update",UpdateAll:"Update all components",UpdateManager:"Update Manager",UpdateWarning:"Update warning: {name}",Upgrade:"upgrade",UpgradeableSystemPackages:"Upgradeable System Packages",UpToDate:"up-to-date",WebClientUpdateQuestion:"In some cases updating the web client could have changes that may cause incompatibility. See the release notes for more information."}},v$={Abort:"abort",Accept:"accept",Advanced:"Advanced",Headline:"Manual Probe"},_$={ExtruderControlPanel:{Allowed:"Allowed",CleanNozzle:"Clean Nozzle",EstimatedExtrusion:"Extrusion:",Extrude:"Extrude",ExtruderControl:"Extruder Control",ExtruderTempTooLow:"Extruder temp. <",ExtrusionFactor:"Extrusion factor",ExtrusionFeedrate:"Extrusion Feedrate",FilamentLength:"Filament Length",FirmwareRetraction:"Firmware Retraction",FirmwareRetractionSettings:{RetractLength:"Retract Length",RetractSpeed:"Retract Speed",UnretractExtraLength:"Unretract Extra Length",UnretractSpeed:"Unretract Speed"},Headline:"Extruder",LoadFilament:"Load Filament",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Pressure Advance",Extruder:"Extruder",SmoothTime:"Smooth Time"},PurgeFilament:"Purge Filament",Requested:"Requested",Retract:"Retract",TooLargeExtrusion:"Extrusion too large!",Tools:"Tools",UnloadFilament:"Unload Filament"},FarmPrinterPanel:{ReconnectToPrinter:"Reconnect",SwitchToPrinter:"Switch to Printer",WebcamOff:"Off"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Please check if the Klipper service is running and klippy_uds_address is correctly configured in the moonraker.conf.",FirmwareRestart:"Firmware Restart",MoonrakerCannotConnect:"Moonraker can't connect to Klipper!",PowerOn:"Power on",PrinterSwitchedOff:"Printer is powered off",PrinterSwitchedOffDescription:"The printer is currently powered off and Klipper cannot connect. To power on the printer, click the button below:",Restart:"Restart",ServiceReports:"{service} reports"},MachineSettingsPanel:{Headline:"Machine",MotionSettings:{Acceleration:"Acceleration",MaxAccelToDecel:"Max Accel. to Decel.",MinimumCruiseRatio:"Min. Cruise Ratio",SquareCornerVelocity:"Square Corner Velocity",Velocity:"Velocity"}},MacrosPanel:{Headline:"Macros",Send:"send"},MiniconsolePanel:{Autoscroll:"Autoscroll",Headline:"Console",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",SendCode:"Send code...",SetupConsole:"Setup Console"},MinSettingsPanel:{IncludeMainsailCfg:"Make sure you include the mainsail.cfg in your printer.cfg file.",IsNotDefinedInConfig:"is not defined in config.",MissingConfiguration:"Missing configuration",MoreInformation:"more information"},MiscellaneousPanel:{Headline:"Miscellaneous",Light:{Blue:"blue",Green:"green",Red:"red",White:"white"},RunoutSensor:{Detected:"detected",Empty:"empty"}},PowerControlPanel:{Error:"Error",Off:"Off",On:"On",PowerControl:"Power Control"},SpoolmanPanel:{Cancel:"Cancel",ChangeSpool:"Change Spool",DaysAgo:"{days} days ago",EjectSpool:"Eject spool",EjectSpoolQuestion:"Are you sure to eject the filament spool?",Filament:"Filament",FilamentTypeMismatch:"The material of the active spool ({spoolType}) does not match the material of the G-Code ({fileType}).",Headline:"Spoolman",LastUsed:"Last Used",Location:"Location",Material:"Material",Never:"Never",NoActiveSpool:"Filament tracking is inactive. To get started, please select a spool.",NoResults:"No spool found with the current search criteria.",NoSpools:"No spools available",NoSpoolSelected:"No spool selected. Please select a spool or this print will not be tracked.",OpenSpoolManager:"open Spool Manager",Refresh:"refresh",Search:"Search",SelectSpool:"Select Spool",Today:"Today",TooLessFilament:"The current spool may not have enough filament for this print. ({spoolWeight}g of {fileWeight}g)",Weight:"Weight",Yesterday:"Yesterday"},StatusPanel:{CancelPrint:"Cancel print",ClearPrintStats:"Clear print stats",Difference:"Difference",EmptyGcodes:"No G-Code available.",EmptyJobqueue:"There is currently no file in the job queue.",Estimate:"Estimate",ETA:"ETA",ExcludeObject:{Cancel:"cancel",Excluded:"Excluded",ExcludeObject:"Exclude Object",ExcludeObjectHeadline:"Exclude Object",ExcludeObjectText:'Do you really want to exclude "{name}"?'},Filament:"Filament",File:"File",Files:"Files",Flow:"Flow",Headline:"Status",Jobqueue:"Job Queue",JobqueueMoreFiles:"no more jobs | one more job | {count} more jobs",Layer:"Layer",Max:"max",ObjectHeight:"Object Height",PauseAtLayer:{Abort:"abort",Accept:"accept",AtLayer:"at Layer",Call:"Call",DescriptionPauseAtLayerActive:'This function is already active and will call "{call}" at layer {layer}. If you call the command again, these settings will be overwritten.',DescriptionPauseNextLayerActive:'This function is already active and will call "{call}" at the next layer.',Layer:"Layer",NextLayer:"next Layer",PauseAtLayer:"Pause at Layer",Type:"Type"},PausePrint:"Pause print",Print:"Print",PrintTime:"Print Time",ReprintJob:"Reprint job",Requested:"Requested",ResumePrint:"Resume print",Slicer:"Slicer",Speed:"Speed",Status:"Status",Total:"Total",Unknown:"Unknown"},TemperaturePanel:{AutoscaleChart:"Autoscale Chart",Avg:"Avg",Cooldown:"Cooldown",Current:"Current",Dataset:{Power:"PWM-power",Speed:"PWM-speed",Target:"target temperature",Temperature:"current temperature"},Headline:"Temperatures",HideMcuHostSensors:"Hide Host/MCU Sensors",HideMonitors:"Hide Monitors",Max:"max",Min:"min",Name:"Name",Presets:"Presets",SetupTemperatures:"Setup Temperatures",ShowChart:"Show Chart",ShowNameInChart:"Show {name} in chart",ShowNameInList:"Show {name} in list",State:"State",Target:"Target",TemperaturesInChart:"Temperature [°C]",TempTooHigh:"Temperature too high for {name}! (max: {max})",TempTooLow:"Temperature too low for {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absolute",ALL:"ALL",ControlButtons:"Control buttons",CoordinateFields:"Coordinate fields",Headline:"Toolhead",PleaseConfigureSteps:"Please configure steps",Position:"Position",PositionOutput:"Position output",QGL:"QGL",Relative:"relative",SettingsInterfaceControl:"Settings > Interface > Control",SpeedFactor:"Speed factor",ZOffset:"Z-Offset",ZTilt:"Z-Tilt"},WebcamPanel:{All:"All",FPS:"FPS",Headline:"Webcam",NoWebcam:'No webcam available. Add a webcam under "Interface Settings" -> "Webcams".',UnknownWebcamService:"Unknown Webcam Service"},ZoffsetPanel:{Clear:"Clear",Headline:"Z-Offset",Later:"Later",Ok:"OK",Save:"Save",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'The new Z-Offset has been calculated and registered. Click on "SAVE CONFIG" to save it to the printer.cfg and restart Klipper.',SaveInfoDescriptionPrint:'The new Z-Offset has been calculated and registered. After printing, click on "SAVE CONFIG" in the top bar to save it to the printer.cfg and restart Klipper.',SaveInfoHeadline:"Information"}},b$={AreYouSure:"Are you sure?",No:"No",TurnDeviceOff:"Turn {device} off",TurnDeviceOn:"Turn {device} on",Yes:"Yes"},y$={Console:"Console",Dashboard:"Dashboard","G-Code Files":"G-Code Files","G-Code Viewer":"G-Code Viewer",Heightmap:"Heightmap",History:"History",Machine:"Machine",Printers:"Printers",Timelapse:"Timelapse",Webcam:"Webcam"},C$={Accept:"accept",Base:"Base",ErrorText:"Something went wrong during the probing process.",Headline:"Screws tilt adjust",Retry:"retry"},$$={AddPrinter:"Add Printer",AddPrintersToJson:"Please add the Printers to the config.json.",CannotConnectTo:"Cannot connect to {host}.",ChangePrinter:"Change Printer",Connecting:"Connecting to {host}",ConnectionFailed:"Connection failed",EditPrinter:"Edit Printer",Hello:"Hello and welcome to the remote mode of Mainsail!",HostnameInvalid:"invalid Hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Hostname is required",Port:"Port",PortRequired:"Port is required",RememberToAdd:"Please remember to add '{cors}' in moonraker.conf within 'cors_domains'.",SelectPrinter:"Select Printer",TryAgain:"try again",UpdatePrinter:"Update Printer",YouCanFindMore:"You can find more details at"},x$={Cancel:"Cancel",Close:"Close",ConsoleTab:{AddFilter:"add filter",Console:"Console",CreateHeadline:"Create filter",Direction:"Direction",DirectionShell:"Last entry at the bottom",DirectionTable:"Last entry on the top",EditHeadline:"Edit filter",EntryStyle:"Entry-Design",EntryStyleCompact:"compact",EntryStyleDefault:"default",Filters:"Filters",Height:"Height",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",Name:"Name",Regex:"Regex",StoreButton:"Store filter",UpdateButton:"Update filter"},ControlTab:{Bars:"Bars",Circle:"Circle",Control:"Control",Cross:"Cross",EnableXYHoming:"Enable combined X & Y axes homing",EstimatedExtrusionInfo:"Show estimated extrusion info",EstimatedExtrusionInfoDescription:"Show / Hide info for estimated extrusions based on extrusion amount and feedrate",HideDuringPrint:"Hide axis controls during print",InvertXMovement:"Invert X axis movement direction",InvertYMovement:"Invert Y axis movement direction",InvertZMovement:"Invert Z axis movement direction",IsDefault:" (default)",MaximumValues:"Maximum values: {maximum}",MaximumValuesVisibility:"Maximum of {maximum} values is recommended for best visibility",MinimumValues:"Minimum values: {minimum}",MotorsOff:"Motors off{isDefault}",MoveDistancesEInMm:"Extrusion amount presets (in mm)",MoveDistancesInMm:"Move distance increments (in mm)",MoveDistancesXYInMm:"Move distance increments X & Y axes (in mm)",MoveDistancesZInMm:"Move distance increments Z axis (in mm)",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Extrusion speed presets (in mm/s)",SpeedXY:"Movement speed X & Y axes",SpeedZ:"Movement speed Z axis",Style:"Style",ValueGreaterThan:"Value has to be greater than {value}",ZOffsetIncrements:"Z-Offset increments (in mm)",ZOffsetSaveOption:"Z-Offset save option",ZOffsetSaveOptionDescription:"Change the option to save the Z-Offset",ZTiltAdjust:"Z-Tilt Adjust{isDefault}"},DashboardTab:{Dashboard:"Dashboard",Desktop:"Desktop",Mobile:"Mobile",ResetLayout:"Reset Layout",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Edit",EditorTab:{ConfirmUnsavedChanges:"Prompt to save or discard unsaved changes",ConfirmUnsavedChangesDescription:"If enabled, the editor requires a confirmation to either save or discard the changes made. If disabled, changes are silently discarded.",Editor:"Editor",KlipperRestartMethod:"Klipper restart method",KlipperRestartMethodDescription:"Select which restart method will be used on 'Save & Restart' when editing Klipper config files.",Spaces:"Spaces: {count}",TabSize:"TAB Size",TabSizeDescription:"Adjusts how many spaces should be indented for TAB",UseEscToClose:"Use ESC to close editor",UseEscToCloseDescription:"Allows the ESC key to close the editor"},GCodeViewerTab:{BackgroundColor:"Background Color",ExtruderColor:"Extruder Colors",GCodeViewer:"G-Code Viewer",GridColor:"Grid Color",MaxFeed:"Max Feed Rate",MinFeed:"Min Feed Rate",ProgressColor:"Progress Color",ShowAxes:"Show Axes"},GeneralTab:{"12hours":"12-hours ({time})","24hours":"24-hours ({time})",Backup:"Backup",BackupDialog:"Please select all the sections you want to create a backup:",CalcEstimateTime:"Estimate time calculation",CalcEstimateTimeDescription:"If multiple are selected, an average will be calculated",CalcEtaTime:"ETA calculation",CalcEtaTimeDescription:"If multiple are selected, an average will be calculated",CalcPrintProgress:"Print progress calculation",CalcPrintProgressDescription:"Method for calculating the print progress.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"File position (absolute)",FileRelative:"File position (relative)",Slicer:"Slicer (M73)"},CannotReadJson:"Cannot read/parse backup file.",DateFormat:"Date Format",DbConsoleHistory:"Console History",DbHistoryJobs:"History Jobs",DbHistoryTotals:"History Totals",DBNavigation:"Navigation",DbTimelapseSettings:"Timelapse Settings",DbView:"View Settings",EstimateValues:{Filament:"Filament",File:"File",Slicer:"Slicer"},Everything:"Everything",FactoryDialog:"Please select all the sections you want to reset:",FactoryReset:"Factory reset",General:"General",Language:"Language",MainsailSettingsMoonrakerDb:"Mainsail Settings in Moonraker DB",PrinterName:"Printer Name",Reset:"reset",Restore:"Restore",RestoreDialog:"Please select all the sections you want to restore:",TimeFormat:"Time Format"},HeightmapTab:{ColorSchemes:"Color Schemes",Heightmap:"Heightmap",IsDefault:"(Default)",Schemes:{GrayScale:"Grayscale",Hot:"Hot",Hsv:"Hsv",Portland:"Portland",Spring:"Spring"}},InterfaceSettings:"Interface Settings",MacrosTab:{Add:"add",AddGroup:"add Group",AvailableMacros:"Available Macros",ChangeMacroColor:"Change the color of the button.",Color:"Color",CountMacros:"no Macros added | {count} Macro | {count} Macros",Custom:"custom",CustomColor:"Custom Color",DeletedMacro:"Deleted macro",DeleteMacroFromGroup:"Delete macro from group.",EditGroup:"Edit Group",Error:"error",Expert:"Expert",General:"General",Group:"Group",GroupMacros:"Group Macros",Macrogroups:"Groups",Macros:"Macros",Management:"Management",Name:"Name",NoAvailableMacros:"No available macros.",NoGroups:"No group found...",NOMacros:"No macros found...",NoMacrosInGroup:"No macros in this group.",Primary:"primary",Secondary:"secondary",ShowInStatePaused:"Show/hide if printer is paused.",ShowInStatePrinting:"Show/hide if printer is printing.",ShowInStateStandby:"Show/hide if printer is standby.",Simple:"Simple",Status:"Status",Success:"success",UnknownGroup:"Unknown Group",Warning:"warning"},MiscellaneousTab:{AddGroup:"add group",AddPreset:"add preset",Color:"Color",CreateGroup:"Create group",CreatePreset:"Create preset",End:"End",EndDescription:"Last LED of this group.",Groups:"Groups",GroupSubTitle:"Start: {start}, End: {end}",LightGroups:"{name} - Groups",LightPresets:"{name} - Presets",Miscellaneous:"Miscellaneous",Name:"Name",NoDevicesFound:"No devices found",NoGroupFound:"No group found",NoPresetFound:"No preset found",Presets:"Presets",Start:"Start",StartDescription:"First LED of this group.",UnableToLoadLight:"Unable to load light",UnableToLoadPreset:"Unable to load preset"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"add preset",Cooldown:"Cooldown",CreateHeadline:"Create Preset",CustomGCode:"Custom G-Code",EditCooldown:"Edit Cooldown",EditHeadline:"Edit Preset",ErrorInvalidValue:"Invalid value",ErrorNameNotUnique:"Name already exists",ErrorNameRequired:"Name required",Name:"Name",PreheatPresets:"Presets",PresetInfo:"Please set at least a target temperature or a custom G-Code.",PresetNamePlaceholder:"Preset name (required)",StoreButton:"Store preset",UpdateButton:"Update preset",UpdateCooldown:"Update Cooldown"},RemotePrintersTab:{AddPrinter:"Add Printer",EditPrinter:"Edit Printer",Hostname:"Hostname",Port:"Port",RemotePrinters:"Printers",UpdatePrinter:"Update Printer",UseConfigJson:"InstanceDB = JSON detected. Please use the config.json to modify the printers list."},Store:"store",TimelapseTab:{Autorender:"Autorender",AutorenderDescription:"If enabled, the timelapse video will automatically render at the end of the print",Camera:"Camera",CameraDescription:"Select which camera should be used",ConstantRateFactor:"Constant Rate Factor",ConstantRateFactorDescription:"This configure quality vs file size of the rendered video. The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default and 51 is worst quality possible. A lower value generally leads to higher quality and a subjectively sane range is 17–28. Consider 17 or 18 to be visually lossless.",duplicatelastframe:"Duplicate Last Frame",duplicatelastframeDescription:"Duplicates the last frame on the end of the video",Enabled:"Enabled",EnabledDescription:"If disabled, G-Code macros are ignored and auto-render is skipped.",Extraoutputparams:"Extra Output Params",ExtraoutputparamsDescription:"Defines extra output parameters to FFMPEG. Note: Specifying anything here will disable the rotation setting",FwRetract:"FW Retract",FwRetractDescription:"Use firmware retraction in the timelapse macro",GcodeVerbose:"Verbose G-Code",GcodeVerboseDescription:"If enabled, G-Code macros will write information to the console",General:"General",HyperlapseCycle:"Hyperlapse Cycle Time",HyperlapseCycleDescription:"A snapshot will be taken any X seconds",Mode:"Mode",ModeDescription:"Select between Layer macro and Hyperlapse (time-based) mode",OutputFramerate:"Output Framerate",OutputFramerateDescription:"Defines the framerate of the video. Note: this will be ignored if variable_fps is enabled",Parkhead:"Park Toolhead",ParkheadDescription:"If enabled, the toolhead will be parked before taking a frame.",Parkpos:"Park position",ParkposDescription:"Select the parking position",ParkTime:"Park Time",ParkTimeDescription:"Add additional idle time when parking.",Pixelformat:"Pixel format",PixelformatDescription:"Defines the pixel format of the output video",PosDZ:"Position Z",PosDZDescription:"Park position Z (relative)",PosX:"Position X",PosXDescription:"Park position X (absolute)",PosY:"Position Y",PosYDescription:"Park position Y (absolute)",PreviewImage:"Preview Image",PreviewImageDescription:"Save a preview image with the same name as the video",RenderingOptions:"Rendering Options",RetractDistance:"Retract Distance",RetractDistanceDescription:"The length of filament that the extruder retracts.",RetractSpeed:"Retract Speed",RetractSpeedDescription:"Speed at which the extruder retracts the filament.",SaveFrames:"Save Frames",SaveFramesDescription:"Save the frames to a zip-file for external rendering",StreamDelayCompensation:"Stream Delay Compensation",StreamDelayCompensationDescription:"Delay frame capture",Targetlength:"Target Length",TargetlengthDescription:"The target length when Variable FPS is enabled",TimeFormatCode:"Time Format Code",TimeFormatCodeDescription:"This defines how the timestamp in the output file should be encoded",Timelapse:"Timelapse",TravelSpeed:"Travel Speed",TravelSpeedDescription:"Travel speed while moving to the parking position and resuming",UnretractDistance:"Unretract Distance",UnretractDistanceDescription:"The length of filament that the extruder unretracts after a retraction.",UnretractSpeed:"Unretract Speed",UnretractSpeedDescription:"Speed at which the extruder unretracts the filament after a retraction.",VariableFps:"Variable FPS",VariableFpsDescription:"If enabled, the framerate of the output video will be calculated based on target length",VariableFpsMax:"Variable FPS max",VariableFpsMaxDescription:"",VariableFpsMin:"Variable FPS min",VariableFpsMinDescription:""},UiSettingsTab:{BedScrewsDialog:"Bed Screws Dialog",BedScrewsDialogDescription:"Display helper dialog for BED_SCREWS_ADJUST.",BigThumbnailBackground:"Large thumbnail background color",BoolBigThumbnail:"Large thumbnail",BoolBigThumbnailDescription:"Display a large thumbnail in the status panel during a print.",BoolHideUploadAndPrintButton:"Hide Upload and Print Button",BoolHideUploadAndPrintButtonDescription:'Show or hide the "Upload and Print" button in the top bar.',ConfirmOnEmergencyStop:"Require confirm on Emergency Stop",ConfirmOnEmergencyStopDescription:"Show a confirmation dialog on Emergency Stop",ConfirmOnPowerDeviceChange:"Require confirm on Device Power changes",ConfirmOnPowerDeviceChangeDescription:"Show a confirmation dialog on Device Power changes",DefaultNavigationState:"Navigation default state",DefaultNavigationStateAlwaysClosed:"always closed",DefaultNavigationStateAlwaysOpen:"always open",DefaultNavigationStateDescription:"Which state should have the navigation per default.",DefaultNavigationStateLastState:"last state",DisableFanAnimation:"Disable fan animation",DisableFanAnimationDescription:"This can reduce some load in your Browser.",DisplayCANCEL_PRINT:"Display CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Shows the CANCEL_PRINT button permanently - no second layer confirmation needed.",GcodeThumbnails:"G-Code thumbnails",GcodeThumbnailsDescription:"Click on the button to get to the instructions.",Guide:"Guide",HideSaveConfigButtonForBedMesh:"Hide SAVE_CONFIG button for bed_mesh changes",HideSaveConfigButtonForBedMeshDescription:"Hide SAVE_CONFIG, if only bed_mesh changes are pending to be saved in Klipper.",HideUpdateWarnings:"Hide Update Warnings",HideUpdateWarningsDescription:"This option will hide all update warnings in the update manager.",LockSliders:"Lock sliders on touchscreen devices",LockSlidersDelay:"Slider lock delay",LockSlidersDelayDescription:"Sliders will lock after a given delay. If set to 0 or left blank, sliders will only lock on page change/reload.",LockSlidersDescription:"Sliders on touchscreens need to be unlocked before changes are allowed.",Logo:"Logo",ManualProbeDialog:"Manual Probe Helper Dialog",ManualProbeDialogDescription:"Display helper dialog for PROBE_CALIBRATE or Z_ENDSTOP_CALIBRATE.",NavigationStyle:"Navigation style",NavigationStyleDescription:"Change navigation appearance",NavigationStyleIconsAndText:"Icons + Text",NavigationStyleIconsOnly:"Icons only",PowerDeviceName:"Printer power device",PowerDeviceNameDescription:"Select which Moonraker power device should be used to power on the printer.",Primary:"Primary",ScrewsTiltAdjustDialog:"Screws Tilt Adjust Dialog",ScrewsTiltAdjustDialogDescription:"Display helper dialog for SCREWS_TILT_CALCULATE.",TempchartHeight:"Height Temperature Chart",TempchartHeightDescription:"Modify the height of the temperature chart on the Dashboard.",Theme:"Theme",ThemeDark:"Dark",ThemeDescription:"Change the overall look and feel of the application",ThemeLight:"Light",UiSettings:"UI-Settings"},Update:"update",WebcamsTab:{AddWebcam:"add webcam",CreateWebcam:"Create Webcam",EditCrowsnestConf:"Edit crowsnest.conf",EditWebcam:"Edit Webcam",EnableAudio:"Enable audio",FlipWebcam:"Flip webcam image:",HideFps:"Hide FPS counter",Hlsstream:"HLS Stream",Horizontally:"horizontally",IconBed:"Bed",IconCam:"Cam",IconDoor:"Door",IconFilament:"Filament",IconHot:"Hot",IconMcu:"MCU",IconNozzle:"Nozzle",IconPrinter:"Printer",Ipstream:"IP Camera",JMuxerStream:"Raw h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptive MJPEG-Streamer (experimental)",Name:"Name",NameAlreadyExists:"Name already exists",Required:"required",Rotate:"Rotate",SaveWebcam:"Save Webcam",Service:"Service",TargetFPS:"Target FPS",UpdateWebcam:"Update Webcam",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertically",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},w$={AllFiles:"All",Autorender:"Auto-render",Cancel:"Cancel",Create:"Create",CreateNewDirectory:"create directory",CurrentPath:"Current Path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Do you really want to delete the "{name}" directory with all its contents?',DeleteSelectedQuestion:"Do you really want to delete {count} selected files?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",DuplicateLastframe:"Duplicate last frame",Empty:"No finished timelapse found.",Enabled:"Enabled",EstimatedLength:"Estimated length",Files:"Files",Filesize:"Filesize",Fixed:"fixed",Framerate:"Framerate",Frames:"Frames",Free:"Free",FreeDisk:"Free disk",LastModified:"Last modified",MaxFramerate:"Max. framerate",MinFramerate:"Min. framerate",Name:"Name",NewDirectory:"New Directory",NoActiveTimelapse:"No records available.",Preview:"Preview",RefreshCurrentDirectory:"refresh directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",Render:"render",RenderSettings:"Render Settings",SaveFrames:"Save frames",Search:"search",StartRender:"start render",Status:"Status",TargetFps:"Target FPS",Targetlength:"Target length",TimelapseFiles:"Timelapse Files",TimelapseRendering:"Timelapse rendering",TimelapseRenderingSuccessful:"Timelapse rendering successful",Total:"Total",Type:"Type",Used:"Used",Variable:"Variable",Video:"Video"},S$="English",P$={App:r$,BedScrews:i$,ConnectionDialog:n$,Console:a$,Dialogs:o$,Editor:l$,EmergencyStopDialog:c$,Files:u$,FullscreenUpload:d$,GCodeViewer:h$,Heightmap:p$,History:m$,JobQueue:f$,Machine:g$,ManualProbe:v$,Panels:_$,PowerDeviceChangeDialog:b$,Router:y$,ScrewsTiltAdjust:C$,SelectPrinterDialog:$$,Settings:x$,Timelapse:w$,title:S$},T$=Object.freeze(Object.defineProperty({__proto__:null,App:r$,BedScrews:i$,ConnectionDialog:n$,Console:a$,Dialogs:o$,Editor:l$,EmergencyStopDialog:c$,Files:u$,FullscreenUpload:d$,GCodeViewer:h$,Heightmap:p$,History:m$,JobQueue:f$,Machine:g$,ManualProbe:v$,Panels:_$,PowerDeviceChangeDialog:b$,Router:y$,ScrewsTiltAdjust:C$,SelectPrinterDialog:$$,Settings:x$,Timelapse:w$,default:P$,title:S$},Symbol.toStringTag,{value:"Module"}));y.use(s$);const LY={}.VUE_APP_I18N_LOCALE||"en",be=new s$({locale:LY,fallbackLocale:{}.VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:{en:P$}});async function D$(e){const s=await qX(Object.assign({"../locales/cz.json":()=>he(()=>import("./cz-285b76fb.js"),[]),"../locales/da.json":()=>he(()=>import("./da-6721996d.js"),[]),"../locales/de.json":()=>he(()=>import("./de-1c7e5778.js"),[]),"../locales/en.json":()=>he(()=>Promise.resolve().then(()=>T$),void 0),"../locales/es.json":()=>he(()=>import("./es-8a2d24bf.js"),[]),"../locales/fr.json":()=>he(()=>import("./fr-ab90ab77.js"),[]),"../locales/hu.json":()=>he(()=>import("./hu-a56cb065.js"),[]),"../locales/it.json":()=>he(()=>import("./it-85215c0c.js"),[]),"../locales/ja.json":()=>he(()=>import("./ja-a20a0276.js"),[]),"../locales/ko.json":()=>he(()=>import("./ko-0b8d811b.js"),[]),"../locales/nl.json":()=>he(()=>import("./nl-d64c7e44.js"),[]),"../locales/pl.json":()=>he(()=>import("./pl-d65989d8.js"),[]),"../locales/pt.json":()=>he(()=>import("./pt-880f8881.js"),[]),"../locales/ru.json":()=>he(()=>import("./ru-5f4aea5d.js"),[]),"../locales/se.json":()=>he(()=>import("./se-23883ae1.js"),[]),"../locales/tr.json":()=>he(()=>import("./tr-9777749c.js"),[]),"../locales/uk.json":()=>he(()=>import("./uk-644a4aa7.js"),[]),"../locales/zh.json":()=>he(()=>import("./zh-fcce6e53.js"),[]),"../locales/zh_TW.json":()=>he(()=>import("./zh_TW-7176daef.js"),[])}),"../locales/".concat(e,".json"));return be.setLocaleMessage(e,s),be.locale=e,s}var kY=Object.defineProperty,AY=Object.getOwnPropertyDescriptor,M$=(e,s,t,r)=>{for(var i=r>1?void 0:r?AY(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&kY(s,t,i),i};let Tl=class extends j(V){get splits(){return this.event.message.split("|")}get text(){return this.splits[0]}get command(){var e;return(e=this.splits[1])!=null?e:this.text}get color(){var e;return(e=this.splits[2])!=null?e:""}clickButton(){this.$store.dispatch("server/addEvent",{message:this.command,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.command})}};M$([k({type:Object,required:!0})],Tl.prototype,"event",2);Tl=M$([O({})],Tl);var FY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(g,{attrs:{color:e.color,text:""},on:{click:e.clickButton}},[e._v(" "+e._s(e.text)+" ")])},RY=[];const q_={};var IY=N(Tl,FY,RY,!1,HY,null,null,null);function HY(e){for(let s in q_)this[s]=q_[s]}const E$=function(){return IY.exports}();var jY=Object.defineProperty,NY=Object.getOwnPropertyDescriptor,O$=(e,s,t,r)=>{for(var i=r>1?void 0:r?NY(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&jY(s,t,i),i};let Dl=class extends j(V){get text(){return this.event.message}};O$([k({type:Object,required:!0})],Dl.prototype,"event",2);Dl=O$([O({})],Dl);var VY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.text))])])],1)},UY=[];const X_={};var BY=N(Dl,VY,UY,!1,WY,null,null,null);function WY(e){for(let s in X_)this[s]=X_[s]}const L$=function(){return BY.exports}();var GY=Object.defineProperty,zY=Object.getOwnPropertyDescriptor,k$=(e,s,t,r)=>{for(var i=r>1?void 0:r?zY(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&GY(s,t,i),i};let Ml=class extends j(V){get splits(){return this.event.message.split("|")}get text(){return this.splits[0]}get command(){var s;return(s=this.splits[1])!=null?s:this.text}get color(){var s;return(s=this.splits[2])!=null?s:""}sendCommand(){this.$store.dispatch("server/addEvent",{message:this.command,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.command})}};k$([k({type:Object,required:!0})],Ml.prototype,"event",2);Ml=k$([O({})],Ml);var ZY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(g,{staticClass:"mx-2",attrs:{color:e.color},on:{click:e.sendCommand}},[e._v(e._s(e.text))])},qY=[];const Y_={};var XY=N(Ml,ZY,qY,!1,YY,null,null,null);function YY(e){for(let s in Y_)this[s]=Y_[s]}const A$=function(){return XY.exports}();var JY=Object.defineProperty,KY=Object.getOwnPropertyDescriptor,zm=(e,s,t,r)=>{for(var i=r>1?void 0:r?KY(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&JY(s,t,i),i};let na=class extends j(V){};zm([k({type:Array,required:!0})],na.prototype,"children",2);zm([k({type:Number,required:!0})],na.prototype,"groupIndex",2);na=zm([O({})],na);var QY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(S,[t(_,{staticClass:"text-center"},e._l(e.children,function(r,i){return t(A$,{key:"prompt_"+e.groupIndex+"_"+i,attrs:{event:r}})}),1)],1)},eJ=[];const J_={};var tJ=N(na,QY,eJ,!1,sJ,null,null,null);function sJ(e){for(let s in J_)this[s]=J_[s]}const Xh=function(){return tJ.exports}();var rJ=Object.defineProperty,iJ=Object.getOwnPropertyDescriptor,nJ=(e,s,t,r)=>{for(var i=r>1?void 0:r?iJ(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&rJ(s,t,i),i};let Yh=class extends j(V){constructor(){super(...arguments),this.mdiInformation=At,this.mdiCloseThick=Ce,this.internalCloseCommand=null}get events(){return this.$store.state.server.events.slice(-100)}get macroPromptEvents(){return this.events.filter(e=>e.type==="action").filter(e=>e.message.startsWith("// action:prompt_")).map(e=>{var i,n;const s=((i=e.message)!=null?i:"").replace("// action:prompt_","").split(" ")[0].trim(),t=((n=e.message)!=null?n:"").replace("// action:prompt_".concat(s),"").replace(/"/g,"").trim();return{date:e.date,type:s,message:t}})}get lastPromptBeginPos(){return this.lastPromptShowPos===-1?-1:this.macroPromptEvents.findLastIndex(e=>e.type==="begin",this.lastPromptShowPos)}get lastPromptShowPos(){return this.macroPromptEvents.findLastIndex(e=>e.type==="show")}get lastPromptClosePos(){return this.macroPromptEvents.findLastIndex(e=>e.type==="end")}get showDialog(){return this.lastPromptBeginPos===-1||this.internalCloseCommand!==null&&this.internalCloseCommand==this.lastPromptBeginPos?!1:this.lastPromptBeginPos>this.lastPromptClosePos&&this.activePromptContent.length>0}get activePrompt(){return this.lastPromptShowPos===-1?[]:this.macroPromptEvents.slice(this.lastPromptBeginPos,this.lastPromptShowPos)}get activePromptContent(){const e=["button","text","button_group_start","button_group_end"],s=this.activePrompt.filter(t=>e.includes(t.type));for(;s.findIndex(t=>t.type==="button_group_start")!==-1&&s.findIndex(t=>t.type==="button_group_end")!==-1;){const t=s.findIndex(n=>n.type==="button_group_start"),r=s.findIndex(n=>n.type==="button_group_end"),i=s.slice(t+1,r);s[t]={date:i[0].date,type:"button_group",message:"",children:i.filter(n=>n.type==="button")},s.splice(t+1,i.length+1)}return s}get headline(){var e,s;return!this.showDialog||this.lastPromptBeginPos===-1?"":(s=(e=this.macroPromptEvents[this.lastPromptBeginPos])==null?void 0:e.message)!=null?s:""}get footerButtons(){return!this.showDialog||this.lastPromptBeginPos===-1?[]:this.activePrompt.filter(e=>e.type==="footer_button")}closePrompt(){this.internalCloseCommand=this.lastPromptBeginPos;const e='RESPOND type="command" msg="action:prompt_end"';this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}};Yh=nJ([O({components:{MacroPromptButtonGroup:Xh,MacroPromptButton:A$,MacroPromptText:L$,MacroPromptFooterButton:E$,Panel:Z}})],Yh);var aJ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(Z,{staticStyle:{overflow:"hidden"},attrs:{title:e.headline,icon:e.mdiInformation,"card-class":"macro_prompt-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e._l(e.activePromptContent,function(r,i){var n;return[r.type==="text"?t(L$,{key:"prompt_"+i,attrs:{event:r}}):e._e(),r.type==="button_group"?t(Xh,{key:"prompt_"+i,attrs:{"group-index":i,children:(n=r.children)!==null&&n!==void 0?n:[]}}):e._e(),r.type==="button"?t(Xh,{key:"prompt_"+i,attrs:{"group-index":i,children:[r]}}):e._e()]})],2),e.footerButtons.length?t(ne,[t(le),e._l(e.footerButtons,function(r,i){return t(E$,{key:"prompt_footer_"+i,attrs:{event:r}})})],2):e._e()],1)],1)},oJ=[];const K_={};var lJ=N(Yh,aJ,oJ,!1,cJ,null,null,null);function cJ(e){for(let s in K_)this[s]=K_[s]}const F$=function(){return lJ.exports}();var uJ=Object.defineProperty,dJ=Object.getOwnPropertyDescriptor,ws=(e,s,t,r)=>{for(var i=r>1?void 0:r?dJ(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&uJ(s,t,i),i};O.registerHooks(["metaInfo"]);let Yt=class extends j(V,kt){metaInfo(){let s=this.$store.getters.getTitle;return this.isPrinterPowerOff&&(s=this.$t("App.Titles.PrinterOff")),{title:s,titleTemplate:"%s"}}get title(){return this.$store.getters.getTitle}get mainBackground(){return this.$store.getters["files/getMainBackground"]}get naviDrawer(){return this.$store.state.naviDrawer}get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get mainStyle(){let s={paddingLeft:"0"};return this.mainBackground!==null&&(s.backgroundImage="url("+this.mainBackground+")"),this.naviDrawer&&!this.$vuetify.breakpoint.mdAndDown&&(this.navigationStyle==="iconsAndText"&&(s.paddingLeft="220px"),this.navigationStyle==="iconsOnly"&&(s.paddingLeft="56px")),s}get customStylesheet(){return this.$store.getters["files/getCustomStylesheet"]}get customFavicons(){var s;return(s=this.$store.getters["files/getCustomFavicons"])!=null?s:null}get language(){return this.$store.state.gui.general.language}get current_file(){var s,t;return(t=(s=this.$store.state.printer.print_stats)==null?void 0:s.filename)!=null?t:""}get theme(){return this.$store.state.gui.uiSettings.theme}get logoColor(){return this.$store.state.gui.uiSettings.logo}get primaryColor(){return this.$store.state.gui.uiSettings.primary}get warningColor(){var s,t,r,i,n;return(n=(i=(r=(t=(s=this.$vuetify)==null?void 0:s.theme)==null?void 0:t.currentTheme)==null?void 0:r.warning)==null?void 0:i.toString())!=null?n:"#ff8300"}get primaryTextColor(){let s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor);if(s){const t=parseInt(s[1],16)*.2126,r=parseInt(s[2],16)*.7152,i=parseInt(s[3],16)*.0722;return(t+r+i)/255>.7?"#222":"#fff"}return"#ffffff"}get cssVars(){return{"--v-btn-text-primary":this.primaryTextColor,"--color-primary":this.primaryColor,"--color-warning":this.warningColor,"--panel-toolbar-icon-btn-width":zu+"px","--panel-toolbar-text-btn-height":zu+"px","--topbar-icon-btn-width":fn+"px","--sidebar-menu-item-height":yS+"px"}}get print_percent(){return Math.floor(this.$store.getters["printer/getPrintPercent"]*100)}async languageChanged(s){await D$(s)}customStylesheetChanged(s){const t=document.getElementById("customStylesheet");if(s!==null&&t===null){const r=document.createElement("link");r.id="customStylesheet",r.type="text/css",r.rel="stylesheet",r.href=s,document.head.appendChild(r)}else s!==null&&t?t.setAttribute("href",s):t&&t.remove()}current_fileChanged(s){s!==""&&this.$socket.emit("server.files.metadata",{filename:s},{action:"files/getMetadataCurrentFile"})}primaryColorChanged(s){this.$nextTick(()=>{this.$vuetify.theme.currentTheme.primary=s})}themeChanged(s){const t=s!=="light";this.$vuetify.theme.dark=t;const r=document.documentElement;r.className=t?"theme--dark":"theme--light"}drawFavicon(s){const t=document.querySelector("link[rel*='icon'][sizes='16x16']"),r=document.querySelector("link[rel*='icon'][sizes='32x32']");if(t&&r)if(this.printerIsPrinting){let i=64,n=document.createElement("canvas");n.width=i,n.height=i;const a=n.getContext("2d"),o=n.width/2,l=n.height/2,c=32;if(a){a.beginPath(),a.moveTo(o,l),a.arc(o,l,c,0,2*Math.PI,!1),a.closePath(),a.fillStyle="#ddd",a.fill(),a.strokeStyle="rgba(200, 208, 218, 0.66)",a.stroke();let u=1.5*Math.PI,d=0,h=(Math.PI-.5*Math.PI)/25;(s>=0&&s<=25||s>25&&s<=50||s>50&&s<=75||s>75&&s<=100)&&(d=u+s*h),a.beginPath(),a.moveTo(o,l),a.arc(o,l,c,u,d,!1),a.closePath(),a.fillStyle=this.logoColor,a.fill(),t.href=n.toDataURL("image/png"),r.href=n.toDataURL("image/png")}}else if(this.customFavicons){const[i,n]=this.customFavicons;t.href=i,r.href=n}else{const i="data:image/svg+xml;base64,"+window.btoa('\n \n \n \n \n \n \n \n '));t.href=i,r.href=i}}customFaviconsChanged(){this.drawFavicon(this.print_percent)}logoColorChanged(){this.drawFavicon(this.print_percent)}print_percentChanged(s){this.drawFavicon(s),this.refreshSpoolman()}printerIsPrintingChanged(){this.drawFavicon(this.print_percent)}refreshSpoolman(){this.moonrakerComponents.includes("spoolman")&&this.$store.dispatch("server/spoolman/refreshActiveSpool",null,{root:!0})}appHeight(){this.$nextTick(()=>{document.documentElement.style.setProperty("--app-height",window.innerHeight+"px")})}mounted(){this.drawFavicon(this.print_percent),this.appHeight(),window.addEventListener("resize",this.appHeight),window.addEventListener("orientationchange",this.appHeight)}};ws([me("language")],Yt.prototype,"languageChanged",1);ws([me("customStylesheet")],Yt.prototype,"customStylesheetChanged",1);ws([me("current_file")],Yt.prototype,"current_fileChanged",1);ws([me("primaryColor")],Yt.prototype,"primaryColorChanged",1);ws([me("theme")],Yt.prototype,"themeChanged",1);ws([me("customFavicons")],Yt.prototype,"customFaviconsChanged",1);ws([me("logoColor")],Yt.prototype,"logoColorChanged",1);ws([me("print_percent")],Yt.prototype,"print_percentChanged",1);ws([me("printerIsPrinting")],Yt.prototype,"printerIsPrintingChanged",1);Yt=ws([O({components:{TheMacroPrompt:F$,TheTimelapseRenderingSnackbar:VC,TheEditor:NC,TheSelectPrinterDialog:Op,TheConnectingDialog:HC,TheUpdateDialog:IC,TheTopbar:FC,TheSidebar:G2,TheFullscreenUpload:UC,TheUploadSnackbar:WC,TheManualProbeDialog:GC,TheBedScrewsDialog:zC,TheScrewsTiltAdjustDialog:qC}})],Yt);var hJ=Object.defineProperty,pJ=Object.getOwnPropertyDescriptor,mJ=(e,s,t,r)=>{for(var i=r>1?void 0:r?pJ(s,t):s,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(s,t,i):a(i))||i);return r&&i&&hJ(s,t,i),i};let Jh=class extends j(V){constructor(){super(...arguments),this.showDialog=!1,this.updateSW=null}onOfflineReady(){window.console.info("PWA is offline ready")}onNeedRefresh(){window.console.warn("PWA needs to refresh"),this.showDialog=!0}onRegistered(){window.console.debug("PWA is registered")}onRegisterError(e){window.console.error("PWA registration error:",e)}update(){var e;(e=this.updateSW)==null||e.call(this,!0),this.showDialog=!1}async mounted(){const{registerSW:e}=await he(()=>import("./virtual_pwa-register-990ff180.js"),["assets/virtual_pwa-register-990ff180.js","assets/vuetify-52f40ce5.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-9bc570b0.js"]);this.updateSW=e({immediate:!0,onOfflineReady:this.onOfflineReady,onNeedRefresh:this.onNeedRefresh,onRegistered:this.onRegistered,onRegisterError:this.onRegisterError})}};Jh=mJ([O],Jh);var fJ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{staticClass:"mx-0",attrs:{persistent:"","max-width":"400"},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(Z,{attrs:{title:e.$t("App.TheServiceWorker.TitleNeedUpdate"),"card-class":"service-worker-dialog","margin-bottom":!1}},[t(q,[t("p",[e._v(e._s(e.$t("App.TheServiceWorker.DescriptionNeedUpdate")))])]),t(ne,[t(le),t(g,{attrs:{text:"",color:"primary"},on:{click:e.update}},[e._v(e._s(e.$t("App.TheServiceWorker.Update")))])],1)],1)],1)},gJ=[];const Q_={};var vJ=N(Jh,fJ,gJ,!1,_J,null,null,null);function _J(e){for(let s in Q_)this[s]=Q_[s]}const bJ=function(){return vJ.exports}();var yJ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(iw,{style:e.cssVars},[e.socketIsConnected&&e.guiIsReady?[t(G2),t(FC),t(nw,{style:e.mainStyle,attrs:{id:"content"}},[t(ke,{staticClass:"container px-3 px-sm-6 py-sm-6 mx-auto",attrs:{id:"page-container",fluid:""}},[t("router-view")],1)],1),t(bJ),t(IC),t(NC),t(VC),t(UC),t(WC),t(GC),t(zC),t(qC),t(F$)]:e.instancesDB!=="moonraker"?t(Op):t(HC)],2)},CJ=[];const eb={};var $J=N(Yt,yJ,CJ,!1,xJ,null,null,null);function xJ(e){for(let s in eb)this[s]=eb[s]}const wJ=function(){return $J.exports}();y.use(wb,{directives:{Touch:aw,Ripple:ow}});const R$=new wb({theme:{dark:!0,options:{customProperties:!0}},icons:{iconfont:"mdiSvg"},breakpoint:{mobileBreakpoint:768}});/*! - * vuex v3.6.2 - * (c) 2021 Evan You - * @license MIT - */function SJ(e){var s=Number(e.version.split(".")[0]);if(s>=2)e.mixin({beforeCreate:r});else{var t=e.prototype._init;e.prototype._init=function(i){i===void 0&&(i={}),i.init=i.init?[r].concat(i.init):r,t.call(this,i)}}function r(){var i=this.$options;i.store?this.$store=typeof i.store=="function"?i.store():i.store:i.parent&&i.parent.$store&&(this.$store=i.parent.$store)}}var PJ=typeof window<"u"?window:typeof global<"u"?global:{},Kr=PJ.__VUE_DEVTOOLS_GLOBAL_HOOK__;function TJ(e){Kr&&(e._devtoolHook=Kr,Kr.emit("vuex:init",e),Kr.on("vuex:travel-to-state",function(s){e.replaceState(s)}),e.subscribe(function(s,t){Kr.emit("vuex:mutation",s,t)},{prepend:!0}),e.subscribeAction(function(s,t){Kr.emit("vuex:action",s,t)},{prepend:!0}))}function DJ(e,s){return e.filter(s)[0]}function Kh(e,s){if(s===void 0&&(s=[]),e===null||typeof e!="object")return e;var t=DJ(s,function(i){return i.original===e});if(t)return t.copy;var r=Array.isArray(e)?[]:{};return s.push({original:e,copy:r}),Object.keys(e).forEach(function(i){r[i]=Kh(e[i],s)}),r}function qi(e,s){Object.keys(e).forEach(function(t){return s(e[t],t)})}function I$(e){return e!==null&&typeof e=="object"}function MJ(e){return e&&typeof e.then=="function"}function EJ(e,s){return function(){return e(s)}}var ds=function(s,t){this.runtime=t,this._children=Object.create(null),this._rawModule=s;var r=s.state;this.state=(typeof r=="function"?r():r)||{}},H$={namespaced:{configurable:!0}};H$.namespaced.get=function(){return!!this._rawModule.namespaced};ds.prototype.addChild=function(s,t){this._children[s]=t};ds.prototype.removeChild=function(s){delete this._children[s]};ds.prototype.getChild=function(s){return this._children[s]};ds.prototype.hasChild=function(s){return s in this._children};ds.prototype.update=function(s){this._rawModule.namespaced=s.namespaced,s.actions&&(this._rawModule.actions=s.actions),s.mutations&&(this._rawModule.mutations=s.mutations),s.getters&&(this._rawModule.getters=s.getters)};ds.prototype.forEachChild=function(s){qi(this._children,s)};ds.prototype.forEachGetter=function(s){this._rawModule.getters&&qi(this._rawModule.getters,s)};ds.prototype.forEachAction=function(s){this._rawModule.actions&&qi(this._rawModule.actions,s)};ds.prototype.forEachMutation=function(s){this._rawModule.mutations&&qi(this._rawModule.mutations,s)};Object.defineProperties(ds.prototype,H$);var Wr=function(s){this.register([],s,!1)};Wr.prototype.get=function(s){return s.reduce(function(t,r){return t.getChild(r)},this.root)};Wr.prototype.getNamespace=function(s){var t=this.root;return s.reduce(function(r,i){return t=t.getChild(i),r+(t.namespaced?i+"/":"")},"")};Wr.prototype.update=function(s){j$([],this.root,s)};Wr.prototype.register=function(s,t,r){var i=this;r===void 0&&(r=!0);var n=new ds(t,r);if(s.length===0)this.root=n;else{var a=this.get(s.slice(0,-1));a.addChild(s[s.length-1],n)}t.modules&&qi(t.modules,function(o,l){i.register(s.concat(l),o,r)})};Wr.prototype.unregister=function(s){var t=this.get(s.slice(0,-1)),r=s[s.length-1],i=t.getChild(r);i&&i.runtime&&t.removeChild(r)};Wr.prototype.isRegistered=function(s){var t=this.get(s.slice(0,-1)),r=s[s.length-1];return t?t.hasChild(r):!1};function j$(e,s,t){if(s.update(t),t.modules)for(var r in t.modules){if(!s.getChild(r))return;j$(e.concat(r),s.getChild(r),t.modules[r])}}var Ot,Vt=function(s){var t=this;s===void 0&&(s={}),!Ot&&typeof window<"u"&&window.Vue&&U$(window.Vue);var r=s.plugins;r===void 0&&(r=[]);var i=s.strict;i===void 0&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Wr(s),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Ot,this._makeLocalGettersCache=Object.create(null);var n=this,a=this,o=a.dispatch,l=a.commit;this.dispatch=function(h,p){return o.call(n,h,p)},this.commit=function(h,p,m){return l.call(n,h,p,m)},this.strict=i;var c=this._modules.root.state;Yc(this,c,[],this._modules.root),qm(this,c),r.forEach(function(d){return d(t)});var u=s.devtools!==void 0?s.devtools:Ot.config.devtools;u&&TJ(this)},Zm={state:{configurable:!0}};Zm.state.get=function(){return this._vm._data.$$state};Zm.state.set=function(e){};Vt.prototype.commit=function(s,t,r){var i=this,n=El(s,t,r),a=n.type,o=n.payload,l={type:a,payload:o},c=this._mutations[a];c&&(this._withCommit(function(){c.forEach(function(d){d(o)})}),this._subscribers.slice().forEach(function(u){return u(l,i.state)}))};Vt.prototype.dispatch=function(s,t){var r=this,i=El(s,t),n=i.type,a=i.payload,o={type:n,payload:a},l=this._actions[n];if(l){try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(o,r.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(u){return u(a)})):l[0](a);return new Promise(function(u,d){c.then(function(h){try{r._actionSubscribers.filter(function(p){return p.after}).forEach(function(p){return p.after(o,r.state)})}catch{}u(h)},function(h){try{r._actionSubscribers.filter(function(p){return p.error}).forEach(function(p){return p.error(o,r.state,h)})}catch{}d(h)})})}};Vt.prototype.subscribe=function(s,t){return N$(s,this._subscribers,t)};Vt.prototype.subscribeAction=function(s,t){var r=typeof s=="function"?{before:s}:s;return N$(r,this._actionSubscribers,t)};Vt.prototype.watch=function(s,t,r){var i=this;return this._watcherVM.$watch(function(){return s(i.state,i.getters)},t,r)};Vt.prototype.replaceState=function(s){var t=this;this._withCommit(function(){t._vm._data.$$state=s})};Vt.prototype.registerModule=function(s,t,r){r===void 0&&(r={}),typeof s=="string"&&(s=[s]),this._modules.register(s,t),Yc(this,this.state,s,this._modules.get(s),r.preserveState),qm(this,this.state)};Vt.prototype.unregisterModule=function(s){var t=this;typeof s=="string"&&(s=[s]),this._modules.unregister(s),this._withCommit(function(){var r=Xm(t.state,s.slice(0,-1));Ot.delete(r,s[s.length-1])}),V$(this)};Vt.prototype.hasModule=function(s){return typeof s=="string"&&(s=[s]),this._modules.isRegistered(s)};Vt.prototype.hotUpdate=function(s){this._modules.update(s),V$(this,!0)};Vt.prototype._withCommit=function(s){var t=this._committing;this._committing=!0,s(),this._committing=t};Object.defineProperties(Vt.prototype,Zm);function N$(e,s,t){return s.indexOf(e)<0&&(t&&t.prepend?s.unshift(e):s.push(e)),function(){var r=s.indexOf(e);r>-1&&s.splice(r,1)}}function V$(e,s){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var t=e.state;Yc(e,t,[],e._modules.root,!0),qm(e,t,s)}function qm(e,s,t){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,n={};qi(i,function(o,l){n[l]=EJ(o,e),Object.defineProperty(e.getters,l,{get:function(){return e._vm[l]},enumerable:!0})});var a=Ot.config.silent;Ot.config.silent=!0,e._vm=new Ot({data:{$$state:s},computed:n}),Ot.config.silent=a,e.strict&&RJ(e),r&&(t&&e._withCommit(function(){r._data.$$state=null}),Ot.nextTick(function(){return r.$destroy()}))}function Yc(e,s,t,r,i){var n=!t.length,a=e._modules.getNamespace(t);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!n&&!i){var o=Xm(s,t.slice(0,-1)),l=t[t.length-1];e._withCommit(function(){Ot.set(o,l,r.state)})}var c=r.context=OJ(e,a,t);r.forEachMutation(function(u,d){var h=a+d;kJ(e,h,u,c)}),r.forEachAction(function(u,d){var h=u.root?d:a+d,p=u.handler||u;AJ(e,h,p,c)}),r.forEachGetter(function(u,d){var h=a+d;FJ(e,h,u,c)}),r.forEachChild(function(u,d){Yc(e,s,t.concat(d),u,i)})}function OJ(e,s,t){var r=s==="",i={dispatch:r?e.dispatch:function(n,a,o){var l=El(n,a,o),c=l.payload,u=l.options,d=l.type;return(!u||!u.root)&&(d=s+d),e.dispatch(d,c)},commit:r?e.commit:function(n,a,o){var l=El(n,a,o),c=l.payload,u=l.options,d=l.type;(!u||!u.root)&&(d=s+d),e.commit(d,c,u)}};return Object.defineProperties(i,{getters:{get:r?function(){return e.getters}:function(){return LJ(e,s)}},state:{get:function(){return Xm(e.state,t)}}}),i}function LJ(e,s){if(!e._makeLocalGettersCache[s]){var t={},r=s.length;Object.keys(e.getters).forEach(function(i){if(i.slice(0,r)===s){var n=i.slice(r);Object.defineProperty(t,n,{get:function(){return e.getters[i]},enumerable:!0})}}),e._makeLocalGettersCache[s]=t}return e._makeLocalGettersCache[s]}function kJ(e,s,t,r){var i=e._mutations[s]||(e._mutations[s]=[]);i.push(function(a){t.call(e,r.state,a)})}function AJ(e,s,t,r){var i=e._actions[s]||(e._actions[s]=[]);i.push(function(a){var o=t.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},a);return MJ(o)||(o=Promise.resolve(o)),e._devtoolHook?o.catch(function(l){throw e._devtoolHook.emit("vuex:error",l),l}):o})}function FJ(e,s,t,r){e._wrappedGetters[s]||(e._wrappedGetters[s]=function(n){return t(r.state,r.getters,n.state,n.getters)})}function RJ(e){e._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function Xm(e,s){return s.reduce(function(t,r){return t[r]},e)}function El(e,s,t){return I$(e)&&e.type&&(t=s,s=e,e=e.type),{type:e,payload:s,options:t}}function U$(e){Ot&&e===Ot||(Ot=e,SJ(Ot))}var B$=Kc(function(e,s){var t={};return Jc(s).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){var o=this.$store.state,l=this.$store.getters;if(e){var c=Qc(this.$store,"mapState",e);if(!c)return;o=c.context.state,l=c.context.getters}return typeof n=="function"?n.call(this,o,l):o[n]},t[i].vuex=!0}),t}),W$=Kc(function(e,s){var t={};return Jc(s).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var c=this.$store.commit;if(e){var u=Qc(this.$store,"mapMutations",e);if(!u)return;c=u.context.commit}return typeof n=="function"?n.apply(this,[c].concat(o)):c.apply(this.$store,[n].concat(o))}}),t}),G$=Kc(function(e,s){var t={};return Jc(s).forEach(function(r){var i=r.key,n=r.val;n=e+n,t[i]=function(){if(!(e&&!Qc(this.$store,"mapGetters",e)))return this.$store.getters[n]},t[i].vuex=!0}),t}),z$=Kc(function(e,s){var t={};return Jc(s).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var c=this.$store.dispatch;if(e){var u=Qc(this.$store,"mapActions",e);if(!u)return;c=u.context.dispatch}return typeof n=="function"?n.apply(this,[c].concat(o)):c.apply(this.$store,[n].concat(o))}}),t}),IJ=function(e){return{mapState:B$.bind(null,e),mapGetters:G$.bind(null,e),mapMutations:W$.bind(null,e),mapActions:z$.bind(null,e)}};function Jc(e){return HJ(e)?Array.isArray(e)?e.map(function(s){return{key:s,val:s}}):Object.keys(e).map(function(s){return{key:s,val:e[s]}}):[]}function HJ(e){return Array.isArray(e)||I$(e)}function Kc(e){return function(s,t){return typeof s!="string"?(t=s,s=""):s.charAt(s.length-1)!=="/"&&(s+="/"),e(s,t)}}function Qc(e,s,t){var r=e._modulesNamespaceMap[t];return r}function jJ(e){e===void 0&&(e={});var s=e.collapsed;s===void 0&&(s=!0);var t=e.filter;t===void 0&&(t=function(u,d,h){return!0});var r=e.transformer;r===void 0&&(r=function(u){return u});var i=e.mutationTransformer;i===void 0&&(i=function(u){return u});var n=e.actionFilter;n===void 0&&(n=function(u,d){return!0});var a=e.actionTransformer;a===void 0&&(a=function(u){return u});var o=e.logMutations;o===void 0&&(o=!0);var l=e.logActions;l===void 0&&(l=!0);var c=e.logger;return c===void 0&&(c=console),function(u){var d=Kh(u.state);typeof c>"u"||(o&&u.subscribe(function(h,p){var m=Kh(p);if(t(h,d,m)){var f=rb(),b=i(h),C="mutation "+h.type+f;tb(c,C,s),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),c.log("%c mutation","color: #03A9F4; font-weight: bold",b),c.log("%c next state","color: #4CAF50; font-weight: bold",r(m)),sb(c)}d=m}),l&&u.subscribeAction(function(h,p){if(n(h,p)){var m=rb(),f=a(h),b="action "+h.type+m;tb(c,b,s),c.log("%c action","color: #03A9F4; font-weight: bold",f),sb(c)}}))}}function tb(e,s,t){var r=t?e.groupCollapsed:e.group;try{r.call(e,s)}catch{e.log(s)}}function sb(e){try{e.groupEnd()}catch{e.log("—— log end ——")}}function rb(){var e=new Date;return" @ "+Ua(e.getHours(),2)+":"+Ua(e.getMinutes(),2)+":"+Ua(e.getSeconds(),2)+"."+Ua(e.getMilliseconds(),3)}function NJ(e,s){return new Array(s+1).join(e)}function Ua(e,s){return NJ("0",s-e.toString().length)+e}var VJ={Store:Vt,install:U$,version:"3.6.2",mapState:B$,mapMutations:W$,mapGetters:G$,mapActions:z$,createNamespacedHelpers:IJ,createLogger:jJ};const Z$=VJ,UJ={switchToDashboard(){sa.currentRoute.fullPath!=="/"&&sa.push("/")},changePrinter({dispatch:e,getters:s},t){e("files/reset"),e("gui/reset"),e("printer/reset"),e("server/reset"),e("socket/reset");const r=s["farm/"+t.printer+"/getSocketData"];e("socket/setSocket",{hostname:r.hostname,port:r.port})},setNaviDrawer({commit:e},s){e("setNaviDrawer",s)},async importConfigJson({commit:e},s){var r;let t=(r=s.instancesDB)!=null?r:"moonraker";if({}.VUE_APP_INSTANCES_DB&&(t={}.VUE_APP_INSTANCES_DB),t!=="moonraker"){e("setInstancesDB",t),t==="json"&&"instances"in s&&Array.isArray(s.instances)&&s.instances.length&&e("setConfigInstances",s.instances);return}s.hostname&&e("socket/setData",{hostname:s.hostname}),s.port&&e("socket/setData",{port:parseInt(s.port.toString())})}},BJ={setNaviDrawer(e,s){y.set(e,"naviDrawer",s),localStorage.setItem("naviDrawer",s)},setInstancesDB(e,s){y.set(e,"instancesDB",s)},setConfigInstances(e,s){y.set(e,"configInstances",s)}},WJ={getVersion:e=>e.packageVersion,getTitle:(e,s)=>{var r,i,n,a,o,l,c,u,d,h,p,m,f,b,C,w,M,H,A,$,T,I;if(!((r=e.socket)!=null&&r.isConnected))return"Mainsail";if(((i=e.server)==null?void 0:i.klippy_state)!=="ready")return be.t("App.Titles.Error");let t=(o=(a=(n=e.printer)==null?void 0:n.print_stats)==null?void 0:a.state)!=null?o:"";if(e.printer&&((l=e.printer["gcode_macro TIMELAPSE_TAKE_FRAME"])!=null&&l.is_paused)&&t==="paused"&&(t="printing"),t==="paused")return be.t("App.Titles.Pause");if(((u=(c=e.printer)==null?void 0:c.print_stats)==null?void 0:u.state)==="complete"){let R=be.t("App.Titles.Complete",{filename:e.printer.print_stats.filename});return(d=e.gui)!=null&&d.general.printername&&(R+="- ".concat((h=e.gui)==null?void 0:h.general.printername)),R}if(t==="printing"){const R=s["printer/getEstimatedTimeETAFormat"],W=Math.floor(s["printer/getPrintPercent"]*100);if(R!=="--"){let ee=be.t("App.Titles.PrintingETA",{percent:W,filename:(m=(p=e.printer)==null?void 0:p.print_stats)==null?void 0:m.filename,eta:R});return(f=e.gui)!=null&&f.general.printername&&(ee+="- ".concat((b=e.gui)==null?void 0:b.general.printername)),ee}let B=be.t("App.Titles.Printing",{percent:W,filename:(w=(C=e.printer)==null?void 0:C.print_stats)==null?void 0:w.filename});return(M=e.gui)!=null&&M.general.printername&&(B+="- ".concat((H=e.gui)==null?void 0:H.general.printername)),B}return(I=(T=(A=e.gui)==null?void 0:A.general.printername)!=null?T:($=e.printer)==null?void 0:$.hostname)!=null?I:"Mainsail"},getDependencies:e=>{var b,C,w,M,H,A,$,T,I,R,W,B;const s=[],t=(C=(b=e.printer)==null?void 0:b.software_version)!=null?C:"",r=t.split("-"),i=(w=r[0])!=null?w:"",n=parseInt((M=r[1])!=null?M:0),a=df.split("-"),o=(H=a[0])!=null?H:"",l=parseInt((A=a[1])!=null?A:0);Ve.valid(i)&&(Ve.gt(o,i)||Ve.eq(o,i)&&n{y.set(e,t,r)})},addLoading(e,s){e.loadings.push(s.name)},removeLoading(e,s){const t=e.loadings.indexOf(s.name);t>-1&&e.loadings.splice(t,1)},clearLoadings(e){e.loadings.length&&y.set(e,"loadings",[])},addInitModule(e,s){const t=[...e.initializationList];t.indexOf(s)>-1||(t.push(s),y.set(e,"initializationList",t))},removeInitModule(e,s){const t=[...e.initializationList],r=t.indexOf(s);r!==-1&&(t.splice(r,1),y.set(e,"initializationList",t))},removeInitComponent(e,s){const t=[...e.initializationList],r=t.reduce((i,n,a)=>(n.startsWith(s)&&i.push(a),i),[]);r.length&&(r.forEach(i=>t.splice(i,1)),y.set(e,"initializationList",t))}},ZJ={getUrl:e=>"//"+e.hostname+(e.port!==80?":"+e.port:""),getHostUrl:e=>(e.protocol==="wss"?"https":"http")+"://"+e.hostname+"/",getWebsocketUrl:(e,s)=>e.protocol+":"+s.getUrl+"/websocket"},q$=()=>{const e={}.VUE_APP_HOSTNAME||window.location.hostname,s=window.location.port||(window.location.protocol==="https:"?443:80),t={}.VUE_APP_PORT?Number({}.VUE_APP_PORT):Number(s);return{hostname:e,port:t,protocol:document.location.protocol==="https:"?"wss":"ws",reconnectInterval:Number({}.VUE_APP_RECONNECT_INTERVAL||2e3),isConnected:!1,isConnecting:!1,connectingFailed:!1,loadings:[],initializationList:["server"],connection_id:null}},qJ=q$(),XJ={namespaced:!0,state:qJ,getters:ZJ,actions:GJ,mutations:zJ},YJ={reset({commit:e,dispatch:s}){s("stopKlippyConnectedInterval"),s("stopKlippyStateInterval"),e("reset"),s("power/reset"),s("updateManager/reset")},async init({dispatch:e}){window.console.debug("init Server"),e("socket/addInitModule","server/info",{root:!0}),e("socket/addInitModule","server/config",{root:!0}),e("socket/addInitModule","server/systemInfo",{root:!0}),e("socket/addInitModule","server/procStats",{root:!0}),e("socket/addInitModule","server/databaseList",{root:!0}),e("identify"),y.$socket.emit("server.info",{},{action:"server/initServerInfo"}),y.$socket.emit("server.config",{},{action:"server/initServerConfig"}),y.$socket.emit("machine.system_info",{},{action:"server/initSystemInfo"}),y.$socket.emit("machine.proc_stats",{},{action:"server/initProcStats"}),y.$socket.emit("server.database.list",{root:"config"},{action:"server/checkDatabases"}),await e("socket/removeInitModule","server",{root:!0})},identify({dispatch:e,rootState:s}){e("socket/addInitModule","server/identify",{root:!0}),y.$socket.emit("server.connection.identify",{client_name:"mainsail",version:s.packageVersion,type:"web",url:"https://github.com/mainsail-crew/mainsail"},{action:"server/setConnectionId"})},setConnectionId({commit:e,dispatch:s},t){e("setConnectionId",t.connection_id),s("socket/removeInitModule","server/identify",{root:!0})},checkDatabases({dispatch:e,commit:s},t){var r,i;(r=t.namespaces)!=null&&r.includes("mainsail")?(e("socket/addInitModule","gui/init",{root:!0}),e("gui/init",null,{root:!0})):e("gui/initDb",null,{root:!0}),(i=t.namespaces)!=null&&i.includes("webcams")&&(e("socket/addInitModule","gui/webcam/init",{root:!0}),e("gui/webcams/init",null,{root:!0})),s("saveDbNamespaces",t.namespaces),y.$socket.emit("server.info",{},{action:"server/checkKlippyConnected"}),e("socket/removeInitModule","server/databaseList",{root:!0})},initServerInfo({dispatch:e,commit:s},t){var r,i;if("plugins"in t&&delete t.plugins,"failed_plugins"in t&&delete t.failed_plugins,(r=t.components)!=null&&r.length)for(let n of t.components)n=t5(n),Ab.includes(n)&&(window.console.debug("init server component: "+n),e("socket/addInitModule","server/"+n+"/init",{root:!0}),e("server/"+n+"/init",{},{root:!0}));(i=t.registered_directories)!=null&&i.length&&e("files/initRootDirs",t.registered_directories,{root:!0}),s("setData",t),e("socket/removeInitModule","server/info",{root:!0})},initServerConfig({commit:e,dispatch:s},t){e("setConfig",t),s("socket/removeInitModule","server/config",{root:!0})},initSystemInfo({commit:e,dispatch:s},t){e("setSystemInfo",t.system_info),s("socket/removeInitModule","server/systemInfo",{root:!0})},initProcStats({commit:e,dispatch:s},t){if(t.throttled_state!==null&&e("setThrottledState",t.throttled_state),t.system_uptime){const r=new Date(new Date().getTime()-t.system_uptime*1e3);e("setSystemBootAt",r)}s("socket/removeInitModule","server/procStats",{root:!0})},updateProcStats({commit:e},s){"cpu_temp"in s&&e("setCpuTemp",s.cpu_temp),"moonraker_stats"in s&&e("setMoonrakerStats",s.moonraker_stats),"network"in s&&e("setNetworkStats",s.network),"system_cpu_usage"in s&&e("setCpuStats",s.system_cpu_usage)},setKlippyReady({dispatch:e}){e("stopKlippyConnectedInterval"),e("stopKlippyStateInterval"),e("printer/reset",null,{root:!0}),e("printer/init",null,{root:!0})},setKlippyDisconnected({commit:e,dispatch:s}){e("setKlippyDisconnected",null),s("stopKlippyStateInterval"),s("startKlippyConnectedInterval")},setKlippyShutdown({commit:e,dispatch:s}){e("setKlippyShutdown",null),s("stopKlippyStateInterval"),s("startKlippyConnectedInterval")},startKlippyConnectedInterval({commit:e,state:s}){if(s.klippy_connected_timer)return;const t=setInterval(()=>{y.$socket.emit("server.info",{},{action:"server/checkKlippyConnected"})},2e3);e("setKlippyConnectedTimer",t)},stopKlippyConnectedInterval({commit:e,state:s}){s.klippy_connected_timer!==null&&(clearInterval(s.klippy_connected_timer),e("setKlippyConnectedTimer",null))},checkKlippyConnected({commit:e,dispatch:s},t){if(!t.klippy_connected){s("startKlippyConnectedInterval");return}s("stopKlippyConnectedInterval"),e("setKlippyConnected"),s("checkKlippyState",{state:t.klippy_state,state_message:null})},startKlippyStateInterval({commit:e,state:s}){if(s.klippy_state_timer)return;const t=setInterval(()=>{y.$socket.emit("printer.info",{},{action:"server/checkKlippyState"})},2e3);e("setKlippyStateTimer",t)},stopKlippyStateInterval({commit:e,state:s}){s.klippy_state_timer!==null&&(clearInterval(s.klippy_state_timer),e("setKlippyStateTimer",null))},checkKlippyState({commit:e,dispatch:s},t){if(e("setKlippyState",t.state),e("setKlippyMessage",t.state_message),t.state!=="ready"){s("startKlippyStateInterval");return}s("stopKlippyConnectedInterval"),s("stopKlippyStateInterval"),s("printer/init",null,{root:!0})},getData({commit:e},s){e("setData",s)},getGcodeStore({commit:e,dispatch:s,rootGetters:t},r){e("clearGcodeStore");let i=r.gcode_store;t["gui/console/getConsolefilterRules"].forEach(o=>{try{const l=new RegExp(o);i=i.filter(c=>!l.test(c.message))}catch{window.console.error("Custom console filter '"+o+"' doesn't work")}});const a=t["gui/console/getConsoleClearedSince"];i=i.filter(o=>a?o.time&&o.time*1e3{try{new RegExp(l).test(n)&&(o=!1)}catch{window.console.error("Custom console filter '"+l+"' doesn't work!")}return o}),o&&(t.type==="command"&&(n=''+n+""),e("addEvent",{date:new Date,message:r,formatMessage:n,type:i}),["error","response"].includes(i)&&!["/","/console"].includes(sa.currentRoute.path)&&r.startsWith("!! ")&&y.$toast.error(n))},serviceStateChanged({commit:e},s){e("updateServiceState",s)},addFailedInitComponent({commit:e},s){e("removeComponent",s),e("addFailedInitComponent",s)}},JJ={reset(e){Object.assign(e,sx())},setKlippyConnected(e){y.set(e,"klippy_connected",!0)},setKlippyState(e,s){y.set(e,"klippy_state",s)},setKlippyStateTimer(e,s){y.set(e,"klippy_state_timer",s)},setKlippyMessage(e,s){y.set(e,"klippy_message",s)},setKlippyDisconnected(e){y.set(e,"klippy_connected",!1),y.set(e,"klippy_state","disconnected"),y.set(e,"klippy_message","Disconnected...")},setKlippyShutdown(e){y.set(e,"klippy_state","shutdown"),y.set(e,"klippy_message","Shutdown...")},setCpuTemp(e,s){y.set(e,"cpu_temp",s)},setMoonrakerStats(e,s){y.set(e,"moonraker_stats",s)},setNetworkStats(e,s){y.set(e,"network_stats",s)},setCpuStats(e,s){y.set(e,"system_cpu_usage",s)},setKlippyConnectedTimer(e,s){y.set(e,"klippy_connected_timer",s)},setProcStats(e,s){y.set(e,"cpu_temp",s.cpu_temp),y.set(e,"moonraker_stats",s.moonraker_stats)},setConnectionId(e,s){y.set(e,"connection_id",s)},setData(e,s){"requestParams"in s&&delete s.requestParams,Object.entries(s).forEach(([t,r])=>{y.set(e,t,r)})},saveDbNamespaces(e,s){y.set(e,"dbNamespaces",s)},setConfig(e,s){y.set(e,"config",s)},setConsoleClearedThisSession(e){y.set(e,"console_cleared_this_session",!0)},clearGcodeStore(e){y.set(e,"events",[])},setGcodeStore(e,s){s.length>=Ea&&(s=s.slice(s.length-Ea)),s.forEach(t=>{const r=new Date(t.time*1e3);let i=kp(t.message),n=t.type;n==="command"&&(i=''+i+""),n==="response"&&t.message.startsWith("// action:")&&(n="action"),e.events.push({date:r,message:t.message,formatMessage:i,type:n})})},addEvent(e,s){var t;["command","autocomplete"].includes(s.type)&&((t=e.events[e.events.length-1])==null?void 0:t.type)==="autocomplete"&&e.events.pop(),e.events.push({date:s.date,message:s.message,formatMessage:s.formatMessage,type:s.type}),e.events.length>=Ea&&(e.events=e.events.slice(e.events.length-Ea))},setSystemInfo(e,s){y.set(e,"system_info",s)},setThrottledState(e,s){s&&"bits"in s&&y.set(e.throttled_state,"bits",s.bits),s&&"flags"in s&&y.set(e.throttled_state,"flags",s.flags)},setSystemBootAt(e,s){y.set(e,"system_boot_at",s)},addRootDirectory(e,s){e.registered_directories.push(s.name)},updateServiceState(e,s){var r;const t=Object.keys(s)[0];(r=e.system_info)!=null&&r.service_state&&y.set(e.system_info.service_state,t,s[t])},addFailedInitComponent(e,s){const t=e.failed_init_components;t.includes(s)||t.push(s),y.set(e,"failed_init_components",t)},removeComponent(e,s){const t=e.components,r=t.indexOf(s);r!==-1&&(t.splice(r,1),y.set(e,"components",t))}},KJ={getConsoleEvents:e=>(s=!0,t=500)=>{var i;const r=(i=[...e.events].slice(t*-1))!=null?i:[];if(r.length<20&&!e.console_cleared_this_session){const n=r.length?r[0].date:new Date;let a="";a+='- Type HELP to get a list of available commands.\n',a+='- Click on the "?" button to get a searchable list.\n',a+="- Commands in the console are clickable and will be placed into the input field.\n",a+="- Use the tab key to complete your inputs. If there are several options, a list is displayed.\n",a+="- Use the ⇵ arrow keys to navigate through the previous entries.\n",r.unshift({date:n,message:a,formatMessage:kp(a),type:"response"})}return s?r.reverse():r},getConfig:e=>(s,t)=>{var i,n;const r=(n=(i=e.config)==null?void 0:i.config)!=null?n:{};return s in r&&t in r[s]?r[s][t]:null},getHostStats:(e,s,t,r)=>{var n,a,o,l,c,u,d,h,p,m,f,b,C,w,M,H,A,$,T,I,R,W,B,ee,D,z,X,Q,te,se,F,G,x,P;let i=null;if("system_info"in e){let L=null;(n=t.printer)!=null&&n.software_version&&(L=(a=t.printer)==null?void 0:a.software_version.split("-").slice(0,4).join("-"));let Y=null;if((l=(o=e.system_info)==null?void 0:o.python)!=null&&l.version_string){const Gx=(u=(c=e.system_info)==null?void 0:c.python)==null?void 0:u.version_string.indexOf(" ");Y=(h=(d=e.system_info)==null?void 0:d.python)==null?void 0:h.version_string.slice(0,Gx+1)}const ae=(f=(m=(p=e.system_info)==null?void 0:p.cpu_info)==null?void 0:m.cpu_count)!=null?f:1,de=Math.round(((C=(b=t.printer.system_stats)==null?void 0:b.sysload)!=null?C:0)*100)/100,ge=Math.round(de/ae*100);let ye="primary";ge>95?ye="error":ge>80&&(ye="warning");let tt=null,lt=null;const _t=((M=(w=t.printer.system_stats)==null?void 0:w.memavail)!=null?M:0)*1024,Ss=(($=(A=(H=e.system_info)==null?void 0:H.cpu_info)==null?void 0:A.total_memory)!=null?$:0)*1024;_t>0&&Ss>0?(tt=it(Ss-_t)+" / "+it(Ss),lt=Math.round((Ss-_t)/Ss*100)):Ss&&(tt=it(Ss));let iu="primary";lt&<>95?iu="error":lt&<>80&&(iu="warning");let nu=r["printer/getHostTempSensor"];nu===null&&(nu={temperature:(T=e.cpu_temp)==null?void 0:T.toFixed(0),measured_min_temp:null,measured_max_temp:null}),i={cpuName:(W=(R=(I=e.system_info)==null?void 0:I.cpu_info)==null?void 0:R.processor)!=null?W:null,cpuDesc:(D=(ee=(B=e.system_info)==null?void 0:B.cpu_info)==null?void 0:ee.cpu_desc)!=null?D:null,bits:(Q=(X=(z=e.system_info)==null?void 0:z.cpu_info)==null?void 0:X.bits)!=null?Q:null,version:L,pythonVersion:Y,os:(F=(se=(te=e.system_info)==null?void 0:te.distribution)==null?void 0:se.name)!=null?F:null,release_info:(P=(x=(G=e.system_info)==null?void 0:G.distribution)==null?void 0:x.release_info)!=null?P:null,load:de,loadPercent:ge<100?ge:100,loadProgressColor:ye,memoryFormat:tt,memUsed:it(Ss-_t),memAvail:it(_t),memTotal:it(Ss),memUsage:lt,memUsageColor:iu,tempSensor:nu}}return i},getCpuUsage:e=>"cpu"in e.system_cpu_usage?Math.round(e.system_cpu_usage.cpu):null,getNetworkInterfaces:e=>{const s={};return Object.keys(e.network_stats).forEach(t=>{var r,i,n,a,o;t!=="lo"&&(t in((i=(r=e.system_info)==null?void 0:r.network)!=null?i:{})||t.startsWith("can"))&&(s[t]={...e.network_stats[t]},(n=e.system_info)!=null&&n.network&&t in((o=(a=e.system_info)==null?void 0:a.network)!=null?o:{})&&(s[t].details={...e.system_info.network[t]}))}),s},getThrottledStateFlags:e=>{let s=e.throttled_state.flags.filter(t=>t!=="?");return s=s.map(t=>(t=t.replace(/ /g,"").replace(/-/g,""),t.charAt(0).toUpperCase()+t.slice(1))),s}},QJ={reset({commit:e}){e("reset")},init(){y.$socket.emit("machine.device_power.devices",{},{action:"server/power/getDevices"})},async getDevices({commit:e,dispatch:s},t){t.error||await e("setDevices",t.devices),await s("socket/removeInitModule","server/power/init",{root:!0})},getStatus({commit:e},s){s.error||e("setStatus",s)},responseToggle({commit:e},s){"requestParams"in s&&delete s.requestParams;for(const[t,r]of Object.entries(s))e("setStatus",{device:t,status:r})}},eK={reset(e){Object.assign(e,X$())},setDevices(e,s){y.set(e,"devices",s)},setStatus(e,s){const t=e.devices.findIndex(r=>r.device===s.device);t>=0&&y.set(e.devices[t],"status",s.status)}},tK={getDevices:e=>e.devices},X$=()=>({devices:[]}),sK=X$(),rK={namespaced:!0,state:sK,getters:tK,actions:QJ,mutations:eK},iK={reset({commit:e}){e("reset")},init(){y.$socket.emit("machine.update.status",{},{action:"server/updateManager/onUpdateStatus"})},async onUpdateStatus({commit:e,dispatch:s},t){var r,i;await e("resetRepos");for(const n of Object.keys(t.version_info)){const a=(r=t.version_info[n])!=null?r:{},o=(i=a.configured_type)!=null?i:null;if(["git_repo","zip"].includes(o)){await e("storeGitRepo",{...a,name:n});continue}if(["web","web_beta"].includes(o)){await e("storeWebRepo",{...a,name:n});continue}n==="system"&&await e("updateSystem",{...a})}await s("socket/removeInitModule","server/updateManager/init",{root:!0})}},nK={reset(e){Object.assign(e,Y$())},resetRepos(e){y.set(e,"git_repos",[]),y.set(e,"web_repos",[]),y.set(e,"system",{package_count:0,package_list:[]})},storeGitRepo(e,s){const t=[...e.git_repos];t.push({...s}),y.set(e,"git_repos",t)},storeWebRepo(e,s){const t=[...e.web_repos];t.push({...s}),y.set(e,"web_repos",t)},updateSystem(e,s){const t={...e.system};t.package_count=s.package_count,t.package_list=s.package_list,y.set(e,"system",t)},addUpdateResponse(e,s){e.updateResponse.application!==s.application&&y.set(e.updateResponse,"application",s.application),e.updateResponse.complete!==s.complete&&y.set(e.updateResponse,"complete",s.complete),"complete"in s&&s.complete&&y.$socket.emit("machine.update.status",{refresh:!1},{action:"server/updateManager/onUpdateStatus"}),e.updateResponse.messages.push({date:new Date,message:s.message})},resetUpdateResponse(e){y.set(e,"updateResponse",{application:"",complete:!0,messages:[]})}},aK={getUpdateManagerList(e){const s=[];return e.git_repos.forEach(t=>{s.push({name:t.name,type:"git",data:{...t}})}),e.web_repos.forEach(t=>{s.push({name:t.name,type:"web",data:{...t}})}),$t(s,"name")}},Y$=()=>({busy:!1,github_rate_limit:null,github_requests_remaining:null,github_limit_reset_time:null,git_repos:[],web_repos:[],system:{package_count:0,package_list:[]},updateResponse:{application:"",complete:!0,messages:[]}}),oK=Y$(),lK={namespaced:!0,state:oK,getters:aK,actions:iK,mutations:nK},cK={reset({commit:e}){e("reset")},init(){y.$socket.emit("server.history.list",{start:0,limit:50,max:100},{action:"server/history/getHistory"}),y.$socket.emit("server.history.totals",{},{action:"server/history/getTotals"})},getTotals({commit:e},s){e("setTotals",s.job_totals)},async getHistory({commit:e,dispatch:s,state:t},r){var o,l,c,u,d,h,p,m,f,b,C;"requestParams"in r&&((l=(o=r.requestParams)==null?void 0:o.start)!=null?l:0)===0&&e("resetJobs"),(c=r.jobs)==null||c.forEach(w=>{t.jobs.findIndex(M=>M.job_id===w.job_id)===-1&&e("addJob",w)});const i=(d=(u=r.requestParams)==null?void 0:u.start)!=null?d:0,n=(p=(h=r.requestParams)==null?void 0:h.limit)!=null?p:50,a=(f=(m=r.requestParams)==null?void 0:m.max)!=null?f:null;if(n>0&&(a===null||a>i+n)&&((b=r.jobs)==null?void 0:b.length)===n){y.$socket.emit("server.history.list",{start:i+n,limit:n,max:a},{action:"server/history/getHistory"});return}((C=r.jobs)==null?void 0:C.length){e("destroyJob",t)})},saveHistoryNote({commit:e},s){y.$socket.emit("server.database.post_item",{namespace:"history_notes",key:s.job_id,value:{text:s.note}}),e("setHistoryNotes",{job_id:s.job_id,text:s.note})}},uK={reset(e){Object.assign(e,J$())},resetJobs(e){y.set(e,"jobs",[])},setTotals(e,s){y.set(e,"job_totals",s)},setHistoryNotes(e,s){const t=e.jobs.find(r=>r.job_id===s.job_id);t&&y.set(t,"note",s.text)},addJob(e,s){const t=[...e.jobs];t.push(s),y.set(e,"jobs",t)},updateJob(e,s){const t=e.jobs.findIndex(r=>r.job_id===s.job_id);t!==-1&&y.set(e.jobs,t,s)},destroyJob(e,s){const t=e.jobs.findIndex(r=>r.job_id===s);t!==-1&&e.jobs.splice(t,1)},setAllLoaded(e){y.set(e,"all_loaded",!0)}},dK={getTotalPrintTime(e){let s=0;return e.jobs.forEach(t=>{s+=t.print_duration}),s},getTotalCompletedPrintTime(e){let s=0;return e.jobs.forEach(t=>{t.status==="completed"&&(s+=t.print_duration)}),s},getLongestPrintTime(e){let s=0;return e.jobs.forEach(t=>{t.print_duration>s&&(s=t.print_duration)}),s},getTotalFilamentUsed(e){let s=0;return e.jobs.forEach(t=>{s+=t.filament_used}),s},getTotalJobsCount(e){return e.jobs.length},getTotalCompletedJobsCount(e){return e.jobs.filter(s=>s.status==="completed").length},getAvgPrintTime(e,s){const t=s.getTotalCompletedPrintTime,r=s.getTotalCompletedJobsCount;return t>0&&r>0?Math.round(t/r):0},getAllPrintStatusArrayAll(e,s,t){const r=[];return e.jobs.forEach(i=>{var a;const n=r.findIndex(o=>o.name===i.status);if(n!==-1)r[n].value+=1;else{const o=be.te("History.StatusValues.".concat(i.status),"en")?be.t("History.StatusValues.".concat(i.status)).toString():i.status,l={opacity:.9,color:"#424242",borderColor:"#1E1E1E",borderWidth:2,borderRadius:3};switch(i.status){case"completed":l.color="#BDBDBD";break;case"in_progress":l.color="#EEEEEE";break;case"cancelled":l.color="#616161";break}r.push({name:i.status,displayName:o,value:1,itemStyle:l,showInTable:!((a=t.gui)!=null&&a.view.history.hidePrintStatus.includes(i.status))})}}),r},getAllPrintStatusArray(e,s){const t=[...s.getAllPrintStatusArrayAll],i=e.jobs.length*.05,n=t.filter(a=>a.value1){let a=0;n.forEach(o=>{const l=t.findIndex(c=>c.name===o.name);l!==-1&&(a+=t[l].value,t.splice(l,1))}),t.push({name:"others",displayName:be.t("History.StatusValues.Others").toString(),value:a,itemStyle:{opacity:.9,color:"#616161",borderColor:"#1E1E1E",borderWidth:2,borderRadius:3},showInTable:!0})}return t},getSelectedPrintStatusArray(e,s,t){const r=[];return t.gui.view.history.selectedJobs.forEach(i=>{var a;const n=r.findIndex(o=>o.name===i.status);if(n!==-1)r[n].value+=1;else{const o=be.te("History.StatusValues.".concat(i.status),"en")?be.t("History.StatusValues.".concat(i.status)).toString():i.status,l={opacity:.9,color:"#424242",borderColor:"#1E1E1E",borderWidth:2,borderRadius:3};switch(i.status){case"completed":l.color="#BDBDBD";break;case"in_progress":l.color="#EEEEEE";break;case"cancelled":l.color="#616161";break}r.push({name:i.status,displayName:o,value:1,itemStyle:l,showInTable:!((a=t.gui)!=null&&a.view.history.hidePrintStatus.includes(i.status))})}}),r},getFilamentUsageArray(e,s,t){const r=[],i=new Date;i.setTime(i.getTime()-60*60*24*14*1e3),i.setHours(0,0,0,0);let n=[...e.jobs.filter(a=>new Date(a.start_time*1e3)>=i&&a.filament_used>0)];t.gui.view.history.selectedJobs.length&&(n=[...t.gui.view.history.selectedJobs.filter(a=>new Date(a.start_time*1e3)>=i&&a.filament_used>0)]);for(let a=0;a<=14;a++){const o=new Date;o.setTime(i.getTime()+60*60*24*a*1e3),r.push([new Date(o).setHours(0,0,0,0),0])}return n.length&&n.forEach(a=>{const o=new Date(a.start_time*1e3).setHours(0,0,0,0),l=r.findIndex(c=>c[0]===o);l!==-1&&(r[l][1]+=Math.round(a.filament_used)/1e3)}),r.sort((a,o)=>o[0]-a[0])},getPrinttimeAvgArray(e,s,t){const r=[0,0,0,0,0],i=new Date(new Date().getTime()-60*60*24*14*1e3);let n=[...e.jobs.filter(a=>new Date(a.start_time*1e3)>=i&&a.status==="completed")];return t.gui.view.history.selectedJobs.length&&(n=[...t.gui.view.history.selectedJobs.filter(a=>new Date(a.start_time*1e3)>=i&&a.status==="completed")]),n.length&&n.forEach(a=>{a.print_duration>0&&a.print_duration<=60*60*2?r[0]++:a.print_duration>60*60*2&&a.print_duration<=60*60*6?r[1]++:a.print_duration>60*60*6&&a.print_duration<=60*60*12?r[2]++:a.print_duration>60*60*12&&a.print_duration<=60*60*24?r[3]++:a.print_duration>60*60*24&&r[4]++}),r},getPrintStatus:e=>s=>{var t;if(e.jobs.length){const r=e.jobs.find(i=>i.job_id===s);return(t=r==null?void 0:r.status)!=null?t:""}return""},getPrintJobById:e=>s=>{if(e.jobs.length!==0)return e.jobs.find(t=>t.job_id===s)},getPrintJobsForGcodes:e=>(s,t,r,i,n)=>{if(e.jobs.length===0)return[];if(i)return e.jobs.filter(o=>{var l;return((l=o.metadata)==null?void 0:l.uuid)===i});const a=e.jobs.filter(o=>{var l,c;return((l=o.metadata)==null?void 0:l.size)===r&&Math.round(((c=o.metadata)==null?void 0:c.modified)*1e3)===t});return a.length?a:n?a.filter(o=>o.job_id===n):[]},getPrintStatusByFilename:e=>(s,t)=>{var r;if(e.jobs.length){const i=e.jobs.find(n=>{var a;return n.filename===s&&Math.round(((a=n.metadata)==null?void 0:a.modified)*1e3)===t});return(r=i==null?void 0:i.status)!=null?r:""}return""},getPrintStatusIconColor:()=>e=>{switch(e){case"in_progress":return"blue accent-3";case"completed":return"green";case"cancelled":return"red";default:return"orange"}},getPrintStatusTextColor:()=>e=>{switch(e){case"in_progress":return"blue--text";case"completed":return"green--text";case"cancelled":return"red--text";default:return"orange--text"}},getPrintStatusIcon:()=>e=>{switch(e){case"in_progress":return EP;case"completed":return NS;case"cancelled":return ZS;default:return Sn}},getFilterdJobList:(e,s,t)=>{const r=t.gui.view.history.hidePrintStatus;return e.jobs.filter(i=>!r.includes(i.status))}},J$=()=>({jobs:[],job_totals:{total_jobs:0,total_time:0,total_print_time:0,total_filament_used:0,longest_job:0,longest_print:0},all_loaded:!1}),hK=J$(),pK={namespaced:!0,state:hK,getters:dK,actions:cK,mutations:uK},mK={reset({commit:e}){e("reset")},init(){y.$socket.emit("machine.timelapse.get_settings",{},{action:"server/timelapse/initSettings"}),y.$socket.emit("machine.timelapse.lastframeinfo",{},{action:"server/timelapse/initLastFrameinfo"})},async initSettings({commit:e,dispatch:s},t){"requestParams"in t&&delete t.requestParams,await e("setSettings",t),await s("socket/removeInitModule","server/timelapse/init",{root:!0})},initLastFrameinfo({commit:e},s){e("setLastFrame",{count:s.framecount,file:s.lastframefile})},getEvent({commit:e},s){switch(s.action){case"newframe":e("setLastFrame",{count:parseInt(s.frame),file:s.framefile});break;case"render":s.status==="error"?(y.$toast.error(s.msg),e("resetSnackbar")):e("setRenderStatus",s);break;default:window.console.log("unknown timelapse event",s)}},saveSetting(e,s){y.$socket.emit("machine.timelapse.post_settings",s,{action:"server/timelapse/initSettings"})},updateCamSettings({dispatch:e,state:s},t){s.settings.camera===t.oldName&&e("saveSetting",{camera:t.newName})},resetSnackbar({commit:e}){e("resetSnackbar")}},fK={reset(e){Object.assign(e,K$())},setSettings(e,s){Object.keys(s).forEach(t=>{t in e.settings&&e.settings[t]!==s[t]&&y.set(e.settings,t,s[t])})},setLastFrame(e,s){y.set(e.lastFrame,"count",s.count),y.set(e.lastFrame,"file",s.file)},setRenderStatus(e,s){var t,r;y.set(e,"rendering",{status:s.status,progress:(t=s.progress)!=null?t:0,filename:(r=s.filename)!=null?r:""})},resetSnackbar(e){y.set(e,"rendering",{status:"",progress:0,filename:""})}},gK={},K$=()=>({settings:{enabled:!0,camera:"",mode:"layermacro",autorender:!0,autorenderOnce:!1,saveframes:!1,stream_delay_compensation:.05,gcode_verbose:!0,parkhead:!1,parkpos:"back_left",park_custom_pos_x:0,park_custom_pos_y:0,park_custom_pos_dz:0,park_travel_speed:100,park_retract_speed:15,park_retract_distance:1,park_extrude_speed:15,park_extrude_distance:1,park_time:.1,fw_retract:!1,hyperlapse_cycle:30,constant_rate_factor:23,output_framerate:30,pixelformat:"yuv420p",extraoutputparams:"",variable_fps:!1,targetlength:60,variable_fps_min:5,variable_fps_max:60,rotation:0,duplicatelastframe:0,previewimage:!0,time_format_code:"%Y%m%d_%H%M",blockedsettings:[]},lastFrame:{count:0,file:""},rendering:{status:"",progress:0,filename:""}}),vK=K$(),_K={namespaced:!0,state:vK,getters:gK,actions:mK,mutations:fK},bK={reset({commit:e}){e("reset")},init(){y.$socket.emit("server.job_queue.status",{},{action:"server/jobQueue/getStatus"})},getEvent({commit:e},s){"updated_queue"in s&&s.updated_queue!==null&&e("setQueuedJobs",s.updated_queue),"queue_state"in s&&e("setQueueState",s.queue_state)},async getStatus({commit:e,dispatch:s},t){"queued_jobs"in t&&await e("setQueuedJobs",t.queued_jobs),"queue_state"in t&&await e("setQueueState",t.queue_state),await s("socket/removeInitModule","server/jobQueue/init",{root:!0})},async addToQueue(e,s){y.$socket.emit("server.job_queue.post_job",{filenames:s})},changeCount({getters:e},s){const t=[];e.getJobs.forEach(i=>{var a,o;if(i.job_id===s.job_id){for(let l=0;l{const i=[];return e.queued_jobs.forEach(n=>{var l;const a={...n};if(i.length&&i[i.length-1].filename===a.filename){(l=i[i.length-1].combinedIds)==null||l.push(a.job_id);return}const o=r["files/getFile"]("gcodes/"+a.filename);o!=null&&o.metadataPulled||y.$socket.emit("server.files.metadata",{filename:a.filename},{action:"files/getMetadata"}),a.metadata=o,a.combinedIds=[],i.push(a)}),i},getJobsCount:e=>e.queued_jobs.length,getSmallThumbnail:(e,s,t,r)=>i=>{var n,a,o,l;if((a=(n=i==null?void 0:i.metadata)==null?void 0:n.thumbnails)!=null&&a.length){const c=(o=i==null?void 0:i.metadata)==null?void 0:o.thumbnails.find(d=>d.width>=ms&&d.width<=fs&&d.height>=ms&&d.height<=fs),u=i.filename.lastIndexOf("/")!==-1?"gcodes/"+i.filename.slice(0,i.filename.lastIndexOf("/")):"gcodes";if(c&&"relative_path"in c)return r["socket/getUrl"]+"/server/files/"+u+"/"+encodeURI(c.relative_path)+"?timestamp="+((l=i.metadata)==null?void 0:l.modified.getTime())}return""},getBigThumbnail:(e,s,t,r)=>i=>{var n,a,o,l;if((a=(n=i==null?void 0:i.metadata)==null?void 0:n.thumbnails)!=null&&a.length){const c=(o=i==null?void 0:i.metadata)==null?void 0:o.thumbnails.find(d=>d.width>=Os),u=i.filename.lastIndexOf("/")!==-1?"gcodes/"+i.filename.slice(0,i.filename.lastIndexOf("/")):"gcodes";if(c&&"relative_path"in c)return r["socket/getUrl"]+"/server/files/"+u+"/"+encodeURI(c.relative_path)+"?timestamp="+((l=i.metadata)==null?void 0:l.modified.getTime())}return""}},Q$=()=>({queued_jobs:[],queue_state:""}),$K=Q$(),xK={namespaced:!0,state:$K,getters:CK,actions:bK,mutations:yK},wK={reset({commit:e}){e("reset")},init(){y.$socket.emit("server.announcements.list",{},{action:"server/announcements/getList"})},async getList({commit:e,dispatch:s},t){if("entries"in t){const r=t.entries.map(i=>{const n=new Date(i.date*1e3),a=t.date_dismissed?new Date(i.date_dismissed*1e3):null,o=t.dismiss_wake?new Date(i.dismiss_wake*1e3):null;return{...i,date:n,date_dismissed:a,dismiss_wake:o}});await e("setEntries",r)}"feeds"in t&&await e("setFeeds",t.feeds),await s("socket/removeInitModule","server/announcements/init",{root:!0})},getDismissed({commit:e},s){e("setDismissed",{entry_id:s.entry_id,status:!0})},getWaked({commit:e},s){e("setDismissed",{entry_id:s.entry_id,status:!1})},close(e,s){y.$socket.emit("server.announcements.dismiss",{entry_id:s.entry_id})},dismiss(e,s){y.$socket.emit("server.announcements.dismiss",{entry_id:s.entry_id,wake_time:s.time})}},SK={reset(e){Object.assign(e,ex())},setEntries(e,s){y.set(e,"entries",s)},setFeeds(e,s){y.set(e,"feeds",s)},setDismissed(e,s){const t=[...e.entries],r=t.findIndex(i=>i.entry_id===s.entry_id);r>-1&&(t[r].dismissed=s.status,s.status?t[r].date_dismissed=new Date:(t[r].date_dismissed=null,t[r].dismiss_wake=null)),y.set(e,"entries",t)}},PK={getAnnouncements:e=>e.entries.filter(s=>!s.dismissed)},ex=()=>({entries:[],feeds:[]}),TK=ex(),DK={namespaced:!0,state:TK,getters:PK,actions:wK,mutations:SK},MK={reset({commit:e}){e("reset")},init({dispatch:e}){y.$socket.emit("server.spoolman.get_spool_id",{},{action:"server/spoolman/getActiveSpoolId"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/info"},{action:"server/spoolman/getInfo"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/health"},{action:"server/spoolman/getHealth"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/vendor"},{action:"server/spoolman/getVendors"}),e("socket/addInitModule","server/spoolman/getActiveSpoolId",{root:!0}),e("socket/addInitModule","server/spoolman/getHealth",{root:!0}),e("socket/addInitModule","server/spoolman/getInfo",{root:!0}),e("socket/addInitModule","server/spoolman/getVendors",{root:!0}),e("socket/removeInitModule","server/spoolman/init",{root:!0})},getActiveSpoolId({commit:e,dispatch:s},t){if(e("setActiveSpoolId",t.spool_id),s("socket/removeInitModule","server/spoolman/getActiveSpoolId",{root:!0}),[null,0].includes(t.spool_id)){e("setActiveSpool",null);return}y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/spool/".concat(t.spool_id)},{action:"server/spoolman/getActiveSpool"})},getActiveSpool({commit:e},s){"requestParams"in s&&delete s.requestParams,e("setActiveSpool",s)},getHealth({commit:e,dispatch:s},t){delete t.requestParams,e("setHealth",t.status),s("socket/removeInitModule","server/spoolman/getHealth",{root:!0})},getInfo({commit:e,dispatch:s},t){delete t.requestParams,e("setInfo",t),s("socket/removeInitModule","server/spoolman/getInfo",{root:!0})},getVendors({commit:e,dispatch:s},t){delete t.requestParams,e("setVendors",Object.entries(t).map(r=>r)),s("socket/removeInitModule","server/spoolman/getVendors",{root:!0})},refreshSpools({dispatch:e}){y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/spool"},{action:"server/spoolman/getSpools"}),e("socket/addLoading","refreshSpools",{root:!0})},getSpools({commit:e,dispatch:s},t){"requestParams"in t&&delete t.requestParams;const r=Object.entries(t).map(i=>i[1]);e("setSpools",r),s("socket/removeLoading","refreshSpools",{root:!0})},setActiveSpool(e,s){const t={};s!==null&&(t.spool_id=s),y.$socket.emit("server.spoolman.post_spool_id",t)},refreshActiveSpool({state:e}){e.active_spool_id!==null&&y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/spool/".concat(e.active_spool_id)},{action:"server/spoolman/getActiveSpool"})}},EK={reset(e){Object.assign(e,tx())},setActiveSpoolId(e,s){y.set(e,"active_spool_id",s)},setActiveSpool(e,s){y.set(e,"active_spool",s)},setHealth(e,s){y.set(e,"health",s)},setInfo(e,s){y.set(e,"info",s)},setVendors(e,s){y.set(e,"vendors",s)},setSpools(e,s){y.set(e,"spools",s)}},OK={},tx=()=>({health:"",info:{automatic_backups:!1,backups_dir:"",data_dir:"",debug_mode:!1,version:""},active_spool_id:null,active_spool:null,vendors:[],feeds:[]}),LK=tx(),kK={namespaced:!0,state:LK,getters:OK,actions:MK,mutations:EK},sx=()=>({klippy_connected:!1,klippy_connected_timer:null,klippy_state:"",klippy_state_timer:null,klippy_message:"",components:[],failed_components:[],failed_init_components:[],warnings:[],registered_directories:[],events:[],config:{},system_info:null,system_boot_at:null,cpu_temp:0,moonraker_stats:null,throttled_state:{bits:0,flags:[]},network_stats:{},system_cpu_usage:{},dbNamespaces:[],websocket_count:0,moonraker_version:""}),AK=sx(),FK={namespaced:!0,state:AK,getters:KJ,actions:YJ,mutations:JJ,modules:{power:rK,updateManager:lK,history:pK,timelapse:_K,jobQueue:xK,announcements:DK,spoolman:kK}},RK={reset({commit:e}){e("reset"),e("tempHistory/reset"),e("socket/clearLoadings",null,{root:!0})},init({dispatch:e}){window.console.debug("init printer"),e("reset"),e("socket/addInitModule","printer/info",{root:!0}),e("socket/addInitModule","printer/initSubscripts",{root:!0}),e("socket/addInitModule","printer/initHelpList",{root:!0}),e("socket/addInitModule","printer/initTempHistory",{root:!0}),e("socket/addInitModule","server/gcode_store",{root:!0}),y.$socket.emit("printer.info",{},{action:"printer/getInfo"}),y.$socket.emit("printer.objects.list",{},{action:"printer/initSubscripts"}),y.$socket.emit("printer.gcode.help",{},{action:"printer/initHelpList"}),y.$socket.emit("server.gcode_store",{},{action:"server/getGcodeStore"})},getInfo({commit:e,dispatch:s},t){e("server/setData",{klippy_state:t.state,klippy_message:t.state_message},{root:!0}),e("setData",{hostname:t.hostname,software_version:t.software_version,cpu_info:t.cpu_info}),s("socket/removeInitModule","printer/info",{root:!0})},initSubscripts({dispatch:e},s){let t={};const r=["menu"];s.objects.forEach(i=>{const n=i.split(" ");r.includes(n[0])||(t={...t,[i]:null})}),Object.keys(t).length>0?y.$socket.emit("printer.objects.subscribe",{objects:t},{action:"printer/getInitData"}):y.$socket.emit("server.temperature_store",{include_monitors:!0},{action:"printer/tempHistory/init"}),e("socket/removeInitModule","printer/initSubscripts",{root:!0})},getInitData({dispatch:e},s){"screws_tilt_adjust"in s.status&&(s.status.screws_tilt_adjust.error=!1,s.status.screws_tilt_adjust.results={}),e("getData",s),y.$socket.emit("server.temperature_store",{include_monitors:!0},{action:"printer/tempHistory/init"}),setTimeout(()=>{e("initExtruderCanExtrude")},200)},getData({commit:e,dispatch:s,state:t},r){var i,n,a,o,l,c,u,d,h,p;"status"in r&&(r=r.status),"requestParams"in r&&delete r.requestParams,"webhooks"in r&&(this.dispatch("server/getData",{klippy_state:r.webhooks.state,klippy_message:r.webhooks.state_message},{root:!0}),delete r.webhooks),"bed_mesh"in t&&"bed_mesh"in r&&"profiles"in r.bed_mesh&&(e("setBedMeshProfiles",r.bed_mesh.profiles),delete r.bed_mesh.profiles),(a=(n=(i=r.configfile)==null?void 0:i.settings)==null?void 0:n.printer)!=null&&a.kinematics&&s("gui/updateGcodeviewerCache",{kinematics:(c=(l=(o=r.configfile)==null?void 0:o.settings)==null?void 0:l.printer)==null?void 0:c.kinematics},{root:!0}),(u=r.toolhead)!=null&&u.axis_maximum&&s("gui/updateGcodeviewerCache",{axis_maximum:(d=r.toolhead)==null?void 0:d.axis_maximum},{root:!0}),(h=r.toolhead)!=null&&h.axis_minimum&&s("gui/updateGcodeviewerCache",{axis_minimum:(p=r.toolhead)==null?void 0:p.axis_minimum},{root:!0}),e("setData",r)},initExtruderCanExtrude({state:e}){const s=Object.keys(e).filter(r=>r.startsWith("extruder")),t={};s.forEach(r=>{t[r]=["can_extrude"]}),y.$socket.emit("printer.objects.query",{objects:t},{action:"printer/getData"})},initHelpList({commit:e,dispatch:s},t){e("setHelplist",t),s("socket/removeInitModule","printer/initHelpList",{root:!0})},getEndstopStatus({commit:e},s){e("setEndstopStatus",s)},removeBedMeshProfile({commit:e},s){e("removeBedMeshProfile",s)},sendGcode({dispatch:e},s){e("server/addEvent",{message:s,type:"command"},{root:!0}),s.toLowerCase().trim()==="m112"?y.$socket.emit("printer.emergency_stop",{},{loading:"sendGcode"}):y.$socket.emit("printer.gcode.script",{script:s},{loading:"sendGcode"})},clearScrewsTiltAdjust({commit:e}){e("clearScrewsTiltAdjust")}},IK={reset(e){const s=ix();for(const t of Object.keys(e))!(t in s)&&t!=="tempHistory"&&delete e[t];for(const[t,r]of Object.entries(s))y.set(e,t,r)},setData(e,s){rc(e,s)},setBedMeshProfiles(e,s){"bed_mesh"in e&&y.set(e.bed_mesh,"profiles",s)},setHelplist(e,s){const t=[];for(const[r,i]of Object.entries(s))t.push({commandLow:r.toLowerCase(),command:r,description:i});y.set(e,"helplist",t)},clearCurrentFile(e){y.set(e,"current_file",{})},setEndstopStatus(e,s){delete s.requestParams,y.set(e,"endstops",s)},removeBedMeshProfile(e,s){"bed_mesh "+s.name in e.configfile.config&&Object.assign(e.configfile.config["bed_mesh "+s.name],{deleted:!0})},clearScrewsTiltAdjust(e){y.set(e.screws_tilt_adjust,"error",!1),y.set(e.screws_tilt_adjust,"results",{})}},HK={getPrintPercent:(e,s,t)=>{var i,n,a;switch((a=(n=(i=t==null?void 0:t.gui)==null?void 0:i.general)==null?void 0:n.calcPrintProgress)!=null?a:"file-relative"){case"file-relative":return s.getPrintPercentByFilepositionRelative;case"file-absolute":return s.getPrintPercentByFilepositionAbsolute;case"slicer":return s.getPrintPercentBySlicer;case"filament":return s.getPrintPercentByFilament;default:return s.getPrintPercentByFilepositionRelative}},getPrintPercentByFilepositionRelative:e=>{var s,t,r,i,n;if((s=e.current_file)!=null&&s.filename&&((t=e.current_file)!=null&&t.gcode_start_byte)&&((r=e.current_file)!=null&&r.gcode_end_byte)&&e.current_file.filename===e.print_stats.filename){if(e.virtual_sdcard.file_position<=e.current_file.gcode_start_byte)return 0;if(e.virtual_sdcard.file_position>=e.current_file.gcode_end_byte)return 1;const a=e.virtual_sdcard.file_position-e.current_file.gcode_start_byte,o=e.current_file.gcode_end_byte-e.current_file.gcode_start_byte;if(a>0&&o>0)return 1/o*a}return(n=(i=e.virtual_sdcard)==null?void 0:i.progress)!=null?n:0},getPrintPercentByFilepositionAbsolute:e=>{var s,t;return(t=(s=e.virtual_sdcard)==null?void 0:s.progress)!=null?t:0},getPrintPercentBySlicer:e=>{var s,t;return(t=(s=e.display_status)==null?void 0:s.progress)!=null?t:0},getPrintPercentByFilament:e=>{var r,i,n,a,o,l;const s=(i=(r=e.print_stats)==null?void 0:r.filament_used)!=null?i:null,t=(a=(n=e.current_file)==null?void 0:n.filament_total)!=null?a:null;if(s!==null&&t!==null){if(t==0)return 0;const c=s/t;return c>1?1:c}return(l=(o=e.virtual_sdcard)==null?void 0:o.progress)!=null?l:0},getPrintMaxLayers:e=>{var s,t,r,i,n,a,o;if(((r=(t=(s=e.print_stats)==null?void 0:s.info)==null?void 0:t.total_layer)!=null?r:null)!==null)return e.print_stats.info.total_layer;if((i=e.current_file)!=null&&i.layer_count)return e.current_file.layer_count;if(((n=e.current_file)==null?void 0:n.first_layer_height)!==void 0&&((a=e.current_file)==null?void 0:a.layer_height)!==void 0&&((o=e.current_file)==null?void 0:o.object_height)!==void 0){const l=Math.ceil((e.current_file.object_height-e.current_file.first_layer_height)/e.current_file.layer_height+1);return l>0?l:0}return 0},getPrintCurrentLayer:(e,s)=>{var t,r,i,n,a,o,l,c;if(((i=(r=(t=e.print_stats)==null?void 0:t.info)==null?void 0:r.current_layer)!=null?i:null)!==null)return e.print_stats.info.current_layer;if(((n=e.print_stats)==null?void 0:n.print_duration)>0&&((a=e.current_file)==null?void 0:a.first_layer_height)!==void 0&&((o=e.current_file)==null?void 0:o.layer_height)!==void 0){const u=(c=(l=e.gcode_move)==null?void 0:l.gcode_position[2])!=null?c:0,d=Math.ceil((u-e.current_file.first_layer_height)/e.current_file.layer_height+1);if(d>s.getPrintMaxLayers)return s.getPrintMaxLayers;if(d>0)return d}return 0},getPrinterObjects:e=>s=>{var r,i,n,a;const t=[];for(const[o,l]of Object.entries(e)){let c=o.substring(0,o.indexOf(" ")).trimEnd(),u=o.substring(o.indexOf(" ")+1).trimStart();o.indexOf(" ")===-1&&(c=u=o),s.includes(c)&&t.push({name:u,type:c,state:{...l},config:(i=(r=e.configfile)==null?void 0:r.config[o])!=null?i:{},settings:(a=(n=e.configfile)==null?void 0:n.settings[o.toLowerCase()])!=null?a:{}})}return t},getMacros:e=>{var i,n,a,o;const s=[],t=(n=(i=e.configfile)==null?void 0:i.config)!=null?n:{},r=(o=(a=e.configfile)==null?void 0:a.settings)!=null?o:null;return Object.keys(t).filter(l=>l.toLowerCase().startsWith("gcode_macro")).forEach(l=>{var p,m;const c=l.replace("gcode_macro ","");if(c.startsWith("_"))return;const u=l.toLowerCase(),d=r[u];if("rename_existing"in d)return;const h=(p=e[l])!=null?p:{};s.push({name:c,description:(m=r[u].description)!=null?m:null,prop:d,params:i5(d),variables:h})}),$t(s,"name")},getMacro:(e,s)=>t=>{const r=t.toLowerCase();return s.getMacros.find(i=>i.name.toLowerCase()===r)},getPartFanSpeed:e=>"fan"in e?e.fan.speed:0,getFans:(e,s)=>{const t=[],r=["temperature_fan","controller_fan","heater_fan","fan_generic","fan"],i=s.getPrinterObjects(r),n=["fan_generic","fan"];return i.foreach(a=>{var o;t.push({name:a.name,type:a.type,speed:(o=a.state.speed)!=null?o:0,controllable:n.includes(a.type)})}),t.sort((a,o)=>{if(a.controllableo.controllable)return-1;const l=a.name.toUpperCase(),c=o.name.toUpperCase();return lc?1:0})},getLights:(e,s)=>{const t=[],r=["dotstar","led","neopixel","pca9533","pca9632"];return s.getPrinterObjects(r).filter(n=>!n.name.startsWith("_")).forEach(n=>{var p,m,f,b,C,w,M,H,A,$,T,I;let a="RGB",o=null;const l=(p=n.state.color_data)!=null?p:[];"color_order"in n.settings&&(a=(m=n.settings.color_order[0])!=null?m:""),n.type==="led"&&(a="","red_pin"in n.config&&(a+="R"),"green_pin"in n.config&&(a+="G"),"blue_pin"in n.config&&(a+="B"),"white_pin"in n.config&&(a+="W"));let c=(f=n.settings.initial_red)!=null?f:null;"initial_red"in n.config||(c=null);let u=(b=n.settings.initial_green)!=null?b:null;"initial_green"in n.config||(u=null);let d=(C=n.settings.initial_blue)!=null?C:null;"initial_blue"in n.config||(d=null);let h=(w=n.settings.initial_white)!=null?w:null;if("initial_white"in n.config||(h=null),n.type==="led"&&a.length===1){const R=(M=l[0])!=null?M:[];switch(a){case"R":o=(H=R[0])!=null?H:0;break;case"G":o=(A=R[1])!=null?A:0;break;case"B":o=($=R[2])!=null?$:0;break;case"W":o=(T=R[3])!=null?T:0;break}}t.push({name:n.name,type:n.type,chainCount:(I=n.settings.chain_count)!=null?I:1,colorOrder:a,initialRed:c,initialGreen:u,initialBlue:d,initialWhite:h,colorData:l,singleChannelTarget:o})}),t.sort((n,a)=>{const o=n.name.toUpperCase(),l=a.name.toUpperCase();return ol?1:0})},getMiscellaneous:e=>{var i,n,a,o,l,c;const s=[],t=["controller_fan","heater_fan","fan_generic","fan","output_pin"],r=["fan_generic","fan"];for(const[u,d]of Object.entries(e)){const h=u.split(" ");if(t.includes(h[0])){const p=h.length>1?h[1]:h[0];if(!p.startsWith("_")){let m=r.includes(h[0].toLowerCase());const f=(n=(i=e.configfile)==null?void 0:i.settings[u.toLowerCase()])!=null?n:{},b="speed"in d?d.speed:"value"in d?d.value:0,C="rpm"in d?d.rpm:null;let w=m,M=1;h[0].toLowerCase()==="fan"&&(M=255),h[0].toLowerCase()==="output_pin"&&(m=!0,w=!1,"pwm"in f&&(w=(a=f==null?void 0:f.pwm)!=null?a:!1),"scale"in f&&(M=(o=f==null?void 0:f.scale)!=null?o:1));const H={name:p,type:h[0],power:b,controllable:m,pwm:w,rpm:C,scale:M,object:d,config:f,off_below:void 0,max_power:void 0};"configfile"in e&&"settings"in e.configfile&&u.toLowerCase()in e.configfile.settings&&("off_below"in f&&(H.off_below=(l=f==null?void 0:f.off_below)!=null?l:0),"max_power"in f&&(H.max_power=(c=f==null?void 0:f.max_power)!=null?c:1)),s.push(H)}}}return s.sort((u,d)=>{if(u.type==="fan")return-1;if(d.type==="fan"||u.pwmd.pwm)return-1;if(u.controllabled.controllable)return-1;const h=u.name.toUpperCase(),p=d.name.toUpperCase();return hp?1:0})},getAvailableHeaters:e=>{var s,t;return(t=(s=e.heaters)==null?void 0:s.available_heaters)!=null?t:[]},getAvailableSensors:e=>{var s,t;return(t=(s=e.heaters)==null?void 0:s.available_sensors)!=null?t:[]},getAvailableMonitors:e=>{var s,t;return(t=(s=e.heaters)==null?void 0:s.available_monitors)!=null?t:[]},getFilamentSensors:e=>{const s=["filament_switch_sensor","filament_motion_sensor"],t=[];for(const[r,i]of Object.entries(e)){const n=r.split(" ");s.includes(n[0])&&t.push({name:n[1],enabled:i.enabled,filament_detected:i.filament_detected})}return $t(t,"name")},getMcus:(e,s)=>{const t=[];return Object.keys(e).forEach(r=>{var i,n,a,o,l,c,u,d,h,p,m,f;if(r==="mcu"||r.startsWith("mcu ")){const b=e[r],C=((i=b.mcu_version)!=null?i:"unknown").split("-").slice(0,4).join("-");let w=0;(n=b.last_stats)!=null&&n.mcu_task_avg&&((a=b.last_stats)!=null&&a.mcu_task_stddev)&&(w=b.last_stats.mcu_task_avg+3*((o=b.last_stats)==null?void 0:o.mcu_task_stddev)/.0025);let M="primary";w>.95?M="error":w>.8&&(M="warning"),t.push({name:r,mcu_constants:b.mcu_constants,last_stats:b.last_stats,version:C,chip:(c=(l=b.mcu_constants)==null?void 0:l.MCU)!=null?c:null,freq:(d=(u=b.last_stats)==null?void 0:u.freq)!=null?d:null,freqFormat:s5((p=(h=b.last_stats)==null?void 0:h.freq)!=null?p:0),awake:(((f=(m=b.last_stats)==null?void 0:m.mcu_awake)!=null?f:0)/5).toFixed(2),load:w.toFixed(2),loadPercent:w<1?Math.round(w*100):100,loadProgressColor:M,tempSensor:s.getMcuTempSensor(r)})}}),t},getPrinterObject:e=>s=>s in e?e[s]:null,getPrinterConfigObjects:e=>s=>{var r;const t={};return(r=e.configfile)!=null&&r.settings&&Object.keys(e.configfile.settings).forEach(i=>{const n=i.split(" ");s.includes(n[0])&&(t[i]=e.configfile.settings[i])}),t},getHostTempSensor:(e,s)=>{const t=["rpi_temperature","temperature_host"],r=["temperature_sensor","temperature_fan"];let i=null;const n=s.getPrinterConfigObjects(r);return Object.keys(n).forEach(a=>{var c,u,d;const o=n[a],l=Object.keys(e).find(h=>h.toLowerCase()===a.toLowerCase())||"";if("sensor_type"in o&&t.includes(o.sensor_type)&&l in e){const h=e[l];i={temperature:(c=h.temperature)==null?void 0:c.toFixed(0),measured_min_temp:(u=h.measured_min_temp)==null?void 0:u.toFixed(1),measured_max_temp:(d=h.measured_max_temp)==null?void 0:d.toFixed(1)}}}),i},getMcuTempSensors:(e,s)=>{const t=["temperature_sensor","temperature_fan"],r=[],i=s.getPrinterConfigObjects(t);return Object.keys(i).forEach(n=>{const a=i[n],o=Object.keys(e).find(l=>l.toLowerCase()===n.toLowerCase())||"";"sensor_type"in a&&a.sensor_type==="temperature_mcu"&&"sensor_mcu"in a&&r.push({key:o,settings:a,object:o in e?e[o]:{}})}),r},getMcuTempSensor:(e,s)=>t=>{let r=null;return s.getMcuTempSensors.forEach(n=>{var a,o,l,c,u,d;t.endsWith((a=n.settings)==null?void 0:a.sensor_mcu)&&((o=n.object)!=null&&o.temperature)&&(r={temperature:n.object.temperature.toFixed(0),measured_min_temp:(c=(l=n.object.measured_min_temp)==null?void 0:l.toFixed(1))!=null?c:null,measured_max_temp:(d=(u=n.object.measured_max_temp)==null?void 0:u.toFixed(1))!=null?d:null})}),r},getBedMeshProfiles:e=>{var r;const s=[];let t="";return e.bed_mesh&&(t=e.bed_mesh.profile_name),e.bed_mesh&&"profiles"in e.bed_mesh&&Object.keys((r=e.bed_mesh)==null?void 0:r.profiles).forEach(i=>{const n=e.bed_mesh.profiles[i];let a=[];n.points.forEach(c=>{a=a.concat(c)});const o=Math.min(...a),l=Math.max(...a);s.push({name:i,data:{...n.mesh_params,points:n.points},points:a,min:o,max:l,variance:Math.abs(o-l),is_active:t===i})}),$t(s,"name")},getExtruders:e=>{var t,r;const s=[];return(t=e.configfile)!=null&&t.settings&&Object.keys((r=e.configfile)==null?void 0:r.settings).filter(i=>i.match(/^(extruder)\d?$/g)).sort().forEach(i=>{var a;const n=(a=e.configfile)==null?void 0:a.settings[i];s.push({key:i,name:"Extruder ".concat(i=="extruder"?"0":i.replace("extruder","")),filamentDiameter:n.filament_diameter,nozzleDiameter:n.nozzle_diameter,minExtrudeTemp:n.min_extrude_temp,maxExtrudeOnlyDistance:n.max_extrude_only_distance})}),s},getExtruderSteppers:e=>{var t,r;const s=[];return(t=e.configfile)!=null&&t.settings&&Object.keys((r=e.configfile)==null?void 0:r.settings).filter(i=>i.match(/^extruder_stepper/g)).sort().forEach(i=>{var a;const n=(a=e.configfile)==null?void 0:a.settings[i];s.push({key:i,name:i.replace("extruder_stepper ",""),extruder:n.extruder})}),s},getExtrudePossible:e=>{var t,r,i,n;const s=(r=(t=e.toolhead)==null?void 0:t.extruder)!=null?r:"extruder";return(n=(i=e[s])==null?void 0:i.can_extrude)!=null?n:!1},getBedMeshProfileName:e=>"bed_mesh"in e&&"profile_name"in e.bed_mesh?e.bed_mesh.profile_name:"",getMaxTemp:e=>{var t,r;let s=0;return(r=(t=e.heaters)==null?void 0:t.available_sensors)==null||r.forEach(i=>{var a;const n=(a=e.configfile)==null?void 0:a.settings[i];n&&"max_temp"in n&&Math.round(n.max_temp)>s&&Math.round(n.max_temp)<1e4&&(s=Math.round(n.max_temp))}),s>0?s+10:300},existPrinterConfig:e=>{var s;return(s=e.configfile)!=null&&s.config?Object.keys(e.configfile.config).length>0:!1},checkConfig:e=>s=>e.configfile.config?Object.keys(e.configfile.config).findIndex(r=>r.toLowerCase()===s.toLowerCase())!==-1:!1,checkNecessaryConfig:(e,s)=>{const t=[];return fS.forEach(r=>{s.checkConfig(r)||t.push(r)}),!s.checkConfig("display")&&!s.checkConfig("display_status")&&t.push("display_status"),t},getEstimatedTimeFile:(e,s)=>"print_stats"in e&&"print_duration"in e.print_stats&&e.print_stats.print_duration>0&&s.getPrintPercent>0?(e.print_stats.print_duration/s.getPrintPercent-e.print_stats.print_duration).toFixed(0):0,getEstimatedTimeFilament:e=>"print_stats"in e&&"print_duration"in e.print_stats&&"filament_used"in e.print_stats&&"current_file"in e&&"filament_total"in e.current_file&&e.print_stats.print_duration>0&&e.current_file.filament_total>0&&e.current_file.filament_total>e.print_stats.filament_used?(e.print_stats.print_duration/(e.print_stats.filament_used/e.current_file.filament_total)-e.print_stats.print_duration).toFixed(0):0,getEstimatedTimeSlicer:e=>"print_stats"in e&&"print_duration"in e.print_stats&&"current_file"in e&&"estimated_time"in e.current_file&&e.print_stats.print_duration>0&&e.current_file.estimated_time>0?(e.current_file.estimated_time-e.print_stats.print_duration).toFixed(0):0,getEstimatedTimeAvg:(e,s,t)=>{var o,l,c,u,d,h,p,m;let r=0,i=0;const n=(u=(c=(l=(o=t.gui)==null?void 0:o.general)==null?void 0:l.calcEstimateTime)==null?void 0:c.includes("file"))!=null?u:!1,a=(m=(p=(h=(d=t.gui)==null?void 0:d.general)==null?void 0:h.calcEstimateTime)==null?void 0:p.includes("filament"))!=null?m:!1;return n&&s.getEstimatedTimeFile>0&&(r+=parseInt(s.getEstimatedTimeFile),i++),a&&s.getEstimatedTimeFilament>0&&(r+=parseInt(s.getEstimatedTimeFilament),i++),r&&i?r/i:0},getEstimatedTimeETA:(e,s,t)=>{var l,c,u,d,h,p,m,f,b,C,w,M;let r=0,i=0;const n=(d=(u=(c=(l=t.gui)==null?void 0:l.general)==null?void 0:c.calcEtaTime)==null?void 0:u.includes("file"))!=null?d:!1,a=(f=(m=(p=(h=t.gui)==null?void 0:h.general)==null?void 0:p.calcEtaTime)==null?void 0:m.includes("filament"))!=null?f:!1,o=(M=(w=(C=(b=t.gui)==null?void 0:b.general)==null?void 0:C.calcEtaTime)==null?void 0:w.includes("slicer"))!=null?M:!1;return n&&s.getEstimatedTimeFile>0&&(r+=parseInt(s.getEstimatedTimeFile),i++),a&&s.getEstimatedTimeFilament>0&&(r+=parseInt(s.getEstimatedTimeFilament),i++),o&&s.getEstimatedTimeSlicer>0&&(r+=parseInt(s.getEstimatedTimeSlicer),i++),r&&i?Math.round(Date.now()+r/i*1e3):0},getEstimatedTimeETAFormat:(e,s,t,r)=>{var h;const i=(h=r["gui/getHours12Format"])!=null?h:!1,n=s.getEstimatedTimeETA;if(n===0)return"--";const a=new Date(n);let o=!0,l=a.getHours();i&&l>11&&(o=!1),i&&l>12&&(l-=12),i&&l==0&&(l+=12),l<10&&(l="0"+l);const c=a.getMinutes()>=10?a.getMinutes():"0"+a.getMinutes(),u=n-new Date().getTime();let d=l+":"+c;return i&&(d+=" ".concat(o?"AM":"PM")),u>60*60*24*1e3&&(d+="+".concat(Math.trunc(u/(60*60*24*1e3)))),d},getKinematics:e=>{var s,t,r,i,n;return(t=(s=e.configfile)==null?void 0:s.settings)!=null&&t.printer?(n=(i=(r=e.configfile)==null?void 0:r.settings)==null?void 0:i.printer.kinematics)!=null?n:"none":!1},existsQGL:e=>{var s;return(s=e.configfile)!=null&&s.settings?"quad_gantry_level"in e.configfile.settings:!1},existsZtilt:e=>{var s;return(s=e.configfile)!=null&&s.settings?"z_tilt"in e.configfile.settings:!1},existsBedTilt:e=>{var s;return(s=e.configfile)!=null&&s.settings?"bed_tilt"in e.configfile.settings:!1},existsBedScrews:e=>{var s;return(s=e.configfile)!=null&&s.settings?"bed_screws"in e.configfile.settings:!1},existsDeltaCalibrate:e=>{var s;return(s=e.configfile)!=null&&s.settings?"delta_calibrate"in e.configfile.settings:!1},existsScrewsTilt:e=>{var s;return(s=e.configfile)!=null&&s.settings?"screws_tilt_adjust"in e.configfile.settings:!1},existsFirmwareRetraction:e=>{var s;return(s=e.configfile)!=null&&s.settings?"firmware_retraction"in e.configfile.settings:!1}},jK={reset({commit:e,state:s}){s.updateSourceInterval!==null&&clearInterval(s.updateSourceInterval),e("reset")},init({commit:e,rootGetters:s,dispatch:t},r){var c,u,d;window.console.debug("init printer/tempHistory"),t("reset");const i=new Date,n=(c=s["printer/getAvailableHeaters"])!=null?c:[],a=(u=s["printer/getAvailableSensors"])!=null?u:[],o=(d=s["printer/getAvailableMonitors"])!=null?d:[],l=s["printer/tempHistory/getTemperatureStoreSize"];if(r!==void 0){"requestParams"in r&&delete r.requestParams;const h=Object.keys(r),p={};h.forEach(A=>{let $=A;if($.indexOf(" ")!==-1&&($=$.substring($.indexOf(" ")+1)),!(a.includes(A)||o.includes(A))||$.startsWith("_")){delete r[A];return}const T=r[A];on.forEach(I=>{if(I+"s"in T){const R=l-T[I+"s"].length;T[I+"s"]=[...Array.from({length:R},()=>null),...T[I+"s"]]}}),p[A]={...T}}),a.concat(o).forEach(A=>{if(A in r)return;let $=A,T=A;const I=A.indexOf(" ");if(I!==-1&&($=A.substring(I+1),T=A.substring(0,I)),$.startsWith("_"))return;const R={temperatures:Array(l).fill(null)};n.includes(A)?(R.targets=Array(l).fill(null),R.powers=Array(l).fill(null)):["temperature_fan"].includes(T)&&(R.targets=Array(l).fill(null),R.speeds=Array(l).fill(null)),p[A]={...R}});const f=[];for(let A=0;A{on.forEach(I=>{const R="".concat(I,"s");R in p[T]&&($["".concat(T,"-").concat(I)]=p[T][R][A])})}),f.push($)}e("setInitSource",f);const b=Object.keys(f[0]).filter(A=>A!=="date"),C=b.filter(A=>A.endsWith("-temperature")).map(A=>A.slice(0,A.length-12)).sort(),w=[];let M=0;C.forEach(A=>{let $=s["gui/getDatasetValue"]({name:A,type:"color"});$||(A==="heater_bed"&&($=dS),A.endsWith(" chamber")&&($=hS),$||($=uS[M],M++,$===void 0&&($="#"+Math.floor(16777215*Math.random()).toString(16))));const T={id:w.length+1,color:$,type:"line",name:"".concat(A,"-temperature"),encode:{x:"date",y:"".concat(A,"-temperature")},animation:!1,yAxisIndex:0,lineStyle:{color:$,width:2,opacity:.9},showSymbol:!1,emphasis:{lineStyle:{color:$,width:2,opacity:.9}}};w.push(T),on.forEach(I=>{if(I==="temperature")return;const R=A+"-"+I;if(!b.includes(R))return;const W=JSON.parse(JSON.stringify(T));W.id=w.length+1,W.name=R,W.encode.y=R,I==="target"&&(W.lineStyle.width=0,W.emphasis.lineStyle.width=0,W.areaStyle={color:$,opacity:.1},W.emphasis.areaStyle={color:$,opacity:.1}),wn.includes(I)&&(W.yAxisIndex=1,W.lineStyle.width=1.5,W.lineStyle.opacity=.75,W.lineStyle.type="dotted",W.emphasis.lineStyle.width=1.5,W.emphasis.lineStyle.opacity=.75,W.emphasis.lineStyle.type="dotted"),w.push(W)})}),e("setInitSeries",w);const H=setInterval(()=>{t("updateSource")},pS);e("setUpdateSourceInterval",H)}t("socket/removeInitModule","printer/initTempHistory",{root:!0})},async updateSource({commit:e,rootState:s,rootGetters:t,state:r}){var o,l;const i=(o=t["printer/getAvailableSensors"])!=null?o:[],n=(l=t["printer/getAvailableMonitors"])!=null?l:[],a=i.concat(n);if(a.length){const c=new Date;if(r.source.length){const d=r.source[r.source.length-1],h=d.date.getSeconds(),p=c.getSeconds(),m=c.getTime()-d.date.getTime();if(h===p&&m<1e3)return}const u={date:c};a.forEach(d=>{if(!(s.printer&&d in s.printer))return;const h={...s.printer[d]};on.forEach(p=>{if(!(p in h))return;let m=h[p];m!==null&&(m=Math.round(h[p]*10)/10),wn.includes(p)&&(m=Math.round(h[p]*1e3)/1e3),u["".concat(d,"-").concat(p)]=m})}),e("addToSource",{data:u,maxHistory:t["printer/tempHistory/getTemperatureStoreSize"]})}},setColor({commit:e},s){e("setColor",s)}},NK={reset(e){Object.assign(e,rx())},setInitSource(e,s){y.set(e,"source",s)},setInitSeries(e,s){y.set(e,"series",s)},addToSource(e,s){const t=[...e.source];for(t.push(s.data);t.length>s.maxHistory;)t.splice(0,1);y.set(e,"source",t)},saveLastDate(e,s){y.set(e,"timeLastUpdate",s)},setUpdateSourceInterval(e,s){y.set(e,"updateSourceInterval",s)},setColor(e,s){e.series.filter(t=>s.name===t.name||t.name.startsWith(s.name+"-")).forEach(t=>{var r;if(t.color=s.value,t.lineStyle.color=s.value,t.emphasis.lineStyle.color=s.value,t.name.endsWith("-target")){const i=t.areaStyle;i&&(i.color=s.value);const n=(r=t.emphasis)==null?void 0:r.areaStyle;n&&(n.color=s.value)}})}},VK={getDatasetColor:(e,s)=>t=>{var i,n;const r=s.getSeries("".concat(t,"-temperature"));return(n=(i=r==null?void 0:r.lineStyle)==null?void 0:i.color)!=null?n:null},getSeries:e=>s=>e.series.find(t=>t.name===s),getSerieNames:e=>s=>{const t=[];return e.series.map(i=>i.name).filter(i=>i.startsWith("".concat(s,"-"))).forEach(i=>{t.push(i.slice(s.length+1))}),t},getBoolDisplayPwmAxis:(e,s)=>{const t=s.getSelectedLegends;return Object.keys(t).find(r=>t[r]===!0&&(r.endsWith("-power")||r.endsWith("-speed")))!==void 0},getAvg:e=>(s,t)=>{const r=t&&t!=="temperature"?s+"-"+t:s,i=new Date().getTime()-1e3*60;let n=0,a=0;return e.source.filter(o=>o.date>i).forEach(o=>{r in o&&(n+=o[r],a++)}),a&&wn.includes(t)?n/a*100:a?n/a:0},getAvgPower:(e,s)=>t=>s.getAvg(t,"power"),getAvgSpeed:(e,s)=>t=>s.getAvg(t,"speed"),getHostMcuSensors:(e,s,t)=>{var a,o,l,c,u,d,h,p,m;const r=(l=(o=(a=t.printer)==null?void 0:a.configfile)==null?void 0:o.settings)!=null?l:{},i=(d=(u=(c=t.printer)==null?void 0:c.heaters)==null?void 0:u.available_heaters)!=null?d:[];return((m=(p=(h=t.printer)==null?void 0:h.heaters)==null?void 0:p.available_sensors)!=null?m:[]).filter(f=>{var w;if(i.includes(f)||f.startsWith("temperature_fan"))return!1;const b=r[f.toLowerCase()];if(!b)return!1;const C=(w=b.sensor_type)!=null?w:"";return["temperature_mcu","temperature_host"].includes(C)})},getSelectedLegends:(e,s,t)=>{var l,c,u,d,h,p,m,f,b,C,w,M,H,A,$,T,I,R,W;const r={},i=(u=(c=(l=t.printer)==null?void 0:l.heaters)==null?void 0:c.available_sensors)!=null?u:[],n=(m=(p=(h=(d=t.gui)==null?void 0:d.view)==null?void 0:h.tempchart)==null?void 0:p.datasetSettings)!=null?m:{};if(Object.keys(n).forEach(B=>{i.includes(B)&&Object.keys(n[B]).forEach(ee=>{if(!on.includes(ee))return;const D="".concat(B,"-").concat(ee);e.series.findIndex(z=>z.name===D)!==-1&&(r[D]=n[B][ee])})}),e.series.forEach(B=>{if(Object.keys(r).includes(B.name))return;const ee=B.name.slice(B.name.lastIndexOf("-")+1);r[B.name]=!wn.includes(ee)}),(w=(C=(b=(f=t.gui)==null?void 0:f.view)==null?void 0:b.tempchart)==null?void 0:C.hideMcuHostSensors)!=null?w:!1){const B=(M=s.getHostMcuSensors)!=null?M:[];Object.keys(r).filter(ee=>{const D=ee.slice(0,ee.lastIndexOf("-"));return B.includes(D)}).forEach(ee=>{r[ee]=!1})}if((T=($=(A=(H=t.gui)==null?void 0:H.view)==null?void 0:A.tempchart)==null?void 0:$.hideMonitors)!=null?T:!1){const B=(W=(R=(I=t.printer)==null?void 0:I.heaters)==null?void 0:R.available_monitors)!=null?W:[];Object.keys(r).filter(ee=>{const D=ee.slice(0,ee.lastIndexOf("-"));return B.includes(D)}).forEach(ee=>{r[ee]=!1})}return r},getTemperatureStoreSize:(e,s,t,r)=>{const i=r["server/getConfig"]("data_store","temperature_store_size");return i!=null?i:1200}},rx=()=>({source:[],series:[],timeLastUpdate:null,updateSourceInterval:null}),UK=rx(),BK={namespaced:!0,state:UK,getters:VK,actions:jK,mutations:NK},ix=()=>({}),WK=ix(),GK={namespaced:!0,state:WK,getters:HK,actions:RK,mutations:IK,modules:{tempHistory:BK}},zK={reset({commit:e}){e("reset")},initRootDirs({state:e,commit:s},t){t.forEach(r=>{e.filetree.findIndex(i=>i.filename===r)===-1&&(s("createRootDir",{name:r,permissions:"r"}),y.$socket.emit("server.files.get_directory",{path:r},{action:"files/getDirectory"}))})},getDirectory({state:e,commit:s,getters:t},r){var c,u,d,h,p,m;const i=r.requestParams.path.split("/"),n=i.length?i[0]:r.requestParams.path,a=r.requestParams.path.indexOf("/"),o=a>1?r.requestParams.path.slice(a+1):"",l=t.getDirectory(n+"/"+o);if((c=l==null?void 0:l.childrens)!=null&&c.length&&(l==null||l.childrens.forEach(f=>{var b,C;f!=null&&f.isDirectory&&((b=r.dirs)==null?void 0:b.findIndex(w=>w.dirname===f.filename))<0?s("setDeleteDir",{item:{path:o.length?o+"/"+f.filename:f.filename,root:n}}):!(f!=null&&f.isDirectory)&&((C=r.files)==null?void 0:C.findIndex(w=>w.filename===f.filename))<0&&s("setDeleteFile",{item:{path:o.length?o+"/"+f.filename:f.filename,root:n}})})),(u=r.dirs)!=null&&u.length&&r.dirs.filter(f=>!xS.includes(f.dirname)).forEach(f=>{var b;((b=l==null?void 0:l.childrens)==null?void 0:b.findIndex(C=>C.isDirectory&&C.filename===f.dirname))===-1&&(s("setCreateDir",{item:{path:o.length?o+"/"+f.dirname:f.dirname,root:n,permissions:f.permissions,modified:f.modified*1e3}}),y.$socket.emit("server.files.get_directory",{path:r.requestParams.path+"/"+f.dirname},{action:"files/getDirectory"}))}),(d=r.files)!=null&&d.length&&r.files.forEach(f=>{var C;const b=(C=l==null?void 0:l.childrens)==null?void 0:C.find(w=>!w.isDirectory&&w.filename===f.filename);b&&(b.size!==f.size||b.modified.getTime()!==new Date(f.modified*1e3).getTime())?s("setModifyFile",{item:{path:o.length?o+"/"+f.filename:f.filename,root:n,modified:f.modified,size:f.size}}):b||s("setCreateFile",{item:{path:o.length?o+"/"+f.filename:f.filename,root:n,permissions:f.permissions,modified:f.modified,size:f.size}})}),(h=r==null?void 0:r.root_info)!=null&&h.name){const f=e.filetree.find(b=>{var C;return b.filename===((C=r==null?void 0:r.root_info)==null?void 0:C.name)});f&&f.permissions!==((p=r.root_info)==null?void 0:p.permissions)&&s("setRootPermissions",r.root_info)}(m=r.requestParams)!=null&&m.path&&r.disk_usage&&s("setDiskUsage",{disk_usage:r.disk_usage,path:r.requestParams.path})},scanMetadata({commit:e},s){if(s.filename.slice(0,s.filename.indexOf("/"))==="gcodes"){const r=s.filename.slice(7);e("setMetadataRequested",{filename:r}),y.$socket.emit("server.files.metascan",{filename:r},{action:"files/getScanMetadata"})}},getScanMetadata({dispatch:e},s){if(s!==void 0&&s.filename!==""){e("getMetadata",s);const t=s.filename;y.$toast.success(be.t("Files.ScanMetaSuccess",{filename:t}).toString())}},requestMetadata({commit:e},s){if(s.filename.slice(0,s.filename.indexOf("/"))==="gcodes"){const r=s.filename.slice(7);e("setMetadataRequested",{filename:r}),y.$socket.emit("server.files.metadata",{filename:r},{action:"files/getMetadata"})}},getMetadata({commit:e,rootState:s},t){var r,i;t!==void 0&&t.filename!==""&&(t.filename===((i=(r=s==null?void 0:s.printer)==null?void 0:r.print_stats)==null?void 0:i.filename)&&(e("printer/clearCurrentFile",null,{root:!0}),e("printer/setData",{current_file:t},{root:!0})),e("setMetadata",t))},getMetadataCurrentFile({commit:e},s){e("printer/clearCurrentFile",null,{root:!0}),e("printer/setData",{current_file:s},{root:!0})},async filelist_changed({commit:e,dispatch:s},t){var r,i;switch(t.action){case"create_file":e("setCreateFile",t);break;case"move_file":if(((r=t.source_item)==null?void 0:r.path)==="printer_autosave.cfg"&&((i=t.source_item)==null?void 0:i.root)==="config"){e("setCreateFile",t);return}await e("setMoveFile",t),t.item.root==="gcodes"&&ci.includes(t.item.path.slice(t.item.path.lastIndexOf(".")))&&await s("requestMetadata",{filename:"gcodes/"+t.item.path});break;case"delete_file":e("setDeleteFile",t);break;case"modify_file":e("setModifyFile",t);break;case"create_dir":e("setCreateDir",t);break;case"move_dir":e("setMoveDir",t);break;case"delete_dir":e("setDeleteDir",t);break;case"root_update":s("server/addRootDirectory",t,{root:!0}),e("setRootUpdate",t);break;default:window.console.error("Unknown filelist_changed action: "+t.action);break}},getMove(e,s){if(s.error)y.$toast.error(s.error.message);else{const t=s.requestParams.dest.substr(s.requestParams.dest.lastIndexOf("/")).replace("/",""),r=s.requestParams.source.substr(0,s.requestParams.source.lastIndexOf("/")),i=s.requestParams.dest.substr(0,s.requestParams.dest.lastIndexOf("/"));r===i?y.$toast.success(be.t("Files.SuccessfullyRenamed",{filename:t})):y.$toast.success(be.t("Files.SuccessfullyMoved",{filename:t}))}},getCreateDir(e,s){if(s.error)y.$toast.error(s.error.message);else{const t=s.requestParams.path.substr(s.requestParams.path.lastIndexOf("/")+1);y.$toast.success(be.t("Files.SuccessfullyCreated",{filename:t}))}},getDeleteDir(e,s){if(s.error)y.$toast.error(s.error.message);else{const t=s.requestParams.path.substr(s.requestParams.path.lastIndexOf("/")+1);y.$toast.success(be.t("Files.SuccessfullyDeleted",{filename:t}))}},getDeleteFile(e,s){if(s.error)y.$toast.error(s.error.message);else{const t=s.item.path.substr(s.item.path.lastIndexOf("/")+1),r=s.item.path.substr(s.item.path.lastIndexOf(".")+1);s.item.root==="timelapse"&&r==="jpg"||y.$toast.success(be.t("Files.SuccessfullyDeleted",{filename:t}))}},async uploadFile({commit:e,rootGetters:s},t){const r=s["socket/getUrl"],i=new FormData;i.append("file",t.file,t.file.name),i.append("root",t.root),i.append("path",t.path);const n=Es.CancelToken.source();await e("uploadClearState"),await e("uploadSetCancelTokenSource",n),await e("uploadSetFilename",t.file.name),await e("uploadSetShow",!0);let a=0,o=0;return new Promise(l=>{Es.post(r+"/server/files/upload",i,{cancelToken:n.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:c=>{const u=c.loaded*100/c.total;if(e("uploadSetPercent",u),a===0){a=c.timeStamp,o=c.loaded;return}const d=c.timeStamp-a;if(d<1e3)return;const p=(c.loaded-o)/(d/1e3);e("uploadSetSpeed",p),a=c.timeStamp,o=c.loaded}}).then(c=>{e("uploadSetShow",!1);const u=c.data.item.path.lastIndexOf("/"),d=c.data.item.path.slice(u+1);l(d)}).catch(()=>{e("uploadSetShow",!1),y.$toast.error(be.t("FullscreenUpload.CannotUploadFile").toString()),l(!1)})})},uploadSetShow({commit:e},s){e("uploadSetShow",s)},uploadSetCurrentNumber({commit:e},s){e("uploadSetCurrentNumber",s)},uploadIncrementCurrentNumber({state:e,commit:s}){s("uploadSetCurrentNumber",e.upload.currentNumber+1)},uploadSetMaxNumber({commit:e},s){e("uploadSetMaxNumber",s)},downloadZip({rootGetters:e},s){const t=e["socket/getUrl"],r="".concat(t,"/server/files/").concat(s.destination.root,"/").concat(encodeURI(s.destination.path));window.open(r)},rolloverLog(e,s){s.rolled_over.forEach(t=>{y.$toast.success(be.t("Machine.LogfilesPanel.RolloverToastSuccessful",{name:t}))}),Object.keys(s.failed).forEach(t=>{const r=s.failed[t];y.$toast.error(be.t("Machine.LogfilesPanel.RolloverToastFailed",{name:t,message:r}))}),setTimeout(()=>{y.$socket.emit("server.files.get_directory",{path:"logs"},{action:"files/getDirectory"})},500)}},ZK={reset(e){Object.assign(e,nx())},createRootDir(e,s){e.filetree.push({isDirectory:!0,filename:s.name,modified:new Date,permissions:s.permissions,childrens:[],disk_usage:{free:0,total:0,used:0}})},setMetadataRequested(e,s){let t="gcodes/"+s.filename;const r=t.split("/");t=r[r.length-1];const i=Rt(e.filetree,r),n=i==null?void 0:i.findIndex(a=>a.filename===t);if(i&&n!==void 0&&n!==-1){const a={...i[n]};a.metadataRequested=!0,y.set(i,n,a)}else window.console.error("file not found in filetree: "+s.filename)},setMetadata(e,s){let t="gcodes/"+s.filename;const r=t.split("/");t=r[r.length-1];const i=Rt(e.filetree,r),n=i==null?void 0:i.findIndex(a=>a.filename===t);if(i&&n!==void 0&&n!==-1){const a={...i[n]};gS.forEach(o=>{o in s&&(a[o]=s[o])}),a.metadataRequested=!0,a.metadataPulled=!0,y.set(i,n,a)}else window.console.error("file not found in filetree: "+s.filename)},setCreateFile(e,s){let t=s.item.path;s.item.path.lastIndexOf("/")>=0&&(t=s.item.path.substr(s.item.path.lastIndexOf("/")).replace("/",""));const r=s.item.path.substr(0,s.item.path.lastIndexOf("/")),i=Rt(e.filetree,(s.item.root+"/"+r).split("/"));if(i){const n=i.findIndex(a=>!a.isDirectory&&a.filename===t);if(n===-1){const a=new Date(s.item.modified*1e3);i.push({isDirectory:!1,filename:t,modified:a,permissions:s.item.permissions,size:s.item.size,metadataRequested:!1,metadataPulled:!1})}else{i[n].modified=new Date(s.item.modified*1e3),i[n].size=s.item.size,i[n].metadataRequested=!1,i[n].metadataPulled=!1;const a=t.substring(t.lastIndexOf(".")+1);s.item.root==="gcodes"&&a==="gcode"&&y.$socket.emit("server.files.metadata",{filename:s.item.path},{action:"files/getMetadata"})}}},setMoveFile(e,s){let t=s.source_item.path,r=s.source_item.root;const i=s.source_item.path.lastIndexOf("/");i!==-1&&(t=s.source_item.path.substring(i+1),r=s.source_item.root+"/"+s.source_item.path.substring(0,i));let n=s.item.path,a=s.item.root;const o=s.item.path.lastIndexOf("/");o!==-1&&(n=s.item.path.substring(o+1),a=s.item.root+"/"+s.item.path.substring(0,o));const l=Rt(e.filetree,r.split("/")),c=l==null?void 0:l.findIndex(h=>h.filename===t);if(c===void 0||c===-1||l===null)return;const u=l.splice(c,1)[0];u.filename=n,r!==a&&"metadataPulled"in u&&u.metadataPulled&&"thumbnails"in u&&(u.metadataPulled=!1,delete u.thumbnails);const d=Rt(e.filetree,a.split("/"));d==null||d.push(u)},setModifyFile(e,s){let t=s.item.path,r=s.item.root;const i=s.item.path.lastIndexOf("/");i!==-1&&(t=s.item.path.substr(i+1),r=s.item.root+"/"+s.item.path.substr(0,i+1));const n=Rt(e.filetree,r.split("/")),a=n==null?void 0:n.findIndex(o=>o.filename===t);a!==void 0&&a>-1&&n&&n[a]&&("metadataPulled"in n[a]&&n[a].metadataPulled&&(n[a].metadataPulled=!1,"thumbnails"in n[a]&&delete n[a].thumbnails),n[a].modified=new Date(s.item.modified*1e3),n[a].size=s.item.size)},setMoveDir(e,s){let t=s.source_item.path,r=s.source_item.root;const i=s.source_item.path.lastIndexOf("/");i!==-1&&(t=s.source_item.path.substr(i+1),r=s.source_item.root+"/"+s.source_item.path.substr(0,i+1));let n=s.item.path,a=s.item.root;const o=s.item.path.lastIndexOf("/");o!==-1&&(n=s.item.path.substr(o+1),a=s.item.root+"/"+s.item.path.substr(0,o+1));const l=Rt(e.filetree,r.split("/")),c=l==null?void 0:l.findIndex(u=>u.filename===t);if(c!==void 0&&l&&l[c]){const u=l.splice(c,1)[0];u.filename=n;const d=Rt(e.filetree,a.split("/"));d==null||d.push(u)}},setDeleteFile(e,s){let t=s.item.path.substr(0,s.item.path.lastIndexOf("/"));const r=s.item.path.substr(s.item.path.lastIndexOf("/")+1);t=Rt(e.filetree,(s.item.root+"/"+t).split("/"));const i=t.findIndex(n=>n.filename===r);i>=0&&t[i]&&t.splice(i,1)},setCreateDir(e,s){var n;const t=s.item.path.substr(s.item.path.lastIndexOf("/")+1),r=s.item.path.substr(0,s.item.path.lastIndexOf("/")),i=Rt(e.filetree,(s.item.root+"/"+r).split("/"));i&&i.push({isDirectory:!0,filename:t,modified:(n=s.item.modified)!=null?n:new Date,permissions:s.item.permissions,childrens:[]})},setDeleteDir(e,s){let t=s.item.path.substr(0,s.item.path.lastIndexOf("/"));const r=s.item.path.substr(s.item.path.lastIndexOf("/")+1);t=Rt(e.filetree,(s.item.root+"/"+t).split("/"));const i=t.findIndex(n=>n.filename===r);i>=0&&t[i]&&t.splice(i,1)},setRootUpdate(e,s){var r,i,n;const t=e.filetree.findIndex(a=>a.filename===s.item.root);t!==-1&&((r=e.filetree[t].childrens)!=null&&r.length)&&((n=e.filetree[t].childrens)==null||n.splice(0,(i=e.filetree[t].childrens)==null?void 0:i.length))},setDiskUsage(e,s){const t=s.path.substr(0,s.path.lastIndexOf("/")),r=s.path.substr(s.path.lastIndexOf("/")+1),i=Rt(e.filetree,t.split("/")),n=i==null?void 0:i.find(a=>a.isDirectory&&a.filename===r);n&&y.set(n,"disk_usage",s.disk_usage)},setRootPermissions(e,s){const t=e.filetree.find(r=>r.filename===s.name);t&&y.set(t,"permissions",s.permissions)},uploadClearState(e){const s={...e.upload};s.show=!1,s.filename="",s.cancelTokenSource=null,s.speed=0,s.percent=0,y.set(e,"upload",s)},uploadSetShow(e,s){y.set(e.upload,"show",s)},uploadSetFilename(e,s){y.set(e.upload,"filename",s)},uploadSetCancelTokenSource(e,s){y.set(e.upload,"cancelTokenSource",s)},uploadSetCurrentNumber(e,s){y.set(e.upload,"currentNumber",s)},uploadSetMaxNumber(e,s){y.set(e.upload,"maxNumber",s)},uploadSetPercent(e,s){e.upload.percent!==s&&y.set(e.upload,"percent",s)},uploadSetSpeed(e,s){e.upload.speed!==s&&y.set(e.upload,"speed",s)}},qK={getDirectory:e=>s=>{s.startsWith("/")&&(s=s.substr(1)),s.endsWith("/")&&(s=s.substr(0,s.length-1));const t=function(r,i){var n;if(i.length){const a=(n=r==null?void 0:r.childrens)==null?void 0:n.find(o=>o.isDirectory&&o.filename===i[0]);return a?(i.shift(),t(a,i)):null}return r};return t({childrens:e.filetree},s.split("/"))},getFile:(e,s)=>t=>{var a;const r=t.slice(0,t.lastIndexOf("/")),i=t.slice(t.lastIndexOf("/")+1),n=s.getDirectory(r);return(a=n==null?void 0:n.childrens)==null?void 0:a.find(o=>o.filename===i&&!o.isDirectory)},getGcodeFiles:(e,s,t,r)=>(i,n,a)=>{var d;const o=s.getDirectory("gcodes");if(o===null)return[];let l="".concat(r["socket/getUrl"],"/server/files/gcodes"),c=[];if(i!==null){l+=encodeURI(i);const h=s.getDirectory("gcodes"+i);c=(d=h==null?void 0:h.childrens)!=null?d:[]}else{const h=(p,m)=>{var f,b;p.isDirectory&&((f=p.childrens)!=null&&f.length)&&((b=p.childrens)==null||b.forEach(C=>{if(C.isDirectory)h(C,m+C.filename+"/");else{const w={...C};w.filename=m+C.filename,c.push(w)}}))};h(o,"")}c=c.filter(h=>{if(!n&&(h.filename==="thumbs"||h.filename.startsWith(".")))return!1;if(h.isDirectory)return!0;const p=h.filename.lastIndexOf("."),m=h.filename.slice(p);return ci.includes(m)});const u=[];return c.forEach(h=>{var M,H;const p=typeof h.modified.getTime=="function"?h.modified.getTime():0,m={...h,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,count_printed:0,last_start_time:null,last_end_time:null,last_filament_used:null,last_status:null,last_print_duration:null,last_total_duration:null},f=[];if([{name:"first_layer_extr_temp",gcode:"M104"},{name:"first_layer_bed_temp",gcode:"M140"}].forEach(A=>{A.name in h&&h[A.name]>1&&f.push("".concat(A.gcode," S").concat(h[A.name]))}),f.length&&(m.preheat_gcode=f.join("\n")),(M=h.thumbnails)!=null&&M.length){let A="";if(i===null){const I=h.filename.lastIndexOf("/");I>0&&(A="/"+h.filename.slice(0,I))}const $=h.thumbnails.find(I=>I.width>=ms&&I.width<=fs&&I.height>=ms&&I.height<=fs);$&&"relative_path"in $&&(m.small_thumbnail="".concat(l+A,"/").concat(encodeURI($.relative_path),"?timestamp=").concat(p));const T=h.thumbnails.find(I=>I.width>=Os);T&&"relative_path"in T&&(m.big_thumbnail="".concat(l+A,"/").concat(encodeURI(T.relative_path),"?timestamp=").concat(p),m.big_thumbnail_width=T.width)}const C=i&&i.length?i+"/"+h.filename:h.filename;let w=r["server/history/getPrintJobsForGcodes"](C,p,h.size,(H=h.uuid)!=null?H:null,h.job_id);if(w&&w.length){w=w.sort((T,I)=>I.start_time-T.start_time);const A=w.filter(T=>T.status==="completed"),$=[...w].shift();if(m.last_status=$.status,m.count_printed=A.length,m.last_start_time=new Date($.start_time*1e3),m.count_printed>0){const T=A[0];m.last_start_time=new Date(T.start_time*1e3),m.last_end_time=new Date(T.end_time*1e3),m.last_filament_used=T.filament_used,m.last_print_duration=T.print_duration,m.last_total_duration=T.total_duration}}(a||m.count_printed===0)&&u.push(m)}),u},getAllGcodes:(e,s)=>s.getGcodeFiles(null,!1,!0),getThemeFileUrl:(e,s,t,r)=>(i,n)=>{var l;const a=s.getDirectory("config/"+xn),o=(l=a==null?void 0:a.childrens)==null?void 0:l.find(c=>{var u,d,h,p;return((d=c.filename)==null?void 0:d.slice(0,(u=c.filename)==null?void 0:u.lastIndexOf(".")))===i&&n.includes((p=c.filename)==null?void 0:p.slice(((h=c.filename)==null?void 0:h.lastIndexOf("."))+1))});return o?"".concat(r["socket/getUrl"],"/server/files/config/").concat(xn,"/").concat(o.filename,"?timestamp=").concat(o.modified.getTime()):null},getSidebarLogo:(e,s)=>{var i;const t="sidebar-logo",r=["svg","jpg","jpeg","png","gif"];return(i=s.getThemeFileUrl(t,r))!=null?i:""},getCustomSidebarBackground:(e,s)=>{var i;const t="sidebar-background",r=["jpg","jpeg","png","gif","svg"];return(i=s.getThemeFileUrl(t,r))!=null?i:null},getMainBackground:(e,s)=>{const t="main-background",r=["jpg","jpeg","png","gif","svg"];return s.getThemeFileUrl(t,r)},getCustomStylesheet:(e,s)=>{var i;const t="custom",r=["css"];return(i=s.getThemeFileUrl(t,r))!=null?i:null},getCustomNaviPoints:(e,s)=>{var i;const t="navi",r=["json"];return(i=s.getThemeFileUrl(t,r))!=null?i:null},getCustomFavicons:(e,s)=>{const t="favicon-32x32",r="favicon-32x32",i=["png","svg"],n=s.getThemeFileUrl(t,i),a=s.getThemeFileUrl(r,i);return n&&a?[n,a]:n?[n,n]:a?[a,a]:null},getDiskUsage:e=>s=>{s.indexOf("/")===0&&(s=s.substr(1)),s.indexOf("/")!==-1&&(s=s.substr(0,s.indexOf("/")));const t=e.filetree.find(r=>r.filename===s);return t&&"disk_usage"in t?t.disk_usage:null},checkConfigFile:(e,s)=>t=>{var i;const r=s.getDirectory("config");return((i=r==null?void 0:r.childrens)==null?void 0:i.findIndex(n=>n.filename!==void 0&&n.filename===t))!==-1},getSmallThumbnail:(e,s,t,r)=>(i,n)=>{var a;if("thumbnails"in i&&((a=i.thumbnails)!=null&&a.length)){const o=i.thumbnails.find(l=>l.width>=ms&&l.width<=fs&&l.height>=ms&&l.height<=fs);if(o&&"relative_path"in o)return"".concat(r["socket/getUrl"],"/server/files/").concat(n,"/").concat(encodeURI(o.relative_path),"?timestamp=").concat(i.modified.getTime())}return""},getBigThumbnail:(e,s,t,r)=>(i,n)=>{var a;if("thumbnails"in i&&((a=i.thumbnails)!=null&&a.length)){const o=i.thumbnails.find(l=>l.width>=Os);if(o&&"relative_path"in o)return"".concat(r["socket/getUrl"],"/server/files/").concat(encodeURI(n),"/").concat(encodeURI(o.relative_path),"?timestamp=").concat(i.modified.getTime())}return""}},nx=()=>({filetree:[],upload:{show:!1,filename:"",currentNumber:0,maxNumber:0,cancelTokenSource:null,percent:0,speed:0}}),XK=nx(),YK={namespaced:!0,state:XK,getters:qK,actions:zK,mutations:ZK},JK={reset({commit:e,dispatch:s}){e("reset"),s("console/reset"),s("gcodehistory/reset"),s("macros/reset"),s("presets/reset"),s("webcams/reset")},init(){window.console.debug("init gui"),y.$socket.emit("server.database.get_item",{namespace:"mainsail"},{action:"gui/initStore"})},async initStore({commit:e,dispatch:s,rootGetters:t,rootState:r},i){var o,l,c,u,d,h;const a=t["socket/getUrl"]+"/server/database/item"+"?namespace=mainsail";if("remoteprinters"in i.value&&(r.instancesDB==="moonraker"&&s("remoteprinters/initStore",i.value.remoteprinters.printers),delete i.value.remoteprinters),(c=(l=(o=i.value)==null?void 0:o.view)==null?void 0:l.gcodefiles)!=null&&c.currentPath&&(window.console.debug("remove currentPath from gui namespace"),await fetch(a+"&key=view.gcodefiles.currentPath",{method:"DELETE"})),(h=(d=(u=i.value)==null?void 0:u.view)==null?void 0:d.configfiles)!=null&&h.currentPath&&(window.console.debug("remove currentPath from gui namespace"),await fetch(a+"&key=view.configfiles.currentPath",{method:"DELETE"})),"cooldownGcode"in i.value&&(window.console.debug("update cooldownGcode to new namespace"),s("saveSetting",{name:"presets.cooldownGcode",value:i.value.cooldownGcode}),await fetch(a+"&key=cooldownGcode",{method:"DELETE"}),delete i.value.cooldownGcode),"presets"in i.value&&Array.isArray(i.value.presets)&&(window.console.debug("update presets to new namespace"),i.value.presets.forEach(p=>{s("presets/store",{values:p})}),delete i.value.presets),"dashboard"in i.value&&"nonExpandPanels"in i.value.dashboard&&Array.isArray(i.value.dashboard.nonExpandPanels)&&(await fetch(a+"&key=dashboard.nonExpandPanels",{method:"DELETE"}),s("saveSetting",{name:"dashboard.nonExpandPanels.widescreen",value:i.value.dashboard.nonExpandPanels}),delete i.value.dashboard.nonExpandPanels),"dashboard"in i.value){const p=i.value.dashboard;["mobileLayout","tabletLayout1","tabletLayout2","desktopLayout1","desktopLayout2","widescreenLayout1","widescreenLayout2","widescreenLayout3"].forEach(f=>{if(f in p){const b=p[f].findIndex(C=>C.name==="tools");b!==-1&&(p[f][b].name="temperature",s("saveSetting",{name:"dashboard."+f,value:p[f]}))}})}await e("setData",i.value),await s("socket/removeInitModule","gui/init",{root:!0})},async initDb({dispatch:e,rootGetters:s}){var a;const t=s["socket/getUrl"]+"/server/database/item",r=s["socket/getUrl"]+"/server/files/config/"+xn+"/default.json?time="+Date.now(),i=await fetch(r);let n={};i&&(n=await i.json(),((a=n.error)==null?void 0:a.code)===404&&(n={}));for(const o in n)if(["webcams","timelapse"].includes(o))for(const l of n[o])await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:o,key:l,value:n[o][l]})});else await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:o,value:n[o]})});await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:"initVersion",value:s.getVersion})}),e("init")},saveSetting({commit:e},s){e("saveSetting",s),y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:s.name,value:s.value})},saveSettingWithoutUpload({commit:e},s){e("saveSetting",s)},updateSettings(e,s){const t=s.keyName;let r=s.newVal;"value"in s&&t in s.value&&typeof s.value[t]!="string"&&!Array.isArray(s.value[t])&&(r=Object.assign(s.value[t],{...r})),y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:t,value:r})},setGcodefilesMetadata({commit:e,dispatch:s,state:t},r){e("setGcodefilesMetadata",r),s("updateSettings",{keyName:"view.gcodefiles.hideMetadataColumns",newVal:t.view.gcodefiles.hideMetadataColumns})},setGcodefilesShowHiddenFiles({commit:e,dispatch:s,state:t},r){e("setGcodefilesShowHiddenFiles",r),s("updateSettings",{keyName:"view.gcodefiles.showHiddenFiles",newVal:t.view.gcodefiles.showHiddenFiles})},setCurrentWebcam({commit:e,dispatch:s,state:t},r){e("setCurrentWebcam",r),s("updateSettings",{keyName:"view.webcam.currentCam",newVal:t.view.webcam.currentCam})},setTempchartDatasetAdditionalSensorSetting({commit:e,dispatch:s,state:t},r){e("setTempchartDatasetAdditionalSensorSetting",r),s("updateSettings",{keyName:"view.tempchart",newVal:t.view.tempchart})},async resetMoonrakerDB({rootGetters:e},s){var a,o,l;const t=e["socket/getUrl"]+"/server/database/item",r=e["socket/getUrl"]+"/server/files/config/"+xn+"/default.json?time="+Date.now(),i=await fetch(r);let n={};i&&(n=await i.json(),((a=n.error)==null?void 0:a.code)===404&&(n={}));for(const c of s)if(["webcams","timelapse"].includes(c)){const u=t+"?namespace="+c,h=await(await fetch(u)).json();if((o=h==null?void 0:h.result)!=null&&o.value)for(const p of Object.keys((l=h==null?void 0:h.result)==null?void 0:l.value))await fetch(u+"&key="+p,{method:"DELETE"});if(c in n)for(const p of n[c])await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:c,key:p,value:n[c][p]})})}else c==="history_jobs"?await fetch(e["socket/getUrl"]+"/server/history/job?all=true",{method:"DELETE"}):c==="history_totals"?await fetch(e["socket/getUrl"]+"/server/history/reset_totals",{method:"POST"}):(await fetch(e["socket/getUrl"]+"/server/database/item?namespace=mainsail&key="+c,{method:"DELETE"}),c in n&&await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:c,value:n[c]})}));window.location.reload()},async backupMoonrakerDB({rootGetters:e},s){var o,l,c,u;const t={},i=await(await fetch(e["socket/getUrl"]+"/server/database/item?namespace=mainsail")).json(),n=(l=(o=i==null?void 0:i.result)==null?void 0:o.value)!=null?l:{};for(const d of s)if(["timelapse","webcams"].includes(d)){const h=e["socket/getUrl"]+"/server/database/item?namespace="+d,m=await(await fetch(h)).json();(c=m==null?void 0:m.result)!=null&&c.value&&(t[d]={...(u=m==null?void 0:m.result)==null?void 0:u.value})}else d in n&&(t[d]={...n[d]});const a=document.createElement("a");a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(JSON.stringify(t))),a.setAttribute("download","backup-mainsail.json"),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)},async restoreMoonrakerDB({rootGetters:e},s){var l,c,u,d,h,p;const t=e["socket/getUrl"]+"/server/database/item",r=t+"?namespace=mainsail",n=await(await fetch(e["socket/getUrl"]+"/server/database/list")).json(),a=(c=(l=n==null?void 0:n.result)==null?void 0:l.namespaces)!=null?c:[];let o=[];if(a.includes("mainsail")){const f=await(await fetch(r)).json();o=Object.keys((d=(u=f==null?void 0:f.result)==null?void 0:u.value)!=null?d:{})}for(const m of s.dbCheckboxes)if(["timelapse","webcams"].includes(m)){if(a.includes(m)){const f=t+"?namespace="+m,C=await(await fetch(f)).json();if((h=C==null?void 0:C.result)!=null&&h.value)for(const w of Object.keys((p=C==null?void 0:C.result)==null?void 0:p.value))await fetch(f+"&key="+w,{method:"DELETE"})}for(const f of Object.keys(s.restoreObjects[m])){const b=s.restoreObjects[m][f];await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:m,key:f,value:b})})}}else o.includes(m)&&await fetch(r+"&key="+m,{method:"DELETE"}),await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:m,value:s.restoreObjects[m]})});window.location.reload()},setHistoryColumns({commit:e,dispatch:s,state:t},r){e("setHistoryColumns",r),s("updateSettings",{keyName:"view.history",newVal:t.view.history})},hideStatusInHistoryList({commit:e,dispatch:s,state:t},r){const i=[...t.view.history.hidePrintStatus];i.includes(r)||(i.push(r),e("setHistoryHidePrintStatus",i),s("updateSettings",{keyName:"view.history.hidePrintStatus",newVal:i}))},saveExpandPanel({commit:e,dispatch:s,state:t},r){r.value?e("removeClosePanel",{name:r.name,viewport:r.viewport}):e("addClosePanel",{name:r.name,viewport:r.viewport}),s("updateSettings",{keyName:"dashboard.nonExpandPanels.".concat(r.viewport),newVal:t.dashboard.nonExpandPanels[r.viewport]})},showStatusInHistoryList({commit:e,dispatch:s,state:t},r){const i=[...t.view.history.hidePrintStatus],n=i.indexOf(r);n!==-1&&(i.splice(n,1),e("setHistoryHidePrintStatus",i),s("updateSettings",{keyName:"view.history.hidePrintStatus",newVal:i}))},resetLayout({dispatch:e},s){var i;const r=(i=eu().dashboard[s])!=null?i:[];e("saveSetting",{name:"dashboard."+s,value:r})},updateGcodeviewerCache({dispatch:e,state:s},t){var i;const r=(i=s.gcodeViewer.klipperCache)!=null?i:{};Object.keys(t).forEach(n=>{const a=t[n],o=n in r?r[n]:null;JSON.stringify(a)!==JSON.stringify(o)&&e("saveSetting",{name:"gcodeViewer.klipperCache.".concat(n),value:a})})},announcementDismissFlag(e,s){window.console.log(s)},setChartDatasetStatus({commit:e,dispatch:s,state:t},r){e("setChartDatasetStatus",r),s("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})},setDatasetAdditionalSensorStatus({commit:e,dispatch:s,state:t},r){e("setDatasetAdditionalSensorStatus",r),s("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})},setChartColor({commit:e,dispatch:s,state:t},r){e("setChartDatasetStatus",{objectName:r.objectName,dataset:"color",value:r.value}),s("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})}},KK={reset(e){Object.assign(e,eu())},setData(e,s){rc(e,s)},saveSetting(e,s){const t=(r,i,n)=>i!==void 0&&typeof i=="string"?t(r,i.split("."),n):i.length==1&&n!==void 0?r[i[0]]=n:i.length==0?r:(i[0]in r||(r[i[0]]={}),t(r[i[0]],i.slice(1),n));t(e,s.name,s.value)},setHeaterChartVisibility(e,s){const t=e.view.tempchart.hiddenDataset.indexOf(s.name.toUpperCase());s.hidden&&t===-1?e.view.tempchart.hiddenDataset.push(s.name.toUpperCase()):s.hidden!==!0&&t>-1&&e.view.tempchart.hiddenDataset.splice(t,1)},setGcodefilesMetadata(e,s){const t=[...e.view.gcodefiles.hideMetadataColumns],r=t.findIndex(i=>i===s.name);s.value&&r!==-1?t.splice(r,1):!s.value&&r===-1&&t.push(s.name),y.set(e.view.gcodefiles,"hideMetadataColumns",t)},setGcodefilesShowHiddenFiles(e,s){y.set(e.view.gcodefiles,"showHiddenFiles",s)},setCurrentWebcam(e,s){y.set(e.view.webcam.currentCam,s.page,s.value)},setHistoryColumns(e,s){s.value&&e.view.history.hideColums.includes(s.name)?e.view.history.hideColums.splice(e.view.history.hideColums.indexOf(s.name),1):!s.value&&!e.view.history.hideColums.includes(s.name)&&e.view.history.hideColums.push(s.name)},setHistoryHidePrintStatus(e,s){y.set(e.view.history,"hidePrintStatus",s)},addClosePanel(e,s){const t=[...e.dashboard.nonExpandPanels[s.viewport]];t.includes(s.name)||(t.push(s.name),y.set(e.dashboard.nonExpandPanels,s.viewport,t))},removeClosePanel(e,s){const t=[...e.dashboard.nonExpandPanels[s.viewport]],r=t.indexOf(s.name);r>-1&&(t.splice(r,1),y.set(e.dashboard.nonExpandPanels,s.viewport,t))},deleteFromDashboardLayout(e,s){const t=[...e.dashboard[s.layoutname]];t.splice(s.index,1),y.set(e.dashboard,s.layoutname,t)},setChartDatasetStatus(e,s){if(!(s.objectName in e.view.tempchart.datasetSettings)){const t={};t[s.dataset]=s.value,y.set(e.view.tempchart.datasetSettings,s.objectName,t);return}y.set(e.view.tempchart.datasetSettings[s.objectName],s.dataset,s.value)},setDatasetAdditionalSensorStatus(e,s){if(!(s.objectName in e.view.tempchart.datasetSettings)){const t={additionalSensors:{}};t.additionalSensors[s.dataset]=s.value,y.set(e.view.tempchart.datasetSettings,s.objectName,t);return}if(!("additionalSensors"in e.view.tempchart.datasetSettings[s.objectName])){const t={};t[s.dataset]=s.value,y.set(e.view.tempchart.datasetSettings[s.objectName],"additionalSensors",t);return}y.set(e.view.tempchart.datasetSettings[s.objectName].additionalSensors,s.dataset,s.value)}},QK={getDatasetValue:e=>s=>s.name in e.view.tempchart.datasetSettings&&s.type in e.view.tempchart.datasetSettings[s.name]?e.view.tempchart.datasetSettings[s.name][s.type]:["temperature","target"].includes(s.type),getDatasetAdditionalSensorValue:e=>s=>s.name in e.view.tempchart.datasetSettings&&"additionalSensors"in e.view.tempchart.datasetSettings[s.name]&&s.sensor in e.view.tempchart.datasetSettings[s.name].additionalSensors?e.view.tempchart.datasetSettings[s.name].additionalSensors[s.sensor]:!0,getPanelExpand:e=>(s,t)=>"dashboard"in e&&t in e.dashboard.nonExpandPanels?!e.dashboard.nonExpandPanels[t].includes(s):!0,getAllPossiblePanels:(e,s,t,r)=>{var c,u,d,h;let i=[..._S];return((c=e.macros)==null?void 0:c.mode)==="expert"&&(s["macros/getAllMacrogroups"].forEach(m=>{i.push("macrogroup_"+m.id)}),i=i.filter(m=>m!=="macros")),r["printer/getKinematics"]==="none"&&(i=i.filter(p=>!["toolhead-control","machine-settings"].includes(p))),r["printer/getExtruders"].length<1&&(i=i.filter(p=>p!=="extruder-control")),((h=(d=(u=t.printer)==null?void 0:u.heaters)==null?void 0:d.available_sensors)!=null?h:[]).length<1&&(i=i.filter(p=>p!=="temperature")),s["webcams/getWebcams"].length===0&&(i=i.filter(p=>p!=="webcam")),t.server.components.includes("spoolman")||(i=i.filter(p=>p!=="spoolman")),i},getPanels:(e,s,t)=>(r,i,n=!1)=>{var c,u;const a=i?"".concat(r,"Layout").concat(i):"".concat(r,"Layout");let o=(u=(c=e.dashboard[a])==null?void 0:c.filter(d=>d!==null))!=null?u:[];const l=s.getAllPossiblePanels;if(i<2){const d=s.getAllPanelsFromViewport(r),h=[];l.forEach(p=>{d.find(m=>m.name===p)||h.push({name:p,visible:!0})}),o=o.concat(h)}if(n&&(o=o.filter(d=>d.visible)),t.gui.macros.mode==="simple")o=o.filter(d=>!d.name.startsWith("macrogroup_"));else{o=o.filter(h=>h.name!=="macros");const d=s["macros/getAllMacrogroups"];d.length&&(o=o.filter(h=>{if(!h.name.startsWith("macrogroup_"))return!0;const p=h.name.slice(11);return d.findIndex(m=>m.id===p)!==-1}))}return o.filter(d=>l.includes(d.name))},getAllPanelsFromViewport:e=>s=>{let t=[];"".concat(s,"Layout")in e.dashboard&&(t=t.concat(e.dashboard["".concat(s,"Layout")]));let r=1;for(;"".concat(s,"Layout").concat(r)in e.dashboard;)t=t.concat(e.dashboard["".concat(s,"Layout").concat(r)]),r++;return t},getDefaultControlActionButton:(e,s,t,r)=>r["printer/existsQGL"]?"qgl":r["printer/existsZtilt"]?"ztilt":"m84",getHours12Format:e=>{const s=e.general.timeFormat;return s==="12hours"?!0:s===null?Intl.DateTimeFormat(navigator.language,{hour:"numeric"}).resolvedOptions().hour12:!1}};let Ba;const eQ=new Uint8Array(16);function tQ(){if(!Ba&&(Ba=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ba))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ba(eQ)}const ct=[];for(let e=0;e<256;++e)ct.push((e+256).toString(16).slice(1));function sQ(e,s=0){return ct[e[s+0]]+ct[e[s+1]]+ct[e[s+2]]+ct[e[s+3]]+"-"+ct[e[s+4]]+ct[e[s+5]]+"-"+ct[e[s+6]]+ct[e[s+7]]+"-"+ct[e[s+8]]+ct[e[s+9]]+"-"+ct[e[s+10]]+ct[e[s+11]]+ct[e[s+12]]+ct[e[s+13]]+ct[e[s+14]]+ct[e[s+15]]}const rQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ib={randomUUID:rQ};function ar(e,s,t){if(ib.randomUUID&&!s&&!e)return ib.randomUUID();e=e||{};const r=e.random||(e.rng||tQ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,s){t=t||0;for(let i=0;i<16;++i)s[t+i]=r[i];return s}return sQ(r)}const iQ={reset({commit:e}){e("reset")},clear({commit:e}){const s=new Date().valueOf();y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"console.cleared_since",value:s}),e("clear",{cleared_since:s}),e("server/clearGcodeStore",{},{root:!0}),e("server/setConsoleClearedThisSession",{},{root:!0})},saveSetting({dispatch:e},s){e("gui/saveSetting",{name:"console."+s.name,value:s.value},{root:!0})},filterUpload(e,s){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"console.consolefilters."+s.id,value:s.value})},filterStore({commit:e,dispatch:s,state:t},r){const i=ar();e("filterStore",{id:i,values:r.values}),s("filterUpload",{id:i,value:t.consolefilters[i]})},filterUpdate({commit:e,dispatch:s,state:t},r){e("filterUpdate",r),s("filterUpload",{id:r.id,value:t.consolefilters[r.id]})},filterDelete({commit:e},s){e("filterDelete",s),y.$socket.emit("server.database.delete_item",{namespace:"mainsail",key:"console.consolefilters."+s})}},nQ={reset(e){Object.assign(e,ax())},clear(e,s){y.set(e,"cleared_since",s.cleared_since)},filterStore(e,s){y.set(e.consolefilters,s.id,s.values)},filterUpdate(e,s){if(s.id in e.consolefilters){const t={...e.consolefilters[s.id]};Object.assign(t,s.values),y.set(e.consolefilters,s.id,t)}},filterDelete(e,s){s in e.consolefilters&&y.delete(e.consolefilters,s)}},aQ={getConsolefilters:e=>{const s=[];return Object.keys(e.consolefilters).forEach(t=>{s.push({...e.consolefilters[t],id:t})}),$t(s,"name")},getConsolefilterRules:(e,s,t)=>{const r=[];return t.gui.console.hideWaitTemperatures&&r.push("^(?:ok\\s+)?(B|C|T\\d*):"),t.gui.console.hideTlCommands&&CS.forEach(i=>{r.push(i)}),Object.keys(e.consolefilters).forEach(i=>{const n=e.consolefilters[i];n.bool&&n.regex.split("\n").forEach(a=>{a!==""&&r.push(a)})}),r},getConsoleClearedSince:e=>e.cleared_since},ax=()=>({hideWaitTemperatures:!0,hideTlCommands:!0,direction:"table",entryStyle:"default",height:300,autoscroll:!0,consolefilters:{}}),oQ=ax(),lQ={namespaced:!0,state:oQ,getters:aQ,actions:iQ,mutations:nQ},cQ={reset({commit:e}){e("reset")},upload({state:e}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"gcodehistory.entries",value:e.entries})},async addToHistory({commit:e,dispatch:s,state:t},r){const i=[...t.entries];for(i.push(r);i.length>vS;)i.splice(0,1);await e("updateHistory",i),await s("upload")}},uQ={reset(e){Object.assign(e,ox())},updateHistory(e,s){y.set(e,"entries",s)}},dQ={},ox=()=>({entries:[]}),hQ=ox(),pQ={namespaced:!0,state:hQ,getters:dQ,actions:cQ,mutations:uQ},mQ={reset({commit:e}){e("reset")},saveSetting({dispatch:e},s){e("gui/saveSetting",{name:"macros."+s.name,value:s.value},{root:!0})},groupUpload({state:e},s){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"macros.macrogroups."+s,value:e.macrogroups[s]})},async groupStore({commit:e,dispatch:s},t){const r=ar();return await e("groupStore",{id:r,values:t.values}),await s("groupUpload",r),r},groupUpdate({commit:e,dispatch:s},t){e("groupUpdate",t),s("groupUpload",t.id)},addMacroToMacrogroup({commit:e,dispatch:s},t){e("addMacroToMacrogroup",t),s("groupUpload",t.id)},updateMacroFromMacrogroup({commit:e,dispatch:s},t){e("updateMacroFromMacrogroup",t),s("groupUpload",t.id)},removeMacroFromMacrogroup({commit:e,dispatch:s},t){e("removeMacroFromMacrogroup",t),s("groupUpload",t.id)},groupDelete({commit:e,dispatch:s,rootState:t},r){e("groupDelete",r),y.$socket.emit("server.database.delete_item",{namespace:"mainsail",key:"macros.macrogroups."+r}),["mobileLayout","tabletLayout1","tabletLayout2","desktopLayout1","desktopLayout2","widescreenLayout1","widescreenLayout2","widescreenLayout3"].forEach(n=>{var l;const o=(t.gui?[...t.gui.dashboard[n]]:[]).findIndex(c=>c.name==="macrogroup_"+r);o!==-1&&(e("gui/deleteFromDashboardLayout",{layoutname:n,index:o},{root:!0}),s("gui/updateSettings",{keyName:"dashboard."+n,newVal:(l=t.gui)==null?void 0:l.dashboard[n]},{root:!0}))})}},fQ={reset(e){Object.assign(e,lx())},groupStore(e,s){y.set(e.macrogroups,s.id,s.values)},groupUpdate(e,s){if(s.id in e.macrogroups){const t={...e.macrogroups[s.id]};Object.assign(t,s.values),y.set(e.macrogroups,s.id,t)}},addMacroToMacrogroup(e,s){var i,n;const t=[...(n=(i=e.macrogroups[s.id])==null?void 0:i.macros)!=null?n:[]],r={pos:1,name:s.macro,color:"group",showInStandby:!0,showInPrinting:!0,showInPause:!0};t.length&&(r.pos=Math.max(...t.map(a=>a.pos))+1),t.push(r),y.set(e.macrogroups[s.id],"macros",t)},updateMacroFromMacrogroup(e,s){var i,n;const t=[...(n=(i=e.macrogroups[s.id])==null?void 0:i.macros)!=null?n:[]],r=t.findIndex(a=>a.name===s.macro);if(r!==-1){const a=t[r];a[s.option]=s.value,y.set(e.macrogroups[s.id],"macros",t)}},removeMacroFromMacrogroup(e,s){var i,n;const t=[...(n=(i=e.macrogroups[s.id])==null?void 0:i.macros)!=null?n:[]],r=t.findIndex(a=>a.name===s.macro);if(r!==-1){const a=t[r].pos;t.splice(r,1),t.filter(o=>o.pos>a).forEach(o=>{o.pos=o.pos-1})}y.set(e.macrogroups[s.id],"macros",t)},groupDelete(e,s){s in e.macrogroups&&y.delete(e.macrogroups,s)}},gQ={getAllMacrogroups:e=>{const s=[];return Object.keys(e.macrogroups).forEach(t=>{s.push({...e.macrogroups[t],id:t})}),$t(s,"name")},getMacrogroup:e=>s=>e.macrogroups[s]},lx=()=>({mode:"simple",hiddenMacros:[],macrogroups:{}}),vQ=lx(),_Q={namespaced:!0,state:vQ,getters:gQ,actions:mQ,mutations:fQ},bQ={reset({commit:e}){e("reset")},upload({state:e},s){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"miscellaneous.entries."+s,value:e.entries[s]})},async store({commit:e,dispatch:s},t){const r=ar();return await e("store",{id:r,values:t}),await s("upload",r),r},async storeLightgroup({commit:e,dispatch:s,getters:t},r){let i=t.getId(r.entry);i===null&&(i=await s("store",r.entry));const n=ar();return await e("updateLightgroup",{entryId:i,lightgroupId:n,values:r.lightgroup}),await s("upload",i),n},async updateLightgroup({commit:e,dispatch:s,getters:t},r){const i=t.getId(r.entry);if(i!==null)return await e("updateLightgroup",{entryId:i,lightgroupId:r.lightgroup.id,values:r.lightgroup}),await s("upload",i),r.lightgroup.id},async deleteLightgroup({commit:e,dispatch:s,getters:t},r){const i=t.getId(r.entry);i!==null&&(await e("destroyLightgroup",{entryId:i,lightgroupId:r.lightgroupId}),await s("upload",i))},async storePreset({commit:e,dispatch:s,getters:t},r){let i=t.getId(r.entry);i===null&&(i=await s("store",r.entry));const n=ar();return await e("updatePreset",{entryId:i,presetId:n,values:r.preset}),await s("upload",i),n},async updatePreset({commit:e,dispatch:s,getters:t},r){const i=t.getId(r.entry);if(i!==null)return await e("updatePreset",{entryId:i,presetId:r.preset.id,values:r.preset}),await s("upload",i),r.preset.id},async deletePreset({commit:e,dispatch:s,getters:t},r){const i=t.getId(r.entry);i!==null&&(await e("destroyPreset",{entryId:i,presetId:r.presetId}),await s("upload",i))}},yQ={reset(e){Object.assign(e,cx())},store(e,s){const t={name:s.values.name,type:s.values.type,lightgroups:{},presets:{}};y.set(e.entries,s.id,t)},updateLightgroup(e,s){const t={name:s.values.name,start:parseInt(s.values.start.toString()),end:parseInt(s.values.end.toString())};y.set(e.entries[s.entryId].lightgroups,s.lightgroupId,t)},destroyLightgroup(e,s){const t={...e.entries};delete t[s.entryId].lightgroups[s.lightgroupId],y.set(e,"entries",t)},updatePreset(e,s){const t={name:s.values.name,red:s.values.red,green:s.values.green,blue:s.values.blue,white:s.values.white};y.set(e.entries[s.entryId].presets,s.presetId,t)},destroyPreset(e,s){const t={...e.entries};delete t[s.entryId].presets[s.presetId],y.set(e,"entries",t)}},CQ={getEntries:e=>{const s=[];return Object.entries(e.entries).forEach(([t,r])=>{s.push({id:t,name:r.name,type:r.type,lightgroups:{...r.lightgroups},presets:{...r.presets}})}),s},getEntry:(e,s)=>t=>s.getEntries.find(r=>r.name===t.name&&r.type===t.type),getId:(e,s)=>t=>{var r,i;return(i=(r=s.getEntry(t))==null?void 0:r.id)!=null?i:null},getEntryLightgroups:(e,s)=>t=>{const r=s.getEntry(t);if(!r)return[];const i=[];return Object.entries(r.lightgroups).forEach(([n,a])=>{i.push({name:a.name,start:a.start,end:a.end,id:n})}),$t(i,"name")},getEntryPresets:(e,s)=>t=>{const r=s.getEntry(t);if(!r)return[];const i=[];return Object.entries(r.presets).forEach(([n,a])=>{i.push({name:a.name,red:a.red,green:a.green,blue:a.blue,white:a.white,id:n})}),$t(i,"name")}},cx=()=>({entries:{}}),$Q=cx(),xQ={namespaced:!0,state:$Q,getters:CQ,actions:bQ,mutations:yQ},wQ={reset({commit:e}){e("reset")},upload({state:e}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"navigation.entries",value:e.entries})},updatePos({commit:e},s){e("updatePos",s)},changeVisibility({commit:e,dispatch:s},t){e("changeVisibility",t),s("upload")}},SQ={reset(e){Object.assign(e,ux())},updatePos(e,s){const t=e.entries.findIndex(n=>n.type===s.type&&n.title===s.title);if(t!==-1){e.entries[t].position=s.position;return}const r={type:s.type,title:s.title,visible:s.visible,position:s.position},i=[...e.entries];i.push(r),y.set(e,"entries",i)},changeVisibility(e,s){var a;const t=(a=s.orgTitle)!=null?a:s.title,r=e.entries.findIndex(o=>o.type===s.type&&o.title===t);if(r!==-1){e.entries[r].visible=!s.visible;return}const i={type:s.type,title:t,visible:!s.visible,position:s.position},n=[...e.entries];n.push(i),y.set(e,"entries",n)}},PQ={},ux=()=>({entries:[]}),TQ=ux(),DQ={namespaced:!0,state:TQ,getters:PQ,actions:wQ,mutations:SQ},MQ={reset({commit:e}){e("reset")},upload({state:e}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"notifications.dismiss",value:e.dismiss})},close({dispatch:e},s){const t=s.id.indexOf("/");if(t===-1)return;const r=s.id.slice(0,t),i=s.id.slice(t+1);if(r==="announcement"){e("server/announcements/close",{entry_id:i},{root:!0});return}e("storeDismiss",{entry_id:i,category:r,type:"ever",time:null})},dismiss({dispatch:e},s){const t=s.id.indexOf("/");if(t===-1)return;const r=s.id.slice(0,t),i=s.id.slice(t+1);if(r==="announcement"){e("server/announcements/dismiss",{entry_id:i,time:s.time},{root:!0});return}e("storeDismiss",{entry_id:i,category:r,type:s.type,time:s.time})},async storeDismiss({commit:e,dispatch:s,state:t},r){var a;let i=new Date().getTime();r.type==="time"&&(i=new Date().getTime()+((a=r.time)!=null?a:0)*1e3);const n={id:r.entry_id,category:r.category,type:r.type,date:i};t.dismiss.filter(o=>o.id===n.id&&o.category===n.category&&o.type===n.type).length&&await e("removeDismiss",n),await e("addDismiss",n),await s("upload")}},EQ={reset(e){Object.assign(e,hx())},addDismiss(e,s){const t=[...e.dismiss];t.push(s),y.set(e,"dismiss",t)},removeDismiss(e,s){const t=[...e.dismiss],r=t.findIndex(i=>i.id===s.id&&i.category===s.category&&i.type===s.type);r!==-1&&t.splice(r),y.set(e,"dismiss",t)}};var dx={exports:{}};const OQ={},LQ=Object.freeze(Object.defineProperty({__proto__:null,default:OQ},Symbol.toStringTag,{value:"Module"})),nb=hp(LQ);/** - * [js-sha256]{@link https://github.com/emn178/js-sha256} - * - * @version 0.10.1 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2014-2023 - * @license MIT - */(function(e){(function(){var s="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=xr:i&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&!0&&e.exports,o=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],u=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=["hex","array","digest","arrayBuffer"],p=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function($){return Object.prototype.toString.call($)==="[object Array]"}),o&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function($){return typeof $=="object"&&$.buffer&&$.buffer.constructor===ArrayBuffer});var m=function($,T){return function(I){return new M(T,!0).update(I)[$]()}},f=function($){var T=m("hex",$);n&&(T=b(T,$)),T.create=function(){return new M($)},T.update=function(W){return T.create().update(W)};for(var I=0;I>2]|=$[W]<>2]|=R<>2]|=(192|R>>6)<>2]|=(128|R&63)<=57344?(D[B>>2]|=(224|R>>12)<>2]|=(128|R>>6&63)<>2]|=(128|R&63)<>2]|=(240|R>>18)<>2]|=(128|R>>12&63)<>2]|=(128|R>>6&63)<>2]|=(128|R&63)<=64?(this.block=D[16],this.start=B-64,this.hash(),this.hashed=!0):this.start=B}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var $=this.blocks,T=this.lastByteIndex;$[16]=this.block,$[T>>2]|=c[T&3],this.block=$[16],T>=56&&(this.hashed||this.hash(),$[0]=this.block,$[16]=$[1]=$[2]=$[3]=$[4]=$[5]=$[6]=$[7]=$[8]=$[9]=$[10]=$[11]=$[12]=$[13]=$[14]=$[15]=0),$[14]=this.hBytes<<3|this.bytes>>>29,$[15]=this.bytes<<3,this.hash()}},M.prototype.hash=function(){var $=this.h0,T=this.h1,I=this.h2,R=this.h3,W=this.h4,B=this.h5,ee=this.h6,D=this.h7,z=this.blocks,X,Q,te,se,F,G,x,P,L,Y,ae;for(X=16;X<64;++X)F=z[X-15],Q=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3,F=z[X-2],te=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10,z[X]=z[X-16]+Q+z[X-7]+te<<0;for(ae=T&I,X=0;X<64;X+=4)this.first?(this.is224?(P=300032,F=z[0]-1413257819,D=F-150054599<<0,R=F+24177077<<0):(P=704751109,F=z[0]-210244248,D=F-1521486534<<0,R=F+143694565<<0),this.first=!1):(Q=($>>>2|$<<30)^($>>>13|$<<19)^($>>>22|$<<10),te=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),P=$&T,se=P^$&I^ae,x=W&B^~W&ee,F=D+te+x+d[X]+z[X],G=Q+se,D=R+F<<0,R=F+G<<0),Q=(R>>>2|R<<30)^(R>>>13|R<<19)^(R>>>22|R<<10),te=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),L=R&$,se=L^R&T^P,x=D&W^~D&B,F=ee+te+x+d[X+1]+z[X+1],G=Q+se,ee=I+F<<0,I=F+G<<0,Q=(I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10),te=(ee>>>6|ee<<26)^(ee>>>11|ee<<21)^(ee>>>25|ee<<7),Y=I&R,se=Y^I&$^L,x=ee&D^~ee&W,F=B+te+x+d[X+2]+z[X+2],G=Q+se,B=T+F<<0,T=F+G<<0,Q=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),te=(B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7),ae=T&I,se=ae^T&R^Y,x=B&ee^~B&D,F=W+te+x+d[X+3]+z[X+3],G=Q+se,W=$+F<<0,$=F+G<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+$<<0,this.h1=this.h1+T<<0,this.h2=this.h2+I<<0,this.h3=this.h3+R<<0,this.h4=this.h4+W<<0,this.h5=this.h5+B<<0,this.h6=this.h6+ee<<0,this.h7=this.h7+D<<0},M.prototype.hex=function(){this.finalize();var $=this.h0,T=this.h1,I=this.h2,R=this.h3,W=this.h4,B=this.h5,ee=this.h6,D=this.h7,z=l[$>>28&15]+l[$>>24&15]+l[$>>20&15]+l[$>>16&15]+l[$>>12&15]+l[$>>8&15]+l[$>>4&15]+l[$&15]+l[T>>28&15]+l[T>>24&15]+l[T>>20&15]+l[T>>16&15]+l[T>>12&15]+l[T>>8&15]+l[T>>4&15]+l[T&15]+l[I>>28&15]+l[I>>24&15]+l[I>>20&15]+l[I>>16&15]+l[I>>12&15]+l[I>>8&15]+l[I>>4&15]+l[I&15]+l[R>>28&15]+l[R>>24&15]+l[R>>20&15]+l[R>>16&15]+l[R>>12&15]+l[R>>8&15]+l[R>>4&15]+l[R&15]+l[W>>28&15]+l[W>>24&15]+l[W>>20&15]+l[W>>16&15]+l[W>>12&15]+l[W>>8&15]+l[W>>4&15]+l[W&15]+l[B>>28&15]+l[B>>24&15]+l[B>>20&15]+l[B>>16&15]+l[B>>12&15]+l[B>>8&15]+l[B>>4&15]+l[B&15]+l[ee>>28&15]+l[ee>>24&15]+l[ee>>20&15]+l[ee>>16&15]+l[ee>>12&15]+l[ee>>8&15]+l[ee>>4&15]+l[ee&15];return this.is224||(z+=l[D>>28&15]+l[D>>24&15]+l[D>>20&15]+l[D>>16&15]+l[D>>12&15]+l[D>>8&15]+l[D>>4&15]+l[D&15]),z},M.prototype.toString=M.prototype.hex,M.prototype.digest=function(){this.finalize();var $=this.h0,T=this.h1,I=this.h2,R=this.h3,W=this.h4,B=this.h5,ee=this.h6,D=this.h7,z=[$>>24&255,$>>16&255,$>>8&255,$&255,T>>24&255,T>>16&255,T>>8&255,T&255,I>>24&255,I>>16&255,I>>8&255,I&255,R>>24&255,R>>16&255,R>>8&255,R&255,W>>24&255,W>>16&255,W>>8&255,W&255,B>>24&255,B>>16&255,B>>8&255,B&255,ee>>24&255,ee>>16&255,ee>>8&255,ee&255];return this.is224||z.push(D>>24&255,D>>16&255,D>>8&255,D&255),z},M.prototype.array=M.prototype.digest,M.prototype.arrayBuffer=function(){this.finalize();var $=new ArrayBuffer(this.is224?28:32),T=new DataView($);return T.setUint32(0,this.h0),T.setUint32(4,this.h1),T.setUint32(8,this.h2),T.setUint32(12,this.h3),T.setUint32(16,this.h4),T.setUint32(20,this.h5),T.setUint32(24,this.h6),this.is224||T.setUint32(28,this.h7),$};function H($,T,I){var R,W=typeof $;if(W==="string"){var B=[],ee=$.length,D=0,z;for(R=0;R>6,B[D++]=128|z&63):z<55296||z>=57344?(B[D++]=224|z>>12,B[D++]=128|z>>6&63,B[D++]=128|z&63):(z=65536+((z&1023)<<10|$.charCodeAt(++R)&1023),B[D++]=240|z>>18,B[D++]=128|z>>12&63,B[D++]=128|z>>6&63,B[D++]=128|z&63);$=B}else if(W==="object"){if($===null)throw new Error(s);if(o&&$.constructor===ArrayBuffer)$=new Uint8Array($);else if(!Array.isArray($)&&(!o||!ArrayBuffer.isView($)))throw new Error(s)}else throw new Error(s);$.length>64&&($=new M(T,!0).update($).array());var X=[],Q=[];for(R=0;R<64;++R){var te=$[R]||0;X[R]=92^te,Q[R]=54^te}M.call(this,T,I),this.update(Q),this.oKeyPad=X,this.inner=!0,this.sharedMemory=I}H.prototype=new M,H.prototype.finalize=function(){if(M.prototype.finalize.call(this),this.inner){this.inner=!1;var $=this.array();M.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update($),M.prototype.finalize.call(this)}};var A=f();A.sha256=A,A.sha224=f(!0),A.sha256.hmac=w(),A.sha224.hmac=w(!0),a?e.exports=A:(r.sha256=A.sha256,r.sha224=A.sha224)})()})(dx);var Dr=dx.exports,ab=globalThis&&globalThis.__spreadArray||function(e,s,t){if(t||arguments.length===2)for(var r=0,i=s.length,n;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new IQ:typeof navigator<"u"?cb(navigator.userAgent):WQ()}function UQ(e){return e!==""&&NQ.reduce(function(s,t){var r=t[0],i=t[1];if(s)return s;var n=i.exec(e);return!!n&&[r,n]},!1)}function cb(e){var s=UQ(e);if(!s)return null;var t=s[0],r=s[1];if(t==="searchbot")return new RQ;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length{let t=[];t=t.concat(s.getNotificationsAnnouncements),t=t.concat(s.getNotificationsFlags),t=t.concat(s.getNotificationsDependencies),t=t.concat(s.getNotificationsMoonrakerWarnings),t=t.concat(s.getNotificationsMoonrakerFailedComponents),t=t.concat(s.getNotificationsMoonrakerFailedInitComponents),t=t.concat(s.getNotificationsKlipperWarnings),t=t.concat(s.getNotificationsBrowserWarnings);const r={normal:2,high:1,critical:0};return t.sort((i,n)=>r[i.priority]r[n.priority]?1:n.date.getTime()-i.date.getTime())},getNotificationsAnnouncements:(e,s,t,r)=>{const i=[],n=r["server/announcements/getAnnouncements"];return n.length&&n.forEach(a=>{i.push({id:"announcement/"+a.entry_id,priority:a.priority,title:a.title,description:a.description,date:a.date,dismissed:a.dismissed,url:a.url})}),i},getNotificationsFlags:(e,s,t,r)=>{var a;const i=[];let n=r["server/getThrottledStateFlags"];if(n.length){const o=(a=t.server.system_boot_at)!=null?a:new Date,l=r["gui/notifications/getDismissByCategory"]("flag").map(c=>c.id);n=n.filter(c=>!l.includes(c)),n.forEach(c=>{i.push({id:"flag/"+c,priority:c.startsWith("Previously")?"high":"critical",title:be.t("App.ThrottledStates.Title".concat(c)),description:be.t("App.ThrottledStates.Description".concat(c)),date:o,dismissed:!1})})}return i},getNotificationsDependencies:(e,s,t,r)=>{var a;const i=[];let n=r.getDependencies;if(n.length){const o=(a=t.server.system_boot_at)!=null?a:new Date,l=r["gui/notifications/getDismissByCategory"]("dependency").map(c=>c.id);n=n.filter(c=>!l.includes("".concat(c.serviceName,"/").concat(c.neededVersion))),n.forEach(c=>{i.push({id:"dependency/".concat(c.serviceName,"/").concat(c.neededVersion),priority:"high",title:be.t("App.Notifications.DependencyName",{name:c.serviceName}).toString(),description:be.t("App.Notifications.DependencyDescription",{name:c.serviceName,installedVersion:c.installedVersion,neededVersion:c.neededVersion}).toString(),date:o,dismissed:!1})})}return i},getNotificationsMoonrakerWarnings:(e,s,t,r)=>{var a,o;const i=[];let n=(a=t.server.warnings)!=null?a:[];if(n.length){const l=(o=t.server.system_boot_at)!=null?o:new Date,c=r["gui/notifications/getDismissByCategory"]("moonrakerWarning").map(u=>u.id);n=n.filter(u=>!c.includes(Dr.sha256(u))),n.forEach(u=>{var h,p,m,f;let d=u;if(u.startsWith("Unparsed config option")){const C=(p=(h=RegExp(/'(?