1import{c as X,f as H}from"./chunk-YVLKX26P.js";import{g as G}from"./chunk-CB3ZI5LX.js";import"./chunk-36GW2Y7Y.js";import{a as z,b as N}from"./chunk-2GB5TJST.js";import{G as $,_ as j,da as B,y as V}from"./chunk-LPBMM3KS.js";import{L as A,O as D,ob as R,qb as U}from"./chunk-3KCLCUK3.js";import"./chunk-CZUDVYPH.js";import{Eb as M,Ga as P,Je as L,K as T,Pb as x,Qb as r,Ra as I,Xb as d,Z as y,Ze as k,ac as s,bc as m,cc as c,gc as w,ha as C,hb as l,he as E,jc as b,kc as F,oc as u,pc as a,qa as p,ra as f,xb as S}from"./chunk-2O3QPDX2.js";import"./chunk-R57JEPK5.js";import"./chunk-CJI2FLHI.js";function W(o,_){if(o&1&&c(0,"img",8),o&2){let t,n,e,i=a(3);r("ngSrc",i.image().src)("alt",(t=i.image())==null?null:t.alt),x("data-image-type",(n=i.image())==null?null:n.type)("data-type",(e=i.image())==null?null:e.type);}}function Y(o,_){if(o&1&&c(0,"img",9),o&2){let t,n,e,i=a(3);r("ngSrc",i.image().src)("alt",(t=i.image())==null?null:t.alt),x("data-image-type",(n=i.image())==null?null:n.type)("data-type",(e=i.image())==null?null:e.type);}}function q(o,_){if(o&1&&(M(0,W,1,4,"img",8)(1,Y,1,4,"img",9),s(2,"div",10),c(3,"fa-icon",3),m()),o&2){let t=a(2);d(t.image().imgType=="poster-img"||t.image().type=="portrait"?0:t.image().imgType=="wallpaper-img"||t.image().imgType=="tile-img"||t.image().type=="landscape"?1:-1),l(3),r("icon",t.faSpinner);}}function J(o,_){if(o&1){let t=w();s(0,"a",11),u("click",function(){let e;p(t);let i=a(2);return f(i.changeImage((e=i.image())==null?null:e.next));}),c(1,"fa-icon",3),m();}if(o&2){let t=a(2);l(),r("icon",t.faArrowLeft);}}function Q(o,_){if(o&1){let t=w();s(0,"a",12),u("click",function(){let e;p(t);let i=a(2);return f(i.changeImage((e=i.image())==null?null:e.previous));}),c(1,"fa-icon",3),m();}if(o&2){let t=a(2);l(),r("icon",t.faArrowRight);}}function Z(o,_){if(o&1){let t=w();s(0,"div",1)(1,"a",2),u("click",function(){p(t);let e=a();return f(e.clearModal());}),c(2,"fa-icon",3),m(),s(3,"a",4),u("click",function(){p(t);let e=a();return f(e.downloadImage());}),b(4,0),c(5,"i",5),F(),m(),M(6,q,4,2)(7,J,2,1,"a",6)(8,Q,2,1,"a",7),m();}if(o&2){let t,n,e,i=a();r("ngClass",((t=i.image())==null?null:t.imgType)||((t=i.image())==null?null:t.type)),l(2),r("icon",i.faClose),l(),x("data-translate","public.commons.download"),l(3),d(i.loading()?-1:6),l(),d((n=i.image())!=null&&n.next?7:-1),l(),d((e=i.image())!=null&&e.previous?8:-1);}}var ft=(()=>{class o{constructor(){this.modalPictureService=C(A),this.imageService=C(X),this.trackingService=C(G),this.image=P(null),this.loading=P(!1),this.faClose=j,this.faArrowLeft=$,this.faArrowRight=V,this.faSpinner=B,I(()=>{document.addEventListener("keydown",t=>{(t.code=="27"||t.code==="Escape")&&this.clearModal();});}),this.modalPictureService.image.pipe(D(),y(()=>this.loading.set(!0)),T(100)).subscribe(t=>{this.image.set(t),this.loading.set(!1);});}clearModal(){this.modalPictureService.cleanImage();}getSourceImg(t,n){let e;return typeof t=="string"?e=t:n=="landscape"||n=="tile"?e=t.tilePhotoUrl:e=t.portraitPhotoUrl,e;}downloadImage(){let{src:t,type:n,movie:e,imgType:i}=this.image(),O=this.getLastChunkOfString(t),K=this.getActionType(i);fetch(t).then(g=>g.blob()).then(g=>{let v=URL.createObjectURL(g),h=document.createElement("a");h.href=v,h.download=O,h.click(),this.trackingService.trackEvent({action:K,properties:{category:"MovieDetail",label:O,orientation:n,movie:e?.title,idMovie:e?.id,imdb:e?.imdb,tagsMovie:R(e),genresMovie:U(e)}}),URL.revokeObjectURL(v);}).catch(g=>{console.error("Error downloading image:",g);});}getActionType(t){if(t=="wallpaper-img")return"WallpaperDownloaded";if(t=="tile-img")return"LandscapeImageDownloaded";if(t=="poster-img")return"PosterImageDownloaded";}changeImage(t){this.modalPictureService.setImage(t);}getLastChunkOfString(t){return t.split("/").pop();}static{this.ɵfac=function(n){return new(n||o)();};}static{this.ɵcmp=S({type:o,selectors:[["ush-modal-picture"]],decls:1,vars:1,consts:()=>{let t;return t="Hent",[t,["id","modal-image-container",3,"ngClass"],[1,"btn-close",3,"click"],[3,"icon"],[1,"btn-download",3,"click"],[1,"pi","pi-download"],[1,"arrow-left"],[1,"arrow-right"],["sizes","(max-width: 650px) 90vw, (max-width: 1500px) 50vw, 25vw","fill","",3,"ngSrc","alt"],["sizes","(max-width: 650px) 100v
1w, (max-width: 1380px) 70vw, 55vw","fill","",3,"ngSrc","alt"],[1,"loading-spinner"],[1,"arrow-left",3,"click"],[1,"arrow-right",3,"click"]];},template:function(n,e){n&1&&M(0,Z,9,6,"div",1),n&2&&d(e.image()!==null?0:-1);},dependencies:[L,E,H,k,N,z],styles:["#modal-image-container[_ngcontent-%COMP%]{display:flex;position:fixed;top:0;left:0;justify-content:center;align-items:center;z-index:1000;background-color:#000c;padding:5%;width:100vw;height:100vh;font-family:mainFont,movie-font,sans-serif}#modal-image-container[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%], #modal-image-container[_ngcontent-%COMP%] .btn-download[_ngcontent-%COMP%]{position:absolute;top:15px;right:35px;z-index:3;transition:.3s;color:#f1f1f1;font-weight:700;font-size:40px}#modal-image-container[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]:hover, #modal-image-container[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]:focus, #modal-image-container[_ngcontent-%COMP%] .btn-download[_ngcontent-%COMP%]:hover, #modal-image-container[_ngcontent-%COMP%] .btn-download[_ngcontent-%COMP%]:focus{cursor:pointer;color:#bbb;text-decoration:none}#modal-image-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:30px}#modal-image-container[_ngcontent-%COMP%] .btn-download[_ngcontent-%COMP%]{top:initial;bottom:15px;font-weight:400;font-size:16px}#modal-image-container[_ngcontent-%COMP%] picture[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}#modal-image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{z-index:2;padding:5dvh 0;object-fit:contain}#modal-image-container[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{display:flex;position:absolute;top:50%;left:50%;justify-content:center;align-items:center;translate:-50% -50%;z-index:1;animation:_ngcontent-%COMP%_spin 1s linear infinite;width:100%;color:#fff;font-size:24px}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#modal-image-container[_ngcontent-%COMP%] .arrow-left[_ngcontent-%COMP%], #modal-image-container[_ngcontent-%COMP%] .arrow-right[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);z-index:10;cursor:pointer;color:#fff;font-size:24px;text-decoration:none}#modal-image-container[_ngcontent-%COMP%] .arrow-left[_ngcontent-%COMP%]{left:20px}#modal-image-container[_ngcontent-%COMP%] .arrow-right[_ngcontent-%COMP%]{right:20px}"],changeDetection:0});}}return o;})();export{ft as ModalPictureComponent};/**i18n:fc4da28cb31e11f192f9eb27519b51ec463b2a43a3e117a1ce1da21f8ca0dd48*/
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.