p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
2 lines • 29.9 kB
JavaScript
import {u,y,w}from'./chunk-4F4EzhXh.js';import {L as Lt,R as Rt}from'./chunk-ClozYWD6.js';import {X as Xe$1,cV as z,d1 as Ue$1,f as fQ,G as It,b as bi,K as op,L as uc,Q,F as x,b7 as _t$1,_ as _e,m as mb,aJ as jn,c$ as Pn,cj as He$1,co as rn,bd as On,d0 as xn,d3 as ot$1,dj as Gt,de as Tt,df as Pt,be as tn,bE as Jt,cW as zt,cX as jt,cY as Vt,cZ as Nt,bc as Ut,ba as qe$1,cp as q,cq as H,d4 as xt$1,ck as Ve,cl as Be,bb as q$1,e as aY,aK as iY,g as _A,y as yt$1,w as wt$1,d as ae,s as se,i as Qt,j as gt$1,x as YT,B as Ba,k as bv,I as IS,v as vf,cr as Lv,bj as Mx,n as no,H as HT,bt as VT,aY as rS,c as In,t as If,R as Rv,cs as Fv,p as pv,bk as Nx,r as ro,U as UT,J as JT,z as fm,cu as AS,A as pm,aN as Ov,aO as kS}from'./chunk-BwlFOdbx.js';import {w as we,t as te}from'./chunk-B8YlgrW9.js';import'./chunk-BqyDblvT.js';import {L}from'./main-HNF44SV3.js';import {Q as Q$1}from'./chunk-BnyV8OX_.js';var Ae=a=>({maxValueAsBuffer:a});function Re(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT();In(),Rv(e.strings().form?.key?.error?.key);}}function Je(a,c){if(a&1&&(Ba(0,"mat-option",10),IS(1),vf()),a&2){let e=c.$implicit,s=JT();pv("value",e),In(),Rv(s.strings().redisTypes?.[e]||e);}}function qe(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",19),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.index,t)||(r.model.index=t),pm(t)}),vf(),Mx(),vf(),Ba(4,"div",20),IS(5),vf();}if(a&2){let e=JT();In(2),Rv(e.strings().form?.key?.field?.index),In(),Fv("ngModel",e.model.index),Nx(),In(2),Rv(e.strings().label?.redisListIndexInfo);}}function ze(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",19),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.index,t)||(r.model.index=t),pm(t)}),vf(),Mx(),vf(),Ba(4,"div",20),IS(5),vf();}if(a&2){let e=JT();In(2),Rv(e.strings().form?.key?.field?.index),In(),Fv("ngModel",e.model.index),Nx(),In(2),Rv(e.strings().label?.redisArrayIndexInfo);}}function He(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.hashKey);}}function Ge(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",21),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.hashKey,t)||(r.model.hashKey=t),pm(t)}),vf(),Mx(),no(4,He,2,1,"mat-error"),vf();}if(a&2){let e=JT(),s=rS(1);In(2),Rv(e.strings().form?.key?.field?.hashKey),In(),Fv("ngModel",e.model.hashKey),Nx(),In(),ro(s.controls.hashKey?.invalid&&s.controls.hashKey?.touched?4:-1);}}function Ue(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.score);}}function Xe(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",22),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.score,t)||(r.model.score=t),pm(t)}),vf(),Mx(),no(4,Ue,2,1,"mat-error"),vf();}if(a&2){let e=JT(),s=rS(1);In(2),Rv(e.strings().form?.key?.field?.score),In(),Fv("ngModel",e.model.score),Nx(),In(),ro(s.controls.score?.invalid&&s.controls.score?.touched?4:-1);}}function Ye(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.streamTimestamp);}}function Qe(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",23),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.streamTimestamp,t)||(r.model.streamTimestamp=t),pm(t)}),vf(),Mx(),no(4,Ye,2,1,"mat-error"),vf(),Ba(5,"div",20),IS(6),vf();}if(a&2){let e=JT(),s=rS(1);In(2),Rv(e.strings().form?.key?.field?.streamTimestamp),In(),Fv("ngModel",e.model.streamTimestamp),Nx(),In(),ro(s.controls.streamTimestamp?.invalid&&s.controls.streamTimestamp?.touched?4:-1),In(2),Rv(e.strings().label?.streamTimestampId);}}function Ze(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",26),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsRetention,t)||(r.model.tsRetention=t),pm(t)}),vf(),Mx(),Ba(4,"mat-hint"),IS(5),vf()(),Ba(6,"mat-form-field",7)(7,"mat-label"),IS(8),vf(),Ba(9,"mat-select",27),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsDuplicatePolicy,t)||(r.model.tsDuplicatePolicy=t),pm(t)}),Ba(10,"mat-option",28),IS(11,"LAST"),vf(),Ba(12,"mat-option",29),IS(13,"FIRST"),vf(),Ba(14,"mat-option",30),IS(15,"MIN"),vf(),Ba(16,"mat-option",31),IS(17,"MAX"),vf(),Ba(18,"mat-option",32),IS(19,"SUM"),vf(),Ba(20,"mat-option",33),IS(21,"BLOCK"),vf()(),Mx(),vf();}if(a&2){let e=JT(2);In(2),If("",e.strings().page?.key?.timeseries?.retention," (ms)"),In(),Fv("ngModel",e.model.tsRetention),Nx(),In(2),Rv(e.strings().page?.key?.timeseries?.retentionHint),In(3),Rv(e.strings().page?.key?.timeseries?.duplicatePolicy),In(),Fv("ngModel",e.model.tsDuplicatePolicy),Nx();}}function $e(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",34),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsTimestamp,t)||(r.model.tsTimestamp=t),pm(t)}),vf(),Mx(),Ba(4,"mat-hint"),IS(5),vf()();}if(a&2){let e=JT(2);In(2),Rv(e.strings().page?.key?.timeseries?.timestamp),In(),Fv("ngModel",e.model.tsTimestamp),pv("disabled",e.model.originalTimestamp!==void 0),Nx(),In(2),Rv(e.strings().page?.key?.timeseries?.timestampHint);}}function et(a,c){if(a&1){let e=YT();Ba(0,"mat-slide-toggle",35),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsBulkMode,t)||(r.model.tsBulkMode=t),pm(t)}),IS(1),vf(),Mx();}if(a&2){let e=JT(2);Fv("ngModel",e.model.tsBulkMode),Nx(),In(),If(" ",e.strings().page?.key?.timeseries?.bulkMode," ");}}function tt(a,c){if(a&1){let e=YT();no(0,Ze,22,5),Ba(1,"mat-form-field",7)(2,"mat-label"),IS(3),vf(),Ba(4,"input",24),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.tsLabels,t)||(r.model.tsLabels=t),pm(t)}),vf(),Mx(),Ba(5,"mat-hint"),IS(6),vf()(),no(7,$e,6,4,"mat-form-field",7),no(8,et,2,2,"mat-slide-toggle",25);}if(a&2){let e=JT();ro(e.options.type==="add"?0:-1),In(3),Rv(e.strings().page?.key?.timeseries?.labels),In(),Fv("ngModel",e.model.tsLabels),Nx(),In(2),Rv(e.strings().page?.key?.timeseries?.labelsHint),In(),ro(e.model.tsBulkMode?-1:7),In(),ro(e.model.originalTimestamp===void 0?8:-1);}}function it(a,c){if(a&1){let e=YT();Ba(0,"div",11)(1,"mat-form-field",36)(2,"mat-label"),IS(3),vf(),Ba(4,"input",37),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.bloomErrorRate,t)||(r.model.bloomErrorRate=t),pm(t)}),vf(),Mx(),vf(),Ba(5,"mat-form-field",36)(6,"mat-label"),IS(7),vf(),Ba(8,"input",38),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.bloomCapacity,t)||(r.model.bloomCapacity=t),pm(t)}),vf(),Mx(),vf()();}if(a&2){let e=JT();In(3),Rv(e.strings().form?.key?.field?.errorRate),In(),Fv("ngModel",e.model.bloomErrorRate),Nx(),In(3),Rv(e.strings().form?.key?.field?.capacity),In(),Fv("ngModel",e.model.bloomCapacity),Nx();}}function nt(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",39),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.cuckooCapacity,t)||(r.model.cuckooCapacity=t),pm(t)}),vf(),Mx(),vf();}if(a&2){let e=JT();In(2),Rv(e.strings().form?.key?.field?.capacity),In(),Fv("ngModel",e.model.cuckooCapacity),Nx();}}function ot(a,c){if(a&1){let e=YT();Ba(0,"div",11)(1,"mat-form-field",40)(2,"mat-label"),IS(3,"Top K"),vf(),Ba(4,"input",41),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.topkK,t)||(r.model.topkK=t),pm(t)}),vf(),Mx(),vf(),Ba(5,"mat-form-field",40)(6,"mat-label"),IS(7),vf(),Ba(8,"input",42),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.topkWidth,t)||(r.model.topkWidth=t),pm(t)}),vf(),Mx(),vf(),Ba(9,"mat-form-field",40)(10,"mat-label"),IS(11),vf(),Ba(12,"input",43),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.topkDepth,t)||(r.model.topkDepth=t),pm(t)}),vf(),Mx(),vf(),Ba(13,"mat-form-field",40)(14,"mat-label"),IS(15),vf(),Ba(16,"input",44),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.topkDecay,t)||(r.model.topkDecay=t),pm(t)}),vf(),Mx(),vf()();}if(a&2){let e=JT();In(4),Fv("ngModel",e.model.topkK),Nx(),In(3),Rv(e.strings().form?.key?.field?.width),In(),Fv("ngModel",e.model.topkWidth),Nx(),In(3),Rv(e.strings().form?.key?.field?.depth),In(),Fv("ngModel",e.model.topkDepth),Nx(),In(3),Rv(e.strings().form?.key?.field?.decay),In(),Fv("ngModel",e.model.topkDecay),Nx();}}function at(a,c){if(a&1){let e=YT();Ba(0,"div",11)(1,"mat-form-field",36)(2,"mat-label"),IS(3),vf(),Ba(4,"input",45),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.cmsWidth,t)||(r.model.cmsWidth=t),pm(t)}),vf(),Mx(),vf(),Ba(5,"mat-form-field",36)(6,"mat-label"),IS(7),vf(),Ba(8,"input",46),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.cmsDepth,t)||(r.model.cmsDepth=t),pm(t)}),vf(),Mx(),vf()();}if(a&2){let e=JT();In(3),Rv(e.strings().form?.key?.field?.width),In(),Fv("ngModel",e.model.cmsWidth),Nx(),In(3),Rv(e.strings().form?.key?.field?.depth),In(),Fv("ngModel",e.model.cmsDepth),Nx();}}function rt(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",47),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.tdigestCompression,t)||(r.model.tdigestCompression=t),pm(t)}),vf(),Mx(),vf();}if(a&2){let e=JT();In(2),Rv(e.strings().form?.key?.field?.compression),In(),Fv("ngModel",e.model.tdigestCompression),Nx();}}function lt(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",48),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.vectorElement,t)||(r.model.vectorElement=t),pm(t)}),vf(),Mx(),vf(),Ba(4,"mat-form-field",7)(5,"mat-label"),IS(6),vf(),Ba(7,"input",49),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.vectorValues,t)||(r.model.vectorValues=t),pm(t)}),vf(),Mx(),vf();}if(a&2){let e=JT();In(2),Rv(e.strings().page?.key?.vectorset?.elementName),In(),Fv("ngModel",e.model.vectorElement),Nx(),In(3),Rv(e.strings().page?.key?.vectorset?.vectorValues),In(),Fv("ngModel",e.model.vectorValues),Nx();}}function mt(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().intention?.setBuffer);}}function st(a,c){if(a&1){let e=YT();Ba(0,"button",50),bv("click",function(){fm(e),JT();let t=rS(33);return pm(t.click())}),Ba(1,"mat-icon"),IS(2,"upload"),vf(),no(3,mt,2,1,"span"),vf();}if(a&2){let e=JT();pv("matTooltip",e.isWide?"":e.strings().intention?.setBuffer),In(3),ro(e.isWide?3:-1);}}function dt(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().intention?.jsonViewEditor);}}function ct(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().intention?.formatJson);}}function pt(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().intention?.jsonViewShow);}}function gt(a,c){if(a&1){let e=YT();Ba(0,"button",50),bv("click",function(){fm(e);let t=JT();return pm(t.openJsonEditor())}),Ba(1,"mat-icon"),IS(2,"description"),vf(),no(3,dt,2,1,"span"),vf(),Ba(4,"button",50),bv("click",function(){fm(e);let t=JT();return pm(t.formatJson())}),Ba(5,"mat-icon"),IS(6,"format_line_spacing"),vf(),no(7,ct,2,1,"span"),vf(),Ba(8,"button",15),bv("click",function(){fm(e);let t=JT();return pm(t.openJsonViewer())}),Ba(9,"mat-icon"),IS(10,"account_tree"),vf(),no(11,pt,2,1,"span"),vf();}if(a&2){let e=JT();pv("matTooltip",e.isWide?"":e.strings().intention?.jsonViewEditor),In(3),ro(e.isWide?3:-1),In(),pv("matTooltip",e.isWide?"":e.strings().intention?.formatJson),In(3),ro(e.isWide?7:-1),In(),pv("matTooltip",e.isWide?"":e.strings().intention?.jsonViewShow),In(3),ro(e.isWide?11:-1);}}function _t(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT();In(),Rv(e.strings().intention?.copy);}}function ut(a,c){if(a&1&&(Ba(0,"div",20),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().label?.streamValue);}}function Ct(a,c){if(a&1&&(Ba(0,"div",20),IS(1),vf()),a&2){let e=JT(2);In(),Ov(" ",e.strings().label?.isBuffer?.(kS(2,Ae,e.getMaxValueAsBufferText()))," ",e.bufferDisplay(e.model.value)," ");}}function yt(a,c){if(a&1){let e=YT();Ba(0,"mat-slide-toggle",51),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.validateJson,t)||(r.validateJson=t),pm(t)}),IS(1),vf(),Mx(),no(2,ut,2,1,"div",20),no(3,Ct,2,4,"div",20);}if(a&2){let e=JT();Fv("ngModel",e.validateJson),Nx(),In(),If(" ",e.strings().label?.validateJson," "),In(),ro(e.model.type==="stream"?2:-1),In(),ro(e.isBuffer?3:-1);}}function xt(a,c){if(a&1&&(Ba(0,"span"),IS(1),vf()),a&2){let e=JT(3);In(),Rv(e.strings().page?.key?.timeseries?.generate);}}function ft(a,c){if(a&1){let e=YT();Ba(0,"div",52)(1,"mat-form-field",64)(2,"mat-label"),IS(3),vf(),Ba(4,"input",65),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsFormulaPoints,t)||(r.model.tsFormulaPoints=t),pm(t)}),vf(),Mx(),vf(),Ba(5,"mat-form-field",64)(6,"mat-label"),IS(7),vf(),Ba(8,"input",66),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsFormulaAmplitude,t)||(r.model.tsFormulaAmplitude=t),pm(t)}),vf(),Mx(),vf(),Ba(9,"mat-form-field",64)(10,"mat-label"),IS(11),vf(),Ba(12,"input",67),Lv("ngModelChange",function(t){fm(e);let r=JT(2);return AS(r.model.tsFormulaOffset,t)||(r.model.tsFormulaOffset=t),pm(t)}),vf(),Mx(),vf(),Ba(13,"button",68),bv("click",function(){fm(e);let t=JT(2);return pm(t.generateFormula())}),Ba(14,"mat-icon"),IS(15,"auto_graph"),vf(),no(16,xt,2,1,"span"),vf()();}if(a&2){let e=JT(2);In(3),Rv(e.strings().page?.key?.timeseries?.formulaPoints),In(),Fv("ngModel",e.model.tsFormulaPoints),Nx(),In(3),Rv(e.strings().page?.key?.timeseries?.formulaAmplitude),In(),Fv("ngModel",e.model.tsFormulaAmplitude),Nx(),In(3),Rv(e.strings().page?.key?.timeseries?.formulaOffset),In(),Fv("ngModel",e.model.tsFormulaOffset),Nx(),In(4),ro(e.isWide?16:-1);}}function wt(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.value);}}function ht(a,c){if(a&1){let e=YT();Ba(0,"div",52)(1,"mat-form-field",53)(2,"mat-label"),IS(3),vf(),Ba(4,"mat-select",54),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.tsSpread,t)||(r.model.tsSpread=t),pm(t)}),Ba(5,"mat-option",10),IS(6),vf(),Ba(7,"mat-option",10),IS(8),vf(),Ba(9,"mat-option",10),IS(10),vf(),Ba(11,"mat-option",10),IS(12),vf(),Ba(13,"mat-option",10),IS(14),vf(),Ba(15,"mat-option",10),IS(16),vf()(),Mx(),vf(),Ba(17,"mat-form-field",55)(18,"mat-label"),IS(19),vf(),Ba(20,"mat-select",56),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.tsFormula,t)||(r.model.tsFormula=t),pm(t)}),Ba(21,"mat-option",57),IS(22),vf(),Ba(23,"mat-option",58),IS(24,"sin"),vf(),Ba(25,"mat-option",59),IS(26,"cos"),vf(),Ba(27,"mat-option",60),IS(28),vf(),Ba(29,"mat-option",61),IS(30),vf(),Ba(31,"mat-option",62),IS(32),vf()(),Mx(),vf()(),no(33,ft,17,7,"div",52),Ba(34,"mat-form-field",7)(35,"mat-label"),IS(36),vf(),Ba(37,"textarea",63),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.value,t)||(r.model.value=t),pm(t)}),vf(),Mx(),Ba(38,"mat-hint"),IS(39),vf(),no(40,wt,2,1,"mat-error"),vf();}if(a&2){let e=JT(),s=rS(1);In(3),Rv(e.strings().page?.key?.timeseries?.autoSpread),In(),Fv("ngModel",e.model.tsSpread),Nx(),In(),pv("value",1e3),In(),If("1 ",e.strings().time?.second),In(),pv("value",3e4),In(),If("30 ",e.strings().time?.seconds),In(),pv("value",6e4),In(),If("1 ",e.strings().time?.minute),In(),pv("value",18e5),In(),If("30 ",e.strings().time?.minutes),In(),pv("value",36e5),In(),If("1 ",e.strings().time?.hour),In(),pv("value",864e5),In(),If("24 ",e.strings().time?.hours),In(3),Rv(e.strings().page?.key?.timeseries?.formula),In(),Fv("ngModel",e.model.tsFormula),Nx(),In(2),Rv(e.strings().page?.key?.timeseries?.none),In(6),Rv(e.strings().page?.key?.timeseries?.formulaLinear),In(2),Rv(e.strings().page?.key?.timeseries?.formulaRandom),In(2),Rv(e.strings().page?.key?.timeseries?.formulaSawtooth),In(),ro(e.model.tsFormula?33:-1),In(3),Rv(e.strings().page?.key?.timeseries?.dataPoints),In(),Fv("ngModel",e.model.value),Nx(),In(2),Rv(e.strings().page?.key?.timeseries?.editAllHint),In(),ro(s.controls.value?.invalid&&s.controls.value?.touched?40:-1);}}function St(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.value);}}function Mt(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"input",69),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.value,t)||(r.model.value=t),pm(t)}),vf(),Mx(),no(4,St,2,1,"mat-error"),vf();}if(a&2){let e=JT(),s=rS(1);In(2),Rv(e.strings().page?.key?.timeseries?.value),In(),Fv("ngModel",e.model.value),Nx(),In(),ro(s.controls.value?.invalid&&s.controls.value?.touched?4:-1);}}function vt(a,c){if(a&1&&(Ba(0,"mat-error"),IS(1),vf()),a&2){let e=JT(2);In(),Rv(e.strings().form?.key?.error?.value);}}function bt(a,c){if(a&1){let e=YT();Ba(0,"mat-form-field",7)(1,"mat-label"),IS(2),vf(),Ba(3,"textarea",70),Lv("ngModelChange",function(t){fm(e);let r=JT();return AS(r.model.value,t)||(r.model.value=t),pm(t)}),vf(),Mx(),no(4,vt,2,1,"mat-error"),vf();}if(a&2){let e=JT(),s=rS(1);In(2),Rv(e.strings().form?.key?.field?.value),In(),Fv("ngModel",e.model.value),Nx(),In(),ro(s.controls.value?.invalid&&s.controls.value?.touched?4:-1);}}function Et(a,c){if(a&1&&(Ba(0,"button",18)(1,"mat-icon"),IS(2),vf(),IS(3),vf()),a&2){let e=JT();In(2),Rv(e.options.type==="edit"?"edit":"add"),In(),If(" ",e.options.type==="edit"?e.strings().intention?.save:e.strings().intention?.add," ");}}var ci=(()=>{class a{dialogRef;data;i18n;common;socket;jsonViewDialog;jsonEditorDialog;breakpointObserver;cdr;state;settings;overlay;diffDialog;model={};options;get types(){let e=["string","list","hash","set","zset","stream"];return this.state.hasTimeSeries()&&e.push("timeseries"),this.state.hasReJSON()&&e.push("json"),this.state.hasBloom()&&e.push("bloom","cuckoo","topk","cms","tdigest"),this.state.redisVersion().isAtLeast(8,8)&&e.push("array"),e.push("vectorset"),e}static PROBABILISTIC_TYPES=["bloom","cuckoo","topk","cms","tdigest"];isProbabilisticType(){return a.PROBABILISTIC_TYPES.includes(this.model.type)||this.model.type==="vectorset"}validateJson=false;isReadonly=false;isBuffer=false;isWide=window.innerWidth>=720;strings;constructor(e,s,t,r,v,M,D,T,Be,Pe,Fe,Le,je){this.dialogRef=e,this.data=s,this.i18n=t,this.common=r,this.socket=v,this.jsonViewDialog=M,this.jsonEditorDialog=D,this.breakpointObserver=T,this.cdr=Be,this.state=Pe,this.settings=Fe,this.overlay=Le,this.diffDialog=je,this.strings=this.i18n.strings,this.options=s;}ngOnInit(){this.isReadonly=this.state.connection()?.readonly===true,this.breakpointObserver.observe("(min-width: 720px)").subscribe(e=>{this.isWide=e.matches,this.cdr.markForCheck();}),this.model={type:"string",key:this.data.node?.key?this.data.node.key+(this.settings.redisTreeDivider()??":"):"",value:void 0,score:void 0,streamTimestamp:void 0,tsTimestamp:void 0,tsRetention:0,tsDuplicatePolicy:"LAST",tsLabels:"",tsBulkMode:false,tsSpread:6e4,tsFormula:"",tsFormulaPoints:25,tsFormulaAmplitude:100,tsFormulaOffset:0,hashKey:void 0,index:void 0,bloomErrorRate:.01,bloomCapacity:100,cuckooCapacity:1024,topkK:10,topkWidth:2e3,topkDepth:7,topkDecay:.9,cmsWidth:2e3,cmsDepth:7,tdigestCompression:100,vectorElement:"",vectorValues:""},this.data.model&&Object.assign(this.model,this.data.model),this.isBuffer=typeof this.model.value=="object"&&this.model.value!==null;}getTitle(){let e=this.strings();return this.options.type==="edit"?e.form?.key?.label?.formName?.edit:this.options.type==="append"?e.form?.key?.label?.formName?.append:e.form?.key?.label?.formName?.add}getMaxValueAsBufferText(){try{return this.settings.prettyBytes(this.settings.maxValueAsBuffer)}catch(e){return `${this.settings.maxValueAsBuffer} bytes`}}bufferDisplay(e){return e?.byteLength!==void 0?"("+this.settings.prettyBytes(e.byteLength)+")":""}copy(){return L(this,null,function*(){let e=this.model.value;this.model.type==="timeseries"&&(e=`TS.ADD ${this.model.key} ${this.model.tsTimestamp||"*"} ${this.model.value}`),yield this.settings.clipboard(e),this.common.toast(this.strings().status?.dataCopied);})}openJsonViewer(){return L(this,null,function*(){yield this.jsonViewDialog.show({value:this.model.value});})}openJsonEditor(){return L(this,null,function*(){try{let e=yield this.jsonEditorDialog.show({value:this.model.value});this.model.value=e.obj;}catch(e){}})}formatJson(){try{this.model.value=JSON.stringify(JSON.parse(this.model.value),null,this.settings.jsonFormat()??2);}catch(e){this.common.toast(this.strings().label?.jsonViewNotParsable);}}onFileSelected(e){return L(this,null,function*(){let s=e.target,t=s.files?.[0];if(t){try{yield this.common.confirm({message:this.strings().confirm?.uploadBuffer});let r=yield t.arrayBuffer();this.model.value=r,this.isBuffer=!0,this.common.toast(this.strings().confirm?.uploadBufferDone);}catch(r){}s.value="";}})}submit(){return L(this,null,function*(){if(!this.model.key||this.model.key.trim().length===0){this.common.toast(this.strings().form?.key?.error?.key);return}if(this.validateJson)try{JSON.parse(this.model.value);}catch(e){this.common.toast(this.strings().label?.jsonViewNotParsable);return}try{if(this.data.model?.value!==void 0&&this.data.model.value!==this.model.value&&!(yield this.diffDialog.show({keyName:this.model.key,fieldName:this.model.hashKey||void 0,oldValue:String(this.data.model.value),newValue:String(this.model.value)})))return;this.overlay.show();let e=yield this.socket.request({action:"key/new-or-set",payload:{type:this.options.type,originalValue:this.data.model?.value,originalHashKey:this.data.model?.hashKey,originalIndex:this.data.model?.index,model:structuredClone(this.model)}});typeof window.gtag=="function"&&window.gtag("config",this.settings.googleAnalytics,{page_path:"/key-new-or-set"}),this.common.toast(this.strings().status?.set),this.dialogRef.close(e);}catch(e){this.common.generalHandleError(e);}finally{this.overlay.hide();}})}generateFormula(){let e=Math.min(Math.max(parseInt(this.model.tsFormulaPoints)||25,1),1e4),s=parseFloat(this.model.tsFormulaAmplitude)||100,t=parseFloat(this.model.tsFormulaOffset)||0,r=this.model.tsFormula,v=[];for(let M=0;M<e;M++){let D=M/e,T;switch(r){case "sin":T=Math.sin(D*Math.PI*2)*s+t;break;case "cos":T=Math.cos(D*Math.PI*2)*s+t;break;case "linear":T=D*s+t;break;case "random":T=Math.random()*s+t;break;case "sawtooth":T=D%.25*4*s+t;break;default:T=t;}v.push(`* ${parseFloat(T.toFixed(4))}`);}this.model.value=v.join(`
`);}cancel(){this.dialogRef.close(void 0);}static \u0275fac=function(s){return new(s||a)(Xe$1(z),Xe$1(Ue$1),Xe$1(fQ),Xe$1(It),Xe$1(bi),Xe$1(u),Xe$1(y),Xe$1(op),Xe$1(uc),Xe$1(Q),Xe$1(x),Xe$1(_t$1),Xe$1(w))};static \u0275cmp=_e({type:a,selectors:[["p3xr-key-new-or-set-dialog"]],decls:48,vars:16,consts:[["keyForm","ngForm"],["fileInput",""],["novalidate","",3,"ngSubmit"],[1,"p3xr-dialog-toolbar","p3xr-mat-layout-strong"],["mat-dialog-title","",1,"p3xr-dialog-title"],["mat-icon-button","","type","button",3,"click"],[1,"p3xr-dialog-content"],[1,"full-width"],["matInput","","required","","minlength","1","name","key",3,"ngModelChange","ngModel","disabled"],["name","type",3,"ngModelChange","ngModel","disabled"],[3,"value"],[2,"display","flex","gap","16px","flex-wrap","wrap"],["type","file",2,"display","none",3,"change"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn",3,"matTooltip"],[2,"margin","8px 0"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn",3,"click","matTooltip"],[1,"p3xr-dialog-actions"],[3,"cancel"],["mat-raised-button","","type","submit",1,"btn-primary"],["matInput","","type","number","step","1","name","index",3,"ngModelChange","ngModel"],[1,"info-text"],["matInput","","required","","minlength","1","name","hashKey",3,"ngModelChange","ngModel"],["matInput","","type","number","required","","name","score",3,"ngModelChange","ngModel"],["matInput","","required","","name","streamTimestamp",3,"ngModelChange","ngModel"],["matInput","","name","tsLabels",3,"ngModelChange","ngModel"],["name","tsBulkMode",2,"display","block","margin","8px 0",3,"ngModel"],["matInput","","type","number","name","tsRetention",3,"ngModelChange","ngModel"],["name","tsDuplicatePolicy",3,"ngModelChange","ngModel"],["value","LAST"],["value","FIRST"],["value","MIN"],["value","MAX"],["value","SUM"],["value","BLOCK"],["matInput","","name","tsTimestamp",3,"ngModelChange","ngModel","disabled"],["name","tsBulkMode",2,"display","block","margin","8px 0",3,"ngModelChange","ngModel"],[2,"flex","1","min-width","140px"],["matInput","","type","number","step","0.001","name","bloomErrorRate","placeholder","0.01 = 1%",3,"ngModelChange","ngModel"],["matInput","","type","number","name","bloomCapacity",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cuckooCapacity",3,"ngModelChange","ngModel"],[2,"flex","1","min-width","100px"],["matInput","","type","number","name","topkK",3,"ngModelChange","ngModel"],["matInput","","type","number","name","topkWidth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","topkDepth",3,"ngModelChange","ngModel"],["matInput","","type","number","step","0.1","name","topkDecay",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cmsWidth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","cmsDepth",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tdigestCompression",3,"ngModelChange","ngModel"],["matInput","","name","vectorElement",3,"ngModelChange","ngModel"],["matInput","","name","vectorValues","placeholder","0.1, 0.2, 0.3",3,"ngModelChange","ngModel"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn",3,"click","matTooltip"],["name","validateJson",2,"display","block","margin","8px 0",3,"ngModelChange","ngModel"],[2,"display","flex","flex-wrap","wrap","gap","12px","align-items","center","margin-bottom","8px"],["subscriptSizing","dynamic",2,"min-width","140px","flex","1"],["name","tsSpread",3,"ngModelChange","ngModel"],["subscriptSizing","dynamic",2,"min-width","120px","flex","1"],["name","tsFormula",3,"ngModelChange","ngModel"],["value",""],["value","sin"],["value","cos"],["value","linear"],["value","random"],["value","sawtooth"],["matInput","","required","","name","value","rows","10",2,"font-family","'Roboto Mono', monospace","font-size","13px",3,"ngModelChange","ngModel"],["subscriptSizing","dynamic",2,"min-width","80px","flex","1"],["matInput","","type","number","name","tsFormulaPoints","min","1","max","10000",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tsFormulaAmplitude",3,"ngModelChange","ngModel"],["matInput","","type","number","name","tsFormulaOffset",3,"ngModelChange","ngModel"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn",3,"click"],["matInput","","type","number","required","","name","value",3,"ngModelChange","ngModel"],["matInput","","required","","name","value","rows","5",3,"ngModelChange","ngModel"]],template:function(s,t){if(s&1){let r=YT();Ba(0,"form",2,0),bv("ngSubmit",function(){return t.submit()}),Ba(2,"mat-toolbar",3)(3,"span",4),IS(4),vf(),Ba(5,"button",5),bv("click",function(){return t.cancel()}),Ba(6,"mat-icon"),IS(7,"close"),vf()()(),Ba(8,"mat-dialog-content",6)(9,"mat-form-field",7)(10,"mat-label"),IS(11),vf(),Ba(12,"input",8),Lv("ngModelChange",function(M){return fm(r),AS(t.model.key,M)||(t.model.key=M),pm(M)}),vf(),Mx(),no(13,Re,2,1,"mat-error"),vf(),Ba(14,"mat-form-field",7)(15,"mat-label"),IS(16),vf(),Ba(17,"mat-select",9),Lv("ngModelChange",function(M){return fm(r),AS(t.model.type,M)||(t.model.type=M),pm(M)}),HT(18,Je,2,2,"mat-option",10,VT),vf(),Mx(),vf(),no(20,qe,6,3)(21,ze,6,3)(22,Ge,5,3,"mat-form-field",7)(23,Xe,5,3,"mat-form-field",7)(24,Qe,7,4)(25,tt,9,6)(26,it,9,4,"div",11)(27,nt,4,2,"mat-form-field",7)(28,ot,17,7,"div",11)(29,at,9,4,"div",11)(30,rt,4,2,"mat-form-field",7)(31,lt,8,4),Ba(32,"input",12,1),bv("change",function(M){return t.onFileSelected(M)}),vf(),no(34,st,4,2,"button",13),no(35,gt,12,6),Ba(36,"div",14)(37,"button",15),bv("click",function(){return t.copy()}),Ba(38,"mat-icon"),IS(39,"content_copy"),vf(),no(40,_t,2,1,"span"),vf()(),no(41,yt,4,4),no(42,ht,41,25)(43,Mt,5,3,"mat-form-field",7)(44,bt,5,3,"mat-form-field",7),vf(),Ba(45,"mat-dialog-actions",16)(46,"p3xr-dialog-cancel",17),bv("cancel",function(){return t.cancel()}),vf(),no(47,Et,4,2,"button",18),vf()();}if(s&2){let r,v=rS(1);In(4),If(" ",t.getTitle()," "),In(7),Rv(t.strings().form?.key?.field?.key),In(),Fv("ngModel",t.model.key),pv("disabled",t.options.type!=="add"),Nx(),In(),ro(v.controls.key?.invalid&&v.controls.key?.touched?13:-1),In(3),Rv(t.strings().form?.key?.field?.type),In(),Fv("ngModel",t.model.type),pv("disabled",t.options.type!=="add"),Nx(),In(),UT(t.types),In(2),ro((r=t.model.type)==="list"?20:r==="array"?21:r==="hash"?22:r==="zset"?23:r==="stream"?24:r==="timeseries"?25:r==="bloom"?26:r==="cuckoo"?27:r==="topk"?28:r==="cms"?29:r==="tdigest"?30:r==="vectorset"?31:-1),In(14),ro(t.model.type!=="stream"&&t.model.type!=="timeseries"&&!t.isProbabilisticType()?34:-1),In(),ro(t.model.type!=="timeseries"&&!t.isProbabilisticType()?35:-1),In(2),pv("matTooltip",t.isWide?"":t.strings().intention?.copy),In(3),ro(t.isWide?40:-1),In(),ro(t.model.type!=="timeseries"&&!t.isProbabilisticType()?41:-1),In(),ro(t.model.type==="timeseries"&&(t.model.tsEditAll||t.model.tsBulkMode)?42:t.model.type==="timeseries"&&!t.model.tsBulkMode?43:t.isProbabilisticType()?-1:44),In(5),ro(t.isReadonly?-1:47);}},dependencies:[mb,jn,Pn,He$1,rn,On,xn,ot$1,Gt,Tt,Pt,tn,Jt,zt,jt,Vt,Nt,Ut,qe$1,q,H,xt$1,Ve,Be,Lt,Rt,q$1,we,te,aY,iY,_A,yt$1,wt$1,ae,se,Qt,gt$1,Q$1],styles:[".full-width[_ngcontent-%COMP%]{width:100%}.info-text[_ngcontent-%COMP%]{opacity:.5;font-size:12px;margin-bottom:8px}.hide-sm[_ngcontent-%COMP%]{display:inline}@media(max-width:959px){.hide-sm[_ngcontent-%COMP%]{display:none}}"],changeDetection:1})}return a})();export{ci as KeyNewOrSetDialogComponent};