1import{a as he,b as Ve}from"./chunk-I65AJPQ4.js";import{a as Ke}from"./chunk-6PYZUNWO.js";import{a as Se}from"./chunk-C35Z3YQA.js";import{a as Ie}from"./chunk-QTBWJBL6.js";import{a as be}from"./chunk-EOLT3XT6.js";import{a as xe,b as Te}from"./chunk-22WJKAIZ.js";import{a as ce}from"./chunk-SFNFCOZS.js";import{a as ge,b as fe}from"./chunk-BXNQRMY5.js";import"./chunk-RFCDL6VX.js";import{b as ve}from"./chunk-HOBTJYQI.js";import"./chunk-XWDSR7V3.js";import"./chunk-VV34F7XC.js";import{a as ye,b as B,c as Ce,d as W}from"./chunk-ICHHVHZA.js";import{a as ue,b as _e}from"./chunk-OAED5FIG.js";import{a as de,b as me}from"./chunk-P37GQ53N.js";import"./chunk-NZ226J7R.js";import"./chunk-7EBKYMB6.js";import"./chunk-YK3HMHC4.js";import"./chunk-2DRXLVRR.js";import{c as R,e as M}from"./chunk-OFHUO5H7.js";import"./chunk-M3XSAKW4.js";import"./chunk-H76LZNGX.js";import"./chunk-PGR2NPNS.js";import"./chunk-OZD37XM5.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-AVEXXPAT.js";import"./chunk-FHU4TM37.js";import{d as ae}from"./chunk-32B64V2R.js";import"./chunk-3XLVKQRY.js";import"./chunk-DJ5AJG3T.js";import"./chunk-SLPC3Y4V.js";import"./chunk-XIRWNEM2.js";import"./chunk-AAORKXGN.js";import"./chunk-KDGXQRVY.js";import"./chunk-UUEFXD6N.js";import{D as pe,c as re,g as oe,l as le,z as se}from"./chunk-Q2KKZV5J.js";import{a as ne}from"./chunk-JICM7NVH.js";import{a as Ee}from"./chunk-BD6EMWWF.js";import{a as ie}from"./chunk-AB6CKZTE.js";import{d as w,e as N}from"./chunk-DIGPPQJE.js";import{s as ee,x as te}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import{D as k,j as V,l as O,m as A,w as Z}from"./chunk-ZAQTNZYS.js";import"./chunk-SRTXE2HR.js";import{Dc as L,Ec as U,Fc as G,Jb as c,Jc as q,Lc as J,Mb as Q,Nc as X,Uc as l,Vc as s,Wb as n,Xb as r,Yb as m,Z as H,ac as T,da as S,db as i,gc as f,hc as v,ib as K,la as C,ma as x,p as I,pa as D,sb as h,uc as p,vc as g,wb as z,wc as d,yb as y}from"./chunk-NTTV6FWH.js";import{g as _}from"./chunk-W7GRJBO5.js";var P=class a extends Ie{endpoint=ie.api+"/api/manager/event-key";createAsync(t){return _(this,null,function*(){return I(this.http.post(this.endpoint,t))})}rotateAsync(t){return _(this,null,function*(){return I(this.http.post(`${this.endpoint}/${t}/rotate`,{}))})}revokeAsync(t){return _(this,null,function*(){return I(this.http.post(`${this.endpoint}/${t}/revoke`,{}))})}setBundleAsync(t,e){return _(this,null,function*(){return I(this.http.put(`${this.endpoint}/${t}/bundle`,{bundleId:e}))})}getAvailableEvents(){return _(this,null,function*(){return I(this.http.get(`${this.endpoint}/events/list`))})}getQuota(){return _(this,null,function*(){return I(this.http.get(`${this.endpoint}/quota`))})}static \u0275fac=(()=>{let t;return function(o){return(t||(t=D(a)))(o||a)}})();static \u0275prov=H({token:a,factory:a.\u0275fac,providedIn:"root"})};var $=(e=>(e.ACTIVE="active",e.REVOKED="revoked",e))($||{});function Ae(a,t){if(a&1){let e=T();n(0,"div",12)(1,"p-checkbox",13),G("ngModelChange",function(E){C(e);let u=v();return U(u.selected,E)||(u.selected=E),x(E)}),r(),n(2,"label",14),m(3,"i",15),p(4),l(5,"translate"),r()()}if(a&2){let e=t.$implicit,o=v();i(),c("value",e.value),L("ngModel",o.selected),c("inputId",e.value),i(),c("for",e.value),i(),c("ngClass",e.icon),i(),d(" ",s(5,6,e.labelKey)," ")}}function Re(a,t){a&1&&(n(0,"small",4),p(1),l(2,"translate"),r()),a&2&&(i(),g(s(2,1,"EVENT_KEY.FORM.EVENTS_REQUIRED")))}var Y=class a{constructor(t){this.ref=t}name="";submitting=!1;options=[{value:"gift",labelKey:"EVENT_KEY.EVENTS.GIFT",icon:"pi pi-gift"},{value:"hearts",labelKey:"EVENT_KEY.EVENTS.HEARTS",icon:"pi pi-heart"},{value:"comment",labelKey:"EVENT_KEY.EVENTS.COMMENT",icon:"pi pi-comment"},{value:"viewer",labelKey:"EVENT_KEY.EVENTS.VIEWER",icon:"pi pi-users"},{value:"poll",labelKey:"EVENT_KEY.EVENTS.POLL",icon:"pi pi-chart-bar"},{value:"gift_goal",labelKey:"EVENT_KEY.EVENTS.GIFT_GOAL",icon:"pi pi-flag"},{value:"follow",labelKey:"EVENT_KEY.EVENTS.FOLLOW",icon:"pi pi-user-plus"}];selected=["gift"];get canSubmit(){return this.name.trim().length>0&&this.selected.length>0&&!this.submitting}save(){if(!this.canSubmit)return;let t={name:this.name.trim(),events:this.selected};this.ref.close(t)}cancel(){this.ref.close(null)}static \u0275fac=function(e){return new(e||a)(K(B))};static \u0275cmp=h({type:a,selectors:[["app-event-key-create-dialog"]],decls:22,vars:22,consts:[[1,"event-key-create-dialog"],[1,"mb-4"],["for","ek-name",1,"form-label","fw-semibold"],["
1id","ek-name","type","text","pInputText","","maxlength","100",1,"w-100",3,"ngModelChange","ngModel","placeholder"],[1,"text-muted"],[1,"form-label","fw-semibold","d-block","mb-2"],[1,"event-list"],["class","event-row",4,"ngFor","ngForOf"],["class","text-muted",4,"ngIf"],[1,"d-flex","justify-content-end","gap-2"],["pButton","","type","button",1,"p-button-text",3,"click","label"],["pButton","","type","button","icon","pi pi-key",3,"click","label","disabled"],[1,"event-row"],[3,"ngModelChange","value","ngModel","inputId"],[1,"event-label",3,"for"],[1,"me-2",3,"ngClass"]],template:function(e,o){e&1&&(n(0,"div",0)(1,"div",1)(2,"label",2),p(3),l(4,"translate"),r(),n(5,"input",3),l(6,"translate"),G("ngModelChange",function(u){return U(o.name,u)||(o.name=u),u}),r(),n(7,"small",4),p(8),l(9,"translate"),r()(),n(10,"div",1)(11,"label",5),p(12),l(13,"translate"),r(),n(14,"div",6),y(15,Ae,6,8,"div",7),r(),y(16,Re,3,3,"small",8),r(),n(17,"div",9)(18,"button",10),l(19,"translate"),f("click",function(){return o.cancel()}),r(),n(20,"button",11),l(21,"translate"),f("click",function(){return o.save()}),r()()()),e&2&&(i(3),g(s(4,10,"EVENT_KEY.FORM.NAME")),i(2),L("ngModel",o.name),c("placeholder",s(6,12,"EVENT_KEY.FORM.NAME_PLACEHOLDER")),i(3),g(s(9,14,"EVENT_KEY.FORM.NAME_HELP")),i(4),g(s(13,16,"EVENT_KEY.FORM.EVENTS")),i(3),c("ngForOf",o.options),i(),c("ngIf",o.selected.length===0),i(2),c("label",s(19,18,"EVENT_KEY.FORM.CANCEL")),i(2),c("label",s(21,20,"EVENT_KEY.FORM.CREATE"))("disabled",!o.canSubmit))},dependencies:[k,V,O,A,pe,re,oe,se,le,M,R,_e,ue,fe,ge,N,w],styles:[".event-key-create-dialog[_ngcontent-%COMP%]{padding:.5rem}.event-key-create-dialog[_ngcontent-%COMP%] .event-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.event-key-create-dialog[_ngcontent-%COMP%] .event-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem}.event-key-create-dialog[_ngcontent-%COMP%] .event-label[_ngcontent-%COMP%]{margin:0;cursor:pointer;-webkit-user-select:none;user-select:none}.event-key-create-dialog[_ngcontent-%COMP%] .event-label[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--p-primary-color, #2f8eef)}"]})};var F=class a{constructor(t,e,o,E){this.ref=t;this.config=e;this.clipboardService=o;this.toastService=E;e?.data?.eventKey&&(this.eventKey=e.data.eventKey)}eventKey;copied=!1;copyToClipboard(){this.clipboardService.copy(this.eventKey.key),this.copied=!0,this.toastService.success("Cl\xE9 copi\xE9e dans le presse-papiers")}close(){this.ref.close(!0)}static \u0275fac=function(e){return new(e||a)(K(B),K(ye),K(ce),K(ne))};static \u0275cmp=h({type:a,selectors:[["app-event-key-created-dialog"]],decls:41,vars:28,consts:[[1,"event-key-created-dialog"],[1,"text-center","mb-4"],[1,"success-icon","mb-3"],[1,"pi","pi-check-circle"],[1,"mb-2"],[1,"text-muted","mb-0"],[1,"alert","alert-warning","mb-4"],[1,"d-flex","align-items-start"],[1,"pi","pi-exclamation-triangle","me-3","mt-1","fs-4"],[1,"mb-0","mt-1"],[1,"key-container","mb-4"],[1,"form-label","fw-semibold","text-muted","small"],[1,"key-box"],[1,"key-value","user-select-all"],[1,"d-flex","gap-2","mb-4"],["pButton","","type","button",1,"flex-grow-1",3,"click","ngClass","label","icon"],[1,"usage-info","mb-4"],[1,"code-block"],[1,"d-flex","justify-content-center"],["pButton","","type","button",1,"p-button-text",3,"click","label"]],template:function(e,o){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),m(3,"i",3),r(),n(4,"h4",4),p(5),l(6,"translate"),r(),n(7,"p",5)(8,"strong"),p(9),r()()(),n(10,"div",6)(11,"div",7),m(12,"i",8),n(13,"div")(14,"strong"),p(15),l(16,"translate"),r(),n(17,"p",9),p(18),l(19,"translate"),r()()()(),n(20,"div",10)(21,"label",11),p(22),l(23,"translate"),r(),n(24,"div",12)(25,"code",13),p(26),r()()(),n(27,"div",14)(28,"button",15),l(29,"translate"),l(30,"translate"),f("click",function(){return o.copyToClipboard()}),r()(),n(31,"div",16)(32,"label",11),p(33),l(34,"translate"),r(),n(35,"div",17)(36,"code"),p(37),r()()(),n(38,"div",18)(39,"button",19),l(40,"translate"),f("click",function(){return o.close()}),r()()()),e&2&&(i(5),d(" ",s(6,12,"EVENT_KEY.CREATED.SUCCESS_TITLE")," "),i(4),g(o.eventKey.name),i(6),g(s(16,14,"EVENT_KEY.CREATED.IMPORTANT")),i(3),d(" ",s(19,16,"EVENT_KEY.CREATED.IMPORTANT_DESC")," "),i(4),g(s(23,18,"EVENT_KEY.CREATED.YOUR_KEY")),i(4),g(o.eventKey.key),i(2),c("ngClass",o.copied?"p-button-success":"")("label",o.copied?s(29,20,"EVENT_KEY.CREATED.COPIED"):s(30,22,"EVENT_KEY.CREATED.COPY"))("icon",o.copied?"pi pi-check":"pi pi-copy"),i(5),g(s(34,24,"EVENT_KEY.CREATED.USAGE")),i(4),d("wss://api.hou.la/ws (namespace /events) ?token=",o.eventKey.keyPrefix,"..."),i(2),c("label",s(40,26,"EVENT_KEY.CREATED.SAVED")))},dependencies:[k,V,M,R,N,w],styles:[".event-key-created-dialog[_ngcontent-%COMP%]{padding:.5rem}.event-key-created-dialog[_ngcontent-%COMP%] .success-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:4rem;color:#28a745}.event-key-created-dialog[_ngcontent-%COMP%] .key-container[_ngcontent-%COMP%] .key-box[_ngcontent-%COMP%]{background:linear-gradient(135deg,#1a1a2e,#16213e);border-radius:8px;padding:1rem;overflow-x:auto}.event-key-created-dialog[_ngcontent-%COMP%] .key-container[_ngcontent-%COMP%] .key-box[_ngcontent-%COMP%] .key-value[_ngcontent-%COMP%]{color:#00d9ff;font-size:.95rem;word-break:break-all;font-family:Monaco,Menlo,Ubuntu Mono,monospace}.event-key-created-dialog[_ngcontent-%COMP%] .code-block[_ngcontent-%COMP%]{background:#f8f9fa;border:1px solid #e9ecef;border-radius:6px;padding:.75rem 1rem}.event-key-created-dialog[_ngcontent-%COMP%] .code-block[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:#495057;font-size:.8rem;word-break:break-all}.event-key-created-dialog[_ngcontent-%COMP%] .usage-info[_ngcontent-%COMP%]{border-top:1px solid #e9ecef;padding-top:1rem}"]})};var Be=a=>({"opacity-50":a}),Pe=(a,t,e)=>({"border-bottom":a,"rounded-top":t,"opacity-50":e});function Ye(a,t){if(a&1&&m(0,"app-widget-key-quota",19),a&2){let e=v(2);c("used",e.quota.used)("max",e.quota.max)}}function Fe(a,t){if(a&1){let e=T();n(0,"div",6)(1,"span",7),m(2,"i",8),p(3),l(4,"translate"),r(),n(5,"div",9),y(6,Ye,1,2,"app-widget-key-quota",10),n(7,"a",11),m(8,"i",12),n(9,"span",13),p(10),l(11,"translate"),r()(),n(12,"a",14),m(13,"i",15),n(14,"span",13),p(15),l(16,"translate"),r()(),n(17,"button",16),f("click",function(){C(e);let E=v();return x(E.openCreateDialog())}),m(18,"i",17),n(19,"span",13),p(20),l(21,"translate"),r(),n(22,"span",18),p(23),l(24,"translate"),r()()()()}if(a&2){let e=v();i(3),d(" ",s(4,6,"EVENT_KEY.TITLE")," "),i(3),c("ngIf",e.quota),i(4),g(s(11,8,"EVENT_KEY.GUIDE_LINK")),i(5),g(s(16,10,"EVENT_KEY.DOC_LINK")),i(5),g(s(21,12,"EVENT_KEY.NEW_KEY")),i(3),g(s(24,14,"COMMON.ADD"))}}function Le(a,t){if(a&1){let e=T();n(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"div",24),m(5,"i",25),r(),n(6,"h2",26),p(7),l(8,"translate"),r(),n(9,"p",27),p(10),l(11,"translate"),r(),n(12,"div",28)(13,"div",29)(14,"div",30),m(15,"i",31),r(),n(16,"div",32)(17,"div",33),p(18),l(19,"translate"),r(),n(20,"div",34),p(21),l(22,"translate"),r()()(),n(23,"div",29)(24,"div",35),m(25,"i",36),r(),n(26,"div",32)(27,"div",33),p(28),l(29,"translate"),r(),n(30,"div",34),p(31),l(32,"translate"),r()()(),n(33,"div",29)(34,"div",37),m(35,"i",38),r(),n(36,"div",32)(37,"div",33),p(38),l(39,"translate"),r(),n(4
10,"div",34),p(41),l(42,"translate"),r()()(),n(43,"div",29)(44,"div",39),m(45,"i",40),r(),n(46,"div",32)(47,"div",33),p(48),l(49,"translate"),r(),n(50,"div",34),p(51),l(52,"translate"),r()()()(),n(53,"button",41),f("click",function(){C(e);let E=v();return x(E.openCreateDialog())}),m(54,"i",42),p(55),l(56,"translate"),r(),n(57,"a",43),m(58,"i",12),p(59),l(60,"translate"),r(),n(61,"a",44),m(62,"i",45),p(63),l(64,"translate"),r(),n(65,"a",46),m(66,"i",15),p(67),l(68,"translate"),r()(),n(69,"div",47),m(70,"i",48),r()()()()}a&2&&(i(7),d(" ",s(8,14,"EVENT_KEY.ONBOARDING_TITLE")," "),i(3),d(" ",s(11,16,"EVENT_KEY.ONBOARDING_DESC")," "),i(8),d(" ",s(19,18,"EVENT_KEY.FEATURE_REALTIME")," "),i(3),d(" ",s(22,20,"EVENT_KEY.FEATURE_REALTIME_DESC")," "),i(7),d(" ",s(29,22,"EVENT_KEY.FEATURE_GIFTS")," "),i(3),d(" ",s(32,24,"EVENT_KEY.FEATURE_GIFTS_DESC")," "),i(7),d(" ",s(39,26,"EVENT_KEY.FEATURE_OBS")," "),i(3),d(" ",s(42,28,"EVENT_KEY.FEATURE_OBS_DESC")," "),i(7),d(" ",s(49,30,"EVENT_KEY.FEATURE_SECURE")," "),i(3),d(" ",s(52,32,"EVENT_KEY.FEATURE_SECURE_DESC")," "),i(4),d("",s(56,34,"EVENT_KEY.CREATE_FIRST")," "),i(4),d("",s(60,36,"EVENT_KEY.GUIDE_LINK")," "),i(4),d("",s(64,38,"EVENT_KEY.DOWNLOAD_CONNECTOR")," "),i(4),d("",s(68,40,"EVENT_KEY.DOC_LINK")," "))}function Ue(a,t){if(a&1&&(m(0,"p-tag",76),l(1,"uppercase"),l(2,"translate")),a&2){let e=t.$implicit;c("value",s(2,3,"EVENT_KEY.EVENTS."+s(1,1,e)))}}function Ge(a,t){if(a&1&&(n(0,"span",77),m(1,"i",78),p(2),l(3,"translate"),r()),a&2){let e=v().$implicit,o=v(2);i(2),d(" ",o.bundleNameFor(e.bundleId)||s(3,1,"EVENT_KEY.INTERACTIVE.ACTIVE")," ")}}function We(a,t){a&1&&m(0,"i",81)}function je(a,t){if(a&1){let e=T();n(0,"button",79),f("click",function(){C(e);let E=v().$implicit,u=v(2);return x(u.openBundlePickerForKey(E))}),y(1,We,1,0,"i",80),p(2),l(3,"translate"),r()}if(a&2){let e=v().$implicit;i(),c("ngIf",!e.bundleId),i(),d("",s(3,2,e.bundleId?"EVENT_KEY.INTERACTIVE.CHANGE":"EVENT_KEY.INTERACTIVE.CHOOSE")," ")}}function $e(a,t){if(a&1){let e=T();n(0,"button",82),f("click",function(){C(e);let E=v().$implicit,u=v(2);return x(u.clearKeyBundle(E))}),p(1),l(2,"translate"),r()}a&2&&(i(),d(" ",s(2,1,"EVENT_KEY.INTERACTIVE.DETACH")," "))}function He(a,t){if(a&1){let e=T();n(0,"button",83),l(1,"translate"),f("click",function(){C(e);let E=v().$implicit,u=v(2);return x(u.confirmRotate(E))}),m(2,"i",84),r()}a&2&&c("pTooltip",s(1,1,"EVENT_KEY.ROTATE"))}function ze(a,t){if(a&1){let e=T();n(0,"button",85),l(1,"translate"),f("click",function(){C(e);let E=v().$implicit,u=v(2);return x(u.confirmRevoke(E))}),m(2,"i",86),r()}a&2&&c("pTooltip",s(1,1,"EVENT_KEY.REVOKE"))}function Qe(a,t){if(a&1){let e=T();n(0,"div",51)(1,"div",52),p(2),r(),n(3,"div",53)(4,"div",54),p(5),r(),n(6,"div",55)(7,"code",56),p(8),r()(),n(9,"div",57),y(10,Ue,3,5,"p-tag",58),r(),n(11,"div",59),y(12,Ge,4,3,"span",60)(13,je,4,4,"button",61)(14,$e,3,3,"button",62),r(),n(15,"div",63)(16,"div",64)(17,"small",65),m(18,"i",66),n(19,"span",67),p(20),l(21,"translate"),r()(),n(22,"small",68),l(23,"translate"),m(24,"i",69),n(25,"span"),p(26),r()()()()(),n(27,"div",70)(28,"div",71),y(29,He,3,3,"button",72)(30,ze,3,3,"button",73),n(31,"button",74),l(32,"translate"),f("click",function(){let E=C(e).$implicit,u=v(2);return x(u.confirmDelete(E))}),m(33,"i",75),r()()()()}if(a&2){let e=t.$implicit,o=t.index,E=t.last,u=t.first,b=v(2);c("ngClass",X(22,Pe,!E,u,e.status===b.EventKeyStatus.REVOKED)),i(2),d(" ",o+1," "),i(3),d(" ",e.name," "),i(3),d("",e.keyPrefix,"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"),i(2),c("ngForOf",e.events),i(2),c("ngIf",e.bundleId),i(),c("ngIf",e.status===b.EventKeyStatus.ACTIVE),i(),c("ngIf",e.bundleId),i(4),c("ngClass",e.status===b.EventKeyStatus.ACTIVE?"pi-check-circle text-success":"pi-times-circle text-danger"),i(),c("ngClass",e.status===b.EventKeyStatus.ACTIVE?"text-success":"text-danger"),i(),d(" ",s(21,16,e.status===b.EventKeyStatus.ACTIVE?"EVENT_KEY.ACTIVE":"EVENT_KEY.REVOKED")," "),i(2),c("pTooltip",s(23,18,"EVENT_KEY.LAST_USED")),i(4),g(b.lastUsedLabel(e.lastUsedAt)),i(3),c("ngIf",e.status===b.EventKeyStatus.ACTIVE),i(),c("ngIf",e.status===b.EventKeyStatus.ACTIVE),i(),c("pTooltip",s(32,20,"EVENT_KEY.DELETE"))}}function qe(a,t){if(a&1&&(n(0,"div",49),y(1,Qe,34,26,"div",50),r()),a&2){let e=v();c("ngClass",J(2,Be,e.loading)),i(),c("ngForOf",e.keys)}}
1function Je(a,t){a&1&&(n(0,"span",96),m(1,"i",97),p(2),l(3,"translate"),r()),a&2&&(i(2),d("",s(3,1,"EVENT_KEY.INTERACTIVE.CONNECTOR_ON")," "))}function Xe(a,t){a&1&&(n(0,"span",98),m(1,"i",99),p(2),l(3,"translate"),r()),a&2&&(i(2),d("",s(3,1,"EVENT_KEY.INTERACTIVE.CONNECTOR_OFF")," "))}function Ze(a,t){if(a&1&&(n(0,"div",87)(1,"div",88),m(2,"i",89),n(3,"span",90),p(4),l(5,"translate"),r()(),n(6,"p",91),p(7),l(8,"translate"),r(),n(9,"p",92),y(10,Je,4,3,"span",93)(11,Xe,4,3,"span",94),r(),n(12,"a",95),m(13,"i",45),p(14),l(15,"translate"),r()()),a&2){let e=v();i(4),g(s(5,5,"EVENT_KEY.INTERACTIVE.TITLE")),i(3),d(" ",s(8,7,"EVENT_KEY.INTERACTIVE.SUBTITLE")," "),i(3),c("ngIf",e.connectorActive),i(),c("ngIf",!e.connectorActive),i(3),d("",s(15,9,"EVENT_KEY.DOWNLOAD_CONNECTOR")," ")}}function et(a,t){if(a&1){let e=T();n(0,"div",100),p(1),n(2,"button",101),f("click",function(){C(e);let E=v();return x(E.loadData())}),p(3),l(4,"translate"),r()()}if(a&2){let e=v();i(),d(" ",e.error," "),i(2),d(" ",s(4,2,"COMMON.RETRY")," ")}}var Me=class a extends Se{crudService=S(P);entityLabel="cl\xE9 d'\xE9v\xE9nement";dialogService=S(W);dateFormat=S(be);bundleService=S(he);workspaceService=S(ae);ref;EventKeyStatus=$;quota=null;bundles=[];connectorActive=!1;get keys(){return this.items}fetchItems(){return _(this,null,function*(){let[t,e]=yield Promise.all([this.crudService.getAll(),this.crudService.getQuota()]);return this.quota=e,this.loadInteractive(),t})}loadInteractive(){return _(this,null,function*(){let t=this.workspaceService.activeWorkspaceId;try{let[e,o]=yield Promise.all([this.bundleService.getBundles(),t?this.bundleService.connectorConnected(t):Promise.resolve(!1)]);this.bundles=e,this.connectorActive=o}catch{}})}bundleNameFor(t){return t?this.bundles.find(e=>e.id===t)?.name??null:null}openBundlePickerForKey(t){this.ref=this.dialogService.open(Ve,{header:this.translateService.instant("EVENT_KEY.INTERACTIVE.PICK_TITLE"),width:"640px",modal:!0,dismissableMask:!0,contentStyle:{"padding-top":"1rem"}}),this.ref.onClose.subscribe(e=>_(this,null,function*(){e&&(yield this.setKeyBundle(t,e))}))}setKeyBundle(t,e){return _(this,null,function*(){try{yield this.crudService.setBundleAsync(t.id,e.id),t.bundleId=e.id,this.bundles.find(o=>o.id===e.id)||this.bundles.push(e),this.toastService.success(this.translateService.instant("EVENT_KEY.INTERACTIVE.ATTACHED_TOAST",{name:e.name}))}catch(o){this.toastService.error(o?.error?.message||"Erreur lors de l\u2019activation du pack")}})}clearKeyBundle(t){return _(this,null,function*(){try{yield this.crudService.setBundleAsync(t.id,null),t.bundleId=null,this.toastService.success(this.translateService.instant("EVENT_KEY.INTERACTIVE.DETACHED_TOAST"))}catch(e){this.toastService.error(e?.error?.message||"Erreur")}})}openCreateDialog(){this.ref=this.dialogService.open(Y,{header:this.translateService.instant("EVENT_KEY.FORM.TITLE"),width:"520px",modal:!0,dismissableMask:!0,contentStyle:{"padding-top":"1.5rem"}}),this.ref.onClose.subscribe(t=>_(this,null,function*(){t?.name&&(yield this.createKey(t))}))}createKey(t){return _(this,null,function*(){try{let e=yield this.crudService.createAsync(t);this.showCreatedDialog(e),yield this.loadData()}catch(e){this.toastService.error(e?.error?.message||"Erreur lors de la cr\xE9ation de la cl\xE9")}})}showCreatedDialog(t){this.ref=this.dialogService.open(F,{header:this.translateService.instant("EVENT_KEY.CREATED.HEADER"),width:"560px",modal:!0,closable:!1,data:{eventKey:t}})}confirmRotate(t){return _(this,null,function*(){if(yield this.confirmService.confirm({message:this.translateService.instant("EVENT_KEY.ROTATE_CONFIRM",{name:t.name}),header:this.translateService.instant("EVENT_KEY.ROTATE"),severity:"warn",acceptLabel:this.translateService.instant("EVENT_KEY.ROTATE"),rejectLabel:this.translateService.instant("EVENT_KEY.FORM.CANCEL")}))try{let o=yield this.crudService.rotateAsync(t.id);this.showCreatedDialog(o),yield this.loadData()}catch(o){this.toastService.error(o?.error?.message||"Erreur")}})}confirmRevoke(t){return _(this,null,function*(){if(yield this.confirmService.confirm({message:this.translateService.instant("EVENT_KEY.REVOKE_CONFIRM",{name:t.name}),header:this.translateService.instant("EVENT_KEY.REVOKE"),severity:"warn",acceptLabel:this.translateService.instant("EVENT_KEY.REVOKE"),rejectLabel:this.translateService.instant("EVENT_KEY.FORM.CANCEL")}))try{yield this.crudService.revokeAsync(t.id),this.toastService.success(this.translateService.instant("EVENT_KEY.REVOKED_TOAST")),yield this.loadData()}catch(o){this.toastService.error(o?.error?.message||"Erreur")}})}confirmDelete(t){return _(this,null,function*(){yield this.deleteItem(t,this.translateService.instant("EVENT_KEY.DELETE_CONFIRM",{name:t.name}),this.translateService.instant("EVENT_KEY.DELETE"))})}lastUsedLabel(t){return t?this.dateFormat.getRelativeTime(t):this.translateService.instant("EVENT_KEY.NEVER_USED")}static \u0275fac=(()=>{let t;return function(o){return(t||(t=D(a)))(o||a)}})();static \u0275cmp=h({type:a,selectors:[["app-view-manager-event-keys"]],features:[q([W]),z],decls:6,vars:8,consts:[["class","d-flex justify-content-between align-items-center mb-2",4,"ngIf"],["class","upsell-container",4,"ngIf"],["class","border rounded container-items container-fluid bg-white position-relative",3,"ngClass",4,"ngIf"],["class","border rounded container-fluid bg-white mt-3 p-3",4,"ngIf"],[1,"d-block","mt-5",3,"loading"],["class","alert alert-danger mt-3",4,"ngIf"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"text-light","fs-6"],[1,"pi","pi-sparkles","me-2"],[1,"d-flex","align-items-center","gap-3"],["label","EVENT_KEY.QUOTA_LABEL",3,"used","max",4,"ngIf"],["routerLink","/guides/live-events","target","_blank","rel","noopener",1,"text-decoration-none","text-primary","fs-6","text-nowrap"],[1,"pi","pi-compass","me-1"],[1,"d-none","d-md-inline"],["routerLink","/api-documentation","fragment","event-keys","target","_blank","rel","noopener",1,"text-decoration-none","text-primary","fs-6","text-nowrap"],[1,"pi","pi-book","me-1"],["type","button",1,"btn","btn-sm","btn-primary","text-white",3,"click"],[1,"pi","pi-plus","me-1"],[1,"d-md-none"],["label","EVENT_KEY.QUOTA_LABEL",3,"used","max"],[1,"upsell-container"],[1,"upsell-card"],[1,"upsell-layout"],[1,"upsell-text"],[1,"upsell-icon-wrapper","upsell-icon--events","mb-3"],[1,"pi","pi-sparkles"],[1,"upsell-title"],[1,"upsell-desc"],[1,"upsell-features"],[1,"upsell-feature"],[1,"upsell-feature-icon","upsell-fi--green"],[1,"pi","pi-bolt"],[1,"upsell-feature-text"],[1,"upsell-feature-label"],[1,"upsell-feature-hint"],[1,"upsell-feature-icon","upsell-fi--blue"],[1,"pi","pi-gift"],[1,"upsell-feature-icon","upsell-fi--orange"],[1,"pi","pi-desktop"],[1,"upsell-feature-icon","upsell-fi--purple"],[1,"pi","pi-shield"],["type","button",1,"upsell-cta","upsell-cta--events",3,"click"],[1,"pi","pi-plus"],["routerLink","/guides/live-events","target","_blank","rel","noopener",1,"d-inline-block","mt-3","ms-3","text-decoration-none","text-primary","fs-6"],["href","https://github.com/Hou-la/houla-live-connector/releases","target","_blank","rel","noopener",1,"d-inline-block","mt-3","ms-3","text-decoration-none","text-primary","fs-6"],[1,"pi","pi-download","me-1"],["routerLink","/api-documentation","fragment","event-keys","target","_blank","rel","noopener",1,"d-inline-block","mt-3","ms-3","text-decoration-none","text-primary","fs-6"],[1,"upsell-illustration","upsell-illust--events"],[1,"upsell-illustration-icon","pi","pi-sparkles"],[1,"border","rounded","container-items","container-fluid","bg-white","position-relative",3,"ngClass"],["class","row p-2",3,"ngClass",4,"ngFor","ngForOf"],[1,"row","p-2",3,"ngClass"],[1,"col-auto","d-flex","align-items-center","fs-6","text-light",2,"max-width","30px","width","30px"],[1,"col","d-flex","flex-column","text-truncate"],[1,"text-dark","fs-6","fw-semibold","text-truncate"],[1,"fs-6"],[1,"text-warning","bg-transparent"],[1,"d-flex","flex-wrap","gap-1","mt-1"],["severity","info",3,"value",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","flex-wrap","gap-2","mt-2"],["class","d-inline-flex align-items-center gap-1","
1style",` 2 font-size: 0.78rem; 3 font-weight: 600; 4 padding: 0.15rem 0.6rem; 5 border-radius: 999px; 6 background: rgba(155, 92, 255, 0.12); 7 color: #7c3aed; 8 border: 1px solid rgba(155, 92, 255, 0.3); 9 `,4,"ngIf"],["type","button","class","btn btn-sm p-0","style","font-size: 0.8rem; color: #7c3aed; font-weight: 500",3,"click",4,"ngIf"],["type","button","class","btn btn-sm p-0 text-light","style","font-size: 0.78rem",3,"click",4,"ngIf"],[1,"text-light","fs-6","mt-2"],[1,"d-flex","flex-wrap","gap-3"],[1,"d-flex","align-items-center"],[1,"pi","fs-6","me-1",3,"ngClass"],[3,"ngClass"],["tooltipPosition","right",1,"d-flex","align-items-center",3,"pTooltip"],[1,"pi","pi-clock","fs-6","me-1"],[1,"col-auto","d-flex","align-items-center","justify-content-end","pe-0"],["role","group",1,"btn-group"],["class","btn btn-sm text-primary p-1 me-1","tooltipPosition","left",3,"pTooltip","click",4,"ngIf"],["class","btn btn-sm text-warning p-1 me-1","tooltipPosition","left",3,"pTooltip","click",4,"ngIf"],["tooltipPosition","left",1,"btn","btn-sm","text-danger","p-1",3,"click","pTooltip"],[1,"pi","pi-trash","fs-6"],["severity","info",3,"value"],[1,"d-inline-flex","align-items-center","gap-1",2,"font-size","0.78rem","font-weight","600","padding","0.15rem 0.6rem","border-radius","999px","background","rgba(155, 92, 255, 0.12)","color","#7c3aed","border","1px solid rgba(155, 92, 255, 0.3)"],[1,"pi","pi-bolt",2,"font-size","0.72rem"],["type","button",1,"btn","btn-sm","p-0",2,"font-size","0.8rem","color","#7c3aed","font-weight","500",3,"click"],["class","pi pi-bolt me-1","style","font-size: 0.72rem",4,"ngIf"],[1,"pi","pi-bolt","me-1",2,"font-size","0.72rem"],["type","button",1,"btn","btn-sm","p-0","text-light",2,"font-size","0.78rem",3,"click"],["tooltipPosition","left",1,"btn","btn-sm","text-primary","p-1","me-1",3,"click","pTooltip"],[1,"pi","pi-refresh","fs-6"],["tooltipPosition","left",1,"btn","btn-sm","text-warning","p-1","me-1",3,"click","pTooltip"],[1,"pi","pi-ban","fs-6"],[1,"border","rounded","container-fluid","bg-white","mt-3","p-3"],[1,"d-flex","align-items-center","mb-2"],[1,"pi","pi-bolt","me-2",2,"color","#9b5cff"],[1,"text-dark","fw-semibold"],[1,"text-light","fs-6","mb-0"],[1,"fs-6","mb-0","mt-2"],["class","text-success",4,"ngIf"],["class","text-secondary",4,"ngIf"],["href","https://github.com/Hou-la/houla-live-connector/releases","target","_blank","rel","noopener",1,"d-inline-block","mt-2","text-decoration-none","text-primary","fs-6"],[1,"text-success"],[1,"pi","pi-check-circle","me-1"],[1,"text-secondary"],[1,"pi","pi-circle","me-1"],[1,"alert","alert-danger","mt-3"],[1,"btn","btn-sm","btn-outline-danger","ms-2",3,"click"]],template:function(e,o){e&1&&(y(0,Fe,25,16,"div",0)(1,Le,71,42,"div",1)(2,qe,2,4,"div",2)(3,Ze,16,11,"div",3),m(4,"app-widget-loading",4),y(5,et,5,4,"div",5)),e&2&&(c("ngIf",!o.loading&&o.keys.length>0),i(),c("ngIf",!o.loading&&!o.error&&o.keys.length===0),i(),c("ngIf",o.keys.length>0),i(),c("ngIf",o.keys.length>0),i(),Q("dark"),c("loading",o.loading),i(),c("ngIf",!o.loading&&o.error))},dependencies:[k,V,O,A,Z,te,ee,M,me,de,Te,xe,ve,Ce,N,w,Ee,Ke],styles:[".container-items[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{transition:background-color .15s}.container-items[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:hover{background-color:#f8f9fa}[_nghost-%COMP%]{display:block}"]})};export{Me as ViewManagerEventKeysComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.