From 3116deac817bf62620a58107eff184ef1408b078 Mon Sep 17 00:00:00 2001 From: Softonik Date: Wed, 14 Aug 2024 21:10:58 +0300 Subject: [PATCH] Init: v2.12.0 --- .version | 1 + assets/Codemirror-96aef739.js | 1 + assets/Heightmap-a5103d86.js | 1 + assets/Heightmap-acf3d6b7.css | 1 + assets/Hlsstreamer-d1b15932.js | 1 + assets/Hlsstreamer-f9f189cf.css | 1 + assets/Ipstreamer-d64872ad.js | 1 + assets/Ipstreamer-f951d43b.css | 1 + assets/JMuxerStream-8716a630.js | 1 + assets/JMuxerStream-baf633f9.css | 1 + assets/JanusStreamer-3206d816.css | 1 + assets/JanusStreamer-caeac552.js | 8 + assets/Mjpegstreamer-181c3267.js | 1 + assets/Mjpegstreamer-7069622c.css | 1 + assets/MjpegstreamerAdaptive-4819ecfb.js | 1 + assets/MjpegstreamerAdaptive-edd84448.css | 1 + assets/Uv4lMjpeg-486d8a68.css | 1 + assets/Uv4lMjpeg-63b5ce35.js | 1 + assets/Viewer-815597de.css | 1 + assets/Viewer-ac934cb5.js | 1 + assets/WebrtcCameraStreamer-7e0e004c.css | 1 + assets/WebrtcCameraStreamer-8d1cc452.js | 1 + assets/WebrtcGo2rtc-4ca7d296.css | 1 + assets/WebrtcGo2rtc-b685b8ad.js | 1 + assets/WebrtcMediaMTX-2862afdc.js | 1 + assets/WebrtcMediaMTX-caefdcd6.css | 1 + assets/codemirror-0a1db0c7.js | 1 + assets/cz-285b76fb.js | 1 + assets/da-32034265.js | 1 + assets/de-1b45e732.js | 1 + assets/echarts-ff51454d.js | 22 +++ assets/es-8a2d24bf.js | 1 + assets/fr-ab90ab77.js | 1 + assets/hu-a56cb065.js | 1 + assets/index-17a5ec1d.js | 50 +++++ assets/index-fc21b522.css | 1 + assets/it-a13fb923.js | 1 + assets/ja-a20a0276.js | 1 + assets/ko-0b8d811b.js | 1 + assets/nl-d64c7e44.js | 1 + assets/overlayscrollbars-44d87bcf.js | 12 ++ assets/overlayscrollbars-a16bc3d3.css | 12 ++ assets/pl-4358b7cc.js | 1 + assets/pt-880f8881.js | 1 + assets/ru-e26fbb6e.js | 1 + assets/se-23883ae1.js | 1 + assets/tr-9777749c.js | 1 + assets/uk-217f44de.js | 1 + assets/virtual_pwa-register-7198e461.js | 1 + assets/vuetify-4c65b4c3.js | 5 + assets/vuetify-950d1cb0.css | 5 + assets/workbox-window.prod.es5-ed7f7eb3.js | 1 + assets/zh-0b0471a0.js | 1 + assets/zh_TW-7176daef.js | 1 + config.json | 10 + fonts/roboto-black.woff2 | Bin 0 -> 11012 bytes fonts/roboto-bold.woff2 | Bin 0 -> 11020 bytes fonts/roboto-light.woff2 | Bin 0 -> 11180 bytes fonts/roboto-medium.woff2 | Bin 0 -> 11056 bytes fonts/roboto-regular.woff2 | Bin 0 -> 11016 bytes fonts/roboto-thin.woff2 | Bin 0 -> 10984 bytes fonts/robotoMono-regular.woff | Bin 0 -> 15160 bytes img/icons/apple-touch-icon-180x180.png | Bin 0 -> 6452 bytes img/icons/favicon-16x16.png | Bin 0 -> 332 bytes img/icons/favicon-32x32.png | Bin 0 -> 618 bytes img/icons/icon-192-maskable.png | Bin 0 -> 7847 bytes img/icons/icon-512-maskable.png | Bin 0 -> 35611 bytes img/icons/mstile-150x150.png | Bin 0 -> 2377 bytes img/icons/safari-pinned-tab.svg | 1 + img/klipper.svg | 1 + img/logo.svg | 1 + img/sidebar-background-light.svg | 206 +++++++++++++++++++++ img/sidebar-background.svg | 1 + img/themes/sidebarBackground-vzbot.png | Bin 0 -> 384096 bytes img/themes/sidebarLogo-btt.svg | 10 + img/themes/sidebarLogo-klipper.svg | 15 ++ img/themes/sidebarLogo-ldo.svg | 7 + img/themes/sidebarLogo-multec.svg | 1 + img/themes/sidebarLogo-prusa.svg | 5 + img/themes/sidebarLogo-voron.svg | 9 + img/themes/sidebarLogo-vzbot.svg | 8 + img/themes/sidebarLogo-yumi.svg | 1 + index.html | 39 ++++ manifest.webmanifest | 1 + release_info.json | 1 + sw.js | 1 + workbox-78627b31.js | 1 + 87 files changed, 480 insertions(+) create mode 100644 .version create mode 100644 assets/Codemirror-96aef739.js create mode 100644 assets/Heightmap-a5103d86.js create mode 100644 assets/Heightmap-acf3d6b7.css create mode 100644 assets/Hlsstreamer-d1b15932.js create mode 100644 assets/Hlsstreamer-f9f189cf.css create mode 100644 assets/Ipstreamer-d64872ad.js create mode 100644 assets/Ipstreamer-f951d43b.css create mode 100644 assets/JMuxerStream-8716a630.js create mode 100644 assets/JMuxerStream-baf633f9.css create mode 100644 assets/JanusStreamer-3206d816.css create mode 100644 assets/JanusStreamer-caeac552.js create mode 100644 assets/Mjpegstreamer-181c3267.js create mode 100644 assets/Mjpegstreamer-7069622c.css create mode 100644 assets/MjpegstreamerAdaptive-4819ecfb.js create mode 100644 assets/MjpegstreamerAdaptive-edd84448.css create mode 100644 assets/Uv4lMjpeg-486d8a68.css create mode 100644 assets/Uv4lMjpeg-63b5ce35.js create mode 100644 assets/Viewer-815597de.css create mode 100644 assets/Viewer-ac934cb5.js create mode 100644 assets/WebrtcCameraStreamer-7e0e004c.css create mode 100644 assets/WebrtcCameraStreamer-8d1cc452.js create mode 100644 assets/WebrtcGo2rtc-4ca7d296.css create mode 100644 assets/WebrtcGo2rtc-b685b8ad.js create mode 100644 assets/WebrtcMediaMTX-2862afdc.js create mode 100644 assets/WebrtcMediaMTX-caefdcd6.css create mode 100644 assets/codemirror-0a1db0c7.js create mode 100644 assets/cz-285b76fb.js create mode 100644 assets/da-32034265.js create mode 100644 assets/de-1b45e732.js create mode 100644 assets/echarts-ff51454d.js create mode 100644 assets/es-8a2d24bf.js create mode 100644 assets/fr-ab90ab77.js create mode 100644 assets/hu-a56cb065.js create mode 100644 assets/index-17a5ec1d.js create mode 100644 assets/index-fc21b522.css create mode 100644 assets/it-a13fb923.js create mode 100644 assets/ja-a20a0276.js create mode 100644 assets/ko-0b8d811b.js create mode 100644 assets/nl-d64c7e44.js create mode 100644 assets/overlayscrollbars-44d87bcf.js create mode 100644 assets/overlayscrollbars-a16bc3d3.css create mode 100644 assets/pl-4358b7cc.js create mode 100644 assets/pt-880f8881.js create mode 100644 assets/ru-e26fbb6e.js create mode 100644 assets/se-23883ae1.js create mode 100644 assets/tr-9777749c.js create mode 100644 assets/uk-217f44de.js create mode 100644 assets/virtual_pwa-register-7198e461.js create mode 100644 assets/vuetify-4c65b4c3.js create mode 100644 assets/vuetify-950d1cb0.css create mode 100644 assets/workbox-window.prod.es5-ed7f7eb3.js create mode 100644 assets/zh-0b0471a0.js create mode 100644 assets/zh_TW-7176daef.js create mode 100644 config.json create mode 100644 fonts/roboto-black.woff2 create mode 100644 fonts/roboto-bold.woff2 create mode 100644 fonts/roboto-light.woff2 create mode 100644 fonts/roboto-medium.woff2 create mode 100644 fonts/roboto-regular.woff2 create mode 100644 fonts/roboto-thin.woff2 create mode 100644 fonts/robotoMono-regular.woff create mode 100644 img/icons/apple-touch-icon-180x180.png create mode 100644 img/icons/favicon-16x16.png create mode 100644 img/icons/favicon-32x32.png create mode 100644 img/icons/icon-192-maskable.png create mode 100644 img/icons/icon-512-maskable.png create mode 100644 img/icons/mstile-150x150.png create mode 100644 img/icons/safari-pinned-tab.svg create mode 100644 img/klipper.svg create mode 100644 img/logo.svg create mode 100644 img/sidebar-background-light.svg create mode 100644 img/sidebar-background.svg create mode 100644 img/themes/sidebarBackground-vzbot.png create mode 100644 img/themes/sidebarLogo-btt.svg create mode 100644 img/themes/sidebarLogo-klipper.svg create mode 100644 img/themes/sidebarLogo-ldo.svg create mode 100644 img/themes/sidebarLogo-multec.svg create mode 100644 img/themes/sidebarLogo-prusa.svg create mode 100644 img/themes/sidebarLogo-voron.svg create mode 100644 img/themes/sidebarLogo-vzbot.svg create mode 100644 img/themes/sidebarLogo-yumi.svg create mode 100644 index.html create mode 100644 manifest.webmanifest create mode 100644 release_info.json create mode 100644 sw.js create mode 100644 workbox-78627b31.js diff --git a/.version b/.version new file mode 100644 index 0000000..a5db00c --- /dev/null +++ b/.version @@ -0,0 +1 @@ +v2.12.0 \ No newline at end of file diff --git a/assets/Codemirror-96aef739.js b/assets/Codemirror-96aef739.js new file mode 100644 index 0000000..f6e8ca0 --- /dev/null +++ b/assets/Codemirror-96aef739.js @@ -0,0 +1 @@ +import{m as w,W as E,B as H,P as d,C as B,n as F}from"./index-17a5ec1d.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-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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 x,j;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/assets/Heightmap-a5103d86.js b/assets/Heightmap-a5103d86.js new file mode 100644 index 0000000..1fb374d --- /dev/null +++ b/assets/Heightmap-a5103d86.js @@ -0,0 +1 @@ +import{m as Et,B as At,a as Xs,C as vt,_ as Wt,b as hi,c as vn,W as za,P as Ke,n as St,d as $s,e as Ga,f as js,g as qs,h as Ys,i as Zs,j as Ks,T as Qs}from"./index-17a5ec1d.js";import{h as fi,f as Pe,c as gt,i as ft,n as Va,o as di,d as vi,l as ht,m as we,r as Js,x as nr,V as eo,B as to,M as ro,p as Ur,A as no,F as io}from"./vuetify-4c65b4c3.js";import{j as Ar,m as Ii,A as ao,L as so,p as ka,R as Wa,k as oo,r as lo,l as Sr,n as co,o as uo,q as ho,s as fo,Z as vo,C as Xa,v as xt,w as Ir,x as _o,y as mo,M as po,z as $n,B as jn,D as go,E as $a,F as ja,G as qa,H as Ya,I as xo,J as yo,K as To,O as Eo,N as Ao,P as So,Q as Hr,S as Bi,T as wo,U as bo,V as Co,W as Ro,X as Mo,Y as Lo,_ as No,$ as Po,a0 as zr,a1 as Do,u as Oo,a2 as Io,a3 as Bo}from"./echarts-ff51454d.js";import"./overlayscrollbars-44d87bcf.js";var Fo=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,Ho=(e,t,r,n)=>{for(var i=n>1?void 0:n?Uo(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&Fo(t,r,i),i};let qn=class extends Et(At){constructor(){super(...arguments),this.mdiLockOutline=Xs}};qn=Ho([vt({components:{Panel:Wt}})],qn);var zo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,_n=(e,t,r,n)=>{for(var i=n>1?void 0:n?Go(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&zo(t,r,i),i};let sr=class extends Et(At){constructor(){super(...arguments),this.mdiCloseThick=hi,this.mdiGrid=vn,this.isInvalidName=!1,this.newName="",this.rules=[t=>!!t||this.$t("Heightmap.InvalidNameEmpty"),t=>t!=="default"||this.$t("Heightmap.InvalidNameReserved"),t=>!this.profileNames.includes(t)||this.$t("Heightmap.InvalidNameAlreadyExists"),t=>t===t.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")]}get profileNames(){var t,r;return Object.keys((r=(t=this.$store.state.printer.bed_mesh)==null?void 0:t.profiles)!=null?r:{})}renameProfile(){const t='BED_MESH_PROFILE SAVE="'.concat(this.newName,'"\nBED_MESH_PROFILE REMOVE="').concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t},{loading:"bedMeshRename"}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(){this.show&&(this.newName=this.name,this.$nextTick(()=>{setTimeout(()=>{var t;(t=this.$refs.input)==null||t.focus()},100)}))}};_n([Ke({type:Boolean,required:!0})],sr.prototype,"show",2);_n([Ke({type:String,required:!0})],sr.prototype,"name",2);_n([za("show")],sr.prototype,"showChanged",1);sr=_n([vt],sr);var Vo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(fi,{attrs:{value:e.show,persistent:"","max-width":400},on:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[r(Wt,{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(Pe,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[r(gt,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(ft,[r(Va,{ref:"input",attrs:{label:e.$t("Heightmap.Name"),required:"",rules:e.rules},on:{"update:error":function(n){e.isInvalidName=n},keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.renameProfile.apply(null,arguments)}},model:{value:e.newName,callback:function(n){e.newName=n},expression:"newName"}})],1),r(di,[r(vi),r(Pe,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Pe,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameProfile}},[e._v(" "+e._s(e.$t("Heightmap.Rename"))+" ")])],1)],1)],1)},ko=[];const Fi={};var Wo=St(sr,Vo,ko,!1,Xo,null,null,null);function Xo(e){for(let t in Fi)this[t]=Fi[t]}const _i=function(){return Wo.exports}();var $o=Object.defineProperty,jo=Object.getOwnPropertyDescriptor,mi=(e,t,r,n)=>{for(var i=n>1?void 0:n?jo(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&$o(t,r,i),i};let wr=class extends Et(At){constructor(){super(...arguments),this.mdiCloseThick=hi,this.mdiGrid=vn}removeProfile(){const e='BED_MESH_PROFILE REMOVE="'.concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshRemove"}),this.closeDialog()}closeDialog(){this.$emit("close")}};mi([Ke({type:Boolean,required:!0})],wr.prototype,"show",2);mi([Ke({type:String,required:!0})],wr.prototype,"name",2);wr=mi([vt],wr);var qo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(fi,{attrs:{value:e.show,persistent:"","max-width":400},on:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[r(Wt,{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(Pe,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[r(gt,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(ft,[r("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Heightmap.DoYouReallyWantToDelete",{name:e.name})))])]),r(di,[r(vi),r(Pe,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Pe,{attrs:{color:"error",text:""},on:{click:e.removeProfile}},[e._v(e._s(e.$t("Heightmap.Remove")))])],1)],1)],1)},Yo=[];const Ui={};var Zo=St(wr,qo,Yo,!1,Ko,null,null,null);function Ko(e){for(let t in Ui)this[t]=Ui[t]}const Za=function(){return Zo.exports}();var Qo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,pi=(e,t,r,n)=>{for(var i=n>1?void 0:n?Jo(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&Qo(t,r,i),i};let br=class extends Et(At){constructor(){super(...arguments),this.mdiDelete=$s,this.mdiPencil=Ga,this.mdiProgressUpload=js,this.showRemove=!1,this.showRename=!1}get points(){const e=[];for(let t=0;t{for(var i=n>1?void 0:n?al(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&il(t,r,i),i};let Yn=class extends Et(At){constructor(){super(...arguments),this.mdiStackOverflow=qs}get profiles(){var e,t;return(t=(e=this.$store.state.printer.bed_mesh)==null?void 0:e.profiles)!=null?t:{}}};Yn=sl([vt({components:{HeightmapProfilesPanelRow:Ka}})],Yn);var ol=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(Wt,{staticClass:"mt-6 mt-md-0",attrs:{title:e.$t("Heightmap.Profiles"),"card-class":"heightmap-profiles-panel",icon:e.mdiStackOverflow,collapsible:!0}},[Object.keys(e.profiles).length?r(ft,{staticClass:"px-0 py-3"},[e._l(e.profiles,function(n,i,a){return[a?r(nr,{key:"deliver_".concat(i),staticClass:"my-3"}):e._e(),r(Ka,{key:"profile_".concat(i),attrs:{profile:n,name:i}})]})],2):r(ft,[r("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Heightmap.NoProfile")))])])],1)},ll=[];const zi={};var cl=St(Yn,ol,ll,!1,ul,null,null,null);function ul(e){for(let t in zi)this[t]=zi[t]}const hl=function(){return cl.exports}();var fl=Object.defineProperty,dl=Object.getOwnPropertyDescriptor,vl=(e,t,r,n)=>{for(var i=n>1?void 0:n?dl(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&fl(t,r,i),i};let Cr=class extends eo{get bed_mesh(){var e;return(e=this.$store.state.printer.bed_mesh)!=null?e:{}}get profiles(){var e;return(e=this.bed_mesh.profiles)!=null?e:{}}get mesh_min(){var e;return(e=this.bed_mesh.mesh_min)!=null?e:[0,0]}get mesh_max(){var e;return(e=this.bed_mesh.mesh_max)!=null?e:[0,0]}get min(){return Math.min(...this.points)}get max(){return Math.max(...this.points)}get variance(){return Math.abs(this.min-this.max).toFixed(3)}get is_active(){return this.bed_mesh.profile_name!==""?!0:this.mesh_min[0]!==0||this.mesh_min[1]!==0||this.mesh_max[0]!==0||this.mesh_max[1]!==0}get name(){return this.bed_mesh.profile_name!==""?this.bed_mesh.profile_name:"Unknown"}get probed_matrix(){var e;return(e=this.bed_mesh.probed_matrix)!=null?e:[]}get points(){const e=[];for(let t=0;t{for(var i=n>1?void 0:n?ml(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&_l(t,r,i),i};let Zn=class extends Et(At,Cr){constructor(){super(...arguments),this.mdiInformation=Ys,this.mdiPencil=Ga,this.showRename=!1}get x_count(){var e,t;return(t=(e=this.bed_mesh.probed_matrix[0])==null?void 0:e.length)!=null?t:0}get y_count(){var e,t;return(t=(e=this.bed_mesh.probed_matrix)==null?void 0:e.length)!=null?t:0}get x_step_size(){return this.x_count<1?0:(this.mesh_max[0]-this.mesh_min[0])/(this.x_count-1)}get y_step_size(){return this.y_count<1?0:(this.mesh_max[1]-this.mesh_min[1])/(this.y_count-1)}get index_max(){return this.points.indexOf(this.max)}get index_max_y(){return Math.trunc(this.index_max/this.x_count)}get index_max_x(){return this.index_max%this.y_count}get position_max_x(){return this.mesh_min[0]+this.index_max_x*this.x_step_size}get position_max_y(){return this.mesh_min[1]+this.index_max_y*this.y_step_size}get index_min(){return this.points.indexOf(this.min)}get index_min_y(){return Math.trunc(this.index_min/this.x_count)}get index_min_x(){return this.index_min%this.y_count}get position_min_x(){return this.mesh_min[0]+this.index_min_x*this.x_step_size}get position_min_y(){return this.mesh_min[1]+this.index_min_y*this.y_step_size}};Zn=pl([vt({components:{}})],Zn);var gl=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.is_active?r(Wt,{staticClass:"mt-0",attrs:{title:e.$t("Heightmap.CurrentMesh.Headline"),"card-class":"heightmap-current-mesh-panel",icon:e.mdiInformation,collapsible:!0}},[r(ft,{staticClass:"py-3 px-0"},[r(ht,{staticClass:"px-3"},[r(we,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Name")))]),r(we,{staticClass:"text-right"},[e.name.startsWith("adaptive-")?r("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.name))]):r("span",{staticClass:"currentMeshName cursor-pointer font-weight-bold",on:{click:function(n){e.showRename=!0}}},[r(gt,{attrs:{left:"",small:"",color:"primary"}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.name)+" ")],1)])],1),r(nr,{staticClass:"my-3"}),r(ht,{staticClass:"px-3"},[r(we,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Size")))]),r(we,{staticClass:"text-right"},[e._v(e._s(e.x_count)+"x"+e._s(e.y_count))])],1),r(nr,{staticClass:"my-3"}),e.index_max>-1?r(ht,{staticClass:"px-3"},[r(we,[e._v(" "+e._s(e.$t("Heightmap.CurrentMesh.Max"))+" ["+e._s(e.position_max_x.toFixed(1))+", "+e._s(e.position_max_y.toFixed(1))+"] ")]),r(we,{staticClass:"text-right"},[e._v(e._s(e.max.toFixed(3))+" mm")])],1):e._e(),r(nr,{staticClass:"my-3"}),r(ht,{staticClass:"px-3"},[r(we,[e._v(" "+e._s(e.$t("Heightmap.CurrentMesh.Min"))+" ["+e._s(e.position_min_x.toFixed(1))+", "+e._s(e.position_min_y.toFixed(1))+"] ")]),r(we,{staticClass:"text-right"},[e._v(e._s(e.min.toFixed(3))+" mm")])],1),r(nr,{staticClass:"my-3"}),r(ht,{staticClass:"px-3"},[r(we,[e._v(e._s(e.$t("Heightmap.CurrentMesh.Range")))]),r(we,{staticClass:"text-right"},[e._v(e._s(e.variance)+" mm")])],1)],1),r(_i,{attrs:{show:e.showRename,name:e.name},on:{close:function(n){e.showRename=!1}}})],1):e._e()},xl=[];const Gi={};var yl=St(Zn,gl,xl,!1,Tl,"a3cfb25c",null,null);function Tl(e){for(let t in Gi)this[t]=Gi[t]}const El=function(){return yl.exports}();var Al=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,gi=(e,t,r,n)=>{for(var i=n>1?void 0:n?Sl(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&Al(t,r,i),i};let Rr=class extends Et(At){constructor(){super(...arguments),this.mdiCloseThick=hi,this.mdiGrid=vn,this.isInvalidName=!1,this.name="",this.rules=[e=>!!e||this.$t("Heightmap.InvalidNameEmpty"),e=>e===e.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")]}calibrateMesh(){const e='BED_MESH_CALIBRATE PROFILE="'.concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshCalibrate"}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(){this.show&&(this.name="default",this.$nextTick(()=>{setTimeout(()=>{var e;(e=this.$refs.input)==null||e.focus()},100)}))}};gi([Ke({type:Boolean,required:!0})],Rr.prototype,"show",2);gi([za("show")],Rr.prototype,"showChanged",1);Rr=gi([vt],Rr);var wl=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(fi,{attrs:{value:e.show,persistent:"","max-width":400},on:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[r(Wt,{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(Pe,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[r(gt,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[r(ft,[r(Va,{ref:"input",attrs:{label:e.$t("Heightmap.Name"),required:"",rules:e.rules},on:{"update:error":function(n){e.isInvalidName=n},keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.calibrateMesh.apply(null,arguments)}},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),r(di,[r(vi),r(Pe,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Heightmap.Abort")))]),r(Pe,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.calibrateMesh}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])],1)],1)],1)},bl=[];const Vi={};var Cl=St(Rr,wl,bl,!1,Rl,null,null,null);function Rl(e){for(let t in Vi)this[t]=Vi[t]}const Qa=function(){return Cl.exports}();var Ml=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Nl=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ll(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&Ml(t,r,i),i};let Kn=class extends Et(At,Zs,Cr){constructor(){super(...arguments),this.mdiGrid=vn,this.mdiHome=Ks,this.calibrateDialog=!1}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 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 heightmapRangeLimit(){const e=Math.round(Math.max(Math.abs(this.min),Math.abs(this.max))*10)/10,t=Math.max(e,1);return[e,t]}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"})}};Kn=Nl([vt({components:{HeightmapCalibrateMeshDialog:Qa}})],Kn);function ki(e,t,r){typeof t=="object"&&(r=t,t=null);var n=this,i;if(!(e instanceof Function)){i=[];for(var a in e)e.hasOwnProperty(a)&&i.push(a)}var s=function(l){if(n.apply(this,arguments),e instanceof Function?Wi(this,e.call(this,l)):Pl(this,e,i),this.constructor===s)for(var c=s.__initializers__,u=0;u=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}const Gl={get:zl};var An,Xe={};Xe.supportWebGL=function(){if(An==null)try{var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)throw new Error}catch{An=!1}return An};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 zt={};typeof window<"u"?zt=window:typeof global<"u"&&(zt=global);Xe.requestAnimationFrame=zt.requestAnimationFrame||zt.msRequestAnimationFrame||zt.mozRequestAnimationFrame||zt.webkitRequestAnimationFrame||function(e){setTimeout(e,16)};Xe.createCanvas=function(){return document.createElement("canvas")};Xe.createImage=function(){return new zt.Image};Xe.request={get:Gl.get};Xe.addEventListener=function(e,t,r,n){e.addEventListener(t,r,n)};Xe.removeEventListener=function(e,t,r){e.removeEventListener(t,r)};const Se=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,n=0;r&&n!=e;)r=r.next,n++;if(r){var i=new Le.Entry(t),a=r.prev;a?(a.next=i,i.prev=a):this.head=i,i.next=r,r.prev=i}else this.insert(t)}};Le.prototype.insertBeforeEntry=function(e,t){var r=new Le.Entry(e),n=t.prev;n?(n.next=r,r.prev=n):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,n=0,i=typeof t<"u";r;)i?e.call(t,r.value,n):e(r.value,n),r=r.next,n++};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 Vl=Le;var hr=function(e){this._list=new Vl,this._map={},this._maxSize=e||10};hr.prototype.setMaxSize=function(e){this._maxSize=e};hr.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var r=this._list.length();if(r>=this._maxSize&&r>0){var n=this._list.head;this._list.remove(n),delete this._map[n.key]}var i=this._list.insert(t);i.key=e,this._map[e]=i}};hr.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};hr.prototype.remove=function(e){var t=this._map[e];typeof t<"u"&&(delete this._map[e],this._list.remove(t))};hr.prototype.clear=function(){this._list.clear(),this._map={}};const Ja=hr;var me={},ji={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 st(e){return e=Math.round(e),e<0?0:e>255?255:e}function kl(e){return e=Math.round(e),e<0?0:e>360?360:e}function Mr(e){return e<0?0:e>1?1:e}function Sn(e){return e.length&&e.charAt(e.length-1)==="%"?st(parseFloat(e)/100*255):st(parseInt(e,10))}function or(e){return e.length&&e.charAt(e.length-1)==="%"?Mr(parseFloat(e)/100):Mr(parseFloat(e))}function wn(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 Lt(e,t,r){return e+(t-e)*r}function at(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function Qn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var es=new Ja(20),Gr=null;function Yt(e,t){Gr&&Qn(Gr,t),Gr=es.put(e,Gr||t.slice())}me.parse=function(e,t){if(e){t=t||[];var r=es.get(e);if(r)return Qn(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in ji)return Qn(t,ji[n]),Yt(e,t),t;if(n.charAt(0)==="#"){if(n.length===4){var i=parseInt(n.substr(1),16);if(!(i>=0&&i<=4095)){at(t,0,0,0,1);return}return at(t,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,1),Yt(e,t),t}else if(n.length===7){var i=parseInt(n.substr(1),16);if(!(i>=0&&i<=16777215)){at(t,0,0,0,1);return}return at(t,(i&16711680)>>16,(i&65280)>>8,i&255,1),Yt(e,t),t}return}var a=n.indexOf("("),s=n.indexOf(")");if(a!==-1&&s+1===n.length){var o=n.substr(0,a),l=n.substr(a+1,s-(a+1)).split(","),c=1;switch(o){case"rgba":if(l.length!==4){at(t,0,0,0,1);return}c=or(l.pop());case"rgb":if(l.length!==3){at(t,0,0,0,1);return}return at(t,Sn(l[0]),Sn(l[1]),Sn(l[2]),c),Yt(e,t),t;case"hsla":if(l.length!==4){at(t,0,0,0,1);return}return l[3]=or(l[3]),Jn(l,t),Yt(e,t),t;case"hsl":if(l.length!==3){at(t,0,0,0,1);return}return Jn(l,t),Yt(e,t),t;default:return}}at(t,0,0,0,1)}};me.parseToFloat=function(e,t){if(t=me.parse(e,t),!!t)return t[0]/=255,t[1]/=255,t[2]/=255,t};function Jn(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=or(e[1]),i=or(e[2]),a=i<=.5?i*(n+1):i+n-i*n,s=i*2-a;return t=t||[],at(t,st(wn(s,a,r+1/3)*255),st(wn(s,a,r)*255),st(wn(s,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Wl(e){if(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=a-i,o=(a+i)/2,l,c;if(s===0)l=0,c=0;else{o<.5?c=s/(a+i):c=s/(2-a-i);var u=((a-t)/6+s/2)/s,h=((a-r)/6+s/2)/s,d=((a-n)/6+s/2)/s;t===a?l=d-h:r===a?l=1/3+u-d:n===a&&(l=2/3+h-u),l<0&&(l+=1),l>1&&(l-=1)}var f=[l*360,c,o];return e[3]!=null&&f.push(e[3]),f}}me.lift=function(e,t){var r=me.parse(e);if(r){for(var n=0;n<3;n++)t<0?r[n]=r[n]*(1-t)|0:r[n]=(255-r[n])*t+r[n]|0;return me.stringify(r,r.length===4?"rgba":"rgb")}};me.toHex=function(e){var t=me.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)};me.fastLerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),s=t[i],o=t[a],l=n-i;return r[0]=st(Lt(s[0],o[0],l)),r[1]=st(Lt(s[1],o[1],l)),r[2]=st(Lt(s[2],o[2],l)),r[3]=Mr(Lt(s[3],o[3],l)),r}};me.fastMapToColor=me.fastLerp;me.lerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),s=me.parse(t[i]),o=me.parse(t[a]),l=n-i,c=me.stringify([st(Lt(s[0],o[0],l)),st(Lt(s[1],o[1],l)),st(Lt(s[2],o[2],l)),Mr(Lt(s[3],o[3],l))],"rgba");return r?{color:c,leftIndex:i,rightIndex:a,value:n}:c}};me.mapToColor=me.lerp;me.modifyHSL=function(e,t,r,n){if(e=me.parse(e),e)return e=Wl(e),t!=null&&(e[0]=kl(t)),r!=null&&(e[1]=or(r)),n!=null&&(e[2]=or(n)),me.stringify(Jn(e),"rgba")};me.modifyAlpha=function(e,t){if(e=me.parse(e),e&&t!=null)return e[3]=Mr(t),me.stringify(e,"rgba")};me.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 Xl=me;var $l=Xl.parseToFloat,bn={};function qi(e){var t=Object.keys(e);t.sort();for(var r=[],n=0;n=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 n=e[r];this.setUniform(r,n)}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 n=this.uniforms;this._enabledUniforms=Object.keys(n),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(c){var u=this.uniforms[c].type;return u==="t"||u==="tv"},this);var i=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=De.clone(e.vertexDefines),this.fragmentDefines=De.clone(e.fragmentDefines),t){for(var s in r)n[s]&&(n[s].value=r[s].value);De.defaults(this.vertexDefines,i),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 n=this.vertexDefines,i=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")&&n[t]!==r&&(n[t]=r,this._programKey=""),(e==="fragment"||e==="both")&&i[t]!==r&&(i[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&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e};Z.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]};Z.cross=function(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e};Z.lerp=function(e,t,r,n){var i=t[0],a=t[1];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e};Z.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};Z.transformMat2=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e};Z.transformMat2d=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e};Z.transformMat3=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e};Z.transformMat4=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e};Z.forEach=function(){var e=Z.create();return function(t,r,n,i,a,s){var o,l;for(r||(r=2),n||(n=0),i?l=Math.min(i*r+n,t.length):l=t.length,o=n;o0&&n.push("#define "+i.toUpperCase()+"_COUNT "+a)}if(r)for(var s=0;sl.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),h+="\n"+Rn(d)+"\n"}a&&(h+="\n#define INSTANCING\n");var f=h+Rn(t.vertexDefines,o,u),v=h+Rn(t.fragmentDefines,o,u),_=f+"\n"+t.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(S){return l.getGLExtension(S)!=null});m.indexOf("EXT_shader_texture_lod")>=0&&(v+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(v+="\n#define SUPPORT_STANDARD_DERIVATIVES");var p=Jl(m)+"\n"+ec(t.precision)+"\n"+v+"\n"+t.shader.fragment,y=ta(_,t.vertexDefines,o),g=ta(p,t.fragmentDefines,o),x=new Kl;x.uniformSemantics=t.shader.uniformSemantics,x.attributes=t.shader.attributes;var E=x.buildProgram(c,t.shader,y,g);return x.__error=E,n[s]=x,x};var ra=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,tc=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,na=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,rc={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!==u){Zt();break}d=l,v=[];continue}else if(d===o){e==="bool"?f[_].value=p==="true":f[_].value=parseFloat(p),v=null;continue}else if(d===u){var y=p;ei.indexOf(y)>=0||rs.indexOf(y)>=0||ns.indexOf(y)>=0?f[_].semantic=y:y==="ignore"||y==="unconfigurable"?f[_].ignore=!0:e==="bool"?f[_].value=y==="true":f[_].value=parseFloat(y);continue}m(p),d=s}}return f}function L(e,t){typeof e=="object"&&(t=e.fragment,e=e.vertex),e=aa(e),t=aa(t),this._shaderID=ic(e,t),this._vertexCode=L.parseImport(e),this._fragmentCode=L.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()}L.prototype={constructor:L,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=L.parseImport(this.vertex),this._fragmentCode=L.parseImport(this.fragment)},_addSemanticUniform:function(e,t,r){if(ei.indexOf(r)>=0)this.attributeSemantics[r]={symbol:e,type:t};else if(ns.indexOf(r)>=0){var n=!1,i=r;r.match(/TRANSPOSE$/)&&(n=!0,i=r.slice(0,-9)),this.matrixSemantics[r]={symbol:e,type:t,isTranspose:n,semanticNoTranspose:i}}else rs.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:e,type:t})},_addMaterialUniform:function(e,t,r,n,i,a){a[e]={type:r,value:i?ia.array:n||ia[t],semantic:null}},_parseUniforms:function(){var e={},t=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(ra,i),r="fragment",this._fragmentCode=this._fragmentCode.replace(ra,i),t.matrixSemanticKeys=Object.keys(this.matrixSemantics);function n(a){return a!=null?function(){return a}:null}function i(a,s,o){var l=sa(s,o),c=[];for(var u in l){var h=l[u],d=h.semantic,f=u,v=rc[s],_=n(l[u].value);l[u].isArray&&(f+="["+l[u].arraySize+"]",v+="v"),c.push(f),t._uniformList.push(u),h.ignore||((s==="sampler2D"||s==="samplerCube")&&(t.textures[u]={shaderType:r,type:s}),d?t._addSemanticUniform(u,v,d):t._addMaterialUniform(u,s,v,_,l[u].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(tc,r);function r(n,i,a){var s=sa(i,a),o=nc[i]||1,l=[];for(var c in s){var u=s[c].semantic;if(e[c]={type:"float",size:o,semantic:u||null},u){if(ei.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:c,type:i}}l.push(c)}return"attribute "+i+" "+l.join(",")+";\n"}this.attributes=e},_parseDefines:function(){var e=this,t="vertex";this._vertexCode=this._vertexCode.replace(na,r),t="fragment",this._fragmentCode=this._fragmentCode.replace(na,r);function r(n,i,a){var s=t==="vertex"?e.vertexDefines:e.fragmentDefines;return s[i]||(a==="false"?s[i]=!1:a==="true"?s[i]=!0:s[i]=a?isNaN(parseFloat(a))?a.trim():parseFloat(a):null),""}},clone:function(){var e=is[this._shaderID],t=new L(e.vertex,e.fragment);return t}};Object.defineProperty&&(Object.defineProperty(L.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(L.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(L.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(L.prototype,"uniforms",{get:function(){return this._uniformList}}));var ac=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;L.parseImport=function(e){return e=e.replace(ac,function(i,r,n){var i=L.source(n);return i?L.parseImport(i):(console.error('Shader chunk "'+n+'" not existed in library'),"")}),e};var sc=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;L.import=function(e){e.replace(sc,function(t,r,n,a){var a=a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(a){for(var s=n.split("."),o=L.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 n=t[0],i=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=i*l-a*o,e[1]=a*s-n*l,e[2]=n*o-i*s,e};X.lerp=function(e,t,r,n){var i=t[0],a=t[1],s=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=s+n*(r[2]-s),e};X.random=function(e,t){t=t||1;var r=ir()*2*Math.PI,n=ir()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e};X.transformMat4=function(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[3]*n+r[7]*i+r[11]*a+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/s,e};X.transformMat3=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e};X.transformQuat=function(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[0],o=r[1],l=r[2],c=r[3],u=c*n+o*a-l*i,h=c*i+l*n-s*a,d=c*a+s*i-o*n,f=-s*n-o*i-l*a;return e[0]=u*c+f*-s+h*-l-d*-o,e[1]=h*c+f*-o+d*-s-u*-l,e[2]=d*c+f*-l+u*-o-h*-s,e};X.rotateX=function(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),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,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),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,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[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,n,i,a,s){var o,l;for(r||(r=3),n||(n=0),i?l=Math.min(i*r+n,t.length):l=t.length,o=n;o1?0:Math.acos(i)};const T=X;L.import(as);var de=C.create,oa={};function la(e){return e.material}function oc(e,t,r){return t.uniforms[r].value}function lc(e,t,r,n){return r!==n}function cc(e){return!0}function ca(){}var ua={float:A.FLOAT,byte:A.BYTE,ubyte:A.UNSIGNED_BYTE,short:A.SHORT,ushort:A.UNSIGNED_SHORT};function uc(e,t,r){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=r,this.vao=null}function hc(e){var t,r;this.bind=function(n){t||(t=Se.createCanvas(),t.width=t.height=1,t.getContext("2d"));var i=n.gl,a=!r;a&&(r=i.createTexture()),i.bindTexture(i.TEXTURE_2D,r),a&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t)},this.unbind=function(n){n.gl.bindTexture(n.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var Nt=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=Se.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 Hl(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 ts(this),this._placeholderTexture=new hc},{resize:function(e,t){var r=this.canvas,n=this.devicePixelRatio;e!=null?(r.style&&(r.style.width=e+"px",r.style.height=t+"px"),r.width=e*n,r.height=t*n,this._width=e,this._height=t):(this._width=r.width/n,this._height=r.height/n),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,n,i){if(typeof e=="object"){var a=e;e=a.x,t=a.y,r=a.width,n=a.height,i=a.devicePixelRatio}i=i||this.devicePixelRatio,this.gl.viewport(e*i,t*i,r*i,n*i),this.viewport={x:e,y:t,width:r,height:n,devicePixelRatio:i}},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,n){var i=this.gl,a=this.clearColor;if(this.clearBit){i.colorMask(!0,!0,!0,!0),i.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,i.enable(i.SCISSOR_TEST),i.scissor(s.x*l,s.y*l,s.width*l,s.height*l)),i.clearColor(a[0],a[1],a[2],a[3]),i.clear(this.clearBit),o&&i.disable(i.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 u=c.opaque,h=c.transparent,d=e.material;e.trigger("beforerender",this,e,t,c),n?(this.renderPreZ(u,e,t),i.depthFunc(i.LEQUAL)):i.depthFunc(i.LESS);for(var f=de(),v=T.create(),_=0;_0){var o=e[i-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 u=this._programMgr.getProgram(a,s,t);this.validateProgram(u),a.__program=u}},renderPass:function(e,t,r){this.trigger("beforerenderpass",this,e,t,r),r=r||{},r.getMaterial=r.getMaterial||la,r.getUniform=r.getUniform||oc,r.isMaterialChanged=r.isMaterialChanged||lc,r.beforeRender=r.beforeRender||ca,r.afterRender=r.afterRender||ca;var n=r.ifRender||cc;this.updatePrograms(e,this._sceneRendering,r),r.sortCompare&&e.sort(r.sortCompare);var i=this.viewport,a=i.devicePixelRatio,s=[i.x*a,i.y*a,i.width*a,i.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]],u=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 h=this.gl,d=this._sceneRendering,f,v,_,m,p,y,g,x,E,S,R,w,M=null,F=0;Fthis.getMaxJointNumber()){var a=i.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,r),t.setUniform(n,"1i","skinMatricesTexture",r),t.setUniform(n,"1f","skinMatricesTextureSize",a.width)}else{var s=i.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(n,"SKIN_MATRIX",s)}},_renderObject:function(e,t,r){var n=this.gl,i=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"),u=c&&i.indices instanceof Uint32Array,h=u?n.UNSIGNED_INT:n.UNSIGNED_SHORT;o?s.drawElementsInstancedANGLE(a,t.indicesBuffer.count,h,0,e.getInstanceCount()):n.drawElements(a,t.indicesBuffer.count,h,0)}else o?s.drawArraysInstancedANGLE(a,0,i.vertexCount,e.getInstanceCount()):n.drawArrays(a,0,i.vertexCount);if(o)for(var d=0;dr?r:e}var oe=Math.atan2,tt=Math.asin,Kt=Math.abs;W.eulerFromQuat=function(e,t,d){e._dirty=!0,t=t.array;var n=e.array,i=t[0],a=t[1],s=t[2],o=t[3],l=i*i,c=a*a,u=s*s,h=o*o,d=(d||"XYZ").toUpperCase();switch(d){case"XYZ":n[0]=oe(2*(i*o-a*s),h-l-c+u),n[1]=tt(et(2*(i*s+a*o),-1,1)),n[2]=oe(2*(s*o-i*a),h+l-c-u);break;case"YXZ":n[0]=tt(et(2*(i*o-a*s),-1,1)),n[1]=oe(2*(i*s+a*o),h-l-c+u),n[2]=oe(2*(i*a+s*o),h-l+c-u);break;case"ZXY":n[0]=tt(et(2*(i*o+a*s),-1,1)),n[1]=oe(2*(a*o-s*i),h-l-c+u),n[2]=oe(2*(s*o-i*a),h-l+c-u);break;case"ZYX":n[0]=oe(2*(i*o+s*a),h-l-c+u),n[1]=tt(et(2*(a*o-i*s),-1,1)),n[2]=oe(2*(i*a+s*o),h+l-c-u);break;case"YZX":n[0]=oe(2*(i*o-s*a),h-l+c-u),n[1]=oe(2*(a*o-i*s),h+l-c-u),n[2]=tt(et(2*(i*a+s*o),-1,1));break;case"XZY":n[0]=oe(2*(i*o+a*s),h-l+c-u),n[1]=oe(2*(i*s+a*o),h+l-c-u),n[2]=tt(et(2*(s*o-i*a),-1,1));break;default:console.warn("Unkown order: "+d)}return e};W.eulerFromMat3=function(e,t,v){var n=t.array,i=n[0],a=n[3],s=n[6],o=n[1],l=n[4],c=n[7],u=n[2],h=n[5],d=n[8],f=e.array,v=(v||"XYZ").toUpperCase();switch(v){case"XYZ":f[1]=tt(et(s,-1,1)),Kt(s)<.99999?(f[0]=oe(-c,d),f[2]=oe(-a,i)):(f[0]=oe(h,l),f[2]=0);break;case"YXZ":f[0]=tt(-et(c,-1,1)),Kt(c)<.99999?(f[1]=oe(s,d),f[2]=oe(o,l)):(f[1]=oe(-u,i),f[2]=0);break;case"ZXY":f[0]=tt(et(h,-1,1)),Kt(h)<.99999?(f[1]=oe(-u,d),f[2]=oe(-a,l)):(f[1]=0,f[2]=oe(o,i));break;case"ZYX":f[1]=tt(-et(u,-1,1)),Kt(u)<.99999?(f[0]=oe(h,d),f[2]=oe(o,i)):(f[0]=0,f[2]=oe(-a,l));break;case"YZX":f[2]=tt(et(o,-1,1)),Kt(o)<.99999?(f[0]=oe(-c,l),f[1]=oe(-u,i)):(f[0]=0,f[1]=oe(s,d));break;case"XZY":f[2]=tt(-et(a,-1,1)),Kt(a)<.99999?(f[0]=oe(h,l),f[1]=oe(s,i)):(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 Nn=1e-5,Jr=function(e,t){this.origin=e||new P,this.direction=t||new P};Jr.prototype={constructor:Jr,intersectPlane:function(e,t){var r=e.normal.array,n=e.distance,i=this.origin.array,a=this.direction.array,s=T.dot(r,a);if(s===0)return null;t||(t=new P);var o=(T.dot(r,i)-n)/s;return T.scaleAndAdd(t.array,i,a,-o),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=T.dot(e.normal.array,this.direction.array);T.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,-t*2),this.direction._dirty=!0},distanceToPoint:function(){var e=T.create();return function(t){T.sub(e,t,this.origin.array);var r=T.dot(e,this.direction.array);if(r<0)return T.distance(this.origin.array,t);var n=T.lenSquared(e);return Math.sqrt(n-r*r)}}(),intersectSphere:function(){var e=T.create();return function(t,r,n){var i=this.origin.array,a=this.direction.array;t=t.array,T.sub(e,t,i);var s=T.dot(e,a),o=T.squaredLength(e),l=o-s*s,c=r*r;if(!(l>c)){var u=Math.sqrt(c-l),h=s-u,d=s+u;return n||(n=new P),h<0?d<0?null:(T.scaleAndAdd(n.array,i,a,d),n):(T.scaleAndAdd(n.array,i,a,h),n)}}}(),intersectBoundingBox:function(e,t){var r=this.direction.array,n=this.origin.array,i=e.min.array,a=e.max.array,s=1/r[0],o=1/r[1],l=1/r[2],c,u,h,d,f,v;if(s>=0?(c=(i[0]-n[0])*s,u=(a[0]-n[0])*s):(u=(i[0]-n[0])*s,c=(a[0]-n[0])*s),o>=0?(h=(i[1]-n[1])*o,d=(a[1]-n[1])*o):(d=(i[1]-n[1])*o,h=(a[1]-n[1])*o),c>d||h>u||((h>c||c!==c)&&(c=h),(d=0?(f=(i[2]-n[2])*l,v=(a[2]-n[2])*l):(v=(i[2]-n[2])*l,f=(a[2]-n[2])*l),c>v||f>u)||((f>c||c!==c)&&(c=f),(v=0?c:u;return t||(t=new P),T.scaleAndAdd(t.array,n,r,_),t},intersectTriangle:function(){var e=T.create(),t=T.create(),r=T.create(),n=T.create();return function(i,a,s,o,l,c){var u=this.direction.array,h=this.origin.array;i=i.array,a=a.array,s=s.array,T.sub(e,a,i),T.sub(t,s,i),T.cross(n,t,u);var d=T.dot(e,n);if(o){if(d>-Nn)return null}else if(d>-Nn&&d1)return null;T.cross(n,e,r);var v=T.dot(u,n)/d;if(v<0||v>1||f+v>1)return null;T.cross(n,e,t);var _=-T.dot(r,n)/d;return _<0?null:(l||(l=new P),c&&P.set(c,1-f-v,f,v),T.scaleAndAdd(l.array,h,u,_),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 Jr;return e.copy(this),e}};const sn=Jr;var K={};K.create=function(){var e=new Oe(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e};K.clone=function(e){var t=new Oe(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,n){var i=new Oe(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i};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,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,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,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e};K.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)};K.dist=K.distance;K.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a};K.sqrDist=K.squaredDistance;K.length=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)};K.len=K.length;K.squaredLength=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i};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],n=t[1],i=t[2],a=t[3],s=r*r+n*n+i*i+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,n){var i=t[0],a=t[1],s=t[2],o=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=s+n*(r[2]-s),e[3]=o+n*(r[3]-o),e};K.random=function(e,t){return t=t||1,e[0]=ir(),e[1]=ir(),e[2]=ir(),e[3]=ir(),K.normalize(e,e),K.scale(e,e,t),e};K.transformMat4=function(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*s,e};K.transformQuat=function(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[0],o=r[1],l=r[2],c=r[3],u=c*n+o*a-l*i,h=c*i+l*n-s*a,d=c*a+s*i-o*n,f=-s*n-o*i-l*a;return e[0]=u*c+f*-s+h*-l-d*-o,e[1]=h*c+f*-o+d*-s-u*-l,e[2]=d*c+f*-l+u*-o-h*-s,e};K.forEach=function(){var e=K.create();return function(t,r,n,i,a,s){var o,l;for(r||(r=4),n||(n=0),i?l=Math.min(i*r+n,t.length):l=t.length,o=n;o.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(T.cross(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,ne.normalize(n,n))}}();ne.setAxes=function(){var e=ee.create();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],ne.normalize(t,ne.fromMat3(t,e))}}();ne.clone=D.clone;ne.fromValues=D.fromValues;ne.copy=D.copy;ne.set=D.set;ne.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e};ne.setAxisAngle=function(e,t,r){r=r*.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e};ne.add=D.add;ne.multiply=function(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3],o=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+s*o+i*c-a*l,e[1]=i*u+s*l+a*o-n*c,e[2]=a*u+s*c+n*l-i*o,e[3]=s*u-n*o-i*l-a*c,e};ne.mul=ne.multiply;ne.scale=D.scale;ne.rotateX=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l+s*o,e[1]=i*l+a*o,e[2]=a*l-i*o,e[3]=s*l-n*o,e};ne.rotateY=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l-a*o,e[1]=i*l+s*o,e[2]=a*l+n*o,e[3]=s*l-i*o,e};ne.rotateZ=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*o,e[1]=i*l-n*o,e[2]=a*l+s*o,e[3]=s*l-a*o,e};ne.calculateW=function(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e};ne.dot=D.dot;ne.lerp=D.lerp;ne.slerp=function(e,t,r,n){var i=t[0],a=t[1],s=t[2],o=t[3],l=r[0],c=r[1],u=r[2],h=r[3],d,f,v,_,m;return f=i*l+a*c+s*u+o*h,f<0&&(f=-f,l=-l,c=-c,u=-u,h=-h),1-f>1e-6?(d=Math.acos(f),v=Math.sin(d),_=Math.sin((1-n)*d)/v,m=Math.sin(n*d)/v):(_=1-n,m=n),e[0]=_*i+m*l,e[1]=_*a+m*c,e[2]=_*s+m*u,e[3]=_*o+m*h,e};ne.invert=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],s=r*r+n*n+i*i+a*a,o=s?1/s:0;return e[0]=-r*o,e[1]=-n*o,e[2]=-i*o,e[3]=a*o,e};ne.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e};ne.length=D.length;ne.len=ne.length;ne.squaredLength=D.squaredLength;ne.sqrLen=ne.squaredLength;ne.normalize=D.normalize;ne.fromMat3=function(e,t){var r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+s]-t[s*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[s]=(t[s*3+i]+t[i*3+s])*n}return e};const j=ne;var ue=function(){this._axisX=new P,this._axisY=new P,this._axisZ=new P,this.array=C.create(),this._dirty=!0};ue.prototype={constructor:ue,setArray:function(e){for(var t=0;t0){var t=this.min,r=this.max,n=t.array,i=r.array;Xr(n,e[0]),Xr(i,e[0]);for(var a=1;ai[0]&&(i[0]=s[0]),s[1]>i[1]&&(i[1]=s[1]),s[2]>i[2]&&(i[2]=s[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return T.min(t.array,t.array,e.min.array),T.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 T.max(t.array,t.array,e.min.array),T.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,n=e.min.array,i=e.max.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]},containPoint:function(e){var t=this.min.array,r=this.max.array,n=e.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]},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=T.create(),t=T.create(),r=T.create(),n=T.create(),i=T.create(),a=T.create();return function(s,o){var l=s.min.array,c=s.max.array,u=o.array;return e[0]=u[0]*l[0],e[1]=u[1]*l[0],e[2]=u[2]*l[0],t[0]=u[0]*c[0],t[1]=u[1]*c[0],t[2]=u[2]*c[0],r[0]=u[4]*l[1],r[1]=u[5]*l[1],r[2]=u[6]*l[1],n[0]=u[4]*c[1],n[1]=u[5]*c[1],n[2]=u[6]*c[1],i[0]=u[8]*l[2],i[1]=u[9]*l[2],i[2]=u[10]*l[2],a[0]=u[8]*c[2],a[1]=u[9]*c[2],a[2]=u[10]*c[2],l=this.min.array,c=this.max.array,l[0]=Math.min(e[0],t[0])+Math.min(r[0],n[0])+Math.min(i[0],a[0])+u[12],l[1]=Math.min(e[1],t[1])+Math.min(r[1],n[1])+Math.min(i[1],a[1])+u[13],l[2]=Math.min(e[2],t[2])+Math.min(r[2],n[2])+Math.min(i[2],a[2])+u[14],c[0]=Math.max(e[0],t[0])+Math.max(r[0],n[0])+Math.max(i[0],a[0])+u[12],c[1]=Math.max(e[1],t[1])+Math.max(r[1],n[1])+Math.max(i[1],a[1])+u[13],c[2]=Math.max(e[2],t[2])+Math.max(r[2],n[2])+Math.max(i[2],a[2])+u[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(e){var t=this.min.array,r=this.max.array,n=e.array,i=t[0],a=t[1],s=t[2],o=r[0],l=r[1],c=t[2],u=r[0],h=r[1],d=r[2];if(n[15]===1)t[0]=n[0]*i+n[12],t[1]=n[5]*a+n[13],r[2]=n[10]*s+n[14],r[0]=n[0]*u+n[12],r[1]=n[5]*h+n[13],t[2]=n[10]*d+n[14];else{var f=-1/s;t[0]=n[0]*i*f,t[1]=n[5]*a*f,r[2]=(n[10]*s+n[14])*f,f=-1/c,r[0]=n[0]*o*f,r[1]=n[5]*l*f,f=-1/d,t[2]=(n[10]*d+n[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]=T.fromValues(0,0,0);this.vertices=e}var r=this.min.array,n=this.max.array;return Rt(e[0],r[0],r[1],r[2]),Rt(e[1],r[0],n[1],r[2]),Rt(e[2],n[0],r[1],r[2]),Rt(e[3],n[0],n[1],r[2]),Rt(e[4],r[0],r[1],n[2]),Rt(e[5],r[0],n[1],n[2]),Rt(e[6],n[0],r[1],n[2]),Rt(e[7],n[0],n[1],n[2]),this},copy:function(e){var t=this.min,r=this.max;return Xr(t.array,e.min.array),Xr(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new en;return e.copy(this),e}};const Ve=en;var fc=0,dc=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")+"_"+fc++),this.position||(this.position=new P),this.rotation||(this.rotation=new ss),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[g]>1e-4&&(T.transformMat4(w,x,p[S[g]]),T.scaleAndAdd(R,R,w,E[g]));M.set(y,R)}}for(var y=0;y>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 Je=ti.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=ti.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});Je.POINTS=A.POINTS;Je.LINES=A.LINES;Je.LINE_LOOP=A.LINE_LOOP;Je.LINE_STRIP=A.LINE_STRIP;Je.TRIANGLES=A.TRIANGLES;Je.TRIANGLE_STRIP=A.TRIANGLE_STRIP;Je.TRIANGLE_FAN=A.TRIANGLE_FAN;Je.BACK=A.BACK;Je.FRONT=A.FRONT;Je.FRONT_AND_BACK=A.FRONT_AND_BACK;Je.CW=A.CW;Je.CCW=A.CCW;const Ei=Je;var pn={};pn.isPowerOfTwo=function(e){return(e&e-1)===0};pn.nextPowerOfTwo=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e};pn.nearestPowerOfTwo=function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))};const os=pn;var ha=os.isPowerOfTwo;function fa(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function _c(e,t){var r=fa(e.width),n=fa(e.height);t=t||document.createElement("canvas"),t.width=r,t.height=n;var i=t.getContext("2d");return i.drawImage(e.image,0,0,r,n),t}var Ai=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,n=this.type,i=!!(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,i?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i?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),n===36193){var s=e.getGLExtension("OES_texture_half_float");s||(n=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,n,i,0,t.pixels):e.texImage2D(e.TEXTURE_2D,r,a,n,i,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 ha(this.width)&&ha(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=Se.createImage();t&&(r.crossOrigin=t);var n=this;return r.onload=function(){n.dirty(),n.trigger("success",n)},r.onerror=function(){n.trigger("error",n)},r.src=e,this.image=r,this}});Object.defineProperty(Ai.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(Ai.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 ie=Ai;function ls(e){return{byte:Se.Int8Array,ubyte:Se.Uint8Array,short:Se.Int16Array,ushort:Se.Uint16Array}[e]||Se.Float32Array}function Dn(e){return"attr_"+e}function lr(e,t,r,n){switch(this.name=e,this.type=t,this.size=r,this.semantic=n||"",this.value=null,r){case 1:this.get=function(i){return this.value[i]},this.set=function(i,a){this.value[i]=a},this.copy=function(i,a){this.value[i]=this.value[i]};break;case 2:this.get=function(i,a){var s=this.value;return a[0]=s[i*2],a[1]=s[i*2+1],a},this.set=function(i,a){var s=this.value;s[i*2]=a[0],s[i*2+1]=a[1]},this.copy=function(i,a){var s=this.value;a*=2,i*=2,s[i]=s[a],s[i+1]=s[a+1]};break;case 3:this.get=function(i,a){var s=i*3,o=this.value;return a[0]=o[s],a[1]=o[s+1],a[2]=o[s+2],a},this.set=function(i,a){var s=i*3,o=this.value;o[s]=a[0],o[s+1]=a[1],o[s+2]=a[2]},this.copy=function(i,a){var s=this.value;a*=3,i*=3,s[i]=s[a],s[i+1]=s[a+1],s[i+2]=s[a+2]};break;case 4:this.get=function(i,a){var s=this.value,o=i*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(i,a){var s=this.value,o=i*4;s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2],s[o+3]=a[3]},this.copy=function(i,a){var s=this.value;a*=4,i*=4,s[i]=s[a],s[i+1]=s[a+1],s[i+2]=s[a+2],s[i+3]=s[a+3]}}}lr.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=ls(this.type);this.value=new t(e*this.size)}};lr.prototype.fromArray=function(e){var t=ls(this.type),r;if(e[0]&&e[0].length){var n=0,i=this.size;r=new t(e.length*i);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?Se.Uint32Array:Se.Uint16Array;if(e[0]&&e[0].length){var n=0,i=3;t=new r(e.length*i);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=[],n=this.vertexCount,i=0;ia[0]&&(a[0]=o),l>a[1]&&(a[1]=l),c>a[2]&&(a[2]=c)}r._dirty=!0,n._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,r=t.position.value,n=t.normal.value;if(!n||n.length!==r.length)n=t.normal.value=new Se.Float32Array(r.length);else for(var i=0;i65535&&(this.indices=new Se.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,r=this.getEnabledAttributes(),n={},i=0;ithis.distance,i=1;i<8;i++)if(T.dot(t[i].array,r)>this.distance!=n)return!0},intersectLine:function(){var e=T.create();return function(t,r,n){var i=this.distanceToPoint(t),a=this.distanceToPoint(r);if(i>0&&a>0||i<0&&a<0)return null;var s=this.normal.array,o=this.distance,l=t.array;T.sub(e,r.array,t.array),T.normalize(e,e);var c=T.dot(s,e);if(c===0)return null;n||(n=new P);var u=(T.dot(s,l)-o)/c;return T.scaleAndAdd(n.array,l,e,-u),n._dirty=!0,n}}(),applyTransform:function(){var e=C.create(),t=D.create(),r=D.create();return r[3]=1,function(n){n=n.array,T.scale(r,this.normal.array,this.distance),D.transformMat4(r,r,n),this.distance=T.dot(r,this.normal.array),C.invert(e,n),C.transpose(e,e),t[3]=0,T.copy(t,this.normal.array),D.transformMat4(t,t,e),T.copy(this.normal.array,t)}}(),copy:function(e){T.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new tn;return e.copy(this),e}};const hs=tn;var Te=T.set,da=T.copy,va=T.transformMat4,On=Math.min,In=Math.max,fs=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new hs);this.boundingBox=new Ve,this.vertices=[];for(var e=0;e<8;e++)this.vertices[e]=T.fromValues(0,0,0)};fs.prototype={setFromProjection:function(e){var t=this.planes,r=e.array,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],l=r[5],c=r[6],u=r[7],h=r[8],d=r[9],f=r[10],v=r[11],_=r[12],m=r[13],p=r[14],y=r[15];Te(t[0].normal.array,s-n,u-o,v-h),t[0].distance=-(y-_),t[0].normalize(),Te(t[1].normal.array,s+n,u+o,v+h),t[1].distance=-(y+_),t[1].normalize(),Te(t[2].normal.array,s+i,u+l,v+d),t[2].distance=-(y+m),t[2].normalize(),Te(t[3].normal.array,s-i,u-l,v-d),t[3].distance=-(y-m),t[3].normalize(),Te(t[4].normal.array,s-a,u-c,v-f),t[4].distance=-(y-p),t[4].normalize(),Te(t[5].normal.array,s+a,u+c,v+f),t[5].distance=-(y+p),t[5].normalize();var g=this.boundingBox,x=this.vertices;if(y===0){var E=l/n,S=-p/(f-1),R=-p/(f+1),w=-R/l,M=-S/l;g.min.set(-w*E,-w,R),g.max.set(w*E,w,S),Te(x[0],-w*E,-w,R),Te(x[1],-w*E,w,R),Te(x[2],w*E,-w,R),Te(x[3],w*E,w,R),Te(x[4],-M*E,-M,S),Te(x[5],-M*E,M,S),Te(x[6],M*E,-M,S),Te(x[7],M*E,M,S)}else{var F=(-1-_)/n,b=(1-_)/n,U=(1-m)/l,I=(-1-m)/l,N=(-1-p)/f,G=(1-p)/f;g.min.set(Math.min(F,b),Math.min(I,U),Math.min(G,N)),g.max.set(Math.max(b,F),Math.max(U,I),Math.max(N,G));var B=g.min.array,Y=g.max.array;Te(x[0],B[0],B[1],B[2]),Te(x[1],B[0],Y[1],B[2]),Te(x[2],Y[0],B[1],B[2]),Te(x[3],Y[0],Y[1],B[2]),Te(x[4],B[0],B[1],Y[2]),Te(x[5],B[0],Y[1],Y[2]),Te(x[6],Y[0],B[1],Y[2]),Te(x[7],Y[0],Y[1],Y[2])}},getTransformedBoundingBox:function(){var e=T.create();return function(t,r){var n=this.vertices,i=r.array,a=t.min,s=t.max,o=a.array,l=s.array,c=n[0];va(e,c,i),da(o,e),da(l,e);for(var u=1;u<8;u++)c=n[u],va(e,c,i),o[0]=On(e[0],o[0]),o[1]=On(e[1],o[1]),o[2]=On(e[2],o[2]),l[0]=In(e[0],l[0]),l[1]=In(e[1],l[1]),l[2]=In(e[2],l[2]);return a._dirty=!0,s._dirty=!0,t}}()};const Si=fs;var xc=dt.extend(function(){return{projectionMatrix:new z,invProjectionMatrix:new z,viewMatrix:new z,frustum:new Si}},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 n=r!==void 0?r:new sn,i=t.array[0],a=t.array[1];return D.set(e,i,a,-1,1),D.transformMat4(e,e,this.invProjectionMatrix.array),D.transformMat4(e,e,this.worldTransform.array),T.scale(n.origin.array,e,1/e[3]),D.set(e,i,a,1,1),D.transformMat4(e,e,this.invProjectionMatrix.array),D.transformMat4(e,e,this.worldTransform.array),T.scale(e,e,1/e[3]),T.sub(n.direction.array,e,n.origin.array),T.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n}}()});const cr=xc;var yc=C.create(),_a=C.create(),Bn={};function Tc(e){var t=[],r=Object.keys(e);r.sort();for(var n=0;n0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof ot&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof cr?(t=this._cameraList.indexOf(e),t>=0&&this._cameraList.splice(t,1)):e instanceof ot&&(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,n,i)}},isFrustumCulled:function(){var e=new Ve,t=new z;return function(r,n,i){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=i,e.transformFrom(a,t),r.castShadow&&this.viewBoundingBoxLastFrame.union(e),r.frustumCulling){if(!e.intersectBoundingBox(n.frustum.boundingBox))return!0;t.array=n.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(Ac);var t=this._lightUniforms;for(var r in t)for(var n in t[r])t[r][n].value.length=0;for(var i=0;i1&&t.texParameterf(t.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),n===36193){var a=e.getGLExtension("OES_texture_half_float");a||(n=A.FLOAT)}if(this.mipmaps.length)for(var s=this.width,o=this.height,l=0;l0&&e.height>0}const Lr=wi;var wc=cr.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=cr.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});const Me=wc;var jr="framebuffer",pt="renderbuffer",ma=pt+"_width",pa=pt+"_height",Fn=pt+"_attached",Un="depthtexture_attached",Ot=A.FRAMEBUFFER,mr=A.RENDERBUFFER,yr=A.DEPTH_ATTACHMENT,ds=A.COLOR_ATTACHMENT0,Br=qe.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new Ti,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(Ot,this._getFrameBufferGL(e)),this._boundRenderer=e;var r=this._cache;r.put("viewport",e.viewport);var n=!1,i,a;for(var s in this._textures){n=!0;var o=this._textures[s];o&&(i=o.texture.width,a=o.texture.height,this._doAttach(e,o.texture,s,o.target))}this._width=i,this._height=a,!n&&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,i,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(Un)&&this.depthBuffer){r.miss(pt)&&r.put(pt,t.createRenderbuffer());var u=r.get(pt);(i!==r.get(ma)||a!==r.get(pa))&&(t.bindRenderbuffer(mr,u),t.renderbufferStorage(mr,t.DEPTH_COMPONENT16,i,a),r.put(ma,i),r.put(pa,a),t.bindRenderbuffer(mr,null)),r.get(Fn)||(t.framebufferRenderbuffer(Ot,yr,mr,u),r.put(Fn,!0))}},unbind:function(e){e.__currentFrameBuffer=null;var t=e.gl;t.bindFramebuffer(Ot,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 n=this._textures[r];if(n){var i=n.texture;if(!i.NPOT&&i.useMipmap&&i.minFilter===q.LINEAR_MIPMAP_LINEAR){var a=i.textureType==="textureCube"?A.TEXTURE_CUBE_MAP:A.TEXTURE_2D;t.bindTexture(a,i.getWebGLTexture(e)),t.generateMipmap(a),t.bindTexture(a,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(Ot)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(jr)&&t.put(jr,e.gl.createFramebuffer()),t.get(jr)},attach:function(e,t,r){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||ds,r=r||A.TEXTURE_2D;var n=this._boundRenderer,i=n&&n.gl,a;if(i){var s=this._cache;s.use(n.__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;n&&(l=this._doAttach(n,e,t,r),this.viewport||n.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,n){var i=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===n)return}r=+r;var l=!0;if(r===yr||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 u=this._cache.get(pt);u&&(i.framebufferRenderbuffer(Ot,yr,mr,null),i.deleteRenderbuffer(u),this._cache.put(pt,!1)),this._cache.put(Fn,!1),this._cache.put(Un,!0)}}return i.framebufferTexture2D(Ot,r,n,a,0),s||(s={},this._cache.put("attached_textures",s)),s[r]=s[r]||{},s[r].texture=t,s[r].target=n,l},_doDetach:function(e,t,r){e.framebufferTexture2D(Ot,t,r,null,0);var n=this._cache.get("attached_textures");n&&n[t]&&(n[t]=null),(t===yr||t===A.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(Un,!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 n=r.get(pt);n&&t.deleteRenderbuffer(n);var i=r.get(jr);i&&t.deleteFramebuffer(i),r.deleteContext(e.__uid__),this._textures={}}});Br.DEPTH_ATTACHMENT=yr;Br.COLOR_ATTACHMENT0=ds;Br.STENCIL_ATTACHMENT=A.STENCIL_ATTACHMENT;Br.DEPTH_STENCIL_ATTACHMENT=A.DEPTH_STENCIL_ATTACHMENT;const Ue=Br;var bc=["px","nx","py","ny","pz","nz"],Cc=qe.extend(function(){var e={position:new P,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new Me({fov:90}),nx:new Me({fov:90}),py:new Me({fov:90}),ny:new Me({fov:90}),pz:new Me({fov:90}),nz:new Me({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 n=e.gl;r||t.update();for(var i=this.texture.width,a=2*Math.atan(i/(i-.5))/Math.PI*180,s=0;s<6;s++){var o=bc[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,n.COLOR_ATTACHMENT0,n.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 bi=Cc;var Rc=Ee.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var e=this.heightSegments,t=this.widthSegments,r=this.attributes,n=[],i=[],a=[],s=[],o=0;o<=e;o++)for(var l=o/e,c=0;c<=t;c++){var u=c/t;if(n.push([2*u-1,2*l-1,0]),i&&i.push([u,l]),a&&a.push([0,0,1]),c0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],r)}});const Nr=Nc;var Pc=542327876,Dc=131072,Oc=512,Ic=4;function Ri(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var Bc=31,Fc=Ri("DXT1"),Uc=Ri("DXT3"),Hc=Ri("DXT5"),zc=0,Gc=1,Vc=2,kc=3,Wc=4,Xc=7,$c=20,jc=21,qc=28,Yc={parse:function(e,t){var r=new Int32Array(e,0,Bc);if(r[zc]!==Pc||!r($c)&Ic)return null;var n=r(jc),i=r[Wc],a=r[kc],s=r[qc]&Oc,o=r[Vc]&Dc,l,c;switch(n){case Fc:l=8,c=q.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Uc:l=16,c=q.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Hc:l=16,c=q.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var u=r[Gc]+4,h=s?6:1,d=1;o&&(d=Math.max(1,r[Xc]));for(var f=[],v=0;v0){var i=Math.pow(2,e[3]-128-8+n);t[r+0]=e[0]*i,t[r+1]=e[1]*i,t[r+2]=e[2]*i}else t[r+0]=0,t[r+1]=0,t[r+2]=0;return t[r+3]=1,t}function eu(e,t,r){for(var n="",i=t;i0;)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--)tu(e[a-1],e[a]),a++,s--;i+=8}else a++,s--,i=0;return r}function ru(e,t,r,n){if(nQc)return ga(e,t,r,n);var i=t[r++];if(i!=2)return ga(e,t,r-1,n);if(e[0][1]=t[r++],e[0][2]=t[r++],i=t[r++],(e[0][2]<<8>>>0|i)>>>0!==n)return null;for(var i=0;i<4;i++)for(var a=0;a128){s=(s&127)>>>0;for(var o=t[r++];s--;)e[a++][i]=o}else for(;s--;)e[a++][i]=t[r++]}return r}var nu={parseRGBE:function(e,t,r){r==null&&(r=0);var n=new Uint8Array(e),i=n.length;if(eu(n,0,2)==="#?"){for(var a=2;a=i)){a+=2;for(var s="";a20)return console.warn("Given image is not a height map"),e}var f,v,_,m;l%(n*4)===0?(f=s.data[l],_=s.data[l+4]):l%(n*4)===(n-1)*4?(f=s.data[l-4],_=s.data[l]):(f=s.data[l-4],_=s.data[l+4]),ln*(i-1)*4?(v=s.data[l-n*4],m=s.data[l]):(v=s.data[l-n*4],m=s.data[l+n*4]),o.data[l]=f-_+127,o.data[l+1]=v-m+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 n=document.createElement("canvas"),i=n.getContext("2d"),a=t||32;r=r||20,n.width=n.height=a,i.drawImage(e,0,0,a,a);for(var s=i.getImageData(0,0,a,a),o=0;or)return!1}return!0},_fetchTexture:function(e,t,r){Se.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:r})},createChessboard:function(e,t,r,n){e=e||512,t=t||64,r=r||"black",n=n||"white";var i=Math.ceil(e/t),a=document.createElement("canvas");a.width=e,a.height=e;var s=a.getContext("2d");s.fillStyle=n,s.fillRect(0,0,e,e),s.fillStyle=r;for(var o=0;o=0||(ri.forEach(function(t){e.on(t,this[ni(t)],this)},this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),ri.forEach(function(r){e.off(r,this[ni(r)])},this)},dispose:function(){this._meshes.forEach(function(e){this.detachFromMesh(e)},this)}};const au=ii;var su=cr.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=cr.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 Pr=su,ou="\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";L.import(ou);var lu=new Ci,xa=new Ei({geometry:lu,frustumCulling:!1}),cu=new Pr,uu=qe.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var e=new L(L.source("clay.compositor.vertex"),this.fragment),t=new wt({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 n=this.outputs[r];n&&t.attach(n,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 n=e.getGLExtension("EXT_draw_buffers");if(n&&this.outputs){var i=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&i.push(a);n.drawBuffersEXT(i)}}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){xa.material=this.material,e.renderPass([xa],cu)},dispose:function(e){}});const ke=uu,hu="#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",fu="#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 kt={},Hn=["px","nx","py","ny","pz","nz"];kt.prefilterEnvironmentMap=function(e,t,r,n,i){(!i||!n)&&(n=kt.generateNormalDistribution(),i=kt.integrateBRDF(e,n)),r=r||{};var a=r.width||64,s=r.height||64,o=r.type||t.type,l=new Lr({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),u=Math.log(c)/Math.log(2)+1,h=new wt({shader:new L({vertex:L.source("clay.skybox.vertex"),fragment:fu})});h.set("normalDistribution",n),r.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&h.define("fragment","RGBM_DECODE");var d=new Pt,f;if(t.textureType==="texture2D"){var v=new Lr({width:a,height:s,type:o===q.FLOAT?q.HALF_FLOAT:o});Vt.panoramaToCubeMap(e,t,v,{encodeRGBM:r.decodeRGBM}),t=v}f=new Nr({scene:d,material:h}),f.material.set("environmentMap",t);var _=new bi({texture:l});r.encodeRGBM&&(o=l.type=q.UNSIGNED_BYTE);for(var m=new ie({width:a,height:s,type:o}),p=new Ue({depthBuffer:!1}),y=Se[o===q.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],g=0;g>>16)>>>0;h=((h&1431655765)<<1|(h&2863311530)>>>1)>>>0,h=((h&858993459)<<2|(h&3435973836)>>>2)>>>0,h=((h&252645135)<<4|(h&4042322160)>>>4)>>>0,h=(((h&16711935)<<8|(h&4278255360)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-h)/(1+(c*c-1)*h));s[u]=d}for(var u=0;u65535?Uint32Array:Uint16Array,o=this.indices=new s(t*e*6),l,c,u,h,d,f,v,g=this.radius,_=this.phiStart,m=this.phiLength,p=this.thetaStart,y=this.thetaLength,g=this.radius,x=[],E=[],S=0,R=1/g;for(v=0;v<=e;v++)for(f=0;f<=t;f++)h=f/t,d=v/e,l=-g*Math.cos(_+h*m)*Math.sin(p+d*y),c=g*Math.cos(p+d*y),u=g*Math.sin(_+h*m)*Math.sin(p+d*y),x[0]=l,x[1]=c,x[2]=u,E[0]=h,E[1]=d,r.set(S,x),n.set(S,E),x[0]*=R,x[1]*=R,x[2]*=R,i.set(S,x),S++;var w,M,F,b,U=t+1,I=0;for(v=0;v=0&&l.splice(h,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,n=0;n 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",Hu="\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",zu="@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",Gu="/**\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",Vu="@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",ku="@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",Wu="@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,Fu);L.import(Uu);L.import(as);L.import(Hu);L.import(zu);L.import(Gu);L.import(Vu);L.import(ku);L.import(Wu);function Xu(e){return!e||e==="none"}function ms(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}function $u(e){return e.getZr&&e.setOption}var ju=Pt.prototype.addToScene,qu=Pt.prototype.removeFromScene;Pt.prototype.addToScene=function(e){if(ju.call(this,e),this.__zr){var t=this.__zr;e.traverse(function(r){r.__zr=t,r.addAnimatorsToZr&&r.addAnimatorsToZr(t)})}};Pt.prototype.removeFromScene=function(e){qu.call(this,e),e.traverse(function(t){var r=t.__zr;t.__zr=null,r&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(r)})};wt.prototype.setTextureImage=function(e,t,r,n){if(this.shader){var i=r.getZr(),a=this,s;return a.autoUpdateTextureStatus=!1,a.disableTexture(e),Xu(t)||(s=$.loadTexture(t,r,n,function(o){a.enableTexture(e),i&&i.refresh()}),a.set(e,s)),s}};var $={};$.Renderer=Er;$.Node=dt;$.Mesh=Ei;$.Shader=L;$.Material=wt;$.Texture=q;$.Texture2D=ie;$.Geometry=Ee;$.SphereGeometry=Au;$.PlaneGeometry=Ci;$.CubeGeometry=vs;$.AmbientLight=wu;$.DirectionalLight=Cu;$.PointLight=Mu;$.SpotLight=Nu;$.PerspectiveCamera=Me;$.OrthographicCamera=Pr;$.Vector2=Ze;$.Vector3=P;$.Vector4=Pu;$.Quaternion=ss;$.Matrix2=Du;$.Matrix2d=Ou;$.Matrix3=Iu;$.Matrix4=z;$.Plane=hs;$.Ray=sn;$.BoundingBox=Ve;$.Frustum=Si;var Yr=null;function Yu(){return Yr!==null||(Yr=Vt.createBlank("rgba(255,255,255,0)").image),Yr}function ya(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function Ta(e){if((e.wrapS===q.REPEAT||e.wrapT===q.REPEAT)&&e.image){var t=ya(e.width),r=ya(e.height);if(t!==e.width||r!==e.height){var n=document.createElement("canvas");n.width=t,n.height=r;var i=n.getContext("2d");i.drawImage(e.image,0,0,t,r),e.image=n}}}$.loadTexture=function(e,t,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};for(var i=Object.keys(r).sort(),a="",s=0;s3?t[3]=e[3]:t[3]=1,t):(t=ka(e||"#000",t)||[0,0,0,0],t[0]/=255,t[1]/=255,t[2]/=255,t)};$.directionFromAlphaBeta=function(e,t){var r=e/180*Math.PI+Math.PI/2,n=-t/180*Math.PI+Math.PI/2,i=[],a=Math.sin(r);return i[0]=a*Math.cos(n),i[1]=-Math.cos(r),i[2]=a*Math.sin(n),i};$.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};$.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];$.createShader=function(e){e==="ecgl.shadow"&&(e="ecgl.displayShadow");var t=L.source(e+".vertex"),r=L.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),r||console.error("Fragment shader of '%s' not exits",e);var n=new L(t,r);return n.name=e,n};$.createMaterial=function(e,t){t instanceof Array||(t=[t]);var r=$.createShader(e),n=new wt({shader:r});return t.forEach(function(i){typeof i=="string"&&n.define(i)}),n};$.setMaterialFromModel=function(e,t,r,n){t.autoUpdateTextureStatus=!1;var i=r.getModel(e+"Material"),a=i.get("detailTexture"),s=rt.firstNotNull(i.get("textureTiling"),1),o=rt.firstNotNull(i.get("textureOffset"),0);typeof s=="number"&&(s=[s,s]),typeof o=="number"&&(o=[o,o]);var l=s[0]>1||s[1]>1?$.Texture.REPEAT:$.Texture.CLAMP_TO_EDGE,c={anisotropic:8,wrapS:l,wrapT:l};if(e==="realistic"){var u=i.get("roughness"),h=i.get("metalness");h!=null?isNaN(h)&&(t.setTextureImage("metalnessMap",h,n,c),h=rt.firstNotNull(i.get("metalnessAdjust"),.5)):h=0,u!=null?isNaN(u)&&(t.setTextureImage("roughnessMap",u,n,c),u=rt.firstNotNull(i.get("roughnessAdjust"),.5)):u=.5;var d=i.get("normalTexture");t.setTextureImage("detailMap",a,n,c),t.setTextureImage("normalMap",d,n,c),t.set({roughness:u,metalness:h,detailUvRepeat:s,detailUvOffset:o})}else if(e==="lambert")t.setTextureImage("detailMap",a,n,c),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="color")t.setTextureImage("detailMap",a,n,c),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="hatching"){var f=i.get("hatchingTextures")||[];f.length<6;for(var v=0;v<6;v++)t.setTextureImage("hatch"+(v+1),f[v],n,{anisotropic:8,wrapS:$.Texture.REPEAT,wrapT:$.Texture.REPEAT});t.set({detailUvRepeat:s,detailUvOffset:o})}};$.updateVertexAnimation=function(e,t,r,n){var i=n.get("animation"),a=n.get("animationDurationUpdate"),s=n.get("animationEasingUpdate"),o=r.shadowDepthMaterial;if(i&&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(n){n.__zr=r,n.addAnimatorsToZr&&n.addAnimatorsToZr(r)})}};function ps(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(ps,this),e.layer=null,this._viewsToDispose.push(e))}};ce.prototype.removeViewsAll=function(){this.views.forEach(function(e){e.scene.traverse(ps,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?k.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t20)){e=e.event;var n=this.pickObject(e.offsetX,e.offsetY);n&&(this._dispatchEvent(e.type,e,n),this._dispatchDataEvent(e.type,e,n));var i=this._clickToSetFocusPoint(e);if(i){var a=i.view.setDOFFocusOnPoint(i.distance);a&&this.zr.refresh()}}}};ce.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,r=t.viewport,n=this.views.length-1;n>=0;n--){var i=this.views[n];if(i.hasDOF()&&i.containPoint(e.offsetX,e.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,t.viewport=i.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=i,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=[],n=this.renderer,i=n.viewport,a=0;a=0&&(u.dataIndex=this._lastDataIndex,u.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(c,"mouseout",t)),o=!0):s!=null&&s!==this._lastEventData&&(this._lastEventData!=null&&(u.eventData=this._lastEventData,this.zr.handler.dispatchToElement(c,"mouseout",t)),o=!0),this._lastEventData=s,this._lastDataIndex=i,this._lastSeriesIndex=a),u.eventData=s,u.dataIndex=i,u.seriesIndex=a,(s!=null||parseInt(i,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&&(Ju(t),t.coordinateSystem==="mapbox"&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))}),Kr(e.xAxis3D),Kr(e.yAxis3D),Kr(e.zAxis3D),Kr(e.grid3D),Tr(e.geo3D)}function xs(e){this._layers={},this._zr=e}xs.prototype.update=function(e,t){var r=this,n=t.getZr();if(!n.getWidth()||!n.getHeight()){console.warn("Dom has no width or height");return}function i(o){n.setSleepAfterStill(0);var l;o.coordinateSystem&&o.coordinateSystem.model,l=o.get("zlevel");var c=r._layers,u=c[l];if(!u){if(u=c[l]=new gs("gl-"+l,n),n.painter.isSingleCanvas()){u.virtual=!0;var h=new vo({z:1e4,style:{image:u.renderer.canvas},silent:!0});u.__hostImage=h,n.add(h)}n.painter.insertLayer(l,u)}return u.__hostImage&&u.__hostImage.setStyle({width:u.renderer.getWidth(),height:u.renderer.getHeight()}),u}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),u=l.coordinateSystem;if(c.__ecgl__){var h;if(u){if(!u.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+l.id);return}h=u.viewGL}else{if(!l.viewGL){console.error("Can't find viewGL of component "+l.id);return}h=u.viewGL}var h=u.viewGL,d=i(l);d.addView(h),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 u=c&&c.viewGL||l.viewGL,h=i(o);h.addView(u),l.afterRender&&l.afterRender(o,e,t,h),a(l.groupGL,o.get("silent"))}})};uo(function(e){var t=e.getZr(),r=t.painter.dispose;t.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(n){n instanceof gs&&n.dispose()}),r.call(this)},t.painter.getRenderedCanvas=function(n){if(n=n||{},this._singleCanvas)return this._layers[0].dom;var i=document.createElement("canvas"),a=n.pixelRatio||this.dpr;i.width=this.getWidth()*a,i.height=this.getHeight()*a;var s=i.getContext("2d");s.dpr=a,s.clearRect(0,0,i.width,i.height),n.backgroundColor&&(s.fillStyle=n.backgroundColor,s.fillRect(0,0,i.width,i.height));var o=this.storage.getDisplayList(!0),l={},c,u=this;function h(_,m){var p=u._zlevelList;_==null&&(_=-1/0);for(var y,g=0;g_&&x0&&this._notFirst?this.animateTo({alpha:c,beta:u,center:h,distance:a,orthographicSize:s,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(u),this.setCenter(h),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(e){var t=this.zr,r=this,n={},i={};return e.distance!=null&&(n.distance=this.getDistance(),i.distance=e.distance),e.orthographicSize!=null&&(n.orthographicSize=this.getOrthographicSize(),i.orthographicSize=e.orthographicSize),e.alpha!=null&&(n.alpha=this.getAlpha(),i.alpha=e.alpha),e.beta!=null&&(n.beta=this.getBeta(),i.beta=e.beta),e.center!=null&&(n.center=this.getCenter(),i.center=e.center),this._addAnimator(t.animation.animate(n).when(e.duration||1e3,i).during(function(){n.alpha!=null&&r.setAlpha(n.alpha),n.beta!=null&&r.setBeta(n.beta),n.distance!=null&&r.setDistance(n.distance),n.center!=null&&r.setCenter(n.center),n.orthographicSize!=null&&r.setOrthographicSize(n.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,n=r/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-n/2,t.right=n/2,t.top=r/2,t.bottom=-r/2},_updatePan:function(e){var t=this._panVelocity,r=this._distance,n=this.getCamera(),i=n.worldTransform.y,a=n.worldTransform.x;this._center.scaleAndAdd(a,-t.x*r/200).scaleAndAdd(i,-t.y*r/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new P,r=this._theta+Math.PI/2,n=this._phi+Math.PI/2,i=Math.sin(r);t.x=i*Math.cos(n),t.y=-Math.cos(r),t.z=i*Math.sin(n),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===Ea[this.rotateMouseButton]?this._mode="rotate":e.event.button===Ea[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=Aa(this.panSensitivity),r=Aa(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,n=e.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(r,n))){var i;this._projection==="perspective"?i=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):i=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*i*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(ys.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});const ah=ys,Mi={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()}},yn={vec2:H,vec3:T,vec4:D,mat2:ye,mat2d:Ae,mat3:ee,mat4:C,quat:j};var zn=yn.vec3,Sa=[[0,0],[1,1]],Ts=Ee.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new Ee.Attribute("position","float",3,"POSITION"),positionPrev:new Ee.Attribute("positionPrev","float",3),positionNext:new Ee.Attribute("positionNext","float",3),prevPositionPrev:new Ee.Attribute("prevPositionPrev","float",3),prevPosition:new Ee.Attribute("prevPosition","float",3),prevPositionNext:new Ee.Attribute("prevPositionNext","float",3),offset:new Ee.Attribute("offset","float",1),color:new Ee.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,n){var i=zn.dist(e,t)+zn.dist(r,t)+zn.dist(n,r),a=1/(i+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?a*2:a*2+2},getCubicCurveTriangleCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?0:a*2},getLineVertexCount:function(){return this.getPolylineVertexCount(Sa)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(Sa)},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,n,i,a){a==null&&(a=1);for(var s=e[0],o=e[1],l=e[2],c=t[0],u=t[1],h=t[2],d=r[0],f=r[1],v=r[2],_=n[0],m=n[1],p=n[2],y=this._getCubicCurveApproxStep(e,t,r,n),g=y*y,x=g*y,E=3*y,S=3*g,R=6*g,w=6*x,M=s-c*2+d,F=o-u*2+f,b=l-h*2+v,U=(c-d)*3-s+_,I=(u-f)*3-o+m,N=(h-v)*3-l+p,G=s,B=o,Y=l,O=(c-s)*E+M*S+U*x,he=(u-o)*E+F*S+I*x,V=(h-l)*E+b*S+N*x,xe=M*R+U*w,ae=F*R+I*w,ve=b*R+N*w,_e=U*w,Ie=I*w,Be=N*w,Re=0,ze=0,Ye=Math.ceil(1/y),Fe=new Float32Array((Ye+1)*3),Fe=[],nt=0,ze=0;ze1&&(G=O>0?Math.min(G,_):Math.max(G,_),B=he>0?Math.min(B,m):Math.max(B,m),Y=V>0?Math.min(Y,p):Math.max(Y,p));return this.addPolyline(Fe,i,a)},addLine:function(e,t,r,n){return this.addPolyline([e,t],r,n)},addPolyline:function(e,t,r,n,i){if(e.length){var a=typeof e[0]!="number";if(i==null&&(i=a?e.length:e.length/3),!(i<2)){n==null&&(n=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===i,o=this.attributes.position,l=this.attributes.positionPrev,c=this.attributes.positionNext,u=this.attributes.color,h=this.attributes.offset,d=this.indices,f=this._vertexOffset,v,_;r=Math.max(r,.01);for(var m=n;m1&&(o.copy(f,f-1),u.copy(f,f-1),f++):(m0&&(c.set(f-2,v),c.set(f-1,v)),o.set(f,v),o.set(f+1,v),u.set(f,_),u.set(f+1,_),h.set(f,r/2),h.set(f+1,-r/2),f+=2),this.useNativeLine)u.set(f,_),o.set(f,v),f++;else if(m>0){var g=this._triangleOffset*3,d=this.indices;d[g]=f-4,d[g+1]=f-3,d[g+2]=f-2,d[g+3]=f-3,d[g+4]=f-1,d[g+5]=f-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,E=this._vertexOffset+i*2;l.copy(x,x+2),l.copy(x+1,x+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],n=es&&(i=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+i,e.y+=this.offsetY*this.dpr+a,this._zr.add(e);var c=[this.offsetX/this.width,this.offsetY/this.height],u=[[i/s+c[0],a/o+c[1]],[(i+t)/s+c[0],(a+r)/o+c[1]]];return u},_fitElement:function(e,t,r){var n=e.getBoundingRect(),i=t/n.width,a=r/n.height;e.x=-n.x*i,e.y=-n.y*a,e.scaleX=i,e.scaleY=a,e.update()}};function ai(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 ie({image:t,flipY:!1});var r=this;this._zr=_o(t);var n=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){n.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 un(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}ai.prototype={clear:function(){for(var e=0;e=e)){var a=(n+this._nodeWidth)*this._dpr,s=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:s})}catch{this._canvas.width=a,this._canvas.height=s}var o=new un(this._zr,n,i,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 n=this._getCurrentNode().add(e,t,r);if(!n){var i=this._expand();if(!i)return;n=i.add(e,t,r)}return this._coords[e.id]=n,n},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 si(){}si.prototype={constructor:si,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new k.DirectionalLight({shadowBias:.005}),this.ambientLight=new k.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,n=e.getModel("light"),i=n.getModel("main"),a=n.getModel("ambient");t.intensity=i.get("intensity"),r.intensity=a.get("intensity"),t.color=k.parseColor(i.get("color")).slice(0,3),r.color=k.parseColor(a.get("color")).slice(0,3);var s=i.get("alpha")||0,o=i.get("beta")||0;t.position.setArray(k.directionFromAlphaBeta(s,o)),t.lookAt(k.Vector3.ZERO),t.castShadow=i.get("shadow"),t.shadowResolution=k.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(e,t,r){var n=t.getModel("light.ambientCubemap"),i=n.get("texture");if(i){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[i];if(!a){var s=this;a=this._cubemapLightsCache[i]=k.createAmbientCubemap(n.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 n=t.get("environment"),i=this;function a(){return i._skybox=i._skybox||new Nr,i._skybox}var s=a();if(n&&n!=="none")if(n==="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 n=="object"&&n.colorStops||typeof n=="string"&&ka(n)){this._isSkyboxFromAmbientCubemap=!1;var l=new k.Texture2D({anisotropic:8,flipY:!1});s.setEnvironmentMap(l);var c=l.image=document.createElement("canvas");c.width=c.height=16;var u=c.getContext("2d"),h=new Wa({shape:{x:0,y:0,width:16,height:16},style:{fill:n}});mo(u,h),s.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=k.loadTexture(n,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&&n!=="auto"&&!(n.match&&n.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 It=yn.vec3,Es=Ee.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new Ee.Attribute("position","float",3,"POSITION"),normal:new Ee.Attribute("normal","float",3,"NORMAL"),color:new Ee.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,r=this.getQuadVertexCount()*e,n=this.getQuadTriangleCount()*e;this.vertexCount!==r&&(t.position.init(r),t.normal.init(r),t.color.init(r)),this.triangleCount!==n&&(this.indices=r>65535?new Uint32Array(n*3):new Uint16Array(n*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=It.create(),t=It.create(),r=It.create(),n=[0,3,1,3,2,1];return function(i,a){var s=this.attributes.position,o=this.attributes.normal,l=this.attributes.color;It.sub(e,i[1],i[0]),It.sub(t,i[2],i[1]),It.cross(r,e,t),It.normalize(r,r);for(var c=0;c<4;c++)s.set(this._vertexOffset+c,i[c]),l.set(this._vertexOffset+c,a),o.set(this._vertexOffset+c,r);for(var u=this._faceOffset*3,c=0;c<6;c++)this.indices[u+c]=n[c]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});Ir(Es.prototype,Mi);const sh=Es;var oi=rt.firstNotNull,oh={x:0,y:2,z:1};function lh(e,t,r,n){var i=[0,0,0],a=n<0?r.getExtentMin():r.getExtentMax();i[oh[r.dim]]=a,e.position.setArray(i),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),r.dim==="x"?(e.rotation.rotateY(n*Math.PI/2),t.normal.x=-n):r.dim==="z"?(e.rotation.rotateX(-n*Math.PI/2),t.normal.y=-n):(n>0&&e.rotation.rotateY(Math.PI),t.normal.z=-n)}function Tn(e,t,r){this.rootNode=new k.Node;var n=new k.Mesh({geometry:new Li({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new k.Mesh({geometry:new sh,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(n),this.faceInfo=e,this.plane=new k.Plane,this.linesMesh=n,this.quadsMesh=i}Tn.prototype.update=function(e,t,r){var n=e.coordinateSystem,i=[n.getAxis(this.faceInfo[0]),n.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,s=this.quadsMesh.geometry;a.convertToDynamicArray(!0),s.convertToDynamicArray(!0),this._updateSplitLines(a,i,e,r),this._udpateSplitAreas(s,i,e,r),a.convertToTypedArray(),s.convertToTypedArray();var o=n.getAxis(this.faceInfo[2]);lh(this.rootNode,this.plane,o,this.faceInfo[3])};Tn.prototype._updateSplitLines=function(e,t,r,n){var i=n.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 u=c.getModel("lineStyle"),h=u.get("color"),d=oi(u.get("opacity"),1),f=oi(u.get("width"),1);h=Ar(h)?h:[h];for(var v=a.getTicksCoords({tickModel:c}),_=0,m=0;m65535?new Uint32Array(r*3):new Uint16Array(r*3))},setSpriteAlign:function(e,t,r,n,i){r==null&&(r="left"),n==null&&(n="top");var a,s,o,l;switch(i=i||0,r){case"left":a=i,o=t[0]+i;break;case"center":case"middle":a=-t[0]/2,o=t[0]/2;break;case"right":a=-t[0]-i,o=-i;break}switch(n){case"bottom":s=i,l=t[1]+i;break;case"middle":s=-t[1]/2,l=t[1]/2;break;case"top":s=-t[1]-i,l=-i;break}var c=e*4,u=this.attributes.offset;u.set(c,[a,l]),u.set(c+1,[o,l]),u.set(c+2,[o,s]),u.set(c+3,[a,s])},addSprite:function(e,t,r,n,i,a){var s=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,r,n,i,a);for(var o=0;on[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"),n=e.getAxis("z"),i=n.getExtentMax(),a=n.getExtentMin(),s=t.getExtentMin(),o=t.getExtentMax(),l=r.getExtentMax(),c=r.getExtentMin(),u=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,v=f[4].rootNode.invisible?c:l,_=f[2].rootNode.invisible?i:a,m=f[0].rootNode.invisible?s:o,p=f[2].rootNode.invisible?i:a,y=f[0].rootNode.invisible?o:s,g=f[4].rootNode.invisible?c:l;u.rotation.identity(),h.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,u.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),u.position.set(0,_,v),h.position.set(m,p,0),d.position.set(y,0,g),u.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new k.Vector4,new k.Vector4],r=new k.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(n){var i=n.axisLineCoords;n.labelsMesh.geometry;for(var a=0;ar.y?"bottom":"top"):(h="middle",u=l>r.x?"left":"right"),n.setSpriteAlign(u,h,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),n=this._axisPointerLineMesh,i=n.geometry,a=this._model.getModel("axisPointer"),s=this._api.getDevicePixelRatio();i.convertToDynamicArray(!0);function o(w){return rt.firstNotNull(w.model.get("axisPointer.show"),a.get("show"))}function l(w){var M=w.model.getModel("axisPointer",a),F=M.getModel("lineStyle"),b=k.parseColor(F.get("color")),U=ba(F.get("width"),1),I=ba(F.get("opacity"),1);return b[3]*=I,{color:b,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 Mt=["px","nx","py","ny","pz","nz"];L.import(_h);function kn(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 n=e.material.get("alphaCutoff");return n||0}return 0}else return r==="uvRepeat"?e.material.get("uvRepeat"):r==="uvOffset"?e.material.get("uvOffset"):t.get(r)}function Ra(e,t){var r=e.material,n=t.material;return r.get("diffuseMap")!==n.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)}var ut=qe.extend(function(){return{softShadow:ut.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 bs}},function(){this._gaussianPassH=new ke({fragment:L.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new ke({fragment:L.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 ke({fragment:L.source("clay.sm.debug_depth")})},{render:function(e,t,r,n){r||(r=t.getMainCamera()),this.trigger("beforerender",this,e,t,r),this._renderShadowPass(e,t,r,n),this.trigger("afterrender",this,e,t,r)},renderDebug:function(e,t){e.saveClear();var r=e.viewport,n=0,i=0,a=t||r.width/4,s=a;this.softShadow===ut.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(n,i,a*l.width/l.height,s),this._outputDepthPass.setUniform("depthMap",l),this._outputDepthPass.render(e),n+=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===ut.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 n=0;n4){console.warn("Support at most 4 cascade");continue}v.shadowCascade>1&&(d=v),this.renderDirectionalLightShadow(e,t,r,v,u,c,l)}else v.type==="SPOT_LIGHT"?this.renderSpotLightShadow(e,t,v,o,s):v.type==="POINT_LIGHT"&&this.renderPointLightShadow(e,t,v,h);this._shadowMapNumber[v.type]++}for(var _ in this._shadowMapNumber)for(var m=this._shadowMapNumber[_],p=_+"_SHADOWMAP_COUNT",f=0;f0?g.define("fragment",p,m):g.isDefined("fragment",p)&&g.undefine("fragment",p))}for(var f=0;f0){var S=l.map(E);if(x.directionalLightShadowMaps={value:l,type:"tv"},x.directionalLightMatrices={value:c,type:"m4v"},x.directionalLightShadowMapSizes={value:S,type:"1fv"},d){var R=u.slice(),w=u.slice();R.pop(),w.shift(),R.reverse(),w.reverse(),c.reverse(),x.shadowCascadeClipsNear={value:R,type:"1fv"},x.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var M=s.map(E),x=t.shadowUniforms;x.spotLightShadowMaps={value:s,type:"tv"},x.spotLightMatrices={value:o,type:"m4v"},x.spotLightShadowMapSizes={value:M,type:"1fv"}}h.length>0&&(x.pointLightShadowMaps={value:h,type:"tv"})},renderDirectionalLightShadow:function(){var e=new Si,t=new z,r=new Ve,n=new z,i=new z,a=new z,s=new z;return function(o,l,c,u,h,d,f){var v=this._getDepthMaterial(u),_={getMaterial:function(ve){return ve.shadowDepthMaterial||v},isMaterialChanged:Ra,getUniform:kn,ifRender:function(ve){return ve.castShadow},sortCompare:Er.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var m=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(m).applyTransform(c.viewMatrix)}var p=Math.min(-l.viewBoundingBoxLastFrame.min.z,c.far),y=Math.max(-l.viewBoundingBoxLastFrame.max.z,c.near),g=this._getDirectionalLightCamera(u,l,c),x=a.array;s.copy(g.projectionMatrix),C.invert(i.array,g.worldTransform.array),C.multiply(i.array,i.array,c.worldTransform.array),C.multiply(x,s.array,i.array);for(var E=[],S=c instanceof Me,R=(c.near+c.far)/(c.near-c.far),w=2*c.near*c.far/(c.near-c.far),M=0;M<=u.shadowCascade;M++){var F=y*Math.pow(p/y,M/u.shadowCascade),b=y+(p-y)*M/u.shadowCascade,U=F*u.cascadeSplitLogFactor+b*(1-u.cascadeSplitLogFactor);E.push(U),h.push(-(-U*R+w)/-U)}var I=this._getTexture(u,u.shadowCascade);f.push(I);var N=o.viewport,G=o.gl;this._frameBuffer.attach(I),this._frameBuffer.bind(o),G.clear(G.COLOR_BUFFER_BIT|G.DEPTH_BUFFER_BIT);for(var M=0;MF?M>b?v[S>0?"px":"nx"]=!0:v[w>0?"pz":"nz"]=!0:F>b?v[R>0?"py":"ny"]=!0:v[w>0?"pz":"nz"]=!0}for(var x=0;x0){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 Or=ph;var gh=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&&u.push(l);c.drawBuffersEXT(u)}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(),n.unbind(e)}this.trigger("afterrender",r),this._rendering=!1,this._rendered=!0}});const Eh=Th;var Ah=Or.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});const Sh=Ah;var wh=Or.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 ke({fragment:this.shader});this.pass=e},{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var r=e.gl;for(var n in this.inputLinks){var i=this.inputLinks[n],a=i.node.getOutput(e,i.pin);this.pass.setUniform(n,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],u=this._compositor.allocateTexture(l);this._outputTextures[o]=u;var h=c.attachment||r.COLOR_ATTACHMENT0;typeof h=="string"&&(h=r[h]),s[h]=u}this._compositor.getFrameBuffer().bind(e);for(var h in s)this._compositor.getFrameBuffer().attach(s[h],h);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}for(var n in this.inputLinks){var i=this.inputLinks[n];i.node.removeReference(i.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var r=this.outputs[e],n=r.parameters,i=r._parametersCopy;if(i||(i=r._parametersCopy={}),n)for(var a in n)a!=="width"&&a!=="height"&&(i[a]=n[a]);var s,o;return typeof n.width=="function"?s=n.width.call(this,t):s=n.width,typeof n.height=="function"?o=n.height.call(this,t):o=n.height,s=Math.ceil(s),o=Math.ceil(o),(i.width!==s||i.height!==o)&&this._outputTextures[e]&&this._outputTextures[e].dispose(t),i.width=s,i.height=o,i},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(){Or.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const bh=wh,Ch="@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",Cs="@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",Rh="@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",Rs="\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",Mh="@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",Ms="@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",Ls="@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",Ns="@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",Ps="\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",Ds="@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",Os="@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",Is="@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 Nh(e){e.import(Ch),e.import(Cs),e.import(Rh),e.import(Rs),e.import(Mh),e.import(Ms),e.import(Ls),e.import(Ns),e.import(Ps),e.import(Ds),e.import(Lh),e.import(Os),e.import(Is)}Nh(L);var Ph=/^#source\((.*?)\)/;function Dh(e,t){var r=new yh;t=t||{};var n={textures:{},parameters:{}},i=function(o,l){for(var c=0;c0;)r=r+n*(i%t),i=Math.floor(i/t),n=n/t;return r}const zh="@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";L.import(zh);function Fs(e){for(var t=new Uint8Array(e*e*4),r=0,n=new P,i=0;i=1?.95:0,weight2:n>=1?.05:1}),f.render(e)),c.attach(o),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),h.render(e),c.attach(l),d.setUniform("texture",o),d.render(e),c.unbind(e),this._physicallyCorrect){var p=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=p}};Ct.prototype.getTargetTexture=function(){return this._texture3};Ct.prototype.setParameter=function(e,t){e==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)};Ct.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=an.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};Ct.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")};Ct.prototype.isFinished=function(e){return this._physicallyCorrect?e>this._totalSamples/this._samplePerFrame:!0};Ct.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],kh="@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";L.import(kh);function Wn(e,t,r,n,i){var a=e.gl;t.setUniform(a,"1i",r,i),a.activeTexture(a.TEXTURE0+i),n.isRenderable()?n.bind(e):n.unbind(e)}function Wh(e,t,r,n,i){var a,s,o,l,c=e.gl;return function(u,h,d){if(!(l&&l.material===u.material)){var f=u.material,v=u.__program,_=f.get("roughness");_==null&&(_=1);var m=f.get("normalMap")||t,p=f.get("roughnessMap"),y=f.get("bumpMap"),g=f.get("uvRepeat"),x=f.get("uvOffset"),E=f.get("detailUvRepeat"),S=f.get("detailUvOffset"),R=!!y&&f.isTextureEnabled("bumpMap"),w=!!p&&f.isTextureEnabled("roughnessMap"),M=f.isDefined("fragment","DOUBLE_SIDED");y=y||r,p=p||n,d!==h?(h.set("normalMap",m),h.set("bumpMap",y),h.set("roughnessMap",p),h.set("useBumpMap",R),h.set("useRoughnessMap",w),h.set("doubleSide",M),g!=null&&h.set("uvRepeat",g),x!=null&&h.set("uvOffset",x),E!=null&&h.set("detailUvRepeat",E),S!=null&&h.set("detailUvOffset",S),h.set("roughness",_)):(v.setUniform(c,"1f","roughness",_),a!==m&&Wn(e,v,"normalMap",m,0),s!==y&&y&&Wn(e,v,"bumpMap",y,1),o!==p&&p&&Wn(e,v,"roughnessMap",p,2),g!=null&&v.setUniform(c,"2f","uvRepeat",g),x!=null&&v.setUniform(c,"2f","uvOffset",x),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",+w),v.setUniform(c,"1i","doubleSide",+M)),a=m,s=y,o=p,l=u}}}function fr(e){this._depthTex=new ie({format:q.DEPTH_COMPONENT,type:q.UNSIGNED_INT}),this._normalTex=new ie({type:q.HALF_FLOAT}),this._framebuffer=new Ue,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,Ue.DEPTH_ATTACHMENT),this._normalMaterial=new wt({shader:new L(L.source("ecgl.normal.vertex"),L.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=Vt.createBlank("#000"),this._defaultBumpMap=Vt.createBlank("#000"),this._defaultRoughessMap=Vt.createBlank("#000"),this._debugPass=new ke({fragment:L.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}fr.prototype.getDepthTexture=function(){return this._depthTex};fr.prototype.getNormalTexture=function(){return this._normalTex};fr.prototype.update=function(e,t,r){var n=e.getWidth(),i=e.getHeight(),a=this._depthTex,s=this._normalTex,o=this._normalMaterial;a.width=n,a.height=i,s.width=n,s.height=i;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:Wh(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)};fr.prototype.renderDebug=function(e){this._debugPass.render(e)};fr.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)};function Fr(e){e=e||{},this._edgePass=new ke({fragment:L.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new ie({type:q.HALF_FLOAT}),this._frameBuffer=new Ue,this._frameBuffer.attach(this._targetTexture)}Fr.prototype.update=function(e,t,r,n){var i=e.getWidth(),a=e.getHeight(),s=this._targetTexture;s.width=i,s.height=a;var o=this._frameBuffer;o.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(e),o.unbind(e)};Fr.prototype.getTargetTexture=function(){return this._targetTexture};Fr.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)};Fr.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};const Xh={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"}}]},$h="@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",jh="@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";L.import(Cs);L.import(Rs);L.import(Ms);L.import(Ls);L.import(Ns);L.import(Ps);L.import(Ds);L.import(Os);L.import(Is);L.import($h);L.import(jh);function Us(e,t){return{color:{parameters:{width:e,height:t}}}}var Di=["composite","FXAA"];function J(){this._width,this._height,this._dpr,this._sourceTexture=new ie({type:q.HALF_FLOAT}),this._depthTexture=new ie({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 fr,this._compositor=Dh(Xh);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(n){return this._compositor.getNodeByName(n)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=Di.map(function(n){return this._compositor.getNodeByName(n)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new bt(r),this._ssrPass=new Ct(r),this._edgePass=new Fr(r)}J.prototype.resize=function(n,i,r){r=r||1;var n=n*r,i=i*r,a=this._sourceTexture,s=this._depthTexture;a.width=n,a.height=i,s.width=n,s.height=i;var o={getWidth:function(){return n},getHeight:function(){return i},getDevicePixelRatio:function(){return r}};function l(c,u){if(typeof c[u]=="function"){var h=c[u].__original||c[u];c[u]=function(d){return h.call(this,o)},c[u].__original=h}}this._compositor.nodes.forEach(function(c){for(var u in c.outputs){var h=c.outputs[u].parameters;h&&(l(h,"width"),l(h,"height"))}for(var d in c.parameters)l(c.parameters,d)}),this._width=n,this._height=i,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=Di.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=Di.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=Us(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=Us(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,n){this._ifRenderNormalPass()&&this._normalPass.update(e,t,r)};J.prototype.updateSSAO=function(e,t,r,n){this._ssaoPass.update(e,r,n)};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 n=this._blendPass;this._frame===0?(n.setUniform("weight1",0),n.setUniform("weight2",1)):(n.setUniform("weight1",.9),n.setUniform("weight2",.1)),n.setUniform("texture1",this._prevFrameTex),n.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),n.render(e),this._blendFb.unbind(e),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,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 pe(e){e=e||"perspective",this.layer=null,this.scene=new Pt,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new J,this._temporalSS=new ci,this._shadowMapPass=new mh;for(var t=[],r=0,n=0;n<30;n++){for(var i=[],a=0;a<6;a++)i.push(ur(r,2)*4-2),i.push(ur(r,3)*4-2),r++;t.push(i)}this._pcfKernels=t,this.scene.on("beforerender",function(s,o,l){this.needsTemporalSS()&&this._temporalSS.jitterProjection(s,l)},this)}pe.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),e==="perspective"?this.camera instanceof Me||(this.camera=new Me,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof Pr||(this.camera=new Pr,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3};pe.prototype.setViewport=function(e,t,r,n,i){this.camera instanceof Me&&(this.camera.aspect=r/n),i=i||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=r,this.viewport.height=n,this.viewport.devicePixelRatio=i,this._compositor.resize(r*i,n*i),this._temporalSS.resize(r*i,n*i)};pe.prototype.containPoint=function(e,t){var r=this.viewport,n=this.layer.renderer.getHeight();return t=n-t,e>=r.x&&t>=r.y&&e<=r.x+r.width&&t<=r.y+r.height};var Pa=new Ze;pe.prototype.castRay=function(e,t,r){var n=this.layer.renderer,i=n.viewport;return n.viewport=this.viewport,n.screenToNDC(e,t,Pa),this.camera.castRay(Pa,r),n.viewport=i,r};pe.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};pe.prototype._doRender=function(e,t,r){var n=this.scene,i=this.camera;r=r||0,this._updateTransparent(e,n,i,r),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,n,i,!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,i),this._compositor.updateNormal(e,n,i,this._temporalSS.getFrame())),this._updateSSAO(e,n,i,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(n,i,!0,!0),s.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,n,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,n,i,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(n,i,!0,!0),e.restoreClear(),s.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)}else e.setViewport(this.viewport),e.render(n,i,!0,!0)};pe.prototype._updateTransparent=function(e,t,r,n){for(var i=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 n=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 i=0,a,s=0;s"+d.join("
")}var i=e.getData(),a=e.getRawValue(t),s=Ar(a)?n(a):Hr(Bi(a)),o=i.getName(t),l=ui(i,t);wo(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var c=bo(l),u=e.name;return u==="\0-"&&(u=""),u=u?Hr(u)+(r?": ":"
"):"",r?c+u+s:u+c+(o?Hr(o)+": "+s:s)}function hf(e,t,r){r=r||e.getSource();var n=t||Ro(e.get("coordinateSystem"))||["x","y","z"],i=Mo(r,{dimensionsDefine:r.dimensionsDefine||e.get("dimensions"),encodeDefine:r.encodeDefine||e.get("encode"),coordDimensions:n.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"&&i.forEach(function(o){if(n.indexOf(o.coordDim)>=0){var l=e.getReferringComponents(o.coordDim+"Axis3D").models[0];l&&l.get("type")==="category"&&(o.ordinalMeta=l.getOrdinalMeta())}});var a=Lo.enableDataStack(e,i,{byIndex:!0,stackedCoordDimension:"z"}),s=new No(i,e);return s.setCalculationInfo(a),s.initData(r),s}var ks=Po.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return uf(this,e)},getInitialData:function(e,t){var r=e.data;function n(Y){return!(isNaN(Y.min)||isNaN(Y.max)||isNaN(Y.step))}function i(Y){var O=$a;return Math.max(O(Y.min),O(Y.max),O(Y.step))+1}if(!r)if(e.parametric){var x=e.parametricEquation||{},E=x.u||{},S=x.v||{};["u","v"].forEach(function(O){n(x[O])}),["x","y","z"].forEach(function(O){x[O]});var R=Math.floor((E.max+E.step-E.min)/E.step),w=Math.floor((S.max+S.step-S.min)/S.step);r=new Float32Array(R*w*5);for(var M=i(E),F=i(S),d=0,f=0;f0;this._updateSurfaceMesh(this._surfaceMesh,e,u,f);var v=this._surfaceMesh.material;f?(v.define("WIREFRAME_QUAD"),v.set("wireframeLineWidth",d),v.set("wireframeLineColor",k.parseColor(h.get("lineStyle.color")))):v.undefine("WIREFRAME_QUAD"),this._initHandler(e,r),this._updateAnimation(e)},_updateAnimation:function(e){k.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new k.Mesh({geometry:new k.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new k.Material({shader:new k.Shader(k.Shader.source("ecgl.sm.depth.vertex"),k.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,lf),e},_initHandler:function(e,t){var r=e.getData(),n=this._surfaceMesh,i=e.coordinateSystem;function a(o,l){for(var c=1/0,u=-1,h=[],d=0;d=0){var c=[];n.geometry.attributes.position.get(l,c);for(var u=i.pointToData(c),h=1/0,d=-1,f=[],v=0;v65535?Uint32Array:Uint16Array)((v-1)*(_-1)*6),S=function(lt,qt,_t){_t[1]=lt*_+qt,_t[0]=lt*_+qt+1,_t[3]=(lt+1)*_+qt+1,_t[2]=(lt+1)*_+qt},R=!1;if(l){var w=[],M=[],F=0;p?u.init(i.vertexCount):u.value=null;for(var b=[[],[],[]],U=[],I=[],N=Ht.create(),G=function(lt,qt,_t){var En=qt*3;return _t[0]=lt[En],_t[1]=lt[En+1],_t[2]=lt[En+2],_t},B=new Float32Array(s.length),Y=new Float32Array(s.length/3*4),O=0;O0;){if(Math.floor(o/u)===o/u)return[u,o/u];u--}return u=Math.floor(Math.sqrt(o)),[u,u]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function _f(e){e.registerChartView(vf),e.registerSeriesModel(ff),e.registerLayout(function(t,r){t.eachSeriesByType("surface",function(n){var i=n.coordinateSystem;!i||i.type;var a=n.getData(),s=new Float32Array(3*a.count()),o=[NaN,NaN,NaN];if(i&&i.type==="cartesian3D"){var l=i.dimensions,c=l.map(function(u){return n.coordDimToDataDim(u)[0]});a.each(c,function(u,h,d,f){var v;a.hasValue(f)?v=i.dataToPoint([u,h,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 mf=Object.defineProperty,pf=Object.getOwnPropertyDescriptor,jt=(e,t,r,n)=>{for(var i=n>1?void 0:n?pf(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(i=(n?s(t,r,i):s(i))||i);return n&&i&&mf(t,r,i),i};Oo([Io,Bo,sf,_f]);let Tt=class extends Et(At,Cr,Qs){get chart(){var e,t;return(t=(e=this.$refs.heightmap)==null?void 0:e.chart)!=null?t:null}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:14}},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 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:1},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.probed_matrix[0].length,r=this.bed_mesh.probed_matrix.length,n=this.bed_mesh.mesh_min[0],i=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(i-n)/(t-1),l=(s-a)/(r-1),c=[];let u=0;this.bed_mesh.probed_matrix.forEach(h=>{let d=0;h.forEach(f=>{c.push([n+o*d,a+l*u,f]),d++}),u++}),e.data=c,e.dataShape=[r,t]}return e}get seriesMesh(){const e={type:"surface",name:"mesh",data:[],itemStyle:{opacity:1},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.mesh_matrix[0].length,r=this.bed_mesh.mesh_matrix.length,n=this.bed_mesh.mesh_min[0],i=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(i-n)/(t-1),l=(s-a)/(r-1),c=[];let u=0;this.bed_mesh.mesh_matrix.forEach(h=>{let d=0;h.forEach(f=>{c.push([n+o*d,a+l*u,f]),d++}),u++}),e.data=c,e.dataShape=[r,t]}return e}get seriesFlat(){var r,n,i,a;const e={type:"surface",name:"flat",data:[],itemStyle:{color:[1,1,1,1],opacity:.5},wireframe:{show:this.wireframe}},t=(n=(r=this.$store.state.printer.configfile)==null?void 0:r.settings)==null?void 0:n.bed_mesh;if(t){let s=[1,1];t.probe_count&&typeof t.probe_count=="string"?s=t.probe_count.split(","):t.probe_count?s=t.probe_count.length<2?[t.probe_count,t.probe_count]:t.probe_count:t.round_probe_count&&(s=[t.round_probe_count,t.round_probe_count]);let o=(i=t.mesh_min)!=null?i:[0,0],l=(a=t.mesh_max)!=null?a:[200,200];"mesh_radius"in t&&(o=[t.mesh_radius*-1,t.mesh_radius*-1],l=[t.mesh_radius,t.mesh_radius]);const c=s[0],u=s[1],h=parseFloat(o[0]),d=parseFloat(l[0]),f=parseFloat(o[1]),v=parseFloat(l[1]),_=(d-h)/(c-1),m=(v-f)/(u-1),p=[];for(let y=0;y".concat(e.seriesName,"")),Object.keys(e.encode).sort().forEach(r=>{const n=e.data[e.encode[r][0]].toFixed(r==="z"?3:1);t.push("".concat(r.toUpperCase(),": ").concat(n," mm"))}),t.join("
")}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}};jt([Ke({type:Boolean,default:!1})],Tt.prototype,"showProbed",2);jt([Ke({type:Boolean,default:!1})],Tt.prototype,"showMesh",2);jt([Ke({type:Boolean,default:!1})],Tt.prototype,"showFlat",2);jt([Ke({type:Boolean,default:!1})],Tt.prototype,"wireframe",2);jt([Ke({type:Boolean,default:!1})],Tt.prototype,"scaleGradient",2);jt([Ke({type:Number,default:1})],Tt.prototype,"scaleZMax",2);Tt=jt([vt],Tt);var gf=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("e-chart",{ref:"heightmap",staticStyle:{height:"600px",width:"100%",overflow:"hidden"},attrs:{option:e.chartOptions,"init-options":{renderer:"canvas"}}})},xf=[];const Fa={};var yf=St(Tt,gf,xf,!1,Tf,null,null,null);function Tf(e){for(let t in Fa)this[t]=Fa[t]}const Ef=function(){return yf.exports}();var Af=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r(Wt,{attrs:{"card-class":"heightmap-map-panel",title:e.$t("Heightmap.Heightmap"),icon:e.mdiGrid},scopedSlots:e._u([{key:"buttons",fn:function(){return[r(Pe,{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(gt,[e._v(e._s(e.mdiHome))])],1),e.is_active?r(Pe,{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(Pe,{staticClass:"d-none d-sm-flex",attrs:{text:"",tile:"",loading:e.loadings.includes("bedMeshCalibrate"),disabled:e.printerIsPrinting,title:e.$t("Heightmap.TitleCalibrate")},on:{click:function(n){e.calibrateDialog=!0}}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])]},proxy:!0}])},[r(ft,{staticClass:"d-sm-none text-center pb-0"},[r(to,{staticClass:"v-btn-toggle",attrs:{tile:"",name:"controllers"}},[r(Pe,{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(gt,{attrs:{color:e.homedAxes.includes("xyz")?"primary":"warning",small:""}},[e._v(" "+e._s(e.mdiHome)+" ")])],1),e.bed_mesh?r(Pe,{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(Pe,{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:function(n){e.calibrateDialog=!0}}},[e._v(" "+e._s(e.$t("Heightmap.Calibrate"))+" ")])],1)],1),e.is_active?[r(ft,{staticClass:"py-0 px-0"},[r(ht,[r(we,{},[r(Ef,{attrs:{"show-probed":e.showProbed,"show-mesh":e.showMesh,"show-flat":e.showFlat,wireframe:e.wireframe,"scale-gradient":e.scaleGradient,"scale-z-max":e.scaleZMax}})],1)],1),r(ht,[r(we,{staticClass:"col-12 col-sm-auto pt-0 pb-0 pl-lg-6 d-flex justify-center justify-sm-start"},[r(ro,{staticClass:"mt-0 ml-5",attrs:{label:e.$t("Heightmap.ScaleGradient")},model:{value:e.scaleGradient,callback:function(n){e.scaleGradient=n},expression:"scaleGradient"}})],1),r(we,{staticClass:"d-flex justify-center pt-0 pb-6 pb-lg-3"},[r(Ur,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Probed"),"hide-details":""},model:{value:e.showProbed,callback:function(n){e.showProbed=n},expression:"showProbed"}}),r(Ur,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Mesh"),"hide-details":""},model:{value:e.showMesh,callback:function(n){e.showMesh=n},expression:"showMesh"}}),r(Ur,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Flat"),"hide-details":""},model:{value:e.showFlat,callback:function(n){e.showFlat=n},expression:"showFlat"}}),r(Ur,{staticClass:"mx-3 mt-0",attrs:{label:e.$t("Heightmap.Wireframe"),"hide-details":""},model:{value:e.wireframe,callback:function(n){e.wireframe=n},expression:"wireframe"}})],1)],1)],1),r(nr),r(ft,{staticClass:"pt-0 pb-3"},[r(ht,[r(we,[r(no,{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(n){e.scaleZMax=n},expression:"scaleZMax"}})],1)],1)],1)]:[r(ft,{staticClass:"text-center py-3 font-italic"},[e._v(" "+e._s(e.$t("Heightmap.NoBedMeshHasBeenLoadedYet"))+" ")])],r(Qa,{attrs:{show:e.calibrateDialog},on:{close:function(n){e.calibrateDialog=!1}}})],2)},Sf=[];const Ua={};var wf=St(Kn,Af,Sf,!1,bf,null,null,null);function bf(e){for(let t in Ua)this[t]=Ua[t]}const Cf=function(){return wf.exports}();var Rf=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r(ht,[e.klipperReadyForGui?[r(we,{staticClass:"col-12 col-md-8 pb-0"},[r(Cf)],1),r(we,{staticClass:"col-12 col-md-4"},[r(El),r(hl)],1)]:[r(we,[r(io,{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)]],2)],1)},Mf=[];const Ha={};var Lf=St(qn,Rf,Mf,!1,Nf,null,null,null);function Nf(e){for(let t in Ha)this[t]=Ha[t]}const Ff=function(){return Lf.exports}();export{Ff as default}; diff --git a/assets/Heightmap-acf3d6b7.css b/assets/Heightmap-acf3d6b7.css new file mode 100644 index 0000000..145e559 --- /dev/null +++ b/assets/Heightmap-acf3d6b7.css @@ -0,0 +1 @@ +.currentMeshName[data-v-2234b010],.currentMeshName[data-v-a3cfb25c]{color:var(--v-primary-base)}.currentMeshName .v-icon[data-v-a3cfb25c]{opacity:0}.currentMeshName:hover .v-icon[data-v-a3cfb25c]{opacity:1} diff --git a/assets/Hlsstreamer-d1b15932.js b/assets/Hlsstreamer-d1b15932.js new file mode 100644 index 0000000..7a8b390 --- /dev/null +++ b/assets/Hlsstreamer-d1b15932.js @@ -0,0 +1 @@ +import{m as nr,B as ar,G as or,P as ai,C as lr,n as cr}from"./index-17a5ec1d.js";import"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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/assets/Hlsstreamer-f9f189cf.css b/assets/Hlsstreamer-f9f189cf.css new file mode 100644 index 0000000..5db5021 --- /dev/null +++ b/assets/Hlsstreamer-f9f189cf.css @@ -0,0 +1 @@ +.webcamImage[data-v-16b345da]{width:100%} diff --git a/assets/Ipstreamer-d64872ad.js b/assets/Ipstreamer-d64872ad.js new file mode 100644 index 0000000..abc317e --- /dev/null +++ b/assets/Ipstreamer-d64872ad.js @@ -0,0 +1 @@ +import{m as p,B as _,G as u,P as m,C as v,n as f}from"./index-17a5ec1d.js";import"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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 O=function(){return d.exports}();export{O as default}; diff --git a/assets/Ipstreamer-f951d43b.css b/assets/Ipstreamer-f951d43b.css new file mode 100644 index 0000000..abfc875 --- /dev/null +++ b/assets/Ipstreamer-f951d43b.css @@ -0,0 +1 @@ +.webcamImage[data-v-bd59f4b0]{width:100%} diff --git a/assets/JMuxerStream-8716a630.js b/assets/JMuxerStream-8716a630.js new file mode 100644 index 0000000..14a8323 --- /dev/null +++ b/assets/JMuxerStream-8716a630.js @@ -0,0 +1 @@ +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,C as ge,n as ke}from"./index-17a5ec1d.js";import{l as be,m as Se,q as we}from"./vuetify-4c65b4c3.js";import"./echarts-ff51454d.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 C(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 q(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}(),H=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 A("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:q(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){A("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"):(A("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=q(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==""&&A("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{A("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=q(this.remainingData,r.video);var c=re(H.extractNALu(r.video),2);if(n=c[0],s=c[1],this.remainingData=s||new Uint8Array,!(n.length>0))return A("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 A("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):A("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||H.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 A("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 Ce=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,F=(d,g,v,k)=>{for(var h=k>1?void 0:k?Ae(g,v):g,C=d.length-1,m;C>=0;C--)(m=d[C])&&(h=(k?m(g,v,h):m(h))||h);return k&&h&&Ce(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 C;(C=this.jmuxer)==null||C.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/assets/JMuxerStream-baf633f9.css b/assets/JMuxerStream-baf633f9.css new file mode 100644 index 0000000..4988b97 --- /dev/null +++ b/assets/JMuxerStream-baf633f9.css @@ -0,0 +1 @@ +.webcamImage[data-v-03ec43aa]{width:100%}._webcam_jmuxer_output[data-v-03ec43aa]{aspect-ratio:1.5} diff --git a/assets/JanusStreamer-3206d816.css b/assets/JanusStreamer-3206d816.css new file mode 100644 index 0000000..cc8fddd --- /dev/null +++ b/assets/JanusStreamer-3206d816.css @@ -0,0 +1 @@ +.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/assets/JanusStreamer-caeac552.js b/assets/JanusStreamer-caeac552.js new file mode 100644 index 0000000..828e2af --- /dev/null +++ b/assets/JanusStreamer-caeac552.js @@ -0,0 +1,8 @@ +import{m as cv,B as fv,G as lv,P as Hu,W as dv,R as pv,C as hv,n as gv}from"./index-17a5ec1d.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-ff51454d.js";import{l as mv,m as vv,q as yv}from"./vuetify-4c65b4c3.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/assets/Mjpegstreamer-181c3267.js b/assets/Mjpegstreamer-181c3267.js new file mode 100644 index 0000000..12285dd --- /dev/null +++ b/assets/Mjpegstreamer-181c3267.js @@ -0,0 +1 @@ +import{m as y,B as w,G as C,P as d,W as R,C as P,n as x}from"./index-17a5ec1d.js";import"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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 L="content-length",j="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()===L&&(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,"414cdb59",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/assets/Mjpegstreamer-7069622c.css b/assets/Mjpegstreamer-7069622c.css new file mode 100644 index 0000000..527c655 --- /dev/null +++ b/assets/Mjpegstreamer-7069622c.css @@ -0,0 +1 @@ +.webcamImage[data-v-414cdb59]{width:100%;background:lightgray}.webcamFpsOutput[data-v-414cdb59]{display:inline-block;position:absolute;bottom:0;right:0;background:rgba(0,0,0,.8);padding:3px 10px;border-top-left-radius:5px}html.theme--light .webcamFpsOutput[data-v-414cdb59]{background:rgba(255,255,255,.7)} diff --git a/assets/MjpegstreamerAdaptive-4819ecfb.js b/assets/MjpegstreamerAdaptive-4819ecfb.js new file mode 100644 index 0000000..6d9e2f4 --- /dev/null +++ b/assets/MjpegstreamerAdaptive-4819ecfb.js @@ -0,0 +1 @@ +import{m as u,B as p,G as d,P as m,C as _,n as g}from"./index-17a5ec1d.js";import{q as f}from"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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,"3879a368",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/assets/MjpegstreamerAdaptive-edd84448.css b/assets/MjpegstreamerAdaptive-edd84448.css new file mode 100644 index 0000000..a1ff612 --- /dev/null +++ b/assets/MjpegstreamerAdaptive-edd84448.css @@ -0,0 +1 @@ +.webcamImage[data-v-3879a368]{width:100%}.webcamFpsOutput[data-v-3879a368]{display:inline-block;position:absolute;bottom:0;right:0;background:rgba(0,0,0,.8);padding:3px 10px;border-top-left-radius:5px}html.theme--light .webcamFpsOutput[data-v-3879a368]{background:rgba(255,255,255,.7)} diff --git a/assets/Uv4lMjpeg-486d8a68.css b/assets/Uv4lMjpeg-486d8a68.css new file mode 100644 index 0000000..0e82716 --- /dev/null +++ b/assets/Uv4lMjpeg-486d8a68.css @@ -0,0 +1 @@ +.webcamImage[data-v-3177fd01]{width:100%;background:lightgray} diff --git a/assets/Uv4lMjpeg-63b5ce35.js b/assets/Uv4lMjpeg-63b5ce35.js new file mode 100644 index 0000000..028fde8 --- /dev/null +++ b/assets/Uv4lMjpeg-63b5ce35.js @@ -0,0 +1 @@ +import{m as h,B as p,G as u,P as m,W as v,C as g,n as b}from"./index-17a5ec1d.js";import"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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,V,"3177fd01",null,null);function V(e){for(let t in c)this[t]=c[t]}const M=function(){return w.exports}();export{M as default}; diff --git a/assets/Viewer-815597de.css b/assets/Viewer-815597de.css new file mode 100644 index 0000000..15d147f --- /dev/null +++ b/assets/Viewer-815597de.css @@ -0,0 +1 @@ +[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-a01a7710]{position:relative;left:0;right:0;bottom:5px} diff --git a/assets/Viewer-ac934cb5.js b/assets/Viewer-ac934cb5.js new file mode 100644 index 0000000..d2d8fd8 --- /dev/null +++ b/assets/Viewer-ac934cb5.js @@ -0,0 +1 @@ +import{k as Iu,l as Au,W as nt,C as ka,P as Ar,n as Va,m as ql,B as $l,o as Cu,p as Mu,q as Ru,r as Pu,s as wu,t as Du,u as Fu,v as Ou,w as Lu,x as Bu,y as Nu,z as Uu,A as ku,D as Yo,E as jl,_ as Zl,R as Ql}from"./index-17a5ec1d.js";import{V as Vu,f as Nt,c as Ei,i as qo,l as Kn,m as cs,A as Gu,T as zu,C as $o,D as Wu,E as Xu,t as Ni,p as Ui,x as Hu,a2 as jo,j as $r,h as Ku,_ as Yu,a as qu,b as $u,o as ju,d as Zu}from"./vuetify-4c65b4c3.js";import{E as Qu,b as Ju,a as ef}from"./codemirror-0a1db0c7.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.js";function tf(a,e){return e===void 0&&(e={}),function(t,i){Iu(e,t,i),Au(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 sf{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 nf{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(){this._remove&&this._remove()}}class Q{static FromPromise(e,t){const i=new Q;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 sf(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,n=!1){if(!e)return null;const r=new nf(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._remove=()=>{this.remove(r)},r}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!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(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new Q;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 rf{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 Zo;(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"})(Zo||(Zo={}));class Et extends rf{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 Q,this.onErrorObservable=new Q,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=0,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._creationFlags=0,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._premulAlpha=!1,this._dynamicTextureSource=null,this._engine=e,this._source=t,this._uniqueId=Et._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 t,i;if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const s=this.onRebuildCallback(this),n=r=>{r._swapAndDie(this,!1),this.isReady=s.isReady};s.isAsync?s.proxy.then(n):n(s.proxy);return}let e;switch(this.source){case 2:break;case 1:e=this._engine.createTexture((t=this._originalUrl)!=null?t:this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,s=>{s._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 3:e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer),e._swapAndDie(this,!1),this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,(i=this._originalFormat)!=null?i:this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,s=>{s&&s._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),e._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){var n;(n=this._hardwareTexture)==null||n.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),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 i=this._engine.getLoadedTexturesCache();let s=i.indexOf(this);s!==-1&&i.splice(s,1),s=i.indexOf(e),s===-1&&i.push(e)}dispose(){this._references--,this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._references===0&&(this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}Et._Counter=0;class Ce{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}Ce.Instances=[];Ce.OnEnginesDisposedObservable=new Q;Ce._LastCreatedScene=null;Ce.UseFallbackTexture=!0;Ce.FallbackTexture="";class af{constructor(){this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){return this.isParallelCompiled}get isReady(){return this.program?this.isParallelCompiled?this.engine._isRenderingStateCompiled(this):!0:!1}_handlesSpectorRebuildCallback(e){e&&this.program&&e(this.program)}setEngine(e){this.engine=e}_fillEffectInformation(e,t,i,s,n,r,o,l){const h=this.engine;if(h.supportsUniformBuffers)for(const f in t)e.bindUniformBlock(f,t[f]);this.engine.getUniforms(this,i).forEach((f,d)=>{s[i[d]]=f}),this._uniforms=s;let u;for(u=0;u{r[f]=d});for(const f of h.getAttributes(this,o))l.push(f)}dispose(){this._uniforms={},this._isDisposed=!0}_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.asArray())||(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}}const Qo={};function Te(a,e=!1){if(!(e&&Qo[a]))return Qo[a]=!0,"".concat(a," needs to be imported before as it contains a side-effect required by your code.")}function St(){return typeof window<"u"}function Xs(){return typeof navigator<"u"}function xn(){return typeof document<"u"}function Ga(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}const or={};function Jl(a,e,t=""){return t+(e?e+"\n":"")+a}function eh(a,e,t,i,s,n,r){const o=r||or.loadFile;if(o)return o(a,e,t,i,s,n);throw Te("FileTools")}function th(a,e,t,i){if(a){e?a.IS_NDC_HALF_ZRANGE="":delete a.IS_NDC_HALF_ZRANGE,t?a.USE_REVERSE_DEPTHBUFFER="":delete a.USE_REVERSE_DEPTHBUFFER,i?a.USE_EXACT_SRGB_CONVERSIONS="":delete a.USE_EXACT_SRGB_CONVERSIONS;return}else{let s="";return e&&(s+="#define IS_NDC_HALF_ZRANGE"),t&&(s&&(s+="\n"),s+="#define USE_REVERSE_DEPTHBUFFER"),i&&(s&&(s+="\n"),s+="#define USE_EXACT_SRGB_CONVERSIONS"),s}}const ua=new WeakMap,of={_webGLVersion:2,cachedPipelines:{}};function li(a){let e=ua.get(a);if(!e){if(!a)return of;e={_webGLVersion:a.TEXTURE_BINDING_3D?2:1,_context:a,cachedPipelines:{}},ua.set(a,e)}return e}function lf(a){ua.delete(a)}function ih(a,e,t,i,s,n){var h;const r=li(i);n||(n=(h=r._createShaderProgramInjection)!=null?h:za);const o=fa(e,"vertex",i,r._contextWasLost),l=fa(t,"fragment",i,r._contextWasLost);return n(a,o,l,i,s,r.validateShaderPrograms)}function sh(a,e,t,i,s,n=null,r){var u;const o=li(s);r||(r=(u=o._createShaderProgramInjection)!=null?u:za);const l=o._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"",h=Jo(e,"vertex",i,l,s,o._contextWasLost),c=Jo(t,"fragment",i,l,s,o._contextWasLost);return r(a,h,c,s,n,o.validateShaderPrograms)}function hf(a,e){const t=new af,i=li(a);return i.parallelShaderCompile&&(t.isParallelCompiled=!0),t.context=i._context,t}function za(a,e,t,i,s=null,n){const r=i.createProgram();if(a.program=r,!r)throw new Error("Unable to create program");return i.attachShader(r,e),i.attachShader(r,t),i.linkProgram(r),a.context=i,a.vertexShader=e,a.fragmentShader=t,a.isParallelCompiled||nh(a,i,n),r}function nh(a,e,t){const i=a.context,s=a.vertexShader,n=a.fragmentShader,r=a.program;if(!i.getProgramParameter(r,i.LINK_STATUS)){if(!e.getShaderParameter(s,e.COMPILE_STATUS)){const h=e.getShaderInfoLog(s);if(h)throw a.vertexCompilationError=h,new Error("VERTEX SHADER "+h)}if(!e.getShaderParameter(n,e.COMPILE_STATUS)){const h=e.getShaderInfoLog(n);if(h)throw a.fragmentCompilationError=h,new Error("FRAGMENT SHADER "+h)}const l=i.getProgramInfoLog(r);if(l)throw a.programLinkError=l,new Error(l)}if(t&&(i.validateProgram(r),!i.getProgramParameter(r,i.VALIDATE_STATUS))){const h=i.getProgramInfoLog(r);if(h)throw a.programValidationError=h,new Error(h)}i.deleteShader(s),i.deleteShader(n),a.vertexShader=void 0,a.fragmentShader=void 0,a.onCompiled&&(a.onCompiled(),a.onCompiled=void 0)}function cf(a,e,t,i,s,n,r,o,l,h="",c,u){var p,g;const f=li(a.context);c||(c=(p=f.createRawShaderProgramInjection)!=null?p:ih),u||(u=(g=f.createShaderProgramInjection)!=null?g:sh);const d=a;i?d.program=c(d,e,t,d.context,l):d.program=u(d,e,t,o,d.context,l),d.program.__SPECTOR_rebuildProgram=r}function Jo(a,e,t,i,s,n){return fa(Jl(a,t,i),e,s,n)}function fa(a,e,t,i){const s=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!s){let n=t.NO_ERROR,r=t.NO_ERROR;for(;(r=t.getError())!==t.NO_ERROR;)n=r;throw new Error("Something went wrong while creating a gl ".concat(e," shader object. gl error=").concat(n,", gl isContextLost=").concat(t.isContextLost(),", _contextWasLost=").concat(i))}return t.shaderSource(s,a),t.compileShader(s),s}function uf(a,e){e.useProgram(a)}function ff(a,e){const t=a;if(!t.isParallelCompiled){e(a);return}const i=t.onCompiled;t.onCompiled=()=>{i==null||i(),e(a)}}function rh(a){return a.getPipelineContext===void 0}class U{static _CheckLimit(e,t){let i=U._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},U._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){var n;const i=U._LogLimitOutputs[e];if(!i||!U.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&U[s.name](U.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,(n=s.name)!=null?n:""))}static _AddLogEntry(e){U._LogCache=e+U._LogCache,U.OnNewCacheEntry&&U.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){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!U._CheckLimit(s,i))return;const n=U._FormatMessage(s),r=this._Levels[e],o=Array.isArray(t)?t.slice(1):[];r.logFunc&&r.logFunc("BJS - "+n,...o);const l="
").concat(n,"

");U._AddLogEntry(l),U._GenerateLimitMessage(s,e)}static get LogCache(){return U._LogCache}static ClearLogCache(){U._LogCache="",U._LogLimitOutputs={},U.errorsCount=0}static set LogLevels(e){U.Log=U._LogDisabled,U.Warn=U._LogDisabled,U.Error=U._LogDisabled,[U.MessageLogLevel,U.WarningLogLevel,U.ErrorLogLevel].forEach(t=>{if((e&t)===t){const i=this._Levels[t];U[i.name]=U._LogEnabled.bind(U,t)}})}}U.NoneLogLevel=0;U.MessageLogLevel=1;U.WarningLogLevel=2;U.ErrorLogLevel=4;U.AllLogLevel=7;U.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";U._LogCache="";U._LogLimitOutputs={};U._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];U.errorsCount=0;U.Log=U._LogEnabled.bind(U,U.MessageLogLevel);U.Warn=U._LogEnabled.bind(U,U.WarningLogLevel);U.Error=U._LogEnabled.bind(U,U.ErrorLogLevel);class df{constructor(){this.shaderLanguage=0}postProcessor(e,t,i,s,n){if(n.drawBuffersExtensionDisabled){const r=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(r,"")}return e}}const pf=/(flat\s)?\s*varying\s*.*/;class _f{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return pf.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){const s=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,n=/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;if(e=e.replace(n,""),e=e.replace(/texture2D\s*\(/g,"texture("),i){const r=e.search(/layout *\(location *= *0\) *out/g)!==-1;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(/void\s+?main\s*\(/g,(s||r?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define MULTIVIEW")!==-1)return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}class on{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=on._Counter++}}on._Counter=0;class Sn extends on{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function gf(a){let e=1;do e*=2;while(ea-t?t:e}function Xa(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}function Cr(a){return a=a|a>>1,a=a|a>>2,a=a|a>>4,a=a|a>>8,a=a|a>>16,a-(a>>1)}function fi(a,e,t=2){let i;switch(t){case 1:i=Cr(a);break;case 2:i=Wa(a);break;case 3:default:i=Xa(a);break}return Math.min(i,e)}class K{static GetShadersRepository(e=0){return e===0?K.ShadersRepository:K.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?K.ShadersStore:K.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?K.IncludesShadersStore:K.IncludesShadersStoreWGSL}}K.ShadersRepository="src/Shaders/";K.ShadersStore={};K.IncludesShadersStore={};K.ShadersRepositoryWGSL="src/ShadersWGSL/";K.ShadersStoreWGSL={};K.IncludesShadersStoreWGSL={};const mf="attribute",vf="varying";class On{constructor(){this.children=[]}isValid(e){return!0}process(e,t){var s,n,r,o,l,h,c;let i="";if(this.line){let u=this.line;const f=t.processor;if(f){f.lineProcessor&&(u=f.lineProcessor(u,t.isFragment,t.processingContext));const d=(n=(s=t.processor)==null?void 0:s.attributeKeywordName)!=null?n:mf,p=t.isFragment&&((r=t.processor)!=null&&r.varyingFragmentKeywordName)?(o=t.processor)==null?void 0:o.varyingFragmentKeywordName:!t.isFragment&&((l=t.processor)!=null&&l.varyingVertexKeywordName)?(h=t.processor)==null?void 0:h.varyingVertexKeywordName:vf;!t.isFragment&&f.attributeProcessor&&this.line.startsWith(d)?u=f.attributeProcessor(this.line,e,t.processingContext):f.varyingProcessor&&((c=f.varyingCheck)!=null&&c.call(f,this.line,t.isFragment)||!f.varyingCheck&&this.line.startsWith(p))?u=f.varyingProcessor(this.line,t.isFragment,e,t.processingContext):f.uniformProcessor&&f.uniformRegexp&&f.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&f.uniformBufferRegexp&&f.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):f.textureProcessor&&f.textureRegexp&&f.textureRegexp.test(this.line)?u=f.textureProcessor(this.line,t.isFragment,e,t.processingContext):(f.uniformProcessor||f.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?f.uniformProcessor&&(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,f.endOfUniformBufferProcessor&&(u=f.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}i+=u+"\n"}return this.children.forEach(u=>{i+=u.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),i}}class xf{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex1&&this._lines.push(i);else{const n=t.split(";");for(let r=0;r{c=c.trim(),c!==""&&(i.push(c),c="")},r=u=>{sht._Stack[s],l=()=>s===-1?"!!INVALID EXPRESSION!!":ht._Stack[s--];let h=0,c="";for(;h1){for(n();s!==-1&&ht._OperatorPriority[o()]>=ht._OperatorPriority[f];)i.push(l());r(f),h++}else c+=u;h++}for(n();s!==-1;)o()==="("?l():i.push(l());return ht._InfixToPostfixCache.size>=ht.InfixToPostfixCacheLimitSize&&ht.ClearCache(),ht._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(ht._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t":i=s>n;break;case"<":i=s=":i=s>=n;break;case"==":i=s===n;break;case"!=":i=s!==n;break}return i}}const Ef=/defined\s*?\((.+?)\)/g,Zr=/defined\s*?\[(.+?)\]/g,If=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,Af=/__decl__/,e0=/light\{X\}.(\w*)/g,t0=/\{X\}/g,Yn=[],Cf=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function ah(a){a.processor&&a.processor.initializeShaders&&a.processor.initializeShaders(a.processingContext)}function i0(a,e,t,i){var s;(s=e.processor)!=null&&s.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),En(a,e,n=>{e.processCodeAfterIncludes&&(n=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",n,e.defines));const r=wf(n,e,i);t(r,n)})}function Mf(a,e,t,i){var s;(s=e.processor)!=null&&s.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),En(a,e,n=>{e.processCodeAfterIncludes&&(n=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",n,e.defines));const r=Df(n,e,i);t(r,n)})}function oh(a,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:a,fragmentCode:e}:t.processor.finalizeShaders(a,e,t.processingContext)}function Rf(a,e){var i;if((i=e.processor)!=null&&i.noPrecision)return a;const t=e.shouldUseHighPrecisionShader;return a.indexOf("precision highp float")===-1?t?a="precision highp float;\n"+a:a="precision mediump float;\n"+a:t||(a=a.replace("precision highp float","precision mediump float")),a}function Qr(a){const t=/defined\((.+)\)/.exec(a);if(t&&t.length)return new lr(t[1].trim(),a[0]==="!");const i=["==","!=",">=","<=","<",">"];let s="",n=0;for(s of i)if(n=a.indexOf(s),n>-1)break;if(n===-1)return new lr(a);const r=a.substring(0,n).trim(),o=a.substring(n+s.length).trim();return new Sf(r,s,o)}function Pf(a){a=a.replace(Ef,"defined[$1]");const e=ht.infixToPostfix(a),t=[];for(const s of e)if(s!=="||"&&s!=="&&")t.push(s);else if(t.length>=2){let n=t[t.length-1],r=t[t.length-2];t.length-=2;const o=s=="&&"?new Tf:new yf;typeof n=="string"&&(n=n.replace(Zr,"defined($1)")),typeof r=="string"&&(r=r.replace(Zr,"defined($1)")),o.leftOperand=typeof r=="string"?Qr(r):r,o.rightOperand=typeof n=="string"?Qr(n):n,t.push(o)}let i=t[t.length-1];return typeof i=="string"&&(i=i.replace(Zr,"defined($1)")),typeof i=="string"?Qr(i):i}function tr(a,e){const t=new bf,i=a.substring(0,e);let s=a.substring(e);return s=s.substring(0,(s.indexOf("//")+1||s.length+1)-1).trim(),i==="#ifdef"?t.testExpression=new lr(s):i==="#ifndef"?t.testExpression=new lr(s,!0):t.testExpression=Pf(s),t}function Jr(a,e,t){let i=a.currentLine;for(;pa(a,t);){i=a.currentLine;const s=i.substring(0,5).toLowerCase();if(s==="#else"){const n=new On;e.children.push(n),pa(a,n);return}else if(s==="#elif"){const n=tr(i,5);e.children.push(n),t=n}}}function pa(a,e){for(;a.canRead;){a.lineIndex++;const t=a.currentLine;if(t.indexOf("#")>=0){const s=Cf.exec(t);if(s&&s.length){switch(s[0]){case"#ifdef":{const r=new jr;e.children.push(r);const o=tr(t,6);r.children.push(o),Jr(a,r,o);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const r=new jr;e.children.push(r);const o=tr(t,7);r.children.push(o),Jr(a,r,o);break}case"#if":{const r=new jr,o=tr(t,3);e.children.push(r),r.children.push(o),Jr(a,r,o);break}}continue}}const i=new On;if(i.line=t,e.children.push(i),t[0]==="#"&&t[1]==="d"){const s=t.replace(";","").split(" ");i.additionalDefineKey=s[1],s.length===3&&(i.additionalDefineValue=s[2])}}return!1}function lh(a,e,t){const i=new On,s=new xf;return s.lineIndex=-1,s.lines=a.split("\n"),pa(s,i),i.process(e,t)}function hh(a,e){var s;const t=a.defines,i={};for(const n of t){const o=n.replace("#define","").replace(";","").trim().split(" ");i[o[0]]=o.length>1?o[1]:""}return((s=a.processor)==null?void 0:s.shaderLanguage)===0&&(i.GL_ES="true"),i.__VERSION__=a.version,i[a.platformName]="true",th(i,e==null?void 0:e.isNDCHalfZRange,e==null?void 0:e.useReverseDepthBuffer,e==null?void 0:e.useExactSrgbConversions),i}function wf(a,e,t){let i=Rf(a,e);if(!e.processor||e.processor.shaderLanguage===0&&i.indexOf("#version 3")!==-1&&(i=i.replace("#version 300 es",""),!e.processor.parseGLES3))return i;const s=e.defines,n=hh(e,t);return e.processor.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext)),i=lh(i,n,e),e.processor.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{})),t!=null&&t._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function Df(a,e,t){var r,o;let i=a;const s=e.defines,n=hh(e,t);return(r=e.processor)!=null&&r.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext)),i=lh(i,n,e),(o=e.processor)!=null&&o.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{})),t._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function En(a,e,t){Yn.length=0;let i;for(;(i=If.exec(a))!==null;)Yn.push(i);let s=String(a),n=[a],r=!1;for(const o of Yn){let l=o[1];if(l.indexOf("__decl__")!==-1&&(l=l.replace(Af,""),e.supportsUniformBuffers&&(l=l.replace("Vertex","Ubo").replace("Fragment","Ubo")),l=l+"Declaration"),e.includesShadersStore[l]){let h=e.includesShadersStore[l];if(o[2]){const u=o[3].split(",");for(let f=0;fx+"{X}")),h+=g.replace(t0,_.toString())+"\n"}else e.supportsUniformBuffers||(h=h.replace(e0,(f,d)=>d+"{X}")),h=h.replace(t0,u)}const c=[];for(const u of n){const f=u.split(o[0]);for(let d=0;d=0||h.indexOf("#include <")>=0}else{const h=e.shadersRepository+"ShadersInclude/"+l+".fx";ch.loadFile(h,c=>{e.includesShadersStore[l]=c,En(n.join(""),e,t)});return}}Yn.length=0,s=n.join(""),r?En(s.toString(),e,t):t(s)}const ch={loadFile:(a,e,t,i,s,n)=>{throw Te("FileTools")}};function Ff(a,e){return li(e).cachedPipelines[a]}function Ha(a){const e=a._name,t=a.context;if(e&&t){const i=li(t),s=i.cachedPipelines[e];s==null||s.dispose(),delete i.cachedPipelines[e]}}function Of(a,e,t,i,s,n,r){let o,l;const h=St()?n==null?void 0:n.getHostDocument():null;typeof e=="string"?o=e:e.vertexSource?o="source:"+e.vertexSource:e.vertexElement?o=(h==null?void 0:h.getElementById(e.vertexElement))||e.vertexElement:o=e.vertex||e,typeof e=="string"?l=e:e.fragmentSource?l="source:"+e.fragmentSource:e.fragmentElement?l=(h==null?void 0:h.getElementById(e.fragmentElement))||e.fragmentElement:l=e.fragment||e;const c=[void 0,void 0],u=()=>{if(c[0]&&c[1]){a.isFragment=!0;const[f,d]=c;i0(d,a,(p,g)=>{r&&(r._fragmentSourceCodeBeforeMigration=g),t&&(p=t("fragment",p));const _=oh(f,p,a);a=null;const m=Lf(_.vertexCode,_.fragmentCode,e,s);i==null||i(m.vertexSourceCode,m.fragmentSourceCode)},n)}};s0(o,"Vertex","",f=>{ah(a),i0(f,a,(d,p)=>{r&&(r._rawVertexSourceCode=f,r._vertexSourceCodeBeforeMigration=p),t&&(d=t("vertex",d)),c[0]=d,u()},n)},s),s0(l,"Fragment","Pixel",f=>{r&&(r._rawFragmentSourceCode=f),c[1]=f,u()},s)}function s0(a,e,t,i,s,n){if(typeof HTMLElement<"u"&&a instanceof HTMLElement){const l=Ga(a);i(l);return}if(a.substr(0,7)==="source:"){i(a.substr(7));return}if(a.substr(0,7)==="base64:"){const l=window.atob(a.substr(7));i(l);return}const r=K.GetShadersStore(s);if(r[a+e+"Shader"]){i(r[a+e+"Shader"]);return}if(t&&r[a+t+"Shader"]){i(r[a+t+"Shader"]);return}let o;if(a[0]==="."||a[0]==="/"||a.indexOf("http")>-1?o=a:o=K.GetShadersRepository(s)+a,n=n||eh,!n)throw new Error("loadFileInjection is not defined");n(o+"."+e.toLowerCase()+".fx",i)}function Lf(a,e,t,i){if(t){const s=t.vertexElement||t.vertex||t.spectorName||t,n=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(i===1?"//":"")+"#define SHADER_NAME vertex:"+s+"\n"+a,fragmentSourceCode:(i===1?"//":"")+"#define SHADER_NAME fragment:"+n+"\n"+e}}else return{vertexSourceCode:a,fragmentSourceCode:e}}const Bf=(a,e,t,i)=>{try{const s=a.existingPipelineContext||e(a.shaderProcessingContext);if(s._name=a.name,a.name&&a.context){const n=li(a.context);n.cachedPipelines[a.name]=s}return t(s,a.vertex,a.fragment,!!a.createAsRaw,"","",a.rebuildRebind,a.defines,a.transformFeedbackVaryings,""),i(s,()=>{var n;(n=a.onRenderingStateCompiled)==null||n.call(a,s)}),s}catch(s){throw U.Error("Error compiling effect"),s}};class Pt{static get ShadersRepository(){return K.ShadersRepository}static set ShadersRepository(e){K.ShadersRepository=e}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Q),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,i,s=null,n,r=null,o=null,l=null,h=null,c,u="",f=0){var g,_,m,x;this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new Q,this.onErrorObservable=new Q,this._onBindObservable=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._processCodeAfterIncludes=void 0,this._processFinalCode=null,this.name=e,this._key=u;const d=this._key.replace(/\r/g,"").replace(/\n/g,"|");let p;if(t.attributes){const I=t;if(this._engine=i,this._attributesNames=I.attributes,this._uniformsNames=I.uniformsNames.concat(I.samplers),this._samplerList=I.samplers.slice(),this.defines=I.defines,this.onError=I.onError,this.onCompiled=I.onCompiled,this._fallbacks=I.fallbacks,this._indexParameters=I.indexParameters,this._transformFeedbackVaryings=I.transformFeedbackVaryings||null,this._multiTarget=!!I.multiTarget,this._shaderLanguage=(g=I.shaderLanguage)!=null?g:0,I.uniformBuffersNames){this._uniformBuffersNamesList=I.uniformBuffersNames.slice();for(let T=0;T{this._vertexSourceCode=n,this._fragmentSourceCode=r,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}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)}get vertexSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:(t=(e=this._pipelineContext)==null?void 0:e._getVertexShaderCode())!=null?t:this._vertexSourceCode}get fragmentSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:(t=(e=this._pipelineContext)==null?void 0:e._getFragmentShaderCode())!=null?t:this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}getPipelineGenerationOptions(){return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split("\n"),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(n,r)=>{s&&s(r)},this.onCompiled=()=>{var r,o;const n=this.getEngine().scenes;if(n)for(let l=0;lthis._rebuildProgram(l,h,c,u),defines:s,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,parallelShaderCompile:o._caps.parallelShaderCompile,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:l=>{t&&!e&&this._engine._deletePipelineContext(t),l&&this._onRenderingStateCompiled(l)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContext.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t,i){const s=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let n=null;if(t&&e){const r=t.match(s);if(r&&r.length===2){const o=parseInt(r[1]),l=e.split("\n",-1);l.length>=o&&(n="Offending line [".concat(o,"] in ").concat(i?"fragment":"vertex"," code: ").concat(l[o-1]))}}return[e,n]}_processCompilationErrors(e,t=null){var r,o,l;this._compilationError=e.message;const i=this._attributesNames,s=this._fallbacks;if(U.Error("Unable to compile effect:"),U.Error("Uniforms: "+this._uniformsNames.map(function(h){return" "+h})),U.Error("Attributes: "+i.map(function(h){return" "+h})),U.Error("Defines:\n"+this.defines),Pt.LogShaderCodeOnCompilationError){let h=null,c=null,u=null;(r=this._pipelineContext)!=null&&r._getVertexShaderCode()&&([u,h]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),u&&(U.Error("Vertex code:"),U.Error(u))),(o=this._pipelineContext)!=null&&o._getFragmentShaderCode()&&([u,c]=this._getShaderCodeAndErrorLine((l=this._pipelineContext)==null?void 0:l._getFragmentShaderCode(),this._compilationError,!0),u&&(U.Error("Fragment code:"),U.Error(u))),h&&U.Error(h),c&&U.Error(c)}U.Error("Error: "+this._compilationError);const n=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)};t&&(this._pipelineContext=t,this._isReady=!0,n()),s?(this._pipelineContext=null,s.hasMoreFallbacks?(this._allFallbacksProcessed=!1,U.Error("Trying next fallback."),this.defines=s.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,n(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||n())}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)}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{this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,s=this._depthCullingState.depthMask,n=this._stencilState.stencilTest;await e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=s,this._stencilState.stencilTest=n,this._flagContextRestored()},0)}get isDisposed(){return this._isDisposed}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return 0}set snapshotRenderingMode(e){}getClassName(){return"AbstractEngine"}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 activeRenderLoops(){return this._activeRenderLoops}stopRenderLoop(e){if(!e){this._activeRenderLoops.length=0,this._cancelFrame();return}const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),this._activeRenderLoops.length==0&&this._cancelFrame())}_cancelFrame(){if(this._frameHandler!==0){const e=this._frameHandler;if(this._frameHandler=0,St()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if(typeof t=="function")return t(e)}else if(typeof cancelAnimationFrame=="function")return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){this.onBeginFrameObservable.notifyObservers(this)}endFrame(){this._frameId++,this.onEndFrameObservable.notifyObservers(this)}_renderLoop(){if(this._frameHandler=0,!this._contextWasLost){let e=!0;(this._isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0&&this._frameHandler===0&&(this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}_renderFrame(){for(let e=0;e-1?e.substring(b).toLowerCase():""),A=null;S.indexOf("?")>-1&&(S=S.split("?")[0]);for(const P of me._TextureLoaders)if(P.canLoad(S,p)){A=P;break}s&&s.addPendingData(T),T.url=e,T.generateMipMaps=!t,T.samplingMode=n,T.invertY=i,T._useSRGBBuffer=this._getUseSRGBBuffer(!!_,t),this._doNotHandleContextLost||(T._buffer=c);let C=null;r&&!u&&(C=T.onLoadedObservable.add(r)),u||this._internalTexturesCache.push(T);const w=(P,z)=>{s&&s.removePendingData(T),e===y?(C&&T.onLoadedObservable.remove(C),Ce.UseFallbackTexture&&e!==Ce.FallbackTexture&&this._createTextureBase(Ce.FallbackTexture,t,T.invertY,s,n,null,o,l,h,c,T),P=(P||"Unknown error")+(Ce.UseFallbackTexture?" - Fallback texture was used":""),T.onErrorObservable.notifyObservers({message:P,exception:z}),o&&o(P,z)):(U.Warn("Failed to load ".concat(e,", falling back to ").concat(y)),this._createTextureBase(y,t,T.invertY,s,n,r,o,l,h,c,T,f,d,p,g,_))};if(A){const P=z=>{A.loadData(z,T,(L,G,H,ce,J,W)=>{W?w("TextureLoader failed to load data"):l(T,S,s,{width:L,height:G},T.invertY,!H,ce,()=>(J(),!1),n)},g)};c?c instanceof ArrayBuffer?P(new Uint8Array(c)):ArrayBuffer.isView(c)?P(c):o&&o("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(e,z=>P(new Uint8Array(z)),void 0,s?s.offlineProvider:void 0,!0,(z,L)=>{w("Unable to load "+(z&&z.responseURL,L))})}else{const P=z=>{x&&!this._doNotHandleContextLost&&(T._buffer=z),l(T,S,s,z,T.invertY,t,!1,h,n)};!m||I?c&&(typeof c.decoding=="string"||c.close)?P(c):me._FileToolsLoadImage(e||"",P,w,s?s.offlineProvider:null,p,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)||c instanceof Blob?me._FileToolsLoadImage(c,P,w,s?s.offlineProvider:null,p,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):c&&P(c)}return T}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:xn()?document:null}getLoadedTexturesCache(){return this._internalTexturesCache}clearInternalTexturesCache(){this._internalTexturesCache.length=0}getCaps(){return this._caps}resetTextureCache(){for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){return this._name}set name(e){this._name=e}static get NpmPackage(){return"babylonjs@7.13.1"}static get Version(){return"7.13.1"}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}setHardwareScalingLevel(e){this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){return this._hardwareScalingLevel}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get isStencilEnable(){return this._isStencilEnable}getCreationOptions(){return this._creationOptions}constructor(e,t,i){var r,o,l,h,c,u,f,d,p,g,_;this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new uh,this._stencilStateComposer=new fh,this._stencilState=new ts,this._alphaState=new Nf,this._alphaMode=1,this._alphaEquation=0,this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this.onCanvasBlurObservable=new Q,this.onCanvasFocusObservable=new Q,this.onNewSceneAddedObservable=new Q,this.onResizeObservable=new Q,this.onCanvasPointerOutObservable=new Q,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new Q,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this._windowIsBackground=!1,this._boundRenderFunction=()=>this._renderLoop(),this.onBeforeShaderCompilationObservable=new Q,this.onAfterShaderCompilationObservable=new Q,this.onBeginFrameObservable=new Q,this.onEndFrameObservable=new Q,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new Q,this.onContextRestoredObservable=new Q,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new Q,Ce.Instances.push(this),this.startTime=xi.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,Rt.SetMatrixPrecision(!!t.useHighPrecisionMatrix),Xs()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),this.adaptToDeviceRatio=i!=null?i:!1,t.antialias=e!=null?e:t.antialias,t.deterministicLockstep=(r=t.deterministicLockstep)!=null?r:!1,t.lockstepMaxSteps=(o=t.lockstepMaxSteps)!=null?o:4,t.timeStep=(l=t.timeStep)!=null?l:1/60,t.audioEngine=(h=t.audioEngine)!=null?h:!0,t.stencil=(c=t.stencil)!=null?c:!0,this._audioContext=(f=(u=t.audioEngineOptions)==null?void 0:u.audioContext)!=null?f:null,this._audioDestination=(p=(d=t.audioEngineOptions)==null?void 0:d.audioDestination)!=null?p:null,this.premultipliedAlpha=(g=t.premultipliedAlpha)!=null?g:!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=(_=t.useExactSrgbConversions)!=null?_:!1;const s=St()&&window.devicePixelRatio||1,n=t.limitDeviceRatio||s;i=i||t.adaptToDeviceRatio||!1,this._hardwareScalingLevel=i?1/Math.min(n,s):1,this._lastDevicePixelRatio=s,this._creationOptions=t}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=St()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=n}if(St()&&xn())if(this._renderingCanvas){const s=this._renderingCanvas.getBoundingClientRect?this._renderingCanvas.getBoundingClientRect():{width:this._renderingCanvas.width*this._hardwareScalingLevel,height:this._renderingCanvas.height*this._hardwareScalingLevel};t=this._renderingCanvas.clientWidth||s.width||this._renderingCanvas.width||100,i=this._renderingCanvas.clientHeight||s.height||this._renderingCanvas.height||100}else t=window.innerWidth,i=window.innerHeight;else 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){if(!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let s=0;s{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&xn()&&"ontouchend"in document},this._checkForMobile(),St()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){var t;(t=this._drawCalls)==null||t.addCount(e,!1)}getFps(){return this._fps}getDeltaTime(){return this._deltaTime}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}_createImageBitmapFromSource(e,t){throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){throw new Error("getFontOffset is not implemented")}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 me._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,s,n,r){throw Te("FileTools")}_loadFile(e,t,i,s,n,r){const o=eh(e,t,i,s,n,r);return this._activeRequests.push(o),o.onCompleteObservable.add(()=>{const l=this._activeRequests.indexOf(o);l!==-1&&this._activeRequests.splice(l,1)}),o}static _FileToolsLoadFile(e,t,i,s,n,r){if(or.loadFile)return or.loadFile(e,t,i,s,n,r);throw Te("FileTools")}dispose(){var t;for(this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();(t=this.releaseComputeEffects)==null||t.call(this),Pt.ResetCache();for(const i of this._activeRequests)i.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),St()&&window.removeEventListener("resize",this._checkForMobile);const e=Ce.Instances.indexOf(this);e>=0&&Ce.Instances.splice(e,1),Ce.Instances.length||(Ce.OnEnginesDisposedObservable.notifyObservers(this),Ce.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw Te("LoadingScreen")}}me._TextureLoaders=[];me._RenderPassIdCounter=0;me._RescalePostProcessFactory=null;class ph{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&(e=t.createTexture(),!e))throw new Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(const e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){var t,i;return(i=(t=this._MSAARenderBuffers)==null?void 0:t[e])!=null?i:null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}class Uf{}class Fe extends me{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return Pt.ShadersRepository}static set ShadersRepository(e){Pt.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,i,s){if(i=i||{},super(t!=null?t:i.antialias,i,s),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,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._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let n=null;if(e.getContext){if(n=e,this._renderingCanvas=n,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const l=navigator.userAgent;for(const h of Fe.ExceptionList){const c=h.key,u=h.targets;if(new RegExp(c).test(l)){if(h.capture&&h.captureConstraint){const d=h.capture,p=h.captureConstraint,_=new RegExp(d).exec(l);if(_&&_.length>0&&parseInt(_[_.length-1])>=p)continue}for(const d of u)switch(d){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=l=>{l.preventDefault(),this._contextWasLost=!0,U.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},n.addEventListener("webglcontextlost",this._onContextLost,!1),n.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=n.getContext("webgl2",i)||n.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(!n)throw new Error("The provided canvas is null or undefined.");try{this._gl=n.getContext("webgl",i)||n.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 l=this._gl.getContextAttributes();l&&(i.stencil=l.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 l=0;l1?new _f:new df;const r="Babylon.js v".concat(Fe.Version);U.Log(r+" - ".concat(this.description)),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",r);const o=li(this._gl);o.validateShaderPrograms=this.validateShaderPrograms,o.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){var t;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")),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_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._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");if(e!=null&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.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=((t=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT))!=null?t: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,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:i.SRGB_EXT,SRGB8:i.SRGB_ALPHA_EXT,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"u",supportRenderAndCopyToLodForFloatTextures:this._webGLVersion!==1,supportDepthStencilTexture:this._webGLVersion!==1,supportShadowSamplers:this._webGLVersion!==1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:this._webGLVersion!==1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:this._webGLVersion!==1,basisNeedsPOT:this._webGLVersion===1,support3DTextures:this._webGLVersion!==1,needTypeSuffixInShaderConstants:this._webGLVersion!==1,supportMSAA:this._webGLVersion!==1,supportSSAO2:this._webGLVersion!==1,supportExtendedTextureFormats:this._webGLVersion!==1,supportSwitchCaseInShader:this._webGLVersion!==1,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1,_collectUbosUpdatedInFrame:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}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}clear(e,t,i,s=!1){var o,l;const n=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=n;let r=0;if(t&&e){let h=!0;if(this._currentRenderTarget){const c=(o=this._currentRenderTarget.texture)==null?void 0:o.format;if(c===8||c===9||c===10||c===11){const u=(l=this._currentRenderTarget.texture)==null?void 0:l.type;u===7||u===5?(Fe._TempClearColorUint32[0]=e.r*255,Fe._TempClearColorUint32[1]=e.g*255,Fe._TempClearColorUint32[2]=e.b*255,Fe._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,Fe._TempClearColorUint32),h=!1):(Fe._TempClearColorInt32[0]=e.r*255,Fe._TempClearColorInt32[1]=e.g*255,Fe._TempClearColorInt32[2]=e.b*255,Fe._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,Fe._TempClearColorInt32),h=!1)}}h&&(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))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,s,n,r=0,o=0){var u,f,d,p,g,_;const l=e;this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(l._MSAAFramebuffer?l._MSAAFramebuffer:l._framebuffer);const h=this._gl;e.isMulti||(e.is2DArray||e.is3D?h.framebufferTextureLayer(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,(u=e.texture._hardwareTexture)==null?void 0:u.underlyingResource,r,o):e.isCube?h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_CUBE_MAP_POSITIVE_X+t,(f=e.texture._hardwareTexture)==null?void 0:f.underlyingResource,r):l._currentLOD!==r&&(h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,(d=e.texture._hardwareTexture)==null?void 0:d.underlyingResource,r),l._currentLOD=r));const c=e._depthStencilTexture;if(c){e.is3D&&(e.texture.width!==c.width||e.texture.height!==c.height||e.texture.depth!==c.depth)&&U.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const m=e._depthStencilTextureWithStencil?h.DEPTH_STENCIL_ATTACHMENT:h.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?h.framebufferTextureLayer(h.FRAMEBUFFER,m,(p=c._hardwareTexture)==null?void 0:p.underlyingResource,r,o):e.isCube?h.framebufferTexture2D(h.FRAMEBUFFER,m,h.TEXTURE_CUBE_MAP_POSITIVE_X+t,(g=c._hardwareTexture)==null?void 0:g.underlyingResource,r):h.framebufferTexture2D(h.FRAMEBUFFER,m,h.TEXTURE_2D,(_=c._hardwareTexture)==null?void 0:_.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 c,u;(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e);const l=(u=(c=this.cullBackFaces)!=null?c:n)==null||u?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==l||i)&&(this._depthCullingState.cullFace=l),this.setZOffset(t),this.setZOffsetUnits(o);const h=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==h||i)&&(this._depthCullingState.frontFace=h),this._stencilStateComposer.stencilMaterial=r}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t=!1,i){var r;const s=e;this._currentRenderTarget=null;const n=this._gl;if(s._MSAAFramebuffer){if(e.isMulti){this.unBindMultiColorAttachmentFramebuffer(e,t,i);return}n.bindFramebuffer(n.READ_FRAMEBUFFER,s._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,s._framebuffer),n.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,n.COLOR_BUFFER_BIT,n.NEAREST)}(r=e.texture)!=null&&r.generateMipMaps&&!t&&!e.isCube&&this.generateMipmaps(e.texture),i&&(s._MSAAFramebuffer&&this._bindUnboundFramebuffer(s._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,t,i){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 Sn(i);return this.bindArrayBuffer(s),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),s.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),s.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),s.capacity=e),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){const s=this._gl.createBuffer(),n=new Sn(s);if(!s)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);const r=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,r,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=r.BYTES_PER_ELEMENT===4,n}_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||this.isWebGPU)),(r===1&&!this._caps.textureFloatLinearFiltering||r===2&&!this._caps.textureHalfFloatLinearFiltering)&&(o=1),r===1&&!this._caps.textureFloat&&(r=0,U.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const f=this._gl,d=new Et(this,s),p=e.width||e,g=e.height||e,_=e.depth||0,m=e.layers||0,x=this._getSamplingParameters(o,n),I=m!==0?f.TEXTURE_2D_ARRAY:_!==0?f.TEXTURE_3D:f.TEXTURE_2D,T=this._getRGBABufferInternalSizedFormat(r,l,h),y=this._getInternalFormat(l),b=this._getWebGLTextureType(r);return this._bindTextureDirectly(I,d),m!==0?(d.is2DArray=!0,f.texImage3D(I,0,T,p,g,m,0,y,b,null)):_!==0?(d.is3D=!0,f.texImage3D(I,0,T,p,g,_,0,y,b,null)):f.texImage2D(I,0,T,p,g,0,y,b,null),f.texParameteri(I,f.TEXTURE_MAG_FILTER,x.mag),f.texParameteri(I,f.TEXTURE_MIN_FILTER,x.min),f.texParameteri(I,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(I,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),n&&this._gl.generateMipmap(I),this._bindTextureDirectly(I,null),d._useSRGBBuffer=h,d.baseWidth=p,d.baseHeight=g,d.width=p,d.height=g,d.depth=m,d.isReady=!0,d.samples=c,d.generateMipMaps=n,d.samplingMode=o,d.type=r,d.format=l,d.label=u,this._internalTexturesCache.push(d),d}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,s,n=3,r=null,o=null,l=null,h=null,c=null,u=null,f,d,p,g){return this._createTextureBase(e,t,i,s,n,r,o,(..._)=>this._prepareWebGLTexture(..._,c),(_,m,x,I,T,y)=>{const b=this._gl,S=x.width===_&&x.height===m;T._creationFlags=p!=null?p:0;const A=this._getTexImageParametersForCreateTexture(T.format,T._useSRGBBuffer);if(S)return b.texImage2D(b.TEXTURE_2D,0,A.internalFormat,A.format,A.type,x),!1;const M=this._caps.maxTextureSize;if(x.width>M||x.height>M||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=_,this._workingCanvas.height=m,this._workingContext.drawImage(x,0,0,x.width,x.height,0,0,_,m),b.texImage2D(b.TEXTURE_2D,0,A.internalFormat,A.format,A.type,this._workingCanvas),T.width=_,T.height=m),!1;{const C=new Et(this,2);this._bindTextureDirectly(b.TEXTURE_2D,C,!0),b.texImage2D(b.TEXTURE_2D,0,A.internalFormat,A.format,A.type,x),this._rescaleTexture(C,T,s,A.format,()=>{this._releaseTexture(C),this._bindTextureDirectly(b.TEXTURE_2D,T,!0),y()})}return!0},l,h,c,u,f,d,g)}_getTexImageParametersForCreateTexture(e,t){let i,s;return this.webGLVersion===1?(i=this._getInternalFormat(e,t),s=i):(i=this._getInternalFormat(e,!1),s=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:s,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,s,n){}_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)}_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 f=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),p=r?e.width:Math.pow(2,Math.max(f-s,0)),g=r?e.height:Math.pow(2,Math.max(d-s,0));o.texImage2D(u,s,c,p,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),f=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let d=c.TEXTURE_2D,p=c.TEXTURE_2D;e.isCube&&(p=c.TEXTURE_CUBE_MAP_POSITIVE_X+o,d=c.TEXTURE_CUBE_MAP),this._bindTextureDirectly(d,e,!0),c.texSubImage2D(p,l,i,s,n,r,f,u,t),h&&this._gl.generateMipmap(p),this._bindTextureDirectly(d,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,c){const u=this.getCaps().maxTextureSize,f=Math.min(u,this.needPOTTextures?fi(s.width,u):s.width),d=Math.min(u,this.needPOTTextures?fi(s.height,u):s.height),p=this._gl;if(p){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(p.TEXTURE_2D,e,!0),this._unpackFlipY(n===void 0?!0:!!n),e.baseWidth=s.width,e.baseHeight=s.height,e.width=f,e.height=d,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:c!=null?c:t===".jpg"&&!e._useSRGBBuffer?4:5,!l(f,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){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);t!==-1&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e==null||e.release()}_setProgram(e){this._currentProgram!==e&&(uf(e,this._gl),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&&r&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw U.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,(h=(l=t==null?void 0:t._hardwareTexture)==null?void 0:l.underlyingResource)!=null?h:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(n=!0,this._activateCurrentTexture());return r&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),n}_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;const h=t.getInternalTexture();h&&(h._associatedChannel=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;St()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&((e=this._gl.getExtension("WEBGL_lose_context"))==null||e.loseContext()),lf(this._gl)}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._glSRGBExtensionValues.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._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:i=t?this._glSRGBExtensionValues.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._glSRGBExtensionValues.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._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?this._glSRGBExtensionValues.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._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}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=me._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=me._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}}Fe._TempClearColorUint32=new Uint32Array(4);Fe._TempClearColorInt32=new Int32Array(4);Fe.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:"Chrome/12\\d\\..+?Mobile",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"]}];Fe.CollisionsEpsilon=.001;Fe._ConcatenateShader=Jl;Fe._IsSupported=null;Fe._HasMajorPerformanceCaveat=null;Fe.CeilingPOT=Xa;Fe.FloorPOT=Cr;Fe.NearestPOT=Wa;Fe.GetExponentOfTwo=fi;Fe.QueueNewFrame=dh;class _h{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new kf(e)}sampleFrame(e=xi.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 kf{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}}Fe.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};function _a(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}Fe.prototype._readTexturePixelsSync=function(a,e,t,i=-1,s=0,n=null,r=!0,o=!1,l=0,h=0){var f,d;const c=this._gl;if(!c)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const p=c.createFramebuffer();if(!p)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=p}c.bindFramebuffer(c.FRAMEBUFFER,this._dummyFramebuffer),i>-1?c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_CUBE_MAP_POSITIVE_X+i,(f=a._hardwareTexture)==null?void 0:f.underlyingResource,s):c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,(d=a._hardwareTexture)==null?void 0:d.underlyingResource,s);let u=a.type!==void 0?this._getWebGLTextureType(a.type):c.UNSIGNED_BYTE;if(o)n||(n=_a(a.type,4*e*t));else switch(u){case c.UNSIGNED_BYTE:n||(n=new Uint8Array(4*e*t)),u=c.UNSIGNED_BYTE;break;default:n||(n=new Float32Array(4*e*t)),u=c.FLOAT;break}return r&&this.flushFramebuffer(),c.readPixels(l,h,e,t,c.RGBA,u,n),c.bindFramebuffer(c.FRAMEBUFFER,this._currentFramebuffer),n};Fe.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))};Fe.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()};Fe.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()};me.prototype.displayLoadingUI=function(){if(!St())return;const a=this.loadingScreen;a&&a.displayLoadingUI()};me.prototype.hideLoadingUI=function(){if(!St())return;const a=this._loadingScreen;a&&a.hideLoadingUI()};Object.defineProperty(me.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=me.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(a){this._loadingScreen=a},enumerable:!0,configurable:!0});Object.defineProperty(me.prototype,"loadingUIText",{set:function(a){this.loadingScreen.loadingUIText=a},enumerable:!0,configurable:!0});Object.defineProperty(me.prototype,"loadingUIBackgroundColor",{set:function(a){this.loadingScreen.loadingUIBackgroundColor=a},enumerable:!0,configurable:!0});me.prototype.getInputElement=function(){return this._renderingCanvas};me.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null};me.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null};me.prototype.getAspectRatio=function(a,e=!1){const t=a.viewport;return this.getRenderWidth(e)*t.width/(this.getRenderHeight(e)*t.height)};me.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)};me.prototype._verifyPointerLock=function(){var a;(a=this._onPointerLockChange)==null||a.call(this)};me.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}};me.prototype.getInputElement=function(){return this._renderingCanvas};me.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc};me.prototype.setDepthFunction=function(a){this._depthCullingState.depthFunc=a};me.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)};me.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)};me.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)};me.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)};me.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask};me.prototype.setDepthWrite=function(a){this._depthCullingState.depthMask=a};me.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest};me.prototype.setStencilBuffer=function(a){this._stencilState.stencilTest=a};me.prototype.getStencilMask=function(){return this._stencilState.stencilMask};me.prototype.setStencilMask=function(a){this._stencilState.stencilMask=a};me.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc};me.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef};me.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask};me.prototype.setStencilFunction=function(a){this._stencilState.stencilFunc=a};me.prototype.setStencilFunctionReference=function(a){this._stencilState.stencilFuncRef=a};me.prototype.setStencilFunctionMask=function(a){this._stencilState.stencilFuncMask=a};me.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail};me.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail};me.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass};me.prototype.setStencilOperationFail=function(a){this._stencilState.stencilOpStencilFail=a};me.prototype.setStencilOperationDepthFail=function(a){this._stencilState.stencilOpDepthFail=a};me.prototype.setStencilOperationPass=function(a){this._stencilState.stencilOpStencilDepthPass=a};me.prototype.cacheStencilState=function(){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()};me.prototype.restoreStencilState=function(){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)};me.prototype.setAlphaConstants=function(a,e,t,i){this._alphaState.setAlphaBlendConstants(a,e,t,i)};me.prototype.getAlphaMode=function(){return this._alphaMode};me.prototype.getAlphaEquation=function(){return this._alphaEquation};me.prototype.getRenderPassNames=function(){return this._renderPassNames};me.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]};me.prototype.createRenderPassId=function(a){const e=++me._RenderPassIdCounter;return this._renderPassNames[e]=a!=null?a:"NONAME",e};me.prototype.releaseRenderPassId=function(a){this._renderPassNames[a]=void 0;for(let e=0;e{a.onCanvasFocusObservable.notifyObservers(a)},a._onCanvasBlur=()=>{a.onCanvasBlurObservable.notifyObservers(a)},a._onCanvasContextMenu=s=>{a.disableContextMenu&&s.preventDefault()},e.addEventListener("focus",a._onCanvasFocus),e.addEventListener("blur",a._onCanvasBlur),e.addEventListener("contextmenu",a._onCanvasContextMenu),a._onBlur=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.disable(),a._windowIsBackground=!0},a._onFocus=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.enable(),a._windowIsBackground=!1},a._onCanvasPointerOut=s=>{document.elementFromPoint(s.clientX,s.clientY)!==e&&a.onCanvasPointerOutObservable.notifyObservers(s)};const i=a.getHostWindow();i&&typeof i.addEventListener=="function"&&(i.addEventListener("blur",a._onBlur),i.addEventListener("focus",a._onFocus)),e.addEventListener("pointerout",a._onCanvasPointerOut),t.doNotHandleTouchAction||Vf(e),!me.audioEngine&&t.audioEngine&&me.AudioEngineFactory&&(me.audioEngine=me.AudioEngineFactory(a.getRenderingCanvas(),a.getAudioContext(),a.getAudioDestination())),xn()&&(a._onFullscreenChange=()=>{a.isFullscreen=!!document.fullscreenElement,a.isFullscreen&&a._pointerLockRequested&&e&&Ka(e)},document.addEventListener("fullscreenchange",a._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",a._onFullscreenChange,!1),a._onPointerLockChange=()=>{a.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",a._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",a._onPointerLockChange,!1)),a.enableOfflineSupport=me.OfflineProviderFactory!==void 0,a._deterministicLockstep=!!t.deterministicLockstep,a._lockstepMaxSteps=t.lockstepMaxSteps||0,a._timeStep=t.timeStep||1/60}function mh(a,e){Ce.Instances.length===1&&me.audioEngine&&(me.audioEngine.dispose(),me.audioEngine=null);const t=a.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",a._onBlur),t.removeEventListener("focus",a._onFocus)),e&&(e.removeEventListener("focus",a._onCanvasFocus),e.removeEventListener("blur",a._onCanvasBlur),e.removeEventListener("pointerout",a._onCanvasPointerOut),e.removeEventListener("contextmenu",a._onCanvasContextMenu)),xn()&&(document.removeEventListener("fullscreenchange",a._onFullscreenChange),document.removeEventListener("mozfullscreenchange",a._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",a._onFullscreenChange),document.removeEventListener("msfullscreenchange",a._onFullscreenChange),document.removeEventListener("pointerlockchange",a._onPointerLockChange),document.removeEventListener("mspointerlockchange",a._onPointerLockChange),document.removeEventListener("mozpointerlockchange",a._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",a._onPointerLockChange))}function vh(a){const e=document.createElement("span");e.textContent="Hg",e.style.font=a;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const i=document.createElement("div");i.style.whiteSpace="nowrap",i.appendChild(e),i.appendChild(t),document.body.appendChild(i);let s=0,n=0;try{n=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",s=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(i)}return{ascent:s,height:n,descent:n-s}}function xh(a,e,t){return new Promise((s,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{a.createImageBitmap(r,t).then(o=>{s(o)})})},r.onerror=()=>{n("Error loading image ".concat(r.src))},r.src=e})}function bh(a,e,t,i){const n=a.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}function yh(a){const e=a.requestFullscreen||a.webkitRequestFullscreen;e&&e.call(a)}function Th(){const a=document;document.exitFullscreen?document.exitFullscreen():a.webkitCancelFullScreen&&a.webkitCancelFullScreen()}function Ka(a){if(a.requestPointerLock){const e=a.requestPointerLock();e instanceof Promise?e.then(()=>{a.focus()}).catch(()=>{}):a.focus()}}function Sh(){document.exitPointerLock&&document.exitPointerLock()}class ui{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){ui.Enabled&&(this._current+=e,t&&this._fetchResult())}beginMonitoring(){ui.Enabled&&(this._startMonitoringTime=xi.Now)}endMonitoring(e=!0){if(!ui.Enabled)return;e&&this.fetchNewFrame();const t=xi.Now;this._current=t-this._startMonitoringTime,e&&this._fetchResult()}endFrame(){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=xi.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}ui.Enabled=!0;me.AudioEngineFactory=(a,e,t)=>new Gf(a,e,t);class Gf{get audioContext(){return this._audioContextInitialized||this._initializeAudioContext(),this._audioContext}constructor(e=null,t=null,i=null){if(this._audioContext=null,this._audioContextInitialized=!1,this._muteButton=null,this._audioDestination=null,this.canUseWebAudio=!1,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.useCustomUnlockedButton=!1,this.onAudioUnlockedObservable=new Q,this.onAudioLockedObservable=new Q,this._tryToRun=!1,this._onResize=()=>{this._moveButtonToTopLeft()},!St())return;typeof window.AudioContext<"u"&&(this.canUseWebAudio=!0);const s=document.createElement("audio");this._hostElement=e,this._audioContext=t,this._audioDestination=i;try{s&&s.canPlayType&&(s.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,"")||s.canPlayType("audio/mp3").replace(/^no$/,""))&&(this.isMP3supported=!0)}catch{}try{s&&s.canPlayType&&s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.isOGGsupported=!0)}catch{}}lock(){this._triggerSuspendedState()}unlock(){var e,t;if(((e=this._audioContext)==null?void 0:e.state)==="running"){this._hideMuteButton(),this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this));return}this._tryToRun?(t=this._audioContext)==null||t.suspend().then(()=>{this._tryToRun=!1,this._triggerRunningState()}):this._triggerRunningState()}_resumeAudioContextOnStateChange(){var e;(e=this._audioContext)==null||e.addEventListener("statechange",()=>{var t;this.unlocked&&((t=this._audioContext)==null?void 0:t.state)!=="running"&&this._resumeAudioContext()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContext(){var e;return(e=this._audioContext)!=null&&e.resume?this._audioContext.resume():Promise.resolve()}_initializeAudioContext(){try{this.canUseWebAudio&&(this._audioContext||(this._audioContext=new AudioContext),this.masterGain=this._audioContext.createGain(),this.masterGain.gain.value=1,this._audioDestination||(this._audioDestination=this._audioContext.destination),this.masterGain.connect(this._audioDestination),this._audioContextInitialized=!0,this._audioContext.state==="running"&&this._triggerRunningState())}catch(e){this.canUseWebAudio=!1,U.Error("Web Audio: "+e.message)}}_triggerRunningState(){this._tryToRun||(this._tryToRun=!0,this._resumeAudioContext().then(()=>{this._tryToRun=!1,this._muteButton&&this._hideMuteButton(),this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)}).catch(()=>{this._tryToRun=!1,this.unlocked=!1}))}_triggerSuspendedState(){this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this),this._displayMuteButton()}_displayMuteButton(){if(this.useCustomUnlockedButton||this._muteButton)return;this._muteButton=document.createElement("BUTTON"),this._muteButton.className="babylonUnmuteIcon",this._muteButton.id="babylonUnmuteIconBtn",this._muteButton.title="Unmute";const t=".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E":"https://cdn.babylonjs.com/Assets/audio.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }",i=document.createElement("style");i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i),document.body.appendChild(this._muteButton),this._moveButtonToTopLeft(),this._muteButton.addEventListener("touchend",()=>{this._triggerRunningState()},!0),this._muteButton.addEventListener("click",()=>{this.unlock()},!0),window.addEventListener("resize",this._onResize)}_moveButtonToTopLeft(){this._hostElement&&this._muteButton&&(this._muteButton.style.top=this._hostElement.offsetTop+20+"px",this._muteButton.style.left=this._hostElement.offsetLeft+20+"px")}_hideMuteButton(){this._muteButton&&(document.body.removeChild(this._muteButton),this._muteButton=null)}dispose(){this.canUseWebAudio&&this._audioContextInitialized&&(this._connectedAnalyser&&this._audioContext&&(this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser.dispose(),this.masterGain.disconnect(),this.masterGain.connect(this._audioContext.destination),this._connectedAnalyser=null),this.masterGain.gain.value=1),this.WarnedWebAudioUnsupported=!1,this._hideMuteButton(),window.removeEventListener("resize",this._onResize),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){return this.canUseWebAudio&&this._audioContextInitialized?this.masterGain.gain.value:-1}setGlobalVolume(e){this.canUseWebAudio&&this._audioContextInitialized&&(this.masterGain.gain.value=e)}connectToAnalyser(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this.canUseWebAudio&&this._audioContextInitialized&&this._audioContext&&(this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._audioContext.destination))}}class ie extends Fe{static get NpmPackage(){return me.NpmPackage}static get Version(){return me.Version}static get Instances(){return Ce.Instances}static get LastCreatedEngine(){return Ce.LastCreatedEngine}static get LastCreatedScene(){return Ce.LastCreatedScene}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i{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}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return vh(e)}_cancelFrame(){if(this.customAnimationFrameRequester){if(this._frameHandler!==0){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID)}}else super._cancelFrame()}_renderLoop(){if(this._frameHandler=0,!this._contextWasLost){let e=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0&&this._frameHandler===0&&(this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}enterPointerlock(){this._renderingCanvas&&Ka(this._renderingCanvas)}exitPointerlock(){Sh()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,s,n,r=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const o=super.createShaderProgram(e,t,i,s,n,r);return this.onAfterShaderCompilationObservable.notifyObservers(this),o}_createShaderProgram(e,t,i,s,n=null){const r=s.createProgram();if(e.program=r,!r)throw new Error("Unable to create program");if(s.attachShader(r,t),s.attachShader(r,i),this.webGLVersion>1&&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)})})})}_rescaleTexture(e,t,i,s,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const r=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&ie._RescalePostProcessFactory&&(this._rescalePostProcess=ie._RescalePostProcessFactory(this)),this._rescalePostProcess&&(this._rescalePostProcess.externalTextureSamplerBinding=!0,this._rescalePostProcess.getEffect().executeWhenCompiled(()=>{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()}))}wrapWebGLTexture(e,t=!1,i=3,s=0,n=0){const r=new ph(e,this._gl),o=new Et(this,0,!0);return o._hardwareTexture=r,o.baseWidth=s,o.baseHeight=n,o.width=s,o.height=n,o.isReady=!0,o.useMipMaps=t,this.updateTextureSamplingMode(i,o),o}_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){U.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 Sn(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(){this.hideLoadingUI(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),mh(this,this._renderingCanvas),super.dispose()}}ie.ALPHA_DISABLE=0;ie.ALPHA_ADD=1;ie.ALPHA_COMBINE=2;ie.ALPHA_SUBTRACT=3;ie.ALPHA_MULTIPLY=4;ie.ALPHA_MAXIMIZED=5;ie.ALPHA_ONEONE=6;ie.ALPHA_PREMULTIPLIED=7;ie.ALPHA_PREMULTIPLIED_PORTERDUFF=8;ie.ALPHA_INTERPOLATE=9;ie.ALPHA_SCREENMODE=10;ie.DELAYLOADSTATE_NONE=0;ie.DELAYLOADSTATE_LOADED=1;ie.DELAYLOADSTATE_LOADING=2;ie.DELAYLOADSTATE_NOTLOADED=4;ie.NEVER=512;ie.ALWAYS=519;ie.LESS=513;ie.EQUAL=514;ie.LEQUAL=515;ie.GREATER=516;ie.GEQUAL=518;ie.NOTEQUAL=517;ie.KEEP=7680;ie.REPLACE=7681;ie.INCR=7682;ie.DECR=7683;ie.INVERT=5386;ie.INCR_WRAP=34055;ie.DECR_WRAP=34056;ie.TEXTURE_CLAMP_ADDRESSMODE=0;ie.TEXTURE_WRAP_ADDRESSMODE=1;ie.TEXTURE_MIRROR_ADDRESSMODE=2;ie.TEXTUREFORMAT_ALPHA=0;ie.TEXTUREFORMAT_LUMINANCE=1;ie.TEXTUREFORMAT_LUMINANCE_ALPHA=2;ie.TEXTUREFORMAT_RGB=4;ie.TEXTUREFORMAT_RGBA=5;ie.TEXTUREFORMAT_RED=6;ie.TEXTUREFORMAT_R=6;ie.TEXTUREFORMAT_RG=7;ie.TEXTUREFORMAT_RED_INTEGER=8;ie.TEXTUREFORMAT_R_INTEGER=8;ie.TEXTUREFORMAT_RG_INTEGER=9;ie.TEXTUREFORMAT_RGB_INTEGER=10;ie.TEXTUREFORMAT_RGBA_INTEGER=11;ie.TEXTURETYPE_UNSIGNED_BYTE=0;ie.TEXTURETYPE_UNSIGNED_INT=0;ie.TEXTURETYPE_FLOAT=1;ie.TEXTURETYPE_HALF_FLOAT=2;ie.TEXTURETYPE_BYTE=3;ie.TEXTURETYPE_SHORT=4;ie.TEXTURETYPE_UNSIGNED_SHORT=5;ie.TEXTURETYPE_INT=6;ie.TEXTURETYPE_UNSIGNED_INTEGER=7;ie.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;ie.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;ie.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;ie.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;ie.TEXTURETYPE_UNSIGNED_INT_24_8=12;ie.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;ie.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;ie.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;ie.TEXTURE_NEAREST_SAMPLINGMODE=1;ie.TEXTURE_BILINEAR_SAMPLINGMODE=2;ie.TEXTURE_TRILINEAR_SAMPLINGMODE=3;ie.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;ie.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;ie.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;ie.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;ie.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;ie.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;ie.TEXTURE_NEAREST_LINEAR=7;ie.TEXTURE_NEAREST_NEAREST=1;ie.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;ie.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;ie.TEXTURE_LINEAR_LINEAR=2;ie.TEXTURE_LINEAR_NEAREST=12;ie.TEXTURE_EXPLICIT_MODE=0;ie.TEXTURE_SPHERICAL_MODE=1;ie.TEXTURE_PLANAR_MODE=2;ie.TEXTURE_CUBIC_MODE=3;ie.TEXTURE_PROJECTION_MODE=4;ie.TEXTURE_SKYBOX_MODE=5;ie.TEXTURE_INVCUBIC_MODE=6;ie.TEXTURE_EQUIRECTANGULAR_MODE=7;ie.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;ie.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;ie.SCALEMODE_FLOOR=1;ie.SCALEMODE_NEAREST=2;ie.SCALEMODE_CEILING=3;const zf=1/2.2,Wf=2.2,xt=(1+Math.sqrt(5))/2,Ne=.001;class Bt{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 Hf=["push","splice","pop","shift","unshift"];function Eh(a,e){const t=Hf.map(i=>Xf(a,i,e));return()=>{t.forEach(i=>{i==null||i()})}}const Ih={};function ft(a,e){Ih[a]=e}function ms(a){return Ih[a]}function Lt(a,e,t=1401298e-51){return Math.abs(a-e)<=t}function ut(a,e){return a===e?a:Math.random()*(e-a)+a}function Ah(a,e,t){return a+(e-a)*t}function gt(a,e=0,t=1){return Math.min(t,Math.max(e,a))}function Ch(a){return a-=Math.PI*2*Math.floor((a+Math.PI)/(Math.PI*2)),a}function Ci(a){const e=a.toString(16);return a<=15?("0"+e).toUpperCase():e.toUpperCase()}const Zt=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=Zt(this.x),t=Zt(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(){return[this.x,this.y]}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)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new fe(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}addInPlaceFromFloats(e,t){return this.x+=e,this.y+=t,this}addVector3(e){return new fe(this.x+e.x,this.y+e.y)}subtract(e){return new fe(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 fe(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 fe(this.x*e,this.y*t)}divide(e){return new fe(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.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){return new fe(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){return i.x=this.x-e,i.y=this.y-t,i}negate(){return new fe(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new fe(this.x*e,this.y*e)}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=Ne){return e&&Lt(this.x,e.x,t)&&Lt(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new fe(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new fe(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}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 this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new fe;return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0&&(e.x=this.x,e.y=this.y),this.scaleToRef(1/t,e)}clone(){return new fe(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new fe(0,0)}static One(){return new fe(1,1)}static Random(e=0,t=1){return new fe(ut(e,t),ut(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ut(e,t),ut(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 FromFloatsToRef(e,t,i){return i.copyFromFloats(e,t),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 fe(l,h)}static ClampToRef(e,t,i,s){return s.x=gt(e.x,t.x,i.x),s.y=gt(e.y,t.y,i.y),s}static Clamp(e,t,i){const s=gt(e.x,t.x,i.x),n=gt(e.y,t.y,i.y);return new fe(s,n)}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,f=e.x*l+i.x*h+t.x*c+s.x*u,d=e.y*l+i.y*h+t.y*c+s.y*u;return new fe(f,d)}static Hermite1stDerivative(e,t,i,s,n){return this.Hermite1stDerivativeToRef(e,t,i,s,n,new fe)}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}static Lerp(e,t,i){const s=e.x+(t.x-e.x)*i,n=e.y+(t.y-e.y)*i;return new fe(s,n)}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return fe.NormalizeToRef(e,new fe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=e.xt.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new fe(i,s)}static Transform(e,t){return fe.TransformToRef(e,t,new fe)}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){return fe.CenterToRef(e,t,new fe)}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();Object.defineProperties(fe.prototype,{dimension:{value:[2]},rank:{value:1}});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=Zt(this._x),t=Zt(this._y),i=Zt(this._z);let s=e;return s=s*397^t,s=s*397^i,s}asArray(){return[this._x,this._y,this._z]}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 le.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new v(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 v(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 v(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 v(-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 v(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=this._x,s=this._y,n=this._z,r=e._x,o=e._y,l=e._z,h=e._w,c=2*(o*n-l*s),u=2*(l*i-r*n),f=2*(r*s-o*i);return t._x=i+h*c+o*f-l*u,t._y=s+h*u+l*c-r*f,t._z=n+h*f+r*u-o*c,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new v)}scaleAndAddToRef(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)}projectOnPlane(e,t){return this.projectOnPlaneToRef(e,t,new v)}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)<1e-10)i.setAll(1/0);else{const l=-(v.Dot(t,s)+n)/o,h=r.scaleInPlace(l);t.addToRef(h,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=Ne){return e&&Lt(this._x,e._x,t)&&Lt(this._y,e._y,t)&&Lt(this._z,e._z,t)}equalsToFloats(e,t,i){return this._x===e&&this._y===t&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){return t.copyFromFloats(this._x*e._x,this._y*e._y,this._z*e._z)}multiplyByFloats(e,t,i){return new v(this._x*e,this._y*t,this._z*i)}divide(e){return new v(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){return t.copyFromFloats(this._x/e._x,this._y/e._y,this._z/e._z)}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,i){return ethis._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(!Lt(t,i,e))return!0;const s=Math.abs(this._z);return!Lt(t,s,e)||!Lt(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}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new v(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z))}fractToRef(e){return e._x=this.x-Math.floor(this._x),e._y=this.y-Math.floor(this._y),e._z=this.z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new v(this.x-Math.floor(this._x),this.y-Math.floor(this._y),this.z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}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){if(e=e.toLowerCase(),e==="xyz")return this;const t=_e.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],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){return v.CrossToRef(this,e,new v)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new v)}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFrom(this):this.scaleToRef(1/t,e)}clone(){return new v(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),r=v.Dot(t,i);return(n-s)/(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=gt(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 Ch(h)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=N.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=gt(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-Ne){const f=Math.acos(h),d=1/Math.sin(f);c=Math.sin((1-i)*f)*d,u=Math.sin(i*f)*d}else c=1-i,u=i;return n.scaleInPlace(c),r.scaleInPlace(u),s.copyFrom(n).addInPlace(r),s.scaleInPlace(Ah(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 get OneReadOnly(){return v._OneReadOnly}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(ut(e,t),ut(e,t),ut(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ut(e,t),ut(e,t),ut(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 v(l,h,c)}static Clamp(e,t,i){const s=new v;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&&C<0?(P.copyFrom(r),z=t,L=i):C>0&&w<0?(P.copyFrom(l),z=i,L=s):(P.copyFrom(o).scaleInPlace(-1),z=s,L=t);const G=_e.Vector3[9],H=_e.Vector3[4];if(z.subtractToRef(x,b),L.subtractToRef(x,G),v.CrossToRef(b,G,H),!(v.Dot(H,h)<0))return n.copyFrom(x),Math.abs(g*_);const J=_e.Vector3[5];v.CrossToRef(P,H,J),J.normalize();const W=_e.Vector3[9];W.copyFrom(z).subtractInPlace(x);const V=W.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}minimizeInPlaceFromFloats(e,t,i,s){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this.z=Math.min(i,this.z),this.w=Math.min(s,this.w),this}maximizeInPlaceFromFloats(e,t,i,s){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this.z=Math.max(i,this.z),this.w=Math.max(s,this.w),this}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e.z=Math.floor(this.z),e.w=Math.floor(this.w),e}floor(){return new Pe(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e.z=this.z-Math.floor(this.z),e.w=this.w-Math.floor(this.w),e}fract(){return new Pe(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(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new Pe)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e):this.scaleToRef(1/t,e)}toVector3(){return new v(this.x,this.y,this.z)}clone(){return new Pe(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}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}static FromArray(e,t){return t||(t=0),new Pe(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 Pe.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 Pe(0,0,0,0)}static One(){return new Pe(1,1,1,1)}static Random(e=0,t=1){return new Pe(ut(e,t),ut(e,t),ut(e,t),ut(e,t))}static RandomToRef(e=0,t=1,i){return i.x=ut(e,t),i.y=ut(e,t),i.z=ut(e,t),i.w=ut(e,t),i}static Clamp(e,t,i){return Pe.ClampToRef(e,t,i,new Pe)}static ClampToRef(e,t,i,s){return s.x=gt(e.x,t.x,i.x),s.y=gt(e.y,t.y,i.y),s.z=gt(e.z,t.z,i.z),s.w=gt(e.w,t.w,i.w),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return Pe._ZeroReadOnly}static Normalize(e){return Pe.NormalizeToRef(e,new Pe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=new Pe;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new Pe;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(Pe.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 Pe.CenterToRef(e,t,new Pe)}static CenterToRef(e,t,i){return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){return Pe.TransformCoordinatesToRef(e,t,new Pe)}static TransformCoordinatesToRef(e,t,i){return Pe.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){return Pe.TransformNormalToRef(e,t,new Pe)}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 Pe(e._x,e._y,e._z,t)}static Dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}Pe._ZeroReadOnly=Pe.Zero();Object.defineProperties(Pe.prototype,{dimension:{value:[4]},rank:{value:1}});class le{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=Zt(this._x),t=Zt(this._y),i=Zt(this._z),s=Zt(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}fromArray(e,t=0){return le.FromArrayToRef(e,t,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=Ne){return e&&Lt(this._x,e._x,t)&&Lt(this._y,e._y,t)&&Lt(this._z,e._z,t)&&Lt(this._w,e._w,t)}clone(){return new le(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)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new le(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}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,i,s){return this._x+=e,this._y+=t,this._z+=i,this._w+=s,this._isDirty=!0,this}subtractToRef(e,t){return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,i,s){return this.subtractFromFloatsToRef(e,t,i,s,new le)}subtractFromFloatsToRef(e,t,i,s,n){return n._x=this._x-e,n._y=this._y-t,n._z=this._z-i,n._w=this._w-s,n._isDirty=!0,n}subtract(e){return new le(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 le(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 le(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)}multiplyByFloats(e,t,i,s){return this._x*=e,this._y*=t,this._z*=i,this._w*=s,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new le)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}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 le(-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(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new le(0,0,0,1);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._w):this.scaleToRef(1/t,e)}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 O.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return le.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}static FromRotationMatrix(e){const t=new le;return le.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],f=i[10],d=s+l+f;let p;return d>0?(p=.5/Math.sqrt(d+1),t._w=.25/p,t._x=(u-h)*p,t._y=(r-c)*p,t._z=(o-n)*p,t._isDirty=!0):s>l&&s>f?(p=2*Math.sqrt(1+s-l-f),t._w=(u-h)/p,t._x=.25*p,t._y=(n+o)/p,t._z=(r+c)/p,t._isDirty=!0):l>f?(p=2*Math.sqrt(1+l-s-f),t._w=(r-c)/p,t._x=(n+o)/p,t._y=.25*p,t._z=(h+u)/p,t._isDirty=!0):(p=2*Math.sqrt(1+f-s-l),t._w=(o-n)/p,t._x=(r+c)/p,t._y=(h+u)/p,t._z=.25*p,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=le.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,n){let r=s===0?1:i/s;return r=gt(r,0,1),le.SlerpToRef(e,t,r,n),n}static Zero(){return new le(0,0,0,0)}static Inverse(e){return new le(-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 le(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 le.RotationAxisToRef(e,t,new le)}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 le(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 FromFloatsToRef(e,t,i,s,n){return n.copyFromFloats(e,t,i,s),n}static FromEulerAngles(e,t,i){const s=new le;return le.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return le.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new le;return le.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return le.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,s=Ne){const n=v.Dot(e,t)+1;return nMath.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(v.CrossToRef(e,t,N.Vector3[0]),i.set(N.Vector3[0].x,N.Vector3[0].y,N.Vector3[0].z,n)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new le;return le.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),f=Math.sin(o),d=Math.cos(o);return s._x=d*c*h+f*u*l,s._y=f*u*h-d*c*l,s._z=d*u*l-f*c*h,s._w=d*u*h+f*c*l,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new le;return le.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 le(0,0,0,0);return le.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const n=_e.Matrix[0];return O.FromXYZAxesToRef(e.normalize(),t.normalize(),i.normalize(),n),le.FromRotationMatrixToRef(n,s),s}static FromLookDirectionLH(e,t){const i=new le;return le.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=_e.Matrix[0];return O.LookDirectionLHToRef(e,t,s),le.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new le;return le.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=_e.Matrix[0];return O.LookDirectionRHToRef(e,t,s),le.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=le.Identity();return le.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,f=e._x*l+i._x*h+t._x*c+s._x*u,d=e._y*l+i._y*h+t._y*c+s._y*u,p=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 le(f,d,p,g)}static Hermite1stDerivative(e,t,i,s,n){const r=new le;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}static Normalize(e){const t=le.Zero();return le.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,i){const s=new le;return le.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){return s.copyFromFloats(gt(e.x,t.x,i.x),gt(e.y,t.y,i.y),gt(e.z,t.z,i.z),gt(e.w,t.w,i.w))}static Random(e=0,t=1){return new le(ut(e,t),ut(e,t),ut(e,t),ut(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ut(e,t),ut(e,t),ut(e,t),ut(e,t))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){return Math.sqrt(le.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 le.CenterToRef(e,t,le.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)}}Object.defineProperties(le.prototype,{dimension:{value:[4]},rank:{value:1}});class O{static get Use64Bits(){return Rt.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=O._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,Rt.MatrixTrackPrecisionChange&&Rt.MatrixTrackedMatrices.push(this),this._m=new Rt.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],f=e[10],d=e[11],p=e[12],g=e[13],_=e[14],m=e[15],x=f*m-_*d,I=u*m-g*d,T=u*_-g*f,y=c*m-p*d,b=c*_-f*p,S=c*g-p*u,A=+(o*x-l*I+h*T),M=-(r*x-l*y+h*b),C=+(r*I-o*y+h*S),w=-(r*T-o*b+l*S);return t*A+i*M+s*C+n*w}toString(){return"{".concat(this.m[0],", ").concat(this.m[1],", ").concat(this.m[2],", ").concat(this.m[3],"\n").concat(this.m[4],", ").concat(this.m[5],", ").concat(this.m[6],", ").concat(this.m[7],"\n").concat(this.m[8],", ").concat(this.m[9],", ").concat(this.m[10],", ").concat(this.m[11],"\n").concat(this.m[12],", ").concat(this.m[13],", ").concat(this.m[14],", ").concat(this.m[15],"}")}toArray(e=null,t=0){if(!e)return this._m;const i=this._m;for(let s=0;s<16;s++)e[t+s]=i[s];return this}asArray(){return this._m}fromArray(e,t=0){return O.FromArrayToRef(e,t,this)}copyFromFloats(...e){return O.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return O.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 O;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;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let r=0;r<16;r++)n[r]=i[r]-s[r];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new O)}subtractFromFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let r=0;r<16;r++)s[r]=i[r]-n[r];return t.markAsUpdated(),t}invertToRef(e){if(this._isIdentity===!0)return O.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],f=t[9],d=t[10],p=t[11],g=t[12],_=t[13],m=t[14],x=t[15],I=d*x-m*p,T=f*x-_*p,y=f*m-_*d,b=u*x-g*p,S=u*m-d*g,A=u*_-g*f,M=+(l*I-h*T+c*y),C=-(o*I-h*b+c*S),w=+(o*T-l*b+c*A),P=-(o*y-l*S+h*A),z=i*M+s*C+n*w+r*P;if(z===0)return e.copyFrom(this),e;const L=1/z,G=h*x-m*c,H=l*x-_*c,ce=l*m-_*h,J=o*x-g*c,W=o*m-g*h,V=o*_-g*l,R=h*p-d*c,k=l*p-f*c,Y=l*d-f*h,he=o*p-u*c,oe=o*d-u*h,re=o*f-u*l,ue=-(s*I-n*T+r*y),xe=+(i*I-n*b+r*S),ae=-(i*T-s*b+r*A),Me=+(i*y-s*S+n*A),ke=+(s*G-n*H+r*ce),Z=-(i*G-n*J+r*W),Ee=+(i*H-s*J+r*V),Oe=-(i*ce-s*W+n*V),He=-(s*R-n*k+r*Y),je=+(i*R-n*he+r*oe),Ct=-(i*k-s*he+r*re),wt=+(i*Y-s*oe+n*re);return O.FromValuesToRef(M*L,ue*L,ke*L,He*L,C*L,xe*L,Z*L,je*L,w*L,ae*L,Ee*L,Ct*L,P*L,Me*L,Oe*L,wt*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 O.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}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}multiply(e){const t=new O;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]*=i[s];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let r=0;r<16;r++)s[r]=i[r]*n[r];return t.markAsUpdated(),t}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],f=s[6],d=s[7],p=s[8],g=s[9],_=s[10],m=s[11],x=s[12],I=s[13],T=s[14],y=s[15],b=n[0],S=n[1],A=n[2],M=n[3],C=n[4],w=n[5],P=n[6],z=n[7],L=n[8],G=n[9],H=n[10],ce=n[11],J=n[12],W=n[13],V=n[14],R=n[15];return t[i]=r*b+o*C+l*L+h*J,t[i+1]=r*S+o*w+l*G+h*W,t[i+2]=r*A+o*P+l*H+h*V,t[i+3]=r*M+o*z+l*ce+h*R,t[i+4]=c*b+u*C+f*L+d*J,t[i+5]=c*S+u*w+f*G+d*W,t[i+6]=c*A+u*P+f*H+d*V,t[i+7]=c*M+u*z+f*ce+d*R,t[i+8]=p*b+g*C+_*L+m*J,t[i+9]=p*S+g*w+_*G+m*W,t[i+10]=p*A+g*P+_*H+m*V,t[i+11]=p*M+g*z+_*ce+m*R,t[i+12]=x*b+I*C+T*L+y*J,t[i+13]=x*S+I*w+T*G+y*W,t[i+14]=x*A+I*P+T*H+y*V,t[i+15]=x*M+I*z+T*ce+y*R,this}divide(e){return this.divideToRef(e,new O)}divideToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let r=0;r<16;r++)n[r]=i[r]/s[r];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]/=i[s];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new O)}negateInPlace(){const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=-t[s];return e.markAsUpdated(),e}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]}equalsWithEpsilon(e,t=0){const i=this._m,s=e.m;for(let n=0;n<16;n++)if(!Lt(i[n],s[n],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new O)}floorToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=Math.floor(t[s]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new O)}fractToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=t[s]-Math.floor(t[s]);return e.markAsUpdated(),e}clone(){const e=new O;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=Zt(this._m[0]);for(let t=1;t<16;t++)e=e*397^Zt(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new le,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s,n=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),e=e||_e.Vector3[0],e.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),e.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),e.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),s){const o=(n?s.absoluteScaling.x:s.scaling.x)<0?-1:1,l=(n?s.absoluteScaling.y:s.scaling.y)<0?-1:1,h=(n?s.absoluteScaling.z:s.scaling.z)<0?-1:1;e.x*=o,e.y*=l,e.z*=h}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 o=1/e._x,l=1/e._y,h=1/e._z;O.FromValuesToRef(r[0]*o,r[1]*o,r[2]*o,0,r[4]*l,r[5]*l,r[6]*l,0,r[8]*h,r[9]*h,r[10]*h,0,0,0,0,1,_e.Matrix[0]),le.FromRotationMatrixToRef(_e.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new Pe(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 O;return O.TransposeToRef(this,e),e}transposeToRef(e){return O.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 O;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}scaleInPlace(e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=_e.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return O.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 O;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=_e.Vector3[0];if(!this.decompose(t))return O.IdentityToRef(e),e;const i=this._m,s=1/t._x,n=1/t._y,r=1/t._z;return O.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 O;return O.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){return s._m[0]=e[0+t]*i,s._m[1]=e[1+t]*i,s._m[2]=e[2+t]*i,s._m[3]=e[3+t]*i,s._m[4]=e[4+t]*i,s._m[5]=e[5+t]*i,s._m[6]=e[6+t]*i,s._m[7]=e[7+t]*i,s._m[8]=e[8+t]*i,s._m[9]=e[9+t]*i,s._m[10]=e[10+t]*i,s._m[11]=e[11+t]*i,s._m[12]=e[12+t]*i,s._m[13]=e[13+t]*i,s._m[14]=e[14+t]*i,s._m[15]=e[15+t]*i,s.markAsUpdated(),s}static get IdentityReadOnly(){return O._IdentityReadOnly}static FromValuesToRef(e,t,i,s,n,r,o,l,h,c,u,f,d,p,g,_,m){const x=m._m;x[0]=e,x[1]=t,x[2]=i,x[3]=s,x[4]=n,x[5]=r,x[6]=o,x[7]=l,x[8]=h,x[9]=c,x[10]=u,x[11]=f,x[12]=d,x[13]=p,x[14]=g,x[15]=_,m.markAsUpdated()}static FromValues(e,t,i,s,n,r,o,l,h,c,u,f,d,p,g,_){const m=new O,x=m._m;return x[0]=e,x[1]=t,x[2]=i,x[3]=s,x[4]=n,x[5]=r,x[6]=o,x[7]=l,x[8]=h,x[9]=c,x[10]=u,x[11]=f,x[12]=d,x[13]=p,x[14]=g,x[15]=_,m.markAsUpdated(),m}static Compose(e,t,i){const s=new O;return O.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,f=l+l,d=r*c,p=r*u,g=r*f,_=o*u,m=o*f,x=l*f,I=h*c,T=h*u,y=h*f,b=e._x,S=e._y,A=e._z;return n[0]=(1-(_+x))*b,n[1]=(p+y)*b,n[2]=(g-T)*b,n[3]=0,n[4]=(p-y)*S,n[5]=(1-(d+x))*S,n[6]=(m+I)*S,n[7]=0,n[8]=(g+T)*A,n[9]=(m-I)*A,n[10]=(1-(d+_))*A,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=O.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 O.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=O.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 O;return O.RotationXToRef(e,t),t}static Invert(e){const t=new O;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.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 O;return O.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.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 O;return O.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.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 O;return O.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,s=!1){const n=v.Dot(t,e),r=i._m;if(n<-1+Ne)r[0]=-1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s?1:-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=s?-1:1,r[11]=0;else{const o=v.Cross(t,e),l=1/(1+n);r[0]=o._x*o._x*l+n,r[1]=o._y*o._x*l-o._z,r[2]=o._z*o._x*l+o._y,r[3]=0,r[4]=o._x*o._y*l+o._z,r[5]=o._y*o._y*l+n,r[6]=o._z*o._y*l-o._x,r[7]=0,r[8]=o._x*o._z*l-o._y,r[9]=o._y*o._z*l+o._x,r[10]=o._z*o._z*l+n,r[11]=0}return r[12]=0,r[13]=0,r[14]=0,r[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new O;return O.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return le.RotationYawPitchRollToRef(e,t,i,_e.Quaternion[0]),_e.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new O;return O.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return O.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 O;return O.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return O.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 O;return O.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 O;return O.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 f=_e.Quaternion[2];le.SlerpToRef(r,h,i,f);const d=_e.Vector3[5];return v.LerpToRef(o,c,i,d),O.ComposeToRef(u,f,d,s),s}static LookAtLH(e,t,i){const s=new O;return O.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);return O.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 LookAtRH(e,t,i){const s=new O;return O.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 O.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 O;return O.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),O.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 O;return O.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=_e.Vector3[2];return v.CrossToRef(t,e,s),O.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 O;return O.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),f=-(l+o)/(l-o);return O.FromValuesToRef(h,0,0,0,0,c,0,0,0,0,u,0,0,0,f,1,n),r&&n.multiplyToRef(Ss,n),n._updateIdentityStatus(h===1&&c===1&&u===1&&f===0),n}static OrthoOffCenterLH(e,t,i,s,n,r,o){const l=new O;return O.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),f=2/(s-i),d=2/(c-h),p=-(c+h)/(c-h),g=(e+t)/(e-t),_=(s+i)/(i-s);return O.FromValuesToRef(u,0,0,0,0,f,0,0,0,0,d,0,g,_,p,1,o),l&&o.multiplyToRef(Ss,o),o.markAsUpdated(),o}static ObliqueOffCenterLHToRef(e,t,i,s,n,r,o,l,h,c,u){const f=-o*Math.cos(l),d=-o*Math.sin(l);return O.TranslationToRef(0,0,-h,_e.Matrix[1]),O.FromValuesToRef(1,0,0,0,0,1,0,0,f,d,1,0,0,0,0,1,_e.Matrix[0]),_e.Matrix[1].multiplyToRef(_e.Matrix[0],_e.Matrix[0]),O.TranslationToRef(0,0,h,_e.Matrix[1]),_e.Matrix[0].multiplyToRef(_e.Matrix[1],_e.Matrix[0]),O.OrthoOffCenterLHToRef(e,t,i,s,n,r,c,u),_e.Matrix[0].multiplyToRef(c,c),c}static OrthoOffCenterRH(e,t,i,s,n,r,o){const l=new O;return O.OrthoOffCenterRHToRef(e,t,i,s,n,r,l,o),l}static OrthoOffCenterRHToRef(e,t,i,s,n,r,o,l){return O.OrthoOffCenterLHToRef(e,t,i,s,n,r,o,l),o._m[10]*=-1,o}static ObliqueOffCenterRHToRef(e,t,i,s,n,r,o,l,h,c,u){const f=o*Math.cos(l),d=o*Math.sin(l);return O.TranslationToRef(0,0,h,_e.Matrix[1]),O.FromValuesToRef(1,0,0,0,0,1,0,0,f,d,1,0,0,0,0,1,_e.Matrix[0]),_e.Matrix[1].multiplyToRef(_e.Matrix[0],_e.Matrix[0]),O.TranslationToRef(0,0,-h,_e.Matrix[1]),_e.Matrix[0].multiplyToRef(_e.Matrix[1],_e.Matrix[0]),O.OrthoOffCenterRHToRef(e,t,i,s,n,r,c,u),_e.Matrix[0].multiplyToRef(c,c),c}static PerspectiveLH(e,t,i,s,n,r=0){const o=new O,l=i,h=s,c=2*l/e,u=2*l/t,f=(h+l)/(h-l),d=-2*h*l/(h-l),p=Math.tan(r);return O.FromValuesToRef(c,0,0,0,0,u,0,p,0,0,f,1,0,0,d,0,o),n&&o.multiplyToRef(Ss,o),o._updateIdentityStatus(!1),o}static PerspectiveFovLH(e,t,i,s,n,r=0,o=!1){const l=new O;return O.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,f=1/Math.tan(e*.5),d=r?f/t:f,p=r?f:f*t,g=h&&c===0?-1:u!==0?(u+c)/(u-c):1,_=h&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,m=Math.tan(l);return O.FromValuesToRef(d,0,0,0,0,p,0,m,0,0,g,1,0,0,_,0,n),o&&n.multiplyToRef(Ss,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,f=Math.tan(l);return O.FromValuesToRef(c,0,0,0,0,u,0,f,0,0,-i,1,0,0,1,0,n),o&&n.multiplyToRef(Ss,n),n._updateIdentityStatus(!1),n}static PerspectiveFovRH(e,t,i,s,n,r=0,o=!1){const l=new O;return O.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,f=1/Math.tan(e*.5),d=r?f/t:f,p=r?f:f*t,g=h&&c===0?1:u!==0?-(u+c)/(u-c):-1,_=h&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,m=Math.tan(l);return O.FromValuesToRef(d,0,0,0,0,p,0,m,0,0,g,-1,0,0,_,0,n),o&&n.multiplyToRef(Ss,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,f=Math.tan(l);return O.FromValuesToRef(c,0,0,0,0,u,0,f,0,0,-i,-1,0,0,-1,0,n),o&&n.multiplyToRef(Ss,n),n._updateIdentityStatus(!1),n}static GetFinalMatrix(e,t,i,s,n,r){const o=e.width,l=e.height,h=e.x,c=e.y,u=O.FromValues(o/2,0,0,0,0,-l/2,0,0,0,0,r-n,0,h+o/2,l/2+c,n,1),f=new O;return t.multiplyToRef(i,f),f.multiplyToRef(s,f),f.multiplyToRef(u,f)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Rt.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 Rt.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new O;return O.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=e.m,s=i[0],n=i[4],r=i[8],o=i[12],l=i[1],h=i[5],c=i[9],u=i[13],f=i[2],d=i[6],p=i[10],g=i[14],_=i[3],m=i[7],x=i[11],I=i[15],T=t._m;return 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]=f,T[9]=d,T[10]=p,T[11]=g,T[12]=_,T[13]=m,T[14]=x,T[15]=I,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new O;return O.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 O.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 O.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}}O._UpdateFlagSeed=0;O._IdentityReadOnly=O.Identity();Object.defineProperties(O.prototype,{dimension:{value:[4,4]},rank:{value:2}});class _e{}_e.Vector3=Bt.BuildTuple(11,v.Zero);_e.Matrix=Bt.BuildTuple(2,O.Identity);_e.Quaternion=Bt.BuildTuple(3,le.Zero);class N{}N.Vector2=Bt.BuildTuple(3,fe.Zero);N.Vector3=Bt.BuildTuple(13,v.Zero);N.Vector4=Bt.BuildTuple(3,Pe.Zero);N.Quaternion=Bt.BuildTuple(2,le.Zero);N.Matrix=Bt.BuildTuple(8,O.Identity);ft("BABYLON.Vector2",fe);ft("BABYLON.Vector3",v);ft("BABYLON.Vector4",Pe);ft("BABYLON.Matrix",O);const Ss=O.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);var ci;(function(a){a[a.LOCAL=0]="LOCAL",a[a.WORLD=1]="WORLD",a[a.BONE=2]="BONE"})(ci||(ci={}));class Wt{}Wt.X=new v(1,0,0);Wt.Y=new v(0,1,0);Wt.Z=new v(0,0,1);var n0;(function(a){a[a.X=0]="X",a[a.Y=1]="Y",a[a.Z=2]="Z"})(n0||(n0={}));class Ye{static Sign(e){return e=+e,e===0||isNaN(e)?e:e>0?1:-1}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=Ye.Repeat(t-e,360);return i>180&&(i-=360),i}static PingPong(e,t){const i=Ye.Repeat(e,t*2);return t-Math.abs(i-t)}static SmoothStep(e,t,i){let s=Ye.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+Ye.Sign(t-e)*i,s}static MoveTowardsAngle(e,t,i){const s=Ye.DeltaAngle(e,t);let n=0;return-i180&&(s-=360),e+s*gt(i)}static InverseLerp(e,t,i){let s=0;return e!=t?s=gt((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 RangeToPercent(e,t,i){return(e-t)/(i-t)}static PercentToRange(e,t,i){return(i-t)*e+t}static HCF(e,t){const i=e%t;return i===0?t:Ye.HCF(t,i)}}Ye.TwoPi=Math.PI*2;Ye.WithinEpsilon=Lt;Ye.ToHex=Ci;Ye.Clamp=gt;Ye.Lerp=Ah;Ye.RandomRange=ut;Ye.NormalizeRadians=Ch;function Ys(a){return Math.pow(a,Wf)}function qs(a){return a<=.04045?.0773993808*a:Math.pow(.947867299*(a+.055),2.4)}function $s(a){return Math.pow(a,zf)}function js(a){return a<=.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class pe{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 pe.FromArrayToRef(e,t,this),this}toColor4(e=1){return new X(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 pe(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,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,i){return new pe(this.r*e,this.g*t,this.b*i)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,i){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=Ne){return Ye.WithinEpsilon(this.r,e.r,t)&&Ye.WithinEpsilon(this.g,e.g,t)&&Ye.WithinEpsilon(this.b,e.b,t)}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}scale(e){return new pe(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,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,i){return i.r=gt(this.r,e,t),i.g=gt(this.g,e,t),i.b=gt(this.b,e,t),i}add(e){return new pe(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,i){return this.r+=e,this.g+=t,this.b+=i,this}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){return new pe(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,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,i){return new pe(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,s){return s.r=this.r-e,s.g=this.g-t,s.b=this.b-i,s}clone(){return new pe(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)}setAll(e){return this.r=this.g=this.b=e,this}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),i=Math.round(this.b*255);return"#"+Ci(e)+Ci(t)+Ci(i)}toHSV(){return this.toHSVToRef(new pe)}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;return 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;return s.r=l+u,s.g=h+u,s.b=c+u,s}static FromHSV(e,t,i){const s=new pe(0,0,0);return pe.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){if(e.substring(0,1)!=="#"||e.length!==7)return new pe(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 pe.FromInts(t,i,s)}static FromArray(e,t=0){return new pe(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 pe(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new pe(0,0,0);return pe.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,f=e.r*l+i.r*h+t.r*c+s.r*u,d=e.g*l+i.g*h+t.g*c+s.g*u,p=e.b*l+i.b*h+t.b*c+s.b*u;return new pe(f,d,p)}static Hermite1stDerivative(e,t,i,s,n){const r=pe.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 pe(1,0,0)}static Green(){return new pe(0,1,0)}static Blue(){return new pe(0,0,1)}static Black(){return new pe(0,0,0)}static get BlackReadOnly(){return pe._BlackReadOnly}static White(){return new pe(1,1,1)}static Purple(){return new pe(.5,0,.5)}static Magenta(){return new pe(1,0,1)}static Yellow(){return new pe(1,1,0)}static Gray(){return new pe(.5,.5,.5)}static Teal(){return new pe(0,1,1)}static Random(){return new pe(Math.random(),Math.random(),Math.random())}}pe._BlackReadOnly=pe.Black();Object.defineProperties(pe.prototype,{dimension:{value:[3]},rank:{value:1}});class X{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}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 this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],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 X(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(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}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this}subtract(e){return new X(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,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,i,s){return new X(this.r-e,this.g-t,this.b-i,this.a-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.r=this.r-e,n.g=this.g-t,n.b=this.b-i,n.a=this.a-s,n}scale(e){return new X(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,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,i){return i.r=gt(this.r,e,t),i.g=gt(this.g,e,t),i.b=gt(this.b,e,t),i.a=gt(this.a,e,t),i}multiply(e){return new X(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}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,i,s){return new X(this.r*e,this.g*t,this.b*i,this.a*s)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,i,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(s,this.a),this}maximizeInPlaceFromFloats(e,t,i,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(s,this.a),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=Ne){return Ye.WithinEpsilon(this.r,e.r,t)&&Ye.WithinEpsilon(this.g,e.g,t)&&Ye.WithinEpsilon(this.b,e.b,t)&&Ye.WithinEpsilon(this.a,e.a,t)}equalsToFloats(e,t,i,s){return this.r===e&&this.g===t&&this.b===i&&this.a===s}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 X().copyFrom(this)}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)}setAll(e){return this.r=this.g=this.b=this.a=e,this}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"#"+Ci(t)+Ci(i)+Ci(s);const n=Math.round(this.a*255);return"#"+Ci(t)+Ci(i)+Ci(s)+Ci(n)}toLinearSpace(e=!1){const t=new X;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=qs(this.r),e.g=qs(this.g),e.b=qs(this.b)):(e.r=Ys(this.r),e.g=Ys(this.g),e.b=Ys(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new X;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=js(this.r),e.g=js(this.g),e.b=js(this.b)):(e.r=$s(this.r),e.g=$s(this.g),e.b=$s(this.b)),e.a=this.a,this}static FromHexString(e){if(e.substring(0,1)!=="#"||e.length!==9&&e.length!==7)return new X(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 X.FromInts(t,i,s,n)}static Lerp(e,t,i){return X.LerpToRef(e,t,i,new X)}static LerpToRef(e,t,i,s){return 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,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,f=e.r*l+i.r*h+t.r*c+s.r*u,d=e.g*l+i.g*h+t.g*c+s.g*u,p=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 X(f,d,p,g)}static Hermite1stDerivative(e,t,i,s,n){const r=new X;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 X(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new X(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 X(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;snew X(0,0,0,0));ft("BABYLON.Color3",pe);ft("BABYLON.Color4",X);class Yt{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 Yt(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=Yt._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 Yt(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,f=s*l-n*o,d=Math.sqrt(c*c+u*u+f*f);let p;return d!==0?p=1/d:p=0,this.normal.x=c*p,this.normal.y=u*p,this.normal.z=f*p,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 Yt(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new Yt(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new Yt(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),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}}Yt._TmpMatrix=O.Identity();class mi{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new Yt(0,0,0,0));return mi.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){mi.GetNearPlaneToRef(e,t[0]),mi.GetFarPlaneToRef(e,t[1]),mi.GetLeftPlaneToRef(e,t[2]),mi.GetRightPlaneToRef(e,t[3]),mi.GetTopPlaneToRef(e,t[4]),mi.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 r0;(function(a){a[a.CW=0]="CW",a[a.CCW=1]="CCW"})(r0||(r0={}));class Vi{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 Vi(s)}static BetweenTwoVectors(e,t){let i=e.lengthSquared()*t.lengthSquared();if(i===0)return new Vi(Math.PI/2);i=Math.sqrt(i);let s=e.dot(t)/i;s=Ye.Clamp(s,-1,1);const n=Math.acos(s);return new Vi(n)}static FromRadians(e){return new Vi(e)}static FromDegrees(e){return new Vi(e*Math.PI/180)}}class Kf{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=Vi.BetweenTwoPoints(this.centerPoint,this.startPoint);const l=this.startAngle.degrees();let h=Vi.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),c=Vi.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?0:1,this.angle=Vi.FromDegrees(this.orientation===0?l-c:c-l)}}class Mr{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 Kf(r,o,l);let c=h.angle.radians()/n;h.orientation===0&&(c*=-1);let u=h.startAngle.radians()+c;for(let f=0;f(1-l)*(1-l)*h+2*l*(1-l)*c+l*l*u,o=this._points[this._points.length-1];for(let l=0;l<=n;l++){const h=l/n,c=r(h,o.x,e,i),u=r(h,o.y,t,s);this.addLineTo(c,u)}return this}addBezierCurveTo(e,t,i,s,n,r,o=36){if(this.closed)return this;const l=(c,u,f,d,p)=>(1-c)*(1-c)*(1-c)*u+3*c*(1-c)*(1-c)*f+3*c*c*(1-c)*d+c*c*c*p,h=this._points[this._points.length-1];for(let c=0;c<=o;c++){const u=c/o,f=l(u,h.x,e,i,n),d=l(u,h.y,t,s,r);this.addLineTo(f,d)}return this}isPointInside(e){let t=!1;const i=this._points.length;for(let s=i-1,n=0;nNumber.EPSILON){if(h<0&&(r=this._points[n],l=-l,o=this._points[s],h=-h),e.yo.y)continue;if(e.y===r.y&&e.x===r.x)return!0;{const c=h*(e.x-r.x)-l*(e.y-r.y);if(c===0)return!0;if(c<0)continue;t=!t}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return t}close(){return this.closed=!0,this}length(){let e=this._length;if(this.closed){const t=this._points[this._points.length-1],i=this._points[0];e+=i.subtract(t).length()}return e}area(){const e=this._points.length;let t=0;for(let i=e-1,s=0;s1)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 Mr(e,t)}}class In{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:O.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 In(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;Ye.WithinEpsilon(Math.abs(e.y)/s,1,Ne)?Ye.WithinEpsilon(Math.abs(e.x)/s,1,Ne)?Ye.WithinEpsilon(Math.abs(e.z)/s,1,Ne)?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,f=s.subtract(n),d=n.add(f.scaleInPlace(u));return this._setPointAtData(e,1-u,d,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=O.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=le.RotationQuaternionFromAxis(s,n,i),c=le.RotationQuaternionFromAxis(o,l,r);le.Slerp(h,c,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class oi{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 oi(this.width*e,this.height*t)}clone(){return new oi(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 oi(0,0)}add(e){return new oi(this.width+e.width,this.height+e.height)}subtract(e){return new oi(this.width-e.width,this.height-e.height)}scale(e){return new oi(this.width*e,this.height*e)}static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,n=e.height+(t.height-e.height)*i;return new oi(s,n)}}class Qs{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new Qs(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 Qs(this.x,this.y,this.width,this.height)}}var a0;(function(a){a.LowPower="low-power",a.HighPerformance="high-performance"})(a0||(a0={}));var o0;(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"})(o0||(o0={}));var l0;(function(a){a.Unmapped="unmapped",a.Pending="pending",a.Mapped="mapped"})(l0||(l0={}));var We;(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"})(We||(We={}));var h0;(function(a){a[a.Read=1]="Read",a[a.Write=2]="Write"})(h0||(h0={}));var c0;(function(a){a.E1d="1d",a.E2d="2d",a.E3d="3d"})(c0||(c0={}));var u0;(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"})(u0||(u0={}));var f0;(function(a){a.E1d="1d",a.E2d="2d",a.E2dArray="2d-array",a.Cube="cube",a.CubeArray="cube-array",a.E3d="3d"})(f0||(f0={}));var d0;(function(a){a.All="all",a.StencilOnly="stencil-only",a.DepthOnly="depth-only"})(d0||(d0={}));var p0;(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.RGB10A2UINT="rgb10a2uint",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.Depth32FloatStencil8="depth32float-stencil8"})(p0||(p0={}));var _0;(function(a){a.ClampToEdge="clamp-to-edge",a.Repeat="repeat",a.MirrorRepeat="mirror-repeat"})(_0||(_0={}));var g0;(function(a){a.Nearest="nearest",a.Linear="linear"})(g0||(g0={}));var m0;(function(a){a.Nearest="nearest",a.Linear="linear"})(m0||(m0={}));var v0;(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"})(v0||(v0={}));var x0;(function(a){a[a.Vertex=1]="Vertex",a[a.Fragment=2]="Fragment",a[a.Compute=4]="Compute"})(x0||(x0={}));var b0;(function(a){a.Uniform="uniform",a.Storage="storage",a.ReadOnlyStorage="read-only-storage"})(b0||(b0={}));var y0;(function(a){a.Filtering="filtering",a.NonFiltering="non-filtering",a.Comparison="comparison"})(y0||(y0={}));var T0;(function(a){a.Float="float",a.UnfilterableFloat="unfilterable-float",a.Depth="depth",a.Sint="sint",a.Uint="uint"})(T0||(T0={}));var S0;(function(a){a.WriteOnly="write-only",a.ReadOnly="read-only",a.ReadWrite="read-write"})(S0||(S0={}));var E0;(function(a){a.Error="error",a.Warning="warning",a.Info="info"})(E0||(E0={}));var I0;(function(a){a.Validation="validation",a.Internal="internal"})(I0||(I0={}));var A0;(function(a){a.Auto="auto"})(A0||(A0={}));var C0;(function(a){a.PointList="point-list",a.LineList="line-list",a.LineStrip="line-strip",a.TriangleList="triangle-list",a.TriangleStrip="triangle-strip"})(C0||(C0={}));var M0;(function(a){a.CCW="ccw",a.CW="cw"})(M0||(M0={}));var R0;(function(a){a.None="none",a.Front="front",a.Back="back"})(R0||(R0={}));var P0;(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"})(P0||(P0={}));var w0;(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"})(w0||(w0={}));var D0;(function(a){a.Add="add",a.Subtract="subtract",a.ReverseSubtract="reverse-subtract",a.Min="min",a.Max="max"})(D0||(D0={}));var F0;(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"})(F0||(F0={}));var O0;(function(a){a.Uint16="uint16",a.Uint32="uint32"})(O0||(O0={}));var L0;(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",a.UNORM10x10x10x2="unorm10-10-10-2"})(L0||(L0={}));var B0;(function(a){a.Vertex="vertex",a.Instance="instance"})(B0||(B0={}));var N0;(function(a){a.Beginning="beginning",a.End="end"})(N0||(N0={}));var U0;(function(a){a.Beginning="beginning",a.End="end"})(U0||(U0={}));var k0;(function(a){a.Load="load",a.Clear="clear"})(k0||(k0={}));var V0;(function(a){a.Store="store",a.Discard="discard"})(V0||(V0={}));var G0;(function(a){a.Occlusion="occlusion",a.Timestamp="timestamp"})(G0||(G0={}));var z0;(function(a){a.Opaque="opaque",a.Premultiplied="premultiplied"})(z0||(z0={}));var W0;(function(a){a.Unknown="unknown",a.Destroyed="destroyed"})(W0||(W0={}));var X0;(function(a){a.Validation="validation",a.OutOfMemory="out-of-memory",a.Internal="internal"})(X0||(X0={}));class Js{get isDisposed(){return this._isDisposed}constructor(e,t,i,s=0,n=!1,r=!1,o=!1,l,h){this._isAlreadyOwned=!1,this._isDisposed=!1,e&&e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=r,this._divisor=l||1,this._label=h,t instanceof on?(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 E(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._label),this._data=e):this._buffer=this._engine.createVertexBuffer(e,void 0,this._label)))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else{if(!this._buffer)return;if(this._buffer.capacity>0){this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label);return}U.Warn('Missing data for buffer "'.concat(this._label,'" ').concat(this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":"",". Buffer reconstruction failed.")),this._buffer=null}}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._isDisposed=!0,this._data=null,this._buffer=null)}}class E{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,i,s,n,r,o,l,h,c,u=!1,f=!1,d=1,p=!1){var m,x,I,T,y;this._isDisposed=!1;let g=!1;if(this.engine=e,typeof s=="object"&&s!==null?(g=(m=s.updatable)!=null?m:!1,n=s.postponeInternalCreation,r=s.stride,o=s.instanced,l=s.offset,h=s.size,c=s.type,u=(x=s.normalized)!=null?x:!1,f=(I=s.useBytes)!=null?I:!1,d=(T=s.divisor)!=null?T:1,p=(y=s.takeBufferOwnership)!=null?y:!1,this._label=s.label):g=!!s,t instanceof Js?(this._buffer=t,this._ownsBuffer=p):(this._buffer=new Js(e,t,g,r,n,o,f,d,this._label),this._ownsBuffer=!0),this.uniqueId=E._Counter++,this._kind=i,c===void 0){const b=this.getData();this.type=b?E.GetDataType(b):E.FLOAT}else this.type=c;const _=E.GetTypeByteLength(this.type);f?(this._size=h||(r?r/_:E.DeduceStride(i)),this.byteStride=r||this._buffer.byteStride||this._size*_,this.byteOffset=l||0):(this._size=h||r||E.DeduceStride(i),this.byteStride=r?r*_:this._buffer.byteStride||this._size*_,this.byteOffset=(l||0)*_),this.normalized=u,this._instanced=o!==void 0?o:!1,this._instanceDivisor=o?d:0,this._alignBuffer(),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(){var e;(e=this._buffer)==null||e._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const i=this.getData();return i?E.GetFloatData(i,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/E.GetTypeByteLength(this.type)}getOffset(){return this.byteOffset/E.GetTypeByteLength(this.type)}getSize(e=!1){return e?this._size*E.GetTypeByteLength(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e),this._alignBuffer()}update(e){this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,i=!1){this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){E.ForEach(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,t)}_alignBuffer(){}static DeduceStride(e){switch(e){case E.UVKind:case E.UV2Kind:case E.UV3Kind:case E.UV4Kind:case E.UV5Kind:case E.UV6Kind:return 2;case E.NormalKind:case E.PositionKind:return 3;case E.ColorKind:case E.ColorInstanceKind:case E.MatricesIndicesKind:case E.MatricesIndicesExtraKind:case E.MatricesWeightsKind:case E.MatricesWeightsExtraKind:case E.TangentKind:return 4;default:throw new Error("Invalid kind '"+e+"'")}}static GetDataType(e){return e instanceof Int8Array?E.BYTE:e instanceof Uint8Array?E.UNSIGNED_BYTE:e instanceof Int16Array?E.SHORT:e instanceof Uint16Array?E.UNSIGNED_SHORT:e instanceof Int32Array?E.INT:e instanceof Uint32Array?E.UNSIGNED_INT:E.FLOAT}static GetTypeByteLength(e){switch(e){case E.BYTE:case E.UNSIGNED_BYTE:return 1;case E.SHORT:case E.UNSIGNED_SHORT:return 2;case E.INT:case E.UNSIGNED_INT:case E.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;uu[d]=f),u}if(!(e instanceof Array||e instanceof Float32Array)||s!==0||e.length!==c)if(e instanceof Array){const u=s/4;return e.slice(u,u+c)}else{if(e instanceof ArrayBuffer)return new Float32Array(e,s,c);{let u=e.byteOffset+s;if(l){const d=new Float32Array(c),p=new Float32Array(e.buffer,u,c);return d.set(p),d}const f=u%4;return f&&(u=Math.max(0,u-f)),new Float32Array(e.buffer,u,c)}}return l?e.slice():e}}E._Counter=0;E.BYTE=5120;E.UNSIGNED_BYTE=5121;E.SHORT=5122;E.UNSIGNED_SHORT=5123;E.INT=5124;E.UNSIGNED_INT=5125;E.FLOAT=5126;E.PositionKind="position";E.NormalKind="normal";E.TangentKind="tangent";E.UVKind="uv";E.UV2Kind="uv2";E.UV3Kind="uv3";E.UV4Kind="uv4";E.UV5Kind="uv5";E.UV6Kind="uv6";E.ColorKind="color";E.ColorInstanceKind="instanceColor";E.MatricesIndicesKind="matricesIndices";E.MatricesWeightsKind="matricesWeights";E.MatricesIndicesExtraKind="matricesIndicesExtra";E.MatricesWeightsExtraKind="matricesWeightsExtra";const H0=(a,e,t)=>!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&(a.getClassName()==="SubMesh"||a.getClassName()==="PhysicsBody")?a.clone(e):a.clone?a.clone():Array.isArray(a)?a.slice():t&&typeof a=="object"?{...a}:null;function Yf(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 Ya{static DeepCopy(e,t,i,s,n=!1){const r=Yf(e);for(const o of r){if(o[0]==="_"&&(!s||s.indexOf(o)===-1)||o.endsWith("Observable")||i&&i.indexOf(o)!==-1)continue;const l=e[o],h=typeof l;if(h!=="function")try{if(h==="object")if(l instanceof Uint8Array)t[o]=Uint8Array.from(l);else if(l instanceof Array){if(t[o]=[],l.length>0)if(typeof l[0]=="object")for(let c=0;c0||Ft.CustomRequestModifiers.length>0}_injectCustomRequestHeaders(){if(!this._shouldSkipRequestModifications(this._requestURL))for(const e in Ft.CustomRequestHeaders){const t=Ft.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}}_shouldSkipRequestModifications(e){return Ft.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){Ft.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)}open(e,t){for(const i of Ft.CustomRequestModifiers){if(this._shouldSkipRequestModifications(t))return;i(this._xhr,t)}t=t.replace("file:http:","http:"),t=t.replace("file:https:","https:"),this._requestURL=t,this._xhr.open(e,t,!0)}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}Ft.CustomRequestHeaders={};Ft.CustomRequestModifiers=new Array;Ft.SkipRequestModificationForBabylonCDN=!0;class bn{}bn.FilesToLoad={};class $f{static ExponentialBackoff(e=3,t=500){return(i,s,n)=>s.status!==0||n>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,n)*t}}class en extends Error{}en._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const Ps={MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class is extends en{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",en._setPrototypeOf(this,is.prototype)}}const Mh=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},Rh=a=>atob(a),jf=a=>{const e=Rh(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s(a=a.replace(/#/gm,"%23"),a),ct={DefaultRetryStrategy:$f.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:a=>a,ScriptBaseUrl:"",ScriptPreprocessUrl:a=>a,CleanUrl:Zf},$a=(a,e)=>{if(!(a&&a.indexOf("data:")===0)&&ct.CorsBehavior)if(typeof ct.CorsBehavior=="string"||ct.CorsBehavior instanceof String)e.crossOrigin=ct.CorsBehavior;else{const t=ct.CorsBehavior(a);t&&(e.crossOrigin=t)}},ja=(a,e,t,i,s="",n)=>{const r=Ce.LastCreatedEngine;if(typeof HTMLImageElement>"u"&&!(r!=null&&r._features.forceBitmapOverHTMLImageElement))return t("LoadImage is only supported in web or BabylonNative environments."),null;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,")+Mh(a):a instanceof Blob?(o=URL.createObjectURL(a),l=!0):(o=ct.CleanUrl(a),o=ct.PreprocessUrl(a));const h=y=>{if(t){const b=o||a.toString();t("Error while trying to load image: ".concat(b.indexOf("http")===0||b.length<=128?b:b.slice(0,128)+"..."),y)}};if(r!=null&&r._features.forceBitmapOverHTMLImageElement)return vs(o,y=>{r.createImageBitmap(new Blob([y],{type:s}),{premultiplyAlpha:"none",...n}).then(b=>{e(b),l&&URL.revokeObjectURL(o)}).catch(b=>{t&&t("Error while trying to load image: "+a,b)})},void 0,i||void 0,!0,(y,b)=>{h(b)}),null;const c=new Image;$a(o,c);const u=[],f=()=>{u.forEach(y=>{y.target.addEventListener(y.name,y.handler)})},d=()=>{u.forEach(y=>{y.target.removeEventListener(y.name,y.handler)}),u.length=0},p=()=>{d(),e(c),l&&c.src&&URL.revokeObjectURL(c.src)},g=y=>{d(),h(y),l&&c.src&&URL.revokeObjectURL(c.src)},_=y=>{if(y.blockedURI!==c.src)return;d();const b=new Error("CSP violation of policy ".concat(y.effectiveDirective," ").concat(y.blockedURI,". Current policy is ").concat(y.originalPolicy));Ce.UseFallbackTexture=!1,h(b),l&&c.src&&URL.revokeObjectURL(c.src),c.src=""};u.push({target:c,name:"load",handler:p}),u.push({target:c,name:"error",handler:g}),u.push({target:document,name:"securitypolicyviolation",handler:_}),f();const m=o.substring(0,5)==="blob:",x=o.substring(0,5)==="data:",I=()=>{m||x||!Ft.IsCustomRequestAvailable?c.src=o:vs(o,(y,b,S)=>{const A=!s&&S?S:s,M=new Blob([y],{type:A}),C=URL.createObjectURL(M);l=!0,c.src=C},void 0,i||void 0,!0,(y,b)=>{h(b)})},T=()=>{i&&i.loadImage(o,c)};if(!m&&!x&&i&&i.enableTexturesOffline)i.open(T,I);else{if(o.indexOf("file:")!==-1){const y=decodeURIComponent(o.substring(5).toLowerCase());if(bn.FilesToLoad[y]&&typeof URL<"u"){try{let b;try{b=URL.createObjectURL(bn.FilesToLoad[y])}catch{b=URL.createObjectURL(bn.FilesToLoad[y])}c.src=b,l=!0}catch{c.src=""}return c}}I()}return c},An=(a,e,t,i,s)=>{const n=new FileReader,r={onCompleteObservable:new Q,abort:()=>n.abort()};return n.onloadend=()=>r.onCompleteObservable.notifyObservers(r),s&&(n.onerror=()=>{s(new qa("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},vs=(a,e,t,i,s,n,r)=>{if(a.name)return An(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=bn.FilesToLoad[c];if(u)return An(u,e,t,s,n?f=>n(void 0,new cr(f.message,f.file)):void 0)}const{match:l,type:h}=Qf(o);if(l){const c={onCompleteObservable:new Q,abort:()=>()=>{}};try{const u=s?Ja(o):Dh(o);e(u,void 0,h)}catch(u){n?n(void 0,u):U.Error(u.message||"Failed to parse the Data URL")}return hr.SetImmediate(()=>{c.onCompleteObservable.notifyObservers(c)}),c}return Za(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 cr(c.message,c.request))}:void 0,r)},Za=(a,e,t,i,s,n,r)=>{a=ct.CleanUrl(a),a=ct.PreprocessUrl(a);const o=ct.BaseUrl+a;let l=!1;const h={onCompleteObservable:new Q,abort:()=>l=!0},c=()=>{let u=new Ft,f=null,d;const p=()=>{u&&(t&&u.removeEventListener("progress",t),d&&u.removeEventListener("readystatechange",d),u.removeEventListener("loadend",g))};let g=()=>{p(),h.onCompleteObservable.notifyObservers(h),h.onCompleteObservable.clear(),t=void 0,d=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(),f!==null&&(clearTimeout(f),f=null),u=null};const _=x=>{const I=x.message||"Unknown error";n&&u?n(new ur(I,u)):U.Error(I)},m=x=>{if(u){if(u.open("GET",o),r)try{r(u)}catch(I){_(I);return}s&&(u.responseType="arraybuffer"),t&&u.addEventListener("progress",t),g&&u.addEventListener("loadend",g),d=()=>{if(!(l||!u)&&u.readyState===(XMLHttpRequest.DONE||4)){if(d&&u.removeEventListener("readystatechange",d),u.status>=200&&u.status<300||u.status===0&&(!St()||wh())){try{e&&e(s?u.response:u.responseText,u)}catch(y){_(y)}return}const I=ct.DefaultRetryStrategy;if(I){const y=I(o,u,x);if(y!==-1){p(),u=new Ft,f=setTimeout(()=>m(x+1),y);return}}const T=new ur("Error status: "+u.status+" "+u.statusText+" - Unable to load "+o,u);n&&n(T)}},u.addEventListener("readystatechange",d),u.send()}};m(0)};if(i&&i.enableSceneOffline){const u=d=>{d&&d.status>400?n&&n(d):c()},f=()=>{i&&i.loadFile(ct.BaseUrl+a,d=>{!l&&e&&e(d),h.onCompleteObservable.notifyObservers(h)},t?d=>{!l&&t&&t(d)}:void 0,u,s)};i.open(f,u)}else c();return h},wh=()=>typeof location<"u"&&location.protocol==="file:",Qa=a=>Ph.test(a),Qf=a=>{const e=Ph.exec(a);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace("base64,","")}};function Ja(a){return jf(a.split(",")[1])}const Dh=a=>Rh(a.split(",")[1]),Jf=()=>{me._FileToolsLoadImage=ja,or.loadFile=vs,ch.loadFile=vs};Jf();let fn;const ed=(a,e,t,i,s,n,r,o,l,h)=>{fn={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(fn,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(c){t.DefaultRetryStrategy=c}}),Object.defineProperty(fn,"BaseUrl",{get:function(){return t.BaseUrl},set:function(c){t.BaseUrl=c}}),Object.defineProperty(fn,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(c){t.PreprocessUrl=c}}),Object.defineProperty(fn,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(c){t.CorsBehavior=c}})};ed(Ja,Dh,ct,Qa,wh,vs,ja,An,Za,$a);class yn{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=ms(e);if(t)return t;U.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 ee{static get BaseUrl(){return ct.BaseUrl}static set BaseUrl(e){ct.BaseUrl=e}static get CleanUrl(){return ct.CleanUrl}static set CleanUrl(e){ct.CleanUrl=e}static IsAbsoluteUrl(e){return e.indexOf("//")===0?!0:e.indexOf("://")===-1||e.indexOf(".")===-1||e.indexOf("/")===-1||e.indexOf(":")>e.indexOf("/")?!1:e.indexOf("://"){vs(e,n=>{i(n)},void 0,void 0,t,(n,r)=>{s(r)})})}static GetBabylonScriptURL(e,t){if(!e)return"";if(ee.ScriptBaseUrl&&e.startsWith(ee._DefaultCdnUrl)){const i=ee.ScriptBaseUrl[ee.ScriptBaseUrl.length-1]==="/"?ee.ScriptBaseUrl.substring(0,ee.ScriptBaseUrl.length-1):ee.ScriptBaseUrl;e=e.replace(ee._DefaultCdnUrl,i)}return e=ee.ScriptPreprocessUrl(e),t&&(e=ee.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,s){e=ee.GetBabylonScriptURL(e),ee.LoadScript(e,t,i)}static LoadBabylonScriptAsync(e){return e=ee.GetBabylonScriptURL(e),ee.LoadScriptAsync(e)}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(!St()){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,t){return new Promise((i,s)=>{this.LoadScript(e,()=>{i()},(n,r)=>{s(r||new Error(n))},t)})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,n={onCompleteObservable:new Q,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 An(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){Ya.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;ut(n)):e.toBlob(function(n){t(n)},i,s)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const i=new Date;t="screenshot_"+((i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2))+".png"}ee.Download(e,t)}else if(e&&typeof URL<"u"){const i=URL.createObjectURL(e),s=window.open("");if(!s)return;const n=s.document.createElement("img");n.onload=function(){URL.revokeObjectURL(i)},n.src=i,s.document.body.appendChild(n)}}static EncodeScreenshotCanvasData(e,t,i="image/png",s,n){if(typeof s=="string"||!t)this.ToBlob(e,function(r){r&&ee.DownloadBlob(r,s),t&&t("")},i,n);else if(t){if(ee._IsOffScreenCanvas(e)){e.convertToBlob({type:i,quality:n}).then(o=>{const l=new FileReader;l.readAsDataURL(o),l.onloadend=()=>{const h=l.result;t(h)}});return}const r=e.toDataURL(i,n);t(r)}}static Download(e,t){if(typeof URL>"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",r=!1,o){throw Te("ScreenshotTools")}static CreateScreenshotAsync(e,t,i,s="image/png",n){throw Te("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,n="image/png",r=1,o=!1,l,h=!1,c=!1,u=!0,f){throw Te("ScreenshotTools")}static CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",n=1,r=!1,o,l=!1,h=!1,c=!0,u){throw Te("ScreenshotTools")}static RandomId(){return eo()}static IsBase64(e){return Qa(e)}static DecodeBase64(e){return Ja(e)}static get errorsCount(){return U.errorsCount}static Log(e){U.Log(e)}static Warn(e){U.Warn(e)}static Error(e){U.Error(e)}static get LogCache(){return U.LogCache}static ClearLogCache(){U.ClearLogCache()}static set LogLevels(e){U.LogLevels=e}static set PerformanceLogLevel(e){if((e&ee.PerformanceUserMarkLogLevel)===ee.PerformanceUserMarkLogLevel){ee.StartPerformanceCounter=ee._StartUserMark,ee.EndPerformanceCounter=ee._EndUserMark;return}if((e&ee.PerformanceConsoleLogLevel)===ee.PerformanceConsoleLogLevel){ee.StartPerformanceCounter=ee._StartPerformanceConsole,ee.EndPerformanceCounter=ee._EndPerformanceConsole;return}ee.StartPerformanceCounter=ee._StartPerformanceCounterDisabled,ee.EndPerformanceCounter=ee._EndPerformanceCounterDisabled}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!ee._Performance){if(!St())return;ee._Performance=window.performance}!t||!ee._Performance.mark||ee._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!ee._Performance.mark||(ee._Performance.mark(e+"-End"),ee._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(ee._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(ee._EndUserMark(e,t),console.timeEnd(e))}static get Now(){return xi.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 Xs()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}ee.UseCustomRequestHeaders=!1;ee.CustomRequestHeaders=Ft.CustomRequestHeaders;ee.GetDOMTextContent=Ga;ee._DefaultCdnUrl="https://cdn.babylonjs.com";ee.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.")};ee.NoneLogLevel=U.NoneLogLevel;ee.MessageLogLevel=U.MessageLogLevel;ee.WarningLogLevel=U.WarningLogLevel;ee.ErrorLogLevel=U.ErrorLogLevel;ee.AllLogLevel=U.AllLogLevel;ee.IsWindowObjectExist=St;ee.PerformanceNoneLogLevel=0;ee.PerformanceUserMarkLogLevel=1;ee.PerformanceConsoleLogLevel=2;ee.StartPerformanceCounter=ee._StartPerformanceCounterDisabled;ee.EndPerformanceCounter=ee._EndPerformanceCounterDisabled;class fr{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)}}ee.Mix=da;ee.IsExponentOfTwo=gf;Ce.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";Fe.prototype.createUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");const i=new Sn(t);return this.bindUniformBuffer(i),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),i.references=1,i};Fe.prototype.createDynamicUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");const i=new Sn(t);return this.bindUniformBuffer(i),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),i.references=1,i};Fe.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)};Fe.prototype.bindUniformBuffer=function(a){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,a?a.underlyingResource:null)};Fe.prototype.bindUniformBufferBase=function(a,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,a?a.underlyingResource:null)};Fe.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 de{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&&(de._UpdatedUbosInFrame[this._name]||(de._UpdatedUbosInFrame[this._name]=0),de._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){U.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let n=0;n=0&&(f.push(o[u]),d.push(p))}this.shaderProcessingContext.attributeNamesFromEffect=f,this.shaderProcessingContext.attributeLocationsFromEffect=d}buildUniformLayout(){if(this.shaderProcessingContext.leftOverUniforms.length){this.uniformBuffer=new de(this.engine,void 0,void 0,"leftOver-"+this._name);for(const e of this.shaderProcessingContext.leftOverUniforms){const t=e.type.replace(/^(.*?)(<.*>)?$/,"$1"),i=bt.UniformSizes[t];this.uniformBuffer.addUniform(e.name,i,e.length),this._leftOverUniformsByName[e.name]=e.type}this.uniformBuffer.create()}}setEngine(e){this.engine=e}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?void 0:e.vertex}_getFragmentShaderCode(){var e;return(e=this.sources)==null?void 0:e.fragment}}const id=4,sd=65536,K0={mat2:2,mat3:3,mat4:4,mat2x2:2,mat3x3:3,mat4x4:4};class ii{static get KnownUBOs(){return ii._SimplifiedKnownBindings?ii._SimplifiedKnownUBOs:ii._KnownUBOs}constructor(e){this.vertexBufferKindToNumberOfComponents={},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=ii.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 s;const i=this._attributeNextLocation;return this._attributeNextLocation+=((s=K0[e])!=null?s:1)*(t||1),i}getVaryingNextLocation(e,t=0){var s;const i=this._varyingNextLocation;return this._varyingNextLocation+=((s=K0[e])!=null?s:1)*(t||1),i}getNextFreeUBOBinding(){return this._getNextFreeBinding(1)}_getNextFreeBinding(e){if(this.freeBindingIndex>sd-e&&(this.freeGroupIndex++,this.freeBindingIndex=0),this.freeGroupIndex===id)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}}ii._SimplifiedKnownBindings=!0;ii._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}}};ii._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}}};function qn(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 ga(a){let e=0,t="",i=!1;const s=[];for(;e=0&&a.charAt(e)!==t&&(!i||a.charAt(e)!==i);)e--;return e}function rd(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ma(a,e,t,i){let s=a.indexOf(e);if(s<0)return a;if(t){for(;s++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\nuniform ".concat(bt.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)}varyingCheck(e,t){const i=/(flat\s)?\s*\bout\b/,s=/(flat\s)?\s*\bin\b/,n=/(flat\s)?\s*\bvarying\b/;return(t&&this._fragmentIsGLES3?s:!t&&this._vertexIsGLES3?i:n).test(e)}varyingProcessor(e,t,i){var h;this._preProcessors=i;const s=/\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,n=/\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,r=/\s*(flat)?\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 c=(h=l[1])!=null?h:"",u=l[2],f=l[3];let d;t?(d=this._webgpuProcessingContext.availableVaryings[f],this._missingVaryings[d]="",d===void 0&&U.Warn('Invalid fragment shader: The varying named "'.concat(f,'" is not declared in the vertex shader! This declaration will be ignored.'))):(d=this._webgpuProcessingContext.getVaryingNextLocation(u,this._getArraySize(f,u,i)[2]),this._webgpuProcessingContext.availableVaryings[f]=d,this._missingVaryings[d]="layout(location = ".concat(d,") ").concat(c," in ").concat(u," ").concat(f,";")),e=e.replace(l[0],d===void 0?"":"layout(location = ".concat(d,") ").concat(c," ").concat(t?"in":"out"," ").concat(u," ").concat(f,";"))}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;const c=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[l];if(c!==void 0){const u=c<0?c===-1?"int":"ivec"+-c:c===1?"uint":"uvec"+c,f="_int_".concat(l,"_");e=e.replace(r[0],"layout(location = ".concat(h,") in ").concat(u," ").concat(f,"; ").concat(o," ").concat(l," = ").concat(o,"(").concat(f,");"))}else e=e.replace(r[0],"layout(location = ".concat(h,") in ").concat(o," ").concat(l,";"))}return e}uniformProcessor(e,t,i){var r;this._preProcessors=i;const n=/\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);if(n!==null){let o=n[1],l=n[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:"float"};for(let A=0;A<(h||1);++A)c.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}const u=(r=bt._SamplerTypeByWebGLSamplerType[o])!=null?r:"sampler",f=!!bt._IsComparisonSamplerByWebGPUSamplerType[u],d=f?"comparison":"filtering",p=l+"Sampler";let g=this._webgpuProcessingContext.availableSamplers[p];g||(g={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:d});const _=o.charAt(0)==="u"?"u":o.charAt(0)==="i"?"i":"";_&&(o=o.substr(1));const m=f?"depth":_==="u"?"uint":_==="i"?"sint":"float";c.sampleType=m;const x=h>0,I=g.binding.groupIndex,T=g.binding.bindingIndex,y=bt._SamplerFunctionByWebGLSamplerType[o],b=bt._TextureTypeByWebGLSamplerType[o],S=bt._GpuTextureViewDimensionByWebGPUTextureType[b];if(!x)h=1,e="layout(set = ".concat(I,", binding = ").concat(T,") uniform ").concat(u," ").concat(p,";\n layout(set = ").concat(c.textures[0].groupIndex,", binding = ").concat(c.textures[0].bindingIndex,") uniform ").concat(_).concat(b," ").concat(l,"Texture;\n #define ").concat(l," ").concat(_).concat(y,"(").concat(l,"Texture, ").concat(p,")");else{const A=[];A.push("layout(set = ".concat(I,", binding = ").concat(T,") uniform ").concat(_).concat(u," ").concat(p,";")),e="\n";for(let M=0;M0?"\n":"","#define ").concat(l).concat(M," ").concat(_).concat(y,"(").concat(l,"Texture").concat(M,", ").concat(p,")")}e=A.join("\n")+e,this._textureArrayProcessing.push(l)}this._webgpuProcessingContext.availableTextures[l]=c,this._webgpuProcessingContext.availableSamplers[p]=g,this._addSamplerBindingDescription(p,g,!t);for(let A=0;A=0,h="\n glFragCoord_ = gl_FragCoord;\n if (yFactor_ == 1.) {\n glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;\n }\n ",c=l?"vec4 glFragCoord_;\n":"",u=e.search(/layout *\(location *= *0\) *out/g)!==-1;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||u?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(");else{const f=/^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);f!==null&&(e=e.substring(0,f.index)+"layout(location = 0) "+e.substring(f.index))}e=e.replace(/dFdy/g,"(-yFactor_)*dFdy"),e=e.replace("##INJECTCODE##",c),l&&(e=ma(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",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,this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}}const od="bonesDeclaration",ld="#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4;attribute matricesWeights : vec4;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4;attribute matricesWeightsExtra : vec4;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d;uniform 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{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2(offset+0,0),0);let m1=textureLoad(smp,vec2(offset+1,0),0);let m2=textureLoad(smp,vec2(offset+2,0),0);let m3=textureLoad(smp,vec2(offset+3,0),0);return mat4x4(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[od]=ld;const hd="bonesVertex",cd="#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";K.IncludesShadersStoreWGSL[hd]=cd;const ud="bakedVertexAnimationDeclaration",fd="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2;uniform bakedVertexAnimationSettings: vec4;var bakedVertexAnimationTexture : texture_2d;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d,index : f32,frame : f32)->mat4x4\n{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2(offset+0,frameUV),0);let m1=textureLoad(smp,vec2(offset+1,frameUV),0);let m2=textureLoad(smp,vec2(offset+2,frameUV),0);let m3=textureLoad(smp,vec2(offset+3,frameUV),0);return mat4x4(m0,m1,m2,m3);}\n#endif\n";K.IncludesShadersStoreWGSL[ud]=fd;const dd="bakedVertexAnimation",pd="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4;VATInfluence=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#endif\n";K.IncludesShadersStoreWGSL[dd]=pd;const _d="clipPlaneFragment",gd="#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{discard;}\n#endif\n#ifdef CLIPPLANE2\nelse if (fragmentInputs.fClipDistance2>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE3\nelse if (fragmentInputs.fClipDistance3>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE4\nelse if (fragmentInputs.fClipDistance4>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE5\nelse if (fragmentInputs.fClipDistance5>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE6\nelse if (fragmentInputs.fClipDistance6>0.0)\n{discard;}\n#endif\n";K.IncludesShadersStoreWGSL[_d]=gd;const md="clipPlaneFragmentDeclaration",vd="#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";K.IncludesShadersStoreWGSL[md]=vd;const xd="clipPlaneVertex",bd="#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";K.IncludesShadersStoreWGSL[xd]=bd;const yd="clipPlaneVertexDeclaration",Td="#ifdef CLIPPLANE\nuniform vClipPlane: vec4;varying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nuniform vClipPlane2: vec4;varying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nuniform vClipPlane3: vec4;varying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nuniform vClipPlane4: vec4;varying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nuniform vClipPlane5: vec4;varying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nuniform vClipPlane6: vec4;varying fClipDistance6: f32;\n#endif\n";K.IncludesShadersStoreWGSL[yd]=Td;const Sd="instancesDeclaration",Ed="#ifdef INSTANCES\nattribute world0 : vec4;attribute world1 : vec4;attribute world2 : vec4;attribute 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;attribute previousWorld1 : vec4;attribute previousWorld2 : vec4;attribute 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";K.IncludesShadersStoreWGSL[Sd]=Ed;const Id="instancesVertex",Ad="#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";K.IncludesShadersStoreWGSL[Id]=Ad;const Cd="helperFunctions",Md="const PI: f32=3.1415926535897932384626433832795;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const HALF_MIN: f32=5.96046448e-08; \nconst LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3=vec3 (0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\nfn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3=inMatrix[0];let i1: vec3=inMatrix[1];let i2: vec3=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nfn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,\nb11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,\nb21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}\n#if USE_EXACT_SRGB_CONVERSIONS\nfn toLinearSpaceExact(color: vec3)->vec3\n{let nearZeroSection: vec3=0.0773993808*color;let remainingSection: vec3=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));}\nfn toGammaSpaceExact(color: vec3)->vec3\n{let nearZeroSection: vec3=12.92*color;let remainingSection: vec3=1.055*pow(color,vec3(0.41666))-vec3(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));}\n#endif\nfn toLinearSpace(color: vec4)->vec4\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}\nfn toLinearSpaceVec3(color: vec3)->vec3\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nfn toGammaSpace(color: vec4)->vec4\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}\nfn toGammaSpaceVec3(color: vec3)->vec3\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nfn square(value: vec3)->vec3\n{return value*value;}\nfn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}\nfn getLuminance(color: vec3)->f32\n{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}\nfn getRand(seed: vec2)->f32 {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}\nfn dither(seed: vec2,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}\nconst rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3)->vec4 {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3 =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4(clamp(rgb,vec3(0.,0.,0.),vec3(1.,1.,1.)),D); }\nfn fromRGBD(rgbd: vec4)->vec3 {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}\nfn parallaxCorrectNormal(vertexPos: vec3,origVec: vec3,cubeSize: vec3,cubePos: vec3)->vec3 {let invOrigVec: vec3=vec3(1.0,1.0,1.0)/origVec;let halfSize: vec3=cubeSize*0.5;let intersecAtMaxPlane: vec3=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\n";K.IncludesShadersStoreWGSL[Cd]=Md;const Rd="fresnelFunction",Pd="#ifdef FRESNEL\nfn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32\n{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}\n#endif\n";K.IncludesShadersStoreWGSL[Rd]=Pd;const wd="meshUboDeclaration",Dd="struct Mesh {world : mat4x4,\nvisibility : f32,};var mesh : Mesh;\n#define WORLD_UBO\n";K.IncludesShadersStoreWGSL[wd]=Dd;const Fd="morphTargetsVertex",Od="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\n#if {X}==0\nfor (var i=0; i=uniforms.morphTargetCount) {break;}\nvertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;positionUpdated=positionUpdated+(readVector3FromRawSampler({X},vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0;\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated=normalUpdated+(readVector3FromRawSampler({X},vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated=uvUpdated+(readVector3FromRawSampler({X},vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];vertexID=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}\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";K.IncludesShadersStoreWGSL[Fd]=Od;const Ld="morphTargetsVertexDeclaration",Bd="#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#elif {X}==0\nuniform morphTargetCount: i32;\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[Ld]=Bd;const Nd="morphTargetsVertexGlobal",Ud="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\nvar vertexID : f32;\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[Nd]=Ud;const kd="morphTargetsVertexGlobalDeclaration",Vd="#ifdef MORPHTARGETS\nuniform morphTargetInfluences : array;\n#ifdef MORPHTARGETS_TEXTURE \nuniform morphTargetTextureIndices : array;uniform morphTargetTextureInfo : vec3;var morphTargets : texture_2d_array;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3\n{ \nlet y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;}\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[kd]=Vd;const Gd="sceneUboDeclaration",zd="struct Scene {viewProjection : mat4x4,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4,\n#endif \nview : mat4x4,\nprojection : mat4x4,\nvEyePosition : vec4,};var scene : Scene;\n";K.IncludesShadersStoreWGSL[Gd]=zd;const Wd="lightsFragmentFunctions",Xd="struct lightingInfo\n{diffuse: vec3f,\n#ifdef SPECULARTERM\nspecular: vec3f,\n#endif\n#ifdef NDOTL\nndl: f32,\n#endif\n};fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.)\n{var direction: vec3f=lightData.xyz-vPositionW;var attenuation: f32=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nvar ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var direction: vec3f=lightData.xyz-vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;var ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nresult.diffuse=vec3f(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3f(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nfn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=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\nvar angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\nfn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(vPositionW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;}";K.IncludesShadersStoreWGSL[Wd]=Xd;const Hd="lightFragment",Kd="#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n#else\n#ifdef PBR\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#endif\npreInfo.NdotV=NdotV;\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n#ifdef HEMILIGHT{X}\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#ifdef IRIDESCENCE\npreInfo.iridescenceIntensity=iridescenceIntensity;\n#endif\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#ifdef CLEARCOAT\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSMDEBUG{X} \nvar shadowDebug{X}: vec3f;\n#endif\n#ifdef SHADOWCSM{X}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nvar index{X}: i32=-1;\n#else\nvar index{X}: i32=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nvar diff{X}: f32=0.;vPositionFromLight{X}[0]=fragmentInputs.vPositionFromLight{X}_0;vPositionFromLight{X}[1]=fragmentInputs.vPositionFromLight{X}_1;vPositionFromLight{X}[2]=fragmentInputs.vPositionFromLight{X}_2;vPositionFromLight{X}[3]=fragmentInputs.vPositionFromLight{X}_3;vDepthMetric{X}[0]=fragmentInputs.vDepthMetric{X}_0;vDepthMetric{X}[1]=fragmentInputs.vDepthMetric{X}_1;vDepthMetric{X}[2]=fragmentInputs.vDepthMetric{X}_2;vDepthMetric{X}[3]=fragmentInputs.vDepthMetric{X}_3;for (var i:i32=0; i=0.) {index{X}=i;break;}}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3f(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nvar frustumLength:f32=uniforms.frustumLengths{X}[index{X}];var diffRatio:f32=clamp(diff{X}/frustumLength,0.,1.)*uniforms.cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{index{X}+=1;var nextShadow: f32=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;shadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\naggShadow+=shadow;numLights+=1.0;\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else \ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[Hd]=Kd;const Yd="lightUboDeclaration",qd="#ifdef LIGHT{X}\nstruct Light{X}\n{vLightData: vec4f,\nvLightDiffuse: vec4f,\nvLightSpecular: vec4f,\n#ifdef SPOTLIGHT{X}\nvLightDirection: vec4f,\nvLightFalloff: vec4f,\n#elif defined(POINTLIGHT{X})\nvLightFalloff: vec4f,\n#elif defined(HEMILIGHT{X})\nvLightGround: vec3f,\n#endif\nshadowsInfo: vec4f,\ndepthValues: vec2f} ;var light{X} : Light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform textureProjectionMatrix{X}: mat4x4f;var projectionLightTexture{X}sampler: sampler;var projectionLightTexture{X}: texture_2d;\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform lightMatrix{X}: array;uniform viewFrustumZ{X}: array;uniform frustumLengths{X}: array;uniform cascadeBlendFactor{X}: f32;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;var vPositionFromLight{X}: array;var vDepthMetric{X} : array;\n#if defined(SHADOWPCSS{X})\nvar shadowTexture{X}Sampler: sampler_comparison; \nvar shadowTexture{X}: texture_depth_2d_array;var depthTexture{X}Sampler: sampler;var depthTexture{X}: texture_2d_array;uniform lightSizeUVCorrection{X}: array;uniform depthCorrection{X}: array;uniform penumbraDarkness{X}: f32;\n#elif defined(SHADOWPCF{X})\nvar shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d_array;\n#else \nvar shadowTexture{X}Sampler: sampler; \nvar shadowTexture{X}: texture_2d_array;\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vCascadeColorsMultiplier{X}: array=array\n(\nvec3f ( 1.5,0.0,0.0 ),\nvec3f ( 0.0,1.5,0.0 ),\nvec3f ( 0.0,0.0,5.5 ),\nvec3f ( 1.5,0.0,5.5 ),\nvec3f ( 1.5,1.5,0.0 ),\nvec3f ( 1.0,1.0,1.0 ),\nvec3f ( 0.0,1.0,5.5 ),\nvec3f ( 0.5,3.5,0.75 )\n);\n#endif\n#elif defined(SHADOWCUBE{X})\nvar shadowTexture{X}Sampler: sampler;var shadowTexture{X}: texture_cube;\n#else\nvarying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;\n#if defined(SHADOWPCSS{X})\nvar shadowTexture{X}Sampler: sampler_comparison; \nvar shadowTexture{X}: texture_depth_2d;var depthTexture{X}Sampler: sampler; \nvar depthTexture{X}: texture_2d;\n#elif defined(SHADOWPCF{X})\nvar shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d;\n#else\nvar shadowTexture{X}Sampler: sampler; \nvar shadowTexture{X}: texture_2d;\n#endif\nuniform lightMatrix{X}: mat4x4f;\n#endif\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[Yd]=qd;const $d="lightVxUboDeclaration",jd="#ifdef LIGHT{X}\nstruct Light{X}\n{vLightData: vec4f,\nvLightDiffuse: vec4f,\nvLightSpecular: vec4f,\n#ifdef SPOTLIGHT{X}\nvLightDirection: vec4f,\nvLightFalloff: vec4f,\n#elif defined(POINTLIGHT{X})\nvLightFalloff: vec4f,\n#elif defined(HEMILIGHT{X})\nvLightGround: vec3f,\n#endif\nshadowsInfo: vec4f,\ndepthValues: vec2f} ;var light{X} : Light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform lightMatrix{X}: array;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;\n#endif\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[$d]=jd;const Zd="shadowsFragmentFunctions",Qd="#ifdef SHADOWS\n#ifndef SHADOWFLOAT\nfn unpack(color: vec4f)->f32\n{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}\n#endif\nfn computeFallOff(value: f32,clipSpace: vec2f,frustumEdgeFalloff: f32)->f32\n{var mask: f32=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}\nfn computeShadowCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,darkness: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadow: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nreturn select(darkness,1.0,depth>shadow);}\nfn computeShadowWithPoissonSamplingCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,mapSize: f32,darkness: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;var visibility: f32=1.;var poissonDisk: array;poissonDisk[0]= vec3f(-1.0,1.0,-1.0);poissonDisk[1]= vec3f(1.0,-1.0,-1.0);poissonDisk[2]= vec3f(-1.0,-1.0,-1.0);poissonDisk[3]= vec3f(1.0,-1.0,1.0);\n#ifndef SHADOWFLOAT\nif (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize)),shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nvar esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}\nfn computeShadowWithCloseESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nvar esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}\nfn computeShadowCSM(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d_array,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,uv,layer));\n#else\nvar shadow: f32=textureSample(shadowTexture,shadowSampler,uv,layer).x;\n#endif\nreturn select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}\nfn computeShadow(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadow: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nreturn select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}}\nfn computeShadowWithPoissonSampling(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,mapSize: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);var visibility: f32=1.;var poissonDisk: array;poissonDisk[0]= vec2f(-0.94201624,-0.39906216);poissonDisk[1]= vec2f(0.94558609,-0.76890725);poissonDisk[2]= vec2f(-0.094184101,-0.92938870);poissonDisk[3]= vec2f(0.34495938,0.29387760);\n#ifndef SHADOWFLOAT\nif (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.)),shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nvar esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithCloseESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nvar esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\nfn getZInClip(clipSpace: vec3f,uvDepth: vec3f)->f32\n{\n#ifdef IS_NDC_HALF_ZRANGE\nreturn clipSpace.z;\n#else\nreturn uvDepth.z;\n#endif\n}\nconst GREATEST_LESS_THAN_ONE: f32=0.99999994;\n#define DISABLE_UNIFORMITY_ANALYSIS\nfn computeShadowWithCSMPCF1(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var shadow: f32=textureSampleCompare(shadowTexture,shadowSampler,uvDepth.xy,layer,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithCSMPCF3(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithCSMPCF5(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),layer,uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),layer,uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),layer,uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),layer,uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithPCF1(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var shadow: f32=textureSampleCompareLevel(shadowTexture,shadowSampler,uvDepth.xy,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithPCF3(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithPCF5(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nconst PoissonSamplers32: array=array (\nvec3f(0.06407013,0.05409927,0.),\nvec3f(0.7366577,0.5789394,0.),\nvec3f(-0.6270542,-0.5320278,0.),\nvec3f(-0.4096107,0.8411095,0.),\nvec3f(0.6849564,-0.4990818,0.),\nvec3f(-0.874181,-0.04579735,0.),\nvec3f(0.9989998,0.0009880066,0.),\nvec3f(-0.004920578,-0.9151649,0.),\nvec3f(0.1805763,0.9747483,0.),\nvec3f(-0.2138451,0.2635818,0.),\nvec3f(0.109845,0.3884785,0.),\nvec3f(0.06876755,-0.3581074,0.),\nvec3f(0.374073,-0.7661266,0.),\nvec3f(0.3079132,-0.1216763,0.),\nvec3f(-0.3794335,-0.8271583,0.),\nvec3f(-0.203878,-0.07715034,0.),\nvec3f(0.5912697,0.1469799,0.),\nvec3f(-0.88069,0.3031784,0.),\nvec3f(0.5040108,0.8283722,0.),\nvec3f(-0.5844124,0.5494877,0.),\nvec3f(0.6017799,-0.1726654,0.),\nvec3f(-0.5554981,0.1559997,0.),\nvec3f(-0.3016369,-0.3900928,0.),\nvec3f(-0.5550632,-0.1723762,0.),\nvec3f(0.925029,0.2995041,0.),\nvec3f(-0.2473137,0.5538505,0.),\nvec3f(0.9183037,-0.2862392,0.),\nvec3f(0.2469421,0.6718712,0.),\nvec3f(0.3916397,-0.4328209,0.),\nvec3f(-0.03576927,-0.6220032,0.),\nvec3f(-0.04661255,0.7995201,0.),\nvec3f(0.4402924,0.3640312,0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.)\n);const PoissonSamplers64: array=array (\nvec3f(-0.613392,0.617481,0.),\nvec3f(0.170019,-0.040254,0.),\nvec3f(-0.299417,0.791925,0.),\nvec3f(0.645680,0.493210,0.),\nvec3f(-0.651784,0.717887,0.),\nvec3f(0.421003,0.027070,0.),\nvec3f(-0.817194,-0.271096,0.),\nvec3f(-0.705374,-0.668203,0.),\nvec3f(0.977050,-0.108615,0.),\nvec3f(0.063326,0.142369,0.),\nvec3f(0.203528,0.214331,0.),\nvec3f(-0.667531,0.326090,0.),\nvec3f(-0.098422,-0.295755,0.),\nvec3f(-0.885922,0.215369,0.),\nvec3f(0.566637,0.605213,0.),\nvec3f(0.039766,-0.396100,0.),\nvec3f(0.751946,0.453352,0.),\nvec3f(0.078707,-0.715323,0.),\nvec3f(-0.075838,-0.529344,0.),\nvec3f(0.724479,-0.580798,0.),\nvec3f(0.222999,-0.215125,0.),\nvec3f(-0.467574,-0.405438,0.),\nvec3f(-0.248268,-0.814753,0.),\nvec3f(0.354411,-0.887570,0.),\nvec3f(0.175817,0.382366,0.),\nvec3f(0.487472,-0.063082,0.),\nvec3f(-0.084078,0.898312,0.),\nvec3f(0.488876,-0.783441,0.),\nvec3f(0.470016,0.217933,0.),\nvec3f(-0.696890,-0.549791,0.),\nvec3f(-0.149693,0.605762,0.),\nvec3f(0.034211,0.979980,0.),\nvec3f(0.503098,-0.308878,0.),\nvec3f(-0.016205,-0.872921,0.),\nvec3f(0.385784,-0.393902,0.),\nvec3f(-0.146886,-0.859249,0.),\nvec3f(0.643361,0.164098,0.),\nvec3f(0.634388,-0.049471,0.),\nvec3f(-0.688894,0.007843,0.),\nvec3f(0.464034,-0.188818,0.),\nvec3f(-0.440840,0.137486,0.),\nvec3f(0.364483,0.511704,0.),\nvec3f(0.034028,0.325968,0.),\nvec3f(0.099094,-0.308023,0.),\nvec3f(0.693960,-0.366253,0.),\nvec3f(0.678884,-0.204688,0.),\nvec3f(0.001801,0.780328,0.),\nvec3f(0.145177,-0.898984,0.),\nvec3f(0.062655,-0.611866,0.),\nvec3f(0.315226,-0.604297,0.),\nvec3f(-0.780145,0.486251,0.),\nvec3f(-0.371868,0.882138,0.),\nvec3f(0.200476,0.494430,0.),\nvec3f(-0.494552,-0.711051,0.),\nvec3f(0.612476,0.705252,0.),\nvec3f(-0.578845,-0.768792,0.),\nvec3f(-0.772454,-0.090976,0.),\nvec3f(0.504440,0.372295,0.),\nvec3f(0.155736,0.065157,0.),\nvec3f(0.391522,0.849605,0.),\nvec3f(-0.620106,-0.328104,0.),\nvec3f(0.789239,-0.419965,0.),\nvec3f(-0.545396,0.538133,0.),\nvec3f(-0.178564,-0.596057,0.)\n);fn computeShadowWithCSMPCSS(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uvDepthLayer: vec4f= vec4f(uvDepth.x,uvDepth.y,f32(layer),uvDepth.z);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;var exitCondition: bool=depthMetric>1.0 || depthMetric<0.0;for (var i: i32=0; i,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}\nfn computeShadowWithPCSS32(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}\nfn computeShadowWithPCSS64(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}\nfn computeShadowWithCSMPCSS16(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\nfn computeShadowWithCSMPCSS32(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\nfn computeShadowWithCSMPCSS64(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\n#endif\n";K.IncludesShadersStoreWGSL[Zd]=Qd;const Jd="shadowsVertex",ep="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvertexOutputs.vPositionFromCamera{X}=view*worldPos;\n#if SHADOWCSMNUM_CASCADES{X}>0\nvertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>1\nvertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>2\nvertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>3\nvertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n";K.IncludesShadersStoreWGSL[Jd]=ep;const tp="fogFragmentDeclaration",ip="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32\n{var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x)\n{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}\nelse if (FOGMODE_EXP==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}\nelse if (FOGMODE_EXP2==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}\nreturn clamp(fogCoeff,0.0,1.0);}\n#endif\n";K.IncludesShadersStoreWGSL[tp]=ip;const sp="bumpFragment",np="var uvOffset: vec2f= vec2f(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nvar normalScale: f32=1.0;\n#elif defined(BUMP)\nvar normalScale: f32=vBumpInfos.y;\n#else\nvar normalScale: f32=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=vTBN;\n#elif defined(BUMP)\nvar TBNUV: vec2f=select(-vBumpUV,vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);\n#else\nvar TBNUV: vec2f=select(-vDetailUV,vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=vTBN;\n#else\nvar TBNUV: vec2f=select( -vMainUV1,vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nvar invTBN: mat3x3f=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvar detailColor: vec4f=textureSample(detail,detailSampler,vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\n#define CUSTOM_FRAGMENT_BUMP_FRAGMENT\nnormalW=normalize(textureSample(bump,bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize( mat3x3f(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);\n#else\nvar bumpNormal: vec3f=textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n#if DETAIL_NORMALBLENDMETHOD==0 \ndetailNormal.xy*=vDetailInfos.z;var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD==1 \ndetailNormal.xy*=vDetailInfos.z;bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif\n";K.IncludesShadersStoreWGSL[sp]=np;const rp="bumpFragmentMainFunctions",ap="#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL) \nvarying vTBN: mat3x3f;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform normalMatrix: mat4x4f;\n#if defined(WEBGL2) || defined(WEBGPU)\nfn toNormalMatrix(wMatrix: mat4x4f)->mat4x4f\n{var ret: mat4x4f=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]= vec4f(0.,0.,0.,1.);return ret;}\n#else\nfn toNormalMatrix(m: mat4x4f)->mat4x4f\n{var a00: f32=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],\na10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],\na20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],\na30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],\nb00=a00*a11-a01*a10,\nb01=a00*a12-a02*a10,\nb02=a00*a13-a03*a10,\nb03=a01*a12-a02*a11,\nb04=a01*a13-a03*a11,\nb05=a02*a13-a03*a12,\nb06=a20*a31-a21*a30,\nb07=a20*a32-a22*a30,\nb08=a20*a33-a23*a30,\nb09=a21*a32-a22*a31,\nb10=a21*a33-a23*a31,\nb11=a22*a33-a23*a32,\ndet=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;var mi: mat4x4f= mat4x4f(\na11*b11-a12*b10+a13*b09,\na02*b10-a01*b11-a03*b09,\na31*b05-a32*b04+a33*b03,\na22*b04-a21*b05-a23*b03,\na12*b08-a10*b11-a13*b07,\na00*b11-a02*b08+a03*b07,\na32*b02-a30*b05-a33*b01,\na20*b05-a22*b02+a23*b01,\na10*b10-a11*b08+a13*b06,\na01*b08-a00*b10-a03*b06,\na30*b04-a31*b02+a33*b00,\na21*b02-a20*b04-a23*b00,\na11*b07-a10*b09-a12*b06,\na00*b09-a01*b07+a02*b06,\na31*b01-a30*b03-a32*b00,\na20*b03-a21*b01+a22*b00)/det;return mat4x4f(mi[0][0],mi[1][0],mi[2][0],mi[3][0],\nmi[0][1],mi[1][1],mi[2][1],mi[3][1],\nmi[0][2],mi[1][2],mi[2][2],mi[3][2],\nmi[0][3],mi[1][3],mi[2][3],mi[3][3]);}\n#endif\n#endif\nfn perturbNormalBase(cotangentFrame: mat3x3f,normal: vec3f,scale: f32)->vec3f\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal* vec3f(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);}\nfn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f\n{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}\nfn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f\n{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);}\n#endif\n";K.IncludesShadersStoreWGSL[rp]=ap;const op="samplerFragmentDeclaration",lp="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying v_VARYINGNAME_UV: vec2f;\n#endif\nuniform _SAMPLERNAME_Sampler: sampler;uniform _SAMPLERNAME_: texture_2d;\n#endif\n";K.IncludesShadersStoreWGSL[op]=lp;const hp="bumpFragmentFunctions",cp="#if defined(BUMP)\n#include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)\n#endif\n#if defined(DETAIL)\n#include(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst minSamples: f32=4.;const maxSamples: f32=15.;const iMaxSamples: i32=15;fn parallaxOcclusion(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32)->vec2f {var parallaxLimit: f32=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;var vOffsetDir: vec2f=normalize(vViewDirCoT.xy);var vMaxOffset: vec2f=vOffsetDir*parallaxLimit;var numSamples: f32=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));var stepSize: f32=1.0/numSamples;var currRayHeight: f32=1.0;var vCurrOffset: vec2f= vec2f(0,0);var vLastOffset: vec2f= vec2f(0,0);var lastSampledHeight: f32=1.0;var currSampledHeight: f32=1.0;var keepWorking: bool=true;for (var i: i32=0; icurrRayHeight)\n{var delta1: f32=currSampledHeight-currRayHeight;var delta2: f32=(currRayHeight+stepSize)-lastSampledHeight;var ratio: f32=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}\nelse\n{currRayHeight-=stepSize;vLastOffset=vCurrOffset;\n#ifdef PARALLAX_RHS\nvCurrOffset-=stepSize*vMaxOffset;\n#else\nvCurrOffset+=stepSize*vMaxOffset;\n#endif\nlastSampledHeight=currSampledHeight;}}\nreturn vCurrOffset;}\nfn parallaxOffset(viewDir: vec3f,heightScale: f32)->vec2f\n{var height: f32=textureSample(bump,bumpSampler,vBumpUV).w;var texCoordOffset: vec2f=heightScale*viewDir.xy*height;\n#ifdef PARALLAX_RHS\nreturn texCoordOffset;\n#else\nreturn -texCoordOffset;\n#endif\n}\n#endif\n";K.IncludesShadersStoreWGSL[hp]=cp;const up="imageProcessingDeclaration",fp="#ifdef EXPOSURE\nuniform exposureLinear: f32;\n#endif\n#ifdef CONTRAST\nuniform contrast: f32;\n#endif\n#if defined(VIGNETTE) || defined(DITHER)\nuniform vInverseScreenSize: vec2f;\n#endif\n#ifdef VIGNETTE\nuniform vignetteSettings1: vec4f;uniform vignetteSettings2: vec4f;\n#endif\n#ifdef COLORCURVES\nuniform vCameraColorCurveNegative: vec4f;uniform vCameraColorCurveNeutral: vec4f;uniform vCameraColorCurvePositive: vec4f;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform colorTransformSettings: vec4f;\n#endif\n#ifdef DITHER\nuniform ditherIntensity: f32;\n#endif\n";K.IncludesShadersStoreWGSL[up]=fp;const dp="imageProcessingFunctions",pp="#if TONEMAPPING==3\nconst PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peakvec3f\n{var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;}\nfn ACESFitted(color: vec3f)->vec3f\n{var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturate(output);return output;}\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS\nfn applyImageProcessing(result: vec4f)->vec4f {\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART\nvar rgb=result.rgb;;\n#ifdef EXPOSURE\nrgb*=uniforms.exposureLinear;\n#endif\n#ifdef VIGNETTE\nvar viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvar vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nrgb=mix(vignetteColor,rgb,vignette);\n#endif\n#endif\n#if TONEMAPPING==3\nrgb=PBRNeutralToneMapping(rgb);\n#elif TONEMAPPING==2\nrgb=ACESFitted(rgb);\n#elif TONEMAPPING==1\nconst tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb);\n#endif\nrgb=toGammaSpaceVec3(rgb);rgb=saturate(rgb);\n#ifdef CONTRAST\nvar resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);}\n#endif\n#ifdef COLORGRADING\nvar colorTransformInput: vec3f=rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvar colorTransformOutput: vec3f=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvar colorTransformOutput: vec3f=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nrgb=mix(rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\nvar luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a);\n#endif\n#ifdef DITHER\nvar rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturate(rgb+ vec3f(dither));\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND\nreturn vec4f(rgb,result.a);}";K.IncludesShadersStoreWGSL[dp]=pp;const _p="reflectionFunction",gp="fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f\n{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); }\nfn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f\n{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); }\nfn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);}\nfn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);}\nfn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}\nfn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nfn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f\n{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz;\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nfn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f\n{return (reflectionMatrix*(view*worldPos)).xyz;}\nfn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{return (reflectionMatrix* vec4f(positionW,1.)).xyz;}\n#ifdef REFLECTION\nfn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvar direction: vec3f=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvar direction: vec3f=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3f(0,0,0);\n#endif\n}\n#endif\n";K.IncludesShadersStoreWGSL[_p]=gp;const mp="fogVertexDeclaration",vp="#ifdef FOG\nvarying vFogDistance: vec3f;\n#endif\n";K.IncludesShadersStoreWGSL[mp]=vp;const xp="logDepthDeclaration",bp="#ifdef LOGARITHMICDEPTH\nuniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;\n#endif\n";K.IncludesShadersStoreWGSL[xp]=bp;const yp="fogVertex",Tp="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif\n";K.IncludesShadersStoreWGSL[yp]=Tp;const Sp="logDepthVertex",Ep="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif\n";K.IncludesShadersStoreWGSL[Sp]=Ep;const Ip="particlesVertexShader",Ap="attribute position: vec3f;attribute color: vec4f;attribute angle: f32;attribute size: vec2f;\n#ifdef ANIMATESHEET\nattribute cellIndex: f32;\n#endif\n#ifndef BILLBOARD\nattribute direction: vec3f;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute direction: vec3f;\n#endif\n#ifdef RAMPGRADIENT\nattribute remapData: vec4f;\n#endif\nattribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform translationPivot: vec2f;\n#ifdef ANIMATESHEET\nuniform particlesInfos: vec3f; \n#endif\nvarying vUV: vec2f;varying vColor: vec4f;varying vPositionW: vec3f;\n#ifdef RAMPGRADIENT\nvarying remapRanges: vec4f;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform invView: mat4x4f;\n#endif\n#include\n#include\n#include\n#ifdef BILLBOARD\nuniform eyePosition: vec3f;\n#endif\nfn rotate(yaxis: vec3f,rotatedCorner: vec3f)->vec3f {var xaxis: vec3f=normalize(cross( vec3f(0.,1.0,0.),yaxis));var zaxis: vec3f=normalize(cross(yaxis,xaxis));var row0: vec3f= vec3f(xaxis.x,xaxis.y,xaxis.z);var row1: vec3f= vec3f(yaxis.x,yaxis.y,yaxis.z);var row2: vec3f= vec3f(zaxis.x,zaxis.y,zaxis.z);var rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return vertexInputs.position+alignedCorner;}\n#ifdef BILLBOARDSTRETCHED\nfn rotateAlign(toCamera: vec3f,rotatedCorner: vec3f)->vec3f {var normalizedToCamera: vec3f=normalize(toCamera);var normalizedCrossDirToCamera: vec3f=normalize(cross(normalize(direction),normalizedToCamera));var row0: vec3f= vec3f(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);var row2: vec3f= vec3f(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\n#ifdef BILLBOARDSTRETCHED_LOCAL\nvar row1: vec3f=direction;\n#else\nvar crossProduct: vec3f=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));var row1: vec3f= vec3f(crossProduct.x,crossProduct.y,crossProduct.z);\n#endif\nvar rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return vertexInputs.position+alignedCorner;}\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar cornerPos: vec2f;cornerPos=( vec2f(vertexInputs.offset.x-0.5,vertexInputs.offset.y -0.5)-uniforms.translationPivot)*vertexInputs.size;\n#ifdef BILLBOARD\nvar rotatedCorner: vec3f;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(vertexInputs.angle)-cornerPos.y*sin(vertexInputs.ngle);rotatedCorner.z=cornerPos.x*sin(vertexInputs.angle)+cornerPos.y*cos(vertexInputs.angle);rotatedCorner.y=0.;rotatedCorner.xz+=uniforms.translationPivot;var yaxis: vec3f=vertexInputs.position-eyePosition;yaxis.y=0.;vertexOutputs.vPositionW=rotate(normalize(yaxis),rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(vertexInputs.angle)-cornerPos.y*sin(vertexInputs.angle);rotatedCorner.y=cornerPos.x*sin(vertexInputs.angle)+cornerPos.y*cos(vertexInputs.angle);rotatedCorner.z=0.;rotatedCorner.x+=uniforms.translationPivot.x;rotatedCorner.y+=uniforms.translationPivot.y;var toCamera: vec3f=vertexInputs.position-eyePosition;vertexOutputs.vPositionW=rotateAlign(toCamera,rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(vertexInputs.angle)-cornerPos.y*sin(vertexInputs.angle);rotatedCorner.y=cornerPos.x*sin(vertexInputs.angle)+cornerPos.y*cos(vertexInputs.angle);rotatedCorner.z=0.;rotatedCorner.x+=uniforms.translationPivot.x;rotatedCorner.y+=uniforms.translationPivot.y;var viewPos: vec3f=(uniforms.view* vec4f(vertexInputs.position,1.0)).xyz+rotatedCorner;vertexOutputs.vPositionW=(uniforms.invView* vec4f(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\nvertexOutputs.position=uniforms.projection* vec4f(viewPos,1.0);\n#else\nvar rotatedCorner: vec3f;rotatedCorner.x=cornerPos.x*cos(vertexInputs.angle)-cornerPos.y*sin(vertexInputs.angle);rotatedCorner.z=cornerPos.x*sin(vertexInputs.angle)+cornerPos.y*cos(vertexInputs.angle);rotatedCorner.y=0.;rotatedCorner.x+=uniforms.translationPivot.x;rotatedCorner.y+=uniforms.translationPivot.y;var yaxis: vec3f=normalize(direction);vertexOutputs.vPositionW=rotate(yaxis,rotatedCorner);vertexOutputs.position=uniforms.projection*view* vec4f(vertexOutputs.vPositionW,1.0);\n#endif\nvertexOutputs.vColor=vertexInputs.color;\n#ifdef ANIMATESHEET\nvar rowOffset: f32=floor(cellIndex*particlesInfos.z);var columnOffset: f32=cellIndex-rowOffset/particlesInfos.z;var uvScale: vec2f=particlesInfos.xy;var uvOffset: vec2f= vec2f(vertexInputs.offset.x ,1.0-vertexInputs.offset.y);vertexOutputs.vUV=(uvOffset+ vec2f(columnOffset,rowOffset))*uvScale;\n#else\nvertexOutputs.vUV=vertexInputs.offset;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)\nvar worldPos: vec4f= vec4f(vertexOutputs.vPositionW,1.0);\n#endif\n#include\n#include\n#include\n#define CUSTOM_VERTEX_MAIN_END\n}";K.ShadersStoreWGSL[Ip]=Ap;const q0="fragmentOutputs.fragDepth",Cp="uniforms",Mp="internals",Rp={texture_1d:"1d",texture_2d:"2d",texture_2d_array:"2d-array",texture_3d:"3d",texture_cube:"cube",texture_cube_array:"cube-array",texture_multisampled_2d:"2d",texture_depth_2d:"2d",texture_depth_2d_array:"2d-array",texture_depth_cube:"cube",texture_depth_cube_array:"cube-array",texture_depth_multisampled_2d:"2d",texture_storage_1d:"1d",texture_storage_2d:"2d",texture_storage_2d_array:"2d-array",texture_storage_3d:"3d",texture_external:null};class Pp extends bt{constructor(){super(...arguments),this.shaderLanguage=1,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}preProcessor(e,t,i,s,n){for(const r in i){if(r==="__VERSION__")continue;const o=i[r];(!isNaN(parseInt(o))||!isNaN(parseFloat(o)))&&(e="const ".concat(r," = ").concat(o,";\n")+e)}return e}_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._attributesInputWGSL=[],this._attributesWGSL=[],this._attributesConversionCodeWGSL=[],this._hasNonFloatAttribute=!1,this._varyingsWGSL=[],this._varyingNamesWGSL=[],this._stridedUniformArrays=[]}preProcessShaderCode(e){const t="struct ".concat(bt.InternalsUBOName," {\n yFactor_: f32,\n textureOutputHeight_: f32,\n};\nvar ").concat(Mp," : ").concat(bt.InternalsUBOName,";\n");return e.indexOf(t)!==-1?e:t+ga(e)}varyingCheck(e,t){return/(flat|linear|perspective)?\s*(center|centroid|sample)?\s*\bvarying\b/.test(e)}varyingProcessor(e,t,i){var r,o;const n=/\s*(flat|linear|perspective)?\s*(center|centroid|sample)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(n!==null){const l=(r=n[1])!=null?r:"perspective",h=(o=n[2])!=null?o:"center",c=n[4],u=n[3],f=l==="flat"?"@interpolate(".concat(l,")"):"@interpolate(".concat(l,", ").concat(h,")");let d;t?(d=this._webgpuProcessingContext.availableVaryings[u],d===void 0&&U.Warn('Invalid fragment shader: The varying named "'.concat(u,'" is not declared in the vertex shader! This declaration will be ignored.'))):(d=this._webgpuProcessingContext.getVaryingNextLocation(c,this._getArraySize(u,c,i)[2]),this._webgpuProcessingContext.availableVaryings[u]=d,this._varyingsWGSL.push(" @location(".concat(d,") ").concat(f," ").concat(u," : ").concat(c,",")),this._varyingNamesWGSL.push(u)),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;const l=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[r];if(l!==void 0){const h=l<0?l===-1?"i32":"vec"+-l+"":l===1?"u32":"vec"+l+"",c="_int_".concat(r,"_");this._attributesInputWGSL.push("@location(".concat(o,") ").concat(c," : ").concat(h,",")),this._attributesWGSL.push("".concat(r," : ").concat(n,",")),this._attributesConversionCodeWGSL.push("vertexInputs.".concat(r," = ").concat(n,"(vertexInputs_.").concat(c,");")),this._hasNonFloatAttribute=!0}else this._attributesInputWGSL.push("@location(".concat(o,") ").concat(r," : ").concat(n,",")),this._attributesWGSL.push("".concat(r," : ").concat(n,",")),this._attributesConversionCodeWGSL.push("vertexInputs.".concat(r," = vertexInputs_.").concat(r,";"));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 f=o?this._getArraySize(n,r,i)[2]:0,d=this._webgpuProcessingContext.availableTextures[n];if(d)f=d.textures.length;else{d={isTextureArray:f>0,isStorageTexture:h,textures:[],sampleType:"float"},f=f||1;for(let m=0;m0,g=Rp[l],_=p?"depth":c==="u32"?"uint":c==="i32"?"sint":"float";if(d.sampleType=_,g===void 0)throw"Can't get the texture dimension corresponding to the texture function \"".concat(l,'"!');for(let m=0;m=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 (\w+)\s+(\d+\.?\d*)/g,"const $1 = $2;"),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._attributesInputWGSL.length>0&&(n+=this._attributesInputWGSL.join("\n")),n+="\n};\nvar vertexInputs"+(this._hasNonFloatAttribute?"_":"")+" : VertexInputs;\n",this._hasNonFloatAttribute&&(n+="struct VertexInputs_ {\n vertexIndex : u32, instanceIndex : u32,\n",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;let o="\n vertexInputs".concat(this._hasNonFloatAttribute?"_":""," = input;\n");this._hasNonFloatAttribute&&(o+="vertexInputs.vertexIndex = vertexInputs_.vertexIndex;\nvertexInputs.instanceIndex = vertexInputs_.instanceIndex;\n",o+=this._attributesConversionCodeWGSL.join("\n"),o+="\n");const l=" vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\n return vertexOutputs;";let h=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1;e=(h?"diagnostic(off, derivative_uniformity);\n":"")+ma(e,"fn main",o,l),t=t.replace(/#define (\w+)\s+(\d+\.?\d*)/g,"const $1 = $2;"),t=t.replace(/#define /g,"//#define "),t=this._processStridedUniformArrays(t),t=t.replace(/dpdy/g,"(-internals.yFactor_)*dpdy");let c="struct FragmentInputs {\n @builtin(position) position : vec4,\n @builtin(front_facing) frontFacing : bool,\n";this._varyingsWGSL.length>0&&(c+=this._varyingsWGSL.join("\n")),c+="\n};\nvar fragmentInputs : FragmentInputs;\n";let u="struct FragmentOutputs {\n @location(0) color : vec4,\n",f=!1,d=0;for(;!f&&(d=t.indexOf(q0,d),!(d<0));){const _=d;for(f=!0;d>1&&t.charAt(d)!=="\n";){if(t.charAt(d)==="/"&&t.charAt(d-1)==="/"){f=!1;break}d--}d=_+q0.length}f&&(u+=" @builtin(frag_depth) fragDepth: f32,\n"),u+="};\nvar fragmentOutputs : FragmentOutputs;\n",t=c+u+t;const p=" fragmentInputs = input;\n "+i,g=" return fragmentOutputs;";return h=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1,t=(h?"diagnostic(off, derivative_uniformity);\n":"")+ma(t,"fn main",p,g),this._collectBindingNames(),this._preCreateBindGroupEntries(),this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{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=bt.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(Cp," : ").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.length-7,l=n.lastIndexOf("Sampler")===o?n.substring(0,o):null,h=r==="sampler_comparison"?"comparison":"filtering";if(l){const p=this._webgpuProcessingContext.availableTextures[l];p&&(p.autoBindSampler=!0)}let c=this._webgpuProcessingContext.availableSamplers[n];c||(c={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:h},this._webgpuProcessingContext.availableSamplers[n]=c),this._addSamplerBindingDescription(n,c,t);const u=e.substring(0,s.index),f="@group(".concat(c.binding.groupIndex,") @binding(").concat(c.binding.bindingIndex,") "),d=e.substring(s.index);e=u+f+d,i.lastIndex+=f.length}return e}_processCustomBuffers(e,t){var s;const i=/var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;for(;;){const n=i.exec(e);if(n===null)break;const r=n[1],o=n[3];let l=n[4];const h=n[5];let c=this._webgpuProcessingContext.availableBuffers[l];if(!c){const _=r==="uniform"?ii.KnownUBOs[h]:null;let m;_?(l=h,m=_.binding,m.groupIndex===-1&&(m=(s=this._webgpuProcessingContext.availableBuffers[l])==null?void 0:s.binding,m||(m=this._webgpuProcessingContext.getNextFreeUBOBinding()))):m=this._webgpuProcessingContext.getNextFreeUBOBinding(),c={binding:m},this._webgpuProcessingContext.availableBuffers[l]=c}this._addBufferBindingDescription(l,this._webgpuProcessingContext.availableBuffers[l],o==="read_write"?"storage":r==="storage"?"read-only-storage":"uniform",t);const u=c.binding.groupIndex,f=c.binding.bindingIndex,d=e.substring(0,n.index),p="@group(".concat(u,") @binding(").concat(f,") "),g=e.substring(n.index);e=d+p+g,i.lastIndex+=p.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 Ve{static ComputeNumMipmapLevels(e,t){return Ye.ILog2(Math.max(e,t))+1}static GetTextureTypeFromFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb10a2uint":case"rgb10a2unorm":case"rgb9e5ufloat":case"rg11b10ufloat":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc5-rg-unorm":case"bc5-rg-snorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":case"stencil8":return 0;case"r16uint":case"r16sint":case"rg16uint":case"rg16sint":case"rgba16uint":case"rgba16sint":case"depth16unorm":return 5;case"r16float":case"rg16float":case"rgba16float":return 2;case"r32uint":case"r32sint":case"rg32uint":case"rg32sint":case"rgba32uint":case"rgba32sint":return 7;case"r32float":case"rg32float":case"rgba32float":case"depth32float":case"depth32float-stencil8":case"depth24plus":case"depth24plus-stencil8":return 1}return 0}static GetBlockInformationFromFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2uint":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw"No fixed size for Stencil8 format!";case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw"No fixed size for Depth24Plus format!";case"depth24plus-stencil8":throw"No fixed size for Depth24PlusStencil8 format!";case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc5-rg-unorm":case"bc5-rg-snorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":return{width:4,height:4,length:8};case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-rg11unorm":case"eac-rg11snorm":return{width:4,height:4,length:16};case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":return{width:4,height:4,length:16};case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":return{width:5,height:4,length:16};case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":return{width:5,height:5,length:16};case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":return{width:6,height:5,length:16};case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":return{width:6,height:6,length:16};case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":return{width:8,height:5,length:16};case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":return{width:8,height:6,length:16};case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":return{width:8,height:8,length:16};case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":return{width:10,height:5,length:16};case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":return{width:10,height:6,length:16};case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":return{width:10,height:8,length:16};case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":return{width:10,height:10,length:16};case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":return{width:12,height:10,length:16};case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":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}static IsCompressedFormat(e){switch(e){case"bc7-rgba-unorm-srgb":case"bc7-rgba-unorm":case"bc6h-rgb-float":case"bc6h-rgb-ufloat":case"bc5-rg-snorm":case"bc5-rg-unorm":case"bc4-r-snorm":case"bc4-r-unorm":case"bc3-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc1-rgba-unorm-srgb":case"bc1-rgba-unorm":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return!0}return!1}static GetWebGPUTextureFormat(e,t,i=!1){switch(t){case 15:return"depth16unorm";case 16:return"depth24plus";case 13:return"depth24plus-stencil8";case 14:return"depth32float";case 18:return"depth32float-stencil8";case 19:return"stencil8";case 36492:return i?"bc7-rgba-unorm-srgb":"bc7-rgba-unorm";case 36495:return"bc6h-rgb-ufloat";case 36494:return"bc6h-rgb-float";case 33779:return i?"bc3-rgba-unorm-srgb":"bc3-rgba-unorm";case 33778:return i?"bc2-rgba-unorm-srgb":"bc2-rgba-unorm";case 33777:case 33776:return i?"bc1-rgba-unorm-srgb":"bc1-rgba-unorm";case 37808:return i?"astc-4x4-unorm-srgb":"astc-4x4-unorm";case 36196:case 37492:return i?"etc2-rgb8unorm-srgb":"etc2-rgb8unorm";case 37496:return i?"etc2-rgba8unorm-srgb":"etc2-rgba8unorm"}switch(e){case 3:switch(t){case 6:return"r8snorm";case 7:return"rg8snorm";case 4:throw"RGB format not supported in WebGPU";case 8:return"r8sint";case 9:return"rg8sint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8sint";default:return"rgba8snorm"}case 0:switch(t){case 6:return"r8unorm";case 7:return"rg8unorm";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return i?"rgba8unorm-srgb":"rgba8unorm";case 12:return i?"bgra8unorm-srgb":"bgra8unorm";case 8:return"r8uint";case 9:return"rg8uint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"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"rgba8unorm"}case 4:switch(t){case 8:return"r16sint";case 9:return"rg16sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16sint";default:return"rgba16sint"}case 5:switch(t){case 8:return"r16uint";case 9:return"rg16uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16uint";default:return"rgba16uint"}case 6:switch(t){case 8:return"r32sint";case 9:return"rg32sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32sint";default:return"rgba32sint"}case 7:switch(t){case 8:return"r32uint";case 9:return"rg32uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32uint";default:return"rgba32uint"}case 1:switch(t){case 6:return"r32float";case 7:return"rg32float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba32float";default:return"rgba32float"}case 2:switch(t){case 6:return"r16float";case 7:return"rg16float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba16float";default:return"rgba16float"}case 10:throw"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:switch(t){case 5:return"rg11b10ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";default:return"rg11b10ufloat"}case 14:switch(t){case 5:return"rgb9e5ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";default:return"rgb9e5ufloat"}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"rgb10a2unorm";case 11:return"rgb10a2uint";default:return"rgb10a2unorm"}}return i?"rgba8unorm-srgb":"rgba8unorm"}static GetNumChannelsFromWebGPUTextureFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":case"bc4-r-unorm":case"bc4-r-snorm":case"r16uint":case"r16sint":case"depth16unorm":case"r16float":case"r32uint":case"r32sint":case"r32float":case"depth32float":case"stencil8":case"depth24plus":case"eac-r11unorm":case"eac-r11snorm":return 1;case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth32float-stencil8":case"bc5-rg-unorm":case"bc5-rg-snorm":case"rg16uint":case"rg16sint":case"rg16float":case"rg32uint":case"rg32sint":case"rg32float":case"depth24plus-stencil8":case"eac-rg11unorm":case"eac-rg11snorm":return 2;case"rgb9e5ufloat":case"rg11b10ufloat":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":return 3;case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb10a2uint":case"rgb10a2unorm":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba32uint":case"rgba32sint":case"rgba32float":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return 4}throw"Unknown format ".concat(e,"!")}static HasStencilAspect(e){switch(e){case"stencil8":case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static HasDepthAndStencilAspects(e){switch(e){case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static GetDepthFormatOnly(e){switch(e){case"depth16unorm":return"depth16unorm";case"depth24plus":return"depth24plus";case"depth24plus-stencil8":return"depth24plus";case"depth32float":return"depth32float";case"depth32float-stencil8":return"depth32float"}return e}static GetSample(e){return e>1?4:1}}class ir{get underlyingResource(){return this._webgpuTexture}getMSAATexture(e=0){var t,i;return(i=(t=this._webgpuMSAATexture)==null?void 0:t[e])!=null?i:null}setMSAATexture(e,t=-1){this._webgpuMSAATexture||(this._webgpuMSAATexture=[]),t===-1&&(t=this._webgpuMSAATexture.length),this._webgpuMSAATexture[t]=e}releaseMSAATexture(){if(this._webgpuMSAATexture){for(const e of this._webgpuMSAATexture)e==null||e.destroy();this._webgpuMSAATexture=null}}constructor(e=null){this._originalFormatIsRGB=!1,this.format="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,r,o,l){let h="2d",c=1;s?(h=i?"cube-array":"cube",c=6*(l||1)):n?(h="3d",c=1):i&&(h="2d-array",c=l);const u=Ve.GetDepthFormatOnly(this.format),f=Ve.HasDepthAndStencilAspects(this.format)?"depth-only":"all";this.createView({label:"TextureView".concat(n?"3D":s?"Cube":"2D").concat(i?"_Array"+c:"","_").concat(r,"x").concat(o,"_").concat(t?"wmips":"womips","_").concat(this.format,"_").concat(h),format:u,dimension:h,mipLevelCount:t?Ye.ILog2(Math.max(r,o))+1:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:c,aspect:f})}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;(e=this._webgpuTexture)==null||e.destroy(),this.releaseMSAATexture(),(t=this._copyInvertYTempTexture)==null||t.destroy(),this.reset()}}const wp="\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 ",Dp="\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 ",Fh="\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 ",Fp="\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 ",Op=Fh,Lp="\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 ",Bp="\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 ",Np="\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 ",Up="\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 ",kp="\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 ",Vp="\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 gi;(function(a){a[a.MipMap=0]="MipMap",a[a.InvertYPremultiplyAlpha=1]="InvertYPremultiplyAlpha",a[a.Clear=2]="Clear",a[a.InvertYPremultiplyAlphaWithOfst=3]="InvertYPremultiplyAlphaWithOfst"})(gi||(gi={}));var Ks;(function(a){a[a.DontInvertY=0]="DontInvertY",a[a.InvertY=1]="InvertY"})(Ks||(Ks={}));const $0=[{vertex:wp,fragment:Dp},{vertex:Fh,fragment:Fp},{vertex:Bp,fragment:Np},{vertex:Op,fragment:Lp}],Gi={"":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,rgb10a2uint:22,rgb10a2unorm:23,rg32uint:24,rg32sint:25,rg32float:26,rgba16uint:27,rgba16sint:28,rgba16float:29,rgba32uint:30,rgba32sint:31,rgba32float:32,stencil8:33,depth16unorm:34,depth24plus:35,"depth24plus-stencil8":36,depth32float:37,"depth32float-stencil8":38};class Gp{constructor(e,t,i,s,n,r){if(this._pipelines={},this._compiledShaders=[],this._videoPipelines={},this._videoCompiledShaders=[],this._deferredReleaseTextures=[],this._engine=e,this._device=t,this._glslang=i,this._tintWASM=s,this._bufferManager=n,r.indexOf("rg11b10ufloat-renderable")!==-1){const o=Object.keys(Gi);Gi.rg11b10ufloat=Gi[o[o.length-1]]+1}this._mipmapSampler=t.createSampler({minFilter:"linear"}),this._videoSampler=t.createSampler({minFilter:"linear"}),this._ubCopyWithOfst=this._bufferManager.createBuffer(4*4,We.Uniform|We.CopyDst,"UBCopyWithOffset").underlyingResource,this._getPipeline("rgba8unorm"),this._getVideoPipeline("rgba8unorm")}_getPipeline(e,t=gi.MipMap,i){const s=t===gi.MipMap?1:t===gi.InvertYPremultiplyAlpha?((i.invertY?1:0)<<1)+((i.premultiplyAlpha?1:0)<<2):t===gi.Clear?8:t===gi.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\n";(t===gi.InvertYPremultiplyAlpha||t===gi.InvertYPremultiplyAlphaWithOfst)&&(i.invertY&&(r+="#define INVERTY\n"),i.premultiplyAlpha&&(r+="#define PREMULTIPLYALPHA\n"));let o=this._compiledShaders[s];if(!o){let h=this._glslang.compileGLSL(r+$0[t].vertex,"vertex"),c=this._glslang.compileGLSL(r+$0[t].fragment,"fragment");this._tintWASM&&(h=this._tintWASM.convertSpirV2WGSL(h),c=this._tintWASM.convertSpirV2WGSL(c));const u=this._device.createShaderModule({code:h}),f=this._device.createShaderModule({code:c});o=this._compiledShaders[s]=[u,f]}const l=this._device.createRenderPipeline({layout:"auto",vertex:{module:o[0],entryPoint:"main"},fragment:{module:o[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});n=this._pipelines[e][s]=[l,l.getBindGroupLayout(0)]}return n}_getVideoPipeline(e,t=Ks.DontInvertY){const i=t===Ks.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:Up}),l=this._device.createShaderModule({code:i===0?kp:Vp});n=this._videoCompiledShaders[i]=[o,l]}const r=this._device.createRenderPipeline({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_CopyVideoToTexture_").concat(e,"_").concat(i===0?"DontInvertY":"InvertY"),layout:"auto",vertex:{module:n[0],entryPoint:"main"},fragment:{module:n[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});s=this._videoPipelines[e][i]=[r,r.getBindGroupLayout(0)]}return s}setCommandEncoder(e){this._commandEncoderForCreation=e}copyVideoToTexture(e,t,i,s=!1,n){var p,g;const r=n===void 0,[o,l]=this._getVideoPipeline(i,s?Ks.InvertY:Ks.DontInvertY);r&&(n=this._device.createCommandEncoder({})),(p=n.pushDebugGroup)==null||p.call(n,"copy video to texture - invertY=".concat(s));const h=t._hardwareTexture,c={label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_copyVideoToTexture_").concat(i,"_").concat(s?"InvertY":"DontInvertY").concat(t.label?"_"+t.label:""),colorAttachments:[{view:h.underlyingResource.createView({format:i,dimension:"2d",mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:"all"}),loadOp:"load",storeOp:"store"}]},u=n.beginRenderPass(c),f={layout:l,entries:[{binding:0,resource:this._videoSampler},{binding:1,resource:this._device.importExternalTexture({source:e.underlyingResource})}]},d=this._device.createBindGroup(f);u.setPipeline(o),u.setBindGroup(0,d),u.draw(4,1,0,0),u.end(),(g=n.popDebugGroup)==null||g.call(n),r&&(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,f=0,d=0,p,g){var C,w,P,z;const _=f!==0,m=p===void 0,[x,I]=this._getPipeline(s,_?gi.InvertYPremultiplyAlphaWithOfst:gi.InvertYPremultiplyAlpha,{invertY:n,premultiplyAlpha:r});o=Math.max(o,0),m&&(p=this._device.createCommandEncoder({})),(C=p.pushDebugGroup)==null||C.call(p,"internal process texture - invertY=".concat(n," premultiplyAlpha=").concat(r));let T;if(Ve.IsHardwareTexture(e)?(T=e.underlyingResource,n&&!r&&h===1&&o===0||(e=void 0)):(T=e,e=void 0),!T)return;_&&this._bufferManager.setRawData(this._ubCopyWithOfst,0,new Float32Array([c,u,f,d]),0,4*4);const y=e,b=(w=y==null?void 0:y._copyInvertYTempTexture)!=null?w:this.createTexture({width:t,height:i,layers:1},!1,!1,!1,!1,!1,s,1,p,21,void 0,"TempTextureForCopyWithInvertY"),S=(P=y==null?void 0:y._copyInvertYRenderPassDescr)!=null?P:{label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_invertYPreMultiplyAlpha_").concat(s,"_").concat(n?"InvertY":"DontInvertY","_").concat(r?"PremultiplyAlpha":"DontPremultiplyAlpha"),colorAttachments:[{view:b.createView({format:s,dimension:"2d",baseMipLevel:0,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:0}),loadOp:"load",storeOp:"store"}]},A=p.beginRenderPass(S);let M=_?y==null?void 0:y._copyInvertYBindGroupWithOfst:y==null?void 0:y._copyInvertYBindGroup;if(!M){const L={layout:I,entries:[{binding:0,resource:T.createView({format:s,dimension:"2d",baseMipLevel:l,mipLevelCount:1,arrayLayerCount:h,baseArrayLayer:o})}]};_&&L.entries.push({binding:1,resource:{buffer:this._ubCopyWithOfst}}),M=this._device.createBindGroup(L)}A.setPipeline(x),A.setBindGroup(0,M),A.draw(4,1,0,0),A.end(),p.copyTextureToTexture({texture:b},{texture:T,mipLevel:l,origin:{x:0,y:0,z:o}},{width:t,height:i,depthOrArrayLayers:1}),y?(y._copyInvertYTempTexture=b,y._copyInvertYRenderPassDescr=S,_?y._copyInvertYBindGroupWithOfst=M:y._copyInvertYBindGroup=M):this._deferredReleaseTextures.push([b,null]),(z=p.popDebugGroup)==null||z.call(p),m&&(this._device.queue.submit([p.finish()]),p=null)}copyWithInvertY(e,t,i,s){var c,u;const n=s===void 0,[r,o]=this._getPipeline(t,gi.InvertYPremultiplyAlpha,{invertY:!0,premultiplyAlpha:!1});n&&(s=this._device.createCommandEncoder({})),(c=s.pushDebugGroup)==null||c.call(s,"internal copy texture with invertY");const l=s.beginRenderPass(i),h=this._device.createBindGroup({layout:o,entries:[{binding:0,resource:e}]});l.setPipeline(r),l.setBindGroup(0,h),l.draw(4,1,0,0),l.end(),(u=s.popDebugGroup)==null||u.call(s),n&&(this._device.queue.submit([s.finish()]),s=null)}createTexture(e,t=!1,i=!1,s=!1,n=!1,r=!1,o="rgba8unorm",l=1,h,c=-1,u=0,f){l=Ve.GetSample(l);const d=e.layers||1,p={width:e.width,height:e.height,depthOrArrayLayers:d},g=Gi[o]?16:0,_=Ve.IsCompressedFormat(o),m=t?Ve.ComputeNumMipmapLevels(e.width,e.height):1,x=c>=0?c:7;u|=t&&!_?1|g:0,!_&&!r&&(u|=g|2);const I=this._device.createTexture({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_Texture").concat(r?"3D":"2D","_").concat(f?f+"_":"").concat(p.width,"x").concat(p.height,"x").concat(p.depthOrArrayLayers,"_").concat(t?"wmips":"womips","_").concat(o,"_samples").concat(l),size:p,dimension:r?"3d":"2d",format:o,usage:x|u,sampleCount:l,mipLevelCount:m});return Ve.IsImageBitmap(e)&&(this.updateTexture(e,I,e.width,e.height,d,o,0,0,s,n,0,0),t&&i&&this.generateMipmaps(I,o,m,0,r,h)),I}createCubeTexture(e,t=!1,i=!1,s=!1,n=!1,r="rgba8unorm",o=1,l,h=-1,c=0,u){o=Ve.GetSample(o);const f=Ve.IsImageBitmapArray(e)?e[0].width:e.width,d=Ve.IsImageBitmapArray(e)?e[0].height:e.height,p=Gi[r]?16:0,g=Ve.IsCompressedFormat(r),_=t?Ve.ComputeNumMipmapLevels(f,d):1,m=h>=0?h:7;c|=t&&!g?1|p:0,g||(c|=p|2);const x=this._device.createTexture({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_TextureCube_").concat(u?u+"_":"").concat(f,"x").concat(d,"x6_").concat(t?"wmips":"womips","_").concat(r,"_samples").concat(o),size:{width:f,height:d,depthOrArrayLayers:6},dimension:"2d",format:r,usage:m|c,sampleCount:o,mipLevelCount:_});return Ve.IsImageBitmapArray(e)&&(this.updateCubeTextures(e,x,f,d,r,s,n,0,0),t&&i&&this.generateCubeMipmaps(x,r,_,l)),x}generateCubeMipmaps(e,t,i,s){var r,o;const n=s===void 0;n&&(s=this._device.createCommandEncoder({})),(r=s.pushDebugGroup)==null||r.call(s,"create cube mipmaps - ".concat(i," levels"));for(let l=0;l<6;++l)this.generateMipmaps(e,t,i,l,!1,s);(o=s.popDebugGroup)==null||o.call(s),n&&(this._device.queue.submit([s.finish()]),s=null)}generateMipmaps(e,t,i,s=0,n=!1,r){var f,d,p,g,_,m;const o=r===void 0,[l,h]=this._getPipeline(t);s=Math.max(s,0),o&&(r=this._device.createCommandEncoder({})),(f=r.pushDebugGroup)==null||f.call(r,"create mipmaps for face #".concat(s," - ").concat(i," levels"));let c;if(Ve.IsHardwareTexture(e)?(c=e.underlyingResource,e._mipmapGenRenderPassDescr=e._mipmapGenRenderPassDescr||[],e._mipmapGenBindGroup=e._mipmapGenBindGroup||[]):(c=e,e=void 0),!c)return;const u=e;for(let x=1;x=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}const $n={},sr={};function Wp(a){const e=a.getClassName();return sr[e]||(sr[e]={}),sr[e]}function va(a){const e=a.getClassName();if($n[e])return $n[e];$n[e]={};const t=$n[e];let i=a,s=e;for(;s;){const n=sr[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 Fi(a,e){return(t,i)=>{const s=Wp(t);s[i]||(s[i]={type:a,sourceName:e})}}function Xp(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 qe(a,e=null){return Xp(a,e)}function B(a){return Fi(0,a)}function pi(a){return Fi(1,a)}function ls(a){return Fi(2,a)}function Ln(a){return Fi(3,a)}function Oh(a){return Fi(4,a)}function bi(a){return Fi(5,a)}function Lh(a){return Fi(6,a)}function Hp(a){return Fi(7,a)}function to(a){return Fi(8,a)}function Kp(a){return Fi(10,a)}function Yp(a){return Fi(11,a)}function ss(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)}}ss.filter=function(a){return(e,t,i)=>ss(e,t,i,a)};class io{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=oi.Zero(),this._cachedBaseSize=oi.Zero(),this._initialSamplingMode=2,this._texture=io._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 Cs{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),Cs._HandleParenthesisContent(i,t))):e=Cs._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:Cs.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=Cs._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 ze{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>ze.HasTags(e),e.addTags=t=>ze.AddTagsTo(e,t),e.removeTags=t=>ze.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>ze.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){ze._AddTagTo(e,s)})}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(ze.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!ze.HasTags(e))return;const i=t.split(" ");for(const s in i)ze._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?ze.HasTags(e):Cs.Eval(t,i=>ze.HasTags(e)&&e._tags[i])}}const j0=function(a,e,t,i={}){const s=a();ze&&ze.HasTags(e)&&ze.AddTagsTo(s,ze.GetTags(e,!0));const n=va(s),r={};for(const o in n){const l=n[o],h=e[o],c=l.type;if(h!=null&&(o!=="uniqueId"||Ae.AllowLoadingUniqueId))switch(c){case 0:case 6:case 11:s[o]=h;break;case 1:i.cloneTexturesOnlyOnce&&r[h.uniqueId]?s[o]=r[h.uniqueId]:(s[o]=t||h.isRenderTarget?h:h.clone(),r[h.uniqueId]=s[o]);break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:s[o]=t?h:h.clone();break}}return s};class Ae{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i{throw Te("ImageProcessingConfiguration")};Ae._FresnelParametersParser=a=>{throw Te("FresnelParameters")};Ae._ColorCurvesParser=a=>{throw Te("ColorCurves")};Ae._TextureParser=(a,e,t)=>{throw Te("Texture")};class lt extends io{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){var t;if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}(t=this.getScene())==null||t.markAllMaterialsAsDirty(1,i=>i.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(e){var t;e!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=e),(t=this.getScene())==null||t.markAllMaterialsAsDirty(1,i=>i.hasTexture(this)))}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=eo()),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=lt.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=[],this.onDisposeObservable=new Q,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,e?lt._IsScene(e)?this._scene=e:this._engine=e:this._scene=Ce.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}getTextureMatrix(){return O.IdentityReadOnly}getReflectionTextureMatrix(){return O.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}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=Ae.Serialize(this);return Ae.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"}}lt.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4;D([B()],lt.prototype,"uniqueId",void 0);D([B()],lt.prototype,"name",void 0);D([B()],lt.prototype,"metadata",void 0);D([B("hasAlpha")],lt.prototype,"_hasAlpha",void 0);D([B("getAlphaFromRGB")],lt.prototype,"_getAlphaFromRGB",void 0);D([B()],lt.prototype,"level",void 0);D([B("coordinatesIndex")],lt.prototype,"_coordinatesIndex",void 0);D([B()],lt.prototype,"optimizeUVAllocation",void 0);D([B("coordinatesMode")],lt.prototype,"_coordinatesMode",void 0);D([B()],lt.prototype,"wrapU",null);D([B()],lt.prototype,"wrapV",null);D([B()],lt.prototype,"wrapR",void 0);D([B()],lt.prototype,"anisotropicFilteringLevel",void 0);D([B()],lt.prototype,"isCube",null);D([B()],lt.prototype,"is3D",null);D([B()],lt.prototype,"is2DArray",null);D([B()],lt.prototype,"gammaSpace",null);D([B()],lt.prototype,"invertZ",void 0);D([B()],lt.prototype,"lodLevelInAlpha",void 0);D([B()],lt.prototype,"lodGenerationOffset",null);D([B()],lt.prototype,"lodGenerationScale",null);D([B()],lt.prototype,"linearSpecularLOD",null);D([pi()],lt.prototype,"irradianceTexture",null);D([B()],lt.prototype,"isRenderTarget",void 0);function Bh(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 qp(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=a._readPixelsSync(e,t);return s?Bh(s,a.getSize(),i.invertY):null}async function $p(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=await a.readPixels(e,t);return s?Bh(s,a.getSize(),i.invertY):null}class Le{}Le.UseOpenGLOrientationForUV=!1;class ne extends lt{static _CreateVideoTexture(e,t,i,s=!1,n=!1,r=ne.TRILINEAR_SAMPLINGMODE,o={},l,h=5){throw Te("VideoTexture")}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=ne.TRILINEAR_SAMPLINGMODE,r=null,o=null,l=null,h=!1,c,u,f,d,p){var S,A,M,C,w,P,z,L,G,H;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._cachedIdentity3x2=!0,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 Q,this._isBlocking=!0,this.name=e||"",this.url=e;let g,_=!1,m=null,x=!0;typeof i=="object"&&i!==null?(g=(S=i.noMipmap)!=null?S:!1,s=(A=i.invertY)!=null?A:!Le.UseOpenGLOrientationForUV,n=(M=i.samplingMode)!=null?M:ne.TRILINEAR_SAMPLINGMODE,r=(C=i.onLoad)!=null?C:null,o=(w=i.onError)!=null?w:null,l=(P=i.buffer)!=null?P:null,h=(z=i.deleteBuffer)!=null?z:!1,c=i.format,u=i.mimeType,f=i.loaderOptions,d=i.creationFlags,_=(L=i.useSRGBBuffer)!=null?L:!1,m=(G=i.internalTexture)!=null?G:null,x=(H=i.gammaSpace)!=null?H:x):g=!!i,this._gammaSpace=x,this._noMipmap=g,this._invertY=s===void 0?!Le.UseOpenGLOrientationForUV:s,this._initialSamplingMode=n,this._buffer=l,this._deleteBuffer=h,this._mimeType=u,this._loaderOptions=f,this._creationFlags=d,this._useSRGBBuffer=_,this._forcedExtension=p,c&&(this._format=c);const I=this.getScene(),T=this._getEngine();if(!T)return;T.onBeforeTextureInitObservable.notifyObservers(this);const y=()=>{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&&I&&I.resetCachedMaterial()},b=(ce,J)=>{this._loadingError=!0,this._errorObject={message:ce,exception:J},o&&o(ce,J),ne.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!m){this._delayedOnLoad=y,this._delayedOnError=b;return}if(this._texture=m!=null?m:this._getFromCache(this.url,g,n,this._invertY,_,this.isCube),this._texture)if(this._texture.isReady)hr.SetImmediate(()=>y());else{const ce=this._texture.onLoadedObservable.add(y);this._texture.onErrorObservable.add(J=>{var W;b(J.message,J.exception),(W=this._texture)==null||W.onLoadedObservable.remove(ce)})}else if(!I||!I.useDelayedTextureLoading){try{this._texture=T.createTexture(this.url,g,this._invertY,I,n,y,b,this._buffer,void 0,this._format,this._forcedExtension,u,f,d,_)}catch(ce){throw b("error loading",ce),ce}h&&(this._buffer=null)}else this.delayLoadState=4,this._delayedOnLoad=y,this._delayedOnError=b}updateURL(e,t=null,i,s){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,n=>n.hasTexture(this))),(!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.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?hr.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}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=O.Zero(),this._rowGenerationMatrix=new O,this._t0=v.Zero(),this._t1=v.Zero(),this._t2=v.Zero()),O.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(O.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,N.Matrix[0]),O.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,N.Matrix[1]),O.ScalingToRef(this._cachedUScale,this._cachedVScale,0,N.Matrix[2]),O.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,N.Matrix[3]),N.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.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),O.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();if(!t)return this._cachedTextureMatrix;const i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,s=>s.hasTexture(this)),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===ne.PROJECTION_MODE){if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}else return this._cachedReflectionTextureMatrix;this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=O.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=O.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 ne.PLANAR_MODE:{O.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 ne.PROJECTION_MODE:{O.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:O.IdentityToRef(this._cachedReflectionTextureMatrix);break}return t&&e.markAllMaterialsAsDirty(1,i=>i.hasTexture(this)),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 Ae.Clone(()=>new ne(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){var i,s;const e=this.name;ne.SerializeBuffers||this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");const t=super.serialize(ne._SerializeInternalTextureUniqueId);return t?((ne.SerializeBuffers||ne.ForceSerializeBuffers)&&(typeof this._buffer=="string"&&this._buffer.substr(0,5)==="data:"?(t.base64String=this._buffer,t.name=t.name.replace("data:","")):this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array?t.base64String="data:image/png;base64,"+Mh(this._buffer):(ne.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?qp(this):$p(this))),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,ne._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=(s=(i=this._texture)==null?void 0:i.uniqueId)!=null?s:void 0),t.noMipmap=this._noMipmap,this.name=e,t):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=yn.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 ne._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 h,c,u;let l=!0;if(e.noMipmap&&(l=!1),e.mirrorPlane){const f=ne._CreateMirror(e.name,e.renderTargetSize,t,l);return f._waitingRenderList=e.renderList,f.mirrorPlane=Yt.FromArray(e.mirrorPlane),r(f),f}else if(e.isRenderTarget){let f=null;if(e.isCube){if(t.reflectionProbes)for(let d=0;d{r(f)},(c=e._creationFlags)!=null?c:0,(u=e._useSRGBBuffer)!=null?u:!1),f.name=e.name;else{let d;e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?d=e.name:d=i+e.name,e.url&&(e.url.startsWith("data:")||ne.UseSerializedUrlIfAny)&&(d=e.url);const p={noMipmap:!l,invertY:e.invertY,samplingMode:e.samplingMode,onLoad:()=>{r(f)},internalTexture:n};f=new ne(d,t,p)}return f}},e,t)}static CreateFromBase64String(e,t,i,s,n,r=ne.TRILINEAR_SAMPLINGMODE,o=null,l=null,h=5,c,u){return new ne("data:"+t,i,s,n,r,o,l,e,!1,h,void 0,void 0,c,u)}static LoadFromDataString(e,t,i,s=!1,n,r=!0,o=ne.TRILINEAR_SAMPLINGMODE,l=null,h=null,c=5,u,f){return e.substr(0,5)!=="data:"&&(e="data:"+e),new ne(e,i,n,r,o,l,h,t,s,c,void 0,void 0,u,f)}}ne.SerializeBuffers=!0;ne.ForceSerializeBuffers=!1;ne.OnTextureLoadErrorObservable=new Q;ne._SerializeInternalTextureUniqueId=!1;ne._CubeTextureParser=(a,e,t)=>{throw Te("CubeTexture")};ne._CreateMirror=(a,e,t,i)=>{throw Te("MirrorTexture")};ne._CreateRenderTargetTexture=(a,e,t,i,s)=>{throw Te("RenderTargetTexture")};ne.NEAREST_SAMPLINGMODE=1;ne.NEAREST_NEAREST_MIPLINEAR=8;ne.BILINEAR_SAMPLINGMODE=2;ne.LINEAR_LINEAR_MIPNEAREST=11;ne.TRILINEAR_SAMPLINGMODE=3;ne.LINEAR_LINEAR_MIPLINEAR=3;ne.NEAREST_NEAREST_MIPNEAREST=4;ne.NEAREST_LINEAR_MIPNEAREST=5;ne.NEAREST_LINEAR_MIPLINEAR=6;ne.NEAREST_LINEAR=7;ne.NEAREST_NEAREST=1;ne.LINEAR_NEAREST_MIPNEAREST=9;ne.LINEAR_NEAREST_MIPLINEAR=10;ne.LINEAR_LINEAR=2;ne.LINEAR_NEAREST=12;ne.EXPLICIT_MODE=0;ne.SPHERICAL_MODE=1;ne.PLANAR_MODE=2;ne.CUBIC_MODE=3;ne.PROJECTION_MODE=4;ne.SKYBOX_MODE=5;ne.INVCUBIC_MODE=6;ne.EQUIRECTANGULAR_MODE=7;ne.FIXED_EQUIRECTANGULAR_MODE=8;ne.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;ne.CLAMP_ADDRESSMODE=0;ne.WRAP_ADDRESSMODE=1;ne.MIRROR_ADDRESSMODE=2;ne.UseSerializedUrlIfAny=!1;D([B()],ne.prototype,"url",void 0);D([B()],ne.prototype,"uOffset",void 0);D([B()],ne.prototype,"vOffset",void 0);D([B()],ne.prototype,"uScale",void 0);D([B()],ne.prototype,"vScale",void 0);D([B()],ne.prototype,"uAng",void 0);D([B()],ne.prototype,"vAng",void 0);D([B()],ne.prototype,"wAng",void 0);D([B()],ne.prototype,"uRotationCenter",void 0);D([B()],ne.prototype,"vRotationCenter",void 0);D([B()],ne.prototype,"wRotationCenter",void 0);D([B()],ne.prototype,"homogeneousRotationInUVTransform",void 0);D([B()],ne.prototype,"isBlocking",null);ft("BABYLON.Texture",ne);Ae._TextureParser=ne.Parse;class xa{constructor(e){this._vertexBuffers={},this._scene=e}_prepareBuffers(){if(this._vertexBuffers[E.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[E.PositionKind]=new E(this._scene.getEngine(),e,E.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[E.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 l;const o=this._scene.getEngine();for(let h=0;hh!=null),s.length===0||!this._scene.postProcessesEnabled))return;const o=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}}Vt._GlobalId=0;class Is extends Vt{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.isEnabled()&&t.isVisible&&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 is3D(){return this.depth>0}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 depth(){return this._size.depth||0}get texture(){var e,t;return(t=(e=this._textures)==null?void 0:e[0])!=null?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,n){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,this.label=n}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]!==e&&(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.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=r,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.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){var t,i,s,n,r,o,l,h;let e=null;if(this._isMulti){const c=this.textures;if(c&&c.length>0){let u=!1,f=c.length,d=-1;const p=c[c.length-1]._source;(p===14||p===12)&&(u=!0,d=c[c.length-1].format,f--);const g=[],_=[],m=[],x=[],I=[],T=[],y=[],b={};for(let M=0;M1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){var e;if(this._textures)for(let t=0;t<((e=this._textures)==null?void 0:e.length);++t)this._textures[t].dispose();this._textures=null}dispose(e=!1){var t;e||((t=this._depthStencilTexture)==null||t.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class Zp extends Nh{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._disposeOnlyFramebuffers=!1,this._currentLOD=0,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}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,r){if(this._depthStencilBuffer){const o=this._engine,l=o._currentFramebuffer,h=this._context;o._bindUnboundFramebuffer(this._framebuffer),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_STENCIL_ATTACHMENT,h.RENDERBUFFER,null),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_ATTACHMENT,h.RENDERBUFFER,null),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.STENCIL_ATTACHMENT,h.RENDERBUFFER,null),o._bindUnboundFramebuffer(l),h.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,s,n,r)}shareDepth(e){super.shareDepth(e);const t=this._context,i=this._depthStencilBuffer,s=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;const r=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(s),t.framebufferRenderbuffer(t.FRAMEBUFFER,r,t.RENDERBUFFER,i),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,s=0){var l,h,c,u;if(!e._hardwareTexture)return;const n=this._framebuffer,r=this._engine,o=r._currentFramebuffer;if(r._bindUnboundFramebuffer(n),r.webGLVersion>1){const f=this._context,d=f["COLOR_ATTACHMENT"+t];e.is2DArray||e.is3D?(i=(h=i!=null?i:(l=this.layerIndices)==null?void 0:l[t])!=null?h:0,f.framebufferTextureLayer(f.FRAMEBUFFER,d,e._hardwareTexture.underlyingResource,s,i)):e.isCube?(i=(u=i!=null?i:(c=this.faceIndices)==null?void 0:c[t])!=null?u:0,f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_CUBE_MAP_POSITIVE_X+i,e._hardwareTexture.underlyingResource,s)):f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_2D,e._hardwareTexture.underlyingResource,s)}else{const f=this._context,d=f["COLOR_ATTACHMENT"+t+"_WEBGL"],p=i!==void 0?f.TEXTURE_CUBE_MAP_POSITIVE_X+i:f.TEXTURE_2D;f.framebufferTexture2D(f.FRAMEBUFFER,d,p,e._hardwareTexture.underlyingResource,s)}r._bindUnboundFramebuffer(o)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){var s,n;if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=(n=(s=this._attachments)==null?void 0:s.length)!=null?n:this.textures.length;for(let r=0;r1&&(r.format===15?u=t.DEPTH_COMPONENT16:r.format===16?u=t.DEPTH_COMPONENT24:r.format===17||r.format===13?u=t.DEPTH24_STENCIL8:r.format===14?u=t.DEPTH_COMPONENT32F:r.format===18&&(u=t.DEPTH32F_STENCIL8)),r.is2DArray?t.texImage3D(n,0,u,r.width,r.height,i,0,c,h,null):r.is3D?t.texImage3D(n,0,u,r.width,r.height,s,0,c,h,null):t.texImage2D(n,0,u,r.width,r.height,0,c,h,null),this._bindTextureDirectly(n,null),this._internalTexturesCache.push(r),r};Fe.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._getRGBABufferInternalSizedFormat(a.texture.type,a.texture.format,a.texture._useSRGBBuffer),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};Fe.prototype._setupDepthStencilTexture=function(a,e,t,i,s,n=1){const r=e.width||e,o=e.height||e,l=e.layers||0,h=e.depth||0;a.baseWidth=r,a.baseHeight=o,a.width=r,a.height=o,a.is2DArray=l>0,a.depth=l||h,a.isReady=!0,a.samples=n,a.generateMipMaps=!1,a.samplingMode=i?2:1,a.type=0,a._comparisonFunction=s;const c=this._gl,u=this._getTextureTarget(a),f=this._getSamplingParameters(a.samplingMode,!1);c.texParameteri(u,c.TEXTURE_MAG_FILTER,f.mag),c.texParameteri(u,c.TEXTURE_MIN_FILTER,f.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&&(s===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,s),c.texParameteri(u,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE)))};Fe.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 Et(this,5);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,U.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};Fe.prototype.setDepthStencilTexture=function(a,e,t,i){a!==void 0&&(e&&(this._boundUniforms[a]=e),!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i))};class ln{static GetEffect(e){return e.getPipelineContext===void 0?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){var s;this.effect=e,t!==void 0&&(this.defines=t),i&&((s=this.drawContext)==null||s.reset())}dispose(){var e;(e=this.drawContext)==null||e.dispose()}}const Qp="postprocessVertexShader",Jp="attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const 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;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";K.ShadersStore[Qp]=Jp;const ta={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class e_{constructor(e,t=ta){var n,r;this._fullscreenViewport=new Qs(0,0,1,1);const i=(n=t.positions)!=null?n:ta.positions,s=(r=t.indices)!=null?r:ta.indices;this.engine=e,this._vertexBuffers={[E.PositionKind]:new E(e,i,E.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(s),this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{this._indexBuffer=e.createIndexBuffer(s);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({})}saveStates(){this._savedStateDepthTest=this.engine.depthCullingState.depthTest,this._savedStateStencilTest=this.engine.stencilState.stencilTest}restoreStates(){this.engine.depthCullingState.depthTest=this._savedStateDepthTest,this.engine.stencilState.stencilTest=this._savedStateStencilTest}draw(){this.engine.drawElementsType(0,0,6)}_isRenderTargetTexture(e){return e.renderTarget!==void 0}render(e,t=null){if(!e.effect.isReady())return;this.saveStates(),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[E.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[E.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class t_{get effect(){return this._drawWrapper.effect}set effect(e){this._drawWrapper.effect=e}constructor(e){this.onApplyObservable=new Q;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 ln(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 Pt(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._prepareEffect()}))}dispose(e=!0){this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),e&&this.effect.dispose()}}const Uh="passPixelShader",kh="varying vec2 vUV;uniform sampler2D textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{gl_FragColor=texture2D(textureSampler,vUV);}";K.ShadersStore[Uh]=kh;const Z0={name:Uh,shader:kh};class Ot{static _CreateDumpRenderer(){if(!Ot._DumpToolsEngine){let e,t=null;const i={preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1};try{e=new OffscreenCanvas(100,100),t=new Fe(e,!1,i)}catch{e=document.createElement("canvas"),t=new Fe(e,!1,i)}Ce.Instances.pop(),Ce.OnEnginesDisposedObservable.add(r=>{t&&r!==t&&!t.isDisposed&&Ce.Instances.length===0&&Ot.Dispose()}),t.getCaps().parallelShaderCompile=void 0;const s=new e_(t),n=new t_({engine:t,name:Z0.name,fragmentShader:Z0.shader,samplerNames:["textureSampler"]});Ot._DumpToolsEngine={canvas:e,engine:t,renderer:s,wrapper:n}}return Ot._DumpToolsEngine}static async DumpFramebuffer(e,t,i,s,n="image/png",r,o){const l=await i.readPixels(0,0,e,t),h=new Uint8Array(l.buffer);Ot.DumpData(e,t,h,s,n,r,!0,void 0,o)}static DumpDataAsync(e,t,i,s="image/png",n,r=!1,o=!1,l){return new Promise(h=>{Ot.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=Ot._CreateDumpRenderer();if(c.engine.setSize(e,t,!0),i instanceof Float32Array){const f=new Uint8Array(i.length);let d=i.length;for(;d--;){const p=i[d];f[d]=Math.round(Ye.Clamp(p)*255)}i=f}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?ee.ToBlob(c.canvas,f=>{const d=new FileReader;d.onload=p=>{const g=p.target.result;s&&s(g)},d.readAsArrayBuffer(f)},n,h):ee.EncodeScreenshotCanvasData(c.canvas,s,n,r,h),u.dispose()}static Dispose(){Ot._DumpToolsEngine&&(Ot._DumpToolsEngine.wrapper.dispose(),Ot._DumpToolsEngine.renderer.dispose(),Ot._DumpToolsEngine.engine.dispose()),Ot._DumpToolsEngine=null}}const i_=()=>{ee.DumpData=Ot.DumpData,ee.DumpDataAsync=Ot.DumpDataAsync,ee.DumpFramebuffer=Ot.DumpFramebuffer};i_();Pt.prototype.setDepthStencilTexture=function(a,e){this._engine.setDepthStencilTexture(this._samplers[a],this._uniforms[a],e,a)};class wi extends ne{get renderList(){return this._renderList}set renderList(e){this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=Eh(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 G;const L=this._renderList?this._renderList.length:0;(z===0&&L>0||L===0)&&((G=this.getScene())==null||G.meshes.forEach(H=>{H._markSubMeshesAsLightDirty()}))},this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new Q,this.onAfterUnbindObservable=new Q,this.onBeforeRenderObservable=new Q,this.onAfterRenderObservable=new Q,this.onClearObservable=new Q,this.onResizeObservable=new Q,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 T=this.getScene().getEngine();this._gammaSpace=I,this._coordinatesMode=ne.PROJECTION_MODE,this.renderList=[],this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=t,this._renderPassIds=[],this._isCubeData=o,this._processSizeParameter(t),this.renderPassId=this._renderPassIds[0],this._resizeObserver=T.onResizeObservable.add(()=>{}),this._generateMipMaps=!!s,this._doNotChangeAspectRatio=n,this._renderingManager=new Ut(i),this._renderingManager._useSceneAutoClearSetup=!0,!u&&(this._renderTargetOptions={generateMipMaps:s,type:r,format:(w=this._format)!=null?w:void 0,samplingMode:this.samplingMode,generateDepthBuffer:h,generateStencilBuffer:c,samples:p,creationFlags:g,noColorAttachment:_,useSRGBBuffer:m,colorAttachment:x,label:this.name},this.samplingMode===ne.NEAREST_SAMPLINGMODE&&(this.wrapU=ne.CLAMP_ADDRESSMODE,this.wrapV=ne.CLAMP_ADDRESSMODE),d||(o?(this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=ne.INVCUBIC_MODE,this._textureMatrix=O.Identity()):this._renderTarget=i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,p!==void 0&&(this.samples=p)))}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,r){var o;(o=this._renderTarget)==null||o.createDepthStencilTexture(e,t,i,s,n,r)}_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;if(e)return e;const t=this._size.depth;return t||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 s;const t=this.isCube;(s=this._renderTarget)==null||s.dispose(),this._renderTarget=null;const i=this.getScene();i&&(this._processSizeParameter(e,!1),t?this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=i.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 c;const s=this.getScene();if(!s)return i;const n=s.getEngine();if(this.useCameraPostProcesses!==void 0&&(e=this.useCameraPostProcesses),this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(let u=0;u{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 h,c,u,f,d,p;const r=this.getScene();if(!r)return;const o=r.getEngine();if((h=o._debugPushGroup)==null||h.call(o,"render to face #".concat(e," layer #").concat(s),1),this._prepareFrame(r,e,s,t),this.is2DArray||this.is3D?(o.currentRenderPassId=this._renderPassIds[s],this.onBeforeRenderObservable.notifyObservers(s)):(o.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e)),o.snapshotRendering&&o.snapshotRenderingMode===1)this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(o):this.skipInitialClear||o.clear(this.clearColor||r.clearColor,!0,!0,!0);else{let g=null;const _=this.renderList?this.renderList:r.getActiveMeshes().data,m=this.renderList?this.renderList.length:r.getActiveMeshes().length;this.getCustomRenderList&&(g=this.getCustomRenderList(this.is2DArray||this.is3D?s:e,_,m)),g?this._prepareRenderingManager(g,g.length,n,this.forceLayerMaskCheck):(this._defaultRenderListPrepared||(this._prepareRenderingManager(_,m,n,!this.renderList||this.forceLayerMaskCheck),this._defaultRenderListPrepared=!0),g=_);for(const I of r._beforeRenderTargetClearStage)I.action(this,e,s);this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(o):this.skipInitialClear||o.clear(this.clearColor||r.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||r.updateTransformMatrix(!0);for(const I of r._beforeRenderTargetDrawStage)I.action(this,e,s);this._renderingManager.render(this.customRenderFunction,g,this.renderParticles,this.renderSprites);for(const I of r._afterRenderTargetDrawStage)I.action(this,e,s);const x=(u=(c=this._texture)==null?void 0:c.generateMipMaps)!=null?u:!1;this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,(f=this._renderTarget)!=null?f:void 0,e,this._postProcesses,this.ignoreCameraViewport):t&&r.postProcessManager._finalizeFrame(!1,(d=this._renderTarget)!=null?d:void 0,e);for(const I of r._afterRenderTargetPostProcessStage)I.action(this,e,s);this._texture&&(this._texture.generateMipMaps=x),this._doNotChangeAspectRatio||r.updateTransformMatrix(!0),i&&Ot.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),o)}this._unbindFrameBuffer(o,e),this._texture&&this.isCube&&e===5&&o.generateMipMapsForCubemap(this._texture,!0),(p=o._debugPopGroup)==null||p.call(o,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 wi(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&&e.customRenderTargets.splice(t,1);for(const s of e.cameras)t=s.customRenderTargets.indexOf(this),t>=0&&s.customRenderTargets.splice(t,1);(i=this._renderTarget)==null||i.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this.refreshRate===wi.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=wi.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._renderingManager&&this._renderingManager.freeRenderingGroups()}getViewCount(){return 1}}wi.REFRESHRATE_RENDER_ONCE=0;wi.REFRESHRATE_RENDER_ONEVERYFRAME=1;wi.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2;ne._CreateRenderTargetTexture=(a,e,t,i,s)=>new wi(a,e,t,i);me.prototype.setTextureFromPostProcess=function(a,e,t){var s;let i=null;e&&(e._forcedOutputTexture?i=e._forcedOutputTexture:e._textures.data[e._currentRenderTextureInd]&&(i=e._textures.data[e._currentRenderTextureInd])),this._bindTexture(a,(s=i==null?void 0:i.texture)!=null?s:null,t)};me.prototype.setTextureFromPostProcessOutput=function(a,e,t){var i,s;this._bindTexture(a,(s=(i=e==null?void 0:e._outputTexture)==null?void 0:i.texture)!=null?s:null,t)};Pt.prototype.setTextureFromPostProcess=function(a,e){this._engine.setTextureFromPostProcess(this._samplers[a],e,a)};Pt.prototype.setTextureFromPostProcessOutput=function(a,e){this._engine.setTextureFromPostProcessOutput(this._samplers[a],e,a)};class it{static RegisterShaderCodeProcessing(e,t){if(!t){delete it._CustomShaderCodeProcessing[e!=null?e:""];return}it._CustomShaderCodeProcessing[e!=null?e:""]=t}static _GetShaderCodeProcessing(e){var t;return(t=it._CustomShaderCodeProcessing[e])!=null?t:it._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,f="postprocess",d,p=!1,g=5,_=0){var I,T,y,b,S,A,M,C,w,P,z,L;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=[],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 Vt(2),this._textureCache=[],this._currentRenderTextureInd=0,this._scaleRatio=new fe(1,1),this._texelSize=fe.Zero(),this.onActivateObservable=new Q,this.onSizeChangedObservable=new Q,this.onApplyObservable=new Q,this.onBeforeRenderObservable=new Q,this.onAfterRenderObservable=new Q,this.name=e;let m=1,x=null;if(i&&!Array.isArray(i)){const G=i;i=(I=G.uniforms)!=null?I:null,s=(T=G.samplers)!=null?T:null,m=(y=G.size)!=null?y:1,r=(b=G.camera)!=null?b:null,o=(S=G.samplingMode)!=null?S:1,l=G.engine,h=G.reusable,c=(A=G.defines)!=null?A:null,u=(M=G.textureType)!=null?M:0,f=(C=G.vertexUrl)!=null?C:"postprocess",d=G.indexParameters,p=(w=G.blockCompilation)!=null?w:!1,g=(P=G.textureFormat)!=null?P:5,_=(z=G.shaderLanguage)!=null?z:0,x=(L=G.uniformBuffers)!=null?L:null}else n&&(typeof n=="number"?m=n:m={width:n.width,height:n.height});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=m,this.renderTargetSamplingMode=o||1,this._reusable=h||!1,this._textureType=u,this._textureFormat=g,this._shaderLanguage=_,this._samplers=s||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=i||[],this._parameters.push("scale"),this._uniformBuffers=x||[],this._indexParameters=d,this._drawWrapper=new ln(this._engine),p||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 Vt(2)),this._shareOutputWithPostProcess=null}updateEffect(e=null,t=null,i=null,s,n,r,o,l){var c,u;const h=it._GetShaderCodeProcessing(this.name);if(h!=null&&h.defineCustomBindings){const f=(c=t==null?void 0:t.slice())!=null?c:[];f.push(...this._parameters);const d=(u=i==null?void 0:i.slice())!=null?u:[];d.push(...this._samplers),e=h.defineCustomBindings(this.name,e,f,d),t=f,i=d}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:this._uniformBuffers,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:h!=null&&h.processCodeAfterIncludes?(f,d)=>h.processCodeAfterIncludes(this.name,f,d):null,processFinalCode:h!=null&&h.processFinalCode?(f,d)=>h.processFinalCode(this.name,f,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;if(i){for(let h=0;h{g.samples!==this.samples&&this._engine.updateRenderTargetTextureSampleCount(g,this.samples)}),this._flushTextureCache(),this._renderId++}return f||(f=this._getTarget()),this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(o/h,l/c),this._engine.bindFramebuffer(f,0,o,l,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(f,0,void 0,void 0,this.forceFullscreenViewport)),(p=(d=this._engine)._debugInsertMarker)==null||p.call(d,"post process ".concat(this.name," input")),this.onActivateObservable.notifyObservers(e),this.autoClear&&(this.alphaMode===0||this.forceAutoClearInAlphaMode)&&this._engine.clear(this.clearColor?this.clearColor:s.clearColor,s._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),f}get isSupported(){return this._drawWrapper.effect.isSupported}get aspectRatio(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height}isReady(){var e,t;return(t=(e=this._drawWrapper.effect)==null?void 0:e.isReady())!=null?t:!1}apply(){var t,i,s;if(!((t=this._drawWrapper.effect)!=null&&t.isReady()))return null;this._engine.enableEffect(this._drawWrapper),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this._engine.setAlphaMode(this.alphaMode),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a);let e;return this._shareOutputWithPostProcess?e=this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?e=this._forcedOutputTexture:e=this.inputTexture,this.externalTextureSamplerBinding||this._drawWrapper.effect._bindTexture("textureSampler",e==null?void 0:e.texture),this._drawWrapper.effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._drawWrapper.effect),(s=(i=it._GetShaderCodeProcessing(this.name))==null?void 0:i.bindCustomBindings)==null||s.call(i,this.name,this._drawWrapper.effect),this._drawWrapper.effect}_disposeTextures(){if(this._shareOutputWithPostProcess||this._forcedOutputTexture){this._disposeTextureCache();return}this._disposeTextureCache(),this._textures.dispose()}_disposeTextureCache(){for(let e=this._textureCache.length-1;e>=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=Ae.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=it.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=ms(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 Ae.Parse(()=>new it(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)}}it._CustomShaderCodeProcessing={};D([B()],it.prototype,"uniqueId",void 0);D([B()],it.prototype,"name",void 0);D([B()],it.prototype,"width",void 0);D([B()],it.prototype,"height",void 0);D([B()],it.prototype,"renderTargetSamplingMode",void 0);D([to()],it.prototype,"clearColor",void 0);D([B()],it.prototype,"autoClear",void 0);D([B()],it.prototype,"forceAutoClearInAlphaMode",void 0);D([B()],it.prototype,"alphaMode",void 0);D([B()],it.prototype,"alphaConstants",void 0);D([B()],it.prototype,"enablePixelPerfectMode",void 0);D([B()],it.prototype,"forceFullscreenViewport",void 0);D([B()],it.prototype,"scaleMode",void 0);D([B()],it.prototype,"alwaysForcePOT",void 0);D([B("samples")],it.prototype,"_samples",void 0);D([B()],it.prototype,"adaptScaleToCurrentViewport",void 0);ft("BABYLON.PostProcess",it);const s_="passCubePixelShader",n_="varying vec2 vUV;uniform samplerCube textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec2 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}";K.ShadersStore[s_]=n_;class Bn extends it{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 Ae.Parse(()=>new Bn(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,i,s)}}ft("BABYLON.PassPostProcess",Bn);me._RescalePostProcessFactory=a=>new Bn("rescale",1,null,2,a,!1,0);const r_="lodPixelShader",a_="#extension GL_EXT_shader_texture_lod : enable\nprecision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform sampler2D textureSampler;uniform float lod;uniform vec2 texSize;uniform bool gamma;void main(void)\n{gl_FragColor=textureLod(textureSampler,vUV,lod);if (!gamma) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}\n";K.ShadersStore[r_]=a_;const o_="lodCubePixelShader",l_="precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform samplerCube textureSampler;uniform float lod;uniform bool gamma;void main(void)\n{vec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x),lod);\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x),lod);\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x),lod);\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x),lod);\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001),lod);\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001),lod);\n#endif\nif (!gamma) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}\n";K.ShadersStore[o_]=l_;function h_(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 it("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=f=>{f._bindTexture("textureSampler",e),f.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 c_(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 dr{static _IsGPUBuffer(e){return e.underlyingResource===void 0}static _FlagsToString(e,t=""){let i=t;for(let s=0;s<=9;++s)e&1<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]=c_(s[e]);return i}readDataFromBuffer(e,t,i,s,n,r,o=0,l=0,h=null,c=!0,u=!1){const f=o===1?2:o===2?1:0,d=this._engine.uniqueId;return new Promise((p,g)=>{e.mapAsync(1,l,t).then(()=>{const _=e.getMappedRange(l,t);let m=h;if(u)m===null?m=_a(o,t,!0,_):m=_a(o,m.buffer,void 0,_);else if(m===null)switch(f){case 0:m=new Uint8Array(t),m.set(new Uint8Array(_));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,_);break;case 2:m=new Float32Array(t/4),m.set(new Float32Array(_));break}else switch(f){case 0:m=new Uint8Array(m.buffer),m.set(new Uint8Array(_));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,_,h);break;case 2:m=new Float32Array(m.buffer),m.set(new Float32Array(_));break}if(n!==r){f===1&&!u&&(n*=2,r*=2);const x=new Uint8Array(m.buffer);let I=n,T=0;for(let y=1;y{this._engine.isDisposed||this._engine.uniqueId!==d?p(new Uint8Array):g(_)})})}releaseBuffer(e){return dr._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 u_[e.samplingMode]+f_[(e._comparisonFunction||514)-512+1]+d_[e.samplingMode]+(((s=e._cachedWrapU)!=null?s:1)<<8)+(((n=e._cachedWrapV)!=null?n:1)<<10)+(((r=e._cachedWrapR)!=null?r:1)<<12)+((e.useMipMaps?1:0)<<14)+(t<<15)}static _GetSamplerFilterDescriptor(e,t){let i,s,n,r,o;const l=e.useMipMaps;switch(e.samplingMode){case 11:i="linear",s="linear",n="nearest",l||(r=o=0);break;case 3:case 3:i="linear",s="linear",l?n="linear":(n="nearest",r=o=0);break;case 8:i="nearest",s="nearest",l?n="linear":(n="nearest",r=o=0);break;case 4:i="nearest",s="nearest",n="nearest",l||(r=o=0);break;case 5:i="nearest",s="linear",n="nearest",l||(r=o=0);break;case 6:i="nearest",s="linear",l?n="linear":(n="nearest",r=o=0);break;case 7:i="nearest",s="linear",n="nearest",r=o=0;break;case 1:case 1:i="nearest",s="nearest",n="nearest",r=o=0;break;case 9:i="linear",s="nearest",n="nearest",l||(r=o=0);break;case 10:i="linear",s="nearest",l?n="linear":(n="nearest",r=o=0);break;case 2:case 2:i="linear",s="linear",n="nearest",r=o=0;break;case 12:i="linear",s="nearest",n="nearest",r=o=0;break;default:i="nearest",s="nearest",n="nearest",r=o=0;break}return t>1&&(r!==0||o!==0)&&n!=="nearest"?{magFilter:"linear",minFilter:"linear",mipmapFilter:"linear",anisotropyEnabled:!0}:{magFilter:i,minFilter:s,mipmapFilter:n,lodMinClamp:r,lodMaxClamp:o}}static _GetWrappingMode(e){switch(e){case 1:return"repeat";case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"}static _GetSamplerWrappingDescriptor(e){return{addressModeU:this._GetWrappingMode(e._cachedWrapU),addressModeV:this._GetWrappingMode(e._cachedWrapV),addressModeW:this._GetWrappingMode(e._cachedWrapR)}}static _GetSamplerDescriptor(e,t){const i=e.useMipMaps&&e._cachedAnisotropicFilteringLevel&&e._cachedAnisotropicFilteringLevel>1?4:1,s=this._GetSamplerFilterDescriptor(e,i);return{label:t,...s,...this._GetSamplerWrappingDescriptor(e),compare:e._comparisonFunction?Ms.GetCompareFunction(e._comparisonFunction):void 0,maxAnisotropy:s.anisotropyEnabled?i:1}}static GetCompareFunction(e){switch(e){case 519:return"always";case 514:return"equal";case 516:return"greater";case 518:return"greater-equal";case 513:return"less";case 515:return"less-equal";case 512:return"never";case 517:return"not-equal";default:return"less"}}getSampler(e,t=!1,i=0,s){if(this.disabled)return this._device.createSampler(Ms._GetSamplerDescriptor(e,s));t?i=0:i===0&&(i=Ms.GetSamplerHashCode(e));let n=t?void 0:this._samplers[i];return n||(n=this._device.createSampler(Ms._GetSamplerDescriptor(e,s)),t||(this._samplers[i]=n)),n}}const p_={[E.PositionKind]:!0,[E.NormalKind]:!0,[E.TangentKind]:!0,[E.UVKind]:!0,[E.UV2Kind]:!0,[E.UV3Kind]:!0,[E.UV4Kind]:!0,[E.UV5Kind]:!0,[E.UV6Kind]:!0,[E.ColorKind]:!0,[E.ColorInstanceKind]:!0,[E.MatricesIndicesKind]:!0,[E.MatricesWeightsKind]:!0,[E.MatricesIndicesExtraKind]:!0,[E.MatricesWeightsExtraKind]:!0};function __(a){switch(a){case E.BYTE:case E.SHORT:case E.INT:case E.FLOAT:return!0;case E.UNSIGNED_BYTE:case E.UNSIGNED_SHORT:case E.UNSIGNED_INT:return!1;default:throw new Error("Invalid type '".concat(a,"'"))}}function g_(a,e){const t=e.getEngine(),i=e._pipelineContext;if(!(i!=null&&i.vertexBufferKindToType))return;let s=null;for(const n in a){const r=a[n];if(!r||!p_[n])continue;const o=r.normalized?E.FLOAT:r.type,l=i.vertexBufferKindToType[n];(o!==E.FLOAT&&l===void 0||l!==void 0&&l!==o)&&(s||(s=t._getShaderProcessingContext(e.shaderLanguage)),i.vertexBufferKindToType[n]=o,o!==E.FLOAT&&(s.vertexBufferKindToNumberOfComponents[n]=E.DeduceStride(n),__(o)&&(s.vertexBufferKindToNumberOfComponents[n]*=-1)))}if(s){const n=t._caps.parallelShaderCompile;t._caps.parallelShaderCompile=void 0,e._processShaderCode(null,t._features._checkNonFloatVertexBuffersDontRecreatePipelineContext,s),t._caps.parallelShaderCompile=n}}var dt;(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"})(dt||(dt={}));const jn={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},ks={0:0,7680:1,7681:2,7682:3,7683:4,5386:5,34055:6,34056:7};class rt{constructor(e,t){this.mrtTextureCount=0,this._device=e,this._useTextureStage=!0,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=["bgra8unorm"],this.setColorFormat("bgra8unorm"),this.setMRT([]),this.setAlphaBlendEnabled(!1),this.setAlphaBlendFactors([null,null,null,null],[null,null]),this.setWriteMask(15),this.setDepthStencilFormat("depth24plus-stencil8"),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=Ve.GetSample(i),this.disabled){const r=rt._GetTopology(e);return this._setVertexState(t),this._setTextureState(s),this._parameter.pipeline=this._createRenderPipeline(t,r,i),rt.NumCacheMiss++,rt._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,rt.NumCacheHitWithoutHash++,this._parameter.pipeline;if(this._getRenderPipeline(this._parameter),this._isDirty=!1,this._stateDirtyLowestIndex=this._statesLength,this._parameter.pipeline)return rt.NumCacheHitWithHash++,this._parameter.pipeline;const n=rt._GetTopology(e);return this._parameter.pipeline=this._createRenderPipeline(t,n,i),this._setRenderPipeline(this._parameter),rt.NumCacheMiss++,rt._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}endFrame(){rt.NumPipelineCreationLastFrame=rt._NumPipelineCreationCurrentFrame,rt._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[dt.DepthBias]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthBias))}setDepthBiasSlopeScale(e){this._depthBiasSlopeScale!==e&&(this._depthBiasSlopeScale=e,this._states[dt.DepthBiasSlopeScale]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthBiasSlopeScale))}setColorFormat(e){this._webgpuColorFormat[0]=e,this._colorFormat=Gi[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 i=[0,0];let s=0,n=0,r=0;for(let h=0;h=32&&(n=0,s++)}this._mrtFormats.length=r,(this._mrtAttachments1!==i[0]||this._mrtAttachments2!==i[1])&&(this._mrtAttachments1=i[0],this._mrtAttachments2=i[1],this._states[dt.MRTAttachments1]=i[0],this._states[dt.MRTAttachments2]=i[1],this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.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:Gi[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:ks[e]}setStencilPassOp(e){this._stencilFrontPassOp=e===null?2:ks[e]}setStencilFailOp(e){this._stencilFrontFailOp=e===null?1:ks[e]}setStencilReadMask(e){this._stencilReadMask!==e&&(this._stencilReadMask=e,this._states[dt.StencilReadMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.StencilReadMask))}setStencilWriteMask(e){this._stencilWriteMask!==e&&(this._stencilWriteMask=e,this._states[dt.StencilWriteMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.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:ks[i],this._stencilFrontPassOp=s===null?2:ks[s],this._stencilFrontFailOp=n===null?1:ks[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"triangle-list";case 2:return"point-list";case 1:return"line-list";case 3:return"point-list";case 4:return"line-list";case 5:throw"LineLoop is an unsupported fillmode in WebGPU";case 6:return"line-strip";case 7:return"triangle-strip";case 8:throw"TriangleFan is an unsupported fillmode in WebGPU";default:return"triangle-list"}}static _GetAphaBlendOperation(e){switch(e){case 32774:return"add";case 32778:return"subtract";case 32779:return"reverse-subtract";case 32775:return"min";case 32776:return"max";default:return"add"}}static _GetAphaBlendFactor(e){switch(e){case 0:return"zero";case 1:return"one";case 768:return"src";case 769:return"one-minus-src";case 770:return"src-alpha";case 771:return"one-minus-src-alpha";case 772:return"dst-alpha";case 773:return"one-minus-dst-alpha";case 774:return"dst";case 775:return"one-minus-dst";case 776:return"src-alpha-saturated";case 32769:return"constant";case 32770:return"one-minus-constant";case 32771:return"constant";case 32772:return"one-minus-constant";default:return"one"}}static _GetCompareFunction(e){switch(e){case 0:return"never";case 1:return"less";case 2:return"equal";case 3:return"less-equal";case 4:return"greater";case 5:return"not-equal";case 6:return"greater-equal";case 7:return"always"}return"never"}static _GetStencilOpFunction(e){switch(e){case 0:return"zero";case 1:return"keep";case 2:return"replace";case 3:return"increment-clamp";case 4:return"decrement-clamp";case 5:return"invert";case 6:return"increment-wrap";case 7:return"decrement-wrap"}return"keep"}static _GetVertexInputDescriptorFormat(e){const t=e.type,i=e.normalized,s=e.getSize();switch(t){case E.BYTE:switch(s){case 1:case 2:return i?"snorm8x2":"sint8x2";case 3:case 4:return i?"snorm8x4":"sint8x4"}break;case E.UNSIGNED_BYTE:switch(s){case 1:case 2:return i?"unorm8x2":"uint8x2";case 3:case 4:return i?"unorm8x4":"uint8x4"}break;case E.SHORT:switch(s){case 1:case 2:return i?"snorm16x2":"sint16x2";case 3:case 4:return i?"snorm16x4":"sint16x4"}break;case E.UNSIGNED_SHORT:switch(s){case 1:case 2:return i?"unorm16x2":"uint16x2";case 3:case 4:return i?"unorm16x4":"uint16x4"}break;case E.INT:switch(s){case 1:return"sint32";case 2:return"sint32x2";case 3:return"sint32x3";case 4:return"sint32x4"}break;case E.UNSIGNED_INT:switch(s){case 1:return"uint32";case 2:return"uint32x2";case 3:return"uint32x3";case 4:return"uint32x4"}break;case E.FLOAT:switch(s){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4"}break}throw new Error("Invalid Format '".concat(e.getKind(),"' - type=").concat(t,", normalized=").concat(i,", size=").concat(s))}_getAphaBlendState(){return this._alphaBlendEnabled?{srcFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),dstFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),operation:rt._GetAphaBlendOperation(this._alphaBlendEqParams[1])}:null}_getColorBlendState(){return this._alphaBlendEnabled?{srcFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),dstFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),operation:rt._GetAphaBlendOperation(this._alphaBlendEqParams[0])}:null}_setShaderStage(e){this._shaderId!==e&&(this._shaderId=e,this._states[dt.ShaderStage]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.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[dt.RasterizationState]=this._rasterizationState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.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:jn[this._alphaBlendFuncParams[0]])<<0)+((this._alphaBlendFuncParams[1]===null?2:jn[this._alphaBlendFuncParams[1]])<<4)+((this._alphaBlendFuncParams[2]===null?2:jn[this._alphaBlendFuncParams[2]])<<8)+((this._alphaBlendFuncParams[3]===null?2:jn[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[dt.ColorStates]=this._colorStates,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.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[dt.DepthStencilState]=this._depthStencilState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthStencilState))}_setVertexState(e){var h,c;const t=this._statesLength;let i=dt.VertexState;const s=e._pipelineContext,n=s.shaderProcessingContext.attributeNamesFromEffect,r=s.shaderProcessingContext.attributeLocationsFromEffect;let o,l=0;for(let u=0;u0)for(let _=0;_=this._video.HAVE_CURRENT_DATA}dispose(){}}class Rr{get forceBindGroupCreation(){return this._numExternalTextures>0}get hasFloatOrDepthTextures(){return this._numFloatOrDepthTextures>0}constructor(){this.uniqueId=Rr._Counter++,this.updateId=0,this.textureState=0,this.reset()}reset(){this.samplers={},this.textures={},this.isDirty=!0,this._numFloatOrDepthTextures=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?Ms.GetSamplerHashCode(t):0;const n=s!==i.hashCode;n&&this.updateId++,this.isDirty||(this.isDirty=n)}setTexture(e,t){var r,o,l;let i=this.textures[e],s=-1;i?s=(o=(r=i.texture)==null?void 0:r.uniqueId)!=null?o:-1:this.textures[e]=i={texture:t,isFloatOrDepthTexture:!1,isExternalTexture:!1},i.isExternalTexture&&this._numExternalTextures--,i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures--,t?(i.isFloatOrDepthTexture=t.type===1||t.format>=13&&t.format<=18,i.isExternalTexture=Vh.IsExternalTexture(t),i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures++,i.isExternalTexture&&this._numExternalTextures++):(i.isFloatOrDepthTexture=!1,i.isExternalTexture=!1),i.texture=t;const n=s!==((l=t==null?void 0:t.uniqueId)!=null?l:-1);n&&this.updateId++,this.isDirty||(this.isDirty=n)}}Rr._Counter=0;class Pr{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(20,We.CopyDst|We.Indirect|We.Storage,void 0,"IndirectDrawBuffer"),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=Pr._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?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}}Pr._Counter=0;class _n{constructor(){this.values={}}}class Ke{static get Statistics(){return{totalCreated:Ke.NumBindGroupsCreatedTotal,lastFrameCreated:Ke.NumBindGroupsCreatedLastFrame,lookupLastFrame:Ke.NumBindGroupsLookupLastFrame,noLookupLastFrame:Ke.NumBindGroupsNoLookupLastFrame}}static ResetCache(){Ke._Cache=new _n,Ke.NumBindGroupsCreatedTotal=0,Ke.NumBindGroupsCreatedLastFrame=0,Ke.NumBindGroupsLookupLastFrame=0,Ke.NumBindGroupsNoLookupLastFrame=0,Ke._NumBindGroupsCreatedCurrentFrame=0,Ke._NumBindGroupsLookupCurrentFrame=0,Ke._NumBindGroupsNoLookupCurrentFrame=0}constructor(e,t,i){this.disabled=!1,this._device=e,this._cacheSampler=t,this._engine=i}endFrame(){Ke.NumBindGroupsCreatedLastFrame=Ke._NumBindGroupsCreatedCurrentFrame,Ke.NumBindGroupsLookupLastFrame=Ke._NumBindGroupsLookupCurrentFrame,Ke.NumBindGroupsNoLookupLastFrame=Ke._NumBindGroupsNoLookupCurrentFrame,Ke._NumBindGroupsCreatedCurrentFrame=0,Ke._NumBindGroupsLookupCurrentFrame=0,Ke._NumBindGroupsNoLookupCurrentFrame=0}getBindGroups(e,t,i){var l,h,c,u,f,d,p,g,_,m;let s,n=Ke._Cache;const r=this.disabled||i.forceBindGroupCreation;if(!r){if(!t.isDirty(i.updateId)&&!i.isDirty)return Ke._NumBindGroupsNoLookupCurrentFrame++,t.bindGroups;for(const x of e.shaderProcessingContext.bufferNames){const I=(h=(l=t.buffers[x])==null?void 0:l.uniqueId)!=null?h:0;let T=n.values[I];T||(T=new _n,n.values[I]=T),n=T}for(const x of e.shaderProcessingContext.samplerNames){const I=(u=(c=i.samplers[x])==null?void 0:c.hashCode)!=null?u:0;let T=n.values[I];T||(T=new _n,n.values[I]=T),n=T}for(const x of e.shaderProcessingContext.textureNames){const I=(p=(d=(f=i.textures[x])==null?void 0:f.texture)==null?void 0:d.uniqueId)!=null?p:0;let T=n.values[I];T||(T=new _n,n.values[I]=T),n=T}s=n.bindGroups}if(t.resetIsDirty(i.updateId),i.isDirty=!1,s)return t.bindGroups=s,Ke._NumBindGroupsLookupCurrentFrame++,s;s=[],t.bindGroups=s,r||(n.bindGroups=s),Ke.NumBindGroupsCreatedTotal++,Ke._NumBindGroupsCreatedCurrentFrame++;const o=e.bindGroupLayouts[i.textureState];for(let x=0;x":z),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[b].resource=this._cacheSampler.getSampler(w,!1,C.hashCode,w.label)}else U.Error('Sampler "'.concat(M,'" could not be bound. entry=').concat(JSON.stringify(S),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(S.texture||S.storageTexture){const C=i.textures[M];if(C){if(this._engine.dbgSanityChecks&&C.texture===null){U.Error("Trying to bind a null texture! entry=".concat(JSON.stringify(S),", bindingInfo=").concat(JSON.stringify(C,(P,z)=>P==="texture"?"":z),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=C.texture._hardwareTexture;if(this._engine.dbgSanityChecks&&(!w||S.texture&&!w.view||S.storageTexture&&!w.viewForWriting)){U.Error("Trying to bind a null gpu texture or view! entry=".concat(JSON.stringify(S),", name=").concat(M,", bindingInfo=").concat(JSON.stringify(C,(P,z)=>P==="texture"?"":z),", isReady=").concat((_=C.texture)==null?void 0:_.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[b].resource=S.storageTexture?w.viewForWriting:w.view}else U.Error('Texture "'.concat(M,'" could not be bound. entry=').concat(JSON.stringify(S),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(S.externalTexture){const C=i.textures[M];if(C){if(this._engine.dbgSanityChecks&&C.texture===null){U.Error("Trying to bind a null external texture! entry=".concat(JSON.stringify(S),", name=").concat(M,", bindingInfo=").concat(JSON.stringify(C,(P,z)=>P==="texture"?"":z),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=C.texture.underlyingResource;if(this._engine.dbgSanityChecks&&!w){U.Error("Trying to bind a null gpu external texture! entry=".concat(JSON.stringify(S),", name=").concat(M,", bindingInfo=").concat(JSON.stringify(C,(P,z)=>P==="texture"?"":z),", isReady=").concat((m=C.texture)==null?void 0:m.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[b].resource=this._device.importExternalTexture({source:w})}else U.Error('Texture "'.concat(M,'" could not be bound. entry=').concat(JSON.stringify(S),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(S.buffer){const C=t.buffers[M];if(C){const w=C.underlyingResource;T[b].resource.buffer=w,T[b].resource.size=C.capacity}else U.Error("Can't find buffer \"".concat(M,'". entry=').concat(JSON.stringify(S),", buffers=").concat(JSON.stringify(t.buffers),", drawContext.uniqueId=").concat(t.uniqueId),50)}}const y=o[x];s[x]=this._device.createBindGroup({layout:y,entries:T})}return s}}Ke.NumBindGroupsCreatedTotal=0;Ke.NumBindGroupsCreatedLastFrame=0;Ke.NumBindGroupsLookupLastFrame=0;Ke.NumBindGroupsNoLookupLastFrame=0;Ke._Cache=new _n;Ke._NumBindGroupsCreatedCurrentFrame=0;Ke._NumBindGroupsLookupCurrentFrame=0;Ke._NumBindGroupsNoLookupCurrentFrame=0;const x_="clearQuadVertexShader",b_="uniform depthValue: f32;const pos=array(\nvec2f(-1.0,1.0),\nvec2f(1.0,1.0),\nvec2f(-1.0,-1.0),\nvec2f(1.0,-1.0)\n);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";K.ShadersStoreWGSL[x_]=b_;const y_="clearQuadPixelShader",T_="uniform color: vec4f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;}\n";K.ShadersStoreWGSL[y_]=T_;class S_{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 Mi(this._device,i),this._cacheRenderPipeline.setDepthTestEnabled(!1),this._cacheRenderPipeline.setStencilReadMask(255),this._effect=t.createEffect("clearQuad",[],["color","depthValue"],void 0,void 0,void 0,void 0,void 0,void 0,1)}clear(e,t,i,s,n=1){var _,m;let r,o=null,l;const h=!!this._engine._currentRenderTarget;if(e)r=e;else{let x=0;this._keyTemp.length=0;for(let T=0;T1?2**36:0)+I*2**37,l=this._keyTemp.join("_"),o=this._bundleCache[l],o)return o;r=this._device.createRenderBundleEncoder({label:"clearQuadRenderBundle",colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:Ve.GetSample(n)})}this._cacheRenderPipeline.setDepthWriteEnabled(!!i),this._cacheRenderPipeline.setStencilEnabled(!!s&&!!this._depthTextureFormat&&Ve.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 c=this._cacheRenderPipeline.getRenderPipeline(7,this._effect,n),u=this._effect._pipelineContext;t&&this._effect.setDirectColor4("color",t),this._effect.setFloat("depthValue",this._engine.useReverseDepthBuffer?this._engine._clearReverseDepthValue:this._engine._clearDepthValue),u.uniformBuffer.update();const f=h?this._engine._ubInvertY:this._engine._ubDontInvertY,d=u.uniformBuffer.getBuffer(),p=d.uniqueId+"-"+f.uniqueId;let g=this._bindGroups[p];if(!g){const x=u.bindGroupLayouts[0];g=this._bindGroups[p]=[],g.push(this._device.createBindGroup({label:"clearQuadBindGroup0-".concat(p),layout:x[0],entries:[]})),ii._SimplifiedKnownBindings||g.push(this._device.createBindGroup({label:"clearQuadBindGroup1-".concat(p),layout:x[1],entries:[]})),g.push(this._device.createBindGroup({label:"clearQuadBindGroup".concat(ii._SimplifiedKnownBindings?1:2,"-").concat(p),layout:x[ii._SimplifiedKnownBindings?1:2],entries:[{binding:0,resource:{buffer:f.underlyingResource,size:f.capacity}},{binding:1,resource:{buffer:d.underlyingResource,size:d.capacity}}]}))}r.setPipeline(c);for(let x=0;x{const n=new BigUint64Array(i.getMappedRange()).slice();return i.unmap(),this._dstBuffers[this._dstBuffers.length]=i,n},n=>{if(this._engine.isDisposed||this._engine.uniqueId!==s)return null;throw n})}async readValue(e=0){const t=this._getBuffer(e,1);if(t===null)return null;const i=this._engine.uniqueId;return t.mapAsync(1).then(()=>{const s=new BigUint64Array(t.getMappedRange()),n=Number(s[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,n},s=>{if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw s})}async readTwoValuesAndSubtract(e=0){const t=this._getBuffer(e,2);if(t===null)return null;const i=this._engine.uniqueId;return t.mapAsync(1).then(()=>{const s=new BigUint64Array(t.getMappedRange()),n=Number(s[1]-s[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,n},s=>{if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw s})}dispose(){this._querySet.destroy(),this._bufferManager.releaseBuffer(this._queryBuffer);for(let e=0;e{t!==null&&t>=0&&(this._gpuFrameTimeCounter.fetchNewFrame(),this._gpuFrameTimeCounter.addCount(t,!0)),this._measureDurationState=0}))}startPass(e,t){this._enabled?this._measureDuration.startPass(e,t):e.timestampWrites=void 0}endPass(e,t){if(!this._enabled||!t)return;const i=this._engine.frameId;this._measureDuration.stopPass(e).then(s=>{t._addDuration(i,s!==null&&s>0?s:0)})}dispose(){var e;(e=this._measureDuration)==null||e.dispose()}}class I_{constructor(e,t,i,s=2,n){this._count=s,this._querySet=new Gh(e,s,"timestamp",t,i,!0,n)}start(e){var t;(t=e.writeTimestamp)==null||t.call(e,this._querySet.querySet,0)}async stop(e){var t;return(t=e.writeTimestamp)==null||t.call(e,this._querySet.querySet,1),e.writeTimestamp?this._querySet.readTwoValuesAndSubtract(0):0}startPass(e,t){if(t+3>this._count)throw new Error("WebGPUDurationMeasure: index out of range ("+t+")");e.timestampWrites={querySet:this._querySet.querySet,beginningOfPassWriteIndex:t+2,endOfPassWriteIndex:t+3}}async stopPass(e){return this._querySet.readTwoValuesAndSubtract(e+2)}dispose(){this._querySet.dispose()}}class A_{get querySet(){return this._querySet.querySet}get hasQueries(){return this._currentTotalIndices!==this._availableIndices.length}canBeginQuery(e){if(this._frameQuerySetIsDirty===this._engine.frameId||this._queryFrameId[e]===this._engine.frameId)return!1;const t=this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet!==void 0;return t&&(this._queryFrameId[e]=this._engine.frameId),t}constructor(e,t,i,s=50,n=100){this._availableIndices=[],this._frameQuerySetIsDirty=-1,this._queryFrameId=[],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]=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.dispose(),this._availableIndices.length=0}}class wr{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&&U.Log("Start inlining process (code size=".concat(this._sourceCode.length,")...")),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&U.Log("End of inlining process.")}_collectFunctions(){let e=0;for(;e=0&&d.push(m.substring(x+1))}n!=="void"&&d.push("return"),this._functionDescr.push({name:r,type:n,parameters:d,body:u,callIndex:0}),e=c+1;const p=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 ea(e.charAt(c-1))||ea(e.charAt(c+r))?t[s]:o})}return e}}wr._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/;class ti{async initTwgsl(e){if(!ti._Twgsl)return e=e||{},e={...ti._TWgslDefaultOptions,...e},e.twgsl?(ti._Twgsl=e.twgsl,Promise.resolve()):(e.jsPath&&e.wasmPath&&await ee.LoadBabylonScriptAsync(e.jsPath),self.twgsl?(ti._Twgsl=await self.twgsl(ee.GetBabylonScriptURL(e.wasmPath)),Promise.resolve()):Promise.reject("twgsl is not available."))}convertSpirV2WGSL(e,t=!1){const i=ti._Twgsl.convertSpirV2WGSL(e,ti.DisableUniformityAnalysis||t);return ti.ShowWGSLShaderCode&&(U.Log(i),U.Log("***********************************************")),ti.DisableUniformityAnalysis||t?"diagnostic(off, derivative_uniformity);\n"+i:i}}ti._TWgslDefaultOptions={jsPath:"".concat(ee._DefaultCdnUrl,"/twgsl/twgsl.js"),wasmPath:"".concat(ee._DefaultCdnUrl,"/twgsl/twgsl.wasm")};ti.ShowWGSLShaderCode=!1;ti.DisableUniformityAnalysis=!1;ti._Twgsl=null;class C_{constructor(e,t,i){this._record=!1,this._play=!1,this._playBundleListIndex=0,this._allBundleLists=[],this._enabled=!1,this._engine=e,this._mode=t,this._bundleList=i}get enabled(){return this._enabled}get play(){return this._play}get record(){return this._record}set enabled(e){this._allBundleLists.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}endRenderPass(e){if(!this._record&&!this._play)return!1;let t;if(this._record)t=this._bundleList.clone(),this._allBundleLists.push(t),this._bundleList.reset();else{if(this._playBundleListIndex>=this._allBundleLists.length)throw new Error("Invalid playBundleListIndex! Your snapshot is no longer valid for the current frame, you should recreate a new one. playBundleListIndex=".concat(this._playBundleListIndex,", allBundleLists.length=").concat(this._allBundleLists.length,"}"));t=this._allBundleLists[this._playBundleListIndex++]}return t.run(e),this._mode===1&&this._engine._reportDrawCall(t.numDrawCalls),!0}endFrame(){this._record&&(this._record=!1,this._play=!0,this._mode=this._modeSaved),this._playBundleListIndex=0}reset(){this.enabled=!1,this.enabled=!0}}const dn=(()=>{const a=new Uint8Array(4),e=new Uint32Array(a.buffer);return!!((e[0]=1)&a[0])})();Object.defineProperty(E.prototype,"effectiveByteStride",{get:function(){return this._alignedBuffer&&this._alignedBuffer.byteStride||this.byteStride},enumerable:!0,configurable:!0});Object.defineProperty(E.prototype,"effectiveByteOffset",{get:function(){return this._alignedBuffer?0:this.byteOffset},enumerable:!0,configurable:!0});Object.defineProperty(E.prototype,"effectiveBuffer",{get:function(){return this._alignedBuffer&&this._alignedBuffer.getBuffer()||this._buffer.getBuffer()},enumerable:!0,configurable:!0});E.prototype._rebuild=function(){var a,e;(a=this._buffer)==null||a._rebuild(),(e=this._alignedBuffer)==null||e._rebuild()};E.prototype.dispose=function(){var a;this._ownsBuffer&&this._buffer.dispose(),(a=this._alignedBuffer)==null||a.dispose(),this._alignedBuffer=void 0,this._isDisposed=!0};E.prototype.getWrapperBuffer=function(){return this._alignedBuffer||this._buffer};E.prototype._alignBuffer=function(){var u,f;const a=this._buffer.getData();if(!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes||this.byteStride%4===0&&this.byteOffset%4===0||!a)return;const e=E.GetTypeByteLength(this.type),t=this.byteStride+3&-4,i=t/e,s=this._maxVerticesCount,r=s*t/e;let o;if(Array.isArray(a)){const d=new Float32Array(a);o=new DataView(d.buffer,d.byteOffset,d.byteLength)}else a instanceof ArrayBuffer?o=new DataView(a,0,a.byteLength):o=new DataView(a.buffer,a.byteOffset,a.byteLength);let l;this.type===E.BYTE?l=new Int8Array(r):this.type===E.UNSIGNED_BYTE?l=new Uint8Array(r):this.type===E.SHORT?l=new Int16Array(r):this.type===E.UNSIGNED_SHORT?l=new Uint16Array(r):this.type===E.INT?l=new Int32Array(r):this.type===E.UNSIGNED_INT?l=new Uint32Array(r):l=new Float32Array(r);const h=this.getSize();let c=this.byteOffset;for(let d=0;d1,a=>a.y,a=>a.z,a=>a.x,a=>a.x*a.y,a=>a.y*a.z,a=>3*a.z*a.z-1,a=>a.x*a.z,a=>a.x*a.x-a.y*a.y],$i=(a,e)=>ki[a]*P_[a](e),ji=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class _r{constructor(){this.preScaled=!1,this.l00=v.Zero(),this.l1_1=v.Zero(),this.l10=v.Zero(),this.l11=v.Zero(),this.l2_2=v.Zero(),this.l2_1=v.Zero(),this.l20=v.Zero(),this.l21=v.Zero(),this.l22=v.Zero()}addLight(e,t,i){N.Vector3[0].set(t.r,t.g,t.b);const s=N.Vector3[0],n=N.Vector3[1];s.scaleToRef(i,n),n.scaleToRef($i(0,e),N.Vector3[2]),this.l00.addInPlace(N.Vector3[2]),n.scaleToRef($i(1,e),N.Vector3[2]),this.l1_1.addInPlace(N.Vector3[2]),n.scaleToRef($i(2,e),N.Vector3[2]),this.l10.addInPlace(N.Vector3[2]),n.scaleToRef($i(3,e),N.Vector3[2]),this.l11.addInPlace(N.Vector3[2]),n.scaleToRef($i(4,e),N.Vector3[2]),this.l2_2.addInPlace(N.Vector3[2]),n.scaleToRef($i(5,e),N.Vector3[2]),this.l2_1.addInPlace(N.Vector3[2]),n.scaleToRef($i(6,e),N.Vector3[2]),this.l20.addInPlace(N.Vector3[2]),n.scaleToRef($i(7,e),N.Vector3[2]),this.l21.addInPlace(N.Vector3[2]),n.scaleToRef($i(8,e),N.Vector3[2]),this.l22.addInPlace(N.Vector3[2])}scaleInPlace(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){this.l00.scaleInPlace(ji[0]),this.l1_1.scaleInPlace(ji[1]),this.l10.scaleInPlace(ji[2]),this.l11.scaleInPlace(ji[3]),this.l2_2.scaleInPlace(ji[4]),this.l2_1.scaleInPlace(ji[5]),this.l20.scaleInPlace(ji[6]),this.l21.scaleInPlace(ji[7]),this.l22.scaleInPlace(ji[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(ki[0]),this.l1_1.scaleInPlace(ki[1]),this.l10.scaleInPlace(ki[2]),this.l11.scaleInPlace(ki[3]),this.l2_2.scaleInPlace(ki[4]),this.l2_1.scaleInPlace(ki[5]),this.l20.scaleInPlace(ki[6]),this.l21.scaleInPlace(ki[7]),this.l22.scaleInPlace(ki[8])}updateFromArray(e){return v.FromArrayToRef(e[0],0,this.l00),v.FromArrayToRef(e[1],0,this.l1_1),v.FromArrayToRef(e[2],0,this.l10),v.FromArrayToRef(e[3],0,this.l11),v.FromArrayToRef(e[4],0,this.l2_2),v.FromArrayToRef(e[5],0,this.l2_1),v.FromArrayToRef(e[6],0,this.l20),v.FromArrayToRef(e[7],0,this.l21),v.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return v.FromFloatsToRef(e[0],e[1],e[2],this.l00),v.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),v.FromFloatsToRef(e[6],e[7],e[8],this.l10),v.FromFloatsToRef(e[9],e[10],e[11],this.l11),v.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),v.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),v.FromFloatsToRef(e[18],e[19],e[20],this.l20),v.FromFloatsToRef(e[21],e[22],e[23],this.l21),v.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new _r().updateFromArray(e)}static FromPolynomial(e){const t=new _r;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class gr{constructor(){this.x=v.Zero(),this.y=v.Zero(),this.z=v.Zero(),this.xx=v.Zero(),this.yy=v.Zero(),this.zz=v.Zero(),this.xy=v.Zero(),this.yz=v.Zero(),this.zx=v.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=_r.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){N.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=N.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),N.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),N.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(N.Vector3[0]).addInPlace(N.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(N.Vector3[0]).subtractInPlace(N.Vector3[1]),this.zz.copyFrom(e.l00),N.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(N.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return new gr().updateFromHarmonics(e)}static FromArray(e){const t=new gr;return v.FromArrayToRef(e[0],0,t.x),v.FromArrayToRef(e[1],0,t.y),v.FromArrayToRef(e[2],0,t.z),v.FromArrayToRef(e[3],0,t.xx),v.FromArrayToRef(e[4],0,t.yy),v.FromArrayToRef(e[5],0,t.zz),v.FromArrayToRef(e[6],0,t.yz),v.FromArrayToRef(e[7],0,t.zx),v.FromArrayToRef(e[8],0,t.xy),t}}class w_ extends Vh{constructor(e){super(e)}}const Q0={label:"TextureView_SwapChain_ResolveTarget",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},J0={label:"TextureView_SwapChain",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},D_=new X;class Se extends me{get snapshotRenderingMode(){return this._snapshotRendering.mode}set snapshotRenderingMode(e){this._snapshotRendering.mode=e}snapshotRenderingReset(){this._snapshotRendering.reset()}get snapshotRendering(){return this._snapshotRendering.enabled}set snapshotRendering(e){this._snapshotRendering.enabled=e}get disableCacheSamplers(){return this._cacheSampler?this._cacheSampler.disabled:!1}set disableCacheSamplers(e){this._cacheSampler&&(this._cacheSampler.disabled=e)}get disableCacheRenderPipelines(){return this._cacheRenderPipeline?this._cacheRenderPipeline.disabled:!1}set disableCacheRenderPipelines(e){this._cacheRenderPipeline&&(this._cacheRenderPipeline.disabled=e)}get disableCacheBindGroups(){return this._cacheBindGroups?this._cacheBindGroups.disabled:!1}set disableCacheBindGroups(e){this._cacheBindGroups&&(this._cacheBindGroups.disabled=e)}areAllEffectsReady(){return!0}getFontOffset(e){return vh(e)}static get IsSupportedAsync(){return navigator.gpu?navigator.gpu.requestAdapter().then(e=>!!e,()=>!1).catch(()=>!1):Promise.resolve(!1)}static get IsSupported(){return U.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 enableGPUTimingMeasurements(){return this._timestampQuery.enable}set enableGPUTimingMeasurements(e){this._timestampQuery.enable!==e&&(this.gpuTimeInFrameForMainPass=e?new zh:void 0,this._timestampQuery.enable=e)}get currentSampleCount(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._mainPassSampleCount}static CreateAsync(e,t={}){const i=new Se(e,t);return new Promise(s=>{i.initAsync(t.glslangOptions,t.twgslOptions).then(()=>s(i))})}constructor(e,t={}){var i,s;if(super((i=t.antialias)!=null?i:!0,t),this.uniqueId=-1,this._uploadEncoderDescriptor={label:"upload"},this._renderEncoderDescriptor={label:"render"},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._timestampIndex=0,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.scenes=[],this._virtualScenes=new Array,this._commandBuffers=[null,null],this._currentRenderPass=null,this._mainRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._rttRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._pendingDebugCommands=[],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._snapshotRenderingMode=0,this.isNDCHalfZRange=!0,this.hasOriginBottomLeft=!1,this._viewportsCurrent={x:0,y:0,w:0,h:0},this._scissorsCurrent={x:0,y:0,w:0,h:0},this._scissorCached={x:0,y:0,z:0,w:0},this._stencilRefsCurrent=-1,this._blendColorsCurrent=[null,null,null,null],this._performanceMonitor=new _h,this._name="WebGPU",this._drawCalls=new ui,t.deviceDescriptor=t.deviceDescriptor||{},t.enableGPUDebugMarkers=(s=t.enableGPUDebugMarkers)!=null?s:!1,U.Log("Babylon.js v".concat(ie.Version," - ").concat(this.description," engine")),!navigator.gpu){U.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,navigator&&navigator.userAgent&&this._setupMobileChecks(),this._sharedInit(this._renderingCanvas),this._shaderProcessor=new ad,this._shaderProcessorWGSL=new Pp}initAsync(e,t){var i;return this.uniqueId=Se._InstanceId++,this._glslangOptions=e,this._twgslOptions=t,this._initGlslang(e!=null?e:(i=this._options)==null?void 0:i.glslangOptions).then(s=>{var n;return this._glslang=s,this._tintWASM=Se.UseTWGSL?new ti:null,this._tintWASM?this._tintWASM.initTwgsl(t!=null?t:(n=this._options)==null?void 0:n.twgslOptions).then(()=>navigator.gpu.requestAdapter(this._options)):navigator.gpu.requestAdapter(this._options)}).then(s=>{var n,r,o;if(s){this._adapter=s,this._adapterSupportedExtensions=[],(n=this._adapter.features)==null||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:{},h=(o=l==null?void 0:l.requiredFeatures)!=null?o:this._options.enableAllFeatures?this._adapterSupportedExtensions:void 0;if(h){const c=h,u=[];for(const f of c)this._adapterSupportedExtensions.indexOf(f)!==-1&&u.push(f);l.requiredFeatures=u}if(this._options.setMaximumLimits&&!l.requiredLimits){l.requiredLimits={};for(const c in this._adapterSupportedLimits)c==="minSubgroupSize"||c==="maxSubgroupSize"||(l.requiredLimits[c]=this._adapterSupportedLimits[c])}return l.label="BabylonWebGPUDevice".concat(this.uniqueId),this._adapter.requestDevice(l)}else throw"Could not retrieve a WebGPU adapter (adapter is null)."}).then(s=>{var r,o;this._device=s,this._deviceEnabledExtensions=[],(r=this._device.features)==null||r.forEach(l=>this._deviceEnabledExtensions.push(l)),this._deviceLimits=s.limits;let n=-1;this._device.addEventListener("uncapturederror",l=>{++n{this._isDisposed||(this._contextWasLost=!0,U.Warn("WebGPU context lost. "+l),this.onContextLostObservable.notifyObservers(this),this._restoreEngineAfterContextLost(async()=>{var g,_,m,x;const h=this.snapshotRenderingMode,c=this.snapshotRendering,u=this.disableCacheSamplers,f=this.disableCacheRenderPipelines,d=this.disableCacheBindGroups,p=this.enableGPUTimingMeasurements;await this.initAsync((_=this._glslangOptions)!=null?_:(g=this._options)==null?void 0:g.glslangOptions,(x=this._twgslOptions)!=null?x:(m=this._options)==null?void 0:m.twgslOptions),this.snapshotRenderingMode=h,this.snapshotRendering=c,this.disableCacheSamplers=u,this.disableCacheRenderPipelines=f,this.disableCacheBindGroups=d,this.enableGPUTimingMeasurements=p,this._currentRenderPass=null}))})}).then(()=>{this._bufferManager=new dr(this,this._device),this._textureHelper=new Gp(this,this._device,this._glslang,this._tintWASM,this._bufferManager,this._deviceEnabledExtensions),this._cacheSampler=new Ms(this._device),this._cacheBindGroups=new Ke(this._device,this._cacheSampler,this),this._timestampQuery=new E_(this,this._device,this._bufferManager),this._occlusionQuery=this._device.createQuerySet?new A_(this,this._device,this._bufferManager):void 0,this._bundleList=new ho(this._device),this._snapshotRendering=new C_(this,this._snapshotRenderingMode,this._bundleList),this._ubInvertY=this._bufferManager.createBuffer(new Float32Array([-1,0]),We.Uniform|We.CopyDst,"UBInvertY"),this._ubDontInvertY=this._bufferManager.createBuffer(new Float32Array([1,0]),We.Uniform|We.CopyDst,"UBDontInvertY"),this.dbgVerboseLogsForFirstFrames&&this._count===void 0&&(this._count=0,U.Log(["%c frame #"+this._count+" - begin","background: #ffff00"])),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._initializeLimits(),this._emptyVertexBuffer=new E(this,[0],"",{stride:1,offset:0,size:1,label:"EmptyVertexBuffer"}),this._cacheRenderPipeline=new Mi(this._device,this._emptyVertexBuffer),this._depthCullingState=new v_(this._cacheRenderPipeline),this._stencilStateComposer=new m_(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 S_(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=>{throw U.Error("A fatal error occurred during WebGPU creation/initialization."),s})}_initGlslang(e){return e=e||{},e={...Se._GLSLslangDefaultOptions,...e},e.glslang?Promise.resolve(e.glslang):self.glslang?self.glslang(e.wasmPath):e.jsPath&&e.wasmPath?ee.LoadBabylonScriptAsync(e.jsPath).then(()=>self.glslang(ee.GetBabylonScriptURL(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("texture-compression-astc")>=0?!0:void 0,s3tc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,pvrtc:null,etc1:null,etc2:this._deviceEnabledExtensions.indexOf("texture-compression-etc2")>=0?!0:void 0,bptc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!0,highPrecisionShaderSupported:!0,colorBufferFloat:!0,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:this._deviceEnabledExtensions.indexOf("rg11b10ufloat-renderable")>=0,textureFloat:!0,textureFloatLinearFiltering:this._deviceEnabledExtensions.indexOf("float32-filterable")>=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("timestamp-query")!==-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._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,forceVertexBufferStrideAndOffsetMultiple4Bytes:!0,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!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 ir],this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format=this._colorFormat,this._setColorFormat(this._mainRenderPassWrapper)}_initializeMainAttachments(){if(!this._bufferManager)return;this.flushFramebuffer(),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:"2d",format:this._options.swapChainFormat,usage:16};this._mainTexture&&this._textureHelper.releaseTexture(this._mainTexture),this._mainTexture=this._device.createTexture(n),t=[{view:this._mainTexture.createView({label:"TextureView_MainColor_antialiasing",dimension:"2d",format:this._options.swapChainFormat,mipLevelCount:1,arrayLayerCount:1}),clearValue:new X(0,0,0,1),loadOp:"clear",storeOp:"store"}]}else t=[{view:void 0,clearValue:new X(0,0,0,1),loadOp:"clear",storeOp:"store"}];this._mainRenderPassWrapper.depthTextureFormat=this.isStencilEnable?"depth24plus-stencil8":"depth32float",this._setDepthTextureFormat(this._mainRenderPassWrapper),this._setColorFormat(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:"2d",format:this._mainRenderPassWrapper.depthTextureFormat,usage:16};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:"2d",format:this._depthTexture.format,mipLevelCount:1,arrayLayerCount:1}),depthClearValue:this._clearDepthValue,depthLoadOp:"clear",depthStoreOp:"store",stencilClearValue:this._clearStencilValue,stencilLoadOp:this.isStencilEnable?"clear":void 0,stencilStoreOp:this.isStencilEnable?"store":void 0};this._mainRenderPassWrapper.renderPassDescriptor={label:"MainRenderPass",colorAttachments:t,depthStencilAttachment:s}}_sharedInit(e){super._sharedInit(e),gh(this,e,this._creationOptions)}_configureContext(){this._context.configure({device:this._device,format:this._options.swapChainFormat,usage:17,alphaMode:this.premultipliedAlpha?"premultiplied":"opaque"})}resizeImageBitmap(e,t,i){return bh(this,e,t,i)}_createImageBitmapFromSource(e,t){return xh(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&yh(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&Th()}enterPointerlock(){this._renderingCanvas&&Ka(this._renderingCanvas)}exitPointerlock(){Sh()}_rebuildBuffers(){super._rebuildBuffers();for(const e of this._storageBuffers)e.getBuffer().engineId!==this.uniqueId&&e._rebuild()}_restoreEngineAfterContextLost(e){Mi.ResetCache(),Ke.ResetCache();const t=s=>{var n;for(const r of s){for(const o of r.meshes){const l=o.subMeshes;if(l)for(const h of l)h._drawWrappers=[]}for(const o of r.materials)(n=o._materialContext)==null||n.reset()}};t(this.scenes),t(this._virtualScenes);const i=[];for(const s of this._uniformBuffers)s.name.indexOf("leftOver")<0&&i.push(s);this._uniformBuffers=i,super._restoreEngineAfterContextLost(e)}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("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,r=i===0?this._compileRawShaderToSpirV(e,"vertex"):e,o=i===0?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("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,r=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,o="#version 450\n",l=s===0?this._compileShaderToSpirV(e,"vertex",i,o):this._getWGSLShader(e,"vertex",i),h=s===0?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 wr(e);return t.debug=!1,t.processCode(),t.code}createPipelineContext(e){return new td(e,this)}createMaterialContext(){return new Rr}createDrawContext(){return new Pr(this._bufferManager)}_preparePipelineContext(e,t,i,s,n,r,o,l){const h=e,c=h.shaderProcessingContext.shaderLanguage;this.dbgShowShaderCode&&(U.Log(["defines",l]),U.Log(t),U.Log(i),U.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,r.is3D=h>0,r._cachedWrapU=0,r._cachedWrapV=0,r._useSRGBBuffer=n.useSRGBBuffer,r.label=n.label,this._internalTexturesCache.push(r),i||this._textureHelper.createGPUTextureForInternalTexture(r,o,l,c||1,n.creationFlags),r}createTexture(e,t,i,s,n=3,r=null,o=null,l=null,h=null,c=null,u=null,f,d,p,g){return this._createTextureBase(e,t,i,s,n,r,o,(_,m,x,I,T,y,b,S)=>{var M;const A=I;if(_.baseWidth=A.width,_.baseHeight=A.height,_.width=A.width,_.height=A.height,_.format=_.format!==-1?_.format:c!=null?c:5,_.type=_.type!==-1?_.type:0,_._creationFlags=p!=null?p:0,S(_.width,_.height,A,m,_,()=>{}),(M=_._hardwareTexture)!=null&&M.underlyingResource)!y&&!b&&this._generateMipmaps(_,this._uploadEncoder);else{const C=this._textureHelper.createGPUTextureForInternalTexture(_,A.width,A.height,void 0,p);Ve.IsImageBitmap(A)&&(this._textureHelper.updateTexture(A,_,A.width,A.height,_.depth,C.format,0,0,T,!1,0,0),!y&&!b&&this._generateMipmaps(_,this._uploadEncoder))}x&&x.removePendingData(_),_.isReady=!0,_.onLoadedObservable.notifyObservers(_),_.onLoadedObservable.clear()},()=>!1,l,h,c,u,f,d,g)}wrapWebGPUTexture(e){const t=new ir(e),i=new Et(this,0,!0);return i._hardwareTexture=t,i.isReady=!0,i}wrapWebGLTexture(){throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.")}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers}_unpackFlipY(e){}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+"Sampler";this._currentMaterialContext.setSampler(r,t)}}}createPrefilteredCubeTexture(e,t,i,s,n=null,r=null,o,l=null,h=!0){const c=u=>{if(!u){n&&n(null);return}const f=u.texture;h?u.info.sphericalPolynomial&&(f._sphericalPolynomial=u.info.sphericalPolynomial):f._sphericalPolynomial=new gr,f._source=9,n&&n(f)};return this.createCubeTexture(e,t,null,!1,c,r,o,l,h,i,s)}setTexture(e,t,i,s){this._setTexture(e,i,!1,!1,s,s)}setTextureArray(e,t,i,s){for(let n=0;n{const o=()=>{e.mapAsync(1,0,t).then(()=>{const l=e.getMappedRange(0,t);let h=i;if(h===void 0)h=new Uint8Array(t),h.set(new Uint8Array(l));else{const c=h.constructor;h=new c(h.buffer),h.set(new c(l))}e.unmap(),this._bufferManager.releaseBuffer(e),n(h)},l=>{this.isDisposed?n(new Uint8Array):r(l)})};s?(this.flushFramebuffer(),o()):this.onEndFrameObservable.addOnce(()=>{o()})})}readFromStorageBuffer(e,t,i,s,n){i=i||e.capacity;const r=this._bufferManager.createRawBuffer(i,We.MapRead|We.CopyDst,void 0,"TempReadFromStorageBuffer");return this._renderEncoder.copyBufferToBuffer(e.underlyingResource,t!=null?t:0,r,0,i),this._readFromGPUBuffer(r,i,s,n)}readFromMultipleStorageBuffers(e,t,i,s,n){i=i||e[0].capacity;const r=this._bufferManager.createRawBuffer(i*e.length,We.MapRead|We.CopyDst,void 0,"TempReadFromMultipleStorageBuffers");for(let o=0;othis.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 Xi{constructor(){this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[]}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=[];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}}Xi._BabylonFileParsers={};Xi._IndividualBabylonFileParsers={};ft("BABYLON.AbstractScene",Xi);function Wh(a){a.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}class ot{constructor(){this._dirty=!0,this._tempColor=new X(0,0,0,0),this._globalCurve=new X(0,0,0,0),this._highlightsCurve=new X(0,0,0,0),this._midtonesCurve=new X(0,0,0,0),this._shadowsCurve=new X(0,0,0,0),this._positiveCurve=new X(0,0,0,0),this._negativeCurve=new X(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(e){this._globalHue=e,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(e){this._globalDensity=e,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(e){this._globalSaturation=e,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(e){this._globalExposure=e,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(e){this._highlightsHue=e,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(e){this._highlightsDensity=e,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(e){this._highlightsSaturation=e,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(e){this._highlightsExposure=e,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(e){this._midtonesHue=e,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(e){this._midtonesDensity=e,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(e){this._midtonesSaturation=e,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(e){this._midtonesExposure=e,this._dirty=!0}get shadowsHue(){return this._shadowsHue}set shadowsHue(e){this._shadowsHue=e,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(e){this._shadowsDensity=e,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(e){this._shadowsSaturation=e,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(e){this._shadowsExposure=e,this._dirty=!0}getClassName(){return"ColorCurves"}static Bind(e,t,i="vCameraColorCurvePositive",s="vCameraColorCurveNeutral",n="vCameraColorCurveNegative"){e._dirty&&(e._dirty=!1,e._getColorGradingDataToRef(e._globalHue,e._globalDensity,e._globalSaturation,e._globalExposure,e._globalCurve),e._getColorGradingDataToRef(e._highlightsHue,e._highlightsDensity,e._highlightsSaturation,e._highlightsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._highlightsCurve),e._getColorGradingDataToRef(e._midtonesHue,e._midtonesDensity,e._midtonesSaturation,e._midtonesExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._midtonesCurve),e._getColorGradingDataToRef(e._shadowsHue,e._shadowsDensity,e._shadowsSaturation,e._shadowsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._shadowsCurve),e._highlightsCurve.subtractToRef(e._midtonesCurve,e._positiveCurve),e._midtonesCurve.subtractToRef(e._shadowsCurve,e._negativeCurve)),t&&(t.setFloat4(i,e._positiveCurve.r,e._positiveCurve.g,e._positiveCurve.b,e._positiveCurve.a),t.setFloat4(s,e._midtonesCurve.r,e._midtonesCurve.g,e._midtonesCurve.b,e._midtonesCurve.a),t.setFloat4(n,e._negativeCurve.r,e._negativeCurve.g,e._negativeCurve.b,e._negativeCurve.a))}_getColorGradingDataToRef(e,t,i,s,n){e!=null&&(e=ot._Clamp(e,0,360),t=ot._Clamp(t,-100,100),i=ot._Clamp(i,-100,100),s=ot._Clamp(s,-100,100),t=ot._ApplyColorGradingSliderNonlinear(t),t*=.5,s=ot._ApplyColorGradingSliderNonlinear(s),t<0&&(t*=-1,e=(e+180)%360),ot._FromHSBToRef(e,t,50+.25*s,n),n.scaleToRef(2,n),n.a=1+.01*i)}static _ApplyColorGradingSliderNonlinear(e){e/=100;let t=Math.abs(e);return t=Math.pow(t,2),e<0&&(t*=-1),t*=100,t}static _FromHSBToRef(e,t,i,s){let n=ot._Clamp(e,0,360);const r=ot._Clamp(t/100,0,1),o=ot._Clamp(i/100,0,1);if(r===0)s.r=o,s.g=o,s.b=o;else{n/=60;const l=Math.floor(n),h=n-l,c=o*(1-r),u=o*(1-r*h),f=o*(1-r*(1-h));switch(l){case 0:s.r=o,s.g=f,s.b=c;break;case 1:s.r=u,s.g=o,s.b=c;break;case 2:s.r=c,s.g=o,s.b=f;break;case 3:s.r=c,s.g=u,s.b=o;break;case 4:s.r=f,s.g=c,s.b=o;break;default:s.r=o,s.g=c,s.b=u;break}}s.a=1}static _Clamp(e,t,i){return Math.min(Math.max(e,t),i)}clone(){return Ae.Clone(()=>new ot,this)}serialize(){return Ae.Serialize(this)}static Parse(e){return Ae.Parse(()=>new ot,e,null,null)}}ot.PrepareUniforms=Wh;D([B()],ot.prototype,"_globalHue",void 0);D([B()],ot.prototype,"_globalDensity",void 0);D([B()],ot.prototype,"_globalSaturation",void 0);D([B()],ot.prototype,"_globalExposure",void 0);D([B()],ot.prototype,"_highlightsHue",void 0);D([B()],ot.prototype,"_highlightsDensity",void 0);D([B()],ot.prototype,"_highlightsSaturation",void 0);D([B()],ot.prototype,"_highlightsExposure",void 0);D([B()],ot.prototype,"_midtonesHue",void 0);D([B()],ot.prototype,"_midtonesDensity",void 0);D([B()],ot.prototype,"_midtonesSaturation",void 0);D([B()],ot.prototype,"_midtonesExposure",void 0);Ae._ColorCurvesParser=ot.Parse;function F_(a,e){e.EXPOSURE&&a.push("exposureLinear"),e.CONTRAST&&a.push("contrast"),e.COLORGRADING&&a.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&a.push("vInverseScreenSize"),e.VIGNETTE&&(a.push("vignetteSettings1"),a.push("vignetteSettings2")),e.COLORCURVES&&Wh(a),e.DITHER&&a.push("ditherIntensity")}function O_(a,e){e.COLORGRADING&&a.push("txColorTransform")}class Ue{constructor(){this.colorCurves=new ot,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=Ue.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCenterX=0,this.vignetteCenterY=0,this.vignetteWeight=1.5,this.vignetteColor=new X(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=Ue.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._ditheringEnabled=!1,this._ditheringIntensity=1/255,this._skipFinalColorClamp=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.onUpdateParameters=new Q}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"}prepareDefines(e,t=!1){if(t!==this.applyByPostProcess||!this._isEnabled){e.VIGNETTE=!1,e.TONEMAPPING=0,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}if(e.VIGNETTE=this.vignetteEnabled,e.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===Ue._VIGNETTEMODE_MULTIPLY,e.VIGNETTEBLENDMODEOPAQUE=!e.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)e.TONEMAPPING=0;else switch(this._toneMappingType){case Ue.TONEMAPPING_KHR_PBR_NEUTRAL:e.TONEMAPPING=3;break;case Ue.TONEMAPPING_ACES:e.TONEMAPPING=2;break;default:e.TONEMAPPING=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&&ot.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=da(o,l,this.vignetteStretch),r=da(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 Ae.Clone(()=>new Ue,this)}serialize(){return Ae.Serialize(this)}static Parse(e){const t=Ae.Parse(()=>new Ue,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}}Ue.TONEMAPPING_STANDARD=0;Ue.TONEMAPPING_ACES=1;Ue.TONEMAPPING_KHR_PBR_NEUTRAL=2;Ue.PrepareUniforms=F_;Ue.PrepareSamplers=O_;Ue._VIGNETTEMODE_MULTIPLY=0;Ue._VIGNETTEMODE_OPAQUE=1;D([Hp()],Ue.prototype,"colorCurves",void 0);D([B()],Ue.prototype,"_colorCurvesEnabled",void 0);D([pi("colorGradingTexture")],Ue.prototype,"_colorGradingTexture",void 0);D([B()],Ue.prototype,"_colorGradingEnabled",void 0);D([B()],Ue.prototype,"_colorGradingWithGreenDepth",void 0);D([B()],Ue.prototype,"_colorGradingBGR",void 0);D([B()],Ue.prototype,"_exposure",void 0);D([B()],Ue.prototype,"_toneMappingEnabled",void 0);D([B()],Ue.prototype,"_toneMappingType",void 0);D([B()],Ue.prototype,"_contrast",void 0);D([B()],Ue.prototype,"vignetteStretch",void 0);D([B()],Ue.prototype,"vignetteCenterX",void 0);D([B()],Ue.prototype,"vignetteCenterY",void 0);D([B()],Ue.prototype,"vignetteWeight",void 0);D([to()],Ue.prototype,"vignetteColor",void 0);D([B()],Ue.prototype,"vignetteCameraFov",void 0);D([B()],Ue.prototype,"_vignetteBlendMode",void 0);D([B()],Ue.prototype,"_vignetteEnabled",void 0);D([B()],Ue.prototype,"_ditheringEnabled",void 0);D([B()],Ue.prototype,"_ditheringIntensity",void 0);D([B()],Ue.prototype,"_skipFinalColorClamp",void 0);D([B()],Ue.prototype,"_applyByPostProcess",void 0);D([B()],Ue.prototype,"_isEnabled",void 0);Ae._ImageProcessingConfigurationParser=Ue.Parse;ft("BABYLON.ImageProcessingConfiguration",Ue);class ns{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(E.NormalKind))return null;let i=this.pickedMesh.getIndices();(i==null?void 0:i.length)===0&&(i=null);let s;const n=N.Vector3[0],r=N.Vector3[1],o=N.Vector3[2];if(t){const h=this.pickedMesh.getVerticesData(E.NormalKind);let c=i?v.FromArrayToRef(h,i[this.faceId*3]*3,n):n.copyFromFloats(h[this.faceId*3*3],h[this.faceId*3*3+1],h[this.faceId*3*3+2]),u=i?v.FromArrayToRef(h,i[this.faceId*3+1]*3,r):r.copyFromFloats(h[(this.faceId*3+1)*3],h[(this.faceId*3+1)*3+1],h[(this.faceId*3+1)*3+2]),f=i?v.FromArrayToRef(h,i[this.faceId*3+2]*3,o):o.copyFromFloats(h[(this.faceId*3+2)*3],h[(this.faceId*3+2)*3+1],h[(this.faceId*3+2)*3+2]);c=c.scale(this.bu),u=u.scale(this.bv),f=f.scale(1-this.bu-this.bv),s=new v(c.x+u.x+f.x,c.y+u.y+f.y,c.z+u.z+f.z)}else{const h=this.pickedMesh.getVerticesData(E.PositionKind),c=i?v.FromArrayToRef(h,i[this.faceId*3]*3,n):n.copyFromFloats(h[this.faceId*3*3],h[this.faceId*3*3+1],h[this.faceId*3*3+2]),u=i?v.FromArrayToRef(h,i[this.faceId*3+1]*3,r):r.copyFromFloats(h[(this.faceId*3+1)*3],h[(this.faceId*3+1)*3+1],h[(this.faceId*3+1)*3+2]),f=i?v.FromArrayToRef(h,i[this.faceId*3+2]*3,o):o.copyFromFloats(h[(this.faceId*3+2)*3],h[(this.faceId*3+2)*3+1],h[(this.faceId*3+2)*3+2]),d=c.subtract(u),p=f.subtract(u);s=v.Cross(d,p)}const l=(h,c)=>{let u=h.getWorldMatrix();h.nonUniformScaling&&(N.Matrix[0].copyFrom(u),u=N.Matrix[0],u.setTranslationFromFloats(0,0,0),u.invert(),u.transposeToRef(N.Matrix[1]),u=N.Matrix[1]),v.TransformNormalToRef(c,u,c)};if(e&&l(this.pickedMesh,s),this.ray){const h=N.Vector3[0].copyFrom(s);e||l(this.pickedMesh,h),v.Dot(h,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=E.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 Dt{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 Dt(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Dt(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Dt(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Dt(e,t.x,t.y,null,i,s)}}class be{}be.NAME_EFFECTLAYER="EffectLayer";be.NAME_LAYER="Layer";be.NAME_LENSFLARESYSTEM="LensFlareSystem";be.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";be.NAME_PARTICLESYSTEM="ParticleSystem";be.NAME_GAMEPAD="Gamepad";be.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";be.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";be.NAME_PREPASSRENDERER="PrePassRenderer";be.NAME_DEPTHRENDERER="DepthRenderer";be.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";be.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";be.NAME_SPRITE="Sprite";be.NAME_SUBSURFACE="SubSurface";be.NAME_OUTLINERENDERER="Outline";be.NAME_PROCEDURALTEXTURE="ProceduralTexture";be.NAME_SHADOWGENERATOR="ShadowGenerator";be.NAME_OCTREE="Octree";be.NAME_PHYSICSENGINE="PhysicsEngine";be.NAME_AUDIO="Audio";be.NAME_FLUIDRENDERER="FluidRenderer";be.STEP_ISREADYFORMESH_EFFECTLAYER=0;be.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;be.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;be.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;be.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;be.STEP_BEFORECAMERADRAW_PREPASS=0;be.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;be.STEP_BEFORECAMERADRAW_LAYER=2;be.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;be.STEP_BEFORERENDERTARGETDRAW_LAYER=1;be.STEP_BEFORERENDERINGMESH_PREPASS=0;be.STEP_BEFORERENDERINGMESH_OUTLINE=1;be.STEP_AFTERRENDERINGMESH_PREPASS=0;be.STEP_AFTERRENDERINGMESH_OUTLINE=1;be.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;be.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;be.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;be.STEP_BEFORECAMERAUPDATE_GAMEPAD=1;be.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;be.STEP_BEFORECLEAR_PREPASS=1;be.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;be.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;be.STEP_AFTERRENDERTARGETDRAW_LAYER=1;be.STEP_AFTERCAMERADRAW_PREPASS=0;be.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;be.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;be.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;be.STEP_AFTERCAMERADRAW_LAYER=4;be.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;be.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;be.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;be.STEP_AFTERRENDER_AUDIO=0;be.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;be.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;be.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;be.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;be.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;be.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;be.STEP_POINTERMOVE_SPRITE=0;be.STEP_POINTERDOWN_SPRITE=0;be.STEP_POINTERUP_SPRITE=0;class pt extends Array{constructor(e){super(...e)}static Create(){return Object.create(pt.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 hi.Triggers)if(Object.prototype.hasOwnProperty.call(hi.Triggers,t)&&parseInt(t)===e)return!0;return!1}}hi.Triggers={};class Cn{}Cn.KEYDOWN=1;Cn.KEYUP=2;class ya{constructor(e,t){this.type=e,this.event=t}}class tl extends ya{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 ge;(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"})(ge||(ge={}));var ye;(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"})(ye||(ye={}));var il;(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"})(il||(il={}));var sl;(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"})(sl||(sl={}));var nl;(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"})(nl||(nl={}));var rl;(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"})(rl||(rl={}));var al;(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"})(al||(al={}));var ol;(function(a){a[a.PointerMove=0]="PointerMove",a[a.PointerDown=1]="PointerDown",a[a.PointerUp=2]="PointerUp"})(ol||(ol={}));class Nn{}Nn.DOM_DELTA_PIXEL=0;Nn.DOM_DELTA_LINE=1;Nn.DOM_DELTA_PAGE=2;class As{static CreateDeviceEvent(e,t,i,s,n,r,o){switch(e){case ge.Keyboard:return this._CreateKeyboardEvent(i,s,n,r);case ge.Mouse:if(i===ye.MouseWheelX||i===ye.MouseWheelY||i===ye.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,n,r);case ge.Touch:return this._CreatePointerEvent(e,t,i,s,n,r,o);default:throw"Unable to generate event for device ".concat(ge[e])}}static _CreatePointerEvent(e,t,i,s,n,r,o){const l=this._CreateMouseEvent(e,t,i,s,n,r);e===ge.Mouse?(l.deviceType=ge.Mouse,l.pointerId=1,l.pointerType="mouse"):(l.deviceType=ge.Touch,l.pointerId=o!=null?o:t,l.pointerType="touch");let h=0;return h+=n.pollInput(e,t,ye.LeftClick),h+=n.pollInput(e,t,ye.RightClick)*2,h+=n.pollInput(e,t,ye.MiddleClick)*4,l.buttons=h,i===ye.Move?l.type="pointermove":i>=ye.LeftClick&&i<=ye.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=Nn.DOM_DELTA_PIXEL,o.deltaX=0,o.deltaY=0,o.deltaZ=0,i){case ye.MouseWheelX:o.deltaX=s;break;case ye.MouseWheelY:o.deltaY=s;break;case ye.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,ye.Horizontal),h=n.pollInput(e,t,ye.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,10),o.movementY=n.pollInput(e,t,11),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=ge.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(ge.Keyboard),s=i&&t.pollInput(ge.Keyboard,0,18)===1,n=i&&t.pollInput(ge.Keyboard,0,17)===1,r=i&&(t.pollInput(ge.Keyboard,0,91)===1||t.pollInput(ge.Keyboard,0,92)===1||t.pollInput(ge.Keyboard,0,93)===1),o=i&&t.pollInput(ge.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 B_{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,n,r,o)=>{const l=As.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===ge.Mouse||e===ge.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const ll=255,hl=Object.keys(ye).length/2;class N_{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=ee.IsSafari(),this._usingMacOS=Xs()&&/(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._pointerMacOSChromeOutEvent=n=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=Xs()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=Xs()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=n=>{},this._gamepadDisconnectedEvent=n=>{},this._eventPrefix=ee.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(ge[e]);e>=ge.DualShock&&e<=ge.DualSense&&this._updateDevice(e,t,i);const n=s[i];if(n===void 0)throw"Unable to find input ".concat(i," for device ").concat(ge[e]," in slot ").concat(t);return i===ye.Move&&ee.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?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(ge.Keyboard,0,ll));const t=this._inputs[ge.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(ge.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(ge.Keyboard,0,ll));const t=this._inputs[ge.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=As.CreateDeviceEvent(ge.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(ge.Keyboard,0,n)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(ge.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[ge.Keyboard][0];for(let t=0;t{const s=this._getPointerType(i);let n=s===ge.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===ge.Touch&&n===-1){const o=this._activeTouchIds.indexOf(-1);if(o>=0)n=o,this._activeTouchIds[o]=i.pointerId,this._onDeviceConnected(s,n);else{ee.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]||this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=i;o.inputIndex=ye.Move,r[ye.Horizontal]=i.clientX,r[ye.Vertical]=i.clientY,s===ge.Touch&&r[ye.LeftClick]===0&&(r[ye.LeftClick]=1),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===ge.Mouse?0:i.pointerId;if(s===ge.Touch){let o=this._activeTouchIds.indexOf(i.pointerId);if(o===-1&&(o=this._activeTouchIds.indexOf(-1)),o>=0)n=o,this._activeTouchIds[o]=i.pointerId;else{ee.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===ge.Touch&&this._onDeviceConnected(s,n):this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=r[ye.Horizontal],l=r[ye.Vertical];if(s===ge.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[ye.Horizontal]=i.clientX,r[ye.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=ye.Move,this._onInputChanged(s,n,h))}},this._pointerUpEvent=i=>{var o,l,h,c,u;const s=this._getPointerType(i),n=s===ge.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===ge.Touch){if(n===-1)return;this._activeTouchIds[n]=-1}const r=(o=this._inputs[s])==null?void 0:o[n];if(r&&r[i.button+2]!==0){const f=r[ye.Horizontal],d=r[ye.Vertical];r[ye.Horizontal]=i.clientX,r[ye.Vertical]=i.clientY,r[i.button+2]=0;const p=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(f!==i.clientX||d!==i.clientY)&&(p.inputIndex=ye.Move,this._onInputChanged(s,n,p)),p.inputIndex=i.button+2,s===ge.Mouse&&this._mouseId>=0&&((h=(l=this._elementToAttachTo).hasPointerCapture)!=null&&h.call(l,this._mouseId))?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&((u=(c=this._elementToAttachTo).hasPointerCapture)!=null&&u.call(c,i.pointerId))&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(s,n,p),s===ge.Touch&&this._onDeviceDisconnected(s,n)}},this._pointerCancelEvent=i=>{var s,n,r,o;if(i.pointerType==="mouse"){const l=this._inputs[ge.Mouse][0];this._mouseId>=0&&((n=(s=this._elementToAttachTo).hasPointerCapture)!=null&&n.call(s,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let h=ye.LeftClick;h<=ye.BrowserForward;h++)if(l[h]===1){l[h]=0;const c=As.CreateDeviceEvent(ge.Mouse,0,h,0,this,this._elementToAttachTo);this._onInputChanged(ge.Mouse,0,c)}}else{const l=this._activeTouchIds.indexOf(i.pointerId);if(l===-1)return;(o=(r=this._elementToAttachTo).hasPointerCapture)!=null&&o.call(r,i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._inputs[ge.Touch][l][ye.LeftClick]=0;const h=As.CreateDeviceEvent(ge.Touch,l,ye.LeftClick,0,this,this._elementToAttachTo,i.pointerId);this._onInputChanged(ge.Touch,l,h),this._activeTouchIds[l]=-1,this._onDeviceDisconnected(ge.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(ge.Mouse)){const l=this._inputs[ge.Mouse][0];this._mouseId>=0&&((s=(i=this._elementToAttachTo).hasPointerCapture)!=null&&s.call(i,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let h=ye.LeftClick;h<=ye.BrowserForward;h++)if(l[h]===1){l[h]=0;const c=As.CreateDeviceEvent(ge.Mouse,0,h,0,this,this._elementToAttachTo);this._onInputChanged(ge.Mouse,0,c)}}if(this.isDeviceAvailable(ge.Touch)){const l=this._inputs[ge.Touch];for(let h=0;h{const s=ge.Mouse,n=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][n]||(this._pointerActive=!0,this._registerDevice(s,n,hl));const r=this._inputs[s][n];if(r){r[ye.MouseWheelX]=i.deltaX||0,r[ye.MouseWheelY]=i.deltaY||i.wheelDelta||0,r[ye.MouseWheelZ]=i.deltaZ||0;const o=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),r[ye.MouseWheelX]!==0&&(o.inputIndex=ye.MouseWheelX,this._onInputChanged(s,n,o)),r[ye.MouseWheelY]!==0&&(o.inputIndex=ye.MouseWheelY,this._onInputChanged(s,n,o)),r[ye.MouseWheelZ]!==0&&(o.inputIndex=ye.MouseWheelZ,this._onInputChanged(s,n,o))}},this._usingMacOS&&this._isUsingChromium&&(this._pointerMacOSChromeOutEvent=i=>{i.buttons>1&&this._pointerCancelEvent(i)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOSChromeOutEvent)),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(ge.Mouse)){const i=this._inputs[ge.Mouse][0];i[ye.MouseWheelX]=0,i[ye.MouseWheelY]=0,i[ye.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?ge.DualSense:ge.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1?ge.Xbox:e.indexOf("057e")!==-1?ge.Switch:ge.Generic}_getPointerType(e){let t=ge.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=ge.Touch),t}}class cl{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new Q,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class U_{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(ge).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 cl(this._deviceInputSystem,r,o);l._addDevice(h)}},s=(r,o)=>{var l;(l=this._devices[r])!=null&&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 B_(i,s,n):this._deviceInputSystem=new N_(e,i,s,n)}dispose(){this._deviceInputSystem.dispose()}}class k_{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(ge).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new U_(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new Q(i=>{for(const s of this._devices)if(s)for(const n of s)n&&this.onDeviceConnectedObservable.notifyObserver(i,n)}),this.onDeviceDisconnectedObservable=new Q,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 s,n;const i=(s=this._devices[e])==null?void 0:s[t];this.onDeviceDisconnectedObservable.notifyObservers(i),(n=this._devices[e])!=null&&n[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){var s,n;(n=(s=this._devices[e])==null?void 0:s[t])==null||n.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case ge.Keyboard:case ge.Mouse:this._firstDevice[e]=0;break;case ge.Touch:case ge.DualSense:case ge.DualShock:case ge.Xbox:case ge.Switch:case ge.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i=ye.MouseWheelX&&t.inputIndex<=ye.MouseWheelZ?Re.POINTERWHEEL:Re.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,r));let o;e?(o=new Zi(r,t,e),this._setRayOnPointerInfo(e,t)):(o=new Zi(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,O.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 L_(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.originalPickingInfo=e,n.ray=e.ray,t.pointerType==="xr-near"&&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,t.pointerMoveFastCheck,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=ye.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,Dt.CreateNew(e.pickedMesh,t,e)),t.button){case 0:r.processTrigger(2,Dt.CreateNew(e.pickedMesh,t,e));break;case 1:r.processTrigger(4,Dt.CreateNew(e.pickedMesh,t,e));break;case 2:r.processTrigger(3,Dt.CreateNew(e.pickedMesh,t,e));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>_t.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,r.processTrigger(8,Dt.CreateNew(o.pickedMesh,t)))},_t.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 Zi(n,t,e),this._setRayOnPointerInfo(e,t)):s=new Zi(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=ye.Move;const n=new ul;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 Zi(r,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(o,r)}const n=e.pickedMesh._getActionManagerForTrigger();if(n&&!i.ignore){n.processTrigger(7,Dt.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&n.processTrigger(1,Dt.CreateNew(e.pickedMesh,t,e));const r=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&r&&r.processTrigger(6,Dt.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,Dt.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const n=new Zi(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 Zi(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 k_(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,n.pointerUpFastCheck,n.cameraToUseForPointers,n.pointerUpTrianglePredicate);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>_t.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,f=new Zi(u,c,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(u)&&n.onPointerObservable.notifyObservers(f,u),this._delayedClicks[o]=null}},this._initClickEvent=(o,l,h,c)=>{var g,_;const u=new ul;this._currentPickResult=null;let f=null,d=o.hasSpecificMask(Re.POINTERPICK)||l.hasSpecificMask(Re.POINTERPICK)||o.hasSpecificMask(Re.POINTERTAP)||l.hasSpecificMask(Re.POINTERTAP)||o.hasSpecificMask(Re.POINTERDOUBLETAP)||l.hasSpecificMask(Re.POINTERDOUBLETAP);!d&&hi&&(f=this._initActionManager(f,u),f&&(d=f.hasPickTriggers));let p=!1;if(d){const m=h.button;if(u.hasSwiped=this._isPointerSwiping(),!u.hasSwiped){let x=!_t.ExclusiveDoubleClickMode;if(x||(x=!o.hasSpecificMask(Re.POINTERDOUBLETAP)&&!l.hasSpecificMask(Re.POINTERDOUBLETAP),x&&!hi.HasSpecificTrigger(6)&&(f=this._initActionManager(f,u),f&&(x=!f.hasSpecificTrigger(6)))),x)(Date.now()-this._previousStartingPointerTime>_t.DoubleClickDelay||m!==this._previousButtonPressed)&&(u.singleClick=!0,c(u,this._currentPickResult),p=!0);else{const T={evt:h,clickInfo:u,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,m,u,c),_t.DoubleClickDelay)};this._delayedClicks[m]=T}let I=o.hasSpecificMask(Re.POINTERDOUBLETAP)||l.hasSpecificMask(Re.POINTERDOUBLETAP);!I&&hi.HasSpecificTrigger(6)&&(f=this._initActionManager(f,u),f&&(I=f.hasSpecificTrigger(6))),I&&(m===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<_t.DoubleClickDelay&&!this._doubleClickOccured?(!u.hasSwiped&&!this._isPointerSwiping()?(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,u.doubleClick=!0,u.ignore=!1,_t.ExclusiveDoubleClickMode&&this._delayedClicks[m]&&(clearTimeout((g=this._delayedClicks[m])==null?void 0:g.timeoutId),this._delayedClicks[m]=null),c(u,this._currentPickResult)):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=m,_t.ExclusiveDoubleClickMode?(this._delayedClicks[m]&&(clearTimeout((_=this._delayedClicks[m])==null?void 0:_.timeoutId),this._delayedClicks[m]=null),c(u,this._previousPickResult)):c(u,this._currentPickResult)),p=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=m))}}p||c(u,this._currentPickResult)},this._onPointerMove=o=>{if(this._updatePointerPosition(o),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>_t.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>_t.DragMovementThreshold),r.isPointerLock&&r._verifyPointerLock(),this._checkPrePointerObservable(null,o,o.inputIndex>=ye.MouseWheelX&&o.inputIndex<=ye.MouseWheelZ?Re.POINTERWHEEL:Re.POINTERMOVE)||!n.cameraToUseForPointers&&!n.activeCamera)return;if(n.skipPointerMovePicking){this._processPointerMove(new ns,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||n.constantlyUpdateMeshUnderPointer?this._pickMove(o):null;this._processPointerMove(l,o)},this._onPointerDown=o=>{var h;if(this._totalPointersPressed++,this._pickedDownMesh=null,this._meshPickProceed=!1,_t.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 l;n.skipPointerDownPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerDown?l=new ns:l=n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerDownPredicate,n.pointerDownFastCheck,n.cameraToUseForPointers,n.pointerDownTrianglePredicate),this._processPointerDown(l,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),o.buttons===0&&(this._pointerCaptures[o.pointerId]=!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&&(hi&&hi.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=Cn.KEYDOWN;if(n.onPreKeyboardObservable.hasObservers()){const h=new tl(l,o);if(n.onPreKeyboardObservable.notifyObservers(h,l),h.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const h=new ya(l,o);n.onKeyboardObservable.notifyObservers(h,l)}n.actionManager&&n.actionManager.processTrigger(14,Dt.CreateNewFromScene(n,o))},this._onKeyUp=o=>{const l=Cn.KEYUP;if(n.onPreKeyboardObservable.hasObservers()){const h=new tl(l,o);if(n.onPreKeyboardObservable.notifyObservers(h,l),h.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const h=new ya(l,o);n.onKeyboardObservable.notifyObservers(h,l)}n.actionManager&&n.actionManager.processTrigger(15,Dt.CreateNewFromScene(n,o))},this._deviceSourceManager.onDeviceConnectedObservable.add(o=>{o.deviceType===ge.Mouse?o.onInputChangedObservable.add(l=>{this._originMouseEvent=l,l.inputIndex===ye.LeftClick||l.inputIndex===ye.MiddleClick||l.inputIndex===ye.RightClick||l.inputIndex===ye.BrowserBack||l.inputIndex===ye.BrowserForward?t&&o.getInput(l.inputIndex)===1?this._onPointerDown(l):e&&o.getInput(l.inputIndex)===0&&this._onPointerUp(l):i&&(l.inputIndex===ye.Move?this._onPointerMove(l):(l.inputIndex===ye.MouseWheelX||l.inputIndex===ye.MouseWheelY||l.inputIndex===ye.MouseWheelZ)&&this._onPointerMove(l))}):o.deviceType===ge.Touch?o.onInputChangedObservable.add(l=>{l.inputIndex===ye.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===ye.Move&&this._onPointerMove(l)}):o.deviceType===ge.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,Dt.CreateNew(n,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,r=e._getActionManagerForTrigger(9),r&&r.processTrigger(9,Dt.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]}}_t.DragMovementThreshold=10;_t.LongPressDelay=500;_t.DoubleClickDelay=300;_t.ExclusiveDoubleClickMode=!1;class Hh{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}Hh._UniqueIdCounter=1;class Xe{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Xe.FALLOFF_DEFAULT=0;Xe.FALLOFF_PHYSICAL=1;Xe.FALLOFF_GLTF=2;Xe.FALLOFF_STANDARD=3;Xe.LIGHTMAP_DEFAULT=0;Xe.LIGHTMAP_SPECULAR=1;Xe.LIGHTMAP_SHADOWSONLY=2;Xe.INTENSITYMODE_AUTOMATIC=0;Xe.INTENSITYMODE_LUMINOUSPOWER=1;Xe.INTENSITYMODE_LUMINOUSINTENSITY=2;Xe.INTENSITYMODE_ILLUMINANCE=3;Xe.INTENSITYMODE_LUMINANCE=4;Xe.LIGHTTYPEID_POINTLIGHT=0;Xe.LIGHTTYPEID_DIRECTIONALLIGHT=1;Xe.LIGHTTYPEID_SPOTLIGHT=2;Xe.LIGHTTYPEID_HEMISPHERICLIGHT=3;class V_{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var Ta;(function(a){a[a.BackwardCompatible=0]="BackwardCompatible",a[a.Intermediate=1]="Intermediate",a[a.Aggressive=2]="Aggressive"})(Ta||(Ta={}));class Qe extends Xi{static DefaultMaterialFactory(e){throw Te("StandardMaterial")}static CollisionCoordinatorFactory(){throw Te("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 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2: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 pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return _t.DragMovementThreshold}static set DragMovementThreshold(e){_t.DragMovementThreshold=e}static get LongPressDelay(){return _t.LongPressDelay}static set LongPressDelay(e){_t.LongPressDelay=e}static get DoubleClickDelay(){return _t.DoubleClickDelay}static set DoubleClickDelay(e){_t.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return _t.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){_t.ExclusiveDoubleClickMode=e}bindEyePosition(e,t="vEyePosition",i=!1){const s=this._forcedViewPosition?this._forcedViewPosition:this._mirroredCameraPosition?this._mirroredCameraPosition:this.activeCamera.globalPosition,n=this.useRightHandedSystem===(this._mirroredCameraPosition!=null);return N.Vector4[0].set(s.x,s.y,s.z,n?-1:1),e&&(i?e.setFloat3(t,N.Vector4[0].x,N.Vector4[0].y,N.Vector4[0].z):e.setVector4(t,N.Vector4[0])),N.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=Eh(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=Qe.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=Qe.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 _t(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this.clearColor=new X(.2,.2,.3,1),this.ambientColor=new pe(0,0,0),this.environmentIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new Q,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=[],this.onDisposeObservable=new Q,this._onDisposeObserver=null,this.onBeforeRenderObservable=new Q,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new Q,this.onAfterRenderCameraObservable=new Q,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new Q,this.onAfterAnimationsObservable=new Q,this.onBeforeDrawPhaseObservable=new Q,this.onAfterDrawPhaseObservable=new Q,this.onReadyObservable=new Q,this.onBeforeCameraRenderObservable=new Q,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new Q,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new Q,this.onAfterActiveMeshesEvaluationObservable=new Q,this.onBeforeParticlesRenderingObservable=new Q,this.onAfterParticlesRenderingObservable=new Q,this.onDataLoadedObservable=new Q,this.onNewCameraAddedObservable=new Q,this.onCameraRemovedObservable=new Q,this.onNewLightAddedObservable=new Q,this.onLightRemovedObservable=new Q,this.onNewGeometryAddedObservable=new Q,this.onGeometryRemovedObservable=new Q,this.onNewTransformNodeAddedObservable=new Q,this.onTransformNodeRemovedObservable=new Q,this.onNewMeshAddedObservable=new Q,this.onMeshRemovedObservable=new Q,this.onNewSkeletonAddedObservable=new Q,this.onSkeletonRemovedObservable=new Q,this.onNewMaterialAddedObservable=new Q,this.onNewMultiMaterialAddedObservable=new Q,this.onMaterialRemovedObservable=new Q,this.onMultiMaterialRemovedObservable=new Q,this.onNewTextureAddedObservable=new Q,this.onTextureRemovedObservable=new Q,this.onBeforeRenderTargetsRenderObservable=new Q,this.onAfterRenderTargetsRenderObservable=new Q,this.onBeforeStepObservable=new Q,this.onAfterStepObservable=new Q,this.onActiveCameraChanged=new Q,this.onActiveCamerasChanged=new Q,this.onBeforeRenderingGroupObservable=new Q,this.onAfterRenderingGroupObservable=new Q,this.onMeshImportedObservable=new Q,this.onAnimationFileImportedObservable=new Q,this._registeredForLateAnimationBindings=new Is(256),this._pointerPickingConfiguration=new V_,this.onPrePointerObservable=new Q,this.onPointerObservable=new Q,this.onPreKeyboardObservable=new Q,this.onKeyboardObservable=new Q,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=Qe.FOGMODE_NONE,this.fogColor=new pe(.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=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new Is(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new ui,this._activeIndices=new ui,this._activeParticles=new ui,this._activeBones=new ui,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 Vt(256),this._processedMaterials=new Vt(256),this._renderTargets=new Is(256),this._materialsRenderTargets=new Is(256),this._activeParticleSystems=new Vt(256),this._activeSkeletons=new Is(32),this._softwareSkinnedMeshes=new Is(32),this._activeAnimatables=new Array,this._transformMatrix=O.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=pt.Create(),this._beforeClearStage=pt.Create(),this._beforeRenderTargetClearStage=pt.Create(),this._gatherRenderTargetsStage=pt.Create(),this._gatherActiveCameraRenderTargetsStage=pt.Create(),this._isReadyForMeshStage=pt.Create(),this._beforeEvaluateActiveMeshStage=pt.Create(),this._evaluateSubMeshStage=pt.Create(),this._preActiveMeshStage=pt.Create(),this._cameraDrawRenderTargetStage=pt.Create(),this._beforeCameraDrawStage=pt.Create(),this._beforeRenderTargetDrawStage=pt.Create(),this._beforeRenderingGroupDrawStage=pt.Create(),this._beforeRenderingMeshStage=pt.Create(),this._afterRenderingMeshStage=pt.Create(),this._afterRenderingGroupDrawStage=pt.Create(),this._afterCameraDrawStage=pt.Create(),this._afterCameraPostProcessStage=pt.Create(),this._afterRenderTargetDrawStage=pt.Create(),this._afterRenderTargetPostProcessStage=pt.Create(),this._afterRenderStage=pt.Create(),this._pointerMoveStage=pt.Create(),this._pointerDownStage=pt.Create(),this._pointerUpStage=pt.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=[];const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,...t};e=this._engine=e||Ce.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(Ce._LastCreatedScene=this,e.scenes.push(this)),this._uid=null,this._renderingManager=new Ut(this),xa&&(this.postProcessManager=new xa(this)),St()&&this.attachControl(),this._createUbo(),Ue&&(this._imageProcessingConfiguration=new Ue),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,(!t||!t.virtual)&&e.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(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}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){var r,o,l;if(this._isDisposed)return!1;let t;const i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=(o=(r=this.activeCamera)==null?void 0:r.renderPassId)!=null?o:s;let n=!0;for(this._pendingData.length>0&&(n=!1),(l=this.prePassRenderer)==null||l.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&n&&(n=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t0;for(const f of this._isReadyForMeshStage)f.action(h,c)||(n=!1);if(!e)continue;const u=h.material||this.defaultMaterial;if(u)if(u._storeEffectOnSubMeshes)for(const f of h.subMeshes){const d=f.getMaterial();d&&d.hasRenderTargetTextures&&d.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(d)===-1&&(this._processedMaterials.push(d),this._materialsRenderTargets.concatWithNoDuplicate(d.getRenderTargetTextures()))}else u.hasRenderTargetTextures&&u.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(u)===-1&&(this._processedMaterials.push(u),this._materialsRenderTargets.concatWithNoDuplicate(u.getRenderTargetTextures()))}if(e)for(t=0;t0)for(const h of this.activeCameras)h.isReady(!0)||(n=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(n=!1));for(const h of this.particleSystems)h.isReady()||(n=!1);if(this.layers)for(const h of this.layers)h.isReady()||(n=!1);return i.areAllEffectsReady()||(n=!1),i.currentRenderPassId=s,n}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=xi.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?mi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=mi.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 de(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 Hh.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}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[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 i;if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&((i=this.activeCamera)==null||i._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.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),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 n=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){ee.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(let h=0;h0),this._renderId++}for(const h of this._cameraDrawRenderTargetStage)n=h.action(this.activeCamera)||n;this._intermediateRendering=!1}this._engine.currentRenderPassId=(l=(o=(r=e.outputRenderTarget)==null?void 0:r.renderPassId)!=null?o:e.renderPassId)!=null?l:0,n&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),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),s.snapshotRendering&&s.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(Dt.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(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(Qe.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Qe.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=(o=s==null?void 0:s.renderPassId)!=null?o:0,this.activeCamera=s,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;l{n.onAnimationEndObservable.clear(),n.onAnimationEnd=null}),this.stopAllAnimations()),this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const n of e)n.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(n){U.Error("An error occurred while calling onDisposeObservable!",n)}if(this.detachControl(),this._engine.getInputElement())for(let n=0;nn.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),Ce._LastCreatedScene===this&&(this._engine.scenes.length>0?Ce._LastCreatedScene=this._engine.scenes[this._engine.scenes.length-1]:Ce._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 Te("Ray")}createPickingRayToRef(e,t,i,s,n,r=!1,o=!1){throw Te("Ray")}createPickingRayInCameraSpace(e,t,i){throw Te("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw Te("Ray")}get _pickingAvailable(){return!1}pick(e,t,i,s,n,r){const o=Te("Ray",!0);return o&&U.Warn(o),new ns}pickWithBoundingInfo(e,t,i,s,n){const r=Te("Ray",!0);return r&&U.Warn(r),new ns}pickWithRay(e,t,i,s){throw Te("Ray")}multiPick(e,t,i,s,n){throw Te("Ray")}multiPickWithRay(e,t,i){throw Te("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(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(t===void 0)return e;const s=[];for(const n in e){const r=e[n];ze&&ze.MatchesQuery(r,t)&&(!i||i(r))&&s.push(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)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=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=vs(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=Za(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=An(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 Te("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}Qe.FOGMODE_NONE=0;Qe.FOGMODE_EXP=1;Qe.FOGMODE_EXP2=2;Qe.FOGMODE_LINEAR=3;Qe.MinDeltaTime=1;Qe.MaxDeltaTime=1e3;ft("BABYLON.Scene",Qe);class G_{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new Q,this._onClonedObservable=new Q}}class mt{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._isDirty=!0,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,i=!0){this._isDirty=!1,this._nodeDataStorage=new G_,this.state="",this.metadata=null,this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new Q,this._parentContainer=null,this.animations=[],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=O.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new Q,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||Ce.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),i&&this._addToSceneRootNodes()}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={}}updateCache(e){!e&&this.isSynchronized()||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._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;tnew mt(e,this.getScene()),this);if(t&&(s.parent=t),!i){const n=this.getDescendants(!0);for(let r=0;r{throw Te("AnimationRange")};mt._NodeConstructors={};D([B()],mt.prototype,"name",void 0);D([B()],mt.prototype,"id",void 0);D([B()],mt.prototype,"uniqueId",void 0);D([B()],mt.prototype,"state",void 0);D([B()],mt.prototype,"metadata",void 0);const z_=O.Compose(v.One(),le.FromEulerAngles(0,Math.PI,0),v.Zero());class Ie extends mt{get billboardMode(){return this._billboardMode}set billboardMode(e){this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=(this._billboardMode&Ie.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!==Ie.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,!1),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=Ie.BILLBOARDMODE_NONE,this._preserveParentRotationForBillboard=!1,this.scalingDeterminant=1,this._infiniteDistance=!1,this.ignoreNonUniformScaling=!1,this.reIntegrateRotationIntoRotationQuaternion=!1,this._poseMatrix=null,this._localMatrix=O.Zero(),this._usePivotMatrix=!1,this._absolutePosition=v.Zero(),this._absoluteScaling=v.Zero(),this._absoluteRotationQuaternion=le.Identity(),this._pivotMatrix=O.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new Q,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}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}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=O.Identity()),this._poseMatrix}_isSynchronized(){const e=this._cache;return!(this._billboardMode!==e.billboardMode||this._billboardMode!==Ie.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=O.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||le.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=N.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=N.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=0){const r=Ie._LookAtVectorCache,o=n===0?this.position:this.getAbsolutePosition();if(e.subtractToRef(o,r),this.setDirection(r,t,i,s),n===1&&this.parent)if(this.rotationQuaternion){const l=N.Matrix[0];this.rotationQuaternion.toRotationMatrix(l);const h=N.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(h),h.invert(),l.multiplyToRef(h,l),this.rotationQuaternion.fromRotationMatrix(l)}else{const l=N.Quaternion[0];le.FromEulerVectorToRef(this.rotation,l);const h=N.Matrix[0];l.toRotationMatrix(h);const c=N.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?le.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=0){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const i=this.getWorldMatrix();if(t==1){const s=N.Matrix[0];i.invertToRef(s),e=v.TransformCoordinates(e,s)}return this.setPivotMatrix(O.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=N.Quaternion[0],n=N.Vector3[0],r=N.Vector3[1],o=N.Matrix[1];O.IdentityToRef(o);const l=N.Matrix[0];this.computeWorldMatrix(!0);let h=this.rotationQuaternion;return h||(h=Ie._TmpRotation,le.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,h)),O.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(O.Identity()),this}addChild(e,t=!1){return e.setParent(this,t),this}removeChild(e,t=!1){return e.setParent(null,t),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(!0),e.getFinalMatrix().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===0)s=le.RotationAxisToRef(e,t,Ie._RotationAxisCache),this.rotationQuaternion.multiplyToRef(s,this.rotationQuaternion);else{if(this.parent){const n=this.parent.getWorldMatrix(),r=N.Matrix[0];n.invertToRef(r),e=v.TransformNormal(e,r),n.determinant()<0&&(t*=-1)}s=le.RotationAxisToRef(e,t,Ie._RotationAxisCache),s.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=le.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const s=N.Vector3[0],n=N.Vector3[1],r=N.Vector3[2],o=N.Quaternion[0],l=N.Matrix[0],h=N.Matrix[1],c=N.Matrix[2],u=N.Matrix[3];return e.subtractToRef(this.position,s),O.TranslationToRef(s.x,s.y,s.z,l),O.TranslationToRef(-s.x,-s.y,-s.z,h),O.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===0){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=N.Quaternion[1],le.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s));const n=N.Quaternion[0];return le.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!==Ie.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=Ie._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=Ie._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(le.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(l=Ie._TmpRotation,le.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),this._usePivotMatrix){const h=N.Matrix[1];O.ScalingToRef(r.x,r.y,r.z,h);const c=N.Matrix[0];l.toRotationMatrix(c),this._pivotMatrix.multiplyToRef(h,N.Matrix[4]),N.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 O.ComposeToRef(r,l,o,this._localMatrix);if(n&&n.getWorldMatrix){if(e&&n.computeWorldMatrix(e),s.useBillboardPath){if(this._transformToBoneReferal){const f=this.parent;f.getSkeleton().prepare(),f.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),N.Matrix[7])}else N.Matrix[7].copyFrom(n.getWorldMatrix());const h=N.Vector3[5],c=N.Vector3[6],u=N.Quaternion[0];N.Matrix[7].decompose(c,u,h),O.ScalingToRef(c.x,c.y,c.z,N.Matrix[7]),N.Matrix[7].setTranslation(h),Ie.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(u,h),this._localMatrix.setTranslation(h)),this._localMatrix.multiplyToRef(N.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const h=this.parent;h.getSkeleton().prepare(),this._localMatrix.multiplyToRef(h.getFinalMatrix(),N.Matrix[6]),N.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else 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=N.Vector3[0];if(this._worldMatrix.getTranslationToRef(h),N.Matrix[1].copyFrom(t.getViewMatrix()),this._scene.useRightHandedSystem&&N.Matrix[1].multiplyToRef(z_,N.Matrix[1]),N.Matrix[1].setTranslationFromFloats(0,0,0),N.Matrix[1].invertToRef(N.Matrix[0]),(this.billboardMode&Ie.BILLBOARDMODE_ALL)!==Ie.BILLBOARDMODE_ALL){N.Matrix[0].decompose(void 0,N.Quaternion[0],void 0);const c=N.Vector3[1];N.Quaternion[0].toEulerAnglesToRef(c),(this.billboardMode&Ie.BILLBOARDMODE_X)!==Ie.BILLBOARDMODE_X&&(c.x=0),(this.billboardMode&Ie.BILLBOARDMODE_Y)!==Ie.BILLBOARDMODE_Y&&(c.y=0),(this.billboardMode&Ie.BILLBOARDMODE_Z)!==Ie.BILLBOARDMODE_Z&&(c.z=0),O.RotationYawPitchRollToRef(c.y,c.x,c.z,N.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(N.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(N.Vector3[0])}else if(s.useBillboardPath&&t&&s.useBillboardPosition){const h=N.Vector3[0];this._worldMatrix.getTranslationToRef(h);const c=t.globalPosition;this._worldMatrix.invertToRef(N.Matrix[1]);const u=N.Vector3[1];v.TransformCoordinatesToRef(c,N.Matrix[1],u),u.normalize();const f=-Math.atan2(u.z,u.x)+Math.PI/2,d=Math.sqrt(u.x*u.x+u.z*u.z),p=-Math.atan2(u.y,d);if(le.RotationYawPitchRollToRef(f,p,0,N.Quaternion[0]),(this.billboardMode&Ie.BILLBOARDMODE_ALL)!==Ie.BILLBOARDMODE_ALL){const g=N.Vector3[1];N.Quaternion[0].toEulerAnglesToRef(g),(this.billboardMode&Ie.BILLBOARDMODE_X)!==Ie.BILLBOARDMODE_X&&(g.x=0),(this.billboardMode&Ie.BILLBOARDMODE_Y)!==Ie.BILLBOARDMODE_Y&&(g.y=0),(this.billboardMode&Ie.BILLBOARDMODE_Z)!==Ie.BILLBOARDMODE_Z&&(g.z=0),O.RotationYawPitchRollToRef(g.y,g.x,g.z,N.Matrix[0])}else O.FromQuaternionToRef(N.Quaternion[0],N.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(N.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(N.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=O.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if(this.computeWorldMatrix(),e){const t=this.getChildren();for(let i=0;inew Ie(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 Ie(e.name,t),e,t,i);if(e.localMatrix?s.setPreTransformMatrix(O.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(O.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),e.animations){for(let n=0;n(!t||t(s))&&s instanceof Ie),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)}}Ie.BILLBOARDMODE_NONE=0;Ie.BILLBOARDMODE_X=1;Ie.BILLBOARDMODE_Y=2;Ie.BILLBOARDMODE_Z=4;Ie.BILLBOARDMODE_ALL=7;Ie.BILLBOARDMODE_USE_POSITION=128;Ie.BillboardUseParentOrientation=!1;Ie._TmpRotation=le.Zero();Ie._TmpScaling=v.Zero();Ie._TmpTranslation=v.Zero();Ie._LookAtVectorCache=new v(0,0,0);Ie._RotationAxisCache=new le;D([bi("position")],Ie.prototype,"_position",void 0);D([bi("rotation")],Ie.prototype,"_rotation",void 0);D([Kp("rotationQuaternion")],Ie.prototype,"_rotationQuaternion",void 0);D([bi("scaling")],Ie.prototype,"_scaling",void 0);D([B("billboardMode")],Ie.prototype,"_billboardMode",void 0);D([B()],Ie.prototype,"scalingDeterminant",void 0);D([B("infiniteDistance")],Ie.prototype,"_infiniteDistance",void 0);D([B()],Ie.prototype,"ignoreNonUniformScaling",void 0);D([B()],Ie.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0);function Sa(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 W_(a=25){let e;return(t,i,s)=>{const n=performance.now();e===void 0||n-e>a?(e=n,setTimeout(()=>{Sa(t,i,s)},0)):Sa(t,i,s)}}function Kh(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 co(a,e){let t;return Kh(a,Sa,i=>t=i,i=>{throw i},e),t}function X_(a,e,t){return new Promise((i,s)=>{Kh(a,e,i,s,t)})}function H_(a,e){return(...t)=>co(a(...t),e)}class ve extends mt{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 i,s,n,r;let e=0,t=0;if(this.mode===ve.PERSPECTIVE_CAMERA)this.fovMode===ve.FOVMODE_VERTICAL_FIXED?(t=this.minZ*2*Math.tan(this.fov/2),e=this.getEngine().getAspectRatio(this)*t):(e=this.minZ*2*Math.tan(this.fov/2),t=e/this.getEngine().getAspectRatio(this));else{const o=this.getEngine().getRenderWidth()/2,l=this.getEngine().getRenderHeight()/2;e=((i=this.orthoRight)!=null?i:o)-((s=this.orthoLeft)!=null?s:-o),t=((n=this.orthoTop)!=null?n:l)-((r=this.orthoBottom)!=null?r:-l)}return e*t}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}get hasMoved(){return this._hasMoved}constructor(e,t,i,s=!0){super(e,i,!1),this._position=v.Zero(),this._upVector=v.Up(),this.oblique=null,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=ve.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new Qs(0,0,1,1),this.layerMask=268435455,this.fovMode=ve.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=ve.RIG_MODE_NONE,this.customRenderTargets=[],this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new Q,this.onProjectionMatrixChangedObservable=new Q,this.onAfterCheckInputsObservable=new Q,this.onRestoreStateObservable=new Q,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new O,this._postProcesses=new Array,this._activeMeshes=new Vt(256),this._globalPosition=v.Zero(),this._computedViewMatrix=O.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=O.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=le.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?(U.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 O.Identity()}getViewMatrix(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this._hasMoved=!0,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 n,r,o,l,h,c,u,f,d,p,g,_,m,x,I,T,y,b,S;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 t=this.getEngine(),i=this.getScene(),s=t.useReverseDepthBuffer;if(this.mode===ve.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=t.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let A;i.useRightHandedSystem?A=O.PerspectiveFovRHToRef:A=O.PerspectiveFovLHToRef,A(this.fov,t.getAspectRatio(this),s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,this.fovMode===ve.FOVMODE_VERTICAL_FIXED,t.isNDCHalfZRange,this.projectionPlaneTilt,s)}else{const A=t.getRenderWidth()/2,M=t.getRenderHeight()/2;i.useRightHandedSystem?this.oblique?O.ObliqueOffCenterRHToRef((n=this.orthoLeft)!=null?n:-A,(r=this.orthoRight)!=null?r:A,(o=this.orthoBottom)!=null?o:-M,(l=this.orthoTop)!=null?l:M,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):O.OrthoOffCenterRHToRef((h=this.orthoLeft)!=null?h:-A,(c=this.orthoRight)!=null?c:A,(u=this.orthoBottom)!=null?u:-M,(f=this.orthoTop)!=null?f:M,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange):this.oblique?O.ObliqueOffCenterLHToRef((d=this.orthoLeft)!=null?d:-A,(p=this.orthoRight)!=null?p:A,(g=this.orthoBottom)!=null?g:-M,(_=this.orthoTop)!=null?_:M,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):O.OrthoOffCenterLHToRef((m=this.orthoLeft)!=null?m:-A,(x=this.orthoRight)!=null?x:A,(I=this.orthoBottom)!=null?I:-M,(T=this.orthoTop)!=null?T:M,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=(y=this.oblique)==null?void 0:y.angle,this._cache.obliqueLength=(b=this.oblique)==null?void 0:b.length,this._cache.obliqueOffset=(S=this.oblique)==null?void 0:S.offset,this._cache.renderWidth=t.getRenderWidth(),this._cache.renderHeight=t.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(e){const t=this,i=this;return(t.radius||(i.target?v.Distance(this.position,i.target):this.position.length()))+e}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?mi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=mi.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 Te("Ray")}getForwardRayToRef(e,t=100,i,s){throw Te("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!==ve.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=ee.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==ve.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 O.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}setCameraRigParameter(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,e==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=ee.ToRadians(t/.0637))}createRigCamera(e,t){return null}_updateRigCameras(){for(let e=0;eve._CreateDefaultParsedCamera(t,i))}computeWorldMatrix(){return this.getWorldMatrix()}static Parse(e,t){const i=e.type,s=ve.GetConstructorFromName(i,e.name,t,e.interaxial_distance,e.isStereoscopicSideBySide),n=Ae.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 Te("UniversalCamera")};ve.PERSPECTIVE_CAMERA=0;ve.ORTHOGRAPHIC_CAMERA=1;ve.FOVMODE_VERTICAL_FIXED=0;ve.FOVMODE_HORIZONTAL_FIXED=1;ve.RIG_MODE_NONE=0;ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10;ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11;ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12;ve.RIG_MODE_STEREOSCOPIC_OVERUNDER=13;ve.RIG_MODE_STEREOSCOPIC_INTERLACED=14;ve.RIG_MODE_VR=20;ve.RIG_MODE_CUSTOM=22;ve.ForceAttachControlToAlwaysPreventDefault=!1;D([bi("position")],ve.prototype,"_position",void 0);D([bi("upVector")],ve.prototype,"_upVector",void 0);D([B()],ve.prototype,"orthoLeft",null);D([B()],ve.prototype,"orthoRight",null);D([B()],ve.prototype,"orthoBottom",null);D([B()],ve.prototype,"orthoTop",null);D([B()],ve.prototype,"fov",void 0);D([B()],ve.prototype,"projectionPlaneTilt",void 0);D([B()],ve.prototype,"minZ",void 0);D([B()],ve.prototype,"maxZ",void 0);D([B()],ve.prototype,"inertia",void 0);D([B()],ve.prototype,"mode",null);D([B()],ve.prototype,"layerMask",void 0);D([B()],ve.prototype,"fovMode",void 0);D([B()],ve.prototype,"cameraRigMode",void 0);D([B()],ve.prototype,"interaxialDistance",void 0);D([B()],ve.prototype,"isStereoscopicSideBySide",void 0);class Ea{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0}}class es{constructor(e,t,i){this.vectors=Bt.BuildArray(8,v.Zero),this.center=v.Zero(),this.centerWorld=v.Zero(),this.extendSize=v.Zero(),this.extendSizeWorld=v.Zero(),this.directions=Bt.BuildArray(3,v.Zero),this.vectorsWorld=Bt.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||O.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=es._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 es.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return es.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,f=e.z,d=-Ne;return!(o-cc-s||l-uu-n||h-ff-r)}intersectsSphere(e){return es.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,f=e.y,d=e.z,p=t.x,g=t.y,_=t.z;return!(lp||hg||c_)}dispose(){var e,t;(e=this._drawWrapperFront)==null||e.dispose(),(t=this._drawWrapperBack)==null||t.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const n=es._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}}es._TmpVector3=Bt.BuildArray(3,v.Zero);class ws{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||O.IdentityReadOnly)}scale(e){const t=this.radius*e,i=ws._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=ws._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},$t=(a,e,t)=>(fl(a,e,ia),fl(a,t,sa),!(ia.min>sa.max||sa.min>ia.max));class si{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new es(e,t,i),this.boundingSphere=new ws(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=si._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=si._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=N.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=N.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,si._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(!ws.Intersects(this.boundingSphere,e.boundingSphere)||!es.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!$t(i.directions[0],i,s)||!$t(i.directions[1],i,s)||!$t(i.directions[2],i,s)||!$t(s.directions[0],i,s)||!$t(s.directions[1],i,s)||!$t(s.directions[2],i,s)||!$t(v.Cross(i.directions[0],s.directions[0]),i,s)||!$t(v.Cross(i.directions[0],s.directions[1]),i,s)||!$t(v.Cross(i.directions[0],s.directions[2]),i,s)||!$t(v.Cross(i.directions[1],s.directions[0]),i,s)||!$t(v.Cross(i.directions[1],s.directions[1]),i,s)||!$t(v.Cross(i.directions[1],s.directions[2]),i,s)||!$t(v.Cross(i.directions[2],s.directions[0]),i,s)||!$t(v.Cross(i.directions[2],s.directions[1]),i,s)||!$t(v.Cross(i.directions[2],s.directions[2]),i,s))}}si._TmpVector3=Bt.BuildArray(2,v.Zero);class Dr{static extractMinAndMaxIndexed(e,t,i,s,n,r){for(let o=i;o!Array.isArray(a)&&!Array.isArray(e))],Dr,"extractMinAndMaxIndexed",null);D([ss.filter((...[a])=>!Array.isArray(a))],Dr,"extractMinAndMax",null);function K_(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 Dr.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 Yh(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),Dr.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 vi{get materialDefines(){var e;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:(e=this._getDrawWrapper())==null?void 0:e.defines}set materialDefines(e){var i;const t=(i=this._mainDrawWrapperOverride)!=null?i:this._getDrawWrapper(void 0,!0);t.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 ln(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0){var i;t&&((i=this._drawWrappers[e])==null||i.dispose()),this._drawWrappers[e]=void 0}get effect(){var e,t;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:(t=(e=this._getDrawWrapper())==null?void 0:e.effect)!=null?t:null}get _drawWrapper(){var e;return(e=this._mainDrawWrapperOverride)!=null?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 vi(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.hasThinInstances?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 i;const t=(i=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId))!=null?i:this._renderingMesh.material;if(t){if(this._isMultiMaterial(t)){const s=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==s&&(this._currentMaterial=s,this.resetDrawCache()),s}}else return e?this._mesh.getScene().defaultMaterial:null;return t}_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(E.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=K_(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new si(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=f)}return new vi(e,o,l-o+1,t,i,s,n,r)}}class na{}class j{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=H_(this._applyToCoroutine.bind(this)),this.uniqueId=j._UniqueIDGenerator,j._UniqueIDGenerator++}set(e,t){switch(e.length||U.Warn("Setting vertex data kind '".concat(t,"' with an empty array")),t){case E.PositionKind:this.positions=e;break;case E.NormalKind:this.normals=e;break;case E.TangentKind:this.tangents=e;break;case E.UVKind:this.uvs=e;break;case E.UV2Kind:this.uvs2=e;break;case E.UV3Kind:this.uvs3=e;break;case E.UV4Kind:this.uvs4=e;break;case E.UV5Kind:this.uvs5=e;break;case E.UV6Kind:this.uvs6=e;break;case E.ColorKind:this.colors=e;break;case E.MatricesIndicesKind:this.matricesIndices=e;break;case E.MatricesWeightsKind:this.matricesWeights=e;break;case E.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case E.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){if(this.positions&&(e.setVerticesData(E.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(E.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(E.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(E.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(E.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(E.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(E.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(E.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(E.UV6Kind,this.uvs6,t),i&&(yield)),this.colors&&(e.setVerticesData(E.ColorKind,this.colors,t),this.hasVertexAlpha&&e.hasVertexAlpha!==void 0&&(e.hasVertexAlpha=!0),i&&(yield)),this.matricesIndices&&(e.setVerticesData(E.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(E.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(E.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(E.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),e.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const s=e;s.subMeshes=[];for(const n of this.materialInfos)new vi(n.materialIndex,n.verticesStart,n.verticesCount,n.indexStart,n.indexCount,s)}return this}_update(e,t,i){return this.positions&&e.updateVerticesData(E.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(E.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(E.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(E.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(E.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(E.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(E.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(E.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(E.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(E.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(E.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(E.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(E.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(E.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,s=e.length){const n=N.Vector3[0],r=N.Vector3[1];for(let o=i;o({vertexData:o})):[{vertexData:e}];return co(this._mergeCoroutine(void 0,r,t,!1,i,s,n))}*_mergeCoroutine(e,t,i=!1,s,n,r=!1,o=!1){var d,p,g,_;this._validate();let l=t.map(m=>m.vertexData),h=this;if(o)for(const m of l)m&&(m._validate(),!this.normals&&m.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&m.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&m.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&m.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&m.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&m.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&m.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&m.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&m.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&m.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&m.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&m.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&m.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const m of l)if(m){if(o)this.normals&&!m.normals&&(m.normals=new Float32Array(m.positions.length)),this.tangents&&!m.tangents&&(m.tangents=new Float32Array(m.positions.length/3*4)),this.uvs&&!m.uvs&&(m.uvs=new Float32Array(m.positions.length/3*2)),this.uvs2&&!m.uvs2&&(m.uvs2=new Float32Array(m.positions.length/3*2)),this.uvs3&&!m.uvs3&&(m.uvs3=new Float32Array(m.positions.length/3*2)),this.uvs4&&!m.uvs4&&(m.uvs4=new Float32Array(m.positions.length/3*2)),this.uvs5&&!m.uvs5&&(m.uvs5=new Float32Array(m.positions.length/3*2)),this.uvs6&&!m.uvs6&&(m.uvs6=new Float32Array(m.positions.length/3*2)),this.colors&&!m.colors&&(m.colors=new Float32Array(m.positions.length/3*4),m.colors.fill(1)),this.matricesIndices&&!m.matricesIndices&&(m.matricesIndices=new Float32Array(m.positions.length/3*4)),this.matricesWeights&&!m.matricesWeights&&(m.matricesWeights=new Float32Array(m.positions.length/3*4)),this.matricesIndicesExtra&&!m.matricesIndicesExtra&&(m.matricesIndicesExtra=new Float32Array(m.positions.length/3*4)),this.matricesWeightsExtra&&!m.matricesWeightsExtra&&(m.matricesWeightsExtra=new Float32Array(m.positions.length/3*4));else if(m._validate(),!this.normals!=!m.normals||!this.tangents!=!m.tangents||!this.uvs!=!m.uvs||!this.uvs2!=!m.uvs2||!this.uvs3!=!m.uvs3||!this.uvs4!=!m.uvs4||!this.uvs5!=!m.uvs5||!this.uvs6!=!m.uvs6||!this.colors!=!m.colors||!this.matricesIndices!=!m.matricesIndices||!this.matricesWeights!=!m.matricesWeights||!this.matricesIndicesExtra!=!m.matricesIndicesExtra||!this.matricesWeightsExtra!=!m.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes")}if(r){let m=0,x=0,I=0;const T=[];let y=null;const b=[];for(const A of this.splitBasedOnMaterialID())b.push({vertexData:A,transform:e});for(const A of t)if(A.vertexData)for(const M of A.vertexData.splitBasedOnMaterialID())b.push({vertexData:M,transform:A.transform});b.sort((A,M)=>{const C=A.vertexData.materialInfos?A.vertexData.materialInfos[0].materialIndex:0,w=M.vertexData.materialInfos?M.vertexData.materialInfos[0].materialIndex:0;return C>w?1:C===w?0:-1});for(const A of b){const M=A.vertexData;if(M.materialInfos?m=M.materialInfos[0].materialIndex:m=0,y&&y.materialIndex===m)y.indexCount+=M.indices.length,y.verticesCount+=M.positions.length/3;else{const C=new na;C.materialIndex=m,C.indexStart=x,C.indexCount=M.indices.length,C.verticesStart=I,C.verticesCount=M.positions.length/3,T.push(C),y=C}x+=M.indices.length,I+=M.positions.length/3}const S=b.splice(0,1)[0];h=S.vertexData,e=S.transform,l=b.map(A=>A.vertexData),t=b,this.materialInfos=T}const c=l.reduce((m,x)=>{var I,T;return m+((T=(I=x.indices)==null?void 0:I.length)!=null?T:0)},(p=(d=h.indices)==null?void 0:d.length)!=null?p:0);let f=n||l.some(m=>m.indices===h.indices)?(g=h.indices)==null?void 0:g.slice():h.indices;if(c>0){let m=(_=f==null?void 0:f.length)!=null?_:0;if(f||(f=new Array(c)),f.length!==c){if(Array.isArray(f))f.length=c;else{const I=i||f instanceof Uint32Array?new Uint32Array(c):new Uint16Array(c);I.set(f),f=I}e&&e.determinant()<0&&j._FlipFaces(f,0,m)}let x=h.positions?h.positions.length/3:0;for(const{vertexData:I,transform:T}of t)if(I.indices){for(let y=0;y[m.vertexData.positions,m.transform])),s&&(yield),h.normals&&(this.normals=j._MergeElement(E.NormalKind,h.normals,e,t.map(m=>[m.vertexData.normals,m.transform])),s&&(yield)),h.tangents&&(this.tangents=j._MergeElement(E.TangentKind,h.tangents,e,t.map(m=>[m.vertexData.tangents,m.transform])),s&&(yield)),h.uvs&&(this.uvs=j._MergeElement(E.UVKind,h.uvs,e,t.map(m=>[m.vertexData.uvs,m.transform])),s&&(yield)),h.uvs2&&(this.uvs2=j._MergeElement(E.UV2Kind,h.uvs2,e,t.map(m=>[m.vertexData.uvs2,m.transform])),s&&(yield)),h.uvs3&&(this.uvs3=j._MergeElement(E.UV3Kind,h.uvs3,e,t.map(m=>[m.vertexData.uvs3,m.transform])),s&&(yield)),h.uvs4&&(this.uvs4=j._MergeElement(E.UV4Kind,h.uvs4,e,t.map(m=>[m.vertexData.uvs4,m.transform])),s&&(yield)),h.uvs5&&(this.uvs5=j._MergeElement(E.UV5Kind,h.uvs5,e,t.map(m=>[m.vertexData.uvs5,m.transform])),s&&(yield)),h.uvs6&&(this.uvs6=j._MergeElement(E.UV6Kind,h.uvs6,e,t.map(m=>[m.vertexData.uvs6,m.transform])),s&&(yield)),h.colors&&(this.colors=j._MergeElement(E.ColorKind,h.colors,e,t.map(m=>[m.vertexData.colors,m.transform])),(h.hasVertexAlpha!==void 0||t.some(m=>m.vertexData.hasVertexAlpha!==void 0))&&(this.hasVertexAlpha=h.hasVertexAlpha||t.some(m=>m.vertexData.hasVertexAlpha)),s&&(yield)),h.matricesIndices&&(this.matricesIndices=j._MergeElement(E.MatricesIndicesKind,h.matricesIndices,e,t.map(m=>[m.vertexData.matricesIndices,m.transform])),s&&(yield)),h.matricesWeights&&(this.matricesWeights=j._MergeElement(E.MatricesWeightsKind,h.matricesWeights,e,t.map(m=>[m.vertexData.matricesWeights,m.transform])),s&&(yield)),h.matricesIndicesExtra&&(this.matricesIndicesExtra=j._MergeElement(E.MatricesIndicesExtraKind,h.matricesIndicesExtra,e,t.map(m=>[m.vertexData.matricesIndicesExtra,m.transform])),s&&(yield)),h.matricesWeightsExtra&&(this.matricesWeightsExtra=j._MergeElement(E.MatricesWeightsExtraKind,h.matricesWeightsExtra,e,t.map(m=>[m.vertexData.matricesWeightsExtra,m.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===E.PositionKind?j._TransformVector3Coordinates:e===E.NormalKind?j._TransformVector3Normals:e===E.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=E.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(E.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(E.NormalKind,this.normals),this.tangents&&i(E.TangentKind,this.tangents),this.uvs&&i(E.UVKind,this.uvs),this.uvs2&&i(E.UV2Kind,this.uvs2),this.uvs3&&i(E.UV3Kind,this.uvs3),this.uvs4&&i(E.UV4Kind,this.uvs4),this.uvs5&&i(E.UV5Kind,this.uvs5),this.uvs6&&i(E.UV6Kind,this.uvs6),this.colors&&i(E.ColorKind,this.colors),this.matricesIndices&&i(E.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(E.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(E.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(E.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){const e=this.serialize();return j.Parse(e)}serialize(){const e={};if(this.positions&&(e.positions=Array.from(this.positions)),this.normals&&(e.normals=Array.from(this.normals)),this.tangents&&(e.tangents=Array.from(this.tangents)),this.uvs&&(e.uvs=Array.from(this.uvs)),this.uvs2&&(e.uvs2=Array.from(this.uvs2)),this.uvs3&&(e.uvs3=Array.from(this.uvs3)),this.uvs4&&(e.uvs4=Array.from(this.uvs4)),this.uvs5&&(e.uvs5=Array.from(this.uvs5)),this.uvs6&&(e.uvs6=Array.from(this.uvs6)),this.colors&&(e.colors=Array.from(this.colors),e.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(e.matricesIndices=Array.from(this.matricesIndices),e.matricesIndices._isExpanded=!0),this.matricesWeights&&(e.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(e.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),e.matricesIndicesExtra._isExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),e.indices=Array.from(this.indices),this.materialInfos){e.materialInfos=[];for(const t of this.materialInfos){const i={indexStart:t.indexStart,indexCount:t.indexCount,materialIndex:t.materialIndex,verticesStart:t.verticesStart,verticesCount:t.verticesCount};e.materialInfos.push(i)}}return 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;if(e.isVerticesDataPresent(E.PositionKind)&&(s.positions=e.getVerticesData(E.PositionKind,t,i)),e.isVerticesDataPresent(E.NormalKind)&&(s.normals=e.getVerticesData(E.NormalKind,t,i)),e.isVerticesDataPresent(E.TangentKind)&&(s.tangents=e.getVerticesData(E.TangentKind,t,i)),e.isVerticesDataPresent(E.UVKind)&&(s.uvs=e.getVerticesData(E.UVKind,t,i)),e.isVerticesDataPresent(E.UV2Kind)&&(s.uvs2=e.getVerticesData(E.UV2Kind,t,i)),e.isVerticesDataPresent(E.UV3Kind)&&(s.uvs3=e.getVerticesData(E.UV3Kind,t,i)),e.isVerticesDataPresent(E.UV4Kind)&&(s.uvs4=e.getVerticesData(E.UV4Kind,t,i)),e.isVerticesDataPresent(E.UV5Kind)&&(s.uvs5=e.getVerticesData(E.UV5Kind,t,i)),e.isVerticesDataPresent(E.UV6Kind)&&(s.uvs6=e.getVerticesData(E.UV6Kind,t,i)),e.isVerticesDataPresent(E.ColorKind)){const n=e.geometry||e,r=n.getVertexBuffer(E.ColorKind),o=n.getVerticesData(E.ColorKind,t,i);if(r.getSize()===3){const l=new Float32Array(o.length*4/3);for(let h=0,c=0;h!Array.isArray(a))],j,"_TransformVector3Coordinates",null);D([ss.filter((...[a])=>!Array.isArray(a))],j,"_TransformVector3Normals",null);D([ss.filter((...[a])=>!Array.isArray(a))],j,"_TransformVector4Normals",null);D([ss.filter((...[a])=>!Array.isArray(a))],j,"_FlipFaces",null);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;function Y_(a,e,t,i,s,n,r,o){const l=e*E.GetTypeByteLength(t),h=r*e;if(o.length!==h)throw new Error("Output length is not valid");if(t!==E.FLOAT||s!==l){E.ForEach(a,i,s,e,t,h,n,(c,u)=>o[u]=c);return}if(a instanceof Array){const c=i/4;o.set(a,c)}else if(a instanceof ArrayBuffer){const c=new Float32Array(a,i,h);o.set(c)}else{let c=a.byteOffset+i;const u=c%4;u&&(c=Math.max(0,c-u));const f=new Float32Array(a.buffer,c,h);o.set(f)}}class kt{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 kt(kt.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||Ce.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;e{t._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));const n=new E(this._engine,t,e,{updatable:i,postponeInternalCreation:this._meshes.length===0,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(n)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){const s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;const n=this._meshes,r=n.length;if(s===E.PositionKind){this._totalVertices=t!=null?t:e._maxVerticesCount,this._updateExtend(e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const o=this._extend&&this._extend.minimum||new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=this._extend&&this._extend.maximum||new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h65535);for(const s of this._meshes)s._createGlobalSubMesh(!0),s.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1){this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),t!=null&&(this._totalVertices=t);for(const s of this._meshes)s._createGlobalSubMesh(!0),s.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?this._totalIndices!==void 0?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;const i=this._indices;return!t&&(!e||this._meshes.length===1)?i:i.slice()}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){!e||!this._vertexArrayObjects||this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){const i=this._meshes,s=i.indexOf(e);s!==-1&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,i.length===0&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&(e=this.getVerticesData(E.PositionKind),!e))return;this._extend=Yh(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){const t=this._meshes.length;for(const i in this._vertexBuffers)t===1&&this._vertexBuffers[i].create(),i===E.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo());t===1&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),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(E.PositionKind,o,!1)}if(r.normalsAttrDesc&&r.normalsAttrDesc.count>0){const o=new Float32Array(e,r.normalsAttrDesc.offset,r.normalsAttrDesc.count);t.setVerticesData(E.NormalKind,o,!1)}if(r.tangetsAttrDesc&&r.tangetsAttrDesc.count>0){const o=new Float32Array(e,r.tangetsAttrDesc.offset,r.tangetsAttrDesc.count);t.setVerticesData(E.TangentKind,o,!1)}if(r.uvsAttrDesc&&r.uvsAttrDesc.count>0){const o=new Float32Array(e,r.uvsAttrDesc.offset,r.uvsAttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs2AttrDesc.offset,r.uvs2AttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs3AttrDesc.offset,r.uvs3AttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs4AttrDesc.offset,r.uvs4AttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs5AttrDesc.offset,r.uvs5AttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.uvs6AttrDesc.offset,r.uvs6AttrDesc.count);if(Le.UseOpenGLOrientationForUV)for(let l=1;l0){const o=new Float32Array(e,r.colorsAttrDesc.offset,r.colorsAttrDesc.count);t.setVerticesData(E.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(E.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(E.MatricesIndicesExtraKind,l,!1)}if(r.matricesWeightsAttrDesc&&r.matricesWeightsAttrDesc.count>0){const o=new Float32Array(e,r.matricesWeightsAttrDesc.offset,r.matricesWeightsAttrDesc.count);t.setVerticesData(E.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(E.MatricesIndicesKind,r,e.matricesIndices._updatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,t.setVerticesData(E.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(E.MatricesIndicesExtraKind,r,e.matricesIndicesExtra._updatable)}e.matricesWeights&&(kt._CleanMatricesWeights(e,t),t.setVerticesData(E.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(E.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(E.MatricesIndicesKind),r=t.getVerticesData(E.MatricesIndicesExtraKind),o=e.matricesWeights,l=e.matricesWeightsExtra,h=e.numBoneInfluencer,c=o.length;for(let u=0;uh-1)&&(d=h-1),f>.001){const p=1/f;for(let g=0;g<4;g++)o[u+g]*=p;if(l)for(let g=0;g<4;g++)l[u+g]*=p}else d>=4?(l[u+d-4]=1-f,r[u+d-4]=s):(o[u+d]=1-f,n[u+d]=s)}t.setVerticesData(E.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(E.MatricesIndicesExtraKind,r)}static Parse(e,t,i){const s=new kt(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,ze&&ze.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new si(v.FromArray(e.boundingBoxMinimum),v.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(E.UVKind),e.hasUVs2&&s._delayInfo.push(E.UV2Kind),e.hasUVs3&&s._delayInfo.push(E.UV3Kind),e.hasUVs4&&s._delayInfo.push(E.UV4Kind),e.hasUVs5&&s._delayInfo.push(E.UV5Kind),e.hasUVs6&&s._delayInfo.push(E.UV6Kind),e.hasColors&&s._delayInfo.push(E.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(E.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(E.MatricesWeightsKind),s._delayLoadingFunction=j.ImportVertexData):j.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}class q_{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}}function $_(a,e,t){let i=null;switch(e){case E.PositionKind:i=s=>s.getPositions();break;case E.NormalKind:i=s=>s.getNormals();break;case E.TangentKind:i=s=>s.getTangents();break;case E.UVKind:i=s=>s.getUVs();break;default:return}for(let s=0;s0&&(O.FromFloat32ArrayToRefScaled(t,Math.floor(i[f+d]*16),p,h),l.addToSelf(h));if(n&&r)for(d=0;d<4;d++)p=r[f+d],p>0&&(O.FromFloat32ArrayToRefScaled(t,Math.floor(n[f+d]*16),p,h),l.addToSelf(h));c(a[u],a[u+1],a[u+2],l,o),o.toArray(a,u)}}class Z_{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 Q_{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new Z_,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 q_,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1}}class et extends Ie{static get BILLBOARDMODE_NONE(){return Ie.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return Ie.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return Ie.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return Ie.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return Ie.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return Ie.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._markSubMeshesAsDirty(i=>{i.markAsMiscDirty(),i.markAsPrePassDirty()})}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._setMaterial(e)}_setMaterial(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?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}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 Q_,this._waitingMaterialId=null,this.cullingStrategy=et.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new Q,this.onCollisionPositionChangeObservable=new Q,this.onMaterialChangedObservable=new Q,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=pe.Red(),this.outlineWidth=.02,this.overlayColor=pe.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 X(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 Q,this._onCollisionPositionChange=(i,s,n=null)=>{s.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>ie.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 de(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1: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!==Ie.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();this.resetDrawCache()}}_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:this.getBoundingInfo()}setBoundingInfo(e){return this._boundingInfo=e,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(e,t,i){return this._boundingInfo=new si(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(E.MatricesIndicesKind)&&this.isVerticesDataPresent(E.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===Ie.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 O;(this.rotationQuaternion?this.rotationQuaternion:le.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,t){if(e){const i=Yh(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new si(i.minimum,i.maximum)}if(this.subMeshes)for(let i=0;i{if(s){const o=s._vertexData||(s._vertexData={});return o[r]||this.copyVerticesData(r,o),o[r]}return this.getVerticesData(r)};if(t||(t=n(i)),!t)return null;if(s?(s._outputData?s._outputData.set(t):s._outputData=new Float32Array(t),t=s._outputData):(e.applyMorph&&this.morphTargetManager||e.applySkeleton&&this.skeleton)&&(t=t.slice()),e.applyMorph&&this.morphTargetManager&&$_(t,i,this.morphTargetManager),e.applySkeleton&&this.skeleton){const r=n(E.MatricesIndicesKind),o=n(E.MatricesWeightsKind);if(o&&r){const l=this.numBoneInfluencers>4,h=l?n(E.MatricesIndicesExtraKind):null,c=l?n(E.MatricesWeightsExtraKind):null,u=this.skeleton.getTransformMatrices(this);et._ApplySkeleton(t,i,u,r,o,h,c)}}if(e.updatePositionsArray!==!1&&i===E.PositionKind){const r=this._internalAbstractMeshDataInfo._positions||[],o=r.length;if(r.length=t.length/3,o1||!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=N.Matrix[0],i=N.Matrix[1];return O.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 ns,l=this.getClassName(),h=l==="InstancedLinesMesh"||l==="LinesMesh"||l==="GreasedLineMesh"?this.intersectionThreshold:0,c=this.getBoundingInfo();if(!this.subMeshes||!r&&(!e.intersectsSphere(c.boundingSphere,h)||!e.intersectsBox(c.boundingBox,h)))return o;if(s)return o.hit=!r,o.pickedMesh=r?null:this,o.distance=r?0:v.Distance(e.origin,c.boundingSphere.center),o.subMeshId=0,o;if(!this._generatePointsArray())return o;let u=null;const f=this._scene.getIntersectingSubMeshCandidates(this,e),d=f.length;let p=!1;for(let g=0;g1&&!r&&!_.canIntersects(e))continue;const m=_.intersects(e,this._positions,this.getIndices(),t,i);if(m&&(t||!u||m.distanceo!==this&&o.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),i=0;i{let l=o.includedOnlyMeshes.indexOf(this);l!==-1&&o.includedOnlyMeshes.splice(l,1),l=o.excludedMeshes.indexOf(this),l!==-1&&o.excludedMeshes.splice(l,1);const h=o.getShadowGenerators();if(h){const c=h.values();for(let u=c.next();u.done!==!0;u=c.next()){const d=u.value.getShadowMap();d&&d.renderList&&(l=d.renderList.indexOf(this),l!==-1&&d.renderList.splice(l,1))}}}),(this.getClassName()!=="InstancedMesh"||this.getClassName()!=="InstancedLinesMesh")&&this.releaseSubMeshes();const r=s.getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,r.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),r.wipeCaches(),s.removeMesh(this),this._parentContainer){const o=this._parentContainer.meshes.indexOf(this);o>-1&&this._parentContainer.meshes.splice(o,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;oNe?n.maximum.x-n.minimum.x:Ne,e.bbSize.y=n.maximum.y-n.minimum.y>Ne?n.maximum.y-n.minimum.y:Ne,e.bbSize.z=n.maximum.z-n.minimum.z>Ne?n.maximum.z-n.minimum.z:Ne;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=N.Matrix[5];o.invertToRef(l);const h=N.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,f=0,d=0,p=0,g=0;const _=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),x=this.getFacetsAtLocalCoordinates(e,t,i);if(!x)return null;let I=Number.MAX_VALUE,T=I,y,b,S;for(let A=0;A=0||n&&!r&&u<=0)&&(u=b.x*S.x+b.y*S.y+b.z*S.z,f=-(b.x*e+b.y*t+b.z*i-u)/(b.x*b.x+b.y*b.y+b.z*b.z),d=e+b.x*f,p=t+b.y*f,g=i+b.z*f,l=d-e,h=p-t,c=g-i,T=l*l+h*h+c*c,Te.emitter===this)}}et.OCCLUSION_TYPE_NONE=0;et.OCCLUSION_TYPE_OPTIMISTIC=1;et.OCCLUSION_TYPE_STRICT=2;et.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0;et.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1;et.CULLINGSTRATEGY_STANDARD=0;et.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1;et.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2;et.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3;D([ss.filter((...[a,e,t,i,s])=>!Array.isArray(a)&&!Array.isArray(e)&&!Array.isArray(t)&&!Array.isArray(i)&&!Array.isArray(s))],et,"_ApplySkeleton",null);ft("BABYLON.AbstractMesh",et);class hs{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){Ae.Clone(()=>e,this)}serialize(){return Ae.Serialize(this)}parse(e,t,i){Ae.Parse(()=>this,e,t,i)}}D([B()],hs.prototype,"func",null);D([B()],hs.prototype,"funcRef",null);D([B()],hs.prototype,"funcMask",null);D([B()],hs.prototype,"opStencilFail",null);D([B()],hs.prototype,"opDepthFail",null);D([B()],hs.prototype,"opStencilDepthPass",null);D([B()],hs.prototype,"mask",null);D([B()],hs.prototype,"enabled",null);function uo(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 qh(a,e,t){var h,c,u,f,d,p;const i=!!((h=a.clipPlane)!=null?h:e.clipPlane),s=!!((c=a.clipPlane2)!=null?c:e.clipPlane2),n=!!((u=a.clipPlane3)!=null?u:e.clipPlane3),r=!!((f=a.clipPlane4)!=null?f:e.clipPlane4),o=!!((d=a.clipPlane5)!=null?d:e.clipPlane5),l=!!((p=a.clipPlane6)!=null?p:e.clipPlane6);i&&t.push("#define CLIPPLANE"),s&&t.push("#define CLIPPLANE2"),n&&t.push("#define CLIPPLANE3"),r&&t.push("#define CLIPPLANE4"),o&&t.push("#define CLIPPLANE5"),l&&t.push("#define CLIPPLANE6")}function J_(a,e,t){var c,u,f,d,p,g;let i=!1;const s=!!((c=a.clipPlane)!=null?c:e.clipPlane),n=!!((u=a.clipPlane2)!=null?u:e.clipPlane2),r=!!((f=a.clipPlane3)!=null?f:e.clipPlane3),o=!!((d=a.clipPlane4)!=null?d:e.clipPlane4),l=!!((p=a.clipPlane5)!=null?p:e.clipPlane5),h=!!((g=a.clipPlane6)!=null?g:e.clipPlane6);return t.CLIPPLANE!==s&&(t.CLIPPLANE=s,i=!0),t.CLIPPLANE2!==n&&(t.CLIPPLANE2=n,i=!0),t.CLIPPLANE3!==r&&(t.CLIPPLANE3=r,i=!0),t.CLIPPLANE4!==o&&(t.CLIPPLANE4=o,i=!0),t.CLIPPLANE5!==l&&(t.CLIPPLANE5=l,i=!0),t.CLIPPLANE6!==h&&(t.CLIPPLANE6=h,i=!0),i}function fo(a,e,t){var s,n,r,o,l,h;let i=(s=e.clipPlane)!=null?s:t.clipPlane;Vs(a,"vClipPlane",i),i=(n=e.clipPlane2)!=null?n:t.clipPlane2,Vs(a,"vClipPlane2",i),i=(r=e.clipPlane3)!=null?r:t.clipPlane3,Vs(a,"vClipPlane3",i),i=(o=e.clipPlane4)!=null?o:t.clipPlane4,Vs(a,"vClipPlane4",i),i=(l=e.clipPlane5)!=null?l:t.clipPlane5,Vs(a,"vClipPlane5",i),i=(h=e.clipPlane6)!=null?h:t.clipPlane6,Vs(a,"vClipPlane6",i)}function Vs(a,e,t){t&&a.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d)}const dl=pe.Black(),pl={NUM_MORPH_INFLUENCERS:0};function po(a,e,t){if(!a||a.LOGARITHMICDEPTH||a.indexOf&&a.indexOf("LOGARITHMICDEPTH")>=0){const i=t.activeCamera;i.mode===1&&U.Error("Logarithmic depth is not compatible with orthographic cameras!",20),e.setFloat("logarithmicDepthConstant",2/(Math.log(i.maxZ+1)/Math.LN2))}}function _o(a,e,t,i=!1){t&&a.fogEnabled&&(!e||e.applyFog)&&a.fogMode!==0&&(t.setFloat4("vFogInfos",a.fogMode,a.fogStart,a.fogEnd,a.fogDensity),i?(a.fogColor.toLinearSpaceToRef(dl,a.getEngine().useExactSrgbConversions),t.setColor3("vFogColor",dl)):t.setColor3("vFogColor",a.fogColor))}function eg(a,e,t){pl.NUM_MORPH_INFLUENCERS=t,$h(a,e,pl)}function $h(a,e,t){const i=t.NUM_MORPH_INFLUENCERS;if(i>0&&Ce.LastCreatedEngine){const s=Ce.LastCreatedEngine.getCaps().maxVertexAttribs,n=e.morphTargetManager;if(n!=null&&n.isUsingTextureForTargets)return;const r=n&&n.supportsNormals&&t.NORMAL,o=n&&n.supportsTangents&&t.TANGENT,l=n&&n.supportsUVs&&t.UV1;for(let h=0;hs&&U.Error("Cannot add more vertex attributes for mesh "+e.name)}}function go(a,e=!1){a.push("world0"),a.push("world1"),a.push("world2"),a.push("world3"),e&&(a.push("previousWorld0"),a.push("previousWorld1"),a.push("previousWorld2"),a.push("previousWorld3"))}function mo(a,e){const t=a.morphTargetManager;!a||!t||e.setFloatArray("morphTargetInfluences",t.influences)}function jh(a,e){e.bindToEffect(a,"Scene")}function ds(a,e,t){e._needUVs=!0,e[t]=!0,a.optimizeUVAllocation&&a.getTextureMatrix().isIdentityAs3x2()?(e[t+"DIRECTUV"]=a.coordinatesIndex+1,e["MAINUV"+(a.coordinatesIndex+1)]=!0):e[t+"DIRECTUV"]=0}function ps(a,e,t){const i=a.getTextureMatrix();e.updateMatrix(t+"Matrix",i)}function Zh(a,e,t){t.BAKED_VERTEX_ANIMATION_TEXTURE&&t.INSTANCES&&a.push("bakedVertexAnimationSettingsInstanced")}function tg(a,e){return e.set(a),e}function Qh(a,e,t){if(!(!e||!a)&&(a.computeBonesUsingShaders&&e._bonesComputationForcedToCPU&&(a.computeBonesUsingShaders=!1),a.useBones&&a.computeBonesUsingShaders&&a.skeleton)){const i=a.skeleton;if(i.isUsingTextureForMatrices&&e.getUniformIndex("boneTextureWidth")>-1){const s=i.getTransformMatrixTexture(a);e.setTexture("boneSampler",s),e.setFloat("boneTextureWidth",4*(i.bones.length+1))}else{const s=i.getTransformMatrices(a);s&&(e.setMatrices("mBones",s),t&&a.getScene().prePassRenderer&&a.getScene().prePassRenderer.getIndex(2)&&(t.previousBones[a.uniqueId]||(t.previousBones[a.uniqueId]=s.slice()),e.setMatrices("mPreviousBones",t.previousBones[a.uniqueId]),tg(s,t.previousBones[a.uniqueId])))}}}function ig(a,e,t,i,s,n=!0){a._bindLight(e,t,i,s,n)}function sg(a,e,t,i,s=4){const n=Math.min(e.lightSources.length,s);for(let r=0;r0&&(i.addCPUSkinningFallback(0,e),a.push("matricesIndices"),a.push("matricesWeights"),t.NUM_BONE_INFLUENCERS>4&&(a.push("matricesIndicesExtra"),a.push("matricesWeightsExtra")))}function Jh(a,e){(e.INSTANCES||e.THIN_INSTANCES)&&go(a,!!e.PREPASS_VELOCITY),e.INSTANCESCOLOR&&a.push("instanceColor")}function rg(a,e,t=4,i=0){let s=0;for(let n=0;n0&&(s=i+n,e.addFallback(s,"LIGHT"+n)),a.SHADOWS||(a["SHADOW"+n]&&e.addFallback(i,"SHADOW"+n),a["SHADOWPCF"+n]&&e.addFallback(i,"SHADOWPCF"+n),a["SHADOWPCSS"+n]&&e.addFallback(i,"SHADOWPCSS"+n),a["SHADOWPOISSON"+n]&&e.addFallback(i,"SHADOWPOISSON"+n),a["SHADOWESM"+n]&&e.addFallback(i,"SHADOWESM"+n),a["SHADOWCLOSEESM"+n]&&e.addFallback(i,"SHADOWCLOSEESM"+n));return s++}function ag(a,e){return e.fogEnabled&&a.applyFog&&e.fogMode!==0}function ec(a,e,t,i,s,n,r,o=!1){r._areMiscDirty&&(r.LOGARITHMICDEPTH=t,r.POINTSIZE=i,r.FOG=s&&ag(a,e),r.NONUNIFORMSCALING=a.nonUniformScaling,r.ALPHATEST=n,r.DECAL_AFTER_DETAIL=o)}function og(a,e,t,i,s=4,n=!1){if(!t._areLightsDirty)return t._needNormals;let r=0;const o={needNormals:t._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(a.lightsEnabled&&!n){for(const h of e.lightSources)if(lg(a,e,h,r,t,i,o),r++,r===s)break}t.SPECULARTERM=o.specularEnabled,t.SHADOWS=o.shadowEnabled;for(let h=r;h0&&(r.shadowEnabled=!0,l.prepareDefines(s,i))}}t.lightmapMode!=Xe.LIGHTMAP_DEFAULT?(r.lightmapMode=!0,s["LIGHTMAPEXCLUDED"+i]=!0,s["LIGHTMAPNOSPECULAR"+i]=t.lightmapMode==Xe.LIGHTMAP_SHADOWSONLY):(s["LIGHTMAPEXCLUDED"+i]=!1,s["LIGHTMAPNOSPECULAR"+i]=!1)}function tc(a,e,t,i,s,n=null,r=!1){let o=_g(a,i);n!==!1&&(o=J_(t,a,i)),i.DEPTHPREPASS!==!e.getColorWrite()&&(i.DEPTHPREPASS=!i.DEPTHPREPASS,o=!0),i.INSTANCES!==s&&(i.INSTANCES=s,o=!0),i.THIN_INSTANCES!==r&&(i.THIN_INSTANCES=r,o=!0),o&&i.markAsUnprocessed()}function hg(a,e){if(a.useBones&&a.computeBonesUsingShaders&&a.skeleton){e.NUM_BONE_INFLUENCERS=a.numBoneInfluencers;const t=e.BONETEXTURE!==void 0;if(a.skeleton.isUsingTextureForMatrices&&t)e.BONETEXTURE=!0;else{e.BonesPerMesh=a.skeleton.bones.length+1,e.BONETEXTURE=t?!1:void 0;const i=a.getScene().prePassRenderer;if(i&&i.enabled){const s=i.excludedSkinnedMesh.indexOf(a)===-1;e.BONES_VELOCITY_ENABLED=s}}}else e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.BONETEXTURE!==void 0&&(e.BONETEXTURE=!1)}function cg(a,e){const t=a.morphTargetManager;t?(e.MORPHTARGETS_UV=t.supportsUVs&&e.UV1,e.MORPHTARGETS_TANGENT=t.supportsTangents&&e.TANGENT,e.MORPHTARGETS_NORMAL=t.supportsNormals&&e.NORMAL,e.NUM_MORPH_INFLUENCERS=t.numMaxInfluencers||t.numInfluencers,e.MORPHTARGETS=e.NUM_MORPH_INFLUENCERS>0,e.MORPHTARGETS_TEXTURE=t.isUsingTextureForTargets):(e.MORPHTARGETS_UV=!1,e.MORPHTARGETS_TANGENT=!1,e.MORPHTARGETS_NORMAL=!1,e.MORPHTARGETS=!1,e.NUM_MORPH_INFLUENCERS=0)}function ug(a,e){const t=a.bakedVertexAnimationManager;e.BAKED_VERTEX_ANIMATION_TEXTURE=!!(t&&t.isEnabled)}function ic(a,e,t,i,s=!1,n=!0,r=!0){if(!e._areAttributesDirty&&e._needNormals===e._normals&&e._needUVs===e._uvs)return!1;e._normals=e._needNormals,e._uvs=e._needUVs,e.NORMAL=e._needNormals&&a.isVerticesDataPresent("normal"),e._needNormals&&a.isVerticesDataPresent("tangent")&&(e.TANGENT=!0);for(let o=1;o<=6;++o)e["UV"+o]=e._needUVs?a.isVerticesDataPresent("uv".concat(o===1?"":o)):!1;if(t){const o=a.useVertexColors&&a.isVerticesDataPresent("color");e.VERTEXCOLOR=o,e.VERTEXALPHA=a.hasVertexAlpha&&o&&n}return a.isVerticesDataPresent("instanceColor")&&(a.hasInstances||a.hasThinInstances)&&(e.INSTANCESCOLOR=!0),i&&hg(a,e),s&&cg(a,e),r&&ug(a,e),!0}function fg(a,e){if(a.activeCamera){const t=e.MULTIVIEW;e.MULTIVIEW=a.activeCamera.outputRenderTarget!==null&&a.activeCamera.outputRenderTarget.getViewCount()>1,e.MULTIVIEW!=t&&e.markAsUnprocessed()}}function dg(a,e,t){const i=e.ORDER_INDEPENDENT_TRANSPARENCY,s=e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;e.ORDER_INDEPENDENT_TRANSPARENCY=a.useOrderIndependentTransparency&&t,e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!a.getEngine().getCaps().textureFloatLinearFiltering,(i!==e.ORDER_INDEPENDENT_TRANSPARENCY||s!==e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&e.markAsUnprocessed()}function pg(a,e,t){const i=e.PREPASS;if(!e._arePrePassDirty)return;const s=[{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(a.prePassRenderer&&a.prePassRenderer.enabled&&t){e.PREPASS=!0,e.SCENE_MRT_COUNT=a.prePassRenderer.mrtCount,e.PREPASS_NORMAL_WORLDSPACE=a.prePassRenderer.generateNormalsInWorldSpace;for(let n=0;n{},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||Ce.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||ee.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new ln(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new de(this._scene.getEngine(),void 0,void 0,e),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,i||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),q.OnEventObservable.notifyObservers(this,1))}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}_getEffectiveOrientation(e){return this.sideOrientation!==null?this.sideOrientation:e.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._forceAlphaTest=e===q.MATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _disableAlphaBlending(){return this._transparencyMode===q.MATERIAL_OPAQUE||this._transparencyMode===q.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)if(s.getMaterial()===this)for(const n of s._drawWrappers)n&&this._materialContext===n.materialContext&&(n._wasPreviouslyReady=!1,n._wasPreviouslyUsingInstances=null,n._forceRebindOnNextCall=e)}e&&this.markAsDirty(q.AllDirtyFlag)}_preBind(e,t=null){const i=this._scene.getEngine(),n=(t==null?this.sideOrientation:t)===q.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(8,this._eventInfo),e.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(e,t,i){const s=i._drawWrapper;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,i){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&t&&(this._needToBindSceneUbo=!1,jh(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 s=this._scene.getEngine();this._cachedDepthWriteState=s.getDepthWrite(),s.setDepthWrite(!1)}if(this.disableColorWrite){const s=this._scene.getEngine();this._cachedColorWriteState=s.getColorWrite(),s.setColorWrite(!1)}if(this.depthFunction!==0){const s=this._scene.getEngine();this._cachedDepthFunctionState=s.getDepthFunction()||0,s.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(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(e){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=e,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(e){return null}_clonePlugins(e,t){const i={};if(this._serializePlugins(i),q._ParsePlugins(i,e,this._scene,t),this.pluginManager)for(const s of this.pluginManager._plugins){const n=e.pluginManager.getPlugin(s.name);n&&s.copyTo(n)}}getBindedMeshes(){if(this.meshMap){const e=[];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 Yt(0,0,0,1)),this._storeEffectOnSubMeshes){let c=!0,u=null;if(e.subMeshes){const f=new vi(0,0,0,0,0,e,void 0,!1,!1);f.materialDefines&&(f.materialDefines._renderId=-1),this.isReadyForSubMesh(e,f,n.useInstances)||(f.effect&&f.effect.getCompilationError()&&f.effect.allFallbacksProcessed()?u=f.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||(q._DirtyCallbackArray.length=0,e&q.TextureDirtyFlag&&q._DirtyCallbackArray.push(q._TextureDirtyCallBack),e&q.LightDirtyFlag&&q._DirtyCallbackArray.push(q._LightsDirtyCallBack),e&q.FresnelDirtyFlag&&q._DirtyCallbackArray.push(q._FresnelDirtyCallBack),e&q.AttributesDirtyFlag&&q._DirtyCallbackArray.push(q._AttributeDirtyCallBack),e&q.MiscDirtyFlag&&q._DirtyCallbackArray.push(q._MiscDirtyCallBack),e&q.PrePassDirtyFlag&&q._DirtyCallbackArray.push(q._PrePassDirtyCallBack),q._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(q._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(q._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(q._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(q._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(q._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(q._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(q._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(q._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(q._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(q._MiscDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(q._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){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(2,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){const i=e.geometry;if(i)if(this._storeEffectOnSubMeshes){if(e.subMeshes)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=Ae.Serialize(this);return e.stencil=this.stencil.serialize(),e.uniqueId=this.uniqueId,this._serializePlugins(e),e}_serializePlugins(e){if(e.plugins={},this.pluginManager)for(const t of this.pluginManager._plugins)e.plugins[t.getClassName()]=t.serialize()}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 U.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const n=ee.Instantiate(e.customType).Parse(e,t,i);return n._loadedUniqueId=e.uniqueId,n}static _ParsePlugins(e,t,i,s){var n;if(e.plugins)for(const r in e.plugins){const o=e.plugins[r];let l=(n=t.pluginManager)==null?void 0:n.getPlugin(o.name);if(!l){const h=ee.Instantiate("BABYLON."+r);h&&(l=new h(t))}l==null||l.parse(o,i,s)}}}q.TriangleFillMode=0;q.WireFrameFillMode=1;q.PointFillMode=2;q.PointListDrawMode=3;q.LineListDrawMode=4;q.LineLoopDrawMode=5;q.LineStripDrawMode=6;q.TriangleStripDrawMode=7;q.TriangleFanDrawMode=8;q.ClockWiseSideOrientation=0;q.CounterClockWiseSideOrientation=1;q.TextureDirtyFlag=1;q.LightDirtyFlag=2;q.FresnelDirtyFlag=4;q.AttributesDirtyFlag=8;q.MiscDirtyFlag=16;q.PrePassDirtyFlag=32;q.AllDirtyFlag=63;q.MATERIAL_OPAQUE=0;q.MATERIAL_ALPHATEST=1;q.MATERIAL_ALPHABLEND=2;q.MATERIAL_ALPHATESTANDBLEND=3;q.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0;q.MATERIAL_NORMALBLENDMETHOD_RNM=1;q.OnEventObservable=new Q;q._AllDirtyCallBack=a=>a.markAllAsDirty();q._ImageProcessingDirtyCallBack=a=>a.markAsImageProcessingDirty();q._TextureDirtyCallBack=a=>a.markAsTexturesDirty();q._FresnelDirtyCallBack=a=>a.markAsFresnelDirty();q._MiscDirtyCallBack=a=>a.markAsMiscDirty();q._PrePassDirtyCallBack=a=>a.markAsPrePassDirty();q._LightsDirtyCallBack=a=>a.markAsLightDirty();q._AttributeDirtyCallBack=a=>a.markAsAttributesDirty();q._FresnelAndMiscDirtyCallBack=a=>{q._FresnelDirtyCallBack(a),q._MiscDirtyCallBack(a)};q._TextureAndMiscDirtyCallBack=a=>{q._TextureDirtyCallBack(a),q._MiscDirtyCallBack(a)};q._DirtyCallbackArray=[];q._RunDirtyCallBacks=a=>{for(const e of q._DirtyCallbackArray)e(a)};D([B()],q.prototype,"id",void 0);D([B()],q.prototype,"uniqueId",void 0);D([B()],q.prototype,"name",void 0);D([B()],q.prototype,"metadata",void 0);D([B()],q.prototype,"checkReadyOnEveryCall",void 0);D([B()],q.prototype,"checkReadyOnlyOnce",void 0);D([B()],q.prototype,"state",void 0);D([B("alpha")],q.prototype,"_alpha",void 0);D([B("backFaceCulling")],q.prototype,"_backFaceCulling",void 0);D([B("cullBackFaces")],q.prototype,"_cullBackFaces",void 0);D([B()],q.prototype,"sideOrientation",void 0);D([B("alphaMode")],q.prototype,"_alphaMode",void 0);D([B()],q.prototype,"_needDepthPrePass",void 0);D([B()],q.prototype,"disableDepthWrite",void 0);D([B()],q.prototype,"disableColorWrite",void 0);D([B()],q.prototype,"forceDepthWrite",void 0);D([B()],q.prototype,"depthFunction",void 0);D([B()],q.prototype,"separateCullingPass",void 0);D([B("fogEnabled")],q.prototype,"_fogEnabled",void 0);D([B()],q.prototype,"pointSize",void 0);D([B()],q.prototype,"zOffset",void 0);D([B()],q.prototype,"zOffsetUnits",void 0);D([B()],q.prototype,"pointsCloud",null);D([B()],q.prototype,"fillMode",null);D([B()],q.prototype,"useLogarithmicDepth",null);D([B()],q.prototype,"transparencyMode",null);class tn extends q{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().addMultiMaterial(this),this.subMaterials=[],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 tn(e.name,t);return i.id=e.id,i._loadedUniqueId=e.uniqueId,ze&&ze.AddTagsTo(i,e.tags),e.materialsUniqueIds?i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds:e.materials.forEach(s=>i.subMaterials.push(t.getLastMaterialById(s))),i}}ft("BABYLON.MultiMaterial",tn);class vg{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}class sc{}class xg{constructor(){this.visibleInstances={},this.batchCache=new _l,this.batchCacheReplacementModeInFrozenMode=new _l,this.instancesBufferSize=32*16*4}}class _l{constructor(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class bg{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=32*16,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class yg{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 F extends et{static _GetDefaultSideOrientation(e){return e||F.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(E.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(E.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 Q),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new Q),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new Q),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new Q),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new Q),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(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&e===1||!this._scene.useRightHandedSystem&&e===0}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&this.material.sideOrientation===null||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(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 yg,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._instanceDataStorage=new xg,this._thinInstanceDataStorage=new bg,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=F.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(o,l,h)=>{o&&h&&(this._uniformBuffer?this.transferToEffect(l):h.bindOnlyWorldMatrix(l))},s){if(s._geometry&&s._geometry.applyToMesh(this),Ya.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","physicsBody","physicsImpostor"],["_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,ze&&ze.HasTags(s)&&ze.AddTagsTo(this,ze.GetTags(s,!0)),this.setEnabled(s.isEnabled(!1)),this.parent=s.parent,this.setPivotMatrix(s.getPivotMatrix(),this._postMultiplyPivotMatrix),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 Q(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 U.Warn("You cannot use a mesh as LOD level twice"),this;const i=new vg(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 r=this.material||s.defaultMaterial;if(r){if(r._storeEffectOnSubMeshes)for(const g of this.subMeshes){const _=g.getMaterial();if(_){if(_._storeEffectOnSubMeshes){if(!_.isReadyForSubMesh(this,g,n))return!1}else if(!_.isReady(this,n))return!1}}else if(!r.isReady(this,n))return!1}const o=i.currentRenderPassId;for(const g of this.lightSources){const _=g.getShadowGenerators();if(!_)continue;const m=_.values();for(let x=m.next();x.done!==!0;x=m.next()){const I=x.value;if(I&&(!((l=I.getShadowMap())!=null&&l.renderList)||(h=I.getShadowMap())!=null&&h.renderList&&((u=(c=I.getShadowMap())==null?void 0:c.renderList)==null?void 0:u.indexOf(this))!==-1)){const y=(f=I.getShadowMap().renderPassIds)!=null?f:[i.currentRenderPassId];for(let b=0;b0){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 vi(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++)vi.CreateFromIndices(0,s,n===e-1?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),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 kt(kt.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=kt.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(E.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(E.PositionKind,i,!1,!1),t){const s=this.getIndices(),n=this.getVerticesData(E.NormalKind);if(!n)return this;j.ComputeNormals(i,s,n),this.updateVerticesData(E.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(kt.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i){let s=this._geometry;s||(s=new kt(kt.RandomId(),this.getScene(),void 0,void 0,this)),s.setIndexBuffer(e,t,i)}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 kt(kt.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();let r;if(this._unIndexed)r=null;else switch(this._getRenderingFillMode(i)){case q.PointFillMode:r=null;break;case q.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case q.TriangleFillMode:r=this._geometry.getIndexBuffer();break}return this._bindDirect(t,r,s)}_bindDirect(e,t,i=!0){return this._geometry?(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),!i||!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(e,t):this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),this):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==q.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==q.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 x;const r=i.visibleInstances[e._id],o=r?r.length:0,l=this._instanceDataStorage,h=l.instancesBufferSize;let c=l.instancesBuffer,u=l.instancesPreviousBuffer;const d=(o+1)*16*4;for(;l.instancesBufferSizey._distanceToCamera>b._distanceToCamera?-1:y._distanceToCamera1&&s.activeCamera===s.activeCameras[0]||n<=1)&&this._checkOcclusionQuery()&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const o=this._getInstancesRenderList(e._id,!!i);if(o.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const l=s.getEngine();let h=0,c=null;this.ignoreCameraMaxZ&&s.activeCamera&&!s._isInIntermediateRendering()&&(h=s.activeCamera.maxZ,c=s.activeCamera,s.activeCamera.maxZ=0,s.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const u=e.getRenderingMesh(),f=o.hardwareInstancedRendering[e._id]||u.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,d=this._instanceDataStorage,p=e.getMaterial();if(!p)return c&&(c.maxZ=h,s.updateTransformMatrix(!0)),this;if(!d.isFrozen||!this._internalMeshDataInfo._effectiveMaterial||this._internalMeshDataInfo._effectiveMaterial!==p){if(p._storeEffectOnSubMeshes){if(!p.isReadyForSubMesh(this,e,f))return c&&(c.maxZ=h,s.updateTransformMatrix(!0)),this}else if(!p.isReady(this,f))return c&&(c.maxZ=h,s.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=p}else if(p._storeEffectOnSubMeshes&&!((M=e._drawWrapper)!=null&&M._wasPreviouslyReady)||!p._storeEffectOnSubMeshes&&!p._getDrawWrapper()._wasPreviouslyReady)return c&&(c.maxZ=h,s.updateTransformMatrix(!0)),this;t&&l.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);let g;this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?g=e._drawWrapper:g=this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const _=(C=g==null?void 0:g.effect)!=null?C:null;for(const w of s._beforeRenderingMeshStage)w.action(this,e,o,_);if(!g||!_)return c&&(c.maxZ=h,s.updateTransformMatrix(!0)),this;const m=i||this;let x;if(!d.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||this._internalMeshDataInfo._effectiveMaterial.sideOrientation!==null||this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)){const w=m._getWorldMatrixDeterminant();x=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),w<0&&(x=x===q.ClockWiseSideOrientation?q.CounterClockWiseSideOrientation:q.ClockWiseSideOrientation),d.sideOrientation=x}else x=d.sideOrientation;const I=this._internalMeshDataInfo._effectiveMaterial._preBind(g,x);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&l.setDepthWrite(!0);const T=this._internalMeshDataInfo._effectiveMaterial,y=T.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),f||this._bind(e,_,y,!1);const b=m.getWorldMatrix();T._storeEffectOnSubMeshes?T.bindForSubMesh(b,this,e):T.bind(b,this),!T.backFaceCulling&&T.separateCullingPass&&(l.setState(!0,T.zOffset,!1,!I,T.cullBackFaces,T.stencil,T.zOffsetUnits),this._processRendering(this,e,_,y,o,f,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),l.setState(!0,T.zOffset,!1,I,T.cullBackFaces,T.stencil,T.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,_,y,o,f,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const w of s._afterRenderingMeshStage)w.action(this,e,o,_);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),c&&(c.maxZ=h,s.updateTransformMatrix(!0)),s.performancePriority===2&&!d.isFrozen&&this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(E.MatricesWeightsKind)&&(this.isVerticesDataPresent(E.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){const e=this.getVerticesData(E.MatricesWeightsKind),t=e.length;for(let i=0;im&&s++,y!==0&&I++,x+=y,m=y}if(h[I]++,I>r&&(r=I),x===0)n++;else{const T=1/x;let y=0;for(let b=0;bc&&o++}}const u=this.skeleton.bones.length,f=this.getVerticesData(E.MatricesIndicesKind),d=this.getVerticesData(E.MatricesIndicesExtraKind);let p=0;for(let _=0;_=u||x<0)&&p++}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 = "+p;return{skinned:!0,valid:n===0&&o===0&&p===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 ee.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=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(E.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(E.PositionKind);const s=v.Zero();let n;for(n=0;n{const f=u.width,d=u.height,g=this.getEngine().createCanvas(f,d).getContext("2d");g.drawImage(u,0,0);const _=g.getImageData(0,0,f,d).data;this.applyDisplacementMapFromBuffer(_,f,d,t,i,n,r,o),s&&s(this)};return ee.LoadImage(e,c,l||(()=>{}),h.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,n,r,o,l=!1){if(!this.isVerticesDataPresent(E.PositionKind)||!this.isVerticesDataPresent(E.NormalKind)||!this.isVerticesDataPresent(E.UVKind))return U.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const h=this.getVerticesData(E.PositionKind,!0,!0),c=this.getVerticesData(E.NormalKind),u=this.getVerticesData(E.UVKind);let f=v.Zero();const d=v.Zero(),p=fe.Zero();r=r||fe.Zero(),o=o||new fe(1,1);for(let g=0;g{const c=new Float32Array(i.length*h);let u=0;for(let f=0;f{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(E.MatricesIndicesExtraKind):null,c=l?this.getVerticesData(E.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),f=v.Zero(),d=new O,p=new O;let g=0,_;for(let m=0;m0&&(O.FromFloat32ArrayToRefScaled(u,Math.floor(r[g+_]*16),x,p),d.addToSelf(p));if(l)for(_=0;_<4;_++)x=c[g+_],x>0&&(O.FromFloat32ArrayToRefScaled(u,Math.floor(h[g+_]*16),x,p),d.addToSelf(p));v.TransformCoordinatesFromFloatsToRef(i._sourcePositions[m],i._sourcePositions[m+1],i._sourcePositions[m+2],d,f),f.toArray(s,m),t&&(v.TransformNormalFromFloatsToRef(i._sourceNormals[m],i._sourceNormals[m+1],i._sourceNormals[m+2],d,f),f.toArray(n,m)),d.reset()}return this.updateVerticesData(E.PositionKind,s),t&&this.updateVerticesData(E.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?F.MinMax(e):e;return v.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,n,r){return co(F._MergeMeshesCoroutine(e,t,i,s,n,r,!1))}static MergeMeshesAsync(e,t=!0,i,s,n,r){return X_(F._MergeMeshesCoroutine(e,t,i,s,n,r,!0),W_())}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 S=0;for(l=0;l=65536)return U.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,f=e[0].sideOrientation;for(l=0;l{const A=S.computeWorldMatrix(!0);return{vertexData:j.ExtractFromMesh(S,!1,!1),transform:A}},{vertexData:g,transform:_}=p(d);o&&(yield);const m=new Array(e.length-1);for(let S=1;S{throw Te("GroundMesh")};F._GoldbergMeshParser=(a,e)=>{throw Te("GoldbergMesh")};F._LinesMeshParser=(a,e)=>{throw Te("LinesMesh")};F._GreasedLineMeshParser=(a,e)=>{throw Te("GreasedLineMesh")};F._GreasedLineRibbonMeshParser=(a,e)=>{throw Te("GreasedLineRibbonMesh")};F._TrailMeshParser=(a,e)=>{throw Te("TrailMesh")};ft("BABYLON.Mesh",F);class Tg{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=xi.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:xi.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}}Di.EASINGMODE_EASEIN=0;Di.EASINGMODE_EASEOUT=1;Di.EASINGMODE_EASEINOUT=2;class Sg extends Di{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 Eg extends Di{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)}}class Fr{constructor(e,t,i){this.name=e,this.from=t,this.to=i}clone(){return new Fr(this.name,this.from,this.to)}}const Ig=Object.freeze(new le(0,0,0,0)),Ag=Object.freeze(v.Zero()),Cg=Object.freeze(fe.Zero()),Mg=Object.freeze(oi.Zero()),Rg=Object.freeze(pe.Black()),Pg=Object.freeze(new X(0,0,0,0)),Ii={key:0,repeatCount:0,loopMode:2};class se{static _PrepareAnimation(e,t,i,s,n,r,o,l){let h;if(!isNaN(parseFloat(n))&&isFinite(n)?h=se.ANIMATIONTYPE_FLOAT:n instanceof le?h=se.ANIMATIONTYPE_QUATERNION:n instanceof v?h=se.ANIMATIONTYPE_VECTOR3:n instanceof fe?h=se.ANIMATIONTYPE_VECTOR2:n instanceof pe?h=se.ANIMATIONTYPE_COLOR3:n instanceof X?h=se.ANIMATIONTYPE_COLOR4:n instanceof oi&&(h=se.ANIMATIONTYPE_SIZE),h==null)return null;const c=new se(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 se(e+"Animation",e,i,t,se.ANIMATIONLOOPMODE_CONSTANT);return n.setEasingFunction(s),n}static CreateAndStartAnimation(e,t,i,s,n,r,o,l,h,c,u){const f=se._PrepareAnimation(e,i,s,n,r,o,l,h);return!f||(t.getScene&&(u=t.getScene()),!u)?null:u.beginDirectAnimation(t,[f],0,n,f.loopMode===1,1,c)}static CreateAndStartHierarchyAnimation(e,t,i,s,n,r,o,l,h,c,u){const f=se._PrepareAnimation(e,s,n,r,o,l,h,c);return f?t.getScene().beginDirectHierarchyAnimation(t,i,[f],0,r,f.loopMode===1,1,u):null}static CreateMergeAndStartAnimation(e,t,i,s,n,r,o,l,h,c){const u=se._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,i,s=!1,n){var x,I;let r;typeof t=="object"?r=t:r={referenceFrame:t!=null?t:0,range:i,cloneOriginalAnimation:s,clonedAnimationName:n};let o=e;if(r.cloneOriginalAnimation&&(o=e.clone(),o.name=r.clonedAnimationName||o.name),!o._keys.length)return o;const l=r.referenceFrame&&r.referenceFrame>=0?r.referenceFrame:0;let h=0;const c=o._keys[0];let u=o._keys.length-1;const f=o._keys[u],d={referenceValue:c.value,referencePosition:N.Vector3[0],referenceQuaternion:N.Quaternion[0],referenceScaling:N.Vector3[1],keyPosition:N.Vector3[2],keyQuaternion:N.Quaternion[1],keyScaling:N.Vector3[3]};let p=c.frame,g=f.frame;if(r.range){const T=o.getRange(r.range);T&&(p=T.from,g=T.to)}else p=(x=r.fromFrame)!=null?x:p,g=(I=r.toFrame)!=null?I:g;if(p!==c.frame&&(h=o.createKeyForFrame(p)),g!==f.frame&&(u=o.createKeyForFrame(g)),o._keys.length===1){const T=o._getKeyValue(o._keys[0]);d.referenceValue=T.clone?T.clone():T}else if(l<=c.frame){const T=o._getKeyValue(c.value);d.referenceValue=T.clone?T.clone():T}else if(l>=f.frame){const T=o._getKeyValue(f.value);d.referenceValue=T.clone?T.clone():T}else{Ii.key=0;const T=o._interpolate(l,Ii);d.referenceValue=T.clone?T.clone():T}o.dataType===se.ANIMATIONTYPE_QUATERNION?d.referenceValue.normalize().conjugateInPlace():o.dataType===se.ANIMATIONTYPE_MATRIX&&(d.referenceValue.decompose(d.referenceScaling,d.referenceQuaternion,d.referencePosition),d.referenceQuaternion.normalize().conjugateInPlace());let _=Number.MAX_VALUE;const m=r.clipKeys?[]:null;for(let T=h;T<=u;T++){let y=o._keys[T];if((m||r.cloneOriginalAnimation)&&(y={frame:y.frame,value:y.value.clone?y.value.clone():y.value,inTangent:y.inTangent,outTangent:y.outTangent,interpolation:y.interpolation,lockedTangent:y.lockedTangent},m&&(_===Number.MAX_VALUE&&(_=y.frame),y.frame-=_,m.push(y))),!(T&&o.dataType!==se.ANIMATIONTYPE_FLOAT&&y.value===c.value))switch(o.dataType){case se.ANIMATIONTYPE_MATRIX:y.value.decompose(d.keyScaling,d.keyQuaternion,d.keyPosition),d.keyPosition.subtractInPlace(d.referencePosition),d.keyScaling.divideInPlace(d.referenceScaling),d.referenceQuaternion.multiplyToRef(d.keyQuaternion,d.keyQuaternion),O.ComposeToRef(d.keyScaling,d.keyQuaternion,d.keyPosition,y.value);break;case se.ANIMATIONTYPE_QUATERNION:d.referenceValue.multiplyToRef(y.value,y.value);break;case se.ANIMATIONTYPE_VECTOR2:case se.ANIMATIONTYPE_VECTOR3:case se.ANIMATIONTYPE_COLOR3:case se.ANIMATIONTYPE_COLOR4:y.value.subtractToRef(d.referenceValue,y.value);break;case se.ANIMATIONTYPE_SIZE:y.value.width-=d.referenceValue.width,y.value.height-=d.referenceValue.height;break;default:y.value-=d.referenceValue}}return m&&o.setKeys(m,!0),o}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?se.ANIMATIONLOOPMODE_CYCLE:n,this.uniqueId=se._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 s=this._keys,n=s.length;let r=t.key;for(;r>=0&&e=s[r+1].frame;)++r;if(t.key=r,r<0)return i?void 0:this._getKeyValue(s[0].value);if(r+1>n-1)return i?void 0:this._getKeyValue(s[n-1].value);const o=s[r],l=s[r+1];if(i&&(e===o.frame||e===l.frame))return;const h=this._getKeyValue(o.value),c=this._getKeyValue(l.value);if(o.interpolation===1)return l.frame>e?h:c;const u=o.outTangent!==void 0&&l.inTangent!==void 0,f=l.frame-o.frame;let d=(e-o.frame)/f;const p=o.easingFunction||this.getEasingFunction();switch(p!==null&&(d=p.ease(d)),this.dataType){case se.ANIMATIONTYPE_FLOAT:{const _=u?this.floatInterpolateFunctionWithTangents(h,o.outTangent*f,c,l.inTangent*f,d):this.floatInterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return((g=t.offsetValue)!=null?g:0)*t.repeatCount+_}break}case se.ANIMATIONTYPE_QUATERNION:{const _=u?this.quaternionInterpolateFunctionWithTangents(h,o.outTangent.scale(f),c,l.inTangent.scale(f),d):this.quaternionInterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return _.addInPlace((t.offsetValue||Ig).scale(t.repeatCount))}return _}case se.ANIMATIONTYPE_VECTOR3:{const _=u?this.vector3InterpolateFunctionWithTangents(h,o.outTangent.scale(f),c,l.inTangent.scale(f),d):this.vector3InterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return _.add((t.offsetValue||Ag).scale(t.repeatCount))}break}case se.ANIMATIONTYPE_VECTOR2:{const _=u?this.vector2InterpolateFunctionWithTangents(h,o.outTangent.scale(f),c,l.inTangent.scale(f),d):this.vector2InterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return _.add((t.offsetValue||Cg).scale(t.repeatCount))}break}case se.ANIMATIONTYPE_SIZE:{switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(h,c,d);case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(h,c,d).add((t.offsetValue||Mg).scale(t.repeatCount))}break}case se.ANIMATIONTYPE_COLOR3:{const _=u?this.color3InterpolateFunctionWithTangents(h,o.outTangent.scale(f),c,l.inTangent.scale(f),d):this.color3InterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return _.add((t.offsetValue||Rg).scale(t.repeatCount))}break}case se.ANIMATIONTYPE_COLOR4:{const _=u?this.color4InterpolateFunctionWithTangents(h,o.outTangent.scale(f),c,l.inTangent.scale(f),d):this.color4InterpolateFunction(h,c,d);switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return _;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return _.add((t.offsetValue||Pg).scale(t.repeatCount))}break}case se.ANIMATIONTYPE_MATRIX:{switch(t.loopMode){case se.ANIMATIONLOOPMODE_CYCLE:case se.ANIMATIONLOOPMODE_CONSTANT:case se.ANIMATIONLOOPMODE_YOYO:return se.AllowMatricesInterpolation?this.matrixInterpolateFunction(h,c,d,t.workValue):h;case se.ANIMATIONLOOPMODE_RELATIVE:case se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return h}break}}return 0}matrixInterpolateFunction(e,t,i,s){return se.AllowMatrixDecomposeForInterpolation?s?(O.DecomposeLerpToRef(e,t,i,s),s):O.DecomposeLerp(e,t,i):s?(O.LerpToRef(e,t,i,s),s):O.Lerp(e,t,i)}clone(){const e=new se(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,t=!1){this._keys=t?e:e.slice(0)}createKeyForFrame(e){Ii.key=0;const t=this._interpolate(e,Ii,!0);if(!t)return this._keys[Ii.key].frame===e?Ii.key:Ii.key+1;const i={frame:e,value:t.clone?t.clone():t};return this._keys.splice(Ii.key+1,0,i),Ii.key+1}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 se.ANIMATIONTYPE_QUATERNION:if(n=le.FromArray(o.values),o.values.length>=8){const f=le.FromArray(o.values.slice(4,8));f.equals(le.Zero())||(l=f)}if(o.values.length>=12){const f=le.FromArray(o.values.slice(8,12));f.equals(le.Zero())||(h=f)}o.values.length>=13&&(c=o.values[12]);break;case se.ANIMATIONTYPE_MATRIX:n=O.FromArray(o.values),o.values.length>=17&&(c=o.values[16]);break;case se.ANIMATIONTYPE_COLOR3:n=pe.FromArray(o.values),o.values[3]&&(l=pe.FromArray(o.values[3])),o.values[4]&&(h=pe.FromArray(o.values[4])),o.values[5]&&(c=o.values[5]);break;case se.ANIMATIONTYPE_COLOR4:n=X.FromArray(o.values),o.values[4]&&(l=X.FromArray(o.values[4])),o.values[5]&&(h=X.FromArray(o.values[5])),o.values[6]&&(c=X.FromArray(o.values[6]));break;case se.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 Ft;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=[];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 Ft;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=[];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()})}}se._UniqueIdGenerator=0;se.AllowMatricesInterpolation=!1;se.AllowMatrixDecomposeForInterpolation=!0;se.SnippetUrl="https://snippet.babylonjs.com";se.ANIMATIONTYPE_FLOAT=0;se.ANIMATIONTYPE_VECTOR3=1;se.ANIMATIONTYPE_QUATERNION=2;se.ANIMATIONTYPE_MATRIX=3;se.ANIMATIONTYPE_COLOR3=4;se.ANIMATIONTYPE_COLOR4=7;se.ANIMATIONTYPE_VECTOR2=5;se.ANIMATIONTYPE_SIZE=6;se.ANIMATIONLOOPMODE_RELATIVE=0;se.ANIMATIONLOOPMODE_CYCLE=1;se.ANIMATIONLOOPMODE_CONSTANT=2;se.ANIMATIONLOOPMODE_YOYO=4;se.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5;se.CreateFromSnippetAsync=se.ParseFromSnippetAsync;ft("BABYLON.Animation",se);mt._AnimationRangeFactory=(a,e,t)=>new Fr(a,e,t);class Ds{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&&(i.computeWorldMatrix(!0),i.getBoundingInfo)){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||(Ds.EasingFunction.setEasingMode(Ds.EasingMode),this._radiusBounceTransition=se.CreateAnimation("radius",se.ANIMATIONTYPE_FLOAT,60,Ds.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const t=se.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()}}Ds.EasingFunction=new Sg(.3);Ds.EasingMode=Di.EASINGMODE_EASEOUT;class jt{constructor(){this.onTargetFramingAnimationEndObservable=new Q,this._mode=jt.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();jt.EasingFunction.setEasingMode(jt.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&&i.getBoundingInfo&&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),!0}_calculateLowerRadiusFromModelBoundingSphere(e,t){const i=this._attachedCamera;if(!i)return 0;let s=i._calculateLowerRadiusFromModelBoundingSphere(e,t,this._radiusScale);return i.lowerRadiusLimit&&this._mode===jt.IgnoreBoundsSizeMode&&(s=si.upperRadiusLimit?i.upperRadiusLimit:s),s}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;const e=xi.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=se.CreateAnimation("beta",se.ANIMATIONTYPE_FLOAT,60,jt.EasingFunction));const s=se.TransitionTo("beta",t,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});s&&this._animatables.push(s)}}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=xi.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}}jt.EasingFunction=new Eg;jt.EasingMode=Di.EASINGMODE_EASEINOUT;jt.IgnoreBoundsSizeMode=0;jt.FitFrustumSidesMode=1;mt.AddNodeConstructor("TargetCamera",(a,e)=>()=>new Mt(a,v.Zero(),e));class Mt extends ve{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 le,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=O.Zero(),this._camMatrix=O.Zero(),this._cameraTransformMatrix=O.Zero(),this._cameraRotationMatrix=O.Zero(),this._referencePoint=new v(0,0,1),this._transformedReferencePoint=v.Zero(),this._deferredPositionUpdate=new v,this._deferredRotationQuaternionUpdate=new le,this._deferredRotationUpdate=new v,this._deferredUpdated=!1,this._deferOnly=!1,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 le(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+=Ne),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),O.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&&le.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(N.Matrix[0]),v.TransformNormalToRef(this.cameraDirection,N.Matrix[0],N.Vector3[0]),this._deferredPositionUpdate.addInPlace(N.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){const e=this.invertRotation?-this.inverseRotationSpeed:1,t=this._decideIfNeedsToMove(),i=this.cameraRotation.x||this.cameraRotation.y;this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),t&&this._updatePosition(),i&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*e,this._deferredRotationUpdate.y+=this.cameraRotation.y*e,this.noRotationConstraint||(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(le.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),t&&(Math.abs(this.cameraDirection.x){}}add(e){const t=e.getSimpleName();if(this.attached[t]){U.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=ve.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=Ae.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=Mn[i];if(s){const n=t[i],r=Ae.Parse(()=>new s,n,null);this.add(r)}}}else for(const i in this.attached){const s=Mn[this.attached[i].getClassName()];if(s){const n=Ae.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(n)}}}}class nc{constructor(){this._currentActiveButton=-1,this.buttons=[0,1,2]}attachControl(e){e=ee.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 u,f;const l=o.event,h=l.pointerType==="touch";if(o.type!==Re.POINTERMOVE&&this.buttons.indexOf(l.button)===-1)return;const c=l.target;if(this._altKey=l.altKey,this._ctrlKey=l.ctrlKey,this._metaKey=l.metaKey,this._shiftKey=l.shiftKey,this._buttonsPressed=l.buttons,t.isPointerLock){const d=l.movementX,p=l.movementY;this.onTouch(null,d,p),this._pointA=null,this._pointB=null}else{if(o.type!==Re.POINTERDOWN&&o.type!==Re.POINTERDOUBLETAP&&h&&((u=this._pointA)==null?void 0:u.pointerId)!==l.pointerId&&((f=this._pointB)==null?void 0:f.pointerId)!==l.pointerId)return;if(o.type===Re.POINTERDOWN&&(this._currentActiveButton===-1||h)){try{c==null||c.setPointerCapture(l.pointerId)}catch{}if(this._pointA===null)this._pointA={x:l.clientX,y:l.clientY,pointerId:l.pointerId,type:l.pointerType};else if(this._pointB===null)this._pointB={x:l.clientX,y:l.clientY,pointerId:l.pointerId,type:l.pointerType};else return;this._currentActiveButton===-1&&!h&&(this._currentActiveButton=l.button),this.onButtonDown(l),e||(l.preventDefault(),i&&i.focus())}else if(o.type===Re.POINTERDOUBLETAP)this.onDoubleTap(l.pointerType);else if(o.type===Re.POINTERUP&&(this._currentActiveButton===l.button||h)){try{c==null||c.releasePointerCapture(l.pointerId)}catch{}h||(this._pointB=null),t._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==l.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==l.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(l),e||l.preventDefault()}else if(o.type===Re.POINTERMOVE){if(e||l.preventDefault(),this._pointA&&this._pointB===null){const d=l.clientX-this._pointA.x,p=l.clientY-this._pointA.y;this.onTouch(this._pointA,d,p),this._pointA.x=l.clientX,this._pointA.y=l.clientY}else if(this._pointA&&this._pointB){const d=this._pointA.pointerId===l.pointerId?this._pointA:this._pointB;d.x=l.clientX,d.y=l.clientY;const p=this._pointA.x-this._pointB.x,g=this._pointA.y-this._pointB.y,_=p*p+g*g,m={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:l.pointerId,type:o.type};this.onMultiTouch(this._pointA,this._pointB,s,_,n,m),n=m,s=_}}}},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=o=>this.onContextMenu(o),i&&i.addEventListener("contextmenu",this._contextMenuBind,!1);const r=this.camera.getScene().getEngine().getHostWindow();r&&ee.RegisterTopRootEvents(r,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){const e=this.camera.getScene().getEngine().getHostWindow();e&&ee.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(){}}D([B()],nc.prototype,"buttons",void 0);class Jt extends nc{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||Jt.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(e){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}}Jt.MinimumRadiusForPinch=.001;D([B()],Jt.prototype,"buttons",void 0);D([B()],Jt.prototype,"angularSensibilityX",void 0);D([B()],Jt.prototype,"angularSensibilityY",void 0);D([B()],Jt.prototype,"pinchPrecision",void 0);D([B()],Jt.prototype,"pinchDeltaPercentage",void 0);D([B()],Jt.prototype,"useNaturalPinchZoom",void 0);D([B()],Jt.prototype,"pinchZoom",void 0);D([B()],Jt.prototype,"panningSensibility",void 0);D([B()],Jt.prototype,"multiTouchPanning",void 0);D([B()],Jt.prototype,"multiTouchPanAndZoom",void 0);Mn.ArcRotateCameraPointersInput=Jt;class Oi{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=ee.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===Cn.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=ee.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==Re.POINTERWHEEL)return;const i=t.event;let s=0;const n=i.deltaMode===Nn.DOM_DELTA_LINE?Dg: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=Ye.Clamp(o,0,Number.MAX_VALUE),s=this._computeDeltaFromMouseWheelLegacyEvent(r,o)}}else s=r/(this.wheelPrecision*40);s&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),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=Yt.FromPositionAndNormal(e.target,t)}_getPosition(){var n;const e=this.camera,t=e.getScene(),i=t.createPickingRay(t.pointerX,t.pointerY,O.Identity(),e,!1);(e.targetScreenOffset.x!==0||e.targetScreenOffset.y!==0)&&(this._viewOffset.set(e.targetScreenOffset.x,e.targetScreenOffset.y,0),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),this._globalOffset=v.TransformNormal(this._viewOffset,e._cameraTransformMatrix),i.origin.addInPlace(this._globalOffset));let s=0;return this._hitPlane&&(s=(n=i.intersectsPlane(this._hitPlane))!=null?n:0),i.origin.addInPlace(i.direction.scaleInPlace(s))}_zoomToMouse(e){var l,h;const t=this.camera,i=1-t.inertia;if(t.lowerRadiusLimit){const c=(l=t.lowerRadiusLimit)!=null?l:0;t.radius-(t.inertialRadiusOffset+e)/ic&&(e=(t.radius-c)*i-t.inertialRadiusOffset)}const n=e/i/t.radius,r=this._getPosition(),o=N.Vector3[6];r.subtractToRef(t.target,o),o.scaleInPlace(n),o.scaleInPlace(i),this._inertialPanning.addInPlace(o),t.inertialRadiusOffset+=e}_zeroIfClose(e){Math.abs(e.x)()=>new st(a,0,0,1,v.Zero(),e));class st extends Mt{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 O,this._upToYMatrix=new O,this._upVector=v.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){O.RotationAlignToRef(v.UpReadOnly,this._upVector,this._yToUpMatrix),O.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 Ds,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 jt,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 Tg,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 O,this.panningAxis=new v(1,1,0),this._transformedDirection=new v,this.mapPanning=!1,this.onMeshTargetChangedObservable=new Q,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),f=Math.sin(this.alpha),d=Math.cos(this.beta);let p=Math.sin(this.beta);p===0&&(p=1e-4);const g=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*u*p,this.radius*d,this.radius*f*p),g.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let _=this.upVector;this.allowUpsideDown&&this.beta<0&&(_=_.clone(),_=_.negate()),this._computeViewMatrix(this._position,g,_),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 Fg(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=ee.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,t=this._calculateHandednessMultiplier();let i=this.inertialAlphaOffset*t;this.beta<0&&(i*=-1),this.alpha+=i*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:s,e.computeWorldMatrix)t&&e.getBoundingInfo?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=F.MinMax(e);let s=this._calculateLowerRadiusFromModelBoundingSphere(i.min,i.max);s=Math.max(Math.min(s,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),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=F.MinMax(n),s=v.Distance(i.min,i.max)}else{const n=e;i=n,s=n.distance}this._target=F.Center(i),t||(this.maxZ=s*2)}createRigCamera(e,t){let i=0;switch(this.cameraRigMode){case ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ve.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ve.RIG_MODE_STEREOSCOPIC_INTERLACED:case ve.RIG_MODE_VR:i=this._cameraRigParams.stereoHalfAngle*(t===0?1:-1);break;case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:i=this._cameraRigParams.stereoHalfAngle*(t===0?-1:1);break}const s=new st(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 ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ve.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ve.RIG_MODE_STEREOSCOPIC_INTERLACED:case ve.RIG_MODE_VR:e.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:e.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle;break}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(e,t,i=1){const s=v.Distance(e,t),r=this.getScene().getEngine().getAspectRatio(this),o=Math.tan(this.fov/2),l=o*r,c=s*.5*i,u=c*Math.sqrt(1+1/(l*l)),f=c*Math.sqrt(1+1/(o*o));return Math.max(u,f)}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}}D([B()],st.prototype,"alpha",void 0);D([B()],st.prototype,"beta",void 0);D([B()],st.prototype,"radius",void 0);D([B()],st.prototype,"overrideCloneAlphaBetaRadius",void 0);D([bi("target")],st.prototype,"_target",void 0);D([Lh("targetHost")],st.prototype,"_targetHost",void 0);D([B()],st.prototype,"inertialAlphaOffset",void 0);D([B()],st.prototype,"inertialBetaOffset",void 0);D([B()],st.prototype,"inertialRadiusOffset",void 0);D([B()],st.prototype,"lowerAlphaLimit",void 0);D([B()],st.prototype,"upperAlphaLimit",void 0);D([B()],st.prototype,"lowerBetaLimit",void 0);D([B()],st.prototype,"upperBetaLimit",void 0);D([B()],st.prototype,"lowerRadiusLimit",void 0);D([B()],st.prototype,"upperRadiusLimit",void 0);D([B()],st.prototype,"inertialPanningX",void 0);D([B()],st.prototype,"inertialPanningY",void 0);D([B()],st.prototype,"pinchToPanMaxDistance",void 0);D([B()],st.prototype,"panningDistanceLimit",void 0);D([bi()],st.prototype,"panningOriginTarget",void 0);D([B()],st.prototype,"panningInertia",void 0);D([B()],st.prototype,"zoomToMouseLocation",null);D([B()],st.prototype,"zoomOnFactor",void 0);D([Oh()],st.prototype,"targetScreenOffset",void 0);D([B()],st.prototype,"allowUpsideDown",void 0);D([B()],st.prototype,"useInputToRestoreState",void 0);ft("BABYLON.ArcRotateCamera",st);class De extends mt{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())}getViewMatrix(e){return null}getProjectionMatrix(e,t){return null}constructor(e,t){super(e,t,!1),this.diffuse=new pe(1,1,1),this.specular=new pe(1,1,1),this.falloffType=De.FALLOFF_DEFAULT,this.intensity=1,this._range=Number.MAX_VALUE,this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=De.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 de(this.getScene().getEngine(),void 0,void 0,e),this._buildUniformLayout(),this.includedOnlyMeshes=[],this.excludedMeshes=[],this._resyncMeshes()}transferTexturesToEffect(e,t){return this}_bindLight(e,t,i,s,n=!0){var l;const r=e.toString();let o=!1;if(this._uniformBuffer.bindToEffect(i,"Light"+r),this._renderId!==t.getRenderId()||this._lastUseSpecular!==s||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId(),this._lastUseSpecular=s;const h=this.getScaledIntensity();this.transferToEffect(i,r),this.diffuse.scaleToRef(h,Hs.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",Hs.Color3[0],this.range,r),s&&(this.specular.scaleToRef(h,Hs.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",Hs.Color3[1],this.radius,r)),o=!0}if(this.transferTexturesToEffect(i,r),t.shadowsEnabled&&this.shadowEnabled&&n){const h=(l=this.getShadowGenerator(t.activeCamera))!=null?l:this.getShadowGenerator();h&&(h.bindShadowLight(r,i),o=!0)}o?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=De.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!i)return null;const s=Ae.Clone(i,this);return e&&(s.name=e),t&&(s.parent=t),s.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(s),s}serialize(){const e=Ae.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)})),Ae.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}static GetConstructorFromName(e,t,i){const s=mt.Construct("Light_Type_"+e,t,i);return s||null}static Parse(e,t){const i=De.GetConstructorFromName(e.type,e.name,t);if(!i)return null;const s=Ae.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===De.INTENSITYMODE_AUTOMATIC&&(t===De.LIGHTTYPEID_DIRECTIONALLIGHT?i=De.INTENSITYMODE_ILLUMINANCE:i=De.INTENSITYMODE_LUMINOUSINTENSITY),t){case De.LIGHTTYPEID_POINTLIGHT:case De.LIGHTTYPEID_SPOTLIGHT:switch(i){case De.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case De.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case De.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius;break}break;case De.LIGHTTYPEID_DIRECTIONALLIGHT:switch(i){case De.INTENSITYMODE_ILLUMINANCE:e=1;break;case De.INTENSITYMODE_LUMINANCE:{let s=this.radius;s=Math.max(s,.001),e=2*Math.PI*(1-Math.cos(s));break}}break;case De.LIGHTTYPEID_HEMISPHERICLIGHT:e=1;break}return e}_reorderLightsInScene(){const e=this.getScene();this._renderPriority!=0&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()}}De.FALLOFF_DEFAULT=Xe.FALLOFF_DEFAULT;De.FALLOFF_PHYSICAL=Xe.FALLOFF_PHYSICAL;De.FALLOFF_GLTF=Xe.FALLOFF_GLTF;De.FALLOFF_STANDARD=Xe.FALLOFF_STANDARD;De.LIGHTMAP_DEFAULT=Xe.LIGHTMAP_DEFAULT;De.LIGHTMAP_SPECULAR=Xe.LIGHTMAP_SPECULAR;De.LIGHTMAP_SHADOWSONLY=Xe.LIGHTMAP_SHADOWSONLY;De.INTENSITYMODE_AUTOMATIC=Xe.INTENSITYMODE_AUTOMATIC;De.INTENSITYMODE_LUMINOUSPOWER=Xe.INTENSITYMODE_LUMINOUSPOWER;De.INTENSITYMODE_LUMINOUSINTENSITY=Xe.INTENSITYMODE_LUMINOUSINTENSITY;De.INTENSITYMODE_ILLUMINANCE=Xe.INTENSITYMODE_ILLUMINANCE;De.INTENSITYMODE_LUMINANCE=Xe.INTENSITYMODE_LUMINANCE;De.LIGHTTYPEID_POINTLIGHT=Xe.LIGHTTYPEID_POINTLIGHT;De.LIGHTTYPEID_DIRECTIONALLIGHT=Xe.LIGHTTYPEID_DIRECTIONALLIGHT;De.LIGHTTYPEID_SPOTLIGHT=Xe.LIGHTTYPEID_SPOTLIGHT;De.LIGHTTYPEID_HEMISPHERICLIGHT=Xe.LIGHTTYPEID_HEMISPHERICLIGHT;D([ls()],De.prototype,"diffuse",void 0);D([ls()],De.prototype,"specular",void 0);D([B()],De.prototype,"falloffType",void 0);D([B()],De.prototype,"intensity",void 0);D([B()],De.prototype,"range",null);D([B()],De.prototype,"intensityMode",null);D([B()],De.prototype,"radius",null);D([B()],De.prototype,"_renderPriority",void 0);D([qe("_reorderLightsInScene")],De.prototype,"renderPriority",void 0);D([B("shadowEnabled")],De.prototype,"_shadowEnabled",void 0);D([B("excludeWithLayerMask")],De.prototype,"_excludeWithLayerMask",void 0);D([B("includeOnlyWithLayerMask")],De.prototype,"_includeOnlyWithLayerMask",void 0);D([B("lightmapMode")],De.prototype,"_lightmapMode",void 0);class kn extends De{constructor(){super(...arguments),this._needProjectionMatrixCompute=!0,this._viewMatrix=O.Identity(),this._projectionMatrix=O.Identity()}_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,Wt.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=O.Identity()),O.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)}getViewMatrix(e){const t=N.Vector3[0];let i=this.position;this.computeTransformedInformation()&&(i=this.transformedPosition),v.NormalizeToRef(this.getShadowDirection(e),t),Math.abs(v.Dot(t,v.Up()))===1&&(t.z=1e-13);const s=N.Vector3[1];return i.addToRef(t,s),O.LookAtLHToRef(i,s,v.Up(),this._viewMatrix),this._viewMatrix}getProjectionMatrix(e,t){return this.setShadowProjectionMatrix(this._projectionMatrix,e!=null?e:this._viewMatrix,t!=null?t:[]),this._projectionMatrix}}D([bi()],kn.prototype,"position",null);D([bi()],kn.prototype,"direction",null);D([B()],kn.prototype,"shadowMinZ",null);D([B()],kn.prototype,"shadowMaxZ",null);mt.AddNodeConstructor("Light_Type_0",(a,e)=>()=>new Or(a,v.Zero(),e));class Or extends kn{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 De.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;O.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}}D([B()],Or.prototype,"shadowAngle",null);ft("BABYLON.PointLight",Or);class gl{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 vo{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._arePrePassDirty=!1,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 s,n,r,o,l;const t=(r=(n=(s=this._externalProperties)==null?void 0:s[e])==null?void 0:n.type)!=null?r:typeof this[e],i=(l=(o=this._externalProperties)==null?void 0:o[e])==null?void 0:l.default;switch(t){case"number":this[e]=i!=null?i:0;break;case"string":this[e]=i!=null?i:"";break;default:this[e]=i!=null?i:!1;break}}toString(){let e="";for(let t=0;tthis._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;sthis._handlePluginEvent(s,n),this._plugins.push(e),this._plugins.sort((s,n)=>s.priority-n.priority),this._codeInjectionPoints={};const i={};i[gs._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"));return this._defineNamesFromPlugins=i,!0}_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,s.customCode);break}case 8:{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:0;s.ubo.addUniform(o.name,o.size,l),this._uboDeclaration+="".concat(o.type," ").concat(o.name).concat(l>0?"[".concat(l,"]"):"",";\n")}this._uniformList.push(o.name)}r.vertex&&(this._vertexDeclaration+=r.vertex+"\n"),r.fragment&&(this._fragmentDeclaration+=r.fragment+"\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,t){return(i,s)=>{var o,l;t&&(s=t(i,s)),this._uboDeclaration&&(s=s.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(s=s.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(s=s.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const n=(o=this._codeInjectionPoints)==null?void 0:o[i];if(!n)return s;let r=null;for(let h in n){let c="";for(const u of this._activePlugins){let f=(l=u.getCustomCode(i))==null?void 0:l[h];f&&(u.resolveIncludes&&(r===null&&(r={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:K.GetShadersRepository(0),includesShadersStore:K.GetIncludesShadersStore(0),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}),r.isFragment=i==="fragment",En(f,r,d=>f=d)),c+=f+"\n")}if(c.length>0)if(h.charAt(0)==="!"){h=h.substring(1);let u="g";if(h.charAt(0)==="!")u="",h=h.substring(1);else{const g=Q1.exec(h);g&&g.length>=2&&(u=g[1],h=h.substring(u.length+1))}u.indexOf("g")<0&&(u+="g");const f=s,d=new RegExp(h,u);let p=d.exec(f);for(;p!==null;){let g=c;for(let _=0;_{ev()});const J1=[];let ml=null;function ev(){J1.length=0,q.OnEventObservable.remove(ml),ml=null}class hn{_enable(e){e&&this._pluginManager._activatePlugin(this)}constructor(e,t,i,s,n=!0,r=!1,o=!1){this.priority=500,this.resolveIncludes=!1,this.registerForExtraEvents=!1,this._material=e,this.name=t,this.priority=i,this.resolveIncludes=o,e.pluginManager||(e.pluginManager=new gs(e),e.onDisposeObservable.add(()=>{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){Ae.Clone(()=>e,this)}serialize(){return Ae.Serialize(this)}parse(e,t,i){Ae.Parse(()=>this,e,t,i)}}D([B()],hn.prototype,"name",void 0);D([B()],hn.prototype,"priority",void 0);D([B()],hn.prototype,"resolveIncludes",void 0);D([B()],hn.prototype,"registerForExtraEvents",void 0);ft("BABYLON.MaterialPluginBase",hn);class tv extends vo{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}class Bs extends hn{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}constructor(e,t=!0){super(e,"DetailMap",140,new tv,t),this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=q.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&&we.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&&we.DetailTextureEnabled&&this._isEnabled?(ds(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&&we.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),ps(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&we.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.dispose())}getClassName(){return"DetailMapConfiguration"}getSamplers(e){e.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}}D([pi("detailTexture"),qe("_markAllSubMeshesAsTexturesDirty")],Bs.prototype,"texture",void 0);D([B()],Bs.prototype,"diffuseBlendLevel",void 0);D([B()],Bs.prototype,"roughnessBlendLevel",void 0);D([B()],Bs.prototype,"bumpLevel",void 0);D([B(),qe("_markAllSubMeshesAsTexturesDirty")],Bs.prototype,"normalBlendMethod",void 0);D([B(),qe("_markAllSubMeshesAsTexturesDirty")],Bs.prototype,"isEnabled",void 0);const ra={effect:null,subMesh:null};class iv extends vo{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.PARALLAX_RHS=!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_NORMAL_WORLDSPACE=!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=0,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.DECAL_AFTER_DETAIL=!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 te extends xo{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 pe(0,0,0),this.diffuseColor=new pe(1,1,1),this.specularColor=new pe(1,1,1),this.emissiveColor=new pe(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._applyDecalMapAfterDetailMap=!1,this._renderTargets=new Vt(16),this._worldViewProjectionMatrix=O.Zero(),this._globalAmbientColor=new pe(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new Bs(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new gl,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),te.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),te.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 te.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||te.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}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===q.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==q.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(e,t,i=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const s=t._drawWrapper;if(s.effect&&this.isFrozen&&s._wasPreviouslyReady&&s._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new iv(this._eventInfo.defineNames));const n=this.getScene(),r=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const o=n.getEngine();r._needNormals=og(n,e,r,!0,this._maxSimultaneousLights,this._disableLighting),fg(n,r);const l=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if(pg(n,r,this.canRenderToMRT&&!l),dg(n,r,l),r._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,r._needUVs=!1;for(let c=1;c<=6;++c)r["MAINUV"+c]=!1;if(n.texturesEnabled){if(r.DIFFUSEDIRECTUV=0,r.BUMPDIRECTUV=0,r.AMBIENTDIRECTUV=0,r.OPACITYDIRECTUV=0,r.EMISSIVEDIRECTUV=0,r.SPECULARDIRECTUV=0,r.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&te.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())ds(this._diffuseTexture,r,"DIFFUSE");else return!1;else r.DIFFUSE=!1;if(this._ambientTexture&&te.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())ds(this._ambientTexture,r,"AMBIENT");else return!1;else r.AMBIENT=!1;if(this._opacityTexture&&te.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())ds(this._opacityTexture,r,"OPACITY"),r.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else r.OPACITY=!1;if(this._reflectionTexture&&te.ReflectionTextureEnabled)if(this._reflectionTexture.isReadyOrNotBlocking()){switch(r._needNormals=!0,r.REFLECTION=!0,r.ROUGHNESS=this._roughness>0,r.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,r.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===ne.INVCUBIC_MODE,r.REFLECTIONMAP_3D=this._reflectionTexture.isCube,r.REFLECTIONMAP_OPPOSITEZ=r.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!this._reflectionTexture.invertZ:this._reflectionTexture.invertZ,r.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case ne.EXPLICIT_MODE:r.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case ne.PLANAR_MODE:r.setReflectionMode("REFLECTIONMAP_PLANAR");break;case ne.PROJECTION_MODE:r.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case ne.SKYBOX_MODE:r.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case ne.SPHERICAL_MODE:r.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case ne.EQUIRECTANGULAR_MODE:r.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case ne.FIXED_EQUIRECTANGULAR_MODE:r.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case ne.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:r.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case ne.CUBIC_MODE:case ne.INVCUBIC_MODE:default:r.setReflectionMode("REFLECTIONMAP_CUBIC");break}r.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else return!1;else r.REFLECTION=!1,r.REFLECTIONMAP_OPPOSITEZ=!1;if(this._emissiveTexture&&te.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())ds(this._emissiveTexture,r,"EMISSIVE");else return!1;else r.EMISSIVE=!1;if(this._lightmapTexture&&te.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())ds(this._lightmapTexture,r,"LIGHTMAP"),r.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,r.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else r.LIGHTMAP=!1;if(this._specularTexture&&te.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())ds(this._specularTexture,r,"SPECULAR"),r.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else r.SPECULAR=!1;if(n.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&te.BumpTextureEnabled){if(this._bumpTexture.isReady())ds(this._bumpTexture,r,"BUMP"),r.PARALLAX=this._useParallax,r.PARALLAX_RHS=n.useRightHandedSystem,r.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;r.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else r.BUMP=!1,r.PARALLAX=!1,r.PARALLAX_RHS=!1,r.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&te.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())r._needUVs=!0,r.REFRACTION=!0,r.REFRACTIONMAP_3D=this._refractionTexture.isCube,r.RGBDREFRACTION=this._refractionTexture.isRGBD,r.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else r.REFRACTION=!1;r.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else r.DIFFUSE=!1,r.AMBIENT=!1,r.OPACITY=!1,r.REFLECTION=!1,r.EMISSIVE=!1,r.LIGHTMAP=!1,r.BUMP=!1,r.REFRACTION=!1;r.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),r.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,r.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,r.SPECULAROVERALPHA=this._useSpecularOverAlpha,r.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,r.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,r.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(e)}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(r._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(r),r.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,r.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}r._areFresnelDirty&&(te.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(r.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,r.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,r.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,r.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,r.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,r.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,r._needNormals=!0,r.FRESNEL=!0):r.FRESNEL=!1),ec(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,r,this._applyDecalMapAfterDetailMap),tc(n,o,this,r,i,null,t.getRenderingMesh().hasThinInstances),this._eventInfo.defines=r,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),ic(e,r,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let h=!1;if(r.isDirty){const c=r._areLightsDisposed;r.markAsProcessed();const u=new bo;r.REFLECTION&&u.addFallback(0,"REFLECTION"),r.SPECULAR&&u.addFallback(0,"SPECULAR"),r.BUMP&&u.addFallback(0,"BUMP"),r.PARALLAX&&u.addFallback(1,"PARALLAX"),r.PARALLAX_RHS&&u.addFallback(1,"PARALLAX_RHS"),r.PARALLAXOCCLUSION&&u.addFallback(0,"PARALLAXOCCLUSION"),r.SPECULAROVERALPHA&&u.addFallback(0,"SPECULAROVERALPHA"),r.FOG&&u.addFallback(1,"FOG"),r.POINTSIZE&&u.addFallback(0,"POINTSIZE"),r.LOGARITHMICDEPTH&&u.addFallback(0,"LOGARITHMICDEPTH"),rg(r,u,this._maxSimultaneousLights),r.SPECULARTERM&&u.addFallback(0,"SPECULARTERM"),r.DIFFUSEFRESNEL&&u.addFallback(1,"DIFFUSEFRESNEL"),r.OPACITYFRESNEL&&u.addFallback(2,"OPACITYFRESNEL"),r.REFLECTIONFRESNEL&&u.addFallback(3,"REFLECTIONFRESNEL"),r.EMISSIVEFRESNEL&&u.addFallback(4,"EMISSIVEFRESNEL"),r.FRESNEL&&u.addFallback(4,"FRESNEL"),r.MULTIVIEW&&u.addFallback(0,"MULTIVIEW");const f=[E.PositionKind];r.NORMAL&&f.push(E.NormalKind),r.TANGENT&&f.push(E.TangentKind);for(let b=1;b<=6;++b)r["UV"+b]&&f.push("uv".concat(b===1?"":b));r.VERTEXCOLOR&&f.push(E.ColorKind),ng(f,e,r,u),Jh(f,r),$h(f,e,r),Zh(f,e,r);let d="default";const p=["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"],g=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler"],_=["Material","Scene","Mesh"],m={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:r.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=u,this._eventInfo.fallbackRank=0,this._eventInfo.defines=r,this._eventInfo.uniforms=p,this._eventInfo.attributes=f,this._eventInfo.samplers=g,this._eventInfo.uniformBuffersNames=_,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=m,this._callbackPluginEventGeneric(128,this._eventInfo),gl.AddUniforms(p),Ue&&(Ue.PrepareUniforms(p,r),Ue.PrepareSamplers(g,r)),mg({uniformsNames:p,uniformBuffersNames:_,samplers:g,defines:r,maxSimultaneousLights:this._maxSimultaneousLights}),uo(p);const x={};this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,p,_,g,r,f,x));const I=r.toString(),T=t.effect;let y=n.getEngine().createEffect(d,{attributes:f,uniformsNames:p,uniformBuffersNames:_,samplers:g,defines:I,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:m,processFinalCode:x.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:r.PREPASS},o);if(this._eventInfo.customCode=void 0,y)if(this._onEffectCreatedObservable&&(ra.effect=y,ra.subMesh=t,this._onEffectCreatedObservable.notifyObservers(ra)),this.allowShaderHotSwapping&&T&&!y.isReady()){if(y=T,r.markAsUnprocessed(),h=this.isFrozen,c)return r._areLightsDisposed=!0,!1}else n.resetCachedMaterial(),t.setEffect(y,r,this._materialContext)}return!t.effect||!t.effect.isReady()?!1:(r._renderId=n.getRenderId(),s._wasPreviouslyReady=!h,s._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 h;const s=this.getScene(),n=i.materialDefines;if(!n)return;const r=i.effect;if(!r)return;this._activeEffect=r,t.getMeshUniformBuffer().bindToEffect(r,"Mesh"),t.transferToEffect(e),this._uniformBuffer.bindToEffect(r,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,s,t,e,this.isFrozen),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),n.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const o=this._mustRebind(s,r,i,t.visibility);Qh(t,r);const l=this._uniformBuffer;if(o){if(this.bindViewProjection(r),!l.useUbo||!this.isFrozen||!l.isSync||i._drawWrapper._forceRebindOnNextCall){if(te.FresnelEnabled&&n.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(l.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),l.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&l.updateColor4("opacityParts",new pe(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(l.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),l.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(l.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),l.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(l.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),l.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),s.texturesEnabled){if(this._diffuseTexture&&te.DiffuseTextureEnabled&&(l.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),ps(this._diffuseTexture,l,"diffuse")),this._ambientTexture&&te.AmbientTextureEnabled&&(l.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),ps(this._ambientTexture,l,"ambient")),this._opacityTexture&&te.OpacityTextureEnabled&&(l.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),ps(this._opacityTexture,l,"opacity")),this._hasAlphaChannel()&&l.updateFloat("alphaCutOff",this.alphaCutOff),this._reflectionTexture&&te.ReflectionTextureEnabled&&(l.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),l.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){const c=this._reflectionTexture;l.updateVector3("vReflectionPosition",c.boundingBoxPosition),l.updateVector3("vReflectionSize",c.boundingBoxSize)}if(this._emissiveTexture&&te.EmissiveTextureEnabled&&(l.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),ps(this._emissiveTexture,l,"emissive")),this._lightmapTexture&&te.LightmapTextureEnabled&&(l.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),ps(this._lightmapTexture,l,"lightmap")),this._specularTexture&&te.SpecularTextureEnabled&&(l.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),ps(this._specularTexture,l,"specular")),this._bumpTexture&&s.getEngine().getCaps().standardDerivatives&&te.BumpTextureEnabled&&(l.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),ps(this._bumpTexture,l,"bump"),s._mirroredCameraPosition?l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&te.RefractionTextureEnabled){let c=1;if(this._refractionTexture.isCube||(l.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(c=this._refractionTexture.depth)),l.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,c,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const u=this._refractionTexture;l.updateVector3("vRefractionPosition",u.boundingBoxPosition),l.updateVector3("vRefractionSize",u.boundingBoxSize)}}}this.pointsCloud&&l.updateFloat("pointSize",this.pointSize),n.SPECULARTERM&&l.updateColor4("vSpecularColor",this.specularColor,this.specularPower),l.updateColor3("vEmissiveColor",te.EmissiveTextureEnabled?this.emissiveColor:pe.BlackReadOnly),l.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),s.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),l.updateColor3("vAmbientColor",this._globalAmbientColor)}s.texturesEnabled&&(this._diffuseTexture&&te.DiffuseTextureEnabled&&r.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&te.AmbientTextureEnabled&&r.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&te.OpacityTextureEnabled&&r.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&te.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?r.setTexture("reflectionCubeSampler",this._reflectionTexture):r.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&te.EmissiveTextureEnabled&&r.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&te.LightmapTextureEnabled&&r.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&te.SpecularTextureEnabled&&r.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&s.getEngine().getCaps().standardDerivatives&&te.BumpTextureEnabled&&r.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&te.RefractionTextureEnabled&&(this._refractionTexture.isCube?r.setTexture("refractionCubeSampler",this._refractionTexture):r.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(r),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),fo(r,this,s),this.bindEyePosition(r)}else s.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(o||!this.isFrozen)&&(s.lightsEnabled&&!this._disableLighting&&sg(s,t,r,n,this._maxSimultaneousLights),(s.fogEnabled&&t.applyFog&&s.fogMode!==Qe.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||t.receiveShadows||n.PREPASS)&&this.bindView(r),_o(s,t,r),n.NUM_MORPH_INFLUENCERS&&mo(t,r),n.BAKED_VERTEX_ANIMATION_TEXTURE&&((h=t.bakedVertexAnimationManager)==null||h.bind(r,n.INSTANCES)),this.useLogarithmicDepth&&po(n,r,s),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect,i),l.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.dispose(),(s=this._ambientTexture)==null||s.dispose(),(n=this._opacityTexture)==null||n.dispose(),(r=this._reflectionTexture)==null||r.dispose(),(o=this._emissiveTexture)==null||o.dispose(),(l=this._specularTexture)==null||l.dispose(),(h=this._bumpTexture)==null||h.dispose(),(c=this._lightmapTexture)==null||c.dispose(),(u=this._refractionTexture)==null||u.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}clone(e,t=!0,i=""){const s=Ae.Clone(()=>new te(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return s.name=e,s.id=e,this.stencil.copyTo(s.stencil),this._clonePlugins(s,i),s}static Parse(e,t,i){const s=Ae.Parse(()=>new te(e.name,t),e,t,i);return e.stencil&&s.stencil.parse(e.stencil,t,i),q._ParsePlugins(e,s,t,i),s}static get DiffuseTextureEnabled(){return we.DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){we.DiffuseTextureEnabled=e}static get DetailTextureEnabled(){return we.DetailTextureEnabled}static set DetailTextureEnabled(e){we.DetailTextureEnabled=e}static get AmbientTextureEnabled(){return we.AmbientTextureEnabled}static set AmbientTextureEnabled(e){we.AmbientTextureEnabled=e}static get OpacityTextureEnabled(){return we.OpacityTextureEnabled}static set OpacityTextureEnabled(e){we.OpacityTextureEnabled=e}static get ReflectionTextureEnabled(){return we.ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){we.ReflectionTextureEnabled=e}static get EmissiveTextureEnabled(){return we.EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){we.EmissiveTextureEnabled=e}static get SpecularTextureEnabled(){return we.SpecularTextureEnabled}static set SpecularTextureEnabled(e){we.SpecularTextureEnabled=e}static get BumpTextureEnabled(){return we.BumpTextureEnabled}static set BumpTextureEnabled(e){we.BumpTextureEnabled=e}static get LightmapTextureEnabled(){return we.LightmapTextureEnabled}static set LightmapTextureEnabled(e){we.LightmapTextureEnabled=e}static get RefractionTextureEnabled(){return we.RefractionTextureEnabled}static set RefractionTextureEnabled(e){we.RefractionTextureEnabled=e}static get ColorGradingTextureEnabled(){return we.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){we.ColorGradingTextureEnabled=e}static get FresnelEnabled(){return we.FresnelEnabled}static set FresnelEnabled(e){we.FresnelEnabled=e}}D([pi("diffuseTexture")],te.prototype,"_diffuseTexture",void 0);D([qe("_markAllSubMeshesAsTexturesAndMiscDirty")],te.prototype,"diffuseTexture",void 0);D([pi("ambientTexture")],te.prototype,"_ambientTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"ambientTexture",void 0);D([pi("opacityTexture")],te.prototype,"_opacityTexture",void 0);D([qe("_markAllSubMeshesAsTexturesAndMiscDirty")],te.prototype,"opacityTexture",void 0);D([pi("reflectionTexture")],te.prototype,"_reflectionTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"reflectionTexture",void 0);D([pi("emissiveTexture")],te.prototype,"_emissiveTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"emissiveTexture",void 0);D([pi("specularTexture")],te.prototype,"_specularTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"specularTexture",void 0);D([pi("bumpTexture")],te.prototype,"_bumpTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"bumpTexture",void 0);D([pi("lightmapTexture")],te.prototype,"_lightmapTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"lightmapTexture",void 0);D([pi("refractionTexture")],te.prototype,"_refractionTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"refractionTexture",void 0);D([ls("ambient")],te.prototype,"ambientColor",void 0);D([ls("diffuse")],te.prototype,"diffuseColor",void 0);D([ls("specular")],te.prototype,"specularColor",void 0);D([ls("emissive")],te.prototype,"emissiveColor",void 0);D([B()],te.prototype,"specularPower",void 0);D([B("useAlphaFromDiffuseTexture")],te.prototype,"_useAlphaFromDiffuseTexture",void 0);D([qe("_markAllSubMeshesAsTexturesAndMiscDirty")],te.prototype,"useAlphaFromDiffuseTexture",void 0);D([B("useEmissiveAsIllumination")],te.prototype,"_useEmissiveAsIllumination",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useEmissiveAsIllumination",void 0);D([B("linkEmissiveWithDiffuse")],te.prototype,"_linkEmissiveWithDiffuse",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"linkEmissiveWithDiffuse",void 0);D([B("useSpecularOverAlpha")],te.prototype,"_useSpecularOverAlpha",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useSpecularOverAlpha",void 0);D([B("useReflectionOverAlpha")],te.prototype,"_useReflectionOverAlpha",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useReflectionOverAlpha",void 0);D([B("disableLighting")],te.prototype,"_disableLighting",void 0);D([qe("_markAllSubMeshesAsLightsDirty")],te.prototype,"disableLighting",void 0);D([B("useObjectSpaceNormalMap")],te.prototype,"_useObjectSpaceNormalMap",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useObjectSpaceNormalMap",void 0);D([B("useParallax")],te.prototype,"_useParallax",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useParallax",void 0);D([B("useParallaxOcclusion")],te.prototype,"_useParallaxOcclusion",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useParallaxOcclusion",void 0);D([B()],te.prototype,"parallaxScaleBias",void 0);D([B("roughness")],te.prototype,"_roughness",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"roughness",void 0);D([B()],te.prototype,"indexOfRefraction",void 0);D([B()],te.prototype,"invertRefractionY",void 0);D([B()],te.prototype,"alphaCutOff",void 0);D([B("useLightmapAsShadowmap")],te.prototype,"_useLightmapAsShadowmap",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useLightmapAsShadowmap",void 0);D([Ln("diffuseFresnelParameters")],te.prototype,"_diffuseFresnelParameters",void 0);D([qe("_markAllSubMeshesAsFresnelDirty")],te.prototype,"diffuseFresnelParameters",void 0);D([Ln("opacityFresnelParameters")],te.prototype,"_opacityFresnelParameters",void 0);D([qe("_markAllSubMeshesAsFresnelAndMiscDirty")],te.prototype,"opacityFresnelParameters",void 0);D([Ln("reflectionFresnelParameters")],te.prototype,"_reflectionFresnelParameters",void 0);D([qe("_markAllSubMeshesAsFresnelDirty")],te.prototype,"reflectionFresnelParameters",void 0);D([Ln("refractionFresnelParameters")],te.prototype,"_refractionFresnelParameters",void 0);D([qe("_markAllSubMeshesAsFresnelDirty")],te.prototype,"refractionFresnelParameters",void 0);D([Ln("emissiveFresnelParameters")],te.prototype,"_emissiveFresnelParameters",void 0);D([qe("_markAllSubMeshesAsFresnelDirty")],te.prototype,"emissiveFresnelParameters",void 0);D([B("useReflectionFresnelFromSpecular")],te.prototype,"_useReflectionFresnelFromSpecular",void 0);D([qe("_markAllSubMeshesAsFresnelDirty")],te.prototype,"useReflectionFresnelFromSpecular",void 0);D([B("useGlossinessFromSpecularMapAlpha")],te.prototype,"_useGlossinessFromSpecularMapAlpha",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"useGlossinessFromSpecularMapAlpha",void 0);D([B("maxSimultaneousLights")],te.prototype,"_maxSimultaneousLights",void 0);D([qe("_markAllSubMeshesAsLightsDirty")],te.prototype,"maxSimultaneousLights",void 0);D([B("invertNormalMapX")],te.prototype,"_invertNormalMapX",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"invertNormalMapX",void 0);D([B("invertNormalMapY")],te.prototype,"_invertNormalMapY",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"invertNormalMapY",void 0);D([B("twoSidedLighting")],te.prototype,"_twoSidedLighting",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],te.prototype,"twoSidedLighting",void 0);D([B("applyDecalMapAfterDetailMap")],te.prototype,"_applyDecalMapAfterDetailMap",void 0);D([qe("_markAllSubMeshesAsMiscDirty")],te.prototype,"applyDecalMapAfterDetailMap",void 0);ft("BABYLON.StandardMaterial",te);Qe.DefaultMaterialFactory=a=>new te("default material",a);var vl;(function(a){a[a.Clean=0]="Clean",a[a.Stop=1]="Stop",a[a.Sync=2]="Sync",a[a.NoSync=3]="NoSync"})(vl||(vl={}));class Be{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 Be._RegisteredPlugins[".babylon"]}static _GetPluginForExtension(e){const t=Be._RegisteredPlugins[e];return t||(U.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"),Be.GetDefaultPlugin())}static _GetPluginForDirectLoad(e){for(const t in Be._RegisteredPlugins){const i=Be._RegisteredPlugins[t].plugin;if(i.canDirectLoad&&i.canDirectLoad(e))return Be._RegisteredPlugins[t]}return Be.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 Be._GetPluginForExtension(s)}static _GetDirectLoad(e){return e.substr(0,5)==="data:"?e.substr(5):null}static _FormatErrorMessage(e,t,i){let n="Unable to load from "+(e.rawData?"binary data":e.url);return t?n+=": ".concat(t):i&&(n+=": ".concat(i)),n}static _LoadData(e,t,i,s,n,r,o,l){var I,T,y,b;const h=Be._GetDirectLoad(e.url);if(e.rawData&&!o)throw"When using ArrayBufferView to load data the file extension must be provided.";const c=o?Be._GetPluginForExtension(o):h?Be._GetPluginForDirectLoad(e.url):Be._GetPluginForFilename(e.url);if(e.rawData&&!c.isBinary)throw"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.";const u=(y=(T=(I=c.plugin).createPlugin)==null?void 0:T.call(I))!=null?y:c.plugin;if(!u)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(Be.OnPluginActivatedObservable.notifyObservers(u),h&&(u.canDirectLoad&&u.canDirectLoad(e.url)||!Qa(e.url))){if(u.directLoad){const S=u.directLoad(t,h);S instanceof Promise?S.then(A=>{i(u,A)}).catch(A=>{n("Error in directLoad of _loadData: "+A,A)}):i(u,S)}else i(u,h);return u}const f=c.isBinary,d=(S,A)=>{if(t.isDisposed){n("Scene has been disposed");return}i(u,S,A)};let p=null,g=!1;(b=u.onDisposeObservable)==null||b.add(()=>{g=!0,p&&(p.abort(),p=null),r()});const _=()=>{if(g)return;const S=(A,M)=>{n(A==null?void 0:A.statusText,M)};if(!u.loadFile&&e.rawData)throw"Plugin does not support loading ArrayBufferView.";p=u.loadFile?u.loadFile(t,e.rawData||e.file||e.url,e.rootUrl,d,s,f,S,l):t._loadFile(e.file||e.url,d,s,!0,f,S)},m=t.getEngine();let x=m.enableOfflineSupport;if(x){let S=!1;for(const A of t.disableOfflineSupportExceptionRules)if(A.test(e.url)){S=!0;break}x=!S}return x&&ie.OfflineProviderFactory?t.offlineProvider=ie.OfflineProviderFactory(e.url,_,m.disableManifestCheck):_(),u}static _GetFileInfo(e,t){let i,s,n=null,r=null;if(!t)i=e,s=ee.GetFilename(e),e=ee.GetFolderPath(e);else if(t.name){const o=t;i="file:".concat(o.name),s=o.name,n=o}else if(ArrayBuffer.isView(t))i="",s=eo(),r=t;else if(typeof t=="string"&&t.startsWith("data:"))i=t,s="";else{const o=t;if(o.substr(0,1)==="/")return ee.Error("Wrong sceneFilename parameter"),null;i=e+o,s=o}return{url:i,rootUrl:e,name:s,file:n,rawData:r}}static GetPluginForExtension(e){return Be._GetPluginForExtension(e).plugin}static IsPluginForExtensionAvailable(e){return!!Be._RegisteredPlugins[e]}static RegisterPlugin(e){if(typeof e.extensions=="string"){const t=e.extensions;Be._RegisteredPlugins[t.toLowerCase()]={plugin:e,isBinary:!1}}else{const t=e.extensions;Object.keys(t).forEach(i=>{Be._RegisteredPlugins[i.toLowerCase()]={plugin:e,isBinary:t[i].isBinary}})}}static ImportMesh(e,t,i="",s=Ce.LastCreatedScene,n=null,r=null,o=null,l=null,h=""){if(!s)return U.Error("No scene available to import mesh to"),null;const c=Be._GetFileInfo(t,i);if(!c)return null;const u={};s.addPendingData(u);const f=()=>{s.removePendingData(u)},d=(_,m)=>{const x=Be._FormatErrorMessage(c,_,m);o?o(s,x,new is(x,Ps.SceneLoaderError,m)):U.Error(x),f()},p=r?_=>{try{r(_)}catch(m){d("Error in onProgress callback: "+m,m)}}:void 0,g=(_,m,x,I,T,y,b,S)=>{if(s.importedMeshesFiles.push(c.url),n)try{n(_,m,x,I,T,y,b,S)}catch(A){d("Error in onSuccess callback: "+A,A)}s.removePendingData(u)};return Be._LoadData(c,s,(_,m,x)=>{if(_.rewriteRootURL&&(c.rootUrl=_.rewriteRootURL(c.rootUrl,x)),_.importMesh){const I=_,T=[],y=[],b=[];if(!I.importMesh(e,s,m,c.rootUrl,T,y,b,d))return;s.loadingPluginName=_.name,g(T,y,b,[],[],[],[],[])}else _.importMeshAsync(e,s,m,c.rootUrl,p,c.name).then(T=>{s.loadingPluginName=_.name,g(T.meshes,T.particleSystems,T.skeletons,T.animationGroups,T.transformNodes,T.geometries,T.lights,T.spriteManagers)}).catch(T=>{d(T.message,T)})},p,d,f,l,h)}static ImportMeshAsync(e,t,i="",s=Ce.LastCreatedScene,n=null,r=null,o=""){return new Promise((l,h)=>{Be.ImportMesh(e,t,i,s,(c,u,f,d,p,g,_,m)=>{l({meshes:c,particleSystems:u,skeletons:f,animationGroups:d,transformNodes:p,geometries:g,lights:_,spriteManagers:m})},n,(c,u,f)=>{h(f||new Error(u))},r,o)})}static Load(e,t="",i=Ce.LastCreatedEngine,s=null,n=null,r=null,o=null,l=""){return i?Be.Append(e,t,new Qe(i),s,n,r,o,l):(ee.Error("No engine available"),null)}static LoadAsync(e,t="",i=Ce.LastCreatedEngine,s=null,n=null,r=""){return new Promise((o,l)=>{Be.Load(e,t,i,h=>{o(h)},s,(h,c,u)=>{l(u||new Error(c))},n,r)})}static Append(e,t="",i=Ce.LastCreatedScene,s=null,n=null,r=null,o=null,l=""){if(!i)return U.Error("No scene available to append to"),null;const h=Be._GetFileInfo(e,t);if(!h)return null;const c={};i.addPendingData(c);const u=()=>{i.removePendingData(c)};Be.ShowLoadingScreen&&!this._ShowingLoadingScreen&&(this._ShowingLoadingScreen=!0,i.getEngine().displayLoadingUI(),i.executeWhenReady(()=>{i.getEngine().hideLoadingUI(),this._ShowingLoadingScreen=!1}));const f=(g,_)=>{const m=Be._FormatErrorMessage(h,g,_);r?r(i,m,new is(m,Ps.SceneLoaderError,_)):U.Error(m),u()},d=n?g=>{try{n(g)}catch(_){f("Error in onProgress callback",_)}}:void 0,p=()=>{if(s)try{s(i)}catch(g){f("Error in onSuccess callback",g)}i.removePendingData(c)};return Be._LoadData(h,i,(g,_)=>{if(g.load){if(!g.load(i,_,h.rootUrl,f))return;i.loadingPluginName=g.name,p()}else g.loadAsync(i,_,h.rootUrl,d,h.name).then(()=>{i.loadingPluginName=g.name,p()}).catch(x=>{f(x.message,x)})},d,f,u,o,l)}static AppendAsync(e,t="",i=Ce.LastCreatedScene,s=null,n=null,r=""){return new Promise((o,l)=>{Be.Append(e,t,i,h=>{o(h)},s,(h,c,u)=>{l(u||new Error(c))},n,r)})}static LoadAssetContainer(e,t="",i=Ce.LastCreatedScene,s=null,n=null,r=null,o=null,l=""){if(!i)return U.Error("No scene available to load asset container to"),null;const h=Be._GetFileInfo(e,t);if(!h)return null;const c={};i.addPendingData(c);const u=()=>{i.removePendingData(c)},f=(g,_)=>{const m=Be._FormatErrorMessage(h,g,_);r?r(i,m,new is(m,Ps.SceneLoaderError,_)):U.Error(m),u()},d=n?g=>{try{n(g)}catch(_){f("Error in onProgress callback",_)}}:void 0,p=g=>{if(s)try{s(g)}catch(_){f("Error in onSuccess callback",_)}i.removePendingData(c)};return Be._LoadData(h,i,(g,_)=>{if(g.loadAssetContainer){const x=g.loadAssetContainer(i,_,h.rootUrl,f);if(!x)return;x.populateRootNodes(),i.loadingPluginName=g.name,p(x)}else g.loadAssetContainerAsync?g.loadAssetContainerAsync(i,_,h.rootUrl,d,h.name).then(x=>{x.populateRootNodes(),i.loadingPluginName=g.name,p(x)}).catch(x=>{f(x.message,x)}):f("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")},d,f,u,o,l)}static LoadAssetContainerAsync(e,t="",i=Ce.LastCreatedScene,s=null,n=null){return new Promise((r,o)=>{Be.LoadAssetContainer(e,t,i,l=>{r(l)},s,(l,h,c)=>{o(c||new Error(h))},n)})}static ImportAnimations(e,t="",i=Ce.LastCreatedScene,s=!0,n=0,r=null,o=null,l=null,h=null,c=null){if(!i){U.Error("No scene available to load animations to");return}if(s){for(const p of i.animatables)p.reset();i.stopAllAnimations(),i.animationGroups.slice().forEach(p=>{p.dispose()}),i.getNodes().forEach(p=>{p.animations&&(p.animations=[])})}else switch(n){case 0:i.animationGroups.slice().forEach(d=>{d.dispose()});break;case 1:i.animationGroups.forEach(d=>{d.stop()});break;case 2:i.animationGroups.forEach(d=>{d.reset(),d.restart()});break;case 3:break;default:U.Error("Unknown animation group loading mode value '"+n+"'");return}const u=i.animatables.length,f=d=>{d.mergeAnimationsTo(i,i.animatables.slice(u),r),d.dispose(),i.onAnimationFileImportedObservable.notifyObservers(i),o&&o(i)};this.LoadAssetContainer(e,t,i,f,l,h,c)}static ImportAnimationsAsync(e,t="",i=Ce.LastCreatedScene,s=!0,n=0,r=null,o=null,l=null,h=null,c=null){return new Promise((u,f)=>{Be.ImportAnimations(e,t,i,s,n,r,d=>{u(d)},l,(d,p,g)=>{f(g||new Error(p))},c)})}}Be.NO_LOGGING=0;Be.MINIMAL_LOGGING=1;Be.SUMMARY_LOGGING=2;Be.DETAILED_LOGGING=3;Be.OnPluginActivatedObservable=new Q;Be._RegisteredPlugins={};Be._ShowingLoadingScreen=!1;const sv="fxaaPixelShader",nv="#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;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const float fxaaQualitySubpix=1.0;const float fxaaQualityEdgeThreshold=0.166;const float fxaaQualityEdgeThresholdMin=0.0833;const vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){vec2 posM;posM.x=vUV.x;posM.y=vUV.y;vec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);float lumaM=FxaaLuma(rgbyM);float lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));float lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));float lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));float lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));float maxSM=max(lumaS,lumaM);float minSM=min(lumaS,lumaM);float maxESM=max(lumaE,maxSM);float minESM=min(lumaE,minSM);float maxWN=max(lumaN,lumaW);float minWN=min(lumaN,lumaW);float rangeMax=max(maxWN,maxESM);float rangeMin=min(minWN,minESM);float rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;float range=rangeMax-rangeMin;float rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range=edgeVert;float subpixA=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)\n{lumaN=lumaW;}\nif (!horzSpan) \n{lumaS=lumaE;}\nif (horzSpan) \n{lengthSign=texelSize.y;}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;float gradientN=lumaN-lumaM;float gradientS=lumaS-lumaM;float lumaNN=lumaN+lumaM;float lumaSS=lumaS+lumaM;bool pairN=abs(gradientN)>=abs(gradientS);float gradient=max(abs(gradientN),abs(gradientS));if (pairN)\n{lengthSign=-lengthSign;}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);vec2 posB;posB.x=posM.x;posB.y=posM.y;vec2 offNP;offNP.x=(!horzSpan) ? 0.0 : texelSize.x;offNP.y=(horzSpan) ? 0.0 : texelSize.y;if (!horzSpan) \n{posB.x+=lengthSign*0.5;}\nif (horzSpan)\n{posB.y+=lengthSign*0.5;}\nvec2 posN;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;vec2 posP;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;float subpixD=((-2.0)*subpixC)+3.0;float lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));float subpixE=subpixC*subpixC;float lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));if (!pairN) \n{lumaNN=lumaSS;}\nfloat gradientScaled=gradient*1.0/4.0;float lumaMM=lumaM-lumaNN*0.5;float subpixF=subpixD*subpixE;bool lumaMLTZero=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;bool doneN=abs(lumaEndN)>=gradientScaled;bool doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) \n{posN.x-=offNP.x*3.0;}\nif (!doneN) \n{posN.y-=offNP.y*3.0;}\nbool doneNP=(!doneN) || (!doneP);if (!doneP) \n{posP.x+=offNP.x*3.0;}\nif (!doneP)\n{posP.y+=offNP.y*3.0;}\nif (doneNP)\n{if (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));if (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));if (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;if (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;doneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) posN.x-=offNP.x*12.0;if (!doneN) posN.y-=offNP.y*12.0;doneNP=(!doneN) || (!doneP);if (!doneP) posP.x+=offNP.x*12.0;if (!doneP) posP.y+=offNP.y*12.0;}\nfloat dstN=posM.x-posN.x;float dstP=posP.x-posM.x;if (!horzSpan)\n{dstN=posM.y-posN.y;}\nif (!horzSpan) \n{dstP=posP.y-posM.y;}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;float spanLength=(dstP+dstN);bool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;float spanLengthRcp=1.0/spanLength;bool directionN=dstN{const c=this.texelSize;h.setFloat2("texelSize",c.x,c.y)})}_getDefines(){const e=this.getEngine();return e&&e.extractDriverInfo().toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null}static _Parse(e,t,i,s){return Ae.Parse(()=>new Lr(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,s)}}ft("BABYLON.FxaaPostProcess",Lr);let us=null;function Br(a,e,t,i,s="image/png",n=!1,r){const{height:o,width:l}=oc(a,e,t);if(!(o&&l)){U.Error("Invalid 'size' parameter !");return}us||(us=document.createElement("canvas")),us.width=l,us.height=o;const h=us.getContext("2d"),c=a.getRenderWidth()/a.getRenderHeight();let u=l,f=u/c;f>o&&(f=o,u=f*c);const d=Math.max(0,l-u)/2,p=Math.max(0,o-f)/2;e.getScene().activeCamera!==e?Nr(a,e,t,_=>{if(n){const m=new Blob([_]);ee.DownloadBlob(m),i&&i("")}else i&&i(_)},s,1,a.getCreationOptions().antialias,void 0,void 0,void 0,void 0,r):a.onEndFrameObservable.addOnce(()=>{const _=a.getRenderingCanvas();h&&_&&h.drawImage(_,d,p,u,f),us&&(n?(ee.EncodeScreenshotCanvasData(us,void 0,s,void 0,r),i&&i("")):ee.EncodeScreenshotCanvasData(us,i,s,void 0,r))})}function rc(a,e,t,i="image/png",s){return new Promise((n,r)=>{Br(a,e,t,o=>{typeof o<"u"?n(o):r(new Error("Data is undefined"))},i,void 0,s)})}function ov(a,e,t,i,s="image/png",n){return new Promise(r=>{Br(a,e,{width:t,height:i},()=>{r()},s,!0,n)})}function Nr(a,e,t,i,s="image/png",n=1,r=!1,o,l=!1,h=!1,c=!0,u,f){const{height:d,width:p,finalWidth:g,finalHeight:_}=oc(a,e,t),m={width:p,height:d};if(!(d&&p)){U.Error("Invalid 'size' parameter !");return}const x={width:a.getRenderWidth(),height:a.getRenderHeight()};a.setSize(p,d);const I=e.getScene(),T=new wi("screenShot",m,I,!1,!1,0,!1,ne.BILINEAR_SAMPLINGMODE,void 0,h,void 0,void 0,void 0,n);T.renderList=I.meshes.slice(),T.samples=n,T.renderSprites=l,T.activeCamera=e,T.forceLayerMaskCheck=c,f==null||f(T);const y=()=>{T.isReadyForRendering()&&e.isReady(!0)?(a.onEndFrameObservable.addOnce(()=>{g===p&&_===d?T.readPixels(void 0,void 0,void 0,!1).then(S=>{Ot.DumpData(p,d,S,i,s,o,!0,void 0,u),T.dispose()}):h_("pass",T.getInternalTexture(),I,void 0,void 0,void 0,g,_).then(S=>{a._readTexturePixels(S,g,_,-1,0,null,!0,!1,0,0).then(A=>{Ot.DumpData(g,_,A,i,s,o,!0,void 0,u),S.dispose()})})}),T.render(!0),I.incrementRenderId(),I.resetCachedMaterial(),a.setSize(x.width,x.height),e.getProjectionMatrix(!0),I.render()):setTimeout(y,16)},b=()=>{I.incrementRenderId(),I.resetCachedMaterial(),y()};if(r){const S=new Lr("antialiasing",1,I.activeCamera);T.addPostProcess(S),S.getEffect().isReady()?b():S.getEffect().onCompiled=()=>{b()}}else b()}function ac(a,e,t,i="image/png",s=1,n=!1,r,o=!1,l=!1,h=!0,c){return new Promise((u,f)=>{Nr(a,e,t,d=>{typeof d<"u"?u(d):f(new Error("Data is undefined"))},i,s,n,r,o,l,h,c)})}function oc(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 lv={CreateScreenshot:Br,CreateScreenshotAsync:rc,CreateScreenshotWithResizeAsync:ov,CreateScreenshotUsingRenderTarget:Nr,CreateScreenshotUsingRenderTargetAsync:ac},hv=()=>{ee.CreateScreenshot=Br,ee.CreateScreenshotAsync=rc,ee.CreateScreenshotUsingRenderTarget=Nr,ee.CreateScreenshotUsingRenderTargetAsync=ac};hv();F._instancedMeshFactory=(a,e)=>{const t=new Ur(a,e);if(e.instancedBuffers){t.instancedBuffers={};for(const i in e.instancedBuffers)t.instancedBuffers[i]=e.instancedBuffers[i]}return t};class Ur extends et{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?void 0:t.receiveShadows)!==e&&ee.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?void 0:t.material)!==e&&ee.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?void 0:t.visibility)!==e&&ee.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?void 0:t.skeleton)!==e&&ee.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||U.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)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}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;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData(i,null,E.PositionKind),s),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||U.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!==Ie.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new O);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,N.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(N.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;sn===e||n.startsWith(i));return s>=0&&this.options.defines.splice(s,1),(typeof t!="boolean"||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){return this.isReady(e,i,t)}isReady(e,t,i){var y,b,S;const s=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const A=s?i._drawWrapper:this._drawWrapper;if(A.effect&&A._wasPreviouslyReady&&A._wasPreviouslyUsingInstances===t)return!0}const n=this.getScene(),r=n.getEngine(),o=[],l=[],h=new bo;let c=this._shaderPath,u=this._options.uniforms,f=this._options.uniformBuffers,d=this._options.samplers;r.getCaps().multiview&&n.activeCamera&&n.activeCamera.outputRenderTarget&&n.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,o.push("#define MULTIVIEW"),u.indexOf("viewProjection")!==-1&&u.indexOf("viewProjectionR")===-1&&u.push("viewProjectionR"));for(let A=0;A4&&(l.push(E.MatricesIndicesExtraKind),l.push(E.MatricesWeightsExtraKind));const A=e.skeleton;o.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),h.addCPUSkinningFallback(0,e),A.isUsingTextureForMatrices?(o.push("#define BONETEXTURE"),u.indexOf("boneTextureWidth")===-1&&u.push("boneTextureWidth"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(o.push("#define BonesPerMesh "+(A.bones.length+1)),u.indexOf("mBones")===-1&&u.push("mBones"))}else o.push("#define NUM_BONE_INFLUENCERS 0");let p=0;const g=e?e.morphTargetManager:null;if(g){const A=g.supportsUVs&&o.indexOf("#define UV1")!==-1,M=g.supportsTangents&&o.indexOf("#define TANGENT")!==-1,C=g.supportsNormals&&o.indexOf("#define NORMAL")!==-1;p=g.numMaxInfluencers||g.numInfluencers,A&&o.push("#define MORPHTARGETS_UV"),M&&o.push("#define MORPHTARGETS_TANGENT"),C&&o.push("#define MORPHTARGETS_NORMAL"),p>0&&o.push("#define MORPHTARGETS"),g.isUsingTextureForTargets&&(o.push("#define MORPHTARGETS_TEXTURE"),u.indexOf("morphTargetTextureIndices")===-1&&u.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),o.push("#define NUM_MORPH_INFLUENCERS "+p);for(let w=0;w0&&(u=u.slice(),u.push("morphTargetInfluences"),u.push("morphTargetCount"),u.push("morphTargetTextureInfo"),u.push("morphTargetTextureIndices"))}else o.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const A=e.bakedVertexAnimationManager;A&&A.isEnabled&&(o.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),u.indexOf("bakedVertexAnimationSettings")===-1&&u.push("bakedVertexAnimationSettings"),u.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&u.push("bakedVertexAnimationTextureSizeInverted"),u.indexOf("bakedVertexAnimationTime")===-1&&u.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture")),Zh(l,e,o)}for(const A in this._textures)if(!this._textures[A].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&o.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(uo(u),qh(this,n,o)),n.fogEnabled&&(e!=null&&e.applyFog)&&n.fogMode!==Qe.FOGMODE_NONE&&(o.push("#define FOG"),u.indexOf("view")===-1&&u.push("view"),u.indexOf("vFogInfos")===-1&&u.push("vFogInfos"),u.indexOf("vFogColor")===-1&&u.push("vFogColor")),this._useLogarithmicDepth&&(o.push("#define LOGARITHMICDEPTH"),u.indexOf("logarithmicDepthConstant")===-1&&u.push("logarithmicDepthConstant")),this.customShaderNameResolve&&(u=u.slice(),f=f.slice(),d=d.slice(),c=this.customShaderNameResolve(this.name,u,f,d,o,l));const _=s?i._getDrawWrapper(void 0,!0):this._drawWrapper,m=(y=_==null?void 0:_.effect)!=null?y:null,x=(b=_==null?void 0:_.defines)!=null?b:null,I=o.join("\n");let T=m;return x!==I&&(T=r.createEffect(c,{attributes:l,uniformsNames:u,uniformBuffersNames:f,samplers:d,defines:I,fallbacks:h,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:p},shaderLanguage:this._options.shaderLanguage},r),s?i.setEffect(T,I,this._materialContext):_&&_.setEffect(T,I),this._onEffectCreatedObservable&&(aa.effect=T,aa.subMesh=(S=i!=null?i:e==null?void 0:e.subMeshes[0])!=null?S:null,this._onEffectCreatedObservable.notifyObservers(aa))),_._wasPreviouslyUsingInstances=!!t,T!=null&&T.isReady()?(m!==T&&n.resetCachedMaterial(),_._wasPreviouslyReady=!0,!0):!1}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)),this._options.uniforms.indexOf("view")!==-1&&s.setMatrix("view",i.getViewMatrix()))}bindForSubMesh(e,t,i){var s;this.bind(e,t,(s=i._drawWrapperOverride)==null?void 0:s.effect,i)}bind(e,t,i,s){var u;const n=s&&this._storeEffectOnSubMeshes,r=i!=null?i:n?s.effect:this.getEffect();if(!r)return;const o=this.getScene();this._activeEffect=r,this.bindOnlyWorldMatrix(e,i);const l=this._options.uniformBuffers;let h=!1;if(r&&l&&l.length>0&&o.getEngine().supportsUniformBuffers)for(let f=0;f0&&mo(t,r);const d=t.bakedVertexAnimationManager;if(d&&d.isEnabled){const p=n?s._drawWrapper:this._drawWrapper;(u=t.bakedVertexAnimationManager)==null||u.bind(r,!!p._wasPreviouslyUsingInstances)}}this._afterBind(t,r,s)}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 rs(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 rs(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,ne.Parse(e.textures[n],t,i));for(n in e.textureArrays){const r=e.textureArrays[n],o=[];for(let l=0;l(h%3===0?o.push([l]):o[o.length-1].push(l),o),[]).map(o=>pe.FromArray(o));s.setColor3Array(n,r)}for(n in e.colors4)s.setColor4(n,X.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=>X.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,Pe.FromArray(e.vectors4[n]));for(n in e.quaternions)s.setQuaternion(n,le.FromArray(e.quaternions[n]));for(n in e.matrices)s.setMatrix(n,O.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 Ft;o.addEventListener("readystatechange",()=>{if(o.readyState==4)if(o.status==200){const l=JSON.parse(o.responseText),h=this.Parse(l,i||Ce.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 Ft;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||Ce.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()})}}rs.SnippetUrl="https://snippet.babylonjs.com";rs.CreateFromSnippetAsync=rs.ParseFromSnippetAsync;ft("BABYLON.ShaderMaterial",rs);const cv="colorPixelShader",uv="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include\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#include(color,gl_FragColor)\n#define CUSTOM_FRAGMENT_MAIN_END\n}";K.ShadersStore[cv]=uv;const fv="colorVertexShader",dv="attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n#include\n#include\n#include\n#ifdef FOG\nuniform mat4 view;\n#endif\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) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include\n#include\n#include\n#define CUSTOM_VERTEX_MAIN_END\n}";K.ShadersStore[fv]=dv;F._LinesMeshParser=(a,e)=>xs.Parse(a,e);class xs extends F{_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 pe(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:[E.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(E.ColorKind)):(c.uniforms.push("color"),this._color4=new X),l?this.material=l:(this.material=new rs("colorShader",this.getScene(),"color",c,!1),this.material.doNotSerialize=!0)}isReady(){return this._lineMaterial.isReady(this,!!this._userInstancedBuffersStorage||this.hasThinInstances)?super.isReady():!1}getClassName(){return"LinesMesh"}get material(){return this._lineMaterial}set material(e){this._lineMaterial=e,this._lineMaterial.fillMode=q.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.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!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(q.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(q.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 xs(e,this.getScene(),t,this,i)}createInstance(e){const t=new lc(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 xs(e.name,t);return i.color=pe.FromArray(e.color),i.alpha=e.alpha,i}}class lc extends Ur{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}const pv="linePixelShader",_v="#include\nuniform vec4 color;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include\n#include\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";K.ShadersStore[pv]=_v;const gv="lineVertexDeclaration",mv="uniform mat4 viewProjection;\n#define ADDITIONAL_VERTEX_DECLARATION\n";K.IncludesShadersStore[gv]=mv;const vv="lineUboDeclaration",xv="layout(std140,column_major) uniform;\n#include\n#include\n";K.IncludesShadersStore[vv]=xv;const bv="lineVertexShader",yv="#include<__decl__lineVertex>\n#include\n#include\nattribute vec3 position;attribute vec4 normal;uniform float width;uniform float aspectRatio;\n#include\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include\nmat4 worldViewProjection=viewProjection*finalWorld;vec4 viewPosition=worldViewProjection*vec4(position,1.0);vec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);vec2 currentScreen=viewPosition.xy/viewPosition.w;vec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;currentScreen.x*=aspectRatio;nextScreen.x*=aspectRatio;vec2 dir=normalize(nextScreen-currentScreen);vec2 normalDir=vec2(-dir.y,dir.x);normalDir*=width/2.0;normalDir.x/=aspectRatio;vec4 offset=vec4(normalDir*normal.w,0.0,0.0);gl_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#include\n#define CUSTOM_VERTEX_MAIN_END\n}";K.ShadersStore[bv]=yv;et.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this};et.prototype.enableEdgesRendering=function(a=.95,e=!1,t){return this.disableEdgesRendering(),this._edgesRenderer=new kr(this,a,e,!0,t),this};Object.defineProperty(et.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0});xs.prototype.enableEdgesRendering=function(a=.95,e=!1){return this.disableEdgesRendering(),this._edgesRenderer=new Sv(this,a,e),this};lc.prototype.enableEdgesRendering=function(a=.95,e=!1){return xs.prototype.enableEdgesRendering.apply(this,arguments),this};class Tv{constructor(){this.edges=[],this.edgesConnectedCount=0}}class kr{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 rs("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"],uniformBuffers:["Scene","Mesh"]},!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 Vt(32),this._source=e,this._checkVerticesInsteadOfIndices=i,this._options=n!=null?n:null,this._epsilon=t,this._source.getScene().getEngine().isWebGPU&&(this._drawWrapper=new ln(e.getEngine())),this._prepareRessources(),s&&((r=n==null?void 0:n.useAlternateEdgeFinder)==null||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=kr._GetShader(this._source.getScene()))}_rebuild(){let e=this._buffers[E.PositionKind];e&&e._rebuild(),e=this._buffers[E.NormalKind],e&&e._rebuild();const i=this._source.getScene().getEngine();this._ib=i.createIndexBuffer(this._linesIndices)}dispose(){var t;this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);let e=this._buffers[E.PositionKind];e&&(e.dispose(),this._buffers[E.PositionKind]=null),e=this._buffers[E.NormalKind],e&&(e.dispose(),this._buffers[E.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose(),(t=this._drawWrapper)==null||t.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]){C>=0&&M.push(C);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 A=0;A<3;++A)A===r?e[A].sort((M,C)=>M[1]C[1]?1:0):e[A].sort((M,C)=>M[1]>C[1]?-1:M[1]=r+1;--A)n(e[A%3],l,A!==r+2?s[i[t+(A+1)%3]]:-1);const c=l.length,u=0,f=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 d=h<=c,p=d?h:c,g=d?c:h,_=d?h-1:c-1,m=d?0:1;let x=h+c-2,I=d?u:f,T=d?f:u;const y=d?o:l,b=d?l:o;let S=0;for(;x-- >0;){m?i.push(y[I],b[T]):i.push(b[T],y[I]),S+=p;let A;S>=g&&I<_?(A=y[++I],S-=g):A=b[++T],i.push(A)}i[t+0]=i[i.length-3],i[t+1]=i[i.length-2],i[t+2]=i[i.length-1],i.length=i.length-3}_generateEdgesLinesAlternate(){var h,c,u,f,d,p,g,_,m,x;const e=this._source.getVerticesData(E.PositionKind);let t=this._source.getIndices();if(!t||!e)return;Array.isArray(t)||(t=Array.from(t));const i=(c=(h=this._options)==null?void 0:h.useFastVertexMerger)!=null?c:!0,s=i?Math.round(-Math.log((f=(u=this._options)==null?void 0:u.epsilonVertexMerge)!=null?f:1e-6)/Math.log(10)):(p=(d=this._options)==null?void 0:d.epsilonVertexMerge)!=null?p:1e-6,n=[],r=[];if(i){const I={};for(let T=0;TS){const w=b;b=S,S=w}const M=b+"_"+S,C=o[M];C?C.done||(v.Dot(T,C.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;f=f.toLowerCase();const d=u>=0?c.substring(u+1).trim():"";if(f==="newmtl")l&&this.materials.push(l),e._blockEntityCollection=!!s,l=new te(d,e),l._parentContainer=s,e._blockEntityCollection=!1;else if(f==="kd"&&l)o=d.split(r,3).map(parseFloat),l.diffuseColor=pe.FromArray(o);else if(f==="ka"&&l)o=d.split(r,3).map(parseFloat),l.ambientColor=pe.FromArray(o);else if(f==="ks"&&l)o=d.split(r,3).map(parseFloat),l.specularColor=pe.FromArray(o);else if(f==="ke"&&l)o=d.split(r,3).map(parseFloat),l.emissiveColor=pe.FromArray(o);else if(f==="ns"&&l)l.specularPower=parseFloat(d);else if(f==="d"&&l)l.alpha=parseFloat(d);else if(f==="map_ka"&&l)l.ambientTexture=Ri._GetTexture(i,d,e);else if(f==="map_kd"&&l)l.diffuseTexture=Ri._GetTexture(i,d,e);else if(f==="map_ks"&&l)l.specularTexture=Ri._GetTexture(i,d,e);else if(f!=="map_ns")if(f==="map_bump"&&l){const p=d.split(r),g=p.indexOf("-bm");let _=null;g>=0&&(_=p[g+1],p.splice(g,2)),l.bumpTexture=Ri._GetTexture(i,p.join(" "),e),l.bumpTexture&&_!==null&&(l.bumpTexture.level=parseFloat(_))}else f==="map_d"&&l&&(l.opacityTexture=Ri._GetTexture(i,d,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 ne(s,i,!1,Ri.INVERT_TEXTURE_Y)}}Ri.INVERT_TEXTURE_Y=!0;class Ze{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 X(.5,.5,.5,1),this._hasLineData=!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._loadingOptions.useLegacyBehavior&&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._handledMesh.hasLines=this._hasLineData,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,this._hasLineData=!1)}_optimizeNormals(e){const t=e.getVerticesData(E.PositionKind),i=e.getVerticesData(E.NormalKind),s={};if(!t||!i)return;for(let r=0;rthis._triangles.push(h[0],h[c],h[c+1]),this._handednessSign=1):i.useRightHandedSystem?(this._pushTriangle=(h,c)=>this._triangles.push(h[0],h[c+1],h[c]),this._handednessSign=1):(this._pushTriangle=(h,c)=>this._triangles.push(h[0],h[c],h[c+1]),this._handednessSign=-1);const r=t.split("\n");for(let h=0;h=7){const f=parseFloat(u[4]),d=parseFloat(u[5]),p=parseFloat(u[6]);this._colors.push(new X(f>1?f/255:f,d>1?d/255:d,p>1?p/255:p,u.length===7||u[7]===void 0?1:parseFloat(u[7])))}else this._colors.push(this._grayColor)}else if((u=Ze.NormalPattern.exec(c))!==null)this._normals.push(new v(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])));else if((u=Ze.UVPattern.exec(c))!==null)this._uvs.push(new fe(parseFloat(u[1])*this._loadingOptions.UVScaling.x,parseFloat(u[2])*this._loadingOptions.UVScaling.y));else if((u=Ze.FacePattern3.exec(c))!==null)this._setDataForCurrentFaceWithPattern3(u[1].trim().split(" "),1);else if((u=Ze.FacePattern4.exec(c))!==null)this._setDataForCurrentFaceWithPattern4(u[1].trim().split(" "),1);else if((u=Ze.FacePattern5.exec(c))!==null)this._setDataForCurrentFaceWithPattern5(u[1].trim().split(" "),1);else if((u=Ze.FacePattern2.exec(c))!==null)this._setDataForCurrentFaceWithPattern2(u[1].trim().split(" "),1);else if((u=Ze.FacePattern1.exec(c))!==null)this._setDataForCurrentFaceWithPattern1(u[1].trim().split(" "),1);else if((u=Ze.LinePattern1.exec(c))!==null)this._setDataForCurrentFaceWithPattern1(u[1].trim().split(" "),0),this._hasLineData=!0;else if((u=Ze.LinePattern2.exec(c))!==null)this._setDataForCurrentFaceWithPattern2(u[1].trim().split(" "),0),this._hasLineData=!0;else if((u=Ze.LinePattern3.exec(c))!==null)this._setDataForCurrentFaceWithPattern3(u[1].trim().split(" "),0),this._hasLineData=!0;else if(Ze.GroupDescriptor.test(c)||Ze.ObjectDescriptor.test(c)){const f={name:c.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:Ze.ObjectDescriptor.test(c)};this._addPreviousObjMesh(),this._meshesFromObj.push(f),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(Ze.UseMtlDescriptor.test(c)){if(this._materialNameFromObj=c.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const f={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1};this._increment++,this._meshesFromObj.push(f),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else Ze.MtlLibGroupDescriptor.test(c)?n(c.substring(7).trim()):Ze.SmoothDescriptor.test(c)||U.Log("Unhandled expression at line : "+c)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&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._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon)),!this._hasMeshes){let h=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(const c of this._positions)this._unwrappedPositionsForBabylon.push(c.x,c.y,c.z);if(this._normals.length)for(const c of this._normals)this._unwrappedNormalsForBabylon.push(c.x,c.y,c.z);if(this._uvs.length)for(const c of this._uvs)this._unwrappedUVForBabylon.push(c.x,c.y);if(this._colors.length)for(const c of this._colors)this._unwrappedColorsForBabylon.push(c.r,c.g,c.b,c.a);this._materialNameFromObj||(h=new te(kt.RandomId(),i),h.pointsCloud=!0,this._materialNameFromObj=h.name,this._normals.length||(h.disableLighting=!0,h.emissiveColor=pe.White()))}this._meshesFromObj.push({name:kt.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:h,isObject:!0})}for(let h=0;h=0;--f)if(this._meshesFromObj[f].isObject&&this._meshesFromObj[f]._babylonMesh){c.parent=this._meshesFromObj[f]._babylonMesh;break}}if(this._materialToUse.push(this._meshesFromObj[h].materialName),this._handledMesh.hasLines&&((o=c._internalMetadata)!=null||(c._internalMetadata={}),c._internalMetadata._isLine=!0),((l=this._handledMesh.positions)==null?void 0:l.length)===0){this._babylonMeshesArray.push(c);continue}const u=new j;if(u.uvs=this._handledMesh.uvs,u.indices=this._handledMesh.indices,u.positions=this._handledMesh.positions,this._loadingOptions.computeNormals){const f=new Array;j.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,f),u.normals=f}else u.normals=this._handledMesh.normals;this._loadingOptions.importVertexColors&&(u.colors=this._handledMesh.colors),u.applyToMesh(c),this._loadingOptions.invertY&&(c.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(c),this._babylonMeshesArray.push(c),this._handledMesh.directMaterial&&(c.material=this._handledMesh.directMaterial)}}}Ze.ObjectDescriptor=/^o/;Ze.GroupDescriptor=/^g/;Ze.MtlLibGroupDescriptor=/^mtllib /;Ze.UseMtlDescriptor=/^usemtl /;Ze.SmoothDescriptor=/^s /;Ze.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/;Ze.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;Ze.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;Ze.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/;Ze.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;Ze.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;Ze.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;Ze.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;Ze.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/;Ze.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;Ze.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;class Ev extends Xi{}class Iv{constructor(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]}dispose(){this.rootNodes.slice(0).forEach(e=>{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 Av extends Xi{constructor(e){super(),this._wasAddedToScene=!1,e=e||Ce.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 Ur){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 f=u.uniqueId;t.has(f)&&(c.add(f),i.dependsOn.get(f).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&&(U.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(o=>U.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 et&&this.meshes.indexOf(e)!==-1||e instanceof Ie&&this.transformNodes.indexOf(e)!==-1||e instanceof De&&this.lights.indexOf(e)!==-1||e instanceof ve&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return U.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 U.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 U.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 U.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;return!0}instantiateModelsToScene(e,t=!1,i){this._isValidHierarchy()||ee.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const s={},n={},r=new Iv,o=[],l=[],h={doNotInstantiate:!0,...i},c=(g,_)=>{if(s[g.uniqueId]=_.uniqueId,n[_.uniqueId]=_,e&&(_.name=e(g.name)),_ instanceof F){const m=_;if(m.morphTargetManager){const x=g.morphTargetManager;m.morphTargetManager=x.clone();for(let I=0;I{if(c(g,_),g.parent){const m=s[g.parent.uniqueId],x=n[m];x?_.parent=x:_.parent=g.parent}if(_.position&&g.position&&_.position.copyFrom(g.position),_.rotationQuaternion&&g.rotationQuaternion&&_.rotationQuaternion.copyFrom(g.rotationQuaternion),_.rotation&&g.rotation&&_.rotation.copyFrom(g.rotation),_.scaling&&g.scaling&&_.scaling.copyFrom(g.scaling),_.material){const m=_;if(m.material)if(t){const x=g.material;if(l.indexOf(x)===-1){let I=x.clone(e?e(x.name):"Clone of "+x.name);if(l.push(x),s[x.uniqueId]=I.uniqueId,n[I.uniqueId]=I,x.getClassName()==="MultiMaterial"){const T=x;for(const y of T.subMaterials)y&&(I=y.clone(e?e(y.name):"Clone of "+y.name),l.push(y),s[y.uniqueId]=I.uniqueId,n[I.uniqueId]=I);T.subMaterials=T.subMaterials.map(y=>y&&n[s[y.uniqueId]])}}m.getClassName()!=="InstancedMesh"&&(m.material=n[s[x.uniqueId]])}else m.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(m.material)===-1&&this.scene.addMultiMaterial(m.material):this.scene.materials.indexOf(m.material)===-1&&this.scene.addMaterial(m.material)}_.parent===null&&r.rootNodes.push(_)};return d.forEach(g=>{if(g.getClassName()==="InstancedMesh"){const _=g,m=_.sourceMesh,x=s[m.uniqueId],T=(typeof x=="number"?n[x]:m).createInstance(_.name);p(_,T)}else{let _=!0;g.getClassName()==="TransformNode"||g.getClassName()==="Node"||g.skeleton||!g.getTotalVertices||g.getTotalVertices()===0?_=!1:h.doNotInstantiate&&(typeof h.doNotInstantiate=="function"?_=!h.doNotInstantiate(g):_=!h.doNotInstantiate);const m=_?g.createInstance("instance of ".concat(g.name)):g.clone("Clone of ".concat(g.name),null,!0);if(!m)throw new Error("Could not clone or instantiate node on Asset Container ".concat(g.name));p(g,m)}}),this.skeletons.forEach(g=>{if(h.predicate&&!h.predicate(g))return;const _=g.clone(e?e(g.name):"Clone of "+g.name);for(const m of this.meshes)if(m.skeleton===g&&!m.isAnInstance){const x=n[s[m.uniqueId]];if(!x||x.isAnInstance||(x.skeleton=_,o.indexOf(_)!==-1))continue;o.push(_);for(const I of _.bones)I._linkedTransformNode&&(I._linkedTransformNode=n[s[I._linkedTransformNode.uniqueId]])}r.skeletons.push(_)}),this.animationGroups.forEach(g=>{if(h.predicate&&!h.predicate(g))return;const _=g.clone(e?e(g.name):"Clone of "+g.name,m=>n[s[m.uniqueId]]||m);r.animationGroups.push(_)}),r}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||ee.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){const t=[];this.cameras.forEach(i=>{e&&!e(i)||(this.scene.addCamera(i),t.push(i))}),this.lights.forEach(i=>{e&&!e(i)||(this.scene.addLight(i),t.push(i))}),this.meshes.forEach(i=>{e&&!e(i)||(this.scene.addMesh(i),t.push(i))}),this.skeletons.forEach(i=>{e&&!e(i)||this.scene.addSkeleton(i)}),this.animations.forEach(i=>{e&&!e(i)||this.scene.addAnimation(i)}),this.animationGroups.forEach(i=>{e&&!e(i)||this.scene.addAnimationGroup(i)}),this.multiMaterials.forEach(i=>{e&&!e(i)||this.scene.addMultiMaterial(i)}),this.materials.forEach(i=>{e&&!e(i)||this.scene.addMaterial(i)}),this.morphTargetManagers.forEach(i=>{e&&!e(i)||this.scene.addMorphTargetManager(i)}),this.geometries.forEach(i=>{e&&!e(i)||this.scene.addGeometry(i)}),this.transformNodes.forEach(i=>{e&&!e(i)||(this.scene.addTransformNode(i),t.push(i))}),this.actionManagers.forEach(i=>{e&&!e(i)||this.scene.addActionManager(i)}),this.textures.forEach(i=>{e&&!e(i)||this.scene.addTexture(i)}),this.reflectionProbes.forEach(i=>{e&&!e(i)||this.scene.addReflectionProbe(i)});for(const i of t)i.parent&&this.scene.getNodes().indexOf(i.parent)===-1&&(i.setParent?i.setParent(null):i.parent=null)}removeAllFromScene(){this._isValidHierarchy()||ee.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,!0)}),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 Ev);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 F("assetContainerRootMesh",this.scene);return this.meshes.forEach(t=>{t.parent||e.addChild(t)}),this.meshes.unshift(e),e}mergeAnimationsTo(e=Ce.LastCreatedScene,t,i=null){if(!e)return U.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 f=l.animations.indexOf(u,0);f>-1&&l.animations.splice(f,1)}}l.animations=l.animations.concat(o.animations)}});const r=[];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}populateRootNodes(){this.rootNodes.length=0,this.meshes.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.transformNodes.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.lights.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.cameras.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)})}addAllAssetsToContainer(e){if(!e)return;const t=[],i=new Set;for(t.push(e);t.length>0;){const s=t.pop();if(s instanceof F?(s.geometry&&this.geometries.indexOf(s.geometry)===-1&&this.geometries.push(s.geometry),this.meshes.push(s)):s instanceof Ie?this.transformNodes.push(s):s instanceof De?this.lights.push(s):s instanceof ve&&this.cameras.push(s),s instanceof et){if(s.material&&this.materials.indexOf(s.material)===-1){this.materials.push(s.material);for(const n of s.material.getActiveTextures())this.textures.indexOf(n)===-1&&this.textures.push(n)}s.skeleton&&this.skeletons.indexOf(s.skeleton)===-1&&this.skeletons.push(s.skeleton),s.morphTargetManager&&this.morphTargetManagers.indexOf(s.morphTargetManager)===-1&&this.morphTargetManagers.push(s.morphTargetManager)}for(const n of s.getChildren())i.has(n)||t.push(n);i.add(s)}this.populateRootNodes()}}class vt{static get INVERT_TEXTURE_Y(){return Ri.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(e){Ri.INVERT_TEXTURE_Y=e}constructor(e){this.name="obj",this.extensions=".obj",this._assetContainer=null,this._loadingOptions=e||vt._DefaultLoadingOptions}static get _DefaultLoadingOptions(){return{computeNormals:vt.COMPUTE_NORMALS,optimizeNormals:vt.OPTIMIZE_NORMALS,importVertexColors:vt.IMPORT_VERTEX_COLORS,invertY:vt.INVERT_Y,invertTextureY:vt.INVERT_TEXTURE_Y,UVScaling:vt.UV_SCALING,materialLoadingFailsSilently:vt.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:vt.OPTIMIZE_WITH_UV,skipMaterials:vt.SKIP_MATERIALS,useLegacyBehavior:vt.USE_LEGACY_BEHAVIOR}}_loadMTL(e,t,i,s){const n=t+e;ee.LoadFile(n,i,void 0,void 0,!1,(r,o)=>{s(n,o)})}createPlugin(){return new vt(vt._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:[],spriteManagers:[]}))}loadAsync(e,t,i){return this.importMeshAsync(null,e,t,i).then(()=>{})}loadAssetContainerAsync(e,t,i){const s=new Av(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 Ri,o=[],l=[];new Ze(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,f)=>{this._loadMTL(n,s,d=>{try{r.parseMTL(t,d,s,this._assetContainer);for(let p=0;p-1;)_.push(m),g=m+1;if(m===-1&&_.length===0)r.materials[p].dispose();else for(let x=0;x<_.length;x++){const I=l[_[x]],T=r.materials[p];I.material=T,I.getTotalIndices()||(T.pointsCloud=!0)}}u()}catch(p){ee.Warn("Error processing MTL file: '".concat(n,"'")),this._loadingOptions.materialLoadingFailsSilently?u():f(p)}},(d,p)=>{ee.Warn("Error downloading MTL file: '".concat(n,"'")),this._loadingOptions.materialLoadingFailsSilently?u():f(p)})})),Promise.all(c).then(()=>{const u=f=>{var d,p;return!!((p=(d=f._internalMetadata)==null?void 0:d._isLine)!=null&&p)};return l.forEach(f=>{var d,p;if(u(f)){let g=(d=f.material)!=null?d:new te(f.name+"_line",t);g.getBindedMeshes().filter(m=>!u(m)).length>0&&(g=(p=g.clone(g.name+"_line"))!=null?p:g),g.wireframe=!0,f.material=g,f._internalMetadata&&(f._internalMetadata._isLine=void 0)}}),l})}}vt.OPTIMIZE_WITH_UV=!0;vt.INVERT_Y=!1;vt.IMPORT_VERTEX_COLORS=!1;vt.COMPUTE_NORMALS=!1;vt.OPTIMIZE_NORMALS=!1;vt.UV_SCALING=new fe(1,1);vt.SKIP_MATERIALS=!1;vt.MATERIAL_LOADING_FAILS_SILENTLY=!0;vt.USE_LEGACY_BEHAVIOR=!1;Be&&Be.RegisterPlugin(new vt);class Ge{constructor(e,t,i=Number.MAX_VALUE,s=Ne){this.origin=e,this.direction=t,this.length=i,this.epsilon=s}clone(){return new Ge(this.origin.clone(),this.direction.clone(),this.length)}intersectsBoxMinMax(e,t,i=0){const s=Ge._TmpVector3[0].copyFromFloats(e.x-i,e.y-i,e.z-i),n=Ge._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=Ge._TmpVector3[0],n=Ge._TmpVector3[1],r=Ge._TmpVector3[2],o=Ge._TmpVector3[3],l=Ge._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<-this.epsilon||u>1+this.epsilon)return null;v.CrossToRef(o,s,l);const f=v.Dot(this.direction,l)*c;if(f<-this.epsilon||u+f>1+this.epsilon)return null;const d=v.Dot(n,l)*c;return d>this.length?null:new Ea(1-u-f,u,d)}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,i,s=!1,n,r=!1){const o=N.Matrix[0];return e.getWorldMatrix().invertToRef(o),this._tmpRay?Ge.TransformToRef(this,o,this._tmpRay):this._tmpRay=Ge.Transform(this,o),e.intersects(this._tmpRay,t,i,s,n,r)}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=N.Vector3[0],r=N.Vector3[1],o=N.Vector3[2],l=N.Vector3[3];t.subtractToRef(e,n),this.direction.scaleToRef(Ge._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),f=v.Dot(n,l),d=v.Dot(o,l),p=h*u-c*c;let g,_=p,m,x=p;p_&&(g=_,m=d+c,x=u)),m<0?(m=0,-f<0?g=0:-f>h?g=_:(g=-f,_=h)):m>x&&(m=x,-f+c<0?g=0:-f+c>h?g=_:(g=-f+c,_=h));const I=Math.abs(g)0&&T<=this.length&&S.lengthSquared()=a.distance?null:h};Qe.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=Ge.Zero()),this.createPickingRayToRef(a,e,r,this._tempPickingRay,s||null),this._tempPickingRay),t,i,!0);return n&&(n.ray=this.createPickingRay(a,e,O.Identity(),s||null)),n};Object.defineProperty(Qe.prototype,"_pickingAvailable",{get:()=>!0,enumerable:!1,configurable:!1});Qe.prototype.pick=function(a,e,t,i,s,n,r=!1){const o=this._internalPick((l,h)=>(this._tempPickingRay||(this._tempPickingRay=Ge.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,O.Identity(),s||null)),o};Qe.prototype.pickWithRay=function(a,e,t,i){const s=this._internalPick(n=>(this._pickWithRayInverseMatrix||(this._pickWithRayInverseMatrix=O.Identity()),n.invertToRef(this._pickWithRayInverseMatrix),this._cachedRayForTransform||(this._cachedRayForTransform=Ge.Zero()),Ge.TransformToRef(a,this._pickWithRayInverseMatrix,this._cachedRayForTransform),this._cachedRayForTransform),e,t,!1,i);return s&&(s.ray=a),s};Qe.prototype.multiPick=function(a,e,t,i,s){return this._internalMultiPick(n=>this.createPickingRay(a,e,n,i||null),t,s)};Qe.prototype.multiPickWithRay=function(a,e,t){return this._internalMultiPick(i=>(this._pickWithRayInverseMatrix||(this._pickWithRayInverseMatrix=O.Identity()),i.invertToRef(this._pickWithRayInverseMatrix),this._cachedRayForTransform||(this._cachedRayForTransform=Ge.Zero()),Ge.TransformToRef(a,this._pickWithRayInverseMatrix,this._cachedRayForTransform),this._cachedRayForTransform),e,t)};ve.prototype.getForwardRay=function(a=100,e,t){return this.getForwardRayToRef(new Ge(v.Zero(),v.Zero(),a),a,e,t)};ve.prototype.getForwardRayToRef=function(a,e=100,t,i){t||(t=this.getWorldMatrix()),a.length=e,i?a.origin.copyFrom(i):a.origin.copyFrom(this.position);const s=N.Vector3[2];s.set(0,0,this._scene.useRightHandedSystem?-1:1);const n=N.Vector3[3];return v.TransformNormalToRef(s,t,n),v.NormalizeToRef(n,a.direction),a};Se.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===0),this._cacheRenderPipeline.setDepthWriteEnabled(a===0)),this._alphaMode=a,this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)};Se.prototype.setAlphaEquation=function(a){me.prototype.setAlphaEquation.call(this,a),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)};class sn{constructor(e,t,i,s=""){var l,h;this.defines="",this.onCompiled=null,this.onError=null,this.uniqueId=0,this.onCompileObservable=new Q,this.onErrorObservable=new Q,this.onBindObservable=new Q,this._wasPreviouslyReady=!1,this._isReady=!1,this._compilationError="",this._key="",this._computeSourceCodeOverride="",this._pipelineContext=null,this._computeSourceCode="",this._rawComputeSourceCode="",this._shaderLanguage=1,this.name=e,this._key=s,this._engine=i,this.uniqueId=sn._UniqueIdSeed++,this.defines=(l=t.defines)!=null?l:"",this.onError=t.onError,this.onCompiled=t.onCompiled,this._entryPoint=(h=t.entryPoint)!=null?h:"main",this._shaderStore=K.GetShadersStore(this._shaderLanguage),this._shaderRepository=K.GetShadersRepository(this._shaderLanguage),this._includeShaderStore=K.GetIncludesShadersStore(this._shaderLanguage);let n;const r=St()?this._engine.getHostDocument():null;typeof e=="string"?n=e:e.computeSource?n="source:"+e.computeSource:e.computeElement?n=(r==null?void 0:r.getElementById(e.computeElement))||e.computeElement:n=e.compute||e;const o={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,processCodeAfterIncludes:(c,u,f)=>{if(!f)return u;for(const d of f){const g=d.replace("#define","").replace(";","").trim().split(" ");if(g.length===2){const _=g[0],m=g[1];(!isNaN(parseInt(m))||!isNaN(parseFloat(m)))&&(u="const ".concat(_," = ").concat(m,";\n")+u)}}return u}};this._loadShader(n,"Compute","",c=>{ah(o),Mf(c,o,u=>{this._rawComputeSourceCode=c,t.processFinalCode&&(u=t.processFinalCode(u));const f=oh(u,"",o);this._useFinalCode(f.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=Ga(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?void 0:e._getComputeShaderCode())!=null?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,s=>{if(s&&s.numErrors>0){this._processCompilationErrors(s,t);return}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)}}_processCompilationErrors(e,t=null){var i;if(this._compilationError="",U.Error("Unable to compile compute effect:"),this.defines&&U.Error("Defines:\n"+this.defines),sn.LogShaderCodeOnCompilationError){const s=(i=this._pipelineContext)==null?void 0:i._getComputeShaderCode();s&&(U.Error("Compute code:"),U.Error(s))}if(typeof e=="string")this._compilationError=e,U.Error("Error: "+this._compilationError);else for(const s of e.messages){let n="";s.line!==void 0&&(n+="Line "+s.line+", "),s.offset!==void 0&&(n+="Offset "+s.offset+", "),s.length!==void 0&&(n+="Length "+s.length+", "),n+=s.type+": "+s.text,this._compilationError&&(this._compilationError+="\n"),this._compilationError+=n,U.Error(n)}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){K.GetShadersStore(1)["".concat(e,"ComputeShader")]=t}}sn._UniqueIdSeed=0;sn.LogShaderCodeOnCompilationError=!0;class Vr{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 f=r.indexInGroupEntries,d=this._bindGroupEntries[l];switch(d||(d=this._bindGroupEntries[l]=[]),c){case 5:{const p=u;f!==void 0&&s?d[f].resource=this._cacheSampler.getSampler(p):(r.indexInGroupEntries=d.length,d.push({binding:h,resource:this._cacheSampler.getSampler(p)}));break}case 0:case 4:{const p=u,g=p._texture._hardwareTexture;f!==void 0&&s?(c===0&&(d[f++].resource=this._cacheSampler.getSampler(p._texture)),d[f].resource=g.view):(r.indexInGroupEntries=d.length,c===0&&d.push({binding:h-1,resource:this._cacheSampler.getSampler(p._texture)}),d.push({binding:h,resource:g.view}));break}case 1:{const p=u,g=p._texture._hardwareTexture;g.textureAdditionalUsages&8||U.Error("computeDispatch: The texture (name=".concat(p.name,", uniqueId=").concat(p.uniqueId,") is not a storage texture!"),50),f!==void 0&&s?d[f].resource=g.viewForWriting:(r.indexInGroupEntries=d.length,d.push({binding:h,resource:g.viewForWriting}));break}case 6:{const g=u.underlyingResource;f!==void 0&&s?d[f].resource=this._device.importExternalTexture({source:g}):(r.indexInGroupEntries=d.length,d.push({binding:h,resource:this._device.importExternalTexture({source:g})}));break}case 2:case 3:case 7:{const p=c===7?u:u.getBuffer(),g=p.underlyingResource;f!==void 0&&s?(d[f].resource.buffer=g,d[f].resource.size=p.capacity):(r.indexInGroupEntries=d.length,d.push({binding:h,resource:{buffer:g,offset:0,size:p.capacity}}));break}}}for(let n=0;n0&&f.dispatchWorkgroups(i,s,n),f.end(),h&&(this._timestampQuery.endPass(this._timestampIndex,h),this._timestampIndex+=2)};Se.prototype.releaseComputeEffects=function(){for(const a in this._compiledComputeEffects){const e=this._compiledComputeEffects[a].getPipelineContext();this._deleteComputePipelineContext(e)}this._compiledComputeEffects={}};Se.prototype._prepareComputePipelineContext=function(a,e,t,i,s){const n=a;this.dbgShowShaderCode&&(U.Log(i),U.Log(e)),n.sources={compute:e,rawCompute:t},n.stage=this._createComputePipelineStageDescriptor(e,i,s)};Se.prototype._releaseComputeEffect=function(a){this._compiledComputeEffects[a._key]&&(delete this._compiledComputeEffects[a._key],this._deleteComputePipelineContext(a.getPipelineContext()))};Se.prototype._rebuildComputeEffects=function(){for(const a in this._compiledComputeEffects){const e=this._compiledComputeEffects[a];e._pipelineContext=null,e._wasPreviouslyReady=!1,e._prepareEffect()}};Se.prototype._executeWhenComputeStateIsCompiled=function(a,e){a.stage.module.getCompilationInfo().then(t=>{const i={numErrors:0,messages:[]};for(const s of t.messages)s.type==="error"&&i.numErrors++,i.messages.push({type:s.type,text:s.message,line:s.lineNum,column:s.linePos,length:s.length,offset:s.offset});e(i)})};Se.prototype._deleteComputePipelineContext=function(a){a&&a.dispose()};Se.prototype._createComputePipelineStageDescriptor=function(a,e,t){return e?e="//"+e.split("\n").join("\n//")+"\n":e="",{module:this._device.createShaderModule({code:e+a}),entryPoint:t}};Se.prototype._createDepthStencilCubeTexture=function(a,e){const t=new Et(this,e.generateStencil?12:14);t.isCube=!0,t.label=e.label;const i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,samples:1,depthTextureFormat:e.generateStencil?13:14,...e};t.format=i.depthTextureFormat,this._setupDepthStencilTexture(t,a,i.generateStencil,i.bilinearFiltering,i.comparisonFunction,i.samples),this._textureHelper.createGPUTextureForInternalTexture(t);const s=t._hardwareTexture;return t.type=Ve.GetTextureTypeFromFormat(s.format),this._internalTexturesCache.push(t),t};Se.prototype.createCubeTexture=function(a,e,t,i,s=null,n=null,r,o=null,l=!1,h=0,c=0,u=null,f,d=!1,p=null){return this.createCubeTextureBase(a,e,t,!!i,s,n,r,o,l,h,c,u,null,(g,_)=>{const m=_,x=m[0].width,I=x;this._setCubeMapTextureParams(g,!i),g.format=r!=null?r:-1;const T=this._textureHelper.createGPUTextureForInternalTexture(g,x,I);this._textureHelper.updateCubeTextures(m,T.underlyingResource,x,I,T.format,!1,!1,0,0),i||this._generateMipmaps(g,this._uploadEncoder),g.isReady=!0,g.onLoadedObservable.notifyObservers(g),g.onLoadedObservable.clear(),s&&s()},!!d,p)};Se.prototype._setCubeMapTextureParams=function(a,e,t){a.samplingMode=e?3:2,a._cachedWrapU=0,a._cachedWrapV=0,t&&(a._maxLodLevel=t)};Se.prototype.generateMipMapsForCubemap=function(a){var e;a.generateMipMaps&&((e=a._hardwareTexture)!=null&&e.underlyingResource||this._textureHelper.createGPUTextureForInternalTexture(a),this._generateMipmaps(a))};Se.prototype._debugPushGroup=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?this._renderEncoder.pushDebugGroup(a):this._currentRenderPass?this._currentRenderPass.pushDebugGroup(a):this._pendingDebugCommands.push(["push",a]))};Se.prototype._debugPopGroup=function(a){this._options.enableGPUDebugMarkers&&(a===0||a===1?this._renderEncoder.popDebugGroup():this._currentRenderPass?this._currentRenderPass.popDebugGroup():this._pendingDebugCommands.push(["pop",null]))};Se.prototype._debugInsertMarker=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?this._renderEncoder.insertDebugMarker(a):this._currentRenderPass?this._currentRenderPass.insertDebugMarker(a):this._pendingDebugCommands.push(["insert",a]))};Se.prototype._debugFlushPendingCommands=function(){for(let a=0;a0)}else if(a.occlusionInternalRetryCounter++,a.occlusionRetryCount!==-1&&a.occlusionInternalRetryCounter>a.occlusionRetryCount)a.isOcclusionQueryInProgress=!1,a.occlusionInternalRetryCounter=0,a.isOccluded=a.occlusionType===et.OCCLUSION_TYPE_OPTIMISTIC?!1:a.isOccluded;else return a.occlusionType===et.OCCLUSION_TYPE_OPTIMISTIC?!1:a.isOccluded;const t=this.getScene();if(t.getBoundingBoxRenderer){const i=t.getBoundingBoxRenderer();this._occlusionQuery===null&&(this._occlusionQuery=e.createQuery()),this._occlusionQuery&&e.beginOcclusionQuery(a.occlusionQueryAlgorithmType,this._occlusionQuery)&&(i.renderOcclusionBoundingBox(this),e.endOcclusionQuery(a.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0)}return a.isOccluded};Se.prototype.getGPUFrameTimeCounter=function(){return this._timestampQuery.gpuFrameTimeCounter};Se.prototype.captureGPUFrameTime=function(a){this._timestampQuery.enable=a&&!!this._caps.timerQuery};Se.prototype.createQuery=function(){return this._occlusionQuery.createQuery()};Se.prototype.deleteQuery=function(a){return this._occlusionQuery.deleteQuery(a),this};Se.prototype.isQueryResultAvailable=function(a){return this._occlusionQuery.isQueryResultAvailable(a)};Se.prototype.getQueryResult=function(a){return this._occlusionQuery.getQueryResult(a)};Se.prototype.beginOcclusionQuery=function(a,e){var t;if(this.compatibilityMode){if(this._occlusionQuery.canBeginQuery(e))return(t=this._currentRenderPass)==null||t.beginOcclusionQuery(e),!0}else return this._bundleList.addItem(new ao(e)),!0;return!1};Se.prototype.endOcclusionQuery=function(){var a;return this.compatibilityMode?(a=this._currentRenderPass)==null||a.endOcclusionQuery():this._bundleList.addItem(new oo),this};Se.prototype.createRawTexture=function(a,e,t,i,s,n,r,o=null,l=0,h=0,c=!1){const u=new Et(this,3);return u.baseWidth=e,u.baseHeight=t,u.width=e,u.height=t,u.format=i,u.generateMipMaps=s,u.samplingMode=r,u.invertY=n,u._compression=o,u.type=l,u._creationFlags=h,u._useSRGBBuffer=c,this._doNotHandleContextLost||(u._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(u,e,t,void 0,h),this.updateRawTexture(u,a,i,n,o,l,c),this._internalTexturesCache.push(u),u};Se.prototype.updateRawTexture=function(a,e,t,i,s=null,n=0,r=!1){if(a){if(this._doNotHandleContextLost||(a._bufferView=e,a.invertY=i,a._compression=s,a._useSRGBBuffer=r),e){const o=a._hardwareTexture;t===4&&(e=Vn(e,a.width,a.height,n));const h=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(h,a,a.width,a.height,a.depth,o.format,0,0,i,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder)}a.isReady=!0}};Se.prototype.createRawCubeTexture=function(a,e,t,i,s,n,r,o=null){const l=new Et(this,8);if(i===1&&!this._caps.textureFloatLinearFiltering?(s=!1,r=1,U.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):i===2&&!this._caps.textureHalfFloatLinearFiltering?(s=!1,r=1,U.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):i===1&&!this._caps.textureFloatRender?(s=!1,U.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):i===2&&!this._caps.colorBufferFloat&&(s=!1,U.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")),l.isCube=!0,l._originalFormat=t,l.format=t===4?5:t,l.type=i,l.generateMipMaps=s,l.width=e,l.height=e,l.samplingMode=r,this._doNotHandleContextLost||(l._bufferViewArray=a),l.invertY=n,l._compression=o,l._cachedWrapU=0,l._cachedWrapV=0,this._textureHelper.createGPUTextureForInternalTexture(l),t===4){const h=l._hardwareTexture;h._originalFormatIsRGB=!0}return a&&this.updateRawCubeTexture(l,a,t,i,n,o),l.isReady=!0,l};Se.prototype.updateRawCubeTexture=function(a,e,t,i,s,n=null){a._bufferViewArray=e,a.invertY=s,a._compression=n;const r=a._hardwareTexture,o=r._originalFormatIsRGB,l=[0,2,4,1,3,5],h=[];for(let c=0;c{e==null||e.removePendingData(f),h&&g&&h(g.status+" "+g.statusText,_)},p=g=>{const _=f.width,m=r(g);if(m){if(o){const x=i===4,I=o(m),T=f._hardwareTexture,y=[0,1,2,3,4,5];for(let b=0;b>b,A=[];for(let M=0;M<6;M++){let C=I[b][y[M]];x&&(C=Vn(C,S,S,s)),A.push(new Uint8Array(C.buffer,C.byteOffset,C.byteLength))}this._textureHelper.updateCubeTextures(A,T.underlyingResource,S,S,T.format,u,!1,0,0)}}else this.updateRawCubeTexture(f,m,i,s,u);f.isReady=!0,e==null||e.removePendingData(f),l&&l()}};return this._loadFile(a,g=>{p(g)},void 0,e==null?void 0:e.offlineProvider,!0,d),f};Se.prototype.createRawTexture3D=function(a,e,t,i,s,n,r,o,l=null,h=0,c=0){const f=new Et(this,10);return f.baseWidth=e,f.baseHeight=t,f.baseDepth=i,f.width=e,f.height=t,f.depth=i,f.format=s,f.type=h,f.generateMipMaps=n,f.samplingMode=o,f.is3D=!0,f._creationFlags=c,this._doNotHandleContextLost||(f._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(f,e,t,void 0,c),this.updateRawTexture3D(f,a,s,r,l,h),this._internalTexturesCache.push(f),f};Se.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=Vn(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};Se.prototype.createRawTexture2DArray=function(a,e,t,i,s,n,r,o,l=null,h=0,c=0){const f=new Et(this,11);return f.baseWidth=e,f.baseHeight=t,f.baseDepth=i,f.width=e,f.height=t,f.depth=i,f.format=s,f.type=h,f.generateMipMaps=n,f.samplingMode=o,f.is2DArray=!0,f._creationFlags=c,this._doNotHandleContextLost||(f._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(f,e,t,i,c),this.updateRawTexture2DArray(f,a,s,r,l,h),this._internalTexturesCache.push(f),f};Se.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=Vn(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 Vn(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.is3D=h>0,a.depth=l||h,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};Se.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};Se.prototype.createRenderTargetCubeTexture=function(a,e){var n;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.label=(n=i.label)!=null?n:"RenderTargetWrapper",t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer;const s=new Et(this,5);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};Se.prototype.setDepthStencilTexture=function(a,e,t,i){!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i)};function Pv(a){return!!(a&&a.underlyingResource!==void 0)}Se.prototype.updateVideoTexture=function(a,e,t){var s;if(!a||a._isDisabled)return;this._videoTextureSupported===void 0&&(this._videoTextureSupported=!0);let i=a._hardwareTexture;if((s=a._hardwareTexture)!=null&&s.underlyingResource||(i=this._textureHelper.createGPUTextureForInternalTexture(a)),Pv(e)){if(e.isReady()){try{this._textureHelper.copyVideoToTexture(e,a,i.format,!t),a.generateMipMaps&&this._generateMipmaps(a)}catch{}a.isReady=!0}}else e&&this.createImageBitmap(e).then(n=>{this._textureHelper.updateTexture(n,a,a.width,a.height,a.depth,i.format,0,0,!t,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a),a.isReady=!0}).catch(()=>{a.isReady=!0})};var wv={value:()=>{}};function hc(){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}})}nr.prototype=hc.prototype={constructor:nr,on:function(a,e){var t=this._,i=Dv(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)),yl.hasOwnProperty(e)?{space:yl[e],local:a}:a}function Ov(a){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Ia&&e.documentElement.namespaceURI===Ia?e.createElement(a):e.createElementNS(t,a)}}function Lv(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function yo(a){var e=Gr(a);return(e.local?Lv:Ov)(e)}function Bv(){}function To(a){return a==null?Bv:function(){return this.querySelector(a)}}function Nv(a){typeof a!="function"&&(a=To(a));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=I&&(I=x+1);!(y=_[I])&&++I=0;)(r=i[s])&&(n&&r.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(r,n),n=r);return this}function l2(a){a||(a=h2);function e(u,f){return u&&f?a(u.__data__,f.__data__):!u-!f}for(var t=this._groups,i=t.length,s=new Array(i),n=0;ne?1:a>=e?0:NaN}function c2(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function u2(){return Array.from(this)}function f2(){for(var a=this._groups,e=0,t=a.length;e1?this.each((e==null?S2:typeof e=="function"?I2:E2)(a,e,t==null?"":t)):nn(this.node(),a)}function nn(a,e){return a.style.getPropertyValue(e)||pc(a).getComputedStyle(a,null).getPropertyValue(e)}function C2(a){return function(){delete this[a]}}function M2(a,e){return function(){this[a]=e}}function R2(a,e){return function(){var t=e.apply(this,arguments);t==null?delete this[a]:this[a]=t}}function P2(a,e){return arguments.length>1?this.each((e==null?C2:typeof e=="function"?R2:M2)(a,e)):this.node()[a]}function _c(a){return a.trim().split(/^|\s+/)}function So(a){return a.classList||new gc(a)}function gc(a){this._node=a,this._names=_c(a.getAttribute("class")||"")}gc.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 mc(a,e){for(var t=So(a),i=-1,s=e.length;++i=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function nx(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?Zn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Zn(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=px.exec(a))?new ni(e[1],e[2],e[3],1):(e=_x.exec(a))?new ni(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=gx.exec(a))?Zn(e[1],e[2],e[3],e[4]):(e=mx.exec(a))?Zn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=vx.exec(a))?Ml(e[1],e[2]/100,e[3]/100,1):(e=xx.exec(a))?Ml(e[1],e[2]/100,e[3]/100,e[4]):Tl.hasOwnProperty(a)?Il(Tl[a]):a==="transparent"?new ni(NaN,NaN,NaN,0):null}function Il(a){return new ni(a>>16&255,a>>8&255,a&255,1)}function Zn(a,e,t,i){return i<=0&&(a=e=t=NaN),new ni(a,e,t,i)}function Tx(a){return a instanceof zn||(a=wn(a)),a?(a=a.rgb(),new ni(a.r,a.g,a.b,a.opacity)):new ni}function Aa(a,e,t,i){return arguments.length===1?Tx(a):new ni(a,e,t,i==null?1:i)}function ni(a,e,t,i){this.r=+a,this.g=+e,this.b=+t,this.opacity=+i}Eo(ni,Aa,Tc(zn,{brighter(a){return a=a==null?vr:Math.pow(vr,a),new ni(this.r*a,this.g*a,this.b*a,this.opacity)},darker(a){return a=a==null?Rn:Math.pow(Rn,a),new ni(this.r*a,this.g*a,this.b*a,this.opacity)},rgb(){return this},clamp(){return new ni(Fs(this.r),Fs(this.g),Fs(this.b),xr(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:Al,formatHex:Al,formatHex8:Sx,formatRgb:Cl,toString:Cl}));function Al(){return"#".concat(Rs(this.r)).concat(Rs(this.g)).concat(Rs(this.b))}function Sx(){return"#".concat(Rs(this.r)).concat(Rs(this.g)).concat(Rs(this.b)).concat(Rs((isNaN(this.opacity)?1:this.opacity)*255))}function Cl(){const a=xr(this.opacity);return"".concat(a===1?"rgb(":"rgba(").concat(Fs(this.r),", ").concat(Fs(this.g),", ").concat(Fs(this.b)).concat(a===1?")":", ".concat(a,")"))}function xr(a){return isNaN(a)?1:Math.max(0,Math.min(1,a))}function Fs(a){return Math.max(0,Math.min(255,Math.round(a)||0))}function Rs(a){return a=Fs(a),(a<16?"0":"")+a.toString(16)}function Ml(a,e,t,i){return i<=0?a=e=t=NaN:t<=0||t>=1?a=e=NaN:e<=0&&(a=NaN),new Pi(a,e,t,i)}function Sc(a){if(a instanceof Pi)return new Pi(a.h,a.s,a.l,a.opacity);if(a instanceof zn||(a=wn(a)),!a)return new Pi;if(a instanceof Pi)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 Pi(r,o,l,a.opacity)}function Ex(a,e,t,i){return arguments.length===1?Sc(a):new Pi(a,e,t,i==null?1:i)}function Pi(a,e,t,i){this.h=+a,this.s=+e,this.l=+t,this.opacity=+i}Eo(Pi,Ex,Tc(zn,{brighter(a){return a=a==null?vr:Math.pow(vr,a),new Pi(this.h,this.s,this.l*a,this.opacity)},darker(a){return a=a==null?Rn:Math.pow(Rn,a),new Pi(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 ni(oa(a>=240?a-240:a+120,s,i),oa(a,s,i),oa(a<120?a+240:a-120,s,i),this.opacity)},clamp(){return new Pi(Rl(this.h),Qn(this.s),Qn(this.l),xr(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=xr(this.opacity);return"".concat(a===1?"hsl(":"hsla(").concat(Rl(this.h),", ").concat(Qn(this.s)*100,"%, ").concat(Qn(this.l)*100,"%").concat(a===1?")":", ".concat(a,")"))}}));function Rl(a){return a=(a||0)%360,a<0?a+360:a}function Qn(a){return Math.max(0,Math.min(1,a||0))}function oa(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 Ec=a=>()=>a;function Ix(a,e){return function(t){return a+t*e}}function Ax(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 Cx(a){return(a=+a)==1?Ic:function(e,t){return t-e?Ax(e,t,a):Ec(isNaN(e)?t:e)}}function Ic(a,e){var t=e-a;return t?Ix(a,t):Ec(isNaN(a)?e:a)}const Pl=function a(e){var t=Cx(e);function i(s,n){var r=t((s=Aa(s)).r,(n=Aa(n)).r),o=t(s.g,n.g),l=t(s.b,n.b),h=Ic(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 _s(a,e){return a=+a,e=+e,function(t){return a*(1-t)+e*t}}var Ca=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,la=new RegExp(Ca.source,"g");function Mx(a){return function(){return a}}function Rx(a){return function(e){return a(e)+""}}function Px(a,e){var t=Ca.lastIndex=la.lastIndex=0,i,s,n,r=-1,o=[],l=[];for(a=a+"",e=e+"";(i=Ca.exec(a))&&(s=la.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:_s(i,s)})),t=la.lastIndex;return t180?c+=360:c-h>180&&(h+=360),f.push({i:u.push(s(u)+"rotate(",null,i)-2,x:_s(h,c)})):c&&u.push(s(u)+"rotate("+c+i)}function o(h,c,u,f){h!==c?f.push({i:u.push(s(u)+"skewX(",null,i)-2,x:_s(h,c)}):c&&u.push(s(u)+"skewX("+c+i)}function l(h,c,u,f,d,p){if(h!==u||c!==f){var g=d.push(s(d)+"scale(",null,",",null,")");p.push({i:g-4,x:_s(h,u)},{i:g-2,x:_s(c,f)})}else(u!==1||f!==1)&&d.push(s(d)+"scale("+u+","+f+")")}return function(h,c){var u=[],f=[];return h=a(h),c=a(c),n(h.translateX,h.translateY,c.translateX,c.translateY,u,f),r(h.rotate,c.rotate,u,f),o(h.skewX,c.skewX,u,f),l(h.scaleX,h.scaleY,c.scaleX,c.scaleY,u,f),h=c=null,function(d){for(var p=-1,g=f.length,_;++p=0&&a._call.call(void 0,e),a=a._next;--rn}function Dl(){Os=(yr=Dn.now())+zr,rn=gn=0;try{Bx()}finally{rn=0,Ux(),Os=0}}function Nx(){var a=Dn.now(),e=a-yr;e>Mc&&(zr-=e,yr=a)}function Ux(){for(var a,e=br,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:br=t);mn=a,Ra(i)}function Ra(a){if(!rn){gn&&(gn=clearTimeout(gn));var e=a-Os;e>24?(a<1/0&&(gn=setTimeout(Dl,a-Dn.now()-zr)),pn&&(pn=clearInterval(pn))):(pn||(yr=Dn.now(),pn=setInterval(Nx,Mc)),rn=1,Rc(Dl))}}function Fl(a,e,t){var i=new Tr;return e=e==null?0:+e,i.restart(s=>{i.stop(),a(s+e)},e,t),i}var kx=hc("start","end","cancel","interrupt"),Vx=[],wc=0,Ol=1,Pa=2,rr=3,Ll=4,wa=5,ar=6;function Wr(a,e,t,i,s,n){var r=a.__transition;if(!r)a.__transition={};else if(t in r)return;Gx(a,t,{name:e,index:i,group:s,on:kx,tween:Vx,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:wc})}function Ao(a,e){var t=Li(a,e);if(t.state>wc)throw new Error("too late; already scheduled");return t}function Hi(a,e){var t=Li(a,e);if(t.state>rr)throw new Error("too late; already running");return t}function Li(a,e){var t=a.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Gx(a,e,t){var i=a.__transition,s;i[e]=t,t.timer=Pc(n,0,t.time);function n(h){t.state=Ol,t.timer.restart(r,t.delay,t.time),t.delay<=h&&r(h-t.delay)}function r(h){var c,u,f,d;if(t.state!==Ol)return l();for(c in i)if(d=i[c],d.name===t.name){if(d.state===rr)return Fl(r);d.state===Ll?(d.state=ar,d.timer.stop(),d.on.call("interrupt",a,a.__data__,d.index,d.group),delete i[c]):+cPa&&i.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function v3(a,e,t){var i,s,n=m3(e)?Ao:Hi;return function(){var r=n(this,a),o=r.on;o!==i&&(s=(i=o).copy()).on(e,t),r.on=s}}function x3(a,e){var t=this._id;return arguments.length<2?Li(this.node(),t).on.on(a):this.each(v3(t,a,e))}function b3(a){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==a)return;e&&e.removeChild(this)}}function y3(){return this.on("end.remove",b3(this._id))}function T3(a){var e=this._name,t=this._id;typeof a!="function"&&(a=To(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=[],f=[],d=[],p=[],g=[],_=[],m=[];let x;const I=[],T=[];let y,b,S;if(e.length<2){const Z=[],Ee=[];for(b=0;b0&&(z=w[S].subtract(w[S-1]).length(),L=z+_[y],p[y].push(L),_[y]=L),S++;i&&(S--,c.push(w[0].x,w[0].y,w[0].z),z=w[S].subtract(w[0]).length(),L=z+_[y],p[y].push(L),_[y]=L),I[y]=P+M,T[y]=A,A+=P+M}let G,H,ce=null,J=null;for(b=0;b{let p=i[0].length;const g=o;let _=0;const m=g._originalBuilderSideOrientation===F.DOUBLESIDE?2:1;for(let x=1;x<=m;++x)for(let I=0;ILs(a,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:r,sideOrientation:o,instance:l},n);function Bc(a){const e=[],t=[],i=[],s=[],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 p=0;pNc(a,{radius:e,tessellation:t,sideOrientation:n,updatable:s},i);F._GroundMeshParser=(a,e)=>Wn.Parse(a,e);class Wn extends F{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=N.Matrix[5];i.invertToRef(s);const n=N.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=N.Matrix[5];s.invertToRef(n);const r=N.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),f=(u.x+a.width/2)/a.width*(a.bufferWidth-1)|0,d=(1-(u.z+a.height/2)/a.height)*(a.bufferHeight-1)|0,p=(f+d*a.bufferWidth)*4;let g=a.buffer[p]/255,_=a.buffer[p+1]/255,m=a.buffer[p+2]/255;const x=a.buffer[p+3]/255;h&&(g=1-g,_=1-_,m=1-m);const I=g*o.r+_*o.g+m*o.b;x>=l?u.y=a.minHeight+(a.maxHeight-a.minHeight)*I:u.y=a.minHeight-Ne,a.heightBuffer&&(a.heightBuffer[n*(a.subdivisions+1)+r]=u.y),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,_=t[f*3+1]>=a.minHeight,m=t[d*3+1]>=a.minHeight;g&&_&&m&&(e.push(u),e.push(f),e.push(d)),t[p*3+1]>=a.minHeight&&g&&m&&(e.push(p),e.push(u),e.push(d))}j.ComputeNormals(t,e,i);const c=new j;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function Gc(a,e={},t){const i=new Wn(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,Uc(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function zc(a,e,t=null){const i=new F(a,t);return kc(e).applyToMesh(i,e.updatable),i}function Wc(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 pe(.3,.59,.11),c=t.alphaFilter||0,u=t.updatable,f=t.onReady;i=i||Ce.LastCreatedScene;const d=new Wn(a,i);d._subdivisionsX=r,d._subdivisionsY=r,d._width=s,d._height=n,d._maxX=d._width/2,d._maxZ=d._height/2,d._minX=-d._maxX,d._minZ=-d._maxZ,d._setReady(!1);let p;t.passHeightBufferInCallback&&(p=new Float32Array((r+1)*(r+1)));const g=(_,m,x)=>{Vc({width:s,height:n,subdivisions:r,minHeight:o,maxHeight:l,colorFilter:h,buffer:_,bufferWidth:m,bufferHeight:x,alphaFilter:c,heightBuffer:p}).applyToMesh(d,u),f&&f(d,p),d._setReady(!0)};if(typeof e=="string"){const _=m=>{const x=m.width,I=m.height;if(i.isDisposed)return;const T=i==null?void 0:i.getEngine().resizeImageBitmap(m,x,I);g(T,x,I)};ee.LoadImage(e,_,t.onError?t.onError:()=>{},i.offlineProvider)}else g(e.data,e.width,e.height);return d}j.CreateGround=Uc;j.CreateTiledGround=kc;j.CreateGroundFromHeightMap=Vc;F.CreateGround=(a,e,t,i,s,n)=>Gc(a,{width:e,height:t,subdivisions:i,updatable:n},s);F.CreateTiledGround=(a,e,t,i,s,n,r,o,l)=>zc(a,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:n,precision:r,updatable:l},o);F.CreateGroundFromHeightMap=(a,e,t,i,s,n,r,o,l,h,c)=>Wc(a,e,{width:t,height:i,subdivisions:s,minHeight:n,maxHeight:r,updatable:l,onReady:h,alphaFilter:c},o);function Xc(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 f=[2,0,3,1],d=[2,0,1,3];let p=f[c],g=d[u],_=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-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],_=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,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 S=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],A=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const M=[17,18,19,16],C=[22,23,20,21];for(;p>0;)S.unshift(S.pop()),M.unshift(M.pop()),p--;for(;g>0;)A.unshift(A.pop()),C.unshift(C.pop()),g--;S=S.flat(),A=A.flat(),_=_.concat(S).concat(A),t.push(M[0],M[2],M[3],M[0],M[1],M[2]),t.push(C[0],C[2],C[3],C[0],C[1],C[2])}const m=[r/2,o/2,l/2];n=_.reduce((S,A,M)=>S.concat(A*m[M%3]),[]);const x=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,I=a.faceUV||new Array(6),T=a.faceColors,y=[];for(let S=0;S<6;S++)I[S]===void 0&&(I[S]=new Pe(0,0,1,1)),T&&T[S]===void 0&&(T[S]=new X(1,1,1,1));for(let S=0;S<6;S++)if(s.push(I[S].z,Le.UseOpenGLOrientationForUV?1-I[S].w:I[S].w),s.push(I[S].x,Le.UseOpenGLOrientationForUV?1-I[S].w:I[S].w),s.push(I[S].x,Le.UseOpenGLOrientationForUV?1-I[S].y:I[S].y),s.push(I[S].z,Le.UseOpenGLOrientationForUV?1-I[S].y:I[S].y),T)for(let A=0;A<4;A++)y.push(T[S].r,T[S].g,T[S].b,T[S].a);j._ComputeSides(x,n,t,i,s,a.frontUVs,a.backUVs);const b=new j;if(b.indices=t,b.positions=n,b.normals=i,b.uvs=s,T){const S=x===j.DOUBLESIDE?y.concat(y):y;b.colors=S}return b}function Hc(a,e={},t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Xc(e).applyToMesh(i,e.updatable),i}j.CreateBox=Xc;F.CreateBox=(a,e,t=null,i,s)=>Hc(a,{size:e,sideOrientation:s,updatable:i},t);function Tn(a){const e=a.pattern||F.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 f=t*o/2,d=i*c/2;let p=0,g=0,_=0,m=0,x=0,I=0;if(l>0||u>0){switch(_=-f,m=-d,x=f,I=d,s){case F.CENTER:l/=2,_-=l,x+=l;break;case F.LEFT:x+=l,p=-l/2;break;case F.RIGHT:_-=l,p=l/2;break}switch(n){case F.CENTER:u/=2,m-=u,I+=u;break;case F.BOTTOM:I+=u,g=-u/2;break;case F.TOP:m-=u,g=u/2;break}}const T=[],y=[],b=[];b[0]=[0,0,1,0,1,1,0,1],b[1]=[0,0,1,0,1,1,0,1],(e===F.ROTATE_TILE||e===F.ROTATE_ROW)&&(b[1]=[1,1,0,1,0,0,1,0]),(e===F.FLIP_TILE||e===F.FLIP_ROW)&&(b[1]=[1,0,0,0,0,1,1,1]),(e===F.FLIP_N_ROTATE_TILE||e===F.FLIP_N_ROTATE_ROW)&&(b[1]=[0,1,1,1,1,0,0,0]);let S=[];const A=[],M=[];let C=0;for(let L=0;L0||u>0){const L=u>0&&(n===F.CENTER||n===F.TOP),G=u>0&&(n===F.CENTER||n===F.BOTTOM),H=l>0&&(s===F.CENTER||s===F.RIGHT),ce=l>0&&(s===F.CENTER||s===F.LEFT);let J=[],W,V,R,k;if(L&&H&&(T.push(_+p,m+g,0),T.push(-f+p,m+g,0),T.push(-f+p,m+u+g,0),T.push(_+p,m+u+g,0),M.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,W=1-l/t,V=1-u/i,R=1,k=1,J=[W,V,R,V,R,k,W,k],e===F.ROTATE_ROW&&(J=[1-W,1-V,1-R,1-V,1-R,1-k,1-W,1-k]),e===F.FLIP_ROW&&(J=[1-W,V,1-R,V,1-R,k,1-W,k]),e===F.FLIP_N_ROTATE_ROW&&(J=[W,1-V,R,1-V,R,1-k,W,1-k]),S=S.concat(J),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&ce&&(T.push(f+p,m+g,0),T.push(x+p,m+g,0),T.push(x+p,m+u+g,0),T.push(f+p,m+u+g,0),M.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,W=0,V=1-u/i,R=l/t,k=1,J=[W,V,R,V,R,k,W,k],(e===F.ROTATE_ROW||e===F.ROTATE_TILE&&o%2===0)&&(J=[1-W,1-V,1-R,1-V,1-R,1-k,1-W,1-k]),(e===F.FLIP_ROW||e===F.FLIP_TILE&&o%2===0)&&(J=[1-W,V,1-R,V,1-R,k,1-W,k]),(e===F.FLIP_N_ROTATE_ROW||e===F.FLIP_N_ROTATE_TILE&&o%2===0)&&(J=[W,1-V,R,1-V,R,1-k,W,1-k]),S=S.concat(J),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),G&&H&&(T.push(_+p,d+g,0),T.push(-f+p,d+g,0),T.push(-f+p,I+g,0),T.push(_+p,I+g,0),M.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,W=1-l/t,V=0,R=1,k=u/i,J=[W,V,R,V,R,k,W,k],(e===F.ROTATE_ROW&&c%2===1||e===F.ROTATE_TILE&&c%1===0)&&(J=[1-W,1-V,1-R,1-V,1-R,1-k,1-W,1-k]),(e===F.FLIP_ROW&&c%2===1||e===F.FLIP_TILE&&c%2===0)&&(J=[1-W,V,1-R,V,1-R,k,1-W,k]),(e===F.FLIP_N_ROTATE_ROW&&c%2===1||e===F.FLIP_N_ROTATE_TILE&&c%2===0)&&(J=[W,1-V,R,1-V,R,1-k,W,1-k]),S=S.concat(J),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),G&&ce&&(T.push(f+p,d+g,0),T.push(x+p,d+g,0),T.push(x+p,I+g,0),T.push(f+p,I+g,0),M.push(C,C+1,C+3,C+1,C+2,C+3),C+=4,W=0,V=0,R=l/t,k=u/i,J=[W,V,R,V,R,k,W,k],(e===F.ROTATE_ROW&&c%2===1||e===F.ROTATE_TILE&&(c+o)%2===1)&&(J=[1-W,1-V,1-R,1-V,1-R,1-k,1-W,1-k]),(e===F.FLIP_ROW&&c%2===1||e===F.FLIP_TILE&&(c+o)%2===1)&&(J=[1-W,V,1-R,V,1-R,k,1-W,k]),(e===F.FLIP_N_ROTATE_ROW&&c%2===1||e===F.FLIP_N_ROTATE_TILE&&(c+o)%2===1)&&(J=[W,1-V,R,1-V,R,1-k,W,1-k]),S=S.concat(J),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L){const Y=[];W=0,V=1-u/i,R=1,k=1,Y[0]=[W,V,R,V,R,k,W,k],Y[1]=[W,V,R,V,R,k,W,k],(e===F.ROTATE_TILE||e===F.ROTATE_ROW)&&(Y[1]=[1-W,1-V,1-R,1-V,1-R,1-k,1-W,1-k]),(e===F.FLIP_TILE||e===F.FLIP_ROW)&&(Y[1]=[1-W,V,1-R,V,1-R,k,1-W,k]),(e===F.FLIP_N_ROTATE_TILE||e===F.FLIP_N_ROTATE_ROW)&&(Y[1]=[W,1-V,R,1-V,R,1-k,W,1-k]);for(let he=0;heY+w)),w+=S[R].length,i)for(let Y=0;Y<4;Y++)b.push(i[R].r,i[R].g,i[R].b,i[R].a)}const P=new v(0,0,g),z=O.RotationY(Math.PI);x=S[0].map(R=>v.TransformNormal(R,z).add(P)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]),I=A[0].map(R=>v.TransformNormal(R,z)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]),x=x.concat(S[1].map(R=>R.subtract(P)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),I=I.concat(A[1].map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]));const L=new v(d,0,0),G=O.RotationY(-Math.PI/2);x=x.concat(S[2].map(R=>v.TransformNormal(R,G).add(L)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),I=I.concat(A[2].map(R=>v.TransformNormal(R,G)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]));const H=O.RotationY(Math.PI/2);x=x.concat(S[3].map(R=>v.TransformNormal(R,H).subtract(L)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),I=I.concat(A[3].map(R=>v.TransformNormal(R,H)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]));const ce=new v(0,p,0),J=O.RotationX(Math.PI/2);x=x.concat(S[4].map(R=>v.TransformNormal(R,J).add(ce)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),I=I.concat(A[4].map(R=>v.TransformNormal(R,J)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[]));const W=O.RotationX(-Math.PI/2);x=x.concat(S[5].map(R=>v.TransformNormal(R,W).subtract(ce)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),I=I.concat(A[5].map(R=>v.TransformNormal(R,W)).map(R=>[R.x,R.y,R.z]).reduce((R,k)=>R.concat(k),[])),j._ComputeSides(f,x,y,I,T);const V=new j;if(V.indices=y,V.positions=x,V.normals=I,V.uvs=T,i){const R=f===j.DOUBLESIDE?b.concat(b):b;V.colors=R}return V}function q3(a,e,t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Kc(e).applyToMesh(i,e.updatable),i}j.CreateTiledBox=Kc;function Yc(a){const e=(a.segments||32)|0,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,f=[],d=[],p=[],g=[];for(let m=0;m<=c;m++){const x=m/c,I=x*Math.PI*r;for(let T=0;T<=u;T++){const y=T/u,b=y*Math.PI*2*n,S=O.RotationZ(-I),A=O.RotationY(b),M=v.TransformCoordinates(v.Up(),S),C=v.TransformCoordinates(M,A),w=C.multiply(h),P=C.divide(h).normalize();d.push(w.x,w.y,w.z),p.push(P.x,P.y,P.z),g.push(y,Le.UseOpenGLOrientationForUV?1-x:x)}if(m>0){const T=d.length/3;for(let y=T-2*(u+1);y+u+21&&(f.push(y),f.push(y+1),f.push(y+u+1)),(mqc(a,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:n,updatable:s},i);function $c(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)|0,n=(a.subdivisions||1)|0,r=!!a.hasRings,o=!!a.enclose,l=a.cap===0?0:a.cap||F.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),f=a.faceColors,d=h!==1&&o?2:0,p=r?n:1,g=2+(1+d)*p;let _;for(_=0;_{const xe=ue?t/2:i/2;if(xe===0)return;let ae,Me,ke;const Z=ue?u[g-1]:u[0];let Ee=null;f&&(Ee=ue?f[g-1]:f[0]);const Oe=x.length/3,He=ue?e/2:-e/2,je=new v(0,He,0);x.push(je.x,je.y,je.z),I.push(0,ue?1:-1,0);const Ct=Z.y+(Z.w-Z.y)*.5;T.push(Z.x+(Z.z-Z.x)*.5,Le.UseOpenGLOrientationForUV?1-Ct:Ct),Ee&&y.push(Ee.r,Ee.g,Ee.b,Ee.a);const wt=new fe(.5,.5);for(ke=0;ke<=s;ke++){ae=Math.PI*2*ke*h/s;const ri=Math.cos(-ae),ei=Math.sin(-ae);Me=new v(ri*xe,He,ei*xe);const Ht=new fe(ri*wt.x+.5,ei*wt.y+.5);x.push(Me.x,Me.y,Me.z),I.push(0,ue?1:-1,0);const Bi=Z.y+(Z.w-Z.y)*Ht.y;T.push(Z.x+(Z.z-Z.x)*Ht.x,Le.UseOpenGLOrientationForUV?1-Bi:Bi),Ee&&y.push(Ee.r,Ee.g,Ee.b,Ee.a)}for(ke=0;ke((r===void 0||!(r instanceof Qe))&&(r!==void 0&&(l=o||F.DEFAULTSIDE,o=r),r=n,n=1),jc(a,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:n,sideOrientation:l,updatable:o},r));function Zc(a){const e=[],t=[],i=[],s=[],n=a.diameter||1,r=a.thickness||.5,o=(a.tessellation||16)|0,l=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,h=o+1;for(let u=0;u<=o;u++){const f=u/o,d=u*Math.PI*2/o-Math.PI/2,p=O.Translation(n/2,0,0).multiply(O.RotationY(d));for(let g=0;g<=o;g++){const _=1-g/o,m=g*Math.PI*2/o+Math.PI,x=Math.cos(m),I=Math.sin(m);let T=new v(x,I,0),y=T.scale(r/2);const b=new fe(f,_);y=v.TransformCoordinates(y,p),T=v.TransformNormal(T,p),t.push(y.x,y.y,y.z),i.push(T.x,T.y,T.z),s.push(b.x,Le.UseOpenGLOrientationForUV?1-b.y:b.y);const S=(u+1)%h,A=(g+1)%h;e.push(u*h+g),e.push(u*h+A),e.push(S*h+g),e.push(u*h+A),e.push(S*h+A),e.push(S*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 Qc(a,e={},t){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Zc(e).applyToMesh(i,e.updatable),i}j.CreateTorus=Zc;F.CreateTorus=(a,e,t,i,s,n,r)=>Qc(a,{diameter:e,thickness:t,tessellation:i,sideOrientation:r,updatable:n},s);function Jc(a){const e=[],t=[],i=[],s=[],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,f=_=>{const m=Math.cos(_),x=Math.sin(_),I=c/h*_,T=Math.cos(I),y=n*(2+T)*.5*m,b=n*(2+T)*x*.5,S=n*Math.sin(I)*.5;return new v(y,b,S)};let d,p;for(d=0;d<=o;d++){const m=d%o/o*2*h*Math.PI,x=f(m),I=f(m+.01),T=I.subtract(x);let y=I.add(x);const b=v.Cross(T,y);for(y=v.Cross(b,T),b.normalize(),y.normalize(),p=0;peu(a,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:n,q:r,sideOrientation:h,updatable:l},o);function tu(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 iu(a){const e=a.dashSize||3,t=a.gapSize||1,i=a.dashNb||200,s=a.points,n=[],r=[],o=v.Zero();let l=0,h=0,c=0,u=0,f=0,d=0,p=0;for(p=0;p{const u=v.Zero(),f=c.length/6;let d=0,p=0,g=0,_=0,m=0,x=0,I=0,T=0;for(I=0;Inu(a,{points:e,updatable:i,instance:s},t);F.CreateDashedLines=(a,e,t,i,s,n=null,r,o)=>ru(a,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:r,instance:o},n);class $3 extends fe{constructor(e,t){super(e.x,e.y),this.index=t}}class ha{constructor(){this.elements=[]}add(e){const t=[];return e.forEach(i=>{const s=new $3(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 j3{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new ha,this._outlinepoints=new ha,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||Ce.LastCreatedScene;let n;t instanceof Mr?n=t.getPoints():n=t,this._addToepoint(n),this._points.add(n),this._outlinepoints.add(n),typeof this.bjsEarcut>"u"&&U.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new ha;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 F(this._name,this._scene),n=this.buildVertexData(t,i);return s.setVerticesData(E.PositionKind,n.positions,e),s.setVerticesData(E.NormalKind,n.normals,e),s.setVerticesData(E.UVKind,n.uvs,e),s.setIndices(n.indices),s}buildVertexData(e=0,t=2){const i=new j,s=[],n=[],r=[],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=[],h=this.bjsEarcut(this._epoints,this._eholes,2);for(let c=0;c0){const c=n.length/3;this._points.elements.forEach(f=>{s.push(0,-1,0),n.push(f.x,-e,f.y),r.push(1-(f.x-o.min.x)/o.width,1-(f.y-o.min.y)/o.height)});const u=l.length;for(let f=0;f{this._addSide(n,s,r,l,o,f,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 f=0;fh?Sh?AMo(a,{shape:e,holes:i,updatable:s,sideOrientation:n},t,r);F.ExtrudePolygon=(a,e,t,i,s,n,r,o=earcut)=>Ro(a,{shape:e,holes:s,depth:t,updatable:n,sideOrientation:r},i,o);function ou(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||F.NO_CAP,l=e.updatable,h=F._GetDefaultSideOrientation(e.sideOrientation),c=e.instance||null,u=e.invertUV||!1,f=e.closeShape||!1,d=e.closePath||!1;return hu(a,s,i,n,r,null,null,d,f,o,!1,t,!!l,h,c,u,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame)}function lu(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||F.NO_CAP,c=e.updatable,u=e.firstNormal||null,f=e.adjustFrame||!1,d=F._GetDefaultSideOrientation(e.sideOrientation),p=e.instance,g=e.invertUV||!1;return hu(a,s,i,null,null,n,r,o,l,h,!0,t,!!c,d,p||null,g,e.frontUVs||null,e.backUVs||null,u,f)}function hu(a,e,t,i,s,n,r,o,l,h,c,u,f,d,p,g,_,m,x,I){const T=(M,C,w,P,z,L,G,H,ce,J,W)=>{const V=w.getTangents(),R=w.getNormals(),k=w.getBinormals(),Y=w.getDistances();if(W){for(let Z=0;Z0){let Ee=V[Z-1];v.Dot(Ee,V[Z])<0&&V[Z].scaleInPlace(-1),Ee=R[Z-1],v.Dot(Ee,R[Z])<0&&R[Z].scaleInPlace(-1),Ee=k[Z-1],v.Dot(Ee,k[Z])<0&&k[Z].scaleInPlace(-1)}}let he=0;const oe=()=>z!==null?z:1,ue=J&&H?H:()=>L!==null?L:0,xe=J&&G?G:oe;let ae=ce===F.NO_CAP||ce===F.CAP_END?0:2;const Me=N.Matrix[0];for(let Z=0;Z{const Ee=Array(),Oe=v.Zero();let He;for(He=0;He3?0:h,b=T(e,t,y,S,i,s,n,r,h,c,I);const A=Ls(a,{pathArray:b,closeArray:o,closePath:l,updatable:f,sideOrientation:d,invertUV:g,frontUVs:_||void 0,backUVs:m||void 0},u);return A._creationDataStorage.pathArray=b,A._creationDataStorage.path3D=y,A._creationDataStorage.cap=h,A}F.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||F.NO_CAP,sideOrientation:l,instance:h,updatable:o};return ou(a,c,r)};F.ExtrudeShapeCustom=(a,e,t,i,s,n,r,o,l,h,c,u)=>{const f={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:n,ribbonClosePath:r,cap:o===0?0:o||F.NO_CAP,sideOrientation:c,instance:u,updatable:h};return lu(a,f,l)};function cu(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=F._GetDefaultSideOrientation(e.sideOrientation),u=e.cap||F.NO_CAP,f=Math.PI*2,d=[],p=e.invertUV||!1;let g=0,_=0;const m=f/o*i;let x,I;for(g=0;g<=o-l;g++){for(I=[],(u==F.CAP_START||u==F.CAP_ALL)&&(I.push(new v(0,n[0].y,0)),I.push(new v(Math.cos(g*m)*n[0].x*r,n[0].y,Math.sin(g*m)*n[0].x*r))),_=0;_cu(a,{shape:e,radius:t,tessellation:i,sideOrientation:r,updatable:n},s);function uu(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,Le.UseOpenGLOrientationForUV?1:0),t.push(l,-h,0),i.push(0,0,-1),s.push(1,Le.UseOpenGLOrientationForUV?1:0),t.push(l,h,0),i.push(0,0,-1),s.push(1,Le.UseOpenGLOrientationForUV?0:1),t.push(-l,h,0),i.push(0,0,-1),s.push(0,Le.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 fu(a,e={},t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,uu(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=uu;F.CreatePlane=(a,e,t,i,s)=>fu(a,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t);function du(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||F.NO_CAP;const h=e.invertUV||!1,c=e.updatable,u=F._GetDefaultSideOrientation(e.sideOrientation);e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const f=(m,x,I,T,y,b,S,A)=>{const M=x.getTangents(),C=x.getNormals(),w=x.getDistances(),z=Math.PI*2/y*A,G=b||(()=>T);let H,ce,J,W;const V=N.Matrix[0];let R=S===F.NO_CAP||S===F.CAP_END?0:2;for(let Y=0;Y{const oe=Array();for(let re=0;re3?0:l,p=f(i,d,g,n,r,o,l,e.arc);const _=Ls(a,{pathArray:p,closePath:!0,closeArray:!1,updatable:c,sideOrientation:u,invertUV:h,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return _._creationDataStorage.pathArray=p,_._creationDataStorage.path3D=d,_._creationDataStorage.tessellation=r,_._creationDataStorage.cap=l,_._creationDataStorage.arc=e.arc,_._creationDataStorage.radius=n,_}F.CreateTube=(a,e,t,i,s,n,r,o,l,h)=>du(a,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:n,updatable:o,sideOrientation:l,instance:h},r);function pu(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,f=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,d=[],p=[],g=[],_=[],m=[];let x=0,I=0;const T=[];let y=0,b=0,S,A,M,C,w,P;if(u)for(b=0;bPo(a,e,t);function _u(a){const e=a.sideOrientation||j.DEFAULTSIDE,t=a.radius||1,i=a.flat===void 0?!0:a.flat,s=(a.subdivisions||4)|0,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],f=[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],d=138/1024,p=239/1024,g=60/1024,_=26/1024,m=-40/1024,x=20/1024,I=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],T=[],y=[],b=[],S=[];let A=0;const M=new Array(3),C=new Array(3);let w;for(w=0;w<3;w++)M[w]=v.Zero(),C[w]=fe.Zero();for(let z=0;z<20;z++){for(w=0;w<3;w++){const G=c[3*z+w];M[w].copyFromFloats(h[3*u[G]],h[3*u[G]+1],h[3*u[G]+2]),M[w].normalize(),C[w].copyFromFloats(f[2*G]*d+g+I[z]*m,f[2*G+1]*p+_+I[z]*x)}const L=(G,H,ce,J)=>{const W=v.Lerp(M[0],M[2],H/s),V=v.Lerp(M[1],M[2],H/s),R=s===H?M[2]:v.Lerp(W,V,G/(s-H));R.normalize();let k;if(i){const re=v.Lerp(M[0],M[2],J/s),ue=v.Lerp(M[1],M[2],J/s);k=v.Lerp(re,ue,ce/(s-J))}else k=new v(R.x,R.y,R.z);k.x/=n,k.y/=r,k.z/=o,k.normalize();const Y=fe.Lerp(C[0],C[2],H/s),he=fe.Lerp(C[1],C[2],H/s),oe=s===H?C[2]:fe.Lerp(Y,he,G/(s-H));y.push(R.x*n,R.y*r,R.z*o),b.push(k.x,k.y,k.z),S.push(oe.x,Le.UseOpenGLOrientationForUV?1-oe.y:oe.y),T.push(A),A++};for(let G=0;Ggu(a,e,t);const Z3=new v(1,0,0),Q3=new v(-1,0,0),J3=new v(0,1,0),eb=new v(0,-1,0),tb=new v(0,0,1),ib=new v(0,0,-1);class Sr{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 Sr(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,(e=this.localPositionOverride)==null?void 0:e.slice(),(t=this.localNormalOverride)==null?void 0:t.slice(),(i=this.matrixIndicesOverride)==null?void 0:i.slice(),(s=this.matrixWeightsOverride)==null?void 0:s.slice())}}function mu(a,e,t){var H,ce,J,W;const i=!!e.skeleton,s=t.localMode||i,n=e.getIndices(),r=i?e.getPositionData(!0,!0):e.getVerticesData(E.PositionKind),o=i?e.getNormalsData(!0,!0):e.getVerticesData(E.NormalKind),l=s?i?e.getVerticesData(E.PositionKind):r:null,h=s?i?e.getVerticesData(E.NormalKind):o:null,c=e.getVerticesData(E.UVKind),u=i?e.getVerticesData(E.MatricesIndicesKind):null,f=i?e.getVerticesData(E.MatricesWeightsKind):null,d=i?e.getVerticesData(E.MatricesIndicesExtraKind):null,p=i?e.getVerticesData(E.MatricesWeightsExtraKind):null,g=t.position||v.Zero();let _=t.normal||v.Up();const m=t.size||v.One(),x=t.angle||0;if(!_){const V=new v(0,0,1),R=e.getScene().activeCamera,k=v.TransformCoordinates(V,R.getWorldMatrix());_=R.globalPosition.subtract(k)}const I=-Math.atan2(_.z,_.x)-Math.PI/2,T=Math.sqrt(_.x*_.x+_.z*_.z),y=Math.atan2(_.y,T),b=new j;b.indices=[],b.positions=[],b.normals=[],b.uvs=[],b.matricesIndices=i?[]:null,b.matricesWeights=i?[]:null,b.matricesIndicesExtra=d?[]:null,b.matricesWeightsExtra=p?[]:null;let S=0;const A=(V,R)=>{const k=new Sr;if(!n||!r||!o)return k;const Y=n[V];if(k.vertexIdx=Y*3,k.vertexIdxForBones=Y*4,k.position=new v(r[Y*3],r[Y*3+1],r[Y*3+2]),v.TransformCoordinatesToRef(k.position,R,k.position),k.normal=new v(o[Y*3],o[Y*3+1],o[Y*3+2]),v.TransformNormalToRef(k.normal,R,k.normal),t.captureUVS&&c){const he=c[Y*2+1];k.uv=new fe(c[Y*2],Le.UseOpenGLOrientationForUV?1-he:he)}return k},M=[0,0,0,0],C=(V,R)=>{if(V.length===0)return V;const k=.5*Math.abs(v.Dot(m,R)),Y=(re,ue,xe,ae)=>{for(let Me=0;Me{var zt,qt,qi,Xn,Do,Fo,Oo,Lo,Bo,No,Uo,ko,Vo,Go,zo,Wo;const xe=v.GetClipFactor(re.position,ue.position,R,k);let ae=M,Me=M;if(u&&f){const cn=re.matrixIndicesOverride?0:re.vertexIdxForBones,Yr=(zt=re.matrixIndicesOverride)!=null?zt:u,Xo=(qt=re.matrixWeightsOverride)!=null?qt:f,qr=ue.matrixIndicesOverride?0:ue.vertexIdxForBones,Ho=(qi=ue.matrixIndicesOverride)!=null?qi:u,Ko=(Xn=ue.matrixWeightsOverride)!=null?Xn:f;ae=[0,0,0,0],Me=[0,0,0,0];let Ts=0;for(let Si=0;Si<4;++Si)if(Xo[cn+Si]>0){const un=Y(Ho,Yr[cn+Si],qr,4);ae[Ts]=Yr[cn+Si],Me[Ts]=Ye.Lerp(Xo[cn+Si],un>=0?Ko[un]:0,xe),Ts++}for(let Si=0;Si<4&&Ts<4;++Si){const un=Ho[qr+Si];Y(Yr,un,cn,4)===-1&&(ae[Ts]=un,Me[Ts]=Ye.Lerp(0,Ko[qr+Si],xe),Ts++)}const Hn=Me[0]+Me[1]+Me[2]+Me[3];Me[0]/=Hn,Me[1]/=Hn,Me[2]/=Hn,Me[3]/=Hn}const ke=re.localPositionOverride?re.localPositionOverride[0]:(Do=l==null?void 0:l[re.vertexIdx])!=null?Do:0,Z=re.localPositionOverride?re.localPositionOverride[1]:(Fo=l==null?void 0:l[re.vertexIdx+1])!=null?Fo:0,Ee=re.localPositionOverride?re.localPositionOverride[2]:(Oo=l==null?void 0:l[re.vertexIdx+2])!=null?Oo:0,Oe=ue.localPositionOverride?ue.localPositionOverride[0]:(Lo=l==null?void 0:l[ue.vertexIdx])!=null?Lo:0,He=ue.localPositionOverride?ue.localPositionOverride[1]:(Bo=l==null?void 0:l[ue.vertexIdx+1])!=null?Bo:0,je=ue.localPositionOverride?ue.localPositionOverride[2]:(No=l==null?void 0:l[ue.vertexIdx+2])!=null?No:0,Ct=re.localNormalOverride?re.localNormalOverride[0]:(Uo=h==null?void 0:h[re.vertexIdx])!=null?Uo:0,wt=re.localNormalOverride?re.localNormalOverride[1]:(ko=h==null?void 0:h[re.vertexIdx+1])!=null?ko:0,ri=re.localNormalOverride?re.localNormalOverride[2]:(Vo=h==null?void 0:h[re.vertexIdx+2])!=null?Vo:0,ei=ue.localNormalOverride?ue.localNormalOverride[0]:(Go=h==null?void 0:h[ue.vertexIdx])!=null?Go:0,Ht=ue.localNormalOverride?ue.localNormalOverride[1]:(zo=h==null?void 0:h[ue.vertexIdx+1])!=null?zo:0,Bi=ue.localNormalOverride?ue.localNormalOverride[2]:(Wo=h==null?void 0:h[ue.vertexIdx+2])!=null?Wo:0,ys=Ct+(ei-Ct)*xe,Ti=wt+(Ht-wt)*xe,Kt=ri+(Bi-ri)*xe,ai=Math.sqrt(ys*ys+Ti*Ti+Kt*Kt);return new Sr(v.Lerp(re.position,ue.position,xe),v.Lerp(re.normal,ue.normal,xe).normalize(),fe.Lerp(re.uv,ue.uv,xe),-1,-1,l?[ke+(Oe-ke)*xe,Z+(He-Z)*xe,Ee+(je-Ee)*xe]:null,h?[ys/ai,Ti/ai,Kt/ai]:null,ae,Me)};let oe=null;V.length>3&&(oe=[]);for(let re=0;re0,je=Ee>0,Ct=Oe>0;switch(ue=(He?1:0)+(je?1:0)+(Ct?1:0),ue){case 0:V.length>3?(oe.push(V[re]),oe.push(V[re+1]),oe.push(V[re+2])):oe=V;break;case 1:if(oe=oe!=null?oe:new Array,He&&(xe=V[re+1],ae=V[re+2],Me=he(V[re],xe),ke=he(V[re],ae)),je){xe=V[re],ae=V[re+2],Me=he(V[re+1],xe),ke=he(V[re+1],ae),oe.push(Me),oe.push(ae.clone()),oe.push(xe.clone()),oe.push(ae.clone()),oe.push(Me.clone()),oe.push(ke);break}Ct&&(xe=V[re],ae=V[re+1],Me=he(V[re+2],xe),ke=he(V[re+2],ae)),xe&&ae&&Me&&ke&&(oe.push(xe.clone()),oe.push(ae.clone()),oe.push(Me),oe.push(ke),oe.push(Me.clone()),oe.push(ae.clone()));break;case 2:oe=oe!=null?oe:new Array,He||(xe=V[re].clone(),ae=he(xe,V[re+1]),Me=he(xe,V[re+2]),oe.push(xe),oe.push(ae),oe.push(Me)),je||(xe=V[re+1].clone(),ae=he(xe,V[re+2]),Me=he(xe,V[re]),oe.push(xe),oe.push(ae),oe.push(Me)),Ct||(xe=V[re+2].clone(),ae=he(xe,V[re]),Me=he(xe,V[re+1]),oe.push(xe),oe.push(ae),oe.push(Me));break}}return oe},w=e instanceof F?e:null,P=w==null?void 0:w._thinInstanceDataStorage.matrixData,z=(w==null?void 0:w.thinInstanceCount)||1,L=N.Matrix[0];L.copyFrom(O.IdentityReadOnly);for(let V=0;Vmu(a,e,{position:t,normal:i,size:s,angle:n});function vu(a={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(a.subdivisions?a.subdivisions:2,1)|0,t=Math.max(a.tessellation?a.tessellation:16,3)|0,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)|0,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,f=2*Math.PI,d=Math.max(a.topCapSubdivisions?a.topCapSubdivisions:n,1),p=Math.max(a.bottomCapSubdivisions?a.bottomCapSubdivisions:n,1),g=Math.acos((h-l)/i);let _=[];const m=[],x=[],I=[];let T=0;const y=[],b=c*.5,S=Math.PI*.5;let A,M;const C=v.Zero(),w=v.Zero(),P=Math.cos(g),z=Math.sin(g),L=new fe(l*z,b+l*P).subtract(new fe(h*z,-b+h*P)).length(),G=l*g+L+h*(S-g);let H=0;for(M=0;M<=d;M++){const V=[],R=S-g*(M/d);H+=l*g/d;const k=Math.cos(R),Y=Math.sin(R),he=k*l;for(A=0;A<=r;A++){const oe=A/r,re=oe*f+u,ue=Math.sin(re),xe=Math.cos(re);w.x=he*ue,w.y=b+Y*l,w.z=he*xe,m.push(w.x,w.y,w.z),C.set(k*ue,Y,k*xe),x.push(C.x,C.y,C.z),I.push(oe,Le.UseOpenGLOrientationForUV?H/G:1-H/G),V.push(T),T++}y.push(V)}const ce=i-l-h+P*l-P*h,J=z*(h-l)/ce;for(M=1;M<=o;M++){const V=[];H+=L/o;const R=z*(M*(h-l)/o+l);for(A=0;A<=r;A++){const k=A/r,Y=k*f+u,he=Math.sin(Y),oe=Math.cos(Y);w.x=R*he,w.y=b+P*l-M*ce/o,w.z=R*oe,m.push(w.x,w.y,w.z),C.set(he,J,oe).normalize(),x.push(C.x,C.y,C.z),I.push(k,Le.UseOpenGLOrientationForUV?H/G:1-H/G),V.push(T),T++}y.push(V)}for(M=1;M<=p;M++){const V=[],R=S-g-(Math.PI-g)*(M/p);H+=h*g/p;const k=Math.cos(R),Y=Math.sin(R),he=k*h;for(A=0;A<=r;A++){const oe=A/r,re=oe*f+u,ue=Math.sin(re),xe=Math.cos(re);w.x=he*ue,w.y=-b+Y*h,w.z=he*xe,m.push(w.x,w.y,w.z),C.set(k*ue,Y,k*xe),x.push(C.x,C.y,C.z),I.push(oe,Le.UseOpenGLOrientationForUV?H/G:1-H/G),V.push(T),T++}y.push(V)}for(A=0;Axu(a,e,t);j.CreateCapsule=vu;class at{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&U.Warn("x is not an integer, floor(x) used"),t!==Math.floor(t)&&U.Warn("y is not an integer, floor(y) used")}clone(){return new at(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)&&U.Warn("m not an integer only floor(m) used"),t!==Math.floor(t)&&U.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)&&U.Warn("m is not an integer, floor(m) used"),t!==Math.floor(t)&&U.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 at(0,0)}}class bu{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new Da("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=Ye.HCF(i,s)),r=i/n,o=s/n;let l,h,c,u,f;const d=at.Zero(),p=new at(i,s),g=new at(-s,i+s),_=at.Zero(),m=at.Zero(),x=at.Zero();let I=[],T,y,b,S;const A=[],M=this.vertByDist,C=(w,P,z,L)=>{T=w+"|"+z,y=P+"|"+L,T in t||y in t?T in t&&!(y in t)?t[y]=t[T]:y in t&&!(T in t)&&(t[T]=t[y]):(t[T]=e,t[y]=e,e++),M[z][0]>2?A[t[T]]=[-M[z][0],M[z][1],t[T]]:A[t[T]]=[I[M[z][0]],M[z][1],t[T]]};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(I=this.IDATA.face[w],c=I[2],u=I[1],f=I[0],b=d.x+"|"+d.y,T=w+"|"+b,T in t||(t[T]=c,A[c]=[I[M[b][0]],M[b][1]]),b=p.x+"|"+p.y,T=w+"|"+b,T in t||(t[T]=u,A[u]=[I[M[b][0]],M[b][1]]),b=g.x+"|"+g.y,T=w+"|"+b,T in t||(t[T]=f,A[f]=[I[M[b][0]],M[b][1]]),l=this.IDATA.edgematch[w][0],h=this.IDATA.edgematch[w][1],h==="B")for(let P=1;P2?A[t[T]]=[-M[b][0],M[b][1],t[T]]:A[t[T]]=[I[M[b][0]],M[b][1],t[T]])}this.closestTo=A,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 y=Ye.HCF(e,t),b=e/y,S=t/y;for(let M=1;My.x-b.x),i.sort((y,b)=>y.y-b.y);const o=new Array(e+t+1),l=new Array(e+t+1);for(let y=0;y{const S=y.clone();return b==="A"&&S.rotateNeg120(e,t),b==="B"&&S.rotate120(e,t),S.x<0?S.y:S.x+S.y},d=[],p=[],g=[],_=[],m={},x=[];let I=-1,T=-1;for(let y=0;yy[2]-b[2]),x.sort((y,b)=>y[3]-b[3]),x.sort((y,b)=>y[1]-b[1]),x.sort((y,b)=>y[0]-b[0]);for(let y=0;yt.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 Da("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 Xr("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,U.Warn("n > m therefore m and n swapped")}const n=new bu;n.build(i,s);const o={custom:Xr.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 Po(a,o,t)}F._GoldbergMeshParser=(a,e)=>Hr.Parse(a,e);class Hr extends F{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&&(U.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(U.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(U.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,f);for(let d=0;d<6;d++)u=r.x+o*Math.cos(l+d*Math.PI/3),f=r.y+o*Math.sin(l+d*Math.PI/3),u<0&&(u=0),u>1&&(u=1),c.push(u,f);for(let d=s;dX.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 Hr(e.name,t);return s.goldbergData=i,s}}function nb(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=[],l=[],h=[],c=[];let u=1/0,f=-1/0,d=1/0,p=-1/0;for(let m=0;mo){const p=l;l=o,o=p,U.Warn("n > m therefore m and n swapped")}const h=new bu;h.build(o,l);const c=Xr.BuildGeodesicData(h),u=c.toGoldbergPolyhedronData(),f=new Hr(a,t);e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),f._originalBuilderSideOrientation=e.sideOrientation,nb(e,u).applyToMesh(f,e.updatable),f.goldbergData.nbSharedFaces=c.sharedNodes,f.goldbergData.nbUnsharedFaces=c.poleNodes,f.goldbergData.adjacentFaces=c.adjacentFaces,f.goldbergData.nbFaces=f.goldbergData.nbSharedFaces+f.goldbergData.nbUnsharedFaces,f.goldbergData.nbFacesAtPole=(f.goldbergData.nbUnsharedFaces-12)/12;for(let p=0;p0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}function ob(a,e,t,i,s,n){const r=n.glyphs[a]||n.glyphs["?"];if(!r)return null;const o=new ab(s);if(r.o){const l=r.o.split(" ");for(let h=0,c=l.length;h=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};F.prototype.thinInstanceSetAttributeAt=function(a,e,t,i=!0){return a===E.ColorKind&&(a=E.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(F.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(a){var i,s;const e=(s=this._thinInstanceDataStorage.matrixData)!=null?s:(i=this.source)==null?void 0:i._thinInstanceDataStorage.matrixData,t=e?e.length/16:0;a<=t&&(this._thinInstanceDataStorage.instancesCount=a)},enumerable:!0,configurable:!0});F.prototype._thinInstanceCreateMatrixBuffer=function(a,e,t=!0){const i=new Js(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};F.prototype.thinInstanceSetBuffer=function(a,e,t=0,i=!0){var s,n,r;t=t||16,a==="matrix"?((s=this._thinInstanceDataStorage.matrixBuffer)==null||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.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,e!==null&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,i))):(a===E.ColorKind&&(a=E.ColorInstanceKind),e===null?(r=this._userThinInstanceBuffersStorage)!=null&&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 E(this.getEngine(),e,a,!i,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[a])))};F.prototype.thinInstanceBufferUpdated=function(a){var e,t,i;a==="matrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(a),(e=this._thinInstanceDataStorage.matrixBuffer)==null||e.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):a==="previousMatrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(a),(t=this._thinInstanceDataStorage.previousMatrixBuffer)==null||t.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):(a===E.ColorKind&&(a=E.ColorInstanceKind),(i=this._userThinInstanceBuffersStorage)!=null&&i.vertexBuffers[a]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[a].isUpdatable()&&this._thinInstanceRecreateBuffer(a),this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(this._userThinInstanceBuffersStorage.data[a],0)))};F.prototype.thinInstancePartialBufferUpdate=function(a,e,t){var i;a==="matrix"?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,t):(a===E.ColorKind&&(a=E.ColorInstanceKind),(i=this._userThinInstanceBuffersStorage)!=null&&i.vertexBuffers[a]&&this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(e,t))};F.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const a=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let e=0;e{this._outputTexture?d.setFloat2("delta",1/this._outputTexture.width*this.direction.x,1/this._outputTexture.height*this.direction.y):d.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 _=0;_0)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 Ae.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)}}D([B("kernel")],bs.prototype,"_kernel",void 0);D([B("packedFloat")],bs.prototype,"_packedFloat",void 0);D([Oh()],bs.prototype,"direction",void 0);ft("BABYLON.BlurPostProcess",bs);const Eb="glowMapGenerationPixelShader",Ib="#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)\n#include\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;uniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;uniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;uniform float glowIntensity;\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 x;const s=this._scene.getEngine(),n=e.getMesh(),r=(x=n._internalAbstractMeshDataInfo._materialForRenderPass)==null?void 0:x[s.currentRenderPassId];if(r)return r.isReadyForSubMesh(n,e,t);const o=e.getMaterial();if(!o)return!1;if(this._useMeshMaterial(e.getRenderingMesh()))return o.isReadyForSubMesh(e.getMesh(),e,t);const l=[],h=[E.PositionKind];let c=!1,u=!1;if(o){const I=o.needAlphaTesting(),T=o.getAlphaTestTexture(),y=T&&T.hasAlpha&&(o.useAlphaFromDiffuseTexture||o._useAlphaFromAlbedoTexture);T&&(I||y)&&(l.push("#define DIFFUSE"),n.isVerticesDataPresent(E.UV2Kind)&&T.coordinatesIndex===1?(l.push("#define DIFFUSEUV2"),u=!0):n.isVerticesDataPresent(E.UVKind)&&(l.push("#define DIFFUSEUV1"),c=!0),I&&(l.push("#define ALPHATEST"),l.push("#define ALPHATESTVALUE 0.4")),T.gammaSpace||l.push("#define DIFFUSE_ISLINEAR"));const b=o.opacityTexture;b&&(l.push("#define OPACITY"),n.isVerticesDataPresent(E.UV2Kind)&&b.coordinatesIndex===1?(l.push("#define OPACITYUV2"),u=!0):n.isVerticesDataPresent(E.UVKind)&&(l.push("#define OPACITYUV1"),c=!0))}i&&(l.push("#define EMISSIVE"),n.isVerticesDataPresent(E.UV2Kind)&&i.coordinatesIndex===1?(l.push("#define EMISSIVEUV2"),u=!0):n.isVerticesDataPresent(E.UVKind)&&(l.push("#define EMISSIVEUV1"),c=!0),i.gammaSpace||l.push("#define EMISSIVE_ISLINEAR")),n.useVertexColors&&n.isVerticesDataPresent(E.ColorKind)&&n.hasVertexAlpha&&o.transparencyMode!==q.MATERIAL_OPAQUE&&(h.push(E.ColorKind),l.push("#define VERTEXALPHA")),c&&(h.push(E.UVKind),l.push("#define UV1")),u&&(h.push(E.UV2Kind),l.push("#define UV2"));const f=new bo;if(n.useBones&&n.computeBonesUsingShaders){h.push(E.MatricesIndicesKind),h.push(E.MatricesWeightsKind),n.numBoneInfluencers>4&&(h.push(E.MatricesIndicesExtraKind),h.push(E.MatricesWeightsExtraKind)),l.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers);const I=n.skeleton;I&&I.isUsingTextureForMatrices?l.push("#define BONETEXTURE"):l.push("#define BonesPerMesh "+(I?I.bones.length+1:0)),n.numBoneInfluencers>0&&f.addCPUSkinningFallback(0,n)}else l.push("#define NUM_BONE_INFLUENCERS 0");const d=n.morphTargetManager;let p=0;d&&(p=d.numMaxInfluencers||d.numInfluencers,p>0&&(l.push("#define MORPHTARGETS"),l.push("#define NUM_MORPH_INFLUENCERS "+p),d.isUsingTextureForTargets&&l.push("#define MORPHTARGETS_TEXTURE"),eg(h,n,p))),t&&(l.push("#define INSTANCES"),go(h),e.getRenderingMesh().hasThinInstances&&l.push("#define THIN_INSTANCES")),qh(o,this._scene,l),this._addCustomEffectDefines(l);const g=e._getDrawWrapper(void 0,!0),_=g.defines,m=l.join("\n");if(_!==m){const I=["world","mBones","viewProjection","glowColor","morphTargetInfluences","morphTargetCount","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity","morphTargetTextureInfo","morphTargetTextureIndices","glowIntensity"];uo(I),g.setEffect(this._engine.createEffect("glowMapGeneration",h,I,["diffuseSampler","emissiveSampler","opacitySampler","boneSampler","morphTargets"],m,f,void 0,void 0,{maxSimultaneousMorphTargets:p}),m)}return g.effect.isReady()}render(){for(let r=0;rx.setMatrix("world",T))}else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(s)}_useMeshMaterial(e){return!1}_rebuild(){const e=this._vertexBuffers[E.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 ee.Instantiate(e.customType).Parse(e,t,i)}}yi._SceneComponentInitialization=a=>{throw Te("EffectLayerSceneComponent")};D([B()],yi.prototype,"name",void 0);D([to()],yi.prototype,"neutralColor",void 0);D([B()],yi.prototype,"isEnabled",void 0);D([Yp()],yi.prototype,"camera",null);D([B()],yi.prototype,"renderingGroupId",null);D([B()],yi.prototype,"disableBoundingBoxesFromEffectLayer",void 0);const Mb="glowMapMergePixelShader",Rb="varying vec2 vUV;uniform 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);baseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);baseColor.a=alpha;baseColor.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}";K.ShadersStore[Mb]=Rb;const Pb="glowMapMergeVertexShader",wb="attribute vec2 position;varying vec2 vUV;const 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;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";K.ShadersStore[Pb]=wb;const Db="glowBlurPostProcessPixelShader",Fb="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color)\n{return dot(color,vec3(0.2126,0.7152,0.0722));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++)\n{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;}\ngl_FragColor=baseColor;}";K.ShadersStore[Db]=Fb;Xi.AddParser(be.NAME_EFFECTLAYER,(a,e,t,i)=>{if(a.effectLayers){t.effectLayers||(t.effectLayers=[]);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===ve.RIG_MODE_NONE&&e===s.camera||s.camera.cameraRigMode!==ve.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(be.NAME_EFFECTLAYER);e||(e=new Ob(a),a._addComponent(e))};Xi.prototype.getHighlightLayerByName=function(a){var e;for(let t=0;t<((e=this.effectLayers)==null?void 0:e.length);t++)if(this.effectLayers[t].name===a&&this.effectLayers[t].getEffectName()===Gt.EffectName)return this.effectLayers[t];return null};class Bl extends it{constructor(e,t,i,s,n,r=ne.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 Gt extends yi{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 Q,this.onAfterBlurObservable=new Q,this._instanceGlowingMeshStencilReference=Gt.GlowingMeshStencilReference++,this._meshes={},this._excludedMeshes={},this.neutralColor=Gt.NeutralColor,this._engine.isStencilEnable||U.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 Gt.EffectName}_numInternalDraws(){return 2}_createMergeEffect(){return this._engine.createEffect("glowMapMerge",[E.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?fi(e,this._maxSize):e,t=this._engine.needPOTTextures?fi(t,this._maxSize):t;let i=0;this._engine.getCaps().textureHalfFloatRender?i=2:i=0,this._blurTexture=new wi("HighlightLayerBlurRTT",{width:e,height:t},this._scene,!1,!0,i),this._blurTexture.wrapU=ne.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=ne.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(ne.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._options.alphaBlendingMode===2?(this._downSamplePostprocess=new Bn("HighlightLayerPPP",this._options.blurTextureSizeRatio,null,ne.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._downSamplePostprocess.externalTextureSamplerBinding=!0,this._downSamplePostprocess.onApplyObservable.add(s=>{s.setTexture("textureSampler",this._mainTexture)}),this._horizontalBlurPostprocess=new Bl("HighlightLayerHBP",new fe(1,0),this._options.blurHorizontalSize,1,null,ne.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._horizontalBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",e,t)}),this._verticalBlurPostprocess=new Bl("HighlightLayerVBP",new fe(0,1),this._options.blurVerticalSize,1,null,ne.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,ne.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,ne.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(q.TriangleFillMode,0,6)),this.innerGlow&&t===1&&(e.setFloat("offset",1),i.setStencilFunction(514),i.drawElementsType(q.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(Gt.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=Ae.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=Ae.Parse(()=>new Gt(e.name,t,e.options),e,t,i);let n;for(n=0;nnew Xt(e,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.GridMaterial",e}getClassName(){return"GridMaterial"}static Parse(e,t,i){return Ae.Parse(()=>new Xt(e.name,t),e,t,i)}}D([ls()],Xt.prototype,"mainColor",void 0);D([ls()],Xt.prototype,"lineColor",void 0);D([B()],Xt.prototype,"gridRatio",void 0);D([bi()],Xt.prototype,"gridOffset",void 0);D([B()],Xt.prototype,"majorUnitFrequency",void 0);D([B()],Xt.prototype,"minorUnitVisibility",void 0);D([B()],Xt.prototype,"opacity",void 0);D([B()],Xt.prototype,"antialias",void 0);D([B()],Xt.prototype,"preMultiplyAlpha",void 0);D([B()],Xt.prototype,"useMaxLine",void 0);D([pi("opacityTexture")],Xt.prototype,"_opacityTexture",void 0);D([qe("_markAllSubMeshesAsTexturesDirty")],Xt.prototype,"opacityTexture",void 0);ft("BABYLON.GridMaterial",Xt);Fe.prototype.createDynamicTexture=function(a,e,t,i){const s=new Et(this,4);return s.baseWidth=a,s.baseHeight=e,t&&(a=this.needPOTTextures?fi(a,this._caps.maxTextureSize):a,e=this.needPOTTextures?fi(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};Fe.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),f=this._getRGBABufferInternalSizedFormat(a.type,u);o.texImage2D(l,0,f,u,c,e),a.generateMipMaps&&o.generateMipmap(l),h||this._bindTextureDirectly(l,null),i&&o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),s&&(a.format=s),a._dynamicTextureSource=e,a._premulAlpha=i,a.invertY=t||!1,a.isReady=!0};class Fn extends ne{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=ne.CLAMP_ADDRESSMODE,this.wrapV=ne.CLAMP_ADDRESSMODE,this._generateMipMaps=s;const l=this._getEngine();if(!l)return;t.getContext?(this._canvas=t,this._ownCanvas=!1,this._texture=l.createDynamicTexture(t.width,t.height,s,n)):(this._canvas=l.createCanvas(1,1),this._ownCanvas=!0,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(e){const t=this.getSize();e&&(this._context.fillStyle=e),this._context.clearRect(0,0,t.width,t.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)}dispose(){var e,t;super.dispose(),this._ownCanvas&&((t=(e=this._canvas)==null?void 0:e.remove)==null||t.call(e)),this._canvas=null,this._context=null}clone(){const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new Fn(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()&&U.Warn("The scene must be ready before serializing the dynamic texture");const t=super.serialize();return Fn._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()}}mt.AddNodeConstructor("Light_Type_3",(a,e)=>()=>new an(a,v.Zero(),e));class an extends De{constructor(e,t,i){super(e,i),this.groundColor=new pe(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=O.Identity()),this._worldMatrix}getTypeID(){return De.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(e,t){e["HEMILIGHT"+t]=!0}}D([ls()],an.prototype,"groundColor",void 0);D([bi()],an.prototype,"direction",void 0);ft("BABYLON.HemisphericLight",an);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(C,w,P){return Object.defineProperty(C,w,{value:P,enumerable:!0,configurable:!0,writable:!0}),C[w]}try{o({},"")}catch{o=(w,P,z)=>w[P]=z}function l(C,w,P,z){var L=w&&w.prototype instanceof u?w:u,G=Object.create(L.prototype),H=new S(z||[]);return G._invoke=((ce,J,W)=>{var V="suspendedStart";return(R,k)=>{if(V==="executing")throw new Error("Generator is already running");if(V==="completed"){if(R==="throw")throw k;return M()}for(W.method=R,W.arg=k;;){var Y=W.delegate;if(Y){var he=T(Y,W);if(he){if(he===c)continue;return he}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(V==="suspendedStart")throw V="completed",W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);V="executing";var oe=h(ce,J,W);if(oe.type==="normal"){if(V=W.done?"completed":"suspendedYield",oe.arg===c)continue;return{value:oe.arg,done:W.done}}oe.type==="throw"&&(V="completed",W.method="throw",W.arg=oe.arg)}}})(C,P,H),G}function h(C,w,P){try{return{type:"normal",arg:C.call(w,P)}}catch(z){return{type:"throw",arg:z}}}a.wrap=l;var c={};function u(){}function f(){}function d(){}var p={};o(p,s,function(){return this});var g=Object.getPrototypeOf,_=g&&g(g(A([])));_&&_!==e&&t.call(_,s)&&(p=_);var m=d.prototype=u.prototype=Object.create(p);function x(C){["next","throw","return"].forEach(function(w){o(C,w,function(P){return this._invoke(w,P)})})}function I(C,w){function P(L,G,H,ce){var J=h(C[L],C,G);if(J.type!=="throw"){var W=J.arg,V=W.value;return V&&typeof V=="object"&&t.call(V,"__await")?w.resolve(V.__await).then(R=>{P("next",R,H,ce)},R=>{P("throw",R,H,ce)}):w.resolve(V).then(R=>{W.value=R,H(W)},R=>P("throw",R,H,ce))}ce(J.arg)}var z;this._invoke=(L,G)=>{function H(){return new w((ce,J)=>{P(L,G,ce,J)})}return z=z?z.then(H,H):H()}}function T(C,w){var P=C.iterator[w.method];if(P===void 0){if(w.delegate=null,w.method==="throw"){if(C.iterator.return&&(w.method="return",w.arg=void 0,T(C,w),w.method==="throw"))return c;w.method="throw",w.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var z=h(P,C.iterator,w.arg);if(z.type==="throw")return w.method="throw",w.arg=z.arg,w.delegate=null,c;var L=z.arg;return L?L.done?(w[C.resultName]=L.value,w.next=C.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 y(C){var w={tryLoc:C[0]};1 in C&&(w.catchLoc=C[1]),2 in C&&(w.finallyLoc=C[2],w.afterLoc=C[3]),this.tryEntries.push(w)}function b(C){var w=C.completion||{};w.type="normal",delete w.arg,C.completion=w}function S(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(y,this),this.reset(!0)}function A(C){if(C){var w=C[s];if(w)return w.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var P=-1,z=function L(){for(;++P{var w=typeof C=="function"&&C.constructor;return!!w&&(w===f||(w.displayName||w.name)==="GeneratorFunction")},a.mark=C=>(Object.setPrototypeOf?Object.setPrototypeOf(C,d):(C.__proto__=d,o(C,r,"GeneratorFunction")),C.prototype=Object.create(m),C),a.awrap=C=>({__await:C}),x(I.prototype),o(I.prototype,n,function(){return this}),a.AsyncIterator=I,a.async=(C,w,P,z,L)=>{L===void 0&&(L=Promise);var G=new I(l(C,w,P,z),L);return a.isGeneratorFunction(w)?G:G.next().then(H=>H.done?H.value:G.next())},x(m),o(m,r,"Generator"),o(m,s,function(){return this}),o(m,"toString",()=>"[object Generator]"),a.keys=C=>{var w=[];for(var P in C)w.push(P);return w.reverse(),function z(){for(;w.length;){var L=w.pop();if(L in C)return z.value=L,z.done=!1,z}return z.done=!0,z}},a.values=A,S.prototype={constructor:S,reset:function(C){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(b),!C)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 C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var w=this;function P(J,W){return G.type="throw",G.arg=C,w.next=J,W&&(w.method="next",w.arg=void 0),!!W}for(var z=this.tryEntries.length-1;z>=0;--z){var L=this.tryEntries[z],G=L.completion;if(L.tryLoc==="root")return P("end");if(L.tryLoc<=this.prev){var H=t.call(L,"catchLoc"),ce=t.call(L,"finallyLoc");if(H&&ce){if(this.prev=0;--P){var z=this.tryEntries[P];if(z.tryLoc<=this.prev&&t.call(z,"finallyLoc")&&this.prev=0;--w){var P=this.tryEntries[w];if(P.finallyLoc===C)return this.complete(P.completion,P.afterLoc),b(P),c}},catch:function(C){for(var w=this.tryEntries.length-1;w>=0;--w){var P=this.tryEntries[w];if(P.tryLoc===C){var z=P.completion;if(z.type==="throw"){var L=z.arg;b(P)}return L}}throw new Error("illegal catch attempt")},delegateYield:function(C,w,P){return this.delegate={iterator:A(C),resultName:w,nextLoc:P},this.method==="next"&&(this.arg=void 0),c}},a}function Fa(a){return Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=>typeof e:e=>e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e,Fa(a)}function Nl(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){Nl(n,i,s,r,o,"next",l)}function o(l){Nl(n,i,s,r,o,"throw",l)}r(void 0)})}}function It(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Ul(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=Er(a);if(e){var s=Er(this).constructor;t=Reflect.construct(i,arguments,s)}else t=i.apply(this,arguments);return zb(this,t)}}function kl(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)||wo(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 Vl(a){return function(e){if(Array.isArray(e))return La(e)}(a)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(a)||wo(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 wo(a,e){if(a){if(typeof a=="string")return La(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)?La(a,e):void 0}}function La(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,i=new Array(e);tsetTimeout(a)).then(()=>Date.now())}var Wb=Math.PI/2,Xb=new v(2,2,2),Gl=function(){function a(){It(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 At(a,[{key:"length",value:function(){return v.Distance(this.start,this.end)}},{key:"renderLine",value:function(e){var t=[this.start,this.end],i=Qt.CreateLines("lines",t,e);i.enableEdgesRendering(),i.edgesWidth=10,i.edgesColor=new X(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(Xb),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=O.Compose(new v(s,this.layerHeight,e),le.FromEulerVector(new v(0,-l,Wb-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 X(1,1,1,1):new X(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),f=e/2*Math.sin(l),d=0;for(o!==0&&(d=(this.end.y-this.start.y)/o);ce)for(var p=h.x-i;p<=h.x+i;p+=e)for(var g=h.z-i;gt&&s){for(var _=[],m=0;m5e4||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==Ji.Color&&!this.hasMixing}},{key:"forceDraw",value:function(){this.timeStamp=0}}]),a}(),Hb=function(a){Ki(t,Kr);var e=Yi(t);function t(i,s,n,r,o,l){var h;return It(this,t),(h=e.call(this,i,s,n,r,o)).meshIndex=l!=null?l:0,h.lostInSpace=O.Identity().setTranslation(new v(1e4,1e4,1e4)),h.additiveColor=new X(0,1,0,.8),h}return At(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=Qt.CreateBox("box",{width:1,height:1,depth:1,sideOrientation:F.FRONTSIDE},this.scene);return this.material=new te("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&&p[L+3]<1){p[L+3]+=.02;var G=10*(p[L+3]-.9);p[L]=s.lerp(s.progressColor.r,n[P].color.r,G),p[L+1]=s.lerp(s.progressColor.g,n[P].color.g,G),p[L+2]=s.lerp(s.progressColor.b,n[P].color.b,G),C=!0}p[L+3]>=1&&!g[P]&&(n[P].color.toArray(p,L),p[L+3]=1,g[P]=!0,C=!0)}}else o[P]<=s.currentFilePosition?(n[P].color.toArray(p,L),n[P].matrix.copyToArray(d,16*P),p[L+3]=1,g[P]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(d,16*P):n[P].matrix.copyToArray(d,16*P),p[L+3]=s.getTransparentValue(),g[P]=!1)}C&&x.thinInstanceBufferUpdated("color"),w&&(x.thinInstanceBufferUpdated("matrix"),x.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var T=i[0].gcodeFilePosition,y=i.slice(-1)[0].gcodeFilePosition,b=0,S=!1,A=!1;this.timeStamp=Date.now();var M=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(b,T,y)||s.forceRedraw){S=!0,s.forceRedraw=!1,b=0;for(var C=0;C=T-3e4&&s.currentFilePosition<=y+3e4?(S=!1,A&&x.unfreezeWorldMatrix(),I()):A||(x.freezeWorldMatrix(),A=!0);b=s.currentFilePosition}};this.renderFuncs.push(M),this.scene.registerBeforeRender(M)}}}]),t}(),Kb=function(a){Ki(t,Kr);var e=Yi(t);function t(i,s,n,r,o,l){var h;return It(this,t),(h=e.call(this,i,s,n,r,o)).meshIndex=l!=null?l:0,h.lostInSpace=O.Identity().setTranslation(new v(1e4,1e4,1e4)),h.additiveColor=new X(0,1,0,.8),h}return At(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=Qt.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,ci.WORLD),i.bakeCurrentTransformIntoVertices(),this.material=new te("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&&p[L+3]<1){p[L+3]+=.02;var G=10*(p[L+3]-.9);p[L]=s.lerp(s.progressColor.r,n[P].color.r,G),p[L+1]=s.lerp(s.progressColor.g,n[P].color.g,G),p[L+2]=s.lerp(s.progressColor.b,n[P].color.b,G)}p[L+3]>=1&&!g[P]&&(n[P].color.toArray(p,L),p[L+3]=1,g[P]=!0,C=!0)}}else o[P]<=s.currentFilePosition?(n[P].color.toArray(p,L),n[P].matrix.copyToArray(d,z),p[L+3]=1,g[P]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(d,z):n[P].matrix.copyToArray(d,z),p[L+3]=s.getTransparentValue(),g[P]=!1)}C&&x.thinInstanceBufferUpdated("color"),w&&(x.thinInstanceBufferUpdated("matrix"),x.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var T=i[0].gcodeFilePosition,y=i.slice(-1)[0].gcodeFilePosition,b=0,S=!1,A=!1;this.timeStamp=Date.now();var M=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(b,T,y)||s.forceRedraw){S=!0,s.forceRedraw=!1,b=0;for(var C=0;C=T-3e4&&s.currentFilePosition<=y+3e4?(S=!1,A&&x.unfreezeWorldMatrix(),I()):A||(A=!0,x.freezeWorldMatrix());b=s.currentFilePosition}};this.renderFuncs.push(M),this.scene.registerBeforeRender(M)}}}]),t}(),Yb=At(function a(e,t){It(this,a),this.filePosition=e,this.add=t,this.complete=!1}),Tu=function(a){Ki(i,Kr);var e,t=Yi(i);function i(s,n,r,o,l,h,c){var u;return It(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=O.Identity().setTranslation(new v(1e4,1e4,1e4)),u.clearColor=new X(1,0,0,0),u.additiveColor=new X(0,1,0,.8),u.subtractiveColor=new X(1,0,0,.8),u}return At(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=Qt.CreateBox("box",{width:this.voxelWidth,height:this.voxelHeight,depth:this.voxelWidth},this.scene);return s.hasVertexAlpha=!0,s.updateFacetData=!0,this.material=new te("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,f,d,p,g,_,m,x,I,T,y,b,S,A,M,C,w=this;return yt().wrap(function(P){for(;;)switch(P.prev=P.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,f=new Date,d=0;case 10:if(!(d5e3)){P.next=57;break}return f=new Date,this.loadingProgressCallback(d/n.length,"Generating Voxel Map..."),P.next=57,Ir();case 57:x++,P.next=22;break;case 60:d++,P.next=10;break;case 63:this.loadingProgressCallback(d/n.length,"Rendering Voxel..."),M=yt().mark(function z(L){var G,H,ce,J,W,V,R,k,Y,he,oe,re,ue,xe,ae,Me,ke,Z,Ee,Oe,He,je,Ct,wt,ri,ei,Ht,Bi,ys;return yt().wrap(Ti=>{for(;;)switch(Ti.prev=Ti.next){case 0:if(G=[],h[L]!==void 0){Ti.next=3;break}return Ti.abrupt("return","continue");case 3:for(H=999999999999,ce=-999999999999,J=[],W=0,V=Object.entries(h[L]);Wce&&(ce=ae.voxelEvents[0].filePosition),(re=J).push.apply(re,Vl(ae.voxelEvents.map(Kt=>Kt.filePosition))),ae.color.a=1,(Me={matrix:O.Identity(),color:ae.color.clone(),voxelEvents:ae.voxelEvents,lastDrawnCount:0}).matrix.setTranslation(new v(k*w.voxelWidth,L*w.voxelHeight,xe*w.voxelWidth)),G.push(Me);for(ke=0,J=J.sort((Kt,ai)=>Kt-ai),J=Vl(new Set(J)),G.length,h[L]=null,(Z=w.buildBox()).alphaIndex=L,Z.renderingGroupId=1,Ee=new Float32Array(16*G.length),Oe=new Float32Array(4*G.length),He=0;He{for(var Kt=!1,ai=!1,zt=0;ztXn.filePositionwt&&qi.filePosition<=w.currentFilePosition&&(qt.lastDrawnCount=0,w.hasSubtractive&&qt.matrix.copyToArray(Ee,16*zt)),ei&&(qt.lastDrawnCount=i.drawDelay),qt.lastDrawnCount=wt&&qi.filePosition<=w.currentFilePosition&&(qt.lastDrawnCount=0),ei&&(qt.lastDrawnCount=i.drawDelay),qt.lastDrawnCount{if(!(w.isLoading||Date.now()-Bi<200)){if(Bi=Date.now(),w.doScrub(wt,H,ce)||ri||w.forceRedraw){ke=0,ei=!0,w.forceRedraw=!1;for(var Kt=0;Ktzt.complete=!1);Ct(),ri=!1}else if(kew.currentFilePosition));ai++);}else Ht<10&&(Ht++,Ct());wt=w.currentFilePosition}},w.loadingProgressCallback&&w.loadingProgressCallback(L/u,"Rendering Voxels..."),w.renderFuncs.push(ys),w.scene.registerBeforeRender(ys),!(new Date-f>1e3)){Ti.next=36;break}return f=new Date,Ti.next=36,Ir();case 36:case"end":return Ti.stop()}},z,this)}),C=0;case 67:if(!(CW===!1);G<=C;G++){var H=8*G;if(l[G]){if(h[G])continue;s.progressMode||M[H+3]<=.5?(M[H]=s.progressColor.r,M[H+1]=s.progressColor.g,M[H+2]=s.progressColor.b,M[H+3]=.9,M[H+4]=s.progressColor.r,M[H+5]=s.progressColor.g,M[H+6]=s.progressColor.b,M[H+7]=.9):M[H+3]<1?(M[H+3]+=.02,M[H+7]+=.02):M[H+3]>=1&&(M[H]=o[G][0].r,M[H+1]=o[G][0].g,M[H+2]=o[G][0].b,M[H+3]=1,M[H+4]=o[G][1].r,M[H+5]=o[G][1].g,M[H+6]=o[G][1].b,M[H+7]=1,h[G]=!0)}else{if(h[G])continue;M[H+3]===0?(M[H]=1,M[H+1]=0,M[H+2]=0,M[H+3]=.9,M[H+4]=1,M[H+5]=0,M[H+6]=0,M[H+7]=.9):M[H+3]<1?(M[H+3]+=.02,M[H+7]+=.02):(M[H+3]=1e-4,M[H+7]=1e-4,h[G]=!0)}y=G}for(var ce=C;ce=m-3e4&&s.currentFilePosition<=x+3e4&&(T=!1,b());I=s.currentFilePosition}};this.renderFuncs.push(A),this.scene.registerBeforeRender(A)}}]),t}(),Ns=function(){function a(){It(this,a),yu(this,"unknownFeatureColor",new X(.5,.5,.5,1)),this.feature=null,this.perimeter=!0,this.support=!1,this.missingFeatures=[]}return At(a,[{key:"isTypeComment",value:function(e){return!1}},{key:"getFeatureColor",value:function(e){return new X(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}(),qb=function(a){Ki(t,Ns);var e=Yi(t);function t(){var i;return It(this,t),(i=e.call(this)).featureList={Perimeter:{color:new X(1,.9,.3,1),perimeter:!1,support:!1},"External perimeter":{color:new X(1,.5,.2,1),perimeter:!0,support:!1},"Internal infill":{color:new X(.59,.19,.16,1),perimeter:!1,support:!1},"Solid infill":{color:new X(.59,.19,.8,1),perimeter:!1,support:!1},"Top solid infill":{color:new X(.95,.25,.25,1),perimeter:!0,support:!1},"Bridge infill":{color:new X(.3,.5,.73,1),perimeter:!1,support:!1},"Gap fill":{color:new X(1,1,1,1),perimeter:!1,support:!1},Skirt:{color:new X(0,.53,.43,1),perimeter:!1,support:!1},"Skirt/Brim":{color:new X(0,.53,.43,1),perimeter:!1,support:!1},"Supported material":{color:new X(0,1,0,1),perimeter:!1,support:!0},"Supported material interface":{color:new X(0,.5,0,1),perimeter:!1,support:!0},Custom:{color:new X(.5,.5,.5,1),perimeter:!1,support:!1},Unknown:{color:new X(.5,.5,.5,1),perimeter:!1,support:!1},"Support material":{color:new X(.5,.5,.5,1),perimeter:!1,support:!0},"Support material interface":{color:new X(.5,.5,.5,1),perimeter:!1,support:!0},"Overhang perimeter":{color:new X(.5,.5,.5,1),perimeter:!0,support:!1},"Wipe tower":{color:new X(.5,.5,.5,1),perimeter:!0,support:!1}},i}return At(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.unknownFeatureColor}},{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 At(a,[{key:"doUpdate",value:function(){this.lastUpdate=Date.now()}},{key:"setProgressColor",value:function(r){var o=this;this.progressColor=X.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=Es.Voxel,this.meshBreakPoint=Wl,void(this.lines=new Array(Wl));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=Es.Block,void(this.everyNthRow=1)}for(var u=h;u<4;u++){var f=void 0;switch(u){case 1:f=24;break;case 2:f=2;break;case 3:f=1}for(var d=this.everyNthRow;d<=c;d++)if(this.debug&&console.log("Mode: "+u+" NRow: "+d+" vertexcount: "+r*f/d),r*f/d0&&(p.extruding=!0,this.maxHeight=this.currentPosition.y);break;case"F":if(this.currentFeedRate=Number(m.substring(1)),p.feedRate=this.currentFeedRate,this.currentFeedRate>this.maxFeedRate&&(this.maxFeedRate=this.currentFeedRate),this.currentFeedRate=1?this.maxFeedColor:x<=0?this.minFeedColor:X.Lerp(this.minFeedColor,this.maxFeedColor,x)}}}if(this.zBelt&&(this.beltLength=this.currentPosition.z1&&p.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 I=this.hasSpindle&&c[0]==="G1",T=this.g1AsExtrusion||p.length()>=this.lineLengthTolerance;h&&(this.renderedLines.push(p),p.extruding&&this.lastZExtrusionthis.currentLayerHeight&&!this.isSupport&&g&&(this.previousLayerHeight=this.currentLayerHeight,this.currentLayerHeight=this.currentPosition.y)):this.renderTravels&&!p.extruding&&(p.color=new X(1,0,0,1),this.travels.push(p)),this.zBelt?p.layerHeight=Math.abs(this.currentLayerHeight-this.previousLayerHeight):this.g1AsExtrusion?p.layerHeight=1:p.layerHeight=this.currentLayerHeight-this.previousLayerHeight)}}},{key:"g2g3",value:function(r,o,l,h){var c=this,u=r.split(/(?=[GXYZIJKFREUVAB])/),f=r.indexOf("E")>0||this.g1AsExtrusion,d=u.filter(_=>_==="G2"||_==="G02"),p={position:this.currentPosition.clone(),points:[]};try{p=function(_,m,x,I,T,y,b){for(var S=new v(m.x,m.z,m.y),A=S.clone(),M=0,C=0,w=0,P=_.some(Bi=>Bi.includes("G2")),z=0;z<_.length;z++){var L=_[z];switch(L[0]){case"X":A.x=Gs(L,A.x,x,b.x);break;case"Y":A.y=Gs(L,A.y,x,b.y);break;case"Z":A.z=Gs(L,A.z,x,b.z);break;case"I":M=Gs(L,M,!1,0);break;case"J":case"K":C=Gs(L,C,!1,0);break;case"R":w=Gs(L,w,!1,0)}}var G="x",H="y",ce="z";switch(y){case"XY":G="x",H="y",ce="z";break;case"XZ":G="z",H="x",ce="y";var J=C;C=M,M=J;break;case"YZ":G="y",H="z",ce="x"}if(w){var W=A[G]-S[G],V=A[H]-S[H],R=Math.pow(W,2)+Math.pow(V,2);if(R===0)return{position:S.clone(),points:[]};var k=Math.pow(w,2)-R/4,Y=0;if(k>=0)Y=Math.sqrt(k/R);else if(k<-.02*Math.pow(w,2)){if(!T)return console.error("G2/G3: Radius too small"),{position:{x:A.x,y:A.z,z:A.y},points:[]};var he=Math.sqrt(Math.pow(W/2,2)+Math.pow(V/2,2));k=Math.pow(he,2)-R/4,Y=Math.sqrt(k/R)}(P&&w<0||!P&&w>0)&&(Y=-Y),M=W/2+V*Y,C=V/2-W*Y}else if(M===0&&C===0)return{position:S.clone(),points:[]};var oe,re=S[G]===A[G]&&S[H]===A[H],ue=S[G]+M,xe=S[H]+C,ae=Math.sqrt(M*M+C*C),Me=Math.atan2(-C,-M),ke=Math.atan2(A[H]-xe,A[G]-ue);re?oe=2*Math.PI:(oe=P?Me-ke:ke-Me)<0&&(oe+=2*Math.PI);var Z=ae*oe/I;Z<1&&(Z=1);var Ee=oe/Z;Ee*=P?-1:1;for(var Oe=new Array,He=(A[ce]-S[ce])/Z,je=S[G],Ct=S[H],wt=S[ce],ri=Me,ei=0;ei{var x=new Gl;x.tool=c.currentTool,x.gcodeLineNumber=o,x.gcodeFilePosition=l,x.feedRate=c.currentFeedRate,x.isPerimeter=c.slicer.isPerimeter(),c.g1AsExtrusion?x.layerHeight=1:x.layerHeight=c.currentLayerHeight-c.previousLayerHeight,x.start=g.clone(),x.end=new v(_.x,_.y,_.z),x.extruding=f,x.color=f?c.currentColor.clone():new X(1,0,0,1),c.debug&&(x.color=d?new X(0,1,1,1):new X(1,1,0,1),m===0&&(x.color=new X(0,1,0,1))),g=x.end.clone(),c.debug&&console.log(x),h&&(c.renderedLines.push(x),x.extruding?c.lines[c.linesIndex++]=x:c.travels.push(x))}),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!==Ji.Feed){for(var h=1;h0&&(this.firstGCodeByte=f),this.lastGCodeByte=f,this.processLine(p,d,f,g)),!(Date.now()-this.timeStamp>10)){_.next=33;break}return this.loadingProgressCallback&&this.loadingProgressCallback(f/o.length,"Loading File..."),_.next=32,Ir();case 32:this.timeStamp=_.sent;case 33:this.doUpdate(),_.next=19;break;case 36:if(this.layerDictionary.push(o.length),!this.renderTravels){_.next=40;break}return _.next=40,this.createTravelLines(this.scene);case 40:this.loadingProgressCallback&&this.loadingProgressCallback(1),o={};case 42:case"end":return _.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,f,d,p,g,_,m,x,I,T,y,b=arguments;return yt().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(c=!(b.length>3&&b[3]!==void 0)||b[3],(u=o.indexOf(";"))>-1&&(o=o.substring(0,u-1).trim()),o=o.toUpperCase(),(d=o.match(/[GM]+[0-9.]+/g))===null&&o.match(/[XYZ]+[+-]?[0-9.]+/g)!==null&&(d=this.lastCommand),!d){S.next=61;break}p=0;case 8:if(!(pA.trim()==="X")&&(this.currentPosition.x=this.workplaceOffsets[this.currentWorkplace].x),f.some(A=>A.trim()==="Y")&&(this.currentPosition.z=this.workplaceOffsets[this.currentWorkplace].y),f.some(A=>A.trim()==="Z")&&(this.currentPosition.y=this.workplaceOffsets[this.currentWorkplace].z)),S.abrupt("break",55);case 31:return S.abrupt("break",55);case 32:return this.currentWorkplace=54-Number(d[p].substring(1)),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),S.abrupt("break",55);case 35:return this.currentWorkplace=10*(58.6-Number(d[p].substring(1))),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),S.abrupt("break",55);case 38:return this.absolute=!0,S.abrupt("break",55);case 40:return this.absolute=!1,S.abrupt("break",55);case 42:return S.abrupt("break",55);case 43:return this.hasSpindle=!0,S.abrupt("break",55);case 45:return g=o.split(/(?=[SM])/),(_=(_=g.filter(A=>A.startsWith("S")))[0]?Number(_[0].substring(1)):0)>0&&(this.hasSpindle=!0),S.abrupt("break",55);case 50:return this.hasMixing=!0,this.m567(o),S.abrupt("break",55);case 53:try{this.currentTool++,this.currentTool>=this.tools.length&&(this.currentTool=0),this.colorMode!==Ji.Feed&&(this.currentColor=this.tools[this.currentTool].color.clone())}catch(A){console.log(A)}return S.abrupt("break",55);case 55:this.lastCommand=d;case 56:p++,S.next=8;break;case 59:S.next=63;break;case 61:o.startsWith("T")&&(m=Number.parseInt(o.substring(1),10),isNaN(m)||(this.currentPosition.z+=10,this.currentTool=m,this.currentTool>=this.tools.length?this.currentTool=this.currentTool%this.tools.length:m<0&&(this.currentTool=0),this.colorMode!==Ji.Feed&&((y=Number(o.substring(1))%this.extruderCount)<0&&(y=0),this.currentColor=(x=(I=this.tools[y])===null||I===void 0||(T=I.color)===null||T===void 0?void 0:T.clone())!==null&&x!==void 0?x:new pe(1,0,0)))),this.debug&&console.log(o);case 63:if(!(this.linesIndex>=this.meshBreakPoint)){S.next=70;break}return S.next=66,this.createMesh(this.scene);case 66:return S.next=68,Ir();case 68:this.doUpdate(),this.meshIndex++;case 70:case"end":return S.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(f=>{f.layerHeight=l})),this.renderVersion===Es.Line||this.renderVersion===Es.Point?h=new zl(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===Es.Block?h=this.highQualityExtrusion?new Kb(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):new Hb(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===Es.Voxel&&(h=new Tu(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]:Ba.Extruder,h=new er;h.color=X.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}(),Xl=0,iy=1,sy=function(){function a(e){It(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=Xl),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 te("bedBoxMaterial",this.scene),this.boxMaterial.alpha=0,this.debug=!1}return At(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 Xl:this.buildFlatBed();break;case iy: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=Qt.CreateDisc("BuildPlate",{radius:i},this.scene),this.bedMesh.rotationQuaternion=le.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.material=this.planeMaterial}else{var s=t.x,n=t.y;this.bedMesh=Qt.CreatePlane("BuildPlate",{width:s,height:n},this.scene),this.bedMesh.material=this.planeMaterial,this.bedMesh.rotationQuaternion=le.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.translate(new v(e.x,0,e.y),1,ci.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=Qt.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 X(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 Gt("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=Qt.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 X(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 Xt("bedMaterial",this.scene);return e.mainColor=new X(0,0,0,0),e.lineColor=pe.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 X.FromHexString(this.getBedColor().padEnd(9,"F"))}},{key:"dispose",value:function(){this.bedMesh&&!this.bedMesh.isDisposed&&this.bedMesh.dispose(!1,!0)}}]),a}(),ny=function(){function a(e){It(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 At(a,[{key:"setBuildMaterial",value:function(e,t,i){i||(i=this.alphaLevel);var s=new te(e,this.scene);return s.diffuseColor=t,s.specularColor=new pe(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 X(.1,.5,.1),.25),this.highlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new pe(.8,.8,.8)),this.cancelledMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new pe(1,0,0),.4),this.cancelledHighlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new pe(1,1,0),.6);var e=ne.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=Qt.CreatePlane("TextPlane",{width:i,height:8},this.scene);return h.material=new te("TextPlaneMaterial",this.scene),h.material.backFaceCulling=!1,h.material.specularColor=new pe(0,0,0),h.material.diffuseTexture=new ne(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 X(1,0,0,1)):(e.material=this.baseMaterial,e.enableEdgesRendering(),e.edgesWidth=15,e.edgesColor=new X(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}(),ry=function(){function a(e){It(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 At(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 Fn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=F.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new te("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new pe(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 F("axis",this.scene),this.registerClipIgnore(this.axesMesh);var i=F.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 pe(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=F.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 pe(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=F.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 pe(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}(),Je=null;function Ws(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=yc("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 f=u.attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node(),d='',p=new XMLSerializer().serializeToString(f),g=new Blob([d+p],{type:"image/svg+xml"}),_=window.URL.createObjectURL(g),m=Qt.CreatePlane("TextPlane",{width:l,height:h},s);return m.material=new te("TextPlaneMaterial",s),m.material.backFaceCulling=!1,m.material.specularColor=new pe(0,0,0),m.material.diffuseTexture=new ne(_,s),m.material.diffuseTexture.hasAlpha=!1,m}(a,e,"white","white",6,6,90);i.name=e,i.lookAt(t),i.position=t.scale(-3),e==="Top"&&i.rotate(Wt.Z,Math.PI/2,ci.LOCAL),e==="Bottom"&&i.rotate(Wt.Z,-Math.PI/2,ci.LOCAL),i.metadata={x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)},i.isPickable=!0}function fs(a,e,t){var i=Qt.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 Na,ca=null;function _i(a,e,t){ca||((ca=new te("edgematerial",a)).diffuseColor=new pe(.5,.5,.5));var i=Qt.CreateBox(e,{width:.35,height:5.8,depth:.35},a),s=v.Zero();t.y!==0&&(i.rotate(Wt.Z,Math.PI/2,ci.WORLD),t.x!==0&&i.rotate(Wt.Y,Math.PI/2,ci.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=ca}function ay(a,e,t){(Je=new Qe(a)).autoClear=!1;var i=new st("camera1",5*Math.PI/8,5*Math.PI/8,13,new v(0,0,0),Je);i.viewport=new Qs(.85,.85,.15,.15),i.viewport.toGlobal(200,200),e.afterRender=()=>{Je.render(),i.alpha=t.alpha,i.beta=t.beta,i.radius=15},new an("light1",new v(0,1,0),Je).intensity=.8,new an("light2",new v(-1,-.5,0),Je).intensity=.8;var s=3.9;_i(Je,"FrontLeft",new v(-s,0,-s)),_i(Je,"BackLeft",new v(-s,0,s)),_i(Je,"BackRight",new v(s,0,s)),_i(Je,"FrontRight",new v(s,0,-s)),_i(Je,"TopFront",new v(0,s,-s)),_i(Je,"TopBack",new v(0,s,s)),_i(Je,"TopLeft",new v(-s,s,0)),_i(Je,"TopRight",new v(s,s,0)),_i(Je,"BottomFront",new v(0,-s,-s)),_i(Je,"BottomBack",new v(0,-s,s)),_i(Je,"BottomLeft",new v(-s,-s,0)),_i(Je,"BottomRight",new v(s,-s,0)),fs(Je,"FrontTopLeft",new v(-3,3,-3)),fs(Je,"FrontTopRight",new v(3,3,-3)),fs(Je,"BackTopLeft",new v(-3,3,3)),fs(Je,"BackTopRight",new v(3,3,3)),fs(Je,"FrontBottomLeft",new v(-3,-3,-3)),fs(Je,"FrontBottomRight",new v(3,-3,-3)),fs(Je,"BackBottomLeft",new v(-3,-3,3)),fs(Je,"BackBottomRight",new v(3,-3,3)),Ws(Je,"Front",new v(0,0,1)),Ws(Je,"Right",new v(-1,0,0)),Ws(Je,"Back",new v(0,0,-1)),Ws(Je,"Left",new v(1,0,0)),Ws(Je,"Top",new v(0,-1,0)),Ws(Je,"Bottom",new v(0,1,0)),Je.onPointerDown=(n,r)=>{r.distance>0&&Na&&(Na(r.pickedMesh.metadata),Je.render(!0))}}var oy=function(){function a(e){It(this,a),this.visible=!0,this.scene=e,this.workplacePoints=[],this.workplaceMeshes=[],this.registerClipIgnore=()=>{}}return At(a,[{key:"setOffsets",value:function(e){this.workplacePoints=e,this.render()}},{key:"makeTextPlane",value:function(e,t,i){var s=new Fn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=F.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new te("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new pe(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 At(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 Yt(0,1,0,this.zTopClipValue),this.scene.clipPlane2=new Yt(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.11"," ")),c.next=4,Se.IsSupportedAsync;case 4:if(!c.sent||!r){c.next=13;break}return console.log("WebGPU Supported"),this.engine=new Se(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 ie(this.canvas,!0,{doNotHandleContextLost:!0});case 15:this.engine.enableOfflineSupport=!1,this.scene=new Qe(this.engine),this.scene.performancePriority=Ta.BackwardCompatible,this.debug,this.scene.clearColor=pe.FromHexString(this.getBackgroundColor()),this.bed=new sy(this.scene),this.bed.registerClipIgnore=u=>{h.registerClipIgnore(u)},o=this.bed.getCenter(),this.orbitCamera=new st("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 Or("light2",new v(0,1,-1),this.scene)).diffuse=new pe(1,1,1),l.specular=new pe(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 ny(this.scene),this.buildObjects.getMaxHeight=()=>h.gcodeProcessor.getMaxHeight(),this.buildObjects.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.bed.buildBed(),this.axes=new ry(this.scene),this.axes.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.axes.render(),this.workplace=new oy(this.scene),this.workplace.registerClipIgnore=u=>{h.registerClipIgnore(u)},this.workplace.setOffsets(this.gcodeProcessor.workplaceOffsets),this.workplace.render(),this.resetCamera(),ay(this.engine,this.scene,this.orbitCamera),Na=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=wo(h))||c&&h&&typeof h.length=="number"){u&&(h=u);var f=0,d=()=>{};return{s:d,n:()=>f>=h.length?{done:!0}:{done:!1,value:h[f++]},e:m=>{throw m},f:d}}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 p,g=!0,_=!1;return{s:()=>{u=u.call(h)},n:()=>{var m=u.next();return g=m.done,m},e:m=>{_=!0,p=m},f:()=>{try{g||u.return==null||u.return()}finally{if(_)throw p}}}}(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=pe.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 Yt(0,1,0,r.zTopClipValue),r.scene.clipPlane2=new Yt(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(Wt.X,Math.PI/2-r*Math.PI/180,ci.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 X(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,lv.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){Je.meshes.forEach(o=>{o.setEnabled(r)})})(n)}}]),a}(),hy=Object.defineProperty,cy=Object.getOwnPropertyDescriptor,Us=(a,e,t,i)=>{for(var s=i>1?void 0:i?cy(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&&hy(e,t,s),s};let os=class extends Vu{constructor(){super(...arguments),this.view=void 0}mounted(){this.view=new Qu({doc:this.document,extensions:[Ju,ef.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})}}};Us([tf("currentline")],os.prototype,"currentLineNumber",2);Us([Ar({type:String,default:""})],os.prototype,"document",2);Us([Ar({type:Boolean,default:!1})],os.prototype,"isSimulating",2);Us([Ar({type:Boolean,default:!1})],os.prototype,"shown",2);Us([nt("document")],os.prototype,"documentUpdated",1);Us([nt("currentLineNumber")],os.prototype,"currentlineUpdated",1);os=Us([ka({})],os);var uy=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}})},fy=[];const Hl={};var dy=Va(os,uy,fy,!1,py,"7831183a",null,null);function py(a){for(let e in Hl)this[e]=Hl[e]}const Su=function(){return dy.exports}();var _y=Object.defineProperty,gy=Object.getOwnPropertyDescriptor,tt=(a,e,t,i)=>{for(var s=i>1?void 0:i?gy(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&&_y(e,t,s),s};let $=null,$e=class extends ql($l){constructor(){super(...arguments),this.mdiReloadAlert=Cu,this.mdiCameraRetake=Mu,this.mdiToggleSwitch=Ru,this.mdiToggleSwitchOffOutline=Pu,this.mdiClose=wu,this.mdiCog=Du,this.mdiVideo3d=Fu,this.mdiPlay=Ou,this.mdiPause=Lu,this.mdiFastForward=Bu,this.mdiBroom=Nu,this.mdiSelectionRemove=Uu,this.formatFilesize=ku,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:{}},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,$=(s=(i=this.$store.state.gcodeviewer)==null?void 0:i.viewerBackup)!=null?s:null,await this.init(),this.loadedFile!==null&&(this.scrubFileSize=$.fileSize),$&&(this.fileData=$.fileData)}beforeDestroy(){$&&($.gcodeProcessor.loadingProgressCallback=null,this.$store.dispatch("gcodeviewer/setLoadedFileBackup",this.loadedFile),this.$store.dispatch("gcodeviewer/setViewerBackup",$)),this.scrubPlaying=!1,this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0)}handleResize(){this.$nextTick(()=>{$==null||$.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),$!=null&&$.gcodeProcessor&&$.gcodeProcessor.updateFilePosition($==null?void 0:$.fileSize)),$===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){$=new ly(e),await $.init(),$.setBackgroundColor(this.backgroundColor),$.bed.setBedColor(this.gridColor),$.setCursorVisiblity(this.showCursor),$.setZClipPlane(1e6,-1e6),$.axes.show(this.showAxes),$.bed.setDelta(this.kinematics.includes("delta")),this.bedMaxSize!==null&&($.bed.buildVolume.x.max=this.bedMaxSize[0],$.bed.buildVolume.y.max=this.bedMaxSize[1],$.bed.buildVolume.z.max=this.bedMaxSize[2]),this.bedMinSize!==null&&($.bed.buildVolume.x.min=this.bedMinSize[0],$.bed.buildVolume.y.min=this.bedMinSize[1],$.bed.buildVolume.z.min=this.bedMinSize[2]),$.gcodeProcessor.useHighQualityExtrusion(this.hdRendering),$.gcodeProcessor.updateForceWireMode(this.forceLineRendering||this.cncMode),$.gcodeProcessor.setAlpha(this.transparency),$.gcodeProcessor.setVoxelMode(this.voxelMode),$.gcodeProcessor.voxelWidth=this.voxelWidth,$.gcodeProcessor.voxelHeight=this.voxelHeight,$.gcodeProcessor.useSpecularColor(this.specularLighting),$.gcodeProcessor.setLiveTracking(!1),$.gcodeProcessor.g1AsExtrusion=this.cncMode,$.buildObjects.objectCallback=this.objectCallback,this.loadToolColors(this.extruderColors),$.lastLoadFailed()&&(this.renderQuality=this.renderQualities[0],$.updateRenderQuality(1),$.clearLoadFlag())}registerProgressCallback(){$&&($.gcodeProcessor.loadingProgressCallback=e=>{this.loadingPercent=Math.ceil(e*100),this.loading=this.loadingPercent<=99})}async cancelRendering(){$&&($.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3))}clearLoadedFile(){$&&(this.scrubPlaying=!1,this.scrubFileSize=0,$.clearScene(!0),this.loadedFile=null,this.tracking=!1)}chooseFile(){this.isBusy||this.fileInput.click()}finishLoad(){this.loading=!1,$.setCursorVisiblity(this.showCursor),this.refreshPrintingObjects(),this.scrubFileSize=$.fileSize,$.gcodeProcessor.updateFilePosition($.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)]})}),$.buildObjects.loadObjectBoundaries(e),$.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 $.processFile(r),this.fileData=$.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.filename=e.startsWith("gcodes/")?e.slice(7):e;const t=Yo.CancelToken;this.downloadSnackbar.cancelTokenSource=t.source();const i=await Yo.get(this.apiUrl+"/server/files/"+encodeURI(e),{cancelToken:this.downloadSnackbar.cancelTokenSource.token,responseType:"blob",onDownloadProgress:s=>{var n,r,o;this.downloadSnackbar.percent=((n=s.progress)!=null?n:0)*100,this.downloadSnackbar.speed=(r=s.rate)!=null?r:0,this.downloadSnackbar.total=(o=s.total)!=null?o:0}}).then(s=>s.data.text()).catch(s=>{window.console.error(s.message)});this.downloadSnackbar.status=!1,this.loadedFile=this.downloadSnackbar.filename,$.updateRenderQuality(this.renderQuality.value),await $.processFile(i),this.fileData=$.fileData,this.loadingPercent=100,this.finishLoad(),this.scrubFileSize=$.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&&($.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3)),this.reloadRequired=!1,this.loading=!0,this.loadingPercent=0,await $.reload(),this.fileData=$.fileData,this.loadingPercent=100,this.finishLoad()}resetCamera(){$.resetCamera()}setReloadRequiredFlag(){this.loadedFile&&this.loadedFile!=""&&(this.reloadRequired=!0)}async renderQualityChanged(e){$&&$.renderQuality!==e&&($.updateRenderQuality(e),await this.reloadViewer())}currentPositionChanged(e){if($){const t=[{axes:"X",position:e[0]},{axes:"Y",position:e[1]},{axes:"Z",position:e[2]}];$.updateToolPosition(t)}}filePositionChanged(e){if(!$)return;const t=350;e>0&&this.printerIsPrinting&&this.tracking&&e>t?($.gcodeProcessor.updateFilePosition(e-t),this.scrubPosition=e-t):$.gcodeProcessor.updateFilePosition($.fileSize)}async trackingChanged(e){$&&(e?(this.scrubPlaying=!1,$.gcodeProcessor.updateFilePosition(0),$==null||$.forceRender()):($.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){$==null||$.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&&$&&(this.fileData=$.fileData),this.handleResize()}showTravelMovesChanged(e){$==null||$.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){$==null||$.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){$&&($.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){$&&($.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){$&&($.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){$&&($.gcodeProcessor.setVoxelMode(e),$.gcodeProcessor.voxelWidth=this.voxelWidth,$.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){$&&$.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}),$.gcodeProcessor.g1AsExtrusion=e,$.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){$&&e.length&&($.gcodeProcessor.resetTools(),e.forEach(t=>{$.gcodeProcessor.addTool(t,this.nozzle_diameter)}),this.setReloadRequiredFlag())}extruderColorsChanged(e){$&&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}),$&&$.gcodeProcessor.colorMode!==e&&($.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){$&&$.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){$&&$.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){$&&$.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){$&&$.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){$&&$.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){$&&($.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){$&&($.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){$&&e&&$.bed.setDelta(e.includes("delta"))}bedMinSizeChanged(e){$&&e&&($.bed.buildVolume.x.min=e[0],$.bed.buildVolume.y.min=e[1],$.bed.buildVolume.z.min=e[2])}bedMaxSizeChanged(e){e&&$&&($.bed.buildVolume.x.max=e[0],$.bed.buildVolume.y.max=e[1],$.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){$==null||$.setProgressColor(e)}scrubPlayingChanged(e){e?(this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0),this.scrubPlaying=!0,this.scrubPosition>=this.scrubFileSize&&(this.scrubPosition=0),$.gcodeProcessor.updateFilePosition(this.scrubPosition-3e4),this.scrubInterval=setInterval(()=>{this.scrubPosition+=100*this.scrubSpeed,$.gcodeProcessor.updateFilePosition(this.scrubPosition),$.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||($.gcodeProcessor.updateFilePosition(e),$.simulateToolPosition())}fastForward(){this.scrubPosition=this.scrubFileSize,$.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}};tt([Ar({type:String,default:"",required:!1})],$e.prototype,"filename",2);tt([Ql("fileInput")],$e.prototype,"fileInput",2);tt([Ql("viewerCanvasContainer")],$e.prototype,"viewerCanvasContainer",2);tt([jl(200)],$e.prototype,"handleResize",1);tt([nt("printing_objects")],$e.prototype,"printing_objectsChanged",1);tt([nt("excluded_objects")],$e.prototype,"excluded_objectsChanged",1);tt([nt("renderQuality")],$e.prototype,"renderQualityChanged",1);tt([nt("currentPosition")],$e.prototype,"currentPositionChanged",1);tt([nt("filePosition")],$e.prototype,"filePositionChanged",1);tt([nt("tracking")],$e.prototype,"trackingChanged",1);tt([nt("printerIsPrinting")],$e.prototype,"printerIsPrintingChanged",1);tt([nt("showCursor")],$e.prototype,"showCursorChanged",1);tt([nt("showTravelMoves")],$e.prototype,"showTravelMovesChanged",1);tt([nt("showObjectSelection")],$e.prototype,"showObjectSelectionChanged",1);tt([nt("hdRendering")],$e.prototype,"hdRenderingChanged",1);tt([nt("forceLineRendering")],$e.prototype,"forceLineRenderingChanged",1);tt([nt("transparency")],$e.prototype,"transparencyChanged",1);tt([nt("voxelMode")],$e.prototype,"voxelModeChanged",1);tt([nt("specularLighting")],$e.prototype,"specularLightingChanged",1);tt([nt("extruderColors")],$e.prototype,"extruderColorsChanged",1);tt([nt("backgroundColor")],$e.prototype,"backgroundColorChanged",1);tt([nt("gridColor")],$e.prototype,"gridColorChanged",1);tt([nt("showAxes")],$e.prototype,"showAxesChanged",1);tt([nt("minFeed")],$e.prototype,"minFeedChanged",1);tt([nt("maxFeed")],$e.prototype,"maxFeedChanged",1);tt([nt("minFeedColor")],$e.prototype,"minFeedColorUpdated",1);tt([nt("maxFeedColor")],$e.prototype,"maxFeedColorUpdated",1);tt([nt("kinematics")],$e.prototype,"kinematicsChanged",1);tt([nt("bedMinSize",{deep:!0})],$e.prototype,"bedMinSizeChanged",1);tt([nt("bedMaxSize",{deep:!0})],$e.prototype,"bedMaxSizeChanged",1);tt([nt("progressColor")],$e.prototype,"progressColorChanged",1);tt([nt("scrubPlaying")],$e.prototype,"scrubPlayingChanged",1);tt([jl(200),nt("scrubPosition")],$e.prototype,"updateScrubPosition",1);$e=tt([ka({components:{Panel:Zl,CodeStream:Su}})],$e);var my=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",[t(Zl,{attrs:{title:a.panelTitle,icon:a.mdiVideo3d,"card-class":"gcode-viewer-panel","margin-bottom":!1},scopedSlots:a._u([{key:"buttons",fn:function(){return[t(Nt,{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(Ei,{staticClass:"d-sm-none"},[a._v(a._s(a.mdiReloadAlert))])],1),t(Nt,{attrs:{icon:"",tile:""},on:{click:a.resetCamera}},[t(Ei,[a._v(a._s(a.mdiCameraRetake))])],1)]},proxy:!0}])},[t(qo,[t(Kn,{class:a.showScrubber?"withScrubber":""},[t(cs,{attrs:{cols:a.showGCode?8:12}},[t("div",{ref:"viewerCanvasContainer"})]),t(cs,{directives:[{name:"show",rawName:"v-show",value:a.showGCode,expression:"showGCode"}],attrs:{cols:"4"}},[t("div",{staticClass:"viewer"},[t(Su,{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(Kn,{directives:[{name:"show",rawName:"v-show",value:a.showScrubber,expression:"showScrubber"}],staticClass:"scrubber"},[t(cs,{staticClass:"pt-0"},[t(Gu,{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(cs,{staticClass:"col-auto pt-0 text-center"},[t(Nt,{staticClass:"px-2 minwidth-0",attrs:{color:"primary"},on:{click:function(i){a.scrubPlaying=!a.scrubPlaying}}},[a.scrubPlaying?t(Ei,[a._v(a._s(a.mdiPause))]):t(Ei,[a._v(a._s(a.mdiPlay))])],1),t(Nt,{staticClass:"px-2 minwidth-0 mx-3",attrs:{color:"primary"},on:{click:a.fastForward}},[t(Ei,[a._v(a._s(a.mdiFastForward))])],1),t(zu,{staticClass:"mt-3 mt-sm-0",attrs:{dense:"",mandatory:"",rounded:""},model:{value:a.scrubSpeed,callback:function(i){a.scrubSpeed=i},expression:"scrubSpeed"}},[t(Nt,{attrs:{value:1}},[a._v("1x")]),t(Nt,{attrs:{value:2}},[a._v("2x")]),t(Nt,{attrs:{value:5}},[a._v("5x")]),t(Nt,{attrs:{value:10}},[a._v("10x")]),t(Nt,{attrs:{value:20}},[a._v("20x")])],1)],1)],1),t(Kn,{staticClass:"mt-0 d-flex align-top"},[t(cs,[t(Kn,[t(cs,{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(Nt,{staticClass:"mr-3",on:{click:a.loadCurrentFile}},[a._v(" "+a._s(a.$t("GCodeViewer.LoadCurrentFile"))+" ")]):a._e(),t(Nt,{on:{click:a.chooseFile}},[a._v(a._s(a.$t("GCodeViewer.LoadLocal")))])]:[a.showTrackingButton?t(Nt,{staticClass:"mr-3",on:{click:function(i){a.tracking=!a.tracking}}},[t(Ei,{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(Nt,{on:{click:a.clearLoadedFile}},[t(Ei,{attrs:{left:""}},[a._v(a._s(a.mdiBroom))]),a._v(" "+a._s(a.$t("GCodeViewer.ClearLoadedFile"))+" ")],1)]],2),t(cs,{staticClass:"col-12 col-sm-6 col-md-4"},[t($o,{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(cs,{staticClass:"col-12 col-sm-6 col-md-4 d-flex",attrs:{"order-md":"3"}},[t($o,{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(Wu,{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(Nt,a._g(a._b({staticClass:"minwidth-0 px-2 ml-3"},"v-btn",n,!1),s),[t(Ei,[a._v(a._s(a.mdiCog))])],1)]}}])},[t(Xu,[t(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Hu),t(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(Ni,{staticClass:"minHeight36"},[t(Ui,{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(jo,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:a._u([{key:"action",fn:function(i){var s=i.attrs;return[t(Nt,a._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:function(n){return a.cancelRendering()}}},"v-btn",s,!1),[t(Ei,{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($r,{staticClass:"mt-2",attrs:{value:a.loadingPercent}})],1),t(jo,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:a._u([{key:"action",fn:function(i){var s=i.attrs;return[t(Nt,a._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:a.cancelDownload}},"v-btn",s,!1),[t(Ei,{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($r,{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($r,{staticClass:"mt-2",attrs:{indeterminate:""}})]],2),t(Ku,{attrs:{"max-width":"400"},model:{value:a.excludeObject.bool,callback:function(i){a.$set(a.excludeObject,"bool",i)},expression:"excludeObject.bool"}},[t(Yu,[t(qu,{attrs:{flat:"",dense:""}},[t($u,[t("span",{staticClass:"subheading"},[t(Ei,{attrs:{left:""}},[a._v(a._s(a.mdiSelectionRemove))]),a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline"))+" ")],1)])],1),t(qo,{staticClass:"mt-3"},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText",{name:a.excludeObject.name}))+" ")]),t(ju,[t(Zu),t(Nt,{attrs:{text:""},on:{click:function(i){a.excludeObject.bool=!1}}},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.Cancel"))+" ")]),t(Nt,{attrs:{color:"primary",text:""},on:{click:a.cancelObject}},[a._v(" "+a._s(a.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"))+" ")])],1)],1)],1)],1)},vy=[];const Kl={};var xy=Va($e,my,vy,!1,by,"a01a7710",null,null);function by(a){for(let e in Kl)this[e]=Kl[e]}const Eu=function(){return xy.exports}();var yy=Object.defineProperty,Ty=Object.getOwnPropertyDescriptor,Sy=(a,e,t,i)=>{for(var s=i>1?void 0:i?Ty(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&&yy(e,t,s),s};let Ua=class extends ql($l){};Ua=Sy([ka({components:{Viewer:Eu}})],Ua);var Ey=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t(Eu)},Iy=[];const Yl={};var Ay=Va(Ua,Ey,Iy,!1,Cy,null,null,null);function Cy(a){for(let e in Yl)this[e]=Yl[e]}const Oy=function(){return Ay.exports}();export{Oy as default}; diff --git a/assets/WebrtcCameraStreamer-7e0e004c.css b/assets/WebrtcCameraStreamer-7e0e004c.css new file mode 100644 index 0000000..562b240 --- /dev/null +++ b/assets/WebrtcCameraStreamer-7e0e004c.css @@ -0,0 +1 @@ +.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/assets/WebrtcCameraStreamer-8d1cc452.js b/assets/WebrtcCameraStreamer-8d1cc452.js new file mode 100644 index 0000000..477c3bd --- /dev/null +++ b/assets/WebrtcCameraStreamer-8d1cc452.js @@ -0,0 +1 @@ +import{m as u,B as h,G as d,P as p,W as _,R as f,C as v,n as S}from"./index-17a5ec1d.js";import{l as y,m as g,q as w}from"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.js";var T=Object.defineProperty,C=Object.getOwnPropertyDescriptor,c=(r,e,i,t)=>{for(var s=t>1?void 0:t?C(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 b=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,b,x,!1,P,"a89db62a",null,null);function P(r){for(let e in m)this[e]=m[e]}const U=function(){return O.exports}();export{U as default}; diff --git a/assets/WebrtcGo2rtc-4ca7d296.css b/assets/WebrtcGo2rtc-4ca7d296.css new file mode 100644 index 0000000..4219054 --- /dev/null +++ b/assets/WebrtcGo2rtc-4ca7d296.css @@ -0,0 +1 @@ +.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/assets/WebrtcGo2rtc-b685b8ad.js b/assets/WebrtcGo2rtc-b685b8ad.js new file mode 100644 index 0000000..154c920 --- /dev/null +++ b/assets/WebrtcGo2rtc-b685b8ad.js @@ -0,0 +1 @@ +import{m as p,B as m,G as g,P as d,W as l,R as f,C as _,n as v}from"./index-17a5ec1d.js";import{l as w,m as b,q as S}from"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.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 C=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)},T=[];const h={};var W=v(o,C,T,!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/assets/WebrtcMediaMTX-2862afdc.js b/assets/WebrtcMediaMTX-2862afdc.js new file mode 100644 index 0000000..94fc496 --- /dev/null +++ b/assets/WebrtcMediaMTX-2862afdc.js @@ -0,0 +1 @@ +import{m as p,B as m,G as f,P as h,W as u,R as g,C as _,n as w}from"./index-17a5ec1d.js";import{l as T,m as v,q as C}from"./vuetify-4c65b4c3.js";import"./overlayscrollbars-44d87bcf.js";import"./echarts-ff51454d.js";var S=Object.defineProperty,b=Object.getOwnPropertyDescriptor,d=(n,e,t,i)=>{for(var s=i>1?void 0:i?b(e,t):e,a=n.length-1,r;a>=0;a--)(r=n[a])&&(s=(i?r(e,t,s):r(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.sessionUuid=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 r of t){const c=r.sdpMLineIndex;c!==null&&(c in i||(i[c]=[]),i[c].push(r))}let s="a=ice-ufrag:"+e.iceUfrag+"\r\na=ice-pwd:"+e.icePwd+"\r\n",a=0;for(const r of e.medias){if(i[a]!==void 0){s+="m="+r+"\r\na=mid:"+a+"\r\n";for(const c of i[a])s+="a="+c.candidate+"\r\n"}a++}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,sdpSemantics:"unified-plan"});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"),this.sessionUuid=s.headers.get("location"),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){var i;const t=new URL((i=this.sessionUuid)!=null?i:"",this.url).toString();fetch(t,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this.eTag},body:this.generateSdpFragment(this.offerData,e)}).then(s=>{switch(s.status){case 204:break;case 404:throw new Error("stream not found");default:throw new Error("bad status code ".concat(s.status))}}).catch(s=>{this.log(s),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 y=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(T,[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=w(o,y,x,!1,P,"8e05f6b2",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/assets/WebrtcMediaMTX-caefdcd6.css b/assets/WebrtcMediaMTX-caefdcd6.css new file mode 100644 index 0000000..aa0e107 --- /dev/null +++ b/assets/WebrtcMediaMTX-caefdcd6.css @@ -0,0 +1 @@ +.webcamImage[data-v-8e05f6b2]{width:100%}._webcam_webrtc_output[data-v-8e05f6b2]{aspect-ratio:1.5}video[data-v-8e05f6b2]{width:100%} diff --git a/assets/codemirror-0a1db0c7.js b/assets/codemirror-0a1db0c7.js new file mode 100644 index 0000000..e6085bb --- /dev/null +++ b/assets/codemirror-0a1db0c7.js @@ -0,0 +1 @@ +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/assets/cz-285b76fb.js b/assets/cz-285b76fb.js new file mode 100644 index 0000000..0b96537 --- /dev/null +++ b/assets/cz-285b76fb.js @@ -0,0 +1 @@ +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/assets/da-32034265.js b/assets/da-32034265.js new file mode 100644 index 0000000..eeb9c62 --- /dev/null +++ b/assets/da-32034265.js @@ -0,0 +1 @@ +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.",MoonrakerFailedInitComponentDescription:"Der blev fundet en fejl under opstart af Moonraker komponenten '{component}'. Tjek logfilen og løs problemet.",MoonrakerInitComponent:"Starter Moonraker: {component}",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"},o={AreYouSure:"Er du sikker?",EmergencyStop:"Nødstop",No:"Nej",Yes:"Ja"},l={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",LoadCompleteHistory:"Indlæs komplet historik",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",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",CleanNozzle:"Rens dyse",EstimatedExtrusion:"Estimeret ekstrudering",Extrude:"Extrude",ExtruderControl:"Esktruder-kontrol",ExtruderTempTooLow:"Hotend temp. <",ExtrusionFactor:"Ekstruderingsfaktor",ExtrusionFeedrate:"Ekstruderingsfødehastighed",FilamentLength:"Filamentlængde",FirmwareRetraction:"Firwmare Retraction",FirmwareRetractionSettings:{RetractLength:"Retract længde",RetractSpeed:"Retract hastighed",UnretractExtraLength:"Unretract ekstra længde",UnretractSpeed:"Unretract hastighed"},Headline:"Ekstruder Kontrolpanel",LoadFilament:"Fød filament",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Advance",Extruder:"Ekstruder",SmoothTime:"Smooth Time"},PurgeFilament:"Udrens filament",Requested:"Anmodet",Retract:"Retract",TooLargeExtrusion:"Ekstruderingen er for lang!",Tools:"Printhoveder",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.",MinimumCruiseRatio:"Minimum rulle forhold",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",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",ControlButtons:"Kontrol-knapper",CoordinateFields:"Koordinatfelter",Headline:"Kontrolpanel",PleaseConfigureSteps:"Konfigurer steps",Position:"Position",PositionOutput:"Positionsoutput",QGL:"QGL",Relative:"relativ",SettingsInterfaceControl:"Indstillinger > Interface > Control",SpeedFactor:"Hastighed",ZOffset:"Z-Offset",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)",ZOffsetSaveOption:"Z-Offset Gem-mulighed",ZOffsetSaveOptionDescription:"Ændr metoden for 'gem Z-Offset'",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"},HeightmapTab:{ColorSchemes:"Farvetemaer",Heightmap:"Højdekort",IsDefault:"(Standard)",Schemes:{GrayScale:"Gråskala",Hot:"Varm",Hsv:"TMV",Portland:"Portland",Spring:"Forår"}},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.",Theme:"Tema",ThemeDark:"Mørkt",ThemeDescription:"Ændr grundfarverne og tonen af applikationen",ThemeLight:"Lyst",UiSettings:"UI-indstillinger"},Update:"Opdater",WebcamsTab:{AddWebcam:"Tilføj webcam",CreateWebcam:"Nyt Webcam",EditCrowsnestConf:"Redigér crowsnest.conf",EditWebcam:"Rediger Webcam",EnableAudio:"Aktivér lyd",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)",WebrtcGo2rtc:"WebRTC (go2rtc)",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:o,Files:l,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,o as EmergencyStopDialog,l 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/assets/de-1b45e732.js b/assets/de-1b45e732.js new file mode 100644 index 0000000..db67c12 --- /dev/null +++ b/assets/de-1b45e732.js @@ -0,0 +1 @@ +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",KlipperRuntimeWarning:"Klipper Laufzeitwarnung",KlipperWarning:"Klipper Warnung"},MaintenanceReminder:"Wartungserinnerung",MaintenanceReminderText:'Wartung "{name}" ist fällig.',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",OneDayShort:"1T",OneHourShort:"1Std",OneWeekShort:"1W",Remind:"Erinnere:",ShowDetails:"Details anzeigen",TmcOtFlag:"Stepper-Treiber Fehler: OT-Flag ist gesetzt",TmcOtFlagText:"Der Stepper-Treiber '{Name}' hat das OT-Flag ausgelöst und funktioniert nicht mehr. Dies kann durch einen zu hohen Strom verursacht werden. Bitte überprüfe die Einstellungen und die Kühlung des Steppertreibers.",TmcOtpwFlag:"Stepper-Treiber Fehler: OTPW-Flag ist gesetzt",TmcOtpwFlagText:"Der Stepper-Treiber '{Name}' hat das OTPW-Flag ausgelöst und funktioniert möglicherweise nicht mehr, wenn er noch heißer wird. Dies ist ein Hinweis auf einen Überhitzungszustand. Dies kann durch einen zu hohen Strom verursacht werden. Bitte überprüfe die Einstellungen und die Kühlung des Steppertreibers."},NumberInput:{GreaterOrEqualError:"Muss größer oder gleich {min} sein!",MustBeBetweenError:"Muss zwischen {min} und {max} liegen!",NoEmptyAllowedError:"Feld darf nicht leer sein!"},Printers:"Drucker",TextfieldWithCopy:{Copied:"Kopiert!"},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={AreYouSure:"Bist du sicher?",CoolDown:"Abkühlen",No:"Nein",Yes:"Ja"},a={CanBusInfo:"Nur nicht zugewiesene Knoten können erkannt werden. Es wird empfohlen, nur ein nicht zugewiesenes Gerät an den Can-Bus anzuschließen, um Kommunikationsprobleme zu vermeiden. Klicke hier für weitere Informationen:",ClickRefresh:"Klicke auf den Aktualisieren-Button, um die Geräte zu aktualisieren.",DevicePath:"Gerätepfad",Formats:"Formate",Headline:"Geräte",HideSystemEntries:"Systemeinträge ausblenden",LibcameraId:"Libcamera ID",NoDeviceFound:"Kein Gerät gefunden. Bitte überprüfe die Verbindung und klicke auf den Aktualisieren-Button.",PathByHardware:"Hardwarepfad",PathById:"ID-Pfad",Refresh:"Aktualisieren",Resolutions:"Auflösungen"},s={StartPrint:{Cancel:"abbrechen",DoYouWantToStartFilename:"Willst du {filename} starten?",DoYouWantToStartFilenameFilament:"Willst du {filename} mit dem folgenden Filament starten?",Headline:"Starte Job",Print:"drucken",Timelapse:"Zeitraffer"}},o={ConfigReference:"Konfig-Referenz",DeviceDialog:"Geräte",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"},l={AreYouSure:"Bist du sicher?",EmergencyStop:"Notaus",No:"Nein",Yes:"Ja"},u={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.",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"},d={CannotUploadFile:"Datei konnte nicht hochgeladen werden!",DropFilesToUploadFiles:"Datei ablegen zum Hochladen"},c={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)"},g={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.",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"Es wurde noch kein Bed Mesh geladen.",NoProfile:"Kein Profil verfügbar",Probed:"Abgetastet",Profiles:"Profile",Remove:"löschen",Rename:"umbenennen",RenameBedMeshProfile:"Bed Mesh umbenennen",ScaleGradient:"Farbverlauf skalieren",ScaleZMax:"Skaliere z-max.",TitleCalibrate:"Neues Bed Mesh kalibrieren",TitleClear:"Lösche Bed Mesh",TitleHomeAll:"Home alle",Wireframe:"Drahtgitter"},m={AddANote:"Eine Notiz hinzufügen",AddMaintenance:"Wartung hinzufügen",AddNote:"Notiz hinzufügen",AddToQueueSuccessful:"Datei {filename} zur Warteschlange hinzugefügt.",AllJobs:"Alle",AvgPrinttime:"Druckzeit - Ø",Cancel:"abbrechen",Chart:"Diagramm",CreateNote:"Notiz anlegen",DateBasedReminder:"Datum",DateBasedReminderDescription:"Diese Erinnerung basiert auf dem Datum.",Days:"Tage",Delete:"Löschen",DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Jobs gelöscht werden?",DeleteSingleJobQuestion:"Soll der Job wirklich gelöscht werden?",Details:"Details",EditMaintenance:"Wartung bearbeiten",EditNote:"Notiz bearbeiten",Empty:"leer",EndTime:"Endzeit",EntryCreatedAt:"Erstellt am {date}.",EntryNextPerform:"Nächste Ausführung:",EntryPerformedAt:"Ausgeführt am {date}.",EntrySince:"Verwendet seit:",EstimatedFilament:"Geschätzte Filamentlänge",EstimatedFilamentWeight:"Geschätztes Filamentgewicht",EstimatedTime:"Geschätzte Zeit",FilamentBasedReminder:"Filament",FilamentBasedReminderDescription:"Diese Erinnerung basiert auf dem Filamentverbrauch.",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",Hours:"Stunden",InvalidNameEmpty:"Ungültiger Name. Name darf nicht leer sein!",JobDetails:"Job Details",Jobs:"Drucke",LastModified:"Zuletzt geändert",LayerHeight:"Schichthöhe",LoadCompleteHistory:"Lade vollständige Historie",LongestPrinttime:"Druckzeit - längste",Maintenance:"Wartung",MaintenanceEntries:"Wartungseinträge",Meter:"Meter",Name:"Name",NoReminder:"Keine Erinnerung",Note:"Notiz",ObjectHeight:"Objekthöhe",OneTime:"Einmalig",Perform:"ausführen",Performed:"ausgeführt",PerformedAndReschedule:"ausgeführt und neu planen",PerformMaintenance:"Wartung ausführen",PrintDuration:"Druckdauer",PrintHistory:"Historie",PrintJobs:"Drucke",PrintTime:"Druckzeit",PrinttimeAvg:"Druckzeit - Ø",PrinttimeBasedReminder:"Druckzeit",PrinttimeBasedReminderDescription:"Diese Erinnerung basiert auf der Druckzeit.",Reminder:"Erinnerung",Repeat:"Wiederholen",Reprint:"Erneut drucken",Save:"speichern",Search:"Suchen",SelectedFilamentUsed:"Ausg. Filamentverbrauch",SelectedJobs:"Ausg. Drucke",SelectedPrinttime:"Ausg. Druckzeit",Slicer:"Slicer",SlicerVersion:"Slicerversion",StartTime:"Startzeit",Statistics:"Statistik",Status:"Status",StatusValues:{cancelled:"Abgebrochen",completed:"Abgeschlossen",error:"Fehler",in_progress:"In Arbeit",interrupted:"Unterbrochen",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"},h={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",Pause:"Pause",RemoveFromQueue:"Von Auftragswarteschlange entfernen",Start:"Start",StartPrint:"Auftrag starten"},p={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."}},f={Abort:"abbrechen",Accept:"akzeptieren",Advanced:"Erweitert",Headline:"Manuelle Messung"},D={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",KlipperLog:"Klipper Log",MoonrakerCannotConnect:"Moonraker kann keine Verbindung zu Klipper herstellen!",MoonrakerLog:"Moonraker Log",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"}},b={AreYouSure:"Bist du sicher?",No:"Nein",TurnDeviceOff:"{device} ausschalten",TurnDeviceOn:"{device} anschalten",Yes:"Ja"},k={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"},S={Accept:"akzeptieren",Base:"Basis",ErrorText:"Ein Fehler ist beim Abtasten aufgetreten.",Headline:"Neigungsverstellung",Retry:"wiederholen"},w={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",Name:"Name",Path:"Pfad",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"},C={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",DbMaintenance:"Wartung",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",Name:"Name",NameDescription:"Dieser Name wird nicht im GUI angezeigt und wird nur für Weiterleitungen verwendet.",Path:"Pfad",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",CameraDescriptionWithSnapshotUrl:"Wähle aus, welche Kamera (mit Schnappschuss URL) verwendet werden soll.",CameraWarningAlreadySet:"Dieser Wert ist bereits in der Moonraker-Konfigurationsdatei festgelegt.",CameraWarningAlreadySetSmall:"snapshoturl ist in der [timelapse] Sektion",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",NoWebcamFound:"Keine Webcam verfügbar",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.",RulesBetweenMinMax:"Der Wert muss zwischen {min} und {max} sein!",RulesMin:"Der Wert muss mindestens {min} sein!",RulesPositive:"Der Wert muss positiv sein!",RulesRequired:"Der Wert ist erforderlich!",RulesZeroAndPositive:"Der Wert muss 0 oder größer sein!",SaveFrames:"Bilder speichern",SaveFramesDescription:"Speichern der Bilder in einer Zip-Datei für externes Rendern",SelectWebcam:"Webcam wählen...",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.',ConfirmOnCoolDown:"Bestätigung für Abkühlen erforderlich",ConfirmOnCoolDownDescription:"Zeige vor dem Abkühlen einen Bestätigungsdialog.",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.",Mode:"Modus",ModeDescription:"Ändert das allgemeine Aussehen der Anwendung.",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",PrintstatusThumbnailZoom:"Großes-Vorschaubild Vergrößerung",PrintstatusThumbnailZoomDescription:"Dadurch wird der Vergrößerungseffekt des Vorschaubildes im Statusfenster deaktiviert.",ProgressAsFavicon:"Fortschritt als Favicon anzeigen",ProgressAsFaviconDescription:"Ändere das Mainsail-Logo-Favicon in einen Fortschrittskreis.",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)"}},v={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"},A="Deutsch",z={App:e,BedScrews:n,ConnectionDialog:t,Console:r,CoolDownDialog:i,DevicesDialog:a,Dialogs:s,Editor:o,EmergencyStopDialog:l,Files:u,FullscreenUpload:d,GCodeViewer:c,Heightmap:g,History:m,JobQueue:h,Machine:p,ManualProbe:f,Panels:D,PowerDeviceChangeDialog:b,Router:k,ScrewsTiltAdjust:S,SelectPrinterDialog:w,Settings:C,Timelapse:v,title:A};export{e as App,n as BedScrews,t as ConnectionDialog,r as Console,i as CoolDownDialog,a as DevicesDialog,s as Dialogs,o as Editor,l as EmergencyStopDialog,u as Files,d as FullscreenUpload,c as GCodeViewer,g as Heightmap,m as History,h as JobQueue,p as Machine,f as ManualProbe,D as Panels,b as PowerDeviceChangeDialog,k as Router,S as ScrewsTiltAdjust,w as SelectPrinterDialog,C as Settings,v as Timelapse,z as default,A as title}; diff --git a/assets/echarts-ff51454d.js b/assets/echarts-ff51454d.js new file mode 100644 index 0000000..8bea11b --- /dev/null +++ b/assets/echarts-ff51454d.js @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +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 Gu=function(r,t){return Gu=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])},Gu(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");Gu(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function RR(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 ER(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 kR(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"||navigator.userAgent.indexOf("Node.js")===0?(li.node=!0,li.svgSupported=!0):R1(navigator.userAgent,li);function R1(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 tt=li;var ih=12,Ng="sans-serif",Or=ih+"px "+Ng,E1=20,k1=100,O1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function N1(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 sS(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?Cv(s,o):Cv(o,s))}function Ug(r){return r.nodeName.toUpperCase()==="CANVAS"}var lS=/([&<>"'])/g,uS={"&":"&","<":"<",">":">",'"':""","'":"'"};function ne(r){return r==null?"":(r+"").replace(lS,function(t,e){return uS[e]})}var fS=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,dl=[],hS=tt.browser.firefox&&+tt.browser.version.split(".")[0]<39;function Zu(r,t,e,i){return e=e||{},i?Av(r,t,e):hS&&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):Av(r,t,e),e}function Av(r,t,e){if(tt.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(Ug(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(Xu(dl,r,i,n)){e.zrX=dl[0],e.zrY=dl[1];return}}e.zrX=e.zrY=0}function lh(r){return r||window.event}function he(r,t,e){if(t=lh(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&&Zu(r,o,t,e)}else{Zu(r,t,t,e);var a=vS(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&fS.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function vS(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 cS(r,t,e,i){r.addEventListener(t,e,i)}function dS(r,t,e,i){r.removeEventListener(t,e,i)}var va=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0},pS=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=Lv(i)/Lv(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=gS(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function rn(){return[1,0,0,1,0,0]}function uh(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function yS(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 nn(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 qu(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 fh(r,t,e,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(e),h=Math.cos(e);return r[0]=n*h+s*f,r[1]=-n*f+s*h,r[2]=a*h+l*f,r[3]=-a*f+h*l,r[4]=h*(o-i[0])+f*(u-i[1])+i[0],r[5]=h*(u-i[1])-f*(o-i[0])+i[1],r}function mS(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 _S=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 q=_S;var Wa=Math.min,Ua=Math.max,Fr=new q,Vr=new q,zr=new q,Hr=new q,xn=new q,bn=new q,SS=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=Wa(t.x,this.x),i=Wa(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ua(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ua(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=rn();return qu(a,a,[-e.x,-e.y]),mS(a,a,[i,n]),qu(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=Wa(Fr.x,Vr.x,zr.x,Hr.x),t.y=Wa(Fr.y,Vr.y,zr.y,Hr.y);var l=Ua(Fr.x,Vr.x,zr.x,Hr.x),u=Ua(Fr.y,Vr.y,zr.y,Hr.y);t.width=l-t.x,t.height=u-t.y},r}();const at=SS;var $g="silent";function wS(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:xS}}function xS(){va(this.event)}var bS=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),Tn=function(){function r(t,e){this.x=t,this.y=e}return r}(),TS=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],gl=new at(0,0,0,0),Yg=function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this)||this;return s._hovered=new Tn(0,0),s.storage=e,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new bS,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new rS(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(D(TS,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=Xg(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 Tn(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 Tn(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=wS(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 Tn(e,i);if(Iv(a,o,e,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new at(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 MS(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?$g:!0}return!1}function Iv(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=MS(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==$g)){t.target=o;break}}}function Xg(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}const CS=Yg;var Zg=32,Mn=7;function DS(r){for(var t=0;r>=Zg;)t|=r&1,r>>=1;return r+t}function Pv(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 AS(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 LS(r,t){var e=Mn,i,n,a=0,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]=Mn||b>=Mn);if(T)break;x<0&&(x=0),x+=2}if(e=x,e<1&&(e=1),d===1){for(y=0;y=0;y--)r[w+y]=r[x+y];r[S]=o[_];return}for(var b=e;;){var T=0,C=0,A=!1;do if(t(o[_],r[m])<0){if(r[S--]=r[m--],T++,C=0,--d===0){A=!0;break}}else if(r[S--]=o[_--],C++,T=0,--p===1){A=!0;break}while((T|C)=0;y--)r[w+y]=r[x+y];if(d===0){A=!0;break}}if(r[S--]=o[_--],--p===1){A=!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,x=_+1,y=0;y=Mn||C>=Mn);if(A)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),p===1){for(S-=d,m-=d,w=S+1,x=m+1,y=d-1;y>=0;y--)r[w+y]=r[x+y];r[S]=o[_]}else{if(p===0)throw new Error;for(x=S-(p-1),y=0;ys&&(l=s),Rv(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 ae=1,Un=2,Yi=4,Ev=!1;function _l(){Ev||(Ev=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function kv(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var IS=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=kv}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 PS=IS;var qg;qg=tt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};const Ku=qg;var Oo={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-Oo.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?Oo.bounceIn(r*2)*.5:Oo.bounceOut(r*2-1)*.5+.5}};const Kg=Oo;var $a=Math.pow,Er=Math.sqrt,Jo=1e-8,Qg=1e-4,Ov=Er(3),Ya=1/3,Ue=yn(),de=yn(),an=yn();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 Nv(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?_=-$a(-_,Ya):_=$a(_,Ya),S<0?S=-$a(-S,Ya):S=$a(S,Ya);var d=(-s-(_+S))/(3*o);d>=0&&d<=1&&(a[v++]=d)}else{var x=(2*f*s-3*o*h)/(2*Er(f*f*f)),w=Math.acos(x)/3,b=Er(f),T=Math.cos(w),d=(-s-2*b*T)/(3*o),y=(-s+b*(T+Ov*Math.sin(w)))/(3*o),C=(-s+b*(T-Ov*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 jg(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(Jg(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 ty(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 ey(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 ry(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 NS=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=Z(t)?t:Kg[t]||hh(t)},r}();const BS=NS;var iy=function(){function r(t){this.value=t}return r}(),FS=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new iy(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}(),VS=function(){function r(t){this._list=new FS,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 iy(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 Ra=VS;var Fv={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 zS(r){return r=Math.round(r),r<0?0:r>360?360:r}function ca(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)==="%"?ca(parseFloat(t)/100):ca(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 Qu(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var ny=new Ra(20),Xa=null;function Pi(r,t){Xa&&Qu(Xa,t),Xa=ny.put(r,Xa||t.slice())}function oe(r,t){if(r){t=t||[];var e=ny.get(r);if(e)return Qu(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in Fv)return Qu(t,Fv[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]),Ju(u,t),Pi(r,t),t;case"hsl":if(u.length!==3){fe(t,0,0,0,1);return}return Ju(u,t),Pi(r,t),t;default:return}}fe(t,0,0,0,1)}}function Ju(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 HS(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 Vv(r,t){var e=oe(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 xl(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]=ca(Ir(o[3],s[3],l)),e}}function GS(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=oe(t[n]),s=oe(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)),ca(Ir(o[3],s[3],l))],"rgba");return e?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function bl(r,t,e,i){var n=oe(r);if(r)return n=HS(n),t!=null&&(n[0]=zS(t)),e!=null&&(n[1]=gi(e)),i!=null&&(n[2]=gi(i)),cr(Ju(n),"rgba")}function WS(r,t){var e=oe(r);if(e&&t!=null)return e[3]=ca(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=oe(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}var zv=new Ra(100);function ju(r){if(H(r)){var t=zv.get(r);return t||(t=Vv(r,-.1),zv.put(r,t)),t}else if(Rs(r)){var e=O({},r);return e.colorStops=G(r.colorStops,function(i){return{offset:i.offset,color:Vv(i.color,-.1)}}),e}return r}var is=Math.round;function da(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=oe(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t==null?1:t}}var Hv=1e-4;function Pr(r){return r-Hv}function Za(r){return is(r*1e3)/1e3}function tf(r){return is(r*1e4)/1e4}function US(r){return"matrix("+Za(r[0])+","+Za(r[1])+","+Za(r[2])+","+Za(r[3])+","+tf(r[4])+","+tf(r[5])+")"}var $S={left:"start",right:"end",center:"middle",middle:"middle"};function YS(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function XS(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function ZS(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 ay(r){return r&&!!r.image}function qS(r){return r&&!!r.svgElement}function vh(r){return ay(r)||qS(r)}function oy(r){return r.type==="linear"}function sy(r){return r.type==="radial"}function ly(r){return r&&(r.type==="linear"||r.type==="radial")}function Os(r){return"url(#"+r+")"}function uy(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 fy(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*Eo,n=X(r.scaleX,1),a=X(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*Eo)+"deg, "+is(s*Eo)+"deg)"),l.join(" ")}var KS=function(){return tt.hasGlobalWindow&&Z(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}}(),ef=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=Wv,l=e;if(ee(e)){var u=tw(e);s=u,(u===1&&!ct(e[0])||u===2&&!ct(e[0][0]))&&(o=!0)}else if(ct(e)&&!Ko(e))s=Ka;else if(H(e))if(!isNaN(+e))s=Ka;else{var f=oe(e);f&&(l=f,s=$n)}else if(Rs(e)){var h=O({},l);h.colorStops=G(e.colorStops,function(v){return{offset:v.offset,color:oe(v.color)}}),oy(e)?s=rf:sy(e)&&(s=nf),l=h}a===0?this.valType=s:(s!==this.valType||s===Wv)&&(o=!0),this.discrete=this.discrete||o;var c={time:t,value:l,rawValue:e,percent:0};return i&&(c.easing=i,c.easingFunc=Z(i)?i:Kg[i]||hh(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=Qa(n),u=Uv(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?Cn:t[l];if((Qa(a)||u)&&!m&&(m=this._additiveValue=[]),this.discrete)t[l]=y<1?v.rawValue:d.rawValue;else if(Qa(a))a===Fo?Tl(m,v[n],d[n],y):QS(m,v[n],d[n],y);else if(Uv(a)){var _=v[n],S=d[n],x=a===rf;t[l]={type:x?"linear":"radial",x:lr(_.x,S.x,y),y:lr(_.y,S.y,y),colorStops:G(_.colorStops,function(b,T){var C=S.colorStops[T];return{offset:lr(b.offset,C.offset,y),color:Bo(Tl([],b.color,C.color,y))}}),global:S.global},x?(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===Ka?t[i]=t[i]+n:e===$n?(oe(t[i],Cn),qa(Cn,Cn,n,1),t[i]=Bo(Cn)):e===Fo?qa(t[i],t[i],n,1):e===hy&&Gv(t[i],t[i],n,1)},r}(),rw=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){oh("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,it(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,No(u),n),this._trackKeys.push(s)}l.addKeyframe(t,No(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 ch=rw;function Qi(){return new Date().getTime()}var iw=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&&(Ku(i),!e._paused&&e.update())}Ku(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 ch(e,i.loop);return this.addAnimator(n),n},t}(rr);const nw=iw;var aw=300,Ml=tt.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=G(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}}(),$v={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Yv=!1;function af(r){var t=r.pointerType;return t==="pen"||t==="touch"}function ow(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 sw(r,t){return he(r.dom,new lw(r,t),!0)}function vy(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 lw=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;vy(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Yv=!0,r=he(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Yv||(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.__lastTouchMomentqv||r<-qv}var Wr=[],Ri=[],Ll=rn(),Il=Math.abs,dw=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&&(Zv(i),this.invTransform=null);return}i=i||rn(),e?this.getLocalTransform(i):Zv(i),t&&(e?nn(i,t,i):yS(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||rn(),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&&(t.invTransform=t.invTransform||rn(),nn(Ri,t.invTransform,e),e=Ri);var i=this.originX,n=this.originY;(i||n)&&(Ll[4]=i,Ll[5]=n,nn(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){dy(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&&fh(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}(),pa=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function dy(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=pa.concat(["ignore"]),pw=Nr(pa,function(r,t){return r[t]=!0,r},{ignore:!1}),Ei={},gw=new at(0,0,0,0),ph=function(){function r(t){this.id=Vg(),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=gw;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|=ae,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()?uf:lf},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&oe(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||{},O(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(W(t))for(var i=t,n=it(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){oh("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&=~ae),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&=~ae)}},r.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},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,A=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){A={};for(var S=0;S<_;S++){var y=g[S];A[y]=No(e[y]),mw(e,i,y)}}var x=new ch(e,!1,!1,h?At(d,function(L){return L.targetName===t}):null);x.targetName=t,n.scope&&(x.scope=n.scope),c&&T&&x.whenWithKeys(0,T,g),A&&x.whenWithKeys(0,A,g),x.whenWithKeys(u==null?500:u,s?C:i,g).delay(f||0),r.addAnimator(x,t),o.push(x)}}const gy=ph;var yy=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._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){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 H(r)?Dw(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),_y),r=(+r).toFixed(t),e?r:+r}function Sy(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 Aw(r)}function Aw(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 Lw(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 Iw(r,t){var e=Nr(r,function(v,d){return v+(isNaN(d)?0:d)},0);if(e===0)return[];for(var i=Math.pow(10,t),n=G(r,function(v){return(isNaN(v)?0:v)/e*i*100}),a=i*100,o=G(n,function(v){return Math.floor(v)}),s=Nr(o,function(v,d){return v+d},0),l=G(n,function(v,d){return v-o[d]});su&&(u=l[h],f=h);++o[f],l[f]=0,++s}return G(o,function(v){return v/i})}function Pw(r,t){var e=Math.max(ur(r),ur(t)),i=r+t;return e>_y?i:Tt(i,e)}function wy(r){var t=Math.PI*2;return(r%t+t)%t}function os(r){return r>-jv&&r=10&&t++,t}function xy(r,t){var e=gh(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 tc(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 nx=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],ax=ya(nx),ox=function(){function r(){}return r.prototype.getAreaStyle=function(t,e){return ax(this,t,e)},r}(),vf=new Ra(50);function sx(r){if(typeof r=="string"){var t=vf.get(r);return t&&t.image}else return r}function Sh(r,t,e,i,n){if(r)if(typeof r=="string"){if(t&&t.__zrImageSrc===r||!e)return t;var a=vf.get(r),o={hostEl:e,cb:i,cbPayload:n};return a?(t=a.image,!Vs(t)&&a.pending.push(o)):(t=gn.loadImage(r,nc,nc),t.__zrImageSrc=r,vf.put(r,t.__cachedImgObj={image:t,pending:[o]})),t}else return r;else return t}function nc(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var u=se(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 Ry(r,t){var e=t.containerWidth,i=t.font,n=t.contentWidth;if(!e)return"";var a=se(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?ux(r,n,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=se(r,i)}return r===""&&(r=t.placeholder),r}function ux(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=Py(f,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),p=0;ps&&Bl(e,r.substring(s,u),t,o),Bl(e,l[2],t,o,l[1]),s=Nl.lastIndex}sn){x>0?(m.tokens=m.tokens.slice(0,x),p(m,S,_),e.lines=e.lines.slice(0,y+1)):e.lines=e.lines.slice(0,y);break t}var L=b.width,I=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")w.percentWidth=L,f.push(w),w.contentWidth=se(w.text,A);else{if(I){var P=b.backgroundColor,R=P&&P.image;R&&(R=sx(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=Ey(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 px=Nr(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function gx(r){return dx(r)?!!px[r]:!0}function Ey(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 cf="__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[cf]=!0;var oc=["z","z2","invisible"],yx=["invisible"],mx=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=it(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,l[0]=r+e,l[1]=t+i;return}if(Ja[0]=Hl(n)*e+r,Ja[1]=zl(n)*i+t,ja[0]=Hl(a)*e+r,ja[1]=zl(a)*i+t,u(s,Ja,ja),f(l,Ja,ja),n=n%$r,n<0&&(n=n+$r),a=a%$r,a<0&&(a=a+$r),n>a&&!o?a+=$r:nn&&(to[0]=Hl(v)*e+r,to[1]=zl(v)*i+t,u(s,to,s),f(l,to,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,df=Math.PI,Dr=df*2,Ul=typeof Float32Array<"u",Dn=[];function $l(r){var t=Math.round(r/df*1e8)/1e8;return t%2*df}function ky(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(),Dn[0]=n,Dn[1]=a,ky(Dn,o),n=Dn[0],a=Dn[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++],x=t[c++],p=t[c++],y=t[c++],w=t[c++],b=t[c++];g=RS(a,o,S,x,p,y,w,b,10),a=w,o=b;break}case ut.Q:{var S=t[c++],x=t[c++],p=t[c++],y=t[c++];g=kS(a,o,S,x,p,y,10),a=p,o=y;break}case ut.A:var T=t[c++],C=t[c++],A=t[c++],M=t[c++],L=t[c++],I=t[c++],P=I+L;c+=1,d&&(s=Zr(L)*A+T,l=qr(L)*M+C),g=Wl(A,M)*Gl(Dr,Math.abs(I)),a=Zr(P)*A+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,x;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,x),_=0),b){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),A=or(c-f);if(C>n||A>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+A*A;I>_&&(S=h,x=c,_=I)}break}case ut.C:{var P=i[w++],R=i[w++],E=i[w++],z=i[w++],k=i[w++],N=i[w++];if(v){var M=d[y++];if(p+M>m){var L=(m-p)/M;ts(u,P,E,k,L,Yr),ts(f,R,z,N,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,z,k,N),u=k,f=N;break}case ut.Q:{var P=i[w++],R=i[w++],E=i[w++],z=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,z,L,Xr),t.quadraticCurveTo(Yr[1],Xr[1],Yr[2],Xr[2]);break t}p+=M}t.quadraticCurveTo(P,R,E,z),u=E,f=z;break}case ut.A:var V=i[w++],U=i[w++],Y=i[w++],Q=i[w++],nt=i[w++],wt=i[w++],vt=i[w++],Nt=!i[w++],Pt=Y>Q?Y:Q,mt=or(Y-Q)>.001,gt=nt+wt,$=!1;if(v){var M=d[y++];p+M>m&&(gt=nt+wt*(m-p)/M,$=!0),p+=M}if(mt&&t.ellipse?t.ellipse(V,U,Y,Q,vt,nt,gt,Nt):t.arc(V,U,Pt,nt,gt,Nt),$)break t;T&&(s=Zr(nt)*Y+V,l=qr(nt)*Q+U),u=Zr(gt)*Y+V,f=qr(gt)*Q+U;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}();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+=An);var c=Math.atan2(l,s);return c<0&&(c+=An),c>=i&&c<=n||c+An>=i&&c+An<=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,Dx=1e-4;function Ax(r,t){return Math.abs(r-t)t&&u>i&&u>a&&u>s||u1&&Lx(),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(Tx(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=Ix(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(Mx(l,u,a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=Px(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++],x=a[d++],w=a[d++];d+=1;var b=!!(1-a[d++]);c=Math.cos(x)*_+y,v=Math.sin(x)*S+m,p?(f=c,h=v):s+=Kr(l,u,c,v,i,n);var T=(i-y)*S/_+y;if(e){if(Cx(y,m,S,x,x+w,b,t,T,n))return!0}else s+=Rx(y,m,S,x,x+w,b,T,n);l=Math.cos(x+w)*_+y,u=Math.sin(x+w)*S+m;break;case Sr.R:f=l=a[d++],h=u=a[d++];var C=a[d++],A=a[d++];if(c=f+C,v=h+A,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&&!Ax(u,h)&&(s+=Kr(l,u,f,h,i,n)||0),s!==0}function Ex(r,t,e){return Oy(r,0,!1,t,e)}function kx(r,t,e,i){return Oy(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),Ox={style:st({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},zs.style)},Yl=pa.concat(["invisible","culling","z","z2","zlevel","parent"]),Nx=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?lf:i>.2?cw:uf}else if(e)return uf}return lf},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(H(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)),kx(s,l/u,e,i)))return!0}if(this.hasFill())return Ex(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:O(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=O({},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=O({},n.shape),O(u,i.shape)):(u=O({},a?this.shape:n.shape),O(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=O({},this.shape);for(var f={},h=it(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(Bx,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=dh(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}(Oa);Ny.prototype.type="tspan";const us=Ny;var Fx=st({x:0,y:0},yi),Vx={style:st({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},zs.style)};function zx(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var By=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return Es(Fx,e)},t.prototype._getSize=function(e){var i=this.style,n=i[e];if(n!=null)return n;var a=zx(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 Vx},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new at(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Oa);By.prototype.type="image";const ir=By;function Hx(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 Fy(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 Vy(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 Gx=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Wx={},zy=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Gx},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=Vy(Wx,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?Hx(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(lt);zy.prototype.type="rect";const Mt=zy;var hc={fill:"#000"},vc=2,Ux={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)},Hy=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=hc,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;A<=I;)P=w[A],this._placeToken(P,e,T,y,M+P.width/2,"center",_),M+=P.width,A++;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=mc(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=yc("fill"in u?u.fill:"fill"in i?i.fill:(m=!0,y.fill)),x=gc("stroke"in u?u.stroke:"stroke"in i?i.stroke:!v&&!l&&(!y.autoStroke||m)?(_=vc,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=jn(u.opacity,i.opacity,1),dc(p,u),x&&(p.lineWidth=jn(u.lineWidth,i.lineWidth,_),p.lineDash=X(u.lineDash,i.lineDash),p.lineDashOffset=i.lineDashOffset||0,p.stroke=x),S&&(p.fill=S);var b=e.contentWidth,T=e.contentHeight;g.setBoundingRect(new at(Yn(p.x,b,p.textAlign),Xi(p.y,T,p.textBaseline),b,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=X(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=X(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=jn(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Wy(e)&&(i=[e.fontStyle,e.fontWeight,Gy(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&Ye(i)||e.textFont||e.font},t}(Oa),$x={left:!0,right:1,center:1},Yx={top:1,bottom:1,middle:1},cc=["fontStyle","fontWeight","fontSize","fontFamily"];function Gy(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?ih+"px":r+"px"}function dc(r,t){for(var e=0;e=0,a=!1;if(r instanceof lt){var o=Uy(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=O({},i),u=O({},u),u.fill=s):!Oi(u.fill)&&Oi(s)?(a=!0,i=O({},i),u=O({},u),u.fill=ju(s)):!Oi(u.stroke)&&Oi(l)&&(a||(i=O({},i),u=O({},u)),u.stroke=ju(l)),i.style=u}}if(i&&i.z2==null){a||(i=O({},i));var f=r.z2EmphasisLift;i.z2=r.z2+(f!=null?f:qx)}return i}function eb(r,t,e){if(e&&e.z2==null){e=O({},e);var i=r.z2SelectLift;e.z2=r.z2+(i!=null?i:Kx)}return e}function rb(r,t,e){var i=ft(r.currentStates,t)>=0,n=r.style.opacity,a=i?null:jx(r,["opacity"],t,{opacity:1});e=e||{};var o=e.style||{};return o.opacity==null&&(e=O({},e),o=O({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 tb(this,r,t,e);if(r==="blur")return rb(this,r,e);if(r==="select")return eb(this,r,e)}return e}function ib(r){r.stateProxy=Zl;var t=r.getTextContent(),e=r.getTextGuideLine();t&&(t.stateProxy=Zl),e&&(e.stateProxy=Zl)}function Tc(r,t){!Qy(r,t)&&!r.__highByOuter&&gr(r,$y)}function Mc(r,t){!Qy(r,t)&&!r.__highByOuter&&gr(r,Yy)}function hs(r,t){r.__highByOuter|=1<<(t||0),gr(r,$y)}function vs(r,t){!(r.__highByOuter&=~(1<<(t||0)))&&gr(r,Yy)}function nb(r){gr(r,bh)}function Zy(r){gr(r,Xy)}function qy(r){gr(r,Qx)}function Ky(r){gr(r,Jx)}function Qy(r,t){return r.__highDownSilentOnTouch&&t.zrByTouch}function Jy(r){var t=r.getModel(),e=[],i=[];t.eachComponent(function(n,a){var o=wh(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){Xy(u)}),s&&e.push(a)),o.isBlured=!1}),D(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(e,!1,t)})}function pf(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 yf(r,t,e){Mh(r,!0),gr(r,ib),hb(r,t,e)}function fb(r){Mh(r,!1)}function ma(r,t,e,i){i?fb(r):yf(r,t,e)}function hb(r,t,e){var i=rt(r);t!=null?(i.focus=t,i.blurScope=e):i.focus&&(i.focus=null)}var Dc=["emphasis","blur","select"],vb={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+ro(h)*p-eo(h)*y,_=(t+i)/2+eo(h)*p+ro(h)*y,S=Pc([1,0],[(c-p)/o,(v-y)/s]),x=[(c-p)/o,(v-y)/s],w=[(-1*c-p)/o,(-1*v-y)/s],b=Pc(x,w);if(Sf(x,w)<=-1&&(b=Ln),Sf(x,w)>=1&&(b=0),b<0){var T=Math.round(b/Ln*1e6)/1e6;b=Ln*2+T%2*Ln}f.addData(u,m,_,o,s,S,b,h,a)}var mb=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,_b=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Sb(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(mb);if(!l)return t;for(var u=0;uP*P+R*R&&(T=A,C=M),{cx:T,cy:C,x0:-f,y0:-h,x1:T*(n/x-1),y1:C*(n/x-1)}}function Ab(r){var t;if(F(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 Lb(r,t){var e,i=Xn(t.r,0),n=Xn(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=Ec(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*Bi(l),h+i*Jr(l)),r.arc(f,h,i,l,u,!c),n>Ce&&(r.moveTo(f+n*Bi(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,x=void 0,w=void 0,b=void 0,T=void 0,C=void 0,A=void 0,M=void 0,L=void 0,I=void 0,P=void 0,R=i*Bi(l),E=i*Jr(l),z=n*Bi(u),k=n*Jr(u),N=v>Ce;if(N){var V=t.cornerRadius;V&&(e=Ab(V),g=e[0],p=e[1],y=e[2],m=e[3]);var U=Ec(i-n)/2;if(_=He(U,y),S=He(U,m),x=He(U,g),w=He(U,p),C=b=Xn(_,S),A=T=Xn(x,w),(b>Ce||T>Ce)&&(M=i*Bi(u),L=i*Jr(u),I=n*Bi(l),P=n*Jr(l),vCe){var mt=He(y,C),gt=He(m,C),$=io(I,P,R,E,i,mt,c),J=io(M,L,z,k,i,gt,c);r.moveTo(f+$.cx+$.x0,h+$.cy+$.y0),C0&&r.arc(f+$.cx,h+$.cy,mt,Bt($.y0,$.x0),Bt($.y1,$.x1),!c),r.arc(f,h,i,Bt($.cy+$.y1,$.cx+$.x1),Bt(J.cy+J.y1,J.cx+J.x1),!c),gt>0&&r.arc(f+J.cx,h+J.cy,gt,Bt(J.y1,J.x1),Bt(J.y0,J.x0),!c))}else r.moveTo(f+R,h+E),r.arc(f,h,i,l,u,!c);if(!(n>Ce)||!N)r.lineTo(f+z,h+k);else if(A>Ce){var mt=He(g,A),gt=He(p,A),$=io(z,k,M,L,n,-gt,c),J=io(R,E,I,P,n,-mt,c);r.lineTo(f+$.cx+$.x0,h+$.cy+$.y0),A0&&r.arc(f+$.cx,h+$.cy,gt,Bt($.y0,$.x0),Bt($.y1,$.x1),!c),r.arc(f,h,n,Bt($.cy+$.y1,$.cx+$.x1),Bt(J.cy+J.y1,J.cx+J.x1),c),mt>0&&r.arc(f+J.cx,h+J.cy,mt,Bt(J.y1,J.x1),Bt(J.y0,J.x0),!c))}else r.lineTo(f+z,h+k),r.arc(f,h,n,u,l,c)}r.closePath()}}}var Ib=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}(),om=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Ib},t.prototype.buildPath=function(e,i){Lb(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(lt);om.prototype.type="sector";const Ci=om;var Pb=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),sm=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Pb},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);sm.prototype.type="ring";const lm=sm;function Rb(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=Rb(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){Ih("update",r,t,e,i,n,a)}function Xt(r,t,e,i,n,a){Ih("enter",r,t,e,i,n,a)}function on(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 Nc(r){return!r.isGroup}function iT(r){return r.shape!=null}function xm(r,t,e){if(!r||!t)return;function i(o){var s={};return o.traverse(function(l){Nc(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return iT(o)&&(s.shape=O({},o.shape)),s}var a=i(r);t.traverse(function(o){if(Nc(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Et(o,l,e,rt(o).dataIndex)}}})}function nT(r,t){return G(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 aT(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 Eh(r,t,e){var i=O({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)):Rh(r.replace("path://",""),i,e,"center")}function oT(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 sT(r){return r<=1e-6&&r>=-1e-6}function kh(r){var t=r.itemTooltipOption,e=r.componentModel,i=r.itemName,n=H(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&&D(it(l),function(f){cn(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=rt(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:st({content:i,formatterParams:s},n)}}function Bc(r,t){var e;r.isGroup&&(e=t(r)),e||r.traverse(t)}function $s(r,t){if(r)if(F(r))for(var e=0;e=0&&s.push(l)}),s}}function Zs(r,t){return ot(ot({},r,!0),t,!0)}const TT={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",custom:"Custom chart",chart:"Chart"}},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:". "}}}},MT={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:"旭日图",custom:"自定义图表",chart:"图表"}},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",Oh="EN",ln=Oh,Uo={},Nh={},Dm=tt.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ln).toUpperCase();return r.indexOf(_s)>-1?_s:ln}():ln;function Am(r,t){r=r.toUpperCase(),Nh[r]=new Rt(t),Uo[r]=t}function CT(r){if(H(r)){var t=Uo[r.toUpperCase()]||{};return r===_s||r===Oh?K(t):ot(K(t),K(Uo[ln]),!1)}else return ot(K(r),K(Uo[ln]),!1)}function DT(r){return Nh[r]}function AT(){return Nh[ln]}Am(Oh,TT);Am(_s,MT);var Bh=1e3,Fh=Bh*60,aa=Fh*60,ye=aa*24,Wc=ye*365,Zn={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}"},oo="{yyyy}-{MM}-{dd}",Uc={year:"{yyyy}",month:"{yyyy}-{MM}",day:oo,hour:oo+" "+Zn.hour,minute:oo+" "+Zn.minute,second:oo+" "+Zn.second,millisecond:Zn.none},tu=["year","month","day","hour","minute","second","millisecond"],Lm=["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 un(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 LT(r){return r===un(r)}function IT(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[Vh(e)](),o=n[fn(e)]()+1,s=Math.floor((o-1)/3)+1,l=n[Ks(e)](),u=n["get"+(e?"UTC":"")+"Day"](),f=n[Sa(e)](),h=(f-1)%12+1,c=n[Qs(e)](),v=n[Js(e)](),d=n[js(e)](),g=i instanceof Rt?i:DT(i||Dm)||AT(),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 PT(r,t,e,i,n){var a=null;if(H(e))a=e;else if(Z(e))a=e(r.value,t,{level:r.level});else{var o=O({},Zn);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(F(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 Im(r,t){var e=tr(r),i=e[fn(t)]()+1,n=e[Ks(t)](),a=e[Sa(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 $c(r,t,e){var i=ct(r)?tr(r):r;switch(t=t||Im(r,e),t){case"year":return i[Vh(e)]();case"half-year":return i[fn(e)]()>=6?1:0;case"quarter":return Math.floor((i[fn(e)]()+1)/4);case"month":return i[fn(e)]();case"day":return i[Ks(e)]();case"half-day":return i[Sa(e)]()/24;case"hour":return i[Sa(e)]();case"minute":return i[Qs(e)]();case"second":return i[Js(e)]();case"millisecond":return i[js(e)]()}}function Vh(r){return r?"getUTCFullYear":"getFullYear"}function fn(r){return r?"getUTCMonth":"getMonth"}function Ks(r){return r?"getUTCDate":"getDate"}function Sa(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 RT(r){return r?"setUTCFullYear":"setFullYear"}function Pm(r){return r?"setUTCMonth":"setMonth"}function Rm(r){return r?"setUTCDate":"setDate"}function Em(r){return r?"setUTCHours":"setHours"}function km(r){return r?"setUTCMinutes":"setMinutes"}function Om(r){return r?"setUTCSeconds":"setSeconds"}function Nm(r){return r?"setUTCMilliseconds":"setMilliseconds"}function Bm(r){if(!kw(r))return H(r)?r:"-";var t=(r+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Fm(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 Fa=zg;function bf(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 Wu(r)?n(r):ct(r)&&a(r)?r+"":"-";var u=ss(r);return a(u)?Bm(u):Wu(r)?n(r):typeof r=="boolean"?r+"":"-"}var Yc=["a","b","c","d","e","f","g"],eu=function(r,t){return"{"+r+(t==null?"":t)+"}"};function Vm(r,t,e){F(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 OR(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 bi(r,t){return t=t||"transparent",H(r)?r:W(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}var $o=D,kT=["left","right","top","bottom","width","height"],so=[["width","left","right"],["height","top","bottom"]];function zh(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 hn=zh;bt(zh,"vertical");bt(zh,"horizontal");function Ti(r,t,e){e=Fa(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 at(a+e[3],o+e[0],u,f);return d.margin=e,d}function OT(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 at(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 wa(r){var t=r.layoutMode||r.constructor.layoutMode;return W(t)?t:t?{type:t}:null}function dn(r,t,e){var i=e&&e.ignoreSize;!F(i)&&(i=[i,i]);var n=o(so[0],0),a=o(so[1],1);u(so[0],r,n),u(so[1],r,a);function o(f,h){var c={},v=0,d={},g=0,p=2;if($o(f,function(_){d[_]=r[_]}),$o(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=ot(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return ka(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);Iy(_n,Rt);Fs(_n);xT(_n);bT(_n,FT);function FT(r){var t=[];return D(_n.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=G(t,function(e){return Xe(e).main}),r!=="dataset"&&ft(t,"dataset")<=0&&t.unshift("dataset"),t}const pt=_n;var zm="";typeof navigator<"u"&&(zm=navigator.platform||"");var Fi="rgba(0, 0, 0, 0.2)";const VT={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:zm.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 Hm=j(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),we="original",ie="arrayRows",Be="objectRows",nr="keyedColumns",kr="typedArray",Gm="unknown",Ke="column",Sn="row",kt={Must:1,Might:2,Not:3},Wm=yt();function zT(r){Wm(r).datasetMap=j()}function HT(r,t,e){var i={},n=Hh(t);if(!n||!r)return i;var a=[],o=[],s=t.ecModel,l=Wm(s).datasetMap,u=n.uid+"_"+e.seriesLayoutBy,f,h;r=r.slice(),D(r,function(g,p){var y=W(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});D(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 XT(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:YT(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 ZT(r,t){t(r).paletteIdx=0,t(r).paletteNameMap={}}var lo,In,Zc,qc="\0_ec_inner",qT=1,Ym=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=Jc(i);this._optionManager.setOption(e,n,a),this._resetOption(null,a)},t.prototype.resetOption=function(e,i){return this._resetOption(e,Jc(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"?Zc(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&&D(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=j(),u=i&&i.replaceMergeMainTypeMap;zT(this),D(e,function(h,c){h!=null&&(pt.hasClass(c)?c&&(s.push(c),l.set(c,!0)):n[c]=n[c]==null?K(h):ot(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=$T(this,h,Ot(e[h])),v=a.get(h),d=v?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=Bw(v,c,d);Uw(g,h,pt),n[h]=null,a.set(h,null),o.set(h,0);var p=[],y=[],m=0,_;D(g,function(S,x){var w=S.existing,b=S.newOption;if(!b)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(b,this),w.optionUpdated(b,!1);else{var A=O({componentIndex:x},S.keyInfo);w=new C(b,this,this,A),O(w,A),S.brandNew&&(w.__requireNewView=!0),w.init(b,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"&&lo(this)}this._seriesIndices||lo(this)},t.prototype.getOption=function(){var e=K(this.option);return D(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]&&!ga(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,e[n]=a}}),delete e[qc],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 oM(r,t){return r.join(",")===t.join(",")}const sM=rM;var Te=D,xa=W,jc=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function iu(r){var t=r&&r.itemStyle;if(t)for(var e=0,i=jc.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=Pw(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||Gm,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};od=(t={},t[ie+"_"+Ke]={pure:!0,appendData:a},t[ie+"_"+Sn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Be]={pure:!0,appendData:a},t[nr]={pure:!0,appendData:function(o){var s=this._data;D(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 pn(this.getData(e),t)},r.prototype.formatTooltip=function(t,e,i){},r}();function fd(r){var t,e;return W(r)?r.type&&(e=r):t=r,{text:t,frag:e}}function oa(r){return new MM(r)}var MM=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}(),DM=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 Yo(t,e)},r}();function AM(r,t){var e=new DM,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)D(u,function(g,p){var y=g.name,m={index:p,name:y,displayName:g.displayName};if(s.push(m),y!=null){var _="";cn(l,y)&&Jt(_),l[y]=m}});else for(var f=0;f65535?NM:BM}function Vi(){return[1/0,-1/0]}function FM(r){var t=r.constructor;return t===Array?r.slice():new t(r)}function cd(r,t,e,i,n){var a=a0[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=G(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],x=t[n[1]][1],y=0;y=h&&m<=c||isNaN(m))&&(w>=S&&w<=x||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++]=b)}else for(var y=0;yt[A][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(Rn(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 Yo(e[a],this._dimensions[a])}ou={arrayRows:t,objectRows:function(e,i,n,a){return Yo(e[i],this._dimensions[a])},keyedColumns:t,original:function(e,i,n,a){var o=e&&(e.value==null?e:e.value);return Yo(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(e,i,n,a){return e[a]}}}(),r}(),o0=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(uo(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=re(s)?kr:we,a=[];var h=this._getSourceMetaRawOption()||{},c=u&&u.metaRawOption||{},v=X(h.seriesLayoutBy,c.seriesLayoutBy)||null,d=X(h.sourceHeader,c.sourceHeader),g=X(h.dimensions,c.dimensions),p=v!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||g;n=p?[Tf(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=[Tf(_,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&&pd(a)}var o,s=[],l=[];return D(t,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&pd(h),s.push(f),l.push(u._getVersionSign())}),i?o=kM(i,s,{datasetIndex:e.componentIndex}):n!=null&&(o=[yM(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 D(r.blocks,function(n){var a=f0(n);a>=t&&(t=a+ +(i&&(!a||Cf(n)&&!n.noHeader)))}),t}return 0}function HM(r,t,e,i){var n=t.noHeader,a=WM(f0(t)),o=[],s=t.blocks||[];_e(!s||F(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(cn(u,l)){var f=new CM(u[l],null);s.sort(function(d,g){return f.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}D(s,function(d,g){var p=t.valueFormatter,y=u0(d)(p?O(O({},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):Df(o.join(""),n?e:a.html);if(n)return h;var c=bf(t.header,"ordinal",r.useUTC),v=l0(i,r.renderMode).nameStyle;return r.renderMode==="richText"?h0(r,c,v)+a.richText+h:Df('
'+ne(c)+"
"+h,e)}function GM(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=F(S)?S:[S],G(S,function(x,w){return bf(x,F(v)?v[w]:v,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),c=a?"":bf(l,"ordinal",u),v=t.valueType,d=o?[]:f(t.value,t.dataIndex),g=!s||!a,p=!s&&a,y=l0(i,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":h)+(a?"":h0(r,c,m))+(o?"":YM(r,d,g,p,_)):Df((s?"":h)+(a?"":UM(c,!s,m))+(o?"":$M(d,g,p,_)),e)}}function gd(r,t,e,i,n,a){if(r){var o=u0(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function WM(r){return{html:VM[r],richText:zM[r]}}function Df(r,t){var e='
',i="margin: "+t+"px 0 0";return'
'+r+e+"
"}function UM(r,t,e){var i=t?"margin-left:2px":"";return''+ne(r)+""}function $M(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=F(r)?r:[r],''+G(r,function(o){return ne(o)}).join("  ")+""}function h0(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function YM(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(F(t)?t.join(" "):t,a)}function XM(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return bi(i)}function v0(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=by()}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=ET({color:e,type:t,renderMode:i,markerId:n});return H(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};F(e)?D(e,function(a){return O(i,a)}):O(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r}();function ZM(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=F(s),u=XM(t,e),f,h,c,v;if(o>1||l&&!o){var d=qM(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=pn(n,e,a[0]),h=g.type}else v=f=l?s[0]:s;var p=yh(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,dataIndex:e})].concat(c||[])})}function qM(r,t,e,i,n){var a=t.getData(),o=Nr(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?D(i,function(h){f(pn(a,e,h),h)}):D(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 fo(r,t){return r.getName(t)||r.getId(t)}var KM="__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=oa({count:JM,reset:jM}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=wr(this).sourceManager=new o0(this);a.prepareSource();var o=this.getInitialData(e,n);md(o,this),this.dataTask.context.data=o,wr(this).dataBeforeProcessed=o,yd(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=wa(this),a=n?tl(e):{},o=this.subType;pt.hasClass(o)&&(o+="Series"),ot(e,i.getTheme().get(this.subType)),ot(e,this.getDefaultOption()),hf(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&dn(e,a,n)},t.prototype.mergeOption=function(e,i){e=ot(this.option,e,!0),this.fillDataTextStyle(e.data);var n=wa(this);n&&dn(this.option,e,n);var a=wr(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(e,i);md(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,wr(this).dataBeforeProcessed=o,yd(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(e){if(e&&!re(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=Gh.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[fo(a,e)])&&!a.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[KM])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"){W(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,TM);Oe(nl,Gh);Iy(nl,pt);function yd(r){var t=r.name;yh(r)||(r.name=QM(r)||t)}function QM(r){var t=r.getRawData(),e=t.mapDimensionsAll("seriesName"),i=[];return D(e,function(n){var a=t.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function JM(r){return r.model.getRawData().count()}function jM(r){var t=r.model;return t.setData(t.getRawData().cloneShallow()),tC}function tC(r,t){t.outputData&&r.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function md(r,t){D(Z1(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(e){r.wrapMethod(e,bt(eC,t))})}function eC(r,t){var e=Af(r);return e&&e.setOutputEnd((t||this).count()),t}function Af(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 Br=nl;var Xh=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}();_h(Xh);Fs(Xh);const er=Xh;function Zh(){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 c0=yt(),rC=Zh(),qh=function(){function r(){this.group=new Ct,this.uid=Xs("viewChart"),this.renderTask=oa({plan:iC,reset:nC}),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&&Sd(a,n,"emphasis")},r.prototype.downplay=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&Sd(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){c0(t).updateMethod=e},r.protoInitialize=function(){var t=r.prototype;t.type="chart"}(),r}();function _d(r,t,e){r&&mf(r)&&(t==="emphasis"?hs:vs)(r,e)}function Sd(r,t,e){var i=wi(r,t),n=t&&t.highlightKey!=null?cb(t.highlightKey):null;i!=null?D(Ot(i),function(a){_d(r.getItemGraphicEl(a),e,n)}):r.eachItemGraphicEl(function(a){_d(a,e,n)})}_h(qh);Fs(qh);function iC(r){return rC(r.model)}function nC(r){var t=r.model,e=r.ecModel,i=r.api,n=r.payload,a=t.pipelineContext.progressiveRender,o=r.view,s=n&&c0(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,e,i,n),aC[l]}var aC={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=qh;var Ss="\0__throttleOriginMethod",wd="\0__throttleRate",xd="\0__throttleType";function Kh(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 d0(r,t,e,i){var n=r[t];if(n){var a=n[Ss]||n,o=n[xd],s=n[wd];if(s!==e||o!==i){if(e==null||!i)return r[t]=a;n=r[t]=Kh(a,e,i==="debounce"),n[Ss]=a,n[xd]=i,n[wd]=e}return n}}function Lf(r,t){var e=r[t];e&&e[Ss]&&(e.clear&&e.clear(),r[t]=e[Ss])}var bd=yt(),Td={itemStyle:ya(Cm,!0),lineStyle:ya(Mm,!0)},oC={lineStyle:"stroke",itemStyle:"fill"};function p0(r,t){var e=r.visualStyleMapper||Td[t];return e||(console.warn("Unknown style type '"+t+"'."),Td.itemStyle)}function g0(r,t){var e=r.visualDrawType||oC[t];return e||(console.warn("Unknown style type '"+t+"'."),"fill")}var sC={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=p0(r,i),o=a(n),s=n.getShallow("decal");s&&(e.setVisual("decal",s),s.dirty=!0);var l=g0(r,i),u=o[l],f=Z(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"||Z(o.fill)?c:o.fill,o.stroke=o.stroke==="auto"||Z(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=O({},o);p[l]=f(g),v.setItemVisual(d,"style",p)}}}},En=new Rt,lC={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!(r.ignoreStyleOnData||t.isSeriesFiltered(r))){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=p0(r,i),a=e.getVisual("drawType");return{dataEach:e.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){En.option=l[i];var u=n(En),f=o.ensureUniqueItemVisual(s,"style");O(f,u),En.option.decal&&(o.setItemVisual(s,"decal",En.option.decal),En.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},uC={performRawSeries:!0,overallReset:function(r){var t=j();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)),bd(e).scope=a}}),r.eachSeries(function(e){if(!(e.isColorBySeries()||r.isSeriesFiltered(e))){var i=e.getRawData(),n={},a=e.getData(),o=bd(e).scope,s=e.visualStyleAccessPath||"itemStyle",l=g0(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)}})}})}},ho=Math.PI;function fC(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 Ah({shape:{startAngle:-ho/2,endAngle:-ho/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:ho*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:ho*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 hC=function(){function r(t,e,i,n){this._stageTaskMap=j(),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=j();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;D(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;D(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=j(),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)||oa({plan:gC,reset:yC,count:_C}));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||oa({reset:vC});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=j(),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,D(i.getSeries(),d));function d(g){var p=g.uid,y=l.set(p,s&&s.get(p)||(c=!0,oa({reset:cC,onDirty:pC})));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 Z(t)&&(t={overallReset:t,seriesType:SC(t)}),t.uid=Xs("stageHandler"),e&&(t.visualType=e),t},r}();function vC(r){r.overallReset(r.ecModel,r.api,r.payload)}function cC(r){return r.overallProgress&&dC}function dC(){this.agent.dirty(),this.getDownstream().dirty()}function pC(){this.agent&&this.agent.dirty()}function gC(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function yC(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?G(t,function(e,i){return y0(i)}):mC}var mC=y0(0);function y0(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}(),If=["symbol","symbolSize","symbolRotate","symbolOffset"],Ad=If.concat(["symbolKeepAspect"]),TC={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 Rf(r,t,e){for(var i=t.type==="radial"?WC(r,t,e):GC(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:ct(r)?[r]:F(r)?r:null}function Qh(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&$C(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=G(e,function(a){return a/n}),i/=n)}return[e,i]}var YC=new dr(!0);function xs(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function Ld(r){return typeof r=="string"&&r!=="none"}function bs(r){var t=r.fill;return t!=null&&t!=="none"}function Id(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 Pd(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 Ef(r,t,e){var i=Sh(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)*Eo),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function XC(r,t,e,i){var n,a=xs(e),o=bs(e),s=e.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var f=t.path||YC,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,x=void 0,w=void 0;(d||g)&&(w=t.getBoundingRect()),d&&(m=h?Rf(r,c,w):t.__canvasFillGradient,t.__canvasFillGradient=m),g&&(_=h?Rf(r,v,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),p&&(S=h||!t.__canvasFillPattern?Ef(r,c,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(x=h||!t.__canvasStrokePattern?Ef(r,v,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),d?r.fillStyle=m:p&&(S?r.fillStyle=S:o=!1),g?r.strokeStyle=_:y&&(x?r.strokeStyle=x:a=!1)}var b=t.getGlobalScale();f.setScale(b[0],b[1],t.segmentIgnoreThreshold);var T,C;r.setLineDash&&e.lineDash&&(n=Qh(t),T=n[0],C=n[1]);var A=!0;(u||h&Yi)&&(f.setDPR(r.dpr),l?f.setContext(null):(f.setContext(r),A=!1),f.reset(),t.buildPath(f,t.shape,i),f.toStatic(),t.pathUpdated()),A&&f.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),i||(e.strokeFirst?(a&&Pd(r,e),o&&Id(r,e)):(o&&Id(r,e),a&&Pd(r,e))),T&&r.setLineDash([])}function ZC(r,t,e){var i=t.__image=Sh(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 qC(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=Qh(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(xs(e)&&r.strokeText(n,e.x,e.y),bs(e)&&r.fillText(n,e.x,e.y)):(bs(e)&&r.fillText(n,e.x,e.y),xs(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Rd=["shadowBlur","shadowOffsetX","shadowOffsetY"],Ed=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function M0(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(W(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 sM(this._api),u=this._theme,f=this._model=new Xm;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(e,{replaceMerge:o},Nf);var h={seriesTransition:s,optionChanged:!0};if(n)this[Qt]={silent:a,updateParams:h},this[Ft]=!1,this.getZr().wakeUp();else{try{Hi(this),xr.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,kn.call(this,a),On.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||tt.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(tt.svgSupported){var e=this._zr,i=e.storage.getDisplayList();return D(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;D(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 D(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(Zd[n]){var l=s,u=s,f=-s,h=-s,c=[],v=e&&e.pixelRatio||this.getDevicePixelRatio();D(la,function(_,S){if(_.group===n){var x=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(K(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:x,left:w.left,top:w.top})}}),l*=v,u*=v,f*=v,h*=v;var d=f-l,g=h-u,p=gn.createCanvas(),y=Jv(p,{renderer:i?"svg":"canvas"});if(y.resize({width:d,height:g}),i){var m="";return D(c,function(_){var S=_.left-l,x=_.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}})),D(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 D(o,function(s,l){l.indexOf("Models")>=0&&D(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?x0(s,l,i):b0(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;D(wD,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=rt(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=O({},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)}),D(sa,function(i,n){e._messageCenter.on(n,function(a){this.trigger(n,a)},e)}),D(["selectchanged"],function(i){e._messageCenter.on(i,function(n){this.trigger(i,n)},e)}),AC(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&&Dy(this.getDom(),tv,"");var i=this,n=i._api,a=i._model;D(i._componentsViews,function(o){o.dispose(a,n)}),D(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 la[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),xr.update.call(this,{type:"resize",animation:O({duration:0},e&&e.animation)})}catch(o){throw this[Ft]=!1,o}this[Ft]=!1,kn.call(this,a),On.call(this,a)}}},t.prototype.showLoading=function(e,i){if(this._disposed){this.id;return}if(W(e)&&(i=e,e=""),e=e||"default",this.hideLoading(),!!Bf[e]){var n=Bf[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=O({},e);return i.type=sa[e.type],i},t.prototype.dispatchAction=function(e,i){if(this._disposed){this.id;return}if(W(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&&tt.browser.weChat&&this._throttledZrFlush(),kn.call(this,n),On.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")&&!tt.node&&!tt.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(on(y))return;if(y instanceof lt&&db(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)}})}Yd=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){nb(d),le(h)},v.prototype.leaveBlur=function(d){Zy(d),le(h)},v.prototype.enterSelect=function(d){qy(d),le(h)},v.prototype.leaveSelect=function(d){Ky(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}(Zm))(h)},z0=function(h){function c(v,d){for(var g=0;g=0)){qd.push(e);var a=S0.wrapStageHandler(e,n);a.__prio=t,a.__raw=e,r.push(a)}}function Y0(r,t){Bf[r]=t}function AD(r,t,e){var i=oD("registerMap");i&&i(r,t,e)}var LD=EM;Ai(Jh,sC);Ai(al,lC);Ai(al,uC);Ai(Jh,TC);Ai(al,MC);Ai(k0,iD);U0(Km);$0(uD,pM);Y0("default",fC);wn({type:mi,event:mi,update:mi},Ht);wn({type:Ho,event:Ho,update:Ho},Ht);wn({type:ra,event:ra,update:ra},Ht);wn({type:Go,event:Go,update:Go},Ht);wn({type:ia,event:ia,update:ia},Ht);W0("light",wC);W0("dark",xC);function Nn(r){return r==null?0:r.length||1}function Kd(r){return r}var ID=function(){function r(t,e,i,n,a,o){this._old=t,this._new=e,this._oldKeyGetter=i||Kd,this._newKeyGetter=n||Kd,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 Bn=W,br=G,VD=typeof Int32Array>"u"?Array:Int32Array,zD="e\0\0",Qd=-1,HD=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],GD=["_approximateExtent"],Jd,yo,Fn,Vn,yu,mo,mu,WD=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;Z0(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),F(a)?a=a.slice():Bn(a)&&(a=O({},a)),n[e]=a),a},r.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,Bn(e)?O(n,e):n[e]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(t,e){Bn(t)?O(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?O(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;Zx(i,this.dataType,t,e),this._graphicEls[t]=e},r.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},r.prototype.eachItemGraphicEl=function(t,e){D(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:br(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];Z(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var n=i.apply(this,arguments);return e.apply(this,[n].concat(sh(arguments)))})},r.internalField=function(){Jd=function(t){var e=t._invertedIndicesMap;D(e,function(i,n){var a=t._dimInfos[n],o=a.ordinalMeta,s=t._store;if(o){i=e[n]=new VD(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),n[e]=l}}}(),r}();const J0=WD;function FR(r,t){return iv(r,t).dimensions}function iv(r,t){Wh(r)||(r=Uh(r)),t=t||{};var e=t.coordDimensions||[],i=t.dimensionsDefine||r.dimensionsDefine||[],n=j(),a=[],o=$D(r,e,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Q0(o),l=i===r.dimensionsDefine,u=l?K0(r):q0(i),f=t.encodeDefine;!f&&t.encodeDefaulter&&(f=t.encodeDefaulter(r,o));for(var h=j(f),c=new n0(o),v=0;v0&&(i.name=n+(a-1)),a++,t.set(n,a)}}function $D(r,t,e,i){var n=Math.max(r.dimensionsDetectedCount||1,t.length,e.length,i||0);return D(t,function(a){var o;W(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function YD(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 XD=function(){function r(t){this.coordSysDims=[],this.axisMap=j(),this.categoryAxisMap=j(),this.coordSysName=t}return r}();function ZD(r){var t=r.get("coordinateSystem"),e=new XD(t),i=qD[t];if(i)return i(r,e,e.axisMap,e.categoryAxisMap),e}var qD={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();D(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 j0(r,t,e){e=e||{};var i=e.byIndex,n=e.stackedCoordDimension,a,o,s;KD(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(r&&r.get("stack")),u,f,h,c;if(D(a,function(m,_){H(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;D(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 KD(r){return!Z0(r.schema)}function Mi(r,t){return!!t&&t===r.getCalculationInfo("stackedDimension")}function t_(r,t){return Mi(r,t)?r.getCalculationInfo("stackResultDimension"):t}function QD(r,t){var e=r.get("coordinateSystem"),i=el.get(e),n;return t&&t.coordSysDims&&(n=G(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=kD(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function JD(r,t,e){var i,n;return e&&D(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 nv(r,t,e){e=e||{};var i=t.getSourceManager(),n,a=!1;r?(a=!0,n=Uh(r)):(n=i.getSource(),a=n.sourceFormat===we);var o=ZD(t),s=QD(t,o),l=e.useEncodeDefaulter,u=Z(l)?l:l?bt(HT,s,t):null,f={coordDimensions:s,generateCoord:e.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=iv(n,f),c=JD(h.dimensions,e.createInvertedIndices,o),v=a?null:i.getSharedDataStore(h),d=j0(t,{schema:h,store:v}),g=new J0(h,t);g.setCalculationInfo(d);var p=c!=null&&jD(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 jD(r){if(r.sourceFormat===we){var t=tA(r.data||[]);return!F(Ea(t))}}function tA(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(e_);const yr=e_;var eA=0,rA=function(){function r(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++eA}return r.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&G(i,iA);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(!H(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=j(this.categories))},r}();function iA(r){return W(r)&&r.value!=null?r.value:r+""}const Ff=rA;function Vf(r){return r.type==="interval"||r.type==="log"}function nA(r,t,e,i){var n={},a=r[1]-r[0],o=n.interval=xy(a/t,!0);e!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=r_(o),l=n.niceTickExtent=[Tt(Math.ceil(r[0]/o)*o,s),Tt(Math.floor(r[1]/o)*o,s)];return aA(l,r),n}function _u(r){var t=Math.pow(10,gh(r)),e=r/t;return e?e===2?e=3:e===3?e=5:e*=2:e=1,Tt(e*t)}function r_(r){return ur(r)+2}function jd(r,t,e){r[t]=Math.max(Math.min(r[t],e[1]),e[0])}function aA(r,t){!isFinite(r[0])&&(r[0]=t[0]),!isFinite(r[1])&&(r[1]=t[1]),jd(r,0,t),jd(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 i_=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 Ff({})),F(n)&&(n=new Ff({categories:G(n,function(a){return W(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:H(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(i_);const n_=i_;var ni=Tt,a_=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=r_(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 l_(r){var t=lA(r),e=[];return D(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")||(f_(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:ov(a),stackId:av(i)})}),uA(e)}function uA(r){var t={};D(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 D(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=it(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),D(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;D(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;D(a,function(y,m){e[n][m]=e[n][m]||{bandWidth:o,offset:p,width:y.width},p+=y.width*(1+f)})}),e}function fA(r,t,e){if(r&&t){var i=r[ov(t)];return i!=null&&e!=null?i[av(e)]:i}}function hA(r,t){var e=s_(r,t),i=l_(e);D(e,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=av(n),u=i[ov(s)][l],f=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:f,size:h})})}function vA(r){return{seriesType:r,plan:Zh(),reset:function(t){if(u_(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=cA(n,a),d=f_(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 x=_.count,w=d&&hr(x*3),b=d&&l&&hr(x*3),T=d&&hr(x),C=i.master.getRect(),A=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,z=void 0;h&&(z=+P-L.get(o,M));var k=void 0,N=void 0,V=void 0,U=void 0;if(c){var Y=i.dataToPoint([P,R]);if(h){var Q=i.dataToPoint([z,R]);E=Q[0]}k=E,N=Y[1]+m,V=Y[0]-E,U=y,Math.abs(V)>>1;r[n][1]n&&(this._approxInterval=n);var s=_o.length,l=Math.min(dA(_o,this._approxInterval,0,s),s-1);this._interval=_o[l][1],this._minLevelUnit=_o[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}(Va),_o=[["second",Bh],["minute",Fh],["hour",aa],["quarter-day",aa*6],["half-day",aa*12],["day",ye*1.2],["half-week",ye*3.5],["week",ye*7],["month",ye*31],["quarter",ye*95],["half-year",Wc/2],["year",Wc]];function pA(r,t,e,i){var n=tr(t),a=tr(e),o=function(d){return $c(n,d,i)===$c(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 gA(r,t){return r/=ye,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function yA(r){var t=30*ye;return r/=t,r>6?6:r>3?3:r>2?2:1}function mA(r){return r/=aa,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function tp(r,t){return r/=t?Fh:Bh,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function _A(r){return xy(r,!0)}function SA(r,t,e){var i=new Date(r);switch(un(t)){case"year":case"month":i[Pm(e)](0);case"day":i[Rm(e)](1);case"hour":i[Em(e)](0);case"minute":i[km(e)](0);case"second":i[Om(e)](0),i[Nm(e)](0)}return i.getTime()}function wA(r,t,e,i){var n=1e4,a=Lm,o=0;function s(A,M,L,I,P,R,E){for(var z=new Date(M),k=M,N=z[I]();k1&&R===0&&L.unshift({value:L[0].value-k})}}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(G(u,function(A){return At(A,function(M){return M.value>=i[0]&&M.value<=i[1]&&!M.notAdd})}),function(A){return A.length>0}),x=[],w=S.length-1,v=0;v0;)a*=10;var s=[Tt(MA(i[0]/a)*a),Tt(TA(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},t.prototype.calcNiceExtent=function(e){ua.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),So(this.base,e)},t.type="log",t}(yr),v_=sv.prototype;v_.getMinorTicks=ua.getMinorTicks;v_.getLabel=ua.getLabel;function wo(r,t){return bA(r,ur(t))}yr.registerClass(sv);const CA=sv;var DA=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[LA[t]]=e},r.prototype.setDeterminedMinMax=function(t,e){var i=AA[t];this[i]=e},r.prototype.freeze=function(){this.frozen=!0},r}(),AA={min:"_determinedMin",max:"_determinedMax"},LA={min:"_dataMin",max:"_dataMax"};function IA(r,t,e){var i=r.rawExtentInfo;return i||(i=new DA(r,t,e),r.rawExtentInfo=i,i)}function xo(r,t){return t==null?null:Ko(t)?NaN:r.parse(t)}function c_(r,t){var e=r.type,i=IA(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=s_("bar",o),l=!1;if(D(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=l_(s),f=PA(n,a,t,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function PA(r,t,e,i){var n=e.axis.getExtent(),a=n[1]-n[0],o=fA(i,e.axis);if(o===void 0)return{min:r,max:t};var s=1/0;D(o,function(v){s=Math.min(v.offset,s)});var l=-1/0;D(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 zf(r,t){var e=t,i=c_(r,e),n=i.extent,a=e.get("splitNumber");r instanceof CA&&(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 d_(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new n_({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new xA({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(yr.getClass(t)||Va)}}function RA(r){var t=r.scale.getExtent(),e=t[0],i=t[1];return!(e>0&&i>0||e<0&&i<0)}function za(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):H(t)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a!=null?a:"");return o}}(t):Z(t)?function(i){return function(n,a){return e!=null&&(a=n.value-e),i(lv(r,n),a,n.level!=null?{level:n.level}:null)}}(t):function(i){return r.scale.getLabel(i)}}function lv(r,t){return r.type==="category"?r.scale.getLabel(t):t.value}function EA(r){var t=r.model,e=r.scale;if(!(!t.get(["axisLabel","show"])||e.isBlank())){var i,n,a=e.getExtent();e instanceof n_?n=e.count():(i=e.getTicks(),n=i.length);var o=r.getLabelModel(),s=za(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var f=0;f=0||(rp.push(r),Z(r)&&(r={install:r}),r.install(NA))}var Ca=yt();function BA(r){return r.type==="category"?VA(r):HA(r)}function FA(r,t){return r.type==="category"?zA(r,t):{ticks:G(r.scale.getTicks(),function(e){return e.value})}}function VA(r){var t=r.getLabelModel(),e=y_(r,t);return!t.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:e.labelCategoryInterval}:e}function y_(r,t){var e=m_(r,"labels"),i=uv(t),n=__(e,i);if(n)return n;var a,o;return Z(i)?a=x_(r,i):(o=i==="auto"?GA(r):i,a=w_(r,o)),S_(e,i,{labels:a,labelCategoryInterval:o})}function zA(r,t){var e=m_(r,"ticks"),i=uv(t),n=__(e,i);if(n)return n;var a,o;if((!t.get("show")||r.scale.isBlank())&&(a=[]),Z(i))a=x_(r,i,!0);else if(i==="auto"){var s=y_(r,r.getLabelModel());o=s.labelCategoryInterval,a=G(s.labels,function(l){return l.tickValue})}else o=i,a=w_(r,o,!0);return S_(e,i,{ticks:a,tickCategoryInterval:o})}function HA(r){var t=r.scale.getTicks(),e=za(r);return{labels:G(t,function(i,n){return{level:i.level,formattedLabel:e(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function m_(r,t){return Ca(r)[t]||(Ca(r)[t]=[])}function __(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=dh(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=Ca(r.model),x=r.getExtent(),w=S.lastAutoInterval,b=S.lastTickCount;return w!=null&&b!=null&&Math.abs(w-_)<=1&&Math.abs(b-o)<=1&&w>_&&S.axisExtent0===x[0]&&S.axisExtent1===x[1]?_=w:(S.lastTickCount=o,S.lastAutoInterval=_,S.axisExtent0=x[0],S.axisExtent1=x[1]),_}function UA(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 w_(r,t,e){var i=za(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=p_(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 x_(r,t,e){var i=r.scale,n=za(r),a=[];return D(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 ip=[0,1],$A=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 Lw(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(),np(i,n.count())),je(t,ip,i,e)},r.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),np(i,n.count()));var a=je(t,i,ip,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=FA(this,e),n=i.ticks,a=G(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=e.get("alignWithLabel");return YA(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=G(i,function(a){return G(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return BA(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 WA(this)},r}();function np(r,t){var e=r[1]-r[0],i=t,n=e/i/2;r[0]+=n,r[1]-=n}function YA(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;D(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+=zn);var v=Math.atan2(s,o);if(v<0&&(v+=zn),v>=i&&v<=n||v+zn>=i&&v+zn<=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 b_(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 QA(r,t,e){var i=b_(t.x,t.y,t.width,t.height,r.x,r.y,Le);return e.set(Le[0],Le[1]),i}function JA(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]),q.sub(Ze,Pe,ht),q.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&&q.copy(Yt,St),Yt.toArray(r[1])}}}}function jA(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]),q.sub(Ze,ht,Pe),q.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)q.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?q.copy(Yt,ht):h>1&&q.copy(Yt,St)}Yt.toArray(r[1])}}}}function Su(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 tL(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=$u(i[0],i[1]),a=$u(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&&x(-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&&b(-y),m<0&&b(m);function _(){y=g.rect[t]-i,m=n-p.rect[t]-p.rect[e]}function S(T,C,A){if(T<0){var M=Math.min(C,-T);if(M>0){x(M*A,0,o);var L=M+T;L<0&&w(-L*A,1)}else w(-T*A,1)}}function x(T,C,A){T!==0&&(u=!0);for(var M=C;M0)for(var L=0;L0;L--){var E=A[L-1]*R;x(-E,L,o)}}}function b(T){var C=T<0?-1:1;T=Math.abs(T);for(var A=Math.ceil(T/(o-1)),M=0;M0?x(A,0,M+1):x(-A,o-M-1,o),T-=A,T<=0)return}return u}function eL(r,t,e,i){return A_(r,"x","width",t,e,i)}function L_(r,t,e,i){return A_(r,"y","height",t,e,i)}function I_(r){var t=[];r.sort(function(g,p){return p.priority-g.priority});var e=new at(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),!mn(i).valueAnimation){var h=X(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,To),bo(v,i.states.select,To)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};bo(d,u,To),bo(d,i.states.emphasis,To)}cT(i,l,f,e,e)}if(n&&!n.ignore&&!n.invisible){var a=nL(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 oL=aL;var xu=yt();function sL(r){r.registerUpdateLifecycle("series:beforeupdate",function(t,e,i){var n=xu(e).labelManager;n||(n=xu(e).labelManager=new oL),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(t,e,i){var n=xu(e).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),n.updateLayoutConfig(e),n.layout(e),n.processLabelsOverall()})}var bu=Math.sin,Tu=Math.cos,P_=Math.PI,oi=Math.PI*2,lL=180/P_,uL=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>=P_==!!f;var g=t+i*Tu(o),p=e+n*bu(o);this._start&&this._add("M",g,p);var y=Math.round(a*lL);if(c){var m=1/this._p,_=(f?1:-1)*(oi-m);this._add("A",i,n,y,1,+f,t+i*Tu(o+_),e+n*bu(o+_)),m>.01&&this._add("A",i,n,y,0,+f,g,p)}else{var S=t+i*Tu(s),x=e+n*bu(s);this._add("A",i,n,y,+d,+f,S,x)}},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 mL(r){return""}function fv(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 yL(o,s)+(o!=="style"?ne(l):l||"")+(a?""+e+G(a,function(u){return i(u)}).join(e)+e:"")+mL(o)}return i(r)}function _L(r,t,e){e=e||{};var i=e.newline?"\n":"",n=" {"+i,a=i+"}",o=G(it(r),function(l){return l+n+G(it(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=G(it(t),function(l){return"@keyframes "+l+n+G(it(t[l]),function(u){return u+n+G(it(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 Gf(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function lp(r,t,e,i){return Lt("svg","root",{width:r,height:t,xmlns:E_,"xmlns:xlink":k_,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var SL=0;function N_(){return SL++}var up={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 wL(r,t,e){var i=O({},r.shape);O(i,t),r.buildPath(e,i);var n=new R_;return n.reset(uy(r)),e.rebuildPath(n,1),n.generateStr(),n.getStr()}function xL(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[ui]=e+"px "+i+"px")}var bL={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function B_(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function TL(r,t,e){var i=r.shape.paths,n={},a,o;if(D(i,function(l){var u=Gf(e.zrId);u.animation=!0,ul(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,c=it(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=B_(n,e);return a.replace(o,s)}}function fp(r){return H(r)?up[r]?"cubic-bezier("+up[r]+")":hh(r)?r:"":""}function ul(r,t,e,i){var n=r.animators,a=n.length,o=[];if(r instanceof gm){var s=TL(r,t,e);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Nt=B_(b,e);return Nt+" "+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-"+N_();e.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function ML(r,t,e){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};hp(i,t,e,!0)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=ju(l))}var u=n.lineWidth;if(u){var f=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/f}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),hp(i,t,e,!0)}}function hp(r,t,e,i){var n=JSON.stringify(r),a=e.cssStyleCache[n];a||(a=e.zrId+"-cls-"+N_(),e.cssStyleCache[n]=a,e.cssNodes["."+a+(i?":hover":"")]=r),t.class=t.class?t.class+" "+a:a}var Da=Math.round;function F_(r){return r&&H(r.src)}function V_(r){return r&&Z(r.toDataURL)}function hv(r,t,e,i){dL(function(n,a){var o=n==="fill"||n==="stroke";o&&ly(a)?H_(t,r,n,i):o&&vh(a)?G_(e,r,n,i):o&&a==="none"?r[n]="transparent":r[n]=a},t,e,!1),RL(e,r,i)}function vv(r,t){var e=Mw(t);e&&(e.each(function(i,n){i!=null&&(r[(sp+n).toLowerCase()]=i+"")}),t.isSilent()&&(r[sp+"silent"]="true"))}function vp(r){return Pr(r[0]-1)&&Pr(r[1])&&Pr(r[2])&&Pr(r[3]-1)}function CL(r){return Pr(r[4])&&Pr(r[5])}function cv(r,t,e){if(t&&!(CL(t)&&vp(t))){var i=e?10:1e4;r.transform=vp(t)?"translate("+Da(t[4]*i)/i+" "+Da(t[5]*i)/i+")":US(t)}}function cp(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(A,M){if(A){var L=A.elm,I=c||M.width,P=v||M.height;A.tag==="pattern"&&(u?(P=1,I/=a.width):f&&(I=1,P/=a.height)),A.attrs.width=I,A.attrs.height=P,L&&(L.setAttribute("width",I),L.setAttribute("height",P))}},m=Sh(d,null,r,function(A){l||y(w,A),y(h,A)});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=K(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 x=fy(n);x&&(o.patternTransform=x);var w=Lt("pattern","",o,[h]),b=fv(w),T=i.patternCache,C=T[b];C||(C=i.zrId+"-p"+i.patternIdx++,T[b]=C,o.id=C,w=i.defs[C]=Lt("pattern",C,o,[h])),t[e]=Os(C)}}function EL(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,[z_(r,e)])}t["clip-path"]=Os(a)}function gp(r){return document.createTextNode(r)}function hi(r,t,e){r.insertBefore(t,e)}function yp(r,t){r.removeChild(t)}function mp(r,t){r.appendChild(t)}function W_(r){return r.parentNode}function U_(r){return r.nextSibling}function Mu(r,t){r.textContent=t}var _p=58,kL=120,OL=Lt("","");function Wf(r){return r===void 0}function We(r){return r!==void 0}function NL(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 Kn(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function Aa(r){var t,e=r.children,i=r.tag;if(We(i)){var n=r.elm=O_(i);if(dv(OL,r),F(e))for(t=0;ta?(d=e[l+1]==null?null:e[l+1].elm,$_(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&&(dv(r,t),Wf(t.text)?We(i)&&We(n)?i!==n&&BL(e,i,n):We(n)?(We(r.text)&&Mu(e,""),$_(e,null,n,0,n.length-1)):We(i)?As(e,i,0,i.length-1):We(r.text)&&Mu(e,""):r.text!==t.text&&(We(i)&&As(e,i,0,i.length-1),Mu(e,t.text)))}function FL(r,t){if(Kn(r,t))Zi(r,t);else{var e=r.elm,i=W_(e);Aa(t),i!==null&&(hi(i,t.elm,U_(e)),As(i,[r],0,0))}return t}var VL=0,zL=function(){function r(t,e,i){if(this.type="svg",this.refreshHover=Sp(),this.configLayer=Sp(),this.storage=e,this._opts=i=O({},i),this.root=t,this._id="zr"+VL++,this._oldVNode=lp(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=O_("svg");dv(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",FL(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return pp(t,Gf(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Gf(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis;var o=[],s=this._bgVNode=HL(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=G(it(a.defs),function(c){return a.defs[c]});if(u.length&&o.push(Lt("defs","defs",{},u)),t.animation){var f=_L(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Lt("style","stl",{},[],f);o.push(h)}}return lp(i,n,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},fv(this.renderToVNode({animation:X(t.cssAnimation,!0),emphasis:X(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:X(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 A=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||(e.painter=this)}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?Mo:0),this._needsManuallyCompositing),f.__builtin__||oh("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&ae&&!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,D(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?ot(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}(Br);const QL=KL;function pv(r,t){var e=r.mapDimensionsAll("defaultedLabel"),i=e.length;if(i===1){var n=pn(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 JL=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=jL,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),Ph(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 x=T0(e.getItemVisual(i,"symbolOffset"),n);x&&(s.x=x[0],s.y=x[1]),y&&s.attr("cursor",y);var w=e.getItemVisual(i,"style"),b=w.fill;if(s instanceof ir){var T=s.style;s.useStyle(O({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(O({},w)):s.useStyle(w),s.style.decal=null,s.setColor(b,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=e.getItemVisual(i,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=s.z2,s.z2+=C):A!=null&&(s.z2=A,this._z2=null);var M=o&&o.useNameLabel;Na(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:L,inheritColor:b,defaultOpacity:w.opacity});function L(R){return M?e.getName(R):pv(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),ma(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=rt(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 HC(e.getItemVisual(i,"symbolSize"))},t}(Ct);function jL(r,t){this.parent.drift(r,t)}const gv=JL;function Du(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 bp(r){return r!=null&&!W(r)&&(r={isIgnore:r}),r||{}}function Tp(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 tI=function(){function r(t){this.group=new Ct,this._SymbolCtor=t||gv}return r.prototype.updateData=function(t,e){this._progressiveEls=null,e=bp(e);var i=this.group,n=t.hostModel,a=this._data,o=this._SymbolCtor,s=e.disableAnimation,l=Tp(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(Du(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(!Du(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=Tp(t),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e,i){this._progressiveEls=[],i=bp(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 Z_(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 iI(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 nI(r,t,e,i,n,a,o,s){for(var l=iI(r,t),u=[],f=[],h=[],c=[],v=[],d=[],g=[],p=X_(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 x=g+a,w=t[x*2],b=t[x*2+1];w===y&&b===m&&p=i||_i(w,b))v=y,d=m;else{A=w-u,M=b-f;var P=y-u,R=w-y,E=m-f,z=b-m,k=void 0,N=void 0;if(s==="x"){k=Math.abs(P),N=Math.abs(R);var V=A>0?1:-1;v=y-V*k*o,d=m,L=y+V*N*o,I=m}else if(s==="y"){k=Math.abs(E),N=Math.abs(z);var U=M>0?1:-1;v=y,d=m-U*k*o,L=y,I=m+U*N*o}else k=Math.sqrt(P*P+E*E),N=Math.sqrt(R*R+z*z),C=N/(N+k),v=y-A*o*(1-C),d=m-M*o*(1-C),L=y+A*o*C,I=m+M*o*C,L=Tr(L,Mr(w,y)),I=Tr(I,Mr(b,m)),L=Mr(L,Tr(w,y)),I=Mr(I,Tr(b,m)),A=L-y,M=I-m,v=y-A*k/N,d=m-M*k/N,v=Tr(v,Mr(u,y)),d=Tr(d,Mr(f,m)),v=Mr(v,Tr(u,y)),d=Mr(d,Tr(f,m)),A=y-v,M=m-d,L=y+A*N/k,I=m+M*N/k}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 q_=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),aI=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 q_},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 x=u?jo(s,v,g,y,e,f):jo(l,d,p,m,e,f);if(x>0)for(var w=0;w=0){var S=u?Dt(l,d,p,m,b):Dt(s,v,g,y,b);return u?[e,S]:[S,e]}}s=y,l=m;break}}},t}(lt),oI=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(q_),sI=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 oI},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 hI(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=G(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=fI(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";D(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 Lh(0,0,0,0,c,!0);return m[n]=g,m[n+"2"]=p,m}}}function vI(r,t,e){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=e.getAxesByScale("ordinal")[0];if(a&&!(n&&cI(a,t))){var o=t.mapDimension(a.dim),s={};return D(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function cI(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 dI(r,t){return isNaN(r)||isNaN(t)}function pI(r){for(var t=r.length/2;t>0&&dI(r[t*2-2],r[t*2-1]);t--);return t-1}function Lp(r,t){return[r[t*2],r[t*2+1]]}function gI(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 J_(r){if(r.get(["endLabel","show"]))return!0;for(var t=0;t0&&e.get(["emphasis","lineStyle","width"])==="bolder"){var V=g.getState("emphasis").style;V.lineWidth=+g.style.lineWidth+1}rt(g).seriesIndex=e.seriesIndex,ma(g,z,k,N);var U=Ap(e.get("smooth")),Y=e.get("smoothMonotone");if(g.setShape({smooth:U,smoothMonotone:Y,connectNulls:T}),p){var Q=l.getCalculationInfo("stackedOnSeries"),nt=0;p.useStyle(st(f.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),Q&&(nt=Ap(Q.get("smooth"))),p.setShape({smooth:U,stackedOnSmooth:nt,smoothMonotone:Y,connectNulls:T}),cs(p,e,"areaStyle"),rt(p).seriesIndex=e.seriesIndex,ma(p,z,k,N)}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){rt(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 gv(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;bc(this._polyline,e),i&&bc(i,e)},t.prototype._newPolyline=function(e){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new aI({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 sI({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");Z(f)&&(f=f(null));var h=u.get("animationDelay")||0,c=Z(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,x=i.pointToCoord(p);a?(y=S.startAngle,m=S.endAngle,_=-x[1]/180*Math.PI):(y=S.r0,m=S.r,_=x[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 b=m===y?0:(_-y)/(m-y);l&&(b=1-b);var T=Z(h)?h(d):f*b+c,C=g.getSymbolPath(),A=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,i,n){var a=e.getModel("endLabel");if(J_(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=pI(l);f>=0&&(Na(s,Ba(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:f,defaultText:function(h,c,v){return v!=null?Y_(o,v):pv(o,h)},enableTextSetter:!0},yI(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,x=(y?g:0)*(m?-1:1),w=(y?0:-g)*(m?-1:1),b=y?"x":"y",T=gI(h,S,b),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!v){var L=Lp(h,C[0]);u.attr({x:L[0]+x,y:L[1]+w}),o&&(M=c.getRawValue(C[0]))}else{var L=f.getPointOn(S,b);L&&u.attr({x:L[0]+x,y:L[1]+w});var I=c.getRawValue(C[0]),P=c.getRawValue(C[1]);o&&(M=Ay(n,d,I,P,T.t))}a.lastFrameIndex=C[0]}else{var R=e===1||a.lastFrameIndex>0?C[0]:0,L=Lp(h,R);o&&(M=c.getRawValue(R)),u.attr({x:L[0]+x,y:L[1]+w})}if(o){var E=mn(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=nI(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)),Dp(v,g)>3e3||f&&Dp(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 x=_[S].cmd;if(x==="="){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 b=u.shape.__points,T=0;Tt&&(t=r[e]);return isFinite(t)?t:NaN},min:function(r){for(var t=1/0,e=0;et&&(t=a,e=n)}return isFinite(e)?e:NaN},nearest:function(r){return r[0]}},xI=function(r){return Math.round(r.length/2)};function j_(r){return{seriesType:r,reset:function(t,e,i){var n=t.getData(),a=t.get("sampling"),o=t.coordinateSystem,s=n.count();if(s>10&&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;H(a)?d=wI[a]:Z(a)&&(d=a),d&&t.setData(n.downSample(n.mapDimension(u.dim),1/v,d,xI))}}}}}function WR(r){r.registerChartView(_I),r.registerSeriesModel(QL),r.registerLayout(SI("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,j_("line"))}var t1=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 nv(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)D(a.getAxes(),function(c,v){if(c.type==="category"&&i!=null){var d=c.getTicksCoords(),g=c.getTickModel().get("alignWithLabel"),p=o[v],y=i[v]==="x1"||i[v]==="y1";if(y&&!g&&(p+=1),d.length<2)return;if(d.length===2){s[v]=c.toGlobalCoord(c.getExtent()[y?1:0]);return}for(var m=void 0,_=void 0,S=1,x=0;xp){_=(w+m)/2;break}x===1&&(S=b-d[0].tickValue)}_==null&&(m?m&&(_=d[d.length-1].coord):_=d[0].coord),s[v]=c.toGlobalCoord(_)}});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}(Br);Br.registerClass(t1);const Ip=t1;var bI=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 nv(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(Ip.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}(Ip);const TI=bI;var MI=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}(),CI=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 MI},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,rt(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),Rp={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=Lu(t.x,r.x),s=Iu(t.x+t.width,n),l=Lu(t.y,r.y),u=Iu(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=Iu(t.r,r.r),a=Lu(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}},Ep={cartesian2d:function(r,t,e,i,n,a,o,s,l){var u=new Mt({shape:O({},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?Pp:Ci,f=new u({shape:i,z2:1});f.name="item";var h=e1(n);if(f.calculateTextPosition=DI(h,{isRoundCap:u===Pp}),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 PI(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 kp(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 Op(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 kI(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function e1(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 Bp(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);O(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);Na(r,d,{labelFetcher:a,labelDataIndex:e,defaultText:pv(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,AI(r,p==="outside"?v:p,e1(o),i.get(["label","rotate"]))}vT(g,d,a.getRawValue(e),function(m){return Y_(t,m)});var y=i.getModel(["emphasis"]);ma(r,y.get("focus"),y.get("blurScope"),y.get("disabled")),cs(r,i),kI(n)&&(r.style.fill="none",r.style.stroke="none",D(r.states,function(m){m.style&&(m.style.fill=m.style.stroke="none")}))}function OI(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 NI=function(){function r(){}return r}(),Fp=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 NI},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 BI(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 r1(r,t,e){if(yv(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 FI(r,t,e){var i=r.type==="polar"?Ci:Mt;return new i({shape:r1(t,e,r),silent:!0,z2:0})}const VI=II;function UR(r){r.registerChartView(VI),r.registerSeriesModel(TI),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,bt(hA,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,vA("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,j_("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 Hp=Math.PI*2,Lo=Math.PI/180;function i1(r,t){return Ti(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function n1(r,t){var e=i1(r,t),i=r.get("center"),n=r.get("radius");F(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 F(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 zI(r,t,e){t.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=i1(i,e),s=n1(i,e),l=s.cx,u=s.cy,f=s.r,h=s.r0,c=-i.get("startAngle")*Lo,v=i.get("endAngle"),d=i.get("padAngle")*Lo;v=v==="auto"?c-Hp:-v*Lo;var g=i.get("minAngle")*Lo,p=g+d,y=0;n.each(a,function(E){!isNaN(E)&&y++});var m=n.getSum(a),_=Math.PI/(m||y)*2,S=i.get("clockwise"),x=i.get("roseType"),w=i.get("stillShowZeroSum"),b=n.getDataExtent(a);b[0]=0;var T=S?1:-1,C=[c,v],A=T*d/2;ky(C,!S),c=C[0],v=C[1];var M=Math.abs(v-c),L=M,I=0,P=c;if(n.setLayout({viewRect:o,r:f}),n.each(a,function(E,z){var k;if(isNaN(E)){n.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:l,cy:u,r0:h,r:x?NaN:f});return}x!=="area"?k=m===0&&w?_:E*_:k=M/y,kk?(V=P+T*k/2,U=V):(V=P+A,U=N-A),n.setItemLayout(z,{angle:k,startAngle:V,endAngle:U,clockwise:S,cx:l,cy:u,r0:h,r:x?je(E,b,[h,f]):f}),P=N}),Le?y:p,x=Math.abs(_.label.y-e);if(x>=S.maxY){var w=_.label.x-t-_.len2*n,b=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 Pu(r){return r.position==="center"}function UI(r){var t=r.getData(),e=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*GI,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 b in w.states)if(w.states[b].ignore===!1)return!0;return!1}t.each(function(w){var b=t.getItemGraphicEl(w),T=b.shape,C=b.getTextContent(),A=b.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),z=L.get("bleedMargin"),k=M.getModel("labelLine"),N=k.get("length");N=dt(N,u);var V=k.get("length2");if(V=dt(V,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":Y>0?"left":"right"}var xe=Math.PI,qt=0,ar=L.get("rotate");if(ct(ar))qt=ar*(xe/180);else if(I==="center")qt=0;else if(ar==="radial"||ar===!0){var Li=Y<0?-U+xe:-U;qt=Li}else if(ar==="tangential"&&I!=="outside"&&I!=="outer"){var be=Math.atan2(Y,Q);be<0&&(be=xe*2+be);var Ha=Q>0;Ha&&(be=xe+be),qt=be-xe}if(a=!!qt,C.x=nt,C.y=wt,C.rotation=qt,C.setStyle({verticalAlign:"middle"}),Pt){C.setStyle({align:Nt});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 xv=(C.style.margin||0)+2.1;mr.y-=xv/2,mr.height+=xv,e.push({label:C,labelLine:A,position:I,len:N,len2:V,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new q(Y,Q),linePoints:vt,textAlign:Nt,labelDistance:P,labelAlignTo:R,edgeDistance:E,bleedMargin:z,rect:mr,unconstrainedWidth:mr.width,labelStyleWidth:C.style.width})}b.setTextConfig({inside:Pt})}}),!a&&r.get("avoidLabelOverlap")&&WI(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 XI=YI;function ZI(r,t,e){t=F(t)&&{coordDimensions:t}||O({encodeDefine:r.getEncode()},t);var i=r.getSource(),n=iv(i,t).dimensions,a=new J0(n,r);return a.initData(i,e),a}var qI=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 KI=qI;var QI=yt(),JI=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 KI(et(this.getData,this),et(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:bt(GT,this)})},t.prototype.getDataParams=function(e){var i=this.getData(),n=QI(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=Iw(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){hf(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,endAngle:"auto",padAngle:0,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}(Br);const jI=JI;function tP(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 $R(r){r.registerChartView(XI),r.registerSeriesModel(jI),DC("pie",r.registerAction),r.registerLayout(bt(zI,"pie")),r.registerProcessor(HI("pie")),r.registerProcessor(tP("pie"))}var eP=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 rP=eP;var $f=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($f,g_);var o1={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)"]}}},iP=ot({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},o1),mv=ot({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}}},o1),nP=ot({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},mv),aP=st({logBase:10},mv);const oP={category:iP,value:mv,time:nP,log:aP};var sP={value:1,category:1,time:1,log:1};function Wp(r,t,e,i){D(sP,function(n,a){var o=ot(ot({},oP[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=wa(this),v=c?tl(f):{},d=h.getTheme();ot(f,d.get(a+"Axis")),ot(f,this.getDefaultOption()),f.type=Up(f),c&&dn(f,v,c)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Ff.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",Up)}function Up(r){return r.type||(r.data?"category":"value")}var lP=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 G(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 uP=lP;var Yf=["x","y"];function $p(r){return r.type==="interval"||r.type==="time"}var fP=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Yf,e}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!$p(e)||!$p(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 at(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(e){e=e||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-e,o=Math.min(n[0],n[1])-e,s=Math.max(i[0],i[1])-a+e,l=Math.max(n[0],n[1])-o+e;return new at(a,o,s,l)},t}(uP),hP=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}(XA);const vP=hP;function Xf(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),vn(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 Yp(r){return r.get("coordinateSystem")==="cartesian2d"}function Xp(r){var t={xAxisModel:null,yAxisModel:null};return D(t,function(e,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Ie).models[0];t[i]=a}),t}var Ru=Math.log;function cP(r,t,e){var i=Va.prototype,n=i.getTicks.call(e),a=i.getTicks.call(e,!0),o=n.length-1,s=i.getInterval.call(e),l=c_(r,t),u=l.extent,f=l.fixMin,h=l.fixMax;if(r.type==="log"){var c=Ru(r.base);u=[Ru(u[0])/c,Ru(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 dP=function(){function r(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Yf,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=it(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;Vf(g)&&d.get("alignTicks")&&d.get("interval")==null?f.push(v):(zf(g,d),Vf(g)&&(s=v))}f.length&&(s||(s=f.pop(),zf(s.scale,s.model)),D(f,function(p){cP(p.scale,p.model,s.scale)}))}}n(i.x),n(i.y);var a={};D(i.x,function(o){Zp(i,"y",o,a)}),D(i.y,function(o){Zp(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&&(D(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=EA(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()),D(this._coordsList,function(u){u.calcAffineTransform()});function l(){D(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]),pP(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]}W(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}(),Kp={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=O({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new xi({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});_a(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"]);H(c)&&(c=[c,c]),(H(v)||ct(v))&&(v=[v,v]);var d=T0(t.get(["axisLine","symbolOffset"])||0,v),g=v[0],p=v[1];D([{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,x=u?l:s;_.attr({rotation:y.rotate,x:x[0]+S*Math.cos(r.rotation),y:x[1]-S*Math.sin(r.rotation),silent:!0,z2:11}),e.add(_)}})}}},axisTickLabel:function(r,t,e,i){var n=_P(e,i,t,r),a=wP(e,i,t,r);if(mP(t,a,n),SP(e,i,t,r.tickDirection),t.get(["axisLabel","hideOverlap"])){var o=D_(G(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));I_(o)}},axisName:function(r,t,e,i){var n=vn(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,Jp(a)?r.labelOffset+o*l:0],c,v=t.get("nameRotate");v!=null&&(v=v*Rr/180);var d;Jp(a)?c=Si.innerTextLayout(r.rotation,v!=null?v:r.rotation,o):(c=yP(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=vn(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(kh({el:_,componentModel:t,itemName:n}),_.__fullText=n,_.anid="name",t.get("triggerEvent")){var S=Si.makeAxisEventDataBase(t);S.targetType="axisName",S.name=n,rt(_).eventData=S}i.add(_),_.updateTransform(),e.add(_),_.decomposeTransform()}}};function yP(r,t,e,i){var n=wy(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 mP(r,t,e){if(!p_(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)):Qp(a,o)&&(i?(ue(o),ue(f)):(ue(a),ue(u))),n===!1?(ue(s),ue(h)):Qp(l,s)&&(n?(ue(l),ue(c)):(ue(s),ue(h)))}}function ue(r){r&&(r.ignore=!0)}function Qp(r,t){var e=r&&r.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(!(!e||!i)){var n=uh([]);return fh(n,n,-r.rotation),e.applyTransform(nn([],n,r.getLocalTransform())),i.applyTransform(nn([],n,t.getLocalTransform())),e.intersect(i)}}function Jp(r){return r==="middle"||r==="center"}function s1(r,t,e,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===t}function DP(r){var t=_v(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=Zf(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 Ou(r,t){var e=r.visual,i=[];W(e)?Ia(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]),v1(r,i)}function Io(r){return{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);i("color",r(e("color"),n))},_normalizedToVisual:Kf([0,1])}}function eg(r){var t=this.option.visual;return t[Math.round(je(r,[0,1],[0,t.length-1],!0))]||{}}function Hn(r){return function(t,e,i){i(r,this.mapValueToVisual(t))}}function Jn(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 Kf(r){return{linear:function(t){return je(t,r,this.option.visual,!0)},category:Jn,piecewise:function(t,e){var i=Qf.call(this,e);return i==null&&(i=je(t,r,this.option.visual,!0)),i},fixed:fi}}function Qf(r){var t=this.option,e=t.pieceList;if(t.hasSpecialVisual){var i=Sv.findPieceIndex(r,e),n=e[i];if(n&&n.visual)return n.visual[this.type]}}function v1(r,t){return r.visual=t,r.type==="color"&&(r.parsedVisual=G(t,function(e){var i=oe(e);return i||[0,0,0,1]})),t}var HP={linear:function(r){return je(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var t=this.option.pieceList,e=Sv.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 Po(r,t,e){return r?t<=e:ta&&(t[1-i]=t[i]+h.sign*a),t}function Nu(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(),rg=K,Bu=et,WP=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=bt(ig,e,h);this.updatePointerEl(s,u,c),this.updateLabelEl(s,u,c,e)}ag(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=_v(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 lT[a.type](rg(e.pointer));t.add(o)}},r.prototype.createLabelEl=function(t,e,i,n){if(e.label){var a=vi(t).labelEl=new It(rg(e.label));t.add(a),ng(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}),ng(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=Eh(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){va(u.event)},onmousedown:Bu(this._onHandleDragMove,this,0,0),drift:Bu(this._onHandleDragMove,this),ondragend:Bu(this._onHandleDragEnd,this)}),i.add(n)),ag(n,e,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");F(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,d0(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},r.prototype._moveHandleToValue=function(t,e){ig(this._axisPointerModel,!e&&this._moveAnimation,this._handle,Fu(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(Fu(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(Fu(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),Lf(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 ig(r,t,e,i){c1(vi(e).lastProp,i)||(vi(e).lastProp=i,t?Et(e,i,r):(e.stopAnimation(),e.attr(i)))}function c1(r,t){if(W(r)&&W(t)){var e=!0;return D(t,function(i,n){e=e&&c1(r[n],i)}),!!e}else return r===t}function ng(r,t){r[t.get(["label","show"])?"show":"hide"]()}function Fu(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function ag(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 UP=WP;function $P(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 YP(r,t,e,i,n){var a=e.get("value"),o=d1(a,t.axis,t.ecModel,e.get("seriesDataIndices"),{precision:e.get(["label","precision"]),formatter:e.get(["label","formatter"])}),s=e.getModel("label"),l=Fa(s.get("padding")||0),u=s.getFont(),f=dh(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),XP(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 XP(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 d1(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:lv(t,{value:r}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};D(i,function(l){var u=e.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),H(o)?a=o.replace("{value}",a):Z(o)&&(a=o(s))}return a}function p1(r,t,e){var i=rn();return fh(i,i,e.rotation),qu(i,i,e.position),sn([r.dataToCoord(t),(e.labelOffset||0)+(e.labelDirection||1)*(e.labelMargin||0)],i)}function ZP(r,t,e,i,n,a){var o=l1.innerTextLayout(e.rotation,0,e.labelDirection);e.labelMargin=n.get(["label","margin"]),YP(t,i,n,a,{position:p1(i.axis,r,e),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function qP(r,t,e){return e=e||0,{x1:r[e],y1:r[1-e],x2:t[e],y2:t[1-e]}}function KP(r,t,e){return e=e||0,{x:r[e],y:r[1-e],width:t[e],height:t[1-e]}}var QP=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=og(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var c=$P(a),v=JP[u](s,h,f);v.style=c,e.graphicKey=v.type,e.pointer=v}var d=Xf(l.model,n);ZP(i,e,d,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=Xf(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=p1(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=og(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}(UP);function og(r,t){var e={};return e[t.dim+"AxisIndex"]=t.index,r.getCartesian(e)}var JP={line:function(r,t,e){var i=qP([t,e[0]],[t,e[1]],sg(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:KP([t-i/2,e[0]],[i,n],sg(r))}}};function sg(r){return r.dim==="x"?0:1}const jP=QP;var t2=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 e2=t2;var vr=yt(),r2=D;function g1(r,t,e){if(!tt.node){var i=t.getZr();vr(i).records||(vr(i).records={}),i2(i,t);var n=vr(i).records[r]||(vr(i).records[r]={});n.handler=e}}function i2(r,t){if(vr(r).initialized)return;vr(r).initialized=!0,e("click",bt(lg,"click")),e("mousemove",bt(lg,"mousemove")),e("globalout",a2);function e(i,n){r.on(i,function(a){var o=o2(t);r2(vr(r).records,function(s){s&&n(s,a,o.dispatchAction)}),n2(o.pendings,t)})}}function n2(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 a2(r,t,e){r.handler("leave",null,e)}function lg(r,t,e,i){t.handler(r,e,i)}function o2(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 Jf(r,t){if(!tt.node){var e=t.getZr(),i=(vr(e).records||{})[r];i&&(vr(e).records[r]=null)}}var s2=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";g1("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){Jf("axisPointer",i)},t.prototype.dispose=function(e,i){Jf("axisPointer",i)},t.type="axisPointer",t}(er);const l2=s2;function y1(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||F(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(G(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 ug=yt();function u2(r,t,e){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||et(e.dispatchAction,e),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Zo(n)&&(n=y1({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Zo(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||Zo(n),c={},v={},d={list:[],map:{}},g={showPointer:bt(h2,v),showTooltip:bt(v2,d)};D(s.coordSysMap,function(y,m){var _=l||y.containPoint(n);D(s.coordSysAxesInfo[m],function(S,x){var w=S.axis,b=g2(u,S);if(!h&&_&&(!u||b)){var T=b&&b.value;T==null&&!l&&(T=w.pointToData(n)),T!=null&&fg(S,T,g,!1,c)}})});var p={};return D(f,function(y,m){var _=y.linkGroup;_&&!v[m]&&D(_.axesInfo,function(S,x){var w=v[x];if(S!==y&&w){var b=w.value;_.mapper&&(b=y.axis.scale.parse(_.mapper(b,hg(S),hg(y)))),p[y.key]=b}})}),D(p,function(y,m){fg(f[m],y,g,!0,c)}),c2(v,f,c),d2(d,n,r,o),p2(f,o,e),c}}function fg(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=f2(t,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&O(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(t=l),e.showPointer(r,t,s),e.showTooltip(r,o,l)}}function f2(r,t){var e=t.axis,i=e.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return D(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),D(c,function(p){a.push({seriesIndex:l.seriesIndex,dataIndexInside:p,dataIndex:l.getData().getRawIndex(p)})}))}}),{payloadBatch:a,snapToValue:n}}function h2(r,t,e,i){r[t.key]={value:e,payloadBatch:i}}function v2(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=La(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 c2(r,t,e){var i=e.axesInfo=[];D(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 d2(r,t,e,i){if(Zo(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 p2(r,t,e){var i=e.getZr(),n="axisPointerLastHighlights",a=ug(i)[n]||{},o=ug(i)[n]={};D(r,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&D(h.seriesDataIndices,function(c){var v=c.seriesIndex+" | "+c.dataIndex;o[v]=c})});var s=[],l=[];D(a,function(u,f){!o[f]&&l.push(u)}),D(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 g2(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 hg(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 Zo(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function m1(r){u1.registerAxisPointerClass("CartesianAxisPointer",jP),r.registerComponentModel(e2),r.registerComponentView(l2),r.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!F(e)&&(t.axisPointer.link=[e])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=xP(t,e)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},u2)}function YR(r){ke(BP),ke(m1)}function y2(r,t){var e=Fa(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 m2=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 _2=m2;function _1(r){var t=r.get("confine");return t!=null?!!t:r.get("renderMode")==="richText"}function S1(r){if(tt.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 C2(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+=tt.transformSupported?","+wv+i:",left"+i+",top"+i),x2+":"+n}function vg(r,t,e){var i=r.toFixed(0)+"px",n=t.toFixed(0)+"px";if(!tt.transformSupported)return e?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=tt.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return e?"top:0;left:0;"+wv+":"+o+";":[["top",0],["left",0],[w1,o]]}function D2(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),D(["decoration","align"],function(l){var u=r.get(l);u&&t.push("text-"+l+":"+u)}),t.join(";")}function A2(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=v0(r,"html"),c=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+c),t&&n&&i.push(C2(n,e)),a&&i.push("background-color:"+a),D(["width","color","radius"],function(v){var d="border-"+v,g=Fm(d),p=r.get(g);p!=null&&i.push(d+":"+p+(v==="color"?"":"px"))}),i.push(D2(f)),h!=null&&i.push("padding:"+Fa(h).join("px ")+"px"),i.join(";")+";"}function cg(r,t,e,i,n){var a=t&&t.painter;if(e){var o=a&&a.getViewportRoot();o&&aS(r,o,e,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 L2=function(){function r(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,tt.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=t.getZr(),a=e.appendTo,o=a&&(H(a)?document.querySelector(a):ha(a)?a:Z(a)&&a(t.getDom()));cg(this._styleCoord,n,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(i),this._api=t,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,f=n.painter.getViewportRoot();he(f,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),i=w2(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=b2+A2(t,!this._firstShow,this._longHide)+vg(a[0],a[1],!0)+("border-color:"+bi(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(H(a)&&i.get("trigger")==="item"&&!_1(i)&&(s=M2(i,n,a)),H(t))o.innerHTML=t+s;else if(t){o.innerHTML="",F(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||tt.node||!n.getDom())){var o=gg(a,n);this._ticket="";var s=a.dataByCoordSys,l=F2(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=E2;f.x=a.x,f.y=a.y,f.update(),rt(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=y1(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(gg(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=Gn([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){var s=rt(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;ji(n,function(f){if(rt(f).dataIndex!=null)return l=f,!0;if(rt(f).tooltipConfig!=null)return u=f,!0},!0),l?this._showSeriesItemTooltip(e,l,i):u?this._showComponentItemTooltip(e,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},t.prototype._showOrMove=function(e,i){var n=e.get("showDelay");i=et(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=Gn([i.tooltipOption],a),l=this._renderMode,u=[],f=ba("section",{blocks:[],noHeader:!0}),h=[],c=new su;D(e,function(m){D(m.dataByAxis,function(_){var S=n.getComponent(_.axisDim+"Axis",_.axisIndex),x=_.value;if(!(!S||x==null)){var w=d1(x,S.axis,n,_.seriesDataIndices,_.valueLabelOpt),b=ba("section",{header:w,noHeader:!Ye(w),sortBlocks:!0,blocks:[]});f.blocks.push(b),D(_.seriesDataIndices,function(T){var C=n.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=_.axisDim,M.axisIndex=_.axisIndex,M.axisType=_.axisType,M.axisId=_.axisId,M.axisValue=lv(S.axis,{value:x}),M.axisValueLabel=w,M.marker=c.makeTooltipMarker("item",bi(M.color),l);var L=fd(C.formatTooltip(A,!0,null)),I=L.frag;if(I){var P=Gn([C],a).get("valueFormatter");b.blocks.push(P?O({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=gd(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=rt(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=Gn([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",bi(y.color),v);var _=fd(u.formatTooltip(f,!1,h)),S=g.get("order"),x=g.get("valueFormatter"),w=_.frag,b=w?gd(x?O({valueFormatter:x},w):w,m,v,S,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(g,function(){this._showTooltipContent(g,b,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=rt(i),o=a.tooltipConfig,s=o.option||{};if(H(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=Gn(u,this._tooltipModel,h?{position:h}:null),v=c.get("content"),d=Math.random()+"",g=new su;this._showOrMove(c,function(){var p=K(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(H(c)){var p=e.ecModel.get("useUTC"),y=F(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;v=c,m&&(v=qs(y.axisValue,v,p)),v=Vm(v,n,!0)}else if(Z(c)){var _=et(function(S,x){S===this._ticket&&(h.setContent(x,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"||F(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!F(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),Z(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),F(i))n=dt(i[0],u),a=dt(i[1],f);else if(W(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(H(i)&&l){var y=B2(i,d,h,e.get("borderWidth"));n=y[0],a=y[1]}else{var y=O2(n,a,o,u,f,c?null:20,v?null:20);n=y[0],a=y[1]}if(c&&(n-=yg(c)?h[0]/2:c==="right"?h[0]:0),v&&(a-=yg(v)?h[1]/2:v==="bottom"?h[1]:0),_1(e)){var y=N2(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&&D(n,function(s,l){var u=s.dataByAxis||[],f=e[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&D(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&&D(g,function(y,m){var _=p[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),a&&D(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){tt.node||!i.getDom()||(Lf(this,"_updatePosition"),this._tooltipContent.dispose(),Jf("itemTooltip",i))},t.type="tooltip",t}(er);function Gn(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)),H(o)&&(o={formatter:o}),o&&(n=new Rt(o,n,i)))}return n}function gg(r,t){return r.dispatchAction||et(t.dispatchAction,t)}function O2(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 N2(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 B2(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 yg(r){return r==="center"||r==="middle"}function F2(r,t,e){var i=mh(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=ka(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=rt(u).tooltipConfig;if(f&&f.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}const V2=k2;function XR(r){ke(m1),r.registerComponentModel(_2),r.registerComponentView(V2),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ht),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ht)}var mg=D;function _g(r){if(r){for(var t in r)if(r.hasOwnProperty(t))return!0}}function Sg(r,t,e){var i={};return mg(t,function(a){var o=i[a]=n();mg(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=K(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 z2(r,t,e){var i;D(e,function(n){t.hasOwnProperty(n)&&_g(t[n])&&(i=!0)}),i&&D(e,function(n){t.hasOwnProperty(n)&&_g(t[n])?r[n]=K(t[n]):delete r[n]})}function H2(r,t,e,i){var n={};return D(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(x){return x0(s,h,x)}function f(x,w){CC(s,h,x,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 G2=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"])}},W2=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"]),F(i)&&D(i,function(a,o){H(a)&&(a={type:a}),i[o]=ot(a,G2(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 jf=W2;var Ui=bt,th=D,Ro=Ct,U2=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 Ro),this.group.add(this._selectorGroup=new Ro),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=y2(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=j(),h=i.get("selectedMode"),c=[];n.eachRawSeries(function(v){!v.get("legendHoverLink")&&c.push(v.id)}),th(i.getData(),function(v,d){var g=v.get("name");if(!this.newlineDisabled&&(g===""||g==="\n")){var p=new Ro;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"),x=m.getVisual("style"),w=this._createItem(y,g,d,v,i,e,_,x,S,h,a);w.on("click",Ui(wg,g,null,a,c)).on("mouseover",Ui(eh,y.name,null,a,c)).on("mouseout",Ui(rh,y.name,null,a,c)),n.ssr&&w.eachChild(function(b){var T=rt(b);T.seriesIndex=y.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),f.set(g,!0)}else n.eachRawSeries(function(b){if(!f.get(g)&&b.legendVisualProvider){var T=b.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),A=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),L=oe(A.fill);L&&L[3]===0&&(L[3]=.2,A=O(O({},A),{fill:cr(L,"rgba")}));var I=this._createItem(b,g,d,v,i,e,{},A,M,h,a);I.on("click",Ui(wg,null,g,a,c)).on("mouseover",Ui(eh,null,g,a,c)).on("mouseout",Ui(rh,null,g,a,c)),n.ssr&&I.eachChild(function(P){var R=rt(P);R.seriesIndex=b.seriesIndex,R.dataIndex=d,R.ssrType="legend"}),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();th(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"]);Na(h,{normal:c,emphasis:v},{defaultText:u.title}),yf(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=$2(f,a,l,u,v,p,c),x=new Ro,w=a.getModel("textStyle");if(Z(e.getLegendIcon)&&(!_||_==="inherit"))x.add(e.getLegendIcon({itemWidth:d,itemHeight:g,icon:f,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}));else{var b=_==="inherit"&&e.getData().getVisual("symbol")?y==="inherit"?e.getData().getVisual("symbolRotate"):y:0;x.add(Y2({itemWidth:d,itemHeight:g,icon:f,iconRotate:b,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,C=s,A=o.get("formatter"),M=i;H(A)&&A?M=A.replace("{name}",i!=null?i:""):Z(A)&&(M=A(i));var L=p?w.getTextColor():a.get("inactiveColor");x.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:x.getBoundingRect(),style:{fill:"transparent"}}),P=a.getModel("tooltip");return P.get("show")&&kh({el:I,componentModel:o,itemName:i,itemTooltipOption:P.option}),x.add(I),x.eachChild(function(R){R.silent=!0}),I.silent=!h,this.getContentGroup().add(x),yf(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();hn(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){hn("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 $2(r,t,e,i,n,a,o){function s(p,y){p.lineWidth==="auto"&&(p.lineWidth=y.lineWidth>0?2:0),th(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:kf(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 Y2(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 wg(r,t,e,i){rh(r,t,e,i),e.dispatchAction({type:"legendToggleSelect",name:r!=null?r:t}),eh(r,t,e,i)}function b1(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],_=X(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 x={x:0,y:0};if(x[o]=g?n[o]:v[o],x[s]=Math.max(v[s],d[s]),x[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]=x[s],h.setClipPath(new Mt({shape:w})),h.__rectSize=w[o]}else c.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Et(f,{x:b.contentPosition[0],y:b.contentPosition[1]},g?e:null),this._updatePageInfoView(e,b),x},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;D(["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",H(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=Vu[o],l=zu[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||_&&!x(_,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]),(!_||!x(m,_.s))&&y.i=b&&w.s<=b+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}(T1);const J2=Q2;function j2(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 tR(r){ke(M1),r.registerComponentModel(K2),r.registerComponentView(J2),j2(r)}function ZR(r){ke(M1),ke(tR)}var eR={get:function(r,t,e){var i=K((rR[r]||{})[t]);return e&&F(i)?i[i.length-1]:i}},rR={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 C1=eR;var Tg=te.mapVisual,iR=te.eachVisual,nR=F,Mg=D,aR=Sy,oR=je,sR=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&&z2(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var i=this.stateList;e=et(e,this),this.controllerVisuals=Sg(this.option.controller,i,e),this.targetVisuals=Sg(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){D(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||["<",">"],F(e)&&(e=e.slice(),u=!0);var f=i?e:u?[h(e[0]),h(e[1])]:h(e);if(H(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(Z(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=aR([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={});ot(a,n),ot(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){nR(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]={},Mg(d,function(p,y){if(te.isValidType(y)){var m=C1.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";Mg(this.stateList,function(y){var m=this.itemSize,_=h[y];_||(_=h[y]={color:s?d:[d]}),_.symbol==null&&(_.symbol=c&&K(c)||(s?p:[p])),_.symbolSize==null&&(_.symbolSize=v&&K(v)||(s?m[0]:[m[0],m[0]])),_.symbol=Tg(_.symbol,function(w){return w==="none"?p:w});var S=_.symbolSize;if(S!=null){var x=-1/0;iR(S,function(w){w>x&&(x=w)}),_.symbolSize=Tg(S,function(w){return oR(w,[0,x],[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=sR;var Cg=[20,140],lR=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]=Cg[0]),(e[1]==null||isNaN(e[1]))&&(e[1]=Cg[1])},t.prototype._resetRange=function(){var e=this.getExtent(),i=this.option.range;!i||i.auto?(e.auto=1,this.option.range=e):F(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),D(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=Sy((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=Dg(this,"outOfRange",this.getExtent()),n=Dg(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();hR([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=sn(n.handleLabelPoints[f],Wo(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=sn(f.indicatorLabelPoint,Wo(h,this.group)),_=f.indicatorLabel;_.attr("invisible",!1);var S=this._applyTransform("left",f.mainGroup),x=this._orient,w=x==="horizontal";_.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:w?S:"middle",align:w?"center":S});var b={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(b,C),_.animateTo(T,C)}else h.attr(b),_.attr(T);this._firstShowIndicator=!1;var A=this._shapes.handleLabels;if(A)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||Pg(n))&&(v=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=Yw(c,v);this._dispatchHighDown("downplay",qo(d[0],n)),this._dispatchHighDown("highlight",qo(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var i;if(ji(e.target,function(l){var u=rt(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 SR(r,t,e,i){for(var n=t.targetVisuals[i],a=te.prepareVisualTypes(n),o={color:b0(r.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),r.registerAction(yR,mR),D(_R,function(t){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,t)}),r.registerPreprocessor(wR))}function xR(r){r.registerComponentModel(uR),r.registerComponentView(gR),L1(r)}var bR=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=[],TR[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=K(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=G(this._pieceList,function(l){return l=K(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var e=this.option,i={},n=te.listVisualTypes(),a=this.isCategory();D(e.pieces,function(s){D(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),D(i,function(s,l){var u=!1;D(this.stateList,function(f){u=u||o(e,f,l)||o(e.target,f,l)},this),!u&&D(this.stateList,function(f){(e[f]||(e[f]={}))[l]=C1.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,D(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;D(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=K(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 D(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),TR={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 Og(r,t){var e=r.inverse;(r.orient==="vertical"?!e:e)&&t.reverse()}const MR=bR;var CR=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=vn(i.get("showLabel",!0),!h);h&&this._renderEndsText(e,h[0],u,c,l),D(f.viewPieceList,function(v){var d=v.piece,g=new Ct;g.onclick=et(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),hn(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:qo(s.findTargetDataIndices(i),s)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,i=e.option;if(i.orient==="vertical")return A1(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=G(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=K(n.selected),s=i.getSelectedMapKey(e);a==="single"||a===!0?(o[s]=!0,D(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}(D1);const DR=CR;function AR(r){r.registerComponentModel(MR),r.registerComponentView(DR),L1(r)}function qR(r){ke(xR),ke(AR)}var LR=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 o0(this),dd(this)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),dd(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:Ke},t}(pt),IR=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 PR(r){r.registerComponentModel(LR),r.registerComponentView(IR)}ke([qL,PR]);ke(sL);export{Br as $,ch as A,qe as B,pt as C,er as D,Aw as E,uP as F,G1 as G,XA as H,Ti as I,zR as J,HR as K,Ra as L,Rt as M,K as N,Ff as O,bt as P,ne as Q,Mt as R,Bm as S,W as T,ET as U,OR as V,BR as W,FR as X,VR as Y,ir as Z,J0 as _,GR as a,Tt as a0,Qe as a1,qL as a2,qR as a3,RR as a4,kR as a5,ER as a6,B as a7,WR as b,UR as c,ZR as d,$R as e,PR as f,YR as g,XR as h,NR as i,F as j,rt as k,D as l,G as m,ft as n,TD as o,oe as p,MD as q,Ku as r,U0 as s,Kh as t,ke as u,ot as v,st as w,Jv as x,D0 as y,It as z}; diff --git a/assets/es-8a2d24bf.js b/assets/es-8a2d24bf.js new file mode 100644 index 0000000..8728b34 --- /dev/null +++ b/assets/es-8a2d24bf.js @@ -0,0 +1 @@ +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/assets/fr-ab90ab77.js b/assets/fr-ab90ab77.js new file mode 100644 index 0000000..c387b0c --- /dev/null +++ b/assets/fr-ab90ab77.js @@ -0,0 +1 @@ +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/assets/hu-a56cb065.js b/assets/hu-a56cb065.js new file mode 100644 index 0000000..e1593e8 --- /dev/null +++ b/assets/hu-a56cb065.js @@ -0,0 +1 @@ +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/assets/index-17a5ec1d.js b/assets/index-17a5ec1d.js new file mode 100644 index 0000000..97e3373 --- /dev/null +++ b/assets/index-17a5ec1d.js @@ -0,0 +1,50 @@ +import{V as y,_ as xe,a as La,b as Yi,c as v,d as ae,e as vP,f as g,g as Ac,h as oe,i as q,j as ws,k as cr,l as $,m as _,n as te,o as ne,p as _e,q as dt,r as de,s as Ae,t as J,u as Is,v as vt,w as Ge,x as U,y as _P,z as _s,A as kc,B as Vt,C as Ee,D as $e,E as Oe,F as it,G as gt,H as Aa,I as Bs,J as zr,K as bP,L as Fc,M as Pe,N as as,O as Vo,P as pi,Q as ay,R as oy,S as Pr,T as Uo,U as rs,W as dp,X as yP,Y as CP,Z as $P,$ as Fr,a0 as Vn,a1 as ly,a2 as _i,a3 as xP,a4 as wP,a5 as ti,a6 as $r,a7 as qs,a8 as SP,a9 as PP,aa as DP,ab as TP,ac as MP,ad as cy,ae as EP,af as OP,ag as LP,ah as so,ai as ro,aj as AP,ak as kP,al as io,am as gg,an as FP,ao as RP,ap as vg,aq as jP,ar as HP}from"./vuetify-4c65b4c3.js";import{g as Ji,c as Dr,a as mp,O as $o}from"./overlayscrollbars-44d87bcf.js";import{i as IP,t as NP,u as VP,a as UP,b as BP,c as WP,d as GP,e as zP,f as ZP,g as qP,h as XP}from"./echarts-ff51454d.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 YP={exports:{}};(function(e){var s=function(t){var r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(F,z,w){F[z]=w.value},a,o=typeof Symbol=="function"?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(F,z,w){return Object.defineProperty(F,z,{value:w,enumerable:!0,configurable:!0,writable:!0}),F[z]}try{d({},"")}catch{d=function(z,w,A){return z[w]=A}}function m(F,z,w,A){var H=z&&z.prototype instanceof L?z:L,K=Object.create(H.prototype),le=new Y(A||[]);return n(K,"_invoke",{value:re(F,w,le)}),K}t.wrap=m;function h(F,z,w){try{return{type:"normal",arg:F.call(z,w)}}catch(A){return{type:"throw",arg:A}}}var p="suspendedStart",f="suspendedYield",b="executing",C="completed",S={};function L(){}function N(){}function R(){}var x={};d(x,l,function(){return this});var T=Object.getPrototypeOf,I=T&&T(T(ee([])));I&&I!==r&&i.call(I,l)&&(x=I);var j=R.prototype=L.prototype=Object.create(x);N.prototype=R,n(j,"constructor",{value:R,configurable:!0}),n(R,"constructor",{value:N,configurable:!0}),N.displayName=d(R,u,"GeneratorFunction");function W(F){["next","throw","return"].forEach(function(z){d(F,z,function(w){return this._invoke(z,w)})})}t.isGeneratorFunction=function(F){var z=typeof F=="function"&&F.constructor;return z?z===N||(z.displayName||z.name)==="GeneratorFunction":!1},t.mark=function(F){return Object.setPrototypeOf?Object.setPrototypeOf(F,R):(F.__proto__=R,d(F,u,"GeneratorFunction")),F.prototype=Object.create(j),F},t.awrap=function(F){return{__await:F}};function Z(F,z){function w(K,le,he,be){var we=h(F[K],F,le);if(we.type==="throw")be(we.arg);else{var st=we.arg,Pt=st.value;return Pt&&typeof Pt=="object"&&i.call(Pt,"__await")?z.resolve(Pt.__await).then(function(Ft){w("next",Ft,he,be)},function(Ft){w("throw",Ft,he,be)}):z.resolve(Pt).then(function(Ft){st.value=Ft,he(st)},function(Ft){return w("throw",Ft,he,be)})}}var A;function H(K,le){function he(){return new z(function(be,we){w(K,le,be,we)})}return A=A?A.then(he,he):he()}n(this,"_invoke",{value:H})}W(Z.prototype),d(Z.prototype,c,function(){return this}),t.AsyncIterator=Z,t.async=function(F,z,w,A,H){H===void 0&&(H=Promise);var K=new Z(m(F,z,w,A),H);return t.isGeneratorFunction(z)?K:K.next().then(function(le){return le.done?le.value:K.next()})};function re(F,z,w){var A=p;return function(K,le){if(A===b)throw new Error("Generator is already running");if(A===C){if(K==="throw")throw le;return se()}for(w.method=K,w.arg=le;;){var he=w.delegate;if(he){var be=k(he,w);if(be){if(be===S)continue;return be}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(A===p)throw A=C,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);A=b;var we=h(F,z,w);if(we.type==="normal"){if(A=w.done?C:f,we.arg===S)continue;return{value:we.arg,done:w.done}}else we.type==="throw"&&(A=C,w.method="throw",w.arg=we.arg)}}}function k(F,z){var w=z.method,A=F.iterator[w];if(A===a)return z.delegate=null,w==="throw"&&F.iterator.return&&(z.method="return",z.arg=a,k(F,z),z.method==="throw")||w!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+w+"' method")),S;var H=h(A,F.iterator,z.arg);if(H.type==="throw")return z.method="throw",z.arg=H.arg,z.delegate=null,S;var K=H.arg;if(!K)return z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,S;if(K.done)z[F.resultName]=K.value,z.next=F.nextLoc,z.method!=="return"&&(z.method="next",z.arg=a);else return K;return z.delegate=null,S}W(j),d(j,u,"Generator"),d(j,l,function(){return this}),d(j,"toString",function(){return"[object Generator]"});function G(F){var z={tryLoc:F[0]};1 in F&&(z.catchLoc=F[1]),2 in F&&(z.finallyLoc=F[2],z.afterLoc=F[3]),this.tryEntries.push(z)}function X(F){var z=F.completion||{};z.type="normal",delete z.arg,F.completion=z}function Y(F){this.tryEntries=[{tryLoc:"root"}],F.forEach(G,this),this.reset(!0)}t.keys=function(F){var z=Object(F),w=[];for(var A in z)w.push(A);return w.reverse(),function H(){for(;w.length;){var K=w.pop();if(K in z)return H.value=K,H.done=!1,H}return H.done=!0,H}};function ee(F){if(F||F===""){var z=F[l];if(z)return z.call(F);if(typeof F.next=="function")return F;if(!isNaN(F.length)){var w=-1,A=function H(){for(;++w=0;--A){var H=this.tryEntries[A],K=H.completion;if(H.tryLoc==="root")return w("end");if(H.tryLoc<=this.prev){var le=i.call(H,"catchLoc"),he=i.call(H,"finallyLoc");if(le&&he){if(this.prev=0;--w){var A=this.tryEntries[w];if(A.tryLoc<=this.prev&&i.call(A,"finallyLoc")&&this.prev=0;--z){var w=this.tryEntries[z];if(w.finallyLoc===F)return this.complete(w.completion,w.afterLoc),X(w),S}},catch:function(F){for(var z=this.tryEntries.length-1;z>=0;--z){var w=this.tryEntries[z];if(w.tryLoc===F){var A=w.completion;if(A.type==="throw"){var H=A.arg;X(w)}return H}}throw new Error("illegal catch attempt")},delegateYield:function(F,z,w){return this.delegate={iterator:ee(F),resultName:z,nextLoc:w},this.method==="next"&&(this.arg=a),S}},t}(e.exports);try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}})(YP);var uy=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(){!Gd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sD?(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(){!Gd||!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=tD.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}(),dy=function(e,s){for(var t=0,r=Object.keys(s);t"u"||!(Element instanceof Object))){if(!(s instanceof bi(s).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(s)||(t.set(s,new dD(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 bi(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 mD(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}(),hy=typeof WeakMap<"u"?new WeakMap:new uy,py=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=rD.getInstance(),r=new hD(s,t,this);hy.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){py.prototype[e]=function(){var s;return(s=hy.get(this))[e].apply(s,arguments)}});(function(){return typeof Bo.ResizeObserver<"u"?Bo.ResizeObserver:py})();/** + * vue-class-component v7.2.6 + * (c) 2015-present Evan You + * @license MIT + */function xo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xo=function(s){return typeof s}:xo=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},xo(e)}function pD(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function fD(e){return gD(e)||vD(e)||_D()}function gD(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(zd.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 pD({},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 wD(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 PD(a,e,n),bD()&&yD(a,e),a}var SD={prototype:!0,arguments:!0,callee:!0,caller:!0};function PD(e,s,t){Object.getOwnPropertyNames(s).forEach(function(r){if(!SD[r]){var i=Object.getOwnPropertyDescriptor(e,r);if(!(i&&!i.configurable)){var n=Object.getOwnPropertyDescriptor(s,r);if(!$D){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!xD(n.value)&&a&&a.value===n.value)return}Object.defineProperty(e,r,n)}}})}function D(e){return typeof e=="function"?bg(e):function(s){return bg(s,e)}}D.registerHooks=function(s){zd.push.apply(zd,fD(s))};globalThis&&globalThis.__spreadArrays;var DD=typeof Reflect<"u"&&typeof Reflect.getMetadata<"u";function TD(e,s,t){if(DD&&!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 P(e){return e===void 0&&(e={}),function(s,t){TD(e,s,t),jc(function(r,i){(r.props||(r.props={}))[i]=e})(s,t)}}function fy(e){return jc(function(s,t){s.computed=s.computed||{},s.computed[t]={cache:!1,get:function(){return this.$refs[e||t]}}})}function MD(e){e===void 0&&(e={});var s="value";return jc(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 jc(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 ED=Object.defineProperty,OD=Object.getOwnPropertyDescriptor,LD=(e,s,t,r)=>{for(var i=r>1?void 0:r?OD(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&&ED(s,t,i),i};let O=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 t,r,i,n;const e=(t=this.$store.state.gui.uiSettings.powerDeviceName)!=null?t:null;return e!==null?e:(n=(i=((r=this.$store.getters["server/power/getDevices"])!=null?r:[]).find(a=>a.device.toLowerCase()==="printer"))==null?void 0:i.device)!=null?n:"printer"}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)}};O=LD([D],O);const gy="dark",vy="mainsail",Rr="#D41216",Go="#2196f3",qt="#1e1e1e",yg="v0.11.0-257",Cg="v0.8.0-306",AD=[{name:"safari",version:"16.5.2"}],kD=["#F44336","#8e379d","#03DAC5","#3F51B5","#ffde03","#009688","#E91E63"],FD="#2196F3",RD="#4CAF50",_y="99",by="44",yi=".theme",jD=1e3,Dn=["temperature","target","power","speed"],Un=["power","speed"],HD=["bme280","aht10","htu21d"],Ci=[".gcode",".g",".gco",".ufp",".nc"],yy=["history","power","updateManager","timelapse","jobQueue","announcements","spoolman","sensor"],ID=["virtual_sdcard","pause_resume","gcode_macro pause","gcode_macro resume","gcode_macro cancel_print"],ND=["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"],no=500,VD=50,UD=["toolhead-control","extruder-control","macros","machine-settings","miniconsole","miscellaneous","spoolman","temperature","webcam"],bs=30,ys=64,rr=128,BD=220,WD=48,Zd=48,kn=48,GD=["^_TIMELAPSE_NEW_FRAME","^TIMELAPSE_TAKE_FRAME","^TIMELAPSE_RENDER","^_SET_TIMELAPSE_SETUP","^HYPERLAPSE ACTION=","^SET_GCODE_VARIABLE MACRO=TIMELAPSE_"],zD=["gcodes","timelapse","timelapse_frames"],ZD=[".git"],qD=["it","hu","zh"],XD=["klippy","moonraker","crowsnest","mmu","sonar"],YD=["klipper","moonraker"],fi=[{name:"mainsail",displayName:"Mainsail",colorLogo:Rr},{name:"klipper",displayName:"Klipper",colorLogo:"#b12f35",logo:{show:!0,light:!1}},{name:"voron",displayName:"Voron Design",colorLogo:"#FF2300",logo:{show:!0,light:!1}},{name:"ldo",displayName:"LDO Motion (Sponsor)",colorLogo:"#326799",colorPrimary:"#326799",logo:{show:!0,light:!1}},{name:"yumi",displayName:"YUMI (Sponsor)",colorLogo:"#F6CF3D",colorPrimary:"#F6CF3D",logo:{show:!0,light:!1}},{name:"vzbot",displayName:"VzBot",colorLogo:"#FF0000",logo:{show:!0,light:!1},sidebarBackground:{show:!0,light:!1}},{name:"prusa",displayName:"Prusa Research (Sponsor)",colorLogo:"#fa6831",colorPrimary:"#fa6831",logo:{show:!0,light:!1}},{name:"btt",displayName:"BigTreeTech (Sponsor)",colorLogo:"#ef0025",logo:{show:!0,light:!1}},{name:"multec",displayName:"Multec GmbH (Sponsor)",colorLogo:"#234D7A",colorPrimary:"#234D7A",logo:{show:!0,light:!1}}];var Ki="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",Bn="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,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z",JD="M9.29,3.25L5.16,6.72L4,5.34L8.14,1.87L9.29,3.25M22,5.35L20.84,6.73L16.7,3.25L17.86,1.87L22,5.35M13,4A8,8 0 0,1 21,12A8,8 0 0,1 13,20A8,8 0 0,1 5,12A8,8 0 0,1 13,4M13,6A6,6 0 0,0 7,12A6,6 0 0,0 13,18A6,6 0 0,0 19,12A6,6 0 0,0 13,6M12,7.5H13.5V12.03L16.72,13.5L16.1,14.86L12,13V7.5M1,14C1,11.5 2.13,9.3 3.91,7.83C3.33,9.1 3,10.5 3,12L3.06,13.13L3,14C3,16.28 4.27,18.26 6.14,19.28C7.44,20.5 9.07,21.39 10.89,21.78C10.28,21.92 9.65,22 9,22A8,8 0 0,1 1,14Z",KD="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",QD="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",Cy="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",$y="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",Wn="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",Hc="M19.92,12.08L12,20L4.08,12.08L5.5,10.67L11,16.17V2H13V16.17L18.5,10.66L19.92,12.08M12,20H2V22H22V20H12Z",eT="M4,12H20V14H4V12M4,9H20V11H4V9M16,4L12,8L8,4H11V1H13V4H16M8,19L12,15L16,19H13V22H11V19H8Z",tT="M9,4H15V12H19.84L12,19.84L4.16,12H9V4Z",xy="M2,20V22H22V20H13V5.83L18.5,11.33L19.92,9.92L12,2L4.08,9.92L5.5,11.33L11,5.83V20H2Z",sT="M13,9V15H16L12,19L8,15H11V9H8L12,5L16,9H13M4,2H20V4H4V2M4,20H20V22H4V20Z",rT="M15,20H9V12H4.16L12,4.16L19.84,12H15V20Z",iT="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",nT="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",aT="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",wy="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",Ic="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.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,3H18V1M17,12H12V17H17V12Z",gce="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",oT="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",Sy="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",lT="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",cT="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",Py="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",hp="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",pp="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",Dy="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",uT="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",Ty="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",hr="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",dT="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",mT="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",hT="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",pT="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",Nc="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",fT="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",ka="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",gT="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",zo="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",vT="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",pe="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",Gn="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",zn="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",_T="M22.12 21.46L2.4 1.73L1.12 3L4 5.87L2.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 12S4.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.38 18.72 15.83 18.45 16.26 18.14L20.85 22.73L22.12 21.46M12 15.5C10.07 15.5 8.5 13.93 8.5 12C8.5 11.5 8.62 11.08 8.79 10.67L13.33 15.21C12.92 15.39 12.5 15.5 12 15.5M11.74 8.53L8.56 5.35C8.75 5.25 8.93 5.15 9.13 5.07L9.5 2.42C9.54 2.18 9.75 2 10 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 19.66 5.27L21.66 8.73C21.78 8.95 21.73 9.22 21.54 9.37L19.43 11C19.47 11.34 19.5 11.67 19.5 12S19.47 12.65 19.43 12.97L21.54 14.63C21.73 14.78 21.78 15.05 21.66 15.27L20.5 17.29L15.47 12.26C15.5 12.18 15.5 12.09 15.5 12C15.5 10.07 13.93 8.5 12 8.5C11.91 8.5 11.83 8.5 11.74 8.53Z",bT="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",fp="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",Fa="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",gp="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",My="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",yT="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",CT="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",Ey="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",$T="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",ze="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",xT="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",wT="M8,3C6.89,3 6,3.89 6,5V21H18V5C18,3.89 17.11,3 16,3H8M8,5H16V19H8V5M13,11V13H15V11H13Z",ST="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",Vc="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",Oy="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Ra="M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z",Ly="M12,5L5.33,15H18.67M5,17H19V19H5V17Z",Ay="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",PT="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",vce="M13,6V18L21.5,12M4,18L12.5,12L4,6V18Z",pr="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",DT="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",TT="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",ja="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",Uc="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",MT="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z",ET="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",ky="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",OT="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",Fy="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",Ry="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",LT="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",AT="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",kT="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",Qi="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",FT="M7,2V13H10V22L17,10H13L17,2H7Z",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",RT="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",jT="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,4A8,8 0 0,1 20,12C20,14.4 19,16.5 17.3,18C15.9,16.7 14,16 12,16C10,16 8.2,16.7 6.7,18C5,16.5 4,14.4 4,12A8,8 0 0,1 12,4M14,5.89C13.62,5.9 13.26,6.15 13.1,6.54L11.81,9.77L11.71,10C11,10.13 10.41,10.6 10.14,11.26C9.73,12.29 10.23,13.45 11.26,13.86C12.29,14.27 13.45,13.77 13.86,12.74C14.12,12.08 14,11.32 13.57,10.76L13.67,10.5L14.96,7.29L14.97,7.26C15.17,6.75 14.92,6.17 14.41,5.96C14.28,5.91 14.15,5.89 14,5.89M10,6A1,1 0 0,0 9,7A1,1 0 0,0 10,8A1,1 0 0,0 11,7A1,1 0 0,0 10,6M7,9A1,1 0 0,0 6,10A1,1 0 0,0 7,11A1,1 0 0,0 8,10A1,1 0 0,0 7,9M17,9A1,1 0 0,0 16,10A1,1 0 0,0 17,11A1,1 0 0,0 18,10A1,1 0 0,0 17,9Z",Bc="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",jy="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",Wc="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",Hy="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",HT="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",Iy="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",kt="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",Ny="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",IT="M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22M12.3 7.29C12.5 7.11 12.74 7 13 7C13.27 7 13.5 7.11 13.71 7.29C13.9 7.5 14 7.74 14 8C14 8.27 13.9 8.5 13.71 8.71C13.5 8.9 13.27 9 13 9C12.74 9 12.5 8.9 12.3 8.71C12.11 8.5 12 8.27 12 8C12 7.74 12.11 7.5 12.3 7.29M9.8 11.97C9.8 11.97 11.97 10.25 12.76 10.18C13.5 10.12 13.35 10.97 13.28 11.41L13.27 11.47C13.13 12 12.96 12.64 12.79 13.25C12.41 14.64 12.04 16 12.13 16.25C12.23 16.59 12.85 16.16 13.3 15.86C13.36 15.82 13.41 15.78 13.46 15.75C13.46 15.75 13.54 15.67 13.62 15.78C13.64 15.81 13.66 15.84 13.68 15.86C13.77 16 13.82 16.05 13.7 16.13L13.66 16.15C13.44 16.3 12.5 16.96 12.12 17.2C11.71 17.47 10.14 18.37 10.38 16.62C10.59 15.39 10.87 14.33 11.09 13.5C11.5 12 11.68 11.32 10.76 11.91C10.39 12.13 10.17 12.27 10.04 12.36C9.93 12.44 9.92 12.44 9.85 12.31L9.82 12.25L9.77 12.17C9.7 12.07 9.7 12.06 9.8 11.97Z",NT="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",qd="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",Vy="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",VT="M11 9.47V11H14.76L13 14.53V13H9.24L11 9.47M13 1L6 15H11V23L18 9H13V1Z",Uy="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",UT="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",By="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",Gc="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",zc="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",Wy="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",BT="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",fr="M7,10L12,15L17,10H7Z",WT="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",GT="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",zT="M21 11C21 6.03 16.97 2 12 2S3 6.03 3 11C3 14.92 5.5 18.24 9 19.5V22H11V19.94C11.33 20 11.66 20 12 20S12.67 20 13 19.94V22H15V19.5C18.5 18.24 21 14.92 21 11M12 18C8.14 18 5 14.86 5 11S8.14 4 12 4 19 7.14 19 11 15.86 18 12 18M8 7H16V9H8V7M12.75 10L9.75 13L11 14.25L9.75 15.5L11.25 17L14.25 14L13 12.75L14.25 11.5L12.75 10Z",Gy="M19,13H5V11H19V13Z",ZT="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",qT="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",XT="M2 12A10 10 0 0 0 15 21.54A10 10 0 0 1 15 2.46A10 10 0 0 0 2 12Z",zy="M18.13 12L19.39 10.74C19.83 10.3 20.39 10.06 21 10V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H11V19.13L11.13 19H5V5H12V12H18.13M14 4.5L19.5 10H14V4.5M19.13 13.83L21.17 15.87L15.04 22H13V19.96L19.13 13.83M22.85 14.19L21.87 15.17L19.83 13.13L20.81 12.15C21 11.95 21.33 11.95 21.53 12.15L22.85 13.47C23.05 13.67 23.05 14 22.85 14.19Z",Zy="M5 19V5H12V12H19V13C19.7 13 20.37 13.13 21 13.35V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H13.35C13.13 20.37 13 19.7 13 19H5M14 4.5L19.5 10H14V4.5M23 18V20H20V23H18V20H15V18H18V15H20V18H23Z",YT="M15 3H5A2 2 0 0 0 3 5V19A2 2 0 0 0 5 21H19A2 2 0 0 0 21 19V9L15 3M19 19H5V5H14V10H19M17 14H7V12H17M14 17H7V15H14",Zc="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",JT="M16.75 22.16L14 19.16L15.16 18L16.75 19.59L20.34 16L21.5 17.41L16.75 22.16M3 7V5H5V4C5 2.89 5.9 2 7 2H13V9L15.5 7.5L18 9V2H19C20.05 2 21 2.95 21 4V13.8C20.12 13.29 19.09 13 18 13C14.69 13 12 15.69 12 19C12 20.09 12.29 21.12 12.8 22H7C5.95 22 5 21.05 5 20V19H3V17H5V13H3V11H5V7H3M5 5V7H7V5H5M5 19H7V17H5V19M5 13H7V11H5V13Z",qy="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",Xy="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",KT="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",qc="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",Dp="M14,19H18V5H14M6,19H10V5H6V19Z",bt="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",en="M8,5.14V19.14L19,12.14L8,5.14Z",Xc="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z",QT="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",Tp="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",e3="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",Yy="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",t3="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",Jy="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",Ws="M7,2H17V8H19V13H16.5L13,17H11L7.5,13H5V8H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22Z",Ky="M7 2H17V8H19V13H16.5L13 17H11L7.5 13H5V8H7V2M10 22H2V20H10C10.6 20 11 19.5 11 19V18H13V19C13 20.7 11.7 22 10 22M21 13V7H23V13H21M21 17V15H23V17H21Z",s3="M7,2H17V7H19V13H16.5L13,17H11L7.5,13H5V7H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22M7,9V11H8.5L12,15L15.5,11H17V9H15V4H9V9H7Z",r3="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",Qy="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",Zo="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",i3="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",e2="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",n3="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",tn="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",a3="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",_ce="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",Yc="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",Zr="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",o3="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",l3="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",c3="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",u3="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",qo="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",t2="M2,21L23,12L2,3V10L17,12L2,14V21Z",d3="M23,12H17V10L20.39,6H17V4H23V6L19.62,10H23V12M15,16H9V14L12.39,10H9V8H15V10L11.62,14H15V16M7,20H1V18L4.39,14H1V12H7V14L3.62,18H7V20Z",Mp="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",m3="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",bce="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",s2="M18,18H6V6H18V18Z",h3="M9,3L5,7H8V14H10V7H13M16,17V10H14V17H11L15,21L19,17H16Z",r2="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",p3="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",i2="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",n2="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",a2="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",o2="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",l2="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",f3="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",g3="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",c2="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",u2="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",v3="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",_3="M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z",b3="M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z",Ia="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",y3="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",d2="M15,7V11H16V13H13V5H15L12,1L9,5H11V13H8V10.93C8.7,10.56 9.2,9.85 9.2,9C9.2,7.78 8.21,6.8 7,6.8C5.78,6.8 4.8,7.78 4.8,9C4.8,9.85 5.3,10.56 6,10.93V13A2,2 0 0,0 8,15H11V18.05C10.29,18.41 9.8,19.15 9.8,20A2.2,2.2 0 0,0 12,22.2A2.2,2.2 0 0,0 14.2,20C14.2,19.15 13.71,18.41 13,18.05V15H16A2,2 0 0,0 18,13V11H19V7H15Z",Jc="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",C3="M19,5V7H15V5H19M9,5V11H5V5H9M19,13V19H15V13H19M9,17V19H5V17H9M21,3H13V9H21V3M11,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z",$g="M3,11H11V3H3M3,21H11V13H3M13,21H21V13H13M13,3V11H21V3",sn="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",$3="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",x3="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",w3=Object.defineProperty,S3=Object.getOwnPropertyDescriptor,Ds=(e,s,t,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 Xt=class extends M(O){constructor(){super(...arguments),this.mdiChevronDown=hr,this.panelToolbarHeight=Zd}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"}};Ds([P({default:null})],Xt.prototype,"icon",2);Ds([P({required:!0,default:""})],Xt.prototype,"title",2);Ds([P({default:!1})],Xt.prototype,"collapsible",2);Ds([P({required:!0})],Xt.prototype,"cardClass",2);Ds([P({default:""})],Xt.prototype,"toolbarColor",2);Ds([P({default:""})],Xt.prototype,"toolbarClass",2);Ds([P({default:!1})],Xt.prototype,"loading",2);Ds([P({default:!0})],Xt.prototype,"marginBottom",2);Ds([P({default:!1})],Xt.prototype,"hideButtonsOnCollapse",2);Xt=Ds([D],Xt);var P3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{class:"panel "+e.cardClass+" "+(e.marginBottom?"mb-3 mb-md-6":"")+" "+(e.expand?"":"expanded"),attrs:{loading:e.loading}},[t(La,{staticClass:"panel-toolbar",class:e.getToolbarClass,style:e.additionalStyle,attrs:{flat:"",dense:"",color:e.toolbarColor,height:e.panelToolbarHeight}},[e._t("buttons-left"),t(Yi,{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(ae),t(vP,{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(Ac,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand||!e.collapsible,expression:"expand || !collapsible"}]},[e._t("default")],2)])],1)},D3=[];function E(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(m){m=m||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!m&&typeof __VUE_SSR_CONTEXT__<"u"&&(m=__VUE_SSR_CONTEXT__),i&&i.call(this,m),m&&m._registeredComponents&&m._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(h,p){return c.call(p),u(h,p)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}const xg={};var T3=E(Xt,P3,D3,!1,M3,"3cfcc6d8",null,null);function M3(e){for(let s in xg)this[s]=xg[s]}const B=function(){return T3.exports}();var E3=Object.defineProperty,O3=Object.getOwnPropertyDescriptor,L3=(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&&E3(s,t,i),i};let Xd=class extends M(O){constructor(){super(...arguments),this.addPrinterValid=!1,this.dialogAddPrinter={bool:!1,hostname:"",port:7125,path:"/",name:""},this.editPrinterValid=!1,this.dialogEditPrinter={bool:!1,id:"",hostname:"",port:0,path:"/",name:""},this.showOptionalSettings=!1,this.mdiConnection=fp,this.mdiCloseThick=pe,this.mdiSync=r2,this.mdiDelete=ze,this.mdiPencil=bt,this.mdiCheckboxMarkedCircle=Dy,this.mdiCancel=Sy,this.mdiShowOptional=us,this.mdiHideOptional=_T}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 path(){return this.$store.state.socket.path}get name(){return this.$store.state.printer}get formatHostname(){return this.hostname+(this.port!==""?":"+this.port:"")+(this.path!==""?this.path:"")}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,path:this.dialogAddPrinter.path,name:this.dialogAddPrinter.name};this.$store.dispatch("gui/remoteprinters/store",{values:e}),this.dialogAddPrinter.hostname="",this.dialogAddPrinter.bool=!1,this.dialogAddPrinter.path="/",this.dialogAddPrinter.name=""}editPrinter(e){var s,t,r;this.dialogEditPrinter.hostname=e.hostname,this.dialogEditPrinter.port=e.port,this.dialogEditPrinter.id=(s=e.id)!=null?s:"",this.dialogEditPrinter.path=(t=e.path)!=null?t:"/",this.dialogEditPrinter.name=(r=e.name)!=null?r:"",this.dialogEditPrinter.bool=!0,this.showOptionalSettings=e.name?e.name.length>0:!1}updatePrinter(){const e={hostname:this.dialogEditPrinter.hostname,port:this.dialogEditPrinter.port,path:this.dialogEditPrinter.path,id:this.dialogEditPrinter.id,name:this.dialogEditPrinter.name};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,path:e.socket.path});const s=e.socket.path.replaceAll(/(^\/*)|(\/*$)/g,""),t=this.protocol+"://"+e.socket.hostname+":"+e.socket.port+(s.length>0?"/".concat(s):"")+"/websocket";this.$socket.setUrl(t),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").then(()=>{if(!("printer"in this.$route.query))return;let e=this.$route.query.printer.toString().toLowerCase(),s=this.printers.filter(t=>{var r;return((r=t.name)==null?void 0:r.toLowerCase())===e});if(s.length==0){window.console.error("No printer with given name '".concat(e,"' found. Showing selection dialog instead."));return}if(s.length>1){window.console.error("Multiple printers with name '".concat(e,"' found. Showing selection dialog instead."));return}this.connect(s[0])})}};Xd=L3([D({components:{Panel:B}})],Xd);var A3=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(B,{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(ws,{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(cr,{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($,[t(_,{staticClass:"col-8"},[t(te,{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(te,{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),e.showOptionalSettings?t($,[t(_,{attrs:{cols:6}},[t(te,{attrs:{rules:[function(r){return!r||r.startsWith("/")||"Path must start with /"}],label:e.$t("SelectPrinterDialog.Path"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.dialogAddPrinter.path,callback:function(r){e.$set(e.dialogAddPrinter,"path",r)},expression:"dialogAddPrinter.path"}})],1),t(_,{attrs:{cols:6}},[t(te,{attrs:{label:e.$t("SelectPrinterDialog.Name"),outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogAddPrinter.name,callback:function(r){e.$set(e.dialogAddPrinter,"name",r)},expression:"dialogAddPrinter.name"}})],1)],1):e._e()],1),t(ne,[t(_e,{staticClass:"ml-2",attrs:{"on-icon":e.mdiShowOptional,"off-icon":e.mdiHideOptional,"true-value":!1,"false-value":!0},model:{value:e.showOptionalSettings,callback:function(r){e.showOptionalSettings=r},expression:"showOptionalSettings"}}),t(ae),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(cr,{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($,[t(_,{staticClass:"col-8"},[t(te,{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(te,{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),e.showOptionalSettings?t($,[t(_,{attrs:{cols:6}},[t(te,{attrs:{rules:[function(r){return!r||r.startsWith("/")||"Path must start with /"}],label:e.$t("SelectPrinterDialog.Path"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.dialogEditPrinter.path,callback:function(r){e.$set(e.dialogEditPrinter,"path",r)},expression:"dialogEditPrinter.path"}})],1),t(_,{attrs:{cols:6}},[t(te,{attrs:{label:e.$t("SelectPrinterDialog.Name"),outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogEditPrinter.name,callback:function(r){e.$set(e.dialogEditPrinter,"name",r)},expression:"dialogEditPrinter.name"}})],1)],1):e._e()],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(_e,{staticClass:"ml-2",attrs:{"on-icon":e.mdiShowOptional,"off-icon":e.mdiHideOptional,"true-value":!1,"false-value":!0},model:{value:e.showOptionalSettings,callback:function(r){e.showOptionalSettings=r},expression:"showOptionalSettings"}}),t(ae),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($,[t(_,{staticClass:"px-6"},e._l(e.printers,function(r,i){return t($,{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($,{attrs:{align:"center"}},[t(_,{staticClass:"col-auto pr-0"},[r.socket.isConnecting?t(dt,{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($,[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($,[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($,[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)},k3=[];const wg={};var F3=E(Xd,A3,k3,!1,R3,null,null,null);function R3(e){for(let s in wg)this[s]=wg[s]}const Op=function(){return F3.exports}();var j3=Object.defineProperty,H3=Object.getOwnPropertyDescriptor,I3=(e,s,t,r)=>{for(var i=r>1?void 0:r?H3(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&&j3(s,t,i),i};let Yd=class extends M(O){constructor(){super(...arguments),this.mdiHelpCircleOutline=Hy,this.mdiCloseThick=pe,this.mdiMoonWaningCrescent=XT}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:""}};Yd=I3([D({})],Yd);var N3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(de,{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(Ae,{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)},V3=[];const Sg={};var U3=E(Yd,N3,V3,!1,B3,"24513c96",null,null);function B3(e){for(let s in Sg)this[s]=Sg[s]}const m2=function(){return U3.exports}();var W3=Object.defineProperty,G3=Object.getOwnPropertyDescriptor,Lp=(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 Zn=class extends M(O){constructor(){super(...arguments),this.internalColor=Rr}colorChanged(e){this.internalColor=e!==""?e:Rr}created(){this.color!==""&&(this.internalColor=this.color)}};Lp([P({required:!1,default:""})],Zn.prototype,"color",2);Lp([me("color")],Zn.prototype,"colorChanged",1);Zn=Lp([D],Zn);var z3=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"}})])])},Z3=[];const Pg={};var q3=E(Zn,z3,Z3,!1,X3,null,null,null);function X3(e){for(let s in Pg)this[s]=Pg[s]}const rn=function(){return q3.exports}();var Y3=Object.defineProperty,J3=Object.getOwnPropertyDescriptor,h2=(e,s,t,r)=>{for(var i=r>1?void 0:r?J3(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&&Y3(s,t,i),i};let Xo=class extends M(O){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"}};h2([P({type:Object,required:!0})],Xo.prototype,"item",2);Xo=h2([D],Xo);var K3=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(de,{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(J,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(Is,{staticClass:"my-3 mr-3 menu-item-icon"},[t(v,[e._v(e._s(e.icon))])],1),t(vt,[t(Ge,{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(U,{staticClass:"my-1"}):e._e()],1)},Q3=[];const Dg={};var e5=E(Xo,K3,Q3,!1,t5,"99ab1bec",null,null);function t5(e){for(let s in Dg)this[s]=Dg[s]}const p2=function(){return e5.exports}(),s5="modulepreload",r5=function(e){return"/"+e},Tg={},fe=function(s,t,r){if(!t||t.length===0)return s();const i=document.getElementsByTagName("link");return Promise.all(t.map(n=>{if(n=r5(n),n in Tg)return;Tg[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":s5,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 i5=Object.defineProperty,n5=Object.getOwnPropertyDescriptor,a5=(e,s,t,r)=>{for(var i=r>1?void 0:r?n5(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&&i5(s,t,i),i};let Ke=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})}};Ke=a5([D],Ke);var o5=Object.defineProperty,l5=Object.getOwnPropertyDescriptor,c5=(e,s,t,r)=>{for(var i=r>1?void 0:r?l5(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&&o5(s,t,i),i};let $i=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}};$i=c5([D],$i);var u5=Object.defineProperty,d5=Object.getOwnPropertyDescriptor,m5=(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&&u5(s,t,i),i};let Jd=class extends M(O,Ke,$i){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Ws,this.mdiDotsVertical=Vc,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||this.purgeFilamentMacro!==void 0||this.cleanNozzleMacro!==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}};Jd=m5([D({components:{Panel:B}})],Jd);var h5=Object.defineProperty,p5=Object.getOwnPropertyDescriptor,xt=(e,s,t,r)=>{for(var i=r>1?void 0:r?p5(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&&h5(s,t,i),i};let mt=class extends M(O){constructor(){super(...arguments),this.mdiRestart=Zr,this.mdiChevronUp=Nc,this.mdiChevronDown=hr,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)},g5=[];const Mg={};var v5=E(mt,f5,g5,!1,_5,"799eadb6",null,null);function _5(e){for(let s in Mg)this[s]=Mg[s]}const je=function(){return v5.exports}();var f2="Expected a function",Eg=0/0,b5="[object Symbol]",y5=/^\s+|\s+$/g,C5=/^[-+]0x[0-9a-f]+$/i,$5=/^0b[01]+$/i,x5=/^0o[0-7]+$/i,w5=parseInt,S5=typeof Dr=="object"&&Dr&&Dr.Object===Object&&Dr,P5=typeof self=="object"&&self&&self.Object===Object&&self,D5=S5||P5||Function("return this")(),T5=Object.prototype,M5=T5.toString,E5=Math.max,O5=Math.min,ud=function(){return D5.Date.now()};function L5(e,s,t){var r,i,n,a,o,l,c=0,u=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(f2);s=Og(s)||0,Yo(t)&&(u=!!t.leading,d="maxWait"in t,n=d?E5(Og(t.maxWait)||0,s):n,m="trailing"in t?!!t.trailing:m);function h(x){var T=r,I=i;return r=i=void 0,c=x,a=e.apply(I,T),a}function p(x){return c=x,o=setTimeout(C,s),u?h(x):a}function f(x){var T=x-l,I=x-c,j=s-T;return d?O5(j,n-I):j}function b(x){var T=x-l,I=x-c;return l===void 0||T>=s||T<0||d&&I>=n}function C(){var x=ud();if(b(x))return S(x);o=setTimeout(C,f(x))}function S(x){return o=void 0,m&&r?h(x):(r=i=void 0,a)}function L(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function N(){return o===void 0?a:S(ud())}function R(){var x=ud(),T=b(x);if(r=arguments,i=this,l=x,T){if(o===void 0)return p(l);if(d)return o=setTimeout(C,s),h(l)}return o===void 0&&(o=setTimeout(C,s)),a}return R.cancel=L,R.flush=N,R}function A5(e,s,t){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(f2);return Yo(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),L5(e,s,{leading:r,maxWait:s,trailing:i})}function Yo(e){var s=typeof e;return!!e&&(s=="object"||s=="function")}function k5(e){return!!e&&typeof e=="object"}function F5(e){return typeof e=="symbol"||k5(e)&&M5.call(e)==b5}function Og(e){if(typeof e=="number")return e;if(F5(e))return Eg;if(Yo(e)){var s=typeof e.valueOf=="function"?e.valueOf():e;e=Yo(s)?s+"":s}if(typeof e!="string")return e===0?e:+e;e=e.replace(y5,"");var t=$5.test(e);return t||x5.test(e)?w5(e.slice(2),t?2:8):C5.test(e)?Eg:+e}var R5=A5;const g2=Ji(R5);var j5=Object.defineProperty,H5=Object.getOwnPropertyDescriptor,v2=(e,s,t,r)=>{for(var i=r>1?void 0:r?H5(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&&j5(s,t,i),i};let Jo=class extends O{constructor(){super(...arguments),this.el={is:{}}}mounted(){this.breakpoints&&this.$nextTick(()=>{this.observer=new ResizeObserver(g2(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))}};v2([P()],Jo.prototype,"breakpoints",2);Jo=v2([D],Jo);var I5=Object.defineProperty,N5=Object.getOwnPropertyDescriptor,_2=(e,s,t,r)=>{for(var i=r>1?void 0:r?N5(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&&I5(s,t,i),i};let Ko=class extends M(Jo){constructor(){super(...arguments),this.init=!1}mounted(){this.init=!0}};_2([P({default:!1})],Ko.prototype,"noHide",2);Ko=_2([D],Ko);var V5=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)},U5=[];const Lg={};var B5=E(Ko,V5,U5,!1,W5,null,null,null);function W5(e){for(let s in Lg)this[s]=Lg[s]}const et=function(){return B5.exports}();var Kc={};const G5=mp(_P);/** + * vue-class-component v6.3.2 + * (c) 2015-present Evan You + * @license MIT + */Object.defineProperty(Kc,"__esModule",{value:!0});function z5(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Kd=z5(G5),Z5=typeof Reflect<"u"&&Reflect.defineMetadata;function q5(e,s){dd(e,s),Object.getOwnPropertyNames(s.prototype).forEach(function(t){dd(e.prototype,s.prototype,t)}),Object.getOwnPropertyNames(s).forEach(function(t){dd(e,s,t)})}function dd(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 X5={__proto__:[]},Y5=X5 instanceof Array;function J5(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 K5(){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 eM(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 Kd?i.constructor:Kd,a=n.extend(s);return tM(a,e,n),Z5&&q5(a,e),a}function tM(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(!Y5){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!Q5(n.value)&&a&&a.value===n.value)return}Object.defineProperty(e,r,n)}}})}function b2(e){return typeof e=="function"?Ag(e):function(s){return Ag(s,e)}}b2.registerHooks=function(s){Qd.push.apply(Qd,s)};Kc.default=b2;var sM=Kc.createDecorator=J5;Kc.mixins=K5;function qe(e){return sM(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?iM(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&&rM(s,t,i),i};let Ze=class extends M(O){constructor(){super(...arguments),this.mdiRestart=Zr,this.mdiLockOutline=Gc,this.mdiLockOpenVariantOutline=By,this.mdiMinus=Gy,this.mdiPlus=Tp,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(kc,{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)},aM=[];const kg={};var oM=E(Ze,nM,aM,!1,lM,"2b843f9d",null,null);function lM(e){for(let s in kg)this[s]=kg[s]}const Qc=function(){return oM.exports}();var cM=Object.defineProperty,uM=Object.getOwnPropertyDescriptor,y2=(e,s,t,r)=>{for(var i=r>1?void 0:r?uM(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&&cM(s,t,i),i};let Qo=class extends M(O,$i){constructor(){super(...arguments),this.mdiArrowDownBold=tT,this.mdiArrowUpBold=rT,this.mdiPrinter3dNozzle=Ws}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"})}};y2([me("maxExtrudeOnlyDistance",{immediate:!0})],Qo.prototype,"onMaxExtrudeOnlyDistanceChange",1);Qo=y2([D({components:{NumberInput:je,Responsive:et,ToolSlider:Qc}})],Qo);var dM=Object.defineProperty,mM=Object.getOwnPropertyDescriptor,hM=(e,s,t,r)=>{for(var i=r>1?void 0:r?mM(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&&dM(s,t,i),i};let em=class extends M(O,$i){constructor(){super(...arguments),this.mdiDiameterVariant=xT,this.mdiInformationOutline=Ny}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 speed_factor(){var s,t;return(t=(s=this.$store.state.printer.gcode_move)==null?void 0:s.speed_factor)!=null?t:1}get volumetricFlow(){return Math.round(Math.pow(this.filamentDiameter/2,2)*Math.PI*this.feedrate*this.speed_factor*10)/10}get showTooltip(){return this.speed_factor!==1||this.extrudeFactor!==1}};em=hM([D({})],em);var pM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showEstimatedExtrusion?t(Ae,{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 "),e.showTooltip?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({attrs:{small:"",color:"warning"}},"v-icon",n,!1),i),[e._v(" "+e._s(e.mdiInformationOutline)+" ")])]}}],null,!1,3195294278)},[t("span",[e.speed_factor!==1?t("div",[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.SpeedFactor"))+": "+e._s(e.speed_factor*100)+" % ")]):e._e(),e.extrudeFactor!==1?t("div",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtrusionFactor"))+": "+e._s(e.extrudeFactor*100)+" % ")]):e._e()])]):e._e()],1)])]):e._e()},fM=[];const Fg={};var gM=E(em,pM,fM,!1,vM,null,null,null);function vM(e){for(let s in Fg)this[s]=Fg[s]}const _M=function(){return gM.exports}();var bM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(et,{attrs:{breakpoints:{large:function(r){return r.width>=640}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t(Ae,[t($,[t(_,[t(je,{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(Vt,{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(je,{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(Vt,{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(de,{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(de,{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($,[t(_,{staticClass:"pa-0"},[t("div",{staticClass:"d-flex justify-space-around"},[t("div",{staticClass:"d-flex align-center"},[t(de,{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(de,{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(_M)]}}])})},yM=[];const Rg={};var CM=E(Qo,bM,yM,!1,$M,"eba60532",null,null);function $M(e){for(let s in Rg)this[s]=Rg[s]}const xM=function(){return CM.exports}();var wM=Object.defineProperty,SM=Object.getOwnPropertyDescriptor,C2=(e,s,t,r)=>{for(var i=r>1?void 0:r?SM(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&&wM(s,t,i),i};let el=class extends M(O,Ke){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})}};C2([qe(500)],el.prototype,"sendCmd",1);el=C2([D({components:{Panel:B,NumberInput:je,Responsive:et}})],el);var PM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.existsFirmwareRetraction?t("div",[t(Ae,[t(et,{attrs:{breakpoints:{small:function(r){return r.width<=350}}},scopedSlots:e._u([{key:"default",fn:function(r){var i=r.el;return[t($,[t(_,{class:{"col-12":i.is.small}},[t(je,{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(je,{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($,[t(_,{class:{"col-12":i.is.small}},[t(je,{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(je,{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()},DM=[];const jg={};var TM=E(el,PM,DM,!1,MM,null,null,null);function MM(e){for(let s in jg)this[s]=jg[s]}const EM=function(){return TM.exports}();var OM=Object.defineProperty,LM=Object.getOwnPropertyDescriptor,$2=(e,s,t,r)=>{for(var i=r>1?void 0:r?LM(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&&OM(s,t,i),i};let tl=class extends M(O){constructor(){super(...arguments),this.mdiRestart=Zr,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})}};$2([qe(500)],tl.prototype,"sendCmd",1);tl=$2([D({components:{NumberInput:je,Panel:B,Responsive:et}})],tl);var AM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(et,{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(Ae,[t($,[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(Ee,{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(je,{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(je,{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)]}}])})},kM=[];const Hg={};var FM=E(tl,AM,kM,!1,RM,null,null,null);function RM(e){for(let s in Hg)this[s]=Hg[s]}const jM=function(){return FM.exports}();var HM=Object.defineProperty,IM=Object.getOwnPropertyDescriptor,NM=(e,s,t,r)=>{for(var i=r>1?void 0:r?IM(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&&HM(s,t,i),i};let tm=class extends M(O,$i){constructor(){super(...arguments),this.mdiPrinter3dNozzleOutline=s3}};tm=NM([D({})],tm);var VM=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,[t(Qc,{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)},UM=[];const Ig={};var BM=E(tm,VM,UM,!1,WM,null,null,null);function WM(e){for(let s in Ig)this[s]=Ig[s]}const GM=function(){return BM.exports}();var zM=Object.defineProperty,ZM=Object.getOwnPropertyDescriptor,qM=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZM(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&&zM(s,t,i),i};let sm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Ws}get rows(){let t=[];for(let r=0;r{for(var i=r>1?void 0:r?YM(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&&XM(s,t,i),i};let sl=class extends M(O,Ke){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}}};x2([P({type:Object})],sl.prototype,"macro",2);sl=x2([D({components:{}})],sl);var JM=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)+" ")])},KM=[];const Ng={};var QM=E(sl,JM,KM,!1,eE,"956e3986",null,null);function eE(e){for(let s in Ng)this[s]=Ng[s]}const tE=function(){return QM.exports}();var sE=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($,{key:"row_"+i,staticClass:"mt-0"},[t(_,[t(Vt,{staticClass:"_btn-group py-0 px-3"},e._l(r,function(n){return t(tE,{key:n.name,attrs:{macro:n}})}),1)],1)],1)}),1)},rE=[];const Vg={};var iE=E(sm,sE,rE,!1,nE,"2b552b14",null,null);function nE(e){for(let s in Vg)this[s]=Vg[s]}const aE=function(){return iE.exports}();var oE=Object.defineProperty,lE=Object.getOwnPropertyDescriptor,cE=(e,s,t,r)=>{for(var i=r>1?void 0:r?lE(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&&oE(s,t,i),i};let rm=class extends M(O,Ke){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})}};rm=cE([D],rm);var uE=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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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)},dE=[];const Ug={};var mE=E(rm,uE,dE,!1,hE,null,null,null);function hE(e){for(let s in Ug)this[s]=Ug[s]}const pE=function(){return mE.exports}();var fE=Object.defineProperty,gE=Object.getOwnPropertyDescriptor,nn=(e,s,t,r)=>{for(var i=r>1?void 0:r?gE(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&&fE(s,t,i),i};let ur=class extends M(O){constructor(){super(...arguments),this.DEFAULT_DESC="G-Code macro",this.mdiCloseThick=pe,this.mdiMenuDown=fr,this.mdiRefresh=tn,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}get hasDescription(){return this.klipperMacro.description&&this.klipperMacro.description!==this.DEFAULT_DESC}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()}};nn([P({required:!0})],ur.prototype,"macro",2);nn([P({default:"primary"})],ur.prototype,"color",2);nn([P({default:null})],ur.prototype,"alias",2);nn([P({default:!1})],ur.prototype,"disabled",2);nn([me("klipperMacro")],ur.prototype,"klipperMacroChange",1);ur=nn([D({components:{Panel:B}})],ur);var vE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Vt,{staticClass:"d-inline-block"},[t(de,{attrs:{disabled:!e.hasDescription,top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(g,e._g(e._b({class:e.paramArray.length?"macroWithParameters":"",attrs:{small:"",color:e.color,loading:e.loadings.includes("macro_"+e.macro.name),disabled:e.disabled},on:{click:function(a){return e.doSendMacro(e.macro.name)}}},"v-btn",n,!1),i),[e._v(" "+e._s(e.alias?e.alias:e.macro.name.replace(/_/g," "))+" ")])]}}])},[t("span",[e._v(e._s(e.klipperMacro.description))])]),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(B,{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($,e._l(e.paramArray,function(r,i){return t(_,{key:"param_mobile_"+i,attrs:{cols:6}},[t(te,{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(xe,{attrs:{"max-width":e.paramsOverlayWidth}},[t(q,{staticClass:"py-2"},[t($,{staticClass:"my-2"},e._l(e.paramArray,function(r,i){return t(_,{key:"param_"+i,attrs:{cols:e.paramCssCols}},[t(te,{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($,{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)},_E=[];const Bg={};var bE=E(ur,vE,_E,!1,yE,"26a7856d",null,null);function yE(e){for(let s in Bg)this[s]=Bg[s]}const Ks=function(){return bE.exports}();var CE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showPanel?t(B,{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(J,[t(de,{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(J,[t(de,{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(J,[t(de,{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(J,[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(pE)]},proxy:!0}],null,!1,40833120)},[e.showTools&&e.toolchangeMacros.length?t(aE):e._e(),e.showExtrusionFactor?[e.showTools?t(U):e._e(),t(GM)]:e._e(),e.showPressureAdvance?[e.showTools||e.showExtrusionFactor?t(U):e._e(),t(jM)]:e._e(),e.showFirmwareRetraction?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance?t(U):e._e(),t(EM)]:e._e(),e.showExtruderControl?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance||e.showFirmwareRetraction?t(U):e._e(),t(xM)]:e._e()],2):e._e()},$E=[];const Wg={};var xE=E(Jd,CE,$E,!1,wE,null,null,null);function wE(e){for(let s in Wg)this[s]=Wg[s]}const SE=function(){return xE.exports}(),eu=(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?eu(e[t],r):y.set(e,t,r)})},jt=(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 jt(t.childrens,s);if(t.childrens)return t.childrens}return e}return null},At=(e,s)=>e.sort((t,r)=>{const i=t[s].toLowerCase(),n=r[s].toLowerCase();return in?1:0}),jr=e=>e.charAt(0).toUpperCase()+e.slice(1),PE=e=>e.replace(/_/g," ").replace(/(?:^\w|[A-Z]|\b\w)/g,(s,t)=>t===0?s.toLowerCase():s.toUpperCase()).replace(/\s+/g,"");function Ap(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 at=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},Je=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]},DE=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]},tu=(e,s=!0)=>{if(!e)return"--";const t=[];if(s){const a=Math.floor(e/86400);a&&(e%=3600*24,t.push("".concat(a,"d")))}const r=Math.floor(e/3600);e%=3600,r&&t.push("".concat(r,"h"));const i=Math.floor(e/60);i&&t.push("".concat(i,"m"));const n=e%60;return n&&t.push("".concat(n.toFixed(0),"s")),t.join(" ")},kp=(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 rl(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?OE(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&&EE(s,t,i),i};let Ns=class extends O{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+=jr(i)}),this.$t("Panels.".concat(t,"Panel.Headline"))}return this.$t("Panels.".concat(jr(e),"Panel.Headline"))}convertPanelnameToIcon(e){if(e.startsWith("macrogroup_"))return zn;switch(e){case"webcam":return sn;case"zoffset":return eT;case"toolhead-control":return wp;case"macros":return zn;case"miscellaneous":return _p;case"temperature":return o2;case"miniconsole":return Fa;case"machine-settings":return Ay;case"extruder-control":return Ws;default:return kt}}};Ns=LE([D],Ns);var AE=Object.defineProperty,kE=Object.getOwnPropertyDescriptor,Rp=(e,s,t,r)=>{for(var i=r>1?void 0:r?kE(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&&AE(s,t,i),i};let qn=class extends M(O){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([P({default:!1})],qn.prototype,"moonraker",2);Rp([P({default:!1})],qn.prototype,"klipper",2);qn=Rp([D],qn);var FE=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"}})])])])},RE=[];const Gg={};var jE=E(qn,FE,RE,!1,HE,null,null,null);function HE(e){for(let s in Gg)this[s]=Gg[s]}const su=function(){return jE.exports}();var IE=Object.defineProperty,NE=Object.getOwnPropertyDescriptor,VE=(e,s,t,r)=>{for(var i=r>1?void 0:r?NE(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&&IE(s,t,i),i};let nm=class extends M(O){constructor(){super(...arguments),this.mdiPrinter3d=Ha,this.mdiRestart=Zr,this.mdiDownload=Oy,this.mdiPower=Yy}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:l3};case"shutdown":return{color:"warning",icon:Wn};case"error":return{color:"error",icon:Wn};case"disconnected":return{color:"",icon:fp};default:return{color:"",icon:WT}}}get buttonClasses(){return[this.messageType.color+"--text","my-1","w-100"]}get serviceReportsKlipper(){return"".concat(this.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Klipper"}),": ").concat(this.klipperState.toUpperCase())}get serviceReportsMoonraker(){return"".concat(this.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Moonraker"}),": ").concat(this.klipperState.toUpperCase())}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"})}};nm=VE([D({components:{Panel:B,ConnectionStatus:su}})],nm);var UE=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperState!=="ready"&&e.socketIsConnected?t("div",[e.klippyIsConnected?t(it,{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.serviceReportsKlipper)+" ")],1),e.klippy_message!==null?t("div",[t("pre",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.klippy_message.trim()))]),t(U,{staticClass:"mt-2 pb-3"}),t($,[t(_,[t(g,{class:e.buttonClasses,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:e.buttonClasses,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:e.buttonClasses,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(" "+e._s(e.$t("Panels.KlippyStatePanel.KlipperLog"))+" ")],1),t(g,{class:e.buttonClasses,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(" "+e._s(e.$t("Panels.KlippyStatePanel.MoonrakerLog"))+" ")],1)],1)],1)],1):t(q,{staticClass:"text-center py-3"},[t(dt,{attrs:{indeterminate:"",color:e.messageType.color}})],1)],1):e.isPrinterPowerOff?t(it,{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($,[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(it,{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.serviceReportsMoonraker)+" ")],1),t(su,{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()],1):e._e()},BE=[];const zg={};var WE=E(nm,UE,BE,!1,GE,null,null,null);function GE(e){for(let s in zg)this[s]=zg[s]}const Na=function(){return WE.exports}();var zE=Object.defineProperty,ZE=Object.getOwnPropertyDescriptor,Va=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZE(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&&zE(s,t,i),i};let Hr=class extends M(O){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})}};Va([P({required:!1,default:hr})],Hr.prototype,"iconExpanded",2);Va([P({required:!1,default:hr})],Hr.prototype,"iconCollapsed",2);Va([P({required:!0,default:""})],Hr.prototype,"title",2);Va([P({required:!0})],Hr.prototype,"subPanelClass",2);Hr=Va([D],Hr);var qE=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(U,{staticClass:"ml-3"})],1),t(Ac,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}]},[e._t("default")],2)])],1)},XE=[];const Zg={};var YE=E(Hr,qE,XE,!1,JE,"28d7b868",null,null);function JE(e){for(let s in Zg)this[s]=Zg[s]}const S2=function(){return YE.exports}();var KE=Object.defineProperty,QE=Object.getOwnPropertyDescriptor,P2=(e,s,t,r)=>{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 il=class extends M(O){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})}};P2([qe(500)],il.prototype,"sendCmd",1);il=P2([D({components:{Panel:B,NumberInput:je,Responsive:et}})],il);var eO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,[t(et,{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($,[t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[t(je,{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(je,{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($,[t(_,{class:{"col-12":i.is.small,"col-6":i.is.medium}},[t(je,{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(je,{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(je,{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)},tO=[];const qg={};var sO=E(il,eO,tO,!1,rO,null,null,null);function rO(e){for(let s in qg)this[s]=qg[s]}const D2=function(){return sO.exports}();var iO=Object.defineProperty,nO=Object.getOwnPropertyDescriptor,aO=(e,s,t,r)=>{for(var i=r>1?void 0:r?nO(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&&iO(s,t,i),i};let am=class extends M(O){constructor(){super(...arguments),this.mdiEngine=Ay}};am=aO([D({components:{Panel:B,SubPanel:S2,MotionSettings:D2}})],am);var oO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(B,{attrs:{icon:e.mdiEngine,title:e.$t("Panels.MachineSettingsPanel.Headline").toString(),collapsible:!0,"card-class":"machine-settings-panel"}},[t("div",[t(D2)],1)]):e._e()},lO=[];const Xg={};var cO=E(am,oO,lO,!1,uO,null,null,null);function uO(e){for(let s in Xg)this[s]=Xg[s]}const dO=function(){return cO.exports}();var mO=Object.defineProperty,hO=Object.getOwnPropertyDescriptor,T2=(e,s,t,r)=>{for(var i=r>1?void 0:r?hO(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 nl=class extends M(O){constructor(){super(...arguments),this.mdiCodeTags=zn}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}};T2([P({required:!0})],nl.prototype,"panelId",2);nl=T2([D({components:{MacroButton:Ks,Panel:B}})],nl);var pO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui&&e.macros.length>0&&e.macrogroupStatus?t(B,{attrs:{icon:e.mdiCodeTags,title:e.macrogroup.name,collapsible:!0,"card-class":"macrogroup_"+e.panelId+"_panel"}},[t(q,{staticClass:"py-2"},[t($,[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()},fO=[];const Yg={};var gO=E(nl,pO,fO,!1,vO,null,null,null);function vO(e){for(let s in Yg)this[s]=Yg[s]}const _O=function(){return gO.exports}();var bO=Object.defineProperty,yO=Object.getOwnPropertyDescriptor,CO=(e,s,t,r)=>{for(var i=r>1?void 0:r?yO(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&&bO(s,t,i),i};let om=class extends M(O){constructor(){super(...arguments),this.mdiCodeTags=zn}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()))}};om=CO([D({components:{MacroButton:Ks,Panel:B}})],om);var $O=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui&&e.macros.length>0?t(B,{attrs:{icon:e.mdiCodeTags,title:e.$t("Panels.MacrosPanel.Headline"),collapsible:!0,"card-class":"macros-panel"}},[t(q,{staticClass:"py-2"},[t($,[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()},xO=[];const Jg={};var wO=E(om,$O,xO,!1,SO,null,null,null);function SO(e){for(let s in Jg)this[s]=Jg[s]}const PO=function(){return wO.exports}();var DO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,M2=(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&&DO(s,t,i),i};let al=class extends M(O){get entryStyle(){var s;const e=["ma-0","flex-nowrap"];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)}}};M2([P({required:!0})],al.prototype,"event",2);al=M2([D],al);var MO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,{class:e.entryStyle},[t(_,{staticClass:"col-auto pr-0 text--disabled console-time"},[e._v(e._s(e.entryFormatTime))]),t(_,{class:e.messageClass,staticStyle:{"min-width":"0"},domProps:{innerHTML:e._s(e.event.formatMessage)},on:{"!click":function(r){return e.commandClick.apply(null,arguments)}}})],1)},EO=[];const Kg={};var OO=E(al,MO,EO,!1,LO,"54d4632f",null,null);function LO(e){for(let s in Kg)this[s]=Kg[s]}const E2=function(){return OO.exports}();var AO=Object.defineProperty,kO=Object.getOwnPropertyDescriptor,jp=(e,s,t,r)=>{for(var i=r>1?void 0:r?kO(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 Xn=class extends y{commandClick(e){this.$emit("command-click",e)}};jp([P({required:!0})],Xn.prototype,"events",2);jp([P({required:!1,default:!1})],Xn.prototype,"isMini",2);Xn=jp([D({components:{ConsoleTableEntry:E2}})],Xn);var FO=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($,{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(E2,{key:i,staticClass:"consoleTableRow",attrs:{event:r},on:{"command-click":e.commandClick}})})],2)},RO=[];const Qg={};var jO=E(Xn,FO,RO,!1,HO,null,null,null);function HO(e){for(let s in Qg)this[s]=Qg[s]}const ru=function(){return jO.exports}();var IO=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,iu=(e,s,t,r)=>{for(var i=r>1?void 0:r?NO(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&&IO(s,t,i),i};let xi=class extends M(O){constructor(){super(...arguments),this.cmdListSearch="",this.isOpen=!1,this.mdiHelp=jy,this.mdiCloseThick=pe}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="")}};iu([P({required:!1,default:!1})],xi.prototype,"isMini",2);iu([P({required:!1,default:!1})],xi.prototype,"inToolbar",2);iu([me("isOpen")],xi.prototype,"onIsOpen",1);xi=iu([D({components:{Panel:B}})],xi);var VO=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(B,{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(gt,[t($,[t(_,[t(te,{attrs:{label:"Search",outlined:"","hide-details":"",clearable:"",dense:""},model:{value:e.cmdListSearch,callback:function(r){e.cmdListSearch=r},expression:"cmdListSearch"}})],1)],1)],1),t(U),t("overlay-scrollbars",{staticClass:"command-help-content",class:e.isMobile?"mobileHeight":"height300"},[t(q,{staticClass:"pt-0"},[t($,[t(_,[t(Oe,e._l(e.helplistFiltered,function(r){return t(J,{key:r.commandLow,staticClass:"px-0",attrs:{"two-line":""}},[t(vt,{staticClass:"px-0"},[t(Ge,{staticClass:"primary--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(Aa,{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"}})},UO=[];const e1={};var BO=E(xi,VO,UO,!1,WO,"4bf48be0",null,null);function WO(e){for(let s in e1)this[s]=e1[s]}const nu=function(){return BO.exports}();var GO=Object.defineProperty,zO=Object.getOwnPropertyDescriptor,Hp=(e,s,t,r)=>{for(var i=r>1?void 0:r?zO(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&&GO(s,t,i),i};let Yn=class extends M(O){constructor(){super(...arguments),this.mdiTrashCan=u2,this.mdiConsoleLine=Fa,this.mdiCog=us,this.mdiSend=t2,this.mdiChevronDoubleRight=Ty,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,m)=>rl(d,m.command),u[0].command)):this.gcode=u.reduce((d,m)=>rl(d,m.command),u[0].command),u&&u.length){let d="";u.forEach(m=>d+=''+m.command+": "+m.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")],Yn.prototype,"eventsChanged",1);Hp([me("autoscroll")],Yn.prototype,"autoscrollChanged",1);Yn=Hp([D({components:{Panel:B,ConsoleTable:ru,CommandHelpModal:nu}})],Yn);var ZO=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.socketIsConnected&&e.klipperState!=="disconnected"?t(B,{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(nu,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{key:i,staticClass:"minHeight36"},[t(_e,{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(Bs,{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($,[t(_,[t("overlay-scrollbars",{ref:"miniConsoleScroll",style:"height: "+e.consoleHeight+"px;",attrs:{options:{}}},[t(ru,{ref:"console",attrs:{events:e.events,"is-mini":!0},on:{"command-click":e.commandClick}}),t(U)],1)],1)],1)],1)],1)]):e._e()},qO=[];const t1={};var XO=E(Yn,ZO,qO,!1,YO,"1db4ee58",null,null);function YO(e){for(let s in t1)this[s]=t1[s]}const JO=function(){return XO.exports}();var KO=Object.defineProperty,QO=Object.getOwnPropertyDescriptor,e4=(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&&KO(s,t,i),i};let lm=class extends M(O){constructor(){super(...arguments),this.mdiAlertCircle=Cy,this.mdiInformation=kt}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}};lm=e4([D({components:{Panel:B}})],lm);var t4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperState==="ready"&&e.existsPrinterConfig&&e.missingConfigs.length?t(B,{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($,[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(U),t(q,[t($,[t(_,[t("p",{staticClass:"orange--text mb-0"},[e._v(e._s(e.$t("Panels.MinSettingsPanel.IncludeMainsailCfg")))])])],1)],1),t(U,{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()},s4=[];const s1={};var r4=E(lm,t4,s4,!1,i4,"05f4d966",null,null);function i4(e){for(let s in s1)this[s]=s1[s]}const Ip=function(){return r4.exports}();var n4=Object.defineProperty,a4=Object.getOwnPropertyDescriptor,wt=(e,s,t,r)=>{for(var i=r>1?void 0:r?a4(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&&n4(s,t,i),i};let ht=class extends M(O){constructor(){super(...arguments),this.mdiFan=yp,this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOffOutline=c2,this.mdiLockOutline=Gc,this.mdiLockOpenVariantOutline=By,this.mdiMinus=Gy,this.mdiPlus=Tp,this.mdiLightbulbOutline=Sp,this.mdiLightbulbOnOutline=Vy,this.convertName=at,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.includes("fan")?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(ae),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(te,{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(kc,{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)},l4=[];const r1={};var c4=E(ht,o4,l4,!1,u4,"2ac94a4b",null,null);function u4(e){for(let s in r1)this[s]=r1[s]}const cm=function(){return c4.exports}();/*! + * iro.js v5.5.2 + * 2016-2021 James Daniel + * Licensed under MPL 2.0 + * github.com/jaames/iro.js + */var Ve,ol,O2,um,L2,ir={},Np=[],d4=/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 A2(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 Tt(e){return parseInt(e,16)}function br(e){return e.toString(16).padStart(2,"0")}var ui=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=pn(i),l=i-o,c=a*(1-n),u=a*(1-l*n),d=a*(1-(1-l)*n),m=o%6,h=[a,u,c,c,d,a][m],p=[d,a,a,u,c,c][m],f=[c,c,d,a,a,u][m];return{r:Wt(h*255,0,255),g:Wt(p*255,0,255),b:Wt(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,m=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},_4(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:si(i),g:si(n),b:si(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:si(i),s:si(n),l:si(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=C4.exec(r))?(n=Dt(i[1],255),a=Dt(i[2],255),o=Dt(i[3],255)):(i=$4.exec(r))&&(n=Dt(i[1],255),a=Dt(i[2],255),o=Dt(i[3],255),l=Dt(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"#"+br(r.r)+br(r.g)+br(r.b)},set:function(r){var i,n,a,o,l=255;if((i=S4.exec(r))?(n=Tt(i[1])*17,a=Tt(i[2])*17,o=Tt(i[3])*17):(i=P4.exec(r))?(n=Tt(i[1])*17,a=Tt(i[2])*17,o=Tt(i[3])*17,l=Tt(i[4])*17):(i=D4.exec(r))?(n=Tt(i[1]),a=Tt(i[2]),o=Tt(i[3])):(i=T4.exec(r))&&(n=Tt(i[1]),a=Tt(i[2]),o=Tt(i[3]),l=Tt(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"#"+br(r.r)+br(r.g)+br(r.b)+br(pn(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=x4.exec(r))?(n=Dt(i[1],360),a=Dt(i[2],100),o=Dt(i[3],100)):(i=w4.exec(r))&&(n=Dt(i[1],360),a=Dt(i[2],100),o=Dt(i[3],100),l=Dt(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}(),O4={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 L4(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 A4(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 k4(e,s){var t=Bp(e),r=t.width,i=t.height,n=t.handleRange,a=t.handleStart,o=e.layoutDirection==="horizontal",l=L4(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 F4(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 G2(e,s,t,r){for(var i=0;i0&&(l[a?"marginLeft":"marginTop"]=o),Fe(au,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&&u1.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),u1.forEach(function(d){document.removeEventListener(d,i,{passive:!1})});break}},s}(gi);function Ir(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("+$t(e.x)+", "+$t(e.y)+")",willChange:"transform",top:$t(-s),left:$t(-s),width:$t(s*2),height:$t(s*2),position:"absolute",overflow:"visible"}},t&&Fe("use",Object.assign({xlinkHref:V4(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"}))}Ir.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}};function cl(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 ui(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:z2},{component:cl}]}i.transparency&&a.push({component:cl,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}(gi);Z2.defaultProps=Object.assign({},U4,{colors:[],display:"block",id:null,layout:"default",margin:null});var Z4=z4(Z2),hm;(function(e){e.version="5.5.2",e.Color=ui,e.ColorPicker=Z4,function(s){s.h=Fe,s.ComponentBase=cu,s.Handle=Ir,s.Slider=cl,s.Wheel=z2,s.Box=B4}(e.ui||(e.ui={}))})(hm||(hm={}));var Nt=hm,q4=Object.defineProperty,X4=Object.getOwnPropertyDescriptor,Ua=(e,s,t,r)=>{for(var i=r>1?void 0:r?X4(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&&q4(s,t,i),i};let Nr=class extends M(O){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=Nt.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)}};Ua([fy("picker")],Nr.prototype,"picker",2);Ua([P({type:[Object,String],default:"#ffffff"})],Nr.prototype,"color",2);Ua([P({type:Object,default:()=>({})})],Nr.prototype,"options",2);Ua([me("color",{deep:!0})],Nr.prototype,"colorChanged",1);Nr=Ua([D],Nr);var Y4=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t("div",{ref:"picker"})])},J4=[];const d1={};var K4=E(Nr,Y4,J4,!1,Q4,null,null,null);function Q4(e){for(let s in d1)this[s]=d1[s]}const Jn=function(){return K4.exports}();var e6=Object.defineProperty,t6=Object.getOwnPropertyDescriptor,qr=(e,s,t,r)=>{for(var i=r>1?void 0:r?t6(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&&e6(s,t,i),i};let Vs=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiLightbulbOutline=Sp,this.mdiLightbulbOnOutline=Vy,this.boolDialog=!1,this.inputValue=0}get name(){return this.group?at(this.group.name):at(this.object.name)}get colorPickerOptions(){let s={width:200,margin:15,layout:[]};return this.existRed&&(s==null||s.layout.push({component:Nt.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(s==null||s.layout.push({component:Nt.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(s==null||s.layout.push({component:Nt.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(s.layout=[{component:Nt.ui.Wheel},{component:Nt.ui.Slider,options:{sliderType:"value"}}]),s}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:Nt.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,m,h,p,f,b,C,S;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((m=this.current.blue)!=null?m:0)&&Math.round((h=s.white)!=null?h:0)===Math.round((p=this.current.white)!=null?p: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(((S=s.white)!=null?S: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 L=a;for(let N=this.group.start;N<=this.group.end;N++){if(N===this.group.start){a+=" INDEX=".concat(N);continue}a+="\n".concat(L," INDEX=").concat(N)}}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)}};qr([P({type:Object,required:!0})],Vs.prototype,"object",2);qr([P({type:Boolean,default:!1})],Vs.prototype,"root",2);qr([P(Object)],Vs.prototype,"group",2);qr([qe({time:500})],Vs.prototype,"onColorRGBChanged",1);qr([qe({time:500})],Vs.prototype,"onColorWhiteChanged",1);qr([qe({time:500})],Vs.prototype,"onColorInput",1);Vs=qr([D({components:{ColorPicker:Jn,MiscellaneousLight:()=>fe(()=>Promise.resolve().then(()=>a6),void 0)}})],Vs);var s6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,{class:e.containerClass},[t($,[t(_,{staticClass:"pb-3"},[t(_s,{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(ae),!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(B,{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($,[t(_,{staticClass:"light-presets-container pt-0 d-flex flex-wrap flex-row justify-center"},e._l(e.presets,function(r){return t(de,{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(U,{staticClass:"my-3"})]:e._e(),t($,[t(_,{staticClass:"text-center"},[t(Jn,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(Jn,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(_,[e.existRed?t($,[t(_,[t(je,{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($,[t(_,[t(je,{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($,[t(_,[t(je,{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($,[t(_,[t(je,{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)},r6=[];const m1={};var i6=E(Vs,s6,r6,!1,n6,"aca41388",null,null);function n6(e){for(let s in m1)this[s]=m1[s]}const zp=function(){return i6.exports}(),a6=Object.freeze(Object.defineProperty({__proto__:null,default:zp},Symbol.toStringTag,{value:"Module"}));var o6=Object.defineProperty,l6=Object.getOwnPropertyDescriptor,uu=(e,s,t,r)=>{for(var i=r>1?void 0:r?l6(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&&o6(s,t,i),i};let wi=class extends M(O){constructor(){super(...arguments),this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOffOutline=c2,this.mdiPrinter3dNozzleAlert=Ky,this.convertName=at}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})}};uu([P({type:String,required:!0})],wi.prototype,"name",2);uu([P({type:Boolean,required:!0})],wi.prototype,"enabled",2);uu([P({type:Boolean,required:!0})],wi.prototype,"filament_detected",2);wi=uu([D],wi);var c6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,{staticClass:"px-0 py-2"},[t($,[t(_,{staticClass:"pb-3"},[t(_s,{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(ae),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)},u6=[];const h1={};var d6=E(wi,c6,u6,!1,m6,"0d751882",null,null);function m6(e){for(let s in h1)this[s]=h1[s]}const q2=function(){return d6.exports}();var h6=Object.defineProperty,p6=Object.getOwnPropertyDescriptor,Zp=(e,s,t,r)=>{for(var i=r>1?void 0:r?p6(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&&h6(s,t,i),i};let Kn=class extends M(O){constructor(){super(...arguments),this.convertName=at,this.mdiGauge=jT,this.mdiLightningBoltOutline=VT,this.mdiFlash=FT,this.mdiThermometer=a2,this.mdiMeterElectricOutline=zT}get sensorData(){const e=this.$store.state.server.sensor.sensors;return this.sensor in e?e[this.sensor].values:{}}get sensorConfig(){var t,r;const e="sensor ".concat(this.sensor),s=(r=(t=this.$store.state.server.config)==null?void 0:t.config)!=null?r:{};return e in s?s[e]:{}}get parameterConfig(){const e="parameter_".concat(this.valueName);return e in this.sensorConfig?this.sensorConfig[e]:{}}get unit(){return"units"in this.parameterConfig?this.parameterConfig.units:null}get value(){return this.valueName in this.sensorData?Math.round(this.sensorData[this.valueName]*1e3)/1e3:"--"}get output(){return this.unit===null?this.value:"".concat(this.value," ").concat(this.unit)}get name(){return this.convertName(this.valueName)}get symbol(){var e,s,t,r;return["wh","kwh","mwh","j"].includes((e=this.unit)==null?void 0:e.toLowerCase())?this.mdiLightningBoltOutline:["w","v"].includes((s=this.unit)==null?void 0:s.toLowerCase())?this.mdiFlash:((t=this.unit)==null?void 0:t.toLowerCase())==="a"?this.mdiMeterElectricOutline:["°c","c","°f","f","°"].includes((r=this.unit)==null?void 0:r.toLowerCase())?this.mdiThermometer:this.mdiGauge}};Zp([P({type:String,required:!0})],Kn.prototype,"sensor",2);Zp([P({type:String,required:!0})],Kn.prototype,"valueName",2);Kn=Zp([D],Kn);var f6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"d-flex w-100 flex-row align-center"},[t(v,{attrs:{small:"",left:""}},[e._v(e._s(e.symbol))]),t("span",{staticClass:"flex-grow-1"},[e._v(e._s(e.name)+":")]),t("span",[e._v(e._s(e.output))])],1)},g6=[];const p1={};var v6=E(Kn,f6,g6,!1,_6,null,null,null);function _6(e){for(let s in p1)this[s]=p1[s]}const X2=function(){return v6.exports}();var b6=Object.defineProperty,y6=Object.getOwnPropertyDescriptor,Y2=(e,s,t,r)=>{for(var i=r>1?void 0:r?y6(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 ul=class extends M(O){constructor(){super(...arguments),this.convertName=at}get valueNames(){const e=this.$store.state.server.sensor.sensors;return this.name in e?Object.keys(e[this.name].values):[]}};Y2([P({type:String,required:!0})],ul.prototype,"name",2);ul=Y2([D({components:{MoonrakerSensorValue:X2}})],ul);var C6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,{staticClass:"px-0 py-2"},[t($,[t(_,{staticClass:"pb-3"},[t(_s,{staticClass:"mb-1 d-block _moonraker-sensor-subheader"},[e._v(" "+e._s(e.convertName(e.name))+" ")]),t(_s,{staticClass:"d-block _moonraker-sensor-subheader"},e._l(e.valueNames,function(r,i){return t(X2,{key:"moonraker_sensor_value_"+i,attrs:{sensor:e.name,"value-name":r}})}),1)],1)],1)],1)},$6=[];const f1={};var x6=E(ul,C6,$6,!1,w6,"93458f12",null,null);function w6(e){for(let s in f1)this[s]=f1[s]}const J2=function(){return x6.exports}();var S6=Object.defineProperty,P6=Object.getOwnPropertyDescriptor,D6=(e,s,t,r)=>{for(var i=r>1?void 0:r?P6(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&&S6(s,t,i),i};let pm=class extends M(O){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 moonrakerSensors(){var s;return(s=this.$store.getters["server/sensor/getSensors"])!=null?s:[]}get showMiscellaneousPanel(){return this.klipperReadyForGui&&(this.miscellaneous.length||this.filamentSensors.length||this.lights.length)}};pm=D6([D({components:{Panel:B,FilamentSensor:q2,MiscellaneousSlider:cm,MiscellaneousLight:zp,MoonrakerSensor:J2}})],pm);var T6=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showMiscellaneousPanel?t(B,{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(U):e._e(),t(cm,{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(U):e._e(),r.type==="led"&&r.colorOrder.length===1?t(cm,{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(U):e._e(),t(q2,{attrs:{name:r.name,enabled:r.enabled,filament_detected:r.filament_detected}})],1)}),e._l(e.moonrakerSensors,function(r,i){return t("div",{key:"moonraker_sensor_"+i},[i||e.miscellaneous.length||e.lights.length||e.filamentSensors.length?t(U):e._e(),t(J2,{attrs:{name:r}})],1)})],2):e._e()},M6=[];const g1={};var E6=E(pm,T6,M6,!1,O6,null,null,null);function O6(e){for(let s in g1)this[s]=g1[s]}const L6=function(){return E6.exports}();var A6=Object.defineProperty,k6=Object.getOwnPropertyDescriptor,qp=(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&&A6(s,t,i),i};let Qn=class extends M(O){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?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 dl=class extends M(O){get styleCircle1(){return{fill:this.color}}get styleCircle2(){return{fill:"#bebebe"}}get styleCircle3(){return{fill:"#343434"}}clickSpool(){this.$emit("click-spool")}};K2([P({required:!1,default:"#ff0"})],dl.prototype,"color",2);dl=K2([D({})],dl);var j6=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"}})])])},H6=[];const v1={};var I6=E(dl,j6,H6,!1,N6,null,null,null);function N6(e){for(let s in v1)this[s]=v1[s]}const Q2=function(){return I6.exports}();var V6=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(Q2,{staticClass:"mr-3",staticStyle:{width:"50px",float:"left"},attrs:{color:e.color}})],1),t("td",{staticClass:"py-2",staticStyle:{"min-width":"300px"}},[t(J,{attrs:{"two-line":""}},[t(vt,{staticClass:"no--padding"},[t("div",{staticClass:"text--disabled mb-1"},[e._v("#"+e._s(e.id)+" | "+e._s(e.vendor))]),t(Ge,{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",{staticClass:"comment"},[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))])])])},U6=[];const _1={};var B6=E(Qn,V6,U6,!1,W6,"8094a05a",null,null);function W6(e){for(let s in _1)this[s]=_1[s]}const eC=function(){return B6.exports}();var G6=Object.defineProperty,z6=Object.getOwnPropertyDescriptor,Xp=(e,s,t,r)=>{for(var i=r>1?void 0:r?z6(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&&G6(s,t,i),i};let ea=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiCloseThick=pe,this.mdiDatabase=CT,this.mdiMagnify=zc,this.mdiRefresh=tn,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){var n;if(s.trim().startsWith("web+spoolman:s-")){const a=parseInt((n=s.split("-")[1])!=null?n:-1);return t.id===a}const r=s.toLowerCase().split(" "),i=[t.id.toString(),t.comment,t.filament.name,t.filament.vendor.name,t.filament.material,t.location];for(const a of r)if(!i.some(l=>l==null?void 0:l.toLowerCase().includes(a)))return!1;return!0}setSpool(e){this.$store.dispatch("server/spoolman/setActiveSpool",e.id),this.close()}onShowDialogChanged(e){e&&(this.search="")}};Xp([P({required:!0})],ea.prototype,"showDialog",2);Xp([me("showDialog")],ea.prototype,"onShowDialogChanged",1);ea=Xp([D({components:{SpoolmanChangeSpoolDialogRow:eC,Panel:B}})],ea);var Z6=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(B,{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(gt,[t(te,{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(ae),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(zr,{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(eC,{key:i.id,attrs:{spool:i,max_id_digits:e.max_spool_id_digits},on:{"set-spool":e.setSpool}})]}}])})],1)],1)],1)],1)},q6=[];const b1={};var X6=E(ea,Z6,q6,!1,Y6,null,null,null);function Y6(e){for(let s in b1)this[s]=b1[s]}const du=function(){return X6.exports}();var J6=Object.defineProperty,K6=Object.getOwnPropertyDescriptor,tC=(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 ml=class extends M(O){constructor(){super(...arguments),this.mdiEject=Ly,this.mdiCloseThick=pe}close(){this.$emit("close")}removeSpool(){this.$store.dispatch("server/spoolman/setActiveSpool",null),this.close()}};tC([P({required:!0})],ml.prototype,"showDialog",2);ml=tC([D({components:{Panel:B}})],ml);var Q6=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(B,{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($,[t(_,[t("p",{staticClass:"body-2"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.EjectSpoolQuestion")))])])],1)],1),t(ne,[t(ae),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)},eL=[];const y1={};var tL=E(ml,Q6,eL,!1,sL,null,null,null);function sL(e){for(let s in y1)this[s]=y1[s]}const Yp=function(){return tL.exports}();var rL=Object.defineProperty,iL=Object.getOwnPropertyDescriptor,sC=(e,s,t,r)=>{for(var i=r>1?void 0:r?iL(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&&rL(s,t,i),i};let hl=class extends M(O){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")}};sC([P({required:!1,default:!1})],hl.prototype,"small",2);hl=sC([D({components:{Panel:B,SpoolmanChangeSpoolDialog:du,SpoolmanEjectSpoolDialog:Yp}})],hl);var nL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(J,{attrs:{"three-line":""}},[t(vt,{class:e.listItemContentClass},[t("div",{class:e.overlineClass},[e._v("#"+e._s(e.id)+" | "+e._s(e.vendor))]),t(Ge,{class:e.listItemTitleClass},[t("span",{staticClass:"cursor-pointer",on:{click:e.clickSpool}},[e._v(e._s(e.name))])]),t(Aa,[e._v(e._s(e.subtitle))])],1),t(bP,{attrs:{tile:"",size:e.avatarSize}},[t(Q2,{attrs:{color:e.color},on:{"click-spool":e.clickSpool}})],1)],1)},aL=[];const C1={};var oL=E(hl,nL,aL,!1,lL,"dfb564f4",null,null);function lL(e){for(let s in C1)this[s]=C1[s]}const mu=function(){return oL.exports}();var cL=Object.defineProperty,uL=Object.getOwnPropertyDescriptor,dL=(e,s,t,r)=>{for(var i=r>1?void 0:r?uL(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&&cL(s,t,i),i};let fm=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiDotsVertical=Vc,this.mdiEject=Ly,this.mdiOpenInNew=Xy,this.mdiSwapVertical=h3,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")}};fm=dL([D({components:{SpoolmanPanelActiveSpool:mu,Panel:B,SpoolmanChangeSpoolDialog:du,SpoolmanEjectSpoolDialog:Yp}})],fm);var mL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(B,{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(J,[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(J,[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($,[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(mu,{on:{"change-spool":function(r){e.showChangeSpoolDialog=!0}}})],1),t(du,{attrs:{"show-dialog":e.showChangeSpoolDialog},on:{close:function(r){e.showChangeSpoolDialog=!1}}}),t(Yp,{attrs:{"show-dialog":e.showEjectSpoolDialog},on:{close:function(r){e.showEjectSpoolDialog=!1}}})],1)},hL=[];const $1={};var pL=E(fm,mL,hL,!1,fL,null,null,null);function fL(e){for(let s in $1)this[s]=$1[s]}const gL=function(){return pL.exports}();var vL=Object.defineProperty,_L=Object.getOwnPropertyDescriptor,hu=(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 Si=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiCounter=My,this.mdiDragVertical=Ra,this.mdiFile=pr,this.mdiPlay=en,this.mdiPlaylistRemove=QT,this.showContextMenu=!1,this.contextMenuX=0,this.contextMenuY=0,this.showChangeCountDialog=!1}get smallThumbnail(){return this.$store.getters["server/jobQueue/getSmallThumbnail"](this.job)}get bigThumbnail(){return this.$store.getters["server/jobQueue/getBigThumbnail"](this.job)}get description(){var r,i;if(!((i=(r=this.job)==null?void 0:r.metadata)!=null&&i.metadataPulled))return!1;const e=[];let s="--";this.filamentLength&&e.push(this.filamentLength),this.filamentWeight&&e.push(this.filamentWeight),e.length&&(s=e.join(" / "));let t="--";return this.estimatedTime&&(t=this.estimatedTime),"".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(s,", ").concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(t)}get filamentLength(){var s,t;const e=(t=(s=this.job.metadata)==null?void 0:s.filament_total)!=null?t:0;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" m":e.toFixed(0)+" mm"}get filamentWeight(){var s,t;const e=(t=(s=this.job.metadata)==null?void 0:s.filament_weight_total)!=null?t:0;return e===0?null:e>=1e3?(length/1e3).toFixed(1)+" kg":e.toFixed(0)+" g"}get estimatedTime(){var a,o;let e=(o=(a=this.job.metadata)==null?void 0:a.estimated_time)!=null?o:0;if(e==0)return"--";const s=[],t=Math.floor(e/(3600*24));t&&(e%=3600*24,s.push(t+"d"));const r=Math.floor(e/3600);e%=3600,r&&s.push(r+"h");const i=Math.floor(e/60);if(i&&s.push(i+"m"),r>0)return s.join(" ");const n=e%60;return n&&s.push(n.toFixed(0)+"s"),s.join(" ")}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:qt}get bigThumbnailTooltipColor(){if(qt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}openContextMenu(e){if(e==null||e.preventDefault(),this.showContextMenu){this.showContextMenu=!1;return}this.showContextMenu=!0,this.contextMenuX=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenuY=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2}printJob(){this.$store.dispatch("server/jobQueue/startByJobId",this.job.job_id)}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}removeFromJobqueue(){var s;const e=[...(s=this.job.combinedIds)!=null?s:[],this.job.job_id];this.$store.dispatch("server/jobQueue/deleteFromQueue",e)}};hu([P({type:Object,required:!0})],Si.prototype,"job",2);hu([P({type:Boolean,default:!1})],Si.prototype,"showPrintButton",2);hu([P({type:Boolean,default:!1})],Si.prototype,"showHandle",2);Si=hu([D],Si);var bL=Object.defineProperty,yL=Object.getOwnPropertyDescriptor,pu=(e,s,t,r)=>{for(var i=r>1?void 0:r?yL(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 Pi=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiChevronUp=Nc,this.mdiChevronDown=hr,this.mdiCounter=My,this.count=1,this.countInputRules=[e=>!!e||this.$t("JobQueue.InvalidCountEmpty"),e=>parseInt(e)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}update(){this.$store.dispatch("server/jobQueue/changeCount",{job_id:this.job.job_id,count:this.count}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(e){var s,t;e&&(this.count=((t=(s=this.job.combinedIds)==null?void 0:s.length)!=null?t:0)+1)}};pu([P({type:Boolean,required:!0})],Pi.prototype,"show",2);pu([P({type:Object,required:!0})],Pi.prototype,"job",2);pu([me("show")],Pi.prototype,"showChanged",1);Pi=pu([D({components:{Panel:B}})],Pi);var CL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":"400"}},[t(B,{attrs:{title:e.$t("JobQueue.ChangeCount"),icon:e.mdiCounter,"card-class":"jobqueue-change-count-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,[t(te,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("JobQueue.Count"),required:"",rules:e.countInputRules,"hide-spin-buttons":"",type:"number"},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.update.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.count++}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.count<=1,icon:"",plain:"",small:""},on:{click:function(r){e.count--}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.count,callback:function(r){e.count=r},expression:"count"}})],1),t(ne,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("JobQueue.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.update}},[e._v(e._s(e.$t("JobQueue.ChangeCount")))])],1)],1)],1)},$L=[];const x1={};var xL=E(Pi,CL,$L,!1,wL,null,null,null);function wL(e){for(let s in x1)this[s]=x1[s]}const SL=function(){return xL.exports}();var PL=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r($,{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(i){return s.openContextMenu(i)},expression:"(e) => openContextMenu(e)",arg:"600"}],staticClass:"jobqueue-list-entry d-flex flex-row flex-nowrap cursor-pointer",on:{contextmenu:function(i){return s.openContextMenu(i)}}},[s.showHandle?r(_,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[r(v,{staticClass:"handle"},[s._v(s._s(s.mdiDragVertical))])],1):s._e(),r(_,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[s.smallThumbnail?r(de,{attrs:{top:"",disabled:!s.bigThumbnail,"content-class":"tooltip__content-opacity1",color:s.bigThumbnailTooltipColor},scopedSlots:s._u([{key:"activator",fn:function(i){var n=i.on,a=i.attrs;return[r("vue-load-image",[r("img",s._g(s._b({attrs:{slot:"image",src:s.smallThumbnail,width:32,height:32,alt:s.job.filename},slot:"image"},"img",a,!1),n)),r("div",{attrs:{slot:"preloader"},slot:"preloader"},[r(dt,{attrs:{indeterminate:"",color:"primary"}})],1),r("div",{attrs:{slot:"error"},slot:"error"},[r(v,[s._v(s._s(s.mdiFile))])],1)])]}}],null,!1,2738555475)},[r("span",[r("img",{attrs:{src:s.bigThumbnail,width:250,alt:s.job.filename}})])]):r(v,[s._v(s._s(s.mdiFile))])],1),r(_,{staticClass:"py-1",staticStyle:{"min-width":"0","font-size":"0.875em"}},[r("div",{staticClass:"text-truncate"},[(e=s.job.combinedIds)!==null&&e!==void 0&&e.length?r("strong",[s._v(s._s(s.job.combinedIds.length+1)+"x")]):s._e(),s._v(" "+s._s(s.job.filename)+" ")]),s.description?r("small",{staticClass:"text-truncate"},[s._v(s._s(s.description))]):s._e()]),s.showPrintButton&&!s.printerIsPrinting?r(_,{staticClass:"col-auto d-flex flex-column justify-center pa-0 pr-1"},[r(g,{staticClass:"minwidth-0",attrs:{icon:"",color:"success"},on:{click:s.startJobqueue}},[r(v,[s._v(s._s(s.mdiPlay))])],1)],1):s._e(),r($e,{attrs:{"position-x":s.contextMenuX,"position-y":s.contextMenuY,absolute:"","offset-y":""},model:{value:s.showContextMenu,callback:function(i){s.showContextMenu=i},expression:"showContextMenu"}},[r(Oe,[r(J,{on:{click:s.printJob}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiPlay))]),s._v(" "+s._s(s.$t("JobQueue.StartPrint"))+" ")],1),r(J,{on:{click:function(i){s.showChangeCountDialog=!0}}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiCounter))]),s._v(" "+s._s(s.$t("JobQueue.ChangeCount"))+" ")],1),r(J,{on:{click:s.removeFromJobqueue}},[r(v,{staticClass:"mr-1"},[s._v(s._s(s.mdiPlaylistRemove))]),s._v(" "+s._s(s.$t("JobQueue.RemoveFromQueue"))+" ")],1)],1)],1),r(SL,{attrs:{show:s.showChangeCountDialog,job:s.job},on:{close:function(i){s.showChangeCountDialog=!1}}})],1)},DL=[];const w1={};var TL=E(Si,PL,DL,!1,ML,null,null,null);function ML(e){for(let s in w1)this[s]=w1[s]}const fu=function(){return TL.exports}();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 gm=class extends M(O){get jobs(){var s;return(s=this.$store.getters["server/jobQueue/getJobs"])!=null?s:[]}get maxLength(){return this.jobs.length>5?4:5}get jobsTable(){return this.jobs.slice(0,this.maxLength)}get jobsRest(){return this.jobs.slice(this.maxLength)}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}};gm=LL([D({components:{JobqueueEntry:fu}})],gm);var AL=Object.defineProperty,kL=Object.getOwnPropertyDescriptor,rC=(e,s,t,r)=>{for(var i=r>1?void 0:r?kL(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&&AL(s,t,i),i};let pl=class extends M(O){constructor(){super(...arguments),this.mdiFileMultiple=ET}get sums(){const e={filamentLength:0,filamentWeight:0,estimatedTime:0};return this.jobs.forEach(s=>{var r,i,n,a,o,l,c,u;const t=((i=(r=s.combinedIds)==null?void 0:r.length)!=null?i:0)+1;e.filamentLength+=((a=(n=s.metadata)==null?void 0:n.filament_total)!=null?a:0)*t,e.filamentWeight+=((l=(o=s.metadata)==null?void 0:o.filament_weight_total)!=null?l:0)*t,e.estimatedTime+=((u=(c=s.metadata)==null?void 0:c.estimated_time)!=null?u:0)*t}),e}get count(){let e=0;return this.jobs.forEach(s=>{var t,r;e+=((r=(t=s.combinedIds)==null?void 0:t.length)!=null?r:0)+1}),e}get headline(){return this.$tc("Panels.StatusPanel.JobqueueMoreFiles",this.count,{count:this.count})}get description(){const e=[];let s="--";this.filamentLength&&e.push(this.filamentLength),this.filamentWeight&&e.push(this.filamentWeight),e.length&&(s=e.join(" / "));let t="--";return this.estimatedTime&&(t=this.estimatedTime),"".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(s,", ").concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(t)}get filamentLength(){const e=this.sums.filamentLength;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" m":e.toFixed(0)+" mm"}get filamentWeight(){const e=this.sums.filamentWeight;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" kg":e.toFixed(0)+" g"}get estimatedTime(){let e=this.sums.estimatedTime;if(e==0)return"--";const s=[],t=Math.floor(e/(3600*24));t&&(e%=3600*24,s.push(t+"d"));const r=Math.floor(e/3600);e%=3600,r&&s.push(r+"h");const i=Math.floor(e/60);if(i&&s.push(i+"m"),r>0)return s.join(" ");const n=e%60;return n&&s.push(n.toFixed(0)+"s"),s.join(" ")}};rC([P({type:Array,required:!0})],pl.prototype,"jobs",2);pl=rC([D],pl);var FL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,{staticClass:"d-flex flex-row flex-nowrap"},[t(_,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[t(v,{staticStyle:{width:"32px"}},[e._v(e._s(e.mdiFileMultiple))])],1),t(_,{staticClass:"py-2",staticStyle:{"min-width":"0","font-size":"0.875em"}},[t("div",{staticClass:"text-truncate"},[e._v(e._s(e.headline))]),t("small",{staticClass:"text-truncate"},[e._v(e._s(e.description))])])],1)},RL=[];const S1={};var jL=E(pl,FL,RL,!1,HL,null,null,null);function HL(e){for(let s in S1)this[s]=S1[s]}const IL=function(){return jL.exports}();var NL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{staticClass:"filesJobqueue",attrs:{flat:""}},[e.jobs.length?[t($,{staticClass:"mx-0 mt-0 pb-3"},[t(_,{staticClass:"jobqueue-list"},[e._l(e.jobsTable,function(r,i){return t(fu,{key:r.job_id,attrs:{job:r,"show-handle":!1,"show-print-button":i===0}})}),e.jobsRest.length?t(IL,{attrs:{jobs:e.jobsRest}}):e._e()],2)],1)]:t("div",[t("p",{staticClass:"body-2 my-3 text-center text--disabled"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyJobqueue")))])])],2)},VL=[];const P1={};var UL=E(gm,NL,VL,!1,BL,"8d295736",null,null);function BL(e){for(let s in P1)this[s]=P1[s]}const iC=function(){return UL.exports}();var WL=Object.defineProperty,GL=Object.getOwnPropertyDescriptor,Xr=(e,s,t,r)=>{for(var i=r>1?void 0:r?GL(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&&WL(s,t,i),i};let Us=class extends M(O){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}};Xr([P({required:!1,default:!1})],Us.prototype,"loading",2);Xr([P({required:!1,default:""})],Us.prototype,"icon",2);Xr([P({required:!0})],Us.prototype,"title",2);Xr([P({required:!1})],Us.prototype,"subTitle",2);Xr([P({required:!1,default:!1})],Us.prototype,"dynamicSlotWidth",2);Xr([P({required:!1,default:!1})],Us.prototype,"mobileSecondRow",2);Us=Xr([D],Us);var zL=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,{class:e.firstColClasses},[t($,{staticClass:"d-flex flex-row"},[e.loading?t(_,{staticClass:"col-auto d-flex justify-center align-center pr-0"},[t(dt,{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)},ZL=[];const D1={};var qL=E(Us,zL,ZL,!1,XL,"ac415fda",null,null);function XL(e){for(let s in D1)this[s]=D1[s]}const V=function(){return qL.exports}();var YL=Object.defineProperty,JL=Object.getOwnPropertyDescriptor,gu=(e,s,t,r)=>{for(var i=r>1?void 0:r?JL(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 Di=class extends M(O){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:qt}get bigThumbnailStyle(){return qt.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")}};gu([P({required:!0,default:!1})],Di.prototype,"bool",2);gu([P({required:!0,default:""})],Di.prototype,"currentPath",2);gu([P({required:!0})],Di.prototype,"file",2);Di=gu([D({components:{SettingsRow:V}})],Di);var KL=Object.defineProperty,QL=Object.getOwnPropertyDescriptor,nC=(e,s,t,r)=>{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 fl=class extends M(O){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,m;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((m=(d=this.activeSpool)==null?void 0:d.remaining_weight)!=null?m:0);return r{for(var i=r>1?void 0:r?u9(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&&c9(s,t,i),i};let Vr=class extends M(O){constructor(){super(...arguments),this.mdiChevronDown=hr,this.mdiChevronUp=Nc,this.mdiPlaylistPlus=Xc,this.mdiCloseThick=pe,this.isValid=!1,this.input="1",this.rules={count:[e=>!!e||this.$t("JobQueue.InvalidCountEmpty"),e=>parseInt(e,10)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}}async addBatchToQueueAction(){const e=Array(parseInt(this.input)).fill(this.filename);await this.$store.dispatch("server/jobQueue/addToQueue",e),this.showToast&&this.$toast.info(this.$t("History.AddToQueueSuccessful",{filename:this.filename}).toString()),this.closeDialog()}closeDialog(){this.$emit("close")}resetFormState(){this.input="1"}isVisibleChanged(e){e&&this.resetFormState()}};Ba([P({type:Boolean,default:!1})],Vr.prototype,"isVisible",2);Ba([P({type:Boolean,default:!1})],Vr.prototype,"showToast",2);Ba([P({type:String,required:!0})],Vr.prototype,"filename",2);Ba([me("isVisible")],Vr.prototype,"isVisibleChanged",1);Vr=Ba([D],Vr);var d9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.isVisible,"max-width":400},on:{"click:outside":e.closeDialog,keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(B,{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:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(cr,{on:{submit:function(r){return r.preventDefault(),e.addBatchToQueueAction.apply(null,arguments)}},model:{value:e.isValid,callback:function(r){e.isValid=r},expression:"isValid"}},[t(q,[t(te,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("Files.Count"),required:"","hide-spin-buttons":"",type:"number",rules:e.rules.count},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.input++}}},[t(v,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.input<=1,icon:"",plain:"",small:""},on:{click:function(r){e.input--}}},[t(v,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.input,callback:function(r){e.input=r},expression:"input"}})],1),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.isValid}},[e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")])],1)],1)],1)],1)},m9=[];const E1={};var h9=E(Vr,d9,m9,!1,p9,"28986d85",null,null);function p9(e){for(let s in E1)this[s]=E1[s]}const an=function(){return h9.exports}();var f9=Object.defineProperty,g9=Object.getOwnPropertyDescriptor,v9=(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&&f9(s,t,i),i};let vm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiFile=pr,this.mdiPlay=en,this.mdiPlaylistPlus=Xc,this.mdiFire=Qi,this.mdiVideo3d=Jc,this.mdiCloudDownload=Gn,this.mdiFileDocumentEditOutline=ja,this.mdiRenameBox=Yc,this.mdiDelete=ze,this.mdiCloseThick=pe,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={isVisible:!1,filename:""},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:[];s=s.slice().sort((i,n)=>n.modified.getTime()-i.modified.getTime()).slice(0,5);const t=s.filter(i=>!i.metadataRequested&&!i.metadataPulled);return this.$store.dispatch("files/requestMetadata",t.map(i=>({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:qt}get bigThumbnailTooltipColor(){if(qt.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.isVisible=!0,this.dialogAddBatchToQueue.filename=s.filename}closeAddBatchToQueueDialog(){this.dialogAddBatchToQueue.isVisible=!1}view3D(s){this.$router.push({path:"/viewer",query:{filename:"gcodes/"+s.filename}})}downloadFile(s){const t=this.apiUrl+"/server/files/gcodes/"+encodeURI(s.filename);window.open(t)}editFile(s){const t=s.filename.lastIndexOf("/"),r=t>0?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()})}};vm=v9([D({components:{Panel:B,StartPrintDialog:vu,AddBatchToQueueDialog:an}})],vm);var _9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{ref:"filesGcodeCard",staticClass:"filesGcodeCard",attrs:{flat:""}},[t(zr,{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(de,{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(dt,{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(de,{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(vu,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(B,{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(te,{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(ae),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(B,{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(ae),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(an,{attrs:{"is-visible":e.dialogAddBatchToQueue.isVisible,filename:e.dialogAddBatchToQueue.filename},on:{close:e.closeAddBatchToQueueDialog}})],1)},b9=[];const O1={};var y9=E(vm,_9,b9,!1,C9,"6933c59e",null,null);function C9(e){for(let s in O1)this[s]=O1[s]}const aC=function(){return y9.exports}();var $9=Object.defineProperty,x9=Object.getOwnPropertyDescriptor,w9=(e,s,t,r)=>{for(var i=r>1?void 0:r?x9(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&&$9(s,t,i),i};let _m=class extends M(O){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){const t=s<0?"-":"";let r=Math.abs(s);const i=Math.floor(r/3600);r%=3600;const n=("0"+Math.floor(r/60)).slice(-2),a=("0"+Math.floor(r%60)).slice(-2);return t+i+":"+n+":"+a}};_m=w9([D({components:{StatusPanelFilesJobqueue:iC,StatusPanelFilesGcodes:aC}})],_m);var S9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,{staticClass:"pa-0"},[t(Ae,{staticClass:"py-0"},[t($,{staticClass:"text-center py-5",attrs:{align:"center"}},[t(_,{staticClass:"col-3 pa-0"},[e.live_velocity!==null?[t(de,{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(de,{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(de,{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(de,{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(U,{staticClass:"my-0"}),t(Ae,{staticClass:"py-0"},[t($,{staticClass:"text-center pt-5 pb-2 mb-0",attrs:{align:"center"}},[t(_,{staticClass:"col-3 pa-0"},[t(de,{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(de,{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)},P9=[];const L1={};var D9=E(_m,S9,P9,!1,T9,null,null,null);function T9(e){for(let s in L1)this[s]=L1[s]}const M9=function(){return D9.exports}();var E9=Object.defineProperty,O9=Object.getOwnPropertyDescriptor,L9=(e,s,t,r)=>{for(var i=r>1?void 0:r?O9(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&&E9(s,t,i),i};let bm=class extends M(O){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}};bm=L9([D({components:{}})],bm);var A9=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,{staticClass:"pa-0"},[t(Ae,{staticClass:"py-0"},[t($,{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)},k9=[];const A1={};var F9=E(bm,A9,k9,!1,R9,null,null,null);function R9(e){for(let s in A1)this[s]=A1[s]}const j9=function(){return F9.exports}();var H9=Object.defineProperty,I9=Object.getOwnPropertyDescriptor,N9=(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&&H9(s,t,i),i};let ym=class extends M(O){};ym=N9([D({components:{StatusPanelPrintstatusPrinting:M9,StatusPanelPrintstatusComplete:j9}})],ym);var V9=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)},U9=[];const k1={};var B9=E(ym,V9,U9,!1,W9,null,null,null);function W9(e){for(let s in k1)this[s]=k1[s]}const G9=function(){return B9.exports}();var z9=Object.defineProperty,Z9=Object.getOwnPropertyDescriptor,oC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Z9(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&&z9(s,t,i),i};let gl=class extends M(O){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:Go}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)}};oC([P({required:!1,default:""})],gl.prototype,"hoverName",2);gl=oC([D],gl);var q9=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)])},X9=[];const F1={};var Y9=E(gl,q9,X9,!1,J9,"71825b43",null,null);function J9(e){for(let s in F1)this[s]=F1[s]}const lC=function(){return Y9.exports}();var K9=Object.defineProperty,Q9=Object.getOwnPropertyDescriptor,cC=(e,s,t,r)=>{for(var i=r>1?void 0:r?Q9(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&&K9(s,t,i),i};let vl=class extends M(O){constructor(){super(...arguments),this.mdiCloseCircle=zo}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)}};cC([P({required:!1,default:""})],vl.prototype,"hoverName",2);vl=cC([D],vl);var eA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e._l(e.printing_objects,function(r){return[t($,{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(as,{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(U,{key:"divider_"+r.name})]})],2)},tA=[];const R1={};var sA=E(vl,eA,tA,!1,rA,null,null,null);function rA(e){for(let s in R1)this[s]=R1[s]}const uC=function(){return sA.exports}();var iA=Object.defineProperty,nA=Object.getOwnPropertyDescriptor,_u=(e,s,t,r)=>{for(var i=r>1?void 0:r?nA(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 Ti=class extends M(O){constructor(){super(...arguments),this.hoverName="",this.mdiSelectionRemove=qo,this.mdiCloseThick=pe}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}};_u([P({required:!0})],Ti.prototype,"showDialog",2);_u([P({required:!0})],Ti.prototype,"excludeObjectDialogBool",2);_u([P({required:!0})],Ti.prototype,"excludeObjectDialogName",2);Ti=_u([D({components:{Panel:B,StatusPanelExcludeObjectDialogList:uC,StatusPanelExcludeObjectDialogMap:lC}})],Ti);var aA=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(B,{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(Ae,[t($,[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)},oA=[];const j1={};var lA=E(Ti,aA,oA,!1,cA,null,null,null);function cA(e){for(let s in j1)this[s]=j1[s]}const uA=function(){return lA.exports}();var dA=Object.defineProperty,mA=Object.getOwnPropertyDescriptor,dC=(e,s,t,r)=>{for(var i=r>1?void 0:r?mA(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&&dA(s,t,i),i};let _l=class extends M(O){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Ws,this.mdiSelectionRemove=qo,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}};dC([P({required:!0})],_l.prototype,"showDialog",2);_l=dC([D({components:{StatusPanelExcludeObjectDialog:uA}})],_l);var hA=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(Ae,{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(U,{staticClass:"mt-0 mb-0"}),t(oe,{attrs:{"max-width":"400"},model:{value:e.boolShowExcludeObjectDialog,callback:function(r){e.boolShowExcludeObjectDialog=r},expression:"boolShowExcludeObjectDialog"}},[t(xe,[t(La,{attrs:{flat:"",dense:""}},[t(Yi,[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(ae),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()},pA=[];const H1={};var fA=E(_l,hA,pA,!1,gA,null,null,null);function gA(e){for(let s in H1)this[s]=H1[s]}const vA=function(){return fA.exports}();var _A=Object.defineProperty,bA=Object.getOwnPropertyDescriptor,mC=(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 bl=class extends M(O){constructor(){super(...arguments),this.mdiFileOutline=ky,this.mdiFile=pr,this.focus=!1,this.thumbnailFactor=0}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>=rr);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>=rr);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>=rr);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>=bs&&t.width<=ys&&t.height>=bs&&t.height<=ys);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:qt}get thumbnailStyle(){let s={height:"200px"};return this.printstatusThumbnailZoom?this.focus&&this.thumbnailBlurHeight>0&&(s.height="".concat(this.thumbnailBlurHeight,"px")):s.height="100%",qt.toLowerCase()!==this.bigThumbnailBackground.toLowerCase()&&(s.backgroundColor=this.bigThumbnailBackground),s}get styleThumbnailOverlay(){const s={backgroundColor:"rgba(0, 0, 0, 0.3)",backdropFilter:"blur(3px)"};return this.$vuetify.theme.dark||(s.backgroundColor="rgba(255, 255, 255, 0.3)"),s}get thumbnailBlurHeight(){return this.thumbnailFactor===0?0:(this.thumbnailBigHeight*this.thumbnailFactor).toFixed()}get printstatusThumbnailZoom(){var s;return(s=this.$store.state.gui.uiSettings.printstatusThumbnailZoom)!=null?s:!0}calcThumbnailFactor(){var t,r;const s=(r=(t=this.$refs.bigThumbnail)==null?void 0:t.$el.clientWidth)!=null?r:0;return(!s||!this.thumbnailBigWidth)&&(this.thumbnailFactor=0),this.thumbnailFactor=s/this.thumbnailBigWidth}handleResize(){this.$nextTick(()=>{this.calcThumbnailFactor()})}};mC([qe(200)],bl.prototype,"handleResize",1);bl=mC([D({})],bl);var yA=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(Fc,{ref:"bigThumbnail",staticClass:"d-flex align-end statusPanel-big-thumbnail",style:e.thumbnailStyle,attrs:{src:e.thumbnailBig,tabindex:"-1",height:"200"},on:{focus:function(r){e.focus=!0},blur:function(r){e.focus=!1}}},[t(gt,{staticClass:"white--text py-2 px-2",style:e.styleThumbnailOverlay},[t($,[t(_,[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(Ae,[t($,[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(de,{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(dt,{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(dt,{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()},CA=[];const I1={};var $A=E(bl,yA,CA,!1,xA,"56af8069",null,null);function xA(e){for(let s in I1)this[s]=I1[s]}const wA=function(){return $A.exports}();var SA=Object.defineProperty,PA=Object.getOwnPropertyDescriptor,bu=(e,s,t,r)=>{for(var i=r>1?void 0:r?PA(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&&SA(s,t,i),i};let Mi=class extends M(O){constructor(){super(...arguments),this.mdiLayersPlus=qd,this.mdiCloseThick=pe,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)}};bu([P({required:!0})],Mi.prototype,"showDialog",2);bu([me("showDialog")],Mi.prototype,"showDialogChanged",1);bu([me("type")],Mi.prototype,"typeChanged",1);Mi=bu([D({components:{Panel:B,StatusPanelExcludeObjectDialogList:uC,StatusPanelExcludeObjectDialogMap:lC}})],Mi);var DA=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(B,{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($,[t(_,[t(it,{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($,[t(_,[t(it,{attrs:{text:"",type:"warning",border:"left"}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.DescriptionPauseNextLayerActive",{call:e.macroSettingsPauseAtLayerCall}))+" ")])],1)],1):e._e(),t($,[t(_,[t(Ee,{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(te,{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($,{staticClass:"mt-0"},[t(_,[t(Ee,{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(ae),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)},TA=[];const N1={};var MA=E(Mi,DA,TA,!1,EA,null,null,null);function EA(e){for(let s in N1)this[s]=N1[s]}const OA=function(){return MA.exports}();var LA=Object.defineProperty,AA=Object.getOwnPropertyDescriptor,hC=(e,s,t,r)=>{for(var i=r>1?void 0:r?AA(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&&LA(s,t,i),i};let yl=class extends M(O){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiMessageProcessingOutline=GT,this.mdiCloseCircle=zo,this.mdiDotsVertical=Vc,this.mdiAlertOutline=Wn,this.boolShowObjects=!1,this.boolShowPauseAtLayer=!1,this.activeTab="files",this.lastFilename=""}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get jobsCount(){return this.$store.getters["server/jobQueue/getJobsCount"]}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:Dp,loadingName:"statusPrintPause",status:()=>["printing"].includes(this.printer_state),click:this.btnPauseJob},{text:this.$t("Panels.StatusPanel.ResumePrint"),color:"success",icon:en,loadingName:"statusPrintResume",status:()=>["paused"].includes(this.printer_state),click:this.btnResumeJob},{text:this.$t("Panels.StatusPanel.CancelPrint"),color:"error",icon:s2,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:qo,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:qd,loadingName:"pauseAtLayer",status:()=>this.multiFunctionButton||!this.displayPauseAtLayerButton?!1:["paused","printing"].includes(this.printer_state),click:this.btnPauseAtLayer},{text:this.$t("Panels.StatusPanel.ClearPrintStats"),color:"primary",icon:wy,loadingName:"statusPrintClear",status:()=>["error","complete","cancelled"].includes(this.printer_state),click:this.btnClearJob},{text:this.$t("Panels.StatusPanel.ReprintJob"),color:"primary",icon:Jy,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:qo,status:()=>this.printing_objects.length>1,disabled:()=>["paused","printing"].includes(this.printer_state),click:this.btnExcludeObject},{text:this.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer"),loadingName:"pauseAtLayer",icon:qd,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"})}};hC([me("current_filename")],yl.prototype,"current_filenameChanged",1);yl=hC([D({components:{KlippyStatePanel:Na,MinSettingsPanel:Ip,Panel:B,StatusPanelExcludeObject:vA,StatusPanelGcodefiles:aC,StatusPanelJobqueue:iC,StatusPanelPrintstatus:G9,StatusPanelPrintstatusThumbnail:wA,StatusPanelPauseAtLayerDialog:OA}})],yl);var kA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Ip),t(Na),e.klipperReadyForGui?t(B,{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(dt,{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(de,{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(J,{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(Ae,[t($,[t(_,{staticClass:"py-2"},[t("span",{staticClass:"subtitle-2 px-0 text--disabled"},[t(v,{staticClass:"mr-2 mt-1 float-left",attrs:{color:"warning",small:""}},[e._v(" "+e._s(e.mdiAlertOutline)+" ")]),e._v(" "+e._s(e.print_stats_message)+" ")],1)])],1)],1),t(U,{staticClass:"mt-0 mb-0"})]:e._e(),e.display_message?[t(Ae,[t($,{staticClass:"flex-nowrap"},[t(_,{staticClass:"py-2",staticStyle:{"min-width":"0"}},[t("span",{staticClass:"subtitle-2 px-0 text--disabled"},[t(v,{staticClass:"mr-2 mt-1 float-left",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(U,{staticClass:"mt-0 mb-0"})]:e._e(),t(Vo,{attrs:{"fixed-tabs":""},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(pi,{attrs:{href:"#status"}},[e._v(e._s(e.$t("Panels.StatusPanel.Status")))]):e._e(),t(pi,{attrs:{href:"#files"}},[e._v(e._s(e.$t("Panels.StatusPanel.Files")))]),t(pi,{attrs:{href:"#jobqueue"}},[t(ay,{attrs:{color:e.jobQueueBadgeColor,content:e.jobsCount.toString(),inline:!0}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Jobqueue"))+" ")])],1)],1),t(U,{staticClass:"my-0"}),t(oy,{staticClass:"_border-radius",model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(Pr,{attrs:{value:"status"}},[t("status-panel-printstatus")],1):e._e(),t(Pr,{attrs:{value:"files"}},[t("status-panel-gcodefiles")],1),t(Pr,{attrs:{value:"jobqueue"}},[t("status-panel-jobqueue")],1)],1)],2):e._e()],1)},FA=[];const V1={};var RA=E(yl,kA,FA,!1,jA,"75338652",null,null);function jA(e){for(let s in V1)this[s]=V1[s]}const Tn=function(){return RA.exports}();var HA=Object.defineProperty,IA=Object.getOwnPropertyDescriptor,NA=(e,s,t,r)=>{for(var i=r>1?void 0:r?IA(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&&HA(s,t,i),i};let Cm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiEngineOff=bp,this.mdiHome=Iy}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})}};Cm=NA([D],Cm);var VA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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($,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Vt,{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($,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Vt,{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($,{attrs:{dense:""}},[t(_,{staticClass:"text-center"},[t(Vt,{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)},UA=[];const U1={};var BA=E(Cm,VA,UA,!1,WA,"23a679bf",null,null);function WA(e){for(let s in U1)this[s]=U1[s]}const GA=function(){return BA.exports}();var zA=Object.defineProperty,ZA=Object.getOwnPropertyDescriptor,qA=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZA(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&&zA(s,t,i),i};let $m=class extends M(O,Ke){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()}};$m=qA([D],$m);var XA=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,[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)},YA=[];const B1={};var JA=E($m,XA,YA,!1,KA,"8e4f3fa8",null,null);function KA(e){for(let s in B1)this[s]=B1[s]}const QA=function(){return JA.exports}();var ek=Object.defineProperty,tk=Object.getOwnPropertyDescriptor,sk=(e,s,t,r)=>{for(var i=r>1?void 0:r?tk(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&&ek(s,t,i),i};let xm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiChevronUp=Nc,this.mdiChevronLeft=dT,this.mdiChevronRight=mT,this.mdiChevronDown=hr,this.mdiEngineOff=bp,this.mdiHome=Iy}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)}};xm=sk([D({components:{Responsive:et}})],xm);var rk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(et,{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($,[t(_,[t($,{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($,{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($,{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($,{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($,[t(_,{staticClass:"d-flex align-center"},[t("div",{staticClass:"flex-grow-1",staticStyle:{"border-radius":"4px",overflow:"hidden"}},[t($,{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($,{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($,{staticClass:"mt-3",attrs:{"no-gutters":""}},[t(_,[e.stepsReversed.length>0?t(Uo,{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)]}}])})},ik=[];const W1={};var nk=E(xm,rk,ik,!1,ak,"8c5676c8",null,null);function ak(e){for(let s in W1)this[s]=W1[s]}const ok=function(){return nk.exports}();var lk=Object.defineProperty,ck=Object.getOwnPropertyDescriptor,gr=(e,s,t,r)=>{for(var i=r>1?void 0:r?ck(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&&lk(s,t,i),i};let Ss=class extends M(O){onBlur(){this.position!==this.currentPos&&(this.position=this.currentPos)}submit(){this.$emit("submit")}};gr([MD({type:String})],Ss.prototype,"position",2);gr([P({type:String,required:!0})],Ss.prototype,"currentPos",2);gr([P({type:String,required:!1})],Ss.prototype,"label",2);gr([P({type:String,required:!1})],Ss.prototype,"suffix",2);gr([P({type:Number,required:!1,default:1})],Ss.prototype,"step",2);gr([P({type:Boolean,required:!1})],Ss.prototype,"disabled",2);gr([P({type:Boolean,required:!1})],Ss.prototype,"readonly",2);Ss=gr([D({components:{}})],Ss);var uk=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(te,{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)},dk=[];const G1={};var mk=E(Ss,uk,dk,!1,hk,null,null,null);function hk(e){for(let s in G1)this[s]=G1[s]}const wo=function(){return mk.exports}();var pk=Object.defineProperty,fk=Object.getOwnPropertyDescriptor,yu=(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&&pk(s,t,i),i};let Ei=class extends M(O,Ke){constructor(){super(...arguments),this.mdiCrosshairsGps=yT,this.mdiGrid=Bc,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}))}};yu([me("gcodePositions.x",{immediate:!0})],Ei.prototype,"updatePositionX",1);yu([me("gcodePositions.y",{immediate:!0})],Ei.prototype,"updatePositionY",1);yu([me("gcodePositions.z",{immediate:!0})],Ei.prototype,"updatePositionZ",1);Ei=yu([D({components:{MoveToInput:wo,Responsive:et}})],Ei);var gk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.showCoordinates||e.showPosition?t(Ae,{class:e.containerClass},[t(et,{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($,{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($,{attrs:{dense:""}},[t(_,{class:i.is.xsmall?"col-12":"col-4"},[t(wo,{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(wo,{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(wo,{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()},vk=[];const z1={};var _k=E(Ei,gk,vk,!1,bk,null,null,null);function bk(e){for(let s in z1)this[s]=z1[s]}const pC=function(){return _k.exports}();var yk=Object.defineProperty,Ck=Object.getOwnPropertyDescriptor,$k=(e,s,t,r)=>{for(var i=r>1?void 0:r?Ck(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&&yk(s,t,i),i};let Cl=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.trim()}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.replaceAll(" ","").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"}};Cl=$k([D],Cl);var xk=Object.defineProperty,wk=Object.getOwnPropertyDescriptor,Sk=(e,s,t,r)=>{for(var i=r>1?void 0:r?wk(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 wm=class extends M(O,Cl){constructor(){super(...arguments),this.mdiBroom=wy,this.mdiContentSave=vp,this.mdiArrowCollapseDown=Hc,this.mdiInformation=kt,this.mdiArrowExpandUp=xy,this.mdiLayersOutline=NT,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}};wm=Sk([D({components:{Panel:B,Responsive:et}})],wm);var Pk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(et,{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(Ae,{staticClass:"pa-0"},[t($,[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($,{attrs:{dense:""}},[t(_,{class:i.is.medium?"col-12":"order-1 col-6"},[t("div",{staticClass:"d-flex align-center"},[t(Vt,{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(Vt,{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(Vt,{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(B,{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(ae),t(g,{attrs:{text:""},on:{click:function(n){e.saveOffsetDialog=!1}}},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Ok")))])],1):t(ne,[t(ae),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)]}}])})},Dk=[];const Z1={};var Tk=E(wm,Pk,Dk,!1,Mk,"51065007",null,null);function Mk(e){for(let s in Z1)this[s]=Z1[s]}const fC=function(){return Tk.exports}();var Ek=Object.defineProperty,Ok=Object.getOwnPropertyDescriptor,Lk=(e,s,t,r)=>{for(var i=r>1?void 0:r?Ok(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&&Ek(s,t,i),i};let Sm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiDotsVertical=Vc,this.mdiEngineOff=bp,this.mdiGamepad=wp,this.mdiSpeedometer=m3,this.mdiRestore=o3,this.mdiMenuDown=fr}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}};Sm=Lk([D({components:{BarsControl:GA,CircleControl:QA,CrossControl:ok,MoveToControl:pC,Panel:B,ToolSlider:Qc,ZoffsetControl:fC}})],Sm);var Ak=Object.defineProperty,kk=Object.getOwnPropertyDescriptor,Fk=(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&&Ak(s,t,i),i};let Pm=class extends M(O){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})}};Pm=Fk([D],Pm);var Rk=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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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)},jk=[];const q1={};var Hk=E(Pm,Rk,jk,!1,Ik,null,null,null);function Ik(e){for(let s in q1)this[s]=q1[s]}const Nk=function(){return Hk.exports}();var Vk=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(B,{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(J,[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(J,[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(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.doQGL}},[e._v("Quad Gantry Level")])],1):e._e(),e.existsBedTilt?t(J,[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(J,[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(J,[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(J,[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(J,[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(J,[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(Nk)]},proxy:!0}],null,!1,2619595342)},[t(pC),e.axisControlVisible?t(Ae,[t("".concat(e.controlStyle,"-control"),{tag:"component"})],1):e._e(),e.showZOffset?t(U):e._e(),e.showZOffset?t(Ae,[t(fC)],1):e._e(),e.showSpeedFactor?t(U):e._e(),e.showSpeedFactor?t(Ae,[t(Qc,{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()},Uk=[];const X1={};var Bk=E(Sm,Vk,Uk,!1,Wk,null,null,null);function Wk(e){for(let s in X1)this[s]=X1[s]}const Gk=function(){return Bk.exports}();var zk=Object.defineProperty,Zk=Object.getOwnPropertyDescriptor,qk=(e,s,t,r)=>{for(var i=r>1?void 0:r?Zk(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 _t=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 themeName(){return this.$store.getters["gui/theme"]}get theme(){return this.$store.getters["gui/getTheme"]}get themeMode(){var e;return(e=this.$store.state.gui.uiSettings.mode)!=null?e:"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(){var e,s;return(e=this.theme.sidebarBackground)!=null&&e.show?(s=this.theme.sidebarBackground)!=null&&s.light&&this.themeMode==="light"?"/img/themes/sidebarBackground-".concat(this.themeName,"-light.png"):"/img/themes/sidebarBackground-".concat(this.themeName,".png"):this.$vuetify.theme.dark?"/img/sidebar-background.svg":"/img/sidebar-background-light.svg"}get sidebarLogo(){var s,t,r;const e=this.$store.getters["files/getSidebarLogo"];return e!==""||this.themeName==="mainsail"?e:(t=(s=this.theme.logo)==null?void 0:s.show)!=null&&t?(r=this.theme.logo)!=null&&r.light&&this.themeMode==="light"?"/img/themes/sidebarLogo-".concat(this.themeName,"-light.svg"):"/img/themes/sidebarLogo-".concat(this.themeName,".svg"):""}get mainBgImage(){var s,t;const e=this.$store.getters["files/getMainBackground"];return e||this.themeName==="mainsail"?e:(s=this.theme.mainBackground)!=null&&s.show?(t=this.theme.mainBackground)!=null&&t.light&&this.themeMode==="light"?"/img/themes/mainBackground-".concat(this.themeName,"-light.png"):"/img/themes/mainBackground-".concat(this.themeName,".png"):null}};_t=qk([D],_t);var Xk=Object.defineProperty,Yk=Object.getOwnPropertyDescriptor,Jp=(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 ta=class extends M(O,_t){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+=""+at(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",Un.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){var s,t;((s=this.chart)==null?void 0:s.isDisposed())!==!0&&((t=this.chart)==null||t.setOption({legend:{selected:e}}))}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?sF(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&&tF(s,t,i),i};let ls=class extends M(O,Ke){constructor(){super(...arguments),this.mdiSnowflake=Mp,this.mdiFire=Qi,this.mdiMenuDown=fr,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?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 $l=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiSnowflake=Mp}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}cooldown(){this.$store.dispatch("server/addEvent",{message:this.cooldownGcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.cooldownGcode}),this.closePrompt()}closePrompt(){this.$emit("close")}};_C([P({type:Boolean,default:!1})],$l.prototype,"showDialog",2);$l=_C([D({components:{Panel:B}})],$l);var cF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:""}},[t(B,{attrs:{title:e.$t("CoolDownDialog.CoolDown"),"card-class":"cool-down-dialog",icon:e.mdiSnowflake,"margin-bottom":!1},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._v(e._s(e.$t("CoolDownDialog.AreYouSure")))]),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closePrompt}},[e._v(e._s(e.$t("CoolDownDialog.No")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.cooldown}},[e._v(e._s(e.$t("CoolDownDialog.Yes")))])],1)],1)],1)},uF=[];const K1={};var dF=E($l,cF,uF,!1,mF,null,null,null);function mF(e){for(let s in K1)this[s]=K1[s]}const bC=function(){return dF.exports}();var hF=Object.defineProperty,pF=Object.getOwnPropertyDescriptor,fF=(e,s,t,r)=>{for(var i=r>1?void 0:r?pF(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&&hF(s,t,i),i};let Dm=class extends M(O){constructor(){super(...arguments),this.mdiFire=Qi,this.mdiMenuDown=fr,this.mdiSnowflake=Mp,this.mdiCloseThick=pe,this.showCoolDownDialog=!1}get presets(){var e;return(e=this.$store.getters["gui/presets/getPresets"])!=null?e:[]}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}get confirmOnCoolDown(){return this.$store.state.gui.uiSettings.confirmOnCoolDown}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)}btnCoolDown(){if(this.confirmOnCoolDown){this.showCoolDownDialog=!0;return}this.cooldown()}cooldown(){this.showCoolDownDialog=!1,this.$store.dispatch("server/addEvent",{message:this.cooldownGcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.cooldownGcode})}};Dm=fF([D({components:{CoolDownDialog:bC}})],Dm);var gF=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(J,{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(U,{staticClass:"_fix_transparency"}),t(Oe,{staticClass:"py-0",attrs:{dense:""}},[t(J,{attrs:{link:""},on:{click:e.btnCoolDown}},[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.btnCoolDown}},[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),t(bC,{attrs:{"show-dialog":e.showCoolDownDialog},on:{close:function(r){e.showCoolDownDialog=!1}}})],1)},vF=[];const Q1={};var _F=E(Dm,gF,vF,!1,bF,"300d8a4d",null,null);function bF(e){for(let s in Q1)this[s]=Q1[s]}const yC=function(){return _F.exports}();var yF=Object.defineProperty,CF=Object.getOwnPropertyDescriptor,$F=(e,s,t,r)=>{for(var i=r>1?void 0:r?CF(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&&yF(s,t,i),i};let Tm=class extends M(O,Ke){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiThermometerLines=o2,this.convertName=at,this.capitalize=jr}get boolTempchart(){var s;return(s=this.$store.state.gui.view.tempchart.boolTempchart)!=null?s:!1}};Tm=$F([D({components:{Panel:B,TempChart:gC,TemperatureInput:vC,Responsive:et,TemperaturePanelPresets:yC}})],Tm);var xF=Object.defineProperty,wF=Object.getOwnPropertyDescriptor,CC=(e,s,t,r)=>{for(var i=r>1?void 0:r?wF(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&&xF(s,t,i),i};let xl=class extends M(O){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(_y):"".concat(this.color).concat(by)}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":""}};CC([P({type:Boolean,required:!0})],xl.prototype,"isResponsiveMobile",2);xl=CC([D],xl);var SF=Object.defineProperty,PF=Object.getOwnPropertyDescriptor,Kp=(e,s,t,r)=>{for(var i=r>1?void 0:r?PF(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&&SF(s,t,i),i};let sa=class extends M(O){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 jr(this.serieName)}};Kp([P({type:String,required:!0})],sa.prototype,"objectName",2);Kp([P({type:String,required:!0})],sa.prototype,"serieName",2);sa=Kp([D],sa);var DF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,{staticClass:"py-1"},[t(_e,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},TF=[];const ev={};var MF=E(sa,DF,TF,!1,EF,null,null,null);function EF(e){for(let s in ev)this[s]=ev[s]}const $C=function(){return MF.exports}();var OF=Object.defineProperty,LF=Object.getOwnPropertyDescriptor,Qp=(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 ra=class extends M(O){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})}};Qp([P({type:String,required:!0})],ra.prototype,"objectName",2);Qp([P({type:String,required:!0})],ra.prototype,"additionalSensor",2);ra=Qp([D],ra);var AF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,{staticClass:"col-12 py-1"},[t(_e,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},kF=[];const tv={};var FF=E(ra,AF,kF,!1,RF,null,null,null);function RF(e){for(let s in tv)this[s]=tv[s]}const xC=function(){return FF.exports}();var jF=Object.defineProperty,HF=Object.getOwnPropertyDescriptor,zs=(e,s,t,r)=>{for(var i=r>1?void 0:r?HF(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&&jF(s,t,i),i};let cs=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe}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")}};zs([P({type:Boolean,required:!0})],cs.prototype,"boolShow",2);zs([P({type:String,required:!0})],cs.prototype,"objectName",2);zs([P({type:String,required:!0})],cs.prototype,"name",2);zs([P({required:!0})],cs.prototype,"additionalSensorName",2);zs([P({type:String,required:!0})],cs.prototype,"formatName",2);zs([P({type:String,required:!0})],cs.prototype,"icon",2);zs([P({type:String,required:!0})],cs.prototype,"color",2);zs([qe(500)],cs.prototype,"setChartColor",1);cs=zs([D({components:{TemperaturePanelListItemEditAdditionalSensor:xC,TemperaturePanelListItemEditChartSerie:$C}})],cs);var IF=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(B,{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($C,{key:r,attrs:{"object-name":e.objectName,"serie-name":r}})}),e._l(e.additionalValues,function(r){return t(xC,{key:r,attrs:{"object-name":e.objectName,"additional-sensor":r}})}),t($,[t(_,{staticClass:"col-12 text-center pb-0"},[t(rs,{staticClass:"mx-auto",attrs:{"hide-mode-switch":"",mode:"hexa",value:e.color},on:{"update:color":e.setChartColor}})],1)],1)],2)],1)],1)},NF=[];const sv={};var VF=E(cs,IF,NF,!1,UF,null,null,null);function UF(e){for(let s in sv)this[s]=sv[s]}const wC=function(){return VF.exports}();var BF=Object.defineProperty,WF=Object.getOwnPropertyDescriptor,Wa=(e,s,t,r)=>{for(var i=r>1?void 0:r?WF(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&&BF(s,t,i),i};let Ur=class extends M(O){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}};Wa([P({type:Object,required:!0})],Ur.prototype,"printerObject",2);Wa([P({type:String,required:!0})],Ur.prototype,"objectName",2);Wa([P({type:String,required:!0})],Ur.prototype,"keyName",2);Wa([P({type:Boolean,required:!1,default:!0})],Ur.prototype,"small",2);Ur=Wa([D],Ur);var GF=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.isVisible?t("div",[t(de,{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()},zF=[];const rv={};var ZF=E(Ur,GF,zF,!1,qF,null,null,null);function qF(e){for(let s in rv)this[s]=rv[s]}const iv=function(){return ZF.exports}();var XF=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(iv,{attrs:{"printer-object":e.printerObject,small:!1,"object-name":"nevermore","key-name":"gas"}}),e._l(e.nevermoreValues,function(r){return t(iv,{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(wC,{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)},YF=[];const nv={};var JF=E(xl,XF,YF,!1,KF,"2263111c",null,null);function KF(e){for(let s in nv)this[s]=nv[s]}const SC=function(){return JF.exports}();var QF=Object.defineProperty,e7=Object.getOwnPropertyDescriptor,t7=(e,s,t,r)=>{for(var i=r>1?void 0:r?e7(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&&QF(s,t,i),i};let Mm=class extends M(O){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}};Mm=t7([D({components:{TemperaturePanelListItemNevermore:SC}})],Mm);var s7=Object.defineProperty,r7=Object.getOwnPropertyDescriptor,ef=(e,s,t,r)=>{for(var i=r>1?void 0:r?r7(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&&s7(s,t,i),i};let ia=class extends M(O){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 at(this.name)}get icon(){var e;return this.objectName.startsWith("extruder")?(e=this.printerObject.can_extrude)!=null&&e?Ws:Ky:this.objectName==="heater_bed"?this.temperature!==null&&this.temperature>50||this.target&&this.temperature&&this.temperature>this.target-5?i3:e2:this.objectName.startsWith("heater_generic")?Qi:this.objectName.startsWith("tmc")?Wy:this.isFan?yp:a2}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(_y):"".concat(this.color).concat(by)}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=HD.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":""}};ef([P({type:String,required:!0})],ia.prototype,"objectName",2);ef([P({type:Boolean,required:!0})],ia.prototype,"isResponsiveMobile",2);ia=ef([D],ia);var i7=Object.defineProperty,n7=Object.getOwnPropertyDescriptor,tf=(e,s,t,r)=>{for(var i=r>1?void 0:r?n7(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&&i7(s,t,i),i};let na=class extends M(O){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")}};tf([P({type:String,required:!0})],na.prototype,"objectName",2);tf([P({type:String,required:!0})],na.prototype,"additionalObjectName",2);na=tf([D],na);var a7=Object.defineProperty,o7=Object.getOwnPropertyDescriptor,Cu=(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&&a7(s,t,i),i};let Oi=class extends M(O){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}};Cu([P({type:Object,required:!0})],Oi.prototype,"printerObject",2);Cu([P({type:String,required:!0})],Oi.prototype,"objectName",2);Cu([P({type:String,required:!0})],Oi.prototype,"keyName",2);Oi=Cu([D],Oi);var l7=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()},c7=[];const av={};var u7=E(Oi,l7,c7,!1,d7,null,null,null);function d7(e){for(let s in av)this[s]=av[s]}const m7=function(){return u7.exports}();var h7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",e._l(e.additionalValues,function(r){return t(m7,{key:r,attrs:{"printer-object":e.printerObject,"object-name":e.objectName,"key-name":r}})}),1)},p7=[];const ov={};var f7=E(na,h7,p7,!1,g7,null,null,null);function g7(e){for(let s in ov)this[s]=ov[s]}const v7=function(){return f7.exports}();var _7=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(de,{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(de,{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(v7,{attrs:{"object-name":e.objectName,"additional-object-name":e.additionalSensorName}}):e._e()],1),t("td",{staticClass:"target"},[e.command!==null?t(vC,{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(wC,{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)},b7=[];const lv={};var y7=E(ia,_7,b7,!1,C7,"8977b3c0",null,null);function C7(e){for(let s in lv)this[s]=lv[s]}const pd=function(){return y7.exports}();var $7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(et,{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(pd,{key:a,attrs:{"object-name":a,"is-responsive-mobile":(o=n.is.mobile)!==null&&o!==void 0?o:!1}})}),e.existsNevermoreFilter?t(SC,{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(pd,{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(pd,{key:a,attrs:{"object-name":a,"is-responsive-mobile":(o=n.is.mobile)!==null&&o!==void 0?o:!1}})})],2)])]}}])})},x7=[];const cv={};var w7=E(Mm,$7,x7,!1,S7,"080ca807",null,null);function S7(e){for(let s in cv)this[s]=cv[s]}const P7=function(){return w7.exports}();var D7=Object.defineProperty,T7=Object.getOwnPropertyDescriptor,M7=(e,s,t,r)=>{for(var i=r>1?void 0:r?T7(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&&D7(s,t,i),i};let Em=class extends M(O){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})}};Em=M7([D],Em);var E7=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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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)},O7=[];const uv={};var L7=E(Em,E7,O7,!1,A7,null,null,null);function A7(e){for(let s in uv)this[s]=uv[s]}const k7=function(){return L7.exports}();var F7=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.klipperReadyForGui?t(B,{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(yC),t(k7)]},proxy:!0}],null,!1,3208382191)},[t(q,{staticClass:"pa-0"},[t(P7),e.boolTempchart?[t(U,{staticClass:"my-0"}),t(gC)]:e._e()],2)],1):e._e()},R7=[];const dv={};var j7=E(Tm,F7,R7,!1,H7,null,null,null);function H7(e){for(let s in dv)this[s]=dv[s]}const I7=function(){return j7.exports}();var N7=Object.defineProperty,V7=Object.getOwnPropertyDescriptor,U7=(e,s,t,r)=>{for(var i=r>1?void 0:r?V7(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&&N7(s,t,i),i};let dr=class extends M(O){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 KD;case"mdiCampfire":return oT;case"mdiDoor":return wT;case"mdiRadiatorDisabled":return e2;case"mdiPrinter3d":return Ha;case"mdiPrinter3dNozzle":return Ws;case"mdiRaspberryPi":return n3;default:return sn}}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"}};dr=U7([D],dr);var B7=Object.defineProperty,W7=Object.getOwnPropertyDescriptor,PC=(e,s,t,r)=>{for(var i=r>1?void 0:r?W7(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&&B7(s,t,i),i};let wl=class extends M(O,dr){constructor(){super(...arguments),this.mdiWebcam=sn,this.mdiMenuDown=fr,this.mdiViewGrid=$g}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:$g}}};PC([P({default:"dashboard"})],wl.prototype,"currentPage",2);wl=PC([D({components:{Panel:B}})],wl);function G7(e){switch(e){case"Hlsstreamer":return()=>fe(()=>import("./Hlsstreamer-d1b15932.js"),["assets/Hlsstreamer-d1b15932.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/Hlsstreamer-f9f189cf.css"]);case"Ipstreamer":return()=>fe(()=>import("./Ipstreamer-d64872ad.js"),["assets/Ipstreamer-d64872ad.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/Ipstreamer-f951d43b.css"]);case"JanusStreamer":return()=>fe(()=>import("./JanusStreamer-caeac552.js"),["assets/JanusStreamer-caeac552.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/JanusStreamer-3206d816.css"]);case"JMuxerStream":return()=>fe(()=>import("./JMuxerStream-8716a630.js"),["assets/JMuxerStream-8716a630.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/echarts-ff51454d.js","assets/JMuxerStream-baf633f9.css"]);case"Mjpegstreamer":return()=>fe(()=>import("./Mjpegstreamer-181c3267.js"),["assets/Mjpegstreamer-181c3267.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/Mjpegstreamer-7069622c.css"]);case"MjpegstreamerAdaptive":return()=>fe(()=>import("./MjpegstreamerAdaptive-4819ecfb.js"),["assets/MjpegstreamerAdaptive-4819ecfb.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/MjpegstreamerAdaptive-edd84448.css"]);case"Uv4lMjpeg":return()=>fe(()=>import("./Uv4lMjpeg-63b5ce35.js"),["assets/Uv4lMjpeg-63b5ce35.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/Uv4lMjpeg-486d8a68.css"]);case"WebrtcCameraStreamer":return()=>fe(()=>import("./WebrtcCameraStreamer-8d1cc452.js"),["assets/WebrtcCameraStreamer-8d1cc452.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/WebrtcCameraStreamer-7e0e004c.css"]);case"WebrtcMediaMTX":return()=>fe(()=>import("./WebrtcMediaMTX-2862afdc.js"),["assets/WebrtcMediaMTX-2862afdc.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/WebrtcMediaMTX-caefdcd6.css"]);case"WebrtcGo2rtc":return()=>fe(()=>import("./WebrtcGo2rtc-b685b8ad.js"),["assets/WebrtcGo2rtc-b685b8ad.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/WebrtcGo2rtc-4ca7d296.css"])}}const gs=e=>y.component(e,G7(e));var z7=Object.defineProperty,Z7=Object.getOwnPropertyDescriptor,$u=(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&&z7(s,t,i),i};let Li=class extends M(O){get service(){var e,s;return(s=(e=this.webcam)==null?void 0:e.service)!=null?s:"unknown"}};$u([P({type:Object,required:!0})],Li.prototype,"webcam",2);$u([P({type:Boolean,default:!0})],Li.prototype,"showFps",2);$u([P({default:null})],Li.prototype,"printerUrl",2);Li=$u([D({components:{HlsstreamerAsync:gs("Hlsstreamer"),IpstreamerAsync:gs("Ipstreamer"),JanusStreamerAsync:gs("JanusStreamer"),JMuxerStreamAsync:gs("JMuxerStream"),MjpegstreamerAsync:gs("Mjpegstreamer"),MjpegstreamerAdaptiveAsync:gs("MjpegstreamerAdaptive"),Uv4lMjpegAsync:gs("Uv4lMjpeg"),WebrtcCameraStreamerAsync:gs("WebrtcCameraStreamer"),WebrtcMediaMTXAsync:gs("WebrtcMediaMTX"),WebrtcGo2rtcAsync:gs("WebrtcGo2rtc")}})],Li);var q7=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)},X7=[];const mv={};var Y7=E(Li,q7,X7,!1,J7,null,null,null);function J7(e){for(let s in mv)this[s]=mv[s]}const Om=function(){return Y7.exports}();var K7=Object.defineProperty,Q7=Object.getOwnPropertyDescriptor,xu=(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 Ai=class extends M(O){get webcams(){return this.$store.getters["gui/webcams/getWebcams"]}};xu([P({type:Object,required:!0})],Ai.prototype,"webcam",2);xu([P({type:Boolean,default:!0})],Ai.prototype,"showFps",2);xu([P({type:String,default:null})],Ai.prototype,"printerUrl",2);Ai=xu([D({components:{WebcamWrapperItem:Om}})],Ai);var e8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.webcam.service==="grid"?[e.webcams?t(Ae,{staticClass:"pb-4",attrs:{fluid:""}},[t($,{attrs:{dense:""}},e._l(e.webcams,function(r){return t(_,{key:r.name,attrs:{cols:"6"}},[t(Om,{attrs:{webcam:r,"printer-url":e.printerUrl,"show-fps":e.showFps}})],1)}),1)],1):e._e()]:[t(Om,{attrs:{webcam:e.webcam,"printer-url":e.printerUrl,"show-fps":e.showFps}})]],2)},t8=[];const hv={};var s8=E(Ai,e8,t8,!1,r8,null,null,null);function r8(e){for(let s in hv)this[s]=hv[s]}const wu=function(){return s8.exports}();var i8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.socketIsConnected?t(B,{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(J,{attrs:{link:""},on:{click:function(r){e.currentCamId="all"}}},[t(Is,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiViewGrid))])],1),t(vt,[t(Ge,[e._v(e._s(e.$t("Panels.WebcamPanel.All")))])],1)],1),e._l(e.webcams,function(r){return t(J,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamId=r.name}}},[t(Is,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(vt,[t(Ge,{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($,[t(_,{staticClass:"pb-0",staticStyle:{position:"relative"}},[t(wu,{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()},n8=[];const pv={};var a8=E(wl,i8,n8,!1,o8,null,null,null);function o8(e){for(let s in pv)this[s]=pv[s]}const sf=function(){return a8.exports}();var l8=Object.defineProperty,c8=Object.getOwnPropertyDescriptor,u8=(e,s,t,r)=>{for(var i=r>1?void 0:r?c8(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&&l8(s,t,i),i};let Lm=class extends M(Ns){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}};Lm=u8([D({components:{ExtruderControlPanel:SE,KlippyStatePanel:Na,MachineSettingsPanel:dO,MacrogroupPanel:_O,MacrosPanel:PO,MiniconsolePanel:JO,MinSettingsPanel:Ip,MiscellaneousPanel:L6,SpoolmanPanel:gL,StatusPanel:Tn,ToolheadControlPanel:Gk,TemperaturePanel:I7,WebcamPanel:sf}})],Lm);var d8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.isMobile?t($,[t(_,[t(Tn),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($,[t(_,{staticClass:"col-6"},[t(Tn),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($,[t(_,{staticClass:"col-5"},[t(Tn),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($,[t(_,{staticClass:"col-3"},[t(Tn),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)},m8=[];const fv={};var h8=E(Lm,d8,m8,!1,p8,null,null,null);function p8(e){for(let s in fv)this[s]=fv[s]}const f8=function(){return h8.exports}();var g8=Object.defineProperty,v8=Object.getOwnPropertyDescriptor,_8=(e,s,t,r)=>{for(var i=r>1?void 0:r?v8(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&&g8(s,t,i),i};let Am=class extends M(O){};Am=_8([D({components:{WebcamPanel:sf}})],Am);var b8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,[t(_,{attrs:{"col-12":""}},[t(sf,{attrs:{"current-page":"page"}})],1)],1)],1)},y8=[];const gv={};var C8=E(Am,b8,y8,!1,$8,null,null,null);function $8(e){for(let s in gv)this[s]=gv[s]}const x8=function(){return C8.exports}();var w8=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,Su=(e,s,t,r)=>{for(var i=r>1?void 0:r?S8(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&&w8(s,t,i),i};let ki=class extends M(O,_t,dr){constructor(){super(...arguments),this.mdiPrinter3d=Ha,this.mdiWebcam=sn,this.mdiMenuDown=fr,this.mdiWebcamOff=$3,this.mdiFileOutline=ky,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(){if(this.printer.socket.isConnected){this.$store.dispatch("changePrinter",{printer:this.printer._namespace});return}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()})}};Su([P({type:Object,required:!0})],ki.prototype,"printer",2);Su([fy()],ki.prototype,"imageDiv",2);Su([qe(200)],ki.prototype,"handleResize",1);ki=Su([D({components:{Panel:B,"webcam-wrapper":wu,"mainsail-logo":rn}})],ki);var P8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{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(J,{attrs:{link:""},on:{click:function(r){e.currentCamName="off"}}},[t(Is,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiWebcamOff))])],1),t(vt,[t(Ge,[e._v(e._s(e.$t("Panels.FarmPrinterPanel.WebcamOff")))])],1)],1),e._l(e.printer_webcams,function(r){return t(J,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamName=r.name}}},[t(Is,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(vt,[t(Ge,{domProps:{textContent:e._s(r.name)}})],1)],1)})],2)],1):e._e()]},proxy:!0}])},[t(yP,{scopedSlots:e._u([{key:"default",fn:function(r){var i=r.hover;return[t("div",[t(Fc,{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(wu,{attrs:{webcam:e.currentWebcam,"printer-url":e.printerUrl,"show-fps":!1}})],1):e._e(),t(gt,{staticClass:"white--text py-2",staticStyle:{"background-color":"rgba(0, 0, 0, 0.3)","backdrop-filter":"blur(3px)"}},[t($,[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(rn,{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(Ae,{staticClass:"py-0"},[t($,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(CP,[i?t($P,{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)},D8=[];const vv={};var T8=E(ki,P8,D8,!1,M8,"69438451",null,null);function M8(e){for(let s in vv)this[s]=vv[s]}const DC=function(){return T8.exports}();var E8=Object.defineProperty,O8=Object.getOwnPropertyDescriptor,L8=(e,s,t,r)=>{for(var i=r>1?void 0:r?O8(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&&E8(s,t,i),i};let km=class extends M(O){get printers(){return this.$store.getters["farm/getPrinters"]}};km=L8([D({components:{FarmPrinterPanel:DC}})],km);var A8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,e._l(e.printers,function(r,i){return t(_,{key:i,staticClass:"col-12 col-sm-6 col-md-4 pb-0"},[t(DC,{attrs:{printer:r}})],1)}),1)},k8=[];const _v={};var F8=E(km,A8,k8,!1,R8,null,null,null);function R8(e){for(let s in _v)this[s]=_v[s]}const j8=function(){return F8.exports}();var H8=Object.defineProperty,I8=Object.getOwnPropertyDescriptor,rf=(e,s,t,r)=>{for(var i=r>1?void 0:r?I8(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&&H8(s,t,i),i};let aa=class extends M(O){constructor(){super(...arguments),this.gcode="",this.lastCommandNumber=null,this.items=[],this.mdiChevronDoubleRight=Ty,this.mdiSend=t2,this.mdiCog=us,this.mdiTrashCan=u2}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)=>rl(u,d.command),c[0].command)):this.gcode=c.reduce((u,d)=>rl(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%"})}})}};rf([me("events")],aa.prototype,"eventsChanged",1);rf([me("autoscroll")],aa.prototype,"autoscrollChanged",1);aa=rf([D({components:{CommandHelpModal:nu,ConsoleTable:ru}})],aa);var N8=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"d-flex flex-column"},[t($,{class:e.consoleDirection==="table"?"order-0":"order-1 mt-3"},[t(_,[t(Bs,{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(nu,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{staticClass:"minHeight36"},[t(_e,{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(J,{key:i,staticClass:"minHeight36"},[t(_e,{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($,{class:e.consoleDirection==="table"?"order-1":"order-0 mt-0"},[t(_,{class:e.consoleDirection==="table"?"col":"col pt-0"},[t(xe,[t(q,{staticClass:"pa-0"},[t("overlay-scrollbars",{ref:"consoleScroll",staticClass:"consoleScrollContainer d-flex flex-column"},[t(ru,{ref:"console",attrs:{"is-mini":!1,events:e.events},on:{"command-click":e.commandClick}})],1)],1)],1)],1)],1)],1)},V8=[];const bv={};var U8=E(aa,N8,V8,!1,B8,"92532d3e",null,null);function B8(e){for(let s in bv)this[s]=bv[s]}const W8=function(){return U8.exports}();var TC={exports:{}};/**! + * Sortable 1.10.2 + * @author RubaXa + * @author owenm + * @license MIT + */function So(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?So=function(s){return typeof s}:So=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},So(e)}function G8(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Yt(){return Yt=Object.assign||function(e){for(var s=1;s=0)&&(t[i]=e[i]);return t}function Z8(e,s){if(e==null)return{};var t=z8(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 q8(e){return X8(e)||Y8(e)||J8()}function X8(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 eR(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ss(e,s,t,r){if(e){t=t||document;do{if(s!=null&&(s[0]===">"?e.parentNode===t&&Sl(e,s):Sl(e,s))||r&&e===t)return e;if(e===t)break}while(e=eR(e))}return null}var Cv=/\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(Cv," ").replace(" "+s+" "," ");e.className=(r+(t?" "+s:"")).replace(Cv," ")}}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 Lr(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 OC(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===$s())break;r=er(r,!1)}return!1}function Pl(e,s,t){for(var r=0,i=0,n=e.children;i2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,n=Z8(r,["evt"]);za.pluginEvent.bind(ge)(s,t,mr({dragEl:ie,parentEl:Xe,ghostEl:Ce,rootEl:Ie,nextEl:xr,lastDownEl:Po,cloneEl:Ue,cloneHidden:Js,dragStarted:En,putSortable:ut,activeSortable:ge.active,originalEvent:i,oldIndex:di,oldDraggableIndex:Rn,newIndex:It,newDraggableIndex:Ys,hideGhostForTarget:jC,unhideGhostForTarget:HC,cloneNowHidden:function(){Js=!0},cloneNowShown:function(){Js=!1},dispatchSortableEvent:function(o){yt({sortable:t,name:o,originalEvent:i})}},n))};function yt(e){Mn(mr({putSortable:ut,cloneEl:Ue,targetEl:ie,rootEl:Ie,oldIndex:di,oldDraggableIndex:Rn,newIndex:It,newDraggableIndex:Ys},e))}var ie,Xe,Ce,Ie,xr,Po,Ue,Js,di,It,Rn,Ys,oo,ut,ci=!1,Dl=!1,Tl=[],yr,Kt,_d,bd,Sv,Pv,En,ri,jn,Hn=!1,lo=!1,Do,pt,yd=[],Rm=!1,Ml=[],Pu=typeof document<"u",co=MC,Dv=Ga||Zs?"cssFloat":"float",oR=Pu&&!Q8&&!MC&&"draggable"in document.createElement("div"),kC=function(){if(Pu){if(Zs)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),FC=function(s,t){var r=ue(s),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),n=Pl(s,0,t),a=Pl(s,1,t),o=n&&ue(n),l=a&&ue(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+We(n).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+We(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[Dv]==="none"||a&&r[Dv]==="none"&&c+u>i)?"vertical":"horizontal"},lR=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},cR=function(s,t){var r;return Tl.some(function(i){if(!nf(i)){var n=We(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},RC=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 m=(a?o:l).options.group.name;return n===!0||typeof n=="string"&&n===m||n.join&&n.indexOf(m)>-1}}var r={},i=s.group;(!i||So(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},jC=function(){!kC&&Ce&&ue(Ce,"display","none")},HC=function(){!kC&&Ce&&ue(Ce,"display","")};Pu&&document.addEventListener("click",function(e){if(Dl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Dl=!1,!1},!0);var Cr=function(s){if(ie){s=s.touches?s.touches[0]:s;var t=cR(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)}}},uR=function(s){ie&&ie.parentNode[ft]._isOutsideThisEl(s.target)};function ge(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=Yt({},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 FC(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:ge.supportPointer!==!1&&"PointerEvent"in window,emptyInsertThreshold:5};za.initializePlugins(this,e,t);for(var r in t)!(r in s)&&(s[r]=t[r]);RC(s);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=s.forceFallback?!1:oR,this.nativeDraggable&&(this.options.touchStartThreshold=1),s.supportPointer?Te(e,"pointerdown",this._onTapStart):(Te(e,"mousedown",this._onTapStart),Te(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Te(e,"dragover",this),Te(e,"dragenter",this)),Tl.push(this.el),s.store&&s.store.get&&this.sort(s.store.get(this)||[]),Yt(this,iR())}ge.prototype={constructor:ge,_isOutsideThisEl:function(s){!this.el.contains(s)&&s!==this.el&&(ri=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(vR(r),!ie&&!(/mousedown|pointerdown/.test(a)&&s.button!==0||i.disabled)&&!c.isContentEditable&&(l=ss(l,i.draggable,r,!1),!(l&&l.animated)&&Po!==l)){if(di=Be(l),Rn=Be(l,i.draggable),typeof u=="function"){if(u.call(this,s,l,this)){yt({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=ss(c,d.trim(),r,!1),d)return yt({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&&!ss(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=We(r);if(Ie=n,ie=r,Xe=ie.parentNode,xr=ie.nextSibling,Po=r,oo=a.group,ge.dragged=ie,yr={target:ie,clientX:(t||s).clientX,clientY:(t||s).clientY},Sv=yr.clientX-c.left,Pv=yr.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}),ge.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!yv&&i.nativeDraggable&&(ie.draggable=!0),i._triggerDragStart(s,t),yt({sortable:i,name:"choose",originalEvent:s}),Ne(ie,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){OC(ie,u.trim(),$d)}),Te(o,"dragover",Cr),Te(o,"mousemove",Cr),Te(o,"touchmove",Cr),Te(o,"mouseup",i._onDrop),Te(o,"touchend",i._onDrop),Te(o,"touchcancel",i._onDrop),yv&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ie.draggable=!0),Mt("delayStart",this,{evt:s}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ga||Zs))){if(ge.eventCanceled){this._onDrop();return}Te(o,"mouseup",i._disableDelayedDrag),Te(o,"touchend",i._disableDelayedDrag),Te(o,"touchcancel",i._disableDelayedDrag),Te(o,"mousemove",i._delayedDragTouchMoveHandler),Te(o,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Te(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&&$d(ie),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var s=this.el.ownerDocument;Se(s,"mouseup",this._disableDelayedDrag),Se(s,"touchend",this._disableDelayedDrag),Se(s,"touchcancel",this._disableDelayedDrag),Se(s,"mousemove",this._delayedDragTouchMoveHandler),Se(s,"touchmove",this._delayedDragTouchMoveHandler),Se(s,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(s,t){t=t||s.pointerType=="touch"&&s,!this.nativeDraggable||t?this.options.supportPointer?Te(document,"pointermove",this._onTouchMove):t?Te(document,"touchmove",this._onTouchMove):Te(document,"mousemove",this._onTouchMove):(Te(ie,"dragend",this),Te(Ie,"dragstart",this._onDragStart));try{document.selection?To(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(s,t){if(ci=!1,Ie&&ie){Mt("dragStarted",this,{evt:t}),this.nativeDraggable&&Te(document,"dragover",uR);var r=this.options;!s&&Ne(ie,r.dragClass,!1),Ne(ie,r.ghostClass,!0),ge.active=this,s&&this._appendGhost(),yt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Kt){this._lastX=Kt.clientX,this._lastY=Kt.clientY,jC();for(var s=document.elementFromPoint(Kt.clientX,Kt.clientY),t=s;s&&s.shadowRoot&&(s=s.shadowRoot.elementFromPoint(Kt.clientX,Kt.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:Kt.clientX,clientY:Kt.clientY,target:s,rootEl:t}),r&&!this.options.dragoverBubble)break}s=t}while(t=t.parentNode);HC()}},_onTouchMove:function(s){if(yr){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,n=s.touches?s.touches[0]:s,a=Ce&&Lr(Ce,!0),o=Ce&&a&&a.a,l=Ce&&a&&a.d,c=co&&pt&&xv(pt),u=(n.clientX-yr.clientX+i.x)/(o||1)+(c?c[0]-yd[0]:0)/(o||1),d=(n.clientY-yr.clientY+i.y)/(l||1)+(c?c[1]-yd[1]:0)/(l||1);if(!ge.active&&!ci){if(r&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))=0&&(yt({rootEl:Xe,name:"add",toEl:Xe,fromEl:Ie,originalEvent:s}),yt({sortable:this,name:"remove",toEl:Xe,originalEvent:s}),yt({rootEl:Xe,name:"sort",toEl:Xe,fromEl:Ie,originalEvent:s}),yt({sortable:this,name:"sort",toEl:Xe,originalEvent:s})),ut&&ut.save()):It!==di&&It>=0&&(yt({sortable:this,name:"update",toEl:Xe,originalEvent:s}),yt({sortable:this,name:"sort",toEl:Xe,originalEvent:s})),ge.active&&((It==null||It===-1)&&(It=di,Ys=Rn),yt({sortable:this,name:"end",toEl:Xe,originalEvent:s}),this.save()))),this._nulling()},_nulling:function(){Mt("nulling",this),Ie=ie=Xe=Ce=xr=Ue=Po=Js=yr=Kt=En=It=Ys=di=Rn=ri=jn=ut=oo=ge.dragged=ge.ghost=ge.clone=ge.active=null,Ml.forEach(function(s){s.checked=!0}),Ml.length=_d=bd=0},handleEvent:function(s){switch(s.type){case"drop":case"dragend":this._onDrop(s);break;case"dragenter":case"dragover":ie&&(this._onDragOver(s),dR(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 pR(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,m=!1;if(!a){if(o&&Dou+c*n/2:ld-Do)return-jn}else if(l>u+c*(1-i)/2&&ld-c*n/2)?l>u+c/2?1:-1:0}function fR(e){return Be(ie)1&&(ye.forEach(function(o){n.addAnimationState({target:o,rect:Rt?We(o):a}),gd(o),o.fromRect=a,r.removeAnimationState(o)}),Rt=!1,$R(!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(),vn=!1,c.animation&&ye.length>1&&(Rt||!i&&!a.options.sort&&!l)){var u=We(Re,!1,!0,!0);ye.forEach(function(m){m!==Re&&(wv(m,u),o.appendChild(m))}),Rt=!0}if(!i)if(Rt||mo(),ye.length>1){var d=uo;a._showClone(r),a.options.animation&&!uo&&d&&Ht.forEach(function(m){a.addAnimationState({target:m,rect:_n}),m.fromRect=_n,m.thisAnimationDuration=null})}else a._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,n=t.activeSortable;if(ye.forEach(function(o){o.thisAnimationDuration=null}),n.options.animation&&!i&&n.multiDrag.isMultiDrag){_n=Yt({},r);var a=Lr(Re,!0);_n.top-=a.f,_n.left-=a.e}},dragOverAnimationComplete:function(){Rt&&(Rt=!1,mo())},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,m=n.children;if(!ii)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Ne(Re,d.selectedClass,!~ye.indexOf(Re)),~ye.indexOf(Re))ye.splice(ye.indexOf(Re),1),gn=null,Mn({sortable:a,rootEl:i,name:"deselect",targetEl:Re,originalEvt:r});else{if(ye.push(Re),Mn({sortable:a,rootEl:i,name:"select",targetEl:Re,originalEvt:r}),r.shiftKey&&gn&&a.el.contains(gn)){var h=Be(gn),p=Be(Re);if(~h&&~p&&h!==p){var f,b;for(p>h?(b=h,f=p):(b=p,f=h+1);b1){var C=We(Re),S=Be(Re,":not(."+this.options.selectedClass+")");if(!vn&&d.animation&&(Re.thisAnimationDuration=null),u.captureAnimationState(),!vn&&(d.animation&&(Re.fromRect=C,ye.forEach(function(N){if(N.thisAnimationDuration=null,N!==Re){var R=Rt?We(N):C;N.fromRect=R,u.addAnimationState({target:N,rect:R})}})),mo(),ye.forEach(function(N){m[S]?n.insertBefore(N,m[S]):n.appendChild(N),S++}),l===Be(Re))){var L=!1;ye.forEach(function(N){if(N.sortableIndex!==Be(N)){L=!0;return}}),L&&o("update")}ye.forEach(function(N){gd(N)}),u.animateAll()}Qt=u}(i===n||c&&c.lastPutMode!=="clone")&&Ht.forEach(function(N){N.parentNode&&N.parentNode.removeChild(N)})}},nullingGlobal:function(){this.isMultiDrag=ii=!1,Ht.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Se(document,"pointerup",this._deselectMultiDrag),Se(document,"mouseup",this._deselectMultiDrag),Se(document,"touchend",this._deselectMultiDrag),Se(document,"keydown",this._checkKeyDown),Se(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof ii<"u"&&ii)&&Qt===this.sortable&&!(t&&ss(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;ye.length;){var r=ye[0];Ne(r,this.options.selectedClass,!1),ye.shift(),Mn({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)}},Yt(e,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[ft];!r||!r.options.multiDrag||~ye.indexOf(t)||(Qt&&Qt!==r&&(Qt.multiDrag._deselectMultiDrag(),Qt=r),Ne(t,r.options.selectedClass,!0),ye.push(t))},deselect:function(t){var r=t.parentNode[ft],i=ye.indexOf(t);!r||!r.options.multiDrag||!~i||(Ne(t,r.options.selectedClass,!1),ye.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return ye.forEach(function(n){r.push({multiDragElement:n,index:n.sortableIndex});var a;Rt&&n!==Re?a=-1:Rt?a=Be(n,":not(."+t.options.selectedClass+")"):a=Be(n),i.push({multiDragElement:n,index:a})}),{items:q8(ye),clones:[].concat(Ht),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 $R(e,s){ye.forEach(function(t,r){var i=s.children[t.sortableIndex+(e?Number(r):0)];i?s.insertBefore(t,i):s.appendChild(t)})}function Mv(e,s){Ht.forEach(function(t,r){var i=s.children[t.sortableIndex+(e?Number(r):0)];i?s.insertBefore(t,i):s.appendChild(t)})}function mo(){ye.forEach(function(e){e!==Re&&e.parentNode&&e.parentNode.removeChild(e)})}ge.mount(new _R);ge.mount(lf,of);const xR=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:CR,Sortable:ge,Swap:bR,default:ge},Symbol.toStringTag,{value:"Module"})),wR=mp(xR);(function(e,s){(function(r,i){e.exports=i(wR)})(typeof self<"u"?self:Dr,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"),m=n("7f20"),h=n("38fd"),p=n("2b4c")("iterator"),f=!([].keys&&"next"in[].keys()),b="@@iterator",C="keys",S="values",L=function(){return this};r.exports=function(N,R,x,T,I,j,W){d(x,R,T);var Z=function(H){if(!f&&H in X)return X[H];switch(H){case C:return function(){return new x(this,H)};case S:return function(){return new x(this,H)}}return function(){return new x(this,H)}},re=R+" Iterator",k=I==S,G=!1,X=N.prototype,Y=X[p]||X[b]||I&&X[I],ee=Y||Z(I),se=I?k?Z("entries"):ee:void 0,F=R=="Array"&&X.entries||Y,z,w,A;if(F&&(A=h(F.call(new N)),A!==Object.prototype&&A.next&&(m(A,re,!0),!a&&typeof A[p]!="function"&&c(A,p,L))),k&&Y&&Y.name!==S&&(G=!0,ee=function(){return Y.call(this)}),(!a||W)&&(f||G||!X[p])&&c(X,p,ee),u[R]=ee,u[re]=L,I)if(z={values:k?ee:Z(S),keys:j?ee:Z(C),entries:se},W)for(w in z)w in X||l(X,w,z[w]);else o(o.P+o.F*(f||G),R,z);return z}},"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)),m=a(u),h=d.length,p,f;return m<0||m>=h?l?"":void 0:(p=d.charCodeAt(m),p<55296||p>56319||m+1===h||(f=d.charCodeAt(m+1))<56320||f>57343?l?d.charAt(m):p:l?d.slice(m,m+2):(p-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 m=l(d),h=m.length,p=0,f;h>p;)a.f(u,f=m[p++],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"),m=u("species"),h=!l(function(){var f=/./;return f.exec=function(){var b=[];return b.groups={a:"7"},b},"".replace(f,"$")!=="7"}),p=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 S=u(f),L=!l(function(){var j={};return j[S]=function(){return 7},""[f](j)!=7}),N=L?!l(function(){var j=!1,W=/a/;return W.exec=function(){return j=!0,null},f==="split"&&(W.constructor={},W.constructor[m]=function(){return W}),W[S](""),!j}):void 0;if(!L||!N||f==="replace"&&!h||f==="split"&&!p){var R=/./[S],x=C(c,S,""[f],function(W,Z,re,k,G){return Z.exec===d?L&&!G?{done:!0,value:R.call(Z,re,k)}:{done:!0,value:W.call(re,Z,k)}:{done:!1}}),T=x[0],I=x[1];a(String.prototype,f,T),o(RegExp.prototype,S,b==2?function(j,W){return I.call(j,this,W)}:function(j){return I.call(j,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,m,h;return u===void 0?"Undefined":u===null?"Null":typeof(m=c(d=Object(u),o))=="string"?m:l?a(d):(h=a(d))=="Object"&&typeof d.callee=="function"?"Arguments":h}},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",m=(""+u).split(d);n("8378").inspectSource=function(h){return u.call(h)},(r.exports=function(h,p,f,b){var C=typeof f=="function";C&&(l(f,"name")||o(f,"name",p)),h[p]!==f&&(C&&(l(f,c)||o(f,c,h[p]?""+h[p]:m.join(String(p)))),h===a?h[p]=f:b?h[p]?h[p]=f:o(h,p,f):(delete h[p],o(h,p,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",m=function(){var h=n("230e")("iframe"),p=l.length,f="<",b=">",C;for(h.style.display="none",n("fab2").appendChild(h),h.src="javascript:",C=h.contentWindow.document,C.open(),C.write(f+"script"+b+"document.F=Object"+f+"/script"+b),C.close(),m=C.F;p--;)delete m[d][l[p]];return m()};r.exports=Object.create||function(p,f){var b;return p!==null?(u[d]=a(p),b=new u,u[d]=null,b[c]=p):b=m(),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,m){u.prototype=a(c,{next:o(1,m)}),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 p=/a/,f=/b*/g;return o.call(p,"a"),o.call(f,"a"),p[u]!==0||f[u]!==0}(),m=/()??/.exec("")[1]!==void 0,h=d||m;h&&(c=function(f){var b=this,C,S,L,N;return m&&(S=new RegExp("^"+b.source+"$(?!\\s)",a.call(b))),d&&(C=b[u]),L=o.call(b,f),d&&L&&(b[u]=b.global?L.index+L[0].length:C),m&&L&&L.length>1&&l.call(L[0],S,function(){for(N=1;N1?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 m={},h={},p=Symbol(),f="abcdefghijklmnopqrst";return m[p]=7,f.split("").forEach(function(b){h[b]=b}),d({},m)[p]!=7||Object.keys(d({},h)).join("")!=f})?function(h,p){for(var f=c(h),b=arguments.length,C=1,S=o.f,L=l.f;b>C;)for(var N=u(arguments[C++]),R=S?a(N).concat(S(N)):a(N),x=R.length,T=0,I;x>T;)L.call(N,I=R[T++])&&(f[I]=N[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,m,h){if(a(d),m=l(m,!0),a(h),o)try{return c(d,m,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(d[m]=h.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,m){return o.call(l,u,d,m)}}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"),m=Math.max,h=Math.min,p=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,b=/\$([$&`']|\d\d?)/g,C=function(S){return S===void 0?S:String(S)};n("214f")("replace",2,function(S,L,N,R){return[function(I,j){var W=S(this),Z=I==null?void 0:I[L];return Z!==void 0?Z.call(I,W,j):N.call(String(W),I,j)},function(T,I){var j=R(N,T,this,I);if(j.done)return j.value;var W=a(T),Z=String(this),re=typeof I=="function";re||(I=String(I));var k=W.global;if(k){var G=W.unicode;W.lastIndex=0}for(var X=[];;){var Y=d(W,Z);if(Y===null||(X.push(Y),!k))break;var ee=String(Y[0]);ee===""&&(W.lastIndex=u(Z,l(W.lastIndex),G))}for(var se="",F=0,z=0;z=F&&(se+=Z.slice(F,A)+be,F=A+w.length)}return se+Z.slice(F)}];function x(T,I,j,W,Z,re){var k=j+T.length,G=W.length,X=b;return Z!==void 0&&(Z=o(Z),X=f),N.call(re,X,function(Y,ee){var se;switch(ee.charAt(0)){case"$":return"$";case"&":return T;case"`":return I.slice(0,j);case"'":return I.slice(k);case"<":se=Z[ee.slice(1,-1)];break;default:var F=+ee;if(F===0)return Y;if(F>G){var z=p(F/10);return z===0?Y:z<=G?W[z-1]===void 0?ee.charAt(1):W[z-1]+ee.charAt(1):Y}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"),m=n("2b4c"),h=m("iterator"),p=m("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),S=0;Sf;)if(b=h[f++],b!=b)return!0}else for(;p>f;f++)if((c||f in h)&&h[f]===d)return c||f||0;return!c&&-1}}},c649:function(r,i,n){(function(a){n.d(i,"c",function(){return h}),n.d(i,"a",function(){return d}),n.d(i,"b",function(){return l}),n.d(i,"d",function(){return m}),n("a481");function o(){return typeof window<"u"?window.console:a.console}var l=o();function c(p){var f=Object.create(null);return function(C){var S=f[C];return S||(f[C]=p(C))}}var u=/-(\w)/g,d=c(function(p){return p.replace(u,function(f,b){return b?b.toUpperCase():""})});function m(p){p.parentElement!==null&&p.parentElement.removeChild(p)}function h(p,f,b){var C=b===0?p.children[0]:p.children[b-1].nextSibling;p.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,m=this._i++;return!u||m>=u.length?(this._t=void 0,o(1)):d=="keys"?o(0,m):d=="values"?o(0,u[m]):o(0,[m,u[m]])},"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 m=o(u),h=0,p=[],f;for(f in m)f!=c&&a(m,f)&&p.push(f);for(;d.length>h;)a(m,f=d[h++])&&(~l(p,f)||p.push(f));return p}},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(m){var h=l(this,m,c),p=o(Math.min(arguments.length>1?arguments[1]:void 0,h.length)),f=String(m);return u?u.call(h,f,p):h.slice(p,p+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(w){if(Array.isArray(w))return w}function l(w,A){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(w)))){var H=[],K=!0,le=!1,he=void 0;try{for(var be=w[Symbol.iterator](),we;!(K=(we=be.next()).done)&&(H.push(we.value),!(A&&H.length===A));K=!0);}catch(st){le=!0,he=st}finally{try{!K&&be.return!=null&&be.return()}finally{if(le)throw he}}return H}}function c(w,A){(A==null||A>w.length)&&(A=w.length);for(var H=0,K=new Array(A);H=he?le.length:le.indexOf(we)});return H?be.filter(function(we){return we!==-1}):be}function T(w,A){var H=this;this.$nextTick(function(){return H.$emit(w.toLowerCase(),A)})}function I(w){var A=this;return function(H){A.realList!==null&&A["onDrag"+w](H),T.call(A,w,H)}}function j(w){return["transition-group","TransitionGroup"].includes(w)}function W(w){if(!w||w.length!==1)return!1;var A=m(w,1),H=A[0].componentOptions;return H?j(H.tag):!1}function Z(w,A,H){return w[H]||(A[H]?A[H]():void 0)}function re(w,A,H){var K=0,le=0,he=Z(A,H,"header");he&&(K=he.length,w=w?[].concat(b(he),b(w)):b(he));var be=Z(A,H,"footer");return be&&(le=be.length,w=w?[].concat(b(w),b(be)):b(be)),{children:w,headerOffset:K,footerOffset:le}}function k(w,A){var H=null,K=function(Pt,Ft){H=N(H,Pt,Ft)},le=Object.keys(w).filter(function(st){return st==="id"||st.startsWith("data-")}).reduce(function(st,Pt){return st[Pt]=w[Pt],st},{});if(K("attrs",le),!A)return H;var he=A.on,be=A.props,we=A.attrs;return K("on",he),K("props",be),Object.assign(H.attrs,we),H}var G=["Start","Add","Remove","Update","End"],X=["Choose","Unchoose","Sort","Filter","Clone"],Y=["Move"].concat(G,X).map(function(w){return"on"+w}),ee=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(A){return A}},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(A){var H=this.$slots.default;this.transitionMode=W(H);var K=re(H,this.$slots,this.$scopedSlots),le=K.children,he=K.headerOffset,be=K.footerOffset;this.headerOffset=he,this.footerOffset=be;var we=k(this.$attrs,this.componentData);return A(this.getTag(),we,le)},created:function(){this.list!==null&&this.value!==null&&L.b.error("Value and list props are mutually exclusive! Please set one or another."),this.element!=="div"&&L.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&&L.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 A=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 H={};G.forEach(function(he){H["on"+he]=I.call(A,he)}),X.forEach(function(he){H["on"+he]=T.bind(A,he)});var K=Object.keys(this.$attrs).reduce(function(he,be){return he[Object(L.a)(be)]=A.$attrs[be],he},{}),le=Object.assign({},this.options,K,H,{onMove:function(be,we){return A.onDragMove(be,we)}});!("draggable"in le)&&(le.draggable=">*"),this._sortable=new S.a(this.rootContainer,le),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(A){this.updateOptions(A)},deep:!0},$attrs:{handler:function(A){this.updateOptions(A)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var A=this._vnode.fnOptions;return A&&A.functional},getTag:function(){return this.tag||this.element},updateOptions:function(A){for(var H in A){var K=Object(L.a)(H);Y.indexOf(K)===-1&&this._sortable.option(K,A[H])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var A=this.$slots.default;return this.transitionMode?A[0].child.$slots.default:A},computeIndexes:function(){var A=this;this.$nextTick(function(){A.visibleIndexes=x(A.getChildrenNodes(),A.rootContainer.children,A.transitionMode,A.footerOffset)})},getUnderlyingVm:function(A){var H=R(this.getChildrenNodes()||[],A);if(H===-1)return null;var K=this.realList[H];return{index:H,element:K}},getUnderlyingPotencialDraggableComponent:function(A){var H=A.__vue__;return!H||!H.$options||!j(H.$options._componentTag)?!("realList"in H)&&H.$children.length===1&&"realList"in H.$children[0]?H.$children[0]:H:H.$parent},emitChanges:function(A){var H=this;this.$nextTick(function(){H.$emit("change",A)})},alterList:function(A){if(this.list){A(this.list);return}var H=b(this.value);A(H),this.$emit("input",H)},spliceList:function(){var A=arguments,H=function(le){return le.splice.apply(le,b(A))};this.alterList(H)},updatePosition:function(A,H){var K=function(he){return he.splice(H,0,he.splice(A,1)[0])};this.alterList(K)},getRelatedContextFromMoveEvent:function(A){var H=A.to,K=A.related,le=this.getUnderlyingPotencialDraggableComponent(H);if(!le)return{component:le};var he=le.realList,be={list:he,component:le};if(H!==K&&he&&le.getUnderlyingVm){var we=le.getUnderlyingVm(K);if(we)return Object.assign(we,be)}return be},getVmIndex:function(A){var H=this.visibleIndexes,K=H.length;return A>K-1?K:H[A]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(A){if(!(!this.noTransitionOnDrag||!this.transitionMode)){var H=this.getChildrenNodes();H[A].data=null;var K=this.getComponent();K.children=[],K.kept=void 0}},onDragStart:function(A){this.context=this.getUnderlyingVm(A.item),A.item._underlying_vm_=this.clone(this.context.element),ee=A.item},onDragAdd:function(A){var H=A.item._underlying_vm_;if(H!==void 0){Object(L.d)(A.item);var K=this.getVmIndex(A.newIndex);this.spliceList(K,0,H),this.computeIndexes();var le={element:H,newIndex:K};this.emitChanges({added:le})}},onDragRemove:function(A){if(Object(L.c)(this.rootContainer,A.item,A.oldIndex),A.pullMode==="clone"){Object(L.d)(A.clone);return}var H=this.context.index;this.spliceList(H,1);var K={element:this.context.element,oldIndex:H};this.resetTransitionData(H),this.emitChanges({removed:K})},onDragUpdate:function(A){Object(L.d)(A.item),Object(L.c)(A.from,A.item,A.oldIndex);var H=this.context.index,K=this.getVmIndex(A.newIndex);this.updatePosition(H,K);var le={element:this.context.element,oldIndex:H,newIndex:K};this.emitChanges({moved:le})},updateProperty:function(A,H){A.hasOwnProperty(H)&&(A[H]+=this.headerOffset)},computeFutureIndex:function(A,H){if(!A.element)return 0;var K=b(H.to.children).filter(function(we){return we.style.display!=="none"}),le=K.indexOf(H.related),he=A.component.getVmIndex(le),be=K.indexOf(ee)!==-1;return be||!H.willInsertAfter?he:he+1},onDragMove:function(A,H){var K=this.move;if(!K||!this.realList)return!0;var le=this.getRelatedContextFromMoveEvent(A),he=this.context,be=this.computeFutureIndex(le,A);Object.assign(he,{futureIndex:be});var we=Object.assign({},A,{relatedContext:le,draggedContext:he});return K(we,H)},onDragEnd:function(){this.computeIndexes(),ee=null}}};typeof window<"u"&&"Vue"in window&&window.Vue.component("draggable",F);var z=F;i.default=z}}).default})})(TC);var SR=TC.exports;const Yr=Ji(SR);var PR=Object.defineProperty,DR=Object.getOwnPropertyDescriptor,Du=(e,s,t,r)=>{for(var i=r>1?void 0:r?DR(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&&PR(s,t,i),i};let Fi=class extends M(O){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])}};Du([P({default:!1})],Fi.prototype,"path",2);Du([P({default:!1})],Fi.prototype,"baseDirectoryLabel",2);Du([P({default:!1})],Fi.prototype,"onSegmentClick",2);Fi=Du([D],Fi);var TR=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)},MR=[];const Ev={};var ER=E(Fi,TR,MR,!1,OR,"4b5d1549",null,null);function OR(e){for(let s in Ev)this[s]=Ev[s]}const on=function(){return ER.exports}();var LR=Object.defineProperty,AR=Object.getOwnPropertyDescriptor,NC=(e,s,t,r)=>{for(var i=r>1?void 0:r?AR(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&&LR(s,t,i),i};let Ol=class extends M(O,Ke){constructor(){super(...arguments),this.mdiContentCopy=gp,this.mdiFile=pr,this.mdiFileDocumentMultipleOutline=Uc,this.mdiMagnify=zc,this.mdiUpload=y3,this.mdiFolderPlus=$p,this.mdiRefresh=tn,this.mdiCog=us,this.mdiFolderUpload=xp,this.mdiFolder=Cp,this.mdiPlay=en,this.mdiPlaylistPlus=Xc,this.mdiFire=Qi,this.mdiVideo3d=Jc,this.mdiCloudDownload=Gn,this.mdiRenameBox=Yc,this.mdiFileDocumentEditOutline=ja,this.mdiDelete=ze,this.mdiCloseThick=pe,this.mdiCheckboxBlankOutline=hp,this.mdiCheckboxMarked=pp,this.mdiDragVertical=Ra,this.formatFilesize=Je,this.sortFiles=kp,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={isVisible:!1,filename:""},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:qt}get bigThumbnailTooltipColor(){if(qt.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){const s=e.filter(t=>!t.isDirectory&&!t.metadataRequested&&!t.metadataPulled);this.$store.dispatch("files/requestMetadata",s.map(t=>({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){let s=[this.currentPath,e.filename].join("/");s.startsWith("/")&&(s=s.slice(1)),this.dialogAddBatchToQueue.isVisible=!0,this.dialogAddBatchToQueue.filename=s}closeAddBatchToQueueDialog(){this.dialogAddBatchToQueue.isVisible=!1}changeMetadataVisible(e,s){this.$store.dispatch("gui/setGcodefilesMetadata",{name:e,value:s})}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}))}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)return"--";switch(e.outputType){case"filesize":return Je(t);case"date":return this.formatDateTime(t);case"time":return tu(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}}};NC([me("hideMetadataColums")],Ol.prototype,"hideMetadataColumsCanged",1);Ol=NC([D({components:{StartPrintDialog:vu,AddBatchToQueueDialog:an,Panel:B,SettingsRow:V,PathNavigation:on,draggable:Yr}})],Ol);var kR=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(B,{attrs:{title:e.$t("Files.GCodeFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"gcode-files-panel"}},[t(q,[t($,[t(_,{staticClass:"col-12 d-flex align-center"},[t(te,{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(ae),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(J,{staticClass:"minHeight36",attrs:{link:""}},[t($,[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(J,{staticClass:"minHeight36",attrs:{link:""}},[t($,[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(U),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(J,{key:r.value,staticClass:"minHeight36"},[t($,[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($,[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(on,{attrs:{path:e.currentPath,"base-directory-label":"/gcodes","on-segment-click":e.clickPathNavGoToDirectory}})],1),t(ae),e.disk_usage!==null?[t(de,{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(U,{staticClass:"mb-3"}),t(zr,{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(Fr,{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(Fr,{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(de,{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(dt,{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(de,{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(vu,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(ae),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(B,{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(ae),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(B,{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(ae),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(an,{attrs:{"is-visible":e.dialogAddBatchToQueue.isVisible,filename:e.dialogAddBatchToQueue.filename},on:{close:e.closeAddBatchToQueueDialog}})],1)},FR=[];const Ov={};var RR=E(Ol,kR,FR,!1,jR,null,null,null);function jR(e){for(let s in Ov)this[s]=Ov[s]}const VC=function(){return RR.exports}();var HR=Object.defineProperty,IR=Object.getOwnPropertyDescriptor,UC=(e,s,t,r)=>{for(var i=r>1?void 0:r?IR(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&&HR(s,t,i),i};let Ll=class extends M(O){get sums(){const e={filamentLength:0,filamentWeight:0,estimatedTime:0};return this.jobs.forEach(s=>{var r,i,n,a,o,l,c,u;const t=((i=(r=s.combinedIds)==null?void 0:r.length)!=null?i:0)+1;e.filamentLength+=((a=(n=s.metadata)==null?void 0:n.filament_total)!=null?a:0)*t,e.filamentWeight+=((l=(o=s.metadata)==null?void 0:o.filament_weight_total)!=null?l:0)*t,e.estimatedTime+=((u=(c=s.metadata)==null?void 0:c.estimated_time)!=null?u:0)*t}),e}get count(){let e=0;return this.jobs.forEach(s=>{var t,r;e+=((r=(t=s.combinedIds)==null?void 0:t.length)!=null?r:0)+1}),e}get filamentLength(){const e=this.sums.filamentLength;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" m":e.toFixed(0)+" mm"}get filamentWeight(){const e=this.sums.filamentWeight;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" kg":e.toFixed(0)+" g"}get filamentOutput(){const e=[];return this.filamentLength&&e.push(this.filamentLength),this.filamentWeight&&e.push(this.filamentWeight),e.length?e.join(" / "):"--"}get estimatedTime(){let e=this.sums.estimatedTime;if(e==0)return"--";const s=[],t=Math.floor(e/(3600*24));t&&(e%=3600*24,s.push(t+"d"));const r=Math.floor(e/3600);e%=3600,r&&s.push(r+"h");const i=Math.floor(e/60);if(i&&s.push(i+"m"),r>0)return s.join(" ");const n=e%60;return n&&s.push(n.toFixed(0)+"s"),s.join(" ")}get currentPrintEta(){var s,t,r;let e=this.$store.getters["printer/getEstimatedTimeETA"];return e||(this.printerIsPrinting&&((s=this.$store.state.printer.print_stats)==null?void 0:s.print_duration)===0?Date.now()+((r=(t=this.$store.state.printer.current_file)==null?void 0:t.estimated_time)!=null?r:0)*1e3:Date.now())}get eta(){var l;if(this.sums.estimatedTime===0)return"--";let e=this.currentPrintEta+this.sums.estimatedTime*1e3;const s=(l=this.$store.getters["gui/getHours12Format"])!=null?l:!1,t=new Date(e);let r=!0,i=t.getHours();s&&i>11&&(r=!1),s&&i>12&&(i-=12),s&&i==0&&(i+=12),i<10&&(i="0"+i);const n=t.getMinutes()>=10?t.getMinutes():"0"+t.getMinutes(),a=e-new Date().getTime();let o=i+":"+n;return s&&(o+=" ".concat(r?"AM":"PM")),a>60*60*24*1e3&&(o+="+".concat(Math.trunc(a/(60*60*24*1e3)))),o}};UC([P({type:Array,required:!0})],Ll.prototype,"jobs",2);Ll=UC([D],Ll);var NR=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,{staticClass:"jobqueue-entry-sum"},[t(_,{staticClass:"py-2",staticStyle:{"font-size":"0.875em"}},[t("small",[t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.Filament"))+": "+e._s(e.filamentOutput)+",")]),t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.PrintTime"))+": "+e._s(e.estimatedTime)+",")]),t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.ETA"))+": "+e._s(e.eta))])])])],1)},VR=[];const Lv={};var UR=E(Ll,NR,VR,!1,BR,"3fc24e22",null,null);function BR(e){for(let s in Lv)this[s]=Lv[s]}const BC=function(){return UR.exports}();var WR=Object.defineProperty,GR=Object.getOwnPropertyDescriptor,zR=(e,s,t,r)=>{for(var i=r>1?void 0:r?GR(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&&WR(s,t,i),i};let Nm=class extends M(O){constructor(){super(...arguments),this.mdiPlay=en,this.mdiPause=Dp,this.mdiTrayFull=_3,this.joblist=[]}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get queueState(){var e;return(e=this.$store.state.server.jobQueue.queue_state)!=null?e:""}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}pauseJobqueue(){this.$store.dispatch("server/jobQueue/pause")}updateOrder(e){this.$store.dispatch("server/jobQueue/changePosition",{newIndex:e.newIndex,oldIndex:e.oldIndex})}};Nm=zR([D({components:{JobqueueEntrySum:BC,draggable:Yr,JobqueueEntry:fu,Panel:B}})],Nm);var ZR=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{attrs:{icon:e.mdiTrayFull,title:e.$t("JobQueue.JobQueue"),"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(de,{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(de,{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}])},[e.jobs.length?t($,{staticClass:"mx-0 mt-0"},[t(_,[t("draggable",{staticClass:"jobqueue-list mb-3",attrs:{handle:".handle","ghost-class":"ghost",group:"jobs"},on:{end:e.updateOrder},model:{value:e.joblist,callback:function(r){e.joblist=r},expression:"joblist"}},e._l(e.jobs,function(r){return t(fu,{key:r.job_id,attrs:{job:r,"show-handle":!0}})}),1),t(BC,{attrs:{jobs:e.jobs}})],1)],1):t(q,[t("p",[e._v(e._s(e.$t("JobQueue.Empty")))])])],1)},qR=[];const Av={};var XR=E(Nm,ZR,qR,!1,YR,null,null,null);function YR(e){for(let s in Av)this[s]=Av[s]}const WC=function(){return XR.exports}();var JR=Object.defineProperty,KR=Object.getOwnPropertyDescriptor,QR=(e,s,t,r)=>{for(var i=r>1?void 0:r?KR(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&&JR(s,t,i),i};let Vm=class extends M(O){constructor(){super(...arguments),this.mdiLockOutline=Gc}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}};Vm=QR([D({components:{JobqueuePanel:WC,GcodefilesPanel:VC}})],Vm);var ej=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.existGcodesRootDirectory?t($,[t(_,{class:e.showJobQueue?"col-12 col-md-8 pt-0 pt-md-3 order-1 order-md-0":"col-12"},[t(VC)],1),e.showJobQueue?t(_,{staticClass:"col-12 col-md-4 pb-0 pb-sm-3 order-0 order-md-1"},[t(WC)],1):e._e()],1):t($,[t(it,{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)},tj=[];const kv={};var sj=E(Vm,ej,tj,!1,rj,null,null,null);function rj(e){for(let s in kv)this[s]=kv[s]}const ij=function(){return sj.exports}();var nj=Object.defineProperty,aj=Object.getOwnPropertyDescriptor,cf=(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&&nj(s,t,i),i};let oa=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiUpdate=Ia,this.formatFilesize=Je,this.formatPrintTime=tu}get entries(){var t,r,i,n,a,o,l,c,u,d,m,h,p,f,b,C,S,L,N,R,x,T,I,j,W,Z,re,k,G,X,Y,ee,se;let s=[{name:this.$t("History.Filename").toString(),value:this.job.filename,exists:!0},{name:this.$t("History.Filesize").toString(),value:Je((r=(t=this.job.metadata)==null?void 0:t.filesize)!=null?r:0),exists:((n=(i=this.job.metadata)==null?void 0:i.filesize)!=null?n:0)>0},{name:this.$t("History.LastModified").toString(),value:this.formatDateTime(((o=(a=this.job.metadata)==null?void 0:a.modified)!=null?o:0)*1e3),exists:((c=(l=this.job.metadata)==null?void 0:l.modified)!=null?c:0)>0},{name:this.$t("History.Status").toString(),value:this.$te("History.StatusValues.".concat(this.job.status),"en")?this.$t("History.StatusValues.".concat(this.job.status)).toString():this.job.status,exists:!0},{name:this.$t("History.StartTime").toString(),value:this.formatDateTime(this.job.start_time*1e3),exists:!0},{name:this.$t("History.EndTime").toString(),value:this.formatDateTime(this.job.end_time*1e3),exists:this.job.end_time>0},{name:this.$t("History.EstimatedTime").toString(),value:this.formatPrintTime((d=(u=this.job.metadata)==null?void 0:u.estimated_time)!=null?d:0),exists:this.job.metadata&&"estimated_time"in this.job.metadata},{name:this.$t("History.PrintDuration").toString(),value:this.formatPrintTime((m=this.job.print_duration)!=null?m:0),exists:this.job.print_duration>0},{name:this.$t("History.TotalDuration").toString(),value:this.formatPrintTime((h=this.job.total_duration)!=null?h:0),exists:this.job.total_duration>0},{name:this.$t("History.EstimatedFilamentWeight").toString(),value:"".concat(Math.round(((f=(p=this.job.metadata)==null?void 0:p.filament_weight_total)!=null?f:0)*100)/100," g"),exists:this.job.metadata&&"filament_weight_total"in this.job.metadata},{name:this.$t("History.EstimatedFilament").toString(),value:"".concat(Math.round((C=(b=this.job.metadata)==null?void 0:b.filament_total)!=null?C:0)," mm"),exists:this.job.metadata&&"filament_total"in this.job.metadata},{name:this.$t("History.FilamentUsed").toString(),value:"".concat(Math.round((L=(S=this.job.metadata)==null?void 0:S.filament_used)!=null?L:0)," mm"),exists:this.job.metadata&&"filament_used"in this.job.metadata},{name:this.$t("History.FirstLayerExtTemp").toString(),value:"".concat((R=(N=this.job.metadata)==null?void 0:N.first_layer_extr_temp)!=null?R:0," °C"),exists:this.job.metadata&&"first_layer_extr_temp"in this.job.metadata},{name:this.$t("History.FirstLayerBedTemp").toString(),value:"".concat((T=(x=this.job.metadata)==null?void 0:x.first_layer_bed_temp)!=null?T:0," °C"),exists:this.job.metadata&&"first_layer_bed_temp"in this.job.metadata},{name:this.$t("History.FirstLayerHeight").toString(),value:"".concat((j=(I=this.job.metadata)==null?void 0:I.first_layer_height)!=null?j:0," mm"),exists:this.job.metadata&&"first_layer_height"in this.job.metadata},{name:this.$t("History.LayerHeight").toString(),value:"".concat((Z=(W=this.job.metadata)==null?void 0:W.layer_height)!=null?Z:0," mm"),exists:this.job.metadata&&"layer_height"in this.job.metadata},{name:this.$t("History.ObjectHeight").toString(),value:"".concat((k=(re=this.job.metadata)==null?void 0:re.object_height)!=null?k:0," mm"),exists:this.job.metadata&&"object_height"in this.job.metadata},{name:this.$t("History.Slicer").toString(),value:(X=(G=this.job.metadata)==null?void 0:G.slicer)!=null?X:"--",exists:this.job.metadata&&"slicer"in this.job.metadata},{name:this.$t("History.SlicerVersion").toString(),value:(ee=(Y=this.job.metadata)==null?void 0:Y.slicer_version)!=null?ee:"--",exists:this.job.metadata&&"slicer_version"in this.job.metadata}];return"auxiliary_data"in this.job&&((se=this.job.auxiliary_data)==null||se.forEach(F=>{let z=F.value.toString();Array.isArray(F.value)||(z="".concat(Math.round(F.value*1e3)/1e3," ").concat(F.units)),z===""&&(z="--"),s.push({name:F.description,value:z,exists:!0})})),s.filter(F=>F.exists)}closeDialog(){this.$emit("close-dialog")}};cf([P({type:Boolean,required:!0})],oa.prototype,"show",2);cf([P({type:Object,required:!0})],oa.prototype,"job",2);oa=cf([D({components:{Panel:B,SettingsRow:V}})],oa);var oj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(B,{attrs:{title:e.$t("History.JobDetails").toString(),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:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,{staticClass:"pa-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[e._l(e.entries,function(r,i){return[i>0?t(U,{key:"history_detail_entry_divider_"+i,staticClass:"my-3"}):e._e(),t($,{key:"history_detail_entry_"+i},[t(_,[e._v(e._s(r.name))]),t(_,{staticClass:"text-right"},[e._v(e._s(r.value))])],1)]})],2)],1)],1)],1)},lj=[];const Fv={};var cj=E(oa,oj,lj,!1,uj,"fa267930",null,null);function uj(e){for(let s in Fv)this[s]=Fv[s]}const uf=function(){return cj.exports}();var dj=Object.defineProperty,mj=Object.getOwnPropertyDescriptor,Za=(e,s,t,r)=>{for(var i=r>1?void 0:r?mj(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&&dj(s,t,i),i};let Br=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.note=""}get panelTitle(){return this.type==="create"?this.$t("History.CreateNote").toString():this.$t("History.EditNote").toString()}get icon(){return this.type==="create"?Zy:zy}saveNote(){var e;this.$store.dispatch("server/history/saveHistoryNote",{job_id:(e=this.job)==null?void 0:e.job_id,note:this.note}),this.closeDialog()}closeDialog(){this.$emit("close-dialog")}onShowChanged(){var e;this.show&&(this.note=(e=this.job.note)!=null?e:"")}};Za([P({type:Boolean,required:!0})],Br.prototype,"show",2);Za([P({type:String,required:!0})],Br.prototype,"type",2);Za([P({type:Object,required:!0})],Br.prototype,"job",2);Za([me("show",{immediate:!0})],Br.prototype,"onShowChanged",1);Br=Za([D({components:{Panel:B,SettingsRow:V}})],Br);var hj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(B,{attrs:{title:e.panelTitle,icon:e.icon,"card-class":"history-note-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:"pb-0"},[t($,[t(_,[t(Bs,{attrs:{outlined:"","hide-details":"",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1)],1),t(ne,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[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)},pj=[];const Rv={};var fj=E(Br,hj,pj,!1,gj,"e397e32c",null,null);function gj(e){for(let s in Rv)this[s]=Rv[s]}const GC=function(){return fj.exports}();var vj=Object.defineProperty,_j=Object.getOwnPropertyDescriptor,Tu=(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 Ri=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiDelete=ze,this.mdiFile=pr,this.mdiFileCancel=DT,this.mdiNoteEditOutline=zy,this.mdiNotePlusOutline=Zy,this.mdiNoteTextOutline=YT,this.mdiPrinter=Jy,this.mdiTextBoxSearch=i2,this.mdiPlaylistPlus=Xc,this.detailsDialogBool=!1,this.contextMenuBool=!1,this.contextMenuX=0,this.contextMenuY=0,this.noteDialogBool=!1,this.noteDialogType="create",this.addBatchToQueueDialogBool=!1}get smallThumbnail(){var r,i,n,a,o,l;if(((n=(i=(r=this.item.metadata)==null?void 0:r.thumbnails)==null?void 0:i.length)!=null?n:0)<1)return!1;const s=(o=(a=this.item.metadata)==null?void 0:a.thumbnails)==null?void 0:o.find(c=>c.width>=bs&&c.width<=ys&&c.height>=bs&&c.height<=ys);let t="";return this.item.filename.lastIndexOf("/")!==-1&&(t=this.item.filename.substring(0,this.item.filename.lastIndexOf("/"))),((l=s==null?void 0:s.relative_path)!=null?l:null)===null?!1:"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+(s==null?void 0:s.relative_path)),"?timestamp=").concat(this.item.metadata.modified)}get bigThumbnail(){var r,i,n,a,o,l;if(((n=(i=(r=this.item.metadata)==null?void 0:r.thumbnails)==null?void 0:i.length)!=null?n:0)<1)return!1;const s=(o=(a=this.item.metadata)==null?void 0:a.thumbnails)==null?void 0:o.find(c=>c.width>=rr);let t="";return this.item.filename.lastIndexOf("/")!==-1&&(t=this.item.filename.substring(0,this.item.filename.lastIndexOf("/")+1)),((l=s==null?void 0:s.relative_path)!=null?l:null)===null?!1:"".concat(this.apiUrl,"/server/files/gcodes/").concat(encodeURI(t+(s==null?void 0:s.relative_path)),"?timestamp=").concat(this.item.metadata.modified)}get statusIcon(){return this.$store.getters["server/history/getPrintStatusIcon"](this.item.status)}get statusColor(){return this.$store.getters["server/history/getPrintStatusIconColor"](this.item.status)}get statusName(){return this.$t("History.StatusValues.".concat(this.item.status),"en")?this.$t("History.StatusValues.".concat(this.item.status)):this.item.status.replace(/_/g," ")}get cssClasses(){let s=["file-list-cursor","user-select-none"];return this.item.exists||s.push("text--disabled"),s}get isJobQueueAvailable(){return this.moonrakerComponents.includes("job_queue")}select(s){this.$emit("select",s)}showContextMenu(s){s==null||s.preventDefault(),!this.contextMenuBool&&(this.contextMenuBool=!0,this.contextMenuX=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenuY=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.$nextTick(()=>{this.contextMenuBool=!0}))}startPrint(){this.item.exists&&this.$socket.emit("printer.print.start",{filename:this.item.filename},{action:"switchToDashboard"})}createNote(){this.noteDialogType="create",this.noteDialogBool=!0}editNote(){this.noteDialogType="edit",this.noteDialogBool=!0}addToQueue(){this.$store.dispatch("server/jobQueue/addToQueue",[this.item.filename]),this.$toast.info(this.$t("History.AddToQueueSuccessful",{filename:this.item.filename}).toString())}deleteJob(){this.$socket.emit("server.history.delete_job",{uid:this.item.job_id},{action:"server/history/getDeletedJobs"})}outputValue(s,t){var i;let r=s.value in t?t[s.value]:null;if(r===null&&(r=s.value in t.metadata?t.metadata[s.value]:null),s.value.startsWith("history_field_")){const n=s.value.replace("history_field_",""),a=(i=t.auxiliary_data)==null?void 0:i.find(o=>o.name===n);if(a&&!Array.isArray(a.value))return"".concat(Math.round(a.value*1e3)/1e3," ").concat(a.units)}if(r===null)return"--";switch(s.value==="slicer"&&(r+="
"+t.metadata.slicer_version),s.outputType){case"filesize":return Je(r);case"date":return this.formatDateTime(r*1e3);case"time":return tu(r,!1);case"temp":return(r==null?void 0:r.toFixed())+" °C";case"length":return r>1e3?(r/1e3).toFixed(2)+" m":(r==null?void 0:r.toFixed(2))+" mm";default:return r}}};Tu([P({type:Object,required:!0})],Ri.prototype,"item",2);Tu([P({type:Array,required:!0})],Ri.prototype,"tableFields",2);Tu([P({type:Boolean,required:!0})],Ri.prototype,"isSelected",2);Ri=Tu([D({components:{AddBatchToQueueDialog:an,HistoryListPanelNoteDialog:GC,HistoryListPanelDetailsDialog:uf,Panel:B}})],Ri);var bj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(r){return e.showContextMenu(r)},expression:"(e) => showContextMenu(e)",arg:"600"}],key:e.item.job_id,class:e.cssClasses,on:{contextmenu:function(r){return e.showContextMenu(r)},click:function(r){e.detailsDialogBool=!0}}},[t("td",{staticClass:"pr-0"},[t(Fr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:e.isSelected},on:{click:function(r){return r.stopPropagation(),e.select(!e.isSelected)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[e.item.exists?e.smallThumbnail&&e.bigThumbnail?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",alt:e.item.filename,src:e.smallThumbnail,width:"32",height:"32"},slot:"image"},"img",n,!1),i)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(dt,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[e._v(e._s(e.mdiFile))])],1)])]}}])},[t("span",[t("img",{attrs:{alt:e.item.filename,src:e.bigThumbnail,width:"250"}})])])]:e.smallThumbnail?[t("vue-load-image",[t("img",{attrs:{slot:"image",alt:e.item.filename,src:e.smallThumbnail,width:"32",height:"32"},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(dt,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(v,[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",[e._v(e._s(e.item.filename))]),t("td",{staticClass:"text-right text-no-wrap"},["note"in e.item&&e.item.note?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({staticClass:"mr-2",attrs:{small:""}},"v-icon",n,!1),i),[e._v(" "+e._s(e.mdiNoteTextOutline)+" ")])]}}],null,!1,3447416518)},[t("span",{domProps:{innerHTML:e._s(e.item.note.replaceAll("\n","
"))}})])]:e._e(),t(de,{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(v,{attrs:{small:"",color:e.statusColor,disabled:!e.item.exists}},[e._v(" "+e._s(e.statusIcon)+" ")])],1)]}}])},[t("span",[e._v(e._s(e.statusName))])])],2),e._l(e.tableFields,function(r){return t("td",{key:r.value,staticClass:"text-no-wrap",domProps:{innerHTML:e._s(e.outputValue(r,e.item))}})}),t($e,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.contextMenuBool,callback:function(r){e.contextMenuBool=r},expression:"contextMenuBool"}},[t(Oe,[t(J,{on:{click:function(r){e.detailsDialogBool=!0}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiTextBoxSearch))]),e._v(" "+e._s(e.$t("History.Details"))+" ")],1),e.item.note?t(J,{on:{click:e.editNote}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiNoteEditOutline))]),e._v(" "+e._s(e.$t("History.EditNote"))+" ")],1):t(J,{on:{click:e.createNote}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiNotePlusOutline))]),e._v(" "+e._s(e.$t("History.AddNote"))+" ")],1),e.item.exists?t(J,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:e.startPrint}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPrinter))]),e._v(" "+e._s(e.$t("History.Reprint"))+" ")],1):e._e(),e.item.exists&&e.isJobQueueAvailable?t(J,{on:{click:e.addToQueue}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),e.item.exists&&e.isJobQueueAvailable?t(J,{on:{click:function(r){e.addBatchToQueueDialogBool=!0}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),t(J,{staticClass:"red--text",on:{click:e.deleteJob}},[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(uf,{attrs:{show:e.detailsDialogBool,job:e.item},on:{"close-dialog":function(r){e.detailsDialogBool=!1}}}),t(GC,{attrs:{show:e.noteDialogBool,type:e.noteDialogType,job:e.item},on:{"close-dialog":function(r){e.noteDialogBool=!1}}}),t(an,{attrs:{"is-visible":e.addBatchToQueueDialogBool,"show-toast":!0,filename:e.item.filename},on:{close:function(r){e.addBatchToQueueDialogBool=!1}}})],2)},yj=[];const jv={};var Cj=E(Ri,bj,yj,!1,$j,null,null,null);function $j(e){for(let s in jv)this[s]=jv[s]}const zC=function(){return Cj.exports}();var xj=Object.defineProperty,wj=Object.getOwnPropertyDescriptor,df=(e,s,t,r)=>{for(var i=r>1?void 0:r?wj(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&&xj(s,t,i),i};let la=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiAlarm=Bn,this.mdiCalendar=Ic,this.mdiCloseThick=pe,this.mdiNotebookPlus=qy,this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0,this.nameInputRules=[s=>!!s||this.$t("History.InvalidNameEmpty")]}get reminderItems(){return[{text:this.$t("History.NoReminder").toString(),value:null},{text:this.$t("History.OneTime").toString(),value:"one-time"},{text:this.$t("History.Repeat").toString(),value:"repeat"}]}get totalFilamentUsed(){var s,t;return(t=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_filament_used)!=null?t:0}get totalPrinttime(){var s,t;return(t=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_print_time)!=null?t:0}get isValid(){return!(this.name===""||this.reminder!==null&&(!this.reminderFilament&&!this.reminderPrinttime&&!this.reminderDate||this.reminderFilament&&this.reminderFilamentValue<=0||this.reminderPrinttime&&this.reminderPrinttimeValue<=0||this.reminderDate&&this.reminderDateValue<=0))}closeDialog(){this.$emit("close")}save(){const s=new Date;this.$store.dispatch("gui/maintenance/store",{entry:{name:this.name,note:this.note,start_time:s.getTime()/1e3,end_time:null,start_filament:this.totalFilamentUsed,end_filament:null,start_printtime:this.totalPrinttime,end_printtime:null,reminder:{type:this.reminder,filament:{bool:this.reminderFilament,value:this.reminderFilamentValue},printtime:{bool:this.reminderPrinttime,value:this.reminderPrinttimeValue},date:{bool:this.reminderDate,value:this.reminderDateValue}}}}),this.closeDialog()}resetValues(){this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0}onShowChanged(){this.show&&this.resetValues()}};df([P({type:Boolean,default:!1})],la.prototype,"show",2);df([me("show")],la.prototype,"onShowChanged",1);la=df([D({components:{Panel:B,SettingsRow:V}})],la);var Sj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(B,{attrs:{title:e.$t("History.AddMaintenance"),icon:e.mdiNotebookPlus,"card-class":"history-add-maintenance-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:"pb-0"},[t($,[t(_,[t(te,{attrs:{rules:e.nameInputRules,label:e.$t("History.Name"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.name,callback:function(r){e.name=r},expression:"name"}})],1)],1),t($,[t(_,[t(Bs,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1),t($,[t(_,[t(V,{attrs:{title:e.$t("History.Reminder")}},[t(Ee,{staticClass:"mt-0",attrs:{items:e.reminderItems,outlined:"",dense:"","hide-details":""},model:{value:e.reminder,callback:function(r){e.reminder=r},expression:"reminder"}})],1)],1)],1),e.reminder?[t($,[t(_,[t(V,{attrs:{icon:e.mdiAdjust,title:e.$t("History.FilamentBasedReminder"),"sub-title":e.$t("History.FilamentBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderFilament,callback:function(r){e.reminderFilament=r},expression:"reminderFilament"}}),t(te,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Meter")},model:{value:e.reminderFilamentValue,callback:function(r){e.reminderFilamentValue=e._n(r)},expression:"reminderFilamentValue"}})],1)],1)],1),t($,[t(_,[t(V,{attrs:{icon:e.mdiAlarm,title:e.$t("History.PrinttimeBasedReminder"),"sub-title":e.$t("History.PrinttimeBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderPrinttime,callback:function(r){e.reminderPrinttime=r},expression:"reminderPrinttime"}}),t(te,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Hours")},model:{value:e.reminderPrinttimeValue,callback:function(r){e.reminderPrinttimeValue=e._n(r)},expression:"reminderPrinttimeValue"}})],1)],1)],1),t($,[t(_,[t(V,{attrs:{icon:e.mdiCalendar,title:e.$t("History.DateBasedReminder"),"sub-title":e.$t("History.DateBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderDate,callback:function(r){e.reminderDate=r},expression:"reminderDate"}}),t(te,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Days")},model:{value:e.reminderDateValue,callback:function(r){e.reminderDateValue=e._n(r)},expression:"reminderDateValue"}})],1)],1)],1)]:e._e()],2),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:"",disabled:!e.isValid},on:{click:e.save}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)},Pj=[];const Hv={};var Dj=E(la,Sj,Pj,!1,Tj,null,null,null);function Tj(e){for(let s in Hv)this[s]=Hv[s]}const ZC=function(){return Dj.exports}();var Mj=Object.defineProperty,Ej=Object.getOwnPropertyDescriptor,Mu=(e,s,t,r)=>{for(var i=r>1?void 0:r?Ej(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&&Mj(s,t,i),i};let ji=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiAlarm=Bn,this.mdiCalendar=Ic,this.mdiCloseThick=pe}get date(){return this.formatDateTime(this.item.start_time*1e3,!1)}get dateText(){return this.last?this.$t("History.EntryCreatedAt",{date:this.date}):this.$t("History.EntryPerformedAt",{date:this.date})}get showGoals(){return this.item.reminder.type===null?!1:this.current&&this.item.end_time===null}get restFilament(){var i,n,a,o,l;const e=(n=(i=this.item)==null?void 0:i.start_filament)!=null?n:0,s=(a=this.item.end_filament)!=null?a:0;let r=((l=(o=this.$store.state.server.history.job_totals)==null?void 0:o.total_filament_used)!=null?l:0)-e;return s&&(r=s-e),r/=1e3,r}get restFilamentText(){var s,t;const e=(t=(s=this.item.reminder.filament)==null?void 0:s.value)!=null?t:0;return this.showGoals?this.item.reminder.filament.bool?"".concat(this.restFilament.toFixed(0)," / ").concat(e," m"):!1:"".concat(this.restFilament.toFixed(0)," m")}get restFilamentClass(){var t,r;const e=["mr-3"];if(!this.showGoals||!this.item.reminder.filament.bool)return e;const s=(r=(t=this.item.reminder.filament)==null?void 0:t.value)!=null?r:0;return this.restFilament>s?[...e,"error--text","font-weight-bold"]:e}get restPrinttime(){var i,n,a,o;const e=(i=this.item.start_printtime)!=null?i:0,s=(n=this.item.end_printtime)!=null?n:0;let r=((o=(a=this.$store.state.server.history.job_totals)==null?void 0:a.total_print_time)!=null?o:0)-e;return s&&(r=s-e),r/=3600,r}get restPrinttimeText(){var s,t;const e=(t=(s=this.item.reminder.printtime)==null?void 0:s.value)!=null?t:0;return this.showGoals?this.item.reminder.printtime.bool?"".concat(this.restPrinttime.toFixed(1)," / ").concat(e," h"):!1:"".concat(this.restPrinttime.toFixed(1)," h")}get restPrinttimeClass(){var t,r;const e=["mr-3"];if(!this.showGoals||!this.item.reminder.printtime.bool)return e;const s=(r=(t=this.item.reminder.printtime)==null?void 0:t.value)!=null?r:0;return this.restPrinttime>s?[...e,"error--text","font-weight-bold"]:e}get restDays(){var i,n;const e=(i=this.item.start_time)!=null?i:0,s=(n=this.item.end_time)!=null?n:0;let r=new Date().getTime()/1e3-e;return s&&(r=s-e),r/(60*60*24)}get restDaysText(){var s,t;const e=(t=(s=this.item.reminder.date)==null?void 0:s.value)!=null?t:0;return this.showGoals?this.item.reminder.date.bool?"".concat(this.restDays.toFixed(0)," / ").concat(e," days"):!1:"".concat(this.restDays.toFixed(0)," days")}get restDaysClass(){var t,r;const e=["mr-3"];if(!this.showGoals||!this.item.reminder.date.bool)return e;const s=(r=(t=this.item.reminder.date)==null?void 0:t.value)!=null?r:0;return this.restDays>s?[...e,"error--text","font-weight-bold"]:e}get classDateItem(){return{"pb-2":!this.last,"pb-5":this.last}}get note(){var e;return(e=this.item.perform_note)==null?void 0:e.replaceAll("\n","
")}};Mu([P({type:Object,default:!1})],ji.prototype,"item",2);Mu([P({type:Boolean,default:!1})],ji.prototype,"current",2);Mu([P({type:Boolean,default:!1})],ji.prototype,"last",2);ji=Mu([D({components:{Panel:B}})],ji);var Oj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Vn,{staticClass:"pb-2",attrs:{small:"","hide-dot":""}},[t("div",[e.restFilamentText?t("span",{class:e.restFilamentClass},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiAdjust))]),e._v(" "+e._s(e.restFilamentText)+" ")],1):e._e(),e.restPrinttimeText?t("span",{class:e.restPrinttimeClass},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiAlarm))]),e._v(" "+e._s(e.restPrinttimeText)+" ")],1):e._e(),e.restDaysText?t("span",{class:e.restDaysClass},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiCalendar))]),e._v(" "+e._s(e.restDaysText)+" ")],1):e._e()]),e.note?t("p",{staticClass:"mt-2 mb-0",domProps:{innerHTML:e._s(e.note)}}):e._e()]),t(Vn,{class:e.classDateItem,attrs:{small:""}},[t("strong",[e._v(e._s(e.dateText))])])],1)},Lj=[];const Iv={};var Aj=E(ji,Oj,Lj,!1,kj,null,null,null);function kj(e){for(let s in Iv)this[s]=Iv[s]}const mf=function(){return Aj.exports}();var Fj=Object.defineProperty,Rj=Object.getOwnPropertyDescriptor,Eu=(e,s,t,r)=>{for(var i=r>1?void 0:r?Rj(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&&Fj(s,t,i),i};let Hi=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiNotebook=Zc,this.note=""}get showPerformButton(){var e,s;return this.item.end_time?!1:(s=(e=this.item.reminder)==null?void 0:e.type)!=null?s:!1}get performButtonText(){var e;return((e=this.item.reminder)==null?void 0:e.type)==="repeat"?this.$t("History.PerformedAndReschedule"):this.$t("History.Performed")}closeDialog(){this.$emit("close")}perform(){this.$store.dispatch("gui/maintenance/perform",{id:this.item.id,note:this.note}),this.$emit("close-both")}onShowChanged(e){e&&(this.note="")}};Eu([P({type:Boolean,default:!1})],Hi.prototype,"show",2);Eu([P({type:Object,default:!1})],Hi.prototype,"item",2);Eu([me("show")],Hi.prototype,"onShowChanged",1);Hi=Eu([D({components:{Panel:B,HistoryListPanelDetailMaintenanceHistoryEntry:mf}})],Hi);var jj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":400,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(B,{attrs:{title:e.$t("History.PerformMaintenance"),icon:e.mdiNotebook,"card-class":"history-perform-maintenance-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:"pb-0"},[t($,[t(_,[t(Bs,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.AddANote")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1)],1),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),e.showPerformButton?t(g,{attrs:{text:"",color:"primary"},on:{click:e.perform}},[e._v(e._s(e.performButtonText))]):e._e()],1)],1)],1)},Hj=[];const Nv={};var Ij=E(Hi,jj,Hj,!1,Nj,null,null,null);function Nj(e){for(let s in Nv)this[s]=Nv[s]}const qC=function(){return Ij.exports}();var Vj=Object.defineProperty,Uj=Object.getOwnPropertyDescriptor,hf=(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&&Vj(s,t,i),i};let ca=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiNotebook=Zc,this.mdiPencil=bt,this.showEditDialog=!1,this.showPerformDialog=!1}get date(){return this.formatDateTime(this.item.start_time*1e3,!1)}get note(){return this.item.note.replaceAll("\n","
")}get showPerformButton(){var e,s;return this.item.end_time?!1:(s=(e=this.item.reminder)==null?void 0:e.type)!=null?s:!1}get allEntries(){var e;return(e=this.$store.getters["gui/maintenance/getEntries"])!=null?e:[]}get history(){const e=[];let s=this.item.id;for(;s;){const t=this.allEntries.find(r=>r.id===s);if(!t)break;e.push(t),s=t.last_entry}return e}get outputFirstPointOfHistory(){return this.item.reminder.type===null?this.$t("History.EntrySince"):this.item.end_time===null?this.$t("History.EntryNextPerform"):this.$t("History.EntryPerformedAt",{date:this.formatDateTime(this.item.end_time*1e3)})}closeDialog(){this.$emit("close")}closePerform(){this.showPerformDialog=!1,this.closeDialog()}};hf([P({type:Boolean,default:!1})],ca.prototype,"show",2);hf([P({type:Object,default:!1})],ca.prototype,"item",2);ca=hf([D({components:{HistoryListPanelPerformMaintenance:qC,Panel:B,HistoryListPanelDetailMaintenanceHistoryEntry:mf}})],ca);var Bj=Object.defineProperty,Wj=Object.getOwnPropertyDescriptor,Ou=(e,s,t,r)=>{for(var i=r>1?void 0:r?Wj(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&&Bj(s,t,i),i};let Ii=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiAlarm=Bn,this.mdiCalendar=Ic,this.mdiCloseThick=pe,this.mdiNotebook=Zc,this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0,this.nameInputRules=[e=>!!e||this.$t("History.InvalidNameEmpty")]}get reminderItems(){return[{text:this.$t("History.NoReminder").toString(),value:null},{text:this.$t("History.OneTime").toString(),value:"one-time"},{text:this.$t("History.Repeat").toString(),value:"repeat"}]}get totalFilamentUsed(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_filament_used)!=null?s:0}get totalPrinttime(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_print_time)!=null?s:0}get isValid(){return!(this.name===""||this.reminder!==null&&(!this.reminderFilament&&!this.reminderPrinttime&&!this.reminderDate||this.reminderFilament&&this.reminderFilamentValue<=0||this.reminderPrinttime&&this.reminderPrinttimeValue<=0||this.reminderDate&&this.reminderDateValue<=0))}closeDialog(){this.$emit("close")}save(){const e={...this.item};"type"in e&&delete e.type,e.name=this.name,e.note=this.note,e.reminder={type:this.reminder,filament:{bool:this.reminderFilament,value:this.reminderFilamentValue},printtime:{bool:this.reminderPrinttime,value:this.reminderPrinttimeValue},date:{bool:this.reminderDate,value:this.reminderDateValue}},this.$store.dispatch("gui/maintenance/update",e),this.closeDialog()}onShowChanged(){var e,s,t,r,i,n,a,o,l,c,u,d,m,h;this.show&&(this.name=this.item.name,this.note=this.item.note,this.reminder=(s=(e=this.item.reminder)==null?void 0:e.type)!=null?s:null,this.reminderFilament=(r=(t=this.item.reminder)==null?void 0:t.filament.bool)!=null?r:!1,this.reminderFilamentValue=(n=(i=this.item.reminder)==null?void 0:i.filament.value)!=null?n:0,this.reminderPrinttime=(o=(a=this.item.reminder)==null?void 0:a.printtime.bool)!=null?o:!1,this.reminderPrinttimeValue=(c=(l=this.item.reminder)==null?void 0:l.printtime.value)!=null?c:0,this.reminderDate=(d=(u=this.item.reminder)==null?void 0:u.date.bool)!=null?d:!1,this.reminderDateValue=(h=(m=this.item.reminder)==null?void 0:m.date.value)!=null?h:0)}};Ou([P({type:Boolean,default:!1})],Ii.prototype,"show",2);Ou([P({type:Object,required:!0})],Ii.prototype,"item",2);Ou([me("show")],Ii.prototype,"onShowChanged",1);Ii=Ou([D({components:{Panel:B,SettingsRow:V}})],Ii);var Gj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(B,{attrs:{title:e.$t("History.EditMaintenance"),icon:e.mdiNotebook,"card-class":"history-edit-maintenance-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:"pb-0"},[t($,[t(_,[t(te,{attrs:{rules:e.nameInputRules,label:e.$t("History.Name"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.name,callback:function(r){e.name=r},expression:"name"}})],1)],1),t($,[t(_,[t(Bs,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1),t($,[t(_,[t(V,{attrs:{title:e.$t("History.Reminder")}},[t(Ee,{staticClass:"mt-0",attrs:{items:e.reminderItems,disabled:e.item.end_time!==null,outlined:"",dense:"","hide-details":""},model:{value:e.reminder,callback:function(r){e.reminder=r},expression:"reminder"}})],1)],1)],1),e.reminder?[t($,[t(_,[t(V,{attrs:{icon:e.mdiAdjust,title:e.$t("History.FilamentBasedReminder"),"sub-title":e.$t("History.FilamentBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderFilament,callback:function(r){e.reminderFilament=r},expression:"reminderFilament"}}),t(te,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Meter")},model:{value:e.reminderFilamentValue,callback:function(r){e.reminderFilamentValue=e._n(r)},expression:"reminderFilamentValue"}})],1)],1)],1),t($,[t(_,[t(V,{attrs:{icon:e.mdiAlarm,title:e.$t("History.PrinttimeBasedReminder"),"sub-title":e.$t("History.PrinttimeBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderPrinttime,callback:function(r){e.reminderPrinttime=r},expression:"reminderPrinttime"}}),t(te,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Hours")},model:{value:e.reminderPrinttimeValue,callback:function(r){e.reminderPrinttimeValue=e._n(r)},expression:"reminderPrinttimeValue"}})],1)],1)],1),t($,[t(_,[t(V,{attrs:{icon:e.mdiCalendar,title:e.$t("History.DateBasedReminder"),"sub-title":e.$t("History.DateBasedReminderDescription")}},[t(_e,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderDate,callback:function(r){e.reminderDate=r},expression:"reminderDate"}}),t(te,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Days")},model:{value:e.reminderDateValue,callback:function(r){e.reminderDateValue=e._n(r)},expression:"reminderDateValue"}})],1)],1)],1)]:e._e()],2),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:"",disabled:!e.isValid},on:{click:e.save}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)},zj=[];const Vv={};var Zj=E(Ii,Gj,zj,!1,qj,null,null,null);function qj(e){for(let s in Vv)this[s]=Vv[s]}const Xj=function(){return Zj.exports}();var Yj=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":500,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(B,{attrs:{title:e.$t("History.Maintenance"),icon:e.mdiNotebook,"card-class":"history-maintenance-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showEditDialog=!0}}},[t(v,[e._v(e._s(e.mdiPencil))])],1),t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t("overlay-scrollbars",{staticStyle:{height:"350px"}},[t(q,{staticClass:"pb-0"},[t($,[t(_,[t("div",[e._v(e._s(e.date))]),t("p",{staticClass:"text-h4 text--primary"},[e._v(e._s(e.item.name))]),e.note?t("div",{staticClass:"text--primary",domProps:{innerHTML:e._s(e.note)}}):e._e()])],1)],1),t(U,{staticClass:"mt-3 mb-0"}),t(q,{staticClass:"pt-0 mb-0 pb-0"},[t(ly,{attrs:{"align-top":"",dense:""}},[t(Vn,{staticClass:"pb-1",attrs:{small:""}},[t("strong",[e._v(e._s(e.outputFirstPointOfHistory))])]),e._l(e.history,function(r){return t(mf,{key:r.id,attrs:{item:r,current:r.id===e.item.id,last:r.id===e.history[e.history.length-1].id}})})],2)],1)],1),t(U,{staticClass:"mt-0"}),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),e.showPerformButton?t(g,{attrs:{text:"",color:"primary"},on:{click:function(r){e.showPerformDialog=!0}}},[e._v(" "+e._s(e.$t("History.Perform"))+" ")]):e._e()],1)],1),t(qC,{attrs:{show:e.showPerformDialog,item:e.item},on:{close:function(r){e.showPerformDialog=!1},"close-both":e.closePerform}}),t(Xj,{attrs:{show:e.showEditDialog,item:e.item},on:{close:function(r){e.showEditDialog=!1}}})],1)},Jj=[];const Uv={};var Kj=E(ca,Yj,Jj,!1,Qj,null,null,null);function Qj(e){for(let s in Uv)this[s]=Uv[s]}const pf=function(){return Kj.exports}();var eH=Object.defineProperty,tH=Object.getOwnPropertyDescriptor,Lu=(e,s,t,r)=>{for(var i=r>1?void 0:r?tH(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&&eH(s,t,i),i};let Ni=class extends M(O){constructor(){super(...arguments),this.mdiAdjust=Ki,this.mdiAlarm=Bn,this.mdiCalendar=Ic,this.mdiDelete=ze,this.mdiTextBoxSearch=i2,this.detailsDialogBool=!1,this.contextMenuBool=!1,this.contextMenuX=0,this.contextMenuY=0}get cssClasses(){return["file-list-cursor","user-select-none"]}get restFilament(){var n,a,o,l,c;const s=(a=(n=this.item)==null?void 0:n.start_filament)!=null?a:0,t=(o=this.item.end_filament)!=null?o:0;let i=((c=(l=this.$store.state.server.history.job_totals)==null?void 0:l.total_filament_used)!=null?c:0)-s;return t&&(i=t-s),i/=1e3,i}get restTextFilament(){var t,r;if(!this.item.reminder.filament.bool)return!1;const s=(r=(t=this.item.reminder.filament)==null?void 0:t.value)!=null?r:0;return"".concat(this.restFilament.toFixed(0)," / ").concat(s," m")}get restPrinttime(){var n,a,o,l;const s=(n=this.item.start_printtime)!=null?n:0,t=(a=this.item.end_printtime)!=null?a:0;let i=((l=(o=this.$store.state.server.history.job_totals)==null?void 0:o.total_print_time)!=null?l:0)-s;return t&&(i=t-s),i/=3600,i}get restTextPrinttime(){var t,r;if(!this.item.reminder.printtime.bool)return!1;const s=(r=(t=this.item.reminder.printtime)==null?void 0:t.value)!=null?r:0;return"".concat(this.restPrinttime.toFixed(1)," / ").concat(s," h")}get restDays(){var n,a;const s=(n=this.item.start_time)!=null?n:0,t=(a=this.item.end_time)!=null?a:0;let i=new Date().getTime()/1e3-s;return t&&(i=t-s),i/(60*60*24)}get restTextDays(){var t,r;if(!this.item.reminder.date.bool)return!1;const s=(r=(t=this.item.reminder.date)==null?void 0:t.value)!=null?r:0;return"".concat(this.restDays.toFixed(0)," / ").concat(s," days")}get reminder(){var s,t;return(t=(s=this.item.reminder)==null?void 0:s.type)!=null?t:null}get alarmIcon(){return this.reminder==="repeat"?JD:Bn}get icon(){return this.item.end_time!==null?JT:Zc}select(s){this.$emit("select",s)}showContextMenu(s){s==null||s.preventDefault(),!this.contextMenuBool&&(this.contextMenuBool=!0,this.contextMenuX=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenuY=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.$nextTick(()=>{this.contextMenuBool=!0}))}deleteEntry(){this.$store.dispatch("gui/maintenance/delete",this.item.id)}};Lu([P({type:Object,required:!0})],Ni.prototype,"item",2);Lu([P({type:Array,required:!0})],Ni.prototype,"tableFields",2);Lu([P({type:Boolean,required:!0})],Ni.prototype,"isSelected",2);Ni=Lu([D({components:{HistoryListPanelDetailMaintenance:pf,Panel:B}})],Ni);var sH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:function(r){return e.showContextMenu(r)},expression:"(e) => showContextMenu(e)",arg:"600"}],key:e.item.id,class:e.cssClasses,on:{contextmenu:function(r){return e.showContextMenu(r)},click:function(r){e.detailsDialogBool=!0}}},[t("td",{staticClass:"pr-0"},[t(Fr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:e.isSelected},on:{click:function(r){return r.stopPropagation(),e.select(!e.isSelected)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[t(v,{attrs:{color:"primary"}},[e._v(e._s(e.icon))])],1),t("td",[e._v(e._s(e.item.name))]),t("td",{staticClass:"text-right text-no-wrap"},[e.reminder!==null?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on,n=r.attrs;return[t(v,e._g(e._b({attrs:{small:"",color:"primary"}},"v-icon",n,!1),i),[e._v(" "+e._s(e.alarmIcon)+" ")])]}}],null,!1,95998964)},[t("div",[e.restTextFilament?t("div",[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiAdjust))]),e._v(" "+e._s(e.restTextFilament)+" ")],1):e._e(),e.restTextPrinttime?t("div",[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiAlarm))]),e._v(" "+e._s(e.restTextPrinttime)+" ")],1):e._e(),e.restTextDays?t("div",[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiCalendar))]),e._v(" "+e._s(e.restTextDays)+" ")],1):e._e()])]):e._e()],1),t("td",{staticClass:"text-left text-no-wrap"},[e._v(" "+e._s(e.formatDateTime(e.item.start_time*1e3,!1))+" ")]),t("td",{attrs:{colspan:e.tableFields.length-1}}),t($e,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.contextMenuBool,callback:function(r){e.contextMenuBool=r},expression:"contextMenuBool"}},[t(Oe,[t(J,{on:{click:function(r){e.detailsDialogBool=!0}}},[t(v,{staticClass:"mr-1"},[e._v(e._s(e.mdiTextBoxSearch))]),e._v(" "+e._s(e.$t("History.Details"))+" ")],1),t(J,{staticClass:"red--text",on:{click:e.deleteEntry}},[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(pf,{attrs:{show:e.detailsDialogBool,item:e.item},on:{close:function(r){e.detailsDialogBool=!1}}})],1)},rH=[];const Bv={};var iH=E(Ni,sH,rH,!1,nH,null,null,null);function nH(e){for(let s in Bv)this[s]=Bv[s]}const XC=function(){return iH.exports}();var aH=Object.defineProperty,oH=Object.getOwnPropertyDescriptor,YC=(e,s,t,r)=>{for(var i=r>1?void 0:r?oH(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&&aH(s,t,i),i};let Al=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe}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 question(){return this.selectedJobs.length===1?this.$t("History.DeleteSingleJobQuestion"):this.$t("History.DeleteSelectedQuestion",{count:this.selectedJobs.length})}closeDialog(){this.$emit("close")}deleteSelectedJobs(){this.selectedJobs.forEach(e=>{if(e.type==="maintenance"){this.$store.dispatch("gui/maintenance/delete",e.id);return}"job_id"in e&&this.$socket.emit("server.history.delete_job",{uid:e.job_id},{action:"server/history/getDeletedJobs"})}),this.selectedJobs=[],this.closeDialog()}};YC([P({type:Boolean,required:!0})],Al.prototype,"show",2);Al=YC([D({components:{Panel:B}})],Al);var lH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.show,"max-width":"400"}},[t(B,{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:e.closeDialog}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.question))])]),t(ne,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[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)},cH=[];const Wv={};var uH=E(Al,lH,cH,!1,dH,null,null,null);function dH(e){for(let s in Wv)this[s]=Wv[s]}const JC=function(){return uH.exports}();var mH=Object.defineProperty,hH=Object.getOwnPropertyDescriptor,pH=(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&&mH(s,t,i),i};let kl=class extends y{get moonrakerHistoryFields(){var r,i;const e=(i=(r=this.$store.state.server.config)==null?void 0:r.config)!=null?i:{},s=Object.keys(e).filter(n=>n.startsWith("sensor ")),t=[];return s.forEach(n=>{var o;const a=(o=e[n])!=null?o:{};Object.keys(a).filter(l=>l.startsWith("history_field_")).forEach(l=>{const c=a[l];t.push({desc:c.desc,unit:c.units,provider:n,parameter:c.parameter,name:l})})}),t}};kl=pH([D],kl);var fH=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,vH=(e,s,t,r)=>{for(var i=r>1?void 0:r?gH(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 Um=class extends M(O,kl){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiCog=us,this.mdiDatabaseArrowDownOutline=Ey,this.mdiDatabaseExportOutline=$T,this.mdiDelete=ze,this.mdiFileDocumentMultipleOutline=Uc,this.mdiMagnify=zc,this.mdiNotebookPlus=qy,this.formatFilesize=Je,this.search="",this.sortBy="start_time",this.sortDesc=!0,this.addMaintenanceDialog=!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/getFilteredJobList"])!=null?e:[]}get maintenanceEntries(){var e;return(e=this.$store.getters["gui/maintenance/getEntries"])!=null?e:[]}get entries(){let e=[];return this.showPrintJobs&&(e=[...this.jobs].map(s=>({...s,type:"job",select_id:"job_".concat(s.job_id)}))),this.sortBy!=="start_time"||this.showMaintenanceEntries&&(e=[...e,...this.maintenanceEntries.map(s=>({...s,type:"maintenance",select_id:"maintenance_".concat(s.id)}))]),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").toString(),value:"filename",align:"left",configable:!1,visible:!0},{text:"",value:"status",align:"left",configable:!1,visible:!0,filterable:!1},{text:this.$t("History.Filesize").toString(),value:"size",align:"left",configable:!0,visible:!0,outputType:"filesize"},{text:this.$t("History.LastModified").toString(),value:"modified",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.StartTime").toString(),value:"start_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EndTime").toString(),value:"end_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EstimatedTime").toString(),value:"estimated_time",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.PrintTime").toString(),value:"print_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.TotalTime").toString(),value:"total_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.FilamentCalc").toString(),value:"filament_total",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FilamentUsed").toString(),value:"filament_used",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FirstLayerExtTemp").toString(),value:"first_layer_extr_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerBedTemp").toString(),value:"first_layer_bed_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerHeight").toString(),value:"first_layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.LayerHeight").toString(),value:"layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.ObjectHeight").toString(),value:"object_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.Slicer").toString(),value:"slicer",align:"left",configable:!0,visible:!0}];return this.moonrakerHistoryFields.forEach(s=>{e.push({text:s.desc,value:s.name,align:"left",configable:!0,visible:!1})}),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"].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 At((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 showMaintenanceEntries(){return this.$store.state.gui.view.history.showMaintenanceEntries}set showMaintenanceEntries(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.showMaintenanceEntries",value:e})}get showPrintJobs(){return this.$store.state.gui.view.history.showPrintJobs}set showPrintJobs(e){this.$store.dispatch("gui/saveSetting",{name:"view.history.showPrintJobs",value:e})}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}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}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){if(e.showInTable){this.$store.dispatch("gui/hideStatusInHistoryList",e.name);return}this.$store.dispatch("gui/showStatusInHistoryList",e.name)}exportHistory(){const t=(parseFloat("1.23").toLocaleString(this.browserLocale).indexOf(",")>=0?",":".")===","?";":",",r=[],i=[];i.push("filename"),i.push("type"),i.push("status"),this.tableFields.forEach(l=>{if(l.value.startsWith("history_field_")){const c=l.value.replace("history_field_","");i.push(c);return}i.push(l.value)}),r.push(i);let n=[...this.entries];this.selectedJobs.length&&(n=[...this.selectedJobs]),n.length&&n.sort((l,c)=>c.start_time-l.start_time).forEach(l=>{var h,p;const c=[];if(((h=l.type)!=null?h:"job")==="maintenance"){const f=l;c.push(f.name),c.push("maintenance"),c.push(f.end_time!==null?"performed":"open"),this.tableFields.filter(b=>b.value!=="slicer").forEach(b=>{if(b.value==="start_time"){c.push(this.formatDateTime(f.start_time*1e3));return}if(b.value==="end_time"&&f.end_time!==null){c.push(this.formatDateTime(f.end_time*1e3));return}if(b.value==="print_duration"&&f.end_printtime!==null){const C=f.end_printtime-f.start_printtime;c.push(C.toLocaleString(this.browserLocale,{useGrouping:!1}));return}if(b.value==="filament_used"&&f.end_filament!==null){const C=f.end_filament-f.start_filament;c.push(C.toLocaleString(this.browserLocale,{useGrouping:!1}));return}c.push("")}),(p=this.tableFields.find(b=>b.value==="slicer"))!=null&&p.visible&&c.push(""),r.push(c);return}const d=l;let m=d.filename;m.includes(t)&&(m='"'+m+'"'),c.push(m),c.push("job"),c.push(d.status),this.tableFields.forEach(f=>{c.push(this.outputValue(f,d,t))}),r.push(c)});const a="data:text/csv;charset=utf-8,"+r.map(l=>l.map(c=>(c==null?void 0:c.indexOf(t))===-1?c:'"'.concat(c,'"')).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()}outputValue(e,s,t=null){var i,n,a,o,l,c;let r=e.value in s?s[e.value]:null;if(r===null&&(r=e.value in s.metadata?s.metadata[e.value]:null),e.value==="slicer"){let u="slicer"in s.metadata&&s.metadata.slicer?s.metadata.slicer:"--";return"slicer_version"in s.metadata&&s.metadata.slicer_version&&(u+=" "+s.metadata.slicer_version),t!==null&&r.includes(t)?'"'+u+'"':u}if(e.value.startsWith("history_field_")){const u=e.value.replace("history_field_",""),d=(i=s.auxiliary_data)==null?void 0:i.find(h=>h.name===u);let m=(n=d==null?void 0:d.value)==null?void 0:n.toString();return d&&!Array.isArray(d.value)&&(m=(o=(a=d.value)==null?void 0:a.toLocaleString(this.browserLocale,{useGrouping:!1}))!=null?o:0),m?t!==null&&(m!=null&&m.includes(t))?'"'.concat(m,'"'):m:"--"}switch(e.outputType){case"date":return this.formatDateTime(r*1e3);case"time":return(l=r==null?void 0:r.toFixed())!=null?l:"";default:switch(typeof r){case"number":return(c=r==null?void 0:r.toLocaleString(this.browserLocale,{useGrouping:!1}))!=null?c:0;case"string":return t!==null&&r.includes(t)&&(r='"'+r+'"'),r;default:return r}}}};Um=vH([D({components:{HistoryListPanelDeleteSelectedDialog:JC,HistoryListEntryMaintenance:XC,HistoryListPanelAddMaintenance:ZC,HistoryListEntryJob:zC,HistoryListPanelDetailsDialog:uf,Panel:B}})],Um);var _H=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{attrs:{icon:e.mdiFileDocumentMultipleOutline,title:e.$t("History.PrintHistory"),"card-class":"history-list-panel"}},[t(q,[t($,[t(_,{staticClass:"col-4 d-flex align-center"},[t(te,{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(),t(de,{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:function(a){e.addMaintenanceDialog=!0}}},"v-btn",n,!1),i),[t(v,[e._v(e._s(e.mdiNotebookPlus))])],1)]}}])},[t("span",[e._v(e._s(e.$t("History.AddMaintenance")))])]),e.allLoaded?e._e():t(de,{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(de,{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,[t(J,{staticClass:"minHeight36"},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":e.showMaintenanceEntries,label:e.$t("History.MaintenanceEntries")},on:{change:function(r){e.showMaintenanceEntries=!e.showMaintenanceEntries}}})],1),t(J,{staticClass:"minHeight36"},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":e.showPrintJobs,label:e.$t("History.PrintJobs")},on:{change:function(r){e.showPrintJobs=!e.showPrintJobs}}})],1),t(U),e.allPrintStatusArray.length?[e._l(e.allPrintStatusArray,function(r){return t(J,{key:r.key,staticClass:"minHeight36"},[t(_e,{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(U)]:e._e(),e._l(e.configHeaders,function(r,i){return t(J,{key:"history-list-panel-header-option-"+i,staticClass:"minHeight36"},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.text},on:{change:function(n){return e.changeColumnVisible(r.value)}},model:{value:r.visible,callback:function(n){e.$set(r,"visible",n)},expression:"header.visible"}})],1)})],2)],1)],2)],1)],1),t(U,{staticClass:"mb-3"}),t(zr,{staticClass:"history-jobs-table",attrs:{items:e.entries,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("History.Jobs"),itemsPerPageAllText:e.$t("History.AllJobs"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"select_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:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("History.Empty")))])]},proxy:!0},{key:"item",fn:function(r){var i=r.item,n=r.isSelected,a=r.select;return[i.type==="job"?t(zC,{key:i.select_id,attrs:{"is-selected":n,item:i,"table-fields":e.tableFields},on:{select:a}}):i.type==="maintenance"?t(XC,{key:i.select_id,attrs:{"is-selected":n,item:i,"table-fields":e.tableFields},on:{select:a}}):e._e()]}}]),model:{value:e.selectedJobs,callback:function(r){e.selectedJobs=r},expression:"selectedJobs"}}),t(JC,{attrs:{show:e.deleteSelectedDialog},on:{close:function(r){e.deleteSelectedDialog=!1}}}),t(ZC,{attrs:{show:e.addMaintenanceDialog},on:{close:function(r){e.addMaintenanceDialog=!1}}})],1)},bH=[];const Gv={};var yH=E(Um,_H,bH,!1,CH,"74f4284e",null,null);function CH(e){for(let s in Gv)this[s]=Gv[s]}const KC=function(){return yH.exports}();var $H=Object.defineProperty,xH=Object.getOwnPropertyDescriptor,QC=(e,s,t,r)=>{for(var i=r>1?void 0:r?xH(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&&$H(s,t,i),i};let Fl=class extends M(O,_t){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())}};QC([me("filamentUsageArray")],Fl.prototype,"filamentUsageArrayChanged",1);Fl=QC([D({})],Fl);var wH=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"}}})},SH=[];const zv={};var PH=E(Fl,wH,SH,!1,DH,null,null,null);function DH(e){for(let s in zv)this[s]=zv[s]}const e$=function(){return PH.exports}();var TH=Object.defineProperty,MH=Object.getOwnPropertyDescriptor,t$=(e,s,t,r)=>{for(var i=r>1?void 0:r?MH(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&&TH(s,t,i),i};let Rl=class extends M(O,_t){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())}};t$([me("printtimeAvgArray")],Rl.prototype,"printtimeAvgArrayChanged",1);Rl=t$([D({components:{}})],Rl);var EH=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"}}})},OH=[];const Zv={};var LH=E(Rl,EH,OH,!1,AH,null,null,null);function AH(e){for(let s in Zv)this[s]=Zv[s]}const s$=function(){return LH.exports}();var kH=Object.defineProperty,FH=Object.getOwnPropertyDescriptor,r$=(e,s,t,r)=>{for(var i=r>1?void 0:r?FH(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&&kH(s,t,i),i};let jl=class extends M(O,_t){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(){return this.$store.getters["server/history/getSelectedJobs"]}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())}};r$([me("printStatusArray")],jl.prototype,"printStatusArrayChanged",1);jl=r$([D({components:{}})],jl);var RH=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"}}})},jH=[];const qv={};var HH=E(jl,RH,jH,!1,IH,null,null,null);function IH(e){for(let s in qv)this[s]=qv[s]}const i$=function(){return HH.exports}();var NH=Object.defineProperty,VH=Object.getOwnPropertyDescriptor,UH=(e,s,t,r)=>{for(var i=r>1?void 0:r?VH(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 Bm=class extends M(O,kl){constructor(){super(...arguments),this.mdiChartAreaspline=cT,this.mdiDatabaseArrowDownOutline=Ey,this.formatPrintTime=tu}get selectedJobs(){return this.$store.getters["server/history/getSelectedJobs"]}get existsSelectedJobs(){return this.selectedJobs.length>0}get totalPrintTime(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_print_time)!=null?s:0}get selectedPrintTime(){let e=0;return this.selectedJobs.forEach(s=>{e+=s.print_duration}),e}get longestPrintTime(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.longest_print)!=null?s: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(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_filament_used)!=null?s:0}get totalFilamentUsedFormat(){const e=Math.round(this.totalFilamentUsed/100)/10;return"".concat(e," m")}get selectedFilamentUsed(){let e=0;return this.selectedJobs.forEach(s=>{e+=s.filament_used}),e}get selectedFilamentUsedFormat(){const e=Math.round(this.selectedFilamentUsed/100)/10;return"".concat(e," m")}get totalJobsCount(){var e,s;return(s=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_jobs)!=null?s: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}get selectedTotals(){const e=[{title:this.$t("History.SelectedPrinttime"),value:this.formatPrintTime(this.selectedPrintTime,!1)},{title:this.$t("History.LongestPrinttime"),value:this.formatPrintTime(this.selectedLongestPrintTime,!1)},{title:this.$t("History.AvgPrinttime"),value:this.formatPrintTime(this.selectedAvgPrintTime,!1)},{title:this.$t("History.SelectedFilamentUsed"),value:this.selectedFilamentUsedFormat},{title:this.$t("History.SelectedJobs"),value:this.selectedJobs.length.toString()}];return e.push(...this.auxiliarySelectedTotals),e}get auxiliarySelectedTotals(){const e=[];return this.moonrakerHistoryFields.forEach(s=>{const t=this.selectedJobs.reduce((r,i)=>{var o;const n=s.name.replace("history_field_",""),a=(o=i.auxiliary_data)==null?void 0:o.find(l=>l.provider===s.provider&&l.name===n);return!a||typeof a.value!="number"?r:r+a.value},0);e.push({title:s.desc,value:"".concat(Math.round(t*1e3)/1e3," ").concat(s.unit)})}),e}get genericTotals(){const e=[{title:this.$t("History.TotalPrinttime"),value:this.formatPrintTime(this.totalPrintTime,!1)},{title:this.$t("History.LongestPrinttime"),value:this.formatPrintTime(this.longestPrintTime,!1)},{title:this.$t("History.AvgPrinttime"),value:this.formatPrintTime(this.avgPrintTime,!1)},{title:this.$t("History.TotalFilamentUsed"),value:this.totalFilamentUsedFormat},{title:this.$t("History.TotalJobs"),value:this.totalJobsCount.toString()}];return e.push(...this.auxiliaryTotals),e}get auxiliaryTotals(){var t;const e=(t=this.$store.state.server.history.auxiliary_totals)!=null?t:[],s=[];return e.forEach(r=>{var o,l;const i="history_field_".concat(r.field),n=this.moonrakerHistoryFields.find(c=>c.provider===r.provider&&c.name===i),a=Math.round(((o=r.total)!=null?o:0)*1e3)/1e3;s.push({title:(l=n==null?void 0:n.desc)!=null?l:r.field,value:"".concat(a," ").concat(n==null?void 0:n.unit)})}),s}get totals(){return this.existsSelectedJobs?this.selectedTotals:this.genericTotals}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}};Bm=UH([D({components:{Panel:B,HistoryFilamentUsage:e$,HistoryPrinttimeAvg:s$,HistoryAllPrintStatusChart:i$}})],Bm);var BH=Object.defineProperty,WH=Object.getOwnPropertyDescriptor,GH=(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&&BH(s,t,i),i};let Wm=class extends M(O){get selectedJobs(){return this.$store.getters["server/history/getSelectedJobs"]}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}};Wm=GH([D({components:{}})],Wm);var zH=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)])},ZH=[];const Xv={};var qH=E(Wm,zH,ZH,!1,XH,null,null,null);function XH(e){for(let s in Xv)this[s]=Xv[s]}const YH=function(){return qH.exports}();var JH=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{attrs:{icon:e.mdiChartAreaspline,title:e.$t("History.Statistics"),"card-class":"history-statistics-panel",collapsible:!0}},[t(q,{staticClass:"pa-0"},[t($,{attrs:{align:"center"}},[t(_,{staticClass:"col-12 col-sm-6 col-md-4"},[t(dp,[t("tbody",e._l(e.totals,function(r){return t("tr",{key:r.title},[t("td",[e._v(e._s(r.title))]),t("td",{staticClass:"text-right"},[e._v(e._s(r.value))])])}),0)])],1),t(_,{staticClass:"col-12 col-sm-6 col-md-4"},[e.togglePrintStatus==="chart"?t(i$):t(YH),t("div",{staticClass:"text-center mb-3"},[t(Uo,{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(de,{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(e$):e.toggleChart==="printtime_avg"?t(s$):e._e(),t("div",{staticClass:"text-center mt-3"},[t(Uo,{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)},KH=[];const Yv={};var QH=E(Bm,JH,KH,!1,eI,null,null,null);function eI(e){for(let s in Yv)this[s]=Yv[s]}const n$=function(){return QH.exports}();var tI=Object.defineProperty,sI=Object.getOwnPropertyDescriptor,rI=(e,s,t,r)=>{for(var i=r>1?void 0:r?sI(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&&tI(s,t,i),i};let Gm=class extends M(O){};Gm=rI([D({components:{HistoryListPanel:KC,HistoryStatisticsPanel:n$}})],Gm);var iI=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,[t(_,[t(n$)],1)],1),t($,{staticClass:"mt-0"},[t(_,[t(KC)],1)],1)],1)},nI=[];const Jv={};var aI=E(Gm,iI,nI,!1,oI,null,null,null);function oI(e){for(let s in Jv)this[s]=Jv[s]}const lI=function(){return aI.exports}();var cI=Object.defineProperty,uI=Object.getOwnPropertyDescriptor,dI=(e,s,t,r)=>{for(var i=r>1?void 0:r?uI(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&&cI(s,t,i),i};let zm=class extends M(O){constructor(){super(...arguments),this.formatFilesize=Je,this.sortFiles=kp,this.mdiFileVideo=LT,this.mdiCloseThick=pe,this.mdiFileDocumentMultipleOutline=Uc,this.mdiMagnify=zc,this.mdiFolderPlus=$p,this.mdiRefresh=tn,this.mdiFolderUpload=xp,this.mdiFolder=Cp,this.mdiFolderZipOutline=RT,this.mdiFile=pr,this.mdiCloudDownload=Gn,this.mdiRenameBox=Yc,this.mdiDelete=ze,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}};zm=dI([D({components:{Panel:B,PathNavigation:on}})],zm);var mI=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(B,{attrs:{title:e.$t("Timelapse.TimelapseFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"timelapse-files-panel"}},[t(q,[t($,[t(_,{staticClass:"col-12 d-flex align-center"},[t(te,{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(ae),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($,[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(on,{attrs:{path:e.currentPathForNavigation,"base-directory-label":"/".concat(e.rootDirectory),"on-segment-click":e.clickPathNavGoToDirectory}})],1),t(ae),e.disk_usage!==null?[t(de,{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(U,{staticClass:"mb-3"}),t(zr,{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(Fr,{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(de,{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(dt,{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(J,{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(J,{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(J,{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(J,{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(J,{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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(ae),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(B,{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($,[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($,[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(B,{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(ae),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(B,{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(ae),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)},hI=[];const Kv={};var pI=E(zm,mI,hI,!1,fI,"45e836df",null,null);function fI(e){for(let s in Kv)this[s]=Kv[s]}const a$=function(){return pI.exports}();var gI=Object.defineProperty,vI=Object.getOwnPropertyDescriptor,_I=(e,s,t,r)=>{for(var i=r>1?void 0:r?vI(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&&gI(s,t,i),i};let Zm=class extends M(O,dr){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiFile=pr,this.mdiCloseThick=pe,this.mdiTextBoxSearchOutline=n2,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))}};Zm=_I([D({components:{Panel:B,SettingsRow:V}})],Zm);var bI=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{staticClass:"mb-3"},[t(La,{attrs:{flat:"",dense:""}},[t(Yi,[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($,{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($,[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(dt,{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(V,{attrs:{title:e.$t("Timelapse.Frames").toString()}},[e._v(" "+e._s(e.framesCount)+" ")]),t(U,{staticClass:"my-2"}),t(V,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Timelapse.Enabled").toString(),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}):e._e(),t(V,{attrs:{title:e.$t("Timelapse.Autorender").toString(),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"mt-2 mb-4"}),t($,[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(B,{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($,[t(_,{staticClass:"col-4"},[t(Ee,{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(te,{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(te,{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(te,{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(te,{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(te,{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(te,{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(te,{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(ae),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)},yI=[];const Qv={};var CI=E(Zm,bI,yI,!1,$I,null,null,null);function $I(e){for(let s in Qv)this[s]=Qv[s]}const o$=function(){return CI.exports}();var xI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,SI=(e,s,t,r)=>{for(var i=r>1?void 0:r?wI(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&&xI(s,t,i),i};let qm=class extends M(O){};qm=SI([D({components:{TimelapseStatusPanel:o$,TimelapseFilesPanel:a$}})],qm);var PI=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,{staticClass:"col-12 col-md-8 pt-0 pt-md-3",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"2"}},[t(a$)],1),t(_,{staticClass:"col-12 col-md-4",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"1"}},[t(o$)],1)],1)},DI=[];const e_={};var TI=E(qm,PI,DI,!1,MI,null,null,null);function MI(e){for(let s in e_)this[s]=e_[s]}const EI=function(){return TI.exports}();var Xm={exports:{}};const OI="2.0.0",l$=256,LI=Number.MAX_SAFE_INTEGER||9007199254740991,AI=16,kI=l$-6,FI=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Au={MAX_LENGTH:l$,MAX_SAFE_COMPONENT_LENGTH:AI,MAX_SAFE_BUILD_LENGTH:kI,MAX_SAFE_INTEGER:LI,RELEASE_TYPES:FI,SEMVER_SPEC_VERSION:OI,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const RI=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var ku=RI;(function(e,s){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Au,n=ku;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-]",m=[["\\s",1],["\\d",i],[d,r]],h=f=>{for(const[b,C]of m)f=f.split("".concat(b,"*")).join("".concat(b,"{0,").concat(C,"}")).split("".concat(b,"+")).join("".concat(b,"{1,").concat(C,"}"));return f},p=(f,b,C)=>{const S=h(b),L=u++;n(f,L,b),c[f]=L,l[L]=b,a[L]=new RegExp(b,C?"g":void 0),o[L]=new RegExp(S,C?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(d,"*")),p("MAINVERSION","(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")")),p("MAINVERSIONLOOSE","(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")")),p("PRERELEASEIDENTIFIER","(?:".concat(l[c.NUMERICIDENTIFIER],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),p("PRERELEASEIDENTIFIERLOOSE","(?:".concat(l[c.NUMERICIDENTIFIERLOOSE],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),p("PRERELEASE","(?:-(".concat(l[c.PRERELEASEIDENTIFIER],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIER],")*))")),p("PRERELEASELOOSE","(?:-?(".concat(l[c.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIERLOOSE],")*))")),p("BUILDIDENTIFIER","".concat(d,"+")),p("BUILD","(?:\\+(".concat(l[c.BUILDIDENTIFIER],"(?:\\.").concat(l[c.BUILDIDENTIFIER],")*))")),p("FULLPLAIN","v?".concat(l[c.MAINVERSION]).concat(l[c.PRERELEASE],"?").concat(l[c.BUILD],"?")),p("FULL","^".concat(l[c.FULLPLAIN],"$")),p("LOOSEPLAIN","[v=\\s]*".concat(l[c.MAINVERSIONLOOSE]).concat(l[c.PRERELEASELOOSE],"?").concat(l[c.BUILD],"?")),p("LOOSE","^".concat(l[c.LOOSEPLAIN],"$")),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(l[c.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(l[c.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:".concat(l[c.PRERELEASE],")?").concat(l[c.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(l[c.PRERELEASELOOSE],")?").concat(l[c.BUILD],"?")+")?)?"),p("XRANGE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAINLOOSE],"$")),p("COERCE","(^|[^\\d])(\\d{1,".concat(t,"})")+"(?:\\.(\\d{1,".concat(t,"}))?")+"(?:\\.(\\d{1,".concat(t,"}))?")+"(?:$|[^\\d])"),p("COERCERTL",l[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(l[c.LONETILDE],"\\s+"),!0),s.tildeTrimReplace="$1~",p("TILDE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(l[c.LONECARET],"\\s+"),!0),s.caretTrimReplace="$1^",p("CARET","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(l[c.GTLT],"\\s*(").concat(l[c.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],"|").concat(l[c.XRANGEPLAIN],")"),!0),s.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(l[c.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Xm,Xm.exports);var qa=Xm.exports;const jI=Object.freeze({loose:!0}),HI=Object.freeze({}),II=e=>e?typeof e!="object"?jI:e:HI;var ff=II;const t_=/^[0-9]+$/,c$=(e,s)=>{const t=t_.test(e),r=t_.test(s);return t&&r&&(e=+e,s=+s),e===s?0:t&&!r?-1:r&&!t?1:ec$(s,e);var u$={compareIdentifiers:c$,rcompareIdentifiers:NI};const ho=ku,{MAX_LENGTH:s_,MAX_SAFE_INTEGER:po}=Au,{safeRe:r_,t:i_}=qa,VI=ff,{compareIdentifiers:ni}=u$;let UI=class vs{constructor(s,t){if(t=VI(t),s instanceof vs){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>s_)throw new TypeError("version is longer than ".concat(s_," characters"));ho("SemVer",s,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=s.trim().match(t.loose?r_[i_.LOOSE]:r_[i_.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>po||this.major<0)throw new TypeError("Invalid major version");if(this.minor>po||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>po||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]),ni(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 St=UI;const n_=St,BI=(e,s,t=!1)=>{if(e instanceof n_)return e;try{return new n_(e,s)}catch(r){if(!t)return null;throw r}};var ln=BI;const WI=ln,GI=(e,s)=>{const t=WI(e,s);return t?t.version:null};var zI=GI;const ZI=ln,qI=(e,s)=>{const t=ZI(e.trim().replace(/^[=v]+/,""),s);return t?t.version:null};var XI=qI;const a_=St,YI=(e,s,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new a_(e instanceof a_?e.version:e,t).inc(s,r,i).version}catch{return null}};var JI=YI;const o_=ln,KI=(e,s)=>{const t=o_(e,null,!0),r=o_(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 QI=KI;const eN=St,tN=(e,s)=>new eN(e,s).major;var sN=tN;const rN=St,iN=(e,s)=>new rN(e,s).minor;var nN=iN;const aN=St,oN=(e,s)=>new aN(e,s).patch;var lN=oN;const cN=ln,uN=(e,s)=>{const t=cN(e,s);return t&&t.prerelease.length?t.prerelease:null};var dN=uN;const l_=St,mN=(e,s,t)=>new l_(e,t).compare(new l_(s,t));var ds=mN;const hN=ds,pN=(e,s,t)=>hN(s,e,t);var fN=pN;const gN=ds,vN=(e,s)=>gN(e,s,!0);var _N=vN;const c_=St,bN=(e,s,t)=>{const r=new c_(e,t),i=new c_(s,t);return r.compare(i)||r.compareBuild(i)};var gf=bN;const yN=gf,CN=(e,s)=>e.sort((t,r)=>yN(t,r,s));var $N=CN;const xN=gf,wN=(e,s)=>e.sort((t,r)=>xN(r,t,s));var SN=wN;const PN=ds,DN=(e,s,t)=>PN(e,s,t)>0;var Fu=DN;const TN=ds,MN=(e,s,t)=>TN(e,s,t)<0;var vf=MN;const EN=ds,ON=(e,s,t)=>EN(e,s,t)===0;var d$=ON;const LN=ds,AN=(e,s,t)=>LN(e,s,t)!==0;var m$=AN;const kN=ds,FN=(e,s,t)=>kN(e,s,t)>=0;var _f=FN;const RN=ds,jN=(e,s,t)=>RN(e,s,t)<=0;var bf=jN;const HN=d$,IN=m$,NN=Fu,VN=_f,UN=vf,BN=bf,WN=(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 HN(e,t,r);case"!=":return IN(e,t,r);case">":return NN(e,t,r);case">=":return VN(e,t,r);case"<":return UN(e,t,r);case"<=":return BN(e,t,r);default:throw new TypeError("Invalid operator: ".concat(s))}};var h$=WN;const GN=St,zN=ln,{safeRe:fo,t:go}=qa,ZN=(e,s)=>{if(e instanceof GN)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(fo[go.COERCE]);else{let r;for(;(r=fo[go.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||r.index+r[0].length!==t.index+t[0].length)&&(t=r),fo[go.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;fo[go.COERCERTL].lastIndex=-1}return t===null?null:zN("".concat(t[2],".").concat(t[3]||"0",".").concat(t[4]||"0"),s)};var qN=ZN,Pd,u_;function XN(){return u_||(u_=1,Pd=function(e){e.prototype[Symbol.iterator]=function*(){for(let s=this.head;s;s=s.next)yield s.value}}),Pd}var YN=Le;Le.Node=Wr;Le.create=Le;function Le(e){var s=this;if(s instanceof Le||(s=new Le),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};Le.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};Le.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};Le.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};Le.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 Le;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};Le.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 tV{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[Sr]=s.max||1/0;const t=s.length||Dd;if(this[ai]=typeof t!="function"?Dd:t,this[In]=s.stale||!1,s.maxAge&&typeof s.maxAge!="number")throw new TypeError("maxAge must be a number");this[Or]=s.maxAge||0,this[Os]=s.dispose,this[d_]=s.noDisposeOnSet||!1,this[p$]=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[Sr]=s||1/0,bn(this)}get max(){return this[Sr]}set allowStale(s){this[In]=!!s}get allowStale(){return this[In]}set maxAge(s){if(typeof s!="number")throw new TypeError("maxAge must be a non-negative number");this[Or]=s,bn(this)}get maxAge(){return this[Or]}set lengthCalculator(s){typeof s!="function"&&(s=Dd),s!==this[ai]&&(this[ai]=s,this[As]=0,this[nt].forEach(t=>{t.length=this[ai](t.value,t.key),this[As]+=t.length})),bn(this)}get lengthCalculator(){return this[ai]}get length(){return this[As]}get itemCount(){return this[nt].length}rforEach(s,t){t=t||this;for(let r=this[nt].tail;r!==null;){const i=r.prev;m_(this,s,r,t),r=i}}forEach(s,t){t=t||this;for(let r=this[nt].head;r!==null;){const i=r.next;m_(this,s,r,t),r=i}}keys(){return this[nt].toArray().map(s=>s.key)}values(){return this[nt].toArray().map(s=>s.value)}reset(){this[Os]&&this[nt]&&this[nt].length&&this[nt].forEach(s=>this[Os](s.key,s.value)),this[ts]=new Map,this[nt]=new eV,this[As]=0}dump(){return this[nt].map(s=>Hl(this,s)?!1:{k:s.key,v:s.value,e:s.now+(s.maxAge||0)}).toArray().filter(s=>s)}dumpLru(){return this[nt]}set(s,t,r){if(r=r||this[Or],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,n=this[ai](t,s);if(this[ts].has(s)){if(n>this[Sr])return vi(this,this[ts].get(s)),!1;const l=this[ts].get(s).value;return this[Os]&&(this[d_]||this[Os](s,l.value)),l.now=i,l.maxAge=r,l.value=t,this[As]+=n-l.length,l.length=n,this.get(s),bn(this),!0}const a=new sV(s,t,n,i,r);return a.length>this[Sr]?(this[Os]&&this[Os](s,t),!1):(this[As]+=a.length,this[nt].unshift(a),this[ts].set(s,this[nt].head),bn(this),!0)}has(s){if(!this[ts].has(s))return!1;const t=this[ts].get(s).value;return!Hl(this,t)}get(s){return Td(this,s,!0)}peek(s){return Td(this,s,!1)}pop(){const s=this[nt].tail;return s?(vi(this,s),s.value):null}del(s){vi(this,this[ts].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[ts].forEach((s,t)=>Td(this,t,!1))}}const Td=(e,s,t)=>{const r=e[ts].get(s);if(r){const i=r.value;if(Hl(e,i)){if(vi(e,r),!e[In])return}else t&&(e[p$]&&(r.value.now=Date.now()),e[nt].unshiftNode(r));return i.value}},Hl=(e,s)=>{if(!s||!s.maxAge&&!e[Or])return!1;const t=Date.now()-s.now;return s.maxAge?t>s.maxAge:e[Or]&&t>e[Or]},bn=e=>{if(e[As]>e[Sr])for(let s=e[nt].tail;e[As]>e[Sr]&&s!==null;){const t=s.prev;vi(e,s),s=t}},vi=(e,s)=>{if(s){const t=s.value;e[Os]&&e[Os](t.key,t.value),e[As]-=t.length,e[ts].delete(t.key),e[nt].removeNode(s)}};class sV{constructor(s,t,r,i,n){this.key=s,this.value=t,this.length=r,this.now=i,this.maxAge=n||0}}const m_=(e,s,t,r)=>{let i=t.value;Hl(e,i)&&(vi(e,t),e[In]||(i=void 0)),i&&s.call(r,i.value,i.key,e)};var rV=tV,Md,h_;function ms(){if(h_)return Md;h_=1;class e{constructor(G,X){if(X=r(X),G instanceof e)return G.loose===!!X.loose&&G.includePrerelease===!!X.includePrerelease?G:new e(G.raw,X);if(G instanceof i)return this.raw=G.value,this.set=[[G]],this.format(),this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=G.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(Y=>this.parseRange(Y.trim())).filter(Y=>Y.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const Y=this.set[0];if(this.set=this.set.filter(ee=>!p(ee[0])),this.set.length===0)this.set=[Y];else if(this.set.length>1){for(const ee of this.set)if(ee.length===1&&f(ee[0])){this.set=[ee];break}}}this.format()}format(){return this.range=this.set.map(G=>G.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(G){const Y=((this.options.includePrerelease&&m)|(this.options.loose&&h))+":"+G,ee=t.get(Y);if(ee)return ee;const se=this.options.loose,F=se?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];G=G.replace(F,Z(this.options.includePrerelease)),n("hyphen replace",G),G=G.replace(o[l.COMPARATORTRIM],c),n("comparator trim",G),G=G.replace(o[l.TILDETRIM],u),n("tilde trim",G),G=G.replace(o[l.CARETTRIM],d),n("caret trim",G);let z=G.split(" ").map(K=>C(K,this.options)).join(" ").split(/\s+/).map(K=>W(K,this.options));se&&(z=z.filter(K=>(n("loose invalid filter",K,this.options),!!K.match(o[l.COMPARATORLOOSE])))),n("range list",z);const w=new Map,A=z.map(K=>new i(K,this.options));for(const K of A){if(p(K))return[K];w.set(K.value,K)}w.size>1&&w.has("")&&w.delete("");const H=[...w.values()];return t.set(Y,H),H}intersects(G,X){if(!(G instanceof e))throw new TypeError("a Range is required");return this.set.some(Y=>b(Y,X)&&G.set.some(ee=>b(ee,X)&&Y.every(se=>ee.every(F=>se.intersects(F,X)))))}test(G){if(!G)return!1;if(typeof G=="string")try{G=new a(G,this.options)}catch{return!1}for(let X=0;Xk.value==="<0.0.0-0",f=k=>k.value==="",b=(k,G)=>{let X=!0;const Y=k.slice();let ee=Y.pop();for(;X&&Y.length;)X=Y.every(se=>ee.intersects(se,G)),ee=Y.pop();return X},C=(k,G)=>(n("comp",k,G),k=R(k,G),n("caret",k),k=L(k,G),n("tildes",k),k=T(k,G),n("xrange",k),k=j(k,G),n("stars",k),k),S=k=>!k||k.toLowerCase()==="x"||k==="*",L=(k,G)=>k.trim().split(/\s+/).map(X=>N(X,G)).join(" "),N=(k,G)=>{const X=G.loose?o[l.TILDELOOSE]:o[l.TILDE];return k.replace(X,(Y,ee,se,F,z)=>{n("tilde",k,Y,ee,se,F,z);let w;return S(ee)?w="":S(se)?w=">=".concat(ee,".0.0 <").concat(+ee+1,".0.0-0"):S(F)?w=">=".concat(ee,".").concat(se,".0 <").concat(ee,".").concat(+se+1,".0-0"):z?(n("replaceTilde pr",z),w=">=".concat(ee,".").concat(se,".").concat(F,"-").concat(z," <").concat(ee,".").concat(+se+1,".0-0")):w=">=".concat(ee,".").concat(se,".").concat(F," <").concat(ee,".").concat(+se+1,".0-0"),n("tilde return",w),w})},R=(k,G)=>k.trim().split(/\s+/).map(X=>x(X,G)).join(" "),x=(k,G)=>{n("caret",k,G);const X=G.loose?o[l.CARETLOOSE]:o[l.CARET],Y=G.includePrerelease?"-0":"";return k.replace(X,(ee,se,F,z,w)=>{n("caret",k,ee,se,F,z,w);let A;return S(se)?A="":S(F)?A=">=".concat(se,".0.0").concat(Y," <").concat(+se+1,".0.0-0"):S(z)?se==="0"?A=">=".concat(se,".").concat(F,".0").concat(Y," <").concat(se,".").concat(+F+1,".0-0"):A=">=".concat(se,".").concat(F,".0").concat(Y," <").concat(+se+1,".0.0-0"):w?(n("replaceCaret pr",w),se==="0"?F==="0"?A=">=".concat(se,".").concat(F,".").concat(z,"-").concat(w," <").concat(se,".").concat(F,".").concat(+z+1,"-0"):A=">=".concat(se,".").concat(F,".").concat(z,"-").concat(w," <").concat(se,".").concat(+F+1,".0-0"):A=">=".concat(se,".").concat(F,".").concat(z,"-").concat(w," <").concat(+se+1,".0.0-0")):(n("no pr"),se==="0"?F==="0"?A=">=".concat(se,".").concat(F,".").concat(z).concat(Y," <").concat(se,".").concat(F,".").concat(+z+1,"-0"):A=">=".concat(se,".").concat(F,".").concat(z).concat(Y," <").concat(se,".").concat(+F+1,".0-0"):A=">=".concat(se,".").concat(F,".").concat(z," <").concat(+se+1,".0.0-0")),n("caret return",A),A})},T=(k,G)=>(n("replaceXRanges",k,G),k.split(/\s+/).map(X=>I(X,G)).join(" ")),I=(k,G)=>{k=k.trim();const X=G.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return k.replace(X,(Y,ee,se,F,z,w)=>{n("xRange",k,Y,ee,se,F,z,w);const A=S(se),H=A||S(F),K=H||S(z),le=K;return ee==="="&&le&&(ee=""),w=G.includePrerelease?"-0":"",A?ee===">"||ee==="<"?Y="<0.0.0-0":Y="*":ee&&le?(H&&(F=0),z=0,ee===">"?(ee=">=",H?(se=+se+1,F=0,z=0):(F=+F+1,z=0)):ee==="<="&&(ee="<",H?se=+se+1:F=+F+1),ee==="<"&&(w="-0"),Y="".concat(ee+se,".").concat(F,".").concat(z).concat(w)):H?Y=">=".concat(se,".0.0").concat(w," <").concat(+se+1,".0.0-0"):K&&(Y=">=".concat(se,".").concat(F,".0").concat(w," <").concat(se,".").concat(+F+1,".0-0")),n("xRange return",Y),Y})},j=(k,G)=>(n("replaceStars",k,G),k.trim().replace(o[l.STAR],"")),W=(k,G)=>(n("replaceGTE0",k,G),k.trim().replace(o[G.includePrerelease?l.GTE0PRE:l.GTE0],"")),Z=k=>(G,X,Y,ee,se,F,z,w,A,H,K,le,he)=>(S(Y)?X="":S(ee)?X=">=".concat(Y,".0.0").concat(k?"-0":""):S(se)?X=">=".concat(Y,".").concat(ee,".0").concat(k?"-0":""):F?X=">=".concat(X):X=">=".concat(X).concat(k?"-0":""),S(A)?w="":S(H)?w="<".concat(+A+1,".0.0-0"):S(K)?w="<".concat(A,".").concat(+H+1,".0-0"):le?w="<=".concat(A,".").concat(H,".").concat(K,"-").concat(le):k?w="<".concat(A,".").concat(H,".").concat(+K+1,"-0"):w="<=".concat(w),"".concat(X," ").concat(w).trim()),re=(k,G,X)=>{for(let Y=0;Y0){const ee=k[Y].semver;if(ee.major===G.major&&ee.minor===G.minor&&ee.patch===G.patch)return!0}return!1}return!0};return Md}var Ed,p_;function Ru(){if(p_)return Ed;p_=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],m=u.match(d);if(!m)throw new TypeError("Invalid comparator: ".concat(u));this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new o(m[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(">")))}}Ed=s;const t=ff,{safeRe:r,t:i}=qa,n=h$,a=ku,o=St,l=ms();return Ed}const iV=ms(),nV=(e,s,t)=>{try{s=new iV(s,t)}catch{return!1}return s.test(e)};var ju=nV;const aV=ms(),oV=(e,s)=>new aV(e,s).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" "));var lV=oV;const cV=St,uV=ms(),dV=(e,s,t)=>{let r=null,i=null,n=null;try{n=new uV(s,t)}catch{return null}return e.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new cV(r,t))}),r};var mV=dV;const hV=St,pV=ms(),fV=(e,s,t)=>{let r=null,i=null,n=null;try{n=new pV(s,t)}catch{return null}return e.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new hV(r,t))}),r};var gV=fV;const Od=St,vV=ms(),f_=Fu,_V=(e,s)=>{e=new vV(e,s);let t=new Od("0.0.0");if(e.test(t)||(t=new Od("0.0.0-0"),e.test(t)))return t;t=null;for(let r=0;r{const o=new Od(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||f_(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(a.operator))}}),n&&(!t||f_(t,n))&&(t=n)}return t&&e.test(t)?t:null};var bV=_V;const yV=ms(),CV=(e,s)=>{try{return new yV(e,s).range||"*"}catch{return null}};var $V=CV;const xV=St,f$=Ru(),{ANY:wV}=f$,SV=ms(),PV=ju,g_=Fu,v_=vf,DV=bf,TV=_f,MV=(e,s,t,r)=>{e=new xV(e,r),s=new SV(s,r);let i,n,a,o,l;switch(t){case">":i=g_,n=DV,a=v_,o=">",l=">=";break;case"<":i=v_,n=TV,a=g_,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(PV(e,s,r))return!1;for(let c=0;c{h.semver===wV&&(h=new f$(">=0.0.0")),d=d||h,m=m||h,i(h.semver,d.semver,r)?d=h:a(h.semver,m.semver,r)&&(m=h)}),d.operator===o||d.operator===l||(!m.operator||m.operator===o)&&n(e,m.semver))return!1;if(m.operator===l&&a(e,m.semver))return!1}return!0};var yf=MV;const EV=yf,OV=(e,s,t)=>EV(e,s,">",t);var LV=OV;const AV=yf,kV=(e,s,t)=>AV(e,s,"<",t);var FV=kV;const __=ms(),RV=(e,s,t)=>(e=new __(e,t),s=new __(s,t),e.intersects(s,t));var jV=RV;const HV=ju,IV=ds;var NV=(e,s,t)=>{const r=[];let i=null,n=null;const a=e.sort((u,d)=>IV(u,d,t));for(const u of a)HV(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 b_(e,t),s=new b_(s,t);let r=!1;e:for(const i of e.set){for(const n of s.set){const a=BV(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},UV=[new Cf(">=0.0.0-0")],y_=[new Cf(">=0.0.0")],BV=(e,s,t)=>{if(e===s)return!0;if(e.length===1&&e[0].semver===Ld){if(s.length===1&&s[0].semver===Ld)return!0;t.includePrerelease?e=UV:e=y_}if(s.length===1&&s[0].semver===Ld){if(t.includePrerelease)return!0;s=y_}const r=new Set;let i,n;for(const h of e)h.operator===">"||h.operator===">="?i=C_(i,h,t):h.operator==="<"||h.operator==="<="?n=$_(n,h,t):r.add(h.semver);if(r.size>1)return null;let a;if(i&&n){if(a=$f(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(const h of r){if(i&&!yn(h,String(i),t)||n&&!yn(h,String(n),t))return null;for(const p of s)if(!yn(h,String(p),t))return!1;return!0}let o,l,c,u,d=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,m=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 h of s){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(m&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===m.major&&h.semver.minor===m.minor&&h.semver.patch===m.patch&&(m=!1),h.operator===">"||h.operator===">="){if(o=C_(i,h,t),o===h&&o!==i)return!1}else if(i.operator===">="&&!yn(i.semver,String(h),t))return!1}if(n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(l=$_(n,h,t),l===h&&l!==n)return!1}else if(n.operator==="<="&&!yn(n.semver,String(h),t))return!1}if(!h.operator&&(n||i)&&a!==0)return!1}return!(i&&c&&!n&&a!==0||n&&u&&!i&&a!==0||m||d)},C_=(e,s,t)=>{if(!e)return s;const r=$f(e.semver,s.semver,t);return r>0?e:r<0||s.operator===">"&&e.operator===">="?s:e},$_=(e,s,t)=>{if(!e)return s;const r=$f(e.semver,s.semver,t);return r<0?e:r>0||s.operator==="<"&&e.operator==="<="?s:e};var WV=VV;const Ad=qa,x_=Au,GV=St,w_=u$,zV=ln,ZV=zI,qV=XI,XV=JI,YV=QI,JV=sN,KV=nN,QV=lN,eU=dN,tU=ds,sU=fN,rU=_N,iU=gf,nU=$N,aU=SN,oU=Fu,lU=vf,cU=d$,uU=m$,dU=_f,mU=bf,hU=h$,pU=qN,fU=Ru(),gU=ms(),vU=ju,_U=lV,bU=mV,yU=gV,CU=bV,$U=$V,xU=yf,wU=LV,SU=FV,PU=jV,DU=NV,TU=WV;var MU={parse:zV,valid:ZV,clean:qV,inc:XV,diff:YV,major:JV,minor:KV,patch:QV,prerelease:eU,compare:tU,rcompare:sU,compareLoose:rU,compareBuild:iU,sort:nU,rsort:aU,gt:oU,lt:lU,eq:cU,neq:uU,gte:dU,lte:mU,cmp:hU,coerce:pU,Comparator:fU,Range:gU,satisfies:vU,toComparators:_U,maxSatisfying:bU,minSatisfying:yU,minVersion:CU,validRange:$U,outside:xU,gtr:wU,ltr:SU,intersects:PU,simplifyRange:DU,subset:TU,SemVer:GV,re:Ad.re,src:Ad.src,tokens:Ad.t,SEMVER_SPEC_VERSION:x_.SEMVER_SPEC_VERSION,RELEASE_TYPES:x_.RELEASE_TYPES,compareIdentifiers:w_.compareIdentifiers,rcompareIdentifiers:w_.rcompareIdentifiers};const rt=Ji(MU);var EU=Object.defineProperty,OU=Object.getOwnPropertyDescriptor,xf=(e,s,t,r)=>{for(var i=r>1?void 0:r?OU(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&&EU(s,t,i),i};let ua=class extends M(O){constructor(){super(...arguments),this.mdiDotsHorizontal=ST,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)}};xf([P({required:!0})],ua.prototype,"commit",2);xf([P({required:!0})],ua.prototype,"repo",2);ua=xf([D({components:{Panel:B}})],ua);var LU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("li",{staticClass:"commit px-3 py-2"},[t($,{staticClass:"flex-column flex-sm-row"},[t(_,[t("h4",{staticClass:"subtitle-2 text--white mb-0"},[e._v(" "+e._s(e.title)+" "),t(as,{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-0 pt-sm-4"},[t(as,{attrs:{outlined:"",label:"",small:"",href:e.commitHref,target:"_blank"}},[e._v(" "+e._s(e.commitShortSha)+" ")])],1)],1)],1)},AU=[];const S_={};var kU=E(ua,LU,AU,!1,FU,"f0d97490",null,null);function FU(e){for(let s in S_)this[s]=S_[s]}const g$=function(){return kU.exports}();var RU=Object.defineProperty,jU=Object.getOwnPropertyDescriptor,wf=(e,s,t,r)=>{for(var i=r>1?void 0:r?jU(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&&RU(s,t,i),i};let da=class extends M(O){get groupedCommitsDate(){return new Date(this.groupedCommits.date).toLocaleDateString(this.browserLocale,{year:"numeric",month:"short",day:"numeric"})}};wf([P({required:!0})],da.prototype,"groupedCommits",2);wf([P({required:!0})],da.prototype,"repo",2);da=wf([D({components:{Panel:B,GitCommitsListDayCommit:g$}})],da);var HU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(Vn,{staticClass:"git-commit-list-day",attrs:{small:""}},[t($,{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(g$,{key:r.sha,attrs:{commit:r,repo:e.repo}})}),1)])],1)],1)],1)},IU=[];const P_={};var NU=E(da,HU,IU,!1,VU,"0afc8caa",null,null);function VU(e){for(let s in P_)this[s]=P_[s]}const Xa=function(){return NU.exports}();var UU=Object.defineProperty,BU=Object.getOwnPropertyDescriptor,Sf=(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&&UU(s,t,i),i};let ma=class extends M(O){constructor(){super(...arguments),this.mdiUpdate=Ia,this.mdiCloseThick=pe}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")}get overlayScrollbarsStyle(){return this.isMobile?{height:"calc(100vh - 48px)"}:{height:"400px"}}get timelineClassName(){return this.isMobile?["groupedCommits","mobile"]:["groupedCommits"]}closeDialog(){this.$emit("close-dialog")}};Sf([P({required:!0})],ma.prototype,"boolShowDialog",2);Sf([P({required:!0})],ma.prototype,"repo",2);ma=Sf([D({components:{GitCommitsListDay:Xa,Panel:B}})],ma);var WU=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{persistent:"","max-width":800,fullscreen:e.isMobile},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(B,{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",{style:e.overlayScrollbarsStyle,attrs:{options:{overflowBehavior:{x:"hidden"}}}},[t(ly,{class:e.timelineClassName,staticStyle:{"min-height":"100%"},attrs:{"align-top":"",dense:""}},[e._l(e.groupedCommits,function(r){return t(Xa,{key:r.date.getTime(),attrs:{repo:e.repo,"grouped-commits":r}})}),e.displayFullHistoryWaring?t(Vn,{staticClass:"git-commit-list-day git-commit-list-warning",attrs:{small:""}},[t($,{staticClass:"pt-0"},[t(_,{staticClass:"pr-12"},[t(it,{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)},GU=[];const D_={};var zU=E(ma,WU,GU,!1,ZU,"170941d1",null,null);function ZU(e){for(let s in D_)this[s]=D_[s]}const Pf=function(){return zU.exports}();var qU=Object.defineProperty,XU=Object.getOwnPropertyDescriptor,Df=(e,s,t,r)=>{for(var i=r>1?void 0:r?XU(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&&qU(s,t,i),i};let ha=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiAlertCircle=Cy,this.mdiEye=PT,this.mdiOpenInNew=Xy}get name(){var e,s;return(s=(e=this.repo)==null?void 0:e.name)!=null?s:"UNKNOWN"}get formatName(){return jr(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")}};Df([P({required:!0})],ha.prototype,"repo",2);Df([P({required:!1,default:!1})],ha.prototype,"boolTitle",2);ha=Df([D({components:{GitCommitsListDay:Xa,Panel:B}})],ha);var YU=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r(it,{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)},JU=[];const T_={};var KU=E(ha,YU,JU,!1,QU,null,null,null);function QU(e){for(let s in T_)this[s]=T_[s]}const Hu=function(){return KU.exports}();var eB=Object.defineProperty,tB=Object.getOwnPropertyDescriptor,Tf=(e,s,t,r)=>{for(var i=r>1?void 0:r?tB(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&&eB(s,t,i),i};let pa=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiProgressQuestion=Qy,this.checkboxUpdateQuestion=!1}doUpdate(){this.$emit("do-update")}openCommitHistory(){this.$emit("open-commit-history")}closeDialog(){this.$emit("close-dialog")}};Tf([P({required:!0})],pa.prototype,"boolShowDialog",2);Tf([P({required:!0})],pa.prototype,"repo",2);pa=Tf([D({components:{GitCommitsListDay:Xa,Panel:B,UpdateHintAlert:Hu}})],pa);var sB=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(B,{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($,[t(_,[t(Hu,{attrs:{repo:e.repo},on:{"open-commit-history":e.openCommitHistory}}),t("div",[t(_e,{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(U),t(ne,[t(ae),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)},rB=[];const M_={};var iB=E(pa,sB,rB,!1,nB,null,null,null);function nB(e){for(let s in M_)this[s]=M_[s]}const v$=function(){return iB.exports}();var aB=Object.defineProperty,oB=Object.getOwnPropertyDescriptor,_$=(e,s,t,r)=>{for(var i=r>1?void 0:r?oB(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&&aB(s,t,i),i};let Il=class extends M(O){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiMenuDown=fr,this.mdiReload=a3,this.mdiCloseCircle=zo,this.mdiUpdate=Ia,this.mdiInformationOutline=Ny,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 rt.valid(s)?s:null}get remoteVersion(){var t;const s=(t=this.repo.remote_version)!=null?t:"?";return rt.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&&rt.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.type==="web"?!this.webUpdatable:this.commitsBehind.length===0}get btnIcon(){if(this.isDetached||!this.isValid||this.isCorrupt||this.isDirty)return zo;if(this.type==="web"){if(this.webUpdatable)return Zo;if(this.localVersion===null||this.remoteVersion===null)return Hy}return this.type==="git_repo"&&this.commitsBehind.length?Zo:Py}get btnColor(){return this.isCorrupt||this.isDetached||this.isDirty||!this.isValid?"orange":this.type==="web"&&this.webUpdatable||this.type==="git_repo"&&this.commitsBehind.length?"primary":"green"}get btnText(){if(this.isCorrupt)return this.$t("Machine.UpdatePanel.Corrupt");if(this.isDetached)return this.$t("Machine.UpdatePanel.Detached");if(this.isDirty)return this.$t("Machine.UpdatePanel.Dirty");if(!this.isValid)return this.$t("Machine.UpdatePanel.Invalid");if(this.type==="web"){if(this.webUpdatable)return this.$t("Machine.UpdatePanel.Update");if(this.localVersion===null||this.remoteVersion===null)return this.$t("Machine.UpdatePanel.Unknown")}return this.type==="git_repo"&&this.commitsBehind.length?this.$t("Machine.UpdatePanel.Update"):this.$t("Machine.UpdatePanel.UpToDate")}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:rt.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}};_$([P({required:!0})],Il.prototype,"repo",2);Il=_$([D({components:{GitCommitsList:Pf,UpdateHint:v$}})],Il);var lB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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(as,{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(as,{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(as,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(J,{on:{click:function(r){return e.doRecovery(!1)}}},[t(Is,{staticClass:"mr-0 pt-1"},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(vt,[t(Ge,[e._v(e._s(e.$t("Machine.UpdatePanel.SoftRecovery")))])],1)],1),t(J,{attrs:{disabled:!e.existsRecoveryUrl},on:{click:function(r){return e.doRecovery(!0)}}},[t(Is,{staticClass:"mr-0 pt-1"},[t(v,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(vt,[t(Ge,[e._v(e._s(e.$t("Machine.UpdatePanel.HardRecovery")))])],1)],1)],1)],1)]],2)],1),e.warnings.length?t($,{staticClass:"mt-0"},[t(_,{staticClass:"px-6 pt-0"},e._l(e.warnings,function(r,i){return t(it,{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($,{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(it,{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(Pf,{attrs:{"bool-show-dialog":e.boolShowCommitList,repo:e.repo},on:{"close-dialog":e.closeCommitList}}):e._e(),t(v$,{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)},cB=[];const E_={};var uB=E(Il,lB,cB,!1,dB,null,null,null);function dB(e){for(let s in E_)this[s]=E_[s]}const mB=function(){return uB.exports}();var hB=Object.defineProperty,pB=Object.getOwnPropertyDescriptor,fB=(e,s,t,r)=>{for(var i=r>1?void 0:r?pB(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&&hB(s,t,i),i};let Ym=class extends M(O){constructor(){super(...arguments),this.mdiInformation=kt,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?Zo:Py}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}};Ym=fB([D],Ym);var gB=Object.defineProperty,vB=Object.getOwnPropertyDescriptor,Mf=(e,s,t,r)=>{for(var i=r>1?void 0:r?vB(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&&gB(s,t,i),i};let fa=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiPackageVariantClosed=KT}closeDialog(){this.$emit("close-dialog")}};Mf([P({required:!0})],fa.prototype,"boolShowDialog",2);Mf([P({required:!0})],fa.prototype,"packagesList",2);fa=Mf([D({components:{Panel:B}})],fa);var _B=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(B,{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($,[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(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Close")))])],1)],1)],1)},bB=[];const O_={};var yB=E(fa,_B,bB,!1,CB,"61fb1dc8",null,null);function CB(e){for(let s in O_)this[s]=O_[s]}const $B=function(){return yB.exports}();var xB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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(as,{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($B,{attrs:{"bool-show-dialog":e.boolShowPackageList,"packages-list":e.package_list},on:{"close-dialog":e.closePackagesList}})],1)},wB=[];const L_={};var SB=E(Ym,xB,wB,!1,PB,null,null,null);function PB(e){for(let s in L_)this[s]=L_[s]}const DB=function(){return SB.exports}();var TB=Object.defineProperty,MB=Object.getOwnPropertyDescriptor,b$=(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&&TB(s,t,i),i};let Nl=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiProgressQuestion=Qy,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"&&rt.valid((r=e.data)==null?void 0:r.remote_version)&&rt.valid((i=e.data)==null?void 0:i.version)&&rt.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")}};b$([P({required:!0})],Nl.prototype,"boolShowDialog",2);Nl=b$([D({components:{GitCommitsListDay:Xa,Panel:B,UpdateHintAlert:Hu}})],Nl);var EB=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(B,{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($,[t(_,[e._l(e.filteredModules,function(r){return t(Hu,{key:r.name,attrs:{repo:r.data,"bool-title":!0},on:{"open-commit-history":function(i){return e.openCommitHistory(r.data)}}})}),t("div",[t(_e,{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(U),t(ne,[t(ae),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(Pf,{attrs:{"bool-show-dialog":e.boolShowCommitHistory,repo:e.showCommitsRepo},on:{"close-dialog":function(r){e.boolShowCommitHistory=!1}}})],1)},OB=[];const A_={};var LB=E(Nl,EB,OB,!1,AB,null,null,null);function AB(e){for(let s in A_)this[s]=A_[s]}const y$=function(){return LB.exports}();var kB=Object.defineProperty,FB=Object.getOwnPropertyDescriptor,RB=(e,s,t,r)=>{for(var i=r>1?void 0:r?FB(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&&kB(s,t,i),i};let Jm=class extends M(O){constructor(){super(...arguments),this.mdiProgressUpload=Zo,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",{})}};Jm=RB([D({components:{UpdateHintAll:y$}})],Jm);var jB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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(y$,{attrs:{"bool-show-dialog":e.boolShowDialog},on:{"close-dialog":function(r){e.boolShowDialog=!1},"update-all":e.updateAll}})],1)},HB=[];const k_={};var IB=E(Jm,jB,HB,!1,NB,null,null,null);function NB(e){for(let s in k_)this[s]=k_[s]}const VB=function(){return IB.exports}();var UB=Object.defineProperty,BB=Object.getOwnPropertyDescriptor,WB=(e,s,t,r)=>{for(var i=r>1?void 0:r?BB(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&&UB(s,t,i),i};let Km=class extends M(O){constructor(){super(...arguments),this.mdiRefresh=tn,this.mdiInformation=kt,this.mdiCloseThick=pe,this.mdiUpdate=Ia}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"&&rt.valid((i=s.data)==null?void 0:i.remote_version)&&rt.valid((n=s.data)==null?void 0:n.version)&&rt.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"})}};Km=WB([D({components:{Panel:B,UpdatePanelEntry:mB,UpdatePanelEntrySystem:DB,UpdatePanelEntryAll:VB}})],Km);var GB=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.enableUpdateManager?t(B,{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(de,{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(U,{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(U,{staticClass:"my-0"}):e._e(),t("update-panel-entry-system")]:e._e(),e.showUpdateAll?[t(U,{staticClass:"mb-0 mt-2 border-top-2"}),t("update-panel-entry-all")]:e._e()]:[t($,{staticClass:"mt-0 mb-0"},[t(_,{staticClass:"px-6"},[t(it,{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)},zB=[];const F_={};var ZB=E(Km,GB,zB,!1,qB,"8e04f428",null,null);function qB(e){for(let s in F_)this[s]=F_[s]}const C$=function(){return ZB.exports}();var XB=Object.defineProperty,YB=Object.getOwnPropertyDescriptor,$$=(e,s,t,r)=>{for(var i=r>1?void 0:r?YB(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&&XB(s,t,i),i};let Vl=class extends M(O){constructor(){super(...arguments),this.mdiDownload=Oy}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)}};$$([P({type:String,required:!0})],Vl.prototype,"name",2);Vl=$$([D({components:{Panel:B}})],Vl);var JB=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()},KB=[];const R_={};var QB=E(Vl,JB,KB,!1,eW,null,null,null);function eW(e){for(let s in R_)this[s]=R_[s]}const Ef=function(){return QB.exports}();var tW=Object.defineProperty,sW=Object.getOwnPropertyDescriptor,rW=(e,s,t,r)=>{for(var i=r>1?void 0:r?sW(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&&tW(s,t,i),i};let Qm=class extends M(O){constructor(){super(...arguments),this.mdiFileDocumentEdit=TT,this.mdiFileSyncOutline=Fy,this.genericLogfiles=XD,this.showRolloverDialog=!1}};Qm=rW([D({components:{LogfilesPanelGenericLog:Ef,Panel:B}})],Qm);var iW=Object.defineProperty,nW=Object.getOwnPropertyDescriptor,Of=(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&&iW(s,t,i),i};let ga=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiFileSyncOutline=Fy,this.rolloverLogfiles=YD,this.capitalize=jr,this.selectedRolloverLogs=[]}get loadingRolloverLogs(){return this.loadings.filter(e=>e==null?void 0: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")}};Of([P({type:Boolean,default:!1})],ga.prototype,"show",2);Of([me("loadingRolloverLogs")],ga.prototype,"loadingRolloverLogsChanged",1);ga=Of([D({components:{LogfilesPanelGenericLog:Ef,Panel:B}})],ga);var aW=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(B,{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($,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Machine.LogfilesPanel.RolloverDescription")))])])],1),t($,{staticClass:"mt-0"},[t(_,e._l(e.rolloverLogfiles,function(r){return t(_e,{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(ae),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)},oW=[];const j_={};var lW=E(ga,aW,oW,!1,cW,null,null,null);function cW(e){for(let s in j_)this[s]=j_[s]}const uW=function(){return lW.exports}();var dW=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(B,{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(de,{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($,{staticClass:"pt-3"},e._l(e.genericLogfiles,function(r){return t(Ef,{key:r,attrs:{name:r}})}),1)],1)],1),t(uW,{attrs:{show:e.showRolloverDialog},on:{"close-dialog":function(r){e.showRolloverDialog=!1}}})],1)},mW=[];const H_={};var hW=E(Qm,dW,mW,!1,pW,null,null,null);function pW(e){for(let s in H_)this[s]=H_[s]}const x$=function(){return hW.exports}();var fW=Object.defineProperty,gW=Object.getOwnPropertyDescriptor,vW=(e,s,t,r)=>{for(var i=r>1?void 0:r?gW(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&&fW(s,t,i),i};let eh=class extends M(O){constructor(){super(...arguments),this.mdiArrowExpandVertical=sT,this.mdiSync=r2,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"}))}};eh=vW([D({components:{Panel:B}})],eh);var _W=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{attrs:{title:e.$t("Machine.EndstopPanel.Endstops"),icon:e.mdiArrowExpandVertical,"card-class":"machine-endstop-panel",collapsible:!0}},[t(q,{staticClass:"pb-0"},[t(Ae,{attrs:{"px-0":"","py-0":""}},[Object.keys(e.endstops).length?[e._l(Object.keys(e.endstops),function(r){return t($,{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(as,{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($,[t(_,{staticClass:"py-1"},[t("label",{staticClass:"mt-1 d-inline-block"},[e._v("Probe")]),t(as,{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($,[t(_,[t("p",[e._v(e._s(e.$t("Machine.EndstopPanel.EndstopInfo")))])])],1)]],2)],1),t(ne,{staticClass:"pt-3"},[t(ae),t(g,{attrs:{icon:"",loading:e.loadings.includes("queryEndstops")},on:{click:e.syncEndstops}},[t(v,[e._v(e._s(e.mdiSync))])],1)],1)],1)},bW=[];const I_={};var yW=E(eh,_W,bW,!1,CW,null,null,null);function CW(e){for(let s in I_)this[s]=I_[s]}const w$=function(){return yW.exports}();function S$(e,s){return function(){return e.apply(s,arguments)}}const{toString:$W}=Object.prototype,{getPrototypeOf:Lf}=Object,Iu=(e=>s=>{const t=$W.call(s);return e[t]||(e[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ts=e=>(e=e.toLowerCase(),s=>Iu(s)===e),Nu=e=>s=>typeof s===e,{isArray:cn}=Array,va=Nu("undefined");function xW(e){return e!==null&&!va(e)&&e.constructor!==null&&!va(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const P$=Ts("ArrayBuffer");function wW(e){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(e):s=e&&e.buffer&&P$(e.buffer),s}const SW=Nu("string"),zt=Nu("function"),D$=Nu("number"),Vu=e=>e!==null&&typeof e=="object",PW=e=>e===!0||e===!1,Eo=e=>{if(Iu(e)!=="object")return!1;const s=Lf(e);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},DW=Ts("Date"),TW=Ts("File"),MW=Ts("Blob"),EW=Ts("FileList"),OW=e=>Vu(e)&&zt(e.pipe),LW=e=>{let s;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((s=Iu(e))==="formdata"||s==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},AW=Ts("URLSearchParams"),kW=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ya(e,s,{allOwnKeys:t=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),cn(e))for(r=0,i=e.length;r0;)if(i=t[r],s===i.toLowerCase())return i;return null}const M$=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),E$=e=>!va(e)&&e!==M$;function th(){const{caseless:e}=E$(this)&&this||{},s={},t=(r,i)=>{const n=e&&T$(s,i)||i;Eo(s[n])&&Eo(r)?s[n]=th(s[n],r):Eo(r)?s[n]=th({},r):cn(r)?s[n]=r.slice():s[n]=r};for(let r=0,i=arguments.length;r(Ya(s,(i,n)=>{t&&zt(i)?e[n]=S$(i,t):e[n]=i},{allOwnKeys:r}),e),RW=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jW=(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)},HW=(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&&Lf(e)}while(e&&(!t||t(e,s))&&e!==Object.prototype);return s},IW=(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},NW=e=>{if(!e)return null;if(cn(e))return e;let s=e.length;if(!D$(s))return null;const t=new Array(s);for(;s-- >0;)t[s]=e[s];return t},VW=(e=>s=>e&&s instanceof e)(typeof Uint8Array<"u"&&Lf(Uint8Array)),UW=(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])}},BW=(e,s)=>{let t;const r=[];for(;(t=e.exec(s))!==null;)r.push(t);return r},WW=Ts("HTMLFormElement"),GW=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,i){return r.toUpperCase()+i}),N_=(({hasOwnProperty:e})=>(s,t)=>e.call(s,t))(Object.prototype),zW=Ts("RegExp"),O$=(e,s)=>{const t=Object.getOwnPropertyDescriptors(e),r={};Ya(t,(i,n)=>{let a;(a=s(i,n,e))!==!1&&(r[n]=a||i)}),Object.defineProperties(e,r)},ZW=e=>{O$(e,(s,t)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=e[t];if(zt(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+"'")})}})},qW=(e,s)=>{const t={},r=i=>{i.forEach(n=>{t[n]=!0})};return cn(e)?r(e):r(String(e).split(s)),t},XW=()=>{},YW=(e,s)=>(e=+e,Number.isFinite(e)?e:s),kd="abcdefghijklmnopqrstuvwxyz",V_="0123456789",L$={DIGIT:V_,ALPHA:kd,ALPHA_DIGIT:kd+kd.toUpperCase()+V_},JW=(e=16,s=L$.ALPHA_DIGIT)=>{let t="";const{length:r}=s;for(;e--;)t+=s[Math.random()*r|0];return t};function KW(e){return!!(e&&zt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const QW=e=>{const s=new Array(10),t=(r,i)=>{if(Vu(r)){if(s.indexOf(r)>=0)return;if(!("toJSON"in r)){s[i]=r;const n=cn(r)?[]:{};return Ya(r,(a,o)=>{const l=t(a,i+1);!va(l)&&(n[o]=l)}),s[i]=void 0,n}}return r};return t(e,0)},eG=Ts("AsyncFunction"),tG=e=>e&&(Vu(e)||zt(e))&&zt(e.then)&&zt(e.catch),Q={isArray:cn,isArrayBuffer:P$,isBuffer:xW,isFormData:LW,isArrayBufferView:wW,isString:SW,isNumber:D$,isBoolean:PW,isObject:Vu,isPlainObject:Eo,isUndefined:va,isDate:DW,isFile:TW,isBlob:MW,isRegExp:zW,isFunction:zt,isStream:OW,isURLSearchParams:AW,isTypedArray:VW,isFileList:EW,forEach:Ya,merge:th,extend:FW,trim:kW,stripBOM:RW,inherits:jW,toFlatObject:HW,kindOf:Iu,kindOfTest:Ts,endsWith:IW,toArray:NW,forEachEntry:UW,matchAll:BW,isHTMLForm:WW,hasOwnProperty:N_,hasOwnProp:N_,reduceDescriptors:O$,freezeMethods:ZW,toObjectSet:qW,toCamelCase:GW,noop:XW,toFiniteNumber:YW,findKey:T$,global:M$,isContextDefined:E$,ALPHABET:L$,generateString:JW,isSpecCompliantForm:KW,toJSONObject:QW,isAsyncFn:eG,isThenable:tG};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)}Q.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:Q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const A$=Me.prototype,k$={};["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=>{k$[e]={value:e}});Object.defineProperties(Me,k$);Object.defineProperty(A$,"isAxiosError",{value:!0});Me.from=(e,s,t,r,i,n)=>{const a=Object.create(A$);return Q.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 sG=null;function sh(e){return Q.isPlainObject(e)||Q.isArray(e)}function F$(e){return Q.endsWith(e,"[]")?e.slice(0,-2):e}function U_(e,s,t){return e?e.concat(s).map(function(i,n){return i=F$(i),!t&&n?"["+i+"]":i}).join(t?".":""):s}function rG(e){return Q.isArray(e)&&!e.some(sh)}const iG=Q.toFlatObject(Q,{},null,function(s){return/^is[A-Z]/.test(s)});function Uu(e,s,t){if(!Q.isObject(e))throw new TypeError("target must be an object");s=s||new FormData,t=Q.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,b){return!Q.isUndefined(b[f])});const r=t.metaTokens,i=t.visitor||u,n=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(s);if(!Q.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Q.isDate(p))return p.toISOString();if(!l&&Q.isBlob(p))throw new Me("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(p)||Q.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,f,b){let C=p;if(p&&!b&&typeof p=="object"){if(Q.endsWith(f,"{}"))f=r?f:f.slice(0,-2),p=JSON.stringify(p);else if(Q.isArray(p)&&rG(p)||(Q.isFileList(p)||Q.endsWith(f,"[]"))&&(C=Q.toArray(p)))return f=F$(f),C.forEach(function(L,N){!(Q.isUndefined(L)||L===null)&&s.append(a===!0?U_([f],N,n):a===null?f:f+"[]",c(L))}),!1}return sh(p)?!0:(s.append(U_(b,f,n),c(p)),!1)}const d=[],m=Object.assign(iG,{defaultVisitor:u,convertValue:c,isVisitable:sh});function h(p,f){if(!Q.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+f.join("."));d.push(p),Q.forEach(p,function(C,S){(!(Q.isUndefined(C)||C===null)&&i.call(s,C,Q.isString(S)?S.trim():S,f,m))===!0&&h(C,f?f.concat(S):[S])}),d.pop()}}if(!Q.isObject(e))throw new TypeError("data must be an object");return h(e),s}function B_(e){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return s[r]})}function Af(e,s){this._pairs=[],e&&Uu(e,this,s)}const R$=Af.prototype;R$.append=function(s,t){this._pairs.push([s,t])};R$.toString=function(s){const t=s?function(r){return s.call(this,r,B_)}:B_;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function nG(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function j$(e,s,t){if(!s)return e;const r=t&&t.encode||nG,i=t&&t.serialize;let n;if(i?n=i(s,t):n=Q.isURLSearchParams(s)?s.toString():new Af(s,t).toString(r),n){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}class aG{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){Q.forEach(this.handlers,function(r){r!==null&&s(r)})}}const W_=aG,H$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oG=typeof URLSearchParams<"u"?URLSearchParams:Af,lG=typeof FormData<"u"?FormData:null,cG=typeof Blob<"u"?Blob:null,uG={isBrowser:!0,classes:{URLSearchParams:oG,FormData:lG,Blob:cG},protocols:["http","https","file","blob","url","data"]},I$=typeof window<"u"&&typeof document<"u",dG=(e=>I$&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),mG=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),hG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:I$,hasStandardBrowserEnv:dG,hasStandardBrowserWebWorkerEnv:mG},Symbol.toStringTag,{value:"Module"})),Cs={...hG,...uG};function pG(e,s){return Uu(e,new Cs.classes.URLSearchParams,Object.assign({visitor:function(t,r,i,n){return Cs.isNode&&Q.isBuffer(t)?(this.append(r,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},s))}function fG(e){return Q.matchAll(/\w+|\[(\w*)]/g,e).map(s=>s[0]==="[]"?"":s[1]||s[0])}function gG(e){const s={},t=Object.keys(e);let r;const i=t.length;let n;for(r=0;r=t.length;return a=!a&&Q.isArray(i)?i.length:a,l?(Q.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!o):((!i[a]||!Q.isObject(i[a]))&&(i[a]=[]),s(t,r,i[a],n)&&Q.isArray(i[a])&&(i[a]=gG(i[a])),!o)}if(Q.isFormData(e)&&Q.isFunction(e.entries)){const t={};return Q.forEachEntry(e,(r,i)=>{s(fG(r),i,t,0)}),t}return null}function vG(e,s,t){if(Q.isString(e))try{return(s||JSON.parse)(e),Q.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(e)}const kf={transitional:H$,adapter:["xhr","http"],transformRequest:[function(s,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=Q.isObject(s);if(n&&Q.isHTMLForm(s)&&(s=new FormData(s)),Q.isFormData(s))return i?JSON.stringify(N$(s)):s;if(Q.isArrayBuffer(s)||Q.isBuffer(s)||Q.isStream(s)||Q.isFile(s)||Q.isBlob(s))return s;if(Q.isArrayBufferView(s))return s.buffer;if(Q.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 pG(s,this.formSerializer).toString();if((o=Q.isFileList(s))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Uu(o?{"files[]":s}:s,l&&new l,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),vG(s)):s}],transformResponse:[function(s){const t=this.transitional||kf.transitional,r=t&&t.forcedJSONParsing,i=this.responseType==="json";if(s&&Q.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:Cs.classes.FormData,Blob:Cs.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Q.forEach(["delete","get","head","post","put","patch"],e=>{kf.headers[e]={}});const Ff=kf,_G=Q.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"]),bG=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]&&_G[t])&&(t==="set-cookie"?s[t]?s[t].push(r):s[t]=[r]:s[t]=s[t]?s[t]+", "+r:r)}),s},G_=Symbol("internals");function Cn(e){return e&&String(e).trim().toLowerCase()}function Oo(e){return e===!1||e==null?e:Q.isArray(e)?e.map(Oo):String(e)}function yG(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 CG=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Fd(e,s,t,r,i){if(Q.isFunction(r))return r.call(this,s,t);if(i&&(s=t),!!Q.isString(s)){if(Q.isString(r))return s.indexOf(r)!==-1;if(Q.isRegExp(r))return r.test(s)}}function $G(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,t,r)=>t.toUpperCase()+r)}function xG(e,s){const t=Q.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 Bu{constructor(s){s&&this.set(s)}set(s,t,r){const i=this;function n(o,l,c){const u=Cn(l);if(!u)throw new Error("header name must be a non-empty string");const d=Q.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Oo(o))}const a=(o,l)=>Q.forEach(o,(c,u)=>n(c,u,l));return Q.isPlainObject(s)||s instanceof this.constructor?a(s,t):Q.isString(s)&&(s=s.trim())&&!CG(s)?a(bG(s),t):s!=null&&n(t,s,r),this}get(s,t){if(s=Cn(s),s){const r=Q.findKey(this,s);if(r){const i=this[r];if(!t)return i;if(t===!0)return yG(i);if(Q.isFunction(t))return t.call(this,i,r);if(Q.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,t){if(s=Cn(s),s){const r=Q.findKey(this,s);return!!(r&&this[r]!==void 0&&(!t||Fd(this,this[r],r,t)))}return!1}delete(s,t){const r=this;let i=!1;function n(a){if(a=Cn(a),a){const o=Q.findKey(r,a);o&&(!t||Fd(r,r[o],o,t))&&(delete r[o],i=!0)}}return Q.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||Fd(this,this[n],n,s,!0))&&(delete this[n],i=!0)}return i}normalize(s){const t=this,r={};return Q.forEach(this,(i,n)=>{const a=Q.findKey(r,n);if(a){t[a]=Oo(i),delete t[n];return}const o=s?$G(n):String(n).trim();o!==n&&delete t[n],t[o]=Oo(i),r[o]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const t=Object.create(null);return Q.forEach(this,(r,i)=>{r!=null&&r!==!1&&(t[i]=s&&Q.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[G_]=this[G_]={accessors:{}}).accessors,i=this.prototype;function n(a){const o=Cn(a);r[o]||(xG(i,a),r[o]=!0)}return Q.isArray(s)?s.forEach(n):n(s),this}}Bu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(Bu.prototype,({value:e},s)=>{let t=s[0].toUpperCase()+s.slice(1);return{get:()=>e,set(r){this[t]=r}}});Q.freezeMethods(Bu);const Rs=Bu;function Rd(e,s){const t=this||Ff,r=s||t,i=Rs.from(r.headers);let n=r.data;return Q.forEach(e,function(o){n=o.call(t,n,i.normalize(),s?s.status:void 0)}),i.normalize(),n}function V$(e){return!!(e&&e.__CANCEL__)}function Ja(e,s,t){Me.call(this,e==null?"canceled":e,Me.ERR_CANCELED,s,t),this.name="CanceledError"}Q.inherits(Ja,Me,{__CANCEL__:!0});function wG(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 SG=Cs.hasStandardBrowserEnv?{write(e,s,t,r,i,n){const a=[e+"="+encodeURIComponent(s)];Q.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),Q.isString(r)&&a.push("path="+r),Q.isString(i)&&a.push("domain="+i),n===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function PG(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function DG(e,s){return s?e.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):e}function U$(e,s){return e&&!PG(s)?DG(e,s):s}const TG=Cs.hasStandardBrowserEnv?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=Q.isString(a)?i(a):a;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}();function MG(e){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return s&&s[1]||""}function EG(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,m=0;for(;d!==i;)m+=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 OG=typeof XMLHttpRequest<"u",LG=OG&&function(e){return new Promise(function(t,r){let i=e.data;const n=Rs.from(e.headers).normalize();let{responseType:a,withXSRFToken:o}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(Q.isFormData(i)){if(Cs.hasStandardBrowserEnv||Cs.hasStandardBrowserWebWorkerEnv)n.setContentType(!1);else if((u=n.getContentType())!==!1){const[f,...b]=u?u.split(";").map(C=>C.trim()).filter(Boolean):[];n.setContentType([f||"multipart/form-data",...b].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(f+":"+b))}const m=U$(e.baseURL,e.url);d.open(e.method.toUpperCase(),j$(m,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function h(){if(!d)return;const f=Rs.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:f,config:e,request:d};wG(function(L){t(L),c()},function(L){r(L),c()},C),d=null}if("onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(h)},d.onabort=function(){d&&(r(new Me("Request aborted",Me.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new Me("Network Error",Me.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let b=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const C=e.transitional||H$;e.timeoutErrorMessage&&(b=e.timeoutErrorMessage),r(new Me(b,C.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,e,d)),d=null},Cs.hasStandardBrowserEnv&&(o&&Q.isFunction(o)&&(o=o(e)),o||o!==!1&&TG(m))){const f=e.xsrfHeaderName&&e.xsrfCookieName&&SG.read(e.xsrfCookieName);f&&n.set(e.xsrfHeaderName,f)}i===void 0&&n.setContentType(null),"setRequestHeader"in d&&Q.forEach(n.toJSON(),function(b,C){d.setRequestHeader(C,b)}),Q.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&a!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",z_(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",z_(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=f=>{d&&(r(!f||f.type?new Ja(null,e,d):f),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=MG(m);if(p&&Cs.protocols.indexOf(p)===-1){r(new Me("Unsupported protocol "+p+":",Me.ERR_BAD_REQUEST,e));return}d.send(i||null)})},rh={http:sG,xhr:LG};Q.forEach(rh,(e,s)=>{if(e){try{Object.defineProperty(e,"name",{value:s})}catch{}Object.defineProperty(e,"adapterName",{value:s})}});const Z_=e=>"- ".concat(e),AG=e=>Q.isFunction(e)||e===null||e===!1,B$={getAdapter:e=>{e=Q.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(Z_).join("\n"):" "+Z_(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:rh};function jd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ja(null,e)}function q_(e){return jd(e),e.headers=Rs.from(e.headers),e.data=Rd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),B$.getAdapter(e.adapter||Ff.adapter)(e).then(function(r){return jd(e),r.data=Rd.call(e,e.transformResponse,r),r.headers=Rs.from(r.headers),r},function(r){return V$(r)||(jd(e),r&&r.response&&(r.response.data=Rd.call(e,e.transformResponse,r.response),r.response.headers=Rs.from(r.response.headers))),Promise.reject(r)})}const X_=e=>e instanceof Rs?{...e}:e;function Vi(e,s){s=s||{};const t={};function r(c,u,d){return Q.isPlainObject(c)&&Q.isPlainObject(u)?Q.merge.call({caseless:d},c,u):Q.isPlainObject(u)?Q.merge({},u):Q.isArray(u)?u.slice():u}function i(c,u,d){if(Q.isUndefined(u)){if(!Q.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function n(c,u){if(!Q.isUndefined(u))return r(void 0,u)}function a(c,u){if(Q.isUndefined(u)){if(!Q.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,withXSRFToken: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(X_(c),X_(u),!0)};return Q.forEach(Object.keys(Object.assign({},e,s)),function(u){const d=l[u]||i,m=d(e[u],s[u],u);Q.isUndefined(m)&&d!==o||(t[u]=m)}),t}const W$="1.6.8",Rf={};["object","boolean","number","function","string","symbol"].forEach((e,s)=>{Rf[e]=function(r){return typeof r===e||"a"+(s<1?"n ":" ")+e}});const Y_={};Rf.transitional=function(s,t,r){function i(n,a){return"[Axios v"+W$+"] 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&&!Y_[a]&&(Y_[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 kG(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 ih={assertOptions:kG,validators:Rf},Xs=ih.validators;class Ul{constructor(s){this.defaults=s,this.interceptors={request:new W_,response:new W_}}async request(s,t){try{return await this._request(s,t)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const n=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?n&&!String(r.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+n):r.stack=n}throw r}}_request(s,t){typeof s=="string"?(t=t||{},t.url=s):t=s||{},t=Vi(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;r!==void 0&&ih.assertOptions(r,{silentJSONParsing:Xs.transitional(Xs.boolean),forcedJSONParsing:Xs.transitional(Xs.boolean),clarifyTimeoutError:Xs.transitional(Xs.boolean)},!1),i!=null&&(Q.isFunction(i)?t.paramsSerializer={serialize:i}:ih.assertOptions(i,{encode:Xs.function,serialize:Xs.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&Q.merge(n.common,n[t.method]);n&&Q.forEach(["delete","get","head","post","put","patch","common"],p=>{delete n[p]}),t.headers=Rs.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,m;if(!l){const p=[q_.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),m=p.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 Ja(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 jf(function(i){s=i}),cancel:s}}}const FG=jf;function RG(e){return function(t){return e.apply(null,t)}}function jG(e){return Q.isObject(e)&&e.isAxiosError===!0}const nh={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(nh).forEach(([e,s])=>{nh[s]=e});const HG=nh;function G$(e){const s=new Lo(e),t=S$(Lo.prototype.request,s);return Q.extend(t,Lo.prototype,s,{allOwnKeys:!0}),Q.extend(t,s,null,{allOwnKeys:!0}),t.create=function(i){return G$(Vi(e,i))},t}const Qe=G$(Ff);Qe.Axios=Lo;Qe.CanceledError=Ja;Qe.CancelToken=FG;Qe.isCancel=V$;Qe.VERSION=W$;Qe.toFormData=Uu;Qe.AxiosError=Me;Qe.Cancel=Qe.CanceledError;Qe.all=function(s){return Promise.all(s)};Qe.spread=RG;Qe.isAxiosError=jG;Qe.mergeConfig=Vi;Qe.AxiosHeaders=Rs;Qe.formToJSON=e=>N$(Q.isHTMLForm(e)?new FormData(e):e);Qe.getAdapter=B$.getAdapter;Qe.HttpStatusCode=HG;Qe.default=Qe;const ks=Qe;var IG=Object.defineProperty,NG=Object.getOwnPropertyDescriptor,VG=(e,s,t,r)=>{for(var i=r>1?void 0:r?NG(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 ah=class extends M(O,_t){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiClose=ka,this.mdiCog=us,this.mdiFolder=Cp,this.mdiFolderUpload=xp,this.mdiFileDocumentEditOutline=ja,this.mdiFile=pr,this.mdiCloudDownload=Gn,this.mdiRenameBox=Yc,this.mdiDelete=ze,this.mdiCloseThick=pe,this.mdiLockOutline=Gc,this.mdiContentCopy=gp,this.sortFiles=kp,this.formatFilesize=Je,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:{}},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:Gn,loadingName:"configDownloadZip",onlyWriteable:!1,condition:this.selectedFiles.length>0,click:()=>{this.downloadSelectedFiles()}},{text:this.$t("Machine.ConfigFilesPanel.Delete"),color:"error",icon:ze,loadingName:null,onlyWriteable:!0,condition:this.selectedFiles.length>0,click:()=>{this.deleteSelectedDialog=!0}},{text:this.$t("Machine.ConfigFilesPanel.UploadFile"),color:this.machineButtonCol,icon:Ry,loadingName:null,onlyWriteable:!0,condition:!0,click:this.uploadFileButton},{text:this.$t("Machine.ConfigFilesPanel.CreateFile"),color:this.machineButtonCol,icon:OT,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:tn,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$/,i=/^crowsnest\.conf\.\d{4}-\d{2}-\d{2}-\d{4}$/;e=e.filter(n=>!n.filename.match(r)&&!n.filename.match(i)&&!n.filename.endsWith(".bkp"))}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=>!zD.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 m="".concat(c,"/").concat(d.filename);if(d.isDirectory&&d.childrens){await s(m,d.childrens);continue}e.push(m)}};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)),ks.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"})}}};ah=VG([D({components:{Panel:B,PathNavigation:on}})],ah);var UG=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r("div",[r(B,{attrs:{title:s.$t("Machine.ConfigFilesPanel.ConfigFiles"),"card-class":"machine-configfiles-panel",icon:s.mdiInformation,collapsible:!0}},[r(q,[r($,[r(_,{staticClass:"col-12 col-lg pr-lg-0"},[r(Ee,{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(de,{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(J,{staticClass:"minHeight36"},[r(_e,{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(J,{staticClass:"minHeight36"},[r(_e,{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($,[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(on,{attrs:{path:s.currentPath,"base-directory-label":"/".concat(s.root),"on-segment-click":s.clickPathNavGoToDirectory}})],1),r(ae),s.disk_usage!==null&&!s.showMissingConfigRootWarning?[r(de,{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(U),s.showMissingConfigRootWarning?r(q,[r($,[r(_,{staticClass:"col-12 col-lg pr-lg-0"},[r(it,{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(zr,{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(Fr,{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(Fr,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(J,{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(B,{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","object-fit":"contain"},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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(te,{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(ae),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(B,{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(ae),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(B,{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(ae),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(B,{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(ae),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(_i,{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(ws,{staticClass:"mt-2",attrs:{value:s.uploadSnackbar.percent}})],1)],1)},BG=[];const J_={};var WG=E(ah,UG,BG,!1,GG,null,null,null);function GG(e){for(let s in J_)this[s]=J_[s]}const z$=function(){return WG.exports}();var zG=Object.defineProperty,ZG=Object.getOwnPropertyDescriptor,qG=(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&&zG(s,t,i),i};let oh=class extends M(O){constructor(){super(...arguments),this.formatFilesize=Je,this.mdiCloseThick=pe,this.mdiTextBoxSearchOutline=n2,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}};oh=qG([D({components:{Panel:B}})],oh);var XG=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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(de,{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(de,{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,2813579108)},[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(dt,{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(dt,{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(dt,{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(B,{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($,{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(U,{staticClass:"my-3"}):e._e(),t($,[t(_,[e._v(e._s(o))]),t(_,{staticClass:"text-right"},[e._v(e._s(a))])],1)],1)})]:e._e()],2)}):[t($,{staticClass:"mt-5"},[t(_,[t("p",[e._v(e._s(e.$t("Machine.SystemPanel.NoMoreInfos")))])])],1)]],2)],1)],1)],1)],1)},YG=[];const K_={};var JG=E(oh,XG,YG,!1,KG,"1e488c0d",null,null);function KG(e){for(let s in K_)this[s]=K_[s]}const Z$=function(){return JG.exports}();var QG=Object.defineProperty,ez=Object.getOwnPropertyDescriptor,q$=(e,s,t,r)=>{for(var i=r>1?void 0:r?ez(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&&QG(s,t,i),i};let Bl=class extends M(O){constructor(){super(...arguments),this.formatFilesize=Je,this.mdiCloseThick=pe,this.mcuDetailsDialog=!1}};q$([P({required:!0})],Bl.prototype,"mcu",2);Bl=q$([D({components:{Panel:B}})],Bl);var tz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t($,{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(de,{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(dt,{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(B,{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($,[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(U,{staticClass:"my-3"}):e._e(),t($,[t(_,[e._v(e._s(i))]),t(_,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e(),e.mcu.last_stats?[t($,{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(U,{staticClass:"my-3"}):e._e(),t($,[t(_,[e._v(e._s(i))]),t(_,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e()],2)],1)],1)],1)],1)},sz=[];const Q_={};var rz=E(Bl,tz,sz,!1,iz,null,null,null);function iz(e){for(let s in Q_)this[s]=Q_[s]}const X$=function(){return rz.exports}();var nz=Object.defineProperty,az=Object.getOwnPropertyDescriptor,oz=(e,s,t,r)=>{for(var i=r>1?void 0:r?az(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 lh=class extends M(O){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiMemory=Wy}get mcus(){var s;const e=(s=this.$store.getters["printer/getMcus"])!=null?s:[];return At(e,"name")}get hostStats(){var e;return(e=this.$store.getters["server/getHostStats"])!=null?e:null}};lh=oz([D({components:{SystemPanelMcu:X$,SystemPanelHost:Z$,Panel:B}})],lh);var lz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(B,{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(U,{staticClass:"my-2"}):e._e(),t(X$,{attrs:{mcu:r}})],1)}),e.hostStats?t("div",[e.mcus.length?t(U,{staticClass:"my-2"}):e._e(),t(Z$)],1):e._e()],2)],1)},cz=[];const eb={};var uz=E(lh,lz,cz,!1,dz,"0449534b",null,null);function dz(e){for(let s in eb)this[s]=eb[s]}const Y$=function(){return uz.exports}();var mz=Object.defineProperty,hz=Object.getOwnPropertyDescriptor,pz=(e,s,t,r)=>{for(var i=r>1?void 0:r?hz(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 ch=class extends M(O){};ch=pz([D({components:{SystemPanel:Y$,ConfigFilesPanel:z$,EndstopPanel:w$,LogfilesPanel:x$,UpdatePanel:C$,KlippyStatePanel:Na}})],ch);var fz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(Ae,{attrs:{fluid:"","py-0":"","px-0":""}},[t($,[t(_,{staticClass:"col-12 col-md-6 pb-0 pb-md-3"},[t(z$)],1),t(_,{staticClass:"col-12 col-md-6 pt-0 pt-md-3"},[t(Na),t(Y$),t(C$),t($,[e.klipperState==="ready"?t(_,{staticClass:"col-12 col-sm-6 pb-0 pb-md-3"},[t(w$)],1):e._e(),t(_,{class:e.klipperState!=="ready"?"col-12":"col-12 col-sm-6 pt-0 pt-sm-3"},[t(x$)],1)],1)],1)],1)],1)},gz=[];const tb={};var vz=E(ch,fz,gz,!1,_z,null,null,null);function _z(e){for(let s in tb)this[s]=tb[s]}const bz=function(){return vz.exports}(),J$=[{name:"dashboard",title:"Dashboard",path:"/",icon:Pp,component:f8,alwaysShow:!0,showInNavi:!0,position:10},{name:"farm",title:"Printers",path:"/allPrinters",component:j8,alwaysShow:!1,showInNavi:!1},{name:"webcam",title:"Webcam",path:"/cam",icon:sn,component:x8,alwaysShow:!0,showInNavi:!0,position:20,fullscreen:!0},{name:"console",title:"Console",path:"/console",icon:Fa,component:W8,alwaysShow:!0,showInNavi:!0,klipperIsConnected:!0,position:30},{name:"heightmap",title:"Heightmap",path:"/heightmap",icon:Bc,component:()=>fe(()=>import("./Heightmap-a5103d86.js"),["assets/Heightmap-a5103d86.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/echarts-ff51454d.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/Heightmap-acf3d6b7.css"]),alwaysShow:!1,showInNavi:!0,klipperComponent:"bed_mesh",position:40},{name:"gcodefiles",title:"G-Code Files",path:"/files",icon:Uc,component:ij,alwaysShow:!0,showInNavi:!0,registeredDirectory:"gcodes",position:50,fullscreen:!0},{name:"gcodeviewer",title:"G-Code Viewer",path:"/viewer",icon:Jc,component:()=>fe(()=>import("./Viewer-ac934cb5.js"),["assets/Viewer-ac934cb5.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/codemirror-0a1db0c7.js","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js","assets/Viewer-815597de.css"]),alwaysShow:!0,showInNavi:!0,position:60,fullscreen:!0},{name:"history",title:"History",path:"/history",icon:HT,component:lI,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"history",position:70},{name:"timelapse",title:"Timelapse",path:"/timelapse",icon:l2,component:EI,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"timelapse",position:80},{name:"machine",title:"Machine",path:"/config",icon:x3,component:bz,alwaysShow:!0,showInNavi:!0,position:90},{title:null,component:null,alwaysShow:!1,showInNavi:!1,path:"/settings/machine",redirect:"/config"}];var yz=Object.defineProperty,Cz=Object.getOwnPropertyDescriptor,K$=(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 Ui=class extends M(O){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:C3,to:"/allPrinters",position:0,visible:!0}),J$.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:Uy,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]}};K$([me("sidebarNaviFile",{immediate:!0})],Ui.prototype,"sidebarNaviFileChanged",1);Ui=K$([D],Ui);var $z=Object.defineProperty,xz=Object.getOwnPropertyDescriptor,wz=(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&&$z(s,t,i),i};let uh=class extends M(Ui,O,_t){constructor(){super(...arguments),this.navigationWidth=BD,this.topbarHeight=kn}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(kn,"px !important"),"padding-bottom":"".concat(kn,"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}};uh=wz([D({components:{SidebarItem:p2,TheSelectPrinterDialog:Op,AboutDialog:m2,MainsailLogo:rn}})],uh);var Sz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xP,{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(Fc,{attrs:{src:e.sidebarBackground,height:"100%"}})]},proxy:!0},{key:"append",fn:function(){return[t(J,{staticClass:"small-list-item mb-2"},[t(Is,{staticClass:"menu-item-icon"},[t(m2)],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(wP,{attrs:{"active-class":"active-nav-item"}},[e.isMobile?t(J,{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(rn,{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(p2,{key:i,attrs:{item:r}})})],2)],1)],1)],1)},Pz=[];const sb={};var Dz=E(uh,Sz,Pz,!1,Tz,"1a6ff80c",null,null);function Tz(e){for(let s in sb)this[s]=sb[s]}const Q$=function(){return Dz.exports}();var Mz=Object.defineProperty,Ez=Object.getOwnPropertyDescriptor,Oz=(e,s,t,r)=>{for(var i=r>1?void 0:r?Ez(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 dh=class extends M(O){constructor(){super(...arguments),this.mdiAlert=QD,this.mdiCloseThick=pe,this.mdiPowerStandby=t3,this.mdiRestart=Zr,this.mdiPlay=en,this.mdiPower=Yy,this.mdiStop=s2,this.mdiToggleSwitch=Ep,this.mdiToggleSwitchOff=g3,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",{})}};dh=Oz([D({components:{Panel:B}})],dh);var Lz=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(_s,{staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.KlipperControl"))+" ")]),t(J,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperRestart,"klipper","restart")}}},[t(Ge,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperRestart")))]),t(ti,{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(J,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperFirmwareRestart,"klipper","firmwareRestart")}}},[t(Ge,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperFirmwareRestart")))]),t(ti,{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(U,{staticClass:"mt-0"}):e._e(),t(_s,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.ServiceControl"))+" ")]),e._l(e.services,function(r){return t(J,{key:r,staticClass:"minheight30 pr-2"},[t(Ge,[t(de,{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(ti,{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(U,{staticClass:"mt-0"}),t(_s,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.PowerDevices"))+" ")]),e._l(e.powerDevices,function(r,i){return t(J,{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(Ge,[e._v(e._s(r.device))]),t(ti,{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(U,{staticClass:"mt-0"}),t(_s,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(e._s(e.$t("App.TopCornerMenu.HostControl")))]),t(J,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostReboot,"host","reboot")}}},[t(Ge,[e._v(e._s(e.$t("App.TopCornerMenu.Reboot")))]),t(ti,{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(J,{staticClass:"minheight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostShutdown,"host","shutdown")}}},[t(Ge,[e._v(e._s(e.$t("App.TopCornerMenu.Shutdown")))]),t(ti,{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(xe,[t(gt,{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(ae),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(B,{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($,[t(_,[t("p",{staticClass:"body-2"},[e._v(e._s(e.dialogConfirmation.description))])])],1)],1),t(ne,[t(ae),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)},Az=[];const rb={};var kz=E(dh,Lz,Az,!1,Fz,"371c81fd",null,null);function Fz(e){for(let s in rb)this[s]=rb[s]}const ex=function(){return kz.exports}();var Rz=Object.defineProperty,jz=Object.getOwnPropertyDescriptor,Hf=(e,s,t,r)=>{for(var i=r>1?void 0:r?jz(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&&Rz(s,t,i),i};let _a=class extends M(O){constructor(){super(...arguments),this.selectedCheckboxes=[],this.selectAllIndeterminate=!1,this.selectAllModel=$r({get:this.getSelectAll,set:this.setSelectAll})}getSelectAll(){return this.selectAllIndeterminate=!1,0t.value);return}this.selectedCheckboxes=[]}};Hf([P({required:!0})],_a.prototype,"options",2);Hf([P({type:Boolean,required:!1,default:!1})],_a.prototype,"selectAll",2);_a=Hf([D],_a);var Hz=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(_,{staticClass:"pl-6"},[e.selectAll?[t(_e,{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(U,{staticClass:"my-2"})]:e._e(),e._l(e.options,function(r){return[t(_e,{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)},Iz=[];const ib={};var Nz=E(_a,Hz,Iz,!1,Vz,null,null,null);function Vz(e){for(let s in ib)this[s]=ib[s]}const Jr=function(){return Nz.exports}();var Uz=Object.defineProperty,Bz=Object.getOwnPropertyDescriptor,Wz=(e,s,t,r)=>{for(var i=r>1?void 0:r?Bz(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&&Uz(s,t,i),i};let Bi=class extends O{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("maintenance")&&e.push({value:"maintenance",label:this.$t("Settings.GeneralTab.DbMaintenance")}),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}};Bi=Wz([D],Bi);var Gz=Object.defineProperty,zz=Object.getOwnPropertyDescriptor,Zz=(e,s,t,r)=>{for(var i=r>1?void 0:r?zz(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&&Gz(s,t,i),i};let mh=class extends M(O,Bi){constructor(){super(...arguments),this.mdiHelpCircle=Wc,this.mdiCloseThick=pe,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}};mh=Zz([D({components:{Panel:B,SettingsRow:V,CheckboxList:Jr}})],mh);var qz=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(B,{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($,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.BackupDialog")))])])],1),t($,[t(Jr,{attrs:{options:e.backupableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectBackupCheckboxes}})],1),t($,[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)},Xz=[];const nb={};var Yz=E(mh,qz,Xz,!1,Jz,null,null,null);function Jz(e){for(let s in nb)this[s]=nb[s]}const tx=function(){return Yz.exports}();var Kz=Object.defineProperty,Qz=Object.getOwnPropertyDescriptor,eZ=(e,s,t,r)=>{for(var i=r>1?void 0:r?Qz(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&&Kz(s,t,i),i};let hh=class extends M(O,Bi){constructor(){super(...arguments),this.mdiHelpCircle=Wc,this.mdiCloseThick=pe,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(m=>m.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=eZ([D({components:{SettingsGeneralTabBackupDatabase:tx,Panel:B,SettingsRow:V,CheckboxList:Jr}})],hh);var tZ=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(B,{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($,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.RestoreDialog")))])])],1),t($,[t(Jr,{attrs:{options:e.restoreableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectRestoreCheckboxes}})],1),t($,[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)},sZ=[];const ab={};var rZ=E(hh,tZ,sZ,!1,iZ,null,null,null);function iZ(e){for(let s in ab)this[s]=ab[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 ph=class extends M(O,Bi){constructor(){super(...arguments),this.mdiHelpCircle=Wc,this.mdiCloseThick=pe,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=lZ([D({components:{Panel:B,SettingsRow:V,CheckboxList:Jr}})],ph);var cZ=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(B,{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($,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.FactoryDialog")))])])],1),t($,[t(Jr,{attrs:{options:e.resetableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectResetCheckboxes}})],1),t($,[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)},uZ=[];const ob={};var dZ=E(ph,cZ,uZ,!1,mZ,null,null,null);function mZ(e){for(let s in ob)this[s]=ob[s]}const hZ=function(){return dZ.exports}();var pZ=Object.defineProperty,fZ=Object.getOwnPropertyDescriptor,gZ=(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&&pZ(s,t,i),i};let fh=class extends M(O,Bi){constructor(){super(...arguments),this.availableLanguages=[]}async created(){const s=Object.assign({"../../locales/cz.json":()=>fe(()=>import("./cz-285b76fb.js"),[]).then(r=>r.title),"../../locales/da.json":()=>fe(()=>import("./da-32034265.js"),[]).then(r=>r.title),"../../locales/de.json":()=>fe(()=>import("./de-1b45e732.js"),[]).then(r=>r.title),"../../locales/en.json":()=>fe(()=>Promise.resolve().then(()=>Yw),void 0).then(r=>r.title),"../../locales/es.json":()=>fe(()=>import("./es-8a2d24bf.js"),[]).then(r=>r.title),"../../locales/fr.json":()=>fe(()=>import("./fr-ab90ab77.js"),[]).then(r=>r.title),"../../locales/hu.json":()=>fe(()=>import("./hu-a56cb065.js"),[]).then(r=>r.title),"../../locales/it.json":()=>fe(()=>import("./it-a13fb923.js"),[]).then(r=>r.title),"../../locales/ja.json":()=>fe(()=>import("./ja-a20a0276.js"),[]).then(r=>r.title),"../../locales/ko.json":()=>fe(()=>import("./ko-0b8d811b.js"),[]).then(r=>r.title),"../../locales/nl.json":()=>fe(()=>import("./nl-d64c7e44.js"),[]).then(r=>r.title),"../../locales/pl.json":()=>fe(()=>import("./pl-4358b7cc.js"),[]).then(r=>r.title),"../../locales/pt.json":()=>fe(()=>import("./pt-880f8881.js"),[]).then(r=>r.title),"../../locales/ru.json":()=>fe(()=>import("./ru-e26fbb6e.js"),[]).then(r=>r.title),"../../locales/se.json":()=>fe(()=>import("./se-23883ae1.js"),[]).then(r=>r.title),"../../locales/tr.json":()=>fe(()=>import("./tr-9777749c.js"),[]).then(r=>r.title),"../../locales/uk.json":()=>fe(()=>import("./uk-217f44de.js"),[]).then(r=>r.title),"../../locales/zh.json":()=>fe(()=>import("./zh-0b0471a0.js"),[]).then(r=>r.title),"../../locales/zh_TW.json":()=>fe(()=>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})}};fh=gZ([D({components:{Panel:B,SettingsRow:V,CheckboxList:Jr,SettingsGeneralTabBackupDatabase:tx,SettingsGeneralTabRestoreDatabase:nZ,SettingsGeneralTabResetDatabase:hZ}})],fh);var vZ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{attrs:{flat:""}},[t(q,[t(V,{attrs:{title:e.$t("Settings.GeneralTab.PrinterName")}},[t(te,{attrs:{"hide-details":"",outlined:"",dense:""},model:{value:e.printerName,callback:function(r){e.printerName=r},expression:"printerName"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.Language")}},[t(Ee,{attrs:{items:e.availableLanguages,"hide-details":"",outlined:"",dense:""},model:{value:e.currentLanguage,callback:function(r){e.currentLanguage=r},expression:"currentLanguage"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.DateFormat")}},[t(Ee,{attrs:{items:e.dateFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.dateFormat,callback:function(r){e.dateFormat=r},expression:"dateFormat"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.TimeFormat")}},[t(Ee,{attrs:{items:e.timeFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.timeFormat,callback:function(r){e.timeFormat=r},expression:"timeFormat"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.CalcPrintProgress"),"sub-title":e.$t("Settings.GeneralTab.CalcPrintProgressDescription")}},[t(Ee,{attrs:{items:e.calcPrintProgressItems,"hide-details":"",dense:"",outlined:""},model:{value:e.calcPrintProgress,callback:function(r){e.calcPrintProgress=r},expression:"calcPrintProgress"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.CalcEstimateTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEstimateTimeDescription")}},[t(Ee,{attrs:{items:e.calcEstimateItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEstimateTime,callback:function(r){e.calcEstimateTime=r},expression:"calcEstimateTime"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.CalcEtaTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEtaTimeDescription")}},[t(Ee,{attrs:{items:e.calcEtaTimeItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEtaTime,callback:function(r){e.calcEtaTime=r},expression:"calcEtaTime"}})],1),t(U,{staticClass:"my-2"}),t(V,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.GeneralTab.FactoryReset"),"dynamic-slot-width":!0}},[t("settings-general-tab-reset-database")],1)],1)],1)],1)},_Z=[];const lb={};var bZ=E(fh,vZ,_Z,!1,yZ,null,null,null);function yZ(e){for(let s in lb)this[s]=lb[s]}const CZ=function(){return bZ.exports}();var $Z=Object.defineProperty,xZ=Object.getOwnPropertyDescriptor,If=(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&&$Z(s,t,i),i};let ba=class extends M(O,dr){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,this.mdiMenuDown=fr,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")}};If([P({type:Object,required:!0})],ba.prototype,"webcam",2);If([P({type:String,default:"create"})],ba.prototype,"type",2);ba=If([D({components:{SettingsRow:V}})],ba);var wZ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(cr,{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(gt,[e._v(e._s(e.title))]),t(q,[t($,[t(_,{staticClass:"col-12 col-sm-6"},[t($,[t(_,{staticClass:"d-flex"},[t(Vt,[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(J,{key:r.value,attrs:{link:""},on:{click:function(i){e.webcam.icon=r.value}}},[t(Is,{staticClass:"mr-2"},[t(v,{staticClass:"mt-1",attrs:{small:""}},[e._v(" "+e._s(e.convertWebcamIcon(r.value))+" ")])],1),t(vt,[t(Ge,{domProps:{textContent:e._s(r.text)}})],1)],1)}),1)],1)],1),t(te,{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($,[t(_,{staticClass:"py-2"},[t(te,{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($,[t(_,{staticClass:"py-2"},[t(te,{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($,[t(_,{staticClass:"py-2"},[t(Ee,{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($,[t(_,{staticClass:"py-2 col-6"},[t(te,{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(Ee,{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($,[t(_,{staticClass:"pt-1 pb-3"},[t(_e,{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($,[t(_,{staticClass:"pt-1 pb-3"},[t(_e,{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($,[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($,{staticClass:"mt-0"},[t(_,{staticClass:"py-0"},[t(_e,{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(_e,{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(wu,{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)},SZ=[];const cb={};var PZ=E(ba,wZ,SZ,!1,DZ,"3a5b3bca",null,null);function DZ(e){for(let s in cb)this[s]=cb[s]}const sx=function(){return PZ.exports}();var TZ=Object.defineProperty,MZ=Object.getOwnPropertyDescriptor,Nf=(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&&TZ(s,t,i),i};let ya=class extends M(O,dr){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,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)}};Nf([P({type:Object,default:()=>{}})],ya.prototype,"webcam",2);Nf([P({type:Boolean,default:!1})],ya.prototype,"boolBorderTop",2);ya=Nf([D({components:{SettingsRow:V}})],ya);var EZ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolBorderTop?t(U,{staticClass:"my-2"}):e._e(),t(V,{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)},OZ=[];const ub={};var LZ=E(ya,EZ,OZ,!1,AZ,null,null,null);function AZ(e){for(let s in ub)this[s]=ub[s]}const rx=function(){return LZ.exports}();var kZ=Object.defineProperty,FZ=Object.getOwnPropertyDescriptor,RZ=(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&&kZ(s,t,i),i};let gh=class extends M(O,dr){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,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}};gh=RZ([D({components:{SettingsRow:V,WebcamForm:sx,WebcamListEntry:rx}})],gh);var jZ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?t(xe,{attrs:{flat:""}},[t(sx,{attrs:{webcam:e.formWebcam,type:e.typeForm},on:{close:e.closeForm}})],1):t(xe,{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(rx,{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(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createWebcam}},[e._v(e._s(e.$t("Settings.WebcamsTab.AddWebcam")))])],1)],1)],1)},HZ=[];const db={};var IZ=E(gh,jZ,HZ,!1,NZ,null,null,null);function NZ(e){for(let s in db)this[s]=db[s]}const VZ=function(){return IZ.exports}();var UZ=Object.defineProperty,BZ=Object.getOwnPropertyDescriptor,WZ=(e,s,t,r)=>{for(var i=r>1?void 0:r?BZ(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&&UZ(s,t,i),i};let vh=class extends M(O){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})}};vh=WZ([D({components:{SettingsRow:V}})],vh);var GZ=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(U,{staticClass:"my-2"}):e._e(),t(V,{attrs:{title:r.name,"sub-title":r.description,"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"input-value":e.getMacroStatus(r.name),"hide-details":""},on:{change:function(n){return e.changeMacroStatus(r.name)}}})],1)],1)}):[t($,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NOMacros")))])])],1)]],2)},zZ=[];const mb={};var ZZ=E(vh,GZ,zZ,!1,qZ,null,null,null);function qZ(e){for(let s in mb)this[s]=mb[s]}const ix=function(){return ZZ.exports}();var XZ=Object.defineProperty,YZ=Object.getOwnPropertyDescriptor,Wu=(e,s,t,r)=>{for(var i=r>1?void 0:r?YZ(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&&XZ(s,t,i),i};let Wi=class extends M(O,_t){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,this.mdiSleep=d3,this.mdiPause=Dp,this.mdiPrinter3dNozzle=Ws,this.mdiPlus=Tp,this.mdiDragVertical=Ra,this.mdiPalette=qc,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")}};Wu([qe(250)],Wi.prototype,"updateGroupOptionName",1);Wu([qe(250)],Wi.prototype,"updateGroupOptionColorCustom",1);Wu([me("boolFormEdit")],Wi.prototype,"updatedBoolFormEdit",1);Wi=Wu([D({components:{SettingsRow:V,draggable:Yr}})],Wi);var JZ=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(U,{staticClass:"my-2"}):i._e(),a(V,{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($,[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(V,{attrs:{title:i.$t("Settings.MacrosTab.Name")}},[a(te,{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(U,{staticClass:"my-2"}),a(V,{attrs:{title:i.$t("Settings.MacrosTab.Color")}},[a(Ee,{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(U,{staticClass:"my-2"}),a(V,{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(rs,{attrs:{value:i.editGroup.colorCustom,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":i.updateGroupOptionColorCustom}})],1)],1)]:i._e(),a(U,{staticClass:"my-2"}),a(V,{attrs:{title:i.$t("Settings.MacrosTab.Status")}},[a(de,{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 m;return i.updateGroupOptionShowInStandby(!((m=i.editGroup)!==null&&m!==void 0&&m.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(de,{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 m;return i.updateGroupOptionShowInPause(!((m=i.editGroup)!==null&&m!==void 0&&m.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(de,{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 m;return i.updateGroupOptionShowInPrinting(!((m=i.editGroup)!==null&&m!==void 0&&m.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(U,{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($,{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(V,{key:"groupMacro_macro_"+l,attrs:{title:o.name,"sub-title":i.getMacroDescription(o.name),"dynamic-slot-width":!0}},[i.existsMacro(o.name)?[a(de,{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(m){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(de,{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(m){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(de,{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(m){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(de,{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(m){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(de,{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(m){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($,[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(U,{key:"availableMacro_deliver_"+l,staticClass:"my-2"}):i._e(),a(V,{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($,[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)},KZ=[];const hb={};var QZ=E(Wi,JZ,KZ,!1,eq,null,null,null);function eq(e){for(let s in hb)this[s]=hb[s]}const nx=function(){return QZ.exports}();var tq=Object.defineProperty,sq=Object.getOwnPropertyDescriptor,rq=(e,s,t,r)=>{for(var i=r>1?void 0:r?sq(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&&tq(s,t,i),i};let _h=class extends M(O){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")}};_h=rq([D({components:{SettingsMacrosTabExpert:nx,SettingsMacrosTabSimple:ix,SettingsRow:V}})],_h);var iq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[e.showGeneral?t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.General")))]),t(V,{attrs:{title:e.$t("Settings.MacrosTab.Management")}},[t(Ee,{attrs:{items:e.modes,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),t(U,{staticClass:"my-2"})],1):e._e(),e.mode==="expert"?[t(nx,{on:{"update:showGeneral":e.updateShowGeneral,scrollToTop:e.scrollToTop}})]:[t(ix)]],2)},nq=[];const pb={};var aq=E(_h,iq,nq,!1,oq,null,null,null);function oq(e){for(let s in pb)this[s]=pb[s]}const lq=function(){return aq.exports}();var cq=Object.defineProperty,uq=Object.getOwnPropertyDescriptor,dq=(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&&cq(s,t,i),i};let bh=class extends M(O,Ke,Cl){constructor(){super(...arguments),this.mdiGamepad=wp,this.mdiPrinter3dNozzle=Ws}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()}};bh=dq([D({components:{SettingsRow:V}})],bh);var mq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t(cr,{ref:"formControlExtruder"},[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGamepad))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.Headline"))+" ")]),t(U,{staticClass:"ml-3"})],1),t(V,{attrs:{title:e.$t("Settings.ControlTab.Style")}},[t(Ee,{attrs:{items:e.controlStyles,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.controlStyle,callback:function(r){e.controlStyle=r},expression:"controlStyle"}})],1),t(U,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)&&e.actionOptions.length>1?[t(V,{attrs:{title:"Overwrite action button"}},[t(Ee,{attrs:{items:e.actionOptions,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.actionButton,callback:function(r){e.actionButton=r},expression:"actionButton"}})],1),t(U,{staticClass:"my-2"})]:e._e(),t(V,{attrs:{title:e.$t("Settings.ControlTab.HideDuringPrint"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideDuringPrint,callback:function(r){e.hideDuringPrint=r},expression:"hideDuringPrint"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.EnableXYHoming"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.enableXYHoming,callback:function(r){e.enableXYHoming=r},expression:"enableXYHoming"}})],1),t(U,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)?[t(V,{attrs:{title:e.$t("Settings.ControlTab.InvertXMovement"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseX,callback:function(r){e.reverseX=r},expression:"reverseX"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.InvertYMovement"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseY,callback:function(r){e.reverseY=r},expression:"reverseY"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.InvertZMovement"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseZ,callback:function(r){e.reverseZ=r},expression:"reverseZ"}})],1),t(U,{staticClass:"my-2"})]:e._e(),t(V,{attrs:{title:e.$t("Settings.ControlTab.SpeedXY")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.SpeedZ")}},[t(te,{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(U,{staticClass:"my-2"}),e.controlStyle==="cross"?[t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"})]:e.controlStyle==="circle"?[t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"})]:[t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"})],t(V,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetSaveOption"),"sub-title":e.$t("Settings.ControlTab.ZOffsetSaveOptionDescription")}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetIncrements"),"mobile-second-row":!0}},[t(qs,{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(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Headline"))+" ")]),t(U,{staticClass:"ml-3"})],1),t(V,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesEInMm"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.SpeedEInMms"),"mobile-second-row":!0}},[t(qs,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ControlTab.EstimatedExtrusionInfo"),"sub-title":e.$t("Settings.ControlTab.EstimatedExtrusionInfoDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.showEstimatedExtrusionInfo,callback:function(r){e.showEstimatedExtrusionInfo=r},expression:"showEstimatedExtrusionInfo"}})],1)],2)],1)],1)},hq=[];const fb={};var pq=E(bh,mq,hq,!1,fq,null,null,null);function fq(e){for(let s in fb)this[s]=fb[s]}const gq=function(){return pq.exports}();var vq=Object.defineProperty,_q=Object.getOwnPropertyDescriptor,Vf=(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&&vq(s,t,i),i};let Ca=class extends M(O){constructor(){super(...arguments),this.mdiFilter=AT,this.mdiFilterOff=kT,this.mdiPencil=bt,this.mdiDelete=ze,this.mdiConsoleLine=Fa,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)}};Vf([me("consoleHeight")],Ca.prototype,"consoleHeightChanged",1);Vf([qe(500)],Ca.prototype,"updateConsoleHeight",1);Ca=Vf([D({components:{SettingsRow:V}})],Ca);var bq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.form.bool?t(xe,{attrs:{flat:""}},[t(cr,{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(gt,[e._v(" "+e._s(e.form.id===null?e.$t("Settings.ConsoleTab.CreateHeadline"):e.$t("Settings.ConsoleTab.EditHeadline"))+" ")]),t(q,[t(V,{attrs:{title:e.$t("Settings.ConsoleTab.Name").toString()}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.Regex").toString()}},[t(Bs,{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(xe,{attrs:{flat:""}},[t(q,[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiConsoleLine))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Console"))+" ")]),t(U,{staticClass:"ml-3"})],1),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.Direction").toString()}},[t(Ee,{attrs:{items:e.availableDirections,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.consoleDirection,callback:function(r){e.consoleDirection=r},expression:"consoleDirection"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.EntryStyle").toString()}},[t(Ee,{attrs:{items:e.availableEntryStyles,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.entryStyle,callback:function(r){e.entryStyle=r},expression:"entryStyle"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.Height").toString()}},[t(kc,{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(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Filters"))+" ")]),t(U,{staticClass:"ml-3"})],1),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.HideTemperatures").toString(),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?[t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.ConsoleTab.HideTimelapse").toString(),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideTimelapse,callback:function(r){e.hideTimelapse=r},expression:"hideTimelapse"}})],1)]:e._e(),t(U,{staticClass:"my-2"}),e._l(e.consoleFilters,function(r,i){return t("div",{key:i},[i?t(U,{staticClass:"my-2"}):e._e(),t(V,{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)},yq=[];const gb={};var Cq=E(Ca,bq,yq,!1,$q,null,null,null);function $q(e){for(let s in gb)this[s]=gb[s]}const xq=function(){return Cq.exports}();var wq=Object.defineProperty,Sq=Object.getOwnPropertyDescriptor,ax=(e,s,t,r)=>{for(var i=r>1?void 0:r?Sq(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&&wq(s,t,i),i};let Wl=class extends M(O){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze}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(at(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)}};ax([P({required:!0})],Wl.prototype,"preset",2);Wl=ax([D({components:{SettingsRow:V}})],Wl);var Pq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(V,{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)},Dq=[];const vb={};var Tq=E(Wl,Pq,Dq,!1,Mq,null,null,null);function Mq(e){for(let s in vb)this[s]=vb[s]}const ox=function(){return Tq.exports}();var Eq=Object.defineProperty,Oq=Object.getOwnPropertyDescriptor,Lq=(e,s,t,r)=>{for(var i=r>1?void 0:r?Oq(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&&Eq(s,t,i),i};let yh=class extends M(O){constructor(){super(...arguments),this.mdiPencil=bt}editCooldown(){this.$emit("edit")}};yh=Lq([D({components:{SettingsRow:V}})],yh);var Aq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(V,{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)},kq=[];const _b={};var Fq=E(yh,Aq,kq,!1,Rq,null,null,null);function Rq(e){for(let s in _b)this[s]=_b[s]}const lx=function(){return Fq.exports}();var jq=Object.defineProperty,Hq=Object.getOwnPropertyDescriptor,cx=(e,s,t,r)=>{for(var i=r>1?void 0:r?Hq(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&&jq(s,t,i),i};let Gl=class extends M(O){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,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 at(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()}};cx([P({required:!0})],Gl.prototype,"preset",2);Gl=cx([D({components:{SettingsRow:V}})],Gl);var Iq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(cr,{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(gt,[e._v(e._s(e.title))]),t(q,[e.boolInvalidMin?t($,{staticClass:"mt-3"},[t(_,{staticClass:"py-0"},[t(it,{attrs:{dense:"",text:"",type:"error"}},[e._v(e._s(e.$t("Settings.PresetsTab.PresetInfo")))])],1)],1):e._e(),t(V,{attrs:{title:e.$t("Settings.PresetsTab.Name")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.converNameObject(i)}},[t(_e,{staticClass:"shrink mt-0",attrs:{"hide-details":""},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"value.bool"}}),t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(Bs,{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)},Nq=[];const bb={};var Vq=E(Gl,Iq,Nq,!1,Uq,null,null,null);function Uq(e){for(let s in bb)this[s]=bb[s]}const ux=function(){return Vq.exports}();var Bq=Object.defineProperty,Wq=Object.getOwnPropertyDescriptor,Gq=(e,s,t,r)=>{for(var i=r>1?void 0:r?Wq(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&&Bq(s,t,i),i};let Ch=class extends M(O){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,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}};Ch=Gq([D({components:{PresetsForm:ux,PresetsEntryCooldown:lx,PresetsEntry:ox,SettingsRow:V}})],Ch);var zq=Object.defineProperty,Zq=Object.getOwnPropertyDescriptor,dx=(e,s,t,r)=>{for(var i=r>1?void 0:r?Zq(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&&zq(s,t,i),i};let zl=class extends M(O){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=ze,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()}};dx([P({required:!0})],zl.prototype,"inputGcode",2);zl=dx([D({components:{SettingsRow:V}})],zl);var qq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(cr,{on:{submit:function(r){return r.preventDefault(),e.saveCooldown.apply(null,arguments)}}},[t(gt,[e._v(e._s(e.$t("Settings.PresetsTab.EditCooldown")))]),t(q,[t(V,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(Bs,{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)},Xq=[];const yb={};var Yq=E(zl,qq,Xq,!1,Jq,null,null,null);function Jq(e){for(let s in yb)this[s]=yb[s]}const Kq=function(){return Yq.exports}();var Qq=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.boolForm?t(ux,{attrs:{preset:e.formPreset},on:{close:function(r){e.boolForm=!1}}}):e.boolFormCooldown?t(Kq,{attrs:{"input-gcode":e.cooldownGcode},on:{close:function(r){e.boolFormCooldown=!1}}}):t(xe,{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(U,{staticClass:"my-2"}):e._e(),t(ox,{attrs:{preset:r},on:{edit:e.edit}})],1)}),e.presets.length?t(U,{staticClass:"my-2"}):e._e(),t(lx,{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)},eX=[];const Cb={};var tX=E(Ch,Qq,eX,!1,sX,null,null,null);function sX(e){for(let s in Cb)this[s]=Cb[s]}const rX=function(){return tX.exports}();var iX=Object.defineProperty,nX=Object.getOwnPropertyDescriptor,aX=(e,s,t,r)=>{for(var i=r>1?void 0:r?nX(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&&iX(s,t,i),i};let $h=class extends M(O){constructor(){super(...arguments),this.mdiCheckboxMarkedCircle=Dy,this.mdiCancel=Sy,this.mdiPencil=bt,this.mdiDelete=ze,this.mdiAlertOutline=Wn,this.form={bool:!1,hostname:"",port:7125,path:"/",name:"",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){var t;return s.hostname+(s.port!==80?":"+s.port:"")+((t=s.path)!=null?t:"")}createPrinter(){this.form.hostname="",this.form.port=7125,this.form.path="/",this.form.name="",this.form.id=null,this.form.namespace=null,this.form.bool=!0}storePrinter(){const s={hostname:this.form.hostname,port:this.form.port,name:this.form.name,path:this.form.path};this.$store.dispatch("gui/remoteprinters/store",{values:s}),this.form.hostname="",this.form.port=7125,this.form.name="",this.form.id=null,this.form.bool=!1}editPrinter(s){var t,r,i;this.form.id=(t=s.id)!=null?t:null,this.form.hostname=s.hostname,this.form.port=s.port,this.form.path=(r=s.path)!=null?r:"/",this.form.name=(i=s.name)!=null?i:"",this.form.bool=!0}updatePrinter(){const s={hostname:this.form.hostname,port:this.form.port,name:this.form.name,path:this.form.path};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.path="/",this.form.name="",this.form.bool=!1}delPrinter(s){this.$store.dispatch("gui/remoteprinters/delete",s)}};$h=aX([D({components:{SettingsRow:V}})],$h);var oX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.form.bool?t(xe,{attrs:{flat:""}},[t(gt,[e._v(" "+e._s(e.form.id!==null?e.$t("Settings.RemotePrintersTab.EditPrinter"):e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")]),t(q,[t(V,{attrs:{title:e.$t("Settings.RemotePrintersTab.Hostname")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.RemotePrintersTab.Port")}},[t(te,{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),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.RemotePrintersTab.Path")}},[t(te,{attrs:{rules:[function(r){return!r||r.startsWith("/")||"Path must start with /"}],"hide-details":"auto",outlined:"",dense:""},model:{value:e.form.path,callback:function(r){e.$set(e.form,"path",r)},expression:"form.path"}})],1),e.instancesDB!=="moonraker"?[t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.RemotePrintersTab.Name"),"sub-title":e.$t("Settings.RemotePrintersTab.NameDescription")}},[t(te,{attrs:{outlined:"","hide-details":"auto",dense:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1)]:e._e()],2),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(xe,{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(it,{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(U,{staticClass:"my-2"}):e._e(),t(V,{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)},lX=[];const $b={};var cX=E($h,oX,lX,!1,uX,null,null,null);function uX(e){for(let s in $b)this[s]=$b[s]}const dX=function(){return cX.exports}();var mX=Object.defineProperty,hX=Object.getOwnPropertyDescriptor,Ka=(e,s,t,r)=>{for(var i=r>1?void 0:r?hX(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&&mX(s,t,i),i};let Gr=class extends M(O,_t){constructor(){super(...arguments),this.mdiRestart=Zr,this.mdiTimerOutline=f3,this.defaultBigThumbnailBackground=qt}get mode(){return this.$store.state.gui.uiSettings.mode}set mode(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.mode",value:s})}get themeName(){return this.$store.getters["gui/theme"]}set themeName(s){var r,i;const t=fi.find(n=>n.name===s);this.logoColor===this.defaultLogoColor&&(this.logoColor=(r=t==null?void 0:t.colorLogo)!=null?r:Rr),this.primaryColor===this.defaultPrimaryColor&&(this.primaryColor=(i=t==null?void 0:t.colorPrimary)!=null?i:Go),this.$store.dispatch("gui/saveSetting",{name:"uiSettings.theme",value:s})}get modes(){return[{text:this.$t("Settings.UiSettingsTab.ThemeDark"),value:"dark"},{text:this.$t("Settings.UiSettingsTab.ThemeLight"),value:"light"}]}get themes(){return fi.map(s=>({text:s.displayName,value:s.name}))}get logoColor(){return this.$store.state.gui.uiSettings.logo}set logoColor(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.logo",value:s})}get defaultLogoColor(){var s,t;return(t=(s=this.theme)==null?void 0:s.colorLogo)!=null?t:Rr}get defaultPrimaryColor(){var s,t;return(t=(s=this.theme)==null?void 0:s.colorPrimary)!=null?t:Go}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 progressAsFavicon(){return this.$store.state.gui.uiSettings.progressAsFavicon}set progressAsFavicon(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.progressAsFavicon",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 confirmOnCoolDown(){return this.$store.state.gui.uiSettings.confirmOnCoolDown}set confirmOnCoolDown(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnCoolDown",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(){var s,t;return(t=(s=this.powerDevices.find(r=>r.device.toLowerCase()==="printer"))==null?void 0:s.device)!=null?t:"--"}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 printstatusThumbnailZoom(){var s;return(s=this.$store.state.gui.uiSettings.printstatusThumbnailZoom)!=null?s:!0}set printstatusThumbnailZoom(s){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.printstatusThumbnailZoom",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)}onThemeChanged(s){const t=fi.find(r=>r.name===s);t&&t.colorLogo&&(this.logoColor=t.colorLogo)}};Ka([qe(500)],Gr.prototype,"updateLogoColor",1);Ka([qe(500)],Gr.prototype,"updatePrimaryColor",1);Ka([qe(500)],Gr.prototype,"updateBigThumbnailBackground",1);Ka([me("theme")],Gr.prototype,"onThemeChanged",1);Gr=Ka([D({components:{SettingsRow:V}})],Gr);var pX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{attrs:{flat:""}},[t(q,[t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.Mode"),"sub-title":e.$t("Settings.UiSettingsTab.ModeDescription")}},[t(Ee,{staticClass:"mt-0",attrs:{items:e.modes,"hide-details":"",outlined:"",dense:""},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.Theme"),"sub-title":e.$t("Settings.UiSettingsTab.ThemeDescription")}},[t(Ee,{staticClass:"mt-0",attrs:{items:e.themes,"hide-details":"",outlined:"",dense:""},model:{value:e.themeName,callback:function(r){e.themeName=r},expression:"themeName"}})],1),t(U,{staticClass:"my-2"}),t(V,{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(rs,{attrs:{value:e.logoColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateLogoColor}})],1)],1),t(U,{staticClass:"my-2"}),t(V,{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(rs,{attrs:{value:e.primaryColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updatePrimaryColor}})],1)],1),t(U,{staticClass:"my-2"}),t(V,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolBigThumbnail"),"sub-title":e.$t("Settings.UiSettingsTab.BoolBigThumbnailDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBigThumbnail,callback:function(r){e.boolBigThumbnail=r},expression:"boolBigThumbnail"}})],1),e.boolBigThumbnail?[t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.PrintstatusThumbnailZoom"),"sub-title":e.$t("Settings.UiSettingsTab.PrintstatusThumbnailZoomDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.printstatusThumbnailZoom,callback:function(r){e.printstatusThumbnailZoom=r},expression:"printstatusThumbnailZoom"}})],1),t(U,{staticClass:"my-2"}),t(V,{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))]}}],null,!1,2319691296)},[t(rs,{attrs:{value:e.bigThumbnailBackground,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateBigThumbnailBackground}})],1)],1)]:e._e(),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINT"),"sub-title":e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.displayCancelPrint,callback:function(r){e.displayCancelPrint=r},expression:"displayCancelPrint"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ProgressAsFavicon"),"sub-title":e.$t("Settings.UiSettingsTab.ProgressAsFaviconDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.progressAsFavicon,callback:function(r){e.progressAsFavicon=r},expression:"progressAsFavicon"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.LockSliders"),"sub-title":e.$t("Settings.UiSettingsTab.LockSlidersDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.lockSliders,callback:function(r){e.lockSliders=r},expression:"lockSliders"}})],1),t(U,{staticClass:"my-2"}),t(Ac,[t(V,{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(te,{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(U,{directives:[{name:"show",rawName:"v-show",value:e.lockSliders,expression:"lockSliders"}],staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStop"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnEmergencyStop,callback:function(r){e.confirmOnEmergencyStop=r},expression:"confirmOnEmergencyStop"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnCoolDown"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnCoolDownDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnCoolDown,callback:function(r){e.confirmOnCoolDown=r},expression:"confirmOnCoolDown"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChange"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnPowerDeviceChange,callback:function(r){e.confirmOnPowerDeviceChange=r},expression:"confirmOnPowerDeviceChange"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.NavigationStyle"),"sub-title":e.$t("Settings.UiSettingsTab.NavigationStyleDescription")}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.DefaultNavigationState"),"sub-title":e.$t("Settings.UiSettingsTab.DefaultNavigationStateDescription")}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButton"),"sub-title":e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolHideUploadAndPrintButton,callback:function(r){e.boolHideUploadAndPrintButton=r},expression:"boolHideUploadAndPrintButton"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.PowerDeviceName"),"sub-title":e.$t("Settings.UiSettingsTab.PowerDeviceNameDescription"),"dynamic-slot-width":!0}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh"),"sub-title":e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideSaveConfigForBedMash,callback:function(r){e.hideSaveConfigForBedMash=r},expression:"hideSaveConfigForBedMash"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.DisableFanAnimation"),"sub-title":e.$t("Settings.UiSettingsTab.DisableFanAnimationDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.disableFanAnimation,callback:function(r){e.disableFanAnimation=r},expression:"disableFanAnimation"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ManualProbeDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ManualProbeDialogDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolManualProbeDialog,callback:function(r){e.boolManualProbeDialog=r},expression:"boolManualProbeDialog"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.BedScrewsDialog"),"sub-title":e.$t("Settings.UiSettingsTab.BedScrewsDialogDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBedScrewsDialog,callback:function(r){e.boolBedScrewsDialog=r},expression:"boolBedScrewsDialog"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolScrewsTiltAdjustDialog,callback:function(r){e.boolScrewsTiltAdjustDialog=r},expression:"boolScrewsTiltAdjustDialog"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.TempchartHeight"),"sub-title":e.$t("Settings.UiSettingsTab.TempchartHeightDescription")}},[t(kc,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.UiSettingsTab.HideUpdateWarnings"),"sub-title":e.$t("Settings.UiSettingsTab.HideUpdateWarningsDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideUpdateWarnings,callback:function(r){e.hideUpdateWarnings=r},expression:"hideUpdateWarnings"}})],1)],2)],1)],1)},fX=[];const xb={};var gX=E(Gr,pX,fX,!1,vX,null,null,null);function vX(e){for(let s in xb)this[s]=xb[s]}const _X=function(){return gX.exports}();var bX=Object.defineProperty,yX=Object.getOwnPropertyDescriptor,Uf=(e,s,t,r)=>{for(var i=r>1?void 0:r?yX(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&&bX(s,t,i),i};let $a=class extends M(Ns){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiDragVertical=Ra}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?pp:hp}};Uf([P({type:String,required:!0})],$a.prototype,"name",2);Uf([P({type:Boolean,required:!0})],$a.prototype,"visible",2);$a=Uf([D({components:{draggable:Yr}})],$a);var CX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(J,[t($,[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)},$X=[];const wb={};var xX=E($a,CX,$X,!1,wX,"bd581aaa",null,null);function wX(e){for(let s in wb)this[s]=wb[s]}const SX=function(){return xX.exports}();var PX=Object.defineProperty,DX=Object.getOwnPropertyDescriptor,Bf=(e,s,t,r)=>{for(var i=r>1?void 0:r?DX(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&&PX(s,t,i),i};let xa=class extends M(Ns){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiLock=UT}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}))}};Bf([P({type:String,required:!0})],xa.prototype,"viewportName",2);Bf([P({type:Number,required:!1,default:1})],xa.prototype,"column",2);xa=Bf([D({components:{SettingsDashboardSortableItem:SX,draggable:Yr}})],xa);var TX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{staticClass:"mx-auto fill-height",attrs:{"max-width":"300",tile:""}},[t(Oe,{staticClass:"fill-height",attrs:{dense:""}},[e.column<2?t(J,[t($,[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)},MX=[];const Sb={};var EX=E(xa,TX,MX,!1,OX,"021a8703",null,null);function OX(e){for(let s in Sb)this[s]=Sb[s]}const Gu=function(){return EX.exports}();var LX=Object.defineProperty,AX=Object.getOwnPropertyDescriptor,kX=(e,s,t,r)=>{for(var i=r>1?void 0:r?AX(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 xh=class extends M(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","mobileLayout")}};xh=kX([D({components:{SettingsDashboardSortable:Gu}})],xh);var FX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t($,[t(_,[t("settings-dashboard-sortable",{attrs:{"viewport-name":"mobile",column:0}})],1)],1),t($,[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)},RX=[];const Pb={};var jX=E(xh,FX,RX,!1,HX,null,null,null);function HX(e){for(let s in Pb)this[s]=Pb[s]}const IX=function(){return jX.exports}();var NX=Object.defineProperty,VX=Object.getOwnPropertyDescriptor,UX=(e,s,t,r)=>{for(var i=r>1?void 0:r?VX(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&&NX(s,t,i),i};let wh=class extends M(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","tabletLayout1"),this.$store.dispatch("gui/resetLayout","tabletLayout2")}};wh=UX([D({components:{SettingsDashboardSortable:Gu}})],wh);var BX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t($,[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($,[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)},WX=[];const Db={};var GX=E(wh,BX,WX,!1,zX,null,null,null);function zX(e){for(let s in Db)this[s]=Db[s]}const ZX=function(){return GX.exports}();var qX=Object.defineProperty,XX=Object.getOwnPropertyDescriptor,YX=(e,s,t,r)=>{for(var i=r>1?void 0:r?XX(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&&qX(s,t,i),i};let Sh=class extends M(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","desktopLayout1"),this.$store.dispatch("gui/resetLayout","desktopLayout2")}};Sh=YX([D({components:{SettingsDashboardSortable:Gu}})],Sh);var JX=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t($,[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($,[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)},KX=[];const Tb={};var QX=E(Sh,JX,KX,!1,eY,null,null,null);function eY(e){for(let s in Tb)this[s]=Tb[s]}const tY=function(){return QX.exports}();var sY=Object.defineProperty,rY=Object.getOwnPropertyDescriptor,iY=(e,s,t,r)=>{for(var i=r>1?void 0:r?rY(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&&sY(s,t,i),i};let Ph=class extends M(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","widescreenLayout1"),this.$store.dispatch("gui/resetLayout","widescreenLayout2"),this.$store.dispatch("gui/resetLayout","widescreenLayout3")}};Ph=iY([D({components:{SettingsDashboardSortable:Gu}})],Ph);var nY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t($,[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($,[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)},aY=[];const Mb={};var oY=E(Ph,nY,aY,!1,lY,null,null,null);function lY(e){for(let s in Mb)this[s]=Mb[s]}const cY=function(){return oY.exports}();var uY=Object.defineProperty,dY=Object.getOwnPropertyDescriptor,mY=(e,s,t,r)=>{for(var i=r>1?void 0:r?dY(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&&uY(s,t,i),i};let Dh=class extends M(O){constructor(){super(...arguments),this.mdiCellphone=lT,this.mdiTablet=p3,this.mdiMonitorDashboard=Pp,this.mdiMonitorScreenshot=qT,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}};Dh=mY([D({components:{SettingsDashboardTabMobile:IX,SettingsDashboardTabTablet:ZX,SettingsDashboardTabDesktop:tY,SettingsDashboardTabWidescreen:cY}})],Dh);var hY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{attrs:{flat:""}},[t(q,[t($,[t(_,{staticClass:"text-center"},[t(Uo,{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($,[t(_,{staticClass:"dashboard-rows-container"},[t(e.currentTab,{tag:"component"})],1)],1)],1)],1)},pY=[];const Eb={};var fY=E(Dh,hY,pY,!1,gY,"50943ad9",null,null);function gY(e){for(let s in Eb)this[s]=Eb[s]}const vY=function(){return fY.exports}();var _Y=Object.defineProperty,bY=Object.getOwnPropertyDescriptor,Wf=(e,s,t,r)=>{for(var i=r>1?void 0:r?bY(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&&_Y(s,t,i),i};let wa=class extends M(O){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(U,{staticClass:"my-2"}),t(V,{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(rs,{attrs:{value:e.maxFeedColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":function(r){return e.updateColorValue("maxFeedColor",r)}}})],1),t(te,{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)},CY=[];const Ob={};var $Y=E(wa,yY,CY,!1,xY,null,null,null);function xY(e){for(let s in Ob)this[s]=Ob[s]}const wY=function(){return $Y.exports}();var SY=Object.defineProperty,PY=Object.getOwnPropertyDescriptor,DY=(e,s,t,r)=>{for(var i=r>1?void 0:r?PY(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&&SY(s,t,i),i};let Th=class extends M(O){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=DY([D({components:{SettingsRow:V}})],Th);var TY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{attrs:{flat:""}},[t(q,[t(V,{attrs:{title:e.$t("Settings.EditorTab.UseEscToClose"),"sub-title":e.$t("Settings.EditorTab.UseEscToCloseDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.escToClose,callback:function(r){e.escToClose=r},expression:"escToClose"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.EditorTab.ConfirmUnsavedChanges"),"sub-title":e.$t("Settings.EditorTab.ConfirmUnsavedChangesDescription"),"dynamic-slot-width":!0}},[t(Pe,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmUnsavedChanges,callback:function(r){e.confirmUnsavedChanges=r},expression:"confirmUnsavedChanges"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.EditorTab.TabSize"),"sub-title":e.$t("Settings.EditorTab.TabSizeDescription"),"dynamic-slot-width":!0}},[t(Ee,{attrs:{items:e.tabSizes,"hide-details":"",outlined:"",dense:"",attached:""},model:{value:e.tabSize,callback:function(r){e.tabSize=r},expression:"tabSize"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.EditorTab.KlipperRestartMethod"),"sub-title":e.$t("Settings.EditorTab.KlipperRestartMethodDescription")}},[t(Ee,{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)},MY=[];const Lb={};var EY=E(Th,TY,MY,!1,OY,null,null,null);function OY(e){for(let s in Lb)this[s]=Lb[s]}const LY=function(){return EY.exports}();var AY=Object.defineProperty,kY=Object.getOwnPropertyDescriptor,FY=(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&&AY(s,t,i),i};let Mh=class extends M(O){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 availableSnapshotWebcams(){return this.$store.getters["gui/webcams/getWebcams"].filter(s=>s.snapshot_url!=="")}get cameraOptions(){let s=[];return this.availableSnapshotWebcams.length===0?[{value:null,text:this.$t("Settings.TimelapseTab.NoWebcamFound")}]:(this.availableSnapshotWebcams.forEach(t=>{s.push({text:t.name,value:t.name})}),s=At(s,"text"),this.camera===null&&s.unshift({value:null,text:this.$t("Settings.TimelapseTab.SelectWebcam")}),s)}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){s===""&&(s=0),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){s===""||sthis.stepperXmax||this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_x:s})}get stepperXmin(){var s,t,r,i;return(i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t.stepper_x)==null?void 0:r.position_min)!=null?i:0}get stepperXmax(){var s,t,r,i;return(i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t.stepper_x)==null?void 0:r.position_max)!=null?i:200}get park_custom_pos_y(){return this.$store.state.server.timelapse.settings.park_custom_pos_y}set park_custom_pos_y(s){s===""||sthis.stepperYmax||this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_y:s})}get stepperYmin(){var s,t,r,i;return(i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t.stepper_y)==null?void 0:r.position_min)!=null?i:0}get stepperYmax(){var s,t,r,i;return(i=(r=(t=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:t.stepper_y)==null?void 0:r.position_max)!=null?i:200}get park_custom_pos_dz(){return this.$store.state.server.timelapse.settings.park_custom_pos_dz}set park_custom_pos_dz(s){s===""||s<0||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){s===""||s<0||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){s===""||s<=0||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){s===""||s<=0||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){s===""||s<0||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){s===""||s<0||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){s===""||s<0||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){s===""||s<=0||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){s===""||s<=0||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){s===""||s<=0||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){s===""||s<=0||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){s===""||s<=this.variable_fps_min||this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_max:s})}get duplicatelastframe(){return this.$store.state.server.timelapse.settings.duplicatelastframe}set duplicatelastframe(s){s===""||s<0||this.$store.dispatch("server/timelapse/saveSetting",{duplicatelastframe:s})}get camera(){var t;const s=(t=this.$store.state.server.timelapse.settings.camera)!=null?t:null;return s===null||this.blockedsettings.includes("snapshoturl")||this.availableSnapshotWebcams.length===0||this.availableSnapshotWebcams.find(r=>r.name===s)===void 0?null: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})}};Mh=FY([D({components:{SettingsRow:V}})],Mh);var RY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{attrs:{flat:""}},[t(q,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.General")))]),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Enabled"),"sub-title":e.$t("Settings.TimelapseTab.EnabledDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Autorender"),"sub-title":e.$t("Settings.TimelapseTab.AutorenderDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Camera"),"sub-title":e.$t("Settings.TimelapseTab.CameraDescriptionWithSnapshotUrl")}},[e.blockedsettings.includes("snapshoturl")?t(it,{staticClass:"mb-0",attrs:{dense:"",text:"",type:"warning"}},[e._v(" "+e._s(e.$t("Settings.TimelapseTab.CameraWarningAlreadySet"))+" "),t("small",[e._v("("+e._s(e.$t("Settings.TimelapseTab.CameraWarningAlreadySetSmall"))+")")])]):t(Ee,{attrs:{items:e.cameraOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("camera")||e.availableSnapshotWebcams.length===0},model:{value:e.camera,callback:function(r){e.camera=r},expression:"camera"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Mode"),"sub-title":e.$t("Settings.TimelapseTab.ModeDescription")}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.HyperlapseCycle"),"sub-title":e.$t("Settings.TimelapseTab.HyperlapseCycleDescription")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.PreviewImage"),"sub-title":e.$t("Settings.TimelapseTab.PreviewImageDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.SaveFrames"),"sub-title":e.$t("Settings.TimelapseTab.SaveFramesDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.StreamDelayCompensation"),"sub-title":e.$t("Settings.TimelapseTab.StreamDelayCompensationDescription")}},[t(te,{attrs:{type:"number",suffix:"s",step:"0.01","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.GcodeVerbose"),"sub-title":e.$t("Settings.TimelapseTab.GcodeVerboseDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.Parkhead")))]),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Parkhead"),"sub-title":e.$t("Settings.TimelapseTab.ParkheadDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Parkpos"),"sub-title":e.$t("Settings.TimelapseTab.ParkposDescription")}},[t(Ee,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.PosX"),"sub-title":e.$t("Settings.TimelapseTab.PosXDescription")}},[t(te,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=e.stepperXmin&&r<=e.stepperXmax||e.$t("Settings.TimelapseTab.RulesBetweenMinMax",{min:e.stepperXmin,max:e.stepperXmax})}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.PosY"),"sub-title":e.$t("Settings.TimelapseTab.PosYDescription")}},[t(te,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=e.stepperYmin&&r<=e.stepperYmax||e.$t("Settings.TimelapseTab.RulesBetweenMinMax",{min:e.stepperYmin,max:e.stepperYmax})}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.PosDZ"),"sub-title":e.$t("Settings.TimelapseTab.PosDZDescription")}},[t(te,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.TravelSpeed"),"sub-title":e.$t("Settings.TimelapseTab.TravelSpeedDescription")}},[t(te,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.FwRetract"),"sub-title":e.$t("Settings.TimelapseTab.FwRetractDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.RetractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.RetractSpeedDescription")}},[t(te,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.RetractDistance"),"sub-title":e.$t("Settings.TimelapseTab.RetractDistanceDescription")}},[t(te,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.UnretractSpeedDescription")}},[t(te,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractDistance"),"sub-title":e.$t("Settings.TimelapseTab.UnretractDistanceDescription")}},[t(te,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.ParkTime"),"sub-title":e.$t("Settings.TimelapseTab.ParkTimeDescription")}},[t(te,{attrs:{type:"number",suffix:"s","hide-details":"auto",step:"0.1",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],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(U,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.RenderingOptions")))]),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFps"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsDescription"),"dynamic-slot-width":!0}},[t(Pe,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Targetlength"),"sub-title":e.$t("Settings.TimelapseTab.TargetlengthDescription")}},[t(te,{attrs:{type:"number",suffix:"s","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],disabled:e.blockedsettings.includes("targetlength"),"hide-spin-buttons":""},model:{value:e.targetlength,callback:function(r){e.targetlength=r},expression:"targetlength"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMin"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMinDescription")}},[t(te,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMax"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMaxDescription")}},[t(te,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>e.variable_fps_min||e.$t("Settings.TimelapseTab.RulesMin")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.OutputFramerate"),"sub-title":e.$t("Settings.TimelapseTab.OutputFramerateDescription")}},[t(te,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.duplicatelastframe"),"sub-title":e.$t("Settings.TimelapseTab.duplicatelastframeDescription")}},[t(te,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")}],disabled:e.blockedsettings.includes("duplicatelastframe"),"hide-spin-buttons":""},model:{value:e.duplicatelastframe,callback:function(r){e.duplicatelastframe=r},expression:"duplicatelastframe"}})],1),t(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.ConstantRateFactor"),"sub-title":e.$t("Settings.TimelapseTab.ConstantRateFactorDescription")}},[t(te,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",rules:[function(r){return!!r||e.$t("Settings.TimelapseTab.RulesRequired")},function(r){return r>0||e.$t("Settings.TimelapseTab.RulesPositive")}],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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Pixelformat"),"sub-title":e.$t("Settings.TimelapseTab.PixelformatDescription")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.TimeFormatCode"),"sub-title":e.$t("Settings.TimelapseTab.TimeFormatCodeDescription")}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.TimelapseTab.Extraoutputparams"),"sub-title":e.$t("Settings.TimelapseTab.ExtraoutputparamsDescription")}},[t(te,{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)},jY=[];const Ab={};var HY=E(Mh,RY,jY,!1,IY,null,null,null);function IY(e){for(let s in Ab)this[s]=Ab[s]}const NY=function(){return HY.exports}();var VY=Object.defineProperty,UY=Object.getOwnPropertyDescriptor,mx=(e,s,t,r)=>{for(var i=r>1?void 0:r?UY(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&&VY(s,t,i),i};let Zl=class extends M(Ui,O,_t){constructor(){super(...arguments),this.mdiDragVertical=Ra}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?pp:hp}changeVisibility(){this.$store.dispatch("gui/navigation/changeVisibility",this.naviPoint)}};mx([P({type:Object,required:!0})],Zl.prototype,"naviPoint",2);Zl=mx([D({components:{SettingsRow:V,draggable:Yr}})],Zl);var BY=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,{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(V,{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)},WY=[];const kb={};var GY=E(Zl,BY,WY,!1,zY,null,null,null);function zY(e){for(let s in kb)this[s]=kb[s]}const hx=function(){return GY.exports}();var ZY=Object.defineProperty,qY=Object.getOwnPropertyDescriptor,XY=(e,s,t,r)=>{for(var i=r>1?void 0:r?qY(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&&ZY(s,t,i),i};let Eh=class extends M(Ui,O,_t){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")}};Eh=XY([D({components:{SettingsNavigationTabItem:hx,SettingsRow:V,draggable:Yr}})],Eh);var YY=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(hx,{key:i,staticClass:"my-2 mx-0",style:e.draggableBgStyle,attrs:{"navi-point":r}})}),1)],1)],1)},JY=[];const Fb={};var KY=E(Eh,YY,JY,!1,QY,null,null,null);function QY(e){for(let s in Fb)this[s]=Fb[s]}const eJ=function(){return KY.exports}();var tJ=Object.defineProperty,sJ=Object.getOwnPropertyDescriptor,px=(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&&tJ(s,t,i),i};let ql=class extends M(O){constructor(){super(...arguments),this.mdiDelete=ze,this.mdiPalette=qc,this.mdiPencil=bt,this.convertName=at,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),At(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}};px([P({type:Object,default:null})],ql.prototype,"light",2);ql=px([D({components:{SettingsRow:V}})],ql);var rJ=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(V,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.MiscellaneousTab.Start").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.StartDescription").toString()}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.MiscellaneousTab.End").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.EndDescription").toString()}},[t(te,{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(U,{staticClass:"my-2"}):e._e(),t(V,{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($,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoGroupFound"))+" ")])])],1)]]:[t($,[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)},iJ=[];const Rb={};var nJ=E(ql,rJ,iJ,!1,aJ,null,null,null);function aJ(e){for(let s in Rb)this[s]=Rb[s]}const fx=function(){return nJ.exports}();var oJ=Object.defineProperty,lJ=Object.getOwnPropertyDescriptor,zu=(e,s,t,r)=>{for(var i=r>1?void 0:r?lJ(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&&oJ(s,t,i),i};let Gi=class extends M(O){constructor(){super(...arguments),this.mdiDelete=ze,this.mdiPencil=bt,this.convertName=at,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),At(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:Nt.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(e==null||e.layout.push({component:Nt.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(e==null||e.layout.push({component:Nt.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(e.layout=[{component:Nt.ui.Wheel},{component:Nt.ui.Slider,options:{sliderType:"value"}}]),e}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:Nt.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}};zu([P({type:Object,default:null})],Gi.prototype,"light",2);zu([qe({time:250})],Gi.prototype,"onColorRGBChanged",1);zu([qe({time:250})],Gi.prototype,"onColorWhiteChanged",1);Gi=zu([D({components:{SettingsRow:V}})],Gi);var cJ=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(V,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(te,{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(U,{staticClass:"my-2"}),t(V,{attrs:{title:e.$t("Settings.MiscellaneousTab.Color").toString()}},[t($,[t(_,{staticClass:"text-center"},[t(Jn,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(Jn,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(_,[e.existRed?t($,[t(_,[t(je,{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($,[t(_,[t(je,{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($,[t(_,[t(je,{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($,[t(_,[t(je,{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(U,{staticClass:"my-2"}):e._e(),t(V,{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($,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoPresetFound"))+" ")])])],1)]]:[t($,[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)},uJ=[];const jb={};var dJ=E(Gi,cJ,uJ,!1,mJ,null,null,null);function mJ(e){for(let s in jb)this[s]=jb[s]}const gx=function(){return dJ.exports}();var hJ=Object.defineProperty,pJ=Object.getOwnPropertyDescriptor,fJ=(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 Oh=class extends M(O){constructor(){super(...arguments),this.mdiDelete=ze,this.mdiPalette=qc,this.mdiPencil=bt,this.convertName=at,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)}};Oh=fJ([D({components:{SettingsRow:V,SettingsMiscellaneousTabLightGroups:fx,SettingsMiscellaneousTabLightPresets:gx}})],Oh);var gJ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[e.editLightGroupObject?t(fx,{attrs:{light:e.editLightGroupObject},on:{close:function(r){e.editLightGroupObject=null}}}):e.editLightPresetObject?t(gx,{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(U,{staticClass:"my-2"}):e._e(),t(V,{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($,[t(_,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.NoDevicesFound")))])])],1)]],2)],1)},vJ=[];const Hb={};var _J=E(Oh,gJ,vJ,!1,bJ,null,null,null);function bJ(e){for(let s in Hb)this[s]=Hb[s]}const yJ=function(){return _J.exports}();var CJ=Object.defineProperty,$J=Object.getOwnPropertyDescriptor,vx=(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&&CJ(s,t,i),i};let Xl=class extends M(O){constructor(){super(...arguments),this.mdiGrid=Bc}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}};vx([me("colorScheme")],Xl.prototype,"colorSchemeChanged",1);Xl=vx([D({components:{Panel:B,SettingsRow:V}})],Xl);var xJ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(xe,{attrs:{flat:""}},[t(q,[t("div",{staticClass:"d-flex align-center"},[t(v,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGrid))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.HeightmapTab.Heightmap"))+" ")]),t(U,{staticClass:"ml-3"})],1),t(V,{attrs:{title:e.$t("Settings.HeightmapTab.ColorSchemes")}},[t(Ee,{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)},wJ=[];const Ib={};var SJ=E(Xl,xJ,wJ,!1,PJ,null,null,null);function PJ(e){for(let s in Ib)this[s]=Ib[s]}const DJ=function(){return SJ.exports}();var TJ=Object.defineProperty,MJ=Object.getOwnPropertyDescriptor,_x=(e,s,t,r)=>{for(var i=r>1?void 0:r?MJ(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&&TJ(s,t,i),i};let Yl=class extends M(O){constructor(){super(...arguments),this.showSettings=!1,this.activeTab="general",this.mdiCloseThick=pe,this.mdiCogs=bT}get tabTitles(){const e=[{icon:us,name:"general",title:this.$t("Settings.GeneralTab.General")},{icon:qc,name:"ui-settings",title:this.$t("Settings.UiSettingsTab.UiSettings")},{icon:Pp,name:"dashboard",title:this.$t("Settings.DashboardTab.Dashboard")},{icon:sn,name:"webcams",title:this.$t("Settings.WebcamsTab.Webcams")},{icon:zn,name:"macros",title:this.$t("Settings.MacrosTab.Macros")},{icon:b3,name:"control",title:this.$t("Settings.ControlTab.Control")},{icon:Fa,name:"console",title:this.$t("Settings.ConsoleTab.Console")},{icon:Qi,name:"presets",title:this.$t("Settings.PresetsTab.PreheatPresets")},{icon:Ha,name:"remote-printers",title:this.$t("Settings.RemotePrintersTab.RemotePrinters")},{icon:Jc,name:"g-code-viewer",title:this.$t("Settings.GCodeViewerTab.GCodeViewer")},{icon:ja,name:"editor",title:this.$t("Settings.EditorTab.Editor")},{icon:_p,name:"miscellaneous",title:this.$t("Settings.MiscellaneousTab.Miscellaneous")},{icon:BT,name:"navigation",title:this.$t("Settings.NavigationTab.Navigation")},{icon:Bc,name:"heightmap",title:this.$t("Settings.HeightmapTab.Heightmap")}];return this.moonrakerComponents.includes("timelapse")&&e.push({icon:l2,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%"})}}};_x([me("activeTab")],Yl.prototype,"activeTabWatch",1);Yl=_x([D({components:{Panel:B,SettingsUiSettingsTab:_X,SettingsRemotePrintersTab:dX,SettingsPresetsTab:rX,SettingsConsoleTab:xq,SettingsControlTab:gq,SettingsMacrosTab:lq,SettingsWebcamsTab:VZ,SettingsGeneralTab:CZ,SettingsDashboardTab:vY,SettingsGCodeViewerTab:wY,SettingsEditorTab:LY,SettingsTimelapseTab:NY,SettingsMiscellaneousTab:yJ,SettingsNavigationTab:eJ,SettingsHeightmapTab:DJ}})],Yl);var EJ=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(B,{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(Vo,{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(pi,{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($,{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(Vo,{attrs:{vertical:!0},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},e._l(e.tabTitles,function(r,i){return t(pi,{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)},OJ=[];const Nb={};var LJ=E(Yl,EJ,OJ,!1,AJ,"0df340c4",null,null);function AJ(e){for(let s in Nb)this[s]=Nb[s]}const bx=function(){return LJ.exports}();/*! + * vue-router v3.6.5 + * (c) 2022 Evan You + * @license MIT + */function is(e,s){for(var t in s)e[t]=s[t];return e}var kJ=/[!'()*]/g,FJ=function(e){return"%"+e.charCodeAt(0).toString(16)},RJ=/%2C/g,oi=function(e){return encodeURIComponent(e).replace(kJ,FJ).replace(RJ,",")};function Lh(e){try{return decodeURIComponent(e)}catch{}return e}function jJ(e,s,t){s===void 0&&(s={});var r=t||HJ,i;try{i=r(e||"")}catch{i={}}for(var n in s){var a=s[n];i[n]=Array.isArray(a)?a.map(Vb):Vb(a)}return i}var Vb=function(e){return e==null||typeof e=="object"?e:String(e)};function HJ(e){var s={};return e=e.trim().replace(/^(\?|#|&)/,""),e&&e.split("&").forEach(function(t){var r=t.replace(/\+/g," ").split("="),i=Lh(r.shift()),n=r.length>0?Lh(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 IJ(e){var s=e?Object.keys(e).map(function(t){var r=e[t];if(r===void 0)return"";if(r===null)return oi(t);if(Array.isArray(r)){var i=[];return r.forEach(function(n){n!==void 0&&(n===null?i.push(oi(t)):i.push(oi(t)+"="+oi(n)))}),i.join("&")}return oi(t)+"="+oi(r)}).filter(function(t){return t.length>0}).join("&"):null;return s?"?"+s:""}var Jl=/\/?$/;function Kl(e,s,t,r){var i=r&&r.options.stringifyQuery,n=s.query||{};try{n=Ah(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:Ub(s,i),matched:e?NJ(e):[]};return t&&(a.redirectedFrom=Ub(t,i)),Object.freeze(a)}function Ah(e){if(Array.isArray(e))return e.map(Ah);if(e&&typeof e=="object"){var s={};for(var t in e)s[t]=Ah(e[t]);return s}else return e}var vr=Kl(null,{path:"/"});function NJ(e){for(var s=[];e;)s.unshift(e),e=e.parent;return s}function Ub(e,s){var t=e.path,r=e.query;r===void 0&&(r={});var i=e.hash;i===void 0&&(i="");var n=s||IJ;return(t||"/")+n(r)+i}function yx(e,s,t){return s===vr?e===s:s?e.path&&s.path?e.path.replace(Jl,"")===s.path.replace(Jl,"")&&(t||e.hash===s.hash&&Ao(e.query,s.query)):e.name&&s.name?e.name===s.name&&(t||e.hash===s.hash&&Ao(e.query,s.query)&&Ao(e.params,s.params)):!1:!1}function Ao(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"?Ao(a,l):String(a)===String(l)})}function VJ(e,s){return e.path.replace(Jl,"/").indexOf(s.path.replace(Jl,"/"))===0&&(!s.hash||e.hash===s.hash)&&UJ(e.query,s.query)}function UJ(e,s){for(var t in s)if(!(t in e))return!1;return!0}function Cx(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 nr(e){return e.replace(/\/(?:\s*\/)+/g,"/")}var Ql=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"},un=Sx,zJ=Gf,ZJ=JJ,qJ=xx,XJ=wx,YJ=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function Gf(e,s){for(var t=[],r=0,i=0,n="",a=s&&s.delimiter||"/",o;(o=YJ.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],m=o[2],h=o[3],p=o[4],f=o[5],b=o[6],C=o[7];n&&(t.push(n),n="");var S=m!=null&&d!=null&&d!==m,L=b==="+"||b==="*",N=b==="?"||b==="*",R=o[2]||a,x=p||f;t.push({name:h||r++,prefix:m||"",delimiter:R,optional:N,repeat:L,partial:S,asterisk:!!C,pattern:x?eK(x):C?".*":"[^"+ko(R)+"]+?"})}return i1||!R.length)return R.length===0?s():s("span",{},R)}if(this.tag==="a")N.on=L,N.attrs={href:l,"aria-current":C};else{var x=Px(this.$slots.default);if(x){x.isStatic=!1;var T=x.data=is({},x.data);T.on=T.on||{};for(var I in T.on){var j=T.on[I];I in L&&(T.on[I]=Array.isArray(j)?j:[j])}for(var W in L)W in T.on?T.on[W].push(L[W]):T.on[W]=S;var Z=x.data.attrs=is({},x.data.attrs);Z.href=l,Z["aria-current"]=C}else N.on=L}return s(this.tag,N,this.$slots.default)}};function zb(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 Px(e){if(e){for(var s,t=0;t-1&&(b.params[N]=p.params[N]);return b.path=Fo(S.path,b.params),m(S,b,f)}else if(b.path){b.params={};for(var R=0;R-1}function Xu(e,s){return sc(e)&&e._isRouter&&(s==null||e.type===s)}function Kb(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 $K(e){return function(s,t,r){var i=!1,n=0,a=null;Ax(e,function(o,l,c,u){if(typeof o=="function"&&o.cid===void 0){i=!0,n++;var d=Qb(function(f){wK(f)&&(f=f.default),o.resolved=typeof f=="function"?f:ec.extend(f),c.components[u]=f,n--,n<=0&&r()}),m=Qb(function(f){var b="Failed to resolve async component "+u+": "+f;a||(a=sc(f)?f:new Error(b),r(a))}),h;try{h=o(d,m)}catch(f){m(f)}if(h)if(typeof h.then=="function")h.then(d,m);else{var p=h.component;p&&typeof p.then=="function"&&p.then(d,m)}}}),i||r()}}function Ax(e,s){return kx(e.map(function(t){return Object.keys(t.components).map(function(r){return s(t.components[r],t.instances[r],t,r)})}))}function kx(e){return Array.prototype.concat.apply([],e)}var xK=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function wK(e){return e.__esModule||xK&&e[Symbol.toStringTag]==="Module"}function Qb(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 hs=function(s,t){this.router=s,this.base=SK(t),this.current=vr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};hs.prototype.listen=function(s){this.cb=s};hs.prototype.onReady=function(s,t){this.ready?s():(this.readyCbs.push(s),t&&this.readyErrorCbs.push(t))};hs.prototype.onError=function(s){this.errorCbs.push(s)};hs.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&&(!Xu(o,Kr.redirected)||a!==vr)&&(i.ready=!0,i.readyErrorCbs.forEach(function(l){l(o)}))})};hs.prototype.confirmTransition=function(s,t,r){var i=this,n=this.current;this.pending=s;var a=function(f){!Xu(f)&&sc(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(yx(s,n)&&o===l&&s.matched[o]===n.matched[l])return this.ensureURL(),s.hash&&ar(this.router,n,s,!1),a(_K(n,s));var c=PK(this.current.matched,s.matched),u=c.updated,d=c.deactivated,m=c.activated,h=[].concat(TK(d),this.router.beforeHooks,MK(u),m.map(function(f){return f.beforeEnter}),$K(m)),p=function(f,b){if(i.pending!==s)return a(Jb(n,s));try{f(s,n,function(C){C===!1?(i.ensureURL(!0),a(bK(n,s))):sc(C)?(i.ensureURL(!0),a(C)):typeof C=="string"||typeof C=="object"&&(typeof C.path=="string"||typeof C.name=="string")?(a(vK(n,s)),typeof C=="object"&&C.replace?i.replace(C):i.push(C)):b(C)})}catch(C){a(C)}};Kb(h,p,function(){var f=EK(m),b=f.concat(i.router.resolveHooks);Kb(b,p,function(){if(i.pending!==s)return a(Jb(n,s));i.pending=null,t(s),i.router.app&&i.router.app.$nextTick(function(){Cx(s)})})})};hs.prototype.updateRoute=function(s){this.current=s,this.cb&&this.cb(s)};hs.prototype.setupListeners=function(){};hs.prototype.teardown=function(){this.listeners.forEach(function(s){s()}),this.listeners=[],this.current=vr,this.pending=null};function SK(e){if(!e)if(Qa){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 PK(e,s){var t,r=Math.max(e.length,s.length);for(t=0;t0)){var i=this.router,n=i.options.scrollBehavior,a=or&&n;a&&this.listeners.push(Ox());var o=function(){var l=r.current,c=An(r.base);r.current===vr&&c===r._startLocation||r.transitionTo(c,function(u){a&&ar(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){tc(nr(a.base+c.fullPath)),ar(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){Rh(nr(a.base+c.fullPath)),ar(a.router,c,l,!1),i&&i(c)},n)},s.prototype.ensureURL=function(r){if(An(this.base)!==this.current.fullPath){var i=nr(this.base+this.current.fullPath);r?tc(i):Rh(i)}},s.prototype.getCurrentLocation=function(){return An(this.base)},s}(hs);function An(e){var s=window.location.pathname,t=s.toLowerCase(),r=e.toLowerCase();return e&&(t===r||t.indexOf(nr(r+"/"))===0)&&(s=s.slice(e.length)),(s||"/")+window.location.search+window.location.hash}var jx=function(e){function s(t,r,i){e.call(this,t,r),!(i&&LK(this.base))&&e0()}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=or&&n;a&&this.listeners.push(Ox());var o=function(){var c=r.current;e0()&&r.transitionTo(Ro(),function(u){a&&ar(r.router,u,c,!0),or||jo(u.fullPath)})},l=or?"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){t0(c.fullPath),ar(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){jo(c.fullPath),ar(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;Ro()!==i&&(r?t0(i):jo(i))},s.prototype.getCurrentLocation=function(){return Ro()},s}(hs);function LK(e){var s=An(e);if(!/^\/#/.test(s))return window.location.replace(nr(e+"/#"+s)),!0}function e0(){var e=Ro();return e.charAt(0)==="/"?!0:(jo("/"+e),!1)}function Ro(){var e=window.location.href,s=e.indexOf("#");return s<0?"":(e=e.slice(s+1),e)}function jh(e){var s=window.location.href,t=s.indexOf("#"),r=t>=0?s.slice(0,t):s;return r+"#"+e}function t0(e){or?tc(jh(e)):window.location.hash=e}function jo(e){or?Rh(jh(e)):window.location.replace(jh(e))}var AK=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){Xu(o,Kr.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}(hs),He=function(s){s===void 0&&(s={}),this.app=null,this.apps=[],this.options=s,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=cK(s.routes||[],this);var t=s.mode||"hash";switch(this.fallback=t==="history"&&!or&&s.fallback!==!1,this.fallback&&(t="hash"),Qa||(t="abstract"),this.mode=t,t){case"history":this.history=new Rx(this,s.base);break;case"hash":this.history=new jx(this,s.base,this.fallback);break;case"abstract":this.history=new AK(this,s.base);break}},Hx={currentRoute:{configurable:!0}};He.prototype.match=function(s,t,r){return this.matcher.match(s,t,r)};Hx.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 Rx||r instanceof jx){var i=function(a){var o=r.current,l=t.options.scrollBehavior,c=or&&l;c&&"fullPath"in a&&ar(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 Yf(this.beforeHooks,s)};He.prototype.beforeResolve=function(s){return Yf(this.resolveHooks,s)};He.prototype.afterEach=function(s){return Yf(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=qf(s,t,r,this),n=this.match(i,t),a=n.redirectedFrom||n.fullPath,o=this.history.base,l=kK(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!==vr&&this.history.transitionTo(this.history.getCurrentLocation())};He.prototype.addRoutes=function(s){this.matcher.addRoutes(s),this.history.current!==vr&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(He.prototype,Hx);var Ix=He;function Yf(e,s){return e.push(s),function(){var t=e.indexOf(s);t>-1&&e.splice(t,1)}}function kK(e,s,t){var r=t==="hash"?"#"+s:s;return e?nr(e+"/"+r):r}He.install=kh;He.version="3.6.5";He.isNavigationFailure=Xu;He.NavigationFailureType=Kr;He.START_LOCATION=vr;Qa&&window.Vue&&window.Vue.use(He);y.use(Ix);const Sa=new Ix({base:"/",mode:"history",routes:J$});var FK=Object.defineProperty,RK=Object.getOwnPropertyDescriptor,jK=(e,s,t,r)=>{for(var i=r>1?void 0:r?RK(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&&FK(s,t,i),i};let Hh=class extends M(O){constructor(){super(...arguments),this.mdiChevronDown=hr}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})}};Hh=jK([D],Hh);var HK=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(J,{key:r._namespace,attrs:{"two-line":"",disabled:!r.socket.isConnected,link:""},on:{click:function(i){return e.changePrinter(r)}}},[t(vt,[t(Ge,[e._v(e._s(e.getPrinterName(r._namespace)))]),t(Aa,[e._v(e._s(e.getPrinterDescription(r)))])],1)],1)}),1)],1)},IK=[];const s0={};var NK=E(Hh,HK,IK,!1,VK,null,null,null);function VK(e){for(let s in s0)this[s]=s0[s]}const Nx=function(){return NK.exports}();var UK=Object.defineProperty,BK=Object.getOwnPropertyDescriptor,Yu=(e,s,t,r)=>{for(var i=r>1?void 0:r?BK(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&&UK(s,t,i),i};let Zi=class extends M(O){constructor(){super(...arguments),this.mdiClose=ka,this.mdiLinkVariant=Uy,this.mdiBellOffOutline=nT,this.expand=!1,this.showMaintenanceDetails=!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)}get maintenanceEntry(){if(this.entryType!=="maintenance")return null;const e=this.entry.id.replace("maintenance/","");return this.$store.getters["gui/maintenance/getEntries"].find(t=>t.id===e)}get reminderTimes(){let e=[{text:this.$t("App.Notifications.NextReboot"),clickFunction:()=>this.dismiss("reboot",null)},{text:this.$t("App.Notifications.Never"),clickFunction:()=>this.close()}];return["announcement","maintenance"].includes(this.entryType)&&(e=[],e.push({text:this.$t("App.Notifications.OneHourShort"),clickFunction:()=>this.dismiss("time",60*60)}),e.push({text:this.$t("App.Notifications.OneDayShort"),clickFunction:()=>this.dismiss("time",60*60*24)}),e.push({text:this.$t("App.Notifications.OneWeekShort"),clickFunction:()=>this.dismiss("time",60*60*24*7)})),e}xButtonAction(){if(this.entryType==="announcement")return this.close();this.dismiss("reboot",null)}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)}};Yu([P({required:!0})],Zi.prototype,"entry",2);Yu([P({default:!0})],Zi.prototype,"parentState",2);Yu([me("parentState")],Zi.prototype,"parentStateUpdate",1);Zi=Yu([D({components:{}})],Zi);var WK=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(it,{class:"notification-menu-entry--priority-".concat(e.entry.priority),attrs:{text:"",color:e.alertColor,border:"left"}},[t($,{staticClass:"flex-nowrap",attrs:{align:"start"}},[t(_,{staticClass:"grow pb-2"},[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))])]),t("p",{staticClass:"notification-menu-entry__description text-body-2 mb-0 text--disabled font-weight-light",domProps:{innerHTML:e._s(e.formatedText)}}),e.entryType==="maintenance"?t(g,{staticClass:"mt-3 mb-0 w-100",attrs:{outlined:"",small:"",color:e.alertColor},on:{click:function(r){e.showMaintenanceDetails=!0}}},[e._v(" "+e._s(e.$t("App.Notifications.ShowDetails"))+" ")]):e._e()],1),e.entry.priority!=="critical"?t(_,{staticClass:"shrink pl-0 pb-1 pt-1 pr-2 d-flex flex-column align-self-stretch justify-space-between"},[e.entryType!=="maintenance"?t(g,{staticClass:"mb-2",attrs:{icon:"",plain:"",color:e.alertColor},on:{click:e.xButtonAction}},[t(v,[e._v(e._s(e.mdiClose))])],1):e._e(),t(ae),t(g,{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($,[t(Ac,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}],staticClass:"pt-1 w-100"},[t(U,{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._l(e.reminderTimes,function(r){return t(g,{key:r.text,staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:r.clickFunction}},[e._v(" "+e._s(r.text)+" ")])})],2)],1)])],1):e._e(),e.entryType==="maintenance"?t(pf,{attrs:{show:e.showMaintenanceDetails,item:e.maintenanceEntry},on:{close:function(r){e.showMaintenanceDetails=!1}}}):e._e()],1)},GK=[];const r0={};var zK=E(Zi,WK,GK,!1,ZK,"199aea20",null,null);function ZK(e){for(let s in r0)this[s]=r0[s]}const Vx=function(){return zK.exports}();var qK=Object.defineProperty,XK=Object.getOwnPropertyDescriptor,YK=(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&&qK(s,t,i),i};let Ih=class extends M(O){constructor(){super(...arguments),this.mdiBell=iT,this.mdiBellOutline=aT,this.mdiCloseBoxMultipleOutline=gT,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})})}};Ih=YK([D({components:{NotificationMenuEntry:Vx}})],Ih);var JK=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(ay,{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(xe,{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(Vx,{key:r.id,class:i1?[t(U),t(ne,[t(ae),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)},KK=[];const i0={};var QK=E(Ih,JK,KK,!1,eQ,"1b8a7ab6",null,null);function eQ(e){for(let s in i0)this[s]=i0[s]}const Ux=function(){return QK.exports}();var tQ=Object.defineProperty,sQ=Object.getOwnPropertyDescriptor,Bx=(e,s,t,r)=>{for(var i=r>1?void 0:r?sQ(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&&tQ(s,t,i),i};let rc=class extends M(O){constructor(){super(...arguments),this.mdiAlertOctagonOutline=$y,this.mdiCloseThick=pe}emergencyStop(){this.$socket.emit("printer.emergency_stop",{},{loading:"topbarEmergencyStop"}),this.closePrompt()}closePrompt(){this.$emit("close")}};Bx([P({type:Boolean,default:!1})],rc.prototype,"showDialog",2);rc=Bx([D({components:{Panel:B}})],rc);var rQ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"400",persistent:""}},[t(B,{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:e.closePrompt}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(q,[e._v(e._s(e.$t("EmergencyStopDialog.AreYouSure")))]),t(ne,[t(ae),t(g,{attrs:{text:""},on:{click:e.closePrompt}},[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)},iQ=[];const n0={};var nQ=E(rc,rQ,iQ,!1,aQ,null,null,null);function aQ(e){for(let s in n0)this[s]=n0[s]}const Wx=function(){return nQ.exports}(),$n={};function oQ(e){return Object.keys(e).reduce((s,t)=>(e[t]!==!1&&e[t]!==null&&e[t]!==void 0&&(s[t]=e[t]),s),{})}const lQ={name:"InlineSvg",inheritAttrs:!1,render(e){return this.svgElSource?e("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),oQ(this.$attrs)),domProps:{innerHTML:this.getSvgContent(this.svgElSource)}}):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0}},data(){return{svgElSource:null}},watch:{src(e){this.getSource(e)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(e){let s={};const t=e.attributes;if(!t)return s;for(let r=t.length-1;r>=0;r--)s[t[r].name]=t[r].value;return s},getSvgContent(e){return e=e.cloneNode(!0),e=this.transformSource(e),this.title&&cQ(e,this.title),e.innerHTML},getSource(e){$n[e]||($n[e]=this.download(e)),this.svgElSource&&$n[e].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),$n[e].then(s=>{this.svgElSource=s,this.$nextTick(()=>{this.$emit("loaded",this.$el)})}).catch(s=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete $n[e],this.$emit("error",s)})},download(e){return uQ(new Promise((s,t)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.onload=()=>{if(r.status>=200&&r.status<400)try{let a=new DOMParser().parseFromString(r.responseText,"text/xml").getElementsByTagName("svg")[0];a?s(a):t(new Error('Loaded file is not valid SVG"'))}catch(i){t(i)}else t(new Error("Error loading SVG"))},r.onerror=t,r.send()}))}}};function cQ(e,s){const t=e.getElementsByTagName("title");if(t.length)t[0].textContent=s;else{const r=document.createElementNS("http://www.w3.org/2000/svg","title");r.textContent=s,e.insertBefore(r,e.firstChild)}}function uQ(e){if(e.getIsPending)return e;let s=!0,t=e.then(r=>(s=!1,r),r=>{throw s=!1,r});return t.getIsPending=function(){return s},t}var dQ=Object.defineProperty,mQ=Object.getOwnPropertyDescriptor,hQ=(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 Nh=class extends M(O,_t){constructor(){super(...arguments),this.mdiAlertOctagonOutline=$y,this.mdiContentSave=vp,this.mdiFileUpload=Ry,this.mdiClose=ka,this.mdiCloseThick=pe,this.topbarHeight=kn,this.showEmergencyStopDialog=!1,this.uploadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,cancelTokenSource:null},this.formatFilesize=Je}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 countPrinters(){return this.$store.getters["farm/countPrinters"]}get boolHideUploadAndPrintButton(){var e;return(e=this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton)!=null?e:!1}get isSvgLogo(){return this.sidebarLogo.includes(".svg?timestamp=")||this.sidebarLogo.endsWith(".svg")}get logoColor(){return this.$store.state.gui.uiSettings.logo}get logoClasses(){return["nav-logo","ml-2","mr-1","d-none","d-sm-flex"]}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,s.append("file",e,t),s.append("print","true"),new Promise(r=>{this.uploadSnackbar.cancelTokenSource=ks.CancelToken.source(),ks.post(this.apiUrl+"/server/files/upload",s,{cancelToken:this.uploadSnackbar.cancelTokenSource.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:i=>{var n,a,o;this.uploadSnackbar.percent=((n=i.progress)!=null?n:0)*100,this.uploadSnackbar.speed=(a=i.rate)!=null?a:0,this.uploadSnackbar.total=(o=i.total)!=null?o:0}}).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}};Nh=hQ([D({components:{EmergencyStopDialog:Wx,InlineSvg:lQ,Panel:B,TheSettingsMenu:bx,TheTopCornerMenu:ex,PrinterSelector:Nx,MainsailLogo:rn,TheNotificationMenu:Ux}})],Nh);var pQ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(SP,{staticClass:"topbar pa-0",attrs:{app:"","elevate-on-scroll":"",height:e.topbarHeight,"clipped-left":""}},[t(PP,{attrs:{tile:""},on:{click:function(r){r.stopPropagation(),e.naviDrawer=!e.naviDrawer}}}),t("router-link",{attrs:{to:"/"}},[e.sidebarLogo&&e.isSvgLogo?t("inline-svg",{class:e.logoClasses,attrs:{src:e.sidebarLogo}}):e.sidebarLogo?t("img",{class:e.logoClasses,attrs:{src:e.sidebarLogo,alt:"Logo"}}):t(rn,{class:e.logoClasses,attrs:{color:e.logoColor,router:"",to:"/",ripple:!1}})],1),t(Yi,{staticClass:"text-no-wrap ml-0 pl-2 mr-2"},[e._v(e._s(e.printerName))]),e.countPrinters?t(Nx):e._e(),t(ae),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(Ux),t(bx),t(ex)],1),t(_i,{attrs:{timeout:-1,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(ws,{staticClass:"mt-2",attrs:{value:e.uploadSnackbar.percent}})],1),t(Wx,{attrs:{"show-dialog":e.showEmergencyStopDialog},on:{close:function(r){e.showEmergencyStopDialog=!1}}})],1)},fQ=[];const a0={};var gQ=E(Nh,pQ,fQ,!1,vQ,"f14843f0",null,null);function vQ(e){for(let s in a0)this[s]=a0[s]}const Gx=function(){return gQ.exports}();var _Q=Object.defineProperty,bQ=Object.getOwnPropertyDescriptor,zx=(e,s,t,r)=>{for(var i=r>1?void 0:r?bQ(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&&_Q(s,t,i),i};let ic=class extends M(O){constructor(){super(...arguments),this.mdiUpdate=Ia,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)}};zx([me("messages")],ic.prototype,"messagesChanged",1);ic=zx([D({components:{}})],ic);var yQ=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(xe,{attrs:{loading:!e.complete}},[t("template",{slot:"progress"},[t(ws,{attrs:{color:"primary",indeterminate:""}})],1),t(La,{attrs:{flat:"",dense:""}},[t(Yi,[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($,[t(_,{staticClass:"py-6 px-0"},[t("overlay-scrollbars",{ref:"updaterLogScroll",staticClass:"updaterLogScroll"},[t(zr,{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($,[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)},CQ=[];const o0={};var $Q=E(ic,yQ,CQ,!1,xQ,"de6f962a",null,null);function xQ(e){for(let s in o0)this[s]=o0[s]}const Zx=function(){return $Q.exports}();var wQ=Object.defineProperty,SQ=Object.getOwnPropertyDescriptor,PQ=(e,s,t,r)=>{for(var i=r>1?void 0:r?SQ(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&&wQ(s,t,i),i};let Vh=class extends M(O,_t){constructor(){super(...arguments),this.mdiConnection=fp,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 path(){return this.$store.state.socket.path}get formatHostname(){return parseInt(this.port)!==80&&this.port!==""?this.hostname+":"+this.port+this.path:this.hostname+this.path}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()}};Vh=PQ([D({components:{ConnectionStatus:su}})],Vh);var DQ=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(xe,[t(La,{attrs:{flat:"",dense:""}},[t(Yi,[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(su,{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(U,{staticClass:"my-3"}),t("p",[e._v(e._s(e.$t("ConnectionDialog.CheckMoonrakerLog")))]),t("ul",[t("li",[e._v("~/printer_data/logs/moonraker.log")])]),t(U,{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(ws,{attrs:{color:e.progressBarColor,indeterminate:""}})],1)],1)],1)},TQ=[];const l0={};var MQ=E(Vh,DQ,TQ,!1,EQ,null,null,null);function EQ(e){for(let s in l0)this[s]=l0[s]}const qx=function(){return MQ.exports}(),OQ=y.component("CodemirrorAsync",()=>fe(()=>import("./Codemirror-96aef739.js"),["assets/Codemirror-96aef739.js","assets/codemirror-0a1db0c7.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js"]));var LQ=Object.defineProperty,AQ=Object.getOwnPropertyDescriptor,Xx=(e,s,t,r)=>{for(var i=r>1?void 0:r?AQ(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 nc=class extends M(O){constructor(){super(...arguments),this.mdiCog=us,this.mdiUsb=d2,this.mdiCloseThick=pe,this.tab="serial",this.hideSystemEntries=!0}get tabs(){const s=[{tab:"serial",title:"Serial"},{tab:"usb",title:"USB"},{tab:"video",title:"Video"}];return this.canInterfaces.forEach(t=>{s.push({tab:t,title:t.toUpperCase()})}),s.sort((t,r)=>t.title.localeCompare(r.title))}get canInterfaces(){var s,t;return Object.keys((t=(s=this.$store.state.server.system_info)==null?void 0:s.canbus)!=null?t:{})}closePrompt(){this.$emit("close")}};Xx([P({type:Boolean,default:!1})],nc.prototype,"showDialog",2);nc=Xx([D({components:{Panel:B}})],nc);var kQ=Object.defineProperty,FQ=Object.getOwnPropertyDescriptor,Yx=(e,s,t,r)=>{for(var i=r>1?void 0:r?FQ(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&&kQ(s,t,i),i};let ac=class extends M(O){constructor(){super(...arguments),this.v4l2Devices=[],this.libcameraDevices=[],this.loading=!1,this.loaded=!1}get filteredLibcameraDevices(){return this.hideSystemEntries?this.libcameraDevices.filter(e=>!e.libcamera_id.includes("usb@")):this.libcameraDevices}get filteredV4l2Devices(){return this.v4l2Devices.filter(e=>this.hideSystemEntries?this.libcameraDevices.length===0&&e.hardware_bus.endsWith("csi")?!0:!e.hardware_bus.startsWith("platform:"):!0)}async refresh(){var s,t;this.loading=!0;const e=await fetch(this.apiUrl+"/machine/peripherals/video").then(r=>r.json()).then(r=>{var i;return(i=r.result)!=null?i:{}});this.v4l2Devices=(s=e.v4l2_devices)!=null?s:[],this.libcameraDevices=(t=e.libcamera_devices)!=null?t:[],this.loading=!1,this.loaded=!0}};Yx([P({type:Boolean,default:!1})],ac.prototype,"hideSystemEntries",2);ac=Yx([D],ac);let _o;const RQ=new Uint8Array(16);function jQ(){if(!_o&&(_o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _o(RQ)}const ct=[];for(let e=0;e<256;++e)ct.push((e+256).toString(16).slice(1));function HQ(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 IQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),c0={randomUUID:IQ};function os(e,s,t){if(c0.randomUUID&&!s&&!e)return c0.randomUUID();e=e||{};const r=e.random||(e.rng||jQ)();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 HQ(r)}var NQ=Object.defineProperty,VQ=Object.getOwnPropertyDescriptor,Jf=(e,s,t,r)=>{for(var i=r>1?void 0:r?VQ(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&&NQ(s,t,i),i};let Pa=class extends M(O){constructor(){super(...arguments),this.mdiContentCopy=gp,this.isShowTooltip=!1,this.cssClassName=""}mounted(){this.cssClassName="textfield-with-copy-".concat(os())}copy(){ME(this.value),this.isShowTooltip=!0,setTimeout(()=>this.isShowTooltip=!1,2e3)}};Jf([P({type:String,required:!0})],Pa.prototype,"label",2);Jf([P({type:String,required:!0})],Pa.prototype,"value",2);Pa=Jf([D],Pa);var UQ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(te,{class:e.cssClassName,attrs:{readonly:"",dense:"",outlined:"","hide-details":"",label:e.label,value:e.value},scopedSlots:e._u([{key:"append",fn:function(){return[t(v,{on:{click:e.copy}},[e._v(e._s(e.mdiContentCopy))]),t(de,{attrs:{"open-on-click":"","open-on-hover":!1,attach:"."+e.cssClassName,"position-x":50,"position-y":0},model:{value:e.isShowTooltip,callback:function(r){e.isShowTooltip=r},expression:"isShowTooltip"}},[t("span",[e._v(e._s(e.$t("App.TextfieldWithCopy.Copied")))])])]},proxy:!0}])})},BQ=[];const u0={};var WQ=E(Pa,UQ,BQ,!1,GQ,"da2acfb4",null,null);function GQ(e){for(let s in u0)this[s]=u0[s]}const Zt=function(){return WQ.exports}();var zQ=Object.defineProperty,ZQ=Object.getOwnPropertyDescriptor,Jx=(e,s,t,r)=>{for(var i=r>1?void 0:r?ZQ(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&&zQ(s,t,i),i};let oc=class extends M(O){get identicalResolutions(){const e=this.device.modes.map(s=>s.resolutions.sort(w2).join(","));return e.every(s=>s===e[0])}get resolutions(){var e,s,t;return(t=(s=(e=this.device.modes[0])==null?void 0:e.resolutions)==null?void 0:s.join(", "))!=null?t:""}get formats(){return this.device.modes.map(e=>"".concat(e.description," (").concat(e.format,")")).join(", ")}get show_alt_name(){return this.device.alt_name===null?!1:this.device.alt_name!==this.device.camera_name}};Jx([P({type:Object,required:!0})],oc.prototype,"device",2);oc=Jx([D({components:{TextfieldWithCopy:Zt}})],oc);var qQ=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(vt,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[e._v("V4L2")]),t(Ge,{staticClass:"text-h5 mb-0"},[e._v(e._s(e.device.camera_name))]),e.show_alt_name?t(Aa,[e._v(e._s(e.device.alt_name))]):e._e()],1)],1),t(q,[t($,[t(_,[t(Zt,{attrs:{label:e.$t("DevicesDialog.DevicePath"),value:e.device.device_path}})],1)],1),e.device.path_by_id?t($,[t(_,[t(Zt,{attrs:{label:e.$t("DevicesDialog.PathById"),value:e.device.path_by_id}})],1)],1):e._e(),e.device.path_by_hardware?t($,[t(_,[t(Zt,{attrs:{label:e.$t("DevicesDialog.PathByHardware"),value:e.device.path_by_hardware}})],1)],1):e._e(),e.device.modes.length?[e.identicalResolutions?[t($,{staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Formats")))]),t(_,{staticClass:"py-2"},[e._v(e._s(e.formats))])],1),t($,{staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Resolutions")))]),t(_,{staticClass:"py-2"},[e._v(e._s(e.resolutions))])],1)]:e._l(e.device.modes,function(r){return t($,{key:r.format,staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(" "+e._s(r.description)+" "),t("br"),t("small",[e._v(e._s(r.format))])]),t(_,{staticClass:"py-2"},[e._v(e._s(r.resolutions.join(", ")))])],1)})]:e._e()],2)],1)},XQ=[];const d0={};var YQ=E(oc,qQ,XQ,!1,JQ,null,null,null);function JQ(e){for(let s in d0)this[s]=d0[s]}const KQ=function(){return YQ.exports}();var QQ=Object.defineProperty,eee=Object.getOwnPropertyDescriptor,Kx=(e,s,t,r)=>{for(var i=r>1?void 0:r?eee(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&&QQ(s,t,i),i};let lc=class extends M(O){get identicalResolutions(){const e=this.device.modes.map(s=>s.resolutions.sort(w2).join(","));return e.every(s=>s===e[0])}get resolutions(){return this.device.modes[0].resolutions.join(", ")}get formats(){return this.device.modes.map(e=>e.format).join(", ")}};Kx([P({type:Object,required:!0})],lc.prototype,"device",2);lc=Kx([D({components:{TextfieldWithCopy:Zt}})],lc);var tee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(vt,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[e._v("Libcamera")]),t(Ge,{staticClass:"text-h5 mb-0"},[e._v(e._s(e.device.model))])],1)],1),t(q,[t($,{staticClass:"mb-1"},[t(_,[t(Zt,{attrs:{label:e.$t("DevicesDialog.LibcameraId"),value:e.device.libcamera_id}})],1)],1),e.identicalResolutions?[t($,{staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Formats")))]),t(_,{staticClass:"py-2"},[e._v(e._s(e.formats))])],1),t($,{staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Resolutions")))]),t(_,{staticClass:"py-2"},[e._v(e._s(e.resolutions))])],1)]:e._l(e.device.modes,function(r){return t($,{key:r.format,staticClass:"mt-0"},[t(_,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(r.format))]),t(_,{staticClass:"py-2"},[e._v(e._s(r.resolutions.join(", ")))])],1)})],2)],1)},see=[];const m0={};var ree=E(lc,tee,see,!1,iee,null,null,null);function iee(e){for(let s in m0)this[s]=m0[s]}const nee=function(){return ree.exports}();var aee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,[t($,[t(_,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.libcameraDevices.length||e.filteredV4l2Devices.length?t($,{staticClass:"mt-0"},[t(_,[e._l(e.filteredLibcameraDevices,function(r,i){return t(nee,{key:"libcamera_".concat(r.libcamera_id,"_").concat(i),attrs:{device:r}})}),e._l(e.filteredV4l2Devices,function(r,i){return t(KQ,{key:"v4l2_".concat(r.hardware_bus,"_").concat(i),attrs:{device:r}})})],2)],1):e.loaded?t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},oee=[];const h0={};var lee=E(ac,aee,oee,!1,cee,null,null,null);function cee(e){for(let s in h0)this[s]=h0[s]}const uee=function(){return lee.exports}();var dee=Object.defineProperty,mee=Object.getOwnPropertyDescriptor,Qx=(e,s,t,r)=>{for(var i=r>1?void 0:r?mee(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&&dee(s,t,i),i};let cc=class extends M(O){constructor(){super(...arguments),this.devices=[],this.loading=!1,this.loaded=!1}get filteredDevices(){return this.hideSystemEntries?this.devices.filter(e=>e.class!=="Hub"):this.devices}async refresh(){this.loading=!0,this.devices=await fetch(this.apiUrl+"/machine/peripherals/usb").then(e=>e.json()).then(e=>{var s,t;return(t=(s=e.result)==null?void 0:s.usb_devices)!=null?t:[]}),this.loading=!1,this.loaded=!0}};Qx([P({type:Boolean,default:!1})],cc.prototype,"hideSystemEntries",2);cc=Qx([D],cc);var hee=Object.defineProperty,pee=Object.getOwnPropertyDescriptor,ew=(e,s,t,r)=>{for(var i=r>1?void 0:r?pee(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&&hee(s,t,i),i};let uc=class extends M(O){get details(){const e=["protocol","class","serial","usb_location"],s=[];return Object.keys(this.device).forEach(t=>{var i;let r=(i=this.device[t])!=null?i:null;!e.includes(t)||r===null||(t==="class"&&this.device.subclass&&(r+=", ".concat(this.device.subclass)),s.push({key:t,value:r}))}),s}};ew([P({type:Object,required:!0})],uc.prototype,"device",2);uc=ew([D],uc);var fee=function(){var e,s,t=this,r=t.$createElement,i=t._self._c||r;return i(xe,{staticClass:"mt-3",attrs:{outlined:""}},[i(J,{attrs:{"three-line":""}},[i(vt,[i("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[i("span",[t._v(t._s((e=t.device.manufacturer)!==null&&e!==void 0?e:"Unknown"))]),i(ae),i("span",[t._v(t._s(t.device.vendor_id)+":"+t._s(t.device.product_id))])],1),i(Ge,{staticClass:"text-h5 mb-1"},[t._v(t._s((s=t.device.product)!==null&&s!==void 0?s:"Unknown"))]),t.device.description?i(Aa,[t._v(t._s(t.device.description))]):t._e()],1)],1),i(q,{staticClass:"pt-0"},t._l(t.details,function(n){return i($,{key:n.key,staticClass:"mt-0"},[i(_,{staticClass:"py-2",attrs:{cols:"3"}},[t._v(t._s(n.key))]),i(_,{staticClass:"py-2"},[t._v(t._s(n.value))])],1)}),1)],1)},gee=[];const p0={};var vee=E(uc,fee,gee,!1,_ee,null,null,null);function _ee(e){for(let s in p0)this[s]=p0[s]}const bee=function(){return vee.exports}();var yee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,[t($,[t(_,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.filteredDevices.length?t($,{staticClass:"mt-0"},[t(_,e._l(e.filteredDevices,function(r){return t(bee,{key:r.usb_location,attrs:{device:r}})}),1)],1):e.loaded?t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},Cee=[];const f0={};var $ee=E(cc,yee,Cee,!1,xee,null,null,null);function xee(e){for(let s in f0)this[s]=f0[s]}const wee=function(){return $ee.exports}();var See=Object.defineProperty,Pee=Object.getOwnPropertyDescriptor,tw=(e,s,t,r)=>{for(var i=r>1?void 0:r?Pee(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&&See(s,t,i),i};let dc=class extends M(O){constructor(){super(...arguments),this.devices=[],this.loading=!1,this.loaded=!1}get filteredDevices(){return this.hideSystemEntries?this.devices.filter(e=>e.device_type!=="hardware_uart"):this.devices}async refresh(){this.loading=!0,this.devices=await fetch(this.apiUrl+"/machine/peripherals/serial").then(e=>e.json()).then(e=>{var s,t;return(t=(s=e.result)==null?void 0:s.serial_devices)!=null?t:[]}),this.loading=!1,this.loaded=!0}};tw([P({type:Boolean,default:!1})],dc.prototype,"hideSystemEntries",2);dc=tw([D],dc);var Dee=Object.defineProperty,Tee=Object.getOwnPropertyDescriptor,sw=(e,s,t,r)=>{for(var i=r>1?void 0:r?Tee(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&&Dee(s,t,i),i};let mc=class extends M(O){};sw([P({type:Object,required:!0})],mc.prototype,"device",2);mc=sw([D({components:{TextfieldWithCopy:Zt}})],mc);var Mee=function(){var e,s,t=this,r=t.$createElement,i=t._self._c||r;return i(xe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[i(J,{attrs:{"three-line":""}},[i(vt,[i("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[i("span",[t._v(t._s(t.device.device_type.toUpperCase().replaceAll("_"," ")))]),i(ae),i("span",[t._v(t._s(t.device.driver_name))])],1),i(Ge,{staticClass:"text-h5 mb-0"},[t._v(t._s(t.device.device_name))])],1)],1),i(q,[i($,[i(_,[i(Zt,{attrs:{label:t.$t("DevicesDialog.DevicePath"),value:t.device.device_path}})],1)],1),(e=t.device.path_by_id)!==null&&e!==void 0&&e?i($,[i(_,[i(Zt,{attrs:{label:t.$t("DevicesDialog.PathById"),value:t.device.path_by_id}})],1)],1):t._e(),(s=t.device.path_by_hardware)!==null&&s!==void 0&&s?i($,[i(_,[i(Zt,{attrs:{label:t.$t("DevicesDialog.PathByHardware"),value:t.device.path_by_hardware}})],1)],1):t._e()],1)],1)},Eee=[];const g0={};var Oee=E(mc,Mee,Eee,!1,Lee,null,null,null);function Lee(e){for(let s in g0)this[s]=g0[s]}const Aee=function(){return Oee.exports}();var kee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(q,[t($,[t(_,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.filteredDevices.length?t($,{staticClass:"mt-0"},[t(_,[t(DP,{attrs:{accordion:""}},e._l(e.filteredDevices,function(r){var i;return t(Aee,{key:(i=r.path_by_hardware)!==null&&i!==void 0?i:r.device_path,attrs:{device:r}})}),1)],1)],1):e.loaded?t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},Fee=[];const v0={};var Ree=E(dc,kee,Fee,!1,jee,null,null,null);function jee(e){for(let s in v0)this[s]=v0[s]}const Hee=function(){return Ree.exports}();var Iee=Object.defineProperty,Nee=Object.getOwnPropertyDescriptor,rw=(e,s,t,r)=>{for(var i=r>1?void 0:r?Nee(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&&Iee(s,t,i),i};let hc=class extends M(O){};rw([P({type:Object,required:!0})],hc.prototype,"device",2);hc=rw([D({components:{TextfieldWithCopy:Zt}})],hc);var Vee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(xe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(q,[t($,[t(_,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[t("span",[e._v(e._s(e.device.application))])])])],1),t($,{staticClass:"mt-0"},[t(_,[t(Zt,{attrs:{label:"UUID",value:e.device.uuid}})],1)],1)],1)],1)},Uee=[];const _0={};var Bee=E(hc,Vee,Uee,!1,Wee,null,null,null);function Wee(e){for(let s in _0)this[s]=_0[s]}const iw=function(){return Bee.exports}();var Gee=Object.defineProperty,zee=Object.getOwnPropertyDescriptor,Kf=(e,s,t,r)=>{for(var i=r>1?void 0:r?zee(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&&Gee(s,t,i),i};let Da=class extends M(O){constructor(){super(...arguments),this.mdiInformationVariantCircle=IT,this.devices=[],this.loading=!1,this.loaded=!1}async refresh(){this.loading=!0,this.devices=await fetch("".concat(this.apiUrl,"/machine/peripherals/canbus?interface=").concat(this.name)).then(e=>e.json()).then(e=>{var s;return(s=e.result.can_uuids)!=null?s:[]}),this.loading=!1,this.loaded=!0}};Kf([P({type:String,required:!0})],Da.prototype,"name",2);Kf([P({type:Boolean,default:!1})],Da.prototype,"hideSystemEntries",2);Da=Kf([D({components:{DevicesDialogCanDevice:iw}})],Da);var Zee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("overlay-scrollbars",{staticStyle:{"max-height":"400px","overflow-x":"hidden"}},[t(q,[t($,[t(_,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.devices.length?t($,{staticClass:"mt-0"},[t(_,e._l(e.devices,function(r){return t(iw,{key:r.uuid,attrs:{device:r}})}),1)],1):e.loaded?t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t($,{staticClass:"mt-0"},[t(_,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1),e.devices.length===0?t($,[t(_,[t(it,{attrs:{dense:"",outlined:"",type:"info",icon:e.mdiInformationVariantCircle}},[e._v(" "+e._s(e.$t("DevicesDialog.CanBusInfo"))+" "),t($,{staticClass:"my-0"},[t(_,{staticClass:"text-center"},[t(g,{attrs:{href:"https://docs.mainsail.xyz/overview/features/query-devices#can-devices",color:"info",outlined:"",text:"",small:""}},[e._v(" open guide ")])],1)],1)],1)],1)],1):e._e()],1)],1)},qee=[];const b0={};var Xee=E(Da,Zee,qee,!1,Yee,null,null,null);function Yee(e){for(let s in b0)this[s]=b0[s]}const Jee=function(){return Xee.exports}();var Kee=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(oe,{attrs:{value:e.showDialog,width:"500",persistent:"",fullscreen:e.isMobile}},[t(B,{staticStyle:{overflow:"hidden"},attrs:{id:"devices-dialog",title:e.$t("DevicesDialog.Headline"),icon:e.mdiUsb,"card-class":"devices-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t($e,{attrs:{left:!0,"offset-y":!0,"close-on-content-click":!1,attach:"#devices-dialog"},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(J,{staticClass:"minHeight36"},[t(_e,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("DevicesDialog.HideSystemEntries")},model:{value:e.hideSystemEntries,callback:function(r){e.hideSystemEntries=r},expression:"hideSystemEntries"}})],1)],1)],1),t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(v,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Vo,{attrs:{"fixed-tabs":""},model:{value:e.tab,callback:function(r){e.tab=r},expression:"tab"}},e._l(e.tabs,function(r){return t(pi,{key:r.tab},[e._v(e._s(r.title))])}),1),t("overlay-scrollbars",{staticStyle:{"max-height":"400px","overflow-x":"hidden"}},[t(oy,{model:{value:e.tab,callback:function(r){e.tab=r},expression:"tab"}},[e._l(e.canInterfaces,function(r){return t(Pr,{key:r},[t(Jee,{attrs:{"hide-system-entries":e.hideSystemEntries,name:r}})],1)}),t(Pr,{key:"serial"},[t(Hee,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1),t(Pr,{key:"usb"},[t(wee,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1),t(Pr,{key:"video"},[t(uee,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1)],2)],1)],1)],1)},Qee=[];const y0={};var ete=E(nc,Kee,Qee,!1,tte,null,null,null);function tte(e){for(let s in y0)this[s]=y0[s]}const nw=function(){return ete.exports}();var ste=Object.defineProperty,rte=Object.getOwnPropertyDescriptor,aw=(e,s,t,r)=>{for(var i=r>1?void 0:r?rte(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&&ste(s,t,i),i};let pc=class extends M(O){constructor(){super(...arguments),this.dialogConfirmChange=!1,this.dialogDevices=!1,this.formatFilesize=Je,this.mdiCloseThick=pe,this.mdiHelp=jy,this.mdiContentSave=vp,this.mdiRestart=Zr,this.mdiClose=ka,this.mdiHelpCircle=Wc,this.mdiFileDocumentEditOutline=ja,this.mdiFileDocumentOutline=MT,this.mdiUsb=d2}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=jr(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=qD;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){if(this.confirmUnsavedChanges){if(e){window.addEventListener("beforeunload",im);return}window.removeEventListener("beforeunload",im)}}};aw([me("changed")],pc.prototype,"changedChanged",1);pc=aw([D({components:{DevicesDialog:nw,Panel:B,CodemirrorAsync:OQ}})],pc);var ite=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)},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.ctrlKey||!r.shiftKey)return null;r.preventDefault(),e.restartServiceNameExists&&e.save(e.restartServiceName)},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.metaKey||!r.shiftKey)return null;r.preventDefault(),e.restartServiceNameExists&&e.save(e.restartServiceName)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.ctrlKey?null:(r.preventDefault(),e.save(null))},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.metaKey?null:(r.preventDefault(),e.save(null))}]},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(B,{attrs:{"card-class":"editor-dialog",icon:e.isWriteable?e.mdiFileDocumentEditOutline:e.mdiFileDocumentOutline,title:e.title},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:""},on:{click:function(r){e.dialogDevices=!0}}},[t(v,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiUsb))]),e._v(" "+e._s(e.$t("Editor.DeviceDialog"))+" ")],1),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.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(),e.isWriteable?t(g,{attrs:{icon:"",tile:""},on:{click:function(r){return e.save(null)}}},[t(v,[e._v(e._s(e.mdiContentSave))])],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(_i,{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(ws,{staticClass:"mt-2",attrs:{value:100*e.loaderProgress.loaded/e.loaderProgress.total}})]:[t(ws,{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(B,{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($,[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(ae),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),t(nw,{attrs:{"show-dialog":e.dialogDevices},on:{close:function(r){e.dialogDevices=!1}}})],1)},nte=[];const C0={};var ate=E(pc,ite,nte,!1,ote,"298bc720",null,null);function ote(e){for(let s in C0)this[s]=C0[s]}const ow=function(){return ate.exports}();var lte=Object.defineProperty,cte=Object.getOwnPropertyDescriptor,ute=(e,s,t,r)=>{for(var i=r>1?void 0:r?cte(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&<e(s,t,i),i};let Uh=class extends M(O){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:""}};Uh=ute([D({components:{}})],Uh);var dte=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t(_i,{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(ws,{staticClass:"mt-2",attrs:{value:e.progress,indeterminate:""}}):e._e(),e.progress===0?t(ws,{staticClass:"mt-2",attrs:{indeterminate:""}}):e._e()],1),t(_i,{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)},mte=[];const $0={};var hte=E(Uh,dte,mte,!1,pte,null,null,null);function pte(e){for(let s in $0)this[s]=$0[s]}const lw=function(){return hte.exports}();var fte=Object.defineProperty,gte=Object.getOwnPropertyDescriptor,vte=(e,s,t,r)=>{for(var i=r>1?void 0:r?gte(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&&fte(s,t,i),i};let Bh=class extends M(O){constructor(){super(...arguments),this.mdiTrayArrowDown=v3,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"})}}};Bh=vte([D],Bh);var _te=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)},bte=[];const x0={};var yte=E(Bh,_te,bte,!1,Cte,null,null,null);function Cte(e){for(let s in x0)this[s]=x0[s]}const cw=function(){return yte.exports}();var $te=Object.defineProperty,xte=Object.getOwnPropertyDescriptor,uw=(e,s,t,r)=>{for(var i=r>1?void 0:r?xte(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&&$te(s,t,i),i};let fc=class extends M(O){constructor(){super(...arguments),this.mdiClose=ka,this.formatFilesize=Je}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 Je(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")}};uw([me("show")],fc.prototype,"showChanged",1);fc=uw([D({components:{}})],fc);var wte=function(){var e=this,s=e.$createElement,t=e._self._c||s;return e.show?t(_i,{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(ws,{staticClass:"mt-2",attrs:{value:e.percent}})],1):e._e()},Ste=[];const w0={};var Pte=E(fc,wte,Ste,!1,Dte,null,null,null);function Dte(e){for(let s in w0)this[s]=w0[s]}const dw=function(){return Pte.exports}();var Tte=Object.defineProperty,Mte=Object.getOwnPropertyDescriptor,Ete=(e,s,t,r)=>{for(var i=r>1?void 0:r?Mte(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&&Tte(s,t,i),i};let Wh=class extends M(O){constructor(){super(...arguments),this.mdiArrowCollapseDown=Hc,this.mdiArrowExpandUp=xy,this.mdiInformation=kt,this.mdiPlusThick=e3,this.mdiMinusThick=ZT,this.mdiChevronTripleLeft=hT,this.mdiChevronTripleRight=pT,this.mdiCloseThick=pe}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"})}};Wh=Ete([D({components:{Panel:B,Responsive:et}})],Wh);var Ote=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(B,{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(Ae,[t($,[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($,[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(S2,{staticClass:"mb-n2",attrs:{title:e.$t("ManualProbe.Advanced"),"sub-panel-class":"manual-probe-dialog-advanced"}},[t(Ae,[t(Vt,{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(Vt,{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(ae),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)},Lte=[];const S0={};var Ate=E(Wh,Ote,Lte,!1,kte,"01252f2e",null,null);function kte(e){for(let s in S0)this[s]=S0[s]}const mw=function(){return Ate.exports}();var Fte=Object.defineProperty,Rte=Object.getOwnPropertyDescriptor,jte=(e,s,t,r)=>{for(var i=r>1?void 0:r?Rte(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&&Fte(s,t,i),i};let Gh=class extends M(O,Ke){constructor(){super(...arguments),this.mdiArrowCollapseDown=Hc,this.mdiInformation=kt,this.mdiCloseThick=pe}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"})}};Gh=jte([D({components:{Panel:B,Responsive:et}})],Gh);var Hte=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(B,{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($,[t(_,[t(te,{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($,[t(_,{attrs:{cols:"6"}},[t(te,{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(te,{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($,[t(_,[t("p",{staticClass:"text-center mb-0",domProps:{innerHTML:e._s(e.$t("BedScrews.Description"))}})])],1)],1),t(ne,[t(ae),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)},Ite=[];const P0={};var Nte=E(Gh,Hte,Ite,!1,Vte,null,null,null);function Vte(e){for(let s in P0)this[s]=P0[s]}const hw=function(){return Nte.exports}();var Ute=Object.defineProperty,Bte=Object.getOwnPropertyDescriptor,Qf=(e,s,t,r)=>{for(var i=r>1?void 0:r?Bte(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&&Ute(s,t,i),i};let Ta=class extends M(O,Ke){constructor(){super(...arguments),this.mdiRotateLeft=c3,this.mdiCloseThick=pe,this.mdiRotateRight=u3}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}};Qf([P({required:!0})],Ta.prototype,"name",2);Qf([P({required:!0})],Ta.prototype,"result",2);Ta=Qf([D({components:{Panel:B,Responsive:et,SettingsRow:V}})],Ta);var Wte=function(){var e,s=this,t=s.$createElement,r=s._self._c||t;return r(V,{attrs:{title:s.outputName,"sub-title":s.subTitle}},[(e=s.is_base)!==null&&e!==void 0&&e?r(as,{attrs:{label:"",small:""}},[s._v(s._s(s.$t("ScrewsTiltAdjust.Base")))]):r(as,{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)},Gte=[];const D0={};var zte=E(Ta,Wte,Gte,!1,Zte,null,null,null);function Zte(e){for(let s in D0)this[s]=D0[s]}const pw=function(){return zte.exports}();var qte=Object.defineProperty,Xte=Object.getOwnPropertyDescriptor,Yte=(e,s,t,r)=>{for(var i=r>1?void 0:r?Xte(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&&qte(s,t,i),i};let zh=class extends M(O,Ke){constructor(){super(...arguments),this.mdiArrowCollapseDown=Hc,this.mdiCloseThick=pe}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(){var t,r;const s=[...(t=this.$store.state.server.events)!=null?t:[]].reverse().find(i=>i.type==="command"&&i.message.startsWith("SCREWS_TILT_CALCULATE"));await this.$store.dispatch("printer/clearScrewsTiltAdjust"),this.doSend((r=s==null?void 0:s.message)!=null?r:"SCREWS_TILT_CALCULATE")}};zh=Yte([D({components:{TheScrewsTiltAdjustDialogEntry:pw,Panel:B,Responsive:et,SettingsRow:V}})],zh);var Jte=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(B,{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($,[t(_,[t(it,{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(U,{key:"result-divider-".concat(i),staticClass:"my-1"}):e._e(),t(pw,{key:"result-".concat(i,"-").concat(i),attrs:{name:i.toString(),result:r}})]})],2):e._e(),t(ne,[t(ae),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)},Kte=[];const T0={};var Qte=E(zh,Jte,Kte,!1,ese,null,null,null);function ese(e){for(let s in T0)this[s]=T0[s]}const fw=function(){return Qte.exports}(),tse=(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 gw=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"],sse=["dateStyle","timeStyle","calendar","localeMatcher","hour12","hourCycle","timeZone","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function qi(e,s){typeof console<"u"&&(console.warn("[vue-i18n] "+e),s&&console.warn(s.stack))}function rse(e,s){typeof console<"u"&&(console.error("[vue-i18n] "+e),s&&console.error(s.stack))}var Ps=Array.isArray;function Jt(e){return e!==null&&typeof e=="object"}function ise(e){return typeof e=="boolean"}function lt(e){return typeof e=="string"}var nse=Object.prototype.toString,ase="[object Object]";function xs(e){return nse.call(e)===ase}function Lt(e){return e==null}function Zh(e){return typeof e=="function"}function Ju(){for(var e=[],s=arguments.length;s--;)e[s]=arguments[s];var t=null,r=null;return e.length===1?Jt(e[0])||Ps(e[0])?r=e[0]:typeof e[0]=="string"&&(t=e[0]):e.length===2&&(typeof e[0]=="string"&&(t=e[0]),(Jt(e[1])||Ps(e[1]))&&(r=e[1])),{locale:t,params:r}}function dn(e){return JSON.parse(JSON.stringify(e))}function ose(e,s){if(e.delete(s))return e}function lse(e){var s=[];return e.forEach(function(t){return s.push(t)}),s}function eo(e,s){return!!~e.indexOf(s)}var cse=Object.prototype.hasOwnProperty;function use(e,s){return cse.call(e,s)}function Ar(e){for(var s=arguments,t=Object(e),r=1;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function mse(e){return e!=null&&Object.keys(e).forEach(function(s){typeof e[s]=="string"&&(e[s]=dse(e[s]))}),e}function hse(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 pse(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=Ar(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(xs(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=Ar(o,JSON.parse(d))}),r.i18n.messages=o}catch{}var c=r.i18n,u=c.sharedMessages;u&&xs(u)&&(r.i18n.messages=Ar(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):xs(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 M0={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(),m=o.i(l,c,fse(d)||u?gse(d.default,u):d),h=n.tag&&n.tag!==!0||n.tag===!1?n.tag:"span";return h?s(h,r,m):m}}};function fse(e){var s;for(s in e)if(s!=="default")return!1;return!!s}function gse(e,s){var t=s?vse(s):{};if(!e)return t;e=e.filter(function(i){return i.tag||i.text.trim()!==""});var r=e.every(bse);return e.reduce(r?_se:vw,t)}function vse(e){return Array.isArray(e)?e.reduce(vw,{}):Object.assign({},e)}function _se(e,s){return s.data&&s.data.attrs&&s.data.attrs.place&&(e[s.data.attrs.place]=s),e}function vw(e,s,t){return e[t]=s,e}function bse(e){return!!(e.data&&e.data.attrs&&e.data.attrs.place)}var E0={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;lt(r.format)?o=r.format:Jt(r.format)&&(r.format.key&&(o=r.format.key),l=Object.keys(r.format).reduce(function(h,p){var f;return eo(gw,p)?Object.assign({},h,(f={},f[p]=r.format[p],f)):h},null));var c=r.locale||a.locale,u=a._ntp(r.value,c,o,l),d=u.map(function(h,p){var f,b=n.scopedSlots&&n.scopedSlots[h.type];return b?b((f={},f[h.type]=h.value,f.index=p,f.parts=u,f)):h.value}),m=r.tag&&r.tag!==!0||r.tag===!1?r.tag:"span";return m?s(m,{attrs:n.attrs,class:n.class,staticClass:n.staticClass},d):d}};function yse(e,s,t){_w(e,t)&&bw(e,s,t)}function Cse(e,s,t,r){if(_w(e,t)){var i=t.context.$i18n;xse(e,t)&&gc(s.value,s.oldValue)&&gc(e._localeMessage,i.getLocaleMessage(i.locale))||bw(e,s,t)}}function $se(e,s,t,r){var i=t.context;if(!i){qi("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 _w(e,s){var t=s.context;return t?t.$i18n?!0:(qi("VueI18n instance does not exists in Vue instance"),!1):(qi("Vue instance does not exists in VNode context"),!1)}function xse(e,s){var t=s.context;return e._locale===t.$i18n.locale}function bw(e,s,t){var r,i,n=s.value,a=wse(n),o=a.path,l=a.locale,c=a.args,u=a.choice;if(!o&&!l&&!c){qi("value type not supported");return}if(!o){qi("`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(O0(l,c))):e._vt=e.textContent=(i=d.$i18n).t.apply(i,[o].concat(O0(l,c))),e._locale=d.$i18n.locale,e._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}function wse(e){var s,t,r,i;return lt(e)?s=e:xs(e)&&(s=e.path,t=e.locale,r=e.args,i=e.choice),{path:s,locale:t,args:r,choice:i}}function O0(e,s){var t=[];return e&&t.push(e),s&&(Array.isArray(s)||xs(s))&&t.push(s),t}var Ct;function eg(e,s){s===void 0&&(s={bridge:!1}),eg.installed=!0,Ct=e,Ct.version&&Number(Ct.version.split(".")[0]),hse(Ct),Ct.mixin(pse(s.bridge)),Ct.directive("t",{bind:yse,update:Cse,unbind:$se}),Ct.component(M0.name,M0),Ct.component(E0.name,E0);var t=Ct.config.optionMergeStrategies;t.i18n=function(r,i){return i===void 0?r:i}}var yw=function(){this._caches=Object.create(null)};yw.prototype.interpolate=function(s,t){if(!t)return[s];var r=this._caches[s];return r||(r=Dse(s),this._caches[s]=r),Tse(r,t)};var Sse=/^(?:\d)+/,Pse=/^(?:\w)+/;function Dse(e){for(var s=[],t=0,r="";t0)i--,r=js,m[ot]();else{if(i=0,a===void 0||(a=Ase(a),a===!1))return!1;m[mi]()}};function h(){var p=e[t+1];if(r===bc&&p==="'"||r===yc&&p==='"')return t++,o="\\"+p,m[ot](),!0}for(;r!==null;)if(t++,n=e[t],!(n==="\\"&&h())){if(l=Lse(n),d=_r[r],c=d[l]||d.else||Ma,c===Ma||(r=c[0],u=m[c[1]],u&&(o=c[2],o=o===void 0?n:o,u()===!1)))return;if(r===Ku)return s}}var tg=function(){this._cache=Object.create(null)};tg.prototype.parsePath=function(s){var t=this._cache[s];return t||(t=kse(s),t&&(this._cache[s]=t)),t||[]};tg.prototype.getPathValue=function(s,t){if(!Jt(s))return null;var r=this.parsePath(t);if(r.length===0)return null;for(var i=r.length,n=s,a=0;a/,Rse=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,jse=/^@(?:\.([a-zA-Z]+))?:/,Hse=/[()]/g,L0={upper:function(e){return e.toLocaleUpperCase()},lower:function(e){return e.toLocaleLowerCase()},capitalize:function(e){return""+e.charAt(0).toLocaleUpperCase()+e.substr(1)}},Xh=new yw,ce=function(s){var t=this;s===void 0&&(s={}),!Ct&&typeof window<"u"&&window.Vue&&eg(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||Xh,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 tg,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 m=function(h,p){return h=Math.abs(h),p===2?h?h>1?1:0:1:h?Math.min(h,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[l,c]):m(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})},ke={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(xs(l))Object.keys(l).forEach(function(m){var h=l[m];xs(h)?(c.push(m),c.push("."),n(a,o,h,c),c.pop(),c.pop()):(c.push(m),n(a,o,h,c),c.pop())});else if(Ps(l))l.forEach(function(m,h){xs(m)?(c.push("["+h+"]"),c.push("."),n(a,o,m,c),c.pop(),c.pop()):(c.push("["+h+"]"),n(a,o,m,c),c.pop())});else if(lt(l)){var u=Fse.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"?qi(d):a==="error"&&rse(d)}}};n(t,s,r,i)};ce.prototype._initVM=function(s){var t=Ct.config.silent;Ct.config.silent=!0,this._vm=new Ct({data:s,__VUE18N__INSTANCE__:!0}),Ct.config.silent=t};ce.prototype.destroyVM=function(){this._vm.$destroy()};ce.prototype.subscribeDataChanging=function(s){this._dataListeners.add(s)};ce.prototype.unsubscribeDataChanging=function(s){ose(this._dataListeners,s)};ce.prototype.watchI18nData=function(){var s=this;return this._vm.$watch("$data",function(){for(var t=lse(s._dataListeners),r=t.length;r--;)Ct.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)};ke.vm.get=function(){return this._vm};ke.messages.get=function(){return dn(this._getMessages())};ke.dateTimeFormats.get=function(){return dn(this._getDateTimeFormats())};ke.numberFormats.get=function(){return dn(this._getNumberFormats())};ke.availableLocales.get=function(){return Object.keys(this.messages).sort()};ke.locale.get=function(){return this._vm.locale};ke.locale.set=function(e){this._vm.$set(this._vm,"locale",e)};ke.fallbackLocale.get=function(){return this._vm.fallbackLocale};ke.fallbackLocale.set=function(e){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",e)};ke.formatFallbackMessages.get=function(){return this._formatFallbackMessages};ke.formatFallbackMessages.set=function(e){this._formatFallbackMessages=e};ke.missing.get=function(){return this._missing};ke.missing.set=function(e){this._missing=e};ke.formatter.get=function(){return this._formatter};ke.formatter.set=function(e){this._formatter=e};ke.silentTranslationWarn.get=function(){return this._silentTranslationWarn};ke.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e};ke.silentFallbackWarn.get=function(){return this._silentFallbackWarn};ke.silentFallbackWarn.set=function(e){this._silentFallbackWarn=e};ke.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent};ke.preserveDirectiveContent.set=function(e){this._preserveDirectiveContent=e};ke.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage};ke.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])})}};ke.postTranslation.get=function(){return this._postTranslation};ke.postTranslation.set=function(e){this._postTranslation=e};ke.sync.get=function(){return this._sync};ke.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(lt(o))return o}if(this._formatFallbackMessages){var l=Ju.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(Ps(l)||xs(l))return l;var c;if(Lt(l))if(xs(t)){if(c=t[r],!(lt(c)||Zh(c)))return null}else return null;else if(lt(l)||Zh(l))c=l;else return null;return lt(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(Rse);for(var u in c)if(c.hasOwnProperty(u)){var d=c[u],m=d.match(jse),h=m[0],p=m[1],f=d.replace(h,"").replace(Hse,"");if(eo(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,Ps(a)?a:[a],n),this._modifiers.hasOwnProperty(p)?b=this._modifiers[p](b):L0.hasOwnProperty(p)&&(b=L0[p](b)),o.pop(),l=b?l.replace(d,b):l}return l};ce.prototype._createMessageContext=function(s,t,r,i){var n=this,a=Ps(s)?s:[],o=Jt(s)?s:{},l=function(m){return a[m]},c=function(m){return o[m]},u=this._getMessages(),d=this.locale;return{list:l,named:c,values:s,formatter:t,path:r,messages:u,locale:d,linked:function(m){return n._interpolate(d,u[d]||{},m,null,i,void 0,[m])}}};ce.prototype._render=function(s,t,r,i){if(Zh(s))return s(this._createMessageContext(r,this._formatter||Xh,i,t));var n=this._formatter.interpolate(s,r,i);return n||(n=Xh.interpolate(s,r,i)),t==="string"&&!lt(n)?n.join(""):n};ce.prototype._appendItemToChain=function(s,t,r){var i=!1;return eo(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=Ju.apply(void 0,a);this._escapeParameterHtml&&(l.params=mse(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?(lt(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=Ju.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||!lt(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=Ju.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 dn(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,Ar(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 dn(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,Ar(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?(lt(t[0])?n=t[0]:Jt(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 eo(sse,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(lt(t[0])&&(n=t[0]),lt(t[1])&&(i=t[1])),this._d(s,i,n,a)};ce.prototype.getNumberFormat=function(s){return dn(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,Ar(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?lt(t[0])?n=t[0]:Jt(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 eo(gw,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(lt(t[0])&&(n=t[0]),lt(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,ke);var Hd;Object.defineProperty(ce,"availabilities",{get:function(){if(!Hd){var s=typeof Intl<"u";Hd={dateTimeFormat:s&&typeof Intl.DateTimeFormat<"u",numberFormat:s&&typeof Intl.NumberFormat<"u"}}return Hd}});ce.install=eg;ce.version="8.28.2";const xw=ce,ww={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",KlipperRuntimeWarning:"Klipper runtime warning",KlipperWarning:"Klipper warning"},MaintenanceReminder:"Maintenance Reminder",MaintenanceReminderText:'Maintenance "{name}" is due.',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",OneDayShort:"1D",OneHourShort:"1H",OneWeekShort:"1W",Remind:"Remind:",ShowDetails:"show details",TmcOtFlag:"Stepper driver error: OT flag set",TmcOtFlagText:"The stepper driver '{name}' has triggered the OT flag and stopped working. This can be caused by a too high current. Please check the stepper driver settings and cooling.",TmcOtpwFlag:"Stepper driver warning: OTPW flag set",TmcOtpwFlagText:"The stepper driver '{name}' has triggered the OTPW flag and may stop working if it gets any hotter. This is an indication of an over temperature condition. This can be caused by a too high current. Please check the stepper driver settings and cooling."},NumberInput:{GreaterOrEqualError:"Must be greater or equal than {min}!",MustBeBetweenError:"Must be between {min} and {max}!",NoEmptyAllowedError:"Input must not be empty!"},Printers:"Printers",TextfieldWithCopy:{Copied:"Copied"},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) were 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!"}},Sw={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}"},Pw={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"},Dw={CommandList:"Command list",Empty:"Empty",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",SendCode:"Send code...",SetupConsole:"Setup Console"},Tw={AreYouSure:"Are you sure?",CoolDown:"CoolDown",No:"No",Yes:"Yes"},Mw={CanBusInfo:"Only unassigned nodes can be detected. It’s recommended to have only one unassigned device connected to the can bus to avoid communication issues. For more details, please click on the link:",ClickRefresh:"Click on the refresh button to search for devices.",DevicePath:"Device path",Formats:"Formats",Headline:"Devices",HideSystemEntries:"Hide system entries",LibcameraId:"Libcamera ID",NoDeviceFound:"No device found. Please check the connection and click on the refresh button.",PathByHardware:"Path by hardware",PathById:"Path by ID",Refresh:"refresh",Resolutions:"Resolutions"},Ew={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"}},Ow={ConfigReference:"Config Reference",DeviceDialog:"Devices",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"},Lw={AreYouSure:"Are you sure?",EmergencyStop:"Emergency Stop",No:"No",Yes:"Yes"},Aw={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.",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"},kw={CannotUploadFile:"Cannot upload file!",DropFilesToUploadFiles:"Drop files to upload"},Fw={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)"},Rw={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.",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"No bed mesh has been loaded yet.",NoProfile:"No profile available",Probed:"Probed",Profiles:"Profiles",Remove:"delete",Rename:"rename",RenameBedMeshProfile:"Rename Bed Mesh Profile",ScaleGradient:"Scale gradient",ScaleZMax:"Scale z-max.",TitleCalibrate:"Calibrate new bed mesh",TitleClear:"Clear bed mesh",TitleHomeAll:"Home all",Wireframe:"Wireframe"},jw={AddANote:"Add a note",AddMaintenance:"Add Maintenance",AddNote:"Add note",AddToQueueSuccessful:"File {filename} added to Queue.",AllJobs:"All",AvgPrinttime:"Print Time - Ø",Cancel:"Cancel",Chart:"Chart",CreateNote:"Create Note",DateBasedReminder:"Date",DateBasedReminderDescription:"This reminder is based on the date.",Days:"days",Delete:"Delete",DeleteSelectedQuestion:"Do you really want to delete {count} selected jobs?",DeleteSingleJobQuestion:"Do you really want to delete the job?",Details:"Details",EditMaintenance:"Edit Maintenance",EditNote:"Edit Note",Empty:"empty",EndTime:"End Time",EntryCreatedAt:"Created at {date}.",EntryNextPerform:"Next perform:",EntryPerformedAt:"Performed at {date}.",EntrySince:"Used since:",EstimatedFilament:"Estimated Filament",EstimatedFilamentWeight:"Estimated Filament Weight",EstimatedTime:"Estimated Time",FilamentBasedReminder:"Filament",FilamentBasedReminderDescription:"This reminder is based on the filament usage.",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",Hours:"hours",InvalidNameEmpty:"Invalid name. Name must not be empty!",JobDetails:"Job Details",Jobs:"Jobs",LastModified:"Last Modified",LayerHeight:"Layer Height",LoadCompleteHistory:"Load complete history",LongestPrinttime:"Longest Print Time",Maintenance:"Maintenance",MaintenanceEntries:"Maintenance Entries",Meter:"meter",Name:"Name",NoReminder:"No reminder",Note:"Note",ObjectHeight:"Object Height",OneTime:"One-Time",Perform:"perform",Performed:"performed",PerformedAndReschedule:"performed and reschedule",PerformMaintenance:"Perform Maintenance",PrintDuration:"Print Time",PrintHistory:"Print History",PrintJobs:"Print Jobs",PrintTime:"Print Time",PrinttimeAvg:"Print Time - Ø",PrinttimeBasedReminder:"Print Time",PrinttimeBasedReminderDescription:"This reminder is based on the print time.",Reminder:"Reminder",Repeat:"Repeat",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",interrupted:"Interrupted",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"},Hw={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",Pause:"Pause",RemoveFromQueue:"Remove from Queue",Start:"Start",StartPrint:"Start Job"},Iw={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."}},Nw={Abort:"abort",Accept:"accept",Advanced:"Advanced",Headline:"Manual Probe"},Vw={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",KlipperLog:"Klipper Log",MoonrakerCannotConnect:"Moonraker can't connect to Klipper!",MoonrakerLog:"Moonraker Log",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"}},Uw={AreYouSure:"Are you sure?",No:"No",TurnDeviceOff:"Turn {device} off",TurnDeviceOn:"Turn {device} on",Yes:"Yes"},Bw={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"},Ww={Accept:"accept",Base:"Base",ErrorText:"Something went wrong during the probing process.",Headline:"Screws tilt adjust",Retry:"retry"},Gw={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",Name:"Name",Path:"Path",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"},zw={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",DbMaintenance:"Maintenance",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",Name:"Name",NameDescription:"This name will not be displayed in the GUI and will only used for redirects.",Path:"Path",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",CameraDescriptionWithSnapshotUrl:"Select which camera (with snapshot URL) should be used",CameraWarningAlreadySet:"This value is already set in the Moonraker configuration file.",CameraWarningAlreadySetSmall:"snapshoturl in the [timelapse] section",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",NoWebcamFound:"No Webcam available",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.",RulesBetweenMinMax:"Value must be between {min} and {max}!",RulesMin:"Value must be minimum {min}!",RulesPositive:"Value must be positive!",RulesRequired:"Value is required!",RulesZeroAndPositive:"Value must be 0 or greater!",SaveFrames:"Save Frames",SaveFramesDescription:"Save the frames to a zip-file for external rendering",SelectWebcam:"Select webcam...",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:"Maximum variable FPS value",VariableFpsMin:"Variable FPS min",VariableFpsMinDescription:"Minimum variable FPS value"},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.',ConfirmOnCoolDown:"Require confirm on CoolDown",ConfirmOnCoolDownDescription:"Show a confirmation dialog on CoolDown",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.",Mode:"Mode",ModeDescription:"Change the overall look and feel of the application.",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",PrintstatusThumbnailZoom:"Large thumbnail zoom",PrintstatusThumbnailZoomDescription:"This will deactivate the zoom effect of the thumbnail in the status panel.",ProgressAsFavicon:"Show progress as favicon",ProgressAsFaviconDescription:"Change the Mainsail logo favicon to a progress circle.",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:"Customizes the branding of the interface.",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)"}},Zw={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"},qw="English",Xw={App:ww,BedScrews:Sw,ConnectionDialog:Pw,Console:Dw,CoolDownDialog:Tw,DevicesDialog:Mw,Dialogs:Ew,Editor:Ow,EmergencyStopDialog:Lw,Files:Aw,FullscreenUpload:kw,GCodeViewer:Fw,Heightmap:Rw,History:jw,JobQueue:Hw,Machine:Iw,ManualProbe:Nw,Panels:Vw,PowerDeviceChangeDialog:Uw,Router:Bw,ScrewsTiltAdjust:Ww,SelectPrinterDialog:Gw,Settings:zw,Timelapse:Zw,title:qw},Yw=Object.freeze(Object.defineProperty({__proto__:null,App:ww,BedScrews:Sw,ConnectionDialog:Pw,Console:Dw,CoolDownDialog:Tw,DevicesDialog:Mw,Dialogs:Ew,Editor:Ow,EmergencyStopDialog:Lw,Files:Aw,FullscreenUpload:kw,GCodeViewer:Fw,Heightmap:Rw,History:jw,JobQueue:Hw,Machine:Iw,ManualProbe:Nw,Panels:Vw,PowerDeviceChangeDialog:Uw,Router:Bw,ScrewsTiltAdjust:Ww,SelectPrinterDialog:Gw,Settings:zw,Timelapse:Zw,default:Xw,title:qw},Symbol.toStringTag,{value:"Module"}));y.use(xw);const Ise={}.VUE_APP_I18N_LOCALE||"en",ve=new xw({locale:Ise,fallbackLocale:{}.VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:{en:Xw}});async function Jw(e){const s=await tse(Object.assign({"../locales/cz.json":()=>fe(()=>import("./cz-285b76fb.js"),[]),"../locales/da.json":()=>fe(()=>import("./da-32034265.js"),[]),"../locales/de.json":()=>fe(()=>import("./de-1b45e732.js"),[]),"../locales/en.json":()=>fe(()=>Promise.resolve().then(()=>Yw),void 0),"../locales/es.json":()=>fe(()=>import("./es-8a2d24bf.js"),[]),"../locales/fr.json":()=>fe(()=>import("./fr-ab90ab77.js"),[]),"../locales/hu.json":()=>fe(()=>import("./hu-a56cb065.js"),[]),"../locales/it.json":()=>fe(()=>import("./it-a13fb923.js"),[]),"../locales/ja.json":()=>fe(()=>import("./ja-a20a0276.js"),[]),"../locales/ko.json":()=>fe(()=>import("./ko-0b8d811b.js"),[]),"../locales/nl.json":()=>fe(()=>import("./nl-d64c7e44.js"),[]),"../locales/pl.json":()=>fe(()=>import("./pl-4358b7cc.js"),[]),"../locales/pt.json":()=>fe(()=>import("./pt-880f8881.js"),[]),"../locales/ru.json":()=>fe(()=>import("./ru-e26fbb6e.js"),[]),"../locales/se.json":()=>fe(()=>import("./se-23883ae1.js"),[]),"../locales/tr.json":()=>fe(()=>import("./tr-9777749c.js"),[]),"../locales/uk.json":()=>fe(()=>import("./uk-217f44de.js"),[]),"../locales/zh.json":()=>fe(()=>import("./zh-0b0471a0.js"),[]),"../locales/zh_TW.json":()=>fe(()=>import("./zh_TW-7176daef.js"),[])}),"../locales/".concat(e,".json"));return ve.setLocaleMessage(e,s),ve.locale=e,s}var Nse=Object.defineProperty,Vse=Object.getOwnPropertyDescriptor,Kw=(e,s,t,r)=>{for(var i=r>1?void 0:r?Vse(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&&Nse(s,t,i),i};let Cc=class extends M(O){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})}};Kw([P({type:Object,required:!0})],Cc.prototype,"event",2);Cc=Kw([D({})],Cc);var Use=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)+" ")])},Bse=[];const A0={};var Wse=E(Cc,Use,Bse,!1,Gse,null,null,null);function Gse(e){for(let s in A0)this[s]=A0[s]}const Qw=function(){return Wse.exports}();var zse=Object.defineProperty,Zse=Object.getOwnPropertyDescriptor,eS=(e,s,t,r)=>{for(var i=r>1?void 0:r?Zse(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&&zse(s,t,i),i};let $c=class extends M(O){get text(){return this.event.message}};eS([P({type:Object,required:!0})],$c.prototype,"event",2);$c=eS([D({})],$c);var qse=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.text))])])],1)},Xse=[];const k0={};var Yse=E($c,qse,Xse,!1,Jse,null,null,null);function Jse(e){for(let s in k0)this[s]=k0[s]}const tS=function(){return Yse.exports}();var Kse=Object.defineProperty,Qse=Object.getOwnPropertyDescriptor,sS=(e,s,t,r)=>{for(var i=r>1?void 0:r?Qse(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&&Kse(s,t,i),i};let xc=class extends M(O){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})}};sS([P({type:Object,required:!0})],xc.prototype,"event",2);xc=sS([D({})],xc);var ere=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))])},tre=[];const F0={};var sre=E(xc,ere,tre,!1,rre,null,null,null);function rre(e){for(let s in F0)this[s]=F0[s]}const rS=function(){return sre.exports}();var ire=Object.defineProperty,nre=Object.getOwnPropertyDescriptor,sg=(e,s,t,r)=>{for(var i=r>1?void 0:r?nre(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&&ire(s,t,i),i};let Ea=class extends M(O){};sg([P({type:Array,required:!0})],Ea.prototype,"children",2);sg([P({type:Number,required:!0})],Ea.prototype,"groupIndex",2);Ea=sg([D({})],Ea);var are=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t($,[t(_,{staticClass:"text-center"},e._l(e.children,function(r,i){return t(rS,{key:"prompt_"+e.groupIndex+"_"+i,attrs:{event:r}})}),1)],1)},ore=[];const R0={};var lre=E(Ea,are,ore,!1,cre,null,null,null);function cre(e){for(let s in R0)this[s]=R0[s]}const Yh=function(){return lre.exports}();var ure=Object.defineProperty,dre=Object.getOwnPropertyDescriptor,mre=(e,s,t,r)=>{for(var i=r>1?void 0:r?dre(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&&ure(s,t,i),i};let Jh=class extends M(O){constructor(){super(...arguments),this.mdiInformation=kt,this.mdiCloseThick=pe,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(){var s,t,r;if(this.lastPromptBeginPos===-1)return!1;const e=(s=this.macroPromptEvents[this.lastPromptBeginPos])!=null?s:null;return this.internalCloseCommand!==null&&this.internalCloseCommand==((r=(t=e==null?void 0:e.date)==null?void 0:t.getTime())!=null?r:null)?!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(){var s,t,r;this.internalCloseCommand=(r=(t=(s=this.macroPromptEvents[this.lastPromptBeginPos])==null?void 0:s.date)==null?void 0:t.getTime())!=null?r:null;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})}};Jh=mre([D({components:{MacroPromptButtonGroup:Yh,MacroPromptButton:rS,MacroPromptText:tS,MacroPromptFooterButton:Qw,Panel:B}})],Jh);var hre=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(B,{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(tS,{key:"prompt_"+i,attrs:{event:r}}):e._e(),r.type==="button_group"?t(Yh,{key:"prompt_"+i,attrs:{"group-index":i,children:(n=r.children)!==null&&n!==void 0?n:[]}}):e._e(),r.type==="button"?t(Yh,{key:"prompt_"+i,attrs:{"group-index":i,children:[r]}}):e._e()]})],2),e.footerButtons.length?t(ne,[t(ae),e._l(e.footerButtons,function(r,i){return t(Qw,{key:"prompt_footer_"+i,attrs:{event:r}})})],2):e._e()],1)],1)},pre=[];const j0={};var fre=E(Jh,hre,pre,!1,gre,null,null,null);function gre(e){for(let s in j0)this[s]=j0[s]}const iS=function(){return fre.exports}();var vre=Object.defineProperty,_re=Object.getOwnPropertyDescriptor,ps=(e,s,t,r)=>{for(var i=r>1?void 0:r?_re(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&&vre(s,t,i),i};D.registerHooks(["metaInfo"]);let Ut=class extends M(O,_t){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 naviDrawer(){return this.$store.state.naviDrawer}get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get mainStyle(){let s={paddingLeft:"0"};return this.mainBgImage!==null&&(s.backgroundImage="url("+this.mainBgImage+")"),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 mode(){return this.$store.state.gui.uiSettings.mode}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-logo":this.logoColor,"--color-primary":this.primaryColor,"--color-warning":this.warningColor,"--panel-toolbar-icon-btn-width":Zd+"px","--panel-toolbar-text-btn-height":Zd+"px","--topbar-icon-btn-width":kn+"px","--sidebar-menu-item-height":WD+"px"}}get print_percent(){return Math.floor(this.$store.getters["printer/getPrintPercent"]*100)}get containerClasses(){var t,r;const s=(t=this.$router.options.routes)==null?void 0:t.find(i=>i.name===this.$route.name);return{"px-3":!0,"px-sm-6":!0,"py-sm-6":!0,"mx-auto":!0,fullscreen:(r=s==null?void 0:s.fullscreen)!=null?r:!1}}get progressAsFavicon(){return this.$store.state.gui.uiSettings.progressAsFavicon}async languageChanged(s){await Jw(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})}modeChanged(s){const t=s!=="light";this.$vuetify.theme.dark=t;const r=document.documentElement;r.className=t?"theme--dark":"theme--light"}async drawFavicon(s){var n,a,o;const t=document.querySelector("link[rel*='icon'][sizes='16x16']"),r=document.querySelector("link[rel*='icon'][sizes='32x32']");if(!t||!r)return;if(this.progressAsFavicon&&this.printerIsPrinting){let l=64,c=document.createElement("canvas");c.width=l,c.height=l;const u=c.getContext("2d"),d=c.width/2,m=c.height/2,h=32;if(!u)return;u.beginPath(),u.moveTo(d,m),u.arc(d,m,h,0,2*Math.PI,!1),u.closePath(),u.fillStyle="#ddd",u.fill(),u.strokeStyle="rgba(200, 208, 218, 0.66)",u.stroke();let p=1.5*Math.PI,f=0,b=(Math.PI-.5*Math.PI)/25;(s>=0&&s<=25||s>25&&s<=50||s>50&&s<=75||s>75&&s<=100)&&(f=p+s*b),u.beginPath(),u.moveTo(d,m),u.arc(d,m,h,p,f,!1),u.closePath(),u.fillStyle=this.logoColor,u.fill(),t.href=c.toDataURL("image/png"),r.href=c.toDataURL("image/png");return}if(this.customFavicons){const[l,c]=this.customFavicons;t.href=l,r.href=c;return}if((o=(a=(n=this.theme)==null?void 0:n.logo)==null?void 0:a.show)!=null&&o&&this.sidebarLogo.endsWith(".svg")){const l=await fetch(this.sidebarLogo);if(!l.ok)return;const u=(await l.text()).replace(/fill="var\(--color-logo, #[0-9a-fA-F]{6}\)"/g,'fill="'.concat(this.logoColor,'"')),d=new Blob([u],{type:"image/svg+xml"}),m=new FileReader;m.onloadend=()=>{const h=m.result;t.href=h,r.href=h},m.readAsDataURL(d);return}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)}progressAsFaviconChanged(){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)}};ps([me("language")],Ut.prototype,"languageChanged",1);ps([me("customStylesheet")],Ut.prototype,"customStylesheetChanged",1);ps([me("current_file")],Ut.prototype,"current_fileChanged",1);ps([me("primaryColor")],Ut.prototype,"primaryColorChanged",1);ps([me("mode")],Ut.prototype,"modeChanged",1);ps([me("customFavicons")],Ut.prototype,"customFaviconsChanged",1);ps([me("progressAsFavicon")],Ut.prototype,"progressAsFaviconChanged",1);ps([me("logoColor")],Ut.prototype,"logoColorChanged",1);ps([me("print_percent")],Ut.prototype,"print_percentChanged",1);ps([me("printerIsPrinting")],Ut.prototype,"printerIsPrintingChanged",1);Ut=ps([D({components:{TheMacroPrompt:iS,TheTimelapseRenderingSnackbar:lw,TheEditor:ow,TheSelectPrinterDialog:Op,TheConnectingDialog:qx,TheUpdateDialog:Zx,TheTopbar:Gx,TheSidebar:Q$,TheFullscreenUpload:cw,TheUploadSnackbar:dw,TheManualProbeDialog:mw,TheBedScrewsDialog:hw,TheScrewsTiltAdjustDialog:fw}})],Ut);var bre=Object.defineProperty,yre=Object.getOwnPropertyDescriptor,Cre=(e,s,t,r)=>{for(var i=r>1?void 0:r?yre(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&&bre(s,t,i),i};let Kh=class extends M(O){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 fe(()=>import("./virtual_pwa-register-7198e461.js"),["assets/virtual_pwa-register-7198e461.js","assets/vuetify-4c65b4c3.js","assets/vuetify-950d1cb0.css","assets/overlayscrollbars-44d87bcf.js","assets/overlayscrollbars-a16bc3d3.css","assets/echarts-ff51454d.js"]);this.updateSW=e({immediate:!0,onOfflineReady:this.onOfflineReady,onNeedRefresh:this.onNeedRefresh,onRegistered:this.onRegistered,onRegisterError:this.onRegisterError})}};Kh=Cre([D],Kh);var $re=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(B,{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(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.update}},[e._v(e._s(e.$t("App.TheServiceWorker.Update")))])],1)],1)],1)},xre=[];const H0={};var wre=E(Kh,$re,xre,!1,Sre,null,null,null);function Sre(e){for(let s in H0)this[s]=H0[s]}const Pre=function(){return wre.exports}();var Dre=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t(TP,{style:e.cssVars},[e.socketIsConnected&&e.guiIsReady?[t(Q$),t(Gx),t(MP,{style:e.mainStyle,attrs:{id:"content"}},[t(Ae,{class:e.containerClasses,attrs:{id:"page-container",fluid:""}},[t("router-view")],1)],1),t(Pre),t(Zx),t(ow),t(lw),t(cw),t(dw),t(mw),t(hw),t(fw),t(iS)]:e.instancesDB!=="moonraker"?t(Op):t(qx)],2)},Tre=[];const I0={};var Mre=E(Ut,Dre,Tre,!1,Ere,null,null,null);function Ere(e){for(let s in I0)this[s]=I0[s]}const Ore=function(){return Mre.exports}();y.use(cy,{directives:{Touch:EP,Ripple:OP}});const nS=new cy({theme:{dark:!0,options:{customProperties:!0}},icons:{iconfont:"mdiSvg"},breakpoint:{mobileBreakpoint:768}});/*! + * vuex v3.6.2 + * (c) 2021 Evan You + * @license MIT + */function Lre(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 Are=typeof window<"u"?window:typeof global<"u"?global:{},li=Are.__VUE_DEVTOOLS_GLOBAL_HOOK__;function kre(e){li&&(e._devtoolHook=li,li.emit("vuex:init",e),li.on("vuex:travel-to-state",function(s){e.replaceState(s)}),e.subscribe(function(s,t){li.emit("vuex:mutation",s,t)},{prepend:!0}),e.subscribeAction(function(s,t){li.emit("vuex:action",s,t)},{prepend:!0}))}function Fre(e,s){return e.filter(s)[0]}function Qh(e,s){if(s===void 0&&(s=[]),e===null||typeof e!="object")return e;var t=Fre(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]=Qh(e[i],s)}),r}function mn(e,s){Object.keys(e).forEach(function(t){return s(e[t],t)})}function aS(e){return e!==null&&typeof e=="object"}function Rre(e){return e&&typeof e.then=="function"}function jre(e,s){return function(){return e(s)}}var fs=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)||{}},oS={namespaced:{configurable:!0}};oS.namespaced.get=function(){return!!this._rawModule.namespaced};fs.prototype.addChild=function(s,t){this._children[s]=t};fs.prototype.removeChild=function(s){delete this._children[s]};fs.prototype.getChild=function(s){return this._children[s]};fs.prototype.hasChild=function(s){return s in this._children};fs.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)};fs.prototype.forEachChild=function(s){mn(this._children,s)};fs.prototype.forEachGetter=function(s){this._rawModule.getters&&mn(this._rawModule.getters,s)};fs.prototype.forEachAction=function(s){this._rawModule.actions&&mn(this._rawModule.actions,s)};fs.prototype.forEachMutation=function(s){this._rawModule.mutations&&mn(this._rawModule.mutations,s)};Object.defineProperties(fs.prototype,oS);var Qr=function(s){this.register([],s,!1)};Qr.prototype.get=function(s){return s.reduce(function(t,r){return t.getChild(r)},this.root)};Qr.prototype.getNamespace=function(s){var t=this.root;return s.reduce(function(r,i){return t=t.getChild(i),r+(t.namespaced?i+"/":"")},"")};Qr.prototype.update=function(s){lS([],this.root,s)};Qr.prototype.register=function(s,t,r){var i=this;r===void 0&&(r=!0);var n=new fs(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&&mn(t.modules,function(o,l){i.register(s.concat(l),o,r)})};Qr.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)};Qr.prototype.isRegistered=function(s){var t=this.get(s.slice(0,-1)),r=s[s.length-1];return t?t.hasChild(r):!1};function lS(e,s,t){if(s.update(t),t.modules)for(var r in t.modules){if(!s.getChild(r))return;lS(e.concat(r),s.getChild(r),t.modules[r])}}var Ot,Bt=function(s){var t=this;s===void 0&&(s={}),!Ot&&typeof window<"u"&&window.Vue&&dS(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 Qr(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(m,h){return o.call(n,m,h)},this.commit=function(m,h,p){return l.call(n,m,h,p)},this.strict=i;var c=this._modules.root.state;Qu(this,c,[],this._modules.root),ig(this,c),r.forEach(function(d){return d(t)});var u=s.devtools!==void 0?s.devtools:Ot.config.devtools;u&&kre(this)},rg={state:{configurable:!0}};rg.state.get=function(){return this._vm._data.$$state};rg.state.set=function(e){};Bt.prototype.commit=function(s,t,r){var i=this,n=wc(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)}))};Bt.prototype.dispatch=function(s,t){var r=this,i=wc(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(m){try{r._actionSubscribers.filter(function(h){return h.after}).forEach(function(h){return h.after(o,r.state)})}catch{}u(m)},function(m){try{r._actionSubscribers.filter(function(h){return h.error}).forEach(function(h){return h.error(o,r.state,m)})}catch{}d(m)})})}};Bt.prototype.subscribe=function(s,t){return cS(s,this._subscribers,t)};Bt.prototype.subscribeAction=function(s,t){var r=typeof s=="function"?{before:s}:s;return cS(r,this._actionSubscribers,t)};Bt.prototype.watch=function(s,t,r){var i=this;return this._watcherVM.$watch(function(){return s(i.state,i.getters)},t,r)};Bt.prototype.replaceState=function(s){var t=this;this._withCommit(function(){t._vm._data.$$state=s})};Bt.prototype.registerModule=function(s,t,r){r===void 0&&(r={}),typeof s=="string"&&(s=[s]),this._modules.register(s,t),Qu(this,this.state,s,this._modules.get(s),r.preserveState),ig(this,this.state)};Bt.prototype.unregisterModule=function(s){var t=this;typeof s=="string"&&(s=[s]),this._modules.unregister(s),this._withCommit(function(){var r=ng(t.state,s.slice(0,-1));Ot.delete(r,s[s.length-1])}),uS(this)};Bt.prototype.hasModule=function(s){return typeof s=="string"&&(s=[s]),this._modules.isRegistered(s)};Bt.prototype.hotUpdate=function(s){this._modules.update(s),uS(this,!0)};Bt.prototype._withCommit=function(s){var t=this._committing;this._committing=!0,s(),this._committing=t};Object.defineProperties(Bt.prototype,rg);function cS(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 uS(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;Qu(e,t,[],e._modules.root,!0),ig(e,t,s)}function ig(e,s,t){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,n={};mn(i,function(o,l){n[l]=jre(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&&Bre(e),r&&(t&&e._withCommit(function(){r._data.$$state=null}),Ot.nextTick(function(){return r.$destroy()}))}function Qu(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=ng(s,t.slice(0,-1)),l=t[t.length-1];e._withCommit(function(){Ot.set(o,l,r.state)})}var c=r.context=Hre(e,a,t);r.forEachMutation(function(u,d){var m=a+d;Nre(e,m,u,c)}),r.forEachAction(function(u,d){var m=u.root?d:a+d,h=u.handler||u;Vre(e,m,h,c)}),r.forEachGetter(function(u,d){var m=a+d;Ure(e,m,u,c)}),r.forEachChild(function(u,d){Qu(e,s,t.concat(d),u,i)})}function Hre(e,s,t){var r=s==="",i={dispatch:r?e.dispatch:function(n,a,o){var l=wc(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=wc(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 Ire(e,s)}},state:{get:function(){return ng(e.state,t)}}}),i}function Ire(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 Nre(e,s,t,r){var i=e._mutations[s]||(e._mutations[s]=[]);i.push(function(a){t.call(e,r.state,a)})}function Vre(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 Rre(o)||(o=Promise.resolve(o)),e._devtoolHook?o.catch(function(l){throw e._devtoolHook.emit("vuex:error",l),l}):o})}function Ure(e,s,t,r){e._wrappedGetters[s]||(e._wrappedGetters[s]=function(n){return t(r.state,r.getters,n.state,n.getters)})}function Bre(e){e._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function ng(e,s){return s.reduce(function(t,r){return t[r]},e)}function wc(e,s,t){return aS(e)&&e.type&&(t=s,s=e,e=e.type),{type:e,payload:s,options:t}}function dS(e){Ot&&e===Ot||(Ot=e,Lre(Ot))}var mS=td(function(e,s){var t={};return ed(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=sd(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}),hS=td(function(e,s){var t={};return ed(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=sd(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}),pS=td(function(e,s){var t={};return ed(s).forEach(function(r){var i=r.key,n=r.val;n=e+n,t[i]=function(){if(!(e&&!sd(this.$store,"mapGetters",e)))return this.$store.getters[n]},t[i].vuex=!0}),t}),fS=td(function(e,s){var t={};return ed(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=sd(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}),Wre=function(e){return{mapState:mS.bind(null,e),mapGetters:pS.bind(null,e),mapMutations:hS.bind(null,e),mapActions:fS.bind(null,e)}};function ed(e){return Gre(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 Gre(e){return Array.isArray(e)||aS(e)}function td(e){return function(s,t){return typeof s!="string"?(t=s,s=""):s.charAt(s.length-1)!=="/"&&(s+="/"),e(s,t)}}function sd(e,s,t){var r=e._modulesNamespaceMap[t];return r}function zre(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,m){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=Qh(u.state);typeof c>"u"||(o&&u.subscribe(function(m,h){var p=Qh(h);if(t(m,d,p)){var f=U0(),b=i(m),C="mutation "+m.type+f;N0(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(p)),V0(c)}d=p}),l&&u.subscribeAction(function(m,h){if(n(m,h)){var p=U0(),f=a(m),b="action "+m.type+p;N0(c,b,s),c.log("%c action","color: #03A9F4; font-weight: bold",f),V0(c)}}))}}function N0(e,s,t){var r=t?e.groupCollapsed:e.group;try{r.call(e,s)}catch{e.log(s)}}function V0(e){try{e.groupEnd()}catch{e.log("—— log end ——")}}function U0(){var e=new Date;return" @ "+bo(e.getHours(),2)+":"+bo(e.getMinutes(),2)+":"+bo(e.getSeconds(),2)+"."+bo(e.getMilliseconds(),3)}function Zre(e,s){return new Array(s+1).join(e)}function bo(e,s){return Zre("0",s-e.toString().length)+e}var qre={Store:Bt,install:dS,version:"3.6.2",mapState:mS,mapMutations:hS,mapGetters:pS,mapActions:fS,createNamespacedHelpers:Wre,createLogger:zre};const gS=qre,Xre={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,path:r.path})},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())}),s.path&&e("socket/setData",{route_prefix:s.path})}},Yre={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)}},Jre={getVersion:e=>e.packageVersion,getTitle:(e,s)=>{var r,i,n,a,o,l,c,u,d,m,h,p,f,b,C,S,L,N,R,x,T,I;if(!((r=e.socket)!=null&&r.isConnected))return"Mainsail";if(((i=e.server)==null?void 0:i.klippy_state)!=="ready")return ve.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 ve.t("App.Titles.Pause");if(((u=(c=e.printer)==null?void 0:c.print_stats)==null?void 0:u.state)==="complete"){let j=ve.t("App.Titles.Complete",{filename:e.printer.print_stats.filename});return(d=e.gui)!=null&&d.general.printername&&(j+="- ".concat((m=e.gui)==null?void 0:m.general.printername)),j}if(t==="printing"){const j=s["printer/getEstimatedTimeETAFormat"],W=Math.floor(s["printer/getPrintPercent"]*100);if(j!=="--"){let re=ve.t("App.Titles.PrintingETA",{percent:W,filename:(p=(h=e.printer)==null?void 0:h.print_stats)==null?void 0:p.filename,eta:j});return(f=e.gui)!=null&&f.general.printername&&(re+="- ".concat((b=e.gui)==null?void 0:b.general.printername)),re}let Z=ve.t("App.Titles.Printing",{percent:W,filename:(S=(C=e.printer)==null?void 0:C.print_stats)==null?void 0:S.filename});return(L=e.gui)!=null&&L.general.printername&&(Z+="- ".concat((N=e.gui)==null?void 0:N.general.printername)),Z}return(I=(T=(R=e.gui)==null?void 0:R.general.printername)!=null?T:(x=e.printer)==null?void 0:x.hostname)!=null?I:"Mainsail"},getDependencies:e=>{var b,C,S,L,N,R,x,T,I,j,W,Z;const s=[],t=(C=(b=e.printer)==null?void 0:b.software_version)!=null?C:"",r=t.split("-"),i=(S=r[0])!=null?S:"",n=parseInt((L=r[1])!=null?L:0),a=yg.split("-"),o=(N=a[0])!=null?N:"",l=parseInt((R=a[1])!=null?R:0);rt.valid(i)&&(rt.gt(o,i)||rt.eq(o,i)&&n0?"/".concat(r):"";await y.prototype.$socket.close(),await y.prototype.$socket.setUrl(s.protocol+"://"+t.hostname+":"+t.port+i+"/websocket"),await y.prototype.$socket.connect()}},onOpen({commit:e,dispatch:s,rootState:t}){var r,i;e("setConnected"),s("server/init",null,{root:!0}),(i=(r=t==null?void 0:t.server)==null?void 0:r.updateManager)!=null&&i.updateResponse.complete||e("server/updateManager/setStatus",{busy:!1},{root:!0})},onClose({commit:e}){e("setDisconnected")},onMessage({commit:e,dispatch:s},t){switch(t.method){case"notify_status_update":s("printer/getData",t.params[0],{root:!0});break;case"notify_gcode_response":s("server/addEvent",Object.assign({result:t.params[0]},{send:!1}),{root:!0});break;case"notify_klippy_ready":e("server/setKlippyConnected",null,{root:!0}),s("server/stopKlippyConnectedInterval",null,{root:!0}),s("server/stopKlippyStateInterval",null,{root:!0}),s("printer/init",null,{root:!0});break;case"notify_klippy_disconnected":s("server/setKlippyDisconnected",null,{root:!0});break;case"notify_klippy_shutdown":s("server/setKlippyShutdown",null,{root:!0});break;case"notify_proc_stat_update":s("server/updateProcStats",t.params[0],{root:!0});break;case"notify_cpu_throttled":e("server/setThrottledState",t.params[0],{root:!0});break;case"notify_filelist_changed":s("files/filelist_changed",t.params[0],{root:!0});break;case"notify_metadata_update":e("files/setMetadata",t.params[0],{root:!0});break;case"notify_power_changed":e("server/power/setStatus",t.params[0],{root:!0});break;case"notify_update_response":e("server/updateManager/addUpdateResponse",t.params[0],{root:!0});break;case"notify_update_refreshed":s("server/updateManager/onUpdateStatus",t.params[0],{root:!0});break;case"notify_history_changed":s("server/history/getChanged",t.params[0],{root:!0});break;case"notify_service_state_changed":s("server/serviceStateChanged",t.params[0],{root:!0});break;case"notify_timelapse_event":s("server/timelapse/getEvent",t.params[0],{root:!0});break;case"notify_job_queue_changed":s("server/jobQueue/getEvent",t.params[0],{root:!0});break;case"notify_announcement_update":s("server/announcements/getList",t.params[0],{root:!0});break;case"notify_announcement_dismissed":s("server/announcements/getDismissed",t.params[0],{root:!0});break;case"notify_announcement_wake":s("server/announcements/getWaked",t.params[0],{root:!0});break;case"notify_webcams_changed":s("gui/webcams/initStore",t.params[0],{root:!0});break;case"notify_active_spool_set":s("server/spoolman/getActiveSpoolId",t.params[0],{root:!0});break;case"notify_sensor_update":s("server/sensor/updateSensors",t.params[0],{root:!0});break;default:window.console.debug(t)}},addLoading({commit:e},s){e("addLoading",s)},removeLoading({commit:e},s){e("removeLoading",s)},clearLoadings({commit:e}){e("clearLoadings")},addInitModule({commit:e},s){e("addInitModule",s)},removeInitModule({commit:e},s){e("removeInitModule",s)},removeInitComponent({commit:e},s){e("removeInitComponent",s)},reportDebug(e,s){window.console.log(s)}},Qre={reset(e){const s=vS();y.set(e,"initializationList",s.initializationList)},setConnected(e){y.set(e,"isConnected",!0),y.set(e,"isConnecting",!1),y.set(e,"connectingFailed",!1)},setDisconnected(e){y.set(e,"isConnected",!1),y.set(e,"isConnecting",!1),y.set(e,"connectingFailed",!0),y.set(e,"connection_id",null)},setData(e,s){"socket"in s&&(s=s.socket),Object.entries(s).forEach(([t,r])=>{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))}},eie={getUrl:e=>{const s=e.port!==80?":"+e.port:"";let t="/"+e.path.replace(/^\/|\/$/g,"");return t.endsWith("/")&&(t=t.slice(0,-1)),"//".concat(e.hostname).concat(s).concat(t)},getHostUrl:e=>{const s=e.protocol==="wss"?"https":"http";return"".concat(s,"://").concat(e.hostname,"/")},getWebsocketUrl:(e,s)=>e.protocol+":"+s.getUrl+"/websocket"},vS=()=>{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),r={}.VUE_APP_PATH||"";return{hostname:e,port:t,path:r,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}},tie=vS(),sie={namespaced:!0,state:tie,getters:eie,actions:Kre,mutations:Qre},rie={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("maintenance")?(e("socket/addInitModule","gui/maintenance/init",{root:!0}),e("gui/maintenance/init",null,{root:!0})):e("gui/maintenance/initDb",null,{root:!0}),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=PE(n),yy.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)}},iie={reset(e){Object.assign(e,PS())},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>=no&&(s=s.slice(s.length-no)),s.forEach(t=>{const r=new Date(t.time*1e3);let i=Ap(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>=no&&(e.events=e.events.slice(e.events.length-no))},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))}},nie={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:Ap(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,m,h,p,f,b,C,S,L,N,R,x,T,I,j,W,Z,re,k,G,X,Y,ee,se,F,z,w,A,H,K;let i=null;if("system_info"in e){let le=null;(n=t.printer)!=null&&n.software_version&&(le=(a=t.printer)==null?void 0:a.software_version.split("-").slice(0,4).join("-")),(o=t.printer)!=null&&o.app_name&&(le=((l=t.printer)==null?void 0:l.app_name)+" "+le);let he=null;if((u=(c=e.system_info)==null?void 0:c.python)!=null&&u.version_string){const gP=(m=(d=e.system_info)==null?void 0:d.python)==null?void 0:m.version_string.indexOf(" ");he=(p=(h=e.system_info)==null?void 0:h.python)==null?void 0:p.version_string.slice(0,gP+1)}const be=(C=(b=(f=e.system_info)==null?void 0:f.cpu_info)==null?void 0:b.cpu_count)!=null?C:1,we=Math.round(((L=(S=t.printer.system_stats)==null?void 0:S.sysload)!=null?L:0)*100)/100,st=Math.round(we/be*100);let Pt="primary";st>95?Pt="error":st>80&&(Pt="warning");let Ft=null,ei=null;const hn=((R=(N=t.printer.system_stats)==null?void 0:N.memavail)!=null?R:0)*1024,Ms=((I=(T=(x=e.system_info)==null?void 0:x.cpu_info)==null?void 0:T.total_memory)!=null?I:0)*1024;hn>0&&Ms>0?(Ft=Je(Ms-hn)+" / "+Je(Ms),ei=Math.round((Ms-hn)/Ms*100)):Ms&&(Ft=Je(Ms));let od="primary";ei&&ei>95?od="error":ei&&ei>80&&(od="warning");let ld=r["printer/getHostTempSensor"];ld===null&&e.cpu_temp!==null&&(ld={temperature:(j=e.cpu_temp)==null?void 0:j.toFixed(0),measured_min_temp:null,measured_max_temp:null}),i={cpuName:(re=(Z=(W=e.system_info)==null?void 0:W.cpu_info)==null?void 0:Z.processor)!=null?re:null,cpuDesc:(X=(G=(k=e.system_info)==null?void 0:k.cpu_info)==null?void 0:G.cpu_desc)!=null?X:null,bits:(se=(ee=(Y=e.system_info)==null?void 0:Y.cpu_info)==null?void 0:ee.bits)!=null?se:null,version:le,pythonVersion:he,os:(w=(z=(F=e.system_info)==null?void 0:F.distribution)==null?void 0:z.name)!=null?w:null,release_info:(K=(H=(A=e.system_info)==null?void 0:A.distribution)==null?void 0:H.release_info)!=null?K:null,load:we,loadPercent:st<100?st:100,loadProgressColor:Pt,memoryFormat:Ft,memUsed:Je(Ms-hn),memAvail:Je(hn),memTotal:Je(Ms),memUsage:ei,memUsageColor:od,tempSensor:ld}}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}},aie={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})}},oie={reset(e){Object.assign(e,_S())},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)}},lie={getDevices:e=>e.devices},_S=()=>({devices:[]}),cie=_S(),uie={namespaced:!0,state:cie,getters:lie,actions:aie,mutations:oie},die={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})}},mie={reset(e){Object.assign(e,bS())},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:[]})}},hie={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}})}),At(s,"name")}},bS=()=>({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:[]}}),pie=bS(),fie={namespaced:!0,state:pie,getters:hie,actions:die,mutations:mie},gie={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){var r;e("setTotals",s.job_totals);const t=(r=s.auxiliary_totals)!=null?r:[];t.length&&e("setAuxiliaryTotals",t)},async getHistory({commit:e,dispatch:s,state:t},r){var o,l,c,u,d,m,h,p,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(S=>{t.jobs.findIndex(L=>L.job_id===S.job_id)===-1&&e("addJob",S)});const i=(d=(u=r.requestParams)==null?void 0:u.start)!=null?d:0,n=(h=(m=r.requestParams)==null?void 0:m.limit)!=null?h:50,a=(f=(p=r.requestParams)==null?void 0:p.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})}},vie={reset(e){Object.assign(e,yS())},resetJobs(e){y.set(e,"jobs",[])},setTotals(e,s){y.set(e,"job_totals",s)},setAuxiliaryTotals(e,s){y.set(e,"auxiliary_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)}},_ie={getSelectedJobs:(e,s,t)=>{var i;return((i=t.gui.view.history.selectedJobs)!=null?i:[]).filter(n=>n.type==="job")},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=ve.te("History.StatusValues.".concat(i.status),"en")?ve.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:ve.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 s.getSelectedJobs.forEach(i=>{var a;const n=r.findIndex(o=>o.name===i.status);if(n!==-1)r[n].value+=1;else{const o=ve.te("History.StatusValues.".concat(i.status),"en").toString()?ve.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){const t=[],r=new Date;r.setTime(r.getTime()-60*60*24*14*1e3),r.setHours(0,0,0,0);let i=[...e.jobs.filter(n=>new Date(n.start_time*1e3)>=r&&n.filament_used>0)];s.getSelectedJobs.length&&(i=[...s.getSelectedJobs.filter(n=>new Date(n.start_time*1e3)>=r&&n.filament_used>0)]);for(let n=0;n<=14;n++){const a=new Date;a.setTime(r.getTime()+60*60*24*n*1e3),t.push([new Date(a).setHours(0,0,0,0),0])}return i.length&&i.forEach(n=>{const a=new Date(n.start_time*1e3).setHours(0,0,0,0),o=t.findIndex(l=>l[0]===a);o!==-1&&(t[o][1]+=Math.round(n.filament_used)/1e3)}),t.sort((n,a)=>a[0]-n[0])},getPrinttimeAvgArray(e,s){const t=[0,0,0,0,0],r=new Date(new Date().getTime()-60*60*24*14*1e3);let i=[...e.jobs.filter(n=>new Date(n.start_time*1e3)>=r&&n.status==="completed")];return s.getSelectedJobs.length&&(i=[...s.getSelectedJobs.filter(n=>new Date(n.start_time*1e3)>=r&&n.status==="completed")]),i.length&&i.forEach(n=>{n.print_duration>0&&n.print_duration<=60*60*2?t[0]++:n.print_duration>60*60*2&&n.print_duration<=60*60*6?t[1]++:n.print_duration>60*60*6&&n.print_duration<=60*60*12?t[2]++:n.print_duration>60*60*12&&n.print_duration<=60*60*24?t[3]++:n.print_duration>60*60*24&&t[4]++}),t},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,u;return((l=o.metadata)==null?void 0:l.size)===r&&Math.round(((u=(c=o.metadata)==null?void 0:c.modified)!=null?u:0)*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,o;return n.filename===s&&Math.round(((o=(a=n.metadata)==null?void 0:a.modified)!=null?o:0)*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 r3;case"completed":return uT;case"cancelled":return vT;default:return Wn}},getFilteredJobList:(e,s,t)=>{const r=t.gui.view.history.hidePrintStatus;return e.jobs.filter(i=>!r.includes(i.status))}},yS=()=>({jobs:[],job_totals:{total_jobs:0,total_time:0,total_print_time:0,total_filament_used:0,longest_job:0,longest_print:0},auxiliary_totals:[],all_loaded:!1}),bie=yS(),yie={namespaced:!0,state:bie,getters:_ie,actions:gie,mutations:vie},Cie={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")}},$ie={reset(e){Object.assign(e,CS())},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:""})}},xie={},CS=()=>({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:""}}),wie=CS(),Sie={namespaced:!0,state:wie,getters:xie,actions:Cie,mutations:$ie},Pie={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&&e("setQueuedJobs",t.queued_jobs),"queue_state"in t&&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({dispatch:e,getters:s},t){const r=s.getJobs,i=r.findIndex(n=>n.job_id===t.job_id);i!==-1&&(r[i].combinedIds=Array(t.count-1).fill(t.job_id),e("sendNewQueueList",{jobs:r}))},changePosition({dispatch:e,getters:s},t){const r=s.getJobs,i=r.splice(t.oldIndex,1)[0];r.splice(t.newIndex,0,i),e("sendNewQueueList",{jobs:r})},startByJobId({dispatch:e,getters:s},t){const r=s.getJobs,i=r.findIndex(a=>a.job_id===t);if(i===-1)return;const n=r.splice(i,1)[0];r.splice(0,0,n),e("sendNewQueueList",{jobs:r,printStart:!0})},sendNewQueueList(e,s){const t=s.jobs.map(i=>{var a,o;const n=((o=(a=i.combinedIds)==null?void 0:a.length)!=null?o:0)+1;return n===1?i.filename:Array(n).fill(i.filename)}).flat(),r={};s.printStart&&(r.action="server/jobQueue/start"),y.$socket.emit("server.job_queue.post_job",{filenames:t,reset:!0},r)},deleteFromQueue(e,s){y.$socket.emit("server.job_queue.delete_job",{job_ids:s})},clearQueue(){y.$socket.emit("server.job_queue.delete_job",{all:!0})},start(){y.$socket.emit("server.job_queue.start",{},{loading:"startJobqueue"})},pause(){y.$socket.emit("server.job_queue.pause",{},{loading:"pauseJobqueue"})}},Die={reset(e){Object.assign(e,$S())},setQueuedJobs(e,s){y.set(e,"queued_jobs",s)},setQueueState(e,s){y.set(e,"queue_state",s)}},Tie={getJobs:(e,s,t,r)=>{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>=bs&&d.width<=ys&&d.height>=bs&&d.height<=ys),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>=rr),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""}},$S=()=>({queued_jobs:[],queue_state:""}),Mie=$S(),Eie={namespaced:!0,state:Mie,getters:Tie,actions:Pie,mutations:Die},Oie={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})}},Lie={reset(e){Object.assign(e,xS())},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)}},Aie={getAnnouncements:e=>e.entries.filter(s=>!s.dismissed)},xS=()=>({entries:[],feeds:[]}),kie=xS(),Fie={namespaced:!0,state:kie,getters:Aie,actions:Oie,mutations:Lie};function xn(e){var s,t,r,i;return((t=(s=e.error)==null?void 0:s.message)!=null?t:null)!==null?(y.$toast.error((i=(r=e.error)==null?void 0:r.message)!=null?i:"unknown spoolman error"),null):"response"in e?e.response:e}const Rie={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",use_v2_response:!0},{action:"server/spoolman/getInfo"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/health",use_v2_response:!0},{action:"server/spoolman/getHealth"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/vendor",use_v2_response:!0},{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",use_v2_response:!0,path:"/v1/spool/".concat(t.spool_id)},{action:"server/spoolman/getActiveSpool"})},getActiveSpool({commit:e},s){"requestParams"in s&&delete s.requestParams,s=xn(s),s!==null&&e("setActiveSpool",s)},getHealth({commit:e,dispatch:s},t){delete t.requestParams,s("socket/removeInitModule","server/spoolman/getHealth",{root:!0}),t=xn(t),t!==null&&e("setHealth",t.status)},getInfo({commit:e,dispatch:s},t){delete t.requestParams,s("socket/removeInitModule","server/spoolman/getInfo",{root:!0}),t=xn(t),t!==null&&e("setInfo",t)},getVendors({commit:e,dispatch:s},t){delete t.requestParams,s("socket/removeInitModule","server/spoolman/getVendors",{root:!0}),t=xn(t),t!==null&&e("setVendors",Object.entries(t).map(r=>r))},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){if("requestParams"in t&&delete t.requestParams,s("socket/removeLoading","refreshSpools",{root:!0}),t=xn(t),t===null)return;const r=Object.entries(t).map(i=>i[1]);e("setSpools",r)},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"})}},jie={reset(e){Object.assign(e,wS())},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)}},Hie={},wS=()=>({health:"",info:{automatic_backups:!1,backups_dir:"",data_dir:"",debug_mode:!1,version:""},active_spool_id:null,active_spool:null,vendors:[],feeds:[]}),Iie=wS(),Nie={namespaced:!0,state:Iie,getters:Hie,actions:Rie,mutations:jie},Vie={reset({commit:e}){e("reset")},init(){y.$socket.emit("server.sensors.list",{},{action:"server/sensor/getSensors"})},getSensors({commit:e,dispatch:s},t){e("setSensors",t.sensors),s("socket/removeInitModule","server/sensor/init",{root:!0})},updateSensors({commit:e},s){Object.keys(s).forEach(t=>{e("updateSensor",{key:t,value:s[t]})})}},Uie={reset(e){Object.assign(e,SS())},setSensors(e,s){y.set(e,"sensors",s)},updateSensor(e,s){s.key in e.sensors&&y.set(e.sensors[s.key],"values",s.value)}},Bie={getSensors:e=>Object.keys(e.sensors)},SS=()=>({sensors:{}}),Wie=SS(),Gie={namespaced:!0,state:Wie,getters:Bie,actions:Vie,mutations:Uie},PS=()=>({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:""}),zie=PS(),Zie={namespaced:!0,state:zie,getters:nie,actions:rie,mutations:iie,modules:{power:uie,updateManager:fie,history:yie,timelapse:Sie,jobQueue:Eie,announcements:Fie,spoolman:Nie,sensor:Gie}},qie={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){var r;e("server/setData",{klippy_state:t.state,klippy_message:t.state_message},{root:!0}),e("setData",{app_name:(r=t.app)!=null?r:null,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,m,h;"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}),(m=r.toolhead)!=null&&m.axis_minimum&&s("gui/updateGcodeviewerCache",{axis_minimum:(h=r.toolhead)==null?void 0:h.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")}},Xie={reset(e){const s=TS();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){eu(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",{})}},Yie={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 a,o,l,c;const s=[],t=(o=(a=e.configfile)==null?void 0:a.settings)!=null?o:null,r=(c=(l=e.gcode)==null?void 0:l.commands)!=null?c:{},i="gcode_macro ",n=i.length;return Object.keys(e).filter(u=>u.toLowerCase().startsWith(i)).forEach(u=>{var b,C,S,L;const d=u.slice(n),m=(b=r[d.toUpperCase()])!=null?b:{};if(d.startsWith("_"))return;const h=u.toLowerCase(),p=(C=t[h])!=null?C:{};if("rename_existing"in p)return;const f=(S=e[u])!=null?S:{};s.push({name:d,description:(L=m==null?void 0:m.help)!=null?L:null,prop:p,params:TE(p),variables:f})}),At(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 h,p,f,b,C,S,L,N,R,x,T,I;let a="RGB",o=null;const l=(h=n.state.color_data)!=null?h:[];"color_order"in n.settings&&(a=(p=n.settings.color_order[0])!=null?p:""),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 m=(S=n.settings.initial_white)!=null?S:null;if("initial_white"in n.config||(m=null),n.type==="led"&&a.length===1){const j=(L=l[0])!=null?L:[];switch(a){case"R":o=(N=j[0])!=null?N:0;break;case"G":o=(R=j[1])!=null?R:0;break;case"B":o=(x=j[2])!=null?x:0;break;case"W":o=(T=j[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:m,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","pwm_tool","pwm_cycle_time"],r=["fan_generic","fan"];for(const[u,d]of Object.entries(e)){const m=u.split(" ");if(t.includes(m[0])){const h=m.length>1?m[1]:m[0];if(!h.startsWith("_")){let p=r.includes(m[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 S=p,L=1;m[0].toLowerCase()==="fan"&&(L=255),["output_pin","pwm_tool","pwm_cycle_time"].includes(m[0])&&(p=!0,S=!1,"pwm"in f&&(S=(a=f==null?void 0:f.pwm)!=null?a:!1),["pwm_tool","pwm_cycle_time"].includes(m[0])&&(S=!0),"scale"in f&&(L=(o=f==null?void 0:f.scale)!=null?o:1));const N={name:h,type:m[0],power:b,controllable:p,pwm:S,rpm:C,scale:L,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&&(N.off_below=(l=f==null?void 0:f.off_below)!=null?l:0),"max_power"in f&&(N.max_power=(c=f==null?void 0:f.max_power)!=null?c:1)),s.push(N)}}}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 m=u.name.toUpperCase(),h=d.name.toUpperCase();return mh?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 At(t,"name")},getMcus:(e,s)=>{const t=[];return Object.keys(e).forEach(r=>{var i,n,a,o,l,c,u,d,m,h,p,f;if(r==="mcu"||r.startsWith("mcu ")){const b=e[r];let C=((i=b.mcu_version)!=null?i:"unknown").split("-").slice(0,4).join("-");"app"in b&&b.app!=="Klipper"&&(C=b.app+" "+C);let S=0;(n=b.last_stats)!=null&&n.mcu_task_avg&&((a=b.last_stats)!=null&&a.mcu_task_stddev)&&(S=b.last_stats.mcu_task_avg+3*((o=b.last_stats)==null?void 0:o.mcu_task_stddev)/.0025);let L="primary";S>.95?L="error":S>.8&&(L="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:DE((h=(m=b.last_stats)==null?void 0:m.freq)!=null?h:0),awake:(((f=(p=b.last_stats)==null?void 0:p.mcu_awake)!=null?f:0)/5).toFixed(2),load:S.toFixed(2),loadPercent:S<1?Math.round(S*100):100,loadProgressColor:L,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(m=>m.toLowerCase()===a.toLowerCase())||"";if("sensor_type"in o&&t.includes(o.sensor_type)&&l in e){const m=e[l];i={temperature:(c=m.temperature)==null?void 0:c.toFixed(0),measured_min_temp:(u=m.measured_min_temp)==null?void 0:u.toFixed(1),measured_max_temp:(d=m.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},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 ID.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,m,h,p;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=(p=(h=(m=(d=t.gui)==null?void 0:d.general)==null?void 0:m.calcEstimateTime)==null?void 0:h.includes("filament"))!=null?p:!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,m,h,p,f,b,C,S,L;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=(p=(h=(m=t.gui)==null?void 0:m.general)==null?void 0:h.calcEtaTime)==null?void 0:p.includes("filament"))!=null?f:!1,o=(L=(S=(C=(b=t.gui)==null?void 0:b.general)==null?void 0:C.calcEtaTime)==null?void 0:S.includes("slicer"))!=null?L:!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 m;const i=(m=r["gui/getHours12Format"])!=null?m:!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}},Jie={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 m=Object.keys(r),h={};m.forEach(R=>{let x=R;if(x.indexOf(" ")!==-1&&(x=x.substring(x.indexOf(" ")+1)),!(a.includes(R)||o.includes(R))||x.startsWith("_")){delete r[R];return}const T=r[R];Dn.forEach(I=>{if(I+"s"in T){const j=l-T[I+"s"].length;T[I+"s"]=[...Array.from({length:j},()=>null),...T[I+"s"]]}}),h[R]={...T}}),a.concat(o).forEach(R=>{if(R in r)return;let x=R,T=R;const I=R.indexOf(" ");if(I!==-1&&(x=R.substring(I+1),T=R.substring(0,I)),x.startsWith("_"))return;const j={temperatures:Array(l).fill(null)};n.includes(R)?(j.targets=Array(l).fill(null),j.powers=Array(l).fill(null)):["temperature_fan"].includes(T)&&(j.targets=Array(l).fill(null),j.speeds=Array(l).fill(null)),h[R]={...j}});const f=[];for(let R=0;R{Dn.forEach(I=>{const j="".concat(I,"s");j in h[T]&&(x["".concat(T,"-").concat(I)]=h[T][j][R])})}),f.push(x)}e("setInitSource",f);const b=Object.keys(f[0]).filter(R=>R!=="date"),C=b.filter(R=>R.endsWith("-temperature")).map(R=>R.slice(0,R.length-12)).sort(),S=[];let L=0;C.forEach(R=>{let x=s["gui/getDatasetValue"]({name:R,type:"color"});x||(R==="heater_bed"&&(x=FD),R.endsWith(" chamber")&&(x=RD),x||(x=kD[L],L++,x===void 0&&(x="#"+Math.floor(16777215*Math.random()).toString(16))));const T={id:S.length+1,color:x,type:"line",name:"".concat(R,"-temperature"),encode:{x:"date",y:"".concat(R,"-temperature")},animation:!1,yAxisIndex:0,lineStyle:{color:x,width:2,opacity:.9},showSymbol:!1,emphasis:{lineStyle:{color:x,width:2,opacity:.9}}};S.push(T),Dn.forEach(I=>{if(I==="temperature")return;const j=R+"-"+I;if(!b.includes(j))return;const W=JSON.parse(JSON.stringify(T));W.id=S.length+1,W.name=j,W.encode.y=j,I==="target"&&(W.lineStyle.width=0,W.emphasis.lineStyle.width=0,W.areaStyle={color:x,opacity:.1},W.emphasis.areaStyle={color:x,opacity:.1}),Un.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"),S.push(W)})}),e("setInitSeries",S);const N=setInterval(()=>{t("updateSource")},jD);e("setUpdateSourceInterval",N)}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],m=d.date.getSeconds(),h=c.getSeconds(),p=c.getTime()-d.date.getTime();if(m===h&&p<1e3)return}const u={date:c};a.forEach(d=>{if(!(s.printer&&d in s.printer))return;const m={...s.printer[d]};Dn.forEach(h=>{if(!(h in m))return;let p=m[h];p!==null&&(p=Math.round(m[h]*10)/10),Un.includes(h)&&(p=Math.round(m[h]*1e3)/1e3),u["".concat(d,"-").concat(h)]=p})}),e("addToSource",{data:u,maxHistory:t["printer/tempHistory/getTemperatureStoreSize"]})}},setColor({commit:e},s){e("setColor",s)}},Kie={reset(e){Object.assign(e,DS())},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)}})}},Qie={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&&Un.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,m,h,p;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((p=(h=(m=t.printer)==null?void 0:m.heaters)==null?void 0:h.available_sensors)!=null?p:[]).filter(f=>{var S;if(i.includes(f)||f.startsWith("temperature_fan"))return!1;const b=r[f.toLowerCase()];if(!b)return!1;const C=(S=b.sensor_type)!=null?S:"";return["temperature_mcu","temperature_host"].includes(C)})},getSelectedLegends:(e,s,t)=>{var c,u,d,m,h,p,f,b,C,S,L,N,R,x,T,I,j,W,Z,re,k,G;const r={},i=(d=(u=(c=t.printer)==null?void 0:c.heaters)==null?void 0:u.available_sensors)!=null?d:[],n=(p=(h=(m=t.printer)==null?void 0:m.heaters)==null?void 0:h.available_monitors)!=null?p:[],a=(S=(C=(b=(f=t.gui)==null?void 0:f.view)==null?void 0:b.tempchart)==null?void 0:C.datasetSettings)!=null?S:{};if(Object.keys(a).forEach(X=>{!i.includes(X)&&!n.includes(X)||Object.keys(a[X]).forEach(Y=>{if(!Dn.includes(Y))return;const ee="".concat(X,"-").concat(Y);e.series.findIndex(se=>se.name===ee)!==-1&&(r[ee]=a[X][Y])})}),e.series.forEach(X=>{if(Object.keys(r).includes(X.name))return;const Y=X.name.slice(X.name.lastIndexOf("-")+1);r[X.name]=!Un.includes(Y)}),(x=(R=(N=(L=t.gui)==null?void 0:L.view)==null?void 0:N.tempchart)==null?void 0:R.hideMcuHostSensors)!=null?x:!1){const X=(T=s.getHostMcuSensors)!=null?T:[];Object.keys(r).filter(Y=>{const ee=Y.slice(0,Y.lastIndexOf("-"));return X.includes(ee)}).forEach(Y=>{r[Y]=!1})}if((Z=(W=(j=(I=t.gui)==null?void 0:I.view)==null?void 0:j.tempchart)==null?void 0:W.hideMonitors)!=null?Z:!1){const X=(G=(k=(re=t.printer)==null?void 0:re.heaters)==null?void 0:k.available_monitors)!=null?G:[];Object.keys(r).filter(Y=>{const ee=Y.slice(0,Y.lastIndexOf("-"));return X.includes(ee)}).forEach(Y=>{r[Y]=!1})}return r},getTemperatureStoreSize:(e,s,t,r)=>{const i=r["server/getConfig"]("data_store","temperature_store_size");return i!=null?i:1200}},DS=()=>({source:[],series:[],timeLastUpdate:null,updateSourceInterval:null}),ene=DS(),tne={namespaced:!0,state:ene,getters:Qie,actions:Jie,mutations:Kie},TS=()=>({}),sne=TS(),rne={namespaced:!0,state:sne,getters:Yie,actions:qie,mutations:Xie,modules:{tempHistory:tne}},ine={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,m,h,p;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(S=>S.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(S=>S.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=>!ZD.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(S=>!S.isDirectory&&S.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}})}),(m=r==null?void 0:r.root_info)!=null&&m.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!==((h=r.root_info)==null?void 0:h.permissions)&&s("setRootPermissions",r.root_info)}(p=r.requestParams)!=null&&p.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(ve.t("Files.ScanMetaSuccess",{filename:t}).toString())}},requestMetadata({commit:e},s){let t=[];for(const{filename:r}of s)if(t.length>=100&&(y.$socket.emitBatch(t),t=[]),r.slice(0,r.indexOf("/"))==="gcodes"){const n=r.slice(7);e("setMetadataRequested",{filename:n}),t.push({method:"server.files.metadata",params:{filename:n},emitOptions:{action:"files/getMetadata"}})}y.$socket.emitBatch(t)},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(ve.t("Files.SuccessfullyRenamed",{filename:t})):y.$toast.success(ve.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(ve.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(ve.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(ve.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=ks.CancelToken.source();return await e("uploadClearState"),await e("uploadSetCancelTokenSource",n),await e("uploadSetFilename",t.file.name),await e("uploadSetShow",!0),new Promise(a=>{ks.post(r+"/server/files/upload",i,{cancelToken:n.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:o=>{var u,d;const l=((u=o.progress)!=null?u:0)*100;e("uploadSetPercent",l);const c=(d=o.rate)!=null?d:0;e("uploadSetSpeed",c)}}).then(o=>{e("uploadSetShow",!1);const l=o.data.item.path.lastIndexOf("/"),c=o.data.item.path.slice(l+1);a(c)}).catch(()=>{e("uploadSetShow",!1),y.$toast.error(ve.t("FullscreenUpload.CannotUploadFile").toString()),a(!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(ve.t("Machine.LogfilesPanel.RolloverToastSuccessful",{name:t}))}),Object.keys(s.failed).forEach(t=>{const r=s.failed[t];y.$toast.error(ve.t("Machine.LogfilesPanel.RolloverToastFailed",{name:t,message:r}))}),setTimeout(()=>{y.$socket.emit("server.files.get_directory",{path:"logs"},{action:"files/getDirectory"})},500)}},nne={reset(e){Object.assign(e,MS())},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=jt(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=jt(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]};ND.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=jt(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=jt(e.filetree,r.split("/")),c=l==null?void 0:l.findIndex(m=>m.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=jt(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=jt(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=jt(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=jt(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=jt(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=jt(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=jt(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=jt(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)}},ane={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 m=s.getDirectory("gcodes"+i);c=(d=m==null?void 0:m.childrens)!=null?d:[]}else{const m=(h,p)=>{var f,b;h.isDirectory&&((f=h.childrens)!=null&&f.length)&&((b=h.childrens)==null||b.forEach(C=>{if(C.isDirectory)m(C,p+C.filename+"/");else{const S={...C};S.filename=p+C.filename,c.push(S)}}))};m(o,"")}c=c.filter(m=>{if(!n&&(m.filename==="thumbs"||m.filename.startsWith(".")))return!1;if(m.isDirectory)return!0;const h=m.filename.lastIndexOf("."),p=m.filename.slice(h);return Ci.includes(p)});const u=[];return c.forEach(m=>{var L,N;const h=typeof m.modified.getTime=="function"?m.modified.getTime():0,p={...m,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(R=>{R.name in m&&m[R.name]>1&&f.push("".concat(R.gcode," S").concat(m[R.name]))}),f.length&&(p.preheat_gcode=f.join("\n")),(L=m.thumbnails)!=null&&L.length){let R="";if(i===null){const I=m.filename.lastIndexOf("/");I>0&&(R="/"+m.filename.slice(0,I))}const x=m.thumbnails.find(I=>I.width>=bs&&I.width<=ys&&I.height>=bs&&I.height<=ys);x&&"relative_path"in x&&(p.small_thumbnail="".concat(l+R,"/").concat(encodeURI(x.relative_path),"?timestamp=").concat(h));const T=m.thumbnails.find(I=>I.width>=rr);T&&"relative_path"in T&&(p.big_thumbnail="".concat(l+R,"/").concat(encodeURI(T.relative_path),"?timestamp=").concat(h),p.big_thumbnail_width=T.width)}const C=i&&i.length?i+"/"+m.filename:m.filename;let S=r["server/history/getPrintJobsForGcodes"](C,h,m.size,(N=m.uuid)!=null?N:null,m.job_id);if(S&&S.length){S=S.sort((T,I)=>I.start_time-T.start_time);const R=S.filter(T=>T.status==="completed"),x=[...S].shift();if(p.last_status=x.status,p.count_printed=R.length,p.last_start_time=new Date(x.start_time*1e3),p.count_printed>0){const T=R[0];p.last_start_time=new Date(T.start_time*1e3),p.last_end_time=new Date(T.end_time*1e3),p.last_filament_used=T.filament_used,p.last_print_duration=T.print_duration,p.last_total_duration=T.total_duration}}(a||p.count_printed===0)&&u.push(p)}),u},getAllGcodes:(e,s)=>s.getGcodeFiles(null,!1,!0),getThemeFileUrl:(e,s,t,r)=>(i,n)=>{var l;const a=s.getDirectory("config/"+yi),o=(l=a==null?void 0:a.childrens)==null?void 0:l.find(c=>{var u,d,m,h;return((d=c.filename)==null?void 0:d.slice(0,(u=c.filename)==null?void 0:u.lastIndexOf(".")))===i&&n.includes((h=c.filename)==null?void 0:h.slice(((m=c.filename)==null?void 0:m.lastIndexOf("."))+1))});return o?"".concat(r["socket/getUrl"],"/server/files/config/").concat(yi,"/").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>=bs&&l.width<=ys&&l.height>=bs&&l.height<=ys);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>=rr);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""}},MS=()=>({filetree:[],upload:{show:!1,filename:"",currentNumber:0,maxNumber:0,cancelTokenSource:null,percent:0,speed:0}}),one=MS(),lne={namespaced:!0,state:one,getters:ane,actions:ine,mutations:nne},cne={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,m;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"})),(m=(d=(u=i.value)==null?void 0:u.view)==null?void 0:d.configfiles)!=null&&m.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(h=>{s("presets/store",{values:h})}),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 h=i.value.dashboard;["mobileLayout","tabletLayout1","tabletLayout2","desktopLayout1","desktopLayout2","widescreenLayout1","widescreenLayout2","widescreenLayout3"].forEach(f=>{if(f in h){const b=h[f].findIndex(C=>C.name==="tools");b!==-1&&(h[f][b].name="temperature",s("saveSetting",{name:"dashboard."+f,value:h[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/"+yi+"/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 n,a;const t=e["socket/getUrl"]+"/server/database/item",r=e["socket/getUrl"]+"/server/files/config/"+yi+"/default.json?time="+Date.now();let i={};try{i=await fetch(r).then(o=>o.json())}catch(o){window.console.error("Error while fetching/parsing default.json",o),i={}}for(const o of s)if(["maintenance","timelapse","webcams"].includes(o)){const l=t+"?namespace="+o,u=await(await fetch(l)).json();if((n=u==null?void 0:u.result)!=null&&n.value)for(const d of Object.keys((a=u==null?void 0:u.result)==null?void 0:a.value))await fetch(l+"&key="+d,{method:"DELETE"});if(o in i)for(const d of i[o])await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:o,key:d,value:i[o][d]})})}else o==="history_jobs"?await fetch(e["socket/getUrl"]+"/server/history/job?all=true",{method:"DELETE"}):o==="history_totals"?await fetch(e["socket/getUrl"]+"/server/history/reset_totals",{method:"POST"}):(await fetch(e["socket/getUrl"]+"/server/database/item?namespace=mainsail&key="+o,{method:"DELETE"}),o in i&&await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:o,value:i[o]})}));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 m=e["socket/getUrl"]+"/server/database/item?namespace="+d,p=await(await fetch(m)).json();(c=p==null?void 0:p.result)!=null&&c.value&&(t[d]={...(u=p==null?void 0:p.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,m,h;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 p of s.dbCheckboxes)if(["timelapse","webcams"].includes(p)){if(a.includes(p)){const f=t+"?namespace="+p,C=await(await fetch(f)).json();if((m=C==null?void 0:C.result)!=null&&m.value)for(const S of Object.keys((h=C==null?void 0:C.result)==null?void 0:h.value))await fetch(f+"&key="+S,{method:"DELETE"})}for(const f of Object.keys(s.restoreObjects[p])){const b=s.restoreObjects[p][f];await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:p,key:f,value:b})})}}else o.includes(p)&&await fetch(r+"&key="+p,{method:"DELETE"}),await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:p,value:s.restoreObjects[p]})});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=rd().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})}},une={reset(e){Object.assign(e,rd())},setData(e,s){eu(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)}},dne={theme:e=>{const s=e.uiSettings.theme;return fi.findIndex(t=>t.name===s)===-1?vy:s},getTheme:(e,s)=>{var t;return(t=fi.find(r=>r.name===s.theme))!=null?t:fi[0]},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,m;let i=[...UD];return((c=e.macros)==null?void 0:c.mode)==="expert"&&(s["macros/getAllMacrogroups"].forEach(p=>{i.push("macrogroup_"+p.id)}),i=i.filter(p=>p!=="macros")),r["printer/getKinematics"]==="none"&&(i=i.filter(h=>!["toolhead-control","machine-settings"].includes(h))),r["printer/getExtruders"].length<1&&(i=i.filter(h=>h!=="extruder-control")),((m=(d=(u=t.printer)==null?void 0:u.heaters)==null?void 0:d.available_sensors)!=null?m:[]).length<1&&(i=i.filter(h=>h!=="temperature")),s["webcams/getWebcams"].length===0&&(i=i.filter(h=>h!=="webcam")),t.server.components.includes("spoolman")||(i=i.filter(h=>h!=="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),m=[];l.forEach(h=>{d.find(p=>p.name===h)||m.push({name:h,visible:!0})}),o=o.concat(m)}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(m=>m.name!=="macros");const d=s["macros/getAllMacrogroups"];d.length&&(o=o.filter(m=>{if(!m.name.startsWith("macrogroup_"))return!0;const h=m.name.slice(11);return d.findIndex(p=>p.id===h)!==-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}},mne={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=os();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})}},hne={reset(e){Object.assign(e,ES())},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)}},pne={getConsolefilters:e=>{const s=[];return Object.keys(e.consolefilters).forEach(t=>{s.push({...e.consolefilters[t],id:t})}),At(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&&GD.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},ES=()=>({hideWaitTemperatures:!0,hideTlCommands:!0,direction:"table",entryStyle:"default",height:300,autoscroll:!0,consolefilters:{}}),fne=ES(),gne={namespaced:!0,state:fne,getters:pne,actions:mne,mutations:hne},vne={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>VD;)i.splice(0,1);await e("updateHistory",i),await s("upload")}},_ne={reset(e){Object.assign(e,OS())},updateHistory(e,s){y.set(e,"entries",s)}},bne={},OS=()=>({entries:[]}),yne=OS(),Cne={namespaced:!0,state:yne,getters:bne,actions:vne,mutations:_ne},$ne={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=os();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}))})}},xne={reset(e){Object.assign(e,LS())},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)}},wne={getAllMacrogroups:e=>{const s=[];return Object.keys(e.macrogroups).forEach(t=>{s.push({...e.macrogroups[t],id:t})}),At(s,"name")},getMacrogroup:e=>s=>e.macrogroups[s]},LS=()=>({mode:"simple",hiddenMacros:[],macrogroups:{}}),Sne=LS(),Pne={namespaced:!0,state:Sne,getters:wne,actions:$ne,mutations:xne},Dne={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=os();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=os();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=os();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))}},Tne={reset(e){Object.assign(e,AS())},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)}},Mne={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})}),At(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})}),At(i,"name")}},AS=()=>({entries:{}}),Ene=AS(),One={namespaced:!0,state:Ene,getters:Mne,actions:Dne,mutations:Tne},Lne={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")}},Ane={reset(e){Object.assign(e,kS())},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)}},kne={},kS=()=>({entries:[]}),Fne=kS(),Rne={namespaced:!0,state:Fne,getters:kne,actions:Lne,mutations:Ane},jne={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")}},Hne={reset(e){Object.assign(e,RS())},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 FS={exports:{}};const Ine={},Nne=Object.freeze(Object.defineProperty({__proto__:null,default:Ine},Symbol.toStringTag,{value:"Module"})),B0=mp(Nne);/** + * [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=Dr: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],m=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),o&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});var p=function(x,T){return function(I){return new L(T,!0).update(I)[x]()}},f=function(x){var T=p("hex",x);n&&(T=b(T,x)),T.create=function(){return new L(x)},T.update=function(W){return T.create().update(W)};for(var I=0;I>2]|=x[W]<>2]|=j<>2]|=(192|j>>6)<>2]|=(128|j&63)<=57344?(k[Z>>2]|=(224|j>>12)<>2]|=(128|j>>6&63)<>2]|=(128|j&63)<>2]|=(240|j>>18)<>2]|=(128|j>>12&63)<>2]|=(128|j>>6&63)<>2]|=(128|j&63)<=64?(this.block=k[16],this.start=Z-64,this.hash(),this.hashed=!0):this.start=Z}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var x=this.blocks,T=this.lastByteIndex;x[16]=this.block,x[T>>2]|=c[T&3],this.block=x[16],T>=56&&(this.hashed||this.hash(),x[0]=this.block,x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0),x[14]=this.hBytes<<3|this.bytes>>>29,x[15]=this.bytes<<3,this.hash()}},L.prototype.hash=function(){var x=this.h0,T=this.h1,I=this.h2,j=this.h3,W=this.h4,Z=this.h5,re=this.h6,k=this.h7,G=this.blocks,X,Y,ee,se,F,z,w,A,H,K,le;for(X=16;X<64;++X)F=G[X-15],Y=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3,F=G[X-2],ee=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10,G[X]=G[X-16]+Y+G[X-7]+ee<<0;for(le=T&I,X=0;X<64;X+=4)this.first?(this.is224?(A=300032,F=G[0]-1413257819,k=F-150054599<<0,j=F+24177077<<0):(A=704751109,F=G[0]-210244248,k=F-1521486534<<0,j=F+143694565<<0),this.first=!1):(Y=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),ee=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),A=x&T,se=A^x&I^le,w=W&Z^~W&re,F=k+ee+w+d[X]+G[X],z=Y+se,k=j+F<<0,j=F+z<<0),Y=(j>>>2|j<<30)^(j>>>13|j<<19)^(j>>>22|j<<10),ee=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),H=j&x,se=H^j&T^A,w=k&W^~k&Z,F=re+ee+w+d[X+1]+G[X+1],z=Y+se,re=I+F<<0,I=F+z<<0,Y=(I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10),ee=(re>>>6|re<<26)^(re>>>11|re<<21)^(re>>>25|re<<7),K=I&j,se=K^I&x^H,w=re&k^~re&W,F=Z+ee+w+d[X+2]+G[X+2],z=Y+se,Z=T+F<<0,T=F+z<<0,Y=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),ee=(Z>>>6|Z<<26)^(Z>>>11|Z<<21)^(Z>>>25|Z<<7),le=T&I,se=le^T&j^K,w=Z&re^~Z&k,F=W+ee+w+d[X+3]+G[X+3],z=Y+se,W=x+F<<0,x=F+z<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+x<<0,this.h1=this.h1+T<<0,this.h2=this.h2+I<<0,this.h3=this.h3+j<<0,this.h4=this.h4+W<<0,this.h5=this.h5+Z<<0,this.h6=this.h6+re<<0,this.h7=this.h7+k<<0},L.prototype.hex=function(){this.finalize();var x=this.h0,T=this.h1,I=this.h2,j=this.h3,W=this.h4,Z=this.h5,re=this.h6,k=this.h7,G=l[x>>28&15]+l[x>>24&15]+l[x>>20&15]+l[x>>16&15]+l[x>>12&15]+l[x>>8&15]+l[x>>4&15]+l[x&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[j>>28&15]+l[j>>24&15]+l[j>>20&15]+l[j>>16&15]+l[j>>12&15]+l[j>>8&15]+l[j>>4&15]+l[j&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[Z>>28&15]+l[Z>>24&15]+l[Z>>20&15]+l[Z>>16&15]+l[Z>>12&15]+l[Z>>8&15]+l[Z>>4&15]+l[Z&15]+l[re>>28&15]+l[re>>24&15]+l[re>>20&15]+l[re>>16&15]+l[re>>12&15]+l[re>>8&15]+l[re>>4&15]+l[re&15];return this.is224||(G+=l[k>>28&15]+l[k>>24&15]+l[k>>20&15]+l[k>>16&15]+l[k>>12&15]+l[k>>8&15]+l[k>>4&15]+l[k&15]),G},L.prototype.toString=L.prototype.hex,L.prototype.digest=function(){this.finalize();var x=this.h0,T=this.h1,I=this.h2,j=this.h3,W=this.h4,Z=this.h5,re=this.h6,k=this.h7,G=[x>>24&255,x>>16&255,x>>8&255,x&255,T>>24&255,T>>16&255,T>>8&255,T&255,I>>24&255,I>>16&255,I>>8&255,I&255,j>>24&255,j>>16&255,j>>8&255,j&255,W>>24&255,W>>16&255,W>>8&255,W&255,Z>>24&255,Z>>16&255,Z>>8&255,Z&255,re>>24&255,re>>16&255,re>>8&255,re&255];return this.is224||G.push(k>>24&255,k>>16&255,k>>8&255,k&255),G},L.prototype.array=L.prototype.digest,L.prototype.arrayBuffer=function(){this.finalize();var x=new ArrayBuffer(this.is224?28:32),T=new DataView(x);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),x};function N(x,T,I){var j,W=typeof x;if(W==="string"){var Z=[],re=x.length,k=0,G;for(j=0;j>6,Z[k++]=128|G&63):G<55296||G>=57344?(Z[k++]=224|G>>12,Z[k++]=128|G>>6&63,Z[k++]=128|G&63):(G=65536+((G&1023)<<10|x.charCodeAt(++j)&1023),Z[k++]=240|G>>18,Z[k++]=128|G>>12&63,Z[k++]=128|G>>6&63,Z[k++]=128|G&63);x=Z}else if(W==="object"){if(x===null)throw new Error(s);if(o&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!o||!ArrayBuffer.isView(x)))throw new Error(s)}else throw new Error(s);x.length>64&&(x=new L(T,!0).update(x).array());var X=[],Y=[];for(j=0;j<64;++j){var ee=x[j]||0;X[j]=92^ee,Y[j]=54^ee}L.call(this,T,I),this.update(Y),this.oKeyPad=X,this.inner=!0,this.sharedMemory=I}N.prototype=new L,N.prototype.finalize=function(){if(L.prototype.finalize.call(this),this.inner){this.inner=!1;var x=this.array();L.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(x),L.prototype.finalize.call(this)}};var R=f();R.sha256=R,R.sha224=f(!0),R.sha256.hmac=S(),R.sha224.hmac=S(!0),a?e.exports=R:(r.sha256=R.sha256,r.sha224=R.sha224)})()})(FS);var sr=FS.exports,W0=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 Gne:typeof navigator<"u"?Z0(navigator.userAgent):Kne()}function Yne(e){return e!==""&&qne.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 Z0(e){var s=Yne(e);if(!s)return null;var t=s[0],r=s[1];if(t==="searchbot")return new Wne;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.getNotificationsOverdueMaintenance),t=t.concat(s.getNotificationsBrowserWarnings),t=t.concat(s.getNotificationsOverheatDrivers);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:ve.t("App.ThrottledStates.Title".concat(c)),description:ve.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:ve.t("App.Notifications.DependencyName",{name:c.serviceName}).toString(),description:ve.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(sr.sha256(u))),n.forEach(u=>{var m,h,p,f;let d=u;if(u.startsWith("Unparsed config option")){const C=(h=(m=RegExp(/'(?