1import{__toESM as e}from"./chunks/1790809380/DDUEPe6U.js";import"./chunks/1790809380/CG3sYyES.js";import"./chunks/1790809380/C5b_0cEQ.js";import{api as t,classes as n,facetQuery as r,require_jsx_runtime as l,require_react as a,trackEvent as s,useQuery as i,useUser as o,withClass as c}from"./chunks/1790809380/Dqgz-G6s.js";import"./chunks/1790809380/DnCzBP8g.js";import{renderApp as d}from"./chunks/1790809380/hpl3rnQR.js";import{hasReducedMotionListener as m,initPrefersReducedMotion as u,prefersReducedMotion as f}from"./chunks/1790809380/wT7Arjaa.js";import{B as h}from"./chunks/1790809380/DFYAR9Qb.js";var x=e(a(),1);let p={},g=["Hidden gem!","Most people haven't seen it!","A deep cut worth digging up.","One of our best-kept secrets.","Criminally underwatched."],b={"b-movie":["A best-seller for a reason!","Certified rewatchable.","The one your friends keep quoting.","Bad movie, great night."],short:["Short, but oh so worth it.","Educational... in the loosest sense."],jokes:["Bring your own movie, we'll bring the jokes.","Sync it up and settle in.","The blockbuster you already own, upgraded."],mst3k:["The one that started it all.","Push the button, Frank.","A fan-favorite from the SOL."],music:["Yes, we riffed music too.","Turn it up."],iRiff:["Straight from the community.","A fan pick worth a look."]};var v=e(l(),1);let j="riffstats_ticker",k=["There's more!","Keep going!","Keep rolling!","So many!","Still going!","We're just getting started!","Plenty more!","Riff on!"],w=["We make movies funny!","We don't make movies â we make fun of them.","Making movies funny since 2006.","Movies Made Funny"],y="riffstats.tagline",_=e=>{if(e<=0)return 0;let t=10**Math.floor(Math.log10(e));return Math.floor(e/t)*t},N=c` 2 not-prose 3 w-full 4 my-4 5 flex justify-center 6`("div"),S=c` 7 w-full max-w-[72rem] 8 flex flex-col items-center gap-1 9`("div"),M=()=>{let[e,t]=(0,x.useState)(null);return(0,x.useEffect)(()=>{t((()=>{try{let e=localStorage.getItem(y);if(e){let{i:t,t:n}=JSON.parse(e);if(Number.isInteger(t)&&w[t]&&Date.now()-n<2592e5)return w[t]}let t=Math.floor(Math.random()*w.length);return localStorage.setItem(y,JSON.stringify({i:t,t:Date.now()})),w[t]}catch(e){return w[Math.floor(Math.random()*w.length)]}})())},[]),(0,v.jsx)("a",{href:"/about",onClick:()=>s("select_content",{content_type:"about",item_name:e,carousel_name:j,click_target:"ticker_tagline"}),className:"riffticker-header text-2xl md:text-4xl font-extrabold leading-tight no-underline hover:opacity-80 transition-opacity text-center",children:e||"\xa0"})},R=c` 10 hidden sm:flex flex-nowrap items-stretch 11 w-full 12 rounded-xl 13 bg-base-200/60 14 border border-base-300/60 15`("div"),$=c` 16 relative 17 flex-1 min-w-0 18 flex items-center 19 px-3 md:px-4 20 bg-base-300/40 21 shadow-[inset_0_1px_10px_rgba(0,0,0,0.18)] 22 overflow-hidden 23`("div"),E=c` 24 riffticker-cap 25 flex-shrink-0 26 flex items-center gap-2 27 whitespace-nowrap 28 px-3 md:px-4 29 rounded-l-xl 30`("div"),C=()=>(0,v.jsxs)("a",{href:"/discover","aria-label":"Enter the RiffVerse",onClick:()=>s("select_content",{content_type:"discover",carousel_name:j,click_target:"ticker_discover"}),className:n(` 31 shrink-0 32 inline-flex items-center justify-center 33 rounded-full p-1 34 text-brand-gold/70 hover:text-brand-gold 35 hover:bg-brand-gold/10 36 transition-colors duration-200 37 no-underline 38 `),children:[(0,v.jsxs)("svg",{viewBox:"0 0 24 24",className:"w-5 h-5 md:w-6 md:h-6 shrink-0 animate-[riffticker-twinkle_3s_ease-in-out_infinite] hover:animate-none",fill:"currentColor","aria-hidden":"true",children:[(0,v.jsx)("path",{d:"M13 2c.3 3.4 1.6 4.7 5 5-3.4.3-4.7 1.6-5 5-.3-3.4-1.6-4.7-5-5 3.4-.3 4.7-1.6 5-5Z"}),(0,v.jsx)("path",{d:"M6 13c.15 1.7.8 2.35 2.5 2.5-1.7.15-2.35.8-2.5 2.5-.15-1.7-.8-2.35-2.5-2.5 1.7-.15 2.35-.8 2.5-2.5Z"}),(0,v.jsx)("path",{d:"M18.5 15c.1 1.1.5 1.5 1.5 1.6-1 .1-1.4.5-1.5 1.6-.1-1.1-.5-1.5-1.5-1.6 1-.1 1.4-.5 1.5-1.6Z"})]}),(0,v.jsx)("span",{className:"sr-only",children:"Enter the RiffVerse"})]}),F=c` 39 relative 40 w-full min-w-0 41 h-11 md:h-12 42 overflow-hidden 43 flex items-center 44`("div"),L=(0,x.memo)(({total:e})=>{let t=_(e),[n,r]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let e=0,t=setInterval(()=>{r((e+=1)%2==0?null:k[(e>>1)%k.length])},6e4);return()=>clearInterval(t)},[]),(0,v.jsx)(E,{children:(0,v.jsx)("span",{className:"text-base sm:text-lg md:text-xl font-extrabold leading-none tabular-nums text-brand-gold animate-[riffticker-in_0.45s_ease-out]",children:n||(t>0?(0,v.jsxs)(v.Fragment,{children:["Over"," ",(0,v.jsx)(h,{isCounting:!0,start:Math.round(.6*t),end:t,duration:1.2,formatter:e=>
44Math.round(e).toLocaleString()},t)," ","Riffed!"]}):(0,v.jsx)("span",{className:"opacity-40",children:"Over\xa0â¦\xa0Riffed!"}))},null!=n?n:"count")})}),T=({rating:e})=>{let t=Math.max(0,Math.min(100,e/5*100));return(0,v.jsxs)("span",{className:"relative inline-block leading-none align-middle",role:"img","aria-label":`${e.toFixed(1)} out of 5 stars`,children:[(0,v.jsx)("span",{className:"text-base-content/25",children:"â â â â â "}),(0,v.jsx)("span",{className:"absolute inset-0 overflow-hidden whitespace-nowrap text-brand-gold",style:{width:`${t}%`},"aria-hidden":"true",children:"â â â â â "})]})},O={bestseller:{label:"Best Seller",className:"badge-warning"},top_rated:{label:"Top Rated",className:"badge-accent"}},q=["bestseller","top_rated"],A={"b-movie":"/catalog/movies",short:"/catalog/shorts",jokes:"/catalog/jokes",mst3k:"/catalog/mst3k"},B=e=>A[e]||"/catalog",I={"b-movie":"Features",short:"Shorts",jokes:"Just the Jokes",mst3k:"MST3K",music:"Music",iRiff:"iRiffs"},J=({item:e,isRecommended:t=!1,position:r,twoLine:l=!1})=>{let a=(e=>{if(!e)return null;let t=new Date(e).getFullYear();return Number.isFinite(t)?t:null})(e.released),i=t?null:((e,t=10)=>{if(!e)return null;if(p[e.nid])return p[e.nid];let n=(e=>{let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)})(e.title||String(e.nid));if(e.low_views)return g[n%g.length];let r=b[e.type];return r&&0!==r.length&&n%t==0?r[n%r.length]:null})(e),o=q.find(t=>{var n;return null==(n=e.badges)?void 0:n.includes(t)});return(0,v.jsxs)("a",{href:e.path,onClick:()=>s("select_content",{content_type:"product",item_id:e.nid,item_name:e.title,carousel_name:j,carousel_position:r,click_target:"ticker_title",recommended:t}),className:n(` 45 min-w-0 max-w-full 46 no-underline group 47 ${l?"w-full flex flex-col items-center gap-0.5 text-center":"flex items-center gap-1.5 md:gap-2"} 48 `),children:[(0,v.jsx)("span",{className:n(` 49 min-w-0 max-w-full font-semibold italic leading-tight 50 group-hover:text-primary 51 ${l?"text-sm line-clamp-2 text-balance":"text-sm md:text-base truncate"} 52 `),children:e.title}),(0,v.jsxs)("span",{className:n(` 53 min-w-0 max-w-full 54 ${l?"flex items-center justify-center gap-1.5 flex-nowrap overflow-hidden":"contents"} 55 `),children:[o&&(0,v.jsx)("span",{className:`badge badge-xs md:badge-sm shrink-0 whitespace-nowrap font-semibold ${O[o].className}`,children:O[o].label}),e.rating>0&&(0,v.jsxs)("span",{className:n(` 56 items-center gap-1 shrink-0 text-xs md:text-sm 57 ${l?"flex":"hidden sm:flex"} 58 `),children:[(0,v.jsx)(T,{rating:e.rating}),(0,v.jsx)("span",{className:"tabular-nums opacity-70",children:e.rating.toFixed(1)})]}),a&&(0,v.jsx)("span",{className:"shrink-0 text-xs md:text-sm opacity-60 tabular-nums",children:a})]}),t?(0,v.jsx)("span",{className:"hidden md:inline shrink-0 text-xs text-primary/80 italic whitespace-nowrap",children:"â Recommended for you"}):i&&(0,v.jsxs)("span",{className:"hidden lg:block min-w-0 shrink text-xs opacity-60 italic truncate",children:["â ",i]})]})},K=({item:e,typeTotal:t})=>(0,v.jsxs)("a",{href:B(e.type),title:`Browse all ${e.type_label} riffs`,onClick:()=>s("select_content",{content_type:"catalog_type",item_name:e.type_label,item_type:e.type,carousel_name:j,click_target:"ticker_type"}),className:n(` 59 group/type 60 flex-shrink-0 w-24 md:w-28 61 flex flex-col items-center justify-center leading-none 62 px-2 no-underline 63 `),children:[(0,v.jsx)("span",{className:"text-xs md:text-sm font-semibold whitespace-nowrap",children:I[e.type]||(e.type_label?`${e.type_label}s`:"Riffs")}),t>0&&(0,v.jsx)("span",{className:"text-base md:text-xl font-extrabold tabular-nums text-brand-gold leading-none",children:(0,v.jsx)(h,{isCounting:!0,start:Math.round(.65*t),end:t,duration:1,formatter:e=>Math.round(e).toLocaleString()},t)})]}),D=[{type:"b-movie",label:"Features"},{type:"short",label:"Shorts"},{type:"jokes",label:"Jokes"}],V=({total:e,typeCounts:t,current:r,recommended:l,cursor:a,reduceMotion:i})=>{let o=_(e),c=null==r?void 0:r.type;return(0,v.jsxs)("div",{className:"sm:hidden w-full flex flex-col items-center gap-1",children:[(0,v.jsx)("span",{className:"riffticker-header text-xl font-extrabold leading-tight",children:o>
630?(0,v.jsxs)(v.Fragment,{children:["Over ",o.toLocaleString()," Riffed!"]}):(0,v.jsx)("span",{className:"opacity-40",children:"Over\xa0â¦\xa0Riffed!"})}),(0,v.jsxs)("div",{className:"w-full rounded-xl bg-base-200/60 border border-base-300/60 overflow-hidden",children:[(0,v.jsx)("div",{className:"riffticker-cap flex divide-x divide-base-300/70",children:D.map(({type:e,label:r})=>{var l;return(0,v.jsxs)("a",{href:B(e),onClick:()=>s("select_content",{content_type:"catalog_type",item_name:r,item_type:e,carousel_name:j,click_target:"ticker_type"}),className:n(` 64 flex-1 flex flex-col items-center justify-center gap-0.5 py-1.5 leading-none no-underline 65 border-b-2 transition-all duration-300 66 ${e===c?`bg-brand-gold/10 border-brand-gold ${i?"":"-translate-y-0.5"}`:"border-transparent translate-y-0"} 67 `),children:[(0,v.jsx)("span",{className:"text-xs font-semibold",children:r}),(0,v.jsx)("span",{className:"text-lg font-extrabold tabular-nums text-brand-gold",children:(null!=(l=null==t?void 0:t.get(e))?l:0).toLocaleString()||"0"})]},e)})}),(0,v.jsx)("div",{className:"relative min-h-14 flex items-center justify-center px-3 py-1.5 bg-base-300/40 shadow-[inset_0_1px_10px_rgba(0,0,0,0.18)] overflow-hidden",children:r?(0,v.jsx)("div",{className:n(` 68 w-full flex items-center justify-center min-w-0 max-w-full 69 ${i?"":"animate-[riffticker-in_0.45s_ease-out]"} 70 `),children:(0,v.jsx)(J,{item:r,isRecommended:l.has(r.nid),position:a,twoLine:!0})},r.nid):(0,v.jsx)("div",{className:"skeleton h-5 w-36 rounded"})})]})]})};var W=()=>{var e;let[l,a]=(0,x.useState)(0),[s,c]=(0,x.useState)([]),[d,h]=(0,x.useState)(0),[p,g]=(0,x.useState)(0),[b,j]=(0,x.useState)(!1),k=function(){m.current||u();let[e]=(0,x.useState)(f.current);return e}(),{data:w}=i(((e=0,n=100)=>({queryKey:["productTicker",e,n],queryFn:()=>t.get(`/api/dante/product_ticker?page=${e}&pagesize=${n}`,{credentials:"omit"}).json()}))(l,100)),{uid:y}=o(),{data:_=new Set}=i({enabled:!!y&&y>0,queryKey:["user_recommendations",y],queryFn:async()=>!y||y<=0?[]:t.get(`/api/dante/user_recommendations/${y}`).json(),select:e=>new Set((null!=e?e:[]).slice(0,40).map(e=>e.nid)),placeholderData:[],staleTime:3e5}),{data:E}=i({...r("type"),select:({terms:e})=>new Map(e.map(e=>[e.term,e.count]))}),T=(0,x.useRef)(new Set);(0,x.useEffect)(()=>{var e;w&&(h(null!=(e=w.total)?e:0),T.current.has(w.page)||(T.current.add(w.page),c(e=>{var t;let n=w.page*w.pagesize,r=e.slice();return(e=>{let t=e.slice();for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t})(null!=(t=w.items)?t:[]).forEach((e,t)=>{r[n+t]=e}),r})))},[w]);let O=(0,x.useRef)(0);O.current=s.length;let q=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=()=>{q.current&&(clearTimeout(q.current),q.current=null)},t=()=>{e(),b||document.hidden||(q.current=setTimeout(()=>{g(e=>{let t=O.current;return t>0?(e+1)%t:0}),t()},5e3))},n=()=>t();return document.addEventListener("visibilitychange",n),t(),()=>{document.removeEventListener("visibilitychange",n),e()}},[b]),(0,x.useEffect)(()=>{let e=s.length;d>e&&p>=e-3&&a(e=>100*e+100<d?e+1:e)},[p,s.length,d]);let A=(0,x.useRef)(null),B=s.length?s[p%s.length]:null;return(0,v.jsx)(N,{ref:e=>{if(A.current&&(A.current(),A.current=null),!e)return;let t=()=>j(!0),n=()=>j(!1);e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",n),A.current=()=>{e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",n)}},children:(0,v.jsxs)(S,{children:[(0,v.jsx)(M,{}),(0,v.jsx)(V,{total:d,typeCounts:E,current:B,recommended:_,cursor:p,reduceMotion:k}),(0,v.jsxs)(R,{children:[(0,v.jsx)(L,{total:d}),(0,v.jsx)("div",{className:"riffticker-cap flex-shrink-0 flex items-stretch border-l border-r border-base-300/70 overflow-hidden",children:B&&(0,v.jsx)("div",{className:n(` 71 flex items-stretch 72 ${k?"":"animate-[riffticker-in_0.45s_ease-out]"} 73 `),children:(0,v.jsx)(K,{item:B,typeTotal:null!=(e=null==E?void 0:E.get(B.type))?e:0})},B.nid)}),(0,v.jsx)($,{children:(0,v.jsx)(F,{children:B?(0,v.jsx)("div",{className:n(` 74 flex items-center min-w-0 max-w-full 75 ${k?"":"animate-[riffticker-in_0.45s_ease-out]"} 76 `),children:(0,v.jsx)(J,{item:B,isRecommended:_.has(B.nid),position:p})},B.nid):(0,v.jsx)("div",{className:"skeleton h-6 w-40 rounded"})})}),(0,v.jsx)("div",{className:"riffticker-cap tooltip tooltip-left flex-shrink-0 flex items-center pl-2 pr-2 md:pl-3 md:pr-3 rounded-r-xl border-l border-base-300/70","data-tip":"Enter the RiffVerse",children:(0,v.jsx)(C,{})})]})]})})};d(()=>(0,v.jsx)(W,{}),"riffticker");
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.