import{a as A}from"./chunk-I7I7GDR6.js";import{b as a}from"./chunk-VGZAEKX5.js";import{b as z}from"./chunk-3X5P6HQO.js";import"./chunk-7ROHYKX4.js";import{a as b}from"./chunk-P62PHQFC.js";import"./chunk-XV6N7FCN.js";import"./chunk-TH2IQMBR.js";import{d as V}from"./chunk-CK7X27BO.js";import{a as R}from"./chunk-NY4ZALB6.js";import{Bb as g,Cc as x,Ch as U,Ga as s,Ob as y,Pb as C,Ra as h,Xa as u,aa as n,db as v,kd as I,mb as l,nb as p,od as S,r as f}from"./chunk-IDYB4NXF.js";import{i as c}from"./chunk-AI7IVZV2.js";function $(o,e){if(o&1&&(l(0,"my-alert",2),y(1),p()),o&2){let _=g();s(),C(_.error);}}var L=(()=>{let e=class e{route=n(I);router=n(S);search=n(a);error="";ngOnInit(){let t=this.route.snapshot.queryParams.uri;if(!t){this.error="URL-parametri puuttuu URL-parametreista";return;}this.loadUrl(t);}loadUrl(t){f([this.search.searchVideos({search:t}),this.search.searchVideoChannels({search:t})]).subscribe(([r,i])=>{let m;if(r.data.length!==0){let d=r.data[0];m=V.buildWatchUrl(d);}else if(i.data.length!==0)m="/c/"+new R(i.data[0]).nameWithHost;else{this.error="Ei saa yhteytt\xE4 et\xE4resurssiin";return;}this.router.navigateByUrl(m);});}};c(e,"\u0275fac",function(r){return new(r||e)();}),c(e,"\u0275cmp",h({type:e,selectors:[["my-remote-interaction"]],decls:2,vars:1,consts:[[1,"root"],["type","danger",4,"ngIf"],["type","danger"]],template:function(r,i){r&1&&(l(0,"div",0),u(1,$,2,1,"my-alert",1),p()),r&2&&(s(),v("ngIf",i.error));},dependencies:[x,b],encapsulation:2}));let o=e;return o;})();var K=[{path:"",component:L,providers:[A,a,z],canActivate:[U],data:{meta:{title:"Et\xE4vuorovaikutus"}}}];export{K as default};/**i18n:1cf7c077143c4c267fdafbe5508f191afcef21bad6aba22a3a8dc180e1003753*///# sourceMappingURL=chunk-2Q6X4R7C.js.map