@refinedev/core 4.23.0 → 4.24.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 CHANGED
@@ -1,5 +1,95 @@
1
1
  # @pankod/refine-core
2
2
 
3
+ ## 4.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#4523](https://github.com/refinedev/refine/pull/4523) [`18d446b1069`](https://github.com/refinedev/refine/commit/18d446b1069c75b5033d0ce8defcb8c32fcce5cf) Thanks [@yildirayunlu](https://github.com/yildirayunlu)! - feat: add `useLoadingOvertime` hook and implement primitive hooks
8
+
9
+ If you need to do something when the loading time exceeds the specified time, refine provides the `useLoadingOvertime` hook. It returns the elapsed time in milliseconds.
10
+
11
+ ```tsx
12
+ const { elapsedTime } = useLoadingOvertime({
13
+ isLoading,
14
+ interval: 1000,
15
+ onInterval(elapsedInterval) {
16
+ console.log("loading overtime", elapsedInterval);
17
+ },
18
+ });
19
+
20
+ console.log(elapsedTime); // 1000, 2000, 3000, ...
21
+ ```
22
+
23
+ This hook implements the primitive data hooks:
24
+
25
+ - [`useCreate`](https://refine.dev/docs/api-reference/core/hooks/data/useCreate/#overtimeoptions)
26
+ - [`useCreateMany`](https://refine.dev/docs/api-reference/core/hooks/data/useCreateMany/#overtimeoptions)
27
+ - [`useCustom`](https://refine.dev/docs/api-reference/core/hooks/data/useCustom/#overtimeoptions)
28
+ - [`useCustomMutation`](https://refine.dev/docs/api-reference/core/hooks/data/useCustomMutation/#overtimeoptions)
29
+ - [`useDelete`](https://refine.dev/docs/api-reference/core/hooks/data/useDelete/#overtimeoptions)
30
+ - [`useDeleteMany`](https://refine.dev/docs/api-reference/core/hooks/data/useDeleteMany/#overtimeoptions)
31
+ - [`useList`](https://refine.dev/docs/api-reference/core/hooks/data/useList/#overtimeoptions)
32
+ - [`useInfiniteList`](https://refine.dev/docs/api-reference/core/hooks/data/useInfiniteList/#overtimeoptions)
33
+ - [`useMany`](https://refine.dev/docs/api-reference/core/hooks/data/useMany/#overtimeoptions)
34
+ - [`useOne`](https://refine.dev/docs/api-reference/core/hooks/data/useOne/#overtimeoptions)
35
+ - [`useUpdate`](https://refine.dev/docs/api-reference/core/hooks/data/useUpdate/#overtimeoptions)
36
+ - [`useUpdateMany`](https://refine.dev/docs/api-reference/core/hooks/data/useUpdateMany/#overtimeoptions)
37
+
38
+ - [#4527](https://github.com/refinedev/refine/pull/4527) [`ceadcd29fc9`](https://github.com/refinedev/refine/commit/ceadcd29fc9e42c875a4b0a78622e9fc14b4ce42) Thanks [@salihozdemir](https://github.com/salihozdemir)! - fix: support multiple `resource` usage with the same name via the `identifier`
39
+
40
+ Previously, data hooks only worked with resource name. So if you had multiple `resource` usage with the same name, it would cause issues.
41
+
42
+ Now the following hooks and its derivatives support `identifier` to distinguish between the resources:
43
+
44
+ - `useList`
45
+ - `useInfiniteList`
46
+ - `useOne`
47
+ - `useMany`
48
+ - `useCreate`
49
+ - `useCreateMany`
50
+ - `useUpdate`
51
+ - `useUpdateMany`
52
+ - `useDelete`
53
+ - `useDeleteMany`
54
+
55
+ fix: generate correct `queryKey`'s for queries with `identifier`
56
+
57
+ Previously, the `queryKey` was generated using `name`. This caused issues when you had multiple `resource` usage with the same name. Now the `queryKey`'s are generated using `identifier` if it's present.
58
+
59
+ - [#4523](https://github.com/refinedev/refine/pull/4523) [`18d446b1069`](https://github.com/refinedev/refine/commit/18d446b1069c75b5033d0ce8defcb8c32fcce5cf) Thanks [@yildirayunlu](https://github.com/yildirayunlu)! - feat: add `useLoadingOvertime` hook
60
+
61
+ if you need to do something when the loading time exceeds the specified time, refine provides the `useLoadingOvertime` hook. It returns the elapsed time in milliseconds.
62
+
63
+ ```tsx
64
+ const { elapsedTime } = useLoadingOvertime({
65
+ isLoading,
66
+ interval: 1000,
67
+ onInterval(elapsedInterval) {
68
+ console.log("loading overtime", elapsedInterval);
69
+ },
70
+ });
71
+ ```
72
+
73
+ `interval` and `onInterval` are optional. It can be controlled globally from `<Refine />` options.
74
+
75
+ ```tsx
76
+ <Refine
77
+ //...
78
+ options={{
79
+ //...
80
+ overtime: {
81
+ interval: 2000, // default 1000
82
+ onInterval(elapsedInterval) {
83
+ console.log(
84
+ "loading overtime",
85
+ elapsedInterval,
86
+ );
87
+ },
88
+ },
89
+ }}
90
+ >
91
+ ```
92
+
3
93
  ## 4.23.0
4
94
 
5
95
  ### Minor Changes
package/dist/esm/index.js CHANGED
@@ -8,7 +8,7 @@ See https://refine.dev/docs/api-reference/core/hooks/useForm/#resource`);let X=U
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 l=Ut({resource:R,id:w??"",queryOptions:{enabled:w!==void 0,...d},successNotification:r,errorNotification:s,meta:h,metaData:h,liveMode:n,onLiveEvent:u,dataProviderName:c}),{elapsedTime:m}=j({isLoading:l.isFetching,interval:p==null?void 0:p.interval,onInterval:p==null?void 0:p.onInterval});return{queryResult:l,showId:w,setShowId:y,overtime:{elapsedTime:m}}};import{useEffect as Ua,useState as Nr}from"react";import{parse as Ma}from"papaparse";import Ia from"lodash-es/chunk";var hT=({resourceName:e,resource:t,mapData:r=p=>p,paparseOptions:s,batchSize:o=Number.MAX_SAFE_INTEGER,onFinish:a,meta:n,metaData:u,onProgress:c,dataProviderName:d}={})=>{let[p,i]=Nr(0),[f,R]=Nr(0),[v,g]=Nr(!1),{resource:x,identifier:b}=F(t??e),w=W(),y=Qr(),h=Mt(),l=w({resource:x,meta:I(n,u)}),m;o===1?m=h:m=y;let L=()=>{R(0),i(0),g(!1)},C=T=>{let E={succeeded:T.filter(D=>D.type==="success"),errored:T.filter(D=>D.type==="error")};a==null||a(E),g(!1)};Ua(()=>{c==null||c({totalAmount:f,processedAmount:p})},[f,p]);let P=({file:T})=>(L(),new Promise(E=>{g(!0),Ma(T,{complete:async({data:D})=>{let A=$t(D,r);if(R(A.length),o===1){let U=A.map(S=>async()=>({response:await h.mutateAsync({resource:b??"",values:S,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:l,metaData:l}),value:S})),M=await Zt(U,({response:S,value:Q})=>(i(O=>O+1),{response:[S.data],type:"success",request:[Q]}),(S,Q)=>({response:[S],type:"error",request:[A[Q]]}));E(M)}else{let U=Ia(A,o),M=U.map(Q=>async()=>({response:await y.mutateAsync({resource:b??"",values:Q,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:l,metaData:l}),value:Q,currentBatchLength:Q.length})),S=await Zt(M,({response:Q,currentBatchLength:O,value:$})=>(i(H=>H+O),{response:Q.data,type:"success",request:$}),(Q,O)=>({response:[Q],type:"error",request:U[O]}));E(S)}},...s})}).then(E=>(C(E),E)));return{inputProps:{type:"file",accept:".csv",onChange:T=>{T.target.files&&T.target.files.length>0&&P({file:T.target.files[0]})}},mutationResult:m,isLoading:v,handleChange:P}};import{useCallback as ts,useState as wa}from"react";var LT=({defaultVisible:e=!1}={})=>{let[t,r]=wa(e),s=ts(()=>r(!0),[t]),o=ts(()=>r(!1),[t]);return{visible:t,show:s,close:o}};import Sa from"react";var At=()=>{let e=z(),{resource:t,resources:r}=F(),s=ce();return Sa.useCallback(({resource:a,action:n,meta:u})=>{var f;let c=a||t;if(!c)return;let p=(f=me(c,r,e==="legacy").find(R=>R.action===n))==null?void 0:f.route;return p?Re(p,c==null?void 0:c.meta,s,u):void 0},[r,t,s])};var Aa=({resource:e,action:t,meta:r,legacy:s})=>At()({resource:e,action:t,meta:r,legacy:s});import Qa,{useContext as Fa}from"react";var nt=()=>{let e=Fa(We);return e!=null&&e.Link?e.Link:({to:r,...s})=>Qa.createElement("a",{href:r,...s})};import{useContext as Va}from"react";import rs from"react";var Ke={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},ka=rs.createContext(Ke),Qt=ka,os=({children:e,useHistory:t,useLocation:r,useParams:s,Prompt:o,Link:a,routes:n})=>rs.createElement(Qt.Provider,{value:{useHistory:t??Ke.useHistory,useLocation:r??Ke.useLocation,useParams:s??Ke.useParams,Prompt:o??Ke.Prompt,Link:a??Ke.Link,routes:n??Ke.routes}},e);var te=()=>{let e=Va(Qt),{useHistory:t,useLocation:r,useParams:s,Prompt:o,Link:a,routes:n}=e??Ke;return{useHistory:t,useLocation:r,useParams:s,Prompt:o,Link:a,routes:n}};import{useQuery as Ba}from"@tanstack/react-query";import{useContext as Na}from"react";import ss from"react";var Xe=ss.createContext({options:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}});var ns=({can:e,children:t,options:r})=>ss.createElement(Xe.Provider,{value:{can:e,options:r?{...r,buttons:{enableAccessControl:!0,hideIfUnauthorized:!1,...r.buttons}}:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}},t);var rr=e=>{let{icon:t,list:r,edit:s,create:o,show:a,clone:n,children:u,meta:c,options:d,...p}=e,{icon:i,...f}=c??{},{icon:R,...v}=d??{};return{...p,...c?{meta:f}:{},...d?{options:v}:{}}};var as=({action:e,resource:t,params:r,queryOptions:s})=>{let{can:o}=Na(Xe),{resource:a,...n}=r??{},u=rr(a??{}),c=Ba(["useCan",{action:e,resource:t,params:{...n,resource:u},enabled:s==null?void 0:s.enabled}],()=>(o==null?void 0:o({action:e,resource:t,params:n}))??Promise.resolve({can:!0}),{enabled:typeof o<"u",...s,retry:!1});return typeof o>"u"?{data:{can:!0}}:c};import{useContext as Ha}from"react";var yR=()=>{let{can:e}=Ha(Xe);return{can:e}};import{useCallback as is,useMemo as Oa,useState as Hr}from"react";import $a from"lodash/uniqBy";import Ga from"lodash/debounce";import or from"lodash/get";var IR=e=>{let[t,r]=Hr([]),[s,o]=Hr([]),[a,n]=Hr([]),{resource:u,sort:c,sorters:d,filters:p=[],optionLabel:i="title",optionValue:f="id",debounce:R=300,successNotification:v,errorNotification:g,defaultValueQueryOptions:x,queryOptions:b,fetchSize:w,pagination:y,hasPagination:h=!1,liveMode:l,defaultValue:m=[],onLiveEvent:L,onSearch:C,liveParams:P,meta:T,metaData:E,dataProviderName:D,overtimeOptions:A}=e,{resource:U,identifier:M}=F(u),Q=W()({resource:U,meta:I(T,E)}),O=Array.isArray(m)?m:[m],$=is(X=>{n(X.data.map(de=>({label:or(de,i),value:or(de,f)})))},[i,f]),H=x??b,Z=Mr({resource:M,ids:O,queryOptions:{...H,enabled:O.length>0&&((H==null?void 0:H.enabled)??!0),onSuccess:X=>{var de;$(X),(de=H==null?void 0:H.onSuccess)==null||de.call(H,X)}},meta:Q,metaData:Q,liveMode:"off",dataProviderName:D}),_=is(X=>{o(X.data.map(de=>({label:or(de,i),value:or(de,f)})))},[i,f]),k=Et({resource:M,sorters:I(d,c),filters:p.concat(t),pagination:{current:y==null?void 0:y.current,pageSize:(y==null?void 0:y.pageSize)??w,mode:y==null?void 0:y.mode},hasPagination:h,queryOptions:{...b,onSuccess:X=>{var de;_(X),(de=b==null?void 0:b.onSuccess)==null||de.call(b,X)}},successNotification:v,errorNotification:g,meta:Q,metaData:Q,liveMode:l,liveParams:P,onLiveEvent:L,dataProviderName:D}),N=X=>{if(C){r(C(X));return}if(X)r([{field:i,operator:"contains",value:X}]);else{r([]);return}},{elapsedTime:K}=j({isLoading:k.isFetching||Z.isFetching,interval:A==null?void 0:A.interval,onInterval:A==null?void 0:A.onInterval});return{queryResult:k,defaultValueQueryResult:Z,options:Oa(()=>$a([...s,...a],"value"),[s,a]),onSearch:Ga(N,R),overtime:{elapsedTime:K}}};import Wa,{useState as sr,useEffect as us}from"react";import cs from"qs";import nr from"lodash/differenceWith";import ar from"lodash/isEqual";import Ka from"warn-once";var ps=[],ds=[];function WR({initialCurrent:e,initialPageSize:t,hasPagination:r=!0,pagination:s,initialSorter:o,permanentSorter:a=ds,defaultSetFilterBehavior:n,initialFilter:u,permanentFilter:c=ps,filters:d,sorters:p,syncWithLocation:i,resource:f,successNotification:R,errorNotification:v,queryOptions:g,liveMode:x,onLiveEvent:b,liveParams:w,meta:y,metaData:h,dataProviderName:l,overtimeOptions:m}={}){var jr,Zr,Yr,Jr,Xr;let{syncWithLocation:L}=Vr(),C=i??L,P=zo(x),T=z(),{useLocation:E}=te(),{search:D,pathname:A}=E(),U=W(),M=ce(),S=((d==null?void 0:d.mode)||"server")==="server",Q=((p==null?void 0:p.mode)||"server")==="server",O=r===!1?"off":"server",$=((s==null?void 0:s.mode)??O)!=="off",H=I(s==null?void 0:s.current,e),Z=I(s==null?void 0:s.pageSize,t),_=I(y,h),{parsedCurrent:k,parsedPageSize:N,parsedSorter:K,parsedFilters:X}=Gt(D??"?"),de=I(d==null?void 0:d.initial,u),ye=I(d==null?void 0:d.permanent,c)??ps,qe=I(p==null?void 0:p.initial,o),He=I(p==null?void 0:p.permanent,a)??ds,ir=I(d==null?void 0:d.defaultBehavior,n)??"merge",ut,et,ct,pt;C?(ut=((jr=M==null?void 0:M.params)==null?void 0:jr.current)||k||H||1,et=((Zr=M==null?void 0:M.params)==null?void 0:Zr.pageSize)||N||Z||10,ct=((Yr=M==null?void 0:M.params)==null?void 0:Yr.sorters)||(K.length?K:qe),pt=((Jr=M==null?void 0:M.params)==null?void 0:Jr.filters)||(X.length?X:de)):(ut=H||1,et=Z||10,ct=qe,pt=de);let{replace:dt}=ae(),lt=ie(),{resource:zr,identifier:kt}=F(f),ur=U({resource:zr,meta:_});Wa.useEffect(()=>{Ka(typeof kt>"u","useTable: `resource` is not defined.")},[kt]);let[ze,Ct]=sr(_t(He,ct??[])),[tt,ge]=sr(zt(ye,pt??[])),[De,Ve]=sr(ut),[Le,Ee]=sr(et),_e=({pagination:{current:le,pageSize:Ue},sorter:Bt,filters:Nt})=>{if(T==="new")return lt({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...$?{current:le,pageSize:Ue}:{},sorters:Bt,filters:Nt,...je()}})??"";{let bt=cs.parse(D==null?void 0:D.substring(1)),ks=Wt({pagination:{pageSize:Ue,current:le},sorters:ze??Bt,filters:Nt,...bt});return`${A??""}?${ks??""}`}};us(()=>{D===""&&(Ve(ut),Ee(et),Ct(_t(He,ct??[])),ge(zt(ye,pt??[])))},[D]);let je=()=>{if(T==="new"){let{sorters:le,filters:Ue,pageSize:Bt,current:Nt,...bt}=(M==null?void 0:M.params)??{};return bt}else{let{sorter:le,filters:Ue,pageSize:Bt,current:Nt,...bt}=cs.parse(D,{ignoreQueryPrefix:!0});return bt}};us(()=>{if(C){let le=je();if(T==="new")lt({type:"replace",options:{keepQuery:!0},query:{...$?{pageSize:Le,current:De}:{},sorters:nr(ze,He,ar),filters:nr(tt,ye,ar)}});else{let Ue=Wt({...$?{pagination:{pageSize:Le,current:De}}:{},sorters:nr(ze,He,ar),filters:nr(tt,ye,ar),...le});return dt==null?void 0:dt(`${A}?${Ue}`,void 0,{shallow:!0})}}},[C,De,Le,ze,tt]);let Oe=Et({resource:kt,hasPagination:r,pagination:{current:De,pageSize:Le,mode:s==null?void 0:s.mode},filters:S?yt(ye,tt):void 0,sorters:Q?Kt(He,ze):void 0,queryOptions:g,successNotification:R,errorNotification:v,meta:ur,metaData:ur,liveMode:P,liveParams:w,onLiveEvent:b,dataProviderName:l}),Vt=le=>{ge(Ue=>yt(ye,le,Ue))},Ss=le=>{ge(yt(ye,le))},As=le=>{ge(Ue=>yt(ye,le(Ue)))},Qs=(le,Ue=ir)=>{typeof le=="function"?As(le):Ue==="replace"?Ss(le):Vt(le)},_r=le=>{Ct(()=>Kt(He,le))},{elapsedTime:Fs}=j({isLoading:Oe.isFetching,interval:m==null?void 0:m.interval,onInterval:m==null?void 0:m.onInterval});return{tableQueryResult:Oe,sorters:ze,setSorters:_r,sorter:ze,setSorter:_r,filters:tt,setFilters:Qs,current:De,setCurrent:Ve,pageSize:Le,setPageSize:Ee,pageCount:Le?Math.ceil((((Xr=Oe.data)==null?void 0:Xr.total)??0)/Le):1,createLinkForSyncWithLocation:_e,overtime:{elapsedTime:Fs}}}import{useContext as fs}from"react";import{useMutation as ys,useQueryClient as za}from"@tanstack/react-query";import ls from"react";var at=ls.createContext({}),ms=({create:e,get:t,update:r,children:s})=>ls.createElement(at.Provider,{value:{create:e,get:t,update:r}},s);var Ie=({logMutationOptions:e,renameMutationOptions:t}={})=>{let r=za(),s=fs(at),o=G(),{resources:a}=fs(Je),{data:n,refetch:u,isLoading:c}=cr({v3LegacyAuthProviderCompatible:!!(o!=null&&o.isLegacy),queryOptions:{enabled:!!s}}),d=ys(async i=>{var g,x,b,w,y;let f=ue(i.resource,a),R=I((g=f==null?void 0:f.meta)==null?void 0:g.audit,(x=f==null?void 0:f.options)==null?void 0:x.audit,(w=(b=f==null?void 0:f.options)==null?void 0:b.auditLog)==null?void 0:w.permissions);if(R&&!xr(R,i.action))return;let v;return c&&(v=await u()),await((y=s.create)==null?void 0:y.call(s,{...i,author:n??(v==null?void 0:v.data)}))},e),p=ys(async i=>{var f;return await((f=s.update)==null?void 0:f.call(s,i))},{onSuccess:i=>{if(i!=null&&i.resource){let f=q(i==null?void 0:i.resource);r.invalidateQueries(f.logList())}},...t});return{log:d,rename:p}};import{useContext as _a}from"react";import{useQuery as ja}from"@tanstack/react-query";var dP=({resource:e,action:t,meta:r,author:s,metaData:o,queryOptions:a})=>{let{get:n}=_a(at),u=q(e,void 0,o);return ja(u.logList(r),()=>(n==null?void 0:n({resource:e,action:t,author:s,meta:r,metaData:o}))??Promise.resolve([]),{enabled:typeof n<"u",...a,retry:!1})};import{useCallback as Za}from"react";import{useQueryClient as Ya}from"@tanstack/react-query";var we=()=>{let{resources:e}=F(),t=Ya();return Za(({resource:s,dataProviderName:o,invalidates:a,id:n})=>{if(a===!1)return;let u=q(s,B(s,o,e));a.forEach(c=>{switch(c){case"all":t.invalidateQueries(u.all);break;case"list":t.invalidateQueries(u.list());break;case"many":t.invalidateQueries(u.many());break;case"resourceAll":t.invalidateQueries(u.resourceAll);break;case"detail":t.invalidateQueries(u.detail(n||""));break;default:break}})},[])};import{useContext as Ja}from"react";import Xa from"warn-once";var SP=({meta:e={}}={})=>{let t=z(),{i18nProvider:r}=Ja(Se),s=ce(),o=V(),{resources:a,resource:n,action:u}=F(),c=[];if(!(n!=null&&n.name))return{breadcrumbs:c};let d=p=>{var f,R,v,g,x,b;let i=typeof p=="string"?ue(p,a,t==="legacy")??{name:p}:p;if(i){let w=I((f=i==null?void 0:i.meta)==null?void 0:f.parent,i==null?void 0:i.parentName);w&&d(w);let y=me(i,a,t==="legacy").find(m=>m.action==="list"),h=(R=y==null?void 0:y.resource)!=null&&R.list?y==null?void 0:y.route:void 0,l=h?t==="legacy"?h:Re(h,i==null?void 0:i.meta,s,e):void 0;c.push({label:I((v=i.meta)==null?void 0:v.label,(g=i.options)==null?void 0:g.label)??o(`${i.name}.${i.name}`,rt(i.name)),href:l,icon:I((x=i.meta)==null?void 0:x.icon,(b=i.options)==null?void 0:b.icon,i.icon)})}};if(d(n),u&&u!=="list"){let p=`actions.${u}`,i=o(p);typeof r<"u"&&i===p?(Xa(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${u}" action. Please add "actions.${u}" key to your translation file.
11
- For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),c.push({label:o(`buttons.${u}`,rt(u))})):c.push({label:o(p,rt(u))})}return{breadcrumbs:c}};import Or from"react";var Tt=(e,t,r=!1)=>{let s=[],o=he(e,t);for(;o;)s.push(o),o=he(o,t);return s.reverse(),`/${[...s,e].map(n=>Te((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`};var gs=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(o=>{let a=[],n=he(o,e);for(;n;)a.push(n),n=he(n,e);a.reverse();let u=r;a.forEach(d=>{let p=(t?d.route:void 0)??d.identifier??d.name;u.children[p]||(u.children[p]={item:d,children:{}}),u=u.children[p]});let c=(t?o.route:void 0)??o.identifier??o.name;u.children[c]||(u.children[c]={item:o,children:{}})});let s=o=>{let a=[];return Object.keys(o.children).forEach(n=>{let u=Tt(o.children[n].item,e,t),c={...o.children[n].item,key:u,children:s(o.children[n])};a.push(c)}),a};return s(r)};var Ts=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),qa=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=V(),s=At(),o=z(),{resource:a,resources:n}=F(),{pathname:u}=ce(),{useLocation:c}=te(),{pathname:d}=c(),i=`/${((o==="legacy"?Ts(d):u?Ts(u):void 0)??"").replace(/^\//,"")}`,f=a?Tt(a,n,o==="legacy"):i??"",R=Or.useMemo(()=>{if(!a)return[];let x=he(a,n),b=[Tt(a,n)];for(;x;)b.push(Tt(x,n)),x=he(x,n);return b},[]),v=Or.useCallback(x=>{var w,y,h,l,m,L;if((((w=x==null?void 0:x.meta)==null?void 0:w.hide)??((y=x==null?void 0:x.options)==null?void 0:y.hide))||!(x!=null&&x.list)&&x.children.length===0)return;let b=x.list?s({resource:x,action:"list",legacy:o==="legacy",meta:e}):void 0;if(!(t&&b&&b.match(/(\/|^):(.+?)(\/|$){1}/)))return{...x,route:b,icon:I((h=x.meta)==null?void 0:h.icon,(l=x.options)==null?void 0:l.icon,x.icon),label:I((m=x==null?void 0:x.meta)==null?void 0:m.label,(L=x==null?void 0:x.options)==null?void 0:L.label)??r(`${x.name}.${x.name}`,Ze(x.name,"plural"))}},[o,e,r,t]),g=Or.useMemo(()=>{let x=gs(n,o==="legacy"),b=w=>w.flatMap(y=>{let h=b(y.children),l=v({...y,children:h});return l?[l]:[]});return b(x)},[n,o,v]);return{defaultOpenKeys:R,selectedKey:f,menuItems:g}};var W=()=>{let{params:e}=ce();return({resource:r,meta:s}={})=>{let{meta:o}=rr(r??{}),{filters:a,sorters:n,current:u,pageSize:c,...d}=e??{};return{...o,...d,...s}}};var ri=()=>{let[e,t]=ti(),r=V(),{push:s}=ae(),o=ie(),a=z(),{resource:n,action:u}=F();return ei(()=>{n&&u&&t(r("pages.error.info",{action:u,resource:n.name},`You may have forgotten to add the "${u}" component to "${n.name}" resource.`))},[n,u]),Ft.createElement(Ft.Fragment,null,Ft.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&Ft.createElement("p",null,e),Ft.createElement("button",{onClick:()=>{a==="legacy"?s("/"):o({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import Pe,{useState as Rs}from"react";var Lr=()=>{let[e,t]=Rs(""),[r,s]=Rs(""),o=V(),a=G(),{mutate:n}=ht({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return Pe.createElement(Pe.Fragment,null,Pe.createElement("h1",null,o("pages.login.title","Sign in your account")),Pe.createElement("form",{onSubmit:u=>{u.preventDefault(),n({username:e,password:r})}},Pe.createElement("table",null,Pe.createElement("tbody",null,Pe.createElement("tr",null,Pe.createElement("td",null,o("pages.login.username",void 0,"username"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:u=>t(u.target.value)}))),Pe.createElement("tr",null,Pe.createElement("td",null,o("pages.login.password",void 0,"password"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:u=>s(u.target.value)}))))),Pe.createElement("br",null),Pe.createElement("input",{type:"submit",value:"login"})))};import Rt from"react";import pe,{useState as $r}from"react";var Ps=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:s,contentProps:o,wrapperProps:a,renderContent:n,formProps:u,title:c=void 0})=>{let d=z(),p=nt(),{Link:i}=te(),f=d==="legacy"?i:p,[R,v]=$r(""),[g,x]=$r(""),[b,w]=$r(!1),y=V(),h=G(),{mutate:l}=ht({v3LegacyAuthProviderCompatible:!!(h!=null&&h.isLegacy)}),m=(P,T)=>pe.createElement(f,{to:P},T),L=()=>e?e.map(P=>pe.createElement("div",{key:P.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},pe.createElement("button",{onClick:()=>l({providerName:P.name}),style:{display:"flex",alignItems:"center"}},P==null?void 0:P.icon,P.label??pe.createElement("label",null,P.label)))):null,C=pe.createElement("div",{...o},pe.createElement("h1",{style:{textAlign:"center"}},y("pages.login.title","Sign in to your account")),L(),pe.createElement("hr",null),pe.createElement("form",{onSubmit:P=>{P.preventDefault(),l({email:R,password:g,remember:b})},...u},pe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},pe.createElement("label",{htmlFor:"email-input"},y("pages.login.fields.email","Email")),pe.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:R,onChange:P=>v(P.target.value)}),pe.createElement("label",{htmlFor:"password-input"},y("pages.login.fields.password","Password")),pe.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:g,onChange:P=>x(P.target.value)}),s??pe.createElement(pe.Fragment,null,pe.createElement("label",{htmlFor:"remember-me-input"},y("pages.login.buttons.rememberMe","Remember me"),pe.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:b,value:b.toString(),onChange:()=>{w(!b)}}))),pe.createElement("br",null),r??m("/forgot-password",y("pages.login.buttons.forgotPassword","Forgot password?")),pe.createElement("input",{type:"submit",value:y("pages.login.signin","Sign in")}),t??pe.createElement("span",null,y("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",m("/register",y("pages.login.register","Sign up"))))));return pe.createElement("div",{...a},n?n(C,c):C)};import fe,{useState as xs}from"react";var Cs=({providers:e,loginLink:t,wrapperProps:r,contentProps:s,renderContent:o,formProps:a,title:n=void 0})=>{let u=z(),c=nt(),{Link:d}=te(),p=u==="legacy"?d:c,[i,f]=xs(""),[R,v]=xs(""),g=V(),x=G(),{mutate:b,isLoading:w}=mr({v3LegacyAuthProviderCompatible:!!(x!=null&&x.isLegacy)}),y=(m,L)=>fe.createElement(p,{to:m},L),h=()=>e?e.map(m=>fe.createElement("div",{key:m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},fe.createElement("button",{onClick:()=>b({providerName:m.name}),style:{display:"flex",alignItems:"center"}},m==null?void 0:m.icon,m.label??fe.createElement("label",null,m.label)))):null,l=fe.createElement("div",{...s},fe.createElement("h1",{style:{textAlign:"center"}},g("pages.register.title","Sign up for your account")),h(),fe.createElement("hr",null),fe.createElement("form",{onSubmit:m=>{m.preventDefault(),b({email:i,password:R})},...a},fe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},fe.createElement("label",{htmlFor:"email-input"},g("pages.register.fields.email","Email")),fe.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:i,onChange:m=>f(m.target.value)}),fe.createElement("label",{htmlFor:"password-input"},g("pages.register.fields.password","Password")),fe.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:R,onChange:m=>v(m.target.value)}),fe.createElement("input",{type:"submit",value:g("pages.register.buttons.submit","Sign up"),disabled:w}),t??fe.createElement(fe.Fragment,null,fe.createElement("span",null,g("pages.login.buttons.haveAccount","Have an account?")," ",y("/login",g("pages.login.signin","Sign in")))))));return fe.createElement("div",{...r},o?o(l,n):l)};import Ae,{useState as oi}from"react";var bs=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:s,formProps:o,title:a=void 0})=>{let n=V(),u=z(),c=nt(),{Link:d}=te(),p=u==="legacy"?d:c,[i,f]=oi(""),{mutate:R,isLoading:v}=yr(),g=(b,w)=>Ae.createElement(p,{to:b},w),x=Ae.createElement("div",{...r},Ae.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Ae.createElement("hr",null),Ae.createElement("form",{onSubmit:b=>{b.preventDefault(),R({email:i})},...o},Ae.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ae.createElement("label",{htmlFor:"email-input"},n("pages.forgotPassword.fields.email","Email")),Ae.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:i,onChange:b=>f(b.target.value)}),Ae.createElement("input",{type:"submit",disabled:v,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Ae.createElement("br",null),e??Ae.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",g("/login",n("pages.login.signin","Sign in"))))));return Ae.createElement("div",{...t},s?s(x,a):x)};import ke,{useState as hs}from"react";var vs=({wrapperProps:e,contentProps:t,renderContent:r,formProps:s,title:o=void 0})=>{let a=V(),n=G(),{mutate:u,isLoading:c}=Tr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),[d,p]=hs(""),[i,f]=hs(""),R=ke.createElement("div",{...t},ke.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),ke.createElement("hr",null),ke.createElement("form",{onSubmit:v=>{v.preventDefault(),u({password:d,confirmPassword:i})},...s},ke.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ke.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),ke.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:v=>p(v.target.value)}),ke.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),ke.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:i,onChange:v=>f(v.target.value)}),ke.createElement("input",{type:"submit",disabled:c,value:a("pages.updatePassword.buttons.submit","Update")}))));return ke.createElement("div",{...e},r?r(R,o):R)};var si=e=>{let{type:t}=e;return Rt.createElement(Rt.Fragment,null,(()=>{switch(t){case"register":return Rt.createElement(Cs,{...e});case"forgotPassword":return Rt.createElement(bs,{...e});case"updatePassword":return Rt.createElement(vs,{...e});default:return Rt.createElement(Ps,{...e})}})())};import be from"react";var Gr=()=>be.createElement(be.Fragment,null,be.createElement("h1",null,"Welcome on board"),be.createElement("p",null,"Your configuration is completed."),be.createElement("p",null,"Now you can get started by adding your resources to the"," ",be.createElement("code",null,"`resources`")," property of ",be.createElement("code",null,"`<Refine>`")),be.createElement("div",{style:{display:"flex",gap:8}},be.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Documentation")),be.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Examples")),be.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Community"))));import J,{useState as ni}from"react";var ai=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:J.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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:J.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}))}],ii=()=>{let e=qt("(max-width: 1010px)"),t=qt("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",s=()=>t?"32px":e?"40px":"48px",o=()=>t?"16px":e?"20px":"24px";return J.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"}},J.createElement("div",{style:{height:"89px"}}),J.createElement("div",{style:{display:"flex",justifyContent:"center"}},J.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),J.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},J.createElement("h1",{style:{fontSize:s(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),J.createElement("h4",{style:{fontSize:o(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),J.createElement("div",{style:{height:"64px"}}),J.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ai.map(a=>J.createElement(ui,{key:`welcome-page-${a.title}`,card:a}))),J.createElement("div",{style:{height:"64px"}}))},ui=({card:e})=>{let{title:t,description:r,icon:s,link:o}=e,[a,n]=ni(!1);return J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},J.createElement("div",{style:{display:"flex",alignItems:"center"}},J.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:o},s,J.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),J.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...a&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},J.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"})))),J.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import se from"react";import{QueryClientProvider as li,QueryClient as Is}from"@tanstack/react-query";import{ReactQueryDevtools as mi}from"@tanstack/react-query-devtools";import{useEffect as pi}from"react";import{useContext as it}from"react";var ci="4.23.0",Ds=()=>{let e=Rr(),t=it(at),r=it(Ge),s=it(Qt),o=it(It),{i18nProvider:a}=it(Se),n=it(wt),u=it(Xe),{resources:c}=F(),d=!!t.create||!!t.get||!!t.update,p=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),i=!!s.useHistory||!!s.Link||!!s.Prompt||!!s.useLocation||!!s.useParams,f=!!o,R=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,g=!!u.can;return{providers:{auth:e,auditLog:d,live:p,router:i,data:f,i18n:R,notification:v,accessControl:g},version:ci,resourceCount:c.length}};var di=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},Ls=()=>{let e=Ds();return pi(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${di(e)}`},[]),null};var Es=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};import Us from"react";var Ms=e=>{let t=Us.useRef(!1);Us.useEffect(()=>{t.current===!1&&e&&Es(e)&&(t.current=!0)},[e])};var fi=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:s,routerProvider:o,notificationProvider:a,accessControlProvider:n,auditLogProvider:u,resources:c,DashboardPage:d,ReadyPage:p,LoginPage:i,catchAll:f,children:R,liveProvider:v,i18nProvider:g,Title:x,Layout:b,Sider:w,Header:y,Footer:h,OffLayoutArea:l,onLiveEvent:m,options:L})=>{let{optionsWithDefaults:C,disableTelemetryWithDefault:P,reactQueryWithDefaults:T}=Er({options:L}),E=tr(()=>{var M;return T.clientConfig instanceof Is?T.clientConfig:new Is({...T.clientConfig,defaultOptions:{...T.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(M=T.clientConfig.defaultOptions)==null?void 0:M.queries}}})},[T.clientConfig]),A=se.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(Ms(o),s&&!o&&(c??[]).length===0)return p?se.createElement(p,null):se.createElement(Gr,null);let{RouterComponent:U=se.Fragment}=o?{}:s??{};return se.createElement(li,{client:E},se.createElement(_o,{...A},se.createElement(eo,{...e??{},isProvided:!!e},se.createElement(ro,{...t??{},isProvided:!!t},se.createElement(Ao,{...r},se.createElement(Fo,{liveProvider:v},se.createElement(Oo,{value:s&&!o?"legacy":"new"},se.createElement(Go,{router:o},se.createElement(os,{...s},se.createElement(Bo,{resources:c??[]},se.createElement(Zo,{i18nProvider:g},se.createElement(ns,{...n??{}},se.createElement(ms,{...u??{}},se.createElement(Sr,null,se.createElement(bo,{mutationMode:C.mutationMode,warnWhenUnsavedChanges:C.warnWhenUnsavedChanges,syncWithLocation:C.syncWithLocation,Title:x,undoableTimeout:C.undoableTimeout,catchAll:f,DashboardPage:d,LoginPage:i,Layout:b,Sider:w,Footer:h,Header:y,OffLayoutArea:l,hasDashboard:!!d,liveMode:C.liveMode,onLiveEvent:m,options:C},se.createElement(Jo,null,se.createElement(U,null,R,!P&&se.createElement(Ls,null),se.createElement(Wr,null))))))))))))))))),T.devtoolConfig===!1?null:se.createElement(mi,{initialIsOpen:!1,position:"bottom-right",...T.devtoolConfig}))};import{useEffect as yi,useState as gi}from"react";var Eo=({notification:e})=>{let t=V(),{notificationDispatch:r}=Ne(),{open:s}=Ce(),[o,a]=gi(),n=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||s==null||s({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:vt(e.seconds)},`You have ${vt(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:vt(e.seconds)}),e.seconds>0)){o&&clearTimeout(o);let u=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(u)}};return yi(()=>{n()},[e]),null};import Kr,{useEffect as Ti}from"react";var Ri=({children:e,Layout:t,Sider:r,Header:s,Title:o,Footer:a,OffLayoutArea:n})=>{let{Layout:u,Footer:c,Header:d,Sider:p,Title:i,OffLayoutArea:f}=st();return Kr.createElement(t??u,{Sider:r??p,Header:s??d,Footer:a??c,Title:o??i,OffLayoutArea:n??f},e,Kr.createElement(Pi,null))},Pi=()=>{let{Prompt:e}=te(),t=V(),{warnWhen:r,setWarnWhen:s}=St(),o=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return Ti(()=>(r&&window.addEventListener("beforeunload",o),window.removeEventListener("beforeunload",o)),[r]),Kr.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:s})};import ve from"react";var xi=()=>{let e=ie(),[t,r]=ve.useState(void 0);return ve.useEffect(()=>{t&&e(t)},[t]),ve.useCallback(o=>{t||r(o)},[t])};function Ci({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:s,loading:o}){var C;let a=G(),n=z(),u=!!(a!=null&&a.isProvided),c=!!(a!=null&&a.isLegacy),d=n==="legacy",p=ce(),i=ie(),f=xi(),{replace:R}=ae(),{useLocation:v}=te(),g=v(),{isLoading:x,isFetching:b,isSuccess:w,data:{authenticated:y,redirectTo:h}={},refetch:l}=Ot({v3LegacyAuthProviderCompatible:c});ve.useEffect(()=>{l()},[r,s]);let m=ve.useRef({status:x?"initial":"pending",content:o??null});b?m.current.status="pending":b||(m.current.status="settled");let L=u?c?w:y:!0;if(m.current.status==="settled")if(L)m.current.content=ve.createElement(ve.Fragment,null,r??null);else if(typeof s<"u")m.current.content=ve.createElement(ve.Fragment,null,s);else{let P=`${d?g==null?void 0:g.pathname:p.pathname}`.replace(/(\?.*|#.*)$/,""),T=c?typeof e=="string"?e:"/login":typeof e=="string"?e:h;if(T)if(d){let E=t?`?to=${encodeURIComponent(P)}`:"";R(`${T}${E}`)}else f({to:T,query:t?{to:(C=p.params)!=null&&C.to?p.params.to:i({to:P,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return u?ve.createElement(ve.Fragment,null,m.current.content):ve.createElement(ve.Fragment,null,r??null)}import{useEffect as bi}from"react";var Wr=()=>{let{useLocation:e}=te(),{checkAuth:t}=ee(),r=e();return bi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Pt from"react";var hi=({resource:e,action:t,params:r,fallback:s,children:o,...a})=>{let{resource:n,id:u,action:c}=F(e),{identifier:d}=F(),i=(()=>{let R=(r==null?void 0:r.id)??u;return e&&e!==d?r==null?void 0:r.id:R})(),{data:f}=as({resource:e??(n==null?void 0:n.name),action:t??c??"",params:r??{id:i,resource:n}});return f!=null&&f.can?Pt.isValidElement(o)?Pt.cloneElement(o,a):Pt.createElement(Pt.Fragment,null,o):(f==null?void 0:f.can)===!1?Pt.createElement(Pt.Fragment,null,s??null):null};import xt,{useEffect as vi}from"react";var ws=[`
11
+ For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),c.push({label:o(`buttons.${u}`,rt(u))})):c.push({label:o(p,rt(u))})}return{breadcrumbs:c}};import Or from"react";var Tt=(e,t,r=!1)=>{let s=[],o=he(e,t);for(;o;)s.push(o),o=he(o,t);return s.reverse(),`/${[...s,e].map(n=>Te((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`};var gs=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(o=>{let a=[],n=he(o,e);for(;n;)a.push(n),n=he(n,e);a.reverse();let u=r;a.forEach(d=>{let p=(t?d.route:void 0)??d.identifier??d.name;u.children[p]||(u.children[p]={item:d,children:{}}),u=u.children[p]});let c=(t?o.route:void 0)??o.identifier??o.name;u.children[c]||(u.children[c]={item:o,children:{}})});let s=o=>{let a=[];return Object.keys(o.children).forEach(n=>{let u=Tt(o.children[n].item,e,t),c={...o.children[n].item,key:u,children:s(o.children[n])};a.push(c)}),a};return s(r)};var Ts=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),qa=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=V(),s=At(),o=z(),{resource:a,resources:n}=F(),{pathname:u}=ce(),{useLocation:c}=te(),{pathname:d}=c(),i=`/${((o==="legacy"?Ts(d):u?Ts(u):void 0)??"").replace(/^\//,"")}`,f=a?Tt(a,n,o==="legacy"):i??"",R=Or.useMemo(()=>{if(!a)return[];let x=he(a,n),b=[Tt(a,n)];for(;x;)b.push(Tt(x,n)),x=he(x,n);return b},[]),v=Or.useCallback(x=>{var w,y,h,l,m,L;if((((w=x==null?void 0:x.meta)==null?void 0:w.hide)??((y=x==null?void 0:x.options)==null?void 0:y.hide))||!(x!=null&&x.list)&&x.children.length===0)return;let b=x.list?s({resource:x,action:"list",legacy:o==="legacy",meta:e}):void 0;if(!(t&&b&&b.match(/(\/|^):(.+?)(\/|$){1}/)))return{...x,route:b,icon:I((h=x.meta)==null?void 0:h.icon,(l=x.options)==null?void 0:l.icon,x.icon),label:I((m=x==null?void 0:x.meta)==null?void 0:m.label,(L=x==null?void 0:x.options)==null?void 0:L.label)??r(`${x.name}.${x.name}`,Ze(x.name,"plural"))}},[o,e,r,t]),g=Or.useMemo(()=>{let x=gs(n,o==="legacy"),b=w=>w.flatMap(y=>{let h=b(y.children),l=v({...y,children:h});return l?[l]:[]});return b(x)},[n,o,v]);return{defaultOpenKeys:R,selectedKey:f,menuItems:g}};var W=()=>{let{params:e}=ce();return({resource:r,meta:s}={})=>{let{meta:o}=rr(r??{}),{filters:a,sorters:n,current:u,pageSize:c,...d}=e??{};return{...o,...d,...s}}};var ri=()=>{let[e,t]=ti(),r=V(),{push:s}=ae(),o=ie(),a=z(),{resource:n,action:u}=F();return ei(()=>{n&&u&&t(r("pages.error.info",{action:u,resource:n.name},`You may have forgotten to add the "${u}" component to "${n.name}" resource.`))},[n,u]),Ft.createElement(Ft.Fragment,null,Ft.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&Ft.createElement("p",null,e),Ft.createElement("button",{onClick:()=>{a==="legacy"?s("/"):o({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import Pe,{useState as Rs}from"react";var Lr=()=>{let[e,t]=Rs(""),[r,s]=Rs(""),o=V(),a=G(),{mutate:n}=ht({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return Pe.createElement(Pe.Fragment,null,Pe.createElement("h1",null,o("pages.login.title","Sign in your account")),Pe.createElement("form",{onSubmit:u=>{u.preventDefault(),n({username:e,password:r})}},Pe.createElement("table",null,Pe.createElement("tbody",null,Pe.createElement("tr",null,Pe.createElement("td",null,o("pages.login.username",void 0,"username"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:u=>t(u.target.value)}))),Pe.createElement("tr",null,Pe.createElement("td",null,o("pages.login.password",void 0,"password"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:u=>s(u.target.value)}))))),Pe.createElement("br",null),Pe.createElement("input",{type:"submit",value:"login"})))};import Rt from"react";import pe,{useState as $r}from"react";var Ps=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:s,contentProps:o,wrapperProps:a,renderContent:n,formProps:u,title:c=void 0})=>{let d=z(),p=nt(),{Link:i}=te(),f=d==="legacy"?i:p,[R,v]=$r(""),[g,x]=$r(""),[b,w]=$r(!1),y=V(),h=G(),{mutate:l}=ht({v3LegacyAuthProviderCompatible:!!(h!=null&&h.isLegacy)}),m=(P,T)=>pe.createElement(f,{to:P},T),L=()=>e?e.map(P=>pe.createElement("div",{key:P.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},pe.createElement("button",{onClick:()=>l({providerName:P.name}),style:{display:"flex",alignItems:"center"}},P==null?void 0:P.icon,P.label??pe.createElement("label",null,P.label)))):null,C=pe.createElement("div",{...o},pe.createElement("h1",{style:{textAlign:"center"}},y("pages.login.title","Sign in to your account")),L(),pe.createElement("hr",null),pe.createElement("form",{onSubmit:P=>{P.preventDefault(),l({email:R,password:g,remember:b})},...u},pe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},pe.createElement("label",{htmlFor:"email-input"},y("pages.login.fields.email","Email")),pe.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:R,onChange:P=>v(P.target.value)}),pe.createElement("label",{htmlFor:"password-input"},y("pages.login.fields.password","Password")),pe.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:g,onChange:P=>x(P.target.value)}),s??pe.createElement(pe.Fragment,null,pe.createElement("label",{htmlFor:"remember-me-input"},y("pages.login.buttons.rememberMe","Remember me"),pe.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:b,value:b.toString(),onChange:()=>{w(!b)}}))),pe.createElement("br",null),r??m("/forgot-password",y("pages.login.buttons.forgotPassword","Forgot password?")),pe.createElement("input",{type:"submit",value:y("pages.login.signin","Sign in")}),t??pe.createElement("span",null,y("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",m("/register",y("pages.login.register","Sign up"))))));return pe.createElement("div",{...a},n?n(C,c):C)};import fe,{useState as xs}from"react";var Cs=({providers:e,loginLink:t,wrapperProps:r,contentProps:s,renderContent:o,formProps:a,title:n=void 0})=>{let u=z(),c=nt(),{Link:d}=te(),p=u==="legacy"?d:c,[i,f]=xs(""),[R,v]=xs(""),g=V(),x=G(),{mutate:b,isLoading:w}=mr({v3LegacyAuthProviderCompatible:!!(x!=null&&x.isLegacy)}),y=(m,L)=>fe.createElement(p,{to:m},L),h=()=>e?e.map(m=>fe.createElement("div",{key:m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},fe.createElement("button",{onClick:()=>b({providerName:m.name}),style:{display:"flex",alignItems:"center"}},m==null?void 0:m.icon,m.label??fe.createElement("label",null,m.label)))):null,l=fe.createElement("div",{...s},fe.createElement("h1",{style:{textAlign:"center"}},g("pages.register.title","Sign up for your account")),h(),fe.createElement("hr",null),fe.createElement("form",{onSubmit:m=>{m.preventDefault(),b({email:i,password:R})},...a},fe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},fe.createElement("label",{htmlFor:"email-input"},g("pages.register.fields.email","Email")),fe.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:i,onChange:m=>f(m.target.value)}),fe.createElement("label",{htmlFor:"password-input"},g("pages.register.fields.password","Password")),fe.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:R,onChange:m=>v(m.target.value)}),fe.createElement("input",{type:"submit",value:g("pages.register.buttons.submit","Sign up"),disabled:w}),t??fe.createElement(fe.Fragment,null,fe.createElement("span",null,g("pages.login.buttons.haveAccount","Have an account?")," ",y("/login",g("pages.login.signin","Sign in")))))));return fe.createElement("div",{...r},o?o(l,n):l)};import Ae,{useState as oi}from"react";var bs=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:s,formProps:o,title:a=void 0})=>{let n=V(),u=z(),c=nt(),{Link:d}=te(),p=u==="legacy"?d:c,[i,f]=oi(""),{mutate:R,isLoading:v}=yr(),g=(b,w)=>Ae.createElement(p,{to:b},w),x=Ae.createElement("div",{...r},Ae.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Ae.createElement("hr",null),Ae.createElement("form",{onSubmit:b=>{b.preventDefault(),R({email:i})},...o},Ae.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ae.createElement("label",{htmlFor:"email-input"},n("pages.forgotPassword.fields.email","Email")),Ae.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:i,onChange:b=>f(b.target.value)}),Ae.createElement("input",{type:"submit",disabled:v,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Ae.createElement("br",null),e??Ae.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",g("/login",n("pages.login.signin","Sign in"))))));return Ae.createElement("div",{...t},s?s(x,a):x)};import ke,{useState as hs}from"react";var vs=({wrapperProps:e,contentProps:t,renderContent:r,formProps:s,title:o=void 0})=>{let a=V(),n=G(),{mutate:u,isLoading:c}=Tr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),[d,p]=hs(""),[i,f]=hs(""),R=ke.createElement("div",{...t},ke.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),ke.createElement("hr",null),ke.createElement("form",{onSubmit:v=>{v.preventDefault(),u({password:d,confirmPassword:i})},...s},ke.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ke.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),ke.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:v=>p(v.target.value)}),ke.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),ke.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:i,onChange:v=>f(v.target.value)}),ke.createElement("input",{type:"submit",disabled:c,value:a("pages.updatePassword.buttons.submit","Update")}))));return ke.createElement("div",{...e},r?r(R,o):R)};var si=e=>{let{type:t}=e;return Rt.createElement(Rt.Fragment,null,(()=>{switch(t){case"register":return Rt.createElement(Cs,{...e});case"forgotPassword":return Rt.createElement(bs,{...e});case"updatePassword":return Rt.createElement(vs,{...e});default:return Rt.createElement(Ps,{...e})}})())};import be from"react";var Gr=()=>be.createElement(be.Fragment,null,be.createElement("h1",null,"Welcome on board"),be.createElement("p",null,"Your configuration is completed."),be.createElement("p",null,"Now you can get started by adding your resources to the"," ",be.createElement("code",null,"`resources`")," property of ",be.createElement("code",null,"`<Refine>`")),be.createElement("div",{style:{display:"flex",gap:8}},be.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Documentation")),be.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Examples")),be.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},be.createElement("button",null,"Community"))));import J,{useState as ni}from"react";var ai=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:J.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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:J.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}))}],ii=()=>{let e=qt("(max-width: 1010px)"),t=qt("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",s=()=>t?"32px":e?"40px":"48px",o=()=>t?"16px":e?"20px":"24px";return J.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"}},J.createElement("div",{style:{height:"89px"}}),J.createElement("div",{style:{display:"flex",justifyContent:"center"}},J.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),J.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},J.createElement("h1",{style:{fontSize:s(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),J.createElement("h4",{style:{fontSize:o(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),J.createElement("div",{style:{height:"64px"}}),J.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ai.map(a=>J.createElement(ui,{key:`welcome-page-${a.title}`,card:a}))),J.createElement("div",{style:{height:"64px"}}))},ui=({card:e})=>{let{title:t,description:r,icon:s,link:o}=e,[a,n]=ni(!1);return J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},J.createElement("div",{style:{display:"flex",alignItems:"center"}},J.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:o},s,J.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),J.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...a&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},J.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"})))),J.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import se from"react";import{QueryClientProvider as li,QueryClient as Is}from"@tanstack/react-query";import{ReactQueryDevtools as mi}from"@tanstack/react-query-devtools";import{useEffect as pi}from"react";import{useContext as it}from"react";var ci="4.24.0",Ds=()=>{let e=Rr(),t=it(at),r=it(Ge),s=it(Qt),o=it(It),{i18nProvider:a}=it(Se),n=it(wt),u=it(Xe),{resources:c}=F(),d=!!t.create||!!t.get||!!t.update,p=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),i=!!s.useHistory||!!s.Link||!!s.Prompt||!!s.useLocation||!!s.useParams,f=!!o,R=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,g=!!u.can;return{providers:{auth:e,auditLog:d,live:p,router:i,data:f,i18n:R,notification:v,accessControl:g},version:ci,resourceCount:c.length}};var di=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},Ls=()=>{let e=Ds();return pi(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${di(e)}`},[]),null};var Es=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};import Us from"react";var Ms=e=>{let t=Us.useRef(!1);Us.useEffect(()=>{t.current===!1&&e&&Es(e)&&(t.current=!0)},[e])};var fi=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:s,routerProvider:o,notificationProvider:a,accessControlProvider:n,auditLogProvider:u,resources:c,DashboardPage:d,ReadyPage:p,LoginPage:i,catchAll:f,children:R,liveProvider:v,i18nProvider:g,Title:x,Layout:b,Sider:w,Header:y,Footer:h,OffLayoutArea:l,onLiveEvent:m,options:L})=>{let{optionsWithDefaults:C,disableTelemetryWithDefault:P,reactQueryWithDefaults:T}=Er({options:L}),E=tr(()=>{var M;return T.clientConfig instanceof Is?T.clientConfig:new Is({...T.clientConfig,defaultOptions:{...T.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(M=T.clientConfig.defaultOptions)==null?void 0:M.queries}}})},[T.clientConfig]),A=se.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(Ms(o),s&&!o&&(c??[]).length===0)return p?se.createElement(p,null):se.createElement(Gr,null);let{RouterComponent:U=se.Fragment}=o?{}:s??{};return se.createElement(li,{client:E},se.createElement(_o,{...A},se.createElement(eo,{...e??{},isProvided:!!e},se.createElement(ro,{...t??{},isProvided:!!t},se.createElement(Ao,{...r},se.createElement(Fo,{liveProvider:v},se.createElement(Oo,{value:s&&!o?"legacy":"new"},se.createElement(Go,{router:o},se.createElement(os,{...s},se.createElement(Bo,{resources:c??[]},se.createElement(Zo,{i18nProvider:g},se.createElement(ns,{...n??{}},se.createElement(ms,{...u??{}},se.createElement(Sr,null,se.createElement(bo,{mutationMode:C.mutationMode,warnWhenUnsavedChanges:C.warnWhenUnsavedChanges,syncWithLocation:C.syncWithLocation,Title:x,undoableTimeout:C.undoableTimeout,catchAll:f,DashboardPage:d,LoginPage:i,Layout:b,Sider:w,Footer:h,Header:y,OffLayoutArea:l,hasDashboard:!!d,liveMode:C.liveMode,onLiveEvent:m,options:C},se.createElement(Jo,null,se.createElement(U,null,R,!P&&se.createElement(Ls,null),se.createElement(Wr,null))))))))))))))))),T.devtoolConfig===!1?null:se.createElement(mi,{initialIsOpen:!1,position:"bottom-right",...T.devtoolConfig}))};import{useEffect as yi,useState as gi}from"react";var Eo=({notification:e})=>{let t=V(),{notificationDispatch:r}=Ne(),{open:s}=Ce(),[o,a]=gi(),n=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||s==null||s({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:vt(e.seconds)},`You have ${vt(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:vt(e.seconds)}),e.seconds>0)){o&&clearTimeout(o);let u=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(u)}};return yi(()=>{n()},[e]),null};import Kr,{useEffect as Ti}from"react";var Ri=({children:e,Layout:t,Sider:r,Header:s,Title:o,Footer:a,OffLayoutArea:n})=>{let{Layout:u,Footer:c,Header:d,Sider:p,Title:i,OffLayoutArea:f}=st();return Kr.createElement(t??u,{Sider:r??p,Header:s??d,Footer:a??c,Title:o??i,OffLayoutArea:n??f},e,Kr.createElement(Pi,null))},Pi=()=>{let{Prompt:e}=te(),t=V(),{warnWhen:r,setWarnWhen:s}=St(),o=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return Ti(()=>(r&&window.addEventListener("beforeunload",o),window.removeEventListener("beforeunload",o)),[r]),Kr.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:s})};import ve from"react";var xi=()=>{let e=ie(),[t,r]=ve.useState(void 0);return ve.useEffect(()=>{t&&e(t)},[t]),ve.useCallback(o=>{t||r(o)},[t])};function Ci({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:s,loading:o}){var C;let a=G(),n=z(),u=!!(a!=null&&a.isProvided),c=!!(a!=null&&a.isLegacy),d=n==="legacy",p=ce(),i=ie(),f=xi(),{replace:R}=ae(),{useLocation:v}=te(),g=v(),{isLoading:x,isFetching:b,isSuccess:w,data:{authenticated:y,redirectTo:h}={},refetch:l}=Ot({v3LegacyAuthProviderCompatible:c});ve.useEffect(()=>{l()},[r,s]);let m=ve.useRef({status:x?"initial":"pending",content:o??null});b?m.current.status="pending":b||(m.current.status="settled");let L=u?c?w:y:!0;if(m.current.status==="settled")if(L)m.current.content=ve.createElement(ve.Fragment,null,r??null);else if(typeof s<"u")m.current.content=ve.createElement(ve.Fragment,null,s);else{let P=`${d?g==null?void 0:g.pathname:p.pathname}`.replace(/(\?.*|#.*)$/,""),T=c?typeof e=="string"?e:"/login":typeof e=="string"?e:h;if(T)if(d){let E=t?`?to=${encodeURIComponent(P)}`:"";R(`${T}${E}`)}else f({to:T,query:t?{to:(C=p.params)!=null&&C.to?p.params.to:i({to:P,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return u?ve.createElement(ve.Fragment,null,m.current.content):ve.createElement(ve.Fragment,null,r??null)}import{useEffect as bi}from"react";var Wr=()=>{let{useLocation:e}=te(),{checkAuth:t}=ee(),r=e();return bi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Pt from"react";var hi=({resource:e,action:t,params:r,fallback:s,children:o,...a})=>{let{resource:n,id:u,action:c}=F(e),{identifier:d}=F(),i=(()=>{let R=(r==null?void 0:r.id)??u;return e&&e!==d?r==null?void 0:r.id:R})(),{data:f}=as({resource:e??(n==null?void 0:n.name),action:t??c??"",params:r??{id:i,resource:n}});return f!=null&&f.can?Pt.isValidElement(o)?Pt.cloneElement(o,a):Pt.createElement(Pt.Fragment,null,o):(f==null?void 0:f.can)===!1?Pt.createElement(Pt.Fragment,null,s??null):null};import xt,{useEffect as vi}from"react";var ws=[`
12
12
  .banner {
13
13
  display: flex;
14
14
  @media (max-width: 1000px) {