import{C as Y,a as j,c as z,g as B,n as U,q}from"./chunk-53W3MT4O.js";import{$b as $,Bb as v,Cb as r,Db as P,Eb as N,Fc as k,Ha as a,Hc as W,Pb as R,Qb as V,Ra as A,Rb as L,Sa as O,Tc as X,Th as J,Vb as x,Wb as F,X as I,Xb as y,Ya as m,aa as h,bc as G,cc as H,db as w,eb as c,ha as s,ia as u,jb as D,lb as C,mb as f,nb as p,ob as d,sc as T,ta as _,tb as S,xb as E,yb as b,zb as M}from"./chunk-RAOXHQSQ.js";import{i as g}from"./chunk-SLIYHYWC.js";var Q=["*"],Z=i=>({"label-secondary":i}),ee=(i,n)=>({"btn-group":i,"btn-group-vertical":n}),K=(i,n)=>n.id;function te(i,n){if(i&1&&(p(0,"label",5),R(1),d()),i&2){let e=r();c("for",e.inputId())("ngClass",G(3,Z,e.labelSecondary())),a(),V(e.label());}}function ie(i,n){if(i&1){let e=S();p(0,"input",6),y("ngModelChange",function(o){s(e);let l=r(2);return F(l.value,o)||(l.value=o),u(o);}),v("ngModelChange",function(){s(e);let o=r(2);return u(o.update());}),d(),p(1,"label",7),E(2,0),d();}if(i&2){let e=n.$implicit,t=r(2);c("name",t.inputId())("id",t.getRadioId(e))("value",e.id),x("ngModel",t.value),a(),c("for",t.getRadioId(e)),w("data-label",e.label),a(),b(e.label),M(2);}}function ne(i,n){if(i&1&&(p(0,"div",4),C(1,ie,3,7,null,null,K),d()),i&2){let e=r();c("ngClass",H(1,ee,!e.isInMobileView(),e.isInMobileView())),a(),f(e.items());}}function oe(i,n){if(i&1&&(p(0,"div",12),R(1),d()),i&2){let e=r().$implicit;a(),L(" ",e.description," ");}}function ae(i,n){if(i&1){let e=S();p(0,"div",8)(1,"input",9),y("ngModelChange",function(o){s(e);let l=r(2);return F(l.value,o)||(l.value=o),u(o);}),v("ngModelChange",function(){s(e);let o=r(2);return u(o.update());}),d(),p(2,"label",10),E(3,1),d(),m(4,oe,2,1,"div",11),d();}if(i&2){let e=n.$implicit,t=r(2);a(),c("name",t.inputId())("id",t.getRadioId(e))("value",e.id),x("ngModel",t.value),a(),c("for",t.getRadioId(e)),a(),b(e.label),M(3),a(),c("ngIf",e.description);}}function re(i,n){if(i&1&&C(0,ae,5,7,"div",8,K),i&2){let e=r();f(e.items());}}var ge=(()=>{let n=class n{items=_.required();inputId=_.required();label=_();isGroup=_(!1,{transform:T});labelSecondary=_(!1,{transform:T});screenService=h(J);value=A("");disabled=!1;wroteValue;propagateChange=t=>{};writeValue(t){this.value.set(t);}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}setDisabledState(t){this.disabled=t;}update(){this.propagateChange(this.value());}getRadioId(t){return this.inputId()+"-"+t.id;}isInMobileView(){return this.screenService.isInMobileView();}};g(n,"\u0275fac",function(o){return new(o||n)();}),g(n,"\u0275cmp",O({type:n,selectors:[["my-select-radio"]],inputs:{items:[1,"items"],inputId:[1,"inputId"],label:[1,"label"],isGroup:[1,"isGroup"],labelSecondary:[1,"labelSecondary"],value:[1,"value"]},outputs:{value:"valueChange"},features:[$([{provide:j,useExisting:I(()=>n),multi:!0}])],ngContentSelectors:Q,decls:5,vars:2,consts:()=>{let t;t="\n          "+"\uFFFD0\uFFFD"+"\n        ";let o;return o="\n          "+"\uFFFD0\uFFFD"+"\n        ",[t,o,["role","radiogroup"],[3,"for","ngClass",4,"ngIf"],["role","group",3,"ngClass"],[3,"for","ngClass"],["type","radio","autocomplete","off",1,"btn-check",3,"ngModelChange","name","id","value","ngModel"],[1,"btn","btn-outline-primary",3,"for"],[1,"peertube-radio-container"],["type","radio","autocomplete","off",3,"ngModelChange","name","id","value","ngModel"],[3,"for"],["class","form-group-description",4,"ngIf"],[1,"form-group-description"]];},template:function(o,l){o&1&&(P(),p(0,"div",2),m(1,te,2,5,"label",3),N(2),m(3,ne,3,4,"div",4)(4,re,2,0),d()),o&2&&(a(),c("ngIf",l.label()),a(2),D(l.isGroup()?3:4));},dependencies:[Y,z,q,B,U,X,k,W],styles:[`label[_ngcontent-%COMP%]{display:block}label.label-secondary[_ngcontent-%COMP%]{font-size:1rem;font-weight:400;color:var(--fg)}.peertube-radio-container[_ngcontent-%COMP%]{margin-bottom:.25rem}.peertube-radio-container[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{margin-bottom:0}.btn-outline-primary[_ngcontent-%COMP%]:after{display:block;content:attr(data-label);font-weight:700;height:0;overflow:hidden;visibility:hidden}.btn-check[_ngcontent-%COMP%]:checked + .btn-outline-primary[_ngcontent-%COMP%]{font-weight:700;letter-spacing:0}
/*# sourceMappingURL=select-radio.component-YAB6U4AA.css.map */`]}));let i=n;return i;})();export{ge as a};/**i18n:aa38438cfc6bb6877c9985433629bf5f310ba8cfd6183982ad2c0c8f601d3935*///# sourceMappingURL=chunk-7D4PJRFG.js.map