PageSourceSearch

https://tsofit.org.il/assets/VideoGalleryPage-DMfKG7tU.js

js tsofit.org.il collected 2026-10-02 14:22:19 UTC 5,320 bytes, 1 lines download raw bytes

1import{ag as N,ac as k,r as l,d as _,aV as C,j as e,b as P,aj as b,au as S,Z as E}from"./index-BH8Hq4fF.js";import{L}from"./LoadError-DtFBUis7.js";import{Y as f}from"./youtube-CpfQxPon.js";import{P as g}from"./play-BtMz3qTH.js";import"./refresh-cw-kjmzcQOe.js";function m(a){const r=String(a||"").match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|shorts\/|v\/))([\w-]{11})/);return r?r[1]:null}const M=a=>{const r=m(a);return r?`https://img.youtube.com/vi/${r}/hqdefault.jpg`:null};function I(){const{t:a}=N(),{id:r}=k(),[o,j]=l.useState([]),[w,u]=l.useState(!0),[y,x]=l.useState(!1),[i,v]=l.useState("all"),[n,d]=l.useState(null),c=l.useCallback(async()=>{u(!0),x(!1);try{const s=await _.entities.AdminPublication.filter({kind:"video",is_active:!0},"display_order",200);j((s||[]).filter(t=>t.show_in_gallery&&m(t.video_url)))}catch(s){console.error(s),x(!0)}finally{u(!1)}},[]);l.useEffect(()=>{c()},[c]);const h=l.useMemo(()=>[...new Set(o.map(t=>t.module_key).filter(Boolean))].filter(t=>C[t]),[o]),p=l.useMemo(()=>i==="all"?o:o.filter(s=>s.module_key===i),[o,i]);return w?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(P,{className:"w-8 h-8 text-primary animate-spin"})}):y?e.jsx("div",{dir:"rtl",children:e.jsx(L,{onRetry:c})}):e.jsxs("div",{dir:"rtl",className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-12 h-12 rounded-2xl bg-rose-50 grid place-items-center flex-none",children:e.jsx(f,{className:"w-7 h-7 text-rose-600"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-extrabold text-slate-900",children:"סרטוני הדרכה"}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:"סרטוני הדרכה והיכרות עם מערכת ניהול הקהילה"})]})]}),h.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"all",label:"הכל"},...h.map(s=>({key:s,label:b(s,a).label||s}))].map(s=>e.jsx("button",{onClick:()=>v(s.key),className:`h-9 px-4 rounded-full text-sm font-bold border-2 transition-all ${i===s.key?"bg-rose-600 border-rose-600 text-white shadow-sm":"bg-white border-slate-200 text-slate-600 hover:border-rose-300 hover:bg-rose-50"}`,children:s.label},s.key))}),p.length===0?e.jsxs("div",{className:"text-center py-20 bg-white rounded-2xl border border-slate-100 shadow-sm",children:[e.jsx(f,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-slate-500",children:"אין סרטוני הדרכה בגלריה כרגע"})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(s=>{const t=s.module_key?b(s.module_key,a):null;return e.jsxs("button",{onClick:()=>d(s),className:"group text-right bg-white rounded-2xl border border-slate-100 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"relative aspect-video bg-slate-900 overflow-hidden",children:[e.jsx("img",{src:M(s.video_url),alt:"",className:"absolute inset-0 w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500"}),e.jsx("span",{className:"absolute inset-0 grid place-items-center bg-black/10 group-hover:bg-black/25 transition-colors",children:e.jsx("span",{className:"w-14 h-14 rounded-full bg-red-600/95 grid place-items-center shadow-lg group-hover:scale-110 transition-transform",children:e.jsx(g,{className:"w-6 h-6 text-white translate-x-[1px]",fill:"currentColor"})})})]}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[t&&e.jsx("span",{className:"inline-block self-start mb-1.5 px-2 py-0.5 rounded-full text-[0.625rem] font-bold bg-rose-50 text-rose-700",children:t.label}),e.jsx("h3",{className:"text-sm font-bold text-slate-800 leading-snug line-clamp-2",children:s.title||"סרטון הדרכה"}),e.jsxs("span",{className:"mt-auto pt-2.5 text-xs font-bold text-rose-600 inline-flex items-center gap-1",children:[e.jsx(g,{className:"w-3.5 h-3.5"})," צפייה בסרטון"]})]})]},s.id)})}),n&&S.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-3 sm:p-6",dir:"rtl",onClick:()=>d(null),children:[e.jsx("div",{className:"absolute inset-0 bg-slate-100/80 backdrop-blur-md"}),e.jsxs("div",{className:"relative w-full max-w-[min(94vw,1000px)] bg-white rounded-3xl shadow-2xl ring-1 ring-slate-200 p-3 sm:p-4",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pb-2.5",children:[e.jsx("h3",{className:"text-slate-800 text-sm sm:text-base font-bold truncate",children:n.title||"סרטון"}),e.jsx("button",{onClick:()=>d(null),"aria-label":"סגור",className:"flex-none w-9 h-9 rounded-full bg-slate-100 hover:bg-slate-200 grid place-items-center text-slate-600",children:e.jsx(E,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"relative w-full aspect-video rounded-2xl overflow-hidden bg-black",children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${m(n.video_url)}?rel=0&modestbranding=1&playsinline=1&autoplay=1`,title:n.title||"video",className:"absolute inset-0 w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]})]}),document.body)]})}
1export{I 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.