(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7990],{14577:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai",function(){return n(79756)}])},20754:function(e,t,n){"use strict";var i=n(85893),l=n(67294),a=n(46791),r=n.n(a),o=n(41664),s=n.n(o),c=n(13114),d=n(34221),u=n(50549),p=n(72679);n(88922),t.Z=e=>{var t,n,a,o,h,v;let{data:m,media_type:_,genresMovie:g,genresTv:f,cardType:x}=e,[S,j]=(0,l.useState)(!0),[y,w]=(0,l.useState)(g),[N,b]=(0,l.useState)(f),[E,k]=(0,l.useState)(!0),[C,T]=(0,l.useState)(!1),I=new Date((null==m?void 0:m.release_date)||(null==m?void 0:m.first_air_date)).getFullYear()||(null==m?void 0:null===(t=m.release_date)||void 0===t?void 0:t.split("-")[2]),P=null==m?void 0:m.original_language,D=[];return null==m||null===(n=m.genre_ids)||void 0===n||n.map(e=>{(null==m?void 0:m.media_type)==="movie"||"movie"===_?null==y||y.map(t=>{(null==t?void 0:t.id)===e&&D.push(null==t?void 0:t.name)}):((null==m?void 0:m.media_type)==="tv"||"tv"===_)&&(null==N||N.map(t=>{(null==t?void 0:t.id)===e&&D.push(null==t?void 0:t.name)}))}),console.log({Genres:D}),(0,i.jsxs)(s(),{href:"".concat((null==m?void 0:m.media_type)==="person"?"/person?id="+(null==m?void 0:m.id):"/detail?type="+((null==m?void 0:m.media_type)||_)+"&id="+(null==m?void 0:m.id)),className:r().MovieCardSmall,"aria-label":(null==m?void 0:m.name)||"poster","data-tooltip-id":"tooltip","data-tooltip-html":"".concat((null==m?void 0:null===(a=m.title)||void 0===a?void 0:a.length)>30||(null==m?void 0:null===(o=m.name)||void 0===o?void 0:o.length)>30?(null==m?void 0:m.title)||(null==m?void 0:m.name):""),children:[(0,i.jsx)(c.M,{mode:"sync",children:(0,i.jsx)(d.E.div,{whileHover:{y:"-0.5rem"},whileTap:{y:"0.2rem"},transition:{type:"spring",stiffness:400,damping:10},children:(0,i.jsx)("div",{className:"".concat(r().img," ").concat((null==m?void 0:m.poster_path)!==null&&(null==m?void 0:m.poster_path)!==void 0?"skeleton":null),children:(0,i.jsx)("div",{children:(0,i.jsx)(p.LazyLoadImage,{src:"".concat(C?"/images/fallback_person.jpg":(null==m?void 0:m.poster_path)!==null&&(null==m?void 0:m.poster_path)!==void 0||(null==m?void 0:m.profile_path)!==null&&(null==m?void 0:m.profile_path)!==void 0||(null==m?void 0:m.still_path)!==null&&(null==m?void 0:m.still_path)!==void 0?"https://image.tmdb.org/t/p/original".replace("/original","/w185")+((null==m?void 0:m.poster_path)||(null==m?void 0:m.profile_path)||(null==m?void 0:m.still_path))||null:S?"/images/logo.svg":"/images/fallback_person.jpg"),height:"100%",width:"100%",useIntersectionObserver:!0,effect:"opacity",className:"".concat(r().img," ").concat(S?"skeleton":null),onLoad:()=>{setTimeout(()=>{j(!1),k(!1)},700)},loading:"lazy",onError:e=>{T(!0),j(!1)},alt:(null==m?void 0:m.id)||"sm"},null==m?void 0:m.id)})})})}),(0,i.jsxs)("div",{className:"".concat(r().metaData),children:[(0,i.jsx)("h1",{children:(null==m?void 0:m.title)||(null==m?void 0:m.name)||(0,i.jsx)(u.Z,{count:2})}),(0,i.jsxs)("p",{children:[(null==(v=(null==m?void 0:m.media_type)||_)?void 0:v.charAt(0).toUpperCase())+(null==v?void 0:v.slice(1)),(null==m?void 0:m.vote_average)?" • ".concat(null===(h=parseInt(null==m?void 0:m.vote_average))||void 0===h?void 0:h.toFixed(1)):null,(null==m?void 0:m.media_type)==="person"||Number.isNaN(I)?null:" • ".concat(I)," ",(null==m?void 0:m.media_type)==="person"&&(null==m?void 0:m.known_for_department)?" • ".concat(null==m?void 0:m.known_for_department):null," ",void 0!==P?" • ".concat(P.toUpperCase()):null]}),(null==m?void 0:m.genre_ids)?(null==D?void 0:D.length)>0&&(null==D?void 0:D.join(", ")):null==m?void 0:m.genres]})]},null==m?void 0:m.id)}},79756:function(e,t,n){"use strict";n.r(t);var i=n(85893),l=n(67294),a=n(2873),r=n(37481),o=n.n(r),s=n(20754),c=n(50549),d=n(74865),u=n.n(d),p=n(9008),h=n.n(p),v=n(34221);let m=[1,2,3,4,5,6,7,8,9,10];t.default=e=>{let{categoryType:t}=e,[n,r]=(0,l.useState)(""),[d,p]=(0,l.useState)([]),[_,g]=(0,l.useState)(1),[f,x]=(0,l.useState)(!0),[S,j]=(0,l.useState)([]),[y,w]=(0,l.useState)([]),[N,b]=(0,l.useState)(!1),[E,k]=(0,l.useState)(!1),[C,T]=(0,l.useState)(!1),I=(0,l.useRef)(null),P=["Russian Gangster Chronicles","Post-Apocalyptic Survival","High-Stakes Heists","Coming-of-Age Stories","Political Intrigue Thrillers","Supernatural Adventures","Romantic Dramas with a Twist","Gripping Courtroom Battles","Epic Fantasy","Spy Espionage Action","True Crime Documentaries","Space Exploration Epics","Time-Travel Conundrums","Hilarious Workplace Comedies","Psychological Thrillers","Underdog Sports Stories","Heartwarming Family Tales","Musical Biographies","Horror in Small Towns","Revenge and Redemption Sagas"],D=new Date().getDate()%(null==P?void 0:P.length);return(0,l.useEffect)(()=>{(async()=>{try{let e=await (0,a.Z)({requestID:"genresMovie"}),t=await (0,a.Z)({requestID:"genresTv"});j(e.genres),w(t.genres)}catch(e){console.error("Error fetching genres:",e)}})(),null==I||I.current.focus();let e=e=>{"/"===e.key?(e.preventDefault(),null==I||I.current.focus()):"Escape"===e.key&&(e.preventDefault(),null==I||I.current.blur())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]),(0,l.useEffect)(()=>{let e;let t=async e=>{x(!0);try{let t;t=e?await (0,a.Z)({requestID:C?"aiRecommendationWithTitle":"aiRecommendation",page:_,query:n}):await (0,a.Z)({requestID:C?"aiRecommendationWithTitle":"aiRecommendation",page:_,query:P[D]}),p(t),x(!1)}catch(e){console.error("Error fetching data:",e)}};return(null==n?void 0:n.length)>1&&(clearTimeout(e),e=setTimeout(()=>{n.length>=2&&t(!0)},600)),(null==n?void 0:n.length)===0&&t(!1),()=>clearTimeout(e)},[n,_,C]),(0,l.useEffect)(()=>{f?u().start():u().done(!1)},[f]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h(),{children:(0,i.jsx)("title",{children:"Rive | AI "})}),(0,i.jsxs)("div",{className:o().MoviePage,children:[E&&(0,i.jsx)("div",{className:o().settingsPopover,onClick:()=>k(!1),children:(0,i.jsxs)(v.E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},className:o().settingsPopoverCard,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,i.jsx)("h1",{className:o().aiHeader,children:(0,i.jsxs)("p",{children:["Rive",(0,i.jsx)("span",{children:"AI"})]})}),(0,i.jsxs)("span",{className:o().highlight,children:[(0,i.jsx)("p",{children:"Technologies used"}),(0,i.jsx)("p",{children:"1. AstraDB"}),(0,i.jsx)("p",{children:"2. TMDB Dataset"}),(0,i.jsx)("p",{children:"3. NVDIA : NV-Embed-QA"})]}),(0,i.jsxs)("span",{className:o().highlight,children:[(0,i.jsx)("p",{children:"Stats"}),(0,i.jsx)("p",{children:"1. Dataset Size: 100k+"}),(0,i.jsx)("p",{children:"2. Movie: 17/09/2024"}),(0,i.jsx)("p",{children:"3. Tv Shows: 0304/2024"})]})]})}),(0,i.jsx)("h1",{className:o().aiHeader,children:(0,i.jsxs)("p",{"aria-label":"RiveAI","data-tooltip-id":"tooltip","data-tooltip-content":"Search powered by GenAI",onClick:()=>k(!E),children:["Rive",(0,i.jsx)("span",{children:"AI"})]})}),(0,i.jsxs)("div",{className:"".concat(o().InputWrapper," ").concat(o().AiInputWrapper),children:[(0,i.jsx)("input",{ref:I,type:"text",className:o().searchInput,value:n,onChange:e=>r(e.target.value),placeholder:"Search powered by AI... Minimum charecter required is 2",onFocus:()=>b(!0),onBlur:()=>b(!1)}),(0,i.jsx)("div",{className:o().inputShortcut,children:N?(0,i.jsx)("span",{className:"tooltip-btn",children:"Esc"}):(0,i.jsx)("span",{className:"tooltip-btn",children:"/"})})]}),(0,i.jsx)("div",{className:o().searchWithTitle,children:(0,i.jsx)("div",{className:"".concat(o().checkboxDiv," ").concat(C?o().active:o().inactive),"data-tooltip-id":"tooltip","data-tooltip-content":"Include movie/show titles in search criteria",children:(0,i.jsxs)("label",{className:"container",htmlFor:"searchWithTitle",children:["Search by Title",(0,i.jsx)("input",{type:"checkbox",id:"searchWithTitle",name:"searchWithTitle",value:"searchWithTitle",onChange:()=>T(!C),checked:C}),(0,i.jsx)("span",{className:"checkmark"})]})})}),n.length>2?(0,i.jsxs)("h1",{children:["showing result for"," ",(0,i.jsx)("span",{className:o().serachQuery,children:n})]}):(0,i.jsxs)("h1",{children:["showing result for"," ",(0,i.jsx)("span",{className:o().serachQuery,children:P[D]})]}),(0,i.jsxs)("div",{className:o().movieList,children:[(null==S?void 0:S.length)>0&&(null==y?void 0:y.length)>0&&(null==d?void 0:d.map(e=>{if((null==e?void 0:e.media_type)!=="person"||(null==e?void 0:e.profile_path)!==null)return(0,i.jsx)(s.Z,{data:e,media_type:t,genresMovie:S,genresTv:y,cardType:"ai"})})),n.length>1&&(null==d?void 0:d.length)===0?(0,i.jsx)("h1",{children:"No Data Found"}):null,n.length>1&&void 0===d?m.map(e=>(0,i.jsx)(c.Z,{className:o().loading})):null,(null==S?void 0:S.length)===0||(null==y?void 0:y.length)===0||(null==n?void 0:n.length)<2&&((null==d?void 0:d.length)===0||void 0===d)?m.map(e=>(0,i.jsx)(c.Z,{className:o().loading})):null]})]})]})}},46791:function(e){e.exports={MovieCardSmall:"style_MovieCardSmall__ZFLlv",desktopOverflow:"style_desktopOverflow__j9wN3",img:"style_img__1DQdE",metaData:"style_metaData__MIuCO"}},37481:function(e){e.exports={MoviePage:"Search_MoviePage__gvx5u",category:"Search_category__zHmgF",movieList:"Search_movieList__XqI7R",loading:"Search_loading__62AXR",wideLoading:"Search_wideLoading__qYQT5",pagination:"Search_pagination__CuV4J",page_item:"Search_page_item__EXdFn",adsPageP:"Search_adsPageP__DQrEU",serachQuery:"Search_serachQuery__G4LfF",InputWrapper:"Search_InputWrapper__pYOfz",searchInput:"Search_searchInput__sKyH1",pageInput:"Search_pageInput__xSnTB",inactive:"Search_inactive__Y87jM",active:"Search_active__MkNE5",searchModeWrapper:"Search_searchModeWrapper__LjjrX",searchOption:"Search_searchOption__6Bpqa",btnActive:"Search_btnActive__HdmmR",btnInactive:"Search_btnInactive__CB10c",paginateActive:"Search_paginateActive__gJjM_",disabled:"Search_disabled__M_3pN",inputShortcut:"Search_inputShortcut__okDgT",loadMore:"Search_loadMore__Q6rfg",jumpTo:"Search_jumpTo__pZkK1",WalletPage:"Search_WalletPage__eZovX",WalletCard:"Search_WalletCard__X1NDN",aiHeader:"Search_aiHeader___gaGP",searchWithTitle:"Search_searchWithTitle__Igc0k",checkboxDiv:"Search_checkboxDiv__Xsjcs",settingsPopover:"Search_settingsPopover__nmsl5",settingsPopoverCard:"Search_settingsPopoverCard__JuDqj",settingsPopoverBtns:"Search_settingsPopoverBtns__zL5gc",popoverConfirmBtn:"Search_popoverConfirmBtn__HaPz_"}},88922:function(){},13114:function(e,t,n){"use strict";n.d(t,{M:function(){return g}});var i=n(85893),l=n(67294),a=n(25364),r=n(96681),o=n(240),s=n(16014);class c extends l.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function d({children:e,isPresent:t}){let n=(0,l.useId)(),a=(0,l.useRef)(null),r=(0,l.useRef)({width:0,height:0,top:0,left:0}),{nonce:o}=(0,l.useContext)(s._);return(0,l.useInsertionEffect)(()=>{let{width:e,height:i,top:l,left:s}=r.current;if(t||!a.current||!e||!i)return;a.current.dataset.motionPopId=n;let c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${e}px !important; height: ${i}px !important; top: ${l}px !important; left: ${s}px !important; } `),()=>{document.head.removeChild(c)}},[t]),(0,i.jsx)(c,{isPresent:t,childRef:a,sizeRef:r,children:l.cloneElement(e,{ref:a})})}let u=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:c,mode:u})=>{let h=(0,r.h)(p),v=(0,l.useId)(),m=(0,l.useCallback)(e=>{for(let t of(h.set(e,!0),h.values()))if(!t)return;a&&a()},[h,a]),_=(0,l.useMemo)(()=>({id:v,initial:t,isPresent:n,custom:s,onExitComplete:m,register:e=>(h.set(e,!1),()=>h.delete(e))}),c?[Math.random(),m]:[n,m]);return(0,l.useMemo)(()=>{h.forEach((e,t)=>h.set(t,!1))},[n]),l.useEffect(()=>{n||h.size||!a||a()},[n]),"popLayout"===u&&(e=(0,i.jsx)(d,{isPresent:n,children:e})),(0,i.jsx)(o.O.Provider,{value:_,children:e})};function p(){return new Map}var h=n(15947);let v=e=>e.key||"";function m(e){let t=[];return l.Children.forEach(e,e=>{(0,l.isValidElement)(e)&&t.push(e)}),t}var _=n(58868);let g=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:s=!0,mode:c="sync",propagate:d=!1})=>{let[p,g]=(0,h.oO)(d),f=(0,l.useMemo)(()=>m(e),[e]),x=d&&!p?[]:f.map(v),S=(0,l.useRef)(!0),j=(0,l.useRef)(f),y=(0,r.h)(()=>new Map),[w,N]=(0,l.useState)(f),[b,E]=(0,l.useState)(f);(0,_.L)(()=>{S.current=!1,j.current=f;for(let e=0;e{let l=v(e),a=(!d||!!p)&&(f===b||x.includes(l));return(0,i.jsx)(u,{isPresent:a,initial:(!S.current||!!n)&&void 0,custom:a?void 0:t,presenceAffectsLayout:s,mode:c,onExitComplete:a?void 0:()=>{if(!y.has(l))return;y.set(l,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(null==C||C(),E(j.current),d&&(null==g||g()),o&&o())},children:e},l)})})}},50549:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var i=n(67294);let l=i.createContext({});function a({count:e=1,wrapper:t,className:n,containerClassName:a,containerTestId:r,circle:o=!1,style:s,...c}){var d,u,p;let h=i.useContext(l),v={...c};for(let[e,t]of Object.entries(c))void 0===t&&delete v[e];let m={...h,...v,circle:o},_={...s,...function({baseColor:e,highlightColor:t,width:n,height:i,borderRadius:l,circle:a,direction:r,duration:o,enableAnimation:s=!0,customHighlightBackground:c}){let d={};return"rtl"===r&&(d["--animation-direction"]="reverse"),"number"==typeof o&&(d["--animation-duration"]=`${o}s`),s||(d["--pseudo-element-display"]="none"),("string"==typeof n||"number"==typeof n)&&(d.width=n),("string"==typeof i||"number"==typeof i)&&(d.height=i),("string"==typeof l||"number"==typeof l)&&(d.borderRadius=l),a&&(d.borderRadius="50%"),void 0!==e&&(d["--base-color"]=e),void 0!==t&&(d["--highlight-color"]=t),"string"==typeof c&&(d["--custom-highlight-background"]=c),d}(m)},g="react-loading-skeleton";n&&(g+=` ${n}`);let f=null!==(d=m.inline)&&void 0!==d&&d,x=[],S=Math.ceil(e);for(let t=0;te&&t===S-1){let t=null!==(u=n.width)&&void 0!==u?u:"100%",i=e%1,l="number"==typeof t?t*i:`calc(${t} * ${i})`;n={...n,width:l}}let l=i.createElement("span",{className:g,style:n,key:t},"‌");f?x.push(l):x.push(i.createElement(i.Fragment,{key:t},l,i.createElement("br",null)))}return i.createElement("span",{className:a,"data-testid":r,"aria-live":"polite","aria-busy":null===(p=m.enableAnimation)||void 0===p||p},t?x.map((e,n)=>i.createElement(t,{key:n},e)):x)}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=14577)}),_N_E=e.O()}]);