import{$ as Ehe,Eo as kb,Fo as l$,Go as m5,Gr as Va,Hr as V,Ia as f$,Io as lA,Is as rh,J as EI,Lr as Uj,Ls as rx,No as kx,Oo as kj,Q as EV,Qi as bV,Qr as W$,Ta as di,Uo as m$,Wa as g,Yi as bI,ec as th,er as Qc,it as FB,mt as Fx,s as $x,ta as bi,u as AV,ua as cA,vc as wp,vr as She,xi as Yn}from"./chunk-B_pj7Jpm.js";import{t as X1}from"./chunk-CgIzqGPc.js";import{A as qn,O as ln,s as Jn}from"./chunk-BPHMC4rz.js";import{O as sr}from"./chunk-CR0lnyBO.js";import"./chunk-1IezKpCQ.js";import{t as q}from"./chunk-CEewNwum.js";var ne=[`modal`];function te(t,n){t&1&&(wp(0,`li`),l$(1,5),kb())}function oe(t,n){t&1&&(wp(0,`li`),l$(1,6),kb())}function ie(t,n){t&1&&(wp(0,`li`),l$(1,7),kb())}function _e(t,n){t&1&&(wp(0,`li`),l$(1,8),kb())}function ae(t,n){t&1&&(wp(0,`li`),l$(1,9),kb())}function re(t,n){t&1&&(wp(0,`li`),l$(1,10),kb())}function le(t,n){t&1&&(wp(0,`li`),l$(1,11),kb())}function se(t,n){if(t&1){let e=AV();wp(0,`div`,12)(1,`h4`,13),l$(2,1),kb(),wp(3,`button`,14),rh(`click`,function(){let a=EI(e).close;return bI(a())}),th(4,`my-global-icon`,15),kb()(),wp(5,`div`,16),th(6,`img`,17),wp(7,`p`),l$(8,2),kb(),wp(9,`ul`),EV(10,te,2,0,`li`),EV(11,oe,2,0,`li`),EV(12,ie,2,0,`li`),EV(13,_e,2,0,`li`),EV(14,ae,2,0,`li`),EV(15,re,2,0,`li`),EV(16,le,2,0,`li`),kb(),wp(17,`p`),kx(18,3),th(19,`strong`)(20,`a`,18),Fx(),kb()(),wp(21,`div`,19)(22,`my-peertube-checkbox`,20),lA(`ngModelChange`,function(a){EI(e);let g=f$();return W$(g.stopDisplayModal,a)||(g.stopDisplayModal=a),bI(a)}),kb(),kj(),wp(23,`input`,21),rh(`click`,function(){let a=EI(e).close;return bI(a())})(`key.enter`,function(){let a=EI(e).close;return bI(a())}),kb(),wp(24,`a`,22),l$(25,4),kb()()}if(t&2){let e=f$();FB(10),bV(e.about.instance.name.toLowerCase()===`peertube`?10:-1),FB(),bV(e.isDefaultShortDescription(e.about.instance.shortDescription)?11:-1),FB(),bV(e.about.instance.administrator?-1:12),FB(),bV(e.about.instance.maintenanceLifetime?-1:13),FB(),bV(e.about.instance.businessModel?-1:14),FB(),bV(e.about.instance.moderationInformation?-1:15),FB(),bV(e.about.instance.terms?-1:16),FB(6),cA(`ngModel`,e.stopDisplayModal),Uj()}}var ee=class t{userService=g(Qc);location=g(di);modalService=g(sr);notifier=g(bi);modal=She(`modal`);created=Ehe();stopDisplayModal=!1;about;LS_KEYS={NO_INSTANCE_CONFIG_WARNING_MODAL:`no_instance_config_warning_modal`};ngOnInit(){this.created.emit()}canBeOpenByUser(n){return!(this.modalService.hasOpenModals()||n.noInstanceConfigWarningModal===!0||Yn.getItem(this.LS_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL)===`true`)}shouldAutoOpen(n,e){return this.modalService.hasOpenModals()||!n.signup.allowed?!1:n.instance.name.toLowerCase()===`peertube`||!e.instance.terms||!e.instance.administrator||!e.instance.maintenanceLifetime}show(n){if(this.location.path().startsWith(`/admin/settings/config/edit-custom`))return;this.about=n,this.modalService.open(this.modal(),{centered:!0}).result.finally(()=>{this.stopDisplayModal===!0&&this.doNotOpenAgain()})}isDefaultShortDescription(n){return n===`PeerTube, an ActivityPub-federated video streaming platform using P2P directly in your web browser.`}doNotOpenAgain(){Yn.setItem(this.LS_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL,`true`),this.userService.updateMyProfile({noInstanceConfigWarningModal:!0}).subscribe({next:()=>V.info(`We will not open the instance config warning modal again.`),error:n=>this.notifier.handleError(n)})}static ɵfac=function(e){return new(e||t)};static ɵcmp=Va({type:t,selectors:[[`my-instance-config-warning-modal`]],viewQuery:function(e,l){e&1&&$x(l.modal,ne,5),e&2&&m$()},outputs:{created:`created`},decls:2,vars:0,consts:()=>{let n;n="关闭此模式";let e;e="不再对我显示此警告";let l;l="关闭";let a;a="配置警告！";let g;g="你在网站上启用了用户注册，但没有配置以下字段:";let f;f=`请考虑配置这些字段以帮助人们进行选择 ${`�#19�`}适当的实例${`�/#19�`}。缺少这些，你的实例可能不会引用在 ${`�#20�`}JoinPeerTube 网站${`�/#20�`} 上。 `;let S;S="设置";let O;O="实例名称";let I;I="实例简短描述";let T;T="你是谁";let E;E="你计划维护实例多久";let L;L="你计划如何付出以保持实例运行";let P;P="你会如管理你的实例";let y;return y="实例条款",[[`modal`,``],a,g,f,S,O,I,T,E,L,P,y,[1,`modal-header`],[1,`modal-title`],[`title`,n,1,`border-0`,`p-0`,3,`click`],[`iconName`,`cross`],[1,`modal-body`],[`src`,`/client/assets/images/mascot/oh.svg`,`alt`,`mascot`,1,`mascot`],[`target`,`_blank`,`rel`,`noopener noreferrer`,`href`,`https://joinpeertube.org`],[1,`modal-footer`,`inputs`],[`inputName`,`stopDisplayModal`,`labelText`,e,3,`ngModelChange`,`ngModel`],[`type`,`button`,`role`,`button`,`value`,l,1,`peertube-button`,`secondary-button`,3,`click`,`key.enter`],[`ngbAutofocus`,``,`href`,`/admin/settings/config/edit-custom`,`target`,`_blank`,`rel`,`noopener noreferrer`,1,`peertube-button-link`,`primary-button`]]},template:function(e,l){e&1&&rx(0,se,26,8,`ng-template`,null,0,m5)},dependencies:[Jn,qn,ln,X1,q],styles:[`li[_ngcontent-%COMP%]{margin-bottom:10px}.mascot[_ngcontent-%COMP%]{display:block;margin:0 auto 50px;width:25%}`],changeDetection:1})};export{ee as InstanceConfigWarningModalComponent};
//# debugId=00e2b699-2cf7-5301-b0ec-8037568e1c50
//# sourceMappingURL=chunk-DGn7LJtr2.js.map