(()=>{var e={247:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const a=requireModule("node:fs"),o=n(465).Z,i=async()=>{var e=o();e=e.split("/")[e.split("/").length-1];var t=__dirname.split("/");t.pop(),t.pop(),t=t.join("/")+"/plugins";let n=a.readFileSync(`${t}/${e}`,"utf8");n=n.split('version:"')[n.split('version:"').length-1].split('",')[0];const i=await fetch(`https://raw.githubusercontent.com/TBHGodPro/SolarStatsPlugins/main/Plugins%20(Compressed)/${e}`);if(!i||"404: Not Found"==i)return;const r=i.split('version:"')[i.split('version:"').length-1].split('",')[0];(function(e,t){if(e==t)return!1;const n=e.split(".").map((e=>parseInt(e))),a=t.split(".").map((e=>parseInt(e)));var o=0;for(const e of n){if(n[o]{Logger.info(`UPDATING PLUGIN FROM ${n} TO ${r}, PLEASE RESTART SOLAR STATS`),a.writeFile(`${t}/${e}`,i,{},(()=>{}))}),500)}},465:(e,t,n)=>{"use strict";function a({depth:e=0}={}){const t=function({depth:e=0}={}){const t=[],n=new Set;for(const a of function(){const e=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const t=(new Error).stack.slice(1);return Error.prepareStackTrace=e,t}()){const o=a.getFileName(),i=null!==a.getTypeName()&&null!==o;if(n.has(o)||(n.add(o),t.unshift(a)),i)return t[e]}}({depth:e});return t&&t.getFileName()}n.d(t,{Z:()=>a})}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(247).Z();const{Command:e}=toolbox,t=new e("ec",[],[]),a=new e("tc",[],[]);let o=null,i=null,r=[],l=null,s=[];player.proxy.on("incoming",((e,t)=>{"open_window"==t.name&&("container.enderchest"==JSON.parse(e.windowTitle).translate&&(i=e.windowId),"container.chest"==JSON.parse(e.windowTitle).translate&&(l=e.windowId)),"window_items"!=t.name||i!=e.windowId&&l!=e.windowId||(i==e.windowId?r=e.items:s=e.items)})),player.proxy.on("outgoing",((e,t)=>{if("window_click"==t.name){if(i==e.windowId||l==e.windowId){var n=e.slot;if(i==e.windowId){if(e.slot>26&&1==e.mode){if(o=e.item,e.slot=r.indexOf(r.find((t=>t.blockId==e.item.blockId&&t.itemDamage==e.item.itemDamage&&t.nbtData==e.item.nbtData&&t.itemCount<64))),(-1==e.slot||e.slot>26)&&(e.slot=r.indexOf(r.find((e=>-1==e.blockId)))),e.slot>26)return}else if(1==e.mode)return void(r[e.slot]={blockId:-1,itemCount:void 0,itemDamage:void 0,nbtData:void 0});r[e.slot]?.itemCount&&n>26?r[e.slot].itemCount+=e.item.itemCount:r[e.slot]=e.item}else{if(e.slot>26&&1==e.mode){if(o=e.item,e.slot=s.indexOf(s.find((t=>t.blockId==e.item.blockId&&t.itemDamage==e.item.itemDamage&&t.nbtData==e.item.nbtData&&t.itemCount<64))),(-1==e.slot||e.slot>26)&&(e.slot=s.indexOf(s.find((e=>-1==e.blockId)))),e.slot>26)return}else if(1==e.mode)return void(s[e.slot]={blockId:-1,itemCount:void 0,itemDamage:void 0,nbtData:void 0});s[e.slot]?.itemCount&&n>26?s[e.slot].itemCount+=e.item.itemCount:s[e.slot]=e.item}}o=e.item}})),t.onTriggered=async()=>{if(r?.length){const n=new Inventory(InventoryType.CONTAINER,"§5§lEnder Chest §r§f(At Last View)",27);for(var e of r){var t=new Item(e?.blockId,e?.itemCount);t.meta=e?.itemDamage,e?.nbtData?.value?.display?.value?.Name?.value&&(t.displayName=e?.nbtData?.value?.display?.value?.Name?.value),e?.nbtData?.value?.display?.value?.Lore?.value?.value&&(t.lore=e?.nbtData?.value?.display?.value?.Lore?.value?.value),n.addItem(t,r.indexOf(e))}n.on("click",(e=>e.cancel(player.client))),n.display(player)}},a.onTriggered=async()=>{if(s?.length){const n=new Inventory(InventoryType.CONTAINER,"§a§lTeam Chest §r§f(At Last View)",27);for(var e of s){var t=new Item(e?.blockId,e?.itemCount);t.meta=e?.itemDamage,e?.nbtData?.value?.display?.value?.Name?.value&&(t.displayName=e?.nbtData?.value?.display?.value?.Name?.value),e?.nbtData?.value?.display?.value?.Lore?.value?.value&&(t.lore=e?.nbtData?.value?.display?.value?.Lore?.value?.value),n.addItem(t,s.indexOf(e))}n.on("click",(e=>e.cancel(player.client))),n.display(player)}},registerCommand(t),registerCommand(a),registerPlugin({name:"Bedwars Chest Viewer",description:"View Your Ender Chest And Team Chest From Anywhere | `/ec` `/tc`",version:"1.3.0",author:"TBHGodPro"})})()})();