hfs 0.44.0 → 0.45.0-alpha3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -26
- package/admin/assets/index-282a6921.js +510 -0
- package/admin/assets/{sha512-d091720e.js → sha512-40c08671.js} +2 -2
- package/admin/index.html +1 -1
- package/frontend/assets/index-4fe980c3.js +94 -0
- package/frontend/assets/{sha512-96fd938f.js → sha512-bc83ec21.js} +2 -2
- package/frontend/fontello.css +4 -3
- package/frontend/fontello.woff2 +0 -0
- package/frontend/index.html +1 -1
- package/package.json +1 -1
- package/plugins/download-counter/plugin.js +13 -6
- package/src/adminApis.js +8 -0
- package/src/api.vfs.js +3 -3
- package/src/commands.js +14 -13
- package/src/config.js +1 -1
- package/src/const.js +7 -4
- package/src/customHtml.js +31 -21
- package/src/lang.js +2 -0
- package/src/langs/embedded.js +2 -1
- package/src/langs/hfs-lang-fr.json +106 -0
- package/src/langs/hfs-lang-it.json +2 -1
- package/src/listen.js +2 -2
- package/src/log.js +2 -4
- package/src/middlewares.js +12 -1
- package/src/misc.js +9 -2
- package/src/plugins.js +7 -2
- package/src/serveGuiFiles.js +6 -6
- package/src/update.js +44 -17
- package/src/util-files.js +13 -10
- package/src/vfs.js +27 -12
- package/src/watchLoad.js +4 -4
- package/admin/assets/index-ef68a7ab.js +0 -510
- package/frontend/assets/index-a3b0d6ac.js +0 -94
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{g as OF,c as UF}from"./index-4fe980c3.js";function gF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var dF={exports:{}};/*
|
|
2
2
|
* [js-sha512]{@link https://github.com/emn178/js-sha512}
|
|
3
3
|
*
|
|
4
4
|
* @version 0.8.0
|
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
6
|
* @copyright Chen, Yi-Cyuan 2014-2018
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/(function(iF){(function(){var hF="input is invalid type",eF="finalize already called",tF=typeof window=="object",w=tF?window:{};w.JS_SHA512_NO_WINDOW&&(tF=!1);var lF=!tF&&typeof self=="object",_F=!w.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;_F?w=SF:lF&&(w=self);var bF=!w.JS_SHA512_NO_COMMON_JS&&!0&&iF.exports,aF=!w.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",F="0123456789abcdef".split(""),wF=[-2147483648,8388608,32768,128],xF=[24,16,8,0],sF=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],fF=["hex","array","digest","arrayBuffer"],C=[];(w.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),aF&&(w.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});var vF=function(x,r){return function(e){return new v(r,!0).update(e)[x]()}},nF=function(x){var r=vF("hex",x);r.create=function(){return new v(x)},r.update=function(B){return r.create().update(B)};for(var e=0;e<fF.length;++e){var o=fF[e];r[o]=vF(o,x)}return r},dF=function(x,r){return function(e,o){return new rF(e,r,!0).update(o)[x]()}},oF=function(x){var r=dF("hex",x);r.create=function(B){return new rF(B,x)},r.update=function(B,l){return r.create(B).update(l)};for(var e=0;e<fF.length;++e){var o=fF[e];r[o]=dF(o,x)}return r};function v(x,r){r?(C[0]=C[1]=C[2]=C[3]=C[4]=C[5]=C[6]=C[7]=C[8]=C[9]=C[10]=C[11]=C[12]=C[13]=C[14]=C[15]=C[16]=C[17]=C[18]=C[19]=C[20]=C[21]=C[22]=C[23]=C[24]=C[25]=C[26]=C[27]=C[28]=C[29]=C[30]=C[31]=C[32]=0,this.blocks=C):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):x==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):x==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=x,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}v.prototype.update=function(x){if(this.finalized)throw new Error(eF);var r,e=typeof x;if(e!=="string"){if(e==="object"){if(x===null)throw new Error(hF);if(aF&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!aF||!ArrayBuffer.isView(x)))throw new Error(hF)}else throw new Error(hF);r=!0}for(var o,B=0,l,c=x.length,s=this.blocks;B<c;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=s[16]=s[17]=s[18]=s[19]=s[20]=s[21]=s[22]=s[23]=s[24]=s[25]=s[26]=s[27]=s[28]=s[29]=s[30]=s[31]=s[32]=0),r)for(l=this.start;B<c&&l<128;++B)s[l>>2]|=x[B]<<xF[l++&3];else for(l=this.start;B<c&&l<128;++B)o=x.charCodeAt(B),o<128?s[l>>2]|=o<<xF[l++&3]:o<2048?(s[l>>2]|=(192|o>>6)<<xF[l++&3],s[l>>2]|=(128|o&63)<<xF[l++&3]):o<55296||o>=57344?(s[l>>2]|=(224|o>>12)<<xF[l++&3],s[l>>2]|=(128|o>>6&63)<<xF[l++&3],s[l>>2]|=(128|o&63)<<xF[l++&3]):(o=65536+((o&1023)<<10|x.charCodeAt(++B)&1023),s[l>>2]|=(240|o>>18)<<xF[l++&3],s[l>>2]|=(128|o>>12&63)<<xF[l++&3],s[l>>2]|=(128|o>>6&63)<<xF[l++&3],s[l>>2]|=(128|o&63)<<xF[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=128?(this.block=s[32],this.start=l-128,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var x=this.blocks,r=this.lastByteIndex;x[32]=this.block,x[r>>2]|=wF[r&3],this.block=x[32],r>=112&&(this.hashed||this.hash(),x[0]=this.block,x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=x[16]=x[17]=x[18]=x[19]=x[20]=x[21]=x[22]=x[23]=x[24]=x[25]=x[26]=x[27]=x[28]=x[29]=x[30]=x[31]=x[32]=0),x[30]=this.hBytes<<3|this.bytes>>>29,x[31]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var x=this.h0h,r=this.h0l,e=this.h1h,o=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.blocks,A,z,P,H,I,h,t,i,a,CF,cF,DF,uF,pF,yF,AF,BF,Z,q,f,n,u,p,Q,FF;for(A=32;A<160;A+=2)f=y[A-30],n=y[A-29],z=(f>>>1|n<<31)^(f>>>8|n<<24)^f>>>7,P=(n>>>1|f<<31)^(n>>>8|f<<24)^(n>>>7|f<<25),f=y[A-4],n=y[A-3],H=(f>>>19|n<<13)^(n>>>29|f<<3)^f>>>6,I=(n>>>19|f<<13)^(f>>>29|n<<3)^(n>>>6|f<<26),f=y[A-32],n=y[A-31],u=y[A-14],p=y[A-13],h=(p&65535)+(n&65535)+(P&65535)+(I&65535),t=(p>>>16)+(n>>>16)+(P>>>16)+(I>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(z&65535)+(H&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(z>>>16)+(H>>>16)+(i>>>16),y[A]=a<<16|i&65535,y[A+1]=t<<16|h&65535;var J=x,M=r,g=e,R=o,j=B,N=l,T=c,K=s,m=E,V=D,W=d,k=_,Y=b,X=S,$=O,G=U;for(AF=g&j,BF=R&N,A=0;A<160;A+=8)z=(J>>>28|M<<4)^(M>>>2|J<<30)^(M>>>7|J<<25),P=(M>>>28|J<<4)^(J>>>2|M<<30)^(J>>>7|M<<25),H=(m>>>14|V<<18)^(m>>>18|V<<14)^(V>>>9|m<<23),I=(V>>>14|m<<18)^(V>>>18|m<<14)^(m>>>9|V<<23),CF=J&g,cF=M&R,Z=CF^J&j^AF,q=cF^M&N^BF,Q=m&W^~m&Y,FF=V&k^~V&X,f=y[A],n=y[A+1],u=sF[A],p=sF[A+1],h=(p&65535)+(n&65535)+(FF&65535)+(I&65535)+(G&65535),t=(p>>>16)+(n>>>16)+(FF>>>16)+(I>>>16)+(G>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+($&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+($>>>16)+(i>>>16),f=a<<16|i&65535,n=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(K&65535)+(n&65535),t=(K>>>16)+(n>>>16)+(h>>>16),i=(T&65535)+(f&65535)+(t>>>16),a=(T>>>16)+(f>>>16)+(i>>>16),$=a<<16|i&65535,G=t<<16|h&65535,h=(p&65535)+(n&65535),t=(p>>>16)+(n>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),T=a<<16|i&65535,K=t<<16|h&65535,z=(T>>>28|K<<4)^(K>>>2|T<<30)^(K>>>7|T<<25),P=(K>>>28|T<<4)^(T>>>2|K<<30)^(T>>>7|K<<25),H=($>>>14|G<<18)^($>>>18|G<<14)^(G>>>9|$<<23),I=(G>>>14|$<<18)^(G>>>18|$<<14)^($>>>9|G<<23),DF=T&J,uF=K&M,Z=DF^T&g^CF,q=uF^K&R^cF,Q=$&m^~$&W,FF=G&V^~G&k,f=y[A+2],n=y[A+3],u=sF[A+2],p=sF[A+3],h=(p&65535)+(n&65535)+(FF&65535)+(I&65535)+(X&65535),t=(p>>>16)+(n>>>16)+(FF>>>16)+(I>>>16)+(X>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(Y&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(Y>>>16)+(i>>>16),f=a<<16|i&65535,n=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(N&65535)+(n&65535),t=(N>>>16)+(n>>>16)+(h>>>16),i=(j&65535)+(f&65535)+(t>>>16),a=(j>>>16)+(f>>>16)+(i>>>16),Y=a<<16|i&65535,X=t<<16|h&65535,h=(p&65535)+(n&65535),t=(p>>>16)+(n>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),j=a<<16|i&65535,N=t<<16|h&65535,z=(j>>>28|N<<4)^(N>>>2|j<<30)^(N>>>7|j<<25),P=(N>>>28|j<<4)^(j>>>2|N<<30)^(j>>>7|N<<25),H=(Y>>>14|X<<18)^(Y>>>18|X<<14)^(X>>>9|Y<<23),I=(X>>>14|Y<<18)^(X>>>18|Y<<14)^(Y>>>9|X<<23),pF=j&T,yF=N&K,Z=pF^j&J^DF,q=yF^N&M^uF,Q=Y&$^~Y&m,FF=X&G^~X&V,f=y[A+4],n=y[A+5],u=sF[A+4],p=sF[A+5],h=(p&65535)+(n&65535)+(FF&65535)+(I&65535)+(k&65535),t=(p>>>16)+(n>>>16)+(FF>>>16)+(I>>>16)+(k>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(W&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(W>>>16)+(i>>>16),f=a<<16|i&65535,n=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(R&65535)+(n&65535),t=(R>>>16)+(n>>>16)+(h>>>16),i=(g&65535)+(f&65535)+(t>>>16),a=(g>>>16)+(f>>>16)+(i>>>16),W=a<<16|i&65535,k=t<<16|h&65535,h=(p&65535)+(n&65535),t=(p>>>16)+(n>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),g=a<<16|i&65535,R=t<<16|h&65535,z=(g>>>28|R<<4)^(R>>>2|g<<30)^(R>>>7|g<<25),P=(R>>>28|g<<4)^(g>>>2|R<<30)^(g>>>7|R<<25),H=(W>>>14|k<<18)^(W>>>18|k<<14)^(k>>>9|W<<23),I=(k>>>14|W<<18)^(k>>>18|W<<14)^(W>>>9|k<<23),AF=g&j,BF=R&N,Z=AF^g&T^pF,q=BF^R&K^yF,Q=W&Y^~W&$,FF=k&X^~k&G,f=y[A+6],n=y[A+7],u=sF[A+6],p=sF[A+7],h=(p&65535)+(n&65535)+(FF&65535)+(I&65535)+(V&65535),t=(p>>>16)+(n>>>16)+(FF>>>16)+(I>>>16)+(V>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(m&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(m>>>16)+(i>>>16),f=a<<16|i&65535,n=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(M&65535)+(n&65535),t=(M>>>16)+(n>>>16)+(h>>>16),i=(J&65535)+(f&65535)+(t>>>16),a=(J>>>16)+(f>>>16)+(i>>>16),m=a<<16|i&65535,V=t<<16|h&65535,h=(p&65535)+(n&65535),t=(p>>>16)+(n>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),J=a<<16|i&65535,M=t<<16|h&65535;h=(r&65535)+(M&65535),t=(r>>>16)+(M>>>16)+(h>>>16),i=(x&65535)+(J&65535)+(t>>>16),a=(x>>>16)+(J>>>16)+(i>>>16),this.h0h=a<<16|i&65535,this.h0l=t<<16|h&65535,h=(o&65535)+(R&65535),t=(o>>>16)+(R>>>16)+(h>>>16),i=(e&65535)+(g&65535)+(t>>>16),a=(e>>>16)+(g>>>16)+(i>>>16),this.h1h=a<<16|i&65535,this.h1l=t<<16|h&65535,h=(l&65535)+(N&65535),t=(l>>>16)+(N>>>16)+(h>>>16),i=(B&65535)+(j&65535)+(t>>>16),a=(B>>>16)+(j>>>16)+(i>>>16),this.h2h=a<<16|i&65535,this.h2l=t<<16|h&65535,h=(s&65535)+(K&65535),t=(s>>>16)+(K>>>16)+(h>>>16),i=(c&65535)+(T&65535)+(t>>>16),a=(c>>>16)+(T>>>16)+(i>>>16),this.h3h=a<<16|i&65535,this.h3l=t<<16|h&65535,h=(D&65535)+(V&65535),t=(D>>>16)+(V>>>16)+(h>>>16),i=(E&65535)+(m&65535)+(t>>>16),a=(E>>>16)+(m>>>16)+(i>>>16),this.h4h=a<<16|i&65535,this.h4l=t<<16|h&65535,h=(_&65535)+(k&65535),t=(_>>>16)+(k>>>16)+(h>>>16),i=(d&65535)+(W&65535)+(t>>>16),a=(d>>>16)+(W>>>16)+(i>>>16),this.h5h=a<<16|i&65535,this.h5l=t<<16|h&65535,h=(S&65535)+(X&65535),t=(S>>>16)+(X>>>16)+(h>>>16),i=(b&65535)+(Y&65535)+(t>>>16),a=(b>>>16)+(Y>>>16)+(i>>>16),this.h6h=a<<16|i&65535,this.h6l=t<<16|h&65535,h=(U&65535)+(G&65535),t=(U>>>16)+(G>>>16)+(h>>>16),i=(O&65535)+($&65535)+(t>>>16),a=(O>>>16)+($>>>16)+(i>>>16),this.h7h=a<<16|i&65535,this.h7l=t<<16|h&65535},v.prototype.hex=function(){this.finalize();var x=this.h0h,r=this.h0l,e=this.h1h,o=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.bits,A=F[x>>28&15]+F[x>>24&15]+F[x>>20&15]+F[x>>16&15]+F[x>>12&15]+F[x>>8&15]+F[x>>4&15]+F[x&15]+F[r>>28&15]+F[r>>24&15]+F[r>>20&15]+F[r>>16&15]+F[r>>12&15]+F[r>>8&15]+F[r>>4&15]+F[r&15]+F[e>>28&15]+F[e>>24&15]+F[e>>20&15]+F[e>>16&15]+F[e>>12&15]+F[e>>8&15]+F[e>>4&15]+F[e&15]+F[o>>28&15]+F[o>>24&15]+F[o>>20&15]+F[o>>16&15]+F[o>>12&15]+F[o>>8&15]+F[o>>4&15]+F[o&15]+F[B>>28&15]+F[B>>24&15]+F[B>>20&15]+F[B>>16&15]+F[B>>12&15]+F[B>>8&15]+F[B>>4&15]+F[B&15]+F[l>>28&15]+F[l>>24&15]+F[l>>20&15]+F[l>>16&15]+F[l>>12&15]+F[l>>8&15]+F[l>>4&15]+F[l&15]+F[c>>28&15]+F[c>>24&15]+F[c>>20&15]+F[c>>16&15]+F[c>>12&15]+F[c>>8&15]+F[c>>4&15]+F[c&15];return y>=256&&(A+=F[s>>28&15]+F[s>>24&15]+F[s>>20&15]+F[s>>16&15]+F[s>>12&15]+F[s>>8&15]+F[s>>4&15]+F[s&15]),y>=384&&(A+=F[E>>28&15]+F[E>>24&15]+F[E>>20&15]+F[E>>16&15]+F[E>>12&15]+F[E>>8&15]+F[E>>4&15]+F[E&15]+F[D>>28&15]+F[D>>24&15]+F[D>>20&15]+F[D>>16&15]+F[D>>12&15]+F[D>>8&15]+F[D>>4&15]+F[D&15]+F[d>>28&15]+F[d>>24&15]+F[d>>20&15]+F[d>>16&15]+F[d>>12&15]+F[d>>8&15]+F[d>>4&15]+F[d&15]+F[_>>28&15]+F[_>>24&15]+F[_>>20&15]+F[_>>16&15]+F[_>>12&15]+F[_>>8&15]+F[_>>4&15]+F[_&15]),y==512&&(A+=F[b>>28&15]+F[b>>24&15]+F[b>>20&15]+F[b>>16&15]+F[b>>12&15]+F[b>>8&15]+F[b>>4&15]+F[b&15]+F[S>>28&15]+F[S>>24&15]+F[S>>20&15]+F[S>>16&15]+F[S>>12&15]+F[S>>8&15]+F[S>>4&15]+F[S&15]+F[O>>28&15]+F[O>>24&15]+F[O>>20&15]+F[O>>16&15]+F[O>>12&15]+F[O>>8&15]+F[O>>4&15]+F[O&15]+F[U>>28&15]+F[U>>24&15]+F[U>>20&15]+F[U>>16&15]+F[U>>12&15]+F[U>>8&15]+F[U>>4&15]+F[U&15]),A},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var x=this.h0h,r=this.h0l,e=this.h1h,o=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.bits,A=[x>>24&255,x>>16&255,x>>8&255,x&255,r>>24&255,r>>16&255,r>>8&255,r&255,e>>24&255,e>>16&255,e>>8&255,e&255,o>>24&255,o>>16&255,o>>8&255,o&255,B>>24&255,B>>16&255,B>>8&255,B&255,l>>24&255,l>>16&255,l>>8&255,l&255,c>>24&255,c>>16&255,c>>8&255,c&255];return y>=256&&A.push(s>>24&255,s>>16&255,s>>8&255,s&255),y>=384&&A.push(E>>24&255,E>>16&255,E>>8&255,E&255,D>>24&255,D>>16&255,D>>8&255,D&255,d>>24&255,d>>16&255,d>>8&255,d&255,_>>24&255,_>>16&255,_>>8&255,_&255),y==512&&A.push(b>>24&255,b>>16&255,b>>8&255,b&255,S>>24&255,S>>16&255,S>>8&255,S&255,O>>24&255,O>>16&255,O>>8&255,O&255,U>>24&255,U>>16&255,U>>8&255,U&255),A},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var x=this.bits,r=new ArrayBuffer(x/8),e=new DataView(r);return e.setUint32(0,this.h0h),e.setUint32(4,this.h0l),e.setUint32(8,this.h1h),e.setUint32(12,this.h1l),e.setUint32(16,this.h2h),e.setUint32(20,this.h2l),e.setUint32(24,this.h3h),x>=256&&e.setUint32(28,this.h3l),x>=384&&(e.setUint32(32,this.h4h),e.setUint32(36,this.h4l),e.setUint32(40,this.h5h),e.setUint32(44,this.h5l)),x==512&&(e.setUint32(48,this.h6h),e.setUint32(52,this.h6l),e.setUint32(56,this.h7h),e.setUint32(60,this.h7l)),r},v.prototype.clone=function(){var x=new v(this.bits,!1);return this.copyTo(x),x},v.prototype.copyTo=function(x){var r=0,e=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(r=0;r<e.length;++r)x[e[r]]=this[e[r]];for(r=0;r<this.blocks.length;++r)x.blocks[r]=this.blocks[r]};function rF(x,r,e){var o,B=typeof x;if(B!=="string"){if(B==="object"){if(x===null)throw new Error(hF);if(aF&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!aF||!ArrayBuffer.isView(x)))throw new Error(hF)}else throw new Error(hF);o=!0}var l=x.length;if(!o){for(var c=[],l=x.length,s=0,E,D=0;D<l;++D)E=x.charCodeAt(D),E<128?c[s++]=E:E<2048?(c[s++]=192|E>>6,c[s++]=128|E&63):E<55296||E>=57344?(c[s++]=224|E>>12,c[s++]=128|E>>6&63,c[s++]=128|E&63):(E=65536+((E&1023)<<10|x.charCodeAt(++D)&1023),c[s++]=240|E>>18,c[s++]=128|E>>12&63,c[s++]=128|E>>6&63,c[s++]=128|E&63);x=c}x.length>128&&(x=new v(r,!0).update(x).array());for(var d=[],_=[],D=0;D<128;++D){var b=x[D]||0;d[D]=92^b,_[D]=54^b}v.call(this,r,e),this.update(_),this.oKeyPad=d,this.inner=!0,this.sharedMemory=e}rF.prototype=new v,rF.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var x=this.array();v.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(x),v.prototype.finalize.call(this)}},rF.prototype.clone=function(){var x=new rF([],this.bits,!1);this.copyTo(x),x.inner=this.inner;for(var r=0;r<this.oKeyPad.length;++r)x.oKeyPad[r]=this.oKeyPad[r];return x};var L=nF(512);L.sha512=L,L.sha384=nF(384),L.sha512_256=nF(256),L.sha512_224=nF(224),L.sha512.hmac=oF(512),L.sha384.hmac=oF(384),L.sha512_256.hmac=oF(256),L.sha512_224.hmac=oF(224),bF?iF.exports=L:(w.sha512=L.sha512,w.sha384=L.sha384,w.sha512_256=L.sha512_256,w.sha512_224=L.sha512_224)})()})(UF);const gF=EF,jF=OF({__proto__:null,default:gF},[EF]);export{jF as s};
|
|
8
|
+
*/(function(sF){(function(){var hF="input is invalid type",eF="finalize already called",tF=typeof window=="object",w=tF?window:{};w.JS_SHA512_NO_WINDOW&&(tF=!1);var lF=!tF&&typeof self=="object",bF=!w.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;bF?w=UF:lF&&(w=self);var wF=!w.JS_SHA512_NO_COMMON_JS&&!0&&sF.exports,aF=!w.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",F="0123456789abcdef".split(""),SF=[-2147483648,8388608,32768,128],xF=[24,16,8,0],iF=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],fF=["hex","array","digest","arrayBuffer"],C=[];(w.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),aF&&(w.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});var yF=function(x,r){return function(e){return new v(r,!0).update(e)[x]()}},oF=function(x){var r=yF("hex",x);r.create=function(){return new v(x)},r.update=function(B){return r.create().update(B)};for(var e=0;e<fF.length;++e){var n=fF[e];r[n]=yF(n,x)}return r},vF=function(x,r){return function(e,n){return new rF(e,r,!0).update(n)[x]()}},nF=function(x){var r=vF("hex",x);r.create=function(B){return new rF(B,x)},r.update=function(B,l){return r.create(B).update(l)};for(var e=0;e<fF.length;++e){var n=fF[e];r[n]=vF(n,x)}return r};function v(x,r){r?(C[0]=C[1]=C[2]=C[3]=C[4]=C[5]=C[6]=C[7]=C[8]=C[9]=C[10]=C[11]=C[12]=C[13]=C[14]=C[15]=C[16]=C[17]=C[18]=C[19]=C[20]=C[21]=C[22]=C[23]=C[24]=C[25]=C[26]=C[27]=C[28]=C[29]=C[30]=C[31]=C[32]=0,this.blocks=C):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):x==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):x==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=x,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}v.prototype.update=function(x){if(this.finalized)throw new Error(eF);var r,e=typeof x;if(e!=="string"){if(e==="object"){if(x===null)throw new Error(hF);if(aF&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!aF||!ArrayBuffer.isView(x)))throw new Error(hF)}else throw new Error(hF);r=!0}for(var n,B=0,l,c=x.length,s=this.blocks;B<c;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=s[16]=s[17]=s[18]=s[19]=s[20]=s[21]=s[22]=s[23]=s[24]=s[25]=s[26]=s[27]=s[28]=s[29]=s[30]=s[31]=s[32]=0),r)for(l=this.start;B<c&&l<128;++B)s[l>>2]|=x[B]<<xF[l++&3];else for(l=this.start;B<c&&l<128;++B)n=x.charCodeAt(B),n<128?s[l>>2]|=n<<xF[l++&3]:n<2048?(s[l>>2]|=(192|n>>6)<<xF[l++&3],s[l>>2]|=(128|n&63)<<xF[l++&3]):n<55296||n>=57344?(s[l>>2]|=(224|n>>12)<<xF[l++&3],s[l>>2]|=(128|n>>6&63)<<xF[l++&3],s[l>>2]|=(128|n&63)<<xF[l++&3]):(n=65536+((n&1023)<<10|x.charCodeAt(++B)&1023),s[l>>2]|=(240|n>>18)<<xF[l++&3],s[l>>2]|=(128|n>>12&63)<<xF[l++&3],s[l>>2]|=(128|n>>6&63)<<xF[l++&3],s[l>>2]|=(128|n&63)<<xF[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=128?(this.block=s[32],this.start=l-128,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var x=this.blocks,r=this.lastByteIndex;x[32]=this.block,x[r>>2]|=SF[r&3],this.block=x[32],r>=112&&(this.hashed||this.hash(),x[0]=this.block,x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=x[16]=x[17]=x[18]=x[19]=x[20]=x[21]=x[22]=x[23]=x[24]=x[25]=x[26]=x[27]=x[28]=x[29]=x[30]=x[31]=x[32]=0),x[30]=this.hBytes<<3|this.bytes>>>29,x[31]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var x=this.h0h,r=this.h0l,e=this.h1h,n=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.blocks,A,z,P,H,I,h,t,i,a,EF,CF,cF,DF,uF,pF,AF,BF,Z,q,f,o,u,p,Q,FF;for(A=32;A<160;A+=2)f=y[A-30],o=y[A-29],z=(f>>>1|o<<31)^(f>>>8|o<<24)^f>>>7,P=(o>>>1|f<<31)^(o>>>8|f<<24)^(o>>>7|f<<25),f=y[A-4],o=y[A-3],H=(f>>>19|o<<13)^(o>>>29|f<<3)^f>>>6,I=(o>>>19|f<<13)^(f>>>29|o<<3)^(o>>>6|f<<26),f=y[A-32],o=y[A-31],u=y[A-14],p=y[A-13],h=(p&65535)+(o&65535)+(P&65535)+(I&65535),t=(p>>>16)+(o>>>16)+(P>>>16)+(I>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(z&65535)+(H&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(z>>>16)+(H>>>16)+(i>>>16),y[A]=a<<16|i&65535,y[A+1]=t<<16|h&65535;var J=x,M=r,g=e,R=n,j=B,N=l,T=c,m=s,K=E,V=D,W=d,k=_,Y=b,X=S,$=O,G=U;for(AF=g&j,BF=R&N,A=0;A<160;A+=8)z=(J>>>28|M<<4)^(M>>>2|J<<30)^(M>>>7|J<<25),P=(M>>>28|J<<4)^(J>>>2|M<<30)^(J>>>7|M<<25),H=(K>>>14|V<<18)^(K>>>18|V<<14)^(V>>>9|K<<23),I=(V>>>14|K<<18)^(V>>>18|K<<14)^(K>>>9|V<<23),EF=J&g,CF=M&R,Z=EF^J&j^AF,q=CF^M&N^BF,Q=K&W^~K&Y,FF=V&k^~V&X,f=y[A],o=y[A+1],u=iF[A],p=iF[A+1],h=(p&65535)+(o&65535)+(FF&65535)+(I&65535)+(G&65535),t=(p>>>16)+(o>>>16)+(FF>>>16)+(I>>>16)+(G>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+($&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+($>>>16)+(i>>>16),f=a<<16|i&65535,o=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(m&65535)+(o&65535),t=(m>>>16)+(o>>>16)+(h>>>16),i=(T&65535)+(f&65535)+(t>>>16),a=(T>>>16)+(f>>>16)+(i>>>16),$=a<<16|i&65535,G=t<<16|h&65535,h=(p&65535)+(o&65535),t=(p>>>16)+(o>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),T=a<<16|i&65535,m=t<<16|h&65535,z=(T>>>28|m<<4)^(m>>>2|T<<30)^(m>>>7|T<<25),P=(m>>>28|T<<4)^(T>>>2|m<<30)^(T>>>7|m<<25),H=($>>>14|G<<18)^($>>>18|G<<14)^(G>>>9|$<<23),I=(G>>>14|$<<18)^(G>>>18|$<<14)^($>>>9|G<<23),cF=T&J,DF=m&M,Z=cF^T&g^EF,q=DF^m&R^CF,Q=$&K^~$&W,FF=G&V^~G&k,f=y[A+2],o=y[A+3],u=iF[A+2],p=iF[A+3],h=(p&65535)+(o&65535)+(FF&65535)+(I&65535)+(X&65535),t=(p>>>16)+(o>>>16)+(FF>>>16)+(I>>>16)+(X>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(Y&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(Y>>>16)+(i>>>16),f=a<<16|i&65535,o=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(N&65535)+(o&65535),t=(N>>>16)+(o>>>16)+(h>>>16),i=(j&65535)+(f&65535)+(t>>>16),a=(j>>>16)+(f>>>16)+(i>>>16),Y=a<<16|i&65535,X=t<<16|h&65535,h=(p&65535)+(o&65535),t=(p>>>16)+(o>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),j=a<<16|i&65535,N=t<<16|h&65535,z=(j>>>28|N<<4)^(N>>>2|j<<30)^(N>>>7|j<<25),P=(N>>>28|j<<4)^(j>>>2|N<<30)^(j>>>7|N<<25),H=(Y>>>14|X<<18)^(Y>>>18|X<<14)^(X>>>9|Y<<23),I=(X>>>14|Y<<18)^(X>>>18|Y<<14)^(Y>>>9|X<<23),uF=j&T,pF=N&m,Z=uF^j&J^cF,q=pF^N&M^DF,Q=Y&$^~Y&K,FF=X&G^~X&V,f=y[A+4],o=y[A+5],u=iF[A+4],p=iF[A+5],h=(p&65535)+(o&65535)+(FF&65535)+(I&65535)+(k&65535),t=(p>>>16)+(o>>>16)+(FF>>>16)+(I>>>16)+(k>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(W&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(W>>>16)+(i>>>16),f=a<<16|i&65535,o=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(R&65535)+(o&65535),t=(R>>>16)+(o>>>16)+(h>>>16),i=(g&65535)+(f&65535)+(t>>>16),a=(g>>>16)+(f>>>16)+(i>>>16),W=a<<16|i&65535,k=t<<16|h&65535,h=(p&65535)+(o&65535),t=(p>>>16)+(o>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),g=a<<16|i&65535,R=t<<16|h&65535,z=(g>>>28|R<<4)^(R>>>2|g<<30)^(R>>>7|g<<25),P=(R>>>28|g<<4)^(g>>>2|R<<30)^(g>>>7|R<<25),H=(W>>>14|k<<18)^(W>>>18|k<<14)^(k>>>9|W<<23),I=(k>>>14|W<<18)^(k>>>18|W<<14)^(W>>>9|k<<23),AF=g&j,BF=R&N,Z=AF^g&T^uF,q=BF^R&m^pF,Q=W&Y^~W&$,FF=k&X^~k&G,f=y[A+6],o=y[A+7],u=iF[A+6],p=iF[A+7],h=(p&65535)+(o&65535)+(FF&65535)+(I&65535)+(V&65535),t=(p>>>16)+(o>>>16)+(FF>>>16)+(I>>>16)+(V>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(Q&65535)+(H&65535)+(K&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(Q>>>16)+(H>>>16)+(K>>>16)+(i>>>16),f=a<<16|i&65535,o=t<<16|h&65535,h=(q&65535)+(P&65535),t=(q>>>16)+(P>>>16)+(h>>>16),i=(Z&65535)+(z&65535)+(t>>>16),a=(Z>>>16)+(z>>>16)+(i>>>16),u=a<<16|i&65535,p=t<<16|h&65535,h=(M&65535)+(o&65535),t=(M>>>16)+(o>>>16)+(h>>>16),i=(J&65535)+(f&65535)+(t>>>16),a=(J>>>16)+(f>>>16)+(i>>>16),K=a<<16|i&65535,V=t<<16|h&65535,h=(p&65535)+(o&65535),t=(p>>>16)+(o>>>16)+(h>>>16),i=(u&65535)+(f&65535)+(t>>>16),a=(u>>>16)+(f>>>16)+(i>>>16),J=a<<16|i&65535,M=t<<16|h&65535;h=(r&65535)+(M&65535),t=(r>>>16)+(M>>>16)+(h>>>16),i=(x&65535)+(J&65535)+(t>>>16),a=(x>>>16)+(J>>>16)+(i>>>16),this.h0h=a<<16|i&65535,this.h0l=t<<16|h&65535,h=(n&65535)+(R&65535),t=(n>>>16)+(R>>>16)+(h>>>16),i=(e&65535)+(g&65535)+(t>>>16),a=(e>>>16)+(g>>>16)+(i>>>16),this.h1h=a<<16|i&65535,this.h1l=t<<16|h&65535,h=(l&65535)+(N&65535),t=(l>>>16)+(N>>>16)+(h>>>16),i=(B&65535)+(j&65535)+(t>>>16),a=(B>>>16)+(j>>>16)+(i>>>16),this.h2h=a<<16|i&65535,this.h2l=t<<16|h&65535,h=(s&65535)+(m&65535),t=(s>>>16)+(m>>>16)+(h>>>16),i=(c&65535)+(T&65535)+(t>>>16),a=(c>>>16)+(T>>>16)+(i>>>16),this.h3h=a<<16|i&65535,this.h3l=t<<16|h&65535,h=(D&65535)+(V&65535),t=(D>>>16)+(V>>>16)+(h>>>16),i=(E&65535)+(K&65535)+(t>>>16),a=(E>>>16)+(K>>>16)+(i>>>16),this.h4h=a<<16|i&65535,this.h4l=t<<16|h&65535,h=(_&65535)+(k&65535),t=(_>>>16)+(k>>>16)+(h>>>16),i=(d&65535)+(W&65535)+(t>>>16),a=(d>>>16)+(W>>>16)+(i>>>16),this.h5h=a<<16|i&65535,this.h5l=t<<16|h&65535,h=(S&65535)+(X&65535),t=(S>>>16)+(X>>>16)+(h>>>16),i=(b&65535)+(Y&65535)+(t>>>16),a=(b>>>16)+(Y>>>16)+(i>>>16),this.h6h=a<<16|i&65535,this.h6l=t<<16|h&65535,h=(U&65535)+(G&65535),t=(U>>>16)+(G>>>16)+(h>>>16),i=(O&65535)+($&65535)+(t>>>16),a=(O>>>16)+($>>>16)+(i>>>16),this.h7h=a<<16|i&65535,this.h7l=t<<16|h&65535},v.prototype.hex=function(){this.finalize();var x=this.h0h,r=this.h0l,e=this.h1h,n=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.bits,A=F[x>>28&15]+F[x>>24&15]+F[x>>20&15]+F[x>>16&15]+F[x>>12&15]+F[x>>8&15]+F[x>>4&15]+F[x&15]+F[r>>28&15]+F[r>>24&15]+F[r>>20&15]+F[r>>16&15]+F[r>>12&15]+F[r>>8&15]+F[r>>4&15]+F[r&15]+F[e>>28&15]+F[e>>24&15]+F[e>>20&15]+F[e>>16&15]+F[e>>12&15]+F[e>>8&15]+F[e>>4&15]+F[e&15]+F[n>>28&15]+F[n>>24&15]+F[n>>20&15]+F[n>>16&15]+F[n>>12&15]+F[n>>8&15]+F[n>>4&15]+F[n&15]+F[B>>28&15]+F[B>>24&15]+F[B>>20&15]+F[B>>16&15]+F[B>>12&15]+F[B>>8&15]+F[B>>4&15]+F[B&15]+F[l>>28&15]+F[l>>24&15]+F[l>>20&15]+F[l>>16&15]+F[l>>12&15]+F[l>>8&15]+F[l>>4&15]+F[l&15]+F[c>>28&15]+F[c>>24&15]+F[c>>20&15]+F[c>>16&15]+F[c>>12&15]+F[c>>8&15]+F[c>>4&15]+F[c&15];return y>=256&&(A+=F[s>>28&15]+F[s>>24&15]+F[s>>20&15]+F[s>>16&15]+F[s>>12&15]+F[s>>8&15]+F[s>>4&15]+F[s&15]),y>=384&&(A+=F[E>>28&15]+F[E>>24&15]+F[E>>20&15]+F[E>>16&15]+F[E>>12&15]+F[E>>8&15]+F[E>>4&15]+F[E&15]+F[D>>28&15]+F[D>>24&15]+F[D>>20&15]+F[D>>16&15]+F[D>>12&15]+F[D>>8&15]+F[D>>4&15]+F[D&15]+F[d>>28&15]+F[d>>24&15]+F[d>>20&15]+F[d>>16&15]+F[d>>12&15]+F[d>>8&15]+F[d>>4&15]+F[d&15]+F[_>>28&15]+F[_>>24&15]+F[_>>20&15]+F[_>>16&15]+F[_>>12&15]+F[_>>8&15]+F[_>>4&15]+F[_&15]),y==512&&(A+=F[b>>28&15]+F[b>>24&15]+F[b>>20&15]+F[b>>16&15]+F[b>>12&15]+F[b>>8&15]+F[b>>4&15]+F[b&15]+F[S>>28&15]+F[S>>24&15]+F[S>>20&15]+F[S>>16&15]+F[S>>12&15]+F[S>>8&15]+F[S>>4&15]+F[S&15]+F[O>>28&15]+F[O>>24&15]+F[O>>20&15]+F[O>>16&15]+F[O>>12&15]+F[O>>8&15]+F[O>>4&15]+F[O&15]+F[U>>28&15]+F[U>>24&15]+F[U>>20&15]+F[U>>16&15]+F[U>>12&15]+F[U>>8&15]+F[U>>4&15]+F[U&15]),A},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var x=this.h0h,r=this.h0l,e=this.h1h,n=this.h1l,B=this.h2h,l=this.h2l,c=this.h3h,s=this.h3l,E=this.h4h,D=this.h4l,d=this.h5h,_=this.h5l,b=this.h6h,S=this.h6l,O=this.h7h,U=this.h7l,y=this.bits,A=[x>>24&255,x>>16&255,x>>8&255,x&255,r>>24&255,r>>16&255,r>>8&255,r&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,B>>24&255,B>>16&255,B>>8&255,B&255,l>>24&255,l>>16&255,l>>8&255,l&255,c>>24&255,c>>16&255,c>>8&255,c&255];return y>=256&&A.push(s>>24&255,s>>16&255,s>>8&255,s&255),y>=384&&A.push(E>>24&255,E>>16&255,E>>8&255,E&255,D>>24&255,D>>16&255,D>>8&255,D&255,d>>24&255,d>>16&255,d>>8&255,d&255,_>>24&255,_>>16&255,_>>8&255,_&255),y==512&&A.push(b>>24&255,b>>16&255,b>>8&255,b&255,S>>24&255,S>>16&255,S>>8&255,S&255,O>>24&255,O>>16&255,O>>8&255,O&255,U>>24&255,U>>16&255,U>>8&255,U&255),A},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var x=this.bits,r=new ArrayBuffer(x/8),e=new DataView(r);return e.setUint32(0,this.h0h),e.setUint32(4,this.h0l),e.setUint32(8,this.h1h),e.setUint32(12,this.h1l),e.setUint32(16,this.h2h),e.setUint32(20,this.h2l),e.setUint32(24,this.h3h),x>=256&&e.setUint32(28,this.h3l),x>=384&&(e.setUint32(32,this.h4h),e.setUint32(36,this.h4l),e.setUint32(40,this.h5h),e.setUint32(44,this.h5l)),x==512&&(e.setUint32(48,this.h6h),e.setUint32(52,this.h6l),e.setUint32(56,this.h7h),e.setUint32(60,this.h7l)),r},v.prototype.clone=function(){var x=new v(this.bits,!1);return this.copyTo(x),x},v.prototype.copyTo=function(x){var r=0,e=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(r=0;r<e.length;++r)x[e[r]]=this[e[r]];for(r=0;r<this.blocks.length;++r)x.blocks[r]=this.blocks[r]};function rF(x,r,e){var n,B=typeof x;if(B!=="string"){if(B==="object"){if(x===null)throw new Error(hF);if(aF&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!aF||!ArrayBuffer.isView(x)))throw new Error(hF)}else throw new Error(hF);n=!0}var l=x.length;if(!n){for(var c=[],l=x.length,s=0,E,D=0;D<l;++D)E=x.charCodeAt(D),E<128?c[s++]=E:E<2048?(c[s++]=192|E>>6,c[s++]=128|E&63):E<55296||E>=57344?(c[s++]=224|E>>12,c[s++]=128|E>>6&63,c[s++]=128|E&63):(E=65536+((E&1023)<<10|x.charCodeAt(++D)&1023),c[s++]=240|E>>18,c[s++]=128|E>>12&63,c[s++]=128|E>>6&63,c[s++]=128|E&63);x=c}x.length>128&&(x=new v(r,!0).update(x).array());for(var d=[],_=[],D=0;D<128;++D){var b=x[D]||0;d[D]=92^b,_[D]=54^b}v.call(this,r,e),this.update(_),this.oKeyPad=d,this.inner=!0,this.sharedMemory=e}rF.prototype=new v,rF.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var x=this.array();v.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(x),v.prototype.finalize.call(this)}},rF.prototype.clone=function(){var x=new rF([],this.bits,!1);this.copyTo(x),x.inner=this.inner;for(var r=0;r<this.oKeyPad.length;++r)x.oKeyPad[r]=this.oKeyPad[r];return x};var L=oF(512);L.sha512=L,L.sha384=oF(384),L.sha512_256=oF(256),L.sha512_224=oF(224),L.sha512.hmac=nF(512),L.sha384.hmac=nF(384),L.sha512_256.hmac=nF(256),L.sha512_224.hmac=nF(224),wF?sF.exports=L:(w.sha512=L.sha512,w.sha384=L.sha384,w.sha512_256=L.sha512_256,w.sha512_224=L.sha512_224)})()})(dF);var _F=dF.exports;const RF=OF(_F),NF=gF({__proto__:null,default:RF},[_F]);export{NF as s};
|
package/frontend/fontello.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: 'fontello';
|
|
3
|
-
src: url('fontello.woff2?
|
|
3
|
+
src: url('fontello.woff2?26713191') format('woff2');
|
|
4
4
|
font-weight: normal;
|
|
5
5
|
font-style: normal;
|
|
6
6
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
|
11
11
|
@font-face {
|
|
12
12
|
font-family: 'fontello';
|
|
13
|
-
src: url('../font/fontello.svg?
|
|
13
|
+
src: url('../font/fontello.svg?26713191#fontello') format('svg');
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
*/
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
.fa-key:before { content: '\e80c'; } /* '' */
|
|
65
65
|
.fa-trash:before { content: '\e80d'; } /* '' */
|
|
66
66
|
.fa-to_start:before { content: '\e80e'; } /* '' */
|
|
67
|
-
.fa-retweet:before { content: '\e80f'; } /* '' */
|
|
68
67
|
.fa-to_end:before { content: '\e810'; } /* '' */
|
|
69
68
|
.fa-picture:before { content: '\e811'; } /* '' */
|
|
70
69
|
.fa-camera:before { content: '\e812'; } /* '' */
|
|
@@ -72,6 +71,8 @@
|
|
|
72
71
|
.fa-logout:before { content: '\e814'; } /* '' */
|
|
73
72
|
.fa-video:before { content: '\e815'; } /* '' */
|
|
74
73
|
.fa-left:before { content: '\e816'; } /* '' */
|
|
74
|
+
.fa-lock:before { content: '\e817'; } /* '' */
|
|
75
|
+
.fa-reload:before { content: '\e818'; } /* '' */
|
|
75
76
|
.fa-spin6:before { content: '\e839'; } /* '' */
|
|
76
77
|
.fa-crown:before { content: '\e844'; } /* '' */
|
|
77
78
|
.fa-download:before { content: '\f02e'; } /* '' */
|
package/frontend/fontello.woff2
CHANGED
|
Binary file
|
package/frontend/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link href="/fontello.css" rel="stylesheet" />
|
|
7
7
|
|
|
8
8
|
<script>HFS={}</script>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-4fe980c3.js"></script>
|
|
10
10
|
<link rel="stylesheet" href="/assets/index-fe0f3d77.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
exports.description = "Counts downloads for each file, and displays the total in the list or file menu"
|
|
2
|
-
exports.version = 4 //
|
|
2
|
+
exports.version = 4.1 // fix: different cases and encodings with urls weren't properly counted
|
|
3
3
|
exports.apiRequired = 8
|
|
4
4
|
|
|
5
5
|
exports.config = {
|
|
@@ -15,7 +15,7 @@ exports.init = async api => {
|
|
|
15
15
|
const _ = api.require('lodash')
|
|
16
16
|
const yaml = api.require('yaml')
|
|
17
17
|
const { writeFile, readFile } = api.require('fs/promises')
|
|
18
|
-
const { debounceAsync } = api.require('./misc')
|
|
18
|
+
const { debounceAsync, newObj } = api.require('./misc')
|
|
19
19
|
|
|
20
20
|
const countersFile = 'counters.yaml'
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ exports.init = async api => {
|
|
|
29
29
|
try {
|
|
30
30
|
const data = await readFile(countersFile, 'utf8')
|
|
31
31
|
counters = yaml.parse(data) || {}
|
|
32
|
+
counters = newObj(counters, (v,k,setKey) => setKey(uri2key(k)) && v)
|
|
32
33
|
console.debug('counters loaded')
|
|
33
34
|
}
|
|
34
35
|
catch(err) {
|
|
@@ -43,15 +44,21 @@ exports.init = async api => {
|
|
|
43
44
|
middleware: (ctx) =>
|
|
44
45
|
() => { // execute after other middlewares are done
|
|
45
46
|
if (ctx.status >= 300 || !ctx.vfsNode) return
|
|
46
|
-
const
|
|
47
|
-
counters[
|
|
47
|
+
const k = uri2key(ctx.path)
|
|
48
|
+
counters[k] = counters[k] + 1 || 1
|
|
48
49
|
save()
|
|
49
50
|
},
|
|
50
51
|
onDirEntry: ({ entry, listUri }) => {
|
|
51
|
-
const
|
|
52
|
-
const n = counters[
|
|
52
|
+
const k = uri2key(listUri + entry.n)
|
|
53
|
+
const n = counters[k]
|
|
53
54
|
if (n)
|
|
54
55
|
entry.hits = n
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
59
|
+
|
|
60
|
+
function uri2key(uri) { // normalize uri to avoid having different keys for same file
|
|
61
|
+
try { uri = decodeURIComponent(uri) } // decodeURI doesn't support #=%23
|
|
62
|
+
catch {}
|
|
63
|
+
return uri.toLowerCase()
|
|
64
|
+
}
|
package/src/adminApis.js
CHANGED
|
@@ -50,6 +50,7 @@ const child_process_1 = require("child_process");
|
|
|
50
50
|
const util_1 = require("util");
|
|
51
51
|
const customHtml_1 = require("./customHtml");
|
|
52
52
|
const lodash_1 = __importDefault(require("lodash"));
|
|
53
|
+
const update_1 = require("./update");
|
|
53
54
|
exports.adminApis = {
|
|
54
55
|
...api_vfs_1.default,
|
|
55
56
|
...api_accounts_1.default,
|
|
@@ -72,6 +73,8 @@ exports.adminApis = {
|
|
|
72
73
|
return {};
|
|
73
74
|
},
|
|
74
75
|
get_config: config_1.getWholeConfig,
|
|
76
|
+
update: update_1.update,
|
|
77
|
+
check_update: () => (0, update_1.getUpdate)().then(x => lodash_1.default.pick(x, 'name')),
|
|
75
78
|
get_custom_html() {
|
|
76
79
|
return {
|
|
77
80
|
sections: Object.fromEntries([
|
|
@@ -84,6 +87,10 @@ exports.adminApis = {
|
|
|
84
87
|
await (0, customHtml_1.saveCustomHtml)(sections);
|
|
85
88
|
return {};
|
|
86
89
|
},
|
|
90
|
+
quit() {
|
|
91
|
+
setTimeout(() => process.exit());
|
|
92
|
+
return {};
|
|
93
|
+
},
|
|
87
94
|
async get_status() {
|
|
88
95
|
return {
|
|
89
96
|
started: const_1.HFS_STARTED,
|
|
@@ -93,6 +100,7 @@ exports.adminApis = {
|
|
|
93
100
|
compatibleApiVersion: const_1.COMPATIBLE_API_VERSION,
|
|
94
101
|
...await (0, listen_1.getServerStatus)(),
|
|
95
102
|
urls: (0, listen_1.getUrls)(),
|
|
103
|
+
update: !(0, update_1.updateSupported)() ? false : await (0, update_1.localUpdateAvailable)() ? 'local' : true,
|
|
96
104
|
proxyDetected: (0, middlewares_1.getProxyDetected)(),
|
|
97
105
|
frpDetected: exports.localhostAdmin.get() && !(0, middlewares_1.getProxyDetected)()
|
|
98
106
|
&& (0, connections_1.getConnections)().every(misc_1.isLocalHost)
|
package/src/api.vfs.js
CHANGED
|
@@ -46,7 +46,7 @@ const apis = {
|
|
|
46
46
|
|| undefined,
|
|
47
47
|
name: node === vfs_1.vfs ? undefined : (0, vfs_1.getNodeName)(node),
|
|
48
48
|
type: isDir ? 'folder' : undefined,
|
|
49
|
-
children: node.children && await Promise.all(node.children.map(
|
|
49
|
+
children: node.children && await Promise.all(node.children.map(child => recur((0, vfs_1.applyParentToChild)(child, node))))
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
},
|
|
@@ -78,7 +78,7 @@ const apis = {
|
|
|
78
78
|
const n = await urlToNodeOriginal(uri);
|
|
79
79
|
if (!n)
|
|
80
80
|
return new apiMiddleware_1.ApiError(const_1.HTTP_NOT_FOUND, 'path not found');
|
|
81
|
-
props = pickProps(props, ['name', 'source', 'masks', 'default', 'accept', ...vfs_1.PERM_KEYS]); // sanitize
|
|
81
|
+
props = pickProps(props, ['name', 'source', 'masks', 'default', 'accept', 'propagate', ...vfs_1.PERM_KEYS]); // sanitize
|
|
82
82
|
if (props.name && props.name !== (0, vfs_1.getNodeName)(n)) {
|
|
83
83
|
const parent = await urlToNodeOriginal((0, path_1.dirname)(uri));
|
|
84
84
|
if ((_a = parent === null || parent === void 0 ? void 0 : parent.children) === null || _a === void 0 ? void 0 : _a.find(x => (0, vfs_1.getNodeName)(x) === props.name))
|
|
@@ -146,7 +146,7 @@ const apis = {
|
|
|
146
146
|
async resolve_path({ path, closestFolder }) {
|
|
147
147
|
path = (0, path_1.resolve)(path);
|
|
148
148
|
if (closestFolder)
|
|
149
|
-
while (path && !await (0,
|
|
149
|
+
while (path && !await (0, misc_1.isDirectory)(path))
|
|
150
150
|
path = (0, path_1.dirname)(path);
|
|
151
151
|
return { path };
|
|
152
152
|
},
|
package/src/commands.js
CHANGED
|
@@ -12,18 +12,19 @@ const listen_1 = require("./listen");
|
|
|
12
12
|
const yaml_1 = __importDefault(require("yaml"));
|
|
13
13
|
const const_1 = require("./const");
|
|
14
14
|
const readline_1 = require("readline");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
if (!const_1.argv.updating)
|
|
16
|
+
try {
|
|
17
|
+
/*
|
|
18
|
+
is this try-block useful in case the stdin is unavailable?
|
|
19
|
+
Not sure, but someone reported a problem using nohup https://github.com/rejetto/hfs/issues/74
|
|
20
|
+
and I've found this example try-catching https://github.com/DefinitelyTyped/DefinitelyTyped/blob/dda83a906914489e09ca28afea12948529015d4a/types/node/readline.d.ts#L489
|
|
21
|
+
*/
|
|
22
|
+
(0, readline_1.createInterface)({ input: process.stdin }).on('line', parseCommandLine);
|
|
23
|
+
console.log(`HINT: type "help" for help`);
|
|
24
|
+
}
|
|
25
|
+
catch (_a) {
|
|
26
|
+
console.log("console commands not available");
|
|
27
|
+
}
|
|
27
28
|
function parseCommandLine(line) {
|
|
28
29
|
if (!line)
|
|
29
30
|
return;
|
|
@@ -89,7 +90,7 @@ const commands = {
|
|
|
89
90
|
(0, config_1.setConfig)({ [key]: v });
|
|
90
91
|
}
|
|
91
92
|
},
|
|
92
|
-
'
|
|
93
|
+
'get-config': {
|
|
93
94
|
params: '<key>',
|
|
94
95
|
cb(key) {
|
|
95
96
|
const conf = (0, config_1.getConfigDefinition)(key);
|
package/src/config.js
CHANGED
|
@@ -45,7 +45,7 @@ if (!(0, fs_1.existsSync)(path) && (0, fs_1.existsSync)(legacyPosition))
|
|
|
45
45
|
}
|
|
46
46
|
catch (_b) { }
|
|
47
47
|
}
|
|
48
|
-
const { save } = (0, watchLoad_1.watchLoad)(path,
|
|
48
|
+
const { save } = (0, watchLoad_1.watchLoad)(path, text => setConfig(yaml_1.default.parse(text) || {}, false), {
|
|
49
49
|
failedOnFirstAttempt() {
|
|
50
50
|
console.log("No config file, using defaults");
|
|
51
51
|
setConfig({}, false);
|
package/src/const.js
CHANGED
|
@@ -38,13 +38,13 @@ exports.DEV = process.env.DEV || exports.argv.dev ? 'DEV' : '';
|
|
|
38
38
|
exports.ORIGINAL_CWD = process.cwd();
|
|
39
39
|
exports.HFS_STARTED = new Date();
|
|
40
40
|
const PKG_PATH = (0, path_1.join)(__dirname, '..', 'package.json');
|
|
41
|
-
exports.BUILD_TIMESTAMP = "2023-
|
|
41
|
+
exports.BUILD_TIMESTAMP = "2023-05-08T12:26:16.202Z";
|
|
42
42
|
const pkg = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));
|
|
43
43
|
exports.VERSION = pkg.version;
|
|
44
44
|
exports.DAY = 86400000;
|
|
45
45
|
exports.SESSION_DURATION = Number(process.env.SESSION_DURATION) * 1000 || exports.DAY;
|
|
46
|
-
exports.API_VERSION = 8; // entry.uri + script.plugin
|
|
47
|
-
exports.COMPATIBLE_API_VERSION = 1; // while changes in the api are not breaking, this number stays the same, otherwise is made equal to API_VERSION
|
|
46
|
+
exports.API_VERSION = 8.1; // entry.uri + script.plugin + absolute frontend_*
|
|
47
|
+
exports.COMPATIBLE_API_VERSION = 1; // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
|
|
48
48
|
exports.HFS_REPO = 'rejetto/hfs';
|
|
49
49
|
exports.SPECIAL_URI = '/~/';
|
|
50
50
|
exports.FRONTEND_URI = exports.SPECIAL_URI + 'frontend/';
|
|
@@ -80,9 +80,12 @@ console.log(`License https://www.gnu.org/licenses/gpl-3.0.txt`);
|
|
|
80
80
|
console.log('started', exports.HFS_STARTED.toLocaleString(), exports.DEV);
|
|
81
81
|
console.log('version', exports.VERSION || '-');
|
|
82
82
|
console.log('build', exports.BUILD_TIMESTAMP || '-');
|
|
83
|
+
console.log('pid', process.pid);
|
|
84
|
+
console.debug('exec', process.execPath);
|
|
85
|
+
const winExe = exports.IS_WINDOWS && process.execPath.match(/(?<!node)\.exe$/i);
|
|
83
86
|
if (exports.argv.cwd)
|
|
84
87
|
process.chdir(exports.argv.cwd);
|
|
85
|
-
else if (!
|
|
88
|
+
else if (!winExe) { // still considering whether to use this behavior with Windows users, who may be less accustomed to it
|
|
86
89
|
const dir = (0, path_1.join)((0, os_1.homedir)(), '.hfs');
|
|
87
90
|
try {
|
|
88
91
|
(0, fs_1.mkdirSync)(dir);
|
package/src/customHtml.js
CHANGED
|
@@ -3,19 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.saveCustomHtml = exports.getSection = exports.customHtmlState = exports.customHtmlSections = void 0;
|
|
6
|
+
exports.saveCustomHtml = exports.getSection = exports.watchLoadCustomHtml = exports.newCustomHtmlState = exports.customHtmlState = exports.customHtmlSections = void 0;
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const events_1 = __importDefault(require("./events"));
|
|
9
9
|
const misc_1 = require("./misc");
|
|
10
10
|
const frontEndApis_1 = require("./frontEndApis");
|
|
11
11
|
const watchLoad_1 = require("./watchLoad");
|
|
12
|
-
const
|
|
12
|
+
const vanilla_1 = require("valtio/vanilla"); // without /vanilla we trigger react dependency
|
|
13
13
|
const promises_1 = require("fs/promises");
|
|
14
|
+
const plugins_1 = require("./plugins");
|
|
14
15
|
exports.customHtmlSections = ['top', 'bottom', 'beforeHeader', 'afterHeader',
|
|
15
16
|
'afterMenuBar', 'afterEntryName', 'afterList', 'beforeLogin'];
|
|
16
|
-
exports.customHtmlState = (0,
|
|
17
|
-
sections:
|
|
17
|
+
exports.customHtmlState = (0, vanilla_1.proxy)({
|
|
18
|
+
sections: newCustomHtmlState()
|
|
18
19
|
});
|
|
20
|
+
function newCustomHtmlState() {
|
|
21
|
+
return new Map();
|
|
22
|
+
}
|
|
23
|
+
exports.newCustomHtmlState = newCustomHtmlState;
|
|
19
24
|
const FILE = 'custom.html';
|
|
20
25
|
if (!(0, fs_1.existsSync)(FILE))
|
|
21
26
|
events_1.default.once('config ready', () => {
|
|
@@ -23,24 +28,29 @@ if (!(0, fs_1.existsSync)(FILE))
|
|
|
23
28
|
(0, fs_1.writeFileSync)(FILE, legacy);
|
|
24
29
|
frontEndApis_1.customHeader.set(''); // get rid of it
|
|
25
30
|
});
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
watchLoadCustomHtml(exports.customHtmlState.sections);
|
|
32
|
+
function watchLoadCustomHtml(state, folder = '') {
|
|
33
|
+
return (0, watchLoad_1.watchLoad)((0, misc_1.prefix)('', folder, '/') + FILE, data => {
|
|
34
|
+
var _a;
|
|
35
|
+
const re = /^\[(\w+)] *$/gm;
|
|
36
|
+
state.clear();
|
|
37
|
+
if (!data)
|
|
38
|
+
return;
|
|
39
|
+
let name = 'top';
|
|
40
|
+
do {
|
|
41
|
+
let last = re.lastIndex;
|
|
42
|
+
const match = re.exec(data);
|
|
43
|
+
const content = data.slice(last, !match ? undefined : re.lastIndex - (((_a = match === null || match === void 0 ? void 0 : match[0]) === null || _a === void 0 ? void 0 : _a.length) || 0)).trim();
|
|
44
|
+
if (content)
|
|
45
|
+
state.set(name, content);
|
|
46
|
+
name = match === null || match === void 0 ? void 0 : match[1];
|
|
47
|
+
} while (name);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports.watchLoadCustomHtml = watchLoadCustomHtml;
|
|
42
51
|
function getSection(name) {
|
|
43
|
-
return exports.customHtmlState.sections.get(name) || ''
|
|
52
|
+
return (exports.customHtmlState.sections.get(name) || '')
|
|
53
|
+
+ (0, plugins_1.mapPlugins)(pl => pl.getData().customHtml.get(name)).join('\n');
|
|
44
54
|
}
|
|
45
55
|
exports.getSection = getSection;
|
|
46
56
|
async function saveCustomHtml(sections) {
|
package/src/lang.js
CHANGED
|
@@ -60,6 +60,8 @@ let undo;
|
|
|
60
60
|
if (!v)
|
|
61
61
|
return forceLangData = undefined;
|
|
62
62
|
forceLangData = {}; // necessary to make the embedded language work
|
|
63
|
+
if (v === EMBEDDED_LANGUAGE)
|
|
64
|
+
return;
|
|
63
65
|
const res = (0, watchLoad_1.watchLoad)(code2file(v), data => {
|
|
64
66
|
forceLangData = { [v]: JSON.parse(data) };
|
|
65
67
|
});
|
package/src/langs/embedded.js
CHANGED
|
@@ -10,4 +10,5 @@ const hfs_lang_sr_json_1 = __importDefault(require("./hfs-lang-sr.json"));
|
|
|
10
10
|
const hfs_lang_ko_json_1 = __importDefault(require("./hfs-lang-ko.json"));
|
|
11
11
|
const hfs_lang_ms_json_1 = __importDefault(require("./hfs-lang-ms.json"));
|
|
12
12
|
const hfs_lang_zh_tw_json_1 = __importDefault(require("./hfs-lang-zh-tw.json"));
|
|
13
|
-
|
|
13
|
+
const hfs_lang_fr_json_1 = __importDefault(require("./hfs-lang-fr.json"));
|
|
14
|
+
exports.default = { it: hfs_lang_it_json_1.default, zh: hfs_lang_zh_json_1.default, ru: hfs_lang_ru_json_1.default, sr: hfs_lang_sr_json_1.default, ko: hfs_lang_ko_json_1.default, ms: hfs_lang_ms_json_1.default, 'zh-tw': hfs_lang_zh_tw_json_1.default, fr: hfs_lang_fr_json_1.default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Club Microtel Vernon",
|
|
3
|
+
"version": 1.0,
|
|
4
|
+
"hfs_version": "0.43.0",
|
|
5
|
+
"translate": {
|
|
6
|
+
"Select": "Selectionner",
|
|
7
|
+
"n_files": "{n,plural, one{# fichier} other{# fichiers}}",
|
|
8
|
+
"n_folders": "{n,plural, one{# dossier} other{# dossiers}}",
|
|
9
|
+
"filter_count": "{n,plural, one{# filtr\u00e9 ;} other{# filtr\u00e9s}}",
|
|
10
|
+
"select_count": "{n,plural, one{# selectionn\u00e9} other{# selectionn\u00e9s}}",
|
|
11
|
+
"filter_placeholder": "Saisissez ici pour filtrer la liste ci-dessous",
|
|
12
|
+
"Select some files": "S\u00e9lectionnez des fichiers",
|
|
13
|
+
"zip_checkboxes": "Utilisez les cases \u00e0 cocher pour s\u00e9lectionner les fichiers, vous pourrez alors utiliser ZIP \u00e0 nouveau",
|
|
14
|
+
"zip_tooltip_selected": "T\u00e9l\u00e9charger les \u00e9l\u00e9ments s\u00e9lectionn\u00e9s dans un seul fichier compress\u00e9 (.zip)",
|
|
15
|
+
"zip_tooltip_whole": "T\u00e9l\u00e9chargez la liste compl\u00e8te (non filtr\u00e9e) sous la forme d\u0027un seul fichier compress\u00e9 (.zip). Si vous s\u00e9lectionnez certains \u00e9l\u00e9ments, seuls ceux-ci seront t\u00e9l\u00e9charg\u00e9s",
|
|
16
|
+
"zip_confirm_search": "T\u00e9l\u00e9charger le r\u00e9sultat de la recherche dans un fichier compress\u00e9 (.zip)?",
|
|
17
|
+
"zip_confirm_folder": "T\u00e9l\u00e9charger le dossier COMPLET compress\u00e9 (.zip)?",
|
|
18
|
+
"select_tooltip": "La s\u00e9lection influe sur le comportement des boutons [ZIP] et [Supprimer] quand disponibles, mais vous pouvez aussi filtrer la liste",
|
|
19
|
+
"delete_hint": "Pour supprimer, cliquez en premier sur s\u00e9lectionner",
|
|
20
|
+
"delete_confirm": "Supprimer {n,plural, one{# \u00e9l\u00e9ment} other{# \u00e9l\u00e9ments}}?",
|
|
21
|
+
"delete_completed": "Suppression: {n} termin\u00e9(s)",
|
|
22
|
+
"delete_failed": ", {n,plural, one{# en \u00e9chec} other{# en \u00e9chec}}",
|
|
23
|
+
"delete_select": "S\u00e9lectionnez un ou plusieurs \u00e9l\u00e9ment(s) \u00e0 supprimer",
|
|
24
|
+
"Delete": "Supprimer",
|
|
25
|
+
"Options": "Options",
|
|
26
|
+
"Search": "Recherche",
|
|
27
|
+
"Zip": "ZIP",
|
|
28
|
+
"search_msg": "Rechercher dans ce dossier et ses sous-dossiers",
|
|
29
|
+
"Searching": "Recherche",
|
|
30
|
+
"Searched": "Recherche termin\u00e9e",
|
|
31
|
+
"Clear search": "Effacer la recherche",
|
|
32
|
+
"Interrupted": "Interrompu",
|
|
33
|
+
"stopped_before": "Chargement annul\u00e9",
|
|
34
|
+
"empty_list": "Liste vide",
|
|
35
|
+
"filter_none": "Aucun filtre",
|
|
36
|
+
"Admin-panel": "Page Administration",
|
|
37
|
+
"Login": "Connexion",
|
|
38
|
+
"Username": "Utilisateur",
|
|
39
|
+
"Password": "Mot de Passe",
|
|
40
|
+
"login_untrusted": "Connexion annul\u00e9e: probl\u00e8me de certificat du serveur",
|
|
41
|
+
"login_bad_credentials": "Identifiant ou mot de passe invalide",
|
|
42
|
+
"login_bad_cookies": "Probl\u00e8me de cookies : \u00e9chec de la connexion",
|
|
43
|
+
"User panel": "Connexion Utilisateur",
|
|
44
|
+
"Change password": "Changer le mot de passe",
|
|
45
|
+
"enter_pass": "Entrez un nouveau mot de passe",
|
|
46
|
+
"enter_pass2": "Confirmez le nouveau mot de passe",
|
|
47
|
+
"pass2_mismatch": "Le second mot de passe ne correspond pas au premier : \u00e9chec de la connexion",
|
|
48
|
+
"password_changed": "Mot de passe chang\u00e9",
|
|
49
|
+
"Logout": "D\u00e9connexion",
|
|
50
|
+
"connection error": "Erreur de connexion",
|
|
51
|
+
"Full timestamp:": "Horodatage complet:",
|
|
52
|
+
"Search was interrupted": "Recherche interrompue",
|
|
53
|
+
"Stop list": "Arr\u00eater le chargement de la liste",
|
|
54
|
+
"upload_starting": "Votre t\u00e9l\u00e9-chargement devrait commencer maintenant",
|
|
55
|
+
"wrong_account": "Aucun acc\u00e8s d\u00e9fini pour ce compte, essayez avec un autre compte",
|
|
56
|
+
"no_upload_here": "Pas de permission de t\u00e9l\u00e9-versement pour ce dossier",
|
|
57
|
+
"Create folder": "Cr\u00e9ez un dossier",
|
|
58
|
+
"Pick files": "Choisissez les fichiers",
|
|
59
|
+
"Pick folder": "Choisissez un dossier",
|
|
60
|
+
"send_files": "Envoyer {n,plural,one{# fichier} other{# fichiers}}, {size}",
|
|
61
|
+
"Clear": "Effacer",
|
|
62
|
+
"failed_upload": "Impossible de transf\u00e9rer {name}",
|
|
63
|
+
"confirm_resume": "Reprendre le t\u00e9l\u00e9-versement?",
|
|
64
|
+
"file too large": "Fichier trop gros",
|
|
65
|
+
"Enter folder name": "Saisissez le nom du dossier",
|
|
66
|
+
"Successfully created": "Cr\u00e9\u00e9 avec succ\u00E8s",
|
|
67
|
+
"enter_folder": "Saisissez le dossier",
|
|
68
|
+
"folder_exists": "Un dossier avec le m\u00eame nom \u00e9xiste d\u00e9j\u00e0",
|
|
69
|
+
"Sort by": "Trier par",
|
|
70
|
+
"name": "Nom",
|
|
71
|
+
"extension": "Extension",
|
|
72
|
+
"size": "Taille",
|
|
73
|
+
"time": "Heure",
|
|
74
|
+
"Invert order": "Inverser le tri",
|
|
75
|
+
"Folders first": "Dossiers en premier",
|
|
76
|
+
"Numeric names": "Noms num\u00E9riques",
|
|
77
|
+
"theme:": "Th\u00E8me:",
|
|
78
|
+
"auto": "Auto",
|
|
79
|
+
"light": "Clair",
|
|
80
|
+
"dark": "Sombre",
|
|
81
|
+
"parent folder": "Dossier parent",
|
|
82
|
+
"home": "Dossier racine",
|
|
83
|
+
"Continue": "Continuer",
|
|
84
|
+
"Confirm": "Confirmer",
|
|
85
|
+
"Don't": "Annuler",
|
|
86
|
+
"Warning": "Avertissement",
|
|
87
|
+
"Error": "Erreur",
|
|
88
|
+
"Info": "Info",
|
|
89
|
+
"Unauthorized": "Non autoris\u00e9",
|
|
90
|
+
"Forbidden": "Interdit",
|
|
91
|
+
"Not found": "Non trouv\u00e9",
|
|
92
|
+
"Server error": "Erreur du serveur",
|
|
93
|
+
"Upload": "Envoyer",
|
|
94
|
+
"upload_concluded": "Envoi termin\u00e9:",
|
|
95
|
+
"upload_finished": "{n} termin\u00e9(s) ({size})",
|
|
96
|
+
"upload_errors": "{n} \u00e9chou\u00e9s",
|
|
97
|
+
"upload_file_rejected": "Certains fichiers ont \u00e9t\u00e9 refus\u00e9s",
|
|
98
|
+
"download counter": "Compteur de t\u00e9l\u00e9chargements",
|
|
99
|
+
"File menu": "Menu du fichier",
|
|
100
|
+
"Folder menu": "Menu du dossier",
|
|
101
|
+
"Name": "Nom",
|
|
102
|
+
"file_open": "Ouvrir",
|
|
103
|
+
"Download": "T\u00e9l\u00e9charger",
|
|
104
|
+
"Missing permission": "Permission manquante"
|
|
105
|
+
}
|
|
106
|
+
}
|
package/src/listen.js
CHANGED
|
@@ -60,7 +60,7 @@ exports.portCfg.sub(async (port) => {
|
|
|
60
60
|
return;
|
|
61
61
|
httpSrv.on('connection', connections_1.newConnection);
|
|
62
62
|
printUrls(port, 'http');
|
|
63
|
-
if (openBrowserAtStart.get())
|
|
63
|
+
if (openBrowserAtStart.get() && !const_1.argv.updated)
|
|
64
64
|
openAdmin();
|
|
65
65
|
});
|
|
66
66
|
function openAdmin() {
|
|
@@ -126,7 +126,7 @@ for (const cfg of httpsNeeds) {
|
|
|
126
126
|
unwatch = (0, watchLoad_1.watchLoad)(v, data => {
|
|
127
127
|
httpsOptions[k] = data;
|
|
128
128
|
considerHttps();
|
|
129
|
-
}).unwatch;
|
|
129
|
+
}, { immediateFirst: true }).unwatch;
|
|
130
130
|
await considerHttps();
|
|
131
131
|
});
|
|
132
132
|
}
|