UNPKG

dphelper

Version:

dphelper devtools, data management for developers by Dario Passariello

1 lines 305 kB
var index;(()=>{var e={174(e,t,r){var n;e.exports=(n=r(6569),r(4942),r(9848),r(3246),r(1345),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,o=[],a=[],s=[],c=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)nextState.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(t){var a=t.words,s=a[0],c=a[1],d=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),p=d>>>16|4294901760&u,h=u<<16|65535&d;for(o[0]^=d,o[1]^=p,o[2]^=u,o[3]^=h,o[4]^=d,o[5]^=p,o[6]^=u,o[7]^=h,r=0;r<4;r++)nextState.call(this)}},_doProcessBlock:function(e,t){var r=this._X;nextState.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function nextState(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,c=n>>>16,d=((o*o>>>17)+o*c>>>15)+c*c,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=d^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(c)}(),n.Rabbit)},264(e,t,r){var n;e.exports=(n=r(6569),r(4942),r(9848),r(3246),r(1345),function(){var e=n,t=e.lib,r=t.WordArray,o=t.BlockCipher,a=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=a.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],a=0;a<16;a++){var u=o[a]=[],p=d[a];for(r=0;r<24;r++)u[r/6|0]|=t[(c[r]-1+p)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(c[r+24]-1+p)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=o[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],exchangeLR.call(this,4,252645135),exchangeLR.call(this,16,65535),exchangeRL.call(this,2,858993459),exchangeRL.call(this,8,16711935),exchangeLR.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],a=this._lBlock,s=this._rBlock,c=0,d=0;d<8;d++)c|=u[d][((s^o[d])&p[d])>>>0];this._lBlock=s,this._rBlock=a^c}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,exchangeLR.call(this,1,1431655765),exchangeRL.call(this,8,16711935),exchangeRL.call(this,2,858993459),exchangeLR.call(this,16,65535),exchangeLR.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function exchangeLR(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function exchangeRL(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=o._createHelper(h);var f=a.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),n.TripleDES)},265(){"use strict";dphelper.terminal=e=>{if(!e)throw Error("Parent DOM element required!");let t=!1;const r=console.log,n=console.info,o=console.warn,a=console.error,s=document.getElementById("terminal"),AppendToDomElement=function(e,...t){let r=t.join(" ");r=e===c.WARN?`<font color="#FF6600">* WARN: ${r}</font>`:e===c.ERR?`<font color="#FF0000">* ERR: ${r}</font>`:`* ${r}`,this.domElement.innerHTML+=`${r}<br/>`,s&&(s.scrollTop=s.scrollHeight)},c={LOG:0,INFO:1,WARN:2,ERR:3},d={autoScroll:!0,disableConsoleLogging:!1,domElement:document.createElement("div"),initKeyMappings:function(){t?console.warn("DebugConsole: keys already mapped!"):(state.toggleConsole=function(){this.visible=!this.visible}.bind(this),t=!0)},overrideConsole:function(){console.log=function(...e){this.disableConsoleLogging||(AppendToDomElement.call(this,c.LOG,...e),r.apply(console,e))}.bind(this),console.info=function(...e){this.disableConsoleLogging||(AppendToDomElement.call(this,c.INFO,...e),n.apply(console,e))}.bind(this),console.warn=function(...e){this.disableConsoleLogging||(AppendToDomElement.call(this,c.WARN,...e),o.apply(console,e))}.bind(this),console.error=function(...e){this.disableConsoleLogging||(AppendToDomElement.call(this,c.ERR,...e),a.apply(console,e))}.bind(this),onerror=(e,t,r)=>{const n=`${e} in <a href="${t}" target='_blank'>${null==t?void 0:t.split("/").pop()}</a>: ${r}`;return console.error(n),!1}},clear:function(){this.domElement.innerHTML=""},get visible(){return""===this.domElement.style.display},set visible(e){e?(this.domElement.style.display="",this.autoScroll&&(this.domElement.scrollTop=this.domElement.scrollHeight)):this.domElement.style.display="none"},get top(){return this.domElement.style.top},set top(e){this.domElement.style.top=e},get left(){return this.domElement.style.left},set left(e){this.domElement.style.left=e},get bottom(){return this.domElement.style.bottom},set bottom(e){this.domElement.style.bottom=e},get right(){return this.domElement.style.right},set right(e){this.domElement.style.right=e},get width(){return this.domElement.style.width},set width(e){this.domElement.style.width=e},get height(){return this.domElement.style.height},set height(e){this.domElement.style.height=e}};return d.domElement.id="debugConsole",e.appendChild(d.domElement),d.overrideConsole(),d},Object.defineProperty(dphelper,"terminal",{writable:!1,enumerable:!1,configurable:!1})},477(){},574(){"use strict";dphelper.setDescription({name:"UI",active:!0,subCommand:[{name:"input",version:"0.0.1",example:"dphelper.UI.input(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"",subCommand:[]}]},{input:()=>null,button:()=>null,textarea:()=>null,select:()=>null,dataset:()=>null,fieldset:()=>null,legend:()=>null,code:()=>null})},656(e,t,r){var n;e.exports=(n=r(6569),r(2140),r(3892),r(6411),r(4942),r(3689),r(9848),r(1371),r(6797),r(7016),r(1320),r(3785),r(5277),r(4460),r(8373),r(3519),r(3246),r(1345),r(4293),r(7271),r(4304),r(6585),r(6770),r(2733),r(2677),r(8870),r(9935),r(1923),r(8821),r(8455),r(264),r(1141),r(174),r(9988),r(7092),n)},662(){"use strict";const e={play:(e,t="",r=!1)=>{if(e){if(!document.querySelector(`#audio_${e}`)){const n=document.createElement("audio");n.id=`audio_${e}`,n.src=t+e,n.loop=r,document.body.appendChild(n),n.load(),n.play().catch(e=>console.error("Error playing audio:",e))}}else{const e=document.querySelectorAll("audio");for(const t of e)t.remove()}}};dphelper.setDescription({name:"audio",active:!0,subCommand:[{name:"play",version:"0.0.1",example:"dphelper.audio.play([audiofile])",description:"",author:"Dario Passariello",creationDate:"20240924",lastMod:"20240924",type:"function",active:!0,subCommand:[]}]},e)},833(){"use strict";const e={list:()=>cache.log,reg:e=>cache.log.push({type:"reg",message:e}),debug:e=>cache.log.push({type:"debug",message:e}),error:e=>cache.log.push({type:"error",message:e})};Object.defineProperty(cache,"log",{writable:!1,enumerable:!1,configurable:!1}),dphelper.setDescription({name:"logging",active:!0,subCommand:[{name:"list",version:"0.0.1",example:"dphelper.log.list()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"List all log entries.",subCommand:[]},{name:"reg",version:"0.0.1",example:"dphelper.log.reg('message')",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Log a regular message.",subCommand:[]},{name:"debug",version:"0.0.1",example:"dphelper.log.debug('message')",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Log a debug message.",subCommand:[]},{name:"error",version:"0.0.1",example:"dphelper.log.error('message')",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Log an error message.",subCommand:[]}]},e)},934(){"use strict";const e={counter:(e,t,r)=>e?t&&r?Object.keys(e).length:e.items.filter(e=>e[t]===r).length:null,toCsv:e=>{const t=e,replacer=(e,t)=>null===t?"":t,r=Object.keys(t[0]),n=t.map(e=>r.map(t=>JSON.stringify(e[t],replacer)).join(","));return n.unshift(r.join(",")),n.join("\r\n")},saveCsvAs:(e,t)=>{const r=new Blob([e],{type:"text/csv;charset=utf-8;"}),n=document.createElement("a"),o=`${t}_${dphelper.date.dateTimeToString(new Date(Date.now()))}.csv`,a=URL.createObjectURL(r);n.setAttribute("href",a),n.setAttribute("download",o),n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n)},is:e=>{try{JSON.parse(e)}catch(e){return console.error(e),!1}return!0},parse:e=>{try{return JSON.parse(e)}catch(e){return console.error(e),"Json not parsable"}},sanitize:e=>e?"{"+e.replace(/:(\s*\d+)/g,':"$1"').replace(/:(\s*true)/g,':"true"').replace(/:(\s*false)/g,':"false"').replace(/:(\s*null)/g,':""').replace(/"\s*?,\s*?"/g,'"@separator@"').replace(/[{}]/g,"").split("@separator@").map(e=>{var t=e.split(":");return`${dphelper.json.sanitize(t[0])}:${dphelper.json.sanitize(t[1])}`}).join(",")+"}":"{}",sanitizeJsonValue:e=>e?`${e.replace(/^"(.*)"$/,"$1").replace(/\\/g,"").replace(/\//g,"/").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/"/g,'\\"').replace(/\t/g," ").trim()}"`:'""'};dphelper.setDescription({name:"json",active:!0,subCommand:[{name:"counter",version:"0.0.1",example:"dphelper.json.counter()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Count occurrences of a key-value pair in a JSON object.",subCommand:[]},{name:"toCsv",version:"0.0.1",example:"dphelper.json.toCsv()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Convert JSON data to CSV format.",subCommand:[]},{name:"saveCsvAs",version:"0.0.1",example:"dphelper.json.saveCsvAs()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Save CSV data as a file.",subCommand:[]},{name:"is",version:"0.0.1",example:"dphelper.json.is()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Check if a string is valid JSON.",subCommand:[]},{name:"parse",version:"0.0.1",example:"dphelper.json.parse()",author:"Dario Passariello",creationDate:"20241107",lastMod:"20241107",type:"function",active:!0,description:"Parse a JSON string.",subCommand:[]},{name:"sanitize",version:"0.0.1",example:"dphelper.json.sanitize()",author:"Dario Passariello",creationDate:"20241107",lastMod:"20241107",type:"function",active:!0,description:"Sanitize a JSON string.",subCommand:[]},{name:"sanitizeJsonValue",version:"0.0.1",example:"dphelper.json.sanitizeJsonValue()",author:"Dario Passariello",creationDate:"20241107",lastMod:"20241107",type:"function",active:!0,description:"Sanitize individual JSON values.",subCommand:[]}]},e)},1062(){"use strict";const e=6371e3,t={degreesToRadians:e=>e*Math.PI/180,latToMeters:t=>{if(Array.isArray(t))return e*Math.cos(t[0])*Math.cos(t[1])/1e3},toVector:t=>{if(Array.isArray(t))return[e*Math.cos(t[1]*Math.PI/180)*Math.cos(t[0]*Math.PI/180),e*Math.cos(t[1]*Math.PI/180)*Math.sin(t[0]*Math.PI/180),e*Math.sin(t[2]*Math.PI/180)]},convertToDecDegrees:(e,t,r,n)=>{let o=e+t/60+r/3600;return"S"!==n&&"W"!==n||(o*=-1),o},distance:(t,r)=>{if(!Array.isArray(t)||!Array.isArray(r))return;const n=t[0]*Math.PI/180,o=r[0]*Math.PI/180,a=(r[0]-t[0])*Math.PI/180,s=(r[1]-t[1])*Math.PI/180,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(o)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),u=e*d;return{km:Number((u/1e3).toFixed(2)),mi:Number((u/1e3*.621371).toFixed(2)),nMi:Number((u/1e3/1.852).toFixed(2))}},polarToCartesian:(e,t,r,n)=>{const o=(n-90)*Math.PI/180;return{x:e+r*Math.cos(o),y:t+r*Math.sin(o)}},mapDegreesToPixels:(e,t,r,n,o,a)=>{const s=o-a/10/2-(n+(e-t)/(r-t)*(o-n)-a);return s<a?a:s}};dphelper.setDescription({name:"coords",active:!0,subCommand:[{name:"degreesToRadians",version:"0.0.1",example:"dphelper.coords.degreesToRadians(45)",author:"Dario Passariello",creationDate:"2021-01-01",lastMod:"2021-01-01",type:"function",active:!0,description:"Convert degrees to radians",subCommand:[]},{name:"latToMeters",version:"0.0.1",example:"dphelper.coords.latToMeters([40.689202777778, -74.044219444444])",author:"Dario Passariello",creationDate:"2021-01-01",lastMod:"2021-01-01",type:"function",active:!0,description:"Convert latitude to meters",subCommand:[]},{name:"toVector",version:"0.0.1",example:"dphelper.coords.toVector([40.689202777778, -74.044219444444, 1])",author:"Dario Passariello",creationDate:"2021-01-01",lastMod:"2021-01-01",type:"function",active:!0,description:"Convert coordinates to vector",subCommand:[]},{name:"convertToDecDegrees",version:"0.0.1",example:"dphelper.coords.convertToDecDegrees([39, 5, 59, 'N'])",author:"Dario Passariello",creationDate:"2021-01-01",lastMod:"2021-01-01",type:"function",active:!0,description:"Convert coordinates to decimal degrees",subCommand:[]},{name:"distance",version:"0.0.1",example:"dphelper.coords.distance([40.718788808171105, -74.0114768663747],[38.909309636475875, -77.01712459058946])",author:"Dario Passariello",creationDate:"2021-01-01",lastMod:"2021-01-01",type:"function",active:!0,description:"\n Haversine formula:\n a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)\n c = 2 ⋅ atan2( √a, √(1-a) )\n d = R ⋅ c\n where φ is latitude, λ is longitude, R is earth's radius (mean radius = 6,371km);\n note that angles need to be in radians to pass to trig functions!\n ",subCommand:[]},{name:"polarToCartesian",version:"0.0.1",example:"dphelper.coords.polarToCartesian([centerX, centerY, radius, angleInDegrees])",author:"Dario Passariello",creationDate:"2024-09-28",lastMod:"2024-09-28",type:"function",active:!0,description:"Convert polar coordinates to Cartesian coordinates",subCommand:[]},{name:"mapDegreesToPixels",version:"0.0.1",example:"dphelper.coords.mapDegreesToPixels([degree, minDegree, maxDegree, minPixel, maxPixel, padding])",author:"Dario Passariello",creationDate:"2024-09-28",lastMod:"2024-09-28",type:"function",active:!0,description:"Map degrees to pixels",subCommand:[]}]},t)},1122(){"use strict";const e={init:(e,t,r,n)=>{$(e).find("svg")&&dphelper.svg_removeConnection(e),t=[dphelper.svg.setConnector(t[0],t[1]),t[1]],r=[dphelper.svg.setConnector(r[0],r[1]),r[1]];const o=e.getBoundingClientRect(),a="http://www.w3.org/2000/svg",s=10*e.offsetWidth,c=10*e.offsetHeight,d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.setAttributeNS(null,"id","pathConnection"),d.setAttributeNS(null,"viewBox","0 0 "+s+" "+c),d.setAttributeNS(null,"width",String(s)),d.setAttributeNS(null,"height",String(c)),d.style.display="block";const u=document.createElementNS(a,"rect");let p=t[0].getBoundingClientRect();u.setAttributeNS(null,"x",String(p.left-o.left)),u.setAttributeNS(null,"y",String(p.top-o.top)),u.setAttributeNS(null,"width",String(p.width)),u.setAttributeNS(null,"height",String(p.height)),d.appendChild(u);const h=document.createElementNS(a,"rect");p=r[0].getBoundingClientRect(),h.setAttributeNS(null,"x",String(p.left-o.left)),h.setAttributeNS(null,"y",String(p.top-o.top)),h.setAttributeNS(null,"width",String(p.width)),h.setAttributeNS(null,"height",String(p.height)),d.appendChild(h);const f=document.createElementNS(a,"path");f.setAttributeNS(null,"id","connection"),f.setAttributeNS(null,"marker-end","url(#head)"),d.appendChild(f),e.appendChild(d),dphelper.svg.update($(u)[0],$(h)[0],$("#connection")[0]),"function"==typeof n&&n(t,r)},check:()=>{try{if(void 0===dphelper.svg.check.supported){const e=document.body.appendChild(document.createElement("div"));e.innerHTML='<v:shape id="vml_flag1" adj="1" />';const t=e.firstChild;t.style.behavior="url(#default#VML)",dphelper.svg.check.supported=!t||"object"==typeof t.adj,e.parentNode.removeChild(e)}return dphelper.svg.check.supported}catch(e){}},update:(e,t,r)=>{const n=Number.parseFloat(e[0].getAttribute("x")),o=Number.parseFloat(e[0].getAttribute("y")),a=Number.parseFloat(t[0].getAttribute("x")),s=Number.parseFloat(t[0].getAttribute("y")),c=Number.parseFloat(e[0].getAttribute("width"))/2,d=Number.parseFloat(e[0].getAttribute("height"))/2,u=Number.parseFloat(t[0].getAttribute("width"))/2,p=Number.parseFloat(t[0].getAttribute("height"))/2,h=n+c,f=o+d,m=a+u,v=s+p,y=m-h,b=v-f,x=dphelper.svg.getIntersection(y,b,h,f,c,d),w=dphelper.svg.getIntersection(-y,-b,m,v,u,p),D=w[0]-x[0],C=dphelper.svg.getCurve(x,w,D);r.setAttributeNS(null,"d","M"+h+","+f+C+m+","+v)},getCurve:(e,t,r)=>{const n=r/2;return" C"+(n+e[0])+","+e[1]+" "+(t[0]-n)+","+t[1]+" "},getIntersection:(e,t,r,n,o,a)=>Math.abs(t/e)<a/o?[r+(e>0?o:-o),n+t*o/Math.abs(e)]:[r+e*a/Math.abs(t),n+(t>0?a:-a)],setConnector:(e,t)=>{let r;const n=$('<span class="connector"></span>');switch($(e).css("position","relative"),n.css({position:"absolute",width:"5px",height:"5px"}),t){case"top":r={left:"50%",top:"2.5px",marginLeft:"2.5px"};break;case"right":r={top:"50%",right:"2.5px",marginTop:"-2.5px"};break;case"bottom":r={left:"50%",bottom:"-2.5px",marginLeft:"2.5px"};break;case"left":r={top:"50%",left:"-2.5px",marginTop:"-2.5px"};break;default:r={}}return n.css(r),$(e).append(n),$(n)[0]},removeConnection:e=>{$(e).find("svg#pathConnection").each((e,t)=>{$(t).remove()})},makeScrollable:(e,t,r,n,o,a)=>{const s=e.getBoundingClientRect(),c=[r,n],d=c.length,u=[o,a],p=[];for(let e=0;e<d;e++)p[e]=c[e].getBoundingClientRect(),u[e].setAttributeNS(null,"x",String(p[e].left-s.left)),u[e].setAttributeNS(null,"y",String(p[e].top-s.top)),u[e].setAttributeNS(null,"width",p[e].width),u[e].setAttributeNS(null,"height",p[e].height);dphelper.svg.update($(o)[0],$(a)[0],$("#connection")[0])},makeDraggable:e=>{const t=e.target;function getMousePosition(e){const r=t[0].getScreenCTM();return{x:(e.clientX-r.e)/r.a,y:(e.clientY-r.f)/r.d}}t[0].addEventListener("mousedown",function startDrag(e){e.target.classList.contains("draggable")&&(r=e.target,n=getMousePosition(e),n.x-=Number.parseFloat(r[0].getAttributeNS(null,"x")||"0"),n.y-=Number.parseFloat(r[0].getAttributeNS(null,"y")||"0"))}),t[0].addEventListener("mousemove",function drag(e){if(r&&n){const t=getMousePosition(e);r.setAttributeNS(null,"x",String(t.x-n.x)),r.setAttributeNS(null,"y",String(t.y-n.y)),dphelper.svg.update(r,r,$("#connection")[0])}}),t[0].addEventListener("mouseup",function endDrag(){return r=null,void(n=null)});let r=null,n=null},toggle:(e,t,r,n)=>{$(e.target).prop("checked")&&$(r).length&&$(n).length?(dphelper.cookie.set({name:`${$(e.target).attr("id")}`,value:1,time:365}),dphelper.svg.init(t,[$(r)[0],"right"],[$(n)[0],"left"],(e,r)=>{$("#parts-left-body").on("scroll",()=>{dphelper.svg.makeScrollable($(t)[0],$("#parts-left-body")[0],$(e)[0],$(r)[0],$("#parts svg rect")[0],$("#parts svg rect")[1])})})):(dphelper.svg.removeConnection(t),$("#parts-left-body").off("scroll"),dphelper.cookie.set({name:`${$(e.target).attr("id")}`,value:0,time:365}))},convert:({children:e,active:t=!0,size:r=[1920,1080],fit:n=["100%","100%"],preserveAspectRatio:o="none",style:a=`width:${n[0]}; height:${n[1]}`,zoom:s=(this?dphelper.window.getZoom():1)})=>{if(!e)return"Please pass ID of element for SVG conversion";if(t){const t=$(e).clone(),c=`\n <svg\n viewBox="0 0 ${r[0]} ${r[1]}"\n preserveAspectRatio="${o}"\n xmlns="http://www.w3.org/2000/svg"\n style="${a}; zoom:${s}"\n >\n <foreignObject\n x="0"\n y="0"\n width="${n[0]}"\n height="${n[1]}"\n style="${a}; zoom:${s}"\n >\n </foreignObject>\n </svg >\n `;$(e).html(c).find("foreignObject").html(t)}}};dphelper.setDescription({name:"svg",active:!0,subCommand:[{name:"init",version:"0.0.1",example:"dphelper.svg.init(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Initializes an SVG connection between two elements.",subCommand:[]},{name:"check",version:"0.0.1",example:"dphelper.svg.check(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Checks if SVG support is available.",subCommand:[]},{name:"update",version:"0.0.1",example:"dphelper.svg.update(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Updates the SVG connection between two elements.",subCommand:[]},{name:"getCurve",version:"0.0.1",example:"dphelper.svg.getCurve(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Calculates the curve of the connection between two points.",subCommand:[]},{name:"getIntersection",version:"0.0.1",example:"dphelper.svg.getIntersection(...) ",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Calculates the intersection point between two elements.",subCommand:[]},{name:"setConnector",version:"0.0.1",example:"dphelper.svg.setConnector(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Sets a connector on an element.",subCommand:[]},{name:"removeConnection",version:"0.0.1",example:"dphelper.svg.removeConnection(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Removes an SVG connection from a container.",subCommand:[]},{name:"makeScrollable",version:"0.0.1",example:"dphelper.svg.makeScrollable(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Makes an SVG container scrollable.",subCommand:[]},{name:"makeDraggable",version:"0.0.1",example:"dphelper.svg.makeDraggable(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Makes an SVG element draggable.",subCommand:[]},{name:"toggle",version:"0.0.1",example:"dphelper.svg.toggle(...)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Toggles an SVG connection on or off.",subCommand:[]},{name:"convert",version:"0.0.1",example:"dphelper.svg.convert([Object])",author:"Dario Passariello",creationDate:"20190101",lastMod:"20240401",type:"function",active:!0,description:"Converts an element to SVG.",subCommand:[]}]},e),dphelper.svg.check()},1141(e,t,r){var n;e.exports=(n=r(6569),r(4942),r(9848),r(3246),r(1345),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,o=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var a=0;o<256;o++){var s=o%r,c=t[s>>>2]>>>24-s%4*8&255;a=(a+n[o]+c)%256;var d=n[o];n[o]=n[a],n[a]=d}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var a=r.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)generateKeystreamWord.call(this)}});e.RC4Drop=t._createHelper(a)}(),n.RC4)},1320(e,t,r){var n;e.exports=(n=r(6569),r(2140),function(){var e=n,t=e.lib.Hasher,r=e.x64,o=r.Word,a=r.WordArray,s=e.algo;function X64Word_create(){return o.create.apply(o,arguments)}var c=[X64Word_create(1116352408,3609767458),X64Word_create(1899447441,602891725),X64Word_create(3049323471,3964484399),X64Word_create(3921009573,2173295548),X64Word_create(961987163,4081628472),X64Word_create(1508970993,3053834265),X64Word_create(2453635748,2937671579),X64Word_create(2870763221,3664609560),X64Word_create(3624381080,2734883394),X64Word_create(310598401,1164996542),X64Word_create(607225278,1323610764),X64Word_create(1426881987,3590304994),X64Word_create(1925078388,4068182383),X64Word_create(2162078206,991336113),X64Word_create(2614888103,633803317),X64Word_create(3248222580,3479774868),X64Word_create(3835390401,2666613458),X64Word_create(4022224774,944711139),X64Word_create(264347078,2341262773),X64Word_create(604807628,2007800933),X64Word_create(770255983,1495990901),X64Word_create(1249150122,1856431235),X64Word_create(1555081692,3175218132),X64Word_create(1996064986,2198950837),X64Word_create(2554220882,3999719339),X64Word_create(2821834349,766784016),X64Word_create(2952996808,2566594879),X64Word_create(3210313671,3203337956),X64Word_create(3336571891,1034457026),X64Word_create(3584528711,2466948901),X64Word_create(113926993,3758326383),X64Word_create(338241895,168717936),X64Word_create(666307205,1188179964),X64Word_create(773529912,1546045734),X64Word_create(1294757372,1522805485),X64Word_create(1396182291,2643833823),X64Word_create(1695183700,2343527390),X64Word_create(1986661051,1014477480),X64Word_create(2177026350,1206759142),X64Word_create(2456956037,344077627),X64Word_create(2730485921,1290863460),X64Word_create(2820302411,3158454273),X64Word_create(3259730800,3505952657),X64Word_create(3345764771,106217008),X64Word_create(3516065817,3606008344),X64Word_create(3600352804,1432725776),X64Word_create(4094571909,1467031594),X64Word_create(275423344,851169720),X64Word_create(430227734,3100823752),X64Word_create(506948616,1363258195),X64Word_create(659060556,3750685593),X64Word_create(883997877,3785050280),X64Word_create(958139571,3318307427),X64Word_create(1322822218,3812723403),X64Word_create(1537002063,2003034995),X64Word_create(1747873779,3602036899),X64Word_create(1955562222,1575990012),X64Word_create(2024104815,1125592928),X64Word_create(2227730452,2716904306),X64Word_create(2361852424,442776044),X64Word_create(2428436474,593698344),X64Word_create(2756734187,3733110249),X64Word_create(3204031479,2999351573),X64Word_create(3329325298,3815920427),X64Word_create(3391569614,3928383900),X64Word_create(3515267271,566280711),X64Word_create(3940187606,3454069534),X64Word_create(4118630271,4000239992),X64Word_create(116418474,1914138554),X64Word_create(174292421,2731055270),X64Word_create(289380356,3203993006),X64Word_create(460393269,320620315),X64Word_create(685471733,587496836),X64Word_create(852142971,1086792851),X64Word_create(1017036298,365543100),X64Word_create(1126000580,2618297676),X64Word_create(1288033470,3409855158),X64Word_create(1501505948,4234509866),X64Word_create(1607167915,987167468),X64Word_create(1816402316,1246189591)],d=[];!function(){for(var e=0;e<80;e++)d[e]=X64Word_create()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new a.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],a=r[2],s=r[3],u=r[4],p=r[5],h=r[6],f=r[7],m=n.high,v=n.low,y=o.high,b=o.low,x=a.high,w=a.low,D=s.high,C=s.low,S=u.high,k=u.low,T=p.high,_=p.low,P=h.high,M=h.low,A=f.high,E=f.low,j=m,N=v,O=y,H=b,B=x,$=w,q=D,R=C,L=S,I=k,z=T,W=_,X=P,U=M,G=A,Y=E,J=0;J<80;J++){var V,K,Z=d[J];if(J<16)K=Z.high=0|e[t+2*J],V=Z.low=0|e[t+2*J+1];else{var Q=d[J-15],ee=Q.high,te=Q.low,re=(ee>>>1|te<<31)^(ee>>>8|te<<24)^ee>>>7,ne=(te>>>1|ee<<31)^(te>>>8|ee<<24)^(te>>>7|ee<<25),oe=d[J-2],ae=oe.high,ie=oe.low,se=(ae>>>19|ie<<13)^(ae<<3|ie>>>29)^ae>>>6,le=(ie>>>19|ae<<13)^(ie<<3|ae>>>29)^(ie>>>6|ae<<26),ce=d[J-7],de=ce.high,ue=ce.low,pe=d[J-16],he=pe.high,fe=pe.low;K=(K=(K=re+de+((V=ne+ue)>>>0<ne>>>0?1:0))+se+((V+=le)>>>0<le>>>0?1:0))+he+((V+=fe)>>>0<fe>>>0?1:0),Z.high=K,Z.low=V}var me,ve=L&z^~L&X,ge=I&W^~I&U,ye=j&O^j&B^O&B,be=N&H^N&$^H&$,xe=(j>>>28|N<<4)^(j<<30|N>>>2)^(j<<25|N>>>7),we=(N>>>28|j<<4)^(N<<30|j>>>2)^(N<<25|j>>>7),De=(L>>>14|I<<18)^(L>>>18|I<<14)^(L<<23|I>>>9),Ce=(I>>>14|L<<18)^(I>>>18|L<<14)^(I<<23|L>>>9),Se=c[J],ke=Se.high,Te=Se.low,_e=G+De+((me=Y+Ce)>>>0<Y>>>0?1:0),Pe=we+be;G=X,Y=U,X=z,U=W,z=L,W=I,L=q+(_e=(_e=(_e=_e+ve+((me+=ge)>>>0<ge>>>0?1:0))+ke+((me+=Te)>>>0<Te>>>0?1:0))+K+((me+=V)>>>0<V>>>0?1:0))+((I=R+me|0)>>>0<R>>>0?1:0)|0,q=B,R=$,B=O,$=H,O=j,H=N,j=_e+(xe+ye+(Pe>>>0<we>>>0?1:0))+((N=me+Pe|0)>>>0<me>>>0?1:0)|0}v=n.low=v+N,n.high=m+j+(v>>>0<N>>>0?1:0),b=o.low=b+H,o.high=y+O+(b>>>0<H>>>0?1:0),w=a.low=w+$,a.high=x+B+(w>>>0<$>>>0?1:0),C=s.low=C+R,s.high=D+q+(C>>>0<R>>>0?1:0),k=u.low=k+I,u.high=S+L+(k>>>0<I>>>0?1:0),_=p.low=_+W,p.high=T+z+(_>>>0<W>>>0?1:0),M=h.low=M+U,h.high=P+X+(M>>>0<U>>>0?1:0),E=f.low=E+Y,f.high=A+G+(E>>>0<Y>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),n.SHA512)},1345(e,t,r){var n,o,a,s,c,d,u,p,h,f,m,v,y,b,x,w,D,C,S;e.exports=(n=r(6569),r(3246),void(n.lib.Cipher||(o=n,a=o.lib,s=a.Base,c=a.WordArray,d=a.BufferedBlockAlgorithm,u=o.enc,u.Utf8,p=u.Base64,h=o.algo.EvpKDF,f=a.Cipher=d.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(e){return"string"==typeof e?S:D}return function(e){return{encrypt:function(t,r,n){return selectCipherStrategy(r).encrypt(e,t,r,n)},decrypt:function(t,r,n){return selectCipherStrategy(r).decrypt(e,t,r,n)}}}}()}),a.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),m=o.mode={},v=a.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),y=m.CBC=function(){var e=v.extend();function xorBlock(e,t,r){var n,o=this._iv;o?(n=o,this._iv=void 0):n=this._prevBlock;for(var a=0;a<r;a++)e[t+a]^=n[a]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize;xorBlock.call(this,e,t,n),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=e.slice(t,t+n);r.decryptBlock(e,t),xorBlock.call(this,e,t,n),this._prevBlock=o}}),e}(),b=(o.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,o=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(o);var d=c.create(a,n);e.concat(d)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.BlockCipher=f.extend({cfg:f.cfg.extend({mode:y,padding:b}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),x=a.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),w=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?c.create([1398893684,1701076831]).concat(r).concat(t):t).toString(p)},parse:function(e){var t,r=p.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=c.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),x.create({ciphertext:r,salt:t})}},D=a.SerializableCipher=s.extend({cfg:s.extend({format:w}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var o=e.createEncryptor(r,n),a=o.finalize(t),s=o.cfg;return x.create({ciphertext:a,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),C=(o.kdf={}).OpenSSL={execute:function(e,t,r,n,o){if(n||(n=c.random(8)),o)a=h.create({keySize:t+r,hasher:o}).compute(e,n);else var a=h.create({keySize:t+r}).compute(e,n);var s=c.create(a.words.slice(t),4*r);return a.sigBytes=4*t,x.create({key:a,iv:s,salt:n})}},S=a.PasswordBasedCipher=D.extend({cfg:D.cfg.extend({kdf:C}),encrypt:function(e,t,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=o.iv;var a=D.encrypt.call(this,e,t,o.key,n);return a.mixIn(o),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var o=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=o.iv,D.decrypt.call(this,e,t,o.key,n)}}))))},1371(e,t,r){var n,o,a,s,c,d,u,p;e.exports=(o=(n=p=r(6569)).lib,a=o.WordArray,s=o.Hasher,c=n.algo,d=[],u=c.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=0;u<80;u++){if(u<16)d[u]=0|e[t+u];else{var p=d[u-3]^d[u-8]^d[u-14]^d[u-16];d[u]=p<<1|p>>>31}var h=(n<<5|n>>>27)+c+d[u];h+=u<20?1518500249+(o&a|~o&s):u<40?1859775393+(o^a^s):u<60?(o&a|o&s|a&s)-1894007588:(o^a^s)-899497514,c=s,s=a,a=o<<30|o>>>2,o=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),p.SHA1)},1489(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n;const s={find:(e,t)=>{if(Array.isArray(e)){for(const r of e){if(r[t]===t)return r;if(r.children){const e=dphelper.array.find(t,r.children);if(e)return e}}return!1}},unique:e=>{if(Array.isArray(e))return[...new Set(e)]},delete:(e,t)=>{Array.isArray(e)&&e.some(function iter(e,r,n){if(e[t]===t)return n.splice(r,1),!0;for(const t of Object.keys(e)){const r=e[t];if(Array.isArray(r))return r.some(iter)}return null})},merge:(e,t)=>{if(!e||!t)return t||e;for(const r of Object.keys(e))e[r]instanceof Object&&t[r]&&Object.assign(e[r],dphelper.array.merge(t[r],e[r]));return Object.assign(t||{},e)},mergeByKey:(e,t,r)=>e.map(e=>{const n=t.find(t=>e[r]===t[r]);return n?Object.assign({},e,n):e}),asc:e=>{if(Array.isArray(e))return e.sort((e,t)=>e-t)},desc:e=>{if(Array.isArray(e))return e.sort((e,t)=>t-e)},duplicates:e=>{if(!Array.isArray(e))return;const t=new Set,r=new Set;for(const n of e)t.has(n)?r.add(n):t.add(n);return Array.from(r)},even:e=>{if(Array.isArray(e))return e.filter(e=>e%2==0)},odd:e=>{if(Array.isArray(e))return e.filter(e=>e%2!=0)},toObj:e=>{if(Array.isArray(e))return Object.assign({},e)},sumColumn:(e=[],t=0)=>Array.isArray(e)?void 0===t?"provide a column":e.reduce((e,r)=>e+(r[t]||0),0):"provide a multidimensional array",shuffle:e=>{if(Array.isArray(e)){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e}},generate:e=>{if(Number.isNaN(e))return;const t=Array.from({length:e},(e,t)=>t+1);return dphelper.array.shuffle(t)},testArrayInt:e=>{if(!Array.isArray(e))return;const t=[];for(let r=1;r<=e.length;r++)e.includes(r)||t.push(r);return t},rand32:e=>{const t=performance.now(),r=[];r.nums=[],r.time=[];for(let t=0;t<e;++t)r.nums.push(crypto.getRandomValues(new Uint32Array(1))[0]);const n=performance.now();return r.time.push(n-t),r},findindex:(e,t)=>e.findIndex(e=>e.name===t),pathToJson:(e,t="/")=>{const r={};let n;for(const o of e){n=r;const e=o.split(t);for(const t of e.slice(1,-1)){if(""===t)return;t in n||(n[t]={}),n=n[t]}n[e[e.length-1]]=null}return r},deepClone:e=>JSON.parse(JSON.stringify(e)),match:(e,t)=>e.filter(e=>t.includes(e)),shallow:e=>Object.assign([],e),deepCopy:e=>structuredClone(e),setProps:(e,t)=>{},groupBy:(e,s)=>e.reduce((e,c)=>{return d=((e,t)=>{for(var r in t||(t={}))o.call(t,r)&&__defNormalProp(e,r,t[r]);if(n)for(var r of n(t))a.call(t,r)&&__defNormalProp(e,r,t[r]);return e})({},e),u={[c[s]]:[...e[s]||[],c]},t(d,r(u));var d,u},{})};dphelper.setDescription({name:"array",active:!0,subCommand:[{name:"find",version:"0.0.1",example:"dphelper.array.find([array, item])",description:"Find an item in the array.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20240619",type:"function",active:!0,subCommand:[]},{name:"unique",version:"0.0.1",example:"dphelper.array.unique([array])",description:"Return a new array with unique items.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,subCommand:[]},{name:"delete",version:"0.0.1",example:"dphelper.array.delete([array, item])",description:"Delete an item from the array.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,subCommand:[]},{name:"merge",version:"0.0.1",example:"dphelper.array.merge([array1, array2])",description:"Merge two arrays into one.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,subCommand:[]},{name:"mergeByKey",version:"0.0.1",example:"dphelper.array.mergeByKey([arrayA, arrayB, key])",author:"Dario Passariello",creationDate:"20230603",lastMod:"20230603",type:"function",active:!0,description:'\n Example:\n const array = [\n {"date":1230,"value":1},\n {"date":1231,"value":2},\n {"date":1232,"value":3, "value1":3, name:"John"},\n {"date":1233,"value":4},\n {"date":1234,"value":5},\n {"date":1235,"value":6}\n ]\n const newData = [\n {"date":1230,"value":1000,\'name\':\'Diana\'},\n {"date":1232,"value":1000, "value1":20000},\n {"date":1234,"value":1000},\n {"date":1235,"value":888810000}\n ]\n Command: dphelper.array.mergeByKey( array, newData, \'date\' )\n Result:\n [\n {"date": 1230,"value": 1000, name: "Diana" },\n {"date": 1231,"value": 2},\n {"date": 1232 "value": 1000, "value1": 20000, name: "John" },\n {"date": 1233,"value": 4},\n {"date": 1234, "value": 1000},\n {"date": 1235,"value": 888810000}\n ]\n ',subCommand:[]},{name:"asc",version:"0.0.1",example:"dphelper.array.asc([array])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Sort an array in ascending order.",subCommand:[]},{name:"desc",version:"0.0.1",example:"dphelper.array.desc([array])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Sort an array in descending order.",subCommand:[]},{name:"duplicates",version:"0.0.1",example:"dphelper.array.duplicates([array])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20210101",type:"function",active:!0,description:"Find duplicate items in an array.",subCommand:[]},{name:"even",version:"0.0.1",example:"dphelper.array.even([array])",author:"Dario Passariello",creationDate:"2021