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 {h as h$1}from'./chunk-DzgS_tEU.js';import {Y,S}from'./chunk-BAYRo-WK.js';import {b3 as sr$1,X as Xe,V as N,K as op,f as fQ,b as bi$1,G as It,P,b8 as T,b5 as b,ca as J,L as uc,Q,F as x,_ as _e,N as h,O as A,S as F$1,a8 as y,T as p,a9 as q,cb as uA,ar as re,as as ee,aW as tn$1,aa as Z,b7 as _t,ae as Q$1,cc as OM,aH as Of,bq as cv,B as Ba,b2 as Cm,h as hv,v as vf,cd as xm,ce as gv,aY as rS,c as In$1,aI as Ei$1,q as oc,p as pv,a_ as wf,o as mt,a$ as rc,b0 as Df,b1 as Ef,aC as Re,cf as Qe,H as HT,cg as Je,ch as _v,ci as et,U as UT,m as mb,aJ as jn$1,cj as He,bd as On$1,be as tn$2,e as aY,aK as iY,aL as sY,y as yt,w as wt,i as Qt,j as gt,ck as Ve,cl as Be,ba as qe,cm as ve,bc as Ut,cn as X,c4 as Be$1,n as no$1,r as ro$1,g as _A,aG as Dn$1,k as bv,I as IS,R as Rv,co as rn$1,bm as cp,bn as R0,bo as B0,bp as j0,cp as q$1,cq as H,bb as q$2,Y as Yt$1,W as Wt$1,Z as Zt$1,u as u$1,a as f,aM as lt,x as YT,cr as Lv,bj as Mx,bt as VT,cs as Fv,bk as Nx,aN as Ov,J as JT,t as If,aO as kS,ct as VS,z as fm,A as pm,cu as AS}from'./chunk-BwlFOdbx.js';import {u,y as y$1,w}from'./chunk-4F4EzhXh.js';import {W as Wt}from'./chunk-Dqaenx7A.js';import {O as Ot,b as bt,n as nt}from'./chunk-CgnEdgcL.js';import {X as X$1}from'./chunk-DeaQoucA.js';import {L as Lt,R as Rt}from'./chunk-ClozYWD6.js';import {w as we,t as te}from'./chunk-B8YlgrW9.js';import'./chunk-BqyDblvT.js';import {L,F,E,K,C}from'./main-HNF44SV3.js';var bi=["determinateSpinner"];function ki(i,r){if(i&1&&(Cm(),Ba(0,"svg",11),hv(1,"circle",12),vf()),i&2){let e=JT();Ei$1("viewBox",e._viewBox()),In$1(),oc("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),Ei$1("r",e._circleRadius());}}var wi=new y("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:Zt})}),Zt=100,Si=10,Xt=(()=>{class i{_elementRef=p(q);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e;}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=p(wi),n=uA(),t=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=t.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="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=Zt;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0;}_strokeWidth;_circleRadius(){return (this.diameter-Si)/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(n){return new(n||i)};static \u0275cmp=_e({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,t){if(n&1&&rc(bi,5),n&2){let s;Df(s=Ef())&&(t._determinateCircle=s.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,t){n&2&&(Ei$1("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",t.mode==="determinate"?t.value:null)("mode",t.mode),wf("mat-"+t.color),oc("width",t.diameter,"px")("height",t.diameter,"px")("--mat-progress-spinner-size",t.diameter+"px")("--mat-progress-spinner-active-indicator-width",t.diameter+"px"),mt("_mat-animation-noopable",t._noopAnimations)("mdc-circular-progress--indeterminate",t.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",Of],diameter:[2,"diameter","diameter",Of],strokeWidth:[2,"strokeWidth","strokeWidth",Of]},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(n,t){if(n&1&&(cv(0,ki,2,8,"ng-template",null,0,VS),Ba(2,"div",2,1),Cm(),Ba(4,"svg",3),hv(5,"circle",4),vf()(),xm(),Ba(6,"div",5)(7,"div",6)(8,"div",7),gv(9,8),vf(),Ba(10,"div",9),gv(11,8),vf(),Ba(12,"div",10),gv(13,8),vf()()()),n&2){let s=rS(1);In$1(4),Ei$1("viewBox",t._viewBox()),In$1(),oc("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeDashOffset(),"px")("stroke-width",t._circleStrokeWidth(),"%"),Ei$1("r",t._circleRadius()),In$1(4),pv("ngTemplateOutlet",s),In$1(2),pv("ngTemplateOutlet",s),In$1(2),pv("ngTemplateOutlet",s);}},dependencies:[OM],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})}return i})();var Yt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=re({type:i});static \u0275inj=ee({imports:[tn$1]})}return i})();var Ye=(()=>{class i{dialog;constructor(e){this.dialog=e;}show(e){return L(this,null,function*(){let{TtlDialogComponent:n}=yield import('./chunk-B7ZhWuZ8.js'),t=this.dialog.open(n,h({data:{model:e.model}}));return new Promise((s,p)=>{t.afterClosed().subscribe(C=>{C?s(C):p();});})})}static \u0275fac=function(n){return new(n||i)(A(Re))};static \u0275prov=F$1({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ei(i){let r=i instanceof Uint8Array?i:new Uint8Array(i);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=Vi(r);return e||{ext:"bin",mime:"application/octet-stream"}}function Vi(i){let r=i[0];if(r===123||r===91)return {ext:"json",mime:"application/json"};if(r===60){let e=new TextDecoder("utf-8",{fatal:false}).decode(i.slice(0,Math.min(i.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(i[0]===239&&i[1]===187&&i[2]===191){if(i.length>3){if(i[3]===123||i[3]===91)return {ext:"json",mime:"application/json"};if(i[3]===60)return {ext:"xml",mime:"application/xml"}}return {ext:"txt",mime:"text/plain"}}return null}var ie=(()=>{class i{i18n;socket;common;jsonViewDialog;keyNewOrSetDialog;breakpointObserver;cmd;cdr;redisState;settingsService;p3xrResponse;p3xrValue;p3xrValueBuffer;p3xrKey="";isGtSm=window.innerWidth>=960;valueFormat="raw";unsubFns=[];constructor(e,n,t,s,p,C,b,S,E,T){this.i18n=e,this.socket=n,this.common=t,this.jsonViewDialog=s,this.keyNewOrSetDialog=p,this.breakpointObserver=C,this.cmd=b,this.cdr=S,this.redisState=E,this.settingsService=T;let ee=this.breakpointObserver.observe("(min-width: 960px)").subscribe(M=>{this.isGtSm=M.matches,this.cdr.markForCheck();});this.unsubFns.push(()=>ee.unsubscribe());}destroyBase(){this.unsubFns.forEach(e=>e());}get strings(){return this.i18n.strings()}get isReadonly(){return this.redisState.connection()?.readonly===true}get maxValueDisplay(){return this.settingsService.maxValueDisplay()??1024}get maxValueAsBuffer(){return this.settingsService.maxValueAsBuffer}copy(e){return L(this,null,function*(){yield this.settingsService.clipboard(e),this.common.toast(this.strings?.status?.dataCopied);})}downloadBuffer(e,n){let t=e instanceof Uint8Array?e:new Uint8Array(e),{ext:s,mime:p}=ei(t),C=new Blob([t],{type:p}),b=URL.createObjectURL(C),S=document.createElement("a");S.href=b,S.download=`${n||this.p3xrKey}.${s}`,S.click(),URL.revokeObjectURL(b);}showJson(e,n){return L(this,null,function*(){try{yield this.jsonViewDialog.show({value:e,$event:n});}catch(t){}})}refreshKey(){this.cmd.refreshKey$.next();}gtag(e){try{typeof window.gtag=="function"&&window.gtag("config",this.settingsService.googleAnalytics,{page_path:e});}catch(n){}}truncateDisplay(e){if(e==null)return "";let n=String(e);return this.maxValueDisplay<=0?n:n.length>this.maxValueDisplay?n.substring(0,this.maxValueDisplay):n}isTruncated(e){return e==null||this.maxValueDisplay<=0?false:String(e).length>this.maxValueDisplay}formatValue(e){if(e==null)return "";let n=String(e);switch(this.valueFormat){case "json":try{return JSON.stringify(JSON.parse(n),null,2)}catch(t){return n}case "base64":{let t=new TextEncoder().encode(n),s="";for(let p=0;p<t.length;p++)s+=String.fromCharCode(t[p]);return btoa(s)}default:return n}}isBufferValue(e){return typeof e=="object"&&e!==null&&e.byteLength!==void 0}prettyBytes(e){return this.settingsService.prettyBytes(e)??`${e} bytes`}static \u0275fac=function(n){return new(n||i)(Xe(fQ),Xe(bi$1),Xe(It),Xe(u),Xe(h$1),Xe(op),Xe(P),Xe(uc),Xe(Q),Xe(x))};static \u0275dir=Z({type:i,inputs:{p3xrResponse:"p3xrResponse",p3xrValue:"p3xrValue",p3xrValueBuffer:"p3xrValueBuffer",p3xrKey:"p3xrKey",valueFormat:"valueFormat"}})}return i})();var Ii=["hexContent"],Ei=["hexScrollbar"],Ki=(i,r)=>r.addr;function Mi(i,r){if(i&1&&(Qe(0,"div",4)(1,"span",7),IS(2),Je(),Qe(3,"span",8),IS(4),Qe(5,"span",9),IS(6),Je()(),Qe(7,"span",10),IS(8),Qe(9,"span",9),IS(10),Je()()()),i&2){let e=r.$implicit;In$1(2),Rv(e.addr),In$1(2),Rv(e.hexReal),In$1(2),Rv(e.hexPad),In$1(2),Rv(e.asciiReal),In$1(2),Rv(e.asciiPad);}}var pe=(()=>{class i{cdr;lines=[];contentScrollWidth=0;truncated=false;contentRef;scrollbarRef;_value="";resizeObs=null;viewReady=false;constructor(e){this.cdr=e;}set value(e){this._value=e??"",this.lines=i.parseHexLines(this._value),this.viewReady&&requestAnimationFrame(()=>this.measure());}get value(){return this._value}ngAfterViewInit(){this.viewReady=true,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 n=new TextEncoder().encode(e),t=[];for(let s=0;s<n.length;s+=16){let p=n.slice(s,s+16),C=p.length,b=s.toString(16).padStart(8,"0"),S=new Uint8Array(16);S.set(p);let E=Array.from(S.slice(0,8)).map(M=>M.toString(16).padStart(2,"0")).join(" "),T=Array.from(S.slice(8)).map(M=>M.toString(16).padStart(2,"0")).join(" "),ee=E+" "+T;if(C===16){let M=Array.from(S).map(re=>re>=32&&re<=126?String.fromCharCode(re):".").join("");t.push({addr:b,hexReal:ee,hexPad:"",asciiReal:M,asciiPad:""});}else {let M=C<=8?3*C-1:25+3*(C-8)-1,re=Array.from(S).map(We=>We>=32&&We<=126?String.fromCharCode(We):".").join("");t.push({addr:b,hexReal:ee.substring(0,M),hexPad:ee.substring(M),asciiReal:re.substring(0,C),asciiPad:re.substring(C)});}}return t}static \u0275fac=function(n){return new(n||i)(Xe(uc))};static \u0275cmp=_e({type:i,selectors:[["p3xr-hex-monitor"]],viewQuery:function(n,t){if(n&1&&rc(Ii,5)(Ei,5),n&2){let s;Df(s=Ef())&&(t.contentRef=s.first),Df(s=Ef())&&(t.scrollbarRef=s.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(n,t){n&1&&(Qe(0,"div",2)(1,"div",3,0),HT(3,Mi,11,5,"div",4,Ki),Je(),Qe(5,"div",5,1),_v("scroll",function(){return t.syncScroll()}),et(7,"div",6),Je()()),n&2&&(In$1(3),UT(t.lines),In$1(4),oc("width",t.contentScrollWidth,"px"));},styles:[`:host{display:block}
`],encapsulation:2,changeDetection:1})}return i})();var ti=i=>({maxValueAsBuffer:i});function Di(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(3);return pm(t.setBufferUpload())}),Ba(1,"mat-icon"),IS(2,"upload"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(3);In$1(4),Rv(e.strings?.intention?.setBuffer);}}function Fi(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(3);return pm(t.setBufferUpload())}),Ba(1,"mat-icon"),IS(2,"upload"),vf()();}if(i&2){let e=JT(3);pv("matTooltip",e.strings?.intention?.setBuffer??"Upload");}}function Bi(i,r){if(i&1&&no$1(0,Di,5,1,"button",6)(1,Fi,3,1,"button",7),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function Pi(i,r){if(i&1){let e=YT();Ba(0,"button",10),bv("click",function(){fm(e);let t=JT(2);return pm(t.downloadBufferFile())}),Ba(1,"mat-icon"),IS(2,"download"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(2);In$1(4),Rv(e.strings?.intention?.downloadBuffer);}}function ji(i,r){if(i&1){let e=YT();Ba(0,"button",11),bv("click",function(){fm(e);let t=JT(2);return pm(t.downloadBufferFile())}),Ba(1,"mat-icon"),IS(2,"download"),vf()();}if(i&2){let e=JT(2);pv("matTooltip",e.strings?.intention?.downloadBuffer??"Download");}}function Ri(i,r){if(i&1){let e=YT();Ba(0,"button",10),bv("click",function(t){fm(e);let s=JT(2);return pm(s.jsonViewer(t))}),Ba(1,"mat-icon"),IS(2,"account_tree"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(2);In$1(4),Rv(e.strings?.intention?.jsonViewShow);}}function Ai(i,r){if(i&1){let e=YT();Ba(0,"button",11),bv("click",function(t){fm(e);let s=JT(2);return pm(s.jsonViewer(t))}),Ba(1,"mat-icon"),IS(2,"account_tree"),vf()();}if(i&2){let e=JT(2);pv("matTooltip",e.strings?.intention?.jsonViewShow??"JSON");}}function Oi(i,r){if(i&1){let e=YT();Ba(0,"button",10),bv("click",function(){fm(e);let t=JT(2);return pm(t.copyValue())}),Ba(1,"mat-icon"),IS(2,"content_copy"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(2);In$1(4),Rv(e.strings?.intention?.copy);}}function Li(i,r){if(i&1){let e=YT();Ba(0,"button",11),bv("click",function(){fm(e);let t=JT(2);return pm(t.copyValue())}),Ba(1,"mat-icon"),IS(2,"content_copy"),vf()();}if(i&2){let e=JT(2);pv("matTooltip",e.strings?.intention?.copy??"Copy");}}function Ji(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(3);return pm(t.formatJson())}),Ba(1,"mat-icon"),IS(2,"format_line_spacing"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(3);In$1(4),Rv(e.strings?.intention?.formatJson);}}function Ni(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(3);return pm(t.formatJson())}),Ba(1,"mat-icon"),IS(2,"format_line_spacing"),vf()();}if(i&2){let e=JT(3);pv("matTooltip",e.strings?.intention?.formatJson??"Format JSON");}}function $i(i,r){if(i&1&&no$1(0,Ji,5,1,"button",6)(1,Ni,3,1,"button",7),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function Wi(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(2);return pm(t.jsonEditor())}),Ba(1,"mat-icon"),IS(2,"description"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(2);In$1(4),Rv(e.strings?.intention?.jsonViewEditor);}}function Hi(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(2);return pm(t.jsonEditor())}),Ba(1,"mat-icon"),IS(2,"description"),vf()();}if(i&2){let e=JT(2);pv("matTooltip",e.strings?.intention?.jsonViewEditor??"JSON Editor");}}function zi(i,r){if(i&1){let e=YT();Ba(0,"button",10),bv("click",function(){fm(e);let t=JT(3);return pm(t.showDigest())}),Ba(1,"mat-icon"),IS(2,"numbers"),vf(),Ba(3,"span"),IS(4,"Digest"),vf()();}}function qi(i,r){if(i&1){let e=YT();Ba(0,"button",13),bv("click",function(){fm(e);let t=JT(3);return pm(t.showDigest())}),Ba(1,"mat-icon"),IS(2,"numbers"),vf()();}}function Ui(i,r){if(i&1&&no$1(0,zi,5,0,"button",4)(1,qi,3,0,"button",12),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function Gi(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(3);return pm(t.edit())}),Ba(1,"mat-icon"),IS(2,"edit"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(3);In$1(4),Rv(e.strings?.intention?.edit);}}function Qi(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(3);return pm(t.edit())}),Ba(1,"mat-icon"),IS(2,"edit"),vf()();}if(i&2){let e=JT(3);pv("matTooltip",e.strings?.intention?.edit??"Edit");}}function Zi(i,r){if(i&1&&no$1(0,Gi,5,1,"button",6)(1,Qi,3,1,"button",7),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function Xi(i,r){if(i&1&&(Ba(0,"div",0),no$1(1,Bi,2,1),no$1(2,Pi,5,1,"button",4)(3,ji,3,1,"button",5),no$1(4,Ri,5,1,"button",4)(5,Ai,3,1,"button",5),no$1(6,Oi,5,1,"button",4)(7,Li,3,1,"button",5),no$1(8,$i,2,1),no$1(9,Wi,5,1,"button",6)(10,Hi,3,1,"button",7),no$1(11,Ui,2,1),no$1(12,Zi,2,1),vf()),i&2){let e=JT();In$1(),ro$1(e.isReadonly?-1:1),In$1(),ro$1(e.isGtSm?2:3),In$1(2),ro$1(e.isGtSm?4:5),In$1(2),ro$1(e.isGtSm?6:7),In$1(2),ro$1(e.isReadonly?-1:8),In$1(),ro$1(e.isGtSm?9:10),In$1(2),ro$1(e.redisState.redisVersion().isAtLeast(8,4)?11:-1),In$1(),ro$1(e.isReadonly?-1:12);}}function Yi(i,r){if(i&1){let e=YT();Ba(0,"mat-slide-toggle",17),Lv("ngModelChange",function(t){fm(e);let s=JT(2);return AS(s.validateJson,t)||(s.validateJson=t),pm(t)}),IS(1),vf(),Mx();}if(i&2){let e=JT(2);Fv("ngModel",e.validateJson),Nx(),In$1(),If(" ",e.strings?.label?.validateJson," ");}}function en(i,r){if(i&1){let e=YT();Ba(0,"button",18),bv("click",function(){fm(e);let t=JT(2);return pm(t.cancelEdit())}),Ba(1,"mat-icon"),IS(2,"cancel"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(2);In$1(4),Rv(e.strings?.intention?.cancel);}}function tn(i,r){if(i&1){let e=YT();Ba(0,"button",19),bv("click",function(){fm(e);let t=JT(2);return pm(t.cancelEdit())}),Ba(1,"mat-icon"),IS(2,"cancel"),vf()();}if(i&2){let e=JT(2);pv("matTooltip",e.strings?.intention?.cancel??"Cancel");}}function nn(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(3);return pm(t.setBufferUpload())}),Ba(1,"mat-icon"),IS(2,"upload"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(3);In$1(4),Rv(e.strings?.intention?.setBuffer);}}function on(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(3);return pm(t.setBufferUpload())}),Ba(1,"mat-icon"),IS(2,"upload"),vf()();}if(i&2){let e=JT(3);pv("matTooltip",e.strings?.intention?.setBuffer??"Upload");}}function rn(i,r){if(i&1&&no$1(0,nn,5,1,"button",6)(1,on,3,1,"button",7),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function an(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(){fm(e);let t=JT(3);return pm(t.save())}),Ba(1,"mat-icon"),IS(2,"save"),vf(),Ba(3,"span"),IS(4),vf()();}if(i&2){let e=JT(3);In$1(4),Rv(e.strings?.intention?.save);}}function sn(i,r){if(i&1){let e=YT();Ba(0,"button",9),bv("click",function(){fm(e);let t=JT(3);return pm(t.save())}),Ba(1,"mat-icon"),IS(2,"save"),vf()();}if(i&2){let e=JT(3);pv("matTooltip",e.strings?.intention?.save??"Save");}}function ln(i,r){if(i&1&&no$1(0,an,5,1,"button",6)(1,sn,3,1,"button",7),i&2){let e=JT(2);ro$1(e.isGtSm?0:1);}}function cn(i,r){if(i&1&&(Ba(0,"div",0),no$1(1,Yi,2,2,"mat-slide-toggle",14),no$1(2,en,5,1,"button",15)(3,tn,3,1,"button",16),no$1(4,rn,2,1),no$1(5,ln,2,1),vf()),i&2){let e=JT();In$1(),ro$1(e.isReadonly?-1:1),In$1(),ro$1(e.isGtSm?2:3),In$1(2),ro$1(e.isReadonly?-1:4),In$1(),ro$1(e.isReadonly?-1:5);}}function mn(i,r){if(i&1&&(Ba(0,"div",20),IS(1),vf()),i&2){let e=JT(2);In$1(),Ov(" ",e.strings?.label?.isBuffer?.(kS(2,ti,e.prettyBytes(e.maxValueAsBuffer)))," ",e.bufferDisplay()," ");}}function pn(i,r){if(i&1){let e=YT();Ba(0,"div",20),IS(1),vf(),Ba(2,"textarea",22),Lv("ngModelChange",function(t){fm(e);let s=JT(2);return AS(s.p3xrValueBuffer,t)||(s.p3xrValueBuffer=t),pm(t)}),vf(),Mx();}if(i&2){let e=JT(2);In$1(),Ov(" ",e.strings?.label?.isBuffer?.(kS(3,ti,e.prettyBytes(e.maxValueAsBuffer)))," ",e.bufferDisplay()," "),In$1(),Fv("ngModel",e.p3xrValueBuffer),Nx();}}function dn(i,r){if(i&1){let e=YT();Ba(0,"textarea",22),Lv("ngModelChange",function(t){fm(e);let s=JT(2);return AS(s.p3xrValue,t)||(s.p3xrValue=t),pm(t)}),vf(),Mx();}if(i&2){let e=JT(2);Fv("ngModel",e.p3xrValue),Nx();}}function un(i,r){if(i&1&&(Ba(0,"mat-form-field",2),no$1(1,mn,2,4,"div",20),no$1(2,pn,3,5)(3,dn,1,1,"textarea",21),vf()),i&2){let e=JT();In$1(),ro$1(e.p3xrValue&&e.p3xrValue.toString()==="[object ArrayBuffer]"?1:-1),In$1(),ro$1(e.buffer?2:3);}}function _n(i,r){if(i&1&&hv(0,"p3xr-hex-monitor",24),i&2){let e=JT(2);pv("value",e.truncateDisplay(e.p3xrValue))("truncated",e.isTruncated(e.p3xrValue));}}function xn(i,r){i&1&&(Ba(0,"span",26),IS(1,"..."),vf());}function gn(i,r){if(i&1&&(Ba(0,"span",25),IS(1),no$1(2,xn,2,0,"span",26),vf()),i&2){let e=JT(2);In$1(),Rv(e.truncateDisplay(e.formatValue(e.p3xrValue))),In$1(),ro$1(e.isTruncated(e.p3xrValue)?2:-1);}}function fn(i,r){if(i&1){let e=YT();Ba(0,"div",23),bv("click",function(){fm(e);let t=JT();return pm(t.edit())}),no$1(1,_n,1,2,"p3xr-hex-monitor",24)(2,gn,3,2,"span",25),vf();}if(i&2){let e=JT();oc("overflow",e.valueFormat==="hex"?"visible":"auto"),In$1(),ro$1(e.valueFormat==="hex"?1:2);}}var ii=(()=>{class i extends ie{jsonEditorDialog;overlay;diffDialog;editable=false;buffer=false;validateJson=false;originalValue;constructor(e,n,t,s,p,C,b,S,E,T,ee,M,re){super(e,n,t,s,p,C,b,E,T,ee),this.jsonEditorDialog=S,this.overlay=M,this.diffDialog=re;}ngOnInit(){}showDigest(){return L(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=true,this.originalValue=structuredClone(this.p3xrValueBuffer)):(this.buffer=false,this.originalValue=structuredClone(this.p3xrValue)),this.editable=true;}cancelEdit(){this.buffer?this.p3xrValueBuffer=this.originalValue:this.p3xrValue=this.originalValue,this.editable=false,this.buffer=false;}save(){return L(this,null,function*(){let e=this.buffer?this.p3xrValueBuffer:this.p3xrValue,n=this.originalValue;try{if(this.validateJson&&JSON.parse(e),n!==void 0&&!(yield this.diffDialog.show({keyName:this.p3xrKey,oldValue:n,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()&&n!==void 0&&n!==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:n}}),this.refreshKey(),this.overlay.hide(),this.common.toast(this.strings?.status?.reverted));}catch(t){this.common.generalHandleError(t),this.overlay.hide();}})}setBufferUpload(){return L(this,null,function*(){let e=document.createElement("input");e.type="file",e.onchange=()=>L(this,null,function*(){let n=e.files?.[0];if(!n)return;let t=new FileReader;t.onerror=s=>{this.common.generalHandleError(s);},t.onload=s=>L(this,null,function*(){let p=s.target.result;try{if(this.editable){yield this.common.confirm({message:this.i18n.strings().confirm?.uploadBuffer}),this.buffer?this.p3xrValueBuffer=p:this.p3xrValue=p,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:p,key:this.p3xrKey}}),this.common.toast(this.i18n.strings().confirm?.uploadBufferDoneAndSave),this.gtag("/key-set"),this.refreshKey();}catch(C){this.common.generalHandleError(C);}finally{this.overlay.hide();}}),t.readAsArrayBuffer(n);}),e.click();})}jsonViewer(e){return L(this,null,function*(){yield this.showJson(this.p3xrValue,e);})}jsonEditor(){return L(this,null,function*(){try{let e=this.p3xrValue,n=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:n.obj}}),this.p3xrValue=n.obj,this.editable=!1,this.buffer=!1,this.refreshKey(),this.overlay.hide(),this.settingsService.undoEnabled()&&e!==void 0&&e!==n.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 L(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(n){return new(n||i)(Xe(fQ),Xe(bi$1),Xe(It),Xe(u),Xe(h$1),Xe(op),Xe(P),Xe(y$1),Xe(uc),Xe(Q),Xe(x),Xe(_t),Xe(w))};static \u0275cmp=_e({type:i,selectors:[["p3xr-key-string"]],features:[Be$1],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(n,t){n&1&&(no$1(0,Xi,13,8,"div",0),no$1(1,cn,6,4,"div",0),Ba(2,"div",1),no$1(3,un,4,2,"mat-form-field",2)(4,fn,3,3,"div",3),vf()),n&2&&(ro$1(t.editable?-1:0),In$1(),ro$1(t.editable?1:-1),In$1(2),ro$1(t.editable?3:4));},dependencies:[mb,jn$1,He,On$1,tn$2,aY,iY,sY,yt,wt,Qt,gt,we,te,Ve,Be,qe,ve,Ut,X,pe],encapsulation:2,changeDetection:1})}return i})();var se=class{page=1;pages=1;zsetMode;settingsService;constructor(r){this.zsetMode=r?.zsetMode??false,this.settingsService=r?.settingsService;}figurePaging(r){let e=this.settingsService?.keyPageCount()??50,n=this.zsetMode?Math.ceil(r/2):r;this.pages=Math.max(Math.ceil(n/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 yn(i,r){if(i&1){let e=YT();Ba(0,"div",0)(1,"button",1),bv("click",function(){fm(e);let t=JT();return t.paging.pager("first"),pm(t.pageChanged.emit())}),Ba(2,"span",2),IS(3,"skip_previous"),vf()(),Ba(4,"button",1),bv("click",function(){fm(e);let t=JT();return t.paging.pager("prev"),pm(t.pageChanged.emit())}),Ba(5,"span",2),IS(6,"keyboard_arrow_left"),vf()(),Ba(7,"p3xr-ng-input",3),bv("ngModelChange",function(t){fm(e);let s=JT();return pm(s.onPageChange(t))}),vf(),Mx(),Ba(8,"span",4),IS(9),vf(),Ba(10,"button",1),bv("click",function(){fm(e);let t=JT();return t.paging.pager("next"),pm(t.pageChanged.emit())}),Ba(11,"span",2),IS(12,"keyboard_arrow_right"),vf()(),Ba(13,"button",1),bv("click",function(){fm(e);let t=JT();return t.paging.pager("last"),pm(t.pageChanged.emit())}),Ba(14,"span",2),IS(15,"skip_next"),vf()()();}if(i&2){let e=JT();In$1(),pv("matTooltip",e.strings?.page?.treeControls?.pager?.first??"First"),In$1(3),pv("matTooltip",e.strings?.page?.treeControls?.pager?.prev??"Previous"),In$1(3),pv("max",""+e.paging.pages)("ngModel",e.paging.page),Nx(),In$1(2),If("/ ",e.paging.pages),In$1(),pv("matTooltip",e.strings?.page?.treeControls?.pager?.next??"Next"),In$1(3),pv("matTooltip",e.strings?.page?.treeControls?.pager?.last??"Last");}}var de=(()=>{class i{i18n;paging;pageChanged=new Q$1;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(n){return new(n||i)(Xe(fQ))};static \u0275cmp=_e({type:i,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(n,t){n&1&&no$1(0,yn,16,7,"div",0),n&2&&ro$1(t.paging.pages>1?0:-1);},dependencies:[mb,jn$1,On$1,tn$2,Qt,gt,S],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)}"],changeDetection:1})}return i})();var ni=K(Y());var hn=(i,r)=>r.key;function Cn(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(t){fm(e);let s=JT();return pm(s.addHash(t))}),Ba(1,"mat-icon"),IS(2,"add"),vf()();}}function vn(i,r){if(i&1&&hv(0,"p3xr-hex-monitor",11),i&2){let e=JT().$implicit,n=JT();pv("value",n.truncateDisplay(e.value))("truncated",n.isTruncated(e.value));}}function bn(i,r){i&1&&(Ba(0,"span",19),IS(1,"..."),vf());}function kn(i,r){if(i&1&&(IS(0),no$1(1,bn,2,0,"span",19)),i&2){let e=JT().$implicit,n=JT();Rv(n.truncateDisplay(n.formatValue(e.value))),In$1(),ro$1(n.isTruncated(e.value)?1:-1);}}function wn(i,r){if(i&1){let e=YT();Ba(0,"mat-icon",20),bv("click",function(t){fm(e);let s=JT().$implicit,p=JT();return pm(p.setFieldTtl(s.key,t))}),IS(1,"schedule"),vf();}if(i&2){let e=JT().$implicit,n=JT();oc("color",n.getFieldTtlColor(e.key)||null)("opacity",n.hasFieldTtl(e.key)?.7:.3),mt("p3xr-tree-ttl-pulse",n.isFieldTtlPulsing(e.key)),pv("matTooltip",n.hasFieldTtl(e.key)?"TTL: "+n.formatFieldTtl(e.key):n.strings?.intention?.ttl);}}function Sn(i,r){if(i&1){let e=YT();Ba(0,"mat-icon",21),bv("click",function(t){fm(e);let s=JT().$implicit,p=JT();return pm(p.deleteHashKey(s.key,t))}),IS(1,"delete"),vf();}}function Tn(i,r){if(i&1){let e=YT();Ba(0,"mat-icon",22),bv("click",function(t){fm(e);let s=JT().$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),IS(1,"edit"),vf();}}function Vn(i,r){if(i&1){let e=YT();Ba(0,"div",7)(1,"span",9),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),IS(2),vf(),Ba(3,"span",10),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),no$1(4,vn,1,2,"p3xr-hex-monitor",11)(5,kn,2,2),vf(),Ba(6,"span",12),no$1(7,wn,2,7,"mat-icon",13),no$1(8,Sn,2,0,"mat-icon",14),Ba(9,"mat-icon",15),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.showJsonItem(s.value,t))}),IS(10,"account_tree"),vf(),Ba(11,"mat-icon",16),bv("click",function(){let t=fm(e).$implicit,s=JT();return pm(s.copyItem(t.value))}),IS(12,"content_copy"),vf(),Ba(13,"mat-icon",17),bv("click",function(){let t=fm(e).$implicit,s=JT();return pm(s.downloadItem(t.key))}),IS(14,"download"),vf(),no$1(15,Tn,2,0,"mat-icon",18),vf()();}if(i&2){let e=r.$implicit,n=JT();In$1(2),Rv(e.key),In$1(),mt("p3xr-pre",n.valueFormat!=="hex"),In$1(),ro$1(n.valueFormat==="hex"?4:5),In$1(3),ro$1(!n.isReadonly&&n.redisState.redisVersion().isAtLeast(8,0)?7:-1),In$1(),ro$1(n.isReadonly?-1:8),In$1(7),ro$1(n.isReadonly?-1:15);}}var oi=(()=>{class i extends ie{ttlDialog;paging;pagedItems=[];fieldTtls={};fieldTtlsFetchedAt=0;ttlCountdownInterval=null;constructor(e,n,t,s,p,C,b,S,E,T,ee){super(e,n,t,s,p,C,b,S,E,T),this.ttlDialog=ee,this.paging=new se({settingsService:T});}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(n=>({key:n,value:this.p3xrValue[n]}));}addHash(e){return L(this,null,function*(){try{yield this.keyNewOrSetDialog.show({$event:e,type:"append",model:{type:"hash",key:this.p3xrKey}}),this.refreshKey();}catch(n){this.common.generalHandleError(n);}})}deleteHashKey(e,n){return L(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,n,t){return L(this,null,function*(){try{let s=typeof n=="string"&&n.length>=this.maxValueAsBuffer?this.p3xrValueBuffer[e]:n;yield this.keyNewOrSetDialog.show({$event:t,type:"edit",model:{type:"hash",key:this.p3xrKey,hashKey:e,value:s}}),this.refreshKey();}catch(s){this.common.generalHandleError(s);}})}ngOnDestroy(){this.clearTtlCountdown();}clearTtlCountdown(){this.ttlCountdownInterval&&(clearInterval(this.ttlCountdownInterval),this.ttlCountdownInterval=null);}startTtlCountdown(){this.clearTtlCountdown(),Object.values(this.fieldTtls).some(n=>n>0)&&(this.ttlCountdownInterval=setInterval(()=>{if(Object.keys(this.fieldTtls).some(t=>{let s=this.fieldTtls[t];if(!s||s<=0)return false;let p=Math.floor((Date.now()-this.fieldTtlsFetchedAt)/1e3);return s-p<=0})){this.clearTtlCountdown(),this.refreshKey();return}this.cdr.markForCheck();},1e3));}getRemainingFieldTtl(e){let n=this.fieldTtls[e];if(!n||n<=0)return -1;let t=Math.floor((Date.now()-this.fieldTtlsFetchedAt)/1e3),s=n-t;return s>0?s:-1}loadFieldTtls(){return L(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 n=yield this.socket.request({action:"hash-field/ttls",payload:{key:this.p3xrKey,fields:e}});this.fieldTtls=n.fieldTtls||{},this.fieldTtlsFetchedAt=Date.now(),this.startTtlCountdown(),this.cdr.markForCheck();}catch(e){this.fieldTtls={};}})}getFieldTtlColor(e){let n=this.getRemainingFieldTtl(e);return n<=0?"":n<300?"var(--mat-sys-error, #f44336)":n<3600?"var(--mat-sys-tertiary, #ff9800)":"#4caf50"}isFieldTtlPulsing(e){let n=this.getRemainingFieldTtl(e);return n>0&&n<30}hasFieldTtl(e){return this.getRemainingFieldTtl(e)>0}formatFieldTtl(e){let n=this.getRemainingFieldTtl(e);if(n<=0)return "";let t=this.settingsService.getHumanizeDurationOptions();return (0, ni.default)(n*1e3,F(E({},t),{largest:2,round:true,delimiter:" "}))}setFieldTtl(e,n){return L(this,null,function*(){try{let s=(yield this.socket.request({action:"hash-field/ttl-get",payload:{key:this.p3xrKey,field:e}})).ttl??-1,p=yield this.ttlDialog.show({$event:n,model:{ttl:s}});yield this.socket.request({action:"hash-field/ttl",payload:{key:this.p3xrKey,field:e,ttl:p.model.ttl}}),this.common.toast(`${e}: TTL ${p.model.ttl===-1?"removed":p.model.ttl+"s"}`),this.loadFieldTtls();}catch(t){t!==void 0&&this.common.generalHandleError(t);}})}copyItem(e){this.copy(e);}showJsonItem(e,n){this.showJson(e,n);}downloadItem(e){this.downloadBuffer(this.p3xrValueBuffer[e],`${this.p3xrKey}-${e}`);}static \u0275fac=function(n){return new(n||i)(Xe(fQ),Xe(bi$1),Xe(It),Xe(u),Xe(h$1),Xe(op),Xe(P),Xe(uc),Xe(Q),Xe(x),Xe(Ye))};static \u0275cmp=_e({type:i,selectors:[["p3xr-key-hash"]],features:[Be$1,Dn$1],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(n,t){n&1&&(Ba(0,"p3xr-key-pager-inline",0),bv("pageChanged",function(){return t.updatePagedItems(),t.loadFieldTtls()}),vf(),Ba(1,"div",1)(2,"div",2)(3,"span",3),IS(4),vf(),Ba(5,"span",4),IS(6),vf(),Ba(7,"span",5),no$1(8,Cn,3,0,"button",6),vf()(),HT(9,Vn,16,7,"div",7,hn),vf()),n&2&&(pv("paging",t.paging),In$1(4),Rv(t.strings?.page?.key?.hash?.table?.hashkey),In$1(2),Rv(t.strings?.page?.key?.hash?.table?.value),In$1(2),ro$1(t.isReadonly?-1:8),In$1(),UT(t.pagedItems));},dependencies:[mb,jn$1,aY,_A,yt,wt,Qt,gt,de,pe],encapsulation:2,changeDetection:1})}return i})();var In=(i,r)=>r.key;function En(i,r){if(i&1){let e=YT();Ba(0,"button",8),bv("click",function(t){fm(e);let s=JT();return pm(s.addArray(t))}),Ba(1,"mat-icon"),IS(2,"add"),vf()();}}function Kn(i,r){if(i&1&&hv(0,"p3xr-hex-monitor",11),i&2){let e=JT().$implicit,n=JT();pv("value",n.truncateDisplay(e.value))("truncated",n.isTruncated(e.value));}}function Mn(i,r){i&1&&(Ba(0,"span",18),IS(1,"..."),vf());}function Dn(i,r){if(i&1&&(IS(0),no$1(1,Mn,2,0,"span",18)),i&2){let e=JT().$implicit,n=JT();Rv(n.truncateDisplay(n.formatValue(e.value))),In$1(),ro$1(n.isTruncated(e.value)?1:-1);}}function Fn(i,r){if(i&1){let e=YT();Ba(0,"mat-icon",19),bv("click",function(t){fm(e);let s=JT().$implicit,p=JT();return pm(p.deleteArrayIndex(s.key,t))}),IS(1,"delete"),vf();}}function Bn(i,r){if(i&1){let e=YT();Ba(0,"mat-icon",20),bv("click",function(t){fm(e);let s=JT().$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),IS(1,"edit"),vf();}}function Pn(i,r){if(i&1){let e=YT();Ba(0,"div",7)(1,"span",9),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),IS(2),vf(),Ba(3,"span",10),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.editValue(s.key,s.value,t))}),no$1(4,Kn,1,2,"p3xr-hex-monitor",11)(5,Dn,2,2),vf(),Ba(6,"span",12),no$1(7,Fn,2,0,"mat-icon",13),Ba(8,"mat-icon",14),bv("click",function(t){let s=fm(e).$implicit,p=JT();return pm(p.showJsonItem(s.value,t))}),IS(9,"account_tree"),vf(),Ba(10,"mat-icon",15),bv("click",function(){let t=fm(e).$implicit,s=JT();return pm(s.copyItem(t.value))}),IS(11,"content_copy"),vf(),Ba(12,"mat-icon",16),bv("click",function(){let t=fm(e).$implicit,s=JT();return pm(s.downloadItem(t.key))}),IS(13,"download"),vf(),no$1(14,Bn,2,0,"mat-icon",17),vf()();}if(i&2){let e=r.$implicit,n=JT();In$1(2),Rv(e.key),In$1(),mt("p3xr-pre",n.valueFormat!=="hex"),In$1(),ro$1(n.valueFormat==="hex"?4:5),In$1(3),ro$1(n.isReadonly?-1:7),In$1(7),ro$1(n.isReadonly?-1:14);}}var ri=(()=>{class i extends ie{paging;pa