import{m as x,u as j,r as h,j as t}from"../index.js";function o(e){const r=e.readFloat(),s=e.readString(),i=e.readBool()?e.readString():void 0;return{n:r,s,opt:i}}function m({id:e,items:r}){const{onEvent:s,sendEvent:c}=j(),[i,a]=h.useState(r),[d,l]=h.useState(0);return s("setItems",n=>{a(n.readList(o))}),s("addItem",n=>{a([...i,o(n)])}),s("funRotate",()=>{l(d+180)}),t.jsxs("div",{children:[t.jsx("button",{onClick:()=>l(d+180),children:"Do fun rotate"}),t.jsx("button",{onClick:()=>c("click"),children:"Server Click"}),t.jsx("div",{children:"ID"}),t.jsx("div",{style:{width:"min-content",transition:"transform 1.0s",transform:`rotate(${d}deg)`},children:e}),t.jsx("div",{children:"Items"}),i.map(n=>{var v;return t.jsxs("div",{children:[t.jsx("div",{children:"N"}),t.jsx("div",{children:n.n}),t.jsx("div",{children:"S"}),t.jsx("div",{children:n.s}),t.jsx("div",{children:"opt"}),t.jsx("div",{children:(v=n.opt)!=null?v:"<UNDEFINED>"})]},n.n)})]})}x("test",m,e=>{const r=e.readInt(),s=e.readList(o);return{id:r,items:s}});
