import{A as b}from"./chunk-5EJWFQRB.js";import{C as y,a as S,g as M,n as _}from"./chunk-2UGJU7DR.js";import{$b as C,Bb as c,Hh as T,Sa as a,Tc as I,Vb as u,Wb as h,X as l,Xb as f,aa as w,eb as p,nb as m,ob as g,ta as d}from"./chunk-EWB56PWF.js";import{i as r}from"./chunk-2T7OYDCL.js";var L=(()=>{let e=class e{inputId=d.required();scopeItems;selectedId;ngOnInit(){this.buildScopeItems();}buildScopeItems(){this.scopeItems=[{id:"local",label:"\u0412\u0438\u0434\u0435\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0441 \u044D\u0442\u043E\u0439 \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B"},{id:"federated",label:"\u0412\u0438\u0434\u0435\u043E \u0441\u043E \u0432\u0441\u0435\u0445 \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C"}];}propagateChange=t=>{};writeValue(t){this.selectedId=t;}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId);}};r(e,"\u0275fac",function(o){return new(o||e)();}),r(e,"\u0275cmp",a({type:e,selectors:[["my-select-videos-scope"]],inputs:{inputId:[1,"inputId"]},features:[C([{provide:S,useExisting:l(()=>e),multi:!0}])],decls:1,vars:3,consts:[[3,"ngModelChange","inputId","items","ngModel"]],template:function(o,i){o&1&&(m(0,"my-select-options",0),f("ngModelChange",function(s){return h(i.selectedId,s)||(i.selectedId=s),s;}),c("ngModelChange",function(){return i.onModelChange();}),g()),o&2&&(p("inputId",i.inputId())("items",i.scopeItems),u("ngModel",i.selectedId));},dependencies:[y,M,_,I,b],encapsulation:2}));let n=e;return n;})();var B=(()=>{let e=class e{server=w(T);inputId=d.required();sortItems;selectedId;serverConfig;ngOnInit(){this.serverConfig=this.server.getHTMLConfig(),this.buildSortItems();}buildSortItems(){this.sortItems=[{id:"-publishedAt",label:"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0435"},{id:"-originallyPublishedAt",label:"\u0414\u0430\u0442\u0430 \u041F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438"},{id:"name",label:"\u0418\u043C\u044F"}],this.isTrendingSortEnabled("most-viewed")&&this.sortItems.push({id:"-trending",label:"\u041D\u0435\u0434\u0430\u0432\u043D\u0438\u0435 \u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u044B"}),this.isTrendingSortEnabled("hot")&&this.sortItems.push({id:"-hot",label:"\u0413\u043E\u0440\u044F\u0447\u0438\u0435"}),this.isTrendingSortEnabled("most-liked")&&this.sortItems.push({id:"-likes",label:"\u041D\u0440\u0430\u0432\u0438\u0442\u0441\u044F"}),this.sortItems.push({id:"-views",label:"\u0413\u043B\u043E\u0431\u0430\u043B\u044C\u043D\u044B\u0435 \u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u044B"});}isTrendingSortEnabled(t){return this.serverConfig.trending.videos.algorithms.enabled.includes(t);}propagateChange=t=>{};writeValue(t){this.selectedId=t;}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId);}};r(e,"\u0275fac",function(o){return new(o||e)();}),r(e,"\u0275cmp",a({type:e,selectors:[["my-select-videos-sort"]],inputs:{inputId:[1,"inputId"]},features:[C([{provide:S,useExisting:l(()=>e),multi:!0}])],decls:1,vars:3,consts:[[3,"ngModelChange","inputId","items","ngModel"]],template:function(o,i){o&1&&(m(0,"my-select-options",0),f("ngModelChange",function(s){return h(i.selectedId,s)||(i.selectedId=s),s;}),c("ngModelChange",function(){return i.onModelChange();}),g()),o&2&&(p("inputId",i.inputId())("items",i.sortItems),u("ngModel",i.selectedId));},dependencies:[y,M,_,I,b],encapsulation:2}));let n=e;return n;})();export{L as a,B as b};/**i18n:85d030b7fdd36d163c6d41dcef9178681a6baa573eb199e8b12fe27dbb057a98*///# sourceMappingURL=chunk-C3BOFVC6.js.map