PageSourceSearch

https://app.uaitec.ai/assets/SharedWithMePage.CtzMqT8O.js

js uaitec.ai collected 2026-10-05 13:47:59 UTC 33,359 bytes, 8 lines download raw bytes

1import{j as e,r as l}from"./react-core.DJiaDNPT.js";import{S as Z}from"./SharedTabs.VMpmciMO.js";import{l as q,x as ee,t as ae,ac as re,ap as G,af as se,aa as te,a6 as V,aL as ne,aB as B,aG as le,ai as Q,aF as ie,aI as ce,H as de,L as U,b0 as oe}from"./vendors.D5VPZlu6.js";import{t as O}from"./transcribeVideo.service.BiozynwC.js";import{s as xe,l as me,L as H}from"./index.CKQejW0v.js";import{f as ge,a as ue,g as W}from"./formatters.BbgLzeV7.js";import{c as he,b as pe}from"./timeUtils.BHqtUMP6.js";import{a as fe,L as ye}from"./react-router.CDx91DFN.js";import{u as be}from"./useFolderQuery.B37akOfA.js";import{P as ke}from"./PageLayout.2gyHQwR4.js";import{P as je}from"./DesignSystem.DJwtNkyV.js";import{C as _e}from"./ConfirmModal.DHfeTdLC.js";import"./react-query.BPQxxLgJ.js";import"./languages.D4X_h8sV.js";import"./folder.service.Bavj0BVK.js";import"./ui-vendor.ifuTFEVu.js";const we=(a,t=85)=>a?a.length<=t?a:a.slice(0,t-1)+"…":"",Ne=a=>{if(!a)return e.jsx(B,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"});switch(a.toLowerCase()){case"audiorecording":return e.jsx(ce,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"});case"screenrecording":return e.jsx(ie,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"});case"videoupload":return e.jsx(Q,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"});case"audioupload":return e.jsx(le,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"});default:return e.jsx(B,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5"})}},ve=a=>
1{const t=a.includes("/")&&a.split("/").pop()||a,o="uaitec-user-media-",s=t.startsWith(o)?t.substring(o.length):t,c=s.indexOf(" - ");if(c!==-1){const x=s.substring(0,c),m=s.substring(c+3);return{platform:x,remainder:m,original:t}}return{platform:null,remainder:s,original:t}},Ce=a=>"/default-video-thumbnail.png",$e=({video:a,index:t,onInfoClick:o,onDeleteClick:s,onShareClick:c,onRetryClick:x,retryInProgress:m=!1,detailsPath:$,isShared:g=!1,featureSharingEnabled:S=!1,customActions:u,deleteInProgress:N=!1,deleteLabel:v})=>{const{t:n}=q(),D=fe(),h=a.status==="processed",y=a.status==="error",R=a.status==="downloading",b=!h&&!y&&(a.status==="processing"||R),p=h?100:a.processing_progress??(R?5:50),M=()=>{if(h)return n("processed");switch(a.processing_step){case"uploading":return n("processing_step_uploading","Uploading");case"downloading":return n("processing_step_downloading","Downloading");case"preparing":return n("processing_step_preparing","Preparing");case"processing":return n("processing_step_processing","Processing");case"transcribing":return n("processing_step_transcribing","Transcribing");case"aligning":return n("processing_step_aligning","Aligning");case"diarizing":return n("processing_step_diarizing","Analyzing speakers");case"labeling_speakers":return n("processing_step_labeling","Labeling speakers");case"stt_complete":return n("processing_step_stt_complete","Analyzing content…");case"analyzing":return n("processing_step_analyzing","Generating summary");case"finalizing":return n("processing_step_finalizing","Finalizing");default:return n("processing")}},z=b?M():(()=>{switch(a.status){case"processed":return n("processed");case"error":return n("error","Error");case"downloading":return n("processing_step_downloading","Downloading");case"processing":return n("processing","Processing");case"created":return n("created","Created");default:return a.status}})(),k=Ce(a.name||""),{platform:j,remainder:C,original:_}=ve(a.name||""),P=[j?`Platform: ${j}`:"",a.media_source_title?`Source Title: ${a.media_source_title}`:"",a.webpage_url?`URL: ${a.webpage_url}`:""].filter(Boolean).join(`
2`),E=i=>new Date(i).toLocaleDateString(),L=()=>{D($||`/library/video/${a.id}`)},A=v||(g?n("remove_shared_content","Remove shared content"):n("delete_content"));return e.jsxs("article",{className:`group relative flex cursor-pointer flex-col overflow-hidden rounded-xl bg-white shadow-lg transition-all duration-300
3               hover:scale-[1.02] hover:shadow-xl hover:ring-2 hover:ring-brand-500/20
4               focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-500
5               dark:bg-gray-800 dark:hover:ring-brand-400/20 dark:focus-within:ring-brand-400`,"aria-label":a.title||_,onClick:i=>{i.target.closest('button, a, [role="button"], input')||L()},children:[e.jsxs("div",{className:"relative aspect-video w-full overflow-hidden bg-gray-100 dark:bg-gray-700",children:[e.jsx("div",{className:"absolute inset-0 rounded-t-xl overflow-hidden border border-gray-200 dark:border-gray-600",children:a.thumb&&a.thumb!=="null"?e.jsx("img",{src:a.thumb,alt:a.title||_,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy"}):e.jsx("img",{src:k,alt:a.title||_,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:i=>{i.currentTarget.style.display="none";const f=i.currentTarget.parentElement;if(f){const F=document.createElement("div");F.className="flex h-full items-center justify-center",F.innerHTML='<svg class="h-16 w-16 text-gray-400" aria-hidden="true">...</svg>',f.appendChild(F)}}})}),e.jsx("div",{className:"absolute top-3 right-3 z-10",children:g&&(a.sharer_email||a.sharer_name)?e.jsx("span",{className:"inline-flex items-center max-w-[140px] sm:max-w-[180px] rounded-full px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 dark:bg-blue-400/10 dark:text-blue-300 truncate",title:a.sharer_name?`${n("shared_by_full","Shared by")} ${a.sharer_name}${a.sharer_email?` <${a.sharer_email}>`:""}`:`${n("shared_by_full","Shared by")} ${a.sharer_email}`,"aria-label":a.sharer_name?`${n("shared_by_full","Shared by")} ${a.sharer_name}${a.sharer_email?` <${a.sharer_email}>`:""}`:`${n("shared_by_full","Shared by")} ${a.sharer_email}`,children:a.sharer_email||a.sharer_name}):e.jsxs("span",{className:`relative inline-flex items-center rounded-full px-2 py-1 text-xs font-medium transition-colors
6                  ${h?"bg-brand-50 text-brand-900":y?"bg-red-100 text-red-800 dark:bg-red-400/15 dark:text-red-300":"bg-gray-200/80 text-gray-800 dark:bg-gray-700/80 dark:text-gray-200"}`,style:{boxShadow:b?`0 0 0 2px rgba(${p<50?"156, 163, 175":"180, 130, 0"}, ${.3+p/100*.5})`:"none"},...y&&a.error_reason?{title:a.error_reason}:{},children:[b&&e.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",style:{background:`linear-gradient(to right, rgba(180, 130, 0, 0.25) ${p}%, transparent ${p}%)`},role:"progressbar","aria-valuenow":p,"aria-valuemin":0,"aria-valuemax":100,"aria-label":M()}),h?n("processed"):e.jsxs("span",{className:"inline-flex items-center",children:[y&&e.jsx(ee,{className:"mr-1 h-3.5 w-3.5","aria-hidden":"true"}),b&&e.jsx("span",{className:"mr-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-brand-900","aria-hidden":"true"}),z,b&&e.jsxs("span",{className:"sr-only",children:[p,"%"]})]})]})}),e.jsx("div",{className:"absolute top-3 left-3 z-10",children:e.jsx("button",{type:"button",onClick:i=>o(i,a),className:`flex items-center justify-center w-8 h-8 rounded-full bg-black/70 backdrop-blur-sm
7                     text-white hover:bg-black/80 transition-colors focus:outline-none
8                     focus:ring-2 focus:ring-brand-500 focus:ring-offset-2`,"aria-label":n("view_details","View Details"),title:n("view_details","View Details"),children:e.jsx(ae,{className:"w-5 h-5"})})}),a.duration&&e.jsxs("div",{className:"absolute bottom-3 right-3 flex items-center gap-1 sm:gap-1.5 rounded-full bg-black/80 px-2 sm:px-2.5 py-1 text-xxs sm:text-xs font-medium text-white backdrop-blur-sm",children:[e.jsx(re,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5","aria-hidden":"true"}),e.jsx("span",{children:ge(a.duration)})]})]}),e.jsxs("div",{className:"relative flex flex-1 flex-col p-4 sm:p-5",children:[e.jsx("div",{className:"flex-1 space-y-3",children:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[a.title?e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-gray-900 dark:text-white group-hover:text-brand-900 dark:group-hover:text-brand-400 leading-snug tracking-tight",children:e.jsx("div",{className:"line-clamp-3 overflow-hidden break-words",children:a.title})}):e.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-gray-900 dark:text-white group-hover:text-brand-900 dark:group-hover:text-brand-400 leading-snug tracking-tight",children:e.jsx("div",{className:"line-clamp-3 overflow-hidden break-words",children:we(_,85)})}),a.keywords&&a.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",title:a.keywords.join(", "),children:[a.keywords.slice(0,4).map((i,f)=>e.jsx("span",{className:"keywords-responsive inline-flex items-center px-1.5 py-0.5 rounded-md font-normal bg-gray-50 text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:i},f)),a.keywords.length>4&&e.jsxs("span",{className:"keywords-responsive inline-flex items-center px-1.5 py-0.5 rounded-md font-normal bg-gray-50 text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:["+",a.keywords.length-4]})]})]})})}),e.jsxs("div",{className:"mt-3 sm:mt-4 pt-2 sm:pt-3 border-t border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5 sm:mb-2",children:[e.jsx("div",{className:"flex items-center gap-2 sm:gap-3 text-gray-500 dark:text-gray-400",children:h&&e.jsxs(e.Fragment,{children:[a.transcription_language&&e.jsx("div",{className:"flex items-center gap-1 sm:gap-1.5 cursor-help",title:n("transcription_original_language",{language:`${W(a.transcription_language).label} (${W(a.transcription_language).iso})`}),children:e.jsx("span",{className:"text-sm sm:text-base leading-none select-none","aria-label":`Language: ${W(a.transcription_language).label}`,children:ue([a.transcription_language])})}),a.transcription_language&&a.unique_speakers_count?e.jsx("div",{className:"text-gray-300 dark:text-gray-600 text-xxs sm:text-sm",children:"|"}):null,a.unique_speakers_count?e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 cursor-help",title:n("speaker_count_tooltip",{count:a.unique_speakers_count||0}),children:[e.jsx(G,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4","aria-hidden":"true"}),e.jsx("span",{className:"text-xxs sm:text-sm font-medium",children:a.unique_speakers_count})]}):null]})}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-gray-500 dark:text-gray-400",title:`${n("updated_at")}: ${E(a.updatedAt)}`,children:[e.jsx(se,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4","aria-hidden":"true"}),e.jsx("span",{className:"text-xxs sm:text-sm font-medium",children:he(a.updatedAt,n)})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 text-gray-500 dark:text-gray-400",children:[a.processing_time?e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5",title:n("processing_time_tooltip"),children:[e.jsx(te,{className:"h-3.5 w-3.5","aria-hidden":"true"}),e.jsx("span",{className:"text-xxs sm:text-sm font-medium",children:pe(a.processing_time)})]}):null,a.processing_time&&j?e.jsx("div",{className:"text-gray-300 dark:text-gray-600 text-xxs sm:text-sm",children:"|"}):null,j&&e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 cursor-help",title:P,children:[Ne(j),e.jsx("span",{className:"text-xxs sm:text-sm font-medium",children:j})]})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:u||e.jsxs(e.Fragment,{children:[y&&x&&e.jsx("button",{type:"button",onClick:i=>x(i,a),disabled:m,className:`p-2 rounded-full transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/60 focus:ring-offset-1 dark:focus:ring-offset-gray-900 ${m?"curs
8or-not-allowed opacity-60 text-gray-400":"text-amber-500 hover:bg-amber-100 hover:text-amber-700 dark:hover:bg-amber-900/40 dark:hover:text-amber-300"}`,"aria-label":n("retry_processing","Retry processing"),title:m?n("retrying","Retrying…"):n("retry_processing","Retry processing"),"aria-busy":m,children:e.jsx(V,{className:`h-4 w-4 ${m?"animate-spin":""}`})}),S&&c&&e.jsx("button",{type:"button",onClick:i=>c(i,a.id),className:"p-2 rounded-full text-gray-400 hover:bg-brand-100 hover:text-brand-900 dark:hover:bg-brand-900/40 dark:hover:text-brand-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-brand-500/60 focus:ring-offset-1 dark:focus:ring-offset-gray-900","aria-label":n("share_content","Share content"),title:n("share_content","Share content"),children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}),e.jsx("button",{type:"button",onClick:i=>s(i,a),disabled:N,className:`p-2 rounded-full text-gray-400 transition-colors duration-200 ${N?"cursor-not-allowed opacity-60":"hover:bg-red-100 hover:text-red-600 dark:hover:bg-red-900/40 dark:hover:text-red-300"}`,"aria-label":A,title:A,"aria-busy":N,children:N?e.jsx(V,{className:"h-4 w-4 animate-spin"}):e.jsx(ne,{className:"h-4 w-4"})})]})})]})]})]})]},t)},T=({title:a,children:t,hidden:o})=>o?null:e.jsxs("section",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-white",children:a}),t]}),Se=({video:a,isOpen:t,onClose:o})=>{const{t:s}=q();return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:o}),e.jsxs("div",{className:"relative w-full max-w-4xl max-h-[90vh] overflow-y-auto rounded-xl bg-white dark:bg-gray-800 shadow-2xl border border-gray-200 dark:border-gray-700 p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white leading-tight",children:a.title||a.name||s("untitled","Untitled")}),e.jsx("button",{type:"button",onClick:o,className:"rounded-md p-2 text-gray-500 hover:text-gray-800 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-brand-500","aria-label":s("close","Close"),children:e.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M4 4l12 12M16 4L4 16"})})})]}),e.jsxs("div",{className:"space-y-8 text-sm",children:[e.jsx(T,{title:s("ai_analysis","AI Analysis"),children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("title","Title"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200 leading-snug",children:a.title||a.name||s("untitled","Untitled")})]}),a.meta_description&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("meta_description","Meta Description"),":"]}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 whitespace-pre-wrap leading-relaxed text-sm max-h-60 overflow-y-auto",children:a.meta_description})]})]}),e.jsxs("div",{className:"space-y-2",children:[a.keywords&&a.keywords.length>0&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("keywords","Keywords"),":"]}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:a.keywords.map((c,x)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xxs font-medium",children:c},x))})]}),(a.use_case||a.document_template)&&e.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[a.use_case&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("use_case","Use Case"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200",children:a.use_case})]}),a.document_template&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("document_template","Document Template"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200",children:a.document_template})]})]})]})]})}),e.jsx(T,{title:s("original_media_details","Original Media Details"),hidden:!(a.media_source_title||a.media_description||a.tags||a.categories||a.uploader||a.channel||a.webpage_url||a.original_url||a.upload_date),children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-3",children:[a.media_source_title&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("media_source_title","Media Source Title"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200 leading-snug",children:a.media_source_title})]}),a.media_description&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("media_description","Media Description"),":"]}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 whitespace-pre-wrap leading-relaxed text-sm max-h-56 overflow-y-auto",children:a.media_description})]}),a.tags&&a.tags.length>0&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("tags","Tags"),":"]}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:a.tags.map((c,x)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xxs",children:c},x))})]}),a.categories&&a.categories.length>0&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("categories","Categories"),":"]}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:a.categories.map((c,x)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xxs",children:c},x))})]})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.uploader&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("uploader","Uploader"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200 break-words",children:a.uploader})]}),a.channel&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("channel","Channel"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200 break-words",children:a.channel})]}),a.webpage_url&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("webpage_url","Webpage Url"),":"]}),e.jsx("a",{href:a.webpage_url,target:"_blank",rel:"noopener noreferrer",className:"text-brand-900 dark:text-brand-400 hover:underline break-all",children:a.webpage_url})]}),a.original_url&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("original_url","Original Url"),":"]}),e.jsx("a",{href:a.original_url,target:"_blank",rel:"noopener noreferrer",className:"text-brand-900 dark:text-brand-400 hover:underline break-all",children:a.original_url})]}),a.upload_date&&e.jsxs("div",{children:[e.jsxs("span",{className:"block text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[s("upload_date","Upload Date"),":"]}),e.jsx("p",{className:"text-gray-900 dark:text-gray-200",children:a.upload_date})]})]})]})}),e.jsx(T,{title:s("engagement","Engagement"),hidden:!(a.view_count!=null||a.like_count!=null||a.comment_count!=null),children:e.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[a.view_count!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("view_count","View Count")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.view_count})]}),a.like_count!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("like_count","Like Count")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.like_count})]}),a.comment_count!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("comment_count","Comment Count")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.comment_count})]})]})}),e.jsx(T,{title:s("technical_details","Technical Details"),hidden:!(a.media_type||a.resolution||a.aspect_ratio||a.filesize_mb||a.content_type||a.file_hash),children:e.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[a.media_type&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("media_type","Media Type")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.media_type})]}),a.resolution&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("resolution","Resolution")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.resolution})]}),a.aspect_ratio&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("aspect_ratio","Aspect Ratio")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.aspect_ratio})]}),a.filesize_mb!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("filesize_mb","File Size (MB)")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.filesize_mb})]}),a.content_type&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("content_type","Content Type")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200 break-words",children:a.content_type})]}),a.file_hash&&e.jsxs("div",{className:"flex flex-col sm:col-span-2",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("file_hash","File Hash")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200 break-all text-xxs font-mono",children:a.file_hash})]})]})}),e.jsx(T,{title:s("core_metrics","Core Metrics"),hidden:!(a.duration!=null||a.processing_time!=null||a.unique_speakers_count!=null),children:e.jsxs("div",{className:"grid sm:grid-cols-4 gap-4",children:[a.duration!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("duration","Duration")}),e.jsxs("span",{className:"text-gray-900 dark:text-gray-200",children:[a.duration,"s"]})]}),a.processing_time!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("processing_time","Processing Time")}),e.jsxs("span",{className:"text-gray-900 dark:text-gray-200",children:[a.processing_time,"s"]})]}),a.unique_speakers_count!=null&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:s("speakers","Speakers")}),e.jsx("span",{className:"text-gray-900 dark:text-gray-200",children:a.unique_speakers_count})]})]})})]})]})]}):null},Oe=()=>{const a=de(),{t}=q(),[o,s]=l.useState("videos"),[c,x]=l.useState(!0),[m,$]=l.useState(null),[g,S]=l.useState([]),[u,N]=l.useState(""),[v,n]=l.useState(null),[D,h]=l.useState(!1),[y,R]=l.useState(null),[b,p]=l.useState(null),[M,I]=l.useState([]),z=l.useRef([]),k=l.useRef(new Set),{usePurchasedFoldersQuery:j}=be(),{data:C=[],isLoading:_}=j(),P=l.useCallback(r=>
8{k.current.has(r)||(k.current.add(r),I(Array.from(k.current)))},[]),E=l.useCallback(r=>{k.current.delete(r)&&I(Array.from(k.current))},[]);l.useEffect(()=>{a(xe(t("shared_with_me_page_title","Shared With Me")))},[a,t]),l.useEffect(()=>{z.current=g},[g]),l.useEffect(()=>{let r=!0;return(async()=>{x(!0);try{const d=await O.listSharedWithMe();if(!r)return;S(d??[]),$(null)}catch{if(!r)return;$(t("load_shared_content_failed","Failed to load shared content"))}finally{r&&x(!1)}})(),()=>{r=!1}},[t]);const L=l.useMemo(()=>{if(!u.trim())return g;const r=u.toLowerCase();return g.filter(d=>[d.title,d.name,d.meta_description,d.sharer_email,d.sharer_name,...d.keywords??[],...d.tags??[],...d.categories??[]].filter(Boolean).join(" ").toLowerCase().includes(r))},[g,u]),A=l.useCallback((r,d)=>{r.stopPropagation(),n(d),h(!0)},[]),[i,f]=l.useState(null),F=l.useCallback((r,d)=>{r.stopPropagation();const w=d;!w?.id||k.current.has(w.id)||f(w)},[]),K=l.useCallback(async r=>{p(null),R(null),P(r.id);const d=z.current.slice();S(w=>w.filter(Y=>Y.id!==r.id)),v?.id===r.id&&(h(!1),n(null));try{await O.removeSharedWithMe(r.id),R(t("shared_with_me_remove_success","Removed shared content from your list."))}catch(w){me.error("[SharedWithMe] failed to remove shared video",w),S(d),p(t("shared_with_me_remove_error","Failed to remove shared content. Please try again."))}finally{E(r.id)}},[P,v,E,t]),J=l.useCallback(r=>r.share_token?`/share/v/${encodeURIComponent(r.share_token)}`:`/library/video/${r.id}`,[]),X=l.useCallback(()=>{h(!1),n(null)},[]);return e.jsx(ke,{variant:"wide",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(Z,{}),e.jsx(je,{title:t("shared_with_me_page_title","Shared with Me"),description:t("shared_with_me_page_description","Content that others have shared with you"),action:e.jsx("div",{className:"w-full sm:w-80",children:e.jsx("input",{type:"text",placeholder:o==="videos"?t("search_content","Search content..."):t("search_folders","Search folders..."),value:u,onChange:r=>N(r.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-500","aria-label":o==="videos"?t("search_content","Search content..."):t("search_folders","Search folders...")})})}),e.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Tabs",children:[e.jsxs("button",{type:"button",onClick:()=>s("videos"),className:`flex items-center gap-2 py-3 px-1 border-b-2 text-sm font-medium transition-colors ${o==="videos"?"border-brand-500 text-brand-900 dark:text-brand-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[e.jsx(Q,{className:"h-5 w-5"}),t("content","Content"),g.length>0&&e.jsx("span",{className:"ml-1 rounded-full bg-gray-100 dark:bg-gray-700 px-2 py-0.5 text-xs",children:g.length})]}),e.jsxs("button",{type:"button",onClick:()=>s("folders"),className:`flex items-center gap-2 py-3 px-1 border-b-2 text-sm font-medium transition-colors ${o==="folders"?"border-brand-500 text-brand-900 dark:text-brand-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:[e.jsx(U,{className:"h-5 w-5"}),t("folders","Folders"),C.length>0&&e.jsx("span",{className:"ml-1 rounded-full bg-gray-100 dark:bg-gray-700 px-2 py-0.5 text-xs",children:C.length})]})]})}),y&&!c&&e.jsx("div",{className:"rounded-md border border-green-300 dark:border-green-700 bg-green-50 dark:bg-green-900/30 p-4 text-sm text-green-700 dark:text-green-300",children:y}),b&&!c&&e.jsx("div",{className:"rounded-md border border-red-300 dark:border-red-700 bg-red-50 dark:bg-red-900/30 p-4 text-sm text-red-700 dark:text-red-300",children:b}),o==="videos"&&e.jsxs(e.Fragment,{children:[c&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-20",children:[e.jsx(H,{}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:t("loading_shared_content","Loading shared content...")})]}),m&&!c&&e.jsx("div",{className:"rounded-md border border-red-300 dark:border-red-700 bg-red-50 dark:bg-red-900/30 p-4 text-sm text-red-700 dark:text-red-300",children:m}),!c&&!m&&e.jsxs(e.Fragment,{children:[L.length>0&&e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:L.map((r,d)=>
8e.jsx($e,{video:r,index:d,onInfoClick:A,onDeleteClick:F,detailsPath:J(r),deleteInProgress:M.includes(r.id),isShared:!0},r.id))}),L.length===0&&e.jsx("div",{className:"flex flex-col items-center justify-center py-16",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx(G,{className:"h-16 w-16 text-gray-400 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:u?t("no_matching_content","No matching content"):t("no_shared_content","No shared content yet")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:u?t("try_different_search","Try a different search term"):t("no_shared_content_description","Content shared with you will appear here")})]})})]})]}),o==="folders"&&e.jsxs(e.Fragment,{children:[_&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-20",children:[e.jsx(H,{}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:t("loading_purchased_folders","Loading purchased folders...")})]}),!_&&C.length>0&&e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:C.filter(r=>!u||r.name.toLowerCase().includes(u.toLowerCase())).map(r=>e.jsxs(ye,{to:`/library/folders/${r.id}`,className:"group relative flex flex-col overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm transition-all hover:border-brand-300 hover:shadow-md dark:border-gray-700 dark:bg-gray-800 dark:hover:border-brand-900",children:[e.jsxs("div",{className:"relative aspect-video bg-gradient-to-br from-brand-50 to-brand-100 dark:from-gray-700 dark:to-gray-800",children:[e.jsx("div",{className:"flex h-full w-full items-center justify-center",children:e.jsx(U,{className:"h-16 w-16 text-brand-200 dark:text-gray-600"})}),e.jsxs("div",{className:"absolute right-2 top-2 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium text-amber-800 bg-amber-100 dark:bg-amber-900/30 dark:text-amber-400",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("span",{children:t("purchased","Purchased")})]})]}),e.jsxs("div",{className:"flex flex-1 flex-col p-3",children:[e.jsx("h3",{className:"line-clamp-1 text-sm font-semibold text-gray-900 group-hover:text-brand-900 dark:text-white dark:group-hover:text-brand-400",children:r.name}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400",children:[r.owner.avatar_url?e.jsx("img",{src:r.owner.avatar_url,alt:r.owner.name||r.owner.email,className:"h-4 w-4 rounded-full"}):e.jsx("div",{className:"h-4 w-4 rounded-full bg-gray-300 dark:bg-gray-600"}),e.jsx("span",{className:"truncate",children:r.owner.name||r.owner.email})]}),e.jsxs("div",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t("purchased_on","Purchased on")," ",new Date(r.purchased_at).toLocaleDateString()]})]})]},r.id))}),!_&&C.length===0&&e.jsx("div",{className:"flex flex-col items-center justify-center py-16",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx(U,{className:"h-16 w-16 text-gray-400 dark:text-gray-600 mx-auto mb-4"}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:t("no_purchased_folders","No purchased folders yet")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:t("no_purchased_folders_description","Folders you purchase will appear here")})]})})]}),e.jsx(_e,{isOpen:i!==null,onClose:()=>f(null),onConfirm:()=>{const r=i;f(null),r&&K(r)},title:t("shared_with_me_remove_title","Remove from your list?"),message:t("shared_with_me_remove_confirm","Remove this shared video from your list? This will revoke your access but keep the original content for others."),confirmText:t("remove","Remove"),isDestructive:!0}),v&&e.jsx(Se,{video:v,isOpen:D,onClose:X})]})})};export{Oe as default};

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.