_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[102],{"1vfM":function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/search/[data]",function(){return r("87aD")}])},"6mMO":function(e,t,r){"use strict";var n=r("q1tI"),a=r.n(n),c=r("HE+r"),o=r("96Ec"),i=r("R1EJ"),s=r("M0Rp"),u=r.n(s),l=a.a.createElement;t.a=function(e){var t,r=e.sectionMedias,a=e.style,s=Object(n.useMemo)((function(){switch(a){case o.a.Horizontal:return[i.a.Landscape,c.a.ThumbHorizontal];default:return[i.a.Portrait,c.a.Thumb127]}}),[a]),f=s[0],d=s[1];return l("div",{className:"".concat(u.a.container)},l("ul",null,null===r||void 0===r||null===(t=r.medias)||void 0===t?void 0:t.map((function(e,t){var r=e.id,n=e.title,a=e.images,c=e.slug,o=e.badges;return l("li",{key:"".concat(r,"-").concat(t,"-item-cover")},l(i.b,{image:a[d],orientation:f,title:n,link:"/media/movies/".concat(r,"/").concat(c||"detail"),tag:o}))}))))}},"87aD":function(e,t,r){"use strict";r.r(t);var n,a=r("q1tI"),c=r.n(a),o=r("z7pX"),i=r("cpVT"),s=r("vJKn"),u=r.n(s),l=r("rg98"),f=r("nbPw"),d=r("nOHt"),p=r("e/F1"),m=r("cGwa"),v=r("96Ec"),b=r("RTG5"),h=r("m6EV"),y=r("6mMO"),g=r("46wD"),O=r("q39W"),_=r("m7we"),j=r("LeJ0"),w=r("OKrk"),E=r.n(w),P=r("RC5v");!function(e){e.Asc="ASC",e.Desc="DESC"}(n||(n={}));var S,N=n;!function(e){e.Name="Name"}(S||(S={}));var M,k=S;!function(e){e.Id="Id",e.Name="Name",e.NameNoDiacritics="NameNoDiacritics",e.Score="Score",e.MediaIds="MediaIds"}(M||(M={}));var x=M;var R=function(e){return(null===e||void 0===e?void 0:e.FindPersonResult)?e.FindPersonResult.Items.map((function(e){return e.Name})):null};function T(e){return C.apply(this,arguments)}function C(){return(C=Object(l.a)(u.a.mark((function e(t){var r,n,a,c,o,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.name,n=t.personProfessionType,a={Criteria:{Name:r,PersonType:n},Options:{SortOrder:N.Desc,SortCriteria:k.Name,Take:8,Skip:0},EntityProperties:[x.Id,x.Name,x.NameNoDiacritics,x.Score,x.MediaIds].join("|"),AuthenticationTicket:j.a.api.secret},c="/FindPerson",e.next=5,P.b.post(c,a);case 5:if(200===(o=e.sent).status){e.next=8;break}throw new Error("Ocorreu um erro [".concat(c,"] ").concat(o.status,": ").concat(o.statusText));case 8:if(0==o.data.FindPersonResult.Result){e.next=10;break}throw new Error("Ocorreu um erro ao tentar relizar a requisi\xe7\xe3o.");case 10:return i=R(o.data),e.abrupt("return",i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var I=r("1/b/"),D=r("OgpL"),L=c.a.createElement;function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t,r=e.search,n=Object(f.a)().t,i=Object(a.useState)(!1),s=i[0],w=i[1],P=Object(a.useState)({}),S=P[0],N=P[1],M=Object(a.useState)(),k=M[0],x=M[1],R=Object(a.useState)(),C=R[0],H=R[1],z=Object(a.useState)(1),W=z[0],A=z[1],F=Object(d.useRouter)(),q=function(){var e=Object(l.a)(u.a.mark((function e(t){var n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,T({name:r,personProfessionType:b.a[t]});case 3:return n=e.sent,e.abrupt("return",n);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",[]);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=Object(l.a)(u.a.mark((function e(){var t,n,a,c,o,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),t=JSON.parse(localStorage.getItem(D.b.Profile)||"{}"),n=F.query,a=(null===n||void 0===n?void 0:n.filterby)?parseInt(null===n||void 0===n?void 0:n.filterby):b.a.All,e.next=6,Object(m.a)({search:r,searchBy:a,mediasPerPage:10,ageRatingId:t.ageRatingId});case 6:return c=e.sent,e.next=9,q("Actor");case 9:return o=e.sent,e.next=12,q("Director");case 12:i=e.sent,o&&x(o),i&&H(i),N(c),w(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=Object(l.a)(u.a.mark((function e(){var t,n,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(W<S.totalPages)){e.next=11;break}return w(!0),t=W+1,e.next=5,Object(m.a)({search:r,page:t,mediasPerPage:j.a.lazyLoad.mediasPerPage});case 5:n=e.sent,(a=B({},n)).medias=[].concat(Object(o.a)(S.medias),Object(o.a)(a.medias)),w(!1),A(t),N(a);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){N({}),K()}),[r]),L(c.a.Fragment,null,L(I.a,{title:"".concat(n("common:seo.searchingFor"),' "').concat(r,'"'),description:S.medias?S.medias.map((function(e){return e.title})).join(" "):""}),L(p.a,null,L("div",{className:E.a.wrapper},L("h1",{className:E.a.title},s?"".concat(n("search:searchingFor"),' "').concat(r,'"...'):"".concat(n("search:searchResult"),' "').concat(r,'"')),!s&&L("div",{className:E.a.recommendedPeople},k&&k.length>0&&L("div",null,L("h2",null,n("search:actors")),L("div",null,L(O.a,{people:k,personProfessionType:"Actor"}))),C&&C.length>0&&L("div",null,L("h2",null,n("search:directors")),L("div",null,L(O.a,{people:C,personProfessionType:"Director"})))),S&&L(y.a,{sectionMedias:S,style:v.a.Default}),S&&0===(null===(t=S.medias)||void 0===t?void 0:t.length)&&L(_.a,{errorMessage:n("search:noResultsFound"),titleSize:"medium"}),s&&L(g.a,null),W<S.totalPages&&L(h.a,{loadMoreItemsFunction:J,enabled:!0===!!S&&!1===s&&W<S.totalPages}))))},W=c.a.createElement;t.default=function(){var e=Object(d.useRouter)().query.data;return W(z,{search:e})}},"96Ec":function(e,t,r){"use strict";var n;!function(e){e[e.Default=1]="Default",e[e.Horizontal=3]="Horizontal"}(n||(n={})),t.a=n},CjZC:function(e,t,r){e.exports={mediaCardBasic:"styles_mediaCardBasic__33nir",placeholderShimmer:"styles_placeholderShimmer__2Tjlf",landscape:"styles_landscape__3nuCK",cover:"styles_cover__2tUW8",loaded:"styles_loaded__2UOFD",tagsWrapper:"styles_tagsWrapper__3N8Hh"}},M0Rp:function(e,t,r){e.exports={container:"styles_container__azq3J"}},OKrk:function(e,t,r){e.exports={wrapper:"styles_wrapper__2aeKn",title:"styles_title__3L_eA",recommendedPeople:"styles_recommendedPeople__27ddD"}},R1EJ:function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var n=r("q1tI"),a=r.n(n),c=r("xvhg"),o=r("elyg"),i=r("nOHt"),s="undefined"!==typeof self&&self.requestIdleCallback||function(e){var t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)},u="undefined"!==typeof IntersectionObserver;function l(e){var t=e.rootMargin,r=e.disabled||!u,a=Object(n.useRef)(),c=Object(n.useState)(!1),o=c[0],i=c[1],l=Object(n.useCallback)((function(e){a.current&&(a.current(),a.current=void 0),r||o||e&&e.tagName&&(a.current=function(e,t,r){var n=function(e){var t=e.rootMargin||"",r=f.get(t);if(r)return r;var n=new Map,a=new IntersectionObserver((function(e){e.forEach((function(e){var t=n.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)}))}),e);return f.set(t,r={id:t,observer:a,elements:n}),r}(r),a=n.id,c=n.observer,o=n.elements;return o.set(e,t),c.observe(e),function(){c.unobserve(e),0===o.size&&(c.disconnect(),f.delete(a))}}(e,(function(e){return e&&i(e)}),{rootMargin:t}))}),[r,t,o]);return Object(n.useEffect)((function(){u||o||s((function(){return i(!0)}))}),[o]),[l,o]}var f=new Map;var d=a.a.createElement,p={};function m(e,t,r,n){if(Object(o.isLocalURL)(t)){e.prefetch(t,r,n).catch((function(e){0}));var a=n&&"undefined"!==typeof n.locale?n.locale:e&&e.locale;p[t+"%"+r+(a?"%"+a:"")]=!0}}var v,b=function(e){var t=!1!==e.prefetch,r=Object(i.useRouter)(),s=r&&r.pathname||"/",u=a.a.useMemo((function(){var t=Object(o.resolveHref)(s,e.href,!0),r=Object(c.a)(t,2),n=r[0],a=r[1];return{href:n,as:e.as?Object(o.resolveHref)(s,e.as):a||n}}),[s,e.href,e.as]),f=u.href,v=u.as,b=e.children,h=e.replace,y=e.shallow,g=e.scroll,O=e.locale;"string"===typeof b&&(b=d("a",null,b));var _=n.Children.only(b),j=_&&"object"===typeof _&&_.ref,w=l({rootMargin:"200px"}),E=Object(c.a)(w,2),P=E[0],S=E[1],N=a.a.useCallback((function(e){P(e),j&&("function"===typeof j?j(e):"object"===typeof j&&(j.current=e))}),[j,P]);Object(n.useEffect)((function(){var e=S&&t&&Object(o.isLocalURL)(f),n="undefined"!==typeof O?O:r&&r.locale,a=p[f+"%"+v+(n?"%"+n:"")];e&&!a&&m(r,f,v,{locale:n})}),[v,f,S,O,t,r]);var M={ref:N,onClick:function(e){_.props&&"function"===typeof _.props.onClick&&_.props.onClick(e),e.defaultPrevented||function(e,t,r,n,a,c,i,s){("A"!==e.currentTarget.nodeName||!function(e){var t=e.currentTarget.target;return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)&&Object(o.isLocalURL)(r))&&(e.preventDefault(),null==i&&(i=n.indexOf("#")<0),t[a?"replace":"push"](r,n,{shallow:c,locale:s}).then((function(e){e&&i&&(window.scrollTo(0,0),document.body.focus())})))}(e,r,f,v,h,y,g,O)},onMouseEnter:function(e){Object(o.isLocalURL)(f)&&(_.props&&"function"===typeof _.props.onMouseEnter&&_.props.onMouseEnter(e),!1!==t&&m(r,f,v,{priority:!0}))}};return(e.passHref||"a"===_.type&&!("href"in _.props))&&(M.href=Object(o.addBasePath)(Object(o.addLocale)(v,"undefined"!==typeof O?O:r&&r.locale,r&&r.defaultLocale))),a.a.cloneElement(_,M)},h=r("CjZC"),y=r.n(h),g=r("nMV1"),O=r.n(g),_=a.a.createElement,j=function(e){var t=e.widthPercentage,r=void 0===t?"50":t;return _("div",{className:O.a.progressBar},_("div",{className:O.a.baseBar}),_("div",{className:O.a.percentBar,style:{width:"".concat(r,"%")}}))},w=a.a.createElement;!function(e){e.Portrait="portrait",e.Landscape="landscape"}(v||(v={}));t.b=function(e){var t=e.image,r=e.link,a=e.progressBar,c=e.orientation,o=void 0===c?v.Portrait:c,i=e.title,s=e.currentPercentage,u=e.tag,l=void 0===u?[]:u,f=Object(n.useState)((function(){return!("undefined"!=typeof document)})),d=f[0],p=f[1],m=Object(n.useMemo)((function(){return"string"===typeof l?[l]:l}),[l]);return w("div",{className:"".concat(y.a.mediaCardBasic," ").concat(o===v.Portrait?y.a.portrait:y.a.landscape," ").concat(d?y.a.loaded:"")},m.length>0&&w("div",{className:y.a.tagsWrapper},m.map((function(e,t){return w("img",{loading:"lazy",key:"".concat(t,"-").concat(e),src:e,alt:"movie tags"})}))),w(b,{href:r,prefetch:!1},w("a",{title:i},w("img",{className:y.a.cover,onLoad:function(){return p(!0)},loading:"lazy",src:t,alt:i}),a&&s&&w(j,{widthPercentage:s.toString()}))))}},fdCl:function(e,t,r){e.exports={errorWithSearch:"styles_errorWithSearch__17MHr",large:"styles_large__1Wv7c",medium:"styles_medium__7HhfY",text:"styles_text__27Eid",back:"styles_back__ReZVA",searchWrapper:"styles_searchWrapper__3WYKh"}},m6EV:function(e,t,r){"use strict";var n=r("q1tI"),a=r.n(n),c=r("LeJ0"),o=a.a.createElement;t.a=function(e){var t=e.loadMoreItemsFunction,r=e.enabled,i=Object(n.useState)(0),s=i[0],u=i[1],l=function(){return u(f())},f=function(){return document.documentElement.scrollTop};return Object(n.useEffect)((function(){var e;r&&s>(e=c.a.lazyLoad.ScreensHeightLeftToScrollTrigger,document.documentElement.scrollHeight-document.documentElement.clientHeight*(e+1))&&t()}),[s]),Object(n.useEffect)((function(){return window.addEventListener("scroll",l),function(){return window.removeEventListener("scroll",l)}}),[]),o(a.a.Fragment,null)}},m7we:function(e,t,r){"use strict";var n=r("q1tI"),a=r.n(n),c=r("nOHt"),o=r("nbPw"),i=r("6PjW"),s=r("vmyE"),u=r("fdCl"),l=r.n(u),f=a.a.createElement;t.a=function(e){var t=e.errorMessage,r=e.titleSize,a=void 0===r?"large":r,u=e.showBack,d=void 0!==u&&u,p=e.titleAsMainHeader,m=void 0!==p&&p,v=Object(n.useState)(""),b=v[0],h=v[1],y=Object(c.useRouter)(),g=Object(o.a)().t;return f("div",{className:l.a.errorWithSearch},f(m?"h1":"h2",{className:"".concat(l.a[a])},t),f("div",{className:l.a.searchWrapper},f(i.a,{placeholder:g("common:navigation.searchPlaceholder"),onHandleSearch:function(){var e=Object(s.a)(b);y.push("/search/".concat(e))},initialStatus:!0,onSearchTextChange:function(e){h(e)},alwaysVisible:!0})),d&&f("p",{onClick:function(){return y.push("/")},className:l.a.back},"\u2190 Voltar"))}},nMV1:function(e,t,r){e.exports={progressBar:"styles_progressBar__s7EAU",baseBar:"styles_baseBar__2LoZ0",percentBar:"styles_percentBar__2beZj"}},xvhg:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r("8rE2");function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(s){a=!0,c=s}finally{try{n||null==i.return||i.return()}finally{if(a)throw c}}return r}}(e,t)||Object(n.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}},[["1vfM",1,2,9,0,3,4,5,6,7,8,13]]]);