import{r as o}from"./index-BP8_t0zE.js";import{c as h,s as _}from"./defaultI18nProvider-C_r1y4tu.js";import{P as C}from"./ShowButton-DFgxFuea.js";import{T as P}from"./TopToolbar-BqW7kXvQ.js";import{u as p}from"./useAuthenticated-CxLvTTH7.js";import{a as j}from"./EditBase-zpPedF3-.js";import{C as S}from"./CardContent-C5u1opi3.js";import{C as T}from"./Card-Cv9uZOGS.js";import{T as A}from"./Title-Db_cbkJo.js";var N=function(){var e=o.useContext(j);if(!e)throw new Error("useEditContext must be used inside an EditContextProvider");return e},u=function(){return u=Object.assign||function(e){for(var r,a=1,t=arguments.length;a<t;a++){r=arguments[a];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)},R=function(e,r){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(a[t[n]]=e[t[n]]);return a},I=function(e){var r=p(e).hasShow;return o.createElement(P,u({},L(e)),r&&o.createElement(C,null))},L=function(e){e.hasCreate,e.hasEdit,e.hasShow,e.hasList,e.resource;var r=R(e,["hasCreate","hasEdit","hasShow","hasList","resource"]);return r},f=function(){return f=Object.assign||function(e){for(var r,a=1,t=arguments.length;a<t;a++){r=arguments[a];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)},$=function(e,r){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(a[t[n]]=e[t[n]]);return a},c,z=o.createElement(I,null),J=function(e){var r,a=e.actions,t=e.aside,n=e.children,y=e.className,d=e.component,E=d===void 0?T:d,m=e.title,O=$(e,["actions","aside","children","className","component","title"]),g=p().hasShow,l=N(),b=l.resource,w=l.defaultTitle,x=l.record,v=typeof a>"u"&&g?z:a;return n?o.createElement(B,f({className:h("edit-page",y)},O),m!==!1&&o.createElement(A,{title:m,defaultTitle:w,preferenceKey:"".concat(b,".edit.title")}),v,o.createElement("div",{className:h(i.main,(r={},r[i.noActions]=!v,r))},o.createElement(E,{className:i.card},x?n:o.createElement(S,null," ")),t)):null},s="RaEdit",i={main:"".concat(s,"-main"),noActions:"".concat(s,"-noActions"),card:"".concat(s,"-card")},B=_("div",{name:s,overridesResolver:function(e,r){return r.root}})((c={},c["& .".concat(i.main)]={display:"flex",alignItems:"flex-start"},c["& .".concat(i.noActions)]={marginTop:"1em"},c["& .".concat(i.card)]={flex:"1 1 auto"},c));export{J as E,N as u};
