import{g as m,j as s}from"./assertThisInitialized-ClXgY4BW.js";import{y as c,z as u,S as d,A as f,I as y,C as g,Q as p,F as v,G as h,T as x,H as P,J as j,d as C}from"./defaultI18nProvider-C_r1y4tu.js";import{d as R}from"./dataProvider-BSMCbdJg.js";import{u as w}from"./useResourceDefinitionContext-mEDLreK0.js";const k=(r={})=>{const n={},i=(e,t)=>{Object.keys(n).forEach(a=>{n[a]&&n[a].key===e&&n[a].callback(t)})};return{setup:()=>{},teardown:()=>{Object.keys(r).forEach(e=>delete r[e])},getItem(e,t){return m(r,e,t)},setItem(e,t){c(r,e,t),i(e,t)},removeItem(e){u(r,e),i(e,void 0)},removeItems(e){const t=l(r);Object.keys(t).forEach(a=>{a.startsWith(e)&&(u(r,a),i(a,void 0))})},reset(){const e=l(r);Object.keys(e).forEach(t=>{u(r,t),i(t,void 0)})},subscribe:(e,t)=>{const a=Math.random().toString();return n[a]={key:e,callback:t},()=>{delete n[a]}}}},l=r=>{var n={};function i(e,t){if(Object(e)!==e)n[t]=e;else if(Array.isArray(e))n[t]=e;else{var a=!0;for(var o in e)a=!1,i(e[o],t?t+"."+o:o);a&&t&&(n[t]={})}}return i(r,""),n},A=({children:r,resources:n})=>{let i=w();if(Array.isArray(n))for(const e of n)i.register(e);else i.register(n);return r},S=r=>s.jsx(s.Fragment,{}),b=({children:r,dataProvider:n=R,i18nProvider:i=C,resources:e=[]})=>s.jsx(d,{value:k(),children:s.jsx(f.Provider,{value:n,children:s.jsx(y,{value:i,children:s.jsx(g,{children:s.jsx(p,{client:new v,children:s.jsx(h,{children:s.jsx(A,{resources:e,children:s.jsx(x.Provider,{value:{lightTheme:P},children:s.jsx(j,{children:r})})})})})})})})});S.__docgenInfo={description:"",methods:[],displayName:"AnyPropsComponent"};b.__docgenInfo={description:"",methods:[],displayName:"AdminStoryContext",props:{children:{required:!0,tsType:{name:"union",raw:"React.JSX.Element | React.JSX.Element[]",elements:[{name:"React.JSX.Element"},{name:"Array",elements:[{name:"React.JSX.Element"}],raw:"React.JSX.Element[]"}]},description:""},dataProvider:{required:!1,tsType:{name:"DataProvider"},description:"",defaultValue:{value:`fakeDataProvider({
    users,
    departments,
    roles,
    tasks,
    competences,
    userCompetences,
})`,computed:!0}},i18nProvider:{required:!1,tsType:{name:"signature",type:"object",raw:`{
    translate: Translate;
    changeLocale: (locale: string, options?: any) => Promise<void>;
    getLocale: () => string;
    getLocales?: () => Locale[];
    [key: string]: any;
}`,signature:{properties:[{key:"translate",value:{name:"signature",type:"function",raw:"(key: string, options?: any) => string",signature:{arguments:[{type:{name:"string"},name:"key"},{type:{name:"any"},name:"options"}],return:{name:"string"}},required:!0}},{key:"changeLocale",value:{name:"signature",type:"function",raw:"(locale: string, options?: any) => Promise<void>",signature:{arguments:[{type:{name:"string"},name:"locale"},{type:{name:"any"},name:"options"}],return:{name:"Promise",elements:[{name:"void"}],raw:"Promise<void>"}},required:!0}},{key:"getLocale",value:{name:"signature",type:"function",raw:"() => string",signature:{arguments:[],return:{name:"string"}},required:!0}},{key:"getLocales",value:{name:"signature",type:"function",raw:"() => Locale[]",signature:{arguments:[],return:{name:"Array",elements:[{name:"signature",type:"object",raw:`{
    locale: string;
    name: string;
}`,signature:{properties:[{key:"locale",value:{name:"string",required:!0}},{key:"name",value:{name:"string",required:!0}}]}}],raw:"Locale[]"}},required:!1}},{key:{name:"string"},value:{name:"any",required:!0}}]}},description:"",defaultValue:{value:"defaultI18nProvider",computed:!0}},resources:{required:!1,tsType:{name:"union",raw:"ResourceDefinition[] | ResourceDefinition",elements:[{name:"Array",elements:[{name:"ResourceDefinition"}],raw:"ResourceDefinition[]"},{name:"ResourceDefinition"}]},description:"",defaultValue:{value:"[]",computed:!1}}}};export{S as A,A as R,b as a};
