import{Ao as jx,Br as T$,C as Au,Ca as dA,Fn as MV,Fo as kV,Gn as NV,Ja as g,Kr as Tu,Na as eh,Nr as S$,Ns as rh,Or as Rhe,Ra as f5,So as jV,V as CI,X as D$,Zi as aA,Zo as m5,_s as ph,ai as Vj,eo as h5,et as DI,fn as Kb,go as ih,gt as Ex,jt as Gj,k as Bb,kt as Gc,ls as oh,n as $B,nn as J$,nr as O3,pr as PV,s as $a,ss as o5,vc as wf,yc as wp,za as fA}from"./chunk-b0nJCs5_.js";import{A as qn,C as fn,O as ln,o as Je,r as D,s as Jn}from"./chunk-Cmet2Nw-.js";var Z=[`*`];var ee=n=>({"label-secondary":n});var ne=(n,t)=>({"btn-group":n,"btn-group-vertical":t});var Y=(n,t)=>t.id;function te(n,t){if(n&1&&(wp(0,`label`,3),J$(1),Bb()),n&2){let e=D$();Ex(`for`,e.inputId())(`ngClass`,h5(3,ee,e.labelSecondary())),$B(),aA(e.label())}}function ie(n,t){if(n&1){let e=jV();wp(0,`input`,5),fA(`ngModelChange`,function(a){CI(e);let _=D$(2);return o5(_.value,a)||(_.value=a),DI(a)}),rh(`ngModelChange`,function(){CI(e);return DI(D$(2).update())}),Bb(),Vj(),wp(1,`label`,6),S$(2,0),Bb()}if(n&2){let e=t.$implicit,i=D$(2);Ex(`name`,i.inputId())(`id`,i.getRadioId(e))(`value`,e.id),dA(`ngModel`,i.value),Gj(),$B(),Ex(`for`,i.getRadioId(e)),eh(`data-label`,e.label),$B(),jx(e.label),T$(2)}}function oe(n,t){if(n&1&&(wp(0,`div`,4),PV(1,ie,3,7,null,null,Y),Bb()),n&2){let e=D$();Ex(`ngClass`,m5(1,ne,!e.isInMobileView(),e.isInMobileView())),$B(),kV(e.items())}}function ae(n,t){if(n&1&&(wp(0,`div`,10),J$(1),Bb()),n&2){let e=D$().$implicit;$B(),Kb(` `,e.description,` `)}}function re(n,t){if(n&1){let e=jV();wp(0,`div`,7)(1,`input`,8),fA(`ngModelChange`,function(a){CI(e);let _=D$(2);return o5(_.value,a)||(_.value=a),DI(a)}),rh(`ngModelChange`,function(){CI(e);return DI(D$(2).update())}),Bb(),Vj(),wp(2,`label`,9),S$(3,1),Bb(),NV(4,ae,2,1,`div`,10),Bb()}if(n&2){let e=t.$implicit,i=D$(2);$B(),Ex(`name`,i.inputId())(`id`,i.getRadioId(e))(`value`,e.id),dA(`ngModel`,i.value),Gj(),$B(),Ex(`for`,i.getRadioId(e)),$B(),jx(e.label),T$(3),$B(),MV(e.description?4:-1)}}function le(n,t){if(n&1&&PV(0,re,5,7,`div`,7,Y),n&2)kV(D$().items())}var Q=class n{items=ph.required();inputId=ph.required();label=ph();isGroup=ph(!1,{transform:Tu});labelSecondary=ph(!1,{transform:Tu});screenService=g(Gc);value=Rhe(``);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()}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a({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:[f5([{provide:D,useExisting:wf(()=>n),multi:!0}])],ngContentSelectors:Z,decls:5,vars:2,consts:()=>{let t;t=`${`�0�`}`;let e;return e=`${`�0�`}`,[t,e,[`role`,`radiogroup`],[3,`for`,`ngClass`],[`role`,`group`,3,`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`],[1,`form-group-description`]]},template:function(e,i){e&1&&(oh(),wp(0,`div`,2),NV(1,te,2,5,`label`,3),ih(2),NV(3,oe,3,4,`div`,4)(4,le,2,0),Bb()),e&2&&($B(),MV(i.label()?1:-1),$B(2),MV(i.isGroup()?3:4))},dependencies:[Jn,Je,fn,qn,ln,Au,O3],styles:[`label[_ngcontent-%COMP%]{display:block}label.label-secondary[_ngcontent-%COMP%]{font-size:1rem;font-weight:400;color:var(--%NS%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}`],changeDetection:1})};export{Q as t};
//# debugId=1e8346d2-12c4-5aa1-8fd1-8fb72a439aa7
//# sourceMappingURL=chunk-CxT8jfPH.js.map