(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.ReactDOM,a=window.wp.domReady;var r=e.n(a);window.wp.hooks;const s=window.ReactJSXRuntime,l=window.wp.components,o=window.wp.i18n,i=()=>{const[e,n]=(0,t.useState)({name:"",description:"",rows:5,columns:5}),a=e=>{n(t=>({...t,...e}))};return(0,s.jsxs)(l.Card,{children:[(0,s.jsx)(l.CardHeader,{children:(0,s.jsx)("h2",{children:(0,o.__)("Add New Table","tablepress")})}),(0,s.jsx)(l.CardBody,{children:(0,s.jsxs)(l.__experimentalVStack,{spacing:"20px",style:{maxWidth:"500px"},children:[(0,s.jsx)(l.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,name:"table[name]",label:(0,o.__)("Table Name","tablepress"),help:(0,o.__)("The name or title of your table.","tablepress"),value:e.name,onChange:e=>a({name:e})}),(0,s.jsx)(l.TextareaControl,{__nextHasNoMarginBottom:!0,name:"table[description]",label:(0,o.__)("Description","tablepress")+" "+(0,o.__)("(optional)","tablepress"),help:(0,o.__)("A description of the contents of your table.","tablepress"),value:e.description,onChange:e=>a({description:e}),rows:"4"}),(0,s.jsxs)(l.__experimentalHStack,{alignment:"left",spacing:"20px",children:[(0,s.jsx)("div",{style:{width:"150px"},children:(0,s.jsx)(l.__experimentalNumberControl,{__next40pxDefaultSize:!0,name:"table[rows]",label:(0,o.__)("Number of Rows","tablepress"),help:(0,o.__)("The number of rows in your table.","tablepress"),title:(0,o.__)("This field must contain a positive number.","tablepress"),isDragEnabled:!1,value:e.rows,onChange:e=>a({rows:e}),min:1,max:99999,required:!0})}),(0,s.jsx)("div",{style:{width:"150px"},children:(0,s.jsx)(l.__experimentalNumberControl,{__next40pxDefaultSize:!0,name:"table[columns]",label:(0,o.__)("Number of Columns","tablepress"),help:(0,o.__)("The number of columns in your table.","tablepress"),title:(0,o.__)("This field must contain a positive number.","tablepress"),isDragEnabled:!1,value:e.columns,onChange:e=>a({columns:e}),min:1,max:99999,required:!0})})]}),(0,s.jsx)(l.__experimentalHStack,{children:(0,s.jsx)(l.Button,{variant:"primary",type:"submit",text:(0,o.__)("Add Table","tablepress")})})]})})]})};var d;d=(0,s.jsx)(i,{}),r()(()=>{const e=document.getElementById("tablepress-add-screen");e&&(0,n.createRoot)(e).render(d)})})();