text: import{S as m,i as v,s as g,w as p,x as $,y as k,q as c,o as u,B as y,e as M,c as b,a as j,d as h,b as w,g as x,p as q,M as B,n as C}from"../../chunks/vendor-1dddfd70.js";import{M as D}from"../../chunks/MovieCard-5a48696f.js";function _(i,a,r){const t=i.slice();return t[1]=a[r],t}function d(i){let a,r;return a=new D({props:{movie:i[1]}}),{c(){p(a.$$.fragment)},l(t){$(a.$$.fragment,t)},m(t,e){k(a,t,e),r=!0},p(t,e){const l={};e&1&&(l.movie=t[1]),a.$set(l)},i(t){r||(c(a.$$.fragment,t),r=!0)},o(t){u(a.$$.fragment,t),r=!1},d(t){y(a,t)}}}function S(i){let a,r,t=i[0],e=[];for(let o=0;o<t.length;o+=1)e[o]=d(_(i,t,o));const l=o=>u(e[o],1,1,()=>{e[o]=null});return{c(){a=M("div");for(let o=0;o<e.length;o+=1)e[o].c();this.h()},l(o){a=b(o,"DIV",{class:!0});var s=j(a);for(let n=0;n<e.length;n+=1)e[n].l(s);s.forEach(h),this.h()},h(){w(a,"class","searched-movies svelte-kru9je")},m(o,s){x(o,a,s);for(let n=0;n<e.length;n+=1)e[n].m(a,null);r=!0},p(o,[s]){if(s&1){t=o[0];let n;for(n=0;n<t.length;n+=1){const f=_(o,t,n);e[n]?(e[n].p(f,s),c(e[n],1)):(e[n]=d(f),e[n].c(),c(e[n],1),e[n].m(a,null))}for(C(),n=t.length;n<e.length;n+=1)l(n);q()}},i(o){if(!r){for(let s=0;s<t.length;s+=1)c(e[s]);r=!0}},o(o){e=e.filter(Boolean);for(let s=0;s<e.length;s+=1)u(e[s]);r=!1},d(o){o&&h(a),B(e,o)}}}async function V({fetch:i,params:a}){const t=await i(`https://api.themoviedb.org/3/search/movie?api_key=544e866552b4596a5a1ffb38e0115b9f&language=en-US&query=${a.id}&page=1&include_adult=false`),e=await t.json();if(console.log(e),t.ok)return{props:{searchMovie:e.results}}}function U(i,a,r){let{searchMovie:t}=a;return i.$$set=e=>{"searchMovie"in e&&r(0,t=e.searchMovie)},[t]}class z extends m{constructor(a){super();v(this,a,U,S,g,{searchMovie:0})}}export{z as default,V as load};
  