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
177 lines (165 loc) • 160 kB
JavaScript
import{a as X}from"./chunk-PYE27J5F.js";import{a as Wt}from"./chunk-JTYQ6EUS.js";import{a as Ut}from"./chunk-BLYHBMDZ.js";import{a as zt}from"./chunk-FGIK2URP.js";import{a as Z,b as Qe}from"./chunk-YNMELUG5.js";import{a as Ge}from"./chunk-N6B7O7YA.js";import{a as Je}from"./chunk-PVS3PBYN.js";import{a as ot}from"./chunk-LXPFV7MW.js";import{a as $t,b as Ht,c as qt}from"./chunk-2H2JFAKN.js";import{a as Le}from"./chunk-YPZ33LVT.js";import{a as je,b as Ae,c as Oe}from"./chunk-BN33DLGQ.js";import{a as Re,b as Pe}from"./chunk-SQBBDTZO.js";import{a as Jt,c as Nt}from"./chunk-EPMRI4P6.js";import"./chunk-KLZILXP3.js";import{d as Lt}from"./chunk-CYCQOADG.js";import"./chunk-DCOXSL4B.js";import"./chunk-IDORGLM3.js";import{a as Bt,b as H}from"./chunk-VQDF6UGR.js";import{b as St}from"./chunk-OTFMRDKW.js";import{a as At,b as Ot}from"./chunk-W7VPRHTK.js";import"./chunk-YBLUFXNR.js";import{a as Ue,c as z}from"./chunk-3QQZQR3D.js";import{e as $}from"./chunk-TEXSADK3.js";import{a as N,b as W}from"./chunk-AN7C4JCR.js";import{a as Pt,b as jt,c as Ve,d as Ie}from"./chunk-5ONGW7JF.js";import{a as De,c as Dt,i as we,j as Se}from"./chunk-AN3YSLKY.js";import"./chunk-6J2GCUHA.js";import{b as Te,f as me,j as de,l as Be,v as U}from"./chunk-ICUC3WIE.js";import{a as Rt}from"./chunk-YA4NX3C4.js";import{b as L,c as J}from"./chunk-VMTBY4VN.js";import{b as G,c as Q}from"./chunk-HFDIHHHN.js";import{c as Ft}from"./chunk-7JNYLOAK.js";import{$a as P,Ab as vt,Bb as p,Cb as h,Da as g,Db as ie,Dd as Mt,Eb as Ce,Hb as E,Ia as D,Ib as K,Ja as xt,Jb as M,Jc as O,Ka as yt,Lb as nt,Ld as se,Ma as Y,Na as $e,Nd as ce,Od as pe,Pd as q,Qb as kt,Rd as R,U as st,V as ct,Wa as Me,X as pt,Xa as y,Y as mt,Ya as f,Z as tt,Zb as B,_a as ft,ab as j,ac as qe,ba as d,bb as b,bd as Tt,ca as u,cb as o,cd as Vt,da as it,db as l,ea as dt,eb as T,fb as ve,gb as Fe,gd as It,hb as ht,hd as Et,ib as He,ja as ut,jb as C,jd as Kt,ka as _t,lb as _,lc as wt,mb as Ct,nb as s,oa as ze,oc as A,pa as te,ra as gt,rb as ke,sb as xe,tb as ye,xa as c,xb as bt,yb as re,zb as le}from"./chunk-KQUCMSSK.js";import{a as fi}from"./chunk-SJB4WMV2.js";import"./chunk-FCVD6SGJ.js";import{a as Ee,b as Ke,g as et,h as w}from"./chunk-O7S4L63H.js";var hi=["determinateSpinner"];function Ci(n,r){if(n&1&&(it(),o(0,"svg",11),T(1,"circle",12),l()),n&2){let e=s();Me("viewBox",e._viewBox()),c(),re("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),Me("r",e._circleRadius())}}var bi=new pt("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:Gt})}),Gt=100,vi=10,Qt=(()=>{class n{_elementRef=tt(gt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=tt(bi),i=Mt(),t=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=t.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&t.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=Gt;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-vi)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=D({type:n,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,t){if(i&1&&ke(hi,5),i&2){let a;xe(a=ye())&&(t._determinateCircle=a.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,t){i&2&&(Me("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",t.mode==="determinate"?t.value:null)("mode",t.mode),vt("mat-"+t.color),re("width",t.diameter,"px")("height",t.diameter,"px")("--mat-progress-spinner-size",t.diameter+"px")("--mat-progress-spinner-active-indicator-width",t.diameter+"px"),le("_mat-animation-noopable",t._noopAnimations)("mdc-circular-progress--indeterminate",t.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",qe],diameter:[2,"diameter","diameter",qe],strokeWidth:[2,"strokeWidth","strokeWidth",qe]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,t){if(i&1&&($e(0,Ci,2,8,"ng-template",null,0,kt),o(2,"div",2,1),it(),o(4,"svg",3),T(5,"circle",4),l()(),dt(),o(6,"div",5)(7,"div",6)(8,"div",7),He(9,8),l(),o(10,"div",9),He(11,8),l(),o(12,"div",10),He(13,8),l()()()),i&2){let a=bt(1);c(4),Me("viewBox",t._viewBox()),c(),re("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeDashOffset(),"px")("stroke-width",t._circleStrokeWidth(),"%"),Me("r",t._circleRadius()),c(4),b("ngTemplateOutlet",a),c(2),b("ngTemplateOutlet",a),c(2),b("ngTemplateOutlet",a)}},dependencies:[wt],styles:[`.mat-mdc-progress-spinner {
--mat-progress-spinner-animation-multiplier: 1;
display: block;
overflow: hidden;
line-height: 0;
position: relative;
direction: ltr;
transition: opacity 250ms cubic-bezier(0.4, 0, 0.6, 1);
}
.mat-mdc-progress-spinner circle {
stroke-width: var(--mat-progress-spinner-active-indicator-width, 4px);
}
.mat-mdc-progress-spinner._mat-animation-noopable, .mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle {
transition: none !important;
}
.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,
.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,
.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container {
animation: none !important;
}
.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle {
stroke-dasharray: 0 !important;
}
@media (forced-colors: active) {
.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,
.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle {
stroke: currentColor;
stroke: CanvasText;
}
}
.mat-progress-spinner-reduced-motion {
--mat-progress-spinner-animation-multiplier: 1.25;
}
.mdc-circular-progress__determinate-container,
.mdc-circular-progress__indeterminate-circle-graphic,
.mdc-circular-progress__indeterminate-container,
.mdc-circular-progress__spinner-layer {
position: absolute;
width: 100%;
height: 100%;
}
.mdc-circular-progress__determinate-container {
transform: rotate(-90deg);
}
.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container {
opacity: 0;
}
.mdc-circular-progress__indeterminate-container {
font-size: 0;
letter-spacing: 0;
white-space: nowrap;
opacity: 0;
}
.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container {
opacity: 1;
animation: mdc-circular-progress-container-rotate calc(1568.2352941176ms * var(--mat-progress-spinner-animation-multiplier)) linear infinite;
}
.mdc-circular-progress__determinate-circle-graphic,
.mdc-circular-progress__indeterminate-circle-graphic {
fill: transparent;
}
.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,
.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic {
stroke: var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary));
}
@media (forced-colors: active) {
.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,
.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic {
stroke: CanvasText;
}
}
.mdc-circular-progress__determinate-circle {
transition: stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);
}
.mdc-circular-progress__gap-patch {
position: absolute;
top: 0;
left: 47.5%;
box-sizing: border-box;
width: 5%;
height: 100%;
overflow: hidden;
}
.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic {
left: -900%;
width: 2000%;
transform: rotate(180deg);
}
.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic {
width: 200%;
}
.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic {
left: -100%;
}
.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic {
animation: mdc-circular-progress-left-spin calc(1333ms * var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic {
animation: mdc-circular-progress-right-spin calc(1333ms * var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.mdc-circular-progress__circle-clipper {
display: inline-flex;
position: relative;
width: 50%;
height: 100%;
overflow: hidden;
}
.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer {
animation: mdc-circular-progress-spinner-layer-rotate calc(5332ms * var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
@keyframes mdc-circular-progress-container-rotate {
to {
transform: rotate(360deg);
}
}
@keyframes mdc-circular-progress-spinner-layer-rotate {
12.5% {
transform: rotate(135deg);
}
25% {
transform: rotate(270deg);
}
37.5% {
transform: rotate(405deg);
}
50% {
transform: rotate(540deg);
}
62.5% {
transform: rotate(675deg);
}
75% {
transform: rotate(810deg);
}
87.5% {
transform: rotate(945deg);
}
100% {
transform: rotate(1080deg);
}
}
@keyframes mdc-circular-progress-left-spin {
from {
transform: rotate(265deg);
}
50% {
transform: rotate(130deg);
}
to {
transform: rotate(265deg);
}
}
@keyframes mdc-circular-progress-right-spin {
from {
transform: rotate(-265deg);
}
50% {
transform: rotate(-130deg);
}
to {
transform: rotate(-265deg);
}
}
`],encapsulation:2,changeDetection:0})}return n})();var Zt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=xt({type:n});static \u0275inj=ct({imports:[Tt]})}return n})();var Ze=(()=>{class n{dialog;constructor(e){this.dialog=e}show(e){return w(this,null,function*(){let{TtlDialogComponent:i}=yield import("./chunk-2KUXGLA5.js"),t=this.dialog.open(i,Rt({data:{model:e.model}}));return new Promise((a,m)=>{t.afterClosed().subscribe(x=>{x?a(x):m()})})})}static \u0275fac=function(i){return new(i||n)(mt(Ft))};static \u0275prov=st({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Xt(n){let r=n instanceof Uint8Array?n:new Uint8Array(n);if(r.length<4)return{ext:"bin",mime:"application/octet-stream"};if(r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71)return{ext:"png",mime:"image/png"};if(r[0]===255&&r[1]===216&&r[2]===255)return{ext:"jpg",mime:"image/jpeg"};if(r[0]===71&&r[1]===73&&r[2]===70&&r[3]===56)return{ext:"gif",mime:"image/gif"};if(r[0]===66&&r[1]===77)return{ext:"bmp",mime:"image/bmp"};if(r[0]===82&&r[1]===73&&r[2]===70&&r[3]===70&&r.length>=12&&r[8]===87&&r[9]===69&&r[10]===66&&r[11]===80)return{ext:"webp",mime:"image/webp"};if(r[0]===73&&r[1]===73&&r[2]===42&&r[3]===0||r[0]===77&&r[1]===77&&r[2]===0&&r[3]===42)return{ext:"tiff",mime:"image/tiff"};if(r[0]===0&&r[1]===0&&r[2]===1&&r[3]===0)return{ext:"ico",mime:"image/x-icon"};if(r[0]===37&&r[1]===80&&r[2]===68&&r[3]===70)return{ext:"pdf",mime:"application/pdf"};if(r[0]===80&&r[1]===75&&r[2]===3&&r[3]===4)return{ext:"zip",mime:"application/zip"};if(r[0]===31&&r[1]===139)return{ext:"gz",mime:"application/gzip"};if(r[0]===66&&r[1]===90&&r[2]===104)return{ext:"bz2",mime:"application/x-bzip2"};if(r[0]===253&&r[1]===55&&r[2]===122&&r[3]===88&&r.length>=6&&r[4]===90&&r[5]===0)return{ext:"xz",mime:"application/x-xz"};if(r[0]===40&&r[1]===181&&r[2]===47&&r[3]===253)return{ext:"zst",mime:"application/zstd"};if(r[0]===4&&r[1]===34&&r[2]===77&&r[3]===24)return{ext:"lz4",mime:"application/x-lz4"};if(r[0]===55&&r[1]===122&&r[2]===188&&r[3]===175&&r.length>=6&&r[4]===39&&r[5]===28)return{ext:"7z",mime:"application/x-7z-compressed"};if(r[0]===82&&r[1]===97&&r[2]===114&&r[3]===33)return{ext:"rar",mime:"application/x-rar-compressed"};if(r[0]===82&&r[1]===73&&r[2]===70&&r[3]===70&&r.length>=12&&r[8]===87&&r[9]===65&&r[10]===86&&r[11]===69)return{ext:"wav",mime:"audio/wav"};if(r[0]===82&&r[1]===73&&r[2]===70&&r[3]===70&&r.length>=12&&r[8]===65&&r[9]===86&&r[10]===73&&r[11]===32)return{ext:"avi",mime:"video/x-msvideo"};if(r[0]===255&&(r[1]===251||r[1]===243||r[1]===242)||r[0]===73&&r[1]===68&&r[2]===51)return{ext:"mp3",mime:"audio/mpeg"};if(r[0]===102&&r[1]===76&&r[2]===97&&r[3]===67)return{ext:"flac",mime:"audio/flac"};if(r[0]===79&&r[1]===103&&r[2]===103&&r[3]===83)return{ext:"ogg",mime:"audio/ogg"};if(r[0]===26&&r[1]===69&&r[2]===223&&r[3]===163)return{ext:"webm",mime:"video/webm"};if(r.length>=8&&r[4]===102&&r[5]===116&&r[6]===121&&r[7]===112)return{ext:"mp4",mime:"video/mp4"};if(r[0]===0&&r[1]===97&&r[2]===115&&r[3]===109)return{ext:"wasm",mime:"application/wasm"};if(r[0]===127&&r[1]===69&&r[2]===76&&r[3]===70)return{ext:"elf",mime:"application/x-elf"};if(r.length>=6&&r[0]===83&&r[1]===81&&r[2]===76&&r[3]===105&&r[4]===116&&r[5]===101)return{ext:"sqlite",mime:"application/x-sqlite3"};if(r[0]===56&&r[1]===66&&r[2]===80&&r[3]===83)return{ext:"psd",mime:"image/vnd.adobe.photoshop"};let e=wi(r);return e||{ext:"bin",mime:"application/octet-stream"}}function wi(n){let r=n[0];if(r===123||r===91)return{ext:"json",mime:"application/json"};if(r===60){let e=new TextDecoder("utf-8",{fatal:!1}).decode(n.slice(0,Math.min(n.length,256))).toLowerCase();if(e.includes("<svg"))return{ext:"svg",mime:"image/svg+xml"};if(e.includes("<!doctype html")||e.includes("<html"))return{ext:"html",mime:"text/html"};if(e.includes("<?xml"))return{ext:"xml",mime:"application/xml"}}if(n[0]===239&&n[1]===187&&n[2]===191){if(n.length>3){if(n[3]===123||n[3]===91)return{ext:"json",mime:"application/json"};if(n[3]===60)return{ext:"xml",mime:"application/xml"}}return{ext:"txt",mime:"text/plain"}}return null}var ee=(()=>{class n{i18n;socket;common;jsonViewDialog;keyNewOrSetDialog;breakpointObserver;cmd;cdr;redisState;settingsService;p3xrResponse;p3xrValue;p3xrValueBuffer;p3xrKey="";isGtSm=window.innerWidth>=960;valueFormat="raw";unsubFns=[];constructor(e,i,t,a,m,x,v,k,S,V){this.i18n=e,this.socket=i,this.common=t,this.jsonViewDialog=a,this.keyNewOrSetDialog=m,this.breakpointObserver=x,this.cmd=v,this.cdr=k,this.redisState=S,this.settingsService=V;let F=this.breakpointObserver.observe("(min-width: 960px)").subscribe(I=>{this.isGtSm=I.matches,this.cdr.markForCheck()});this.unsubFns.push(()=>F.unsubscribe())}destroyBase(){this.unsubFns.forEach(e=>e())}get strings(){return this.i18n.strings()}get isReadonly(){return this.redisState.connection()?.readonly===!0}get maxValueDisplay(){return this.settingsService.maxValueDisplay()??1024}get maxValueAsBuffer(){return this.settingsService.maxValueAsBuffer}copy(e){return w(this,null,function*(){yield this.settingsService.clipboard(e),this.common.toast(this.strings?.status?.dataCopied)})}downloadBuffer(e,i){let t=e instanceof Uint8Array?e:new Uint8Array(e),{ext:a,mime:m}=Xt(t),x=new Blob([t],{type:m}),v=URL.createObjectURL(x),k=document.createElement("a");k.href=v,k.download=`${i||this.p3xrKey}.${a}`,k.click(),URL.revokeObjectURL(v)}showJson(e,i){return w(this,null,function*(){try{yield this.jsonViewDialog.show({value:e,$event:i})}catch(t){}})}refreshKey(){this.cmd.refreshKey$.next()}gtag(e){try{typeof window.gtag=="function"&&window.gtag("config",this.settingsService.googleAnalytics,{page_path:e})}catch(i){}}truncateDisplay(e){if(e==null)return"";let i=String(e);return this.maxValueDisplay<=0?i:i.length>this.maxValueDisplay?i.substring(0,this.maxValueDisplay):i}isTruncated(e){return e==null||this.maxValueDisplay<=0?!1:String(e).length>this.maxValueDisplay}formatValue(e){if(e==null)return"";let i=String(e);switch(this.valueFormat){case"json":try{return JSON.stringify(JSON.parse(i),null,2)}catch(t){return i}case"base64":{let t=new TextEncoder().encode(i),a="";for(let m=0;m<t.length;m++)a+=String.fromCharCode(t[m]);return btoa(a)}default:return i}}isBufferValue(e){return typeof e=="object"&&e!==null&&e.byteLength!==void 0}prettyBytes(e){return this.settingsService.prettyBytes(e)??`${e} bytes`}static \u0275fac=function(i){return new(i||n)(g(R),g(z),g($),g(Z),g(X),g(O),g(H),g(B),g(W),g(N))};static \u0275dir=yt({type:n,inputs:{p3xrResponse:"p3xrResponse",p3xrValue:"p3xrValue",p3xrValueBuffer:"p3xrValueBuffer",p3xrKey:"p3xrKey",valueFormat:"valueFormat"}})}return n})();var Si=["hexContent"],Ti=["hexScrollbar"],Vi=(n,r)=>r.addr;function Ii(n,r){if(n&1&&(ve(0,"div",4)(1,"span",7),p(2),Fe(),ve(3,"span",8),p(4),ve(5,"span",9),p(6),Fe()(),ve(7,"span",10),p(8),ve(9,"span",9),p(10),Fe()()()),n&2){let e=r.$implicit;c(2),h(e.addr),c(2),h(e.hexReal),c(2),h(e.hexPad),c(2),h(e.asciiReal),c(2),h(e.asciiPad)}}var ue=(()=>{class n{cdr;lines=[];contentScrollWidth=0;truncated=!1;contentRef;scrollbarRef;_value="";resizeObs=null;viewReady=!1;constructor(e){this.cdr=e}set value(e){this._value=e??"",this.lines=n.parseHexLines(this._value),this.viewReady&&requestAnimationFrame(()=>this.measure())}get value(){return this._value}ngAfterViewInit(){this.viewReady=!0,this.measure(),this.resizeObs=new ResizeObserver(()=>{this.measure(),this.cdr.detectChanges()}),this.contentRef?.nativeElement&&this.resizeObs.observe(this.contentRef.nativeElement)}ngOnDestroy(){this.resizeObs?.disconnect()}syncScroll(){this.contentRef?.nativeElement&&this.scrollbarRef?.nativeElement&&(this.contentRef.nativeElement.scrollLeft=this.scrollbarRef.nativeElement.scrollLeft)}measure(){let e=this.contentRef?.nativeElement;e&&(this.contentScrollWidth=e.scrollWidth)}static parseHexLines(e){if(!e)return[];let i=new TextEncoder().encode(e),t=[];for(let a=0;a<i.length;a+=16){let m=i.slice(a,a+16),x=m.length,v=a.toString(16).padStart(8,"0"),k=new Uint8Array(16);k.set(m);let S=Array.from(k.slice(0,8)).map(I=>I.toString(16).padStart(2,"0")).join(" "),V=Array.from(k.slice(8)).map(I=>I.toString(16).padStart(2,"0")).join(" "),F=S+" "+V;if(x===16){let I=Array.from(k).map(ne=>ne>=32&&ne<=126?String.fromCharCode(ne):".").join("");t.push({addr:v,hexReal:F,hexPad:"",asciiReal:I,asciiPad:""})}else{let I=x<=8?3*x-1:25+3*(x-8)-1,ne=Array.from(k).map(Ne=>Ne>=32&&Ne<=126?String.fromCharCode(Ne):".").join("");t.push({addr:v,hexReal:F.substring(0,I),hexPad:F.substring(I),asciiReal:ne.substring(0,x),asciiPad:ne.substring(x)})}}return t}static \u0275fac=function(i){return new(i||n)(g(B))};static \u0275cmp=D({type:n,selectors:[["p3xr-hex-monitor"]],viewQuery:function(i,t){if(i&1&&ke(Si,5)(Ti,5),i&2){let a;xe(a=ye())&&(t.contentRef=a.first),xe(a=ye())&&(t.scrollbarRef=a.first)}},inputs:{truncated:"truncated",value:"value"},decls:8,vars:2,consts:[["hexContent",""],["hexScrollbar",""],[2,"font-family","'Roboto Mono', monospace","font-size","16px","line-height","22px"],[2,"overflow","hidden"],[2,"display","flex","white-space","nowrap"],[2,"overflow-x","auto","overflow-y","hidden","position","sticky","bottom","0",3,"scroll"],[2,"height","1px"],[2,"opacity","0.5","padding-right","12px","flex-shrink","0"],[2,"padding-right","12px","flex-shrink","0","white-space","pre"],[2,"opacity","0.5"],[2,"border-left","1px solid var(--p3xr-fieldset-border, rgba(255,255,255,0.25))","padding-left","12px","flex-shrink","0"]],template:function(i,t){i&1&&(ve(0,"div",2)(1,"div",3,0),P(3,Ii,11,5,"div",4,Vi),Fe(),ve(5,"div",5,1),Ct("scroll",function(){return t.syncScroll()}),ht(7,"div",6),Fe()()),i&2&&(c(3),j(t.lines),c(4),re("width",t.contentScrollWidth,"px"))},styles:[`:host{display:block}
`],encapsulation:2})}return n})();var Yt=n=>({maxValueAsBuffer:n});function Ei(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(3);return u(t.setBufferUpload())}),o(1,"mat-icon"),p(2,"upload"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(3);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.setBuffer)}}function Ki(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(3);return u(t.setBufferUpload())}),o(1,"mat-icon"),p(2,"upload"),l()()}if(n&2){let e=s(3);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.setBuffer)??"Upload")}}function Mi(n,r){if(n&1&&y(0,Ei,5,1,"button",6)(1,Ki,3,1,"button",7),n&2){let e=s(2);f(e.isGtSm?0:1)}}function Fi(n,r){if(n&1){let e=C();o(0,"button",10),_("click",function(){d(e);let t=s(2);return u(t.downloadBufferFile())}),o(1,"mat-icon"),p(2,"download"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(2);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.downloadBuffer)}}function Di(n,r){if(n&1){let e=C();o(0,"button",11),_("click",function(){d(e);let t=s(2);return u(t.downloadBufferFile())}),o(1,"mat-icon"),p(2,"download"),l()()}if(n&2){let e=s(2);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.downloadBuffer)??"Download")}}function Bi(n,r){if(n&1){let e=C();o(0,"button",10),_("click",function(t){d(e);let a=s(2);return u(a.jsonViewer(t))}),o(1,"mat-icon"),p(2,"account_tree"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(2);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.jsonViewShow)}}function Ri(n,r){if(n&1){let e=C();o(0,"button",11),_("click",function(t){d(e);let a=s(2);return u(a.jsonViewer(t))}),o(1,"mat-icon"),p(2,"account_tree"),l()()}if(n&2){let e=s(2);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.jsonViewShow)??"JSON")}}function Pi(n,r){if(n&1){let e=C();o(0,"button",10),_("click",function(){d(e);let t=s(2);return u(t.copyValue())}),o(1,"mat-icon"),p(2,"content_copy"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(2);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.copy)}}function ji(n,r){if(n&1){let e=C();o(0,"button",11),_("click",function(){d(e);let t=s(2);return u(t.copyValue())}),o(1,"mat-icon"),p(2,"content_copy"),l()()}if(n&2){let e=s(2);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.copy)??"Copy")}}function Ai(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(3);return u(t.formatJson())}),o(1,"mat-icon"),p(2,"format_line_spacing"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(3);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.formatJson)}}function Oi(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(3);return u(t.formatJson())}),o(1,"mat-icon"),p(2,"format_line_spacing"),l()()}if(n&2){let e=s(3);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.formatJson)??"Format JSON")}}function Li(n,r){if(n&1&&y(0,Ai,5,1,"button",6)(1,Oi,3,1,"button",7),n&2){let e=s(2);f(e.isGtSm?0:1)}}function Ji(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(2);return u(t.jsonEditor())}),o(1,"mat-icon"),p(2,"description"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(2);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.jsonViewEditor)}}function Ni(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(2);return u(t.jsonEditor())}),o(1,"mat-icon"),p(2,"description"),l()()}if(n&2){let e=s(2);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.jsonViewEditor)??"JSON Editor")}}function Wi(n,r){if(n&1){let e=C();o(0,"button",10),_("click",function(){d(e);let t=s(3);return u(t.showDigest())}),o(1,"mat-icon"),p(2,"numbers"),l(),o(3,"span"),p(4,"Digest"),l()()}}function zi(n,r){if(n&1){let e=C();o(0,"button",13),_("click",function(){d(e);let t=s(3);return u(t.showDigest())}),o(1,"mat-icon"),p(2,"numbers"),l()()}}function $i(n,r){if(n&1&&y(0,Wi,5,0,"button",4)(1,zi,3,0,"button",12),n&2){let e=s(2);f(e.isGtSm?0:1)}}function Hi(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(3);return u(t.edit())}),o(1,"mat-icon"),p(2,"edit"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(3);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.edit)}}function qi(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(3);return u(t.edit())}),o(1,"mat-icon"),p(2,"edit"),l()()}if(n&2){let e=s(3);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.edit)??"Edit")}}function Ui(n,r){if(n&1&&y(0,Hi,5,1,"button",6)(1,qi,3,1,"button",7),n&2){let e=s(2);f(e.isGtSm?0:1)}}function Gi(n,r){if(n&1&&(o(0,"div",0),y(1,Mi,2,1),y(2,Fi,5,1,"button",4)(3,Di,3,1,"button",5),y(4,Bi,5,1,"button",4)(5,Ri,3,1,"button",5),y(6,Pi,5,1,"button",4)(7,ji,3,1,"button",5),y(8,Li,2,1),y(9,Ji,5,1,"button",6)(10,Ni,3,1,"button",7),y(11,$i,2,1),y(12,Ui,2,1),l()),n&2){let e=s();c(),f(e.isReadonly?-1:1),c(),f(e.isGtSm?2:3),c(2),f(e.isGtSm?4:5),c(2),f(e.isGtSm?6:7),c(2),f(e.isReadonly?-1:8),c(),f(e.isGtSm?9:10),c(2),f(e.redisState.redisVersion().isAtLeast(8,4)?11:-1),c(),f(e.isReadonly?-1:12)}}function Qi(n,r){if(n&1){let e=C();o(0,"mat-slide-toggle",17),M("ngModelChange",function(t){d(e);let a=s(2);return K(a.validateJson,t)||(a.validateJson=t),u(t)}),p(1),l()}if(n&2){let e=s(2);E("ngModel",e.validateJson),c(),ie(" ",e.strings==null||e.strings.label==null?null:e.strings.label.validateJson," ")}}function Zi(n,r){if(n&1){let e=C();o(0,"button",18),_("click",function(){d(e);let t=s(2);return u(t.cancelEdit())}),o(1,"mat-icon"),p(2,"cancel"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(2);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.cancel)}}function Xi(n,r){if(n&1){let e=C();o(0,"button",19),_("click",function(){d(e);let t=s(2);return u(t.cancelEdit())}),o(1,"mat-icon"),p(2,"cancel"),l()()}if(n&2){let e=s(2);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.cancel)??"Cancel")}}function Yi(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(3);return u(t.setBufferUpload())}),o(1,"mat-icon"),p(2,"upload"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(3);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.setBuffer)}}function en(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(3);return u(t.setBufferUpload())}),o(1,"mat-icon"),p(2,"upload"),l()()}if(n&2){let e=s(3);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.setBuffer)??"Upload")}}function tn(n,r){if(n&1&&y(0,Yi,5,1,"button",6)(1,en,3,1,"button",7),n&2){let e=s(2);f(e.isGtSm?0:1)}}function nn(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(){d(e);let t=s(3);return u(t.save())}),o(1,"mat-icon"),p(2,"save"),l(),o(3,"span"),p(4),l()()}if(n&2){let e=s(3);c(4),h(e.strings==null||e.strings.intention==null?null:e.strings.intention.save)}}function on(n,r){if(n&1){let e=C();o(0,"button",9),_("click",function(){d(e);let t=s(3);return u(t.save())}),o(1,"mat-icon"),p(2,"save"),l()()}if(n&2){let e=s(3);b("matTooltip",(e.strings==null||e.strings.intention==null?null:e.strings.intention.save)??"Save")}}function rn(n,r){if(n&1&&y(0,nn,5,1,"button",6)(1,on,3,1,"button",7),n&2){let e=s(2);f(e.isGtSm?0:1)}}function an(n,r){if(n&1&&(o(0,"div",0),y(1,Qi,2,2,"mat-slide-toggle",14),y(2,Zi,5,1,"button",15)(3,Xi,3,1,"button",16),y(4,tn,2,1),y(5,rn,2,1),l()),n&2){let e=s();c(),f(e.isReadonly?-1:1),c(),f(e.isGtSm?2:3),c(2),f(e.isReadonly?-1:4),c(),f(e.isReadonly?-1:5)}}function ln(n,r){if(n&1&&(o(0,"div",20),p(1),l()),n&2){let e=s(2);c(),Ce(" ",e.strings==null||e.strings.label==null||e.strings.label.isBuffer==null?null:e.strings.label.isBuffer(nt(2,Yt,e.prettyBytes(e.maxValueAsBuffer)))," ",e.bufferDisplay()," ")}}function sn(n,r){if(n&1){let e=C();o(0,"div",20),p(1),l(),o(2,"textarea",22),M("ngModelChange",function(t){d(e);let a=s(2);return K(a.p3xrValueBuffer,t)||(a.p3xrValueBuffer=t),u(t)}),l()}if(n&2){let e=s(2);c(),Ce(" ",e.strings==null||e.strings.label==null||e.strings.label.isBuffer==null?null:e.strings.label.isBuffer(nt(3,Yt,e.prettyBytes(e.maxValueAsBuffer)))," ",e.bufferDisplay()," "),c(),E("ngModel",e.p3xrValueBuffer)}}function cn(n,r){if(n&1){let e=C();o(0,"textarea",22),M("ngModelChange",function(t){d(e);let a=s(2);return K(a.p3xrValue,t)||(a.p3xrValue=t),u(t)}),l()}if(n&2){let e=s(2);E("ngModel",e.p3xrValue)}}function pn(n,r){if(n&1&&(o(0,"mat-form-field",2),y(1,ln,2,4,"div",20),y(2,sn,3,5)(3,cn,1,1,"textarea",21),l()),n&2){let e=s();c(),f(e.p3xrValue&&e.p3xrValue.toString()==="[object ArrayBuffer]"?1:-1),c(),f(e.buffer?2:3)}}function mn(n,r){if(n&1&&T(0,"p3xr-hex-monitor",24),n&2){let e=s(2);b("value",e.truncateDisplay(e.p3xrValue))("truncated",e.isTruncated(e.p3xrValue))}}function dn(n,r){n&1&&(o(0,"span",26),p(1,"..."),l())}function un(n,r){if(n&1&&(o(0,"span",25),p(1),y(2,dn,2,0,"span",26),l()),n&2){let e=s(2);c(),h(e.truncateDisplay(e.formatValue(e.p3xrValue))),c(),f(e.isTruncated(e.p3xrValue)?2:-1)}}function _n(n,r){if(n&1){let e=C();o(0,"div",23),_("click",function(){d(e);let t=s();return u(t.edit())}),y(1,mn,1,2,"p3xr-hex-monitor",24)(2,un,3,2,"span",25),l()}if(n&2){let e=s();re("overflow",e.valueFormat==="hex"?"visible":"auto"),c(),f(e.valueFormat==="hex"?1:2)}}var ei=(()=>{class n extends ee{jsonEditorDialog;overlay;diffDialog;editable=!1;buffer=!1;validateJson=!1;originalValue;constructor(e,i,t,a,m,x,v,k,S,V,F,I,ne){super(e,i,t,a,m,x,v,S,V,F),this.jsonEditorDialog=k,this.overlay=I,this.diffDialog=ne}ngOnInit(){}showDigest(){return w(this,null,function*(){try{let e=yield this.socket.request({action:"key/string-digest",payload:{key:this.p3xrKey}});this.common.toast(e.digest||"No digest")}catch(e){this.common.generalHandleError(e)}})}edit(){let e=this.p3xrValue;typeof e=="string"&&e.length>=this.maxValueAsBuffer?(this.buffer=!0,this.originalValue=structuredClone(this.p3xrValueBuffer)):(this.buffer=!1,this.originalValue=structuredClone(this.p3xrValue)),this.editable=!0}cancelEdit(){this.buffer?this.p3xrValueBuffer=this.originalValue:this.p3xrValue=this.originalValue,this.editable=!1,this.buffer=!1}save(){return w(this,null,function*(){let e=this.buffer?this.p3xrValueBuffer:this.p3xrValue,i=this.originalValue;try{if(this.validateJson&&JSON.parse(e),i!==void 0&&!(yield this.diffDialog.show({keyName:this.p3xrKey,oldValue:i,newValue:e})))return;this.overlay.show({message:this.strings?.intention?.save??"Saving..."}),yield this.socket.request({action:"key/set",payload:{type:this.p3xrResponse?.type,key:this.p3xrKey,value:e}}),this.gtag("/key-set"),this.editable=!1,this.buffer=!1,this.refreshKey(),this.overlay.hide(),this.settingsService.undoEnabled()&&i!==void 0&&i!==e&&(yield this.common.toastWithUndo(this.strings?.status?.saved))&&(this.overlay.show({message:"Undo..."}),yield this.socket.request({action:"key/set",payload:{type:this.p3xrResponse?.type,key:this.p3xrKey,value:i}}),this.refreshKey(),this.overlay.hide(),this.common.toast(this.strings?.status?.reverted))}catch(t){this.common.generalHandleError(t),this.overlay.hide()}})}setBufferUpload(){return w(this,null,function*(){let e=document.createElement("input");e.type="file",e.onchange=()=>w(this,null,function*(){let i=e.files?.[0];if(!i)return;let t=new FileReader;t.onerror=a=>{this.common.generalHandleError(a)},t.onload=a=>w(this,null,function*(){let m=a.target.result;try{if(this.editable){yield this.common.confirm({message:this.i18n.strings().confirm?.uploadBuffer}),this.buffer?this.p3xrValueBuffer=m:this.p3xrValue=m,this.common.toast(this.i18n.strings().confirm?.uploadBufferDone);return}yield this.common.confirm({message:this.i18n.strings().confirm?.uploadBuffer}),this.overlay.show(),yield this.socket.request({action:"key/set",payload:{type:this.p3xrResponse?.type,value:m,key:this.p3xrKey}}),this.common.toast(this.i18n.strings().confirm?.uploadBufferDoneAndSave),this.gtag("/key-set"),this.refreshKey()}catch(x){this.common.generalHandleError(x)}finally{this.overlay.hide()}}),t.readAsArrayBuffer(i)}),e.click()})}jsonViewer(e){return w(this,null,function*(){yield this.showJson(this.p3xrValue,e)})}jsonEditor(){return w(this,null,function*(){try{let e=this.p3xrValue,i=yield this.jsonEditorDialog.show({value:this.p3xrValue});this.originalValue=void 0,this.overlay.show({message:this.strings?.intention?.save??"Saving..."}),yield this.socket.request({action:"key/set",payload:{type:this.p3xrResponse?.type,key:this.p3xrKey,value:i.obj}}),this.p3xrValue=i.obj,this.editable=!1,this.buffer=!1,this.refreshKey(),this.overlay.hide(),this.settingsService.undoEnabled()&&e!==void 0&&e!==i.obj&&(yield this.common.toastWithUndo(this.strings?.status?.saved))&&(this.overlay.show({message:"Undo..."}),yield this.socket.request({action:"key/set",payload:{type:this.p3xrResponse?.type,key:this.p3xrKey,value:e}}),this.refreshKey(),this.overlay.hide(),this.common.toast(this.strings?.status?.reverted))}catch(e){}})}formatJson(){return w(this,null,function*(){try{this.p3xrValue=JSON.stringify(JSON.parse(this.p3xrValue),null,this.settingsService.jsonFormat()??2),yield this.save()}catch(e){this.common.toast(this.strings?.label?.jsonViewNotParsable??"Not valid JSON")}})}copyValue(){this.copy(this.p3xrValue)}downloadBufferFile(){this.downloadBuffer(this.p3xrValueBuffer)}bufferDisplay(){return this.p3xrValueBuffer?.byteLength!==void 0?"("+this.prettyBytes(this.p3xrValueBuffer.byteLength)+")":""}static \u0275fac=function(i){return new(i||n)(g(R),g(z),g($),g(Z),g(X),g(O),g(H),g(Qe),g(B),g(W),g(N),g(Ue),g(Ge))};static \u0275cmp=D({type:n,selectors:[["p3xr-key-string"]],features:[Y],decls:5,vars:3,consts:[[1,"p3xr-key-type-actions"],[1,"p3xr-key-type-content"],["appearance","fill",1,"p3xr-key-type-editor"],[1,"p3xr-key-type-display",2,"cursor","pointer","max-width","100%",3,"overflow"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-accent",3,"matTooltip"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-primary",3,"matTooltip"],["mat-raised-button","","type","button",1,"btn-primary","p3xr-action-btn",3,"click"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-primary",3,"click","matTooltip"],["mat-raised-button","","type","button",1,"btn-accent","p3xr-action-btn",3,"click"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-accent",3,"click","matTooltip"],["mat-mini-fab","","type","button","matTooltip","Digest","matTooltipPosition","above",1,"btn-accent"],["mat-mini-fab","","type","button","matTooltip","Digest","matTooltipPosition","above",1,"btn-accent",3,"click"],[1,"btn-accent",2,"margin-right","8px",3,"ngModel"],["mat-raised-button","","type","button",1,"btn-warn","p3xr-action-btn"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-warn",3,"matTooltip"],[1,"btn-accent",2,"margin-right","8px",3,"ngModelChange","ngModel"],["mat-raised-button","","type","button",1,"btn-warn","p3xr-action-btn",3,"click"],["mat-mini-fab","","type","button","matTooltipPosition","above",1,"btn-warn",3,"click","matTooltip"],[1,"p3xr-key-type-buffer-info"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4",3,"ngModel"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","4",3,"ngModelChange","ngModel"],[1,"p3xr-key-type-display",2,"cursor","pointer","max-width","100%",3,"click"],[3,"value","truncated"],[1,"p3xr-pre",2,"word-break","break-all","white-space","pre-wrap"],[2,"opacity","0.5"]],template:function(i,t){i&1&&(y(0,Gi,13,8,"div",0),y(1,an,6,4,"div",0),o(2,"div",1),y(3,pn,4,2,"mat-form-field",2)(4,_n,3,3,"div",3),l()),i&2&&(f(t.editable?-1:0),c(),f(t.editable?1:-1),c(2),f(t.editable?3:4))},dependencies:[A,U,Te,me,de,q,ce,pe,Q,G,J,L,Ot,At,Ie,Ve,we,Pt,Se,jt,ue],encapsulation:2})}return n})();var ae=class{page=1;pages=1;zsetMode;settingsService;constructor(r){this.zsetMode=r?.zsetMode??!1,this.settingsService=r?.settingsService}figurePaging(r){let e=this.settingsService?.keyPageCount()??50,i=this.zsetMode?Math.ceil(r/2):r;this.pages=Math.max(Math.ceil(i/e),1),this.page>this.pages?this.page=this.pages:this.page<1&&(this.page=1)}get pageCount(){return this.settingsService?.keyPageCount()??50}get startIndex(){return this.pageCount*(this.page-1)}get endIndex(){return this.startIndex+this.pageCount}pager(r){switch(r){case"first":this.page=1;break;case"prev":this.page>1&&this.page--;break;case"next":this.page<this.pages&&this.page++;break;case"last":this.page=this.pages;break}}pageChange(){this.page<1&&(this.page=1),this.page>this.pages&&(this.page=this.pages)}};function gn(n,r){if(n&1){let e=C();o(0,"div",0)(1,"button",1),_("click",function(){d(e);let t=s();return t.paging.pager("first"),u(t.pageChanged.emit())}),o(2,"span",2),p(3,"skip_previous"),l()(),o(4,"button",1),_("click",function(){d(e);let t=s();return t.paging.pager("prev"),u(t.pageChanged.emit())}),o(5,"span",2),p(6,"keyboard_arrow_left"),l()(),o(7,"p3xr-ng-input",3),_("ngModelChange",function(t){d(e);let a=s();return u(a.onPageChange(t))}),l(),o(8,"span",4),p(9),l(),o(10,"button",1),_("click",function(){d(e);let t=s();return t.paging.pager("next"),u(t.pageChanged.emit())}),o(11,"span",2),p(12,"keyboard_arrow_right"),l()(),o(13,"button",1),_("click",function(){d(e);let t=s();return t.paging.pager("last"),u(t.pageChanged.emit())}),o(14,"span",2),p(15,"skip_next"),l()()()}if(n&2){let e=s();c(),b("matTooltip",(e.strings==null||e.strings.page==null||e.strings.page.treeControls==null||e.strings.page.treeControls.pager==null?null:e.strings.page.treeControls.pager.first)??"First"),c(3),b("matTooltip",(e.strings==null||e.strings.page==null||e.strings.page.treeControls==null||e.strings.page.treeControls.pager==null?null:e.strings.page.treeControls.pager.prev)??"Previous"),c(3),b("max",""+e.paging.pages)("ngModel",e.paging.page),c(2),ie("/ ",e.paging.pages),c(),b("matTooltip",(e.strings==null||e.strings.page==null||e.strings.page.treeControls==null||e.strings.page.treeControls.pager==null?null:e.strings.page.treeControls.pager.next)??"Next"),c(3),b("matTooltip",(e.strings==null||e.strings.page==null||e.strings.page.treeControls==null||e.strings.page.treeControls.pager==null?null:e.strings.page.treeControls.pager.last)??"Last")}}var _e=(()=>{class n{i18n;paging;pageChanged=new ut;constructor(e){this.i18n=e}get strings(){return this.i18n.strings()}onPageChange(e){this.paging.page=e,this.paging.pageChange(),this.pageChanged.emit()}static \u0275fac=function(i){return new(i||n)(g(R))};static \u0275cmp=D({type:n,selectors:[["p3xr-key-pager-inline"]],inputs:{paging:"paging"},outputs:{pageChanged:"pageChanged"},decls:1,vars:1,consts:[[1,"p3xr-key-pager-inline"],["type","button",1,"p3xr-key-pager-btn",3,"click","matTooltip"],[1,"material-icons"],["type","number","step","1","min","1",1,"p3xr-key-pager-input",3,"ngModelChange","max","ngModel"],[1,"p3xr-key-pager-text"]],template:function(i,t){i&1&&y(0,gn,16,7,"div",0),i&2&&f(t.paging.pages>1?0:-1)},dependencies:[A,U,me,de,J,L,Wt],styles:[".p3xr-key-pager-inline[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:4px 0}.p3xr-key-pager-btn[_ngcontent-%COMP%]{background:none;border:none;color:var(--p3xr-input-border-color, var(--p3xr-border-color));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;height:28px;width:28px;margin:0;padding:0}.p3xr-key-pager-btn[_ngcontent-%COMP%]:focus{outline:none}.p3xr-key-pager-btn[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:24px}[_nghost-%COMP%] p3xr-ng-input.p3xr-key-pager-input{vertical-align:middle!important;width:64px;margin:0 4px}.p3xr-key-pager-text[_ngcontent-%COMP%]{margin:0 4px;color:var(--p3xr-input-color, inherit)}"]})}return n})();var ti=et(Ut());var xn=(n,r)=>r.key;function yn(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(t){d(e);let a=s();return u(a.addHash(t))}),o(1,"mat-icon"),p(2,"add"),l()()}}function fn(n,r){if(n&1&&T(0,"p3xr-hex-monitor",11),n&2){let e=s().$implicit,i=s();b("value",i.truncateDisplay(e.value))("truncated",i.isTruncated(e.value))}}function hn(n,r){n&1&&(o(0,"span",19),p(1,"..."),l())}function Cn(n,r){if(n&1&&(p(0),y(1,hn,2,0,"span",19)),n&2){let e=s().$implicit,i=s();h(i.truncateDisplay(i.formatValue(e.value))),c(),f(i.isTruncated(e.value)?1:-1)}}function bn(n,r){if(n&1){let e=C();o(0,"mat-icon",20),_("click",function(t){d(e);let a=s().$implicit,m=s();return u(m.setFieldTtl(a.key,t))}),p(1,"schedule"),l()}if(n&2){let e=s().$implicit,i=s();re("color",i.getFieldTtlColor(e.key)||null)("opacity",i.hasFieldTtl(e.key)?.7:.3),le("p3xr-tree-ttl-pulse",i.isFieldTtlPulsing(e.key)),b("matTooltip",i.hasFieldTtl(e.key)?"TTL: "+i.formatFieldTtl(e.key):i.strings==null||i.strings.intention==null?null:i.strings.intention.ttl)}}function vn(n,r){if(n&1){let e=C();o(0,"mat-icon",21),_("click",function(t){d(e);let a=s().$implicit,m=s();return u(m.deleteHashKey(a.key,t))}),p(1,"delete"),l()}}function kn(n,r){if(n&1){let e=C();o(0,"mat-icon",22),_("click",function(t){d(e);let a=s().$implicit,m=s();return u(m.editValue(a.key,a.value,t))}),p(1,"edit"),l()}}function wn(n,r){if(n&1){let e=C();o(0,"div",7)(1,"span",9),_("click",function(t){let a=d(e).$implicit,m=s();return u(m.editValue(a.key,a.value,t))}),p(2),l(),o(3,"span",10),_("click",function(t){let a=d(e).$implicit,m=s();return u(m.editValue(a.key,a.value,t))}),y(4,fn,1,2,"p3xr-hex-monitor",11)(5,Cn,2,2),l(),o(6,"span",12),y(7,bn,2,7,"mat-icon",13),y(8,vn,2,0,"mat-icon",14),o(9,"mat-icon",15),_("click",function(t){let a=d(e).$implicit,m=s();return u(m.showJsonItem(a.value,t))}),p(10,"account_tree"),l(),o(11,"mat-icon",16),_("click",function(){let t=d(e).$implicit,a=s();return u(a.copyItem(t.value))}),p(12,"content_copy"),l(),o(13,"mat-icon",17),_("click",function(){let t=d(e).$implicit,a=s();return u(a.downloadItem(t.key))}),p(14,"download"),l(),y(15,kn,2,0,"mat-icon",18),l()()}if(n&2){let e=r.$implicit,i=s();c(2),h(e.key),c(),le("p3xr-pre",i.valueFormat!=="hex"),c(),f(i.valueFormat==="hex"?4:5),c(3),f(!i.isReadonly&&i.redisState.redisVersion().isAtLeast(8,0)?7:-1),c(),f(i.isReadonly?-1:8),c(7),f(i.isReadonly?-1:15)}}var ii=(()=>{class n extends ee{ttlDialog;paging;pagedItems=[];fieldTtls={};fieldTtlsFetchedAt=0;ttlCountdownInterval=null;constructor(e,i,t,a,m,x,v,k,S,V,F){super(e,i,t,a,m,x,v,k,S,V),this.ttlDialog=F,this.paging=new ae({settingsService:V})}ngOnInit(){this.updatePaging(),this.loadFieldTtls()}ngOnChanges(e){e.p3xrValue&&(this.updatePaging(),this.loadFieldTtls())}updatePaging(){this.p3xrValue&&(this.paging.figurePaging(Object.keys(this.p3xrValue).length),this.updatePagedItems())}updatePagedItems(){if(!this.p3xrValue){this.pagedItems=[];return}let e=Object.keys(this.p3xrValue);this.pagedItems=e.slice(this.paging.startIndex,this.paging.endIndex).map(i=>({key:i,value:this.p3xrValue[i]}))}addHash(e){return w(this,null,function*(){try{yield this.keyNewOrSetDialog.show({$event:e,type:"append",model:{type:"hash",key:this.p3xrKey}}),this.refreshKey()}catch(i){this.common.generalHandleError(i)}})}deleteHashKey(e,i){return w(this,null,function*(){try{yield this.common.confirm({message:this.i18n.strings().confirm?.deleteHashKey}),yield this.socket.request({action:"key/hash-delete-field",payload:{key:this.p3xrKey,hashKey:e}}),this.common.toast(this.i18n.strings().status?.deletedHashKey),this.refreshKey()}catch(t){this.common.generalHandleError(t)}})}editValue(e,i,t){return w(this,null,function*(){try{let a=typeof i=="string"&&i.length>=this.maxValueAsBuffer?this.p3xrValueBuffer[e]:i;yield this.keyNewOrSetDialog.show({$event:t,type:"edit",model:{type:"hash",key:this.p3xrKey,hashKey:e,value:a}}),this.refreshKey()}catch(a){this.common.generalHandleError(a)}})}ngOnDestroy(){this.clearTtlCountdown()}clearTtlCountdown(){this.ttlCountdownInterval&&(clearInterval(this.ttlCountdownInterval),this.ttlCountdownInterval=null)}startTtlCountdown(){this.clearTtlCountdown(),Object.values(this.fieldTtls).some(i=>i>0)&&(this.ttlCountdownInterval=setInterval(()=>{if(Object.keys(this.fieldTtls).some(t=>{let a=this.fieldTtls[t];if(!a||a<=0)return!1;let m=Math.floor((Date.now()-this.fieldTtlsFetchedAt)/1e3);return a-m<=0})){this.clearTtlCountdown(),this.refreshKey();return}this.cdr.markForCheck()},1e3))}getRemainingFieldTtl(e){let i=this.fieldTtls[e];if(!i||i<=0)return-1;let t=Math.floor((Date.now()-this.fieldTtlsFetchedAt)/1e3),a=i-t;return a>0?a:-1}loadFieldTtls(){return w(this,null,function*(){if(!(!this.redisState.redisVersion().isAtLeast(8,0)||!this.pagedItems.length))try{let e=this.pagedItems.map(t=>t.key);if(e.length===0)return;let i=yield this.socket.request({action:"hash-field/ttls",payload:{key:this.p3xrKey,fields:e}});this.fieldTtls=i.fieldTtls||{},this.fieldTtlsFetchedAt=Date.now(),this.startTtlCountdown(),this.cdr.markForCheck()}catch(e){this.fieldTtls={}}})}getFieldTtlColor(e){let i=this.getRemainingFieldTtl(e);return i<=0?"":i<300?"var(--mat-sys-error, #f44336)":i<3600?"var(--mat-sys-tertiary, #ff9800)":"#4caf50"}isFieldTtlPulsing(e){let i=this.getRemainingFieldTtl(e);return i>0&&i<30}hasFieldTtl(e){return this.getRemainingFieldTtl(e)>0}formatFieldTtl(e){let i=this.getRemainingFieldTtl(e);if(i<=0)return"";let t=this.settingsService.getHumanizeDurationOptions();return(0,ti.default)(i*1e3,Ke(Ee({},t),{largest:2,round:!0,delimiter:" "}))}setFieldTtl(e,i){return w(this,null,function*(){try{let a=(yield this.socket.request({action:"hash-field/ttl-get",payload:{key:this.p3xrKey,field:e}})).ttl??-1,m=yield this.ttlDialog.show({$event:i,model:{ttl:a}});yield this.socket.request({action:"hash-field/ttl",payload:{key:this.p3xrKey,field:e,ttl:m.model.ttl}}),this.common.toast(`${e}: TTL ${m.model.ttl===-1?"removed":m.model.ttl+"s"}`),this.loadFieldTtls()}catch(t){t!==void 0&&this.common.generalHandleError(t)}})}copyItem(e){this.copy(e)}showJsonItem(e,i){this.showJson(e,i)}downloadItem(e){this.downloadBuffer(this.p3xrValueBuffer[e],`${this.p3xrKey}-${e}`)}static \u0275fac=function(i){return new(i||n)(g(R),g(z),g($),g(Z),g(X),g(O),g(H),g(B),g(W),g(N),g(Ze))};static \u0275cmp=D({type:n,selectors:[["p3xr-key-hash"]],features:[Y,te],decls:11,vars:4,consts:[[3,"pageChanged","paging"],[1,"p3xr-key-type-table"],[1,"p3xr-key-type-header"],[2,"flex","20%"],[2,"flex","60%"],[2,"flex","20%","text-align","right"],["mat-icon-button","","matTooltip","Add"],[1,"p3xr-key-type-row"],["mat-icon-button","","matTooltip","Add",3,"click"],[1,"p3xr-key-col",2,"flex","20%","cursor","pointer",3,"click"],[1,"p3xr-value-col",2,"flex","60%","cursor","pointer",3,"click"],[3,"value","truncated"],[1,"p3xr-key-type-row-actions",2,"flex","20%","text-align","right"],[3,"color","opacity","p3xr-tree-ttl-pulse","matTooltip"],["matTooltip","Delete",1,"icon-warn"],["matTooltip","JSON",1,"icon-accent",3,"click"],["matTooltip","Copy",1,"icon-accent",3,"click"],["matTooltip","Download",1,"icon-accent",3,"click"],["matTooltip","Edit",1,"icon-primary"],[2,"opacity","0.5"],[3,"click","matTooltip"],["matTooltip","Delete",1,"icon-warn",3,"click"],["matTooltip","Edit",1,"icon-primary",3,"click"]],template:function(i,t){i&1&&(o(0,"p3xr-key-pager-inline",0),_("pageChanged",function(){return t.updatePagedItems(),t.loadFieldTtls()}),l(),o(1,"div",1)(2,"div",2)(3,"span",3),p(4),l(),o(5,"span",4),p(6),l(),o(7,"span",5),y(8,yn,3,0,"button",6),l()(),P(9,wn,16,7,"div",7,xn),l()),i&2&&(b("paging",t.paging),c(4),h(t.strings==null||t.strings.page==null||t.strings.page.key==null||t.strings.page.key.hash==null||t.strings.page.key.hash.table==null?null:t.strings.page.key.hash.table.hashkey),c(2),h(t.strings==null||t.strings.page==null||t.strings.page.key==null||t.strings.page.key.hash==null||t.strings.page.key.hash.table==null?null:t.strings.page.key.hash.table.value),c(2),f(t.isReadonly?-1:8),c(),j(t.pagedItems))},dependencies:[A,U,q,se,Q,G,J,L,_e,ue],encapsulation:2})}return n})();var Sn=(n,r)=>r.index;function Tn(n,r){if(n&1){let e=C();o(0,"button",8),_("click",function(t){d(e);let a=s();return u(a.appendValue(t))}),o(1,"mat-icon"),p(2,"add"),l()()}}function Vn(n,r){if(n&1&&T(0,"p3xr-hex-monitor",11),n&2){let e=s().$implicit,i=s();b("value",i.truncateDisplay(e.value))("truncated",i.isTruncated(e.value))}}function In(n,r){n&1&&(o(0,"span",18),p(1,"..."),l())}function En(n,r){if(n&1&&(p(0),y(1,In,2,0,"span",18)),n&2){let e=s().$implicit,i=s();h(i.truncateDisplay(i.formatValue(e.value))),c(),f(i.isTruncated(e.value)?1:-1)}}function Kn(n,r){if(n&1){let e=C();o(0,"mat-icon",19),_("click",function(t){d(e);let a=s().$implicit,m=s();return u(m.deleteListE