PageSourceSearch

https://www.headtrip.pl/_next/static/chunks/9287-75543681de1baca7.js

js headtrip.pl collected 2026-10-06 13:33:11 UTC 8,629 bytes, 24 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9287],{9287:(e,t,r)=>{r.r(t),r.d(t,{VideoModal:()=>d,getYouTubeId:()=>c});var n=r(5155),a=r(2115),o=r(7650),i=r(1783),l=r(5011);let s=[25,50,75];function c(e){if(!e)return null;let t=e.trim();if(/^[\w-]{11}$/.test(t))return t;let r=t.match(/(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/|live\/|v\/))([\w-]{11})/);return r?r[1]:null}let u=null;function d({entry:e,onClose:t}){let[r,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[b,h]=(0,a.useState)(!1),[v,g]=(0,a.useState)(!1),[x,w]=(0,a.useState)(!1),y=(0,a.useRef)(null),F=(0,a.useRef)(null),k=(0,a.useRef)(null),j=(0,a.useRef)(null),E=(0,a.useRef)(t);E.current=t;let L=c(i.QL.youtubeUrl);return(0,a.useEffect)(()=>{let e=document.activeElement,t=document.documentElement,r=t.style.overflow;t.style.overflow="hidden";let n=requestAnimationFrame(()=>m(!0));k.current?.focus({preventScroll:!0});let a=0,o=e=>{"Escape"===e.key?(e.preventDefault(),E.current()):"Tab"===e.key&&(a=Date.now())},i=e=>{let t=F.current;t&&!t.contains(e.target)&&k.current?.focus({preventScroll:!0})},l=()=>{setTimeout(()=>{let e=document.activeElement;e&&"IFRAME"===e.tagName&&F.current?.contains(e)&&Date.now()-a>400&&k.current?.focus({preventScroll:!0})},0)};return document.addEventListener("keydown",o),document.addEventListener("focusin",i),window.addEventListener("blur",l),()=>{cancelAnimationFrame(n),document.removeEventListener("keydown",o),document.removeEventListener("focusin",i),window.removeEventListener("blur",l),t.style.overflow=r,e&&"function"==typeof e.focus&&e.focus({preventScroll:!0})}},[]),(0,a.useEffect)(()=>{if(!L)return void f(!0);let t=null,r=null,n=null,a=null,o=!1,c=!1,d=[],m=()=>{if(o)return;let e=j.current?.querySelector("iframe");e&&(e.style.width="99.9%",requestAnimationFrame(()=>{e.style.width="100%"}))},p=e=>{try{return e?.getPlayerState?.()===1}catch{return!1}},b=new Set,v=j.current,x=t=>{b.has(t)||(b.add(t),(0,l.s)({event:t,video_entry:e,video_title:i.QL.title,video_id:L}))},F=()=>{try{let e=t?.getDuration?.()||0,r=t?.getCurrentTime?.()||0;if(e>0)for(let t of s)r/e>=t/100&&x(`ba_video_${t}`)}catch{}},k=()=>{n&&(clearInterval(n),n=null)},E=()=>{r&&(clearInterval(r),r=null)},T=j.current;if(!T)return;let S=new URLSearchParams({autoplay:"1",rel:"0",playsinline:"1",modestbranding:"1",enablejsapi:"1",origin:window.location.origin}),I=document.createElement("iframe");I.src=`https://www.youtube-nocookie.com/embed/${L}?${S.toString()}`,I.title=i.QL.title,I.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen",I.setAttribute("allowfullscreen",""),I.referrerPolicy="strict-origin-when-cross-origin",T.appendChild(I);let _=Date.now();a=setTimeout(()=>{o||y.current||f(!0)},15e3);let N=()=>{if(h(!0),g(!1),!c)for(let e of(c=!0,[50,400,1200,2500]))d.push(setTimeout(m,e));x("ba_video_start"),r||(r=setInterval(F,500))};return(window.YT&&window.YT.Player?Promise.resolve(window.YT):u||(u=new Promise((e,t)=>{let r=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{if("function"==typeof r)try{r()}catch{}e(window.YT)};let n=document.createElement("script");n.src="https://www.youtube.com/iframe_api",n.async=!0,n.onerror=()=>{u=null,n.remove(),t(Error("YouTube IFrame API load failed"))},document.head.appendChild(n)}))).then(e=>{o||(t=new e.Player(I,{events:{onReady:e=>{if(o)return;if(y.current=e.target,a&&(clearTimeout(a),a=null),p(e.target))N();else try{e.target.playVideo()}catch{}let t=0;n=setInterval(()=>{let r=e.target;if(o||p(r))return void k();let n=-1;try{n=r.getPlayerState()}catch{}let a=Date.now();if(t){let e=a-t;if(e>=3e3&&(3!==n||e>=6e3)){k();try{r.unMute()}catch{}w(!1),g(!0)}}else{let e=a-_;if(e>=2e3&&(3!==n||e>=4500)){t=a;try{r.mute(),r.playVideo()}catch{}w(!0)}}},250)},onStateChange:t=>{let r=e.PlayerState;t.data===r.PLAYING?N():(E(),F()),t.data===r.ENDED&&x("ba_video_complete")},onError:()=>{o||f(!0)}}}))}).catch(()=>{o||f(!0)}),()=>{o=!0,E(),k(),d.forEach(clearTimeout),a&&clearTimeout(a),y.current=null;try{t?.stopVideo?.()}catch{}try{t?.destroy?.()}catch{}v&&(v.innerHTML="")}},[L,e]),(0,o.createPortal)((0,n.jsxs)("div",{ref:F,role:"dialog","aria-modal":"true","aria-label":`Film: ${i.QL.title}`,className:"ba-vm","data-on":r?"1":"0",onClick:e=>{e.target===e.currentTarget&&t()},children:[(0,n.jsx)("style",{children:`
2        .ba-vm { position:fixed; inset:0; z-index:9990; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(7,7,10,0); transition:background-color 0.25s ease; font-family:'Inter',sans-serif; }
3        .ba-vm[data-on="1"] { background:rgba(7,7,10,0.92); }
4        .ba-vm-player { position:relative; width:min(1280px, 92vw, calc((100vh - 120px) * 16 / 9)); aspect-ratio:16/9; background:#000 center/cover no-repeat; box-shadow:0 40px 120px rgba(0,0,0,0.6); }
5        .ba-vm-frame, .ba-vm-frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; display:block; }
6        .ba-vm-x { position:fixed; top:20px; right:20px; width:44px; height:44px; border-radius:50%; border:none; background:rgba(255,255,255,0.12); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background 0.2s ease; -webkit-tap-highlight-color:transparent; }
7        .ba-vm-x:hover { background:rgba(255,255,255,0.22); }
8        .ba-vm-x:focus { outline:none; }
9        .ba-vm-x:focus-visible { outline:2px solid rgba(255,255,255,0.8); outline-offset:3px; }
10        .ba-vm-fail { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; text-align:center; color:#FFFFFF; font-size:15px; line-height:1.5; background:rgba(7,7,10,0.72); }
11        .ba-vm-fail a { color:#C9C6FF; text-decoration:underline; }
12        .ba-vm-load { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:#FFFFFF; font-size:14px; background:rgba(7,7,10,0.55); pointer-events:none; }
13        .ba-vm-spin { width:44px; height:44px; border-radius:50%; border:3px solid rgba(255,255,255,0.25); border-top-color:#FFFFFF; animation:ba-vm-rot 0.8s linear infinite; }
14        @keyframes ba-vm-rot { to { transform:rotate(360deg); } }
15        .ba-vm-snd { position:absolute; left:50%; bottom:64px; transform:translateX(-50%); display:flex; align-items:center; gap:8px; padding:12px 20px; border:none; border-radius:100px; background:#5147E5; color:#FFFFFF; font-family:'Inter',sans-serif; font-size:15px; font-weight:600; cursor:pointer; box-shadow:0 8px 24px rgba(0,0,0,0.35); -webkit-tap-highlight-color:transparent; }
16        .ba-vm-snd:hover { background:#463CD6; }
17        .ba-vm-snd:focus-visible { outline:2px solid #FFFFFF; outline-offset:3px; }
18        @media (prefers-reduced-motion: reduce) { .ba-vm-spin { animation-duration:2.4s; } }
19        @media (max-width: 767px) {
20          .ba-vm { padding:16px; }
21          .ba-vm-player { width:100%; }
22          .ba-vm-x { top:14px; right:14px; }
23        }
24      `}),(0,n.jsx)("button",{ref:k,type:"button",className:"ba-vm-x","aria-label":"Zamknij film",onClick:t,children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})}),(0,n.jsxs)("div",{className:"ba-vm-player",style:i.QL.thumb&&!b?{backgroundImage:`url("${i.QL.thumb}")`}:void 0,children:[(0,n.jsx)("div",{ref:j,className:"ba-vm-frame"}),!b&&!v&&!p&&(0,n.jsxs)("div",{className:"ba-vm-load",role:"status","aria-live":"polite",children:[(0,n.jsx)("div",{className:"ba-vm-spin","aria-hidden":"true"}),(0,n.jsx)("span",{children:"Ładowanie filmu…"})]}),b&&x&&!p&&(0,n.jsxs)("button",{type:"button",className:"ba-vm-snd",onClick:()=>{let e=y.current;try{e?.unMute?.(),e?.setVolume?.(100),e?.playVideo?.()}catch{}w(!1)},children:[(0,n.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),(0,n.jsx)("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),(0,n.jsx)("path",{d:"M19 5a10 10 0 0 1 0 14"})]}),"Włącz dźwięk"]}),p&&(0,n.jsxs)("div",{className:"ba-vm-fail",role:"alert",children:[(0,n.jsx)("span",{children:"Nie udało się załadować filmu."}),L&&(0,n.jsx)("a",{href:`https://www.youtube.com/watch?v=${L}`,target:"_blank",rel:"noopener noreferrer",children:"Otw\xf3rz film na YouTube"})]})]})]}),document.body)}}}]);

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.