@refinedev/core 4.17.0 → 4.18.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,44 @@
1
1
  # @pankod/refine-core
2
2
 
3
+ ## 4.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#4430](https://github.com/refinedev/refine/pull/4430) [`cf07d59587f`](https://github.com/refinedev/refine/commit/cf07d59587fae2adce97a79b40fdb60b9d9a9527) Thanks [@aliemir](https://github.com/aliemir)! - Added `queryMeta` and `mutationMeta` properties to the `useForm` hook. These properties are used to pass specific meta values to the query or mutation. This is useful when you have overlapping values in your data provider's `getOne` and `update` methods. For example, you may want to change the `method` of the mutation to `PATCH` but if you pass it in the `meta` property, you'll end up changing the method of the `getOne` request as well.
8
+
9
+ `queryMeta` and `mutationMeta` has precedence over `meta`. This means that if you have the same property in `queryMeta` and `meta`, the value in `queryMeta` will be used.
10
+
11
+ **Usage**
12
+
13
+ ```tsx
14
+ import { useForm } from "@refinedev/core";
15
+
16
+ export const MyEditPage = () => {
17
+ const form = useForm({
18
+ // this is passed both to the mutation and the query requests
19
+ meta: {
20
+ myValue: "myValue",
21
+ },
22
+ // this is only passed to the query request
23
+ queryMeta: {
24
+ propertyOnlyWorksForQuery: "propertyOnlyWorksForQuery",
25
+ },
26
+ // this is only passed to the mutation request
27
+ mutationMeta: {
28
+ propertyOnlyWorksForMutation: "propertyOnlyWorksForMutation",
29
+ },
30
+ });
31
+ };
32
+ ```
33
+
34
+ ### Patch Changes
35
+
36
+ - [#4430](https://github.com/refinedev/refine/pull/4430) [`cf07d59587f`](https://github.com/refinedev/refine/commit/cf07d59587fae2adce97a79b40fdb60b9d9a9527) Thanks [@aliemir](https://github.com/aliemir)! - Fix missing `meta` values in `useForm` redirects after submission.
37
+
38
+ - [#4431](https://github.com/refinedev/refine/pull/4431) [`c29a3618cf6`](https://github.com/refinedev/refine/commit/c29a3618cf6b577c36e90ec514f3a691c87aad8f) Thanks [@aliemir](https://github.com/aliemir)! - Updated the TSDoc comments to fix the broken links in the documentation.
39
+
40
+ - [#4426](https://github.com/refinedev/refine/pull/4426) [`0602f4cdf1c`](https://github.com/refinedev/refine/commit/0602f4cdf1c38f2b9dea8a293680a1872f4a448d) Thanks [@yildirayunlu](https://github.com/yildirayunlu)! - fix: `resource` parameter in the `legacyResourceTransform` helper is not optional but used as optional
41
+
3
42
  ## 4.17.0
4
43
 
5
44
  ### Minor Changes
package/dist/esm/index.js CHANGED
@@ -8,7 +8,7 @@ See https://refine.dev/docs/api-reference/core/hooks/useForm/#resource`);let ot=
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`),{queryResult:At({resource:T==null?void 0:T.name,id:E!=null?E:"",queryOptions:{enabled:E!==void 0,...d},successNotification:r,errorNotification:o,meta:C,metaData:C,liveMode:n,onLiveEvent:i,dataProviderName:p}),showId:E,setShowId:m}};import{useEffect as La,useState as zr}from"react";import{parse as Ia}from"papaparse";import wa from"lodash-es/chunk";var Fg=({resourceName:e,resource:t,mapData:r=l=>l,paparseOptions:o,batchSize:s=Number.MAX_SAFE_INTEGER,onFinish:a,meta:n,metaData:i,onProgress:p,dataProviderName:d}={})=>{let[l,u]=zr(0),[y,R]=zr(0),[v,M]=zr(!1),{resource:c}=S(t!=null?t:e),g=Or(),f=St(),x;s===1?x=f:x=g;let E=()=>{R(0),u(0),M(!1)},m=T=>{let D={succeeded:T.filter(C=>C.type==="success"),errored:T.filter(C=>C.type==="error")};a==null||a(D),M(!1)};La(()=>{p==null||p({totalAmount:y,processedAmount:l})},[y,l]);let P=({file:T})=>(E(),new Promise(D=>{M(!0),Ia(T,{complete:async({data:C})=>{let h=jt(C,r);if(R(h.length),s===1){let b=h.map(I=>async()=>{var H;return{response:await f.mutateAsync({resource:(H=c==null?void 0:c.name)!=null?H:"",values:I,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:L(n,i),metaData:L(n,i)}),value:I}}),U=await tr(b,({response:I,value:w})=>(u(F=>F+1),{response:[I.data],type:"success",request:[w]}),(I,w)=>({response:[I],type:"error",request:[h[w]]}));D(U)}else{let b=wa(h,s),U=b.map(w=>async()=>{var B;return{response:await g.mutateAsync({resource:(B=c==null?void 0:c.name)!=null?B:"",values:w,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:L(n,i),metaData:L(n,i)}),value:w,currentBatchLength:w.length}}),I=await tr(U,({response:w,currentBatchLength:F,value:H})=>(u(B=>B+F),{response:w.data,type:"success",request:H}),(w,F)=>({response:[w],type:"error",request:b[F]}));D(I)}},...o})}).then(D=>(m(D),D)));return{inputProps:{type:"file",accept:".csv",onChange:T=>{T.target.files&&T.target.files.length>0&&P({file:T.target.files[0]})}},mutationResult:x,isLoading:v,handleChange:P}};import{useCallback as us,useState as Aa}from"react";var Hg=({defaultVisible:e=!1}={})=>{let[t,r]=Aa(e),o=us(()=>r(!0),[t]),s=us(()=>r(!1),[t]);return{visible:t,show:o,close:s}};import Sa from"react";var Bt=()=>{let e=N(),{resource:t,resources:r}=S(),o=Z();return Sa.useCallback(({resource:a,action:n,meta:i})=>{var y;let p=a||t;if(!p)return;let l=(y=pe(p,r,e==="legacy").find(R=>R.action===n))==null?void 0:y.route;return l?me(l,p==null?void 0:p.meta,o,i):void 0},[r,t,o])};var Qa=({resource:e,action:t,meta:r,legacy:o})=>Bt()({resource:e,action:t,meta:r,legacy:o});import ka,{useContext as Va}from"react";var at=()=>{let e=Va(We);return e!=null&&e.Link?e.Link:({to:r,...o})=>ka.createElement("a",{href:r,...o})};import{useContext as Ba}from"react";import cs from"react";var Ke={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},Fa=cs.createContext(Ke),Nt=Fa,ps=({children:e,useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n})=>cs.createElement(Nt.Provider,{value:{useHistory:t!=null?t:Ke.useHistory,useLocation:r!=null?r:Ke.useLocation,useParams:o!=null?o:Ke.useParams,Prompt:s!=null?s:Ke.Prompt,Link:a!=null?a:Ke.Link,routes:n!=null?n:Ke.routes}},e);var W=()=>{let e=Ba(Nt),{useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n}=e!=null?e:Ke;return{useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n}};import{useQuery as Na}from"@tanstack/react-query";import{useContext as Ha}from"react";import ds from"react";var it=ds.createContext({}),ls=({can:e,children:t})=>ds.createElement(it.Provider,{value:{can:e}},t);var ur=e=>{let{icon:t,list:r,edit:o,create:s,show:a,clone:n,children:i,meta:p,options:d,...l}=e,{icon:u,...y}=p!=null?p:{},{icon:R,...v}=d!=null?d:{};return{...l,...p?{meta:y}:{},...d?{options:v}:{}}};var ms=({action:e,resource:t,params:r,queryOptions:o})=>{let{can:s}=Ha(it),{resource:a,...n}=r!=null?r:{},i=ur(a!=null?a:{}),p=Na(["useCan",{action:e,resource:t,params:{...n,resource:i},enabled:o==null?void 0:o.enabled}],()=>{var d;return(d=s==null?void 0:s({action:e,resource:t,params:n}))!=null?d:Promise.resolve({can:!0})},{enabled:typeof s<"u",...o,retry:!1});return typeof s>"u"?{data:{can:!0}}:p};import{useContext as Oa}from"react";var LT=()=>{let{can:e}=Oa(it);return{can:e}};import{useCallback as fs,useMemo as $a,useState as _r}from"react";import Ga from"lodash/uniqBy";import Wa from"lodash/debounce";import cr from"lodash/get";var $T=e=>{var Y,he,xe;let[t,r]=_r([]),[o,s]=_r([]),[a,n]=_r([]),{resource:i,sort:p,sorters:d,filters:l=[],optionLabel:u="title",optionValue:y="id",debounce:R=300,successNotification:v,errorNotification:M,defaultValueQueryOptions:c,queryOptions:g,fetchSize:f,pagination:x,hasPagination:E=!1,liveMode:m,defaultValue:P=[],onLiveEvent:T,onSearch:D,liveParams:C,meta:h,metaData:b,dataProviderName:U}=e,{resources:I}=S(),w=G(),F=$(i,I),H=(Y=F==null?void 0:F.name)!=null?Y:i,B=w({resource:F,meta:L(h,b)}),j=Array.isArray(P)?P:[P],A=fs(re=>{n(re.data.map(ie=>({label:cr(ie,u),value:cr(ie,y)})))},[u,y]),V=c!=null?c:g,_=Vr({resource:H,ids:j,queryOptions:{...V,enabled:j.length>0&&((he=V==null?void 0:V.enabled)!=null?he:!0),onSuccess:re=>{var ie;A(re),(ie=V==null?void 0:V.onSuccess)==null||ie.call(V,re)}},meta:B,metaData:B,liveMode:"off",dataProviderName:U}),be=fs(re=>{s(re.data.map(ie=>({label:cr(ie,u),value:cr(ie,y)})))},[u,y]),ge=wt({resource:H,sorters:L(d,p),filters:l.concat(t),pagination:{current:x==null?void 0:x.current,pageSize:(xe=x==null?void 0:x.pageSize)!=null?xe:f,mode:x==null?void 0:x.mode},hasPagination:E,queryOptions:{...g,onSuccess:re=>{var ie;be(re),(ie=g==null?void 0:g.onSuccess)==null||ie.call(g,re)}},successNotification:v,errorNotification:M,meta:B,metaData:B,liveMode:m,liveParams:C,onLiveEvent:T,dataProviderName:U}),Ie=re=>{if(D){r(D(re));return}if(re)r([{field:u,operator:"contains",value:re}]);else{r([]);return}};return{queryResult:ge,defaultValueQueryResult:_,options:$a(()=>Ga([...o,...a],"value"),[o,a]),onSearch:Wa(Ie,R)}};import Ka,{useState as pr,useEffect as ys}from"react";import gs from"qs";import dr from"lodash/differenceWith";import lr from"lodash/isEqual";import za from"warn-once";var Ts=[],Rs=[];function qT({initialCurrent:e,initialPageSize:t,hasPagination:r=!0,pagination:o,initialSorter:s,permanentSorter:a=Rs,defaultSetFilterBehavior:n,initialFilter:i,permanentFilter:p=Ts,filters:d,sorters:l,syncWithLocation:u,resource:y,successNotification:R,errorNotification:v,queryOptions:M,liveMode:c,onLiveEvent:g,liveParams:f,meta:x,metaData:E,dataProviderName:m}={}){var Xe,vt,eo,to,ro,oo,so,no,ao,io;let{syncWithLocation:P}=Wr(),T=u!=null?u:P,D=Ko(c),C=N(),{useLocation:h}=W(),{search:b,pathname:U}=h(),I=G(),w=Z(),F=((d==null?void 0:d.mode)||"server")==="server",H=((l==null?void 0:l.mode)||"server")==="server",B=r===!1?"off":"server",j=((Xe=o==null?void 0:o.mode)!=null?Xe:B)!=="off",A=L(o==null?void 0:o.current,e),V=L(o==null?void 0:o.pageSize,t),_=L(x,E),{parsedCurrent:be,parsedPageSize:ge,parsedSorter:Ie,parsedFilters:Y}=Zt(b!=null?b:"?"),he=L(d==null?void 0:d.initial,i),xe=(vt=L(d==null?void 0:d.permanent,p))!=null?vt:Ts,re=L(l==null?void 0:l.initial,s),ie=(eo=L(l==null?void 0:l.permanent,a))!=null?eo:Rs,ht=(to=L(d==null?void 0:d.defaultBehavior,n))!=null?to:"merge",ze,ot,Fe,we;T?(ze=((ro=w==null?void 0:w.params)==null?void 0:ro.current)||be||A||1,ot=((oo=w==null?void 0:w.params)==null?void 0:oo.pageSize)||ge||V||10,Fe=((so=w==null?void 0:w.params)==null?void 0:so.sorters)||(Ie.length?Ie:re),we=((no=w==null?void 0:w.params)==null?void 0:no.filters)||(Y.length?Y:he)):(ze=A||1,ot=V||10,Fe=re,we=he);let{replace:pt}=se(),Dt=ne(),{resource:dt}=S(y),Ot=I({resource:dt,meta:_}),lt=dt==null?void 0:dt.name;Ka.useEffect(()=>{za(typeof lt>"u","useTable: `resource` is not defined.")},[lt]);let[Ae,$t]=pr(qt(ie,Fe!=null?Fe:[])),[_e,je]=pr(Xt(xe,we!=null?we:[])),[mt,mr]=pr(ze),[Ze,fr]=pr(ot),qr=({pagination:{current:ue,pageSize:De},sorter:Gt,filters:Wt})=>{var Kt;if(C==="new")return(Kt=Dt({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...j?{current:ue,pageSize:De}:{},sorters:Gt,filters:Wt,...ce()}}))!=null?Kt:"";{let Et=gs.parse(b==null?void 0:b.substring(1)),yr=Yt({pagination:{pageSize:De,current:ue},sorters:Ae!=null?Ae:Gt,filters:Wt,...Et});return`${U!=null?U:""}?${yr!=null?yr:""}`}};ys(()=>{b===""&&(mr(ze),fr(ot),$t(qt(ie,Fe!=null?Fe:[])),je(Xt(xe,we!=null?we:[])))},[b]);let ce=()=>{var ue;if(C==="new"){let{sorters:De,filters:Gt,pageSize:Wt,current:Kt,...Et}=(ue=w==null?void 0:w.params)!=null?ue:{};return Et}else{let{sorter:De,filters:Gt,pageSize:Wt,current:Kt,...Et}=gs.parse(b,{ignoreQueryPrefix:!0});return Et}};ys(()=>{if(T){let ue=ce();if(C==="new")Dt({type:"replace",options:{keepQuery:!0},query:{...j?{pageSize:Ze,current:mt}:{},sorters:dr(Ae,ie,lr),filters:dr(_e,xe,lr)}});else{let De=Yt({...j?{pagination:{pageSize:Ze,current:mt}}:{},sorters:dr(Ae,ie,lr),filters:dr(_e,xe,lr),...ue});return pt==null?void 0:pt(`${U}?${De}`,void 0,{shallow:!0})}}},[T,mt,Ze,Ae,_e]);let Se=wt({resource:lt,hasPagination:r,pagination:{current:mt,pageSize:Ze,mode:o==null?void 0:o.mode},filters:F?Tt(xe,_e):void 0,sorters:H?Jt(ie,Ae):void 0,queryOptions:M,successNotification:R,errorNotification:v,meta:Ot,metaData:Ot,liveMode:D,liveParams:f,onLiveEvent:g,dataProviderName:m}),Oe=ue=>{je(De=>Tt(xe,ue,De))},ft=ue=>{je(Tt(xe,ue))},Qe=ue=>{je(De=>Tt(xe,ue(De)))},Ye=(ue,De=ht)=>{typeof ue=="function"?Qe(ue):De==="replace"?ft(ue):Oe(ue)},Je=ue=>{$t(()=>Jt(ie,ue))};return{tableQueryResult:Se,sorters:Ae,setSorters:Je,sorter:Ae,setSorter:Je,filters:_e,setFilters:Ye,current:mt,setCurrent:mr,pageSize:Ze,setPageSize:fr,pageCount:Ze?Math.ceil(((io=(ao=Se.data)==null?void 0:ao.total)!=null?io:0)/Ze):1,createLinkForSyncWithLocation:qr}}import{useContext as Ps}from"react";import{useMutation as bs,useQueryClient as _a}from"@tanstack/react-query";import xs from"react";var ut=xs.createContext({}),Cs=({create:e,get:t,update:r,children:o})=>xs.createElement(ut.Provider,{value:{create:e,get:t,update:r}},o);var Ee=({logMutationOptions:e,renameMutationOptions:t}={})=>{let r=_a(),o=Ps(ut),s=O(),{resources:a}=Ps(tt),{data:n,refetch:i,isLoading:p}=gr({v3LegacyAuthProviderCompatible:Boolean(s==null?void 0:s.isLegacy),queryOptions:{enabled:!!o}}),d=bs(async u=>{var M,c,g,f,x;let y=$(u.resource,a),R=L((M=y==null?void 0:y.meta)==null?void 0:M.audit,(c=y==null?void 0:y.options)==null?void 0:c.audit,(f=(g=y==null?void 0:y.options)==null?void 0:g.auditLog)==null?void 0:f.permissions);if(R&&!Ur(R,u.action))return;let v;return p&&(v=await i()),await((x=o.create)==null?void 0:x.call(o,{...u,author:n!=null?n:v==null?void 0:v.data}))},e),l=bs(async u=>{var y;return await((y=o.update)==null?void 0:y.call(o,u))},{onSuccess:u=>{if(u!=null&&u.resource){let y=J(u==null?void 0:u.resource);r.invalidateQueries(y.logList())}},...t});return{log:d,rename:l}};import{useContext as ja}from"react";import{useQuery as Za}from"@tanstack/react-query";var CR=({resource:e,action:t,meta:r,author:o,metaData:s,queryOptions:a})=>{let{get:n}=ja(ut),i=J(e,void 0,s);return Za(i.logList(r),()=>{var d;return(d=n==null?void 0:n({resource:e,action:t,author:o,meta:r,metaData:s}))!=null?d:Promise.resolve([])},{enabled:typeof n<"u",...a,retry:!1})};import{useCallback as Ya}from"react";import{useQueryClient as Ja}from"@tanstack/react-query";var Ue=()=>{let{resources:e}=S(),t=Ja();return Ya(({resource:o,dataProviderName:s,invalidates:a,id:n})=>{if(a===!1)return;let i=J(o,Q(o,s,e));a.forEach(p=>{switch(p){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}})},[])};import{useContext as Xa}from"react";import qa from"warn-once";var OR=({meta:e={}}={})=>{let t=N(),{i18nProvider:r}=Xa(Me),o=Z(),s=k(),{resources:a,resource:n,action:i}=S(),p=[];if(!(n!=null&&n.name))return{breadcrumbs:p};let d=l=>{var y,R,v,M,c,g,f,x;let u=typeof l=="string"?(y=$(l,a,t==="legacy"))!=null?y:{name:l}:l;if(u){let E=L((R=u==null?void 0:u.meta)==null?void 0:R.parent,u==null?void 0:u.parentName);E&&d(E);let m=pe(u,a,t==="legacy").find(D=>D.action==="list"),P=(v=m==null?void 0:m.resource)!=null&&v.list?m==null?void 0:m.route:void 0,T=P?t==="legacy"?P:me(P,u==null?void 0:u.meta,o,e):void 0;p.push({label:(g=L((M=u.meta)==null?void 0:M.label,(c=u.options)==null?void 0:c.label))!=null?g:s(`${u.name}.${u.name}`,st(u.name)),href:T,icon:L((f=u.meta)==null?void 0:f.icon,(x=u.options)==null?void 0:x.icon,u.icon)})}};if(d(n),i&&i!=="list"){let l=`actions.${i}`,u=s(l);typeof r<"u"&&u===l?(qa(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${i}" action. Please add "actions.${i}" key to your translation file.
11
- For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),p.push({label:s(`buttons.${i}`,st(i))})):p.push({label:s(l,st(i))})}return{breadcrumbs:p}};import jr from"react";var xt=(e,t,r=!1)=>{let o=[],s=Ce(e,t);for(;s;)o.push(s),s=Ce(s,t);return o.reverse(),`/${[...o,e].map(n=>{var i,p;return le((p=(i=r?n.route:void 0)!=null?i:n.identifier)!=null?p:n.name)}).join("/").replace(/^\//,"")}`};var hs=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(s=>{var d,l;let a=[],n=Ce(s,e);for(;n;)a.push(n),n=Ce(n,e);a.reverse();let i=r;a.forEach(u=>{var R,v;let y=(v=(R=t?u.route:void 0)!=null?R:u.identifier)!=null?v:u.name;i.children[y]||(i.children[y]={item:u,children:{}}),i=i.children[y]});let p=(l=(d=t?s.route:void 0)!=null?d:s.identifier)!=null?l:s.name;i.children[p]||(i.children[p]={item:s,children:{}})});let o=s=>{let a=[];return Object.keys(s.children).forEach(n=>{let i=xt(s.children[n].item,e,t),p={...s.children[n].item,key:i,children:o(s.children[n])};a.push(p)}),a};return o(r)};var Ds=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),ei=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=k(),o=Bt(),s=N(),{resource:a,resources:n}=S(),{pathname:i}=Z(),{useLocation:p}=W(),{pathname:d}=p(),l=s==="legacy"?Ds(d):i?Ds(i):void 0,u=`/${(l!=null?l:"").replace(/^\//,"")}`,y=a?xt(a,n,s==="legacy"):u!=null?u:"",R=jr.useMemo(()=>{if(!a)return[];let c=Ce(a,n),g=[xt(a,n)];for(;c;)g.push(xt(c,n)),c=Ce(c,n);return g},[]),v=jr.useCallback(c=>{var f,x,E,m,P,T,D,C;if(((E=(f=c==null?void 0:c.meta)==null?void 0:f.hide)!=null?E:(x=c==null?void 0:c.options)==null?void 0:x.hide)||!(c!=null&&c.list)&&c.children.length===0)return;let g=c.list?o({resource:c,action:"list",legacy:s==="legacy",meta:e}):void 0;if(!(t&&g&&g.match(/(\/|^):(.+?)(\/|$){1}/)))return{...c,route:g,icon:L((m=c.meta)==null?void 0:m.icon,(P=c.options)==null?void 0:P.icon,c.icon),label:(C=L((T=c==null?void 0:c.meta)==null?void 0:T.label,(D=c==null?void 0:c.options)==null?void 0:D.label))!=null?C:r(`${c.name}.${c.name}`,qe(c.name,"plural"))}},[s,e,r,t]),M=jr.useMemo(()=>{let c=hs(n,s==="legacy"),g=f=>f.flatMap(x=>{let E=g(x.children),m=v({...x,children:E});return m?[m]:[]});return g(c)},[n,s,v]);return{defaultOpenKeys:R,selectedKey:y,menuItems:M}};var G=()=>{let{params:e}=Z();return({resource:r,meta:o}={})=>{let{meta:s}=ur(r!=null?r:{}),{filters:a,sorters:n,current:i,pageSize:p,...d}=e!=null?e:{};return{...s,...d,...o}}};var oi=()=>{let[e,t]=ri(),r=k(),{push:o}=se(),s=ne(),a=N(),{resource:n,action:i}=S();return ti(()=>{n&&i&&t(r("pages.error.info",{action:i,resource:n==null?void 0:n.name},`You may have forgotten to add the "${i}" component to "${n==null?void 0:n.name}" resource.`))},[n,i]),Ht.createElement(Ht.Fragment,null,Ht.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&Ht.createElement("p",null,e),Ht.createElement("button",{onClick:()=>{a==="legacy"?o("/"):s({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import fe,{useState as vs}from"react";var Sr=()=>{let[e,t]=vs(""),[r,o]=vs(""),s=k(),a=O(),{mutate:n}=Ut({v3LegacyAuthProviderCompatible:Boolean(a==null?void 0:a.isLegacy)});return fe.createElement(fe.Fragment,null,fe.createElement("h1",null,s("pages.login.title","Sign in your account")),fe.createElement("form",{onSubmit:i=>{i.preventDefault(),n({username:e,password:r})}},fe.createElement("table",null,fe.createElement("tbody",null,fe.createElement("tr",null,fe.createElement("td",null,s("pages.login.username",void 0,"username"),":"),fe.createElement("td",null,fe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:i=>t(i.target.value)}))),fe.createElement("tr",null,fe.createElement("td",null,s("pages.login.password",void 0,"password"),":"),fe.createElement("td",null,fe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:i=>o(i.target.value)}))))),fe.createElement("br",null),fe.createElement("input",{type:"submit",value:"login"})))};import Ct from"react";import ae,{useState as Zr}from"react";var Es=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:s,wrapperProps:a,renderContent:n,formProps:i,title:p=void 0})=>{let d=N(),l=at(),{Link:u}=W(),y=d==="legacy"?u:l,[R,v]=Zr(""),[M,c]=Zr(""),[g,f]=Zr(!1),x=k(),E=O(),{mutate:m}=Ut({v3LegacyAuthProviderCompatible:Boolean(E==null?void 0:E.isLegacy)}),P=(C,h)=>C?typeof C=="string"?ae.createElement(y,{to:C},h):C:null,T=()=>e?e.map(C=>{var h;return ae.createElement("div",{key:C.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ae.createElement("button",{onClick:()=>m({providerName:C.name}),style:{display:"flex",alignItems:"center"}},C==null?void 0:C.icon,(h=C.label)!=null?h:ae.createElement("label",null,C.label)))}):null,D=ae.createElement("div",{...s},ae.createElement("h1",{style:{textAlign:"center"}},x("pages.login.title","Sign in to your account")),T(),ae.createElement("hr",null),ae.createElement("form",{onSubmit:C=>{C.preventDefault(),m({email:R,password:M,remember:g})},...i},ae.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ae.createElement("label",null,x("pages.login.fields.email","Email")),ae.createElement("input",{name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:R,onChange:C=>v(C.target.value)}),ae.createElement("label",null,x("pages.login.fields.password","Password")),ae.createElement("input",{type:"password",name:"password",required:!0,size:20,value:M,onChange:C=>c(C.target.value)}),o!=null?o:ae.createElement(ae.Fragment,null,ae.createElement("label",null,x("pages.login.buttons.rememberMe","Remember me"),ae.createElement("input",{name:"remember",type:"checkbox",size:20,checked:g,value:g.toString(),onChange:()=>{f(!g)}}))),ae.createElement("br",null),r!=null?r:P("/forgot-password",x("pages.login.buttons.forgotPassword","Forgot password?")),ae.createElement("input",{type:"submit",value:x("pages.login.signin","Sign in")}),t!=null?t:ae.createElement("span",null,x("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",P("/register",x("pages.login.register","Sign up"))))));return ae.createElement("div",{...a},n?n(D,p):D)};import de,{useState as Us}from"react";var Ms=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:s,formProps:a,title:n=void 0})=>{let i=N(),p=at(),{Link:d}=W(),l=i==="legacy"?d:p,[u,y]=Us(""),[R,v]=Us(""),M=k(),c=O(),{mutate:g,isLoading:f}=Cr({v3LegacyAuthProviderCompatible:Boolean(c==null?void 0:c.isLegacy)}),x=(P,T)=>P?typeof P=="string"?de.createElement(l,{to:P},T):P:null,E=()=>e?e.map(P=>{var T;return de.createElement("div",{key:P.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},de.createElement("button",{onClick:()=>g({providerName:P.name}),style:{display:"flex",alignItems:"center"}},P==null?void 0:P.icon,(T=P.label)!=null?T:de.createElement("label",null,P.label)))}):null,m=de.createElement("div",{...o},de.createElement("h1",{style:{textAlign:"center"}},M("pages.register.title","Sign up for your account")),E(),de.createElement("hr",null),de.createElement("form",{onSubmit:P=>{P.preventDefault(),g({email:u,password:R})},...a},de.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},de.createElement("label",null,M("pages.register.fields.email","Email")),de.createElement("input",{name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:u,onChange:P=>y(P.target.value)}),de.createElement("label",null,M("pages.register.fields.password","Password")),de.createElement("input",{name:"password",type:"password",required:!0,size:20,value:R,onChange:P=>v(P.target.value)}),de.createElement("input",{type:"submit",value:M("pages.register.buttons.submit","Sign up"),disabled:f}),t!=null?t:de.createElement(de.Fragment,null,de.createElement("span",null,M("pages.login.buttons.haveAccount","Have an account?")," ",x("/login",M("pages.login.signin","Sign in")))))));return de.createElement("div",{...r},s?s(m,n):m)};import Le,{useState as si}from"react";var Ls=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:s,title:a=void 0})=>{let n=k(),i=N(),p=at(),{Link:d}=W(),l=i==="legacy"?d:p,[u,y]=si(""),{mutate:R,isLoading:v}=br(),M=(g,f)=>g?typeof g=="string"?Le.createElement(l,{to:g},f):g:null,c=Le.createElement("div",{...r},Le.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Le.createElement("hr",null),Le.createElement("form",{onSubmit:g=>{g.preventDefault(),R({email:u})},...s},Le.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Le.createElement("label",null,n("pages.forgotPassword.fields.email","Email")),Le.createElement("input",{name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:u,onChange:g=>y(g.target.value)}),Le.createElement("input",{type:"submit",disabled:v,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Le.createElement("br",null),e!=null?e:Le.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",M("/login",n("pages.login.signin","Sign in"))))));return Le.createElement("div",{...t},o?o(c,a):c)};import Ve,{useState as Is}from"react";var ws=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:s=void 0})=>{let a=k(),n=O(),{mutate:i,isLoading:p}=Dr({v3LegacyAuthProviderCompatible:Boolean(n==null?void 0:n.isLegacy)}),[d,l]=Is(""),[u,y]=Is(""),R=Ve.createElement("div",{...t},Ve.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ve.createElement("hr",null),Ve.createElement("form",{onSubmit:v=>{v.preventDefault(),i({password:d,confirmPassword:u})},...o},Ve.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ve.createElement("label",null,a("pages.updatePassword.fields.password","New Password")),Ve.createElement("input",{name:"password",type:"password",required:!0,size:20,value:d,onChange:v=>l(v.target.value)}),Ve.createElement("label",null,a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ve.createElement("input",{name:"confirmPassword",type:"password",required:!0,size:20,value:u,onChange:v=>y(v.target.value)}),Ve.createElement("input",{type:"submit",disabled:p,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ve.createElement("div",{...e},r?r(R,s):R)};var ni=e=>{let{type:t}=e;return Ct.createElement(Ct.Fragment,null,(()=>{switch(t){case"register":return Ct.createElement(Ms,{...e});case"forgotPassword":return Ct.createElement(Ls,{...e});case"updatePassword":return Ct.createElement(ws,{...e});default:return Ct.createElement(Es,{...e})}})())};import Re from"react";var Yr=()=>Re.createElement(Re.Fragment,null,Re.createElement("h1",null,"Welcome on board"),Re.createElement("p",null,"Your configuration is completed."),Re.createElement("p",null,"Now you can get started by adding your resources to the"," ",Re.createElement("code",null,"`resources`")," property of ",Re.createElement("code",null,"`<Refine>`")),Re.createElement("div",{style:{display:"flex",gap:8}},Re.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Documentation")),Re.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Examples")),Re.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Community"))));import z,{useState as ai}from"react";var ii=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:z.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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:z.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}),z.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:z.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}),z.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:z.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}))}],ui=()=>{let e=nr("(max-width: 1010px)"),t=nr("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",s=()=>t?"16px":e?"20px":"24px";return z.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"}},z.createElement("div",{style:{height:"89px"}}),z.createElement("div",{style:{display:"flex",justifyContent:"center"}},z.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),z.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),z.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},z.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),z.createElement("h4",{style:{fontSize:s(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),z.createElement("div",{style:{height:"64px"}}),z.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ii.map(a=>z.createElement(ci,{key:`welcome-page-${a.title}`,card:a}))),z.createElement("div",{style:{height:"64px"}}))},ci=({card:e})=>{let{title:t,description:r,icon:o,link:s}=e,[a,n]=ai(!1);return z.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},z.createElement("div",{style:{display:"flex",alignItems:"center"}},z.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:s},o,z.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),z.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"},z.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"})))),z.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import te from"react";import{QueryClientProvider as mi,QueryClient as Fs}from"@tanstack/react-query";import{ReactQueryDevtools as fi}from"@tanstack/react-query-devtools";import{useEffect as di}from"react";import{useContext as ct}from"react";var pi="4.17.0",As=()=>{let e=vr(),t=ct(ut),r=ct(Ge),o=ct(Nt),s=ct(Qt),{i18nProvider:a}=ct(Me),n=ct(kt),i=ct(it),{resources:p}=S(),d=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),u=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,y=!!s,R=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,M=!!i.can;return{providers:{auth:e,auditLog:d,live:l,router:u,data:y,i18n:R,notification:v,accessControl:M},version:pi,resourceCount:p.length}};var li=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},Ss=()=>{let e=As();return di(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${li(e)}`},[]),null};var Qs=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(s=>!t.includes(s));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 ks from"react";var Vs=e=>{let t=ks.useRef(!1);ks.useEffect(()=>{t.current===!1&&e&&Qs(e)&&(t.current=!0)},[e])};var yi=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:s,notificationProvider:a,accessControlProvider:n,auditLogProvider:i,resources:p,DashboardPage:d,ReadyPage:l,LoginPage:u,catchAll:y,children:R,liveProvider:v,i18nProvider:M,Title:c,Layout:g,Sider:f,Header:x,Footer:E,OffLayoutArea:m,onLiveEvent:P,options:T})=>{let{optionsWithDefaults:D,disableTelemetryWithDefault:C,reactQueryWithDefaults:h}=Qr({options:T}),b=ir(()=>{var F;return h.clientConfig instanceof Fs?h.clientConfig:new Fs({...h.clientConfig,defaultOptions:{...h.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(F=h.clientConfig.defaultOptions)==null?void 0:F.queries}}})},[h.clientConfig]),I=te.useMemo(()=>typeof a=="function"?a:()=>a!=null?a:{},[a])();if(Vs(s),o&&!s&&(p!=null?p:[]).length===0)return l?te.createElement(l,null):te.createElement(Yr,null);let{RouterComponent:w=te.Fragment}=s?{}:o!=null?o:{};return te.createElement(mi,{client:b},te.createElement(es,{...I},te.createElement(co,{...e!=null?e:{},isProvided:Boolean(e)},te.createElement(lo,{...t!=null?t:{},isProvided:Boolean(t)},te.createElement(Oo,{...r},te.createElement(Go,{liveProvider:v},te.createElement(Jo,{value:o&&!s?"legacy":"new"},te.createElement(qo,{router:s},te.createElement(ps,{...o},te.createElement(jo,{resources:p!=null?p:[]},te.createElement(rs,{i18nProvider:M},te.createElement(ls,{...n!=null?n:{}},te.createElement(Cs,{...i!=null?i:{}},te.createElement(Nr,null,te.createElement(wo,{mutationMode:D.mutationMode,warnWhenUnsavedChanges:D.warnWhenUnsavedChanges,syncWithLocation:D.syncWithLocation,Title:c,undoableTimeout:D.undoableTimeout,catchAll:y,DashboardPage:d,LoginPage:u,Layout:g,Sider:f,Footer:E,Header:x,OffLayoutArea:m,hasDashboard:!!d,liveMode:D.liveMode,onLiveEvent:P,options:D},te.createElement(ss,null,te.createElement(w,null,R,!C&&te.createElement(Ss,null),te.createElement(Jr,null))))))))))))))))),h.devtoolConfig===!1?null:te.createElement(fi,{initialIsOpen:!1,position:"bottom-right",...h.devtoolConfig}))};import{useEffect as gi,useState as Ti}from"react";var ko=({notification:e})=>{let t=k(),{notificationDispatch:r}=He(),{open:o}=Te(),[s,a]=Ti(),n=()=>{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:Mt(e.seconds)},`You have ${Mt(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:Mt(e.seconds)}),e.seconds>0)){s&&clearTimeout(s);let i=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(i)}};return gi(()=>{n()},[e]),null};import Xr,{useEffect as Ri}from"react";var xi=({children:e,Layout:t,Sider:r,Header:o,Title:s,Footer:a,OffLayoutArea:n})=>{let{Layout:i,Footer:p,Header:d,Sider:l,Title:u,OffLayoutArea:y}=Ft(),R=t!=null?t:i;return Xr.createElement(R,{Sider:r!=null?r:l,Header:o!=null?o:d,Footer:a!=null?a:p,Title:s!=null?s:u,OffLayoutArea:n!=null?n:y},e,Xr.createElement(Ci,null))},Ci=()=>{let{Prompt:e}=W(),t=k(),{warnWhen:r,setWarnWhen:o}=Vt(),s=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return Ri(()=>(r&&window.addEventListener("beforeunload",s),window.removeEventListener("beforeunload",s)),[r]),Xr.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})};import Pe from"react";var Pi=()=>{let e=ne(),[t,r]=Pe.useState(void 0);return Pe.useEffect(()=>{t&&e(t)},[t]),Pe.useCallback(s=>{t||r(s)},[t])};function bi({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:s}){var D;let a=O(),n=N(),i=Boolean(a==null?void 0:a.isProvided),p=Boolean(a==null?void 0:a.isLegacy),d=n==="legacy",l=Z(),u=ne(),y=Pi(),{replace:R}=se(),{useLocation:v}=W(),M=v(),{isLoading:c,isFetching:g,isSuccess:f,data:{authenticated:x,redirectTo:E}={},refetch:m}=_t({v3LegacyAuthProviderCompatible:p});Pe.useEffect(()=>{m()},[r,o]);let P=Pe.useRef({status:c?"initial":"pending",content:s!=null?s:null});g?P.current.status="pending":g||(P.current.status="settled");let T=i?p?f:x:!0;if(P.current.status==="settled")if(T)P.current.content=Pe.createElement(Pe.Fragment,null,r!=null?r:null);else if(typeof o<"u")P.current.content=Pe.createElement(Pe.Fragment,null,o);else{let C=`${d?M==null?void 0:M.pathname:l.pathname}`.replace(/(\?.*|#.*)$/,""),h=p?typeof e=="string"?e:"/login":typeof e=="string"?e:E;if(h)if(d){let b=t?`?to=${encodeURIComponent(C)}`:"";R(`${h}${b}`)}else y({to:h,query:t?{to:(D=l.params)!=null&&D.to?l.params.to:u({to:C,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return i?Pe.createElement(Pe.Fragment,null,P.current.content):Pe.createElement(Pe.Fragment,null,r!=null?r:null)}import{useEffect as hi}from"react";var Jr=()=>{let{useLocation:e}=W(),{checkAuth:t}=X(),r=e();return hi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Pt from"react";var Di=({resource:e,action:t,params:r,fallback:o,children:s,...a})=>{var m,P;let n=N(),{resources:i}=S(),{useParams:p}=W(),{resource:d,id:l,action:u}=Z(),{resource:y,id:R,action:v}=p(),M=d==null?void 0:d.name,c=!e||e===(n==="legacy"?y:M)?(m=r==null?void 0:r.id)!=null?m:n==="legacy"?R:l:r==null?void 0:r.id,g=e!=null?e:n==="legacy"?y:M,f,x=rt();if(n==="legacy")g&&(f=x(g));else if(e){let T=$(e,i);T?f=T:f={name:e,route:e}}else if(typeof d=="string"){let T=$(d,i);T?f=T:f={name:d,route:d}}else f=d;let{data:E}=ms({resource:e!=null?e:f==null?void 0:f.name,action:(P=t!=null?t:n==="legacy"?v:u)!=null?P:"",params:r!=null?r:{id:c,resource:f}});return E!=null&&E.can?Pt.isValidElement(s)?Pt.cloneElement(s,a):Pt.createElement(Pt.Fragment,null,s):(E==null?void 0:E.can)===!1?Pt.createElement(Pt.Fragment,null,o!=null?o:null):null};import bt,{useEffect as vi}from"react";var Bs=[`
11
+ For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),p.push({label:s(`buttons.${i}`,st(i))})):p.push({label:s(l,st(i))})}return{breadcrumbs:p}};import jr from"react";var xt=(e,t,r=!1)=>{let o=[],s=Ce(e,t);for(;s;)o.push(s),s=Ce(s,t);return o.reverse(),`/${[...o,e].map(n=>{var i,p;return le((p=(i=r?n.route:void 0)!=null?i:n.identifier)!=null?p:n.name)}).join("/").replace(/^\//,"")}`};var hs=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(s=>{var d,l;let a=[],n=Ce(s,e);for(;n;)a.push(n),n=Ce(n,e);a.reverse();let i=r;a.forEach(u=>{var R,v;let y=(v=(R=t?u.route:void 0)!=null?R:u.identifier)!=null?v:u.name;i.children[y]||(i.children[y]={item:u,children:{}}),i=i.children[y]});let p=(l=(d=t?s.route:void 0)!=null?d:s.identifier)!=null?l:s.name;i.children[p]||(i.children[p]={item:s,children:{}})});let o=s=>{let a=[];return Object.keys(s.children).forEach(n=>{let i=xt(s.children[n].item,e,t),p={...s.children[n].item,key:i,children:o(s.children[n])};a.push(p)}),a};return o(r)};var Ds=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),ei=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=k(),o=Bt(),s=N(),{resource:a,resources:n}=S(),{pathname:i}=Z(),{useLocation:p}=W(),{pathname:d}=p(),l=s==="legacy"?Ds(d):i?Ds(i):void 0,u=`/${(l!=null?l:"").replace(/^\//,"")}`,y=a?xt(a,n,s==="legacy"):u!=null?u:"",R=jr.useMemo(()=>{if(!a)return[];let c=Ce(a,n),g=[xt(a,n)];for(;c;)g.push(xt(c,n)),c=Ce(c,n);return g},[]),v=jr.useCallback(c=>{var f,x,E,m,P,T,D,C;if(((E=(f=c==null?void 0:c.meta)==null?void 0:f.hide)!=null?E:(x=c==null?void 0:c.options)==null?void 0:x.hide)||!(c!=null&&c.list)&&c.children.length===0)return;let g=c.list?o({resource:c,action:"list",legacy:s==="legacy",meta:e}):void 0;if(!(t&&g&&g.match(/(\/|^):(.+?)(\/|$){1}/)))return{...c,route:g,icon:L((m=c.meta)==null?void 0:m.icon,(P=c.options)==null?void 0:P.icon,c.icon),label:(C=L((T=c==null?void 0:c.meta)==null?void 0:T.label,(D=c==null?void 0:c.options)==null?void 0:D.label))!=null?C:r(`${c.name}.${c.name}`,qe(c.name,"plural"))}},[s,e,r,t]),M=jr.useMemo(()=>{let c=hs(n,s==="legacy"),g=f=>f.flatMap(x=>{let E=g(x.children),m=v({...x,children:E});return m?[m]:[]});return g(c)},[n,s,v]);return{defaultOpenKeys:R,selectedKey:y,menuItems:M}};var G=()=>{let{params:e}=Z();return({resource:r,meta:o}={})=>{let{meta:s}=ur(r!=null?r:{}),{filters:a,sorters:n,current:i,pageSize:p,...d}=e!=null?e:{};return{...s,...d,...o}}};var oi=()=>{let[e,t]=ri(),r=k(),{push:o}=se(),s=ne(),a=N(),{resource:n,action:i}=S();return ti(()=>{n&&i&&t(r("pages.error.info",{action:i,resource:n==null?void 0:n.name},`You may have forgotten to add the "${i}" component to "${n==null?void 0:n.name}" resource.`))},[n,i]),Ht.createElement(Ht.Fragment,null,Ht.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&Ht.createElement("p",null,e),Ht.createElement("button",{onClick:()=>{a==="legacy"?o("/"):s({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import fe,{useState as vs}from"react";var Sr=()=>{let[e,t]=vs(""),[r,o]=vs(""),s=k(),a=O(),{mutate:n}=Ut({v3LegacyAuthProviderCompatible:Boolean(a==null?void 0:a.isLegacy)});return fe.createElement(fe.Fragment,null,fe.createElement("h1",null,s("pages.login.title","Sign in your account")),fe.createElement("form",{onSubmit:i=>{i.preventDefault(),n({username:e,password:r})}},fe.createElement("table",null,fe.createElement("tbody",null,fe.createElement("tr",null,fe.createElement("td",null,s("pages.login.username",void 0,"username"),":"),fe.createElement("td",null,fe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:i=>t(i.target.value)}))),fe.createElement("tr",null,fe.createElement("td",null,s("pages.login.password",void 0,"password"),":"),fe.createElement("td",null,fe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:i=>o(i.target.value)}))))),fe.createElement("br",null),fe.createElement("input",{type:"submit",value:"login"})))};import Ct from"react";import ae,{useState as Zr}from"react";var Es=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:s,wrapperProps:a,renderContent:n,formProps:i,title:p=void 0})=>{let d=N(),l=at(),{Link:u}=W(),y=d==="legacy"?u:l,[R,v]=Zr(""),[M,c]=Zr(""),[g,f]=Zr(!1),x=k(),E=O(),{mutate:m}=Ut({v3LegacyAuthProviderCompatible:Boolean(E==null?void 0:E.isLegacy)}),P=(C,h)=>C?typeof C=="string"?ae.createElement(y,{to:C},h):C:null,T=()=>e?e.map(C=>{var h;return ae.createElement("div",{key:C.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ae.createElement("button",{onClick:()=>m({providerName:C.name}),style:{display:"flex",alignItems:"center"}},C==null?void 0:C.icon,(h=C.label)!=null?h:ae.createElement("label",null,C.label)))}):null,D=ae.createElement("div",{...s},ae.createElement("h1",{style:{textAlign:"center"}},x("pages.login.title","Sign in to your account")),T(),ae.createElement("hr",null),ae.createElement("form",{onSubmit:C=>{C.preventDefault(),m({email:R,password:M,remember:g})},...i},ae.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ae.createElement("label",null,x("pages.login.fields.email","Email")),ae.createElement("input",{name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:R,onChange:C=>v(C.target.value)}),ae.createElement("label",null,x("pages.login.fields.password","Password")),ae.createElement("input",{type:"password",name:"password",required:!0,size:20,value:M,onChange:C=>c(C.target.value)}),o!=null?o:ae.createElement(ae.Fragment,null,ae.createElement("label",null,x("pages.login.buttons.rememberMe","Remember me"),ae.createElement("input",{name:"remember",type:"checkbox",size:20,checked:g,value:g.toString(),onChange:()=>{f(!g)}}))),ae.createElement("br",null),r!=null?r:P("/forgot-password",x("pages.login.buttons.forgotPassword","Forgot password?")),ae.createElement("input",{type:"submit",value:x("pages.login.signin","Sign in")}),t!=null?t:ae.createElement("span",null,x("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",P("/register",x("pages.login.register","Sign up"))))));return ae.createElement("div",{...a},n?n(D,p):D)};import de,{useState as Us}from"react";var Ms=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:s,formProps:a,title:n=void 0})=>{let i=N(),p=at(),{Link:d}=W(),l=i==="legacy"?d:p,[u,y]=Us(""),[R,v]=Us(""),M=k(),c=O(),{mutate:g,isLoading:f}=Cr({v3LegacyAuthProviderCompatible:Boolean(c==null?void 0:c.isLegacy)}),x=(P,T)=>P?typeof P=="string"?de.createElement(l,{to:P},T):P:null,E=()=>e?e.map(P=>{var T;return de.createElement("div",{key:P.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},de.createElement("button",{onClick:()=>g({providerName:P.name}),style:{display:"flex",alignItems:"center"}},P==null?void 0:P.icon,(T=P.label)!=null?T:de.createElement("label",null,P.label)))}):null,m=de.createElement("div",{...o},de.createElement("h1",{style:{textAlign:"center"}},M("pages.register.title","Sign up for your account")),E(),de.createElement("hr",null),de.createElement("form",{onSubmit:P=>{P.preventDefault(),g({email:u,password:R})},...a},de.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},de.createElement("label",null,M("pages.register.fields.email","Email")),de.createElement("input",{name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:u,onChange:P=>y(P.target.value)}),de.createElement("label",null,M("pages.register.fields.password","Password")),de.createElement("input",{name:"password",type:"password",required:!0,size:20,value:R,onChange:P=>v(P.target.value)}),de.createElement("input",{type:"submit",value:M("pages.register.buttons.submit","Sign up"),disabled:f}),t!=null?t:de.createElement(de.Fragment,null,de.createElement("span",null,M("pages.login.buttons.haveAccount","Have an account?")," ",x("/login",M("pages.login.signin","Sign in")))))));return de.createElement("div",{...r},s?s(m,n):m)};import Le,{useState as si}from"react";var Ls=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:s,title:a=void 0})=>{let n=k(),i=N(),p=at(),{Link:d}=W(),l=i==="legacy"?d:p,[u,y]=si(""),{mutate:R,isLoading:v}=br(),M=(g,f)=>g?typeof g=="string"?Le.createElement(l,{to:g},f):g:null,c=Le.createElement("div",{...r},Le.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Le.createElement("hr",null),Le.createElement("form",{onSubmit:g=>{g.preventDefault(),R({email:u})},...s},Le.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Le.createElement("label",null,n("pages.forgotPassword.fields.email","Email")),Le.createElement("input",{name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:u,onChange:g=>y(g.target.value)}),Le.createElement("input",{type:"submit",disabled:v,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Le.createElement("br",null),e!=null?e:Le.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",M("/login",n("pages.login.signin","Sign in"))))));return Le.createElement("div",{...t},o?o(c,a):c)};import Ve,{useState as Is}from"react";var ws=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:s=void 0})=>{let a=k(),n=O(),{mutate:i,isLoading:p}=Dr({v3LegacyAuthProviderCompatible:Boolean(n==null?void 0:n.isLegacy)}),[d,l]=Is(""),[u,y]=Is(""),R=Ve.createElement("div",{...t},Ve.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ve.createElement("hr",null),Ve.createElement("form",{onSubmit:v=>{v.preventDefault(),i({password:d,confirmPassword:u})},...o},Ve.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ve.createElement("label",null,a("pages.updatePassword.fields.password","New Password")),Ve.createElement("input",{name:"password",type:"password",required:!0,size:20,value:d,onChange:v=>l(v.target.value)}),Ve.createElement("label",null,a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ve.createElement("input",{name:"confirmPassword",type:"password",required:!0,size:20,value:u,onChange:v=>y(v.target.value)}),Ve.createElement("input",{type:"submit",disabled:p,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ve.createElement("div",{...e},r?r(R,s):R)};var ni=e=>{let{type:t}=e;return Ct.createElement(Ct.Fragment,null,(()=>{switch(t){case"register":return Ct.createElement(Ms,{...e});case"forgotPassword":return Ct.createElement(Ls,{...e});case"updatePassword":return Ct.createElement(ws,{...e});default:return Ct.createElement(Es,{...e})}})())};import Re from"react";var Yr=()=>Re.createElement(Re.Fragment,null,Re.createElement("h1",null,"Welcome on board"),Re.createElement("p",null,"Your configuration is completed."),Re.createElement("p",null,"Now you can get started by adding your resources to the"," ",Re.createElement("code",null,"`resources`")," property of ",Re.createElement("code",null,"`<Refine>`")),Re.createElement("div",{style:{display:"flex",gap:8}},Re.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Documentation")),Re.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Examples")),Re.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},Re.createElement("button",null,"Community"))));import z,{useState as ai}from"react";var ii=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:z.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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:z.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}),z.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:z.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}),z.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:z.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z.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"}))}],ui=()=>{let e=nr("(max-width: 1010px)"),t=nr("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",s=()=>t?"16px":e?"20px":"24px";return z.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"}},z.createElement("div",{style:{height:"89px"}}),z.createElement("div",{style:{display:"flex",justifyContent:"center"}},z.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),z.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),z.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},z.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),z.createElement("h4",{style:{fontSize:s(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),z.createElement("div",{style:{height:"64px"}}),z.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ii.map(a=>z.createElement(ci,{key:`welcome-page-${a.title}`,card:a}))),z.createElement("div",{style:{height:"64px"}}))},ci=({card:e})=>{let{title:t,description:r,icon:o,link:s}=e,[a,n]=ai(!1);return z.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},z.createElement("div",{style:{display:"flex",alignItems:"center"}},z.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:s},o,z.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),z.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"},z.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"})))),z.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import te from"react";import{QueryClientProvider as mi,QueryClient as Fs}from"@tanstack/react-query";import{ReactQueryDevtools as fi}from"@tanstack/react-query-devtools";import{useEffect as di}from"react";import{useContext as ct}from"react";var pi="4.18.0",As=()=>{let e=vr(),t=ct(ut),r=ct(Ge),o=ct(Nt),s=ct(Qt),{i18nProvider:a}=ct(Me),n=ct(kt),i=ct(it),{resources:p}=S(),d=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),u=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,y=!!s,R=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,M=!!i.can;return{providers:{auth:e,auditLog:d,live:l,router:u,data:y,i18n:R,notification:v,accessControl:M},version:pi,resourceCount:p.length}};var li=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},Ss=()=>{let e=As();return di(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${li(e)}`},[]),null};var Qs=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(s=>!t.includes(s));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 ks from"react";var Vs=e=>{let t=ks.useRef(!1);ks.useEffect(()=>{t.current===!1&&e&&Qs(e)&&(t.current=!0)},[e])};var yi=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:s,notificationProvider:a,accessControlProvider:n,auditLogProvider:i,resources:p,DashboardPage:d,ReadyPage:l,LoginPage:u,catchAll:y,children:R,liveProvider:v,i18nProvider:M,Title:c,Layout:g,Sider:f,Header:x,Footer:E,OffLayoutArea:m,onLiveEvent:P,options:T})=>{let{optionsWithDefaults:D,disableTelemetryWithDefault:C,reactQueryWithDefaults:h}=Qr({options:T}),b=ir(()=>{var F;return h.clientConfig instanceof Fs?h.clientConfig:new Fs({...h.clientConfig,defaultOptions:{...h.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(F=h.clientConfig.defaultOptions)==null?void 0:F.queries}}})},[h.clientConfig]),I=te.useMemo(()=>typeof a=="function"?a:()=>a!=null?a:{},[a])();if(Vs(s),o&&!s&&(p!=null?p:[]).length===0)return l?te.createElement(l,null):te.createElement(Yr,null);let{RouterComponent:w=te.Fragment}=s?{}:o!=null?o:{};return te.createElement(mi,{client:b},te.createElement(es,{...I},te.createElement(co,{...e!=null?e:{},isProvided:Boolean(e)},te.createElement(lo,{...t!=null?t:{},isProvided:Boolean(t)},te.createElement(Oo,{...r},te.createElement(Go,{liveProvider:v},te.createElement(Jo,{value:o&&!s?"legacy":"new"},te.createElement(qo,{router:s},te.createElement(ps,{...o},te.createElement(jo,{resources:p!=null?p:[]},te.createElement(rs,{i18nProvider:M},te.createElement(ls,{...n!=null?n:{}},te.createElement(Cs,{...i!=null?i:{}},te.createElement(Nr,null,te.createElement(wo,{mutationMode:D.mutationMode,warnWhenUnsavedChanges:D.warnWhenUnsavedChanges,syncWithLocation:D.syncWithLocation,Title:c,undoableTimeout:D.undoableTimeout,catchAll:y,DashboardPage:d,LoginPage:u,Layout:g,Sider:f,Footer:E,Header:x,OffLayoutArea:m,hasDashboard:!!d,liveMode:D.liveMode,onLiveEvent:P,options:D},te.createElement(ss,null,te.createElement(w,null,R,!C&&te.createElement(Ss,null),te.createElement(Jr,null))))))))))))))))),h.devtoolConfig===!1?null:te.createElement(fi,{initialIsOpen:!1,position:"bottom-right",...h.devtoolConfig}))};import{useEffect as gi,useState as Ti}from"react";var ko=({notification:e})=>{let t=k(),{notificationDispatch:r}=He(),{open:o}=Te(),[s,a]=Ti(),n=()=>{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:Mt(e.seconds)},`You have ${Mt(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:Mt(e.seconds)}),e.seconds>0)){s&&clearTimeout(s);let i=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(i)}};return gi(()=>{n()},[e]),null};import Xr,{useEffect as Ri}from"react";var xi=({children:e,Layout:t,Sider:r,Header:o,Title:s,Footer:a,OffLayoutArea:n})=>{let{Layout:i,Footer:p,Header:d,Sider:l,Title:u,OffLayoutArea:y}=Ft(),R=t!=null?t:i;return Xr.createElement(R,{Sider:r!=null?r:l,Header:o!=null?o:d,Footer:a!=null?a:p,Title:s!=null?s:u,OffLayoutArea:n!=null?n:y},e,Xr.createElement(Ci,null))},Ci=()=>{let{Prompt:e}=W(),t=k(),{warnWhen:r,setWarnWhen:o}=Vt(),s=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return Ri(()=>(r&&window.addEventListener("beforeunload",s),window.removeEventListener("beforeunload",s)),[r]),Xr.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})};import Pe from"react";var Pi=()=>{let e=ne(),[t,r]=Pe.useState(void 0);return Pe.useEffect(()=>{t&&e(t)},[t]),Pe.useCallback(s=>{t||r(s)},[t])};function bi({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:s}){var D;let a=O(),n=N(),i=Boolean(a==null?void 0:a.isProvided),p=Boolean(a==null?void 0:a.isLegacy),d=n==="legacy",l=Z(),u=ne(),y=Pi(),{replace:R}=se(),{useLocation:v}=W(),M=v(),{isLoading:c,isFetching:g,isSuccess:f,data:{authenticated:x,redirectTo:E}={},refetch:m}=_t({v3LegacyAuthProviderCompatible:p});Pe.useEffect(()=>{m()},[r,o]);let P=Pe.useRef({status:c?"initial":"pending",content:s!=null?s:null});g?P.current.status="pending":g||(P.current.status="settled");let T=i?p?f:x:!0;if(P.current.status==="settled")if(T)P.current.content=Pe.createElement(Pe.Fragment,null,r!=null?r:null);else if(typeof o<"u")P.current.content=Pe.createElement(Pe.Fragment,null,o);else{let C=`${d?M==null?void 0:M.pathname:l.pathname}`.replace(/(\?.*|#.*)$/,""),h=p?typeof e=="string"?e:"/login":typeof e=="string"?e:E;if(h)if(d){let b=t?`?to=${encodeURIComponent(C)}`:"";R(`${h}${b}`)}else y({to:h,query:t?{to:(D=l.params)!=null&&D.to?l.params.to:u({to:C,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return i?Pe.createElement(Pe.Fragment,null,P.current.content):Pe.createElement(Pe.Fragment,null,r!=null?r:null)}import{useEffect as hi}from"react";var Jr=()=>{let{useLocation:e}=W(),{checkAuth:t}=X(),r=e();return hi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Pt from"react";var Di=({resource:e,action:t,params:r,fallback:o,children:s,...a})=>{var m,P;let n=N(),{resources:i}=S(),{useParams:p}=W(),{resource:d,id:l,action:u}=Z(),{resource:y,id:R,action:v}=p(),M=d==null?void 0:d.name,c=!e||e===(n==="legacy"?y:M)?(m=r==null?void 0:r.id)!=null?m:n==="legacy"?R:l:r==null?void 0:r.id,g=e!=null?e:n==="legacy"?y:M,f,x=rt();if(n==="legacy")g&&(f=x(g));else if(e){let T=$(e,i);T?f=T:f={name:e,route:e}}else if(typeof d=="string"){let T=$(d,i);T?f=T:f={name:d,route:d}}else f=d;let{data:E}=ms({resource:e!=null?e:f==null?void 0:f.name,action:(P=t!=null?t:n==="legacy"?v:u)!=null?P:"",params:r!=null?r:{id:c,resource:f}});return E!=null&&E.can?Pt.isValidElement(s)?Pt.cloneElement(s,a):Pt.createElement(Pt.Fragment,null,s):(E==null?void 0:E.can)===!1?Pt.createElement(Pt.Fragment,null,o!=null?o:null):null};import bt,{useEffect as vi}from"react";var Bs=[`
12
12
  .banner {
13
13
  display: flex;
14
14
  @media (max-width: 1000px) {