hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01897e23255d52f26ff1da0bdf17adf350614702 | 73,919 | js | JavaScript | node_modules/troika-three-text/dist/troika-three-text.umd.min.js | mgavillo/personnal_website | 3f9c906244ab92e4d7fcede8c4d901a7e123c1d3 | [
"MIT"
] | null | null | null | node_modules/troika-three-text/dist/troika-three-text.umd.min.js | mgavillo/personnal_website | 3f9c906244ab92e4d7fcede8c4d901a7e123c1d3 | [
"MIT"
] | null | null | null | node_modules/troika-three-text/dist/troika-three-text.umd.min.js | mgavillo/personnal_website | 3f9c906244ab92e4d7fcede8c4d901a7e123c1d3 | [
"MIT"
] | null | null | null | /*
Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
(https://github.com/101arrowz/fflate) for use in Troika text rendering.
Original licenses apply:
- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
*/
'use strict';(function(F,A){"object"===typeof exports&&"undefined"!==typeof module?A(exports,require("three"),require("troika-worker-utils"),require("troika-three-utils")):"function"===typeof define&&define.amd?define(["exports","three","troika-worker-utils","troika-three-utils"],A):(F=F||self,A(F.troika_three_text={},F.THREE,F.troika_worker_utils,F.troika_three_utils))})(this,function(F,A,S,ha){function ia(n,f){ja=!0;n=pa({},n);n.font=va(n.font||N.defaultFontURL);n.text=""+n.text;n.sdfGlyphSize=
n.sdfGlyphSize||N.sdfGlyphSize;if(null!=n.colorRanges){var u={};for(c in n.colorRanges)if(n.colorRanges.hasOwnProperty(c)){var y=n.colorRanges[c];"number"!==typeof y&&(y=wa.set(y).getHex());u[c]=y}n.colorRanges=u}Object.freeze(n);u=N.textureWidth;var b=N.sdfExponent,a=n.sdfGlyphSize;var c=n.font+"@"+a;var d=qa[c];d||(d=qa[c]={sdfTexture:new A.DataTexture(new Uint8Array(a*u),u,a,A.LuminanceFormat,void 0,void 0,void 0,void 0,A.LinearFilter,A.LinearFilter)},d.sdfTexture.font=n.font);xa(n).then(function(c){c.newGlyphSDFs&&
(c.newGlyphSDFs.forEach(function(b){var c=b.textureData,e=b.atlasIndex;for(b=d.sdfTexture.image;b.data.length<(e+1)*a*a;){var g=new Uint8Array(2*b.data.length);g.set(b.data);b.data=g;b.height*=2}g=b.width/a;e=b.width*a*Math.floor(e/g)+e%g*a;for(g=0;g<a;g++)for(var f=g*a,v=e+g*b.width,q=0;q<a;q++)b.data[v+q]=c[f+q]}),d.sdfTexture.needsUpdate=!0);f(Object.freeze({parameters:n,sdfTexture:d.sdfTexture,sdfGlyphSize:a,sdfExponent:b,glyphBounds:c.glyphBounds,glyphAtlasIndices:c.glyphAtlasIndices,glyphColors:c.glyphColors,
caretPositions:c.caretPositions,caretHeight:c.caretHeight,chunkedBounds:c.chunkedBounds,ascender:c.ascender,descender:c.descender,lineHeight:c.lineHeight,topBaseline:c.topBaseline,blockBounds:c.blockBounds,visibleBounds:c.visibleBounds,timings:c.timings,get totalBounds(){console.log("totalBounds deprecated, use blockBounds instead");return c.blockBounds},get totalBlockSize(){console.log("totalBlockSize deprecated, use blockBounds instead");var a=c.blockBounds;return[a[2]-a[0],a[3]-a[1]]}}))})}function pa(n,
f){for(var u in f)f.hasOwnProperty(u)&&(n[u]=f[u]);return n}function va(n){X||(X="undefined"===typeof document?{}:document.createElement("a"));X.href=n;return X.href}function ra(n){n=ha.createDerivedMaterial(n,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new A.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new A.Vector4(0,0,0,0)},uTroikaClipRect:{value:new A.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},
uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new A.Vector2},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new A.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new A.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",
vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerGlyph = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerGlyph * vec2(\n mod(aTroikaGlyphIndex, txCols),\n floor(aTroikaGlyphIndex / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerGlyph);\n",
fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of encoding in SDFGenerator.js\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n return texture2D(uTroikaSDFTexture, textureUV).r;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",
fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat distance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(distance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n distance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",
customRewriter:function(f){var n=f.vertexShader;f=f.fragmentShader;var y=/\buniform\s+vec3\s+diffuse\b/;y.test(f)&&(f=f.replace(y,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),y.test(n)||(n=n.replace(ha.voidMainRegExp,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n")));return{vertexShader:n,fragmentShader:f}}});n.transparent=!0;Object.defineProperties(n,{isTroikaTextMaterial:{value:!0},shadowSide:{get:function(){return this.side},
set:function(){}}});return n}function ya(n){var f=sa.get(n);if(!f){var u=n.caretPositions,y=n.caretHeight;f=new Map;for(var b=0;b<u.length;b+=3){var a=u[b+2],c=f.get(a);c||f.set(a,c=[]);c.push({x:u[b],y:a,height:y,charIndex:b/3});b+3>=u.length&&c.push({x:u[b+1],y:a,height:y,charIndex:b/3+1})}}sa.set(n,f);return f}var V=S.defineWorkerModule({name:"Typr Font Parser",dependencies:[function(){return"undefined"==typeof window&&(self.window=self),function(n){var f={parse:function(b){var a=f._bin;b=new Uint8Array(b);
if("ttcf"==a.readASCII(b,0,4)){var c=4;a.readUshort(b,c);c+=2;a.readUshort(b,c);c+=2;var d=a.readUint(b,c);c+=4;for(var e=[],g=0;g<d;g++){var h=a.readUint(b,c);c+=4;e.push(f._readFont(b,h))}return e}return[f._readFont(b,0)]},_readFont:function(b,a){var c=f._bin,d=a;c.readFixed(b,a);a+=4;var e=c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;var g="cmap;head;hhea;maxp;hmtx;name;OS/2;post;loca;glyf;kern;CFF ;GPOS;GSUB;SVG ".split(";");d={_data:b,_offset:d};
for(var h={},k=0;k<e;k++){var l=c.readASCII(b,a,4);a+=4;c.readUint(b,a);a+=4;var m=c.readUint(b,a);a+=4;var v=c.readUint(b,a);a+=4;h[l]={offset:m,length:v}}for(k=0;k<g.length;k++)a=g[k],h[a]&&(d[a.trim()]=f[a.trim()].parse(b,h[a].offset,h[a].length,d));return d},_tabOffset:function(b,a,c){var d=f._bin,e=d.readUshort(b,c+4);c+=12;for(var g=0;g<e;g++){var h=d.readASCII(b,c,4);c+=4;d.readUint(b,c);c+=4;var k=d.readUint(b,c);c+=4;d.readUint(b,c);if(c+=4,h==a)return k}return 0}};f._bin={readFixed:function(b,
a){return(b[a]<<8|b[a+1])+(b[a+2]<<8|b[a+3])/65540},readF2dot14:function(b,a){return f._bin.readShort(b,a)/16384},readInt:function(b,a){var c=f._bin.t.uint8;return c[0]=b[a+3],c[1]=b[a+2],c[2]=b[a+1],c[3]=b[a],f._bin.t.int32[0]},readInt8:function(b,a){return f._bin.t.uint8[0]=b[a],f._bin.t.int8[0]},readShort:function(b,a){var c=f._bin.t.uint8;return c[1]=b[a],c[0]=b[a+1],f._bin.t.int16[0]},readUshort:function(b,a){return b[a]<<8|b[a+1]},readUshorts:function(b,a,c){for(var d=[],e=0;e<c;e++)d.push(f._bin.readUshort(b,
a+2*e));return d},readUint:function(b,a){var c=f._bin.t.uint8;return c[3]=b[a],c[2]=b[a+1],c[1]=b[a+2],c[0]=b[a+3],f._bin.t.uint32[0]},readUint64:function(b,a){return 4294967296*f._bin.readUint(b,a)+f._bin.readUint(b,a+4)},readASCII:function(b,a,c){for(var d="",e=0;e<c;e++)d+=String.fromCharCode(b[a+e]);return d},readUnicode:function(b,a,c){for(var d="",e=0;e<c;e++){var g=b[a++]<<8|b[a++];d+=String.fromCharCode(g)}return d},_tdec:"undefined"!=typeof window&&window.TextDecoder?new window.TextDecoder:
null,readUTF8:function(b,a,c){var d=f._bin._tdec;return d&&0==a&&c==b.length?d.decode(b):f._bin.readASCII(b,a,c)},readBytes:function(b,a,c){for(var d=[],e=0;e<c;e++)d.push(b[a+e]);return d},readASCIIArray:function(b,a,c){for(var d=[],e=0;e<c;e++)d.push(String.fromCharCode(b[a+e]));return d}};f._bin.t={buff:new ArrayBuffer(8)};f._bin.t.int8=new Int8Array(f._bin.t.buff);f._bin.t.uint8=new Uint8Array(f._bin.t.buff);f._bin.t.int16=new Int16Array(f._bin.t.buff);f._bin.t.uint16=new Uint16Array(f._bin.t.buff);
f._bin.t.int32=new Int32Array(f._bin.t.buff);f._bin.t.uint32=new Uint32Array(f._bin.t.buff);f._lctf={};f._lctf.parse=function(b,a,c,d,e){var g=f._bin;c={};d=a;g.readFixed(b,a);a+=4;var h=g.readUshort(b,a);a+=2;var k=g.readUshort(b,a);a=g.readUshort(b,a+2);return c.scriptList=f._lctf.readScriptList(b,d+h),c.featureList=f._lctf.readFeatureList(b,d+k),c.lookupList=f._lctf.readLookupList(b,d+a,e),c};f._lctf.readLookupList=function(b,a,c){var d=f._bin,e=a,g=[],h=d.readUshort(b,a);a+=2;for(var k=0;k<h;k++){var l=
d.readUshort(b,a);a+=2;l=f._lctf.readLookupTable(b,e+l,c);g.push(l)}return g};f._lctf.readLookupTable=function(b,a,c){var d=f._bin,e=a,g={tabs:[]};g.ltype=d.readUshort(b,a);a+=2;g.flag=d.readUshort(b,a);a+=2;var h=d.readUshort(b,a);a+=2;for(var k=g.ltype,l=0;l<h;l++){var m=d.readUshort(b,a);a+=2;m=c(b,k,e+m,g);g.tabs.push(m)}return g};f._lctf.numOfOnes=function(b){for(var a=0,c=0;32>c;c++)0!=(b>>>c&1)&&a++;return a};f._lctf.readClassDef=function(b,a){var c=f._bin,d=[],e=c.readUshort(b,a);if(a+=2,
1==e){var g=c.readUshort(b,a);a+=2;var h=c.readUshort(b,a);a+=2;for(var k=0;k<h;k++)d.push(g+k),d.push(g+k),d.push(c.readUshort(b,a)),a+=2}if(2==e)for(e=c.readUshort(b,a),a+=2,k=0;k<e;k++)d.push(c.readUshort(b,a)),a+=2,d.push(c.readUshort(b,a)),a+=2,d.push(c.readUshort(b,a)),a+=2;return d};f._lctf.getInterval=function(b,a){for(var c=0;c<b.length;c+=3){var d=b[c],e=b[c+1];b[c+2];if(d<=a&&a<=e)return c}return-1};f._lctf.readCoverage=function(b,a){var c=f._bin,d={};d.fmt=c.readUshort(b,a);a+=2;var e=
c.readUshort(b,a);return a+=2,1==d.fmt&&(d.tab=c.readUshorts(b,a,e)),2==d.fmt&&(d.tab=c.readUshorts(b,a,3*e)),d};f._lctf.coverageIndex=function(b,a){var c=b.tab;return 1==b.fmt?c.indexOf(a):2==b.fmt&&(b=f._lctf.getInterval(c,a),-1!=b)?c[b+2]+(a-c[b]):-1};f._lctf.readFeatureList=function(b,a){var c=f._bin,d=a,e=[],g=c.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=c.readASCII(b,a,4);a+=4;var l=c.readUshort(b,a);a+=2;l=f._lctf.readFeatureTable(b,d+l);l.tag=k.trim();e.push(l)}return e};f._lctf.readFeatureTable=
function(b,a){var c=f._bin,d=a,e={},g=c.readUshort(b,a);a+=2;0<g&&(e.featureParams=d+g);d=c.readUshort(b,a);a+=2;e.tab=[];for(g=0;g<d;g++)e.tab.push(c.readUshort(b,a+2*g));return e};f._lctf.readScriptList=function(b,a){var c=f._bin,d=a,e={},g=c.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=c.readASCII(b,a,4);a+=4;var l=c.readUshort(b,a);a+=2;e[k.trim()]=f._lctf.readScriptTable(b,d+l)}return e};f._lctf.readScriptTable=function(b,a){var c=f._bin,d=a,e={},g=c.readUshort(b,a);a+=2;e.default=f._lctf.readLangSysTable(b,
d+g);g=c.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=c.readASCII(b,a,4);a+=4;var l=c.readUshort(b,a);a+=2;e[k.trim()]=f._lctf.readLangSysTable(b,d+l)}return e};f._lctf.readLangSysTable=function(b,a){var c=f._bin,d={};c.readUshort(b,a);a+=2;d.reqFeature=c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);return a+=2,d.features=c.readUshorts(b,a,e),d};f.CFF={};f.CFF.parse=function(b,a,c){var d=f._bin;(b=new Uint8Array(b.buffer,a,c))[a=0];b[++a];b[++a];b[++a];a++;var e=[];a=f.CFF.readIndex(b,a,e);var g=
[];for(c=0;c<e.length-1;c++)g.push(d.readASCII(b,a+e[c],e[c+1]-e[c]));a+=e[e.length-1];e=[];a=f.CFF.readIndex(b,a,e);g=[];for(c=0;c<e.length-1;c++)g.push(f.CFF.readDict(b,a+e[c],a+e[c+1]));a+=e[e.length-1];e=g[0];var h=[];a=f.CFF.readIndex(b,a,h);g=[];for(c=0;c<h.length-1;c++)g.push(d.readASCII(b,a+h[c],h[c+1]-h[c]));if(a+=h[h.length-1],f.CFF.readSubrs(b,a,e),e.CharStrings){a=e.CharStrings;h=[];a=f.CFF.readIndex(b,a,h);var k=[];for(c=0;c<h.length-1;c++)k.push(d.readBytes(b,a+h[c],h[c+1]-h[c]));e.CharStrings=
k}if(e.ROS){a=e.FDArray;h=[];a=f.CFF.readIndex(b,a,h);e.FDArray=[];for(c=0;c<h.length-1;c++)k=f.CFF.readDict(b,a+h[c],a+h[c+1]),f.CFF._readFDict(b,k,g),e.FDArray.push(k);a=e.FDSelect;e.FDSelect=[];c=b[a];if(a++,3!=c)throw c;h=d.readUshort(b,a);a+=2;for(c=0;c<h+1;c++)e.FDSelect.push(d.readUshort(b,a),b[a+2]),a+=3}return e.Encoding&&(e.Encoding=f.CFF.readEncoding(b,e.Encoding,e.CharStrings.length)),e.charset&&(e.charset=f.CFF.readCharset(b,e.charset,e.CharStrings.length)),f.CFF._readFDict(b,e,g),e};
f.CFF._readFDict=function(b,a,c){var d,e;for(e in a.Private&&(d=a.Private[1],a.Private=f.CFF.readDict(b,d,d+a.Private[0]),a.Private.Subrs&&f.CFF.readSubrs(b,d+a.Private.Subrs,a.Private)),a)-1!="FamilyName FontName FullName Notice version Copyright".split(" ").indexOf(e)&&(a[e]=c[a[e]-426+35])};f.CFF.readSubrs=function(b,a,c){var d=f._bin,e=[];a=f.CFF.readIndex(b,a,e);var g=e.length;c.Bias=1240>g?107:33900>g?1131:32768;c.Subrs=[];for(g=0;g<e.length-1;g++)c.Subrs.push(d.readBytes(b,a+e[g],e[g+1]-e[g]))};
f.CFF.tableSE=[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,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,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,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,
116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0];f.CFF.glyphByUnicode=function(b,a){for(var c=0;c<b.charset.length;c++)if(b.charset[c]==a)return c;return-1};f.CFF.glyphBySE=function(b,a){return 0>a||255<a?-1:f.CFF.glyphByUnicode(b,f.CFF.tableSE[a])};f.CFF.readEncoding=function(b,a,c){f._bin;c=[".notdef"];var d=b[a];if(a++,0!=d)throw"error: unknown encoding format: "+
d;d=b[a];a++;for(var e=0;e<d;e++)c.push(b[a+e]);return c};f.CFF.readCharset=function(b,a,c){var d=f._bin,e=[".notdef"],g=b[a];if(a++,0==g)for(var h=0;h<c;h++){var k=d.readUshort(b,a);a+=2;e.push(k)}else{if(1!=g&&2!=g)throw"error: format: "+g;for(;e.length<c;){k=d.readUshort(b,a);a+=2;var l=0;1==g?(l=b[a],a++):(l=d.readUshort(b,a),a+=2);for(h=0;h<=l;h++)e.push(k),k++}}return e};f.CFF.readIndex=function(b,a,c){var d=f._bin,e=d.readUshort(b,a)+1,g=b[a+=2];if(a++,1==g)for(var h=0;h<e;h++)c.push(b[a+h]);
else if(2==g)for(h=0;h<e;h++)c.push(d.readUshort(b,a+2*h));else if(3==g)for(h=0;h<e;h++)c.push(16777215&d.readUint(b,a+3*h-1));else if(1!=e)throw"unsupported offset size: "+g+", count: "+e;return a+e*g-1};f.CFF.getCharString=function(b,a,c){var d=f._bin,e=b[a],g=b[a+1],h=(b[a+2],b[a+3],b[a+4],1),k=null,l=null;20>=e&&(k=e,h=1);12==e&&(k=100*e+g,h=2);21<=e&&27>=e&&(k=e,h=1);28==e&&(l=d.readShort(b,a+1),h=3);29<=e&&31>=e&&(k=e,h=1);32<=e&&246>=e&&(l=e-139,h=1);247<=e&&250>=e&&(l=256*(e-247)+g+108,h=
2);251<=e&&254>=e&&(l=256*-(e-251)-g-108,h=2);255==e&&(l=d.readInt(b,a+1)/65535,h=5);c.val=null!=l?l:"o"+k;c.size=h};f.CFF.readCharString=function(b,a,c){c=a+c;for(var d=f._bin,e=[];a<c;){var g=b[a],h=b[a+1],k=(b[a+2],b[a+3],b[a+4],1),l=null,m=null;20>=g&&(l=g,k=1);12==g&&(l=100*g+h,k=2);19!=g&&20!=g||(l=g,k=2);21<=g&&27>=g&&(l=g,k=1);28==g&&(m=d.readShort(b,a+1),k=3);29<=g&&31>=g&&(l=g,k=1);32<=g&&246>=g&&(m=g-139,k=1);247<=g&&250>=g&&(m=256*(g-247)+h+108,k=2);251<=g&&254>=g&&(m=256*-(g-251)-h-108,
k=2);255==g&&(m=d.readInt(b,a+1)/65535,k=5);e.push(null!=m?m:"o"+l);a+=k}return e};f.CFF.readDict=function(b,a,c){for(var d=f._bin,e={},g=[];a<c;){var h=b[a],k=b[a+1],l=(b[a+2],b[a+3],b[a+4],1),m=null,v=null;if(28==h&&(v=d.readShort(b,a+1),l=3),29==h&&(v=d.readInt(b,a+1),l=5),32<=h&&246>=h&&(v=h-139,l=1),247<=h&&250>=h&&(v=256*(h-247)+k+108,l=2),251<=h&&254>=h&&(v=256*-(h-251)-k-108,l=2),255==h)throw d.readInt(b,a+1),"unknown number";if(30==h){v=[];for(l=1;;){var q=b[a+l];l++;var r=q>>4;q&=15;if(15!=
r&&v.push(r),15!=q&&v.push(q),15==q)break}r="";q=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"];for(var p=0;p<v.length;p++)r+=q[v[p]];v=parseFloat(r)}21>=h&&(m="version Notice FullName FamilyName Weight FontBBox BlueValues OtherBlues FamilyBlues FamilyOtherBlues StdHW StdVW escape UniqueID XUID charset Encoding CharStrings Private Subrs defaultWidthX nominalWidthX".split(" ")[h],l=1,12==h)&&(m=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType",
"CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][k],l=2);null!=m?(e[m]=1==g.length?g[0]:g,g=[]):g.push(v);a+=l}return e};f.cmap={};f.cmap.parse=function(b,a,c){b=new Uint8Array(b.buffer,a,c);a=0;c=
f._bin;var d={};c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);a+=2;var g=[];d.tables=[];for(var h=0;h<e;h++){var k=c.readUshort(b,a);a+=2;var l=c.readUshort(b,a);a+=2;var m=c.readUint(b,a);a+=4;var v="p"+k+"e"+l,q=g.indexOf(m);if(-1==q){var r;q=d.tables.length;g.push(m);var p=c.readUshort(b,m);0==p?r=f.cmap.parse0(b,m):4==p?r=f.cmap.parse4(b,m):6==p?r=f.cmap.parse6(b,m):12==p?r=f.cmap.parse12(b,m):console.debug("unknown format: "+p,k,l,m);d.tables.push(r)}if(null!=d[v])throw"multiple tables for one platform+encoding";
d[v]=q}return d};f.cmap.parse0=function(b,a){var c=f._bin,d={};d.format=c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;d.map=[];for(c=0;c<e-6;c++)d.map.push(b[a+c]);return d};f.cmap.parse4=function(b,a){var c=f._bin,d=a,e={};e.format=c.readUshort(b,a);a+=2;var g=c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;var h=c.readUshort(b,a);a+=2;h/=2;e.searchRange=c.readUshort(b,a);a+=2;e.entrySelector=c.readUshort(b,a);a+=2;e.rangeShift=c.readUshort(b,a);a+=2;e.endCount=c.readUshorts(b,
a,h);a=a+2*h+2;e.startCount=c.readUshorts(b,a,h);a+=2*h;e.idDelta=[];for(var k=0;k<h;k++)e.idDelta.push(c.readShort(b,a)),a+=2;e.idRangeOffset=c.readUshorts(b,a,h);a+=2*h;for(e.glyphIdArray=[];a<d+g;)e.glyphIdArray.push(c.readUshort(b,a)),a+=2;return e};f.cmap.parse6=function(b,a){var c=f._bin,d={};d.format=c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;d.firstCode=c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);a+=2;d.glyphIdArray=[];for(var g=0;g<e;g++)d.glyphIdArray.push(c.readUshort(b,
a)),a+=2;return d};f.cmap.parse12=function(b,a){var c=f._bin,d={};d.format=c.readUshort(b,a);a=a+2+2;c.readUint(b,a);a+=4;c.readUint(b,a);a+=4;var e=c.readUint(b,a);a+=4;d.groups=[];for(var g=0;g<e;g++){var h=a+12*g,k=c.readUint(b,h+0),l=c.readUint(b,h+4);h=c.readUint(b,h+8);d.groups.push([k,l,h])}return d};f.glyf={};f.glyf.parse=function(b,a,c,d){b=[];for(a=0;a<d.maxp.numGlyphs;a++)b.push(null);return b};f.glyf._parseGlyf=function(b,a){var c=f._bin,d=b._data,e=f._tabOffset(d,"glyf",b._offset)+b.loca[a];
if(b.loca[a]==b.loca[a+1])return null;b={};if(b.noc=c.readShort(d,e),e+=2,b.xMin=c.readShort(d,e),e+=2,b.yMin=c.readShort(d,e),e+=2,b.xMax=c.readShort(d,e),e+=2,b.yMax=c.readShort(d,e),e+=2,b.xMin>=b.xMax||b.yMin>=b.yMax)return null;if(0<b.noc){b.endPts=[];for(a=0;a<b.noc;a++)b.endPts.push(c.readUshort(d,e)),e+=2;a=c.readUshort(d,e);if(e+=2,d.length-e<a)return null;b.instructions=c.readBytes(d,e,a);e+=a;var g=b.endPts[b.noc-1]+1;b.flags=[];for(a=0;a<g;a++){var h=d[e];if(e++,b.flags.push(h),0!=(8&
h)){var k=d[e];e++;for(var l=0;l<k;l++)b.flags.push(h),a++}}b.xs=[];for(a=0;a<g;a++)h=0!=(2&b.flags[a]),k=0!=(16&b.flags[a]),h?(b.xs.push(k?d[e]:-d[e]),e++):k?b.xs.push(0):(b.xs.push(c.readShort(d,e)),e+=2);b.ys=[];for(a=0;a<g;a++)h=0!=(4&b.flags[a]),k=0!=(32&b.flags[a]),h?(b.ys.push(k?d[e]:-d[e]),e++):k?b.ys.push(0):(b.ys.push(c.readShort(d,e)),e+=2);for(a=e=d=0;a<g;a++)d+=b.xs[a],e+=b.ys[a],b.xs[a]=d,b.ys[a]=e}else{b.parts=[];do a=c.readUshort(d,e),e+=2,g={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1},
(b.parts.push(g),g.glyphIndex=c.readUshort(d,e),e+=2,1&a)?(h=c.readShort(d,e),e+=2,k=c.readShort(d,e),e+=2):(h=c.readInt8(d,e),e++,k=c.readInt8(d,e),e++),2&a?(g.m.tx=h,g.m.ty=k):(g.p1=h,g.p2=k),8&a?(g.m.a=g.m.d=c.readF2dot14(d,e),e+=2):64&a?(g.m.a=c.readF2dot14(d,e),e+=2,g.m.d=c.readF2dot14(d,e),e+=2):128&a&&(g.m.a=c.readF2dot14(d,e),e+=2,g.m.b=c.readF2dot14(d,e),e+=2,g.m.c=c.readF2dot14(d,e),e+=2,g.m.d=c.readF2dot14(d,e),e+=2);while(32&a);if(256&a)for(c=c.readUshort(d,e),e+=2,b.instr=[],a=0;a<c;a++)b.instr.push(d[e]),
e++}return b};f.GPOS={};f.GPOS.parse=function(b,a,c,d){return f._lctf.parse(b,a,c,d,f.GPOS.subt)};f.GPOS.subt=function(b,a,c,d){var e=f._bin,g=c,h={};if(h.fmt=e.readUshort(b,c),c+=2,1==a||2==a||3==a||7==a||8==a&&2>=h.fmt){var k=e.readUshort(b,c);c+=2;h.coverage=f._lctf.readCoverage(b,k+g)}if(1==a&&1==h.fmt)d=e.readUshort(b,c),c+=2,f._lctf.numOfOnes(d),0!=d&&(h.pos=f.GPOS.readValueRecord(b,c,d));else if(2==a&&1<=h.fmt&&2>=h.fmt){d=e.readUshort(b,c);c+=2;k=e.readUshort(b,c);c+=2;a=f._lctf.numOfOnes(d);
var l=f._lctf.numOfOnes(k);if(1==h.fmt){h.pairsets=[];var m=e.readUshort(b,c);c+=2;for(var v=0;v<m;v++){var q=g+e.readUshort(b,c);c+=2;var r=e.readUshort(b,q);q+=2;for(var p=[],t=0;t<r;t++){var z=e.readUshort(b,q);q+=2;0!=d&&(w=f.GPOS.readValueRecord(b,q,d),q+=2*a);0!=k&&(E=f.GPOS.readValueRecord(b,q,k),q+=2*l);p.push({gid2:z,val1:w,val2:E})}h.pairsets.push(p)}}if(2==h.fmt)for(w=e.readUshort(b,c),c+=2,E=e.readUshort(b,c),c+=2,m=e.readUshort(b,c),c+=2,e=e.readUshort(b,c),c+=2,h.classDef1=f._lctf.readClassDef(b,
g+w),h.classDef2=f._lctf.readClassDef(b,g+E),h.matrix=[],v=0;v<m;v++){g=[];for(t=0;t<e;t++){var w=null,E=null;0!=d&&(w=f.GPOS.readValueRecord(b,c,d),c+=2*a);0!=k&&(E=f.GPOS.readValueRecord(b,c,k),c+=2*l);g.push({val1:w,val2:E})}h.matrix.push(g)}}else{if(9==a&&1==h.fmt){h=e.readUshort(b,c);c=e.readUint(b,c+2);if(9==d.ltype)d.ltype=h;else if(d.ltype!=h)throw"invalid extension substitution";return f.GPOS.subt(b,d.ltype,g+c)}console.debug("unsupported GPOS table LookupType",a,"format",h.fmt)}return h};
f.GPOS.readValueRecord=function(b,a,c){var d=f._bin,e=[];return e.push(1&c?d.readShort(b,a):0),a+=1&c?2:0,e.push(2&c?d.readShort(b,a):0),a+=2&c?2:0,e.push(4&c?d.readShort(b,a):0),a+=4&c?2:0,e.push(8&c?d.readShort(b,a):0),e};f.GSUB={};f.GSUB.parse=function(b,a,c,d){return f._lctf.parse(b,a,c,d,f.GSUB.subt)};f.GSUB.subt=function(b,a,c,d){var e=f._bin,g=c,h={};if(h.fmt=e.readUshort(b,c),c+=2,1!=a&&4!=a&&5!=a&&6!=a)return null;if(1==a||4==a||5==a&&2>=h.fmt||6==a&&2>=h.fmt){var k=e.readUshort(b,c);c+=
2;h.coverage=f._lctf.readCoverage(b,g+k)}if(1==a&&1<=h.fmt&&2>=h.fmt)1==h.fmt?h.delta=e.readShort(b,c):2==h.fmt&&(a=e.readUshort(b,c),h.newg=e.readUshorts(b,c+2,a));else if(4==a)for(h.vals=[],a=e.readUshort(b,c),c+=2,d=0;d<a;d++)k=e.readUshort(b,c),c+=2,h.vals.push(f.GSUB.readLigatureSet(b,g+k));else if(5==a&&2==h.fmt){if(2==h.fmt)for(d=e.readUshort(b,c),c+=2,h.cDef=f._lctf.readClassDef(b,g+d),h.scset=[],a=e.readUshort(b,c),c+=2,d=0;d<a;d++)k=e.readUshort(b,c),c+=2,h.scset.push(0==k?null:f.GSUB.readSubClassSet(b,
g+k))}else if(6==a&&3==h.fmt){if(3==h.fmt){for(d=0;3>d;d++){a=e.readUshort(b,c);c+=2;k=[];for(var l=0;l<a;l++)k.push(f._lctf.readCoverage(b,g+e.readUshort(b,c+2*l)));c+=2*a;0==d&&(h.backCvg=k);1==d&&(h.inptCvg=k);2==d&&(h.ahedCvg=k)}a=e.readUshort(b,c);h.lookupRec=f.GSUB.readSubstLookupRecords(b,c+2,a)}}else{if(7==a&&1==h.fmt){h=e.readUshort(b,c);c=e.readUint(b,c+2);if(9==d.ltype)d.ltype=h;else if(d.ltype!=h)throw"invalid extension substitution";return f.GSUB.subt(b,d.ltype,g+c)}console.debug("unsupported GSUB table LookupType",
a,"format",h.fmt)}return h};f.GSUB.readSubClassSet=function(b,a){var c=f._bin.readUshort,d=a,e=[],g=c(b,a);a+=2;for(var h=0;h<g;h++){var k=c(b,a);a+=2;e.push(f.GSUB.readSubClassRule(b,d+k))}return e};f.GSUB.readSubClassRule=function(b,a){var c=f._bin.readUshort,d={},e=c(b,a),g=c(b,a+=2);a+=2;d.input=[];for(var h=0;h<e-1;h++)d.input.push(c(b,a)),a+=2;return d.substLookupRecords=f.GSUB.readSubstLookupRecords(b,a,g),d};f.GSUB.readSubstLookupRecords=function(b,a,c){for(var d=f._bin.readUshort,e=[],g=
0;g<c;g++)e.push(d(b,a),d(b,a+2)),a+=4;return e};f.GSUB.readChainSubClassSet=function(b,a){var c=f._bin,d=a,e=[],g=c.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=c.readUshort(b,a);a+=2;e.push(f.GSUB.readChainSubClassRule(b,d+k))}return e};f.GSUB.readChainSubClassRule=function(b,a){for(var c=f._bin,d={},e=["backtrack","input","lookahead"],g=0;g<e.length;g++){var h=c.readUshort(b,a);a+=2;1==g&&h--;d[e[g]]=c.readUshorts(b,a,h);a+=2*d[e[g]].length}h=c.readUshort(b,a);return a+=2,d.subst=c.readUshorts(b,
a,2*h),d};f.GSUB.readLigatureSet=function(b,a){var c=f._bin,d=a,e=[],g=c.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=c.readUshort(b,a);a+=2;e.push(f.GSUB.readLigature(b,d+k))}return e};f.GSUB.readLigature=function(b,a){var c=f._bin,d={chain:[]};d.nglyph=c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);a+=2;for(var g=0;g<e-1;g++)d.chain.push(c.readUshort(b,a)),a+=2;return d};f.head={};f.head.parse=function(b,a,c){c=f._bin;var d={};c.readFixed(b,a);a+=4;d.fontRevision=c.readFixed(b,a);a+=4;c.readUint(b,
a);a+=4;c.readUint(b,a);return a+=4,d.flags=c.readUshort(b,a),a+=2,d.unitsPerEm=c.readUshort(b,a),a+=2,d.created=c.readUint64(b,a),a+=8,d.modified=c.readUint64(b,a),a+=8,d.xMin=c.readShort(b,a),a+=2,d.yMin=c.readShort(b,a),a+=2,d.xMax=c.readShort(b,a),a+=2,d.yMax=c.readShort(b,a),a+=2,d.macStyle=c.readUshort(b,a),a+=2,d.lowestRecPPEM=c.readUshort(b,a),a+=2,d.fontDirectionHint=c.readShort(b,a),a+=2,d.indexToLocFormat=c.readShort(b,a),a+=2,d.glyphDataFormat=c.readShort(b,a),d};f.hhea={};f.hhea.parse=
function(b,a,c){c=f._bin;var d={};c.readFixed(b,a);return a+=4,d.ascender=c.readShort(b,a),a+=2,d.descender=c.readShort(b,a),a+=2,d.lineGap=c.readShort(b,a),a+=2,d.advanceWidthMax=c.readUshort(b,a),a+=2,d.minLeftSideBearing=c.readShort(b,a),a+=2,d.minRightSideBearing=c.readShort(b,a),a+=2,d.xMaxExtent=c.readShort(b,a),a+=2,d.caretSlopeRise=c.readShort(b,a),a+=2,d.caretSlopeRun=c.readShort(b,a),a+=2,d.caretOffset=c.readShort(b,a),a+=2,a+=8,d.metricDataFormat=c.readShort(b,a),a+=2,d.numberOfHMetrics=
c.readUshort(b,a),d};f.hmtx={};f.hmtx.parse=function(b,a,c,d){c=f._bin;for(var e={aWidth:[],lsBearing:[]},g=0,h=0,k=0;k<d.maxp.numGlyphs;k++)k<d.hhea.numberOfHMetrics&&(g=c.readUshort(b,a),a+=2,h=c.readShort(b,a),a+=2),e.aWidth.push(g),e.lsBearing.push(h);return e};f.kern={};f.kern.parse=function(b,a,c,d){var e=f._bin,g=e.readUshort(b,a);if(a+=2,1==g)return f.kern.parseV1(b,a-2,c,d);c=e.readUshort(b,a);a+=2;d={glyph1:[],rval:[]};for(g=0;g<c;g++){a+=2;e.readUshort(b,a);a+=2;var h=e.readUshort(b,a);
a+=2;h>>>=8;if(0!=(h&=15))throw"unknown kern table format: "+h;a=f.kern.readFormat0(b,a,d)}return d};f.kern.parseV1=function(b,a,c,d){c=f._bin;c.readFixed(b,a);a+=4;d=c.readUint(b,a);a+=4;for(var e={glyph1:[],rval:[]},g=0;g<d;g++){c.readUint(b,a);a+=4;var h=c.readUshort(b,a);a+=2;c.readUshort(b,a);a+=2;h>>>=8;if(0!=(h&=15))throw"unknown kern table format: "+h;a=f.kern.readFormat0(b,a,e)}return e};f.kern.readFormat0=function(b,a,c){var d=f._bin,e=-1,g=d.readUshort(b,a);a+=2;d.readUshort(b,a);a+=2;
d.readUshort(b,a);a+=2;d.readUshort(b,a);a+=2;for(var h=0;h<g;h++){var k=d.readUshort(b,a);a+=2;var l=d.readUshort(b,a);a+=2;var m=d.readShort(b,a);a+=2;k!=e&&(c.glyph1.push(k),c.rval.push({glyph2:[],vals:[]}));e=c.rval[c.rval.length-1];e.glyph2.push(l);e.vals.push(m);e=k}return a};f.loca={};f.loca.parse=function(b,a,c,d){c=f._bin;var e=[],g=d.head.indexToLocFormat;d=d.maxp.numGlyphs+1;if(0==g)for(var h=0;h<d;h++)e.push(c.readUshort(b,a+(h<<1))<<1);if(1==g)for(h=0;h<d;h++)e.push(c.readUint(b,a+(h<<
2)));return e};f.maxp={};f.maxp.parse=function(b,a,c){c=f._bin;var d={},e=c.readUint(b,a);return a+=4,d.numGlyphs=c.readUshort(b,a),a+=2,65536==e&&(d.maxPoints=c.readUshort(b,a),a+=2,d.maxContours=c.readUshort(b,a),a+=2,d.maxCompositePoints=c.readUshort(b,a),a+=2,d.maxCompositeContours=c.readUshort(b,a),a+=2,d.maxZones=c.readUshort(b,a),a+=2,d.maxTwilightPoints=c.readUshort(b,a),a+=2,d.maxStorage=c.readUshort(b,a),a+=2,d.maxFunctionDefs=c.readUshort(b,a),a+=2,d.maxInstructionDefs=c.readUshort(b,a),
a+=2,d.maxStackElements=c.readUshort(b,a),a+=2,d.maxSizeOfInstructions=c.readUshort(b,a),a+=2,d.maxComponentElements=c.readUshort(b,a),a+=2,d.maxComponentDepth=c.readUshort(b,a)),d};f.name={};f.name.parse=function(b,a,c){c=f._bin;var d={};c.readUshort(b,a);a+=2;var e=c.readUshort(b,a);a+=2;c.readUshort(b,a);for(var g,h="copyright fontFamily fontSubfamily ID fullName version postScriptName trademark manufacturer designer description urlVendor urlDesigner licence licenceURL --- typoFamilyName typoSubfamilyName compatibleFull sampleText postScriptCID wwsFamilyName wwsSubfamilyName lightPalette darkPalette".split(" "),
k=a+=2,l=0;l<e;l++){var m=c.readUshort(b,a);a+=2;var v=c.readUshort(b,a);a+=2;var q=c.readUshort(b,a);a+=2;var r=c.readUshort(b,a);a+=2;var p=c.readUshort(b,a);a+=2;var t=c.readUshort(b,a);a+=2;var z=h[r];t=k+12*e+t;if(0==m)p=c.readUnicode(b,t,p/2);else if(3==m&&0==v)p=c.readUnicode(b,t,p/2);else if(0==v)p=c.readASCII(b,t,p);else if(1==v)p=c.readUnicode(b,t,p/2);else if(3==v)p=c.readUnicode(b,t,p/2);else{if(1!=m)throw"unknown encoding "+v+", platformID: "+m;p=c.readASCII(b,t,p);console.debug("reading unknown MAC encoding "+
v+" as ASCII")}m="p"+m+","+q.toString(16);null==d[m]&&(d[m]={});d[m][void 0!==z?z:r]=p;d[m]._lang=q}for(var w in d)if(null!=d[w].postScriptName&&1033==d[w]._lang)return d[w];for(w in d)if(null!=d[w].postScriptName&&0==d[w]._lang)return d[w];for(w in d)if(null!=d[w].postScriptName&&3084==d[w]._lang)return d[w];for(w in d)if(null!=d[w].postScriptName)return d[w];for(w in d){g=w;break}return console.debug("returning name table with languageID "+d[g]._lang),d[g]};f["OS/2"]={};f["OS/2"].parse=function(b,
a,c){c=f._bin.readUshort(b,a);a+=2;var d={};if(0==c)f["OS/2"].version0(b,a,d);else if(1==c)f["OS/2"].version1(b,a,d);else if(2==c||3==c||4==c)f["OS/2"].version2(b,a,d);else{if(5!=c)throw"unknown OS/2 table version: "+c;f["OS/2"].version5(b,a,d)}return d};f["OS/2"].version0=function(b,a,c){var d=f._bin;return c.xAvgCharWidth=d.readShort(b,a),a+=2,c.usWeightClass=d.readUshort(b,a),a+=2,c.usWidthClass=d.readUshort(b,a),a+=2,c.fsType=d.readUshort(b,a),a+=2,c.ySubscriptXSize=d.readShort(b,a),a+=2,c.ySubscriptYSize=
d.readShort(b,a),a+=2,c.ySubscriptXOffset=d.readShort(b,a),a+=2,c.ySubscriptYOffset=d.readShort(b,a),a+=2,c.ySuperscriptXSize=d.readShort(b,a),a+=2,c.ySuperscriptYSize=d.readShort(b,a),a+=2,c.ySuperscriptXOffset=d.readShort(b,a),a+=2,c.ySuperscriptYOffset=d.readShort(b,a),a+=2,c.yStrikeoutSize=d.readShort(b,a),a+=2,c.yStrikeoutPosition=d.readShort(b,a),a+=2,c.sFamilyClass=d.readShort(b,a),a+=2,c.panose=d.readBytes(b,a,10),a+=10,c.ulUnicodeRange1=d.readUint(b,a),a+=4,c.ulUnicodeRange2=d.readUint(b,
a),a+=4,c.ulUnicodeRange3=d.readUint(b,a),a+=4,c.ulUnicodeRange4=d.readUint(b,a),a+=4,c.achVendID=[d.readInt8(b,a),d.readInt8(b,a+1),d.readInt8(b,a+2),d.readInt8(b,a+3)],a+=4,c.fsSelection=d.readUshort(b,a),a+=2,c.usFirstCharIndex=d.readUshort(b,a),a+=2,c.usLastCharIndex=d.readUshort(b,a),a+=2,c.sTypoAscender=d.readShort(b,a),a+=2,c.sTypoDescender=d.readShort(b,a),a+=2,c.sTypoLineGap=d.readShort(b,a),a+=2,c.usWinAscent=d.readUshort(b,a),a+=2,c.usWinDescent=d.readUshort(b,a),a+2};f["OS/2"].version1=
function(b,a,c){var d=f._bin;return a=f["OS/2"].version0(b,a,c),c.ulCodePageRange1=d.readUint(b,a),a+=4,c.ulCodePageRange2=d.readUint(b,a),a+4};f["OS/2"].version2=function(b,a,c){var d=f._bin;return a=f["OS/2"].version1(b,a,c),c.sxHeight=d.readShort(b,a),a+=2,c.sCapHeight=d.readShort(b,a),a+=2,c.usDefault=d.readUshort(b,a),a+=2,c.usBreak=d.readUshort(b,a),a+=2,c.usMaxContext=d.readUshort(b,a),a+2};f["OS/2"].version5=function(b,a,c){var d=f._bin;return a=f["OS/2"].version2(b,a,c),c.usLowerOpticalPointSize=
d.readUshort(b,a),a+=2,c.usUpperOpticalPointSize=d.readUshort(b,a),a+2};f.post={};f.post.parse=function(b,a,c){c=f._bin;var d={};return d.version=c.readFixed(b,a),a+=4,d.italicAngle=c.readFixed(b,a),a+=4,d.underlinePosition=c.readShort(b,a),a+=2,d.underlineThickness=c.readShort(b,a),d};f.SVG={};f.SVG.parse=function(b,a,c){c=f._bin;var d={entries:[]},e=a;c.readUshort(b,a);a+=2;var g=c.readUint(b,a);c.readUint(b,a+4);a=g+e;var h=c.readUshort(b,a);a+=2;for(var k=0;k<h;k++){var l=c.readUshort(b,a);a+=
2;var m=c.readUshort(b,a);a+=2;var v=c.readUint(b,a);a+=4;var q=c.readUint(b,a);a+=4;v=new Uint8Array(b.buffer,e+v+g,q);for(v=c.readUTF8(v,0,v.length);l<=m;l++)d.entries[l]=v}return d};f.SVG.toPath=function(b){var a={cmds:[],crds:[]};if(null==b)return a;for(var c=(new DOMParser).parseFromString(b,"image/svg+xml").firstChild;"svg"!=c.tagName;)c=c.nextSibling;b=(b=c.getAttribute("viewBox"))?b.trim().split(" ").map(parseFloat):[0,0,1E3,1E3];f.SVG._toPath(c.children,a);for(c=0;c<a.crds.length;c+=2){var d=
a.crds[c],e=a.crds[c+1];d-=b[0];e=-(e-=b[1]);a.crds[c]=d;a.crds[c+1]=e}return a};f.SVG._toPath=function(b,a,c){for(var d=0;d<b.length;d++){var e=b[d],g=e.tagName,h=e.getAttribute("fill");(null==h&&(h=c),"g"==g)?f.SVG._toPath(e.children,a,h):"path"==g?(a.cmds.push(h||"#000000"),e=e.getAttribute("d"),e=f.SVG._tokens(e),f.SVG._toksToPath(e,a),a.cmds.push("X")):"defs"==g||console.debug(g,e)}};f.SVG._tokens=function(b){for(var a=[],c=0,d=!1,e="";c<b.length;){var g=b.charCodeAt(c),f=b.charAt(c);c++;g=48<=
g&&57>=g||"."==f||"-"==f;d?"-"==f?(a.push(parseFloat(e)),e=f):g?e+=f:(a.push(parseFloat(e)),","!=f&&" "!=f&&a.push(f),d=!1):g?(e=f,d=!0):","!=f&&" "!=f&&a.push(f)}return d&&a.push(parseFloat(e)),a};f.SVG._toksToPath=function(b,a){var c=0,d=0,e=0,g=0,h=0,k={M:2,L:2,H:1,V:1,S:4,C:6},l=a.cmds;for(a=a.crds;c<b.length;){var m=b[c];if(c++,"z"==m)l.push("Z"),d=g,e=h;else for(var v=m.toUpperCase(),q=f.SVG._reps(b,c,k[v]),r=0;r<q;r++){var p=0,t=0;if(m!=v&&(p=d,t=e),"M"==v)d=p+b[c++],e=t+b[c++],l.push("M"),
a.push(d,e),g=d,h=e;else if("L"==v)d=p+b[c++],e=t+b[c++],l.push("L"),a.push(d,e);else if("H"==v)d=p+b[c++],l.push("L"),a.push(d,e);else if("V"==v)e=t+b[c++],l.push("L"),a.push(d,e);else if("C"==v){d=p+b[c++];e=t+b[c++];var z=p+b[c++],w=t+b[c++];p+=b[c++];t+=b[c++];l.push("C");a.push(d,e,z,w,p,t);d=p;e=t}else"S"==v?(z=Math.max(a.length-4,0),d=d+d-a[z],e=e+e-a[z+1],z=p+b[c++],w=t+b[c++],p+=b[c++],t+=b[c++],l.push("C"),a.push(d,e,z,w,p,t),d=p,e=t):console.debug("Unknown SVG command "+m)}}};f.SVG._reps=
function(b,a,c){for(var d=a;d<b.length&&"string"!=typeof b[d];)d+=c;return(d-a)/c};null==f&&(f={});null==f.U&&(f.U={});f.U.codeToGlyph=function(b,a){b=b.cmap;var c=-1;if(null!=b.p0e4?c=b.p0e4:null!=b.p3e1?c=b.p3e1:null!=b.p1e0?c=b.p1e0:null!=b.p0e3&&(c=b.p0e3),-1==c)throw"no familiar platform and encoding!";b=b.tables[c];if(0==b.format)return a>=b.map.length?0:b.map[a];if(4==b.format){var d=-1;for(c=0;c<b.endCount.length;c++)if(a<=b.endCount[c]){d=c;break}return-1==d||b.startCount[d]>a?0:65535&(0!=
b.idRangeOffset[d]?b.glyphIdArray[a-b.startCount[d]+(b.idRangeOffset[d]>>1)-(b.idRangeOffset.length-d)]:a+b.idDelta[d])}if(12==b.format){if(a>b.groups[b.groups.length-1][1])return 0;for(c=0;c<b.groups.length;c++)if(d=b.groups[c],d[0]<=a&&a<=d[1])return d[2]+(a-d[0]);return 0}throw"unknown cmap table format "+b.format;};f.U.glyphToPath=function(b,a){var c={cmds:[],crds:[]};if(b.SVG&&b.SVG.entries[a]){var d=b.SVG.entries[a];return null==d?c:("string"==typeof d&&(d=f.SVG.toPath(d),b.SVG.entries[a]=d),
d)}if(b.CFF){d={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:b.CFF.Private?b.CFF.Private.defaultWidthX:0,open:!1};var e=b.CFF,g=b.CFF.Private;if(e.ROS){for(g=0;e.FDSelect[g+2]<=a;)g+=2;g=e.FDArray[e.FDSelect[g+1]].Private}f.U._drawCFF(b.CFF.CharStrings[a],d,e,g,c)}else b.glyf&&f.U._drawGlyf(a,b,c);return c};f.U._drawGlyf=function(b,a,c){var d=a.glyf[b];null==d&&(d=a.glyf[b]=f.glyf._parseGlyf(a,b));null!=d&&(-1<d.noc?f.U._simpleGlyph(d,c):f.U._compoGlyph(d,a,c))};f.U._simpleGlyph=function(b,a){for(var c=
0;c<b.noc;c++){for(var d=0==c?0:b.endPts[c-1]+1,e=b.endPts[c],g=d;g<=e;g++){var h=g==d?e:g-1,k=g==e?d:g+1,l=1&b.flags[g],m=1&b.flags[h],v=1&b.flags[k],q=b.xs[g],r=b.ys[g];if(g==d)if(l){if(!m){f.U.P.moveTo(a,q,r);continue}f.U.P.moveTo(a,b.xs[h],b.ys[h])}else m?f.U.P.moveTo(a,b.xs[h],b.ys[h]):f.U.P.moveTo(a,(b.xs[h]+q)/2,(b.ys[h]+r)/2);l?m&&f.U.P.lineTo(a,q,r):v?f.U.P.qcurveTo(a,q,r,b.xs[k],b.ys[k]):f.U.P.qcurveTo(a,q,r,(q+b.xs[k])/2,(r+b.ys[k])/2)}f.U.P.closePath(a)}};f.U._compoGlyph=function(b,a,
c){for(var d=0;d<b.parts.length;d++){var e={cmds:[],crds:[]},g=b.parts[d];f.U._drawGlyf(g.glyphIndex,a,e);g=g.m;for(var h=0;h<e.crds.length;h+=2){var k=e.crds[h],l=e.crds[h+1];c.crds.push(k*g.a+l*g.b+g.tx);c.crds.push(k*g.c+l*g.d+g.ty)}for(h=0;h<e.cmds.length;h++)c.cmds.push(e.cmds[h])}};f.U._getGlyphClass=function(b,a){b=f._lctf.getInterval(a,b);return-1==b?0:a[b+2]};f.U.getPairAdjustment=function(b,a,c){var d=0;if(b.GPOS){var e=b.GPOS,g=e.lookupList;e=e.featureList;for(var h=[],k=0;k<e.length;k++){var l=
e[k];if("kern"==l.tag)for(var m=0;m<l.tab.length;m++)if(!h[l.tab[m]]){h[l.tab[m]]=!0;for(var v=g[l.tab[m]],q=0;q<v.tabs.length;q++)if(null!=v.tabs[q]){var r,p=v.tabs[q];if((!p.coverage||-1!=(r=f._lctf.coverageIndex(p.coverage,a)))&&1!=v.ltype&&2==v.ltype){var t;if(1==p.fmt)for(p=p.pairsets[r],k=0;k<p.length;k++)p[k].gid2==c&&(t=p[k]);else if(2==p.fmt){t=f.U._getGlyphClass(a,p.classDef1);var z=f.U._getGlyphClass(c,p.classDef2);t=p.matrix[t][z]}t&&t.val1&&t.val1[2]&&(d+=t.val1[2]);t&&t.val2&&t.val2[0]&&
(d+=t.val2[0])}}}}}b.kern&&(a=b.kern.glyph1.indexOf(a),-1!=a&&(c=b.kern.rval[a].glyph2.indexOf(c),-1!=c&&(d+=b.kern.rval[a].vals[c])));return d};f.U.stringToGlyphs=function(b,a){for(var c=[],d=0;d<a.length;d++)65535<(e=a.codePointAt(d))&&d++,c.push(f.U.codeToGlyph(b,e));for(d=0;d<a.length;d++){var e;if(2367==(e=a.codePointAt(d))){var g=c[d-1];c[d-1]=c[d];c[d]=g}65535<e&&d++}d=b.GSUB;if(null==d)return c;b=d.lookupList;d=d.featureList;e="rlig liga mset isol init fina medi half pres blws".split(" ");
g=[];for(var h=0;h<d.length;h++){var k=d[h];if(-1!=e.indexOf(k.tag))for(var l=0;l<k.tab.length;l++)if(!g[k.tab[l]]){g[k.tab[l]]=!0;for(var m=b[k.tab[l]],v=0;v<c.length;v++){var q=f.U._getWPfeature(a,v);-1!="isol,init,fina,medi".indexOf(k.tag)&&k.tag!=q||f.U._applySubs(c,v,m,b)}}}return c};f.U._getWPfeature=function(b,a){var c=0==a||-1!='\n\t" ,.:;!?() \u060c'.indexOf(b[a-1]),d=a==b.length-1||-1!='\n\t" ,.:;!?() \u060c'.indexOf(b[a+1]);c||-1=="\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0671\u0672\u0673\u0675\u0676\u0677\u0688\u0689\u068a\u068b\u068c\u068d\u068e\u068f\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u06c0\u06c3\u06c4\u06c5\u06c6\u06c7\u06c8\u06c9\u06ca\u06cb\u06cd\u06cf\u06d2\u06d3\u06d5\u06ee\u06ef\u0710\u0715\u0716\u0717\u0718\u0719\u071e\u0728\u072a\u072c\u072f\u074d\u0759\u075a\u075b\u076b\u076c\u0771\u0773\u0774\u0778\u0779\u0840\u0846\u0847\u0849\u0854\u0867\u0869\u086a\u08aa\u08ab\u08ac\u08ae\u08b1\u08b2\u08b9\u0ac5\u0ac7\u0ac9\u0aca\u0ace\u0acf\u0ad0\u0ad1\u0ad2\u0add\u0ae1\u0ae4\u0aef\u0b81\u0b83\u0b84\u0b85\u0b89\u0b8c\u0b8e\u0b8f\u0b91\u0ba9\u0baa\u0bab\u0bac".indexOf(b[a-
1])||(c=!0);d||-1=="\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0671\u0672\u0673\u0675\u0676\u0677\u0688\u0689\u068a\u068b\u068c\u068d\u068e\u068f\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u06c0\u06c3\u06c4\u06c5\u06c6\u06c7\u06c8\u06c9\u06ca\u06cb\u06cd\u06cf\u06d2\u06d3\u06d5\u06ee\u06ef\u0710\u0715\u0716\u0717\u0718\u0719\u071e\u0728\u072a\u072c\u072f\u074d\u0759\u075a\u075b\u076b\u076c\u0771\u0773\u0774\u0778\u0779\u0840\u0846\u0847\u0849\u0854\u0867\u0869\u086a\u08aa\u08ab\u08ac\u08ae\u08b1\u08b2\u08b9\u0ac5\u0ac7\u0ac9\u0aca\u0ace\u0acf\u0ad0\u0ad1\u0ad2\u0add\u0ae1\u0ae4\u0aef\u0b81\u0b83\u0b84\u0b85\u0b89\u0b8c\u0b8e\u0b8f\u0b91\u0ba9\u0baa\u0bab\u0bac".indexOf(b[a])||
(d=!0);d||-1=="\ua872\u0acd\u0ad7".indexOf(b[a+1])||(d=!0);c||-1=="\ua872\u0acd\u0ad7".indexOf(b[a])||(c=!0);return c?d?"isol":"init":d?"fina":"medi"};f.U._applySubs=function(b,a,c,d){for(var e=b.length-a-1,g=0;g<c.tabs.length;g++)if(null!=c.tabs[g]){var h,k=c.tabs[g];if(!k.coverage||-1!=(h=f._lctf.coverageIndex(k.coverage,b[a])))if(1==c.ltype)b[a],1==k.fmt?b[a]+=k.delta:b[a]=k.newg[h];else if(4==c.ltype)for(var l=k.vals[h],m=0;m<l.length;m++){var v=l[m];k=v.chain.length;if(!(k>e)){for(var q=!0,r=
0,p=0;p<k;p++){for(;-1==b[a+r+(1+p)];)r++;v.chain[p]!=b[a+r+(1+p)]&&(q=!1)}if(q){b[a]=v.nglyph;for(p=0;p<k+r;p++)b[a+p+1]=-1;break}}}else if(5==c.ltype&&2==k.fmt)for(l=f._lctf.getInterval(k.cDef,b[a]),r=k.scset[k.cDef[l+2]],v=0;v<r.length;v++){m=r[v];var t=m.input;if(!(t.length>e)){q=!0;for(p=0;p<t.length;p++){var z=f._lctf.getInterval(k.cDef,b[a+1+p]);if(-1==l&&k.cDef[z+2]!=t[p]){q=!1;break}}if(q)for(q=m.substLookupRecords,m=0;m<q.length;m+=2)q[m],q[m+1]}}else if(6==c.ltype&&3==k.fmt&&f.U._glsCovered(b,
k.backCvg,a-k.backCvg.length)&&f.U._glsCovered(b,k.inptCvg,a)&&f.U._glsCovered(b,k.ahedCvg,a+k.inptCvg.length))for(q=k.lookupRec,v=0;v<q.length;v+=2)l=q[v],f.U._applySubs(b,a+l,d[q[v+1]],d)}};f.U._glsCovered=function(b,a,c){for(var d=0;d<a.length;d++)if(-1==f._lctf.coverageIndex(a[d],b[c+d]))return!1;return!0};f.U.glyphsToPath=function(b,a,c){for(var d={cmds:[],crds:[]},e=0,g=0;g<a.length;g++){var h=a[g];if(-1!=h){for(var k=g<a.length-1&&-1!=a[g+1]?a[g+1]:0,l=f.U.glyphToPath(b,h),m=0;m<l.crds.length;m+=
2)d.crds.push(l.crds[m]+e),d.crds.push(l.crds[m+1]);c&&d.cmds.push(c);for(m=0;m<l.cmds.length;m++)d.cmds.push(l.cmds[m]);c&&d.cmds.push("X");e+=b.hmtx.aWidth[h];g<a.length-1&&(e+=f.U.getPairAdjustment(b,h,k))}}return d};f.U.pathToSVG=function(b,a){null==a&&(a=5);for(var c=[],d=0,e={M:2,L:2,Q:4,C:6},g=0;g<b.cmds.length;g++){var f=b.cmds[g],k=d+(e[f]?e[f]:0);for(c.push(f);d<k;)f=b.crds[d++],c.push(parseFloat(f.toFixed(a))+(d==k?"":" "))}return c.join("")};f.U.pathToContext=function(b,a){for(var c=0,
d=b.crds,e=0;e<b.cmds.length;e++){var g=b.cmds[e];"M"==g?(a.moveTo(d[c],d[c+1]),c+=2):"L"==g?(a.lineTo(d[c],d[c+1]),c+=2):"C"==g?(a.bezierCurveTo(d[c],d[c+1],d[c+2],d[c+3],d[c+4],d[c+5]),c+=6):"Q"==g?(a.quadraticCurveTo(d[c],d[c+1],d[c+2],d[c+3]),c+=4):"#"==g.charAt(0)?(a.beginPath(),a.fillStyle=g):"Z"==g?a.closePath():"X"==g&&a.fill()}};f.U.P={};f.U.P.moveTo=function(b,a,c){b.cmds.push("M");b.crds.push(a,c)};f.U.P.lineTo=function(b,a,c){b.cmds.push("L");b.crds.push(a,c)};f.U.P.curveTo=function(b,
a,c,d,e,g,f){b.cmds.push("C");b.crds.push(a,c,d,e,g,f)};f.U.P.qcurveTo=function(b,a,c,d,e){b.cmds.push("Q");b.crds.push(a,c,d,e)};f.U.P.closePath=function(b){b.cmds.push("Z")};f.U._drawCFF=function(b,a,c,d,e){for(var g=a.stack,h=a.nStems,k=a.haveWidth,l=a.width,m=a.open,v=0,q=a.x,r=a.y,p=0,t=0,z=0,w=0,E=0,n=0,H=0,u=0,y=0,L=0,M={val:0,size:0};v<b.length;){f.CFF.getCharString(b,v,M);var x=M.val;if(v+=M.size,"o1"==x||"o18"==x)0!=g.length%2&&!k&&(l=g.shift()+d.nominalWidthX),h+=g.length>>1,g.length=0,
k=!0;else if("o3"==x||"o23"==x)0!=g.length%2&&!k&&(l=g.shift()+d.nominalWidthX),h+=g.length>>1,g.length=0,k=!0;else if("o4"==x)1<g.length&&!k&&(l=g.shift()+d.nominalWidthX,k=!0),m&&f.U.P.closePath(e),r+=g.pop(),f.U.P.moveTo(e,q,r),m=!0;else if("o5"==x)for(;0<g.length;)q+=g.shift(),r+=g.shift(),f.U.P.lineTo(e,q,r);else if("o6"==x||"o7"==x){var B=g.length,D="o6"==x;for(x=0;x<B;x++){var G=g.shift();D?q+=G:r+=G;D=!D;f.U.P.lineTo(e,q,r)}}else if("o8"==x||"o24"==x){B=g.length;for(D=0;D+6<=B;)p=q+g.shift(),
t=r+g.shift(),z=p+g.shift(),w=t+g.shift(),q=z+g.shift(),r=w+g.shift(),f.U.P.curveTo(e,p,t,z,w,q,r),D+=6;"o24"==x&&(q+=g.shift(),r+=g.shift(),f.U.P.lineTo(e,q,r))}else{if("o11"==x)break;if("o1234"==x||"o1235"==x||"o1236"==x||"o1237"==x)"o1234"==x&&(t=r,z=(p=q+g.shift())+g.shift(),L=w=t+g.shift(),n=w,u=r,q=(H=(E=(y=z+g.shift())+g.shift())+g.shift())+g.shift(),f.U.P.curveTo(e,p,t,z,w,y,L),f.U.P.curveTo(e,E,n,H,u,q,r)),"o1235"==x&&(p=q+g.shift(),t=r+g.shift(),z=p+g.shift(),w=t+g.shift(),y=z+g.shift(),
L=w+g.shift(),E=y+g.shift(),n=L+g.shift(),H=E+g.shift(),u=n+g.shift(),q=H+g.shift(),r=u+g.shift(),g.shift(),f.U.P.curveTo(e,p,t,z,w,y,L),f.U.P.curveTo(e,E,n,H,u,q,r)),"o1236"==x&&(p=q+g.shift(),t=r+g.shift(),z=p+g.shift(),L=w=t+g.shift(),n=w,H=(E=(y=z+g.shift())+g.shift())+g.shift(),u=n+g.shift(),q=H+g.shift(),f.U.P.curveTo(e,p,t,z,w,y,L),f.U.P.curveTo(e,E,n,H,u,q,r)),"o1237"==x&&(p=q+g.shift(),t=r+g.shift(),z=p+g.shift(),w=t+g.shift(),y=z+g.shift(),L=w+g.shift(),E=y+g.shift(),n=L+g.shift(),H=E+g.shift(),
u=n+g.shift(),Math.abs(H-q)>Math.abs(u-r)?q=H+g.shift():r=u+g.shift(),f.U.P.curveTo(e,p,t,z,w,y,L),f.U.P.curveTo(e,E,n,H,u,q,r));else if("o14"==x){if(0<g.length&&!k&&(l=g.shift()+c.nominalWidthX,k=!0),4==g.length)B=g.shift(),D=g.shift(),G=g.shift(),x=g.shift(),G=f.CFF.glyphBySE(c,G),x=f.CFF.glyphBySE(c,x),f.U._drawCFF(c.CharStrings[G],a,c,d,e),a.x=B,a.y=D,f.U._drawCFF(c.CharStrings[x],a,c,d,e);m&&(f.U.P.closePath(e),m=!1)}else if("o19"==x||"o20"==x)0!=g.length%2&&!k&&(l=g.shift()+d.nominalWidthX),
h+=g.length>>1,g.length=0,k=!0,v+=h+7>>3;else if("o21"==x)2<g.length&&!k&&(l=g.shift()+d.nominalWidthX,k=!0),r+=g.pop(),q+=g.pop(),m&&f.U.P.closePath(e),f.U.P.moveTo(e,q,r),m=!0;else if("o22"==x)1<g.length&&!k&&(l=g.shift()+d.nominalWidthX,k=!0),q+=g.pop(),m&&f.U.P.closePath(e),f.U.P.moveTo(e,q,r),m=!0;else if("o25"==x){for(;6<g.length;)q+=g.shift(),r+=g.shift(),f.U.P.lineTo(e,q,r);p=q+g.shift();t=r+g.shift();z=p+g.shift();w=t+g.shift();q=z+g.shift();r=w+g.shift();f.U.P.curveTo(e,p,t,z,w,q,r)}else if("o26"==
x)for(g.length%2&&(q+=g.shift());0<g.length;)p=q,t=r+g.shift(),q=z=p+g.shift(),r=(w=t+g.shift())+g.shift(),f.U.P.curveTo(e,p,t,z,w,q,r);else if("o27"==x)for(g.length%2&&(r+=g.shift());0<g.length;)t=r,z=(p=q+g.shift())+g.shift(),w=t+g.shift(),q=z+g.shift(),r=w,f.U.P.curveTo(e,p,t,z,w,q,r);else if("o10"==x||"o29"==x)B="o10"==x?d:c,0==g.length?console.debug("error: empty stack"):(D=g.pop(),B=B.Subrs[D+B.Bias],a.x=q,a.y=r,a.nStems=h,a.haveWidth=k,a.width=l,a.open=m,f.U._drawCFF(B,a,c,d,e),q=a.x,r=a.y,
h=a.nStems,k=a.haveWidth,l=a.width,m=a.open);else if("o30"==x||"o31"==x)for(B=g.length,x=(D=0,"o31"==x),D+=B-(B&=-3);D<B;)x?(t=r,z=(p=q+g.shift())+g.shift(),r=(w=t+g.shift())+g.shift(),5==B-D?(q=z+g.shift(),D++):q=z,x=!1):(p=q,t=r+g.shift(),z=p+g.shift(),w=t+g.shift(),q=z+g.shift(),5==B-D?(r=w+g.shift(),D++):r=w,x=!0),f.U.P.curveTo(e,p,t,z,w,q,r),D+=4;else{if("o"==(x+"").charAt(0))throw console.debug("Unknown operation: "+x,b),x;g.push(x)}}}a.x=q;a.y=r;a.nStems=h;a.haveWidth=k;a.width=l;a.open=m};
var u=f,y={Typr:u};return n.Typr=u,n.default=y,n}({}).Typr},function(){return function(n){var f=Uint8Array,u=Uint16Array,y=Uint32Array,b=new f([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new f([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new f([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(a,b){for(var c=new u(31),d=0;31>d;++d)c[d]=b+=1<<a[d-1];a=new y(c[30]);for(d=1;30>d;++d)for(b=c[d];b<c[d+1];++b)a[b]=b-c[d]<<5|d;return[c,a]},
e=d(b,2),g=e[0];e=e[1];g[28]=258;e[258]=28;var h=d(a,0)[0],k=new u(32768);for(d=0;32768>d;++d)e=(43690&d)>>>1|(21845&d)<<1,e=(61680&(e=(52428&e)>>>2|(13107&e)<<2))>>>4|(3855&e)<<4,k[d]=((65280&e)>>>8|(255&e)<<8)>>>1;var l=function(a,b,c){for(var d=a.length,e=0,g=new u(b);e<d;++e)++g[a[e]-1];var f=new u(b);for(e=0;e<b;++e)f[e]=f[e-1]+g[e-1]<<1;if(c)for(c=new u(1<<b),g=15-b,e=0;e<d;++e){if(a[e]){var h=e<<4|a[e],p=b-a[e],q=f[a[e]-1]++<<p;for(p=q|(1<<p)-1;q<=p;++q)c[k[q]>>>g]=h}}else for(c=new u(d),e=
0;e<d;++e)c[e]=k[f[a[e]-1]++]>>>15-a[e];return c};e=new f(288);for(d=0;144>d;++d)e[d]=8;for(d=144;256>d;++d)e[d]=9;for(d=256;280>d;++d)e[d]=7;for(d=280;288>d;++d)e[d]=8;var m=new f(32);for(d=0;32>d;++d)m[d]=5;var v=l(e,9,1),q=l(m,5,1),r=function(a){for(var b=a[0],c=1;c<a.length;++c)a[c]>b&&(b=a[c]);return b},p=function(a,b,c){var d=b/8>>0;return(a[d]|a[d+1]<<8)>>>(7&b)&c},t=function(a,b){var c=b/8>>0;return(a[c]|a[c+1]<<8|a[c+2]<<16)>>>(7&b)},z=function(d,e,k){var m=d.length,z=!e||k,n=!k||k.i;k||
(k={});e||(e=new f(3*m));var w,E=function(a){var b=e.length;a>b&&(a=new f(Math.max(2*b,a)),a.set(e),e=a)},x=k.f||0,B=k.p||0,D=k.b||0,G=k.l,O=k.d,A=k.m,I=k.n,ea=8*m;do{if(!G){k.f=x=p(d,B,1);var C=p(d,B+1,3);if(B+=3,!C){B=d[(Q=((w=B)/8>>0)+(7&w&&1)+4)-4]|d[Q-3]<<8;C=Q+B;if(C>m){if(n)throw"unexpected EOF";break}z&&E(D+B);e.set(d.subarray(Q,C),D);k.b=D+=B;k.p=B=8*C;continue}if(1==C)G=v,O=q,A=9,I=5;else{if(2!=C)throw"invalid block type";A=p(d,B,31)+257;O=p(d,B+10,15)+4;G=A+p(d,B+5,31)+1;B+=14;I=new f(G);
var K=new f(19);for(C=0;C<O;++C)K[c[C]]=p(d,B+3*C,7);B+=3*O;C=r(K);O=(1<<C)-1;if(!n&&B+G*(C+7)>ea)break;var F=l(K,C,1);for(C=0;C<G;){var Q;Q=F[p(d,B,O)];if(B+=15&Q,16>(Q>>>=4))I[C++]=Q;else{var Z=K=0;for(16==Q?(Z=3+p(d,B,3),B+=2,K=I[C-1]):17==Q?(Z=3+p(d,B,7),B+=3):18==Q&&(Z=11+p(d,B,127),B+=7);Z--;)I[C++]=K}}G=I.subarray(0,A);C=I.subarray(A);A=r(G);I=r(C);G=l(G,A,1);O=l(C,I,1)}if(B>ea)throw"unexpected EOF";}z&&E(D+131072);F=(1<<A)-1;Z=(1<<I)-1;for(var za=A+I+18;n||B+za<ea;){C=(K=G[t(d,B)&F])>>>4;
if((B+=15&K)>ea)throw"unexpected EOF";if(!K)throw"invalid length/literal";if(256>C)e[D++]=C;else{if(256==C){G=null;break}K=C-254;if(264<C){var T=b[C-=257];K=p(d,B,(1<<T)-1)+g[C];B+=T}C=O[t(d,B)&Z];T=C>>>4;if(!C)throw"invalid distance";B+=15&C;C=h[T];3<T&&(T=a[T],C+=t(d,B)&(1<<T)-1,B+=T);if(B>ea)throw"unexpected EOF";z&&E(D+131072);for(K=D+K;D<K;D+=4)e[D]=e[D-C],e[D+1]=e[D+1-C],e[D+2]=e[D+2-C],e[D+3]=e[D+3-C];D=K}}k.l=G;k.p=B;k.b=D;G&&(x=1,k.m=A,k.d=O,k.n=I)}while(!x);return D==e.length?e:function(a,
b,c){(null==b||0>b)&&(b=0);(null==c||c>a.length)&&(c=a.length);var d=new (a instanceof u?u:a instanceof y?y:f)(c-b);return d.set(a.subarray(b,c)),d}(e,0,D)};return n.convert_streams=function(a){function b(){var a=g.getUint16(f);return f+=2,a}function c(){var a=g.getUint32(f);return f+=4,a}function d(a){w.setUint16(u,a);u+=2}function e(a){w.setUint32(u,a);u+=4}var g=new DataView(a),f=0;c();var h=c();c();var k=b();b();c();b();b();c();c();c();c();c();for(var p=0;Math.pow(2,p)<=k;)p++;p--;for(var q=16*
Math.pow(2,p),m=16*k-q,l=12,t=[],r=0;r<k;r++)t.push({tag:c(),offset:c(),compLength:c(),origLength:c(),origChecksum:c()}),l+=16;var v,n=new Uint8Array(12+16*t.length+t.reduce(function(a,b){return a+b.origLength+4},0));r=n.buffer;var w=new DataView(r),u=0;return e(h),d(k),d(q),d(p),d(m),t.forEach(function(a){e(a.tag);e(a.origChecksum);e(l);e(a.origLength);a.outOffset=l;0!=(l+=a.origLength)%4&&(l+=4-l%4)}),t.forEach(function(b){var c=a.slice(b.offset,b.offset+b.compLength);if(b.compLength!=b.origLength){var d=
new Uint8Array(b.origLength);c=new Uint8Array(c,2);z(c,d)}else d=new Uint8Array(c);n.set(d,b.outOffset);d=0;0!=(l=b.outOffset+b.origLength)%4&&(d=4-l%4);n.set((new Uint8Array(d)).buffer,b.outOffset+b.origLength);v=l+d}),r.slice(0,v)},n}({}).convert_streams},function(n,f){function u(b){var a=Object.create(null),c={unitsPerEm:b.head.unitsPerEm,ascender:b.hhea.ascender,descender:b.hhea.descender,forEachGlyph:function(d,e,g,f){var h=0,l=1/c.unitsPerEm*e,m=0,v=-1;n.U.stringToGlyphs(b,d).forEach(function(c,
k){if(-1!==c){k=a[c];if(!k){k=n.U.glyphToPath(b,c);var p=k.cmds,q=k.crds,r,w;if(q.length){k=r=Infinity;var u=w=-Infinity;for(var A=0,H=q.length;A<H;A+=2){var Y=q[A],F=q[A+1];Y<k&&(k=Y);F<r&&(r=F);Y>u&&(u=Y);F>w&&(w=F)}}else k=u=r=w=0;k=a[c]={index:c,advanceWidth:b.hmtx.aWidth[c],xMin:k,yMin:r,xMax:u,yMax:w,pathCommandCount:p.length,forEachPathCommand:function(a){for(var b=0,c=[],d=0,e=p.length;d<e;d++){var g=y[p[d]];c.length=1+g;c[0]=p[d];for(var f=1;f<=g;f++)c[f]=q[b++];a.apply(null,c)}}}}-1!==v&&
(h+=n.U.getPairAdjustment(b,v,c)*l);f.call(null,k,h,m);k.advanceWidth&&(h+=k.advanceWidth*l);g&&(h+=g*e);v=c}m+=65535<d.codePointAt(m)?2:1});return h}};return c}var y={M:2,L:2,Q:4,C:6,Z:0};return function(b){var a=new Uint8Array(b,0,4);a=n._bin.readASCII(a,0,4);if("wOFF"===a)b=f(b);else if("wOF2"===a)throw Error("woff2 fonts not supported");return u(n.parse(b)[0])}}],init:function(n,f,u){n=n();f=f();return u(n,f)}}),N={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",
sdfGlyphSize:64,sdfMargin:.0625,sdfExponent:9,textureWidth:2048},wa=new A.Color,ja=!1,qa=Object.create(null),X;V=S.defineWorkerModule({name:"FontProcessor",dependencies:[N,V,function(){function n(){f&&(u.sort(function(f,b){return f.maxX-b.maxX}),f=!1)}var f=!1,u=[];return{addLineSegment:function(n,b,a,c){u.push({x0:n,y0:b,x1:a,y1:c,minX:Math.min(n,a),minY:Math.min(b,c),maxX:Math.max(n,a),maxY:Math.max(b,c)});f=!0},findNearestSignedDistance:function(f,b){n();for(var a=Infinity,c=Infinity,d=u.length;d--;){var e=
u[d];if(e.maxX+c<=f)break;if(f+c>e.minX&&b-c<e.maxY&&b+c>e.minY){var g=e.x0;var h=e.y0;var k=e.x1-g;e=e.y1-h;var l=k*k+e*e;l=l?Math.max(0,Math.min(1,((f-g)*k+(b-h)*e)/l)):0;g=f-(g+l*k);h=b-(h+l*e);h=g*g+h*h;h<a&&(a=h,c=Math.sqrt(a))}}n();a=!1;for(d=u.length;d--;){h=u[d];if(h.maxX<=f)break;h.minY<b&&h.maxY>b&&h.y0>b!==h.y1>b&&f<(h.x1-h.x0)*(b-h.y0)/(h.y1-h.y0)+h.x0&&(a=!a)}a&&(c=-c);return c}}},function(n,f){var u=f.sdfExponent,y=f.sdfMargin;return function(b,a){var c=new Uint8Array(a*a),d=b.xMax-
b.xMin,e=b.yMax-b.yMin,g=Math.max(d,e),f=Math.max(d,e)/a*(y*a+.5);d=b.xMin-f;e=b.yMin-f;var k=b.xMax+f;f=b.yMax+f;var l=k-d,m=f-e,v=Math.max(l,m);if(b.pathCommandCount){var q=n(b),r,p,t,z;b.forEachPathCommand(function(a,b,c,d,e,g,f){switch(a){case "M":t=r=b;z=p=c;break;case "L":b===t&&c===z||q.addLineSegment(t,z,t=b,z=c);break;case "Q":g={x:t,y:z};for(f=1;16>f;f++){a=f/15;var h=1-a;a={x:h*h*t+2*h*a*b+a*a*d,y:h*h*z+2*h*a*c+a*a*e};q.addLineSegment(g.x,g.y,a.x,a.y);g=a}t=d;z=e;break;case "C":a={x:t,
y:z};for(h=1;16>h;h++){var k=h/15;var m=1-k;k={x:m*m*m*t+3*m*m*k*b+3*m*k*k*d+k*k*k*g,y:m*m*m*z+3*m*m*k*c+3*m*k*k*e+k*k*k*f};q.addLineSegment(a.x,a.y,k.x,k.y);a=k}t=g;z=f;break;case "Z":t===r&&z===p||q.addLineSegment(t,z,r,p)}});for(b=0;b<a;b++)for(var w=0;w<a;w++){var E=q.findNearestSignedDistance(d+l*(b+.5)/a,e+m*(w+.5)/a,g),A=Math.pow(1-Math.abs(E)/v,u)/2;0>E&&(A=1-A);A=Math.max(0,Math.min(255,Math.round(255*A)));c[w*a+b]=A}}return{textureData:c,renderingBounds:[d,e,k,f]}}},function(n,f,u){function y(a,
b){function c(){var d=function(b){console.error("Failure loading font "+a+(a===h?"":"; trying fallback"),b);a!==h&&(a=h,c())};try{var e=new XMLHttpRequest;e.open("get",a,!0);e.responseType="arraybuffer";e.onload=function(){if(400<=e.status)d(Error(e.statusText));else if(0<e.status)try{var a=n(e.response);b(a)}catch(z){d(z)}};e.onerror=d;e.send()}catch(t){d(t)}}c()}function b(a,b){a||(a=h);var c=l[a];c?c.pending?c.pending.push(b):b(c):(l[a]={pending:[b]},y(a,function(b){var c=l[a].pending;l[a]=b;c.forEach(function(a){return a(b)})}))}
function a(a,c,d){a||(a=h);var e=a+"@"+c,g=k[e];g?d(g):b(a,function(a){g=k[e]||(k[e]={fontObj:a,glyphs:{},glyphCount:0});d(g)})}function c(b,c,k){var l=b.text;void 0===l&&(l="");var p=b.font;void 0===p&&(p=h);var q=b.sdfGlyphSize;void 0===q&&(q=64);var m=b.fontSize;void 0===m&&(m=1);var n=b.letterSpacing;void 0===n&&(n=0);var v=b.lineHeight;void 0===v&&(v="normal");var u=b.maxWidth;void 0===u&&(u=Infinity);var y=b.textAlign;void 0===y&&(y="left");var A=b.textIndent;void 0===A&&(A=0);var F=b.whiteSpace;
void 0===F&&(F="normal");var L=b.overflowWrap;void 0===L&&(L="normal");var M=b.anchorX;void 0===M&&(M=0);var x=b.anchorY;void 0===x&&(x=0);var B=b.includeCaretPositions;void 0===B&&(B=!1);var D=b.chunkedBoundsSize;void 0===D&&(D=8192);var G=b.colorRanges;void 0===G&&(G=null);void 0===k&&(k=!1);var S=e(),R={total:0,fontLoad:0,layout:0,sdf:{},sdfTotal:0};-1<l.indexOf("\r")&&(console.warn("FontProcessor.process: got text with \\r chars; normalizing to \\n"),l=l.replace(/\r\n/g,"\n").replace(/\r/g,"\n"));
m=+m;n=+n;u=+u;v=v||"normal";A=+A;a(p,q,function(a){var b=a.fontObj,h=isFinite(u),p=null,t=null,r=null,z=null,w=null,E=null,O=null,H=0,I=0,Y="nowrap"!==F,N=b.ascender,aa=b.descender,fa=b.unitsPerEm;R.fontLoad=e()-S;var X=e(),J=m/fa;"normal"===v&&(v=(N-aa)/fa);v*=m;fa=(v-(N-aa)*J)/2;var na=-(N*J+fa),V=Math.min(v,(N-aa)*J),ha=(N+aa)/2*J-V/2,ba=A,P=new g,ca=[P];b.forEachGlyph(l,m,n,function(a,b,c){var d=l.charAt(c),e=a.advanceWidth*J,f=P.count;"isEmpty"in a||(a.isWhitespace=!!d&&/\s/.test(d),a.isEmpty=
a.xMin===a.xMax||a.yMin===a.yMax);a.isWhitespace||a.isEmpty||I++;if(Y&&h&&!a.isWhitespace&&b+e+ba>u&&f){if(P.glyphAt(f-1).glyphObj.isWhitespace){var k=new g;ba=-b}else for(;f--;)if(0===f&&"break-word"===L){k=new g;ba=-b;break}else if(P.glyphAt(f).glyphObj.isWhitespace){k=P.splitAt(f+1);f=k.glyphAt(0).x;ba-=f;for(var p=k.count;p--;)k.glyphAt(p).x-=f;break}k&&(P.isSoftWrapped=!0,P=k,ca.push(P),H=u)}k=P.glyphAt(P.count);k.glyphObj=a;k.x=b+ba;k.width=e;k.charIndex=c;"\n"===d&&(P=new g,ca.push(P),ba=-(b+
e+n*m)+A)});ca.forEach(function(a){for(var b=a.count;b--;){var c=a.glyphAt(b),d=c.x,e=c.width;if(!c.glyphObj.isWhitespace){a.width=d+e;a.width>H&&(H=a.width);break}}});var W=0,da=0;M&&("number"===typeof M?W=-M:"string"===typeof M&&(W=-H*("left"===M?0:"center"===M?.5:"right"===M?1:d(M))));x&&("number"===typeof x?da=-x:"string"===typeof x&&(b=ca.length*v,da="top"===x?0:"top-baseline"===x?-na:"middle"===x?b/2:"bottom"===x?b:"bottom-baseline"===x?b-fa+aa*J:d(x)*b));if(!k){t=new Float32Array(4*I);r=new Float32Array(I);
E=[Infinity,Infinity,-Infinity,-Infinity];O=[];var oa=na;B&&(w=new Float32Array(3*l.length));G&&(z=new Uint8Array(3*I));var ia=0,U=-1,ka=-1,la,ma;ca.forEach(function(b){var c=b.count,d=b.width;if(0<c){var g=0,h=0;if("center"===y)g=(H-d)/2;else if("right"===y)g=H-d;else if("justify"===y&&b.isSoftWrapped){h=0;for(var k=c;k--;)if(!b.glyphAt(k).glyphObj.isWhitespace){for(;k--;){if(!b.glyphAt(k).glyphObj)debugger;b.glyphAt(k).glyphObj.isWhitespace&&h++}break}h=(H-d)/h}for(d=0;d<c;d++){var m=b.glyphAt(d);
k=m.glyphObj;g&&(m.x+=g);0!==h&&k.isWhitespace&&(g+=h,m.width+=h);if(B){var n=m.charIndex;w[3*n]=m.x+W;w[3*n+1]=m.x+m.width+W;for(w[3*n+2]=oa+ha+da;1<n-U;)w[3*(U+1)]=w[3*U],w[3*(U+1)+1]=w[3*U+1],w[3*(U+1)+2]=w[3*U+2],U++;U=n}if(G)for(n=m.charIndex;n>ka;)ka++,G.hasOwnProperty(ka)&&(ma=G[ka]);if(!k.isWhitespace&&!k.isEmpty){n=ia++;var u=a.glyphs[k.index];if(!u){u=e();var x=f(k,q);R.sdf[l.charAt(m.charIndex)]=e()-u;x.atlasIndex=a.glyphCount++;p||(p=[]);p.push(x);u=a.glyphs[k.index]={atlasIndex:x.atlasIndex,
glyphObj:k,renderingBounds:x.renderingBounds}}x=u.renderingBounds;var A=4*n,C=m.x+W;m=oa+da;t[A]=C+x[0]*J;t[A+1]=m+x[1]*J;t[A+2]=C+x[2]*J;t[A+3]=m+x[3]*J;x=C+k.xMin*J;A=m+k.yMin*J;C+=k.xMax*J;k=m+k.yMax*J;x<E[0]&&(E[0]=x);A<E[1]&&(E[1]=A);C>E[2]&&(E[2]=C);k>E[3]&&(E[3]=k);0===n%D&&(la={start:n,end:n,rect:[Infinity,Infinity,-Infinity,-Infinity]},O.push(la));la.end++;m=la.rect;x<m[0]&&(m[0]=x);A<m[1]&&(m[1]=A);C>m[2]&&(m[2]=C);k>m[3]&&(m[3]=k);r[n]=u.atlasIndex;G&&(k=3*n,z[k]=ma>>16&255,z[k+1]=ma>>
8&255,z[k+2]=ma&255)}}}oa-=v})}for(var ja in R.sdf)R.sdfTotal+=R.sdf[ja];R.layout=e()-X-R.sdfTotal;R.total=e()-S;c({glyphBounds:t,glyphAtlasIndices:r,caretPositions:w,caretHeight:V,glyphColors:z,chunkedBounds:O,ascender:N*J,descender:aa*J,lineHeight:v,topBaseline:na,blockBounds:[W,da-ca.length*v,W+H,da],visibleBounds:E,newGlyphSDFs:p,timings:R})})}function d(a){a=(a=a.match(/^([\d.]+)%$/))?parseFloat(a[1]):NaN;return isNaN(a)?0:a/100}function e(){return(self.performance||Date).now()}function g(){this.data=
[]}var h=u.defaultFontURL,k=Object.create(null),l=Object.create(null);g.prototype={width:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/4)},glyphAt:function(a){var b=g.flyweight;b.data=this.data;b.index=a;return b},splitAt:function(a){var b=new g;b.data=this.data.splice(4*a);return b}};g.flyweight=["glyphObj","x","width","charIndex"].reduce(function(a,b,c,d){Object.defineProperty(a,b,{get:function(){return this.data[4*this.index+c]},set:function(a){this.data[4*this.index+c]=a}});
return a},{data:null,index:0});return{process:c,measure:function(a,b){c(a,function(a){a=a.blockBounds;b({width:a[2]-a[0],height:a[3]-a[1]})},{metricsOnly:!0})},loadFont:b}}],init:function(n,f,u,y,b){var a=n.defaultFontURL;n=y(u,{sdfExponent:n.sdfExponent,sdfMargin:n.sdfMargin});return b(f,n,{defaultFontURL:a})}});var xa=S.defineWorkerModule({name:"TextBuilder",dependencies:[V,S.ThenableWorkerModule],init:function(n,f){return function(u){var y=new f;n.process(u,y.resolve);return y}},getTransferables:function(n){var f=
[n.glyphBounds.buffer,n.glyphAtlasIndices.buffer];n.caretPositions&&f.push(n.caretPositions.buffer);n.newGlyphSDFs&&n.newGlyphSDFs.forEach(function(n){f.push(n.textureData.buffer)});return f}}),ta=function(){function n(a){var b=y[a];b||(b=y[a]=(new A.PlaneBufferGeometry(1,1,a,a)).translate(.5,.5,0));return b}function f(a,b,e,g){var c=a.getAttribute(b);e?c&&c.array.length===e.length?(c.array.set(e),c.needsUpdate=!0):(a.setAttribute(b,new A.InstancedBufferAttribute(e,g)),delete a._maxInstanceCount,
a.dispose()):c&&a.deleteAttribute(b)}function u(a,b){a[a.hasOwnProperty("instanceCount")?"instanceCount":"maxInstancedCount"]=b}var y={},b=new A.Vector3,a=function(a){function c(){a.call(this);this.detail=1;this.groups=[{start:0,count:Infinity,materialIndex:0},{start:0,count:Infinity,materialIndex:1}];this.boundingSphere=new A.Sphere;this.boundingBox=new A.Box3}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;var e={detail:{configurable:!0}};c.prototype.computeBoundingSphere=
function(){};c.prototype.computeBoundingBox=function(){};e.detail.set=function(a){var b=this;if(a!==this._detail){this._detail=a;if("number"!==typeof a||1>a)a=1;var c=n(a);["position","normal","uv"].forEach(function(a){b.attributes[a]=c.attributes[a].clone()});this.setIndex(c.getIndex().clone())}};e.detail.get=function(){return this._detail};c.prototype.updateGlyphs=function(a,c,d,e,m){f(this,"aTroikaGlyphBounds",a,4);f(this,"aTroikaGlyphIndex",c,1);f(this,"aTroikaGlyphColor",m,3);this._chunkedBounds=
e;u(this,c.length);a=this.boundingSphere;a.center.set((d[0]+d[2])/2,(d[1]+d[3])/2,0);a.radius=a.center.distanceTo(b.set(d[0],d[1],0));a=this.boundingBox;a.min.set(d[0],d[1],0);a.max.set(d[2],d[3],0)};c.prototype.applyClipRect=function(a){var b=this.getAttribute("aTroikaGlyphIndex").count,c=this._chunkedBounds;if(c)for(var d=c.length;d--;){b=c[d].end;var e=c[d].rect;if(e[1]<a.w&&e[3]>a.y&&e[0]<a.z&&e[2]>a.x)break}u(this,b)};Object.defineProperties(c.prototype,e);return c}(A.InstancedBufferGeometry);
a.prototype.setAttribute||(a.prototype.setAttribute=function(a,b){this.attributes[a]=b;return this});return a}();S=function(){function n(a){return Array.isArray(a)?a[0]:a}var f=new A.MeshBasicMaterial({color:16777215,side:A.DoubleSide,transparent:!0}),u=new A.Matrix4,y=new A.Vector3,b=new A.Vector3,a=[],c=new A.Vector3,d=new A.Mesh((new A.PlaneBufferGeometry(1,1)).translate(.5,.5,0),f),e={type:"syncstart"},g={type:"synccomplete"},h="font fontSize letterSpacing lineHeight maxWidth overflowWrap text textAlign textIndent whiteSpace anchorX anchorY colorRanges sdfGlyphSize".split(" "),
k=h.concat("material","color","depthOffset","clipRect","orientation","glyphGeometryDetail"),l=function(h){function l(){var a=new ta;h.call(this,a,null);this.text="";this.anchorY=this.anchorX=0;this.font=null;this.fontSize=.1;this.letterSpacing=0;this.lineHeight="normal";this.maxWidth=Infinity;this.overflowWrap="normal";this.textAlign="left";this.textIndent=0;this.whiteSpace="normal";this.colorRanges=this.color=this.material=null;this.outlineColor=this.outlineWidth=0;this.outlineOpacity=1;this.strokeWidth=
this.outlineOffsetY=this.outlineOffsetX=this.outlineBlur=0;this.strokeColor=8421504;this.fillOpacity=this.strokeOpacity=1;this.depthOffset=0;this.clipRect=null;this.orientation="+x+y";this.glyphGeometryDetail=1;this.sdfGlyphSize=null;this.debugSDF=!1}h&&(l.__proto__=h);l.prototype=Object.create(h&&h.prototype);l.prototype.constructor=l;var m={textRenderInfo:{configurable:!0},material:{configurable:!0},glyphGeometryDetail:{configurable:!0},customDepthMaterial:{configurable:!0},customDistanceMaterial:{configurable:!0}};
l.prototype.sync=function(a){var b=this;this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(a):(this._isSyncing=!0,this.dispatchEvent(e),ia({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,
includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize},function(c){b._isSyncing=!1;b._textRenderInfo=c;b.geometry.updateGlyphs(c.glyphBounds,c.glyphAtlasIndices,c.blockBounds,c.chunkedBounds,c.glyphColors);var d=b._queuedSyncs;d&&(b._queuedSyncs=null,b._needsSync=!0,b.sync(function(){d.forEach(function(a){return a&&a()})}));b.dispatchEvent(g);a&&a()})))};l.prototype.onBeforeRender=function(a,b,c,d,e,f){this.sync();e.isTroikaTextMaterial&&this._prepareForRender(e)};l.prototype.dispose=function(){this.geometry.dispose()};
m.textRenderInfo.get=function(){return this._textRenderInfo||null};m.material.get=function(){var a=this._derivedMaterial,b=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=f.clone());a&&a.baseMaterial===b||(a=this._derivedMaterial=ra(b),b.addEventListener("dispose",function E(){b.removeEventListener("dispose",E);a.dispose()}));if(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){var c=a._outlineMtl;c||(c=a._outlineMtl=Object.create(a,{id:{value:a.id+.1}}),
c.isTextOutlineMaterial=!0,c.depthWrite=!1,c.map=null,a.addEventListener("dispose",function E(){a.removeEventListener("dispose",E);c.dispose()}));return[c,a]}return a};m.material.set=function(a){a&&a.isTroikaTextMaterial?(this._derivedMaterial=a,this._baseMaterial=a.baseMaterial):this._baseMaterial=a};m.glyphGeometryDetail.get=function(){return this.geometry.detail};m.glyphGeometryDetail.set=function(a){this.geometry.detail=a};m.customDepthMaterial.get=function(){return n(this.material).getDepthMaterial()};
m.customDistanceMaterial.get=function(){return n(this.material).getDistanceMaterial()};l.prototype._prepareForRender=function(a){var d=a.isTextOutlineMaterial,e=a.uniforms,f=this.textRenderInfo;if(f){var g=f.sdfTexture,h=f.blockBounds;e.uTroikaSDFTexture.value=g;e.uTroikaSDFTextureSize.value.set(g.image.width,g.image.height);e.uTroikaSDFGlyphSize.value=f.sdfGlyphSize;e.uTroikaSDFExponent.value=f.sdfExponent;e.uTroikaTotalBounds.value.fromArray(h);e.uTroikaUseGlyphColors.value=!d&&!!f.glyphColors;
var k=f=0;g=0;var l=0,m=0;if(d){l=this.outlineOffsetX;m=this.outlineOffsetY;k=this.outlineBlur;var p=this.outlineOpacity;f=this._parsePercent(this.outlineWidth)||0;k=Math.max(0,this._parsePercent(k)||0);l=this._parsePercent(l)||0;m=this._parsePercent(m)||0}else{if(g=Math.max(0,this._parsePercent(this.strokeWidth)||0)){var n=this.strokeColor;e.uTroikaStrokeColor.value.set(null==n?8421504:n);n=this.strokeOpacity;null==n&&(n=1)}p=this.fillOpacity}e.uTroikaDistanceOffset.value=f;e.uTroikaPositionOffset.value.set(l,
m);e.uTroikaBlurRadius.value=k;e.uTroikaStrokeWidth.value=g;e.uTroikaStrokeOpacity.value=n;e.uTroikaFillOpacity.value=null==p?1:p;(n=this.clipRect)&&Array.isArray(n)&&4===n.length?e.uTroikaClipRect.value.fromArray(n):(n=100*(this.fontSize||.1),e.uTroikaClipRect.value.set(h[0]-n,h[1]-n,h[2]+n,h[3]+n));this.geometry.applyClipRect(e.uTroikaClipRect.value)}e.uTroikaSDFDebug.value=!!this.debugSDF;a.polygonOffset=!!this.depthOffset;a.polygonOffsetFactor=a.polygonOffsetUnits=this.depthOffset||0;d=d?this.outlineColor||
0:this.color;null==d?delete a.color:(h=a.hasOwnProperty("color")?a.color:a.color=new A.Color,(d!==h._input||"object"===typeof d)&&h.set(h._input=d));d=this.orientation||"+x+y";d!==a._orientation&&(e=e.uTroikaOrient.value,d=d.replace(/[^-+xyz]/g,""),(g="+x+y"!==d&&d.match(/^([-+])([xyz])([-+])([xyz])$/))?(h=g[1],n=g[2],f=g[3],g=g[4],y.set(0,0,0)[n]="-"===h?1:-1,b.set(0,0,0)[g]="-"===f?-1:1,u.lookAt(c,y.cross(b),b),e.setFromMatrix4(u)):e.identity(),a._orientation=d)};l.prototype._parsePercent=function(a){"string"===
typeof a&&(a=(a=a.match(/^(-?[\d.]+)%$/))?parseFloat(a[1]):NaN,a=(isNaN(a)?0:a/100)*this.fontSize);return a};l.prototype.raycast=function(b,c){var e=this.textRenderInfo;if(e)for(e=e.blockBounds,d.matrixWorld.multiplyMatrices(this.matrixWorld,u.set(e[2]-e[0],0,0,e[0],0,e[3]-e[1],0,e[1],0,0,1,0,0,0,0,1)),a.length=0,d.raycast(b,a),b=0;b<a.length;b++)a[b].object=this,c.push(a[b])};l.prototype.copy=function(a){var b=this,c=this.geometry;h.prototype.copy.call(this,a);this.geometry=c;k.forEach(function(c){b[c]=
a[c]});return this};l.prototype.clone=function(){return(new this.constructor).copy(this)};Object.defineProperties(l.prototype,m);return l}(A.Mesh);h.forEach(function(a){var b="_private_"+a;Object.defineProperty(l.prototype,a,{get:function(){return this[b]},set:function(a){a!==this[b]&&(this[b]=a,this._needsSync=!0)}})});var m=!1;Object.defineProperty(l.prototype,"anchor",{get:function(){return this._deprecated_anchor},set:function(a){this._deprecated_anchor=a;m||(console.warn("TextMesh: `anchor` has been deprecated; use `anchorX` and `anchorY` instead."),
m=!0);Array.isArray(a)?(this.anchorX=100*(+a[0]||0)+"%",this.anchorY=100*(+a[1]||0)+"%"):this.anchorX=this.anchorY=0}});return l}();var ua=new WeakMap,sa=new WeakMap;F.GlyphsGeometry=ta;F.Text=S;F.configureTextBuilder=function(n){ja?console.warn("configureTextBuilder called after first font request; will be ignored."):pa(N,n)};F.createTextDerivedMaterial=ra;F.fontProcessorWorkerModule=V;F.getCaretAtPoint=function(n,f,u){var y=null,b=n.caretHeight;n=ya(n);var a=Infinity;n.forEach(function(c,d){Math.abs(u-
(d+b/2))<Math.abs(u-(a+b/2))&&(a=d)});n.get(a).forEach(function(a){if(!y||Math.abs(f-a.x)<Math.abs(f-y.x))y=a});return y};F.getSelectionRects=function(n,f,u){if(n){var y=ua.get(n);if(y&&y.start===f&&y.end===u)return y.rects;y=n.caretPositions;var b=n.caretHeight,a=n.blockBounds;if(u<f){var c=f;f=u;u=c}f=Math.max(f,0);u=Math.min(u,y.length+1);c=new Map;for(var d=f;d<u;d++){var e=y[3*d],g=y[3*d+1],h=y[3*d+2],k=c.get(h);k?(k.left=Math.max(Math.min(k.left,e),a[0]),k.right=Math.min(Math.max(k.right,g),
a[2])):(k={left:e,right:g,bottom:h,top:h+b},c.set(h,k))}var l=[];c.forEach(function(a){l.push(a)});ua.set(n,{start:f,end:u,rects:l})}return l};F.preloadFont=function(n,f){var u=n.font,y=n.characters;n=n.sdfGlyphSize;y=Array.isArray(y)?y.join("\n"):""+y;ia({font:u,sdfGlyphSize:n,text:y},f)};Object.defineProperty(F,"__esModule",{value:!0})})
| 506.294521 | 2,255 | 0.671992 |
0189f6885e610abe0a75c07e08c6aecc486bb99d | 118 | js | JavaScript | lib/index.js | cfn2/cfn2-parser | 563723493ff423d48caf9032994d011fd4bc5224 | [
"MIT"
] | null | null | null | lib/index.js | cfn2/cfn2-parser | 563723493ff423d48caf9032994d011fd4bc5224 | [
"MIT"
] | null | null | null | lib/index.js | cfn2/cfn2-parser | 563723493ff423d48caf9032994d011fd4bc5224 | [
"MIT"
] | null | null | null | Object.assign(exports,
require('declarative-traverser'),
require('./errors'),
require('./makeTemplateParser'));
| 23.6 | 35 | 0.711864 |
018b485a10ce853a2a2ee60f70494218718353e9 | 3,663 | js | JavaScript | src/game.js | CIS580/frogger-aaronschif | 966ecb0ab46e83b3c823e7fb9b6d33982e69e575 | [
"CC-BY-2.0"
] | null | null | null | src/game.js | CIS580/frogger-aaronschif | 966ecb0ab46e83b3c823e7fb9b6d33982e69e575 | [
"CC-BY-2.0"
] | null | null | null | src/game.js | CIS580/frogger-aaronschif | 966ecb0ab46e83b3c823e7fb9b6d33982e69e575 | [
"CC-BY-2.0"
] | null | null | null | "use strict";
import {Player} from "./player.js";
import {Car} from "./car.js";
import {Button} from "./button.js";
import {Flag} from "./flag.js";
let backdrop = new Image();
backdrop.src = encodeURI('assets/canvas.png');
export class Game {
constructor(screen) {
// Set up buffers
this.frontBuffer = screen;
this.frontCtx = screen.getContext('2d');
this.backBuffer = document.createElement('canvas');
this.backBuffer.width = screen.width;
this.backBuffer.height = screen.height;
this.backCtx = this.backBuffer.getContext('2d');
this.width = this.frontBuffer.width;
this.height = this.frontBuffer.height;
// Start the game loop
this.oldTime = performance.now();
this.paused = false;
this.level = 0;
this.lives = 3;
this.endTimeout = 0;
this.nextLevel();
}
pause(flag) {
this.paused = (flag == true);
}
loop(newTime) {
var game = this;
var elapsedTime = newTime - this.oldTime;
this.oldTime = newTime;
if(!this.paused) this.update(elapsedTime);
this.render(elapsedTime, this.frontCtx);
// Flip the back buffer
this.frontCtx.drawImage(this.backBuffer, 0, 0);
}
lose() {
this.endTimeout = 4000;
this.level = 0;
this.lives = 3;
this.nextLevel();
console.log('lose')
}
die() {
console.log('die');
this.lives--;
if (this.lives <= 0) {
this.lose();
}
this.start();
}
nextLevel() {
console.log('next')
this.level++;
this.start();
}
start() {
this.player = new Player({x: 0, y: 256}, this);
this.button = new Button(this);
this.flag = new Flag(this);
this.cars = [this.button, this.flag];
for (let i=1; i<11; i++) {
this.cars.push(new Car(this, {heading: (Math.floor((i+1)/2)%2===0?-1:1), x: 64*i, y: -1112}));
}
}
update(elapsedTime) {
if (this.endTimeout > 0) {
return;
}
this.player.update(elapsedTime);
this.button.update(elapsedTime);
this.flag.update(elapsedTime);
let hitBox = this.player.getHitBoxes()[0];
for (let car of this.cars) {
car.update(elapsedTime);
if (
((hitBox.x >= car.x && hitBox.x <= car.x + car.width -1) || (hitBox.x + hitBox.width -1 >= car.x && hitBox.x + hitBox.width -1 <= car.x + car.width -1)) &&
((hitBox.y >= car.y && hitBox.y <= car.y + car.height -1) || (hitBox.y + hitBox.height -1 >= car.y && hitBox.y + hitBox.height -1 <= car.y + car.height -1))
) {
this.player.events.emit('collision', car);
car.events.emit('collision', this.player);
}
}
}
render(elapsedTime, ctx) {
if (this.endTimeout > 0) {
this.endTimeout -= elapsedTime;
ctx.fillStyle = `rgba(0, 0, 0, 0.1)`;
ctx.fillRect(0, 0, this.width, this.height);
ctx.fillStyle = `rgba(255, 0, 0, 0.1)`;
ctx.fillText("loser", 400, 200);
return
}
ctx.drawImage(backdrop, 0, 0);
this.button.render(elapsedTime, ctx);
this.flag.render(elapsedTime, ctx);
for (let car of this.cars) {
car.render(elapsedTime, ctx)
}
this.player.render(elapsedTime, ctx);
ctx.fillStyle = 'black';
ctx.fillText(this.lives + ' Lives', 710, 40);
ctx.fillText('Level '+this.level, 710, 20)
}
}
| 29.304 | 172 | 0.525526 |
018bac5b8d905199bcb3a6563ef443c7401e5c66 | 1,076 | js | JavaScript | src/components/TaskContent.js | samfitz13/Gap2Goal.app | c37ec27aea1ffbb6c3a35f748a198259bf491341 | [
"MIT"
] | 1 | 2021-08-19T23:58:05.000Z | 2021-08-19T23:58:05.000Z | src/components/TaskContent.js | samfitz13/Gap2Goal.app | c37ec27aea1ffbb6c3a35f748a198259bf491341 | [
"MIT"
] | 10 | 2021-08-10T23:52:36.000Z | 2021-08-22T02:25:25.000Z | src/components/TaskContent.js | samfitz13/Gap2Goal.app | c37ec27aea1ffbb6c3a35f748a198259bf491341 | [
"MIT"
] | null | null | null | import React from "react";
import {
Box,
Flex,
Heading,
Tag,
Text,
useColorModeValue,
} from "@chakra-ui/react";
import StatusBadge from "./StatusBadge";
import moment from "moment";
export default function TaskContent({ task }, statusBadgeDisplay) {
return (
<Box
mx="auto"
px={8}
py={4}
maxW="3xl"
shadow="sm"
_hover={{
shadow: "2xl",
}}
w="full"
borderWidth="1px"
bg={useColorModeValue("white", "gray.800")}
>
<Flex justify="space-between">
<Heading justifyContent="start" flexWrap="wrap" fontSize="lg">
{task.name}
</Heading>
<Flex>
{moment(task.dueDate).fromNow().includes("ago") &&
task.status !== "Complete" ? (
<Tag maxH="1rem" size="lg" colorScheme="red" variant="subtle">
Overdue
</Tag>
) : null}
<StatusBadge display={statusBadgeDisplay} status={task.status} />
</Flex>
</Flex>
<Box mt={2}>
<Text>{task.description}</Text>
{task.dueDate ? (
<Text>Due Date: {moment(task.dueDate).fromNow()}</Text>
) : null}
</Box>
</Box>
);
}
| 20.692308 | 70 | 0.594796 |
018c44fb57b72d31241329b95ad28b45cd65088f | 990 | js | JavaScript | src/__test__/Calculator.test.js | eri8-9/react-app | 39e4f832d8db1538b728aaf3160678152c6698ab | [
"MIT"
] | null | null | null | src/__test__/Calculator.test.js | eri8-9/react-app | 39e4f832d8db1538b728aaf3160678152c6698ab | [
"MIT"
] | 1 | 2021-08-21T21:28:47.000Z | 2021-08-21T21:28:47.000Z | src/__test__/Calculator.test.js | eri8-9/react-app | 39e4f832d8db1538b728aaf3160678152c6698ab | [
"MIT"
] | null | null | null | import React from 'react';
import TestRenderer from 'react-test-renderer';
import { render, screen } from '@testing-library/react';
import Calculator from '../components/Calculator';
describe('Calculator test', () => {
it('Should render same text passed into ...', () => {
const tree = TestRenderer.create(<Calculator />).toJSON();
expect(tree).toMatchSnapshot();
});
it('renders the main heading', () => {
render(<Calculator />);
const heading = screen.getByText(/Lets do some math/i);
expect(heading).toMatchSnapshot();
});
it('Test AC', () => {
render(<Calculator />);
const allClear = screen.getByText(/AC/i);
expect(allClear).toMatchSnapshot();
});
it('Test +/-', () => {
render(<Calculator />);
const simbol = screen.getByText('+/-');
expect(simbol).toMatchSnapshot();
});
it('Test %', () => {
render(<Calculator />);
const quantity = screen.getByText(/%/i);
expect(quantity).toMatchSnapshot();
});
});
| 27.5 | 62 | 0.616162 |
018c4d1529b410c2ab604631dc4928b09adfd5ca | 146 | js | JavaScript | src/testHelper.js | qrusadorz/utils-node | a9d21c9eccc1685097a1beae1ccd04df83373926 | [
"MIT"
] | null | null | null | src/testHelper.js | qrusadorz/utils-node | a9d21c9eccc1685097a1beae1ccd04df83373926 | [
"MIT"
] | 1 | 2022-01-22T13:23:25.000Z | 2022-01-22T13:23:25.000Z | src/testHelper.js | qrusadorz/utils-node | a9d21c9eccc1685097a1beae1ccd04df83373926 | [
"MIT"
] | null | null | null | // for npm test
const getPrivateMethodsInTest = (methods) => process.env.NODE_ENV === 'test' ? methods : {};
export { getPrivateMethodsInTest };
| 29.2 | 92 | 0.705479 |
018d978c900f20942665b568bd92c68d1a8af55d | 700 | js | JavaScript | JS-Advanced-May-2020/Jan2021-08-DomIntroductionExercise/08-GenerateReport/report.js | marinakolova/SoftUni-JavaScript-and-Front-End-Courses | b6ed6e8a0f69b06541feb49438d8120cb483fd5c | [
"MIT"
] | null | null | null | JS-Advanced-May-2020/Jan2021-08-DomIntroductionExercise/08-GenerateReport/report.js | marinakolova/SoftUni-JavaScript-and-Front-End-Courses | b6ed6e8a0f69b06541feb49438d8120cb483fd5c | [
"MIT"
] | null | null | null | JS-Advanced-May-2020/Jan2021-08-DomIntroductionExercise/08-GenerateReport/report.js | marinakolova/SoftUni-JavaScript-and-Front-End-Courses | b6ed6e8a0f69b06541feb49438d8120cb483fd5c | [
"MIT"
] | null | null | null | function generateReport() {
let checkboxes = document.querySelectorAll("input[type='checkbox']");
let selected = Array.from(checkboxes)
.map((x, i) => [x, i])
.filter(x => x[0].checked)
.map(x => [x[0].name, x[1]])
let rows = document.getElementsByTagName("tr");
let rowData = Array.from(rows)
.slice(1)
.map(x => Array.from(x.children).map(y => y.innerHTML))
document.getElementById("output").value = JSON.stringify(
rowData.map(x =>
selected.reduce((a, v) => {
const [sColName, sColIndex] = v
a[sColName] = x[sColIndex]
return a
}, {})
)
)
}
| 28 | 73 | 0.521429 |
018de8f5d7995a424b00820daf73542aa56acbad | 39 | js | JavaScript | js/lib/pn/vm.min.js | 1337GameDev/WordPressPluginExample | 73f86850f8ab4c7061bfcce0c30af00572e073c0 | [
"MIT"
] | null | null | null | js/lib/pn/vm.min.js | 1337GameDev/WordPressPluginExample | 73f86850f8ab4c7061bfcce0c30af00572e073c0 | [
"MIT"
] | null | null | null | js/lib/pn/vm.min.js | 1337GameDev/WordPressPluginExample | 73f86850f8ab4c7061bfcce0c30af00572e073c0 | [
"MIT"
] | null | null | null | var vm=require("vm");module.exports=vm; | 39 | 39 | 0.74359 |
018fde406270127d4a112e0d19898fa79aa37a74 | 2,111 | js | JavaScript | test/unit/providers/s3.js | CometaEngine/Cometa | 0b83239bca43e1653c702d33b733ae93d09ba9ee | [
"MIT"
] | 8 | 2018-04-05T02:01:03.000Z | 2022-02-04T22:31:23.000Z | test/unit/providers/s3.js | CometaEngine/Cometa | 0b83239bca43e1653c702d33b733ae93d09ba9ee | [
"MIT"
] | 77 | 2018-03-15T21:37:41.000Z | 2020-04-21T18:39:35.000Z | test/unit/providers/s3.js | CometaEngine/Cometa | 0b83239bca43e1653c702d33b733ae93d09ba9ee | [
"MIT"
] | 5 | 2018-03-28T14:43:26.000Z | 2019-07-15T18:13:47.000Z | const aws = require('aws-sdk');
const should = require('should');
const sinon = require('sinon');
const { Readable } = require('stream');
const config = require('../../../app/config');
const S3 = require('../../../app/providers/s3');
const sandbox = sinon.createSandbox();
module.exports = () => {
beforeEach(() => {});
afterEach(() => sandbox.restore());
it('Should be a function.', (done) => {
should(S3).be.a.Function();
done();
});
it('Sould return an image.', (done) => {
sandbox
.stub(aws.Request.prototype, 'send')
.yields(null, { Body: 'Binary image data will be here.' });
const provider = new S3({
...config.cometa,
...{ output: { extension: 'png' } }
});
provider
.on('provided', (message) => {
should(message).equal('Image received from S3 provider.');
})
.on('data', (chunk) => {
should(provider).be.an.Object().and.be.instanceOf(Readable).with.property('_read');
should(chunk).be.an.Object().with.properties('output', 'body', 'originalSize');
should(chunk.output).be.an.Object();
should(chunk.output.extension).equal('png');
should(chunk.body).equal('Binary image data will be here.');
should(chunk.originalSize).equal(31);
done();
});
});
it('Should fail (no config)', (done) => {
let provider;
try {
provider = new S3();
} catch (error) {
should(!!provider).equal(false);
should(error).be.an.Object().with.property('message');
should(error.message).equal('Configuration is required.');
done();
}
});
it('Should fail (throw error)', (done) => {
sandbox.stub(aws.Request.prototype, 'send').yields(new Error('Testing error.'));
const provider = new S3(config.cometa);
provider.on('error', (error) => {
should(provider).be.an.Object().and.instanceOf(Readable).with.property('_read');
should(error).be.an.Object().with.property('message');
should(error.message).equal('Testing error.');
done();
});
provider.pipe(process.stdout);
});
};
| 27.415584 | 91 | 0.584557 |
01907a269920b9e880dd8de0bf07e9c561d360a1 | 192 | js | JavaScript | app/core/TitleBar/titleBarDirec.js | pyj4104/FOTransBaseFE | 54b39a3306b83ab24be7613b46d9e9a26ebb056c | [
"Apache-2.0"
] | null | null | null | app/core/TitleBar/titleBarDirec.js | pyj4104/FOTransBaseFE | 54b39a3306b83ab24be7613b46d9e9a26ebb056c | [
"Apache-2.0"
] | null | null | null | app/core/TitleBar/titleBarDirec.js | pyj4104/FOTransBaseFE | 54b39a3306b83ab24be7613b46d9e9a26ebb056c | [
"Apache-2.0"
] | null | null | null | angular
.module("FOTransBaseFE")
.directive('titleBarDirec', titleBarDirec);
function titleBarDirec(){
return {restrict: "AE", templateUrl: "./app/core/TitleBar/titleBarTemplate.html"};
}; | 27.428571 | 83 | 0.75 |
0190b2bfb8a094e27e8a6bfe3513f4945c6484ad | 68 | js | JavaScript | next.config.js | jasonrundell/nextjs-airtable-starter | 4559a38b9596f7b89de2c648cffe56f9cfa5b6cc | [
"MIT"
] | null | null | null | next.config.js | jasonrundell/nextjs-airtable-starter | 4559a38b9596f7b89de2c648cffe56f9cfa5b6cc | [
"MIT"
] | 1 | 2020-09-30T04:41:41.000Z | 2020-09-30T04:41:41.000Z | next.config.js | jasonrundell/nextjs-airtable-starter | 4559a38b9596f7b89de2c648cffe56f9cfa5b6cc | [
"MIT"
] | null | null | null | module.exports = {
basePath: '',
env: {
id: 'local',
},
}
| 9.714286 | 18 | 0.455882 |
01912afc623729c395af1d736ce10139499bff30 | 2,754 | js | JavaScript | src/client/components/duration.js | IvanFon/mochawesome-report-generator | 0cf301071014470158d589111919df24a41e9ce9 | [
"MIT"
] | 1 | 2021-03-24T20:12:07.000Z | 2021-03-24T20:12:07.000Z | src/client/components/duration.js | IvanFon/mochawesome-report-generator | 0cf301071014470158d589111919df24a41e9ce9 | [
"MIT"
] | null | null | null | src/client/components/duration.js | IvanFon/mochawesome-report-generator | 0cf301071014470158d589111919df24a41e9ce9 | [
"MIT"
] | null | null | null | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
class Duration extends PureComponent {
static propTypes = {
className: PropTypes.string,
unitsClassName: PropTypes.string,
timer: PropTypes.number,
isSummary: PropTypes.bool,
};
_getDurationObj = durationInMs => {
const DAY = 24 * 60 * 60 * 1000;
const HOUR = 60 * 60 * 1000;
const MINUTE = 60 * 1000;
const SECOND = 1000;
const days = Math.floor(durationInMs / DAY);
const daysms = durationInMs % DAY;
const hrs = Math.floor(daysms / HOUR);
const hrsms = durationInMs % HOUR;
const min = Math.floor(hrsms / MINUTE);
const minms = durationInMs % MINUTE;
const sec = Math.floor(minms / SECOND);
const ms = durationInMs % SECOND;
return { days, hrs, min, sec, ms };
};
formatSummaryDuration = context => {
const { days, hrs, min, sec, ms } = context;
if (days < 1) {
if (hrs < 1) {
if (min < 1) {
if (sec < 1) {
return ms;
}
return `${sec}.${ms}`;
}
return `${min}:${sec < 10 ? `0${sec}` : sec}`;
}
return `${hrs}:${min < 10 ? `0${min}` : min}`;
}
return `${days}d ${hrs}:${min < 10 ? `0${min}` : min}`;
};
formatDuration = context => {
const { days, hrs, min, sec, ms } = context;
if (days < 1) {
if (hrs < 1) {
if (min < 1) {
if (sec < 1) {
return `${ms}ms`;
}
return `${sec}.${ms}s`;
}
return `${min}:${sec < 10 ? `0${sec}` : sec}.${ms}m`;
}
return `${hrs}:${min < 10 ? `0${min}` : min}:${
sec < 10 ? `0${sec}` : sec
}.${ms}h`;
}
return `${days}d ${hrs}:${min < 10 ? `0${min}` : min}:${
sec < 10 ? `0${sec}` : sec
}.${ms}h`;
};
getSummaryDurationUnits = context => {
const { hrs, min, sec } = context;
if (hrs < 1) {
if (min < 1) {
if (sec < 1) {
return 'ms';
}
return 's';
}
return 'm';
}
return 'h';
};
render() {
const { className, unitsClassName, timer, isSummary } = this.props;
const duration = this._getDurationObj(timer);
const summaryDuration = this.formatSummaryDuration(duration);
const units = this.getSummaryDurationUnits(duration);
if (isSummary) {
return (
<span>
<span className={classNames(className)}>{summaryDuration}</span>
<span className={classNames(unitsClassName)}>{units}</span>
</span>
);
}
return (
<span className={classNames(className)}>
{this.formatDuration(duration)}
</span>
);
}
}
export default Duration;
| 25.738318 | 74 | 0.520697 |
01914160404453311f5b99334ba7b5797dc0a53b | 13,302 | js | JavaScript | src/store/user.test.js | talhasch/lander | 0f1a90026b8a6470968ad0c5e434ac56d1d5b51c | [
"MIT"
] | 40 | 2019-02-28T17:46:21.000Z | 2021-05-31T05:27:42.000Z | src/store/user.test.js | talhasch/lander | 0f1a90026b8a6470968ad0c5e434ac56d1d5b51c | [
"MIT"
] | 11 | 2019-10-21T10:19:07.000Z | 2022-02-26T09:56:11.000Z | src/store/user.test.js | talhasch/lander | 0f1a90026b8a6470968ad0c5e434ac56d1d5b51c | [
"MIT"
] | 7 | 2019-07-03T18:40:25.000Z | 2021-05-31T05:27:50.000Z | import reducer, {
prepareDraftForSave,
loginAct,
loadProfileAct,
loadDataAct,
setBgImageAct,
setBgColorAct,
setBgBlurAct,
setBioAct,
setPhotoAct,
setNameAct,
setDescriptionAct,
setAccountAct,
setWalletAct,
setContactAct,
saveDraftAct,
saveDraftDoneAct,
saveDraftErrorAct,
publishAct,
publishErrorAct,
publishDoneAct,
logoutAct
} from "./user"
import {dataModel} from "../constants";
import {
TOGGLE_STYLE,
TOGGLE_BIO_EDIT,
TOGGLE_PHOTO_UPLOAD,
TOGGLE_NAME_EDIT,
TOGGLE_DESCRIPTION_EDIT,
TOGGLE_ACCOUNT_EDIT,
TOGGLE_WALLET_EDIT,
TOGGLE_CONTACT_EDIT
} from "./ui";
let state = undefined;
it('1 default state', () => {
expect(reducer(state, {})).toMatchSnapshot();
});
it('2 login', () => {
const act = loginAct('foo');
state = reducer(null, act);
expect(state).toMatchSnapshot();
});
it('3 profile data loaded', () => {
const act = loadProfileAct({foo: "bar"});
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('4 draft and public data loaded', () => {
const act = loadDataAct(dataModel(), null);
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('5 style dialog opened', () => {
const act = {type: TOGGLE_STYLE};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('6 bg image set', () => {
const act = setBgImageAct('foo.jpg');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('7 bg color set', () => {
const act = setBgColorAct('red');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('8 bg blur set', () => {
const act = setBgBlurAct(3);
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('9 style dialog closed', () => {
const act = {type: TOGGLE_STYLE};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('10 bio dialog opened', () => {
const act = {type: TOGGLE_BIO_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('11 bio set', () => {
const act = setBioAct("lorem ipsum dolor sit amet");
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('12 bio dialog closed', () => {
const act = {type: TOGGLE_BIO_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('13 style dialog opened', () => {
const act = {type: TOGGLE_STYLE};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('14 bg image set', () => {
const act = setBgImageAct('foo.jpg');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('15 bg color set', () => {
const act = setBgColorAct('red');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('16 bg blur set', () => {
const act = setBgBlurAct(3);
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('17 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('18 draft not saved due to an error', () => {
const act = saveDraftErrorAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('19 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('20 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('21 publish not saved due to an error', () => {
const act = publishErrorAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('22 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('23 bio dialog opened', () => {
const act = {type: TOGGLE_BIO_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('24 bio set', () => {
const act = setBioAct('lorem ipsum dolor sit amet');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('25 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('26 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('27 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('28 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('29 photo dialog opened', () => {
const act = {type: TOGGLE_PHOTO_UPLOAD};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('30 image set', () => {
const act = setPhotoAct('base64string');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('31 image set', () => {
const act = setPhotoAct('https://fooo.bar/baz.jpg');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('32 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('33 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('34 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('35 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('36 name dialog opened', () => {
const act = {type: TOGGLE_NAME_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('37 name set', () => {
const act = setNameAct('foo');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('38 name dialog closed', () => {
const act = {type: TOGGLE_NAME_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('39 name dialog opened', () => {
const act = {type: TOGGLE_NAME_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('40 name set', () => {
const act = setNameAct('bar');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('41 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('42 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('43 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('44 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('45 description dialog opened', () => {
const act = {type: TOGGLE_DESCRIPTION_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('46 description set', () => {
const act = setDescriptionAct('lorem ipsum dolor');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('47 description dialog closed', () => {
const act = {type: TOGGLE_DESCRIPTION_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('48 description dialog opened', () => {
const act = {type: TOGGLE_DESCRIPTION_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('49 description set', () => {
const act = setDescriptionAct('foo bar baz');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('50 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('51 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('52 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('53 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('54 account dialog opened', () => {
const act = {type: TOGGLE_ACCOUNT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('55 twitter account set', () => {
const act = setAccountAct('twitter', 'foo');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('56 instagram account set', () => {
const act = setAccountAct('instagram', 'bar');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('57 account dialog closed', () => {
const act = {type: TOGGLE_ACCOUNT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('58 account dialog opened', () => {
const act = {type: TOGGLE_ACCOUNT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('59 instagram account set', () => {
const act = setAccountAct('instagram', 'bar');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('60 twitter account set', () => {
const act = setAccountAct('twitter', 'foo');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('61 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('62 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('63 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('64 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('65 wallet dialog opened', () => {
const act = {type: TOGGLE_WALLET_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('66 bitcoin wallet set', () => {
const act = setWalletAct('bitcoin', '13213123123');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('67 ethereum wallet set', () => {
const act = setWalletAct('ethereum', '0xqwdqw313');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('68 wallet dialog closed', () => {
const act = {type: TOGGLE_WALLET_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('69 wallet dialog opened', () => {
const act = {type: TOGGLE_WALLET_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('70 bitcoin wallet set', () => {
const act = setWalletAct('bitcoin', '13213123123');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('71 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('72 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('73 publish clicked', () => {
const act = publishAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('74 publish saved successfully', () => {
const act = publishDoneAct(prepareDraftForSave(state.draft, false));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('75 contact dialog opened', () => {
const act = {type: TOGGLE_CONTACT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('76 email set', () => {
const act = setContactAct('email', 'foo@bar.com');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('77 address set', () => {
const act = setContactAct('address', 'lorem ipsum street NY');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('78 contact dialog closed', () => {
const act = {type: TOGGLE_CONTACT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('79 contact dialog opened', () => {
const act = {type: TOGGLE_CONTACT_EDIT};
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('80 website set', () => {
const act = setContactAct('website', 'https://mybusiness.com');
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('81 save draft clicked', () => {
const act = saveDraftAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('82 draft saved successfully', () => {
const act = saveDraftDoneAct(prepareDraftForSave(state.draft, true));
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
it('200 logout', () => {
const act = logoutAct();
state = reducer(state, act);
expect(state).toMatchSnapshot();
});
| 24.185455 | 71 | 0.652383 |
0191a584bcdd3967e12047c54b64be17c7f85322 | 6,763 | js | JavaScript | task07/src/main/resources/static/js/myscript.js | ok213/predesign-tasks | 9cef000bd0bf054a4fa53e872101ec4aca011ca4 | [
"BSD-2-Clause"
] | null | null | null | task07/src/main/resources/static/js/myscript.js | ok213/predesign-tasks | 9cef000bd0bf054a4fa53e872101ec4aca011ca4 | [
"BSD-2-Clause"
] | null | null | null | task07/src/main/resources/static/js/myscript.js | ok213/predesign-tasks | 9cef000bd0bf054a4fa53e872101ec4aca011ca4 | [
"BSD-2-Clause"
] | null | null | null |
const apiUserUrl = '/api/v1/user';
const apiRoleUrl = '/api/v1/role';
const btnSendUser = $('#btnSendUser');
$('#btnReadUsers').on('click', getAllUsers);
$('#btnMenuCreateUser').on('click', getModalCreateUser);
function getModalCreateUser() {
$('#createUserModalTitle').text('Create new user');
btnSendUser.text('Add new user');
$('#formGroupId').addClass('d-none');
btnSendUser.unbind('click');
btnSendUser.on('click', userCreate);
getAllRoles();
$('#createUserModal').modal('show');
}
function userCreate(e){
e.preventDefault();
fetch(apiUserUrl, {
method: "POST",
body: JSON.stringify(getFormResults(e.target.form.elements)),
// headers: { 'Content-type': 'application/x-www-form-urlencoded' }
headers: {'Accept': 'application/json, text/plain',
'Content-type': 'application/json;charset=UTF-8'}
})
.then(function(response){
if (response.status !== 200) {
alert('Error receiving data. Status Code: ' + response.status);
return;
}
$('#inputId').val('');
$('#inputEmail').val('');
$('#inputLogin').val('');
$('#inputPassword').val('');
btnSendUser.unbind('click');
$('#createUserModal').modal('hide');
document.getElementById('btnReadUsers').click();
})
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function getModalUpdateUser(id) {
fetch(apiUserUrl + '/' + id, {
method: "GET"
})
.then(function(response){
if (response.status !== 200) {
alert('Error receiving data. Status Code: ' + response.status);
return;
}
response.json().then(function(data) {
// console.log(data);
$('#inputId').val(data.id);
$('#inputEmail').val(data.email);
$('#inputLogin').val(data.login);
$('#inputPassword').val(data.password);
$('#createUserModalTitle').text('Update user');
btnSendUser.text('Update user');
$('#formGroupId').removeClass('d-none');
btnSendUser.unbind('click');
btnSendUser.on('click', updateUser);
getAllRoles();
$('#createUserModal').modal('show');
});
})
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function updateUser(e) {
e.preventDefault();
let a = getFormResults(e.target.form.elements);
let b =1;
fetch(apiUserUrl, {
method: "PUT",
body: JSON.stringify(getFormResults(e.target.form.elements)),
headers: {'Accept': 'application/json, text/plain',
'Content-type': 'application/json;charset=UTF-8'}
})
.then(function(response){
if (response.status !== 200) {
alert('Error receiving data. Status Code: ' + response.status);
return;
}
$('#inputId').val('');
$('#inputEmail').val('');
$('#inputLogin').val('');
$('#inputPassword').val('');
btnSendUser.unbind('click');
$('#createUserModal').modal('hide');
$('#btnReadUsers').click();
})
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function deleteUser(id) {
fetch(apiUserUrl + '/' + id, {
method: "DELETE"
})
.then(function(response){
if (response.status !== 200) {
alert('Error receiving data. Status Code: ' + response.status);
return;
}
$('#btnReadUsers').click();
})
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function getAllUsers() {
fetch(apiUserUrl,{
method: "GET"
})
.then(
function(response) {
if (response.status !== 200) {
alert('Error receiving data. Status Code: ' + response.status);
return;
}
response.json().then(function(data) {
// console.log(data);
let rows = '';
data.forEach(user => {
rows += '<tr>';
rows += '<td>' + user.id + '</td>';
rows += '<td>';
user.roles.forEach(role => {
rows += role.role + '<br>';
});
rows += '</td>';
rows += '<td>' + user.login + '</td>';
rows += '<td>' + user.password + '</td>';
rows += '<td>' + user.email + '</td>';
rows += '<td>';
rows += '<button type="button" class="btn btn-info btn-sm" onclick="getModalUpdateUser(' + user.id + ')">Edit</button>';
rows += '  ';
rows += '<button type="button" class="btn btn-danger btn-sm" onclick="deleteUser(' + user.id + ')">Delete</button>';
rows += '</td>';
rows += '</tr>';
});
document.querySelector('tbody').innerHTML = rows;
});
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function getAllRoles() {
fetch(apiRoleUrl,{
method: "GET"
})
.then(
function(response) {
if (response.status !== 200) {
console.log('Error receiving data. Status Code: ' + response.status);
return;
}
response.json().then(function(data) {
// console.log(data);
let options = '';
data.forEach(role => {
let selected = role.role === 'ROLE_USER'? 'selected' : '';
options += `<option value="${role.id}" ${selected}>${role.role}</option>`;
});
document.querySelector('#inputRole').innerHTML = options;
});
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
}
function getFormResults(formElements) {
let formParams = {};
for (let i = 0; i < formElements.length; i += 1) {
elem = formElements[i];
switch (elem.tagName) {
case 'INPUT':
if (elem.type === 'hidden') break;
formParams[elem.name] = elem.value;
break;
case 'SELECT':
formParams[elem.name] = [{'id': elem.value}];
}
}
return formParams;
}
| 32.830097 | 144 | 0.471241 |
0191ec2aac675a40a2cb825c6f472c2b4c75e431 | 992 | js | JavaScript | src/router/index.js | isaxiao/uviewDemo | ba081c04972d846a61ca02e2b9b00a379cc11214 | [
"MIT"
] | null | null | null | src/router/index.js | isaxiao/uviewDemo | ba081c04972d846a61ca02e2b9b00a379cc11214 | [
"MIT"
] | null | null | null | src/router/index.js | isaxiao/uviewDemo | ba081c04972d846a61ca02e2b9b00a379cc11214 | [
"MIT"
] | null | null | null | import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{ //首页信息
path: '/homePage',
name: 'homePage',
component: () => import('../views/homeComponents/index.vue')
},
{ //资讯中心
path: '/newsList',
name: 'newsList',
component: () => import('../views/newsComponents/index.vue')
},
{ //资讯中心
path: '/cooperationCases/:id',
name: 'cooperationCases',
component: () => import('../views/cooperationCases/index.vue')
},
{ //关于我们
path: '/aboutUs',
name: 'aboutUs',
component: () => import('../views/aboutUs/index.vue')
},
{ //捐赠我们
path: '/donateToUs',
name: 'donateToUs',
component: () => import('../views/donateToUs/index.vue')
},
{ //捐赠我们
path: '/loginOregs',
name: 'loginOregs',
component: () => import('../views/loginOregs/index.vue')
},
{ //路由重定向
path: '/',
redirect: '/homePage',
},
]
const router = new VueRouter({
routes
})
export default router
| 20.666667 | 66 | 0.578629 |
01921e0ff95aa251b83066cc84823b40c7956bf8 | 1,748 | js | JavaScript | webpack.config.babel.js | gj262/noaa-coops-viewer | 16e8e95d4e21e6aaafadcee45785e0dc98903380 | [
"MIT"
] | 1 | 2017-05-02T04:48:07.000Z | 2017-05-02T04:48:07.000Z | webpack.config.babel.js | gj262/noaa-coops-viewer | 16e8e95d4e21e6aaafadcee45785e0dc98903380 | [
"MIT"
] | null | null | null | webpack.config.babel.js | gj262/noaa-coops-viewer | 16e8e95d4e21e6aaafadcee45785e0dc98903380 | [
"MIT"
] | 1 | 2016-04-07T18:44:01.000Z | 2016-04-07T18:44:01.000Z | import webpack from 'webpack'
import { argv } from 'yargs'
import path from 'path'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
const globals = {
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
},
NODE_ENV: process.env.NODE_ENV,
__DEV__: process.env.NODE_ENV === 'development',
__PROD__: process.env.NODE_ENV === 'production',
__DEBUG__: process.env.NODE_ENV === 'development' && !argv.no_debug
}
const basePath = __dirname
const webpackConfig = {
mode: process.env.NODE_ENV,
name: 'compare',
target: 'web',
devtool:
process.env.NODE_ENV === 'development' ? 'inline-source-map' : 'source-map',
entry: {
app: process.env.ENTRY || './src/app.js'
},
output: {
filename: `[name].js`,
path: path.join(__dirname, 'dist')
},
plugins: [
new webpack.DefinePlugin(globals),
new HtmlWebpackPlugin({
template: basePath + '/src/index.html',
hash: false,
filename: 'index.html',
inject: 'body',
minify: {
collapseWhitespace: true
}
}),
new MiniCssExtractPlugin(`[name].css`)
],
resolve: {
modules: [path.join(__dirname, 'src'), 'node_modules'],
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.jsx?$/,
enforce: 'pre',
use: 'eslint-loader'
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {}
},
'css-loader',
'sass-loader'
]
}
]
}
}
export default webpackConfig
| 22.701299 | 80 | 0.57151 |
019298c650ec3593fed36b2d76bf0bc0eb087385 | 890 | js | JavaScript | src/server.js | Mopanc/MaratonaDiscover | a4989c733dbd1c9349ca7ba1459fc4b992170683 | [
"MIT"
] | 2 | 2021-04-23T18:19:58.000Z | 2021-04-25T23:16:22.000Z | src/server.js | Mopanc/MaratonaDiscover | a4989c733dbd1c9349ca7ba1459fc4b992170683 | [
"MIT"
] | 1 | 2021-04-03T16:17:08.000Z | 2021-04-23T18:21:07.000Z | src/server.js | Mopanc/MaratonaDiscover | a4989c733dbd1c9349ca7ba1459fc4b992170683 | [
"MIT"
] | null | null | null | const express = require("express")
//primeiro passo eu preciso criar uma constante para chamar(importar) o pacote expression que já foi instalado la no node_modules
const server = express()
//o valor atribuido á função express criada acima foi a requizição express que agora é chamada para executar por outra constante server
const routes = require("./routes")
const path = require("path")
//usando template engine
server.set('view engine', 'ejs')
//mudar a localização da pasta views
server.set('views', path.join(__dirname, 'views'))
//Habilitar arquivos estáticos
server.use(express.static("public"))
//usar i req/body
server.use(express.urlencoded({ extended: true }))
//routes
server.use(routes)
server.listen(3000, () => console.log('rodando'))
//a funcionalidade listen() vai ligar o servidor na porta que queremos assim que abrir roda uma funçao desta forma uma arrowFunction
| 37.083333 | 135 | 0.764045 |
019303ec57f5753c155ecf25c841eca2ad874655 | 2,341 | js | JavaScript | public/functionScripts/userService1.js | durgakuralkar/app-inventory-rest-services | 38f725b74183349032f1ce689aad73a544d3bc2b | [
"Apache-2.0"
] | null | null | null | public/functionScripts/userService1.js | durgakuralkar/app-inventory-rest-services | 38f725b74183349032f1ce689aad73a544d3bc2b | [
"Apache-2.0"
] | null | null | null | public/functionScripts/userService1.js | durgakuralkar/app-inventory-rest-services | 38f725b74183349032f1ce689aad73a544d3bc2b | [
"Apache-2.0"
] | null | null | null | var dba;
module.exports.setup = function(db){
dba = db;
};
module.exports.process_validateUser = function(data,res){
validateUser(data,res);
}
module.exports.process_getUserRoleList = function(res,data){
getuserRoleList(data,res);
}
module.exports.process_getAduitRecordForUser = function(res,data){
getAduitRecordForUser(data,res);
}
/*var validateUser = function(data, response) {
console.log(data.id);
var adminRole=data.role;
dba.find({selector:{type:"user",userId:data.id,password:data.password}}, function(er, result) {
if (er) {
throw er;
}
//response = result;
console.log(result);
if(result.docs.length != 0){
console.log("inside result.docs.length != 0");
// if(contains(result.docs[0].roles,adminRole)){
result.docs[0].status = true;
//result.docs[0].loggedInRole= adminRole;
response.write(JSON.stringify(result));
response.end();
// }
else{
result.docs[0].status = false;
response.write(JSON.stringify(result));
response.end();}}
});
}*/
var validateUser = function(data, response) {
dba.find({selector:{type:"user",userId:data.id,password:data.password}}, function(er, result) {
if (er) {
throw er;
}
console.log(result);
if(result.docs.length != 0){
result.docs[0].status=true;
response.write(JSON.stringify(result.docs[0]));
response.end();
}
else{
response.write(JSON.stringify({"status":false}));
response.end();}});
}
function contains(arr, element) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === element) {
return true;
}
}
return false;
}
var getuserRoleList = function(data, response) {
dba.find({selector:{type:"userRoles"}}, function(er, result) {
if (er) {
throw er;
}
console.log(result);
if(result.docs.length != 0){
response.write(JSON.stringify(result.docs[0]));
response.end();
}});
}
var getAduitRecordForUser = function(data, response) {
dba.find({selector:{type:"account" , accountLastModifyBy: data.id}}, function(er, result) {
if (er) {
throw er;
}
/* var accountLastModified= result.docs[0]*/
console.log(result);
if(result.docs.length != 0){
response.write(JSON.stringify(result.docs[0]));
response.end();
}});
} | 24.904255 | 96 | 0.625801 |
01931a8336b669f014ca272e6fc9002969c48564 | 1,222 | js | JavaScript | routes/comments.js | ace1122sp/RESTful-Blog-API | ca30fc764b5ade90f92466a3296bb7a79e090c36 | [
"MIT"
] | null | null | null | routes/comments.js | ace1122sp/RESTful-Blog-API | ca30fc764b5ade90f92466a3296bb7a79e090c36 | [
"MIT"
] | null | null | null | routes/comments.js | ace1122sp/RESTful-Blog-API | ca30fc764b5ade90f92466a3296bb7a79e090c36 | [
"MIT"
] | null | null | null | module.exports = {
getComments(req, res) {
const id = req.params.postId;
if(!req.store.posts[id]) {
return res.sendStatus(400);
}
const comments = req.store.posts[id].comments || null;
console.log(comments);
res.status(200);
res.send(comments);
},
addComment(req, res) {
const id = req.params.postId;
if(!req.body.text.trim() || !req.store.posts[id]) {
return res.sendStatus(400);
}
const comment = req.body.text;
req.store.posts[id].comments.push(comment);
res.status(201);
res.send({id});
},
updateComment(req, res) {
const postId = req.params.postId;
if(!req.body.text.trim() || !req.store.posts[postId]) {
return res.sendStatus(400);
}
const commentId = req.params.commentId;
const updatedComment = req.body.text;
req.store.posts[postId].comments[commentId] = updatedComment;
res.status(200);
res.send(updatedComment);
},
removeComment(req, res) {
const postId = req.params.postId;
if(!req.store.posts[postId]) {
return res.sendStatus(400);
}
const commentId = req.params.commentId;
req.store.posts[postId].comments.splice(commentId, 1);
res.status(204).send();
}
}
| 28.418605 | 65 | 0.63257 |
0193fea3d896bf6dea432b0d02768d81704d86a6 | 1,003 | js | JavaScript | src/modules/account.js | basicfu/sip-cd-ui | bf188443f097de6668715f2aa88e5d5eefb3ea8b | [
"MIT"
] | null | null | null | src/modules/account.js | basicfu/sip-cd-ui | bf188443f097de6668715f2aa88e5d5eefb3ea8b | [
"MIT"
] | 6 | 2021-03-09T04:52:39.000Z | 2022-02-12T11:04:47.000Z | src/modules/account.js | basicfu/sip-cd-ui | bf188443f097de6668715f2aa88e5d5eefb3ea8b | [
"MIT"
] | null | null | null | import {insertAccount, listAccount, updateAccount} from 'api';
const modal = {
effects: {
* list({_}, {call, put, select}) {
const search = yield select(state => state.account.table.search);
yield put({type: 'startLoading'});
const {success, data} = yield call(listAccount, search);
yield put({type: 'stopLoading'});
if (success) {
yield put({type: 'updateState', payload: {data}});
}
},
* insert({payload}, {call, put}) {
yield put({type: 'global/startLoading'});
const {success} = yield call(insertAccount, payload);
yield put({type: 'global/stopLoading'});
if (success) {
yield put({type: 'list'});
}
},
* update({payload}, {call, put}) {
yield put({type: 'global/startLoading'});
const {success} = yield call(updateAccount, payload);
yield put({type: 'global/stopLoading'});
if (success) {
yield put({type: 'list'});
}
},
},
};
export default modal;
| 30.393939 | 71 | 0.57328 |
01960978a963e5b16e06a4e669614b8bd6ed3cb7 | 2,282 | js | JavaScript | controllers/publish.js | nerdmax/NGWeb | 655a88dc0d3f274d857fda6e634b0040043e4a06 | [
"MIT"
] | null | null | null | controllers/publish.js | nerdmax/NGWeb | 655a88dc0d3f274d857fda6e634b0040043e4a06 | [
"MIT"
] | 2 | 2018-10-19T05:49:09.000Z | 2019-06-20T03:08:17.000Z | controllers/publish.js | nerdmax/NGWeb | 655a88dc0d3f274d857fda6e634b0040043e4a06 | [
"MIT"
] | null | null | null | const NgWeb = require('../models/Ngweb');
// const symbolsParser = require('less-symbols-parser');
const log = require('pretty-log');
const fs = require('fs');
const sql = require('mssql');
/**
* GET /
* New Next Gen Web page.
*/
exports.getPublish = (req, res) => {
// async () => {
// try {
// const pool = await sql.connect('mssql://username:password@localhost/database')
// const result = await sql.query `select * from mytable where id = ${value}`
// console.dir(result)
// } catch (err) {
// // ... error checks
// }
// };
log.debug('DLKJLFJ');
const dbConfig = {
server: 'MAX',
database: 'Vokins_CMS',
user: 'umbraco',
password: 'umbraco'
};
// function getEmp() {
// const conn = new sql.ConnectionPool(dbConfig);
// const req = new sql.Request(conn);
// conn.connect((err) => {
// if (err) {
// log.error(err);
// return;
// }
// req.query(`
// BACKUP DATABASE Vokins_CMS TO DISK = 'C:\\Temp\\Vokins_CMS.BAK'
// `, (err, recordset) => {
// if (err) {
// log.error(err);
// } else {
// log.debug(recordset);
// console.log(recordset);
// }
// conn.close();
// });
// });
// }
// getEmp();
function getEmp() {
const conn = new sql.ConnectionPool(dbConfig);
const req = new sql.Request(conn);
conn.connect((err) => {
if (err) {
log.error(err);
return;
}
req.query(`
`, (err, recordset) => {
if (err) {
log.error(err);
} else {
log.debug(recordset);
console.log(recordset);
}
conn.close();
});
});
}
getEmp();
// RESTORE FILELISTONLY FROM DISK='C:\Temp\Vokins_CMS.BAK'
// RESTORE DATABASE testdb FROM DISK = 'C:\Temp\Vokins_CMS.BAK'
// WITH
// MOVE 'Madsen_CMS_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\testdb.mdf',
// MOVE 'Madsen_CMS_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\testdb_log.ldf'
res.render('publish', {
title: 'PUBLISH',
// ngWeb
});
};
/**
* POST /
* New Next Gen Web page.
*/
exports.postPublish = (req, res) => {
};
| 22.372549 | 116 | 0.534181 |
0197a05112a8923698fc241d6e4f7e45f903f9bb | 191,168 | js | JavaScript | bundle/ajv2020.min.js | giscloud/ajv | f2b4bb7d538be5bf1e9ff0d7274d253d7a047c6d | [
"MIT"
] | null | null | null | bundle/ajv2020.min.js | giscloud/ajv | f2b4bb7d538be5bf1e9ff0d7274d253d7a047c6d | [
"MIT"
] | null | null | null | bundle/ajv2020.min.js | giscloud/ajv | f2b4bb7d538be5bf1e9ff0d7274d253d7a047c6d | [
"MIT"
] | null | null | null | var _templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21,_templateObject22,_templateObject23,_templateObject24,_templateObject25,_templateObject26,_templateObject27,_templateObject28,_templateObject29,_templateObject30,_templateObject31,_templateObject32,_templateObject33,_templateObject34,_templateObject35,_templateObject36,_templateObject37,_templateObject38,_templateObject39,_templateObject40,_templateObject41,_templateObject42,_templateObject43,_templateObject44,_templateObject45,_templateObject46,_templateObject47,_templateObject48,_templateObject49,_templateObject50,_templateObject51,_templateObject52,_templateObject53,_templateObject54,_templateObject55,_templateObject56,_templateObject57,_templateObject58,_templateObject59,_templateObject60,_templateObject61,_templateObject62,_templateObject63,_templateObject64,_templateObject65,_templateObject66,_templateObject67,_templateObject68,_templateObject69,_templateObject70,_templateObject71,_templateObject72,_templateObject73,_templateObject74,_templateObject75,_templateObject76,_templateObject77,_templateObject78,_templateObject79,_templateObject80,_templateObject81,_templateObject82,_templateObject83,_templateObject84,_templateObject85,_templateObject86,_templateObject87,_templateObject88,_templateObject89,_templateObject90,_templateObject91,_templateObject92,_templateObject93,_templateObject94,_templateObject95,_templateObject96,_templateObject97,_templateObject98,_templateObject99,_templateObject100,_templateObject101,_templateObject102,_templateObject103,_templateObject104,_templateObject105,_templateObject106,_templateObject107,_templateObject108,_templateObject109,_templateObject110,_templateObject111,_templateObject112,_templateObject113,_templateObject114,_templateObject115,_templateObject116,_templateObject117,_templateObject118,_templateObject119,_templateObject120,_templateObject121,_templateObject122,_templateObject123,_templateObject124,_templateObject125,_templateObject126,_templateObject127,_templateObject128,_templateObject129,_templateObject130,_templateObject131,_templateObject132,_templateObject133,_templateObject134,_templateObject135,_templateObject136,_templateObject137,_templateObject138,_templateObject139,_templateObject140,_templateObject141,_templateObject142,_templateObject143,_templateObject144,_templateObject145,_templateObject146,_templateObject147,_templateObject148,_templateObject149,_templateObject150,_templateObject151,_templateObject152,_templateObject153,_templateObject154,_templateObject155,_templateObject156,_templateObject157,_templateObject158,_templateObject159,_templateObject160,_templateObject161,_templateObject162,_templateObject163,_templateObject164,_templateObject165,_templateObject166,_templateObject167,_templateObject168,_templateObject169,_templateObject170,_templateObject171,_templateObject172,_templateObject173,_templateObject174,_templateObject175,_templateObject176,_templateObject177,_templateObject178,_templateObject179,_templateObject180,_templateObject181,_templateObject182,_templateObject183,_templateObject184,_templateObject185,_templateObject186,_templateObject187,_templateObject188,_templateObject189,_templateObject190,_templateObject191,_templateObject192,_templateObject193,_templateObject194,_templateObject195,_templateObject196,_templateObject197,_templateObject198,_templateObject199,_templateObject200,_templateObject201,_templateObject202,_templateObject203,_templateObject204,_templateObject205,_templateObject206,_templateObject207,_templateObject208,_templateObject209,_templateObject210,_templateObject211,_templateObject212,_templateObject213,_templateObject214,_templateObject215,_templateObject216,_templateObject217,_templateObject218,_templateObject219,_templateObject220,_templateObject221,_templateObject222,_templateObject223,_templateObject224,_templateObject225,_templateObject226,_templateObject227,_templateObject228,_templateObject229,_templateObject230,_templateObject231,_templateObject232,_templateObject233,_templateObject234,_templateObject235,_templateObject236,_templateObject237,_templateObject238,_templateObject239,_templateObject240,_templateObject241,_templateObject242,_templateObject243,_templateObject244,_templateObject245,_templateObject246,_templateObject247,_templateObject248,_templateObject249,_templateObject250,_templateObject251,_templateObject252,_templateObject253,_templateObject254,_templateObject255,_templateObject256,_templateObject257,_templateObject258,_templateObject259,_templateObject260,_templateObject261,_templateObject262,_templateObject263,_templateObject264,_templateObject265,_templateObject266,_templateObject267,_templateObject268,_templateObject269,_templateObject270,_templateObject271,_templateObject272,_templateObject273,_templateObject274,_templateObject275,_templateObject276,_templateObject277,_templateObject278,_templateObject279,_templateObject280,_templateObject281,_templateObject282,_templateObject283,_templateObject284,_templateObject285,_templateObject286,_templateObject287,_templateObject288,_templateObject289,_templateObject290,_templateObject291,_templateObject292,_templateObject293,_templateObject294,_templateObject295;function asyncGeneratorStep(e,t,a,r,n,o,i){try{var c=e[o](i),l=c.value}catch(e){return void a(e)}c.done?t(l):Promise.resolve(l).then(r,n)}function _asyncToGenerator(e){return function(){var t=this,a=arguments;return new Promise(function(r,n){var o=e.apply(t,a);function i(e){asyncGeneratorStep(o,r,n,i,c,"next",e)}function c(e){asyncGeneratorStep(o,r,n,i,c,"throw",e)}i(void 0)})}}function _createForOfIteratorHelper(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==a.return||a.return()}finally{if(c)throw o}}}}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(a,e)})(e)}function _construct(e,t,a){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,a){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return a&&_setPrototypeOf(n,a.prototype),n}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,o=[],i=!0,c=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(c)throw n}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,a){var r=_superPropBase(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(arguments.length<3?e:a):n.value}}).apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,r)}return a}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach(function(t){_defineProperty(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var a,r=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _defineProperties(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,a){return t&&_defineProperties(e.prototype,t),a&&_defineProperties(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ajv2020=e()}(function(){return function e(t,a,r){function n(i,c){if(!a[i]){if(!t[i]){var l="function"==typeof require&&require;if(!c&&l)return l(i,!0);if(o)return o(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var u=a[i]={exports:{}};t[i][0].call(u.exports,function(e){return n(t[i][1][e]||e)},u,u.exports,e,t,a,r)}return a[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)n(r[i]);return n}({1:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.regexpCode=a.getProperty=a.safeStringify=a.stringify=a.strConcat=a.addCodeArg=a.str=a._=a.nil=a._Code=a.Name=a.IDENTIFIER=a._CodeOrName=void 0;var r=_createClass(function e(){_classCallCheck(this,e)});a._CodeOrName=r,a.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=function(e){_inherits(n,r);var t=_createSuper(n);function n(e){var r;if(_classCallCheck(this,n),r=t.call(this),!a.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");return r.str=e,_possibleConstructorReturn(r)}return _createClass(n,[{key:"toString",value:function(){return this.str}},{key:"emptyStr",value:function(){return!1}},{key:"names",get:function(){return _defineProperty({},this.str,1)}}]),n}();a.Name=n;var o=function(e){_inherits(a,r);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this))._items="string"==typeof e?[e]:e,r}return _createClass(a,[{key:"toString",value:function(){return this.str}},{key:"emptyStr",value:function(){if(this._items.length>1)return!1;var e=this._items[0];return""===e||'""'===e}},{key:"str",get:function(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(function(e,t){return"".concat(e).concat(t)},"")}},{key:"names",get:function(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(function(e,t){return t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e},{})}}]),a}();function i(e){for(var t=[e[0]],a=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(;a<n.length;)s(t,n[a]),t.push(e[++a]);return new o(t)}a._Code=o,a.nil=new o(""),a._=i;var c=new o("+");function l(e){for(var t=[p(e[0])],a=0,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(;a<n.length;)t.push(c),s(t,n[a]),t.push(c,p(e[++a]));return function(e){for(var t=1;t<e.length-1;){if(e[t]===c){var a=u(e[t-1],e[t+1]);if(void 0!==a){e.splice(t-1,3,a);continue}e[t++]="+"}t++}}(t),new o(t)}function s(e,t){var a;t instanceof o?e.push.apply(e,_toConsumableArray(t._items)):e.push(t instanceof n?t:"number"==typeof(a=t)||"boolean"==typeof a||null===a?a:p(Array.isArray(a)?a.join(","):a))}function u(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?"".concat(e.slice(0,-1)).concat(t,'"'):'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:'"'.concat(e).concat(t.slice(1))}function p(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}a.str=l,a.addCodeArg=s,a.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:l(_templateObject||(_templateObject=_taggedTemplateLiteral(["","",""])),e,t)},a.stringify=function(e){return new o(p(e))},a.safeStringify=p,a.getProperty=function(e){return"string"==typeof e&&a.IDENTIFIER.test(e)?new o(".".concat(e)):i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["[","]"])),e)},a.regexpCode=function(e){return new o(e.toString())}},{}],2:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.or=a.and=a.not=a.CodeGen=a.operators=a.varKinds=a.ValueScopeName=a.ValueScope=a.Scope=a.Name=a.regexpCode=a.stringify=a.getProperty=a.nil=a.strConcat=a.str=a._=void 0;var r=e("./code"),n=e("./scope"),o=e("./code");Object.defineProperty(a,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(a,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(a,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(a,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return o.Name}});var i=e("./scope");Object.defineProperty(a,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(a,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(a,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(a,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),a.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};var c=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"optimizeNodes",value:function(){return this}},{key:"optimizeNames",value:function(e,t){return this}}]),e}(),l=function(e){_inherits(a,c);var t=_createSuper(a);function a(e,r,n){var o;return _classCallCheck(this,a),(o=t.call(this)).varKind=e,o.name=r,o.rhs=n,o}return _createClass(a,[{key:"render",value:function(e){var t=e.es5,a=e._n;return"".concat(t?n.varKinds.var:this.varKind," ").concat(this.name).concat(void 0===this.rhs?"":" = ".concat(this.rhs),";")+a}},{key:"optimizeNames",value:function(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,e,t)),this}},{key:"names",get:function(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}]),a}(),s=function(e){_inherits(a,c);var t=_createSuper(a);function a(e,r,n){var o;return _classCallCheck(this,a),(o=t.call(this)).lhs=e,o.rhs=r,o.sideEffects=n,o}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"".concat(this.lhs," = ").concat(this.rhs,";")+t}},{key:"optimizeNames",value:function(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=N(this.rhs,e,t),this}},{key:"names",get:function(){return L(this.lhs instanceof r.Name?{}:_objectSpread({},this.lhs.names),this.rhs)}}]),a}(),u=function(e){_inherits(a,s);var t=_createSuper(a);function a(e,r,n,o){var i;return _classCallCheck(this,a),(i=t.call(this,e,n,o)).op=r,i}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}}]),a}(),p=function(e){_inherits(a,c);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).label=e,r.names={},r}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"".concat(this.label,":")+t}}]),a}(),m=function(e){_inherits(a,c);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).label=e,r.names={},r}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"break".concat(this.label?" ".concat(this.label):"",";")+t}}]),a}(),d=function(e){_inherits(a,c);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).error=e,r}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"throw ".concat(this.error,";")+t}},{key:"names",get:function(){return this.error.names}}]),a}(),f=function(e){_inherits(a,c);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).code=e,r}return _createClass(a,[{key:"render",value:function(e){var t=e._n;return"".concat(this.code,";")+t}},{key:"optimizeNodes",value:function(){return"".concat(this.code)?this:void 0}},{key:"optimizeNames",value:function(e,t){return this.code=N(this.code,e,t),this}},{key:"names",get:function(){return this.code instanceof r._CodeOrName?this.code.names:{}}}]),a}(),h=function(e){_inherits(a,c);var t=_createSuper(a);function a(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return _classCallCheck(this,a),(e=t.call(this)).nodes=r,e}return _createClass(a,[{key:"render",value:function(e){return this.nodes.reduce(function(t,a){return t+a.render(e)},"")}},{key:"optimizeNodes",value:function(){for(var e=this.nodes,t=e.length;t--;){var a=e[t].optimizeNodes();Array.isArray(a)?e.splice.apply(e,[t,1].concat(_toConsumableArray(a))):a?e[t]=a:e.splice(t,1)}return e.length>0?this:void 0}},{key:"optimizeNames",value:function(e,t){for(var a=this.nodes,r=a.length;r--;){var n=a[r];n.optimizeNames(e,t)||($(e,n.names),a.splice(r,1))}return a.length>0?this:void 0}},{key:"names",get:function(){return this.nodes.reduce(function(e,t){return C(e,t.names)},{})}}]),a}(),_=function(e){_inherits(a,h);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a,[{key:"render",value:function(e){return"{"+e._n+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)+"}"+e._n}}]),a}(),v=function(e){_inherits(a,h);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a)}(),g=function(e){_inherits(a,_);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a)}();g.kind="else";var y=function(e){_inherits(a,_);var t=_createSuper(a);function a(e,r){var n;return _classCallCheck(this,a),(n=t.call(this,r)).condition=e,n}return _createClass(a,[{key:"render",value:function(e){var t="if(".concat(this.condition,")")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e);return this.else&&(t+="else "+this.else.render(e)),t}},{key:"optimizeNodes",value:function(){_get(_getPrototypeOf(a.prototype),"optimizeNodes",this).call(this);var e=this.condition;if(!0===e)return this.nodes;var t=this.else;if(t){var r=t.optimizeNodes();t=this.else=Array.isArray(r)?new g(r):r}return t?!1===e?t instanceof a?t:t.nodes:this.nodes.length?this:new a(R(e),t instanceof a?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}},{key:"optimizeNames",value:function(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),_get(_getPrototypeOf(a.prototype),"optimizeNames",this).call(this,e,t)||this.else)return this.condition=N(this.condition,e,t),this}},{key:"names",get:function(){var e=_get(_getPrototypeOf(a.prototype),"names",this);return L(e,this.condition),this.else&&C(e,this.else.names),e}}]),a}();y.kind="if";var b=function(e){_inherits(a,_);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a)}();b.kind="for";var j=function(e){_inherits(a,b);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).iteration=e,r}return _createClass(a,[{key:"render",value:function(e){return"for(".concat(this.iteration,")")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}},{key:"optimizeNames",value:function(e,t){if(_get(_getPrototypeOf(a.prototype),"optimizeNames",this).call(this,e,t))return this.iteration=N(this.iteration,e,t),this}},{key:"names",get:function(){return C(_get(_getPrototypeOf(a.prototype),"names",this),this.iteration.names)}}]),a}(),O=function(e){_inherits(a,b);var t=_createSuper(a);function a(e,r,n,o){var i;return _classCallCheck(this,a),(i=t.call(this)).varKind=e,i.name=r,i.from=n,i.to=o,i}return _createClass(a,[{key:"render",value:function(e){var t=e.es5?n.varKinds.var:this.varKind,r=this.name,o=this.from,i=this.to;return"for(".concat(t," ").concat(r,"=").concat(o,"; ").concat(r,"<").concat(i,"; ").concat(r,"++)")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}},{key:"names",get:function(){var e=L(_get(_getPrototypeOf(a.prototype),"names",this),this.from);return L(e,this.to)}}]),a}(),w=function(e){_inherits(a,b);var t=_createSuper(a);function a(e,r,n,o){var i;return _classCallCheck(this,a),(i=t.call(this)).loop=e,i.varKind=r,i.name=n,i.iterable=o,i}return _createClass(a,[{key:"render",value:function(e){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}},{key:"optimizeNames",value:function(e,t){if(_get(_getPrototypeOf(a.prototype),"optimizeNames",this).call(this,e,t))return this.iterable=N(this.iterable,e,t),this}},{key:"names",get:function(){return C(_get(_getPrototypeOf(a.prototype),"names",this),this.iterable.names)}}]),a}(),T=function(e){_inherits(a,_);var t=_createSuper(a);function a(e,r,n){var o;return _classCallCheck(this,a),(o=t.call(this)).name=e,o.args=r,o.async=n,o}return _createClass(a,[{key:"render",value:function(e){return"".concat(this.async?"async ":"","function ").concat(this.name,"(").concat(this.args,")")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}}]),a}();T.kind="func";var k=function(e){_inherits(a,h);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a,[{key:"render",value:function(e){return"return "+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}}]),a}();k.kind="return";var P=function(e){_inherits(a,_);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a,[{key:"render",value:function(e){var t="try"+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}},{key:"optimizeNodes",value:function(){var e,t;return _get(_getPrototypeOf(a.prototype),"optimizeNodes",this).call(this),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}},{key:"optimizeNames",value:function(e,t){var r,n;return _get(_getPrototypeOf(a.prototype),"optimizeNames",this).call(this,e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}},{key:"names",get:function(){var e=_get(_getPrototypeOf(a.prototype),"names",this);return this.catch&&C(e,this.catch.names),this.finally&&C(e,this.finally.names),e}}]),a}(),S=function(e){_inherits(a,_);var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this)).error=e,r}return _createClass(a,[{key:"render",value:function(e){return"catch(".concat(this.error,")")+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}}]),a}();S.kind="catch";var E=function(e){_inherits(a,_);var t=_createSuper(a);function a(){return _classCallCheck(this,a),t.apply(this,arguments)}return _createClass(a,[{key:"render",value:function(e){return"finally"+_get(_getPrototypeOf(a.prototype),"render",this).call(this,e)}}]),a}();function C(e,t){for(var a in t)e[a]=(e[a]||0)+(t[a]||0);return e}function L(e,t){return t instanceof r._CodeOrName?C(e,t.names):e}function N(e,t,a){return e instanceof r.Name?o(e):(n=e)instanceof r._Code&&n._items.some(function(e){return e instanceof r.Name&&1===t[e.str]&&void 0!==a[e.str]})?new r._Code(e._items.reduce(function(e,t){return t instanceof r.Name&&(t=o(t)),t instanceof r._Code?e.push.apply(e,_toConsumableArray(t._items)):e.push(t),e},[])):e;var n;function o(e){var r=a[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function $(e,t){for(var a in t)e[a]=(e[a]||0)-(t[a]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["!",""])),D(e))}E.kind="finally",a.CodeGen=function(){function e(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this._values={},this._blockStarts=[],this._constants={},this.opts=_objectSpread(_objectSpread({},a),{},{_n:a.lines?"\n":""}),this._extScope=t,this._scope=new n.Scope({parent:t}),this._nodes=[new v]}return _createClass(e,[{key:"toString",value:function(){return this._root.render(this.opts)}},{key:"name",value:function(e){return this._scope.name(e)}},{key:"scopeName",value:function(e){return this._extScope.name(e)}},{key:"scopeValue",value:function(e,t){var a=this._extScope.value(e,t);return(this._values[a.prefix]||(this._values[a.prefix]=new Set)).add(a),a}},{key:"getScopeValue",value:function(e,t){return this._extScope.getValue(e,t)}},{key:"scopeRefs",value:function(e){return this._extScope.scopeRefs(e,this._values)}},{key:"scopeCode",value:function(){return this._extScope.scopeCode(this._values)}},{key:"_def",value:function(e,t,a,r){var n=this._scope.toName(t);return void 0!==a&&r&&(this._constants[n.str]=a),this._leafNode(new l(e,n,a)),n}},{key:"const",value:function(e,t,a){return this._def(n.varKinds.const,e,t,a)}},{key:"let",value:function(e,t,a){return this._def(n.varKinds.let,e,t,a)}},{key:"var",value:function(e,t,a){return this._def(n.varKinds.var,e,t,a)}},{key:"assign",value:function(e,t,a){return this._leafNode(new s(e,t,a))}},{key:"add",value:function(e,t){return this._leafNode(new u(e,a.operators.ADD,t))}},{key:"code",value:function(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new f(e)),this}},{key:"object",value:function(){for(var e=["{"],t=arguments.length,a=new Array(t),n=0;n<t;n++)a[n]=arguments[n];for(var o=0,i=a;o<i.length;o++){var c=_slicedToArray(i[o],2),l=c[0],s=c[1];e.length>1&&e.push(","),e.push(l),(l!==s||this.opts.es5)&&(e.push(":"),(0,r.addCodeArg)(e,s))}return e.push("}"),new r._Code(e)}},{key:"if",value:function(e,t,a){if(this._blockNode(new y(e)),t&&a)this.code(t).else().code(a).endIf();else if(t)this.code(t).endIf();else if(a)throw new Error('CodeGen: "else" body without "then" body');return this}},{key:"elseIf",value:function(e){return this._elseNode(new y(e))}},{key:"else",value:function(){return this._elseNode(new g)}},{key:"endIf",value:function(){return this._endBlockNode(y,g)}},{key:"_for",value:function(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}},{key:"for",value:function(e,t){return this._for(new j(e),t)}},{key:"forRange",value:function(e,t,a,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.opts.es5?n.varKinds.var:n.varKinds.let,i=this._scope.toName(e);return this._for(new O(o,i,t,a),function(){return r(i)})}},{key:"forOf",value:function(e,t,a){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.varKinds.const,c=this._scope.toName(e);if(this.opts.es5){var l=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["",".length"])),l),function(e){o.var(c,r._(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["","[","]"])),l,e)),a(c)})}return this._for(new w("of",i,c,t),function(){return a(c)})}},{key:"forIn",value:function(e,t,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.es5?n.varKinds.var:n.varKinds.const;if(this.opts.ownProperties)return this.forOf(e,r._(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["Object.keys(",")"])),t),a);var i=this._scope.toName(e);return this._for(new w("in",o,i,t),function(){return a(i)})}},{key:"endFor",value:function(){return this._endBlockNode(b)}},{key:"label",value:function(e){return this._leafNode(new p(e))}},{key:"break",value:function(e){return this._leafNode(new m(e))}},{key:"return",value:function(e){var t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}},{key:"try",value:function(e,t,a){if(!t&&!a)throw new Error('CodeGen: "try" without "catch" and "finally"');var r=new P;if(this._blockNode(r),this.code(e),t){var n=this.name("e");this._currNode=r.catch=new S(n),t(n)}return a&&(this._currNode=r.finally=new E,this.code(a)),this._endBlockNode(S,E)}},{key:"throw",value:function(e){return this._leafNode(new d(e))}},{key:"block",value:function(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}},{key:"endBlock",value:function(e){var t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");var a=this._nodes.length-t;if(a<0||void 0!==e&&a!==e)throw new Error("CodeGen: wrong number of nodes: ".concat(a," vs ").concat(e," expected"));return this._nodes.length=t,this}},{key:"func",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.nil,a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;return this._blockNode(new T(e,t,a)),n&&this.code(n).endFunc(),this}},{key:"endFunc",value:function(){return this._endBlockNode(T)}},{key:"optimize",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}},{key:"_leafNode",value:function(e){return this._currNode.nodes.push(e),this}},{key:"_blockNode",value:function(e){this._currNode.nodes.push(e),this._nodes.push(e)}},{key:"_endBlockNode",value:function(e,t){var a=this._currNode;if(a instanceof e||t&&a instanceof t)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(t?"".concat(e.kind,"/").concat(t.kind):e.kind,'"'))}},{key:"_elseNode",value:function(e){var t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}},{key:"_root",get:function(){return this._nodes[0]}},{key:"_currNode",get:function(){var e=this._nodes;return e[e.length-1]},set:function(e){var t=this._nodes;t[t.length-1]=e}}]),e}(),a.not=R;var I=A(a.operators.AND);a.and=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.reduce(I)};var x=A(a.operators.OR);function A(e){return function(t,a){return t===r.nil?a:a===r.nil?t:r._(_templateObject7||(_templateObject7=_taggedTemplateLiteral([""," "," ",""])),D(t),e,D(a))}}function D(e){return e instanceof r.Name?e:r._(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["(",")"])),e)}a.or=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.reduce(x)}},{"./code":1,"./scope":3}],3:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ValueScope=a.ValueScopeName=a.Scope=a.varKinds=a.UsedValueState=void 0;var r,n=e("./code"),o=function(e){_inherits(a,_wrapNativeSuper(Error));var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this,'CodeGen: "code" for '.concat(e," not defined"))).value=e.value,r}return _createClass(a)}();!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r=a.UsedValueState||(a.UsedValueState={})),a.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};var i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=t.prefixes,r=t.parent;_classCallCheck(this,e),this._names={},this._prefixes=a,this._parent=r}return _createClass(e,[{key:"toName",value:function(e){return e instanceof n.Name?e:this.name(e)}},{key:"name",value:function(e){return new n.Name(this._newName(e))}},{key:"_newName",value:function(e){return"".concat(e).concat((this._names[e]||this._nameGroup(e)).index++)}},{key:"_nameGroup",value:function(e){var t,a;if((null===(a=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===a?void 0:a.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error('CodeGen: prefix "'.concat(e,'" is not allowed in this scope'));return this._names[e]={prefix:e,index:0}}}]),e}();a.Scope=i;var c=function(e){_inherits(a,n.Name);var t=_createSuper(a);function a(e,r){var n;return _classCallCheck(this,a),(n=t.call(this,r)).prefix=e,n}return _createClass(a,[{key:"setValue",value:function(e,t){var a=t.property,r=t.itemIndex;this.value=e,this.scopePath=n._(_templateObject9||(_templateObject9=_taggedTemplateLiteral([".","[","]"])),new n.Name(a),r)}}]),a}();a.ValueScopeName=c;var l=n._(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n"],["\\n"])));a.ValueScope=function(e){_inherits(s,i);var t=_createSuper(s);function s(e){var a;return _classCallCheck(this,s),(a=t.call(this,e))._values={},a._scope=e.scope,a.opts=_objectSpread(_objectSpread({},e),{},{_n:e.lines?l:n.nil}),a}return _createClass(s,[{key:"get",value:function(){return this._scope}},{key:"name",value:function(e){return new c(e,this._newName(e))}},{key:"value",value:function(e,t){var a;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");var r=this.toName(e),n=r.prefix,o=null!==(a=t.key)&&void 0!==a?a:t.ref,i=this._values[n];if(i){var c=i.get(o);if(c)return c}else i=this._values[n]=new Map;i.set(o,r);var l=this._scope[n]||(this._scope[n]=[]),s=l.length;return l[s]=t.ref,r.setValue(t,{property:n,itemIndex:s}),r}},{key:"getValue",value:function(e,t){var a=this._values[e];if(a)return a.get(t)}},{key:"scopeRefs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._values;return this._reduceValues(t,function(t){if(void 0===t.scopePath)throw new Error('CodeGen: name "'.concat(t,'" has no value'));return n._(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["","",""])),e,t.scopePath)})}},{key:"scopeCode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._values,t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;return this._reduceValues(e,function(e){if(void 0===e.value)throw new Error('CodeGen: name "'.concat(e,'" has no value'));return e.value.code},t,a)}},{key:"_reduceValues",value:function(e,t){var i=this,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0,s=n.nil,u=function(u){var p=e[u];if(!p)return"continue";var m=c[u]=c[u]||new Map;p.forEach(function(e){if(!m.has(e)){m.set(e,r.Started);var c=t(e);if(c)s=n._(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["",""," "," = ",";",""])),s,i.opts.es5?a.varKinds.var:a.varKinds.const,e,c,i.opts._n);else{if(!(c=null==l?void 0:l(e)))throw new o(e);s=n._(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["","","",""])),s,c,i.opts._n)}m.set(e,r.Completed)}})};for(var p in e)u(p);return s}}]),s}()},{"./code":1}],4:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendErrors=a.resetErrorsCount=a.reportExtraError=a.reportError=a.keyword$DataError=a.keywordError=void 0;var r=e("./codegen"),n=e("./util"),o=e("./names");function i(e,t){var a=e.const("err",t);e.if(r._(_templateObject14||(_templateObject14=_taggedTemplateLiteral([""," === null"])),o.default.vErrors),function(){return e.assign(o.default.vErrors,r._(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["[","]"])),a))},r._(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["",".push(",")"])),o.default.vErrors,a)),e.code(r._(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["","++"])),o.default.errors))}function c(e,t){var a=e.gen,n=e.validateName;e.schemaEnv.$async?a.throw(r._(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["new ","(",")"])),e.ValidationError,t)):(a.assign(r._(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["",".errors"])),n),t),a.return(!1))}a.keywordError={message:function(e){var t=e.keyword;return r.str(_templateObject20||(_templateObject20=_taggedTemplateLiteral(['must pass "','" keyword validation'])),t)}},a.keyword$DataError={message:function(e){var t=e.keyword,a=e.schemaType;return a?r.str(_templateObject21||(_templateObject21=_taggedTemplateLiteral(['"','" keyword must be '," ($data)"])),t,a):r.str(_templateObject22||(_templateObject22=_taggedTemplateLiteral(['"','" keyword is invalid ($data)'])),t)}},a.reportError=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.keywordError,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=e.it,u=l.gen,p=l.compositeRule,m=l.allErrors,d=s(e,t,n);(null!=o?o:p||m)?i(u,d):c(l,r._(_templateObject23||(_templateObject23=_taggedTemplateLiteral(["[","]"])),d))},a.reportExtraError=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.keywordError,r=arguments.length>2?arguments[2]:void 0,n=e.it,l=n.gen,u=n.compositeRule,p=n.allErrors;i(l,s(e,t,r)),u||p||c(n,o.default.vErrors)},a.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(r._(_templateObject24||(_templateObject24=_taggedTemplateLiteral([""," !== null"])),o.default.vErrors),function(){return e.if(t,function(){return e.assign(r._(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["",".length"])),o.default.vErrors),t)},function(){return e.assign(o.default.vErrors,null)})})},a.extendErrors=function(e){var t=e.gen,a=e.keyword,n=e.schemaValue,i=e.data,c=e.errsCount,l=e.it;if(void 0===c)throw new Error("ajv implementation error");var s=t.name("err");t.forRange("i",c,o.default.errors,function(e){t.const(s,r._(_templateObject26||(_templateObject26=_taggedTemplateLiteral(["","[","]"])),o.default.vErrors,e)),t.if(r._(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["",".instancePath === undefined"])),s),function(){return t.assign(r._(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["",".instancePath"])),s),(0,r.strConcat)(o.default.instancePath,l.errorPath))}),t.assign(r._(_templateObject29||(_templateObject29=_taggedTemplateLiteral(["",".schemaPath"])),s),r.str(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["","/",""])),l.errSchemaPath,a)),l.opts.verbose&&(t.assign(r._(_templateObject31||(_templateObject31=_taggedTemplateLiteral(["",".schema"])),s),n),t.assign(r._(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["",".data"])),s),i))})};var l={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function s(e,t,a){return!1===e.it.createErrors?r._(_templateObject33||(_templateObject33=_taggedTemplateLiteral(["{}"]))):function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.gen,i=[u(e.it,a),p(e,a)];return function(e,t,a){var n=t.params,i=t.message,c=e.keyword,s=e.data,u=e.schemaValue,p=e.it,m=p.opts,d=p.propertyName,f=p.topSchemaRef,h=p.schemaPath;a.push([l.keyword,c],[l.params,"function"==typeof n?n(e):n||r._(_templateObject34||(_templateObject34=_taggedTemplateLiteral(["{}"])))]),m.messages&&a.push([l.message,"function"==typeof i?i(e):i]),m.verbose&&a.push([l.schema,u],[l.parentSchema,r._(_templateObject35||(_templateObject35=_taggedTemplateLiteral(["","",""])),f,h)],[o.default.data,s]),d&&a.push([l.propertyName,d])}(e,t,i),n.object.apply(n,i)}(e,t,a)}function u(e,t){var a=e.errorPath,i=t.instancePath,c=i?r.str(_templateObject36||(_templateObject36=_taggedTemplateLiteral(["","",""])),a,(0,n.getErrorPath)(i,n.Type.Str)):a;return[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,c)]}function p(e,t){var a=e.keyword,o=e.it.errSchemaPath,i=t.schemaPath,c=t.parentSchema?o:r.str(_templateObject37||(_templateObject37=_taggedTemplateLiteral(["","/",""])),o,a);return i&&(c=r.str(_templateObject38||(_templateObject38=_taggedTemplateLiteral(["","",""])),c,(0,n.getErrorPath)(i,n.Type.Str))),[l.schemaPath,c]}},{"./codegen":2,"./names":6,"./util":10}],5:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.resolveSchema=a.getCompilingSchema=a.resolveRef=a.compileSchema=a.SchemaEnv=void 0;var r=e("./codegen"),n=e("../runtime/validation_error"),o=e("./names"),i=e("./resolve"),c=e("./util"),l=e("./validate"),s=e("uri-js"),u=_createClass(function e(t){var a,r;_classCallCheck(this,e),this.refs={},this.dynamicAnchors={},"object"==_typeof(t.schema)&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(a=t.baseId)&&void 0!==a?a:(0,i.normalizeId)(null==r?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==r?void 0:r.$async,this.refs={}});function p(e){var t=m.call(this,e);if(t)return t;var a,c=(0,i.getFullPath)(e.root.baseId),s=this.opts.code,u=s.es5,p=s.lines,d=this.opts.ownProperties,f=new r.CodeGen(this.scope,{es5:u,lines:p,ownProperties:d});e.$async&&(a=f.scopeValue("Error",{ref:n.default,code:r._(_templateObject39||(_templateObject39=_taggedTemplateLiteral(['require("ajv/dist/runtime/validation_error").default'])))}));var h=f.scopeName("validate");e.validateName=h;var _,v={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._(_templateObject40||(_templateObject40=_taggedTemplateLiteral(['""']))),opts:this.opts,self:this};try{this._compilations.add(e),(0,l.validateFunctionCode)(v),f.optimize(this.opts.code.optimize);var g=f.toString();_="".concat(f.scopeRefs(o.default.scope),"return ").concat(g),this.opts.code.process&&(_=this.opts.code.process(_,e));var y=new Function("".concat(o.default.self),"".concat(o.default.scope),_)(this,this.scope.get());if(this.scope.value(h,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async&&(y.$async=!0),!0===this.opts.code.source&&(y.source={validateName:h,validateCode:g,scopeValues:f._values}),this.opts.unevaluated){var b=v.props,j=v.items;y.evaluated={props:b instanceof r.Name?void 0:b,items:j instanceof r.Name?void 0:j,dynamicProps:b instanceof r.Name,dynamicItems:j instanceof r.Name},y.source&&(y.source.evaluated=(0,r.stringify)(y.evaluated))}return e.validate=y,e}catch(t){throw delete e.validate,delete e.validateName,_&&this.logger.error("Error compiling schema, function code:",_),t}finally{this._compilations.delete(e)}}function m(e){var t,a,r,n=_createForOfIteratorHelper(this._compilations);try{for(n.s();!(t=n.n()).done;){var o=t.value;if((a=o).schema===(r=e).schema&&a.root===r.root&&a.baseId===r.baseId)return o}}catch(e){n.e(e)}finally{n.f()}}function d(e,t){var a=s.parse(t),r=(0,i._getFullPath)(a),n=(0,i.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&r===n)return h.call(this,a,e);var o=(0,i.normalizeId)(r),c=this.refs[o]||this.schemas[o];if("string"==typeof c){var l=d.call(this,e,c);if("object"!=_typeof(null==l?void 0:l.schema))return;return h.call(this,a,l)}if("object"==_typeof(null==c?void 0:c.schema)){if(c.validate||p.call(this,c),o===(0,i.normalizeId)(t)){var m=c.schema,f=this.opts.schemaId,_=m[f];return _&&(n=(0,i.resolveUrl)(n,_)),new u({schema:m,schemaId:f,root:e,baseId:n})}return h.call(this,a,c)}}a.SchemaEnv=u,a.compileSchema=p,a.resolveRef=function(e,t,a){var r;a=(0,i.resolveUrl)(t,a);var n=e.refs[a];if(n)return n;var o=function(e,t){for(var a;"string"==typeof(a=this.refs[t]);)t=a;return a||this.schemas[t]||d.call(this,e,t)}.call(this,e,a);if(void 0===o){var c=null===(r=e.localRefs)||void 0===r?void 0:r[a],l=this.opts.schemaId;c&&(o=new u({schema:c,schemaId:l,root:e,baseId:t}))}return void 0!==o?e.refs[a]=function(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:p.call(this,e)}.call(this,o):void 0},a.getCompilingSchema=m,a.resolveSchema=d;var f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t){var a,r=t.baseId,n=t.schema,o=t.root;if("/"===(null===(a=e.fragment)||void 0===a?void 0:a[0])){var l,s,p=_createForOfIteratorHelper(e.fragment.slice(1).split("/"));try{for(p.s();!(l=p.n()).done;){var m=l.value;if("boolean"==typeof n)return;var h=n[(0,c.unescapeFragment)(m)];if(void 0===h)return;var _="object"==_typeof(n=h)&&n[this.opts.schemaId];!f.has(m)&&_&&(r=(0,i.resolveUrl)(r,_))}}catch(e){p.e(e)}finally{p.f()}if("boolean"!=typeof n&&n.$ref&&!(0,c.schemaHasRulesButRef)(n,this.RULES)){var v=(0,i.resolveUrl)(r,n.$ref);s=d.call(this,o,v)}var g=this.opts.schemaId;return(s=s||new u({schema:n,schemaId:g,root:o,baseId:r})).schema!==s.root.schema?s:void 0}}},{"../runtime/validation_error":31,"./codegen":2,"./names":6,"./resolve":8,"./util":10,"./validate":15,"uri-js":84}],6:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./codegen"),n={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};a.default=n},{"./codegen":2}],7:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./resolve"),n=function(e){_inherits(a,_wrapNativeSuper(Error));var t=_createSuper(a);function a(e,n,o){var i;return _classCallCheck(this,a),(i=t.call(this,o||"can't resolve reference ".concat(n," from id ").concat(e))).missingRef=(0,r.resolveUrl)(e,n),i.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(i.missingRef)),i}return _createClass(a)}();a.default=n},{"./resolve":8}],8:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getSchemaRefs=a.resolveUrl=a.normalizeId=a._getFullPath=a.getFullPath=a.inlineRef=void 0;var r=e("./util"),n=e("fast-deep-equal"),o=e("json-schema-traverse"),i=e("uri-js"),c=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);a.inlineRef=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"boolean"==typeof e||(!0===t?!s(e):!!t&&function e(t){var a=0;for(var n in t){if("$ref"===n)return 1/0;if(a++,!c.has(n)&&("object"==_typeof(t[n])&&(0,r.eachItem)(t[n],function(t){return a+=e(t)}),1/0===a))return 1/0}return a}(e)<=t)};var l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e){for(var t in e){if(l.has(t))return!0;var a=e[t];if(Array.isArray(a)&&a.some(s))return!0;if("object"==_typeof(a)&&s(a))return!0}return!1}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1!==(arguments.length>1?arguments[1]:void 0)&&(e=d(e)),p(i.parse(e))}function p(e){return i.serialize(e).split("#")[0]+"#"}a.getFullPath=u,a._getFullPath=p;var m=/#\/?$/;function d(e){return e?e.replace(m,""):""}a.normalizeId=d,a.resolveUrl=function(e,t){return t=d(t),i.resolve(e,t)};var f=/^[a-z_][-a-z0-9._]*$/i;a.getSchemaRefs=function(e,t){var a=this;if("boolean"==typeof e)return{};var r=this.opts.schemaId,c=d(e[r]||t),l={"":c},s=u(c,!1),p={},m=new Set;return o(e,{allKeys:!0},function(e,t,n,o){if(void 0!==o){var c=s+t,u=l[o];"string"==typeof e[r]&&(u=v.call(a,e[r])),g.call(a,e.$anchor),g.call(a,e.$dynamicAnchor),l[t]=u}function v(t){if(t=d(u?i.resolve(u,t):t),m.has(t))throw _(t);m.add(t);var a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==_typeof(a)?h(e,a.schema,t):t!==d(c)&&("#"===t[0]?(h(e,p[t],t),p[t]=e):this.refs[t]=c),t}function g(e){if("string"==typeof e){if(!f.test(e))throw new Error('invalid anchor "'.concat(e,'"'));v.call(this,"#".concat(e))}}}),p;function h(e,t,a){if(void 0!==t&&!n(e,t))throw _(a)}function _(e){return new Error('reference "'.concat(e,'" resolves to more than one schema'))}}},{"./util":10,"fast-deep-equal":82,"json-schema-traverse":83,"uri-js":84}],9:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getRules=a.isJSONType=void 0;var r=new Set(["string","number","integer","boolean","null","object","array"]);a.isJSONType=function(e){return"string"==typeof e&&r.has(e)},a.getRules=function(){var e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:_objectSpread(_objectSpread({},e),{},{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},{}],10:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.checkStrictMode=a.getErrorPath=a.Type=a.useFunc=a.setEvaluated=a.evaluatedPropsToName=a.mergeEvaluated=a.eachItem=a.unescapeJsonPointer=a.escapeJsonPointer=a.escapeFragment=a.unescapeFragment=a.schemaRefOrVal=a.schemaHasRulesButRef=a.schemaHasRules=a.checkUnknownRules=a.alwaysValidSchema=a.toHash=void 0;var r=e("./codegen"),n=e("./codegen/code");function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema,a=e.opts,r=e.self;if(a.strictSchema&&"boolean"!=typeof t){var n=r.RULES.keywords;for(var o in t)n[o]||f(e,'unknown keyword: "'.concat(o,'"'))}}function i(e,t){if("boolean"==typeof e)return!e;for(var a in e)if(t[a])return!0;return!1}function c(e){return"number"==typeof e?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s(e){var t=e.mergeNames,a=e.mergeToName,n=e.mergeValues,o=e.resultToName;return function(e,i,c,l){var s=void 0===c?i:c instanceof r.Name?(i instanceof r.Name?t(e,i,c):a(e,i,c),c):i instanceof r.Name?(a(e,c,i),i):n(i,c);return l!==r.Name||s instanceof r.Name?s:o(e,s)}}function u(e,t){if(!0===t)return e.var("props",!0);var a=e.var("props",r._(_templateObject41||(_templateObject41=_taggedTemplateLiteral(["{}"]))));return void 0!==t&&p(e,a,t),a}function p(e,t,a){Object.keys(a).forEach(function(a){return e.assign(r._(_templateObject42||(_templateObject42=_taggedTemplateLiteral(["","",""])),t,(0,r.getProperty)(a)),!0)})}a.toHash=function(e){var t,a={},r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){a[t.value]=!0}}catch(e){r.e(e)}finally{r.f()}return a},a.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!i(t,e.self.RULES.all))},a.checkUnknownRules=o,a.schemaHasRules=i,a.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(var a in e)if("$ref"!==a&&t.all[a])return!0;return!1},a.schemaRefOrVal=function(e,t,a,n){var o=e.topSchemaRef,i=e.schemaPath;if(!n){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return r._(_templateObject43||(_templateObject43=_taggedTemplateLiteral(["",""])),t)}return r._(_templateObject44||(_templateObject44=_taggedTemplateLiteral(["","","",""])),o,i,(0,r.getProperty)(a))},a.unescapeFragment=function(e){return l(decodeURIComponent(e))},a.escapeFragment=function(e){return encodeURIComponent(c(e))},a.escapeJsonPointer=c,a.unescapeJsonPointer=l,a.eachItem=function(e,t){if(Array.isArray(e)){var a,r=_createForOfIteratorHelper(e);try{for(r.s();!(a=r.n()).done;){t(a.value)}}catch(e){r.e(e)}finally{r.f()}}else t(e)},a.mergeEvaluated={props:s({mergeNames:function(e,t,a){return e.if(r._(_templateObject45||(_templateObject45=_taggedTemplateLiteral([""," !== true && "," !== undefined"])),a,t),function(){e.if(r._(_templateObject46||(_templateObject46=_taggedTemplateLiteral([""," === true"])),t),function(){return e.assign(a,!0)},function(){return e.assign(a,r._(_templateObject47||(_templateObject47=_taggedTemplateLiteral([""," || {}"])),a)).code(r._(_templateObject48||(_templateObject48=_taggedTemplateLiteral(["Object.assign(",", ",")"])),a,t))})})},mergeToName:function(e,t,a){return e.if(r._(_templateObject49||(_templateObject49=_taggedTemplateLiteral([""," !== true"])),a),function(){!0===t?e.assign(a,!0):(e.assign(a,r._(_templateObject50||(_templateObject50=_taggedTemplateLiteral([""," || {}"])),a)),p(e,a,t))})},mergeValues:function(e,t){return!0===e||_objectSpread(_objectSpread({},e),t)},resultToName:u}),items:s({mergeNames:function(e,t,a){return e.if(r._(_templateObject51||(_templateObject51=_taggedTemplateLiteral([""," !== true && "," !== undefined"])),a,t),function(){return e.assign(a,r._(_templateObject52||(_templateObject52=_taggedTemplateLiteral([""," === true ? true : "," > "," ? "," : ",""])),t,a,t,a,t))})},mergeToName:function(e,t,a){return e.if(r._(_templateObject53||(_templateObject53=_taggedTemplateLiteral([""," !== true"])),a),function(){return e.assign(a,!0===t||r._(_templateObject54||(_templateObject54=_taggedTemplateLiteral([""," > "," ? "," : ",""])),a,t,a,t))})},mergeValues:function(e,t){return!0===e||Math.max(e,t)},resultToName:function(e,t){return e.var("items",t)}})},a.evaluatedPropsToName=u,a.setEvaluated=p;var m,d={};function f(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.opts.strictSchema;if(a){if(t="strict mode: ".concat(t),!0===a)throw new Error(t);e.self.logger.warn(t)}}a.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new n._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m=a.Type||(a.Type={})),a.getErrorPath=function(e,t,a){if(e instanceof r.Name){var n=t===m.Num;return a?n?r._(_templateObject55||(_templateObject55=_taggedTemplateLiteral(['"[" + ',' + "]"'])),e):r._(_templateObject56||(_templateObject56=_taggedTemplateLiteral(['"[\'" + ',' + "\']"'])),e):n?r._(_templateObject57||(_templateObject57=_taggedTemplateLiteral(['"/" + ',""])),e):r._(_templateObject58||(_templateObject58=_taggedTemplateLiteral(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return a?(0,r.getProperty)(e).toString():"/"+c(e)},a.checkStrictMode=f},{"./codegen":2,"./codegen/code":1}],11:[function(e,t,a){"use strict";function r(e,t){return t.rules.some(function(t){return n(e,t)})}function n(e,t){var a;return void 0!==e[t.keyword]||(null===(a=t.definition.implements)||void 0===a?void 0:a.some(function(t){return void 0!==e[t]}))}Object.defineProperty(a,"__esModule",{value:!0}),a.shouldUseRule=a.shouldUseGroup=a.schemaHasRulesForType=void 0,a.schemaHasRulesForType=function(e,t){var a=e.schema,n=e.self.RULES.types[t];return n&&!0!==n&&r(a,n)},a.shouldUseGroup=r,a.shouldUseRule=n},{}],12:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.boolOrEmptySchema=a.topBoolOrEmptySchema=void 0;var r=e("../errors"),n=e("../codegen"),o=e("../names"),i={message:"boolean schema is false"};function c(e,t){var a=e.gen,n=e.data;(0,r.reportError)({gen:a,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},i,void 0,t)}a.topBoolOrEmptySchema=function(e){var t=e.gen,a=e.schema,r=e.validateName;!1===a?c(e,!1):"object"==_typeof(a)&&!0===a.$async?t.return(o.default.data):(t.assign(n._(_templateObject59||(_templateObject59=_taggedTemplateLiteral(["",".errors"])),r),null),t.return(!0))},a.boolOrEmptySchema=function(e,t){var a=e.gen;!1===e.schema?(a.var(t,!1),c(e)):a.var(t,!0)}},{"../codegen":2,"../errors":4,"../names":6}],13:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.reportTypeError=a.checkDataTypes=a.checkDataType=a.coerceAndCheckDataType=a.getJSONTypes=a.getSchemaTypes=a.DataType=void 0;var r,n=e("../rules"),o=e("./applicability"),i=e("../errors"),c=e("../codegen"),l=e("../util");function s(e){var t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(r=a.DataType||(a.DataType={})),a.getSchemaTypes=function(e){var t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},a.getJSONTypes=s,a.coerceAndCheckDataType=function(e,t){var a=e.gen,n=e.data,i=e.opts,l=function(e,t){return t?e.filter(function(e){return u.has(e)||"array"===t&&"array"===e}):[]}(t,i.coerceTypes),s=t.length>0&&!(0===l.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(s){var p=m(t,n,i.strictNumbers,r.Wrong);a.if(p,function(){l.length?function(e,t,a){var r=e.gen,n=e.data,o=e.opts,i=r.let("dataType",c._(_templateObject60||(_templateObject60=_taggedTemplateLiteral(["typeof ",""])),n)),l=r.let("coerced",c._(_templateObject61||(_templateObject61=_taggedTemplateLiteral(["undefined"]))));"array"===o.coerceTypes&&r.if(c._(_templateObject62||(_templateObject62=_taggedTemplateLiteral([""," == 'object' && Array.isArray(",") && ",".length == 1"])),i,n,n),function(){return r.assign(n,c._(_templateObject63||(_templateObject63=_taggedTemplateLiteral(["","[0]"])),n)).assign(i,c._(_templateObject64||(_templateObject64=_taggedTemplateLiteral(["typeof ",""])),n)).if(m(t,n,o.strictNumbers),function(){return r.assign(l,n)})}),r.if(c._(_templateObject65||(_templateObject65=_taggedTemplateLiteral([""," !== undefined"])),l));var s,p=_createForOfIteratorHelper(a);try{for(p.s();!(s=p.n()).done;){var d=s.value;(u.has(d)||"array"===d&&"array"===o.coerceTypes)&&h(d)}}catch(e){p.e(e)}finally{p.f()}function h(e){switch(e){case"string":return void r.elseIf(c._(_templateObject66||(_templateObject66=_taggedTemplateLiteral(["",' == "number" || ',' == "boolean"'])),i,i)).assign(l,c._(_templateObject67||(_templateObject67=_taggedTemplateLiteral(['"" + ',""])),n)).elseIf(c._(_templateObject68||(_templateObject68=_taggedTemplateLiteral([""," === null"])),n)).assign(l,c._(_templateObject69||(_templateObject69=_taggedTemplateLiteral(['""']))));case"number":return void r.elseIf(c._(_templateObject70||(_templateObject70=_taggedTemplateLiteral(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),i,n,i,n,n,n)).assign(l,c._(_templateObject71||(_templateObject71=_taggedTemplateLiteral(["+",""])),n));case"integer":return void r.elseIf(c._(_templateObject72||(_templateObject72=_taggedTemplateLiteral(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),i,n,i,n,n,n,n)).assign(l,c._(_templateObject73||(_templateObject73=_taggedTemplateLiteral(["+",""])),n));case"boolean":return void r.elseIf(c._(_templateObject74||(_templateObject74=_taggedTemplateLiteral(["",' === "false" || '," === 0 || "," === null"])),n,n,n)).assign(l,!1).elseIf(c._(_templateObject75||(_templateObject75=_taggedTemplateLiteral(["",' === "true" || '," === 1"])),n,n)).assign(l,!0);case"null":return r.elseIf(c._(_templateObject76||(_templateObject76=_taggedTemplateLiteral(["",' === "" || '," === 0 || "," === false"])),n,n,n)),void r.assign(l,null);case"array":r.elseIf(c._(_templateObject77||(_templateObject77=_taggedTemplateLiteral(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),i,i,i,n)).assign(l,c._(_templateObject78||(_templateObject78=_taggedTemplateLiteral(["[","]"])),n))}}r.else(),f(e),r.endIf(),r.if(c._(_templateObject79||(_templateObject79=_taggedTemplateLiteral([""," !== undefined"])),l),function(){r.assign(n,l),function(e,t){var a=e.gen,r=e.parentData,n=e.parentDataProperty;a.if(c._(_templateObject80||(_templateObject80=_taggedTemplateLiteral([""," !== undefined"])),r),function(){return a.assign(c._(_templateObject81||(_templateObject81=_taggedTemplateLiteral(["","[","]"])),r,n),t)})}(e,l)})}(e,t,l):f(e)})}return s};var u=new Set(["string","number","integer","boolean","null"]);function p(e,t,a){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.Correct,i=o===r.Correct?c.operators.EQ:c.operators.NEQ;switch(e){case"null":return c._(_templateObject82||(_templateObject82=_taggedTemplateLiteral([""," "," null"])),t,i);case"array":n=c._(_templateObject83||(_templateObject83=_taggedTemplateLiteral(["Array.isArray(",")"])),t);break;case"object":n=c._(_templateObject84||(_templateObject84=_taggedTemplateLiteral([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":n=l(c._(_templateObject85||(_templateObject85=_taggedTemplateLiteral(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":n=l();break;default:return c._(_templateObject86||(_templateObject86=_taggedTemplateLiteral(["typeof "," "," ",""])),t,i,e)}return o===r.Correct?n:(0,c.not)(n);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.nil;return(0,c.and)(c._(_templateObject87||(_templateObject87=_taggedTemplateLiteral(["typeof ",' == "number"'])),t),e,a?c._(_templateObject88||(_templateObject88=_taggedTemplateLiteral(["isFinite(",")"])),t):c.nil)}}function m(e,t,a,r){if(1===e.length)return p(e[0],t,a,r);var n,o=(0,l.toHash)(e);if(o.array&&o.object){var i=c._(_templateObject89||(_templateObject89=_taggedTemplateLiteral(["typeof ",' != "object"'])),t);n=o.null?i:c._(_templateObject90||(_templateObject90=_taggedTemplateLiteral(["!"," || ",""])),t,i),delete o.null,delete o.array,delete o.object}else n=c.nil;for(var s in o.number&&delete o.integer,o)n=(0,c.and)(n,p(s,t,a,r));return n}a.checkDataType=p,a.checkDataTypes=m;var d={message:function(e){var t=e.schema;return"must be ".concat(t)},params:function(e){var t=e.schema,a=e.schemaValue;return"string"==typeof t?c._(_templateObject91||(_templateObject91=_taggedTemplateLiteral(["{type: ","}"])),t):c._(_templateObject92||(_templateObject92=_taggedTemplateLiteral(["{type: ","}"])),a)}};function f(e){var t=function(e){var t=e.gen,a=e.data,r=e.schema,n=(0,l.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:a,schema:r.type,schemaCode:n,schemaValue:n,parentSchema:r,params:{},it:e}}(e);(0,i.reportError)(t,d)}a.reportTypeError=f},{"../codegen":2,"../errors":4,"../rules":9,"../util":10,"./applicability":11}],14:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assignDefaults=void 0;var r=e("../codegen"),n=e("../util");function o(e,t,a){var o=e.gen,i=e.compositeRule,c=e.data,l=e.opts;if(void 0!==a){var s=r._(_templateObject93||(_templateObject93=_taggedTemplateLiteral(["","",""])),c,(0,r.getProperty)(t));if(i)(0,n.checkStrictMode)(e,"default is ignored for: ".concat(s));else{var u=r._(_templateObject94||(_templateObject94=_taggedTemplateLiteral([""," === undefined"])),s);"empty"===l.useDefaults&&(u=r._(_templateObject95||(_templateObject95=_taggedTemplateLiteral([""," || "," === null || ",' === ""'])),u,s,s)),o.if(u,r._(_templateObject96||(_templateObject96=_taggedTemplateLiteral([""," = ",""])),s,(0,r.stringify)(a)))}}}a.assignDefaults=function(e,t){var a=e.schema,r=a.properties,n=a.items;if("object"===t&&r)for(var i in r)o(e,i,r[i].default);else"array"===t&&Array.isArray(n)&&n.forEach(function(t,a){return o(e,a,t.default)})}},{"../codegen":2,"../util":10}],15:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getData=a.KeywordCxt=a.validateFunctionCode=void 0;var r=e("./boolSchema"),n=e("./dataType"),o=e("./applicability"),i=e("./dataType"),c=e("./defaults"),l=e("./keyword"),s=e("./subschema"),u=e("../codegen"),p=e("../names"),m=e("../resolve"),d=e("../util"),f=e("../errors");function h(e,t){var a=e.gen,r=e.validateName,n=e.schema,o=e.schemaEnv,i=e.opts;i.code.es5?a.func(r,u._(_templateObject97||(_templateObject97=_taggedTemplateLiteral(["",", ",""])),p.default.data,p.default.valCxt),o.$async,function(){a.code(u._(_templateObject98||(_templateObject98=_taggedTemplateLiteral(['"use strict"; ',""])),_(n,i))),function(e,t){e.if(p.default.valCxt,function(){e.var(p.default.instancePath,u._(_templateObject99||(_templateObject99=_taggedTemplateLiteral(["",".",""])),p.default.valCxt,p.default.instancePath)),e.var(p.default.parentData,u._(_templateObject100||(_templateObject100=_taggedTemplateLiteral(["",".",""])),p.default.valCxt,p.default.parentData)),e.var(p.default.parentDataProperty,u._(_templateObject101||(_templateObject101=_taggedTemplateLiteral(["",".",""])),p.default.valCxt,p.default.parentDataProperty)),e.var(p.default.rootData,u._(_templateObject102||(_templateObject102=_taggedTemplateLiteral(["",".",""])),p.default.valCxt,p.default.rootData)),t.dynamicRef&&e.var(p.default.dynamicAnchors,u._(_templateObject103||(_templateObject103=_taggedTemplateLiteral(["",".",""])),p.default.valCxt,p.default.dynamicAnchors))},function(){e.var(p.default.instancePath,u._(_templateObject104||(_templateObject104=_taggedTemplateLiteral(['""'])))),e.var(p.default.parentData,u._(_templateObject105||(_templateObject105=_taggedTemplateLiteral(["undefined"])))),e.var(p.default.parentDataProperty,u._(_templateObject106||(_templateObject106=_taggedTemplateLiteral(["undefined"])))),e.var(p.default.rootData,p.default.data),t.dynamicRef&&e.var(p.default.dynamicAnchors,u._(_templateObject107||(_templateObject107=_taggedTemplateLiteral(["{}"]))))})}(a,i),a.code(t)}):a.func(r,u._(_templateObject108||(_templateObject108=_taggedTemplateLiteral(["",", ",""])),p.default.data,function(e){return u._(_templateObject109||(_templateObject109=_taggedTemplateLiteral(["{",'="", ',", ",", ","=","","}={}"])),p.default.instancePath,p.default.parentData,p.default.parentDataProperty,p.default.rootData,p.default.data,e.dynamicRef?u._(_templateObject110||(_templateObject110=_taggedTemplateLiteral([", ","={}"])),p.default.dynamicAnchors):u.nil)}(i)),o.$async,function(){return a.code(_(n,i)).code(t)})}function _(e,t){var a="object"==_typeof(e)&&e[t.schemaId];return a&&(t.code.source||t.code.process)?u._(_templateObject111||(_templateObject111=_taggedTemplateLiteral(["/*# sourceURL="," */"])),a):u.nil}function v(e,t){y(e)&&(b(e),g(e))?function(e,t){var a=e.schema,r=e.gen;e.opts.$comment&&a.$comment&&O(e),function(e){var t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,m.resolveUrl)(e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);var n=r.const("_errs",p.default.errors);j(e,n),r.var(t,u._(_templateObject112||(_templateObject112=_taggedTemplateLiteral([""," === ",""])),n,p.default.errors))}(e,t):(0,r.boolOrEmptySchema)(e,t)}function g(e){var t=e.schema,a=e.self;if("boolean"==typeof t)return!t;for(var r in t)if(a.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function b(e){(0,d.checkUnknownRules)(e),function(e){var t=e.schema,a=e.errSchemaPath,r=e.opts,n=e.self;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn('$ref: keywords ignored in schema at path "'.concat(a,'"'))}(e)}function j(e,t){if(e.opts.jtd)return w(e,[],!1,t);var a=(0,n.getSchemaTypes)(e.schema);w(e,a,!(0,n.coerceAndCheckDataType)(e,a),t)}function O(e){var t=e.gen,a=e.schemaEnv,r=e.schema,n=e.errSchemaPath,o=e.opts,i=r.$comment;if(!0===o.$comment)t.code(u._(_templateObject113||(_templateObject113=_taggedTemplateLiteral(["",".logger.log(",")"])),p.default.self,i));else if("function"==typeof o.$comment){var c=u.str(_templateObject114||(_templateObject114=_taggedTemplateLiteral(["","/$comment"])),n),l=t.scopeValue("root",{ref:a.root});t.code(u._(_templateObject115||(_templateObject115=_taggedTemplateLiteral(["",".opts.$comment(",", ",", ",".schema)"])),p.default.self,i,c,l))}}function w(e,t,a,r){var n=e.gen,c=e.schema,l=e.data,s=e.allErrors,m=e.opts,f=e.self.RULES;function h(d){(0,o.shouldUseGroup)(c,d)&&(d.type?(n.if((0,i.checkDataType)(d.type,l,m.strictNumbers)),T(e,d),1===t.length&&t[0]===d.type&&a&&(n.else(),(0,i.reportTypeError)(e)),n.endIf()):T(e,d),s||n.if(u._(_templateObject116||(_templateObject116=_taggedTemplateLiteral([""," === ",""])),p.default.errors,r||0)))}!c.$ref||!m.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(c,f)?(m.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(function(t){P(e.dataTypes,t)||S(e,'type "'.concat(t,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),e.dataTypes=e.dataTypes.filter(function(e){return P(t,e)})):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){var a=e.self.RULES.all;for(var r in a){var n=a[r];if("object"==_typeof(n)&&(0,o.shouldUseRule)(e.schema,n)){var i=n.definition.type;i.length&&!i.some(function(e){return k(t,e)})&&S(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(r,'"'))}}}(e,e.dataTypes))}(e,t),n.block(function(){var e,t=_createForOfIteratorHelper(f.rules);try{for(t.s();!(e=t.n()).done;){h(e.value)}}catch(e){t.e(e)}finally{t.f()}h(f.post)})):n.block(function(){return C(e,"$ref",f.all.$ref.definition)})}function T(e,t){var a=e.gen,r=e.schema;e.opts.useDefaults&&(0,c.assignDefaults)(e,t.type),a.block(function(){var a,n=_createForOfIteratorHelper(t.rules);try{for(n.s();!(a=n.n()).done;){var i=a.value;(0,o.shouldUseRule)(r,i)&&C(e,i.keyword,i.definition,t.type)}}catch(e){n.e(e)}finally{n.f()}})}function k(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function P(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){(0,d.checkStrictMode)(e,t+=' at "'.concat(e.schemaEnv.baseId+e.errSchemaPath,'" (strictTypes)'),e.opts.strictTypes)}a.validateFunctionCode=function(e){y(e)&&(b(e),g(e))?function(e){var t=e.schema,a=e.opts,r=e.gen;h(e,function(){a.$comment&&t.$comment&&O(e),function(e){var t=e.schema,a=e.opts;void 0!==t.default&&a.useDefaults&&a.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(p.default.vErrors,null),r.let(p.default.errors,0),a.unevaluated&&function(e){var t=e.gen,a=e.validateName;e.evaluated=t.const("evaluated",u._(_templateObject117||(_templateObject117=_taggedTemplateLiteral(["",".evaluated"])),a)),t.if(u._(_templateObject118||(_templateObject118=_taggedTemplateLiteral(["",".dynamicProps"])),e.evaluated),function(){return t.assign(u._(_templateObject119||(_templateObject119=_taggedTemplateLiteral(["",".props"])),e.evaluated),u._(_templateObject120||(_templateObject120=_taggedTemplateLiteral(["undefined"]))))}),t.if(u._(_templateObject121||(_templateObject121=_taggedTemplateLiteral(["",".dynamicItems"])),e.evaluated),function(){return t.assign(u._(_templateObject122||(_templateObject122=_taggedTemplateLiteral(["",".items"])),e.evaluated),u._(_templateObject123||(_templateObject123=_taggedTemplateLiteral(["undefined"]))))})}(e),j(e),function(e){var t=e.gen,a=e.schemaEnv,r=e.validateName,n=e.ValidationError,o=e.opts;a.$async?t.if(u._(_templateObject124||(_templateObject124=_taggedTemplateLiteral([""," === 0"])),p.default.errors),function(){return t.return(p.default.data)},function(){return t.throw(u._(_templateObject125||(_templateObject125=_taggedTemplateLiteral(["new ","(",")"])),n,p.default.vErrors))}):(t.assign(u._(_templateObject126||(_templateObject126=_taggedTemplateLiteral(["",".errors"])),r),p.default.vErrors),o.unevaluated&&function(e){var t=e.gen,a=e.evaluated,r=e.props,n=e.items;r instanceof u.Name&&t.assign(u._(_templateObject127||(_templateObject127=_taggedTemplateLiteral(["",".props"])),a),r),n instanceof u.Name&&t.assign(u._(_templateObject128||(_templateObject128=_taggedTemplateLiteral(["",".items"])),a),n)}(e),t.return(u._(_templateObject129||(_templateObject129=_taggedTemplateLiteral([""," === 0"])),p.default.errors)))}(e)})}(e):h(e,function(){return(0,r.topBoolOrEmptySchema)(e)})};var E=function(){function e(t,a,r){if(_classCallCheck(this,e),(0,l.validateKeywordUsage)(t,a,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=a.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=a.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=a,this.$data)this.schemaCode=t.gen.const("vSchema",$(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,a.schemaType,a.allowUndefined))throw new Error("".concat(r," value must be ").concat(JSON.stringify(a.schemaType)));("code"in a?a.trackErrors:!1!==a.errors)&&(this.errsCount=t.gen.const("_errs",p.default.errors))}return _createClass(e,[{key:"result",value:function(e,t,a){this.failResult((0,u.not)(e),t,a)}},{key:"failResult",value:function(e,t,a){this.gen.if(e),a?a():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}},{key:"pass",value:function(e,t){this.failResult((0,u.not)(e),void 0,t)}},{key:"fail",value:function(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}},{key:"fail$data",value:function(e){if(!this.$data)return this.fail(e);var t=this.schemaCode;this.fail(u._(_templateObject130||(_templateObject130=_taggedTemplateLiteral([""," !== undefined && (",")"])),t,(0,u.or)(this.invalid$data(),e)))}},{key:"error",value:function(e,t,a){if(t)return this.setParams(t),this._error(e,a),void this.setParams({});this._error(e,a)}},{key:"_error",value:function(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}},{key:"$dataError",value:function(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}},{key:"reset",value:function(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}},{key:"ok",value:function(e){this.allErrors||this.gen.if(e)}},{key:"setParams",value:function(e,t){t?Object.assign(this.params,e):this.params=e}},{key:"block$data",value:function(e,t){var a=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.nil;this.gen.block(function(){a.check$data(e,r),t()})}},{key:"check$data",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.nil,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.nil;if(this.$data){var a=this.gen,r=this.schemaCode,n=this.schemaType,o=this.def;a.if((0,u.or)(u._(_templateObject131||(_templateObject131=_taggedTemplateLiteral([""," === undefined"])),r),t)),e!==u.nil&&a.assign(e,!0),(n.length||o.validateSchema)&&(a.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&a.assign(e,!1)),a.else()}}},{key:"invalid$data",value:function(){var e=this.gen,t=this.schemaCode,a=this.schemaType,r=this.def,n=this.it;return(0,u.or)(function(){if(a.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");var e=Array.isArray(a)?a:[a];return u._(_templateObject132||(_templateObject132=_taggedTemplateLiteral(["",""])),(0,i.checkDataTypes)(e,t,n.opts.strictNumbers,i.DataType.Wrong))}return u.nil}(),function(){if(r.validateSchema){var a=e.scopeValue("validate$data",{ref:r.validateSchema});return u._(_templateObject133||(_templateObject133=_taggedTemplateLiteral(["!","(",")"])),a,t)}return u.nil}())}},{key:"subschema",value:function(e,t){var a=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(a,this.it,e),(0,s.extendSubschemaMode)(a,e);var r=_objectSpread(_objectSpread(_objectSpread({},this.it),a),{},{items:void 0,props:void 0});return v(r,t),r}},{key:"mergeEvaluated",value:function(e,t){var a=this.it,r=this.gen;a.opts.unevaluated&&(!0!==a.props&&void 0!==e.props&&(a.props=d.mergeEvaluated.props(r,e.props,a.props,t)),!0!==a.items&&void 0!==e.items&&(a.items=d.mergeEvaluated.items(r,e.items,a.items,t)))}},{key:"mergeValidEvaluated",value:function(e,t){var a=this,r=this.it,n=this.gen;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,function(){return a.mergeEvaluated(e,u.Name)}),!0}}]),e}();function C(e,t,a,r){var n=new E(e,a,t);"code"in a?a.code(n,r):n.$data&&a.validate?(0,l.funcKeywordCode)(n,a):"macro"in a?(0,l.macroKeywordCode)(n,a):(a.compile||a.validate)&&(0,l.funcKeywordCode)(n,a)}a.KeywordCxt=E;var L=/^\/(?:[^~]|~0|~1)*$/,N=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function $(e,t){var a,r,n=t.dataLevel,o=t.dataNames,i=t.dataPathArr;if(""===e)return p.default.rootData;if("/"===e[0]){if(!L.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));a=e,r=p.default.rootData}else{var c=N.exec(e);if(!c)throw new Error("Invalid JSON-pointer: ".concat(e));var l=+c[1];if("#"===(a=c[2])){if(l>=n)throw new Error(_("property/index",l));return i[n-l]}if(l>n)throw new Error(_("data",l));if(r=o[n-l],!a)return r}var s,m=r,f=_createForOfIteratorHelper(a.split("/"));try{for(f.s();!(s=f.n()).done;){var h=s.value;h&&(r=u._(_templateObject134||(_templateObject134=_taggedTemplateLiteral(["","",""])),r,(0,u.getProperty)((0,d.unescapeJsonPointer)(h))),m=u._(_templateObject135||(_templateObject135=_taggedTemplateLiteral([""," && ",""])),m,r))}}catch(e){f.e(e)}finally{f.f()}return m;function _(e,t){return"Cannot access ".concat(e," ").concat(t," levels up, current level is ").concat(n)}}a.getData=$},{"../codegen":2,"../errors":4,"../names":6,"../resolve":8,"../util":10,"./applicability":11,"./boolSchema":12,"./dataType":13,"./defaults":14,"./keyword":16,"./subschema":17}],16:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateKeywordUsage=a.validSchemaType=a.funcKeywordCode=a.macroKeywordCode=void 0;var r=e("../codegen"),n=e("../names"),o=e("../../vocabularies/code"),i=e("../errors");function c(e){var t=e.gen,a=e.data,n=e.it;t.if(n.parentData,function(){return t.assign(a,r._(_templateObject136||(_templateObject136=_taggedTemplateLiteral(["","[","]"])),n.parentData,n.parentDataProperty))})}function l(e,t,a){if(void 0===a)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword","function"==typeof a?{ref:a}:{ref:a,code:(0,r.stringify)(a)})}a.macroKeywordCode=function(e,t){var a=e.gen,n=e.keyword,o=e.schema,i=e.parentSchema,c=e.it,s=t.macro.call(c.self,o,i,c),u=l(a,n,s);!1!==c.opts.validateSchema&&c.self.validateSchema(s,!0);var p=a.name("valid");e.subschema({schema:s,schemaPath:r.nil,errSchemaPath:"".concat(c.errSchemaPath,"/").concat(n),topSchemaRef:u,compositeRule:!0},p),e.pass(p,function(){return e.error(!0)})},a.funcKeywordCode=function(e,t){var a,s=e.gen,u=e.keyword,p=e.schema,m=e.parentSchema,d=e.$data,f=e.it;!function(e,t){var a=f.schemaEnv;if(t.async&&!a.$async)throw new Error("async keyword in sync schema")}(0,t);var h=!d&&t.compile?t.compile.call(f.self,p,m,f):t.validate,_=l(s,u,h),v=s.let("valid");function g(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.async?r._(_templateObject137||(_templateObject137=_taggedTemplateLiteral(["await "]))):r.nil;s.assign(v,r._(_templateObject138||(_templateObject138=_taggedTemplateLiteral(["","",""])),a,(0,o.callValidateCode)(e,_,f.opts.passContext?n.default.this:n.default.self,!("compile"in t&&!d||!1===t.schema))),t.modifying)}function y(e){var a;s.if((0,r.not)(null!==(a=t.valid)&&void 0!==a?a:v),e)}e.block$data(v,function(){if(!1===t.errors)g(),t.modifying&&c(e),y(function(){return e.error()});else{var a=t.async?function(){var e=s.let("ruleErrs",null);return s.try(function(){return g(r._(_templateObject139||(_templateObject139=_taggedTemplateLiteral(["await "]))))},function(t){return s.assign(v,!1).if(r._(_templateObject140||(_templateObject140=_taggedTemplateLiteral([""," instanceof ",""])),t,f.ValidationError),function(){return s.assign(e,r._(_templateObject141||(_templateObject141=_taggedTemplateLiteral(["",".errors"])),t))},function(){return s.throw(t)})}),e}():function(){var e=r._(_templateObject142||(_templateObject142=_taggedTemplateLiteral(["",".errors"])),_);return s.assign(e,null),g(r.nil),e}();t.modifying&&c(e),y(function(){return function(e,t){var a=e.gen;a.if(r._(_templateObject143||(_templateObject143=_taggedTemplateLiteral(["Array.isArray(",")"])),t),function(){a.assign(n.default.vErrors,r._(_templateObject144||(_templateObject144=_taggedTemplateLiteral([""," === null ? "," : ",".concat(",")"])),n.default.vErrors,t,n.default.vErrors,t)).assign(n.default.errors,r._(_templateObject145||(_templateObject145=_taggedTemplateLiteral(["",".length"])),n.default.vErrors)),(0,i.extendErrors)(e)},function(){return e.error()})}(e,a)})}}),e.ok(null!==(a=t.valid)&&void 0!==a?a:v)},a.validSchemaType=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!t.length||t.some(function(t){return"array"===t?Array.isArray(e):"object"===t?e&&"object"==_typeof(e)&&!Array.isArray(e):_typeof(e)==t||a&&void 0===e})},a.validateKeywordUsage=function(e,t,a){var r=e.schema,n=e.opts,o=e.self,i=e.errSchemaPath;if(Array.isArray(t.keyword)?!t.keyword.includes(a):t.keyword!==a)throw new Error("ajv implementation error");var c=t.dependencies;if(null==c?void 0:c.some(function(e){return!Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have dependencies of ".concat(a,": ").concat(c.join(",")));if(t.validateSchema&&!t.validateSchema(r[a])){var l='keyword "'.concat(a,'" value is invalid at path "').concat(i,'": ')+o.errorsText(t.validateSchema.errors);if("log"!==n.validateSchema)throw new Error(l);o.logger.error(l)}}},{"../../vocabularies/code":50,"../codegen":2,"../errors":4,"../names":6}],17:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendSubschemaMode=a.extendSubschemaData=a.getSubschema=void 0;var r=e("../codegen"),n=e("../util");a.getSubschema=function(e,t){var a=t.keyword,o=t.schemaProp,i=t.schema,c=t.schemaPath,l=t.errSchemaPath,s=t.topSchemaRef;if(void 0!==a&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){var u=e.schema[a];return void 0===o?{schema:u,schemaPath:r._(_templateObject146||(_templateObject146=_taggedTemplateLiteral(["","",""])),e.schemaPath,(0,r.getProperty)(a)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(a)}:{schema:u[o],schemaPath:r._(_templateObject147||(_templateObject147=_taggedTemplateLiteral(["","","",""])),e.schemaPath,(0,r.getProperty)(a),(0,r.getProperty)(o)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(a,"/").concat((0,n.escapeFragment)(o))}}if(void 0!==i){if(void 0===c||void 0===l||void 0===s)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:c,topSchemaRef:s,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')},a.extendSubschemaData=function(e,t,a){var o=a.dataProp,i=a.dataPropType,c=a.data,l=a.dataTypes,s=a.propertyName;if(void 0!==c&&void 0!==o)throw new Error('both "data" and "dataProp" passed, only one allowed');var u=t.gen;if(void 0!==o){var p=t.errorPath,m=t.dataPathArr,d=t.opts;f(u.let("data",r._(_templateObject148||(_templateObject148=_taggedTemplateLiteral(["","",""])),t.data,(0,r.getProperty)(o)),!0)),e.errorPath=r.str(_templateObject149||(_templateObject149=_taggedTemplateLiteral(["","",""])),p,(0,n.getErrorPath)(o,i,d.jsPropertySyntax)),e.parentDataProperty=r._(_templateObject150||(_templateObject150=_taggedTemplateLiteral(["",""])),o),e.dataPathArr=[].concat(_toConsumableArray(m),[e.parentDataProperty])}function f(a){e.data=a,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[].concat(_toConsumableArray(t.dataNames),[a])}void 0!==c&&(f(c instanceof r.Name?c:u.let("data",c,!0)),void 0!==s&&(e.propertyName=s)),l&&(e.dataTypes=l)},a.extendSubschemaMode=function(e,t){var a=t.jtdDiscriminator,r=t.jtdMetadata,n=t.compositeRule,o=t.createErrors,i=t.allErrors;void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=a,e.jtdMetadata=r}},{"../codegen":2,"../util":10}],18:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=void 0;var r=e("./compile/validate");Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var n=e("./compile/codegen");Object.defineProperty(a,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});var o=e("./runtime/validation_error"),i=e("./compile/ref_error"),c=e("./compile/rules"),l=e("./compile"),s=e("./compile/codegen"),u=e("./compile/resolve"),p=e("./compile/validate/dataType"),m=e("./compile/util"),d=e("./refs/data.json"),f=function(e,t){return new RegExp(e,t)};f.code="new RegExp";var h=["removeAdditional","useDefaults","coerceTypes"],_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var y=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=_objectSpread(_objectSpread({},t),function(e){var t,a,r,n,o,i,c,l,s,u,p,m,d,h,_,v,g,y,b,j,O,w,T,k,P=e.strict,S=null===(t=e.code)||void 0===t?void 0:t.optimize,E=!0===S||void 0===S?1:S||0,C=null!==(r=null===(a=e.code)||void 0===a?void 0:a.regExp)&&void 0!==r?r:f;return{strictSchema:null===(o=null!==(n=e.strictSchema)&&void 0!==n?n:P)||void 0===o||o,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:P)||void 0===c||c,strictTypes:null!==(s=null!==(l=e.strictTypes)&&void 0!==l?l:P)&&void 0!==s?s:"log",strictTuples:null!==(p=null!==(u=e.strictTuples)&&void 0!==u?u:P)&&void 0!==p?p:"log",strictRequired:null!==(d=null!==(m=e.strictRequired)&&void 0!==m?m:P)&&void 0!==d&&d,code:e.code?_objectSpread(_objectSpread({},e.code),{},{optimize:E,regExp:C}):{optimize:E,regExp:C},loopRequired:null!==(h=e.loopRequired)&&void 0!==h?h:200,loopEnum:null!==(_=e.loopEnum)&&void 0!==_?_:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(g=e.messages)||void 0===g||g,inlineRefs:null===(y=e.inlineRefs)||void 0===y||y,schemaId:null!==(b=e.schemaId)&&void 0!==b?b:"$id",addUsedSchema:null===(j=e.addUsedSchema)||void 0===j||j,validateSchema:null===(O=e.validateSchema)||void 0===O||O,validateFormats:null===(w=e.validateFormats)||void 0===w||w,unicodeRegExp:null===(T=e.unicodeRegExp)||void 0===T||T,int32range:null===(k=e.int32range)||void 0===k||k}}(t));var a=this.opts.code,r=a.es5,n=a.lines;this.scope=new s.ValueScope({scope:{},prefixes:_,es5:r,lines:n}),this.logger=function(e){if(!1===e)return O;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(t.logger);var o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,c.getRules)(),b.call(this,v,t,"NOT SUPPORTED"),b.call(this,g,t,"DEPRECATED","warn"),this._metaOpts=function(){var e,t=_objectSpread({},this.opts),a=_createForOfIteratorHelper(h);try{for(a.s();!(e=a.n()).done;){var r=e.value;delete t[r]}}catch(e){a.e(e)}finally{a.f()}return t}.call(this),t.formats&&function(){for(var e in this.opts.formats){var t=this.opts.formats[e];t&&this.addFormat(e,t)}}.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&function(e){if(Array.isArray(e))this.addVocabulary(e);else for(var t in this.logger.warn("keywords option as map is deprecated, pass array"),e){var a=e[t];a.keyword||(a.keyword=t),this.addKeyword(a)}}.call(this,t.keywords),"object"==_typeof(t.meta)&&this.addMetaSchema(t.meta),function(){var e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(var t in e)this.addSchema(e[t],t)}.call(this),t.validateFormats=o}return _createClass(e,[{key:"_addVocabularies",value:function(){this.addKeyword("$async")}},{key:"_addDefaultMetaSchema",value:function(){var e=this.opts,t=e.$data,a=e.meta,r=e.schemaId,n=d;"id"===r&&((n=_objectSpread({},d)).id=n.$id,delete n.$id),a&&t&&this.addMetaSchema(n,n[r],!1)}},{key:"defaultMeta",value:function(){var e=this.opts,t=e.meta,a=e.schemaId;return this.opts.defaultMeta="object"==_typeof(t)?t[a]||t:void 0}},{key:"validate",value:function(e,t){var a;if("string"==typeof e){if(!(a=this.getSchema(e)))throw new Error('no schema with key or ref "'.concat(e,'"'))}else a=this.compile(e);var r=a(t);return"$async"in a||(this.errors=a.errors),r}},{key:"compile",value:function(e,t){var a=this._addSchema(e,t);return a.validate||this._compileSchemaEnv(a)}},{key:"compileAsync",value:function(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");var a=this.opts.loadSchema;return r.call(this,e,t);function r(e,t){return n.apply(this,arguments)}function n(){return(n=_asyncToGenerator(regeneratorRuntime.mark(function e(t,a){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.call(this,t.$schema);case 2:return r=this._addSchema(t,a),e.abrupt("return",r.validate||l.call(this,r));case 4:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function o(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t&&!this.getSchema(t),!e.t0){e.next=4;break}return e.next=4,r.call(this,{$ref:t},!0);case 4:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function l(e){return s.apply(this,arguments)}function s(){return(s=_asyncToGenerator(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._compileSchemaEnv(t));case 4:if(e.prev=4,e.t0=e.catch(0),e.t0 instanceof i.default){e.next=8;break}throw e.t0;case 8:return u.call(this,e.t0),e.next=11,p.call(this,e.t0.missingSchema);case 11:return e.abrupt("return",l.call(this,t));case 12:case"end":return e.stop()}},e,this,[[0,4]])}))).apply(this,arguments)}function u(e){var t=e.missingSchema,a=e.missingRef;if(this.refs[t])throw new Error("AnySchema ".concat(t," is loaded but ").concat(a," cannot be resolved"))}function p(e){return m.apply(this,arguments)}function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark(function e(a){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.call(this,a);case 2:if(r=e.sent,e.t0=this.refs[a],e.t0){e.next=7;break}return e.next=7,o.call(this,r.$schema);case 7:this.refs[a]||this.addSchema(r,a,t);case 8:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function d(e){return f.apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._loading[t])){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,e.next=6,this._loading[t]=a(t);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,delete this._loading[t],e.finish(7);case 10:case"end":return e.stop()}},e,this,[[3,,7,10]])}))).apply(this,arguments)}}},{key:"addSchema",value:function(e,t,a){var r,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.validateSchema;if(Array.isArray(e)){var o,i=_createForOfIteratorHelper(e);try{for(i.s();!(o=i.n()).done;){var c=o.value;this.addSchema(c,void 0,a,n)}}catch(e){i.e(e)}finally{i.f()}return this}if("object"==_typeof(e)){var l=this.opts.schemaId;if(void 0!==(r=e[l])&&"string"!=typeof r)throw new Error("schema ".concat(l," must be string"))}return t=(0,u.normalizeId)(t||r),this._checkUnique(t),this.schemas[t]=this._addSchema(e,a,t,n,!0),this}},{key:"addMetaSchema",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.opts.validateSchema;return this.addSchema(e,t,!0,a),this}},{key:"validateSchema",value:function(e,t){if("boolean"==typeof e)return!0;var a;if(void 0!==(a=e.$schema)&&"string"!=typeof a)throw new Error("$schema must be a string");if(!(a=a||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var r=this.validate(a,e);if(!r&&t){var n="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(n);this.logger.error(n)}return r}},{key:"getSchema",value:function(e){for(var t;"string"==typeof(t=j.call(this,e));)e=t;if(void 0===t){var a=this.opts.schemaId,r=new l.SchemaEnv({schema:{},schemaId:a});if(!(t=l.resolveSchema.call(this,r,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}},{key:"removeSchema",value:function(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(_typeof(e)){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":var t=j.call(this,e);return"object"==_typeof(t)&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this;case"object":this._cache.delete(e);var a=e[this.opts.schemaId];return a&&(a=(0,u.normalizeId)(a),delete this.schemas[a],delete this.refs[a]),this;default:throw new Error("ajv.removeSchema: invalid parameter")}}},{key:"addVocabulary",value:function(e){var t,a=_createForOfIteratorHelper(e);try{for(a.s();!(t=a.n()).done;){var r=t.value;this.addKeyword(r)}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"addKeyword",value:function(e,t){var a,r=this;if("string"==typeof e)a=e,"object"==_typeof(t)&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=a);else{if("object"!=_typeof(e)||void 0!==t)throw new Error("invalid addKeywords parameters");if(a=(t=e).keyword,Array.isArray(a)&&!a.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(function(e,t){var a=this.RULES;if((0,m.eachItem)(e,function(e){if(a.keywords[e])throw new Error("Keyword ".concat(e," is already defined"));if(!w.test(e))throw new Error("Keyword ".concat(e," has invalid name"))}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}.call(this,a,t),!t)return(0,m.eachItem)(a,function(e){return T.call(r,e)}),this;(function(e){var t=e.metaSchema;void 0!==t&&(e.$data&&this.opts.$data&&(t=P(t)),e.validateSchema=this.compile(t,!0))}).call(this,t);var n=_objectSpread(_objectSpread({},t),{},{type:(0,p.getJSONTypes)(t.type),schemaType:(0,p.getJSONTypes)(t.schemaType)});return(0,m.eachItem)(a,0===n.type.length?function(e){return T.call(r,e,n)}:function(e){return n.type.forEach(function(t){return T.call(r,e,n,t)})}),this}},{key:"getKeyword",value:function(e){var t=this.RULES.all[e];return"object"==_typeof(t)?t.definition:!!t}},{key:"removeKeyword",value:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e];var a,r=_createForOfIteratorHelper(t.rules);try{for(r.s();!(a=r.n()).done;){var n=a.value,o=n.rules.findIndex(function(t){return t.keyword===e});o>=0&&n.rules.splice(o,1)}}catch(e){r.e(e)}finally{r.f()}return this}},{key:"addFormat",value:function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}},{key:"errorsText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.errors,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.separator,r=void 0===a?", ":a,n=t.dataVar,o=void 0===n?"data":n;return e&&0!==e.length?e.map(function(e){return"".concat(o).concat(e.instancePath," ").concat(e.message)}).reduce(function(e,t){return e+r+t}):"No errors"}},{key:"$dataMetaSchema",value:function(e,t){var a=this.RULES.all;e=JSON.parse(JSON.stringify(e));var r,n=_createForOfIteratorHelper(t);try{for(n.s();!(r=n.n()).done;){var o,i=r.value.split("/").slice(1),c=e,l=_createForOfIteratorHelper(i);try{for(l.s();!(o=l.n()).done;){c=c[o.value]}}catch(e){l.e(e)}finally{l.f()}for(var s in a){var u=a[s];if("object"==_typeof(u)){var p=u.definition.$data,m=c[s];p&&m&&(c[s]=P(m))}}}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"_removeAllSchemas",value:function(e,t){for(var a in e){var r=e[a];t&&!t.test(a)||("string"==typeof r?delete e[a]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[a]))}}},{key:"_addSchema",value:function(e,t,a){var r,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.validateSchema,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.opts.addUsedSchema,i=this.opts.schemaId;if("object"==_typeof(e))r=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}var c=this._cache.get(e);if(void 0!==c)return c;a=(0,u.normalizeId)(r||a);var s=u.getSchemaRefs.call(this,e,a);return c=new l.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:a,localRefs:s}),this._cache.set(c.schema,c),o&&!a.startsWith("#")&&(a&&this._checkUnique(a),this.refs[a]=c),n&&this.validateSchema(e,!0),c}},{key:"_checkUnique",value:function(e){if(this.schemas[e]||this.refs[e])throw new Error('schema with key or id "'.concat(e,'" already exists'))}},{key:"_compileSchemaEnv",value:function(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}},{key:"_compileMetaSchema",value:function(e){var t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}]),e}();function b(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"error";for(var n in e){var o=n;o in t&&this.logger[r]("".concat(a,": option ").concat(n,". ").concat(e[o]))}}function j(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}a.default=y,y.ValidationError=o.default,y.MissingRefError=i.default;var O={log:function(){},warn:function(){},error:function(){}},w=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t,a){var r,n=this,o=null==t?void 0:t.post;if(a&&o)throw new Error('keyword with "post" flag cannot have "type"');var i=this.RULES,c=o?i.post:i.rules.find(function(e){return e.type===a});if(c||(c={type:a,rules:[]},i.rules.push(c)),i.keywords[e]=!0,t){var l={keyword:e,definition:_objectSpread(_objectSpread({},t),{},{type:(0,p.getJSONTypes)(t.type),schemaType:(0,p.getJSONTypes)(t.schemaType)})};t.before?function(e,t,a){var r=e.rules.findIndex(function(e){return e.keyword===a});r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(a," is not defined")))}.call(this,c,l,t.before):c.rules.push(l),i.all[e]=l,null===(r=t.implements)||void 0===r||r.forEach(function(e){return n.addKeyword(e)})}}var k={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function P(e){return{anyOf:[e,k]}}},{"./compile":5,"./compile/codegen":2,"./compile/ref_error":7,"./compile/resolve":8,"./compile/rules":9,"./compile/util":10,"./compile/validate":15,"./compile/validate/dataType":13,"./refs/data.json":19,"./runtime/validation_error":31}],19:[function(e,t,a){t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},{}],20:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./schema.json"),n=e("./meta/applicator.json"),o=e("./meta/unevaluated.json"),i=e("./meta/content.json"),c=e("./meta/core.json"),l=e("./meta/format-annotation.json"),s=e("./meta/meta-data.json"),u=e("./meta/validation.json"),p=["/properties"];a.default=function(e){var t=this;return[r,n,o,i,c,a(this,l),s,a(this,u)].forEach(function(e){return t.addMetaSchema(e,void 0,!1)}),this;function a(t,a){return e?t.$dataMetaSchema(a,p):a}}},{"./meta/applicator.json":21,"./meta/content.json":22,"./meta/core.json":23,"./meta/format-annotation.json":24,"./meta/meta-data.json":25,"./meta/unevaluated.json":26,"./meta/validation.json":27,"./schema.json":28}],21:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}},{}],22:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}},{}],23:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}},{}],24:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}},{}],25:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}},{}],26:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}},{}],27:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}},{}],28:[function(e,t,a){t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}},{}],29:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("fast-deep-equal");r.code='require("ajv/dist/runtime/equal").default',a.default=r},{"fast-deep-equal":82}],30:[function(e,t,a){"use strict";function r(e){for(var t,a=e.length,r=0,n=0;n<a;)r++,(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<a&&(56320==(64512&(t=e.charCodeAt(n)))&&n++);return r}Object.defineProperty(a,"__esModule",{value:!0}),a.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},{}],31:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=function(e){_inherits(a,_wrapNativeSuper(Error));var t=_createSuper(a);function a(e){var r;return _classCallCheck(this,a),(r=t.call(this,"validation failed")).errors=e,r.ajv=r.validation=!0,r}return _createClass(a)}();a.default=r},{}],32:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateAdditionalItems=void 0;var r=e("../../compile/codegen"),n=e("../../compile/util"),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:function(e){var t=e.params.len;return r.str(_templateObject151||(_templateObject151=_taggedTemplateLiteral(["must NOT have more than "," items"])),t)},params:function(e){var t=e.params.len;return r._(_templateObject152||(_templateObject152=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.parentSchema,a=e.it,r=t.items;Array.isArray(r)?i(e,r):(0,n.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas')}};function i(e,t){var a=e.gen,o=e.schema,i=e.data,c=e.keyword,l=e.it;l.items=!0;var s=a.const("len",r._(_templateObject153||(_templateObject153=_taggedTemplateLiteral(["",".length"])),i));if(!1===o)e.setParams({len:t.length}),e.pass(r._(_templateObject154||(_templateObject154=_taggedTemplateLiteral([""," <= ",""])),s,t.length));else if("object"==_typeof(o)&&!(0,n.alwaysValidSchema)(l,o)){var u=a.var("valid",r._(_templateObject155||(_templateObject155=_taggedTemplateLiteral([""," <= ",""])),s,t.length));a.if((0,r.not)(u),function(){return o=u,void a.forRange("i",t.length,s,function(t){e.subschema({keyword:c,dataProp:t,dataPropType:n.Type.Num},o),l.allErrors||a.if((0,r.not)(o),function(){return a.break()})});var o}),e.ok(u)}}a.validateAdditionalItems=i,a.default=o},{"../../compile/codegen":2,"../../compile/util":10}],33:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../code"),n=e("../../compile/codegen"),o=e("../../compile/names"),i=e("../../compile/util");a.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:function(e){var t=e.params;return n._(_templateObject156||(_templateObject156=_taggedTemplateLiteral(["{additionalProperty: ","}"])),t.additionalProperty)}},code:function(e){var t=e.gen,a=e.schema,c=e.parentSchema,l=e.data,s=e.errsCount,u=e.it;if(!s)throw new Error("ajv implementation error");var p=u.allErrors,m=u.opts;if(u.props=!0,"all"===m.removeAdditional||!(0,i.alwaysValidSchema)(u,a)){var d=(0,r.allSchemaProperties)(c.properties),f=(0,r.allSchemaProperties)(c.patternProperties);t.forIn("key",l,function(a){d.length||f.length?t.if(function(a){var o;if(d.length>8){var l=(0,i.schemaRefOrVal)(u,c.properties,"properties");o=(0,r.isOwnProperty)(t,l,a)}else o=d.length?n.or.apply(void 0,_toConsumableArray(d.map(function(e){return n._(_templateObject158||(_templateObject158=_taggedTemplateLiteral([""," === ",""])),a,e)}))):n.nil;return f.length&&(o=n.or.apply(void 0,[o].concat(_toConsumableArray(f.map(function(t){return n._(_templateObject159||(_templateObject159=_taggedTemplateLiteral(["",".test(",")"])),(0,r.usePattern)(e,t),a)}))))),(0,n.not)(o)}(a),function(){return _(a)}):_(a)}),e.ok(n._(_templateObject160||(_templateObject160=_taggedTemplateLiteral([""," === ",""])),s,o.default.errors))}function h(e){t.code(n._(_templateObject157||(_templateObject157=_taggedTemplateLiteral(["delete ","[","]"])),l,e))}function _(r){if("all"===m.removeAdditional||m.removeAdditional&&!1===a)h(r);else{if(!1===a)return e.setParams({additionalProperty:r}),e.error(),void(p||t.break());if("object"==_typeof(a)&&!(0,i.alwaysValidSchema)(u,a)){var o=t.name("valid");"failing"===m.removeAdditional?(v(r,o,!1),t.if((0,n.not)(o),function(){e.reset(),h(r)})):(v(r,o),p||t.if((0,n.not)(o),function(){return t.break()}))}}}function v(t,a,r){var n={keyword:"additionalProperties",dataProp:t,dataPropType:i.Type.Str};!1===r&&Object.assign(n,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(n,a)}}}},{"../../compile/codegen":2,"../../compile/names":6,"../../compile/util":10,"../code":50}],34:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/util");a.default={keyword:"allOf",schemaType:"array",code:function(e){var t=e.gen,a=e.schema,n=e.it;if(!Array.isArray(a))throw new Error("ajv implementation error");var o=t.name("valid");a.forEach(function(t,a){if(!(0,r.alwaysValidSchema)(n,t)){var i=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(i)}})}}},{"../../compile/util":10}],35:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../code");a.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r.validateUnion,error:{message:"must match a schema in anyOf"}}},{"../code":50}],36:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util");a.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:function(e){var t=e.params,a=t.min,n=t.max;return void 0===n?r.str(_templateObject161||(_templateObject161=_taggedTemplateLiteral(["must contain at least "," valid item(s)"])),a):r.str(_templateObject162||(_templateObject162=_taggedTemplateLiteral(["must contain at least "," and no more than "," valid item(s)"])),a,n)},params:function(e){var t=e.params,a=t.min,n=t.max;return void 0===n?r._(_templateObject163||(_templateObject163=_taggedTemplateLiteral(["{minContains: ","}"])),a):r._(_templateObject164||(_templateObject164=_taggedTemplateLiteral(["{minContains: ",", maxContains: ","}"])),a,n)}},code:function(e){var t,a,o=e.gen,i=e.schema,c=e.parentSchema,l=e.data,s=e.it,u=c.minContains,p=c.maxContains;s.opts.next?(t=void 0===u?1:u,a=p):t=1;var m=o.const("len",r._(_templateObject165||(_templateObject165=_taggedTemplateLiteral(["",".length"])),l));if(e.setParams({min:t,max:a}),void 0!==a||0!==t){if(void 0!==a&&t>a)return(0,n.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,n.alwaysValidSchema)(s,i)){var d=r._(_templateObject166||(_templateObject166=_taggedTemplateLiteral([""," >= ",""])),m,t);return void 0!==a&&(d=r._(_templateObject167||(_templateObject167=_taggedTemplateLiteral([""," && "," <= ",""])),d,m,a)),void e.pass(d)}s.items=!0;var f=o.name("valid");void 0===a&&1===t?_(f,function(){return o.if(f,function(){return o.break()})}):0===t?(o.let(f,!0),void 0!==a&&o.if(r._(_templateObject172||(_templateObject172=_taggedTemplateLiteral(["",".length > 0"])),l),h)):(o.let(f,!1),h()),e.result(f,function(){return e.reset()})}else(0,n.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');function h(){var e=o.name("_valid"),n=o.let("count",0);_(e,function(){return o.if(e,function(){return e=n,o.code(r._(_templateObject168||(_templateObject168=_taggedTemplateLiteral(["","++"])),e)),void(void 0===a?o.if(r._(_templateObject169||(_templateObject169=_taggedTemplateLiteral([""," >= ",""])),e,t),function(){return o.assign(f,!0).break()}):(o.if(r._(_templateObject170||(_templateObject170=_taggedTemplateLiteral([""," > ",""])),e,a),function(){return o.assign(f,!1).break()}),1===t?o.assign(f,!0):o.if(r._(_templateObject171||(_templateObject171=_taggedTemplateLiteral([""," >= ",""])),e,t),function(){return o.assign(f,!0)})));var e})})}function _(t,a){o.forRange("i",0,m,function(r){e.subschema({keyword:"contains",dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),a()})}}}},{"../../compile/codegen":2,"../../compile/util":10}],37:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateSchemaDeps=a.validatePropertyDeps=a.error=void 0;var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../code");a.error={message:function(e){var t=e.params,a=t.property,n=t.depsCount,o=t.deps;return r.str(_templateObject173||(_templateObject173=_taggedTemplateLiteral(["must have "," "," when property "," is present"])),1===n?"property":"properties",o,a)},params:function(e){var t=e.params,a=t.property,n=t.depsCount,o=t.deps,i=t.missingProperty;return r._(_templateObject174||(_templateObject174=_taggedTemplateLiteral(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),a,i,n,o)}};var i={keyword:"dependencies",type:"object",schemaType:"object",error:a.error,code:function(e){var t=_slicedToArray(function(e){var t=e.schema,a={},r={};for(var n in t)"__proto__"!==n&&((Array.isArray(t[n])?a:r)[n]=t[n]);return[a,r]}(e),2),a=t[0],r=t[1];c(e,a),l(e,r)}};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema,a=e.gen,n=e.data,i=e.it;if(0!==Object.keys(t).length){var c=a.let("missing"),l=function(l){var s=t[l];if(0===s.length)return"continue";var u=(0,o.propertyInData)(a,n,l,i.opts.ownProperties);e.setParams({property:l,depsCount:s.length,deps:s.join(", ")}),i.allErrors?a.if(u,function(){var t,a=_createForOfIteratorHelper(s);try{for(a.s();!(t=a.n()).done;){var r=t.value;(0,o.checkReportMissingProp)(e,r)}}catch(e){a.e(e)}finally{a.f()}}):(a.if(r._(_templateObject175||(_templateObject175=_taggedTemplateLiteral([""," && (",")"])),u,(0,o.checkMissingProp)(e,s,c))),(0,o.reportMissingProp)(e,c),a.else())};for(var s in t)l(s)}}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema,a=e.gen,r=e.data,i=e.keyword,c=e.it,l=a.name("valid"),s=function(s){(0,n.alwaysValidSchema)(c,t[s])||(a.if((0,o.propertyInData)(a,r,s,c.opts.ownProperties),function(){var t=e.subschema({keyword:i,schemaProp:s},l);e.mergeValidEvaluated(t,l)},function(){return a.var(l,!0)}),e.ok(l))};for(var u in t)s(u)}a.validatePropertyDeps=c,a.validateSchemaDeps=l,a.default=i},{"../../compile/codegen":2,"../../compile/util":10,"../code":50}],38:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./dependencies");a.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:function(e){return(0,r.validateSchemaDeps)(e)}}},{"./dependencies":37}],39:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util");function o(e,t){var a=e.schema[t];return void 0!==a&&!(0,n.alwaysValidSchema)(e,a)}a.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:function(e){var t=e.params;return r.str(_templateObject176||(_templateObject176=_taggedTemplateLiteral(['must match "','" schema'])),t.ifClause)},params:function(e){var t=e.params;return r._(_templateObject177||(_templateObject177=_taggedTemplateLiteral(["{failingKeyword: ","}"])),t.ifClause)}},code:function(e){var t=e.gen,a=e.parentSchema,i=e.it;void 0===a.then&&void 0===a.else&&(0,n.checkStrictMode)(i,'"if" without "then" and "else" is ignored');var c=o(i,"then"),l=o(i,"else");if(c||l){var s=t.let("valid",!0),u=t.name("_valid");if(function(){var t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),c&&l){var p=t.let("ifClause");e.setParams({ifClause:p}),t.if(u,m("then",p),m("else",p))}else c?t.if(u,m("then")):t.if((0,r.not)(u),m("else"));e.pass(s,function(){return e.error(!0)})}function m(a,n){return function(){var o=e.subschema({keyword:a},u);t.assign(s,u),e.mergeValidEvaluated(o,s),n?t.assign(n,r._(_templateObject178||(_templateObject178=_taggedTemplateLiteral(["",""])),a)):e.setParams({ifClause:a})}}}}},{"../../compile/codegen":2,"../../compile/util":10}],40:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./additionalItems"),n=e("./prefixItems"),o=e("./items"),i=e("./items2020"),c=e("./contains"),l=e("./dependencies"),s=e("./propertyNames"),u=e("./additionalProperties"),p=e("./properties"),m=e("./patternProperties"),d=e("./not"),f=e("./anyOf"),h=e("./oneOf"),_=e("./allOf"),v=e("./if"),g=e("./thenElse");a.default=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[d.default,f.default,h.default,_.default,v.default,g.default,s.default,u.default,l.default,p.default,m.default];return e?t.push(n.default,i.default):t.push(r.default,o.default),t.push(c.default),t}},{"./additionalItems":32,"./additionalProperties":33,"./allOf":34,"./anyOf":35,"./contains":36,"./dependencies":37,"./if":39,"./items":41,"./items2020":42,"./not":43,"./oneOf":44,"./patternProperties":45,"./prefixItems":46,"./properties":47,"./propertyNames":48,"./thenElse":49}],41:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateTuple=void 0;var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../code"),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code:function(e){var t=e.schema,a=e.it;if(Array.isArray(t))return c(e,"additionalItems",t);a.items=!0,(0,n.alwaysValidSchema)(a,t)||e.ok((0,o.validateArray)(e))}};function c(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.schema,o=e.gen,i=e.parentSchema,c=e.data,l=e.keyword,s=e.it;!function(e){var r=s.opts,o=s.errSchemaPath,i=a.length,c=i===e.minItems&&(i===e.maxItems||!1===e[t]);r.strictTuples&&!c&&(0,n.checkStrictMode)(s,'"'.concat(l,'" is ').concat(i,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(o,'"'),r.strictTuples)}(i),s.opts.unevaluated&&a.length&&!0!==s.items&&(s.items=n.mergeEvaluated.items(o,a.length,s.items));var u=o.name("valid"),p=o.const("len",r._(_templateObject179||(_templateObject179=_taggedTemplateLiteral(["",".length"])),c));a.forEach(function(t,a){(0,n.alwaysValidSchema)(s,t)||(o.if(r._(_templateObject180||(_templateObject180=_taggedTemplateLiteral([""," > ",""])),p,a),function(){return e.subschema({keyword:l,schemaProp:a,dataProp:a},u)}),e.ok(u))})}a.validateTuple=c,a.default=i},{"../../compile/codegen":2,"../../compile/util":10,"../code":50}],42:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../code"),i=e("./additionalItems");a.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:function(e){var t=e.params.len;return r.str(_templateObject181||(_templateObject181=_taggedTemplateLiteral(["must NOT have more than "," items"])),t)},params:function(e){var t=e.params.len;return r._(_templateObject182||(_templateObject182=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.schema,a=e.parentSchema,r=e.it,c=a.prefixItems;r.items=!0,(0,n.alwaysValidSchema)(r,t)||(c?(0,i.validateAdditionalItems)(e,c):e.ok((0,o.validateArray)(e)))}}},{"../../compile/codegen":2,"../../compile/util":10,"../code":50,"./additionalItems":32}],43:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/util");a.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code:function(e){var t=e.gen,a=e.schema,n=e.it;if((0,r.alwaysValidSchema)(n,a))e.fail();else{var o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,function(){return e.reset()},function(){return e.error()})}},error:{message:"must NOT be valid"}}},{"../../compile/util":10}],44:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util");a.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:function(e){var t=e.params;return r._(_templateObject183||(_templateObject183=_taggedTemplateLiteral(["{passingSchemas: ","}"])),t.passing)}},code:function(e){var t=e.gen,a=e.schema,o=e.parentSchema,i=e.it;if(!Array.isArray(a))throw new Error("ajv implementation error");if(!i.opts.discriminator||!o.discriminator){var c=a,l=t.let("valid",!1),s=t.let("passing",null),u=t.name("_valid");e.setParams({passing:s}),t.block(function(){c.forEach(function(a,o){var c;(0,n.alwaysValidSchema)(i,a)?t.var(u,!0):c=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},u),o>0&&t.if(r._(_templateObject184||(_templateObject184=_taggedTemplateLiteral([""," && ",""])),u,l)).assign(l,!1).assign(s,r._(_templateObject185||(_templateObject185=_taggedTemplateLiteral(["[",", ","]"])),s,o)).else(),t.if(u,function(){t.assign(l,!0),t.assign(s,o),c&&e.mergeEvaluated(c,r.Name)})})}),e.result(l,function(){return e.reset()},function(){return e.error(!0)})}}}},{"../../compile/codegen":2,"../../compile/util":10}],45:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../code"),n=e("../../compile/codegen"),o=e("../../compile/util"),i=e("../../compile/util");a.default={keyword:"patternProperties",type:"object",schemaType:"object",code:function(e){var t=e.gen,a=e.schema,c=e.data,l=e.parentSchema,s=e.it,u=s.opts,p=(0,r.allSchemaProperties)(a),m=p.filter(function(e){return(0,o.alwaysValidSchema)(s,a[e])});if(0!==p.length&&(m.length!==p.length||s.opts.unevaluated&&!0!==s.props)){var d=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=t.name("valid");!0===s.props||s.props instanceof n.Name||(s.props=(0,i.evaluatedPropsToName)(t,s.props));var h=s.props;!function(){var e,a=_createForOfIteratorHelper(p);try{for(a.s();!(e=a.n()).done;){var r=e.value;d&&_(r),s.allErrors?v(r):(t.var(f,!0),v(r),t.if(f))}}catch(e){a.e(e)}finally{a.f()}}()}function _(e){for(var t in d)new RegExp(e).test(t)&&(0,o.checkStrictMode)(s,"property ".concat(t," matches pattern ").concat(e," (use allowMatchingProperties)"))}function v(a){t.forIn("key",c,function(o){t.if(n._(_templateObject186||(_templateObject186=_taggedTemplateLiteral(["",".test(",")"])),(0,r.usePattern)(e,a),o),function(){var r=m.includes(a);r||e.subschema({keyword:"patternProperties",schemaProp:a,dataProp:o,dataPropType:i.Type.Str},f),s.opts.unevaluated&&!0!==h?t.assign(n._(_templateObject187||(_templateObject187=_taggedTemplateLiteral(["","[","]"])),h,o),!0):r||s.allErrors||t.if((0,n.not)(f),function(){return t.break()})})})}}}},{"../../compile/codegen":2,"../../compile/util":10,"../code":50}],46:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./items");a.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:function(e){return(0,r.validateTuple)(e,"items")}}},{"./items":41}],47:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/validate"),n=e("../code"),o=e("../../compile/util"),i=e("./additionalProperties");a.default={keyword:"properties",type:"object",schemaType:"object",code:function(e){var t=e.gen,a=e.schema,c=e.parentSchema,l=e.data,s=e.it;"all"===s.opts.removeAdditional&&void 0===c.additionalProperties&&i.default.code(new r.KeywordCxt(s,i.default,"additionalProperties"));var u,p=(0,n.allSchemaProperties)(a),m=_createForOfIteratorHelper(p);try{for(m.s();!(u=m.n()).done;){var d=u.value;s.definedProperties.add(d)}}catch(e){m.e(e)}finally{m.f()}s.opts.unevaluated&&p.length&&!0!==s.props&&(s.props=o.mergeEvaluated.props(t,(0,o.toHash)(p),s.props));var f=p.filter(function(e){return!(0,o.alwaysValidSchema)(s,a[e])});if(0!==f.length){var h,_=t.name("valid"),v=_createForOfIteratorHelper(f);try{for(v.s();!(h=v.n()).done;){var g=h.value;y(g)?b(g):(t.if((0,n.propertyInData)(t,l,g,s.opts.ownProperties)),b(g),s.allErrors||t.else().var(_,!0),t.endIf()),e.it.definedProperties.add(g),e.ok(_)}}catch(e){v.e(e)}finally{v.f()}}function y(e){return s.opts.useDefaults&&!s.compositeRule&&void 0!==a[e].default}function b(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},_)}}}},{"../../compile/util":10,"../../compile/validate":15,"../code":50,"./additionalProperties":33}],48:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util");a.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:function(e){var t=e.params;return r._(_templateObject188||(_templateObject188=_taggedTemplateLiteral(["{propertyName: ","}"])),t.propertyName)}},code:function(e){var t=e.gen,a=e.schema,o=e.data,i=e.it;if(!(0,n.alwaysValidSchema)(i,a)){var c=t.name("valid");t.forIn("key",o,function(a){e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},c),t.if((0,r.not)(c),function(){e.error(!0),i.allErrors||t.break()})}),e.ok(c)}}}},{"../../compile/codegen":2,"../../compile/util":10}],49:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/util");a.default={keyword:["then","else"],schemaType:["object","boolean"],code:function(e){var t=e.keyword,a=e.parentSchema,n=e.it;void 0===a.if&&(0,r.checkStrictMode)(n,'"'.concat(t,'" without "if" is ignored'))}}},{"../../compile/util":10}],50:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateUnion=a.validateArray=a.usePattern=a.callValidateCode=a.schemaProperties=a.allSchemaProperties=a.noPropertyInData=a.propertyInData=a.isOwnProperty=a.hasPropFunc=a.reportMissingProp=a.checkMissingProp=a.checkReportMissingProp=void 0;var r=e("../compile/codegen"),n=e("../compile/util"),o=e("../compile/names"),i=e("../compile/util");function c(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._(_templateObject189||(_templateObject189=_taggedTemplateLiteral(["Object.prototype.hasOwnProperty"])))})}function l(e,t,a){return r._(_templateObject190||(_templateObject190=_taggedTemplateLiteral(["",".call(",", ",")"])),c(e),t,a)}function s(e,t,a,n){var o=r._(_templateObject191||(_templateObject191=_taggedTemplateLiteral(["",""," === undefined"])),t,(0,r.getProperty)(a));return n?(0,r.or)(o,(0,r.not)(l(e,t,a))):o}function u(e){return e?Object.keys(e).filter(function(e){return"__proto__"!==e}):[]}a.checkReportMissingProp=function(e,t){var a=e.gen,n=e.data,o=e.it;a.if(s(a,n,t,o.opts.ownProperties),function(){e.setParams({missingProperty:r._(_templateObject192||(_templateObject192=_taggedTemplateLiteral(["",""])),t)},!0),e.error()})},a.checkMissingProp=function(e,t,a){var n=e.gen,o=e.data,i=e.it.opts;return r.or.apply(void 0,_toConsumableArray(t.map(function(e){return(0,r.and)(s(n,o,e,i.ownProperties),r._(_templateObject193||(_templateObject193=_taggedTemplateLiteral([""," = ",""])),a,e))})))},a.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},a.hasPropFunc=c,a.isOwnProperty=l,a.propertyInData=function(e,t,a,n){var o=r._(_templateObject194||(_templateObject194=_taggedTemplateLiteral(["",""," !== undefined"])),t,(0,r.getProperty)(a));return n?r._(_templateObject195||(_templateObject195=_taggedTemplateLiteral([""," && ",""])),o,l(e,t,a)):o},a.noPropertyInData=s,a.allSchemaProperties=u,a.schemaProperties=function(e,t){return u(t).filter(function(a){return!(0,n.alwaysValidSchema)(e,t[a])})},a.callValidateCode=function(e,t,a,n){var i=e.schemaCode,c=e.data,l=e.it,s=l.gen,u=l.topSchemaRef,p=l.schemaPath,m=l.errorPath,d=e.it,f=n?r._(_templateObject196||(_templateObject196=_taggedTemplateLiteral(["",", ",", ","",""])),i,c,u,p):c,h=[[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,m)],[o.default.parentData,d.parentData],[o.default.parentDataProperty,d.parentDataProperty],[o.default.rootData,o.default.rootData]];d.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);var _=r._(_templateObject197||(_templateObject197=_taggedTemplateLiteral(["",", ",""])),f,s.object.apply(s,h));return a!==r.nil?r._(_templateObject198||(_templateObject198=_taggedTemplateLiteral(["",".call(",", ",")"])),t,a,_):r._(_templateObject199||(_templateObject199=_taggedTemplateLiteral(["","(",")"])),t,_)};var p=r._(_templateObject200||(_templateObject200=_taggedTemplateLiteral(["new RegExp"])));a.usePattern=function(e,t){var a=e.gen,n=e.it.opts,o=n.unicodeRegExp?"u":"",c=n.code.regExp,l=c(t,o);return a.scopeValue("pattern",{key:l.toString(),ref:l,code:r._(_templateObject201||(_templateObject201=_taggedTemplateLiteral(["","(",", ",")"])),"new RegExp"===c.code?p:(0,i.useFunc)(a,c),t,o)})},a.validateArray=function(e){var t=e.gen,a=e.data,o=e.keyword,i=e.it,c=t.name("valid");if(i.allErrors){var l=t.let("valid",!0);return s(function(){return t.assign(l,!1)}),l}return t.var(c,!0),s(function(){return t.break()}),c;function s(i){var l=t.const("len",r._(_templateObject202||(_templateObject202=_taggedTemplateLiteral(["",".length"])),a));t.forRange("i",0,l,function(a){e.subschema({keyword:o,dataProp:a,dataPropType:n.Type.Num},c),t.if((0,r.not)(c),i)})}},a.validateUnion=function(e){var t=e.gen,a=e.schema,o=e.keyword,i=e.it;if(!Array.isArray(a))throw new Error("ajv implementation error");if(!a.some(function(e){return(0,n.alwaysValidSchema)(i,e)})||i.opts.unevaluated){var c=t.let("valid",!1),l=t.name("_valid");t.block(function(){return a.forEach(function(a,n){var i=e.subschema({keyword:o,schemaProp:n,compositeRule:!0},l);t.assign(c,r._(_templateObject203||(_templateObject203=_taggedTemplateLiteral([""," || ",""])),c,l)),e.mergeValidEvaluated(i,l)||t.if((0,r.not)(c))})}),e.result(c,function(){return e.reset()},function(){return e.error(!0)})}}},{"../compile/codegen":2,"../compile/names":6,"../compile/util":10}],51:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default={keyword:"id",code:function(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},{}],52:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./id"),n=e("./ref");a.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,n.default]},{"./id":51,"./ref":53}],53:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.callRef=a.getValidate=void 0;var r=e("../../compile/ref_error"),n=e("../code"),o=e("../../compile/codegen"),i=e("../../compile/names"),c=e("../../compile"),l=e("../../compile/util"),s={keyword:"$ref",schemaType:"string",code:function(e){var t=e.gen,a=e.schema,n=e.it,i=n.baseId,l=n.schemaEnv,s=n.validateName,m=n.opts,d=n.self,f=l.root;if(("#"===a||"#/"===a)&&i===f.baseId)return function(){if(l===f)return p(e,s,l,l.$async);var a=t.scopeValue("root",{ref:f});return p(e,o._(_templateObject204||(_templateObject204=_taggedTemplateLiteral(["",".validate"])),a),f,f.$async)}();var h=c.resolveRef.call(d,f,i,a);if(void 0===h)throw new r.default(i,a);return h instanceof c.SchemaEnv?function(t){var a=u(e,t);p(e,a,t,t.$async)}(h):function(r){var n=t.scopeValue("schema",!0===m.code.source?{ref:r,code:(0,o.stringify)(r)}:{ref:r}),i=t.name("valid"),c=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:n,errSchemaPath:a},i);e.mergeEvaluated(c),e.ok(i)}(h)}};function u(e,t){var a=e.gen;return t.validate?a.scopeValue("validate",{ref:t.validate}):o._(_templateObject205||(_templateObject205=_taggedTemplateLiteral(["",".validate"])),a.scopeValue("wrapper",{ref:t}))}function p(e,t,a,r){var c=e.gen,s=e.it,u=s.allErrors,p=s.schemaEnv,m=s.opts.passContext?i.default.this:o.nil;function d(e){var t=o._(_templateObject206||(_templateObject206=_taggedTemplateLiteral(["",".errors"])),e);c.assign(i.default.vErrors,o._(_templateObject207||(_templateObject207=_taggedTemplateLiteral([""," === null ? "," : ",".concat(",")"])),i.default.vErrors,t,i.default.vErrors,t)),c.assign(i.default.errors,o._(_templateObject208||(_templateObject208=_taggedTemplateLiteral(["",".length"])),i.default.vErrors))}function f(e){var t;if(s.opts.unevaluated){var r=null===(t=null==a?void 0:a.validate)||void 0===t?void 0:t.evaluated;if(!0!==s.props)if(r&&!r.dynamicProps)void 0!==r.props&&(s.props=l.mergeEvaluated.props(c,r.props,s.props));else{var n=c.var("props",o._(_templateObject209||(_templateObject209=_taggedTemplateLiteral(["",".evaluated.props"])),e));s.props=l.mergeEvaluated.props(c,n,s.props,o.Name)}if(!0!==s.items)if(r&&!r.dynamicItems)void 0!==r.items&&(s.items=l.mergeEvaluated.items(c,r.items,s.items));else{var i=c.var("items",o._(_templateObject210||(_templateObject210=_taggedTemplateLiteral(["",".evaluated.items"])),e));s.items=l.mergeEvaluated.items(c,i,s.items,o.Name)}}}r?function(){if(!p.$async)throw new Error("async schema referenced by sync schema");var a=c.let("valid");c.try(function(){c.code(o._(_templateObject211||(_templateObject211=_taggedTemplateLiteral(["await ",""])),(0,n.callValidateCode)(e,t,m))),f(t),u||c.assign(a,!0)},function(e){c.if(o._(_templateObject212||(_templateObject212=_taggedTemplateLiteral(["!("," instanceof ",")"])),e,s.ValidationError),function(){return c.throw(e)}),d(e),u||c.assign(a,!1)}),e.ok(a)}():e.result((0,n.callValidateCode)(e,t,m),function(){return f(t)},function(){return d(t)})}a.getValidate=u,a.callRef=p,a.default=s},{"../../compile":5,"../../compile/codegen":2,"../../compile/names":6,"../../compile/ref_error":7,"../../compile/util":10,"../code":50}],54:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../discriminator/types");a.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:function(e){var t=e.params,a=t.discrError,r=t.tagName;return a===n.DiscrError.Tag?'tag "'.concat(r,'" must be string'):'value of tag "'.concat(r,'" must be in oneOf')},params:function(e){var t=e.params,a=t.discrError,n=t.tag,o=t.tagName;return r._(_templateObject213||(_templateObject213=_taggedTemplateLiteral(["{error: ",", tag: ",", tagValue: ","}"])),a,o,n)}},code:function(e){var t=e.gen,a=e.data,o=e.schema,i=e.parentSchema,c=e.it,l=i.oneOf;if(!c.opts.discriminator)throw new Error("discriminator: requires discriminator option");var s=o.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");var u=t.let("valid",!1),p=t.const("tag",r._(_templateObject214||(_templateObject214=_taggedTemplateLiteral(["","",""])),a,(0,r.getProperty)(s)));function m(a){var n=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:a},n);return e.mergeEvaluated(o,r.Name),n}t.if(r._(_templateObject215||(_templateObject215=_taggedTemplateLiteral(["typeof ",' == "string"'])),p),function(){return function(){var a=function(){for(var e,t={},a=u(i),r=!0,n=0;n<l.length;n++){var o=l[n],c=null===(e=o.properties)||void 0===e?void 0:e[s];if("object"!=_typeof(c))throw new Error('discriminator: oneOf schemas must have "properties/'.concat(s,'"'));r=r&&(a||u(o)),p(c,n)}if(!r)throw new Error('discriminator: "'.concat(s,'" must be required'));return t;function u(e){var t=e.required;return Array.isArray(t)&&t.includes(s)}function p(e,t){if(e.const)m(e.const,t);else{if(!e.enum)throw new Error('discriminator: "properties/'.concat(s,'" must have "const" or "enum"'));var a,r=_createForOfIteratorHelper(e.enum);try{for(r.s();!(a=r.n()).done;){m(a.value,t)}}catch(e){r.e(e)}finally{r.f()}}}function m(e,a){if("string"!=typeof e||e in t)throw new Error('discriminator: "'.concat(s,'" values must be unique strings'));t[e]=a}}();for(var o in t.if(!1),a)t.elseIf(r._(_templateObject216||(_templateObject216=_taggedTemplateLiteral([""," === ",""])),p,o)),t.assign(u,m(a[o]));t.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:p,tagName:s}),t.endIf()}()},function(){return e.error(!1,{discrError:n.DiscrError.Tag,tag:p,tagName:s})}),e.ok(u)}}},{"../../compile/codegen":2,"../discriminator/types":55}],55:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(a.DiscrError||(a.DiscrError={}))},{}],56:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./core"),n=e("./validation"),o=e("./applicator"),i=e("./dynamic"),c=e("./next"),l=e("./unevaluated"),s=e("./format"),u=e("./metadata"),p=[i.default,r.default,n.default,(0,o.default)(!0),s.default,u.metadataVocabulary,u.contentVocabulary,c.default,l.default];a.default=p},{"./applicator":40,"./core":52,"./dynamic":59,"./format":63,"./metadata":64,"./next":65,"./unevaluated":66,"./validation":72}],57:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.dynamicAnchor=void 0;var r=e("../../compile/codegen"),n=e("../../compile/names"),o=e("../../compile"),i=e("../core/ref"),c={keyword:"$dynamicAnchor",schemaType:"string",code:function(e){return l(e,e.schema)}};function l(e,t){var a=e.gen,c=e.it;c.schemaEnv.root.dynamicAnchors[t]=!0;var l=r._(_templateObject217||(_templateObject217=_taggedTemplateLiteral(["","",""])),n.default.dynamicAnchors,(0,r.getProperty)(t)),s="#"===c.errSchemaPath?c.validateName:function(e){var t=e.it,a=t.schemaEnv,r=t.schema,n=t.self,c=a.root,l=c.root,s=c.baseId,u=c.localRefs,p=c.meta,m=n.opts.schemaId,d=new o.SchemaEnv({schema:r,schemaId:m,root:l,baseId:s,localRefs:u,meta:p});return o.compileSchema.call(n,d),(0,i.getValidate)(e,d)}(e);a.if(r._(_templateObject218||(_templateObject218=_taggedTemplateLiteral(["!",""])),l),function(){return a.assign(l,s)})}a.dynamicAnchor=l,a.default=c},{"../../compile":5,"../../compile/codegen":2,"../../compile/names":6,"../core/ref":53}],58:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.dynamicRef=void 0;var r=e("../../compile/codegen"),n=e("../../compile/names"),o=e("../core/ref"),i={keyword:"$dynamicRef",schemaType:"string",code:function(e){return c(e,e.schema)}};function c(e,t){var a=e.gen,i=e.keyword,c=e.it;if("#"!==t[0])throw new Error('"'.concat(i,'" only supports hash fragment reference'));var l=t.slice(1);if(c.allErrors)u();else{var s=a.let("valid",!1);u(s),e.ok(s)}function u(e){if(c.schemaEnv.root.dynamicAnchors[l]){var t=a.let("_v",r._(_templateObject219||(_templateObject219=_taggedTemplateLiteral(["","",""])),n.default.dynamicAnchors,(0,r.getProperty)(l)));a.if(t,p(t,e),p(c.validateName,e))}else p(c.validateName,e)()}function p(t,r){return r?function(){return a.block(function(){(0,o.callRef)(e,t),a.let(r,!0)})}:function(){return(0,o.callRef)(e,t)}}}a.dynamicRef=c,a.default=i},{"../../compile/codegen":2,"../../compile/names":6,"../core/ref":53}],59:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./dynamicAnchor"),n=e("./dynamicRef"),o=e("./recursiveAnchor"),i=e("./recursiveRef");a.default=[r.default,n.default,o.default,i.default]},{"./dynamicAnchor":57,"./dynamicRef":58,"./recursiveAnchor":60,"./recursiveRef":61}],60:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./dynamicAnchor"),n=e("../../compile/util");a.default={keyword:"$recursiveAnchor",schemaType:"boolean",code:function(e){e.schema?(0,r.dynamicAnchor)(e,""):(0,n.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}},{"../../compile/util":10,"./dynamicAnchor":57}],61:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./dynamicRef");a.default={keyword:"$recursiveRef",schemaType:"string",code:function(e){return(0,r.dynamicRef)(e,e.schema)}}},{"./dynamicRef":58}],62:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen");a.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:function(e){var t=e.schemaCode;return r.str(_templateObject220||(_templateObject220=_taggedTemplateLiteral(['must match format "','"'])),t)},params:function(e){var t=e.schemaCode;return r._(_templateObject221||(_templateObject221=_taggedTemplateLiteral(["{format: ","}"])),t)}},code:function(e,t){var a=e.gen,n=e.data,o=e.$data,i=e.schema,c=e.schemaCode,l=e.it,s=l.opts,u=l.errSchemaPath,p=l.schemaEnv,m=l.self;s.validateFormats&&(o?function(){var o=a.scopeValue("formats",{ref:m.formats,code:s.code.formats}),i=a.const("fDef",r._(_templateObject222||(_templateObject222=_taggedTemplateLiteral(["","[","]"])),o,c)),l=a.let("fType"),u=a.let("format");a.if(r._(_templateObject223||(_templateObject223=_taggedTemplateLiteral(["typeof ",' == "object" && !('," instanceof RegExp)"])),i,i),function(){return a.assign(l,r._(_templateObject224||(_templateObject224=_taggedTemplateLiteral(["",'.type || "string"'])),i)).assign(u,r._(_templateObject225||(_templateObject225=_taggedTemplateLiteral(["",".validate"])),i))},function(){return a.assign(l,r._(_templateObject226||(_templateObject226=_taggedTemplateLiteral(['"string"'])))).assign(u,i)}),e.fail$data((0,r.or)(!1===s.strictSchema?r.nil:r._(_templateObject227||(_templateObject227=_taggedTemplateLiteral([""," && !",""])),c,u),function(){var e=p.$async?r._(_templateObject228||(_templateObject228=_taggedTemplateLiteral(["(",".async ? await ","(",") : ","(","))"])),i,u,n,u,n):r._(_templateObject229||(_templateObject229=_taggedTemplateLiteral(["","(",")"])),u,n),a=r._(_templateObject230||(_templateObject230=_taggedTemplateLiteral(["(typeof ",' == "function" ? '," : ",".test(","))"])),u,e,u,n);return r._(_templateObject231||(_templateObject231=_taggedTemplateLiteral([""," && "," !== true && "," === "," && !",""])),u,u,l,t,a)}()))}():function(){var o=m.formats[i];if(o){if(!0!==o){var c=_slicedToArray(function(e){var t=e instanceof RegExp?(0,r.regexpCode)(e):s.code.formats?r._(_templateObject232||(_templateObject232=_taggedTemplateLiteral(["","",""])),s.code.formats,(0,r.getProperty)(i)):void 0,n=a.scopeValue("formats",{key:i,ref:e,code:t});return"object"!=_typeof(e)||e instanceof RegExp?["string",e,n]:[e.type||"string",e.validate,r._(_templateObject233||(_templateObject233=_taggedTemplateLiteral(["",".validate"])),n)]}(o),3),l=c[0],d=c[1],f=c[2];l===t&&e.pass(function(){if("object"==_typeof(o)&&!(o instanceof RegExp)&&o.async){if(!p.$async)throw new Error("async format in sync schema");return r._(_templateObject234||(_templateObject234=_taggedTemplateLiteral(["await ","(",")"])),f,n)}return"function"==typeof d?r._(_templateObject235||(_templateObject235=_taggedTemplateLiteral(["","(",")"])),f,n):r._(_templateObject236||(_templateObject236=_taggedTemplateLiteral(["",".test(",")"])),f,n)}())}}else!function(){if(!1!==s.strictSchema)throw new Error(e());function e(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(u,'"')}m.logger.warn(e())}()}())}}},{"../../compile/codegen":2}],63:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./format");a.default=[r.default]},{"./format":62}],64:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contentVocabulary=a.metadataVocabulary=void 0,a.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],a.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},{}],65:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./validation/dependentRequired"),n=e("./applicator/dependentSchemas"),o=e("./validation/limitContains");a.default=[r.default,n.default,o.default]},{"./applicator/dependentSchemas":38,"./validation/dependentRequired":70,"./validation/limitContains":73}],66:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./unevaluatedProperties"),n=e("./unevaluatedItems");a.default=[r.default,n.default]},{"./unevaluatedItems":67,"./unevaluatedProperties":68}],67:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util");a.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:function(e){var t=e.params.len;return r.str(_templateObject237||(_templateObject237=_taggedTemplateLiteral(["must NOT have more than "," items"])),t)},params:function(e){var t=e.params.len;return r._(_templateObject238||(_templateObject238=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.gen,a=e.schema,o=e.data,i=e.it,c=i.items||0;if(!0!==c){var l=t.const("len",r._(_templateObject239||(_templateObject239=_taggedTemplateLiteral(["",".length"])),o));if(!1===a)e.setParams({len:c}),e.fail(r._(_templateObject240||(_templateObject240=_taggedTemplateLiteral([""," > ",""])),l,c));else if("object"==_typeof(a)&&!(0,n.alwaysValidSchema)(i,a)){var s=t.var("valid",r._(_templateObject241||(_templateObject241=_taggedTemplateLiteral([""," <= ",""])),l,c));t.if((0,r.not)(s),function(){return a=s,o=c,void t.forRange("i",o,l,function(o){e.subschema({keyword:"unevaluatedItems",dataProp:o,dataPropType:n.Type.Num},a),i.allErrors||t.if((0,r.not)(a),function(){return t.break()})});var a,o}),e.ok(s)}i.items=!0}}}},{"../../compile/codegen":2,"../../compile/util":10}],68:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../../compile/names");a.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:function(e){var t=e.params;return r._(_templateObject242||(_templateObject242=_taggedTemplateLiteral(["{unevaluatedProperty: ","}"])),t.unevaluatedProperty)}},code:function(e){var t=e.gen,a=e.schema,i=e.data,c=e.errsCount,l=e.it;if(!c)throw new Error("ajv implementation error");var s=l.allErrors,u=l.props;function p(o){if(!1===a)return e.setParams({unevaluatedProperty:o}),e.error(),void(s||t.break());if(!(0,n.alwaysValidSchema)(l,a)){var i=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:n.Type.Str},i),s||t.if((0,r.not)(i),function(){return t.break()})}}u instanceof r.Name?t.if(r._(_templateObject243||(_templateObject243=_taggedTemplateLiteral([""," !== true"])),u),function(){return t.forIn("key",i,function(e){return t.if(function(e,t){return r._(_templateObject244||(_templateObject244=_taggedTemplateLiteral(["!"," || !","[","]"])),e,e,t)}(u,e),function(){return p(e)})})}):!0!==u&&t.forIn("key",i,function(e){return void 0===u?p(e):t.if(function(e,t){var a=[];for(var n in e)!0===e[n]&&a.push(r._(_templateObject245||(_templateObject245=_taggedTemplateLiteral([""," !== ",""])),t,n));return r.and.apply(void 0,a)}(u,e),function(){return p(e)})}),l.props=!0,e.ok(r._(_templateObject246||(_templateObject246=_taggedTemplateLiteral([""," === ",""])),c,o.default.errors))}}},{"../../compile/codegen":2,"../../compile/names":6,"../../compile/util":10}],69:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../../runtime/equal");a.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:function(e){var t=e.schemaCode;return r._(_templateObject247||(_templateObject247=_taggedTemplateLiteral(["{allowedValue: ","}"])),t)}},code:function(e){var t=e.gen,a=e.data,i=e.$data,c=e.schemaCode,l=e.schema;i||l&&"object"==_typeof(l)?e.fail$data(r._(_templateObject248||(_templateObject248=_taggedTemplateLiteral(["!","(",", ",")"])),(0,n.useFunc)(t,o.default),a,c)):e.fail(r._(_templateObject249||(_templateObject249=_taggedTemplateLiteral([""," !== ",""])),l,a))}}},{"../../compile/codegen":2,"../../compile/util":10,"../../runtime/equal":29}],70:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../applicator/dependencies");a.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:function(e){return(0,r.validatePropertyDeps)(e)}}},{"../applicator/dependencies":37}],71:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../../runtime/equal");a.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:function(e){var t=e.schemaCode;return r._(_templateObject250||(_templateObject250=_taggedTemplateLiteral(["{allowedValues: ","}"])),t)}},code:function(e){var t=e.gen,a=e.data,i=e.$data,c=e.schema,l=e.schemaCode,s=e.it;if(!i&&0===c.length)throw new Error("enum must have non-empty array");var u,p=c.length>=s.opts.loopEnum,m=(0,n.useFunc)(t,o.default);if(p||i)u=t.let("valid"),e.block$data(u,function(){t.assign(u,!1),t.forOf("v",l,function(e){return t.if(r._(_templateObject251||(_templateObject251=_taggedTemplateLiteral(["","(",", ",")"])),m,a,e),function(){return t.assign(u,!0).break()})})});else{if(!Array.isArray(c))throw new Error("ajv implementation error");var d=t.const("vSchema",l);u=r.or.apply(void 0,_toConsumableArray(c.map(function(e,t){return function(e,t){var n=c[t];return"object"==_typeof(n)&&null!==n?r._(_templateObject252||(_templateObject252=_taggedTemplateLiteral(["","(",", ","[","])"])),m,a,e,t):r._(_templateObject253||(_templateObject253=_taggedTemplateLiteral([""," === ",""])),a,n)}(d,t)})))}e.pass(u)}}},{"../../compile/codegen":2,"../../compile/util":10,"../../runtime/equal":29}],72:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("./limitNumber"),n=e("./multipleOf"),o=e("./limitLength"),i=e("./pattern"),c=e("./limitProperties"),l=e("./required"),s=e("./limitItems"),u=e("./uniqueItems"),p=e("./const"),m=e("./enum");a.default=[r.default,n.default,o.default,i.default,c.default,l.default,s.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},p.default,m.default]},{"./const":69,"./enum":71,"./limitItems":74,"./limitLength":75,"./limitNumber":76,"./limitProperties":77,"./multipleOf":78,"./pattern":79,"./required":80,"./uniqueItems":81}],73:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/util");a.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code:function(e){var t=e.keyword,a=e.parentSchema,n=e.it;void 0===a.contains&&(0,r.checkStrictMode)(n,'"'.concat(t,'" without "contains" is ignored'))}}},{"../../compile/util":10}],74:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen");a.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:function(e){var t=e.keyword,a=e.schemaCode;return r.str(_templateObject254||(_templateObject254=_taggedTemplateLiteral(["must NOT have "," than "," items"])),"maxItems"===t?"more":"fewer",a)},params:function(e){var t=e.schemaCode;return r._(_templateObject255||(_templateObject255=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.keyword,a=e.data,n=e.schemaCode;e.fail$data(r._(_templateObject256||(_templateObject256=_taggedTemplateLiteral(["",".length "," ",""])),a,"maxItems"===t?r.operators.GT:r.operators.LT,n))}}},{"../../compile/codegen":2}],75:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=e("../../compile/util"),o=e("../../runtime/ucs2length");a.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:function(e){var t=e.keyword,a=e.schemaCode;return r.str(_templateObject257||(_templateObject257=_taggedTemplateLiteral(["must NOT have "," than "," characters"])),"maxLength"===t?"more":"fewer",a)},params:function(e){var t=e.schemaCode;return r._(_templateObject258||(_templateObject258=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.keyword,a=e.data,i=e.schemaCode,c=e.it,l="maxLength"===t?r.operators.GT:r.operators.LT,s=!1===c.opts.unicode?r._(_templateObject259||(_templateObject259=_taggedTemplateLiteral(["",".length"])),a):r._(_templateObject260||(_templateObject260=_taggedTemplateLiteral(["","(",")"])),(0,n.useFunc)(e.gen,o.default),a);e.fail$data(r._(_templateObject261||(_templateObject261=_taggedTemplateLiteral([""," "," ",""])),s,l,i))}}},{"../../compile/codegen":2,"../../compile/util":10,"../../runtime/ucs2length":30}],76:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen"),n=r.operators,o={maximum:{okStr:"<=",ok:n.LTE,fail:n.GT},minimum:{okStr:">=",ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:function(e){var t=e.keyword,a=e.schemaCode;return r.str(_templateObject262||(_templateObject262=_taggedTemplateLiteral(["must be "," ",""])),o[t].okStr,a)},params:function(e){var t=e.keyword,a=e.schemaCode;return r._(_templateObject263||(_templateObject263=_taggedTemplateLiteral(["{comparison: ",", limit: ","}"])),o[t].okStr,a)}},c={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:i,code:function(e){var t=e.keyword,a=e.data,n=e.schemaCode;e.fail$data(r._(_templateObject264||(_templateObject264=_taggedTemplateLiteral([""," "," "," || isNaN(",")"])),a,o[t].fail,n,a))}};a.default=c},{"../../compile/codegen":2}],77:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen");a.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:function(e){var t=e.keyword,a=e.schemaCode;return r.str(_templateObject265||(_templateObject265=_taggedTemplateLiteral(["must NOT have "," than "," items"])),"maxProperties"===t?"more":"fewer",a)},params:function(e){var t=e.schemaCode;return r._(_templateObject266||(_templateObject266=_taggedTemplateLiteral(["{limit: ","}"])),t)}},code:function(e){var t=e.keyword,a=e.data,n=e.schemaCode;e.fail$data(r._(_templateObject267||(_templateObject267=_taggedTemplateLiteral(["Object.keys(",").length "," ",""])),a,"maxProperties"===t?r.operators.GT:r.operators.LT,n))}}},{"../../compile/codegen":2}],78:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/codegen");a.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:function(e){var t=e.schemaCode;return r.str(_templateObject268||(_templateObject268=_taggedTemplateLiteral(["must be multiple of ",""])),t)},params:function(e){var t=e.schemaCode;return r._(_templateObject269||(_templateObject269=_taggedTemplateLiteral(["{multipleOf: ","}"])),t)}},code:function(e){var t=e.gen,a=e.data,n=e.schemaCode,o=e.it.opts.multipleOfPrecision,i=t.let("res"),c=o?r._(_templateObject270||(_templateObject270=_taggedTemplateLiteral(["Math.abs(Math.round(",") - ",") > 1e-",""])),i,i,o):r._(_templateObject271||(_templateObject271=_taggedTemplateLiteral([""," !== parseInt(",")"])),i,i);e.fail$data(r._(_templateObject272||(_templateObject272=_taggedTemplateLiteral(["("," === 0 || ("," = ","/",", ","))"])),n,i,a,n,c))}}},{"../../compile/codegen":2}],79:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../code"),n=e("../../compile/codegen");a.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:function(e){var t=e.schemaCode;return n.str(_templateObject273||(_templateObject273=_taggedTemplateLiteral(['must match pattern "','"'])),t)},params:function(e){var t=e.schemaCode;return n._(_templateObject274||(_templateObject274=_taggedTemplateLiteral(["{pattern: ","}"])),t)}},code:function(e){var t=e.data,a=e.$data,o=e.schema,i=e.schemaCode,c=e.it,l=a?n._(_templateObject275||(_templateObject275=_taggedTemplateLiteral(["(new RegExp(",", ","))"])),i,c.opts.unicodeRegExp?"u":""):(0,r.usePattern)(e,o);e.fail$data(n._(_templateObject276||(_templateObject276=_taggedTemplateLiteral(["!",".test(",")"])),l,t))}}},{"../../compile/codegen":2,"../code":50}],80:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../code"),n=e("../../compile/codegen"),o=e("../../compile/util");a.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:function(e){var t=e.params.missingProperty;return n.str(_templateObject277||(_templateObject277=_taggedTemplateLiteral(["must have required property '","'"])),t)},params:function(e){var t=e.params.missingProperty;return n._(_templateObject278||(_templateObject278=_taggedTemplateLiteral(["{missingProperty: ","}"])),t)}},code:function(e){var t=e.gen,a=e.schema,i=e.schemaCode,c=e.data,l=e.$data,s=e.it,u=s.opts;if(l||0!==a.length){var p=a.length>=u.loopRequired;if(s.allErrors?function(){if(p||l)e.block$data(n.nil,v);else{var t,o=_createForOfIteratorHelper(a);try{for(o.s();!(t=o.n()).done;){var i=t.value;(0,r.checkReportMissingProp)(e,i)}}catch(e){o.e(e)}finally{o.f()}}}():function(){var o=t.let("missing");if(p||l){var s=t.let("valid",!0);e.block$data(s,function(){return function(a,o){e.setParams({missingProperty:a}),t.forOf(a,i,function(){t.assign(o,(0,r.propertyInData)(t,c,a,u.ownProperties)),t.if((0,n.not)(o),function(){e.error(),t.break()})},n.nil)}(o,s)}),e.ok(s)}else t.if((0,r.checkMissingProp)(e,a,o)),(0,r.reportMissingProp)(e,o),t.else()}(),u.strictRequired){var m,d=e.parentSchema.properties,f=e.it.definedProperties,h=_createForOfIteratorHelper(a);try{for(h.s();!(m=h.n()).done;){var _=m.value;void 0!==(null==d?void 0:d[_])||f.has(_)||(0,o.checkStrictMode)(s,'required property "'.concat(_,'" is not defined at "').concat(s.schemaEnv.baseId+s.errSchemaPath,'" (strictRequired)'),s.opts.strictRequired)}}catch(e){h.e(e)}finally{h.f()}}}function v(){t.forOf("prop",i,function(a){e.setParams({missingProperty:a}),t.if((0,r.noPropertyInData)(t,c,a,u.ownProperties),function(){return e.error()})})}}}},{"../../compile/codegen":2,"../../compile/util":10,"../code":50}],81:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r=e("../../compile/validate/dataType"),n=e("../../compile/codegen"),o=e("../../compile/util"),i=e("../../runtime/equal");a.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:function(e){var t=e.params,a=t.i,r=t.j;return n.str(_templateObject279||(_templateObject279=_taggedTemplateLiteral(["must NOT have duplicate items (items ## "," and "," are identical)"])),r,a)},params:function(e){var t=e.params,a=t.i,r=t.j;return n._(_templateObject280||(_templateObject280=_taggedTemplateLiteral(["{i: ",", j: ","}"])),a,r)}},code:function(e){var t=e.gen,a=e.data,c=e.$data,l=e.schema,s=e.parentSchema,u=e.schemaCode,p=e.it;if(c||l){var m=t.let("valid"),d=s.items?(0,r.getSchemaTypes)(s.items):[];e.block$data(m,function(){var r=t.let("i",n._(_templateObject293||(_templateObject293=_taggedTemplateLiteral(["",".length"])),a)),o=t.let("j");e.setParams({i:r,j:o}),t.assign(m,!0),t.if(n._(_templateObject294||(_templateObject294=_taggedTemplateLiteral([""," > 1"])),r),function(){return(d.length>0&&!d.some(function(e){return"object"===e||"array"===e})?f:h)(r,o)})},n._(_templateObject295||(_templateObject295=_taggedTemplateLiteral([""," === false"])),u)),e.ok(m)}function f(o,i){var c=t.name("item"),l=(0,r.checkDataTypes)(d,c,p.opts.strictNumbers,r.DataType.Wrong),s=t.const("indices",n._(_templateObject281||(_templateObject281=_taggedTemplateLiteral(["{}"]))));t.for(n._(_templateObject282||(_templateObject282=_taggedTemplateLiteral([";","--;"])),o),function(){t.let(c,n._(_templateObject283||(_templateObject283=_taggedTemplateLiteral(["","[","]"])),a,o)),t.if(l,n._(_templateObject284||(_templateObject284=_taggedTemplateLiteral(["continue"])))),d.length>1&&t.if(n._(_templateObject285||(_templateObject285=_taggedTemplateLiteral(["typeof ",' == "string"'])),c),n._(_templateObject286||(_templateObject286=_taggedTemplateLiteral(["",' += "_"'])),c)),t.if(n._(_templateObject287||(_templateObject287=_taggedTemplateLiteral(["typeof ","[",'] == "number"'])),s,c),function(){t.assign(i,n._(_templateObject288||(_templateObject288=_taggedTemplateLiteral(["","[","]"])),s,c)),e.error(),t.assign(m,!1).break()}).code(n._(_templateObject289||(_templateObject289=_taggedTemplateLiteral(["","[","] = ",""])),s,c,o))})}function h(r,c){var l=(0,o.useFunc)(t,i.default),s=t.name("outer");t.label(s).for(n._(_templateObject290||(_templateObject290=_taggedTemplateLiteral([";","--;"])),r),function(){return t.for(n._(_templateObject291||(_templateObject291=_taggedTemplateLiteral([""," = ","; ","--;"])),c,r,c),function(){return t.if(n._(_templateObject292||(_templateObject292=_taggedTemplateLiteral(["","(","[","], ","[","])"])),l,a,r,a,c),function(){e.error(),t.assign(m,!1).break(s)})})})}}}},{"../../compile/codegen":2,"../../compile/util":10,"../../compile/validate/dataType":13,"../../runtime/equal":29}],82:[function(e,t,a){"use strict";t.exports=function e(t,a){if(t===a)return!0;if(t&&a&&"object"==_typeof(t)&&"object"==_typeof(a)){if(t.constructor!==a.constructor)return!1;var r,n,o;if(Array.isArray(t)){if((r=t.length)!=a.length)return!1;for(n=r;0!=n--;)if(!e(t[n],a[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(a,o[n]))return!1;for(n=r;0!=n--;){var i=o[n];if(!e(t[i],a[i]))return!1}return!0}return t!=t&&a!=a}},{}],83:[function(e,t,a){"use strict";var r=t.exports=function(e,t,a){"function"==typeof t&&(a=t,t={}),function e(t,a,n,o,i,c,l,s,u,p){if(o&&"object"==_typeof(o)&&!Array.isArray(o)){for(var m in a(o,i,c,l,s,u,p),o){var d=o[m];if(Array.isArray(d)){if(m in r.arrayKeywords)for(var f=0;f<d.length;f++)e(t,a,n,d[f],i+"/"+m+"/"+f,c,i,m,o,f)}else if(m in r.propsKeywords){if(d&&"object"==_typeof(d))for(var h in d)e(t,a,n,d[h],i+"/"+m+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),c,i,m,o,h)}else(m in r.keywords||t.allKeys&&!(m in r.skipKeywords))&&e(t,a,n,d,i+"/"+m,c,i,m,o)}n(o,i,c,l,s,u,p)}}(t,"function"==typeof(a=t.cb||a)?a:a.pre||function(){},a.post||function(){},e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},{}],84:[function(e,t,a){!function(e,r){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];if(t.length>1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,n=1;n<r;++n)t[n]=t[n].slice(1,-1);return t[r]=t[r].slice(1),t.join("")}return t[0]}function a(e){return"(?:"+e+")"}function r(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function n(e){return e.toUpperCase()}function o(e){var r="[A-Za-z]",n="[0-9]",o=t(n,"[A-Fa-f]"),i=a(a("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+a("%[89A-Fa-f]"+o+"%"+o+o)+"|"+a("%"+o+o)),c="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",c),s=e?"[\\uE000-\\uF8FF]":"[]",u=t(r,n,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),p=a(r+t(r,n,"[\\+\\-\\.]")+"*"),m=a(a(i+"|"+t(u,c,"[\\:]"))+"*"),d=(a(a("25[0-5]")+"|"+a("2[0-4][0-9]")+"|"+a("1[0-9][0-9]")+"|"+a("[1-9][0-9]")+"|"+n),a(a("25[0-5]")+"|"+a("2[0-4][0-9]")+"|"+a("1[0-9][0-9]")+"|"+a("0?[1-9][0-9]")+"|0?0?"+n)),f=a(d+"\\."+d+"\\."+d+"\\."+d),h=a(o+"{1,4}"),_=a(a(h+"\\:"+h)+"|"+f),v=a(a(h+"\\:")+"{6}"+_),g=a("\\:\\:"+a(h+"\\:")+"{5}"+_),y=a(a(h)+"?\\:\\:"+a(h+"\\:")+"{4}"+_),b=a(a(a(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+a(h+"\\:")+"{3}"+_),j=a(a(a(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+a(h+"\\:")+"{2}"+_),O=a(a(a(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+_),w=a(a(a(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+_),T=a(a(a(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),k=a(a(a(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),P=a([v,g,y,b,j,O,w,T,k].join("|")),S=a(a(u+"|"+i)+"+"),E=(a(P+"\\%25"+S),a(P+a("\\%25|\\%(?!"+o+"{2})")+S)),C=a("[vV]"+o+"+\\."+t(u,c,"[\\:]")+"+"),L=a("\\["+a(E+"|"+P+"|"+C)+"\\]"),N=a(a(i+"|"+t(u,c))+"*"),$=a(L+"|"+f+"(?!"+N+")|"+N),R=a("[0-9]*"),I=a(a(m+"@")+"?"+$+a("\\:"+R)+"?"),x=a(i+"|"+t(u,c,"[\\:\\@]")),A=a(x+"*"),D=a(x+"+"),M=a(a(i+"|"+t(u,c,"[\\@]"))+"+"),F=a(a("\\/"+A)+"*"),V=a("\\/"+a(D+F)+"?"),q=a(M+F),U=a(D+F),z="(?!"+x+")",K=(a(F+"|"+V+"|"+q+"|"+U+"|"+z),a(a(x+"|"+t("[\\/\\?]",s))+"*")),H=a(a(x+"|[\\/\\?]")+"*"),G=a(a("\\/\\/"+I+F)+"|"+V+"|"+U+"|"+z),J=a(p+"\\:"+G+a("\\?"+K)+"?"+a("\\#"+H)+"?"),B=a(a("\\/\\/"+I+F)+"|"+V+"|"+q+"|"+z),W=a(B+a("\\?"+K)+"?"+a("\\#"+H)+"?");return a(J+"|"+W),a(p+"\\:"+G+a("\\?"+K)+"?"),a(a("\\/\\/("+a("("+m+")@")+"?("+$+")"+a("\\:("+R+")")+"?)")+"?("+F+"|"+V+"|"+U+"|"+z+")"),a("\\?("+K+")"),a("\\#("+H+")"),a(a("\\/\\/("+a("("+m+")@")+"?("+$+")"+a("\\:("+R+")")+"?)")+"?("+F+"|"+V+"|"+q+"|"+z+")"),a("\\?("+K+")"),a("\\#("+H+")"),a(a("\\/\\/("+a("("+m+")@")+"?("+$+")"+a("\\:("+R+")")+"?)")+"?("+F+"|"+V+"|"+U+"|"+z+")"),a("\\?("+K+")"),a("\\#("+H+")"),a("("+m+")@"),a("\\:("+R+")"),{NOT_SCHEME:new RegExp(t("[^]",r,n,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,c),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,c),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,c),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,c),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,c,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,c,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,c),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,l),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+a(a("\\%25|\\%(?!"+o+"{2})")+"("+S+")")+"?\\]?$")}}var i=o(!1),c=o(!0),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],r=!0,n=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(a.push(i.value),!t||a.length!==t);r=!0);}catch(e){n=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(n)throw o}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=2147483647,u=36,p=/^xn--/,m=/[^\0-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,_=String.fromCharCode;function v(e){throw new RangeError(f[e])}function g(e,t){var a=e.split("@"),r="";a.length>1&&(r=a[0]+"@",e=a[1]);var n=function(e,t){for(var a=[],r=e.length;r--;)a[r]=t(e[r]);return a}((e=e.replace(d,".")).split("."),t).join(".");return r+n}var y=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},b=function(e,t,a){var r=0;for(e=a?h(e/700):e>>1,e+=h(e/t);e>455;r+=u)e=h(e/35);return h(r+36*e/(e+38))},j=function(e){return g(e,function(e){return m.test(e)?"xn--"+function(e){var t=[],a=(e=function(e){for(var t=[],a=0,r=e.length;a<r;){var n=e.charCodeAt(a++);if(n>=55296&&n<=56319&&a<r){var o=e.charCodeAt(a++);56320==(64512&o)?t.push(((1023&n)<<10)+(1023&o)+65536):(t.push(n),a--)}else t.push(n)}return t}(e)).length,r=128,n=0,o=72,i=!0,c=!1,l=void 0;try{for(var p,m=e[Symbol.iterator]();!(i=(p=m.next()).done);i=!0){var d=p.value;d<128&&t.push(_(d))}}catch(e){c=!0,l=e}finally{try{!i&&m.return&&m.return()}finally{if(c)throw l}}var f=t.length,g=f;for(f&&t.push("-");g<a;){var j=s,O=!0,w=!1,T=void 0;try{for(var k,P=e[Symbol.iterator]();!(O=(k=P.next()).done);O=!0){var S=k.value;S>=r&&S<j&&(j=S)}}catch(e){w=!0,T=e}finally{try{!O&&P.return&&P.return()}finally{if(w)throw T}}var E=g+1;j-r>h((s-n)/E)&&v("overflow"),n+=(j-r)*E,r=j;var C=!0,L=!1,N=void 0;try{for(var $,R=e[Symbol.iterator]();!(C=($=R.next()).done);C=!0){var I=$.value;if(I<r&&++n>s&&v("overflow"),I==r){for(var x=n,A=u;;A+=u){var D=A<=o?1:A>=o+26?26:A-o;if(x<D)break;var M=x-D,F=u-D;t.push(_(y(D+M%F,0))),x=h(M/F)}t.push(_(y(x,0))),o=b(n,E,g==f),n=0,++g}}}catch(e){L=!0,N=e}finally{try{!C&&R.return&&R.return()}finally{if(L)throw N}}++n,++r}return t.join("")}(e):e})},O=function(e){return g(e,function(e){return p.test(e)?function(e){var t,a=[],r=e.length,n=0,o=128,i=72,c=e.lastIndexOf("-");c<0&&(c=0);for(var l=0;l<c;++l)e.charCodeAt(l)>=128&&v("not-basic"),a.push(e.charCodeAt(l));for(var p=c>0?c+1:0;p<r;){for(var m=n,d=1,f=u;;f+=u){p>=r&&v("invalid-input");var _=(t=e.charCodeAt(p++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(_>=u||_>h((s-n)/d))&&v("overflow"),n+=_*d;var g=f<=i?1:f>=i+26?26:f-i;if(_<g)break;var y=u-g;d>h(s/y)&&v("overflow"),d*=y}var j=a.length+1;i=b(n-m,j,0==m),h(n/j)>s-o&&v("overflow"),o+=h(n/j),n%=j,a.splice(n++,0,o)}return String.fromCodePoint.apply(String,a)}(e.slice(4).toLowerCase()):e})},w={};function T(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function k(e){for(var t="",a=0,r=e.length;a<r;){var n=parseInt(e.substr(a+1,2),16);if(n<128)t+=String.fromCharCode(n),a+=3;else if(n>=194&&n<224){if(r-a>=6){var o=parseInt(e.substr(a+4,2),16);t+=String.fromCharCode((31&n)<<6|63&o)}else t+=e.substr(a,6);a+=6}else if(n>=224){if(r-a>=9){var i=parseInt(e.substr(a+4,2),16),c=parseInt(e.substr(a+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&c)}else t+=e.substr(a,9);a+=9}else t+=e.substr(a,3),a+=3}return t}function P(e,t){function a(e){var a=k(e);return a.match(t.UNRESERVED)?a:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,a).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,a).replace(t.NOT_USERINFO,T).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,a).toLowerCase().replace(t.NOT_HOST,T).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,a).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,T).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,a).replace(t.NOT_QUERY,T).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,a).replace(t.NOT_FRAGMENT,T).replace(t.PCT_ENCODED,n)),e}function S(e){return e.replace(/^0*(.*)/,"$1")||"0"}function E(e,t){var a=e.match(t.IPV4ADDRESS)||[],r=l(a,2)[1];return r?r.split(".").map(S).join("."):e}function C(e,t){var a=e.match(t.IPV6ADDRESS)||[],r=l(a,3),n=r[1],o=r[2];if(n){for(var i=n.toLowerCase().split("::").reverse(),c=l(i,2),s=c[0],u=c[1],p=u?u.split(":").map(S):[],m=s.split(":").map(S),d=t.IPV4ADDRESS.test(m[m.length-1]),f=d?7:8,h=m.length-f,_=Array(f),v=0;v<f;++v)_[v]=p[v]||m[h+v]||"";d&&(_[f-1]=E(_[f-1],t));var g=_.reduce(function(e,t,a){if(!t||"0"===t){var r=e[e.length-1];r&&r.index+r.length===a?r.length++:e.push({index:a,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],y=void 0;if(g&&g.length>1){var b=_.slice(0,g.index),j=_.slice(g.index+g.length);y=b.join(":")+"::"+j.join(":")}else y=_.join(":");return o&&(y+="%"+o),y}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a={},r=!1!==t.iri?c:i;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){N?(a.scheme=n[1],a.userinfo=n[3],a.host=n[4],a.port=parseInt(n[5],10),a.path=n[6]||"",a.query=n[7],a.fragment=n[8],isNaN(a.port)&&(a.port=n[5])):(a.scheme=n[1]||void 0,a.userinfo=-1!==e.indexOf("@")?n[3]:void 0,a.host=-1!==e.indexOf("//")?n[4]:void 0,a.port=parseInt(n[5],10),a.path=n[6]||"",a.query=-1!==e.indexOf("?")?n[7]:void 0,a.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(a.port)&&(a.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),a.host&&(a.host=C(E(a.host,r),r)),a.reference=void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||a.path||void 0!==a.query?void 0===a.scheme?"relative":void 0===a.fragment?"absolute":"uri":"same-document",t.reference&&"suffix"!==t.reference&&t.reference!==a.reference&&(a.error=a.error||"URI is not a "+t.reference+" reference.");var o=w[(t.scheme||a.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)P(a,r);else{if(a.host&&(t.domainHost||o&&o.domainHost))try{a.host=j(a.host.replace(r.PCT_ENCODED,k).toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII via punycode: "+e}P(a,i)}o&&o.parse&&o.parse(a,t)}else a.error=a.error||"URI can not be parsed.";return a}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,x=/^\/\.\.(\/|$)/,A=/^\/?(?:.|\n)*?(?=\/|$)/;function D(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(x))e=e.replace(x,"/"),t.pop();else if("."===e||".."===e)e="";else{var a=e.match(A);if(!a)throw new Error("Unexpected dot segment condition");var r=a[0];e=e.slice(r.length),t.push(r)}return t.join("")}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.iri?c:i,r=[],n=w[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(a.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?O(e.host):j(e.host.replace(a.PCT_ENCODED,k).toLowerCase())}catch(a){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+a}P(e,a),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var o=function(e,t){var a=!1!==t.iri?c:i,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(C(E(String(e.host),a),a).replace(a.IPV6ADDRESS,function(e,t,a){return"["+t+(a?"%25"+a:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&r.push("//"),r.push(o),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=D(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),r.push(l)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function F(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],n={};return r||(e=$(M(e,a),a),t=$(M(t,a),a)),!(a=a||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=D(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=D(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=D(t.path):(n.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:t.path:"/"+t.path,n.path=D(n.path)),n.query=t.query):(n.path=e.path,n.query=void 0!==t.query?t.query:e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function V(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:i.PCT_ENCODED,k)}var q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var a="https"===String(e.scheme).toLowerCase();return e.port!==(a?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},U={scheme:"https",domainHost:q.domainHost,parse:q.parse,serialize:q.serialize};function z(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var a=e;return a.secure=z(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a},serialize:function(e,t){if(e.port!==(z(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var a=e.resourceName.split("?"),r=l(a,2),n=r[0],o=r[1];e.path=n&&"/"!==n?n:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},H={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},G={},J="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",B="[0-9A-Fa-f]",W=a(a("%[EFef][0-9A-Fa-f]%"+B+B+"%"+B+B)+"|"+a("%[89A-Fa-f][0-9A-Fa-f]%"+B+B)+"|"+a("%"+B+B)),Q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(J,"g"),Y=new RegExp(W,"g"),X=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Q),"g"),ee=new RegExp(t("[^]",J,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),te=ee;function ae(e){var t=k(e);return t.match(Z)?t:e}var re={scheme:"mailto",parse:function(e,t){var a=e,r=a.to=a.path?a.path.split(","):[];if(a.path=void 0,a.query){for(var n=!1,o={},i=a.query.split("&"),c=0,l=i.length;c<l;++c){var s=i[c].split("=");switch(s[0]){case"to":for(var u=s[1].split(","),p=0,m=u.length;p<m;++p)r.push(u[p]);break;case"subject":a.subject=V(s[1],t);break;case"body":a.body=V(s[1],t);break;default:n=!0,o[V(s[0],t)]=V(s[1],t)}}n&&(a.headers=o)}a.query=void 0;for(var d=0,f=r.length;d<f;++d){var h=r[d].split("@");if(h[0]=V(h[0]),t.unicodeSupport)h[1]=V(h[1],t).toLowerCase();else try{h[1]=j(V(h[1],t).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}r[d]=h.join("@")}return a},serialize:function(e,t){var a,r=e,o=null!=(a=e.to)?a instanceof Array?a:"number"!=typeof a.length||a.split||a.setInterval||a.call?[a]:Array.prototype.slice.call(a):[];if(o){for(var i=0,c=o.length;i<c;++i){var l=String(o[i]),s=l.lastIndexOf("@"),u=l.slice(0,s).replace(Y,ae).replace(Y,n).replace(X,T),p=l.slice(s+1);try{p=t.iri?O(p):j(V(p,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[i]=u+"@"+p}r.path=o.join(",")}var m=e.headers=e.headers||{};e.subject&&(m.subject=e.subject),e.body&&(m.body=e.body);var d=[];for(var f in m)m[f]!==G[f]&&d.push(f.replace(Y,ae).replace(Y,n).replace(ee,T)+"="+m[f].replace(Y,ae).replace(Y,n).replace(te,T));return d.length&&(r.query=d.join("&")),r}},ne=/^([^\:]+)\:(.*)/,oe={scheme:"urn",parse:function(e,t){var a=e.path&&e.path.match(ne),r=e;if(a){var n=t.scheme||r.scheme||"urn",o=a[1].toLowerCase(),i=a[2],c=w[n+":"+(t.nid||o)];r.nid=o,r.nss=i,r.path=void 0,c&&(r=c.parse(r,t))}else r.error=r.error||"URN can not be parsed.";return r},serialize:function(e,t){var a=e.nid,r=w[(t.scheme||e.scheme||"urn")+":"+(t.nid||a)];r&&(e=r.serialize(e,t));var n=e;return n.path=(a||t.nid)+":"+e.nss,n}},ie=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ce={scheme:"urn:uuid",parse:function(e,t){var a=e;return a.uuid=a.nss,a.nss=void 0,t.tolerant||a.uuid&&a.uuid.match(ie)||(a.error=a.error||"UUID is not valid."),a},serialize:function(e,t){var a=e;return a.nss=(e.uuid||"").toLowerCase(),a}};w[q.scheme]=q,w[U.scheme]=U,w[K.scheme]=K,w[H.scheme]=H,w[re.scheme]=re,w[oe.scheme]=oe,w[ce.scheme]=ce,e.SCHEMES=w,e.pctEncChar=T,e.pctDecChars=k,e.parse=$,e.removeDotSegments=D,e.serialize=M,e.resolveComponents=F,e.resolve=function(e,t,a){var r=function(e,t){var a={scheme:"null"};if(t)for(var r in t)a[r]=t[r];return a}(0,a);return M(F($(e,r),$(t,r),r,!0),r)},e.normalize=function(e,t){return"string"==typeof e?e=M($(e,t),t):"object"===r(e)&&(e=$(M(e,t),t)),e},e.equal=function(e,t,a){return"string"==typeof e?e=M($(e,a),a):"object"===r(e)&&(e=M(e,a)),"string"==typeof t?t=M($(t,a),a):"object"===r(t)&&(t=M(t,a)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:i.ESCAPE,T)},e.unescapeComponent=V,Object.defineProperty(e,"__esModule",{value:!0})}("object"==_typeof(a)&&void 0!==t?a:e.URI=e.URI||{})}(this)},{}],2020:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=void 0;var r=e("./core"),n=e("./vocabularies/draft2020"),o=e("./vocabularies/discriminator"),i=e("./refs/json-schema-2020-12"),c="https://json-schema.org/draft/2020-12/schema",l=function(e){_inherits(a,r["default"]);var t=_createSuper(a);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _classCallCheck(this,a),t.call(this,_objectSpread(_objectSpread({},e),{},{dynamicRef:!0,next:!0,unevaluated:!0}))}return _createClass(a,[{key:"_addVocabularies",value:function(){var e=this;_get(_getPrototypeOf(a.prototype),"_addVocabularies",this).call(this),n.default.forEach(function(t){return e.addVocabulary(t)}),this.opts.discriminator&&this.addKeyword(o.default)}},{key:"_addDefaultMetaSchema",value:function(){_get(_getPrototypeOf(a.prototype),"_addDefaultMetaSchema",this).call(this);var e=this.opts,t=e.$data;e.meta&&(i.default.call(this,t),this.refs["http://json-schema.org/schema"]=c)}},{key:"defaultMeta",value:function(){return this.opts.defaultMeta=_get(_getPrototypeOf(a.prototype),"defaultMeta",this).call(this)||(this.getSchema(c)?c:void 0)}}]),a}();t.exports=a=l,Object.defineProperty(a,"__esModule",{value:!0}),a.default=l;var s=e("./compile/validate");Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var u=e("./compile/codegen");Object.defineProperty(a,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}})},{"./compile/codegen":2,"./compile/validate":15,"./core":18,"./refs/json-schema-2020-12":20,"./vocabularies/discriminator":54,"./vocabularies/draft2020":56}]},{},[])("2020")}); | 191,168 | 191,168 | 0.6987 |
0199c864e699cac8c941611b720da7b0ddef0945 | 1,298 | js | JavaScript | dist/commands/sudo.js | edsu/docnow | 2429420fb42064742d3592b3d6fccd452a647f49 | [
"MIT"
] | 51 | 2016-04-04T17:46:17.000Z | 2022-03-25T07:57:10.000Z | dist/commands/sudo.js | edsu/docnow | 2429420fb42064742d3592b3d6fccd452a647f49 | [
"MIT"
] | 175 | 2017-03-24T19:28:56.000Z | 2022-03-29T05:51:55.000Z | dist/commands/sudo.js | edsu/docnow | 2429420fb42064742d3592b3d6fccd452a647f49 | [
"MIT"
] | 17 | 2017-09-11T12:46:56.000Z | 2021-04-22T04:31:09.000Z | "use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _db = require("../server/db");
function main(_x) {
return _main.apply(this, arguments);
}
function _main() {
_main = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(screenName) {
var db, user;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
db = new _db.Database();
_context.next = 3;
return db.getUserByTwitterScreenName(screenName);
case 3:
user = _context.sent;
user.isSuperUser = !user.isSuperUser;
db.updateUser(user);
console.log("".concat(screenName, ": isSuperUser=").concat(user.isSuperUser));
_context.next = 9;
return db.close();
case 9:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _main.apply(this, arguments);
}
main(process.argv[2]); | 29.5 | 118 | 0.620185 |
10ca5c28c066df7a029eeb181750adb3dc941d5d | 1,370 | js | JavaScript | src/resources/4_0_0/profiles/specimendefinition/register.js | jeffkurian/graphql-fhir | 1dc1fca96c6fa81d9badcb7bff06bb017c8a6a2c | [
"MIT"
] | 144 | 2018-07-06T18:46:09.000Z | 2022-03-14T03:42:28.000Z | src/resources/4_0_0/profiles/specimendefinition/register.js | jeffkurian/graphql-fhir | 1dc1fca96c6fa81d9badcb7bff06bb017c8a6a2c | [
"MIT"
] | 53 | 2018-07-16T16:43:56.000Z | 2022-01-19T22:48:56.000Z | src/resources/4_0_0/profiles/specimendefinition/register.js | jeffkurian/graphql-fhir | 1dc1fca96c6fa81d9badcb7bff06bb017c8a6a2c | [
"MIT"
] | 44 | 2018-09-04T20:48:11.000Z | 2022-02-04T14:34:15.000Z | const {
SpecimenDefinitionCreateMutation,
SpecimenDefinitionUpdateMutation,
SpecimenDefinitionRemoveMutation,
} = require('./mutation');
const {
SpecimenDefinitionQuery,
SpecimenDefinitionListQuery,
SpecimenDefinitionInstanceQuery,
} = require('./query');
/**
* @name exports
* @static
* @summary GraphQL Configurations. This is needed to register this profile
* with the GraphQL server.
*/
module.exports = {
/**
* Define Query Schema's here
* Each profile will need to define the two queries it supports
* and these keys must be unique across the entire application, like routes
*/
query: {
SpecimenDefinition: SpecimenDefinitionQuery,
SpecimenDefinitionList: SpecimenDefinitionListQuery,
},
/**
* Define Mutation Schema's here
* Each profile will need to define the supported mutations
* and these keys must be unique across the entire application, like routes
*/
mutation: {
SpecimenDefinitionCreate: SpecimenDefinitionCreateMutation,
SpecimenDefinitionUpdate: SpecimenDefinitionUpdateMutation,
SpecimenDefinitionRemove: SpecimenDefinitionRemoveMutation,
},
/**
* These properties are so the core router can setup the approriate endpoint
* for a direct query against a resource
*/
instance: {
name: 'SpecimenDefinition',
path: '/4_0_0/SpecimenDefinition/:id',
query: SpecimenDefinitionInstanceQuery,
},
};
| 27.959184 | 77 | 0.765693 |
10cb86b5c0aab5615df013324c037256f1ab36de | 120 | js | JavaScript | src/superUser.js | stevenstc/Crypto-Soccer-DB-TESTNET | f9268e4abc7d552e73d96c9f0e92bcc43d18ff99 | [
"Apache-2.0"
] | null | null | null | src/superUser.js | stevenstc/Crypto-Soccer-DB-TESTNET | f9268e4abc7d552e73d96c9f0e92bcc43d18ff99 | [
"Apache-2.0"
] | null | null | null | src/superUser.js | stevenstc/Crypto-Soccer-DB-TESTNET | f9268e4abc7d552e73d96c9f0e92bcc43d18ff99 | [
"Apache-2.0"
] | 1 | 2022-03-16T22:27:44.000Z | 2022-03-16T22:27:44.000Z | module.exports = [
"0x11134Bd1dd0219eb9B4Ab931c508834EA29C0F8d",
"0x306A75c3E33603f69F4178C2c40EAF0734DE4F64"
]; | 30 | 49 | 0.808333 |
10cb902f445e044aca6e5fbc3cc75f44cf7880a9 | 2,123 | js | JavaScript | gatsby-node.js | ksiegel1923/LPaaS2Test | c818c2e15d43379abf0628f31526b73a3f082c5a | [
"Apache-2.0"
] | null | null | null | gatsby-node.js | ksiegel1923/LPaaS2Test | c818c2e15d43379abf0628f31526b73a3f082c5a | [
"Apache-2.0"
] | null | null | null | gatsby-node.js | ksiegel1923/LPaaS2Test | c818c2e15d43379abf0628f31526b73a3f082c5a | [
"Apache-2.0"
] | null | null | null | /* eslint-disable no-unused-vars */
const path = require('path');
const fs = require('fs-extra');
const { createFilePath } = require('gatsby-source-filesystem');
const _ = require('lodash');
const { languages } = require('./src/constants/languages');
exports.createPages = ({ actions, graphql }) => {
const { createPage, createRedirect } = actions;
languages.map((lang) => createRedirect({
fromPath: `/${lang.langKey}/home`,
toPath: `/${lang.langKey}/`,
isPermanent: true,
redirectInBrowser: true,
}));
return graphql(`
{
allMarkdownRemark(limit: 1000) {
edges {
node {
id
fields {
slug
}
frontmatter {
templateKey
lang
}
}
}
}
}
`).then((result) => {
if (result.errors) {
result.errors.forEach((e) => console.error(e.toString()));
return Promise.reject(result.errors);
}
const posts = result.data.allMarkdownRemark.edges;
posts.forEach((edge) => {
const { id } = edge.node;
if (edge.node.frontmatter.templateKey) {
const lang = _.get(edge, 'node.frontmatter.lang', 'en');
createPage({
path: edge.node.fields.slug,
component: path.resolve(
`src/templates/${String(edge.node.frontmatter.templateKey)}.jsx`,
),
context: {
id,
lang,
},
});
}
});
});
};
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions;
if (node.internal.type === 'MarkdownRemark') {
const value = createFilePath({ node, getNode });
const lang = _.get(node, 'frontmatter.lang', 'en');
const slug = _.get(node, 'frontmatter.slug', 'landing');
createNodeField({
name: 'slug',
node,
value: slug === 'home' ? `/${lang}` : `/${lang}/${slug}/`,
context: {
lang,
},
});
}
};
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
node: {
fs: 'empty',
},
});
};
| 23.588889 | 77 | 0.530382 |
10cc50fb779325c1faa61bdcfa955c56e456065e | 67 | js | JavaScript | app/blueprints/ember-ckeditor.js | smith-carson/ember-ckeditor | 0eb66f870d75d952e9fe783515d3cfa343c4d472 | [
"MIT"
] | null | null | null | app/blueprints/ember-ckeditor.js | smith-carson/ember-ckeditor | 0eb66f870d75d952e9fe783515d3cfa343c4d472 | [
"MIT"
] | null | null | null | app/blueprints/ember-ckeditor.js | smith-carson/ember-ckeditor | 0eb66f870d75d952e9fe783515d3cfa343c4d472 | [
"MIT"
] | null | null | null | export { default } from 'ember-ckeditor/blueprints/ember-ckeditor'; | 67 | 67 | 0.791045 |
10cca7ca4f1788c9d8e56144daf6c10a3c01eaea | 1,249 | js | JavaScript | src/Pages/products/pageComponents/categories/home.js | DaniloWA/FrontEndFlag | b94a61dbb86496366327503ace5c1854c86dc3c1 | [
"MIT"
] | null | null | null | src/Pages/products/pageComponents/categories/home.js | DaniloWA/FrontEndFlag | b94a61dbb86496366327503ace5c1854c86dc3c1 | [
"MIT"
] | null | null | null | src/Pages/products/pageComponents/categories/home.js | DaniloWA/FrontEndFlag | b94a61dbb86496366327503ace5c1854c86dc3c1 | [
"MIT"
] | null | null | null | /* eslint-disable react/prop-types */
import React, {useState} from "react";
import { Link } from "react-router-dom";
const Home = ({loading, homeProducts, cartAddItem}) => {
const [currentPage] = useState(1);
const [productsPerPage] = useState(5);
if(loading) {
return <h2>Loading...</h2>;
}
//Pagination
const indexLast = currentPage * productsPerPage;
const indexFirst = indexLast - productsPerPage;
const currentProducts = homeProducts.slice(indexFirst, indexLast);
return(
<>
<div className="wrapper">
{currentProducts.map((product) => {
return(
<>
<div key={product.id} className="card cardHeight">
<Link to={`/produto/${product.id}`}>
<div className="cardImage">
<img src={product.image} alt={product.title} />
</div>
</Link>
<div className="cardBody">
<h2 className="cardTitle">{product.title}</h2>
<p className="cardPrice">Price: {product.price}€</p>
<button onClick={() => cartAddItem({productId: product.id, title: product.title ,image: product.image ,price: product.price})} className="cardBtn">Add to cart</button>
</div>
</div>
</>
);
})}
</div>
</>
);
};
export default Home; | 28.386364 | 176 | 0.61249 |
10ccfc52ac47f7db4977ea73c0290e135642240d | 3,032 | js | JavaScript | assets/js/page/member/register_form.js | florebb1/kcloud | fc144194619ad09ac2ca14f08e36ce6c60d7e7f0 | [
"MIT"
] | null | null | null | assets/js/page/member/register_form.js | florebb1/kcloud | fc144194619ad09ac2ca14f08e36ce6c60d7e7f0 | [
"MIT"
] | null | null | null | assets/js/page/member/register_form.js | florebb1/kcloud | fc144194619ad09ac2ca14f08e36ce6c60d7e7f0 | [
"MIT"
] | null | null | null | $(document).ready(function () {
// 이메일 정규표현식
var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
// 비밀번호 정규표현식
var pwReg = /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{8,16}$/;
// email 수신동의 파리미터값
var rec = getParameter('email');
$("input[name=emailYn]").val(rec);
// 중복확인
$("#duplicateBtn").click(function () {
var id = $("input[name=userId]").val()
if(id == "") {
alert('아이디를 입력해주세요.');
$("input[name=userId]").focus();
return false;
}else if(regExp.test(id) == null) {
alert('아이디는 이메일 형식으로 입력해주세요.');
return false;
}
$.ajax({
url: '/Api/dupleCheck?userId='+id,
type: 'POST',
dataType: 'JSON',
success: function (response) {
console.log(response)
if(response.result == true) {
alert("사용가능한 아이디 입니다.");
$("#idChack").val(id);
$("#duplicateBtn").removeClass('btn-secondary');
$("#duplicateBtn").addClass('btn-info');
}else{
alert('동일한 아이디가 존재합니다.');
}
}
});
});
// sign-up button click event
$("#signBtn").click(function () {
var name = $("input[name=userName]").val();
var id = $("input[name=userId]").val();
var id2 = $("#idChack").val();
var pw = $("input[name=userPw]").val();
var pw2 = $("#pwCheck").val();
var email = $("input[name=userEmail]").val();
if(name == "") {
alert('이름을 입력해주세요.');
return false;
}else if(id == "") {
alert('아이디를 입력해주세요.')
return false;
}else if(id != id2) {
alert('아이디 중복체크를 해주세요.');
return false;
}else if(pw == "") {
alert('비밀번호를 입력해주세요.');
return false;
}else if(pwReg.test(pw) == false) {
alert('비밀번호 형식은 영문+숫자+특수문자를 사용하여 8자리 이상입니다.');
return false;
}else if(pw2 == "") {
alert('비밀번호 확인을 입력해주세요.');
return false;
}else if(pw != pw2) {
alert('비밀번호가 일치하지 않습니다.');
return false;
}else if(email == "") {
alert('email을 입력해주세요.');
return false;
}else if (email.match(regExp) == null) {
alert('잘못된 이메일 형식입니다.');
return false;
}
var datas = $("#registForm").serialize();
$.ajax({
url: '/api/join',
type: 'POST',
dataType: 'JSON',
data: datas,
success: function (response) {
if(response.result == true) {
document.location.href='/member/register_result';
}else {
alert('회원가입중 오류가 발생하였습니다.');
return false;
}
}
});
});
}); | 32.255319 | 100 | 0.419855 |
10cd0a6729d9adc69f536b027885f347d7e4eb8b | 3,183 | js | JavaScript | front/src/components/Cisco/components/Tickets.js | lima1756/CiscoTicketSystem | 2a2ecce9dfa8a667cb4c242e8462e4e45b7bc5b1 | [
"MIT"
] | null | null | null | front/src/components/Cisco/components/Tickets.js | lima1756/CiscoTicketSystem | 2a2ecce9dfa8a667cb4c242e8462e4e45b7bc5b1 | [
"MIT"
] | 1 | 2021-03-10T20:27:12.000Z | 2021-03-10T20:27:12.000Z | front/src/components/Cisco/components/Tickets.js | lima1756/CiscoTicketSystem | 2a2ecce9dfa8a667cb4c242e8462e4e45b7bc5b1 | [
"MIT"
] | null | null | null | import React, {useState} from "react";
import { Tooltip, OverlayTrigger } from "react-bootstrap";
import Button from "./CustomButton.jsx";
import Fuse from 'fuse.js';
import { useHistory } from "react-router-dom";
import { useAuth0 } from '../../../react-auth0-spa';
import axios from 'axios';
/**
* Props: tickets={tickets} pageSize={6} page={1} exclude={"Completed"}
*/
export default function Tickets(props) {
const [token, setToken] = useState("")
const edit = <Tooltip id="edit_tooltip">Update Ticket</Tooltip>;
const remove = <Tooltip id="remove_tooltip">Completed Ticket</Tooltip>;
const exclude = props.exclude;
const history = useHistory();
const { user, getIdTokenClaims } = useAuth0();
getIdTokenClaims().then((data) => { setToken(data.__raw) }).catch()
const completed = (ticket) => {
ticket.status="Completed";
axios.put("/ticket/"+ticket._id, ticket, {
headers: {
'Authorization': `Bearer ${token}`
}
}
).then(res => {
history.push("/ticket/" + res.data._id)
}).catch(err => {
console.log(err);
})
}
let tickets;
if(props.search !== ""){
tickets = search(props.search, props.tickets).filter((ticket)=> !exclude.includes(ticket.status));
console.log(tickets);
}
else {
tickets = props.tickets.filter((ticket)=> !exclude.includes(ticket.status));
}
const table = [];
for (let i = props.pageSize * (props.page-1); i < props.pageSize * props.page && i<tickets.length; i++) {
table.push(
<tr key={i}>
<td className="clickable" onClick={()=>{history.push("/ticket/"+tickets[i]._id)}}>{tickets[i].title}</td>
<td className="td-actions text-right">
<OverlayTrigger placement="top" overlay={edit} >
<Button bsstyle="info" simple type="button" bssize="xs" onClick={()=>{history.push("/ticket/edit/" + tickets[i]._id)}}>
<i className="fa fa-edit" />
</Button>
</OverlayTrigger>
<OverlayTrigger placement="top" overlay={remove}>
<Button bsstyle="success" simple type="button" bssize="xs" onClick={()=>{completed(tickets[i])}}>
<i className="fa fa-check" />
</Button>
</OverlayTrigger>
</td>
</tr>
);
}
return (
<div className="table-full-width">
<table className="table">
<tbody>{table}</tbody>
</table>
</div>
);
}
function search(input, tickets){
const data = tickets.map( s => {return combineAllKeyValues(s, null)});
const fuzeOptions = {
shouldSort: true,
threshold: 0.6,
isCaseSensitive: false,
keys: [
"_id",
"title",
"description",
"all"
]
}
const fuse = new Fuse(data, fuzeOptions);
return fuse.search(input).map(f=>f.item);
}
function combineAllKeyValues( obj, separator )
{
separator = separator || " ";
let d = {...JSON.parse(JSON.stringify(obj)), ...{"all":Object.keys(JSON.parse(JSON.stringify(obj))).map(s => obj[s]).join( separator )}};
return d;
} | 32.151515 | 139 | 0.573987 |
10cd63b2edda770a691b9bea91850d29727efdfc | 1,334 | js | JavaScript | src/containers/AppLayout/AppLayout.js | darwinzer0/pteraform-mw | ccecdf812652db8523d168f267417c3bbe5e2037 | [
"MIT"
] | 1 | 2018-08-09T11:04:27.000Z | 2018-08-09T11:04:27.000Z | src/containers/AppLayout/AppLayout.js | darwinzer0/pteraform-mw | ccecdf812652db8523d168f267417c3bbe5e2037 | [
"MIT"
] | null | null | null | src/containers/AppLayout/AppLayout.js | darwinzer0/pteraform-mw | ccecdf812652db8523d168f267417c3bbe5e2037 | [
"MIT"
] | 1 | 2021-09-15T18:03:37.000Z | 2021-09-15T18:03:37.000Z | import React, {Component} from 'react';
import { connect } from 'react-redux';
import muiThemeable from 'material-ui/styles/muiThemeable';
import { ResponsiveDrawer } from 'material-ui-responsive-drawer';
import { DrawerHeader } from '../../containers/Drawer';
import { DrawerContent } from '../../containers/Drawer';
import { Routes } from '../../components/Routes';
import config from '../../config';
import { withRouter } from 'react-router-dom';
import Scrollbar from '../../components/Scrollbar/Scrollbar';
export class AppLayout extends Component {
render(){
const { muiTheme, history } = this.props;
const drawerWidth=config.drawer_width;
const path=history.location.pathname;
return (
<div style={{backgroundColor: muiTheme.palette.canvasColor, height: '100%'}}>
<ResponsiveDrawer width={drawerWidth}>
<Scrollbar>
<DrawerHeader/>
<DrawerContent path={path} history={history}/>
</Scrollbar>
</ResponsiveDrawer>
<Routes/>
</div>
);
}
}
const mapStateToProps = (state) => {
const { theme, locale, messaging } = state;
return {
theme, //We need this so the theme change triggers rerendering
locale,
messaging
};
};
export default connect(
mapStateToProps
)(muiThemeable()(withRouter(AppLayout)));
| 27.22449 | 83 | 0.663418 |
10cf1c72cc511238915b9e80d604680d8fdfefa1 | 1,048 | js | JavaScript | routes/films.js | NatName/films | 3551f068a40af31bf6b184f440d62838c6b9f7a8 | [
"MIT"
] | null | null | null | routes/films.js | NatName/films | 3551f068a40af31bf6b184f440d62838c6b9f7a8 | [
"MIT"
] | null | null | null | routes/films.js | NatName/films | 3551f068a40af31bf6b184f440d62838c6b9f7a8 | [
"MIT"
] | null | null | null | const express = require('express');
const router = express.Router();
const multer = require('multer');
const upload = multer({ storage: multer.memoryStorage() });
const validator = require('validator');
const { check, validationResult } = require('express-validator');
const {
getFilms,
postFilms,
getAdd,
postAdd,
getInfo
} = require('../controllers/films');
router.get('/', getFilms);
router.post('/', upload.single('file'), [], postFilms);
router.get('/add', getAdd);
router.post('/add',[
check('title', ' must be 2 symbols and more').isLength({ min: 2 }).not().isEmpty().withMessage(' is empty').matches(/(\w|\s|\.|:)+/).withMessage(' use unsupported symbols'),
check('year', ' must be in range 1900-2019').isLength({ max: 4 }).not().isEmpty().withMessage(' is empty').matches(/(19\d\d)|(20[01]\d)/),
check('format').matches(/(DVD|VHS|Blu-Ray)/).withMessage("doesn't have a specific option"),
check('stars').not().isEmpty().withMessage(' is empty'),
], postAdd);
router.get('/info/:id', getInfo);
module.exports = router;
| 33.806452 | 175 | 0.662214 |
10d11febc50d223110c73c7dd32690fa27d84ade | 8,847 | js | JavaScript | www/search-search-module-es2015.js | rutvik0/Peach | b922db13dc8a41a7d06c4a9b991ae8f031313604 | [
"MIT"
] | null | null | null | www/search-search-module-es2015.js | rutvik0/Peach | b922db13dc8a41a7d06c4a9b991ae8f031313604 | [
"MIT"
] | null | null | null | www/search-search-module-es2015.js | rutvik0/Peach | b922db13dc8a41a7d06c4a9b991ae8f031313604 | [
"MIT"
] | null | null | null | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["search-search-module"],{
/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/search/search.page.html":
/*!*******************************************************************************!*\
!*** ./node_modules/raw-loader/dist/cjs.js!./src/app/search/search.page.html ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<ion-header>\n <ion-toolbar>\n <ion-title>Find Users</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <ion-searchbar style=\"--background:#ffe3ca\" (ionInput)=\"filterList($event)\"></ion-searchbar>\n <ion-list lines=\"none\">\n <ion-item *ngFor=\"let user of users\" (click)=\"goToUser(user)\">\n <ion-label class=\"ion-text-wrap\">\n <ion-avatar>\n <img [src]=\"user.image\"/>\n </ion-avatar>\n </ion-label>\n <ion-label>\n {{user.username}}\n </ion-label>\n </ion-item>\n </ion-list>\n</ion-content>\n");
/***/ }),
/***/ "./src/app/search/search-routing.module.ts":
/*!*************************************************!*\
!*** ./src/app/search/search-routing.module.ts ***!
\*************************************************/
/*! exports provided: SearchPageRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchPageRoutingModule", function() { return SearchPageRoutingModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var _search_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./search.page */ "./src/app/search/search.page.ts");
const routes = [
{
path: '',
component: _search_page__WEBPACK_IMPORTED_MODULE_3__["SearchPage"]
}
];
let SearchPageRoutingModule = class SearchPageRoutingModule {
};
SearchPageRoutingModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes)],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]],
})
], SearchPageRoutingModule);
/***/ }),
/***/ "./src/app/search/search.module.ts":
/*!*****************************************!*\
!*** ./src/app/search/search.module.ts ***!
\*****************************************/
/*! exports provided: SearchPageModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchPageModule", function() { return SearchPageModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
/* harmony import */ var _search_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./search-routing.module */ "./src/app/search/search-routing.module.ts");
/* harmony import */ var _search_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./search.page */ "./src/app/search/search.page.ts");
let SearchPageModule = class SearchPageModule {
};
SearchPageModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
_angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"],
_search_routing_module__WEBPACK_IMPORTED_MODULE_5__["SearchPageRoutingModule"]
],
declarations: [_search_page__WEBPACK_IMPORTED_MODULE_6__["SearchPage"]]
})
], SearchPageModule);
/***/ }),
/***/ "./src/app/search/search.page.scss":
/*!*****************************************!*\
!*** ./src/app/search/search.page.scss ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL3NlYXJjaC9zZWFyY2gucGFnZS5zY3NzIn0= */");
/***/ }),
/***/ "./src/app/search/search.page.ts":
/*!***************************************!*\
!*** ./src/app/search/search.page.ts ***!
\***************************************/
/*! exports provided: SearchPage */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchPage", function() { return SearchPage; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _user_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../user.service */ "./src/app/user.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
let SearchPage = class SearchPage {
constructor(userService, router) {
this.userService = userService;
this.router = router;
this.initializeList();
}
ngOnInit() {
this.initializeList();
}
goToUser(user) {
this.router.navigate(["/user", user]);
}
initializeList() {
this.userService.getObservable().subscribe((data) => {
this.users = this.userService.users;
});
this.users = this.userService.users;
}
filterList(event) {
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
this.initializeList();
const val = event.target.value;
if (val && val.trim() != '') {
this.users = this.users.filter((user) => {
return (user.username.toLocaleLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
});
}
};
SearchPage.ctorParameters = () => [
{ type: _user_service__WEBPACK_IMPORTED_MODULE_2__["UserService"] },
{ type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] }
];
SearchPage = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: 'app-search',
template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./search.page.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/search/search.page.html")).default,
styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./search.page.scss */ "./src/app/search/search.page.scss")).default]
})
], SearchPage);
/***/ })
}]);
//# sourceMappingURL=search-search-module-es2015.js.map | 51.138728 | 649 | 0.665875 |
10d15a74cf28cc8ecbdfb05a9067ee2d2d895530 | 293 | js | JavaScript | example/create.js | substack/svg-create-element | d41735c8476dfd5e5264440006ba73be14557a60 | [
"MIT"
] | 14 | 2015-01-19T11:52:49.000Z | 2020-02-24T22:15:41.000Z | example/create.js | npm-dom/svg-create-element | d41735c8476dfd5e5264440006ba73be14557a60 | [
"MIT"
] | 1 | 2015-03-20T23:45:17.000Z | 2015-03-20T23:45:17.000Z | example/create.js | npm-dom/svg-create-element | d41735c8476dfd5e5264440006ba73be14557a60 | [
"MIT"
] | 1 | 2016-08-25T22:27:44.000Z | 2016-08-25T22:27:44.000Z | var createElement = require('../');
var svg = createElement('svg');
svg.appendChild(createElement('polyline', {
stroke: 'cyan',
strokeWidth: 4,
fill: 'transparent',
points: [ [ 5, 50 ], [ 450, 100 ], [ 300, 300 ], [ 150, 220 ] ].join(' ')
}));
document.body.appendChild(svg);
| 26.636364 | 77 | 0.593857 |
10d1868a1862a5b571af89bfb89d5c3eef534088 | 126 | js | JavaScript | fuzzer_output/interesting/sample_1554149022480.js | patil215/v8 | bb941b58df9ee1e4048b69a555a2ce819fb819ed | [
"BSD-3-Clause"
] | null | null | null | fuzzer_output/interesting/sample_1554149022480.js | patil215/v8 | bb941b58df9ee1e4048b69a555a2ce819fb819ed | [
"BSD-3-Clause"
] | null | null | null | fuzzer_output/interesting/sample_1554149022480.js | patil215/v8 | bb941b58df9ee1e4048b69a555a2ce819fb819ed | [
"BSD-3-Clause"
] | null | null | null | function main() {
let v2 = "string";
const v3 = v2.split("string",-9007199254740991);
}
%NeverOptimizeFunction(main);
main();
| 18 | 48 | 0.698413 |
10d1ae8db30e3e8ba266bba591d8f52673a80acf | 484 | js | JavaScript | server/questions/question-model.js | jamesdasilva/answers-api | b4b1d1bd82242993aa37d3511f5eb0c8d473c45e | [
"MIT"
] | null | null | null | server/questions/question-model.js | jamesdasilva/answers-api | b4b1d1bd82242993aa37d3511f5eb0c8d473c45e | [
"MIT"
] | null | null | null | server/questions/question-model.js | jamesdasilva/answers-api | b4b1d1bd82242993aa37d3511f5eb0c8d473c45e | [
"MIT"
] | null | null | null | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const answerSchema = require('./answer-model').answerSchema;
const questionSchema = new Schema({
text: { type: String, required: true },
user: { type: String, default: 'anonymous' },
likesCount: { type: Number, default: 0 },
creationDate: { type: Date, default: Date.now },
answers: [answerSchema]
});
const Question = mongoose.model('Question', questionSchema);
module.exports.Question = Question; | 30.25 | 60 | 0.706612 |
10d2a081da7c30cdfad10ad9d1488b51ab2b10a4 | 776 | js | JavaScript | src/site/js/components/project-section.js | kt3k/todo-md | 7fa095756205e995e7a94397377bf0e6ae0e1752 | [
"MIT"
] | 1 | 2016-04-08T05:19:04.000Z | 2016-04-08T05:19:04.000Z | src/site/js/components/project-section.js | kt3k/todo-md | 7fa095756205e995e7a94397377bf0e6ae0e1752 | [
"MIT"
] | 37 | 2016-05-01T23:06:34.000Z | 2021-02-04T17:11:27.000Z | src/site/js/components/project-section.js | kt3k/todo-md | 7fa095756205e995e7a94397377bf0e6ae0e1752 | [
"MIT"
] | null | null | null | require('./todo-section')
require('./project-status-section')
require('./project-title-section')
const {div, hr, h2, p} = require('dom-gen')
const {component} = $.cc
@component
class ProjectSection {
constructor (elem) {
/**
* @property {Project}
*/
const project = elem.data('project')
elem.append(
h2('TODO ' + project.todos.length).addClass('todo-title'),
p({data: {project}}).cc('project-title-section'),
p({data: {project}}).cc('project-status-section'),
div({data: {tasks: project.todos}}).cc('todo-section'),
div({data: {tasks: project.dones}}).cc('done-section'),
hr()
)
}
onMouseenter () {
this.elem.find('.task-area').removeClass('task-area-hidden')
}
}
module.exports = ProjectSection
| 23.515152 | 64 | 0.613402 |
10d316e5a53c486b068355dc04daa4233541d098 | 4,225 | js | JavaScript | src/shop/wabao/Calculate/index.js | linyingzhen/btnew | 213c16401850c88a0b7f49b82b0f66c7c9863144 | [
"Apache-2.0"
] | null | null | null | src/shop/wabao/Calculate/index.js | linyingzhen/btnew | 213c16401850c88a0b7f49b82b0f66c7c9863144 | [
"Apache-2.0"
] | null | null | null | src/shop/wabao/Calculate/index.js | linyingzhen/btnew | 213c16401850c88a0b7f49b82b0f66c7c9863144 | [
"Apache-2.0"
] | null | null | null | /**
* const prefixCls = 'style-184101';
* const images = '/static/images/src/shop/wabao/Calculate';
* @Author: czy0729
* @Date: 2018-09-28 10:48:29
* @Last Modified by: czy0729
* @Last Modified time: 2018-09-28 15:36:56
* @Path m.benting.com.cn /src/shop/wabao/Calculate/index.js
*/
import React from 'react';
import PropTypes from 'prop-types';
import { injectV2, observer } from '@';
import { Flex } from '@components';
import { Layout, Header } from '@_';
import Styles from '@styles';
import store from './store';
const prefixCls = 'style-184101';
const Calculate = (props, { $ }) => {
const {
winNo,
lotTimeCount,
timeNo,
lotteryNo,
perTotal,
_loaded
} = $.getState('detail');
if (!_loaded) {
return null;
}
const total = parseInt(lotTimeCount) + parseInt(lotteryNo);
const yu = total % parseInt(perTotal);
return (
<Layout title="计算详情">
<div className="wrap-num">
<p className="t-32 t-void">幸运号码</p>
<p className="t-48 t-void t-b mt-4">{winNo}</p>
<p className="t-32 t-void mt-8">计算公式</p>
<p className="t-32 t-void mt-4">
(时间值之和 + 重庆时时彩) / 所需人次,取余数 + 初始号
</p>
</div>
<Header title="第一步" desc="计算所有人次的投注时间之和" line={false} />
<div className="wrap">
<p className="t-32 user-select">时间之和 = {lotTimeCount}</p>
</div>
<Header
className="mt-d"
title="第二步"
desc={`重庆时时彩 (第${timeNo}期)`}
line={false}
linkExtra="查询"
href="https://m.500.com/info/kaijiang/ssc/"
/>
<Flex className={`${prefixCls}__wrap-no`} justify="around">
{String(lotteryNo)
.split('')
.map((item, index) => (
/* eslint-disable-next-line */
<span key={index} className="no t-64 t-b t-c t-void">
{item}
</span>
))}
</Flex>
<Header
className="mt-d"
title="第三步"
desc="时间之和 + 重庆时时彩"
line={false}
/>
<div className="wrap">
<p className="t-32 user-select">
{lotTimeCount} + {lotteryNo} = {total}
</p>
</div>
<Header
className="mt-d"
title="第四步"
desc="第三步结果与 所需人次 取余数"
line={false}
/>
<div className="wrap">
<p className="t-32 user-select">
{total} % {perTotal} = {yu} (余数)
</p>
</div>
<Header
className="mt-d"
title="第五步"
desc="余数 + 初始号 = 幸运号码"
line={false}
/>
<div className="wrap">
<p className="t-32 user-select">
<span>{yu} + 100000001 =</span>
<span className="t-danger ml-xs">{yu + 100000001}</span>
</p>
</div>
<style jsx global>{`
.style-184101 {
}
.${prefixCls}__wrap-no {
padding: 0 ${Styles.wind_raw * 2}rem ${Styles.bottom};
background: ${Styles.color_theme};
}
`}</style>
<style jsx>{`
.style-184101 {
}
.wrap-num {
padding: ${Styles.wind};
margin: ${Styles.wind};
background: ${Styles.color_danger};
border-radius: 0.06rem;
}
.wrap {
padding: 0 ${Styles.wind} ${Styles.bottom};
background: ${Styles.color_theme};
}
.no {
display: inline-block;
width: 1rem;
height: 1rem;
border-radius: 50%;
}
.no:nth-of-type(1),
.no:nth-of-type(5) {
background: linear-gradient(
45deg,
rgba(255, 119, 132, 1) 0%,
rgba(255, 46, 70, 1) 100%
);
}
.no:nth-of-type(2),
.no:nth-of-type(4) {
background: linear-gradient(
45deg,
rgba(128, 216, 250, 1) 0%,
rgba(0, 159, 220, 1) 100%
);
}
.no:nth-of-type(3) {
background: linear-gradient(
45deg,
rgba(97, 244, 205, 1) 0%,
rgba(21, 215, 184, 1) 100%
);
}
`}</style>
</Layout>
);
};
Calculate.contextTypes = {
$: PropTypes.object
};
export default injectV2(store)(observer(Calculate));
| 25.762195 | 66 | 0.496568 |
10d60d2e217002ffd04080d122b764eeddf0f61a | 487 | js | JavaScript | src/components/image-contentstack/index.js | sachin1245/contentstack-demo | a7aa5f71d44d8dd2d25f841d7eb6dee81616540d | [
"MIT"
] | null | null | null | src/components/image-contentstack/index.js | sachin1245/contentstack-demo | a7aa5f71d44d8dd2d25f841d7eb6dee81616540d | [
"MIT"
] | null | null | null | src/components/image-contentstack/index.js | sachin1245/contentstack-demo | a7aa5f71d44d8dd2d25f841d7eb6dee81616540d | [
"MIT"
] | null | null | null | import React from "react"
const encodeQueryDataURL = data => {
let singleQuery = []
Object.keys(data).forEach(key => {
singleQuery.push(
encodeURIComponent(key) + "=" + encodeURIComponent(data[key])
)
})
return singleQuery.join("&")
}
export default ({ url, quality, format, alt }) => {
let queryString = encodeQueryDataURL({
format: format,
quality: quality,
})
const imageUrl = `${url}?${queryString}`
return <img src={imageUrl} alt={alt} />
}
| 22.136364 | 67 | 0.63655 |
10d6bf21085d35a56923d45bdd7a856b564fbd4e | 457 | js | JavaScript | src/sites/image/imagetwist.js | httpsgithu/adsbypasser | f19d5efccae4e25fba3dcc2846a8e0f96ebfcd21 | [
"BSD-2-Clause-FreeBSD"
] | 1,203 | 2015-01-03T17:40:56.000Z | 2022-03-19T21:20:05.000Z | src/sites/image/imagetwist.js | httpsgithu/adsbypasser | f19d5efccae4e25fba3dcc2846a8e0f96ebfcd21 | [
"BSD-2-Clause-FreeBSD"
] | 2,724 | 2015-01-01T10:38:36.000Z | 2022-03-27T06:52:11.000Z | src/sites/image/imagetwist.js | httpsgithu/adsbypasser | f19d5efccae4e25fba3dcc2846a8e0f96ebfcd21 | [
"BSD-2-Clause-FreeBSD"
] | 292 | 2015-01-26T01:47:28.000Z | 2022-02-18T00:17:57.000Z | (function () {
_.register({
rule: [
{
host: /^imagenpic\.com$/,
path: /^\/.*\/.+\.html?$/,
},
{
host: [
/^imagetwist\.com$/,
/^vipr\.im$/,
]
},
],
ready: run,
});
_.register({
rule: {
host: /^(imagexport|imageshimage)\.com$/,
},
ready: run,
});
async function run () {
const i = $('img.pic');
await $.openImage(i.src);
}
})();
| 14.28125 | 47 | 0.376368 |
10d77ca5de9f96de6e1f421aea4c9ea08f30dbca | 17,586 | js | JavaScript | Assets/Scripts/Directors/InputDirector.js | Gamieon/Cycles3D | 212e0980d27cbc3953dea4efed98ba073c5b0bc7 | [
"MIT"
] | 1 | 2015-01-16T17:59:23.000Z | 2015-01-16T17:59:23.000Z | Assets/Scripts/Directors/InputDirector.js | Gamieon/Cycles3D | 212e0980d27cbc3953dea4efed98ba073c5b0bc7 | [
"MIT"
] | null | null | null | Assets/Scripts/Directors/InputDirector.js | Gamieon/Cycles3D | 212e0980d27cbc3953dea4efed98ba073c5b0bc7 | [
"MIT"
] | 1 | 2020-11-05T00:22:30.000Z | 2020-11-05T00:22:30.000Z | /*******************************************************************************
Copyright (C) 2012 Gamieon, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
/* This component is used to handle all commands performed within a game. It hides
callers from the abstraction of how commands are dispatched to every instance of
the game. All commands in a game which affect player states not internally driven
by Unity must go through this component.
This component should persist throughout the lifetime of the game.
We expect that the game will add other components to this same game object. Those
components would have game-specific player registration and handling of events.
Major version history
=====================
2012-01-06 - c.haag - Initial implementation
*/
// Possible input director states
//
// Idle - Nothing is going on. This is true when we're in the main menu
// Local - A local instance of the game is in progress
// Server - This instance of the game is acting as the host
// Connecting - This instance of the game is connecting to a host
// Client - This instance of the game is connected to a host
enum InputTransportMode { Idle, Local, Server, Connecting, Client }
// The master server director which is responsible for acquiring online game listings
private var masterServerDirector : MasterServerDirector;
// The current state of the input director
private var mode : InputTransportMode = InputTransportMode.Idle;
// The prefix for the next level to load (prevents network messages from one
// level trickling into another)
private var nextLevelPrefix : int = 0;
// True if our input transport mode is Server and we're not actually engaging in the game
// (but we still need to run it)
private var isDedicatedServer : boolean;
// True if this game will NOT be listed on the master server
private var isPrivate : boolean;
private var gameTypeName : String; // Host property
private var gameName : String; // Host property
private var gameComment : String; // Host property
// Returns the input director in the scene. If it does not exist, it is created.
// The input director object persists through all scenes.
static function Get() : InputDirector
{
var o : GameObject = GameObject.Find("InputDirector");
if (null == o) {
o = new GameObject();
o.name = "InputDirector";
o.AddComponent("InputDirector");
o.AddComponent("MasterServerDirector");
// Ensure this object is never destroyed
DontDestroyOnLoad(o);
}
return o.GetComponent("InputDirector");
}
private function SetModeInternal(value : InputTransportMode)
{
mode = value;
Debug.Log("InputDirector mode is now " + value.ToString());
}
function Start()
{
masterServerDirector = GetComponent("MasterServerDirector");
networkView.stateSynchronization = NetworkStateSynchronization.Off;
}
// Returns true if this instance of the game is the host
function IsHosting() : boolean
{
var result : boolean = false;
if (InputTransportMode.Local == mode || InputTransportMode.Server == mode)
{
result = true;
}
return result;
}
function IsNetworking() : boolean
{
var result : boolean = true;
if (InputTransportMode.Local == mode)
{
result = false;
}
return result;
}
// Returns true if this game object belongs to us for controlling. This only
// applies to objects with networkView components being used.
function IsOurs(o : GameObject)
{
if (IsNetworking()) {
return o.networkView.isMine;
} else {
return true;
}
}
// Returns true if we are actively running a dedicated server
function IsDedicatedServer() : boolean
{
if (InputTransportMode.Server == mode) {
return isDedicatedServer;
} else {
// If we're not a server, we're not dedicated, period.
return false;
}
}
// This function returns our current mode
function GetMode() : InputTransportMode
{
return mode;
}
// This function changes the mode of the input director
function SetMode(value : InputTransportMode)
{
// Unhost if we're currently hosting but the input mode is changing
if (InputTransportMode.Server == mode && value != mode) {
UnhostServer();
}
// TODO: Check the existing mode and throw exceptions if not supported
SetModeInternal(value);
}
// This function gets the IP address from a given client ID
function GetIPAddress(ID : String) : String
{
for (var i=0; i < Network.connections.length; i++) {
if (Network.connections[i].ToString() == ID) {
return Network.connections[i].ipAddress;
}
}
return "";
}
// This function will host a server. The caller specifies the max number of players
// and the listening port. This will notify the notification object when the game is
// hosted.
function HostServer(connections : int, listenPort : int, dedicatedServer : boolean,
password : String, gamePrivate : boolean, typeName : String, name : String, comment : String)
{
if (InputTransportMode.Idle == mode)
{
var useNat : boolean = !Network.HavePublicAddress();
isDedicatedServer = dedicatedServer;
isPrivate = gamePrivate;
gameTypeName = typeName;
gameName = name;
gameComment = comment;
Network.InitializeSecurity();
SetModeInternal(InputTransportMode.Connecting);
Network.incomingPassword = password;
var result : NetworkConnectionError = Network.InitializeServer(connections, listenPort, useNat);
if (NetworkConnectionError.NoError == result)
{
// This might not mean the server is initialized; it could mean it's initializing. We want
// to wait for a OnServerInitialized message.
Debug.Log("Network.InitializeServer was successful");
}
else {
// Unity doesn't send messages for failing to initialize the server, so we'll send one.
SendMessage("OnHostServerComplete", result);
// TODO: Throw an exception?
}
}
else {
// TODO: Throw an exception
}
}
// This function will unhost a server
function UnhostServer()
{
if (InputTransportMode.Server == mode) {
// Remove from the Unity master server game list
masterServerDirector.UnregisterHost();
// Now disconnect
Network.Disconnect();
// Update our mode
SetModeInternal(InputTransportMode.Idle);
}
else {
// TODO: Throw an exception
}
}
// This function will have the game instance attempt to connect to a server
function ConnectToServer(IP : String, remotePort : int, password : String, self : GameObject)
{
if (InputTransportMode.Idle == mode)
{
selfPlayerObject = self;
SetModeInternal(InputTransportMode.Connecting);
var result : NetworkConnectionError = Network.Connect(IP, remotePort, password);
if (NetworkConnectionError.NoError == result)
{
// This might not mean the connection is established; it could mean it's initializing. We want
// to wait for a OnConnectedToServer message.
Debug.Log("Network.Connect was successful.");
}
else {
// TODO: Throw an exception?
}
}
else {
// TODO: Throw an exception
}
}
// This function will disconnect us from the server if we're still connected
function DisconnectFromServer()
{
if (InputTransportMode.Connecting == mode || InputTransportMode.Client == mode) {
Network.Disconnect();
// Update our mode
SetModeInternal(InputTransportMode.Idle);
}
}
// This function is called by the server to disconnect a client
function DisconnectClientFromServer(ID : String)
{
for (var i=0; i < Network.connections.Length; i++) {
if (Network.connections[i].ToString() == ID) {
Network.CloseConnection(Network.connections[i],true);
return;
}
}
}
function OnServerInitialized()
{
Debug.Log("Server initialized.");
// Update our mode
SetModeInternal(InputTransportMode.Server);
// Register the game on Unity's master server
if (!isPrivate) {
masterServerDirector.RegisterHost(gameTypeName, gameName, gameComment, isDedicatedServer);
}
// Let all components know the server is initialized
SendMessage("OnHostServerComplete", NetworkConnectionError.NoError);
}
// This is called by Unity when a player connects to a server. Only servers get this message.
function OnPlayerConnected(player : NetworkPlayer)
{
// player.ToString() is the unique ID of the player. When printing NetworkPlayer.ToString()
// you will see a number, but we should not assume it will always be a number.
Debug.Log("Player " + player.ToString() + " connected from " + player.ipAddress + ":" + player.port + ".");
// TODO: Anything else?
}
// This is called by Unity when a player disconnects from a server. Only servers get this message.
function OnPlayerDisconnected(player : NetworkPlayer)
{
// player.ToString() is the unique ID of the player. When printing NetworkPlayer.ToString()
// you will see a number, but we should not assume it will always be a number.
Debug.Log("Player " + player.ToString() + " disconnected.");
// Delete all player objects and RPC buffer entries
Network.RemoveRPCs(player);
Network.DestroyPlayerObjects(player);
// TODO: Anything else?
// Let all components know what happened
SendMessage("OnPlayerDisconnectedFromServer", player);
}
// This is called by Unity when we, a client, failed to connect to a remote server.
function OnFailedToConnect(error : NetworkConnectionError)
{
Debug.Log("Failed to connect to server!");
SetModeInternal(InputTransportMode.Idle);
// Shut down our connection
DisconnectFromServer();
// Let all components know what happened
SendMessage("OnConnectToServerComplete", error);
}
// This is called by Unity when we, a client, connected to the remote server.
function OnConnectedToServer()
{
// Update our mode
SetModeInternal(InputTransportMode.Client);
// Let all components know what happened. We don't need to do anything here.
SendMessage("OnConnectToServerComplete", NetworkConnectionError.NoError);
}
// This is called by Unity when we, a client, were disconnected from the remote server.
// It can also be called when a server is shut down.
function OnDisconnectedFromServer(disconnectionMode : NetworkDisconnection)
{
Debug.Log("Disconnected from the server.");
SetModeInternal(InputTransportMode.Idle);
// TODO: Better handling per
// http://unity3d.com/support/documentation/ScriptReference/Network.OnDisconnectedFromServer.html
// Let all components know what happened
SendMessage("OnDisconnectionFromServer", disconnectionMode);
}
// This function will create a new object in the game based on a prefab
function InstantiateObject(prefab : GameObject, position : Vector3, rotation : Quaternion, group : int) : GameObject
{
var result : GameObject = null;
switch (mode) {
case InputTransportMode.Local:
// Regular instantiation
result = GameObject.Instantiate(prefab, position, rotation);
break;
case InputTransportMode.Server:
case InputTransportMode.Client:
// Network instantiation
result = Network.Instantiate(prefab, position, rotation, group);
break;
default:
// Not supported
// TODO: Throw an exception
break;
}
return result;
}
// This function will destroy a game object
function DestroyObject(doomedObject : GameObject)
{
switch (mode) {
case InputTransportMode.Local:
// Regular destruction
Destroy(doomedObject);
break;
case InputTransportMode.Server:
case InputTransportMode.Client:
// Network destruction
// TODO: Figure out why When when destroying client objects do we still get messages
// like "View ID AllocatedID: 50 not found during lookup. Strange behaviour may occur"?
// Probably because I pulled the rug from right under the client's feet and they're trying
// to send state information. I tried sending an RPC first, but Destroy seems to have a higher
// priority and completes before my RPC gets out. Need to confirm the right way to destroy
// objects that were instantiated by other players.
Network.Destroy(doomedObject);
break;
default:
// Not supported
// TODO: Throw an exception
break;
}
}
// This function is called by a server to change the current level during a network game
function LoadScene(level : String)
{
if (InputTransportMode.Local == mode) {
Application.LoadLevel(level);
} else if (InputTransportMode.Server == mode) {
networkView.RPC("OnLoadNetworkLevel", RPCMode.AllBuffered, level, nextLevelPrefix++);
} else {
// TODO: Throw an exception?
}
}
// This function will send a non-buffered command to the server
function SendCommandToServer(command : String)
{
switch (mode) {
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.Server);
break;
default:
// TODO: Throw an exception?
break;
}
}
// This function will send a non-buffered command with a Vector3 parameter to a single player
function SendCommand(networkPlayerID : String, command : String, param : Vector3)
{
switch (mode) {
case InputTransportMode.Server:
for (var p : NetworkPlayer in Network.connections) {
if (p.ToString() == networkPlayerID) {
networkView.RPC(command, p, param);
return;
}
}
// TODO: Throw an exception?
break;
default:
break;
}
}
// This function will send a buffered command to an object. In a local game, a message
// will be sent. In a network game, an RPC call will be made. In a network game,
// the object should have been created with InputDirector.InstantiateObject()
function SendBufferedCommand(receiver : GameObject, command : String)
{
switch (mode) {
case InputTransportMode.Local:
// Process the command locally. The receiver is required to handle the message.
receiver.SendMessage(command);
break;
case InputTransportMode.Server:
case InputTransportMode.Client:
// Use an RPC command. This requires that the receiver has a network view.
receiver.networkView.RPC(command, RPCMode.AllBuffered);
break;
default:
// Not supported
// TODO: Throw an exception
break;
}
}
// This function will broadcast a non-buffered command with a single float to all clients
// TODO: How do we use args so we don't need all these BroadcastCommand overloads?
function BroadcastCommand(command : String, f1 : float)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, f1);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a non-buffered command with a single string to all clients
function BroadcastCommand(command : String, s1 : String)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, s1);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a non-buffered command with a string and int to all clients
function BroadcastCommand(command : String, s1 : String, i1 : int)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, s1, i1);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a non-buffered command with a single vector and color
// parameter to all clients and the originator.
function BroadcastCommand(command : String, pos : Vector3, color : Color)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, pos, color.r, color.g, color.b, color.a);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a non-buffered command with two string
// parameters to all clients and the originator.
function BroadcastCommand(command : String, s1 : String, s2 : String)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, s1, s2);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a non-buffered command with a string and
// a booelan parameter to all clients and the originator.
function BroadcastCommand(command : String, s1 : String, b2 : boolean)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.All, s1, b2);
break;
default:
// Not supported
break;
}
}
// This function will broadcast a buffered command with an integer
// parameter to all clients and the originator.
function BroadcastBufferedCommand(command : String, i1 : int)
{
switch (mode) {
case InputTransportMode.Server:
case InputTransportMode.Client:
networkView.RPC(command, RPCMode.AllBuffered, i1);
break;
default:
// Not supported
break;
}
}
@script RequireComponent(NetworkView)
| 31.858696 | 116 | 0.731093 |
10d7dc165f4e2f712964eeaf0b9b4d049002047a | 640 | js | JavaScript | packages/registerclient/src/clients.js | sassoftware/restaf | 25d15314b54153409d98a54ab2fd45ff4ad27013 | [
"Apache-2.0"
] | 20 | 2018-03-22T23:24:39.000Z | 2021-09-21T08:17:11.000Z | packages/registerclient/src/clients.js | sassoftware/restaf | 25d15314b54153409d98a54ab2fd45ff4ad27013 | [
"Apache-2.0"
] | 27 | 2019-04-23T22:59:09.000Z | 2022-03-04T01:55:45.000Z | packages/registerclient/src/clients.js | sassoftware/restaf | 25d15314b54153409d98a54ab2fd45ff4ad27013 | [
"Apache-2.0"
] | 7 | 2018-06-03T02:56:49.000Z | 2020-11-11T01:47:49.000Z | #!/usr/bin/env node
const addapp = require('./addClient');
const delapp = require('./delapp');
const listapp = require('./listClient');
function clients (store,args,vorpal) {
let options = {
clientid: (args.c != null) ? args.c : null
};
let sel = process.argv[2];
console.log(sel);
console.log('-----------------------------------');
if (sel.indexOf('list') >= 0) {
listapp();
} else if (sel.indexOf('delete') >=0) {
delapp();
} else if (sel.indexOf('add') >= 0) {
addapp();
} else {
console.log(`Error: Unknown operation ${sel}`);
process.exit(0);
}
} | 25.6 | 55 | 0.514063 |
10d8b1426fd7420bddc9399aaa9c29554acefb0b | 2,234 | js | JavaScript | assets/js/ckeditor/translations/id.js | fadilatur11/cmsmuntaha | 7c759da0e68da4e142b75409a3f8d6d8c1b525e6 | [
"MIT"
] | null | null | null | assets/js/ckeditor/translations/id.js | fadilatur11/cmsmuntaha | 7c759da0e68da4e142b75409a3f8d6d8c1b525e6 | [
"MIT"
] | null | null | null | assets/js/ckeditor/translations/id.js | fadilatur11/cmsmuntaha | 7c759da0e68da4e142b75409a3f8d6d8c1b525e6 | [
"MIT"
] | null | null | null | (function(d){d['id']=Object.assign(d['id']||{},{a:"Tidak dapat mengunggah berkas:",b:"Tebal",c:"Miring",d:"Kutipan",e:"Sisipkan gambar atau berkas",f:"widget gambar",g:"Gambar ukuran penuh",h:"Gambar sisi",i:"Gambar rata kiri",j:"Gambar rata tengah",k:"Gambar rata kanan",l:"Sisipkan gambar",m:"Pilih tajuk",n:"Tajuk",o:"Daftar Berangka",p:"Daftar Tak Berangka",q:"Sisipkan tabel",r:"Kolom tajuk",s:"Sisipkan kolom ke kiri",t:"Sisipkan kolom ke kanan",u:"Hapus kolom",v:"Kolom",w:"Baris tajuk",x:"Sisipkan baris ke bawah",y:"Sisipkan baris ke atas",z:"Hapus baris",aa:"Baris",ab:"Gabungkan sel ke atas",ac:"Gabungkan sel ke kanan",ad:"Gabungkan sel ke bawah",ae:"Gabungkan sel ke kiri",af:"Bagikan sel secara vertikal",ag:"Bagikan sel secara horizontal",ah:"Gabungkan sel",ai:"Rata kiri",aj:"Rata kanan",ak:"Rata tengah",al:"Rata kanan-kiri",am:"Perataan teks",an:"Tambahkan deskripsi gambar",ao:"Gagal mengunggah",ap:"widget media",aq:"Sisipkan media",ar:"URL tidak boleh kosong.",as:"URL media ini tidak didukung.",at:"Tautan",au:"Sedang mengunggah",av:"Gagal mendapatkan URL gambar terukur",aw:"Gagal memilih gambar terukur",ax:"Tidak dapat menyisipkan gambar pada posisi ini.",ay:"Gagal menyisipkan gambar",az:"Ganti alternatif teks gambar",ba:"Jenis Huruf",bb:"Bawaan",bc:"Warna Huruf",bd:"Ukuran Huruf",be:"Sangat Kecil",bf:"Kecil",bg:"Besar",bh:"Sangat Besar",bi:"Warna Latar Huruf",bj:"Simpan",bk:"Batal",bl:"Tempelkan URL ke dalam bidang masukan.",bm:"Tip: Tempelkan URL ke bagian konten untuk sisip cepat.",bn:"URL Media",bo:"Editor Teks Kaya",bp:"Editor Teks Kaya, %0",bq:"Batal",br:"Lakukan lagi",bs:"%0 dari %1",bt:"Sebelumnya",bu:"Berikutnya",bv:"Hitam",bw:"Kelabu gelap",bx:"Kelabu",by:"Kelabu terang",bz:"Putih",ca:"Merah",cb:"Jingga",cc:"Kuning",cd:"Hijau terang",ce:"Hijau",cf:"Biru laut",cg:"Turkish",ch:"Biru terang",ci:"Biru",cj:"Ungu",ck:"Hapus warna",cl:"Warna dokumen",cm:"Buka di tab baru",cn:"Dapat diunduh",co:"Alternatif teks",cp:"Hapus tautan",cq:"Sunting tautan",cr:"Buka tautan di tab baru",cs:"Tautan ini tidak memiliki URL",ct:"URL tautan",cu:"Paragraf",cv:"Tajuk 1",cw:"Tajuk 2",cx:"Tajuk 3",cy:"Tajuk 4",cz:"Tajuk 5",da:"Tajuk 6"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); | 2,234 | 2,234 | 0.722919 |
10d8c4dfcc3268d65ed69689585d03030222734c | 3,644 | js | JavaScript | src/commands/roleinfo.js | alex123rep/something | efbcb87eec6205bb4254e07d9be51f98830323ed | [
"MIT"
] | 21 | 2020-05-25T09:57:17.000Z | 2021-11-01T18:05:21.000Z | src/commands/roleinfo.js | alex123rep/something | efbcb87eec6205bb4254e07d9be51f98830323ed | [
"MIT"
] | 6 | 2020-05-20T14:51:55.000Z | 2021-02-24T08:45:22.000Z | src/commands/roleinfo.js | alex123rep/something | efbcb87eec6205bb4254e07d9be51f98830323ed | [
"MIT"
] | 10 | 2020-03-09T17:10:13.000Z | 2020-05-03T12:52:45.000Z | const Discord = require("discord.js");
exports.run = async (client, message, args, level) => {
if (!args[0])
return message.channel.send(
`<:error:466995152976871434> You didn't provide me with a role name or ID! Usage: \`${client.commands.get(`roleinfo`).help.usage}\``
);
let role = client.findRole(args.join(" "), message);
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
if(!role) {
return message.channel.send(`<:error:466995152976871434> Role not found.`)
}
var permissions = "```";
if(role.permissions.has("ADMINISTRATOR")) permissions += "ADMINISTRATOR, ";
if(role.permissions.has("CREATE_INSTANT_INVITE")) permissions += "CREATE_INSTANT_INVITE, ";
if(role.permissions.has("KICK_MEMBERS")) permissions += "KICK_MEMBERS, ";
if(role.permissions.has("BAN_MEMBERS")) permissions += "BAN_MEMBERS, ";
if(role.permissions.has("MANAGE_CHANNELS")) permissions += "MANAGE_CHANNELS, ";
if(role.permissions.has("MANAGE_GUILD")) permissions += "MANAGE_GUILD, ";
if(role.permissions.has("ADD_REACTIONS")) permissions += "ADD_REACTIONS, ";
if(role.permissions.has("VIEW_AUDIT_LOG")) permissions += "VIEW_AUDIT_LOG, ";
if(role.permissions.has("PRIORITY_SPEAKER")) permissions += "PRIORITY_SPEAKER, ";
if(role.permissions.has("STREAM")) permissions += "STREAM, ";
if(role.permissions.has("VIEW_CHANNEL")) permissions += "VIEW_CHANNEL, ";
if(role.permissions.has("SEND_MESSAGES")) permissions += "SEND_MESSAGES, ";
if(role.permissions.has("SEND_TTS_MESSAGES")) permissions += "SEND_TTS_MESSAGES, ";
if(role.permissions.has("MANAGE_MESSAGES")) permissions += "MANAGE_MESSAGES, ";
if(role.permissions.has("EMBED_LINKS")) permissions += "EMBED_LINKS, ";
if(role.permissions.has("ATTACH_FILES")) permissions += "ATTACH_FILES, ";
if(role.permissions.has("READ_MESSAGE_HISTORY")) permissions += "READ_MESSAGE_HISTORY, ";
if(role.permissions.has("MENTION_EVERYONE")) permissions += "MENTION_EVERYONE, ";
if(role.permissions.has("USE_EXTERNAL_EMOJIS")) permissions += "USE_EXTERNAL_EMOJIS, ";
if(role.permissions.has("CONNECT")) permissions += "CONNECT, ";
if(role.permissions.has("SPEAK")) permissions += "SPEAK, ";
if(role.permissions.has("MUTE_MEMBERS")) permissions += "MUTE_MEMBERS, ";
if(role.permissions.has("DEAFEN_MEMBERS")) permissions += "DEAFEN_MEMBERS, ";
if(role.permissions.has("MOVE_MEMBERS")) permissions += "MOVE_MEMBERS, ";
if(role.permissions.has("USE_VAD")) permissions += "USE_VAD, ";
if(role.permissions.has("CHANGE_NICKNAME")) permissions += "CHANGE_NICKNAME, ";
if(role.permissions.has("MANAGE_NICKNAMES")) permissions += "MANAGE_NICKNAMES, ";
if(role.permissions.has("MANAGE_ROLES")) permissions += "MANAGE_ROLES, ";
if(role.permissions.has("MANAGE_WEBHOOKS")) permissions += "MANAGE_WEBHOOKS, ";
if(role.permissions.has("MANAGE_EMOJIS")) permissions += "MANAGE_EMOJIS, ";
permissions = permissions.slice(0, -2);
permissions += "```";
var embed = new Discord.MessageEmbed();
embed.setColor(role.color);
embed.setTitle(role.name);
embed.setDescription(
`• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${role.hoist}`
);
embed.addField(`**Permissions:**`, permissions)
message.channel.send(embed)
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ["rinfo"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "roleinfo",
category: "Utility",
description: "Gives information about a role.",
usage: "roleinfo [role]"
}; | 48.586667 | 156 | 0.701153 |
10d936266147764470257034604ca566422866e7 | 1,470 | js | JavaScript | unpackage/dist/build/.tmp/app-plus/components/badge/badge.js | Qumge/fission-h5 | ed3c9d441b3be7e2a9da016ec43e6a54f355f92a | [
"MIT"
] | null | null | null | unpackage/dist/build/.tmp/app-plus/components/badge/badge.js | Qumge/fission-h5 | ed3c9d441b3be7e2a9da016ec43e6a54f355f92a | [
"MIT"
] | null | null | null | unpackage/dist/build/.tmp/app-plus/components/badge/badge.js | Qumge/fission-h5 | ed3c9d441b3be7e2a9da016ec43e6a54f355f92a | [
"MIT"
] | null | null | null | (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/badge/badge"],{"0c0c":function(t,e,n){"use strict";var u=n("d81f"),a=n.n(u);a.a},"26c4":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u={name:"tuiBadge",props:{type:{type:String,default:"primary"},size:{type:String,default:""},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}}};e.default=u},"2c57":function(t,e,n){"use strict";var u,a=function(){var t=this,e=t.$createElement;t._self._c},c=[];n.d(e,"b",function(){return a}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return u})},7181:function(t,e,n){"use strict";n.r(e);var u=n("2c57"),a=n("eb10");for(var c in a)"default"!==c&&function(t){n.d(e,t,function(){return a[t]})}(c);n("0c0c");var r,f=n("f0c5"),o=Object(f["a"])(a["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],r);e["default"]=o.exports},d81f:function(t,e,n){},eb10:function(t,e,n){"use strict";n.r(e);var u=n("26c4"),a=n.n(u);for(var c in u)"default"!==c&&function(t){n.d(e,t,function(){return u[t]})}(c);e["default"]=a.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/badge/badge-create-component',
{
'components/badge/badge-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('6e42')['createComponent'](__webpack_require__("7181"))
})
},
[['components/badge/badge-create-component']]
]);
| 133.636364 | 1,093 | 0.642177 |
10d9c58c2e2766421fbf713eb13e399821897847 | 750 | js | JavaScript | nodeJS-backend/src/api/routes/createGame.js | Max-Hitchings/Blackjack-Web-App | 6426ddb2d156781acffba48ffece757e5db04bc4 | [
"MIT"
] | 1 | 2021-07-27T11:54:14.000Z | 2021-07-27T11:54:14.000Z | nodeJS-backend/src/api/routes/createGame.js | Max-Hitchings/Blackjack-Web-App | 6426ddb2d156781acffba48ffece757e5db04bc4 | [
"MIT"
] | 7 | 2021-07-21T22:50:50.000Z | 2022-01-22T22:52:03.000Z | nodeJS-backend/src/api/routes/createGame.js | Max-Hitchings/Blackjack-Web-App | 6426ddb2d156781acffba48ffece757e5db04bc4 | [
"MIT"
] | null | null | null | const Games = require("../../models/gamesSchema.js");
const generateCards = require("../../util/generateCards");
export const createGame = async (req, res) => {
const playerId = req.body.playerId;
const playerNick = req.body.playerNick;
const newPlayers = playerId !== null ? [playerId] : [];
const newGame = new Games({
gameCode: Math.random().toString(36).toUpperCase().substring(2, 7),
cards: generateCards(),
players: [{ playerId: playerId, playerNick: playerNick, cards: [] }],
hostId: playerId,
});
try {
const gameSaved = await newGame.save();
res.status(201).json({ gameCode: gameSaved.gameCode });
} catch (err) {
res.status(err.code === 11000 ? 500 : 400).json({ message: err.message });
}
};
| 32.608696 | 78 | 0.646667 |
10da44df738997a5086c5be78a777c9c0fe9c6a2 | 3,748 | js | JavaScript | dist/universal-auth.js | poeticninja/universal-auth | 708df08c5b8e583cca3cb3e816ab459618c316cc | [
"MIT"
] | 6 | 2015-09-03T02:47:03.000Z | 2018-10-12T13:06:01.000Z | dist/universal-auth.js | poeticninja/universal-auth | 708df08c5b8e583cca3cb3e816ab459618c316cc | [
"MIT"
] | 1 | 2015-08-31T04:02:12.000Z | 2015-09-03T02:49:54.000Z | dist/universal-auth.js | poeticninja/universal-auth | 708df08c5b8e583cca3cb3e816ab459618c316cc | [
"MIT"
] | null | null | null | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.UniversalAuth = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* Dependencies.
*/
var RenderTemplate = require('./render-template');
var Intersection = require('./intersection');
module.exports = function(){
var isBrowser = false;
if (typeof window !== 'undefined') {
isBrowser = true;
}
var auth = {
session: {}
};
auth.session.set = function(session) {
auth.session.store = session;
if (isBrowser) {
localStorage.setItem('userSession', JSON.stringify(session));
}
};
auth.session.get = function(){
if (isBrowser && !auth.session.store) {
auth.session.store = JSON.parse(localStorage.getItem('userSession'));
}
if (auth.session.store) {
return auth.session.store;
}
return null;
};
auth.session.clear = function(){
auth.session.store = null;
if (isBrowser) {
localStorage.removeItem('userSession');
}
};
auth.session.store = null;
auth.isAuthenticated = function() {
return !!auth.session.get();
};
auth.isAuthorized = function(scope, templateObj) {
var session = auth.session.get();
var scopes = [].concat(scope);
if (scope) {
scopes.forEach(function(scope, i) {
if (/{([^}]+)}/.test(scope)) {
scopes[i] = RenderTemplate(scope, templateObj);
}
});
}
if (!scope ||
((scope === true) && session) ||
(session && Intersection(scopes, [].concat(session.scope)).length)) {
return true;
}
return false;
};
return auth;
};
},{"./intersection":2,"./render-template":3}],2:[function(require,module,exports){
module.exports = function(arrayOne, arrayTwo) {
var common = [];
var obj = {};
arrayOne.forEach(function(item){
obj[item] = true;
});
arrayTwo.forEach(function(item){
if (item in obj) {
common.push(item);
}
});
return common;
};
},{}],3:[function(require,module,exports){
module.exports = function(template, obj) {
return template.replace(/{([^}]+)}/g, function ($0, chain) {
var path = chain.split('.');
for (var i = 0, length = path.length; i < length; ++i) {
var key = path[i];
if (key[0] === '-' && Array.isArray(obj)) {
key = key.slice(1, key.length);
key = obj.length - key;
}
if (!obj ||
!obj.hasOwnProperty(key) ||
typeof obj !== 'object') {
console.log('Missing key', key, 'in template', chain);
obj = null;
break;
}
obj = obj[key];
}
return (obj === undefined || obj === null ? '' : obj);
});
};
},{}]},{},[1])(1)
}); | 27.15942 | 853 | 0.533885 |
10dadab62ff51e69a536179aa10cb00e67d55e35 | 1,156 | js | JavaScript | routes/api/getAccessToken.js | minhchi3103/novel-translate-api | 5e28eda71acdcb525aeb9479a04c4cc961f5b026 | [
"MIT"
] | null | null | null | routes/api/getAccessToken.js | minhchi3103/novel-translate-api | 5e28eda71acdcb525aeb9479a04c4cc961f5b026 | [
"MIT"
] | 2 | 2021-05-10T17:16:17.000Z | 2021-09-02T00:06:46.000Z | routes/api/getAccessToken.js | minhchi3103/novel-translate-api | 5e28eda71acdcb525aeb9479a04c4cc961f5b026 | [
"MIT"
] | null | null | null | var express = require('express');
var router = express.Router();
var jwt = require('jsonwebtoken');
var User = require('@m/user');
router.post('/', async function(req, res, next) {
try {
let username = req.body.username;
let password = req.body.password;
// find user in database, after that, compare password
let queryUser = await User.findOne({
username: username
})
.select('+password')
.exec();
if (!queryUser) {
let err = new Error('user not found');
err.status = 400;
throw err;
}
if (queryUser.comparePassword(password)) {
if (queryUser.password) queryUser.password = undefined;
let token = jwt.sign(queryUser.toJSON(), process.env.PRIVATE_KEY, {
algorithm: 'RS256',
expiresIn: Number(process.env.TOKEN_EXPIRED_TIME),
issuer: 'shinryak'
});
return res
.set({
Authorization: 'Bearer ' + token
})
.json({
token: token
});
}
let err = new Error('password wrong');
err.status = 403;
throw err;
} catch (error) {
next(error);
}
});
module.exports = router;
| 25.130435 | 73 | 0.58391 |
10dbc3b3042d269c0f081491d729bf8d59f11347 | 1,567 | js | JavaScript | src/reducers/state/state.js | lourencorodrigo/tentacle-frontend | ced55a400e477cd0635a8081d2acd68165ee8885 | [
"MIT"
] | null | null | null | src/reducers/state/state.js | lourencorodrigo/tentacle-frontend | ced55a400e477cd0635a8081d2acd68165ee8885 | [
"MIT"
] | null | null | null | src/reducers/state/state.js | lourencorodrigo/tentacle-frontend | ced55a400e477cd0635a8081d2acd68165ee8885 | [
"MIT"
] | null | null | null | import {
STATE_FAILURE,
STATE_REQUEST,
STATE_SUCCESS,
STATE_REQUEST_CITIES,
STATE_SUCCESS_CITIES,
STATE_FAILURE_CITIES
} from '../../actions/state';
const initialState = {
payload: [],
loading: false,
error: false,
errorData: {}
};
const initialStateCity = {
payload: [],
loading: false,
error: false,
errorData: {}
};
export const state = (state = initialState, action) => {
switch (action.type) {
case STATE_REQUEST:
return Object.assign({}, state, { loading: true });
case STATE_SUCCESS:
return Object.assign({}, state, {
payload: action.data.list,
loading: false,
error: false
});
case STATE_SUCCESS_CITIES:
return Object.assign({}, state, {
cities: action.data.cities,
loading: false,
error: false
});
case STATE_FAILURE:
return Object.assign({}, state, {
loading: false,
error: true,
errorData: action.data.error
});
default:
return state;
}
};
export const city = (state = initialStateCity, action) => {
switch (action.type) {
case STATE_REQUEST_CITIES:
return Object.assign({}, state, { loading: true });
case STATE_SUCCESS_CITIES:
return Object.assign({}, state, {
payload: action.data.cities,
loading: false,
error: false
});
case STATE_FAILURE_CITIES:
return Object.assign({}, state, {
loading: false,
error: true,
errorData: action.data.error
});
default:
return state;
}
};
| 22.070423 | 59 | 0.59732 |
10dca97b433111139dc0bcead5020eabb489dcf3 | 960 | js | JavaScript | src/store/reduxStore.js | flyingSprite/upperHot | 3221ad56e3d8898ce1d0cf5deee5e15845acb8c5 | [
"MIT"
] | null | null | null | src/store/reduxStore.js | flyingSprite/upperHot | 3221ad56e3d8898ce1d0cf5deee5e15845acb8c5 | [
"MIT"
] | null | null | null | src/store/reduxStore.js | flyingSprite/upperHot | 3221ad56e3d8898ce1d0cf5deee5e15845acb8c5 | [
"MIT"
] | null | null | null | import { createStore, applyMiddleware,compose } from 'redux';
import thunk from 'redux-thunk';
import reducer from '../reducers';
// import DevTools from '../devTools/dev-tool.js';
//applyMiddleware来自redux可以包装 store 的 dispatch
//thunk作用是使被 dispatch 的 function 会接收 dispatch 作为参数,并且可以异步调用它
const createStoreWithMiddleware = compose(
// Middleware you want to use in development:
applyMiddleware(thunk)
// window.devToolsExtension ? window.devToolsExtension() : f => f
// Required! Enable Redux DevTools with the monitors you chose
// DevTools.instrument()
)(createStore);
export default function configureStore(initialState) {
const store = createStoreWithMiddleware(reducer, initialState);
//热替换选项
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers', () => {
const nextReducer = require('../reducers');
store.replaceReducer(nextReducer);
});
}
return store;
};
| 32 | 67 | 0.728125 |
10dcea1579d9c3efa63e3e62ba034dc06a80bd62 | 1,838 | js | JavaScript | app/modules/search/search_list/search_list_item/component.js | lx3133584/duoduo_comic_app | d65bc87dfc4f53b0d0cb06f06f64d6d7cf60fcca | [
"MIT"
] | 4 | 2018-07-31T09:06:32.000Z | 2021-05-15T17:42:07.000Z | app/modules/search/search_list/search_list_item/component.js | lx3133584/duoduo_comic_app | d65bc87dfc4f53b0d0cb06f06f64d6d7cf60fcca | [
"MIT"
] | 1 | 2018-04-18T15:41:31.000Z | 2018-08-27T02:37:02.000Z | app/modules/search/search_list/search_list_item/component.js | lx3133584/duoduo_comic_app | d65bc87dfc4f53b0d0cb06f06f64d6d7cf60fcca | [
"MIT"
] | null | null | null | import React from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { LongListItem } from '..';
import { Badge } from 'react-native-elements';
import { green, red, purple } from '~/theme';
const ContainStyled = styled.View`
flex-direction: row;
padding: 8px;
`;
const DescStyled = styled.Text`
color: #999;
font-size: 14px;
margin: 10px 0;
`;
const AuthorStyled = styled.Text`
color: #666;
font-size: 12px;
margin-right: 10px;
`;
const textStyle = {
fontSize: 10,
};
const wrapperStyle = {
width: 50,
marginRight: 10,
};
const greenBackground = {
backgroundColor: green,
};
const redBackground = {
backgroundColor: red,
};
const purpleBackground = {
backgroundColor: purple,
};
function SearchListItem(props) {
const {
desc, author, status, class_name,
} = props;
return (
<LongListItem {...props}>
<DescStyled numberOfLines={3}>
{desc.replace(':', '')}
</DescStyled>
<ContainStyled>
<AuthorStyled>
{author || '佚名'}
</AuthorStyled>
<Badge
value={status}
textStyle={textStyle}
wrapperStyle={wrapperStyle}
containerStyle={status === '完结' ? greenBackground : redBackground}
/>
{class_name && (
<Badge
value={class_name}
textStyle={textStyle}
wrapperStyle={wrapperStyle}
containerStyle={purpleBackground}
/>
)}
</ContainStyled>
</LongListItem>
);
}
SearchListItem.propTypes = {
desc: PropTypes.string,
class_name: PropTypes.string,
author: PropTypes.string,
status: PropTypes.string.isRequired,
};
SearchListItem.defaultProps = {
desc: '',
class_name: '',
author: '',
};
export default SearchListItem;
| 22.414634 | 76 | 0.626224 |
10dd19c281ea234766805a61d25b852512621712 | 1,067 | js | JavaScript | Gruntfile.js | mickpik/taxi-sam | 482977a63a9f27a5a496d9db84429e6103236fff | [
"MIT"
] | null | null | null | Gruntfile.js | mickpik/taxi-sam | 482977a63a9f27a5a496d9db84429e6103236fff | [
"MIT"
] | null | null | null | Gruntfile.js | mickpik/taxi-sam | 482977a63a9f27a5a496d9db84429e6103236fff | [
"MIT"
] | null | null | null | module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
all: {
options: {
outputStyle: 'compressed',
sourceMap: true
},
files: {
'src/AppBundle/Resources/public/css/style.css': 'src/AppBundle/Resources/sources/sass/style.scss'
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'src/AppBundle/Resources/public/css',
src: ['*.css', '!*.min.css'],
dest: 'src/AppBundle/Resources/public/css',
ext: '.min.css'
}]
}
},
watch: {
styles: {
files: [
'src/AppBundle/Resources/**/*.scss'
],
tasks: ['sass']
}
}
});
grunt.registerTask('build', ['sass', 'cssmin']);
grunt.registerTask('default', ['build', 'watch']);
}; | 23.711111 | 107 | 0.525773 |
10de90f95c28a8f79157d992fb55537a0ce50dfa | 537 | js | JavaScript | server/models/controls_regulations.js | alfjjacob/Tombolo | 30cf9f2ae0b10e7996385c25388fc32a9da861ec | [
"Apache-2.0"
] | null | null | null | server/models/controls_regulations.js | alfjjacob/Tombolo | 30cf9f2ae0b10e7996385c25388fc32a9da861ec | [
"Apache-2.0"
] | 242 | 2020-01-28T16:40:31.000Z | 2022-03-29T00:26:20.000Z | server/models/controls_regulations.js | alfjjacob/Tombolo | 30cf9f2ae0b10e7996385c25388fc32a9da861ec | [
"Apache-2.0"
] | 6 | 2019-07-17T04:52:15.000Z | 2022-02-04T02:59:03.000Z | 'use strict';
module.exports = (sequelize, DataTypes) => {
const controls_regulations = sequelize.define('controls_regulations', {
id: {
primaryKey: true,
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
autoIncrement: false
},
compliance: DataTypes.STRING,
data_types:DataTypes.STRING,
}, {paranoid: true, freezeTableName: true});
controls_regulations.associate = function(models) {
// associations can be defined here
};
return controls_regulations;
}; | 29.833333 | 73 | 0.689013 |
10dffb4c2a0e0807e64b82d1adc13b31023e4f09 | 955 | js | JavaScript | services/NoticiaService.js | MarcosVn/noticias-api | 942f2706d104ba781fb1ad8ac3476ecd810335e6 | [
"MIT"
] | null | null | null | services/NoticiaService.js | MarcosVn/noticias-api | 942f2706d104ba781fb1ad8ac3476ecd810335e6 | [
"MIT"
] | null | null | null | services/NoticiaService.js | MarcosVn/noticias-api | 942f2706d104ba781fb1ad8ac3476ecd810335e6 | [
"MIT"
] | null | null | null | "use strict";
const Noticia = require('../models/Noticia');
const ObjectId = require('mongoose').Types.ObjectId;
class NoticiaService {
async create(params) {
const noticia = new Noticia(params);
return await noticia.save();
};
async findAll() {
return await Noticia.find();
};
async findOne({ id }) {
if(!ObjectId.isValid(id)) {
throw { status: 404, message: 'Notícia não existe!' };
}
return await Noticia.findById(id);
};
async update(id, params) {
const noticia = await Noticia.findById(id);
if(!ObjectId.isValid(id) || !noticia) {
throw { status: 404, message: 'Notícia não existe!' };
}
Object.assign(noticia, params);
return await noticia.save();
};
async remove({ id }) {
if(!ObjectId.isValid(id)) {
throw { status: 404, message: 'Notícia não existe!' };
}
return await Noticia.findByIdAndRemove(id);
};
}
module.exports = NoticiaService;
| 20.319149 | 60 | 0.624084 |
10e122f14cc65512a75d0483abd98b67b5383e56 | 3,236 | js | JavaScript | src/index.js | sgromkov/docusaurus-plugin-yandex-metrica | c67b08bc3db917ef6d40c0161139027cbda748d5 | [
"0BSD"
] | null | null | null | src/index.js | sgromkov/docusaurus-plugin-yandex-metrica | c67b08bc3db917ef6d40c0161139027cbda748d5 | [
"0BSD"
] | null | null | null | src/index.js | sgromkov/docusaurus-plugin-yandex-metrica | c67b08bc3db917ef6d40c0161139027cbda748d5 | [
"0BSD"
] | null | null | null | const DEFAULT_SCRIPT_URL = 'https://mc.yandex.ru/metrika/tag.js';
const ALTERNATIVE_CDN_SCRIPT_URL = 'https://cdn.jsdelivr.net/npm/yandex-metrica-watch/tag.js';
const generateYmParamsString = function (params) {
const defaultYmParams = {
defer: true,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: false,
ecommerce: false,
trackHash: false,
};
const ymParams = {};
for (paramName in defaultYmParams) {
ymParams[paramName] = (paramName in params) ? params[paramName] : defaultYmParams[paramName];
};
const ymParamsString = Object.keys(ymParams).reduce((acc, paramName, index, paramNames) => {
const separator = (index < paramNames.length - 1) ? ',' : '';
const paramValue = ymParams[paramName];
return `${acc}${paramName}:${paramValue}${separator}`;
}, '');
return '{' + ymParamsString + '}';
}
module.exports = async function pluginYandexMetrika(context, options) {
const {
counterID,
alternativeCdn = false,
} = options;
if (!counterID) {
throw new Error(
`You need to specify "counterID" field in plugin options to use docusaurus-plugin-yandex-metrica.`
);
}
const isProd = process.env.NODE_ENV === 'production';
return {
name: 'docusaurus-plugin-yandex-metrica',
async contentLoaded({ actions }) {
actions.setGlobalData(options);
},
getClientModules() {
return isProd ? ['./events'] : [];
},
injectHtmlTags() {
if (!isProd) {
return {};
}
const ymParams = generateYmParamsString(options);
const scriptUrl = alternativeCdn ? ALTERNATIVE_CDN_SCRIPT_URL : DEFAULT_SCRIPT_URL;
return {
// Yandex.Metrica load https://mc.yandex.ru/metrika/tag.js, so we preconnect it.
headTags: [
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://mc.yandex.ru',
},
},
// https://yandex.ru/support/metrica/code/counter-spa-setup.html
{
tagName: 'script',
innerHTML: `
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "${scriptUrl}", "ym");
ym(${counterID}, "init", ${ymParams});
`,
},
{
tagName: 'noscript',
innerHTML: `
<div><img src="https://mc.yandex.ru/watch/${counterID}" style="position:absolute; left:-9999px;" alt="" /></div>
`,
},
],
};
},
};
};
| 35.173913 | 150 | 0.491347 |
10e2305114c5ae188ca2ae3a6a4c934b60c9fb87 | 2,677 | js | JavaScript | public/js/utils.js | mberenguerascampi/web_padel | 23ae3a33ec7a3947dec09dc41b3b0f90453017fe | [
"MIT"
] | null | null | null | public/js/utils.js | mberenguerascampi/web_padel | 23ae3a33ec7a3947dec09dc41b3b0f90453017fe | [
"MIT"
] | null | null | null | public/js/utils.js | mberenguerascampi/web_padel | 23ae3a33ec7a3947dec09dc41b3b0f90453017fe | [
"MIT"
] | null | null | null | var Utils = (function () {
var getNextHour = function (hour) {
if(hour === undefined) return "";
var arrHour = hour.split(":");
if (arrHour[1] == "30"){
return (parseInt(arrHour[0])+1) + ":00";
}
else {
return arrHour[0] + ":30";
}
}
var getPreviousHour = function (hour) {
if(hour === undefined) return "";
var arrHour = hour.split(":");
if (arrHour[1] == "00"){
return (parseInt(arrHour[0])-1) + ":30";
}
else {
return arrHour[0] + ":00";
}
}
var compareHours = function(hourA, hourB){
if (hourA === hourB) return 0;
var arrHourA = hourA.split(":");
var arrHourB = hourB.split(":");
if (parseInt(arrHourA[0]) > parseInt(arrHourB[0]) ||
(parseInt(arrHourA[0]) == parseInt(arrHourB[0]) && parseInt(arrHourA[1]) > parseInt(arrHourB[0]) ) ){
return 1;
}
else{
return -1;
}
}
var dateToString = function(date) {
var hour = date.getHours();
hour = (hour < 10 ? "0" : "") + hour;
var min = date.getMinutes();
min = (min < 10 ? "0" : "") + min;
var sec = date.getSeconds();
sec = (sec < 10 ? "0" : "") + sec;
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = (month < 10 ? "0" : "") + month;
var day = date.getDate();
day = (day < 10 ? "0" : "") + day;
return day + "/" + month + "/" + year;
}
var stringToDate = function(strDate, hourMin){
var arrDate = strDate.split("/");
var hours = 0;
var min = 0;
if(hourMin !== undefined){
var arrHour = hourMin.split(":");
hours = parseInt(arrHour[0]);
min = parseInt(arrHour[1]);
}
return new Date(parseInt(arrDate[2]), parseInt(arrDate[1])-1, parseInt(arrDate[0]), hours, min, 0, 0);
}
var getCurrentDate = function() {
var date = new Date();
return dateToString(date);
}
var incrDate = function (strDate) {
var date = stringToDate(strDate);
date.setDate(date.getDate()+1);
return dateToString(date);
}
var decrDate = function (strDate) {
var date = stringToDate(strDate);
date.setDate(date.getDate()-1);
return dateToString(date);
}
var copyJson = function(json){
var jsonRet = {};
for (key in json) {
jsonRet[key] = json[key];
}
return jsonRet;
}
var isExpiredDate = function(strDate){
if (typeof strDate !== "string") return false; //Utilitzem -1 per definir l'infinit
var date = stringToDate(strDate);
return new Date() > date;
}
return {
getNextHour: getNextHour,
getPreviousHour: getPreviousHour,
compareHours: compareHours,
getCurrentDate: getCurrentDate,
stringToDate: stringToDate,
dateToString: dateToString,
incrDate: incrDate,
decrDate: decrDate,
isExpiredDate: isExpiredDate,
copyJson: copyJson
}
})(); | 22.123967 | 104 | 0.611879 |
10e252aadb467d4e002396d9b29696cbafde58ef | 177 | js | JavaScript | scripts/create-env.js | JeanHaro/js-portafolio-course | 9a01680b4b24eb10c677aa8b448b65e16737cdec | [
"MIT"
] | null | null | null | scripts/create-env.js | JeanHaro/js-portafolio-course | 9a01680b4b24eb10c677aa8b448b65e16737cdec | [
"MIT"
] | null | null | null | scripts/create-env.js | JeanHaro/js-portafolio-course | 9a01680b4b24eb10c677aa8b448b65e16737cdec | [
"MIT"
] | null | null | null | const fs = require('fs');
// De esta forma tenemos este recurso, y ya estamos creando un archivo .env dentro del servidor
fs.writeFileSync('./.env', `API=${process.env.API}\n`) | 44.25 | 95 | 0.711864 |
10e3b88cbd163748901ca81da3cc5af0b78c9c87 | 1,723 | js | JavaScript | web/js/MyFramework.js | vacagonzalo/CESE-SOPG-TP2 | f77cacbdb960e08c735f2b226c24fff5db5dfd23 | [
"MIT"
] | null | null | null | web/js/MyFramework.js | vacagonzalo/CESE-SOPG-TP2 | f77cacbdb960e08c735f2b226c24fff5db5dfd23 | [
"MIT"
] | null | null | null | web/js/MyFramework.js | vacagonzalo/CESE-SOPG-TP2 | f77cacbdb960e08c735f2b226c24fff5db5dfd23 | [
"MIT"
] | null | null | null | var MyFramework = /** @class */ (function () {
function MyFramework() {
}
/**
* getElementById: Busca un elemento del DOM por su ID
* @param id : String con el id a buscar
* @returns : Objeto HTMLElement encontrado
*/
MyFramework.prototype.getElementById = function (id) {
var el;
el = document.getElementById(id);
return el;
};
MyFramework.prototype.getElementByEvent = function (evt) {
return evt.target;
};
MyFramework.prototype.requestGET = function (url, listener) {
var xhr;
xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
listener.handleGETResponse(xhr.status, xhr.responseText);
}
else {
listener.handleGETResponse(xhr.status, null);
}
}
};
xhr.open('GET', url, true);
xhr.send(null);
};
MyFramework.prototype.requestPOST = function (url, data, listener) {
var formData = new FormData();
for (var key in data) {
formData.append(key, data[key]);
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
listener.handlePOSTResponse(xhr.status, xhr.responseText);
}
else {
listener.handlePOSTResponse(xhr.status, null);
}
}
};
xhr.open("POST", url);
xhr.send(formData);
};
return MyFramework;
}());
| 31.907407 | 78 | 0.513059 |
10e476592aa1a12318d6f825aff38cac0b89742d | 4,107 | js | JavaScript | markdown/src/components/MarkDown.js | raniamhelmy/markdown-live-preview | 6269bb89f83bd597bfeaa78d1d1874187d0bed5f | [
"MIT"
] | null | null | null | markdown/src/components/MarkDown.js | raniamhelmy/markdown-live-preview | 6269bb89f83bd597bfeaa78d1d1874187d0bed5f | [
"MIT"
] | 1 | 2021-12-26T17:01:02.000Z | 2021-12-26T17:01:11.000Z | markdown/src/components/MarkDown.js | raniamhelmy/markdown-live-preview | 6269bb89f83bd597bfeaa78d1d1874187d0bed5f | [
"MIT"
] | null | null | null | import React ,{useState} from "react";
import Container from 'react-bootstrap/Container'
import {useGlobalContext} from "../context/DataContext"
import Row from "react-bootstrap/Row"
import Col from "react-bootstrap/Col"
import 'bootstrap/dist/css/bootstrap.min.css';
import "./MarkDown.css"
import {marked} from 'marked'
import * as SiIcons from "react-icons/si"
import * as CgIcons from "react-icons/cg"
function MarkDown() {
const placeholder = `# Welcome to my React Markdown Previewer!
## This is a sub-heading...
### And here's some other cool stuff:
Heres some code, \`<div></div>\`, between 2 backticks.
\`\`\`
// this is multi-line code:
function anotherExample(firstLine, lastLine) {
if (firstLine == '\`\`\`' && lastLine == '\`\`\`') {
return multiLineCode;
}
}
\`\`\`
You can also make text **bold**... whoa!
Or _italic_.
Or... wait for it... **_both!_**
And feel free to go crazy ~~crossing stuff out~~.
There's also [links](https://www.freecodecamp.com), and
> Block Quotes!
And if you want to get really crazy, even tables:
Wild Header | Crazy Header | Another Header?
------------ | ------------- | -------------
Your content can | be here, and it | can be here....
And here. | Okay. | I think we get it.
- And of course there are lists.
- Some are bulleted.
- With different indentation levels.
- That look like this.
1. And there are numbererd lists too.
1. Use just 1s if you want!
1. And last but not least, let's not forget embedded images:
`;
const [mark, setMark] = useState(placeholder);
const { editorMax, setEditorMaxMax, previewMax, setPreviewMax } =
useGlobalContext();
const classes = editorMax
? ['editorWrap maximized', 'previewWrap hide', <CgIcons.CgMaximizeAlt />]
: previewMax
? ['editorWrap hide', 'previewWrap maximized', <CgIcons.CgMaximizeAlt />]
: ['editorWrap', 'previewWrap', <CgIcons.CgMinimizeAlt />];
const handleChange = (event) => {
setMark(event.target.value);
};
const markdownValue = marked(mark, { breaks: true });
return (
<>
<Container fluid className="p-3 mr-auto mt-4">
<div className="header">
<h1 className="text-center">Markdown Live Preview</h1>
<hr />
</div>
<Row >
<Col xs={12} className={classes[0]}>
<div className="toolbar-container">
<div className="right-div">
<h4 className="text-left"><SiIcons.SiFreecodecamp /> Editor </h4>
</div>
<div className="right-c" onClick={() => setEditorMaxMax(!editorMax)}>
{editorMax ? (
<CgIcons.CgMinimizeAlt />
) : (
<CgIcons.CgMaximizeAlt />
)}
</div>
</div>
<textarea
className="form-control p-2 mb-5"
value={mark}
id="editor"
onChange={handleChange}
/>
</Col>
<div className="converter" />
<Col xs={12} className={classes[1]}>
<Row className="toolbar-container">
<div className="right-div">
<h4 className="text-left"><SiIcons.SiFreecodecamp /> Result </h4>
</div>
<div
className="right-c" onClick={() => setPreviewMax(!previewMax)}>
{previewMax ? (
<CgIcons.CgMinimizeAlt />
) : (
<CgIcons.CgMaximizeAlt />
)}
</div>
</Row>
<div id="preview" className="preview mt-4 p-2" dangerouslySetInnerHTML={{ __html: markdownValue }}></div>
</Col>
</Row>
</Container>
</>
);
}
export default MarkDown;
| 31.351145 | 119 | 0.536645 |
10e4d0b8cb758d8db30199215479734084965b72 | 1,011 | js | JavaScript | test/spec/features/sleep/SleepSpec.js | adbre/dart380-js | 9b4f1085f77e92a00c271a7655c4ab1f314785bd | [
"MIT"
] | null | null | null | test/spec/features/sleep/SleepSpec.js | adbre/dart380-js | 9b4f1085f77e92a00c271a7655c4ab1f314785bd | [
"MIT"
] | null | null | null | test/spec/features/sleep/SleepSpec.js | adbre/dart380-js | 9b4f1085f77e92a00c271a7655c4ab1f314785bd | [
"MIT"
] | null | null | null | 'use strict';
require('../../../TestHelper');
describe("sleep", function() {
beforeEach(bootstrapDart380());
beforeEach(inject(function(mod, selfTest, eventBus) {
var isReady = false;
eventBus.on('ready', function () {
isReady = true;
});
mod.set(mod.SKYDD);
while (!isReady) {
jasmine.clock().tick(1000);
}
}));
it('should not attempt to sleep when user has exited the menu himself', inject(function (keyboard) {
// given
keyboard.trigger('4');
keyboard.trigger('SLT');
// when
// then
jasmine.clock().tick(60 * 1000);
}));
it('should not attempt to sleep when user has exited edit mode himself', inject(function (keyboard) {
// given
keyboard.trigger('4');
keyboard.trigger('ÄND');
keyboard.trigger('SLT');
keyboard.trigger('SLT');
// when
// then
jasmine.clock().tick(60 * 1000);
}));
}); | 24.658537 | 105 | 0.536103 |
10e969c89552f0d1c9b712324e0faaab7e632ec7 | 327 | js | JavaScript | src/infrastructure/sequelize/seeders/20200916101421-seed-users.js | the-vishal-kumar/express-postgres-template | 4824b2034e28c95c2508c3a564ad6d9f2aa24452 | [
"OML"
] | null | null | null | src/infrastructure/sequelize/seeders/20200916101421-seed-users.js | the-vishal-kumar/express-postgres-template | 4824b2034e28c95c2508c3a564ad6d9f2aa24452 | [
"OML"
] | null | null | null | src/infrastructure/sequelize/seeders/20200916101421-seed-users.js | the-vishal-kumar/express-postgres-template | 4824b2034e28c95c2508c3a564ad6d9f2aa24452 | [
"OML"
] | null | null | null | /**
* 20200916101421-seed-users.js
* Vishal Kumar
*/
'use strict';
const { users } = require(`./data`);
module.exports = {
up: async (queryInterface) => {
return await queryInterface.bulkInsert(`User`, users, {});
},
down: async (queryInterface) => {
return await queryInterface.bulkDelete(`User`, null, {});
}
}; | 19.235294 | 60 | 0.642202 |
10e9a5bf739062289466cd313c0a594f7394069a | 1,659 | js | JavaScript | dist/neontext.js | FaHaIk/neontext | 2583cd37bdc7d839430fdce7a582272486b5a088 | [
"MIT"
] | null | null | null | dist/neontext.js | FaHaIk/neontext | 2583cd37bdc7d839430fdce7a582272486b5a088 | [
"MIT"
] | null | null | null | dist/neontext.js | FaHaIk/neontext | 2583cd37bdc7d839430fdce7a582272486b5a088 | [
"MIT"
] | null | null | null | function n({...n}){if(n.elem)if(document.getElementById(n.elem)){n.colors=n.colors||["#ff00ff","#00ffff","#01FFC3"],n.shadowBlurRadius=n.shadowBlurRadius||5,n.random=n.random||!1,n.colorizeText=n.colorizeText||!1,n.shadowOffsetX=n.shadowOffsetX||0,n.shadowOffsetY=n.shadowOffsetY||0;var o=e(n.elem);f(n.elem),t(o,n)}else console.error(`No element with the id "${n.elem}" found.`);else console.error("No 'elem' property set in options.")}function t(n,t){for(var e=document.getElementById(t.elem),f=0;f<n.length;f++)if("\n"==n[f])e.appendChild(document.createElement("br"));else{var r=document.createElement("span");if(r.setAttribute("class","data"),r.innerText=n[f],t.random){var a=o(0,t.colors.length-1);r.style.textShadow=t.shadowOffsetX+"px "+t.shadowOffsetY+"px "+t.shadowBlurRadius+"px "+t.colors[a],t.colorizeText&&(r.style.color=t.colors[a])}e.appendChild(r)}if(!t.random)for(var p=0;p<t.colors.length;p++)for(var c=0;c<e.querySelectorAll("span:nth-of-type("+t.colors.length+"n + "+(p+1)+")").length;c++){var i=e.querySelectorAll("span:nth-of-type("+t.colors.length+"n + "+(p+1)+")")[c];i.style.textShadow=t.shadowOffsetX+"px "+t.shadowOffsetY+"px "+t.shadowBlurRadius+"px "+t.colors[p],t.colorizeText&&(i.style.color=t.colors[p])}}function o(n,t){return n=Math.ceil(n),t=Math.floor(t),Math.floor(Math.random()*(t-n+1))+n}function e(n){var t=document.getElementById(n);return Array.from(t.innerText)}function f(n){for(var t=document.getElementById(n);t.firstChild;)t.removeChild(t.firstChild)}export{t as _createSpanElements,o as _getRandomIntInclusive,f as _removeChildNodes,e as _splitElementString,n as neonify};
//# sourceMappingURL=neontext.js.map
| 553 | 1,621 | 0.731163 |
10eace1f28c5316a5e12f8c0ecc441eee86ee400 | 318 | js | JavaScript | utils/bgImages.js | chaudharyneha/udacicards | 7847000c44e4cb2b687904fcf306f163e52a3bb5 | [
"MIT"
] | null | null | null | utils/bgImages.js | chaudharyneha/udacicards | 7847000c44e4cb2b687904fcf306f163e52a3bb5 | [
"MIT"
] | null | null | null | utils/bgImages.js | chaudharyneha/udacicards | 7847000c44e4cb2b687904fcf306f163e52a3bb5 | [
"MIT"
] | null | null | null | import { Platform } from 'react-native'
export const IMAGE_RESIZE_MODE = (Platform.OS === 'ios' ? 'repeat' : 'cover')
export const backgroundImages = [
require('./../assets/backgrounds/1.png'),
require('./../assets/backgrounds/2.png')
]
export function getBgImage(index) {
return backgroundImages[index % 2]
}
| 26.5 | 77 | 0.694969 |
10ebd86ade5cab80786a5b3ce68fd071dd0e415e | 3,658 | js | JavaScript | server/controllers/authentication.js | pankaj5395/react-redux-node | d86dc30a4882f559750f1a4de99065929877acc5 | [
"Apache-2.0"
] | null | null | null | server/controllers/authentication.js | pankaj5395/react-redux-node | d86dc30a4882f559750f1a4de99065929877acc5 | [
"Apache-2.0"
] | null | null | null | server/controllers/authentication.js | pankaj5395/react-redux-node | d86dc30a4882f559750f1a4de99065929877acc5 | [
"Apache-2.0"
] | 1 | 2020-09-06T18:22:51.000Z | 2020-09-06T18:22:51.000Z | import jwt from 'jsonwebtoken';
import crypto from 'crypto';
//import User from '../models/user';
import { setUserInfo, getRole } from '../services/helpers';
import config from '../config';
import User from '../models/user';
//var User = require('../models/user');
// Generate JWT
// TO-DO Add issuer and audience
function generateToken(user) {
return jwt.sign(user, config.secret, {
expiresIn: 60810 // in seconds
});
}
//= =======================================
// Login Route
//= =======================================
exports.login = function (req, res, next) {
const userInfo = setUserInfo(req.user);
res.status(200).json({
token: `JWT ${generateToken(userInfo)}`,
user: userInfo
});
};
//= =======================================
// Registration Route
//= =======================================
exports.register = async (req, res, next) => {
// Check for registration errors
const email = req.body.email;
const firstName = req.body.firstName;
const lastName = req.body.lastName;
const password = req.body.password;
const role = req.body.role;
// Return error if no email provided
if (!email) {
return res.status(422).send({ error: 'You must enter an email address.' });
}
// Return error if full name not provided
if (!firstName || !lastName) {
return res.status(422).send({ error: 'You must enter your full name.' });
}
// Return error if no password provided
if (!password) {
return res.status(422).send({ error: 'You must enter a password.' });
}
try {
//let User = new database.User();
let user = await database.User.findOne({ where:{ email }})
console.log('user', user);
if(user){
return res.status(422).send({ error: 'That email address is already in use.' });
}
else{
const userData = {
email,
password,
firstName,
lastName,
role
};
console.log(userData);
user = await User.create(userData);
user = JSON.parse(JSON.stringify(user))
console.log(user);
const userInfo = setUserInfo(user);
res.status(201).json({
token: `JWT ${generateToken(userInfo)}`,
user: userInfo
});
}
}
catch(e){
console.log(e)
return res.status(500).send({ error: 'Server Error' });
}
};
exports.refreshToken = (req, res, next) => {
const { token } = req.body;
if (!token) {
return res.sendStatus(401);
}
console.log(token);
jwt.verify(token, config.secret, (err, user) => {
console.log(err)
if (err) {
return res.sendStatus(403);
}
const accessToken = `JWT ${generateToken(user)}`;
res.json({
accessToken
});
});
}
//= =======================================
// Authorization Middleware
//= =======================================
// Role authorization check
exports.roleAuthorization = function (requiredRole) {
return async function (req, res, next) {
const user = req.user;
console.log('i callled')
const foundUser = await database.User.findOne({where:{id:user.id}}) //, (err, foundUser) => {
if (!foundUser) {
return res.status(422).json({ error: 'No user was found.' });
//return next();
}
// If user is found, check role.
console.log(foundUser.role, await getRole(foundUser.role))
console.log(requiredRole, await getRole(requiredRole))
if (await getRole(foundUser.role) == await getRole(requiredRole)) {
return next();
}
return res.status(401).json({ error: 'You are not authorized to view this content.' });
//});
};
};
| 26.897059 | 97 | 0.564516 |
10ec4768a46630a02d3313252765bdd0fe94cacb | 208 | js | JavaScript | Client/src/actions/FinalBookButton/ACTION_FINAL_BOOK_BUTTON_RESET.js | BibhushanKarki/GlowLabs | 24bb9b07dcc6da7ffb218f2f217e5ed19ee0f92f | [
"MIT"
] | 47 | 2021-01-17T15:43:32.000Z | 2022-03-19T19:33:00.000Z | Client/src/actions/FinalBookButton/ACTION_FINAL_BOOK_BUTTON_RESET.js | brendantay/GlowLabs | 679f2a76e0a871681f7276bdcfb0c500171fb36f | [
"MIT"
] | 42 | 2020-08-09T03:41:06.000Z | 2022-03-30T14:11:23.000Z | Client/src/actions/FinalBookButton/ACTION_FINAL_BOOK_BUTTON_RESET.js | brendantay/GlowLabs | 679f2a76e0a871681f7276bdcfb0c500171fb36f | [
"MIT"
] | 26 | 2021-02-18T19:29:22.000Z | 2022-03-31T13:16:17.000Z | const FINAL_BOOK_BUTTON_RESET = "FINAL_BOOK_BUTTON_RESET";
const ACTION_FINAL_BOOK_BUTTON_RESET = () => {
return {
type: FINAL_BOOK_BUTTON_RESET
};
};
export default ACTION_FINAL_BOOK_BUTTON_RESET;
| 20.8 | 58 | 0.778846 |
10ec5f0d92b915a247030ec5785ca94ae25c485d | 1,167 | js | JavaScript | src/components/TagBlock/TagBlock.js | 337969371/ux_h5 | cdecd1189e6f0f690349c7c8c63e1bd06acbd6cc | [
"MIT"
] | null | null | null | src/components/TagBlock/TagBlock.js | 337969371/ux_h5 | cdecd1189e6f0f690349c7c8c63e1bd06acbd6cc | [
"MIT"
] | null | null | null | src/components/TagBlock/TagBlock.js | 337969371/ux_h5 | cdecd1189e6f0f690349c7c8c63e1bd06acbd6cc | [
"MIT"
] | null | null | null | import React from 'react'
import fireIcon from "../../static/icon/fire-black-icon.png";
import "./TagBlock.scss"
import PropTypes from "prop-types";
export default class TagBlock extends React.Component {
constructor(props) {
super(props)
}
getString(num){
if(num<1000){
return num.toString();
}
if(num>=1000 && num<1000000){
return (num/1000).toFixed(1)+"K+";
}
}
render() {
const {title,num} =this.props;
return (
<div className="tags-item" onClick={()=>this.props.onClick()}>
<div className="tags-item-name">
{title}
</div>
<div className="tags-item-content">
<div className="tags-item-icon">
<img src={fireIcon} alt=""/>
</div>
<div className="tags-item-num">
{this.getString(num)}
</div>
</div>
</div>
);
}
}
TagBlock.propTypes = {
title: PropTypes.string.isRequired,
num: PropTypes.number.isRequired,
} | 27.785714 | 74 | 0.484147 |
10ecdd4d5e1b796fcaeb0a9f0b3e2a4ce4b22ce3 | 1,708 | js | JavaScript | src/components/LanguageSwitch/LanguageSwitch.js | ritabur/vp-portfolio | cb9b888128c307ae2e6164ee3b0bbd08e7fe2089 | [
"MIT"
] | null | null | null | src/components/LanguageSwitch/LanguageSwitch.js | ritabur/vp-portfolio | cb9b888128c307ae2e6164ee3b0bbd08e7fe2089 | [
"MIT"
] | 3 | 2020-12-03T10:59:51.000Z | 2021-04-17T11:08:20.000Z | src/components/LanguageSwitch/LanguageSwitch.js | FlyingCarpets/vp-portfolio | cb9b888128c307ae2e6164ee3b0bbd08e7fe2089 | [
"MIT"
] | null | null | null | import * as React from 'react';
import styled from 'styled-components';
import { Box } from 'components/Box';
import { useAppContext } from 'context/AppContext';
import { languages } from 'const';
import { routeToPage } from 'utils/routing';
const StyledLanguageContainer = styled.div`
background-color: ${(props) => props.theme.colors.contentBackground};
`;
const Language = styled.div`
position: relative;
color: ${(props) => props.theme.colors.bodyPrimary};
cursor: pointer;
&:after {
content: '';
height: 1px;
width: 100%;
position: absolute;
left: 0;
right: 0;
bottom: -2px;
background-color: ${(props) => props.theme.colors.bodyPrimary};
}
${(props) =>
props.isActive &&
`
pointer-events: none;
`}
${(props) =>
!props.isActive &&
`
&:after {
content: none;
}
`}
`;
export const LanguageSwitch = ({ className }) => {
const { selectedLanguage, setLanguage } = useAppContext();
const handleClick = (language) => {
setLanguage(language);
routeToPage(language);
};
return (
<StyledLanguageContainer className={className}>
<Box py={8} pr={4} pl={8} display="inline-block">
<Language
onClick={() => handleClick(languages.en)}
isActive={selectedLanguage === languages.en}
>
{languages.en.toUpperCase()}
</Language>
</Box>
<Box py={8} pr={8} pl={4} display="inline-block">
<Language
onClick={() => handleClick(languages.lt)}
isActive={selectedLanguage === languages.lt}
>
{languages.lt.toUpperCase()}
</Language>
</Box>
</StyledLanguageContainer>
);
};
| 23.722222 | 71 | 0.595433 |
10ef3467032766fdaca58b0be7dc88352ad6497b | 491 | js | JavaScript | src/config/constants.js | ArianaHernandezVazquez/comunarr-api | 0a4d22a1b701a5bdefb30e2cff86160055ba5023 | [
"MIT"
] | null | null | null | src/config/constants.js | ArianaHernandezVazquez/comunarr-api | 0a4d22a1b701a5bdefb30e2cff86160055ba5023 | [
"MIT"
] | null | null | null | src/config/constants.js | ArianaHernandezVazquez/comunarr-api | 0a4d22a1b701a5bdefb30e2cff86160055ba5023 | [
"MIT"
] | null | null | null | module.exports = function () {
const constants = {
database: {
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_SCHEMA,
multipleStatements: true
},
directories: {
files: process.env.FILES_DIRECTORY,
tempFiles: process.env.TEMP_FILES_DIRECTORY
}
};
return constants;
}();
| 25.842105 | 55 | 0.574338 |
10efa572ae9389fe037e679eb8504e8bf8edfe34 | 28,759 | js | JavaScript | test/bin/libs/laya.particle.js | wushuning/FairyGUI-layabox | 57b7ca36c3009607472fd4e795261b3013d82b8e | [
"MIT"
] | 1 | 2019-09-21T16:24:38.000Z | 2019-09-21T16:24:38.000Z | test/bin/libs/laya.particle.js | wushuning/FairyGUI-layabox | 57b7ca36c3009607472fd4e795261b3013d82b8e | [
"MIT"
] | null | null | null | test/bin/libs/laya.particle.js | wushuning/FairyGUI-layabox | 57b7ca36c3009607472fd4e795261b3013d82b8e | [
"MIT"
] | null | null | null | (function (exports, parvs) {
'use strict';
var parvs__default = 'default' in parvs ? parvs['default'] : parvs;
class ParticleSetting {
constructor() {
this.textureName = null;
this.textureCount = 1;
this.maxPartices = 100;
this.duration = 1;
this.ageAddScale = 0;
this.emitterVelocitySensitivity = 1;
this.minStartSize = 100;
this.maxStartSize = 100;
this.minEndSize = 100;
this.maxEndSize = 100;
this.minHorizontalVelocity = 0;
this.maxHorizontalVelocity = 0;
this.minVerticalVelocity = 0;
this.maxVerticalVelocity = 0;
this.endVelocity = 1;
this.gravity = new Float32Array([0, 0, 0]);
this.minRotateSpeed = 0;
this.maxRotateSpeed = 0;
this.minStartRadius = 0;
this.maxStartRadius = 0;
this.minEndRadius = 0;
this.maxEndRadius = 0;
this.minHorizontalStartRadian = 0;
this.maxHorizontalStartRadian = 0;
this.minVerticalStartRadian = 0;
this.maxVerticalStartRadian = 0;
this.useEndRadian = true;
this.minHorizontalEndRadian = 0;
this.maxHorizontalEndRadian = 0;
this.minVerticalEndRadian = 0;
this.maxVerticalEndRadian = 0;
this.minStartColor = new Float32Array([1, 1, 1, 1]);
this.maxStartColor = new Float32Array([1, 1, 1, 1]);
this.minEndColor = new Float32Array([1, 1, 1, 1]);
this.maxEndColor = new Float32Array([1, 1, 1, 1]);
this.colorComponentInter = false;
this.disableColor = false;
this.blendState = 0;
this.emitterType = "null";
this.emissionRate = 0;
this.pointEmitterPosition = new Float32Array([0, 0, 0]);
this.pointEmitterPositionVariance = new Float32Array([0, 0, 0]);
this.pointEmitterVelocity = new Float32Array([0, 0, 0]);
this.pointEmitterVelocityAddVariance = new Float32Array([0, 0, 0]);
this.boxEmitterCenterPosition = new Float32Array([0, 0, 0]);
this.boxEmitterSize = new Float32Array([0, 0, 0]);
this.boxEmitterVelocity = new Float32Array([0, 0, 0]);
this.boxEmitterVelocityAddVariance = new Float32Array([0, 0, 0]);
this.sphereEmitterCenterPosition = new Float32Array([0, 0, 0]);
this.sphereEmitterRadius = 1;
this.sphereEmitterVelocity = 0;
this.sphereEmitterVelocityAddVariance = 0;
this.ringEmitterCenterPosition = new Float32Array([0, 0, 0]);
this.ringEmitterRadius = 30;
this.ringEmitterVelocity = 0;
this.ringEmitterVelocityAddVariance = 0;
this.ringEmitterUp = 2;
this.positionVariance = new Float32Array([0, 0, 0]);
}
static checkSetting(setting) {
var key;
for (key in ParticleSetting._defaultSetting) {
if (!(key in setting)) {
setting[key] = ParticleSetting._defaultSetting[key];
}
}
setting.endVelocity = +setting.endVelocity;
setting.gravity[0] = +setting.gravity[0];
setting.gravity[1] = +setting.gravity[1];
setting.gravity[2] = +setting.gravity[2];
}
}
ParticleSetting._defaultSetting = new ParticleSetting();
class ParticleTemplateBase {
constructor() {
}
addParticleArray(position, velocity) {
}
}
class ParticleData {
constructor() {
}
static Create(settings, position, velocity, time) {
var particleData = new ParticleData();
particleData.position = position;
parvs.MathUtil.scaleVector3(velocity, settings.emitterVelocitySensitivity, ParticleData._tempVelocity);
var horizontalVelocity = parvs.MathUtil.lerp(settings.minHorizontalVelocity, settings.maxHorizontalVelocity, Math.random());
var horizontalAngle = Math.random() * Math.PI * 2;
ParticleData._tempVelocity[0] += horizontalVelocity * Math.cos(horizontalAngle);
ParticleData._tempVelocity[2] += horizontalVelocity * Math.sin(horizontalAngle);
ParticleData._tempVelocity[1] += parvs.MathUtil.lerp(settings.minVerticalVelocity, settings.maxVerticalVelocity, Math.random());
particleData.velocity = ParticleData._tempVelocity;
particleData.startColor = ParticleData._tempStartColor;
particleData.endColor = ParticleData._tempEndColor;
var i;
if (settings.disableColor) {
for (i = 0; i < 3; i++) {
particleData.startColor[i] = 1;
particleData.endColor[i] = 1;
}
particleData.startColor[i] = parvs.MathUtil.lerp(settings.minStartColor[i], settings.maxStartColor[i], Math.random());
particleData.endColor[i] = parvs.MathUtil.lerp(settings.minEndColor[i], settings.maxEndColor[i], Math.random());
}
else {
if (settings.colorComponentInter) {
for (i = 0; i < 4; i++) {
particleData.startColor[i] = parvs.MathUtil.lerp(settings.minStartColor[i], settings.maxStartColor[i], Math.random());
particleData.endColor[i] = parvs.MathUtil.lerp(settings.minEndColor[i], settings.maxEndColor[i], Math.random());
}
}
else {
parvs.MathUtil.lerpVector4(settings.minStartColor, settings.maxStartColor, Math.random(), particleData.startColor);
parvs.MathUtil.lerpVector4(settings.minEndColor, settings.maxEndColor, Math.random(), particleData.endColor);
}
}
particleData.sizeRotation = ParticleData._tempSizeRotation;
var sizeRandom = Math.random();
particleData.sizeRotation[0] = parvs.MathUtil.lerp(settings.minStartSize, settings.maxStartSize, sizeRandom);
particleData.sizeRotation[1] = parvs.MathUtil.lerp(settings.minEndSize, settings.maxEndSize, sizeRandom);
particleData.sizeRotation[2] = parvs.MathUtil.lerp(settings.minRotateSpeed, settings.maxRotateSpeed, Math.random());
particleData.radius = ParticleData._tempRadius;
var radiusRandom = Math.random();
particleData.radius[0] = parvs.MathUtil.lerp(settings.minStartRadius, settings.maxStartRadius, radiusRandom);
particleData.radius[1] = parvs.MathUtil.lerp(settings.minEndRadius, settings.maxEndRadius, radiusRandom);
particleData.radian = ParticleData._tempRadian;
particleData.radian[0] = parvs.MathUtil.lerp(settings.minHorizontalStartRadian, settings.maxHorizontalStartRadian, Math.random());
particleData.radian[1] = parvs.MathUtil.lerp(settings.minVerticalStartRadian, settings.maxVerticalStartRadian, Math.random());
var useEndRadian = settings.useEndRadian;
particleData.radian[2] = useEndRadian ? parvs.MathUtil.lerp(settings.minHorizontalEndRadian, settings.maxHorizontalEndRadian, Math.random()) : particleData.radian[0];
particleData.radian[3] = useEndRadian ? parvs.MathUtil.lerp(settings.minVerticalEndRadian, settings.maxVerticalEndRadian, Math.random()) : particleData.radian[1];
particleData.durationAddScale = settings.ageAddScale * Math.random();
particleData.time = time;
return particleData;
}
}
ParticleData._tempVelocity = new Float32Array(3);
ParticleData._tempStartColor = new Float32Array(4);
ParticleData._tempEndColor = new Float32Array(4);
ParticleData._tempSizeRotation = new Float32Array(3);
ParticleData._tempRadius = new Float32Array(2);
ParticleData._tempRadian = new Float32Array(4);
class ParticleTemplateWebGL extends ParticleTemplateBase {
constructor(parSetting) {
super();
this._floatCountPerVertex = 29;
this._firstActiveElement = 0;
this._firstNewElement = 0;
this._firstFreeElement = 0;
this._firstRetiredElement = 0;
this._currentTime = 0;
this.settings = parSetting;
}
reUse(context, pos) {
return 0;
}
initialize() {
var floatStride = 0;
this._vertices = this._mesh._vb.getFloat32Array();
floatStride = this._mesh._stride / 4;
var bufi = 0;
var bufStart = 0;
for (var i = 0; i < this.settings.maxPartices; i++) {
var random = Math.random();
var cornerYSegement = this.settings.textureCount ? 1.0 / this.settings.textureCount : 1.0;
var cornerY;
for (cornerY = 0; cornerY < this.settings.textureCount; cornerY += cornerYSegement) {
if (random < cornerY + cornerYSegement)
break;
}
this._vertices[bufi++] = -1;
this._vertices[bufi++] = -1;
this._vertices[bufi++] = 0;
this._vertices[bufi++] = cornerY;
bufi = (bufStart += floatStride);
this._vertices[bufi++] = 1;
this._vertices[bufi++] = -1;
this._vertices[bufi++] = 1;
this._vertices[bufi++] = cornerY;
bufi = bufStart += floatStride;
this._vertices[bufi++] = 1;
this._vertices[bufi++] = 1;
this._vertices[bufi++] = 1;
this._vertices[bufi++] = cornerY + cornerYSegement;
bufi = bufStart += floatStride;
this._vertices[bufi++] = -1;
this._vertices[bufi++] = 1;
this._vertices[bufi++] = 0;
this._vertices[bufi++] = cornerY + cornerYSegement;
bufi = bufStart += floatStride;
}
}
update(elapsedTime) {
this._currentTime += elapsedTime / 1000;
this.retireActiveParticles();
this.freeRetiredParticles();
if (this._firstActiveElement == this._firstFreeElement)
this._currentTime = 0;
if (this._firstRetiredElement == this._firstActiveElement)
this._drawCounter = 0;
}
retireActiveParticles() {
const epsilon = 0.0001;
var particleDuration = this.settings.duration;
while (this._firstActiveElement != this._firstNewElement) {
var offset = this._firstActiveElement * this._floatCountPerVertex * 4;
var index = offset + 28;
var particleAge = this._currentTime - this._vertices[index];
particleAge *= (1.0 + this._vertices[offset + 27]);
if (particleAge + epsilon < particleDuration)
break;
this._vertices[index] = this._drawCounter;
this._firstActiveElement++;
if (this._firstActiveElement >= this.settings.maxPartices)
this._firstActiveElement = 0;
}
}
freeRetiredParticles() {
while (this._firstRetiredElement != this._firstActiveElement) {
var age = this._drawCounter - this._vertices[this._firstRetiredElement * this._floatCountPerVertex * 4 + 28];
if (age < 3)
break;
this._firstRetiredElement++;
if (this._firstRetiredElement >= this.settings.maxPartices)
this._firstRetiredElement = 0;
}
}
addNewParticlesToVertexBuffer() {
}
addParticleArray(position, velocity) {
var nextFreeParticle = this._firstFreeElement + 1;
if (nextFreeParticle >= this.settings.maxPartices)
nextFreeParticle = 0;
if (nextFreeParticle === this._firstRetiredElement)
return;
var particleData = ParticleData.Create(this.settings, position, velocity, this._currentTime);
var startIndex = this._firstFreeElement * this._floatCountPerVertex * 4;
for (var i = 0; i < 4; i++) {
var j, offset;
for (j = 0, offset = 4; j < 3; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.position[j];
for (j = 0, offset = 7; j < 3; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.velocity[j];
for (j = 0, offset = 10; j < 4; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.startColor[j];
for (j = 0, offset = 14; j < 4; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.endColor[j];
for (j = 0, offset = 18; j < 3; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.sizeRotation[j];
for (j = 0, offset = 21; j < 2; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.radius[j];
for (j = 0, offset = 23; j < 4; j++)
this._vertices[startIndex + i * this._floatCountPerVertex + offset + j] = particleData.radian[j];
this._vertices[startIndex + i * this._floatCountPerVertex + 27] = particleData.durationAddScale;
this._vertices[startIndex + i * this._floatCountPerVertex + 28] = particleData.time;
}
this._firstFreeElement = nextFreeParticle;
}
}
class ParticleShader extends parvs.Shader {
constructor() {
super(parvs__default, parvs__default, "ParticleShader", null, ['a_CornerTextureCoordinate', 0, 'a_Position', 1, 'a_Velocity', 2, 'a_StartColor', 3,
'a_EndColor', 4, 'a_SizeRotation', 5, 'a_Radius', 6, 'a_Radian', 7, 'a_AgeAddScale', 8, 'a_Time', 9]);
}
}
ParticleShader.vs = parvs__default;
ParticleShader.ps = parvs__default;
class ParticleShaderValue extends parvs.Value2D {
constructor() {
super(0, 0);
if (!ParticleShaderValue.pShader) {
ParticleShaderValue.pShader = new ParticleShader();
}
}
upload() {
var size = this.size;
size[0] = parvs.RenderState2D.width;
size[1] = parvs.RenderState2D.height;
this.alpha = this.ALPHA * parvs.RenderState2D.worldAlpha;
ParticleShaderValue.pShader.upload(this);
}
}
ParticleShaderValue.pShader = null;
class ParticleTemplate2D extends ParticleTemplateWebGL {
constructor(parSetting) {
super(parSetting);
this.x = 0;
this.y = 0;
this.sv = new ParticleShaderValue();
this._key = {};
var _this = this;
parvs.ILaya.loader.load(this.settings.textureName, parvs.Handler.create(null, function (texture) {
_this.texture = texture;
}));
this.sv.u_Duration = this.settings.duration;
this.sv.u_Gravity = this.settings.gravity;
this.sv.u_EndVelocity = this.settings.endVelocity;
this._blendFn = parvs.BlendMode.fns[parSetting.blendState];
this._mesh = parvs.MeshParticle2D.getAMesh(this.settings.maxPartices);
this.initialize();
}
getRenderType() { return -111; }
releaseRender() { }
addParticleArray(position, velocity) {
position[0] += this.x;
position[1] += this.y;
super.addParticleArray(position, velocity);
}
addNewParticlesToVertexBuffer() {
var _vertexBuffer2D = this._mesh._vb;
_vertexBuffer2D.clear();
_vertexBuffer2D.append(this._vertices);
var start;
if (this._firstNewElement < this._firstFreeElement) {
start = this._firstNewElement * 4 * this._floatCountPerVertex * 4;
_vertexBuffer2D.subUpload(start, start, start + (this._firstFreeElement - this._firstNewElement) * 4 * this._floatCountPerVertex * 4);
}
else {
start = this._firstNewElement * 4 * this._floatCountPerVertex * 4;
_vertexBuffer2D.subUpload(start, start, start + (this.settings.maxPartices - this._firstNewElement) * 4 * this._floatCountPerVertex * 4);
if (this._firstFreeElement > 0) {
_vertexBuffer2D.setNeedUpload();
_vertexBuffer2D.subUpload(0, 0, this._firstFreeElement * 4 * this._floatCountPerVertex * 4);
}
}
this._firstNewElement = this._firstFreeElement;
}
renderSubmit() {
if (this.texture && this.texture.getIsReady()) {
this.update(parvs.ILaya.timer._delta);
this.sv.u_CurrentTime = this._currentTime;
if (this._firstNewElement != this._firstFreeElement) {
this.addNewParticlesToVertexBuffer();
}
this.blend();
if (this._firstActiveElement != this._firstFreeElement) {
var gl = parvs.WebGLContext.mainContext;
this._mesh.useMesh(gl);
this.sv.u_texture = this.texture._getSource();
this.sv.upload();
if (this._firstActiveElement < this._firstFreeElement) {
gl.drawElements(gl.TRIANGLES, (this._firstFreeElement - this._firstActiveElement) * 6, gl.UNSIGNED_SHORT, this._firstActiveElement * 6 * 2);
}
else {
parvs.WebGLContext.mainContext.drawElements(gl.TRIANGLES, (this.settings.maxPartices - this._firstActiveElement) * 6, gl.UNSIGNED_SHORT, this._firstActiveElement * 6 * 2);
if (this._firstFreeElement > 0)
gl.drawElements(gl.TRIANGLES, this._firstFreeElement * 6, gl.UNSIGNED_SHORT, 0);
}
parvs.Stat.renderBatches++;
}
this._drawCounter++;
}
return 1;
}
updateParticleForNative() {
if (this.texture && this.texture.getIsReady()) {
this.update(parvs.ILaya.timer._delta);
this.sv.u_CurrentTime = this._currentTime;
if (this._firstNewElement != this._firstFreeElement) {
this._firstNewElement = this._firstFreeElement;
}
}
}
getMesh() {
return this._mesh;
}
getConchMesh() {
return this._conchMesh;
}
getFirstNewElement() {
return this._firstNewElement;
}
getFirstFreeElement() {
return this._firstFreeElement;
}
getFirstActiveElement() {
return this._firstActiveElement;
}
getFirstRetiredElement() {
return this._firstRetiredElement;
}
setFirstFreeElement(_value) {
this._firstFreeElement = _value;
}
setFirstNewElement(_value) {
this._firstNewElement = _value;
}
addDrawCounter() {
this._drawCounter++;
}
blend() {
if (parvs.BlendMode.activeBlendFunction !== this._blendFn) {
var gl = parvs.WebGLContext.mainContext;
gl.enable(gl.BLEND);
this._blendFn(gl);
parvs.BlendMode.activeBlendFunction = this._blendFn;
}
}
dispose() {
this._mesh.releaseMesh();
}
}
ParticleTemplate2D.activeBlendType = -1;
class EmitterBase {
constructor() {
this._frameTime = 0;
this._emissionRate = 60;
this._emissionTime = 0;
this.minEmissionTime = 1 / 60;
}
set particleTemplate(particleTemplate) {
this._particleTemplate = particleTemplate;
}
set emissionRate(_emissionRate) {
if (_emissionRate <= 0)
return;
this._emissionRate = _emissionRate;
(_emissionRate > 0) && (this.minEmissionTime = 1 / _emissionRate);
}
get emissionRate() {
return this._emissionRate;
}
start(duration = Number.MAX_VALUE) {
if (this._emissionRate != 0)
this._emissionTime = duration;
}
stop() {
this._emissionTime = 0;
}
clear() {
this._emissionTime = 0;
}
emit() {
}
advanceTime(passedTime = 1) {
this._emissionTime -= passedTime;
if (this._emissionTime < 0)
return;
this._frameTime += passedTime;
if (this._frameTime < this.minEmissionTime)
return;
while (this._frameTime > this.minEmissionTime) {
this._frameTime -= this.minEmissionTime;
this.emit();
}
}
}
class Emitter2D extends EmitterBase {
constructor(_template) {
super();
this.template = _template;
}
set template(template) {
this._particleTemplate = template;
if (!template) {
this._emitFun = null;
this.setting = null;
this._posRange = null;
}
this.setting = template.settings;
this._posRange = this.setting.positionVariance;
if (this._particleTemplate instanceof ParticleTemplate2D) {
this._emitFun = this.webGLEmit;
}
}
get template() {
return this._particleTemplate;
}
emit() {
super.emit();
if (this._emitFun != null)
this._emitFun();
}
getRandom(value) {
return (Math.random() * 2 - 1) * value;
}
webGLEmit() {
var pos = new Float32Array(3);
pos[0] = this.getRandom(this._posRange[0]);
pos[1] = this.getRandom(this._posRange[1]);
pos[2] = this.getRandom(this._posRange[2]);
var v = new Float32Array(3);
v[0] = 0;
v[1] = 0;
v[2] = 0;
this._particleTemplate.addParticleArray(pos, v);
}
canvasEmit() {
var pos = new Float32Array(3);
pos[0] = this.getRandom(this._posRange[0]);
pos[1] = this.getRandom(this._posRange[1]);
pos[2] = this.getRandom(this._posRange[2]);
var v = new Float32Array(3);
v[0] = 0;
v[1] = 0;
v[2] = 0;
this._particleTemplate.addParticleArray(pos, v);
}
}
class Particle2D extends parvs.Sprite {
constructor(setting) {
super();
this._matrix4 = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
this.autoPlay = true;
this.customRenderEnable = true;
if (setting)
this.setParticleSetting(setting);
}
set url(url) {
this.load(url);
}
load(url) {
parvs.ILaya.loader.load(url, parvs.Handler.create(this, this.setParticleSetting), null, parvs.ILaya.Loader.JSON);
}
setParticleSetting(setting) {
if (!setting)
return this.stop();
ParticleSetting.checkSetting(setting);
this.customRenderEnable = true;
this._particleTemplate = new ParticleTemplate2D(setting);
this.graphics._saveToCmd(null, parvs.DrawParticleCmd.create(this._particleTemplate));
if (!this._emitter) {
this._emitter = new Emitter2D(this._particleTemplate);
}
else {
this._emitter.template = this._particleTemplate;
}
if (this.autoPlay) {
this.emitter.start();
this.play();
}
}
get emitter() {
return this._emitter;
}
play() {
parvs.ILaya.timer.frameLoop(1, this, this._loop);
}
stop() {
parvs.ILaya.timer.clear(this, this._loop);
}
_loop() {
this.advanceTime(1 / 60);
}
advanceTime(passedTime = 1) {
if (this._canvasTemplate) {
this._canvasTemplate.advanceTime(passedTime);
}
if (this._emitter) {
this._emitter.advanceTime(passedTime);
}
}
customRender(context, x, y) {
this._matrix4[0] = context._curMat.a;
this._matrix4[1] = context._curMat.b;
this._matrix4[4] = context._curMat.c;
this._matrix4[5] = context._curMat.d;
this._matrix4[12] = context._curMat.tx;
this._matrix4[13] = context._curMat.ty;
var sv = this._particleTemplate.sv;
sv.u_mmat = this._matrix4;
if (this._canvasTemplate) {
this._canvasTemplate.render(context, x, y);
}
}
destroy(destroyChild = true) {
if (this._particleTemplate instanceof ParticleTemplate2D)
this._particleTemplate.dispose();
super.destroy(destroyChild);
}
}
parvs.ILaya.regClass(Particle2D);
class ParticleEmitter {
constructor(templet, particlesPerSecond, initialPosition) {
this._timeLeftOver = 0;
this._tempVelocity = new Float32Array([0, 0, 0]);
this._tempPosition = new Float32Array([0, 0, 0]);
this._templet = templet;
this._timeBetweenParticles = 1.0 / particlesPerSecond;
this._previousPosition = initialPosition;
}
update(elapsedTime, newPosition) {
elapsedTime = elapsedTime / 1000;
if (elapsedTime > 0) {
parvs.MathUtil.subtractVector3(newPosition, this._previousPosition, this._tempVelocity);
parvs.MathUtil.scaleVector3(this._tempVelocity, 1 / elapsedTime, this._tempVelocity);
var timeToSpend = this._timeLeftOver + elapsedTime;
var currentTime = -this._timeLeftOver;
while (timeToSpend > this._timeBetweenParticles) {
currentTime += this._timeBetweenParticles;
timeToSpend -= this._timeBetweenParticles;
parvs.MathUtil.lerpVector3(this._previousPosition, newPosition, currentTime / elapsedTime, this._tempPosition);
this._templet.addParticleArray(this._tempPosition, this._tempVelocity);
}
this._timeLeftOver = timeToSpend;
}
this._previousPosition[0] = newPosition[0];
this._previousPosition[1] = newPosition[1];
this._previousPosition[2] = newPosition[2];
}
}
exports.Emitter2D = Emitter2D;
exports.EmitterBase = EmitterBase;
exports.Particle2D = Particle2D;
exports.ParticleData = ParticleData;
exports.ParticleEmitter = ParticleEmitter;
exports.ParticleSetting = ParticleSetting;
exports.ParticleShader = ParticleShader;
exports.ParticleShaderValue = ParticleShaderValue;
exports.ParticleTemplate2D = ParticleTemplate2D;
exports.ParticleTemplateBase = ParticleTemplateBase;
exports.ParticleTemplateWebGL = ParticleTemplateWebGL;
}(window.Laya = window.Laya|| {}, Laya));
| 45.504747 | 196 | 0.552175 |
10f04baa870cb0c4bbbc36f49f222617d0f4df51 | 2,631 | js | JavaScript | app/javascript/packs/application.js | asarbu/covid-charts-ro | 8af8fb786632cfc3670caee964608818522b86cd | [
"MIT"
] | null | null | null | app/javascript/packs/application.js | asarbu/covid-charts-ro | 8af8fb786632cfc3670caee964608818522b86cd | [
"MIT"
] | 5 | 2022-02-12T02:04:02.000Z | 2022-03-31T01:52:51.000Z | app/javascript/packs/application.js | asarbu/covid-charts-ro | 8af8fb786632cfc3670caee964608818522b86cd | [
"MIT"
] | null | null | null | // This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
require("@rails/ujs").start()
require("turbolinks").start()
require("channels")
require("chartkick")
require("chart.js")
require('jquery')
require("bootstrap/js/src/collapse")
// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)
$( document ).ready(function() {
$('#county_select').change(function() {
code = this.value;
$.ajax({
url: "/county",
method: 'GET',
data: { code: code }
}).done(function(response) {
var chart = Chartkick.charts['county_chart_new_cases'];
chart.updateData(response['cases']);
if (response['details']['chart'] == undefined) {
$('.county_details')[0].classList.remove('d-block');
$('.county_details')[0].classList.add('d-none');
}
else {
$('.county_details')[0].classList.remove('d-none');
$('.county_details')[0].classList.add('d-block');
var chart = Chartkick.charts['county_chart_details'];
chart.updateData(response['details']['chart']);
$('.county_chart_details_cured')[0].innerText = 'cured: ' + response['details']['cured'];
$('.county_chart_details_deceased')[0].innerText = 'deceased: ' + response['details']['deceased'];
}
});
});
$('#county_select').ready(function() {
code = 'AB';
$.ajax({
url: "/county",
method: 'GET',
data: { code: code }
}).done(function(response) {
var chart = Chartkick.charts['county_chart_new_cases'];
chart.updateData(response['cases']);
if (response['details']['chart'] == undefined) {
$('.county_details')[0].classList.remove('d-block');
$('.county_details')[0].classList.add('d-none');
}
else {
$('.county_details')[0].classList.remove('d-none');
$('.county_details')[0].classList.add('d-block');
var chart = Chartkick.charts['county_chart_details'];
chart.updateData(response['details']['chart']);
$('.county_chart_details_cured')[0].innerText = 'cured: ' + response['details']['cured'];
$('.county_chart_details_deceased')[0].innerText = 'deceased: ' + response['details']['deceased'];
}
});
});
}); | 34.618421 | 103 | 0.646142 |
10f15897ce03ac0fc42774e906470e988f403268 | 1,746 | js | JavaScript | public/components/property/deleteOwnerRepair/deleteOwnerRepair.js | yingxx26/MicroCommunityWeb-master | 7e759c716ee1cd4f23f289e6a78c7e1e3f41ec59 | [
"Apache-2.0"
] | 1 | 2021-11-25T07:14:10.000Z | 2021-11-25T07:14:10.000Z | public/components/property/deleteOwnerRepair/deleteOwnerRepair.js | yingxx26/MicroCommunityWeb-master | 7e759c716ee1cd4f23f289e6a78c7e1e3f41ec59 | [
"Apache-2.0"
] | null | null | null | public/components/property/deleteOwnerRepair/deleteOwnerRepair.js | yingxx26/MicroCommunityWeb-master | 7e759c716ee1cd4f23f289e6a78c7e1e3f41ec59 | [
"Apache-2.0"
] | null | null | null | (function (vc, vm) {
vc.extends({
data: {
deleteOwnerRepairInfo: {}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('deleteOwnerRepair', 'openDeleteOwnerRepairModal', function (_params) {
vc.component.deleteOwnerRepairInfo = _params;
$('#deleteOwnerRepairModel').modal('show');
});
},
methods: {
deleteOwnerRepair: function () {
vc.component.deleteOwnerRepairInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.post(
'deleteOwnerRepair',
'delete',
JSON.stringify(vc.component.deleteOwnerRepairInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
//关闭model
$('#deleteOwnerRepairModel').modal('hide');
vc.emit('ownerRepairManage', 'listOwnerRepair', {});
vc.emit('repairPoolManage', 'listRepairPool', {})
vc.toast("删除成功")
}
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(json);
});
},
closeDeleteOwnerRepairModel: function () {
$('#deleteOwnerRepairModel').modal('hide');
}
}
});
})(window.vc, window.vc.component);
| 34.235294 | 102 | 0.42669 |
10f213ef2074b57e880a53d8e996fc7a966d3f35 | 5,001 | js | JavaScript | newForm.js | AlioshaRabeshko/UDapp.js | 8bbc566ad937603cf6f5c4628a8ea845ade7a019 | [
"MIT"
] | null | null | null | newForm.js | AlioshaRabeshko/UDapp.js | 8bbc566ad937603cf6f5c4628a8ea845ade7a019 | [
"MIT"
] | null | null | null | newForm.js | AlioshaRabeshko/UDapp.js | 8bbc566ad937603cf6f5c4628a8ea845ade7a019 | [
"MIT"
] | null | null | null | const Forms = require('./models/forms');
const form = JSON.stringify({
name: 'Ехокардіологічне обстеження',
count: 50,
blocks: [
{
name: 'Лівий шлуночок - порожнина',
inputs: [
{
type: 'input',
prelabel: 'ВТЛШ:',
},
{
type: 'input',
prelabel: 'КДР:',
afterlabel: 'см',
},
{
type: 'input',
prelabel: 'КСР:',
afterlabel: 'см',
},
{
type: 'input',
prelabel: 'КДО:',
afterlabel: 'мл',
},
{
type: 'input',
prelabel: 'КСО:',
afterlabel: 'мл',
},
{
type: 'input',
prelabel: 'ОУ:',
afterlabel: 'мл',
},
{
type: 'input',
prelabel: 'ФВ:',
afterlabel: '%',
},
{
type: 'input',
prelabel: 'ЧСС:',
afterlabel: '',
},
{
type: 'input',
prelabel: 'FS:',
},
{
type: 'input',
prelabel: 'Маса міокарду:',
afterlabel: 'г',
},
],
},
{
name: 'Лівий шлуночок - стінки',
inputs: [
{
type: 'input',
prelabel: 'ТМШП:',
afterlabel: 'см',
},
{
type: 'input',
prelabel: 'Кінез:',
},
{
type: 'input',
prelabel: 'ТЗС:',
afterlabel: 'см',
},
{
type: 'input',
prelabel: 'Кінез:',
},
{
type: 'input',
prelabel: 'Наявність перикардіального випоту:',
afterlabel: 'см',
radio: true,
radiolabel: 'Ні',
},
{
type: 'radio',
prelabel: 'Діастологічна дисфункція:',
values: ['>1', '<1'],
},
{
type: 'input',
prelabel: 'Атипова хорда:',
afterlabel: 'см',
radio: true,
radiolabel: 'Ні',
},
],
},
{
name: 'Мітральний клапан',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'radio',
prelabel: 'Рух',
values: ['Паралелький', 'П-подібний'],
},
{
type: 'radio',
prelabel: 'Фіброз',
values: ['Помірний', 'Виражений', 'Різкий'],
},
{
type: 'text',
prelabel: 'Кальциноз:',
},
{
type: 'text',
prelabel: 'Вегетація:',
},
{
type: 'text',
prelabel: 'Пролапс:',
},
{
type: 'text',
prelabel: 'Зворотній потік:',
},
],
},
{
name: 'Правий шлуночок',
inputs: [
{
type: 'radio',
prelabel: 'Порожнина:',
values: ['Норма', 'Збільшена'],
},
{
type: 'radio',
prelabel: 'Стінка',
values: ['Норма', 'Гіпертрофія'],
},
{
type: 'text',
prelabel: 'Скоротливість',
},
],
},
{
name: 'Трикуспідальний клапан',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'text',
prelabel: 'Фіброз',
},
{
type: 'text',
prelabel: 'Зворотній потік',
},
{
type: 'input',
prelabel: 'Градієнт регуляції',
afterlabel: 'mmHg',
},
],
},
{
name: 'Ліве передсердя',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'input',
prelabel: 'Збільшене:',
afterlabel: 'см',
radio: true,
radiolabel: 'Норма',
},
],
},
{
name: 'Праве передсердя',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'input',
prelabel: 'Збільшене:',
afterlabel: 'см',
radio: true,
radiolabel: 'Норма',
},
],
},
{
name: 'Аорта, аортальний клапан',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'radio',
prelabel: 'Фіброз',
values: ['Помірний', 'Виражений', 'Різкий'],
},
{
type: 'text',
prelabel: 'Кальциноз:',
},
{
type: 'text',
prelabel: 'Вегетація:',
},
{
type: 'text',
prelabel: 'Систологічне розкриття:',
},
{
type: 'input',
prelabel: 'Діаметр аорти:',
afterlabel: 'см',
},
{
type: 'text',
prelabel: 'Зворотній потік:',
},
{
type: 'text',
prelabel: 'Шв. кровотоку:',
},
{
type: 'input',
prelabel: 'Градієнт тиску:',
afterlabel: 'mmHg',
},
],
},
{
name: 'Клапан легеневої артерії',
inputs: [
{
type: 'radio',
prelabel: 'Норма:',
values: ['Так', 'Ні'],
},
{
type: 'radio',
prelabel: 'Фіброз',
values: ['Помірний', 'Виражений', 'Різкий'],
},
{
type: 'text',
prelabel: 'Не локується:',
},
{
type: 'radio',
prelabel: 'Гіпертензія:',
values: ['Так', 'Ні'],
},
{
type: 'text',
prelabel: 'Регургітація:',
},
{
type: 'text',
prelabel: 'Швидкість кровотоку:',
},
{
type: 'input',
prelabel: 'Градієнт тиску:',
afterlabel: 'mmHg',
},
],
},
],
});
Forms.create({
name: 'Ехокардіологічне обстеження',
form,
docxName: 'tmp.docx',
});
| 16.50495 | 52 | 0.45051 |
10f2490021d66d35382f7ea960620035abfc7193 | 471 | js | JavaScript | packages/core/src/sceneGraph/GeometryNode.js | sendevman/rctvertex | ad040179e8f24c9e328f910b666a6c66e0408401 | [
"MIT"
] | null | null | null | packages/core/src/sceneGraph/GeometryNode.js | sendevman/rctvertex | ad040179e8f24c9e328f910b666a6c66e0408401 | [
"MIT"
] | 3 | 2020-07-19T13:08:41.000Z | 2021-12-09T01:25:19.000Z | packages/core/src/sceneGraph/GeometryNode.js | sendevman/rctvertex | ad040179e8f24c9e328f910b666a6c66e0408401 | [
"MIT"
] | null | null | null | import Node from './GraphNode'
export const isGeometryNode = Symbol('isGeometryNode')
export class GeometryNode extends Node {
constructor() {
super()
}
[isGeometryNode] = true
attributes = {}
applyProps(nextprops, prevProps = {}) {
this.applyMatrixProps(nextprops, prevProps)
this.index = nextprops.index
this.attributes = nextprops.attributes
this.drawArrays = nextprops.drawArrays
this.drawElements = nextprops.drawElements
}
}
| 22.428571 | 54 | 0.717622 |
10f3daf52527be65534ba2cdc1c2554b6c562ded | 10,545 | js | JavaScript | highmaps/513423.js | lbp0200/highcharts-china-geo | a8342835f3004d257c11aab196272b449aa58899 | [
"MIT"
] | 40 | 2016-06-24T03:14:42.000Z | 2022-01-15T11:17:13.000Z | highmaps/513423.js | lbp0200/highcharts-china-geo | a8342835f3004d257c11aab196272b449aa58899 | [
"MIT"
] | null | null | null | highmaps/513423.js | lbp0200/highcharts-china-geo | a8342835f3004d257c11aab196272b449aa58899 | [
"MIT"
] | 46 | 2016-01-12T16:08:07.000Z | 2022-03-30T17:37:44.000Z | Highcharts.maps["countries/cn/513423"] = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"adcode":513423,"name":"盐源县","center":[101.508909,27.423415],"centroid":[101.460183,27.598362],"childrenNum":0,"level":"district","acroutes":[100000,510000,513400],"parent":{"adcode":513400},"longitude":101.460183,"latitude":27.598362},"geometry":{"type":"MultiPolygon","coordinates":[[[[3757,3563],[3758,3564],[3758,3564],[3758,3565],[3757,3566],[3758,3567],[3758,3567],[3758,3568],[3758,3568],[3758,3569],[3758,3570],[3758,3570],[3758,3571],[3757,3570],[3756,3570],[3755,3570],[3754,3570],[3754,3571],[3753,3571],[3752,3572],[3751,3572],[3751,3572],[3750,3572],[3749,3573],[3749,3573],[3748,3573],[3748,3573],[3747,3573],[3745,3573],[3744,3572],[3743,3572],[3743,3572],[3742,3572],[3742,3572],[3741,3571],[3740,3571],[3739,3571],[3738,3572],[3736,3572],[3736,3572],[3736,3573],[3736,3574],[3736,3575],[3734,3576],[3734,3576],[3733,3578],[3733,3579],[3733,3580],[3734,3581],[3734,3583],[3734,3583],[3732,3587],[3731,3588],[3731,3589],[3731,3589],[3732,3591],[3732,3592],[3732,3594],[3732,3596],[3730,3597],[3729,3598],[3728,3599],[3729,3599],[3730,3601],[3731,3602],[3731,3603],[3731,3604],[3731,3604],[3731,3605],[3731,3606],[3730,3606],[3729,3606],[3728,3606],[3727,3607],[3727,3608],[3727,3610],[3727,3611],[3726,3613],[3725,3614],[3724,3616],[3723,3617],[3723,3618],[3722,3619],[3721,3619],[3721,3620],[3721,3621],[3720,3623],[3719,3625],[3719,3625],[3719,3626],[3720,3627],[3720,3628],[3720,3629],[3719,3630],[3719,3632],[3718,3633],[3717,3634],[3717,3634],[3717,3635],[3715,3635],[3714,3635],[3714,3635],[3713,3635],[3712,3634],[3712,3633],[3712,3633],[3710,3632],[3709,3632],[3710,3634],[3710,3636],[3710,3637],[3710,3638],[3710,3639],[3711,3639],[3712,3641],[3712,3641],[3712,3643],[3713,3645],[3713,3647],[3712,3648],[3711,3649],[3711,3651],[3710,3652],[3709,3654],[3709,3654],[3709,3655],[3709,3656],[3708,3658],[3706,3662],[3705,3663],[3705,3664],[3704,3664],[3703,3664],[3703,3665],[3703,3666],[3703,3669],[3703,3670],[3703,3671],[3702,3670],[3701,3669],[3701,3669],[3700,3668],[3699,3668],[3698,3669],[3698,3669],[3699,3671],[3700,3671],[3700,3672],[3701,3673],[3703,3674],[3703,3675],[3702,3676],[3702,3676],[3701,3676],[3700,3676],[3699,3677],[3699,3678],[3700,3679],[3701,3679],[3702,3680],[3702,3680],[3703,3681],[3703,3681],[3702,3682],[3701,3684],[3699,3684],[3697,3685],[3695,3685],[3694,3684],[3692,3685],[3691,3685],[3691,3686],[3690,3686],[3690,3687],[3690,3689],[3690,3690],[3690,3691],[3690,3692],[3690,3693],[3690,3695],[3690,3697],[3690,3698],[3689,3700],[3687,3702],[3687,3704],[3686,3705],[3686,3705],[3685,3705],[3684,3706],[3683,3706],[3682,3707],[3682,3708],[3682,3708],[3681,3709],[3680,3709],[3680,3710],[3680,3710],[3679,3711],[3679,3711],[3679,3712],[3678,3711],[3678,3712],[3677,3712],[3677,3713],[3677,3714],[3677,3715],[3677,3716],[3677,3716],[3677,3718],[3678,3720],[3678,3721],[3678,3722],[3680,3722],[3680,3724],[3681,3724],[3681,3725],[3684,3727],[3685,3727],[3685,3728],[3686,3729],[3686,3731],[3686,3732],[3687,3734],[3687,3735],[3687,3736],[3687,3736],[3689,3735],[3690,3734],[3690,3733],[3690,3732],[3690,3731],[3691,3730],[3693,3730],[3694,3730],[3695,3731],[3696,3731],[3697,3731],[3698,3731],[3699,3731],[3699,3732],[3700,3734],[3700,3735],[3700,3736],[3701,3737],[3702,3738],[3702,3740],[3703,3740],[3703,3741],[3704,3741],[3705,3740],[3705,3739],[3706,3738],[3707,3738],[3708,3739],[3709,3739],[3710,3739],[3710,3737],[3711,3736],[3711,3736],[3710,3735],[3710,3735],[3709,3734],[3710,3732],[3710,3731],[3711,3731],[3711,3731],[3713,3732],[3713,3731],[3714,3731],[3715,3731],[3715,3731],[3716,3731],[3717,3729],[3719,3728],[3720,3726],[3720,3725],[3722,3724],[3724,3723],[3725,3723],[3728,3721],[3729,3719],[3731,3717],[3733,3715],[3733,3715],[3734,3715],[3737,3715],[3740,3713],[3741,3711],[3743,3709],[3745,3708],[3747,3706],[3748,3705],[3748,3704],[3750,3702],[3751,3701],[3751,3700],[3752,3700],[3752,3700],[3754,3701],[3755,3701],[3756,3699],[3757,3699],[3758,3698],[3758,3697],[3759,3697],[3761,3697],[3763,3696],[3764,3692],[3766,3692],[3768,3692],[3769,3691],[3769,3690],[3769,3688],[3769,3688],[3768,3688],[3771,3684],[3772,3681],[3772,3679],[3773,3676],[3774,3676],[3775,3676],[3777,3678],[3778,3678],[3781,3678],[3782,3680],[3785,3684],[3786,3684],[3788,3683],[3789,3683],[3791,3682],[3792,3683],[3793,3684],[3795,3685],[3797,3687],[3800,3688],[3801,3689],[3801,3691],[3802,3693],[3802,3695],[3804,3697],[3806,3698],[3806,3698],[3807,3698],[3808,3697],[3808,3696],[3809,3695],[3810,3693],[3811,3691],[3812,3691],[3812,3691],[3813,3691],[3813,3692],[3814,3692],[3814,3692],[3815,3691],[3815,3691],[3817,3691],[3817,3692],[3818,3693],[3820,3695],[3821,3696],[3822,3696],[3823,3697],[3823,3697],[3824,3699],[3824,3700],[3824,3700],[3823,3701],[3822,3703],[3821,3705],[3822,3708],[3822,3711],[3822,3714],[3821,3716],[3820,3718],[3820,3719],[3819,3719],[3816,3721],[3816,3721],[3815,3721],[3814,3720],[3814,3720],[3813,3721],[3813,3723],[3813,3724],[3813,3725],[3813,3725],[3814,3725],[3815,3724],[3816,3725],[3816,3725],[3818,3727],[3819,3727],[3821,3726],[3822,3727],[3823,3727],[3824,3727],[3824,3728],[3824,3731],[3824,3733],[3824,3734],[3825,3734],[3828,3734],[3831,3735],[3832,3735],[3833,3737],[3834,3738],[3836,3739],[3839,3740],[3839,3740],[3839,3741],[3839,3742],[3836,3744],[3836,3745],[3836,3745],[3837,3746],[3837,3747],[3837,3748],[3836,3751],[3836,3752],[3837,3755],[3841,3756],[3842,3756],[3842,3757],[3844,3758],[3844,3759],[3844,3760],[3844,3761],[3844,3762],[3844,3762],[3844,3763],[3846,3764],[3846,3764],[3848,3765],[3849,3766],[3850,3769],[3851,3770],[3852,3770],[3853,3771],[3854,3771],[3857,3771],[3857,3771],[3858,3773],[3858,3773],[3861,3775],[3863,3776],[3865,3777],[3865,3778],[3866,3780],[3868,3783],[3869,3784],[3869,3786],[3870,3788],[3870,3790],[3871,3796],[3872,3798],[3872,3799],[3872,3802],[3872,3803],[3872,3803],[3874,3803],[3875,3802],[3877,3800],[3878,3798],[3880,3797],[3882,3796],[3884,3796],[3885,3795],[3886,3794],[3886,3790],[3885,3787],[3884,3785],[3885,3783],[3886,3782],[3886,3779],[3885,3775],[3886,3773],[3888,3772],[3890,3771],[3893,3771],[3895,3770],[3899,3770],[3899,3769],[3899,3764],[3898,3761],[3898,3760],[3896,3757],[3894,3755],[3893,3753],[3893,3752],[3893,3751],[3894,3749],[3895,3748],[3895,3746],[3894,3744],[3894,3744],[3894,3743],[3897,3742],[3902,3741],[3905,3741],[3908,3742],[3909,3741],[3910,3740],[3910,3740],[3910,3738],[3908,3737],[3906,3736],[3905,3734],[3904,3733],[3903,3731],[3904,3729],[3904,3727],[3907,3725],[3909,3725],[3911,3724],[3911,3722],[3912,3721],[3911,3720],[3910,3717],[3908,3716],[3906,3715],[3905,3714],[3904,3712],[3905,3710],[3912,3708],[3913,3707],[3914,3705],[3912,3702],[3911,3700],[3911,3698],[3913,3698],[3916,3697],[3916,3696],[3916,3694],[3916,3692],[3917,3691],[3918,3689],[3919,3687],[3918,3687],[3919,3684],[3920,3681],[3920,3679],[3921,3679],[3921,3678],[3923,3679],[3924,3679],[3926,3679],[3927,3678],[3930,3677],[3931,3677],[3932,3676],[3933,3675],[3934,3675],[3935,3675],[3936,3677],[3937,3678],[3938,3677],[3939,3677],[3942,3676],[3942,3676],[3943,3674],[3944,3673],[3943,3671],[3943,3670],[3942,3670],[3940,3670],[3939,3670],[3938,3670],[3936,3669],[3935,3668],[3935,3667],[3935,3666],[3935,3665],[3933,3657],[3932,3650],[3931,3648],[3929,3647],[3929,3645],[3931,3643],[3932,3642],[3931,3640],[3928,3635],[3928,3632],[3927,3630],[3927,3628],[3925,3625],[3925,3624],[3924,3619],[3923,3618],[3923,3616],[3922,3614],[3922,3613],[3922,3611],[3923,3609],[3923,3607],[3922,3606],[3922,3605],[3921,3604],[3922,3599],[3920,3594],[3919,3592],[3918,3591],[3917,3590],[3916,3589],[3915,3587],[3914,3585],[3913,3583],[3911,3582],[3909,3580],[3908,3580],[3906,3578],[3906,3577],[3905,3575],[3905,3574],[3903,3573],[3902,3572],[3902,3571],[3902,3569],[3902,3568],[3902,3567],[3900,3566],[3900,3565],[3901,3563],[3901,3562],[3900,3557],[3899,3557],[3897,3557],[3897,3556],[3897,3555],[3897,3553],[3898,3553],[3899,3553],[3900,3552],[3898,3548],[3898,3546],[3898,3545],[3897,3544],[3892,3544],[3890,3543],[3890,3543],[3888,3541],[3886,3539],[3884,3542],[3882,3543],[3880,3544],[3877,3546],[3875,3546],[3875,3546],[3874,3546],[3873,3545],[3872,3545],[3872,3545],[3871,3545],[3869,3546],[3869,3546],[3868,3547],[3867,3547],[3866,3546],[3865,3546],[3862,3548],[3862,3549],[3861,3550],[3860,3551],[3860,3552],[3859,3554],[3858,3556],[3857,3558],[3857,3559],[3855,3563],[3855,3564],[3855,3565],[3854,3566],[3854,3566],[3854,3567],[3855,3568],[3855,3569],[3855,3571],[3854,3572],[3854,3573],[3856,3575],[3856,3576],[3856,3577],[3857,3578],[3857,3578],[3858,3579],[3858,3581],[3859,3583],[3859,3584],[3858,3585],[3858,3586],[3858,3587],[3858,3588],[3858,3589],[3857,3589],[3856,3588],[3855,3589],[3856,3589],[3856,3590],[3855,3591],[3854,3592],[3853,3592],[3853,3593],[3854,3594],[3854,3595],[3853,3595],[3851,3595],[3851,3595],[3850,3594],[3849,3594],[3848,3595],[3846,3595],[3845,3595],[3843,3594],[3843,3593],[3843,3592],[3842,3592],[3842,3591],[3841,3591],[3841,3590],[3839,3587],[3838,3586],[3836,3585],[3836,3585],[3835,3583],[3834,3583],[3834,3582],[3832,3582],[3831,3582],[3830,3581],[3830,3580],[3830,3579],[3830,3578],[3829,3577],[3828,3574],[3828,3573],[3828,3572],[3828,3572],[3826,3572],[3824,3572],[3823,3572],[3822,3573],[3822,3574],[3821,3574],[3820,3574],[3819,3575],[3818,3574],[3815,3573],[3810,3571],[3809,3570],[3808,3570],[3808,3569],[3809,3568],[3809,3567],[3810,3566],[3810,3564],[3808,3563],[3808,3562],[3807,3562],[3807,3561],[3807,3559],[3807,3558],[3806,3557],[3805,3557],[3804,3556],[3803,3556],[3802,3555],[3801,3555],[3801,3557],[3801,3557],[3800,3558],[3799,3560],[3797,3561],[3797,3562],[3796,3564],[3795,3564],[3794,3564],[3792,3563],[3791,3563],[3790,3564],[3789,3565],[3789,3567],[3788,3567],[3787,3568],[3787,3568],[3786,3567],[3785,3567],[3784,3567],[3783,3566],[3782,3567],[3781,3568],[3780,3568],[3780,3568],[3779,3567],[3776,3567],[3775,3567],[3775,3566],[3773,3565],[3772,3565],[3771,3564],[3769,3565],[3768,3566],[3768,3566],[3767,3566],[3766,3565],[3766,3565],[3765,3566],[3764,3566],[3763,3565],[3761,3564],[3760,3563],[3759,3563],[3757,3563]]]]}}],"UTF8Encoding":true,"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:3415"}},"hc-transform":{"default":{"crs":"+proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0=500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs","scale":0.000129831107685,"jsonres":15.5,"jsonmarginX":-999,"jsonmarginY":9851,"xoffset":-3139937.49309,"yoffset":4358972.7486}}} | 10,545 | 10,545 | 0.669322 |
10f4661bfa948bca3a1979da8599508d11927e96 | 3,677 | js | JavaScript | src/a-button.js | justinslud/aframe-cubemenu | fc957e9cdd839cc83541f1b9dec3f4ebb25a88f7 | [
"MIT"
] | 2 | 2019-08-14T13:03:01.000Z | 2019-09-18T08:27:45.000Z | src/a-button.js | justinslud/aframe-cubemenu | fc957e9cdd839cc83541f1b9dec3f4ebb25a88f7 | [
"MIT"
] | 1 | 2020-11-21T07:51:37.000Z | 2020-11-21T07:51:37.000Z | src/a-button.js | justinslud/aframe-cubemenu | fc957e9cdd839cc83541f1b9dec3f4ebb25a88f7 | [
"MIT"
] | 1 | 2019-09-22T02:27:46.000Z | 2019-09-22T02:27:46.000Z | AFRAME.registerComponent('button', {
schema: {
type: {type: 'string', default: 'toggle'},
hovercolor: {type: 'string'},
color: {type: 'string', default: 'black'},
onclick: {type: 'string'},
height: {type: 'number'},
width: {type: 'number'},
opacity: {type: 'string'},
distance: {type: 'string'},
},
init: function() {
var el = this.el;
var parent = el.parentElement;
var grandparent = parent.parentNode;
var data = this.data;
var height = grandparent.getAttribute('height') * data.height || data.height;
//var width = data.width;
var face = parent.getAttribute('face');
var text = data.text;
var color = data.color;
var opacity = data.opacity;
var distance = data.distance || parent.getAttribute('distance') || grandparent.getAttribute('height') / 10;
var pos = grandparent.getAttribute('position');
var depth = grandparent.getAttribute('depth');
var height = grandparent.getAttribute('height');
var width = grandparent.getAttribute('width');
var names = ['right', 'left', 'top', 'bottom', 'back', 'front'];
var faceNames = [{
face: 'right',
height: height,
width: depth,
},
{
face: 'left',
height: height,
width: depth,
},
{
face: 'top',
height: depth,
width: width,
},
{
face: 'bottom',
height: depth,
width: width,
},
{
face: 'back',
height: height,
width: width,
},
{
face: 'front',
height: height,
width: width,
}];
var buttons = Array.from(parent.querySelectorAll('a-button'));
var buttonsCount = buttons.length;
var i = buttons.indexOf(el) + 1;
var faceWidth = data.width || faceNames[names.indexOf(face)].width;
var faceHeight = data.height || faceNames[names.indexOf(face)].height;
var margin = parent.getAttribute('margin') || height / 20;
var buttonHeight = (faceHeight - (buttonsCount + 1 ) * margin) / buttonsCount //.8 * faceHeight / buttonsCount;
var ypos = (faceHeight/2) - (i*(margin + buttonHeight) - buttonHeight/2);
var buttonWidth = .8 * faceWidth;
console.log(ypos);
var geomText = 'primitive: plane; height: '+buttonHeight+'; width: '+buttonWidth;
var matText = 'color: '+color+'; opacity: '+opacity;
el.setAttribute('material', matText);
el.setAttribute('geometry', geomText);
el.setAttribute('position', {x: 0, y: ypos, z: distance});
el.addEventListener('mouseenter' || 'raycaster-intersected', function startHover() {
var hovercolor = data.hovercolor;
el.setAttribute('material', 'color: '+ hovercolor);
});
el.addEventListener('mouseleave' || 'raycaster-intersection-cleared', function endHover() {
var color = data.color;
el.setAttribute('material', 'color', color);
});
//something for if button is toggle to change color on click
el.addEventListener('click' || 'triggerdown', function click(evt) {
var onclick = data.onclick;
if (typeof onclick === "function") onclick(evt);
});
}
});
AFRAME.registerPrimitive('a-button', {
defaultComponents: {
'button': {},
},
mappings: {
type: 'button.type',
hovercolor: 'button.hovercolor',
color: 'button.color',
opacity: 'button.opacity',
height: 'button.height',
width: 'button.width',
distance: 'button.distance',
onclick: 'button.onclick',
}
});
| 31.698276 | 116 | 0.574381 |
10f47969188980af549929025eaae1a7aa612535 | 2,571 | js | JavaScript | src/pages/Home/index.js | SafraPC/safrest | 3078398777ee7cf98d280d1ce771a000a174d1f8 | [
"MIT"
] | 1 | 2021-05-17T17:18:50.000Z | 2021-05-17T17:18:50.000Z | src/pages/Home/index.js | SafraPC/safrest | 3078398777ee7cf98d280d1ce771a000a174d1f8 | [
"MIT"
] | null | null | null | src/pages/Home/index.js | SafraPC/safrest | 3078398777ee7cf98d280d1ce771a000a174d1f8 | [
"MIT"
] | null | null | null | import React from "react";
import {Header} from "../../components/Header";
import { Apresentation, Page, ScreenView } from "../../styles/default";
import {Footer} from "../../components/Footer";
import HomeCarousel from "./carousel";
import { Content } from "./styles.js";
import CardComum from "../../components/CardComum";
//Import images for cards
import workTogether from "../../assets/svgs/workTogether.svg";
import relasionship from '../../assets/svgs/relasionship.svg'
import welcome from '../../assets/svgs/welcome.svg'
import i18n from "../../services/i18next";
function Home() {
return (
<Page>
<Header />
<ScreenView>
<Apresentation>
<label>{i18n.t('pageHome.homeHeader.homeWelcome.text')}</label>
<hr></hr>
<span>
{i18n.t('pageHome.homeHeader.homeSubwelcome.text')}
</span>
<ul>
<li>{i18n.t('pageHome.homeHeader.homeList.text')}</li>
<li>{i18n.t('pageHome.homeHeader.homeList.text2')}</li>
<li>{i18n.t('pageHome.homeHeader.homeList.text3')}</li>
<li>{i18n.t('pageHome.homeHeader.homeList.text4')}</li>
</ul>
</Apresentation>
<HomeCarousel />
<br></br>
<Apresentation>
<label>{i18n.t('pageHome.homeContent.homeWelcome.text')}</label>
<hr></hr>
<span>{i18n.t('pageHome.homeContent.subWelcome.text')}
</span>
<span>{i18n.t('pageHome.homeContent.subWelcome.text2')}
</span>
</Apresentation>
<Content>
<CardComum
image={welcome}
link="/"
title={i18n.t('pageHome.homeContent.cards.card.title')}
text={i18n.t('pageHome.homeContent.cards.card.text')}
color="var(--color-hover-blue)"
fontColor="white"
/>
<CardComum
link="/contact"
image={relasionship}
title={i18n.t('pageHome.homeContent.cards.card2.title')}
text={i18n.t('pageHome.homeContent.cards.card2.text')}
color="var(--color-soft-green)"
fontColor="white"
/>
<CardComum
link="/work_with_us"
image={workTogether}
title={i18n.t('pageHome.homeContent.cards.card3.title')}
text={i18n.t('pageHome.homeContent.cards.card3.text')}
color="var(--color-blackPurple)"
fontColor="white"
/>
</Content>
</ScreenView>
<Footer />
</Page>
);
}
export default Home;
| 33.38961 | 74 | 0.561649 |
10f4d0b740fc2820f77f1563d370461e8012ab9a | 343 | js | JavaScript | static/script.js | simonknowsstuff/salsa | 63405c5589fe84522ae94f906223ef30ff2790ac | [
"MIT"
] | 2 | 2021-10-30T07:17:02.000Z | 2021-10-30T17:06:51.000Z | static/script.js | simonknowsstuff/salsa | 63405c5589fe84522ae94f906223ef30ff2790ac | [
"MIT"
] | null | null | null | static/script.js | simonknowsstuff/salsa | 63405c5589fe84522ae94f906223ef30ff2790ac | [
"MIT"
] | null | null | null |
function open_form() {
document.getElementById('form_container').style.display = "flex";
document.getElementById('confirm_title').value = document.getElementById('portfolio_title').value;
window.scrollTo({ top: 0, behavior: 'smooth' });
}
function close_form() {
document.getElementById('form_container').style.display = "none";
}
| 31.181818 | 100 | 0.737609 |
10f4d78f243468f3ae27b19872afde1b8c09cbb5 | 1,033 | js | JavaScript | lib/scopes.js | ChaosGroup/dat | b2a4d5de86eb053f1fc4c0ea36bd317f6c3666a0 | [
"MIT"
] | 2 | 2015-06-11T12:41:45.000Z | 2015-06-11T16:37:55.000Z | lib/scopes.js | ChaosGroup/sequelize-accesstree | b2a4d5de86eb053f1fc4c0ea36bd317f6c3666a0 | [
"MIT"
] | null | null | null | lib/scopes.js | ChaosGroup/sequelize-accesstree | b2a4d5de86eb053f1fc4c0ea36bd317f6c3666a0 | [
"MIT"
] | null | null | null | 'use strict';
module.exports = function (sequelize, getRefModel, Grant) {
const scopes = {};
scopes.withgrants = function () {
return {
include: [
{
model: Grant,
as: Grant.options.name.plural
}
]
};
};
/**
* Returns full subtree with grants populated
*
* @returns {*}
*/
scopes.fullChildTree = function () {
return {
include: [
{
model: Grant,
as: Grant.options.name.plural
}, {
model: getRefModel(),
as: 'descendents',
hierarchy: true,
include: [
{
model: Grant,
as: Grant.options.name.plural
}
]
}
]
};
};
/**
* Returns full subtree with grants populated
*
* @returns {*}
*/
scopes.fullChildren = function () {
return {
include: [
{
model: Grant,
as: Grant.options.name.plural
}, {
model: getRefModel(),
as: 'children',
include: [
{
model: Grant,
as: Grant.options.name.plural
}
]
}
]
};
};
return scopes;
};
| 14.549296 | 59 | 0.516941 |
10f4ec6a399b8437252e4d5e24b28e02736bb09b | 16,288 | js | JavaScript | src/screens/Tabs/GeofenceTab/GeofenceTab.js | pxuanbach/Run-For-Your-Life | cae7a196a62a32eefccaf39750607c4e8a490c4c | [
"Apache-2.0"
] | 1 | 2022-02-26T03:08:42.000Z | 2022-02-26T03:08:42.000Z | src/screens/Tabs/GeofenceTab/GeofenceTab.js | pxuanbach/Run-For-Your-Life | cae7a196a62a32eefccaf39750607c4e8a490c4c | [
"Apache-2.0"
] | null | null | null | src/screens/Tabs/GeofenceTab/GeofenceTab.js | pxuanbach/Run-For-Your-Life | cae7a196a62a32eefccaf39750607c4e8a490c4c | [
"Apache-2.0"
] | null | null | null | import React from "react";
import { StyleSheet, View, Text, TouchableOpacity, AsyncStorage, Alert } from "react-native";
import MapView, { Marker, Polyline, PROVIDER_GOOGLE } from "react-native-maps";
import { NavigationEvents } from 'react-navigation';
import haversine from "haversine";
import moment from 'moment';
import { FontAwesome5, FontAwesome, MaterialIcons, Entypo } from '@expo/vector-icons';
import {Picker} from '@react-native-picker/picker';
import * as Location from 'expo-location';
import * as TaskManager from 'expo-task-manager';
import { EventEmitter } from 'fbemitter';
import Constants from "../../../utilities/Constants";
const STORAGE_KEY = 'expo-home-locations';
const LOCATION_UPDATES_TASK = 'background-location-task';
const LATITUDE_DELTA = 0.001;
const LONGTITUDE_DELTA = 0.001;
const locationEventsEmitter = new EventEmitter();
export default class GeofenceTab extends React.Component {
static navigationOptions = {
title: 'Activity',
headerLeft: () => null,
headerTintColor: Constants.COLOR.white,
headerStyle: {
backgroundColor: Constants.COLOR.green,
},
headerTitleStyle: {
alignSelf: 'center',
},
};
constructor(props) {
super(props);
this.state = {
// Activity
routes: [],
markerOnRoute: [],
// Coordinate
currentRoute: [],
prevLatLng: null,
coordinate: null,
// Data
avgPace: 0,
distance: 0,
distanceMarker: 0,
time: 0,
// Picker
selectedActivity: 'running',
// Timer
start: 0,
now: 0,
laps: [],
// Controller
statement: "isNotActive",
showRecordBox: false,
region: null,
};
}
componentWillUnmount = async () => {
await AsyncStorage.removeItem(STORAGE_KEY);
if (this.eventSubscription) {
this.eventSubscription.remove();
}
this.stopLocationUpdates();
clearInterval(this.timer);
}
// Tracking
didFocus = async () => {
this.resetActivity();
const isTracking = await Location.hasStartedLocationUpdatesAsync(LOCATION_UPDATES_TASK);
console.log('Is tracking? ', isTracking);
if (isTracking == true) {
this.stopLocationUpdates();
}
this.startLocationUpdates();
this.eventSubscription = locationEventsEmitter.addListener('update', locations => {
this.setState({
coordinate: locations[locations.length-1],
region: {
latitude: locations[locations.length-1].latitude,
longitude: locations[locations.length-1].longitude,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGTITUDE_DELTA,
},
})
if (this.state.statement == "isActive") {
this.updateCoordinates(locations);
this.addMarker();
}
else {
this.setState({
prevLatLng: locations[locations.length-1],
})
this.clearItem();
}
});
}
clearItem = async () => {
await AsyncStorage.removeItem(STORAGE_KEY);
}
async startLocationUpdates() {
const { status } = await Location.requestBackgroundPermissionsAsync();
if (status !== 'granted') {
console.log('Background permissions to access location was denied!');
}
await Location.startLocationUpdatesAsync(LOCATION_UPDATES_TASK, {
accuracy: Location.Accuracy.High,
timeInterval: 1000,
distanceInterval: 1,
});
console.log('[GeofenceTab] Call func startLocationUpdates');
}
async stopLocationUpdates() {
console.log('[GeofenceTab] Call func stopLocationUpdates');
await Location.stopLocationUpdatesAsync(LOCATION_UPDATES_TASK);
}
resetActivity = async () => {
await AsyncStorage.setItem(STORAGE_KEY, JSON.stringify([]));
this.setState({
routes: [],
markerOnRoute: [],
currentRoute: [],
// Data
avgPace: 0,
distance: 0,
distanceMarker: 0,
time: 0,
// Control
statement: "isNotActive",
showRecordBox: false,
});
this.resetTimer();
}
// Handling coordinates
updateCoordinates = (locations) => {
const { distance, distanceMarker } = this.state;
const { laps, now, start } = this.state;
let time = moment.duration(laps.reduce((total, curr) => total + curr, 0) + now - start).asMinutes();
this.setState({
time: time,
currentRoute: locations,
coordinate: locations[locations.length-1],
distance: distance + this.calcDistance(locations[locations.length-1]),
distanceMarker: distanceMarker + this.calcDistance(locations[locations.length-1]),
prevLatLng: locations[locations.length-1],
});
if (locations[locations.length-1].speed != 0) {
this.setState({avgPace: this.calcAVGPage(locations[locations.length-1])});
}
}
calcDistance = newLatLng => {
const { prevLatLng } = this.state;
return haversine(prevLatLng, newLatLng) || 0;
};
calcAVGPage = (coord) => {
const { avgPace } = this.state;
const currentPace = 1000 / 60 / coord.speed * 1.0438;
if (avgPace == 0) {
return currentPace;
}
else {
return (avgPace + currentPace) / 2;
}
}
addMarker = () => {
const { markerOnRoute, distanceMarker, coordinate } = this.state;
if (distanceMarker >= 0.5) {
markerOnRoute.push(coordinate);
this.setState({
markerOnRoute: markerOnRoute,
distanceMarker: 0,
});
}
}
// Handle timer
startTimer = () => {
const now = new Date().getTime()
this.setState({
start: now,
now,
laps: [0],
})
this.timer = setInterval(() => {
this.setState({ now: new Date().getTime() })
}, 100)
}
stopTimer = () => {
clearInterval(this.timer)
const { laps, now, start } = this.state
const [firstLap, ...other] = laps
this.setState({
time: moment.duration(laps.reduce((total, curr) => total + curr, 0) + now - start).asMinutes(),
laps: [firstLap + now - start, ...other],
start: 0,
now: 0,
})
}
resetTimer = () => {
this.setState({
laps: [],
start: 0,
now: 0,
})
}
resumeTimer = () => {
const now = new Date().getTime()
this.setState({
start: now,
now,
})
this.timer = setInterval(() => {
this.setState({ now: new Date().getTime() })
}, 100)
}
// Controller
onPress_btnStart = () => {
this.setState({
statement: "isActive",
showRecordBox: true,
});
this.startTimer();
}
onPress_btnPause = () => {
this.setState({ statement: "isPaused" });
const { currentRoute, routes } = this.state;
routes.push(currentRoute);
this.setState({
routes: routes,
currentRoute: [],
});
this.stopTimer();
}
onPress_btnResume = async () => {
await AsyncStorage.removeItem(STORAGE_KEY);
this.setState({
statement: "isActive",
});
this.resumeTimer();
}
onPress_btnFinish = () => {
if (this.state.distance > 0 && this.state.routes.length != 0 && this.state.avgPace != 0) {
this.props.navigation.navigate('SaveActivityScreen', {
selectedActivity: this.state.selectedActivity,
distance: this.state.distance,
avgPace: this.state.avgPace,
time: this.state.time,
routes: this.state.routes,
markerOnRoute: this.state.markerOnRoute,
});
}
else {
Alert.alert(
"Not moving yet?",
"App needs a longer activity to upload and analyze. Please continue or start over.",
[
{
text: "Discard",
onPress: () => {
this.resetActivity();
},
},
{
text: "Resume",
}
]
)
}
}
onPress_btnLocate = async () => {
const { coords } = await Location.getCurrentPositionAsync();
this.setState({
region: {
latitude: coords.latitude,
longitude: coords.longitude,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGTITUDE_DELTA,
}
})
}
onPress_btnShowRecordBox = () => {
if (this.state.showRecordBox == false) {
this.setState({ showRecordBox: true });
}
else {
this.setState({ showRecordBox: false });
}
}
// Render
renderButton() {
const { statement } = this.state;
switch (statement) {
case "isNotActive":
return (
<TouchableOpacity
style={[styles.button, { backgroundColor: "green" }]}
onPress={this.onPress_btnStart}>
<Text style={styles.buttonTitle}>
START
</Text>
</TouchableOpacity>
)
case "isActive":
return (
<TouchableOpacity
style={[styles.button, { backgroundColor: "green" }]}
onPress={this.onPress_btnPause}>
<Text style={styles.buttonTitle}>
PAUSE
</Text>
</TouchableOpacity>
)
case "isPaused":
return (
<React.Fragment>
<TouchableOpacity
style={[styles.button, {
backgroundColor: "white",
borderColor: "green",
borderWidth: 1,
}]}
onPress={this.onPress_btnResume}>
<Text style={[styles.buttonTitle, { color: "green" }]}>
RESUME
</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { backgroundColor: "green" }]}
onPress={this.onPress_btnFinish}>
<Text style={styles.buttonTitle}>
FINISH
</Text>
</TouchableOpacity>
</React.Fragment>
)
default:
break;
}
}
render() {
const { now, start, laps } = this.state;
const timer = now - start;
if (!this.state.region) {
return <NavigationEvents onDidFocus={this.didFocus} />;
}
return (
<View style={styles.container}>
<View style={styles.containerMap}>
<Map
region={this.state.region}
routes={this.state.routes}
currentRoute={this.state.currentRoute}
coordinate={this.state.coordinate}
markerOnRoute={this.state.markerOnRoute} />
{
this.state.showRecordBox ? (
<View style={styles.recordBox}>
<View style={{
width: '100%',
alignItems: "center",
}}>
<Text style={styles.itemTitle}>TIME</Text>
<Timer
interval={laps.reduce((total, curr) => total + curr, 0) + timer}
style={styles.itemContent} />
</View >
<View style={styles.item}>
<Text style={styles.itemTitle}>DISTANCE (km)</Text>
<Text style={styles.itemContent}>
{parseFloat(this.state.distance).toFixed(2)}
</Text>
</View>
<View style={styles.item}>
<Text style={styles.itemTitle}>AVG PACE (/km)</Text>
<Text style={styles.itemContent}>
{parseFloat(this.state.avgPace).toFixed(2)}
</Text>
</View>
</View>
) : null
}
</View>
<View style={{width: '100%', backgroundColor: 'green'}}>
<Picker
mode={'dropdown'}
style={{width:'100%', height: 40, backgroundColor: 'transparent', color: 'white'}}
selectedValue={this.state.selectedActivity}
onValueChange={(itemValue) => this.setState({selectedActivity: itemValue})}>
<Picker.Item label='Running' value='running'/>
<Picker.Item label='Bicycling' value='bicycling'/>
</Picker>
</View>
<View style={styles.buttonRow}>
<TouchableOpacity
style={[styles.button,
{
borderWidth: 1,
borderColor: 'green',
backgroundColor: 'white',
width: 40,
height: 40,
}]}
onPress={this.onPress_btnShowRecordBox}>
{
this.state.showRecordBox ? (
<Entypo name="eye-with-line" size={20} color="green" />
) : (
<Entypo name="eye" size={20} color="green" />
)
}
</TouchableOpacity>
{this.renderButton()}
<TouchableOpacity
style={[styles.button,
{
backgroundColor: "green",
width: 40,
height: 40,
}]}
onPress={this.onPress_btnLocate}>
<MaterialIcons name="my-location" size={20} color="white" />
</TouchableOpacity>
</View>
</View>
);
}
}
const Map = React.memo(props => {
return (
<MapView
style={styles.map}
provider={PROVIDER_GOOGLE}
showUserLocation
followUserLocation
loadingEnabled
region={props.region}>
{
props.routes.map((route, index) => {
return (
<Polyline
key={index}
coordinates={route}
strokeWidth={6}
strokeColor='green' />
)
})
}
<Polyline
coordinates={props.currentRoute}
strokeWidth={6}
strokeColor='green' />
{
props.markerOnRoute.map((marker, index) => {
return (
<Marker
key={index}
coordinate={marker}
anchor={{ x: 0.5, y: 0.5 }}>
<FontAwesome name="check-circle" size={16} color="gold" />
</Marker>
)
})
}
<Marker
coordinate={props.coordinate}>
<FontAwesome5 name="map-marker-alt" size={24} color="gold" />
</Marker>
</MapView>
)
})
function Timer({ interval, style }) {
const pad = (n) => n < 10 ? '0' + n : n;
const duration = moment.duration(interval);
return (
<Text style={style}>{duration.hours()}:{pad(duration.minutes())}:{pad(duration.seconds())}</Text>
)
}
async function getSavedLocations() {
try {
const item = await AsyncStorage.getItem(STORAGE_KEY);
return item ? JSON.parse(item) : [];
} catch (e) {
return [];
}
}
TaskManager.defineTask(LOCATION_UPDATES_TASK, async ({ data: { locations }, error }) => {
if (error) {
// Error occurred - check `error.message` for more details.
return;
}
if (locations && locations.length > 0) {
// do something with the locations captured in the background
const savedLocations = await getSavedLocations();
const newLocations = locations.map(({ coords }) => ({
latitude: coords.latitude,
longitude: coords.longitude,
speed: coords.speed,
}));
savedLocations.push(...newLocations);
await AsyncStorage.setItem(STORAGE_KEY, JSON.stringify(savedLocations));
locationEventsEmitter.emit('update', savedLocations);
}
});
const styles = StyleSheet.create({
container: {
flex: 1,
...StyleSheet.absoluteFillObject,
justifyContent: "flex-end",
alignItems: "center",
},
containerMap: {
flex: 1,
alignSelf: 'stretch',
justifyContent: "flex-end",
},
map: {
...StyleSheet.absoluteFillObject
},
button: {
width: 80,
height: 80,
borderRadius: 40,
justifyContent: 'center',
alignItems: 'center',
},
buttonTitle: {
fontSize: 18,
color: 'white',
},
buttonRow: {
width: "100%",
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-evenly',
paddingVertical: 10,
backgroundColor: "white",
borderTopColor: "green",
borderTopWidth: 1,
},
recordBox:
{
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'flex-start',
backgroundColor: "white"
},
item:
{
width: '50%',
alignItems: "center",
},
itemTitle:
{
marginTop: 5,
fontSize: 12,
},
itemContent:
{
marginBottom: 8,
fontSize: 30,
fontWeight: "bold",
},
}); | 25.213622 | 104 | 0.556054 |
10f57fc2cb2a3d7fe4ee3e9dc5c30e5610d6f4f5 | 8,000 | js | JavaScript | src/components/dynamic-pages/group-category.js | Corea98/ecommerce-gatsby-strapi | e3318ff4bc6d0cd6c90dcacde895f21c49603ee6 | [
"RSA-MD"
] | null | null | null | src/components/dynamic-pages/group-category.js | Corea98/ecommerce-gatsby-strapi | e3318ff4bc6d0cd6c90dcacde895f21c49603ee6 | [
"RSA-MD"
] | null | null | null | src/components/dynamic-pages/group-category.js | Corea98/ecommerce-gatsby-strapi | e3318ff4bc6d0cd6c90dcacde895f21c49603ee6 | [
"RSA-MD"
] | null | null | null | import React, { useState } from 'react'
import { graphql } from 'gatsby'
import Image from 'gatsby-image'
import { Link } from 'gatsby'
import { css } from '@emotion/core'
// Components
import Layout from '../layout'
import SEO from "../../components/seo"
import Product from "./product"
// Hooks
import useMenu from '../../hooks/useMenu'
export const query = graphql`
query ($slug: String!, $name: String!) {
allStrapiCategory(filter: {name: {eq: $name}}) {
nodes {
id
name
sub_categories {
id
name
}
}
}
allStrapiGroupCategory(filter: {slug: {eq: $slug}}) {
nodes {
id
name
image {
sharp: childImageSharp {
fluid (maxWidth: 1200) {
...GatsbyImageSharpFluid_withWebp
}
}
}
categories {
id
name
}
}
}
}
`
const GroupCategoryTemplate = ({ data: { allStrapiCategory: { nodes: categories }, allStrapiGroupCategory: { nodes: groupCategories } } }) => {
const subCategories = categories[0].sub_categories
const groupCategory = groupCategories[0]
console.log('group-category.js - subCategories', subCategories)
console.log('group-category.js - groupCategory', groupCategory)
// Hooks
const { Menu, Checkbox } = useMenu()
return (
<Layout>
<SEO title={ groupCategory.name } />
<div className="container">
<p css={css`
margin: 20px 0;
`}><Link to="/">Home</Link> / { groupCategory.name }</p>
<h1 css={css`text-align: center; margin-top: 20px; font-weight: 400;`}>{ groupCategory.name }</h1>
<p css={css`text-align: center; margin-bottom: 40px;`}>588 Items</p>
<div css={css`
display: flex;
align-items: first;
`}>
{/* CATEGORIES */}
<div css={css`
height: auto;
width: 430px;
padding-right: 25px;
div:nth-of-type(1) {
padding-top: 0px !important;
}
div > ul > li> input[type="checkbox"] {
margin-right: 10px;
}
li, label {
font-size: 1.3rem;
}
`}>
<Menu
title='CATEGORY'
>
<ul>
{ subCategories.map(subCategory => (
<li
key={ subCategory.id }
><Link to="/">{ subCategory.name }</Link></li>
))}
</ul>
</Menu>
<Menu
title='BRAND'
>
<ul>
<Checkbox
name="Brand 1 dinámica"
action={(checked) => checked ? console.log('Brand 1 dinámica') : console.log('Saliendo..') }
/>
<Checkbox
name="Brand 2 dinámica"
action={(checked) => checked && console.log('Brand 2 dinámica') }
/>
<Checkbox
name="Brand 3 dinámica"
action={(checked) => checked && console.log('Brand 3 dinámica') }
/>
</ul>
</Menu>
<Menu
title='COLOR'
>
<ul>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
</ul>
</Menu>
<Menu
title='Size'
>
<ul>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
</ul>
</Menu>
<Menu
title='Material outside'
>
<ul>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
</ul>
</Menu>
<Menu
title='Gender'
>
<ul>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
<li>
<input type="checkbox"/>
<label>Beige 1</label>
</li>
</ul>
</Menu>
</div>
{/* PRODUCTS */}
<div css={css`width: 100%;`}>
<div css={css`
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 400px;
gap: 25px;
`}>
<Product />
<Product />
<Product />
<Product />
</div>
</div>
</div>
</div>
</Layout>
)
}
export default GroupCategoryTemplate | 35.874439 | 143 | 0.281875 |
10f664a4d25aaae8ddf4121ad5e0e5498500f182 | 895 | js | JavaScript | _/lib/lodash-amd/internal/baseSetData.js | paullewallencom/lodash-978-1-7843-9833-0 | 528f0c4617c75615e4b5bf42ac752170c763c5f3 | [
"Apache-2.0"
] | null | null | null | _/lib/lodash-amd/internal/baseSetData.js | paullewallencom/lodash-978-1-7843-9833-0 | 528f0c4617c75615e4b5bf42ac752170c763c5f3 | [
"Apache-2.0"
] | null | null | null | _/lib/lodash-amd/internal/baseSetData.js | paullewallencom/lodash-978-1-7843-9833-0 | 528f0c4617c75615e4b5bf42ac752170c763c5f3 | [
"Apache-2.0"
] | null | null | null | /**
* Lo-Dash 3.0.0-pre (Custom Build) <http://lodash.com/>
* Build: `lodash modularize modern exports="amd" -o ./modern/`
* Copyright 2012-2014 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
* Copyright 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
define(['../utility/identity', './metaMap'], function(identity, metaMap) {
/**
* The base implementation of `setData` without support for hot loop detection.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
return baseSetData;
});
| 34.423077 | 91 | 0.682682 |
10f7fdd7e33559c73f2938176f9c79a8fc93e02d | 2,059 | js | JavaScript | public/js/scripts.js | ibrahim-ih/Video-Downloader | 98a3ef1f6990166e17cea6c7d48bb149874ac486 | [
"MIT"
] | 3 | 2019-11-17T19:18:14.000Z | 2020-11-12T16:28:12.000Z | public/js/scripts.js | ibrahim-ih/Video-Downloader | 98a3ef1f6990166e17cea6c7d48bb149874ac486 | [
"MIT"
] | null | null | null | public/js/scripts.js | ibrahim-ih/Video-Downloader | 98a3ef1f6990166e17cea6c7d48bb149874ac486 | [
"MIT"
] | 1 | 2020-11-12T11:51:02.000Z | 2020-11-12T11:51:02.000Z | jQuery(document).ready(function ($) {
var busy = null;
if ($('#submit').length > 0 ){
var busy = null;
$('#submit').click(function (e) {
e.preventDefault();
var error = false;
form = $('form');
form.find('[required]').each( function () {
if ($.trim($(this).val()) == '') {
$(this).css('border-color', '#FF0000');
error = true;
} else {
$(this).css('border-color', '#CDCDCD');
}
});
var formElement = document.getElementById("form");
var myForm = new FormData(formElement);
myForm.append('action', 'vidw_response_action');
if (!error ) {
if (busy)
busy.abort();
busy = $.ajax({
type: 'POST',
url: js_content.ajaxurl,
data: myForm,
contentType: false,
processData: false,
success: function (data, textStatus, jqXHR) {
console.log(data);
$('#info').attr('class', 'text-center').html(data);
if (data === 'success'){
form[0].reset();
$('#noty').attr('class', 'alert alert-success').html(js_content.success_msg);
$('#info').attr('class', 'text-center').html(js_content.info_msg);
}
if (data === 'error'){
$('#noty').attr('class', 'alert alert-warning').html(js_content.notic_msg);
}
},
});
}else {
$('#noty').attr('class', 'alert alert-danger').html(js_content.wrong_msg);
}
$('#noty').slideDown();
$('#noty').delay(5000).slideUp();
return false;
});
}
});
| 30.731343 | 105 | 0.387081 |
10f8b15774fa291864f6df47c2783c4c3fe2ddc3 | 5,009 | js | JavaScript | apps/unsupervised/simple-tf-network-plugin.js | IMAGINARY/ai-to-touch-prototypes | e5ff6ca21d15bc7438ba1cd2a3bee09a917b21b7 | [
"Apache-2.0"
] | null | null | null | apps/unsupervised/simple-tf-network-plugin.js | IMAGINARY/ai-to-touch-prototypes | e5ff6ca21d15bc7438ba1cd2a3bee09a917b21b7 | [
"Apache-2.0"
] | null | null | null | apps/unsupervised/simple-tf-network-plugin.js | IMAGINARY/ai-to-touch-prototypes | e5ff6ca21d15bc7438ba1cd2a3bee09a917b21b7 | [
"Apache-2.0"
] | null | null | null | const model = tf.sequential({
layers: [tf.layers.dense({
units: 6,
inputShape: [4],
//kernelRegularizer: tf.regularizers.l1l2({l1:0,l2:0.005}),
kernelRegularizer: 'l1l2',
biasRegularizer: 'l1l2',
activation: 'relu'
}),
tf.layers.dense({
units: 2,
kernelRegularizer: 'l1l2',
biasRegularizer: 'l1l2',
activation: 'softmax'
})
]
});
/*
model.weights.forEach(w => {
const newVals = tf.zeros(w.shape);
// w.val is an instance of tf.Variable
w.val.assign(newVals);
});
*/
model.compile({
optimizer: tf.train.adam(0.05),
loss: 'meanSquaredError'
});
var cloneExpression = function(obj) {
var copy;
if (null == obj || "object" != typeof obj) return obj;
if (obj instanceof Array) {
copy = [];
for (var i = 0, len = obj.length; i < len; i++) {
copy[i] = cloneExpression(obj[i]);
}
return copy;
}
if (obj instanceof Object) {
copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
if (['oper', 'impl', 'args', 'ctype', 'stack', 'name', 'arglist', 'value', 'real', 'imag', 'key', 'obj', 'body'].indexOf(attr) >= 0)
copy[attr] = cloneExpression(obj[attr]);
}
}
if (obj['modifs']) copy['modifs'] = obj['modifs']; //modifs cannot be handeled in recursion properly
return copy;
}
}
var real = function(r) {
return {
"ctype": "number",
"value": {
'real': r,
'imag': 0
}
};
};
var list = function(l) {
return {
'ctype': 'list',
'value': l
};
};
var wrap = function(v) {
if (typeof v === "number") {
return real(v);
}
if (typeof v === "object" && v.length !== undefined) {
var li = [];
for (var i = 0; i < v.length; i++) {
li[i] = wrap(v[i]);
}
return list(li);
}
if (typeof v === "string") {
return {
ctype: "string",
value: v
};
}
if (typeof v === "boolean") {
return {
ctype: "boolean",
value: v
};
}
return nada;
};
var recreplace = function(ex, rmap) {
if (ex.ctype === "variable" && rmap[ex.name]) {
return rmap[ex.name];
} else {
if (ex.args)
ex.args = ex.args.map(e => recreplace(e, rmap));
return ex;
}
};
// Register a plugin called "simple-tf-network-plugin", using plugin API version 1
CindyJS.registerPlugin(1, "simple-tf-network-plugin", function(api) {
// Define a CindyScript function called "train"
// that takes two arguments
api.defineFunction("train", 3, function(args, modifs) {
var callback = cloneExpression(args[2]);
// Evaluate the argument expression
// (as opposed to inspecting the unevaluated formula)
var xs = api.evaluate(args[0]);
var ys = api.evaluate(args[1]);
if (xs.ctype !== "list" || ys.ctype !== "list" || xs.value.length != ys.value.length) {
console.log("aborting train because of inconsistent arguments");
return api.nada;
}
xs = xs.value.map(li => li.value.map(x => x.value.real));
ys = ys.value.map(li => li.value.map(x => x.value.real));
//console.log(ys);
/*for (let i = 0; i < 5; i++) {
xs = xs.concat(xs);
ys = ys.concat(ys);
}*/
//(tf.tensor2d(ys, [ys.length, 2])).print();
model.fit(
tf.tensor2d(xs, [xs.length, 4]),
tf.tensor2d(ys, [ys.length, 2]), {
//batchSize: 32,
shuffle: true,
epochs: 1,
}).then(() => api.evaluate(callback));
return api.nada;
});
api.defineFunction("predict", 2, function(args, modifs) {
var callback = cloneExpression(args[1]);
var xs = api.evaluate(args[0]);
xs = xs.value.map(li => li.value.map(x => x.value.real));
model.predict(tf.tensor2d(xs, [xs.length, 4])).array().then(
function(data) {
let cdydata = wrap(data);
api.evaluate(recreplace(callback, {
'#': cdydata
}));
}
);
});
api.defineFunction("getweights", 1, function(args, modifs) {
var callback = cloneExpression(args[0]);
Promise.all([0, 1, 2, 3].map(k => model.getWeights()[k].array())).then(
function(data) {
let cdydata = wrap(data);
api.evaluate(recreplace(callback, {
'#': cdydata
}));
});
});
api.defineFunction("resetweights", 0, function(args, modifs) {
model.weights.forEach(w => {
const newVals = tf.randomNormal(w.shape);
w.val.assign(newVals);
});
});
});
| 27.98324 | 148 | 0.490916 |
10f9066a3547c2bc62c7ac6fe03357a461746523 | 12,046 | js | JavaScript | js/app.js | baibars/LiveQuestTool | ac0e8963215cafa5e2e9db57ec9c20da3b535340 | [
"MIT"
] | null | null | null | js/app.js | baibars/LiveQuestTool | ac0e8963215cafa5e2e9db57ec9c20da3b535340 | [
"MIT"
] | null | null | null | js/app.js | baibars/LiveQuestTool | ac0e8963215cafa5e2e9db57ec9c20da3b535340 | [
"MIT"
] | null | null | null | /**
* 演示程序当前的 “注册/登录” 等操作,是基于 “本地存储” 完成的
* 当您要参考这个演示程序进行相关 app 的开发时,
* 请注意将相关方法调整成 “基于服务端Service” 的实现。
**/
(function($, owner)
{
owner.SERVER = "http://116.228.6.173:1123/";
owner.ANCHOR = 1;
owner.ADMIN = 2;
owner.NO_QUEST = 0;
owner.createState = function(user)
{
var state = {
account: user.account,
token: user.token,
};
owner.setState(state);
};
owner.setState = function(state)
{
state = state || {};
localStorage.setItem('$state', JSON.stringify(state));
};
owner.getState = function()
{
var stateText = localStorage.getItem('$state') || "{}";
var state = JSON.parse(stateText);
if (null != state.account)
{
var user = owner.getUser(state.account);
if (null != user)
{
return user;
}
}
return state;
};
owner.getAnchorState = function()
{
var state = owner.getState();
if (owner.ANCHOR == state.type)
{
return state;
}
var users = JSON.parse(localStorage.getItem('$users') || '[]');
for(var i = 0; i < users.length; ++i)
{
if (owner.ANCHOR == users[i].type && state.group == users[i].group)
{
return users[i];
}
}
return null;
};
owner.getUser = function(account)
{
var users = JSON.parse(localStorage.getItem('$users') || '[]');
for(var i = 0; i < users.length; ++i)
{
if (account == users[i].account)
{
return users[i];
}
}
};
owner.setUser = function(user)
{
var users = JSON.parse(localStorage.getItem('$users') || '[]');
for(var i = 0; i < users.length; ++i)
{
if (user.account == users[i].account)
{
users[i].token = (null != user.token) ? user.token : users[i].token;
users[i].group = (null != user.group) ? user.group : users[i].group;
users[i].type = (null != user.type) ? user.type : users[i].type;
users[i].level = (null != user.level) ? user.level : users[i].level;
users[i].exp = (null != user.exp) ? user.exp : users[i].exp;
users[i].questID = (null != user.questID) ? user.questID : users[i].questID;
localStorage.setItem('$users', JSON.stringify(users));
return;
}
}
users.push(user);
localStorage.setItem('$users', JSON.stringify(users));
};
owner.reg = function(regInfo, callback)
{
callback = callback || $.noop;
regInfo = regInfo || {};
regInfo.account = regInfo.account || '';
regInfo.password = regInfo.password || '';
if (regInfo.account.length < 1)
{
return callback('用户名最短需要 1 个字符');
}
if (regInfo.password.length < 1)
{
return callback('密码最短需要 1 个字符');
}
var data = "id=" + regInfo.account + "&password=" + regInfo.password;
console.log("app.reg req data:" + data);
mui.ajax(owner.SERVER + 'register', {
data: data,
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
console.log("app.reg ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
return callback();
}
else
{
return callback("注册失败,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.reg ack error:" + type);
return callback(type);
}
});
};
owner.login = function(loginInfo, callback)
{
callback = callback || $.noop;
loginInfo = loginInfo || {};
loginInfo.account = loginInfo.account || '';
if (loginInfo.account.length < 1)
{
return callback('账号最短为 1 个字符');
}
if (null == loginInfo.password && null == loginInfo.token)
{
return callback('密码错误');
}
var data = "";
if (null != loginInfo.password)
{
data = "id=" + loginInfo.account + "&password=" + loginInfo.password;
}
else
{
data = "id=" + loginInfo.account + "&token=" + loginInfo.token;
}
console.log("app.login req data:" + data);
mui.ajax(owner.SERVER + 'login', {
data: data,
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
console.log("app.login ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
var users = [];
for (var i = 0; i < data.charList.length; ++i)
{
users.push(data.charList[i]);
}
localStorage.setItem('$users', JSON.stringify(users));
owner.createState(data.charList[0]);
return callback();
}
else
{
return callback("登录失败,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.login ack error:" + type);
return callback(type);
}
});
};
owner.takeQuest = function(callback)
{
var state = owner.getState();
if (owner.ANCHOR != state.type || owner.NO_QUEST != state.questID)
{
return callback("状态错误");
}
var data = "id=" + state.account + "&token=" + state.token;
console.log("app.takeQuest req data:" + data);
mui.ajax(owner.SERVER + 'takeQuest', {
data: data,
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
console.log("app.takeQuest ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
data.account = state.account;
owner.setUser(data);
return callback();
}
else
{
return callback("领取任务失败,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.takeQuest ack error:" + type);
return callback(type);
}
});
};
owner.finishQuest = function(callback)
{
var state = owner.getState();
if (owner.ADMIN != state.type)
{
return callback("状态错误");
}
var anchor = owner.getAnchorState()
if (null == anchor)
{
return callback("状态错误");
}
var data = "myid=" + state.account + "&token=" + state.token + "&targetid=" + anchor.account;
console.log("app.fihishQuest req data:" + data);
mui.ajax(owner.SERVER + 'finishQuest', {
data: data,
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
console.log("app.fihishQuest ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
data.account = anchor.account;
data.questID = owner.NO_QUEST;
owner.setUser(data);
return callback();
}
else
{
return callback("完成任务失败,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.fihishQuest ack error:" + type);
return callback(type);
}
});
};
owner.refresh = function(callback)
{
var data = "";
var state = owner.getState();
if (null == state || null == state.account)
{
return;
}
var account = state.account;
if (owner.ADMIN == state.type)
{
var anchor = owner.getAnchorState()
if (null == anchor)
{
return callback("状态错误");
}
account = anchor.account;
}
data = "id=" + state.account + "&token=" + state.token + "&queryid=" + account;
mui.ajax(owner.SERVER + 'refresh', {
data: data,
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
console.log("app.refresh ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
data.account = account;
owner.setUser(data);
return callback();
}
else
{
return callback("刷新失败,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.refresh ack error:" + type);
callback(type);
}
});
};
owner.getQuestInfo = function(id)
{
var quests = JSON.parse(localStorage.getItem('$quests') || '[]');
for(var i = 0; i < quests.length; ++i)
{
if (id == quests[i].id)
{
return quests[i];
}
}
};
owner.getPreExp = function(level)
{
var exps = JSON.parse(localStorage.getItem('$exps') || '[]');
return exps[level - 1];
}
owner.getMaxExp = function(level)
{
var exps = JSON.parse(localStorage.getItem('$exps') || '[]');
return exps[level];
}
owner.getLevelData = function(callback)
{
mui.ajax(owner.SERVER + 'getExp', {
data: "",
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
// console.log("app.getLevelData ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
var exps = [ 0, ];
for (i = 0; i < data.expList.length; ++i)
{
exps[data.expList[i].id] = data.expList[i].nextExp;
}
if (exps.length != data.expList.length + 1)
{
console.log("app.getLevelData error! exps.length:" + exps.length + " data.expList.length:" + data.expList.length);
return callback("level数据错误");
}
for (i = 0; i < exps.length; ++i)
{
if (null == exps[i])
{
console.log("app.getLevelData error! level " + i + " have no data");
return callback("level数据错误");
}
}
localStorage.setItem('$exps', JSON.stringify(exps));
return callback();
}
else
{
return callback("level数据错误,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.getLevelData ack error:" + type);
return callback(type);
}
});
};
owner.getQuestData = function(callback)
{
mui.ajax(owner.SERVER + 'getQuest', {
data: "",
dataType:'string',
type:'get',
timeout:10000,
headers:{'Content-Type':'application/json'},
success:function(rawData){
// console.log("app.getQuestData ack success:" + rawData);
var data = JSON.parse(rawData);
if (0 == data.code)
{
var quests = [];
for (i = 0; i < data.questList.length; ++i)
{
quests.push({
id: data.questList[i].id,
title: data.questList[i].name,
desc: data.questList[i].desc,
bonus: data.questList[i].award,
exp: data.questList[i].awardExp,
})
}
localStorage.setItem('$quests', JSON.stringify(quests));
return callback();
}
else
{
return callback("quest数据错误,code:" + data.code);
}
},
error:function(xhr,type,errorThrown){
console.log("app.getQuestData ack error:" + type);
callback(type);
}
});
};
var checkEmail = function(email) {
email = email || '';
return (email.length > 3 && email.indexOf('@') > -1);
};
/**
* 找回密码
**/
owner.forgetPassword = function(email, callback) {
callback = callback || $.noop;
if (!checkEmail(email)) {
return callback('邮箱地址不合法');
}
return callback(null, '新的随机密码已经发送到您的邮箱,请查收邮件。');
};
/**
* 获取应用本地配置
**/
owner.setSettings = function(settings) {
settings = settings || {};
localStorage.setItem('$settings', JSON.stringify(settings));
}
/**
* 设置应用本地配置
**/
owner.getSettings = function() {
var settingsText = localStorage.getItem('$settings') || "{}";
return JSON.parse(settingsText);
}
/**
* 获取本地是否安装客户端
**/
owner.isInstalled = function(id) {
if (id === 'qihoo' && mui.os.plus) {
return true;
}
if (mui.os.android) {
var main = plus.android.runtimeMainActivity();
var packageManager = main.getPackageManager();
var PackageManager = plus.android.importClass(packageManager)
var packageName = {
"qq": "com.tencent.mobileqq",
"weixin": "com.tencent.mm",
"sinaweibo": "com.sina.weibo"
}
try {
return packageManager.getPackageInfo(packageName[id], PackageManager.GET_ACTIVITIES);
} catch (e) {}
} else {
switch (id) {
case "qq":
var TencentOAuth = plus.ios.import("TencentOAuth");
return TencentOAuth.iphoneQQInstalled();
case "weixin":
var WXApi = plus.ios.import("WXApi");
return WXApi.isWXAppInstalled()
case "sinaweibo":
var SinaAPI = plus.ios.import("WeiboSDK");
return SinaAPI.isWeiboAppInstalled()
default:
break;
}
}
}
}(mui, window.app = {})); | 24.237425 | 120 | 0.58783 |
10fa88fc952f603d738687b69641f1cb716032cb | 2,118 | js | JavaScript | sql/operators/createIndex/createIndex.js | pierrecle/json-sql-builder2 | 0a19759c60c129e829b3119ae6ba9f367b686225 | [
"MIT"
] | 64 | 2018-06-06T07:28:33.000Z | 2022-02-21T14:55:31.000Z | sql/operators/createIndex/createIndex.js | pierrecle/json-sql-builder2 | 0a19759c60c129e829b3119ae6ba9f367b686225 | [
"MIT"
] | 34 | 2018-03-08T07:23:53.000Z | 2021-05-06T21:06:24.000Z | sql/operators/createIndex/createIndex.js | pierrecle/json-sql-builder2 | 0a19759c60c129e829b3119ae6ba9f367b686225 | [
"MIT"
] | 26 | 2018-05-09T02:37:17.000Z | 2022-02-12T07:22:46.000Z | 'use strict';
const SYNTAX =
`CREATE{ UNIQUE[$unique]} INDEX
{ CONCURRENTLY[$concurrently]}-->(PostgreSQL)
{ IF NOT EXISTS [$ine] | [$ifNotExists]}
{ [$name]} ON <$table>
{ USING [$using]}-->(PostgreSQL,MariaDB,MySQL)
(<$columns>)
{ WITH ([$storageParameters])}
{ TABLESPACE [$tablespace]}-->(PostgreSQL)
{ WHERE [$where]}
`;
class createIndex extends SQLBuilder.SQLOperator {
constructor(sql){
super(sql);
this.Types({
Object: {
syntax: this.Syntax(SYNTAX, SQLBuilder.CALLEE)
}
});
this.$unique = new SQLBuilder.SQLPredefined.AcceptIfTrue(sql);
this.$concurrently = new SQLBuilder.SQLPredefined.AcceptIfTrue(sql);
this.$ine = new SQLBuilder.SQLPredefined.AcceptIfTrue(sql);
// add a synonym for ine = ifNotExists
this.$ifNotExists = this.$ine;
this.$name = new SQLBuilder.SQLPredefined.StringIdentifier(sql);
this.$table = new SQLBuilder.SQLPredefined.StringIdentifier(sql);
this.$tablespace = new SQLBuilder.SQLPredefined.StringIdentifier(sql);
this.registerPrivateHelper('using');
this.registerPrivateHelper('columns');
this.registerPrivateHelper('storageParameters');
}
}
module.exports = {
definition: createIndex,
description: 'Specifies the `CREATE INDEX` Statement.',
supportedBy: {
MySQL: 'https://dev.mysql.com/doc/refman/5.7/en/create-index.html',
MariaDB: 'https://mariadb.com/kb/en/library/create-index/',
PostgreSQL: 'https://www.postgresql.org/docs/9.5/static/sql-createindex.html',
SQLite: 'https://sqlite.org/lang_createview.html',
Oracle: 'https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5010.htm',
SQLServer: 'https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql'
},
examples: {
Object: {
"Basic Usage": function(sql) {
return {
test: function(){
return sql.$createIndex({
$unique: true,
$table: 'people',
$columns: {
first_name: true,
last_name: true
}
});
},
expectedResults: {
sql: 'CREATE UNIQUE INDEX ON people (first_name ASC, last_name ASC)',
values: {},
}
}
}
}
}
}
| 28.621622 | 94 | 0.67611 |
10fa8e9902d2521b3aad9fc71cab7ff1fb5a0206 | 196 | js | JavaScript | src/Auth/auth0-variables.js | marcjohnstonuw/bingo-gen | ab7eedc165c0dbec4c9dfd03528a0544c77c9b9d | [
"MIT"
] | null | null | null | src/Auth/auth0-variables.js | marcjohnstonuw/bingo-gen | ab7eedc165c0dbec4c9dfd03528a0544c77c9b9d | [
"MIT"
] | null | null | null | src/Auth/auth0-variables.js | marcjohnstonuw/bingo-gen | ab7eedc165c0dbec4c9dfd03528a0544c77c9b9d | [
"MIT"
] | null | null | null | const AUTH_CONFIG = {
domain: 'marcjohnstonuw.auth0.com',
clientId: 'sO78Oq2NopXAHukBwD3rnfQbnwYWVHF4',
callbackUrl: 'https://bingo-gen.herokuapp.com/callback'
}
export default AUTH_CONFIG; | 28 | 57 | 0.77551 |
10fba4a523975bf4eb0e02a27963ed31cd18aaf1 | 3,466 | js | JavaScript | classes/algorithms/generate-predictive-parsing-table.js | scut-grimm/compiler-analyzer | ca249220360e6187128c87d820f71ce6742cfced | [
"MIT"
] | 3 | 2019-04-17T05:19:39.000Z | 2019-05-28T00:39:04.000Z | classes/algorithms/generate-predictive-parsing-table.js | scut-grimm/compiler-analyzer | ca249220360e6187128c87d820f71ce6742cfced | [
"MIT"
] | 4 | 2021-05-08T14:10:17.000Z | 2022-02-12T08:52:51.000Z | classes/algorithms/generate-predictive-parsing-table.js | scut-grimm/compiler-analyzer | ca249220360e6187128c87d820f71ce6742cfced | [
"MIT"
] | 1 | 2019-06-24T08:29:44.000Z | 2019-06-24T08:29:44.000Z | import PredictiveParsingTable from '../predictive-parsing-table'
class GeneratePredictiveParsingTable{
constructor(grammar){
this.grammar = grammar
}
// 获取初始化context
getInitContext(){
return {
cur_g_index: 0,
table: new PredictiveParsingTable()
}
}
// epoll函数为generator,执行算法的每一轮循环,返回一个数组[isFinish, nextContext]。该函数接受curContext作为本轮算法的上下文,并在nextContext中返回经过该次算法迭代后的算法上下文
// 由于每个算法循环中都包含几个步骤,考虑到前端的展示需求,在需要前端展示变化的时候,通过yield返回视图上所需的变化
*epoll(curContext){
let {cur_g_index,table} = curContext
const G = this.grammar
if(cur_g_index >= G.grammars.length){
return [true, table]
}
const curGrammarItem = G.grammars[cur_g_index]
let curFirstSet = new Set(G.getGrammarItemRightFirstSet(curGrammarItem))
let curFollowSet = new Set(G.getSignFollowSet(curGrammarItem.leftSign))
const Empty = G.getSign('ε','Terminal')
const End = G.getSign('$','Terminal')
yield {
curGrammarItem,
notice: '分析产生式(' + curGrammarItem.getStr() +')',
step: 0,
highlightSymbols: []
}
for(let symbol of curFirstSet) {
yield {
curGrammarItem,
notice: `First(${curGrammarItem.getRightStr()})中存在终止符 ${symbol.getStr()} , 将产生式 ${curGrammarItem.getStr()} 加入到分析表M[${curGrammarItem.getLeftStr()}, ${symbol.getStr()}]中`,
step: 0,
highlightSymbols: [symbol]
}
table.set(curGrammarItem.leftSign, symbol, curGrammarItem)
}
if(curFirstSet.has(Empty)){
yield {
curGrammarItem,
notice: `First(${curGrammarItem.getRightStr()})中存在${Empty.getStr()}`,
step: 1,
highlightSymbols: [Empty]
}
for(let symbol of curFollowSet){
yield {
curGrammarItem,
notice: `Follow(${curGrammarItem.getLeftStr()})中存在终止符 ${symbol.getStr()} , 将产生式 ${curGrammarItem.getStr()} 加入到分析表M[${curGrammarItem.getLeftStr()}, ${symbol.getStr()}]中`,
step: 1,
highlightSymbols: [symbol]
}
table.set(curGrammarItem.leftSign, symbol, curGrammarItem)
}
if(curFollowSet.has(End)){
yield {
curGrammarItem,
notice: `Follow(${curGrammarItem.getLeftStr()})中存在 $ , 将产生式 ${curGrammarItem.getStr()} 加入到分析表M[${curGrammarItem.getLeftStr()}, $]中`,
step: 2,
highlightSymbols: [End]
}
table.set(curGrammarItem.leftSign, End, curGrammarItem)
}else{
yield {
curGrammarItem,
notice: `Follow(${curGrammarItem.getLeftStr()})中不存在 $ ,跳过`,
step: 2,
highlightSymbols: []
}
}
}else{
yield {
curGrammarItem,
notice: `First(${curGrammarItem.getRightStr()})中不存在 ${Empty.getStr()} ,跳过`,
step: 1,
highlightSymbols: []
}
}
const nextContext = {
cur_g_index: cur_g_index+1,
table
}
return [false, nextContext]
}
getCurResult({table}){
return table.getTableData()
}
getResultFromContext({table}){
return table
}
//包装器,用于完整运行每一个epoll,返回[isFinish, nextContext]
runEpoll(curContext){
let run = this.epoll(curContext)
let ret = null;
do{
ret = run.next()
}while(ret.done === false)
return ret.value
}
//执行整个算法,返回该算法的输出
run(){
let ret = [false, this.getInitContext()]
while(ret[0] == false){
ret = runEpoll(ret[1])
}
return this.getResultFromContext(ret[1])
}
}
export default GeneratePredictiveParsingTable
| 30.672566 | 179 | 0.625505 |
10fbfcb20a8156f1e910dc1c8206fe965a09c264 | 1,071 | js | JavaScript | doxygen_cxx/classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.js | RobotLocomotion/RobotLocomotion.github.io | 55aa519b48f147254c73f77de9249c7973b467fe | [
"BSD-3-Clause"
] | 13 | 2016-11-11T09:48:13.000Z | 2020-10-13T03:39:29.000Z | doxygen_cxx/classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.js | RobotLocomotion/RobotLocomotion.github.io | 55aa519b48f147254c73f77de9249c7973b467fe | [
"BSD-3-Clause"
] | null | null | null | doxygen_cxx/classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.js | RobotLocomotion/RobotLocomotion.github.io | 55aa519b48f147254c73f77de9249c7973b467fe | [
"BSD-3-Clause"
] | 10 | 2016-05-12T14:30:18.000Z | 2020-09-01T14:07:54.000Z | var classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender =
[
[ "OptitrackLcmFrameSender", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#a20b3c738f7ef7ab9c723535d27999011", null ],
[ "OptitrackLcmFrameSender", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#a7a889f43e88e25251192aac8cf48ff4e", null ],
[ "OptitrackLcmFrameSender", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#a12b90bd6576f6e72a799a6a1c6949910", null ],
[ "get_lcm_output_port", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#aa517ec718cb4a5f3edc247227e7b1f09", null ],
[ "get_optitrack_input_port", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#a02e276bf589c28c9b65253f4287feafe", null ],
[ "operator=", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#ada9851e4749a9925c1bf20054fb1a056", null ],
[ "operator=", "classdrake_1_1systems_1_1sensors_1_1_optitrack_lcm_frame_sender.html#a91776575e2de77fce01c5bc4a3edab09", null ]
]; | 107.1 | 147 | 0.860878 |
10fdc0c9658c3d1570511b72437d0116f567b4ba | 760 | js | JavaScript | src/buildPropertyField.js | pfaciana/parse-php-to-md | cdc28714d079faea847b2cc505cd8c7bcb758c56 | [
"MIT"
] | null | null | null | src/buildPropertyField.js | pfaciana/parse-php-to-md | cdc28714d079faea847b2cc505cd8c7bcb758c56 | [
"MIT"
] | null | null | null | src/buildPropertyField.js | pfaciana/parse-php-to-md | cdc28714d079faea847b2cc505cd8c7bcb758c56 | [
"MIT"
] | null | null | null | const isset = require('es5-util/js/isSetStrict');
const getVarTypes = require('./getVarTypes');
const {newLineToSpace, var_export} = require('./helpers');
function buildPropertyField(name, types = [], value = null, modifiers = [], url = false, isConstant = false) {
name = Array.isArray(name) ? name[name.length - 1] : name;
const modifiersStr = modifiers.join(' ') + (modifiers.length ? ' ' : '');
const type = types.length ? getVarTypes({type: types}) + ' ' : '';
let propertyStr = (isConstant ? '' : '$') + name;
url && (propertyStr = `**[${propertyStr}](${url})**`);
const valueStr = isset(value) ? ' = ' + var_export(value) : ' ';
return newLineToSpace(`${modifiersStr}${type}${propertyStr}${valueStr};`);
}
module.exports = buildPropertyField; | 44.705882 | 110 | 0.65 |
10fed24605c013e9912665b72a34e54a15eabc75 | 515 | js | JavaScript | reference/jquery-plugins/basicPrimitives-5.9.1/src.primitives/Controls/FamDiagram/Tasks/Options/VisualTreeOptionTask.js | jstree/Java-Service-Tree-Framework-Front-DevPortal | 20dd181be7716794fe8ecbb3e3fb264069e8ac14 | [
"MIT"
] | 1 | 2021-12-29T02:45:59.000Z | 2021-12-29T02:45:59.000Z | reference/jquery-plugins/basicPrimitives-5.9.1/src.primitives/Controls/FamDiagram/Tasks/Options/VisualTreeOptionTask.js | jstree/Java-Service-Tree-Framework-Front-DevPortal | 20dd181be7716794fe8ecbb3e3fb264069e8ac14 | [
"MIT"
] | 1 | 2021-11-20T01:24:00.000Z | 2021-11-20T01:24:00.000Z | reference/jquery-plugins/basicPrimitives-5.9.1/src.primitives/Controls/FamDiagram/Tasks/Options/VisualTreeOptionTask.js | jstree/Java-Service-Tree-Framework-Front-DevPortal | 20dd181be7716794fe8ecbb3e3fb264069e8ac14 | [
"MIT"
] | 1 | 2021-10-16T15:17:10.000Z | 2021-10-16T15:17:10.000Z | primitives.famdiagram.VisualTreeOptionTask = function (optionsTask) {
var _data = {
leavesPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
childrenPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
maximumColumnsInMatrix: 6,
horizontalAlignment: primitives.common.HorizontalAlignmentType.Center
};
function process() {
return false;
}
function getOptions() {
return _data;
}
return {
process: process,
getOptions: getOptions
};
}; | 24.52381 | 78 | 0.743689 |
8000ac3dcf08f8f39a73e84ac7d789a141265903 | 1,405 | js | JavaScript | src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js | The-Speck/box-ui-elements | 53dbdde6d6fa1bbd64292845a667d4721c40d1a1 | [
"Apache-2.0"
] | 673 | 2017-10-03T01:53:24.000Z | 2022-03-30T22:42:15.000Z | src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js | The-Speck/box-ui-elements | 53dbdde6d6fa1bbd64292845a667d4721c40d1a1 | [
"Apache-2.0"
] | 2,087 | 2017-10-26T03:18:49.000Z | 2022-03-29T08:09:16.000Z | src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js | The-Speck/box-ui-elements | 53dbdde6d6fa1bbd64292845a667d4721c40d1a1 | [
"Apache-2.0"
] | 282 | 2017-10-02T23:11:29.000Z | 2022-03-24T11:38:46.000Z | import mergeContacts from '../mergeContacts';
describe('features/unified-share-modal/utils/mergeContacts', () => {
const email = 'dev@box.com';
const displayText = email;
const id = email;
const isExternalUser = true;
const name = 'dev';
const text = email;
const type = 'user';
const value = email;
const contact = { displayText, text, value };
const existingContacts = [contact];
test('should take existing contacts and merge with new contacts', () => {
const fetchedContacts = { [email]: { email, id, isExternalUser, name, type } };
const expectedMergedContacts = [
{
email,
id,
isExternalUser,
name,
text: name,
type,
value,
},
];
const mergedContacts = mergeContacts(existingContacts, fetchedContacts);
expect(mergedContacts).toEqual(expectedMergedContacts);
});
test('should return existing contact information if there is no new contact information in fetched contacts', () => {
const fetchedContacts = {};
const expectedMergedContacts = [{ email, id, isExternalUser, text, type, value }];
const mergedContacts = mergeContacts(existingContacts, fetchedContacts);
expect(mergedContacts).toEqual(expectedMergedContacts);
});
});
| 32.674419 | 121 | 0.603559 |
8000af19c317060b22176c5c422421067b12df09 | 1,049 | js | JavaScript | wp-content/plugins/advanced-code-editor/js/baace.js | ianlancaster/denverseocoach.com | e5b385a1e09baa626debb6b38eed7ee79344f74b | [
"WTFPL"
] | null | null | null | wp-content/plugins/advanced-code-editor/js/baace.js | ianlancaster/denverseocoach.com | e5b385a1e09baa626debb6b38eed7ee79344f74b | [
"WTFPL"
] | null | null | null | wp-content/plugins/advanced-code-editor/js/baace.js | ianlancaster/denverseocoach.com | e5b385a1e09baa626debb6b38eed7ee79344f74b | [
"WTFPL"
] | null | null | null | //helper functions//
//do bind
function do_bind(sele,eve,f){jQuery(sele).bind(eve,f);}
//show dialog
function show_dialog(sele,setup){
var defaults = {show: 'slide',hide: 'slide'};
var settings = jQuery.extend({}, defaults, setup);
jQuery(sele).dialog(settings);
}
//ajax helper
function aceAJAX(data,resF){jQuery.post(ajaxurl, data, resF);}
//add toolbar button
function addToolbarButton(html,cla,i,title,src,alt,f){
var toolbar = jQuery('.ace_tool_bar');
html = html || false;
f = f || false;
i = i || false;
if (html){
toolbar.append(html);
}else{
cla = cla || 'ace_tool_bar_button';
title = title || '';
src = src || false;
alt = alt || '';
if (src.indexOf('http') != -1 )
var image = jQuery('<img>').attr('src',src).attr('alt',alt);
else
var image = jQuery('<img>').attr('src',ace_strings.imgURL+src).attr('alt',alt);
var a = jQuery('<a>').addClass(cla).attr('id',i).attr('title',title).append(image);
var li = jQuery('<li>').append(a);
toolbar.append(li);
}
if (i && f){
do_bind("#"+i,'click',f);
}
} | 26.897436 | 85 | 0.629171 |
800145431ff10a2882001ccbcfd510ffacfa431a | 2,206 | js | JavaScript | controllers/controller.js | yourmercury/Link-Shortener | be573028e44118af6fbce53bdde197b7bff06b8b | [
"MIT"
] | null | null | null | controllers/controller.js | yourmercury/Link-Shortener | be573028e44118af6fbce53bdde197b7bff06b8b | [
"MIT"
] | null | null | null | controllers/controller.js | yourmercury/Link-Shortener | be573028e44118af6fbce53bdde197b7bff06b8b | [
"MIT"
] | null | null | null | const generate = require("randomstring").generate;
const { genLink, getLink, getTrendingLinks } = require("../helpers/helper");
const bodyParser = require("body-parser");
const validator = require("validator");
const cors = require("cors")
url_validator_options = {
protocols: ['http', 'https', 'ftp'],
require_tld: true,
require_protocol: true,
require_host: true,
require_valid_protocol: true,
allow_underscores: true,
host_whitelist: false,
host_blacklist: false,
allow_trailing_dot: false,
allow_protocol_relative_urls: false,
disallow_auth: false,
}
module.exports = function (app) {
app.use(bodyParser.json());
app.use(cors());
app.post("/shorten", async (req, res) => {
let link = req.body.link;
let host = req.get("host");
let isLink = validator.isURL(link, url_validator_options);
if (!isLink) {
res.status(500).json({ error: "not a valid link", status: false });
return;
}
try {
let shortened_link = await genLink(link, host);
res.status(201).json({ shortened_link: shortened_link, status: true });
}
catch (error) {
console.log(error);
res.status(500).json({ error: "server error", status: false })
}
});
app.post("/trending", async (req, res) => {
let data = req.body;
let host = req.get("host");
try {
let links = await getTrendingLinks(data);
res.status(200).json({ links: links, host:host, status: true });
}
catch (error) {
throw new Error(error);
}
});
app.get("/:linkCode", async (req, res) => {
let linkCode = req.params.linkCode;
try {
let link = await getLink(linkCode);
if (!link) {
res.status(404).json({ error: "no link found or link expired", status: false });
return;
}
res.redirect(`${link}`);
// res.status(200).json({ link: link, status: true });
}
catch (error) {
throw new Error(error);
}
});
} | 25.952941 | 96 | 0.546238 |
8001560aeb765660c2c17aa2bc3c1bb2a6186047 | 235 | js | JavaScript | src/pages/_layouts/default/styles.js | pauloantoniol/frontendRSXP | 44dc454bffe584c9f647cee55b79f2da1e2ab6c7 | [
"MIT"
] | 1 | 2019-11-28T00:37:34.000Z | 2019-11-28T00:37:34.000Z | src/pages/_layouts/default/styles.js | pauloantoniol/frontendRSXP | 44dc454bffe584c9f647cee55b79f2da1e2ab6c7 | [
"MIT"
] | null | null | null | src/pages/_layouts/default/styles.js | pauloantoniol/frontendRSXP | 44dc454bffe584c9f647cee55b79f2da1e2ab6c7 | [
"MIT"
] | null | null | null | import styled from "styled-components";
export const Wrapper = styled.div`
width: 100%;
height: 100%;
background: #acacac;
`;
export const Content = styled.div`
width: 100%;
height: 100%;
padding: 30px 90px 40px 70px;
`;
| 16.785714 | 39 | 0.676596 |
8001cef71d30fe1110dccd217af4706b40dfcaea | 466 | js | JavaScript | components/AppBar.js | PlusAuth/plusauth-react-native-starter | a8d3d69e48f665d64277164022ef05c1f9865fb8 | [
"MIT"
] | null | null | null | components/AppBar.js | PlusAuth/plusauth-react-native-starter | a8d3d69e48f665d64277164022ef05c1f9865fb8 | [
"MIT"
] | null | null | null | components/AppBar.js | PlusAuth/plusauth-react-native-starter | a8d3d69e48f665d64277164022ef05c1f9865fb8 | [
"MIT"
] | null | null | null | import React from 'react'
import {StyleSheet, View, Text} from 'react-native'
const AppBar = () => (
<View style={styles.container}>
<Text style={styles.text}>PlusAuth React Native Starter</Text>
</View>
)
const styles = StyleSheet.create({
container: {
backgroundColor: '#2196F3',
width: '100%',
height: 64,
justifyContent: 'center',
paddingStart: 12
},
text: {
color: 'white',
fontSize: 20
}
})
export default AppBar
| 18.64 | 66 | 0.637339 |
8003fb2f106c394b5e7ad4404289d2e0488c8ecb | 145 | js | JavaScript | services/helloworld.js | jkervine/lambdafoo | 4bcccf1749fb896886e6052db77edf4b7d8963e4 | [
"Apache-2.0"
] | null | null | null | services/helloworld.js | jkervine/lambdafoo | 4bcccf1749fb896886e6052db77edf4b7d8963e4 | [
"Apache-2.0"
] | null | null | null | services/helloworld.js | jkervine/lambdafoo | 4bcccf1749fb896886e6052db77edf4b7d8963e4 | [
"Apache-2.0"
] | null | null | null | exports.helloWorldHandler = function(event, context) {
console.log("starting")
context.succeed("Hello, World!")
console.log("ending")
}
| 24.166667 | 54 | 0.703448 |
800405823363b0998dbd4d90bfa045a3884c30ed | 734 | js | JavaScript | src/state/shelf.middleware.js | neilshah2000/Karmela-Library-UI | b6c1642a68b65f03775e0bac5f4dd91a1c6d9774 | [
"MIT"
] | null | null | null | src/state/shelf.middleware.js | neilshah2000/Karmela-Library-UI | b6c1642a68b65f03775e0bac5f4dd91a1c6d9774 | [
"MIT"
] | null | null | null | src/state/shelf.middleware.js | neilshah2000/Karmela-Library-UI | b6c1642a68b65f03775e0bac5f4dd91a1c6d9774 | [
"MIT"
] | null | null | null | import { SHELF_GET_ALL, SHELF_GET_ALL_SUCCESS, SHELF_GET_ALL_FAILURE,
shelfUpdateAll } from './shelf.actions'
import { apiRequest } from './api.action'
export const shelfGetAllSideEffect = (store) => next => action => {
next(action)
if (action.type === SHELF_GET_ALL) {
store.dispatch(apiRequest(
'/catalog/api/shelves/',
{ },
SHELF_GET_ALL_SUCCESS, SHELF_GET_ALL_FAILURE)
)
}
}
export const shelfGetAllProcessor = (store) => next => action => {
next(action)
if (action.type === SHELF_GET_ALL_SUCCESS) {
store.dispatch(shelfUpdateAll(action.payload))
}
}
export const shelfMiddleware = [
shelfGetAllSideEffect,
shelfGetAllProcessor,
] | 27.185185 | 69 | 0.653951 |
8004fd401d9cfce55f1268f303942b408e59c20c | 88 | js | JavaScript | Projeto JS/javinha.js | serjjiin/EstudosJavaScript | 6d2148569ba9bc8616afcfc785c7d82ab44879cd | [
"MIT"
] | 1 | 2021-08-30T19:30:32.000Z | 2021-08-30T19:30:32.000Z | Projeto JS/javinha.js | serjjiin/EstudosJavaScript | 6d2148569ba9bc8616afcfc785c7d82ab44879cd | [
"MIT"
] | null | null | null | Projeto JS/javinha.js | serjjiin/EstudosJavaScript | 6d2148569ba9bc8616afcfc785c7d82ab44879cd | [
"MIT"
] | null | null | null | var nome = window.prompt('Qual é o seu nome?')
window.alert(`Seja Bem Vindo ${nome} !`)
| 29.333333 | 46 | 0.670455 |
8005264d84da3f5d6aaf6a020c8e79e7378975c1 | 19,332 | js | JavaScript | build/generateSpec.js | bagbyte/routing-controllers-openapi | 37c6eaa691b35bdb889e6b58af5071a881941f92 | [
"MIT"
] | null | null | null | build/generateSpec.js | bagbyte/routing-controllers-openapi | 37c6eaa691b35bdb889e6b58af5071a881941f92 | [
"MIT"
] | null | null | null | build/generateSpec.js | bagbyte/routing-controllers-openapi | 37c6eaa691b35bdb889e6b58af5071a881941f92 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _ = require("lodash");
const pathToRegexp = require("path-to-regexp");
require("reflect-metadata");
const decorators_1 = require("./decorators");
function getFullExpressPath(route) {
const { action, controller, options } = route;
return ((options.routePrefix || '') +
(controller.route || '') +
(action.route || ''));
}
exports.getFullExpressPath = getFullExpressPath;
function getFullPath(route) {
return expressToOpenAPIPath(getFullExpressPath(route));
}
exports.getFullPath = getFullPath;
function getOperation(route) {
const operation = {
operationId: getOperationId(route),
parameters: [
...getHeaderParams(route),
...getPathParams(route),
...getQueryParams(route)
],
requestBody: getRequestBody(route) || undefined,
responses: getResponses(route),
summary: getSummary(route),
tags: getTags(route)
};
const cleanedOperation = _.omitBy(operation, _.isEmpty);
return decorators_1.applyOpenAPIDecorator(cleanedOperation, route);
}
exports.getOperation = getOperation;
function getOperationId(route) {
return `${route.action.target.name}.${route.action.method}`;
}
exports.getOperationId = getOperationId;
function getPaths(routes) {
const routePaths = routes.map(route => ({
[getFullPath(route)]: {
[route.action.type]: getOperation(route)
}
}));
return _.merge(...routePaths);
}
exports.getPaths = getPaths;
function getHeaderParams(route) {
const headers = _(route.params)
.filter({ type: 'header' })
.map(headerMeta => {
const schema = getParamSchema(headerMeta);
return {
in: 'header',
name: headerMeta.name || '',
required: isRequired(headerMeta, route),
schema
};
})
.value();
const headersMeta = _.find(route.params, { type: 'headers' });
if (headersMeta) {
const schema = getParamSchema(headersMeta);
headers.push({
in: 'header',
name: _.last(_.split(schema.$ref, '/')) || '',
required: isRequired(headersMeta, route),
schema
});
}
return headers;
}
exports.getHeaderParams = getHeaderParams;
function getPathParams(route) {
const path = getFullExpressPath(route);
const tokens = pathToRegexp.parse(path);
return tokens
.filter(_.isObject)
.map((token) => {
const name = token.name + '';
const param = {
in: 'path',
name,
required: !token.optional,
schema: { type: 'string' }
};
if (token.pattern && token.pattern !== '[^\\/]+?') {
param.schema = { pattern: token.pattern, type: 'string' };
}
const meta = _.find(route.params, { name, type: 'param' });
if (meta) {
const metaSchema = getParamSchema(meta);
param.schema =
'type' in metaSchema ? Object.assign(Object.assign({}, param.schema), metaSchema) : metaSchema;
}
return param;
});
}
exports.getPathParams = getPathParams;
function getQueryParams(route) {
const queries = _(route.params)
.filter({ type: 'query' })
.map(queryMeta => {
const schema = getParamSchema(queryMeta);
return {
in: 'query',
name: queryMeta.name || '',
required: isRequired(queryMeta, route),
schema
};
})
.value();
const queriesMeta = _.find(route.params, { type: 'queries' });
if (queriesMeta) {
const schema = getParamSchema(queriesMeta);
queries.push({
in: 'query',
name: _.last(_.split(schema.$ref, '/')) || '',
required: isRequired(queriesMeta, route),
schema
});
}
return queries;
}
exports.getQueryParams = getQueryParams;
function getRequestBody(route) {
const bodyParamMetas = route.params.filter(d => d.type === 'body-param');
const bodyParamsSchema = bodyParamMetas.length > 0
? bodyParamMetas.reduce((acc, d) => (Object.assign(Object.assign({}, acc), { properties: Object.assign(Object.assign({}, acc.properties), { [d.name]: getParamSchema(d) }), required: isRequired(d, route)
? [...(acc.required || []), d.name]
: acc.required })), { properties: {}, required: [], type: 'object' })
: null;
const bodyMeta = route.params.find(d => d.type === 'body');
if (bodyMeta) {
const bodySchema = getParamSchema(bodyMeta);
const { $ref } = 'items' in bodySchema && bodySchema.items ? bodySchema.items : bodySchema;
return {
content: {
'application/json': {
schema: bodyParamsSchema
? { allOf: [bodySchema, bodyParamsSchema] }
: bodySchema
}
},
description: _.last(_.split($ref, '/')),
required: isRequired(bodyMeta, route)
};
}
else if (bodyParamsSchema) {
return {
content: { 'application/json': { schema: bodyParamsSchema } }
};
}
}
exports.getRequestBody = getRequestBody;
function getContentType(route) {
const defaultContentType = route.controller.type === 'json'
? 'application/json'
: 'text/html; charset=utf-8';
const contentMeta = _.find(route.responseHandlers, { type: 'content-type' });
return contentMeta ? contentMeta.value : defaultContentType;
}
exports.getContentType = getContentType;
function getStatusCode(route) {
const successMeta = _.find(route.responseHandlers, { type: 'success-code' });
return successMeta ? successMeta.value + '' : '200';
}
exports.getStatusCode = getStatusCode;
function getResponses(route) {
const contentType = getContentType(route);
const successStatus = getStatusCode(route);
return {
[successStatus]: {
content: { [contentType]: {} },
description: 'Successful response'
}
};
}
exports.getResponses = getResponses;
function getSpec(routes) {
return {
components: { schemas: {} },
info: { title: '', version: '1.0.0' },
openapi: '3.0.0',
paths: getPaths(routes)
};
}
exports.getSpec = getSpec;
function getSummary(route) {
return _.capitalize(_.startCase(route.action.method));
}
exports.getSummary = getSummary;
function getTags(route) {
return [_.startCase(route.controller.target.name.replace(/Controller$/, ''))];
}
exports.getTags = getTags;
function expressToOpenAPIPath(expressPath) {
const tokens = pathToRegexp.parse(expressPath);
return tokens
.map(d => (_.isString(d) ? d : `${d.prefix}{${d.name}}`))
.join('');
}
exports.expressToOpenAPIPath = expressToOpenAPIPath;
function isRequired(meta, route) {
const globalRequired = _.get(route.options, 'defaults.paramOptions.required');
return globalRequired ? meta.required !== false : !!meta.required;
}
function getParamSchema(param) {
const { explicitType, index, object, method } = param;
const type = Reflect.getMetadata('design:paramtypes', object, method)[index];
if (_.isFunction(type) && type.name === 'Array') {
const items = explicitType
? { $ref: '#/components/schemas/' + explicitType.name }
: { type: 'object' };
return { items, type: 'array' };
}
if (explicitType) {
return { $ref: '#/components/schemas/' + explicitType.name };
}
if (_.isFunction(type)) {
if (_.isString(type.prototype) || _.isSymbol(type.prototype)) {
return { type: 'string' };
}
else if (_.isNumber(type.prototype)) {
return { type: 'number' };
}
else if (_.isBoolean(type.prototype)) {
return { type: 'boolean' };
}
else if (type.name !== 'Object') {
return { $ref: '#/components/schemas/' + type.name };
}
}
return {};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVTcGVjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2dlbmVyYXRlU3BlYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLDRCQUEyQjtBQUUzQiwrQ0FBOEM7QUFDOUMsNEJBQXlCO0FBR3pCLDZDQUFvRDtBQUlwRCxTQUFnQixrQkFBa0IsQ0FBQyxLQUFhO0lBQzlDLE1BQU0sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxHQUFHLEtBQUssQ0FBQTtJQUM3QyxPQUFPLENBQ0wsQ0FBQyxPQUFPLENBQUMsV0FBVyxJQUFJLEVBQUUsQ0FBQztRQUMzQixDQUFDLFVBQVUsQ0FBQyxLQUFLLElBQUksRUFBRSxDQUFDO1FBQ3hCLENBQUMsTUFBTSxDQUFDLEtBQUssSUFBSSxFQUFFLENBQUMsQ0FDckIsQ0FBQTtBQUNILENBQUM7QUFQRCxnREFPQztBQUtELFNBQWdCLFdBQVcsQ0FBQyxLQUFhO0lBQ3ZDLE9BQU8sb0JBQW9CLENBQUMsa0JBQWtCLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQTtBQUN4RCxDQUFDO0FBRkQsa0NBRUM7QUFLRCxTQUFnQixZQUFZLENBQUMsS0FBYTtJQUN4QyxNQUFNLFNBQVMsR0FBdUI7UUFDcEMsV0FBVyxFQUFFLGNBQWMsQ0FBQyxLQUFLLENBQUM7UUFDbEMsVUFBVSxFQUFFO1lBQ1YsR0FBRyxlQUFlLENBQUMsS0FBSyxDQUFDO1lBQ3pCLEdBQUcsYUFBYSxDQUFDLEtBQUssQ0FBQztZQUN2QixHQUFHLGNBQWMsQ0FBQyxLQUFLLENBQUM7U0FDekI7UUFDRCxXQUFXLEVBQUUsY0FBYyxDQUFDLEtBQUssQ0FBQyxJQUFJLFNBQVM7UUFDL0MsU0FBUyxFQUFFLFlBQVksQ0FBQyxLQUFLLENBQUM7UUFDOUIsT0FBTyxFQUFFLFVBQVUsQ0FBQyxLQUFLLENBQUM7UUFDMUIsSUFBSSxFQUFFLE9BQU8sQ0FBQyxLQUFLLENBQUM7S0FDckIsQ0FBQTtJQUVELE1BQU0sZ0JBQWdCLEdBQUcsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxTQUFTLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBdUIsQ0FBQTtJQUM3RSxPQUFPLGtDQUFxQixDQUFDLGdCQUFnQixFQUFFLEtBQUssQ0FBQyxDQUFBO0FBQ3ZELENBQUM7QUFoQkQsb0NBZ0JDO0FBS0QsU0FBZ0IsY0FBYyxDQUFDLEtBQWE7SUFDMUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFBO0FBQzdELENBQUM7QUFGRCx3Q0FFQztBQUtELFNBQWdCLFFBQVEsQ0FBQyxNQUFnQjtJQUN2QyxNQUFNLFVBQVUsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUN0QyxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFO1lBQ3BCLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxZQUFZLENBQUMsS0FBSyxDQUFDO1NBQ3pDO0tBQ0YsQ0FBQyxDQUFDLENBQUE7SUFHSCxPQUFPLENBQUMsQ0FBQyxLQUFLLENBQUMsR0FBRyxVQUFVLENBQUMsQ0FBQTtBQUMvQixDQUFDO0FBVEQsNEJBU0M7QUFLRCxTQUFnQixlQUFlLENBQUMsS0FBYTtJQUMzQyxNQUFNLE9BQU8sR0FBeUIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUM7U0FDbEQsTUFBTSxDQUFDLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxDQUFDO1NBQzFCLEdBQUcsQ0FBQyxVQUFVLENBQUMsRUFBRTtRQUNoQixNQUFNLE1BQU0sR0FBRyxjQUFjLENBQUMsVUFBVSxDQUFvQixDQUFBO1FBQzVELE9BQU87WUFDTCxFQUFFLEVBQUUsUUFBZ0M7WUFDcEMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxJQUFJLElBQUksRUFBRTtZQUMzQixRQUFRLEVBQUUsVUFBVSxDQUFDLFVBQVUsRUFBRSxLQUFLLENBQUM7WUFDdkMsTUFBTTtTQUNQLENBQUE7SUFDSCxDQUFDLENBQUM7U0FDRCxLQUFLLEVBQUUsQ0FBQTtJQUVWLE1BQU0sV0FBVyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxFQUFFLElBQUksRUFBRSxTQUFTLEVBQUUsQ0FBQyxDQUFBO0lBQzdELElBQUksV0FBVyxFQUFFO1FBQ2YsTUFBTSxNQUFNLEdBQUcsY0FBYyxDQUFDLFdBQVcsQ0FBdUIsQ0FBQTtRQUNoRSxPQUFPLENBQUMsSUFBSSxDQUFDO1lBQ1gsRUFBRSxFQUFFLFFBQVE7WUFDWixJQUFJLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsR0FBRyxDQUFDLENBQUMsSUFBSSxFQUFFO1lBQzdDLFFBQVEsRUFBRSxVQUFVLENBQUMsV0FBVyxFQUFFLEtBQUssQ0FBQztZQUN4QyxNQUFNO1NBQ1AsQ0FBQyxDQUFBO0tBQ0g7SUFFRCxPQUFPLE9BQU8sQ0FBQTtBQUNoQixDQUFDO0FBMUJELDBDQTBCQztBQVFELFNBQWdCLGFBQWEsQ0FBQyxLQUFhO0lBQ3pDLE1BQU0sSUFBSSxHQUFHLGtCQUFrQixDQUFDLEtBQUssQ0FBQyxDQUFBO0lBQ3RDLE1BQU0sTUFBTSxHQUFHLFlBQVksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUE7SUFFdkMsT0FBTyxNQUFNO1NBQ1YsTUFBTSxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUM7U0FDbEIsR0FBRyxDQUFDLENBQUMsS0FBdUIsRUFBRSxFQUFFO1FBQy9CLE1BQU0sSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLEdBQUcsRUFBRSxDQUFBO1FBQzVCLE1BQU0sS0FBSyxHQUF1QjtZQUNoQyxFQUFFLEVBQUUsTUFBTTtZQUNWLElBQUk7WUFDSixRQUFRLEVBQUUsQ0FBQyxLQUFLLENBQUMsUUFBUTtZQUN6QixNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFO1NBQzNCLENBQUE7UUFFRCxJQUFJLEtBQUssQ0FBQyxPQUFPLElBQUksS0FBSyxDQUFDLE9BQU8sS0FBSyxVQUFVLEVBQUU7WUFDakQsS0FBSyxDQUFDLE1BQU0sR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsQ0FBQTtTQUMxRDtRQUVELE1BQU0sSUFBSSxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLENBQUMsQ0FBQTtRQUMxRCxJQUFJLElBQUksRUFBRTtZQUNSLE1BQU0sVUFBVSxHQUFHLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQTtZQUN2QyxLQUFLLENBQUMsTUFBTTtnQkFDVixNQUFNLElBQUksVUFBVSxDQUFDLENBQUMsaUNBQU0sS0FBSyxDQUFDLE1BQU0sR0FBSyxVQUFVLEVBQUcsQ0FBQyxDQUFDLFVBQVUsQ0FBQTtTQUN6RTtRQUVELE9BQU8sS0FBSyxDQUFBO0lBQ2QsQ0FBQyxDQUFDLENBQUE7QUFDTixDQUFDO0FBNUJELHNDQTRCQztBQUtELFNBQWdCLGNBQWMsQ0FBQyxLQUFhO0lBQzFDLE1BQU0sT0FBTyxHQUF5QixDQUFDLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQztTQUNsRCxNQUFNLENBQUMsRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLENBQUM7U0FDekIsR0FBRyxDQUFDLFNBQVMsQ0FBQyxFQUFFO1FBQ2YsTUFBTSxNQUFNLEdBQUcsY0FBYyxDQUFDLFNBQVMsQ0FBb0IsQ0FBQTtRQUMzRCxPQUFPO1lBQ0wsRUFBRSxFQUFFLE9BQStCO1lBQ25DLElBQUksRUFBRSxTQUFTLENBQUMsSUFBSSxJQUFJLEVBQUU7WUFDMUIsUUFBUSxFQUFFLFVBQVUsQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDO1lBQ3RDLE1BQU07U0FDUCxDQUFBO0lBQ0gsQ0FBQyxDQUFDO1NBQ0QsS0FBSyxFQUFFLENBQUE7SUFFVixNQUFNLFdBQVcsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQTtJQUM3RCxJQUFJLFdBQVcsRUFBRTtRQUNmLE1BQU0sTUFBTSxHQUFHLGNBQWMsQ0FBQyxXQUFXLENBQXVCLENBQUE7UUFDaEUsT0FBTyxDQUFDLElBQUksQ0FBQztZQUNYLEVBQUUsRUFBRSxPQUFPO1lBQ1gsSUFBSSxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxDQUFDLElBQUksRUFBRTtZQUM3QyxRQUFRLEVBQUUsVUFBVSxDQUFDLFdBQVcsRUFBRSxLQUFLLENBQUM7WUFDeEMsTUFBTTtTQUNQLENBQUMsQ0FBQTtLQUNIO0lBRUQsT0FBTyxPQUFPLENBQUE7QUFDaEIsQ0FBQztBQTFCRCx3Q0EwQkM7QUFLRCxTQUFnQixjQUFjLENBQUMsS0FBYTtJQUMxQyxNQUFNLGNBQWMsR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEtBQUssWUFBWSxDQUFDLENBQUE7SUFDeEUsTUFBTSxnQkFBZ0IsR0FDcEIsY0FBYyxDQUFDLE1BQU0sR0FBRyxDQUFDO1FBQ3ZCLENBQUMsQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUNuQixDQUFDLEdBQW9CLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxpQ0FDeEIsR0FBRyxLQUNOLFVBQVUsa0NBQ0wsR0FBRyxDQUFDLFVBQVUsS0FDakIsQ0FBQyxDQUFDLENBQUMsSUFBSyxDQUFDLEVBQUUsY0FBYyxDQUFDLENBQUMsQ0FBQyxLQUU5QixRQUFRLEVBQUUsVUFBVSxDQUFDLENBQUMsRUFBRSxLQUFLLENBQUM7Z0JBQzVCLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsUUFBUSxJQUFJLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxJQUFLLENBQUM7Z0JBQ3BDLENBQUMsQ0FBQyxHQUFHLENBQUMsUUFBUSxJQUNoQixFQUNGLEVBQUUsVUFBVSxFQUFFLEVBQUUsRUFBRSxRQUFRLEVBQUUsRUFBRSxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsQ0FDakQ7UUFDSCxDQUFDLENBQUMsSUFBSSxDQUFBO0lBRVYsTUFBTSxRQUFRLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyxDQUFBO0lBRTFELElBQUksUUFBUSxFQUFFO1FBQ1osTUFBTSxVQUFVLEdBQUcsY0FBYyxDQUFDLFFBQVEsQ0FBQyxDQUFBO1FBQzNDLE1BQU0sRUFBRSxJQUFJLEVBQUUsR0FDWixPQUFPLElBQUksVUFBVSxJQUFJLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQTtRQUUzRSxPQUFPO1lBQ0wsT0FBTyxFQUFFO2dCQUNQLGtCQUFrQixFQUFFO29CQUNsQixNQUFNLEVBQUUsZ0JBQWdCO3dCQUN0QixDQUFDLENBQUMsRUFBRSxLQUFLLEVBQUUsQ0FBQyxVQUFVLEVBQUUsZ0JBQWdCLENBQUMsRUFBRTt3QkFDM0MsQ0FBQyxDQUFDLFVBQVU7aUJBQ2Y7YUFDRjtZQUNELFdBQVcsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxDQUFDO1lBQ3ZDLFFBQVEsRUFBRSxVQUFVLENBQUMsUUFBUSxFQUFFLEtBQUssQ0FBQztTQUN0QyxDQUFBO0tBQ0Y7U0FBTSxJQUFJLGdCQUFnQixFQUFFO1FBQzNCLE9BQU87WUFDTCxPQUFPLEVBQUUsRUFBRSxrQkFBa0IsRUFBRSxFQUFFLE1BQU0sRUFBRSxnQkFBZ0IsRUFBRSxFQUFFO1NBQzlELENBQUE7S0FDRjtBQUNILENBQUM7QUExQ0Qsd0NBMENDO0FBS0QsU0FBZ0IsY0FBYyxDQUFDLEtBQWE7SUFDMUMsTUFBTSxrQkFBa0IsR0FDdEIsS0FBSyxDQUFDLFVBQVUsQ0FBQyxJQUFJLEtBQUssTUFBTTtRQUM5QixDQUFDLENBQUMsa0JBQWtCO1FBQ3BCLENBQUMsQ0FBQywwQkFBMEIsQ0FBQTtJQUNoQyxNQUFNLFdBQVcsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxnQkFBZ0IsRUFBRSxFQUFFLElBQUksRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFBO0lBQzVFLE9BQU8sV0FBVyxDQUFDLENBQUMsQ0FBQyxXQUFXLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxrQkFBa0IsQ0FBQTtBQUM3RCxDQUFDO0FBUEQsd0NBT0M7QUFLRCxTQUFnQixhQUFhLENBQUMsS0FBYTtJQUN6QyxNQUFNLFdBQVcsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxnQkFBZ0IsRUFBRSxFQUFFLElBQUksRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFBO0lBQzVFLE9BQU8sV0FBVyxDQUFDLENBQUMsQ0FBQyxXQUFXLENBQUMsS0FBSyxHQUFHLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFBO0FBQ3JELENBQUM7QUFIRCxzQ0FHQztBQUtELFNBQWdCLFlBQVksQ0FBQyxLQUFhO0lBQ3hDLE1BQU0sV0FBVyxHQUFHLGNBQWMsQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUN6QyxNQUFNLGFBQWEsR0FBRyxhQUFhLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFMUMsT0FBTztRQUNMLENBQUMsYUFBYSxDQUFDLEVBQUU7WUFDZixPQUFPLEVBQUUsRUFBRSxDQUFDLFdBQVcsQ0FBQyxFQUFFLEVBQUUsRUFBRTtZQUM5QixXQUFXLEVBQUUscUJBQXFCO1NBQ25DO0tBQ0YsQ0FBQTtBQUNILENBQUM7QUFWRCxvQ0FVQztBQUtELFNBQWdCLE9BQU8sQ0FBQyxNQUFnQjtJQUN0QyxPQUFPO1FBQ0wsVUFBVSxFQUFFLEVBQUUsT0FBTyxFQUFFLEVBQUUsRUFBRTtRQUMzQixJQUFJLEVBQUUsRUFBRSxLQUFLLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUU7UUFDckMsT0FBTyxFQUFFLE9BQU87UUFDaEIsS0FBSyxFQUFFLFFBQVEsQ0FBQyxNQUFNLENBQUM7S0FDeEIsQ0FBQTtBQUNILENBQUM7QUFQRCwwQkFPQztBQUtELFNBQWdCLFVBQVUsQ0FBQyxLQUFhO0lBQ3RDLE9BQU8sQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQTtBQUN2RCxDQUFDO0FBRkQsZ0NBRUM7QUFLRCxTQUFnQixPQUFPLENBQUMsS0FBYTtJQUNuQyxPQUFPLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGFBQWEsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUE7QUFDL0UsQ0FBQztBQUZELDBCQUVDO0FBS0QsU0FBZ0Isb0JBQW9CLENBQUMsV0FBbUI7SUFDdEQsTUFBTSxNQUFNLEdBQUcsWUFBWSxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUM5QyxPQUFPLE1BQU07U0FDVixHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDO1NBQ3hELElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQTtBQUNiLENBQUM7QUFMRCxvREFLQztBQU1ELFNBQVMsVUFBVSxDQUFDLElBQTRCLEVBQUUsS0FBYTtJQUM3RCxNQUFNLGNBQWMsR0FBRyxDQUFDLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxPQUFPLEVBQUUsZ0NBQWdDLENBQUMsQ0FBQTtJQUM3RSxPQUFPLGNBQWMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLFFBQVEsS0FBSyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFBO0FBQ25FLENBQUM7QUFNRCxTQUFTLGNBQWMsQ0FDckIsS0FBd0I7SUFFeEIsTUFBTSxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLEtBQUssQ0FBQTtJQUVyRCxNQUFNLElBQUksR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLG1CQUFtQixFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUM1RSxJQUFJLENBQUMsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxPQUFPLEVBQUU7UUFDL0MsTUFBTSxLQUFLLEdBQUcsWUFBWTtZQUN4QixDQUFDLENBQUMsRUFBRSxJQUFJLEVBQUUsdUJBQXVCLEdBQUcsWUFBWSxDQUFDLElBQUksRUFBRTtZQUN2RCxDQUFDLENBQUMsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLENBQUE7UUFDdEIsT0FBTyxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLENBQUE7S0FDaEM7SUFDRCxJQUFJLFlBQVksRUFBRTtRQUNoQixPQUFPLEVBQUUsSUFBSSxFQUFFLHVCQUF1QixHQUFHLFlBQVksQ0FBQyxJQUFJLEVBQUUsQ0FBQTtLQUM3RDtJQUNELElBQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUN0QixJQUFJLENBQUMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxFQUFFO1lBQzVELE9BQU8sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLENBQUE7U0FDMUI7YUFBTSxJQUFJLENBQUMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxFQUFFO1lBQ3JDLE9BQU8sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLENBQUE7U0FDMUI7YUFBTSxJQUFJLENBQUMsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxFQUFFO1lBQ3RDLE9BQU8sRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLENBQUE7U0FDM0I7YUFBTSxJQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssUUFBUSxFQUFFO1lBQ2pDLE9BQU8sRUFBRSxJQUFJLEVBQUUsdUJBQXVCLEdBQUcsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFBO1NBQ3JEO0tBQ0Y7SUFFRCxPQUFPLEVBQUUsQ0FBQTtBQUNYLENBQUMifQ== | 81.915254 | 11,174 | 0.825988 |
800534f0f0e75bea724c033baef1b250da0bb050 | 697 | js | JavaScript | _book/libs/tippy-binding-0.1.0/tippy.js | cphthomas/stat2020 | d086b2dc0bccee8e7585784d7d018a823c48f2c8 | [
"CC0-1.0"
] | null | null | null | _book/libs/tippy-binding-0.1.0/tippy.js | cphthomas/stat2020 | d086b2dc0bccee8e7585784d7d018a823c48f2c8 | [
"CC0-1.0"
] | 3 | 2021-03-15T14:01:25.000Z | 2021-05-26T13:55:56.000Z | _book/libs/tippy-binding-0.1.0/tippy.js | cphthomas/stat2020 | d086b2dc0bccee8e7585784d7d018a823c48f2c8 | [
"CC0-1.0"
] | 2 | 2021-03-13T14:21:44.000Z | 2022-01-04T23:41:02.000Z | HTMLWidgets.widget({
name: 'tippy',
type: 'output',
factory: function(el, width, height) {
var id;
return {
renderValue: function(x) {
id = el.id
if(x.hasOwnProperty('element')){
tippy('#' + x.element, x.opts);
} else if(x.hasOwnProperty('class')){
if(x.hasOwnProperty('opts')){
tippy('.' + x.class, x.opts);
} else {
tippy('.' + x.class);
}
} else {
el.innerHTML = x.text;
el.setAttribute("data-tippy", x.tooltip);
tippy('#' + id, x.opts);
}
},
resize: function(width, height) {
}
};
}
});
| 17.425 | 51 | 0.443329 |