import{i as e}from"./chunk-aKtaBQYM.js";import{Rt as t,Vt as n,o as r,wt as i}from"./mui-B6lh3XSP.js";import{t as a}from"./EditAttributesAccordion-BaG0aySx.js";import{i as o,n as s,r as c,t as l}from"./ExpandMore-BvigPYWL.js";import{t as u}from"./TextField-DOdnjCrL.js";import{t as d}from"./Typography-DfQXhGTT.js";import{mt as f,w as p,yt as m}from"./index-KVuxnkWj.js";import{t as h}from"./SelectField-9K8NpSQG.js";import{n as g,t as _}from"./useSettingsStyles-X3caKosH.js";import{t as v}from"./EditItemView-BNkSnNuu.js";import{t as y}from"./useCommonDeviceAttributes-C4IpCoKu.js";var b=e(n(),1),x=e=>(0,b.useMemo)(()=>({"processing.copyAttributes":{name:e(`attributeProcessingCopyAttributes`),type:`string`},"decoder.timezone":{name:e(`sharedTimezone`),type:`string`}}),[e]),S=i(),C=()=>{let{classes:e}=_(),n=t(),i=m(),C=y(i),w=x(i),[T,E]=(0,b.useState)(),D=f(async()=>{let e=await p(`/api/groups`);n(r.refresh(await e.json()))});return(0,S.jsx)(v,{endpoint:`groups`,item:T,setItem:E,validate:()=>T&&T.name,onItemSaved:D,menu:(0,S.jsx)(g,{}),breadcrumbs:[`settingsTitle`,`groupDialog`],children:T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(o,{defaultExpanded:!0,children:[(0,S.jsx)(s,{expandIcon:(0,S.jsx)(l,{}),children:(0,S.jsx)(d,{variant:`subtitle1`,children:i(`sharedRequired`)})}),(0,S.jsx)(c,{className:e.details,children:(0,S.jsx)(u,{value:T.name||``,onChange:e=>E({...T,name:e.target.value}),label:i(`sharedName`)})})]}),(0,S.jsxs)(o,{children:[(0,S.jsx)(s,{expandIcon:(0,S.jsx)(l,{}),children:(0,S.jsx)(d,{variant:`subtitle1`,children:i(`sharedExtra`)})}),(0,S.jsx)(c,{className:e.details,children:(0,S.jsx)(h,{value:T.groupId,onChange:e=>E({...T,groupId:Number(e.target.value)}),endpoint:`/api/groups`,label:i(`groupParent`)})})]}),(0,S.jsx)(a,{attributes:T.attributes,setAttributes:e=>E({...T,attributes:e}),definitions:{...C,...w}})]})})};export{C as default};