PageSourceSearch

https://club.touchtight.com/assets/PlaylistDetailV2-Ikh_R2Wt.js

js touchtight.com collected 2026-10-02 00:02:43 UTC 21,398 bytes, 6 lines download raw bytes

1import{a as r,j as e}from"./react-vendor-DJtAp8P_.js";import{bg as mt,bm as xt,bi as bt,aX as Ae,bu as V}from"./index-CyS3LFy6.js";import{R as ht}from"./index-CeeFDfJ-.js";import{B as ft}from"./BackButtonV2-DsCFeevZ.js";import{b6 as gt,aX as yt}from"./query-CcmDMjHA.js";import{bG as vt,bw as St}from"./mutation--iSLlBrt.js";import{F as jt,c as wt,u as Nt,d as Ct,bk as It,a4 as At,S as Pe,v as Pt}from"./app-DT7WuczB.js";import{r as Tt}from"./imageUrl-gCnBcCAn.js";import{a as kt,b as Ot,c as Et}from"./popover-DQmY_bgT.js";import{C as Te}from"./index-BHFF4lkW.js";import{U as Mt}from"./index-Dg9Ob-9g.js";import{M as Dt,A as _t}from"./AddPlaylistModalV2-CK13cVBA.js";import{D as Rt,S as Vt}from"./index-BYpyTL8r.js";import{A as Lt}from"./AddPracticeToSessionModalGate-BB6n61YO.js";import{u as Bt}from"./useCollectionsPracticeTypeMap-Diyla1H4.js";import{T as $t}from"./TrailerModal-CVX4TgKw.js";import{u as zt,M as Ut}from"./MediaCardV2-CVjrjZCx.js";import{E as Gt}from"./ellipsis-vertical-EfBRlYg5.js";import{M as Yt}from"./checkbox-BCFY1QRf.js";import{A as qt}from"./arrow-up-down-Cyob2fWI.js";import{u as Ft,n as ke}from"./apollo-DL0KWP0Y.js";import"./mui-styles-C9F12l22.js";import"./babel-helpers-D2wBBc1I.js";import"./chevron-left-hHkvU2-n.js";import"./dayjs-CFxoC4n5.js";import"./index-C53T7JDS.js";import"./floating-ui.dom-CpqR1Q5s.js";import"./triangle-alert-BdPscC9S.js";import"./check-njpSxvzl.js";import"./trash-2-B3r-aJQU.js";import"./arrow-up-right-BHTble7A.js";import"./index-DFAqAA9H.js";import"./imageOptimization-zUL1CBPb.js";import"./SessionPlannerMobile-85wkJ1ZS.js";import"./mui-DvP2hOwX.js";import"./moment-Bj79pgB5.js";import"./Modal-BzPnYVEi.js";import"./Button-C4goEOKP.js";import"./index-CvVUxn0l.js";import"./chevron-down-D9vZfud1.js";import"./plus-jTnJ9Ylg.js";import"./list-plus-jbEUR6Jd.js";import"./bookmark-D81rgROb.js";import"./AvatarImgC-DLZ8EYiW.js";import"./swiper-react-DcF17yCe.js";import"./index.esm-CWqXbt53.js";import"./_baseClone-DByvJCmO.js";import"./_baseAssignValue-CjtYt4eh.js";import"./cloneDeep-mVQ3twB2.js";import"./Search-BEYvHCFs.js";import"./lodash-icp7yO-G.js";import"./merge-TfBrBrIh.js";import"./isArrayLikeObject-CcVCHQro.js";import"./map-BI8CQ8np.js";import"./browser-B3fhYDhb.js";import"./_arrayIncludes-DFQcso6E.js";import"./_baseIndexOf-DqPIyCu4.js";import"./hello-pangea-dnd-1bhs5THC.js";import"./some-YFJAbcVi.js";import"./values-DeBIqcD0.js";import"./index-B79atc36.js";import"./_baseDifference-BHjDay7E.js";import"./omit-BaIHraq0.js";import"./index-bEsv4Yks.js";import"./mui-x-DMY3qA32.js";import"./s3FileHandler-Bp64keCt.js";import"./compact-DZdspzxW.js";import"./seededSessionFill-BljGszd4.js";import"./index-CrwW5ro-.js";import"./subMonths-CpZP7vPB.js";import"./chevron-right-Bx281FLM.js";import"./sessionSections-a-lprBoU.js";import"./index-Cor9x_UP.js";import"./input-CuTRSUQZ.js";import"./editable-input-BbmoAFqJ.js";import"./label-DlgL8a7V.js";import"./arrow-right-CPcr9UUY.js";import"./funnel-CHKnj2yC.js";import"./plainText-DBpeJa6y.js";import"./heart-SY2Qtxi5.js";import"./useHoverTrailerV2-C_vNBnFz.js";import"./ellipsis-BPffiR7H.js";import"./play-CBxhfLg4.js";import"./calendar-range-BRkGfDrQ.js";import"./folder-plus-BuJChPs4.js";import"./footballize-CKQT9bi3.js";import"./star-DNcD-a5x.js";try{let i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new i.Error().stack;d&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[d]="cf72c00f-cfa7-4c7b-b331-09d6abd5757b",i._sentryDebugIdIdentifier="sentry-dbid-cf72c00f-cfa7-4c7b-b331-09d6abd5757b")}catch{}/**
2 * @license lucide-react v1.31.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Wt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Ht=mt("settings-2",Wt),Kt={coach:"Personal",club:"Club",shared:"Shared"},ee=10;function Or(){var xe,be,he,fe,ge,ye,ve,Se,je,we,Ne,Ce,Ie;const{id:i}=xt(),d=Number(i),u=bt(),b=Ft(),S=zt(),[m]=jt(),f=wt(),p=Nt(t=>t.user.userPermission),{isReadOnlyMode:g}=Ct(),a=(be=(xe=f.userRolesPermissions)==null?void 0:xe.permissions)==null?void 0:be.engineRoom,se=(he=a==null?void 0:a.weeklySeasonPlans)==null?void 0:he.add,[l,re]=r.useState(null),[x,A]=r.useState([]),[j,Oe]=r.useState(0),[y,oe]=r.useState(!1),[B,P]=r.useState(0),[w,$]=r.useState(""),[z,Ee]=r.useState(!1),[N,Me]=r.useState("created_at"),[T,ae]=r.useState("DESC"),[h,v]=r.useState(new Set),[De,U]=r.useState(!1),[_e,ne]=r.useState(!1),[Re,le]=r.useState(!1),[Ve,G]=r.useState(!1),[Le,C]=r.useState(!1),[Be,ie]=r.useState(!1),[$e,de]=r.useState(null),[ze,Y]=r.useState(!1),[Ue,q]=r.useState([]),[ce,F]=r.useState(!1),[Ge,W]=r.useState([]),[Ye,H]=r.useState([]),qe=Bt(Ye,ce),[Fe,k]=r.useState(!1),[I,O]=r.useState([]),[We]=ke(vt),[He]=ke(St),pe=r.useRef(null),K=r.useCallback(async()=>{var t,o;try{const s=await b.query({query:gt,variables:{playlistDetailsInput:{id:d}},fetchPolicy:"no-cache"});(o=(t=s==null?void 0:s.data)==null?void 0:t.getPlaylistDetails)!=null&&o.success&&re(s.data.getPlaylistDetails.data)}catch{}},[b,d]),Q=r.useCallback(async()=>{var t,o;oe(!0);try{const s=await b.query({query:yt,variables:{getPlaylistVideosInput:{id:d,limit:10,offset:B*10,searchQuery:w,sortBy:N,sortOrder:T,tagIds:[]}},fetchPolicy:"no-cache"}),n=(o=(t=s==null?void 0:s.data)==null?void 0:t.getPlaylistVideos)==null?void 0:o.data,c=(n==null?void 0:n.rows)??[];A(R=>B===0?c:[...R,...c]),Oe((n==null?void 0:n.count)??0)}finally{oe(!1)}},[b,d,B,w,N,T]);r.useEffect(()=>{re(null),A([]),P(0),v(new Set),K()},[d,K]),r.useEffect(()=>{Q()},[Q]),r.useEffect(()=>{P(0),A([])},[w,N,T]),r.useEffect(()=>{const t=pe.current;if(!t)return;const o=new IntersectionObserver(s=>{var n;(n=s[0])!=null&&n.isIntersecting&&!y&&j>x.length&&P(c=>c+1)},{rootMargin:"0px",threshold:1});return o.observe(t),()=>o.disconnect()},[y,j,x.length]);const E=(f==null?void 0:f.id)===((fe=l==null?void 0:l.User)==null?void 0:fe.id),M=((p==null?void 0:p.planId)??0)<3,Ke=E||((ge=a==null?void 0:a.clubPlaylists)==null?void 0:ge.manage)==="yes",D=E||((ye=a==null?void 0:a.clubPlaylists)==null?void 0:ye.delete)==="yes",Qe=E||((ve=a==null?void 0:a.clubPlaylists)==null?void 0:ve.add)==="yes"||((Se=a==null?void 0:a.clubPlaylists)==null?void 0:Se.delete)==="yes"||((je=a==null?void 0:a.clubPlaylists)==null?void 0:je.manage)==="yes"||((we=a==null?void 0:a.sharedPlaylists)==null?void 0:we.add)==="yes",ue=Ke&&!g,Xe=Qe&&!g,X=D&&!g,_=()=>{P(0),A([]),v(new Set),K(),Q()},Ze=(t,o)=>
6{v(s=>{const n=new Set(s);if(o){if(n.has(t))return n;if(n.size>=ee)return m({msg:`Only ${ee} videos can be selected at a time.`,variant:"warning"}),n;n.add(t)}else n.delete(t);return n})},Je=async()=>{var t,o;if(l)try{const{data:s}=await We({variables:{deletePlaylistsInput:{ids:[l.id]}}});(t=s==null?void 0:s.deletePlaylists)!=null&&t.success?(m({msg:s.deletePlaylists.message||"Playlist deleted",variant:"success"}),G(!1),u(-1)):m({msg:((o=s==null?void 0:s.deletePlaylists)==null?void 0:o.message)||"Could not delete",variant:"error"})}catch{m({msg:"Could not delete playlist",variant:"error"})}},et=async()=>{var t,o;if(I.length!==0)try{const{data:s}=await He({variables:{deletePlaylistVideosInput:{playlist_id:d,collection_ids:I}}});(t=s==null?void 0:s.deletePlaylistVideos)!=null&&t.success?(m({msg:s.deletePlaylistVideos.message||"Removed from playlist",variant:"success"}),k(!1),O([]),v(new Set),_()):m({msg:((o=s==null?void 0:s.deletePlaylistVideos)==null?void 0:o.message)||"Could not remove",variant:"error"})}catch{m({msg:"Could not remove videos",variant:"error"})}},Z=t=>{var n,c;const o=t.content_type==="collection"?t.id:((c=(n=t.videos)==null?void 0:n[0])==null?void 0:c.id)??t.id,s=Pt(t.title,o,t.id,t.content_type);u(`/collections?${s}`)},tt=r.useCallback(t=>{const o=Array.isArray(t.categories)?(t.categories??[]).map(c=>c.id):[],s=o.map(Number).some(c=>c===Ae.WEEK_PLANS_46||c===Ae.SEASON_PLANS);return{showAddToSession:It(o,t.content_type??"video",se),isSeasonOrWeek:s}},[se]),st=t=>{var o;if(M){C(!0);return}W(((o=t.videos)==null?void 0:o.map(s=>s.id))??[]),H(t.id!=null?[t.id]:[]),F(!0)},rt=t=>{if(M){C(!0);return}q([t.id]),Y(!0)},ot=t=>{de(t),ie(!0)},at=t=>{O([t.id]),k(!0)},nt=()=>{if(M){C(!0);return}const t=[];h.forEach(o=>{const s=x.find(n=>n.id===o);((s==null?void 0:s.videos)??[]).forEach(n=>t.push(n.id))}),W(t),H(Array.from(h)),F(!0)},lt=()=>{if(M){C(!0);return}q(Array.from(h)),Y(!0)},it=()=>{O(Array.from(h)),k(!0)},J=r.useMemo(()=>{const t=l==null?void 0:l.User;return t?`${t.username??""} ${t.lastname??""}`.trim():""},[l]),me=Tt((Ne=l==null?void 0:l.User)==null?void 0:Ne.profile_image)??null,[dt,ct]=r.useState(!1),pt=!!me&&!dt;return l?e.jsxs("div",{className:"er-v2 min-h-screen bg-bg text-fg font-body",children:[e.jsxs("div",{className:"px-4 md:px-8 pt-6 md:pt-8 pb-2",children:[e.jsx(ft,{fallbackTo:"/engine-room/home",className:"mb-2"}),e.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] uppercase tracking-wide12 text-accent-2",children:[e.jsx("button",{type:"button",onClick:()=>u("/engine-room/home"),className:"bg-transparent border-0 p-0 m-0 cursor-pointer text-accent-2 hover:underline",children:"Engine Room"}),e.jsx("span",{children:"·"}),e.jsx("button",{type:"button",onClick:()=>u(`/playlists/${l.permission==="club"?"club":l.permission==="shared"?"shared":"personal"}`),className:"bg-transparent border-0 p-0 m-0 cursor-pointer text-accent-2 hover:underline",children:"Playlists"}),e.jsx("span",{children:"·"}),e.jsx("span",{className:V("inline-flex items-center px-2 py-0.5 rounded-[2px] border border-solid",l.permission==="club"?"border-accent-2 text-accent-2":l.permission==="shared"?"border-accent text-accent":"border-hairline text-muted"),children:Kt[l.permission]})]}),e.jsxs("div",{className:"mt-2 flex items-end justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-[280px]",children:[e.jsx("h1",{className:"font-head font-bold uppercase text-[22px] sm:text-[36px] md:text-[48px] leading-none m-0 text-fg",children:l.title}),e.jsxs("div",{className:"mt-3 flex items-center gap-3 flex-wrap",children:[J&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-card-hi border border-solid border-hairline rounded-full pl-0.5 pr-2.5 py-0.5",children:[pt?e.jsx("img",{src:me??"",alt:"",className:"w-5 h-5 rounded-full object-cover",onError:()=>ct(!0)}):e.jsx("span",{className:"w-5 h-5 rounded-full bg-bg-raised border border-solid border-hairline flex items-center justify-center font-mono text-[9px] text-subtle",children:At(J)}),e.jsx("span",{className:"font-body text-[12px] text-fg",children:J})]}),e.jsx(ht,{size:"sm",count:j,label:"videos",loading:y}),g&&e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-[2px] border border-solid border-warn text-warn font-mono text-[10px] uppercase tracking-wide12",children:"Archived · read-only"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ue&&e.jsxs("button",{type:"button",onClick:()=>
6U(!0),className:"box-border h-9 bg-accent text-bg border-0 rounded-[3px] px-4 inline-flex items-center gap-2 cursor-pointer hover:brightness-110",children:[e.jsx(Ht,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"font-head text-[12px] uppercase tracking-wide4",children:"Manage Playlist"})]}),Xe&&e.jsxs(kt,{children:[e.jsx(Ot,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Playlist actions",className:"box-border w-9 h-9 bg-card border border-solid border-hairline rounded-[3px] inline-flex items-center justify-center cursor-pointer hover:bg-card-hi",children:e.jsx(Gt,{className:"w-4 h-4 text-fg"})})}),e.jsxs(Et,{align:"end",className:"w-[200px] p-1 bg-card-hi border border-solid border-tt-border",children:[(E||((Ce=a==null?void 0:a.clubPlaylists)==null?void 0:Ce.add)==="yes"||((Ie=a==null?void 0:a.sharedPlaylists)==null?void 0:Ie.add)==="yes")&&e.jsx(te,{label:"Share",onClick:()=>ne(!0)}),e.jsx(te,{label:"Duplicate",onClick:()=>le(!0)}),D&&e.jsx(te,{label:"Delete",destructive:!0,onClick:()=>G(!0)})]})]}),e.jsx("button",{type:"button","aria-label":z?"Close search":"Search this playlist",onClick:()=>Ee(t=>(t&&$(""),!t)),className:V("box-border w-9 h-9 bg-card border border-solid rounded-[3px] inline-flex items-center justify-center cursor-pointer hover:bg-card-hi",z?"border-accent-2 text-accent-2":"border-hairline text-fg"),children:e.jsx(Pe,{className:"w-4 h-4"})}),e.jsx(Qt,{sortKey:N,sortOrder:T,onChange:t=>{N===t?ae(o=>o==="ASC"?"DESC":"ASC"):(Me(t),ae("DESC"))}})]})]})]}),e.jsx("div",{className:"px-4 md:px-8 pt-3",children:e.jsxs("div",{className:"flex items-center gap-3 py-3 border-y border-solid border-hairline",children:[z&&e.jsxs("div",{className:"flex items-center gap-2 flex-1 bg-card border border-solid border-hairline rounded-[3px] px-3 py-2 max-w-[420px]",children:[e.jsx(Pe,{className:"w-3.5 h-3.5 text-subtle"}),e.jsx("input",{type:"text",autoFocus:!0,value:w,onChange:t=>$(t.target.value),placeholder:"Search this playlist",className:"flex-1 bg-transparent border-0 outline-none font-body text-[13px] text-fg placeholder:text-subtle"})]}),e.jsxs("span",{className:"ml-auto font-mono text-[10.5px] text-subtle",children:[j," items",X?"":" · view only"]})]})}),e.jsxs("div",{className:"px-4 md:px-8 pt-5 pb-32",children:[x.length===0&&y&&e.jsx("div",{className:"grid grid-cols-1 gap-4 md:[grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:Array.from({length:10}).map((t,o)=>e.jsx("div",{className:"aspect-[4/3] bg-card border border-solid border-hairline rounded-[8px] animate-pulse"},o))}),x.length>0&&e.jsx("div",{className:"grid grid-cols-1 gap-4 md:[grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:x.map((t,o)=>{const{showAddToSession:s,isSeasonOrWeek:n}=tt(t),c=h.has(t.id),R=t.id;return e.jsxs("div",{className:"relative",children:[e.jsx(Ut,{item:t,index:o,onOpen:()=>Z(t),onPlayTrailer:()=>ot(t),onPlayClick:()=>Z(t),onAddToSession:s?()=>st(t):void 0,onAddToPlaylist:()=>rt(t),selectMode:X,isSelected:c,onToggleSelect:()=>Ze(R,!c),fillCell:!0}),X&&D&&e.jsxs("button",{type:"button",onClick:ut=>{ut.stopPropagation(),at(t)},"aria-label":"Remove from playlist",title:"Remove from playlist",className:"absolute bottom-2 right-2 z-10 inline-flex h-6 w-6 items-center justify-center rounded-full border border-solid border-on-media-hairline bg-media-scrim backdrop-blur text-on-media-muted hover:bg-media-scrim-strong hover:text-danger hover:border-danger transition-colors cursor-pointer",children:[e.jsx(Yt,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"sr-only",children:"Remove"})]})]},R)})}),x.length===0&&!y&&e.jsx(Xt,{isFilteredOrSearch:!!w,onClearSearch:()=>$(""),onAddVideos:ue?()=>U(!0):void 0}),e.jsx("div",{ref:pe,className:"h-4"}),y&&x.length>0&&e.jsx("div",{className:"py-4 text-center font-mono text-[11px] text-muted",children:"Loading more…"})]}),h.size>0&&e.jsx("div",{className:"fixed left-1/2 -translate-x-1/2 bottom-6 z-40",children:e.jsxs("div",{className:"box-border bg-card-hi border border-solid border-tt-border rounded-[3px] px-4 py-3 flex items-center gap-3 shadow-lg",style:{boxShadow:"0 18px 40px -16px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,128,208,0.18)"},children:[e.jsxs("span",{className:"font-mono text-[10.5px] uppercase tracking-wide12 text-accent",children:[h.size," selected · max ",ee]}),e.jsx("span",{className:"h-4 w-px bg-hairline"}),e.jsx("button",{type:"button",onClick:()=>v(new Set(x.map(t=>
6t.id))),className:"box-border bg-transparent border-0 cursor-pointer font-mono text-[10.5px] uppercase tracking-wide8 text-fg hover:text-accent",children:"Select all"}),e.jsx("button",{type:"button",onClick:()=>v(new Set),className:"box-border bg-transparent border-0 cursor-pointer font-mono text-[10.5px] uppercase tracking-wide8 text-fg hover:text-accent",children:"Deselect all"}),e.jsx("button",{type:"button",onClick:nt,className:"box-border bg-card border border-solid border-hairline rounded-[2px] px-3 py-1.5 cursor-pointer hover:border-fg",children:e.jsx("span",{className:"font-head text-[11px] uppercase tracking-wide4 text-fg",children:"Add to Session"})}),e.jsx("button",{type:"button",onClick:lt,className:"box-border bg-card border border-solid border-hairline rounded-[2px] px-3 py-1.5 cursor-pointer hover:border-fg",children:e.jsx("span",{className:"font-head text-[11px] uppercase tracking-wide4 text-fg",children:"Add to Playlist"})}),D&&e.jsx("button",{type:"button",onClick:it,className:"box-border bg-transparent border-0 cursor-pointer font-mono text-[10.5px] uppercase tracking-wide8 text-accent hover:underline",children:"Remove from playlist"})]})}),e.jsx(Dt,{open:De,onClose:()=>U(!1),playlist:l,onSuccess:_}),e.jsx(Rt,{open:Re,onClose:()=>le(!1),source:l,onSuccess:_}),e.jsx(Vt,{open:_e,onClose:()=>ne(!1),playlist:l,onSuccess:_}),e.jsx(Te,{open:Ve,handleClose:()=>G(!1),handleDelete:Je,title:"Delete this playlist?",actionBtnTitle:"Delete Playlist",subjectName:l.title,warning:`"${l.title}" and its ${j} videos will be removed for everyone it's shared with. This can't be undone.`}),e.jsx(Te,{open:Fe,handleClose:()=>{k(!1),O([])},handleDelete:et,title:I.length>1?"Remove videos?":"Remove from playlist?",actionBtnTitle:"Remove",warning:`${I.length} ${I.length===1?"video":"videos"} will be removed from this playlist. The source videos stay in your library.`}),e.jsx(Mt,{open:Le,onClose:()=>C(!1),triggerReason:"feature-locked",context:"engine-room",currentPlanLabel:"Starter",featureName:"Playlists"}),e.jsx($t,{open:Be,item:$e,onClose:()=>{ie(!1),de(null)},onOpenDetail:t=>Z(t)}),e.jsx(_t,{open:ze,onClose:()=>{Y(!1),q([])},collectionIds:Ue}),e.jsx(Lt,{open:ce,handleClose:()=>{F(!1),W([]),H([])},videoIds:Ge,workflow:"ENGINE_ROOM",practiceTypeByVideoId:qe}),e.jsx("span",{className:"sr-only",children:String(S)})]}):e.jsxs("div",{className:"px-4 md:px-8 pt-8",children:[e.jsx("div",{className:"h-8 w-2/3 bg-card-hi animate-pulse rounded mb-4"}),e.jsx("div",{className:"h-6 w-1/3 bg-card-hi animate-pulse rounded"})]})}function te({label:i,onClick:d,destructive:u}){return e.jsx("button",{type:"button",onClick:d,className:V("box-border w-full text-left bg-transparent border-0 cursor-pointer px-3 py-2 rounded-[2px] hover:bg-card transition-colors","font-body text-[13px]",u?"text-accent":"text-fg"),children:i})}function Qt({sortKey:i,sortOrder:d,onChange:u}){const[b,S]=r.useState(!1),m=r.useRef(null);r.useEffect(()=>{if(!b)return;const p=g=>{var L;(L=m.current)!=null&&L.contains(g.target)||S(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[b]);const f=i==="created_at"?"New to Old":"A to Z";return e.jsxs("div",{className:"relative",ref:m,children:[e.jsxs("button",{type:"button",onClick:()=>S(p=>!p),"aria-label":`Sort: ${f} ${d}`,className:"box-border h-8 bg-card border border-solid border-hairline rounded-[3px] px-3 inline-flex items-center gap-1.5 cursor-pointer hover:border-fg font-head text-[12px] font-bold uppercase tracking-wide10 text-fg",children:[e.jsx(qt,{className:"h-3.5 w-3.5"}),"Sort"]}),b&&e.jsx("ul",{className:"absolute right-0 mt-1.5 min-w-[180px] bg-card-hi border border-solid border-tt-border rounded-[2px] shadow-lg z-20 list-none pl-0 m-0",children:[{value:"created_at",label:"New to Old"},{value:"title",label:"A to Z"}].map(p=>e.jsx("li",{className:"list-none",children:e.jsx("button",{type:"button",onClick:()=>{u(p.value),S(!1)},className:V("box-border w-full text-left bg-transparent border-0 px-3 py-2 cursor-pointer hover:bg-bg-raised",p.value===i?"text-accent":"text-fg"),children:e.jsx("span",{className:"font-body text-[12.5px]",children:p.label})})},p.value))})]})}function Xt({isFilteredOrSearch:i,onClearSearch:d,onAddVideos:u}){return i?e.jsxs("div",{className:"border border-dashed border-tt-border rounded-[3px] px-7 py-12 flex flex-col items-start gap-3",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide12 text-subtle",children:"NO MATCH"}),e.jsx("h3",{className:"font-head font-bold uppercase text-fg leading-none m-0",style:{fontSize:"28px"},children:"The coaching vault is empty… for now."}),e.jsx("p",{className:"font-body text-[13.5px] text-muted max-w-[420px]",children:"Try a different search."}),e.jsx("button",{type:"button",onClick:d,className:"mt-2 box-border px-4 py-2 bg-accent-2 text-bg border-0 font-head font-bold uppercase text-[13px] tracking-wide10 rounded-[2px] curs
6or-pointer hover:brightness-110",children:"Clear search →"})]}):e.jsxs("div",{className:"border border-dashed border-tt-border rounded-[3px] px-7 py-12 flex flex-col items-start gap-3",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide12 text-subtle",children:"EMPTY PLAYLIST"}),e.jsx("h3",{className:"font-head font-bold uppercase text-fg leading-none m-0",style:{fontSize:"28px"},children:"This playlist is empty"}),e.jsx("p",{className:"font-body text-[13.5px] text-muted max-w-[420px]",children:"Add videos from any library category to start building."}),u&&e.jsx("button",{type:"button",onClick:u,className:"mt-2 box-border px-4 py-2 bg-accent text-bg border-0 font-head font-bold uppercase text-[13px] tracking-wide10 rounded-[2px] cursor-pointer hover:brightness-110",children:"+ Add Videos"})]})}export{Or 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.