ocearo-ui 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/404.html +1 -1
  2. package/README.fr.md +23 -3
  3. package/README.md +23 -3
  4. package/__next.__PAGE__.txt +3 -3
  5. package/__next._full.txt +3 -3
  6. package/__next._tree.txt +2 -2
  7. package/_next/static/chunks/0-jqvc-r0kh0c.js +1 -0
  8. package/_next/static/chunks/{2g-xpe7xnropn.js → 05do10p9ldt1p.js} +1 -1
  9. package/_next/static/chunks/07gn9z0d6clzs.js +1 -0
  10. package/_next/static/chunks/{2w44atvyp9o_w.js → 096zaxs1gf_3q.js} +2 -1
  11. package/_next/static/chunks/0b3cus8izqkmg.js +119 -0
  12. package/_next/static/chunks/0j11dppxb9l0b.js +1 -0
  13. package/_next/static/chunks/0jucaltuccn03.js +1 -0
  14. package/_next/static/chunks/{1gt2hhqk1821k.js → 0zvzu5fnwh4_a.js} +3 -3
  15. package/_next/static/chunks/1_g85m2d7jjpo.css +3 -0
  16. package/_next/static/chunks/1arvue9o-atui.js +739 -0
  17. package/_next/static/chunks/1bo0ke8gjc1c2.js +1 -0
  18. package/_next/static/chunks/1cp1kkarm5gxz.js +1 -0
  19. package/_next/static/chunks/1e-w_-usen7fy.js +3 -0
  20. package/_next/static/chunks/1hz_mzl8l35j8.js +1 -0
  21. package/_next/static/chunks/1k72cpd0x8veh.js +1 -0
  22. package/_next/static/chunks/1mtfh1vqpvit2.js +1 -0
  23. package/_next/static/chunks/1u6o5_s2b39xh.js +1 -0
  24. package/_next/static/chunks/{1exvcc71cgr4t.js → 2aivnrnff0avu.js} +1 -1
  25. package/_next/static/chunks/2fe99e03gnvg9.js +1 -0
  26. package/_next/static/chunks/{3nm7o0eq5abhg.js → 2fthh9f57zzm2.js} +1 -1
  27. package/_next/static/chunks/{0jfox92up1jvy.js → 2gr1d26f-ymoh.js} +1 -1
  28. package/_next/static/chunks/2r98jty3a4wel.js +564 -0
  29. package/_next/static/chunks/2v6ebsavxlgyw.js +1 -0
  30. package/_next/static/chunks/{1w1xks0hp_tlr.js → 33u782y6vhw-f.js} +9 -9
  31. package/_next/static/chunks/3qik_nv7zlj4e.js +1 -0
  32. package/_next/static/chunks/3qzb9nvvw-b-k.js +1 -0
  33. package/_next/static/chunks/41mro59si-xxc.js +1 -0
  34. package/_next/static/chunks/41odv061mfm6t.js +1 -0
  35. package/_not-found/__next._full.txt +2 -2
  36. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  37. package/_not-found/__next._tree.txt +2 -2
  38. package/_not-found.html +1 -1
  39. package/_not-found.txt +2 -2
  40. package/docs/index.json +10 -5
  41. package/docs/signalk-server.html +3751 -0
  42. package/docs/signalk-specification.html +8507 -0
  43. package/guide/anchor.jpg +0 -0
  44. package/guide/bathymetry.jpg +0 -0
  45. package/guide/dashboard.jpg +0 -0
  46. package/guide/hero.jpg +0 -0
  47. package/guide/logbook.jpg +0 -0
  48. package/guide/mob.jpg +0 -0
  49. package/guide/parking.jpg +0 -0
  50. package/guide/polars.jpg +0 -0
  51. package/guide/traffic.jpg +0 -0
  52. package/guide/weather.jpg +0 -0
  53. package/index.html +1 -1
  54. package/index.txt +3 -3
  55. package/package.json +1 -1
  56. package/settings/__next._full.txt +3 -3
  57. package/settings/__next._tree.txt +2 -2
  58. package/settings/__next.settings.__PAGE__.txt +3 -3
  59. package/settings.html +1 -1
  60. package/settings.txt +3 -3
  61. package/_next/static/chunks/0iqdztntvxh3c.js +0 -119
  62. package/_next/static/chunks/0iztd835j5p1n.js +0 -700
  63. package/_next/static/chunks/0voiofm58khqd.js +0 -1
  64. package/_next/static/chunks/0w_skktmh3e48.js +0 -1
  65. package/_next/static/chunks/0zwc9m4qgtwle.js +0 -1
  66. package/_next/static/chunks/144mjqdrx42lq.js +0 -1
  67. package/_next/static/chunks/1ed7ayfg19cjb.js +0 -1
  68. package/_next/static/chunks/1epya-yh2wvj2.js +0 -1
  69. package/_next/static/chunks/1gq4t2dyr7rq3.js +0 -1
  70. package/_next/static/chunks/1ptj3mv8b_tzs.js +0 -1
  71. package/_next/static/chunks/1y35unwvy8p98.js +0 -1
  72. package/_next/static/chunks/1zm03hw2ylxw8.js +0 -1
  73. package/_next/static/chunks/2aq8orcir5h03.js +0 -1
  74. package/_next/static/chunks/2kmptoy43h0mx.js +0 -1
  75. package/_next/static/chunks/2kwn4iymxaom3.js +0 -1
  76. package/_next/static/chunks/2rebcvig176xk.js +0 -564
  77. package/_next/static/chunks/2ryo_bbmt6t74.css +0 -3
  78. package/_next/static/chunks/3--qzv1u6c7_7.js +0 -1
  79. package/_next/static/chunks/37t6vg8fb1-z8.js +0 -1
  80. package/_next/static/chunks/3p9ziqn6r35qf.js +0 -1
  81. package/_next/static/chunks/3q8o52_juxmdp.js +0 -1
  82. package/docs/opencpn.pdf +0 -0
  83. package/docs/signalk.pdf +0 -0
  84. /package/_next/static/{_UKzzvfzAh-9NIsngWWio → EuchA2ImhjrwCnR5WjCLX}/_buildManifest.js +0 -0
  85. /package/_next/static/{_UKzzvfzAh-9NIsngWWio → EuchA2ImhjrwCnR5WjCLX}/_clientMiddlewareManifest.js +0 -0
  86. /package/_next/static/{_UKzzvfzAh-9NIsngWWio → EuchA2ImhjrwCnR5WjCLX}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67561,t=>{"use strict";t.s(["OcearoContextProvider",()=>y,"useOcearoContext",()=>g]);var e=t.i(43476),r=t.i(71645),i=t.i(83402),n=t.i(30206),s=t.i(66799),o=t.i(48390),a=t.i(90072),h=t.i(78037),l=t.i(18638),u=t.i(14421),c=t.i(95430);t.i(11426);let p=(0,r.createContext)(),d={autopilot:!0,anchorWatch:!1,parkingMode:!1,mob:!1,oceanMode:"black",ais:!1,showPolar:!0,showLaylines3D:!1,racing:!1},f=["oceanMode","ais","showPolar","showLaylines3D"],m=["black","water","chart","depth","meteo"],y=({children:t})=>{let[y,g]=(0,r.useState)(()=>(0,l.normalizeThemeMode)(i.default.get("theme"))),[b,v]=(0,r.useState)("dark"),x="auto"===y?b:y,w="night"===x,[S,M]=(0,r.useState)(()=>{let t;return{...d,...!(t=i.default.get("uiStates"))||"object"!=typeof t?{}:f.reduce((e,r)=>(r in t&&(e[r]=t[r]),e),{})}});(0,r.useEffect)(()=>{i.default.set("uiStates",f.reduce((t,e)=>(t[e]=S[e],t),{}))},f.map(t=>S[t]));let _=(0,r.useCallback)(t=>{let e=(0,l.normalizeThemeMode)(t);i.default.set("theme",e),g(e)},[]);(0,r.useEffect)(()=>{"u">typeof document&&(0,l.applyThemeTokens)(l.THEMES[x])},[x]);let A=(0,r.useRef)({}),T=(0,r.useRef)({}),C=(0,r.useCallback)((t,e)=>{A.current[t]||(A.current[t]=new Set),A.current[t].add(e)},[]),E=(0,r.useCallback)((t,e)=>{A.current[t]&&(A.current[t].delete(e),0===A.current[t].size&&delete A.current[t])},[]),R=(0,r.useRef)(new Map),O=(0,r.useCallback)((t,e)=>{R.current.set(e,t)},[]),I=(0,r.useCallback)(t=>{R.current.delete(t)},[]),k=(0,r.useCallback)(t=>{let e={};for(let[r,i]of Object.entries(T.current))r.startsWith(t)&&(e[r]=i);return e},[]),P=(0,r.useCallback)((t,e)=>{A.current[t]&&A.current[t].forEach(t=>t(e)),R.current.size>0&&R.current.forEach((r,i)=>{t.startsWith(r)&&i(t,e)})},[]),B=(0,r.useCallback)(t=>{let e=T.current,r=!1;for(let[i,n]of Object.entries(t)){let t=e[i];t!==n&&("object"!=typeof t||"object"!=typeof n||null===t||null===n||JSON.stringify(t)!==JSON.stringify(n))&&(e[i]=n,r=!0,P(i,n))}r&&(T.current=e)},[P]),L=(0,r.useCallback)(t=>Object.prototype.hasOwnProperty.call(T.current,t)?T.current[t]:null,[]),z=(0,r.useCallback)(()=>{let t=T.current,e=i.default.get("preferredHeadingPath")||"courseOverGroundTrue",r=t[`navigation.${e}`];if(null!=r)return r;let n=t["navigation.headingTrue"]||t["navigation.headingMagnetic"];return t["navigation.courseOverGroundTrue"]||t["navigation.courseOverGroundMagnetic"]||n||0},[]),N=(0,r.useCallback)((t,e)=>{if(!t?.lat||!t?.lon||!e?.lat||!e?.lon)return console.warn("Invalid input to convertLatLonToXY",t,e),{x:0,y:0};let r=e.lat*Math.PI/180,i=e.lon*Math.PI/180,n=t.lat*Math.PI/180,s=t.lon*Math.PI/180-i,o=n-r,a=Math.atan2(Math.sin(s)*Math.cos(n),Math.cos(r)*Math.sin(n)-Math.sin(r)*Math.cos(n)*Math.cos(s)),h=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),l=2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))*6371e3;return{x:l*Math.sin(a),y:l*Math.cos(a)}},[]),F=(0,r.useCallback)(()=>{M(t=>{let e=(m.indexOf(t.oceanMode)+1)%m.length;return{...t,oceanMode:m[e]}})},[]),U=(0,r.useCallback)(async(t,e)=>{let r=void 0!==e?e:!S[t];if(M(e=>({...e,[t]:r})),"anchorWatch"===t)try{if(r)(0,o.isOcearoCoreEnabled)()&&await (0,o.updateOcearoCoreMode)("anchored");else{let t=T.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];(0,o.isOcearoCoreEnabled)()&&await (0,o.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for anchorWatch update"):console.warn("Failed to update OcearoCore mode for anchorWatch:",(0,o.handleOcearoCoreError)(t))}if("parkingMode"===t)try{if(r)(0,o.isOcearoCoreEnabled)()&&await (0,o.updateOcearoCoreMode)("moored");else if((0,o.isOcearoCoreEnabled)()){let t=T.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];await (0,o.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for parkingMode update"):console.warn("Failed to update OcearoCore mode for parkingMode:",(0,o.handleOcearoCoreError)(t))}if("racing"===t)try{r?(0,o.isOcearoCoreEnabled)()&&await (0,o.updateOcearoCoreMode)("racing"):(0,o.isOcearoCoreEnabled)()&&await (0,o.updateOcearoCoreMode)("sailing")}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for racing update"):console.error("Failed to update OcearoCore mode for racing:",(0,o.handleOcearoCoreError)(t))}},[S]),j=(0,r.useCallback)(async t=>{let e=["autopilot","anchorWatch","parkingMode"];if(!e.includes(t))return U(t);if(S[t]){if("autopilot"!==t)return M(t=>({...t,autopilot:!0})),U(t,!1)}else{M(r=>{let i={...r};return e.forEach(e=>{i[e]=e===t}),i});try{if((0,o.isOcearoCoreEnabled)()){if("anchorWatch"===t)await (0,o.updateOcearoCoreMode)("anchored");else if("parkingMode"===t)await (0,o.updateOcearoCoreMode)("moored");else if("autopilot"===t){let t=T.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];await (0,o.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}}catch(e){"NetworkError"===e.name?console.warn(`OcearoCore unreachable for exclusive mode update: ${t}`):console.warn(`Failed to update OcearoCore mode for ${t}:`,(0,o.handleOcearoCoreError)(e))}}},[S,U]),D=(0,r.useRef)(null),V=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=!0;return(async()=>{let{debugMode:e}=i.default.getAll(),r=i.default.getSignalKUrl(),o=()=>{V.current&&clearInterval(V.current);let t=0,e=0,r=1,s={"steering.rudderAngle":a.MathUtils.degToRad(e),...h.SAMPLE_DATA.temperature,...h.SAMPLE_DATA.environment,...h.SAMPLE_DATA.performance,...h.SAMPLE_DATA.navigation,...h.SAMPLE_DATA.racing,...h.SAMPLE_DATA.electrical,...h.SAMPLE_DATA.propulsion,...h.SAMPLE_DATA.tanks};i.default.get("debugWindOverride")||Object.assign(s,h.SAMPLE_DATA.wind),B(s),V.current=setInterval(()=>{if((0,n.isReplaying)())return;((e+=2*r)>=15||e<=-15)&&(r*=-1);let s={"steering.rudderAngle":a.MathUtils.degToRad(e)};i.default.get("debugWindOverride")||(t=(t+5)%360,s["environment.wind.angleTrueWater"]=a.MathUtils.degToRad(t),s["environment.wind.angleApparent"]=a.MathUtils.degToRad(t)),B(s)},h.SAMPLE_DATA_INTERVAL)};if(!r||0===r.trim().length){e&&o();return}try{let r=s.default.createClient({deltaStreamBehaviour:"self",sendMeta:"all"});D.current=r,await r.connect();let a=["environment.wind.speedTrue","environment.wind.speedApparent","environment.wind.angleTrueWater","environment.wind.angleApparent","environment.wind.directionTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround"];r.on("delta",e=>{t&&e.updates.forEach(t=>{t.values&&t.values.forEach(t=>{i.default.get("debugWindOverride")&&a.includes(t.path)||(0,n.isReplaying)()||B({[t.path]:t.value})})})}),e&&o()}catch(i){let t;if(i instanceof Error)t=i.message;else if(i&&"object"==typeof i&&"isTrusted"in i)t="Network error (Event). Check SignalK URL, server availability, and CORS settings.";else try{t=JSON.stringify(i)}catch(e){t=String(i)}console.warn(`Failed to connect to SignalK (${r}): ${t}`),e&&o()}})(),()=>{t=!1,D.current&&D.current.disconnect(),V.current&&clearInterval(V.current)}},[]),(0,r.useEffect)(()=>{if("auto"!==y)return;let t=()=>{let t=T.current["navigation.position"],e=(0,u.sunPosition)(t?.latitude,t?.longitude,(0,c.vesselNow)());v(t=>(0,l.themeForSunElevation)(e?.elevation,t))},e=setTimeout(t,1500),r=setInterval(t,6e4);return()=>{clearTimeout(e),clearInterval(r)}},[y]);let W=(0,r.useMemo)(()=>({getSignalKValue:L,subscribe:C,unsubscribe:E,subscribePrefix:O,unsubscribePrefix:I,getSignalKValuesByPrefix:k,updateSignalKData:B,getBoatRotationAngle:z,convertLatLonToXY:N,theme:x,themeMode:y,setTheme:_,tokens:l.THEMES[x],nightMode:w,states:S,toggleState:U,toggleExclusiveMode:j,cycleOceanMode:F}),[L,C,E,O,I,k,B,z,N,x,y,_,w,S,U,j,F]);return(0,e.jsx)(p.Provider,{value:W,children:t})},g=()=>(0,r.useContext)(p)},78037,18638,14421,t=>{"use strict";var e=t.i(90072),r=t.i(46991);let i={wind:{"environment.wind.angleTrueWater":e.MathUtils.degToRad(0),"environment.wind.speedTrue":10.288,"environment.wind.angleApparent":e.MathUtils.degToRad(0),"environment.wind.speedApparent":10.288},temperature:{"environment.water.temperature":(0,r.toKelvin)(17),"environment.outside.temperature":(0,r.toKelvin)(21),"propulsion.main.exhaustTemperature":(0,r.toKelvin)(95),"environment.inside.fridge.temperature":(0,r.toKelvin)(4)},environment:{"environment.outside.pressure":102300,"environment.inside.relativeHumidity":.74,"environment.inside.voc":.03,"environment.inside.co2":640,"environment.inside.pm25":8,"environment.inside.dewPoint":288.4,"environment.outside.relativeHumidity":.68,"environment.outside.uvIndex":4.2,"environment.outside.visibility":14800},performance:{"performance.beatAngle":e.MathUtils.degToRad(45),"performance.gybeAngle":e.MathUtils.degToRad(135),"performance.beatAngleVelocityMadeGood":6,"performance.gybeAngleVelocityMadeGood":5,"performance.targetAngle":e.MathUtils.degToRad(45),"performance.polarSpeed":8,"performance.polarSpeedRatio":.95,"performance.velocityMadeGood":5,"performance.polarVelocityMadeGood":6,"performance.polarVelocityMadeGoodRatio":.9},navigation:{"navigation.speedThroughWater":7,"navigation.headingTrue":e.MathUtils.degToRad(0),"navigation.courseOverGround":e.MathUtils.degToRad(20),"navigation.courseGreatCircle.nextPoint.bearingTrue":e.MathUtils.degToRad(30),"navigation.courseGreatCircle.nextPoint.distance":1500,"navigation.attitude":{roll:e.MathUtils.degToRad(5),pitch:e.MathUtils.degToRad(2),yaw:e.MathUtils.degToRad(2)}},racing:{"navigation.racing.layline":e.MathUtils.degToRad(10),"navigation.racing.layline.distance":100,"navigation.racing.layline.time":180,"navigation.racing.oppositeLayline":e.MathUtils.degToRad(45),"navigation.racing.oppositeLayline.distance":80,"navigation.racing.oppositeLayline.time":180,"navigation.racing.startLineStb":{latitude:0,longitude:0,altitude:0},"navigation.racing.startLinePort":{latitude:0,longitude:0,altitude:0},"navigation.racing.distanceStartline":50,"navigation.racing.timeToStart":120,"navigation.racing.timePortDown":60,"navigation.racing.timePortUp":70,"navigation.racing.timeStbdDown":65,"navigation.racing.timeStbdUp":75},electrical:{"electrical.batteries.1.name":"House Battery","electrical.batteries.1.location":"Under Starboard Bed","electrical.batteries.1.capacity.nominal":768,"electrical.batteries.1.capacity.actual":707,"electrical.batteries.1.capacity.remaining":601,"electrical.batteries.1.capacity.dischargeLimit":.2,"electrical.batteries.1.capacity.timeRemaining":9860,"electrical.batteries.1.lifetimeDischarge":54e4,"electrical.batteries.1.lifetimeRecharge":545e3,"electrical.batteries.1.voltage.ripple":.05,"electrical.batteries.1.chemistry":"LeadAcid","electrical.batteries.1.manufacturer.name":"VARTA","electrical.batteries.1.manufacturer.model":"Professional Dual Purpose RA 595 985","electrical.batteries.1.manufacturer.URL":"https://www.varta-automotive.com","electrical.batteries.1.dateInstalled":"2020-06-15T00:00:00Z","electrical.batteries.1.associatedBus":"House Bus","electrical.batteries.1.voltage":12.6,"electrical.batteries.1.current":-2.3,"electrical.batteries.0.name":"Engine Start Battery","electrical.batteries.0.location":"Engine Compartment","electrical.batteries.0.capacity.nominal":888,"electrical.batteries.0.capacity.actual":861,"electrical.batteries.0.chemistry":"LeadAcid","electrical.batteries.0.manufacturer.name":"VARTA","electrical.batteries.0.manufacturer.model":"Blue Dynamic E11","electrical.batteries.0.manufacturer.URL":"https://www.varta-automotive.com","electrical.batteries.0.dateInstalled":"2022-04-10T00:00:00Z","electrical.batteries.0.associatedBus":"Start Bus","electrical.batteries.0.voltage":12.4,"electrical.batteries.0.current":.1,"electrical.alternators.0.voltage":14.2,"electrical.alternators.0.current":35.5,"navigation.lights":!1,"steering.autopilot.state":"auto"},propulsion:{"propulsion.0.revolutions":25,"propulsion.0.runTime":125e3,"propulsion.0.coolantTemperature":353.15,"propulsion.0.coolantPressure":18e4,"propulsion.0.oilPressure":35e4,"propulsion.0.oilTemperature":363.15,"propulsion.0.exhaustTemperature":623.15,"propulsion.0.intakeManifoldTemperature":313.15,"propulsion.0.boostPressure":15e4,"propulsion.0.load":.45,"propulsion.0.torque":.52,"propulsion.0.state":"started","propulsion.0.fuel.rate":2778e-9,"propulsion.0.fuel.pressure":28e4,"propulsion.0.fuel.economyRate":.45,"propulsion.0.transmission.gear":1,"propulsion.0.transmission.oilPressure":32e4,"propulsion.0.transmission.oilTemperature":343.15,"propulsion.0.tilt":0,"propulsion.1.revolutions":26,"propulsion.1.runTime":128e3,"propulsion.1.coolantTemperature":355.15,"propulsion.1.coolantPressure":185e3,"propulsion.1.oilPressure":36e4,"propulsion.1.oilTemperature":365.15,"propulsion.1.exhaustTemperature":633.15,"propulsion.1.intakeManifoldTemperature":315.15,"propulsion.1.boostPressure":155e3,"propulsion.1.load":.48,"propulsion.1.torque":.54,"propulsion.1.state":"started","propulsion.1.fuel.rate":2917e-9,"propulsion.1.fuel.pressure":285e3,"propulsion.1.transmission.gear":1,"propulsion.1.transmission.oilPressure":325e3,"propulsion.1.transmission.oilTemperature":345.15,"propulsion.1.tilt":0},tanks:{"tanks.fuel.0.currentLevel":.75,"tanks.fuel.0.capacity":.2,"tanks.fuel.0.currentVolume":150,"tanks.fuel.0.type":"fuel","tanks.freshWater.0.currentLevel":.45,"tanks.freshWater.0.capacity":.2,"tanks.freshWater.0.type":"freshWater","tanks.wasteWater.0.currentLevel":.25,"tanks.wasteWater.0.capacity":.2,"tanks.wasteWater.0.type":"wasteWater","tanks.blackWater.0.currentLevel":.25,"tanks.blackWater.0.capacity":.2,"tanks.blackWater.0.type":"blackWater","tanks.oil.0.currentLevel":.9,"tanks.oil.0.capacity":.005,"tanks.oil.0.type":"oil"}};t.s(["SAMPLE_DATA",0,i,"SAMPLE_DATA_INTERVAL",0,5e3],78037);let n=["auto","day","dark","night"],s="#ff7a63";t.s(["THEMES",0,{day:{id:"day",appBg:"#f2f3f5",leftPaneBg:"#e9ebee",rightPaneBg:"#f6f7f9",surface:"rgba(255, 255, 255, 0.72)",surfaceElevated:"rgba(0, 0, 0, 0.045)",card:"rgba(255, 255, 255, 0.9)",border:"rgba(0, 0, 0, 0.08)",textMain:"#111418",textSecondary:"rgba(17, 20, 24, 0.62)",textMuted:"rgba(17, 20, 24, 0.45)",textDim:"rgba(17, 20, 24, 0.28)",accent:"#0a7fc2",ok:"#0e9f47",warn:"#c98a00",danger:"#d0021b",neutral:"#7d8288",neutralStrong:"#c5c9ce",shadowSoft:"0 1px 4px rgba(0, 0, 0, 0.08)",shadowSubtle:"0 1px 3px rgba(0, 0, 0, 0.05)",instrument:{sky:"#9fd3f2",sea:"#b9bcc0",bezel:"#c5c9ce"},scene:{background:"#f7f8f9",ground:"#f2f3f5",grid:"#dcdfe3",sea:"#134868",seaScatter:"#2b97a3",seaFoam:"#f3f7f9",skyZenith:"#4f86b8",skyHorizon:"#dbe6ed",markerDim:"#b5bac0",water:"#9fb4c2",ownHull:"#ffffff",ownDeck:"#8f99a4",sail:"#f7f8fa",rigging:"#5a6068",compass:"#2b3036",compassDim:"#8a9097",compassFace:"#dfe2e6",vessel:"#9aa0a6",vesselDanger:"#d2504f",vesselYields:"#8f86c9",vesselClose:"#d9a066",route:"#1688d8",routeGlow:"#5fb8ff",laylinePort:"#e0262f",laylineStarboard:"#0e9f47",wakeGood:"#0e9f47",wakeFair:"#e3a400",wakeBad:"#e0262f",wakeFoam:"#ffffff",ghost:"#5f6b78",giveWay:"#e8954f",target:"#c98a00",wind:"#2b3036",current:"#0e9f47",light:"#ffffff",rimLight:"#ffffff",ambient:1.3,keyLight:2.4,fillLight:1}},dark:{id:"dark",appBg:"#101216",leftPaneBg:"#121418",rightPaneBg:"#171a1f",surface:"rgba(255, 255, 255, 0.03)",surfaceElevated:"rgba(255, 255, 255, 0.07)",card:"rgba(255, 255, 255, 0.045)",border:"rgba(255, 255, 255, 0.09)",textMain:"#f2f4f7",textSecondary:"rgba(235, 240, 245, 0.68)",textMuted:"rgba(235, 240, 245, 0.52)",textDim:"rgba(235, 240, 245, 0.36)",accent:"#3ec6ff",ok:"#2fd27a",warn:"#ffc53d",danger:"#ff4d4f",neutral:"#9aa3ad",neutralStrong:"#4a525c",shadowSoft:"0 4px 20px rgba(0, 0, 0, 0.35)",shadowSubtle:"0 2px 10px rgba(0, 0, 0, 0.25)",instrument:{sky:"#5b8fb8",sea:"#3a4048",bezel:"#4a525c"},scene:{background:"#16191e",ground:"#20252c",grid:"#353d47",sea:"#0b1e2b",seaScatter:"#16485a",seaFoam:"#3e4a55",skyZenith:"#0b1016",skyHorizon:"#222c37",markerDim:"#4a525c",water:"#0d3550",ownHull:"#f4f6f8",ownDeck:"#c9cfd6",sail:"#eef1f4",rigging:"#aeb6bf",compass:"#e8ecf0",compassDim:"#7d8690",compassFace:"#16191e",vessel:"#b9c0c8",vesselDanger:"#ff4d4f",vesselYields:"#a99cf0",vesselClose:"#f0b46e",route:"#3ec6ff",routeGlow:"#8fe0ff",laylinePort:"#ff5a5a",laylineStarboard:"#2fd27a",wakeGood:"#2fd27a",wakeFair:"#ffc53d",wakeBad:"#ff4d4f",wakeFoam:"#8fd4ff",ghost:"#a9bccf",giveWay:"#f0a060",target:"#ffc53d",wind:"#ffffff",current:"#2fd27a",light:"#ffffff",rimLight:"#dfe9f5",ambient:1,keyLight:2,fillLight:.9}},night:{id:"night",appBg:"#0f0706",leftPaneBg:"#110807",rightPaneBg:"#160a08",surface:"rgba(255, 110, 90, 0.04)",surfaceElevated:"rgba(255, 110, 90, 0.1)",card:"rgba(255, 110, 90, 0.06)",border:"rgba(255, 110, 90, 0.18)",textMain:s,textSecondary:"rgba(255, 122, 99, 0.78)",textMuted:"rgba(255, 122, 99, 0.6)",textDim:"rgba(255, 122, 99, 0.42)",accent:"#ff8a6b",onAccent:"#1a0806",ok:"#ff9478",warn:"#ffad80",danger:"#ff3b2f",neutral:"#a8473a",neutralStrong:"#4a1a14",shadowSoft:"none",shadowSubtle:"none",instrument:{sky:"#3a1510",sea:"#1a0907",bezel:"#4a1a14"},scene:{background:"#120807",ground:"#1c0e0b",grid:"#43201a",sea:"#1a0907",seaScatter:"#3a130e",seaFoam:"#4f2018",skyZenith:"#0c0504",skyHorizon:"#26110d",markerDim:"#5a261e",water:"#1a0907",ownHull:"#d9705d",ownDeck:"#9c4436",sail:"#c8604e",rigging:"#8a3a2e",compass:"#ff8a72",compassDim:"#93412f",compassFace:"#120807",vessel:"#b35a4a",vesselDanger:"#ff3b2f",vesselYields:"#e0607a",vesselClose:"#ff9a5a",route:s,routeGlow:"#ffab95",laylinePort:"#e04a3a",laylineStarboard:"#ffab95",wakeGood:"#ffab95",wakeFair:"#e0604a",wakeBad:"#8a2a1e",wakeFoam:"#93412f",ghost:"#93412f",giveWay:"#ff7a3a",target:"#ffad80",wind:"#ffb3a3",current:s,light:"#ffb3a3",rimLight:"#ff8a72",ambient:.75,keyLight:1.4,fillLight:.6}}},"THEME_MODES",0,n,"applyThemeTokens",0,(t,e=document.documentElement)=>{for(let[r,i]of Object.entries({"--background":t.appBg,"--foreground":t.textMain,"--color-leftPaneBg":t.leftPaneBg,"--color-rightPaneBg":t.rightPaneBg,"--hud-bg":t.surface,"--hud-bg-elevated":t.surfaceElevated,"--hud-card-bg":t.card,"--hud-border":t.border,"--hud-text-main":t.textMain,"--hud-text-secondary":t.textSecondary,"--hud-text-muted":t.textMuted,"--hud-text-dim":t.textDim,"--color-oBlue":t.accent,"--color-oGreen":t.ok,"--color-oYellow":t.warn,"--color-oRed":t.danger,"--color-oGray":t.neutral,"--color-oGray2":t.neutralStrong,"--color-oNight":t.textMain,"--color-onAccent":t.onAccent||"#ffffff","--shadow-soft":t.shadowSoft,"--shadow-subtle":t.shadowSubtle}))e.style.setProperty(r,i);e.setAttribute("data-theme",t.id),e.style.colorScheme="day"===t.id?"light":"dark"},"normalizeThemeMode",0,t=>"light"===t?"day":n.includes(t)?t:"dark","themeForSunElevation",0,(t,e)=>{if(!Number.isFinite(t))return e||"dark";let r=t=>e===t?1:-1;return t>6-r("day")?"day":t<-6+r("night")?"night":"dark"},"tintForTheme",0,(t,e)=>{if("night"!==t.id)return e;let r=.2126*e.r+.7152*e.g+.0722*e.b;return e.setRGB(Math.min(1,.25+r),.04*r,.04*r)}],18638);let o=t=>Math.PI/180*t,a=t=>180/Math.PI*t,h=(t,e)=>{let r=t%e;return r<0?r+e:r},l=(t,e,r,i)=>{let n,s=(n=Date.UTC(r.getUTCFullYear(),0,1),Math.floor((Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())-n)/864e5)+1),l=e/15,u=s+((i?6:18)-l)/24,c=.9856*u-3.289,p=h(c+1.916*Math.sin(o(c))+.02*Math.sin(2*o(c))+282.634,360),d=h(a(Math.atan(.91764*Math.tan(o(p)))),360);d+=90*Math.floor(p/90)-90*Math.floor(d/90),d/=15;let f=.39782*Math.sin(o(p)),m=Math.cos(Math.asin(f)),y=(Math.cos(o(90.833))-f*Math.sin(o(t)))/(m*Math.cos(o(t)));return y>1||y<-1?null:h((i?360-a(Math.acos(y)):a(Math.acos(y)))/15+d-.06571*u-6.622-l,24)},u=(t,e,r)=>{if(null===r)return null;let i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n=i+(12-e/15)*36e5,s=i+36e5*r;for(;s-n>432e5;)s-=864e5;for(;n-s>432e5;)s+=864e5;return new Date(s)};t.s(["computeSunEvents",0,(t,e,r)=>{if(!Number.isFinite(t)||!Number.isFinite(e)||!(r instanceof Date))return null;let i=new Date(r.getTime()+e/15*36e5);return{sunrise:u(i,e,l(t,e,i,!0)),sunset:u(i,e,l(t,e,i,!1))}},"formatClockTime",0,t=>t?t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}):null,"parseSunTime",0,(t,e)=>{if(!t)return null;if("string"==typeof t&&/^\d{1,2}:\d{2}$/.test(t)){let[r,i]=t.split(":").map(Number),n=new Date(e);return n.setHours(r,i,0,0),n}let r=new Date(t);return Number.isNaN(r.getTime())?null:r},"sunPosition",0,(t,e,r)=>{if(!Number.isFinite(t)||!Number.isFinite(e)||!(r instanceof Date))return null;let i=Date.UTC(r.getUTCFullYear(),0,1),n=(r.getTime()-i)/864e5+1,s=r.getUTCHours()+r.getUTCMinutes()/60+r.getUTCSeconds()/3600,l=2*Math.PI/365*(n-1+(s-12)/24),u=229.18*(75e-6+.001868*Math.cos(l)-.032077*Math.sin(l)-.014615*Math.cos(2*l)-.040849*Math.sin(2*l)),c=.006918-.399912*Math.cos(l)+.070257*Math.sin(l)-.006758*Math.cos(2*l)+907e-6*Math.sin(2*l)-.002697*Math.cos(3*l)+.00148*Math.sin(3*l),p=o(h(60*s+u+4*e,1440)/4-180),d=o(t),f=Math.acos(Math.min(Math.max(Math.sin(d)*Math.sin(c)+Math.cos(d)*Math.cos(c)*Math.cos(p),-1),1)),m=h(a(Math.atan2(Math.sin(p),Math.cos(p)*Math.sin(d)-Math.tan(c)*Math.cos(d)))+180,360);return{elevation:90-a(f),azimuth:m}}],14421)},11426,t=>{"use strict";t.s(["TideContextProvider",()=>u,"useTide",()=>c]);var e=t.i(43476),r=t.i(71645),i=t.i(66799),n=t.i(67561),s=t.i(85709),o=t.i(95430);let a=(0,r.createContext)(),h=["environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.tide.timeLow","environment.tide.timeHigh","environment.tide.coeffNow"],l=async t=>{try{let e,r,i=(0,o.vesselNow)(),n=i.getFullYear(),s=(i.getMonth()+1).toString().padStart(2,"0"),a=`./tides/larochelle/${s}_${n}.json`,h=await fetch(a);if(!h.ok)return void console.warn("TideContext: No local tide data found");let l=await h.json(),u=i.toISOString().split("T")[0];if(!l[u])return;let c=(0,o.vesselNow)(),p=60*c.getHours()+c.getMinutes(),d=null,f=null;for(let t of l[u].map(([t,e,r,i])=>{let[n,s]=e.split(":").map(Number);return{type:t,height:parseFloat(r),time:e,timeInMinutes:60*n+s,coef:i}}).sort((t,e)=>t.timeInMinutes-e.timeInMinutes))if(t.timeInMinutes<=p)d=t;else{f=t;break}if(!d||!f)return void console.warn("TideContext: Cannot determine tide trend from local data");if("tide.low"===d.type&&"tide.high"===f.type?(e="tide.high"===f.type?f:null,r="tide.low"===d.type?d:null):(e="tide.high"===d.type?d:null,r="tide.low"===f.type?f:null),e&&r){let i=`${c.getHours().toString().padStart(2,"0")}:${c.getMinutes().toString().padStart(2,"0")}`,n=((t,e,r,i,n)=>{let s,o,a,h;if(!r||!i||!n||!/^\d{1,2}:\d{2}$/.test(r)||!/^\d{1,2}:\d{2}$/.test(i)||!/^\d{1,2}:\d{2}$/.test(n))return console.error("Invalid time format provided to calculateTideHeightUsingTwelfths"),(t+e)/2;let l=t=>{let[e,r]=t.split(":").map(Number);return 60*e+r},u=l(i),c=l(n),p=l(r),d=!1;c<=p&&p<=u?(d=!0,s=e,o=t,a=c,h=u):(s=t,o=e,a=u,h=c+1440*(c<u));let f=Math.abs(h-a),m=Math.abs(o-s),y=p-a;y<0&&(y+=1440);let g=m/12,b=0;return b=y<=f/6?g*Math.ceil(y/(f/12)):y<=2*f/6?2*g+g*Math.ceil((y-f/6)/(f/12)):y<=3*f/6?5*g:y<=4*f/6?8*g:y<=5*f/6?10*g:m,d?s+b:s-b})(e.height,r.height,i,e.time,r.time);t({"environment.tide.heightNow":n,"environment.tide.heightHigh":e.height,"environment.tide.heightLow":r.height,"environment.tide.timeLow":r.time,"environment.tide.timeHigh":e.time,"environment.tide.coeffNow":e.coef})}else console.warn("TideContext: Tide data for today is incomplete")}catch(t){console.warn("TideContext: Failed to fetch local tide data:",t.message)}},u=({children:t})=>{let{updateSignalKData:u}=(0,n.useOcearoContext)(),{offsetMs:c}=(0,o.useVesselClock)(),p=(0,s.useSignalKPaths)(h),[d,f]=(0,r.useState)(null),[m,y]=(0,r.useState)(!1),[g,b]=(0,r.useState)(null),[v,x]=(0,r.useState)(null),[w,S]=(0,r.useState)(null),M=(0,r.useRef)(null),_=(0,r.useRef)(null),A=(0,r.useRef)(u);A.current=u;let T=(0,r.useCallback)(async()=>{y(!0),b(null);try{let t=await i.default.checkTideApiAvailability();if(f(t),t){S("signalk");let t=await i.default.getTideData();if(t){let e={};t.heightNow?.value!==void 0&&(e["environment.tide.heightNow"]=t.heightNow.value),t.heightHigh?.value!==void 0&&(e["environment.tide.heightHigh"]=t.heightHigh.value),t.heightLow?.value!==void 0&&(e["environment.tide.heightLow"]=t.heightLow.value),t.timeLow?.value!==void 0&&(e["environment.tide.timeLow"]=t.timeLow.value),t.timeHigh?.value!==void 0&&(e["environment.tide.timeHigh"]=t.timeHigh.value),t.coeffNow?.value!==void 0&&(e["environment.tide.coeffNow"]=t.coeffNow.value),Object.keys(e).length>0&&A.current(e)}x(new Date)}else S("local"),await l(A.current),x(new Date)}catch(t){console.warn("TideContext: Failed to fetch tide data:",t.message),b(t.message);try{S("local"),await l(A.current),x(new Date)}catch(t){console.warn("TideContext: Local fallback also failed:",t.message)}}finally{y(!1)}},[]),C=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let t=0!==c;t&&!C.current?(C.current=!0,T()):t||(C.current=!1)},[c,T]),(0,r.useEffect)(()=>(_.current=setTimeout(()=>{T()},3e3),M.current=setInterval(()=>{T()},6e5),()=>{_.current&&clearTimeout(_.current),M.current&&clearInterval(M.current)}),[T]);let E=(0,r.useMemo)(()=>({level:p["environment.tide.heightNow"],high:p["environment.tide.heightHigh"],low:p["environment.tide.heightLow"],timeLow:p["environment.tide.timeLow"],timeHigh:p["environment.tide.timeHigh"],coefficient:p["environment.tide.coeffNow"]}),[p]),R=(0,r.useMemo)(()=>({tideData:E,tideApiAvailable:d,source:w,isLoading:m,error:g,lastFetchTime:v,fetchTideData:T}),[E,d,w,m,g,v,T]);return(0,e.jsx)(a.Provider,{value:R,children:t})},c=()=>{let t=(0,r.useContext)(a);if(!t)throw Error("useTide must be used within a TideContextProvider");return t}},85709,t=>{"use strict";t.s(["useSignalKPath",()=>i,"useSignalKPaths",()=>n,"useSignalKPrefix",()=>s]);var e=t.i(71645),r=t.i(67561);let i=(t,i=null)=>{let{getSignalKValue:n,subscribe:s,unsubscribe:o}=(0,r.useOcearoContext)(),[a,h]=(0,e.useState)(()=>n(t)??i),l=(0,e.useRef)(i),u=(0,e.useRef)(a);l.current=i;let c=(0,e.useCallback)(t=>{let e=t??l.current;u.current=e,h(e)},[]);return(0,e.useEffect)(()=>{s&&s(t,c);let e=n(t);return null!=e&&(u.current=e,h(e)),()=>{o&&o(t,c)}},[t,s,o,n,c]),a},n=t=>{let{getSignalKValue:i,subscribe:n,unsubscribe:s}=(0,r.useOcearoContext)(),o=JSON.stringify(t),a=(0,e.useRef)(t);JSON.stringify(a.current)!==o&&(a.current=t);let[h,l]=(0,e.useState)(()=>{let t={};return a.current.forEach(e=>{t[e]=i(e)}),t});return(0,e.useEffect)(()=>{let t=a.current,e={};t.forEach(t=>{e[t]=e=>{l(r=>r[t]===e?r:{...r,[t]:e})}}),n&&t.forEach(t=>n(t,e[t]));let r={},o=!1;return t.forEach(t=>{let e=i(t);null!=e&&(r[t]=e,o=!0)}),o&&l(t=>({...t,...r})),()=>{s&&t.forEach(t=>{e[t]&&s(t,e[t])})}},[o,n,s,i]),h},s=t=>{let{getSignalKValuesByPrefix:i,subscribePrefix:n,unsubscribePrefix:s}=(0,r.useOcearoContext)(),[o,a]=(0,e.useState)(()=>i(t));return(0,e.useEffect)(()=>{let e=(t,e)=>{a(r=>r[t]===e?r:{...r,[t]:e})};return n(t,e),a(i(t)),()=>s(e)},[t,n,s,i]),o}},66799,46991,48390,t=>{"use strict";var e=t.i(67034),r=t.i(49018),i=t.i(83402);let n=t=>{if(null==t||""===t)return null;let e="number"==typeof t?t:Number(t);return Number.isFinite(e)?e:null},s=t=>null===(t=n(t))?null:Math.round(180*t/Math.PI*10)/10,o=t=>null===(t=n(t))?null:Math.round(1.94384*t*10)/10,a=t=>null===(t=n(t))?null:Math.round((t-273.15)*10)/10,h=null,l=()=>(h||(h=t.r(83402).default),h);t.s(["EARTH_RADIUS_METERS",0,6371e3,"KNOTS_TO_MPS",0,.51444,"convertDepthUnit",0,t=>{if(null===(t=n(t)))return null;switch(l().get("depthUnits")||"m"){case"ft":return Math.round(3.28084*t*10)/10;case"fa":return Math.round(.546807*t*10)/10;default:return Math.round(10*t)/10}},"convertDistanceUnit",0,t=>{if(null===(t=n(t)))return null;switch(l().get("distanceUnits")||"nm"){case"km":return Math.round(t/1e3*100)/100;case"mi":return Math.round(t/1609.344*100)/100;default:return Math.round(t/1852*100)/100}},"convertPressure",0,t=>null===(t=n(t))?null:Math.round(t/100*10)/10,"convertSpeedUnit",0,t=>{if(null===(t=n(t)))return null;switch(l().get("speedUnits")||"kn"){case"km/h":return Math.round(3.6*t*10)/10;case"mph":return Math.round(2.23694*t*10)/10;case"m/s":return Math.round(10*t)/10;default:return Math.round(1.94384*t*10)/10}},"convertTemperature",0,a,"convertTemperatureUnit",0,t=>null===(t=n(t))?null:"F"===(l().get("temperatureUnits")||"C")?Math.round(((t-273.15)*9/5+32)*10)/10:Math.round((t-273.15)*10)/10,"degToRad",0,t=>null===(t=n(t))?null:Math.PI/180*t,"finite",0,n,"getDepthUnitLabel",0,()=>l().get("depthUnits")||"m","getDistanceUnitLabel",0,()=>l().get("distanceUnits")||"nm","getSpeedUnitLabel",0,()=>l().get("speedUnits")||"kn","getTemperatureUnitLabel",0,()=>"F"===(l().get("temperatureUnits")||"C")?"°F":"°C","kelvinToCelsius",0,a,"knotsToMs",0,t=>null===(t=n(t))?null:t/1.94384,"msToKnots",0,o,"radToDeg",0,t=>null===(t=n(t))?null:180/Math.PI*t,"radiansToDegrees",0,s,"toDegrees",0,t=>null===(t=n(t))?null:Math.round((180*t/Math.PI+360)%360),"toKelvin",0,t=>{let e=n(t);return null===e?null:e+273.15},"toKnots",0,t=>null===(t=n(t))?null:(1.94384*t).toFixed(1)],46991);let u=new class t{constructor(){this.client=null,this.authToken=null,this.weatherApiAvailable=null,this.featuresCache=null,this.connectionListeners=[],this.isConnected=!1}getClientConfig(){let t=i.default.getAll(),e=i.default.getSignalKUrl(),[r,n]=e.replace(/https?:\/\//,"").replace(/\/.*$/,"").split(":"),s=e.startsWith("https");return{hostname:r||"localhost",port:parseInt(n)||(s?443:80),useTLS:s,useAuthentication:t.useAuthentication||!1,username:t.username||null,password:t.password||null,reconnect:!0,autoConnect:!1,notifications:!1,deltaStreamBehaviour:"self",sendMeta:"all",wsKeepaliveInterval:10}}createClient(t={}){let e={...this.getClientConfig(),...t};return new r.default(e)}async connect(t={}){try{return this.client=this.createClient(t),await this.client.connect(),this.isConnected=!0,await this.checkWeatherApiAvailability(),this.connectionListeners.forEach(t=>t(!0,this.client)),this.client}catch(t){throw console.error("SignalKService: Failed to connect:",t),this.isConnected=!1,this.connectionListeners.forEach(e=>e(!1,null,t)),t}}disconnect(){this.client&&(this.client.disconnect(),this.client=null,this.isConnected=!1,this.connectionListeners.forEach(t=>t(!1,null)))}addConnectionListener(t){this.connectionListeners.push(t)}removeConnectionListener(t){this.connectionListeners=this.connectionListeners.filter(e=>e!==t)}getBaseUrl(){return i.default.getSignalKUrl()}isDemoSignalK(){let t=i.default.getAll(),e=i.default.getSignalKUrl()||"";return t.debugMode||e.includes("demo.signalk.org")}getAuthHeaders(){let t=i.default.getAll(),r={"Content-Type":"application/json"};if(t.useAuthentication&&t.username){let i="function"==typeof btoa?btoa(`${t.username}:${t.password||""}`):e.Buffer.from(`${t.username}:${t.password||""}`).toString("base64");r.Authorization=`Basic ${i}`}return this.authToken&&(r.Authorization=`Bearer ${this.authToken}`),r}async apiCall(t,e={}){let r=this.getBaseUrl(),n=`${r}${t}`,s=this.getAuthHeaders(),o=i.default.getAll(),a=o.useAuthentication&&o.username?"include":"omit",{timeoutMs:h=1e4,...l}=e,u=new AbortController,c=setTimeout(()=>u.abort(),h);try{let t=await fetch(n,{credentials:a,...l,headers:{...s,...l.headers},signal:u.signal}),e=await t.text(),r=null;if(e)try{r=JSON.parse(e)}catch{r=e}if(!t.ok){let e=r?.message?` — ${r.message}`:"",i=Error(`SignalK API error (${t.status}): ${t.statusText}${e}`);throw i.status=t.status,i}return r}catch(e){if("AbortError"===e.name){let e=Error(`SignalK request timed out after ${h/1e3}s`);throw e.name="NetworkError",console.warn(`SignalKService: Timeout for ${t}`),e}if("TypeError"===e.name&&("Failed to fetch"===e.message||e.message.includes("NetworkError"))){let i=Error(`SignalK server unreachable at ${r}`);throw i.name="NetworkError",console.warn(`SignalKService: Server unreachable for ${t}:`,e.message),i}throw 400===e.status||404===e.status?console.warn(`SignalKService: API call returned error for ${t}:`,e.message):console.warn(`SignalKService: API call failed for ${t}:`,e),e}finally{clearTimeout(c)}}async getHistoryValues({paths:t,duration:e,resolution:r,context:i}){let n=new URLSearchParams({paths:t.join(","),duration:e});r&&n.set("resolution",r),i&&n.set("context",i);try{let t=await this.apiCall(`/signalk/v2/api/history/values?${n}`);return Array.isArray(t?.data)?t.data:null}catch{return null}}async notificationAction(t,e){if(!t||!["silence","acknowledge"].includes(e))throw Error(`Invalid notification action: ${e}`);return this.apiCall(`/signalk/v2/api/notifications/${encodeURIComponent(t)}/${e}`,{method:"POST"})}async clearNotification(t){if(!t)throw Error("Notification id required");return this.apiCall(`/signalk/v2/api/notifications/${encodeURIComponent(t)}`,{method:"DELETE"})}async raiseMob(t){let e=await this.apiCall("/signalk/v2/api/notifications/mob",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{message:t}:{})});return e?.id}async getFeatures(){let t=this.getBaseUrl();if(this.featuresCache?.baseUrl===t)return this.featuresCache.promise;let e=this.apiCall("/signalk/v2/features?enabled=1").then(t=>({apis:Array.isArray(t?.apis)?t.apis:[],plugins:Array.isArray(t?.plugins)?t.plugins:[]})).catch(t=>404===t.status?{apis:[],plugins:[]}:(this.featuresCache?.promise===e&&(this.featuresCache=null),null));return this.featuresCache={baseUrl:t,promise:e},e}async checkWeatherApiAvailability(){try{let t=await fetch(`${this.getBaseUrl()}/signalk/v2/api/weather`,{method:"GET",headers:this.getAuthHeaders()});return this.weatherApiAvailable=t.ok,this.weatherApiAvailable}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))||console.warn("SignalKService: Weather API check failed:",t.message),this.weatherApiAvailable=!1,!1}}isWeatherApiAvailable(){return this.weatherApiAvailable}async getWeatherForecast(t,e,r=48){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");if(null==t||null==e)throw Error("Position is required for weather forecast");let i=`/signalk/v2/api/weather/forecasts/point?lat=${t}&lon=${e}&count=${r}`;return await this.apiCall(i)}async getDailyWeatherForecast(t,e,r=7){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");if(null==t||null==e)throw Error("Position is required for weather forecast");let i=`/signalk/v2/api/weather/forecasts/daily?lat=${t}&lon=${e}&count=${r}`;return await this.apiCall(i)}async getCurrentWeather(){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");return await this.apiCall("/signalk/v2/api/weather/observations")}parseWeatherForecast(t){let e=[],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return Object.values(t).forEach(t=>{let i={description:t.description||"",date:t.date||null,time:"",temperature:null,temperatureMin:null,temperatureMax:null,dewPoint:null,humidity:null,pressure:null,rain:null,uvIndex:null,clouds:null,visibility:null,wind:{speed:null,direction:null,gust:null}};if(t.date){let e=new Date(t.date);i.time=`${r[e.getDay()]} ${e.getHours()}:${("00"+e.getMinutes()).slice(-2)}`}if(void 0!==t.outside?.temperature&&(i.temperature=this.kelvinToCelsius(t.outside.temperature)),void 0!==t.outside?.minTemperature&&(i.temperatureMin=this.kelvinToCelsius(t.outside.minTemperature)),void 0!==t.outside?.maxTemperature&&(i.temperatureMax=this.kelvinToCelsius(t.outside.maxTemperature)),void 0!==t.outside?.dewPointTemperature&&(i.dewPoint=this.kelvinToCelsius(t.outside.dewPointTemperature)),"number"==typeof t.outside?.relativeHumidity){let e=t.outside.relativeHumidity;i.humidity=e>1?e/100:e}void 0!==t.outside?.pressure&&(i.pressure=Math.round(t.outside.pressure)),void 0!==t.outside?.uvIndex&&(i.uvIndex=t.outside.uvIndex),void 0!==t.outside?.cloudCover?i.clouds=t.outside.cloudCover:void 0!==t.outside?.clouds&&(i.clouds=t.outside.clouds),void 0!==t.outside?.horizontalVisibility?i.visibility=t.outside.horizontalVisibility:void 0!==t.outside?.visibility&&(i.visibility=t.outside.visibility),void 0!==t.outside?.precipitationVolume&&(i.rain=1e3*t.outside.precipitationVolume),void 0!==t.wind&&(void 0!==t.wind.speedTrue&&(i.wind.speed=this.msToKnots(t.wind.speedTrue)),void 0!==t.wind.gust&&(i.wind.gust=this.msToKnots(t.wind.gust)),void 0!==t.wind.directionTrue&&(i.wind.direction=this.radiansToDegrees(t.wind.directionTrue))),e.push(i)}),e}kelvinToCelsius(t){return a(t)}msToKnots(t){return o(t)}radiansToDegrees(t){return s(t)}async login(t,e){let r=this.getBaseUrl();try{let i=await fetch(`${r}/signalk/v1/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:e})});if(!i.ok)throw Error(`Login failed: ${i.statusText}`);let n=await i.json();return this.authToken=n.token,this.authToken}catch(t){if("TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))){let t=Error(`SignalK server unreachable at ${r}`);throw t.name="NetworkError",t}throw console.error("SignalKService: Login failed:",t),t}}async isLoggedIn(){try{return(await fetch(`${this.getBaseUrl()}/signalk/v1/auth/user`,{headers:this.getAuthHeaders()})).ok}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError")),!1}}static RESOURCE_TYPES=["routes","waypoints","notes","regions","charts"];async listResources(e,r={}){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let i=`/signalk/v2/api/resources/${e}`,n=new URLSearchParams;r.bbox&&n.append("bbox",r.bbox),r.distance&&n.append("distance",r.distance),r.position&&n.append("position",r.position);let s=n.toString();return s&&(i+=`?${s}`),await this.apiCall(i)}async getResource(e,r){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let i=`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`;return await this.apiCall(i)}async setResource(e,r,i){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let n=`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`;return await this.apiCall(n,{method:"PUT",body:JSON.stringify(i)})}async deleteResource(e,r){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);await this.apiCall(`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`,{method:"DELETE"})}async getRoutes(t={}){return await this.listResources("routes",t)}async getRoute(t){return await this.getResource("routes",t)}async saveRoute(t,e){return await this.setResource("routes",t,e)}async deleteRoute(t){return await this.deleteResource("routes",t)}async getWaypoints(t={}){return await this.listResources("waypoints",t)}async getWaypoint(t){return await this.getResource("waypoints",t)}async saveWaypoint(t,e){return await this.setResource("waypoints",t,e)}async deleteWaypoint(t){return await this.deleteResource("waypoints",t)}async getCharts(){return await this.listResources("charts")}async getChart(t){return await this.getResource("charts",t)}async getNotes(t={}){return await this.listResources("notes",t)}async getNote(t){return await this.getResource("notes",t)}async saveNote(t,e){return await this.setResource("notes",t,e)}async deleteNote(t){return await this.deleteResource("notes",t)}async getRegions(t={}){return await this.listResources("regions",t)}async getRegion(t){return await this.getResource("regions",t)}async getCourse(){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course")}async getCourseCalculations(){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/calcValues")}async setDestinationWaypoint(t){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/destination",{method:"PUT",body:JSON.stringify({href:`/resources/waypoints/${t}`})})}async setDestinationPosition(t,e){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/destination",{method:"PUT",body:JSON.stringify({position:{latitude:t,longitude:e}})})}async activateRoute(t,e=0,r=!1){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/activeRoute",{method:"PUT",body:JSON.stringify({href:`/resources/routes/${t}`,pointIndex:e,reverse:r})})}async clearCourse(){await this.apiCall("/signalk/v2/api/vessels/self/navigation/course",{method:"DELETE"})}async moveRoutePoint(t){return this.apiCall("/signalk/v2/api/vessels/self/navigation/course/activeRoute/nextPoint",{method:"PUT",body:JSON.stringify({value:t})})}async nextWaypoint(){return this.moveRoutePoint(1)}async previousWaypoint(){return this.moveRoutePoint(-1)}async setArrivalCircle(t){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/arrivalCircle",{method:"PUT",body:JSON.stringify({value:t})})}generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}createWaypointFeature(t,e,r,i=""){return{name:r,description:i,feature:{type:"Feature",geometry:{type:"Point",coordinates:[t,e]},properties:{}}}}createRouteFeature(t,e,r=""){return{name:e,description:r,feature:{type:"Feature",geometry:{type:"LineString",coordinates:t},properties:{}}}}parseRouteCoordinates(t){return t?.feature?.geometry?.coordinates?t.feature.geometry.coordinates.map(t=>({longitude:t[0],latitude:t[1]})):[]}parseWaypointPosition(t){if(!t?.feature?.geometry?.coordinates)return null;let e=t.feature.geometry.coordinates;return{longitude:e[0],latitude:e[1]}}autopilotPath(t="_default",e=""){return`/signalk/v2/api/vessels/self/autopilots/${encodeURIComponent(t)}${e}`}async getAutopilotDevices(){try{let t=await this.apiCall("/signalk/v2/api/vessels/self/autopilots");return Object.keys(t||{})}catch(t){return console.warn("SignalKService: Could not fetch autopilot devices:",t.message),[]}}async getAutopilotData(t="_default"){return this.apiCall(this.autopilotPath(t))}async setAutopilotState(t,e="_default"){if("string"!=typeof t||!t)throw Error(`Invalid autopilot state: ${t}`);return this.apiCall(this.autopilotPath(e,"/state"),{method:"PUT",body:JSON.stringify({value:t})})}async setAutopilotMode(t,e="_default"){if("string"!=typeof t||!t)throw Error(`Invalid autopilot mode: ${t}`);return this.apiCall(this.autopilotPath(e,"/mode"),{method:"PUT",body:JSON.stringify({value:t})})}async setAutopilotTarget(t,e="_default"){return this.apiCall(this.autopilotPath(e,"/target"),{method:"PUT",body:JSON.stringify({value:t})})}async adjustAutopilotTarget(t,e="_default"){return this.apiCall(this.autopilotPath(e,"/target/adjust"),{method:"PUT",body:JSON.stringify({value:t,units:"deg"})})}async engageAutopilot(t="_default"){return this.apiCall(this.autopilotPath(t,"/engage"),{method:"POST"})}async disengageAutopilot(t="_default"){return this.apiCall(this.autopilotPath(t,"/disengage"),{method:"POST"})}async autopilotManeuver(t,e,r="_default"){if("tack"!==t&&"gybe"!==t)throw Error(`Invalid maneuver: ${t}`);if("port"!==e&&"starboard"!==e)throw Error(`Invalid direction: ${e}`);return this.apiCall(this.autopilotPath(r,`/${t}/${e}`),{method:"POST"})}async autopilotTack(t,e="_default"){return this.autopilotManeuver("tack",t,e)}async autopilotGybe(t,e="_default"){return this.autopilotManeuver("gybe",t,e)}async autopilotDodge({deltaDegrees:t=null,exit:e=!1}={},r="_default"){let i=this.autopilotPath(r,"/dodge");return e?this.apiCall(i,{method:"DELETE"}):null===t?this.apiCall(i,{method:"POST"}):this.apiCall(i,{method:"PUT",body:JSON.stringify({value:t,units:"deg"})})}async autopilotCourseAction(t,e="_default"){if("courseCurrentPoint"!==t&&"courseNextPoint"!==t)throw Error(`Invalid course action: ${t}`);return this.apiCall(this.autopilotPath(e,`/${t}`),{method:"POST"})}async isAutopilotAvailable(){try{return(await this.getAutopilotDevices()).length>0}catch(t){return!1}}async checkTideApiAvailability(){if(this.isDemoSignalK())return!1;try{let t=await fetch(`${this.getBaseUrl()}/signalk/v1/api/vessels/self/environment/tide`,{method:"GET",headers:this.getAuthHeaders()});if(t.ok){let e=await t.json();return null!==e&&"object"==typeof e&&Object.keys(e).length>0}return!1}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))||console.warn("SignalKService: Tide API check failed:",t.message),!1}}async getTideData(){if(this.isDemoSignalK())return null;try{return await this.apiCall("/signalk/v1/api/vessels/self/environment/tide")}catch(t){return console.warn("SignalKService: Could not fetch tide data:",t.message),null}}};t.s(["default",0,u],66799);let c=()=>{let t,e=i.default.getAll();return t=e.signalKUrlSet&&e.signalkUrl?e.signalkUrl:"function"==typeof i.default.getComputedSignalKUrl?i.default.getComputedSignalKUrl():e.signalkUrl||"http://localhost:3000",{enabled:!1!==e.ocearoCoreEnabled,baseUrl:t,timeout:6e4,useAuthentication:e.useAuthentication||!1,username:e.username||"",password:e.password||""}},p=async(t,r={})=>{let i=c();if(!i.enabled)throw Error("OcearoCore is not enabled");let n=new AbortController,{timeout:s,...o}=r,a=setTimeout(()=>n.abort(),s||i.timeout);try{let r=`${i.baseUrl}/plugins/ocearo-core${t}`,s={"Content-Type":"application/json",...o.headers};if(i.useAuthentication&&i.username)try{let t="function"==typeof btoa?btoa(`${i.username}:${i.password||""}`):e.Buffer.from(`${i.username}:${i.password||""}`).toString("base64");s.Authorization=`Basic ${t}`}catch(t){}let h=await fetch(r,{signal:n.signal,headers:s,credentials:"include",...o});if(clearTimeout(a),!h.ok){let t=h.headers.get("content-type")||"";if(404===h.status||t.includes("text/html")){let t=Error(`OcearoCore plugin not available at ${r}`);throw t.name="NetworkError",t}let e=await h.text().catch(()=>h.statusText);throw Error(`OcearoCore API error (${h.status}): ${e}`)}return await h.json()}catch(t){if(clearTimeout(a),"AbortError"===t.name){let t=Error("OcearoCore API request timed out");throw t.name="TimeoutError",t}if("TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))){let t=Error(`OcearoCore server unreachable at ${i.baseUrl}`);throw t.name="NetworkError",t}throw t}},d=async(t,e={})=>{let r=["weather","sail","alerts","ais","status","logbook","route","racing","briefing"];if(!r.includes(t))throw Error(`Invalid analysis type. Valid types: ${r.join(", ")}`);return await p("/analyze",{method:"POST",timeout:12e4,body:JSON.stringify({type:t,...e})})},f=async t=>{let e=["sailing","anchored","motoring","moored","racing"];if(!e.includes(t))throw Error(`Invalid mode. Valid modes: ${e.join(", ")}`);return await p("/mode",{method:"POST",body:JSON.stringify({mode:t})})},m=async()=>await p("/dnd"),y=async(t,e)=>{let r=["off","safety","all"];if(!r.includes(t))throw Error(`Invalid DND mode. Valid modes: ${r.join(", ")}`);let i={mode:t};return"number"==typeof e&&e>0&&(i.durationMinutes=e),await p("/dnd",{method:"POST",body:JSON.stringify(i)})},g=async(t=[])=>await p("/logbook/analyze",{method:"POST",body:JSON.stringify({entries:t})}),b=async t=>{if(!t||"object"!=typeof t)throw Error("Current data is required and must be an object");return await p("/logbook/entry",{method:"POST",body:JSON.stringify({currentData:t})})},v=async(t,e=null)=>{if(!t||"object"!=typeof t)throw Error("Fuel data is required and must be an object");try{let r={datetime:new Date().toISOString(),type:"fuel_refill",position:e||{latitude:null,longitude:null},fuel:{liters:t.liters,cost:t.cost,additive:t.additive||!1,engineHoursAtRefill:t.engineHours,previousEngineHours:t.previousEngineHours||null,hoursSinceLastRefill:t.hoursSinceLastRefill||null},liters:t.liters,author:"fuel_log",text:`Fuel refill: ${t.liters}L - ${t.cost}€${t.additive?" (with additive)":""} - Engine hours: ${t.engineHours}h`};return await p("/logbook/fuel",{method:"POST",body:JSON.stringify(r)})}catch(i){let r={datetime:new Date().toISOString(),type:"fuel_refill",position:e||{latitude:null,longitude:null},fuel:{liters:t.liters,cost:t.cost,additive:t.additive||!1,engineHoursAtRefill:t.engineHours,previousEngineHours:t.previousEngineHours||null,hoursSinceLastRefill:t.hoursSinceLastRefill||null},author:"fuel_log",text:`Fuel refill: ${t.liters}L - ${t.cost}€${t.additive?" (with additive)":""} - Engine hours: ${t.engineHours}h`};return await T(r)}},x=async()=>{try{let t=await p("/logbook/fuel");if(Array.isArray(t)&&t.length>=0)return t}catch(t){}return(await A()).filter(t=>"fuel_refill"===t.type||"fuel_log"===t.author)},w=(t,e=null)=>{if(!t||0===t.length)return{averageConsumption:null,totalLiters:0,totalCost:0,refillCount:0,estimatedTankLevel:null,lastRefill:null};let r=[...t].sort((t,e)=>new Date(t.datetime)-new Date(e.datetime)),i=0,n=0,s=0,o=[];for(let t=0;t<r.length;t++){let e=r[t].fuel||{};if(i+=e.liters||0,n+=e.cost||0,e.hoursSinceLastRefill&&e.hoursSinceLastRefill>0){let t=e.liters||0,r=e.hoursSinceLastRefill;t>0&&r>0&&(o.push(t/r),s+=r)}}let a=o.length>0?o.reduce((t,e)=>t+e,0)/o.length:null,h=o.length>0?Math.max(...o):null,l=r[r.length-1],u=l?.fuel||{};return{averageConsumption:a?Math.round(10*a)/10:null,worstConsumption:h?Math.round(10*h)/10:null,totalLiters:Math.round(10*i)/10,totalCost:Math.round(100*n)/100,refillCount:r.length,totalHours:Math.round(10*s)/10,lastRefill:l?{date:new Date(l.datetime),liters:u.liters,engineHours:u.engineHoursAtRefill}:null}},S=async t=>{let e=Number.isFinite(t)&&t>0?`?limit=${t}`:"";return await p(`/navigation/anchor/track${e}`)},M=async()=>await p("/bathymetry/status"),_=async(t,e,r)=>await p("/bathymetry/download",{method:"POST",body:JSON.stringify({lat:t,lon:e,radiusNm:r})}),A=async(t,e)=>{let r=new URLSearchParams;t&&r.append("startDate",t),e&&r.append("endDate",e);let i=r.toString(),n=`/logbook/all-entries${i?`?${i}`:""}`;return await p(n)},T=async t=>{if(!t||"object"!=typeof t)throw Error("Entry data is required and must be an object");return await p("/logbook/add-entry",{method:"POST",body:JSON.stringify(t)})};t.s(["addFuelLogEntry",0,v,"addLogbookEntry",0,T,"analyzeLogbookWithOcearoCore",0,g,"bathymetryTileTemplate",0,()=>{let t=c();return t.enabled?`${t.baseUrl}/plugins/ocearo-core/bathymetry/tiles/{z}/{x}/{y}.png`:null},"calculateFuelStats",0,w,"downloadBathymetry",0,_,"estimateTankLevel",0,(t,e,r,i=null)=>{let n=w(t,r);if(!n.lastRefill||!n.averageConsumption||!e)return{estimatedLiters:null,estimatedPercent:null,hoursRemaining:null,basedOnSensor:null!==i,sensorLevel:null!==i?Math.round(100*i):null};let s=e-n.lastRefill.engineHours,o=n.worstConsumption||n.averageConsumption,a=s*n.averageConsumption,h=t=>{let e;if(r)e=r-t;else{if(!n.lastRefill.liters)return null;e=n.lastRefill.liters-t}return Math.max(0,e)},l=h(a),u=h(s*o),c=t=>null!==t&&r?Math.round(Math.max(0,Math.min(100,t/r*100))):null,p=null!==l&&n.averageConsumption>0?Math.max(0,l/n.averageConsumption):null,d=null!==u&&o>0?Math.max(0,u/o):null;return{estimatedLiters:null!==l?Math.round(10*l)/10:null,estimatedLitersWorst:null!==u?Math.round(10*u)/10:null,estimatedPercent:c(l),estimatedPercentWorst:c(u),hoursRemaining:null!==p?Math.round(10*p)/10:null,hoursRemainingWorst:null!==d?Math.round(10*d)/10:null,hoursSinceLastRefill:Math.round(10*s)/10,estimatedUsed:Math.round(10*a)/10,basedOnSensor:null!==i,sensorLevel:null!==i?Math.round(100*i):null}},"fetchFuelLogEntries",0,x,"fetchLogbookEntries",0,A,"generateOcearoCoreLogbookEntry",0,b,"getAnchorTrack",0,S,"getBathymetryStatus",0,M,"getOcearoCoreDnd",0,m,"handleOcearoCoreError",0,(t,e="OcearoCore operation")=>"NetworkError"===t.name?(console.warn(`${e} failed: OcearoCore server unreachable.`,t.message),"OcearoCore server unreachable. Please check if the service is running."):"TimeoutError"===t.name||t.message.includes("timed out")?(console.warn(`${e} failed: OcearoCore request timed out.`),"OcearoCore service is not responding (timeout)"):(console.warn(`${e} failed:`,t.message),t.message.includes("not enabled"))?"OcearoCore is not enabled in the configuration":t.message.includes("Logbook write failed")||t.message.includes("Logbook manager not initialized")?"Logbook service error. Please check the ocearo-core plugin status.":t.message.includes("503")?"Service temporarily unavailable. Please try again later.":t.message.includes("404")?"Feature not found or not installed":t.message.includes("500")?"Internal server error. Check server logs for details.":t.message||"Unknown error occurred","isOcearoCoreEnabled",0,()=>c().enabled,"makeOcearoCoreApiCall",0,p,"requestAnalysis",0,d,"setOcearoCoreDnd",0,y,"updateOcearoCoreMode",0,f],48390)},95430,t=>{"use strict";t.s(["useVesselClock",()=>o,"vesselNow",()=>s]);var e=t.i(71645),r=t.i(85709);let i=0,n=!1,s=()=>new Date(Date.now()+i),o=()=>{let t=(0,r.useSignalKPath)("navigation.datetime");(0,e.useEffect)(()=>{(t=>{if(null==t)return;let e=t instanceof Date?t.getTime():new Date(t).getTime();if(!Number.isFinite(e))return;let r=e-Date.now(),s=Math.abs(r)>=6e4,o=s?r:0;return(o!==i||n!==s)&&(i=o,n=s)})(t)},[t]);let{offsetMs:s,corrected:o}=(0,e.useMemo)(()=>{let e=null==t?NaN:new Date(t).getTime(),r=Number.isFinite(e)?e-Date.now():0,i=Math.abs(r)>=6e4;return{offsetMs:i?r:0,corrected:i}},[t]),a=(0,e.useRef)(s);a.current=s;let h=(0,e.useCallback)(()=>new Date(Date.now()+a.current),[]);return(0,e.useMemo)(()=>({now:h,offsetMs:s,corrected:o}),[h,s,o])}},78492,(t,e,r)=>{"use strict";var i=Object.prototype.hasOwnProperty,n="~";function s(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,s){if("function"!=typeof r)throw TypeError("The listener must be a function");var a=new o(r,i||t,s),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1)),l.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},l.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=Array(s);i<s;i++)o[i]=r[i].fn;return o},l.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},l.prototype.emit=function(t,e,r,i,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,s),!0;case 6:return u.fn.call(u.context,e,r,i,s,o),!0}for(l=1,h=Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var p,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!h)for(p=1,h=Array(c-1);p<c;p++)h[p-1]=arguments[p];u[l].fn.apply(u[l].context,h)}}return!0},l.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},l.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},l.prototype.removeListener=function(t,e,r,i){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||i&&!o.once||r&&o.context!==r||h(this,s);else{for(var a=0,l=[],u=o.length;a<u;a++)(o[a].fn!==e||i&&!o[a].once||r&&o[a].context!==r)&&l.push(o[a]);l.length?this._events[s]=1===l.length?l[0]:l:h(this,s)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},58033,(t,e,r)=>{var i=null;e.exports=i="u">typeof WebSocket?WebSocket:"u">typeof MozWebSocket?MozWebSocket:t.g.WebSocket||t.g.MozWebSocket},20502,(t,e,r)=>{var i="u">typeof globalThis&&globalThis||"u">typeof self&&self||t.g,n=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();(function(e){var r=void 0!==n&&n||"u">typeof self&&self||t.g||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function c(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(TypeError("Already read"));t.bodyUsed=!0}}function p(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function d(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){if(this.bodyUsed=this.bodyUsed,this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(i.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(i.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else{var e;i.arrayBuffer&&i.blob&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=c(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(d);throw Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,i,n,s=c(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,r=p(e=new FileReader),n=(i=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?i[1]:"utf-8",e.readAsText(t,n),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=Array(e.length),i=0;i<e.length;i++)r[i]=String.fromCharCode(e[i]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=a(t),e=h(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[a(t)]},u.prototype.get=function(t){return t=a(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},u.prototype.set=function(t,e){this.map[a(t)]=h(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),l(t)},u.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),l(t)},u.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),l(t)},i.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function g(t,e){if(!(this instanceof g))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var i,n,s=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new u(e.headers)),this.method=(n=(i=e.method||this.method||"GET").toUpperCase(),y.indexOf(n)>-1?n:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),("GET"===this.method||"HEAD"===this.method)&&("no-store"===e.cache||"no-cache"===e.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}}),e}function v(t,e){if(!(this instanceof v))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var x=[301,302,303,307,308];v.redirect=function(t,e){if(-1===x.indexOf(e))throw RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,n){return new Promise(function(s,o){var l=new g(t,n);if(l.signal&&l.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function p(){c.abort()}if(c.onload=function(){var t,e,r={statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();try{e.append(i,n)}catch(t){console.warn("Response "+t.message)}}}),e)};0===l.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var i="response"in c?c.response:c.responseText;setTimeout(function(){s(new v(i,r))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new e.DOMException("Aborted","AbortError"))},0)},c.open(l.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?c.withCredentials=!0:"omit"===l.credentials&&(c.withCredentials=!1),"responseType"in c&&(i.blob?c.responseType="blob":i.arrayBuffer&&(c.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof u||r.Headers&&n.headers instanceof r.Headers)){var d=[];Object.getOwnPropertyNames(n.headers).forEach(function(t){d.push(a(t)),c.setRequestHeader(t,h(n.headers[t]))}),l.headers.forEach(function(t,e){-1===d.indexOf(e)&&c.setRequestHeader(e,t)})}else l.headers.forEach(function(t,e){c.setRequestHeader(e,t)});l.signal&&(l.signal.addEventListener("abort",p),c.onreadystatechange=function(){4===c.readyState&&l.signal.removeEventListener("abort",p)}),c.send(void 0===l._bodyInit?null:l._bodyInit)})}w.polyfill=!0,r.fetch||(r.fetch=w,r.Headers=u,r.Request=g,r.Response=v),e.Headers=u,e.Request=g,e.Response=v,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=i.fetch?i:n;(r=s.fetch).default=s.fetch,r.fetch=s.fetch,r.Headers=s.Headers,r.Request=s.Request,r.Response=s.Response,e.exports=r},76775,(t,e,r)=>{function i(t,e,r,i){return Math.round(t/r)+" "+i+(e>=1.5*r?"s":"")}e.exports=function(t,e){e=e||{};var r,n,s,o,a=typeof t;if("string"===a&&t.length>0){var h=t;if(!((h=String(h)).length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(l){var u=parseFloat(l[1]);switch((l[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===a&&isFinite(t)){return e.long?(n=Math.abs(r=t))>=864e5?i(r,n,864e5,"day"):n>=36e5?i(r,n,36e5,"hour"):n>=6e4?i(r,n,6e4,"minute"):n>=1e3?i(r,n,1e3,"second"):r+" ms":(o=Math.abs(s=t))>=864e5?Math.round(s/864e5)+"d":o>=36e5?Math.round(s/36e5)+"h":o>=6e4?Math.round(s/6e4)+"m":o>=1e3?Math.round(s/1e3)+"s":s+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},7003,(t,e,r)=>{e.exports=function(e){function r(t){let e,n,s,o=null;function a(...t){if(!a.enabled)return;let i=Number(new Date);a.diff=i-(e||i),a.prev=e,a.curr=i,e=i,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let n=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(e,i)=>{if("%%"===e)return"%";n++;let s=r.formatters[i];if("function"==typeof s){let r=t[n];e=s.call(a,r),t.splice(n,1),n--}return e}),r.formatArgs.call(a,t),(a.log||r.log).apply(a,t)}return a.namespace=t,a.useColors=r.useColors(),a.color=r.selectColor(t),a.extend=i,a.destroy=r.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==r.namespaces&&(n=r.namespaces,s=r.enabled(t)),s),set:t=>{o=t}}),"function"==typeof r.init&&r.init(a),a}function i(t,e){let i=r(this.namespace+(void 0===e?":":e)+t);return i.log=this.log,i}function n(t,e){let r=0,i=0,n=-1,s=0;for(;r<t.length;)if(i<e.length&&(e[i]===t[r]||"*"===e[i]))"*"===e[i]?(n=i,s=r):r++,i++;else{if(-1===n)return!1;i=n+1,r=++s}for(;i<e.length&&"*"===e[i];)i++;return i===e.length}return r.debug=r,r.default=r,r.coerce=function(t){return t instanceof Error?t.stack||t.message:t},r.disable=function(){let t=[...r.names,...r.skips.map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){for(let e of(r.save(t),r.namespaces=t,r.names=[],r.skips=[],("string"==typeof t?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===e[0]?r.skips.push(e.slice(1)):r.names.push(e)},r.enabled=function(t){for(let e of r.skips)if(n(t,e))return!1;for(let e of r.names)if(n(t,e))return!0;return!1},r.humanize=t.r(76775),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{r[t]=e[t]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r)|0;return r.colors[Math.abs(e)%r.colors.length]},r.enable(r.load()),r}},48450,(t,e,r)=>{let i;var n=t.i(47167);r.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let i=0,n=0;t[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(i++,"%c"===t&&(n=i))}),t.splice(n,0,r)},r.save=function(t){try{t?r.storage.setItem("debug",t):r.storage.removeItem("debug")}catch(t){}},r.load=function(){let t;try{t=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch(t){}return!t&&void 0!==n.default&&"env"in n.default&&(t=n.default.env.DEBUG),t},r.useColors=function(){let t;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(t){}}(),i=!1,r.destroy=()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),e.exports=t.r(7003)(r);let{formatters:s}=e.exports;s.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=l(t),r=e[0],i=e[1];return(r+i)*3/4-i},r.toByteArray=function(t){var e,r,i=l(t),o=i[0],a=i[1],h=new s((o+a)*3/4-a),u=0,c=a>0?o-4:o;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],h[u++]=e>>16&255,h[u++]=e>>8&255,h[u++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[u++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e),h},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s=[],o=0,a=r-n;o<a;o+=16383)s.push(function(t,e,r){for(var n,s=[],o=e;o<r;o+=3)n=(t[o]<<16&0xff0000)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(i[n>>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return s.join("")}(t,o,o+16383>a?a:o+16383));return 1===n?s.push(i[(e=t[r-1])>>2]+i[e<<4&63]+"=="):2===n&&s.push(i[(e=(t[r-2]<<8)+t[r-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],n=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,h=o.length;a<h;++a)i[a]=o[a],n[o.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}n[45]=62,n[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,h=(1<<a)-1,l=h>>1,u=-7,c=r?n-1:0,p=r?-1:1,d=t[e+c];for(c+=p,s=d&(1<<-u)-1,d>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=p,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+c],c+=p,u-=8);if(0===s)s=1-l;else{if(s===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=l}return(d?-1:1)*o*Math.pow(2,s-i)},r.write=function(t,e,r,i,n,s){var o,a,h,l=8*s-n-1,u=(1<<l)-1,c=u>>1,p=5960464477539062e-23*(23===n),d=i?0:s-1,f=i?1:-1,m=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),o+c>=1?e+=p/h:e+=p*Math.pow(2,1-c),e*h>=2&&(o++,h/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(e*h-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&a,d+=f,a/=256,n-=8);for(o=o<<n|a,l+=n;l>0;t[r+d]=255&o,d+=f,o/=256,l-=8);t[r+d-f]|=128*m}},43943,(t,e,r)=>{"use strict";let i=t.r(34582),n=t.r(38492),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return u(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t){var i=t,n=e;if(("string"!=typeof n||""===n)&&(n="utf8"),!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);let r=0|f(i,n),s=o(r),h=s.write(i,n);return h!==r&&(s=s.slice(0,h)),s}if(ArrayBuffer.isView(t)){var s=t;if(N(s,Uint8Array)){let t=new Uint8Array(s);return p(t.buffer,t.byteOffset,t.byteLength)}return c(s)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let h=t.valueOf&&t.valueOf();if(null!=h&&h!==t)return a.from(h,e,r);let l=function(t){if(a.isBuffer(t)){let e=0|d(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?o(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),o(t<0?0:0|d(t))}function c(t){let e=t.length<0?0:0|d(t.length),r=o(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function p(t,e,r){let i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),i}function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(n)return i?-1:B(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=F[t[i]];return n}(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}(this,e,r);case"base64":var s,o,a;return s=this,o=e,a=r,0===o&&a===s.length?i.fromByteArray(s):i.fromByteArray(s.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let i=t.slice(e,r),n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}(this,e,r);default:if(n)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){var s;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(n)return -1;else r=t.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,i,n)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let s,o=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;o=2,a/=2,h/=2,r/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(s=r;s<a;s++)if(l(t,s)===l(e,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===h)return i*o}else -1!==i&&(s-=s-i),i=-1}else for(r+h>a&&(r=a-h),s=r;s>=0;s--){let r=!0;for(let i=0;i<h;i++)if(l(t,s+i)!==l(e,i)){r=!1;break}if(r)return s}return -1}function v(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let e=t[n],s=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,h;switch(o){case 1:e<128&&(s=e);break;case 2:(192&(r=t[n+1]))==128&&(h=(31&e)<<6|63&r)>127&&(s=h);break;case 3:r=t[n+1],i=t[n+2],(192&r)==128&&(192&i)==128&&(h=(15&e)<<12|(63&r)<<6|63&i)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],(192&r)==128&&(192&i)==128&&(192&a)==128&&(h=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a)>65535&&h<1114112&&(s=h)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}var s=i;let o=s.length;if(o<=4096)return String.fromCharCode.apply(String,s);let a="",h=0;for(;h<o;)a+=String.fromCharCode.apply(String,s.slice(h,h+=4096));return a}function x(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,i,n,s){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function S(t,e,r,i,n){O(e,i,n,t,r,7);let s=Number(e&BigInt(0xffffffff));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function M(t,e,r,i,n){O(e,i,n,t,r,7);let s=Number(e&BigInt(0xffffffff));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function _(t,e,r,i,n,s){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function A(t,e,r,i,s){return e*=1,r>>>=0,s||_(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function T(t,e,r,i,s){return e*=1,r>>>=0,s||_(t,e,r,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,r,i,52,8),r+8}r.Buffer=a,r.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)},a.allocUnsafe=function(t){return u(t)},a.allocUnsafeSlow=function(t){return u(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:+(i<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))n+e.length>i.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else if(a.isBuffer(e))e.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=e.length}return i},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},a.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},a.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?v(this,0,t):m.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;let s=n-i,o=r-e,h=Math.min(s,o),l=this.slice(i,n),u=t.slice(e,r);for(let t=0;t<h;++t)if(l[t]!==u[t]){s=l[t],o=u[t];break}return s<o?-1:+(o<s)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},a.prototype.write=function(t,e,r,i){var n,s,o,a,h,l,u,c;if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let d=!1;for(;;)switch(i){case"hex":return function(t,e,r,i){let n;r=Number(r)||0;let s=t.length-r;i?(i=Number(i))>s&&(i=s):i=s;let o=e.length;for(i>o/2&&(i=o/2),n=0;n<i;++n){var a;let i=parseInt(e.substr(2*n,2),16);if((a=i)!=a)break;t[r+n]=i}return n}(this,t,e,r);case"utf8":case"utf-8":return n=e,s=r,z(B(t,this.length-n),this,n,s);case"ascii":case"latin1":case"binary":return o=e,a=r,z(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,o,a);case"base64":return h=e,l=r,z(L(t),this,h,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=e,c=r,z(function(t,e){let r,i,n=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)i=(r=t.charCodeAt(s))>>8,n.push(r%256),n.push(i);return n}(t,this.length-u),this,u,c);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return i},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=U(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&k(t,this.length-8);let i=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],n=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(i)+(BigInt(n)<<BigInt(32))}),a.prototype.readBigUInt64BE=U(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&k(t,this.length-8);let i=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],n=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return(t>>>=0,e||x(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=U(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&k(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),a.prototype.readBigInt64BE=U(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&k(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}let n=1,s=0;for(this[e]=255&t;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}let n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=U(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=U(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=255&t;++n<r&&(s*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/s|0)-o&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s|0)-o&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=U(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=U(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);let n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},a.prototype.fill=function(t,e,r,i){let n;if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){let e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{let s=a.isBuffer(t)?t:a.from(t,i),o=s.length;if(0===o)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=s[n%o]}return this};let C={};function E(t,e,r){C[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function R(t){let e="",r=t.length,i=+("-"===t[0]);for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function O(t,e,r,i,n,s){if(t>r||t<e){let i,n="bigint"==typeof e?"n":"";throw i=s>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new C.ERR_OUT_OF_RANGE("value",i,t)}I(n,"offset"),(void 0===i[n]||void 0===i[n+s])&&k(n,i.length-(s+1))}function I(t,e){if("number"!=typeof t)throw new C.ERR_INVALID_ARG_TYPE(e,"number",t)}function k(t,e,r){if(Math.floor(t)!==t)throw I(t,r),new C.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}E("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),E("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?n=R(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=R(n)),n+="n"),i+=` It must be ${e}. Received ${n}`},RangeError);let P=/[^+/0-9A-Za-z-_]/g;function B(t,e){let r;e=e||1/0;let i=t.length,n=null,s=[];for(let o=0;o<i;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!n){if(r>56319||o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function L(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let F=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function U(t){return"u"<typeof BigInt?j:t}function j(){throw Error("BigInt not supported")}},30662,(t,e,r)=>{!function(){"use strict";var t={294:function(t){var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise(function(r,i){var n,s,o;function a(r){t.removeListener(e,h),i(r)}function h(){"function"==typeof t.removeListener&&t.removeListener("error",a),r([].slice.call(arguments))}m(t,e,h,{once:!0}),"error"!==e&&(n=t,s=a,o={once:!0},"function"==typeof n.on&&m(n,"error",s,o))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=h(t))>0&&o.length>n&&!o.warned){o.warned=!0;var n,s,o,l=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,console&&console.warn&&console.warn(l)}return t}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=u.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):f(n,n.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(t,e){for(var r=Array(e),i=0;i<e;++i)r[i]=t[i];return r}function m(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else if("function"==typeof t.addEventListener)t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||n(t))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||n(t))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else for(var l=h.length,u=f(h,l),r=0;r<l;++r)i(u[r],this,e);return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,c(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,c(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,n,s,o;if(a(e),void 0===(i=this._events)||void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0==arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var s=r[e]={exports:{}},o=!0;try{t[e](s,s.exports,i),o=!1}finally{o&&delete r[e]}return s.exports}i.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=i(294)}()},77398,(t,e,r)=>{var i=t.i(67034),n=t.i(47167),s={7492:function(t){t.exports=function(t,r,i){if(t.filter)return t.filter(r,i);if(null==t||"function"!=typeof r)throw TypeError();for(var n=[],s=0;s<t.length;s++)if(e.call(t,s)){var o=t[s];r.call(i,o,s,t)&&n.push(o)}return n};var e=Object.prototype.hasOwnProperty},1648:function(t,e,r){"use strict";var i=r(7797),n=r(4834),s=r(8772);t.exports=r(9095)||i.call(s,n)},4757:function(t,e,r){"use strict";var i=r(7797),n=r(4834),s=r(1648);t.exports=function(){return s(i,n,arguments)}},4834:function(t){"use strict";t.exports=Function.prototype.apply},8772:function(t){"use strict";t.exports=Function.prototype.call},2462:function(t,e,r){"use strict";var i=r(7797),n=r(4785),s=r(8772),o=r(1648);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return o(i,s,t)}},9095:function(t){"use strict";t.exports="u">typeof Reflect&&Reflect&&Reflect.apply},2982:function(t,e,r){"use strict";var i=r(1893),n=r(5494),s=n(i("String.prototype.indexOf"));t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?n(r):r}},5494:function(t,e,r){"use strict";var i=r(3798),n=r(871),s=r(2462),o=r(4757);t.exports=function(t){var e=s(arguments),r=t.length-(arguments.length-1);return i(e,1+(r>0?r:0),!0)},n?n(t.exports,"apply",{value:o}):t.exports.apply=o},2071:function(t,e,r){"use strict";var i=r(871),n=r(9546),s=r(4785),o=r(8322);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],c=!!o&&o(t,e);if(i)i(t,e,{configurable:null===l&&c?c.configurable:!l,enumerable:null===a&&c?c.enumerable:!a,value:r,writable:null===h&&c?c.writable:!h});else if(!u&&(a||h||l))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else t[e]=r}},3859:function(t,e,r){"use strict";var i,n=r(2462),s=r(8322);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&s&&s(Object.prototype,"__proto__"),a=Object,h=a.getPrototypeOf;t.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof h&&function(t){return h(null==t?t:a(t))}},871:function(t){"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},1247:function(t){"use strict";t.exports=EvalError},6621:function(t){"use strict";t.exports=Error},6136:function(t){"use strict";t.exports=RangeError},252:function(t){"use strict";t.exports=ReferenceError},9546:function(t){"use strict";t.exports=SyntaxError},4785:function(t){"use strict";t.exports=TypeError},1223:function(t){"use strict";t.exports=URIError},8300:function(t){"use strict";t.exports=Object},4680:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,i,n){if("[object Function]"!==r.call(i))throw TypeError("iterator must be a function");var s=t.length;if(s===+s)for(var o=0;o<s;o++)i.call(n,t[o],o,t);else for(var a in t)e.call(t,a)&&i.call(n,t[a],a,t)}},6555:function(t){"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var n=0;n<e.length;n+=1)r[n+t.length]=e[n];return r},n=function(t,e){for(var r=[],i=e||0,n=0;i<t.length;i+=1,n+=1)r[n]=t[i];return r},s=function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r};t.exports=function(t){var o,a=this;if("function"!=typeof a||"[object Function]"!==e.apply(a))throw TypeError("Function.prototype.bind called on incompatible "+a);for(var h=n(arguments,1),l=r(0,a.length-h.length),u=[],c=0;c<l;c++)u[c]="$"+c;if(o=Function("binder","return function ("+s(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var e=a.apply(this,i(h,arguments));return Object(e)===e?e:this}return a.apply(t,i(h,arguments))}),a.prototype){var p=function(){};p.prototype=a.prototype,o.prototype=new p,p.prototype=null}return o}},7797:function(t,e,r){"use strict";var i=r(6555);t.exports=Function.prototype.bind||i},1893:function(t,e,r){"use strict";var i,n=r(8300),s=r(6621),o=r(1247),a=r(6136),h=r(252),l=r(9546),u=r(4785),c=r(1223),p=r(4197),d=r(4455),f=r(1295),m=r(6949),y=r(2943),g=r(1721),b=r(3536),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(8322),S=r(871),M=function(){throw new u},_=w?function(){try{return arguments.callee,M}catch(t){try{return w(arguments,"callee").get}catch(t){return M}}}():M,A=r(9131)(),T=r(9717),C=r(45),E=r(7767),R=r(4834),O=r(8772),I={},k="u">typeof Uint8Array&&T?T(Uint8Array):i,P={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&T?T([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"u"<typeof Atomics?i:Atomics,"%BigInt%":"u"<typeof BigInt?i:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"u"<typeof Float16Array?i:Float16Array,"%Float32Array%":"u"<typeof Float32Array?i:Float32Array,"%Float64Array%":"u"<typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":"u"<typeof Int8Array?i:Int8Array,"%Int16Array%":"u"<typeof Int16Array?i:Int16Array,"%Int32Array%":"u"<typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&T?T(T([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"u"<typeof Map?i:Map,"%MapIteratorPrototype%":"u">typeof Map&&A&&T?T((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?i:Promise,"%Proxy%":"u"<typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":h,"%Reflect%":"u"<typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?i:Set,"%SetIteratorPrototype%":"u">typeof Set&&A&&T?T((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&T?T(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":l,"%ThrowTypeError%":_,"%TypedArray%":k,"%TypeError%":u,"%Uint8Array%":"u"<typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"u"<typeof WeakMap?i:WeakMap,"%WeakRef%":"u"<typeof WeakRef?i:WeakRef,"%WeakSet%":"u"<typeof WeakSet?i:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":R,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":d,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":y,"%Math.round%":g,"%Math.sign%":b,"%Reflect.getPrototypeOf%":E};if(T)try{null.error}catch(t){var B=T(T(t));P["%Error.prototype%"]=B}var L=function t(e){var r;if("%AsyncFunction%"===e)r=x("async function () {}");else if("%GeneratorFunction%"===e)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=x("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&T&&(r=T(n.prototype))}return P[e]=r,r},z={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=r(7797),F=r(3383),U=N.call(O,Array.prototype.concat),j=N.call(R,Array.prototype.splice),D=N.call(O,String.prototype.replace),V=N.call(O,String.prototype.slice),W=N.call(O,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,H=function(t){var e=V(t,0,1),r=V(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var i=[];return D(t,q,function(t,e,r,n){i[i.length]=r?D(n,G,"$1"):e||t}),i},$=function(t,e){var r,i=t;if(F(z,i)&&(i="%"+(r=z[i])[0]+"%"),F(P,i)){var n=P[i];if(n===I&&(n=L(i)),void 0===n&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===W(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=H(t),i=r.length>0?r[0]:"",n=$("%"+i+"%",e),s=n.name,o=n.value,a=!1,h=n.alias;h&&(i=h[0],j(r,U([0,1],h)));for(var c=1,p=!0;c<r.length;c+=1){var d=r[c],f=V(d,0,1),m=V(d,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new l("property names with quotes must have matching quotes");if("constructor"!==d&&p||(a=!0),i+="."+d,F(P,s="%"+i+"%"))o=P[s];else if(null!=o){if(!(d in o)){if(!e)throw new u("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var y=w(o,d);o=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[d]}else p=F(o,d),o=o[d];p&&!a&&(P[s]=o)}}return o}},45:function(t,e,r){"use strict";t.exports=r(8300).getPrototypeOf||null},7767:function(t){"use strict";t.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},9717:function(t,e,r){"use strict";var i=r(7767),n=r(45),s=r(3859);t.exports=i?function(t){return i(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("getProto: not an object");return n(t)}:s?function(t){return s(t)}:null},8422:function(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},8322:function(t,e,r){"use strict";var i=r(8422);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},8122:function(t,e,r){"use strict";var i=r(871),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},8564:function(t,e,r){"use strict";var i="u">typeof Symbol&&Symbol,n=r(9094);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}},9094:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},9131:function(t,e,r){"use strict";var i="u">typeof Symbol&&Symbol,n=r(6313);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}},6313:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},3383:function(t,e,r){"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty;t.exports=r(7797).call(i,n)},1638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},6960:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,i=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},n=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=n,t.exports=s?i:n},8979:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,i=/^\s*(?:function)?\*/,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,s=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(t){}}(),a=o?s(o):{};t.exports=function(t){return"function"==typeof t&&(!!i.test(r.call(t))||(n?s(t)===a:"[object GeneratorFunction]"===e.call(t)))}},9572:function(e,r,i){"use strict";var n=i(4680),s=i(3147),o=i(2982),a=o("Object.prototype.toString"),h=i(8564)()&&"symbol"==typeof Symbol.toStringTag,l=s(),u=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return -1},c=o("String.prototype.slice"),p={},d=i(9745),f=Object.getPrototypeOf;h&&d&&f&&n(l,function(e){var r=new t.g[e];if(!(Symbol.toStringTag in r))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var i=f(r),n=d(i,Symbol.toStringTag);n||(n=d(f(i),Symbol.toStringTag)),p[e]=n.get});var m=function(t){var e=!1;return n(p,function(r,i){if(!e)try{e=r.call(t)===i}catch(t){}}),e};e.exports=function(t){return!!t&&"object"==typeof t&&(h?!!d&&m(t):u(l,c(a(t),8,-1))>-1)}},4197:function(t){"use strict";t.exports=Math.abs},4455:function(t){"use strict";t.exports=Math.floor},6128:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},1295:function(t){"use strict";t.exports=Math.max},6949:function(t){"use strict";t.exports=Math.min},2943:function(t){"use strict";t.exports=Math.pow},1721:function(t){"use strict";t.exports=Math.round},3536:function(t,e,r){"use strict";var i=r(6128);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},3798:function(t,e,r){"use strict";var i=r(1893),n=r(2071),s=r(8122)(),o=r(8322),a=r(4785),h=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>0xffffffff||h(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,l=!0;if("length"in t&&o){var u=o(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(l=!1)}return(i||l||!r)&&(s?n(t,"length",e,!0,!0):n(t,"length",e)),t}},3614:function(t){t.exports=function(t){return t instanceof i.Buffer}},7551:function(t,e,r){"use strict";var i=r(6960),n=r(8979),s=r(3051),o=r(9572);function a(t){return t.call.bind(t)}var h="u">typeof BigInt,l="u">typeof Symbol,u=a(Object.prototype.toString),c=a(Number.prototype.valueOf),p=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(h)var f=a(BigInt.prototype.valueOf);if(l)var m=a(Symbol.prototype.valueOf);function y(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===u(t)}function b(t){return"[object Set]"===u(t)}function v(t){return"[object WeakMap]"===u(t)}function x(t){return"[object WeakSet]"===u(t)}function w(t){return"[object ArrayBuffer]"===u(t)}function S(t){return!("u"<typeof ArrayBuffer)&&(w.working?w(t):t instanceof ArrayBuffer)}function M(t){return"[object DataView]"===u(t)}function _(t){return!("u"<typeof DataView)&&(M.working?M(t):t instanceof DataView)}e.isArgumentsObject=i,e.isGeneratorFunction=n,e.isTypedArray=o,e.isPromise=function(t){return"u">typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||_(t)},e.isUint8Array=function(t){return"Uint8Array"===s(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===s(t)},e.isUint16Array=function(t){return"Uint16Array"===s(t)},e.isUint32Array=function(t){return"Uint32Array"===s(t)},e.isInt8Array=function(t){return"Int8Array"===s(t)},e.isInt16Array=function(t){return"Int16Array"===s(t)},e.isInt32Array=function(t){return"Int32Array"===s(t)},e.isFloat32Array=function(t){return"Float32Array"===s(t)},e.isFloat64Array=function(t){return"Float64Array"===s(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===s(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===s(t)},g.working="u">typeof Map&&g(new Map),e.isMap=function(t){return!("u"<typeof Map)&&(g.working?g(t):t instanceof Map)},b.working="u">typeof Set&&b(new Set),e.isSet=function(t){return!("u"<typeof Set)&&(b.working?b(t):t instanceof Set)},v.working="u">typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return!("u"<typeof WeakMap)&&(v.working?v(t):t instanceof WeakMap)},x.working="u">typeof WeakSet&&x(new WeakSet),e.isWeakSet=function(t){return x(t)},w.working="u">typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,M.working="u">typeof ArrayBuffer&&"u">typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=_;var A="u">typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function C(t){return void 0!==A&&(void 0===T.working&&(T.working=T(new A)),T.working?T(t):t instanceof A)}function E(t){return y(t,c)}function R(t){return y(t,p)}function O(t){return y(t,d)}function I(t){return h&&y(t,f)}function k(t){return l&&y(t,m)}e.isSharedArrayBuffer=C,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},e.isGeneratorObject=function(t){return"[object Generator]"===u(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},e.isNumberObject=E,e.isStringObject=R,e.isBooleanObject=O,e.isBigIntObject=I,e.isSymbolObject=k,e.isBoxedPrimitive=function(t){return E(t)||R(t)||O(t)||I(t)||k(t)},e.isAnyArrayBuffer=function(t){return"u">typeof Uint8Array&&(S(t)||C(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},4268:function(t,e,r){var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++)r[e[i]]=Object.getOwnPropertyDescriptor(t,e[i]);return r},s=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}for(var r=1,i=arguments,n=i.length,o=String(t).replace(s,function(t){if("%%"===t)return"%";if(r>=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}}),a=i[r];r<n;a=i[++r])g(a)||!S(a)?o+=" "+a:o+=" "+l(a);return o},e.deprecate=function(t,r){if(void 0!==n.default&&!0===n.default.noDeprecation)return t;if(void 0===n.default)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.default.throwDeprecation)throw Error(r);n.default.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var o={},a=/^$/;if(n.default.env.NODE_DEBUG){var h=n.default.env.NODE_DEBUG;a=RegExp("^"+(h=h.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase())+"$","i")}function l(t,r){var i={seen:[],stylize:c};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),y(r)?i.showHidden=r:r&&e._extend(i,r),x(i.showHidden)&&(i.showHidden=!1),x(i.depth)&&(i.depth=2),x(i.colors)&&(i.colors=!1),x(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),p(i,t,i.depth)}function u(t,e){var r=l.styles[e];return r?"\x1b["+l.colors[r][0]+"m"+t+"\x1b["+l.colors[r][1]+"m":t}function c(t,e){return t}function p(t,r,i){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var n,s,o,a,h,l,u=r.inspect(i,t);return v(u)||(u=p(t,u,i)),u}var c=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),T=(h={},S.forEach(function(t,e){h[t]=!0}),h);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),_(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(A(r)){var C=r.name?": "+r.name:"";return t.stylize("[Function"+C+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return d(r)}var E="",O=!1,I=["{","}"];if(m(r)&&(O=!0,I=["[","]"]),A(r)&&(E=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(E=" "+RegExp.prototype.toString.call(r)),M(r)&&(E=" "+Date.prototype.toUTCString.call(r)),_(r)&&(E=" "+d(r)),0===S.length&&(!O||0==r.length))return I[0]+E+I[1];if(i<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),l=O?function(t,e,r,i,n){for(var s=[],o=0,a=e.length;o<a;++o)R(e,String(o))?s.push(f(t,e,r,i,String(o),!0)):s.push("");return n.forEach(function(n){n.match(/^\d+$/)||s.push(f(t,e,r,i,n,!0))}),s}(t,r,i,T,S):S.map(function(e){return f(t,r,i,T,e,O)}),t.seen.pop(),n=l,s=E,o=I,a=0,n.reduce(function(t,e){return a++,e.indexOf("\n")>=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===s?"":s+"\n ")+" "+n.join(",\n ")+" "+o[1]:o[0]+s+" "+n.join(", ")+" "+o[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,i,n,s){var o,a,h;if((h=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),R(i,n)||(o="["+n+"]"),!a&&(0>t.seen.indexOf(h.value)?(a=g(r)?p(t,h.value,null):p(t,h.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),x(o)){if(s&&n.match(/^\d+$/))return a;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function m(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function x(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===T(t)}function S(t){return"object"==typeof t&&null!==t}function M(t){return S(t)&&"[object Date]"===T(t)}function _(t){return S(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!o[t=t.toUpperCase()])if(a.test(t)){var r=n.default.pid;o[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else o[t]=function(){};return o[t]},e.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(7551),e.isArray=m,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=M,e.types.isDate=M,e.isError=_,e.types.isNativeError=_,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(3614);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[C((t=new Date).getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(1638),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var O="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e=t[O];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise(function(t,i){e=t,r=i}),n=[],s=0;s<arguments.length;s++)n.push(arguments[s]);n.push(function(t,i){t?r(t):e(i)});try{t.apply(this,n)}catch(t){r(t)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),O&&Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=O,e.callbackify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw TypeError("The last argument must be of type Function");var s=this,o=function(){return i.apply(s,arguments)};t.apply(this,e).then(function(t){n.default.nextTick(o.bind(null,null,t))},function(t){n.default.nextTick(I.bind(null,t,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},3051:function(e,r,i){"use strict";var n=i(4680),s=i(3147),o=i(2982),a=o("Object.prototype.toString"),h=i(8564)()&&"symbol"==typeof Symbol.toStringTag,l=s(),u=o("String.prototype.slice"),c={},p=i(9745),d=Object.getPrototypeOf;h&&p&&d&&n(l,function(e){if("function"==typeof t.g[e]){var r=new t.g[e];if(!(Symbol.toStringTag in r))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var i=d(r),n=p(i,Symbol.toStringTag);n||(n=p(d(i),Symbol.toStringTag)),c[e]=n.get}});var f=function(t){var e=!1;return n(c,function(r,i){if(!e)try{var n=r.call(t);n===i&&(e=n)}catch(t){}}),e},m=i(9572);e.exports=function(t){return!!m(t)&&(h?f(t):u(a(t),8,-1))}},3147:function(e,r,i){"use strict";var n=i(7492);e.exports=function(){return n(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(e){return"function"==typeof t.g[e]})}},9745:function(t,e,r){"use strict";t.exports=r(8322)}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}},i=!0;try{s[t](r,r.exports,a),i=!1}finally{i&&delete o[t]}return r.exports}a.ab="/ROOT/node_modules/next/dist/compiled/util/",e.exports=a(4268)},12569,(t,e,r)=>{var i=t.i(47167),n={638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},329:function(t){"use strict";let e={};function r(t,r,i){i||(i=Error);class n extends i{constructor(t,e,i){super(function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(t,e,i))}}n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(!Array.isArray(t))return`of ${e} ${String(t)}`;{let r=t.length;return(t=t.map(t=>String(t)),r>2)?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,s,o,a;let h,l;if("string"==typeof e&&(n="not ",e.substr(0,n.length)===n)?(h="must not be",e=e.replace(/^not /,"")):h="must be",s=" argument",(void 0===o||o>t.length)&&(o=t.length),t.substring(o-s.length,o)===s)l=`The ${t} ${h} ${i(e,"type")}`;else{let r=("number"!=typeof a&&(a=0),a+1>t.length||-1===t.indexOf(".",a))?"argument":"property";l=`The "${t}" ${r} ${h} ${i(e,"type")}`}return l+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.F=e},686:function(t,e,r){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var s=r(276),o=r(732);r(638)(u,s);for(var a=n(o.prototype),h=0;h<a.length;h++){var l=a[h];u.prototype[l]||(u.prototype[l]=o.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);s.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||i.default.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},512:function(t,e,r){"use strict";t.exports=n;var i=r(586);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(638)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},276:function(e,r,n){"use strict";e.exports=T,T.ReadableState=A,n(434).EventEmitter;var s,o,a,h,l,u=function(t,e){return t.listeners(e).length},c=n(120),p=n(181).Buffer,d=t.g.Uint8Array||function(){},f=n(23);o=f&&f.debuglog?f.debuglog("stream"):function(){};var m=n(137),y=n(528),g=n(771).getHighWaterMark,b=n(329).F,v=b.ERR_INVALID_ARG_TYPE,x=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(638)(T,c);var M=y.errorOrDestroy,_=["error","close","destroy","pause","resume"];function A(t,e,r){s=s||n(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof s),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(a||(a=n(319).I),this.decoder=new a(t.encoding),this.encoding=t.encoding)}function T(t){if(s=s||n(686),!(this instanceof T))return new T(t);var e=this instanceof s;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function C(t,e,r,i,n){o("readableAddChunk",e);var s,a,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,h);else if(n||(a=function(t,e){var r;return p.isBuffer(e)||e instanceof d||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),a)M(t,a);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===p.prototype||(s=e,e=p.from(s)),i)h.endEmitted?M(t,new S):E(t,h,e,!0);else if(h.ended)M(t,new x);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?E(t,h,e,!1):k(t,h)):E(t,h,e,!1)}else i||(h.reading=!1,k(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function E(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),k(t,e)}function R(t,e){var r;if(t<=0||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length;return(t>e.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function O(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.default.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function k(t,e){e.readingMore||(e.readingMore=!0,i.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){o("readable nexttick read 0"),t.read(0)}function z(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function U(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.default.nextTick(j,e,t))}function j(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return -1}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=p.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},T.prototype.unshift=function(t){return C(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){a||(a=n(319).I);var e=new a(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},T.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e,r=this._readableState,i=t;if(0!==t&&(r.emittedReadable=!1),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return o("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?U(this):O(this),null;if(0===(t=R(t,r))&&r.ended)return 0===r.length&&U(this),null;var n=r.needReadable;return o("need readable",n),(0===r.length||r.length-t<r.highWaterMark)&&o("length less than watermark",n=!0),r.ended||r.reading?o("reading or ended",n=!1):n&&(o("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(t=R(i,r))),null===(e=t>0?F(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&U(this)),null!==e&&this.emit("data",e),e},T.prototype._read=function(t){M(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r,n=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,o("pipe count=%d opts=%j",s.pipesCount,e);var a=e&&!1===e.end||t===i.default.stdout||t===i.default.stderr?y:h;function h(){o("onend"),t.end()}s.endEmitted?i.default.nextTick(a):n.once("end",a),t.on("unpipe",function e(r,i){o("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,o("cleanup"),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",d),t.removeListener("unpipe",e),n.removeListener("end",h),n.removeListener("end",y),n.removeListener("data",p),c=!0,s.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())});var l=(r=n,function(){var t=r._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(r,"data")&&(t.flowing=!0,N(r))});t.on("drain",l);var c=!1;function p(e){o("ondata");var r=t.write(e);o("dest.write",r),!1===r&&((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==D(s.pipes,t))&&!c&&(o("false write response, pause",s.awaitDrain),s.awaitDrain++),n.pause())}function d(e){o("onerror",e),y(),t.removeListener("error",d),0===u(t,"error")&&M(t,e)}function f(){t.removeListener("finish",m),y()}function m(){o("onfinish"),t.removeListener("close",f),y()}function y(){o("unpipe"),n.unpipe(t)}return n.on("data",p),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",f),t.once("finish",m),t.emit("pipe",n),s.flowing||(o("pipe resume"),n.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=D(e.pipes,t);return -1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==t||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.default.nextTick(L,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&i.default.nextTick(B,this),r},T.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&i.default.nextTick(B,this),e},T.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(o("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,i.default.nextTick(z,t,e))),r.paused=!1,this},T.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){o("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var s=0;s<_.length;s++)t.on(_[s],this.emit.bind(this,_[s]));return this._read=function(e){o("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=n(531)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=F,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=n(812)),l(T,t,e)})},586:function(t,e,r){"use strict";t.exports=u;var i=r(329).F,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(686);function l(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);h.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(e,r){p(t,e,r)})}function p(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}r(638)(u,h),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,r){r(new n("_transform()"))},u.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,function(t){e(t)})}},732:function(e,r,n){"use strict";function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){var r=e,i=t,n=r.entry;for(r.entry=null;n;){var s=n.callback;i.pendingcb--,s(void 0),n=n.next}i.corkedRequestsFree.next=r}}e.exports=T,T.WritableState=A;var o,a,h={deprecate:n(774)},l=n(120),u=n(181).Buffer,c=t.g.Uint8Array||function(){},p=n(528),d=n(771).getHighWaterMark,f=n(329).F,m=f.ERR_INVALID_ARG_TYPE,y=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,x=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,M=p.errorOrDestroy;function _(){}function A(t,e,r){o=o||n(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof o),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,s=r.writecb;if("function"!=typeof s)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e)--r.pendingcb,n?(i.default.nextTick(s,e),i.default.nextTick(k,t,r),t._writableState.errorEmitted=!0,M(t,e)):(s(e),t._writableState.errorEmitted=!0,M(t,e),k(t,r));else{var o=O(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?i.default.nextTick(E,t,r,o,s):E(t,r,o,s)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}n(638)(T,l),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(A.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function T(t){var e=this instanceof(o=o||n(686));if(!e&&!a.call(T,this))return new T(t);this._writableState=new A(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function C(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function E(t,e,r,i){var n,s;r||(n=t,0===(s=e).length&&s.needDrain&&(s.needDrain=!1,n.emit("drain"))),e.pendingcb--,i(),k(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(e.bufferedRequestCount),n=e.corkedRequestsFree;n.entry=r;for(var o=0,a=!0;r;)i[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;i.allBuffers=a,C(t,e,!0,e.length,i,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,u=r.callback,c=e.objectMode?1:h.length;if(C(t,e,!1,c,h,l,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final(function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=O(e);if(r&&(e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.default.nextTick(I,t,e))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===T&&t&&t._writableState instanceof A}})):a=function(t){return t instanceof this},T.prototype.pipe=function(){M(this,new b)},T.prototype.write=function(t,e,r){var n,s,o,a,h,l,p,d=this._writableState,f=!1,y=!d.objectMode&&(n=t,u.isBuffer(n)||n instanceof c);return(y&&!u.isBuffer(t)&&(s=t,t=u.from(s)),"function"==typeof e&&(r=e,e=null),y?e="buffer":e||(e=d.defaultEncoding),"function"!=typeof r&&(r=_),d.ending)?(o=r,M(this,a=new w),i.default.nextTick(o,a)):(y||(h=t,l=r,null===h?p=new x:"string"==typeof h||d.objectMode||(p=new m("chunk",["string","Buffer"],h)),!p||(M(this,p),i.default.nextTick(l,p),0)))&&(d.pendingcb++,f=function(t,e,r,i,n,s){if(!r){var o,a,h=(o=i,a=n,e.objectMode||!1===e.decodeStrings||"string"!=typeof o||(o=u.from(o,a)),o);i!==h&&(r=!0,n="buffer",i=h)}var l=e.objectMode?1:i.length;e.length+=l;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var p=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},p?p.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,l,i,n,s);return c}(this,d,y,t,e,r)),f},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n,s,o,a=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),a.corked&&(a.corked=1,this.uncork()),a.ending||(n=this,s=a,o=r,s.ending=!0,k(n,s),o&&(s.finished?i.default.nextTick(o):n.once("finish",o)),s.ended=!0,n.writable=!1),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)}},531:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s,o=r(134),a=Symbol("lastResolve"),h=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),p=Symbol("handlePromise"),d=Symbol("stream");function f(t,e){return{value:t,done:e}}function m(t){var e=t[a];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[a]=null,t[h]=null,e(f(r,!1)))}}function y(t){i.default.nextTick(m,t)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((n(s={get stream(){return this[d]},next:function(){var t,e,r=this,n=this[l];if(null!==n)return Promise.reject(n);if(this[u])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){i.default.nextTick(function(){r[l]?e(r[l]):t(f(void 0,!0))})});var s=this[c];if(s)e=new Promise((t=this,function(e,r){s.then(function(){t[u]?e(f(void 0,!0)):t[p](e,r)},r)}));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(o,!1));e=new Promise(this[p])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),n(s,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){t?r(t):e(f(void 0,!0))})})}),s),g);t.exports=function(t){var e,r=Object.create(b,(n(e={},d,{value:t,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,h,{value:null,writable:!0}),n(e,l,{value:null,writable:!0}),n(e,u,{value:t._readableState.endEmitted,writable:!0}),n(e,p,{value:function(t,e){var i=r[d].read();i?(r[c]=null,r[a]=null,r[h]=null,t(f(i,!1))):(r[a]=t,r[h]=e)},writable:!0}),e));return r[c]=null,o(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[h];null!==e&&(r[c]=null,r[a]=null,r[h]=null,e(t)),r[l]=t;return}var i=r[a];null!==i&&(r[c]=null,r[a]=null,r[h]=null,i(f(void 0,!0))),r[u]=!0}),t.on("readable",y.bind(null,r)),r}},137:function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var n=r(181).Buffer,s=r(23).inspect,o=s&&s.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return n.alloc(0);for(var e,r,i=n.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=s.data,r=o,n.prototype.copy.call(e,i,r),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,s=t>n.length?n.length:t;if(s===n.length?i+=n:i+=n.slice(0,t),0==(t-=s)){s===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=n.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(s.copy(e,e.length-t,0,o),0==(t-=o)){o===s.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=s.slice(o));break}++i}return this.length-=i,e}},{key:o,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){var i,n,s;i=t,n=e,s=r[e],n in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e,{depth:0,customInspect:!1}))}}],function(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(e.prototype,t),e}()},528:function(t){"use strict";function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||(!t._readableState||t._readableState.emitClose)&&t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,s){var o=this,a=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return a||h?s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.default.nextTick(n,this,t)):i.default.nextTick(n,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!s&&t?o._writableState?o._writableState.errorEmitted?i.default.nextTick(r,o):(o._writableState.errorEmitted=!0,i.default.nextTick(e,o,t)):i.default.nextTick(e,o,t):s?(i.default.nextTick(r,o),s(t)):i.default.nextTick(r,o)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},134:function(t,e,r){"use strict";var i=r(329).F.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),o=s||n,a=!1,s=function(){if(!a){a=!0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e)}};var o,a,h=r.readable||!1!==r.readable&&e.readable,l=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||p()},c=e._writableState&&e._writableState.finished,p=function(){l=!1,c=!0,h||s.call(e)},d=e._readableState&&e._readableState.endEmitted,f=function(){h=!1,d=!0,l||s.call(e)},m=function(t){s.call(e,t)},y=function(){var t;return h&&!d?(e._readableState&&e._readableState.ended||(t=new i),s.call(e,t)):l&&!c?(e._writableState&&e._writableState.ended||(t=new i),s.call(e,t)):void 0},g=function(){e.req.on("finish",p)};return e.setHeader&&"function"==typeof e.abort?(e.on("complete",p),e.on("abort",y),e.req?g():e.on("request",g)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",f),e.on("finish",p),!1!==r.error&&e.on("error",m),e.on("close",y),function(){e.removeListener("complete",p),e.removeListener("abort",y),e.removeListener("request",g),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",y)}}},812:function(t,e,r){"use strict";function i(t,e,r,i,n,s,o){try{var a=t[s](o),h=a.value}catch(t){r(t);return}a.done?e(h):Promise.resolve(h).then(i,n)}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var s=r(329).F.ERR_INVALID_ARG_TYPE;t.exports=function(t,e,r){if(e&&"function"==typeof e.next)o=e;else if(e&&e[Symbol.asyncIterator])o=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])o=e[Symbol.iterator]();else throw new s("iterable",["Iterable"],e);var o,a=new t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){var i,n,s;i=t,n=e,s=r[e],n in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({objectMode:!0},r)),h=!1;function l(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var t=yield o.next(),e=t.value;t.done?a.push(null):a.push((yield e))?l():h=!1}catch(t){a.destroy(t)}},(u=function(){var e=this,r=arguments;return new Promise(function(n,s){var o=t.apply(e,r);function a(t){i(o,n,s,a,h,"next",t)}function h(t){i(o,n,s,a,h,"throw",t)}a(void 0)})}).apply(this,arguments)}return a._read=function(){h||(h=!0,l())},a}},694:function(t,e,r){"use strict";var i,n=r(329).F,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function h(t){t()}function l(t,e){return t.pipe(e)}t.exports=function(){for(var t,e,n=arguments.length,u=Array(n),c=0;c<n;c++)u[c]=arguments[c];var p=(t=u).length&&"function"==typeof t[t.length-1]?t.pop():a;if(Array.isArray(u[0])&&(u=u[0]),u.length<2)throw new s("streams");var d=u.map(function(t,n){var s,a,l,c,f,m,y=n<u.length-1;return s=n>0,l=a=function(t){e||(e=t),t&&d.forEach(h),y||(d.forEach(h),p(e))},c=!1,a=function(){c||(c=!0,l.apply(void 0,arguments))},f=!1,t.on("close",function(){f=!0}),void 0===i&&(i=r(134)),i(t,{readable:y,writable:s},function(t){if(t)return a(t);f=!0,a()}),m=!1,function(e){if(!f&&!m){if(m=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();a(e||new o("pipe"))}}});return u.reduce(l)}},771:function(t,e,r){"use strict";var i=r(329).F.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var s=null!=e.highWaterMark?e.highWaterMark:n?e[r]:null;if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},120:function(t,e,r){t.exports=r(203)},56:function(t,e,r){var i=r(181),n=i.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(s(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},854:function(t,e,r){t.exports=n;var i=r(434).EventEmitter;function n(){i.call(this)}r(638)(n,i),n.Readable=r(276),n.Writable=r(732),n.Duplex=r(686),n.Transform=r(586),n.PassThrough=r(512),n.finished=r(134),n.pipeline=r(694),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",h));var o=!1;function a(){o||(o=!0,t.end())}function h(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",n),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",l),t.on("error",l),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},319:function(t,e,r){"use strict";var i=r(56).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=l,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=u,this.end=c,e=3;break;default:this.write=p,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.I=s,s.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=o(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},774:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},181:function(e){"use strict";e.exports=t.r(43943)},434:function(e){"use strict";e.exports=t.r(30662)},203:function(e){"use strict";e.exports=t.r(30662).EventEmitter},23:function(e){"use strict";e.exports=t.r(77398)}},s={};function o(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}},i=!0;try{n[t](r,r.exports,o),i=!1}finally{i&&delete s[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=o(854)},43954,(t,e,r)=>{!function(){"use strict";var t={922:function(t){t.exports=function(t,r,i,n){r=r||"&",i=i||"=";var s={};if("string"!=typeof t||0===t.length)return s;var o=/\+/g;t=t.split(r);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var h=t.length;a>0&&h>a&&(h=a);for(var l=0;l<h;++l){var u,c,p,d,f=t[l].replace(o,"%20"),m=f.indexOf(i);(m>=0?(u=f.substr(0,m),c=f.substr(m+1)):(u=f,c=""),p=decodeURIComponent(u),d=decodeURIComponent(c),Object.prototype.hasOwnProperty.call(s,p))?e(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},790:function(t){var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,s,o,a){return(s=s||"&",o=o||"=",null===t&&(t=void 0),"object"==typeof t)?i(n(t),function(n){var a=encodeURIComponent(e(n))+o;return r(t[n])?i(t[n],function(t){return a+encodeURIComponent(e(t))}).join(s):a+encodeURIComponent(e(t[n]))}).join(s):a?encodeURIComponent(e(a))+o+encodeURIComponent(e(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}var n=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var s=r[e]={exports:{}},o=!0;try{t[e](s,s.exports,i),o=!1}finally{o&&delete r[e]}return s.exports}i.ab="/ROOT/node_modules/next/dist/compiled/querystring-es3/";var n={};n.decode=n.parse=i(922),n.encode=n.stringify=i(790),e.exports=n}()},21342,(t,e,r)=>{var i={221:function(e){"use strict";e.exports=t.r(43954)}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}},o=!0;try{i[t](r,r.exports,s),o=!1}finally{o&&delete n[t]}return r.exports}s.ab="/ROOT/node_modules/next/dist/compiled/native-url/";var o={};!function(){var t,e=(t=s(221))&&"object"==typeof t&&"default"in t?t.default:t,r=/https?|ftp|gopher|file/;function i(t){"string"==typeof t&&(t=g(t));var i,n,s,o,a,h,l,u,c,p=(n=(i=t).auth,s=i.hostname,o=i.protocol||"",a=i.pathname||"",h=i.hash||"",l=i.query||"",u=!1,n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",i.host?u=n+i.host:s&&(u=n+(~s.indexOf(":")?"["+s+"]":s),i.port&&(u+=":"+i.port)),l&&"object"==typeof l&&(l=e.encode(l)),c=i.search||l&&"?"+l||"",o&&":"!==o.substr(-1)&&(o+=":"),i.slashes||(!o||r.test(o))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),h&&"#"!==h[0]&&(h="#"+h),c&&"?"!==c[0]&&(c="?"+c),{protocol:o,host:u,pathname:a=a.replace(/[?#]/g,encodeURIComponent),search:c=c.replace("#","%23"),hash:h});return""+p.protocol+p.host+p.pathname+p.search+p.hash}var n="http://",a=n+"w.w",h=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,l=/https?|ftp|gopher|file/;function u(t,e){var r="string"==typeof t?g(t):t;t="object"==typeof t?i(t):t;var s=g(e),o="";r.protocol&&!r.slashes&&(o=r.protocol,t=t.replace(r.protocol,""),o+="/"===e[0]||"/"===t[0]?"/":""),o&&s.protocol&&(o="",s.slashes||(o=s.protocol,e=e.replace(s.protocol,"")));var u=t.match(h);u&&!s.protocol&&(t=t.substr((o=u[1]+(u[2]||"")).length),/^\/\/[^/]/.test(e)&&(o=o.slice(0,-1)));var c=new URL(t,a+"/"),p=new URL(e,c).toString().replace(a,""),d=s.protocol||r.protocol;return d+=r.slashes||s.slashes?"//":"",!o&&d?p=p.replace(n,d):o&&(p=p.replace(n,"")),l.test(p)||~e.indexOf(".")||"/"===t.slice(-1)||"/"===e.slice(-1)||"/"!==p.slice(-1)||(p=p.slice(0,-1)),o&&(p=o+("/"===p[0]?p.substr(1):p)),p}function c(){}c.prototype.parse=g,c.prototype.format=i,c.prototype.resolve=u,c.prototype.resolveObject=u;var p=/^https?|ftp|gopher|file/,d=/^(.*?)([#?].*)/,f=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,y=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function g(t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),t&&"object"==typeof t&&t instanceof c)return t;var s=(t=t.trim()).match(d);t=s?s[1].replace(/\\/g,"/")+s[2]:t.replace(/\\/g,"/"),y.test(t)&&"/"!==t.slice(-1)&&(t+="/");var o=!/(^javascript)/.test(t)&&t.match(f),h=m.test(t),l="";o&&(p.test(o[1])||(l=o[1].toLowerCase(),t=""+o[2]+o[3]),o[2]||(h=!1,p.test(o[1])?(l=o[1],t=""+o[3]):t="//"+o[3]),3!==o[2].length&&1!==o[2].length||(l=o[1],t="/"+o[3]));var u,g=(s?s[1]:t).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),b=g&&g[1],v=new c,x="",w="";try{u=new URL(t)}catch(e){x=e,l||n||!/^\/\//.test(t)||/^\/\/.+[@.]/.test(t)||(w="/",t=t.substr(1));try{u=new URL(t,a)}catch(t){return v.protocol=l,v.href=l,v}}v.slashes=h&&!w,v.host="w.w"===u.host?"":u.host,v.hostname="w.w"===u.hostname?"":u.hostname.replace(/(\[|\])/g,""),v.protocol=x?l||null:u.protocol,v.search=u.search.replace(/\\/g,"%5C"),v.hash=u.hash.replace(/\\/g,"%5C");var S=t.split("#");!v.search&&~S[0].indexOf("?")&&(v.search="?"),v.hash||""!==S[1]||(v.hash="#"),v.query=r?e.decode(u.search.substr(1)):v.search.substr(1),v.pathname=w+(o?u.pathname.replace(/['^|`]/g,function(t){return"%"+t.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(t,e){try{return decodeURIComponent(e).split("").map(function(t){var e=t.charCodeAt();return e>256||/^[a-z0-9]$/i.test(t)?t:"%"+e.toString(16).toUpperCase()}).join("")}catch(t){return e}}):u.pathname),"about:"===v.protocol&&"blank"===v.pathname&&(v.protocol="",v.pathname=""),x&&"/"!==t[0]&&(v.pathname=v.pathname.substr(1)),l&&!p.test(l)&&"/"!==t.slice(-1)&&"/"===v.pathname&&(v.pathname=""),v.path=v.pathname+v.search,v.auth=[u.username,u.password].map(decodeURIComponent).filter(Boolean).join(":"),v.port=u.port,b&&!v.host.endsWith(b)&&(v.host+=b,v.port=b.slice(1)),v.href=w?""+v.pathname+v.search+v.hash:i(v);var M=/^(file)/.test(v.href)?["host","hostname"]:[];return Object.keys(v).forEach(function(t){~M.indexOf(t)||(v[t]=v[t]||null)}),v}o.parse=g,o.format=i,o.resolve=u,o.resolveObject=function(t,e){return g(u(t,e))},o.Url=c}(),e.exports=o},22184,(t,e,r)=>{var i=t.i(47167),n=t.i(67034),s={514:function(t){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},329:function(t){"use strict";let e={};function r(t,r,i){i||(i=Error);class n extends i{constructor(t,e,i){super(function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(t,e,i))}}n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(!Array.isArray(t))return`of ${e} ${String(t)}`;{let r=t.length;return(t=t.map(t=>String(t)),r>2)?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,s,o,a;let h,l;if("string"==typeof e&&(n="not ",e.substr(0,n.length)===n)?(h="must not be",e=e.replace(/^not /,"")):h="must be",s=" argument",(void 0===o||o>t.length)&&(o=t.length),t.substring(o-s.length,o)===s)l=`The ${t} ${h} ${i(e,"type")}`;else{let r=("number"!=typeof a&&(a=0),a+1>t.length||-1===t.indexOf(".",a))?"argument":"property";l=`The "${t}" ${r} ${h} ${i(e,"type")}`}return l+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.F=e},686:function(t,e,r){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var s=r(276),o=r(732);r(638)(u,s);for(var a=n(o.prototype),h=0;h<a.length;h++){var l=a[h];u.prototype[l]||(u.prototype[l]=o.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);s.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||i.default.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},512:function(t,e,r){"use strict";t.exports=n;var i=r(586);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(638)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},276:function(e,r,n){"use strict";e.exports=T,T.ReadableState=A,n(434).EventEmitter;var s,o,a,h,l,u=function(t,e){return t.listeners(e).length},c=n(120),p=n(181).Buffer,d=t.g.Uint8Array||function(){},f=n(23);o=f&&f.debuglog?f.debuglog("stream"):function(){};var m=n(137),y=n(528),g=n(771).getHighWaterMark,b=n(329).F,v=b.ERR_INVALID_ARG_TYPE,x=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(638)(T,c);var M=y.errorOrDestroy,_=["error","close","destroy","pause","resume"];function A(t,e,r){s=s||n(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof s),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(a||(a=n(319).I),this.decoder=new a(t.encoding),this.encoding=t.encoding)}function T(t){if(s=s||n(686),!(this instanceof T))return new T(t);var e=this instanceof s;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function C(t,e,r,i,n){o("readableAddChunk",e);var s,a,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,h);else if(n||(a=function(t,e){var r;return p.isBuffer(e)||e instanceof d||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),a)M(t,a);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===p.prototype||(s=e,e=p.from(s)),i)h.endEmitted?M(t,new S):E(t,h,e,!0);else if(h.ended)M(t,new x);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?E(t,h,e,!1):k(t,h)):E(t,h,e,!1)}else i||(h.reading=!1,k(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function E(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),k(t,e)}function R(t,e){var r;if(t<=0||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length;return(t>e.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function O(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.default.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function k(t,e){e.readingMore||(e.readingMore=!0,i.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){o("readable nexttick read 0"),t.read(0)}function z(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function U(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.default.nextTick(j,e,t))}function j(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return -1}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=p.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},T.prototype.unshift=function(t){return C(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){a||(a=n(319).I);var e=new a(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},T.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e,r=this._readableState,i=t;if(0!==t&&(r.emittedReadable=!1),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return o("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?U(this):O(this),null;if(0===(t=R(t,r))&&r.ended)return 0===r.length&&U(this),null;var n=r.needReadable;return o("need readable",n),(0===r.length||r.length-t<r.highWaterMark)&&o("length less than watermark",n=!0),r.ended||r.reading?o("reading or ended",n=!1):n&&(o("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(t=R(i,r))),null===(e=t>0?F(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&U(this)),null!==e&&this.emit("data",e),e},T.prototype._read=function(t){M(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r,n=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,o("pipe count=%d opts=%j",s.pipesCount,e);var a=e&&!1===e.end||t===i.default.stdout||t===i.default.stderr?y:h;function h(){o("onend"),t.end()}s.endEmitted?i.default.nextTick(a):n.once("end",a),t.on("unpipe",function e(r,i){o("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,o("cleanup"),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",d),t.removeListener("unpipe",e),n.removeListener("end",h),n.removeListener("end",y),n.removeListener("data",p),c=!0,s.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())});var l=(r=n,function(){var t=r._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(r,"data")&&(t.flowing=!0,N(r))});t.on("drain",l);var c=!1;function p(e){o("ondata");var r=t.write(e);o("dest.write",r),!1===r&&((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==D(s.pipes,t))&&!c&&(o("false write response, pause",s.awaitDrain),s.awaitDrain++),n.pause())}function d(e){o("onerror",e),y(),t.removeListener("error",d),0===u(t,"error")&&M(t,e)}function f(){t.removeListener("finish",m),y()}function m(){o("onfinish"),t.removeListener("close",f),y()}function y(){o("unpipe"),n.unpipe(t)}return n.on("data",p),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",f),t.once("finish",m),t.emit("pipe",n),s.flowing||(o("pipe resume"),n.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=D(e.pipes,t);return -1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==t||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.default.nextTick(L,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&i.default.nextTick(B,this),r},T.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&i.default.nextTick(B,this),e},T.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(o("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,i.default.nextTick(z,t,e))),r.paused=!1,this},T.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){o("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var s=0;s<_.length;s++)t.on(_[s],this.emit.bind(this,_[s]));return this._read=function(e){o("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=n(531)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=F,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=n(812)),l(T,t,e)})},586:function(t,e,r){"use strict";t.exports=u;var i=r(329).F,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(686);function l(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);h.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(e,r){p(t,e,r)})}function p(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}r(638)(u,h),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,r){r(new n("_transform()"))},u.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,function(t){e(t)})}},732:function(e,r,n){"use strict";function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){var r=e,i=t,n=r.entry;for(r.entry=null;n;){var s=n.callback;i.pendingcb--,s(void 0),n=n.next}i.corkedRequestsFree.next=r}}e.exports=T,T.WritableState=A;var o,a,h={deprecate:n(774)},l=n(120),u=n(181).Buffer,c=t.g.Uint8Array||function(){},p=n(528),d=n(771).getHighWaterMark,f=n(329).F,m=f.ERR_INVALID_ARG_TYPE,y=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,x=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,M=p.errorOrDestroy;function _(){}function A(t,e,r){o=o||n(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof o),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,s=r.writecb;if("function"!=typeof s)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e)--r.pendingcb,n?(i.default.nextTick(s,e),i.default.nextTick(k,t,r),t._writableState.errorEmitted=!0,M(t,e)):(s(e),t._writableState.errorEmitted=!0,M(t,e),k(t,r));else{var o=O(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?i.default.nextTick(E,t,r,o,s):E(t,r,o,s)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}n(638)(T,l),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(A.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function T(t){var e=this instanceof(o=o||n(686));if(!e&&!a.call(T,this))return new T(t);this._writableState=new A(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function C(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function E(t,e,r,i){var n,s;r||(n=t,0===(s=e).length&&s.needDrain&&(s.needDrain=!1,n.emit("drain"))),e.pendingcb--,i(),k(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(e.bufferedRequestCount),n=e.corkedRequestsFree;n.entry=r;for(var o=0,a=!0;r;)i[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;i.allBuffers=a,C(t,e,!0,e.length,i,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,u=r.callback,c=e.objectMode?1:h.length;if(C(t,e,!1,c,h,l,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final(function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=O(e);if(r&&(e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.default.nextTick(I,t,e))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===T&&t&&t._writableState instanceof A}})):a=function(t){return t instanceof this},T.prototype.pipe=function(){M(this,new b)},T.prototype.write=function(t,e,r){var n,s,o,a,h,l,p,d=this._writableState,f=!1,y=!d.objectMode&&(n=t,u.isBuffer(n)||n instanceof c);return(y&&!u.isBuffer(t)&&(s=t,t=u.from(s)),"function"==typeof e&&(r=e,e=null),y?e="buffer":e||(e=d.defaultEncoding),"function"!=typeof r&&(r=_),d.ending)?(o=r,M(this,a=new w),i.default.nextTick(o,a)):(y||(h=t,l=r,null===h?p=new x:"string"==typeof h||d.objectMode||(p=new m("chunk",["string","Buffer"],h)),!p||(M(this,p),i.default.nextTick(l,p),0)))&&(d.pendingcb++,f=function(t,e,r,i,n,s){if(!r){var o,a,h=(o=i,a=n,e.objectMode||!1===e.decodeStrings||"string"!=typeof o||(o=u.from(o,a)),o);i!==h&&(r=!0,n="buffer",i=h)}var l=e.objectMode?1:i.length;e.length+=l;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var p=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},p?p.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,l,i,n,s);return c}(this,d,y,t,e,r)),f},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n,s,o,a=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),a.corked&&(a.corked=1,this.uncork()),a.ending||(n=this,s=a,o=r,s.ending=!0,k(n,s),o&&(s.finished?i.default.nextTick(o):n.once("finish",o)),s.ended=!0,n.writable=!1),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)}},531:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s,o=r(134),a=Symbol("lastResolve"),h=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),p=Symbol("handlePromise"),d=Symbol("stream");function f(t,e){return{value:t,done:e}}function m(t){var e=t[a];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[a]=null,t[h]=null,e(f(r,!1)))}}function y(t){i.default.nextTick(m,t)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((n(s={get stream(){return this[d]},next:function(){var t,e,r=this,n=this[l];if(null!==n)return Promise.reject(n);if(this[u])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){i.default.nextTick(function(){r[l]?e(r[l]):t(f(void 0,!0))})});var s=this[c];if(s)e=new Promise((t=this,function(e,r){s.then(function(){t[u]?e(f(void 0,!0)):t[p](e,r)},r)}));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(o,!1));e=new Promise(this[p])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),n(s,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){t?r(t):e(f(void 0,!0))})})}),s),g);t.exports=function(t){var e,r=Object.create(b,(n(e={},d,{value:t,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,h,{value:null,writable:!0}),n(e,l,{value:null,writable:!0}),n(e,u,{value:t._readableState.endEmitted,writable:!0}),n(e,p,{value:function(t,e){var i=r[d].read();i?(r[c]=null,r[a]=null,r[h]=null,t(f(i,!1))):(r[a]=t,r[h]=e)},writable:!0}),e));return r[c]=null,o(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[h];null!==e&&(r[c]=null,r[a]=null,r[h]=null,e(t)),r[l]=t;return}var i=r[a];null!==i&&(r[c]=null,r[a]=null,r[h]=null,i(f(void 0,!0))),r[u]=!0}),t.on("readable",y.bind(null,r)),r}},137:function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var n=r(181).Buffer,s=r(23).inspect,o=s&&s.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return n.alloc(0);for(var e,r,i=n.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=s.data,r=o,n.prototype.copy.call(e,i,r),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,s=t>n.length?n.length:t;if(s===n.length?i+=n:i+=n.slice(0,t),0==(t-=s)){s===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=n.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(s.copy(e,e.length-t,0,o),0==(t-=o)){o===s.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=s.slice(o));break}++i}return this.length-=i,e}},{key:o,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){var i,n,s;i=t,n=e,s=r[e],n in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e,{depth:0,customInspect:!1}))}}],function(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(e.prototype,t),e}()},528:function(t){"use strict";function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||(!t._readableState||t._readableState.emitClose)&&t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,s){var o=this,a=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return a||h?s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.default.nextTick(n,this,t)):i.default.nextTick(n,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!s&&t?o._writableState?o._writableState.errorEmitted?i.default.nextTick(r,o):(o._writableState.errorEmitted=!0,i.default.nextTick(e,o,t)):i.default.nextTick(e,o,t):s?(i.default.nextTick(r,o),s(t)):i.default.nextTick(r,o)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},134:function(t,e,r){"use strict";var i=r(329).F.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),o=s||n,a=!1,s=function(){if(!a){a=!0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e)}};var o,a,h=r.readable||!1!==r.readable&&e.readable,l=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||p()},c=e._writableState&&e._writableState.finished,p=function(){l=!1,c=!0,h||s.call(e)},d=e._readableState&&e._readableState.endEmitted,f=function(){h=!1,d=!0,l||s.call(e)},m=function(t){s.call(e,t)},y=function(){var t;return h&&!d?(e._readableState&&e._readableState.ended||(t=new i),s.call(e,t)):l&&!c?(e._writableState&&e._writableState.ended||(t=new i),s.call(e,t)):void 0},g=function(){e.req.on("finish",p)};return e.setHeader&&"function"==typeof e.abort?(e.on("complete",p),e.on("abort",y),e.req?g():e.on("request",g)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",f),e.on("finish",p),!1!==r.error&&e.on("error",m),e.on("close",y),function(){e.removeListener("complete",p),e.removeListener("abort",y),e.removeListener("request",g),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",y)}}},812:function(t,e,r){"use strict";function i(t,e,r,i,n,s,o){try{var a=t[s](o),h=a.value}catch(t){r(t);return}a.done?e(h):Promise.resolve(h).then(i,n)}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var s=r(329).F.ERR_INVALID_ARG_TYPE;t.exports=function(t,e,r){if(e&&"function"==typeof e.next)o=e;else if(e&&e[Symbol.asyncIterator])o=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])o=e[Symbol.iterator]();else throw new s("iterable",["Iterable"],e);var o,a=new t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){var i,n,s;i=t,n=e,s=r[e],n in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({objectMode:!0},r)),h=!1;function l(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var t=yield o.next(),e=t.value;t.done?a.push(null):a.push((yield e))?l():h=!1}catch(t){a.destroy(t)}},(u=function(){var e=this,r=arguments;return new Promise(function(n,s){var o=t.apply(e,r);function a(t){i(o,n,s,a,h,"next",t)}function h(t){i(o,n,s,a,h,"throw",t)}a(void 0)})}).apply(this,arguments)}return a._read=function(){h||(h=!0,l())},a}},694:function(t,e,r){"use strict";var i,n=r(329).F,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function h(t){t()}function l(t,e){return t.pipe(e)}t.exports=function(){for(var t,e,n=arguments.length,u=Array(n),c=0;c<n;c++)u[c]=arguments[c];var p=(t=u).length&&"function"==typeof t[t.length-1]?t.pop():a;if(Array.isArray(u[0])&&(u=u[0]),u.length<2)throw new s("streams");var d=u.map(function(t,n){var s,a,l,c,f,m,y=n<u.length-1;return s=n>0,l=a=function(t){e||(e=t),t&&d.forEach(h),y||(d.forEach(h),p(e))},c=!1,a=function(){c||(c=!0,l.apply(void 0,arguments))},f=!1,t.on("close",function(){f=!0}),void 0===i&&(i=r(134)),i(t,{readable:y,writable:s},function(t){if(t)return a(t);f=!0,a()}),m=!1,function(e){if(!f&&!m){if(m=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();a(e||new o("pipe"))}}});return u.reduce(l)}},771:function(t,e,r){"use strict";var i=r(329).F.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var s=null!=e.highWaterMark?e.highWaterMark:n?e[r]:null;if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},120:function(t,e,r){t.exports=r(203)},486:function(t,e,r){var n=r(203);"disable"===i.default.env.READABLE_STREAM&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):((e=t.exports=r(276)).Stream=n||e,e.Readable=e,e.Writable=r(732),e.Duplex=r(686),e.Transform=r(586),e.PassThrough=r(512),e.finished=r(134),e.pipeline=r(694))},56:function(t,e,r){var i=r(181),n=i.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(s(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},534:function(e,r,i){var n=i(291),s=i(935),o=i(663),a=i(514),h=i(16);r.request=function(e,r){e="string"==typeof e?h.parse(e):o(e);var i=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||i,a=e.hostname||e.host,l=e.port,u=e.path||"/";a&&-1!==a.indexOf(":")&&(a="["+a+"]"),e.url=(a?s+"//"+a:"")+(l?":"+l:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new n(e);return r&&c.on("response",r),c},r.get=function(t,e){var i=r.request(t,e);return i.end(),i},r.ClientRequest=n,r.IncomingMessage=s.IncomingMessage,r.Agent=function(){},r.Agent.defaultMaxSockets=4,r.globalAgent=new r.Agent,r.STATUS_CODES=a,r.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},102:function(e,r){var i;function n(){if(void 0!==i)return i;if(t.g.XMLHttpRequest){i=new t.g.XMLHttpRequest;try{i.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(t){i=null}}else i=null;return i}function s(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function o(t){return"function"==typeof t}r.fetch=o(t.g.fetch)&&o(t.g.ReadableStream),r.writableStream=o(t.g.WritableStream),r.abortController=o(t.g.AbortController),r.arraybuffer=r.fetch||s("arraybuffer"),r.msstream=!r.fetch&&s("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&s("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&o(n().overrideMimeType),i=null},291:function(e,r,s){var o=s(102),a=s(638),h=s(935),l=s(486),u=h.IncomingMessage,c=h.readyStates,p=e.exports=function(t){var e,r,i,s=this;l.Writable.call(s),s._opts=t,s._body=[],s._headers={},t.auth&&s.setHeader("Authorization","Basic "+n.Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){s.setHeader(e,t.headers[e])});var a=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)a=!1,i=!0;else if("prefer-streaming"===t.mode)i=!1;else if("allow-wrong-content-type"===t.mode)i=!o.overrideMimeType;else if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw Error("Invalid value for opts.mode");else i=!0;e=i,r=a,s._mode=o.fetch&&r?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":"text",s._fetchTimer=null,s.on("finish",function(){s._onFinish()})};a(p,l.Writable),p.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:t,value:e})},p.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},p.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},p.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts,n=e._headers,s=null;"GET"!==r.method&&"HEAD"!==r.method&&(s=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var a=[];if(Object.keys(n).forEach(function(t){var e=n[t].name,r=n[t].value;Array.isArray(r)?r.forEach(function(t){a.push([e,t])}):a.push([e,r])}),"fetch"===e._mode){var h=null;if(o.abortController){var l=new AbortController;h=l.signal,e._fetchAbortController=l,"requestTimeout"in r&&0!==r.requestTimeout&&(e._fetchTimer=t.g.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},r.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:a,body:s||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:h}).then(function(t){e._fetchResponse=t,e._connect()},function(r){t.g.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",r)})}else{var u=e._xhr=new t.g.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){i.default.nextTick(function(){e.emit("error",t)});return}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(u.timeout=r.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),a.forEach(function(t){u.setRequestHeader(t[0],t[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",Error("XHR error"))};try{u.send(s)}catch(t){i.default.nextTick(function(){e.emit("error",t)});return}}}},p.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},p.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},p.prototype._write=function(t,e,r){this._body.push(t),r()},p.prototype.abort=p.prototype.destroy=function(){this._destroyed=!0,t.g.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},p.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),l.Writable.prototype.end.call(this,t,e,r)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},935:function(e,r,s){var o=s(102),a=s(638),h=s(486),l=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=r.IncomingMessage=function(e,r,s,a){var l=this;if(h.Readable.call(l),l._mode=s,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){i.default.nextTick(function(){l.emit("close")})}),"fetch"===s){if(l._fetchResponse=r,l.url=r.url,l.statusCode=r.status,l.statusMessage=r.statusText,r.headers.forEach(function(t,e){l.headers[e.toLowerCase()]=t,l.rawHeaders.push(e,t)}),o.writableStream){var u=new WritableStream({write:function(t){return new Promise(function(e,r){l._destroyed?r():l.push(n.Buffer.from(t))?e():l._resumeFetch=e})},close:function(){t.g.clearTimeout(a),l._destroyed||l.push(null)},abort:function(t){l._destroyed||l.emit("error",t)}});try{r.body.pipeTo(u).catch(function(e){t.g.clearTimeout(a),l._destroyed||l.emit("error",e)});return}catch(t){}}var c=r.body.getReader();!function e(){c.read().then(function(r){if(!l._destroyed){if(r.done){t.g.clearTimeout(a),l.push(null);return}l.push(n.Buffer.from(r.value)),e()}}).catch(function(e){t.g.clearTimeout(a),l._destroyed||l.emit("error",e)})}()}else if(l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===l.headers[r]&&(l.headers[r]=[]),l.headers[r].push(e[2])):void 0!==l.headers[r]?l.headers[r]+=", "+e[2]:l.headers[r]=e[2],l.rawHeaders.push(e[1],e[2])}}),l._charset="x-user-defined",!o.overrideMimeType){var p=l.rawHeaders["mime-type"];if(p){var d=p.match(/;\s*charset=([^;])(;|$)/);d&&(l._charset=d[1].toLowerCase())}l._charset||(l._charset="utf-8")}};a(u,h.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if((i=r.responseText).length>e._pos){var s=i.substr(e._pos);if("x-user-defined"===e._charset){for(var o=n.Buffer.alloc(s.length),a=0;a<s.length;a++)o[a]=255&s.charCodeAt(a);e.push(o)}else e.push(s,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==l.DONE||!r.response)break;i=r.response,e.push(n.Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==l.LOADING||!i)break;e.push(n.Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==l.LOADING)break;var h=new t.g.MSStreamReader;h.onprogress=function(){h.result.byteLength>e._pos&&(e.push(n.Buffer.from(new Uint8Array(h.result.slice(e._pos)))),e._pos=h.result.byteLength)},h.onload=function(){e.push(null)},h.readAsArrayBuffer(i)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&e.push(null)}},319:function(t,e,r){"use strict";var i=r(56).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=l,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=u,this.end=c,e=3;break;default:this.write=p,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.I=s,s.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=o(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},774:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},663:function(t){t.exports=function(){for(var t={},r=0;r<arguments.length;r++){var i=arguments[r];for(var n in i)e.call(i,n)&&(t[n]=i[n])}return t};var e=Object.prototype.hasOwnProperty},181:function(e){"use strict";e.exports=t.r(43943)},434:function(e){"use strict";e.exports=t.r(30662)},203:function(e){"use strict";e.exports=t.r(12569)},16:function(e){"use strict";e.exports=t.r(21342)},23:function(e){"use strict";e.exports=t.r(77398)}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}},i=!0;try{s[t](r,r.exports,a),i=!1}finally{i&&delete o[t]}return r.exports}a.ab="/ROOT/node_modules/next/dist/compiled/stream-http/",e.exports=a(534)},92542,(t,e,r)=>{var i={572:function(t,e,r){var i=r(611),n=r(16),s=t.exports;for(var o in i)i.hasOwnProperty(o)&&(s[o]=i[o]);function a(t){if("string"==typeof t&&(t=n.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}s.request=function(t,e){return t=a(t),i.request.call(this,t,e)},s.get=function(t,e){return t=a(t),i.get.call(this,t,e)}},611:function(e){"use strict";e.exports=t.r(22184)},16:function(e){"use strict";e.exports=t.r(21342)}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}},o=!0;try{i[t](r,r.exports,s),o=!1}finally{o&&delete n[t]}return r.exports}s.ab="/ROOT/node_modules/next/dist/compiled/https-browserify/",e.exports=s(572)},8153,(t,e,r)=>{"use strict";var i=t.i(47167);Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.SUPPORTED_STREAM_BEHAVIOUR=r.SUPPORTED_SEND_META=void 0;var n=l(t.r(78492)),s=l(t.r(58033)),o=l(t.r(20502)),a=l(t.r(48450)),h=l(t.r(92542));function l(t){return t&&t.__esModule?t:{default:t}}let u=(0,a.default)("signalk-js-sdk/Connection"),c=void 0!==i.default&&null!=i.default.versions&&null!=i.default.versions.node,p=r.SUPPORTED_STREAM_BEHAVIOUR={self:"self",all:"all",none:"none"},d=r.SUPPORTED_SEND_META={all:"all"};class f extends n.default{constructor(t,e=[]){super(),this.options=t,this.httpURI=this.buildURI("http"),this.wsURI=this.buildURI("ws"),this.shouldDisconnect=!1,this.connected=!1,this.socket=null,this.lastMessage=-1,this.isConnecting=!1,this.wsKeepaliveIntervalMs=1e3*this.options.wsKeepaliveInterval,this._fetchReady=!1,this._bearerTokenPrefix=this.options.bearerTokenPrefix||"Bearer",this._authenticated=!1,this._retries=0,this._connection=null,this._self="",this._subscriptions=e,this.sendKeepaliveWithReschedule=this.sendKeepaliveWithReschedule.bind(this),this.onWSMessage=this._onWSMessage.bind(this),this.onWSOpen=this._onWSOpen.bind(this),this.onWSClose=this._onWSClose.bind(this),this.onWSError=this._onWSError.bind(this),this._token={kind:"",token:""},this.reconnect(!0)}get retries(){return this._retries}set self(t){null!==t&&this.emit("self",t),this._self=t}get self(){return this._self}set connectionInfo(t){null!==t&&this.emit("connectionInfo",t),this._connection=t,this.self=t.self}get connectionInfo(){return this._connection}buildURI(t){let{useTLS:e,hostname:r,port:i,version:n,deltaStreamBehaviour:s,sendMeta:o}=this.options,a=!0===e?`${t}s://`:`${t}://`;if(a+=r,a+=80===i?"":`:${i}`,a+="/signalk/",a+=n,"ws"===t){a+="/stream";let t=[];s&&p.hasOwnProperty(s)&&""!==p[s]&&t.push(`subscribe=${p[s]}`),o&&d.hasOwnProperty(o)&&""!==d[o]&&t.push(`sendMeta=${d[o]}`),a+="?"+t.join("&")}return"http"===t&&(a+="/api"),a}state(){return{connecting:this.isConnecting,connected:this.connected,ready:this.fetchReady}}disconnect(){u("[disconnect] called"),this.shouldDisconnect=!0,this.reconnect()}backOffAndReconnect(){if(!0===this.isConnecting)return;let{maxTimeBetweenRetries:t}=this.options,e=this._retries<Math.round(t/250)?250*this._retries:t;if(0===e)return this.reconnect();this.emit("backOffBeforeReconnect",e),u(`[backOffAndReconnect] waiting ${e} ms before reconnecting`),setTimeout(()=>this.reconnect(),e)}reconnect(t=!1){if(!0===this.isConnecting)return;if(null!==this.socket){u("[reconnect] closing socket"),this.socket.close();return}if(!1===t&&(this._retries+=1),!0!==t&&this._retries===this.options.maxRetries){this.emit("hitMaxRetries"),this.cleanupListeners();return}if(!0!==t&&!1===this.options.reconnect){u("[reconnect] Not reconnecting, for reconnect is false"),this.cleanupListeners();return}if(!0!==t&&!0===this.shouldDisconnect){u("[reconnect] not reconnecting, shouldDisconnect is true"),this.cleanupListeners();return}if(u(`[reconnect] socket is ${null===this.socket?"":"not "}NULL`),this._fetchReady=!1,this.shouldDisconnect=!1,this.isConnecting=!0,!1===this.options.useAuthentication){this._fetchReady=!0,this.emit("fetchReady"),this.initiateSocket();return}let e={method:"POST",mode:"cors",credentials:"same-origin",body:JSON.stringify({username:String(this.options.username||""),password:String(this.options.password||"")})};return this.fetch("/auth/login",e).then(t=>{if(!t||"object"!=typeof t||!t.hasOwnProperty("token"))throw Error(`Unexpected response from auth endpoint: ${JSON.stringify(t)}`);u(`[reconnect] successful auth request: ${JSON.stringify(t,null,2)}`),this._authenticated=!0,this._token={kind:"string"==typeof t.type&&""!==t.type.trim()?t.type:this._bearerTokenPrefix,token:t.token},this._fetchReady=!0,this.emit("fetchReady"),this.initiateSocket()}).catch(t=>(u(`[reconnect] error logging in: ${t.message}, reconnecting`),this.emit("error",t),this._retries+=1,this.isConnecting=!1,this.backOffAndReconnect()))}setAuthenticated(t,e="JWT"){this.emit("fetchReady"),this._authenticated=!0,this._token={kind:e,token:t}}initiateSocket(){c&&this.options.useTLS&&!1===this.options.rejectUnauthorized?this.socket=new s.default(this.wsURI,{rejectUnauthorized:!1}):this.socket=new s.default(this.wsURI),this.socket.addEventListener("message",this.onWSMessage),this.socket.addEventListener("open",this.onWSOpen),this.socket.addEventListener("error",this.onWSError),this.socket.addEventListener("close",this.onWSClose)}cleanupListeners(){u("[cleanupListeners] resetting auth and removing listeners"),this._authenticated=!1,this._token={kind:"",token:""},this.removeAllListeners()}sendKeepaliveWithReschedule(){!0===this.connected&&(this.lastMessage<Date.now()-this.wsKeepaliveIntervalMs&&this.socket.send("{}"),setTimeout(this.sendKeepaliveWithReschedule,this.wsKeepaliveIntervalMs))}_onWSMessage(t){this.lastMessage=Date.now();let e=t.data;try{"string"==typeof e&&(e=JSON.parse(e))}catch(t){console.error(`[Connection: ${this.options.hostname}] Error parsing data: ${t.message}`)}e&&"object"==typeof e&&e.hasOwnProperty("name")&&e.hasOwnProperty("version")&&e.hasOwnProperty("roles")&&(this.connectionInfo=e),this.emit("message",e)}_onWSOpen(){if(this.connected=!0,this.isConnecting=!1,this._subscriptions.length>0){let t=m(this._subscriptions);this.subscribe(t)}this._retries=0,this.options.wsKeepaliveInterval>0&&this.sendKeepaliveWithReschedule(),this.emit("connect")}_onWSError(t){u("[_onWSError] WS error",t.message||""),this.emit("error",t),this.backOffAndReconnect()}_onWSClose(t){u("[_onWSClose] called with wsURI:",this.wsURI),this.socket.removeEventListener("message",this.onWSMessage),this.socket.removeEventListener("open",this.onWSOpen),this.socket.removeEventListener("error",this.onWSError),this.socket.removeEventListener("close",this.onWSClose),this.connected=!1,this.isConnecting=!1,this.socket=null,this.emit("disconnect",t),this.backOffAndReconnect()}unsubscribe(){!0!==this.connected||null===this.socket?u("Not connected to socket"):this.send(JSON.stringify({context:"*",unsubscribe:[{path:"*"}]}))}subscribe(t=[]){!Array.isArray(t)&&t&&"object"==typeof t&&t.hasOwnProperty("subscribe")&&(t=[t]),t.forEach(t=>{this.send(JSON.stringify(t))})}send(t){if(!0!==this.connected||null===this.socket)return Promise.reject(Error("Not connected to WebSocket"));if("string"==typeof t)try{t=JSON.parse(t)}catch(t){u(`[send] data is string but not valid JSON: ${t.message}`)}let e=t&&"object"==typeof t;try{e&&(t=JSON.stringify(t))}catch(t){return Promise.reject(t)}return u(`Sending data to socket: ${t}`),Promise.resolve(this.socket.send(t))}fetch(t,e){"/"!==t.charAt(0)&&(t=`/${t}`),e&&"object"==typeof e||(e={method:"GET"}),e.headers&&"object"==typeof e.headers||(e.headers={Accept:"application/json","Content-Type":"application/json"}),!0!==this._authenticated||t.includes("auth/login")||(e.headers={...e.headers,Authorization:`${this._token.kind} ${this._token.token}`},e.credentials="same-origin",e.mode="cors",u("[fetch] enriching fetch options with in-memory token")),c&&this.options.useTLS&&!1===this.options.rejectUnauthorized&&(e.agent=new h.default.Agent({rejectUnauthorized:!1}));let r=`${this.httpURI}${t}`;return r.includes("/api/auth/login")&&(r=r.replace("/api/auth/login","/auth/login")),r.includes("/api/access/requests")&&(r=r.replace("/api/access/requests","/access/requests")),r.includes("/signalk/v1/api/security")&&(r=r.replace("/signalk/v1/api/security","/security")),u(`[fetch] ${e.method||"GET"} ${r} ${JSON.stringify(e,null,2)}`),(0,o.default)(r,e).then(t=>{if(!t.ok)throw Error(`Error fetching ${r}: ${t.status} ${t.statusText}`);return t.headers.get("content-type").includes("application/json")?t.json():t.text()})}}r.default=f;let m=t=>{let e={};return t.forEach(t=>{Array.isArray(e[t.context])||(e[t.context]=[]),e[t.context]=e[t.context].concat(t.subscribe)}),Object.keys(e).map(t=>{let r={context:t,subscribe:e[t]};if(r.subscribe.length>0){let t=[];r.subscribe=r.subscribe.reduce((e,r)=>{if(t.includes(r.path)){let t=e.findIndex(t=>t.path===r.path);-1!==t&&e.splice(t,1)}else t.push(r.path);return e.push(r),e},[])}return r})}},37342,t=>{"use strict";t.s([],48636),t.i(48636);var e,r,i,n=new Uint8Array(16);function s(){if(!e&&!(e="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}let o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&o.test(t)};for(var h=[],l=0;l<256;++l)h.push((l+256).toString(16).substr(1));let u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(h[t[e+0]]+h[t[e+1]]+h[t[e+2]]+h[t[e+3]]+"-"+h[t[e+4]]+h[t[e+5]]+"-"+h[t[e+6]]+h[t[e+7]]+"-"+h[t[e+8]]+h[t[e+9]]+"-"+h[t[e+10]]+h[t[e+11]]+h[t[e+12]]+h[t[e+13]]+h[t[e+14]]+h[t[e+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var c=0,p=0;let d=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/0x10000000000&255,r[11]=e/0x100000000&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function f(t,e,r){function i(t,i,n,s){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof i&&(i=d(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var o=new Uint8Array(16+t.length);if(o.set(i),o.set(t,i.length),(o=r(o))[6]=15&o[6]|e,o[8]=63&o[8]|128,n){s=s||0;for(var a=0;a<16;++a)n[s+a]=o[a];return n}return u(o)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function m(t){return(t+64>>>9<<4)+14+1}function y(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function g(t,e,r,i,n,s){var o;return y((o=y(y(e,t),y(i,s)))<<n|o>>>32-n,r)}function b(t,e,r,i,n,s,o){return g(e&r|~e&i,t,e,n,s,o)}function v(t,e,r,i,n,s,o){return g(e&i|r&~i,t,e,n,s,o)}function x(t,e,r,i,n,s,o){return g(e^r^i,t,e,n,s,o)}function w(t,e,r,i,n,s,o){return g(r^(e|~i),t,e,n,s,o)}var S=f("v3",48,function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,i="0123456789abcdef",n=0;n<r;n+=8){var s=t[n>>5]>>>n%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(15&s),16);e.push(o)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[m(e)-1]=e;for(var r=0x67452301,i=-0x10325477,n=-0x67452302,s=0x10325476,o=0;o<t.length;o+=16){var a=r,h=i,l=n,u=s;r=b(r,i,n,s,t[o],7,-0x28955b88),s=b(s,r,i,n,t[o+1],12,-0x173848aa),n=b(n,s,r,i,t[o+2],17,0x242070db),i=b(i,n,s,r,t[o+3],22,-0x3e423112),r=b(r,i,n,s,t[o+4],7,-0xa83f051),s=b(s,r,i,n,t[o+5],12,0x4787c62a),n=b(n,s,r,i,t[o+6],17,-0x57cfb9ed),i=b(i,n,s,r,t[o+7],22,-0x2b96aff),r=b(r,i,n,s,t[o+8],7,0x698098d8),s=b(s,r,i,n,t[o+9],12,-0x74bb0851),n=b(n,s,r,i,t[o+10],17,-42063),i=b(i,n,s,r,t[o+11],22,-0x76a32842),r=b(r,i,n,s,t[o+12],7,0x6b901122),s=b(s,r,i,n,t[o+13],12,-0x2678e6d),n=b(n,s,r,i,t[o+14],17,-0x5986bc72),i=b(i,n,s,r,t[o+15],22,0x49b40821),r=v(r,i,n,s,t[o+1],5,-0x9e1da9e),s=v(s,r,i,n,t[o+6],9,-0x3fbf4cc0),n=v(n,s,r,i,t[o+11],14,0x265e5a51),i=v(i,n,s,r,t[o],20,-0x16493856),r=v(r,i,n,s,t[o+5],5,-0x29d0efa3),s=v(s,r,i,n,t[o+10],9,0x2441453),n=v(n,s,r,i,t[o+15],14,-0x275e197f),i=v(i,n,s,r,t[o+4],20,-0x182c0438),r=v(r,i,n,s,t[o+9],5,0x21e1cde6),s=v(s,r,i,n,t[o+14],9,-0x3cc8f82a),n=v(n,s,r,i,t[o+3],14,-0xb2af279),i=v(i,n,s,r,t[o+8],20,0x455a14ed),r=v(r,i,n,s,t[o+13],5,-0x561c16fb),s=v(s,r,i,n,t[o+2],9,-0x3105c08),n=v(n,s,r,i,t[o+7],14,0x676f02d9),i=v(i,n,s,r,t[o+12],20,-0x72d5b376),r=x(r,i,n,s,t[o+5],4,-378558),s=x(s,r,i,n,t[o+8],11,-0x788e097f),n=x(n,s,r,i,t[o+11],16,0x6d9d6122),i=x(i,n,s,r,t[o+14],23,-0x21ac7f4),r=x(r,i,n,s,t[o+1],4,-0x5b4115bc),s=x(s,r,i,n,t[o+4],11,0x4bdecfa9),n=x(n,s,r,i,t[o+7],16,-0x944b4a0),i=x(i,n,s,r,t[o+10],23,-0x41404390),r=x(r,i,n,s,t[o+13],4,0x289b7ec6),s=x(s,r,i,n,t[o],11,-0x155ed806),n=x(n,s,r,i,t[o+3],16,-0x2b10cf7b),i=x(i,n,s,r,t[o+6],23,0x4881d05),r=x(r,i,n,s,t[o+9],4,-0x262b2fc7),s=x(s,r,i,n,t[o+12],11,-0x1924661b),n=x(n,s,r,i,t[o+15],16,0x1fa27cf8),i=x(i,n,s,r,t[o+2],23,-0x3b53a99b),r=w(r,i,n,s,t[o],6,-0xbd6ddbc),s=w(s,r,i,n,t[o+7],10,0x432aff97),n=w(n,s,r,i,t[o+14],15,-0x546bdc59),i=w(i,n,s,r,t[o+5],21,-0x36c5fc7),r=w(r,i,n,s,t[o+12],6,0x655b59c3),s=w(s,r,i,n,t[o+3],10,-0x70f3336e),n=w(n,s,r,i,t[o+10],15,-1051523),i=w(i,n,s,r,t[o+1],21,-0x7a7ba22f),r=w(r,i,n,s,t[o+8],6,0x6fa87e4f),s=w(s,r,i,n,t[o+15],10,-0x1d31920),n=w(n,s,r,i,t[o+6],15,-0x5cfebcec),i=w(i,n,s,r,t[o+13],21,0x4e0811a1),r=w(r,i,n,s,t[o+4],6,-0x8ac817e),s=w(s,r,i,n,t[o+11],10,-0x42c50dcb),n=w(n,s,r,i,t[o+2],15,0x2ad7d2bb),i=w(i,n,s,r,t[o+9],21,-0x14792c6f),r=y(r,a),i=y(i,h),n=y(n,l),s=y(s,u)}return[r,i,n,s]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(m(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))});function M(t,e){return t<<e|t>>>32-e}var _=f("v5",80,function(t){var e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var n=0;n<i.length;++n)t.push(i.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var s=Math.ceil((t.length/4+2)/16),o=Array(s),a=0;a<s;++a){for(var h=new Uint32Array(16),l=0;l<16;++l)h[l]=t[64*a+4*l]<<24|t[64*a+4*l+1]<<16|t[64*a+4*l+2]<<8|t[64*a+4*l+3];o[a]=h}o[s-1][14]=(t.length-1)*8/0x100000000,o[s-1][14]=Math.floor(o[s-1][14]),o[s-1][15]=(t.length-1)*8|0;for(var u=0;u<s;++u){for(var c=new Uint32Array(80),p=0;p<16;++p)c[p]=o[u][p];for(var d=16;d<80;++d)c[d]=M(c[d-3]^c[d-8]^c[d-14]^c[d-16],1);for(var f=r[0],m=r[1],y=r[2],g=r[3],b=r[4],v=0;v<80;++v){var x=Math.floor(v/20),w=M(f,5)+function(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:case 3:return e^r^i;case 2:return e&r^e&i^r&i}}(x,m,y,g)+b+e[x]+c[v]>>>0;b=g,g=y,y=M(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+g>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});t.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,d,"stringify",0,u,"v1",0,function(t,e,n){var o=e&&n||0,a=e||Array(16),h=(t=t||{}).node||r,l=void 0!==t.clockseq?t.clockseq:i;if(null==h||null==l){var d=t.random||(t.rng||s)();null==h&&(h=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=i=(d[6]<<8|d[7])&16383)}var f=void 0!==t.msecs?t.msecs:Date.now(),m=void 0!==t.nsecs?t.nsecs:p+1,y=f-c+(m-p)/1e4;if(y<0&&void 0===t.clockseq&&(l=l+1&16383),(y<0||f>c)&&void 0===t.nsecs&&(m=0),m>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,p=m,i=l;var g=((0xfffffff&(f+=122192928e5))*1e4+m)%0x100000000;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var b=f/0x100000000*1e4&0xfffffff;a[o++]=b>>>8&255,a[o++]=255&b,a[o++]=b>>>24&15|16,a[o++]=b>>>16&255,a[o++]=l>>>8|128,a[o++]=255&l;for(var v=0;v<6;++v)a[o+v]=h[v];return e||u(a)},"v3",0,S,"v4",0,function(t,e,r){var i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=i[n];return e}return u(i)},"v5",0,_,"validate",0,a,"version",0,function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],37342)},30980,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(t.r(78492)),n=o(t.r(48450)),s=t.r(37342);function o(t){return t&&t.__esModule?t:{default:t}}let a=(0,n.default)("signalk-js-sdk/Request");class h extends i.default{constructor(t,e,r){super(),this.connection=t,this.requestId=(0,s.v4)(),this.name=e,this.body=r,this.responses=[],this.sent=!1,this.connection.on("message",t=>{t&&"object"==typeof t&&t.hasOwnProperty("requestId")&&t.requestId===this.requestId&&this.addResponse(t)})}query(){let t={requestId:this.requestId,query:!0};a(`Sending query: ${JSON.stringify(t,null,2)}`),this.connection.send(t)}send(){if(!0===this.sent)return;let t={requestId:this.requestId,...this.body};a(`Sending request: ${JSON.stringify(t,null,2)}`),this.connection.send(t)}addResponse(t){a(`Got response for request "${this.name}": ${JSON.stringify(t,null,2)}`);let e=new Date().toISOString();this.responses.push({response:t,receivedAt:e}),this.emit("response",{...t,request:{receivedAt:e,name:this.name,requestId:this.requestId}})}getRequestId(){return this.requestId}}r.default=h},5526,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=class{constructor(t){this.connection=t,this.selfMRN=this.connection.self}get(t){return t.includes(".")&&(t=t.replace(/\./g,"/")),("string"!=typeof t||""===t.trim())&&(t="/"),"/"!==t.charAt(0)&&(t=`/${t}`),this.connection.fetch(t)}put(t,e){return t.includes(".")&&(t=t.replace(/\./g,"/")),("string"!=typeof t||""===t.trim())&&(t="/"),"/"!==t.charAt(0)&&(t=`/${t}`),this.connection.fetch(t,{method:"PUT",mode:"cors",body:e&&"object"==typeof e?JSON.stringify(e):e})}getMeta(t){return this.get(t).then(t=>t&&"object"==typeof t&&t.hasOwnProperty("meta")?t.meta:null)}sources(){return this.get("/sources")}resources(){return this.get("/resources")}mrn(){return this.get("/self")}vessels(){return this.get("/vessels")}aircraft(){return this.get("/aircraft")}aton(){return this.get("/aton")}sar(){return this.get("/sar")}version(){return this.get("/version")}self(t){return("string"!=typeof t||"/"!==t.charAt(0))&&(t=""),this.connection.fetch(`/vessels/self${t}`)}vessel(t,e){return("string"!=typeof e||"/"!==e.charAt(0))&&(e=""),this.connection.fetch(`/vessels/${t}${e}`)}name(){return this.self("/name")}getGroup(t,e,r="self"){return(("string"!=typeof e||"/"!==e.charAt(0))&&(e=""),"self"===r)?this.self(`/${t}${e}`):this.vessel(r,`/${t}${e}`)}communication(t="",e="self"){return this.getGroup("communication",t,e)}design(t="",e="self"){return this.getGroup("design",t,e)}electrical(t="",e="self"){return this.getGroup("electrical",t,e)}environment(t="",e="self"){return this.getGroup("environment",t,e)}navigation(t="",e="self"){return this.getGroup("navigation",t,e)}notifications(t="",e="self"){return this.getGroup("notifications",t,e)}performance(t="",e="self"){return this.getGroup("performance",t,e)}propulsion(t="",e="self"){return this.getGroup("propulsion",t,e)}sails(t="",e="self"){return this.getGroup("sails",t,e)}sensors(t="",e="self"){return this.getGroup("sensors",t,e)}steering(t="",e="self"){return this.getGroup("steering",t,e)}tanks(t="",e="self"){return this.getGroup("tanks",t,e)}}},74392,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.PERMISSIONS_READWRITE=r.PERMISSIONS_READONLY=r.PERMISSIONS_DENY=r.AUTHENTICATION_REQUEST=void 0;var i=l(t.r(78492)),n=l(t.r(8153)),s=l(t.r(30980)),o=l(t.r(5526)),a=l(t.r(48450)),h=t.r(37342);function l(t){return t&&t.__esModule?t:{default:t}}let u=(0,a.default)("signalk-js-sdk/Client"),c=r.AUTHENTICATION_REQUEST="__AUTHENTICATION_REQUEST__";r.PERMISSIONS_READWRITE="readwrite",r.PERMISSIONS_READONLY="readonly",r.PERMISSIONS_DENY="denied";class p extends i.default{constructor(t={}){super(),this.options={hostname:"localhost",port:3e3,useTLS:!0,useAuthentication:!1,notifications:!0,version:"v1",autoConnect:!1,reconnect:!0,maxRetries:1/0,maxTimeBetweenRetries:2500,mdns:null,username:null,password:null,deltaStreamBehaviour:"none",subscriptions:[],wsKeepaliveInterval:0,...t},this.api=null,this.connection=null,this.services=[],this.notifications={},this.requests={},this.fetchReady=null,Array.isArray(this.options.subscriptions)&&(this.subscribeCommands=this.options.subscriptions.filter(t=>f(t))),!0===this.options.notifications&&this.subscribeCommands.push({context:"vessels.self",subscribe:[{path:"notifications.*",policy:"instant"}]}),!0===this.options.autoConnect&&this.connect().catch(t=>this.emit("error",t))}get self(){return null===this.connection?null:this.connection.self}set(t,e){return this.options[t]=e,this}get(t){return this.options[t]||null}get retries(){return null===this.connection?0:this.connection.retries}requestDeviceAccess(t,e){let r="string"==typeof e?e:(0,h.v4)();return this.connection.fetch("/access/requests",{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:r,description:t})}).then(t=>({clientId:r,response:t}))}respondToAccessRequest(t,e,r="1y"){return this.connection.fetch(`/security/access/requests/${t}/${"denied"===e?"denied":"approved"}`,{method:"PUT",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({expiration:r,permissions:e})})}authenticate(t,e){let r=this.request(c,{login:{username:t,password:e}});r.on("response",t=>{if(200===t.statusCode&&t.hasOwnProperty("login")&&"object"==typeof t.login&&t.login.hasOwnProperty("token"))return this.connection.setAuthenticated(t.login.token),this.emit("authenticated",{token:t.login.token});this.emit("error",Error(`Error authenticating: status ${t.statusCode}`))}),r.send()}request(t,e={}){return this.requests.hasOwnProperty(t)||(this.requests[t]=new s.default(this.connection,t,e),u(`Registered request "${t}" with ID ${this.requests[t].getRequestId()}`)),this.requests[t]}subscribe(t=[]){if(null===this.connection)throw Error("Not connected");t&&!Array.isArray(t)&&"object"==typeof t&&t.hasOwnProperty("subscribe")&&(t=[t]),(t=t.filter(t=>f(t))).forEach(t=>{this.subscribeCommands.push(t)}),this.connection.subscribe(t)}unsubscribe(){if(null===this.connection)throw Error("Not connected");let{notifications:t}=this.options;this.subscribeCommands=!0===t?[{context:"vessels.self",subscribe:[{path:"notifications.*",policy:"instant"}]}]:[],this.connection.unsubscribe(),this.subscribeCommands.length>0&&this.connection.subscribe(this.subscribeCommands)}connect(){return null!==this.connection?(this.connection.reconnect(!0),Promise.resolve(this.connection)):new Promise((t,e)=>{this.connection=new n.default(this.options,this.subscribeCommands),this.connection.on("disconnect",t=>this.emit("disconnect",t)),this.connection.on("message",t=>this.processWSMessage(t)),this.connection.on("connectionInfo",t=>this.emit("connectionInfo",t)),this.connection.on("self",t=>this.emit("self",t)),this.connection.on("hitMaxRetries",()=>this.emit("hitMaxRetries")),this.connection.on("backOffBeforeReconnect",t=>this.emit("backOffBeforeReconnect",t)),this.connection.on("connect",()=>{this.getInitialNotifications(),this.emit("connect"),t(this.connection)}),this.connection.on("fetchReady",()=>{this.fetchReady=!0}),this.connection.on("error",t=>{this.emit("error",t),e(t)})})}disconnect(t=!1){return(null!==this.connection?(this.connection.on("disconnect",()=>{this.cleanupListeners(),this.connection=null}),this.connection.unsubscribe(),this.connection.disconnect()):this.cleanupListeners(),null!==this.api&&(this.api=null),!0===t)?Promise.resolve(this):this}cleanupListeners(){this.removeAllListeners("self"),this.removeAllListeners("connectionInfo"),this.removeAllListeners("message"),this.removeAllListeners("delta"),this.removeAllListeners("connect"),this.removeAllListeners("error"),this.removeAllListeners("hitMaxRetries"),this.removeAllListeners("backOffBeforeReconnect"),this.removeAllListeners("disconnect"),this.removeAllListeners("unsubscribe"),this.removeAllListeners("subscribe")}API(){return null===this.connection?Promise.reject(Error("There are no available connections. Please connect before you use the REST API.")):null!==this.api?Promise.resolve(this.api):new Promise(t=>{if(this.api=new o.default(this.connection),!0===this.fetchReady||!1===this.options.useAuthentication)return t(this.api);this.connection.on("fetchReady",()=>{t(this.api)})})}processWSMessage(t){this.emit("message",t),t&&"object"==typeof t&&t.hasOwnProperty("updates")&&(this.checkAndEmitNotificationsInDelta(t),this.emit("delta",t))}checkAndEmitNotificationsInDelta(t){if(!1===this.options.notifications||!t||"object"!=typeof t||!Array.isArray(t.updates))return;let e={};t.updates.forEach(t=>{(t.values||[]).forEach(t=>{"string"==typeof t.path&&t.path.includes("notifications.")&&(e[t.path.replace("notifications.","")]={...t.value})})}),Object.keys(e).forEach(t=>{if(!this.notifications.hasOwnProperty(t)||this.notifications[t].timestamp!==e[t].timestamp){this.notifications[t]={...e[t]};let r={path:t,...this.notifications[t]};u(`[checkAndEmitNotificationsInDelta] emitting notification: ${JSON.stringify(r,null,2)}`),this.emit("notification",r)}})}getInitialNotifications(){!1===this.options.notifications||null!==this.connection&&(null===this.api&&(this.api=new o.default(this.connection)),this.api.notifications().then(t=>(this.notifications={...this.notifications,...d(t)},Object.keys(this.notifications).forEach(t=>{let e={path:t,...this.notifications[t]};u(`[getInitialNotifications] emitting notification: ${JSON.stringify(e,null,2)}`),this.emit("notification",e)}),this.notifications)).catch(t=>{console.error(`[getInitialNotifications] error getting notifications: ${t.message}`)}))}}r.default=p;let d=t=>{let e={},r=t,i="",n=t=>{i+=`${""===i?"":"."}${t}`,(r=r[t])&&"object"==typeof r&&(r&&"object"==typeof r&&r.hasOwnProperty("value")?e[i]=Object.assign({},r.value):Object.keys(r).forEach(n))};return Object.keys(r).forEach(t=>n(t)),e},f=t=>!!t&&"object"==typeof t&&!!t.hasOwnProperty("context")&&!!Array.isArray(t.subscribe)},33079,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.SKServer=void 0;var i=s(t.r(78492)),n=s(t.r(74392));function s(t){return t&&t.__esModule?t:{default:t}}class o{constructor(t){this._roles=t.roles||["master","main"],this._self=t.self||"",this._version=t.version||"0.0.0",this._hostname=t.hostname,this._port=t.port}get roles(){return this._roles}get self(){return this._self}get version(){return this._version}get hostname(){return this._hostname}get port(){return this._port}isMain(){return this._roles.includes("main")}isMaster(){return this._roles.includes("master")}createClient(t={}){return new n.default({...t,hostname:this._hostname,port:this._port})}}r.SKServer=o;class a extends i.default{constructor(t,e=6e4){if(super(),this.found=[],!t||"object"!=typeof t)throw Error("No mDNS provider given");if(Object.keys(t).join(",").startsWith("_server,_registry"))return this.discoverWithBonjour(t,e);if(Object.keys(t).join(",").startsWith("dns_sd,Advertisement,createAdvertisement,Browser"))return this.discoverWithMdns(t,e);throw Error("Unrecognized mDNS provider given")}discoverWithBonjour(t,e){let r=t.find({type:"signalk-http"});r.on("up",t=>this.handleDiscoveredService(t,{...t.txt,name:t.name||"",hostname:t.host||"",port:parseInt(t.port,10),provider:"bonjour"})),setTimeout(()=>{0===this.found.length&&this.emit("timeout"),r.stop()},e),r.start()}discoverWithMdns(t,e){let r=t.createBrowser(t.tcp("_signalk-http"));r.on("serviceUp",t=>this.handleDiscoveredService(t,{...t.txtRecord,hostname:t.host||"",port:parseInt(t.port,10),provider:"mdns"})),r.on("error",t=>this.handleDiscoveryError(t)),setTimeout(()=>{0===this.found.length&&this.emit("timeout"),r.stop()},e),r.start()}handleDiscoveryError(t){console.error(`Error during discovery: ${t.message}`)}handleDiscoveredService(t,e){"string"==typeof e.roles&&(e.roles=e.roles.split(",").map(t=>t.trim().toLowerCase())),e.roles=Array.isArray(e.roles)?e.roles:[];let r=e.hostname;Array.isArray(t.addresses)&&(r=t.addresses.reduce((t,e)=>(e&&"string"==typeof e&&e.includes(".")&&(t=e),t),e.hostname)),""!==r.trim()&&(e.hostname=r);let i=new o(e);this.found.push(i),this.emit("found",i)}}r.default=a},28020,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Discovery=r.Client=void 0;var i=s(t.r(74392)),n=s(t.r(33079));function s(t){return t&&t.__esModule?t:{default:t}}r.Client=i.default,r.Discovery=n.default,r.default=i.default},49018,(t,e,r)=>{e.exports=t.r(28020)},67034,(t,e,r)=>{var i={872:function(t,e){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],i=e[1];return(r+i)*3/4-i},e.toByteArray=function(t){var e,r,s=h(t),o=s[0],a=s[1],l=new n((o+a)*3/4-a),u=0,c=a>0?o-4:o;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=0,a=i-n;o<a;o+=16383)s.push(function(t,e,i){for(var n,s=[],o=e;o<i;o+=3)n=(t[o]<<16&0xff0000)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(r[n>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}(t,o,o+16383>a?a:o+16383));return 1===n?s.push(r[(e=t[i-1])>>2]+r[e<<4&63]+"=="):2===n&&s.push(r[(e=(t[i-2]<<8)+t[i-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),s.join("")};for(var r=[],i=[],n="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o<a;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function h(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},230:function(t,e,r){"use strict";var i=r(872),n=r(321),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return u(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t){var i=t,n=e;if(("string"!=typeof n||""===n)&&(n="utf8"),!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);var s=0|d(i,n),h=o(s),l=h.write(i,n);return l!==s&&(h=h.slice(0,l)),h}if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(R(t,ArrayBuffer)||t&&R(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(R(t,SharedArrayBuffer)||t&&R(t.buffer,SharedArrayBuffer)))return function(t,e,r){var i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),i}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return a.from(u,e,r);var f=function(t){if(a.isBuffer(t)){var e=0|p(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?o(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),o(t<0?0:0|p(t))}function c(t){for(var e=t.length<0?0:0|p(t.length),r=o(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)},a.allocUnsafe=function(t){return u(t)},a.allocUnsafeSlow=function(t){return u(t)};function p(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||R(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(t).length;default:if(n)return i?-1:A(t).length;e=(""+e).toLowerCase(),n=!0}}function f(t,e,r){var n,s,o,a=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=e;s<r;++s)n+=O[t[s]];return n}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}(this,e,r);case"base64":return n=this,s=e,o=r,0===s&&o===n.length?i.fromByteArray(n):i.fromByteArray(n.slice(s,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var i=t.slice(e,r),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}(this,e,r);default:if(a)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function m(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){var s;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(n)return -1;else r=t.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:g(t,e,r,i,n);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return g(t,[e],r,i,n)}throw TypeError("val must be string, number or Buffer")}function g(t,e,r,i,n){var s,o=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;o=2,a/=2,h/=2,r/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var u=-1;for(s=r;s<a;s++)if(l(t,s)===l(e,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===h)return u*o}else -1!==u&&(s-=s-u),u=-1}else for(r+h>a&&(r=a-h),s=r;s>=0;s--){for(var c=!0,p=0;p<h;p++)if(l(t,s+p)!==l(e,p)){c=!1;break}if(c)return s}return -1}a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(R(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),R(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:+(i<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var s=t[r];if(R(s,Uint8Array)&&(s=a.from(s)),!a.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(R(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;for(var s=n-i,o=r-e,h=Math.min(s,o),l=this.slice(i,n),u=t.slice(e,r),c=0;c<h;++c)if(l[c]!==u[c]){s=l[c],o=u[c];break}return s<o?-1:+(o<s)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var s,o,a,h,l=t[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c<=r)switch(c){case 1:l<128&&(u=l);break;case 2:(192&(s=t[n+1]))==128&&(h=(31&l)<<6|63&s)>127&&(u=h);break;case 3:s=t[n+1],o=t[n+2],(192&s)==128&&(192&o)==128&&(h=(15&l)<<12|(63&s)<<6|63&o)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],(192&s)==128&&(192&o)==128&&(192&a)==128&&(h=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),n+=c}var p=i,d=p.length;if(d<=4096)return String.fromCharCode.apply(String,p);for(var f="",m=0;m<d;)f+=String.fromCharCode.apply(String,p.slice(m,m+=4096));return f}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,i,n,s){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function w(t,e,r,i,n,s){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function S(t,e,r,i,s){return e*=1,r>>>=0,s||w(t,e,r,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,r,i,23,4),r+4}function M(t,e,r,i,s){return e*=1,r>>>=0,s||w(t,e,r,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,r,i,52,8),r+8}a.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,s,o,a,h,l,u,c,p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var d=!1;;)switch(i){case"hex":return function(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o<i;++o){var a,h=parseInt(e.substr(2*o,2),16);if((a=h)!=a)break;t[r+o]=h}return o}(this,t,e,r);case"utf8":case"utf-8":return n=e,s=r,E(A(t,this.length-n),this,n,s);case"ascii":return o=e,a=r,E(T(t),this,o,a);case"latin1":case"binary":return function(t,e,r,i){return E(T(e),t,r,i)}(this,t,e,r);case"base64":return h=e,l=r,E(C(t),this,h,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=e,c=r,E(function(t,e){for(var r,i,n=[],s=0;s<t.length&&!((e-=2)<0);++s)i=(r=t.charCodeAt(s))>>8,n.push(r%256),n.push(i);return n}(t,this.length-u),this,u,c);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}var s=1,o=0;for(this[e]=255&t;++o<r&&(s*=256);)this[e+o]=t/s&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}var s=r-1,o=1;for(this[e+s]=255&t;--s>=0&&(o*=256);)this[e+s]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){var n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o|0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){var n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o|0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return S(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return S(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var s=n-1;s>=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},a.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){var n,s=t.charCodeAt(0);("utf8"===i&&s<128||"latin1"===i)&&(t=s)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{var o=a.isBuffer(t)?t:a.from(t,i),h=o.length;if(0===h)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=o[n%h]}return this};var _=/[^+/0-9A-Za-z-_]/g;function A(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!n){if(r>56319||o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function T(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function C(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function E(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length)&&!(n>=t.length);++n)e[n+r]=t[n];return n}function R(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var O=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},321:function(t,e){e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,h=(1<<a)-1,l=h>>1,u=-7,c=r?n-1:0,p=r?-1:1,d=t[e+c];for(c+=p,s=d&(1<<-u)-1,d>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=p,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+c],c+=p,u-=8);if(0===s)s=1-l;else{if(s===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=l}return(d?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,h,l=8*s-n-1,u=(1<<l)-1,c=u>>1,p=5960464477539062e-23*(23===n),d=i?0:s-1,f=i?1:-1,m=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),o+c>=1?e+=p/h:e+=p*Math.pow(2,1-c),e*h>=2&&(o++,h/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(e*h-1)*Math.pow(2,n),o+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&a,d+=f,a/=256,n-=8);for(o=o<<n|a,l+=n;l>0;t[r+d]=255&o,d+=f,o/=256,l-=8);t[r+d-f]|=128*m}}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}},o=!0;try{i[t](r,r.exports,s),o=!1}finally{o&&delete n[t]}return r.exports}s.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=s(230)},90072,t=>{"use strict";let e,r,i,n,s,o,a,h,l,u="attached",c="detached",p="srgb",d="srgb-linear",f="linear",m="srgb",y={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function g(t,e){return new y[t](e)}function b(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function v(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}let x={},w=null;function S(...t){let e="THREE."+t.shift();w?w("log",e,...t):console.log(e,...t)}function M(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function _(...t){let e="THREE."+(t=M(t)).shift();if(w)w("warn",e,...t);else{let r=t[0];r&&r.isStackTrace?console.warn(r.getError(e)):console.warn(e,...t)}}function A(...t){let e="THREE."+(t=M(t)).shift();if(w)w("error",e,...t);else{let r=t[0];r&&r.isStackTrace?console.error(r.getError(e)):console.error(e,...t)}}function T(...t){let e=t.join(" ");e in x||(x[e]=!0,_(...t))}class C{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)}hasEventListener(t,e){let r=this._listeners;return void 0!==r&&void 0!==r[t]&&-1!==r[t].indexOf(e)}removeEventListener(t,e){let r=this._listeners;if(void 0===r)return;let i=r[t];if(void 0!==i){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let r=e[t.type];if(void 0!==r){t.target=this;let e=r.slice(0);for(let r=0,i=e.length;r<i;r++)e[r].call(this,t);t.target=null}}}let E=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],R=1234567,O=Math.PI/180,I=180/Math.PI;function k(){let t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(E[255&t]+E[t>>8&255]+E[t>>16&255]+E[t>>24&255]+"-"+E[255&e]+E[e>>8&255]+"-"+E[e>>16&15|64]+E[e>>24&255]+"-"+E[63&r|128]+E[r>>8&255]+"-"+E[r>>16&255]+E[r>>24&255]+E[255&i]+E[i>>8&255]+E[i>>16&255]+E[i>>24&255]).toLowerCase()}function P(t,e,r){return Math.max(e,Math.min(r,t))}function B(t,e){return(t%e+e)%e}function L(t,e,r){return(1-r)*t+r*e}function z(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:case Uint8ClampedArray:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("THREE.MathUtils: Invalid component type.")}}function N(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:case Uint8ClampedArray:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("THREE.MathUtils: Invalid component type.")}}class F{static{F.prototype.isVector2=!0}constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("THREE.Vector2: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("THREE.Vector2: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(P(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,r=this.y-t.y;return e*e+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,s=this.y-t.y;return this.x=n*r-s*i+t.x,this.y=n*i+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class U{constructor(t=0,e=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=r,this._w=i}static slerpFlat(t,e,r,i,n,s,o){let a=r[i+0],h=r[i+1],l=r[i+2],u=r[i+3],c=n[s+0],p=n[s+1],d=n[s+2],f=n[s+3];if(u!==f||a!==c||h!==p||l!==d){let t=a*c+h*p+l*d+u*f;t<0&&(c=-c,p=-p,d=-d,f=-f,t=-t);let e=1-o;if(t<.9995){let r=Math.acos(t),i=Math.sin(r);a=a*(e=Math.sin(e*r)/i)+c*(o=Math.sin(o*r)/i),h=h*e+p*o,l=l*e+d*o,u=u*e+f*o}else{let t=1/Math.sqrt((a=a*e+c*o)*a+(h=h*e+p*o)*h+(l=l*e+d*o)*l+(u=u*e+f*o)*u);a*=t,h*=t,l*=t,u*=t}}t[e]=a,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,r,i,n,s){let o=r[i],a=r[i+1],h=r[i+2],l=r[i+3],u=n[s],c=n[s+1],p=n[s+2],d=n[s+3];return t[e]=o*d+l*u+a*p-h*c,t[e+1]=a*d+l*c+h*u-o*p,t[e+2]=h*d+l*p+o*c-a*u,t[e+3]=l*d-o*u-a*c-h*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let r=t._x,i=t._y,n=t._z,s=t._order,o=Math.cos,a=Math.sin,h=o(r/2),l=o(i/2),u=o(n/2),c=a(r/2),p=a(i/2),d=a(n/2);switch(s){case"XYZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"YXZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"ZXY":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"ZYX":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"YZX":this._x=c*l*u+h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u-c*p*d;break;case"XZY":this._x=c*l*u-h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u+c*p*d;break;default:_("Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,r=e[0],i=e[4],n=e[8],s=e[1],o=e[5],a=e[9],h=e[2],l=e[6],u=e[10],c=r+o+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-a)*t,this._y=(n-h)*t,this._z=(s-i)*t}else if(r>o&&r>u){let t=2*Math.sqrt(1+r-o-u);this._w=(l-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+h)/t}else if(o>u){let t=2*Math.sqrt(1+o-r-u);this._w=(n-h)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+l)/t}else{let t=2*Math.sqrt(1+u-r-o);this._w=(s-i)/t,this._x=(n+h)/t,this._y=(a+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=r,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(P(this.dot(t),-1,1)))}rotateTowards(t,e){let r=this.angleTo(t);if(0===r)return this;let i=Math.min(1,e/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,h=e._z,l=e._w;return this._x=r*l+s*o+i*h-n*a,this._y=i*l+s*a+n*o-r*h,this._z=n*l+s*h+r*a-i*o,this._w=s*l-r*o-i*a-n*h,this._onChangeCallback(),this}slerp(t,e){let r=t._x,i=t._y,n=t._z,s=t._w,o=this.dot(t);o<0&&(r=-r,i=-i,n=-n,s=-s,o=-o);let a=1-e;if(o<.9995){let t=Math.acos(o),h=Math.sin(t);a=Math.sin(a*t)/h,e=Math.sin(e*t)/h,this._x=this._x*a+r*e,this._y=this._y*a+i*e,this._z=this._z*a+n*e,this._w=this._w*a+s*e,this._onChangeCallback()}else this._x=this._x*a+r*e,this._y=this._y*a+i*e,this._z=this._z*a+n*e,this._w=this._w*a+s*e,this.normalize();return this}slerpQuaternions(t,e,r){return this.copy(t).slerp(e,r)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),n=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),n*Math.sin(e),n*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class j{static{j.prototype.isVector3=!0}constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.z=r}set(t,e,r){return void 0===r&&(r=this.z),this.x=t,this.y=e,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("THREE.Vector3: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("THREE.Vector3: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(V.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(V.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6]*i,this.y=n[1]*e+n[4]*r+n[7]*i,this.z=n[2]*e+n[5]*r+n[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,r=this.y,i=this.z,n=t.elements,s=1/(n[3]*e+n[7]*r+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*r+n[8]*i+n[12])*s,this.y=(n[1]*e+n[5]*r+n[9]*i+n[13])*s,this.z=(n[2]*e+n[6]*r+n[10]*i+n[14])*s,this}applyQuaternion(t){let e=this.x,r=this.y,i=this.z,n=t.x,s=t.y,o=t.z,a=t.w,h=2*(s*i-o*r),l=2*(o*e-n*i),u=2*(n*r-s*e);return this.x=e+a*h+s*u-o*l,this.y=r+a*l+o*h-n*u,this.z=i+a*u+n*l-s*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[4]*r+n[8]*i,this.y=n[1]*e+n[5]*r+n[9]*i,this.z=n[2]*e+n[6]*r+n[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this.z=P(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this.z=P(this.z,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let r=t.x,i=t.y,n=t.z,s=e.x,o=e.y,a=e.z;return this.x=i*a-n*o,this.y=n*s-r*a,this.z=r*o-i*s,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return D.copy(this).projectOnVector(t),this.sub(D)}reflect(t){return this.sub(D.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(P(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,r){let i=Math.sin(e)*t;return this.x=i*Math.sin(r),this.y=Math.cos(e)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,r=Math.sqrt(1-e*e);return this.x=r*Math.cos(t),this.y=e,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let D=new j,V=new U;class W{static{W.prototype.isMatrix3=!0}constructor(t,e,r,i,n,s,o,a,h){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,h)}set(t,e,r,i,n,s,o,a,h){let l=this.elements;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=n,l[5]=a,l[6]=r,l[7]=s,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}extractBasis(t,e,r){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let r=t.elements,i=e.elements,n=this.elements,s=r[0],o=r[3],a=r[6],h=r[1],l=r[4],u=r[7],c=r[2],p=r[5],d=r[8],f=i[0],m=i[3],y=i[6],g=i[1],b=i[4],v=i[7],x=i[2],w=i[5],S=i[8];return n[0]=s*f+o*g+a*x,n[3]=s*m+o*b+a*w,n[6]=s*y+o*v+a*S,n[1]=h*f+l*g+u*x,n[4]=h*m+l*b+u*w,n[7]=h*y+l*v+u*S,n[2]=c*f+p*g+d*x,n[5]=c*m+p*b+d*w,n[8]=c*y+p*v+d*S,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*s*l-e*o*h-r*n*l+r*o*a+i*n*h-i*s*a}invert(){let t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*s-o*h,c=o*a-l*n,p=h*n-s*a,d=e*u+r*c+i*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);let f=1/d;return t[0]=u*f,t[1]=(i*h-l*r)*f,t[2]=(o*r-i*s)*f,t[3]=c*f,t[4]=(l*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=p*f,t[7]=(r*a-h*e)*f,t[8]=(s*e-r*n)*f,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,r,i,n,s,o){let a=Math.cos(n),h=Math.sin(n);return this.set(r*a,r*h,-r*(a*s+h*o)+s+t,-i*h,i*a,-i*(-h*s+a*o)+o+e,0,0,1),this}scale(t,e){return T("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(q.makeScale(t,e)),this}rotate(t){return T("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(q.makeRotation(-t)),this}translate(t,e){return T("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(q.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,r=t.elements;for(let t=0;t<9;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){let r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let q=new W,G=new W().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),H=new W().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),$=(a=[.64,.33,.3,.6,.15,.06],h=[.2126,.7152,.0722],l=[.3127,.329],(o={enabled:!0,workingColorSpace:d,spaces:{},convert:function(t,e,r){return!1!==this.enabled&&e!==r&&e&&r&&(this.spaces[e].transfer===m&&(t.r=J(t.r),t.g=J(t.g),t.b=J(t.b)),this.spaces[e].primaries!==this.spaces[r].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===m&&(t.r=Y(t.r),t.g=Y(t.g),t.b=Y(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?f:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,r){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,e){return T("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),o.workingToColorSpace(t,e)},toWorkingColorSpace:function(t,e){return T("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),o.colorSpaceToWorking(t,e)}}).define({[d]:{primaries:a,whitePoint:l,transfer:f,toXYZ:G,fromXYZ:H,luminanceCoefficients:h,workingColorSpaceConfig:{unpackColorSpace:p},outputColorSpaceConfig:{drawingBufferColorSpace:p}},[p]:{primaries:a,whitePoint:l,transfer:m,toXYZ:G,fromXYZ:H,luminanceCoefficients:h,outputColorSpaceConfig:{drawingBufferColorSpace:p}}}),o);function J(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Y(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class X{static getDataURL(t,r="image/png"){let i;if(/^data:/i.test(t.src)||"u"<typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)i=t;else{void 0===e&&(e=v("canvas")),e.width=t.width,e.height=t.height;let r=e.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=e}return i.toDataURL(r)}static sRGBToLinear(t){if("u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap){let e=v("canvas");e.width=t.width,e.height=t.height;let r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);let i=r.getImageData(0,0,t.width,t.height),n=i.data;for(let t=0;t<n.length;t++)n[t]=255*J(n[t]/255);return r.putImageData(i,0,0),e}if(!t.data)return _("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t;{let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*J(e[t]/255)):e[t]=J(e[t]);return{data:e,width:t.width,height:t.height}}}}let Z=0;class K{constructor(t=null){this.isTextureSource=!0,Object.defineProperty(this,"id",{value:Z++}),this.uuid=k(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return"u">typeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"u">typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let r={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,r=i.length;e<r;e++)i[e].isDataTexture?t.push(Q(i[e].image)):t.push(Q(i[e]))}else t=Q(i);r.url=t}return e||(t.images[this.uuid]=r),r}}function Q(t){return"u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap?X.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(_("Texture: Unable to serialize Texture."),{})}let tt=0,te=new j;class tr extends C{constructor(t=tr.DEFAULT_IMAGE,e=tr.DEFAULT_MAPPING,r=1001,i=1001,n=1006,s=1008,o=1023,a=1009,h=tr.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tt++}),this.uuid=k(),this.name="",this.source=new K(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=n,this.minFilter=s,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new F(0,0),this.repeat=new F(1,1),this.center=new F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new W,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(te).x}get height(){return this.source.getSize(te).y}get depth(){return this.source.getSize(te).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let r=t[e];if(void 0===r){_(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let i=this[e];if(void 0===i){_(`Texture.setValues(): property '${e}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[e]=r}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}tr.DEFAULT_IMAGE=null,tr.DEFAULT_MAPPING=300,tr.DEFAULT_ANISOTROPY=1;class ti{static{ti.prototype.isVector4=!0}constructor(t=0,e=0,r=0,i=1){this.x=t,this.y=e,this.z=r,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("THREE.Vector4: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("THREE.Vector4: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,r=this.y,i=this.z,n=this.w,s=t.elements;return this.x=s[0]*e+s[4]*r+s[8]*i+s[12]*n,this.y=s[1]*e+s[5]*r+s[9]*i+s[13]*n,this.z=s[2]*e+s[6]*r+s[10]*i+s[14]*n,this.w=s[3]*e+s[7]*r+s[11]*i+s[15]*n,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,r,i,n,s=t.elements,o=s[0],a=s[4],h=s[8],l=s[1],u=s[5],c=s[9],p=s[2],d=s[6],f=s[10];if(.01>Math.abs(a-l)&&.01>Math.abs(h-p)&&.01>Math.abs(c-d)){if(.1>Math.abs(a+l)&&.1>Math.abs(h+p)&&.1>Math.abs(c+d)&&.1>Math.abs(o+u+f-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(o+1)/2,s=(u+1)/2,m=(f+1)/2,y=(a+l)/4,g=(h+p)/4,b=(c+d)/4;return t>s&&t>m?t<.01?(r=0,i=.707106781,n=.707106781):(i=y/(r=Math.sqrt(t)),n=g/r):s>m?s<.01?(r=.707106781,i=0,n=.707106781):(r=y/(i=Math.sqrt(s)),n=b/i):m<.01?(r=.707106781,i=.707106781,n=0):(r=g/(n=Math.sqrt(m)),i=b/n),this.set(r,i,n,e),this}let m=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-a)*(l-a));return .001>Math.abs(m)&&(m=1),this.x=(d-c)/m,this.y=(h-p)/m,this.z=(l-a)/m,this.w=Math.acos((o+u+f-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this.z=P(this.z,t.z,e.z),this.w=P(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this.z=P(this.z,t,e),this.w=P(this.w,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this.w=t.w+(e.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tn extends C{constructor(t=1,e=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveColorBuffer:!0,resolveDepthBuffer:!0,resolveStencilBuffer:!0,storeMultisampledColorBuffer:!0,storeMultisampledDepthBuffer:!0,storeMultisampledStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},r),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=r.depth,this.scissor=new ti(0,0,t,e),this.scissorTest=!1,this.viewport=new ti(0,0,t,e),this.textures=[];const i=new tr({width:t,height:e,depth:r.depth}),n=r.count;for(let t=0;t<n;t++)this.textures[t]=i.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveColorBuffer=r.resolveColorBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this.storeMultisampledColorBuffer=r.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=r.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=r.storeMultisampledStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview,this.useArrayDepthTexture=r.useArrayDepthTexture}_setTextureOptions(t={}){let e={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&this._depthTexture.renderTarget===this&&(this._depthTexture.renderTarget=null),null!==t&&null===t.renderTarget&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,r=1){if(this.width!==t||this.height!==e||this.depth!==r){this.width=t,this.height=e,this.depth=r;for(let i=0,n=this.textures.length;i<n;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=r,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,r=t.textures.length;e<r;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let r=Object.assign({},t.textures[e].image);this.textures[e].source=new K(r)}if(this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveColorBuffer=t.resolveColorBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,this.storeMultisampledColorBuffer=t.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=t.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=t.storeMultisampledStencilBuffer,null!==t.depthTexture)if(t.depthTexture.renderTarget===t){let e=t.depthTexture.clone();e.renderTarget=null,this.depthTexture=e}else this.depthTexture=t.depthTexture;return this.samples=t.samples,this.multiview=t.multiview,this.useArrayDepthTexture=t.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ts extends tn{constructor(t=1,e=1,r={}){super(t,e,r),this.isWebGLRenderTarget=!0}}class to extends tr{constructor(t=null,e=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class ta extends tr{constructor(t=null,e=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}}class th{static{th.prototype.isMatrix4=!0}constructor(t,e,r,i,n,s,o,a,h,l,u,c,p,d,f,m){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,h,l,u,c,p,d,f,m)}set(t,e,r,i,n,s,o,a,h,l,u,c,p,d,f,m){let y=this.elements;return y[0]=t,y[4]=e,y[8]=r,y[12]=i,y[1]=n,y[5]=s,y[9]=o,y[13]=a,y[2]=h,y[6]=l,y[10]=u,y[14]=c,y[3]=p,y[7]=d,y[11]=f,y[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new th().fromArray(this.elements)}copy(t){let e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}copyPosition(t){let e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,r){return 0===this.determinantAffine()?(t.set(1,0,0),e.set(0,1,0),r.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2)),this}makeBasis(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinantAffine())return this.identity();let e=this.elements,r=t.elements,i=1/tl.setFromMatrixColumn(t,0).length(),n=1/tl.setFromMatrixColumn(t,1).length(),s=1/tl.setFromMatrixColumn(t,2).length();return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=0,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=0,e[8]=r[8]*s,e[9]=r[9]*s,e[10]=r[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,r=t.x,i=t.y,n=t.z,s=Math.cos(r),o=Math.sin(r),a=Math.cos(i),h=Math.sin(i),l=Math.cos(n),u=Math.sin(n);if("XYZ"===t.order){let t=s*l,r=s*u,i=o*l,n=o*u;e[0]=a*l,e[4]=-a*u,e[8]=h,e[1]=r+i*h,e[5]=t-n*h,e[9]=-o*a,e[2]=n-t*h,e[6]=i+r*h,e[10]=s*a}else if("YXZ"===t.order){let t=a*l,r=a*u,i=h*l,n=h*u;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*h,e[1]=s*u,e[5]=s*l,e[9]=-o,e[2]=r*o-i,e[6]=n+t*o,e[10]=s*a}else if("ZXY"===t.order){let t=a*l,r=a*u,i=h*l,n=h*u;e[0]=t-n*o,e[4]=-s*u,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*l,e[9]=n-t*o,e[2]=-s*h,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){let t=s*l,r=s*u,i=o*l,n=o*u;e[0]=a*l,e[4]=i*h-r,e[8]=t*h+n,e[1]=a*u,e[5]=n*h+t,e[9]=r*h-i,e[2]=-h,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){let t=s*a,r=s*h,i=o*a,n=o*h;e[0]=a*l,e[4]=n-t*u,e[8]=i*u+r,e[1]=u,e[5]=s*l,e[9]=-o*l,e[2]=-h*l,e[6]=r*u+i,e[10]=t-n*u}else if("XZY"===t.order){let t=s*a,r=s*h,i=o*a,n=o*h;e[0]=a*l,e[4]=-u,e[8]=h*l,e[1]=t*u+n,e[5]=s*l,e[9]=r*u-i,e[2]=i*u-r,e[6]=o*l,e[10]=n*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(tc,t,tp)}lookAt(t,e,r){let i=this.elements;return tm.subVectors(t,e),0===tm.lengthSq()&&(tm.z=1),tm.normalize(),td.crossVectors(r,tm),0===td.lengthSq()&&(1===Math.abs(r.z)?tm.x+=1e-4:tm.z+=1e-4,tm.normalize(),td.crossVectors(r,tm)),td.normalize(),tf.crossVectors(tm,td),i[0]=td.x,i[4]=tf.x,i[8]=tm.x,i[1]=td.y,i[5]=tf.y,i[9]=tm.y,i[2]=td.z,i[6]=tf.z,i[10]=tm.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let r=t.elements,i=e.elements,n=this.elements,s=r[0],o=r[4],a=r[8],h=r[12],l=r[1],u=r[5],c=r[9],p=r[13],d=r[2],f=r[6],m=r[10],y=r[14],g=r[3],b=r[7],v=r[11],x=r[15],w=i[0],S=i[4],M=i[8],_=i[12],A=i[1],T=i[5],C=i[9],E=i[13],R=i[2],O=i[6],I=i[10],k=i[14],P=i[3],B=i[7],L=i[11],z=i[15];return n[0]=s*w+o*A+a*R+h*P,n[4]=s*S+o*T+a*O+h*B,n[8]=s*M+o*C+a*I+h*L,n[12]=s*_+o*E+a*k+h*z,n[1]=l*w+u*A+c*R+p*P,n[5]=l*S+u*T+c*O+p*B,n[9]=l*M+u*C+c*I+p*L,n[13]=l*_+u*E+c*k+p*z,n[2]=d*w+f*A+m*R+y*P,n[6]=d*S+f*T+m*O+y*B,n[10]=d*M+f*C+m*I+y*L,n[14]=d*_+f*E+m*k+y*z,n[3]=g*w+b*A+v*R+x*P,n[7]=g*S+b*T+v*O+x*B,n[11]=g*M+b*C+v*I+x*L,n[15]=g*_+b*E+v*k+x*z,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],r=t[4],i=t[8],n=t[12],s=t[1],o=t[5],a=t[9],h=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3],f=t[7],m=t[11],y=t[15],g=a*p-h*c,b=o*p-h*u,v=o*c-a*u,x=s*p-h*l,w=s*c-a*l,S=s*u-o*l;return e*(f*g-m*b+y*v)-r*(d*g-m*x+y*w)+i*(d*b-f*x+y*S)-n*(d*v-f*w+m*S)}determinantAffine(){let t=this.elements,e=t[0],r=t[4],i=t[8],n=t[1],s=t[5],o=t[9],a=t[2],h=t[6],l=t[10];return e*(s*l-o*h)-r*(n*l-o*a)+i*(n*h-s*a)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,r){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=r),this}invert(){let t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],p=t[11],d=t[12],f=t[13],m=t[14],y=t[15],g=e*o-r*s,b=e*a-i*s,v=e*h-n*s,x=r*a-i*o,w=r*h-n*o,S=i*h-n*a,M=l*f-u*d,_=l*m-c*d,A=l*y-p*d,T=u*m-c*f,C=u*y-p*f,E=c*y-p*m,R=g*E-b*C+v*T+x*A-w*_+S*M;if(0===R)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let O=1/R;return t[0]=(o*E-a*C+h*T)*O,t[1]=(i*C-r*E-n*T)*O,t[2]=(f*S-m*w+y*x)*O,t[3]=(c*w-u*S-p*x)*O,t[4]=(a*A-s*E-h*_)*O,t[5]=(e*E-i*A+n*_)*O,t[6]=(m*v-d*S-y*b)*O,t[7]=(l*S-c*v+p*b)*O,t[8]=(s*C-o*A+h*M)*O,t[9]=(r*A-e*C-n*M)*O,t[10]=(d*w-f*v+y*g)*O,t[11]=(u*v-l*w-p*g)*O,t[12]=(o*_-s*T-a*M)*O,t[13]=(e*T-r*_+i*M)*O,t[14]=(f*b-d*x-m*g)*O,t[15]=(l*x-u*b+c*g)*O,this}scale(t){let e=this.elements,r=t.x,i=t.y,n=t.z;return e[0]*=r,e[4]*=i,e[8]*=n,e[1]*=r,e[5]*=i,e[9]*=n,e[2]*=r,e[6]*=i,e[10]*=n,e[3]*=r,e[7]*=i,e[11]*=n,this}getMaxScaleOnAxis(){let t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,r){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let r=Math.cos(e),i=Math.sin(e),n=1-r,s=t.x,o=t.y,a=t.z,h=n*s,l=n*o;return this.set(h*s+r,h*o-i*a,h*a+i*o,0,h*o+i*a,l*o+r,l*a-i*s,0,h*a-i*o,l*a+i*s,n*a*a+r,0,0,0,0,1),this}makeScale(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,e,r,i,n,s){return this.set(1,r,n,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,r){let i=this.elements,n=e._x,s=e._y,o=e._z,a=e._w,h=n+n,l=s+s,u=o+o,c=n*h,p=n*l,d=n*u,f=s*l,m=s*u,y=o*u,g=a*h,b=a*l,v=a*u,x=r.x,w=r.y,S=r.z;return i[0]=(1-(f+y))*x,i[1]=(p+v)*x,i[2]=(d-b)*x,i[3]=0,i[4]=(p-v)*w,i[5]=(1-(c+y))*w,i[6]=(m+g)*w,i[7]=0,i[8]=(d+b)*S,i[9]=(m-g)*S,i[10]=(1-(c+f))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,r){let i=this.elements;t.x=i[12],t.y=i[13],t.z=i[14];let n=this.determinantAffine();if(0===n)return r.set(1,1,1),e.identity(),this;let s=tl.set(i[0],i[1],i[2]).length(),o=tl.set(i[4],i[5],i[6]).length(),a=tl.set(i[8],i[9],i[10]).length();n<0&&(s=-s),tu.copy(this);let h=1/s,l=1/o,u=1/a;return tu.elements[0]*=h,tu.elements[1]*=h,tu.elements[2]*=h,tu.elements[4]*=l,tu.elements[5]*=l,tu.elements[6]*=l,tu.elements[8]*=u,tu.elements[9]*=u,tu.elements[10]*=u,e.setFromRotationMatrix(tu),r.x=s,r.y=o,r.z=a,this}makePerspective(t,e,r,i,n,s,o=2e3,a=!1){let h,l,u=this.elements;if(a)h=n/(s-n),l=s*n/(s-n);else if(2e3===o)h=-(s+n)/(s-n),l=-2*s*n/(s-n);else if(2001===o)h=-s/(s-n),l=-s*n/(s-n);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=2*n/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*n/(r-i),u[9]=(r+i)/(r-i),u[13]=0,u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,r,i,n,s,o=2e3,a=!1){let h,l,u=this.elements;if(a)h=1/(s-n),l=s/(s-n);else if(2e3===o)h=-2/(s-n),l=-(s+n)/(s-n);else if(2001===o)h=-1/(s-n),l=-n/(s-n);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(r-i),u[9]=0,u[13]=-(r+i)/(r-i),u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,r=t.elements;for(let t=0;t<16;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<16;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){let r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}let tl=new j,tu=new th,tc=new j(0,0,0),tp=new j(1,1,1),td=new j,tf=new j,tm=new j,ty=new th,tg=new U;class tb{constructor(t=0,e=0,r=0,i=tb.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=r,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,r,i=this._order){return this._x=t,this._y=e,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,r=!0){let i=t.elements,n=i[0],s=i[4],o=i[8],a=i[1],h=i[5],l=i[9],u=i[2],c=i[6],p=i[10];switch(e){case"XYZ":this._y=Math.asin(P(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-P(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(o,p),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-u,n),this._z=0);break;case"ZXY":this._x=Math.asin(P(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-P(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,p),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,h));break;case"YZX":this._z=Math.asin(P(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-P(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(c,h),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-l,p),this._y=0);break;default:_("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===r&&this._onChangeCallback(),this}setFromQuaternion(t,e,r){return ty.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ty,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return tg.setFromEuler(this),this.setFromQuaternion(tg,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}tb.DEFAULT_ORDER="XYZ";class tv{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&1<<t)!=0}}let tx=0,tw=new j,tS=new U,tM=new th,t_=new j,tA=new j,tT=new j,tC=new U,tE=new j(1,0,0),tR=new j(0,1,0),tO=new j(0,0,1),tI={type:"added"},tk={type:"removed"},tP={type:"childadded",child:null},tB={type:"childremoved",child:null};class tL extends C{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tx++}),this.uuid=k(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=tL.DEFAULT_UP.clone();const t=new j,e=new tb,r=new U,i=new j(1,1,1);e._onChange(function(){r.setFromEuler(e,!1)}),r._onChange(function(){e.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new th},normalMatrix:{value:new W}}),this.matrix=new th,this.matrixWorld=new th,this.matrixAutoUpdate=tL.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=tL.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new tv,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return tS.setFromAxisAngle(t,e),this.quaternion.multiply(tS),this}rotateOnWorldAxis(t,e){return tS.setFromAxisAngle(t,e),this.quaternion.premultiply(tS),this}rotateX(t){return this.rotateOnAxis(tE,t)}rotateY(t){return this.rotateOnAxis(tR,t)}rotateZ(t){return this.rotateOnAxis(tO,t)}translateOnAxis(t,e){return tw.copy(t).applyQuaternion(this.quaternion),this.position.add(tw.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(tE,t)}translateY(t){return this.translateOnAxis(tR,t)}translateZ(t){return this.translateOnAxis(tO,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(tM.copy(this.matrixWorld).invert())}lookAt(t,e,r){t.isVector3?t_.copy(t):t_.set(t,e,r);let i=this.parent;this.updateWorldMatrix(!0,!1),tA.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?tM.lookAt(tA,t_,this.up):tM.lookAt(t_,tA,this.up),this.quaternion.setFromRotationMatrix(tM),i&&(tM.extractRotation(i.matrixWorld),tS.setFromRotationMatrix(tM),this.quaternion.premultiply(tS.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?A("Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(tI),tP.child=t,this.dispatchEvent(tP),tP.child=null):A("Object3D.add: object not an instance of THREE.Object3D.",t),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}let e=this.children.indexOf(t);return -1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(tk),tB.child=t,this.dispatchEvent(tB),tB.child=null),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),tM.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),tM.multiply(t.parent.matrixWorld)),t.applyMatrix4(tM),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(tI),tP.child=t,this.dispatchEvent(tP),tP.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let r=0,i=this.children.length;r<i;r++){let i=this.children[r].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,r=[]){this[t]===e&&r.push(this);let i=this.children;for(let n=0,s=i.length;n<s;n++)i[n].getObjectsByProperty(t,e,r);return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tA,t,tT),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tA,tC,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}intersectsFrustum(){}traverse(t){t(this);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,r=t.y,i=t.z,n=this.matrix.elements;n[12]+=e-n[0]*e-n[4]*r-n[8]*i,n[13]+=r-n[1]*e-n[5]*r-n[9]*i,n[14]+=i-n[2]*e-n[6]*r-n[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].updateMatrixWorld(t)}updateWorldMatrix(t,e,r=!1){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,r=!0),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0,r)}}toJSON(t){let e=void 0===t||"string"==typeof t,r={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};function n(e,r){return void 0===e[r.uuid]&&(e[r.uuid]=r.toJSON(t)),r.uuid}if(i.uuid=this.uuid,i.type=this.type,i.name=this.name,i.castShadow=this.castShadow,i.receiveShadow=this.receiveShadow,i.visible=this.visible,i.frustumCulled=this.frustumCulled,i.renderOrder=this.renderOrder,i.static=this.static,i.matrixAutoUpdate=this.matrixAutoUpdate,Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),null!==this.pivot&&(i.pivot=this.pivot.toArray()),void 0!==this.morphTargetDictionary&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(t=>({...t})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(t),i.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let r=e.shapes;if(Array.isArray(r))for(let e=0,i=r.length;e<i;e++){let i=r[e];n(t.shapes,i)}else n(t.shapes,r)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(n(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let r=0,i=this.material.length;r<i;r++)e.push(n(t.materials,this.material[r]));i.material=e}else i.material=n(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){let r=this.animations[e];i.animations.push(n(t.animations,r))}}if(e){let e=s(t.geometries),i=s(t.materials),n=s(t.textures),o=s(t.images),a=s(t.shapes),h=s(t.skeletons),l=s(t.animations),u=s(t.nodes);e.length>0&&(r.geometries=e),i.length>0&&(r.materials=i),n.length>0&&(r.textures=n),o.length>0&&(r.images=o),a.length>0&&(r.shapes=a),h.length>0&&(r.skeletons=h),l.length>0&&(r.animations=l),u.length>0&&(r.nodes=u)}return r.object=i,r;function s(t){let e=[];for(let r in t){let i=t[r];delete i.metadata,e.push(i)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let r=t.children[e];this.add(r.clone())}return this}dispose(){this.dispatchEvent({type:"dispose"})}}tL.DEFAULT_UP=new j(0,1,0),tL.DEFAULT_MATRIX_AUTO_UPDATE=!0,tL.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class tz extends tL{constructor(){super(),this.isGroup=!0,this.type="Group"}}let tN={type:"move"},tF={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},tU={h:0,s:0,l:0},tj={h:0,s:0,l:0};function tD(t,e,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?t+(e-t)*6*r:r<.5?e:r<2/3?t+(e-t)*6*(2/3-r):t}class tV{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){return void 0===e&&void 0===r?t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t):this.setRGB(t,e,r),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=p){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,$.colorSpaceToWorking(this,e),this}setRGB(t,e,r,i=$.workingColorSpace){return this.r=t,this.g=e,this.b=r,$.colorSpaceToWorking(this,i),this}setHSL(t,e,r,i=$.workingColorSpace){if(t=B(t,1),e=P(e,0,1),r=P(r,0,1),0===e)this.r=this.g=this.b=r;else{let i=r<=.5?r*(1+e):r+e-r*e,n=2*r-i;this.r=tD(n,i,t+1/3),this.g=tD(n,i,t),this.b=tD(n,i,t-1/3)}return $.colorSpaceToWorking(this,i),this}setStyle(t,e=p){let r;function i(e){void 0!==e&&1>parseFloat(e)&&_("Color: Alpha component of "+t+" will be ignored.")}if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let n,s=r[1],o=r[2];switch(s){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,e);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,e);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,e);break;default:_("Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){let i=r[1],n=i.length;if(3===n)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===n)return this.setHex(parseInt(i,16),e);_("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=p){let r=tF[t.toLowerCase()];return void 0!==r?this.setHex(r,e):_("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=J(t.r),this.g=J(t.g),this.b=J(t.b),this}copyLinearToSRGB(t){return this.r=Y(t.r),this.g=Y(t.g),this.b=Y(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=p){return $.workingToColorSpace(tW.copy(this),t),65536*Math.round(P(255*tW.r,0,255))+256*Math.round(P(255*tW.g,0,255))+Math.round(P(255*tW.b,0,255))}getHexString(t=p){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$.workingColorSpace){let r,i;$.workingToColorSpace(tW.copy(this),e);let n=tW.r,s=tW.g,o=tW.b,a=Math.max(n,s,o),h=Math.min(n,s,o),l=(h+a)/2;if(h===a)r=0,i=0;else{let t=a-h;switch(i=l<=.5?t/(a+h):t/(2-a-h),a){case n:r=(s-o)/t+6*(s<o);break;case s:r=(o-n)/t+2;break;case o:r=(n-s)/t+4}r/=6}return t.h=r,t.s=i,t.l=l,t}getRGB(t,e=$.workingColorSpace){return $.workingToColorSpace(tW.copy(this),e),t.r=tW.r,t.g=tW.g,t.b=tW.b,t}getStyle(t=p){$.workingToColorSpace(tW.copy(this),t);let e=tW.r,r=tW.g,i=tW.b;return t!==p?`color(${t} ${e.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*r)},${Math.round(255*i)})`}offsetHSL(t,e,r){return this.getHSL(tU),this.setHSL(tU.h+t,tU.s+e,tU.l+r)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(tU),t.getHSL(tj);let r=L(tU.h,tj.h,e),i=L(tU.s,tj.s,e),n=L(tU.l,tj.l,e);return this.setHSL(r,i,n),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,r=this.g,i=this.b,n=t.elements;return this.r=n[0]*e+n[3]*r+n[6]*i,this.g=n[1]*e+n[4]*r+n[7]*i,this.b=n[2]*e+n[5]*r+n[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let tW=new tV;tV.NAMES=tF;class tq{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new tV(t),this.density=e}clone(){return new tq(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class tG{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new tV(t),this.near=e,this.far=r}clone(){return new tG(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tH extends tL{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new tb,this.environmentIntensity=1,this.environmentRotation=new tb,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e.object.backgroundBlurriness=this.backgroundBlurriness,e.object.backgroundIntensity=this.backgroundIntensity,e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentIntensity=this.environmentIntensity,e.object.environmentRotation=this.environmentRotation.toArray(),e}}let t$=new j,tJ=new j,tY=new j,tX=new j,tZ=new j,tK=new j,tQ=new j,t0=new j,t1=new j,t2=new j,t3=new ti,t5=new ti,t4=new ti;class t6{constructor(t=new j,e=new j,r=new j){this.a=t,this.b=e,this.c=r}static getNormal(t,e,r,i){i.subVectors(r,e),t$.subVectors(t,e),i.cross(t$);let n=i.lengthSq();return n>0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(t,e,r,i,n){t$.subVectors(i,e),tJ.subVectors(r,e),tY.subVectors(t,e);let s=t$.dot(t$),o=t$.dot(tJ),a=t$.dot(tY),h=tJ.dot(tJ),l=tJ.dot(tY),u=s*h-o*o;if(0===u)return n.set(0,0,0),null;let c=1/u,p=(h*a-o*l)*c,d=(s*l-o*a)*c;return n.set(1-p-d,d,p)}static containsPoint(t,e,r,i){return null!==this.getBarycoord(t,e,r,i,tX)&&tX.x>=0&&tX.y>=0&&tX.x+tX.y<=1}static getInterpolation(t,e,r,i,n,s,o,a){return null===this.getBarycoord(t,e,r,i,tX)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(n,tX.x),a.addScaledVector(s,tX.y),a.addScaledVector(o,tX.z),a)}static getInterpolatedAttribute(t,e,r,i,n,s){return t3.setScalar(0),t5.setScalar(0),t4.setScalar(0),t3.fromBufferAttribute(t,e),t5.fromBufferAttribute(t,r),t4.fromBufferAttribute(t,i),s.setScalar(0),s.addScaledVector(t3,n.x),s.addScaledVector(t5,n.y),s.addScaledVector(t4,n.z),s}static isFrontFacing(t,e,r,i){return t$.subVectors(r,e),tJ.subVectors(t,e),0>t$.cross(tJ).dot(i)}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return t$.subVectors(this.c,this.b),tJ.subVectors(this.a,this.b),.5*t$.cross(tJ).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return t6.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return t6.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,r,i,n){return t6.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}containsPoint(t){return t6.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return t6.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let r,i,n=this.a,s=this.b,o=this.c;tZ.subVectors(s,n),tK.subVectors(o,n),t0.subVectors(t,n);let a=tZ.dot(t0),h=tK.dot(t0);if(a<=0&&h<=0)return e.copy(n);t1.subVectors(t,s);let l=tZ.dot(t1),u=tK.dot(t1);if(l>=0&&u<=l)return e.copy(s);let c=a*u-l*h;if(c<=0&&a>=0&&l<=0)return r=a/(a-l),e.copy(n).addScaledVector(tZ,r);t2.subVectors(t,o);let p=tZ.dot(t2),d=tK.dot(t2);if(d>=0&&p<=d)return e.copy(o);let f=p*h-a*d;if(f<=0&&h>=0&&d<=0)return i=h/(h-d),e.copy(n).addScaledVector(tK,i);let m=l*d-p*u;if(m<=0&&u-l>=0&&p-d>=0)return tQ.subVectors(o,s),i=(u-l)/(u-l+(p-d)),e.copy(s).addScaledVector(tQ,i);let y=1/(m+f+c);return r=f*y,i=c*y,e.copy(n).addScaledVector(tZ,r).addScaledVector(tK,i)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class t8{constructor(t=new j(Infinity,Infinity,Infinity),e=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e+=3)this.expandByPoint(t7.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,r=t.count;e<r;e++)this.expandByPoint(t7.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let r=t7.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let r=t.geometry;if(void 0!==r){let i=r.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,r=i.count;e<r;e++)!0===t.isMesh?t.getVertexPosition(e,t7):t7.fromBufferAttribute(i,e),t7.applyMatrix4(t.matrixWorld),this.expandByPoint(t7);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),et.copy(t.boundingBox)):(null===r.boundingBox&&r.computeBoundingBox(),et.copy(r.boundingBox)),et.applyMatrix4(t.matrixWorld),this.union(et)}let i=t.children;for(let t=0,r=i.length;t<r;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,t7),t7.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ea),eh.subVectors(this.max,ea),ee.subVectors(t.a,ea),er.subVectors(t.b,ea),ei.subVectors(t.c,ea),en.subVectors(er,ee),es.subVectors(ei,er),eo.subVectors(ee,ei);let e=[0,-en.z,en.y,0,-es.z,es.y,0,-eo.z,eo.y,en.z,0,-en.x,es.z,0,-es.x,eo.z,0,-eo.x,-en.y,en.x,0,-es.y,es.x,0,-eo.y,eo.x,0];return!!ec(e,ee,er,ei,eh)&&!!ec(e=[1,0,0,0,1,0,0,0,1],ee,er,ei,eh)&&(el.crossVectors(en,es),ec(e=[el.x,el.y,el.z],ee,er,ei,eh))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,t7).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(t7).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(t9[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),t9[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),t9[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),t9[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),t9[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),t9[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),t9[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),t9[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(t9)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let t9=[new j,new j,new j,new j,new j,new j,new j,new j],t7=new j,et=new t8,ee=new j,er=new j,ei=new j,en=new j,es=new j,eo=new j,ea=new j,eh=new j,el=new j,eu=new j;function ec(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){eu.fromArray(t,s);let o=n.x*Math.abs(eu.x)+n.y*Math.abs(eu.y)+n.z*Math.abs(eu.z),a=e.dot(eu),h=r.dot(eu),l=i.dot(eu);if(Math.max(-Math.max(a,h,l),Math.min(a,h,l))>o)return!1}return!0}let ep=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),r=new Uint32Array(t),i=new Uint32Array(512),n=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(i[t]=0,i[256|t]=32768,n[t]=24,n[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,n[t]=-e-1,n[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,n[t]=13,n[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,n[t]=24,n[256|t]=24):(i[t]=31744,i[256|t]=64512,n[t]=13,n[256|t]=13)}let s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,r=0;for(;(8388608&e)==0;)e<<=1,r-=8388608;e&=-8388609,r+=0x38800000,s[t]=e|r}for(let t=1024;t<2048;++t)s[t]=0x38000000+(t-1024<<13);for(let t=1;t<31;++t)o[t]=t<<23;o[31]=0x47800000,o[32]=0x80000000;for(let t=33;t<63;++t)o[t]=0x80000000+(t-32<<23);o[63]=0xc7800000;for(let t=1;t<64;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}();function ed(t){Math.abs(t)>65504&&_("DataUtils.toHalfFloat(): Value out of range."),t=P(t,-65504,65504),ep.floatView[0]=t;let e=ep.uint32View[0],r=e>>23&511;return ep.baseTable[r]+((8388607&e)>>ep.shiftTable[r])}function ef(t){let e=t>>10;return ep.uint32View[0]=ep.mantissaTable[ep.offsetTable[e]+(1023&t)]+ep.exponentTable[e],ep.floatView[0]}let em=new j,ey=new F,eg=0;class eb extends C{constructor(t,e,r=!1){if(super(),Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:eg++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=r,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[t+i]=e.array[r+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,r=this.count;e<r;e++)ey.fromBufferAttribute(this,e),ey.applyMatrix3(t),this.setXY(e,ey.x,ey.y);else if(3===this.itemSize)for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyMatrix3(t),this.setXYZ(e,em.x,em.y,em.z);return this}applyMatrix4(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyMatrix4(t),this.setXYZ(e,em.x,em.y,em.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyNormalMatrix(t),this.setXYZ(e,em.x,em.y,em.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.transformDirection(t),this.setXYZ(e,em.x,em.y,em.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let r=this.array[t*this.itemSize+e];return this.normalized&&(r=z(r,this.array)),r}setComponent(t,e,r){return this.normalized&&(r=N(r,this.array)),this.array[t*this.itemSize+e]=r,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=z(e,this.array)),e}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=z(e,this.array)),e}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=z(e,this.array)),e}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=z(e,this.array)),e}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.array[t+0]=e,this.array[t+1]=r,this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this}setXYZW(t,e,r,i,n){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),n=N(n,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=n,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return t.name=this.name,t.usage=this.usage,t.gpuType=this.gpuType,t}dispose(){this.dispatchEvent({type:"dispose"})}}class ev extends eb{constructor(t,e,r){super(new Uint16Array(t),e,r)}}class ex extends eb{constructor(t,e,r){super(new Uint32Array(t),e,r)}}class ew extends eb{constructor(t,e,r){super(new Float32Array(t),e,r)}}let eS=new t8,eM=new j,e_=new j;class eA{constructor(t=new j,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let r=this.center;void 0!==e?r.copy(e):eS.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;e<n;e++)i=Math.max(i,r.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let r=this.center.distanceToSquared(t);return e.copy(t),r>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;eM.subVectors(t,this.center);let e=eM.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),r=(t-this.radius)*.5;this.center.addScaledVector(eM,r/t),this.radius+=r}return this}union(t){return t.isEmpty()||(this.isEmpty()?this.copy(t):!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(e_.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(eM.copy(t.center).add(e_)),this.expandByPoint(eM.copy(t.center).sub(e_)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let eT=0,eC=new th,eE=new tL,eR=new j,eO=new t8,eI=new t8,ek=new j;class eP extends C{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:eT++}),this.uuid=k(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(!function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ev:ex)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,r=0){this.groups.push({start:t,count:e,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let r=this.attributes.normal;if(void 0!==r){let e=new W().getNormalMatrix(t);r.applyNormalMatrix(e),r.needsUpdate=!0}let i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(t){return eC.makeRotationFromQuaternion(t),this.applyMatrix4(eC),this}rotateX(t){return eC.makeRotationX(t),this.applyMatrix4(eC),this}rotateY(t){return eC.makeRotationY(t),this.applyMatrix4(eC),this}rotateZ(t){return eC.makeRotationZ(t),this.applyMatrix4(eC),this}translate(t,e,r){return eC.makeTranslation(t,e,r),this.applyMatrix4(eC),this}scale(t,e,r){return eC.makeScale(t,e,r),this.applyMatrix4(eC),this}lookAt(t){return eE.lookAt(t),eE.updateMatrix(),this.applyMatrix4(eE.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(eR).negate(),this.translate(eR.x,eR.y,eR.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];e.push(i.x,i.y,i.z||0)}this.setAttribute("position",new ew(e,3))}else{let r=Math.min(t.length,e.count);for(let i=0;i<r;i++){let r=t[i];e.setXYZ(i,r.x,r.y,r.z||0)}t.length>e.count&&_("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t8);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){A("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(Infinity,Infinity,Infinity));return}if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){let r=e[t];eO.setFromBufferAttribute(r),this.morphTargetsRelative?(ek.addVectors(this.boundingBox.min,eO.min),this.boundingBox.expandByPoint(ek),ek.addVectors(this.boundingBox.max,eO.max),this.boundingBox.expandByPoint(ek)):(this.boundingBox.expandByPoint(eO.min),this.boundingBox.expandByPoint(eO.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&A('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eA);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){A("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){let r=this.boundingSphere.center;if(eO.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){let r=e[t];eI.setFromBufferAttribute(r),this.morphTargetsRelative?(ek.addVectors(eO.min,eI.min),eO.expandByPoint(ek),ek.addVectors(eO.max,eI.max),eO.expandByPoint(ek)):(eO.expandByPoint(eI.min),eO.expandByPoint(eI.max))}eO.getCenter(r);let i=0;for(let e=0,n=t.count;e<n;e++)ek.fromBufferAttribute(t,e),i=Math.max(i,r.distanceToSquared(ek));if(e)for(let n=0,s=e.length;n<s;n++){let s=e[n],o=this.morphTargetsRelative;for(let e=0,n=s.count;e<n;e++)ek.fromBufferAttribute(s,e),o&&(eR.fromBufferAttribute(t,e),ek.add(eR)),i=Math.max(i,r.distanceToSquared(ek))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&A('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void A("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let r=e.position,i=e.normal,n=e.uv,s=this.getAttribute("tangent");(void 0===s||s.count!==r.count)&&(s=new eb(new Float32Array(4*r.count),4),this.setAttribute("tangent",s));let o=[],a=[];for(let t=0;t<r.count;t++)o[t]=new j,a[t]=new j;let h=new j,l=new j,u=new j,c=new F,p=new F,d=new F,f=new j,m=new j,y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,i=y.length;e<i;++e){let i=y[e],s=i.start,g=i.count;for(let e=s,i=s+g;e<i;e+=3)!function(t,e,i){h.fromBufferAttribute(r,t),l.fromBufferAttribute(r,e),u.fromBufferAttribute(r,i),c.fromBufferAttribute(n,t),p.fromBufferAttribute(n,e),d.fromBufferAttribute(n,i),l.sub(h),u.sub(h),p.sub(c),d.sub(c);let s=1/(p.x*d.y-d.x*p.y);isFinite(s)&&(f.copy(l).multiplyScalar(d.y).addScaledVector(u,-p.y).multiplyScalar(s),m.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(s),o[t].add(f),o[e].add(f),o[i].add(f),a[t].add(m),a[e].add(m),a[i].add(m))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new j,b=new j,v=new j,x=new j;function w(t){v.fromBufferAttribute(i,t),x.copy(v);let e=o[t];g.copy(e),g.sub(v.multiplyScalar(v.dot(e))).normalize(),b.crossVectors(x,e);let r=b.dot(a[t]);s.setXYZW(t,g.x,g.y,g.z,r<0?-1:1)}for(let e=0,r=y.length;e<r;++e){let r=y[e],i=r.start,n=r.count;for(let e=i,r=i+n;e<r;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}this._transformed=!0}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let r=this.getAttribute("normal");if(void 0===r||r.count!==e.count)r=new eb(new Float32Array(3*e.count),3),this.setAttribute("normal",r);else for(let t=0,e=r.count;t<e;t++)r.setXYZ(t,0,0,0);let i=new j,n=new j,s=new j,o=new j,a=new j,h=new j,l=new j,u=new j;if(t)for(let c=0,p=t.count;c<p;c+=3){let p=t.getX(c+0),d=t.getX(c+1),f=t.getX(c+2);i.fromBufferAttribute(e,p),n.fromBufferAttribute(e,d),s.fromBufferAttribute(e,f),l.subVectors(s,n),u.subVectors(i,n),l.cross(u),o.fromBufferAttribute(r,p),a.fromBufferAttribute(r,d),h.fromBufferAttribute(r,f),o.add(l),a.add(l),h.add(l),r.setXYZ(p,o.x,o.y,o.z),r.setXYZ(d,a.x,a.y,a.z),r.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,o=e.count;t<o;t+=3)i.fromBufferAttribute(e,t+0),n.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),l.subVectors(s,n),u.subVectors(i,n),l.cross(u),r.setXYZ(t+0,l.x,l.y,l.z),r.setXYZ(t+1,l.x,l.y,l.z),r.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,r=t.count;e<r;e++)ek.fromBufferAttribute(t,e),ek.normalize(),t.setXYZ(e,ek.x,ek.y,ek.z)}toNonIndexed(){function t(t,e){let r=t.array,i=t.itemSize,n=t.normalized,s=new r.constructor(e.length*i),o=0,a=0;for(let n=0,h=e.length;n<h;n++){o=t.isInterleavedBufferAttribute?e[n]*t.data.stride+t.offset:e[n]*i;for(let t=0;t<i;t++)s[a++]=r[o++]}return new eb(s,i,n)}if(null===this.index)return _("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new eP,r=this.index.array,i=this.attributes;for(let n in i){let s=t(i[n],r);e.setAttribute(n,s)}let n=this.morphAttributes;for(let i in n){let s=[],o=n[i];for(let e=0,i=o.length;e<i;e++){let i=t(o[e],r);s.push(i)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let t=0,r=s.length;t<r;t++){let r=s[t];e.addGroup(r.start,r.count,r.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,t.name=this.name,Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){let e=this.parameters;for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let r=this.attributes;for(let e in r){let i=r[e];t.data.attributes[e]=i.toJSON(t.data)}let i={},n=!1;for(let e in this.morphAttributes){let r=this.morphAttributes[e],s=[];for(let e=0,i=r.length;e<i;e++){let i=r[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,n=!0)}n&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return null!==o&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let r=t.index;null!==r&&this.setIndex(r.clone());let i=t.attributes;for(let t in i){let r=i[t];this.setAttribute(t,r.clone(e))}let n=t.morphAttributes;for(let t in n){let r=[],i=n[t];for(let t=0,n=i.length;t<n;t++)r.push(i[t].clone(e));this.morphAttributes[t]=r}this.morphTargetsRelative=t.morphTargetsRelative;let s=t.groups;for(let t=0,e=s.length;t<e;t++){let e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}let o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());let a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this._transformed=t._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}class eB{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=k()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,r){t*=this.stride,r*=e.stride;for(let i=0,n=this.stride;i<n;i++)this.array[t+i]=e.array[r+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(e,this.stride);return r.setUsage(this.usage),r}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer)));let e={uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride};return e.usage=this.usage,e}}let eL=new j;class ez{constructor(t,e,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,r=this.data.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.applyMatrix4(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.applyNormalMatrix(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.transformDirection(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}getComponent(t,e){let r=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(r=z(r,this.array)),r}setComponent(t,e,r){return this.normalized&&(r=N(r,this.array)),this.data.array[t*this.data.stride+this.offset+e]=r,this}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=z(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=z(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=z(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=z(e,this.array)),e}setXY(t,e,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this}setXYZ(t,e,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this}setXYZW(t,e,r,i,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),n=N(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=n,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new ez(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{S("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return new eb(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{S("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}let eN=new j,eF=new j,eU=new W;class ej{constructor(t=new j(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){let i=eN.subVectors(r,e).cross(eF.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,r=!0){let i=t.delta(eN),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/n;return!0===r&&(s<0||s>1)?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let r=e||eU.getNormalMatrix(t),i=this.coplanarPoint(eN).applyMatrix4(t),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(n),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}toJSON(){return{normal:this.normal.toArray(),constant:this.constant}}fromJSON(t){return this.normal.fromArray(t.normal),this.constant=t.constant,this}}let eD=0;class eV extends C{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:eD++}),this.uuid=k(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tV(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let r=t[e];if(void 0===r){_(`Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(void 0===i){_(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector2&&r&&r.isVector2||i&&i.isEuler&&r&&r.isEuler||i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(t){let e=[];for(let r in t){let i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,r.blending=this.blending,r.side=this.side,r.shadowSide=this.shadowSide,r.vertexColors=this.vertexColors,r.opacity=this.opacity,r.transparent=this.transparent,r.blendSrc=this.blendSrc,r.blendDst=this.blendDst,r.blendEquation=this.blendEquation,r.blendSrcAlpha=this.blendSrcAlpha,r.blendDstAlpha=this.blendDstAlpha,r.blendEquationAlpha=this.blendEquationAlpha,r.blendColor=this.blendColor.getHex(),r.blendAlpha=this.blendAlpha,r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.clipIntersection=this.clipIntersection,r.clipShadows=this.clipShadows,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,r.stencilWrite=this.stencilWrite,r.polygonOffset=this.polygonOffset,r.polygonOffsetFactor=this.polygonOffsetFactor,r.polygonOffsetUnits=this.polygonOffsetUnits,r.dithering=this.dithering,r.alphaTest=this.alphaTest,r.alphaHash=this.alphaHash,r.alphaToCoverage=this.alphaToCoverage,r.premultipliedAlpha=this.premultipliedAlpha,r.forceSinglePass=this.forceSinglePass,r.allowOverride=this.allowOverride,r.visible=this.visible,r.toneMapped=this.toneMapped,r.name=this.name,this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(r.dispersion=this.dispersion),void 0!==this.retroreflectivity&&(r.retroreflectivity=this.retroreflectivity),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),Array.isArray(this.clippingPlanes)&&this.clippingPlanes.length>0&&(r.clippingPlanes=this.clippingPlanes.map(t=>t.toJSON())),void 0!==this.rotation&&(r.rotation=this.rotation),void 0!==this.depthPacking&&(r.depthPacking=this.depthPacking),void 0!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.linecap&&(r.linecap=this.linecap),void 0!==this.linejoin&&(r.linejoin=this.linejoin),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),void 0!==this.wireframe&&(r.wireframe=this.wireframe),void 0!==this.wireframeLinewidth&&(r.wireframeLinewidth=this.wireframeLinewidth),void 0!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),void 0!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),void 0!==this.flatShading&&(r.flatShading=this.flatShading),void 0!==this.fog&&(r.fog=this.fog),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){let e=i(t.textures),n=i(t.images);e.length>0&&(r.textures=e),n.length>0&&(r.images=n)}return r}fromJSON(t,e){if(void 0!==t.uuid&&(this.uuid=t.uuid),void 0!==t.name&&(this.name=t.name),void 0!==t.color&&void 0!==this.color&&this.color.setHex(t.color),void 0!==t.roughness&&(this.roughness=t.roughness),void 0!==t.metalness&&(this.metalness=t.metalness),void 0!==t.sheen&&(this.sheen=t.sheen),void 0!==t.sheenColor&&(this.sheenColor=new tV().setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(this.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==this.emissive&&this.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==this.specular&&this.specular.setHex(t.specular),void 0!==t.specularIntensity&&(this.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(this.shininess=t.shininess),void 0!==t.clearcoat&&(this.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(this.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(this.dispersion=t.dispersion),void 0!==t.retroreflectivity&&(this.retroreflectivity=t.retroreflectivity),void 0!==t.iridescence&&(this.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(this.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(this.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(this.transmission=t.transmission),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.attenuationDistance&&(this.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(this.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(this.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(this.fog=t.fog),void 0!==t.flatShading&&(this.flatShading=t.flatShading),void 0!==t.blending&&(this.blending=t.blending),void 0!==t.combine&&(this.combine=t.combine),void 0!==t.side&&(this.side=t.side),void 0!==t.shadowSide&&(this.shadowSide=t.shadowSide),void 0!==t.opacity&&(this.opacity=t.opacity),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.alphaTest&&(this.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(this.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(this.depthFunc=t.depthFunc),void 0!==t.depthTest&&(this.depthTest=t.depthTest),void 0!==t.depthWrite&&(this.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(this.colorWrite=t.colorWrite),void 0!==t.clippingPlanes&&(this.clippingPlanes=t.clippingPlanes.map(t=>new ej().fromJSON(t))),void 0!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection),void 0!==t.clipShadows&&(this.clipShadows=t.clipShadows),void 0!==t.depthPacking&&(this.depthPacking=t.depthPacking),void 0!==t.blendSrc&&(this.blendSrc=t.blendSrc),void 0!==t.blendDst&&(this.blendDst=t.blendDst),void 0!==t.blendEquation&&(this.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(this.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(this.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(this.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(this.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(this.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(this.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(this.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(this.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(this.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(this.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(this.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(this.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(this.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(this.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(this.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.linewidth&&(this.linewidth=t.linewidth),void 0!==t.linecap&&(this.linecap=t.linecap),void 0!==t.linejoin&&(this.linejoin=t.linejoin),void 0!==t.dashSize&&(this.dashSize=t.dashSize),void 0!==t.gapSize&&(this.gapSize=t.gapSize),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.polygonOffset&&(this.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(this.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(this.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(this.dithering=t.dithering),void 0!==t.alphaToCoverage&&(this.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(this.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(this.forceSinglePass=t.forceSinglePass),void 0!==t.allowOverride&&(this.allowOverride=t.allowOverride),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.toneMapped&&(this.toneMapped=t.toneMapped),void 0!==t.userData&&(this.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?this.vertexColors=t.vertexColors>0:this.vertexColors=t.vertexColors),void 0!==t.size&&(this.size=t.size),void 0!==t.sizeAttenuation&&(this.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(this.map=e[t.map]||null),void 0!==t.matcap&&(this.matcap=e[t.matcap]||null),void 0!==t.alphaMap&&(this.alphaMap=e[t.alphaMap]||null),void 0!==t.bumpMap&&(this.bumpMap=e[t.bumpMap]||null),void 0!==t.bumpScale&&(this.bumpScale=t.bumpScale),void 0!==t.normalMap&&(this.normalMap=e[t.normalMap]||null),void 0!==t.normalMapType&&(this.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),this.normalScale=new F().fromArray(e)}return void 0!==t.displacementMap&&(this.displacementMap=e[t.displacementMap]||null),void 0!==t.displacementScale&&(this.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(this.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(this.roughnessMap=e[t.roughnessMap]||null),void 0!==t.metalnessMap&&(this.metalnessMap=e[t.metalnessMap]||null),void 0!==t.emissiveMap&&(this.emissiveMap=e[t.emissiveMap]||null),void 0!==t.emissiveIntensity&&(this.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(this.specularMap=e[t.specularMap]||null),void 0!==t.specularIntensityMap&&(this.specularIntensityMap=e[t.specularIntensityMap]||null),void 0!==t.specularColorMap&&(this.specularColorMap=e[t.specularColorMap]||null),void 0!==t.envMap&&(this.envMap=e[t.envMap]||null),void 0!==t.envMapRotation&&this.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(this.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(this.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(this.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(this.lightMap=e[t.lightMap]||null),void 0!==t.lightMapIntensity&&(this.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(this.aoMap=e[t.aoMap]||null),void 0!==t.aoMapIntensity&&(this.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(this.gradientMap=e[t.gradientMap]||null),void 0!==t.clearcoatMap&&(this.clearcoatMap=e[t.clearcoatMap]||null),void 0!==t.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=e[t.clearcoatRoughnessMap]||null),void 0!==t.clearcoatNormalMap&&(this.clearcoatNormalMap=e[t.clearcoatNormalMap]||null),void 0!==t.clearcoatNormalScale&&(this.clearcoatNormalScale=new F().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(this.iridescenceMap=e[t.iridescenceMap]||null),void 0!==t.iridescenceThicknessMap&&(this.iridescenceThicknessMap=e[t.iridescenceThicknessMap]||null),void 0!==t.transmissionMap&&(this.transmissionMap=e[t.transmissionMap]||null),void 0!==t.thicknessMap&&(this.thicknessMap=e[t.thicknessMap]||null),void 0!==t.anisotropyMap&&(this.anisotropyMap=e[t.anisotropyMap]||null),void 0!==t.sheenColorMap&&(this.sheenColorMap=e[t.sheenColorMap]||null),void 0!==t.sheenRoughnessMap&&(this.sheenRoughnessMap=e[t.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,r=null;if(null!==e){let t=e.length;r=Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class eW extends eV{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tV(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let eq=new j,eG=new j,eH=new j,e$=new F,eJ=new F,eY=new th,eX=new j,eZ=new j,eK=new j,eQ=new F,e0=new F,e1=new F;class e2 extends tL{constructor(t=new eW){if(super(),this.isSprite=!0,this.type="Sprite",void 0===r){r=new eP;const t=new eB(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);r.setIndex([0,1,2,0,2,3]),r.setAttribute("position",new ez(t,3,0,!1)),r.setAttribute("uv",new ez(t,2,3,!1))}this.geometry=r,this.material=t,this.center=new F(.5,.5),this.count=1}intersectsFrustum(t){return t.intersectsSprite(this)}raycast(t,e){let r,i;null===t.camera&&A('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),eG.setFromMatrixScale(this.matrixWorld),eY.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),eH.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&eG.multiplyScalar(-eH.z);let n=this.material.rotation;0!==n&&(i=Math.cos(n),r=Math.sin(n));let s=this.center;e3(eX.set(-.5,-.5,0),eH,s,eG,r,i),e3(eZ.set(.5,-.5,0),eH,s,eG,r,i),e3(eK.set(.5,.5,0),eH,s,eG,r,i),eQ.set(0,0),e0.set(1,0),e1.set(1,1);let o=t.ray.intersectTriangle(eX,eZ,eK,!1,eq);if(null===o&&(e3(eZ.set(-.5,.5,0),eH,s,eG,r,i),e0.set(0,1),null===(o=t.ray.intersectTriangle(eX,eK,eZ,!1,eq))))return;let a=t.ray.origin.distanceTo(eq);a<t.near||a>t.far||e.push({distance:a,point:eq.clone(),uv:t6.getInterpolation(eq,eX,eZ,eK,eQ,e0,e1,new F),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function e3(t,e,r,i,n,s){e$.subVectors(t,r).addScalar(.5).multiply(i),void 0!==n?(eJ.x=s*e$.x-n*e$.y,eJ.y=n*e$.x+s*e$.y):eJ.copy(e$),t.copy(e),t.x+=eJ.x,t.y+=eJ.y,t.applyMatrix4(eY)}let e5=new j,e4=new j;class e6 extends tL{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);let e=t.levels;for(let t=0,r=e.length;t<r;t++){let r=e[t];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,r=0){let i;e=Math.abs(e);let n=this.levels;for(i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,hysteresis:r,object:t}),this.add(t),this}removeLevel(t){let e=this.levels;for(let r=0;r<e.length;r++)if(e[r].distance===t){let t=e.splice(r,1);return this.remove(t[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){let e=this.levels;if(e.length>0){let r,i;for(r=1,i=e.length;r<i;r++){let i=e[r].distance;if(e[r].object.visible&&(i-=i*e[r].hysteresis),t<i)break}return e[r-1].object}return null}raycast(t,e){if(this.levels.length>0){e5.setFromMatrixPosition(this.matrixWorld);let r=t.ray.origin.distanceTo(e5);this.getObjectForDistance(r).raycast(t,e)}}update(t){let e=this.levels;if(e.length>1){let r,i;e5.setFromMatrixPosition(t.matrixWorld),e4.setFromMatrixPosition(this.matrixWorld);let n=e5.distanceTo(e4)/t.zoom;for(e[0].object.visible=!0,r=1,i=e.length;r<i;r++){let t=e[r].distance;if(e[r].object.visible&&(t-=t*e[r].hysteresis),n>=t)e[r-1].object.visible=!1,e[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}}toJSON(t){let e=super.toJSON(t);e.object.autoUpdate=this.autoUpdate,e.object.levels=[];let r=this.levels;for(let t=0,i=r.length;t<i;t++){let i=r[t];e.object.levels.push({object:i.object.uuid,distance:i.distance,hysteresis:i.hysteresis})}return e}}let e8=new j,e9=new j,e7=new j,rt=new j;class re{constructor(t=new j,e=new j(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,e8)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=e8.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(e8.copy(this.origin).addScaledVector(this.direction,e),e8.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){let n,s,o,a;e9.copy(t).add(e).multiplyScalar(.5),e7.copy(e).sub(t).normalize(),rt.copy(this.origin).sub(e9);let h=.5*t.distanceTo(e),l=-this.direction.dot(e7),u=rt.dot(this.direction),c=-rt.dot(e7),p=rt.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(n=l*c-u,s=l*u-c,a=h*d,n>=0)if(s>=-a)if(s<=a){let t=1/d;n*=t,s*=t,o=n*(n+l*s+2*u)+s*(l*n+s+2*c)+p}else o=-(n=Math.max(0,-(l*(s=h)+u)))*n+s*(s+2*c)+p;else o=-(n=Math.max(0,-(l*(s=-h)+u)))*n+s*(s+2*c)+p;else s<=-a?(s=(n=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),o=-n*n+s*(s+2*c)+p):s<=a?(n=0,o=(s=Math.min(Math.max(-h,-c),h))*(s+2*c)+p):(s=(n=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),o=-n*n+s*(s+2*c)+p);else s=l>0?-h:h,o=-(n=Math.max(0,-(l*s+u)))*n+s*(s+2*c)+p;return r&&r.copy(this.origin).addScaledVector(this.direction,n),i&&i.copy(e9).addScaledVector(e7,s),o}intersectSphere(t,e){if(t.radius<0)return null;e8.subVectors(t.center,this.origin);let r=e8.dot(this.direction),i=e8.dot(e8)-r*r,n=t.radius*t.radius;if(i>n)return null;let s=Math.sqrt(n-i),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){let r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let r,i,n,s,o,a,h=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(h>=0?(r=(t.min.x-c.x)*h,i=(t.max.x-c.x)*h):(r=(t.max.x-c.x)*h,i=(t.min.x-c.x)*h),l>=0?(n=(t.min.y-c.y)*l,s=(t.max.y-c.y)*l):(n=(t.max.y-c.y)*l,s=(t.min.y-c.y)*l),r>s||n>i||((n>r||isNaN(r))&&(r=n),(s<i||isNaN(i))&&(i=s),u>=0?(o=(t.min.z-c.z)*u,a=(t.max.z-c.z)*u):(o=(t.max.z-c.z)*u,a=(t.min.z-c.z)*u),r>a||o>i||((o>r||r!=r)&&(r=o),(a<i||i!=i)&&(i=a),i<0)))?null:this.at(r>=0?r:i,e)}intersectsBox(t){return null!==this.intersectBox(t,e8)}intersectTriangle(t,e,r,i,n){let s,o,a,h,l,u,c,p,d,f,m,y,g=this.origin,b=this.direction,v=b.x,x=b.y,w=b.z,S=t.x-g.x,M=t.y-g.y,_=t.z-g.z,A=e.x-g.x,T=e.y-g.y,C=e.z-g.z,E=r.x-g.x,R=r.y-g.y,O=r.z-g.z,I=Math.abs(v),k=Math.abs(x),P=Math.abs(w);if(I>=k&&I>=P?(a=v,u=S,d=A,y=E,v>=0?(s=x,o=w,h=M,l=_,c=T,p=C,f=R,m=O):(s=w,o=x,h=_,l=M,c=C,p=T,f=O,m=R)):k>=P?(a=x,u=M,d=T,y=R,x>=0?(s=w,o=v,h=_,l=S,c=C,p=A,f=O,m=E):(s=v,o=w,h=S,l=_,c=A,p=C,f=E,m=O)):(a=w,u=_,d=C,y=O,w>=0?(s=v,o=x,h=S,l=M,c=A,p=T,f=E,m=R):(s=x,o=v,h=M,l=S,c=T,p=A,f=R,m=E)),0===a)return null;let B=s/a,L=o/a,z=1/a,N=h-B*u,F=l-L*u,U=c-B*d,j=p-L*d,D=f-B*y,V=m-L*y,W=D*j-V*U,q=N*V-F*D,G=U*F-j*N;if(i){if(W<0||q<0||G<0)return null}else if((W<0||q<0||G<0)&&(W>0||q>0||G>0))return null;let H=W+q+G;if(0===H)return null;let $=z*(W*u+q*d+G*y);return(H>0?$<0:$>0)?null:this.at($/H,n)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rr extends eV{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tV(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}let ri=new th,rn=new re,rs=new eA,ro=new j,ra=new j,rh=new j,rl=new j,ru=new j,rc=new j,rp=new j,rd=new j;class rf extends tL{constructor(t=new eP,e=new rr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let r=this.geometry,i=r.attributes.position,n=r.morphAttributes.position,s=r.morphTargetsRelative;e.fromBufferAttribute(i,t);let o=this.morphTargetInfluences;if(n&&o){rc.set(0,0,0);for(let r=0,i=n.length;r<i;r++){let i=o[r],a=n[r];0!==i&&(ru.fromBufferAttribute(a,t),s?rc.addScaledVector(ru,i):rc.addScaledVector(ru.sub(e),i))}e.add(rc)}return e}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.material,n=this.matrixWorld;void 0===i||(null===r.boundingSphere&&r.computeBoundingSphere(),rs.copy(r.boundingSphere),rs.applyMatrix4(n),rn.copy(t.ray).recast(t.near),!1===rs.containsPoint(rn.origin)&&(null===rn.intersectSphere(rs,ro)||rn.origin.distanceToSquared(ro)>(t.far-t.near)**2)||(ri.copy(n).invert(),rn.copy(t.ray).applyMatrix4(ri),(null===r.boundingBox||!1!==rn.intersectsBox(r.boundingBox))&&this._computeIntersections(t,e,rn)))}_computeIntersections(t,e,r){let i,n=this.geometry,s=this.material,o=n.index,a=n.attributes.position,h=n.attributes.uv,l=n.attributes.uv1,u=n.attributes.normal,c=n.groups,p=n.drawRange;if(null!==o)if(Array.isArray(s))for(let n=0,a=c.length;n<a;n++){let a=c[n],d=s[a.materialIndex],f=Math.max(a.start,p.start),m=Math.min(o.count,Math.min(a.start+a.count,p.start+p.count));for(let n=f;n<m;n+=3)(i=rm(this,d,t,r,h,l,u,o.getX(n),o.getX(n+1),o.getX(n+2)))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=a.materialIndex,e.push(i))}else{let n=Math.max(0,p.start),a=Math.min(o.count,p.start+p.count);for(let c=n;c<a;c+=3)(i=rm(this,s,t,r,h,l,u,o.getX(c),o.getX(c+1),o.getX(c+2)))&&(i.faceIndex=Math.floor(c/3),e.push(i))}else if(void 0!==a)if(Array.isArray(s))for(let n=0,o=c.length;n<o;n++){let o=c[n],d=s[o.materialIndex],f=Math.max(o.start,p.start),m=Math.min(a.count,Math.min(o.start+o.count,p.start+p.count));for(let n=f;n<m;n+=3)(i=rm(this,d,t,r,h,l,u,n,n+1,n+2))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=o.materialIndex,e.push(i))}else{let n=Math.max(0,p.start),o=Math.min(a.count,p.start+p.count);for(let a=n;a<o;a+=3)(i=rm(this,s,t,r,h,l,u,a,a+1,a+2))&&(i.faceIndex=Math.floor(a/3),e.push(i))}}}function rm(t,e,r,i,n,s,o,a,h,l){t.getVertexPosition(a,ra),t.getVertexPosition(h,rh),t.getVertexPosition(l,rl);let u=function(t,e,r,i,n,s,o,a){if(null===(1===e.side?i.intersectTriangle(o,s,n,!0,a):i.intersectTriangle(n,s,o,0===e.side,a)))return null;rd.copy(a),rd.applyMatrix4(t.matrixWorld);let h=r.ray.origin.distanceTo(rd);return h<r.near||h>r.far?null:{distance:h,point:rd.clone(),object:t}}(t,e,r,i,ra,rh,rl,rp);if(u){let t=new j;t6.getBarycoord(rp,ra,rh,rl,t),n&&(u.uv=t6.getInterpolatedAttribute(n,a,h,l,t,new F)),s&&(u.uv1=t6.getInterpolatedAttribute(s,a,h,l,t,new F)),o&&(u.normal=t6.getInterpolatedAttribute(o,a,h,l,t,new j),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));let e={a:a,b:h,c:l,normal:new j,materialIndex:0};t6.getNormal(ra,rh,rl,e.normal),u.face=e,u.barycoord=t}return u}let ry=new ti,rg=new ti,rb=new ti,rv=new ti,rx=new th,rw=new j,rS=new eA,rM=new th,r_=new re;class rA extends rf{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=u,this.bindMatrix=new th,this.bindMatrixInverse=new th,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;null===this.boundingBox&&(this.boundingBox=new t8),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rw),this.boundingBox.expandByPoint(rw)}computeBoundingSphere(){let t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new eA),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rw),this.boundingSphere.expandByPoint(rw)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let r=this.material,i=this.matrixWorld;void 0===r||(null===this.boundingSphere&&this.computeBoundingSphere(),rS.copy(this.boundingSphere),rS.applyMatrix4(i),!1===t.ray.intersectsSphere(rS)||(rM.copy(i).invert(),r_.copy(t.ray).applyMatrix4(rM),(null===this.boundingBox||!1!==r_.intersectsBox(this.boundingBox))&&this._computeIntersections(t,e,r_)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new ti,e=this.geometry.attributes.skinWeight;for(let r=0,i=e.count;r<i;r++){t.fromBufferAttribute(e,r);let i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(r,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===u?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===c?this.bindMatrixInverse.copy(this.bindMatrix).invert():_("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){let r=this.skeleton,i=this.geometry;rg.fromBufferAttribute(i.attributes.skinIndex,t),rb.fromBufferAttribute(i.attributes.skinWeight,t),e.isVector4?(ry.copy(e),e.set(0,0,0,0)):(ry.set(...e,1),e.set(0,0,0)),ry.applyMatrix4(this.bindMatrix);for(let t=0;t<4;t++){let i=rb.getComponent(t);if(0!==i){let n=rg.getComponent(t);rx.multiplyMatrices(r.bones[n].matrixWorld,r.boneInverses[n]),e.addScaledVector(rv.copy(ry).applyMatrix4(rx),i)}}return e.isVector4&&(e.w=ry.w),e.applyMatrix4(this.bindMatrixInverse)}}class rT extends tL{constructor(){super(),this.isBone=!0,this.type="Bone"}}class rC extends tr{constructor(t=null,e=1,r=1,i,n,s,o,a,h=1003,l=1003,u,c){super(null,s,o,a,h,l,i,n,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let rE=new th,rR=new th;class rO{constructor(t=[],e=[]){this.uuid=k(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){_("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new th)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new th;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let i=0,n=t.length;i<n;i++){let n=t[i]?t[i].matrixWorld:rR;rE.multiplyMatrices(n,e[i]),rE.toArray(r,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new rO(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length),e=new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4);e.set(this.boneMatrices);let r=new rC(e,t,t,1023,1015);return r.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=r,this}getBoneByName(t){for(let e=0,r=this.bones.length;e<r;e++){let r=this.bones[e];if(r.name===t)return r}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let r=0,i=t.bones.length;r<i;r++){let i=t.bones[r],n=e[i];void 0===n&&(_("Skeleton: No bone found with UUID:",i),n=new rT),this.bones.push(n),this.boneInverses.push(new th().fromArray(t.boneInverses[r]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,r=this.boneInverses;for(let i=0,n=e.length;i<n;i++){let n=e[i];t.bones.push(n.uuid);let s=r[i];t.boneInverses.push(s.toArray())}return t}}class rI extends eb{constructor(t,e,r,i=1){super(t,e,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}let rk=new th,rP=new th,rB=[],rL=new t8,rz=new th,rN=new rf,rF=new eA;class rU extends rf{constructor(t,e,r){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new rI(new Float32Array(16*r),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<r;t++)this.setMatrixAt(t,rz)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new t8),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<e;r++)this.getMatrixAt(r,rk),rL.copy(t.boundingBox).applyMatrix4(rk),this.boundingBox.union(rL)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new eA),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<e;r++)this.getMatrixAt(r,rk),rF.copy(t.boundingSphere).applyMatrix4(rk),this.boundingSphere.union(rF)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let r=e.morphTargetInfluences,i=this.morphTexture.source.data.data,n=t*(r.length+1)+1;for(let t=0;t<r.length;t++)r[t]=i[n+t]}raycast(t,e){let r=this.matrixWorld,i=this.count;if((rN.geometry=this.geometry,rN.material=this.material,void 0!==rN.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),rF.copy(this.boundingSphere),rF.applyMatrix4(r),!1!==t.ray.intersectsSphere(rF)))for(let n=0;n<i;n++){this.getMatrixAt(n,rk),rP.multiplyMatrices(r,rk),rN.matrixWorld=rP,rN.raycast(t,rB);for(let t=0,r=rB.length;t<r;t++){let r=rB[t];r.instanceId=n,r.object=this,e.push(r)}rB.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new rI(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let r=e.morphTargetInfluences,i=r.length+1;null===this.morphTexture&&(this.morphTexture=new rC(new Float32Array(i*this.count),i,this.count,1028,1015));let n=this.morphTexture.source.data.data,s=0;for(let t=0;t<r.length;t++)s+=r[t];let o=this.geometry.morphTargetsRelative?1:1-s,a=i*t;return n[a]=o,n.set(r,a+1),this}updateMorphTargets(){}dispose(){super.dispose(),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let rj=new eA,rD=new F(.5,.5),rV=new j;class rW{constructor(t=new ej,e=new ej,r=new ej,i=new ej,n=new ej,s=new ej){this.planes=[t,e,r,i,n,s]}set(t,e,r,i,n,s){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(s),this}copy(t){let e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=2e3,r=!1){let i=this.planes,n=t.elements,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],p=n[7],d=n[8],f=n[9],m=n[10],y=n[11],g=n[12],b=n[13],v=n[14],x=n[15];if(i[0].setComponents(h-s,p-l,y-d,x-g).normalize(),i[1].setComponents(h+s,p+l,y+d,x+g).normalize(),i[2].setComponents(h+o,p+u,y+f,x+b).normalize(),i[3].setComponents(h-o,p-u,y-f,x-b).normalize(),r)i[4].setComponents(a,c,m,v).normalize(),i[5].setComponents(h-a,p-c,y-m,x-v).normalize();else if(i[4].setComponents(h-a,p-c,y-m,x-v).normalize(),2e3===e)i[5].setComponents(h+a,p+c,y+m,x+v).normalize();else if(2001===e)i[5].setComponents(a,c,m,v).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rj.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rj.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rj)}intersectsSprite(t){return rj.center.set(0,0,0),rj.radius=.7071067811865476+rD.distanceTo(t.center),rj.applyMatrix4(t.matrixWorld),this.intersectsSphere(rj)}intersectsSphere(t){let e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let r=0;r<6;r++){let i=e[r];if(rV.x=i.normal.x>0?t.max.x:t.min.x,rV.y=i.normal.y>0?t.max.y:t.min.y,rV.z=i.normal.z>0?t.max.z:t.min.z,0>i.distanceToPoint(rV))return!1}return!0}containsPoint(t){let e=this.planes;for(let r=0;r<6;r++)if(0>e[r].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}let rq=new th;class rG{constructor(){this.coordinateSystem=2e3,this._frustums=[],this._count=0}setFromArrayCamera(t){let e=t.cameras,r=this._frustums;for(let t=0;t<e.length;t++){let i=e[t];rq.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),void 0===r[t]&&(r[t]=new rW),r[t].setFromProjectionMatrix(rq,i.coordinateSystem,i.reversedDepth)}return this._count=e.length,this}intersectsObject(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsObject(t))return!0;return!1}intersectsSprite(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsSprite(t))return!0;return!1}intersectsSphere(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsSphere(t))return!0;return!1}intersectsBox(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsBox(t))return!0;return!1}containsPoint(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].containsPoint(t))return!0;return!1}copy(t){this.coordinateSystem=t.coordinateSystem;let e=this._frustums,r=t._frustums;for(let i=0;i<t._count;i++)void 0===e[i]&&(e[i]=new rW),e[i].copy(r[i]);return this._count=t._count,this}clone(){return new rG().copy(this)}}function rH(t,e){return t-e}function r$(t,e){return t.z-e.z}function rJ(t,e){return e.z-t.z}let rY=new th,rX=new tV(1,1,1),rZ=new rW,rK=new rG,rQ=new t8,r0=new eA,r1=new j,r2=new j,r3=new j,r5=new class{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,r,i){let n=this.pool,s=this.list;this.index>=n.length&&n.push({start:-1,count:-1,z:-1,index:-1});let o=n[this.index];s.push(o),this.index++,o.start=t,o.count=e,o.z=r,o.index=i}reset(){this.list.length=0,this.index=0}},r4=new rf,r6=[];function r8(t,e){if(t.constructor!==e.constructor){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)e[i]=t[i]}else{let r=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,r))}}class r9 extends rf{constructor(t,e,r=2*e,i){super(new eP,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=t,this._maxVertexCount=e,this._maxIndexCount=r,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._multiDrawBytesPerElement=1,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let t=Math.sqrt(4*this._maxInstanceCount),e=new rC(new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4),t,t,1023,1015);this._matricesTexture=e}_initIndirectTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new rC(new Uint32Array((t=Math.ceil(t))*t),t,t,1029,1014);this._indirectTexture=e}_initColorsTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new rC(new Float32Array((t=Math.ceil(t))*t*4).fill(1),t,t,1023,1015);e.colorSpace=$.workingColorSpace,this._colorsTexture=e}_initializeGeometry(t){let e=this.geometry,r=this._maxVertexCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(let i in t.attributes){let{array:n,itemSize:s,normalized:o}=t.getAttribute(i),a=new eb(new n.constructor(r*s),s,o);e.setAttribute(i,a)}if(null!==t.getIndex()){let t=r>65535?new Uint32Array(i):new Uint16Array(i);e.setIndex(new eb(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){let e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let r in e.attributes){if(!t.hasAttribute(r))throw Error(`THREE.BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);let i=t.getAttribute(r),n=e.getAttribute(r);if(i.itemSize!==n.itemSize||i.normalized!==n.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){let e=this._instanceInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){let e=this._geometryInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t8);let t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let r=0,i=e.length;r<i;r++){if(!1===e[r].active)continue;let i=e[r].geometryIndex;this.getMatrixAt(r,rY),this.getBoundingBoxAt(i,rQ).applyMatrix4(rY),t.union(rQ)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eA);let t=this.boundingSphere,e=this._instanceInfo;t.makeEmpty();for(let r=0,i=e.length;r<i;r++){if(!1===e[r].active)continue;let i=e[r].geometryIndex;this.getMatrixAt(r,rY),this.getBoundingSphereAt(i,r0).applyMatrix4(rY),t.union(r0)}}addInstance(t){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let e={visible:!0,active:!0,geometryIndex:t},r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(rH),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=e):(r=this._instanceInfo.length,this._instanceInfo.push(e));let i=this._matricesTexture;rY.identity().toArray(i.image.data,16*r),i.needsUpdate=!0;let n=this._colorsTexture;return n&&(rX.toArray(n.image.data,4*r),n.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(t,e=-1,r=-1){let i;this._initializeGeometry(t),this._validateGeometry(t);let n={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;n.vertexStart=this._nextVertexStart,n.reservedVertexCount=-1===e?t.getAttribute("position").count:e;let o=t.getIndex();if(null!==o&&(n.indexStart=this._nextIndexStart,n.reservedIndexCount=-1===r?o.count:r),-1!==n.indexStart&&n.indexStart+n.reservedIndexCount>this._maxIndexCount||n.vertexStart+n.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(rH),s[i=this._availableGeometryIds.shift()]=n):(i=this._geometryCount,this._geometryCount++,s.push(n)),this.setGeometryAt(i,t),this._nextIndexStart=n.indexStart+n.reservedIndexCount,this._nextVertexStart=n.vertexStart+n.reservedVertexCount,i}setGeometryAt(t,e){if(t>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);let r=this.geometry,i=null!==r.getIndex(),n=r.getIndex(),s=e.getIndex(),o=this._geometryInfo[t];if(i&&s.count>o.reservedIndexCount||e.attributes.position.count>o.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let a=o.vertexStart,h=o.reservedVertexCount;for(let t in o.vertexCount=e.getAttribute("position").count,r.attributes){let i=e.getAttribute(t),n=r.getAttribute(t);!function(t,e,r=0){let i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){let n=t.count;for(let s=0;s<n;s++)for(let n=0;n<i;n++)e.setComponent(s+r,n,t.getComponent(s,n))}else e.array.set(t.array,r*i);e.needsUpdate=!0}(i,n,a);let s=i.itemSize;for(let t=i.count;t<h;t++){let e=a+t;for(let t=0;t<s;t++)n.setComponent(e,t,0)}n.needsUpdate=!0,n.addUpdateRange(a*s,h*s)}if(i){let t=o.indexStart,r=o.reservedIndexCount;o.indexCount=e.getIndex().count;for(let e=0;e<s.count;e++)n.setX(t+e,a+s.getX(e));for(let e=s.count;e<r;e++)n.setX(t+e,a);n.needsUpdate=!0,n.addUpdateRange(t,o.reservedIndexCount)}return o.start=i?o.indexStart:o.vertexStart,o.count=i?o.indexCount:o.vertexCount,o.boundingBox=null,null!==e.boundingBox&&(o.boundingBox=e.boundingBox.clone()),o.boundingSphere=null,null!==e.boundingSphere&&(o.boundingSphere=e.boundingSphere.clone()),this._visibilityChanged=!0,t}deleteGeometry(t){let e=this._geometryInfo;if(t>=e.length||!1===e[t].active)return this;let r=this._instanceInfo;for(let e=0,i=r.length;e<i;e++)r[e].active&&r[e].geometryIndex===t&&this.deleteInstance(e);return e[t].active=!1,this._availableGeometryIds.push(t),this._visibilityChanged=!0,this}deleteInstance(t){return this.validateInstanceId(t),this._instanceInfo[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0,this}optimize(){let t=0,e=0,r=this._geometryInfo,i=r.map((t,e)=>e).sort((t,e)=>r[t].vertexStart-r[e].vertexStart),n=this.geometry;for(let s=0,o=r.length;s<o;s++){let o=r[i[s]];if(!1!==o.active){if(null!==n.index){if(o.indexStart!==e){let{indexStart:r,vertexStart:i,reservedIndexCount:s}=o,a=n.index,h=a.array,l=t-i;for(let t=r;t<r+s;t++)h[t]=h[t]+l;a.array.copyWithin(e,r,r+s),a.addUpdateRange(e,s),a.needsUpdate=!0,o.indexStart=e}e+=o.reservedIndexCount}if(o.vertexStart!==t){let{vertexStart:e,reservedVertexCount:r}=o,i=n.attributes;for(let n in i){let s=i[n],{array:o,itemSize:a}=s;o.copyWithin(t*a,e*a,(e+r)*a),s.addUpdateRange(t*a,r*a),s.needsUpdate=!0}o.vertexStart=t}t+=o.reservedVertexCount,o.start=n.index?o.indexStart:o.vertexStart}}return this._nextIndexStart=e,this._nextVertexStart=t,this._visibilityChanged=!0,this}getBoundingBoxAt(t,e){if(t>=this._geometryCount)return null;let r=this.geometry,i=this._geometryInfo[t];if(null===i.boundingBox){let t=new t8,e=r.index,n=r.attributes.position;for(let r=i.start,s=i.start+i.count;r<s;r++){let i=r;e&&(i=e.getX(i)),t.expandByPoint(r1.fromBufferAttribute(n,i))}i.boundingBox=t}return e.copy(i.boundingBox),e}getBoundingSphereAt(t,e){if(t>=this._geometryCount)return null;let r=this.geometry,i=this._geometryInfo[t];if(null===i.boundingSphere){let e=new eA;this.getBoundingBoxAt(t,rQ),rQ.getCenter(e.center);let n=r.index,s=r.attributes.position,o=0;for(let t=i.start,r=i.start+i.count;t<r;t++){let r=t;n&&(r=n.getX(r)),r1.fromBufferAttribute(s,r),o=Math.max(o,e.center.distanceToSquared(r1))}e.radius=Math.sqrt(o),i.boundingSphere=e}return e.copy(i.boundingSphere),e}setMatrixAt(t,e){this.validateInstanceId(t);let r=this._matricesTexture,i=this._matricesTexture.image.data;return e.toArray(i,16*t),r.needsUpdate=!0,this}getMatrixAt(t,e){return this.validateInstanceId(t),e.fromArray(this._matricesTexture.image.data,16*t)}setColorAt(t,e){return this.validateInstanceId(t),null===this._colorsTexture&&this._initColorsTexture(),e.toArray(this._colorsTexture.image.data,4*t),this._colorsTexture.needsUpdate=!0,this}getColorAt(t,e){return(this.validateInstanceId(t),null!==this._colorsTexture)?e.fromArray(this._colorsTexture.image.data,4*t):e.isVector4?e.set(1,1,1,1):e.setRGB(1,1,1)}setVisibleAt(t,e){return this.validateInstanceId(t),this._instanceInfo[t].visible===e||(this._instanceInfo[t].visible=e,this._visibilityChanged=!0),this}getVisibleAt(t){return this.validateInstanceId(t),this._instanceInfo[t].visible}setGeometryIdAt(t,e){return this.validateInstanceId(t),this.validateGeometryId(e),this._instanceInfo[t].geometryIndex=e,this._visibilityChanged=!0,this}getGeometryIdAt(t){return this.validateInstanceId(t),this._instanceInfo[t].geometryIndex}getGeometryRangeAt(t,e={}){this.validateGeometryId(t);let r=this._geometryInfo[t];return e.vertexStart=r.vertexStart,e.vertexCount=r.vertexCount,e.reservedVertexCount=r.reservedVertexCount,e.indexStart=r.indexStart,e.indexCount=r.indexCount,e.reservedIndexCount=r.reservedIndexCount,e.start=r.start,e.count=r.count,e}setInstanceCount(t){let e=this._availableInstanceIds,r=this._instanceInfo;for(e.sort(rH);e[e.length-1]===r.length-1;)r.pop(),e.pop();if(t<r.length)throw Error(`THREE.BatchedMesh: Instance ids outside the range ${t} are being used. Cannot shrink instance count.`);let i=new Int32Array(t),n=new Int32Array(t);r8(this._multiDrawCounts,i),r8(this._multiDrawStarts,n),this._multiDrawCounts=i,this._multiDrawStarts=n,this._maxInstanceCount=t;let s=this._indirectTexture,o=this._matricesTexture,a=this._colorsTexture;s.dispose(),this._initIndirectTexture(),r8(s.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),r8(o.image.data,this._matricesTexture.image.data),a&&(a.dispose(),this._initColorsTexture(),r8(a.image.data,this._colorsTexture.image.data))}setGeometrySize(t,e){let r=[...this._geometryInfo].filter(t=>t.active);if(Math.max(...r.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw Error(`THREE.BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(t=>t.indexStart+t.reservedIndexCount))>e)throw Error(`THREE.BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);let i=this.geometry;i.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new eP,this._initializeGeometry(i));let n=this.geometry;for(let t in i.index&&r8(i.index.array,n.index.array),i.attributes)r8(i.attributes[t].array,n.attributes[t].array)}raycast(t,e){let r=this._instanceInfo,i=this._geometryInfo,n=this.matrixWorld,s=this.geometry;r4.material=this.material,r4.geometry.index=s.index,r4.geometry.attributes=s.attributes,null===r4.geometry.boundingBox&&(r4.geometry.boundingBox=new t8),null===r4.geometry.boundingSphere&&(r4.geometry.boundingSphere=new eA);for(let s=0,o=r.length;s<o;s++){if(!r[s].visible||!r[s].active)continue;let o=r[s].geometryIndex,a=i[o];r4.geometry.setDrawRange(a.start,a.count),this.getMatrixAt(s,r4.matrixWorld).premultiply(n),this.getBoundingBoxAt(o,r4.geometry.boundingBox),this.getBoundingSphereAt(o,r4.geometry.boundingSphere),r4.raycast(t,r6);for(let t=0,r=r6.length;t<r;t++){let r=r6[t];r.object=this,r.batchId=s,e.push(r)}r6.length=0}r4.material=null,r4.geometry.index=null,r4.geometry.attributes={},r4.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._geometryInfo=t._geometryInfo.map(t=>({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._availableInstanceIds=t._availableInstanceIds.slice(),this._availableGeometryIds=t._availableGeometryIds.slice(),this._nextIndexStart=t._nextIndexStart,this._nextVertexStart=t._nextVertexStart,this._geometryCount=t._geometryCount,this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._multiDrawBytesPerElement=t._multiDrawBytesPerElement,this._indirectTexture=t._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){super.dispose(),this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(t,e,r,i,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let s=i.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=1;n.wireframe&&(a=2,o=i.attributes.position.count>65535?4:2);let h=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,p=this.perObjectFrustumCulled,d=this._indirectTexture,f=d.image.data,m=r.isArrayCamera?rK:rZ;p&&(r.isArrayCamera?m.setFromArrayCamera(r):(rY.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),m.setFromProjectionMatrix(rY,r.coordinateSystem,r.reversedDepth)));let y=0;if(this.sortObjects){rY.copy(this.matrixWorld).invert(),r1.setFromMatrixPosition(r.matrixWorld).applyMatrix4(rY),r2.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(rY);for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex;this.getMatrixAt(t,rY),this.getBoundingSphereAt(e,r0).applyMatrix4(rY);let r=!1;if(p&&(r=!m.intersectsSphere(r0)),!r){let r=c[e],i=r3.subVectors(r0.center,r1).dot(r2);r5.push(r.start,r.count,i,t)}}let t=r5.list,e=this.customSort;null===e?t.sort(n.transparent?rJ:r$):e.call(this,t,r);for(let e=0,r=t.length;e<r;e++){let r=t[e];l[y]=r.start*o*a,u[y]=r.count*a,f[y]=r.index,y++}r5.reset()}else for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex,r=!1;if(p&&(this.getMatrixAt(t,rY),this.getBoundingSphereAt(e,r0).applyMatrix4(rY),r=!m.intersectsSphere(r0)),!r){let r=c[e];l[y]=r.start*o*a,u[y]=r.count*a,f[y]=t,y++}}d.needsUpdate=!0,this._multiDrawCount=y,this._multiDrawBytesPerElement=o,this._visibilityChanged=!1}onBeforeShadow(t,e,r,i,n,s){this.onBeforeRender(t,null,i,n,s)}}class r7 extends eV{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tV(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}let it=new j,ie=new j,ir=new th,ii=new re,is=new eA,io=new j,ia=new j;class ih extends tL{constructor(t=new eP,e=new r7){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,r=[0];for(let t=1,i=e.count;t<i;t++)it.fromBufferAttribute(e,t-1),ie.fromBufferAttribute(e,t),r[t]=r[t-1],r[t]+=it.distanceTo(ie);t.setAttribute("lineDistance",new ew(r,1))}else _("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.matrixWorld,n=t.params.Line.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),is.copy(r.boundingSphere),is.applyMatrix4(i),is.radius+=n,!1===t.ray.intersectsSphere(is))return;ir.copy(i).invert(),ii.copy(t.ray).applyMatrix4(ir);let o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=this.isLineSegments?2:1,l=r.index,u=r.attributes.position;if(null!==l){let r=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);for(let n=r,s=i-1;n<s;n+=h){let r=il(this,t,ii,a,l.getX(n),l.getX(n+1),n);r&&e.push(r)}if(this.isLineLoop){let n=il(this,t,ii,a,l.getX(i-1),l.getX(r),i-1);n&&e.push(n)}}else{let r=Math.max(0,s.start),i=Math.min(u.count,s.start+s.count);for(let n=r,s=i-1;n<s;n+=h){let r=il(this,t,ii,a,n,n+1,n);r&&e.push(r)}if(this.isLineLoop){let n=il(this,t,ii,a,i-1,r,i-1);n&&e.push(n)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function il(t,e,r,i,n,s,o){let a=t.geometry.attributes.position;if(it.fromBufferAttribute(a,n),ie.fromBufferAttribute(a,s),r.distanceSqToSegment(it,ie,io,ia)>i)return;io.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(io);if(!(h<e.near)&&!(h>e.far))return{distance:h,point:ia.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}let iu=new j,ic=new j;class ip extends ih{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,r=[];for(let t=0,i=e.count;t<i;t+=2)iu.fromBufferAttribute(e,t),ic.fromBufferAttribute(e,t+1),r[t]=0===t?0:r[t-1],r[t+1]=r[t]+iu.distanceTo(ic);t.setAttribute("lineDistance",new ew(r,1))}else _("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class id extends ih{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class im extends eV{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tV(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let iy=new th,ig=new re,ib=new eA,iv=new j;class ix extends tL{constructor(t=new eP,e=new im){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.matrixWorld,n=t.params.Points.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),ib.copy(r.boundingSphere),ib.applyMatrix4(i),ib.radius+=n,!1===t.ray.intersectsSphere(ib))return;iy.copy(i).invert(),ig.copy(t.ray).applyMatrix4(iy);let o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=r.index,l=r.attributes.position;if(null!==h){let r=Math.max(0,s.start),n=Math.min(h.count,s.start+s.count);for(let s=r;s<n;s++){let r=h.getX(s);iv.fromBufferAttribute(l,r),iw(iv,r,a,i,t,e,this)}}else{let r=Math.max(0,s.start),n=Math.min(l.count,s.start+s.count);for(let s=r;s<n;s++)iv.fromBufferAttribute(l,s),iw(iv,s,a,i,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function iw(t,e,r,i,n,s,o){let a=ig.distanceSqToPoint(t);if(a<r){let r=new j;ig.closestPointToPoint(t,r),r.applyMatrix4(i);let h=n.ray.origin.distanceTo(r);if(h<n.near||h>n.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:r,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class iS extends tr{constructor(t,e,r,i,n=1006,s=1006,o,a,h){super(t,e,r,i,n,s,o,a,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const l=this;"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class iM extends tr{constructor(t,e,r,i,n,s,o,a,h,l,u,c){super(null,s,o,a,h,l,i,n,u,c),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class i_ extends tr{constructor(t=[],e=301,r,i,n,s,o,a,h,l){super(t,e,r,i,n,s,o,a,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class iA extends tr{constructor(t,e,r=1014,i,n,s,o=1003,a=1003,h,l=1026,u=1){if(1026!==l&&1027!==l)throw Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},i,n,s,o,a,l,r,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new K(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return e.compareFunction=this.compareFunction,e}}class iT extends eP{constructor(t=1,e=1,r=1,i=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:s};const o=this;i=Math.floor(i),n=Math.floor(n);const a=[],h=[],l=[],u=[];let c=0,p=0;function d(t,e,r,i,n,s,d,f,m,y,g){let b=s/m,v=d/y,x=s/2,w=d/2,S=f/2,M=m+1,_=y+1,A=0,T=0,C=new j;for(let s=0;s<_;s++){let o=s*v-w;for(let a=0;a<M;a++){let c=a*b-x;C[t]=c*i,C[e]=o*n,C[r]=S,h.push(C.x,C.y,C.z),C[t]=0,C[e]=0,C[r]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(a/m),u.push(1-s/y),A+=1}}for(let t=0;t<y;t++)for(let e=0;e<m;e++){let r=c+e+M*t,i=c+e+M*(t+1),n=c+(e+1)+M*(t+1),s=c+(e+1)+M*t;a.push(r,i,s),a.push(i,n,s),T+=6}o.addGroup(p,T,g),p+=T,c+=A}d("z","y","x",-1,-1,r,e,t,s=Math.floor(s),n,0),d("z","y","x",1,-1,r,e,-t,s,n,1),d("x","z","y",1,1,t,r,e,i,s,2),d("x","z","y",1,-1,t,r,-e,i,s,3),d("x","y","z",1,-1,t,e,r,i,n,4),d("x","y","z",-1,-1,t,e,-r,i,n,5),this.setIndex(a),this.setAttribute("position",new ew(h,3)),this.setAttribute("normal",new ew(l,3)),this.setAttribute("uv",new ew(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iT(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class iC extends eP{constructor(t=1,e=1,r=4,i=8,n=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:e,capSegments:r,radialSegments:i,heightSegments:n},e=Math.max(0,e),r=Math.max(1,Math.floor(r)),i=Math.max(3,Math.floor(i));const s=[],o=[],a=[],h=[],l=e/2,u=Math.PI/2*t,c=e,p=2*u+c,d=2*r+(n=Math.max(1,Math.floor(n))),f=i+1,m=new j,y=new j;for(let g=0;g<=d;g++){let b=0,v=0,x=0,w=0;if(g<=r){const e=g/r,i=e*Math.PI/2;v=-l-t*Math.cos(i),x=t*Math.sin(i),w=-t*Math.cos(i),b=e*u}else if(g<=r+n){const i=(g-r)/n;v=-l+i*e,x=t,w=0,b=u+i*c}else{const e=(g-r-n)/r,i=e*Math.PI/2;v=l+t*Math.sin(i),x=t*Math.cos(i),w=t*Math.sin(i),b=u+c+e*u}const S=Math.max(0,Math.min(1,b/p));let M=0;0===g?M=.5/i:g===d&&(M=-.5/i);for(let t=0;t<=i;t++){const e=t/i,r=e*Math.PI*2,n=Math.sin(r),s=Math.cos(r);y.x=-x*s,y.y=v,y.z=x*n,o.push(y.x,y.y,y.z),m.set(-x*s,w,x*n),m.normalize(),a.push(m.x,m.y,m.z),h.push(e+M,S)}if(g>0){const t=(g-1)*f;for(let e=0;e<i;e++){const r=t+e,i=t+e+1,n=g*f+e,o=g*f+e+1;s.push(r,i,n),s.push(i,o,n)}}}this.setIndex(s),this.setAttribute("position",new ew(o,3)),this.setAttribute("normal",new ew(a,3)),this.setAttribute("uv",new ew(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iC(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}}class iE extends eP{constructor(t=1,e=32,r=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},e=Math.max(3,e);const n=[],s=[],o=[],a=[],h=new j,l=new F;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let n=0,u=3;n<=e;n++,u+=3){const c=r+n/e*i;h.x=t*Math.cos(c),h.y=t*Math.sin(c),s.push(h.x,h.y,h.z),o.push(0,0,1),l.x=(s[u]/t+1)/2,l.y=(s[u+1]/t+1)/2,a.push(l.x,l.y)}for(let t=1;t<=e;t++)n.push(t,t+1,0);this.setIndex(n),this.setAttribute("position",new ew(s,3)),this.setAttribute("normal",new ew(o,3)),this.setAttribute("uv",new ew(a,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iE(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class iR extends eP{constructor(t=1,e=1,r=1,i=32,n=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:n,openEnded:s,thetaStart:o,thetaLength:a};const h=this;i=Math.floor(i),n=Math.floor(n);const l=[],u=[],c=[],p=[];let d=0;const f=[],m=r/2;let y=0;function g(r){let n=d,s=new F,f=new j,g=0,b=!0===r?t:e,v=!0===r?1:-1;for(let t=1;t<=i;t++)u.push(0,m*v,0),c.push(0,v,0),p.push(.5,.5),d++;let x=d;for(let t=0;t<=i;t++){let e=t/i*a+o,r=Math.cos(e),n=Math.sin(e);f.x=b*n,f.y=m*v,f.z=b*r,u.push(f.x,f.y,f.z),c.push(0,v,0),s.x=.5*r+.5,s.y=.5*n*v+.5,p.push(s.x,s.y),d++}for(let t=0;t<i;t++){let e=n+t,i=x+t;!0===r?l.push(i,i+1,e):l.push(i+1,i,e),g+=3}h.addGroup(y,g,!0===r?1:2),y+=g}(function(){let s=new j,g=new j,b=0,v=(e-t)/r;for(let h=0;h<=n;h++){let l=[],y=h/n,b=y*(e-t)+t;for(let t=0;t<=i;t++){let e=t/i,n=e*a+o,h=Math.sin(n),f=Math.cos(n);g.x=b*h,g.y=-y*r+m,g.z=b*f,u.push(g.x,g.y,g.z),s.set(h,v,f).normalize(),c.push(s.x,s.y,s.z),p.push(e,1-y),l.push(d++)}f.push(l)}for(let r=0;r<i;r++)for(let i=0;i<n;i++){let s=f[i][r],o=f[i+1][r],a=f[i+1][r+1],h=f[i][r+1];(t>0||0!==i)&&(l.push(s,o,h),b+=3),(e>0||i!==n-1)&&(l.push(o,a,h),b+=3)}h.addGroup(y,b,0),y+=b})(),!1===s&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new ew(u,3)),this.setAttribute("normal",new ew(c,3)),this.setAttribute("uv",new ew(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iR(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class iO extends iR{constructor(t=1,e=1,r=32,i=1,n=!1,s=0,o=2*Math.PI){super(0,t,e,r,i,n,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:o}}static fromJSON(t){return new iO(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class iI extends eP{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const n=[],s=[];function o(t){n.push(t.x,t.y,t.z)}function a(e,r){let i=3*e;r.x=t[i+0],r.y=t[i+1],r.z=t[i+2]}function h(t,e,r,i){i<0&&1===t.x&&(s[e]=t.x-1),0===r.x&&0===r.z&&(s[e]=i/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let r=new j,i=new j,n=new j;for(let s=0;s<e.length;s+=3)a(e[s+0],r),a(e[s+1],i),a(e[s+2],n),function(t,e,r,i){let n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];let o=t.clone().lerp(r,i/n),a=e.clone().lerp(r,i/n),h=n-i;for(let t=0;t<=h;t++)0===t&&i===n?s[i][t]=o:s[i][t]=o.clone().lerp(a,t/h)}for(let t=0;t<n;t++)for(let e=0;e<2*(n-t)-1;e++){let r=Math.floor(e/2);e%2==0?(o(s[t][r+1]),o(s[t+1][r]),o(s[t][r])):(o(s[t][r+1]),o(s[t+1][r+1]),o(s[t+1][r]))}}(r,i,n,t)})(i),function(t){let e=new j;for(let r=0;r<n.length;r+=3)e.x=n[r+0],e.y=n[r+1],e.z=n[r+2],e.normalize().multiplyScalar(t),n[r+0]=e.x,n[r+1]=e.y,n[r+2]=e.z}(r),function(){let t=new j;for(let r=0;r<n.length;r+=3){var e;t.x=n[r+0],t.y=n[r+1],t.z=n[r+2];let i=l(t)/2/Math.PI+.5,o=Math.atan2(-(e=t).y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;s.push(i,1-o)}(function(){let t=new j,e=new j,r=new j,i=new j,o=new F,a=new F,u=new F;for(let c=0,p=0;c<n.length;c+=9,p+=6){t.set(n[c+0],n[c+1],n[c+2]),e.set(n[c+3],n[c+4],n[c+5]),r.set(n[c+6],n[c+7],n[c+8]),o.set(s[p+0],s[p+1]),a.set(s[p+2],s[p+3]),u.set(s[p+4],s[p+5]),i.copy(t).add(e).add(r).divideScalar(3);let d=l(i);h(o,p+0,t,d),h(a,p+2,e,d),h(u,p+4,r,d)}})(),function(){for(let t=0;t<s.length;t+=6){let e=s[t+0],r=s[t+2],i=s[t+4],n=Math.max(e,r,i),o=Math.min(e,r,i);n>.9&&o<.1&&(e<.2&&(s[t+0]+=1),r<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new ew(n,3)),this.setAttribute("normal",new ew(n.slice(),3)),this.setAttribute("uv",new ew(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iI(t.vertices,t.indices,t.radius,t.detail)}}class ik extends iI{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new ik(t.radius,t.detail)}}let iP=new j,iB=new j,iL=new j,iz=new t6;class iN extends eP{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=Math.cos(O*e),i=t.getIndex(),n=t.getAttribute("position"),s=i?i.count:n.count,o=[0,0,0],a=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t<s;t+=3){i?(o[0]=i.getX(t),o[1]=i.getX(t+1),o[2]=i.getX(t+2)):(o[0]=t,o[1]=t+1,o[2]=t+2);const{a:e,b:s,c}=iz;if(e.fromBufferAttribute(n,o[0]),s.fromBufferAttribute(n,o[1]),c.fromBufferAttribute(n,o[2]),iz.getNormal(iL),h[0]=`${Math.round(1e4*e.x)},${Math.round(1e4*e.y)},${Math.round(1e4*e.z)}`,h[1]=`${Math.round(1e4*s.x)},${Math.round(1e4*s.y)},${Math.round(1e4*s.z)}`,h[2]=`${Math.round(1e4*c.x)},${Math.round(1e4*c.y)},${Math.round(1e4*c.z)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=h[t],n=h[e],s=iz[a[t]],c=iz[a[e]],p=`${i}_${n}`,d=`${n}_${i}`;d in l&&l[d]?(iL.dot(l[d].normal)<=r&&(u.push(s.x,s.y,s.z),u.push(c.x,c.y,c.z)),l[d]=null):p in l||(l[p]={index0:o[t],index1:o[e],normal:iL.clone()})}}for(const t in l)if(l[t]){const{index0:e,index1:r}=l[t];iP.fromBufferAttribute(n,e),iB.fromBufferAttribute(n,r),u.push(iP.x,iP.y,iP.z),u.push(iB.x,iB.y,iB.z)}this.setAttribute("position",new ew(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class iF{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){_("Curve: .getPoint() not implemented.")}getPointAt(t,e){let r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){let e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){let e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],r,i=this.getPoint(0),n=0;e.push(0);for(let s=1;s<=t;s++)e.push(n+=(r=this.getPoint(s/t)).distanceTo(i)),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let r,i=this.getLengths(),n=0,s=i.length;r=e||t*i[s-1];let o=0,a=s-1,h;for(;o<=a;)if((h=i[n=Math.floor(o+(a-o)/2)]-r)<0)o=n+1;else if(h>0)a=n-1;else{a=n;break}if(i[n=a]===r)return n/(s-1);let l=i[n],u=i[n+1];return(n+(r-l)/(u-l))/(s-1)}getTangent(t,e){let r=t-1e-4,i=t+1e-4;r<0&&(r=0),i>1&&(i=1);let n=this.getPoint(r),s=this.getPoint(i),o=e||(n.isVector2?new F:new j);return o.copy(s).sub(n).normalize(),o}getTangentAt(t,e){let r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e=!1){let r=new j,i=[],n=[],s=[],o=new j,a=new th;for(let e=0;e<=t;e++){let r=e/t;i[e]=this.getTangentAt(r,new j)}n[0]=new j,s[0]=new j;let h=Number.MAX_VALUE,l=Math.abs(i[0].x),u=Math.abs(i[0].y),c=Math.abs(i[0].z);l<=h&&(h=l,r.set(1,0,0)),u<=h&&(h=u,r.set(0,1,0)),c<=h&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],o),s[0].crossVectors(i[0],n[0]);for(let e=1;e<=t;e++){if(n[e]=n[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(i[e-1],i[e]),o.length()>Number.EPSILON){o.normalize();let t=Math.acos(P(i[e-1].dot(i[e]),-1,1));n[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(i[e],n[e])}if(!0===e){let e=Math.acos(P(n[0].dot(n[t]),-1,1));e/=t,i[0].dot(o.crossVectors(n[0],n[t]))>0&&(e=-e);for(let r=1;r<=t;r++)n[r].applyMatrix4(a.makeRotationAxis(i[r],e*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class iU extends iF{constructor(t=0,e=0,r=1,i=1,n=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e=new F){let r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,n=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=n?0:r),!0!==this.aClockwise||n||(i===r?i=-r:i-=r);let s=this.aStartAngle+t*i,o=this.aX+this.xRadius*Math.cos(s),a=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),r=o-this.aX,i=a-this.aY;o=r*t-i*e+this.aX,a=r*e+i*t+this.aY}return e.set(o,a)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class ij extends iU{constructor(t,e,r,i,n,s){super(t,e,r,r,i,n,s),this.isArcCurve=!0,this.type="ArcCurve"}}function iD(){let t=0,e=0,r=0,i=0;function n(n,s,o,a){t=n,e=o,r=-3*n+3*s-2*o-a,i=2*n-2*s+o+a}return{initCatmullRom:function(t,e,r,i,s){n(e,r,s*(r-t),s*(i-e))},initNonuniformCatmullRom:function(t,e,r,i,s,o,a){let h=(e-t)/s-(r-t)/(s+o)+(r-e)/o,l=(r-e)/o-(i-e)/(o+a)+(i-r)/a;n(e,r,h*=o,l*=o)},calc:function(n){let s=n*n;return t+e*n+r*s+s*n*i}}}let iV=new j,iW=new j,iq=new iD,iG=new iD,iH=new iD;class i$ extends iF{constructor(t=[],e=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=r,this.tension=i}getPoint(t,e=new j){let r,i,n=this.points,s=n.length,o=(s-!this.closed)*t,a=Math.floor(o),h=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:0===h&&a===s-1&&(a=s-2,h=1),this.closed||a>0?r=n[(a-1)%s]:(iW.subVectors(n[0],n[1]).add(n[0]),r=iW);let l=n[a%s],u=n[(a+1)%s];if(this.closed||a+2<s?i=n[(a+2)%s]:(iV.subVectors(n[s-1],n[s-2]).add(n[s-1]),i=iV),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(r.distanceToSquared(l),t),n=Math.pow(l.distanceToSquared(u),t),s=Math.pow(u.distanceToSquared(i),t);n<1e-4&&(n=1),e<1e-4&&(e=n),s<1e-4&&(s=n),iq.initNonuniformCatmullRom(r.x,l.x,u.x,i.x,e,n,s),iG.initNonuniformCatmullRom(r.y,l.y,u.y,i.y,e,n,s),iH.initNonuniformCatmullRom(r.z,l.z,u.z,i.z,e,n,s)}else"catmullrom"===this.curveType&&(iq.initCatmullRom(r.x,l.x,u.x,i.x,this.tension),iG.initCatmullRom(r.y,l.y,u.y,i.y,this.tension),iH.initCatmullRom(r.z,l.z,u.z,i.z,this.tension));return e.set(iq.calc(h),iG.calc(h),iH.calc(h)),e}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,r=this.points.length;e<r;e++){let r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(new j().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function iJ(t,e,r,i,n){let s=(i-e)*.5,o=(n-r)*.5,a=t*t;return t*a*(2*r-2*i+s+o)+(-3*r+3*i-2*s-o)*a+s*t+r}function iY(t,e,r,i){let n;return(n=1-t)*n*e+2*(1-t)*t*r+t*t*i}function iX(t,e,r,i,n){let s,o;return(s=1-t)*s*s*e+3*(o=1-t)*o*t*r+3*(1-t)*t*t*i+t*t*t*n}class iZ extends iF{constructor(t=new F,e=new F,r=new F,i=new F){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=r,this.v3=i}getPoint(t,e=new F){let r=this.v0,i=this.v1,n=this.v2,s=this.v3;return e.set(iX(t,r.x,i.x,n.x,s.x),iX(t,r.y,i.y,n.y,s.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class iK extends iF{constructor(t=new j,e=new j,r=new j,i=new j){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=r,this.v3=i}getPoint(t,e=new j){let r=this.v0,i=this.v1,n=this.v2,s=this.v3;return e.set(iX(t,r.x,i.x,n.x,s.x),iX(t,r.y,i.y,n.y,s.y),iX(t,r.z,i.z,n.z,s.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class iQ extends iF{constructor(t=new F,e=new F){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new F){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new F){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i0 extends iF{constructor(t=new j,e=new j){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new j){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new j){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i1 extends iF{constructor(t=new F,e=new F,r=new F){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=r}getPoint(t,e=new F){let r=this.v0,i=this.v1,n=this.v2;return e.set(iY(t,r.x,i.x,n.x),iY(t,r.y,i.y,n.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i2 extends iF{constructor(t=new j,e=new j,r=new j){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=r}getPoint(t,e=new j){let r=this.v0,i=this.v1,n=this.v2;return e.set(iY(t,r.x,i.x,n.x),iY(t,r.y,i.y,n.y),iY(t,r.z,i.z,n.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i3 extends iF{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new F){let r=this.points,i=(r.length-1)*t,n=Math.floor(i),s=i-n,o=r[0===n?n:n-1],a=r[n],h=r[n>r.length-2?r.length-1:n+1],l=r[n>r.length-3?r.length-1:n+2];return e.set(iJ(s,o.x,a.x,h.x,l.x),iJ(s,o.y,a.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(r.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,r=this.points.length;e<r;e++){let r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(new F().fromArray(r))}return this}}var i5=Object.freeze({__proto__:null,ArcCurve:ij,CatmullRomCurve3:i$,CubicBezierCurve:iZ,CubicBezierCurve3:iK,EllipseCurve:iU,LineCurve:iQ,LineCurve3:i0,QuadraticBezierCurve:i1,QuadraticBezierCurve3:i2,SplineCurve:i3});class i4 extends iF{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let r=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new i5[r](e,t))}return this}getPoint(t,e){let r=t*this.getLength(),i=this.getCurveLengths(),n=0;for(;n<i.length;){if(i[n]>=r){let t=i[n]-r,s=this.curves[n],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}n++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let r=0,i=this.curves.length;r<i;r++)t.push(e+=this.curves[r].getLength());return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e,r=[];for(let i=0,n=this.curves;i<n.length;i++){let s=n[i],o=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,a=s.getPoints(o);for(let t=0;t<a.length;t++){let i=a[t];e&&e.equals(i)||(r.push(i),e=i)}}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e<r;e++){let r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,r=this.curves.length;e<r;e++){let r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,r=t.curves.length;e<r;e++){let r=t.curves[e];this.curves.push(new i5[r.type]().fromJSON(r))}return this}}class i6 extends i4{constructor(t){super(),this.type="Path",this.currentPoint=new F,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let r=new iQ(this.currentPoint.clone(),new F(t,e));return this.curves.push(r),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,r,i){let n=new i1(this.currentPoint.clone(),new F(t,e),new F(r,i));return this.curves.push(n),this.currentPoint.set(r,i),this}bezierCurveTo(t,e,r,i,n,s){let o=new iZ(this.currentPoint.clone(),new F(t,e),new F(r,i),new F(n,s));return this.curves.push(o),this.currentPoint.set(n,s),this}splineThru(t){let e=new i3([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,r,i,n,s){let o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+o,e+a,r,i,n,s),this}absarc(t,e,r,i,n,s){return this.absellipse(t,e,r,r,i,n,s),this}ellipse(t,e,r,i,n,s,o,a){let h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,r,i,n,s,o,a),this}absellipse(t,e,r,i,n,s,o,a){let h=new iU(t,e,r,i,n,s,o,a);if(this.curves.length>0){let t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);let l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class i8 extends i6{constructor(t){super(t),this.uuid=k(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let r=0,i=this.holes.length;r<i;r++)e[r]=this.holes[r].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,r=t.holes.length;e<r;e++){let r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,r=this.holes.length;e<r;e++){let r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,r=t.holes.length;e<r;e++){let r=t.holes[e];this.holes.push(new i6().fromJSON(r))}return this}}function i9(t,e,r,i,n){let s;if(n===function(t,e,r,i){let n=0;for(let s=e,o=r-i;s<r;s+=i)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}(t,e,r,i)>0)for(let n=e;n<r;n+=i)s=nc(n/i|0,t[n],t[n+1],s);else for(let n=r-i;n>=e;n-=i)s=nc(n/i|0,t[n],t[n+1],s);return s&&ns(s,s.next)&&(np(s),s=s.next),s}function i7(t,e){if(!t)return t;e||(e=t);let r=t,i;do if(i=!1,!r.steiner&&(ns(r,r.next)||0===nn(r.prev,r,r.next))){if(np(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e)return e}function nt(t,e){let r=t.x-e.x;return 0===r&&0==(r=t.y-e.y)&&(r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),r}function ne(t,e,r,i,n){return(t=((t=((t=((t=((t=(t-r)*n|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(e=((e=((e=((e=((e=(e-i)*n|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)<<1}function nr(t,e,r,i,n,s,o,a){return(n-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function ni(t,e,r,i,n,s,o,a){return(t!==o||e!==a)&&nr(t,e,r,i,n,s,o,a)}function nn(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ns(t,e){return t.x===e.x&&t.y===e.y}function no(t,e,r,i){let n=nh(nn(t,e,r)),s=nh(nn(t,e,i)),o=nh(nn(r,i,t)),a=nh(nn(r,i,e));return!!(n!==s&&o!==a||0===n&&na(t,r,e)||0===s&&na(t,i,e)||0===o&&na(r,t,i)||0===a&&na(r,e,i))}function na(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function nh(t){return t>0?1:t<0?-1:0}function nl(t,e){return 0>nn(t.prev,t,t.next)?nn(t,e,t.next)>=0&&nn(t,t.prev,e)>=0:0>nn(t,e,t.prev)||0>nn(t,t.next,e)}function nu(t,e){let r=nd(t.i,t.x,t.y),i=nd(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function nc(t,e,r,i){let n=nd(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function np(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function nd(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class nf{static triangulate(t,e,r=2){return function(t,e,r=2){let i,n,s,o=e&&e.length,a=o?e[0]*r:t.length,h=i9(t,0,a,r,!0),l=[];if(!h||h.next===h.prev)return l;if(o&&(h=function(t,e,r,i){let n=[];for(let r=0,s=e.length;r<s;r++){let o=e[r]*i,a=r<s-1?e[r+1]*i:t.length,h=i9(t,o,a,i,!1);h===h.next&&(h.steiner=!0),n.push(function(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t)return r}(h))}n.sort(nt);for(let t=0;t<n.length;t++)r=function(t,e){let r=function(t,e){let r,i=e,n=t.x,s=t.y,o=-1/0;if(ns(t,i))return i;do{if(ns(t,i.next))return i.next;if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){let t=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o&&(o=t,r=i.x<i.next.x?i:i.next,t===n))return r}i=i.next}while(i!==e)if(!r)return null;let a=r,h=r.x,l=r.y,u=1/0;i=r;do{if(n>=i.x&&i.x>=h&&n!==i.x&&nr(s<l?n:o,s,h,l,s<l?o:n,s,i.x,i.y)){var c,p;let e=Math.abs(s-i.y)/(n-i.x);nl(i,t)&&(e<u||e===u&&(i.x>r.x||i.x===r.x&&(c=r,p=i,0>nn(c.prev,c,p.prev)&&0>nn(p.next,c,c.next))))&&(r=i,u=e)}i=i.next}while(i!==a)return r}(t,e);if(!r)return e;let i=nu(r,t);return i7(i,i.next),i7(r,r.next)}(n[t],r);return r}(t,e,h,r)),t.length>80*r){i=t[0],n=t[1];let e=i,o=n;for(let s=r;s<a;s+=r){let r=t[s],a=t[s+1];r<i&&(i=r),a<n&&(n=a),r>e&&(e=r),a>o&&(o=a)}s=0!==(s=Math.max(e-i,o-n))?32767/s:0}return function t(e,r,i,n,s,o,a){if(!e)return;!a&&o&&function(t,e,r,i){let n=t;do 0===n.z&&(n.z=ne(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t)n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,r=1;do{let i,n=t;t=null;let s=null;for(e=0;n;){e++;let o=n,a=0;for(let t=0;t<r&&(a++,o=o.nextZ);t++);let h=r;for(;a>0||h>0&&o;)0!==a&&(0===h||!o||n.z<=o.z)?(i=n,n=n.nextZ,a--):(i=o,o=o.nextZ,h--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;n=o}s.nextZ=null,r*=2}while(e>1)}(n)}(e,n,s,o);let h=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(o?function(t,e,r,i){let n=t.prev,s=t.next;if(nn(n,t,s)>=0)return!1;let o=n.x,a=t.x,h=s.x,l=n.y,u=t.y,c=s.y,p=Math.min(o,a,h),d=Math.min(l,u,c),f=Math.max(o,a,h),m=Math.max(l,u,c),y=ne(p,d,e,r,i),g=ne(f,m,e,r,i),b=t.prevZ,v=t.nextZ;for(;b&&b.z>=y&&v&&v.z<=g;){if(b.x>=p&&b.x<=f&&b.y>=d&&b.y<=m&&b!==n&&b!==s&&ni(o,l,a,u,h,c,b.x,b.y)&&nn(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=p&&v.x<=f&&v.y>=d&&v.y<=m&&v!==n&&v!==s&&ni(o,l,a,u,h,c,v.x,v.y)&&nn(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=y;){if(b.x>=p&&b.x<=f&&b.y>=d&&b.y<=m&&b!==n&&b!==s&&ni(o,l,a,u,h,c,b.x,b.y)&&nn(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=g;){if(v.x>=p&&v.x<=f&&v.y>=d&&v.y<=m&&v!==n&&v!==s&&ni(o,l,a,u,h,c,v.x,v.y)&&nn(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(e,n,s,o):function(t){let e=t.prev,r=t.next;if(nn(e,t,r)>=0)return!1;let i=e.x,n=t.x,s=r.x,o=e.y,a=t.y,h=r.y,l=Math.min(i,n,s),u=Math.min(o,a,h),c=Math.max(i,n,s),p=Math.max(o,a,h),d=r.next;for(;d!==e;){if(d.x>=l&&d.x<=c&&d.y>=u&&d.y<=p&&ni(i,o,n,a,s,h,d.x,d.y)&&nn(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}(e)){r.push(l.i,e.i,u.i),np(e),e=u.next,h=u.next;continue}if((e=u)===h){a?1===a?t(e=function(t,e){let r=t;do{let i=r.prev,n=r.next.next;!ns(i,n)&&no(i,r,r.next,n)&&nl(i,n)&&nl(n,i)&&(e.push(i.i,r.i,n.i),np(r),np(r.next),r=t=n),r=r.next}while(r!==t)return i7(r)}(i7(e),r),r,i,n,s,o,2):2===a&&function(e,r,i,n,s,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){var h,l;if(a.i!==e.i&&(h=a,l=e,h.next.i!==l.i&&h.prev.i!==l.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&no(r,r.next,t,e))return!0;r=r.next}while(r!==t)return!1}(h,l)&&(nl(h,l)&&nl(l,h)&&function(t,e){let r=t,i=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t)return i}(h,l)&&(nn(h.prev,h,l.prev)||nn(h,l.prev,l))||ns(h,l)&&nn(h.prev,h,h.next)>0&&nn(l.prev,l,l.next)>0))){let h=nu(a,e);a=i7(a,a.next),h=i7(h,h.next),t(a,r,i,n,s,o,0),t(h,r,i,n,s,o,0);return}e=e.next}a=a.next}while(a!==e)}(e,r,i,n,s,o):t(i7(e),r,i,n,s,o,1);break}}}(h,l,r,i,n,s,0),l}(t,e,r)}}class nm{static area(t){let e=t.length,r=0;for(let i=e-1,n=0;n<e;i=n++)r+=t[i].x*t[n].y-t[n].x*t[i].y;return .5*r}static isClockWise(t){return 0>nm.area(t)}static triangulateShape(t,e){let r=[],i=[],n=[];ny(t),ng(r,t);let s=t.length;e.forEach(ny);for(let t=0;t<e.length;t++)i.push(s),s+=e[t].length,ng(r,e[t]);let o=nf.triangulate(r,i);for(let t=0;t<o.length;t+=3)n.push(o.slice(t,t+3));return n}}function ny(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ng(t,e){for(let r=0;r<e.length;r++)t.push(e[r].x),t.push(e[r].y)}class nb extends eP{constructor(t=new i8([new F(.5,.5),new F(-.5,.5),new F(-.5,-.5),new F(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const r=this,i=[],n=[];for(let s=0,o=t.length;s<o;s++)!function(t){let s,o,a,h,l,u=[],c=void 0!==e.curveSegments?e.curveSegments:12,p=void 0!==e.steps?e.steps:1,d=void 0!==e.depth?e.depth:1,f=void 0===e.bevelEnabled||e.bevelEnabled,m=void 0!==e.bevelThickness?e.bevelThickness:.2,y=void 0!==e.bevelSize?e.bevelSize:m-.1,g=void 0!==e.bevelOffset?e.bevelOffset:0,b=void 0!==e.bevelSegments?e.bevelSegments:3,v=e.extrudePath,x=void 0!==e.UVGenerator?e.UVGenerator:nv,w,S=!1;if(v){w=v.getSpacedPoints(p),S=!0,f=!1;let t=!!v.isCatmullRomCurve3&&v.closed;s=v.computeFrenetFrames(p,t),o=new j,a=new j,h=new j}f||(b=0,m=0,y=0,g=0);let M=t.extractPoints(c),_=M.shape,T=M.holes;if(!nm.isClockWise(_)){_=_.reverse();for(let t=0,e=T.length;t<e;t++){let e=T[t];nm.isClockWise(e)&&(T[t]=e.reverse())}}function C(t){let e=1e-10*1e-10,r=t[0];for(let i=1;i<=t.length;i++){let n=i%t.length,s=t[n],o=s.x-r.x,a=s.y-r.y,h=o*o+a*a,l=Math.max(Math.abs(s.x),Math.abs(s.y),Math.abs(r.x),Math.abs(r.y));if(h<=e*l*l){t.splice(n,1),i--;continue}r=s}}C(_),T.forEach(C);let E=T.length,R=_;for(let t=0;t<E;t++){let e=T[t];_=_.concat(e)}function O(t,e,r){return e||A("ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,r)}let I=_.length;function k(t,e,r){let i,n,s,o=t.x-e.x,a=t.y-e.y,h=r.x-t.x,l=r.y-t.y,u=o*o+a*a;if(Math.abs(o*l-a*h)>Number.EPSILON){let c=Math.sqrt(u),p=Math.sqrt(h*h+l*l),d=e.x-a/c,f=e.y+o/c,m=((r.x-l/p-d)*l-(r.y+h/p-f)*h)/(o*l-a*h),y=(i=d+o*m-t.x)*i+(n=f+a*m-t.y)*n;if(y<=2)return new F(i,n);s=Math.sqrt(y/2)}else{let t=!1;o>Number.EPSILON?h>Number.EPSILON&&(t=!0):o<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(l)&&(t=!0),t?(i=-a,n=o,s=Math.sqrt(u)):(i=o,n=a,s=Math.sqrt(u/2))}return new F(i/s,n/s)}let P=[];for(let t=0,e=R.length,r=e-1,i=t+1;t<e;t++,r++,i++)r===e&&(r=0),i===e&&(i=0),P[t]=k(R[t],R[r],R[i]);let B=[],L,z=P.concat();for(let t=0;t<E;t++){let e=T[t];L=[];for(let t=0,r=e.length,i=r-1,n=t+1;t<r;t++,i++,n++)i===r&&(i=0),n===r&&(n=0),L[t]=k(e[t],e[i],e[n]);B.push(L),z=z.concat(L)}if(0===b)l=nm.triangulateShape(R,T);else{let t=[],e=[];for(let r=0;r<b;r++){let i=r/b,n=m*Math.cos(i*Math.PI/2),s=y*Math.sin(i*Math.PI/2)+g;for(let e=0,r=R.length;e<r;e++){let r=O(R[e],P[e],s);V(r.x,r.y,-n),0===i&&t.push(r)}for(let t=0;t<E;t++){let r=T[t];L=B[t];let o=[];for(let t=0,e=r.length;t<e;t++){let e=O(r[t],L[t],s);V(e.x,e.y,-n),0===i&&o.push(e)}0===i&&e.push(o)}}l=nm.triangulateShape(t,e)}let N=l.length,U=y+g;for(let t=0;t<I;t++){let e=f?O(_[t],z[t],U):_[t];S?(a.copy(s.normals[0]).multiplyScalar(e.x),o.copy(s.binormals[0]).multiplyScalar(e.y),h.copy(w[0]).add(a).add(o),V(h.x,h.y,h.z)):V(e.x,e.y,0)}for(let t=1;t<=p;t++)for(let e=0;e<I;e++){let r=f?O(_[e],z[e],U):_[e];S?(a.copy(s.normals[t]).multiplyScalar(r.x),o.copy(s.binormals[t]).multiplyScalar(r.y),h.copy(w[t]).add(a).add(o),V(h.x,h.y,h.z)):V(r.x,r.y,d/p*t)}for(let t=b-1;t>=0;t--){let e=t/b,r=m*Math.cos(e*Math.PI/2),i=y*Math.sin(e*Math.PI/2)+g;for(let t=0,e=R.length;t<e;t++){let e=O(R[t],P[t],i);V(e.x,e.y,d+r)}for(let t=0,e=T.length;t<e;t++){let e=T[t];L=B[t];for(let t=0,n=e.length;t<n;t++){let n=O(e[t],L[t],i);S?V(n.x,n.y+w[p-1].y,w[p-1].x+r):V(n.x,n.y,d+r)}}}function D(t,e){let n=t.length;for(;--n>=0;){let s=n,o=n-1;o<0&&(o=t.length-1);for(let t=0,n=p+2*b;t<n;t++){let n=I*t,a=I*(t+1);!function(t,e,n,s){q(t),q(e),q(s),q(e),q(n),q(s);let o=i.length/3,a=x.generateSideWallUV(r,i,o-6,o-3,o-2,o-1);G(a[0]),G(a[1]),G(a[3]),G(a[1]),G(a[2]),G(a[3])}(e+s+n,e+o+n,e+o+a,e+s+a)}}}function V(t,e,r){u.push(t),u.push(e),u.push(r)}function W(t,e,n){q(t),q(e),q(n);let s=i.length/3,o=x.generateTopUV(r,i,s-3,s-2,s-1);G(o[0]),G(o[1]),G(o[2])}function q(t){i.push(u[3*t+0]),i.push(u[3*t+1]),i.push(u[3*t+2])}function G(t){n.push(t.x),n.push(t.y)}(function(){let t=i.length/3;if(f){let t=0*I;for(let e=0;e<N;e++){let r=l[e];W(r[2]+t,r[1]+t,r[0]+t)}t=I*(p+2*b);for(let e=0;e<N;e++){let r=l[e];W(r[0]+t,r[1]+t,r[2]+t)}}else{for(let t=0;t<N;t++){let e=l[t];W(e[2],e[1],e[0])}for(let t=0;t<N;t++){let e=l[t];W(e[0]+I*p,e[1]+I*p,e[2]+I*p)}}r.addGroup(t,i.length/3-t,0)})(),function(){let t=i.length/3,e=0;D(R,0),e+=R.length;for(let t=0,r=T.length;t<r;t++){let r=T[t];D(r,e),e+=r.length}r.addGroup(t,i.length/3-t,1)}()}(t[s]);this.setAttribute("position",new ew(i,3)),this.setAttribute("uv",new ew(n,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e,r){if(r.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){let i=t[e];r.shapes.push(i.uuid)}else r.shapes.push(t.uuid);return r.options=Object.assign({},e),void 0!==e.extrudePath&&(r.options.extrudePath=e.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){let r=[];for(let i=0,n=t.shapes.length;i<n;i++){let n=e[t.shapes[i]];r.push(n)}let i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=new i5[i.type]().fromJSON(i)),new nb(r,t.options)}}let nv={generateTopUV:function(t,e,r,i,n){let s=e[3*r],o=e[3*r+1],a=e[3*i],h=e[3*i+1],l=e[3*n],u=e[3*n+1];return[new F(s,o),new F(a,h),new F(l,u)]},generateSideWallUV:function(t,e,r,i,n,s){let o=e[3*r],a=e[3*r+1],h=e[3*r+2],l=e[3*i],u=e[3*i+1],c=e[3*i+2],p=e[3*n],d=e[3*n+1],f=e[3*n+2],m=e[3*s],y=e[3*s+1],g=e[3*s+2];return Math.abs(a-u)<Math.abs(o-l)?[new F(o,1-h),new F(l,1-c),new F(p,1-f),new F(m,1-g)]:[new F(a,1-h),new F(u,1-c),new F(d,1-f),new F(y,1-g)]}};class nx extends iI{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2;super([-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new nx(t.radius,t.detail)}}class nw extends eP{constructor(t=[new F(0,-.5),new F(.5,0),new F(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=P(i,0,2*Math.PI);const n=[],s=[],o=[],a=[],h=[],l=1/e,u=new j,c=new F,p=new j,d=new j,f=new j;let m=0,y=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,p.x=+(y=t[e+1].y-t[e].y),p.y=-m,p.z=0*y,f.copy(p),p.normalize(),a.push(p.x,p.y,p.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,p.x=+(y=t[e+1].y-t[e].y),p.y=-m,p.z=0*y,d.copy(p),p.x+=f.x,p.y+=f.y,p.z+=f.z,p.normalize(),a.push(p.x,p.y,p.z),f.copy(d)}for(let n=0;n<=e;n++){const p=r+n*l*i,d=Math.sin(p),f=Math.cos(p);for(let r=0;r<=t.length-1;r++){u.x=t[r].x*d,u.y=t[r].y,u.z=t[r].x*f,s.push(u.x,u.y,u.z),c.x=n/e,c.y=r/(t.length-1),o.push(c.x,c.y);const i=a[3*r+0]*d,l=a[3*r+1],p=a[3*r+0]*f;h.push(i,l,p)}}for(let r=0;r<e;r++)for(let e=0;e<t.length-1;e++){const i=e+r*t.length,s=i+t.length,o=i+t.length+1,a=i+1;n.push(i,s,a),n.push(o,a,s)}this.setIndex(n),this.setAttribute("position",new ew(s,3)),this.setAttribute("uv",new ew(o,2)),this.setAttribute("normal",new ew(h,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nw(t.points,t.segments,t.phiStart,t.phiLength)}}class nS extends iI{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new nS(t.radius,t.detail)}}class nM extends eP{constructor(t=1,e=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i};const n=t/2,s=e/2,o=Math.floor(r),a=Math.floor(i),h=o+1,l=a+1,u=t/o,c=e/a,p=[],d=[],f=[],m=[];for(let t=0;t<l;t++){const e=t*c-s;for(let r=0;r<h;r++){const i=r*u-n;d.push(i,-e,0),f.push(0,0,1),m.push(r/o),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<o;e++){const r=e+h*t,i=e+h*(t+1),n=e+1+h*(t+1),s=e+1+h*t;p.push(r,i,s),p.push(i,n,s)}this.setIndex(p),this.setAttribute("position",new ew(d,3)),this.setAttribute("normal",new ew(f,3)),this.setAttribute("uv",new ew(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nM(t.width,t.height,t.widthSegments,t.heightSegments)}}class n_ extends eP{constructor(t=.5,e=1,r=32,i=1,n=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:s},r=Math.max(3,r);const o=[],a=[],h=[],l=[];let u=t;const c=(e-t)/(i=Math.max(1,i)),p=new j,d=new F;for(let t=0;t<=i;t++){for(let t=0;t<=r;t++){const i=n+t/r*s;p.x=u*Math.cos(i),p.y=u*Math.sin(i),a.push(p.x,p.y,p.z),h.push(0,0,1),d.x=(p.x/e+1)/2,d.y=(p.y/e+1)/2,l.push(d.x,d.y)}u+=c}for(let t=0;t<i;t++){const e=t*(r+1);for(let t=0;t<r;t++){const i=t+e,n=i+r+1,s=i+r+2,a=i+1;o.push(i,n,a),o.push(n,s,a)}}this.setIndex(o),this.setAttribute("position",new ew(a,3)),this.setAttribute("normal",new ew(h,3)),this.setAttribute("uv",new ew(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new n_(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class nA extends eP{constructor(t=new i8([new F(0,.5),new F(-.5,-.5),new F(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const r=[],i=[],n=[],s=[];let o=0,a=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(o,a,e),o+=a,a=0;function h(t){let o=i.length/3,h=t.extractPoints(e),l=h.shape,u=h.holes;!1===nm.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){let e=u[t];!0===nm.isClockWise(e)&&(u[t]=e.reverse())}let c=nm.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){let e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){let e=l[t];i.push(e.x,e.y,0),n.push(0,0,1),s.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){let e=c[t],i=e[0]+o,n=e[1]+o,s=e[2]+o;r.push(i,n,s),a+=3}}this.setIndex(r),this.setAttribute("position",new ew(i,3)),this.setAttribute("normal",new ew(n,3)),this.setAttribute("uv",new ew(s,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let r=0,i=t.length;r<i;r++){let i=t[r];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){let r=[];for(let i=0,n=t.shapes.length;i<n;i++){let n=e[t.shapes[i]];r.push(n)}return new nA(r,t.curveSegments)}}class nT extends eP{constructor(t=1,e=32,r=16,i=0,n=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:s,thetaLength:o},e=Math.max(3,Math.floor(e)),r=Math.max(2,Math.floor(r));const a=Math.min(s+o,Math.PI);let h=0;const l=[],u=new j,c=new j,p=[],d=[],f=[],m=[];for(let p=0;p<=r;p++){const y=[],g=p/r,b=t*Math.cos(s+g*o),v=Math.sqrt(t*t-b*b);let x=0;0===p&&0===s?x=.5/e:p===r&&a===Math.PI&&(x=-.5/e);for(let t=0;t<=e;t++){const r=t/e,s=i+r*n;u.x=-v*Math.cos(s),u.y=b,u.z=v*Math.sin(s),d.push(u.x,u.y,u.z),c.copy(u).normalize(),f.push(c.x,c.y,c.z),m.push(r+x,1-g),y.push(h++)}l.push(y)}for(let t=0;t<r;t++)for(let i=0;i<e;i++){const e=l[t][i+1],n=l[t][i],o=l[t+1][i],h=l[t+1][i+1];(0!==t||s>0)&&p.push(e,n,h),(t!==r-1||a<Math.PI)&&p.push(n,o,h)}this.setIndex(p),this.setAttribute("position",new ew(d,3)),this.setAttribute("normal",new ew(f,3)),this.setAttribute("uv",new ew(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nT(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class nC extends iI{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new nC(t.radius,t.detail)}}class nE extends eP{constructor(t=1,e=.4,r=12,i=48,n=2*Math.PI,s=0,o=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:n,thetaStart:s,thetaLength:o},r=Math.floor(r),i=Math.floor(i);const a=[],h=[],l=[],u=[],c=new j,p=new j,d=new j;for(let a=0;a<=r;a++){const f=s+a/r*o;for(let s=0;s<=i;s++){const o=s/i*n;p.x=(t+e*Math.cos(f))*Math.cos(o),p.y=(t+e*Math.cos(f))*Math.sin(o),p.z=e*Math.sin(f),h.push(p.x,p.y,p.z),c.x=t*Math.cos(o),c.y=t*Math.sin(o),d.subVectors(p,c).normalize(),l.push(d.x,d.y,d.z),u.push(s/i),u.push(a/r)}}for(let t=1;t<=r;t++)for(let e=1;e<=i;e++){const r=(i+1)*t+e-1,n=(i+1)*(t-1)+e-1,s=(i+1)*(t-1)+e,o=(i+1)*t+e;a.push(r,n,o),a.push(n,s,o)}this.setIndex(a),this.setAttribute("position",new ew(h,3)),this.setAttribute("normal",new ew(l,3)),this.setAttribute("uv",new ew(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nE(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc,t.thetaStart,t.thetaLength)}}class nR extends eP{constructor(t=1,e=.4,r=64,i=8,n=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:i,p:n,q:s},r=Math.floor(r),i=Math.floor(i);const o=[],a=[],h=[],l=[],u=new j,c=new j,p=new j,d=new j,f=new j,m=new j,y=new j;for(let o=0;o<=r;++o){const b=o/r*n*Math.PI*2;g(b,n,s,t,p),g(b+.01,n,s,t,d),m.subVectors(d,p),y.addVectors(d,p),f.crossVectors(m,y),y.crossVectors(f,m),f.normalize(),y.normalize();for(let t=0;t<=i;++t){const n=t/i*Math.PI*2,s=-e*Math.cos(n),d=e*Math.sin(n);u.x=p.x+(s*y.x+d*f.x),u.y=p.y+(s*y.y+d*f.y),u.z=p.z+(s*y.z+d*f.z),a.push(u.x,u.y,u.z),c.subVectors(u,p).normalize(),h.push(c.x,c.y,c.z),l.push(o/r),l.push(t/i)}}for(let t=1;t<=r;t++)for(let e=1;e<=i;e++){const r=(i+1)*(t-1)+(e-1),n=(i+1)*t+(e-1),s=(i+1)*t+e,a=(i+1)*(t-1)+e;o.push(r,n,a),o.push(n,s,a)}function g(t,e,r,i,n){let s=Math.cos(t),o=Math.sin(t),a=r/e*t,h=Math.cos(a);n.x=i*(2+h)*.5*s,n.y=i*(2+h)*o*.5,n.z=i*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new ew(a,3)),this.setAttribute("normal",new ew(h,3)),this.setAttribute("uv",new ew(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new nR(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class nO extends eP{constructor(t=new i2(new j(-1,-1,0),new j(-1,1,0),new j(1,1,0)),e=64,r=1,i=8,n=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:i,closed:n};const s=t.computeFrenetFrames(e,n);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new j,a=new j,h=new F;let l=new j;const u=[],c=[],p=[],d=[];function f(n){l=t.getPointAt(n/e,l);let h=s.normals[n],p=s.binormals[n];for(let t=0;t<=i;t++){let e=t/i*Math.PI*2,n=Math.sin(e),s=-Math.cos(e);a.x=s*h.x+n*p.x,a.y=s*h.y+n*p.y,a.z=s*h.z+n*p.z,a.normalize(),c.push(a.x,a.y,a.z),o.x=l.x+r*a.x,o.y=l.y+r*a.y,o.z=l.z+r*a.z,u.push(o.x,o.y,o.z)}}(function(){for(let t=0;t<e;t++)f(t);f(!1===n?e:0),function(){for(let t=0;t<=e;t++)for(let r=0;r<=i;r++)h.x=t/e,h.y=r/i,p.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){let r=(i+1)*(t-1)+(e-1),n=(i+1)*t+(e-1),s=(i+1)*t+e,o=(i+1)*(t-1)+e;d.push(r,n,o),d.push(n,s,o)}}()})(),this.setIndex(d),this.setAttribute("position",new ew(u,3)),this.setAttribute("normal",new ew(c,3)),this.setAttribute("uv",new ew(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new nO(new i5[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class nI extends eP{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],r=new Set,i=new j,n=new j;if(null!==t.index){const s=t.attributes.position,o=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,h=a.length;t<h;++t){const h=a[t],l=h.start,u=h.count;for(let t=l,a=l+u;t<a;t+=3)for(let a=0;a<3;a++){const h=o.getX(t+a),l=o.getX(t+(a+1)%3);i.fromBufferAttribute(s,h),n.fromBufferAttribute(s,l),!0===nk(i,n,r)&&(e.push(i.x,i.y,i.z),e.push(n.x,n.y,n.z))}}}else{const s=t.attributes.position;for(let t=0,o=s.count/3;t<o;t++)for(let o=0;o<3;o++){const a=3*t+o,h=3*t+(o+1)%3;i.fromBufferAttribute(s,a),n.fromBufferAttribute(s,h),!0===nk(i,n,r)&&(e.push(i.x,i.y,i.z),e.push(n.x,n.y,n.z))}}this.setAttribute("position",new ew(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function nk(t,e,r){let i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==r.has(i)&&!0!==r.has(n)&&(r.add(i),r.add(n),!0)}var nP=Object.freeze({__proto__:null,BoxGeometry:iT,CapsuleGeometry:iC,CircleGeometry:iE,ConeGeometry:iO,CylinderGeometry:iR,DodecahedronGeometry:ik,EdgesGeometry:iN,ExtrudeGeometry:nb,IcosahedronGeometry:nx,LatheGeometry:nw,OctahedronGeometry:nS,PlaneGeometry:nM,PolyhedronGeometry:iI,RingGeometry:n_,ShapeGeometry:nA,SphereGeometry:nT,TetrahedronGeometry:nC,TorusGeometry:nE,TorusKnotGeometry:nR,TubeGeometry:nO,WireframeGeometry:nI});class nB extends eV{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new tV(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}function nL(t){let e={};for(let r in t)for(let i in e[r]={},t[r]){let n=t[r][i];if(nN(n))n.isRenderTargetTexture?(_("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[r][i]=null):e[r][i]=n.clone();else if(Array.isArray(n))if(nN(n[0])){let t=[];for(let e=0,r=n.length;e<r;e++)t[e]=n[e].clone();e[r][i]=t}else e[r][i]=n.slice();else e[r][i]=n}return e}function nz(t){let e={};for(let r=0;r<t.length;r++){let i=nL(t[r]);for(let t in i)e[t]=i[t]}return e}function nN(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}class nF extends eV{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=nL(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let r=0;r<t.length;r++)e.push(t[r].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);for(let r in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){let i=this.uniforms[r].value;i&&i.isTexture?e.uniforms[r]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[r]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[r]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[r]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[r]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[r]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[r]={type:"m4",value:i.toArray()}:e.uniforms[r]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let r={};for(let t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}fromJSON(t,e){if(super.fromJSON(t,e),void 0!==t.uniforms)for(let r in t.uniforms){let i=t.uniforms[r];switch(this.uniforms[r]={},i.type){case"t":this.uniforms[r].value=e[i.value]||null;break;case"c":this.uniforms[r].value=new tV().setHex(i.value);break;case"v2":this.uniforms[r].value=new F().fromArray(i.value);break;case"v3":this.uniforms[r].value=new j().fromArray(i.value);break;case"v4":this.uniforms[r].value=new ti().fromArray(i.value);break;case"m3":this.uniforms[r].value=new W().fromArray(i.value);break;case"m4":this.uniforms[r].value=new th().fromArray(i.value);break;default:this.uniforms[r].value=i.value}}if(void 0!==t.defines&&(this.defines=t.defines),void 0!==t.vertexShader&&(this.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(this.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(this.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)this.extensions[e]=t.extensions[e];return void 0!==t.lights&&(this.lights=t.lights),void 0!==t.clipping&&(this.clipping=t.clipping),this}}class nU extends nF{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class nj extends eV{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tV(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nD extends nj{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new F(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return P(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tV(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tV(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tV(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._retroreflectivity=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get retroreflectivity(){return this._retroreflectivity}set retroreflectivity(t){this._retroreflectivity>0!=t>0&&this.version++,this._retroreflectivity=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.retroreflectivity=t.retroreflectivity,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class nV extends eV{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tV(0xffffff),this.specular=new tV(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nW extends eV{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tV(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class nq extends eV{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class nG extends eV{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tV(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nH extends eV{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class n$ extends eV{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class nJ extends eV{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tV(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nY extends r7{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function nX(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function nZ(t){return void 0!==t&&void 0!==t.inTangents&&void 0!==t.outTangents}function nK(t){let e=t.length,r=Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort(function(e,r){return t[e]-t[r]}),r}function nQ(t,e,r){let i=t.length,n=new t.constructor(i);for(let s=0,o=0;o!==i;++s){let i=r[s]*e;for(let r=0;r!==e;++r)n[o++]=t[i+r]}return n}function n0(t,e,r,i){let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let o=s[i];if(void 0!==o)if(Array.isArray(o))do void 0!==(o=s[i])&&(e.push(s.time),r.push(...o)),s=t[n++];while(void 0!==s)else if(void 0!==o.toArray)do void 0!==(o=s[i])&&(e.push(s.time),o.toArray(r,r.length)),s=t[n++];while(void 0!==s)else do void 0!==(o=s[i])&&(e.push(s.time),r.push(o)),s=t[n++];while(void 0!==s)}class n1{constructor(t,e,r,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(r),this.sampleValues=e,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,r=this._cachedIndex,i=e[r],n=e[r-1];t:{e:{let s;r:{i:if(!(t<i)){for(let s=r+2;;){if(void 0===i){if(t<n)break i;return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===s)break;if(n=i,t<(i=e[++r]))break e}s=e.length;break r}if(!(t>=n)){let o=e[1];t<o&&(r=2,n=o);for(let s=r-2;;){if(void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(r===s)break;if(i=n,t>=(n=e[--r-1]))break e}s=r,r=0;break r}break t}for(;r<s;){let i=r+s>>>1;t<e[i]?s=i:r=i+1}if(i=e[r],void 0===(n=e[r-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=t*i;for(let t=0;t!==i;++t)e[t]=r[n+t];return e}interpolate_(){throw Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}}class n2 extends n1{constructor(t,e,r,i){super(t,e,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,r){let i=this.parameterPositions,n=t-2,s=t+1,o=i[n],a=i[s];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:n=t,o=2*e-r;break;case 2402:n=i.length-2,o=e+i[n]-i[n+1];break;default:n=t,o=r}if(void 0===a)switch(this.getSettings_().endingEnd){case 2401:s=t,a=2*r-e;break;case 2402:s=1,a=r+i[1]-i[0];break;default:s=t-1,a=e}let h=(r-e)*.5,l=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(a-r),this._offsetPrev=n*l,this._offsetNext=s*l}interpolate_(t,e,r,i){let n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,p=this._weightNext,d=(r-e)/(i-e),f=d*d,m=f*d,y=-c*m+2*c*f-c*d,g=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*d+1,b=(-1-p)*m+(1.5+p)*f+.5*d,v=p*m-p*f;for(let t=0;t!==o;++t)n[t]=y*s[l+t]+g*s[h+t]+b*s[a+t]+v*s[u+t];return n}}class n3 extends n1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){let n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=(r-e)/(i-e),u=1-l;for(let t=0;t!==o;++t)n[t]=s[h+t]*u+s[a+t]*l;return n}}class n5 extends n1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class n4 extends n1{interpolate_(t,e,r,i){let n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=this.inTangents,u=this.outTangents;if(!l||!u){let t=(r-e)/(i-e),l=1-t;for(let e=0;e!==o;++e)n[e]=s[h+e]*l+s[a+e]*t;return n}let c=2*o,p=t-1;for(let d=0;d!==o;++d){let o=s[h+d],f=s[a+d],m=p*c+2*d,y=u[m],g=u[m+1],b=t*c+2*d,v=l[b],x=l[b+1],w=function(t,e,r,i,n){let s=(t-e)/(n-e);for(let o=0;o<8;o++){let o=n6(s,e,r,i,n)-t;if(1e-10>Math.abs(o))break;let a=function(t,e,r,i,n){let s=1-t;return 3*s*s*(r-e)+6*s*t*(i-r)+3*t*t*(n-i)}(s,e,r,i,n);if(1e-10>Math.abs(a))break;s=Math.max(0,Math.min(1,s-o/a))}return s}(r,e,y,v,i);n[d]=n6(w,o,g,x,f)}return n}}function n6(t,e,r,i,n){let s=1-t;return s*s*s*e+3*s*s*t*r+3*s*t*t*i+t*t*t*n}class n8{constructor(t,e,r,i){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=nX(e,this.TimeBufferType),this.values=nX(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e,r=t.constructor;if(r.toJSON!==this.toJSON)e=r.toJSON(t);else{e={name:t.name,times:nX(t.times,Array),values:nX(t.values,Array)};let r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r),nZ(t.settings)&&(e.settings={inTangents:nX(t.settings.inTangents,Array),outTangents:nX(t.settings.outTangents,Array)})}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new n5(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new n3(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new n2(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new n4(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.inTangents=this.settings.inTangents,e.outTangents=this.settings.outTangents),e}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e);return _("KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]*=t;nZ(this.settings)&&(n9(this.settings.inTangents,t),n9(this.settings.outTangents,t))}return this}trim(t,e){let r=this.times,i=r.length,n=0,s=i-1;for(;n!==i&&r[n]<t;)++n;for(;-1!==s&&r[s]>e;)--s;if(++s,0!==n||s!==i){n>=s&&(n=(s=Math.max(s,1))-1);let t=this.getValueSize();this.times=r.slice(n,s),this.values=this.values.slice(n*t,s*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(A("KeyframeTrack: Invalid value size in track.",this),t=!1);let r=this.times,i=this.values,n=r.length;0===n&&(A("KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==n;e++){let i=r[e];if("number"==typeof i&&isNaN(i)){A("KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){A("KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&b(i))for(let e=0,r=i.length;e!==r;++e){let r=i[e];if(isNaN(r)){A("KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=2302===this.getInterpolation(),n=t.length-1,s=1;for(let o=1;o<n;++o){let n=!1,a=t[o];if(a!==t[o+1]&&(1!==o||a!==t[0]))if(i)n=!0;else{let t=o*r,i=t-r,s=t+r;for(let o=0;o!==r;++o){let r=e[t+o];if(r!==e[i+o]||r!==e[s+o]){n=!0;break}}}if(n){if(o!==s){t[s]=t[o];let i=o*r,n=s*r;for(let t=0;t!==r;++t)e[n+t]=e[i+t]}++s}}if(n>0){t[s]=t[n];for(let t=n*r,i=s*r,o=0;o!==r;++o)e[i+o]=e[t+o];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*r)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),r=new this.constructor(this.name,t,e);return r.createInterpolant=this.createInterpolant,nZ(this.settings)&&(r.settings={inTangents:this.settings.inTangents.slice(),outTangents:this.settings.outTangents.slice()}),r}}function n9(t,e){for(let r=0,i=t.length;r!==i;r+=2)t[r]*=e}n8.prototype.ValueTypeName="",n8.prototype.TimeBufferType=Float32Array,n8.prototype.ValueBufferType=Float32Array,n8.prototype.DefaultInterpolation=2301;class n7 extends n8{constructor(t,e,r){super(t,e,r)}}n7.prototype.ValueTypeName="bool",n7.prototype.ValueBufferType=Array,n7.prototype.DefaultInterpolation=2300,n7.prototype.InterpolantFactoryMethodLinear=void 0,n7.prototype.InterpolantFactoryMethodSmooth=void 0;class st extends n8{constructor(t,e,r,i){super(t,e,r,i)}}st.prototype.ValueTypeName="color";class se extends n8{constructor(t,e,r,i){super(t,e,r,i)}}se.prototype.ValueTypeName="number";class sr extends n1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){let n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-e)/(i-e),h=t*o;for(let t=h+o;h!==t;h+=4)U.slerpFlat(n,0,s,h-o,s,h,a);return n}}class si extends n8{constructor(t,e,r,i){super(t,e,r,i)}InterpolantFactoryMethodLinear(t){return new sr(this.times,this.values,this.getValueSize(),t)}}si.prototype.ValueTypeName="quaternion",si.prototype.InterpolantFactoryMethodSmooth=void 0;class sn extends n8{constructor(t,e,r){super(t,e,r)}}sn.prototype.ValueTypeName="string",sn.prototype.ValueBufferType=Array,sn.prototype.DefaultInterpolation=2300,sn.prototype.InterpolantFactoryMethodLinear=void 0,sn.prototype.InterpolantFactoryMethodSmooth=void 0;class ss extends n8{constructor(t,e,r,i){super(t,e,r,i)}}ss.prototype.ValueTypeName="vector";class so{constructor(t="",e=-1,r=[],i=2500){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=k(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push((function(t){let e;if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let r=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return se;case"vector":case"vector2":case"vector3":case"vector4":return ss;case"color":return st;case"quaternion":return si;case"bool":case"boolean":return n7;case"string":return sn}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],r=[];n0(t.keys,e,r,"value"),t.times=e,t.values=r}return e=void 0!==r.parse?r.parse(t):new r(t.name,t.times,t.values,t.interpolation),nZ(t.settings)&&(e.settings={inTangents:nX(t.settings.inTangents,Float32Array),outTangents:nX(t.settings.outTangents,Float32Array)}),e})(r[t]).scale(i));let n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n.userData=JSON.parse(t.userData||"{}"),n}static toJSON(t){let e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,i=r.length;t!==i;++t)e.push(n8.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){let n=e.length,s=[];for(let t=0;t<n;t++){let o=[],a=[];o.push((t+n-1)%n,t,(t+1)%n),a.push(0,1,0);let h=nK(o);o=nQ(o,1,h),a=nQ(a,1,h),i||0!==o[0]||(o.push(n),a.push(a[0])),s.push(new se(".morphTargetInfluences["+e[t].name+"]",o,a).scale(1/r))}return new this(t,-1,s)}static findByName(t,e){let r=t;Array.isArray(t)||(r=t.geometry&&t.geometry.animations||t.animations);for(let t=0;t<r.length;t++)if(r[t].name===e)return r[t];return null}static CreateClipsFromMorphTargetSequences(t,e,r){let i={},n=/^([\w-]*?)([\d]+)$/;for(let e=0,r=t.length;e<r;e++){let r=t[e],s=r.name.match(n);if(s&&s.length>1){let t=s[1],e=i[t];e||(i[t]=e=[]),e.push(r)}}let s=[];for(let t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return s}resetDuration(){let t=this.tracks,e=0;for(let r=0,i=t.length;r!==i;++r){let t=this.tracks[r];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}}let sa={enabled:!1,files:{},add:function(t,e){!1===this.enabled||sh(t)||(this.files[t]=e)},get:function(t){if(!1!==this.enabled&&!sh(t))return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function sh(t){try{let e=t.slice(t.indexOf(":")+1),r=new URL(e);return"blob:"===r.protocol}catch(t){return!1}}class sl{constructor(t,e,r){let i;const n=this;let s=!1,o=0,a=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this._abortController=null,this.itemStart=function(t){a++,!1===s&&void 0!==n.onStart&&n.onStart(t,o,a),s=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,a),o===a&&(s=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return(t=t.normalize("NFC"),i)?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){let e=h.indexOf(t);return -1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,r=h.length;e<r;e+=2){let r=h[e],i=h[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let su=new sl;class sc{constructor(t){this.manager=void 0!==t?t:su,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){let r=this;return new Promise(function(i,n){r.load(t,i,e,n)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}sc.DEFAULT_MATERIAL_NAME="__DEFAULT";let sp={};class sd extends Error{constructor(t,e){super(t),this.response=e}}class sf extends sc{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,r,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let n=sa.get(`file:${t}`);if(void 0!==n){this.manager.itemStart(t),setTimeout(()=>{e&&e(n),this.manager.itemEnd(t)},0);return}if(void 0!==sp[t])return void sp[t].push({onLoad:e,onProgress:r,onError:i});sp[t]=[],sp[t].push({onLoad:e,onProgress:r,onError:i});let s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&_("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let r=sp[t],i=e.body.getReader(),n=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),s=n?parseInt(n):0,o=0!==s,a=0;return new Response(new ReadableStream({start(t){!function e(){i.read().then(({done:i,value:n})=>{if(i)t.close();else{let i=new ProgressEvent("progress",{lengthComputable:o,loaded:a+=n.byteLength,total:s});for(let t=0,e=r.length;t<e;t++){let e=r[t];e.onProgress&&e.onProgress(i)}t.enqueue(n),e()}},e=>{t.error(e)})}()}}))}throw new sd(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,o));case"json":return t.json();default:if(""===o)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(o),r=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>r.decode(t))}}}).then(e=>{sa.add(`file:${t}`,e);let r=sp[t];delete sp[t];for(let t=0,i=r.length;t<i;t++){let i=r[t];i.onLoad&&i.onLoad(e)}}).catch(e=>{let r=sp[t];if(void 0===r)throw this.manager.itemError(t),e;delete sp[t];for(let t=0,i=r.length;t<i;t++){let i=r[t];i.onError&&i.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let sm=new WeakMap;class sy extends sc{constructor(t){super(t)}load(t,e,r,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let n=this,s=sa.get(`image:${t}`);if(void 0!==s){if(!0===s.complete)n.manager.itemStart(t),setTimeout(function(){e&&e(s),n.manager.itemEnd(t)},0);else{let t=sm.get(s);void 0===t&&(t=[],sm.set(s,t)),t.push({onLoad:e,onError:i})}return s}let o=v("img");function a(){l(),e&&e(this);let r=sm.get(this)||[];for(let t=0;t<r.length;t++){let e=r[t];e.onLoad&&e.onLoad(this)}sm.delete(this),n.manager.itemEnd(t)}function h(e){l(),i&&i(e),sa.remove(`image:${t}`);let r=sm.get(this)||[];for(let t=0;t<r.length;t++){let i=r[t];i.onError&&i.onError(e)}sm.delete(this),n.manager.itemError(t),n.manager.itemEnd(t)}function l(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),sa.add(`image:${t}`,o),n.manager.itemStart(t),o.src=t,o}}class sg extends tL{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new tV(t),this.intensity=e}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}}class sb extends sg{constructor(t,e,r){super(t,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.groundColor=new tV(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}toJSON(t){let e=super.toJSON(t);return e.object.groundColor=this.groundColor.getHex(),e}}let sv=new th,sx=new j,sw=new j;class sS{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new F(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new th,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rW,this._frameExtents=new F(1,1),this._viewportCount=1,this._viewports=[new ti(0,0,1,1)]}getViewportCount(){return this._viewportCount}getCamera(){return this.camera}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera;sx.setFromMatrixPosition(t.matrixWorld),e.position.copy(sx),sw.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(sw),e.updateMatrixWorld(),this._updateMatrix(e,this.matrix,this._frustum)}_updateMatrix(t,e,r,i){sv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),r.setFromProjectionMatrix(sv,t.coordinateSystem,t.reversedDepth);let n=this._frameExtents,s=i?i.z/n.x:1,o=i?i.w/n.y:1,a=i?i.x/n.x:0,h=i?i.y/n.y:0;2001===t.coordinateSystem||t.reversedDepth?e.set(.5*s,0,0,.5*s+a,0,.5*o,0,.5*o+h,0,0,1,0,0,0,0,1):e.set(.5*s,0,0,.5*s+a,0,.5*o,0,.5*o+h,0,0,.5,.5,0,0,0,1),e.multiply(sv)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return t.intensity=this.intensity,t.bias=this.bias,t.normalBias=this.normalBias,t.radius=this.radius,t.blurSamples=this.blurSamples,t.mapSize=this.mapSize.toArray(),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}let sM=new j,s_=new U,sA=new j;class sT extends tL{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new th,this.projectionMatrix=new th,this.projectionMatrixInverse=new th,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(sM,s_,sA),1===sA.x&&1===sA.y&&1===sA.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(sM,s_,sA.set(1,1,1)).invert()}updateWorldMatrix(t,e,r=!1){super.updateWorldMatrix(t,e,r),this.matrixWorld.decompose(sM,s_,sA),1===sA.x&&1===sA.y&&1===sA.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(sM,s_,sA.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let sC=new j,sE=new F,sR=new F;class sO extends sT{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*I*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*O*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*I*Math.atan(Math.tan(.5*O*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,r){sC.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(sC.x,sC.y).multiplyScalar(-t/sC.z),sC.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(sC.x,sC.y).multiplyScalar(-t/sC.z)}getViewSize(t,e){return this.getViewBounds(t,sE,sR),e.subVectors(sR,sE)}setViewOffset(t,e,r,i,n,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*O*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i,s=this.view;if(null!==this.view&&this.view.enabled){let t=s.fullWidth,o=s.fullHeight;n+=s.offsetX*i/t,e-=s.offsetY*r/o,i*=s.width/t,r*=s.height/o}let o=this.filmOffset;0!==o&&(n+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,e,e-r,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}class sI extends sS{constructor(){super(new sO(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,r=2*I*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,n=t.distance||e.far;(r!==e.fov||i!==e.aspect||n!==e.far)&&(e.fov=r,e.aspect=i,e.far=n,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this.aspect=t.aspect,this}toJSON(){let t=super.toJSON();return t.focus=this.focus,t.aspect=this.aspect,t}}class sk extends sg{constructor(t,e,r=0,i=Math.PI/3,n=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.target=new tL,this.distance=r,this.angle=i,this.penumbra=n,this.decay=s,this.map=null,this.shadow=new sI}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}}class sP extends sS{constructor(){super(new sO(90,1,.5,500)),this.isPointLightShadow=!0}}class sB extends sg{constructor(t,e,r=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new sP}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}}class sL extends sT{constructor(t=-1,e=1,r=1,i=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=n,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,r,i,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2,n=r-t,s=r+t,o=i+e,a=i-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=t*this.view.offsetX,s=n+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(n,s,o,a,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class sz extends sS{constructor(){super(new sL(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class sN extends sg{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.target=new tL,this.shadow=new sz}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}}class sF extends sg{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class sU extends sg{constructor(t,e,r=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class sj{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new j)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){let r=t.x,i=t.y,n=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*n),e.addScaledVector(s[3],.488603*r),e.addScaledVector(s[4],r*i*1.092548),e.addScaledVector(s[5],i*n*1.092548),e.addScaledVector(s[6],.315392*(3*n*n-1)),e.addScaledVector(s[7],r*n*1.092548),e.addScaledVector(s[8],.546274*(r*r-i*i)),e}getIrradianceAt(t,e){let r=t.x,i=t.y,n=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*n),e.addScaledVector(s[3],1.023328*r),e.addScaledVector(s[4],.858086*r*i),e.addScaledVector(s[5],.858086*i*n),e.addScaledVector(s[6],.743125*n*n-.247708),e.addScaledVector(s[7],.858086*r*n),e.addScaledVector(s[8],.429043*(r*r-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(t.coefficients[r],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let r=0;r<9;r++)this.coefficients[r].lerp(t.coefficients[r],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){let r=t.x,i=t.y,n=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*n,e[3]=.488603*r,e[4]=1.092548*r*i,e[5]=1.092548*i*n,e[6]=.315392*(3*n*n-1),e[7]=1.092548*r*n,e[8]=.546274*(r*r-i*i)}}class sD extends sg{constructor(t=new sj,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}toJSON(t){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}let sV={};class sW extends sc{constructor(t){super(t),this.textures={}}load(t,e,r,i){let n=this,s=new sf(n.manager);s.setPath(n.path),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(t,function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),n.manager.itemError(t)}},r,i)}parse(t){let e=this.createMaterialFromType(t.type);return e.fromJSON(t,this.textures),e}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return sW.createMaterialFromType(t)}static createMaterialFromType(t){let e,r={ShadowMaterial:nB,SpriteMaterial:eW,RawShaderMaterial:nU,ShaderMaterial:nF,PointsMaterial:im,MeshPhysicalMaterial:nD,MeshStandardMaterial:nj,MeshPhongMaterial:nV,MeshToonMaterial:nW,MeshNormalMaterial:nq,MeshLambertMaterial:nG,MeshDepthMaterial:nH,MeshDistanceMaterial:n$,MeshBasicMaterial:rr,MeshMatcapMaterial:nJ,LineDashedMaterial:nY,LineBasicMaterial:r7,Material:eV,...sV}[t];return void 0===r?(T(`MaterialLoader: Unknown material type "${t}". Use .registerMaterial() before starting the deserialization process.`),e=new eV):e=new r,e}static registerMaterial(t,e){sV[t]=e}}class sq{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}class sG extends eP{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class sH extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=new sf(n.manager);s.setPath(n.path),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(t,function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),n.manager.itemError(t)}},r,i)}parse(t){let e={},r={};function i(t,i){if(void 0!==e[i])return e[i];let n=t.interleavedBuffers[i],s=function(t,e){if(void 0!==r[e])return r[e];let i=new Uint32Array(t.arrayBuffers[e]).buffer;return r[e]=i,i}(t,n.buffer),o=new eB(g(n.type,s),n.stride);return o.uuid=n.uuid,void 0!==n.usage&&o.setUsage(n.usage),e[i]=o,o}let n=t.isInstancedBufferGeometry?new sG:new eP,s=t.data.index;if(void 0!==s){let t=g(s.type,s.array);n.setIndex(new eb(t,1))}let o=t.data.attributes;for(let e in o){let r,s=o[e];if(s.isInterleavedBufferAttribute)r=new ez(i(t.data,s.data),s.itemSize,s.offset,s.normalized);else{let t=g(s.type,s.array);r=new(s.isInstancedBufferAttribute?rI:eb)(t,s.itemSize,s.normalized)}void 0!==s.name&&(r.name=s.name),void 0!==s.usage&&r.setUsage(s.usage),void 0!==s.gpuType&&(r.gpuType=s.gpuType),n.setAttribute(e,r)}let a=t.data.morphAttributes;if(a)for(let e in a){let r=a[e],s=[];for(let e=0,n=r.length;e<n;e++){let n,o=r[e];n=o.isInterleavedBufferAttribute?new ez(i(t.data,o.data),o.itemSize,o.offset,o.normalized):new eb(g(o.type,o.array),o.itemSize,o.normalized),void 0!==o.name&&(n.name=o.name),void 0!==o.usage&&n.setUsage(o.usage),void 0!==o.gpuType&&(n.gpuType=o.gpuType),s.push(n)}n.morphAttributes[e]=s}t.data.morphTargetsRelative&&(n.morphTargetsRelative=!0);let h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){let e=h[t];n.addGroup(e.start,e.count,e.materialIndex)}let l=t.data.boundingSphere;return void 0!==l&&(n.boundingSphere=new eA().fromJSON(l)),t.name&&(n.name=t.name),t.userData&&(n.userData=t.userData),n}}let s$={},sJ={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},sY={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},sX={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008},sZ=new WeakMap;class sK{static getContext(){return void 0===i&&(i=new(window.AudioContext||window.webkitAudioContext)),i}static setContext(t){i=t}}let sQ=new th,s0=new th,s1=new th;class s2{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(t){this._document=t,void 0!==t.hidden&&(this._pageVisibilityHandler=s3.bind(this),t.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(t){return this._timescale=t,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(t){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==t?t:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function s3(){!1===this._document.hidden&&this.reset()}let s5=new j,s4=new U,s6=new j,s8=new j,s9=new j;class s7 extends tL{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void _("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void _("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;let e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)}stop(t=0){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){return this.detune=t,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1===this.hasPlaybackControl?(_("Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}copy(t,e){return(super.copy(t,e),"buffer"!==t.sourceType)?_("Audio: Audio source type cannot be copied."):(this.autoplay=t.autoplay,this.buffer=t.buffer,this.detune=t.detune,this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this.offset=t.offset,this.duration=t.duration,this.playbackRate=t.playbackRate,this.hasPlaybackControl=t.hasPlaybackControl,this.sourceType=t.sourceType,this.filters=t.filters.slice()),this}clone(t){return new this.constructor(this.listener).copy(this,t)}}let ot=new j,oe=new U,or=new j,oi=new j;class on{constructor(t,e,r){let i,n,s;switch(this.binding=t,this.valueSize=r,e){case"quaternion":i=this._slerp,n=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":i=this._select,n=this._select,s=this._setAdditiveIdentityOther,this.buffer=Array(5*r);break;default:i=this._lerp,n=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=n,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){let r=this.buffer,i=this.valueSize,n=t*i+i,s=this.cumulativeWeight;if(0===s){for(let t=0;t!==i;++t)r[n+t]=r[t];s=e}else{s+=e;let t=e/s;this._mixBufferRegion(r,n,0,t,i)}this.cumulativeWeight=s}accumulateAdditive(t){let e=this.buffer,r=this.valueSize,i=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,r),this.cumulativeWeightAdditive+=t}apply(t){let e=this.valueSize,r=this.buffer,i=t*e+e,n=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){let t=e*this._origIndex;this._mixBufferRegion(r,i,t,1-n,e)}s>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){o.setValue(r,i);break}}saveOriginalState(){let t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r;t!==i;++t)e[t]=e[i+t%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let r=t;r<e;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[e+r]=this.buffer[t+r]}_select(t,e,r,i,n){if(i>=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){U.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,n){let s=this._workIndex*n;U.multiplyQuaternionsFlat(t,s,t,e,t,r),U.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,r,i,n){let s=1-i;for(let o=0;o!==n;++o){let n=e+o;t[n]=t[n]*s+t[r+o]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){let n=e+s;t[n]=t[n]+t[r+s]*i}}}let os="\\[\\]\\.:\\/",oo=RegExp("["+os+"]","g"),oa="[^"+os+"]",oh="[^"+os.replace("\\.","")+"]",ol=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",oa)+/(WCOD+)?/.source.replace("WCOD",oh)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",oa)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",oa)+"$"),ou=["material","materials","bones","map"];class oc{constructor(t,e,r){this.path=e,this.parsedPath=r||oc.parseTrackName(e),this.node=oc.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new oc.Composite(t,e,r):new oc(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(oo,"")}static parseTrackName(t){let e=ol.exec(t);if(null===e)throw Error("THREE.PropertyBinding: Cannot parse trackName: "+t);let r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let t=r.nodeName.substring(i+1);-1!==ou.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){let r=function(t){for(let i=0;i<t.length;i++){let n=t[i];if(n.name===e||n.uuid===e)return n;let s=r(n.children);if(s)return s}return null},i=r(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)t[e++]=r[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,r=e.objectName,i=e.propertyName,n=e.propertyIndex;if(t||(t=oc.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void _("PropertyBinding: No target node found for track: "+this.path+".");if(r){let i=e.objectIndex;switch(r){case"materials":if(!t.material)return void A("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void A("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void A("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void A("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void A("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[r])return void A("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[r]}if(void 0!==i){if(void 0===t[i])return void A("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}let s=t[i];if(void 0===s)return void A("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+i+" but it wasn't found.",t);let o=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?o=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===i){if(!t.geometry)return void A("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void A("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[n]&&(n=t.morphTargetDictionary[n])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}oc.Composite=class{constructor(t,e,r){const i=r||oc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(t,e)}setValue(t,e){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}},oc.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},oc.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},oc.prototype.GetterByBindingType=[oc.prototype._getValue_direct,oc.prototype._getValue_array,oc.prototype._getValue_arrayElement,oc.prototype._getValue_toArray],oc.prototype.SetterByBindingTypeAndVersioning=[[oc.prototype._setValue_direct,oc.prototype._setValue_direct_setNeedsUpdate,oc.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[oc.prototype._setValue_array,oc.prototype._setValue_array_setNeedsUpdate,oc.prototype._setValue_array_setMatrixWorldNeedsUpdate],[oc.prototype._setValue_arrayElement,oc.prototype._setValue_arrayElement_setNeedsUpdate,oc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[oc.prototype._setValue_fromArray,oc.prototype._setValue_fromArray_setNeedsUpdate,oc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class op{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,o=Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=n[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,r=!1){if(t.fadeOut(e),this.fadeIn(e),!0===r){let r=this._clip.duration,i=t._clip.duration;t._restoreTimeScale=t.timeScale,this._restoreTimeScale=this.timeScale,t.warp(1,i/r,e),this.warp(r/i,1,e)}return this}crossFadeTo(t,e,r=!1){return t.crossFadeFrom(this,e,r)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,r){let i=this._mixer,n=i.time,s=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);let a=o.parameterPositions,h=o.sampleValues;return a[0]=n,a[1]=n+r,h[0]=t/s,h[1]=e/s,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this._restoreTimeScale=null,this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,r,i){if(!this.enabled)return void this._updateWeight(t);let n=this._startTime;if(null!==n){let i=(t-n)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);let s=this._updateTime(e),o=this._updateWeight(t);if(o>0){let t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(o);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let r=this._weightInterpolant;if(null!==r){let i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(0===e?this.paused=!0:(null!==this._restoreTimeScale&&(e=this._restoreTimeScale),this.timeScale=e),this.stopWarping()))}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,r=this.loop,i=this.time+t,n=this._loopCount,s=2202===r;if(0===t)return -1===n?i:s&&(1&n)==1?e-i:i;if(2200===r){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));n:{if(i>=e)i=e;else if(i<0)i=0;else{this.time=i;break n}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){let r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);let o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){let e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this._loopCount=n,this.time=i;if(s&&(1&n)==1)return e-i}return i}_setEndings(t,e,r){let i=this._interpolantSettings;r?(i.endingStart=2401,i.endingEnd=2401):(t?i.endingStart=this.zeroSlopeAtStart?2401:2400:i.endingStart=2402,e?i.endingEnd=this.zeroSlopeAtEnd?2401:2400:i.endingEnd=2402)}_scheduleFading(t,e,r){let i=this._mixer,n=i.time,s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);let o=s.parameterPositions,a=s.sampleValues;return o[0]=n,a[0]=e,o[1]=n+t,a[1]=r,this}}let od=new Float32Array(1),of=0,om=new th;function oy(t,e){return t.distance-e.distance}function og(t,e,r,i){let n=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,r)&&(n=!1),!0===n&&!0===i){let i=t.children;for(let t=0,n=i.length;t<n;t++)og(i[t],e,r,!0)}}class ob{static{ob.prototype.isMatrix2=!0}constructor(t,e,r,i){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let r=0;r<4;r++)this.elements[r]=t[r+e];return this}set(t,e,r,i){let n=this.elements;return n[0]=t,n[2]=e,n[1]=r,n[3]=i,this}}let ov=new F;class ox{constructor(t=new F(Infinity,Infinity),e=new F(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let r=ov.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ov).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}let ow=new j,oS=new j,oM=new j,o_=new j,oA=new j,oT=new j,oC=new j,oE=new j,oR=new j,oO=new th,oI=new th,ok=new j,oP=new tV,oB=new tV,oL=new j,oz=new j,oN=new j,oF=new j,oU=new sT;function oj(t,e,r,i,n,s,o){oF.set(n,s,o).unproject(i);let a=e[t];if(void 0!==a){let t=r.getAttribute("position");for(let e=0,r=a.length;e<r;e++)t.setXYZ(a[e],oF.x,oF.y,oF.z)}}let oD=new t8,oV=new j;function oW(t,e,r,i){let n=function(t){switch(t){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${t}.`)}(i);switch(r){case 1021:return t*e;case 1028:case 1029:return t*e/n.components*n.byteLength;case 1030:case 1031:return t*e*2/n.components*n.byteLength;case 1022:return t*e*3/n.components*n.byteLength;case 1023:case 1033:return t*e*4/n.components*n.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case 35841:case 35843:return Math.max(t,16)*Math.max(e,8)/4;case 35840:case 35842:return Math.max(t,8)*Math.max(e,8)/2;case 37809:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case 37810:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case 37811:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case 37812:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case 37813:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case 37814:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case 37815:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case 37816:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case 37817:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case 37818:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case 37819:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case 37820:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case 37821:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case 36284:return Math.ceil(t/4)*Math.ceil(e/4)*8}throw Error(`Unable to determine texture byte length for ${r} format.`)}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"186"}})),"u">typeof window&&(window.__THREE__?_("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="186"),t.s(["ACESFilmicToneMapping",0,4,"AddEquation",0,100,"AddOperation",0,2,"AdditiveAnimationBlendMode",0,2501,"AdditiveBlending",0,2,"AgXToneMapping",0,6,"AlphaFormat",0,1021,"AlwaysCompare",0,519,"AlwaysDepth",0,1,"AlwaysStencilFunc",0,519,"AmbientLight",0,sF,"AnimationAction",0,op,"AnimationClip",0,so,"AnimationLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=new sf(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),n.manager.itemError(t)}},r,i)}parse(t){let e=[];for(let r=0;r<t.length;r++){let i=so.parse(t[r]);e.push(i)}return e}},"AnimationMixer",0,class extends C{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(t,e){let r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,o=t._interpolants,a=r.uuid,h=this._bindingsByRootAndName,l=h[a];void 0===l&&(l={},h[a]=l);for(let t=0;t!==n;++t){let n=i[t],h=n.name,u=l[h];if(void 0!==u)++u.referenceCount,s[t]=u;else{if(void 0!==(u=s[t])){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,h));continue}let i=e&&e._propertyBindings[t].binding.parsedPath;u=new on(oc.create(r,h,i),n.ValueTypeName,n.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,h),s[t]=u}o[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,r){let i=this._actions,n=this._actionsByClip,s=n[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=s;else{let e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),s.actionByRoot[r]=t}_removeInactiveAction(t){let e=this._actions,r=e[e.length-1],i=t._cacheIndex;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=null;let n=t._clip.uuid,s=this._actionsByClip,o=s[n],a=o.knownActions,h=a[a.length-1],l=t._byClipCacheIndex;h._byClipCacheIndex=l,a[l]=h,a.pop(),t._byClipCacheIndex=null;let u=o.actionByRoot,c=(t._localRoot||this._root).uuid;delete u[c],0===a.length&&delete s[n],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(t){let e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_takeBackAction(t){let e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_addInactiveBinding(t,e,r){let i=this._bindingsByRootAndName,n=this._bindings,s=i[e];void 0===s&&(s={},i[e]=s),s[r]=t,t._cacheIndex=n.length,n.push(t)}_removeInactiveBinding(t){let e=this._bindings,r=t.binding,i=r.rootNode.uuid,n=r.path,s=this._bindingsByRootAndName,o=s[i],a=e[e.length-1],h=t._cacheIndex;a._cacheIndex=h,e[h]=a,e.pop(),delete o[n],0===Object.keys(o).length&&delete s[i]}_lendBinding(t){let e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_takeBackBinding(t){let e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_lendControlInterpolant(){let t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&((r=new n3(new Float32Array(2),new Float32Array(2),1,od)).__cacheIndex=e,t[e]=r),r}_takeBackControlInterpolant(t){let e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];t.__cacheIndex=i,e[i]=t,n.__cacheIndex=r,e[r]=n}clipAction(t,e,r){let i=e||this._root,n=i.uuid,s="string"==typeof t?so.findByName(i,t):t,o=null!==s?s.uuid:t,a=this._actionsByClip[o],h=null;if(void 0===r&&(r=null!==s?s.blendMode:2500),void 0!==a){let t=a.actionByRoot[n];if(void 0!==t&&t.blendMode===r)return t;h=a.knownActions[0],null===s&&(s=h._clip)}if(null===s)return null;let l=new op(this,s,e,r);return this._bindAction(l,h),this._addInactiveAction(l,o,n),l}existingAction(t,e){let r=e||this._root,i=r.uuid,n="string"==typeof t?so.findByName(r,t):t,s=n?n.uuid:t,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[i]||null}stopAllAction(){let t=this._actions,e=this._nActiveActions;for(let r=e-1;r>=0;--r)t[r].stop();return this}update(t){t*=this.timeScale;let e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==r;++o)e[o]._update(i,t,n,s);let o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let e=this._actions,r=t.uuid,i=this._actionsByClip,n=i[r];if(void 0!==n){let t=n.knownActions;for(let r=0,i=t.length;r!==i;++r){let i=t[r];this._deactivateAction(i);let n=i._cacheIndex,s=e[e.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,s._cacheIndex=n,e[n]=s,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[r]}}uncacheRoot(t){let e=t.uuid,r=this._actionsByClip;for(let t in r){let i=r[t].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}let i=this._bindingsByRootAndName[e];if(void 0!==i)for(let t in i){let e=i[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){let r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}},"AnimationObjectGroup",0,class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=k(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,r=arguments.length;e!==r;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){let t=this._objects,e=this._indicesByUUID,r=this._paths,i=this._parsedPaths,n=this._bindings,s=n.length,o,a=t.length,h=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){let u=arguments[l],c=u.uuid,p=e[c];if(void 0===p){p=a++,e[c]=p,t.push(u);for(let t=0;t!==s;++t)n[t].push(new oc(u,r[t],i[t]))}else if(p<h){o=t[p];let a=--h,l=t[a];e[l.uuid]=p,t[p]=l,e[c]=a,t[a]=u;for(let t=0;t!==s;++t){let e=n[t],s=e[a],o=e[p];e[p]=s,void 0===o&&(o=new oc(u,r[t],i[t])),e[a]=o}}else t[p]!==o&&A("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){let t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length,n=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s],a=o.uuid,h=e[a];if(void 0!==h&&h>=n){let s=n++,l=t[s];e[l.uuid]=h,t[h]=l,e[a]=s,t[s]=o;for(let t=0;t!==i;++t){let e=r[t],i=e[s],n=e[h];e[h]=i,e[s]=n}}}this.nCachedObjects_=n}uncache(){let t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length,n=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){let a=arguments[o],h=a.uuid,l=e[h];if(void 0!==l)if(delete e[h],l<n){let o=--n,a=t[o],h=--s,u=t[h];l!==o&&(e[a.uuid]=l),t[l]=a,o!==h&&(e[u.uuid]=o),t[o]=u,t.pop();for(let t=0;t!==i;++t){let e=r[t],i=e[o],n=e[h];e[l]=i,e[o]=n,e.pop()}}else{let n=--s,o=t[n];l!==n&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0;t!==i;++t){let e=r[t];e[l]=e[n],e.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){let r=this._bindingsIndicesByPath,i=r[t],n=this._bindings;if(void 0!==i)return n[i];let s=this._paths,o=this._parsedPaths,a=this._objects,h=a.length,l=this.nCachedObjects_,u=Array(h);i=n.length,r[t]=i,s.push(t),o.push(e),n.push(u);for(let r=l,i=a.length;r!==i;++r){let i=a[r];u[r]=new oc(i,t,e)}return u}unsubscribe_(t){let e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){let t=this._paths,i=this._parsedPaths,n=this._bindings,s=n.length-1,o=n[s];e[t[s]]=r,n[r]=o,n.pop(),i[r]=i[s],i.pop(),t[r]=t[s],t.pop()}}},"AnimationUtils",0,class{static convertArray(t,e){return nX(t,e)}static isTypedArray(t){return b(t)}static hasTangents(t){return nZ(t)}static getKeyframeOrder(t){return nK(t)}static sortedArray(t,e,r){return nQ(t,e,r)}static flattenJSON(t,e,r,i){n0(t,e,r,i)}static subclip(t,e,r,i,n=30){return function(t,e,r,i,n=30){let s=t.clone();s.name=e;let o=[];for(let t=0;t<s.tracks.length;++t){let e=s.tracks[t],a=e.getValueSize(),h=[],l=[];for(let t=0;t<e.times.length;++t){let s=e.times[t]*n;if(!(s<r)&&!(s>=i)){h.push(e.times[t]);for(let r=0;r<a;++r)l.push(e.values[t*a+r])}}0!==h.length&&(e.times=nX(h,e.times.constructor),e.values=nX(l,e.values.constructor),o.push(e))}s.tracks=o;let a=1/0;for(let t=0;t<s.tracks.length;++t)a>s.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t<s.tracks.length;++t)s.tracks[t].shift(-1*a);return s.resetDuration(),s}(t,e,r,i,n)}static makeClipAdditive(t,e=0,r=t,i=30){return function(t,e=0,r=t,i=30){i<=0&&(i=30);let n=r.tracks.length,s=e/i;for(let e=0;e<n;++e){let i,n=r.tracks[e],o=n.ValueTypeName;if("bool"===o||"string"===o)continue;let a=t.tracks.find(function(t){return t.name===n.name&&t.ValueTypeName===o});if(void 0===a)continue;let h=0,l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=l/3);let u=0,c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=c/3);let p=n.times.length-1;if(s<=n.times[0]){let t=h,e=l-h;i=n.values.slice(t,e)}else if(s>=n.times[p]){let t=p*l+h,e=t+l-h;i=n.values.slice(t,e)}else{let t=n.createInterpolant(),e=h,r=l-h;t.evaluate(s),i=t.resultBuffer.slice(e,r)}"quaternion"===o&&new U().fromArray(i).normalize().conjugate().toArray(i);let d=a.times.length;for(let t=0;t<d;++t){let e=t*c+u;if("quaternion"===o)U.multiplyQuaternionsFlat(a.values,e,i,0,a.values,e);else{let t=c-2*u;for(let r=0;r<t;++r)a.values[e+r]-=i[r]}}}return t.blendMode=2501,t}(t,e,r,i)}},"ArcCurve",0,ij,"ArrayCamera",0,class extends sO{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}},"ArrowHelper",0,class extends tL{constructor(t=new j(0,0,1),e=new j(0,0,0),r=1,i=0xffff00,o=.2*r,a=.2*o){super(),this.type="ArrowHelper",void 0===n&&((n=new eP).setAttribute("position",new ew([0,0,0,0,1,0],3)),(s=new iO(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ih(n,new r7({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new rf(s,new rr({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(r,o,a)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{oV.set(t.z,0,-t.x).normalize();let e=Math.acos(t.y);this.quaternion.setFromAxisAngle(oV,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){super.dispose(),this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},"AttachedBindMode",0,u,"Audio",0,s7,"AudioAnalyser",0,class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0,e=this.getFrequencyData();for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}},"AudioContext",0,sK,"AudioListener",0,class extends tL{constructor(){super(),this.type="AudioListener",this.context=sK.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new s2}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t),this._timer.update();let e=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(s5,s4,s6),s8.set(0,0,-1).applyQuaternion(s4),s9.set(0,1,0).applyQuaternion(s4),e.positionX){let t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(s5.x,t),e.positionY.linearRampToValueAtTime(s5.y,t),e.positionZ.linearRampToValueAtTime(s5.z,t),e.forwardX.linearRampToValueAtTime(s8.x,t),e.forwardY.linearRampToValueAtTime(s8.y,t),e.forwardZ.linearRampToValueAtTime(s8.z,t),e.upX.linearRampToValueAtTime(s9.x,t),e.upY.linearRampToValueAtTime(s9.y,t),e.upZ.linearRampToValueAtTime(s9.z,t)}else e.setPosition(s5.x,s5.y,s5.z),e.setOrientation(s8.x,s8.y,s8.z,s9.x,s9.y,s9.z)}},"AudioLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=new sf(this.manager);function o(e){i?i(e):A(e),n.manager.itemError(t)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(r){try{let i=r.slice(0),s=sK.getContext(),a=t+"#decode";n.manager.itemStart(a),s.decodeAudioData(i,function(t){e(t),n.manager.itemEnd(a)}).catch(function(t){o(t),n.manager.itemEnd(a)})}catch(t){o(t)}},r,i)}},"AxesHelper",0,class extends ip{constructor(t=1){const e=new eP;e.setAttribute("position",new ew([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],3)),e.setAttribute("color",new ew([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(e,new r7({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){let i=new tV,n=this.geometry.attributes.color.array;return i.set(t),i.toArray(n,0),i.toArray(n,3),i.set(e),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BackSide",0,1,"BasicDepthPacking",0,3200,"BasicShadowMap",0,0,"BatchedMesh",0,r9,"BezierInterpolant",0,n4,"Bone",0,rT,"BooleanKeyframeTrack",0,n7,"Box2",0,ox,"Box3",0,t8,"Box3Helper",0,class extends ip{constructor(t,e=0xffff00){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new eP;i.setIndex(new eb(r,1)),i.setAttribute("position",new ew([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new r7({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BoxGeometry",0,iT,"BoxHelper",0,class extends ip{constructor(t,e=0xffff00){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),n=new eP;n.setIndex(new eb(r,1)),n.setAttribute("position",new eb(i,3)),super(n,new r7({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(void 0!==this.object&&oD.setFromObject(this.object),oD.isEmpty())return;let t=oD.min,e=oD.max,r=this.geometry.attributes.position,i=r.array;i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=t.x,i[4]=e.y,i[5]=e.z,i[6]=t.x,i[7]=t.y,i[8]=e.z,i[9]=e.x,i[10]=t.y,i[11]=e.z,i[12]=e.x,i[13]=e.y,i[14]=t.z,i[15]=t.x,i[16]=e.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=e.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BufferAttribute",0,eb,"BufferGeometry",0,eP,"BufferGeometryLoader",0,sH,"ByteType",0,1010,"Cache",0,sa,"Camera",0,sT,"CameraHelper",0,class extends ip{constructor(t){const e=new eP,r=new r7({color:0xffffff,vertexColors:!0,toneMapped:!1}),i=[],n=[],s={};function o(t,e){a(t),a(e)}function a(t){i.push(0,0,0),n.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(i.length/3-1)}o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4"),e.setAttribute("position",new ew(i,3)),e.setAttribute("color",new ew(n,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const h=new tV(0xffaa00),l=new tV(0xff0000),u=new tV(43775),c=new tV(0xffffff),p=new tV(3355443);this.setColors(h,l,u,c,p)}setColors(t,e,r,i,n){let s=this.geometry.getAttribute("color");return s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,r.r,r.g,r.b),s.setXYZ(33,r.r,r.g,r.b),s.setXYZ(34,r.r,r.g,r.b),s.setXYZ(35,r.r,r.g,r.b),s.setXYZ(36,r.r,r.g,r.b),s.setXYZ(37,r.r,r.g,r.b),s.setXYZ(38,i.r,i.g,i.b),s.setXYZ(39,i.r,i.g,i.b),s.setXYZ(40,n.r,n.g,n.b),s.setXYZ(41,n.r,n.g,n.b),s.setXYZ(42,n.r,n.g,n.b),s.setXYZ(43,n.r,n.g,n.b),s.setXYZ(44,n.r,n.g,n.b),s.setXYZ(45,n.r,n.g,n.b),s.setXYZ(46,n.r,n.g,n.b),s.setXYZ(47,n.r,n.g,n.b),s.setXYZ(48,n.r,n.g,n.b),s.setXYZ(49,n.r,n.g,n.b),s.needsUpdate=!0,this}update(){let t,e,r=this.geometry,i=this.pointMap;if(oU.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)t=1,e=0;else if(2e3===this.camera.coordinateSystem)t=-1,e=1;else if(2001===this.camera.coordinateSystem)t=0,e=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);oj("c",i,r,oU,0,0,t),oj("t",i,r,oU,0,0,e),oj("n1",i,r,oU,-1,-1,t),oj("n2",i,r,oU,1,-1,t),oj("n3",i,r,oU,-1,1,t),oj("n4",i,r,oU,1,1,t),oj("f1",i,r,oU,-1,-1,e),oj("f2",i,r,oU,1,-1,e),oj("f3",i,r,oU,-1,1,e),oj("f4",i,r,oU,1,1,e),oj("u1",i,r,oU,.7,1.1,t),oj("u2",i,r,oU,-.7,1.1,t),oj("u3",i,r,oU,0,2,t),oj("cf1",i,r,oU,-1,0,e),oj("cf2",i,r,oU,1,0,e),oj("cf3",i,r,oU,0,-1,e),oj("cf4",i,r,oU,0,1,e),oj("cn1",i,r,oU,-1,0,t),oj("cn2",i,r,oU,1,0,t),oj("cn3",i,r,oU,0,-1,t),oj("cn4",i,r,oU,0,1,t),r.getAttribute("position").needsUpdate=!0}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"CanvasTexture",0,class extends tr{constructor(t,e,r,i,n,s,o,a,h){super(t,e,r,i,n,s,o,a,h),this.isCanvasTexture=!0,this.needsUpdate=!0}},"CapsuleGeometry",0,iC,"CatmullRomCurve3",0,i$,"CineonToneMapping",0,3,"CircleGeometry",0,iE,"ClampToEdgeWrapping",0,1001,"Clock",0,class{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,_("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=performance.now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}},"Color",0,tV,"ColorKeyframeTrack",0,st,"ColorManagement",0,$,"Compatibility",0,{TEXTURE_COMPARE:"depthTextureCompare"},"CompressedArrayTexture",0,class extends iM{constructor(t,e,r,i,n,s){super(t,e,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=1001,this.layerUpdates=new Set}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}},"CompressedCubeTexture",0,class extends iM{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}},"CompressedTexture",0,iM,"CompressedTextureLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=[],o=new iM,a=new sf(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(n.withCredentials);let h=0;if(Array.isArray(t))for(let l=0,u=t.length;l<u;++l)!function(l){a.load(t[l],function(t){let r=n.parse(t,!0);s[l]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},6===(h+=1)&&(1===r.mipmapCount&&(o.minFilter=1006),o.image=s,o.format=r.format,o.needsUpdate=!0,e&&e(o))},r,i)}(l);else a.load(t,function(t){let r=n.parse(t,!0);if(r.isCubemap){let t=r.mipmaps.length/r.mipmapCount;for(let e=0;e<t;e++){s[e]={mipmaps:[]};for(let t=0;t<r.mipmapCount;t++)s[e].mipmaps.push(r.mipmaps[e*r.mipmapCount+t]),s[e].format=r.format,s[e].width=r.width,s[e].height=r.height}o.image=s}else o.image.width=r.width,o.image.height=r.height,o.mipmaps=r.mipmaps;1===r.mipmapCount&&(o.minFilter=1006),o.format=r.format,o.needsUpdate=!0,e&&e(o)},r,i);return o}},"ConeGeometry",0,iO,"ConstantAlphaFactor",0,213,"ConstantColorFactor",0,211,"Controls",0,class extends C{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){null!==this.domElement&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}},"CubeCamera",0,class extends tL{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new sO(-90,1,t,e);i.layers=this.layers,this.add(i);const n=new sO(-90,1,t,e);n.layers=this.layers,this.add(n);const s=new sO(-90,1,t,e);s.layers=this.layers,this.add(s);const o=new sO(-90,1,t,e);o.layers=this.layers,this.add(o);const a=new sO(-90,1,t,e);a.layers=this.layers,this.add(a);const h=new sO(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[r,i,n,s,o,a]=e;for(let t of e)this.remove(t);if(2e3===t)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else if(2001===t)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[n,s,o,a,h,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;let f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1;let m=!1;m=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(r,0,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(r,1,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,s),t.setRenderTarget(r,2,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),t.setRenderTarget(r,3,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(r,4,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,r.texture.needsPMREMUpdate=!0}},"CubeDepthTexture",0,class extends iA{constructor(t,e=1014,r=301,i,n,s=1003,o=1003,a,h=1026){const l={width:t,height:t,depth:1};super(t,t,e,r,i,n,s,o,a,h),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}},"CubeReflectionMapping",0,301,"CubeRefractionMapping",0,302,"CubeTexture",0,i_,"CubeTextureLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=new i_;n.colorSpace=p;let s=new sy(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;for(let r=0;r<t.length;++r)!function(r){s.load(t[r],function(t){n.images[r]=t,6==++o&&(n.needsUpdate=!0,e&&e(n))},void 0,i)}(r);return n}},"CubeUVReflectionMapping",0,306,"CubicBezierCurve",0,iZ,"CubicBezierCurve3",0,iK,"CubicInterpolant",0,n2,"CullFaceBack",0,1,"CullFaceFront",0,2,"CullFaceFrontBack",0,3,"CullFaceNone",0,0,"Curve",0,iF,"CurvePath",0,i4,"CustomBlending",0,5,"CustomToneMapping",0,5,"CylinderGeometry",0,iR,"Cylindrical",0,class{constructor(t=1,e=0,r=0){this.radius=t,this.theta=e,this.y=r}set(t,e,r){return this.radius=t,this.theta=e,this.y=r,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,r){return this.radius=Math.sqrt(t*t+r*r),this.theta=Math.atan2(t,r),this.y=e,this}clone(){return new this.constructor().copy(this)}},"Data3DTexture",0,ta,"DataArrayTexture",0,to,"DataTexture",0,rC,"DataTextureLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=new rC,o=new sf(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(n.withCredentials),o.load(t,function(t){let r;try{r=n.parse(t)}catch(t){void 0!==i?i(t):A(t);return}n._applyTexData(s,r),e&&e(s,r)},r,i),s}createDataTexture(t){let e=new rC;return this._applyTexData(e,this.parse(t)),e}_applyTexData(t,e){void 0!==e.image?t.image=e.image:void 0!==e.data&&(t.image.width=e.width,t.image.height=e.height,t.image.data=e.data),t.wrapS=void 0!==e.wrapS?e.wrapS:1001,t.wrapT=void 0!==e.wrapT?e.wrapT:1001,t.magFilter=void 0!==e.magFilter?e.magFilter:1006,t.minFilter=void 0!==e.minFilter?e.minFilter:1006,t.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.mipmaps&&(t.mipmaps=e.mipmaps,t.minFilter=1008),1===e.mipmapCount&&(t.minFilter=1006),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),t.needsUpdate=!0}},"DataUtils",0,class{static toHalfFloat(t){return ed(t)}static fromHalfFloat(t){return ef(t)}},"DecrementStencilOp",0,7683,"DecrementWrapStencilOp",0,34056,"DefaultLoadingManager",0,su,"DepthFormat",0,1026,"DepthStencilFormat",0,1027,"DepthTexture",0,iA,"DetachedBindMode",0,c,"DirectionalLight",0,sN,"DirectionalLightHelper",0,class extends tL{constructor(t,e,r){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",void 0===e&&(e=1);let i=new eP;i.setAttribute("position",new ew([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const n=new r7({fog:!1,toneMapped:!1});this.lightPlane=new ih(i,n),this.add(this.lightPlane),(i=new eP).setAttribute("position",new ew([0,0,0,0,0,1],3)),this.targetLine=new ih(i,n),this.add(this.targetLine),this.update()}dispose(){super.dispose(),this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),oL.setFromMatrixPosition(this.light.matrixWorld),oz.setFromMatrixPosition(this.light.target.matrixWorld),oN.subVectors(oz,oL),this.lightPlane.lookAt(oz),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(oz),this.targetLine.scale.z=oN.length()}},"DiscreteInterpolant",0,n5,"DodecahedronGeometry",0,ik,"DoubleSide",0,2,"DstAlphaFactor",0,206,"DstColorFactor",0,208,"DynamicCopyUsage",0,35050,"DynamicDrawUsage",0,35048,"DynamicReadUsage",0,35049,"EdgesGeometry",0,iN,"EllipseCurve",0,iU,"EqualCompare",0,514,"EqualDepth",0,4,"EqualStencilFunc",0,514,"EquirectangularReflectionMapping",0,303,"EquirectangularRefractionMapping",0,304,"Euler",0,tb,"EventDispatcher",0,C,"ExternalTexture",0,class extends tr{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}},"ExtrudeGeometry",0,nb,"FileLoader",0,sf,"Float16BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint16Array(t),e,r),this.isFloat16BufferAttribute=!0}getX(t){let e=ef(this.array[t*this.itemSize]);return this.normalized&&(e=z(e,this.array)),e}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize]=ed(e),this}getY(t){let e=ef(this.array[t*this.itemSize+1]);return this.normalized&&(e=z(e,this.array)),e}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+1]=ed(e),this}getZ(t){let e=ef(this.array[t*this.itemSize+2]);return this.normalized&&(e=z(e,this.array)),e}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+2]=ed(e),this}getW(t){let e=ef(this.array[t*this.itemSize+3]);return this.normalized&&(e=z(e,this.array)),e}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+3]=ed(e),this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.array[t+0]=ed(e),this.array[t+1]=ed(r),this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.array[t+0]=ed(e),this.array[t+1]=ed(r),this.array[t+2]=ed(i),this}setXYZW(t,e,r,i,n){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),n=N(n,this.array)),this.array[t+0]=ed(e),this.array[t+1]=ed(r),this.array[t+2]=ed(i),this.array[t+3]=ed(n),this}},"Float32BufferAttribute",0,ew,"FloatType",0,1015,"Fog",0,tG,"FogExp2",0,tq,"FramebufferTexture",0,class extends tr{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}},"FrontSide",0,0,"Frustum",0,rW,"FrustumArray",0,rG,"GLBufferAttribute",0,class{constructor(t,e,r,i,n,s=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=t,this.type=e,this.itemSize=r,this.elementSize=i,this.count=n,this.normalized=s,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}},"GLSL1",0,"100","GLSL3",0,"300 es","GreaterCompare",0,516,"GreaterDepth",0,6,"GreaterEqualCompare",0,518,"GreaterEqualDepth",0,5,"GreaterEqualStencilFunc",0,518,"GreaterStencilFunc",0,516,"GridHelper",0,class extends ip{constructor(t=10,e=10,r=4473924,i=8947848){r=new tV(r),i=new tV(i);const n=e/2,s=t/e,o=t/2,a=[],h=[];for(let t=0,l=0,u=-o;t<=e;t++,u+=s){a.push(-o,0,u,o,0,u),a.push(u,0,-o,u,0,o);const e=t===n?r:i;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new eP;l.setAttribute("position",new ew(a,3)),l.setAttribute("color",new ew(h,3)),super(l,new r7({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"Group",0,tz,"HTMLTexture",0,class extends tr{constructor(t,e,r,i,n,s,o,a,h){super(t,e,r,i,n,s,o,a,h),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const l=t?t.parentNode:null;null!==l&&"requestPaint"in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let t=this.image?this.image.parentNode:null;null!==t&&"onpaint"in t&&(t.onpaint=null),super.dispose()}},"HalfFloatType",0,1016,"HemisphereLight",0,sb,"HemisphereLightHelper",0,class extends tL{constructor(t,e,r){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new nS(e);i.rotateY(.5*Math.PI),this.material=new rr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const n=new Float32Array(3*i.getAttribute("position").count);i.setAttribute("color",new eb(n,3)),this.add(new rf(i,this.material)),this.update()}dispose(){super.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let e=t.geometry.getAttribute("color");oP.copy(this.light.color),oB.copy(this.light.groundColor);for(let t=0,r=e.count;t<r;t++){let i=t<r/2?oP:oB;e.setXYZ(t,i.r,i.g,i.b)}e.needsUpdate=!0}this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),t.lookAt(ok.setFromMatrixPosition(this.light.matrixWorld).negate())}},"IcosahedronGeometry",0,nx,"ImageBitmapLoader",0,class extends sc{constructor(t){super(t),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&_("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&_("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(t){return this.options=t,this}load(t,e,r,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let n=this,s=sa.get(`image-bitmap:${t}`);if(void 0!==s)return(n.manager.itemStart(t),s.then)?void s.then(r=>{!0===sZ.has(s)?(i&&i(sZ.get(s)),n.manager.itemError(t)):e&&e(r),n.manager.itemEnd(t)}):void setTimeout(function(){e&&e(s),n.manager.itemEnd(t)},0);let o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,o.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let a=fetch(t,o).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign({},n.options,{colorSpaceConversion:"none"}))}).then(function(r){return sa.add(`image-bitmap:${t}`,r),e&&e(r),n.manager.itemEnd(t),r}).catch(function(e){i&&i(e),sZ.set(a,e),sa.remove(`image-bitmap:${t}`),n.manager.itemError(t),n.manager.itemEnd(t)});sa.add(`image-bitmap:${t}`,a),n.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},"ImageLoader",0,sy,"ImageUtils",0,X,"IncrementStencilOp",0,7682,"IncrementWrapStencilOp",0,34055,"InstancedBufferAttribute",0,rI,"InstancedBufferGeometry",0,sG,"InstancedInterleavedBuffer",0,class extends eB{constructor(t,e,r=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},"InstancedMesh",0,rU,"Int16BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int16Array(t),e,r)}},"Int32BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int32Array(t),e,r)}},"Int8BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int8Array(t),e,r)}},"IntType",0,1013,"InterleavedBuffer",0,eB,"InterleavedBufferAttribute",0,ez,"Interpolant",0,n1,"InterpolateBezier",0,2303,"InterpolateDiscrete",0,2300,"InterpolateLinear",0,2301,"InterpolateSmooth",0,2302,"InterpolationSamplingMode",0,{NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},"InterpolationSamplingType",0,{PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},"InvertStencilOp",0,5386,"KeepStencilOp",0,7680,"KeyframeTrack",0,n8,"LOD",0,e6,"LatheGeometry",0,nw,"Layers",0,tv,"LessCompare",0,513,"LessDepth",0,2,"LessEqualCompare",0,515,"LessEqualDepth",0,3,"LessEqualStencilFunc",0,515,"LessStencilFunc",0,513,"Light",0,sg,"LightProbe",0,sD,"LightShadow",0,sS,"Line",0,ih,"Line3",0,class{constructor(t=new j,e=new j){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){ow.subVectors(t,this.start),oS.subVectors(this.end,this.start);let r=oS.dot(oS);if(0===r)return 0;let i=oS.dot(ow)/r;return e&&(i=P(i,0,1)),i}closestPointToPoint(t,e,r){let i=this.closestPointToPointParameter(t,e);return this.delta(r).multiplyScalar(i).add(this.start)}distanceSqToLine3(t,e=oT,r=oC){let i,n,s=1e-8*1e-8,o=this.start,a=t.start,h=this.end,l=t.end;oM.subVectors(h,o),o_.subVectors(l,a),oA.subVectors(o,a);let u=oM.dot(oM),c=o_.dot(o_),p=o_.dot(oA);if(u<=s&&c<=s)return e.copy(o),r.copy(a),e.sub(r),e.dot(e);if(u<=s)i=0,n=P(n=p/c,0,1);else{let t=oM.dot(oA);if(c<=s)n=0,i=P(-t/u,0,1);else{let e=oM.dot(o_),r=u*c-e*e;i=0!==r?P((e*p-t*c)/r,0,1):0,(n=(e*i+p)/c)<0?(n=0,i=P(-t/u,0,1)):n>1&&(n=1,i=P((e-t)/u,0,1))}}return e.copy(o).addScaledVector(oM,i),r.copy(a).addScaledVector(o_,n),e.distanceToSquared(r)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},"LineBasicMaterial",0,r7,"LineCurve",0,iQ,"LineCurve3",0,i0,"LineDashedMaterial",0,nY,"LineLoop",0,id,"LineSegments",0,ip,"LinearFilter",0,1006,"LinearInterpolant",0,n3,"LinearMipMapLinearFilter",0,1008,"LinearMipMapNearestFilter",0,1007,"LinearMipmapLinearFilter",0,1008,"LinearMipmapNearestFilter",0,1007,"LinearSRGBColorSpace",0,d,"LinearToneMapping",0,1,"LinearTransfer",0,f,"Loader",0,sc,"LoaderUtils",0,sq,"LoadingManager",0,sl,"LoopOnce",0,2200,"LoopPingPong",0,2202,"LoopRepeat",0,2201,"MOUSE",0,{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},"Material",0,eV,"MaterialBlending",0,6,"MaterialLoader",0,sW,"MathUtils",0,{DEG2RAD:O,RAD2DEG:I,generateUUID:k,clamp:P,euclideanModulo:B,mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:L,damp:function(t,e,r,i){return L(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(B(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(R=t);let e=R+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*O},radToDeg:function(t){return t*I},isPowerOfTwo:function(t){return t>0&&Number.isInteger(t)&&2**Math.round(Math.log2(t))===t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,r,i,n){let s=Math.cos,o=Math.sin,a=s(r/2),h=o(r/2),l=s((e+i)/2),u=o((e+i)/2),c=s((e-i)/2),p=o((e-i)/2),d=s((i-e)/2),f=o((i-e)/2);switch(n){case"XYX":t.set(a*u,h*c,h*p,a*l);break;case"YZY":t.set(h*p,a*u,h*c,a*l);break;case"ZXZ":t.set(h*c,h*p,a*u,a*l);break;case"XZX":t.set(a*u,h*f,h*d,a*l);break;case"YXY":t.set(h*d,a*u,h*f,a*l);break;case"ZYZ":t.set(h*f,h*d,a*u,a*l);break;default:_("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:N,denormalize:z},"Matrix2",0,ob,"Matrix3",0,W,"Matrix4",0,th,"MaxEquation",0,104,"Mesh",0,rf,"MeshBasicMaterial",0,rr,"MeshDepthMaterial",0,nH,"MeshDistanceMaterial",0,n$,"MeshLambertMaterial",0,nG,"MeshMatcapMaterial",0,nJ,"MeshNormalMaterial",0,nq,"MeshPhongMaterial",0,nV,"MeshPhysicalMaterial",0,nD,"MeshStandardMaterial",0,nj,"MeshToonMaterial",0,nW,"MinEquation",0,103,"MirroredRepeatWrapping",0,1002,"MixOperation",0,1,"MultiplyBlending",0,4,"MultiplyOperation",0,0,"NearestFilter",0,1003,"NearestMipMapLinearFilter",0,1005,"NearestMipMapNearestFilter",0,1004,"NearestMipmapLinearFilter",0,1005,"NearestMipmapNearestFilter",0,1004,"NeutralToneMapping",0,7,"NeverCompare",0,512,"NeverDepth",0,0,"NeverStencilFunc",0,512,"NoBlending",0,0,"NoColorSpace",0,"","NoNormalPacking",0,"","NoToneMapping",0,0,"NormalAnimationBlendMode",0,2500,"NormalBlending",0,1,"NormalGAPacking",0,"ga","NormalRGPacking",0,"rg","NotEqualCompare",0,517,"NotEqualDepth",0,7,"NotEqualStencilFunc",0,517,"NumberKeyframeTrack",0,se,"Object3D",0,tL,"ObjectLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=this,s=""===this.path?sq.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;let o=new sf(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(r){let s=null;try{s=JSON.parse(r)}catch(e){void 0!==i&&i(e),A("ObjectLoader: Can't parse "+t+".",e.message);return}let o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase()){void 0!==i&&i(Error("THREE.ObjectLoader: Can't load "+t)),A("ObjectLoader: Can't load "+t);return}n.parse(s,e)},r,i)}async loadAsync(t,e){let r,i=""===this.path?sq.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;let n=new sf(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);let s=await n.loadAsync(t,e);try{r=JSON.parse(s)}catch(e){throw Error("THREE.ObjectLoader: Can't parse "+t+". "+e.message)}let o=r.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(r)}parse(t,e){let r=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),n=this.parseGeometries(t.geometries,i),s=this.parseImages(t.images,function(){void 0!==e&&e(h)}),o=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,o),h=this.parseObject(t.object,n,a,o,r),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),this.bindLightTargets(h),void 0!==e){let t=!1;for(let e in s)if(s[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}async parseAsync(t){let e=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),i=this.parseGeometries(t.geometries,r),n=await this.parseImagesAsync(t.images),s=this.parseTextures(t.textures,n),o=this.parseMaterials(t.materials,s),a=this.parseObject(t.object,i,o,s,e),h=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,h),this.bindLightTargets(a),a}static registerGeometry(t,e){s$[t]=e}parseShapes(t){let e={};if(void 0!==t)for(let r=0,i=t.length;r<i;r++){let i=new i8().fromJSON(t[r]);e[i.uuid]=i}return e}parseSkeletons(t,e){let r={},i={};if(e.traverse(function(t){t.isBone&&(i[t.uuid]=t)}),void 0!==t)for(let e=0,n=t.length;e<n;e++){let n=new rO().fromJSON(t[e],i);r[n.uuid]=n}return r}parseGeometries(t,e){let r={};if(void 0!==t){let i=new sH;for(let n=0,s=t.length;n<s;n++){let s,o=t[n];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=i.parse(o);break;default:o.type in nP?s=nP[o.type].fromJSON(o,e):o.type in s$?s=s$[o.type].fromJSON(o,e):_(`ObjectLoader: Unknown geometry type "${o.type}". Use .registerGeometry() before starting the deserialization process.`)}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.userData&&(s.userData=o.userData),r[o.uuid]=s}}return r}parseMaterials(t,e){let r={},i={};if(void 0!==t){let n=new sW;n.setTextures(e);for(let e=0,s=t.length;e<s;e++){let s=t[e];void 0===r[s.uuid]&&(r[s.uuid]=n.parse(s)),i[s.uuid]=r[s.uuid]}}return i}parseAnimations(t){let e={};if(void 0!==t)for(let r=0;r<t.length;r++){let i=t[r],n=so.parse(i);e[n.uuid]=n}return e}parseImages(t,e){let r,i=this,n={};function s(t){if("string"==typeof t){var e;return e=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:i.resourcePath+t,e=i.manager.resolveURL(e),i.manager.itemStart(e),r.load(e,function(){i.manager.itemEnd(e)},void 0,function(){i.manager.itemError(e),i.manager.itemEnd(e)})}return t.data?{data:g(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(r=new sy(new sl(e))).setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){let r=t[e],i=r.url;if(Array.isArray(i)){let t=[];for(let e=0,r=i.length;e<r;e++){let r=s(i[e]);null!==r&&(r instanceof HTMLImageElement?t.push(r):t.push(new rC(r.data,r.width,r.height)))}n[r.uuid]=new K(t)}else{let t=s(r.url);n[r.uuid]=new K(t)}}}return n}async parseImagesAsync(t){let e,r=this,i={};async function n(t){if("string"==typeof t){let i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t;return await e.loadAsync(i)}return t.data?{data:g(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(e=new sy(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){let r=t[e],s=r.url;if(Array.isArray(s)){let t=[];for(let e=0,r=s.length;e<r;e++){let r=s[e],i=await n(r);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new rC(i.data,i.width,i.height)))}i[r.uuid]=new K(t)}else{let t=await n(r.url);i[r.uuid]=new K(t)}}}return i}parseTextures(t,e){function r(t,e){return"number"==typeof t?t:(_("ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}let i={};if(void 0!==t)for(let n=0,s=t.length;n<s;n++){let s,o=t[n];void 0===o.image&&_('ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&_("ObjectLoader: Undefined image",o.image);let a=e[o.image],h=a.data;Array.isArray(h)?(s=new i_,6===h.length&&(s.needsUpdate=!0)):(s=h&&h.data?new rC:new tr,h&&(s.needsUpdate=!0)),s.source=a,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=r(o.mapping,sJ)),void 0!==o.channel&&(s.channel=o.channel),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=r(o.wrap[0],sY),s.wrapT=r(o.wrap[1],sY)),void 0!==o.format&&(s.format=o.format),void 0!==o.internalFormat&&(s.internalFormat=o.internalFormat),void 0!==o.type&&(s.type=o.type),void 0!==o.colorSpace&&(s.colorSpace=o.colorSpace),void 0!==o.minFilter&&(s.minFilter=r(o.minFilter,sX)),void 0!==o.magFilter&&(s.magFilter=r(o.magFilter,sX)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.generateMipmaps&&(s.generateMipmaps=o.generateMipmaps),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),void 0!==o.compareFunction&&(s.compareFunction=o.compareFunction),void 0!==o.normalized&&(s.normalized=o.normalized),void 0!==o.userData&&(s.userData=o.userData),i[o.uuid]=s}return i}parseObject(t,e,r,i,n){let s,o,a;function h(t){return void 0===e[t]&&_("ObjectLoader: Undefined geometry",t),e[t]}function l(t){if(void 0!==t){if(Array.isArray(t)){let e=[];for(let i=0,n=t.length;i<n;i++){let n=t[i];void 0===r[n]&&_("ObjectLoader: Undefined material",n),e.push(r[n])}return e}return void 0===r[t]&&_("ObjectLoader: Undefined material",t),r[t]}}function u(t){return void 0===i[t]&&_("ObjectLoader: Undefined texture",t),i[t]}switch(t.type){case"Scene":s=new tH,void 0!==t.background&&(Number.isInteger(t.background)?s.background=new tV(t.background):s.background=u(t.background)),void 0!==t.environment&&(s.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?s.fog=new tG(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(s.fog=new tq(t.fog.color,t.fog.density)),""!==t.fog.name&&(s.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(s.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(s.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&s.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentIntensity&&(s.environmentIntensity=t.environmentIntensity),void 0!==t.environmentRotation&&s.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":s=new sO(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new sL(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new sF(t.color,t.intensity);break;case"DirectionalLight":(s=new sN(t.color,t.intensity)).target=t.target||"";break;case"PointLight":s=new sB(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new sU(t.color,t.intensity,t.width,t.height);break;case"SpotLight":(s=new sk(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay)).target=t.target||"";break;case"HemisphereLight":s=new sb(t.color,t.groundColor,t.intensity);break;case"LightProbe":s=new sD(new sj().fromArray(t.sh),t.intensity);break;case"SkinnedMesh":s=new rA(o=h(t.geometry),a=l(t.material)),void 0!==t.bindMode&&(s.bindMode=t.bindMode),void 0!==t.bindMatrix&&s.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(s.skeleton=t.skeleton);break;case"Mesh":s=new rf(o=h(t.geometry),a=l(t.material));break;case"InstancedMesh":o=h(t.geometry),a=l(t.material);let c=t.count,p=t.instanceMatrix,d=t.instanceColor;(s=new rU(o,a,c)).instanceMatrix=new rI(new Float32Array(p.array),16),void 0!==d&&(s.instanceColor=new rI(new Float32Array(d.array),d.itemSize));break;case"BatchedMesh":o=h(t.geometry),a=l(t.material),(s=new r9(t.maxInstanceCount,t.maxVertexCount,t.maxIndexCount,a)).geometry=o,s.perObjectFrustumCulled=t.perObjectFrustumCulled,s.sortObjects=t.sortObjects,s._drawRanges=t.drawRanges,s._reservedRanges=t.reservedRanges,s._geometryInfo=t.geometryInfo.map(t=>{let e=null,r=null;return void 0!==t.boundingBox&&(e=new t8().fromJSON(t.boundingBox)),void 0!==t.boundingSphere&&(r=new eA().fromJSON(t.boundingSphere)),{...t,boundingBox:e,boundingSphere:r}}),s._instanceInfo=t.instanceInfo,s._availableInstanceIds=t._availableInstanceIds,s._availableGeometryIds=t._availableGeometryIds,s._nextIndexStart=t.nextIndexStart,s._nextVertexStart=t.nextVertexStart,s._geometryCount=t.geometryCount,s._maxInstanceCount=t.maxInstanceCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._matricesTexture=u(t.matricesTexture.uuid),s._indirectTexture=u(t.indirectTexture.uuid),void 0!==t.colorsTexture&&(s._colorsTexture=u(t.colorsTexture.uuid)),void 0!==t.boundingSphere&&(s.boundingSphere=new eA().fromJSON(t.boundingSphere)),void 0!==t.boundingBox&&(s.boundingBox=new t8().fromJSON(t.boundingBox));break;case"LOD":s=new e6;break;case"Line":s=new ih(h(t.geometry),l(t.material));break;case"LineLoop":s=new id(h(t.geometry),l(t.material));break;case"LineSegments":s=new ip(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":s=new ix(h(t.geometry),l(t.material));break;case"Sprite":s=new e2(l(t.material));break;case"Group":s=new tz;break;case"Bone":s=new rT;break;default:s=new tL}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.up&&s.up.fromArray(t.up),void 0!==t.pivot&&(s.pivot=new j().fromArray(t.pivot)),void 0!==t.morphTargetDictionary&&(s.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),void 0!==t.morphTargetInfluences&&(s.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(s.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.blurSamples&&(s.shadow.blurSamples=t.shadow.blurSamples),void 0!==t.shadow.focus&&(s.shadow.focus=t.shadow.focus),void 0!==t.shadow.aspect&&(s.shadow.aspect=t.shadow.aspect),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.static&&(s.static=t.static),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){let o=t.children;for(let t=0;t<o.length;t++)s.add(this.parseObject(o[t],e,r,i,n))}if(void 0!==t.animations){let e=t.animations;for(let t=0;t<e.length;t++){let r=e[t];s.animations.push(n[r])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(s.autoUpdate=t.autoUpdate);let e=t.levels;for(let t=0;t<e.length;t++){let r=e[t],i=s.getObjectByProperty("uuid",r.object);void 0!==i&&s.addLevel(i,r.distance,r.hysteresis)}}return s}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){let r=e[t.skeleton];void 0===r?_("ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(r,t.bindMatrix)}})}bindLightTargets(t){t.traverse(function(e){if(e.isDirectionalLight||e.isSpotLight){let r=e.target,i=t.getObjectByProperty("uuid",r);void 0!==i?e.target=i:e.target=new tL}})}},"ObjectSpaceNormalMap",0,1,"OctahedronGeometry",0,nS,"OneFactor",0,201,"OneMinusConstantAlphaFactor",0,214,"OneMinusConstantColorFactor",0,212,"OneMinusDstAlphaFactor",0,207,"OneMinusDstColorFactor",0,209,"OneMinusSrcAlphaFactor",0,205,"OneMinusSrcColorFactor",0,203,"OrthographicCamera",0,sL,"PCFShadowMap",0,1,"PCFSoftShadowMap",0,2,"Path",0,i6,"PerspectiveCamera",0,sO,"Plane",0,ej,"PlaneGeometry",0,nM,"PlaneHelper",0,class extends ih{constructor(t,e=1,r=0xffff00){const i=new eP;i.setAttribute("position",new ew([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new r7({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const n=new eP;n.setAttribute("position",new ew([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),n.computeBoundingSphere(),this.add(new rf(n,new rr({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},"PointLight",0,sB,"PointLightHelper",0,class extends rf{constructor(t,e,r){super(new nT(e,4,2),new rr({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},"Points",0,ix,"PointsMaterial",0,im,"PolarGridHelper",0,class extends ip{constructor(t=10,e=16,r=8,i=64,n=4473924,s=8947848){n=new tV(n),s=new tV(s);const o=[],a=[];if(e>1)for(let r=0;r<e;r++){const i=r/e*(2*Math.PI),h=Math.sin(i)*t,l=Math.cos(i)*t;o.push(0,0,0),o.push(h,0,l);const u=1&r?n:s;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let e=0;e<r;e++){const h=1&e?n:s,l=t-t/r*e;for(let t=0;t<i;t++){let e=t/i*(2*Math.PI),r=Math.sin(e)*l,n=Math.cos(e)*l;o.push(r,0,n),a.push(h.r,h.g,h.b),r=Math.sin(e=(t+1)/i*(2*Math.PI))*l,n=Math.cos(e)*l,o.push(r,0,n),a.push(h.r,h.g,h.b)}}const h=new eP;h.setAttribute("position",new ew(o,3)),h.setAttribute("color",new ew(a,3)),super(h,new r7({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"PolyhedronGeometry",0,iI,"PositionalAudio",0,class extends s7{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,r){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=r,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(ot,oe,or),oi.set(0,0,1).applyQuaternion(oe);let e=this.panner;if(e.positionX){let t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(ot.x,t),e.positionY.linearRampToValueAtTime(ot.y,t),e.positionZ.linearRampToValueAtTime(ot.z,t),e.orientationX.linearRampToValueAtTime(oi.x,t),e.orientationY.linearRampToValueAtTime(oi.y,t),e.orientationZ.linearRampToValueAtTime(oi.z,t)}else e.setPosition(ot.x,ot.y,ot.z),e.setOrientation(oi.x,oi.y,oi.z)}},"PropertyBinding",0,oc,"PropertyMixer",0,on,"QuadraticBezierCurve",0,i1,"QuadraticBezierCurve3",0,i2,"Quaternion",0,U,"QuaternionKeyframeTrack",0,si,"QuaternionLinearInterpolant",0,sr,"R11_EAC_Format",0,37488,"RAD2DEG",0,I,"RED_GREEN_RGTC2_Format",0,36285,"RED_RGTC1_Format",0,36283,"REVISION",0,"186","RG11_EAC_Format",0,37490,"RGBADepthPacking",0,3201,"RGBAFormat",0,1023,"RGBAIntegerFormat",0,1033,"RGBA_ASTC_10x10_Format",0,37819,"RGBA_ASTC_10x5_Format",0,37816,"RGBA_ASTC_10x6_Format",0,37817,"RGBA_ASTC_10x8_Format",0,37818,"RGBA_ASTC_12x10_Format",0,37820,"RGBA_ASTC_12x12_Format",0,37821,"RGBA_ASTC_4x4_Format",0,37808,"RGBA_ASTC_5x4_Format",0,37809,"RGBA_ASTC_5x5_Format",0,37810,"RGBA_ASTC_6x5_Format",0,37811,"RGBA_ASTC_6x6_Format",0,37812,"RGBA_ASTC_8x5_Format",0,37813,"RGBA_ASTC_8x6_Format",0,37814,"RGBA_ASTC_8x8_Format",0,37815,"RGBA_BPTC_Format",0,36492,"RGBA_ETC2_EAC_Format",0,37496,"RGBA_PVRTC_2BPPV1_Format",0,35843,"RGBA_PVRTC_4BPPV1_Format",0,35842,"RGBA_S3TC_DXT1_Format",0,33777,"RGBA_S3TC_DXT3_Format",0,33778,"RGBA_S3TC_DXT5_Format",0,33779,"RGBDepthPacking",0,3202,"RGBFormat",0,1022,"RGBIntegerFormat",0,1032,"RGB_BPTC_SIGNED_Format",0,36494,"RGB_BPTC_UNSIGNED_Format",0,36495,"RGB_ETC1_Format",0,36196,"RGB_ETC2_Format",0,37492,"RGB_PVRTC_2BPPV1_Format",0,35841,"RGB_PVRTC_4BPPV1_Format",0,35840,"RGB_S3TC_DXT1_Format",0,33776,"RGDepthPacking",0,3203,"RGFormat",0,1030,"RGIntegerFormat",0,1031,"RawShaderMaterial",0,nU,"Ray",0,re,"Raycaster",0,class{constructor(t,e,r=0,i=1/0){this.ray=new re(t,e),this.near=r,this.far=i,this.camera=null,this.layers=new tv,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,e.projectionMatrix.elements[14]).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):A("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return om.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(om),this}intersectObject(t,e=!0,r=[]){return og(t,this,r,e),r.sort(oy),r}intersectObjects(t,e=!0,r=[]){for(let i=0,n=t.length;i<n;i++)og(t[i],this,r,e);return r.sort(oy),r}},"RectAreaLight",0,sU,"RedFormat",0,1028,"RedIntegerFormat",0,1029,"ReinhardToneMapping",0,2,"RenderObjectRefreshType",0,{NONE:0,SHARED:1,FULL:2},"RenderTarget",0,tn,"RenderTarget3D",0,class extends tn{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isRenderTarget3D=!0,this.depth=r;for(let i=0;i<this.textures.length;i++){const n=new ta(null,t,e,r);n.isRenderTargetTexture=!0,n.renderTarget=this,this.textures[i]=n}this._setTextureOptions(i)}},"RepeatWrapping",0,1e3,"ReplaceStencilOp",0,7681,"ReverseSubtractEquation",0,102,"ReversedDepthFuncs",0,{0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},"RingGeometry",0,n_,"SIGNED_R11_EAC_Format",0,37489,"SIGNED_RED_GREEN_RGTC2_Format",0,36286,"SIGNED_RED_RGTC1_Format",0,36284,"SIGNED_RG11_EAC_Format",0,37491,"SRGBColorSpace",0,p,"SRGBTransfer",0,m,"Scene",0,tH,"ShaderMaterial",0,nF,"ShadowMaterial",0,nB,"Shape",0,i8,"ShapeGeometry",0,nA,"ShapePath",0,class{constructor(){this.type="ShapePath",this.color=new tV,this.subPaths=[],this.currentPath=null,this.userData={}}moveTo(t,e){return this.currentPath=new i6,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(){function t(t,e){let r=!1,i=e.length;for(let n=0,s=i-1;n<i;s=n++){let i=e[n],o=e[s];i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}let e=this.userData.style&&this.userData.style.fillRule||"nonzero";"nonzero"!==e&&"evenodd"!==e&&(_('Fill-rule "'+e+'" is not supported, falling back to "nonzero".'),e="nonzero");let r="nonzero"===e?t=>0!==t:t=>(1&t)!=0,i=[];for(let e of this.subPaths){let r=e.getPoints();if(r.length<3)continue;let n=nm.area(r);if(0===n)continue;let s=new ox;for(let t=0;t<r.length;t++)s.expandByPoint(r[t]);i.push({subPath:e,points:r,boundingBox:s,interiorPoint:function(e,r){let i=r.getCenter(new F);if(t(i,e))return i;let n=i.y,s=[],o=e.length;for(let t=0;t<o;t++){let r=e[t],i=e[(t+1)%o];if(r.y>n!=i.y>n){let t=r.x+(n-r.y)*(i.x-r.x)/(i.y-r.y);s.push(t)}}return s.length>1&&(s.sort((t,e)=>t-e),i.x=(s[0]+s[1])/2),i}(r,s),absArea:Math.abs(n),winding:n<0?-1:1,container:null,exclude:!1,role:null})}i.sort((t,e)=>e.absArea-t.absArea);for(let e=0;e<i.length;e++){let n=i[e],s=0;for(let r=e-1;r>=0;r--){let e=i[r];if(e.boundingBox.containsBox(n.boundingBox)&&t(n.interiorPoint,e.points)){n.container=e.exclude?e.container:e,s=e.winding,n.winding+=s;break}}r(n.winding)===r(s)&&(n.exclude=!0)}for(let t of i)t.exclude||(t.role=null===t.container||"hole"===t.container.role?"outer":"hole");let n=[],s=new Map;for(let t of i){if(t.exclude||"outer"!==t.role)continue;let e=new i8;e.curves=t.subPath.curves,n.push(e),s.set(t,e)}for(let t of i){if(t.exclude||"hole"!==t.role)continue;let e=s.get(t.container);if(!e)continue;let r=new i6;r.curves=t.subPath.curves,e.holes.push(r)}return n}},"ShapeUtils",0,nm,"ShortType",0,1011,"Skeleton",0,rO,"SkeletonHelper",0,class extends ip{constructor(t){const e=function t(e){let r=[];!0===e.isBone&&r.push(e);for(let i=0;i<e.children.length;i++)r.push(...t(e.children[i]));return r}(t),r=new eP,i=[],n=[];for(let t=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),n.push(0,0,0),n.push(0,0,0))}r.setAttribute("position",new ew(i,3)),r.setAttribute("color",new ew(n,3)),super(r,new r7({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;const s=new tV(255),o=new tV(65280);this.setColors(s,o)}updateMatrixWorld(t){let e=this.bones,r=this.geometry,i=r.getAttribute("position");oI.copy(this.root.matrixWorld).invert();for(let t=0,r=0;t<e.length;t++){let n=e[t];n.parent&&n.parent.isBone&&(oO.multiplyMatrices(oI,n.matrixWorld),oR.setFromMatrixPosition(oO),i.setXYZ(r,oR.x,oR.y,oR.z),oO.multiplyMatrices(oI,n.parent.matrixWorld),oR.setFromMatrixPosition(oO),i.setXYZ(r+1,oR.x,oR.y,oR.z),r+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}setColors(t,e){let r=this.geometry.getAttribute("color");for(let i=0;i<r.count;i+=2)r.setXYZ(i,t.r,t.g,t.b),r.setXYZ(i+1,e.r,e.g,e.b);return r.needsUpdate=!0,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"SkinnedMesh",0,rA,"Source",0,class extends K{constructor(t=null){T('Source: "Source" has been renamed to "TextureSource". Please update your code to use "THREE.TextureSource" instead.'),super(t),this.isSource=!0}},"Sphere",0,eA,"SphereGeometry",0,nT,"Spherical",0,class{constructor(t=1,e=0,r=0){this.radius=t,this.phi=e,this.theta=r}set(t,e,r){return this.radius=t,this.phi=e,this.theta=r,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=P(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,r){return this.radius=Math.sqrt(t*t+e*e+r*r),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,r),this.phi=Math.acos(P(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},"SphericalHarmonics3",0,sj,"SplineCurve",0,i3,"SpotLight",0,sk,"SpotLightHelper",0,class extends tL{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new eP,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1;t<32;t++,e++){const r=t/32*Math.PI*2,n=e/32*Math.PI*2;i.push(Math.cos(r),Math.sin(r),1,Math.cos(n),Math.sin(n),1)}r.setAttribute("position",new ew(i,3));const n=new r7({fog:!1,toneMapped:!1});this.cone=new ip(r,n),this.add(this.cone),this.update()}dispose(){super.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;let t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),oE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oE),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},"Sprite",0,e2,"SpriteMaterial",0,eW,"SrcAlphaFactor",0,204,"SrcAlphaSaturateFactor",0,210,"SrcColorFactor",0,202,"StaticCopyUsage",0,35046,"StaticDrawUsage",0,35044,"StaticReadUsage",0,35045,"StereoCamera",0,class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new sO,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new sO,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){let e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){let r,i;e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,s1.copy(t.projectionMatrix);let n=e.eyeSep/2,s=n*e.near/e.focus,o=e.near*Math.tan(O*e.fov*.5)/e.zoom;s0.elements[12]=-n,sQ.elements[12]=n,r=-o*e.aspect+s,i=o*e.aspect+s,s1.elements[0]=2*e.near/(i-r),s1.elements[8]=(i+r)/(i-r),this.cameraL.projectionMatrix.copy(s1),r=-o*e.aspect-s,i=o*e.aspect-s,s1.elements[0]=2*e.near/(i-r),s1.elements[8]=(i+r)/(i-r),this.cameraR.projectionMatrix.copy(s1)}this.cameraL.matrix.copy(t.matrixWorld).multiply(s0),this.cameraL.matrixWorldNeedsUpdate=!0,this.cameraR.matrix.copy(t.matrixWorld).multiply(sQ),this.cameraR.matrixWorldNeedsUpdate=!0}},"StreamCopyUsage",0,35042,"StreamDrawUsage",0,35040,"StreamReadUsage",0,35041,"StringKeyframeTrack",0,sn,"SubtractEquation",0,101,"SubtractiveBlending",0,3,"TOUCH",0,{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},"TangentSpaceNormalMap",0,0,"TetrahedronGeometry",0,nC,"Texture",0,tr,"TextureLoader",0,class extends sc{constructor(t){super(t)}load(t,e,r,i){let n=new tr,s=new sy(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(t){n.image=t,n.needsUpdate=!0,void 0!==e&&e(n)},r,i),n}},"TextureSource",0,K,"TextureUtils",0,class{static contain(t,e){let r;return(r=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=1,t.repeat.y=r/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/r,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}static cover(t,e){let r;return(r=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=e/r,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=r/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}static fill(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}static getByteLength(t,e,r,i){return oW(t,e,r,i)}},"Timer",0,s2,"TimestampQuery",0,{COMPUTE:"compute",RENDER:"render"},"TorusGeometry",0,nE,"TorusKnotGeometry",0,nR,"Triangle",0,t6,"TriangleFanDrawMode",0,2,"TriangleStripDrawMode",0,1,"TrianglesDrawMode",0,0,"TubeGeometry",0,nO,"UVMapping",0,300,"Uint16BufferAttribute",0,ev,"Uint32BufferAttribute",0,ex,"Uint8BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint8Array(t),e,r)}},"Uint8ClampedBufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint8ClampedArray(t),e,r)}},"Uniform",0,class t{constructor(t){this.value=t}clone(){return new t(void 0===this.value.clone?this.value:this.value.clone())}},"UniformsGroup",0,class extends C{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:of++}),this.name="",this.usage=35044,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){let e=this.uniforms.indexOf(t);return -1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(t){this.name=t.name,this.usage=t.usage;let e=t.uniforms;this.uniforms.length=0;for(let t=0,r=e.length;t<r;t++){let r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0;t<r.length;t++)this.uniforms.push(r[t].clone())}return this}clone(){return new this.constructor().copy(this)}},"UniformsUtils",0,{clone:nL,merge:nz},"UnsignedByteType",0,1009,"UnsignedInt101111Type",0,35899,"UnsignedInt248Type",0,1020,"UnsignedInt5999Type",0,35902,"UnsignedIntType",0,1014,"UnsignedShort4444Type",0,1017,"UnsignedShort5551Type",0,1018,"UnsignedShortType",0,1012,"VSMShadowMap",0,3,"Vector2",0,F,"Vector3",0,j,"Vector4",0,ti,"VectorKeyframeTrack",0,ss,"VideoFrameTexture",0,class extends iS{constructor(t,e,r,i,n,s,o,a){super({},t,e,r,i,n,s,o,a),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(t){this.image=t,this.needsUpdate=!0}},"VideoTexture",0,iS,"WebGL3DRenderTarget",0,class extends ts{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new ta(null,t,e,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}},"WebGLArrayRenderTarget",0,class extends ts{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new to(null,t,e,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}},"WebGLCoordinateSystem",0,2e3,"WebGLRenderTarget",0,ts,"WebGPUCoordinateSystem",0,2001,"WebXRController",0,class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new tz,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new tz,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new tz,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let r of t.hand.values())this._getHandJoint(e,r)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,r){let i=null,n=null,s=null,o=this._targetRay,a=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let i of(s=!0,t.hand.values())){let t=e.getJointPose(i,r),n=this._getHandJoint(h,i);null!==t&&(n.matrix.fromArray(t.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.matrixWorldNeedsUpdate=!0,n.jointRadius=t.radius),n.visible=null!==t}let i=h.joints["index-finger-tip"],n=h.joints["thumb-tip"],o=i.position.distanceTo(n.position);h.inputState.pinching&&o>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&o<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&null!==(n=e.getPose(t.gripSpace,r))&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,a.eventsEnabled&&a.dispatchEvent({type:"gripUpdated",data:t,target:this}));null!==o&&(null===(i=e.getPose(t.targetRaySpace,r))&&null!==n&&(i=n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(tN)))}return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==n),null!==h&&(h.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let r=new tz;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}},"WireframeGeometry",0,nI,"WrapAroundEnding",0,2402,"ZeroCurvatureEnding",0,2400,"ZeroFactor",0,200,"ZeroSlopeEnding",0,2401,"ZeroStencilOp",0,0,"cloneUniforms",0,nL,"createCanvasElement",0,function(){let t=v("canvas");return t.style.display="block",t},"createElementNS",0,v,"error",0,A,"getByteLength",0,oW,"getConsoleFunction",0,function(){return w},"getUnlitUniformColorSpace",0,function(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:$.workingColorSpace},"log",0,S,"mergeUniforms",0,nz,"probeAsync",0,function(t,e,r){return new Promise(function(i,n){setTimeout(function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:n();break;case t.TIMEOUT_EXPIRED:setTimeout(s,r);break;default:i()}},r)})},"setConsoleFunction",0,function(t){w=t},"warn",0,_,"warnOnce",0,T])}]);