@unciatech/file-manager 0.0.7 → 0.0.8
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/dist/index.js +10 -10
- package/dist/index.mjs +21 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var ui=Object.create;var na=Object.defineProperty,fi=Object.defineProperties,gi=Object.getOwnPropertyDescriptor,hi=Object.getOwnPropertyDescriptors,vi=Object.getOwnPropertyNames,Pa=Object.getOwnPropertySymbols,xi=Object.getPrototypeOf,ho=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable;var Wo=(e,t,a)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,n=(e,t)=>{for(var a in t||(t={}))ho.call(t,a)&&Wo(e,a,t[a]);if(Pa)for(var a of Pa(t))Ko.call(t,a)&&Wo(e,a,t[a]);return e},d=(e,t)=>fi(e,hi(t));var g=(e,t)=>{var a={};for(var o in e)ho.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&Pa)for(var o of Pa(e))t.indexOf(o)<0&&Ko.call(e,o)&&(a[o]=e[o]);return a};var bi=(e,t)=>{for(var a in t)na(e,a,{get:t[a],enumerable:!0})},Yo=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vi(t))!ho.call(e,r)&&r!==a&&na(e,r,{get:()=>t[r],enumerable:!(o=gi(t,r))||o.enumerable});return e};var ka=(e,t,a)=>(a=e!=null?ui(xi(e)):{},Yo(t||!e||!e.__esModule?na(a,"default",{value:e,enumerable:!0}):a,e)),wi=e=>Yo(na({},"__esModule",{value:!0}),e);var ji={};bi(ji,{FileManager:()=>Zn,FileManagerModal:()=>jn,FileManagerProvider:()=>ia,MockProvider:()=>go,useFileManager:()=>O});module.exports=wi(ji);var ke=require("react");var oe={PAGE:"page",MODAL:"modal"},Wi=Object.values(oe),X={IMAGE:"images",VIDEO:"videos",AUDIO:"audios",FILE:"files"},Ki=Object.values(X),Le={SINGLE:"single",MULTIPLE:"multiple"},Yi=Object.values(Le),Ci={GRID:"grid",LIST:"list"},qi=Object.values(Ci),vo={LOCAL:"local",REMOTE:"remote",YOUTUBE:"youtube",VIMEO:"vimeo"},Qi=Object.values(vo);var Qo=require("next/navigation"),Se=require("sonner");var xo=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(i=>i.id===o.id)?a=a.filter(i=>i.id!==o.id):a.push(o)}),a},qo=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(i=>i.id===o.id)?a=a.filter(i=>i.id!==o.id):a.push(o)}),a};function Jo(e){let{mode:t,selectionMode:a,files:o,folders:r,selectedFiles:i,selectedFolders:l,currentFolder:c,setSelectedFiles:s,setSelectedFolders:f,setCurrentFolder:m,setFiles:b,setFolders:p,setPagination:y,loadData:w,isInSelectionMode:N,provider:M,onFilesSelected:D,onClose:z,basePath:T,setIsLoading:h,setFileDetailsModalFile:I}=e,Y=(0,Qo.useRouter)(),te=(0,ke.useCallback)((_,V,W=!1)=>{let K=[_];if(W||V&&(V.metaKey||V.ctrlKey)){s(q=>xo(q,K));return}if(N()&&t!==oe.MODAL){s(q=>xo(q,K));return}if(t===oe.MODAL){a==="single"?(s([_]),D==null||D([_]),z==null||z()):s(q=>xo(q,K));return}I(_)},[t,a,N,s,D,z,I]),se=(0,ke.useCallback)((_,V,W=!1)=>{let K=_?_.id:null;if((W||V&&(V.metaKey||V.ctrlKey))&&_){f(q=>qo(q,[_]));return}if(N()&&_){f(q=>qo(q,[_]));return}if(t===oe.PAGE){h(!0);let q=T!=null?T:"/media",Pe=K===null?q:`${q}/${K}`;Y.push(Pe)}else{h(!0),s([]),f([]);let q=new URLSearchParams(window.location.search);K===null?q.delete("folderId"):q.set("folderId",String(K)),q.set("page","1");let Pe=`${window.location.pathname}?${q.toString()}`;Y.push(Pe,{scroll:!1})}},[N,t,Y,f,s,T,h]),De=(0,ke.useCallback)(()=>{s([]),f([])},[s,f]),u=(0,ke.useCallback)(_=>{_?(s(o),f(t===oe.PAGE?r:[])):(s([]),f([]))},[o,r,t,s,f]),L=(0,ke.useCallback)(async(_=!1)=>{await w(_)},[w]),v=(0,ke.useCallback)(async _=>{var V;try{await M.uploadFiles(_,(V=c==null?void 0:c.id)!=null?V:null),await L(!0),s([]),Se.toast.success("Upload Successful",{description:`${_.length} file(s) uploaded successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to upload files";Se.toast.error("Upload Failed",{description:K}),console.error("Upload failed:",W)}},[c,M,L,s]),G=(0,ke.useCallback)(async _=>{var V;try{await M.createFolder(_,(V=c==null?void 0:c.id)!=null?V:null),await L(!0),s([]),Se.toast.success("Folder Created",{description:`Folder "${_}" created successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to create folder";Se.toast.error("Create Folder Failed",{description:K}),console.error("Failed to create folder:",W)}},[c,M,L,s]),B=(0,ke.useCallback)(async _=>{try{i.length>0&&await M.moveFiles(i.map(W=>W.id),_),l.length>0&&await M.moveFolders(l.map(W=>W.id),_),await L(!0),s([]),f([]);let V=i.length+l.length;Se.toast.success("Move Successful",{description:`${V} item(s) moved successfully`})}catch(V){let W=V instanceof Error?V.message:"Failed to move items";Se.toast.error("Move Failed",{description:W}),console.error("Failed to move items:",V)}},[i,l,M,L,s,f]),$=(0,ke.useCallback)(async(_,V)=>{try{p(W=>W.map(K=>K.id===_?d(n({},K),{name:V}):K)),await M.renameFolder(_,V),await L(!0),Se.toast.success("Folder Renamed",{description:`Folder renamed to "${V}"`})}catch(W){let K=W instanceof Error?W.message:"Failed to rename folder";Se.toast.error("Rename Failed",{description:K}),console.error("Failed to rename folder:",W)}},[M,L]),we=(0,ke.useCallback)(async(_,V)=>{try{b(W=>W.map(K=>{if(K.id===_){let Ye=V,{metaData:q}=Ye,Pe=g(Ye,["metaData"]);return d(n(n({},K),Pe),{metaData:q?n(n({},K.metaData),q):K.metaData})}return K})),await M.updateFileMetaData(_,V),await L(!0)}catch(W){let K=W instanceof Error?W.message:"Failed to update metadata";Se.toast.error("Update Failed",{description:K}),console.error("Failed to update metadata:",W)}},[M,L]),Vt=(0,ke.useCallback)(async()=>{try{i.length>0&&await M.deleteFiles(i.map(V=>V.id)),l.length>0&&await M.deleteFolders(l.map(V=>V.id)),await L(!0),s([]),f([]);let _=i.length+l.length;Se.toast.success("Delete Successful",{description:`${_} item(s) deleted successfully`})}catch(_){let V=_ instanceof Error?_.message:"Failed to delete items";Se.toast.error("Delete Failed",{description:V}),console.error("Failed to delete items:",_)}},[i,l,M,L,s,f]);return{handleFileClick:te,handleFolderClick:se,handleClearSelection:De,handleSelectAllGlobal:u,uploadFiles:v,createFolder:G,bulkMove:B,renameFolder:$,updateFileMetadata:we,bulkDelete:Vt,refreshData:L}}var rt=require("next/navigation"),U=require("react"),Sa=require("sonner");function Xo(e){let{mode:t,selectionMode:a,initialFolderId:o,acceptedFileTypesForModal:r,allowedFileTypes:i,provider:l,onFilesSelected:c,onClose:s,basePath:f}=e,m=(0,rt.useParams)(),b=(0,rt.useSearchParams)(),p=(0,rt.useRouter)(),y=(0,rt.usePathname)(),w=Math.max(1,parseInt(b.get("page")||"1",10)),N=Math.max(1,parseInt(b.get("limit")||"24",10)),M=b.get("query")||"",D=(0,U.useMemo)(()=>{if(t===oe.PAGE&&(m!=null&&m.path)){let j=Array.isArray(m.path)?m.path[0]:m.path;return typeof j=="string"&&/^\d+$/.test(j)?Number(j):null}if(t===oe.MODAL){let j=b.get("folderId");if(j&&/^\d+$/.test(j))return Number(j)}return o!=null?o:null},[t,m,b,o]),[z,T]=(0,U.useState)([]),[h,I]=(0,U.useState)([]),[Y,te]=(0,U.useState)([]),[se,De]=(0,U.useState)([]),[u,L]=(0,U.useState)(null),[v,G]=(0,U.useState)(!0),[B,$]=(0,U.useState)({currentPage:w,totalPages:1,totalFiles:0,filesPerPage:N}),we=(0,U.useRef)(null);we.current=u;let[Vt,_]=(0,U.useState)(M),[V,W]=(0,U.useState)(M);(0,U.useEffect)(()=>{let j=setTimeout(()=>{W(Vt)},300);return()=>clearTimeout(j)},[Vt]);let K=(0,U.useRef)(D),Ye=(0,U.useCallback)((j,ue)=>{let fe=new URLSearchParams(b.toString());fe.set("page",j.toString()),fe.set("limit",ue.toString()),p.push(`${y}?${fe.toString()}`,{scroll:!1})},[p,y]);(0,U.useEffect)(()=>{$(j=>d(n({},j),{currentPage:w,filesPerPage:N})),_(M)},[w,N,M]),(0,U.useEffect)(()=>{D!==K.current&&(t===oe.PAGE&&Ye(1,N),K.current=D)},[D,N,Ye,t]);let q=B.currentPage,Pe=B.filesPerPage;(0,U.useEffect)(()=>{let j=!1,ue=async()=>{if(D&&(!we.current||we.current.id!==D))try{G(!0);let ge=await l.getFolder(D);if(j)return;L(ge),await fe(ge)}catch(ge){let Ia=ge instanceof Error?ge.message:"Failed to load folder";if(Sa.toast.error("Load Folder Failed",{description:Ia}),console.error("Failed to fetch current folder",ge),j)return;L(null),j||G(!1)}else D===null&&we.current!==null?(L(null),await fe(null)):we.current?await fe(we.current):await fe(null)},fe=async ge=>{var Ia;if(!j){G(!0);try{let It=[];t===oe.MODAL?It=r:It=i;let ra=await l.getItems((Ia=ge==null?void 0:ge.id)!=null?Ia:null,It,q,Pe,V);if(j)return;I(ra.folders),T(ra.files),$(ra.pagination)}catch(It){let ra=It instanceof Error?It.message:"Failed to load data";Sa.toast.error("Load Data Failed",{description:ra}),console.error("Failed to load data:",It)}finally{j||G(!1)}}};return ue(),()=>{j=!0}},[D,l,t,r,i,q,Pe,V]),(0,U.useEffect)(()=>{De([]),te([])},[u]);let[Wn,Kn]=(0,U.useState)(!1),[Yn,qn]=(0,U.useState)(!1),[Qn,Jn]=(0,U.useState)(!1),[Xn,ei]=(0,U.useState)(!1),[ti,ai]=(0,U.useState)(!1),[oi,ri]=(0,U.useState)(null),[ni,ii]=(0,U.useState)(null),li=(0,U.useCallback)(async(j=!1)=>{var ue;j||G(!0);try{let fe=[];t===oe.MODAL?fe=r:fe=i;let ge=await l.getItems((ue=u==null?void 0:u.id)!=null?ue:null,fe,q,Pe,V);I(ge.folders),T(ge.files),$(ge.pagination)}catch(fe){let ge=fe instanceof Error?fe.message:"Failed to load data";Sa.toast.error("Load Data Failed",{description:ge}),console.error("Failed to load data:",fe)}finally{j||G(!1)}},[u,t,r,i,l,q,Pe,V]),si=()=>Y.length>0||se.length>0,di=()=>u,ci=(0,U.useMemo)(()=>()=>{let j=z.length+(t===oe.PAGE?h.length:0),ue=Y.length+se.length;return ue===0?!1:ue===j?!0:"indeterminate"},[z.length,h.length,Y.length,se.length,t]),pi=(0,U.useCallback)(j=>{$(ue=>d(n({},ue),{currentPage:j})),t===oe.PAGE&&Ye(j,Pe)},[Ye,Pe,t]),mi=(0,U.useCallback)(j=>{_(j);let ue=new URLSearchParams(b.toString());j.trim()?(ue.set("query",j),ue.set("page","1")):ue.delete("query"),p.push(`${y}?${ue.toString()}`,{scroll:!1})},[p,y,b]);return{files:z,folders:h,selectedFiles:Y,selectedFolders:se,currentFolder:u,isLoading:v,pagination:B,isUploadModalOpen:Wn,isCreateFolderModalOpen:Yn,isSearchModalOpen:Qn,isMoveFileModalOpen:Xn,isRenameFolderModalOpen:ti,fileDetailsModalFile:ni,folderToRename:oi,setFiles:T,setFolders:I,setSelectedFiles:te,setSelectedFolders:De,setCurrentFolder:L,setPagination:$,setIsUploadModalOpen:Kn,setIsCreateFolderModalOpen:qn,setIsSearchModalOpen:Jn,setIsMoveFileModalOpen:ei,setIsRenameFolderModalOpen:ai,setFileDetailsModalFile:ii,setFolderToRename:ri,loadData:li,setIsLoading:G,isInSelectionMode:si,getCurrentFolder:di,getSelectionState:ci,handlePageChange:pi,searchQuery:Vt,updateSearchQuery:mi,mode:t,selectionMode:a,acceptedFileTypesForModal:r,provider:l,onFilesSelected:c,onClose:s,basePath:f}}var Ot=require("react"),tr=require("react/jsx-runtime"),er=(0,Ot.createContext)(void 0);function ia({children:e,mode:t=oe.PAGE,selectionMode:a=Le.SINGLE,allowedFileTypes:o,onFilesSelected:r,onClose:i,acceptedFileTypesForModal:l,initialFolderId:c=null,provider:s,basePath:f="/media",maxUploadFiles:m=50,maxUploadSize:b=100*1024*1024}){let p=Xo({mode:t,selectionMode:a,initialFolderId:c,acceptedFileTypesForModal:l,allowedFileTypes:o,provider:s,onFilesSelected:r,onClose:i,basePath:f}),y=Jo(p),w=(0,Ot.useMemo)(()=>({files:p.files,folders:p.folders,selectedFiles:p.selectedFiles,selectedFolders:p.selectedFolders,currentFolder:p.currentFolder,isLoading:p.isLoading,pagination:p.pagination,isUploadModalOpen:p.isUploadModalOpen,isCreateFolderModalOpen:p.isCreateFolderModalOpen,isSearchModalOpen:p.isSearchModalOpen,isMoveFileModalOpen:p.isMoveFileModalOpen,isRenameFolderModalOpen:p.isRenameFolderModalOpen,fileDetailsModalFile:p.fileDetailsModalFile,folderToRename:p.folderToRename,mode:p.mode,selectionMode:p.selectionMode,allowedFileTypes:o,acceptedFileTypesForModal:p.acceptedFileTypesForModal,maxUploadFiles:m,maxUploadSize:b,setIsUploadModalOpen:p.setIsUploadModalOpen,setIsCreateFolderModalOpen:p.setIsCreateFolderModalOpen,setIsSearchModalOpen:p.setIsSearchModalOpen,setIsMoveFileModalOpen:p.setIsMoveFileModalOpen,setSelectedFiles:p.setSelectedFiles,setSelectedFolders:p.setSelectedFolders,setIsRenameFolderModalOpen:p.setIsRenameFolderModalOpen,setFileDetailsModalFile:p.setFileDetailsModalFile,setFolderToRename:p.setFolderToRename,handleFileClick:y.handleFileClick,handleFolderClick:y.handleFolderClick,handleClearSelection:y.handleClearSelection,handleSelectAllGlobal:y.handleSelectAllGlobal,handlePageChange:p.handlePageChange,searchQuery:p.searchQuery,updateSearchQuery:p.updateSearchQuery,uploadFiles:y.uploadFiles,createFolder:y.createFolder,bulkMove:y.bulkMove,renameFolder:y.renameFolder,updateFileMetadata:y.updateFileMetadata,bulkDelete:y.bulkDelete,refreshData:y.refreshData,isInSelectionMode:p.isInSelectionMode,getCurrentFolder:p.getCurrentFolder,getSelectionState:p.getSelectionState,onClose:p.onClose,onFilesSelected:p.onFilesSelected,provider:s,basePath:p.basePath}),[p,y,s,o,m,b]);return(0,tr.jsx)(er.Provider,{value:w,children:e})}function O(){let e=(0,Ot.useContext)(er);if(e===void 0)throw new Error("useFileManager must be used within a FileManagerProvider");return e}var ar=require("clsx"),or=require("tailwind-merge");function x(...e){return(0,or.twMerge)((0,ar.clsx)(e))}var rr=require("lucide-react");var nt=require("react/jsx-runtime"),nr=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("nav",n({"data-slot":"pagination",role:"navigation","aria-label":"pagination",className:x("mx-auto flex w-full justify-center",e)},t))};function ir(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("ul",n({"data-slot":"pagination-content",className:x("flex flex-row items-center gap-1",e)},t))}function la(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("li",n({"data-slot":"pagination-item",className:x("",e)},t))}var lr=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsxs)("span",d(n({"data-slot":"pagination-ellipsis","aria-hidden":!0,className:x("flex h-9 w-9 items-center justify-center",e)},t),{children:[(0,nt.jsx)(rr.MoreHorizontal,{className:"h-4 w-4"}),(0,nt.jsx)("span",{className:"sr-only",children:"More pages"})]}))};var sr=require("class-variance-authority"),yi=require("lucide-react"),dr=require("radix-ui");var cr=require("react/jsx-runtime"),Fi=(0,sr.cva)("cursor-pointer group whitespace-nowrap focus-visible:outline-hidden inline-flex items-center justify-center has-data-[arrow=true]:justify-between whitespace-nowrap text-sm font-medium ring-offset-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 data-[state=open]:bg-primary/90",mono:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black hover:bg-zinc-950/90 dark:hover:bg-zinc-300/90 data-[state=open]:bg-zinc-950/90 dark:data-[state=open]:bg-zinc-300/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 data-[state=open]:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 data-[state=open]:bg-secondary/90",outline:"bg-background text-accent-foreground border border-input hover:bg-accent data-[state=open]:bg-accent",dashed:"text-accent-foreground border border-input border-dashed bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:text-accent-foreground",ghost:"text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",dim:"text-muted-foreground hover:text-foreground data-[state=open]:text-foreground",foreground:"",inverse:""},appearance:{default:"",ghost:""},underline:{solid:"",dashed:""},underlined:{solid:"",dashed:""},size:{lg:"h-10 px-4 text-sm gap-1.5 [&_svg:not([class*=size-])]:size-4",md:"h-9 px-3 gap-1.5 text-sm [&_svg:not([class*=size-])]:size-4",sm:"h-8 px-2.5 gap-1.25 text-xs [&_svg:not([class*=size-])]:size-3.5",xs:"h-7 px-2 gap-1 text-xs [&_svg:not([class*=size-])]:size-3.5",icon:"size-9 [&_svg:not([class*=size-])]:size-4 shrink-0"},autoHeight:{true:"",false:""},radius:{md:"rounded-md",full:"rounded-full"},mode:{default:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",icon:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 shrink-0",link:"text-primary h-auto p-0 bg-transparent rounded-none hover:bg-transparent data-[state=open]:bg-transparent",input:`
|
|
1
|
+
"use strict";var ui=Object.create;var na=Object.defineProperty,fi=Object.defineProperties,gi=Object.getOwnPropertyDescriptor,hi=Object.getOwnPropertyDescriptors,vi=Object.getOwnPropertyNames,Pa=Object.getOwnPropertySymbols,xi=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable;var Ko=(e,t,a)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,n=(e,t)=>{for(var a in t||(t={}))vo.call(t,a)&&Ko(e,a,t[a]);if(Pa)for(var a of Pa(t))Yo.call(t,a)&&Ko(e,a,t[a]);return e},d=(e,t)=>fi(e,hi(t));var g=(e,t)=>{var a={};for(var o in e)vo.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&Pa)for(var o of Pa(e))t.indexOf(o)<0&&Yo.call(e,o)&&(a[o]=e[o]);return a};var bi=(e,t)=>{for(var a in t)na(e,a,{get:t[a],enumerable:!0})},qo=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vi(t))!vo.call(e,r)&&r!==a&&na(e,r,{get:()=>t[r],enumerable:!(o=gi(t,r))||o.enumerable});return e};var ka=(e,t,a)=>(a=e!=null?ui(xi(e)):{},qo(t||!e||!e.__esModule?na(a,"default",{value:e,enumerable:!0}):a,e)),wi=e=>qo(na({},"__esModule",{value:!0}),e);var ji={};bi(ji,{FileManager:()=>jn,FileManagerModal:()=>$n,FileManagerProvider:()=>ia,MockProvider:()=>go,useFileManager:()=>O});module.exports=wi(ji);var ke=require("react");var oe={PAGE:"page",MODAL:"modal"},Wi=Object.values(oe),X={IMAGE:"images",VIDEO:"videos",AUDIO:"audios",FILE:"files"},Ki=Object.values(X),Le={SINGLE:"single",MULTIPLE:"multiple"},Yi=Object.values(Le),Ci={GRID:"grid",LIST:"list"},qi=Object.values(Ci),xo={LOCAL:"local",REMOTE:"remote",YOUTUBE:"youtube",VIMEO:"vimeo"},Qi=Object.values(xo);var Jo=require("next/navigation"),Se=require("sonner");var bo=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(i=>i.id===o.id)?a=a.filter(i=>i.id!==o.id):a.push(o)}),a},Qo=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(i=>i.id===o.id)?a=a.filter(i=>i.id!==o.id):a.push(o)}),a};function Xo(e){let{mode:t,selectionMode:a,files:o,folders:r,selectedFiles:i,selectedFolders:l,currentFolder:c,setSelectedFiles:s,setSelectedFolders:f,setCurrentFolder:m,setFiles:b,setFolders:p,setPagination:y,loadData:w,isInSelectionMode:N,provider:M,onFilesSelected:D,onClose:z,basePath:T,setIsLoading:h,setFileDetailsModalFile:I}=e,Y=(0,Jo.useRouter)(),te=(0,ke.useCallback)((_,V,W=!1)=>{let K=[_];if(W||V&&(V.metaKey||V.ctrlKey)){s(q=>bo(q,K));return}if(N()&&t!==oe.MODAL){s(q=>bo(q,K));return}if(t===oe.MODAL){a==="single"?(s([_]),D==null||D([_]),z==null||z()):s(q=>bo(q,K));return}I(_)},[t,a,N,s,D,z,I]),se=(0,ke.useCallback)((_,V,W=!1)=>{let K=_?_.id:null;if((W||V&&(V.metaKey||V.ctrlKey))&&_){f(q=>Qo(q,[_]));return}if(N()&&_){f(q=>Qo(q,[_]));return}if(t===oe.PAGE){h(!0);let q=T!=null?T:"/media",Ne=q.startsWith("/")?q:`/${q}`,ho=K===null?Ne:`${Ne}/${K}`;Y.push(ho)}else{h(!0),s([]),f([]);let q=new URLSearchParams(window.location.search);K===null?q.delete("folderId"):q.set("folderId",String(K)),q.set("page","1");let Ne=`${window.location.pathname}?${q.toString()}`;Y.push(Ne,{scroll:!1})}},[N,t,Y,f,s,T,h]),De=(0,ke.useCallback)(()=>{s([]),f([])},[s,f]),u=(0,ke.useCallback)(_=>{_?(s(o),f(t===oe.PAGE?r:[])):(s([]),f([]))},[o,r,t,s,f]),L=(0,ke.useCallback)(async(_=!1)=>{await w(_)},[w]),v=(0,ke.useCallback)(async _=>{var V;try{await M.uploadFiles(_,(V=c==null?void 0:c.id)!=null?V:null),await L(!0),s([]),Se.toast.success("Upload Successful",{description:`${_.length} file(s) uploaded successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to upload files";Se.toast.error("Upload Failed",{description:K}),console.error("Upload failed:",W)}},[c,M,L,s]),G=(0,ke.useCallback)(async _=>{var V;try{await M.createFolder(_,(V=c==null?void 0:c.id)!=null?V:null),await L(!0),s([]),Se.toast.success("Folder Created",{description:`Folder "${_}" created successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to create folder";Se.toast.error("Create Folder Failed",{description:K}),console.error("Failed to create folder:",W)}},[c,M,L,s]),B=(0,ke.useCallback)(async _=>{try{i.length>0&&await M.moveFiles(i.map(W=>W.id),_),l.length>0&&await M.moveFolders(l.map(W=>W.id),_),await L(!0),s([]),f([]);let V=i.length+l.length;Se.toast.success("Move Successful",{description:`${V} item(s) moved successfully`})}catch(V){let W=V instanceof Error?V.message:"Failed to move items";Se.toast.error("Move Failed",{description:W}),console.error("Failed to move items:",V)}},[i,l,M,L,s,f]),$=(0,ke.useCallback)(async(_,V)=>{try{p(W=>W.map(K=>K.id===_?d(n({},K),{name:V}):K)),await M.renameFolder(_,V),await L(!0),Se.toast.success("Folder Renamed",{description:`Folder renamed to "${V}"`})}catch(W){let K=W instanceof Error?W.message:"Failed to rename folder";Se.toast.error("Rename Failed",{description:K}),console.error("Failed to rename folder:",W)}},[M,L]),Ce=(0,ke.useCallback)(async(_,V)=>{try{b(W=>W.map(K=>{if(K.id===_){let Ye=V,{metaData:q}=Ye,Ne=g(Ye,["metaData"]);return d(n(n({},K),Ne),{metaData:q?n(n({},K.metaData),q):K.metaData})}return K})),await M.updateFileMetaData(_,V),await L(!0)}catch(W){let K=W instanceof Error?W.message:"Failed to update metadata";Se.toast.error("Update Failed",{description:K}),console.error("Failed to update metadata:",W)}},[M,L]),Vt=(0,ke.useCallback)(async()=>{try{i.length>0&&await M.deleteFiles(i.map(V=>V.id)),l.length>0&&await M.deleteFolders(l.map(V=>V.id)),await L(!0),s([]),f([]);let _=i.length+l.length;Se.toast.success("Delete Successful",{description:`${_} item(s) deleted successfully`})}catch(_){let V=_ instanceof Error?_.message:"Failed to delete items";Se.toast.error("Delete Failed",{description:V}),console.error("Failed to delete items:",_)}},[i,l,M,L,s,f]);return{handleFileClick:te,handleFolderClick:se,handleClearSelection:De,handleSelectAllGlobal:u,uploadFiles:v,createFolder:G,bulkMove:B,renameFolder:$,updateFileMetadata:Ce,bulkDelete:Vt,refreshData:L}}var rt=require("next/navigation"),U=require("react"),Sa=require("sonner");function er(e){let{mode:t,selectionMode:a,initialFolderId:o,acceptedFileTypesForModal:r,allowedFileTypes:i,provider:l,onFilesSelected:c,onClose:s,basePath:f}=e,m=(0,rt.useParams)(),b=(0,rt.useSearchParams)(),p=(0,rt.useRouter)(),y=(0,rt.usePathname)(),w=Math.max(1,parseInt(b.get("page")||"1",10)),N=Math.max(1,parseInt(b.get("limit")||"24",10)),M=b.get("query")||"",D=(0,U.useMemo)(()=>{if(t===oe.PAGE&&(m!=null&&m.path)){let j=Array.isArray(m.path)?m.path[0]:m.path;return typeof j=="string"&&/^\d+$/.test(j)?Number(j):null}if(t===oe.MODAL){let j=b.get("folderId");if(j&&/^\d+$/.test(j))return Number(j)}return o!=null?o:null},[t,m,b,o]),[z,T]=(0,U.useState)([]),[h,I]=(0,U.useState)([]),[Y,te]=(0,U.useState)([]),[se,De]=(0,U.useState)([]),[u,L]=(0,U.useState)(null),[v,G]=(0,U.useState)(!0),[B,$]=(0,U.useState)({currentPage:w,totalPages:1,totalFiles:0,filesPerPage:N}),Ce=(0,U.useRef)(null);Ce.current=u;let[Vt,_]=(0,U.useState)(M),[V,W]=(0,U.useState)(M);(0,U.useEffect)(()=>{let j=setTimeout(()=>{W(Vt)},300);return()=>clearTimeout(j)},[Vt]);let K=(0,U.useRef)(D),Ye=(0,U.useCallback)((j,ue)=>{let fe=new URLSearchParams(b.toString());fe.set("page",j.toString()),fe.set("limit",ue.toString()),p.push(`${y}?${fe.toString()}`,{scroll:!1})},[p,y]);(0,U.useEffect)(()=>{$(j=>d(n({},j),{currentPage:w,filesPerPage:N})),_(M)},[w,N,M]),(0,U.useEffect)(()=>{D!==K.current&&(t===oe.PAGE&&Ye(1,N),K.current=D)},[D,N,Ye,t]);let q=B.currentPage,Ne=B.filesPerPage;(0,U.useEffect)(()=>{let j=!1,ue=async()=>{if(D&&(!Ce.current||Ce.current.id!==D))try{G(!0);let ge=await l.getFolder(D);if(j)return;L(ge),await fe(ge)}catch(ge){let Ia=ge instanceof Error?ge.message:"Failed to load folder";if(Sa.toast.error("Load Folder Failed",{description:Ia}),console.error("Failed to fetch current folder",ge),j)return;L(null),j||G(!1)}else D===null&&Ce.current!==null?(L(null),await fe(null)):Ce.current?await fe(Ce.current):await fe(null)},fe=async ge=>{var Ia;if(!j){G(!0);try{let It=[];t===oe.MODAL?It=r:It=i;let ra=await l.getItems((Ia=ge==null?void 0:ge.id)!=null?Ia:null,It,q,Ne,V);if(j)return;I(ra.folders),T(ra.files),$(ra.pagination)}catch(It){let ra=It instanceof Error?It.message:"Failed to load data";Sa.toast.error("Load Data Failed",{description:ra}),console.error("Failed to load data:",It)}finally{j||G(!1)}}};return ue(),()=>{j=!0}},[D,l,t,r,i,q,Ne,V]),(0,U.useEffect)(()=>{De([]),te([])},[u]);let[ho,Kn]=(0,U.useState)(!1),[Yn,qn]=(0,U.useState)(!1),[Qn,Jn]=(0,U.useState)(!1),[Xn,ei]=(0,U.useState)(!1),[ti,ai]=(0,U.useState)(!1),[oi,ri]=(0,U.useState)(null),[ni,ii]=(0,U.useState)(null),li=(0,U.useCallback)(async(j=!1)=>{var ue;j||G(!0);try{let fe=[];t===oe.MODAL?fe=r:fe=i;let ge=await l.getItems((ue=u==null?void 0:u.id)!=null?ue:null,fe,q,Ne,V);I(ge.folders),T(ge.files),$(ge.pagination)}catch(fe){let ge=fe instanceof Error?fe.message:"Failed to load data";Sa.toast.error("Load Data Failed",{description:ge}),console.error("Failed to load data:",fe)}finally{j||G(!1)}},[u,t,r,i,l,q,Ne,V]),si=()=>Y.length>0||se.length>0,di=()=>u,ci=(0,U.useMemo)(()=>()=>{let j=z.length+(t===oe.PAGE?h.length:0),ue=Y.length+se.length;return ue===0?!1:ue===j?!0:"indeterminate"},[z.length,h.length,Y.length,se.length,t]),pi=(0,U.useCallback)(j=>{$(ue=>d(n({},ue),{currentPage:j})),t===oe.PAGE&&Ye(j,Ne)},[Ye,Ne,t]),mi=(0,U.useCallback)(j=>{_(j);let ue=new URLSearchParams(b.toString());j.trim()?(ue.set("query",j),ue.set("page","1")):ue.delete("query"),p.push(`${y}?${ue.toString()}`,{scroll:!1})},[p,y,b]);return{files:z,folders:h,selectedFiles:Y,selectedFolders:se,currentFolder:u,isLoading:v,pagination:B,isUploadModalOpen:ho,isCreateFolderModalOpen:Yn,isSearchModalOpen:Qn,isMoveFileModalOpen:Xn,isRenameFolderModalOpen:ti,fileDetailsModalFile:ni,folderToRename:oi,setFiles:T,setFolders:I,setSelectedFiles:te,setSelectedFolders:De,setCurrentFolder:L,setPagination:$,setIsUploadModalOpen:Kn,setIsCreateFolderModalOpen:qn,setIsSearchModalOpen:Jn,setIsMoveFileModalOpen:ei,setIsRenameFolderModalOpen:ai,setFileDetailsModalFile:ii,setFolderToRename:ri,loadData:li,setIsLoading:G,isInSelectionMode:si,getCurrentFolder:di,getSelectionState:ci,handlePageChange:pi,searchQuery:Vt,updateSearchQuery:mi,mode:t,selectionMode:a,acceptedFileTypesForModal:r,provider:l,onFilesSelected:c,onClose:s,basePath:f}}var Ot=require("react"),ar=require("react/jsx-runtime"),tr=(0,Ot.createContext)(void 0);function ia({children:e,mode:t=oe.PAGE,selectionMode:a=Le.SINGLE,allowedFileTypes:o,onFilesSelected:r,onClose:i,acceptedFileTypesForModal:l,initialFolderId:c=null,provider:s,basePath:f="/media",maxUploadFiles:m=50,maxUploadSize:b=100*1024*1024}){let p=er({mode:t,selectionMode:a,initialFolderId:c,acceptedFileTypesForModal:l,allowedFileTypes:o,provider:s,onFilesSelected:r,onClose:i,basePath:f}),y=Xo(p),w=(0,Ot.useMemo)(()=>({files:p.files,folders:p.folders,selectedFiles:p.selectedFiles,selectedFolders:p.selectedFolders,currentFolder:p.currentFolder,isLoading:p.isLoading,pagination:p.pagination,isUploadModalOpen:p.isUploadModalOpen,isCreateFolderModalOpen:p.isCreateFolderModalOpen,isSearchModalOpen:p.isSearchModalOpen,isMoveFileModalOpen:p.isMoveFileModalOpen,isRenameFolderModalOpen:p.isRenameFolderModalOpen,fileDetailsModalFile:p.fileDetailsModalFile,folderToRename:p.folderToRename,mode:p.mode,selectionMode:p.selectionMode,allowedFileTypes:o,acceptedFileTypesForModal:p.acceptedFileTypesForModal,maxUploadFiles:m,maxUploadSize:b,setIsUploadModalOpen:p.setIsUploadModalOpen,setIsCreateFolderModalOpen:p.setIsCreateFolderModalOpen,setIsSearchModalOpen:p.setIsSearchModalOpen,setIsMoveFileModalOpen:p.setIsMoveFileModalOpen,setSelectedFiles:p.setSelectedFiles,setSelectedFolders:p.setSelectedFolders,setIsRenameFolderModalOpen:p.setIsRenameFolderModalOpen,setFileDetailsModalFile:p.setFileDetailsModalFile,setFolderToRename:p.setFolderToRename,handleFileClick:y.handleFileClick,handleFolderClick:y.handleFolderClick,handleClearSelection:y.handleClearSelection,handleSelectAllGlobal:y.handleSelectAllGlobal,handlePageChange:p.handlePageChange,searchQuery:p.searchQuery,updateSearchQuery:p.updateSearchQuery,uploadFiles:y.uploadFiles,createFolder:y.createFolder,bulkMove:y.bulkMove,renameFolder:y.renameFolder,updateFileMetadata:y.updateFileMetadata,bulkDelete:y.bulkDelete,refreshData:y.refreshData,isInSelectionMode:p.isInSelectionMode,getCurrentFolder:p.getCurrentFolder,getSelectionState:p.getSelectionState,onClose:p.onClose,onFilesSelected:p.onFilesSelected,provider:s,basePath:p.basePath}),[p,y,s,o,m,b]);return(0,ar.jsx)(tr.Provider,{value:w,children:e})}function O(){let e=(0,Ot.useContext)(tr);if(e===void 0)throw new Error("useFileManager must be used within a FileManagerProvider");return e}var or=require("clsx"),rr=require("tailwind-merge");function x(...e){return(0,rr.twMerge)((0,or.clsx)(e))}var nr=require("lucide-react");var nt=require("react/jsx-runtime"),ir=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("nav",n({"data-slot":"pagination",role:"navigation","aria-label":"pagination",className:x("mx-auto flex w-full justify-center",e)},t))};function lr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("ul",n({"data-slot":"pagination-content",className:x("flex flex-row items-center gap-1",e)},t))}function la(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsx)("li",n({"data-slot":"pagination-item",className:x("",e)},t))}var sr=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,nt.jsxs)("span",d(n({"data-slot":"pagination-ellipsis","aria-hidden":!0,className:x("flex h-9 w-9 items-center justify-center",e)},t),{children:[(0,nt.jsx)(nr.MoreHorizontal,{className:"h-4 w-4"}),(0,nt.jsx)("span",{className:"sr-only",children:"More pages"})]}))};var dr=require("class-variance-authority"),yi=require("lucide-react"),cr=require("radix-ui");var pr=require("react/jsx-runtime"),Fi=(0,dr.cva)("cursor-pointer group whitespace-nowrap focus-visible:outline-hidden inline-flex items-center justify-center has-data-[arrow=true]:justify-between whitespace-nowrap text-sm font-medium ring-offset-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 data-[state=open]:bg-primary/90",mono:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black hover:bg-zinc-950/90 dark:hover:bg-zinc-300/90 data-[state=open]:bg-zinc-950/90 dark:data-[state=open]:bg-zinc-300/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 data-[state=open]:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 data-[state=open]:bg-secondary/90",outline:"bg-background text-accent-foreground border border-input hover:bg-accent data-[state=open]:bg-accent",dashed:"text-accent-foreground border border-input border-dashed bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:text-accent-foreground",ghost:"text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",dim:"text-muted-foreground hover:text-foreground data-[state=open]:text-foreground",foreground:"",inverse:""},appearance:{default:"",ghost:""},underline:{solid:"",dashed:""},underlined:{solid:"",dashed:""},size:{lg:"h-10 px-4 text-sm gap-1.5 [&_svg:not([class*=size-])]:size-4",md:"h-9 px-3 gap-1.5 text-sm [&_svg:not([class*=size-])]:size-4",sm:"h-8 px-2.5 gap-1.25 text-xs [&_svg:not([class*=size-])]:size-3.5",xs:"h-7 px-2 gap-1 text-xs [&_svg:not([class*=size-])]:size-3.5",icon:"size-9 [&_svg:not([class*=size-])]:size-4 shrink-0"},autoHeight:{true:"",false:""},radius:{md:"rounded-md",full:"rounded-full"},mode:{default:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",icon:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 shrink-0",link:"text-primary h-auto p-0 bg-transparent rounded-none hover:bg-transparent data-[state=open]:bg-transparent",input:`
|
|
2
2
|
justify-start font-normal hover:bg-background [&_svg]:transition-colors [&_svg]:hover:text-foreground data-[state=open]:bg-background
|
|
3
3
|
focus-visible:border-ring focus-visible:outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/30
|
|
4
4
|
[[data-state=open]>&]:border-ring [[data-state=open]>&]:outline-hidden [[data-state=open]>&]:ring-[3px]
|
|
5
5
|
[[data-state=open]>&]:ring-ring/30
|
|
6
6
|
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
7
7
|
in-data-[invalid=true]:border-destructive/60 in-data-[invalid=true]:ring-destructive/10 dark:in-data-[invalid=true]:border-destructive dark:in-data-[invalid=true]:ring-destructive/20
|
|
8
|
-
`},placeholder:{true:"text-muted-foreground",false:""}},compoundVariants:[{variant:"ghost",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"dashed",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"secondary",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"input",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"icon",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{size:"xs",autoHeight:!0,className:"h-auto min-h-7"},{size:"md",autoHeight:!0,className:"h-auto min-h-9"},{size:"sm",autoHeight:!0,className:"h-auto min-h-8"},{size:"lg",autoHeight:!0,className:"h-auto min-h-10"},{variant:"primary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"link",underline:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"primary",mode:"link",underline:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"primary",mode:"link",underlined:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"primary",mode:"link",underlined:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underline:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"inverse",mode:"link",underline:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underlined:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"inverse",mode:"link",underlined:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underline:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"foreground",mode:"link",underline:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underlined:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"foreground",mode:"link",underlined:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"primary",appearance:"ghost",className:"bg-transparent text-primary/90 hover:bg-primary/5 data-[state=open]:bg-primary/5"},{variant:"destructive",appearance:"ghost",className:"bg-transparent text-destructive/90 hover:bg-destructive/5 data-[state=open]:bg-destructive/5"},{variant:"ghost",mode:"icon",className:"text-muted-foreground"},{size:"xs",mode:"icon",className:"w-7 h-7 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"sm",mode:"icon",className:"w-8 h-8 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"md",mode:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"lg",mode:"icon",className:"w-10 h-10 p-0 [&_svg:not([class*=size-])]:size-4"},{mode:"input",placeholder:!0,variant:"outline",className:"font-normal text-muted-foreground"},{mode:"input",variant:"outline",size:"sm",className:"gap-1.25"},{mode:"input",variant:"outline",size:"md",className:"gap-1.5"},{mode:"input",variant:"outline",size:"lg",className:"gap-1.5"}],defaultVariants:{variant:"primary",mode:"default",size:"md",radius:"md",appearance:"default"}});function C(y){var w=y,{className:e,selected:t,variant:a,radius:o,appearance:r,mode:i,size:l,autoHeight:c,underlined:s,underline:f,asChild:m=!1,placeholder:b=!1}=w,p=g(w,["className","selected","variant","radius","appearance","mode","size","autoHeight","underlined","underline","asChild","placeholder"]);let N=m?dr.Slot.Slot:"button";return(0,cr.jsx)(N,n(n({"data-slot":"button",className:x(Fi({variant:a,size:l,radius:o,appearance:r,mode:i,autoHeight:c,placeholder:b,underlined:s,underline:f,className:e}),m&&p.disabled&&"pointer-events-none opacity-50")},t&&{"data-state":"open"}),p))}var bo=require("react/jsx-runtime");function za(e){return(0,bo.jsx)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,bo.jsx)("path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"#141B34",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}var wo=require("react/jsx-runtime");function Gt(e){return(0,wo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:(0,wo.jsx)("path",{fill:"currentColor",d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76z"})}))}var de=require("react/jsx-runtime");function Mi(e,t){let a=[];if(t<=7)for(let o=1;o<=t;o++)a.push(o);else e<=4?a.push(1,2,3,4,5,"ellipsis",t):e>=t-3?a.push(1,"ellipsis",t-4,t-3,t-2,t-1,t):a.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return a}function pr({className:e}){let{pagination:t,handlePageChange:a,files:o,folders:r}=O(),{currentPage:i,totalPages:l}=t,c=((o==null?void 0:o.length)||0)+((r==null?void 0:r.length)||0);if(l<=1||c===0)return null;let s=Mi(i,l);return(0,de.jsx)(nr,{className:e,children:(0,de.jsxs)(ir,{children:[(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:"ghost",radius:"full",asChild:!0,disabled:i===1,onClick:()=>i>1&&a(i-1),children:(0,de.jsxs)("span",{children:[(0,de.jsx)(Gt,{className:"rtl:rotate-180"})," Previous"]})})}),s.map((f,m)=>f==="ellipsis"?(0,de.jsx)(la,{children:(0,de.jsx)(lr,{})},`ellipsis-${i}-${l}-${m}`):(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:f===i?"outline":"ghost",mode:"icon",size:"icon",radius:"full",asChild:!0,onClick:()=>a(f),disabled:f===i,children:(0,de.jsx)("span",{children:f})})},f)),(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:"ghost",radius:"full",asChild:!0,disabled:i===l,onClick:()=>i<l&&a(i+1),children:(0,de.jsxs)("span",{children:["Next ",(0,de.jsx)(za,{className:"rtl:rotate-180"})]})})})]})})}var ur=require("react/jsx-runtime");function mr({children:e,className:t}){return(0,ur.jsx)("div",{className:x("p-4 flex md:flex-row gap-2",t),children:e})}var Ur=require("react");var fr=require("class-variance-authority"),gr=require("lucide-react"),it=require("radix-ui");var he=require("react/jsx-runtime"),Di=(0,fr.cva)("flex flex-col fixed outline-0 z-50 border border-border bg-background p-6 shadow-lg shadow-black/5 duration-200 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 rounded-2xl",{variants:{variant:{default:"left-[50%] top-[50%] max-w-lg translate-x-[-50%] translate-y-[-50%] w-full",fullscreen:"inset-5"}},defaultVariants:{variant:"default"}});function ze(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Root,n({"data-slot":"dialog"},e))}function Ni(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Portal,n({"data-slot":"dialog-portal"},e))}function qe(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Close,n({"data-slot":"dialog-close"},e))}function Ii(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Overlay,n({"data-slot":"dialog-overlay",className:x("fixed inset-0 z-50 bg-black/30 [backdrop-filter:blur(4px)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)},t))}function Te(l){var c=l,{className:e,children:t,showCloseButton:a=!0,overlay:o=!0,variant:r}=c,i=g(c,["className","children","showCloseButton","overlay","variant"]);return(0,he.jsxs)(Ni,{children:[o&&(0,he.jsx)(Ii,{}),(0,he.jsxs)(it.Dialog.Content,d(n({"data-slot":"dialog-content",className:x(Di({variant:r}),e)},i),{children:[t,a&&(0,he.jsxs)(qe,{className:"cursor-pointer outline-0 absolute end-5 top-5 rounded-full opacity-60 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,he.jsx)(gr.X,{className:"size-4"}),(0,he.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})}var Be=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)("div",n({"data-slot":"dialog-header",className:x("flex flex-col space-y-1 text-center sm:text-start mb-5",e)},t))},He=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)("div",n({"data-slot":"dialog-footer",className:x("flex flex-col-reverse sm:flex-row sm:justify-end pt-5 sm:space-x-2.5",e)},t))};function Re(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Title,n({"data-slot":"dialog-title",className:x("text-lg font-semibold leading-none tracking-tight",e)},t))}function lt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Description,n({"data-slot":"dialog-description",className:x("text-sm text-muted-foreground",e)},t))}var hr=require("class-variance-authority"),vr=require("lucide-react");var Qe=require("react/jsx-runtime"),Pi=(0,hr.cva)("flex items-stretch w-full gap-2 group-[.toaster]:w-(--width)",{variants:{variant:{secondary:"",primary:"",destructive:"",success:"",info:"",mono:"",warning:""},icon:{primary:"",destructive:"",success:"",info:"",warning:""},appearance:{solid:"",outline:"",light:"",stroke:"text-foreground"},size:{lg:"rounded-lg p-4 gap-3 text-base [&>[data-slot=alert-icon]>svg]:size-6 *:data-slot=alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-1",md:"rounded-lg p-3.5 gap-2.5 text-sm [&>[data-slot=alert-icon]>svg]:size-5 *:data-slot=alert-icon:mt-0 [&_[data-slot=alert-close]]:mt-0.5",sm:"rounded-md px-3 py-2.5 gap-2 text-xs [&>[data-slot=alert-icon]>svg]:size-4 *:data-alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-0.25 [&_[data-slot=alert-close]_svg]:size-3.5"}},compoundVariants:[{variant:"secondary",appearance:"solid",className:"bg-muted text-foreground"},{variant:"primary",appearance:"solid",className:"bg-primary text-primary-foreground"},{variant:"destructive",appearance:"solid",className:"bg-destructive text-destructive-foreground"},{variant:"success",appearance:"solid",className:"bg-[var(--color-success,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]"},{variant:"info",appearance:"solid",className:"bg-[var(--color-info,var(--color-violet-600))] text-[var(--color-info-foreground,var(--color-white))]"},{variant:"warning",appearance:"solid",className:"bg-[var(--color-warning,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]"},{variant:"mono",appearance:"solid",className:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black *:data-slot-[alert=close]:text-white"},{variant:"secondary",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"primary",appearance:"outline",className:"border border-border bg-background text-primary [&_[data-slot=alert-close]]:text-foreground"},{variant:"destructive",appearance:"outline",className:"border border-border bg-background text-destructive [&_[data-slot=alert-close]]:text-foreground"},{variant:"success",appearance:"outline",className:"border border-border bg-background text-[var(--color-success,var(--color-green-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"info",appearance:"outline",className:"border border-border bg-background text-[var(--color-info,var(--color-violet-600))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"warning",appearance:"outline",className:"border border-border bg-background text-[var(--color-warning,var(--color-yellow-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"mono",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"secondary",appearance:"light",className:"bg-muted border border-border text-foreground"},{variant:"primary",appearance:"light",className:"text-foreground bg-[var(--color-primary-soft,var(--color-blue-50))] border border-[var(--color-primary-alpha,var(--color-blue-100))] [&_[data-slot=alert-icon]]:text-primary dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-alpha,var(--color-blue-900))]"},{variant:"destructive",appearance:"light",className:"bg-[var(--color-destructive-soft,var(--color-red-50))] border border-[var(--color-destructive-alpha,var(--color-red-100))] text-foreground [&_[data-slot=alert-icon]]:text-destructive dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-alpha,var(--color-red-900))] "},{variant:"success",appearance:"light",className:"bg-[var(--color-success-soft,var(--color-green-50))] border border-[var(--color-success-alpha,var(--color-green-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-alpha,var(--color-green-900))]"},{variant:"info",appearance:"light",className:"bg-[var(--color-info-soft,var(--color-violet-50))] border border-[var(--color-info-alpha,var(--color-violet-100))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-alpha,var(--color-violet-900))]"},{variant:"warning",appearance:"light",className:"bg-[var(--color-warning-soft,var(--color-yellow-50))] border border-[var(--color-warning-alpha,var(--color-yellow-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-alpha,var(--color-yellow-900))]"},{variant:"mono",icon:"primary",className:"[&_[data-slot=alert-icon]]:text-primary"},{variant:"mono",icon:"warning",className:"[&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))]"},{variant:"mono",icon:"success",className:"[&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))]"},{variant:"mono",icon:"destructive",className:"[&_[data-slot=alert-icon]]:text-destructive"},{variant:"mono",icon:"info",className:"[&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))]"}],defaultVariants:{variant:"secondary",appearance:"solid",size:"md"}});function xr(f){var m=f,{className:e,variant:t,size:a,icon:o,appearance:r,close:i=!1,onClose:l,children:c}=m,s=g(m,["className","variant","size","icon","appearance","close","onClose","children"]);return(0,Qe.jsxs)("div",d(n({"data-slot":"alert",role:"alert",className:x(Pi({variant:t,size:a,icon:o,appearance:r}),e)},s),{children:[c,i&&(0,Qe.jsx)("button",{onClick:l,"aria-label":"Dismiss","data-slot":"alert-close",className:x("group shrink-0 size-4 cursor-pointer"),children:(0,Qe.jsx)(vr.X,{className:"opacity-60 group-hover:opacity-100 size-4"})})]}))}function br(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-title",className:x("grow tracking-tight",e)},t))}function wr(o){var r=o,{children:e,className:t}=r,a=g(r,["children","className"]);return(0,Qe.jsx)("div",d(n({"data-slot":"alert-icon",className:x("shrink-0",t)},a),{children:e}))}function Cr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-description",className:x("text-sm [&_p]:leading-relaxed [&_p]:mb-2",e)},t))}function yr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-content",className:x("space-y-2 [&_[data-slot=alert-title]]:font-semibold",e)},t))}var Ee=ka(require("@radix-ui/react-tooltip"));var Je=require("react/jsx-runtime");function ki(a){var o=a,{delayDuration:e=0}=o,t=g(o,["delayDuration"]);return(0,Je.jsx)(Ee.Provider,n({"data-slot":"tooltip-provider",delayDuration:e},t))}function Fr(t){var e=g(t,[]);return(0,Je.jsx)(ki,{children:(0,Je.jsx)(Ee.Root,n({"data-slot":"tooltip"},e))})}function Mr(t){var e=g(t,[]);return(0,Je.jsx)(Ee.Trigger,n({"data-slot":"tooltip-trigger"},e))}function Dr(r){var i=r,{className:e,sideOffset:t=0,children:a}=i,o=g(i,["className","sideOffset","children"]);return(0,Je.jsx)(Ee.Portal,{children:(0,Je.jsxs)(Ee.Content,d(n({"data-slot":"tooltip-content",sideOffset:t,className:x("bg-foreground text-background 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",e)},o),{children:[a,(0,Je.jsx)(Ee.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})}function le(e){if(e===0)return"0 Bytes";let t=1024,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(t));return Number.parseFloat((e/Math.pow(t,o)).toFixed(2))+" "+a[o]}var re=require("react");var Nr=(e={})=>{let{maxFiles:t=Number.POSITIVE_INFINITY,maxSize:a=Number.POSITIVE_INFINITY,accept:o="*",multiple:r=!1,initialFiles:i=[],onFilesChange:l,onFilesAdded:c,onError:s}=e,[f,m]=(0,re.useState)({files:i.map(u=>({file:u,id:u.id,preview:u.url})),isDragging:!1,errors:[]}),b=(0,re.useRef)(null);(0,re.useEffect)(()=>()=>{f.files.forEach(u=>{u.preview&&u.file instanceof File&&URL.revokeObjectURL(u.preview)})},[f.files]);let p=(0,re.useCallback)(u=>{if(u instanceof File){if(u.size>a)return`File "${u.name}" exceeds the maximum size of ${le(a)}.`}else if(u.size>a)return`File "${u.name}" exceeds the maximum size of ${le(a)}.`;if(o!=="*"){let L=o.split(",").map($=>$.trim()),v=u instanceof File?u.type||"":u.type,G=`.${u instanceof File,u.name.split(".").pop()}`;if(!L.some($=>{if($.startsWith("."))return G.toLowerCase()===$.toLowerCase();if($.endsWith("/*")){let we=$.split("/")[0];return v.startsWith(`${we}/`)}return v===$}))return`File "${u instanceof File,u.name}" is not an accepted file type.`}return null},[o,a]),y=(0,re.useCallback)(u=>u instanceof File?URL.createObjectURL(u):u.url,[]),w=(0,re.useCallback)(u=>u instanceof File?`${u.name}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:u.id.toString(),[]),N=(0,re.useCallback)(()=>{m(u=>{for(let v of u.files)v.preview&&v.file instanceof File&&v.file.type.startsWith("image/")&&URL.revokeObjectURL(v.preview);b.current&&(b.current.value="");let L=d(n({},u),{files:[],errors:[]});return l==null||l(L.files),L})},[l]),M=(0,re.useCallback)(u=>{if(!u||u.length===0)return;let L=Array.from(u),v=[];m(G=>d(n({},G),{errors:[]})),r||N(),m(G=>{if(r&&t!==Number.POSITIVE_INFINITY&&G.files.length+L.length>t)return v.push(`You can only upload a maximum of ${t} files.`),s==null||s(v),d(n({},G),{errors:v});let B=[];for(let $ of L){if(r&&G.files.some(_=>_.file.name===$.name&&_.file.size===$.size))continue;if($.size>a){v.push(r?`Some files exceed the maximum size of ${le(a)}.`:`File exceeds the maximum size of ${le(a)}.`);continue}let we=p($);we?v.push(we):B.push({file:$,id:w($),preview:y($)})}if(B.length>0){c==null||c(B);let $=r?[...G.files,...B]:B;return l==null||l($),d(n({},G),{files:$,errors:v})}else if(v.length>0)return s==null||s(v),d(n({},G),{errors:v});return G}),b.current&&(b.current.value="")},[t,r,a,p,y,w,N,l,c,s]),D=(0,re.useCallback)(u=>{m(L=>{let v=L.files.find(B=>B.id===u);v&&v.preview&&v.file instanceof File&&v.file.type.startsWith("image/")&&URL.revokeObjectURL(v.preview);let G=L.files.filter(B=>B.id!==u);return l==null||l(G),d(n({},L),{files:G,errors:[]})})},[l]),z=(0,re.useCallback)(()=>{m(u=>d(n({},u),{errors:[]}))},[]),T=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation(),m(L=>d(n({},L),{isDragging:!0}))},[]),h=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation(),!u.currentTarget.contains(u.relatedTarget)&&m(L=>d(n({},L),{isDragging:!1}))},[]),I=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation()},[]),Y=(0,re.useCallback)(u=>{var L;if(u.preventDefault(),u.stopPropagation(),m(v=>d(n({},v),{isDragging:!1})),!((L=b.current)!=null&&L.disabled)&&u.dataTransfer.files&&u.dataTransfer.files.length>0)if(r)M(u.dataTransfer.files);else{let v=u.dataTransfer.files[0];M([v])}},[M,r]),te=(0,re.useCallback)(u=>{u.target.files&&u.target.files.length>0&&M(u.target.files)},[M]),se=(0,re.useCallback)(()=>{b.current&&b.current.click()},[]),De=(0,re.useCallback)((u={})=>d(n({},u),{type:"file",onChange:te,accept:u.accept||o,multiple:u.multiple!==void 0?u.multiple:r,ref:b}),[o,r,te]);return[f,{addFiles:M,removeFile:D,clearFiles:N,clearErrors:z,handleDragEnter:T,handleDragLeave:h,handleDragOver:I,handleDrop:Y,handleFileChange:te,openFileDialog:se,getInputProps:De}]};var Qa=require("lucide-react");var Do=ka(require("mime"));var Bt=require("react/jsx-runtime");function Ta(e){return(0,Bt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 29.93 40.02",width:"100",height:"100"},e),{children:[(0,Bt.jsx)("path",{fill:"#e5252a",d:"M5.21 0l13.38 0 11.34 11.82 0 22.99c0,2.88 -2.33,5.21 -5.2,5.21l-19.52 0c-2.88,0 -5.21,-2.33 -5.21,-5.21l0 -29.6c0,-2.88 2.33,-5.21 5.21,-5.21z"}),(0,Bt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"18.58 0 18.58 11.73 29.93 11.73"}),(0,Bt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M5.79 29.86l0 -7.31 3.11 0c0.77,0 1.38,0.21 1.84,0.64 0.46,0.42 0.69,0.99 0.69,1.7 0,0.71 -0.23,1.28 -0.69,1.7 -0.46,0.43 -1.07,0.64 -1.84,0.64l-1.24 0 0 2.63 -1.87 0zm1.87 -4.22l1.03 0c0.28,0 0.5,-0.06 0.65,-0.2 0.15,-0.13 0.23,-0.31 0.23,-0.55 0,-0.24 -0.08,-0.42 -0.23,-0.55 -0.15,-0.14 -0.37,-0.2 -0.65,-0.2l-1.03 0 0 1.5zm4.54 4.22l0 -7.31 2.59 0c0.51,0 0.99,0.07 1.44,0.22 0.45,0.15 0.86,0.36 1.22,0.65 0.36,0.28 0.65,0.66 0.86,1.14 0.2,0.48 0.31,1.03 0.31,1.65 0,0.61 -0.11,1.16 -0.31,1.64 -0.21,0.48 -0.5,0.86 -0.86,1.14 -0.36,0.29 -0.77,0.5 -1.22,0.65 -0.45,0.15 -0.93,0.22 -1.44,0.22l-2.59 0zm1.83 -1.59l0.54 0c0.29,0 0.56,-0.03 0.81,-0.1 0.24,-0.07 0.47,-0.18 0.69,-0.33 0.21,-0.15 0.38,-0.36 0.5,-0.64 0.12,-0.28 0.18,-0.61 0.18,-0.99 0,-0.39 -0.06,-0.72 -0.18,-1 -0.12,-0.28 -0.29,-0.49 -0.5,-0.64 -0.22,-0.15 -0.45,-0.26 -0.69,-0.33 -0.25,-0.07 -0.52,-0.1 -0.81,-0.1l-0.54 0 0 4.13zm5.53 1.59l0 -7.31 5.2 0 0 1.59 -3.33 0 0 1.17 2.66 0 0 1.58 -2.66 0 0 2.97 -1.87 0z"})]}))}var Ht=require("react/jsx-runtime");function Ra(e){return(0,Ht.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 17.69 23.65",width:"100",height:"100"},e),{children:[(0,Ht.jsx)("path",{fill:"#00733b",d:"M3.08 0l7.91 0 6.7 6.99 0 13.58c0,1.7 -1.38,3.08 -3.08,3.08l-11.53 0c-1.7,0 -3.08,-1.38 -3.08,-3.08l0 -17.49c0,-1.7 1.38,-3.08 3.08,-3.08z"}),(0,Ht.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"10.98 0 10.98 6.93 17.69 6.93"}),(0,Ht.jsx)("path",{fill:"#fff",d:"M5.21 17.35l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 -6.08l3.15 0 0 1.18 -3.15 0 0 -1.18zm-4.12 0l3.14 0 0 1.18 -3.14 0 0 -1.18zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2.08l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19z"})]}))}var Ut=require("react/jsx-runtime");function Ea(e){return(0,Ut.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Ut.jsx)("path",{fill:"#e03303",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Ut.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Ut.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M11.76 16.13c-2.44,0.12 -4.38,2.15 -4.35,4.62 0.04,2.46 2.04,4.47 4.5,4.5 2.48,0.04 4.51,-1.9 4.62,-4.34 0.01,-0.12 -0.09,-0.22 -0.21,-0.22l-4.13 0c-0.12,0 -0.22,-0.1 -0.22,-0.21l0 -4.14c0,-0.12 -0.09,-0.21 -0.21,-0.21zm1.1 -0.67l0 4.13c0,0.12 0.09,0.21 0.21,0.21l4.14 0c0.12,0 0.21,-0.1 0.21,-0.22 -0.11,-2.34 -1.99,-4.22 -4.34,-4.33 -0.12,-0.01 -0.22,0.09 -0.22,0.21z"})]}))}var Zt=require("react/jsx-runtime");function Aa(e){return(0,Zt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 38.89 51.99",width:"100",height:"100"},e),{children:[(0,Zt.jsx)("path",{fill:"#0263d1",fillRule:"nonzero",d:"M6.76 0l17.4 0 14.73 15.36 0 29.87c0,3.73 -3.03,6.76 -6.77,6.76l-25.36 0c-3.73,0 -6.76,-3.03 -6.76,-6.76l0 -38.47c0,-3.73 3.03,-6.76 6.76,-6.76z"}),(0,Zt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"24.14 0 24.14 15.24 38.89 15.24"}),(0,Zt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M26.3 27.05l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm-4.57 13.71l-9.14 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l9.14 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm4.57 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm0 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0z"})]}))}var jt=require("react/jsx-runtime");function _a(e){return(0,jt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,jt.jsx)("path",{fill:"#ffc000",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,jt.jsx)("polygon",{fill:"#ffffff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,jt.jsx)("path",{fill:"#ffffff",fillRule:"nonzero",d:"M16.45 21.21l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm0 2.86l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm-4.36 -8.57l-4.21 0c-0.4,0 -0.72,0.31 -0.72,0.71 0,0.4 0.32,0.71 0.72,0.71l4.21 0c0.4,0 0.72,-0.31 0.72,-0.71 0,-0.4 -0.32,-0.71 -0.72,-0.71l0 0zm4.36 2.85l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0z"})]}))}var Ve=require("react/jsx-runtime");function La(e){return(0,Ve.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"100",height:"100",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:[(0,Ve.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1",x1:"37.127",x2:"25.868",y1:"6.873",y2:"18.132",gradientUnits:"userSpaceOnUse",children:[(0,Ve.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ve.jsx)("stop",{offset:".913",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ve.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1)",d:"M28,4v8c0,2.209,1.791,4,4,4h8L28,4z",children:" "}),(0,Ve.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2",x1:"-8.398",x2:"74.731",y1:"51.185",y2:"-18.568",gradientUnits:"userSpaceOnUse",children:[(0,Ve.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ve.jsx)("stop",{offset:"1",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ve.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2)",d:"M40,16v23c0,2.761-2.239,5-5,5H8V9c0-2.761,2.239-5,5-5h15L40,16z"})]}))}var $t=require("react/jsx-runtime");function Va(e){return(0,$t.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,$t.jsx)("path",{fill:"#ffb11f",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,$t.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,$t.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M8.96 16.9l0 -2.22c0,-0.24 -0.19,-0.43 -0.43,-0.43l-1.2 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 2.22 -0.67 1.96c-0.19,0.55 -0.1,1.16 0.24,1.63 0.33,0.47 0.88,0.75 1.46,0.75 0.58,0 1.12,-0.28 1.46,-0.75 0.34,-0.47 0.43,-1.08 0.24,-1.63l-0.67 -1.96zm-0.28 3.08c-0.34,0.49 -1.16,0.49 -1.51,0 -0.17,-0.24 -0.22,-0.56 -0.12,-0.84l0.22 -0.66 1.31 0 0.23 0.66c0.09,0.28 0.05,0.6 -0.13,0.84zm-3.41 -17.65l0 1.22c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.82 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.94c0,0.24 0.19,0.44 0.43,0.44l1.63 0 0 1.81 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.95c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.38c0,0.24 0.2,0.43 0.44,0.43l2.39 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.23 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.24 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.2 0.43,-0.44l0 -0.94c0,-0.24 -0.2,-0.44 -0.43,-0.44l-1.64 0 0 -1.66c0,0 -3.25,0.01 -3.25,0.01z"})]}))}var Wt=require("react/jsx-runtime");function Oa(e){return(0,Wt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 20.49 27.4",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,Wt.jsx)("path",{fill:"#00a1e0",d:"M3.56 0l9.17 0 7.76 8.1 0 15.73c0,1.97 -1.59,3.57 -3.56,3.57l-13.37 0c-1.96,0 -3.56,-1.6 -3.56,-3.57l0 -20.27c0,-1.96 1.6,-3.56 3.56,-3.56z"}),(0,Wt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"12.72 0 12.72 8.03 20.49 8.03"}),(0,Wt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M12.07 20.44l-0.52 0 0 -0.99 0.11 0c0.26,0 0.39,-0.14 0.39,-0.42l0 -1.45c0,-0.23 0.06,-0.41 0.16,-0.53 0.11,-0.11 0.27,-0.21 0.48,-0.3 -0.2,-0.08 -0.36,-0.18 -0.47,-0.3 -0.11,-0.12 -0.17,-0.29 -0.17,-0.52l0 -1.45c0,-0.28 -0.13,-0.42 -0.39,-0.42l-0.11 0 0 -0.99 0.52 0c0.31,0 0.56,0.1 0.76,0.3 0.2,0.2 0.3,0.45 0.3,0.75l0 1.55c0,0.38 0.21,0.57 0.63,0.57l0 1.03c-0.42,0 -0.63,0.19 -0.63,0.58l0 1.54c0,0.3 -0.1,0.55 -0.3,0.75 -0.2,0.2 -0.45,0.3 -0.76,0.3zm-3.65 0c-0.3,0 -0.56,-0.1 -0.76,-0.3 -0.2,-0.2 -0.3,-0.45 -0.3,-0.75l0 -1.54c0,-0.39 -0.21,-0.58 -0.63,-0.58l0 -1.03c0.42,0 0.63,-0.19 0.63,-0.57l0 -1.55c0,-0.3 0.1,-0.55 0.3,-0.75 0.2,-0.2 0.46,-0.3 0.76,-0.3l0.53 0 0 0.99 -0.12 0c-0.26,0 -0.39,0.14 -0.39,0.42l0 1.45c0,0.23 -0.05,0.4 -0.16,0.52 -0.11,0.12 -0.27,0.22 -0.48,0.3 0.21,0.09 0.37,0.19 0.48,0.3 0.11,0.12 0.16,0.3 0.16,0.53l0 1.45c0,0.28 0.13,0.42 0.39,0.42l0.12 0 0 0.99 -0.53 0z"})]}))}var Kt=require("react/jsx-runtime");function Ga(e){return(0,Kt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Kt.jsx)("path",{fill:"#90c",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Kt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Kt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M15.07 21.38c0.31,-0.52 0.52,-1.18 0.56,-1.83 0.02,-0.42 -0.07,-0.86 -0.27,-1.27 -0.32,-0.65 -0.86,-1.01 -1.39,-1.37 -0.39,-0.26 -0.76,-0.51 -1.02,-0.86l-0.05 -0.06c-0.15,-0.21 -0.33,-0.45 -0.36,-0.65 -0.02,-0.2 -0.21,-0.34 -0.4,-0.33 -0.21,0.02 -0.36,0.18 -0.36,0.39l0 6.86c-0.32,-0.2 -0.72,-0.32 -1.16,-0.32 -1.06,0 -1.92,0.69 -1.92,1.54 0,0.85 0.86,1.54 1.92,1.54 1.06,0 1.93,-0.69 1.93,-1.54l0 -4.49c0.58,0.23 1.52,0.79 1.78,2.1 -0.05,0.07 -0.09,0.15 -0.15,0.21 -0.14,0.16 -0.12,0.4 0.04,0.55 0.16,0.14 0.4,0.12 0.54,-0.04 0.1,-0.12 0.2,-0.25 0.28,-0.4 0.01,-0.01 0.02,-0.02 0.03,-0.03z"})]}))}var J=require("react/jsx-runtime");function Ba(e){return(0,J.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:"100",height:"100"},e),{children:[(0,J.jsx)("path",{fill:"#188a32",d:"M56,35v8c0,1.66-1.34,3-3,3H11c-1.66,0-3-1.34-3-3v-8c0-1.66,1.34-3,3-3h42C54.66,32,56,33.34,56,35z"}),(0,J.jsx)("path",{fill:"#0082AA",d:"M44,29v5c0,1.66-1.34,3-3,3H23c-1.66,0-3-1.34-3-3v-5h4v4h16v-4H44z"}),(0,J.jsx)("path",{fill:"#4d50c6",d:`M53,32H11c-1.657,0-3-1.343-3-3v-8c0-1.657,1.343-3,3-3h42c1.657,0,3,1.343,3,3v8
|
|
8
|
+
`},placeholder:{true:"text-muted-foreground",false:""}},compoundVariants:[{variant:"ghost",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"dashed",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"secondary",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"input",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"icon",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{size:"xs",autoHeight:!0,className:"h-auto min-h-7"},{size:"md",autoHeight:!0,className:"h-auto min-h-9"},{size:"sm",autoHeight:!0,className:"h-auto min-h-8"},{size:"lg",autoHeight:!0,className:"h-auto min-h-10"},{variant:"primary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"link",underline:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"primary",mode:"link",underline:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"primary",mode:"link",underlined:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"primary",mode:"link",underlined:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underline:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"inverse",mode:"link",underline:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underlined:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"inverse",mode:"link",underlined:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underline:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"foreground",mode:"link",underline:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underlined:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"foreground",mode:"link",underlined:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"primary",appearance:"ghost",className:"bg-transparent text-primary/90 hover:bg-primary/5 data-[state=open]:bg-primary/5"},{variant:"destructive",appearance:"ghost",className:"bg-transparent text-destructive/90 hover:bg-destructive/5 data-[state=open]:bg-destructive/5"},{variant:"ghost",mode:"icon",className:"text-muted-foreground"},{size:"xs",mode:"icon",className:"w-7 h-7 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"sm",mode:"icon",className:"w-8 h-8 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"md",mode:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"lg",mode:"icon",className:"w-10 h-10 p-0 [&_svg:not([class*=size-])]:size-4"},{mode:"input",placeholder:!0,variant:"outline",className:"font-normal text-muted-foreground"},{mode:"input",variant:"outline",size:"sm",className:"gap-1.25"},{mode:"input",variant:"outline",size:"md",className:"gap-1.5"},{mode:"input",variant:"outline",size:"lg",className:"gap-1.5"}],defaultVariants:{variant:"primary",mode:"default",size:"md",radius:"md",appearance:"default"}});function C(y){var w=y,{className:e,selected:t,variant:a,radius:o,appearance:r,mode:i,size:l,autoHeight:c,underlined:s,underline:f,asChild:m=!1,placeholder:b=!1}=w,p=g(w,["className","selected","variant","radius","appearance","mode","size","autoHeight","underlined","underline","asChild","placeholder"]);let N=m?cr.Slot.Slot:"button";return(0,pr.jsx)(N,n(n({"data-slot":"button",className:x(Fi({variant:a,size:l,radius:o,appearance:r,mode:i,autoHeight:c,placeholder:b,underlined:s,underline:f,className:e}),m&&p.disabled&&"pointer-events-none opacity-50")},t&&{"data-state":"open"}),p))}var wo=require("react/jsx-runtime");function za(e){return(0,wo.jsx)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,wo.jsx)("path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"#141B34",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}var Co=require("react/jsx-runtime");function Gt(e){return(0,Co.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:(0,Co.jsx)("path",{fill:"currentColor",d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76z"})}))}var de=require("react/jsx-runtime");function Mi(e,t){let a=[];if(t<=7)for(let o=1;o<=t;o++)a.push(o);else e<=4?a.push(1,2,3,4,5,"ellipsis",t):e>=t-3?a.push(1,"ellipsis",t-4,t-3,t-2,t-1,t):a.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return a}function mr({className:e}){let{pagination:t,handlePageChange:a,files:o,folders:r}=O(),{currentPage:i,totalPages:l}=t,c=((o==null?void 0:o.length)||0)+((r==null?void 0:r.length)||0);if(l<=1||c===0)return null;let s=Mi(i,l);return(0,de.jsx)(ir,{className:e,children:(0,de.jsxs)(lr,{children:[(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:"ghost",radius:"full",asChild:!0,disabled:i===1,onClick:()=>i>1&&a(i-1),children:(0,de.jsxs)("span",{children:[(0,de.jsx)(Gt,{className:"rtl:rotate-180"})," Previous"]})})}),s.map((f,m)=>f==="ellipsis"?(0,de.jsx)(la,{children:(0,de.jsx)(sr,{})},`ellipsis-${i}-${l}-${m}`):(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:f===i?"outline":"ghost",mode:"icon",size:"icon",radius:"full",asChild:!0,onClick:()=>a(f),disabled:f===i,children:(0,de.jsx)("span",{children:f})})},f)),(0,de.jsx)(la,{children:(0,de.jsx)(C,{variant:"ghost",radius:"full",asChild:!0,disabled:i===l,onClick:()=>i<l&&a(i+1),children:(0,de.jsxs)("span",{children:["Next ",(0,de.jsx)(za,{className:"rtl:rotate-180"})]})})})]})})}var fr=require("react/jsx-runtime");function ur({children:e,className:t}){return(0,fr.jsx)("div",{className:x("p-4 flex md:flex-row gap-2",t),children:e})}var Zr=require("react");var gr=require("class-variance-authority"),hr=require("lucide-react"),it=require("radix-ui");var he=require("react/jsx-runtime"),Di=(0,gr.cva)("flex flex-col fixed outline-0 z-50 border border-border bg-background p-6 shadow-lg shadow-black/5 duration-200 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 rounded-2xl",{variants:{variant:{default:"left-[50%] top-[50%] max-w-lg translate-x-[-50%] translate-y-[-50%] w-full",fullscreen:"inset-5"}},defaultVariants:{variant:"default"}});function ze(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Root,n({"data-slot":"dialog"},e))}function Ni(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Portal,n({"data-slot":"dialog-portal"},e))}function qe(t){var e=g(t,[]);return(0,he.jsx)(it.Dialog.Close,n({"data-slot":"dialog-close"},e))}function Ii(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Overlay,n({"data-slot":"dialog-overlay",className:x("fixed inset-0 z-50 bg-black/30 [backdrop-filter:blur(4px)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)},t))}function Te(l){var c=l,{className:e,children:t,showCloseButton:a=!0,overlay:o=!0,variant:r}=c,i=g(c,["className","children","showCloseButton","overlay","variant"]);return(0,he.jsxs)(Ni,{children:[o&&(0,he.jsx)(Ii,{}),(0,he.jsxs)(it.Dialog.Content,d(n({"data-slot":"dialog-content",className:x(Di({variant:r}),e)},i),{children:[t,a&&(0,he.jsxs)(qe,{className:"cursor-pointer outline-0 absolute end-5 top-5 rounded-full opacity-60 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,he.jsx)(hr.X,{className:"size-4"}),(0,he.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})}var Be=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)("div",n({"data-slot":"dialog-header",className:x("flex flex-col space-y-1 text-center sm:text-start mb-5",e)},t))},He=a=>{var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)("div",n({"data-slot":"dialog-footer",className:x("flex flex-col-reverse sm:flex-row sm:justify-end pt-5 sm:space-x-2.5",e)},t))};function Re(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Title,n({"data-slot":"dialog-title",className:x("text-lg font-semibold leading-none tracking-tight",e)},t))}function lt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,he.jsx)(it.Dialog.Description,n({"data-slot":"dialog-description",className:x("text-sm text-muted-foreground",e)},t))}var vr=require("class-variance-authority"),xr=require("lucide-react");var Qe=require("react/jsx-runtime"),Pi=(0,vr.cva)("flex items-stretch w-full gap-2 group-[.toaster]:w-(--width)",{variants:{variant:{secondary:"",primary:"",destructive:"",success:"",info:"",mono:"",warning:""},icon:{primary:"",destructive:"",success:"",info:"",warning:""},appearance:{solid:"",outline:"",light:"",stroke:"text-foreground"},size:{lg:"rounded-lg p-4 gap-3 text-base [&>[data-slot=alert-icon]>svg]:size-6 *:data-slot=alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-1",md:"rounded-lg p-3.5 gap-2.5 text-sm [&>[data-slot=alert-icon]>svg]:size-5 *:data-slot=alert-icon:mt-0 [&_[data-slot=alert-close]]:mt-0.5",sm:"rounded-md px-3 py-2.5 gap-2 text-xs [&>[data-slot=alert-icon]>svg]:size-4 *:data-alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-0.25 [&_[data-slot=alert-close]_svg]:size-3.5"}},compoundVariants:[{variant:"secondary",appearance:"solid",className:"bg-muted text-foreground"},{variant:"primary",appearance:"solid",className:"bg-primary text-primary-foreground"},{variant:"destructive",appearance:"solid",className:"bg-destructive text-destructive-foreground"},{variant:"success",appearance:"solid",className:"bg-[var(--color-success,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]"},{variant:"info",appearance:"solid",className:"bg-[var(--color-info,var(--color-violet-600))] text-[var(--color-info-foreground,var(--color-white))]"},{variant:"warning",appearance:"solid",className:"bg-[var(--color-warning,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]"},{variant:"mono",appearance:"solid",className:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black *:data-slot-[alert=close]:text-white"},{variant:"secondary",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"primary",appearance:"outline",className:"border border-border bg-background text-primary [&_[data-slot=alert-close]]:text-foreground"},{variant:"destructive",appearance:"outline",className:"border border-border bg-background text-destructive [&_[data-slot=alert-close]]:text-foreground"},{variant:"success",appearance:"outline",className:"border border-border bg-background text-[var(--color-success,var(--color-green-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"info",appearance:"outline",className:"border border-border bg-background text-[var(--color-info,var(--color-violet-600))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"warning",appearance:"outline",className:"border border-border bg-background text-[var(--color-warning,var(--color-yellow-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"mono",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"secondary",appearance:"light",className:"bg-muted border border-border text-foreground"},{variant:"primary",appearance:"light",className:"text-foreground bg-[var(--color-primary-soft,var(--color-blue-50))] border border-[var(--color-primary-alpha,var(--color-blue-100))] [&_[data-slot=alert-icon]]:text-primary dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-alpha,var(--color-blue-900))]"},{variant:"destructive",appearance:"light",className:"bg-[var(--color-destructive-soft,var(--color-red-50))] border border-[var(--color-destructive-alpha,var(--color-red-100))] text-foreground [&_[data-slot=alert-icon]]:text-destructive dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-alpha,var(--color-red-900))] "},{variant:"success",appearance:"light",className:"bg-[var(--color-success-soft,var(--color-green-50))] border border-[var(--color-success-alpha,var(--color-green-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-alpha,var(--color-green-900))]"},{variant:"info",appearance:"light",className:"bg-[var(--color-info-soft,var(--color-violet-50))] border border-[var(--color-info-alpha,var(--color-violet-100))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-alpha,var(--color-violet-900))]"},{variant:"warning",appearance:"light",className:"bg-[var(--color-warning-soft,var(--color-yellow-50))] border border-[var(--color-warning-alpha,var(--color-yellow-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-alpha,var(--color-yellow-900))]"},{variant:"mono",icon:"primary",className:"[&_[data-slot=alert-icon]]:text-primary"},{variant:"mono",icon:"warning",className:"[&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))]"},{variant:"mono",icon:"success",className:"[&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))]"},{variant:"mono",icon:"destructive",className:"[&_[data-slot=alert-icon]]:text-destructive"},{variant:"mono",icon:"info",className:"[&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))]"}],defaultVariants:{variant:"secondary",appearance:"solid",size:"md"}});function br(f){var m=f,{className:e,variant:t,size:a,icon:o,appearance:r,close:i=!1,onClose:l,children:c}=m,s=g(m,["className","variant","size","icon","appearance","close","onClose","children"]);return(0,Qe.jsxs)("div",d(n({"data-slot":"alert",role:"alert",className:x(Pi({variant:t,size:a,icon:o,appearance:r}),e)},s),{children:[c,i&&(0,Qe.jsx)("button",{onClick:l,"aria-label":"Dismiss","data-slot":"alert-close",className:x("group shrink-0 size-4 cursor-pointer"),children:(0,Qe.jsx)(xr.X,{className:"opacity-60 group-hover:opacity-100 size-4"})})]}))}function wr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-title",className:x("grow tracking-tight",e)},t))}function Cr(o){var r=o,{children:e,className:t}=r,a=g(r,["children","className"]);return(0,Qe.jsx)("div",d(n({"data-slot":"alert-icon",className:x("shrink-0",t)},a),{children:e}))}function yr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-description",className:x("text-sm [&_p]:leading-relaxed [&_p]:mb-2",e)},t))}function Fr(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Qe.jsx)("div",n({"data-slot":"alert-content",className:x("space-y-2 [&_[data-slot=alert-title]]:font-semibold",e)},t))}var Ee=ka(require("@radix-ui/react-tooltip"));var Je=require("react/jsx-runtime");function ki(a){var o=a,{delayDuration:e=0}=o,t=g(o,["delayDuration"]);return(0,Je.jsx)(Ee.Provider,n({"data-slot":"tooltip-provider",delayDuration:e},t))}function Mr(t){var e=g(t,[]);return(0,Je.jsx)(ki,{children:(0,Je.jsx)(Ee.Root,n({"data-slot":"tooltip"},e))})}function Dr(t){var e=g(t,[]);return(0,Je.jsx)(Ee.Trigger,n({"data-slot":"tooltip-trigger"},e))}function Nr(r){var i=r,{className:e,sideOffset:t=0,children:a}=i,o=g(i,["className","sideOffset","children"]);return(0,Je.jsx)(Ee.Portal,{children:(0,Je.jsxs)(Ee.Content,d(n({"data-slot":"tooltip-content",sideOffset:t,className:x("bg-foreground text-background 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",e)},o),{children:[a,(0,Je.jsx)(Ee.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})}function le(e){if(e===0)return"0 Bytes";let t=1024,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(t));return Number.parseFloat((e/Math.pow(t,o)).toFixed(2))+" "+a[o]}var re=require("react");var Ir=(e={})=>{let{maxFiles:t=Number.POSITIVE_INFINITY,maxSize:a=Number.POSITIVE_INFINITY,accept:o="*",multiple:r=!1,initialFiles:i=[],onFilesChange:l,onFilesAdded:c,onError:s}=e,[f,m]=(0,re.useState)({files:i.map(u=>({file:u,id:u.id,preview:u.url})),isDragging:!1,errors:[]}),b=(0,re.useRef)(null);(0,re.useEffect)(()=>()=>{f.files.forEach(u=>{u.preview&&u.file instanceof File&&URL.revokeObjectURL(u.preview)})},[f.files]);let p=(0,re.useCallback)(u=>{if(u instanceof File){if(u.size>a)return`File "${u.name}" exceeds the maximum size of ${le(a)}.`}else if(u.size>a)return`File "${u.name}" exceeds the maximum size of ${le(a)}.`;if(o!=="*"){let L=o.split(",").map($=>$.trim()),v=u instanceof File?u.type||"":u.type,G=`.${u instanceof File,u.name.split(".").pop()}`;if(!L.some($=>{if($.startsWith("."))return G.toLowerCase()===$.toLowerCase();if($.endsWith("/*")){let Ce=$.split("/")[0];return v.startsWith(`${Ce}/`)}return v===$}))return`File "${u instanceof File,u.name}" is not an accepted file type.`}return null},[o,a]),y=(0,re.useCallback)(u=>u instanceof File?URL.createObjectURL(u):u.url,[]),w=(0,re.useCallback)(u=>u instanceof File?`${u.name}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:u.id.toString(),[]),N=(0,re.useCallback)(()=>{m(u=>{for(let v of u.files)v.preview&&v.file instanceof File&&v.file.type.startsWith("image/")&&URL.revokeObjectURL(v.preview);b.current&&(b.current.value="");let L=d(n({},u),{files:[],errors:[]});return l==null||l(L.files),L})},[l]),M=(0,re.useCallback)(u=>{if(!u||u.length===0)return;let L=Array.from(u),v=[];m(G=>d(n({},G),{errors:[]})),r||N(),m(G=>{if(r&&t!==Number.POSITIVE_INFINITY&&G.files.length+L.length>t)return v.push(`You can only upload a maximum of ${t} files.`),s==null||s(v),d(n({},G),{errors:v});let B=[];for(let $ of L){if(r&&G.files.some(_=>_.file.name===$.name&&_.file.size===$.size))continue;if($.size>a){v.push(r?`Some files exceed the maximum size of ${le(a)}.`:`File exceeds the maximum size of ${le(a)}.`);continue}let Ce=p($);Ce?v.push(Ce):B.push({file:$,id:w($),preview:y($)})}if(B.length>0){c==null||c(B);let $=r?[...G.files,...B]:B;return l==null||l($),d(n({},G),{files:$,errors:v})}else if(v.length>0)return s==null||s(v),d(n({},G),{errors:v});return G}),b.current&&(b.current.value="")},[t,r,a,p,y,w,N,l,c,s]),D=(0,re.useCallback)(u=>{m(L=>{let v=L.files.find(B=>B.id===u);v&&v.preview&&v.file instanceof File&&v.file.type.startsWith("image/")&&URL.revokeObjectURL(v.preview);let G=L.files.filter(B=>B.id!==u);return l==null||l(G),d(n({},L),{files:G,errors:[]})})},[l]),z=(0,re.useCallback)(()=>{m(u=>d(n({},u),{errors:[]}))},[]),T=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation(),m(L=>d(n({},L),{isDragging:!0}))},[]),h=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation(),!u.currentTarget.contains(u.relatedTarget)&&m(L=>d(n({},L),{isDragging:!1}))},[]),I=(0,re.useCallback)(u=>{u.preventDefault(),u.stopPropagation()},[]),Y=(0,re.useCallback)(u=>{var L;if(u.preventDefault(),u.stopPropagation(),m(v=>d(n({},v),{isDragging:!1})),!((L=b.current)!=null&&L.disabled)&&u.dataTransfer.files&&u.dataTransfer.files.length>0)if(r)M(u.dataTransfer.files);else{let v=u.dataTransfer.files[0];M([v])}},[M,r]),te=(0,re.useCallback)(u=>{u.target.files&&u.target.files.length>0&&M(u.target.files)},[M]),se=(0,re.useCallback)(()=>{b.current&&b.current.click()},[]),De=(0,re.useCallback)((u={})=>d(n({},u),{type:"file",onChange:te,accept:u.accept||o,multiple:u.multiple!==void 0?u.multiple:r,ref:b}),[o,r,te]);return[f,{addFiles:M,removeFile:D,clearFiles:N,clearErrors:z,handleDragEnter:T,handleDragLeave:h,handleDragOver:I,handleDrop:Y,handleFileChange:te,openFileDialog:se,getInputProps:De}]};var Qa=require("lucide-react");var No=ka(require("mime"));var Bt=require("react/jsx-runtime");function Ta(e){return(0,Bt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 29.93 40.02",width:"100",height:"100"},e),{children:[(0,Bt.jsx)("path",{fill:"#e5252a",d:"M5.21 0l13.38 0 11.34 11.82 0 22.99c0,2.88 -2.33,5.21 -5.2,5.21l-19.52 0c-2.88,0 -5.21,-2.33 -5.21,-5.21l0 -29.6c0,-2.88 2.33,-5.21 5.21,-5.21z"}),(0,Bt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"18.58 0 18.58 11.73 29.93 11.73"}),(0,Bt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M5.79 29.86l0 -7.31 3.11 0c0.77,0 1.38,0.21 1.84,0.64 0.46,0.42 0.69,0.99 0.69,1.7 0,0.71 -0.23,1.28 -0.69,1.7 -0.46,0.43 -1.07,0.64 -1.84,0.64l-1.24 0 0 2.63 -1.87 0zm1.87 -4.22l1.03 0c0.28,0 0.5,-0.06 0.65,-0.2 0.15,-0.13 0.23,-0.31 0.23,-0.55 0,-0.24 -0.08,-0.42 -0.23,-0.55 -0.15,-0.14 -0.37,-0.2 -0.65,-0.2l-1.03 0 0 1.5zm4.54 4.22l0 -7.31 2.59 0c0.51,0 0.99,0.07 1.44,0.22 0.45,0.15 0.86,0.36 1.22,0.65 0.36,0.28 0.65,0.66 0.86,1.14 0.2,0.48 0.31,1.03 0.31,1.65 0,0.61 -0.11,1.16 -0.31,1.64 -0.21,0.48 -0.5,0.86 -0.86,1.14 -0.36,0.29 -0.77,0.5 -1.22,0.65 -0.45,0.15 -0.93,0.22 -1.44,0.22l-2.59 0zm1.83 -1.59l0.54 0c0.29,0 0.56,-0.03 0.81,-0.1 0.24,-0.07 0.47,-0.18 0.69,-0.33 0.21,-0.15 0.38,-0.36 0.5,-0.64 0.12,-0.28 0.18,-0.61 0.18,-0.99 0,-0.39 -0.06,-0.72 -0.18,-1 -0.12,-0.28 -0.29,-0.49 -0.5,-0.64 -0.22,-0.15 -0.45,-0.26 -0.69,-0.33 -0.25,-0.07 -0.52,-0.1 -0.81,-0.1l-0.54 0 0 4.13zm5.53 1.59l0 -7.31 5.2 0 0 1.59 -3.33 0 0 1.17 2.66 0 0 1.58 -2.66 0 0 2.97 -1.87 0z"})]}))}var Ht=require("react/jsx-runtime");function Ra(e){return(0,Ht.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 17.69 23.65",width:"100",height:"100"},e),{children:[(0,Ht.jsx)("path",{fill:"#00733b",d:"M3.08 0l7.91 0 6.7 6.99 0 13.58c0,1.7 -1.38,3.08 -3.08,3.08l-11.53 0c-1.7,0 -3.08,-1.38 -3.08,-3.08l0 -17.49c0,-1.7 1.38,-3.08 3.08,-3.08z"}),(0,Ht.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"10.98 0 10.98 6.93 17.69 6.93"}),(0,Ht.jsx)("path",{fill:"#fff",d:"M5.21 17.35l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 -6.08l3.15 0 0 1.18 -3.15 0 0 -1.18zm-4.12 0l3.14 0 0 1.18 -3.14 0 0 -1.18zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2.08l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19z"})]}))}var Ut=require("react/jsx-runtime");function Ea(e){return(0,Ut.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Ut.jsx)("path",{fill:"#e03303",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Ut.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Ut.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M11.76 16.13c-2.44,0.12 -4.38,2.15 -4.35,4.62 0.04,2.46 2.04,4.47 4.5,4.5 2.48,0.04 4.51,-1.9 4.62,-4.34 0.01,-0.12 -0.09,-0.22 -0.21,-0.22l-4.13 0c-0.12,0 -0.22,-0.1 -0.22,-0.21l0 -4.14c0,-0.12 -0.09,-0.21 -0.21,-0.21zm1.1 -0.67l0 4.13c0,0.12 0.09,0.21 0.21,0.21l4.14 0c0.12,0 0.21,-0.1 0.21,-0.22 -0.11,-2.34 -1.99,-4.22 -4.34,-4.33 -0.12,-0.01 -0.22,0.09 -0.22,0.21z"})]}))}var Zt=require("react/jsx-runtime");function Aa(e){return(0,Zt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 38.89 51.99",width:"100",height:"100"},e),{children:[(0,Zt.jsx)("path",{fill:"#0263d1",fillRule:"nonzero",d:"M6.76 0l17.4 0 14.73 15.36 0 29.87c0,3.73 -3.03,6.76 -6.77,6.76l-25.36 0c-3.73,0 -6.76,-3.03 -6.76,-6.76l0 -38.47c0,-3.73 3.03,-6.76 6.76,-6.76z"}),(0,Zt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"24.14 0 24.14 15.24 38.89 15.24"}),(0,Zt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M26.3 27.05l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm-4.57 13.71l-9.14 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l9.14 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm4.57 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm0 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0z"})]}))}var jt=require("react/jsx-runtime");function _a(e){return(0,jt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,jt.jsx)("path",{fill:"#ffc000",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,jt.jsx)("polygon",{fill:"#ffffff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,jt.jsx)("path",{fill:"#ffffff",fillRule:"nonzero",d:"M16.45 21.21l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm0 2.86l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm-4.36 -8.57l-4.21 0c-0.4,0 -0.72,0.31 -0.72,0.71 0,0.4 0.32,0.71 0.72,0.71l4.21 0c0.4,0 0.72,-0.31 0.72,-0.71 0,-0.4 -0.32,-0.71 -0.72,-0.71l0 0zm4.36 2.85l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0z"})]}))}var Ve=require("react/jsx-runtime");function La(e){return(0,Ve.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"100",height:"100",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:[(0,Ve.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1",x1:"37.127",x2:"25.868",y1:"6.873",y2:"18.132",gradientUnits:"userSpaceOnUse",children:[(0,Ve.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ve.jsx)("stop",{offset:".913",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ve.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1)",d:"M28,4v8c0,2.209,1.791,4,4,4h8L28,4z",children:" "}),(0,Ve.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2",x1:"-8.398",x2:"74.731",y1:"51.185",y2:"-18.568",gradientUnits:"userSpaceOnUse",children:[(0,Ve.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ve.jsx)("stop",{offset:"1",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ve.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2)",d:"M40,16v23c0,2.761-2.239,5-5,5H8V9c0-2.761,2.239-5,5-5h15L40,16z"})]}))}var $t=require("react/jsx-runtime");function Va(e){return(0,$t.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,$t.jsx)("path",{fill:"#ffb11f",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,$t.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,$t.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M8.96 16.9l0 -2.22c0,-0.24 -0.19,-0.43 -0.43,-0.43l-1.2 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 2.22 -0.67 1.96c-0.19,0.55 -0.1,1.16 0.24,1.63 0.33,0.47 0.88,0.75 1.46,0.75 0.58,0 1.12,-0.28 1.46,-0.75 0.34,-0.47 0.43,-1.08 0.24,-1.63l-0.67 -1.96zm-0.28 3.08c-0.34,0.49 -1.16,0.49 -1.51,0 -0.17,-0.24 -0.22,-0.56 -0.12,-0.84l0.22 -0.66 1.31 0 0.23 0.66c0.09,0.28 0.05,0.6 -0.13,0.84zm-3.41 -17.65l0 1.22c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.82 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.94c0,0.24 0.19,0.44 0.43,0.44l1.63 0 0 1.81 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.95c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.38c0,0.24 0.2,0.43 0.44,0.43l2.39 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.23 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.24 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.2 0.43,-0.44l0 -0.94c0,-0.24 -0.2,-0.44 -0.43,-0.44l-1.64 0 0 -1.66c0,0 -3.25,0.01 -3.25,0.01z"})]}))}var Wt=require("react/jsx-runtime");function Oa(e){return(0,Wt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 20.49 27.4",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,Wt.jsx)("path",{fill:"#00a1e0",d:"M3.56 0l9.17 0 7.76 8.1 0 15.73c0,1.97 -1.59,3.57 -3.56,3.57l-13.37 0c-1.96,0 -3.56,-1.6 -3.56,-3.57l0 -20.27c0,-1.96 1.6,-3.56 3.56,-3.56z"}),(0,Wt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"12.72 0 12.72 8.03 20.49 8.03"}),(0,Wt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M12.07 20.44l-0.52 0 0 -0.99 0.11 0c0.26,0 0.39,-0.14 0.39,-0.42l0 -1.45c0,-0.23 0.06,-0.41 0.16,-0.53 0.11,-0.11 0.27,-0.21 0.48,-0.3 -0.2,-0.08 -0.36,-0.18 -0.47,-0.3 -0.11,-0.12 -0.17,-0.29 -0.17,-0.52l0 -1.45c0,-0.28 -0.13,-0.42 -0.39,-0.42l-0.11 0 0 -0.99 0.52 0c0.31,0 0.56,0.1 0.76,0.3 0.2,0.2 0.3,0.45 0.3,0.75l0 1.55c0,0.38 0.21,0.57 0.63,0.57l0 1.03c-0.42,0 -0.63,0.19 -0.63,0.58l0 1.54c0,0.3 -0.1,0.55 -0.3,0.75 -0.2,0.2 -0.45,0.3 -0.76,0.3zm-3.65 0c-0.3,0 -0.56,-0.1 -0.76,-0.3 -0.2,-0.2 -0.3,-0.45 -0.3,-0.75l0 -1.54c0,-0.39 -0.21,-0.58 -0.63,-0.58l0 -1.03c0.42,0 0.63,-0.19 0.63,-0.57l0 -1.55c0,-0.3 0.1,-0.55 0.3,-0.75 0.2,-0.2 0.46,-0.3 0.76,-0.3l0.53 0 0 0.99 -0.12 0c-0.26,0 -0.39,0.14 -0.39,0.42l0 1.45c0,0.23 -0.05,0.4 -0.16,0.52 -0.11,0.12 -0.27,0.22 -0.48,0.3 0.21,0.09 0.37,0.19 0.48,0.3 0.11,0.12 0.16,0.3 0.16,0.53l0 1.45c0,0.28 0.13,0.42 0.39,0.42l0.12 0 0 0.99 -0.53 0z"})]}))}var Kt=require("react/jsx-runtime");function Ga(e){return(0,Kt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Kt.jsx)("path",{fill:"#90c",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Kt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Kt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M15.07 21.38c0.31,-0.52 0.52,-1.18 0.56,-1.83 0.02,-0.42 -0.07,-0.86 -0.27,-1.27 -0.32,-0.65 -0.86,-1.01 -1.39,-1.37 -0.39,-0.26 -0.76,-0.51 -1.02,-0.86l-0.05 -0.06c-0.15,-0.21 -0.33,-0.45 -0.36,-0.65 -0.02,-0.2 -0.21,-0.34 -0.4,-0.33 -0.21,0.02 -0.36,0.18 -0.36,0.39l0 6.86c-0.32,-0.2 -0.72,-0.32 -1.16,-0.32 -1.06,0 -1.92,0.69 -1.92,1.54 0,0.85 0.86,1.54 1.92,1.54 1.06,0 1.93,-0.69 1.93,-1.54l0 -4.49c0.58,0.23 1.52,0.79 1.78,2.1 -0.05,0.07 -0.09,0.15 -0.15,0.21 -0.14,0.16 -0.12,0.4 0.04,0.55 0.16,0.14 0.4,0.12 0.54,-0.04 0.1,-0.12 0.2,-0.25 0.28,-0.4 0.01,-0.01 0.02,-0.02 0.03,-0.03z"})]}))}var J=require("react/jsx-runtime");function Ba(e){return(0,J.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:"100",height:"100"},e),{children:[(0,J.jsx)("path",{fill:"#188a32",d:"M56,35v8c0,1.66-1.34,3-3,3H11c-1.66,0-3-1.34-3-3v-8c0-1.66,1.34-3,3-3h42C54.66,32,56,33.34,56,35z"}),(0,J.jsx)("path",{fill:"#0082AA",d:"M44,29v5c0,1.66-1.34,3-3,3H23c-1.66,0-3-1.34-3-3v-5h4v4h16v-4H44z"}),(0,J.jsx)("path",{fill:"#4d50c6",d:`M53,32H11c-1.657,0-3-1.343-3-3v-8c0-1.657,1.343-3,3-3h42c1.657,0,3,1.343,3,3v8
|
|
9
9
|
C56,30.657,54.657,32,53,32z`}),(0,J.jsx)("path",{fill:"#e6275e",d:`M53,18H11c-1.657,0-3-1.343-3-3V7c0-1.657,1.343-3,3-3h42c1.657,0,3,1.343,3,3v8
|
|
10
10
|
C56,16.657,54.657,18,53,18z`}),(0,J.jsx)("rect",{width:"16",height:"42",x:"24",y:"4",fill:"#FAB400"}),(0,J.jsx)("path",{fill:"#DC9600",d:"M32,46L32,46c-4.418,0-8-3.582-8-8v-4h16v4C40,42.418,36.418,46,32,46z"}),(0,J.jsx)("path",{fill:"#FAB400",d:"M32,44L32,44c-4.418,0-8-3.582-8-8v-4h16v4C40,40.418,36.418,44,32,44z"}),(0,J.jsx)("rect",{width:"16",height:"4",x:"24",y:"33",fill:"#DC9600"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:`M44,17v16c0,1.66-1.34,3-3,3H23c-1.66,0-3-1.34-3-3V17c0-1.66,1.34-3,3-3h1v18h16V14h1
|
|
11
11
|
C42.66,14,44,15.34,44,17z`}),(0,J.jsx)("path",{fill:"#D2D2D2",d:"M34,31v2c0,1.1-0.9,2-2,2s-2-0.9-2-2v-2H34z"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:`M32,34L32,34c-1.105,0-2-0.895-2-2v-8c0-1.105,0.895-2,2-2h0c1.105,0,2,0.895,2,2v8
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,5.7,0,6.6,0,7.8v47.5C0,56.4,0.9,57.4,2.1,57.4z`}),(0,Pt.jsx)("path",{fill:"#504e4e",d:`M3,58.3h56.7c1.1,0,2.1-0.9,2.1-2.1V14.3c0-1.1-0.9-2.1-2.1-2.1H31c-0.8,0-1.5-0.4-1.8-1.1l-1.7-3.4
|
|
22
22
|
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,6.6,0,7.6,0,8.7v46.6C0,56.9,1.3,58.3,3,58.3z`}),(0,Pt.jsx)("path",{fill:"#676666",d:`M64,18.6v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
23
23
|
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,15.6,64,17,64,18.6z`}),(0,Pt.jsx)("path",{fill:"#6f6d6d",d:`M64,19.5v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
24
|
-
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,16.5,64,17.9,64,19.5z`})]}))}var Q=require("react/jsx-runtime");function Xe(e){return(0,Q.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true"},e),{children:(0,Q.jsxs)("g",{fill:"none",children:[(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"origin",mask:"url(#1752500502786-6297956_folder_mask_2iow0yqdp)"}),(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"clone",filter:"url(#1752500502786-6297956_folder_filter_56qas2ark)",clipPath:"url(#1752500502786-6297956_folder_clipPath_gygn8e14a)"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)","data-glass":"blur"}),(0,Q.jsx)("path",{d:"M18.6807 9.00586C19.7975 9.02423 20.4692 9.09846 20.9864 9.39258C21.5915 9.73676 22.0586 10.2802 22.3067 10.9307C22.5894 11.6719 22.4426 12.6251 22.1495 14.5303L21.626 17.9297C21.4038 19.3742 21.2926 20.097 20.9385 20.6396L20.8155 20.8135C20.5147 21.2098 20.1193 21.5262 19.6641 21.7324C19.074 21.9997 18.3431 22 16.8819 22V21.25C17.624 21.25 18.1389 21.2495 18.543 21.2188C18.9374 21.1887 19.1709 21.133 19.3546 21.0498C19.7447 20.873 20.0766 20.5882 20.3106 20.2295C20.4208 20.0606 20.5119 19.8385 20.6016 19.4531C20.6935 19.0584 20.772 18.5489 20.8848 17.8154L21.4083 14.416C21.5568 13.4504 21.6601 12.7732 21.6954 12.2441C21.7302 11.7223 21.6913 11.4231 21.6055 11.1982C21.4194 10.7103 21.0693 10.3021 20.6153 10.0439C20.4061 9.92506 20.1166 9.84086 19.5958 9.7959C19.0675 9.75031 18.3823 9.75 17.4053 9.75H6.59479C5.61785 9.75 4.93266 9.75032 4.40436 9.7959C3.88353 9.84086 3.59399 9.92504 3.38483 10.0439C2.93088 10.3021 2.5807 10.7103 2.3946 11.1982C2.30885 11.4231 2.26996 11.7223 2.30475 12.2441C2.34005 12.7732 2.44331 13.4504 2.59186 14.416L3.1153 17.8154C3.22814 18.5489 3.30665 19.0584 3.3985 19.4531C3.4882 19.8385 3.5793 20.0606 3.68952 20.2295C3.92357 20.5882 4.25545 20.873 4.64558 21.0498C4.82929 21.133 5.06268 21.1887 5.4571 21.2188C5.86121 21.2495 6.37613 21.25 7.11823 21.25V22L6.14948 21.9961C5.44148 21.9856 4.96108 21.9493 4.56452 21.8213L4.336 21.7324C3.88079 21.5262 3.48544 21.2098 3.18464 20.8135L3.06159 20.6396C2.79608 20.2327 2.66703 19.7244 2.52546 18.8867L2.37409 17.9297L1.85065 14.5303C1.57585 12.744 1.42974 11.7947 1.64558 11.0723L1.6944 10.9307C1.91158 10.3615 2.29578 9.8738 2.79401 9.53027L3.01374 9.39258C3.70332 9.00046 4.66737 9 6.59479 9H17.4053L18.6807 9.00586ZM16.8819 21.25V22H7.11823V21.25H16.8819Z",fill:"url(#1752500502786-6297956_folder_existing_2_vhap9347d)"}),(0,Q.jsxs)("defs",{children:[(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_0_ekojck6b3",x1:"12",y1:"2",x2:"12",y2:"16",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#575757"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#151515"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_1_v5o9796uz",x1:"23",y1:"15.5",x2:"1",y2:"15.5",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#E3E3E5",stopOpacity:".6"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#BBBBC0",stopOpacity:".6"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_2_vhap9347d",x1:"12",y1:"9",x2:"12",y2:"16.528",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#fff"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0"})]}),(0,Q.jsx)("filter",{id:"1752500502786-6297956_folder_filter_56qas2ark",x:"-100%",y:"-100%",width:"400%",height:"400%",filterUnits:"objectBoundingBox",primitiveUnits:"userSpaceOnUse",children:(0,Q.jsx)("feGaussianBlur",{stdDeviation:"2",x:"0%",y:"0%",width:"100%",height:"100%",in:"SourceGraphic",edgeMode:"none",result:"blur"})}),(0,Q.jsx)("clipPath",{id:"1752500502786-6297956_folder_clipPath_gygn8e14a",children:(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)"})}),(0,Q.jsxs)("mask",{id:"1752500502786-6297956_folder_mask_2iow0yqdp",children:[(0,Q.jsx)("rect",{width:"100%",height:"100%",fill:"#FFF"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"#000"})]})]})]})}))}var da=require("react/jsx-runtime");function $a(e){return(0,da.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,da.jsx)("path",{opacity:"0.4",d:"M13.4919 2.29395C13.0743 1.94268 12.5457 1.75 11.9997 1.75C11.5221 1.75 11.058 1.89775 10.6697 2.16992L10.5085 2.29395L1.5974 9.78906C1.18491 10.1364 1.13178 10.7528 1.47924 11.165C1.78946 11.5327 2.31307 11.6121 2.71557 11.3789V15.9531V15.955C2.71555 17.0543 2.71553 17.9612 2.7976 18.6885C2.88313 19.4463 3.06823 20.1292 3.52318 20.7217L3.68627 20.9199C3.85487 21.1119 4.04268 21.2876 4.24584 21.4434L4.47143 21.6016C5.01004 21.9427 5.61706 22.0932 6.281 22.168C7.00121 22.2491 7.89724 22.249 8.98176 22.249H8.99975H14.9997H15.0178C16.1023 22.249 16.9983 22.2491 17.7185 22.168C18.4771 22.0825 19.1606 21.8977 19.7537 21.4434L19.9529 21.2803C20.145 21.1119 20.3205 20.9245 20.4763 20.7217L20.6345 20.4961C20.976 19.9581 21.127 19.3517 21.2019 18.6885C21.284 17.9612 21.2839 17.0543 21.2839 15.955V15.9531V11.3789C21.6864 11.6121 22.21 11.5327 22.5203 11.165C22.846 10.7785 22.8199 10.2127 22.4753 9.85742L13.4919 2.29395Z",fill:"#141B34"}),(0,da.jsx)("path",{d:"M14.9998 17V22.249H8.99979V17C8.99979 15.5859 9.00002 14.8788 9.43924 14.4395C9.87855 14.0001 10.5857 14 11.9998 14C13.4139 14 14.121 14.0002 14.5603 14.4395C14.9997 14.8788 14.9998 15.5858 14.9998 17Z",fill:"#141B34"})]}))}var Co=require("react/jsx-runtime");function Ae(e){return(0,Co.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:(0,Co.jsx)("path",{fill:"currentColor",d:"M46.599 46.599a4.498 4.498 0 0 1-6.363 0l-7.941-7.941C29.028 40.749 25.167 42 21 42 9.402 42 0 32.598 0 21S9.402 0 21 0s21 9.402 21 21c0 4.167-1.251 8.028-3.342 11.295l7.941 7.941a4.498 4.498 0 0 1 0 6.363zM21 6C12.717 6 6 12.714 6 21s6.717 15 15 15c8.286 0 15-6.714 15-15S29.286 6 21 6z"})}))}var ca=require("react/jsx-runtime");function pa(e){return(0,ca.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,ca.jsx)("path",{fill:"currentColor",opacity:"0.4",d:"M20.4155 3.66085C22.3012 5.52939 19.2842 20.7253 16.1883 20.9931C13.5911 21.2177 12.7819 16.0954 12.2348 14.4719C11.695 12.8696 11.0943 12.2927 9.50513 11.767C5.46811 10.4315 3.4496 9.76374 3.04996 8.70639C1.99171 5.90649 18.0071 1.27438 20.4155 3.66085Z"}),(0,ca.jsx)("path",{fill:"currentColor",d:"M3.04996 8.70639C3.4496 9.76374 5.46811 10.4315 9.50513 11.767C10.3308 12.0402 10.8897 12.3271 11.3118 12.7646L20.4155 3.66085C18.0071 1.27438 1.99171 5.90649 3.04996 8.70639Z"})]}))}var Ir=require("react/jsx-runtime");var ma=require("react/jsx-runtime");function kt(e){return(0,ma.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,ma.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.75 11.7499C18.3023 11.7499 18.75 12.1977 18.75 12.7499V15.7499H21.75C22.3023 15.7499 22.75 16.1977 22.75 16.7499C22.75 17.3022 22.3023 17.7499 21.75 17.7499H18.75V20.7499C18.75 21.3022 18.3023 21.7499 17.75 21.7499C17.1977 21.7499 16.75 21.3022 16.75 20.7499V17.7499H13.75C13.1977 17.7499 12.75 17.3022 12.75 16.7499C12.75 16.1977 13.1977 15.7499 13.75 15.7499H16.75V12.7499C16.75 12.1977 17.1977 11.7499 17.75 11.7499Z",fill:"currentColor"}),(0,ma.jsx)("path",{opacity:"0.4",d:"M9.4626 2.48876C8.82373 2.24919 8.11205 2.24951 7.08264 2.24996C6.2039 2.24995 5.32205 2.24999 4.7497 2.30044C4.15996 2.35243 3.64388 2.46238 3.17258 2.7254C2.56533 3.06428 2.06428 3.56534 1.7254 4.17258C1.46238 4.64388 1.35242 5.15996 1.30044 5.7497C1.24999 6.32205 1.24999 7.03077 1.25 7.9095V11.0574C1.24999 13.3658 1.24998 15.1748 1.43975 16.5863C1.63399 18.031 2.03933 19.1711 2.93414 20.0659C3.82895 20.9607 4.96897 21.366 6.41371 21.5603C7.82519 21.75 9.63423 21.75 11.9426 21.75H13.2923C14.1084 21.75 14.8409 21.75 15.5 21.7383V18.9999H13.75C12.5074 18.9999 11.5 17.9926 11.5 16.7499C11.5 15.5073 12.5074 14.4999 13.75 14.4999H15.5V12.7499C15.5 11.5073 16.5074 10.4999 17.75 10.4999C18.9926 10.4999 20 11.5073 20 12.7499V14.4999H22.7383C22.75 13.8408 22.75 13.1084 22.75 12.2923C22.75 11.2733 22.75 10.3688 22.683 9.70949C22.6137 9.02893 22.4669 8.43872 22.118 7.91661C21.8444 7.50715 21.4929 7.15559 21.0834 6.88199C20.5613 6.53313 19.9711 6.38628 19.2905 6.31705C18.6312 6.24998 17.8095 6.24999 16.7905 6.25L13.2361 6.25C12.92 6.25 12.7396 6.24908 12.6064 6.23531C12.5044 6.22817 12.4348 6.15255 12.4128 6.11563C12.3409 6.0027 12.0838 5.48909 11.9425 5.20636C11.4704 4.25121 10.8581 3.01205 9.4626 2.48876Z",fill:"currentColor"})]}))}var yo=require("react/jsx-runtime");function St(e){return(0,yo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true"},e),{children:(0,yo.jsx)("path",{fill:"currentColor",d:"M19,11H13V5a1,1,0,0,0-2,0v6H5a1,1,0,0,0,0,2h6v6a1,1,0,0,0,2,0V13h6a1,1,0,0,0,0-2Z"})}))}var Jt=require("react/jsx-runtime");function Ze(e){return(0,Jt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:[(0,Jt.jsx)("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),(0,Jt.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),(0,Jt.jsx)("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:"0.5"})]}))}var Fo=require("react/jsx-runtime");function ve(e){return(0,Fo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:(0,Fo.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"})}))}var zt=require("react/jsx-runtime");function Wa(e){return(0,zt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,zt.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,zt.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,zt.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,zt.jsx)("path",{d:"M12 4l0 12"})]}))}var Tt=require("react/jsx-runtime");function Ka(e){return(0,Tt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,Tt.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Tt.jsx)("path",{d:"M9 15l6 -6"}),(0,Tt.jsx)("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),(0,Tt.jsx)("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]}))}var Mo=require("react/jsx-runtime");function Ya(e){return(0,Mo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:(0,Mo.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.944 1.25H10a.75.75 0 0 1 0 1.5c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S3.025 4.705 2.89 5.71c-.138 1.029-.14 2.383-.14 4.29a.75.75 0 0 1-1.5 0v-.056c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153m8.345 1.64c-1.027-.138-2.382-.14-4.289-.14a.75.75 0 0 1 0-1.5h.056c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433V10a.75.75 0 0 1-1.5 0c0-1.907-.002-3.261-.14-4.29c-.135-1.005-.389-1.585-.812-2.008s-1.003-.677-2.009-.812M2 13.25a.75.75 0 0 1 .75.75c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14a.75.75 0 0 1 0 1.5h-.056c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V14a.75.75 0 0 1 .75-.75m20 0a.75.75 0 0 1 .75.75v.056c0 1.838 0 3.294-.153 4.433c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H14a.75.75 0 0 1 0-1.5c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812s.677-1.003.812-2.009c.138-1.027.14-2.382.14-4.289a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})}))}var xe=require("react/jsx-runtime");function je(e,t){if(typeof e!="string")return console.warn("getFileTypeFromMime: mimeType is not a string:",e),X.FILE;let a=e;if(t){let o=t.toLowerCase().replace(/^\./,""),r=Do.default.getType(o);r&&(a=r)}return a.startsWith("image/")?X.IMAGE:a.startsWith("video/")?X.VIDEO:a.startsWith("audio/")?X.AUDIO:X.FILE}function qa(e,t){let a=e;if(t){let o=t.toLowerCase().replace(/^\./,""),r=Do.default.getType(o);r&&(a=r)}if(a.startsWith("image/"))return"image";if(a.startsWith("video/"))return"video";if(a.startsWith("audio/"))return"audio";switch(a){case"application/pdf":return"pdf";case"application/json":return"json";case"application/zip":case"application/x-zip-compressed":return"zip";case"application/x-rar-compressed":case"application/vnd.rar":return"rar";case"application/x-msdownload":case"application/x-executable":return"exe";case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":case"application/vnd.ms-excel":case"text/csv":return"excel";case"application/vnd.openxmlformats-officedocument.presentationml.presentation":case"application/vnd.ms-powerpoint":return"powerpoint";case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":case"application/msword":return"document"}if(a.startsWith("text/"))return"txt";if(t)switch(t.toLowerCase().replace(/^\./,"")){case"exe":case"msi":return"exe";case"zip":return"zip";case"rar":return"rar";case"pdf":return"pdf";case"csv":return"excel"}return"file"}var st=o=>{var r=o,{type:e,className:t}=r,a=g(r,["type","className"]);switch(e){case"folder-with-files":return(0,xe.jsx)(Za,n({className:t},a));case"folder":return(0,xe.jsx)(ja,n({className:t},a));case"image":return(0,xe.jsx)(qt,n({className:t},a));case"video":return(0,xe.jsx)(Ua,n({className:t},a));case"audio":return(0,xe.jsx)(Ga,n({className:t},a));case"pdf":return(0,xe.jsx)(Ta,n({className:t},a));case"excel":case"xlsx":return(0,xe.jsx)(Ra,n({className:t},a));case"powerpoint":case"pptx":return(0,xe.jsx)(Ea,n({className:t},a));case"document":case"docx":case"doc":return(0,xe.jsx)(Aa,n({className:t},a));case"txt":return(0,xe.jsx)(_a,n({className:t},a));case"json":return(0,xe.jsx)(Oa,n({className:t},a));case"zip":return(0,xe.jsx)(Va,n({className:t},a));case"rar":return(0,xe.jsx)(Ba,n({className:t},a));case"exe":return(0,xe.jsx)(Ha,n({className:t},a));default:return(0,xe.jsx)(La,n({className:t},a))}};function Pr(e){if(!e||e.length===0)return"*/*";let t=[];for(let a of e)switch(a){case X.IMAGE:t.push("image/*");break;case X.VIDEO:t.push("video/*");break;case X.AUDIO:t.push("audio/*");break;case X.FILE:t.push("application/*","text/*");break}return t.join(",")}function kr(e){if(!e||e.length===0)return"All files";let t=[];for(let a of e)switch(a){case X.IMAGE:t.push("Images");break;case X.VIDEO:t.push("Videos");break;case X.AUDIO:t.push("Audio");break;case X.FILE:t.push("Files");break}return t.join(", ")}var ua=require("react/jsx-runtime");function No(e){return(0,ua.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",color:"currentColor"},e),{children:[(0,ua.jsx)("path",{d:"M13.0059 21.25C13.0059 21.8023 12.5581 22.25 12.0059 22.25C11.4536 22.25 11.0059 21.8023 11.0059 21.25L11.0059 16.75L10.4116 16.75C10.236 16.7501 10.0203 16.7503 9.84387 16.7282L9.84053 16.7278C9.71408 16.712 9.13804 16.6402 8.86368 16.0746C8.58872 15.5078 8.89065 15.0076 8.95597 14.8994L8.95841 14.8954C9.05062 14.7424 9.18477 14.5715 9.29511 14.4309L9.31885 14.4007C9.61348 14.0249 9.99545 13.5406 10.3759 13.1496C10.5657 12.9545 10.783 12.7533 11.0139 12.5944C11.2191 12.4532 11.5693 12.25 12 12.25C12.4307 12.25 12.7809 12.4532 12.9861 12.5944C13.217 12.7533 13.4343 12.9545 13.6241 13.1496C14.0046 13.5406 14.3865 14.0249 14.6812 14.4007L14.7049 14.4309C14.8152 14.5715 14.9494 14.7424 15.0416 14.8954L15.044 14.8994C15.1093 15.0076 15.4113 15.5078 15.1363 16.0746C14.862 16.6402 14.2859 16.712 14.1595 16.7278L14.1561 16.7282C13.9797 16.7503 13.764 16.7501 13.5884 16.75L13.0059 16.75L13.0059 21.25Z",fill:"currentColor",fillRule:"evenodd"}),(0,ua.jsx)("path",{d:"M1.25 12.5C1.25 9.85827 3.03106 7.63322 5.45825 6.9592C5.65424 6.90478 5.75224 6.87756 5.80872 6.81971C5.8652 6.76186 5.88991 6.66386 5.93931 6.46785C6.62272 3.75655 9.07671 1.75002 12 1.75002C15.2149 1.75002 17.8628 4.17733 18.2112 7.29925C18.2385 7.54461 18.2522 7.66731 18.3147 7.7383C18.3772 7.80929 18.4989 7.83881 18.7423 7.89787C21.0422 8.4559 22.75 10.5285 22.75 13C22.75 15.8995 20.3995 18.25 17.5 18.25H16.4006C15.942 18.25 15.7126 18.25 15.6826 18.2119C15.6679 18.1933 15.6641 18.1839 15.6617 18.1604C15.6567 18.1121 15.8519 17.9223 16.2425 17.5427C17.2326 16.5804 17.255 14.9976 16.2927 14.0075C15.6442 13.1982 15.0315 12.3422 14.2379 11.6663C13.6086 11.1303 12.8426 10.75 12 10.75C11.1574 10.75 10.3914 11.1303 9.76209 11.6663C8.96846 12.3422 8.35575 13.1982 7.7073 14.0075C6.74496 14.9976 6.76745 16.5804 7.75753 17.5427C8.14807 17.9223 8.34334 18.1121 8.33832 18.1604C8.33587 18.1839 8.33206 18.1933 8.31739 18.2119C8.28737 18.25 8.05801 18.25 7.59942 18.25H7C3.82436 18.25 1.25 15.6757 1.25 12.5Z",fill:"currentColor"})]}))}var Sr=require("react"),fa=require("react/jsx-runtime");function zr({file:e}){var r;let[t,a]=(0,Sr.useState)(!1),o=e.previewUrl||e.url;return o&&!t?(0,fa.jsx)("img",{src:o,alt:((r=e==null?void 0:e.name)==null?void 0:r.substring(0,10))||"image",className:"w-full h-full object-contain rounded-md drop-shadow-md",onError:()=>a(!0)}):(0,fa.jsx)(qt,{})}function Tr({file:e}){return e.caption?(0,fa.jsxs)("p",{className:"text-xs text-blue-600 line-clamp-2 mb-2",children:[e.height," x ",e.width]}):null}var Io=require("lucide-react"),Rr=require("react"),ce=require("react/jsx-runtime");function Er({file:e,className:t}){let[a,o]=(0,Rr.useState)(!1);return e.previewUrl&&!a?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("img",{src:e.previewUrl,className:"w-full h-full object-contain rounded-md",alt:e.name,onError:()=>o(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(Io.Play,{className:"size-5 text-white fill-white"})})})]}):e.url&&!a?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("video",{src:e.url,className:"w-full h-full object-contain rounded-md",preload:"metadata",onError:()=>o(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(Io.Play,{className:"size-5 text-white fill-white"})})})]}):(0,ce.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,ce.jsx)("div",{className:"text-center",children:(0,ce.jsx)("div",{className:"text-4xl",children:(0,ce.jsx)(st,{type:"video",className:t})})})})}function Ar({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,ce.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var Rt=require("react/jsx-runtime");function _r({file:e,className:t}){return(0,Rt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,Rt.jsx)("div",{className:"text-center",children:(0,Rt.jsx)("div",{className:"text-4xl",children:(0,Rt.jsx)(st,{type:"audio",className:t})})})})}function Lr({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,Rt.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var dt=require("react/jsx-runtime");function Vr({file:e,className:t}){let a=qa(e.mime,e.ext);return(0,dt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent relative",children:e.previewUrl?(0,dt.jsx)("img",{src:e.previewUrl,alt:e.name,className:"w-full h-full object-contain rounded-md drop-shadow-md"}):(0,dt.jsx)("div",{className:"text-center",children:(0,dt.jsx)("div",{className:"text-4xl",children:(0,dt.jsx)(st,{type:a,className:t})})})})}function Or({file:e}){var t;return(t=e.metaData)!=null&&t.pageCount?(0,dt.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Pages: ",e.metaData.pageCount]}):null}var Br=require("react/jsx-runtime");function Gr({file:e}){let t=qa(e.mime,e.ext);return(0,Br.jsx)(st,{type:t})}var Hr={images:{component:zr,metadataComponent:Tr},videos:{component:Er,metadataComponent:Ar},files:{component:Vr,metadataComponent:Or},audios:{component:_r,metadataComponent:Lr},default:{component:Gr}};function ct(e){let t=je(e.mime,e.ext);return Hr[t]||Hr.default}var Po=require("react/jsx-runtime");function Xt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Po.jsx)("kbd",n({"data-slot":"kbd",className:x("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e)},t))}function ea(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Po.jsx)("kbd",n({"data-slot":"kbd-group",className:x("inline-flex items-center gap-1",e)},t))}var F=require("react/jsx-runtime");function Zr(){let{isUploadModalOpen:e,setIsUploadModalOpen:t,uploadFiles:a,allowedFileTypes:o,maxUploadFiles:r,maxUploadSize:i}=O(),l=Pr(o),c=kr(o),[s,f]=(0,Ur.useState)([]),[{isDragging:m,errors:b},{removeFile:p,clearFiles:y,handleDragEnter:w,handleDragLeave:N,handleDragOver:M,handleDrop:D,openFileDialog:z,getInputProps:T}]=Nr({maxFiles:r,maxSize:i,accept:l,multiple:!0,onFilesChange:v=>{let G=v.map(B=>{let $=s.find(we=>we.id===B.id);return $?n(n({},$),B):d(n({},B),{progress:100,status:"completed"})});f(G)}}),h=v=>{p(v)},I=v=>{f(G=>G.map(B=>B.id===v?d(n({},B),{progress:0,status:"uploading",error:void 0}):B))},Y=()=>{let v=s.filter(G=>G.status==="completed");if(v.length>0){let G=v.map(B=>({name:B.file.name,size:B.file.size,type:je(B.file.type,B.file.name.split(".").pop()),lastModified:B.file instanceof File?B.file.lastModified:Date.now(),file:B.file,metadata:{}}));a(G),te()}},te=()=>{t(!1),y(),f([])},se=(v,G)=>{let B={id:"temp",name:v.name,size:v.size,mime:v.type,ext:v.name.split(".").pop()||"",url:G||"",createdAt:new Date(v.lastModified),updatedAt:new Date(v.lastModified),folderId:null,metaData:{}},{component:$}=ct(B);return(0,F.jsx)($,{file:B,metaData:B.metaData})},De=s.filter(v=>v.status==="completed").length,u=s.filter(v=>v.status==="uploading").length,L=De>0&&u===0;return(0,F.jsx)(ze,{open:e,onOpenChange:t,children:(0,F.jsxs)(Te,{className:"p-0 max-w-4xl max-h-[80vh] flex flex-col",variant:"default",showCloseButton:!1,children:[(0,F.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,F.jsx)(Re,{className:"px-6 text-base",children:(0,F.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,F.jsxs)("span",{children:["Upload Files",(0,F.jsx)(ea,{className:"ml-2",children:(0,F.jsxs)(Xt,{children:[(0,F.jsx)("span",{className:"text-lg",children:"\u2318"})," + U"]})})]}),(0,F.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>t(!1),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,F.jsx)(ve,{className:"size-5"}),(0,F.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,F.jsx)(lt,{})]}),(0,F.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[(0,F.jsxs)("div",{className:x("relative rounded-lg border-dashed border-[2.5px] bg-gray-100 border-gray-300 px-6 py-16 text-center transition-colors mb-4",m?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"),onDragEnter:w,onDragLeave:N,onDragOver:M,onDrop:D,children:[(0,F.jsx)("input",d(n({},T()),{className:"sr-only"})),(0,F.jsxs)("div",{className:"flex flex-col items-center",children:[(0,F.jsx)("div",{className:x("flex h-12 w-12 items-center justify-center rounded-full transition-colors",m?"border-primary bg-primary/10":"border-muted-foreground/25"),children:(0,F.jsx)(No,{className:"mb-3 text-zinc-400 dark:text-zinc-500"})}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("p",{className:"text-sm font-medium",children:["Drop files here or"," ",(0,F.jsx)("button",{type:"button",onClick:z,className:"cursor-pointer text-primary underline-offset-4 hover:underline",children:"browse files"})]}),(0,F.jsxs)("p",{className:"text-xs text-muted-foreground",children:[c," \u2022 Max size: ",le(i)," \u2022 Max files: ",r]})]})]})]}),s.length>0&&(0,F.jsx)("div",{className:"space-y-4",children:(0,F.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:s.map(v=>(0,F.jsxs)("div",{className:"relative group",children:[(0,F.jsx)(C,{onClick:()=>h(v.id),variant:"outline",size:"icon",className:"absolute -end-2 -top-2 z-10 size-6 rounded-full opacity-0 transition-opacity group-hover:opacity-100",children:(0,F.jsx)(ve,{className:"size-3"})}),(0,F.jsxs)("div",{className:"relative overflow-hidden rounded-lg border bg-card transition-colors",children:[(0,F.jsx)("div",{className:"relative aspect-square bg-muted border-b border-border",children:(0,F.jsx)("div",{className:"flex h-full items-center justify-center p-4",children:(0,F.jsx)("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:v.status==="uploading"?(0,F.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,F.jsxs)("svg",{className:"size-12 -rotate-90 absolute",viewBox:"0 0 48 48",children:[(0,F.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted-foreground/20"}),(0,F.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${2*Math.PI*20}`,strokeDashoffset:`${2*Math.PI*20*(1-v.progress/100)}`,className:"text-primary transition-all duration-300",strokeLinecap:"round"})]}),v.file instanceof File&&se(v.file,v.preview)]}):v.file instanceof File&&se(v.file,v.preview)})})}),(0,F.jsx)("div",{className:"p-3",children:(0,F.jsxs)("div",{className:"space-y-1",children:[(0,F.jsx)("p",{className:"truncate text-xs font-medium",children:v.file.name}),(0,F.jsxs)("div",{className:"relative flex items-center justify-between gap-2",children:[(0,F.jsx)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight",children:le(v.file.size)}),v.status==="error"&&v.error&&(0,F.jsxs)(Fr,{children:[(0,F.jsx)(Mr,{asChild:!0,children:(0,F.jsx)(C,{onClick:()=>I(v.id),variant:"ghost",size:"icon",className:"absolute end-0 -top-1.25 size-6 text-destructive hover:bg-destructive/10 hover:text-destructive",children:(0,F.jsx)(Qa.RefreshCwIcon,{className:"size-3 opacity-100"})})}),(0,F.jsx)(Dr,{children:"Upload failed. Retry"})]})]})]})})]})]},v.id))})}),b.length>0&&(0,F.jsxs)(xr,{variant:"destructive",appearance:"light",className:"mt-5",children:[(0,F.jsx)(wr,{children:(0,F.jsx)(Qa.TriangleAlert,{})}),(0,F.jsxs)(yr,{children:[(0,F.jsx)(br,{children:"File upload error(s)"}),(0,F.jsx)(Cr,{children:b.map((v,G)=>(0,F.jsx)("p",{className:"last:mb-0",children:v},G))})]})]})]}),(0,F.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,F.jsx)(qe,{asChild:!0,children:(0,F.jsx)(C,{type:"button",radius:"full",variant:"outline",onClick:te,className:"w-full md:w-auto",children:"Cancel"})}),(0,F.jsxs)(C,{type:"button",radius:"full",onClick:Y,disabled:!L,className:"w-full md:w-auto",children:["Upload ",De>0&&`(${De})`]})]})]})})}var Ja=require("react");var ga=require("class-variance-authority");var jr=require("react/jsx-runtime"),Si=(0,ga.cva)(`
|
|
24
|
+
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,16.5,64,17.9,64,19.5z`})]}))}var Q=require("react/jsx-runtime");function Xe(e){return(0,Q.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true"},e),{children:(0,Q.jsxs)("g",{fill:"none",children:[(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"origin",mask:"url(#1752500502786-6297956_folder_mask_2iow0yqdp)"}),(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"clone",filter:"url(#1752500502786-6297956_folder_filter_56qas2ark)",clipPath:"url(#1752500502786-6297956_folder_clipPath_gygn8e14a)"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)","data-glass":"blur"}),(0,Q.jsx)("path",{d:"M18.6807 9.00586C19.7975 9.02423 20.4692 9.09846 20.9864 9.39258C21.5915 9.73676 22.0586 10.2802 22.3067 10.9307C22.5894 11.6719 22.4426 12.6251 22.1495 14.5303L21.626 17.9297C21.4038 19.3742 21.2926 20.097 20.9385 20.6396L20.8155 20.8135C20.5147 21.2098 20.1193 21.5262 19.6641 21.7324C19.074 21.9997 18.3431 22 16.8819 22V21.25C17.624 21.25 18.1389 21.2495 18.543 21.2188C18.9374 21.1887 19.1709 21.133 19.3546 21.0498C19.7447 20.873 20.0766 20.5882 20.3106 20.2295C20.4208 20.0606 20.5119 19.8385 20.6016 19.4531C20.6935 19.0584 20.772 18.5489 20.8848 17.8154L21.4083 14.416C21.5568 13.4504 21.6601 12.7732 21.6954 12.2441C21.7302 11.7223 21.6913 11.4231 21.6055 11.1982C21.4194 10.7103 21.0693 10.3021 20.6153 10.0439C20.4061 9.92506 20.1166 9.84086 19.5958 9.7959C19.0675 9.75031 18.3823 9.75 17.4053 9.75H6.59479C5.61785 9.75 4.93266 9.75032 4.40436 9.7959C3.88353 9.84086 3.59399 9.92504 3.38483 10.0439C2.93088 10.3021 2.5807 10.7103 2.3946 11.1982C2.30885 11.4231 2.26996 11.7223 2.30475 12.2441C2.34005 12.7732 2.44331 13.4504 2.59186 14.416L3.1153 17.8154C3.22814 18.5489 3.30665 19.0584 3.3985 19.4531C3.4882 19.8385 3.5793 20.0606 3.68952 20.2295C3.92357 20.5882 4.25545 20.873 4.64558 21.0498C4.82929 21.133 5.06268 21.1887 5.4571 21.2188C5.86121 21.2495 6.37613 21.25 7.11823 21.25V22L6.14948 21.9961C5.44148 21.9856 4.96108 21.9493 4.56452 21.8213L4.336 21.7324C3.88079 21.5262 3.48544 21.2098 3.18464 20.8135L3.06159 20.6396C2.79608 20.2327 2.66703 19.7244 2.52546 18.8867L2.37409 17.9297L1.85065 14.5303C1.57585 12.744 1.42974 11.7947 1.64558 11.0723L1.6944 10.9307C1.91158 10.3615 2.29578 9.8738 2.79401 9.53027L3.01374 9.39258C3.70332 9.00046 4.66737 9 6.59479 9H17.4053L18.6807 9.00586ZM16.8819 21.25V22H7.11823V21.25H16.8819Z",fill:"url(#1752500502786-6297956_folder_existing_2_vhap9347d)"}),(0,Q.jsxs)("defs",{children:[(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_0_ekojck6b3",x1:"12",y1:"2",x2:"12",y2:"16",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#575757"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#151515"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_1_v5o9796uz",x1:"23",y1:"15.5",x2:"1",y2:"15.5",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#E3E3E5",stopOpacity:".6"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#BBBBC0",stopOpacity:".6"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_2_vhap9347d",x1:"12",y1:"9",x2:"12",y2:"16.528",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#fff"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0"})]}),(0,Q.jsx)("filter",{id:"1752500502786-6297956_folder_filter_56qas2ark",x:"-100%",y:"-100%",width:"400%",height:"400%",filterUnits:"objectBoundingBox",primitiveUnits:"userSpaceOnUse",children:(0,Q.jsx)("feGaussianBlur",{stdDeviation:"2",x:"0%",y:"0%",width:"100%",height:"100%",in:"SourceGraphic",edgeMode:"none",result:"blur"})}),(0,Q.jsx)("clipPath",{id:"1752500502786-6297956_folder_clipPath_gygn8e14a",children:(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)"})}),(0,Q.jsxs)("mask",{id:"1752500502786-6297956_folder_mask_2iow0yqdp",children:[(0,Q.jsx)("rect",{width:"100%",height:"100%",fill:"#FFF"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"#000"})]})]})]})}))}var da=require("react/jsx-runtime");function $a(e){return(0,da.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,da.jsx)("path",{opacity:"0.4",d:"M13.4919 2.29395C13.0743 1.94268 12.5457 1.75 11.9997 1.75C11.5221 1.75 11.058 1.89775 10.6697 2.16992L10.5085 2.29395L1.5974 9.78906C1.18491 10.1364 1.13178 10.7528 1.47924 11.165C1.78946 11.5327 2.31307 11.6121 2.71557 11.3789V15.9531V15.955C2.71555 17.0543 2.71553 17.9612 2.7976 18.6885C2.88313 19.4463 3.06823 20.1292 3.52318 20.7217L3.68627 20.9199C3.85487 21.1119 4.04268 21.2876 4.24584 21.4434L4.47143 21.6016C5.01004 21.9427 5.61706 22.0932 6.281 22.168C7.00121 22.2491 7.89724 22.249 8.98176 22.249H8.99975H14.9997H15.0178C16.1023 22.249 16.9983 22.2491 17.7185 22.168C18.4771 22.0825 19.1606 21.8977 19.7537 21.4434L19.9529 21.2803C20.145 21.1119 20.3205 20.9245 20.4763 20.7217L20.6345 20.4961C20.976 19.9581 21.127 19.3517 21.2019 18.6885C21.284 17.9612 21.2839 17.0543 21.2839 15.955V15.9531V11.3789C21.6864 11.6121 22.21 11.5327 22.5203 11.165C22.846 10.7785 22.8199 10.2127 22.4753 9.85742L13.4919 2.29395Z",fill:"#141B34"}),(0,da.jsx)("path",{d:"M14.9998 17V22.249H8.99979V17C8.99979 15.5859 9.00002 14.8788 9.43924 14.4395C9.87855 14.0001 10.5857 14 11.9998 14C13.4139 14 14.121 14.0002 14.5603 14.4395C14.9997 14.8788 14.9998 15.5858 14.9998 17Z",fill:"#141B34"})]}))}var yo=require("react/jsx-runtime");function Ae(e){return(0,yo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:(0,yo.jsx)("path",{fill:"currentColor",d:"M46.599 46.599a4.498 4.498 0 0 1-6.363 0l-7.941-7.941C29.028 40.749 25.167 42 21 42 9.402 42 0 32.598 0 21S9.402 0 21 0s21 9.402 21 21c0 4.167-1.251 8.028-3.342 11.295l7.941 7.941a4.498 4.498 0 0 1 0 6.363zM21 6C12.717 6 6 12.714 6 21s6.717 15 15 15c8.286 0 15-6.714 15-15S29.286 6 21 6z"})}))}var ca=require("react/jsx-runtime");function pa(e){return(0,ca.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,ca.jsx)("path",{fill:"currentColor",opacity:"0.4",d:"M20.4155 3.66085C22.3012 5.52939 19.2842 20.7253 16.1883 20.9931C13.5911 21.2177 12.7819 16.0954 12.2348 14.4719C11.695 12.8696 11.0943 12.2927 9.50513 11.767C5.46811 10.4315 3.4496 9.76374 3.04996 8.70639C1.99171 5.90649 18.0071 1.27438 20.4155 3.66085Z"}),(0,ca.jsx)("path",{fill:"currentColor",d:"M3.04996 8.70639C3.4496 9.76374 5.46811 10.4315 9.50513 11.767C10.3308 12.0402 10.8897 12.3271 11.3118 12.7646L20.4155 3.66085C18.0071 1.27438 1.99171 5.90649 3.04996 8.70639Z"})]}))}var Pr=require("react/jsx-runtime");var ma=require("react/jsx-runtime");function kt(e){return(0,ma.jsxs)("svg",d(n({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,ma.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.75 11.7499C18.3023 11.7499 18.75 12.1977 18.75 12.7499V15.7499H21.75C22.3023 15.7499 22.75 16.1977 22.75 16.7499C22.75 17.3022 22.3023 17.7499 21.75 17.7499H18.75V20.7499C18.75 21.3022 18.3023 21.7499 17.75 21.7499C17.1977 21.7499 16.75 21.3022 16.75 20.7499V17.7499H13.75C13.1977 17.7499 12.75 17.3022 12.75 16.7499C12.75 16.1977 13.1977 15.7499 13.75 15.7499H16.75V12.7499C16.75 12.1977 17.1977 11.7499 17.75 11.7499Z",fill:"currentColor"}),(0,ma.jsx)("path",{opacity:"0.4",d:"M9.4626 2.48876C8.82373 2.24919 8.11205 2.24951 7.08264 2.24996C6.2039 2.24995 5.32205 2.24999 4.7497 2.30044C4.15996 2.35243 3.64388 2.46238 3.17258 2.7254C2.56533 3.06428 2.06428 3.56534 1.7254 4.17258C1.46238 4.64388 1.35242 5.15996 1.30044 5.7497C1.24999 6.32205 1.24999 7.03077 1.25 7.9095V11.0574C1.24999 13.3658 1.24998 15.1748 1.43975 16.5863C1.63399 18.031 2.03933 19.1711 2.93414 20.0659C3.82895 20.9607 4.96897 21.366 6.41371 21.5603C7.82519 21.75 9.63423 21.75 11.9426 21.75H13.2923C14.1084 21.75 14.8409 21.75 15.5 21.7383V18.9999H13.75C12.5074 18.9999 11.5 17.9926 11.5 16.7499C11.5 15.5073 12.5074 14.4999 13.75 14.4999H15.5V12.7499C15.5 11.5073 16.5074 10.4999 17.75 10.4999C18.9926 10.4999 20 11.5073 20 12.7499V14.4999H22.7383C22.75 13.8408 22.75 13.1084 22.75 12.2923C22.75 11.2733 22.75 10.3688 22.683 9.70949C22.6137 9.02893 22.4669 8.43872 22.118 7.91661C21.8444 7.50715 21.4929 7.15559 21.0834 6.88199C20.5613 6.53313 19.9711 6.38628 19.2905 6.31705C18.6312 6.24998 17.8095 6.24999 16.7905 6.25L13.2361 6.25C12.92 6.25 12.7396 6.24908 12.6064 6.23531C12.5044 6.22817 12.4348 6.15255 12.4128 6.11563C12.3409 6.0027 12.0838 5.48909 11.9425 5.20636C11.4704 4.25121 10.8581 3.01205 9.4626 2.48876Z",fill:"currentColor"})]}))}var Fo=require("react/jsx-runtime");function St(e){return(0,Fo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true"},e),{children:(0,Fo.jsx)("path",{fill:"currentColor",d:"M19,11H13V5a1,1,0,0,0-2,0v6H5a1,1,0,0,0,0,2h6v6a1,1,0,0,0,2,0V13h6a1,1,0,0,0,0-2Z"})}))}var Jt=require("react/jsx-runtime");function Ze(e){return(0,Jt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:[(0,Jt.jsx)("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),(0,Jt.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),(0,Jt.jsx)("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:"0.5"})]}))}var Mo=require("react/jsx-runtime");function ve(e){return(0,Mo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:(0,Mo.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"})}))}var zt=require("react/jsx-runtime");function Wa(e){return(0,zt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,zt.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,zt.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,zt.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,zt.jsx)("path",{d:"M12 4l0 12"})]}))}var Tt=require("react/jsx-runtime");function Ka(e){return(0,Tt.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,Tt.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Tt.jsx)("path",{d:"M9 15l6 -6"}),(0,Tt.jsx)("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),(0,Tt.jsx)("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]}))}var Do=require("react/jsx-runtime");function Ya(e){return(0,Do.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:(0,Do.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.944 1.25H10a.75.75 0 0 1 0 1.5c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S3.025 4.705 2.89 5.71c-.138 1.029-.14 2.383-.14 4.29a.75.75 0 0 1-1.5 0v-.056c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153m8.345 1.64c-1.027-.138-2.382-.14-4.289-.14a.75.75 0 0 1 0-1.5h.056c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433V10a.75.75 0 0 1-1.5 0c0-1.907-.002-3.261-.14-4.29c-.135-1.005-.389-1.585-.812-2.008s-1.003-.677-2.009-.812M2 13.25a.75.75 0 0 1 .75.75c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14a.75.75 0 0 1 0 1.5h-.056c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V14a.75.75 0 0 1 .75-.75m20 0a.75.75 0 0 1 .75.75v.056c0 1.838 0 3.294-.153 4.433c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H14a.75.75 0 0 1 0-1.5c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812s.677-1.003.812-2.009c.138-1.027.14-2.382.14-4.289a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})}))}var xe=require("react/jsx-runtime");function je(e,t){if(typeof e!="string")return console.warn("getFileTypeFromMime: mimeType is not a string:",e),X.FILE;let a=e;if(t){let o=t.toLowerCase().replace(/^\./,""),r=No.default.getType(o);r&&(a=r)}return a.startsWith("image/")?X.IMAGE:a.startsWith("video/")?X.VIDEO:a.startsWith("audio/")?X.AUDIO:X.FILE}function qa(e,t){let a=e;if(t){let o=t.toLowerCase().replace(/^\./,""),r=No.default.getType(o);r&&(a=r)}if(a.startsWith("image/"))return"image";if(a.startsWith("video/"))return"video";if(a.startsWith("audio/"))return"audio";switch(a){case"application/pdf":return"pdf";case"application/json":return"json";case"application/zip":case"application/x-zip-compressed":return"zip";case"application/x-rar-compressed":case"application/vnd.rar":return"rar";case"application/x-msdownload":case"application/x-executable":return"exe";case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":case"application/vnd.ms-excel":case"text/csv":return"excel";case"application/vnd.openxmlformats-officedocument.presentationml.presentation":case"application/vnd.ms-powerpoint":return"powerpoint";case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":case"application/msword":return"document"}if(a.startsWith("text/"))return"txt";if(t)switch(t.toLowerCase().replace(/^\./,"")){case"exe":case"msi":return"exe";case"zip":return"zip";case"rar":return"rar";case"pdf":return"pdf";case"csv":return"excel"}return"file"}var st=o=>{var r=o,{type:e,className:t}=r,a=g(r,["type","className"]);switch(e){case"folder-with-files":return(0,xe.jsx)(Za,n({className:t},a));case"folder":return(0,xe.jsx)(ja,n({className:t},a));case"image":return(0,xe.jsx)(qt,n({className:t},a));case"video":return(0,xe.jsx)(Ua,n({className:t},a));case"audio":return(0,xe.jsx)(Ga,n({className:t},a));case"pdf":return(0,xe.jsx)(Ta,n({className:t},a));case"excel":case"xlsx":return(0,xe.jsx)(Ra,n({className:t},a));case"powerpoint":case"pptx":return(0,xe.jsx)(Ea,n({className:t},a));case"document":case"docx":case"doc":return(0,xe.jsx)(Aa,n({className:t},a));case"txt":return(0,xe.jsx)(_a,n({className:t},a));case"json":return(0,xe.jsx)(Oa,n({className:t},a));case"zip":return(0,xe.jsx)(Va,n({className:t},a));case"rar":return(0,xe.jsx)(Ba,n({className:t},a));case"exe":return(0,xe.jsx)(Ha,n({className:t},a));default:return(0,xe.jsx)(La,n({className:t},a))}};function kr(e){if(!e||e.length===0)return"*/*";let t=[];for(let a of e)switch(a){case X.IMAGE:t.push("image/*");break;case X.VIDEO:t.push("video/*");break;case X.AUDIO:t.push("audio/*");break;case X.FILE:t.push("application/*","text/*");break}return t.join(",")}function Sr(e){if(!e||e.length===0)return"All files";let t=[];for(let a of e)switch(a){case X.IMAGE:t.push("Images");break;case X.VIDEO:t.push("Videos");break;case X.AUDIO:t.push("Audio");break;case X.FILE:t.push("Files");break}return t.join(", ")}var ua=require("react/jsx-runtime");function Io(e){return(0,ua.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",color:"currentColor"},e),{children:[(0,ua.jsx)("path",{d:"M13.0059 21.25C13.0059 21.8023 12.5581 22.25 12.0059 22.25C11.4536 22.25 11.0059 21.8023 11.0059 21.25L11.0059 16.75L10.4116 16.75C10.236 16.7501 10.0203 16.7503 9.84387 16.7282L9.84053 16.7278C9.71408 16.712 9.13804 16.6402 8.86368 16.0746C8.58872 15.5078 8.89065 15.0076 8.95597 14.8994L8.95841 14.8954C9.05062 14.7424 9.18477 14.5715 9.29511 14.4309L9.31885 14.4007C9.61348 14.0249 9.99545 13.5406 10.3759 13.1496C10.5657 12.9545 10.783 12.7533 11.0139 12.5944C11.2191 12.4532 11.5693 12.25 12 12.25C12.4307 12.25 12.7809 12.4532 12.9861 12.5944C13.217 12.7533 13.4343 12.9545 13.6241 13.1496C14.0046 13.5406 14.3865 14.0249 14.6812 14.4007L14.7049 14.4309C14.8152 14.5715 14.9494 14.7424 15.0416 14.8954L15.044 14.8994C15.1093 15.0076 15.4113 15.5078 15.1363 16.0746C14.862 16.6402 14.2859 16.712 14.1595 16.7278L14.1561 16.7282C13.9797 16.7503 13.764 16.7501 13.5884 16.75L13.0059 16.75L13.0059 21.25Z",fill:"currentColor",fillRule:"evenodd"}),(0,ua.jsx)("path",{d:"M1.25 12.5C1.25 9.85827 3.03106 7.63322 5.45825 6.9592C5.65424 6.90478 5.75224 6.87756 5.80872 6.81971C5.8652 6.76186 5.88991 6.66386 5.93931 6.46785C6.62272 3.75655 9.07671 1.75002 12 1.75002C15.2149 1.75002 17.8628 4.17733 18.2112 7.29925C18.2385 7.54461 18.2522 7.66731 18.3147 7.7383C18.3772 7.80929 18.4989 7.83881 18.7423 7.89787C21.0422 8.4559 22.75 10.5285 22.75 13C22.75 15.8995 20.3995 18.25 17.5 18.25H16.4006C15.942 18.25 15.7126 18.25 15.6826 18.2119C15.6679 18.1933 15.6641 18.1839 15.6617 18.1604C15.6567 18.1121 15.8519 17.9223 16.2425 17.5427C17.2326 16.5804 17.255 14.9976 16.2927 14.0075C15.6442 13.1982 15.0315 12.3422 14.2379 11.6663C13.6086 11.1303 12.8426 10.75 12 10.75C11.1574 10.75 10.3914 11.1303 9.76209 11.6663C8.96846 12.3422 8.35575 13.1982 7.7073 14.0075C6.74496 14.9976 6.76745 16.5804 7.75753 17.5427C8.14807 17.9223 8.34334 18.1121 8.33832 18.1604C8.33587 18.1839 8.33206 18.1933 8.31739 18.2119C8.28737 18.25 8.05801 18.25 7.59942 18.25H7C3.82436 18.25 1.25 15.6757 1.25 12.5Z",fill:"currentColor"})]}))}var zr=require("react"),fa=require("react/jsx-runtime");function Tr({file:e}){var r;let[t,a]=(0,zr.useState)(!1),o=e.previewUrl||e.url;return o&&!t?(0,fa.jsx)("img",{src:o,alt:((r=e==null?void 0:e.name)==null?void 0:r.substring(0,10))||"image",className:"w-full h-full object-contain rounded-md drop-shadow-md",onError:()=>a(!0)}):(0,fa.jsx)(qt,{})}function Rr({file:e}){return e.caption?(0,fa.jsxs)("p",{className:"text-xs text-blue-600 line-clamp-2 mb-2",children:[e.height," x ",e.width]}):null}var Po=require("lucide-react"),Er=require("react"),ce=require("react/jsx-runtime");function Ar({file:e,className:t}){let[a,o]=(0,Er.useState)(!1);return e.previewUrl&&!a?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("img",{src:e.previewUrl,className:"w-full h-full object-contain rounded-md",alt:e.name,onError:()=>o(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(Po.Play,{className:"size-5 text-white fill-white"})})})]}):e.url&&!a?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("video",{src:e.url,className:"w-full h-full object-contain rounded-md",preload:"metadata",onError:()=>o(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(Po.Play,{className:"size-5 text-white fill-white"})})})]}):(0,ce.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,ce.jsx)("div",{className:"text-center",children:(0,ce.jsx)("div",{className:"text-4xl",children:(0,ce.jsx)(st,{type:"video",className:t})})})})}function _r({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,ce.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var Rt=require("react/jsx-runtime");function Lr({file:e,className:t}){return(0,Rt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,Rt.jsx)("div",{className:"text-center",children:(0,Rt.jsx)("div",{className:"text-4xl",children:(0,Rt.jsx)(st,{type:"audio",className:t})})})})}function Vr({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,Rt.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var dt=require("react/jsx-runtime");function Or({file:e,className:t}){let a=qa(e.mime,e.ext);return(0,dt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent relative",children:e.previewUrl?(0,dt.jsx)("img",{src:e.previewUrl,alt:e.name,className:"w-full h-full object-contain rounded-md drop-shadow-md"}):(0,dt.jsx)("div",{className:"text-center",children:(0,dt.jsx)("div",{className:"text-4xl",children:(0,dt.jsx)(st,{type:a,className:t})})})})}function Gr({file:e}){var t;return(t=e.metaData)!=null&&t.pageCount?(0,dt.jsxs)("p",{className:"text-xs text-blue-600 mb-2",children:["Pages: ",e.metaData.pageCount]}):null}var Hr=require("react/jsx-runtime");function Br({file:e}){let t=qa(e.mime,e.ext);return(0,Hr.jsx)(st,{type:t})}var Ur={images:{component:Tr,metadataComponent:Rr},videos:{component:Ar,metadataComponent:_r},files:{component:Or,metadataComponent:Gr},audios:{component:Lr,metadataComponent:Vr},default:{component:Br}};function ct(e){let t=je(e.mime,e.ext);return Ur[t]||Ur.default}var ko=require("react/jsx-runtime");function Xt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,ko.jsx)("kbd",n({"data-slot":"kbd",className:x("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e)},t))}function ea(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,ko.jsx)("kbd",n({"data-slot":"kbd-group",className:x("inline-flex items-center gap-1",e)},t))}var F=require("react/jsx-runtime");function jr(){let{isUploadModalOpen:e,setIsUploadModalOpen:t,uploadFiles:a,allowedFileTypes:o,maxUploadFiles:r,maxUploadSize:i}=O(),l=kr(o),c=Sr(o),[s,f]=(0,Zr.useState)([]),[{isDragging:m,errors:b},{removeFile:p,clearFiles:y,handleDragEnter:w,handleDragLeave:N,handleDragOver:M,handleDrop:D,openFileDialog:z,getInputProps:T}]=Ir({maxFiles:r,maxSize:i,accept:l,multiple:!0,onFilesChange:v=>{let G=v.map(B=>{let $=s.find(Ce=>Ce.id===B.id);return $?n(n({},$),B):d(n({},B),{progress:100,status:"completed"})});f(G)}}),h=v=>{p(v)},I=v=>{f(G=>G.map(B=>B.id===v?d(n({},B),{progress:0,status:"uploading",error:void 0}):B))},Y=()=>{let v=s.filter(G=>G.status==="completed");if(v.length>0){let G=v.map(B=>({name:B.file.name,size:B.file.size,type:je(B.file.type,B.file.name.split(".").pop()),lastModified:B.file instanceof File?B.file.lastModified:Date.now(),file:B.file,metadata:{}}));a(G),te()}},te=()=>{t(!1),y(),f([])},se=(v,G)=>{let B={id:"temp",name:v.name,size:v.size,mime:v.type,ext:v.name.split(".").pop()||"",url:G||"",createdAt:new Date(v.lastModified),updatedAt:new Date(v.lastModified),folderId:null,metaData:{}},{component:$}=ct(B);return(0,F.jsx)($,{file:B,metaData:B.metaData})},De=s.filter(v=>v.status==="completed").length,u=s.filter(v=>v.status==="uploading").length,L=De>0&&u===0;return(0,F.jsx)(ze,{open:e,onOpenChange:t,children:(0,F.jsxs)(Te,{className:"p-0 max-w-4xl max-h-[80vh] flex flex-col",variant:"default",showCloseButton:!1,children:[(0,F.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,F.jsx)(Re,{className:"px-6 text-base",children:(0,F.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,F.jsxs)("span",{children:["Upload Files",(0,F.jsx)(ea,{className:"ml-2",children:(0,F.jsxs)(Xt,{children:[(0,F.jsx)("span",{className:"text-lg",children:"\u2318"})," + U"]})})]}),(0,F.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>t(!1),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,F.jsx)(ve,{className:"size-5"}),(0,F.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,F.jsx)(lt,{})]}),(0,F.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[(0,F.jsxs)("div",{className:x("relative rounded-lg border-dashed border-[2.5px] bg-gray-100 border-gray-300 px-6 py-16 text-center transition-colors mb-4",m?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"),onDragEnter:w,onDragLeave:N,onDragOver:M,onDrop:D,children:[(0,F.jsx)("input",d(n({},T()),{className:"sr-only"})),(0,F.jsxs)("div",{className:"flex flex-col items-center",children:[(0,F.jsx)("div",{className:x("flex h-12 w-12 items-center justify-center rounded-full transition-colors",m?"border-primary bg-primary/10":"border-muted-foreground/25"),children:(0,F.jsx)(Io,{className:"mb-3 text-zinc-400 dark:text-zinc-500"})}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("p",{className:"text-sm font-medium",children:["Drop files here or"," ",(0,F.jsx)("button",{type:"button",onClick:z,className:"cursor-pointer text-primary underline-offset-4 hover:underline",children:"browse files"})]}),(0,F.jsxs)("p",{className:"text-xs text-muted-foreground",children:[c," \u2022 Max size: ",le(i)," \u2022 Max files: ",r]})]})]})]}),s.length>0&&(0,F.jsx)("div",{className:"space-y-4",children:(0,F.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:s.map(v=>(0,F.jsxs)("div",{className:"relative group",children:[(0,F.jsx)(C,{onClick:()=>h(v.id),variant:"outline",size:"icon",className:"absolute -end-2 -top-2 z-10 size-6 rounded-full opacity-0 transition-opacity group-hover:opacity-100",children:(0,F.jsx)(ve,{className:"size-3"})}),(0,F.jsxs)("div",{className:"relative overflow-hidden rounded-lg border bg-card transition-colors",children:[(0,F.jsx)("div",{className:"relative aspect-square bg-muted border-b border-border",children:(0,F.jsx)("div",{className:"flex h-full items-center justify-center p-4",children:(0,F.jsx)("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:v.status==="uploading"?(0,F.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,F.jsxs)("svg",{className:"size-12 -rotate-90 absolute",viewBox:"0 0 48 48",children:[(0,F.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted-foreground/20"}),(0,F.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${2*Math.PI*20}`,strokeDashoffset:`${2*Math.PI*20*(1-v.progress/100)}`,className:"text-primary transition-all duration-300",strokeLinecap:"round"})]}),v.file instanceof File&&se(v.file,v.preview)]}):v.file instanceof File&&se(v.file,v.preview)})})}),(0,F.jsx)("div",{className:"p-3",children:(0,F.jsxs)("div",{className:"space-y-1",children:[(0,F.jsx)("p",{className:"truncate text-xs font-medium",children:v.file.name}),(0,F.jsxs)("div",{className:"relative flex items-center justify-between gap-2",children:[(0,F.jsx)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight",children:le(v.file.size)}),v.status==="error"&&v.error&&(0,F.jsxs)(Mr,{children:[(0,F.jsx)(Dr,{asChild:!0,children:(0,F.jsx)(C,{onClick:()=>I(v.id),variant:"ghost",size:"icon",className:"absolute end-0 -top-1.25 size-6 text-destructive hover:bg-destructive/10 hover:text-destructive",children:(0,F.jsx)(Qa.RefreshCwIcon,{className:"size-3 opacity-100"})})}),(0,F.jsx)(Nr,{children:"Upload failed. Retry"})]})]})]})})]})]},v.id))})}),b.length>0&&(0,F.jsxs)(br,{variant:"destructive",appearance:"light",className:"mt-5",children:[(0,F.jsx)(Cr,{children:(0,F.jsx)(Qa.TriangleAlert,{})}),(0,F.jsxs)(Fr,{children:[(0,F.jsx)(wr,{children:"File upload error(s)"}),(0,F.jsx)(yr,{children:b.map((v,G)=>(0,F.jsx)("p",{className:"last:mb-0",children:v},G))})]})]})]}),(0,F.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,F.jsx)(qe,{asChild:!0,children:(0,F.jsx)(C,{type:"button",radius:"full",variant:"outline",onClick:te,className:"w-full md:w-auto",children:"Cancel"})}),(0,F.jsxs)(C,{type:"button",radius:"full",onClick:Y,disabled:!L,className:"w-full md:w-auto",children:["Upload ",De>0&&`(${De})`]})]})]})})}var Ja=require("react");var ga=require("class-variance-authority");var $r=require("react/jsx-runtime"),Si=(0,ga.cva)(`
|
|
25
25
|
flex w-full bg-background border border-input shadow-xs shadow-black/5 transition-[color,box-shadow] text-foreground placeholder:text-muted-foreground/80
|
|
26
26
|
focus-visible:ring-ring/30 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px]
|
|
27
27
|
disabled:cursor-not-allowed disabled:opacity-60
|
|
@@ -81,35 +81,35 @@
|
|
|
81
81
|
has-[[aria-invalid=true]]:ring-destructive/10
|
|
82
82
|
dark:has-[[aria-invalid=true]]:border-destructive
|
|
83
83
|
dark:has-[[aria-invalid=true]]:ring-destructive/20
|
|
84
|
-
`,{variants:{variant:{sm:"gap-1.25 [&_svg:not([class*=size-])]:size-3.5",md:"gap-1.5 [&_svg:not([class*=size-])]:size-4",lg:"gap-1.5 [&_svg:not([class*=size-])]:size-4"}},defaultVariants:{variant:"md"}});function ta(r){var i=r,{className:e,type:t,variant:a}=i,o=g(i,["className","type","variant"]);return(0,jr.jsx)("input",n({"data-slot":"input",type:t,className:x(Si({variant:a}),e)},o))}var ae=require("react/jsx-runtime");function $r(){let{isCreateFolderModalOpen:e,setIsCreateFolderModalOpen:t,isRenameFolderModalOpen:a,setIsRenameFolderModalOpen:o,createFolder:r,renameFolder:i,folderToRename:l,setFolderToRename:c}=O(),[s,f]=(0,Ja.useState)(""),m=a,b=e||a;(0,Ja.useEffect)(()=>{a&&l?f(l.name):e||f("")},[a,e,l]);let p=async()=>{if(s.trim()!==""){if(m&&l){let w=l.id;w!==null&&await i(w,s.trim()),o(!1),c(null)}else r(s.trim()),t(!1);f("")}},y=()=>{m?(o(!1),c(null)):t(!1),f("")};return b?(0,ae.jsx)(ze,{open:b,onOpenChange:y,children:(0,ae.jsxs)(Te,{className:"p-0 max-w-xl m-auto min-h-fit max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,ae.jsx)(Be,{className:"pt-5 pb-3 m-0 border-b border-border flex w-full justify-between",children:(0,ae.jsx)(Re,{className:"px-6 text-base",children:(0,ae.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,ae.jsxs)("span",{children:[m?"Rename Folder":"Create New Folder",!m&&(0,ae.jsx)("span",{className:"ml-4",children:(0,ae.jsx)(ea,{children:(0,ae.jsxs)(Xt,{children:[(0,ae.jsx)("span",{className:"text-lg",children:"\u2318"})," + F"]})})})]}),(0,ae.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:y,className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,ae.jsx)(ve,{className:"size-5"}),(0,ae.jsx)("span",{className:"hidden",children:"Close"})]})]})})}),(0,ae.jsxs)("div",{className:"p-6",children:[(0,ae.jsx)("label",{htmlFor:"folder-name",className:"hidden mb-2",children:"Folder Name:"}),(0,ae.jsx)(ta,{id:"folder-name",name:"folder-name",value:s,onChange:w=>f(w.target.value),placeholder:"Enter folder name",autoFocus:!0,onKeyDown:w=>{w.key==="Enter"&&s.trim()!==""&&p()}})]}),(0,ae.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,ae.jsx)(qe,{asChild:!0,children:(0,ae.jsx)(C,{type:"button",variant:"outline",onClick:y,radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,ae.jsx)(C,{type:"button",disabled:s.trim()==="",onClick:p,radius:"full",className:"w-full md:w-auto",children:m?"Rename":"Create"})]})]})}):null}var pt=require("react");var ha=require("lucide-react");function $e(e,t=30){if(e.length<=t)return e;let a=e.slice(0,Math.ceil(t/2)),o=e.slice(-Math.floor(t/2));return`${a}...${o}`}var Et=require("react");function ko({threshold:e=0,root:t=null,rootMargin:a="0%"}={}){let[o,r]=(0,Et.useState)(),[i,l]=(0,Et.useState)(null),c=(0,Et.useRef)(null);return(0,Et.useEffect)(()=>(c.current&&c.current.disconnect(),i&&typeof window!="undefined"&&"IntersectionObserver"in window&&(c.current=new IntersectionObserver(([s])=>{r(s)},{threshold:e,root:t,rootMargin:a}),c.current.observe(i)),()=>{c.current&&c.current.disconnect()}),[i,e,t,a]),{ref:l,entry:o}}var P=require("react/jsx-runtime");function Wr({folder:e,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r=[],treeState:i}){var h;let[l,c]=(0,pt.useState)(!1),s=((h=e.folderCount)!=null?h:0)>0,f=t===e.id,m=r.includes(e.id),b=i.loading.has(e.id),p=i.loaded.has(e.id),y=i.folders.get(e.id)||[],w=i.pagination.get(e.id),{ref:N,entry:M}=ko({threshold:.1,rootMargin:"100px"}),D=w&&w.currentPage<w.totalPages;return(0,pt.useEffect)(()=>{if(l&&(M!=null&&M.isIntersecting)&&D&&!b){let I=((w==null?void 0:w.currentPage)||1)+1;o(e.id,I)}},[M==null?void 0:M.isIntersecting,D,b,l,w,e.id,o]),(0,P.jsxs)("li",{children:[(0,P.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[s?(0,P.jsx)("button",{onClick:async()=>{if(!s)return;let I=!l;c(I),I&&!p&&!b&&await o(e.id,1)},className:"p-1 -m-1 hover:bg-gray-100 rounded transition-colors","aria-label":l?"Collapse folder":"Expand folder",children:(0,P.jsx)(ha.ChevronRight,{className:`size-4 text-gray-500 transition-transform ${!m&&l?"rotate-90":""}`})}):(0,P.jsx)("div",{className:"w-4"}),(0,P.jsxs)("button",{onClick:()=>{m||a(e.id)},disabled:m,title:e.name,className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${f?"bg-blue-100 text-blue-600 font-semibold":m?"opacity-50 cursor-not-allowed":"hover:bg-gray-100"}`,children:[(0,P.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,P.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,P.jsx)("span",{className:"truncate min-w-0",children:$e(e.name,15)}),m?(0,P.jsx)("span",{className:"text-[0.6rem] text-left font-medium text-gray-900",children:"(Already selected)"}):""]})]})]}),!m&&l&&(0,P.jsxs)("ul",{className:"pl-6",children:[y.map(I=>(0,P.jsx)(Wr,{folder:I,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r,treeState:i},I.id)),(b||D)&&(0,P.jsx)("li",{ref:N,className:"py-2 pl-6 flex justify-start",children:(0,P.jsx)(ha.Loader2,{className:"h-4 w-4 animate-spin text-blue-500"})}),b&&y.length===0&&(0,P.jsx)("li",{className:"py-1",children:(0,P.jsx)("div",{className:"flex items-center gap-1.5 px-2",children:(0,P.jsx)("span",{className:"text-sm text-gray-500",children:"Loading..."})})})]})]})}function Kr(){let{isMoveFileModalOpen:e,setIsMoveFileModalOpen:t,selectedFiles:a,selectedFolders:o,bulkMove:r,provider:i}=O(),[l,c]=(0,pt.useState)(void 0),[s,f]=(0,pt.useState)({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}),{ref:m,entry:b}=ko({threshold:.1,rootMargin:"100px"}),p=s.pagination.get(null),y=p&&p.currentPage<p.totalPages,w=s.loading.has(null),N=o.map(h=>h.id),M=s.folders.get(null)||[];(0,pt.useEffect)(()=>{e&&!s.loaded.has(null)&&!s.loading.has(null)&&D(null,1)},[e]),(0,pt.useEffect)(()=>{if(e&&(b!=null&&b.isIntersecting)&&y&&!w){let h=((p==null?void 0:p.currentPage)||1)+1;D(null,h)}},[b==null?void 0:b.isIntersecting,y,w,p,e]);let D=async(h,I=1)=>{if(!s.loading.has(h)){f(Y=>d(n({},Y),{loading:new Set(Y.loading).add(h)}));try{let Y=await i.getFolders(h,I,20);f(te=>{let se=new Set(te.loading);se.delete(h);let De=new Set(te.loaded);De.add(h);let u=new Map(te.folders),L=u.get(h)||[];I>1?u.set(h,[...L,...Y.folders]):u.set(h,Y.folders);let v=new Map(te.pagination);return v.set(h,Y.pagination),{folders:u,loading:se,loaded:De,pagination:v}})}catch(Y){console.error(`Failed to load folders for ${h}:`,Y),f(te=>{let se=new Set(te.loading);return se.delete(h),d(n({},te),{loading:se})})}}},z=()=>{l!==void 0&&(r(l),t(!1),c(void 0),f({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))},T=h=>{t(h),h?D(null,1):(c(void 0),f({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))};return e?(0,P.jsx)(ze,{open:e,onOpenChange:T,children:(0,P.jsxs)(Te,{className:"p-0 max-w-3xl max-h-full m-auto md:max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,P.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,P.jsx)(Re,{className:"px-6 text-base",children:(0,P.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,P.jsxs)("span",{className:"w-full text-left",children:["Move Items",(0,P.jsxs)("p",{className:"text-gray-400 text-xs",children:["Moving ",a.length," file",a.length===1?"":"s"," and"," ",o.length," folder",o.length===1?"":"s","."]})]}),(0,P.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>T(!1),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,P.jsx)(ve,{className:"size-5"}),(0,P.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,P.jsx)(lt,{})]}),(0,P.jsx)("div",{className:"text-sm my-3 px-6 flex-1 flex flex-col min-h-0",children:(0,P.jsx)("div",{className:"space-y-4 flex flex-col flex-1 min-h-0",children:(0,P.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,P.jsx)("label",{className:"block mb-2 font-medium text-gray-900",children:"Select destination folder:"}),(0,P.jsxs)("ul",{className:"border rounded-xl p-2 shadow-inner overflow-y-auto flex-1 min-h-0",children:[(0,P.jsx)("li",{children:(0,P.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[(0,P.jsx)("div",{className:"w-4"}),(0,P.jsxs)("button",{onClick:()=>c(null),className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${l===null?"bg-blue-100 text-blue-600 font-semibold":"hover:bg-gray-100"}`,children:[(0,P.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,P.jsx)("div",{className:"flex flex-col gap-1",children:(0,P.jsx)("span",{className:"truncate min-w-0",children:"Root Directory"})})]})]})}),M.map(h=>(0,P.jsx)(Wr,{folder:h,selectedFolderId:l,onSelect:I=>c(I),onLoadChildren:D,disabledFolderIds:N,treeState:s},h.id)),(w||y)&&(0,P.jsx)("li",{ref:m,className:"py-2 pl-6 flex justify-start",children:(0,P.jsx)(ha.Loader2,{className:"h-5 w-5 animate-spin text-blue-500"})}),M.length===0&&!w&&!y&&(0,P.jsx)("li",{className:"text-gray-500 text-sm text-center py-4",children:"No nested folders available"})]})]})})}),(0,P.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,P.jsx)(qe,{asChild:!0,children:(0,P.jsx)(C,{type:"button",variant:"outline",radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,P.jsx)(C,{type:"button",onClick:z,disabled:l===void 0,radius:"full",className:"w-full md:w-auto",children:"Move"})]})]})}):null}var ba=require("react"),on=require("lucide-react");var aa=require("radix-ui");var mt=require("react/jsx-runtime");function Yr(i){var l=i,{className:e,viewportClassName:t,children:a,viewportRef:o}=l,r=g(l,["className","viewportClassName","children","viewportRef"]);return(0,mt.jsxs)(aa.ScrollArea.Root,d(n({"data-slot":"scroll-area",className:x("relative overflow-hidden",e)},r),{children:[(0,mt.jsx)(aa.ScrollArea.Viewport,{ref:o,className:x("h-full w-full rounded-[inherit]",t),children:a}),(0,mt.jsx)(zi,{}),(0,mt.jsx)(aa.ScrollArea.Corner,{})]}))}function zi(o){var r=o,{className:e,orientation:t="vertical"}=r,a=g(r,["className","orientation"]);return(0,mt.jsx)(aa.ScrollArea.ScrollAreaScrollbar,d(n({"data-slot":"scroll-area-scrollbar",orientation:t,className:x("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-[1px]",e)},a),{children:(0,mt.jsx)(aa.ScrollArea.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}))}var pe=require("react/jsx-runtime");function ut({title:e,open:t,onClose:a,previewSection:o,metadataSection:r,footer:i}){return(0,pe.jsx)(ze,{open:t,onOpenChange:l=>!l&&a(),children:(0,pe.jsxs)(Te,{className:"p-0 max-w-6xl m-auto xl:min-h-fit max-h-[85vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,pe.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,pe.jsx)(Re,{className:"px-6 text-base",children:(0,pe.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,pe.jsx)("span",{children:e}),(0,pe.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>a(),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,pe.jsx)(ve,{className:"size-5"}),(0,pe.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,pe.jsx)(lt,{})]}),(0,pe.jsx)(Yr,{className:"flex-1 min-h-0",children:(0,pe.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 min-h-full max-h-[65vh] overflow-scroll",children:[(0,pe.jsx)("div",{className:"p-6 border-b lg:border-b-0 lg:border-r",children:o}),(0,pe.jsx)("div",{className:"p-6",children:r})]})}),(0,pe.jsx)(He,{className:"px-6 py-4 border-t border-border",children:i})]})})}var zo=require("lucide-react");var At=require("sonner");var Xa=require("react");var va=require("react/jsx-runtime");function So(e){return(0,va.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,va.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,va.jsx)("path",{d:"M5 12l5 5l10 -10"})]}))}var _e=require("react/jsx-runtime");function ft({file:e}){let{provider:t,setFileDetailsModalFile:a,refreshData:o}=O(),[r,i]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",title:"Delete",className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50 active:scale-95 transition-transform",onClick:async()=>{i(!0);try{await t.deleteFiles([e.id]),await o(),a(null),At.toast.success("File Deleted",{description:`${$e(e.name,20)} has been deleted`})}catch(c){At.toast.error("Delete failed"),i(!1)}},disabled:r,children:r?(0,_e.jsx)(zo.Loader2,{className:"size-5 animate-spin"}):(0,_e.jsx)(Ze,{className:"size-5"})})}function gt({file:e}){let[t,a]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{a(!0);try{let r=document.createElement("a");r.href=e.url,r.download=e.name,r.click(),At.toast.success("Download Started",{description:`Downloading ${$e(e.name,20)}`})}catch(r){At.toast.error("Download failed")}finally{a(!1)}},className:"border-gray-200 bg-white hover:text-blue-600 hover:border-blue-200 hover:bg-blue-50 active:scale-95 transition-transform",title:"Download",disabled:t,children:t?(0,_e.jsx)(zo.Loader2,{className:"size-5 animate-spin"}):(0,_e.jsx)(Wa,{className:"size-5",strokeWidth:2.5})})}function ht({file:e}){let[t,a]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{try{await navigator.clipboard.writeText(e.url),a(!0),At.toast.success("Link Copied",{description:"File URL copied to clipboard"}),setTimeout(()=>a(!1),2e3)}catch(r){At.toast.error("Failed to copy link")}},className:`border-gray-200 bg-white active:scale-95 transition-all ${t?"text-green-700 border-green-400 bg-green-100 font-bold":"hover:text-orange-600 hover:border-orange-200 hover:bg-orange-50"}`,title:"Copy Link",disabled:t,children:t?(0,_e.jsx)(So,{className:"size-5 animate-in zoom-in duration-200",strokeWidth:3}):(0,_e.jsx)(Ka,{className:"size-5",strokeWidth:2.5})})}function qr({file:e,onFullscreen:t}){return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:t,className:"border-gray-200 bg-white hover:text-purple-600 hover:border-purple-200 hover:bg-purple-50 active:scale-95 transition-transform",title:"Fullscreen",children:(0,_e.jsx)(Ya,{className:"size-5",strokeWidth:1})})}var Qr=require("class-variance-authority");var Jr=require("react/jsx-runtime"),Ti=(0,Qr.cva)(`
|
|
84
|
+
`,{variants:{variant:{sm:"gap-1.25 [&_svg:not([class*=size-])]:size-3.5",md:"gap-1.5 [&_svg:not([class*=size-])]:size-4",lg:"gap-1.5 [&_svg:not([class*=size-])]:size-4"}},defaultVariants:{variant:"md"}});function ta(r){var i=r,{className:e,type:t,variant:a}=i,o=g(i,["className","type","variant"]);return(0,$r.jsx)("input",n({"data-slot":"input",type:t,className:x(Si({variant:a}),e)},o))}var ae=require("react/jsx-runtime");function Wr(){let{isCreateFolderModalOpen:e,setIsCreateFolderModalOpen:t,isRenameFolderModalOpen:a,setIsRenameFolderModalOpen:o,createFolder:r,renameFolder:i,folderToRename:l,setFolderToRename:c}=O(),[s,f]=(0,Ja.useState)(""),m=a,b=e||a;(0,Ja.useEffect)(()=>{a&&l?f(l.name):e||f("")},[a,e,l]);let p=async()=>{if(s.trim()!==""){if(m&&l){let w=l.id;w!==null&&await i(w,s.trim()),o(!1),c(null)}else r(s.trim()),t(!1);f("")}},y=()=>{m?(o(!1),c(null)):t(!1),f("")};return b?(0,ae.jsx)(ze,{open:b,onOpenChange:y,children:(0,ae.jsxs)(Te,{className:"p-0 max-w-xl m-auto min-h-fit max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,ae.jsx)(Be,{className:"pt-5 pb-3 m-0 border-b border-border flex w-full justify-between",children:(0,ae.jsx)(Re,{className:"px-6 text-base",children:(0,ae.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,ae.jsxs)("span",{children:[m?"Rename Folder":"Create New Folder",!m&&(0,ae.jsx)("span",{className:"ml-4",children:(0,ae.jsx)(ea,{children:(0,ae.jsxs)(Xt,{children:[(0,ae.jsx)("span",{className:"text-lg",children:"\u2318"})," + F"]})})})]}),(0,ae.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:y,className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,ae.jsx)(ve,{className:"size-5"}),(0,ae.jsx)("span",{className:"hidden",children:"Close"})]})]})})}),(0,ae.jsxs)("div",{className:"p-6",children:[(0,ae.jsx)("label",{htmlFor:"folder-name",className:"hidden mb-2",children:"Folder Name:"}),(0,ae.jsx)(ta,{id:"folder-name",name:"folder-name",value:s,onChange:w=>f(w.target.value),placeholder:"Enter folder name",autoFocus:!0,onKeyDown:w=>{w.key==="Enter"&&s.trim()!==""&&p()}})]}),(0,ae.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,ae.jsx)(qe,{asChild:!0,children:(0,ae.jsx)(C,{type:"button",variant:"outline",onClick:y,radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,ae.jsx)(C,{type:"button",disabled:s.trim()==="",onClick:p,radius:"full",className:"w-full md:w-auto",children:m?"Rename":"Create"})]})]})}):null}var pt=require("react");var ha=require("lucide-react");function $e(e,t=30){if(e.length<=t)return e;let a=e.slice(0,Math.ceil(t/2)),o=e.slice(-Math.floor(t/2));return`${a}...${o}`}var Et=require("react");function So({threshold:e=0,root:t=null,rootMargin:a="0%"}={}){let[o,r]=(0,Et.useState)(),[i,l]=(0,Et.useState)(null),c=(0,Et.useRef)(null);return(0,Et.useEffect)(()=>(c.current&&c.current.disconnect(),i&&typeof window!="undefined"&&"IntersectionObserver"in window&&(c.current=new IntersectionObserver(([s])=>{r(s)},{threshold:e,root:t,rootMargin:a}),c.current.observe(i)),()=>{c.current&&c.current.disconnect()}),[i,e,t,a]),{ref:l,entry:o}}var P=require("react/jsx-runtime");function Kr({folder:e,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r=[],treeState:i}){var h;let[l,c]=(0,pt.useState)(!1),s=((h=e.folderCount)!=null?h:0)>0,f=t===e.id,m=r.includes(e.id),b=i.loading.has(e.id),p=i.loaded.has(e.id),y=i.folders.get(e.id)||[],w=i.pagination.get(e.id),{ref:N,entry:M}=So({threshold:.1,rootMargin:"100px"}),D=w&&w.currentPage<w.totalPages;return(0,pt.useEffect)(()=>{if(l&&(M!=null&&M.isIntersecting)&&D&&!b){let I=((w==null?void 0:w.currentPage)||1)+1;o(e.id,I)}},[M==null?void 0:M.isIntersecting,D,b,l,w,e.id,o]),(0,P.jsxs)("li",{children:[(0,P.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[s?(0,P.jsx)("button",{onClick:async()=>{if(!s)return;let I=!l;c(I),I&&!p&&!b&&await o(e.id,1)},className:"p-1 -m-1 hover:bg-gray-100 rounded transition-colors","aria-label":l?"Collapse folder":"Expand folder",children:(0,P.jsx)(ha.ChevronRight,{className:`size-4 text-gray-500 transition-transform ${!m&&l?"rotate-90":""}`})}):(0,P.jsx)("div",{className:"w-4"}),(0,P.jsxs)("button",{onClick:()=>{m||a(e.id)},disabled:m,title:e.name,className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${f?"bg-blue-100 text-blue-600 font-semibold":m?"opacity-50 cursor-not-allowed":"hover:bg-gray-100"}`,children:[(0,P.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,P.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,P.jsx)("span",{className:"truncate min-w-0",children:$e(e.name,15)}),m?(0,P.jsx)("span",{className:"text-[0.6rem] text-left font-medium text-gray-900",children:"(Already selected)"}):""]})]})]}),!m&&l&&(0,P.jsxs)("ul",{className:"pl-6",children:[y.map(I=>(0,P.jsx)(Kr,{folder:I,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r,treeState:i},I.id)),(b||D)&&(0,P.jsx)("li",{ref:N,className:"py-2 pl-6 flex justify-start",children:(0,P.jsx)(ha.Loader2,{className:"h-4 w-4 animate-spin text-blue-500"})}),b&&y.length===0&&(0,P.jsx)("li",{className:"py-1",children:(0,P.jsx)("div",{className:"flex items-center gap-1.5 px-2",children:(0,P.jsx)("span",{className:"text-sm text-gray-500",children:"Loading..."})})})]})]})}function Yr(){let{isMoveFileModalOpen:e,setIsMoveFileModalOpen:t,selectedFiles:a,selectedFolders:o,bulkMove:r,provider:i}=O(),[l,c]=(0,pt.useState)(void 0),[s,f]=(0,pt.useState)({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}),{ref:m,entry:b}=So({threshold:.1,rootMargin:"100px"}),p=s.pagination.get(null),y=p&&p.currentPage<p.totalPages,w=s.loading.has(null),N=o.map(h=>h.id),M=s.folders.get(null)||[];(0,pt.useEffect)(()=>{e&&!s.loaded.has(null)&&!s.loading.has(null)&&D(null,1)},[e]),(0,pt.useEffect)(()=>{if(e&&(b!=null&&b.isIntersecting)&&y&&!w){let h=((p==null?void 0:p.currentPage)||1)+1;D(null,h)}},[b==null?void 0:b.isIntersecting,y,w,p,e]);let D=async(h,I=1)=>{if(!s.loading.has(h)){f(Y=>d(n({},Y),{loading:new Set(Y.loading).add(h)}));try{let Y=await i.getFolders(h,I,20);f(te=>{let se=new Set(te.loading);se.delete(h);let De=new Set(te.loaded);De.add(h);let u=new Map(te.folders),L=u.get(h)||[];I>1?u.set(h,[...L,...Y.folders]):u.set(h,Y.folders);let v=new Map(te.pagination);return v.set(h,Y.pagination),{folders:u,loading:se,loaded:De,pagination:v}})}catch(Y){console.error(`Failed to load folders for ${h}:`,Y),f(te=>{let se=new Set(te.loading);return se.delete(h),d(n({},te),{loading:se})})}}},z=()=>{l!==void 0&&(r(l),t(!1),c(void 0),f({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))},T=h=>{t(h),h?D(null,1):(c(void 0),f({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))};return e?(0,P.jsx)(ze,{open:e,onOpenChange:T,children:(0,P.jsxs)(Te,{className:"p-0 max-w-3xl max-h-full m-auto md:max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,P.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,P.jsx)(Re,{className:"px-6 text-base",children:(0,P.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,P.jsxs)("span",{className:"w-full text-left",children:["Move Items",(0,P.jsxs)("p",{className:"text-gray-400 text-xs",children:["Moving ",a.length," file",a.length===1?"":"s"," and"," ",o.length," folder",o.length===1?"":"s","."]})]}),(0,P.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>T(!1),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,P.jsx)(ve,{className:"size-5"}),(0,P.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,P.jsx)(lt,{})]}),(0,P.jsx)("div",{className:"text-sm my-3 px-6 flex-1 flex flex-col min-h-0",children:(0,P.jsx)("div",{className:"space-y-4 flex flex-col flex-1 min-h-0",children:(0,P.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,P.jsx)("label",{className:"block mb-2 font-medium text-gray-900",children:"Select destination folder:"}),(0,P.jsxs)("ul",{className:"border rounded-xl p-2 shadow-inner overflow-y-auto flex-1 min-h-0",children:[(0,P.jsx)("li",{children:(0,P.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[(0,P.jsx)("div",{className:"w-4"}),(0,P.jsxs)("button",{onClick:()=>c(null),className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${l===null?"bg-blue-100 text-blue-600 font-semibold":"hover:bg-gray-100"}`,children:[(0,P.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,P.jsx)("div",{className:"flex flex-col gap-1",children:(0,P.jsx)("span",{className:"truncate min-w-0",children:"Root Directory"})})]})]})}),M.map(h=>(0,P.jsx)(Kr,{folder:h,selectedFolderId:l,onSelect:I=>c(I),onLoadChildren:D,disabledFolderIds:N,treeState:s},h.id)),(w||y)&&(0,P.jsx)("li",{ref:m,className:"py-2 pl-6 flex justify-start",children:(0,P.jsx)(ha.Loader2,{className:"h-5 w-5 animate-spin text-blue-500"})}),M.length===0&&!w&&!y&&(0,P.jsx)("li",{className:"text-gray-500 text-sm text-center py-4",children:"No nested folders available"})]})]})})}),(0,P.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,P.jsx)(qe,{asChild:!0,children:(0,P.jsx)(C,{type:"button",variant:"outline",radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,P.jsx)(C,{type:"button",onClick:z,disabled:l===void 0,radius:"full",className:"w-full md:w-auto",children:"Move"})]})]})}):null}var ba=require("react"),rn=require("lucide-react");var aa=require("radix-ui");var mt=require("react/jsx-runtime");function qr(i){var l=i,{className:e,viewportClassName:t,children:a,viewportRef:o}=l,r=g(l,["className","viewportClassName","children","viewportRef"]);return(0,mt.jsxs)(aa.ScrollArea.Root,d(n({"data-slot":"scroll-area",className:x("relative overflow-hidden",e)},r),{children:[(0,mt.jsx)(aa.ScrollArea.Viewport,{ref:o,className:x("h-full w-full rounded-[inherit]",t),children:a}),(0,mt.jsx)(zi,{}),(0,mt.jsx)(aa.ScrollArea.Corner,{})]}))}function zi(o){var r=o,{className:e,orientation:t="vertical"}=r,a=g(r,["className","orientation"]);return(0,mt.jsx)(aa.ScrollArea.ScrollAreaScrollbar,d(n({"data-slot":"scroll-area-scrollbar",orientation:t,className:x("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-[1px]",e)},a),{children:(0,mt.jsx)(aa.ScrollArea.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}))}var pe=require("react/jsx-runtime");function ut({title:e,open:t,onClose:a,previewSection:o,metadataSection:r,footer:i}){return(0,pe.jsx)(ze,{open:t,onOpenChange:l=>!l&&a(),children:(0,pe.jsxs)(Te,{className:"p-0 max-w-6xl m-auto xl:min-h-fit max-h-[85vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,pe.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,pe.jsx)(Re,{className:"px-6 text-base",children:(0,pe.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,pe.jsx)("span",{children:e}),(0,pe.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>a(),className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50",children:[(0,pe.jsx)(ve,{className:"size-5"}),(0,pe.jsx)("span",{className:"hidden",children:"Close"})]})]})}),(0,pe.jsx)(lt,{})]}),(0,pe.jsx)(qr,{className:"flex-1 min-h-0",children:(0,pe.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 min-h-full max-h-[65vh] overflow-scroll",children:[(0,pe.jsx)("div",{className:"p-6 border-b lg:border-b-0 lg:border-r",children:o}),(0,pe.jsx)("div",{className:"p-6",children:r})]})}),(0,pe.jsx)(He,{className:"px-6 py-4 border-t border-border",children:i})]})})}var To=require("lucide-react");var At=require("sonner");var Xa=require("react");var va=require("react/jsx-runtime");function zo(e){return(0,va.jsxs)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,va.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,va.jsx)("path",{d:"M5 12l5 5l10 -10"})]}))}var _e=require("react/jsx-runtime");function ft({file:e}){let{provider:t,setFileDetailsModalFile:a,refreshData:o}=O(),[r,i]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",title:"Delete",className:"border-gray-200 bg-white hover:text-red-600 hover:border-red-200 hover:bg-red-50 active:scale-95 transition-transform",onClick:async()=>{i(!0);try{await t.deleteFiles([e.id]),await o(),a(null),At.toast.success("File Deleted",{description:`${$e(e.name,20)} has been deleted`})}catch(c){At.toast.error("Delete failed"),i(!1)}},disabled:r,children:r?(0,_e.jsx)(To.Loader2,{className:"size-5 animate-spin"}):(0,_e.jsx)(Ze,{className:"size-5"})})}function gt({file:e}){let[t,a]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{a(!0);try{let r=document.createElement("a");r.href=e.url,r.download=e.name,r.click(),At.toast.success("Download Started",{description:`Downloading ${$e(e.name,20)}`})}catch(r){At.toast.error("Download failed")}finally{a(!1)}},className:"border-gray-200 bg-white hover:text-blue-600 hover:border-blue-200 hover:bg-blue-50 active:scale-95 transition-transform",title:"Download",disabled:t,children:t?(0,_e.jsx)(To.Loader2,{className:"size-5 animate-spin"}):(0,_e.jsx)(Wa,{className:"size-5",strokeWidth:2.5})})}function ht({file:e}){let[t,a]=(0,Xa.useState)(!1);return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{try{await navigator.clipboard.writeText(e.url),a(!0),At.toast.success("Link Copied",{description:"File URL copied to clipboard"}),setTimeout(()=>a(!1),2e3)}catch(r){At.toast.error("Failed to copy link")}},className:`border-gray-200 bg-white active:scale-95 transition-all ${t?"text-green-700 border-green-400 bg-green-100 font-bold":"hover:text-orange-600 hover:border-orange-200 hover:bg-orange-50"}`,title:"Copy Link",disabled:t,children:t?(0,_e.jsx)(zo,{className:"size-5 animate-in zoom-in duration-200",strokeWidth:3}):(0,_e.jsx)(Ka,{className:"size-5",strokeWidth:2.5})})}function Qr({file:e,onFullscreen:t}){return(0,_e.jsx)(C,{variant:"outline",size:"icon",radius:"full",onClick:t,className:"border-gray-200 bg-white hover:text-purple-600 hover:border-purple-200 hover:bg-purple-50 active:scale-95 transition-transform",title:"Fullscreen",children:(0,_e.jsx)(Ya,{className:"size-5",strokeWidth:1})})}var Jr=require("class-variance-authority");var Xr=require("react/jsx-runtime"),Ti=(0,Jr.cva)(`
|
|
85
85
|
w-full bg-background border border-input bg-background text-foreground shadow-xs shadow-black/5 transition-[color,box-shadow]
|
|
86
86
|
text-foreground placeholder:text-muted-foreground/80 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px]
|
|
87
87
|
focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 [&[readonly]]:opacity-70
|
|
88
88
|
aria-invalid:border-destructive aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
89
|
-
`,{variants:{variant:{sm:"px-2.5 py-2.5 text-xs rounded-md",md:"px-3 py-3 text-sm rounded-md",lg:"px-4 py-4 text-sm rounded-md"}},defaultVariants:{variant:"md"}});function We(o){var r=o,{className:e,variant:t}=r,a=g(r,["className","variant"]);return(0,
|
|
89
|
+
`,{variants:{variant:{sm:"px-2.5 py-2.5 text-xs rounded-md",md:"px-3 py-3 text-sm rounded-md",lg:"px-4 py-4 text-sm rounded-md"}},defaultVariants:{variant:"md"}});function We(o){var r=o,{className:e,variant:t}=r,a=g(r,["className","variant"]);return(0,Xr.jsx)("textarea",n({"data-slot":"textarea",className:x(Ti({variant:t}),e)},a))}var en=require("class-variance-authority"),tn=require("radix-ui");var an=require("react/jsx-runtime"),Ri=(0,en.cva)("text-sm leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50",{variants:{variant:{primary:"font-medium",secondary:"font-normal"}},defaultVariants:{variant:"primary"}});function Oe(o){var r=o,{className:e,variant:t}=r,a=g(r,["className","variant"]);return(0,an.jsx)(tn.Label.Root,n({"data-slot":"label",className:x(Ri({variant:t}),e)},a))}function vt(e){let t=typeof e=="string"?new Date(e):e,a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=t.getFullYear();return`${a}/${o}/${r}`}function eo(e){let t=Math.floor(e/60),a=e%60;return`${t}:${a.toString().padStart(2,"0")}`}var _i=require("react"),on=require("class-variance-authority");var Ei=require("radix-ui");var Ai=require("react/jsx-runtime");var to=require("react/jsx-runtime");var Li=(0,on.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function xt(o){var r=o,{className:e,orientation:t="vertical"}=r,a=g(r,["className","orientation"]);return(0,to.jsx)("div",n({role:"group","data-slot":"field","data-orientation":t,className:x(Li({orientation:t}),e)},a))}function bt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,to.jsx)(Oe,n({"data-slot":"field-label",className:x("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e)},t))}var Ro=require("class-variance-authority");var xa=require("react/jsx-runtime");function wt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,xa.jsx)("div",n({"data-slot":"input-group",role:"group",className:x("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e)},t))}var Vi=(0,Ro.cva)("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function Ct(o){var r=o,{className:e,align:t="inline-start"}=r,a=g(r,["className","align"]);return(0,xa.jsx)("div",n({role:"group","data-slot":"input-group-addon","data-align":t,className:x(Vi({align:t}),e),onClick:i=>{var l,c;i.target.closest("button")||(c=(l=i.currentTarget.parentElement)==null?void 0:l.querySelector("input"))==null||c.focus()}},a))}var Rc=(0,Ro.cva)("text-sm shadow-none flex gap-2 items-center",{variants:{size:{xs:"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",sm:"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function yt(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,xa.jsx)("span",n({className:x("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",e)},t))}function Ft(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,xa.jsx)(ta,n({"data-slot":"input-group-control",className:x("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e)},t))}var E=require("react/jsx-runtime");function nn({file:e,onClose:t,onSave:a,onDelete:o}){var M;let[r,i]=(0,ba.useState)(!1),[l,c]=(0,ba.useState)(e.name),[s,f]=(0,ba.useState)(e.alternativeText||""),[m,b]=(0,ba.useState)(e.caption||""),p=async()=>{i(!0);try{await(a==null?void 0:a({name:l,alternativeText:s,caption:m})),t()}finally{i(!1)}},y=(0,E.jsxs)("div",{className:"flex flex-col h-full",children:[(0,E.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,E.jsx)(ft,{file:e}),(0,E.jsx)(gt,{file:e}),(0,E.jsx)(ht,{file:e}),(0,E.jsx)(Qr,{file:e,onFullscreen:()=>window.open(e.url,"_blank")})]}),(0,E.jsx)("div",{className:"flex-1 flex items-center justify-center bg-gray-50 dark:bg-gray-900 rounded-lg overflow-hidden",style:{backgroundImage:`
|
|
90
90
|
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
|
|
91
91
|
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
|
|
92
92
|
linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
|
|
93
93
|
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%)
|
|
94
|
-
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:(0,E.jsx)("img",{src:e.previewUrl||e.url,alt:e.alternativeText||e.name,className:"max-w-full max-h-full object-contain"})})]}),w=(0,E.jsxs)("div",{className:"space-y-6",children:[(0,E.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Dimensions"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((M=e.ext)==null?void 0:M.replace(".",""))||"N/A"})]})]}),(0,E.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,E.jsx)("div",{className:"space-y-2",children:(0,E.jsxs)(xt,{className:"gap-0",children:[(0,E.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,E.jsxs)(wt,{children:[(0,E.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,E.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,E.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Oe,{htmlFor:"altText",children:"Alternative text"}),(0,E.jsx)(We,{id:"altText",value:s,onChange:D=>f(D.target.value),placeholder:"Describe the image for accessibility",rows:3}),(0,E.jsx)("p",{className:"text-xs text-muted-foreground",children:"This text will be displayed if the asset can't be shown."})]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,E.jsx)(We,{id:"caption",value:m,onChange:D=>b(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,E.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:y,metadataSection:w,footer:(0,E.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,E.jsx)(C,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:r,children:"Cancel"}),(0,E.jsxs)(C,{className:"w-full md:w-auto",onClick:p,radius:"full",disabled:r,children:[r&&(0,E.jsx)(on.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var ao=require("react"),nn=require("lucide-react");var R=require("react/jsx-runtime");function ln({file:e,onClose:t,onSave:a,onDelete:o}){var w,N,M;let[r,i]=(0,ao.useState)(!1),[l,c]=(0,ao.useState)(e.name),[s,f]=(0,ao.useState)(e.caption||""),m=async()=>{i(!0);try{await(a==null?void 0:a({name:l,caption:s})),t()}finally{i(!1)}},b=(0,R.jsxs)("div",{className:"flex flex-col h-full",children:[(0,R.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,R.jsx)(ft,{file:e}),(0,R.jsx)(gt,{file:e}),(0,R.jsx)(ht,{file:e})]}),(0,R.jsx)("div",{className:"flex-1 flex items-center justify-center bg-black rounded-lg overflow-hidden",children:(0,R.jsx)("video",{src:e.url,controls:!0,className:"max-w-full max-h-full",style:{maxHeight:"500px"},children:"Your browser does not support the video tag."})})]}),p=(0,R.jsxs)("div",{className:"space-y-6",children:[(0,R.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Dimensions"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(w=e.metaData)!=null&&w.duration?eo(e.metaData.duration):"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((N=e.ext)==null?void 0:N.replace(".",""))||"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Video Source"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600 capitalize",children:((M=e.metaData)==null?void 0:M.videoSource)||"local"})]})]}),(0,R.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,R.jsx)("div",{className:"space-y-2",children:(0,R.jsxs)(xt,{className:"gap-0",children:[(0,R.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,R.jsxs)(wt,{children:[(0,R.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,R.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,R.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,R.jsxs)("div",{className:"space-y-2",children:[(0,R.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,R.jsx)(We,{id:"caption",value:s,onChange:D=>f(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,R.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,R.jsxs)("div",{className:"flex w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,R.jsx)(C,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),(0,R.jsxs)(C,{onClick:m,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&(0,R.jsx)(nn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var oo=require("react"),sn=require("lucide-react");var dn=require("lucide-react");var S=require("react/jsx-runtime");function cn({file:e,onClose:t,onSave:a,onDelete:o}){var w,N,M;let[r,i]=(0,oo.useState)(!1),[l,c]=(0,oo.useState)(e.name),[s,f]=(0,oo.useState)(e.caption||""),m=async()=>{i(!0);try{await(a==null?void 0:a({name:l,caption:s})),t()}finally{i(!1)}},b=(0,S.jsxs)("div",{className:"flex flex-col h-full",children:[(0,S.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,S.jsx)(ft,{file:e}),(0,S.jsx)(gt,{file:e}),(0,S.jsx)(ht,{file:e})]}),(0,S.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-purple-50 to-blue-50 dark:from-purple-950 dark:to-blue-950 rounded-lg p-8",children:[(0,S.jsx)("div",{className:"mb-8",children:(0,S.jsx)("div",{className:"w-32 h-32 rounded-full bg-white dark:bg-gray-800 shadow-lg flex items-center justify-center",children:(0,S.jsx)(dn.Music,{className:"w-16 h-16 text-purple-600 dark:text-purple-400"})})}),(0,S.jsx)("div",{className:"w-full max-w-md",children:(0,S.jsx)("audio",{src:e.url,controls:!0,className:"w-full",children:"Your browser does not support the audio tag."})})]})]}),p=(0,S.jsxs)("div",{className:"space-y-6",children:[(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(w=e.metaData)!=null&&w.duration?eo(e.metaData.duration):"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Bitrate"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(N=e.metaData)!=null&&N.bitrate?`${e.metaData.bitrate} kbps`:"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((M=e.ext)==null?void 0:M.replace(".",""))||"N/A"})]})]}),(0,S.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,S.jsx)("div",{className:"space-y-2",children:(0,S.jsxs)(xt,{className:"gap-0",children:[(0,S.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,S.jsxs)(wt,{children:[(0,S.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,S.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,S.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,S.jsx)(We,{id:"caption",value:s,onChange:D=>f(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,S.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,S.jsxs)("div",{className:"flex gap-2 w-full sm:justify-between justify-center items-center flex-col sm:flex-row ",children:[(0,S.jsx)(C,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),(0,S.jsxs)(C,{onClick:m,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&(0,S.jsx)(sn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var ro=require("react"),pn=require("lucide-react");var A=require("react/jsx-runtime");function mn({file:e,onClose:t,onSave:a}){var N,M,D,z;let[o,r]=(0,ro.useState)(!1),[i,l]=(0,ro.useState)(e.name),[c,s]=(0,ro.useState)(((N=e.metaData)==null?void 0:N.description)||""),f=async()=>{r(!0);try{await(a==null?void 0:a({name:i,metaData:d(n({},e.metaData),{description:c})})),t()}finally{r(!1)}},m=((M=e.ext)==null?void 0:M.replace(".",""))||"file",{component:b}=ct(e),p=(0,A.jsxs)("div",{className:"flex flex-col h-full",children:[(0,A.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,A.jsx)(ft,{file:e}),(0,A.jsx)(gt,{file:e}),(0,A.jsx)(ht,{file:e})]}),(0,A.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 rounded-lg p-8",children:[(0,A.jsx)("div",{className:"mb-4 w-32 h-32 flex items-center justify-center",children:(0,A.jsx)(b,{file:e,metaData:e.metaData})}),(0,A.jsxs)("p",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[m," File"]})]})]}),y=(0,A.jsxs)("div",{className:"space-y-6",children:[(0,A.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:m})]}),((D=e.metaData)==null?void 0:D.pageCount)&&(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Page Count"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.metaData.pageCount})]}),((z=e.metaData)==null?void 0:z.author)&&(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Author"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.metaData.author})]})]}),(0,A.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,A.jsx)("div",{className:"space-y-2",children:(0,A.jsxs)(xt,{className:"gap-0",children:[(0,A.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,A.jsxs)(wt,{children:[(0,A.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:i.replace(e.ext||"",""),onChange:T=>l(T.target.value)}),(0,A.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,A.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)(Oe,{htmlFor:"description",children:"Description"}),(0,A.jsx)(We,{id:"description",value:c,onChange:T=>s(T.target.value),placeholder:"Add a description",rows:3})]})]})]});return(0,A.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:p,metadataSection:y,footer:(0,A.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,A.jsx)(C,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:o,children:"Cancel"}),(0,A.jsxs)(C,{className:"w-full md:w-auto",onClick:f,radius:"full",disabled:o,children:[o&&(0,A.jsx)(pn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})]})})}var Ke=require("react/jsx-runtime");function un({className:e}){let{fileDetailsModalFile:t,setFileDetailsModalFile:a,updateFileMetadata:o}=O(),r=()=>{a(null)},i=async c=>{t&&await o(t.id,c)},l=()=>{if(!t)return null;switch(je(t.mime,t.ext)){case X.IMAGE:return(0,Ke.jsx)(rn,{file:t,onClose:r,onSave:i});case X.VIDEO:return(0,Ke.jsx)(ln,{file:t,onClose:r,onSave:i});case X.AUDIO:return(0,Ke.jsx)(cn,{file:t,onClose:r,onSave:i});case X.FILE:default:return(0,Ke.jsx)(mn,{file:t,onClose:r,onSave:i})}};return(0,Ke.jsxs)("div",{className:x("",e),children:[(0,Ke.jsx)(Zr,{}),(0,Ke.jsx)($r,{}),(0,Ke.jsx)(Kr,{}),l()]})}var Ro=require("react/jsx-runtime");function Oi(a){var o=a,{children:e}=o,t=g(o,["children"]);return(0,Ro.jsx)(ia,d(n({mode:oe.PAGE,selectionMode:Le.MULTIPLE},t),{children:e}))}function Gi(c){var s=c,{children:e,fileSelectionMode:t=Le.SINGLE,acceptedFileTypes:a,viewMode:o="grid",onFilesSelected:r,onClose:i}=s,l=g(s,["children","fileSelectionMode","acceptedFileTypes","viewMode","onFilesSelected","onClose"]);return(0,Ro.jsx)(ia,d(n({mode:oe.MODAL,selectionMode:t,acceptedFileTypesForModal:a||l.allowedFileTypes,viewMode:o,onFilesSelected:r,onClose:i},l),{children:e}))}var et={Page:Oi,Modal:Gi,Header:mr,Footer:pr,Overlays:un};var ee=require("react/jsx-runtime");function fn(){let{setIsMoveFileModalOpen:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",radius:"full",onClick:()=>e(!0),className:"text-md font-medium bg-white hover:bg-blue-50 hover:text-blue-600 hover:border-blue-200 border-gray-200 shadow-sm",children:[(0,ee.jsx)(pa,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden sm:inline",children:"Move"})]})}function gn(){let{bulkDelete:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",radius:"full",onClick:e,className:"text-md font-medium bg-white hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 shadow-sm",children:[(0,ee.jsx)(Ze,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden",children:"Delete"})]})}function hn(){let{handleClearSelection:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",onClick:e,className:"rounded-full text-md font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 hover:font-bold hover:border-blue-200 transition-all duration-200",children:[(0,ee.jsx)(ve,{className:"size-5 text-blue-600"}),"Clear"]})}function vn(){let{selectedFiles:e,selectedFolders:t}=O();return e.length+t.length===0?null:(0,ee.jsx)("div",{className:"w-full",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(fn,{}),(0,ee.jsx)(gn,{})]}),(0,ee.jsx)(hn,{})]})})}function xn({className:e}){let{selectedFiles:t,selectedFolders:a}=O();return t.length+a.length===0?null:(0,ee.jsx)("div",{className:`fixed bottom-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-sm border-t border-gray-200 shadow-lg ${e||""}`,children:(0,ee.jsx)("div",{className:"px-4 sm:px-6 py-3 mx-auto",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(fn,{}),(0,ee.jsx)(gn,{})]}),(0,ee.jsx)(hn,{})]})})})}var bn=require("react/jsx-runtime");function Eo(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,bn.jsx)("div",n({"data-slot":"skeleton",className:x("animate-pulse rounded-md bg-accent",e)},t))}var wn=require("next/navigation"),be=require("react/jsx-runtime");function no(){let{currentFolder:e,handleFolderClick:t,isLoading:a}=O(),o=(0,wn.useRouter)(),r=()=>{o.back()};return a?(0,be.jsxs)("div",{className:"flex item-center w-full",children:[(0,be.jsx)(Eo,{className:"rounded-full size-10 mr-2 shrink-0"}),(0,be.jsx)(Eo,{className:"min-w-32 rounded-md h-full"})]}):(0,be.jsx)(be.Fragment,{children:e?(0,be.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,be.jsx)(C,{variant:"outline",size:"icon",radius:"full",disabled:a,className:"border-gray-200 bg-white mr-2",onClick:r,children:(0,be.jsx)(Gt,{className:"size-5",strokeWidth:"1",stroke:"black"})}),(0,be.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:$e(e.name,20)})]}):(0,be.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,be.jsx)(C,{className:"mr-2 shrink-0",radius:"full",variant:"ghost",mode:"icon",size:"icon",onClick:()=>t(null),children:(0,be.jsx)($a,{className:"size-6"})}),(0,be.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:"Home"})]})})}var Uo=require("lucide-react");var Ao=require("lucide-react"),_t=require("radix-ui");var Mt=require("react/jsx-runtime");function wa(t){var e=g(t,[]);return(0,Mt.jsx)(_t.DropdownMenu.Root,n({"data-slot":"dropdown-menu"},e))}function Ca(t){var e=g(t,[]);return(0,Mt.jsx)(_t.DropdownMenu.Trigger,n({className:"select-none","data-slot":"dropdown-menu-trigger"},e))}function ya(o){var r=o,{className:e,sideOffset:t=4}=r,a=g(r,["className","sideOffset"]);return(0,Mt.jsx)(_t.DropdownMenu.Portal,{children:(0,Mt.jsx)(_t.DropdownMenu.Content,n({"data-slot":"dropdown-menu-content",sideOffset:t,className:x("space-y-0.5 z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md shadow-black/5 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",e)},a))})}function tt(r){var i=r,{className:e,inset:t,variant:a}=i,o=g(i,["className","inset","variant"]);return(0,Mt.jsx)(_t.DropdownMenu.Item,n({"data-slot":"dropdown-menu-item",className:x("text-foreground relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0","focus:bg-accent focus:text-foreground","data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",t&&"ps-8",a==="destructive"&&"text-destructive hover:text-destructive focus:text-destructive hover:bg-destructive/5 focus:bg-destructive/5 data-[active=true]:bg-destructive/5",e)},o))}function Cn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Mt.jsx)(_t.DropdownMenu.Separator,n({"data-slot":"dropdown-menu-separator",className:x("-mx-2 my-1.5 h-px bg-muted",e)},t))}var at=require("react");var Lt=require("cmdk"),_o=require("lucide-react");var Fe=require("react/jsx-runtime");function Bi(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command,n({className:x("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e)},t))}var yn=r=>{var i=r,{children:e,className:t,shouldFilter:a}=i,o=g(i,["children","className","shouldFilter"]);return(0,Fe.jsx)(ze,d(n({},o),{children:(0,Fe.jsxs)(Te,{className:x("overflow-hidden p-0 shadow-lg",t),children:[(0,Fe.jsx)(Re,{className:"hidden"}),(0,Fe.jsx)(Bi,{shouldFilter:a,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})]})}))};function Fn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsxs)("div",{className:"flex items-center border-border border-b px-3","cmdk-input-wrapper":"","data-slot":"command-input",children:[(0,Fe.jsx)(_o.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,Fe.jsx)(Lt.Command.Input,n({className:x("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)},t))]})}function Mn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.List,n({"data-slot":"command-list",className:x("max-h-[300px] overflow-y-auto overflow-x-hidden",e)},t))}function io(t){var e=g(t,[]);return(0,Fe.jsx)(Lt.Command.Empty,n({"data-slot":"command-empty",className:"py-6 text-center text-sm"},e))}function Lo(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.Group,n({"data-slot":"command-group",className:x("overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e)},t))}function Vo(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.Item,n({"data-slot":"command-item",className:x("relative flex text-foreground cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0","[&_svg:not([role=img]):not([class*=text-])]:opacity-60",e)},t))}var lo=require("react");function so(e,t=500){let[a,o]=(0,lo.useState)(e);return(0,lo.useEffect)(()=>{let r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),a}var Dn=require("sonner");var H=require("react/jsx-runtime");function Oo(){let[e,t]=(0,at.useState)(""),[a,o]=(0,at.useState)([]),[r,i]=(0,at.useState)([]),[l,c]=(0,at.useState)(!1),{provider:s,handleFolderClick:f,handleClearSelection:m,isSearchModalOpen:b,setIsSearchModalOpen:p,setFileDetailsModalFile:y}=O(),w=so(e,300),N=(0,at.useCallback)(async z=>{c(!0);try{let[T,h]=await Promise.all([s.findFiles(z),s.findFolders(z)]);o(T),i(h)}catch(T){let h=T instanceof Error?T.message:"Search failed";Dn.toast.error("Search Failed",{description:h}),o([]),i([])}finally{c(!1)}},[s]);return(0,at.useEffect)(()=>{b&&w.length>0?N(w):(o([]),i([]))},[w,b,N]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",onClick:()=>p(!0),children:[(0,H.jsx)(Ae,{className:"size-4 text-gray-700"}),(0,H.jsx)("span",{className:"hidden",children:"Search"})]}),(0,H.jsxs)(yn,{className:"max-w-4xl w-full",open:b,onOpenChange:z=>{p(z),z||(t(""),o([]),i([]))},shouldFilter:!1,children:[(0,H.jsx)(Fn,{placeholder:"Type to search files or folders...",value:e,onValueChange:z=>{t(z)}}),(0,H.jsxs)(Mn,{children:[l&&(0,H.jsx)(io,{children:"Searching..."}),!l&&a.length===0&&r.length===0&&!e&&(0,H.jsx)(io,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Ae,{className:"size-12 text-gray-300 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"Search your files and folders"}),(0,H.jsx)("p",{className:"text-xs text-gray-500",children:"Start typing to find what you're looking for"}),(0,H.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:(0,H.jsx)(ea,{children:(0,H.jsxs)(Xt,{children:[(0,H.jsx)("span",{className:"text-lg",children:"\u2318"})," + K"]})})})]})}),!l&&a.length===0&&r.length===0&&e&&(0,H.jsx)(io,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Ae,{className:"size-12 text-gray-300 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"No results found"}),(0,H.jsx)("p",{className:"text-xs text-gray-500",children:"Try searching with different keywords"})]})}),r.length>0&&(0,H.jsx)(Lo,{heading:"Folders",children:r.map(z=>(0,H.jsxs)(Vo,{onSelect:()=>{m(),p(!1),f(z)},children:[(0,H.jsx)(Xe,{className:"size-4 mr-2 shrink-0",strokeWidth:1.5}),(0,H.jsx)("span",{children:$e(z.name,60)})]},z.id))}),a.length>0&&(0,H.jsx)(Lo,{heading:"Files",children:a.map(z=>{let{component:T}=ct(z);return(0,H.jsxs)(Vo,{onSelect:()=>{m(),y(z)},children:[(0,H.jsx)("div",{className:"size-6 mr-2 shrink-0 flex items-center justify-center",children:(0,H.jsx)(T,{file:z,metaData:z.metaData})}),(0,H.jsx)("span",{children:$e(z.name,60)})]},z.id)})})]})]})]})}var Nn=require("class-variance-authority"),co=require("lucide-react"),Go=require("radix-ui");var oa=require("react/jsx-runtime"),Hi=(0,Nn.cva)(`
|
|
94
|
+
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:(0,E.jsx)("img",{src:e.previewUrl||e.url,alt:e.alternativeText||e.name,className:"max-w-full max-h-full object-contain"})})]}),w=(0,E.jsxs)("div",{className:"space-y-6",children:[(0,E.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Dimensions"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((M=e.ext)==null?void 0:M.replace(".",""))||"N/A"})]})]}),(0,E.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,E.jsx)("div",{className:"space-y-2",children:(0,E.jsxs)(xt,{className:"gap-0",children:[(0,E.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,E.jsxs)(wt,{children:[(0,E.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,E.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,E.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Oe,{htmlFor:"altText",children:"Alternative text"}),(0,E.jsx)(We,{id:"altText",value:s,onChange:D=>f(D.target.value),placeholder:"Describe the image for accessibility",rows:3}),(0,E.jsx)("p",{className:"text-xs text-muted-foreground",children:"This text will be displayed if the asset can't be shown."})]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,E.jsx)(We,{id:"caption",value:m,onChange:D=>b(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,E.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:y,metadataSection:w,footer:(0,E.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,E.jsx)(C,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:r,children:"Cancel"}),(0,E.jsxs)(C,{className:"w-full md:w-auto",onClick:p,radius:"full",disabled:r,children:[r&&(0,E.jsx)(rn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var ao=require("react"),ln=require("lucide-react");var R=require("react/jsx-runtime");function sn({file:e,onClose:t,onSave:a,onDelete:o}){var w,N,M;let[r,i]=(0,ao.useState)(!1),[l,c]=(0,ao.useState)(e.name),[s,f]=(0,ao.useState)(e.caption||""),m=async()=>{i(!0);try{await(a==null?void 0:a({name:l,caption:s})),t()}finally{i(!1)}},b=(0,R.jsxs)("div",{className:"flex flex-col h-full",children:[(0,R.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,R.jsx)(ft,{file:e}),(0,R.jsx)(gt,{file:e}),(0,R.jsx)(ht,{file:e})]}),(0,R.jsx)("div",{className:"flex-1 flex items-center justify-center bg-black rounded-lg overflow-hidden",children:(0,R.jsx)("video",{src:e.url,controls:!0,className:"max-w-full max-h-full",style:{maxHeight:"500px"},children:"Your browser does not support the video tag."})})]}),p=(0,R.jsxs)("div",{className:"space-y-6",children:[(0,R.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Dimensions"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(w=e.metaData)!=null&&w.duration?eo(e.metaData.duration):"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((N=e.ext)==null?void 0:N.replace(".",""))||"N/A"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Video Source"}),(0,R.jsx)("p",{className:"text-xs font-bold text-blue-600 capitalize",children:((M=e.metaData)==null?void 0:M.videoSource)||"local"})]})]}),(0,R.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,R.jsx)("div",{className:"space-y-2",children:(0,R.jsxs)(xt,{className:"gap-0",children:[(0,R.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,R.jsxs)(wt,{children:[(0,R.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,R.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,R.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,R.jsxs)("div",{className:"space-y-2",children:[(0,R.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,R.jsx)(We,{id:"caption",value:s,onChange:D=>f(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,R.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,R.jsxs)("div",{className:"flex w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,R.jsx)(C,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),(0,R.jsxs)(C,{onClick:m,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&(0,R.jsx)(ln.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var oo=require("react"),dn=require("lucide-react");var cn=require("lucide-react");var S=require("react/jsx-runtime");function pn({file:e,onClose:t,onSave:a,onDelete:o}){var w,N,M;let[r,i]=(0,oo.useState)(!1),[l,c]=(0,oo.useState)(e.name),[s,f]=(0,oo.useState)(e.caption||""),m=async()=>{i(!0);try{await(a==null?void 0:a({name:l,caption:s})),t()}finally{i(!1)}},b=(0,S.jsxs)("div",{className:"flex flex-col h-full",children:[(0,S.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,S.jsx)(ft,{file:e}),(0,S.jsx)(gt,{file:e}),(0,S.jsx)(ht,{file:e})]}),(0,S.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-purple-50 to-blue-50 dark:from-purple-950 dark:to-blue-950 rounded-lg p-8",children:[(0,S.jsx)("div",{className:"mb-8",children:(0,S.jsx)("div",{className:"w-32 h-32 rounded-full bg-white dark:bg-gray-800 shadow-lg flex items-center justify-center",children:(0,S.jsx)(cn.Music,{className:"w-16 h-16 text-purple-600 dark:text-purple-400"})})}),(0,S.jsx)("div",{className:"w-full max-w-md",children:(0,S.jsx)("audio",{src:e.url,controls:!0,className:"w-full",children:"Your browser does not support the audio tag."})})]})]}),p=(0,S.jsxs)("div",{className:"space-y-6",children:[(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(w=e.metaData)!=null&&w.duration?eo(e.metaData.duration):"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Bitrate"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:(N=e.metaData)!=null&&N.bitrate?`${e.metaData.bitrate} kbps`:"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600",children:((M=e.ext)==null?void 0:M.replace(".",""))||"N/A"})]})]}),(0,S.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,S.jsx)("div",{className:"space-y-2",children:(0,S.jsxs)(xt,{className:"gap-0",children:[(0,S.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,S.jsxs)(wt,{children:[(0,S.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:D=>c(D.target.value)}),(0,S.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,S.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(Oe,{htmlFor:"caption",children:"Caption"}),(0,S.jsx)(We,{id:"caption",value:s,onChange:D=>f(D.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,S.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,S.jsxs)("div",{className:"flex gap-2 w-full sm:justify-between justify-center items-center flex-col sm:flex-row ",children:[(0,S.jsx)(C,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),(0,S.jsxs)(C,{onClick:m,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&(0,S.jsx)(dn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var ro=require("react"),mn=require("lucide-react");var A=require("react/jsx-runtime");function un({file:e,onClose:t,onSave:a}){var N,M,D,z;let[o,r]=(0,ro.useState)(!1),[i,l]=(0,ro.useState)(e.name),[c,s]=(0,ro.useState)(((N=e.metaData)==null?void 0:N.description)||""),f=async()=>{r(!0);try{await(a==null?void 0:a({name:i,metaData:d(n({},e.metaData),{description:c})})),t()}finally{r(!1)}},m=((M=e.ext)==null?void 0:M.replace(".",""))||"file",{component:b}=ct(e),p=(0,A.jsxs)("div",{className:"flex flex-col h-full",children:[(0,A.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,A.jsx)(ft,{file:e}),(0,A.jsx)(gt,{file:e}),(0,A.jsx)(ht,{file:e})]}),(0,A.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 rounded-lg p-8",children:[(0,A.jsx)("div",{className:"mb-4 w-32 h-32 flex items-center justify-center",children:(0,A.jsx)(b,{file:e,metaData:e.metaData})}),(0,A.jsxs)("p",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[m," File"]})]})]}),y=(0,A.jsxs)("div",{className:"space-y-6",children:[(0,A.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:le(e.size)})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:vt(e.createdAt)})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:m})]}),((D=e.metaData)==null?void 0:D.pageCount)&&(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Page Count"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.metaData.pageCount})]}),((z=e.metaData)==null?void 0:z.author)&&(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Author"}),(0,A.jsx)("p",{className:"text-xs font-bold text-blue-600",children:e.metaData.author})]})]}),(0,A.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,A.jsx)("div",{className:"space-y-2",children:(0,A.jsxs)(xt,{className:"gap-0",children:[(0,A.jsx)(bt,{htmlFor:"fileName",children:"File name"}),(0,A.jsxs)(wt,{children:[(0,A.jsx)(Ft,{id:"fileName",placeholder:"Enter file name",value:i.replace(e.ext||"",""),onChange:T=>l(T.target.value)}),(0,A.jsx)(Ct,{align:"inline-end",className:"pr-1",children:(0,A.jsx)(yt,{className:"font-bold bg-gray-200 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)(Oe,{htmlFor:"description",children:"Description"}),(0,A.jsx)(We,{id:"description",value:c,onChange:T=>s(T.target.value),placeholder:"Add a description",rows:3})]})]})]});return(0,A.jsx)(ut,{title:"Details",open:!0,onClose:t,previewSection:p,metadataSection:y,footer:(0,A.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,A.jsx)(C,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:o,children:"Cancel"}),(0,A.jsxs)(C,{className:"w-full md:w-auto",onClick:f,radius:"full",disabled:o,children:[o&&(0,A.jsx)(mn.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})]})})}var Ke=require("react/jsx-runtime");function fn({className:e}){let{fileDetailsModalFile:t,setFileDetailsModalFile:a,updateFileMetadata:o}=O(),r=()=>{a(null)},i=async c=>{t&&await o(t.id,c)},l=()=>{if(!t)return null;switch(je(t.mime,t.ext)){case X.IMAGE:return(0,Ke.jsx)(nn,{file:t,onClose:r,onSave:i});case X.VIDEO:return(0,Ke.jsx)(sn,{file:t,onClose:r,onSave:i});case X.AUDIO:return(0,Ke.jsx)(pn,{file:t,onClose:r,onSave:i});case X.FILE:default:return(0,Ke.jsx)(un,{file:t,onClose:r,onSave:i})}};return(0,Ke.jsxs)("div",{className:x("",e),children:[(0,Ke.jsx)(jr,{}),(0,Ke.jsx)(Wr,{}),(0,Ke.jsx)(Yr,{}),l()]})}var Eo=require("react/jsx-runtime");function Oi(a){var o=a,{children:e}=o,t=g(o,["children"]);return(0,Eo.jsx)(ia,d(n({mode:oe.PAGE,selectionMode:Le.MULTIPLE},t),{children:e}))}function Gi(c){var s=c,{children:e,fileSelectionMode:t=Le.SINGLE,acceptedFileTypes:a,viewMode:o="grid",onFilesSelected:r,onClose:i}=s,l=g(s,["children","fileSelectionMode","acceptedFileTypes","viewMode","onFilesSelected","onClose"]);return(0,Eo.jsx)(ia,d(n({mode:oe.MODAL,selectionMode:t,acceptedFileTypesForModal:a||l.allowedFileTypes,viewMode:o,onFilesSelected:r,onClose:i},l),{children:e}))}var et={Page:Oi,Modal:Gi,Header:ur,Footer:mr,Overlays:fn};var ee=require("react/jsx-runtime");function gn(){let{setIsMoveFileModalOpen:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",radius:"full",onClick:()=>e(!0),className:"text-md font-medium bg-white hover:bg-blue-50 hover:text-blue-600 hover:border-blue-200 border-gray-200 shadow-sm",children:[(0,ee.jsx)(pa,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden sm:inline",children:"Move"})]})}function hn(){let{bulkDelete:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",radius:"full",onClick:e,className:"text-md font-medium bg-white hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 shadow-sm",children:[(0,ee.jsx)(Ze,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden",children:"Delete"})]})}function vn(){let{handleClearSelection:e}=O();return(0,ee.jsxs)(C,{variant:"outline",size:"lg",onClick:e,className:"rounded-full text-md font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 hover:font-bold hover:border-blue-200 transition-all duration-200",children:[(0,ee.jsx)(ve,{className:"size-5 text-blue-600"}),"Clear"]})}function xn(){let{selectedFiles:e,selectedFolders:t}=O();return e.length+t.length===0?null:(0,ee.jsx)("div",{className:"w-full",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(gn,{}),(0,ee.jsx)(hn,{})]}),(0,ee.jsx)(vn,{})]})})}function bn({className:e}){let{selectedFiles:t,selectedFolders:a}=O();return t.length+a.length===0?null:(0,ee.jsx)("div",{className:`fixed bottom-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-sm border-t border-gray-200 shadow-lg ${e||""}`,children:(0,ee.jsx)("div",{className:"px-4 sm:px-6 py-3 mx-auto",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(gn,{}),(0,ee.jsx)(hn,{})]}),(0,ee.jsx)(vn,{})]})})})}var wn=require("react/jsx-runtime");function Ao(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,wn.jsx)("div",n({"data-slot":"skeleton",className:x("animate-pulse rounded-md bg-accent",e)},t))}var Cn=require("next/navigation"),be=require("react/jsx-runtime");function no(){let{currentFolder:e,handleFolderClick:t,isLoading:a}=O(),o=(0,Cn.useRouter)(),r=()=>{o.back()};return a?(0,be.jsxs)("div",{className:"flex item-center w-full",children:[(0,be.jsx)(Ao,{className:"rounded-full size-10 mr-2 shrink-0"}),(0,be.jsx)(Ao,{className:"min-w-32 rounded-md h-full"})]}):(0,be.jsx)(be.Fragment,{children:e?(0,be.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,be.jsx)(C,{variant:"outline",size:"icon",radius:"full",disabled:a,className:"border-gray-200 bg-white mr-2",onClick:r,children:(0,be.jsx)(Gt,{className:"size-5",strokeWidth:"1",stroke:"black"})}),(0,be.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:$e(e.name,20)})]}):(0,be.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,be.jsx)(C,{className:"mr-2 shrink-0",radius:"full",variant:"ghost",mode:"icon",size:"icon",onClick:()=>t(null),children:(0,be.jsx)($a,{className:"size-6"})}),(0,be.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:"Home"})]})})}var Zo=require("lucide-react");var _o=require("lucide-react"),_t=require("radix-ui");var Mt=require("react/jsx-runtime");function wa(t){var e=g(t,[]);return(0,Mt.jsx)(_t.DropdownMenu.Root,n({"data-slot":"dropdown-menu"},e))}function Ca(t){var e=g(t,[]);return(0,Mt.jsx)(_t.DropdownMenu.Trigger,n({className:"select-none","data-slot":"dropdown-menu-trigger"},e))}function ya(o){var r=o,{className:e,sideOffset:t=4}=r,a=g(r,["className","sideOffset"]);return(0,Mt.jsx)(_t.DropdownMenu.Portal,{children:(0,Mt.jsx)(_t.DropdownMenu.Content,n({"data-slot":"dropdown-menu-content",sideOffset:t,className:x("space-y-0.5 z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md shadow-black/5 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",e)},a))})}function tt(r){var i=r,{className:e,inset:t,variant:a}=i,o=g(i,["className","inset","variant"]);return(0,Mt.jsx)(_t.DropdownMenu.Item,n({"data-slot":"dropdown-menu-item",className:x("text-foreground relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0","focus:bg-accent focus:text-foreground","data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",t&&"ps-8",a==="destructive"&&"text-destructive hover:text-destructive focus:text-destructive hover:bg-destructive/5 focus:bg-destructive/5 data-[active=true]:bg-destructive/5",e)},o))}function yn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Mt.jsx)(_t.DropdownMenu.Separator,n({"data-slot":"dropdown-menu-separator",className:x("-mx-2 my-1.5 h-px bg-muted",e)},t))}var at=require("react");var Lt=require("cmdk"),Lo=require("lucide-react");var Fe=require("react/jsx-runtime");function Bi(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command,n({className:x("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e)},t))}var Fn=r=>{var i=r,{children:e,className:t,shouldFilter:a}=i,o=g(i,["children","className","shouldFilter"]);return(0,Fe.jsx)(ze,d(n({},o),{children:(0,Fe.jsxs)(Te,{className:x("overflow-hidden p-0 shadow-lg",t),children:[(0,Fe.jsx)(Re,{className:"hidden"}),(0,Fe.jsx)(Bi,{shouldFilter:a,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})]})}))};function Mn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsxs)("div",{className:"flex items-center border-border border-b px-3","cmdk-input-wrapper":"","data-slot":"command-input",children:[(0,Fe.jsx)(Lo.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,Fe.jsx)(Lt.Command.Input,n({className:x("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)},t))]})}function Dn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.List,n({"data-slot":"command-list",className:x("max-h-[300px] overflow-y-auto overflow-x-hidden",e)},t))}function io(t){var e=g(t,[]);return(0,Fe.jsx)(Lt.Command.Empty,n({"data-slot":"command-empty",className:"py-6 text-center text-sm"},e))}function Vo(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.Group,n({"data-slot":"command-group",className:x("overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e)},t))}function Oo(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Fe.jsx)(Lt.Command.Item,n({"data-slot":"command-item",className:x("relative flex text-foreground cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0","[&_svg:not([role=img]):not([class*=text-])]:opacity-60",e)},t))}var lo=require("react");function so(e,t=500){let[a,o]=(0,lo.useState)(e);return(0,lo.useEffect)(()=>{let r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),a}var Nn=require("sonner");var H=require("react/jsx-runtime");function Go(){let[e,t]=(0,at.useState)(""),[a,o]=(0,at.useState)([]),[r,i]=(0,at.useState)([]),[l,c]=(0,at.useState)(!1),{provider:s,handleFolderClick:f,handleClearSelection:m,isSearchModalOpen:b,setIsSearchModalOpen:p,setFileDetailsModalFile:y}=O(),w=so(e,300),N=(0,at.useCallback)(async z=>{c(!0);try{let[T,h]=await Promise.all([s.findFiles(z),s.findFolders(z)]);o(T),i(h)}catch(T){let h=T instanceof Error?T.message:"Search failed";Nn.toast.error("Search Failed",{description:h}),o([]),i([])}finally{c(!1)}},[s]);return(0,at.useEffect)(()=>{b&&w.length>0?N(w):(o([]),i([]))},[w,b,N]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",onClick:()=>p(!0),children:[(0,H.jsx)(Ae,{className:"size-4 text-gray-700"}),(0,H.jsx)("span",{className:"hidden",children:"Search"})]}),(0,H.jsxs)(Fn,{className:"max-w-4xl w-full",open:b,onOpenChange:z=>{p(z),z||(t(""),o([]),i([]))},shouldFilter:!1,children:[(0,H.jsx)(Mn,{placeholder:"Type to search files or folders...",value:e,onValueChange:z=>{t(z)}}),(0,H.jsxs)(Dn,{children:[l&&(0,H.jsx)(io,{children:"Searching..."}),!l&&a.length===0&&r.length===0&&!e&&(0,H.jsx)(io,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Ae,{className:"size-12 text-gray-300 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"Search your files and folders"}),(0,H.jsx)("p",{className:"text-xs text-gray-500",children:"Start typing to find what you're looking for"}),(0,H.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:(0,H.jsx)(ea,{children:(0,H.jsxs)(Xt,{children:[(0,H.jsx)("span",{className:"text-lg",children:"\u2318"})," + K"]})})})]})}),!l&&a.length===0&&r.length===0&&e&&(0,H.jsx)(io,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Ae,{className:"size-12 text-gray-300 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"No results found"}),(0,H.jsx)("p",{className:"text-xs text-gray-500",children:"Try searching with different keywords"})]})}),r.length>0&&(0,H.jsx)(Vo,{heading:"Folders",children:r.map(z=>(0,H.jsxs)(Oo,{onSelect:()=>{m(),p(!1),f(z)},children:[(0,H.jsx)(Xe,{className:"size-4 mr-2 shrink-0",strokeWidth:1.5}),(0,H.jsx)("span",{children:$e(z.name,60)})]},z.id))}),a.length>0&&(0,H.jsx)(Vo,{heading:"Files",children:a.map(z=>{let{component:T}=ct(z);return(0,H.jsxs)(Oo,{onSelect:()=>{m(),y(z)},children:[(0,H.jsx)("div",{className:"size-6 mr-2 shrink-0 flex items-center justify-center",children:(0,H.jsx)(T,{file:z,metaData:z.metaData})}),(0,H.jsx)("span",{children:$e(z.name,60)})]},z.id)})})]})]})]})}var In=require("class-variance-authority"),co=require("lucide-react"),Bo=require("radix-ui");var oa=require("react/jsx-runtime"),Hi=(0,In.cva)(`
|
|
95
95
|
group peer bg-background shrink-0 rounded-md border border-input ring-offset-background focus-visible:outline-none
|
|
96
96
|
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
|
|
97
97
|
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
98
98
|
[[data-invalid=true]_&]:border-destructive/60 [[data-invalid=true]_&]:ring-destructive/10 dark:[[data-invalid=true]_&]:border-destructive dark:[[data-invalid=true]_&]:ring-destructive/20,
|
|
99
99
|
data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground
|
|
100
|
-
`,{variants:{size:{sm:"size-4.5 [&_svg]:size-3",md:"size-5 [&_svg]:size-3.5",lg:"size-5.5 [&_svg]:size-4"}},defaultVariants:{size:"md"}});function Fa(o){var r=o,{className:e,size:t}=r,a=g(r,["className","size"]);return(0,oa.jsx)(
|
|
100
|
+
`,{variants:{size:{sm:"size-4.5 [&_svg]:size-3",md:"size-5 [&_svg]:size-3.5",lg:"size-5.5 [&_svg]:size-4"}},defaultVariants:{size:"md"}});function Fa(o){var r=o,{className:e,size:t}=r,a=g(r,["className","size"]);return(0,oa.jsx)(Bo.Checkbox.Root,d(n({"data-slot":"checkbox",className:x(Hi({size:t}),e)},a),{children:(0,oa.jsxs)(Bo.Checkbox.Indicator,{className:x("flex items-center justify-center text-current"),children:[(0,oa.jsx)(co.Check,{className:"group-data-[state=indeterminate]:hidden"}),(0,oa.jsx)(co.Minus,{className:"hidden group-data-[state=indeterminate]:block"})]})}))}var ot=require("react/jsx-runtime");function Pn(){return(0,ot.jsx)(Go,{})}function Ho(){let{setIsUploadModalOpen:e}=O();return(0,ot.jsxs)(C,{variant:"outline",size:"md",radius:"full",className:"border-gray-200 bg-white text-md font-medium",onClick:()=>e(!0),children:[(0,ot.jsx)(St,{className:"size-5 text-gray-900",stroke:"black",strokeWidth:"1"}),(0,ot.jsx)("span",{className:"hidden sm:inline",children:"Upload File"})]})}function Uo(){let{setIsCreateFolderModalOpen:e}=O();return(0,ot.jsxs)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",onClick:()=>e(!0),children:[(0,ot.jsx)(kt,{className:"size-5 text-gray-900"}),(0,ot.jsx)("span",{className:"hidden",children:"Create Folder"})]})}var k=require("react/jsx-runtime");function kn(){let{setIsUploadModalOpen:e,setIsCreateFolderModalOpen:t,setIsSearchModalOpen:a}=O();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"hidden md:flex gap-2",children:[(0,k.jsx)(Ho,{}),(0,k.jsx)(Uo,{}),(0,k.jsx)(Pn,{})]}),(0,k.jsx)("div",{className:"flex md:hidden",children:(0,k.jsxs)(wa,{children:[(0,k.jsx)(Ca,{asChild:!0,children:(0,k.jsx)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",children:(0,k.jsx)(Zo.MoreHorizontal,{className:"size-5"})})}),(0,k.jsxs)(ya,{align:"end",className:"w-56 rounded-2xl shadow-xl bg-white/50 backdrop-blur-2xl border-gray-200",children:[(0,k.jsxs)(tt,{onClick:()=>e(!0),className:"cursor-pointer",children:[(0,k.jsx)(St,{className:"size-5 text-gray-900",stroke:"black",strokeWidth:"1"}),(0,k.jsx)("span",{className:"inline",children:"Upload File"})]}),(0,k.jsxs)(tt,{onClick:()=>t(!0),className:"cursor-pointer",children:[(0,k.jsx)(kt,{className:"size-5 text-gray-900"}),(0,k.jsx)("span",{className:"inline",children:"Create Folder"})]}),(0,k.jsxs)(tt,{onClick:()=>a(!0),className:"cursor-pointer",children:[(0,k.jsx)(Ae,{className:"size-5 text-gray-700"}),(0,k.jsx)("span",{className:"inline",children:"Search"})]})]})]})})]})}function Sn({onSearchClick:e}){let{setIsUploadModalOpen:t,setIsCreateFolderModalOpen:a}=O();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"hidden md:flex gap-2",children:[(0,k.jsx)(Ho,{}),(0,k.jsx)(Uo,{}),e?(0,k.jsxs)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",onClick:e,children:[(0,k.jsx)(Ae,{className:"size-5 text-gray-900"}),(0,k.jsx)("span",{className:"hidden",children:"Search"})]}):null]}),(0,k.jsx)("div",{className:"flex md:hidden",children:(0,k.jsxs)(wa,{children:[(0,k.jsx)(Ca,{asChild:!0,children:(0,k.jsx)(C,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 bg-white",children:(0,k.jsx)(Zo.MoreHorizontal,{className:"size-5"})})}),(0,k.jsxs)(ya,{align:"end",className:"w-48",children:[(0,k.jsxs)(tt,{onClick:()=>t(!0),className:"cursor-pointer",children:[(0,k.jsx)(St,{className:"size-5 text-gray-900",stroke:"black",strokeWidth:"1"}),(0,k.jsx)("span",{className:"inline",children:"Upload File"})]}),(0,k.jsxs)(tt,{onClick:()=>a(!0),className:"cursor-pointer",children:[(0,k.jsx)(kt,{className:"size-5 text-gray-900"}),(0,k.jsx)("span",{className:"inline",children:"Create Folder"})]}),e?(0,k.jsxs)(tt,{onClick:e,className:"cursor-pointer",children:[(0,k.jsx)(Ae,{className:"size-5 text-gray-700"}),(0,k.jsx)("span",{className:"inline",children:"Search"})]}):null]})]})})]})}var Vn=require("lucide-react");var _n=ka(require("react")),Ln=require("lucide-react");var ne=ka(require("@radix-ui/react-context-menu")),jo=require("lucide-react");var Dt=require("react/jsx-runtime");function zn(t){var e=g(t,[]);return(0,Dt.jsx)(ne.Root,n({"data-slot":"context-menu"},e))}function Tn(t){var e=g(t,[]);return(0,Dt.jsx)(ne.Trigger,n({"data-slot":"context-menu-trigger"},e))}function Rn(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Dt.jsx)(ne.Portal,{children:(0,Dt.jsx)(ne.Content,n({"data-slot":"context-menu-content",className:x("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e)},t))})}function En(r){var i=r,{className:e,inset:t,variant:a="default"}=i,o=g(i,["className","inset","variant"]);return(0,Dt.jsx)(ne.Item,n({"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:x("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e)},o))}function An(a){var o=a,{className:e}=o,t=g(o,["className"]);return(0,Dt.jsx)(ne.Separator,n({"data-slot":"context-menu-separator",className:x("bg-border -mx-1 my-1 h-px",e)},t))}var ye=require("react/jsx-runtime");function po({children:e,menuItems:t,isInSelectionMode:a=!1,mode:o}){let r=!a&&o!=="modal",i=(l=!1)=>t.map((c,s)=>{let f=s===t.length-1,m=c.variant==="destructive",b=l?tt:En,p=l?yn:An,y=s<t.length-1&&t[s+1].variant==="destructive";return(0,ye.jsxs)(_n.default.Fragment,{children:[(0,ye.jsxs)(b,{onClick:c.onClick,className:c.className||`text-sm font-medium ${m?"text-red-600 focus:text-red-700 focus:bg-red-50":""} ${s===0?"rounded-t-xl":""} ${f?"rounded-b-xl":""}`,children:[c.icon,c.label]}),y&&!f&&(0,ye.jsx)(p,{className:"bg-gray-200"})]},s)});return(0,ye.jsxs)(zn,{children:[(0,ye.jsx)(Tn,{children:(0,ye.jsxs)("div",{className:"relative w-full h-full",children:[e,r&&(0,ye.jsx)("div",{className:"absolute top-0 right-0 z-10 md:hidden",onClick:l=>l.stopPropagation(),children:(0,ye.jsxs)(wa,{children:[(0,ye.jsx)(Ca,{asChild:!0,children:(0,ye.jsx)(C,{variant:"ghost",size:"icon",radius:"full",className:"focus-visible:ring-0 focus-visible:ring-offset-0",children:(0,ye.jsx)(Ln.MoreVertical,{className:"size-4 text-gray-700"})})}),(0,ye.jsx)(ya,{className:"w-56 rounded-2xl shadow-xl bg-white/50 backdrop-blur-2xl border-gray-200",children:i(!0)})]})})]})}),r&&(0,ye.jsx)(Rn,{className:"w-56 rounded-2xl shadow-xl bg-white/50 backdrop-blur-2xl border-gray-200",children:i(!1)})]})}var $o=require("react/jsx-runtime");function Ma(e){return(0,$o.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"100",height:"100",viewBox:"0 0 72 72",fill:"currentColor"},e),{children:(0,$o.jsx)("path",{d:"M38.406 22.234l11.36 11.36L28.784 54.576l-12.876 4.307c-1.725.577-3.367-1.065-2.791-2.79l4.307-12.876L38.406 22.234zM41.234 19.406l5.234-5.234c1.562-1.562 4.095-1.562 5.657 0l5.703 5.703c1.562 1.562 1.562 4.095 0 5.657l-5.234 5.234L41.234 19.406z"})}))}var Wo=require("react/jsx-runtime");function Da(e){return(0,Wo.jsx)("svg",d(n({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:(0,Wo.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10m-5.97-3.03a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0",clipRule:"evenodd"})}))}var ie=require("react/jsx-runtime");function On({file:e,isSelected:t,onSelect:a,onDelete:o,onEdit:r,onMove:i,selectionMode:l,showCheckbox:c=!1,mode:s=oe.PAGE,isInSelectionMode:f=!1}){let m=h=>{h.stopPropagation(),confirm(`Are you sure you want to delete "${e.name}"?`)&&o(e.id)},b=h=>{h.stopPropagation(),r(e)},p=h=>{h.stopPropagation(),a(e,void 0,!0)},y=h=>{h.stopPropagation(),i(e)},w=h=>{a(e,h,!1)},N=h=>{a(e,void 0,!0)},M=h=>{h.stopPropagation()},{component:D,metadataComponent:z}=ct(e);return(0,ie.jsx)(po,{menuItems:[{label:"Edit",icon:(0,ie.jsx)(Ma,{className:"size-6"}),onClick:b},{label:"Select File",icon:(0,ie.jsx)(Da,{className:"size-6"}),onClick:p},{label:"Move to...",icon:(0,ie.jsx)(Vn.Move,{className:"size-4 mr-2"}),onClick:y},{label:"Delete",icon:(0,ie.jsx)(Ze,{className:"size-5 mr-2 text-red-600"}),onClick:m,variant:"destructive"}],isInSelectionMode:f,mode:s,children:(0,ie.jsxs)("div",{className:"group relative flex flex-col items-center justify-start transition-all duration-200 cursor-pointer w-full select-none",onDoubleClick:w,onClick:w,children:[(0,ie.jsxs)("div",{className:`
|
|
101
101
|
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-gray-200/60
|
|
102
102
|
${t?"bg-gray-200/60":""}
|
|
103
103
|
`,children:[(0,ie.jsx)("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:(0,ie.jsx)(D,{file:e,metaData:e.metaData})}),(l===Le.MULTIPLE||c)&&(0,ie.jsx)("div",{className:`absolute top-2 left-2 z-10 ${t?"opacity-100":"opacity-0 group-hover:opacity-100"} transition-opacity duration-200`,onClick:M,children:(0,ie.jsx)(Fa,{checked:t,onCheckedChange:N,className:"bg-white/90 border-gray-300 shadow-sm data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600 rounded-full h-5 w-5"})})]}),(0,ie.jsxs)("div",{className:"w-full text-center px-0.5 flex flex-col items-center",children:[(0,ie.jsx)("span",{className:`
|
|
104
104
|
text-[13px] font-medium leading-[1.3] tracking-tight line-clamp-2 px-2.5 py-[2px] rounded-[6px] transition-colors duration-100 wrap-break-word max-w-full
|
|
105
105
|
${t?"bg-[#2563EB] text-white antialiased shadow-sm":"text-[#374151] group-hover:text-black"}
|
|
106
|
-
`,children:e.name}),(0,ie.jsxs)("div",{className:`flex flex-col items-center justify-center gap-0.5 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:[(0,ie.jsx)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight",children:le(e.size)}),z?(0,ie.jsx)("div",{className:"text-[11px] text-gray-400 flex items-center scale-95",children:(0,ie.jsx)(z,{file:e})}):null]})]})]})})}var
|
|
106
|
+
`,children:e.name}),(0,ie.jsxs)("div",{className:`flex flex-col items-center justify-center gap-0.5 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:[(0,ie.jsx)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight",children:le(e.size)}),z?(0,ie.jsx)("div",{className:"text-[11px] text-gray-400 flex items-center scale-95",children:(0,ie.jsx)(z,{file:e})}):null]})]})]})})}var Gn=require("lucide-react");var me=require("react/jsx-runtime");function Bn({folder:e,isSelected:t,onSelect:a,onRightClick:o,onDelete:r,onRename:i,onMove:l,selectionMode:c,showCheckbox:s,mode:f,isInSelectionMode:m}){let b=T=>{T.stopPropagation(),confirm(`Are you sure you want to delete "${e.name}"?
|
|
107
107
|
|
|
108
|
-
\u26A0\uFE0F Warning: This will also delete all ${e.fileCount} file(s) inside this folder.`)&&r(e.id)},p=T=>{T.stopPropagation(),i(e)},y=T=>{T.stopPropagation(),l(e)},w=T=>{T.stopPropagation(),a(e,void 0,!0)},N=T=>{a(e,T,!1)},M=T=>{a(e,void 0,!0)},D=T=>{T.stopPropagation()};return(0,me.jsx)(po,{menuItems:[{label:"Rename",icon:(0,me.jsx)(Ma,{className:"size-6"}),onClick:p},{label:"Select Folder",icon:(0,me.jsx)(Da,{className:"size-6"}),onClick:w},{label:"Move to...",icon:(0,me.jsx)(
|
|
108
|
+
\u26A0\uFE0F Warning: This will also delete all ${e.fileCount} file(s) inside this folder.`)&&r(e.id)},p=T=>{T.stopPropagation(),i(e)},y=T=>{T.stopPropagation(),l(e)},w=T=>{T.stopPropagation(),a(e,void 0,!0)},N=T=>{a(e,T,!1)},M=T=>{a(e,void 0,!0)},D=T=>{T.stopPropagation()};return(0,me.jsx)(po,{menuItems:[{label:"Rename",icon:(0,me.jsx)(Ma,{className:"size-6"}),onClick:p},{label:"Select Folder",icon:(0,me.jsx)(Da,{className:"size-6"}),onClick:w},{label:"Move to...",icon:(0,me.jsx)(Gn.Move,{className:"size-5 mr-1"}),onClick:y},{label:"Delete",icon:(0,me.jsx)(Ze,{className:"size-5 mr-1 text-red-600"}),onClick:b,variant:"destructive"}],isInSelectionMode:m,mode:f,children:(0,me.jsxs)("div",{className:"group relative flex flex-col items-center justify-start transition-all duration-200 cursor-pointer w-full select-none",onDoubleClick:N,onClick:N,children:[(0,me.jsxs)("div",{className:`
|
|
109
109
|
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-gray-200/60
|
|
110
110
|
|
|
111
111
|
${t?"bg-gray-200/60 ":""}
|
|
112
112
|
`,children:[(0,me.jsx)("div",{className:"w-[75%] h-[75%] flex items-center justify-center transform ",children:(0,me.jsx)(Xe,{className:"w-full h-full text-blue-400 fill-blue-400/20 drop-shadow-sm",strokeWidth:1.5})}),(c===Le.MULTIPLE||s)&&(0,me.jsx)("div",{className:`absolute top-2 left-2 z-10 ${t?"opacity-100":"opacity-0 group-hover:opacity-100"} transition-opacity duration-200`,onClick:D,children:(0,me.jsx)(Fa,{checked:t,onCheckedChange:M,className:"bg-white/90 border-gray-300 shadow-sm data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600 rounded-full h-5 w-5"})})]}),(0,me.jsxs)("div",{className:"w-full text-center px-0.5 flex flex-col items-center",children:[(0,me.jsx)("span",{className:`
|
|
113
113
|
text-[13px] font-medium leading-[1.3] tracking-tight line-clamp-2 px-2.5 pb-[2px] rounded-[6px] transition-colors duration-100 break-words max-w-full
|
|
114
114
|
${t?"bg-[#2563EB] text-white antialiased shadow-sm":"text-[#374151] group-hover:text-black"}
|
|
115
|
-
`,children:e.name}),(0,me.jsx)("div",{className:`flex items-center justify-center gap-1 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:(0,me.jsxs)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight px-1.5 rounded-full",children:[e.fileCount," items"]})})]})]})})}var Ge=require("react/jsx-runtime");function mo(){let{files:e,folders:t,isLoading:a,handleFileClick:o,handleFolderClick:r,bulkDelete:i,mode:l,selectionMode:c,isInSelectionMode:s,selectedFiles:f,selectedFolders:m,currentFolder:b,setSelectedFiles:p,setSelectedFolders:y,setIsRenameFolderModalOpen:w,setIsMoveFileModalOpen:N,setFileDetailsModalFile:M,setFolderToRename:D}=O(),T=(()=>{if(!b)return 18;let h=b.folderCount||0,I=b.fileCount||0,Y=h+I;return Y>0?Y:18})();return a?(0,Ge.jsx)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:Array.from({length:T}).map((h,I)=>(0,Ge.jsxs)("div",{className:"flex flex-col items-center justify-start w-full gap-2",children:[(0,Ge.jsx)("div",{className:"w-full aspect-square bg-gray-100 rounded-2xl animate-pulse"}),(0,Ge.jsxs)("div",{className:"flex flex-col items-center gap-1 w-full",children:[(0,Ge.jsx)("div",{className:"h-4 w-20 bg-gray-100 rounded animate-pulse"}),(0,Ge.jsx)("div",{className:"h-3 w-12 bg-gray-100 rounded animate-pulse"})]})]},I))}):(0,Ge.jsxs)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:[t.map(h=>(0,Ge.jsx)(Gn,{folder:h,isSelected:m.some(I=>I.id===h.id),onSelect:r,onDelete:()=>i(),onRename:I=>{D(I),w(!0)},onMove:I=>{y([I]),p([]),N(!0)},selectionMode:c,mode:l,isInSelectionMode:s()},h.id)),e.map(h=>(0,Ge.jsx)(Vn,{file:h,isSelected:f.some(I=>I.id===h.id),onSelect:o,onDelete:()=>i(),onEdit:I=>{M(I)},onMove:I=>{p([I]),y([]),N(!0)},selectionMode:c,mode:l,isInSelectionMode:s()},h.id))]})}var Bn=require("react");var fo=require("lucide-react"),Me=require("react/jsx-runtime"),uo=class extends Bn.Component{constructor(a){super(a);this.handleReset=()=>{window.location.reload()};this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,o){console.error("FileManager Error Boundary caught an error:",a,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,Me.jsx)("div",{className:"flex items-center justify-center min-h-[400px] p-8 w-full h-full bg-slate-50/50 rounded-lg border border-dashed border-slate-200",children:(0,Me.jsxs)("div",{className:"text-center max-w-md flex flex-col items-center",children:[(0,Me.jsx)("div",{className:"bg-red-100 p-3 rounded-full mb-4",children:(0,Me.jsx)(fo.AlertCircle,{className:"size-8 text-red-600"})}),(0,Me.jsx)("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Something went wrong"}),(0,Me.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:"The file manager encountered an unexpected error. Refreshing the page usually resolves this issue."}),this.state.error&&(0,Me.jsxs)("details",{className:"mb-6 text-left w-full border border-slate-200 rounded-lg overflow-hidden flex-col group",children:[(0,Me.jsx)("summary",{className:"cursor-pointer text-xs font-mono bg-slate-100 p-2 text-slate-600 hover:bg-slate-200 transition-colors",children:"View Technical Details"}),(0,Me.jsx)("div",{className:"p-3 bg-white",children:(0,Me.jsx)("pre",{className:"text-[10px] text-slate-600 font-mono whitespace-pre-wrap word-break-all max-h-40 overflow-auto",children:this.state.error.toString()})})]}),(0,Me.jsxs)(C,{onClick:this.handleReset,radius:"full",className:"gap-2",children:[(0,Me.jsx)(fo.RefreshCw,{className:"size-4"}),"Reload Application"]})]})}):this.props.children}};var Hn=require("react");function Un(){let{handleSelectAllGlobal:e,handleClearSelection:t,getSelectionState:a,isCreateFolderModalOpen:o,setIsCreateFolderModalOpen:r,isUploadModalOpen:i,setIsUploadModalOpen:l,isSearchModalOpen:c,setIsSearchModalOpen:s}=O();return(0,Hn.useEffect)(()=>{let f=m=>{m.key==="k"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),s(!c)),m.key==="a"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),a()===!0?t():e(!0)),m.key==="f"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),r(!o)),m.key==="u"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),l(!i))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t,a,o,r,i,l,c,s]),null}var ye=require("react/jsx-runtime");function Zn(e){return(0,ye.jsx)(uo,{children:(0,ye.jsxs)(et.Page,d(n({},e),{children:[(0,ye.jsx)(Un,{}),(0,ye.jsxs)("div",{className:"flex h-full relative pb-12 overflow-hidden",children:[(0,ye.jsxs)("div",{className:"flex-1 flex w-full flex-col",children:[(0,ye.jsx)(et.Header,{children:(0,ye.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,ye.jsx)(no,{}),(0,ye.jsx)(Pn,{})]})}),(0,ye.jsx)(xn,{className:"-mb-1"}),(0,ye.jsx)(mo,{}),(0,ye.jsx)(et.Footer,{className:"pt-6 pb-10"})]}),(0,ye.jsx)(et.Overlays,{})]})]}))})}var Nt=require("react");var Z=require("react/jsx-runtime");function jn(o){var r=o,{open:e,onClose:t}=r,a=g(r,["open","onClose"]);return(0,Z.jsx)(et.Modal,d(n({},a),{onClose:t,children:(0,Z.jsx)(ze,{open:e,onOpenChange:t,children:(0,Z.jsx)(Ui,{onClose:t})})}))}function Ui({onClose:e}){let{updateSearchQuery:t}=O(),[a,o]=(0,Nt.useState)(!1),[r,i]=(0,Nt.useState)(""),l=(0,Nt.useRef)(null),c=so(r,300);return(0,Nt.useEffect)(()=>{t(c)},[c,t]),(0,Nt.useEffect)(()=>{a&&l.current&&l.current.focus()},[a]),(0,Z.jsxs)(Te,{className:"p-0",variant:"fullscreen",showCloseButton:!1,children:[(0,Z.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,Z.jsx)(Re,{className:"px-6 text-base",children:(0,Z.jsx)("div",{className:"flex w-full justify-between gap-2",children:a?(0,Z.jsxs)("div",{className:"flex items-center gap-4 flex-1",children:[(0,Z.jsx)(Ae,{className:"size-5 text-gray-500 shrink-0"}),(0,Z.jsx)(ta,{ref:l,type:"text",placeholder:"Search files and folders...",className:"border-none shadow-none focus-visible:ring-0 h-auto p-0 text-base font-semibold",value:r,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Escape"&&(i(""),t(""),o(!1))}}),(0,Z.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>{i(""),t(""),o(!1)},className:"border-gray-200 bg-white shrink-0",children:[(0,Z.jsx)(ve,{className:"size-5"}),(0,Z.jsx)("span",{className:"sr-only",children:"Cancel Search"})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(no,{}),(0,Z.jsx)(kn,{onSearchClick:()=>o(!0)}),(0,Z.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:e,className:"border-gray-200 bg-white",children:[(0,Z.jsx)(ve,{className:"size-5"}),(0,Z.jsx)("span",{className:"hidden",children:"Close"})]})]})})}),(0,Z.jsx)(lt,{className:"sr-only",children:"Browse and select files from your media library"})]}),(0,Z.jsxs)("div",{className:"overflow-y-auto flex-1 pb-4",children:[(0,Z.jsx)(mo,{}),(0,Z.jsx)(et.Footer,{className:"my-4"}),(0,Z.jsx)(et.Overlays,{})]}),(0,Z.jsx)(Zi,{onClose:e})]})}function Zi({onClose:e}){let{selectedFiles:t,onFilesSelected:a,setSelectedFiles:o,setSelectedFolders:r,updateSearchQuery:i,handlePageChange:l}=O();return(0,Z.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2",children:[(0,Z.jsx)(vn,{}),(0,Z.jsx)(qe,{asChild:!0,children:(0,Z.jsx)(C,{type:"button",variant:"outline",onClick:e,radius:"full",className:"w-full md:w-auto mr-0",children:"Cancel"})}),(0,Z.jsxs)(C,{type:"button",onClick:()=>{a&&t.length>0&&(a(t),o([]),r([]),i(""),l(1),e())},disabled:t.length===0,radius:"full",className:"w-full md:w-auto",children:["Select ",t.length>0?`(${t.length})`:""]})]})}var Ne=[{id:1,name:"Documents",pathId:1,path:"/1",parentId:null,fileCount:20,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:2,name:"Images",pathId:2,path:"/2",parentId:null,fileCount:10,folderCount:3,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:3,name:"Videos",pathId:3,path:"/3",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:4,name:"Music Some Long Name Streched also so long to fit in the card Music Some Long Name Streched also so long to fit in the card",pathId:4,path:"/4",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:5,name:"Archives",pathId:5,path:"/5",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:6,name:"Album 01",pathId:6,path:"/2/6",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:7,name:"Album 02",pathId:7,path:"/2/7",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:8,name:"Squirrels",pathId:8,path:"/2/8",parentId:2,fileCount:1,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")}],$n=[{id:1,name:"Important",color:"#ef4444"},{id:2,name:"Work",color:"#3b82f6"},{id:3,name:"Personal",color:"#10b981"},{id:4,name:"Project",color:"#8b5cf6"},{id:5,name:"Archive",color:"#6b7280"}],Ie=[{id:101,name:"welcome.pdf",url:"/placeholder.svg?height=400&width=300",size:245e3,createdAt:new Date("2024-05-15T10:00:00Z"),updatedAt:new Date("2024-05-15T10:00:00Z"),folderId:null,tags:["important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:2,author:"Admin"}},{id:102,name:"desktop_wallpaper.jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926",size:42e5,createdAt:new Date("2024-05-14T15:30:00Z"),updatedAt:new Date("2024-05-14T15:30:00Z"),folderId:null,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:5e3,height:3333,formats:{thumbnail:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=156",hash:"thumbnail_desktop_wallpaper_abc123",mime:"image/jpeg",name:"thumbnail_desktop_wallpaper.jpg",path:null,size:5.57,width:156,height:104},small:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=500",hash:"small_desktop_wallpaper_abc123",mime:"image/jpeg",name:"small_desktop_wallpaper.jpg",path:null,size:47.27,width:500,height:333},medium:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=750",hash:"medium_desktop_wallpaper_abc123",mime:"image/jpeg",name:"medium_desktop_wallpaper.jpg",path:null,size:97.89,width:750,height:500},large:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=1000",hash:"large_desktop_wallpaper_abc123",mime:"image/jpeg",name:"large_desktop_wallpaper.jpg",path:null,size:159.48,width:1e3,height:667}},metaData:{}},{id:103,name:"quick_notes.txt",url:"/placeholder.svg?height=400&width=300",size:3500,createdAt:new Date("2024-05-13T09:45:00Z"),updatedAt:new Date("2024-05-13T09:45:00Z"),folderId:null,tags:[],mime:"text/plain",ext:".txt",metaData:{}},{id:104,name:"intro_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:12e6,createdAt:new Date("2024-05-12T14:00:00Z"),updatedAt:new Date("2024-05-12T14:00:00Z"),folderId:null,tags:[],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:90,videoSource:"local"}},{id:105,name:"profile_photo.png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde",size:85e4,createdAt:new Date("2024-05-11T11:20:00Z"),updatedAt:new Date("2024-05-11T11:20:00Z"),folderId:null,tags:["personal"],mime:"image/png",ext:".png",width:2e3,height:2e3,formats:{thumbnail:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=156",hash:"thumbnail_profile_photo_def456",mime:"image/png",name:"thumbnail_profile_photo.png",path:null,size:8.2,width:156,height:156},small:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=500",hash:"small_profile_photo_def456",mime:"image/png",name:"small_profile_photo.png",path:null,size:52.3,width:500,height:500},medium:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=750",hash:"medium_profile_photo_def456",mime:"image/png",name:"medium_profile_photo.png",path:null,size:110.5,width:750,height:750},large:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=1000",hash:"large_profile_photo_def456",mime:"image/png",name:"large_profile_photo.png",path:null,size:185.7,width:1e3,height:1e3}},metaData:{}},{id:106,name:"todo_list.md",url:"/placeholder.svg?height=400&width=300",size:6200,createdAt:new Date("2024-05-10T08:30:00Z"),updatedAt:new Date("2024-05-10T08:30:00Z"),folderId:null,tags:["important"],mime:"text/markdown",ext:".md",metaData:{}},{id:107,name:"app_settings.json",url:"/placeholder.svg?height=400&width=300",size:4800,createdAt:new Date("2024-05-09T16:15:00Z"),updatedAt:new Date("2024-05-09T16:15:00Z"),folderId:null,tags:[],mime:"application/json",ext:".json",metaData:{}},{id:108,name:"mountain_landscape.webp",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:12e5,createdAt:new Date("2024-05-08T13:00:00Z"),updatedAt:new Date("2024-05-08T13:00:00Z"),folderId:null,tags:["personal"],mime:"image/webp",ext:".webp",width:4e3,height:2667,metaData:{}},{id:1,name:"Key-Monastery-img.avif",url:"https://unciatrails.com/wp-content/uploads/2024/07/Key-Monastery-img.avif",size:2621440,createdAt:new Date("2023-10-26T10:30:00Z"),updatedAt:new Date("2023-10-26T10:30:00Z"),folderId:8,tags:["personal","important"],mime:"image/avif",ext:".avif",caption:"A cute squirrel in the park",alternativeText:"Gray squirrel sitting on wooden fence",width:3024,height:4032,metaData:{}},{id:2,name:"project_proposal thoda sa.pdf",url:"/placeholder.svg?height=400&width=300",size:1048576,createdAt:new Date("2024-05-10T14:20:00Z"),updatedAt:new Date("2024-05-10T14:20:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:15,author:"John Doe"}},{id:3,name:"quarterly_report.xlsx",url:"/placeholder.svg?height=400&width=300",size:524288,createdAt:new Date("2024-05-08T09:15:00Z"),updatedAt:new Date("2024-05-08T09:15:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:10}},{id:4,name:"presentation.pptx",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:20}},{id:8,name:"documnet.doc",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/msword",ext:".doc",metaData:{pageCount:20}},{id:5,name:"demo_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:10485760,createdAt:new Date("2024-05-03T11:30:00Z"),updatedAt:new Date("2024-05-03T11:30:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:120,videoSource:"remote"}},{id:6,name:"podcast_episode.mp3",url:"/placeholder.svg?height=400&width=300",size:5242880,createdAt:new Date("2024-05-02T10:00:00Z"),updatedAt:new Date("2024-05-02T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:3600}},{id:7,name:"notes.txt",url:"/placeholder.svg?height=400&width=300",size:1024,createdAt:new Date("2024-05-01T09:00:00Z"),updatedAt:new Date("2024-05-01T09:00:00Z"),folderId:1,tags:["work"],mime:"text/plain",ext:".txt",metaData:{}},{id:9,name:"data.json",url:"/placeholder.svg?height=400&width=300",size:2048,createdAt:new Date("2024-04-30T15:00:00Z"),updatedAt:new Date("2024-04-30T15:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:10,name:"archive.zip",url:"/placeholder.svg?height=400&width=300",size:104857600,createdAt:new Date("2024-04-29T12:00:00Z"),updatedAt:new Date("2024-04-29T12:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Project backup"}},{id:11,name:"setup.exe",url:"/placeholder.svg?height=400&width=300",size:52428800,createdAt:new Date("2024-04-28T11:00:00Z"),updatedAt:new Date("2024-04-28T11:00:00Z"),folderId:5,tags:["software"],mime:"application/x-msdownload",ext:".exe",metaData:{description:"Installer"}},{id:12,name:"old_stuff.rar",url:"/placeholder.svg?height=400&width=300",size:20971520,createdAt:new Date("2024-04-27T10:00:00Z"),updatedAt:new Date("2024-04-27T10:00:00Z"),folderId:5,tags:["archive"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Old files"}},{id:13,name:"meeting_notes_q1.pdf",url:"/placeholder.svg?height=400&width=300",size:856e3,createdAt:new Date("2024-03-15T09:00:00Z"),updatedAt:new Date("2024-03-15T09:00:00Z"),folderId:1,tags:["work"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:8,author:"Sarah Johnson"}},{id:14,name:"budget_2024.xlsx",url:"/placeholder.svg?height=400&width=300",size:425e3,createdAt:new Date("2024-03-10T14:30:00Z"),updatedAt:new Date("2024-03-10T14:30:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:5}},{id:15,name:"team_photo.jpg",url:"https://images.unsplash.com/photo-1522071820081-009f0129c71c",size:32e5,createdAt:new Date("2024-02-28T11:00:00Z"),updatedAt:new Date("2024-02-28T11:00:00Z"),folderId:2,tags:["work"],mime:"image/jpeg",ext:".jpg",width:4e3,height:3e3,metaData:{}},{id:16,name:"logo_design.png",url:"https://images.unsplash.com/photo-1611162617474-5b21e879e113",size:15e5,createdAt:new Date("2024-02-20T10:00:00Z"),updatedAt:new Date("2024-02-20T10:00:00Z"),folderId:2,tags:["project"],mime:"image/png",ext:".png",width:2e3,height:2e3,metaData:{}},{id:17,name:"product_demo.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:15e6,createdAt:new Date("2024-02-15T16:00:00Z"),updatedAt:new Date("2024-02-15T16:00:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:180,videoSource:"local"}},{id:18,name:"training_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:25e6,createdAt:new Date("2024-02-10T09:30:00Z"),updatedAt:new Date("2024-02-10T09:30:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:300,videoSource:"local"}},{id:19,name:"background_music.mp3",url:"/placeholder.svg?height=400&width=300",size:45e5,createdAt:new Date("2024-02-05T14:00:00Z"),updatedAt:new Date("2024-02-05T14:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:240}},{id:20,name:"contract_template.docx",url:"/placeholder.svg?height=400&width=300",size:65e4,createdAt:new Date("2024-01-30T11:00:00Z"),updatedAt:new Date("2024-01-30T11:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:12}},{id:21,name:"invoice_jan.pdf",url:"/placeholder.svg?height=400&width=300",size:32e4,createdAt:new Date("2024-01-25T10:00:00Z"),updatedAt:new Date("2024-01-25T10:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:3}},{id:22,name:"vacation_photo1.jpg",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:28e5,createdAt:new Date("2024-01-20T15:00:00Z"),updatedAt:new Date("2024-01-20T15:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:3500,height:2500,metaData:{}},{id:23,name:"vacation_photo2.jpg",url:"https://images.unsplash.com/photo-1469474968028-56623f02e42e",size:31e5,createdAt:new Date("2024-01-20T15:05:00Z"),updatedAt:new Date("2024-01-20T15:05:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2800,metaData:{}},{id:24,name:"project_backup.zip",url:"/placeholder.svg?height=400&width=300",size:85e6,createdAt:new Date("2024-01-15T12:00:00Z"),updatedAt:new Date("2024-01-15T12:00:00Z"),folderId:5,tags:["archive","project"],mime:"application/zip",ext:".zip",metaData:{description:"Full project backup"}},{id:25,name:"presentation_final.pptx",url:"/placeholder.svg?height=400&width=300",size:35e5,createdAt:new Date("2024-01-10T16:00:00Z"),updatedAt:new Date("2024-01-10T16:00:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:35}},{id:26,name:"screenshot_001.png",url:"https://images.unsplash.com/photo-1517694712202-14dd9538aa97",size:12e5,createdAt:new Date("2024-01-05T09:00:00Z"),updatedAt:new Date("2024-01-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/png",ext:".png",width:1920,height:1080,metaData:{}},{id:27,name:"config.json",url:"/placeholder.svg?height=400&width=300",size:5e3,createdAt:new Date("2023-12-28T14:00:00Z"),updatedAt:new Date("2023-12-28T14:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:28,name:"readme.md",url:"/placeholder.svg?height=400&width=300",size:8500,createdAt:new Date("2023-12-20T10:00:00Z"),updatedAt:new Date("2023-12-20T10:00:00Z"),folderId:1,tags:["project"],mime:"text/markdown",ext:".md",metaData:{}},{id:29,name:"database_backup.sql",url:"/placeholder.svg?height=400&width=300",size:12e6,createdAt:new Date("2023-12-15T11:00:00Z"),updatedAt:new Date("2023-12-15T11:00:00Z"),folderId:5,tags:["archive","important"],mime:"application/sql",ext:".sql",metaData:{description:"Database backup"}},{id:30,name:"tutorial_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:18e6,createdAt:new Date("2023-12-10T13:00:00Z"),updatedAt:new Date("2023-12-10T13:00:00Z"),folderId:3,tags:["personal"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:420,videoSource:"local"}},{id:31,name:"company_logo.svg",url:"/placeholder.svg?height=400&width=300",size:45e3,createdAt:new Date("2023-12-05T09:00:00Z"),updatedAt:new Date("2023-12-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/svg+xml",ext:".svg",metaData:{}},{id:32,name:"report_q4.pdf",url:"/placeholder.svg?height=400&width=300",size:18e5,createdAt:new Date("2023-12-01T15:00:00Z"),updatedAt:new Date("2023-12-01T15:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:25,author:"Finance Team"}},{id:33,name:"nature_photo.webp",url:"https://images.unsplash.com/photo-1441974231531-c6227db76b6e",size:95e4,createdAt:new Date("2023-11-25T12:00:00Z"),updatedAt:new Date("2023-11-25T12:00:00Z"),folderId:2,tags:["personal"],mime:"image/webp",ext:".webp",width:3e3,height:2e3,metaData:{}},{id:34,name:"podcast_intro.mp3",url:"/placeholder.svg?height=400&width=300",size:25e5,createdAt:new Date("2023-11-20T10:00:00Z"),updatedAt:new Date("2023-11-20T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:180}},{id:35,name:"data_export.csv",url:"/placeholder.svg?height=400&width=300",size:85e4,createdAt:new Date("2023-11-15T14:00:00Z"),updatedAt:new Date("2023-11-15T14:00:00Z"),folderId:1,tags:["work"],mime:"text/csv",ext:".csv",metaData:{}},{id:36,name:"wireframes.pdf",url:"/placeholder.svg?height=400&width=300",size:42e5,createdAt:new Date("2023-11-10T11:00:00Z"),updatedAt:new Date("2023-11-10T11:00:00Z"),folderId:1,tags:["project"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:45}},{id:37,name:"cityscape.jpg",url:"https://images.unsplash.com/photo-1449824913935-59a10b8d2000",size:38e5,createdAt:new Date("2023-11-05T16:00:00Z"),updatedAt:new Date("2023-11-05T16:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4500,height:3e3,metaData:{}},{id:38,name:"interview_recording.mp3",url:"/placeholder.svg?height=400&width=300",size:85e5,createdAt:new Date("2023-11-01T09:00:00Z"),updatedAt:new Date("2023-11-01T09:00:00Z"),folderId:4,tags:["work"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:1800}},{id:39,name:"client_files.rar",url:"/placeholder.svg?height=400&width=300",size:45e6,createdAt:new Date("2023-10-25T13:00:00Z"),updatedAt:new Date("2023-10-25T13:00:00Z"),folderId:5,tags:["archive","work"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Client deliverables"}},{id:40,name:"marketing_plan.docx",url:"/placeholder.svg?height=400&width=300",size:12e5,createdAt:new Date("2023-10-20T10:00:00Z"),updatedAt:new Date("2023-10-20T10:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:18}},{id:41,name:"analytics_data.xlsx",url:"/placeholder.svg?height=400&width=300",size:21e5,createdAt:new Date("2023-10-15T15:00:00Z"),updatedAt:new Date("2023-10-15T15:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:8}},{id:42,name:"sunset_beach.jpg",url:"https://images.unsplash.com/photo-1507525428034-b723cf961d3e",size:32e5,createdAt:new Date("2023-10-10T17:00:00Z"),updatedAt:new Date("2023-10-10T17:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2700,metaData:{}},{id:43,name:"webinar_recording.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:35e6,createdAt:new Date("2023-10-05T14:00:00Z"),updatedAt:new Date("2023-10-05T14:00:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:600,videoSource:"local"}},{id:44,name:"sound_effects.wav",url:"/placeholder.svg?height=400&width=300",size:15e6,createdAt:new Date("2023-10-01T11:00:00Z"),updatedAt:new Date("2023-10-01T11:00:00Z"),folderId:4,tags:["project"],mime:"audio/wav",ext:".wav",metaData:{duration:120}},{id:45,name:"legacy_system.zip",url:"/placeholder.svg?height=400&width=300",size:125e6,createdAt:new Date("2023-09-25T09:00:00Z"),updatedAt:new Date("2023-09-25T09:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Old system files"}}];var Na=e=>new Promise(t=>setTimeout(t,e)),go=class{getFolder(t){if(t===null)return Promise.resolve(null);let a=Ne.find(i=>i.id===t);if(!a)return Promise.resolve(null);let o=n({},a),r=o;for(;r.parentId!==null;){let i=Ne.find(l=>l.id===r.parentId);if(i)r.parent=n({},i),r=r.parent;else break}return Promise.resolve(o)}async getFolders(t,a=1,o=20,r=""){await Na(300);let i=t!==null?Ne.filter(p=>p.parentId===t):Ne.filter(p=>p.parentId===null),l=i;if(r&&r.trim()){let p=r.toLowerCase().trim();l=i.filter(y=>y.name.toLowerCase().includes(p))}let c=l.sort((p,y)=>new Date(p.createdAt).getTime()-new Date(y.createdAt).getTime()),s=c.length,f=Math.ceil(s/o),m=(a-1)*o;return{folders:c.slice(m,m+o),pagination:{currentPage:a,totalPages:f,totalFiles:s,filesPerPage:o}}}getTags(){return Promise.resolve($n.map(t=>t.name))}async getFiles(t,a,o,r,i){await Na(500);let l=[...Ie];if(t!==null&&(l=l.filter(w=>w.folderId===t)),a&&a.length>0&&(l=l.filter(w=>{let N=je(w.mime,w.ext);return a.includes(N)})),i){let w=i==null?void 0:i.toLowerCase();l=l.filter(N=>N.name.toLowerCase().includes(w))}let c=l.sort((w,N)=>new Date(w.createdAt).getTime()-new Date(N.createdAt).getTime()),s=o!=null?o:1,f=r!=null?r:10,m=c.length,b=Math.ceil(m/f),p=(s-1)*f,y=c.slice(p,p+f);return Promise.resolve({files:y,pagination:{currentPage:s,totalPages:b,totalFiles:m,filesPerPage:f}})}async getItems(t,a,o=1,r=24,i=""){await Na(300);let l=t!==null?Ne.filter(h=>h.parentId===t):Ne.filter(h=>h.parentId===null),c=t!==null?Ie.filter(h=>h.folderId===t):Ie.filter(h=>h.folderId===null);if(a&&a.length>0&&(c=c.filter(h=>{let I=je(h.mime,h.ext);return a.includes(I)})),i&&i.trim()){let h=i.toLowerCase().trim();l=l.filter(I=>I.name.toLowerCase().includes(h)),c=c.filter(I=>{var Y,te;return I.name.toLowerCase().includes(h)||((te=(Y=I.ext)==null?void 0:Y.toLowerCase().includes(h))!=null?te:!1)})}let s=l.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),f=c.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),m=s.length+f.length,b=Math.ceil(m/r)||1,p=(o-1)*r,y=p+r,w=s.slice(Math.max(0,p),Math.min(s.length,y)),N=w.length,M=r-N,D=Math.min(s.length,p),z=Math.max(0,p-s.length),T=f.slice(z,z+M);return{folders:w,files:T,pagination:{currentPage:o,totalPages:b,totalFiles:m,filesPerPage:r}}}async createFolder(t,a){await Na(300);let o={id:Date.now(),name:t,parentId:a!=null?a:null,pathId:typeof a=="number"?a:0,path:"",fileCount:0,folderCount:0,createdAt:new Date,updatedAt:new Date};return Ne.push(o),o}getMetaDataType(t,a){return t.type.startsWith("image/")?{}:t.type.startsWith("video/")?{duration:0,videoSource:a!=null?a:vo.LOCAL}:t.type.startsWith("audio/")?{duration:0}:{description:""}}getFileType(t){var o;let a="."+((o=t.name.split(".").pop())==null?void 0:o.toLowerCase());return je(t.type,a)}async uploadFiles(t,a){var r;await Na(500);let o=[];for(let{file:i,videoSource:l}of t){let c=this.getFileType(i),s="."+((r=i.name.split(".").pop())==null?void 0:r.toLowerCase()),f={id:Date.now()+Math.random(),name:i.name,folderId:a!=null?a:null,size:i.size,url:URL.createObjectURL(i),mime:i.type||"application/octet-stream",ext:s,metaData:this.getMetaDataType(i,l),createdAt:new Date,updatedAt:new Date,tags:[],width:c===X.IMAGE?800:void 0,height:c===X.IMAGE?600:void 0};Ie.push(f),o.push(f)}return o}renameFolder(t,a){let o=Ne.find(r=>r.id===t);return o?(o.name=a,o.updatedAt=new Date,Promise.resolve(o)):Promise.reject(new Error("Folder not found"))}updateFileMetaData(t,a){let o=Ie.find(c=>c.id===t);if(!o)return Promise.reject(new Error("File not found"));let l=a,{metaData:r}=l,i=g(l,["metaData"]);return Object.assign(o,i),r&&(o.metaData=n(n({},o.metaData),r)),o.updatedAt=new Date,Promise.resolve(o)}deleteFiles(t){for(let a of t){let o=Ie.findIndex(r=>r.id===a);o!==-1&&Ie.splice(o,1)}return Promise.resolve()}deleteFolders(t){for(let a of t){let o=Ne.findIndex(r=>r.id===a);if(o!==-1){Ne.splice(o,1);for(let r=Ie.length-1;r>=0;r--)Ie[r].folderId===a&&Ie.splice(r,1)}}return Promise.resolve()}findFiles(t){let a=t==null?void 0:t.toLowerCase(),o=Ie.filter(r=>{var i;return r.name.toLowerCase().includes(a)||((i=r.tags)==null?void 0:i.some(l=>l.toLowerCase().includes(a)))});return Promise.resolve(o)}findFolders(t){let a=t==null?void 0:t.toLowerCase(),o=Ne.filter(r=>r.name.toLowerCase().includes(a));return Promise.resolve(o)}moveFiles(t,a){let o=[];for(let r of t){let i=Ie.find(l=>l.id===r);i&&(i.folderId=a,i.updatedAt=new Date,o.push(i))}return Promise.resolve(o)}moveFolders(t,a){let o=[];for(let r of t){let i=Ne.find(l=>l.id===r);i&&(i.parentId=a,i.updatedAt=new Date,o.push(i))}return Promise.resolve(o)}};0&&(module.exports={FileManager,FileManagerModal,FileManagerProvider,MockProvider,useFileManager});
|
|
115
|
+
`,children:e.name}),(0,me.jsx)("div",{className:`flex items-center justify-center gap-1 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:(0,me.jsxs)("span",{className:"text-[11px] text-blue-600 font-medium tracking-tight px-1.5 rounded-full",children:[e.fileCount," items"]})})]})]})})}var Ge=require("react/jsx-runtime");function mo(){let{files:e,folders:t,isLoading:a,handleFileClick:o,handleFolderClick:r,bulkDelete:i,mode:l,selectionMode:c,isInSelectionMode:s,selectedFiles:f,selectedFolders:m,currentFolder:b,setSelectedFiles:p,setSelectedFolders:y,setIsRenameFolderModalOpen:w,setIsMoveFileModalOpen:N,setFileDetailsModalFile:M,setFolderToRename:D}=O(),T=(()=>{if(!b)return 18;let h=b.folderCount||0,I=b.fileCount||0,Y=h+I;return Y>0?Y:18})();return a?(0,Ge.jsx)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:Array.from({length:T}).map((h,I)=>(0,Ge.jsxs)("div",{className:"flex flex-col items-center justify-start w-full gap-2",children:[(0,Ge.jsx)("div",{className:"w-full aspect-square bg-gray-100 rounded-2xl animate-pulse"}),(0,Ge.jsxs)("div",{className:"flex flex-col items-center gap-1 w-full",children:[(0,Ge.jsx)("div",{className:"h-4 w-20 bg-gray-100 rounded animate-pulse"}),(0,Ge.jsx)("div",{className:"h-3 w-12 bg-gray-100 rounded animate-pulse"})]})]},I))}):(0,Ge.jsxs)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:[t.map(h=>(0,Ge.jsx)(Bn,{folder:h,isSelected:m.some(I=>I.id===h.id),onSelect:r,onDelete:()=>i(),onRename:I=>{D(I),w(!0)},onMove:I=>{y([I]),p([]),N(!0)},selectionMode:c,mode:l,isInSelectionMode:s()},h.id)),e.map(h=>(0,Ge.jsx)(On,{file:h,isSelected:f.some(I=>I.id===h.id),onSelect:o,onDelete:()=>i(),onEdit:I=>{M(I)},onMove:I=>{p([I]),y([]),N(!0)},selectionMode:c,mode:l,isInSelectionMode:s()},h.id))]})}var Hn=require("react");var fo=require("lucide-react"),Me=require("react/jsx-runtime"),uo=class extends Hn.Component{constructor(a){super(a);this.handleReset=()=>{window.location.reload()};this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,o){console.error("FileManager Error Boundary caught an error:",a,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,Me.jsx)("div",{className:"flex items-center justify-center min-h-[400px] p-8 w-full h-full bg-slate-50/50 rounded-lg border border-dashed border-slate-200",children:(0,Me.jsxs)("div",{className:"text-center max-w-md flex flex-col items-center",children:[(0,Me.jsx)("div",{className:"bg-red-100 p-3 rounded-full mb-4",children:(0,Me.jsx)(fo.AlertCircle,{className:"size-8 text-red-600"})}),(0,Me.jsx)("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Something went wrong"}),(0,Me.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:"The file manager encountered an unexpected error. Refreshing the page usually resolves this issue."}),this.state.error&&(0,Me.jsxs)("details",{className:"mb-6 text-left w-full border border-slate-200 rounded-lg overflow-hidden flex-col group",children:[(0,Me.jsx)("summary",{className:"cursor-pointer text-xs font-mono bg-slate-100 p-2 text-slate-600 hover:bg-slate-200 transition-colors",children:"View Technical Details"}),(0,Me.jsx)("div",{className:"p-3 bg-white",children:(0,Me.jsx)("pre",{className:"text-[10px] text-slate-600 font-mono whitespace-pre-wrap word-break-all max-h-40 overflow-auto",children:this.state.error.toString()})})]}),(0,Me.jsxs)(C,{onClick:this.handleReset,radius:"full",className:"gap-2",children:[(0,Me.jsx)(fo.RefreshCw,{className:"size-4"}),"Reload Application"]})]})}):this.props.children}};var Un=require("react");function Zn(){let{handleSelectAllGlobal:e,handleClearSelection:t,getSelectionState:a,isCreateFolderModalOpen:o,setIsCreateFolderModalOpen:r,isUploadModalOpen:i,setIsUploadModalOpen:l,isSearchModalOpen:c,setIsSearchModalOpen:s}=O();return(0,Un.useEffect)(()=>{let f=m=>{m.key==="k"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),s(!c)),m.key==="a"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),a()===!0?t():e(!0)),m.key==="f"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),r(!o)),m.key==="u"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),l(!i))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t,a,o,r,i,l,c,s]),null}var we=require("react/jsx-runtime");function jn(e){return(0,we.jsx)(uo,{children:(0,we.jsxs)(et.Page,d(n({},e),{children:[(0,we.jsx)(Zn,{}),(0,we.jsxs)("div",{className:"flex h-full relative overflow-hidden",children:[(0,we.jsxs)("div",{className:"flex-1 flex w-full flex-col min-h-0",children:[(0,we.jsx)(et.Header,{children:(0,we.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,we.jsx)(no,{}),(0,we.jsx)(kn,{})]})}),(0,we.jsx)(bn,{className:"-mb-1"}),(0,we.jsxs)("div",{className:"flex-1 overflow-y-auto pb-12",children:[(0,we.jsx)(mo,{}),(0,we.jsx)(et.Footer,{className:"pt-6 pb-10"})]})]}),(0,we.jsx)(et.Overlays,{})]})]}))})}var Nt=require("react");var Z=require("react/jsx-runtime");function $n(o){var r=o,{open:e,onClose:t}=r,a=g(r,["open","onClose"]);return(0,Z.jsx)(et.Modal,d(n({},a),{onClose:t,children:(0,Z.jsx)(ze,{open:e,onOpenChange:t,children:(0,Z.jsx)(Ui,{onClose:t})})}))}function Ui({onClose:e}){let{updateSearchQuery:t}=O(),[a,o]=(0,Nt.useState)(!1),[r,i]=(0,Nt.useState)(""),l=(0,Nt.useRef)(null),c=so(r,300);return(0,Nt.useEffect)(()=>{t(c)},[c,t]),(0,Nt.useEffect)(()=>{a&&l.current&&l.current.focus()},[a]),(0,Z.jsxs)(Te,{className:"p-0",variant:"fullscreen",showCloseButton:!1,children:[(0,Z.jsxs)(Be,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,Z.jsx)(Re,{className:"px-6 text-base",children:(0,Z.jsx)("div",{className:"flex w-full justify-between gap-2",children:a?(0,Z.jsxs)("div",{className:"flex items-center gap-4 flex-1",children:[(0,Z.jsx)(Ae,{className:"size-5 text-gray-500 shrink-0"}),(0,Z.jsx)(ta,{ref:l,type:"text",placeholder:"Search files and folders...",className:"border-none shadow-none focus-visible:ring-0 h-auto p-0 text-base font-semibold",value:r,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Escape"&&(i(""),t(""),o(!1))}}),(0,Z.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:()=>{i(""),t(""),o(!1)},className:"border-gray-200 bg-white shrink-0",children:[(0,Z.jsx)(ve,{className:"size-5"}),(0,Z.jsx)("span",{className:"sr-only",children:"Cancel Search"})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(no,{}),(0,Z.jsx)(Sn,{onSearchClick:()=>o(!0)}),(0,Z.jsxs)(C,{variant:"outline",size:"icon",radius:"full",onClick:e,className:"border-gray-200 bg-white",children:[(0,Z.jsx)(ve,{className:"size-5"}),(0,Z.jsx)("span",{className:"hidden",children:"Close"})]})]})})}),(0,Z.jsx)(lt,{className:"sr-only",children:"Browse and select files from your media library"})]}),(0,Z.jsxs)("div",{className:"overflow-y-auto flex-1 pb-4",children:[(0,Z.jsx)(mo,{}),(0,Z.jsx)(et.Footer,{className:"my-4"}),(0,Z.jsx)(et.Overlays,{})]}),(0,Z.jsx)(Zi,{onClose:e})]})}function Zi({onClose:e}){let{selectedFiles:t,onFilesSelected:a,setSelectedFiles:o,setSelectedFolders:r,updateSearchQuery:i,handlePageChange:l}=O();return(0,Z.jsxs)(He,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2",children:[(0,Z.jsx)(xn,{}),(0,Z.jsx)(qe,{asChild:!0,children:(0,Z.jsx)(C,{type:"button",variant:"outline",onClick:e,radius:"full",className:"w-full md:w-auto mr-0",children:"Cancel"})}),(0,Z.jsxs)(C,{type:"button",onClick:()=>{a&&t.length>0&&(a(t),o([]),r([]),i(""),l(1),e())},disabled:t.length===0,radius:"full",className:"w-full md:w-auto",children:["Select ",t.length>0?`(${t.length})`:""]})]})}var Ie=[{id:1,name:"Documents",pathId:1,path:"/1",parentId:null,fileCount:20,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:2,name:"Images",pathId:2,path:"/2",parentId:null,fileCount:10,folderCount:3,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:3,name:"Videos",pathId:3,path:"/3",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:4,name:"Music Some Long Name Streched also so long to fit in the card Music Some Long Name Streched also so long to fit in the card",pathId:4,path:"/4",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:5,name:"Archives",pathId:5,path:"/5",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:6,name:"Album 01",pathId:6,path:"/2/6",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:7,name:"Album 02",pathId:7,path:"/2/7",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:8,name:"Squirrels",pathId:8,path:"/2/8",parentId:2,fileCount:1,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")}],Wn=[{id:1,name:"Important",color:"#ef4444"},{id:2,name:"Work",color:"#3b82f6"},{id:3,name:"Personal",color:"#10b981"},{id:4,name:"Project",color:"#8b5cf6"},{id:5,name:"Archive",color:"#6b7280"}],Pe=[{id:101,name:"welcome.pdf",url:"/placeholder.svg?height=400&width=300",size:245e3,createdAt:new Date("2024-05-15T10:00:00Z"),updatedAt:new Date("2024-05-15T10:00:00Z"),folderId:null,tags:["important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:2,author:"Admin"}},{id:102,name:"desktop_wallpaper.jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926",size:42e5,createdAt:new Date("2024-05-14T15:30:00Z"),updatedAt:new Date("2024-05-14T15:30:00Z"),folderId:null,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:5e3,height:3333,formats:{thumbnail:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=156",hash:"thumbnail_desktop_wallpaper_abc123",mime:"image/jpeg",name:"thumbnail_desktop_wallpaper.jpg",path:null,size:5.57,width:156,height:104},small:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=500",hash:"small_desktop_wallpaper_abc123",mime:"image/jpeg",name:"small_desktop_wallpaper.jpg",path:null,size:47.27,width:500,height:333},medium:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=750",hash:"medium_desktop_wallpaper_abc123",mime:"image/jpeg",name:"medium_desktop_wallpaper.jpg",path:null,size:97.89,width:750,height:500},large:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=1000",hash:"large_desktop_wallpaper_abc123",mime:"image/jpeg",name:"large_desktop_wallpaper.jpg",path:null,size:159.48,width:1e3,height:667}},metaData:{}},{id:103,name:"quick_notes.txt",url:"/placeholder.svg?height=400&width=300",size:3500,createdAt:new Date("2024-05-13T09:45:00Z"),updatedAt:new Date("2024-05-13T09:45:00Z"),folderId:null,tags:[],mime:"text/plain",ext:".txt",metaData:{}},{id:104,name:"intro_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:12e6,createdAt:new Date("2024-05-12T14:00:00Z"),updatedAt:new Date("2024-05-12T14:00:00Z"),folderId:null,tags:[],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:90,videoSource:"local"}},{id:105,name:"profile_photo.png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde",size:85e4,createdAt:new Date("2024-05-11T11:20:00Z"),updatedAt:new Date("2024-05-11T11:20:00Z"),folderId:null,tags:["personal"],mime:"image/png",ext:".png",width:2e3,height:2e3,formats:{thumbnail:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=156",hash:"thumbnail_profile_photo_def456",mime:"image/png",name:"thumbnail_profile_photo.png",path:null,size:8.2,width:156,height:156},small:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=500",hash:"small_profile_photo_def456",mime:"image/png",name:"small_profile_photo.png",path:null,size:52.3,width:500,height:500},medium:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=750",hash:"medium_profile_photo_def456",mime:"image/png",name:"medium_profile_photo.png",path:null,size:110.5,width:750,height:750},large:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=1000",hash:"large_profile_photo_def456",mime:"image/png",name:"large_profile_photo.png",path:null,size:185.7,width:1e3,height:1e3}},metaData:{}},{id:106,name:"todo_list.md",url:"/placeholder.svg?height=400&width=300",size:6200,createdAt:new Date("2024-05-10T08:30:00Z"),updatedAt:new Date("2024-05-10T08:30:00Z"),folderId:null,tags:["important"],mime:"text/markdown",ext:".md",metaData:{}},{id:107,name:"app_settings.json",url:"/placeholder.svg?height=400&width=300",size:4800,createdAt:new Date("2024-05-09T16:15:00Z"),updatedAt:new Date("2024-05-09T16:15:00Z"),folderId:null,tags:[],mime:"application/json",ext:".json",metaData:{}},{id:108,name:"mountain_landscape.webp",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:12e5,createdAt:new Date("2024-05-08T13:00:00Z"),updatedAt:new Date("2024-05-08T13:00:00Z"),folderId:null,tags:["personal"],mime:"image/webp",ext:".webp",width:4e3,height:2667,metaData:{}},{id:1,name:"Key-Monastery-img.avif",url:"https://unciatrails.com/wp-content/uploads/2024/07/Key-Monastery-img.avif",size:2621440,createdAt:new Date("2023-10-26T10:30:00Z"),updatedAt:new Date("2023-10-26T10:30:00Z"),folderId:8,tags:["personal","important"],mime:"image/avif",ext:".avif",caption:"A cute squirrel in the park",alternativeText:"Gray squirrel sitting on wooden fence",width:3024,height:4032,metaData:{}},{id:2,name:"project_proposal thoda sa.pdf",url:"/placeholder.svg?height=400&width=300",size:1048576,createdAt:new Date("2024-05-10T14:20:00Z"),updatedAt:new Date("2024-05-10T14:20:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:15,author:"John Doe"}},{id:3,name:"quarterly_report.xlsx",url:"/placeholder.svg?height=400&width=300",size:524288,createdAt:new Date("2024-05-08T09:15:00Z"),updatedAt:new Date("2024-05-08T09:15:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:10}},{id:4,name:"presentation.pptx",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:20}},{id:8,name:"documnet.doc",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/msword",ext:".doc",metaData:{pageCount:20}},{id:5,name:"demo_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:10485760,createdAt:new Date("2024-05-03T11:30:00Z"),updatedAt:new Date("2024-05-03T11:30:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:120,videoSource:"remote"}},{id:6,name:"podcast_episode.mp3",url:"/placeholder.svg?height=400&width=300",size:5242880,createdAt:new Date("2024-05-02T10:00:00Z"),updatedAt:new Date("2024-05-02T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:3600}},{id:7,name:"notes.txt",url:"/placeholder.svg?height=400&width=300",size:1024,createdAt:new Date("2024-05-01T09:00:00Z"),updatedAt:new Date("2024-05-01T09:00:00Z"),folderId:1,tags:["work"],mime:"text/plain",ext:".txt",metaData:{}},{id:9,name:"data.json",url:"/placeholder.svg?height=400&width=300",size:2048,createdAt:new Date("2024-04-30T15:00:00Z"),updatedAt:new Date("2024-04-30T15:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:10,name:"archive.zip",url:"/placeholder.svg?height=400&width=300",size:104857600,createdAt:new Date("2024-04-29T12:00:00Z"),updatedAt:new Date("2024-04-29T12:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Project backup"}},{id:11,name:"setup.exe",url:"/placeholder.svg?height=400&width=300",size:52428800,createdAt:new Date("2024-04-28T11:00:00Z"),updatedAt:new Date("2024-04-28T11:00:00Z"),folderId:5,tags:["software"],mime:"application/x-msdownload",ext:".exe",metaData:{description:"Installer"}},{id:12,name:"old_stuff.rar",url:"/placeholder.svg?height=400&width=300",size:20971520,createdAt:new Date("2024-04-27T10:00:00Z"),updatedAt:new Date("2024-04-27T10:00:00Z"),folderId:5,tags:["archive"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Old files"}},{id:13,name:"meeting_notes_q1.pdf",url:"/placeholder.svg?height=400&width=300",size:856e3,createdAt:new Date("2024-03-15T09:00:00Z"),updatedAt:new Date("2024-03-15T09:00:00Z"),folderId:1,tags:["work"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:8,author:"Sarah Johnson"}},{id:14,name:"budget_2024.xlsx",url:"/placeholder.svg?height=400&width=300",size:425e3,createdAt:new Date("2024-03-10T14:30:00Z"),updatedAt:new Date("2024-03-10T14:30:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:5}},{id:15,name:"team_photo.jpg",url:"https://images.unsplash.com/photo-1522071820081-009f0129c71c",size:32e5,createdAt:new Date("2024-02-28T11:00:00Z"),updatedAt:new Date("2024-02-28T11:00:00Z"),folderId:2,tags:["work"],mime:"image/jpeg",ext:".jpg",width:4e3,height:3e3,metaData:{}},{id:16,name:"logo_design.png",url:"https://images.unsplash.com/photo-1611162617474-5b21e879e113",size:15e5,createdAt:new Date("2024-02-20T10:00:00Z"),updatedAt:new Date("2024-02-20T10:00:00Z"),folderId:2,tags:["project"],mime:"image/png",ext:".png",width:2e3,height:2e3,metaData:{}},{id:17,name:"product_demo.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:15e6,createdAt:new Date("2024-02-15T16:00:00Z"),updatedAt:new Date("2024-02-15T16:00:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:180,videoSource:"local"}},{id:18,name:"training_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:25e6,createdAt:new Date("2024-02-10T09:30:00Z"),updatedAt:new Date("2024-02-10T09:30:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:300,videoSource:"local"}},{id:19,name:"background_music.mp3",url:"/placeholder.svg?height=400&width=300",size:45e5,createdAt:new Date("2024-02-05T14:00:00Z"),updatedAt:new Date("2024-02-05T14:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:240}},{id:20,name:"contract_template.docx",url:"/placeholder.svg?height=400&width=300",size:65e4,createdAt:new Date("2024-01-30T11:00:00Z"),updatedAt:new Date("2024-01-30T11:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:12}},{id:21,name:"invoice_jan.pdf",url:"/placeholder.svg?height=400&width=300",size:32e4,createdAt:new Date("2024-01-25T10:00:00Z"),updatedAt:new Date("2024-01-25T10:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:3}},{id:22,name:"vacation_photo1.jpg",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:28e5,createdAt:new Date("2024-01-20T15:00:00Z"),updatedAt:new Date("2024-01-20T15:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:3500,height:2500,metaData:{}},{id:23,name:"vacation_photo2.jpg",url:"https://images.unsplash.com/photo-1469474968028-56623f02e42e",size:31e5,createdAt:new Date("2024-01-20T15:05:00Z"),updatedAt:new Date("2024-01-20T15:05:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2800,metaData:{}},{id:24,name:"project_backup.zip",url:"/placeholder.svg?height=400&width=300",size:85e6,createdAt:new Date("2024-01-15T12:00:00Z"),updatedAt:new Date("2024-01-15T12:00:00Z"),folderId:5,tags:["archive","project"],mime:"application/zip",ext:".zip",metaData:{description:"Full project backup"}},{id:25,name:"presentation_final.pptx",url:"/placeholder.svg?height=400&width=300",size:35e5,createdAt:new Date("2024-01-10T16:00:00Z"),updatedAt:new Date("2024-01-10T16:00:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:35}},{id:26,name:"screenshot_001.png",url:"https://images.unsplash.com/photo-1517694712202-14dd9538aa97",size:12e5,createdAt:new Date("2024-01-05T09:00:00Z"),updatedAt:new Date("2024-01-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/png",ext:".png",width:1920,height:1080,metaData:{}},{id:27,name:"config.json",url:"/placeholder.svg?height=400&width=300",size:5e3,createdAt:new Date("2023-12-28T14:00:00Z"),updatedAt:new Date("2023-12-28T14:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:28,name:"readme.md",url:"/placeholder.svg?height=400&width=300",size:8500,createdAt:new Date("2023-12-20T10:00:00Z"),updatedAt:new Date("2023-12-20T10:00:00Z"),folderId:1,tags:["project"],mime:"text/markdown",ext:".md",metaData:{}},{id:29,name:"database_backup.sql",url:"/placeholder.svg?height=400&width=300",size:12e6,createdAt:new Date("2023-12-15T11:00:00Z"),updatedAt:new Date("2023-12-15T11:00:00Z"),folderId:5,tags:["archive","important"],mime:"application/sql",ext:".sql",metaData:{description:"Database backup"}},{id:30,name:"tutorial_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:18e6,createdAt:new Date("2023-12-10T13:00:00Z"),updatedAt:new Date("2023-12-10T13:00:00Z"),folderId:3,tags:["personal"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:420,videoSource:"local"}},{id:31,name:"company_logo.svg",url:"/placeholder.svg?height=400&width=300",size:45e3,createdAt:new Date("2023-12-05T09:00:00Z"),updatedAt:new Date("2023-12-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/svg+xml",ext:".svg",metaData:{}},{id:32,name:"report_q4.pdf",url:"/placeholder.svg?height=400&width=300",size:18e5,createdAt:new Date("2023-12-01T15:00:00Z"),updatedAt:new Date("2023-12-01T15:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:25,author:"Finance Team"}},{id:33,name:"nature_photo.webp",url:"https://images.unsplash.com/photo-1441974231531-c6227db76b6e",size:95e4,createdAt:new Date("2023-11-25T12:00:00Z"),updatedAt:new Date("2023-11-25T12:00:00Z"),folderId:2,tags:["personal"],mime:"image/webp",ext:".webp",width:3e3,height:2e3,metaData:{}},{id:34,name:"podcast_intro.mp3",url:"/placeholder.svg?height=400&width=300",size:25e5,createdAt:new Date("2023-11-20T10:00:00Z"),updatedAt:new Date("2023-11-20T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:180}},{id:35,name:"data_export.csv",url:"/placeholder.svg?height=400&width=300",size:85e4,createdAt:new Date("2023-11-15T14:00:00Z"),updatedAt:new Date("2023-11-15T14:00:00Z"),folderId:1,tags:["work"],mime:"text/csv",ext:".csv",metaData:{}},{id:36,name:"wireframes.pdf",url:"/placeholder.svg?height=400&width=300",size:42e5,createdAt:new Date("2023-11-10T11:00:00Z"),updatedAt:new Date("2023-11-10T11:00:00Z"),folderId:1,tags:["project"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:45}},{id:37,name:"cityscape.jpg",url:"https://images.unsplash.com/photo-1449824913935-59a10b8d2000",size:38e5,createdAt:new Date("2023-11-05T16:00:00Z"),updatedAt:new Date("2023-11-05T16:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4500,height:3e3,metaData:{}},{id:38,name:"interview_recording.mp3",url:"/placeholder.svg?height=400&width=300",size:85e5,createdAt:new Date("2023-11-01T09:00:00Z"),updatedAt:new Date("2023-11-01T09:00:00Z"),folderId:4,tags:["work"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:1800}},{id:39,name:"client_files.rar",url:"/placeholder.svg?height=400&width=300",size:45e6,createdAt:new Date("2023-10-25T13:00:00Z"),updatedAt:new Date("2023-10-25T13:00:00Z"),folderId:5,tags:["archive","work"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Client deliverables"}},{id:40,name:"marketing_plan.docx",url:"/placeholder.svg?height=400&width=300",size:12e5,createdAt:new Date("2023-10-20T10:00:00Z"),updatedAt:new Date("2023-10-20T10:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:18}},{id:41,name:"analytics_data.xlsx",url:"/placeholder.svg?height=400&width=300",size:21e5,createdAt:new Date("2023-10-15T15:00:00Z"),updatedAt:new Date("2023-10-15T15:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:8}},{id:42,name:"sunset_beach.jpg",url:"https://images.unsplash.com/photo-1507525428034-b723cf961d3e",size:32e5,createdAt:new Date("2023-10-10T17:00:00Z"),updatedAt:new Date("2023-10-10T17:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2700,metaData:{}},{id:43,name:"webinar_recording.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:35e6,createdAt:new Date("2023-10-05T14:00:00Z"),updatedAt:new Date("2023-10-05T14:00:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:600,videoSource:"local"}},{id:44,name:"sound_effects.wav",url:"/placeholder.svg?height=400&width=300",size:15e6,createdAt:new Date("2023-10-01T11:00:00Z"),updatedAt:new Date("2023-10-01T11:00:00Z"),folderId:4,tags:["project"],mime:"audio/wav",ext:".wav",metaData:{duration:120}},{id:45,name:"legacy_system.zip",url:"/placeholder.svg?height=400&width=300",size:125e6,createdAt:new Date("2023-09-25T09:00:00Z"),updatedAt:new Date("2023-09-25T09:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Old system files"}}];var Na=e=>new Promise(t=>setTimeout(t,e)),go=class{getFolder(t){if(t===null)return Promise.resolve(null);let a=Ie.find(i=>i.id===t);if(!a)return Promise.resolve(null);let o=n({},a),r=o;for(;r.parentId!==null;){let i=Ie.find(l=>l.id===r.parentId);if(i)r.parent=n({},i),r=r.parent;else break}return Promise.resolve(o)}async getFolders(t,a=1,o=20,r=""){await Na(300);let i=t!==null?Ie.filter(p=>p.parentId===t):Ie.filter(p=>p.parentId===null),l=i;if(r&&r.trim()){let p=r.toLowerCase().trim();l=i.filter(y=>y.name.toLowerCase().includes(p))}let c=l.sort((p,y)=>new Date(p.createdAt).getTime()-new Date(y.createdAt).getTime()),s=c.length,f=Math.ceil(s/o),m=(a-1)*o;return{folders:c.slice(m,m+o),pagination:{currentPage:a,totalPages:f,totalFiles:s,filesPerPage:o}}}getTags(){return Promise.resolve(Wn.map(t=>t.name))}async getFiles(t,a,o,r,i){await Na(500);let l=[...Pe];if(t!==null&&(l=l.filter(w=>w.folderId===t)),a&&a.length>0&&(l=l.filter(w=>{let N=je(w.mime,w.ext);return a.includes(N)})),i){let w=i==null?void 0:i.toLowerCase();l=l.filter(N=>N.name.toLowerCase().includes(w))}let c=l.sort((w,N)=>new Date(w.createdAt).getTime()-new Date(N.createdAt).getTime()),s=o!=null?o:1,f=r!=null?r:10,m=c.length,b=Math.ceil(m/f),p=(s-1)*f,y=c.slice(p,p+f);return Promise.resolve({files:y,pagination:{currentPage:s,totalPages:b,totalFiles:m,filesPerPage:f}})}async getItems(t,a,o=1,r=24,i=""){await Na(300);let l=t!==null?Ie.filter(h=>h.parentId===t):Ie.filter(h=>h.parentId===null),c=t!==null?Pe.filter(h=>h.folderId===t):Pe.filter(h=>h.folderId===null);if(a&&a.length>0&&(c=c.filter(h=>{let I=je(h.mime,h.ext);return a.includes(I)})),i&&i.trim()){let h=i.toLowerCase().trim();l=l.filter(I=>I.name.toLowerCase().includes(h)),c=c.filter(I=>{var Y,te;return I.name.toLowerCase().includes(h)||((te=(Y=I.ext)==null?void 0:Y.toLowerCase().includes(h))!=null?te:!1)})}let s=l.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),f=c.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),m=s.length+f.length,b=Math.ceil(m/r)||1,p=(o-1)*r,y=p+r,w=s.slice(Math.max(0,p),Math.min(s.length,y)),N=w.length,M=r-N,D=Math.min(s.length,p),z=Math.max(0,p-s.length),T=f.slice(z,z+M);return{folders:w,files:T,pagination:{currentPage:o,totalPages:b,totalFiles:m,filesPerPage:r}}}async createFolder(t,a){await Na(300);let o={id:Date.now(),name:t,parentId:a!=null?a:null,pathId:typeof a=="number"?a:0,path:"",fileCount:0,folderCount:0,createdAt:new Date,updatedAt:new Date};return Ie.push(o),o}getMetaDataType(t,a){return t.type.startsWith("image/")?{}:t.type.startsWith("video/")?{duration:0,videoSource:a!=null?a:xo.LOCAL}:t.type.startsWith("audio/")?{duration:0}:{description:""}}getFileType(t){var o;let a="."+((o=t.name.split(".").pop())==null?void 0:o.toLowerCase());return je(t.type,a)}async uploadFiles(t,a){var r;await Na(500);let o=[];for(let{file:i,videoSource:l}of t){let c=this.getFileType(i),s="."+((r=i.name.split(".").pop())==null?void 0:r.toLowerCase()),f={id:Date.now()+Math.random(),name:i.name,folderId:a!=null?a:null,size:i.size,url:URL.createObjectURL(i),mime:i.type||"application/octet-stream",ext:s,metaData:this.getMetaDataType(i,l),createdAt:new Date,updatedAt:new Date,tags:[],width:c===X.IMAGE?800:void 0,height:c===X.IMAGE?600:void 0};Pe.push(f),o.push(f)}return o}renameFolder(t,a){let o=Ie.find(r=>r.id===t);return o?(o.name=a,o.updatedAt=new Date,Promise.resolve(o)):Promise.reject(new Error("Folder not found"))}updateFileMetaData(t,a){let o=Pe.find(c=>c.id===t);if(!o)return Promise.reject(new Error("File not found"));let l=a,{metaData:r}=l,i=g(l,["metaData"]);return Object.assign(o,i),r&&(o.metaData=n(n({},o.metaData),r)),o.updatedAt=new Date,Promise.resolve(o)}deleteFiles(t){for(let a of t){let o=Pe.findIndex(r=>r.id===a);o!==-1&&Pe.splice(o,1)}return Promise.resolve()}deleteFolders(t){for(let a of t){let o=Ie.findIndex(r=>r.id===a);if(o!==-1){Ie.splice(o,1);for(let r=Pe.length-1;r>=0;r--)Pe[r].folderId===a&&Pe.splice(r,1)}}return Promise.resolve()}findFiles(t){let a=t==null?void 0:t.toLowerCase(),o=Pe.filter(r=>{var i;return r.name.toLowerCase().includes(a)||((i=r.tags)==null?void 0:i.some(l=>l.toLowerCase().includes(a)))});return Promise.resolve(o)}findFolders(t){let a=t==null?void 0:t.toLowerCase(),o=Ie.filter(r=>r.name.toLowerCase().includes(a));return Promise.resolve(o)}moveFiles(t,a){let o=[];for(let r of t){let i=Pe.find(l=>l.id===r);i&&(i.folderId=a,i.updatedAt=new Date,o.push(i))}return Promise.resolve(o)}moveFolders(t,a){let o=[];for(let r of t){let i=Ie.find(l=>l.id===r);i&&(i.parentId=a,i.updatedAt=new Date,o.push(i))}return Promise.resolve(o)}};0&&(module.exports={FileManager,FileManagerModal,FileManagerProvider,MockProvider,useFileManager});
|