@isardsat/editorial-admin 6.19.5 → 6.20.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/build/client/assets/FilePicker-DGseBDOZ.js +1 -0
- package/build/client/assets/{Loading-MKgXMPvl.js → Loading-C1QGFwZC.js} +1 -1
- package/build/client/assets/{URLInput-CPrLDhlu.js → URLInput-ATIRZflA.js} +1 -1
- package/build/client/assets/{authSlice-BI_rlf3v.js → authSlice-DWtXmmFR.js} +1 -1
- package/build/client/assets/{badge-gLcN3Bjg.js → badge-DTudhbGs.js} +1 -1
- package/build/client/assets/button-BEFuP7Ru.js +1 -0
- package/build/client/assets/chevron-down-qxzqwz13.js +1 -0
- package/build/client/assets/clear-button-DDlOMSPc.js +1 -0
- package/build/client/assets/{dashboard-Dpm8zjXn.js → dashboard-Z-q3vTcz.js} +1 -1
- package/build/client/assets/dashboard._collection-BJjjgsuR.js +1 -0
- package/build/client/assets/dashboard._collection._document-DsM6Ccoi.js +1 -0
- package/build/client/assets/dashboard._collection.new-CSCI2lHu.js +1 -0
- package/build/client/assets/dashboard._layout-BcvvHYJk.js +1 -0
- package/build/client/assets/dashboard.files-wgFLZCcb.js +1 -0
- package/build/client/assets/date-picker-BdkIUMlY.js +1 -0
- package/build/client/assets/datetime-picker-D5KjBZgW.js +1 -0
- package/build/client/assets/files-BTW5qTjQ.js +1 -0
- package/build/client/assets/home-DkI84frB.js +1 -0
- package/build/client/assets/index-6Qui8hKi.js +1 -0
- package/build/client/assets/index-BWbeFPrX.js +1 -0
- package/build/client/assets/{index-CtLWaleL.js → index-CbaefyjV.js} +1 -1
- package/build/client/assets/{index-pxU98Is7.js → index-Cgk-ojIv.js} +1 -1
- package/build/client/assets/index-DVXSV0SY.js +1 -0
- package/build/client/assets/index-F1mp4zFe.js +45 -0
- package/build/client/assets/{input-Bk91TMQj.js → input-C3iFdiD8.js} +1 -1
- package/build/client/assets/itemForm-DLH0QBUu.js +8 -0
- package/build/client/assets/manifest-31b20659.js +1 -0
- package/build/client/assets/{markdownEditor-DQlvnWfs.js → markdownEditor-DmTXZRsO.js} +2 -2
- package/build/client/assets/{root-CLpfMQQt.js → root-BYBo3WgS.js} +1 -1
- package/build/client/assets/root-CKQ4Xhj3.css +1 -0
- package/build/client/assets/{schemas-MhAKMGOb.js → schemas-D-U8dKAF.js} +1 -1
- package/build/client/assets/{utils-CCKKso3e.js → utils-B48p8Qal.js} +1 -1
- package/build/client/assets/x-D6gZWaAR.js +1 -0
- package/build/client/assets/zod-3z1GyiF_.js +1 -0
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/FilePicker-C1CJTrRE.js +0 -1
- package/build/client/assets/alert-dialog-CN-uuUVp.js +0 -7
- package/build/client/assets/clear-button-D05R9Y5Y.js +0 -1
- package/build/client/assets/dashboard._collection-WrdG5htb.js +0 -1
- package/build/client/assets/dashboard._collection._document-B1GJt2sO.js +0 -1
- package/build/client/assets/dashboard._collection.new-Diuwwt8Y.js +0 -1
- package/build/client/assets/dashboard._layout-B1StatCH.js +0 -1
- package/build/client/assets/dashboard.files-BK6IOREO.js +0 -1
- package/build/client/assets/date-picker-Dgbvfw_1.js +0 -1
- package/build/client/assets/datetime-picker-De7vM6e7.js +0 -1
- package/build/client/assets/files-Cdeyho5X.js +0 -1
- package/build/client/assets/home-DChaVk_H.js +0 -1
- package/build/client/assets/index-B0u0hYGX.js +0 -1
- package/build/client/assets/index-B2dzkZu5.js +0 -1
- package/build/client/assets/index-B3bJjaCJ.js +0 -1
- package/build/client/assets/index-BhARCKRr.js +0 -1
- package/build/client/assets/index-CHzEoQKp.js +0 -1
- package/build/client/assets/index-cCny74f5.js +0 -45
- package/build/client/assets/itemForm-CQAq1Sag.js +0 -2
- package/build/client/assets/manifest-fd6f5f23.js +0 -1
- package/build/client/assets/root-D5WeoLDH.css +0 -1
- package/build/client/assets/x-BVtfHpQX.js +0 -1
- package/build/client/assets/zod-BFfp0fV9.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as m,p as e,x as F}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{D as z,b as C}from"./utils-B48p8Qal.js";import{a as M,F as B}from"./files-BTW5qTjQ.js";import{B as l}from"./button-BEFuP7Ru.js";import{I as u}from"./input-C3iFdiD8.js";import{E}from"./external-link-ERgO2SVI.js";import{c as I}from"./createLucideIcon-BvSqmaUO.js";import{X as w}from"./x-D6gZWaAR.js";import{U}from"./upload-DhJ5wU_H.js";import"./index-CZSVchcX.js";import"./index-DLIEpuwL.js";import"./badge-DTudhbGs.js";import"./index-CbaefyjV.js";import"./trash-UKLAaALv.js";import"./chevron-down-qxzqwz13.js";import"./check-DF0ucE8d.js";const L=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],S=I("pencil",L);function V({id:h,value:t,name:p,register:x,onChange:f}){const{isLoading:n}=z(),[N,c]=m.useState(!1),[i,o]=m.useState(null),d=s=>s?/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(s):!1,b=s=>{if(s===0)return"0 Bytes";const a=1024,r=["Bytes","KB","MB","GB"],j=Math.floor(Math.log(s)/Math.log(a));return Math.round(s/Math.pow(a,j)*100)/100+" "+r[j]},y=s=>{const a=new Image;a.onload=()=>{fetch(s).then(r=>r.blob()).then(r=>{o({width:a.width,height:a.height,size:r.size,format:r.type.split("/")[1]?.toUpperCase()||s.split(".").pop()?.toUpperCase(),name:s})}).catch(r=>{console.error("Error fetching image for size:",r),o({width:a.width,height:a.height,format:s.split(".").pop()?.toUpperCase(),name:s})})},a.onerror=r=>{console.error("Error loading image for metadata:",r),o({name:s,format:s.split(".").pop()?.toUpperCase()})},a.src=s},g=s=>s?!s.startsWith("http")&&!s.startsWith("/")?`/${s}`:s:"";m.useEffect(()=>{t&&d(t)?y(g(t)):o(null)},[t]);const k=()=>{f(""),o(null)},v=s=>{c(!1),f(s)};return e.jsxs(e.Fragment,{children:[t?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"border rounded-lg p-4 bg-background",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"shrink-0",children:d(t)?e.jsx("div",{className:"w-32 h-24 rounded border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:g(t),alt:"Preview",className:"max-w-full max-h-full object-contain"})}):e.jsx("div",{className:"w-32 h-24 rounded border bg-muted flex items-center justify-center",children:e.jsx(M,{className:"w-12 h-12 text-muted-foreground"})})}),e.jsx("div",{className:"flex-1 min-w-0 space-y-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:i?.name||t.split("/").pop()}),d(t)&&i&&e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-2 text-xs text-muted-foreground",children:[i.size&&e.jsx("span",{children:b(i.size)}),i.width&&i.height&&e.jsxs("span",{children:[i.width,"x",i.height]}),i.format&&e.jsx("span",{children:i.format})]})]}),e.jsxs("div",{children:[e.jsx(l,{type:"button",variant:"ghost",size:"icon",title:"Open File",className:"h-8 w-8 shrink-0 cursor-pointer",asChild:!0,children:e.jsx(F,{to:`/${t}`,target:"_blank",children:e.jsx(E,{className:"h-4 w-4"})})}),e.jsx(l,{type:"button",variant:"ghost",size:"icon",title:"Change File",className:"h-8 w-8 shrink-0 cursor-pointer",onClick:()=>c(!0),disabled:n,children:e.jsx(S,{className:"h-4 w-4"})}),e.jsx(l,{type:"button",variant:"ghost",size:"icon",title:"Remove File",className:"h-8 w-8 shrink-0 cursor-pointer",onClick:k,disabled:n,children:e.jsx(w,{className:"h-4 w-4"})})]})]})})]})}),e.jsx(u,{id:h,...x(p),type:"hidden",value:t})]}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"relative flex items-center flex-1",children:[e.jsx(l,{type:"button",variant:"outline",className:C("w-full h-24 border-2 border-dashed",n&&"opacity-50"),onClick:()=>c(!0),disabled:n,children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(U,{className:"h-8 w-8 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:n?"Loading...":"Click to select file"})]})}),e.jsx(u,{id:h,...x(p),type:"hidden",value:""})]})}),N&&e.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-950 p-4 rounded-lg shadow-lg max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Select File"}),e.jsx(l,{onClick:()=>c(!1),children:e.jsx(w,{})})]}),e.jsx(B,{onChange:v})]})})]})}export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,p as a}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as o}from"./utils-
|
|
1
|
+
import{a as i,p as a}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as o}from"./utils-B48p8Qal.js";import{L as d}from"./loader-circle-BDUbeTTe.js";import{c as p}from"./createLucideIcon-BvSqmaUO.js";const m=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],n=p("loader",m),s=i.forwardRef(({className:e,...t},r)=>a.jsx(d,{ref:r,className:o(e,"animate-spin"),...t}));s.displayName=n.displayName;function l({message:e="Loading Editorial..."}){return a.jsxs("div",{className:"flex gap-1 items-center justify-center min-h-screen",children:[a.jsx(s,{size:"28px"}),a.jsx("p",{className:"text-gray-600",children:e})]})}export{l as L,s as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,x as r}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as s}from"./input-
|
|
1
|
+
import{p as e,x as r}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as s}from"./input-C3iFdiD8.js";import{E as i}from"./external-link-ERgO2SVI.js";import"./utils-B48p8Qal.js";import"./createLucideIcon-BvSqmaUO.js";function x({...t}){return e.jsxs("div",{className:"relative flex justify-center items-center",children:[e.jsx(s,{...t}),t.value&&e.jsx(r,{to:t.value,className:"flex items-center absolute right-0 mr-3",children:e.jsx(i,{className:"h-4 bg-white hover:text-blue-500"})})]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as y,J as L,K as m,L as S,M as i,N as C,O as b,Q as U,R as A,e as T,r as E,f as v,g as P,S as l,T as R}from"./utils-
|
|
1
|
+
import{I as y,J as L,K as m,L as S,M as i,N as C,O as b,Q as U,R as A,e as T,r as E,f as v,g as P,S as l,T as R}from"./utils-B48p8Qal.js";const I=y.withTypes(),$=L.withTypes();m.withTypes();const g=S.withTypes(),k={isLoading:!0},n=g("auth/login",async({email:s,password:e,remember:r},{rejectWithValue:d,dispatch:p})=>{try{const{auth:a}=i(),t=await C(a,r?b:U).then(()=>A(a,s,e)),h=await p(T.endpoints.getConfig.initiate(void 0)).unwrap(),f=t.user.email?.replace(/[.@]/g,"_"),w=E(v,`${h.firebase?.dbUsersPath}/${f}`),u=(await P(w)).val();if(!u)throw new Error("Not authenticated");return{user:{uid:t.user.uid,email:t.user.email??s,role:u}}}catch(a){const{auth:t}=i();return await l(t),a instanceof Error?d(a.message):d("Unknown error occured")}}),o=g("auth/signOut",async(s,{rejectWithValue:e})=>{try{const{auth:r}=i();return await l(r),null}catch(r){return r instanceof Error?e(r.message):e("Unknown error occured")}}),c=R({name:"auth",initialState:k,reducers:{setUser:(s,e)=>{s.isLoading=!1,s.user=e.payload},setLoading:(s,e)=>{s.isLoading=e.payload},clearError:s=>{s.error=void 0}},extraReducers:s=>{s.addCase(n.pending,e=>{e.isLoading=!0,e.error=void 0}).addCase(n.fulfilled,(e,r)=>{e.isLoading=!1,e.user=r.payload.user}).addCase(n.rejected,(e,r)=>{e.isLoading=!1,e.error=r.payload}).addCase(o.pending,e=>{e.isLoading=!0}).addCase(o.fulfilled,e=>{e.isLoading=!1,e.user=void 0}).addCase(o.rejected,(e,r)=>{e.isLoading=!1,e.error=r.payload})},selectors:{selectUser:s=>s.user}}),{setUser:x,setLoading:K,clearError:N}=c.actions,{selectUser:_}=c.selectors,F=c.reducer;export{K as a,F as b,$ as c,o as d,_ as e,n as l,x as s,I as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{S as o,c as s}from"./index-
|
|
1
|
+
import{p as n}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{S as o,c as s}from"./index-CbaefyjV.js";import{b as d}from"./utils-B48p8Qal.js";const c=s("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function b({className:r,variant:e,asChild:t=!1,...a}){const i=t?o:"span";return n.jsx(i,{"data-slot":"badge",className:d(c({variant:e}),r),...a})}export{b as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as a}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{S as o,c as d}from"./index-CbaefyjV.js";import{b as u}from"./utils-B48p8Qal.js";const c=d("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l({className:e,variant:r,size:t,asChild:i=!1,...s}){const n=i?o:"button";return a.jsx(n,{"data-slot":"button",className:u(c({variant:r,size:t,className:e})),...s})}export{l as B,c as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./createLucideIcon-BvSqmaUO.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as f,a as _,p as z}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as Qe,B as sn}from"./button-BEFuP7Ru.js";import{b as W}from"./utils-B48p8Qal.js";import{c as cn}from"./createLucideIcon-BvSqmaUO.js";import{C as un}from"./chevron-right-BFlMu-RJ.js";import{C as dn}from"./chevron-down-qxzqwz13.js";import{R as ln,T as fn,P as hn,C as mn}from"./index-BWbeFPrX.js";import{X as yn}from"./x-D6gZWaAR.js";const gn=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pn=cn("chevron-left",gn),wn={},me={};function ye(e,t){try{const r=(wn[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return r in me?me[r]:Xe(r,r.split(":"))}catch{if(e in me)return me[e];const n=e?.match(bn);return n?Xe(e,n.slice(1)):NaN}}const bn=/([+-]\d\d):?(\d\d)?/;function Xe(e,t){const n=+t[0],r=+(t[1]||0);return me[e]=n>0?n*60+r:n*60-r}class K extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ye(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),it(this),He(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new K(...n,t):new K(Date.now(),t)}withTimeZone(t){return new K(+this,t)}getTimezoneOffset(){return-ye(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),He(this),+this}[Symbol.for("constructDateFrom")](t){return new K(+new Date(t),this.timeZone)}}const Ve=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Ve.test(e))return;const t=e.replace(Ve,"$1UTC");K.prototype[t]&&(e.startsWith("get")?K.prototype[e]=function(){return this.internal[t]()}:(K.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),kn(this),+this},K.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),He(this),+this}))});function He(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function kn(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),it(e)}function it(e){const t=ye(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=-new Date(+n).getTimezoneOffset(),a=r-o,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const c=ye(e.timeZone,e),l=-new Date(+e).getTimezoneOffset()-c,u=c!==t,h=l-s;if(u&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);const g=ye(e.timeZone,e),p=c-g;p&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+p),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p))}}class j extends K{static tz(t,...n){return n.length?new j(...n,t):new j(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${Mn(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new j(+this,t)}[Symbol.for("constructDateFrom")](t){return new j(+new Date(t),this.timeZone)}}function Mn(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}var m;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(m||(m={}));var F;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(F||(F={}));var Q;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Q||(Q={}));var R;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(R||(R={}));const ct=6048e5,Dn=864e5,Ke=Symbol.for("constructDateFrom");function B(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ke in e?e[Ke](t):e instanceof Date?new e.constructor(t):new Date(t)}function T(e,t){return B(t||e,e)}function ut(e,t,n){const r=T(e,n?.in);return isNaN(t)?B(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function dt(e,t,n){const r=T(e,n?.in);if(isNaN(t))return B(e,NaN);if(!t)return r;const o=r.getDate(),a=B(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const i=a.getDate();return o>=i?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let vn={};function we(){return vn}function de(e,t){const n=we(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=T(e,t?.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function ge(e,t){return de(e,{...t,weekStartsOn:1})}function lt(e,t){const n=T(e,t?.in),r=n.getFullYear(),o=B(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=ge(o),i=B(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=ge(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Ue(e){const t=T(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function le(e,...t){const n=B.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function pe(e,t){const n=T(e,t?.in);return n.setHours(0,0,0,0),n}function ft(e,t,n){const[r,o]=le(n?.in,e,t),a=pe(r),i=pe(o),s=+a-Ue(a),c=+i-Ue(i);return Math.round((s-c)/Dn)}function On(e,t){const n=lt(e,t),r=B(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ge(r)}function Wn(e,t,n){return ut(e,t*7,n)}function Cn(e,t,n){return dt(e,t*12,n)}function xn(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=B.bind(null,o));const a=T(o,r);(!n||n<a||isNaN(+a))&&(n=a)}),B(r,n||NaN)}function Sn(e,t){let n,r=t?.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=B.bind(null,o));const a=T(o,r);(!n||n>a||isNaN(+a))&&(n=a)}),B(r,n||NaN)}function Nn(e,t,n){const[r,o]=le(n?.in,e,t);return+pe(r)==+pe(o)}function ht(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _n(e){return!(!ht(e)&&typeof e!="number"||isNaN(+T(e)))}function Tn(e,t,n){const[r,o]=le(n?.in,e,t),a=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return a*12+i}function Yn(e,t){const n=T(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function En(e,t){const[n,r]=le(e,t.start,t.end);return{start:n,end:r}}function Pn(e,t){const{start:n,end:r}=En(t?.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=1;const c=[];for(;+i<=a;)c.push(B(n,i)),i.setMonth(i.getMonth()+s);return o?c.reverse():c}function Fn(e,t){const n=T(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Bn(e,t){const n=T(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function mt(e,t){const n=T(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yt(e,t){const n=we(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=T(e,t?.in),a=o.getDay(),i=(a<r?-7:0)+6-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function In(e,t){return yt(e,{...t,weekStartsOn:1})}const Hn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},jn=(e,t,n)=>{let r;const o=Hn[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Pe(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const qn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},An={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rn={date:Pe({formats:qn,defaultWidth:"full"}),time:Pe({formats:An,defaultWidth:"full"}),dateTime:Pe({formats:zn,defaultWidth:"full"})},$n={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gn=(e,t,n,r)=>$n[e];function fe(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{const i=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[i]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const Zn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ln={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Xn={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Vn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Un=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Jn={ordinalNumber:Un,era:fe({values:Zn,defaultWidth:"wide"}),quarter:fe({values:Ln,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fe({values:Qn,defaultWidth:"wide"}),day:fe({values:Xn,defaultWidth:"wide"}),dayPeriod:fe({values:Vn,defaultWidth:"wide",formattingValues:Kn,defaultFormattingWidth:"wide"})};function he(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?tr(s,u=>u.test(i)):er(s,u=>u.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const l=t.slice(i.length);return{value:d,rest:l}}}function er(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function tr(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function nr(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=n.valueCallback?n.valueCallback(i):i;const s=t.slice(o.length);return{value:i,rest:s}}}const rr=/^(\d+)(th|st|nd|rd)?/i,or=/\d+/i,ar={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sr={any:[/^b/i,/^(a|c)/i]},ir={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cr={any:[/1/i,/2/i,/3/i,/4/i]},ur={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lr={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fr={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hr={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mr={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yr={ordinalNumber:nr({matchPattern:rr,parsePattern:or,valueCallback:e=>parseInt(e,10)}),era:he({matchPatterns:ar,defaultMatchWidth:"wide",parsePatterns:sr,defaultParseWidth:"any"}),quarter:he({matchPatterns:ir,defaultMatchWidth:"wide",parsePatterns:cr,defaultParseWidth:"any",valueCallback:e=>e+1}),month:he({matchPatterns:ur,defaultMatchWidth:"wide",parsePatterns:dr,defaultParseWidth:"any"}),day:he({matchPatterns:lr,defaultMatchWidth:"wide",parsePatterns:fr,defaultParseWidth:"any"}),dayPeriod:he({matchPatterns:hr,defaultMatchWidth:"any",parsePatterns:mr,defaultParseWidth:"any"})},je={code:"en-US",formatDistance:jn,formatLong:Rn,formatRelative:Gn,localize:Jn,match:yr,options:{weekStartsOn:0,firstWeekContainsDate:1}};function gr(e,t){const n=T(e,t?.in);return ft(n,mt(n))+1}function gt(e,t){const n=T(e,t?.in),r=+ge(n)-+On(n);return Math.round(r/ct)+1}function pt(e,t){const n=T(e,t?.in),r=n.getFullYear(),o=we(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=B(t?.in||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const s=de(i,t),c=B(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const d=de(c,t);return+n>=+s?r+1:+n>=+d?r:r-1}function pr(e,t){const n=we(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=pt(e,t),a=B(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),de(a,t)}function wt(e,t){const n=T(e,t?.in),r=+de(n,t)-+pr(n,t);return Math.round(r/ct)+1}function N(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const oe={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return N(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):N(n+1,2)},d(e,t){return N(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return N(e.getHours()%12||12,t.length)},H(e,t){return N(e.getHours(),t.length)},m(e,t){return N(e.getMinutes(),t.length)},s(e,t){return N(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return N(o,t.length)}},ue={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Je={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return oe.y(e,t)},Y:function(e,t,n,r){const o=pt(e,r),a=o>0?o:1-o;if(t==="YY"){const i=a%100;return N(i,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):N(a,t.length)},R:function(e,t){const n=lt(e);return N(n,t.length)},u:function(e,t){const n=e.getFullYear();return N(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return N(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return N(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return oe.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return N(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=wt(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):N(o,t.length)},I:function(e,t,n){const r=gt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):N(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):oe.d(e,t)},D:function(e,t,n){const r=gr(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):N(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return N(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return N(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return N(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ue.noon:r===0?o=ue.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ue.evening:r>=12?o=ue.afternoon:r>=4?o=ue.morning:o=ue.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return oe.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):oe.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):N(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):N(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):oe.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):oe.s(e,t)},S:function(e,t){return oe.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tt(r);case"XXXX":case"XX":return ae(r);default:return ae(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tt(r);case"xxxx":case"xx":return ae(r);default:return ae(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+et(r,":");default:return"GMT"+ae(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+et(r,":");default:return"GMT"+ae(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return N(r,t.length)},T:function(e,t,n){return N(+e,t.length)}};function et(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+N(a,2)}function tt(e,t){return e%60===0?(e>0?"-":"+")+N(Math.abs(e)/60,2):ae(e,t)}function ae(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=N(Math.trunc(r/60),2),a=N(r%60,2);return n+o+t+a}const nt=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},bt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},wr=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return nt(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",nt(r,t)).replace("{{time}}",bt(o,t))},br={p:bt,P:wr},kr=/^D+$/,Mr=/^Y+$/,Dr=["D","DD","YY","YYYY"];function vr(e){return kr.test(e)}function Or(e){return Mr.test(e)}function Wr(e,t,n){const r=Cr(e,t,n);if(console.warn(r),Dr.includes(e))throw new RangeError(r)}function Cr(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nr=/^'([^]*?)'?$/,_r=/''/g,Tr=/[a-zA-Z]/;function Yr(e,t,n){const r=we(),o=n?.locale??r.locale??je,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=T(e,n?.in);if(!_n(s))throw new RangeError("Invalid time value");let c=t.match(Sr).map(l=>{const u=l[0];if(u==="p"||u==="P"){const h=br[u];return h(l,o.formatLong)}return l}).join("").match(xr).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const u=l[0];if(u==="'")return{isToken:!1,value:Er(l)};if(Je[u])return{isToken:!0,value:l};if(u.match(Tr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:l}});o.localize.preprocessor&&(c=o.localize.preprocessor(s,c));const d={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return c.map(l=>{if(!l.isToken)return l.value;const u=l.value;(!n?.useAdditionalWeekYearTokens&&Or(u)||!n?.useAdditionalDayOfYearTokens&&vr(u))&&Wr(u,t,String(e));const h=Je[u[0]];return h(s,u,o.localize,d)}).join("")}function Er(e){const t=e.match(Nr);return t?t[1].replace(_r,"'"):e}function Pr(e,t){const n=T(e,t?.in),r=n.getFullYear(),o=n.getMonth(),a=B(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function Fr(e,t){return T(e,t?.in).getMonth()}function Br(e,t){return T(e,t?.in).getFullYear()}function Ir(e,t){return+T(e)>+T(t)}function Hr(e,t){return+T(e)<+T(t)}function jr(e,t,n){const[r,o]=le(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function qr(e,t,n){const[r,o]=le(n?.in,e,t);return r.getFullYear()===o.getFullYear()}function Ar(e,t,n){const r=T(e,n?.in),o=r.getFullYear(),a=r.getDate(),i=B(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=Pr(i);return r.setMonth(t,Math.min(a,s)),r}function zr(e,t,n){const r=T(e,n?.in);return isNaN(+r)?B(e,NaN):(r.setFullYear(t),r)}const rt=5,Rr=4;function $r(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),a=t.addDays(o,rt*7-1);return t.getMonth(e)===t.getMonth(a)?rt:Rr}function kt(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function Gr(e,t){const n=kt(e,t),r=$r(e,t);return t.addDays(n,r*7-1)}class ne{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?j.tz(this.options.timeZone):new this.Date,this.newDate=(r,o,a)=>this.overrides?.newDate?this.overrides.newDate(r,o,a):this.options.timeZone?new j(r,o,a,this.options.timeZone):new Date(r,o,a),this.addDays=(r,o)=>this.overrides?.addDays?this.overrides.addDays(r,o):ut(r,o),this.addMonths=(r,o)=>this.overrides?.addMonths?this.overrides.addMonths(r,o):dt(r,o),this.addWeeks=(r,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,o):Wn(r,o),this.addYears=(r,o)=>this.overrides?.addYears?this.overrides.addYears(r,o):Cn(r,o),this.differenceInCalendarDays=(r,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):ft(r,o),this.differenceInCalendarMonths=(r,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Tn(r,o),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Pn(r),this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Gr(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):In(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):Yn(r),this.endOfWeek=(r,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,o):yt(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):Bn(r),this.format=(r,o,a)=>{const i=this.overrides?.format?this.overrides.format(r,o,this.options):Yr(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):gt(r),this.getMonth=(r,o)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Fr(r,this.options),this.getYear=(r,o)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):Br(r,this.options),this.getWeek=(r,o)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):wt(r,this.options),this.isAfter=(r,o)=>this.overrides?.isAfter?this.overrides.isAfter(r,o):Ir(r,o),this.isBefore=(r,o)=>this.overrides?.isBefore?this.overrides.isBefore(r,o):Hr(r,o),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):ht(r),this.isSameDay=(r,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,o):Nn(r,o),this.isSameMonth=(r,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,o):jr(r,o),this.isSameYear=(r,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,o):qr(r,o),this.max=r=>this.overrides?.max?this.overrides.max(r):xn(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Sn(r),this.setMonth=(r,o)=>this.overrides?.setMonth?this.overrides.setMonth(r,o):Ar(r,o),this.setYear=(r,o)=>this.overrides?.setYear?this.overrides.setYear(r,o):zr(r,o),this.startOfBroadcastWeek=(r,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):kt(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):pe(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):ge(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Fn(r),this.startOfWeek=(r,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):de(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):mt(r),this.options={locale:je,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}}const U=new ne;class Mt{constructor(t,n,r=U){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class Zr{constructor(t,n){this.date=t,this.weeks=n}}class Lr{constructor(t,n){this.days=n,this.weekNumber=t}}function ee(e,t,n=!1,r=U){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=r;return o&&a?(i(a,o)<0&&([o,a]=[a,o]),i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)):!n&&a?s(a,t):!n&&o?s(o,t):!1}function Dt(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function qe(e){return!!(e&&typeof e=="object"&&"from"in e)}function vt(e){return!!(e&&typeof e=="object"&&"after"in e)}function Ot(e){return!!(e&&typeof e=="object"&&"before"in e)}function Wt(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Ct(e,t){return Array.isArray(e)&&e.every(t.isDate)}function te(e,t,n=U){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some(s=>{if(typeof s=="boolean")return s;if(n.isDate(s))return o(e,s);if(Ct(s,n))return s.includes(e);if(qe(s))return ee(s,e,!1,n);if(Wt(s))return Array.isArray(s.dayOfWeek)?s.dayOfWeek.includes(e.getDay()):s.dayOfWeek===e.getDay();if(Dt(s)){const c=a(s.before,e),d=a(s.after,e),l=c>0,u=d<0;return i(s.before,s.after)?u&&l:l||u}return vt(s)?a(e,s.after)>0:Ot(s)?a(s.before,e)>0:typeof s=="function"?s(e):!1})}function Qr(e,t,n,r,o){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:c,broadcastCalendar:d,today:l}=t,{isSameDay:u,isSameMonth:h,startOfMonth:g,isBefore:p,endOfMonth:O,isAfter:M}=o,v=n&&g(n),Y=r&&O(r),k={[F.focused]:[],[F.outside]:[],[F.disabled]:[],[F.hidden]:[],[F.today]:[]},P={};for(const y of e){const{date:b,displayMonth:w}=y,C=!!(w&&!h(b,w)),I=!!(v&&p(b,v)),q=!!(Y&&M(b,Y)),A=!!(a&&te(b,a,o)),$=!!(i&&te(b,i,o))||I||q||!d&&!c&&C||d&&c===!1&&C,se=u(b,l??o.today());C&&k.outside.push(y),A&&k.disabled.push(y),$&&k.hidden.push(y),se&&k.today.push(y),s&&Object.keys(s).forEach(ie=>{const ce=s?.[ie];ce&&te(b,ce,o)&&(P[ie]?P[ie].push(y):P[ie]=[y])})}return y=>{const b={[F.focused]:!1,[F.disabled]:!1,[F.hidden]:!1,[F.outside]:!1,[F.today]:!1},w={};for(const C in k){const I=k[C];b[C]=I.some(q=>q===y)}for(const C in P)w[C]=P[C].some(I=>I===y);return{...b,...w}}}function Xr(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[a])=>(n[a]?o.push(n[a]):t[F[a]]?o.push(t[F[a]]):t[Q[a]]&&o.push(t[Q[a]]),o),[t[m.Day]])}function Vr(e){return f.createElement("button",{...e})}function Kr(e){return f.createElement("span",{...e})}function Ur(e){const{size:t=24,orientation:n="left",className:r}=e;return f.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&f.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&f.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&f.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&f.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Jr(e){const{day:t,modifiers:n,...r}=e;return f.createElement("td",{...r})}function eo(e){const{day:t,modifiers:n,...r}=e,o=f.useRef(null);return f.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),f.createElement("button",{ref:o,...r})}function to(e){const{options:t,className:n,components:r,classNames:o,...a}=e,i=[o[m.Dropdown],n].join(" "),s=t?.find(({value:c})=>c===a.value);return f.createElement("span",{"data-disabled":a.disabled,className:o[m.DropdownRoot]},f.createElement(r.Select,{className:i,...a},t?.map(({value:c,label:d,disabled:l})=>f.createElement(r.Option,{key:c,value:c,disabled:l},d))),f.createElement("span",{className:o[m.CaptionLabel],"aria-hidden":!0},s?.label,f.createElement(r.Chevron,{orientation:"down",size:18,className:o[m.Chevron]})))}function no(e){return f.createElement("div",{...e})}function ro(e){return f.createElement("div",{...e})}function oo(e){const{calendarMonth:t,displayIndex:n,...r}=e;return f.createElement("div",{...r},e.children)}function ao(e){const{calendarMonth:t,displayIndex:n,...r}=e;return f.createElement("div",{...r})}function so(e){return f.createElement("table",{...e})}function io(e){return f.createElement("div",{...e})}const xt=_.createContext(void 0);function be(){const e=_.useContext(xt);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function co(e){const{components:t}=be();return f.createElement(t.Dropdown,{...e})}function uo(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:i,classNames:s,labels:{labelPrevious:c,labelNext:d}}=be(),l=_.useCallback(h=>{o&&n?.(h)},[o,n]),u=_.useCallback(h=>{r&&t?.(h)},[r,t]);return f.createElement("nav",{...a},f.createElement(i.PreviousMonthButton,{type:"button",className:s[m.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},f.createElement(i.Chevron,{disabled:r?void 0:!0,className:s[m.Chevron],orientation:"left"})),f.createElement(i.NextMonthButton,{type:"button",className:s[m.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:l},f.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:s[m.Chevron]})))}function lo(e){const{components:t}=be();return f.createElement(t.Button,{...e})}function fo(e){return f.createElement("option",{...e})}function ho(e){const{components:t}=be();return f.createElement(t.Button,{...e})}function mo(e){const{rootRef:t,...n}=e;return f.createElement("div",{...n,ref:t})}function yo(e){return f.createElement("select",{...e})}function go(e){const{week:t,...n}=e;return f.createElement("tr",{...n})}function po(e){return f.createElement("th",{...e})}function wo(e){return f.createElement("thead",{"aria-hidden":!0},f.createElement("tr",{...e}))}function bo(e){const{week:t,...n}=e;return f.createElement("th",{...n})}function ko(e){return f.createElement("th",{...e})}function Mo(e){return f.createElement("tbody",{...e})}function Do(e){const{components:t}=be();return f.createElement(t.Dropdown,{...e})}const vo=Object.freeze(Object.defineProperty({__proto__:null,Button:Vr,CaptionLabel:Kr,Chevron:Ur,Day:Jr,DayButton:eo,Dropdown:to,DropdownNav:no,Footer:ro,Month:oo,MonthCaption:ao,MonthGrid:so,Months:io,MonthsDropdown:co,Nav:uo,NextMonthButton:lo,Option:fo,PreviousMonthButton:ho,Root:mo,Select:yo,Week:go,WeekNumber:bo,WeekNumberHeader:ko,Weekday:po,Weekdays:wo,Weeks:Mo,YearsDropdown:Do},Symbol.toStringTag,{value:"Module"}));function Oo(e){return{...vo,...e}}function Wo(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Ae(){const e={};for(const t in m)e[m[t]]=`rdp-${m[t]}`;for(const t in F)e[F[t]]=`rdp-${F[t]}`;for(const t in Q)e[Q[t]]=`rdp-${Q[t]}`;for(const t in R)e[R[t]]=`rdp-${R[t]}`;return e}function St(e,t,n){return(n??new ne(t)).format(e,"LLLL y")}const Co=St;function xo(e,t,n){return(n??new ne(t)).format(e,"d")}function So(e,t=U){return t.format(e,"LLLL")}function No(e,t=U){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _o(){return""}function To(e,t,n){return(n??new ne(t)).format(e,"cccccc")}function Nt(e,t=U){return t.format(e,"yyyy")}const Yo=Nt,Eo=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:St,formatDay:xo,formatMonthCaption:Co,formatMonthDropdown:So,formatWeekNumber:No,formatWeekNumberHeader:_o,formatWeekdayName:To,formatYearCaption:Yo,formatYearDropdown:Nt},Symbol.toStringTag,{value:"Module"}));function Po(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Eo,...e}}function Fo(e,t,n,r,o){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:c,getMonth:d}=o;return c({start:i(e),end:s(e)}).map(h=>{const g=r.formatMonthDropdown(h,o),p=d(h),O=t&&h<a(t)||n&&h>a(n)||!1;return{value:p,label:g,disabled:O}})}function Bo(e,t={},n={}){let r={...t?.[m.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n?.[o]}}),r}function Io(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),a=[];for(let i=0;i<7;i++){const s=e.addDays(o,i);a.push(s)}return a}function Ho(e,t,n,r){if(!e||!t)return;const{startOfYear:o,endOfYear:a,addYears:i,getYear:s,isBefore:c,isSameYear:d}=r,l=o(e),u=a(t),h=[];let g=l;for(;c(g,u)||d(g,u);)h.push(g),g=i(g,1);return h.map(p=>{const O=n.formatYearDropdown(p,r);return{value:s(p),label:O,disabled:!1}})}function _t(e,t,n){return(n??new ne(t)).format(e,"LLLL y")}const jo=_t;function qo(e,t,n,r){let o=(r??new ne(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function Tt(e,t,n,r){let o=(r??new ne(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const Ao=Tt;function zo(){return""}function Ro(e){return"Choose the Month"}function $o(e){return"Go to the Next Month"}function Go(e){return"Go to the Previous Month"}function Zo(e,t,n){return(n??new ne(t)).format(e,"cccc")}function Lo(e,t){return`Week ${e}`}function Qo(e){return"Week Number"}function Xo(e){return"Choose the Year"}const Vo=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:jo,labelDay:Ao,labelDayButton:Tt,labelGrid:_t,labelGridcell:qo,labelMonthDropdown:Ro,labelNav:zo,labelNext:$o,labelPrevious:Go,labelWeekNumber:Lo,labelWeekNumberHeader:Qo,labelWeekday:Zo,labelYearDropdown:Xo},Symbol.toStringTag,{value:"Module"})),ke=e=>e instanceof HTMLElement?e:null,Fe=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Ko=e=>ke(e.querySelector("[data-animated-month]")),Be=e=>ke(e.querySelector("[data-animated-caption]")),Ie=e=>ke(e.querySelector("[data-animated-weeks]")),Uo=e=>ke(e.querySelector("[data-animated-nav]")),Jo=e=>ke(e.querySelector("[data-animated-weekdays]"));function ea(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const i=_.useRef(null),s=_.useRef(r),c=_.useRef(!1);_.useLayoutEffect(()=>{const d=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const l=a.isSameMonth(r[0].date,d[0].date),u=a.isAfter(r[0].date,d[0].date),h=u?n[R.caption_after_enter]:n[R.caption_before_enter],g=u?n[R.weeks_after_enter]:n[R.weeks_before_enter],p=i.current,O=e.current.cloneNode(!0);if(O instanceof HTMLElement?(Fe(O).forEach(k=>{if(!(k instanceof HTMLElement))return;const P=Ko(k);P&&k.contains(P)&&k.removeChild(P);const y=Be(k);y&&y.classList.remove(h);const b=Ie(k);b&&b.classList.remove(g)}),i.current=O):i.current=null,c.current||l||o)return;const M=p instanceof HTMLElement?Fe(p):[],v=Fe(e.current);if(v&&v.every(Y=>Y instanceof HTMLElement)&&M&&M.every(Y=>Y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const Y=Uo(e.current);Y&&(Y.style.zIndex="1"),v.forEach((k,P)=>{const y=M[P];if(!y)return;k.style.position="relative",k.style.overflow="hidden";const b=Be(k);b&&b.classList.add(h);const w=Ie(k);w&&w.classList.add(g);const C=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),Y&&(Y.style.zIndex=""),b&&b.classList.remove(h),w&&w.classList.remove(g),k.style.position="",k.style.overflow="",k.contains(y)&&k.removeChild(y)};y.style.pointerEvents="none",y.style.position="absolute",y.style.overflow="hidden",y.setAttribute("aria-hidden","true");const I=Jo(y);I&&(I.style.opacity="0");const q=Be(y);q&&(q.classList.add(u?n[R.caption_before_exit]:n[R.caption_after_exit]),q.addEventListener("animationend",C));const A=Ie(y);A&&A.classList.add(u?n[R.weeks_before_exit]:n[R.weeks_after_exit]),k.insertBefore(y,k.firstChild)})}})}function ta(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:l,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:g,endOfMonth:p,endOfWeek:O,isAfter:M,startOfBroadcastWeek:v,startOfISOWeek:Y,startOfWeek:k}=r,P=c?v(o,r):i?Y(o):k(o),y=c?h(a):i?g(p(a)):O(p(a)),b=l(y,P),w=u(a,o)+1,C=[];for(let A=0;A<=b;A++){const $=d(P,A);if(t&&M($,t))break;C.push($)}const q=(c?35:42)*w;if(s&&C.length<q){const A=q-C.length;for(let $=0;$<A;$++){const se=d(C[C.length-1],1);C.push(se)}}return C}function na(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((a,i)=>[...a,...i.days],t);return[...n,...o]},t)}function ra(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let i=0;i<o;i++){const s=r.addMonths(e,i);if(t&&s>t)break;a.push(s)}return a}function ot(e,t,n,r){const{month:o,defaultMonth:a,today:i=r.today(),numberOfMonths:s=1}=e;let c=o||a||i;const{differenceInCalendarMonths:d,addMonths:l,startOfMonth:u}=r;if(n&&d(n,c)<s-1){const h=-1*(s-1);c=l(n,h)}return t&&d(c,t)<0&&(c=t),u(c)}function oa(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:c,getISOWeek:d,getWeek:l,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:g}=r,p=e.reduce((O,M)=>{const v=n.broadcastCalendar?u(M,r):n.ISOWeek?h(M):g(M),Y=n.broadcastCalendar?a(M):n.ISOWeek?i(s(M)):c(s(M)),k=t.filter(w=>w>=v&&w<=Y),P=n.broadcastCalendar?35:42;if(n.fixedWeeks&&k.length<P){const w=t.filter(C=>{const I=P-k.length;return C>Y&&C<=o(Y,I)});k.push(...w)}const y=k.reduce((w,C)=>{const I=n.ISOWeek?d(C):l(C),q=w.find($=>$.weekNumber===I),A=new Mt(C,M,r);return q?q.days.push(A):w.push(new Lr(I,[A])),w},[]),b=new Zr(M,y);return O.push(b),O},[]);return n.reverseMonths?p.reverse():p}function aa(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:c,endOfYear:d,newDate:l,today:u}=t,{fromYear:h,toYear:g,fromMonth:p,toMonth:O}=e;!n&&p&&(n=p),!n&&h&&(n=t.newDate(h,0,1)),!r&&O&&(r=O),!r&&g&&(r=l(g,11,31));const M=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):h?n=l(h,0,1):!n&&M&&(n=o(c(e.today??u(),-100))),r?r=s(r):g?r=l(g,11,31):!r&&M&&(r=d(e.today??u())),[n&&a(n),r&&a(r)]}function sa(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,d=o?a:1,l=i(e);if(!t)return s(l,d);if(!(c(t,e)<a))return s(l,d)}function ia(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,d=o?a??1:1,l=i(e);if(!t)return s(l,-d);if(!(c(l,t)<=0))return s(l,-d)}function ca(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function We(e,t){const[n,r]=_.useState(e);return[t===void 0?n:t,r]}function ua(e,t){const[n,r]=aa(e,t),{startOfMonth:o,endOfMonth:a}=t,i=ot(e,n,r,t),[s,c]=We(i,e.month?i:void 0);_.useEffect(()=>{const b=ot(e,n,r,t);c(b)},[e.timeZone]);const d=ra(s,r,e,t),l=ta(d,e.endMonth?a(e.endMonth):void 0,e,t),u=oa(d,l,e,t),h=ca(u),g=na(u),p=ia(s,n,e,t),O=sa(s,r,e,t),{disableNavigation:M,onMonthChange:v}=e,Y=b=>h.some(w=>w.days.some(C=>C.isEqualTo(b))),k=b=>{if(M)return;let w=o(b);n&&w<o(n)&&(w=o(n)),r&&w>o(r)&&(w=o(r)),c(w),v?.(w)};return{months:u,weeks:h,days:g,navStart:n,navEnd:r,previousMonth:p,nextMonth:O,goToMonth:k,goToDay:b=>{Y(b)||k(b.date)}}}var V;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(V||(V={}));function at(e){return!e[F.disabled]&&!e[F.hidden]&&!e[F.outside]}function da(e,t,n,r){let o,a=-1;for(const i of e){const s=t(i);at(s)&&(s[F.focused]&&a<V.FocusedModifier?(o=i,a=V.FocusedModifier):r?.isEqualTo(i)&&a<V.LastFocused?(o=i,a=V.LastFocused):n(i.date)&&a<V.Selected?(o=i,a=V.Selected):s[F.today]&&a<V.Today&&(o=i,a=V.Today))}return o||(o=e.find(i=>at(t(i)))),o}function la(e,t,n,r,o,a,i){const{ISOWeek:s,broadcastCalendar:c}=a,{addDays:d,addMonths:l,addWeeks:u,addYears:h,endOfBroadcastWeek:g,endOfISOWeek:p,endOfWeek:O,max:M,min:v,startOfBroadcastWeek:Y,startOfISOWeek:k,startOfWeek:P}=i;let b={day:d,week:u,month:l,year:h,startOfWeek:w=>c?Y(w,i):s?k(w):P(w),endOfWeek:w=>c?g(w):s?p(w):O(w)}[e](n,t==="after"?1:-1);return t==="before"&&r?b=M([r,b]):t==="after"&&o&&(b=v([o,b])),b}function Yt(e,t,n,r,o,a,i,s=0){if(s>365)return;const c=la(e,t,n.date,r,o,a,i),d=!!(a.disabled&&te(c,a.disabled,i)),l=!!(a.hidden&&te(c,a.hidden,i)),u=c,h=new Mt(c,u,i);return!d&&!l?h:Yt(e,t,h,r,o,a,i,s+1)}function fa(e,t,n,r,o){const{autoFocus:a}=e,[i,s]=_.useState(),c=da(t.days,n,r||(()=>!1),i),[d,l]=_.useState(a?c:void 0);return{isFocusTarget:O=>!!c?.isEqualTo(O),setFocused:l,focused:d,blur:()=>{s(d),l(void 0)},moveFocus:(O,M)=>{if(!d)return;const v=Yt(O,M,d,t.navStart,t.navEnd,e,o);v&&(t.goToDay(v),l(v))}}}function ha(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=We(n,o?n:void 0),s=o?n:a,{isSameDay:c}=t,d=g=>s?.some(p=>c(p,g))??!1,{min:l,max:u}=e;return{selected:s,select:(g,p,O)=>{let M=[...s??[]];if(d(g)){if(s?.length===l||r&&s?.length===1)return;M=s?.filter(v=>!c(v,g))}else s?.length===u?M=[g]:M=[...M,g];return o||i(M),o?.(M,g,p,O),M},isSelected:d}}function ma(e,t,n=0,r=0,o=!1,a=U){const{from:i,to:s}=t||{},{isSameDay:c,isAfter:d,isBefore:l}=a;let u;if(!i&&!s)u={from:e,to:n>0?void 0:e};else if(i&&!s)c(i,e)?o?u={from:i,to:void 0}:u=void 0:l(e,i)?u={from:e,to:i}:u={from:i,to:e};else if(i&&s)if(c(i,e)&&c(s,e))o?u={from:i,to:s}:u=void 0;else if(c(i,e))u={from:i,to:n>0?void 0:e};else if(c(s,e))u={from:e,to:n>0?void 0:e};else if(l(e,i))u={from:e,to:s};else if(d(e,i))u={from:i,to:e};else if(d(e,s))u={from:i,to:e};else throw new Error("Invalid range");if(u?.from&&u?.to){const h=a.differenceInCalendarDays(u.to,u.from);r>0&&h>r?u={from:e,to:void 0}:n>1&&h<n&&(u={from:e,to:void 0})}return u}function ya(e,t,n=U){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let s=0;s<=i;s++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function st(e,t,n=U){return ee(e,t.from,!1,n)||ee(e,t.to,!1,n)||ee(t,e.from,!1,n)||ee(t,e.to,!1,n)}function ga(e,t,n=U){const r=Array.isArray(t)?t:[t];if(r.filter(s=>typeof s!="function").some(s=>typeof s=="boolean"?s:n.isDate(s)?ee(e,s,!1,n):Ct(s,n)?s.some(c=>ee(e,c,!1,n)):qe(s)?s.from&&s.to?st(e,{from:s.from,to:s.to},n):!1:Wt(s)?ya(e,s.dayOfWeek,n):Dt(s)?n.isAfter(s.before,s.after)?st(e,{from:n.addDays(s.after,1),to:n.addDays(s.before,-1)},n):te(e.from,s,n)||te(e.to,s,n):vt(s)||Ot(s)?te(e.from,s,n)||te(e.to,s,n):!1))return!0;const i=r.filter(s=>typeof s=="function");if(i.length){let s=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(i.some(l=>l(s)))return!0;s=n.addDays(s,1)}}return!1}function pa(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:i}=e,[s,c]=We(o,i?o:void 0),d=i?o:s;return{selected:d,select:(h,g,p)=>{const{min:O,max:M}=e,v=h?ma(h,d,O,M,a,t):void 0;return r&&n&&v?.from&&v.to&&ga({from:v.from,to:v.to},n,t)&&(v.from=h,v.to=void 0),i||c(v),i?.(v,h,g,p),v},isSelected:h=>d&&ee(d,h,!1,t)}}function wa(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=We(n,o?n:void 0),s=o?n:a,{isSameDay:c}=t;return{selected:s,select:(u,h,g)=>{let p=u;return!r&&s&&s&&c(u,s)&&(p=void 0),o||i(p),o?.(p,u,h,g),p},isSelected:u=>s?c(s,u):!1}}function ba(e,t){const n=wa(e,t),r=ha(e,t),o=pa(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function ka(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new j(t.today,t.timeZone)),t.month&&(t.month=new j(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new j(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new j(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new j(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new j(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(D=>new j(D,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new j(t.selected.from,t.timeZone):void 0,to:t.selected.to?new j(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:o,dateLib:a,locale:i,classNames:s}=_.useMemo(()=>{const D={...je,...t.locale};return{dateLib:new ne({locale:D,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:Oo(t.components),formatters:Po(t.formatters),labels:{...Vo,...t.labels},locale:D,classNames:{...Ae(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:d,navLayout:l,numberOfMonths:u=1,onDayBlur:h,onDayClick:g,onDayFocus:p,onDayKeyDown:O,onDayMouseEnter:M,onDayMouseLeave:v,onNextClick:Y,onPrevClick:k,showWeekNumber:P,styles:y}=t,{formatCaption:b,formatDay:w,formatMonthDropdown:C,formatWeekNumber:I,formatWeekNumberHeader:q,formatWeekdayName:A,formatYearDropdown:$}=r,se=ua(t,a),{days:ie,months:ce,navStart:Me,navEnd:Ce,previousMonth:G,nextMonth:Z,goToMonth:J}=se,xe=Qr(ie,t,Me,Ce,a),{isSelected:Se,select:Ne,selected:De}=ba(t,a)??{},{blur:ze,focused:Re,isFocusTarget:Et,moveFocus:$e,setFocused:ve}=fa(t,se,xe,Se??(()=>!1),a),{labelDayButton:Pt,labelGridcell:Ft,labelGrid:Bt,labelMonthDropdown:It,labelNav:Ge,labelPrevious:Ht,labelNext:jt,labelWeekday:qt,labelWeekNumber:At,labelWeekNumberHeader:zt,labelYearDropdown:Rt}=o,$t=_.useMemo(()=>Io(a,t.ISOWeek),[a,t.ISOWeek]),Ze=d!==void 0||g!==void 0,_e=_.useCallback(()=>{G&&(J(G),k?.(G))},[G,J,k]),Te=_.useCallback(()=>{Z&&(J(Z),Y?.(Z))},[J,Z,Y]),Gt=_.useCallback((D,E)=>x=>{x.preventDefault(),x.stopPropagation(),ve(D),Ne?.(D.date,E,x),g?.(D.date,E,x)},[Ne,g,ve]),Zt=_.useCallback((D,E)=>x=>{ve(D),p?.(D.date,E,x)},[p,ve]),Lt=_.useCallback((D,E)=>x=>{ze(),h?.(D.date,E,x)},[ze,h]),Qt=_.useCallback((D,E)=>x=>{const re={ArrowLeft:[x.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[x.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[x.shiftKey?"year":"week","after"],ArrowUp:[x.shiftKey?"year":"week","before"],PageUp:[x.shiftKey?"year":"month","before"],PageDown:[x.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(re[x.key]){x.preventDefault(),x.stopPropagation();const[L,Oe]=re[x.key];$e(L,Oe)}O?.(D.date,E,x)},[$e,O,t.dir]),Xt=_.useCallback((D,E)=>x=>{M?.(D.date,E,x)},[M]),Vt=_.useCallback((D,E)=>x=>{v?.(D.date,E,x)},[v]),Kt=_.useCallback(D=>E=>{const x=Number(E.target.value),re=a.setMonth(a.startOfMonth(D),x);J(re)},[a,J]),Ut=_.useCallback(D=>E=>{const x=Number(E.target.value),re=a.setYear(a.startOfMonth(D),x);J(re)},[a,J]),{className:Jt,style:en}=_.useMemo(()=>({className:[s[m.Root],t.className].filter(Boolean).join(" "),style:{...y?.[m.Root],...t.style}}),[s,t.className,t.style,y]),tn=Wo(t),Le=_.useRef(null);ea(Le,!!t.animate,{classNames:s,months:ce,focused:Re,dateLib:a});const nn={dayPickerProps:t,selected:De,select:Ne,isSelected:Se,months:ce,nextMonth:Z,previousMonth:G,goToMonth:J,getModifiers:xe,components:n,classNames:s,styles:y,labels:o,formatters:r};return f.createElement(xt.Provider,{value:nn},f.createElement(n.Root,{rootRef:t.animate?Le:void 0,className:Jt,style:en,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...tn},f.createElement(n.Months,{className:s[m.Months],style:y?.[m.Months]},!t.hideNavigation&&!l&&f.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[m.Nav],style:y?.[m.Nav],"aria-label":Ge(),onPreviousClick:_e,onNextClick:Te,previousMonth:G,nextMonth:Z}),ce.map((D,E)=>{const x=Fo(D.date,Me,Ce,r,a),re=Ho(Me,Ce,r,a);return f.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:s[m.Month],style:y?.[m.Month],key:E,displayIndex:E,calendarMonth:D},l==="around"&&!t.hideNavigation&&E===0&&f.createElement(n.PreviousMonthButton,{type:"button",className:s[m.PreviousMonthButton],tabIndex:G?void 0:-1,"aria-disabled":G?void 0:!0,"aria-label":Ht(G),onClick:_e,"data-animated-button":t.animate?"true":void 0},f.createElement(n.Chevron,{disabled:G?void 0:!0,className:s[m.Chevron],orientation:t.dir==="rtl"?"right":"left"})),f.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:s[m.MonthCaption],style:y?.[m.MonthCaption],calendarMonth:D,displayIndex:E},c?.startsWith("dropdown")?f.createElement(n.DropdownNav,{className:s[m.Dropdowns],style:y?.[m.Dropdowns]},c==="dropdown"||c==="dropdown-months"?f.createElement(n.MonthsDropdown,{className:s[m.MonthsDropdown],"aria-label":It(),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:Kt(D.date),options:x,style:y?.[m.Dropdown],value:a.getMonth(D.date)}):f.createElement("span",null,C(D.date,a)),c==="dropdown"||c==="dropdown-years"?f.createElement(n.YearsDropdown,{className:s[m.YearsDropdown],"aria-label":Rt(a.options),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:Ut(D.date),options:re,style:y?.[m.Dropdown],value:a.getYear(D.date)}):f.createElement("span",null,$(D.date,a)),f.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},b(D.date,a.options,a))):f.createElement(n.CaptionLabel,{className:s[m.CaptionLabel],role:"status","aria-live":"polite"},b(D.date,a.options,a))),l==="around"&&!t.hideNavigation&&E===u-1&&f.createElement(n.NextMonthButton,{type:"button",className:s[m.NextMonthButton],tabIndex:Z?void 0:-1,"aria-disabled":Z?void 0:!0,"aria-label":jt(Z),onClick:Te,"data-animated-button":t.animate?"true":void 0},f.createElement(n.Chevron,{disabled:Z?void 0:!0,className:s[m.Chevron],orientation:t.dir==="rtl"?"left":"right"})),E===u-1&&l==="after"&&!t.hideNavigation&&f.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[m.Nav],style:y?.[m.Nav],"aria-label":Ge(),onPreviousClick:_e,onNextClick:Te,previousMonth:G,nextMonth:Z}),f.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Bt(D.date,a.options,a)||void 0,className:s[m.MonthGrid],style:y?.[m.MonthGrid]},!t.hideWeekdays&&f.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:s[m.Weekdays],style:y?.[m.Weekdays]},P&&f.createElement(n.WeekNumberHeader,{"aria-label":zt(a.options),className:s[m.WeekNumberHeader],style:y?.[m.WeekNumberHeader],scope:"col"},q()),$t.map((L,Oe)=>f.createElement(n.Weekday,{"aria-label":qt(L,a.options,a),className:s[m.Weekday],key:Oe,style:y?.[m.Weekday],scope:"col"},A(L,a.options,a)))),f.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:s[m.Weeks],style:y?.[m.Weeks]},D.weeks.map((L,Oe)=>f.createElement(n.Week,{className:s[m.Week],key:L.weekNumber,style:y?.[m.Week],week:L},P&&f.createElement(n.WeekNumber,{week:L,style:y?.[m.WeekNumber],"aria-label":At(L.weekNumber,{locale:i}),className:s[m.WeekNumber],scope:"row",role:"rowheader"},I(L.weekNumber,a)),L.days.map(H=>{const{date:X}=H,S=xe(H);if(S[F.focused]=!S.hidden&&!!Re?.isEqualTo(H),S[Q.selected]=Se?.(X)||S.selected,qe(De)){const{from:Ye,to:Ee}=De;S[Q.range_start]=!!(Ye&&Ee&&a.isSameDay(X,Ye)),S[Q.range_end]=!!(Ye&&Ee&&a.isSameDay(X,Ee)),S[Q.range_middle]=ee(De,X,!0,a)}const rn=Bo(S,y,t.modifiersStyles),on=Xr(S,s,t.modifiersClassNames),an=!Ze&&!S.hidden?Ft(X,S,a.options,a):void 0;return f.createElement(n.Day,{key:`${a.format(X,"yyyy-MM-dd")}_${a.format(H.displayMonth,"yyyy-MM")}`,day:H,modifiers:S,className:on.join(" "),style:rn,role:"gridcell","aria-selected":S.selected||void 0,"aria-label":an,"data-day":a.format(X,"yyyy-MM-dd"),"data-month":H.outside?a.format(X,"yyyy-MM"):void 0,"data-selected":S.selected||void 0,"data-disabled":S.disabled||void 0,"data-hidden":S.hidden||void 0,"data-outside":H.outside||void 0,"data-focused":S.focused||void 0,"data-today":S.today||void 0},!S.hidden&&Ze?f.createElement(n.DayButton,{className:s[m.DayButton],style:y?.[m.DayButton],type:"button",day:H,modifiers:S,disabled:S.disabled||void 0,tabIndex:Et(H)?0:-1,"aria-label":Pt(X,S,a.options,a),onClick:Gt(H,S),onBlur:Lt(H,S),onFocus:Zt(H,S),onKeyDown:Qt(H,S),onMouseEnter:Xt(H,S),onMouseLeave:Vt(H,S)},w(X,a.options,a)):!S.hidden&&w(H.date,a.options,a))}))))))})),t.footer&&f.createElement(n.Footer,{className:s[m.Footer],style:y?.[m.Footer],role:"status","aria-live":"polite"},t.footer)))}function _a({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:o="ghost",formatters:a,components:i,...s}){const c=Ae();return z.jsx(ka,{showOutsideDays:n,className:W("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...a},classNames:{root:W("w-fit",c.root),months:W("flex gap-4 flex-col md:flex-row relative",c.months),month:W("flex flex-col w-full gap-4",c.month),nav:W("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",c.nav),button_previous:W(Qe({variant:o}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",c.button_previous),button_next:W(Qe({variant:o}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",c.button_next),month_caption:W("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",c.month_caption),dropdowns:W("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",c.dropdowns),dropdown_root:W("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",c.dropdown_root),dropdown:W("absolute bg-popover inset-0 opacity-0",c.dropdown),caption_label:W("select-none font-medium",r==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:W("flex",c.weekdays),weekday:W("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",c.weekday),week:W("flex w-full mt-2",c.week),week_number_header:W("select-none w-(--cell-size)",c.week_number_header),week_number:W("text-[0.8rem] select-none text-muted-foreground",c.week_number),day:W("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",c.day),range_start:W("rounded-l-md bg-accent",c.range_start),range_middle:W("rounded-none",c.range_middle),range_end:W("rounded-r-md bg-accent",c.range_end),today:W("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:W("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:W("text-muted-foreground opacity-50",c.disabled),hidden:W("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:l,...u})=>z.jsx("div",{"data-slot":"calendar",ref:l,className:W(d),...u}),Chevron:({className:d,orientation:l,...u})=>l==="left"?z.jsx(pn,{className:W("size-4",d),...u}):l==="right"?z.jsx(un,{className:W("size-4",d),...u}):z.jsx(dn,{className:W("size-4",d),...u}),DayButton:Ma,WeekNumber:({children:d,...l})=>z.jsx("td",{...l,children:z.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...i},...s})}function Ma({className:e,day:t,modifiers:n,...r}){const o=Ae(),a=_.useRef(null);return _.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),z.jsx(sn,{ref:a,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:W("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",o.day,e),...r})}function Ta({...e}){return z.jsx(ln,{"data-slot":"popover",...e})}function Ya({...e}){return z.jsx(fn,{"data-slot":"popover-trigger",...e})}function Ea({className:e,align:t="center",sideOffset:n=4,...r}){return z.jsx(hn,{children:z.jsx(mn,{"data-slot":"popover-content",align:t,sideOffset:n,className:W("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}const Pa=({onClear:e,visible:t=!0})=>t?z.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),e()},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded",title:"Clear",children:z.jsx(yn,{className:"w-4 h-4 text-gray-500 hover:text-black"})}):null;export{Pa as C,Ta as P,Ya as a,Ea as b,_a as c,Yr as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as w,x as C,w as k}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as c,m as j,h as H,d as N,n as L,p as M,q as S,t as I}from"./utils-
|
|
1
|
+
import{p as e,a as w,x as C,w as k}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{b as c,m as j,h as H,d as N,n as L,p as M,q as S,t as I}from"./utils-B48p8Qal.js";import{c as v,u as D,T as y,a as A,b as m,d as T,f as p,e as $,g as R,h as V}from"./index-Cgk-ojIv.js";import{B as G}from"./badge-DTudhbGs.js";import"./schemas-D-U8dKAF.js";import"./index-CbaefyjV.js";import"./schemas-CPJfa6mm.js";function Q({className:s,...a}){return e.jsx("div",{"data-slot":"skeleton",className:c("bg-accent animate-pulse rounded-md",s),...a})}function b({className:s,title:a,value:i,isLoading:o,...d}){return e.jsxs("div",{className:c("border border-border rounded-xl p-6",s),...d,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:a}),o?e.jsx(Q,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:i})]})}const f=v(),h=[f.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(s){const a=s.getValue();return e.jsx("span",{title:a,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:a})}}),f.accessor("createdAt",{header:"Created",cell(s){return j(new Date(s.getValue()))}}),f.accessor("updatedAt",{header:"Updated",cell(s){return j(new Date(s.getValue()))}})];function z(){const{data:s}=H(),{data:a}=N(),i=w.useMemo(()=>!s||!a?[]:Object.entries(s).reduce((l,[n,r])=>l.concat(Object.values(r).filter(x=>x.isDraft).map(x=>({...x,type:n}))),[]).toSorted((l,n)=>l.updatedAt>n.updatedAt?-1:1).slice(0,6),[s,a]),o=D({data:i,columns:h,getCoreRowModel:V()});return o.getRowCount()===0?null:e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Drafts"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(y,{children:[e.jsx(A,{children:o.getHeaderGroups().map(d=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:d.headers.map(t=>e.jsx(T,{children:t.isPlaceholder?null:p(t.column.columnDef.header,t.getContext())},t.id))},d.id))}),e.jsx($,{children:o.getRowModel().rows.map(d=>e.jsx(C,{to:`/admin/dashboard/${d.original.type}/${d.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:d.getVisibleCells().map(t=>e.jsx(R,{className:c("p-2"),children:p(t.column.columnDef.cell,t.getContext())},t.id))},d.id)},d.original.id))})]})})]})}const u=v(),g=[u.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(s){const a=s.getValue();return e.jsx("span",{title:a,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:a})}}),u.accessor("type",{header:"Type",cell(s){return e.jsx("span",{className:"capitalize",children:s.getValue()})}}),u.accessor("status",{header:"Status",cell(s){const a=s.getValue();return e.jsx(G,{className:c("capitalize",L[a]),children:a})}}),u.accessor("updatedAt",{header:"Updated",cell(s){const a=s.getValue();return a?j(new Date(a)):"-"}})];function O(){const{data:s}=M(),{data:a}=N(),i=w.useMemo(()=>{if(!s||!a)return[];const t=[];for(const[l,n]of Object.entries(s.collections)){for(const r of n.added)t.push({id:r.id,type:l,status:"added",updatedAt:r.updatedAt});for(const r of n.modified)t.push({id:r.id,type:l,status:"modified",updatedAt:r.updatedAt});for(const r of n.deleted)t.push({id:r.id,type:l,status:"deleted",updatedAt:void 0})}for(const[l,n]of Object.entries(s.singles))t.push({id:n.preview?.id||n.production?.id||l,type:l,status:n.status,updatedAt:n.updatedAt});return t.toSorted((l,n)=>l.updatedAt?n.updatedAt?l.updatedAt>n.updatedAt?-1:1:-1:1)},[s,a]),o=D({data:i,columns:g,getCoreRowModel:V()});if(o.getRowCount()===0)return null;const d=t=>{const l=t.original.status==="deleted",n=e.jsx(m,{className:c("grid"),style:{gridTemplateColumns:`repeat(${g.length}, minmax(150px, 1fr))`},children:t.getVisibleCells().map(r=>e.jsx(R,{className:c("p-2"),children:p(r.column.columnDef.cell,r.getContext())},r.id))},t.id);return l?e.jsx("div",{children:n},`${t.original.type}-${t.original.id}`):e.jsx(C,{to:`/admin/dashboard/${t.original.type}/${t.original.id}`,children:n},`${t.original.type}-${t.original.id}`)};return e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Unpublished Changes"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(y,{children:[e.jsx(A,{children:o.getHeaderGroups().map(t=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(150px, 1fr))`},children:t.headers.map(l=>e.jsx(T,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},t.id))}),e.jsx($,{className:"max-h-96 overflow-y-scroll",children:o.getRowModel().rows.map(d)})]})})]})}const K=k(function(){const{data:a,isLoading:i}=S(),{data:o,isLoading:d}=I();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(b,{className:"w-full sm:w-44",title:"Items",value:a,isLoading:i}),e.jsx(b,{className:"w-full sm:w-44",title:"Files",value:o,isLoading:d})]}),e.jsx(O,{}),e.jsx(z,{})]})})});export{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,a as d,x as j,R as G,w as Q}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{B as X}from"./button-BEFuP7Ru.js";import{m as T,v as L,h as J,w as K,x as v,b as C}from"./utils-B48p8Qal.js";import{I as W}from"./input-C3iFdiD8.js";import{c as Y,u as Z,T as ee,a as te,b as M,d as se,f as D,e as ae,g as le,i as ne,j as re,h as oe}from"./index-Cgk-ojIv.js";import{c as m}from"./createLucideIcon-BvSqmaUO.js";import{C as N}from"./calendar-Frbsxn98.js";import{T as ie,F as ce}from"./trash-UKLAaALv.js";import{C as de}from"./check-DF0ucE8d.js";import{X as me}from"./x-D6gZWaAR.js";import{E as z}from"./external-link-ERgO2SVI.js";import{C as R}from"./circle-check-C6CxUIig.js";import{a as he,A as pe}from"./arrow-up-C0I0e1Jt.js";import"./index-CbaefyjV.js";const ue=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],xe=m("arrow-up-down",ue);const ge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_=m("circle",ge);const fe=[["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"m3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13",key:"blevx4"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M4 11h6",key:"olkgv1"}]],S=m("letter-text",fe);const we=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],ye=m("list-checks",we);const je=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Ne=m("list",je);const be=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ke=m("plus",be),ve={boolean:R,date:N,datetime:N,markdown:S,select:Ne,multiselect:ye,string:S,url:z},x=Y(),A=(r,l,o)=>{const i=r.getValue(o),c=l.getValue(o);return!i&&!c?0:i?c?new Date(i).getTime()-new Date(c).getTime():-1:1},F=[x.accessor("id",{header(){return e.jsxs("span",{className:"flex items-center max-w-48",children:[e.jsx(_,{className:"text-gray-500 h-4"})," ID"]})},cell(r){const l=r.getValue();return e.jsx("span",{title:l,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:l})}})],Ce=[x.accessor("updatedAt",{header(){return e.jsxs("div",{className:"flex items-center max-w-48",children:[e.jsx(N,{className:"text-gray-500 h-4"})," Last updated"]})},sortingFn:A,cell(r){return T(new Date(r.getValue()))}})];function Me({itemType:r}){const{data:l}=L(r),{data:o}=J(),[i,c]=d.useState([]),[$,I]=d.useState([{id:"updatedAt",desc:!0}]),[b,g]=K(),[f,w]=d.useState(null),V=a=>w(a),B=()=>w(null),H=async a=>{try{await b({type:r,id:a}).unwrap(),w(null)}catch(s){console.error("Delete failed:",s)}},k=d.useMemo(()=>x.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(a){const s=f===a.row.original.id;return e.jsx("div",{className:"flex gap-2 justify-end",children:s?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{className:"p-1 hover:bg-muted rounded-sm text-red-600 cursor-pointer",onClick:n=>{n.preventDefault(),n.stopPropagation(),H(a.row.original.id)},disabled:g.isLoading,children:[e.jsx(de,{size:16}),e.jsx("span",{className:"sr-only",children:"Confirm delete"})]}),e.jsxs("button",{className:"p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:n=>{n.preventDefault(),n.stopPropagation(),B()},disabled:g.isLoading,children:[e.jsx(me,{size:16}),e.jsx("span",{className:"sr-only",children:"Cancel delete"})]})]}):e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:n=>{n.preventDefault(),n.stopPropagation(),V(a.row.original.id)},children:[e.jsx(ie,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})},enableSorting:!1}),[f,g.isLoading,r,b]),y=d.useMemo(()=>{if(!l)return F;const a=Object.entries(l.fields);return[...F,...a.filter(([,s])=>s.showInSummary).map(([s,n])=>x.accessor(h=>h[s],{id:s,sortingFn:n.type==="date"||n.type==="datetime"?A:"alphanumeric",header(){const h=n.isUploadedFile?ce:ve[n.type]??G.Fragment;return e.jsxs("div",{className:"flex items-center ",children:[e.jsx(h,{className:"text-gray-500 h-4 flex-shrink-0"}),n.displayName]})},cell(h){const t=h.getValue();switch(n.type){case"boolean":const E=t?R:_;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(E,{className:v("mx-auto",t?"text-green-600":"text-gray-300"),size:14})});case"url":return t?e.jsx(j,{to:t,className:"flex items-center w-48 hover:text-blue-500 overflow-hidden text-ellipsis whitespace-nowrap",title:t,children:t}):"--";case"datetime":return t?e.jsx("span",{className:" text-nowrap",title:t,children:new Date(t).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:void 0})}):"--";case"date":return t?e.jsx("span",{className:"text-nowrap",title:t,children:T(new Date(t))}):"--";case"select":return t?e.jsx("span",{title:t,className:"inline-flex items-center px-2 py-0.5 font-medium max-w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:t}):"--";case"multiselect":if(!t||Array.isArray(t)&&t.length===0)return"--";const u=Array.isArray(t)?t:[t],O=u.join(", ");return e.jsxs("span",{title:O,className:"flex items-center gap-1 w-48 overflow-hidden",children:[u.slice(0,3).map((U,q)=>e.jsx("span",{className:"inline-flex items-center px-0.5 py-0.5 font-medium whitespace-nowrap",children:U},q)),u.length>3&&e.jsxs("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:["+",u.length-3]})]});case"markdown":case"string":return n.isUploadedFile?e.jsxs("span",{title:t,className:"flex items-center w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:[e.jsx(z,{className:"h-4 shrink-0"})," ",t]}):e.jsx("span",{title:t,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:t});default:return Array.isArray(t)?t.join(", "):t}}})),...Ce,k]},[k,l]),P=d.useMemo(()=>o?.[r]?Object.values(o[r]):[],[r,o]),p=Z({data:P,columns:y,getCoreRowModel:oe(),onColumnFiltersChange:c,getFilteredRowModel:re(),onSortingChange:I,getSortedRowModel:ne(),state:{sorting:$,columnFilters:i}});return!l||!o?null:e.jsxs("div",{className:"rounded-sm border overflow-auto",children:[l.filterBy&&Object.entries(l.fields).find(([a])=>a===l.filterBy)&&e.jsx("div",{className:"flex items-center py-2 pl-2 ",children:e.jsx(W,{placeholder:`Filter ${l.filterBy}...`,value:p.getColumn(l.filterBy)?.getFilterValue()??"",onChange:a=>p.getColumn(l.filterBy||"")?.setFilterValue(a.target.value),className:"max-w-sm rounded-sm"})}),e.jsxs(ee,{children:[e.jsx(te,{className:"sticky top-0 z-50",children:p.getHeaderGroups().map(a=>e.jsx(M,{className:"grid",style:{gridTemplateColumns:`repeat(${y.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx(se,{className:v("bg-background transition-colors",s.column.getCanSort()&&"hover:bg-gray-100 cursor-default"),onClick:()=>{console.log("sorting",s.column.getIsSorted()),s.column.toggleSorting(s.column.getIsSorted()==="asc")},children:e.jsxs("div",{className:"flex items-center w-full overflow-hidden",children:[e.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap",title:s.column.columnDef.header?.toString?.()??"",children:s.isPlaceholder?null:D(s.column.columnDef.header,s.getContext())}),s.column.getCanSort()&&(s.column.getIsSorted()==="asc"?e.jsx(he,{className:"ml-2 h-4 w-4 text-foreground"}):s.column.getIsSorted()==="desc"?e.jsx(pe,{className:"ml-2 h-4 w-4 text-foreground"}):e.jsx(xe,{className:"ml-2 h-4 w-4 text-gray-400"}))]})},s.id))},a.id))}),e.jsx(ae,{children:p.getRowModel().rows.map(a=>e.jsx(j,{to:`/admin/dashboard/${r}/${a.original.id}`,children:e.jsx(M,{className:C("grid",a.original.isDraft&&"bg-orange-50 hover:bg-orange-100",f===a.original.id&&"bg-red-50 hover:bg-red-50"),style:{gridTemplateColumns:`repeat(${y.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map(s=>e.jsx(le,{className:C("h-10"),children:D(s.column.columnDef.cell,s.getContext())},s.id))})},a.id))})]})]})}const Pe=Q(function({params:l}){const{collectionId:o}=l,{data:i,isFetching:c}=L(o);return c||!i?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:i.displayName,children:i.displayName}),e.jsx(X,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(j,{to:`/admin/dashboard/${o}/new`,children:[e.jsx(ke,{}),"Create"]})})]}),e.jsx(Me,{itemType:o},o)]})})})});export{Pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as F,a as m,p as d}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as x}from"./itemForm-DLH0QBUu.js";import{v as y,y as I,p as j}from"./utils-B48p8Qal.js";import"./badge-DTudhbGs.js";import"./index-CbaefyjV.js";import"./button-BEFuP7Ru.js";import"./zod-3z1GyiF_.js";import"./index-6Qui8hKi.js";import"./index-DLIEpuwL.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-C3iFdiD8.js";import"./index-F1mp4zFe.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const B=F(function({params:l}){const{collectionId:t,documentId:e}=l,[p,o]=m.useState(void 0),{data:s,isFetching:u}=y(t),{data:f,isFetching:h}=I({itemType:t,id:e}),{data:i}=j(),g=m.useMemo(()=>{if(!i)return[];const a=i.singles[t];if(a?.changedFields)return o(a.status),a.changedFields;const n=i.collections[t];if(!n)return[];const c=n.modified.find(r=>r.id===e);return c?(o("modified"),c.changedFields):(n.added.find(r=>r.id===e)&&o("added"),[])},[i,t,e]);return!s||(u||h)?null:d.jsx("div",{className:"overflow-auto scrollbar-stable",children:d.jsx("div",{className:"p-4 gap-4",children:d.jsx(x,{itemType:t,fields:s.fields,data:f??void 0,isSingleton:s.singleton,changedFields:g,itemStatus:p},`${t}-${e}`)})})});export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as m,p as t}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as e}from"./itemForm-DLH0QBUu.js";import{v as p}from"./utils-B48p8Qal.js";import"./badge-DTudhbGs.js";import"./index-CbaefyjV.js";import"./button-BEFuP7Ru.js";import"./zod-3z1GyiF_.js";import"./index-6Qui8hKi.js";import"./index-DLIEpuwL.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-C3iFdiD8.js";import"./index-F1mp4zFe.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const _=m(function({params:r}){const{collectionId:i}=r,{data:o}=p(i);return o?t.jsx("div",{className:"overflow-auto",children:t.jsx("div",{className:" p-4 gap-4",children:t.jsx(e,{itemType:i,fields:o.fields,isNew:!0,isSingleton:o.singleton})})}):null});export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,a as r,x as N,y as Z,v as xe,z as fe,R as be,w as me,O as ge}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as je,c as z,d as ve}from"./authSlice-DWtXmmFR.js";import{b as l,d as E,h as we,j as ye,k as Ne,l as Ce,u as Se}from"./utils-B48p8Qal.js";import{t as v}from"./index-CZSVchcX.js";import{R as Y,C as J,a as ee,T as te,D as ae,P as se,O as ne,u as ke}from"./index-F1mp4zFe.js";import{X as oe}from"./x-D6gZWaAR.js";import{B as _}from"./button-BEFuP7Ru.js";import{c as C}from"./createLucideIcon-BvSqmaUO.js";import{S as R,c as _e,u as Me}from"./index-CbaefyjV.js";import{P as Pe,u as Oe,c as ze,a as A,b as Ee,d as Re,e as Ae}from"./index-6Qui8hKi.js";import{P as De,R as Ie,T as Le,a as Te,C as $e,A as Be}from"./index-DVXSV0SY.js";import{C as B}from"./chevron-down-qxzqwz13.js";import{L as P}from"./loader-circle-BDUbeTTe.js";import{A as Ge,a as He}from"./arrow-up-C0I0e1Jt.js";import{U as Fe}from"./upload-DhJ5wU_H.js";import{E as Ve}from"./external-link-ERgO2SVI.js";import{L as Ke}from"./Loading-C1QGFwZC.js";import{C as Ue}from"./chevron-right-BFlMu-RJ.js";import"./index-DLIEpuwL.js";const qe=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],We=C("blocks",qe);const Qe=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Xe=C("files",Qe);const Ze=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Ye=C("grid-3x3",Ze);const Je=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],et=C("heart",Je);const tt=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],at=C("log-out",tt);const st=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],nt=C("panel-left",st);const ot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],it=C("square",ot);function rt({...t}){return e.jsx(Y,{"data-slot":"dialog",...t})}function lt({...t}){return e.jsx(se,{"data-slot":"dialog-portal",...t})}function dt({className:t,...a}){return e.jsx(ne,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function ct({className:t,children:a,...n}){return e.jsxs(lt,{"data-slot":"dialog-portal",children:[e.jsx(dt,{}),e.jsxs(J,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(ee,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(oe,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function pt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ht({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),mt="#85EA2D",G=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=mt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function gt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(xt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx(G,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"/doc/ui",children:[e.jsx(G,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(pt,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(et,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(N,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}var jt="Separator",H="horizontal",vt=["horizontal","vertical"],ie=r.forwardRef((t,a)=>{const{decorative:n,orientation:s=H,...o}=t,i=wt(s)?s:H,p=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(Pe.div,{"data-orientation":i,...p,...o,ref:a})});ie.displayName=jt;function wt(t){return vt.includes(t)}var yt=ie;function re({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(yt,{"data-slot":"separator-root",decorative:n,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function Nt({...t}){return e.jsx(Y,{"data-slot":"sheet",...t})}function Ct({...t}){return e.jsx(se,{"data-slot":"sheet-portal",...t})}function St({className:t,...a}){return e.jsx(ne,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function kt({className:t,children:a,side:n="right",...s}){return e.jsxs(Ct,{children:[e.jsx(St,{}),e.jsxs(J,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(ee,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(oe,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _t({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Mt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function Pt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}function le({delayDuration:t=0,...a}){return e.jsx(De,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ot({...t}){return e.jsx(le,{children:e.jsx(Ie,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Le,{"data-slot":"tooltip-trigger",...t})}function Et({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Te,{children:e.jsxs($e,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(Be,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const O=768;function Rt(){const[t,a]=r.useState(void 0);return r.useEffect(()=>{const n=window.matchMedia(`(max-width: ${O-1}px)`),s=()=>{a(window.innerWidth<O)};return n.addEventListener("change",s),a(window.innerWidth<O),()=>n.removeEventListener("change",s)},[]),!!t}const At="sidebar_state",Dt=3600*24*7,It="16rem",Lt="18rem",Tt="3rem",$t="b",de=r.createContext(null);function D(){const t=r.useContext(de);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Bt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...u}){const p=Rt(),[f,h]=r.useState(!1),[x,S]=r.useState(t),m=a??x,b=r.useCallback(d=>{const c=typeof d=="function"?d(m):d;n?n(c):S(c),document.cookie=`${At}=${c}; path=/; max-age=${Dt}`},[n,m]),j=r.useCallback(()=>p?h(d=>!d):b(d=>!d),[p,b,h]);r.useEffect(()=>{const d=c=>{c.key===$t&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),j())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[j]);const w=m?"expanded":"collapsed",k=r.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:p,openMobile:f,setOpenMobile:h,toggleSidebar:j}),[w,m,b,p,f,h,j]);return e.jsx(de.Provider,{value:k,children:e.jsx(le,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":It,"--sidebar-width-icon":Tt,...o},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...u,children:i})})})}function Gt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:u,state:p,openMobile:f,setOpenMobile:h}=D();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):u?e.jsx(Nt,{open:f,onOpenChange:h,...i,children:e.jsxs(kt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Lt},side:t,children:[e.jsxs(_t,{className:"sr-only",children:[e.jsx(Mt,{children:"Sidebar"}),e.jsx(Pt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Ht({className:t,onClick:a,...n}){const{toggleSidebar:s}=D();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:o=>{a?.(o),s()},...n,children:[e.jsx(nt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ft({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Vt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function Kt({className:t,...a}){return e.jsx(re,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Ut({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function F({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function V({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function K({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function U({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function y({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const qt=_e("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function g({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...u}){const p=t?R:"button",{isMobile:f,state:h}=D(),x=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:l(qt({variant:n,size:s}),i),...u});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Ot,{children:[e.jsx(zt,{asChild:!0,children:x}),e.jsx(Et,{side:"right",align:"center",hidden:h!=="collapsed"||f,...o})]})):x}function Wt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Qt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?R:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function q({singleton:t}){const{data:a}=E(),{data:n}=we();if(!a)return null;const s=r.useMemo(()=>Object.entries(a).filter(([,o])=>t?o.singleton:!o.singleton).toSorted(([o],[i])=>o.localeCompare(i)),[a,t]);return e.jsx(e.Fragment,{children:s.map(([o,i])=>e.jsx(Wt,{children:e.jsx(Z,{to:t?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:({isActive:u})=>e.jsx(Qt,{isActive:u,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:i.displayName}),!t&&n?.[o]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[o]).length})]})})})},i.displayName))})}var M="Collapsible",[Xt]=ze(M),[Zt,I]=Xt(M),ce=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:u,...p}=t,[f,h]=Oe({prop:s,defaultProp:o??!1,onChange:u,caller:M});return e.jsx(Zt,{scope:n,disabled:i,contentId:ke(),open:f,onOpenToggle:r.useCallback(()=>h(x=>!x),[h]),children:e.jsx(A.div,{"data-state":T(f),"data-disabled":i?"":void 0,...p,ref:a})})});ce.displayName=M;var ue="CollapsibleTrigger",pe=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=I(ue,n);return e.jsx(A.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":T(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ee(t.onClick,o.onOpenToggle)})});pe.displayName=ue;var L="CollapsibleContent",he=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=I(L,t.__scopeCollapsible);return e.jsx(Re,{present:n||o.open,children:({present:i})=>e.jsx(Yt,{...s,ref:a,present:i})})});he.displayName=L;var Yt=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,u=I(L,n),[p,f]=r.useState(s),h=r.useRef(null),x=Me(a,h),S=r.useRef(0),m=S.current,b=r.useRef(0),j=b.current,w=u.open||p,k=r.useRef(w),d=r.useRef(void 0);return r.useEffect(()=>{const c=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(c)},[]),Ae(()=>{const c=h.current;if(c){d.current=d.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const $=c.getBoundingClientRect();S.current=$.height,b.current=$.width,k.current||(c.style.transitionDuration=d.current.transitionDuration,c.style.animationName=d.current.animationName),f(s)}},[u.open,s]),e.jsx(A.div,{"data-state":T(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...i,ref:x,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...t.style},children:w&&o})});function T(t){return t?"open":"closed"}var Jt=ce;function W({...t}){return e.jsx(Jt,{"data-slot":"collapsible",...t})}function Q({...t}){return e.jsx(pe,{"data-slot":"collapsible-trigger",...t})}function X({...t}){return e.jsx(he,{"data-slot":"collapsible-content",...t})}function ea(){const t=je(),[a,n]=r.useState(!1),[s,o]=ye(),[i,u]=Ne(),[p,f]=Ce(),{data:h}=Se(),{data:x}=E(),S=r.useMemo(()=>x&&!!Object.values(x).find(d=>!d.singleton),[x]),m=r.useMemo(()=>x&&!!Object.values(x).find(d=>d.singleton),[x]),b=z(d=>d.auth.user),j=async d=>{try{await s({author:d}).unwrap()?v.success("Content published successfully."):v.error("Publishing failed.")}catch(c){v.error("Publishing failed."),console.error(c)}},w=async()=>{try{await i().unwrap()?v.success("Content pulled successfully."):v.error("Pulling content failed.")}catch(d){v.error("Pulling content failed."),console.error(d)}},k=async d=>{try{await p(d).unwrap()?v.success("Content pushed successfully."):v.error("Pushing content failed.")}catch(c){v.error("Pushing content failed."),console.error(c)}};return e.jsxs(Gt,{className:"z-50",children:[e.jsx(gt,{isOpen:a,setOpen:n}),e.jsx(Ft,{className:"h-14 justify-center",children:e.jsx(F,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:h?.name})})}),e.jsx(Ut,{children:e.jsxs(F,{children:[e.jsx(V,{children:"Content"}),e.jsx(K,{children:e.jsxs(U,{children:[e.jsx(W,{className:"group/collapsible",disabled:!S,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(Ye,{}),e.jsx("span",{children:"Collections"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{})})]})}),e.jsx(W,{className:"group/collapsible",disabled:!m,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(it,{}),e.jsx("span",{children:"Singles"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{singleton:!0})})]})}),e.jsx(y,{children:e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Xe,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(y,{children:e.jsxs(g,{disabled:!0,children:[e.jsx(We,{}),e.jsx("span",{children:"Components"})]})})]})})]})}),e.jsxs(Vt,{children:[e.jsx(V,{children:"Actions"}),e.jsx(K,{children:e.jsxs(U,{children:[b?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>w(),children:[u.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Ge,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>k({author:b.email}),children:[f.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(He,{}),e.jsx("span",{children:"Push to repo"})]})})]}),b&&e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>{j(b.email)},children:[o.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Fe,{}),e.jsx("span",{children:"Publish"})]})})]})}),e.jsx(Kt,{}),e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:h?.previewUrl,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(g,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(g,{className:"cursor-pointer",onClick:()=>t(ve()),children:[e.jsx(at,{}),"Log out"]}),e.jsxs("div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",children:["Editorial v","6.20.0"]})]})]})}function ta({children:t}){const a=xe(),n=z(o=>o.auth.user),s=z(o=>o.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(Ke,{}):t}function aa(){const{pathname:t}=fe(),{data:a}=E(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(be.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Ue,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.length-1&&a[s]&&!a[s].singleton&&e.jsx(Z,{to:`/admin/dashboard/${s}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ya=me(function(){return e.jsx(ta,{children:e.jsxs(Bt,{className:"flex h-full",children:[e.jsx(ea,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Ht,{}),e.jsx(re,{orientation:"vertical",className:"h-4"}),e.jsx(aa,{})]})}),e.jsx(ge,{})]})]})})});export{ya as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as r,p as o}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{F as i}from"./files-BTW5qTjQ.js";import"./utils-B48p8Qal.js";import"./index-CZSVchcX.js";import"./index-DLIEpuwL.js";import"./badge-DTudhbGs.js";import"./index-CbaefyjV.js";import"./upload-DhJ5wU_H.js";import"./createLucideIcon-BvSqmaUO.js";import"./trash-UKLAaALv.js";import"./chevron-down-qxzqwz13.js";import"./check-DF0ucE8d.js";import"./x-D6gZWaAR.js";const j=r(function(){return o.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:o.jsx("div",{className:"flex flex-col flex-1 gap-8",children:o.jsx(i,{})})})});export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as r}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{B as l}from"./button-BEFuP7Ru.js";import{P as n,a as p,f as c,C as f,b as u,c as x}from"./clear-button-DDlOMSPc.js";import{b as d}from"./utils-B48p8Qal.js";import{C as j}from"./calendar-Frbsxn98.js";import"./index-CbaefyjV.js";import"./createLucideIcon-BvSqmaUO.js";import"./chevron-right-BFlMu-RJ.js";import"./chevron-down-qxzqwz13.js";import"./index-BWbeFPrX.js";import"./index-6Qui8hKi.js";import"./index-DLIEpuwL.js";import"./index-F1mp4zFe.js";import"./x-D6gZWaAR.js";function S({id:e,date:t,onDateChange:o,placeholder:s="Pick a date",disabled:i=!1,className:a,allowClear:m=!1}){return r.jsxs(n,{children:[r.jsx(p,{asChild:!0,children:r.jsx(l,{variant:"outline",className:d("w-full justify-start text-left font-normal relative",!t&&"text-muted-foreground",a),disabled:i,children:r.jsxs(r.Fragment,{children:[r.jsx(j,{className:"mr-2 h-4 w-4"}),t?c(t,"PPP"):r.jsx("span",{children:s}),r.jsx(f,{onClear:()=>{o?.(void 0)},visible:m&&!!t})]})})}),r.jsx(u,{className:"w-auto p-0",children:r.jsx(x,{id:e,mode:"single",selected:t,onSelect:o,initialFocus:!0})})]})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,p as s}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{B as C}from"./button-BEFuP7Ru.js";import{f as c,P as N,a as H,C as S,b as g,c as k}from"./clear-button-DDlOMSPc.js";import{I as B}from"./input-C3iFdiD8.js";import{b as E}from"./utils-B48p8Qal.js";import{C as w}from"./calendar-Frbsxn98.js";import"./index-CbaefyjV.js";import"./createLucideIcon-BvSqmaUO.js";import"./chevron-right-BFlMu-RJ.js";import"./chevron-down-qxzqwz13.js";import"./index-BWbeFPrX.js";import"./index-6Qui8hKi.js";import"./index-DLIEpuwL.js";import"./index-F1mp4zFe.js";import"./x-D6gZWaAR.js";function Q({id:d,date:t,onDateTimeChange:r,placeholder:x="Pick a date and time",disabled:u=!1,className:j,allowClear:v=!1}){const[e,i]=a.useState(t),[m,p]=a.useState(t?c(t,"HH:mm"):"12:00");a.useEffect(()=>{i(t),t&&p(c(t,"HH:mm"))},[t]);const h=a.useCallback(o=>{const l=o.target.value;if(p(l),!e)return;const[n,b]=l.split(":").map(Number),f=new Date(e);f.setHours(n,b,0,0),r?.(f)},[e,r]),P=a.useCallback(o=>{if(!o){i(void 0),r?.(void 0);return}const[l,n]=m.split(":").map(Number);o.setHours(l,n,0,0),i(o),r?.(o)},[m,r]);return s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(N,{children:[s.jsx(H,{asChild:!0,children:s.jsx(C,{variant:"outline",className:E("flex-1 justify-start text-left font-normal relative",!e&&"text-muted-foreground",j),disabled:u,children:s.jsxs(s.Fragment,{children:[s.jsx(w,{className:"mr-2 h-4 w-4"}),e?c(e,"PPP"):s.jsx("span",{children:x}),s.jsx(S,{onClear:()=>{i(void 0),r?.(void 0)},visible:v&&!!t})]})})}),s.jsx(g,{className:"w-auto p-0",children:s.jsx(k,{id:d,mode:"single",selected:e,onSelect:P,initialFocus:!0})})]}),s.jsx(B,{type:"time",value:m,onChange:h,disabled:u||!e,className:"w-32"})]})}export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,p as e,x as q}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{D as Z,E as G,F as B,G as K,u as Q,b as U,H as W}from"./utils-B48p8Qal.js";import{t as n}from"./index-CZSVchcX.js";import{B as O}from"./badge-DTudhbGs.js";import{U as T}from"./upload-DhJ5wU_H.js";import{c as v}from"./createLucideIcon-BvSqmaUO.js";import{F as X,T as J}from"./trash-UKLAaALv.js";import{C as Y}from"./chevron-down-qxzqwz13.js";import{C as H}from"./check-DF0ucE8d.js";import{X as _}from"./x-D6gZWaAR.js";const A=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ee=v("copy",A);const te=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],se=v("file-text",te);const ae=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],re=v("file",ae);const le=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],oe=v("folder-open",le);const ie=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],R=v("folder-plus",ie);const ne=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],E=v("folder",ne),ce=["txt","md","html","pdf"],de=["svg","webp","png","jpeg","jpg"],pe=[{Icon:X,test:t=>de.some(l=>t.name.endsWith(l))},{Icon:se,test:t=>ce.some(l=>t.name.endsWith(l))}],me={Icon:re};function I(t){return!(!t.trim()||t==="."||t===".."||t.includes("/")||t.includes("\\"))}function ue({visible:t,onConfirm:l,onCancel:h,disabled:d}){const[c,m]=f.useState("");return f.useEffect(()=>{t&&m("")},[t]),t?e.jsxs("div",{className:"flex items-center gap-2 h-10 p-2 border-b",onClick:i=>i.stopPropagation(),children:[e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[e.jsx(E,{size:16,className:"text-yellow-500"}),e.jsx("input",{autoFocus:!0,value:c,onChange:i=>m(i.target.value),onKeyDown:i=>{i.key==="Enter"&&l(c),i.key==="Escape"&&h()},placeholder:"New folder name",className:"h-8 flex-1 rounded-md border px-2 text-sm",disabled:d})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:"--"})}),e.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[e.jsx("button",{className:"p-1 hover:bg-muted rounded-sm disabled:opacity-50",title:"Create",onClick:()=>l(c),disabled:d||!c.trim(),children:e.jsx(H,{size:16})}),e.jsx("button",{className:"p-1 hover:bg-muted rounded-sm",title:"Cancel",onClick:h,disabled:d,children:e.jsx(_,{size:16})})]})]}):null}const V=({node:t,level:l=0,onDelete:h,onChange:d,disableActions:c,onUpload:m,createTarget:i,onStartCreateInDirectory:N,onConfirmCreateInDirectory:y,onCancelCreate:p,deleteTarget:b,onStartDelete:g,onCancelDelete:C,onConfirmDelete:D,isDeleting:w})=>{const[x,z]=f.useState(!1),[k,F]=f.useState(""),{data:P}=Q(),L=pe.find(s=>s.test(t))??me,o=t.type==="directory",M=o||d?"div":q,a=i?.kind==="directory"&&o&&i.path===t.relativePath,r=b===t.relativePath;f.useEffect(()=>{a&&F("")},[a]);const u=()=>{o&&z(!x)},$=s=>{const j=s.target.files;j&&m&&m(t.relativePath,j)},S=()=>{y(t.relativePath,k)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(M,{to:`/${t.relativePath}`,target:"_blank",className:U("flex items-center gap-2 h-10 p-2 group hover:bg-muted/50 cursor-pointer",r&&"bg-red-50 hover:bg-red-50"),style:{paddingLeft:`calc(0.5rem + ${l*20}px)`},onClick:o?u:d?()=>d(t.isLarge?`${P?.largeFilesUrl}/${t.relativePath}`:t.relativePath):void 0,children:[o?e.jsx(Y,{size:16,className:U("transition-transform",{"rotate-180":x})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[o?x?e.jsx(oe,{size:16,className:"text-yellow-500"}):e.jsx(E,{size:16,className:"text-yellow-500"}):e.jsx(L.Icon,{size:16,className:" text-gray-500"}),e.jsxs("span",{className:"flex gap-2 items-center text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:[!o&&t.isLarge&&e.jsx(O,{variant:"outline",children:"Large"}),t.name]})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:o?"--":W(t.size)})}),!c&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-50",children:[o&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"file",multiple:!0,onChange:$,className:"hidden",id:`dir-upload-${t.relativePath}-${l}`}),e.jsxs("label",{htmlFor:`dir-upload-${t.relativePath}-${l}`,className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:s=>s.stopPropagation(),children:[e.jsx(T,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files to this folder"})]}),e.jsxs("button",{className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:s=>{s.preventDefault(),s.stopPropagation(),z(!0),N(t.relativePath)},title:"Create Folder",children:[e.jsx(R,{size:16}),e.jsx("span",{className:"sr-only",children:"Create folder in this directory"})]})]}),e.jsxs("button",{className:U("hover:text-yellow-500 p-1 hover:bg-muted rounded-sm cursor-pointer",o&&"hidden"),onClick:async s=>{s.preventDefault(),s.stopPropagation();try{await navigator.clipboard.writeText(t.path),n.success("File URL copied to clipboard",{duration:2e3})}catch(j){console.error("Copy failed:",j),n.error("Failed to copy to clipboard",{duration:2e3})}},title:"Copy file URL",children:[e.jsx(ee,{size:16}),e.jsx("span",{className:"sr-only",children:"Copy file URL"})]}),r?e.jsxs("div",{className:"flex items-center gap-1",onClick:s=>s.stopPropagation(),children:[e.jsxs("button",{className:"p-1 hover:bg-muted rounded-sm disabled:opacity-50 text-red-600 cursor-pointer",title:"Confirm delete",onClick:s=>{s.preventDefault(),s.stopPropagation(),D(t.relativePath)},disabled:w,children:[e.jsx(H,{size:16}),e.jsx("span",{className:"sr-only",children:"Confirm delete"})]}),e.jsxs("button",{className:"p-1 hover:bg-muted rounded-sm disabled:opacity-50 cursor-pointer",title:"Cancel",onClick:s=>{s.preventDefault(),s.stopPropagation(),C()},disabled:w,children:[e.jsx(_,{size:16}),e.jsx("span",{className:"sr-only",children:"Cancel delete"})]})]}):e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:s=>{s.preventDefault(),s.stopPropagation(),g(t.relativePath)},title:`Delete this ${o?"folder":"file"}`,children:[e.jsx(J,{size:16}),e.jsxs("span",{className:"sr-only",children:["Delete this ",o?"folder":"file"]})]})]})]}),o&&x&&e.jsxs("div",{children:[!c&&a&&e.jsxs("div",{className:"flex items-center gap-2 h-10 p-2",style:{paddingLeft:`calc(0.5rem + ${(l+1)*20}px)`},onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"w-4"}),e.jsx(E,{size:16,className:"text-yellow-500"}),e.jsx("input",{autoFocus:!0,value:k,onChange:s=>F(s.target.value),onKeyDown:s=>{s.key==="Enter"&&S(),s.key==="Escape"&&p()},placeholder:"New folder name",className:"h-8 flex-1 rounded-md border px-2 text-sm"}),e.jsx("button",{className:"p-1 hover:bg-muted rounded-sm disabled:opacity-50",title:"Create",onClick:S,disabled:!k.trim(),children:e.jsx(H,{size:16})}),e.jsx("button",{className:"p-1 hover:bg-muted rounded-sm",title:"Cancel",onClick:p,children:e.jsx(_,{size:16})})]}),t.children?.map((s,j)=>e.jsx(V,{node:s,level:l+1,onDelete:h,onChange:d,disableActions:c,onUpload:m,createTarget:i,onStartCreateInDirectory:N,onConfirmCreateInDirectory:y,onCancelCreate:p,deleteTarget:b,onStartDelete:g,onCancelDelete:C,onConfirmDelete:D,isDeleting:w},`${s.name}-${j}`))]})]})};function we({disableActions:t,onChange:l}){const{data:h}=Z(),[d,c]=G(),[m]=B(),[i,N]=K(),[y,p]=f.useState(null),[b,g]=f.useState(null),C=async({files:a,path:r})=>{try{await m({files:a,path:r}).unwrap(),n.success("Files uploaded",{duration:2e3})}catch(u){console.error("Upload failed:",u),n.error("Upload failed",{duration:2e3})}},D=async a=>{const r=a.target.files;r&&await C({files:r})},w=async(a,r)=>{await C({files:r,path:a})},x=()=>p(null),z=async a=>{const r=a.trim();if(!I(r)){n.error("Invalid folder name",{duration:2e3});return}try{await i({name:r,path:""}).unwrap(),n.success("Folder created",{duration:2e3}),p(null)}catch(u){console.error("Create folder failed:",u),n.error("Create folder failed",{duration:2e3})}},k=async(a,r)=>{const u=r.trim();if(!I(u)){n.error("Invalid folder name",{duration:2e3});return}try{await i({name:u,path:a}).unwrap(),n.success("Folder created",{duration:2e3}),p(null)}catch($){console.error("Create folder failed:",$),n.error("Create folder failed",{duration:2e3})}},F=async a=>{try{await d(a).unwrap(),n.success("Moved to deleted",{duration:2e3})}catch(r){console.error("Delete failed:",r),n.error("Delete failed",{duration:2e3})}},P=a=>{g(a)},L=()=>{g(null)},o=async a=>{await F(a),g(null)},M=f.useMemo(()=>h?.toSorted((a,r)=>a.type==="directory"&&r.type!=="directory"?-1:a.type!=="directory"&&r.type==="directory"?1:a.name.localeCompare(r.name)).map(a=>e.jsx(V,{node:a,onDelete:F,onChange:l,disableActions:t,onUpload:w,createTarget:y,onStartCreateInDirectory:r=>p({kind:"directory",path:r}),onConfirmCreateInDirectory:k,onCancelCreate:x,deleteTarget:b,onStartDelete:P,onCancelDelete:L,onConfirmDelete:o,isDeleting:c.isLoading},a.name)),[h,t,l,y,b,c.isLoading]);return e.jsxs("div",{className:"overflow-auto h-full max-w-[800px] rounded-xl border",children:[e.jsxs("div",{className:"sticky top-0 bg-white flex items-center gap-2 py-1 px-2 border-b group",children:[e.jsx("div",{className:"w-4"}),e.jsx("div",{className:"flex flex-grow items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Name"})}),e.jsx("div",{className:"flex w-24 items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Size"})}),!t&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"file",multiple:!0,onChange:D,className:"hidden",id:"file-upload"}),e.jsxs("label",{htmlFor:"file-upload",className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",title:"Upload File",children:[e.jsx(T,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files"})]}),e.jsxs("button",{onClick:()=>p({kind:"root"}),className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",title:"Create Folder",disabled:N.isLoading,children:[e.jsx(R,{size:16}),e.jsx("span",{className:"sr-only",children:"Create folder"})]})]})]}),!t&&e.jsx(ue,{visible:y?.kind==="root",disabled:N.isLoading,onConfirm:z,onCancel:x}),M]})}export{we as F,re as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,p as e,w as j,v as g}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{S as b,L as N}from"./Loading-C1QGFwZC.js";import{B as w}from"./button-BEFuP7Ru.js";import{u as F,a as L,F as v,b as t,c as n,d,e as i,f as m,C as y}from"./zod-3z1GyiF_.js";import{I as x}from"./input-C3iFdiD8.js";import{u as C,c,l as S}from"./authSlice-DWtXmmFR.js";import{o as E,s as p,b as k}from"./schemas-CPJfa6mm.js";import"./utils-B48p8Qal.js";import"./loader-circle-BDUbeTTe.js";import"./createLucideIcon-BvSqmaUO.js";import"./index-CbaefyjV.js";import"./index-6Qui8hKi.js";import"./index-DLIEpuwL.js";import"./check-DF0ucE8d.js";const P=E({email:p().nonempty("Please enter your email").email(),password:p().nonempty("Please enter your password"),remember:k()});function A(){"use no memo";const o=C(),r=c(s=>s.auth.isLoading),a=F({resolver:L(P),disabled:r,defaultValues:{email:"",password:"",remember:!1}}),l=u.useCallback(({email:s,password:h,remember:f})=>{o(S({email:s,password:h,remember:f}))},[o]);return e.jsx("div",{className:"flex flex-col",children:e.jsx(v,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[e.jsx(t,{control:a.control,name:"email",rules:{required:!0},render:({field:s})=>e.jsxs(n,{children:[e.jsx(d,{className:"flex gap-1 items-baseline",children:"Email"}),e.jsx(i,{children:e.jsx(x,{placeholder:"callasmaria@example.com",...s,autoComplete:"email"})}),e.jsx(m,{})]})}),e.jsx(t,{name:"password",control:a.control,rules:{required:!0},render:({field:s})=>e.jsxs(n,{children:[e.jsx(d,{className:"flex gap-1 items-baseline",children:"Password"}),e.jsx(i,{children:e.jsx(x,{type:"password",...s,autoComplete:"current-password"})}),e.jsx(m,{})]})}),e.jsx(t,{name:"remember",control:a.control,render:({field:s})=>e.jsxs(n,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(y,{id:"remember",checked:s.value,onCheckedChange:s.onChange}),e.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),e.jsx(m,{})]})}),e.jsx(w,{type:"submit",disabled:!a.formState.isValid||r,className:"w-full",children:r?e.jsx(b,{className:"absolute"}):"Login"})]})})})}const Q=j(function(){const r=g(),a=c(s=>s.auth.user),l=c(s=>s.auth.isLoading);return u.useEffect(()=>{a&&r("/admin/dashboard")},[r,a]),l||a?e.jsx(N,{message:"Logging in..."}):e.jsx("div",{className:"flex w-full h-full",children:e.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),e.jsx(A,{})]})})});export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,p as v,B as b}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as x,a as C,b as w}from"./index-CbaefyjV.js";import{a as P}from"./index-DLIEpuwL.js";function k(e,t){const n=s.createContext(t),o=i=>{const{children:u,...c}=i,a=s.useMemo(()=>c,Object.values(c));return v.jsx(n.Provider,{value:a,children:u})};o.displayName=e+"Provider";function r(i){const u=s.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Z(e,t=[]){let n=[];function o(i,u){const c=s.createContext(u),a=n.length;n=[...n,u];const l=f=>{const{scope:p,children:m,...S}=f,g=p?.[e]?.[a]||c,N=s.useMemo(()=>S,Object.values(S));return v.jsx(g.Provider,{value:N,children:m})};l.displayName=i+"Provider";function d(f,p){const m=p?.[e]?.[a]||c,S=s.useContext(m);if(S)return S;if(u!==void 0)return u;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const r=()=>{const i=n.map(u=>s.createContext(u));return function(c){const a=c?.[e]||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,R(r,...t)]}function R(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const u=o.reduce((c,{useScope:a,scopeName:l})=>{const f=a(i)[`__scope${l}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var y=globalThis?.document?s.useLayoutEffect:()=>{},A=b[" useInsertionEffect ".trim().toString()]||y;function G({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,u]=O({defaultProp:t,onChange:n}),c=e!==void 0,a=c?e:r;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=c},[c,o])}const l=s.useCallback(d=>{if(c){const f=M(d)?d(e):d;f!==e&&u.current?.(f)}else i(d)},[c,e,i,u]);return[a,l]}function O({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),i=s.useRef(t);return A(()=>{i.current=t},[t]),s.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function M(e){return typeof e=="function"}function J(e){const[t,n]=s.useState(void 0);return y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let u,c;if("borderBoxSize"in i){const a=i.borderBoxSize,l=Array.isArray(a)?a[0]:a;u=l.inlineSize,c=l.blockSize}else u=e.offsetWidth,c=e.offsetHeight;n({width:u,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}function $(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var I=e=>{const{present:t,children:n}=e,o=T(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),i=x(o.ref,_(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:i}):null};I.displayName="Presence";function T(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),i=s.useRef("none"),u=e?"mounted":"unmounted",[c,a]=$(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=h(o.current);i.current=c==="mounted"?l:"none"},[c]),y(()=>{const l=o.current,d=r.current;if(d!==e){const p=i.current,m=h(l);e?a("MOUNT"):m==="none"||l?.display==="none"?a("UNMOUNT"):a(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,a]),y(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=m=>{const g=h(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(a("ANIMATION_END"),!r.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},p=m=>{m.target===t&&(i.current=h(o.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(l=>{o.current=l?getComputedStyle(l):null,n(l)},[])}}function h(e){return e?.animationName||"none"}function _(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function j(e){const t=D(e),n=s.forwardRef((o,r)=>{const{children:i,...u}=o,c=s.Children.toArray(i),a=c.find(U);if(a){const l=a.props.children,d=c.map(f=>f===a?s.Children.count(l)>1?s.Children.only(null):s.isValidElement(l)?l.props.children:null:f);return v.jsx(t,{...u,ref:r,children:s.isValidElement(l)?s.cloneElement(l,void 0,d):null})}return v.jsx(t,{...u,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function D(e){const t=s.forwardRef((n,o)=>{const{children:r,...i}=n;if(s.isValidElement(r)){const u=z(r),c=W(i,r.props);return r.type!==s.Fragment&&(c.ref=o?C(o,u):u),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var E=Symbol("radix.slottable");function K(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=E,t}function U(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===E}function W(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const a=i(...c);return r(...c),a}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function z(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var L=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=L.reduce((e,t)=>{const n=j(`Primitive.${t}`),o=s.forwardRef((r,i)=>{const{asChild:u,...c}=r,a=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function X(e,t){e&&P.flushSync(()=>e.dispatchEvent(t))}var F=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Y=F.reduce((e,t)=>{const n=w(`Primitive.${t}`),o=s.forwardRef((r,i)=>{const{asChild:u,...c}=r,a=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});export{Y as P,Q as a,q as b,Z as c,I as d,y as e,j as f,K as g,J as h,X as i,k as j,G as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,p}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as G,c as H,a as A,b as P,d as O,f as K}from"./index-6Qui8hKi.js";import{u as _}from"./index-CbaefyjV.js";import{c as E,b as $,u as U,A as w,d as V,h as W,g as Z,k as q,f as z,F as B,i as J,j as Q}from"./index-F1mp4zFe.js";var x="Popover",[j]=H(x,[E]),g=E(),[X,u]=j(x),b=e=>{const{__scopePopover:n,children:t,open:s,defaultOpen:o,onOpenChange:r,modal:a=!1}=e,i=g(n),f=c.useRef(null),[v,h]=c.useState(!1),[C,l]=G({prop:s,defaultProp:o??!1,onChange:r,caller:x});return p.jsx($,{...i,children:p.jsx(X,{scope:n,contentId:U(),triggerRef:f,open:C,onOpenChange:l,onOpenToggle:c.useCallback(()=>l(R=>!R),[l]),hasCustomAnchor:v,onCustomAnchorAdd:c.useCallback(()=>h(!0),[]),onCustomAnchorRemove:c.useCallback(()=>h(!1),[]),modal:a,children:t})})};b.displayName=x;var F="PopoverAnchor",N=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(F,t),r=g(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return c.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(w,{...r,...s,ref:n})});N.displayName=F;var S="PopoverTrigger",y=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(S,t),r=g(t),a=_(n,o.triggerRef),i=p.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":L(o.open),...s,ref:a,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:p.jsx(w,{asChild:!0,...r,children:i})});y.displayName=S;var m="PopoverPortal",[Y,ee]=j(m,{forceMount:void 0}),D=e=>{const{__scopePopover:n,forceMount:t,children:s,container:o}=e,r=u(m,n);return p.jsx(Y,{scope:n,forceMount:t,children:p.jsx(O,{present:t||r.open,children:p.jsx(V,{asChild:!0,container:o,children:s})})})};D.displayName=m;var d="PopoverContent",M=c.forwardRef((e,n)=>{const t=ee(d,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,r=u(d,e.__scopePopover);return p.jsx(O,{present:s||r.open,children:r.modal?p.jsx(re,{...o,ref:n}):p.jsx(te,{...o,ref:n})})});M.displayName=d;var oe=K("PopoverContent.RemoveScroll"),re=c.forwardRef((e,n)=>{const t=u(d,e.__scopePopover),s=c.useRef(null),o=_(n,s),r=c.useRef(!1);return c.useEffect(()=>{const a=s.current;if(a)return W(a)},[]),p.jsx(Z,{as:oe,allowPinchZoom:!0,children:p.jsx(k,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,a=>{a.preventDefault(),r.current||t.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,f=i.button===0&&i.ctrlKey===!0,v=i.button===2||f;r.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),te=c.forwardRef((e,n)=>{const t=u(d,e.__scopePopover),s=c.useRef(!1),o=c.useRef(!1);return p.jsx(k,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(s.current||t.triggerRef.current?.focus(),r.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(s.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=r.target;t.triggerRef.current?.contains(a)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),k=c.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:v,onInteractOutside:h,...C}=e,l=u(d,t),R=g(t);return z(),p.jsx(B,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:r,children:p.jsx(J,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:v,onDismiss:()=>l.onOpenChange(!1),children:p.jsx(Q,{"data-state":L(l.open),role:"dialog",id:l.contentId,...R,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ne=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(T,t);return p.jsx(A.button,{type:"button",...s,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ne.displayName=T;var se="PopoverArrow",I=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=g(t);return p.jsx(q,{...o,...s,ref:n})});I.displayName=se;function L(e){return e?"open":"closed"}var ue=b,le=N,de=y,fe=D,ve=M,Pe=I;export{le as A,ve as C,fe as P,ue as R,de as T,Pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,B as x,p as C}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{x as g}from"./utils-
|
|
1
|
+
import{a as s,B as x,p as C}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{x as g}from"./utils-B48p8Qal.js";function S(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function R(...n){return e=>{let t=!1;const l=n.map(r=>{const o=S(r,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<l.length;r++){const o=l[r];typeof o=="function"?o():S(n[r],null)}}}}function L(...n){return s.useCallback(R(...n),n)}var j=Symbol.for("react.lazy"),p=x[" use ".trim().toString()];function N(n){return typeof n=="object"&&n!==null&&"then"in n}function V(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===j&&"_payload"in n&&N(n._payload)}function O(n){const e=P(n),t=s.forwardRef((l,r)=>{let{children:o,...u}=l;V(o)&&typeof p=="function"&&(o=p(o._payload));const a=s.Children.toArray(o),d=a.find($);if(d){const i=d.props.children,c=a.map(f=>f===d?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:f);return C.jsx(e,{...u,ref:r,children:s.isValidElement(i)?s.cloneElement(i,void 0,c):null})}return C.jsx(e,{...u,ref:r,children:o})});return t.displayName=`${n}.Slot`,t}var w=O("Slot");function P(n){const e=s.forwardRef((t,l)=>{let{children:r,...o}=t;if(V(r)&&typeof p=="function"&&(r=p(r._payload)),s.isValidElement(r)){const u=W(r),a=T(o,r.props);return r.type!==s.Fragment&&(a.ref=l?R(l,u):u),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var A=Symbol("radix.slottable");function $(n){return s.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===A}function T(n,e){const t={...e};for(const l in e){const r=n[l],o=e[l];/^on[A-Z]/.test(l)?r&&o?t[l]=(...a)=>{const d=o(...a);return r(...a),d}:r&&(t[l]=r):l==="style"?t[l]={...r,...o}:l==="className"&&(t[l]=[r,o].filter(Boolean).join(" "))}return{...n,...t}}function W(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}const E=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,b=g,B=(n,e)=>t=>{var l;if(e?.variants==null)return b(n,t?.class,t?.className);const{variants:r,defaultVariants:o}=e,u=Object.keys(r).map(i=>{const c=t?.[i],f=o?.[i];if(c===null)return null;const y=E(c)||E(f);return r[i][y]}),a=t&&Object.entries(t).reduce((i,c)=>{let[f,y]=c;return y===void 0||(i[f]=y),i},{}),d=e==null||(l=e.compoundVariants)===null||l===void 0?void 0:l.reduce((i,c)=>{let{class:f,className:y,..._}=c;return Object.entries(_).every(h=>{let[v,m]=h;return Array.isArray(m)?m.includes({...o,...a}[v]):{...o,...a}[v]===m})?[...i,f,y]:i},[]);return b(n,u,d,t?.class,t?.className)};export{w as S,R as a,O as b,B as c,L as u};
|