1import{cN as e,F as s,W as a}from"./CmVwsSB4.js";import{R as i,M as t}from"./2Do9M2cI.js";import{M as r}from"./CmYxbt8O.js";import{e9 as o,o as l,f as d,a2 as n,W as m,L as c,V as p,a1 as j,H as v}from"./Bku_ZNU5.js";import{b as h}from"./BizObkke.js";import{g as f}from"./DoPegut2.js";import{u as x}from"./DZmZcIhl.js";import{D as u}from"./D9CTyUQp.js";import{T as g,a as b,b as D,c as N}from"./BSykS7Lo.js";import"./DWyQ20U7.js";import"./BLdQrD1j.js";import"./DemIo6QM.js";import"./BU1Y1fw2.js";import"./P1FsCZW1.js";import"./CSc5fXZY.js";import"./FFfopono.js";import"./nPWfopu4.js";import"./Cg9qUMaV.js";import"./DTYXwo7g.js";function _(){var _,y;const w=o.useNavigate(),S=o.useSearch(),{companyId:k}=e({from:"/_protected/$companyId"}),C=l(e=>e.hasPermission)("ORDER_VIDEO_DOWNLOAD"),{data:I}=x({}),O=null==(y=null==(_=null==I?void 0:I.data)?void 0:_.features)?void 0:y.camera_promote,{data:V,isPending:E}=h({...S,start_date:S.startDate,end_date:S.endDate,status:S.tab}),L=s.useMemo(()=>{if(S.startDate||S.endDate)return{from:S.startDate?d(S.startDate):void 0,to:S.endDate?d(S.endDate):void 0}},[S.startDate,S.endDate]),[M,P]=s.useState(L);s.useEffect(()=>{P(L)},[L]);const R=S.vehicle_id?S.vehicle_id.split(","):[],W=S.device_imei?S.device_imei.split(","):[],A=f(),$=a.jsx(n,{data:(null==V?void 0:V.data.videos)||[],columns:A,isLoading:E});return a.jsxs(g,{defaultValue:S.tab,className:"gap-4",onValueChange:e=>{w({to:".",search:s=>({...s,tab:e})})},children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[a.jsxs(b,{children:[a.jsx(D,{value:"all",children:"Saved"}),a.jsx(D,{value:"pending",children:"Pending"}),a.jsx(D,{value:"favorite",children:"Starred"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(m,{queryKeys:"video-library"}),C&&a.jsx(i,{companyId:k})]})]}),O&&a.jsx("img",{src:"https://assets.drivehos.app/app/free_100_cams.webp",alt:"Safety Banner",className:"h-auto w-full object-cover"}),a.jsxs("div",{className:"flex flex-wrap items-end gap-4 overflow-x-auto border-y py-2",children:[a.jsxs("div",{className:"mr-0 grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-64",children:[a.jsx(c,{children:"Date"}),a.jsx(u,{contentClassName:"w-full",date:M,setDate:e=>{P(e);const s=(null==e?void 0:e.from)?v(e.from):void 0,a=(null==e?void 0:e.to)?v(e.to):void 0;w({to:".",search:e=>({...e,startDate:s,endDate:a,page:1})})}})]}),a.jsx(p,{orientation:"vertical",className:"mb-2 hidden h-6! bg-border sm:flex"}),a.jsx("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-64",children:a.jsx(j,{value:S.search,onChange:e=>{w({to:".",search:s=>({...s,search:e||void 0})})},placeholder:"Search vehicle/driver"})}),a.jsx("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-64",children:a.jsx(r,{label:"",value:R,onChange:e=>{w({to:".",search:s=>({...s,vehicle_id:e.join(",")})})}})}),a.jsx("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-64",children:a.jsx(t,{label:"",value:W,onChange:e=>{w({to:".",search:s=>({...s,device_imei:e.join(",")})})}})})]}),a.jsx(N,{value:"all",children:$}),a.jsx(N,{value:"pending",children:$}),a.jsx(N,{value:"favorite",children:$})]})}export{_ as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.