@refinedev/antd 5.33.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/iife/index.js +1 -1
- package/dist/iife/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# @pankod/refine-antd
|
2
2
|
|
3
|
+
## 5.34.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#4775](https://github.com/refinedev/refine/pull/4775) [`3052fb22449`](https://github.com/refinedev/refine/commit/3052fb22449c5e35c607e95c060c38ca48e00c82) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - fixed: `<RefreshButton />` does not refresh content #4618.
|
8
|
+
From now, `<RefreshButton />` uses `useInvalidate` hook to refresh data instead of `useOne`.
|
9
|
+
|
10
|
+
### Patch Changes
|
11
|
+
|
12
|
+
- [#4772](https://github.com/refinedev/refine/pull/4772) [`c9cc4398e99`](https://github.com/refinedev/refine/commit/c9cc4398e9996a49f7ee9c4c5656661a66b591ad) Thanks [@alicanerdurmaz](https://github.com/alicanerdurmaz)! - fixed: antd `useModalForm` and `useDrawerForm` sends request twice when `syncWithLocation` is true
|
13
|
+
|
14
|
+
- [#4778](https://github.com/refinedev/refine/pull/4778) [`82909db10b4`](https://github.com/refinedev/refine/commit/82909db10b4ac1705e1354bff0c0d95951497725) Thanks [@salihozdemir](https://github.com/salihozdemir)! - fix: fixed the `goToStep` of `useStepsForm` hook return type
|
15
|
+
|
16
|
+
- Updated dependencies [[`3052fb22449`](https://github.com/refinedev/refine/commit/3052fb22449c5e35c607e95c060c38ca48e00c82)]:
|
17
|
+
- @refinedev/ui-types@1.22.0
|
18
|
+
|
3
19
|
## 5.33.0
|
4
20
|
|
5
21
|
### Minor Changes
|
package/dist/iife/index.js
CHANGED
@@ -8,7 +8,7 @@ See https://refine.dev/docs/api-reference/core/hooks/useForm/#resource`);let V=t
|
|
8
8
|
If you don't use the \`setShowId\` method to set the \`showId\`, you should pass the \`id\` prop to \`useShow\`. Otherwise, \`useShow\` will not be able to infer the \`id\` from the current URL.
|
9
9
|
|
10
10
|
See https://refine.dev/docs/api-reference/core/hooks/show/useShow/#resource`);let m=sn({resource:y,id:b??"",queryOptions:{enabled:b!==void 0,...d},successNotification:r,errorNotification:o,meta:S,metaData:S,liveMode:i,onLiveEvent:s,dataProviderName:v}),{elapsedTime:P}=$e({isLoading:m.isFetching,interval:l==null?void 0:l.interval,onInterval:l==null?void 0:l.onInterval});return{queryResult:m,showId:b,setShowId:g,overtime:{elapsedTime:P}}},$o=u("react"),ic=u("papaparse"),sc=$(u("lodash/chunk")),lc=({resourceName:e,resource:t,mapData:r=l=>l,paparseOptions:o,batchSize:a=Number.MAX_SAFE_INTEGER,onFinish:n,meta:i,metaData:s,onProgress:v,dataProviderName:d}={})=>{let[l,c]=(0,$o.useState)(0),[T,y]=(0,$o.useState)(0),[h,p]=(0,$o.useState)(!1),{resource:f,identifier:b}=ne(t??e),g=Re(),S=as(),m=ln(),P=g({resource:f,meta:Q(i,s)}),x;a===1?x=m:x=S;let E=()=>{y(0),c(0),p(!1)},M=w=>{let D={succeeded:w.filter(k=>k.type==="success"),errored:w.filter(k=>k.type==="error")};n==null||n(D),p(!1)};(0,$o.useEffect)(()=>{v==null||v({totalAmount:T,processedAmount:l})},[T,l]);let C=({file:w})=>(E(),new Promise(D=>{p(!0),(0,ic.parse)(w,{complete:async({data:k})=>{let A=Oi(k,r);if(y(A.length),a===1){let L=A.map(B=>async()=>({response:await m.mutateAsync({resource:b??"",values:B,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:P,metaData:P}),value:B})),F=await ri(L,({response:B,value:I})=>(c(N=>N+1),{response:[B.data],type:"success",request:[I]}),(B,I)=>({response:[B],type:"error",request:[A[I]]}));D(F)}else{let L=(0,sc.default)(A,a),F=L.map(I=>async()=>({response:await S.mutateAsync({resource:b??"",values:I,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:P,metaData:P}),value:I,currentBatchLength:I.length})),B=await ri(F,({response:I,currentBatchLength:N,value:O})=>(c(q=>q+N),{response:I.data,type:"success",request:O}),(I,N)=>({response:[I],type:"error",request:L[N]}));D(B)}},...o})}).then(D=>(M(D),D)));return{inputProps:{type:"file",accept:".csv",onChange:w=>{w.target.files&&w.target.files.length>0&&C({file:w.target.files[0]})}},mutationResult:x,isLoading:h,handleChange:C}},Va=u("react"),uc=({defaultVisible:e=!1}={})=>{let[t,r]=(0,Va.useState)(e),o=(0,Va.useCallback)(()=>r(!0),[t]),a=(0,Va.useCallback)(()=>r(!1),[t]);return{visible:t,show:o,close:a}},dc=$(u("react")),cn=()=>{let e=Oe(),{resource:t,resources:r}=ne(),o=Rt();return dc.default.useCallback(({resource:a,action:n,meta:i})=>{var s;let v=a||t;if(!v)return;let d=(s=lt(v,r,e==="legacy").find(l=>l.action===n))==null?void 0:s.route;return d?bt(d,v==null?void 0:v.meta,o,i):void 0},[r,t,o])},cc=({resource:e,action:t,meta:r,legacy:o})=>cn()({resource:e,action:t,meta:r,legacy:o}),Ti=$(u("react")),Xo=()=>{let e=(0,Ti.useContext)(Lo);return e!=null&&e.Link?e.Link:({to:t,...r})=>Ti.default.createElement("a",{href:t,...r})},pc=u("react"),Ts=$(u("react")),Jt={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},mc=Ts.default.createContext(Jt),pn=mc,fc=({children:e,useHistory:t,useLocation:r,useParams:o,Prompt:a,Link:n,routes:i})=>Ts.default.createElement(pn.Provider,{value:{useHistory:t??Jt.useHistory,useLocation:r??Jt.useLocation,useParams:o??Jt.useParams,Prompt:a??Jt.Prompt,Link:n??Jt.Link,routes:i??Jt.routes}},e),ft=()=>{let e=(0,pc.useContext)(pn),{useHistory:t,useLocation:r,useParams:o,Prompt:a,Link:n,routes:i}=e??Jt;return{useHistory:t,useLocation:r,useParams:o,Prompt:a,Link:n,routes:i}},yc=u("@tanstack/react-query"),vc=u("react"),Ps=$(u("react")),Fo=Ps.default.createContext({options:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}),gc=({can:e,children:t,options:r})=>Ps.default.createElement(Fo.Provider,{value:{can:e,options:r?{...r,buttons:{enableAccessControl:!0,hideIfUnauthorized:!1,...r.buttons}}:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}},t),mn=e=>{if(!e)return;let{icon:t,list:r,edit:o,create:a,show:n,clone:i,children:s,meta:v,options:d,...l}=e,{icon:c,...T}=v??{},{icon:y,...h}=d??{};return{...l,...v?{meta:T}:{},...d?{options:h}:{}}},Cs=({action:e,resource:t,params:r,queryOptions:o})=>{let{can:a}=(0,vc.useContext)(Fo),{resource:n,...i}=r??{},s=mn(n),v=(0,yc.useQuery)(["useCan",{action:e,resource:t,params:{...i,resource:s},enabled:o==null?void 0:o.enabled}],()=>(a==null?void 0:a({action:e,resource:t,params:{...i,resource:s}}))??Promise.resolve({can:!0}),{enabled:typeof a<"u",...o,retry:!1});return typeof a>"u"?{data:{can:!0}}:v},Pi=$(u("react")),hc=()=>{let{can:e}=Pi.default.useContext(Fo);return{can:Pi.default.useMemo(()=>e?async({params:t,...r})=>{let o=t!=null&&t.resource?mn(t.resource):void 0;return e({...r,...t?{params:{...t,resource:o}}:{}})}:void 0,[e])}},Ir=u("react"),bc=$(u("lodash/uniqBy")),Tc=$(u("lodash/debounce")),zo=$(u("lodash/get")),Pc=e=>{let[t,r]=(0,Ir.useState)([]),[o,a]=(0,Ir.useState)([]),[n,i]=(0,Ir.useState)([]),{resource:s,sort:v,sorters:d,filters:l=[],optionLabel:c="title",optionValue:T="id",debounce:y=300,successNotification:h,errorNotification:p,defaultValueQueryOptions:f,queryOptions:b,fetchSize:g,pagination:S,hasPagination:m=!1,liveMode:P,defaultValue:x=[],onLiveEvent:E,onSearch:M,liveParams:C,meta:w,metaData:D,dataProviderName:k,overtimeOptions:A}=e,{resource:L,identifier:F}=ne(s),B=Re()({resource:L,meta:Q(w,D)}),I=Array.isArray(x)?x:[x],N=(0,Ir.useCallback)(V=>{i(V.data.map(z=>({label:(0,zo.default)(z,c),value:(0,zo.default)(z,T)})))},[c,T]),O=f??b,q=rs({resource:F,ids:I,queryOptions:{...O,enabled:I.length>0&&((O==null?void 0:O.enabled)??!0),onSuccess:V=>{var z;N(V),(z=O==null?void 0:O.onSuccess)==null||z.call(O,V)}},meta:B,metaData:B,liveMode:"off",dataProviderName:k}),W=(0,Ir.useCallback)(V=>{a(V.data.map(z=>({label:(0,zo.default)(z,c),value:(0,zo.default)(z,T)})))},[c,T]),j=nn({resource:F,sorters:Q(d,v),filters:l.concat(t),pagination:{current:S==null?void 0:S.current,pageSize:(S==null?void 0:S.pageSize)??g,mode:S==null?void 0:S.mode},hasPagination:m,queryOptions:{...b,onSuccess:V=>{var z;W(V),(z=b==null?void 0:b.onSuccess)==null||z.call(b,V)}},successNotification:h,errorNotification:p,meta:B,metaData:B,liveMode:P,liveParams:C,onLiveEvent:E,dataProviderName:k}),U=V=>{if(M){r(M(V));return}if(V)r([{field:c,operator:"contains",value:V}]);else{r([]);return}},{elapsedTime:H}=$e({isLoading:j.isFetching||q.isFetching,interval:A==null?void 0:A.interval,onInterval:A==null?void 0:A.onInterval});return{queryResult:j,defaultValueQueryResult:q,options:(0,Ir.useMemo)(()=>(0,bc.default)([...o,...n],"value"),[o,n]),onSearch:(0,Tc.default)(U,y),overtime:{elapsedTime:H}}},br=$(u("react")),Ci=$(u("qs")),Wo=$(u("lodash/differenceWith")),jo=$(u("lodash/isEqual")),Cc=$(u("warn-once")),xi=[],Si=[];function xc({initialCurrent:e,initialPageSize:t,hasPagination:r=!0,pagination:o,initialSorter:a,permanentSorter:n=Si,defaultSetFilterBehavior:i,initialFilter:s,permanentFilter:v=xi,filters:d,sorters:l,syncWithLocation:c,resource:T,successNotification:y,errorNotification:h,queryOptions:p,liveMode:f,onLiveEvent:b,liveParams:g,meta:S,metaData:m,dataProviderName:P,overtimeOptions:x}={}){var E,M,C,w,D;let{syncWithLocation:k}=ts(),A=c??k,L=ys(f),F=Oe(),{useLocation:B}=ft(),{search:I,pathname:N}=B(),O=Re(),q=Rt(),W=((d==null?void 0:d.mode)||"server")==="server",j=((l==null?void 0:l.mode)||"server")==="server",U=r===!1?"off":"server",H=((o==null?void 0:o.mode)??U)!=="off",V=Q(o==null?void 0:o.current,e),z=Q(o==null?void 0:o.pageSize,t),ee=Q(S,m),{parsedCurrent:_,parsedPageSize:le,parsedSorter:Ce,parsedFilters:Z}=tn(I??"?"),ye=Q(d==null?void 0:d.initial,s),te=Q(d==null?void 0:d.permanent,v)??xi,re=Q(l==null?void 0:l.initial,a),oe=Q(l==null?void 0:l.permanent,n)??Si,De=Q(d==null?void 0:d.defaultBehavior,i)??"merge",xe,et,Se,nt;A?(xe=((E=q==null?void 0:q.params)==null?void 0:E.current)||_||V||1,et=((M=q==null?void 0:q.params)==null?void 0:M.pageSize)||le||z||10,Se=((C=q==null?void 0:q.params)==null?void 0:C.sorters)||(Ce.length?Ce:re),nt=((w=q==null?void 0:q.params)==null?void 0:w.filters)||(Z.length?Z:ye)):(xe=V||1,et=z||10,Se=re,nt=ye);let{replace:Mr}=Ct(),me=Pt(),{resource:qt,identifier:Xe}=ne(T),Qt=O({resource:qt,meta:ee});br.default.useEffect(()=>{(0,Cc.default)(typeof Xe>"u","useTable: `resource` is not defined.")},[Xe]);let[Le,$t]=(0,br.useState)(Ga(oe,Se??[])),[kt,Dt]=(0,br.useState)(Ka(te,nt??[])),[vr,On]=(0,br.useState)(xe),[gr,Vn]=(0,br.useState)(et),iu=({pagination:{current:Be,pageSize:ht},sorter:Ho,filters:Qo})=>{if(F==="new")return me({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...H?{current:Be,pageSize:ht}:{},sorters:Ho,filters:Qo,...Hn()}})??"";{let Co=Ci.default.parse(I==null?void 0:I.substring(1)),pu=Wa({pagination:{pageSize:ht,current:Be},sorters:Le??Ho,filters:Qo,...Co});return`${N??""}?${pu??""}`}};(0,br.useEffect)(()=>{I===""&&(On(xe),Vn(et),$t(Ga(oe,Se??[])),Dt(Ka(te,nt??[])))},[I]);let Hn=()=>{if(F==="new"){let{sorters:Be,filters:ht,pageSize:Ho,current:Qo,...Co}=(q==null?void 0:q.params)??{};return Co}else{let{sorter:Be,filters:ht,pageSize:Ho,current:Qo,...Co}=Ci.default.parse(I,{ignoreQueryPrefix:!0});return Co}};(0,br.useEffect)(()=>{if(A){let Be=Hn();if(F==="new")me({type:"replace",options:{keepQuery:!0},query:{...H?{pageSize:gr,current:vr}:{},sorters:(0,Wo.default)(Le,oe,jo.default),filters:(0,Wo.default)(kt,te,jo.default)}});else{let ht=Wa({...H?{pagination:{pageSize:gr,current:vr}}:{},sorters:(0,Wo.default)(Le,oe,jo.default),filters:(0,Wo.default)(kt,te,jo.default),...Be});return Mr==null?void 0:Mr(`${N}?${ht}`,void 0,{shallow:!0})}}},[A,vr,gr,Le,kt]);let Fa=nn({resource:Xe,hasPagination:r,pagination:{current:vr,pageSize:gr,mode:o==null?void 0:o.mode},filters:W?xo(te,kt):void 0,sorters:j?ja(oe,Le):void 0,queryOptions:p,successNotification:y,errorNotification:h,meta:Qt,metaData:Qt,liveMode:L,liveParams:g,onLiveEvent:b,dataProviderName:P}),su=Be=>{Dt(ht=>xo(te,Be,ht))},lu=Be=>{Dt(xo(te,Be))},uu=Be=>{Dt(ht=>xo(te,Be(ht)))},du=(Be,ht=De)=>{typeof Be=="function"?uu(Be):ht==="replace"?lu(Be):su(Be)},Qn=Be=>{$t(()=>ja(oe,Be))},{elapsedTime:cu}=$e({isLoading:Fa.isFetching,interval:x==null?void 0:x.interval,onInterval:x==null?void 0:x.onInterval});return{tableQueryResult:Fa,sorters:Le,setSorters:Qn,sorter:Le,setSorter:Qn,filters:kt,setFilters:du,current:vr,setCurrent:On,pageSize:gr,setPageSize:Vn,pageCount:gr?Math.ceil((((D=Fa.data)==null?void 0:D.total)??0)/gr):1,createLinkForSyncWithLocation:iu,overtime:{elapsedTime:cu}}}var Ei=u("react"),Ha=u("@tanstack/react-query"),xs=$(u("react")),Jo=xs.default.createContext({}),Sc=({create:e,get:t,update:r,children:o})=>xs.default.createElement(Jo.Provider,{value:{create:e,get:t,update:r}},o),Sr=({logMutationOptions:e,renameMutationOptions:t}={})=>{let r=(0,Ha.useQueryClient)(),o=(0,Ei.useContext)(Jo),a=qe(),{resources:n}=(0,Ei.useContext)(Eo),{data:i,refetch:s,isLoading:v}=Mi({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy),queryOptions:{enabled:!!o}}),d=(0,Ha.useMutation)(async c=>{var T,y,h,p,f;let b=je(c.resource,n),g=Q((T=b==null?void 0:b.meta)==null?void 0:T.audit,(y=b==null?void 0:b.options)==null?void 0:y.audit,(p=(h=b==null?void 0:b.options)==null?void 0:h.auditLog)==null?void 0:p.permissions);if(g&&!Wu(g,c.action))return;let S;return v&&(S=await s()),await((f=o.create)==null?void 0:f.call(o,{...c,author:i??(S==null?void 0:S.data)}))},e),l=(0,Ha.useMutation)(async c=>{var T;return await((T=o.update)==null?void 0:T.call(o,c))},{onSuccess:c=>{if(c!=null&&c.resource){let T=ct(c==null?void 0:c.resource);r.invalidateQueries(T.logList())}},...t});return{log:d,rename:l}},Ec=u("react"),Lc=u("@tanstack/react-query"),wc=({resource:e,action:t,meta:r,author:o,metaData:a,queryOptions:n})=>{let{get:i}=(0,Ec.useContext)(Jo),s=ct(e,void 0,a);return(0,Lc.useQuery)(s.logList(r),()=>(i==null?void 0:i({resource:e,action:t,author:o,meta:r,metaData:a}))??Promise.resolve([]),{enabled:typeof i<"u",...n,retry:!1})},Fc=u("react"),kc=u("@tanstack/react-query"),Er=()=>{let{resources:e}=ne(),t=(0,kc.useQueryClient)();return(0,Fc.useCallback)(({resource:r,dataProviderName:o,invalidates:a,id:n})=>{if(a===!1)return;let i=ct(r,J(r,o,e));a.forEach(s=>{switch(s){case"all":t.invalidateQueries(i.all);break;case"list":t.invalidateQueries(i.list());break;case"many":t.invalidateQueries(i.many());break;case"resourceAll":t.invalidateQueries(i.resourceAll);break;case"detail":t.invalidateQueries(i.detail(n||""));break;default:break}})},[])},Dc=u("react"),Bc=$(u("warn-once")),Rc=({meta:e={}}={})=>{let t=Oe(),{i18nProvider:r}=(0,Dc.useContext)(xr),o=Rt(),a=he(),{resources:n,resource:i,action:s}=ne(),{options:{textTransformers:v}}=pt(),d=[];if(!(i!=null&&i.name))return{breadcrumbs:d};let l=c=>{var T,y,h,p,f,b;let g=typeof c=="string"?je(c,n,t==="legacy")??{name:c}:c;if(g){let S=Q((T=g==null?void 0:g.meta)==null?void 0:T.parent,g==null?void 0:g.parentName);S&&l(S);let m=lt(g,n,t==="legacy").find(E=>E.action==="list"),P=(y=m==null?void 0:m.resource)!=null&&y.list?m==null?void 0:m.route:void 0,x=P?t==="legacy"?P:bt(P,g==null?void 0:g.meta,o,e):void 0;d.push({label:Q((h=g.meta)==null?void 0:h.label,(p=g.options)==null?void 0:p.label)??a(`${g.name}.${g.name}`,v.humanize(g.name)),href:x,icon:Q((f=g.meta)==null?void 0:f.icon,(b=g.options)==null?void 0:b.icon,g.icon)})}};if(l(i),s&&s!=="list"){let c=`actions.${s}`,T=a(c);typeof r<"u"&&T===c?((0,Bc.default)(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${s}" action. Please add "actions.${s}" key to your translation file.
|
11
|
-
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),d.push({label:a(`buttons.${s}`,v.humanize(s))})):d.push({label:a(c,v.humanize(s))})}return{breadcrumbs:d}},Qa=$(u("react")),Go=(e,t,r=!1)=>{let o=[],a=er(e,t);for(;a;)o.push(a),a=er(a,t);return o.reverse(),`/${[...o,e].map(n=>zt((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`},Ac=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(a=>{let n=[],i=er(a,e);for(;i;)n.push(i),i=er(i,e);n.reverse();let s=r;n.forEach(d=>{let l=(t?d.route:void 0)??d.identifier??d.name;s.children[l]||(s.children[l]={item:d,children:{}}),s=s.children[l]});let v=(t?a.route:void 0)??a.identifier??a.name;s.children[v]||(s.children[v]={item:a,children:{}})});let o=a=>{let n=[];return Object.keys(a.children).forEach(i=>{let s=Go(a.children[i].item,e,t),v={...a.children[i].item,key:s,children:o(a.children[i])};n.push(v)}),n};return o(r)},Li=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),Mc=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=he(),o=cn(),a=Oe(),{resource:n,resources:i}=ne(),{pathname:s}=Rt(),{useLocation:v}=ft(),{pathname:d}=v(),l=an(),c=`/${((a==="legacy"?Li(d):s?Li(s):void 0)??"").replace(/^\//,"")}`,T=n?Go(n,i,a==="legacy"):c??"",y=Qa.default.useMemo(()=>{if(!n)return[];let f=er(n,i),b=[Go(n,i)];for(;f;)b.push(Go(f,i)),f=er(f,i);return b},[]),h=Qa.default.useCallback(f=>{var b,g,S,m,P,x;if((((b=f==null?void 0:f.meta)==null?void 0:b.hide)??((g=f==null?void 0:f.options)==null?void 0:g.hide))||!(f!=null&&f.list)&&f.children.length===0)return;let E=f.list?o({resource:f,action:"list",legacy:a==="legacy",meta:e}):void 0;if(!(t&&E&&E.match(/(\/|^):(.+?)(\/|$){1}/)))return{...f,route:E,icon:Q((S=f.meta)==null?void 0:S.icon,(m=f.options)==null?void 0:m.icon,f.icon),label:Q((P=f==null?void 0:f.meta)==null?void 0:P.label,(x=f==null?void 0:f.options)==null?void 0:x.label)??r(`${f.name}.${f.name}`,l(f.name,"plural"))}},[a,e,r,t]),p=Qa.default.useMemo(()=>{let f=Ac(i,a==="legacy"),b=g=>g.flatMap(S=>{let m=b(S.children),P=h({...S,children:m});return P?[P]:[]});return b(f)},[i,a,h]);return{defaultOpenKeys:y,selectedKey:T,menuItems:p}},Re=()=>{let{params:e}=Rt();return({resource:t,meta:r}={})=>{let{meta:o}=mn(t)??{meta:{}},{filters:a,sorters:n,current:i,pageSize:s,...v}=e??{};return{...o,...v,...r}}},Ic=()=>{let[e,t]=(0,hr.useState)(),r=he(),{push:o}=Ct(),a=Pt(),n=Oe(),{resource:i,action:s}=ne();return(0,hr.useEffect)(()=>{i&&s&&t(r("pages.error.info",{action:s,resource:i.name},`You may have forgotten to add the "${s}" component to "${i.name}" resource.`))},[i,s]),hr.default.createElement(hr.default.Fragment,null,hr.default.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&hr.default.createElement("p",null,e),hr.default.createElement("button",{onClick:()=>{n==="legacy"?o("/"):a({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))},Ue=$(u("react")),Ss=()=>{let[e,t]=(0,Ue.useState)(""),[r,o]=(0,Ue.useState)(""),a=he(),n=qe(),{mutate:i}=Xa({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)});return Ue.default.createElement(Ue.default.Fragment,null,Ue.default.createElement("h1",null,a("pages.login.title","Sign in your account")),Ue.default.createElement("form",{onSubmit:s=>{s.preventDefault(),i({username:e,password:r})}},Ue.default.createElement("table",null,Ue.default.createElement("tbody",null,Ue.default.createElement("tr",null,Ue.default.createElement("td",null,a("pages.login.username",void 0,"username"),":"),Ue.default.createElement("td",null,Ue.default.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:s=>t(s.target.value)}))),Ue.default.createElement("tr",null,Ue.default.createElement("td",null,a("pages.login.password",void 0,"password"),":"),Ue.default.createElement("td",null,Ue.default.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:s=>o(s.target.value)}))))),Ue.default.createElement("br",null),Ue.default.createElement("input",{type:"submit",value:"login"})))},Nr=$(u("react")),ve=$(u("react")),Nc=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:a,wrapperProps:n,renderContent:i,formProps:s,title:v=void 0})=>{let d=Oe(),l=Xo(),{Link:c}=ft(),T=d==="legacy"?c:l,[y,h]=(0,ve.useState)(""),[p,f]=(0,ve.useState)(""),[b,g]=(0,ve.useState)(!1),S=he(),m=qe(),{mutate:P}=Xa({v3LegacyAuthProviderCompatible:!!(m!=null&&m.isLegacy)}),x=(C,w)=>ve.default.createElement(T,{to:C},w),E=()=>e?e.map(C=>ve.default.createElement("div",{key:C.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ve.default.createElement("button",{onClick:()=>P({providerName:C.name}),style:{display:"flex",alignItems:"center"}},C==null?void 0:C.icon,C.label??ve.default.createElement("label",null,C.label)))):null,M=ve.default.createElement("div",{...a},ve.default.createElement("h1",{style:{textAlign:"center"}},S("pages.login.title","Sign in to your account")),E(),ve.default.createElement("hr",null),ve.default.createElement("form",{onSubmit:C=>{C.preventDefault(),P({email:y,password:p,remember:b})},...s},ve.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ve.default.createElement("label",{htmlFor:"email-input"},S("pages.login.fields.email","Email")),ve.default.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:y,onChange:C=>h(C.target.value)}),ve.default.createElement("label",{htmlFor:"password-input"},S("pages.login.fields.password","Password")),ve.default.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:p,onChange:C=>f(C.target.value)}),o??ve.default.createElement(ve.default.Fragment,null,ve.default.createElement("label",{htmlFor:"remember-me-input"},S("pages.login.buttons.rememberMe","Remember me"),ve.default.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:b,value:b.toString(),onChange:()=>{g(!b)}}))),ve.default.createElement("br",null),r??x("/forgot-password",S("pages.login.buttons.forgotPassword","Forgot password?")),ve.default.createElement("input",{type:"submit",value:S("pages.login.signin","Sign in")}),t??ve.default.createElement("span",null,S("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",x("/register",S("pages.login.register","Sign up"))))));return ve.default.createElement("div",{...n},i?i(M,v):M)},we=$(u("react")),Uc=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:a,formProps:n,title:i=void 0})=>{let s=Oe(),v=Xo(),{Link:d}=ft(),l=s==="legacy"?d:v,[c,T]=(0,we.useState)(""),[y,h]=(0,we.useState)(""),p=he(),f=qe(),{mutate:b,isLoading:g}=Ii({v3LegacyAuthProviderCompatible:!!(f!=null&&f.isLegacy)}),S=(x,E)=>we.default.createElement(l,{to:x},E),m=()=>e?e.map(x=>we.default.createElement("div",{key:x.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},we.default.createElement("button",{onClick:()=>b({providerName:x.name}),style:{display:"flex",alignItems:"center"}},x==null?void 0:x.icon,x.label??we.default.createElement("label",null,x.label)))):null,P=we.default.createElement("div",{...o},we.default.createElement("h1",{style:{textAlign:"center"}},p("pages.register.title","Sign up for your account")),m(),we.default.createElement("hr",null),we.default.createElement("form",{onSubmit:x=>{x.preventDefault(),b({email:c,password:y})},...n},we.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},we.default.createElement("label",{htmlFor:"email-input"},p("pages.register.fields.email","Email")),we.default.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:x=>T(x.target.value)}),we.default.createElement("label",{htmlFor:"password-input"},p("pages.register.fields.password","Password")),we.default.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:y,onChange:x=>h(x.target.value)}),we.default.createElement("input",{type:"submit",value:p("pages.register.buttons.submit","Sign up"),disabled:g}),t??we.default.createElement(we.default.Fragment,null,we.default.createElement("span",null,p("pages.login.buttons.haveAccount","Have an account?")," ",S("/login",p("pages.login.signin","Sign in")))))));return we.default.createElement("div",{...r},a?a(P,i):P)},it=$(u("react")),qc=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:a,title:n=void 0})=>{let i=he(),s=Oe(),v=Xo(),{Link:d}=ft(),l=s==="legacy"?d:v,[c,T]=(0,it.useState)(""),{mutate:y,isLoading:h}=Ni(),p=(b,g)=>it.default.createElement(l,{to:b},g),f=it.default.createElement("div",{...r},it.default.createElement("h1",{style:{textAlign:"center"}},i("pages.forgotPassword.title","Forgot your password?")),it.default.createElement("hr",null),it.default.createElement("form",{onSubmit:b=>{b.preventDefault(),y({email:c})},...a},it.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},it.default.createElement("label",{htmlFor:"email-input"},i("pages.forgotPassword.fields.email","Email")),it.default.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:b=>T(b.target.value)}),it.default.createElement("input",{type:"submit",disabled:h,value:i("pages.forgotPassword.buttons.submit","Send reset instructions")}),it.default.createElement("br",null),e??it.default.createElement("span",null,i("pages.register.buttons.haveAccount","Have an account? ")," ",p("/login",i("pages.login.signin","Sign in"))))));return it.default.createElement("div",{...t},o?o(f,n):f)},st=$(u("react")),Oc=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:a=void 0})=>{let n=he(),i=qe(),{mutate:s,isLoading:v}=Ui({v3LegacyAuthProviderCompatible:!!(i!=null&&i.isLegacy)}),[d,l]=(0,st.useState)(""),[c,T]=(0,st.useState)(""),y=st.default.createElement("div",{...t},st.default.createElement("h1",{style:{textAlign:"center"}},n("pages.updatePassword.title","Update Password")),st.default.createElement("hr",null),st.default.createElement("form",{onSubmit:h=>{h.preventDefault(),s({password:d,confirmPassword:c})},...o},st.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},st.default.createElement("label",{htmlFor:"password-input"},n("pages.updatePassword.fields.password","New Password")),st.default.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:h=>l(h.target.value)}),st.default.createElement("label",{htmlFor:"confirm-password-input"},n("pages.updatePassword.fields.confirmPassword","Confirm New Password")),st.default.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:c,onChange:h=>T(h.target.value)}),st.default.createElement("input",{type:"submit",disabled:v,value:n("pages.updatePassword.buttons.submit","Update")}))));return st.default.createElement("div",{...e},r?r(y,a):y)},Vc=e=>{let{type:t}=e;return Nr.default.createElement(Nr.default.Fragment,null,(()=>{switch(t){case"register":return Nr.default.createElement(Uc,{...e});case"forgotPassword":return Nr.default.createElement(qc,{...e});case"updatePassword":return Nr.default.createElement(Oc,{...e});default:return Nr.default.createElement(Nc,{...e})}})())},tt=$(u("react")),Es=()=>tt.default.createElement(tt.default.Fragment,null,tt.default.createElement("h1",null,"Welcome on board"),tt.default.createElement("p",null,"Your configuration is completed."),tt.default.createElement("p",null,"Now you can get started by adding your resources to the"," ",tt.default.createElement("code",null,"`resources`")," property of ",tt.default.createElement("code",null,"`<Refine>`")),tt.default.createElement("div",{style:{display:"flex",gap:8}},tt.default.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Documentation")),tt.default.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Examples")),tt.default.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Community")))),ae=$(u("react")),Hc=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:ae.default.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a1 1 0 0 0-1-1H3a1 1 0 0 1 0-2h10a1 1 0 1 0 0-2H2Z",fill:"#fff"}))},{title:"Tutorial",description:"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",link:"https://refine.dev/docs/tutorial/introduction/index/",icon:ae.default.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M0 4.573c0-.475.163-.948.53-1.25a4.57 4.57 0 0 1 .854-.553L5.956.485a4.571 4.571 0 0 1 4.088 0l4.572 2.285c.308.154.594.34.853.553.306.251.47.62.517 1.01.01.055.014.112.014.169v6.5a1 1 0 0 1-2 0V6.684l-3.956 1.978a4.571 4.571 0 0 1-4.088 0L1.384 6.376a4.57 4.57 0 0 1-.853-.553C.163 5.522 0 5.05 0 4.573Z",fill:"#fff"}),ae.default.createElement("path",{d:"M5.061 13.305 3 12.274V9.42l2.061 1.031a6.571 6.571 0 0 0 5.878 0L13 9.421v2.853l-2.061 1.03a6.571 6.571 0 0 1-5.878 0Z",fill:"#fff"}))},{title:"Examples",description:"A collection of reference applications you can use as a starting point.",link:"https://refine.dev/examples",icon:ae.default.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4H0V2Zm3 2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#fff"}),ae.default.createElement("path",{d:"M0 14V8h16v6a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2Z",fill:"#fff"}))},{title:"Community",description:"Join our Discord community and keep up with the latest news.",link:"https://discord.gg/refine",icon:ae.default.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M13.553 1.005A13.334 13.334 0 0 0 10.253 0c-.156.276-.298.56-.423.85a12.42 12.42 0 0 0-3.664 0A8.975 8.975 0 0 0 5.744 0 13.43 13.43 0 0 0 2.44 1.007C.351 4.066-.215 7.05.068 9.99A13.36 13.36 0 0 0 4.116 12c.328-.436.618-.9.867-1.384a8.647 8.647 0 0 1-1.365-.645c.115-.082.227-.167.335-.249a9.594 9.594 0 0 0 8.094 0c.11.089.222.173.335.25-.436.254-.894.47-1.368.646.249.484.539.946.867 1.382a13.3 13.3 0 0 0 4.051-2.01c.332-3.41-.568-6.365-2.379-8.985Zm-8.21 7.176c-.79 0-1.442-.709-1.442-1.58 0-.872.63-1.587 1.439-1.587s1.456.715 1.442 1.586c-.014.872-.636 1.58-1.44 1.58Zm5.315 0c-.79 0-1.44-.709-1.44-1.58 0-.872.63-1.587 1.44-1.587.81 0 1.452.715 1.438 1.586-.014.872-.634 1.58-1.438 1.58Z",fill:"#fff"}))}],Qc=()=>{let e=ai("(max-width: 1010px)"),t=ai("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",a=()=>t?"16px":e?"20px":"24px";return ae.default.createElement("div",{style:{backgroundImage:"url(https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-page.webp)",backgroundPosition:"center top",backgroundSize:"cover",backgroundRepeat:"no-repeat",minHeight:"100vh",backgroundColor:"#0D0D12",fontFamily:"Arial",color:"#FFFFFF"}},ae.default.createElement("div",{style:{height:"89px"}}),ae.default.createElement("div",{style:{display:"flex",justifyContent:"center"}},ae.default.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),ae.default.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),ae.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},ae.default.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),ae.default.createElement("h4",{style:{fontSize:a(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),ae.default.createElement("div",{style:{height:"64px"}}),ae.default.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},Hc.map(n=>ae.default.createElement($c,{key:`welcome-page-${n.title}`,card:n}))),ae.default.createElement("div",{style:{height:"64px"}}))},$c=({card:e})=>{let{title:t,description:r,icon:o,link:a}=e,[n,i]=(0,ae.useState)(!1);return ae.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},ae.default.createElement("div",{style:{display:"flex",alignItems:"center"}},ae.default.createElement("a",{onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:a},o,ae.default.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),ae.default.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...n&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z",fill:"#fff"})))),ae.default.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))},$a=u("@tanstack/react-query"),ge=$(u("react")),wi=$(u("react")),Tr=u("react"),zc="4.33.0",Wc=()=>{var e;let t=qi(),r=(0,Tr.useContext)(Jo),o=(0,Tr.useContext)(So),a=(0,Tr.useContext)(pn),n=(0,Tr.useContext)(un),{i18nProvider:i}=(0,Tr.useContext)(xr),s=(0,Tr.useContext)(dn),v=(0,Tr.useContext)(Fo),{resources:d}=ne(),l=pt(),c=!!r.create||!!r.get||!!r.update,T=!!(o!=null&&o.publish)||!!(o!=null&&o.subscribe)||!!(o!=null&&o.unsubscribe),y=!!a.useHistory||!!a.Link||!!a.Prompt||!!a.useLocation||!!a.useParams,h=!!n,p=!!(i!=null&&i.changeLocale)||!!(i!=null&&i.getLocale)||!!(i!=null&&i.translate),f=!!s.close||!!s.open,b=!!v.can,g=(e=l==null?void 0:l.options)==null?void 0:e.projectId;return{providers:{auth:t,auditLog:c,live:T,router:y,data:h,i18n:p,notification:f,accessControl:b},version:zc,resourceCount:d.length,projectId:g}},jc=e=>{try{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")}catch{return}},Kc=e=>{let t=new Image;t.src=e},Gc=e=>{fetch(e)},_c=e=>{typeof Image<"u"?Kc(e):typeof fetch<"u"&&Gc(e)},Yc=()=>{let e=Wc(),t=wi.default.useRef(!1);return wi.default.useEffect(()=>{if(t.current)return;let r=jc(e);r&&(_c(`https://telemetry.refine.dev/telemetry?payload=${r}`),t.current=!0)},[]),null},Zc=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(o=>!t.includes(o));return r.length>0?(console.warn(`Unsupported properties are found in \`routerProvider\` prop. You provided \`${r.join(", ")}\`. Supported properties are \`${t.join(", ")}\`. You may wanted to use \`legacyRouterProvider\` prop instead.`),!0):!1},Fi=$(u("react")),Xc=e=>{let t=Fi.default.useRef(!1);Fi.default.useEffect(()=>{t.current===!1&&e&&Zc(e)&&(t.current=!0)},[e])},Jc=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:a,notificationProvider:n,accessControlProvider:i,auditLogProvider:s,resources:v,DashboardPage:d,ReadyPage:l,LoginPage:c,catchAll:T,children:y,liveProvider:h,i18nProvider:p,Title:f,Layout:b,Sider:g,Header:S,Footer:m,OffLayoutArea:P,onLiveEvent:x,options:E})=>{let{optionsWithDefaults:M,disableTelemetryWithDefault:C,reactQueryWithDefaults:w}=ed({options:E}),D=ls(()=>{var L;return w.clientConfig instanceof $a.QueryClient?w.clientConfig:new $a.QueryClient({...w.clientConfig,defaultOptions:{...w.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(L=w.clientConfig.defaultOptions)==null?void 0:L.queries}}})},[w.clientConfig]),k=ge.default.useMemo(()=>typeof n=="function"?n:()=>n??{},[n])();if(Xc(a),o&&!a&&(v??[]).length===0)return l?ge.default.createElement(l,null):ge.default.createElement(Es,null);let{RouterComponent:A=ge.default.Fragment}=a?{}:o??{};return ge.default.createElement($a.QueryClientProvider,{client:D},ge.default.createElement(jd,{...k},ge.default.createElement(Lu,{...e??{},isProvided:!!e},ge.default.createElement(wu,{...t??{},isProvided:!!t},ge.default.createElement(wd,{...r},ge.default.createElement(Bd,{liveProvider:h},ge.default.createElement(qd,{value:o&&!a?"legacy":"new"},ge.default.createElement(Vd,{router:a},ge.default.createElement(fc,{...o},ge.default.createElement(Ud,{resources:v??[]},ge.default.createElement(Gd,{i18nProvider:p},ge.default.createElement(gc,{...i??{}},ge.default.createElement(Sc,{...s??{}},ge.default.createElement(yd,null,ge.default.createElement(Ju,{mutationMode:M.mutationMode,warnWhenUnsavedChanges:M.warnWhenUnsavedChanges,syncWithLocation:M.syncWithLocation,Title:f,undoableTimeout:M.undoableTimeout,catchAll:T,DashboardPage:d,LoginPage:c,Layout:b,Sider:g,Footer:m,Header:S,OffLayoutArea:P,hasDashboard:!!d,liveMode:M.liveMode,onLiveEvent:x,options:M},ge.default.createElement(id,null,ge.default.createElement(A,null,y,!C&&ge.default.createElement(Yc,null),ge.default.createElement(ws,null))))))))))))))))))},ki=u("react"),Ls=({notification:e})=>{let t=he(),{notificationDispatch:r}=Hr(),{open:o}=rr(),[a,n]=(0,ki.useState)(),i=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||o==null||o({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:Ma(e.seconds)},`You have ${Ma(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:Ma(e.seconds)}),e.seconds>0)){a&&clearTimeout(a);let s=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);n(s)}};return(0,ki.useEffect)(()=>{i()},[e]),null},_o=$(u("react")),ep=({children:e,Layout:t,Sider:r,Header:o,Title:a,Footer:n,OffLayoutArea:i})=>{let{Layout:s,Footer:v,Header:d,Sider:l,Title:c,OffLayoutArea:T}=pt();return _o.default.createElement(t??s,{Sider:r??l,Header:o??d,Footer:n??v,Title:a??c,OffLayoutArea:i??T},e,_o.default.createElement(tp,null))},tp=()=>{let{Prompt:e}=ft(),t=he(),{warnWhen:r,setWarnWhen:o}=on(),a=n=>(n.preventDefault(),n.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),n.returnValue);return(0,_o.useEffect)(()=>(r&&window.addEventListener("beforeunload",a),window.removeEventListener("beforeunload",a)),[r]),_o.default.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})},ut=$(u("react")),rp=()=>{let e=Pt(),[t,r]=ut.default.useState(void 0);return ut.default.useEffect(()=>{t&&e(t)},[t]),ut.default.useCallback(o=>{t||r(o)},[t])};function op({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:a}){var n;let i=qe(),s=Oe(),v=!!(i!=null&&i.isProvided),d=!!(i!=null&&i.isLegacy),l=s==="legacy",c=Rt(),T=Pt(),y=rp(),{replace:h}=Ct(),{useLocation:p}=ft(),f=p(),{isLoading:b,isFetching:g,isSuccess:S,data:{authenticated:m,redirectTo:P}={},refetch:x}=Ja({v3LegacyAuthProviderCompatible:d});ut.default.useEffect(()=>{x()},[r,o]);let E=ut.default.useRef({status:b?"initial":"pending",content:a??null});g?E.current.status="pending":g||(E.current.status="settled");let M=v?d?S:m:!0;if(E.current.status==="settled")if(M)E.current.content=ut.default.createElement(ut.default.Fragment,null,r??null);else if(typeof o<"u")E.current.content=ut.default.createElement(ut.default.Fragment,null,o);else{let C=`${l?f==null?void 0:f.pathname:c.pathname}`.replace(/(\?.*|#.*)$/,""),w=d?typeof e=="string"?e:"/login":typeof e=="string"?e:P;if(w)if(l){let D=t?`?to=${encodeURIComponent(C)}`:"";h(`${w}${D}`)}else y({to:w,query:t?{to:(n=c.params)!=null&&n.to?c.params.to:T({to:C,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return v?ut.default.createElement(ut.default.Fragment,null,E.current.content):ut.default.createElement(ut.default.Fragment,null,r??null)}var ap=u("react"),ws=()=>{let{useLocation:e}=ft(),{checkAuth:t}=Tt(),r=e();return(0,ap.useEffect)(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null},Ur=$(u("react")),np=({resource:e,action:t,params:r,fallback:o,children:a,...n})=>{let{resource:i,id:s,action:v}=ne(e),{identifier:d}=ne(),l=(()=>{let T=(r==null?void 0:r.id)??s;return e&&e!==d?r==null?void 0:r.id:T})(),{data:c}=Cs({resource:e??(i==null?void 0:i.name),action:t??v??"",params:r??{id:l,resource:i}});return c!=null&&c.can?Ur.default.isValidElement(a)?Ur.default.cloneElement(a,n):Ur.default.createElement(Ur.default.Fragment,null,a):(c==null?void 0:c.can)===!1?Ur.default.createElement(Ur.default.Fragment,null,o??null):null},Pr=$(u("react")),ip=[`
|
11
|
+
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),d.push({label:a(`buttons.${s}`,v.humanize(s))})):d.push({label:a(c,v.humanize(s))})}return{breadcrumbs:d}},Qa=$(u("react")),Go=(e,t,r=!1)=>{let o=[],a=er(e,t);for(;a;)o.push(a),a=er(a,t);return o.reverse(),`/${[...o,e].map(n=>zt((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`},Ac=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(a=>{let n=[],i=er(a,e);for(;i;)n.push(i),i=er(i,e);n.reverse();let s=r;n.forEach(d=>{let l=(t?d.route:void 0)??d.identifier??d.name;s.children[l]||(s.children[l]={item:d,children:{}}),s=s.children[l]});let v=(t?a.route:void 0)??a.identifier??a.name;s.children[v]||(s.children[v]={item:a,children:{}})});let o=a=>{let n=[];return Object.keys(a.children).forEach(i=>{let s=Go(a.children[i].item,e,t),v={...a.children[i].item,key:s,children:o(a.children[i])};n.push(v)}),n};return o(r)},Li=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),Mc=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=he(),o=cn(),a=Oe(),{resource:n,resources:i}=ne(),{pathname:s}=Rt(),{useLocation:v}=ft(),{pathname:d}=v(),l=an(),c=`/${((a==="legacy"?Li(d):s?Li(s):void 0)??"").replace(/^\//,"")}`,T=n?Go(n,i,a==="legacy"):c??"",y=Qa.default.useMemo(()=>{if(!n)return[];let f=er(n,i),b=[Go(n,i)];for(;f;)b.push(Go(f,i)),f=er(f,i);return b},[]),h=Qa.default.useCallback(f=>{var b,g,S,m,P,x;if((((b=f==null?void 0:f.meta)==null?void 0:b.hide)??((g=f==null?void 0:f.options)==null?void 0:g.hide))||!(f!=null&&f.list)&&f.children.length===0)return;let E=f.list?o({resource:f,action:"list",legacy:a==="legacy",meta:e}):void 0;if(!(t&&E&&E.match(/(\/|^):(.+?)(\/|$){1}/)))return{...f,route:E,icon:Q((S=f.meta)==null?void 0:S.icon,(m=f.options)==null?void 0:m.icon,f.icon),label:Q((P=f==null?void 0:f.meta)==null?void 0:P.label,(x=f==null?void 0:f.options)==null?void 0:x.label)??r(`${f.name}.${f.name}`,l(f.name,"plural"))}},[a,e,r,t]),p=Qa.default.useMemo(()=>{let f=Ac(i,a==="legacy"),b=g=>g.flatMap(S=>{let m=b(S.children),P=h({...S,children:m});return P?[P]:[]});return b(f)},[i,a,h]);return{defaultOpenKeys:y,selectedKey:T,menuItems:p}},Re=()=>{let{params:e}=Rt();return({resource:t,meta:r}={})=>{let{meta:o}=mn(t)??{meta:{}},{filters:a,sorters:n,current:i,pageSize:s,...v}=e??{};return{...o,...v,...r}}},Ic=()=>{let[e,t]=(0,hr.useState)(),r=he(),{push:o}=Ct(),a=Pt(),n=Oe(),{resource:i,action:s}=ne();return(0,hr.useEffect)(()=>{i&&s&&t(r("pages.error.info",{action:s,resource:i.name},`You may have forgotten to add the "${s}" component to "${i.name}" resource.`))},[i,s]),hr.default.createElement(hr.default.Fragment,null,hr.default.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&hr.default.createElement("p",null,e),hr.default.createElement("button",{onClick:()=>{n==="legacy"?o("/"):a({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))},Ue=$(u("react")),Ss=()=>{let[e,t]=(0,Ue.useState)(""),[r,o]=(0,Ue.useState)(""),a=he(),n=qe(),{mutate:i}=Xa({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)});return Ue.default.createElement(Ue.default.Fragment,null,Ue.default.createElement("h1",null,a("pages.login.title","Sign in your account")),Ue.default.createElement("form",{onSubmit:s=>{s.preventDefault(),i({username:e,password:r})}},Ue.default.createElement("table",null,Ue.default.createElement("tbody",null,Ue.default.createElement("tr",null,Ue.default.createElement("td",null,a("pages.login.username",void 0,"username"),":"),Ue.default.createElement("td",null,Ue.default.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:s=>t(s.target.value)}))),Ue.default.createElement("tr",null,Ue.default.createElement("td",null,a("pages.login.password",void 0,"password"),":"),Ue.default.createElement("td",null,Ue.default.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:s=>o(s.target.value)}))))),Ue.default.createElement("br",null),Ue.default.createElement("input",{type:"submit",value:"login"})))},Nr=$(u("react")),ve=$(u("react")),Nc=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:a,wrapperProps:n,renderContent:i,formProps:s,title:v=void 0})=>{let d=Oe(),l=Xo(),{Link:c}=ft(),T=d==="legacy"?c:l,[y,h]=(0,ve.useState)(""),[p,f]=(0,ve.useState)(""),[b,g]=(0,ve.useState)(!1),S=he(),m=qe(),{mutate:P}=Xa({v3LegacyAuthProviderCompatible:!!(m!=null&&m.isLegacy)}),x=(C,w)=>ve.default.createElement(T,{to:C},w),E=()=>e?e.map(C=>ve.default.createElement("div",{key:C.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ve.default.createElement("button",{onClick:()=>P({providerName:C.name}),style:{display:"flex",alignItems:"center"}},C==null?void 0:C.icon,C.label??ve.default.createElement("label",null,C.label)))):null,M=ve.default.createElement("div",{...a},ve.default.createElement("h1",{style:{textAlign:"center"}},S("pages.login.title","Sign in to your account")),E(),ve.default.createElement("hr",null),ve.default.createElement("form",{onSubmit:C=>{C.preventDefault(),P({email:y,password:p,remember:b})},...s},ve.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ve.default.createElement("label",{htmlFor:"email-input"},S("pages.login.fields.email","Email")),ve.default.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:y,onChange:C=>h(C.target.value)}),ve.default.createElement("label",{htmlFor:"password-input"},S("pages.login.fields.password","Password")),ve.default.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:p,onChange:C=>f(C.target.value)}),o??ve.default.createElement(ve.default.Fragment,null,ve.default.createElement("label",{htmlFor:"remember-me-input"},S("pages.login.buttons.rememberMe","Remember me"),ve.default.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:b,value:b.toString(),onChange:()=>{g(!b)}}))),ve.default.createElement("br",null),r??x("/forgot-password",S("pages.login.buttons.forgotPassword","Forgot password?")),ve.default.createElement("input",{type:"submit",value:S("pages.login.signin","Sign in")}),t??ve.default.createElement("span",null,S("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",x("/register",S("pages.login.register","Sign up"))))));return ve.default.createElement("div",{...n},i?i(M,v):M)},we=$(u("react")),Uc=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:a,formProps:n,title:i=void 0})=>{let s=Oe(),v=Xo(),{Link:d}=ft(),l=s==="legacy"?d:v,[c,T]=(0,we.useState)(""),[y,h]=(0,we.useState)(""),p=he(),f=qe(),{mutate:b,isLoading:g}=Ii({v3LegacyAuthProviderCompatible:!!(f!=null&&f.isLegacy)}),S=(x,E)=>we.default.createElement(l,{to:x},E),m=()=>e?e.map(x=>we.default.createElement("div",{key:x.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},we.default.createElement("button",{onClick:()=>b({providerName:x.name}),style:{display:"flex",alignItems:"center"}},x==null?void 0:x.icon,x.label??we.default.createElement("label",null,x.label)))):null,P=we.default.createElement("div",{...o},we.default.createElement("h1",{style:{textAlign:"center"}},p("pages.register.title","Sign up for your account")),m(),we.default.createElement("hr",null),we.default.createElement("form",{onSubmit:x=>{x.preventDefault(),b({email:c,password:y})},...n},we.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},we.default.createElement("label",{htmlFor:"email-input"},p("pages.register.fields.email","Email")),we.default.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:x=>T(x.target.value)}),we.default.createElement("label",{htmlFor:"password-input"},p("pages.register.fields.password","Password")),we.default.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:y,onChange:x=>h(x.target.value)}),we.default.createElement("input",{type:"submit",value:p("pages.register.buttons.submit","Sign up"),disabled:g}),t??we.default.createElement(we.default.Fragment,null,we.default.createElement("span",null,p("pages.login.buttons.haveAccount","Have an account?")," ",S("/login",p("pages.login.signin","Sign in")))))));return we.default.createElement("div",{...r},a?a(P,i):P)},it=$(u("react")),qc=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:a,title:n=void 0})=>{let i=he(),s=Oe(),v=Xo(),{Link:d}=ft(),l=s==="legacy"?d:v,[c,T]=(0,it.useState)(""),{mutate:y,isLoading:h}=Ni(),p=(b,g)=>it.default.createElement(l,{to:b},g),f=it.default.createElement("div",{...r},it.default.createElement("h1",{style:{textAlign:"center"}},i("pages.forgotPassword.title","Forgot your password?")),it.default.createElement("hr",null),it.default.createElement("form",{onSubmit:b=>{b.preventDefault(),y({email:c})},...a},it.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},it.default.createElement("label",{htmlFor:"email-input"},i("pages.forgotPassword.fields.email","Email")),it.default.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:b=>T(b.target.value)}),it.default.createElement("input",{type:"submit",disabled:h,value:i("pages.forgotPassword.buttons.submit","Send reset instructions")}),it.default.createElement("br",null),e??it.default.createElement("span",null,i("pages.register.buttons.haveAccount","Have an account? ")," ",p("/login",i("pages.login.signin","Sign in"))))));return it.default.createElement("div",{...t},o?o(f,n):f)},st=$(u("react")),Oc=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:a=void 0})=>{let n=he(),i=qe(),{mutate:s,isLoading:v}=Ui({v3LegacyAuthProviderCompatible:!!(i!=null&&i.isLegacy)}),[d,l]=(0,st.useState)(""),[c,T]=(0,st.useState)(""),y=st.default.createElement("div",{...t},st.default.createElement("h1",{style:{textAlign:"center"}},n("pages.updatePassword.title","Update Password")),st.default.createElement("hr",null),st.default.createElement("form",{onSubmit:h=>{h.preventDefault(),s({password:d,confirmPassword:c})},...o},st.default.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},st.default.createElement("label",{htmlFor:"password-input"},n("pages.updatePassword.fields.password","New Password")),st.default.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:h=>l(h.target.value)}),st.default.createElement("label",{htmlFor:"confirm-password-input"},n("pages.updatePassword.fields.confirmPassword","Confirm New Password")),st.default.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:c,onChange:h=>T(h.target.value)}),st.default.createElement("input",{type:"submit",disabled:v,value:n("pages.updatePassword.buttons.submit","Update")}))));return st.default.createElement("div",{...e},r?r(y,a):y)},Vc=e=>{let{type:t}=e;return Nr.default.createElement(Nr.default.Fragment,null,(()=>{switch(t){case"register":return Nr.default.createElement(Uc,{...e});case"forgotPassword":return Nr.default.createElement(qc,{...e});case"updatePassword":return Nr.default.createElement(Oc,{...e});default:return Nr.default.createElement(Nc,{...e})}})())},tt=$(u("react")),Es=()=>tt.default.createElement(tt.default.Fragment,null,tt.default.createElement("h1",null,"Welcome on board"),tt.default.createElement("p",null,"Your configuration is completed."),tt.default.createElement("p",null,"Now you can get started by adding your resources to the"," ",tt.default.createElement("code",null,"`resources`")," property of ",tt.default.createElement("code",null,"`<Refine>`")),tt.default.createElement("div",{style:{display:"flex",gap:8}},tt.default.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Documentation")),tt.default.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Examples")),tt.default.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},tt.default.createElement("button",null,"Community")))),ae=$(u("react")),Hc=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:ae.default.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a1 1 0 0 0-1-1H3a1 1 0 0 1 0-2h10a1 1 0 1 0 0-2H2Z",fill:"#fff"}))},{title:"Tutorial",description:"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",link:"https://refine.dev/docs/tutorial/introduction/index/",icon:ae.default.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M0 4.573c0-.475.163-.948.53-1.25a4.57 4.57 0 0 1 .854-.553L5.956.485a4.571 4.571 0 0 1 4.088 0l4.572 2.285c.308.154.594.34.853.553.306.251.47.62.517 1.01.01.055.014.112.014.169v6.5a1 1 0 0 1-2 0V6.684l-3.956 1.978a4.571 4.571 0 0 1-4.088 0L1.384 6.376a4.57 4.57 0 0 1-.853-.553C.163 5.522 0 5.05 0 4.573Z",fill:"#fff"}),ae.default.createElement("path",{d:"M5.061 13.305 3 12.274V9.42l2.061 1.031a6.571 6.571 0 0 0 5.878 0L13 9.421v2.853l-2.061 1.03a6.571 6.571 0 0 1-5.878 0Z",fill:"#fff"}))},{title:"Examples",description:"A collection of reference applications you can use as a starting point.",link:"https://refine.dev/examples",icon:ae.default.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4H0V2Zm3 2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#fff"}),ae.default.createElement("path",{d:"M0 14V8h16v6a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2Z",fill:"#fff"}))},{title:"Community",description:"Join our Discord community and keep up with the latest news.",link:"https://discord.gg/refine",icon:ae.default.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M13.553 1.005A13.334 13.334 0 0 0 10.253 0c-.156.276-.298.56-.423.85a12.42 12.42 0 0 0-3.664 0A8.975 8.975 0 0 0 5.744 0 13.43 13.43 0 0 0 2.44 1.007C.351 4.066-.215 7.05.068 9.99A13.36 13.36 0 0 0 4.116 12c.328-.436.618-.9.867-1.384a8.647 8.647 0 0 1-1.365-.645c.115-.082.227-.167.335-.249a9.594 9.594 0 0 0 8.094 0c.11.089.222.173.335.25-.436.254-.894.47-1.368.646.249.484.539.946.867 1.382a13.3 13.3 0 0 0 4.051-2.01c.332-3.41-.568-6.365-2.379-8.985Zm-8.21 7.176c-.79 0-1.442-.709-1.442-1.58 0-.872.63-1.587 1.439-1.587s1.456.715 1.442 1.586c-.014.872-.636 1.58-1.44 1.58Zm5.315 0c-.79 0-1.44-.709-1.44-1.58 0-.872.63-1.587 1.44-1.587.81 0 1.452.715 1.438 1.586-.014.872-.634 1.58-1.438 1.58Z",fill:"#fff"}))}],Qc=()=>{let e=ai("(max-width: 1010px)"),t=ai("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",a=()=>t?"16px":e?"20px":"24px";return ae.default.createElement("div",{style:{backgroundImage:"url(https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-page.webp)",backgroundPosition:"center top",backgroundSize:"cover",backgroundRepeat:"no-repeat",minHeight:"100vh",backgroundColor:"#0D0D12",fontFamily:"Arial",color:"#FFFFFF"}},ae.default.createElement("div",{style:{height:"89px"}}),ae.default.createElement("div",{style:{display:"flex",justifyContent:"center"}},ae.default.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),ae.default.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),ae.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},ae.default.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),ae.default.createElement("h4",{style:{fontSize:a(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),ae.default.createElement("div",{style:{height:"64px"}}),ae.default.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},Hc.map(n=>ae.default.createElement($c,{key:`welcome-page-${n.title}`,card:n}))),ae.default.createElement("div",{style:{height:"64px"}}))},$c=({card:e})=>{let{title:t,description:r,icon:o,link:a}=e,[n,i]=(0,ae.useState)(!1);return ae.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},ae.default.createElement("div",{style:{display:"flex",alignItems:"center"}},ae.default.createElement("a",{onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:a},o,ae.default.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),ae.default.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...n&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},ae.default.createElement("path",{d:"M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z",fill:"#fff"})))),ae.default.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))},$a=u("@tanstack/react-query"),ge=$(u("react")),wi=$(u("react")),Tr=u("react"),zc="4.34.0",Wc=()=>{var e;let t=qi(),r=(0,Tr.useContext)(Jo),o=(0,Tr.useContext)(So),a=(0,Tr.useContext)(pn),n=(0,Tr.useContext)(un),{i18nProvider:i}=(0,Tr.useContext)(xr),s=(0,Tr.useContext)(dn),v=(0,Tr.useContext)(Fo),{resources:d}=ne(),l=pt(),c=!!r.create||!!r.get||!!r.update,T=!!(o!=null&&o.publish)||!!(o!=null&&o.subscribe)||!!(o!=null&&o.unsubscribe),y=!!a.useHistory||!!a.Link||!!a.Prompt||!!a.useLocation||!!a.useParams,h=!!n,p=!!(i!=null&&i.changeLocale)||!!(i!=null&&i.getLocale)||!!(i!=null&&i.translate),f=!!s.close||!!s.open,b=!!v.can,g=(e=l==null?void 0:l.options)==null?void 0:e.projectId;return{providers:{auth:t,auditLog:c,live:T,router:y,data:h,i18n:p,notification:f,accessControl:b},version:zc,resourceCount:d.length,projectId:g}},jc=e=>{try{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")}catch{return}},Kc=e=>{let t=new Image;t.src=e},Gc=e=>{fetch(e)},_c=e=>{typeof Image<"u"?Kc(e):typeof fetch<"u"&&Gc(e)},Yc=()=>{let e=Wc(),t=wi.default.useRef(!1);return wi.default.useEffect(()=>{if(t.current)return;let r=jc(e);r&&(_c(`https://telemetry.refine.dev/telemetry?payload=${r}`),t.current=!0)},[]),null},Zc=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(o=>!t.includes(o));return r.length>0?(console.warn(`Unsupported properties are found in \`routerProvider\` prop. You provided \`${r.join(", ")}\`. Supported properties are \`${t.join(", ")}\`. You may wanted to use \`legacyRouterProvider\` prop instead.`),!0):!1},Fi=$(u("react")),Xc=e=>{let t=Fi.default.useRef(!1);Fi.default.useEffect(()=>{t.current===!1&&e&&Zc(e)&&(t.current=!0)},[e])},Jc=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:a,notificationProvider:n,accessControlProvider:i,auditLogProvider:s,resources:v,DashboardPage:d,ReadyPage:l,LoginPage:c,catchAll:T,children:y,liveProvider:h,i18nProvider:p,Title:f,Layout:b,Sider:g,Header:S,Footer:m,OffLayoutArea:P,onLiveEvent:x,options:E})=>{let{optionsWithDefaults:M,disableTelemetryWithDefault:C,reactQueryWithDefaults:w}=ed({options:E}),D=ls(()=>{var L;return w.clientConfig instanceof $a.QueryClient?w.clientConfig:new $a.QueryClient({...w.clientConfig,defaultOptions:{...w.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(L=w.clientConfig.defaultOptions)==null?void 0:L.queries}}})},[w.clientConfig]),k=ge.default.useMemo(()=>typeof n=="function"?n:()=>n??{},[n])();if(Xc(a),o&&!a&&(v??[]).length===0)return l?ge.default.createElement(l,null):ge.default.createElement(Es,null);let{RouterComponent:A=ge.default.Fragment}=a?{}:o??{};return ge.default.createElement($a.QueryClientProvider,{client:D},ge.default.createElement(jd,{...k},ge.default.createElement(Lu,{...e??{},isProvided:!!e},ge.default.createElement(wu,{...t??{},isProvided:!!t},ge.default.createElement(wd,{...r},ge.default.createElement(Bd,{liveProvider:h},ge.default.createElement(qd,{value:o&&!a?"legacy":"new"},ge.default.createElement(Vd,{router:a},ge.default.createElement(fc,{...o},ge.default.createElement(Ud,{resources:v??[]},ge.default.createElement(Gd,{i18nProvider:p},ge.default.createElement(gc,{...i??{}},ge.default.createElement(Sc,{...s??{}},ge.default.createElement(yd,null,ge.default.createElement(Ju,{mutationMode:M.mutationMode,warnWhenUnsavedChanges:M.warnWhenUnsavedChanges,syncWithLocation:M.syncWithLocation,Title:f,undoableTimeout:M.undoableTimeout,catchAll:T,DashboardPage:d,LoginPage:c,Layout:b,Sider:g,Footer:m,Header:S,OffLayoutArea:P,hasDashboard:!!d,liveMode:M.liveMode,onLiveEvent:x,options:M},ge.default.createElement(id,null,ge.default.createElement(A,null,y,!C&&ge.default.createElement(Yc,null),ge.default.createElement(ws,null))))))))))))))))))},ki=u("react"),Ls=({notification:e})=>{let t=he(),{notificationDispatch:r}=Hr(),{open:o}=rr(),[a,n]=(0,ki.useState)(),i=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||o==null||o({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:Ma(e.seconds)},`You have ${Ma(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:Ma(e.seconds)}),e.seconds>0)){a&&clearTimeout(a);let s=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);n(s)}};return(0,ki.useEffect)(()=>{i()},[e]),null},_o=$(u("react")),ep=({children:e,Layout:t,Sider:r,Header:o,Title:a,Footer:n,OffLayoutArea:i})=>{let{Layout:s,Footer:v,Header:d,Sider:l,Title:c,OffLayoutArea:T}=pt();return _o.default.createElement(t??s,{Sider:r??l,Header:o??d,Footer:n??v,Title:a??c,OffLayoutArea:i??T},e,_o.default.createElement(tp,null))},tp=()=>{let{Prompt:e}=ft(),t=he(),{warnWhen:r,setWarnWhen:o}=on(),a=n=>(n.preventDefault(),n.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),n.returnValue);return(0,_o.useEffect)(()=>(r&&window.addEventListener("beforeunload",a),window.removeEventListener("beforeunload",a)),[r]),_o.default.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})},ut=$(u("react")),rp=()=>{let e=Pt(),[t,r]=ut.default.useState(void 0);return ut.default.useEffect(()=>{t&&e(t)},[t]),ut.default.useCallback(o=>{t||r(o)},[t])};function op({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:a}){var n;let i=qe(),s=Oe(),v=!!(i!=null&&i.isProvided),d=!!(i!=null&&i.isLegacy),l=s==="legacy",c=Rt(),T=Pt(),y=rp(),{replace:h}=Ct(),{useLocation:p}=ft(),f=p(),{isLoading:b,isFetching:g,isSuccess:S,data:{authenticated:m,redirectTo:P}={},refetch:x}=Ja({v3LegacyAuthProviderCompatible:d});ut.default.useEffect(()=>{x()},[r,o]);let E=ut.default.useRef({status:b?"initial":"pending",content:a??null});g?E.current.status="pending":g||(E.current.status="settled");let M=v?d?S:m:!0;if(E.current.status==="settled")if(M)E.current.content=ut.default.createElement(ut.default.Fragment,null,r??null);else if(typeof o<"u")E.current.content=ut.default.createElement(ut.default.Fragment,null,o);else{let C=`${l?f==null?void 0:f.pathname:c.pathname}`.replace(/(\?.*|#.*)$/,""),w=d?typeof e=="string"?e:"/login":typeof e=="string"?e:P;if(w)if(l){let D=t?`?to=${encodeURIComponent(C)}`:"";h(`${w}${D}`)}else y({to:w,query:t?{to:(n=c.params)!=null&&n.to?c.params.to:T({to:C,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return v?ut.default.createElement(ut.default.Fragment,null,E.current.content):ut.default.createElement(ut.default.Fragment,null,r??null)}var ap=u("react"),ws=()=>{let{useLocation:e}=ft(),{checkAuth:t}=Tt(),r=e();return(0,ap.useEffect)(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null},Ur=$(u("react")),np=({resource:e,action:t,params:r,fallback:o,children:a,...n})=>{let{resource:i,id:s,action:v}=ne(e),{identifier:d}=ne(),l=(()=>{let T=(r==null?void 0:r.id)??s;return e&&e!==d?r==null?void 0:r.id:T})(),{data:c}=Cs({resource:e??(i==null?void 0:i.name),action:t??v??"",params:r??{id:l,resource:i}});return c!=null&&c.can?Ur.default.isValidElement(a)?Ur.default.cloneElement(a,n):Ur.default.createElement(Ur.default.Fragment,null,a):(c==null?void 0:c.can)===!1?Ur.default.createElement(Ur.default.Fragment,null,o??null):null},Pr=$(u("react")),ip=[`
|
12
12
|
.banner {
|
13
13
|
display: flex;
|
14
14
|
@media (max-width: 1000px) {
|