From 0488901fc2d3349ec3819f16891e2bb97159f6af Mon Sep 17 00:00:00 2001 From: Jens Ochsenmeier Date: Wed, 22 Nov 2023 11:56:45 +0100 Subject: [PATCH 1/5] wip --- .eslintignore | 3 + .eslintrc.cjs | 25 + README.md | 2 +- lib/charLS-DynamicMemory-browser.js | 64 - lib/jpeg-baseline.js | 1888 +++---- lib/jpeg-ls.js | 218 +- lib/jpx.js | 4051 --------------- package-lock.json | 2831 ++++++++++- package.json | 19 +- src/compression-utils.js | 76 +- src/dictionary.js | 7334 +++++++++++++-------------- src/image.js | 2630 +++++----- src/iterator.js | 54 +- src/license.js | 18 +- src/main.js | 59 +- src/orderedmap.js | 98 +- src/parser.js | 677 ++- src/rle.js | 305 +- src/series.js | 891 ++-- src/siemens.js | 237 +- src/tag.js | 1194 ++--- src/utilities.js | 442 +- tests/browser.html | 2 - tests/driver-deflated.js | 58 +- tests/driver-explicit-big.js | 61 +- tests/driver-explicit-little.js | 61 +- tests/driver-implicit.js | 61 +- tests/driver-jpeg-2000.js | 68 +- tests/driver-jpeg-baseline-8bit.js | 69 +- tests/driver-jpeg-lossless-sel1.js | 68 +- tests/driver-jpeg-ls.js | 69 +- tests/driver-rle.js | 68 +- tests/driver-series.js | 112 +- tests/driver-tags.js | 78 +- 34 files changed, 10872 insertions(+), 13019 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.cjs delete mode 100755 lib/charLS-DynamicMemory-browser.js delete mode 100755 lib/jpx.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..2eb0ba1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +build +release +lib/charLS-DynamicMemory-browser.js \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..3dc3e15 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,25 @@ +module.exports = { + env: { + browser: true, + jest: true + }, + root: true, + ignorePatterns: ['dist/**/*'], + extends: ['standard', 'plugin:prettier/recommended'], + plugins: ['prettier'], + rules: { + 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + camelcase: 'off', + 'import/order': 'error', + 'prettier/prettier': [ + 'error', + { + tabWidth: 2, + printWidth: 120, + singleQuote: true, + trailingComma: 'none', + semi: false + } + ] + } +} diff --git a/README.md b/README.md index 4d5e737..ecdf23a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ var series = new daikon.Series(); var files = fs.readdirSync('./data/volume/'); // iterate over files -for (var ctr in files) { +for (let ctr in files) { var name = './data/volume/' + files[ctr]; var buf = fs.readFileSync(name); diff --git a/lib/charLS-DynamicMemory-browser.js b/lib/charLS-DynamicMemory-browser.js deleted file mode 100755 index 5671834..0000000 --- a/lib/charLS-DynamicMemory-browser.js +++ /dev/null @@ -1,64 +0,0 @@ -/*! CharLS.js - v2.0.1 - 2016-06-08 | (c) 2016 Chris Hafey | https://github.com/chafey/charls */ - -/*! - Copyright (c) 2007-2010, Jan de Vaan - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of my employer, nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var CharLS = function(Module) { - Module = Module || {}; - -var Module;if(!Module)Module=(typeof CharLS!=="undefined"?CharLS:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&&!binary)ret=ret.toString();return ret};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available (jsc?)"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.log(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){eval.call(null,x)}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module["dynCall_"+sig].apply(null,args)}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i=TOTAL_MEMORY){var success=enlargeMemory();if(!success){DYNAMICTOP=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var __THREW__=0;var ABORT=false;var EXITSTATUS=0;var undef=0;var tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat;var tempI64,tempI64b;var tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var globalScope=this;function getCFunc(ident){var func=Module["_"+ident];if(!func){try{func=eval("_"+ident)}catch(e){}}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=Runtime.stackAlloc((str.length<<2)+1);writeStringToMemory(str,ret)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;function UTF8ArrayToString(u8Array,idx){var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;function UTF16ToString(ptr){var i=0;var str="";while(1){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)return str;++i;str+=String.fromCharCode(codeUnit)}}Module["UTF16ToString"]=UTF16ToString;function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}Module["stringToUTF16"]=stringToUTF16;function lengthBytesUTF16(str){return str.length*2}Module["lengthBytesUTF16"]=lengthBytesUTF16;function UTF32ToString(ptr){var i=0;var str="";while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}}Module["UTF32ToString"]=UTF32ToString;function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}Module["stringToUTF32"]=stringToUTF32;function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}Module["lengthBytesUTF32"]=lengthBytesUTF32;function demangle(func){var hasLibcxxabi=!!Module["___cxa_demangle"];if(hasLibcxxabi){try{var buf=_malloc(func.length);writeStringToMemory(func.substr(1),buf);var status=_malloc(4);var ret=Module["___cxa_demangle"](buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}}var i=3;var basicTypes={"v":"void","b":"bool","c":"char","s":"short","i":"int","l":"long","f":"float","d":"double","w":"wchar_t","a":"signed char","h":"unsigned char","t":"unsigned short","j":"unsigned int","m":"unsigned long","x":"long long","y":"unsigned long long","z":"..."};var subs=[];var first=true;function dump(x){if(x)Module.print(x);Module.print(func);var pre="";for(var a=0;a"}else{ret=name}paramLoop:while(i0){var c=func[i++];if(c in basicTypes){list.push(basicTypes[c])}else{switch(c){case"P":list.push(parse(true,1,true)[0]+"*");break;case"R":list.push(parse(true,1,true)[0]+"&");break;case"L":{i++;var end=func.indexOf("E",i);var size=end-i;list.push(func.substr(i,size));i+=size+2;break};case"A":{var size=parseInt(func.substr(i));i+=size.toString().length;if(func[i]!=="_")throw"?";i++;list.push(parse(true,1,true)[0]+" ["+size+"]");break};case"E":break paramLoop;default:ret+="?"+c;break paramLoop}}}if(!allowVoid&&list.length===1&&list[0]==="void")list=[];if(rawList){if(ret){list.push(ret+"?")}return list}else{return ret+flushList()}}var parsed=func;try{if(func=="Object._main"||func=="_main"){return"main()"}if(typeof func==="number")func=Pointer_stringify(func);if(func[0]!=="_")return func;if(func[1]!=="_")return func;if(func[2]!=="Z")return func;switch(func[3]){case"n":return"operator new()";case"d":return"operator delete()"}parsed=parse()}catch(e){parsed+="?"}if(parsed.indexOf("?")>=0&&!hasLibcxxabi){Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling")}return parsed}function demangleAll(text){return text.replace(/__Z[\w\d_]+/g,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(x){if(x%4096>0){x+=4096-x%4096}return x}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0,staticSealed=false;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;var DYNAMIC_BASE=0,DYNAMICTOP=0;function enlargeMemory(){var OLD_TOTAL_MEMORY=TOTAL_MEMORY;var LIMIT=Math.pow(2,31);if(DYNAMICTOP>=LIMIT)return false;while(TOTAL_MEMORY<=DYNAMICTOP){if(TOTAL_MEMORY=LIMIT)return false;try{if(ArrayBuffer.transfer){buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY)}else{var oldHEAP8=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return false}var success=_emscripten_replace_memory(buffer);if(!success)return false;Module["buffer"]=buffer;Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer);if(!ArrayBuffer.transfer){HEAP8.set(oldHEAP8)}return true}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);byteLength(new ArrayBuffer(4))}catch(e){byteLength=(function(buffer){return buffer.byteLength})}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;var totalMemory=64*1024;while(totalMemory0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Runtime.dynCall("v",func)}else{Runtime.dynCall("vi",func,[callback.arg])}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i255){chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i>0]=chr;i=i+1}}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){for(var i=0;i>0]=array[i]}}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){value=-2*half+value}return value}if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_min=Math.min;var Math_clz32=Math.clz32;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+59744;__ATINIT__.push({func:(function(){__GLOBAL__I_000101()})},{func:(function(){__GLOBAL__sub_I_jpegls_cpp()})},{func:(function(){__GLOBAL__sub_I_iostream_cpp()})});allocate([0,0,0,0,0,0,0,0,84,144,0,0,31,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,237,191,0,0,48,0,0,0,0,0,0,0,44,144,0,0,41,192,0,0,84,144,0,0,55,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,115,192,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,192,0,0,152,3,0,0,0,0,0,0,84,144,0,0,241,192,0,0,216,3,0,0,0,0,0,0,84,144,0,0,55,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,95,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,135,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,175,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,216,193,0,0,48,0,0,0,0,0,0,0,84,144,0,0,241,193,0,0,48,0,0,0,0,0,0,0,44,144,0,0,13,194,0,0,84,144,0,0,80,194,0,0,216,0,0,0,0,0,0,0,84,144,0,0,44,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,139,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,179,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,219,194,0,0,48,0,0,0,0,0,0,0,84,144,0,0,3,195,0,0,48,0,0,0,0,0,0,0,84,144,0,0,103,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,157,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,211,195,0,0,216,0,0,0,0,0,0,0,84,144,0,0,8,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,71,196,0,0,216,0,0,0,0,0,0,0,84,144,0,0,138,196,0,0,160,1,0,0,0,0,0,0,44,144,0,0,120,196,0,0,84,144,0,0,187,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,246,196,0,0,160,1,0,0,0,0,0,0,84,144,0,0,49,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,103,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,157,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,210,197,0,0,160,1,0,0,0,0,0,0,84,144,0,0,17,198,0,0,160,1,0,0,0,0,0,0,84,144,0,0,86,198,0,0,72,3,0,0,0,0,0,0,84,144,0,0,162,198,0,0,56,2,0,0,0,0,0,0,44,144,0,0,182,198,0,0,84,144,0,0,196,198,0,0,56,2,0,0,0,0,0,0,84,144,0,0,112,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,125,199,0,0,84,144,0,0,138,199,0,0,96,2,0,0,0,0,0,0,44,144,0,0,156,199,0,0,84,144,0,0,169,199,0,0,96,2,0,0,0,0,0,0,84,144,0,0,181,199,0,0,120,2,0,0,0,0,0,0,84,144,0,0,214,199,0,0,144,2,0,0,0,0,0,0,84,144,0,0,28,200,0,0,144,2,0,0,0,0,0,0,84,144,0,0,248,199,0,0,176,2,0,0,0,0,0,0,84,144,0,0,62,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,99,200,0,0,160,2,0,0,0,0,0,0,84,144,0,0,182,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,245,221,0,0,160,3,0,0,0,0,0,0,84,144,0,0,13,222,0,0,152,3,0,0,0,0,0,0,84,144,0,0,38,222,0,0,152,3,0,0,0,0,0,0,44,144,0,0,62,222,0,0,84,144,0,0,87,222,0,0,104,2,0,0,0,0,0,0,44,144,0,0,110,222,0,0,84,144,0,0,135,222,0,0,72,3,0,0,0,0,0,0,84,144,0,0,161,222,0,0,56,3,0,0,0,0,0,0,44,144,0,0,187,222,0,0,84,144,0,0,205,222,0,0,112,3,0,0,0,0,0,0,84,144,0,0,247,222,0,0,112,3,0,0,0,0,0,0,44,144,0,0,33,223,0,0,44,144,0,0,82,223,0,0,124,144,0,0,131,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,178,223,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,124,144,0,0,225,223,0,0,0,0,0,0,1,0,0,0,120,3,0,0,3,244,255,255,124,144,0,0,16,224,0,0,0,0,0,0,1,0,0,0,136,3,0,0,3,244,255,255,84,144,0,0,63,224,0,0,80,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,144,0,0,187,224,0,0,48,3,0,0,0,0,0,0,124,144,0,0,209,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,124,144,0,0,227,224,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,5,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,124,144,0,0,40,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,75,225,0,0,144,4,0,0,0,0,0,0,84,144,0,0,109,225,0,0,144,4,0,0,0,0,0,0,124,144,0,0,144,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,72,10,0,0,2,0,0,0,84,144,0,0,178,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,200,225,0,0,32,4,0,0,0,0,0,0,84,144,0,0,220,225,0,0,32,4,0,0,0,0,0,0,124,144,0,0,240,225,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,64,10,0,0,2,0,0,0,84,144,0,0,2,226,0,0,32,4,0,0,0,0,0,0,84,144,0,0,23,226,0,0,32,4,0,0,0,0,0,0,124,144,0,0,44,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,80,10,0,0,0,0,0,0,124,144,0,0,112,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,104,10,0,0,0,0,0,0,124,144,0,0,180,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,128,10,0,0,0,0,0,0,124,144,0,0,248,226,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,152,10,0,0,0,0,0,0,124,144,0,0,60,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,184,10,0,0,0,8,0,0,124,144,0,0,129,227,0,0,0,0,0,0,3,0,0,0,32,4,0,0,2,0,0,0,176,10,0,0,2,0,0,0,192,10,0,0,0,8,0,0,124,144,0,0,198,227,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,11,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,200,10,0,0,0,8,0,0,124,144,0,0,80,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,108,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,136,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,164,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,208,10,0,0,2,0,0,0,124,144,0,0,192,228,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,216,10,0,0,0,0,0,0,124,144,0,0,6,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,224,10,0,0,0,0,0,0,124,144,0,0,76,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,232,10,0,0,0,0,0,0,124,144,0,0,146,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,240,10,0,0,0,0,0,0,124,144,0,0,216,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,0,0,0,124,144,0,0,237,229,0,0,0,0,0,0,2,0,0,0,32,4,0,0,2,0,0,0,248,10,0,0,2,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,44,144,0,0,73,233,0,0,44,144,0,0,50,233,0,0,124,144,0,0,28,233,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,237,232,0,0,0,0,0,0,1,0,0,0,8,11,0,0,0,0,0,0,124,144,0,0,215,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,124,144,0,0,168,232,0,0,0,0,0,0,1,0,0,0,0,11,0,0,0,0,0,0,44,144,0,0,149,232,0,0,44,144,0,0,115,232,0,0,44,144,0,0,81,232,0,0,44,144,0,0,60,232,0,0,44,144,0,0,39,232,0,0,44,144,0,0,14,232,0,0,44,144,0,0,245,231,0,0,44,144,0,0,220,231,0,0,44,144,0,0,195,231,0,0,44,144,0,0,171,231,0,0,44,144,0,0,190,232,0,0,44,144,0,0,3,233],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);allocate([156,143,0,0,0,0,0,0,8,2,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,248,1,0,0,3,0,0,0,4,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,232,1,0,0,5,0,0,0,6,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,216,1,0,0,7,0,0,0,8,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,200,1,0,0,9,0,0,0,10,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0,184,1,0,0,11,0,0,0,12,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,0,0,0,0,168,1,0,0,13,0,0,0,14,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,144,1,0,0,15,0,0,0,16,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,128,1,0,0,17,0,0,0,18,0,0,0,9,0,0,0,1,0,0,0,9,0,0,0,0,0,0,0,112,1,0,0,19,0,0,0,20,0,0,0,10,0,0,0,2,0,0,0,10,0,0,0,0,0,0,0,96,1,0,0,21,0,0,0,22,0,0,0,11,0,0,0,3,0,0,0,11,0,0,0,0,0,0,0,80,1,0,0,23,0,0,0,24,0,0,0,12,0,0,0,4,0,0,0,12,0,0,0,0,0,0,0,64,1,0,0,25,0,0,0,26,0,0,0,13,0,0,0,5,0,0,0,13,0,0,0,0,0,0,0,240,0,0,0,27,0,0,0,28,0,0,0,14,0,0,0,6,0,0,0,14,0,0,0,0,0,0,0,224,0,0,0,29,0,0,0,30,0,0,0,15,0,0,0,7,0,0,0,15,0,0,0,0,0,0,0,16,0,0,0,31,0,0,0,32,0,0,0,16,0,0,0,8,0,0,0,16,0,0,0,0,0,0,0,200,0,0,0,33,0,0,0,34,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,184,0,0,0,33,0,0,0,35,0,0,0,3,0,0,0,4,0,0,0,56,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,200,255,255,255,200,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,56,0,0,0,0,0,0,0,104,0,0,0,40,0,0,0,41,0,0,0,200,255,255,255,200,255,255,255,104,0,0,0,42,0,0,0,43,0,0,0,0,0,0,0,88,0,0,0,44,0,0,0,45,0,0,0,17,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,17,0,0,0,3,0,0,0,18,0,0,0,104,141,0,0,64,141,0,0,84,141,0,0,124,141,0,0,0,0,0,0,32,0,0,0,46,0,0,0,47,0,0,0,6,0,0,0,7,0,0,0,0,0,0,0,56,0,0,0,48,0,0,0,49,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,72,0,0,0,50,0,0,0,51,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,120,0,0,0,52,0,0,0,53,0,0,0,12,0,0,0,13,0,0,0,0,0,0,0,136,0,0,0,54,0,0,0,55,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,152,0,0,0,56,0,0,0,57,0,0,0,16,0,0,0,17,0,0,0,0,0,0,0,168,0,0,0,58,0,0,0,59,0,0,0,18,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,216,0,0,0,60,0,0,0,61,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,62,0,0,0,63,0,0,0,20,0,0,0,21,0,0,0,0,0,0,0,16,1,0,0,64,0,0,0,65,0,0,0,22,0,0,0,23,0,0,0,0,0,0,0,32,1,0,0,66,0,0,0,67,0,0,0,24,0,0,0,25,0,0,0,0,0,0,0,48,1,0,0,68,0,0,0,69,0,0,0,26,0,0,0,27,0,0,0,0,0,0,0,160,1,0,0,70,0,0,0,71,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,24,2,0,0,72,0,0,0,73,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,0,0,0,0,40,2,0,0,74,0,0,0,75,0,0,0,18,0,0,0,0,0,0,0,64,2,0,0,76,0,0,0,77,0,0,0,19,0,0,0,2,0,0,0,0,0,0,0,80,2,0,0,78,0,0,0,79,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,104,2,0,0,80,0,0,0,81,0,0,0,7,0,0,0,0,0,0,0,128,2,0,0,82,0,0,0,83,0,0,0,8,0,0,0,0,0,0,0,160,2,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,2,0,0,0,9,0,0,0,28,0,0,0,0,0,0,0,208,2,0,0,84,0,0,0,88,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,3,0,0,0,10,0,0,0,29,0,0,0,0,0,0,0,224,2,0,0,84,0,0,0,89,0,0,0,86,0,0,0,87,0,0,0,6,0,0,0,4,0,0,0,11,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,1,203,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,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,88,146,0,0,200,146,0,0,56,147,0,0,56,147,0,0,120,187,0,0,168,155,0,0,168,149,0,0,0,0,0,0,10,0,0,0,100,0,0,0,232,3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5,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,0,0,0,0,0,0,0,0,0,0,7,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,0,0,0,0,255,255,255,255,255,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,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,9,0,0,0,159,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,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,9,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,9,0,0,0,151,215,0,0,0,4,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,255,255,255,255,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,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0,143,211,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,65,0,0,0,66,0,0,0,67,0,0,0,68,0,0,0,69,0,0,0,70,0,0,0,71,0,0,0,72,0,0,0,73,0,0,0,74,0,0,0,75,0,0,0,76,0,0,0,77,0,0,0,78,0,0,0,79,0,0,0,80,0,0,0,81,0,0,0,82,0,0,0,83,0,0,0,84,0,0,0,85,0,0,0,86,0,0,0,87,0,0,0,88,0,0,0,89,0,0,0,90,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+35640);allocate([1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,48,0,0,0,49,0,0,0,50,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,57,0,0,0,58,0,0,0,59,0,0,0,60,0,0,0,61,0,0,0,62,0,0,0,63,0,0,0,64,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,91,0,0,0,92,0,0,0,93,0,0,0,94,0,0,0,95,0,0,0,96,0,0,0,97,0,0,0,98,0,0,0,99,0,0,0,100,0,0,0,101,0,0,0,102,0,0,0,103,0,0,0,104,0,0,0,105,0,0,0,106,0,0,0,107,0,0,0,108,0,0,0,109,0,0,0,110,0,0,0,111,0,0,0,112,0,0,0,113,0,0,0,114,0,0,0,115,0,0,0,116,0,0,0,117,0,0,0,118,0,0,0,119,0,0,0,120,0,0,0,121,0,0,0,122,0,0,0,123,0,0,0,124,0,0,0,125,0,0,0,126,0,0,0,127],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+39844);allocate([240,2,0,0,90,0,0,0,91,0,0,0,20,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,10,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,14,0,0,0,20,0,0,0,0,0,0,0,0,3,0,0,90,0,0,0,92,0,0,0,21,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,15,0,0,0,16,0,0,0,21,0,0,0,15,0,0,0,22,0,0,0,0,0,0,0,16,3,0,0,93,0,0,0,94,0,0,0,22,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,17,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,16,0,0,0,24,0,0,0,0,0,0,0,32,3,0,0,93,0,0,0,95,0,0,0,23,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,19,0,0,0,20,0,0,0,25,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,56,3,0,0,96,0,0,0,97,0,0,0,7,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,3,0,0,93,0,0,0,98,0,0,0,17,0,0,0,1,0,0,0,6,0,0,0,32,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,18,0,0,0,4,0,0,0,23,0,0,0,3,0,0,0,26,0,0,0,0,0,0,0,160,3,0,0,90,0,0,0,99,0,0,0,24,0,0,0,12,0,0,0,5,0,0,0,31,0,0,0,14,0,0,0,11,0,0,0,13,0,0,0,12,0,0,0,13,0,0,0,19,0,0,0,15,0,0,0,22,0,0,0,8,0,0,0,0,0,0,0,168,3,0,0,100,0,0,0,101,0,0,0,248,255,255,255,248,255,255,255,168,3,0,0,102,0,0,0,103,0,0,0,8,0,0,0,0,0,0,0,192,3,0,0,104,0,0,0,105,0,0,0,248,255,255,255,248,255,255,255,192,3,0,0,106,0,0,0,107,0,0,0,4,0,0,0,0,0,0,0,216,3,0,0,36,0,0,0,37,0,0,0,252,255,255,255,252,255,255,255,216,3,0,0,38,0,0,0,39,0,0,0,4,0,0,0,0,0,0,0,240,3,0,0,108,0,0,0,109,0,0,0,252,255,255,255,252,255,255,255,240,3,0,0,110,0,0,0,111,0,0,0,0,0,0,0,96,3,0,0,112,0,0,0,113,0,0,0,7,0,0,0,0,0,0,0,112,3,0,0,114,0,0,0,115,0,0,0,0,0,0,0,8,4,0,0,72,0,0,0,116,0,0,0,21,0,0,0,1,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,117,0,0,0,118,0,0,0,119,0,0,0,1,0,0,0,33,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,5,0,0,120,0,0,0,121,0,0,0,119,0,0,0,2,0,0,0,34,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,5,0,0,122,0,0,0,123,0,0,0,119,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,5,0,0,124,0,0,0,125,0,0,0,119,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,5,0,0,126,0,0,0,127,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,23,0,0,0,5,0,0,0,24,0,0,0,1,0,0,0,2,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,5,0,0,128,0,0,0,129,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,25,0,0,0,9,0,0,0,26,0,0,0,3,0,0,0,4,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,5,0,0,130,0,0,0,131,0,0,0,119,0,0,0,22,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,1,0,0,0,248,255,255,255,224,5,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,6,0,0,132,0,0,0,133,0,0,0,119,0,0,0,30,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,2,0,0,0,248,255,255,255,8,6,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,6,0,0,134,0,0,0,135,0,0,0,119,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,6,0,0,136,0,0,0,137,0,0,0,119,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,6,0,0,138,0,0,0,139,0,0,0,119,0,0,0,38,0,0,0,39,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,40,0,0,0,29,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,6,0,0,140,0,0,0,141,0,0,0,119,0,0,0,41,0,0,0,42,0,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,43,0,0,0,35,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,6,0,0,142,0,0,0,143,0,0,0,119,0,0,0,44,0,0,0,45,0,0,0,37,0,0,0,38,0,0,0,39,0,0,0,40,0,0,0,46,0,0,0,41,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,6,0,0,144,0,0,0,145,0,0,0,119,0,0,0,47,0,0,0,48,0,0,0,43,0,0,0,44,0,0,0,45,0,0,0,46,0,0,0,49,0,0,0,47,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,6,0,0,146,0,0,0,147,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,7,0,0,148,0,0,0,149,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,7,0,0,150,0,0,0,151,0,0,0,119,0,0,0,1,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,7,0,0,152,0,0,0,153,0,0,0,119,0,0,0,2,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,7,0,0,154,0,0,0,155,0,0,0,119,0,0,0,19,0,0,0,7,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,144,7,0,0,156,0,0,0,157,0,0,0,119,0,0,0,20,0,0,0,8,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,4,0,0,158,0,0,0,159,0,0,0,119,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,32,5,0,0,160,0,0,0,161,0,0,0,119,0,0,0,27,0,0,0,21,0,0,0,28,0,0,0,22,0,0,0,29,0,0,0,9,0,0,0,23,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,4,0,0,162,0,0,0,163,0,0,0,119,0,0,0,3,0,0,0,4,0,0,0,12,0,0,0,50,0,0,0,51,0,0,0,13,0,0,0,52,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,0,0,0,0,0,64,5,0,0,164,0,0,0,165,0,0,0,119,0,0,0,53,0,0,0,54,0,0,0,51,0,0,0,52,0,0,0,53,0,0,0,0,0,0,0,80,5,0,0,166,0,0,0,167,0,0,0,119,0,0,0,55,0,0,0,56,0,0,0,54,0,0,0,55,0,0,0,56,0,0,0,0,0,0,0,32,4,0,0,168,0,0,0,169,0,0,0,119,0,0,0,0,0,0,0,48,4,0,0,168,0,0,0,170,0,0,0,119,0,0,0,24,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,30,0,0,0,25,0,0,0,31,0,0,0,26,0,0,0,32,0,0,0,13,0,0,0,27,0,0,0,14,0,0,0,0,0,0,0,80,4,0,0,168,0,0,0,171,0,0,0,119,0,0,0,5,0,0,0,6,0,0,0,15,0,0,0,57,0,0,0,58,0,0,0,16,0,0,0,59,0,0,0,0,0,0,0,112,4,0,0,168,0,0,0,172,0,0,0,119,0,0,0,7,0,0,0,8,0,0,0,17,0,0,0,60,0,0,0,61,0,0,0,18,0,0,0,62,0,0,0,0,0,0,0,144,4,0,0,168,0,0,0,173,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,176,4,0,0,168,0,0,0,174,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,192,4,0,0,168,0,0,0,175,0,0,0,119,0,0,0,9,0,0,0,10,0,0,0,19,0,0,0,63,0,0,0,64,0,0,0,20,0,0,0,65,0,0,0,0,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,0,0,0,37,0,0,0,89,0,0,0,45,0,0,0,37,0,0,0,109,0,0,0,45,0,0,0,37,0,0,0,100,0,0,0,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,0,0,0,114,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,102,0,0,0,97,0,0,0,108,0,0,0,115,0,0,0,101,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,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,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,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,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,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,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,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,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,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,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,110,0,0,0,101,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,114,0,0,0,115,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,0,0,0,117,0,0,0,114,0,0,0,100,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,83,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,77,0,0,0,111,0,0,0,110,0,0,0,0,0,0,0,84,0,0,0,117,0,0,0,101,0,0,0,0,0,0,0,87,0,0,0,101,0,0,0,100,0,0,0,0,0,0,0,84,0,0,0,104,0,0,0,117,0,0,0,0,0,0,0,70,0,0,0,114,0,0,0,105,0,0,0,0,0,0,0,83,0,0,0,97,0,0,0,116,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,114,0,0,0,117,0,0,0,97,0,0,0,114,0,0,0,121,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,99,0,0,0,104,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,105,0,0,0,108,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,121,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,101,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,121,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,117,0,0,0,115,0,0,0,116,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,116,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,111,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,0,0,0,101,0,0,0,109,0,0,0,98,0,0,0,101,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,97,0,0,0,110,0,0,0,0,0,0,0,70,0,0,0,101,0,0,0,98,0,0,0,0,0,0,0,77,0,0,0,97,0,0,0,114,0,0,0,0,0,0,0,65,0,0,0,112,0,0,0,114,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,110,0,0,0,0,0,0,0,74,0,0,0,117,0,0,0,108,0,0,0,0,0,0,0,65,0,0,0,117,0,0,0,103,0,0,0,0,0,0,0,83,0,0,0,101,0,0,0,112,0,0,0,0,0,0,0,79,0,0,0,99,0,0,0,116,0,0,0,0,0,0,0,78,0,0,0,111,0,0,0,118,0,0,0,0,0,0,0,68,0,0,0,101,0,0,0,99,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,77,0,0,0,0,0,0,0,80,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0,0,0,109,0,0,0,47,0,0,0,37,0,0,0,100,0,0,0,47,0,0,0,37,0,0,0,121,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,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,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,37,0,0,0,97,0,0,0,32,0,0,0,37,0,0,0,98,0,0,0,32,0,0,0,37,0,0,0,100,0,0,0,32,0,0,0,37,0,0,0,72,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,89,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,37,0,0,0,73,0,0,0,58,0,0,0,37,0,0,0,77,0,0,0,58,0,0,0,37,0,0,0,83,0,0,0,32,0,0,0,37,0,0,0,112,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,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,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,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,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,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,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,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,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,32,2,32,2,32,2,32,2,32,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1,96,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,8,216,4,192,4,192,4,192,4,192,4,192,4,192,4,192,8,213,8,213,8,213,8,213,8,213,8,213,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,8,197,4,192,4,192,4,192,4,192,4,192,4,192,8,214,8,214,8,214,8,214,8,214,8,214,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,8,198,4,192,4,192,4,192,4,192,2,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,97,119,83,116,114,101,97,109,32,111,114,32,114,97,119,68,97,116,97,32,110,101,101,100,115,32,116,111,32,114,101,102,101,114,101,110,99,101,32,116,111,32,115,111,109,101,116,104,105,110,103,0,119,105,100,116,104,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,104,101,105,103,104,116,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,54,53,53,51,53,93,0,98,105,116,115,112,101,114,115,97,109,112,108,101,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,50,44,32,49,54,93,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,110,101,101,100,115,32,116,111,32,98,101,32,115,101,116,32,116,111,32,97,32,118,97,108,117,101,32,111,102,32,123,78,111,110,101,44,32,83,97,109,112,108,101,44,32,76,105,110,101,125,0,99,111,109,112,111,110,101,110,116,115,32,110,101,101,100,115,32,116,111,32,98,101,32,105,110,32,116,104,101,32,114,97,110,103,101,32,91,49,44,32,50,53,53,93,0,117,110,99,111,109,112,114,101,115,115,101,100,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,119,105,116,104,32,116,104,101,32,111,116,104,101,114,32,112,97,114,97,109,101,116,101,114,115,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,110,111,116,32,98,101,32,115,101,116,32,116,111,32,83,97,109,112,108,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,52,0,105,110,116,101,114,108,101,97,118,101,77,111,100,101,32,99,97,110,32,111,110,108,121,32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,32,105,110,32,99,111,109,98,105,110,97,116,105,111,110,32,119,105,116,104,32,99,111,109,112,111,110,101,110,116,115,32,61,32,49,0,67,111,108,111,114,32,116,114,97,110,115,102,111,114,109,97,116,105,111,110,32,0,78,111,32,109,111,114,101,32,98,121,116,101,115,32,97,118,97,105,108,97,98,108,101,32,105,110,32,105,110,112,117,116,32,98,117,102,102,101,114,44,32,115,116,105,108,108,32,110,101,101,100,101,100,105,110,103,32,0,65,110,32,111,100,100,32,110,117,109,98,101,114,32,111,102,32,98,121,116,101,115,32,40,0,41,32,99,97,110,110,111,116,32,98,101,32,115,119,97,112,112,101,100,46,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,69,0,49,49,80,114,111,99,101,115,115,76,105,110,101,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,54,84,114,97,110,115,102,111,114,109,83,104,105,102,116,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,105,110,103,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,57,98,97,115,105,99,95,111,115,116,114,105,110,103,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,78,83,95,57,97,108,108,111,99,97,116,111,114,73,99,69,69,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,116,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,116,69,69,0,50,50,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,83,116,114,101,97,109,0,50,53,80,111,115,116,80,114,111,99,101,115,83,105,110,103,108,101,67,111,109,112,111,110,101,110,116,0,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,51,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,50,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,50,84,114,97,110,115,102,111,114,109,72,112,49,73,104,69,69,0,49,56,80,114,111,99,101,115,115,84,114,97,110,115,102,111,114,109,101,100,73,49,51,84,114,97,110,115,102,111,114,109,78,111,110,101,73,104,69,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,69,110,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,116,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,116,55,84,114,105,112,108,101,116,73,116,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,55,84,114,105,112,108,101,116,73,104,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,54,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,116,76,105,49,50,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,104,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,53,76,111,115,115,108,101,115,115,84,114,97,105,116,115,84,73,55,84,114,105,112,108,101,116,73,104,69,76,105,56,69,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,56,74,108,115,67,111,100,101,99,73,49,52,68,101,102,97,117,108,116,84,114,97,105,116,115,84,73,104,104,69,49,53,68,101,99,111,100,101,114,83,116,114,97,116,101,103,121,69,0,67,104,97,114,76,83,32,101,114,114,111,114,0,99,104,97,114,108,115,0,49,53,99,104,97,114,108,115,95,99,97,116,101,103,111,114,121,0,112,97,114,97,109,115,46,88,116,104,117,109,98,110,97,105,108,32,105,115,32,62,32,48,32,98,117,116,32,112,97,114,97,109,115,46,116,104,117,109,98,110,97,105,108,32,61,61,32,110,117,108,108,95,112,116,114,0,49,55,74,112,101,103,77,97,114,107,101,114,83,101,103,109,101,110,116,0,49,49,74,112,101,103,83,101,103,109,101,110,116,0,50,48,74,112,101,103,73,109,97,103,101,68,97,116,97,83,101,103,109,101,110,116,0,69,120,112,101,99,116,101,100,32,74,80,69,71,32,77,97,114,107,101,114,32,115,116,97,114,116,32,98,121,116,101,32,48,120,70,70,32,98,117,116,32,116,104,101,32,98,121,116,101,32,118,97,108,117,101,32,119,97,115,32,48,120,0,74,80,69,71,32,101,110,99,111,100,105,110,103,32,119,105,116,104,32,109,97,114,107,101,114,32,0,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,46,0,85,110,107,110,111,119,110,32,74,80,69,71,32,109,97,114,107,101,114,32,0,32,101,110,99,111,117,110,116,101,114,101,100,46,0,109,114,102,120,0,83,116,57,98,97,100,95,97,108,108,111,99,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,49,51,114,117,110,116,105,109,101,95,101,114,114,111,114,0,83,116,57,116,121,112,101,95,105,110,102,111,0,83,116,56,98,97,100,95,99,97,115,116,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,49,95,95,118,109,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,33,34,98,97,115,105,99,95,115,116,114,105,110,103,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,115,116,114,105,110,103,0,95,95,116,104,114,111,119,95,108,101,110,103,116,104,95,101,114,114,111,114,0,33,34,118,101,99,116,111,114,32,108,101,110,103,116,104,95,101,114,114,111,114,34,0,47,85,115,101,114,115,47,99,104,97,102,101,121,47,101,109,115,100,107,95,112,111,114,116,97,98,108,101,47,101,109,115,99,114,105,112,116,101,110,47,49,46,51,53,46,48,47,115,121,115,116,101,109,47,105,110,99,108,117,100,101,47,108,105,98,99,120,120,47,118,101,99,116,111,114,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,115,116,100,58,58,98,97,100,95,97,108,108,111,99,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,116,104,114,101,119,32,97,110,32,101,120,99,101,112,116,105,111,110,0,115,116,100,58,58,98,97,100,95,99,97,115,116,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+42396);allocate([32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,105,110,102,105,110,105,116,121,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,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,255,255,255,255,255,255,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,80,79,83,73,88],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+52636);allocate([17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,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,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,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,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,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,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,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,18,0,0,0,18,18,18,0,0,0,0,0,0,9,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,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,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,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,119,69,69,0,117,110,115,117,112,112,111,114,116,101,100,32,108,111,99,97,108,101,32,102,111,114,32,115,116,97,110,100,97,114,100,32,105,110,112,117,116,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,115,116,100,111,117,116,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,48,95,95,115,116,100,105,110,98,117,102,73,99,69,69,0,78,83,116,51,95,95,49,49,52,95,95,115,104,97,114,101,100,95,99,111,117,110,116,69,0,78,83,116,51,95,95,49,49,50,115,121,115,116,101,109,95,101,114,114,111,114,69,0,78,83,116,51,95,95,49,49,52,101,114,114,111,114,95,99,97,116,101,103,111,114,121,69,0,78,83,116,51,95,95,49,49,50,95,95,100,111,95,109,101,115,115,97,103,101,69,0,58,32,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,55,102,97,105,108,117,114,101,69,0,78,83,116,51,95,95,49,56,105,111,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,57,98,97,115,105,99,95,105,111,115,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,53,98,97,115,105,99,95,115,116,114,101,97,109,98,117,102,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,105,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,0,78,83,116,51,95,95,49,49,51,98,97,115,105,99,95,111,115,116,114,101,97,109,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,0,78,83,116,51,95,95,49,49,57,95,95,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,69,0,105,111,115,95,98,97,115,101,58,58,99,108,101,97,114,0,105,111,115,116,114,101,97,109,0,117,110,115,112,101,99,105,102,105,101,100,32,105,111,115,116,114,101,97,109,95,99,97,116,101,103,111,114,121,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,65,66,67,68,69,70,120,88,43,45,112,80,105,73,110,78,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,102,97,99,101,116,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,119,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,99,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,115,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,68,105,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,49,54,95,95,110,97,114,114,111,119,95,116,111,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,49,55,95,95,119,105,100,101,110,95,102,114,111,109,95,117,116,102,56,73,76,106,51,50,69,69,69,0,78,83,116,51,95,95,49,55,99,111,100,101,99,118,116,73,119,99,49,49,95,95,109,98,115,116,97,116,101,95,116,69,69,0,78,83,116,51,95,95,49,54,108,111,99,97,108,101,53,95,95,105,109,112,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,99,69,69,0,78,83,116,51,95,95,49,55,99,111,108,108,97,116,101,73,119,69,69,0,78,83,116,51,95,95,49,53,99,116,121,112,101,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,99,69,69,0,78,83,116,51,95,95,49,56,110,117,109,112,117,110,99,116,73,119,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,55,110,117,109,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,116,105,109,101,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,99,76,98,49,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,48,69,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,112,117,110,99,116,73,119,76,98,49,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,99,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,103,101,116,73,119,78,83,95,49,57,105,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,99,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,99,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,99,69,69,69,69,69,69,0,78,83,116,51,95,95,49,57,109,111,110,101,121,95,112,117,116,73,119,78,83,95,49,57,111,115,116,114,101,97,109,98,117,102,95,105,116,101,114,97,116,111,114,73,119,78,83,95,49,49,99,104,97,114,95,116,114,97,105,116,115,73,119,69,69,69,69,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,99,69,69,0,78,83,116,51,95,95,49,56,109,101,115,115,97,103,101,115,73,119,69,69,0,37,112,0,67,0,37,0,0,0,0,0,108,0,108,108,0,0,76,0,37,112,0,0,0,0,37,72,58,37,77,58,37,83,37,109,47,37,100,47,37,121,37,89,45,37,109,45,37,100,37,73,58,37,77,58,37,83,32,37,112,37,72,58,37,77,37,72,58,37,77,58,37,83,108,111,99,97,108,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,48,49,50,51,52,53,54,55,56,57,0,37,76,102,0,109,111,110,101,121,95,103,101,116,32,101,114,114,111,114,0,48,49,50,51,52,53,54,55,56,57,0,37,46,48,76,102,0,116,114,117,101,0,102,97,108,115,101,0,83,117,110,100,97,121,0,77,111,110,100,97,121,0,84,117,101,115,100,97,121,0,87,101,100,110,101,115,100,97,121,0,84,104,117,114,115,100,97,121,0,70,114,105,100,97,121,0,83,97,116,117,114,100,97,121,0,83,117,110,0,77,111,110,0,84,117,101,0,87,101,100,0,84,104,117,0,70,114,105,0,83,97,116,0,74,97,110,117,97,114,121,0,70,101,98,114,117,97,114,121,0,77,97,114,99,104,0,65,112,114,105,108,0,77,97,121,0,74,117,110,101,0,74,117,108,121,0,65,117,103,117,115,116,0,83,101,112,116,101,109,98,101,114,0,79,99,116,111,98,101,114,0,78,111,118,101,109,98,101,114,0,68,101,99,101,109,98,101,114,0,74,97,110,0,70,101,98,0,77,97,114,0,65,112,114,0,74,117,110,0,74,117,108,0,65,117,103,0,83,101,112,0,79,99,116,0,78,111,118,0,68,101,99,0,65,77,0,80,77,0,37,109,47,37,100,47,37,121,0,37,72,58,37,77,58,37,83,0,37,97,32,37,98,32,37,100,32,37,72,58,37,77,58,37,83,32,37,89,0,37,73,58,37,77,58,37,83,32,37,112,0,78,83,116,51,95,95,49,49,51,109,101,115,115,97,103,101,115,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,49,95,95,109,111,110,101,121,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,48,109,111,110,101,121,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,95,95,116,105,109,101,95,112,117,116,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,119,69,69,0,78,83,116,51,95,95,49,50,48,95,95,116,105,109,101,95,103,101,116,95,99,95,115,116,111,114,97,103,101,73,99,69,69,0,78,83,116,51,95,95,49,57,116,105,109,101,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,112,117,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,112,117,116,73,99,69,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,119,69,69,0,78,83,116,51,95,95,49,49,52,95,95,110,117,109,95,103,101,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,57,95,95,110,117,109,95,103,101,116,73,99,69,69,0,78,83,116,51,95,95,49,49,50,99,111,100,101,99,118,116,95,98,97,115,101,69,0,78,83,116,51,95,95,49,49,48,99,116,121,112,101,95,98,97,115,101,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+56215);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function copyTempFloat(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3]}function copyTempDouble(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3];HEAP8[tempDoublePtr+4]=HEAP8[ptr+4];HEAP8[tempDoublePtr+5]=HEAP8[ptr+5];HEAP8[tempDoublePtr+6]=HEAP8[ptr+6];HEAP8[tempDoublePtr+7]=HEAP8[ptr+7]}function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}Module["_i64Subtract"]=_i64Subtract;function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var ptr in EXCEPTIONS.infos){var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0){if(info.destructor){Runtime.dynCall("vi",info.destructor,[ptr])}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}EXCEPTIONS.clearRef(EXCEPTIONS.deAdjust(ptr));throw ptr}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(asm["setTempRet0"](0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(asm["setTempRet0"](0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i>2];info.adjusted=thrown;return(asm["setTempRet0"](typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(asm["setTempRet0"](throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr}Module["_memset"]=_memset;var _BDtoILow=true;var _emscripten_resume=true;function ___gxx_personality_v0(){}var _emscripten_landingpad=true;function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){return leadingNulls(date.tm_hour<13?date.tm_hour:date.tm_hour-12,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>0&&date.tm_hour<13){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function _abort(){Module["abort"]()}function _free(){}Module["_free"]=_free;function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}function ___cxa_end_catch(){if(___cxa_end_catch.rethrown){___cxa_end_catch.rethrown=false;return}asm["setThrew"](0);var ptr=EXCEPTIONS.caught.pop();if(ptr){EXCEPTIONS.decRef(EXCEPTIONS.deAdjust(ptr));EXCEPTIONS.last=0}}function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.seen={};if(ptr in _pthread_once.seen)return;Runtime.dynCall("v",func);_pthread_once.seen[ptr]=1}function ___lock(){}function ___unlock(){}var PTHREAD_SPECIFIC={};function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}var _fabs=Math_abs;var PTHREAD_SPECIFIC_NEXT_KEY=1;function _pthread_key_create(key,destructor){if(key==0){return ERRNO_CODES.EINVAL}HEAP32[key>>2]=PTHREAD_SPECIFIC_NEXT_KEY;PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0;PTHREAD_SPECIFIC_NEXT_KEY++;return 0}var PATH=undefined;function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){setTimeout(Browser.mainLoop.runner,value)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(!window["setImmediate"]){var setImmediates=[];var emscriptenMainLoopMessageId="__emcc";function Browser_setImmediate_messageHandler(event){if(event.source===window&&event.data===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}}window.addEventListener("message",Browser_setImmediate_messageHandler,true);window["setImmediate"]=function Browser_emulated_setImmediate(func){setImmediates.push(func);window.postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){window["setImmediate"](Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noSetTiming){Module["noExitRuntime"]=true;assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=func;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();setTimeout(Browser.mainLoop.runner,0);return}if(thisMainLoopId1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}if(Browser.mainLoop.method==="timeout"&&Module.ctx){Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");Browser.mainLoop.method=""}Browser.mainLoop.runIter((function(){if(typeof arg!=="undefined"){Runtime.dynCall("vi",func,[arg])}else{Runtime.dynCall("v",func)}}));if(thisMainLoopId0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"SimulateInfiniteLoop"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:(function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++}),resume:(function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()}),updateStatus:(function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout((function(){finish(audio)}),1e4)}else{return fail()}};Module["preloadPlugins"].push(audioPlugin);var canvas=Module["canvas"];function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===canvas||document["mozPointerLockElement"]===canvas||document["webkitPointerLockElement"]===canvas||document["msPointerLockElement"]===canvas}if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(function(){});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(function(){});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",(function(ev){if(!Browser.pointerLock&&canvas.requestPointerLock){canvas.requestPointerLock();ev.preventDefault()}}),false)}}}),createContext:(function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}canvas.style.backgroundColor="black"}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach((function(callback){callback()}));Browser.init()}return ctx}),destroyContext:(function(canvas,useWebGL,setInModule){}),fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:(function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;var canvas=Module["canvas"];function fullScreenChange(){Browser.isFullScreen=false;var canvasContainer=canvas.parentNode;if((document["webkitFullScreenElement"]||document["webkitFullscreenElement"]||document["mozFullScreenElement"]||document["mozFullscreenElement"]||document["fullScreenElement"]||document["fullscreenElement"]||document["msFullScreenElement"]||document["msFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.cancelFullScreen=document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["webkitCancelFullScreen"]||document["msExitFullscreen"]||document["exitFullscreen"]||(function(){});canvas.cancelFullScreen=canvas.cancelFullScreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullScreen=true;if(Browser.resizeCanvas)Browser.setFullScreenCanvasSize()}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas)Browser.setWindowedCanvasSize()}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullScreen);Browser.updateCanvasDimensions(canvas)}if(!Browser.fullScreenHandlersInstalled){Browser.fullScreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullScreenChange,false);document.addEventListener("mozfullscreenchange",fullScreenChange,false);document.addEventListener("webkitfullscreenchange",fullScreenChange,false);document.addEventListener("MSFullscreenChange",fullScreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullScreen=canvasContainer["requestFullScreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullScreen"]?(function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null);if(vrDevice){canvasContainer.requestFullScreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullScreen()}}),nextRAF:0,fakeRequestAnimationFrame:(function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)}),requestAnimationFrame:function requestAnimationFrame(func){if(typeof window==="undefined"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window["requestAnimationFrame"]||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:(function(func){return(function(){if(!ABORT)return func.apply(null,arguments)})}),allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=false}),resumeAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach((function(func){func()}))}}),safeRequestAnimationFrame:(function(func){return Browser.requestAnimationFrame((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}))}),safeSetTimeout:(function(func,timeout){Module["noExitRuntime"]=true;return setTimeout((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}),timeout)}),safeSetInterval:(function(func,timeout){Module["noExitRuntime"]=true;return setInterval((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}}),timeout)}),getMimetype:(function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]}),getUserMedia:(function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)}),getMovementX:(function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0}),getMovementY:(function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0}),getMouseWheelDelta:(function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail;break;case"mousewheel":delta=event.wheelDelta;break;case"wheel":delta=event["deltaY"];break;default:throw"unrecognized mouse wheel event: "+event.type}return delta}),mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:(function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!=="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!=="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}}),xhrLoad:(function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)}),asyncLoad:(function(url,onload,onerror,noRunDep){Browser.xhrLoad(url,(function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(!noRunDep)removeRunDependency("al "+url)}),(function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}}));if(!noRunDep)addRunDependency("al "+url)}),resizeListeners:[],updateResizeListeners:(function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach((function(listener){listener(canvas.width,canvas.height)}))}),setCanvasSize:(function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()}),windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags|8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),setWindowedCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags&~8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),updateCanvasDimensions:(function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_i64Add"]=_i64Add;Module["_bitshift64Lshr"]=_bitshift64Lshr;function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}var _BDtoIHigh=true;function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Runtime.dynCall("vi",routine,[arg])}));_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cond_broadcast(){return 0}function ___cxa_guard_acquire(variable){if(!HEAP8[variable>>0]){HEAP8[variable>>0]=1;return 1}return 0}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}function ___cxa_guard_release(){}function ___cxa_begin_catch(ptr){__ZSt18uncaught_exceptionv.uncaught_exception--;EXCEPTIONS.caught.push(ptr);EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(ptr));return ptr}function _llvm_eh_typeid_for(type){return type}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _pthread_mutex_lock(){}var _emscripten_postinvoke=true;function _sbrk(bytes){var self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);self.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=(function(){abort("cannot dynamically allocate, sbrk now has control")})}var ret=DYNAMICTOP;if(bytes!=0){var success=self.alloc(bytes);if(!success)return-1>>>0}return ret}Module["_bitshift64Shl"]=_bitshift64Shl;function ___cxa_guard_abort(){}Module["_memmove"]=_memmove;var _emscripten_preinvoke=true;var _BItoD=true;function _pthread_cond_wait(){return 0}function ___cxa_rethrow(){___cxa_end_catch.rethrown=true;var ptr=EXCEPTIONS.caught.pop();EXCEPTIONS.last=ptr;throw ptr}function _pthread_mutex_unlock(){}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _pthread_self(){return 0}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;if(!___syscall146.buffer)___syscall146.buffer=[];var buffer=___syscall146.buffer;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j2147483648)return false;i=new a(newBuffer);j=new b(newBuffer);k=new c(newBuffer);l=new d(newBuffer);m=new e(newBuffer);n=new f(newBuffer);o=new g(newBuffer);p=new h(newBuffer);buffer=newBuffer;return true} -// EMSCRIPTEN_START_FUNCS -function dc(a){a=a|0;var b=0;b=r;r=r+a|0;r=r+15&-16;return b|0}function ec(){return r|0}function fc(a){a=a|0;r=a}function gc(a,b){a=a|0;b=b|0;r=a;s=b}function hc(a,b){a=a|0;b=b|0;if(!x){x=a;y=b}}function ic(a){a=a|0;i[t>>0]=i[a>>0];i[t+1>>0]=i[a+1>>0];i[t+2>>0]=i[a+2>>0];i[t+3>>0]=i[a+3>>0]}function jc(a){a=a|0;i[t>>0]=i[a>>0];i[t+1>>0]=i[a+1>>0];i[t+2>>0]=i[a+2>>0];i[t+3>>0]=i[a+3>>0];i[t+4>>0]=i[a+4>>0];i[t+5>>0]=i[a+5>>0];i[t+6>>0]=i[a+6>>0];i[t+7>>0]=i[a+7>>0]}function kc(a){a=a|0;M=a}function lc(){return M|0}function mc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0;v=r;r=r+128|0;n=v+44|0;q=v+8|0;j=v+4|0;m=v;o=c+4|0;p=c+8|0;x=0;Ja(35,k[c>>2]|0,k[o>>2]|0,k[p>>2]|0,d|0);l=x;x=0;if(!(l&1)){g=n;f=g+84|0;do{k[g>>2]=k[d>>2];g=g+4|0;d=d+4|0}while((g|0)<(f|0));d=n+12|0;if((k[d>>2]|0)==0?(h=ia(((k[n+8>>2]|0)+7|0)/8|0,k[n>>2]|0)|0,k[d>>2]=h,(k[n+24>>2]|0)!=0):0){l=ia(k[n+16>>2]|0,h)|0;k[d>>2]=l}x=0;qa(176,q|0);l=x;x=0;if(!(l&1)){d=n+56|0;do if(k[d>>2]|0){x=0;d=ta(66,d|0)|0;l=x;x=0;if(!(l&1)){k[j>>2]=d;f=q+28|0;g=k[f>>2]|0;if(g>>>0<(k[q+32>>2]|0)>>>0){k[g>>2]=d;k[f>>2]=g+4;k[j>>2]=0;s=19;break}x=0;ra(57,q+24|0,j|0);l=x;x=0;if(l&1){f=Wa(824,0)|0;d=M;g=k[j>>2]|0;k[j>>2]=0;if(!g)break;Lb[k[(k[g>>2]|0)+4>>2]&255](g);break}else{d=k[j>>2]|0;k[j>>2]=0;if(!d){s=19;break}Lb[k[(k[d>>2]|0)+4>>2]&255](d);s=19;break}}else s=15}else s=19;while(0);a:do if((s|0)==19){g=n+4|0;h=n+8|0;j=n+16|0;x=0;d=Ea(14,k[n>>2]|0,k[g>>2]|0,k[h>>2]|0,k[j>>2]|0)|0;l=x;x=0;if(!(l&1)){k[m>>2]=d;l=q+28|0;f=k[l>>2]|0;do if(f>>>0>=(k[q+32>>2]|0)>>>0){x=0;ra(57,q+24|0,m|0);f=x;x=0;if(f&1){f=Wa(824,0)|0;d=M;g=k[m>>2]|0;k[m>>2]=0;if(!g)break a;Lb[k[(k[g>>2]|0)+4>>2]&255](g);break a}else{d=k[m>>2]|0;k[m>>2]=0;if(!d)break;Lb[k[(k[d>>2]|0)+4>>2]&255](d);break}}else{k[f>>2]=d;k[l>>2]=f+4;k[m>>2]=0}while(0);d=k[n+28>>2]|0;if((d|0)!=0?(x=0,ra(58,q|0,d|0),s=x,x=0,s&1):0){s=15;break}b:do if(!(k[n+24>>2]|0)){d=ia(k[g>>2]|0,k[n>>2]|0)|0;d=ia(d,((k[h>>2]|0)+7|0)/8|0)|0;if((k[j>>2]|0)>0){g=0;while(1){x=0;Fa(4,q|0,c|0,n|0);s=x;x=0;if(s&1)break;f=k[o>>2]|0;if(f){k[o>>2]=f+d;k[p>>2]=(k[p>>2]|0)-d}g=g+1|0;if((g|0)>=(k[j>>2]|0))break b}f=Wa(824,0)|0;d=M;s=16;break a}}else{x=0;Fa(4,q|0,c|0,n|0);s=x;x=0;if(s&1){s=15;break a}}while(0);x=0;Aa(33,q|0,a|0)|0;s=x;x=0;if(!(s&1)){k[b>>2]=k[q+16>>2];if(e)i[e>>0]=0;g=q+24|0;d=k[g>>2]|0;if(d){f=k[l>>2]|0;if((f|0)!=(d|0)){do{e=f+-4|0;k[l>>2]=e;f=k[e>>2]|0;k[e>>2]=0;if(f)Lb[k[(k[f>>2]|0)+4>>2]&255](f);f=k[l>>2]|0}while((f|0)!=(d|0));d=k[g>>2]|0}mj(d)}e=0;r=v;return e|0}else s=15}else s=15}while(0);if((s|0)==15){f=Wa(824,0)|0;d=M;s=16}l=q+24|0;g=k[l>>2]|0;if(g){j=q+28|0;h=k[j>>2]|0;if((h|0)!=(g|0)){do{q=h+-4|0;k[j>>2]=q;h=k[q>>2]|0;k[q>>2]=0;if(h)Lb[k[(k[h>>2]|0)+4>>2]&255](h);h=k[j>>2]|0}while((h|0)!=(g|0));g=k[l>>2]|0}mj(g)}}else s=5}else s=5;if((s|0)==5){f=Wa(824,0)|0;d=M}q=(d|0)==(ab(824)|0);h=cb(f|0)|0;d=(e|0)==0;if(!q){if(!d)i[e>>0]=0;eb();e=14;r=v;return e|0}g=h+12|0;do if(!d){d=k[g>>2]|0;x=0;f=Da(1)|0;q=x;x=0;if(!(q&1))if((d|0)==(f|0)){wl(e,Ob[k[(k[h>>2]|0)+8>>2]&127](h)|0)|0;s=60;break}else{i[e>>0]=0;s=60;break}}else s=60;while(0);if((s|0)==60?(t=k[g>>2]|0,x=0,u=Da(1)|0,e=x,x=0,!(e&1)):0){e=(t|0)==(u|0)?k[h+8>>2]|0:13;eb();r=v;return e|0}d=Wa()|0;x=0;Ga(3);v=x;x=0;if(v&1){v=Wa(0)|0;oc(v)}else fb(d|0);return 0}function nc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;j=r;r=r+112|0;f=j+96|0;i=j+84|0;l=j+72|0;m=j+60|0;n=j+48|0;o=j+36|0;p=j+24|0;q=j+12|0;s=j;h=(b|0)==0;if((a|0)==0&h){e=Va(16)|0;x=0;Fa(5,f|0,48504,52);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,f|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(f);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}g=k[d>>2]|0;if((g+-1|0)>>>0>65534){e=Va(16)|0;x=0;Fa(5,i|0,48557,41);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,i|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(i);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}f=k[d+4>>2]|0;if((f+-1|0)>>>0>65534){e=Va(16)|0;x=0;Fa(5,l|0,48599,42);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,l|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(l);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}e=k[d+8>>2]|0;if((e+-2|0)>>>0>14){e=Va(16)|0;x=0;Fa(5,m|0,48642,46);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,m|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(m);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}a=k[d+24>>2]|0;if(a>>>0>=3){e=Va(16)|0;x=0;Fa(5,n|0,48689,65);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,n|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(n);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}b=k[d+16>>2]|0;if((b+-1|0)>>>0>254){e=Va(16)|0;x=0;Fa(5,o|0,48755,44);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,o|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(o);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}if(!h?(o=ia(f,g)|0,(ia(ia(o,(e|0)>8?2:1)|0,b)|0)>>>0>c>>>0):0){e=Va(16)|0;x=0;Fa(5,p|0,48800,58);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,p|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(p);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}switch(b|0){case 4:{if((a|0)!=2){r=j;return}e=Va(16)|0;x=0;Fa(5,q|0,48859,73);s=x;x=0;if(!(s&1)){x=0;b=Da(1)|0;s=x;x=0;if(!(s&1)?(x=0,Ja(36,e|0,1,b|0,q|0),s=x,x=0,!(s&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(q);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}case 3:{r=j;return}default:{if(!a){r=j;return}e=Va(16)|0;x=0;Fa(5,s|0,48933,73);q=x;x=0;if(!(q&1)){x=0;b=Da(1)|0;q=x;x=0;if(!(q&1)?(x=0,Ja(36,e|0,1,b|0,s|0),q=x,x=0,!(q&1)):0){x=0;Fa(6,e|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(s);if(!a){s=b;fb(s|0)}}else b=Wa()|0;Ua(e|0);s=b;fb(s|0)}}}function oc(a){a=a|0;cb(a|0)|0;tj()}function pc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0;m=r;r=r+128|0;f=m+116|0;g=m;x=0;k[f>>2]=k[b>>2];k[f+4>>2]=k[b+4>>2];k[f+8>>2]=k[b+8>>2];ra(59,g|0,f|0);e=x;x=0;if(!(e&1)){if(c){e=g+16|0;b=e+84|0;do{k[e>>2]=k[c>>2];e=e+4|0;c=c+4|0}while((e|0)<(b|0))}x=0;k[f>>2]=k[a>>2];k[f+4>>2]=k[a+4>>2];k[f+8>>2]=k[a+8>>2];ra(60,g|0,f|0);g=x;x=0;if(!(g&1)){if(d)i[d>>0]=0;l=0;r=m;return l|0}}a=Wa(824,0)|0;g=M;g=(g|0)==(ab(824)|0);a=cb(a|0)|0;b=(d|0)==0;if(!g){if(!b)i[d>>0]=0;eb();l=14;r=m;return l|0}e=a+12|0;do if(!b){b=k[e>>2]|0;x=0;c=Da(1)|0;g=x;x=0;if(!(g&1))if((b|0)==(c|0)){wl(d,Ob[k[(k[a>>2]|0)+8>>2]&127](a)|0)|0;l=10;break}else{i[d>>0]=0;l=10;break}}else l=10;while(0);if((l|0)==10?(h=k[e>>2]|0,x=0,j=Da(1)|0,l=x,x=0,!(l&1)):0){l=(h|0)==(j|0)?k[a+8>>2]|0:13;eb();r=m;return l|0}b=Wa()|0;x=0;Ga(3);m=x;x=0;if(m&1){m=Wa(0)|0;oc(m)}else fb(b|0);return 0}function qc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0;j=r;r=r+128|0;e=j+116|0;d=j;x=0;k[e>>2]=k[a>>2];k[e+4>>2]=k[a+4>>2];k[e+8>>2]=k[a+8>>2];ra(59,d|0,e|0);e=x;x=0;if((!(e&1)?(x=0,qa(177,d|0),e=x,x=0,!(e&1)):0)?(x=0,ra(61,d|0,1),e=x,x=0,!(e&1)):0){a=d+16|0;d=b+84|0;do{k[b>>2]=k[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(d|0));if(c)i[c>>0]=0;c=0;r=j;return c|0}e=Wa(824,0)|0;b=M;b=(b|0)==(ab(824)|0);e=cb(e|0)|0;a=(c|0)==0;if(!b){if(!a)i[c>>0]=0;eb();c=14;r=j;return c|0}b=e+12|0;do if(!a){a=k[b>>2]|0;x=0;d=Da(1)|0;l=x;x=0;if(!(l&1))if((a|0)==(d|0)){wl(c,Ob[k[(k[e>>2]|0)+8>>2]&127](e)|0)|0;h=13;break}else{i[c>>0]=0;h=13;break}}else h=13;while(0);if((h|0)==13?(f=k[b>>2]|0,x=0,g=Da(1)|0,l=x,x=0,!(l&1)):0){l=(f|0)==(g|0)?k[e+8>>2]|0:13;eb();r=j;return l|0}a=Wa()|0;x=0;Ga(3);l=x;x=0;if(l&1){l=Wa(0)|0;oc(l)}else fb(a|0);return 0}function rc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,l=0,m=0;m=r;r=r+48|0;i=m+36|0;h=m+24|0;j=m+12|0;l=m;if(!((a|0)!=0&(c|0)!=0&(d|0)!=0&(f|0)!=0)){e=1;r=m;return e|0}k[j>>2]=0;k[j+4>>2]=a;k[j+8>>2]=b;k[l>>2]=0;k[l+4>>2]=d;k[l+8>>2]=e;k[h>>2]=k[j>>2];k[h+4>>2]=k[j+4>>2];k[h+8>>2]=k[j+8>>2];k[i>>2]=k[l>>2];k[i+4>>2]=k[l+4>>2];k[i+8>>2]=k[l+8>>2];e=mc(h,c,i,f,g)|0;r=m;return e|0}function sc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;e=r;r=r+32|0;f=e+12|0;g=e;h=g;k[h>>2]=0;k[h+4>>2]=0;k[g+4>>2]=a;k[g+8>>2]=b;k[f>>2]=k[g>>2];k[f+4>>2]=k[g+4>>2];k[f+8>>2]=k[g+8>>2];c=qc(f,c,d)|0;r=e;return c|0}function tc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+48|0;h=g+36|0;i=g+24|0;l=g+12|0;j=g;k[l>>2]=0;k[l+4>>2]=a;k[l+8>>2]=b;k[j>>2]=0;k[j+4>>2]=c;k[j+8>>2]=d;k[i>>2]=k[l>>2];k[i+4>>2]=k[l+4>>2];k[i+8>>2]=k[l+8>>2];k[h>>2]=k[j>>2];k[h+4>>2]=k[j+4>>2];k[h+8>>2]=k[j+8>>2];d=pc(i,h,e,f)|0;r=g;return d|0}function uc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0;j=a+4|0;c=k[a>>2]|0;e=((k[j>>2]|0)-c>>2)+1|0;if(e>>>0>1073741823){jj(a);c=k[a>>2]|0}l=a+8|0;d=(k[l>>2]|0)-c|0;if(d>>2>>>0<536870911){d=d>>1;d=d>>>0>>0?e:d;c=(k[j>>2]|0)-c>>2;if(!d){f=0;g=0}else h=6}else{d=1073741823;c=(k[j>>2]|0)-c>>2;h=6}if((h|0)==6){f=d;g=lj(d<<2)|0}e=g+(c<<2)|0;d=e;i=g+(f<<2)|0;h=k[b>>2]|0;k[b>>2]=0;k[e>>2]=h;h=g+(c+1<<2)|0;g=k[a>>2]|0;c=k[j>>2]|0;if((c|0)==(g|0)){e=a;f=j}else{do{c=c+-4|0;b=k[c>>2]|0;k[c>>2]=0;k[e+-4>>2]=b;e=d+-4|0;d=e}while((c|0)!=(g|0));c=d;e=a;f=j;d=c;g=k[a>>2]|0;c=k[j>>2]|0}k[e>>2]=d;k[f>>2]=h;k[l>>2]=i;e=g;if((c|0)!=(e|0))do{c=c+-4|0;d=k[c>>2]|0;k[c>>2]=0;if(d)Lb[k[(k[d>>2]|0)+4>>2]&255](d)}while((c|0)!=(e|0));if(!g)return;mj(g);return}function vc(){if(i[8]|0)return 35648;if(!(Qa(8)|0))return 35648;tb(72,35648,w|0)|0;Ya(8);return 35648}function wc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;m=r;r=r+32|0;j=m;Oi(j,(1<>2]|0;l=f+1|0;c=l<<1;k[a>>2]=0;g=a+4|0;k[g>>2]=0;k[a+8>>2]=0;a:do if(l){if(!((f|0)<-1?(x=0,qa(178,a|0),h=x,x=0,h&1):0))d=4;if((d|0)==4?(x=0,e=ta(67,c|0)|0,h=x,x=0,!(h&1)):0){k[g>>2]=e;k[a>>2]=e;k[a+8>>2]=e+c;b=e;while(1){i[b>>0]=0;b=(k[g>>2]|0)+1|0;k[g>>2]=b;c=c+-1|0;if(!c)break a}}c=Wa()|0;b=k[a>>2]|0;if(!b)fb(c|0);if((k[g>>2]|0)!=(b|0))k[g>>2]=b;mj(b);fb(c|0)}while(0);b=~f;if((f|0)<(b|0)){r=m;return}g=j+12|0;h=j+8|0;f=j+4|0;e=b;do{b=k[g>>2]|0;if((e|0)>(0-b|0)){c=k[h>>2]|0;if((e|0)>(0-c|0)){d=k[f>>2]|0;if((e|0)>(0-d|0))if((e|0)>=0)if((e|0)>0)if((d|0)<=(e|0))if((c|0)>(e|0))b=2;else b=(b|0)>(e|0)?3:4;else b=1;else b=0;else b=-1;else b=-2}else b=-3}else b=-4;i[(k[a>>2]|0)+(e+l)>>0]=b;e=e+1|0}while((e|0)<(l|0));r=m;return}function xc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;p=k[c+16>>2]|0;switch(p|0){case 64:case 0:{x=0;a=Aa(34,a|0,b|0)|0;b=x;x=0;if(b&1)q=16;else d=a;break}default:{e=(1<>2])+-1|0;o=k[b+20>>2]|0;n=o<<1;n=((n+e|0)/(n|1|0)|0)+1|0;a=0;while(1)if((1<>2]|0;x=0;d=ta(67,4624)|0;m=x;x=0;if(m&1)q=16;else{f=((g|0)<8?8:g)+g<<1;h=d+4|0;l=b;m=h+84|0;do{k[h>>2]=k[l>>2];h=h+4|0;l=l+4|0}while((h|0)<(m|0));h=d+88|0;m=h+40|0;do{k[h>>2]=0;h=h+4|0}while((h|0)<(m|0));k[d>>2]=35660;k[d+128>>2]=e;k[d+132>>2]=n;k[d+136>>2]=o;k[d+140>>2]=a;k[d+144>>2]=g;k[d+148>>2]=f;k[d+152>>2]=p;a=d+156|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+172>>2]=k[b>>2];k[d+176>>2]=0;k[d+180>>2]=0;k[d+184>>2]=0;a=d+4568|0;e=d+188|0;do{k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;j[e+10>>1]=1;e=e+12|0}while((e|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4580|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4592|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+28>>2]|0))k[d+20>>2]=1}}}if((q|0)==16){q=Wa()|0;fb(q|0)}if(!d)return d|0;x=0;ra(k[(k[d>>2]|0)+12>>2]|0,d|0,c|0);q=x;x=0;if(!(q&1))return d|0;a=Wa()|0;if(!d){q=a;fb(q|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);q=a;fb(q|0);return 0}function yc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,m=0,n=0;c=(k[b+24>>2]|0)==2;if(c?(k[b+16>>2]|0)!=3:0){b=0;return b|0}n=k[b+20>>2]|0;a=k[b+8>>2]|0;a:do if(!n){if(c){if((a|0)!=8)break;d=lj(4600)|0;g=d+4|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=d+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[d>>2]=35688;a=d+132|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+148>>2]=k[b>>2];k[d+152>>2]=0;k[d+156>>2]=0;k[d+160>>2]=0;a=d+4544|0;c=d+164|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4556|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4568|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+28>>2]|0))k[d+20>>2]=1;b=d;return b|0}switch(a|0){case 8:{d=lj(4600)|0;g=d+4|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=d+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[d>>2]=35716;a=d+132|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+148>>2]=k[b>>2];k[d+152>>2]=0;k[d+156>>2]=0;k[d+160>>2]=0;a=d+4544|0;c=d+164|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4556|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4568|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+28>>2]|0))k[d+20>>2]=1;b=d;return b|0}case 12:{d=lj(4600)|0;g=d+4|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=d+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[d>>2]=35744;a=d+132|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+148>>2]=k[b>>2];k[d+152>>2]=0;k[d+156>>2]=0;k[d+160>>2]=0;a=d+4544|0;c=d+164|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4556|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4568|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+28>>2]|0))k[d+20>>2]=1;b=d;return b|0}case 16:{d=lj(4600)|0;g=d+4|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=d+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[d>>2]=35772;a=d+132|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+148>>2]=k[b>>2];k[d+152>>2]=0;k[d+156>>2]=0;k[d+160>>2]=0;a=d+4544|0;c=d+164|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4556|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4568|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+28>>2]|0))k[d+20>>2]=1;b=d;return b|0}default:break a}}while(0);m=(1<>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=e+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[e>>2]=35800;k[e+128>>2]=m;k[e+132>>2]=f;k[e+136>>2]=n;k[e+140>>2]=a;k[e+144>>2]=c;k[e+148>>2]=d;k[e+152>>2]=64;a=e+156|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+172>>2]=k[b>>2];k[e+176>>2]=0;k[e+180>>2]=0;k[e+184>>2]=0;a=e+4568|0;c=e+188|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4580|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4592|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+28>>2]|0))k[e+20>>2]=1;b=e;return b|0}else{a=0;while(1)if((1<>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=e+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[e>>2]=35660;k[e+128>>2]=m;k[e+132>>2]=f;k[e+136>>2]=n;k[e+140>>2]=a;k[e+144>>2]=c;k[e+148>>2]=d;k[e+152>>2]=64;a=e+156|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+172>>2]=k[b>>2];k[e+176>>2]=0;k[e+180>>2]=0;k[e+184>>2]=0;a=e+4568|0;c=e+188|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4580|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4592|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+28>>2]|0))k[e+20>>2]=1;b=e;return b|0}}if((a|0)>=17){b=0;return b|0}f=n<<1;f=((f+m|0)/(f|1|0)|0)+1|0;if(c){a=0;while(1)if((1<>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=e+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[e>>2]=35828;k[e+128>>2]=m;k[e+132>>2]=f;k[e+136>>2]=n;k[e+140>>2]=a;k[e+144>>2]=c;k[e+148>>2]=d;k[e+152>>2]=64;a=e+156|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+172>>2]=k[b>>2];k[e+176>>2]=0;k[e+180>>2]=0;k[e+184>>2]=0;a=e+4568|0;c=e+188|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4580|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4592|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+28>>2]|0))k[e+20>>2]=1;b=e;return b|0}else{a=0;while(1)if((1<>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));g=e+88|0;l=g+40|0;do{k[g>>2]=0;g=g+4|0}while((g|0)<(l|0));k[e>>2]=35856;k[e+128>>2]=m;k[e+132>>2]=f;k[e+136>>2]=n;k[e+140>>2]=a;k[e+144>>2]=c;k[e+148>>2]=d;k[e+152>>2]=64;a=e+156|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+172>>2]=k[b>>2];k[e+176>>2]=0;k[e+180>>2]=0;k[e+184>>2]=0;a=e+4568|0;c=e+188|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4580|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4592|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+28>>2]|0))k[e+20>>2]=1;b=e;return b|0}return 0}function zc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;p=k[c+16>>2]|0;switch(p|0){case 64:case 0:{x=0;a=Aa(35,a|0,b|0)|0;b=x;x=0;if(b&1)q=16;else d=a;break}default:{e=(1<>2])+-1|0;o=k[b+20>>2]|0;n=o<<1;n=((n+e|0)/(n|1|0)|0)+1|0;a=0;while(1)if((1<>2]|0;x=0;d=ta(67,4632)|0;m=x;x=0;if(m&1)q=16;else{f=((g|0)<8?8:g)+g<<1;k[d+4>>2]=0;h=d+8|0;l=b;m=h+84|0;do{k[h>>2]=k[l>>2];h=h+4|0;l=l+4|0}while((h|0)<(m|0));k[d+92>>2]=0;k[d+96>>2]=0;k[d+100>>2]=32;k[d+104>>2]=0;k[d+108>>2]=0;i[d+112>>0]=0;m=d+116|0;k[m>>2]=0;k[m+4>>2]=0;k[m+8>>2]=0;k[m+12>>2]=0;k[m+16>>2]=0;k[d>>2]=35884;k[d+136>>2]=e;k[d+140>>2]=n;k[d+144>>2]=o;k[d+148>>2]=a;k[d+152>>2]=g;k[d+156>>2]=f;k[d+160>>2]=p;a=d+164|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+180>>2]=k[b>>2];k[d+184>>2]=0;k[d+188>>2]=0;k[d+192>>2]=0;a=d+4576|0;e=d+196|0;do{k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;j[e+10>>1]=1;e=e+12|0}while((e|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4588|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4600|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+32>>2]|0))k[d+24>>2]=1}}}if((q|0)==16){q=Wa()|0;fb(q|0)}if(!d)return d|0;x=0;ra(k[(k[d>>2]|0)+8>>2]|0,d|0,c|0);q=x;x=0;if(!(q&1))return d|0;a=Wa()|0;if(!d){q=a;fb(q|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);q=a;fb(q|0);return 0}function Ac(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,m=0,n=0;c=(k[b+24>>2]|0)==2;if(c?(k[b+16>>2]|0)!=3:0){b=0;return b|0}n=k[b+20>>2]|0;a=k[b+8>>2]|0;a:do if(!n){if(c){if((a|0)!=8)break;d=lj(4608)|0;k[d+4>>2]=0;g=d+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[d+92>>2]=0;k[d+96>>2]=0;k[d+100>>2]=32;k[d+104>>2]=0;k[d+108>>2]=0;i[d+112>>0]=0;a=d+116|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[d>>2]=35912;a=d+140|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+156>>2]=k[b>>2];k[d+160>>2]=0;k[d+164>>2]=0;k[d+168>>2]=0;a=d+4552|0;c=d+172|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4564|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4576|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+32>>2]|0))k[d+24>>2]=1;b=d;return b|0}switch(a|0){case 8:{d=lj(4608)|0;k[d+4>>2]=0;g=d+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[d+92>>2]=0;k[d+96>>2]=0;k[d+100>>2]=32;k[d+104>>2]=0;k[d+108>>2]=0;i[d+112>>0]=0;a=d+116|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[d>>2]=35940;a=d+140|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+156>>2]=k[b>>2];k[d+160>>2]=0;k[d+164>>2]=0;k[d+168>>2]=0;a=d+4552|0;c=d+172|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4564|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4576|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+32>>2]|0))k[d+24>>2]=1;b=d;return b|0}case 12:{d=lj(4608)|0;k[d+4>>2]=0;g=d+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[d+92>>2]=0;k[d+96>>2]=0;k[d+100>>2]=32;k[d+104>>2]=0;k[d+108>>2]=0;i[d+112>>0]=0;a=d+116|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[d>>2]=35968;a=d+140|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+156>>2]=k[b>>2];k[d+160>>2]=0;k[d+164>>2]=0;k[d+168>>2]=0;a=d+4552|0;c=d+172|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4564|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4576|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+32>>2]|0))k[d+24>>2]=1;b=d;return b|0}case 16:{d=lj(4608)|0;k[d+4>>2]=0;g=d+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[d+92>>2]=0;k[d+96>>2]=0;k[d+100>>2]=32;k[d+104>>2]=0;k[d+108>>2]=0;i[d+112>>0]=0;a=d+116|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[d>>2]=35996;a=d+140|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[d+156>>2]=k[b>>2];k[d+160>>2]=0;k[d+164>>2]=0;k[d+168>>2]=0;a=d+4552|0;c=d+172|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=d+4564|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=d+4576|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[d+32>>2]|0))k[d+24>>2]=1;b=d;return b|0}default:break a}}while(0);m=(1<>2]=0;g=e+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[e+92>>2]=0;k[e+96>>2]=0;k[e+100>>2]=32;k[e+104>>2]=0;k[e+108>>2]=0;i[e+112>>0]=0;l=e+116|0;k[l>>2]=0;k[l+4>>2]=0;k[l+8>>2]=0;k[l+12>>2]=0;k[l+16>>2]=0;k[e>>2]=36024;k[e+136>>2]=m;k[e+140>>2]=f;k[e+144>>2]=n;k[e+148>>2]=a;k[e+152>>2]=c;k[e+156>>2]=d;k[e+160>>2]=64;a=e+164|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+180>>2]=k[b>>2];k[e+184>>2]=0;k[e+188>>2]=0;k[e+192>>2]=0;a=e+4576|0;c=e+196|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4588|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4600|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+32>>2]|0))k[e+24>>2]=1;b=e;return b|0}else{a=0;while(1)if((1<>2]=0;g=e+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[e+92>>2]=0;k[e+96>>2]=0;k[e+100>>2]=32;k[e+104>>2]=0;k[e+108>>2]=0;i[e+112>>0]=0;l=e+116|0;k[l>>2]=0;k[l+4>>2]=0;k[l+8>>2]=0;k[l+12>>2]=0;k[l+16>>2]=0;k[e>>2]=35884;k[e+136>>2]=m;k[e+140>>2]=f;k[e+144>>2]=n;k[e+148>>2]=a;k[e+152>>2]=c;k[e+156>>2]=d;k[e+160>>2]=64;a=e+164|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+180>>2]=k[b>>2];k[e+184>>2]=0;k[e+188>>2]=0;k[e+192>>2]=0;a=e+4576|0;c=e+196|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4588|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4600|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+32>>2]|0))k[e+24>>2]=1;b=e;return b|0}}if((a|0)>=17){b=0;return b|0}f=n<<1;f=((f+m|0)/(f|1|0)|0)+1|0;if(c){a=0;while(1)if((1<>2]=0;g=e+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[e+92>>2]=0;k[e+96>>2]=0;k[e+100>>2]=32;k[e+104>>2]=0;k[e+108>>2]=0;i[e+112>>0]=0;l=e+116|0;k[l>>2]=0;k[l+4>>2]=0;k[l+8>>2]=0;k[l+12>>2]=0;k[l+16>>2]=0;k[e>>2]=36052;k[e+136>>2]=m;k[e+140>>2]=f;k[e+144>>2]=n;k[e+148>>2]=a;k[e+152>>2]=c;k[e+156>>2]=d;k[e+160>>2]=64;a=e+164|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+180>>2]=k[b>>2];k[e+184>>2]=0;k[e+188>>2]=0;k[e+192>>2]=0;a=e+4576|0;c=e+196|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4588|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4600|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+32>>2]|0))k[e+24>>2]=1;b=e;return b|0}else{a=0;while(1)if((1<>2]=0;g=e+8|0;h=b;l=g+84|0;do{k[g>>2]=k[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(l|0));k[e+92>>2]=0;k[e+96>>2]=0;k[e+100>>2]=32;k[e+104>>2]=0;k[e+108>>2]=0;i[e+112>>0]=0;l=e+116|0;k[l>>2]=0;k[l+4>>2]=0;k[l+8>>2]=0;k[l+12>>2]=0;k[l+16>>2]=0;k[e>>2]=36080;k[e+136>>2]=m;k[e+140>>2]=f;k[e+144>>2]=n;k[e+148>>2]=a;k[e+152>>2]=c;k[e+156>>2]=d;k[e+160>>2]=64;a=e+164|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[e+180>>2]=k[b>>2];k[e+184>>2]=0;k[e+188>>2]=0;k[e+192>>2]=0;a=e+4576|0;c=e+196|0;do{k[c>>2]=0;k[c+4>>2]=0;j[c+8>>1]=0;j[c+10>>1]=1;c=c+12|0}while((c|0)!=(a|0));k[a>>2]=0;k[a+4>>2]=0;j[a+8>>1]=0;i[a+10>>0]=0;b=e+4588|0;k[b>>2]=0;k[b+4>>2]=0;j[b+8>>1]=0;i[b+10>>0]=0;b=e+4600|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[b+16>>2]=0;k[b+20>>2]=0;k[b+24>>2]=0;i[b+28>>0]=0;if(!(k[e+32>>2]|0))k[e+24>>2]=1;b=e;return b|0}return 0}function Bc(){var a=0,b=0,c=0,d=0,e=0,f=0,g=0;a=2832;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=4880);sw(2832,0,2048)|0;a=0;do{g=2832+(a+128<<3)|0;k[g>>2]=0;k[g+4>>2]=1;a=a+1|0}while((a|0)!=128);a=3088;k[a>>2]=1;k[a+4>>2]=3;a=3096;k[a>>2]=1;k[a+4>>2]=3;a=3104;k[a>>2]=1;k[a+4>>2]=3;a=3112;k[a>>2]=1;k[a+4>>2]=3;a=3120;k[a>>2]=1;k[a+4>>2]=3;a=3128;k[a>>2]=1;k[a+4>>2]=3;a=3136;k[a>>2]=1;k[a+4>>2]=3;a=3144;k[a>>2]=1;k[a+4>>2]=3;a=3152;k[a>>2]=1;k[a+4>>2]=3;a=3160;k[a>>2]=1;k[a+4>>2]=3;a=3168;k[a>>2]=1;k[a+4>>2]=3;a=3176;k[a>>2]=1;k[a+4>>2]=3;a=3184;k[a>>2]=1;k[a+4>>2]=3;a=3192;k[a>>2]=1;k[a+4>>2]=3;a=3200;k[a>>2]=1;k[a+4>>2]=3;a=3208;k[a>>2]=1;k[a+4>>2]=3;a=3216;k[a>>2]=1;k[a+4>>2]=3;a=3224;k[a>>2]=1;k[a+4>>2]=3;a=3232;k[a>>2]=1;k[a+4>>2]=3;a=3240;k[a>>2]=1;k[a+4>>2]=3;a=3248;k[a>>2]=1;k[a+4>>2]=3;a=3256;k[a>>2]=1;k[a+4>>2]=3;a=3264;k[a>>2]=1;k[a+4>>2]=3;a=3272;k[a>>2]=1;k[a+4>>2]=3;a=3280;k[a>>2]=1;k[a+4>>2]=3;a=3288;k[a>>2]=1;k[a+4>>2]=3;a=3296;k[a>>2]=1;k[a+4>>2]=3;a=3304;k[a>>2]=1;k[a+4>>2]=3;a=3312;k[a>>2]=1;k[a+4>>2]=3;a=3320;k[a>>2]=1;k[a+4>>2]=3;a=3328;k[a>>2]=1;k[a+4>>2]=3;a=3336;k[a>>2]=1;k[a+4>>2]=3;a=2896;k[a>>2]=2;k[a+4>>2]=5;a=2904;k[a>>2]=2;k[a+4>>2]=5;a=2912;k[a>>2]=2;k[a+4>>2]=5;a=2920;k[a>>2]=2;k[a+4>>2]=5;a=2928;k[a>>2]=2;k[a+4>>2]=5;a=2936;k[a>>2]=2;k[a+4>>2]=5;a=2944;k[a>>2]=2;k[a+4>>2]=5;a=2952;k[a>>2]=2;k[a+4>>2]=5;a=2848;k[a>>2]=3;k[a+4>>2]=7;a=2856;k[a>>2]=3;k[a+4>>2]=7;a=0;do{g=2832+(a+64<<3)|0;k[g>>2]=-1;k[g+4>>2]=2;a=a+1|0}while((a|0)!=64);a=2960;k[a>>2]=-2;k[a+4>>2]=4;a=2968;k[a>>2]=-2;k[a+4>>2]=4;a=2976;k[a>>2]=-2;k[a+4>>2]=4;a=2984;k[a>>2]=-2;k[a+4>>2]=4;a=2992;k[a>>2]=-2;k[a+4>>2]=4;a=3e3;k[a>>2]=-2;k[a+4>>2]=4;a=3008;k[a>>2]=-2;k[a+4>>2]=4;a=3016;k[a>>2]=-2;k[a+4>>2]=4;a=3024;k[a>>2]=-2;k[a+4>>2]=4;a=3032;k[a>>2]=-2;k[a+4>>2]=4;a=3040;k[a>>2]=-2;k[a+4>>2]=4;a=3048;k[a>>2]=-2;k[a+4>>2]=4;a=3056;k[a>>2]=-2;k[a+4>>2]=4;a=3064;k[a>>2]=-2;k[a+4>>2]=4;a=3072;k[a>>2]=-2;k[a+4>>2]=4;a=3080;k[a>>2]=-2;k[a+4>>2]=4;a=2864;k[a>>2]=-3;k[a+4>>2]=6;a=2872;k[a>>2]=-3;k[a+4>>2]=6;a=2880;k[a>>2]=-3;k[a+4>>2]=6;a=2888;k[a>>2]=-3;k[a+4>>2]=6;a=2840;k[a>>2]=-4;k[a+4>>2]=8;a=4880;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=6928);sw(4880,0,2048)|0;c=2;a=0;e=0;f=0;while(1){c=c<<16>>16;b=8-c|0;d=1<>2]=e;k[g+4>>2]=c;b=b+1|0}while((b|0)<(d|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==7){b=2;e=1;f=-1;g=-1;break}else{c=(a>>1)+2|0;e=b>>16}}while(1){c=b<<16>>16;a=8-c|0;d=1<>2]=f;k[e+4>>2]=c;b=b+1|0}while((b|0)<(d|0))}a=(g<<16)+-65536|0;e=a>>31^a>>15;b=(e>>1)+2|0;if((b|0)>8){a=6928;break}else{f=a>>16;g=g+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=8976);sw(6928,0,2048)|0;e=3;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==12){e=3;b=1;d=-1;f=-1;break}else{e=(a>>2)+3|0;d=b>>16}}while(1){a=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}a=(f<<16)+-65536|0;b=a>>31^a>>15;e=(b>>2)+3|0;if((e|0)>8){a=8976;break}else{d=a>>16;f=f+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=11024);sw(8976,0,2048)|0;e=4;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==20){e=4;b=1;d=-1;f=-1;break}else{e=(a>>3)+4|0;d=b>>16}}while(1){a=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}a=(f<<16)+-65536|0;b=a>>31^a>>15;e=(b>>3)+4|0;if((e|0)>8){a=11024;break}else{d=a>>16;f=f+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=13072);sw(11024,0,2048)|0;e=5;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==32){e=5;b=1;d=-1;f=-1;break}else{e=(a>>4)+5|0;d=b>>16}}while(1){a=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}a=(f<<16)+-65536|0;b=a>>31^a>>15;e=(b>>4)+5|0;if((e|0)>8){a=13072;break}else{d=a>>16;f=f+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=15120);sw(13072,0,2048)|0;e=6;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==48){e=6;b=1;d=-1;f=-1;break}else{e=(a>>5)+6|0;d=b>>16}}while(1){a=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}a=(f<<16)+-65536|0;b=a>>31^a>>15;e=(b>>5)+6|0;if((e|0)>8){a=15120;break}else{d=a>>16;f=f+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=17168);sw(15120,0,2048)|0;e=7;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==64){e=7;b=1;d=-1;f=-1;break}else{e=(a>>6)+7|0;d=b>>16}}while(1){a=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}a=(f<<16)+-65536|0;b=a>>31^a>>15;e=(b>>6)+7|0;if((e|0)>8){a=17168;break}else{d=a>>16;f=f+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=19216);sw(17168,0,2048)|0;e=8;a=0;d=0;f=0;while(1){b=8-e|0;c=1<>2]=d;k[g+4>>2]=e;b=b+1|0}while((b|0)<(c|0))}b=(f<<16)+65536|0;a=b>>31^b>>15;f=f+1|0;if((f|0)==64){f=8;d=1;e=-1;g=-1;break}else{e=(a>>7)+8|0;d=b>>16}}while(1){a=8-f|0;c=1<>2]=e;k[d+4>>2]=f;b=b+1|0}while((b|0)<(c|0))}b=(g<<16)+-65536|0;d=b>>31^b>>15;a=d>>7;if((a|0)>0){a=19216;break}else{f=a+8|0;e=b>>16;g=g+-1|0}}do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=21264);sw(19216,0,2048)|0;a=21264;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=23312);sw(21264,0,2048)|0;a=23312;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=25360);sw(23312,0,2048)|0;a=25360;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=27408);sw(25360,0,2048)|0;a=27408;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=29456);sw(27408,0,2048)|0;a=29456;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=31504);sw(29456,0,2048)|0;a=31504;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=33552);sw(31504,0,2048)|0;a=33552;do{k[a>>2]=0;k[a+4>>2]=0;a=a+8|0}while((a|0)!=35600);sw(33552,0,2048)|0;wc(35600,8);tb(179,35600,w|0)|0;wc(35612,10);tb(179,35612,w|0)|0;wc(35624,12);tb(179,35624,w|0)|0;wc(35636,16);tb(179,35636,w|0)|0;return}function Cc(a){a=a|0;var b=0;b=k[a>>2]|0;if(!b)return;a=a+4|0;if((k[a>>2]|0)!=(b|0))k[a>>2]=b;mj(b);return}function Dc(a){a=a|0;var b=0,c=0;k[a>>2]=36080;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Ec(a){a=a|0;var b=0,c=0;k[a>>2]=36080;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Fc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+136>>2]|0,k[a+144>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+184>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+188>>2]=f;k[a+192>>2]=e;re(a);e=a+140|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+196+(f*12|0)>>2]=b;k[a+196+(f*12|0)+4>>2]=0;j[a+196+(f*12|0)+8>>1]=0;j[a+196+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4576>>2]=h;k[a+4580>>2]=0;i[a+4584>>0]=l;i[a+4585>>0]=1;i[a+4586>>0]=0;k[a+4588>>2]=h;k[a+4592>>2]=1;i[a+4596>>0]=l;i[a+4597>>0]=1;i[a+4598>>0]=0;k[a+4600>>2]=0;r=g;return}function Gc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4624)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35856;k[b+128>>2]=k[a+136>>2];k[b+132>>2]=k[a+140>>2];k[b+136>>2]=k[a+144>>2];k[b+140>>2]=k[a+148>>2];k[b+144>>2]=k[a+152>>2];k[b+148>>2]=k[a+156>>2];k[b+152>>2]=k[a+160>>2];e=b+156|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+172>>2]=k[d>>2];k[b+176>>2]=0;k[b+180>>2]=0;k[b+184>>2]=0;e=b+4568|0;d=b+188|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4580|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4592|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];ge(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;ge(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function Hc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Ic(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;k[a>>2]=36460;k[a+4>>2]=c;n=a+8|0;f=k[c>>2]|0;l=c+16|0;d=k[l>>2]|0;g=ia(d,f)|0;k[n>>2]=0;o=a+12|0;k[o>>2]=0;k[a+16>>2]=0;do if(g){if(!((g|0)<0?(x=0,qa(178,n|0),f=x,x=0,f&1):0))m=4;if((m|0)==4?(h=g<<1,x=0,j=ta(67,h|0)|0,f=x,x=0,!(f&1)):0){k[n>>2]=j;f=j+(g<<1)|0;k[a+16>>2]=f;sw(j|0,0,h|0)|0;k[o>>2]=f;f=k[c>>2]|0;d=k[l>>2]|0;break}g=Wa()|0;e=k[n>>2]|0;d=e;if(e){f=k[o>>2]|0;if((f|0)!=(e|0))k[o>>2]=f+(~((f+-2-d|0)>>>1)<<1);mj(e)}o=g;fb(o|0)}while(0);g=a+20|0;d=ia(f<<1,d)|0;k[g>>2]=0;h=a+24|0;k[h>>2]=0;k[a+28>>2]=0;if(!d){o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))m=13;if((m|0)==13?(x=0,e=ta(67,d|0)|0,m=x,x=0,!(m&1)):0){k[h>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[h>>2]|0)+1|0;k[h>>2]=e;d=d+-1|0}while((d|0)!=0);o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}f=Wa()|0;e=k[g>>2]|0;if(e){if((k[h>>2]|0)!=(e|0))k[h>>2]=e;mj(e)}e=k[n>>2]|0;if(!e){o=f;fb(o|0)}d=k[o>>2]|0;if((d|0)!=(e|0))k[o>>2]=d+(~((d+-2-e|0)>>>1)<<1);mj(e);o=f;fb(o|0)}function Jc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;k[a>>2]=36436;k[a+4>>2]=c;n=a+8|0;f=k[c>>2]|0;l=c+16|0;d=k[l>>2]|0;g=ia(d,f)|0;k[n>>2]=0;o=a+12|0;k[o>>2]=0;k[a+16>>2]=0;do if(g){if(!((g|0)<0?(x=0,qa(178,n|0),f=x,x=0,f&1):0))m=4;if((m|0)==4?(h=g<<1,x=0,j=ta(67,h|0)|0,f=x,x=0,!(f&1)):0){k[n>>2]=j;f=j+(g<<1)|0;k[a+16>>2]=f;sw(j|0,0,h|0)|0;k[o>>2]=f;f=k[c>>2]|0;d=k[l>>2]|0;break}g=Wa()|0;e=k[n>>2]|0;d=e;if(e){f=k[o>>2]|0;if((f|0)!=(e|0))k[o>>2]=f+(~((f+-2-d|0)>>>1)<<1);mj(e)}o=g;fb(o|0)}while(0);g=a+20|0;d=ia(f<<1,d)|0;k[g>>2]=0;h=a+24|0;k[h>>2]=0;k[a+28>>2]=0;if(!d){o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))m=13;if((m|0)==13?(x=0,e=ta(67,d|0)|0,m=x,x=0,!(m&1)):0){k[h>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[h>>2]|0)+1|0;k[h>>2]=e;d=d+-1|0}while((d|0)!=0);o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}f=Wa()|0;e=k[g>>2]|0;if(e){if((k[h>>2]|0)!=(e|0))k[h>>2]=e;mj(e)}e=k[n>>2]|0;if(!e){o=f;fb(o|0)}d=k[o>>2]|0;if((d|0)!=(e|0))k[o>>2]=d+(~((d+-2-e|0)>>>1)<<1);mj(e);o=f;fb(o|0)}function Kc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;k[a>>2]=36412;k[a+4>>2]=c;n=a+8|0;f=k[c>>2]|0;l=c+16|0;d=k[l>>2]|0;g=ia(d,f)|0;k[n>>2]=0;o=a+12|0;k[o>>2]=0;k[a+16>>2]=0;do if(g){if(!((g|0)<0?(x=0,qa(178,n|0),f=x,x=0,f&1):0))m=4;if((m|0)==4?(h=g<<1,x=0,j=ta(67,h|0)|0,f=x,x=0,!(f&1)):0){k[n>>2]=j;f=j+(g<<1)|0;k[a+16>>2]=f;sw(j|0,0,h|0)|0;k[o>>2]=f;f=k[c>>2]|0;d=k[l>>2]|0;break}g=Wa()|0;e=k[n>>2]|0;d=e;if(e){f=k[o>>2]|0;if((f|0)!=(e|0))k[o>>2]=f+(~((f+-2-d|0)>>>1)<<1);mj(e)}o=g;fb(o|0)}while(0);g=a+20|0;d=ia(f<<1,d)|0;k[g>>2]=0;h=a+24|0;k[h>>2]=0;k[a+28>>2]=0;if(!d){o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))m=13;if((m|0)==13?(x=0,e=ta(67,d|0)|0,m=x,x=0,!(m&1)):0){k[h>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[h>>2]|0)+1|0;k[h>>2]=e;d=d+-1|0}while((d|0)!=0);o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}f=Wa()|0;e=k[g>>2]|0;if(e){if((k[h>>2]|0)!=(e|0))k[h>>2]=e;mj(e)}e=k[n>>2]|0;if(!e){o=f;fb(o|0)}d=k[o>>2]|0;if((d|0)!=(e|0))k[o>>2]=d+(~((d+-2-e|0)>>>1)<<1);mj(e);o=f;fb(o|0)}function Lc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;k[a>>2]=36388;k[a+4>>2]=c;n=a+8|0;f=k[c>>2]|0;l=c+16|0;d=k[l>>2]|0;g=ia(d,f)|0;k[n>>2]=0;o=a+12|0;k[o>>2]=0;k[a+16>>2]=0;do if(g){if(!((g|0)<0?(x=0,qa(178,n|0),f=x,x=0,f&1):0))m=4;if((m|0)==4?(h=g<<1,x=0,j=ta(67,h|0)|0,f=x,x=0,!(f&1)):0){k[n>>2]=j;f=j+(g<<1)|0;k[a+16>>2]=f;sw(j|0,0,h|0)|0;k[o>>2]=f;f=k[c>>2]|0;d=k[l>>2]|0;break}g=Wa()|0;e=k[n>>2]|0;d=e;if(e){f=k[o>>2]|0;if((f|0)!=(e|0))k[o>>2]=f+(~((f+-2-d|0)>>>1)<<1);mj(e)}o=g;fb(o|0)}while(0);g=a+20|0;d=ia(f<<1,d)|0;k[g>>2]=0;h=a+24|0;k[h>>2]=0;k[a+28>>2]=0;if(!d){o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))m=13;if((m|0)==13?(x=0,e=ta(67,d|0)|0,m=x,x=0,!(m&1)):0){k[h>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[h>>2]|0)+1|0;k[h>>2]=e;d=d+-1|0}while((d|0)!=0);o=a+36|0;k[o>>2]=k[b>>2];k[o+4>>2]=k[b+4>>2];k[o+8>>2]=k[b+8>>2];return}f=Wa()|0;e=k[g>>2]|0;if(e){if((k[h>>2]|0)!=(e|0))k[h>>2]=e;mj(e)}e=k[n>>2]|0;if(!e){o=f;fb(o|0)}d=k[o>>2]|0;if((d|0)!=(e|0))k[o>>2]=d+(~((d+-2-e|0)>>>1)<<1);mj(e);o=f;fb(o|0)}function Mc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;g=a+32|0;Tm(g,b)|0;f=a+44|0;k[f>>2]=0;h=a+48|0;e=k[h>>2]|0;if(e&8){b=i[g>>0]|0;if(!(b&1)){b=((b&255)>>>1)+(g+1)|0;k[f>>2]=b;c=g+1|0;d=g+1|0}else{b=(k[a+40>>2]|0)+(k[a+36>>2]|0)|0;k[f>>2]=b;d=k[a+40>>2]|0;c=d}k[a+8>>2]=c;k[a+12>>2]=d;k[a+16>>2]=b}if(!(e&16))return;b=i[g>>0]|0;if(!(b&1)){e=(b&255)>>>1;k[f>>2]=g+1+e;b=10;f=e}else{e=k[a+36>>2]|0;k[f>>2]=(k[a+40>>2]|0)+e;b=(k[g>>2]&-2)+-1|0;f=e}Wm(g,b,0);b=i[g>>0]|0;if(!(b&1)){e=g+1|0;d=(b&255)>>>1;c=g+1|0}else{c=k[a+40>>2]|0;e=c;d=k[a+36>>2]|0}b=a+24|0;k[b>>2]=c;k[a+20>>2]=c;k[a+28>>2]=e+d;if(!(k[h>>2]&3))return;k[b>>2]=c+f;return}function Nc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;o=r;r=r+32|0;g=o+16|0;n=o+8|0;h=o;x=0;ra(65,n|0,a|0);l=x;x=0;a:do if(l&1){c=Wa(0)|0;d=a;e=a}else{do if(i[n>>0]|0){d=k[(k[a>>2]|0)+-12>>2]|0;k[h>>2]=k[a+(d+24)>>2];j=a+d|0;l=k[a+(d+4)>>2]|0;e=b+c|0;d=a+(d+76)|0;c=k[d>>2]|0;do if((c|0)==-1){x=0;c=ta(68,j|0)|0;p=x;x=0;if(p&1)m=13;else{k[g>>2]=c;x=0;c=Aa(37,g|0,44220)|0;p=x;x=0;if(!(p&1)?(x=0,f=Aa(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0,p=x,x=0,!(p&1)):0){Qs(g);c=f<<24>>24;k[d>>2]=c;m=9;break}c=Wa(0)|0;Qs(g)}}else m=9;while(0);if((m|0)==9){x=0;k[g>>2]=k[h>>2];c=sa(39,g|0,b|0,((l&176|0)==32?e:b)|0,e|0,j|0,c&255|0)|0;p=x;x=0;if(!(p&1)){if(c)break;p=k[(k[a>>2]|0)+-12>>2]|0;x=0;ra(66,a+p|0,k[a+(p+16)>>2]|5|0);p=x;x=0;if(!(p&1))break;else m=13}else m=13}if((m|0)==13)c=Wa(0)|0;ro(n);d=a;e=a;break a}while(0);ro(n);r=o;return a|0}while(0);cb(c|0)|0;x=0;qa(181,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);p=x;x=0;if(!(p&1)){eb();r=o;return a|0}c=Wa()|0;x=0;Ga(3);p=x;x=0;if(p&1){p=Wa(0)|0;oc(p)}else fb(c|0);return 0}function Oc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=k[b+48>>2]|0;if(c&16){c=b+44|0;d=k[c>>2]|0;e=k[b+24>>2]|0;if(d>>>0>>0)k[c>>2]=e;else e=d;d=k[b+20>>2]|0;f=e-d|0;if(f>>>0>4294967279)ij(a);if(f>>>0<11){i[a>>0]=f<<1;c=a+1|0}else{b=f+16&-16;c=lj(b)|0;k[a+8>>2]=c;k[a>>2]=b|1;k[a+4>>2]=f}if((d|0)!=(e|0)){b=c;while(1){i[b>>0]=i[d>>0]|0;d=d+1|0;if((d|0)==(e|0))break;else b=b+1|0}c=c+f|0}i[c>>0]=0;return}if(!(c&8)){k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}d=k[b+8>>2]|0;b=k[b+16>>2]|0;f=b-d|0;if(f>>>0>4294967279)ij(a);if(f>>>0<11){i[a>>0]=f<<1;c=a+1|0}else{e=f+16&-16;c=lj(e)|0;k[a+8>>2]=c;k[a>>2]=e|1;k[a+4>>2]=f}if((d|0)!=(b|0)){e=c;while(1){i[e>>0]=i[d>>0]|0;d=d+1|0;if((d|0)==(b|0))break;else e=e+1|0}c=c+f|0}i[c>>0]=0;return}function Pc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;k[a>>2]=36364;k[a+4>>2]=c;o=a+8|0;g=k[c>>2]|0;m=c+16|0;f=k[m>>2]|0;l=ia(f,g)|0;k[o>>2]=0;p=a+12|0;k[p>>2]=0;k[a+16>>2]=0;do if(l){if(!((l|0)<0?(x=0,qa(178,o|0),g=x,x=0,g&1):0))n=4;if((n|0)==4?(h=l<<1,x=0,j=ta(67,h|0)|0,g=x,x=0,!(g&1)):0){k[o>>2]=j;g=j+(l<<1)|0;k[a+16>>2]=g;sw(j|0,0,h|0)|0;k[p>>2]=g;g=k[c>>2]|0;f=k[m>>2]|0;break}h=Wa()|0;e=k[o>>2]|0;f=e;if(e){g=k[p>>2]|0;if((g|0)!=(e|0))k[p>>2]=g+(~((g+-2-f|0)>>>1)<<1);mj(e)}p=h;fb(p|0)}while(0);h=a+20|0;f=ia(g<<1,f)|0;k[h>>2]=0;j=a+24|0;k[j>>2]=0;k[a+28>>2]=0;if(!f){p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}if(!((f|0)<0?(x=0,qa(178,h|0),m=x,x=0,m&1):0))n=13;if((n|0)==13?(x=0,e=ta(67,f|0)|0,n=x,x=0,!(n&1)):0){k[j>>2]=e;k[h>>2]=e;k[a+28>>2]=e+f;do{i[e>>0]=0;e=(k[j>>2]|0)+1|0;k[j>>2]=e;f=f+-1|0}while((f|0)!=0);p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}g=Wa()|0;e=k[h>>2]|0;if(e){if((k[j>>2]|0)!=(e|0))k[j>>2]=e;mj(e)}e=k[o>>2]|0;if(!e){p=g;fb(p|0)}f=k[p>>2]|0;if((f|0)!=(e|0))k[p>>2]=f+(~((f+-2-e|0)>>>1)<<1);mj(e);p=g;fb(p|0)}function Qc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;k[a>>2]=36340;k[a+4>>2]=c;o=a+8|0;g=k[c>>2]|0;m=c+16|0;f=k[m>>2]|0;l=ia(f,g)|0;k[o>>2]=0;p=a+12|0;k[p>>2]=0;k[a+16>>2]=0;do if(l){if(!((l|0)<0?(x=0,qa(178,o|0),g=x,x=0,g&1):0))n=4;if((n|0)==4?(h=l<<1,x=0,j=ta(67,h|0)|0,g=x,x=0,!(g&1)):0){k[o>>2]=j;g=j+(l<<1)|0;k[a+16>>2]=g;sw(j|0,0,h|0)|0;k[p>>2]=g;g=k[c>>2]|0;f=k[m>>2]|0;break}h=Wa()|0;e=k[o>>2]|0;f=e;if(e){g=k[p>>2]|0;if((g|0)!=(e|0))k[p>>2]=g+(~((g+-2-f|0)>>>1)<<1);mj(e)}p=h;fb(p|0)}while(0);h=a+20|0;f=ia(g<<1,f)|0;k[h>>2]=0;j=a+24|0;k[j>>2]=0;k[a+28>>2]=0;if(!f){p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}if(!((f|0)<0?(x=0,qa(178,h|0),m=x,x=0,m&1):0))n=13;if((n|0)==13?(x=0,e=ta(67,f|0)|0,n=x,x=0,!(n&1)):0){k[j>>2]=e;k[h>>2]=e;k[a+28>>2]=e+f;do{i[e>>0]=0;e=(k[j>>2]|0)+1|0;k[j>>2]=e;f=f+-1|0}while((f|0)!=0);p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}g=Wa()|0;e=k[h>>2]|0;if(e){if((k[j>>2]|0)!=(e|0))k[j>>2]=e;mj(e)}e=k[o>>2]|0;if(!e){p=g;fb(p|0)}f=k[p>>2]|0;if((f|0)!=(e|0))k[p>>2]=f+(~((f+-2-e|0)>>>1)<<1);mj(e);p=g;fb(p|0)}function Rc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;k[a>>2]=36316;k[a+4>>2]=c;o=a+8|0;g=k[c>>2]|0;m=c+16|0;f=k[m>>2]|0;l=ia(f,g)|0;k[o>>2]=0;p=a+12|0;k[p>>2]=0;k[a+16>>2]=0;do if(l){if(!((l|0)<0?(x=0,qa(178,o|0),g=x,x=0,g&1):0))n=4;if((n|0)==4?(h=l<<1,x=0,j=ta(67,h|0)|0,g=x,x=0,!(g&1)):0){k[o>>2]=j;g=j+(l<<1)|0;k[a+16>>2]=g;sw(j|0,0,h|0)|0;k[p>>2]=g;g=k[c>>2]|0;f=k[m>>2]|0;break}h=Wa()|0;e=k[o>>2]|0;f=e;if(e){g=k[p>>2]|0;if((g|0)!=(e|0))k[p>>2]=g+(~((g+-2-f|0)>>>1)<<1);mj(e)}p=h;fb(p|0)}while(0);h=a+20|0;f=ia(g<<1,f)|0;k[h>>2]=0;j=a+24|0;k[j>>2]=0;k[a+28>>2]=0;if(!f){p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}if(!((f|0)<0?(x=0,qa(178,h|0),m=x,x=0,m&1):0))n=13;if((n|0)==13?(x=0,e=ta(67,f|0)|0,n=x,x=0,!(n&1)):0){k[j>>2]=e;k[h>>2]=e;k[a+28>>2]=e+f;do{i[e>>0]=0;e=(k[j>>2]|0)+1|0;k[j>>2]=e;f=f+-1|0}while((f|0)!=0);p=a+32|0;o=d;o=k[o>>2]|0;d=d+4|0;d=k[d>>2]|0;n=p;k[n>>2]=o;p=p+4|0;k[p>>2]=d;p=a+40|0;k[p>>2]=o;p=a+48|0;k[p>>2]=k[b>>2];k[p+4>>2]=k[b+4>>2];k[p+8>>2]=k[b+8>>2];return}g=Wa()|0;e=k[h>>2]|0;if(e){if((k[j>>2]|0)!=(e|0))k[j>>2]=e;mj(e)}e=k[o>>2]|0;if(!e){p=g;fb(p|0)}f=k[p>>2]|0;if((f|0)!=(e|0))k[p>>2]=f+(~((f+-2-e|0)>>>1)<<1);mj(e);p=g;fb(p|0)}function Sc(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36316;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function Tc(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36316;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function Uc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+48|0;if(!(k[e>>2]|0)){h=a+52|0;Zc(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;Zc(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function Vc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+48>>2]|0;if(!e){e=a+52|0;Wc(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{Xc(a,e,b,c,d);return}}function Wc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0;l=a+4|0;f=k[l>>2]|0;do if(!(i[f+32>>0]|0))n=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*6|0)|0;f=k[l>>2]|0;h=k[f+16>>2]|0;if((d|0)<=0){n=k[g>>2]|0;break}b=k[g>>2]|0;f=b;g=0;while(1){n=f+4|0;o=j[f>>1]|0;j[f>>1]=j[n>>1]|0;j[n>>1]=o;g=g+1|0;if((g|0)==(d|0))break;else f=f+(h<<1)|0}n=b;f=k[l>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:if((k[f+24>>2]|0)==2){if((d|0)<=0)return;f=a+32|0;b=0;do{o=k[f>>2]|0;l=m[n+(b*6|0)+2>>1]<>1]<>1]<>1]=(l+49152+((a+e|0)>>>2)&65535)>>>o;j[c+(b*6|0)+2>>1]=a>>>o;j[c+(b*6|0)+4>>1]=e>>>o;b=b+1|0}while((b|0)!=(d|0));return}else{g=(e|0)<(d|0)?e:d;if((g|0)<=0)return;h=e<<1;f=k[a+32>>2]|0;b=0;do{d=m[n+(b*6|0)+2>>1]<>1]<>1]<>1]=(d+49152+((a+o|0)>>>2)&65535)>>>f;j[c+(b+e<<1)>>1]=a>>>f;j[c+(b+h<<1)>>1]=o>>>f;b=b+1|0}while((b|0)!=(g|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;g=(e|0)<(d|0)?e:d;if((g|0)<=0)return;h=e<<1;l=e*3|0;f=k[a+32>>2]|0;b=0;do{o=j[n+(b<<3)+6>>1]|0;p=m[n+(b<<3)+2>>1]<>1]<>1]<>1]=(p+49152+((d+a|0)>>>2)&65535)>>>f;j[c+(b+e<<1)>>1]=d>>>f;j[c+(b+h<<1)>>1]=a>>>f;j[c+(b+l<<1)>>1]=o;b=b+1|0}while((b|0)!=(g|0));return}default:return}}function Xc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;Wc(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;Wc(a,q,c,d,e);r=n;return}function Yc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;e=r;r=r+176|0;c=e+152|0;j=e+16|0;g=e;if(!(b&1)){c=(b|0)/4|0;if((b|0)>3){d=0;do{j=a+(d<<2)|0;h=k[j>>2]|0;k[j>>2]=h>>>8&16711935|h<<8&-16711936;d=d+1|0}while((d|0)<(c|0))}if(!(b&3)){r=e;return}g=a+(b+-2)|0;j=a+(b+-1)|0;h=i[g>>0]|0;i[g>>0]=i[j>>0]|0;i[j>>0]=h;r=e;return}h=j+56|0;f=j+4|0;k[j>>2]=36160;k[h>>2]=36180;x=0;ra(62,j+56|0,f|0);e=x;x=0;if(e&1){j=Wa()|0;qn(h);fb(j|0)}k[j+128>>2]=0;k[j+132>>2]=-1;k[j>>2]=36200;k[j+56>>2]=36220;x=0;qa(180,f|0);e=x;x=0;do if(e&1)c=Wa()|0;else{k[f>>2]=36236;e=j+36|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[j+52>>2]=16;k[c>>2]=0;k[c+4>>2]=0;k[c+8>>2]=0;x=0;ra(63,f|0,c|0);a=x;x=0;if(a&1){j=Wa()|0;Sm(c);Sm(e);xn(f);c=j;break}Sm(c);x=0;c=va(28,j|0,49087,24)|0;a=x;x=0;if((!(a&1)?(x=0,d=Aa(36,c|0,b|0)|0,b=x,x=0,!(b&1)):0)?(x=0,va(28,d|0,49112,20)|0,b=x,x=0,!(b&1)):0){a=Va(16)|0;x=0;ra(64,g|0,f|0);b=x;x=0;if(!(b&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,a|0,1,35648,g|0);b=x;x=0;if(b&1)d=1;else{x=0;Fa(6,a|0,824,96);x=0;d=0}c=Wa()|0;Sm(g);if(!d){g=c;k[j>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}}else c=Wa()|0;Ua(a|0);g=c;k[j>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}g=Wa()|0;k[j>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}while(0);j=c;qn(h);fb(j|0)}function Zc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=a+4|0;f=k[n>>2]|0;a:do switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)<=0)break a;f=a+40|0;a=0;do{e=k[f>>2]|0;h=m[b+(a*6|0)+2>>1]<>1]<>1]<>2)+16384|0;j[c+(a*6|0)>>1]=(g+32768+l&65535)>>>e;j[c+(a*6|0)+2>>1]=(l&65535)>>>e;j[c+(a*6|0)+4>>1]=(h+32768+l&65535)>>>e;a=a+1|0}while((a|0)!=(d|0))}else{g=(d|0)<(e|0)?d:e;if((g|0)<=0)break a;h=e<<1;f=a+40|0;a=0;do{l=k[f>>2]|0;p=m[b+(a+e<<1)>>1]<>1]<>1]<>2)+16384|0;j[c+(a*6|0)>>1]=(q+32768+o&65535)>>>l;j[c+(a*6|0)+2>>1]=(o&65535)>>>l;j[c+(a*6|0)+4>>1]=(p+32768+o&65535)>>>l;a=a+1|0}while((a|0)!=(g|0))}break}case 4:{if((k[f+24>>2]|0)==1?(l=(d|0)<(e|0)?d:e,(l|0)>0):0){h=e<<1;f=a+40|0;a=e*3|0;g=0;do{q=k[f>>2]|0;p=m[b+(g+e<<1)>>1]<>1]<>1]<>2)+16384|0;r=j[b+(g+a<<1)>>1]|0;t=ww((o&65535)>>>q&65535|0,0,16)|0;p=(p+32768+o&65535)>>>q|M;r=ww(r&65535|0,0,48)|0;r=t|(s+32768+o&65535)>>>q&65535|r;p=p&65535|M;q=c+(g<<3)|0;o=q;j[o>>1]=r;j[o+2>>1]=r>>>16;q=q+4|0;j[q>>1]=p;j[q+2>>1]=p>>>16;g=g+1|0}while((g|0)!=(l|0))}break}default:{}}while(0);f=k[n>>2]|0;if(!(i[f+32>>0]|0))return;g=k[f+16>>2]|0;if((d|0)<=0)return;f=c;a=0;while(1){t=f+4|0;s=j[f>>1]|0;j[f>>1]=j[t>>1]|0;j[t>>1]=s;a=a+1|0;if((a|0)==(d|0))break;else f=f+(g<<1)|0}return}function _c(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36340;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function $c(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36340;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function ad(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+48|0;if(!(k[e>>2]|0)){h=a+52|0;ed(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;ed(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function bd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+48>>2]|0;if(!e){e=a+52|0;cd(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{dd(a,e,b,c,d);return}}function cd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0;l=a+4|0;f=k[l>>2]|0;do if(!(i[f+32>>0]|0))n=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*6|0)|0;f=k[l>>2]|0;h=k[f+16>>2]|0;if((d|0)<=0){n=k[g>>2]|0;break}b=k[g>>2]|0;f=b;g=0;while(1){n=f+4|0;o=j[f>>1]|0;j[f>>1]=j[n>>1]|0;j[n>>1]=o;g=g+1|0;if((g|0)==(d|0))break;else f=f+(h<<1)|0}n=b;f=k[l>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:if((k[f+24>>2]|0)==2){if((d|0)<=0)return;f=a+32|0;b=0;do{e=k[f>>2]|0;l=m[n+(b*6|0)>>1]<>1]<>1]<>>1)&65535)>>>e&65535;j[c+(b*6|0)>>1]=(l+32768-a&65535)>>>e;j[c+(b*6|0)+2>>1]=(a&65535)>>>e;j[c+(b*6|0)+4>>1]=o;b=b+1|0}while((b|0)!=(d|0));return}else{g=(e|0)<(d|0)?e:d;if((g|0)<=0)return;h=e<<1;f=k[a+32>>2]|0;b=0;do{d=m[n+(b*6|0)>>1]<>1]<>1]<>>1)&65535)>>>f&65535;j[c+(b<<1)>>1]=(d+32768-a&65535)>>>f;j[c+(b+e<<1)>>1]=(a&65535)>>>f;j[c+(b+h<<1)>>1]=o;b=b+1|0}while((b|0)!=(g|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;g=(e|0)<(d|0)?e:d;if((g|0)<=0)return;h=e<<1;l=e*3|0;f=k[a+32>>2]|0;b=0;do{o=j[n+(b<<3)+6>>1]|0;p=m[n+(b<<3)>>1]<>1]<>1]<>>1)&65535)>>>f&65535;j[c+(b<<1)>>1]=(p+32768-d&65535)>>>f;j[c+(b+e<<1)>>1]=(d&65535)>>>f;j[c+(b+h<<1)>>1]=a;j[c+(b+l<<1)>>1]=o;b=b+1|0}while((b|0)!=(g|0));return}default:return}}function dd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;cd(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;cd(a,q,c,d,e);r=n;return}function ed(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;n=a+4|0;f=k[n>>2]|0;a:do switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)<=0)break a;f=a+40|0;a=0;do{l=k[f>>2]|0;h=m[b+(a*6|0)+2>>1]<>1]<>1]<>>1)&65535)>>>l&65535;j[c+(a*6|0)>>1]=g>>>l;j[c+(a*6|0)+2>>1]=h>>>l;j[c+(a*6|0)+4>>1]=e;a=a+1|0}while((a|0)!=(d|0))}else{g=(d|0)<(e|0)?d:e;if((g|0)<=0)break a;h=e<<1;f=a+40|0;a=0;do{o=k[f>>2]|0;p=m[b+(a+e<<1)>>1]<>1]<>1]<>>1)&65535)>>>o&65535;j[c+(a*6|0)>>1]=q>>>o;j[c+(a*6|0)+2>>1]=p>>>o;j[c+(a*6|0)+4>>1]=l;a=a+1|0}while((a|0)!=(g|0))}break}case 4:{if((k[f+24>>2]|0)==1?(l=(d|0)<(e|0)?d:e,(l|0)>0):0){h=e<<1;f=a+40|0;a=e*3|0;g=0;do{o=k[f>>2]|0;q=m[b+(g+e<<1)>>1]<>1]<>1]<>>1)&65535)>>>o;r=j[b+(g+a<<1)>>1]|0;q=ww(q>>>o&65535|0,0,16)|0;p=M|p;r=ww(r&65535|0,0,48)|0;r=s>>>o&65535|q|r;p=p&65535|M;q=c+(g<<3)|0;o=q;j[o>>1]=r;j[o+2>>1]=r>>>16;q=q+4|0;j[q>>1]=p;j[q+2>>1]=p>>>16;g=g+1|0}while((g|0)!=(l|0))}break}default:{}}while(0);f=k[n>>2]|0;if(!(i[f+32>>0]|0))return;g=k[f+16>>2]|0;if((d|0)<=0)return;f=c;a=0;while(1){s=f+4|0;r=j[f>>1]|0;j[f>>1]=j[s>>1]|0;j[s>>1]=r;a=a+1|0;if((a|0)==(d|0))break;else f=f+(g<<1)|0}return}function fd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36364;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function gd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36364;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function hd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+48|0;if(!(k[e>>2]|0)){h=a+52|0;ld(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;ld(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function id(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+48>>2]|0;if(!e){e=a+52|0;jd(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{kd(a,e,b,c,d);return}}function jd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0;l=a+4|0;f=k[l>>2]|0;do if(!(i[f+32>>0]|0))n=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*6|0)|0;f=k[l>>2]|0;h=k[f+16>>2]|0;if((d|0)<=0){n=k[g>>2]|0;break}b=k[g>>2]|0;f=b;g=0;while(1){n=f+4|0;o=j[f>>1]|0;j[f>>1]=j[n>>1]|0;j[n>>1]=o;g=g+1|0;if((g|0)==(d|0))break;else f=f+(h<<1)|0}n=b;f=k[l>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:if((k[f+24>>2]|0)==2){if((d|0)<=0)return;f=a+32|0;b=0;do{e=k[f>>2]|0;a=m[n+(b*6|0)+2>>1]<>1]<>>e&65535;j[c+(b*6|0)>>1]=((m[n+(b*6|0)>>1]<>>e;j[c+(b*6|0)+2>>1]=(a&65535)>>>e;j[c+(b*6|0)+4>>1]=o;b=b+1|0}while((b|0)!=(d|0));return}else{g=(e|0)<(d|0)?e:d;if((g|0)<=0)return;h=e<<1;f=k[a+32>>2]|0;b=0;do{a=m[n+(b*6|0)+2>>1]<>1]<>>f&65535;j[c+(b<<1)>>1]=((m[n+(b*6|0)>>1]<>>f;j[c+(b+e<<1)>>1]=(a&65535)>>>f;j[c+(b+h<<1)>>1]=o;b=b+1|0}while((b|0)!=(g|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;h=(e|0)<(d|0)?e:d;if((h|0)<=0)return;l=e<<1;g=e*3|0;f=k[a+32>>2]|0;b=0;do{o=j[n+(b<<3)+6>>1]|0;d=m[n+(b<<3)+2>>1]<>1]<>>f&65535;j[c+(b<<1)>>1]=((m[n+(b<<3)>>1]<>>f;j[c+(b+e<<1)>>1]=(d&65535)>>>f;j[c+(b+l<<1)>>1]=a;j[c+(b+g<<1)>>1]=o;b=b+1|0}while((b|0)!=(h|0));return}default:return}}function kd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;jd(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;jd(a,q,c,d,e);r=n;return}function ld(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;n=a+4|0;f=k[n>>2]|0;a:do switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)<=0)break a;f=a+40|0;a=0;do{l=k[f>>2]|0;h=m[b+(a*6|0)+2>>1]<>1]<>>l&65535;j[c+(a*6|0)>>1]=((m[b+(a*6|0)>>1]<>>l;j[c+(a*6|0)+2>>1]=(h&65535)>>>l;j[c+(a*6|0)+4>>1]=e;a=a+1|0}while((a|0)!=(d|0))}else{g=(d|0)<(e|0)?d:e;if((g|0)<=0)break a;h=e<<1;f=a+40|0;a=0;do{o=k[f>>2]|0;p=m[b+(a+e<<1)>>1]<>1]<>>o&65535;j[c+(a*6|0)>>1]=((m[b+(a<<1)>>1]<>>o;j[c+(a*6|0)+2>>1]=(p&65535)>>>o;j[c+(a*6|0)+4>>1]=l;a=a+1|0}while((a|0)!=(g|0))}break}case 4:{if((k[f+24>>2]|0)==1?(l=(d|0)<(e|0)?d:e,(l|0)>0):0){h=e<<1;f=a+40|0;a=e*3|0;g=0;do{q=k[f>>2]|0;s=m[b+(g+e<<1)>>1]<>1]<>>q;o=(s+32768+(m[b+(g+h<<1)>>1]<>>q;r=j[b+(g+a<<1)>>1]|0;q=ww((s&65535)>>>q&65535|0,0,16)|0;o=o|M;r=ww(r&65535|0,0,48)|0;r=q|p&65535|r;o=o&65535|M;p=c+(g<<3)|0;q=p;j[q>>1]=r;j[q+2>>1]=r>>>16;p=p+4|0;j[p>>1]=o;j[p+2>>1]=o>>>16;g=g+1|0}while((g|0)!=(l|0))}break}default:{}}while(0);f=k[n>>2]|0;if(!(i[f+32>>0]|0))return;g=k[f+16>>2]|0;if((d|0)<=0)return;f=c;a=0;while(1){s=f+4|0;r=j[f>>1]|0;j[f>>1]=j[s>>1]|0;j[s>>1]=r;a=a+1|0;if((a|0)==(d|0))break;else f=f+(g<<1)|0}return}function md(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0;n=r;r=r+16|0;l=n;m=k[a>>2]|0;if(!m){a=0;r=n;return a|0}o=b;h=d-o|0;j=e+12|0;g=k[j>>2]|0;h=(g|0)>(h|0)?g-h|0:0;g=c;e=g-o|0;if((e|0)>0?(Qb[k[(k[m>>2]|0)+48>>2]&63](m,b,e)|0)!=(e|0):0){k[a>>2]=0;o=0;r=n;return o|0}do if((h|0)>0){Rm(l,h,f);x=0;e=va(k[(k[m>>2]|0)+48>>2]|0,m|0,((i[l>>0]&1)==0?l+1|0:k[l+8>>2]|0)|0,h|0)|0;o=x;x=0;if(o&1){o=Wa()|0;Sm(l);fb(o|0)}if((e|0)==(h|0)){Sm(l);break}k[a>>2]=0;Sm(l);o=0;r=n;return o|0}while(0);d=d-g|0;if((d|0)>0?(Qb[k[(k[m>>2]|0)+48>>2]&63](m,c,d)|0)!=(d|0):0){k[a>>2]=0;o=0;r=n;return o|0}k[j>>2]=0;o=m;r=n;return o|0}function nd(a){a=a|0;k[a>>2]=36236;Sm(a+32|0);xn(a);return}function od(a){a=a|0;k[a>>2]=36236;Sm(a+32|0);xn(a);mj(a);return}function pd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0;g=b+44|0;h=k[g>>2]|0;l=b+24|0;m=k[l>>2]|0;if(h>>>0>>0){k[g>>2]=m;h=m}j=h;g=f&24;if(!g){b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}if((e|0)==1&(g|0)==24){b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}a:do switch(e|0){case 0:{g=0;e=0;break}case 1:if(!(f&8)){e=m-(k[b+20>>2]|0)|0;g=e;e=((e|0)<0)<<31>>31;break a}else{e=(k[b+12>>2]|0)-(k[b+8>>2]|0)|0;g=e;e=((e|0)<0)<<31>>31;break a}case 2:{g=b+32|0;if(!(i[g>>0]&1))g=g+1|0;else g=k[b+40>>2]|0;e=h-g|0;g=e;e=((e|0)<0)<<31>>31;break}default:{b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}}while(0);e=tw(g|0,e|0,c|0,d|0)|0;c=M;if((c|0)>=0){g=b+32|0;if(!(i[g>>0]&1))g=g+1|0;else g=k[b+40>>2]|0;d=h-g|0;h=((d|0)<0)<<31>>31;if(!((h|0)<(c|0)|(h|0)==(c|0)&d>>>0>>0)){g=f&8;if(!((e|0)==0&(c|0)==0)){if((g|0)!=0?(k[b+12>>2]|0)==0:0){b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}if((f&16|0)!=0&(m|0)==0){b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}}if(g){k[b+12>>2]=(k[b+8>>2]|0)+e;k[b+16>>2]=j}if(f&16)k[l>>2]=(k[b+20>>2]|0)+e;b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=e;k[b+4>>2]=c;return}}b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}function qd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=c+8|0;Sb[k[(k[b>>2]|0)+16>>2]&15](a,b,k[c>>2]|0,k[c+4>>2]|0,0,d);return}function rd(a){a=a|0;var b=0,c=0,d=0,e=0;b=a+44|0;c=k[b>>2]|0;d=k[a+24>>2]|0;if(c>>>0>>0){k[b>>2]=d;c=d}if(!(k[a+48>>2]&8)){a=-1;return a|0}e=a+16|0;b=k[e>>2]|0;d=a+12|0;if(b>>>0>>0){d=k[d>>2]|0;k[e>>2]=c;b=c}else d=k[d>>2]|0;if(d>>>0>=b>>>0){a=-1;return a|0}a=l[d>>0]|0;return a|0}function sd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;d=a+44|0;c=k[d>>2]|0;e=k[a+24>>2]|0;if(c>>>0>>0){k[d>>2]=e;c=e}h=a+8|0;d=k[h>>2]|0;j=a+12|0;f=k[j>>2]|0;g=d;if(d>>>0>=f>>>0){a=-1;return a|0}if((b|0)==-1){k[h>>2]=d;k[j>>2]=f+-1;k[a+16>>2]=c;a=0;return a|0}if(!(k[a+48>>2]&16)){e=b&255;d=f+-1|0;if(e<<24>>24!=(i[d>>0]|0)){a=-1;return a|0}}else{e=b&255;d=f+-1|0}k[h>>2]=g;k[j>>2]=d;k[a+16>>2]=c;i[d>>0]=e;a=b;return a|0}function td(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;s=r;r=r+16|0;m=s;if((b|0)==-1){a=0;r=s;return a|0}n=a+12|0;o=a+8|0;p=(k[n>>2]|0)-(k[o>>2]|0)|0;q=a+24|0;c=k[q>>2]|0;l=a+28|0;d=k[l>>2]|0;do if((c|0)==(d|0)){h=a+48|0;if(!(k[h>>2]&16)){a=-1;r=s;return a|0}j=a+20|0;g=k[j>>2]|0;e=c-g|0;f=a+44|0;g=(k[f>>2]|0)-g|0;d=a+32|0;x=0;ra(67,d|0,0);c=x;x=0;if(!(c&1)){if(!(i[d>>0]&1))c=10;else c=(k[d>>2]&-2)+-1|0;x=0;Fa(8,d|0,c|0,0);c=x;x=0;if(!(c&1)){c=i[d>>0]|0;if(!(c&1)){d=d+1|0;c=(c&255)>>>1}else{d=k[a+40>>2]|0;c=k[a+36>>2]|0}t=d+c|0;k[j>>2]=d;k[l>>2]=t;j=d+e|0;k[q>>2]=j;c=d+g|0;k[f>>2]=c;d=t;break}}t=Wa(0)|0;cb(t|0)|0;eb();t=-1;r=s;return t|0}else{t=a+44|0;h=a+48|0;f=t;j=c;c=k[t>>2]|0}while(0);g=j+1|0;k[m>>2]=g;e=k[(g>>>0>>0?f:m)>>2]|0;k[f>>2]=e;if(k[h>>2]&8){c=a+32|0;if(!(i[c>>0]&1))c=c+1|0;else c=k[a+40>>2]|0;k[o>>2]=c;k[n>>2]=c+p;k[a+16>>2]=e}if((j|0)==(d|0)){t=Vb[k[(k[a>>2]|0)+52>>2]&63](a,b&255)|0;r=s;return t|0}else{k[q>>2]=g;i[j>>0]=b;t=b&255;r=s;return t|0}return 0}function ud(a){a=a|0;var b=0,c=0;k[a>>2]=36200;b=a+56|0;k[b>>2]=36220;c=a+4|0;k[c>>2]=36236;Sm(a+36|0);xn(c);qn(b);return}function vd(a){a=a|0;var b=0,c=0;k[a>>2]=36200;b=a+56|0;k[b>>2]=36220;c=a+4|0;k[c>>2]=36236;Sm(a+36|0);xn(c);qn(b);mj(a);return}function wd(a){a=a|0;var b=0,c=0,d=0,e=0;e=k[(k[a>>2]|0)+-12>>2]|0;b=a+e|0;k[b>>2]=36200;c=a+(e+56)|0;k[c>>2]=36220;d=a+(e+4)|0;k[d>>2]=36236;Sm(a+(e+36)|0);xn(d);qn(c);mj(b);return}function xd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36388;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function yd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36388;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function zd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+36|0;if(!(k[e>>2]|0)){h=a+40|0;Dd(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;Dd(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function Ad(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;Bd(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{Cd(a,e,b,c,d);return}}function Bd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0;h=a+4|0;f=k[h>>2]|0;do if(!(i[f+32>>0]|0))l=b;else{a=a+8|0;vw(k[a>>2]|0,b|0,d*6|0)|0;f=k[h>>2]|0;g=k[f+16>>2]|0;if((d|0)<=0){l=k[a>>2]|0;break}a=k[a>>2]|0;f=a;b=0;while(1){l=f+4|0;n=j[f>>1]|0;j[f>>1]=j[l>>1]|0;j[l>>1]=n;b=b+1|0;if((b|0)==(d|0))break;else f=f+(g<<1)|0}l=a;f=k[h>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{h=m[l+(f*6|0)+2>>1]|0;e=32768-h+(m[l+(f*6|0)+4>>1]|0)|0;n=(m[l+(f*6|0)>>1]|0)-h+32768|0;j[c+(f*6|0)>>1]=h+49152+(((e&65535)+(n&65535)|0)>>>2);j[c+(f*6|0)+2>>1]=e;j[c+(f*6|0)+4>>1]=n;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{h=m[l+(b*6|0)+2>>1]|0;d=32768-h+(m[l+(b*6|0)+4>>1]|0)|0;n=(m[l+(b*6|0)>>1]|0)-h+32768|0;j[c+(b<<1)>>1]=h+49152+(((d&65535)+(n&65535)|0)>>>2);j[c+(b+e<<1)>>1]=d;j[c+(b+a<<1)>>1]=n;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{n=j[l+(g<<3)+6>>1]|0;o=m[l+(g<<3)+2>>1]|0;h=32768-o+(m[l+(g<<3)+4>>1]|0)|0;d=(m[l+(g<<3)>>1]|0)-o+32768|0;j[c+(g<<1)>>1]=o+49152+(((h&65535)+(d&65535)|0)>>>2);j[c+(g+e<<1)>>1]=h;j[c+(g+a<<1)>>1]=d;j[c+(g+b<<1)>>1]=n;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function Cd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;Bd(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;Bd(a,q,c,d,e);r=n;return}function Dd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0;l=a+4|0;a=k[l>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){h=m[b+(a*6|0)+2>>1]|0;g=m[b+(a*6|0)+4>>1]|0;e=(m[b+(a*6|0)>>1]|0)-((g+h|0)>>>2)+16384|0;j[c+(a*6|0)>>1]=g+32768+e;j[c+(a*6|0)+2>>1]=e;j[c+(a*6|0)+4>>1]=h+32768+e;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=m[b+(g+e<<1)>>1]|0;o=m[b+(g+f<<1)>>1]|0;h=(m[b+(g<<1)>>1]|0)-((o+n|0)>>>2)+16384|0;j[c+(g*6|0)>>1]=o+32768+h;j[c+(g*6|0)+2>>1]=h;j[c+(g*6|0)+4>>1]=n+32768+h;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{n=m[b+(g+e<<1)>>1]|0;p=m[b+(g+a<<1)>>1]|0;o=(m[b+(g<<1)>>1]|0)-((p+n|0)>>>2)+16384|0;q=j[b+(g+f<<1)>>1]|0;r=ww(o&65535|0,0,16)|0;n=n+32768+o|M;q=ww(q&65535|0,0,48)|0;q=r|p+32768+o&65535|q;n=n&65535|M;o=c+(g<<3)|0;p=o;j[p>>1]=q;j[p+2>>1]=q>>>16;o=o+4|0;j[o>>1]=n;j[o+2>>1]=n>>>16;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[l>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)<=0)return;a=c;f=0;while(1){r=a+4|0;q=j[a>>1]|0;j[a>>1]=j[r>>1]|0;j[r>>1]=q;f=f+1|0;if((f|0)==(d|0))break;else a=a+(g<<1)|0}return}function Ed(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36412;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function Fd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36412;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function Gd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+36|0;if(!(k[e>>2]|0)){h=a+40|0;Kd(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;Kd(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function Hd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;Id(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{Jd(a,e,b,c,d);return}}function Id(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0;h=a+4|0;f=k[h>>2]|0;do if(!(i[f+32>>0]|0))l=b;else{a=a+8|0;vw(k[a>>2]|0,b|0,d*6|0)|0;f=k[h>>2]|0;g=k[f+16>>2]|0;if((d|0)<=0){l=k[a>>2]|0;break}a=k[a>>2]|0;f=a;b=0;while(1){l=f+4|0;n=j[f>>1]|0;j[f>>1]=j[l>>1]|0;j[l>>1]=n;b=b+1|0;if((b|0)==(d|0))break;else f=f+(g<<1)|0}l=a;f=k[h>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{g=m[l+(f*6|0)>>1]|0;e=j[l+(f*6|0)+2>>1]|0;h=e&65535;n=(m[l+(f*6|0)+4>>1]|0)+32768-((h+g|0)>>>1)&65535;j[c+(f*6|0)>>1]=g+32768-h;j[c+(f*6|0)+2>>1]=e;j[c+(f*6|0)+4>>1]=n;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{d=j[l+(b*6|0)+2>>1]|0;g=m[l+(b*6|0)>>1]|0;h=d&65535;n=(m[l+(b*6|0)+4>>1]|0)+32768-((h+g|0)>>>1)&65535;j[c+(b<<1)>>1]=g+32768-h;j[c+(b+e<<1)>>1]=d;j[c+(b+a<<1)>>1]=n;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{h=j[l+(g<<3)+2>>1]|0;n=j[l+(g<<3)+6>>1]|0;p=m[l+(g<<3)>>1]|0;o=h&65535;d=(m[l+(g<<3)+4>>1]|0)+32768-((o+p|0)>>>1)&65535;j[c+(g<<1)>>1]=p+32768-o;j[c+(g+e<<1)>>1]=h;j[c+(g+a<<1)>>1]=d;j[c+(g+b<<1)>>1]=n;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function Jd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;Id(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;Id(a,q,c,d,e);r=n;return}function Kd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0;l=a+4|0;a=k[l>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){h=j[b+(a*6|0)+2>>1]|0;e=h&65535;g=(m[b+(a*6|0)>>1]|0)+32768+e|0;e=(m[b+(a*6|0)+4>>1]|0)+32768+(((g&65535)+e|0)>>>1)&65535;j[c+(a*6|0)>>1]=g;j[c+(a*6|0)+2>>1]=h;j[c+(a*6|0)+4>>1]=e;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=j[b+(g+e<<1)>>1]|0;h=n&65535;o=(m[b+(g<<1)>>1]|0)+32768+h|0;h=(m[b+(g+f<<1)>>1]|0)+32768+(((o&65535)+h|0)>>>1)&65535;j[c+(g*6|0)>>1]=o;j[c+(g*6|0)+2>>1]=n;j[c+(g*6|0)+4>>1]=h;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{o=j[b+(g+e<<1)>>1]|0;n=o&65535;p=(m[b+(g<<1)>>1]|0)+32768+n&65535;n=(m[b+(g+a<<1)>>1]|0)+32768+((p+n|0)>>>1)|0;q=j[b+(g+f<<1)>>1]|0;o=ww(o&65535|0,0,16)|0;n=M|n;q=ww(q&65535|0,0,48)|0;q=p|o|q;n=n&65535|M;o=c+(g<<3)|0;p=o;j[p>>1]=q;j[p+2>>1]=q>>>16;o=o+4|0;j[o>>1]=n;j[o+2>>1]=n>>>16;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[l>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)<=0)return;a=c;f=0;while(1){q=a+4|0;p=j[a>>1]|0;j[a>>1]=j[q>>1]|0;j[q>>1]=p;f=f+1|0;if((f|0)==(d|0))break;else a=a+(g<<1)|0}return}function Ld(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36436;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function Md(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36436;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function Nd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+36|0;if(!(k[e>>2]|0)){h=a+40|0;Rd(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;Rd(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function Od(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;Pd(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{Qd(a,e,b,c,d);return}}function Pd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0;h=a+4|0;f=k[h>>2]|0;do if(!(i[f+32>>0]|0))l=b;else{a=a+8|0;vw(k[a>>2]|0,b|0,d*6|0)|0;f=k[h>>2]|0;g=k[f+16>>2]|0;if((d|0)<=0){l=k[a>>2]|0;break}a=k[a>>2]|0;f=a;b=0;while(1){l=f+4|0;n=j[f>>1]|0;j[f>>1]=j[l>>1]|0;j[l>>1]=n;b=b+1|0;if((b|0)==(d|0))break;else f=f+(g<<1)|0}l=a;f=k[h>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{e=j[l+(f*6|0)+2>>1]|0;h=e&65535;n=32768-h+(m[l+(f*6|0)+4>>1]|0)&65535;j[c+(f*6|0)>>1]=(m[l+(f*6|0)>>1]|0)+32768-h;j[c+(f*6|0)+2>>1]=e;j[c+(f*6|0)+4>>1]=n;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{d=j[l+(b*6|0)+2>>1]|0;h=d&65535;n=32768-h+(m[l+(b*6|0)+4>>1]|0)&65535;j[c+(b<<1)>>1]=(m[l+(b*6|0)>>1]|0)+32768-h;j[c+(b+e<<1)>>1]=d;j[c+(b+a<<1)>>1]=n;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{h=j[l+(g<<3)+2>>1]|0;n=j[l+(g<<3)+6>>1]|0;o=h&65535;d=32768-o+(m[l+(g<<3)+4>>1]|0)&65535;j[c+(g<<1)>>1]=(m[l+(g<<3)>>1]|0)+32768-o;j[c+(g+e<<1)>>1]=h;j[c+(g+a<<1)>>1]=d;j[c+(g+b<<1)>>1]=n;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function Qd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;Pd(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;Pd(a,q,c,d,e);r=n;return}function Rd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0;l=a+4|0;a=k[l>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){h=j[b+(a*6|0)+2>>1]|0;g=h&65535;e=g+32768+(m[b+(a*6|0)+4>>1]|0)&65535;j[c+(a*6|0)>>1]=(m[b+(a*6|0)>>1]|0)+32768+g;j[c+(a*6|0)+2>>1]=h;j[c+(a*6|0)+4>>1]=e;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=j[b+(g+e<<1)>>1]|0;o=n&65535;h=o+32768+(m[b+(g+f<<1)>>1]|0)&65535;j[c+(g*6|0)>>1]=(m[b+(g<<1)>>1]|0)+32768+o;j[c+(g*6|0)+2>>1]=n;j[c+(g*6|0)+4>>1]=h;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{o=j[b+(g+e<<1)>>1]|0;n=o&65535;p=(m[b+(g<<1)>>1]|0)+32768+n|0;n=n+32768+(m[b+(g+a<<1)>>1]|0)|0;q=j[b+(g+f<<1)>>1]|0;o=ww(o&65535|0,0,16)|0;n=M|n;q=ww(q&65535|0,0,48)|0;q=p&65535|o|q;n=n&65535|M;o=c+(g<<3)|0;p=o;j[p>>1]=q;j[p+2>>1]=q>>>16;o=o+4|0;j[o>>1]=n;j[o+2>>1]=n>>>16;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[l>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)<=0)return;a=c;f=0;while(1){q=a+4|0;p=j[a>>1]|0;j[a>>1]=j[q>>1]|0;j[q>>1]=p;f=f+1|0;if((f|0)==(d|0))break;else a=a+(g<<1)|0}return}function Sd(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36460;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d)return;b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);return}function Td(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=36460;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}d=k[a+8>>2]|0;if(!d){mj(a);return}b=a+12|0;c=k[b>>2]|0;if((c|0)!=(d|0))k[b>>2]=c+(~((c+-2-d|0)>>>1)<<1);mj(d);mj(a);return}function Ud(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=a+36|0;if(!(k[e>>2]|0)){h=a+40|0;Yd(a,b,k[h>>2]|0,c,d);k[h>>2]=(k[h>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}j=a+4|0;f=c<<1;g=ia(f,k[(k[j>>2]|0)+16>>2]|0)|0;h=a+20|0;Yd(a,b,k[h>>2]|0,c,d);b=k[j>>2]|0;if((k[b+28>>2]|0)==536870912)Yc(k[h>>2]|0,ia(f,k[b+16>>2]|0)|0);j=k[e>>2]|0;if((Qb[k[(k[j>>2]|0)+48>>2]&63](j,k[h>>2]|0,g)|0)==(g|0))return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,3,35648);j=x;x=0;if(j&1){j=Wa()|0;Ua(b|0);fb(j|0)}else ub(b|0,824,96)}function Vd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;Wd(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{Xd(a,e,b,c,d);return}}function Wd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0;h=a+4|0;f=k[h>>2]|0;do if(!(i[f+32>>0]|0))l=b;else{a=a+8|0;vw(k[a>>2]|0,b|0,d*6|0)|0;f=k[h>>2]|0;g=k[f+16>>2]|0;if((d|0)<=0){l=k[a>>2]|0;break}a=k[a>>2]|0;f=a;b=0;while(1){l=f+4|0;m=j[f>>1]|0;j[f>>1]=j[l>>1]|0;j[l>>1]=m;b=b+1|0;if((b|0)==(d|0))break;else f=f+(g<<1)|0}l=a;f=k[h>>2]|0}while(0);switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{e=j[l+(f*6|0)+2>>1]|0;m=j[l+(f*6|0)+4>>1]|0;j[c+(f*6|0)>>1]=j[l+(f*6|0)>>1]|0;j[c+(f*6|0)+2>>1]=e;j[c+(f*6|0)+4>>1]=m;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{d=j[l+(b*6|0)+2>>1]|0;m=j[l+(b*6|0)+4>>1]|0;j[c+(b<<1)>>1]=j[l+(b*6|0)>>1]|0;j[c+(b+e<<1)>>1]=d;j[c+(b+a<<1)>>1]=m;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{h=j[l+(g<<3)+2>>1]|0;d=j[l+(g<<3)+4>>1]|0;m=j[l+(g<<3)+6>>1]|0;j[c+(g<<1)>>1]=j[l+(g<<3)>>1]|0;j[c+(g+e<<1)>>1]=h;j[c+(g+a<<1)>>1]=d;j[c+(g+b<<1)>>1]=m;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function Xd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=r;r=r+176|0;o=n+152|0;q=n+16|0;p=n;j=a+4|0;f=k[j>>2]|0;m=d<<1;g=ia(m,k[f+16>>2]|0)|0;do if(g){h=a+20|0;while(1){f=Qb[k[(k[b>>2]|0)+32>>2]&63](b,k[h>>2]|0,g)|0;if(!f)break;if((g|0)==(f|0)){l=26;break}else g=g-f|0}if((l|0)==26){f=k[j>>2]|0;break}l=q+56|0;j=q+4|0;k[q>>2]=36160;k[l>>2]=36180;x=0;ra(62,q+56|0,j|0);n=x;x=0;if(n&1){q=Wa()|0;qn(l);fb(q|0)}k[q+128>>2]=0;k[q+132>>2]=-1;k[q>>2]=36200;k[q+56>>2]=36220;x=0;qa(180,j|0);n=x;x=0;do if(n&1)f=Wa()|0;else{k[j>>2]=36236;b=q+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[q+52>>2]=16;k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;x=0;ra(63,j|0,o|0);n=x;x=0;if(n&1){f=Wa()|0;Sm(o);Sm(b);xn(j);break}Sm(o);x=0;f=va(28,q|0,49029,57)|0;o=x;x=0;if(!(o&1)?(x=0,Aa(36,f|0,0)|0,o=x,x=0,!(o&1)):0){h=Va(16)|0;x=0;ra(64,p|0,j|0);o=x;x=0;if(!(o&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,p|0);o=x;x=0;if(o&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(p);if(!g){p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}}else f=Wa()|0;Ua(h|0);p=f;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}p=Wa()|0;k[q>>2]=36200;k[l>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(l);fb(p|0)}while(0);q=f;qn(l);fb(q|0)}while(0);g=a+20|0;if((k[f+28>>2]|0)!=536870912){q=k[g>>2]|0;Wd(a,q,c,d,e);r=n;return}Yc(k[g>>2]|0,ia(m,k[f+16>>2]|0)|0);q=k[g>>2]|0;Wd(a,q,c,d,e);r=n;return}function Yd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0;l=a+4|0;a=k[l>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){h=j[b+(a*6|0)+2>>1]|0;e=j[b+(a*6|0)+4>>1]|0;j[c+(a*6|0)>>1]=j[b+(a*6|0)>>1]|0;j[c+(a*6|0)+2>>1]=h;j[c+(a*6|0)+4>>1]=e;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=j[b+(g+e<<1)>>1]|0;h=j[b+(g+f<<1)>>1]|0;j[c+(g*6|0)>>1]=j[b+(g<<1)>>1]|0;j[c+(g*6|0)+2>>1]=n;j[c+(g*6|0)+4>>1]=h;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{n=j[b+(g<<1)>>1]|0;q=j[b+(g+f<<1)>>1]|0;o=m[b+(g+a<<1)>>1]|0;p=ww(m[b+(g+e<<1)>>1]|0,0,16)|0;o=M|o;q=ww(q&65535|0,0,48)|0;q=p|n&65535|q;o=o&65535|M;n=c+(g<<3)|0;p=n;j[p>>1]=q;j[p+2>>1]=q>>>16;n=n+4|0;j[n>>1]=o;j[n+2>>1]=o>>>16;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[l>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)<=0)return;a=c;f=0;while(1){q=a+4|0;p=j[a>>1]|0;j[a>>1]=j[q>>1]|0;j[q>>1]=p;f=f+1|0;if((f|0)==(d|0))break;else a=a+(g<<1)|0}return}function Zd(a){a=a|0;return}function _d(a){a=a|0;mj(a);return}function $d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=ia(k[a+8>>2]|0,c)|0;a=k[a+4>>2]|0;if((Qb[k[(k[a>>2]|0)+48>>2]&63](a,b,c)|0)==(c|0))return;d=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,d|0,3,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(d|0);fb(a|0)}else ub(d|0,824,96)}function ae(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0;m=r;r=r+16|0;l=m;j=a+8|0;e=k[j>>2]|0;d=ia(e,c)|0;do if(d){g=a+4|0;f=d;while(1){e=k[g>>2]|0;e=Qb[k[(k[e>>2]|0)+32>>2]&63](e,b,f)|0;if(!e)break;d=f-e|0;if((f|0)==(e|0)){h=11;break}else f=d}if((h|0)==11){e=k[j>>2]|0;f=d;break}d=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,d|0,3,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(d|0);fb(a|0)}else ub(d|0,824,96)}else f=0;while(0);if((e|0)==2){Yc(b,c<<1);e=k[j>>2]|0}d=k[a+12>>2]|0;if((d|0)<=(ia(e,c)|0)){r=m;return}a=k[a+4>>2]|0;Sb[k[(k[a>>2]|0)+16>>2]&15](l,a,d-f|0,0,1,24);r=m;return}function be(a){a=a|0;mj(a);return}function ce(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=a+4|0;vw(k[d>>2]|0,b|0,ia(k[a+8>>2]|0,c)|0)|0;k[d>>2]=(k[d>>2]|0)+(k[a+12>>2]|0);return}function de(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=a+4|0;vw(b|0,k[d>>2]|0,ia(k[a+8>>2]|0,c)|0)|0;k[d>>2]=(k[d>>2]|0)+(k[a+12>>2]|0);return}function ee(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;k[a+112>>2]=0;k[a+108>>2]=0;l=k[b>>2]|0;e=l;do if(l){g=a+92|0;l=a+96|0;h=k[l>>2]|0;j=k[g>>2]|0;c=j;d=h-c|0;if(d>>>0>=4e4)if(d>>>0>4e4?(f=j+4e4|0,(h|0)!=(f|0)):0){k[l>>2]=f;f=c}else f=c;else{fe(g,4e4-d|0);f=k[g>>2]|0;e=k[b>>2]|0}c=a+116|0;k[c>>2]=f;h=a+124|0;k[h>>2]=f;j=a+104|0;k[j>>2]=e;d=e;if(e){if((k[d+12>>2]|0)==(k[d+16>>2]|0)){b=(Ob[k[(k[e>>2]|0)+36>>2]&127](d)|0)==-1;d=k[h>>2]|0;if(b)break;e=k[c>>2]|0}else{d=f;e=f}g=d-e|0;if(g>>>0<=64){f=a+92|0;if((d|0)==(e|0))d=e;else{d=e;e=0;do{i[(k[f>>2]|0)+e>>0]=i[d+e>>0]|0;e=e+1|0;d=k[c>>2]|0}while(e>>>0>>0);e=k[h>>2]|0}f=k[f>>2]|0;b=f;m=b-d|0;k[c>>2]=f;d=e+m|0;k[h>>2]=d;f=a+120|0;k[f>>2]=(k[f>>2]|0)+m;j=k[j>>2]|0;d=Qb[k[(k[j>>2]|0)+32>>2]&63](j,d,(k[l>>2]|0)-(b+g)|0)|0;d=(k[h>>2]|0)+d|0;k[h>>2]=d}}else d=f}else{k[a+104>>2]=0;d=k[b+4>>2]|0;c=a+116|0;k[c>>2]=d;d=d+(k[b+8>>2]|0)|0;k[a+124>>2]=d}while(0);c=k[c>>2]|0;if(c>>>0>=d>>>0){l=c;m=a+120|0;k[m>>2]=l;qe(a);return}while(1){if((i[c>>0]|0)==-1){d=20;break}c=c+1|0;if(c>>>0>=d>>>0){d=20;break}}if((d|0)==20){m=a+120|0;k[m>>2]=c;qe(a);return}}function fe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;j=a+8|0;e=k[j>>2]|0;l=a+4|0;c=k[l>>2]|0;d=c;if((e-d|0)>>>0>=b>>>0){do{i[c>>0]=0;c=(k[l>>2]|0)+1|0;k[l>>2]=c;b=b+-1|0}while((b|0)!=0);return}c=k[a>>2]|0;f=d-c+b|0;if((f|0)<0){jj(a);e=k[j>>2]|0;c=k[a>>2]|0}d=e-c|0;if(d>>>0<1073741823){d=d<<1;d=d>>>0>>0?f:d;c=(k[l>>2]|0)-c|0;if(!d){e=0;g=0;f=c}else h=8}else{d=2147483647;c=(k[l>>2]|0)-c|0;h=8}if((h|0)==8){e=d;g=lj(d)|0;f=c}c=g+f|0;e=g+e|0;d=c;do{i[d>>0]=0;d=c+1|0;c=d;b=b+-1|0}while((b|0)!=0);b=k[a>>2]|0;d=(k[l>>2]|0)-b|0;h=g+(f-d)|0;vw(h|0,b|0,d|0)|0;k[a>>2]=h;k[l>>2]=c;k[j>>2]=e;if(!b)return;mj(b);return}function ge(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;u=r;r=r+32|0;w=u+12|0;t=u;p=a+180|0;q=(k[p>>2]|0)+4|0;if((k[a+32>>2]|0)==1)s=k[a+24>>2]|0;else s=1;b=ia(s<<1,q)|0;k[w>>2]=0;y=w+4|0;k[y>>2]=0;k[w+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,w|0),v=x,x=0,v&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,v=x,x=0,!(v&1)):0){k[w>>2]=d;v=d+(b<<1)|0;k[w+8>>2]=v;sw(d|0,0,c|0)|0;k[y>>2]=v;break}d=Wa()|0;b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[t>>2]=0;v=t+4|0;k[v>>2]=0;k[t+8>>2]=0;do if(!s)g=18;else{if(!(s>>>0>1073741823?(x=0,qa(178,t|0),o=x,x=0,o&1):0))g=16;if((g|0)==16?(e=s<<2,x=0,f=ta(67,e|0)|0,o=x,x=0,!(o&1)):0){k[t>>2]=f;g=f+(s<<2)|0;k[t+8>>2]=g;sw(f|0,0,e|0)|0;k[v>>2]=g;g=18;break}d=Wa()|0;b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+12|0;a:do if((k[f>>2]|0)>0){g=a+4604|0;h=(ia(s,q)|0)+1|0;i=a+4608|0;l=a+92|0;m=(s|0)>0;n=a+4600|0;o=0;b:while(1){c=k[w>>2]|0;b=c+2|0;k[g>>2]=b;c=c+(h<<1)|0;k[i>>2]=c;if(!(o&1))b=c;else{k[g>>2]=c;k[i>>2]=b}e=k[l>>2]|0;x=0;Ja(k[(k[e>>2]|0)+12>>2]|0,e|0,b|0,k[p>>2]|0,q|0);e=x;x=0;if(e&1){g=28;break}if(m){b=k[g>>2]|0;c=k[i>>2]|0;d=k[t>>2]|0;e=0;do{k[n>>2]=k[d+(e<<2)>>2];d=k[p>>2]|0;j[b+(d<<1)>>1]=j[b+(d+-1<<1)>>1]|0;j[c+-2>>1]=j[b>>1]|0;x=0;ra(68,a|0,0);d=x;x=0;if(d&1){g=27;break b}d=k[t>>2]|0;k[d+(e<<2)>>2]=k[n>>2];b=(k[g>>2]|0)+(q<<1)|0;k[g>>2]=b;c=(k[i>>2]|0)+(q<<1)|0;k[i>>2]=c;e=e+1|0}while((e|0)<(s|0))}o=o+1|0;if((o|0)>=(k[f>>2]|0)){g=40;break a}}if((g|0)==27){d=Wa()|0;break}else if((g|0)==28){d=Wa()|0;break}}else g=40;while(0);do if((g|0)==40){x=0;qa(182,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[t>>2]|0;c=b;if(b){d=k[v>>2]|0;if((d|0)!=(b|0))k[v>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[w>>2]|0;if(!b){r=u;return}c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=u;return}while(0);b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function he(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;p=a+4604|0;b=k[p>>2]|0;s=a+180|0;if((k[s>>2]|0)<=0)return;q=a+4608|0;r=a+4612|0;e=b;f=m[b+-2>>1]|0;b=m[b>>1]|0;o=0;while(1){n=k[q>>2]|0;l=m[n+(o+-1<<1)>>1]|0;d=o+1|0;c=m[e+(d<<1)>>1]|0;h=k[r>>2]|0;g=b-f|0;e=f-l|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(me(a,o,0)|0)+o|0;c=k[p>>2]|0;b=m[c+(d+-1<<1)>>1]|0;c=m[c+(d<<1)>>1]|0}else{f=b-l>>31;if((f^e|0)<0)e=b;else e=l+((f^g|0)<0?0:g)|0;n=le(a,h,m[n+(o<<1)>>1]|0,e,0)|0;j[(k[q>>2]|0)+(o<<1)>>1]=n}if((d|0)>=(k[s>>2]|0))break;e=k[p>>2]|0;f=b;b=c;o=d}return}function ie(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;e=a+104|0;if((k[e>>2]|0)>>>0<4)je(a);f=a+100|0;g=a+112|0;h=a+96|0;j=a+108|0;l=a+116|0;b=k[f>>2]|0;d=0;do{c=i[g>>0]|0;if((b|0)>31)break;b=k[h>>2]|0;if(!(c<<24>>24)){i[k[j>>2]>>0]=b>>>24;k[h>>2]=k[h>>2]<<8;b=(k[f>>2]|0)+8|0}else{i[k[j>>2]>>0]=b>>>25;k[h>>2]=k[h>>2]<<7;b=(k[f>>2]|0)+7|0}k[f>>2]=b;m=k[j>>2]|0;c=(i[m>>0]|0)==-1&1;i[g>>0]=c;k[j>>2]=m+1;k[e>>2]=(k[e>>2]|0)+-1;k[l>>2]=(k[l>>2]|0)+1;d=d+1|0}while((d|0)<4);if(!(c<<24>>24))ke(a,0,(b|0)%8|0);else ke(a,0,(b+-1|0)%8|0);if((k[e>>2]|0)>>>0<4)je(a);b=k[f>>2]|0;c=0;do{if((b|0)>31)break;b=k[h>>2]|0;if(!(i[g>>0]|0)){i[k[j>>2]>>0]=b>>>24;k[h>>2]=k[h>>2]<<8;b=(k[f>>2]|0)+8|0}else{i[k[j>>2]>>0]=b>>>25;k[h>>2]=k[h>>2]<<7;b=(k[f>>2]|0)+7|0}k[f>>2]=b;m=k[j>>2]|0;i[g>>0]=(i[m>>0]|0)==-1&1;k[j>>2]=m+1;k[e>>2]=(k[e>>2]|0)+-1;k[l>>2]=(k[l>>2]|0)+1;c=c+1|0}while((c|0)<4);if(!(k[a+132>>2]|0))return;je(a);return}function je(a){a=a|0;var b=0,c=0,d=0,e=0,f=0;b=k[a+132>>2]|0;if(!b){b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,4,35648);a=x;x=0;if(!(a&1))ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}c=a+108|0;d=a+120|0;f=k[d>>2]|0;e=(k[c>>2]|0)-f|0;if((Qb[k[(k[b>>2]|0)+48>>2]&63](b,f,e)|0)==(e|0)){f=k[d>>2]|0;k[c>>2]=f;k[a+104>>2]=(k[a+124>>2]|0)-f;return}b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,4,35648);f=x;x=0;if(!(f&1))ub(b|0,824,96);f=Wa()|0;Ua(b|0);fb(f|0)}function ke(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;l=a+100|0;c=(k[l>>2]|0)-c|0;k[l>>2]=c;if((c|0)>-1){m=a+96|0;k[m>>2]=k[m>>2]|b<>2]=k[m>>2]|b>>0-c;j=a+104|0;if((k[j>>2]|0)>>>0<4){je(a);c=k[l>>2]|0}f=a+112|0;g=a+108|0;h=a+116|0;d=0;while(1){if((c|0)>31)break;c=k[m>>2]|0;if(!(i[f>>0]|0)){i[k[g>>2]>>0]=c>>>24;k[m>>2]=k[m>>2]<<8;c=(k[l>>2]|0)+8|0}else{i[k[g>>2]>>0]=c>>>25;k[m>>2]=k[m>>2]<<7;c=(k[l>>2]|0)+7|0}k[l>>2]=c;n=k[g>>2]|0;i[f>>0]=(i[n>>0]|0)==-1&1;k[g>>2]=n+1;k[j>>2]=(k[j>>2]|0)+-1;k[h>>2]=(k[h>>2]|0)+1;d=d+1|0;if((d|0)>=4){e=11;break}}a:do if((e|0)==11)if((c|0)<0){k[m>>2]=k[m>>2]|b>>0-c;if((k[j>>2]|0)>>>0<4){je(a);c=k[l>>2]|0;d=0}else d=0;do{if((c|0)>31)break a;c=k[m>>2]|0;if(!(i[f>>0]|0)){i[k[g>>2]>>0]=c>>>24;k[m>>2]=k[m>>2]<<8;c=(k[l>>2]|0)+8|0}else{i[k[g>>2]>>0]=c>>>25;k[m>>2]=k[m>>2]<<7;c=(k[l>>2]|0)+7|0}k[l>>2]=c;n=k[g>>2]|0;i[f>>0]=(i[n>>0]|0)==-1&1;k[g>>2]=n+1;k[j>>2]=(k[j>>2]|0)+-1;k[h>>2]=(k[h>>2]|0)+1;d=d+1|0}while((d|0)<4)}while(0);k[m>>2]=k[m>>2]|b<>31;f=(r^b)-r|0;p=a+196+(f*12|0)+10|0;g=j[p>>1]|0;o=a+196+(f*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){b=5;while(1)if((g<>1]^r)-r+d|0;q=a+136|0;d=k[q>>2]|0;if((e&d|0)==(e|0))l=e;else l=d&~(e>>31);e=(c-l^r)-r|0;i=a+144|0;d=k[i>>2]|0;if((e|0)>0)e=(e+d|0)/(d<<1|1|0)|0;else e=(e-d|0)/(d<<1|1|0)|0;n=a+140|0;h=k[n>>2]|0;c=((e|0)<0?h:0)+e|0;h=c-((c|0)<((h+1|0)/2|0|0)?0:h)|0;f=a+196+(f*12|0)+4|0;if(!(d|b))e=(k[f>>2]<<1)+-1+g>>31;else e=0;d=e^h;pe(a,b,d>>30^d<<1,k[a+156>>2]|0);d=k[a+160>>2]|0;b=(k[o>>2]|0)+((h|0)>-1?h:0-h|0)|0;e=(k[f>>2]|0)+(ia(k[i>>2]<<1|1,h)|0)|0;c=j[p>>1]|0;if((c|0)==(d|0)){b=b>>1;e=e>>1;c=d>>1}k[o>>2]=b;d=c+1|0;j[p>>1]=d;b=d+e|0;if((b|0)>=1){if((e|0)>0){e=e-d|0;p=j[m>>1]|0;j[m>>1]=(p<<16>>16<127&1)+(p&65535);e=(e|0)>0?0:e}}else{e=j[m>>1]|0;j[m>>1]=(e&65535)-(e<<16>>16>-128&1);e=(b|0)>(~c|0)?b:0-c|0}k[f>>2]=e;d=k[i>>2]|0;c=d<<1|1;b=(ia(c,(h^r)-r|0)|0)+l|0;if((b|0)>=(0-d|0)){e=k[q>>2]|0;if((e+d|0)<(b|0))b=b-(ia(k[n>>2]|0,c)|0)|0}else{b=(ia(k[n>>2]|0,c)|0)+b|0;e=k[q>>2]|0}if((b&e|0)==(b|0)){r=b;r=r&65535;return r|0}r=e&~(b>>31);r=r&65535;return r|0}function me(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,l=0,n=0;i=(k[a+180>>2]|0)-b|0;l=k[a+4608>>2]|0;n=k[a+4604>>2]|0;e=j[l+(b+-1<<1)>>1]|0;h=e&65535;c=k[a+144>>2]|0;f=0;while(1){d=l+(f+b<<1)|0;g=(m[d>>1]|0)-h|0;if((((g|0)>-1?g:0-g|0)|0)>(c|0))break;j[d>>1]=e;f=f+1|0;if((f|0)==(i|0)){f=i;break}}e=(f|0)==(i|0);g=a+4600|0;d=k[36476+(k[g>>2]<<2)>>2]|0;if((1<(f|0))c=f;else{c=f;do{ke(a,1,1);d=k[g>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[g>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>1]|0,h,m[n+(i<<1)>>1]|0)|0;j[b>>1]=a;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;a=f+1|0;return a|0}if(!c){a=i;return a|0}ke(a,1,1);a=i;return a|0}function ne(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=c-d|0;i=a+136|0;g=a+144|0;e=k[g>>2]|0;if((((h|0)>-1?h:0-h|0)|0)>(e|0)){f=d-c>>31|1;b=ia(f,b-d|0)|0;if((b|0)>0)b=(e+b|0)/(e<<1|1|0)|0;else b=(b-e|0)/(e<<1|1|0)|0;h=a+140|0;e=k[h>>2]|0;c=((b|0)<0?e:0)+b|0;e=c-((c|0)<((e+1|0)/2|0|0)?0:e)|0;oe(a,a+4576|0,e);e=ia(e,f)|0;f=k[g>>2]|0;g=f<<1|1;e=(ia(e,g)|0)+d|0;if((e|0)>=(0-f|0)){b=k[i>>2]|0;if((b+f|0)<(e|0))e=e-(ia(k[h>>2]|0,g)|0)|0}else{e=(ia(k[h>>2]|0,g)|0)+e|0;b=k[i>>2]|0}if((e&b|0)==(e|0)){i=e;i=i&65535;return i|0}i=b&~(e>>31);i=i&65535;return i|0}else{b=b-c|0;if((b|0)>0)b=(e+b|0)/(e<<1|1|0)|0;else b=(b-e|0)/(e<<1|1|0)|0;h=a+140|0;e=k[h>>2]|0;f=((b|0)<0?e:0)+b|0;e=f-((f|0)<((e+1|0)/2|0|0)?0:e)|0;oe(a,a+4588|0,e);f=k[g>>2]|0;g=f<<1|1;e=(ia(g,e)|0)+c|0;if((e|0)>=(0-f|0)){b=k[i>>2]|0;if((b+f|0)<(e|0))e=e-(ia(k[h>>2]|0,g)|0)|0}else{e=(ia(k[h>>2]|0,g)|0)+e|0;b=k[i>>2]|0}if((e&b|0)==(e|0)){i=e;i=i&65535;return i|0}i=b&~(e>>31);i=i&65535;return i|0}return 0}function oe(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;pe(a,e,d,(k[a+156>>2]|0)+-1-(k[36476+(k[a+4600>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function pe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=c>>b;f=a+148|0;g=d-(k[f>>2]|0)|0;if((e|0)<(g+-1|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-31-(k[f>>2]|0)|0)}else ke(a,1,g);b=k[f>>2]|0;ke(a,(1<>2]|0;j=a+120|0;if(b>>>0<((k[j>>2]|0)+-3|0)>>>0){j=a+112|0;g=k[j>>2]|0;a=a+108|0;k[a>>2]=(l[b+1>>0]<<16|l[b>>0]<<24|l[b+2>>0]<<8|l[b+3>>0])>>>g|k[a>>2];a=32-g>>3;k[h>>2]=b+a;k[j>>2]=(a<<3)+g;return}g=a+104|0;c=k[g>>2]|0;do if(c){if((k[c+12>>2]|0)==(k[c+16>>2]|0)){if((Ob[k[(k[c>>2]|0)+36>>2]&127](c)|0)==-1)break;b=k[h>>2]|0}e=a+124|0;c=k[e>>2]|0;f=c-b|0;if(f>>>0<=64){d=a+92|0;if((c|0)==(b|0))c=b;else{c=0;do{i[(k[d>>2]|0)+c>>0]=i[b+c>>0]|0;c=c+1|0;b=k[h>>2]|0}while(c>>>0>>0);c=b;b=k[e>>2]|0}n=k[d>>2]|0;d=n;m=d-c|0;k[h>>2]=n;c=b+m|0;k[e>>2]=c;k[j>>2]=(k[j>>2]|0)+m;g=k[g>>2]|0;g=Qb[k[(k[g>>2]|0)+32>>2]&63](g,c,(k[a+96>>2]|0)-(d+f)|0)|0;k[e>>2]=(k[e>>2]|0)+g}}while(0);g=a+112|0;f=a+108|0;a=k[a+124>>2]|0;e=a+-1|0;b=k[h>>2]|0;while(1){if(b>>>0>=a>>>0){c=14;break}d=i[b>>0]|0;c=d&255;d=d<<24>>24==-1;if(d){if((b|0)==(e|0)){c=25;break}b=b+1|0;if((i[b>>0]|0)<0){c=25;break}}else b=b+1|0;n=k[g>>2]|0;k[f>>2]=c<<24-n|k[f>>2];k[h>>2]=b;n=n+(d?7:8)|0;k[g>>2]=n;if((n|0)>=24){c=33;break}}if((c|0)==14){if((k[g>>2]|0)>=1)return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,5,35648);n=x;x=0;if(!(n&1))ub(b|0,824,96);n=Wa()|0;Ua(b|0);fb(n|0)}else if((c|0)==25){if((k[g>>2]|0)>=1)return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,5,35648);n=x;x=0;if(!(n&1))ub(b|0,824,96);n=Wa()|0;Ua(b|0);fb(n|0)}else if((c|0)==33){a:do if(b>>>0>>0)do{if((i[b>>0]|0)==-1)break a;b=b+1|0}while(b>>>0>>0);while(0);k[j>>2]=b;return}}function re(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+144|0;a:do if(!(k[n>>2]|0)){c=k[a+136>>2]|0;b=a+152|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+184>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+188>>2]|0):0)?(k[d+12>>2]|0)==(k[a+192>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4612>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4612>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4612>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4612>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+152|0;while(0);m=1<>2];c=a+4616|0;d=m<<1;e=a+4620|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4612|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+192|0;j=a+188|0;g=a+184|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function se(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;j=a+8|0;e=k[j>>2]|0;l=a+4|0;c=k[l>>2]|0;d=c;if((e-d|0)>>>0>=b>>>0){do{i[c>>0]=0;c=(k[l>>2]|0)+1|0;k[l>>2]=c;b=b+-1|0}while((b|0)!=0);return}c=k[a>>2]|0;f=d-c+b|0;if((f|0)<0){jj(a);e=k[j>>2]|0;c=k[a>>2]|0}d=e-c|0;if(d>>>0<1073741823){d=d<<1;d=d>>>0>>0?f:d;c=(k[l>>2]|0)-c|0;if(!d){e=0;g=0;f=c}else h=8}else{d=2147483647;c=(k[l>>2]|0)-c|0;h=8}if((h|0)==8){e=d;g=lj(d)|0;f=c}c=g+f|0;e=g+e|0;d=c;do{i[d>>0]=0;d=c+1|0;c=d;b=b+-1|0}while((b|0)!=0);b=k[a>>2]|0;d=(k[l>>2]|0)-b|0;h=g+(f-d)|0;vw(h|0,b|0,d|0)|0;k[a>>2]=h;k[l>>2]=c;k[j>>2]=e;if(!b)return;mj(b);return}function te(a){a=a|0;var b=0,c=0;k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function ue(a){a=a|0;var b=0,c=0;k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function ve(a){a=a|0;var b=0,c=0;k[a>>2]=36052;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function we(a){a=a|0;var b=0,c=0;k[a>>2]=36052;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function xe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+136>>2]|0,k[a+144>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+184>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+188>>2]=f;k[a+192>>2]=e;He(a);e=a+140|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+196+(f*12|0)>>2]=b;k[a+196+(f*12|0)+4>>2]=0;j[a+196+(f*12|0)+8>>1]=0;j[a+196+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4576>>2]=h;k[a+4580>>2]=0;i[a+4584>>0]=l;i[a+4585>>0]=1;i[a+4586>>0]=0;k[a+4588>>2]=h;k[a+4592>>2]=1;i[a+4596>>0]=l;i[a+4597>>0]=1;i[a+4598>>0]=0;k[a+4600>>2]=0;r=g;return}function ye(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4624)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35828;k[b+128>>2]=k[a+136>>2];k[b+132>>2]=k[a+140>>2];k[b+136>>2]=k[a+144>>2];k[b+140>>2]=k[a+148>>2];k[b+144>>2]=k[a+152>>2];k[b+148>>2]=k[a+156>>2];k[b+152>>2]=k[a+160>>2];e=b+156|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+172>>2]=k[d>>2];k[b+176>>2]=0;k[b+180>>2]=0;k[b+184>>2]=0;e=b+4568|0;d=b+188|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4580|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4592|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];Ae(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;Ae(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0} -function ze(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=6;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=6;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Ae(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;t=r;r=r+32|0;v=t+12|0;s=t;o=a+180|0;p=(k[o>>2]|0)+4|0;if((k[a+32>>2]|0)==1)q=k[a+24>>2]|0;else q=1;b=ia(q<<1,p)|0;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;do if(b){if(!(b>>>0>715827882?(x=0,qa(178,v|0),u=x,x=0,u&1):0))g=6;if((g|0)==6?(x=0,c=ta(67,b*6|0)|0,u=x,x=0,!(u&1)):0){k[w>>2]=c;k[v>>2]=c;d=c+(b*6|0)|0;k[v+8>>2]=d;while(1){j[c>>1]=0;j[c+2>>1]=0;j[c+4>>1]=0;b=b+-1|0;if(!b)break;else c=c+6|0}k[w>>2]=d;break}d=Wa()|0;b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);fb(d|0)}while(0);k[s>>2]=0;u=s+4|0;k[u>>2]=0;k[s+8>>2]=0;do if(!q)g=20;else{if(!(q>>>0>1073741823?(x=0,qa(178,s|0),n=x,x=0,n&1):0))g=18;if((g|0)==18?(e=q<<2,x=0,f=ta(67,e|0)|0,n=x,x=0,!(n&1)):0){k[s>>2]=f;g=f+(q<<2)|0;k[s+8>>2]=g;sw(f|0,0,e|0)|0;k[u>>2]=g;g=20;break}d=Wa()|0;b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==20){e=a+12|0;a:do if((k[e>>2]|0)>0){f=a+4604|0;g=(ia(q,p)|0)+1|0;h=a+4608|0;i=a+92|0;l=(q|0)>0;m=a+4600|0;n=0;b:while(1){c=k[v>>2]|0;b=c+6|0;k[f>>2]=b;c=c+(g*6|0)|0;k[h>>2]=c;if(!(n&1))b=c;else{k[f>>2]=c;k[h>>2]=b}d=k[i>>2]|0;x=0;Ja(k[(k[d>>2]|0)+12>>2]|0,d|0,b|0,k[o>>2]|0,p|0);d=x;x=0;if(d&1){g=30;break}if(l){b=k[s>>2]|0;c=k[f>>2]|0;d=0;do{k[m>>2]=k[b+(d<<2)>>2];y=k[o>>2]|0;b=c+(y*6|0)|0;c=c+((y+-1|0)*6|0)|0;j[b>>1]=j[c>>1]|0;j[b+2>>1]=j[c+2>>1]|0;j[b+4>>1]=j[c+4>>1]|0;c=(k[h>>2]|0)+-6|0;b=k[f>>2]|0;j[c>>1]=j[b>>1]|0;j[c+2>>1]=j[b+2>>1]|0;j[c+4>>1]=j[b+4>>1]|0;x=0;ra(69,a|0,0);c=x;x=0;if(c&1){g=29;break b}b=k[s>>2]|0;k[b+(d<<2)>>2]=k[m>>2];c=(k[f>>2]|0)+(p*6|0)|0;k[f>>2]=c;k[h>>2]=(k[h>>2]|0)+(p*6|0);d=d+1|0}while((d|0)<(q|0))}n=n+1|0;if((n|0)>=(k[e>>2]|0)){g=42;break a}}if((g|0)==29){d=Wa()|0;break}else if((g|0)==30){d=Wa()|0;break}}else g=42;while(0);do if((g|0)==42){x=0;qa(182,a|0);y=x;x=0;if(y&1){d=Wa()|0;break}b=k[s>>2]|0;c=b;if(b){d=k[u>>2]|0;if((d|0)!=(b|0))k[u>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[v>>2]|0;if(!b){r=t;return}c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);r=t;return}while(0);b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);fb(d|0)}function Be(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;B=a+180|0;if((k[B>>2]|0)<=0)return;C=a+4608|0;D=a+4604|0;E=a+4612|0;A=0;while(1){x=A+-1|0;f=k[C>>2]|0;g=k[D>>2]|0;b=A+1|0;e=m[g+(A*6|0)>>1]|0;z=k[E>>2]|0;h=m[g+(x*6|0)>>1]|0;l=e-h|0;n=m[f+(x*6|0)>>1]|0;o=h-n|0;p=((((i[z+((m[g+(b*6|0)>>1]|0)-e)>>0]|0)*9|0)+(i[z+l>>0]|0)|0)*9|0)+(i[z+o>>0]|0)|0;d=m[g+(A*6|0)+2>>1]|0;q=m[g+(x*6|0)+2>>1]|0;r=d-q|0;s=m[f+(x*6|0)+2>>1]|0;t=q-s|0;u=((((i[z+((m[g+(b*6|0)+2>>1]|0)-d)>>0]|0)*9|0)+(i[z+r>>0]|0)|0)*9|0)+(i[z+t>>0]|0)|0;c=m[g+(A*6|0)+4>>1]|0;v=m[g+(x*6|0)+4>>1]|0;w=c-v|0;x=m[f+(x*6|0)+4>>1]|0;y=v-x|0;z=((((i[z+((m[g+(b*6|0)+4>>1]|0)-c)>>0]|0)*9|0)+(i[z+w>>0]|0)|0)*9|0)+(i[z+y>>0]|0)|0;if(!(u|p|z))b=(Ce(a,A,0)|0)+A|0;else{g=m[f+(A*6|0)>>1]|0;f=e-n>>31;if((f^o|0)>=0)if((f^l|0)<0)e=n;else e=n-h+e|0;g=De(a,p,g,e,0)|0;f=m[(k[C>>2]|0)+(A*6|0)+2>>1]|0;e=d-s>>31;if((e^t|0)>=0)if((e^r|0)<0)d=s;else d=s-q+d|0;e=De(a,u,f,d,0)|0;f=m[(k[C>>2]|0)+(A*6|0)+4>>1]|0;d=c-x>>31;if((d^y|0)>=0)if((d^w|0)<0)c=x;else c=x-v+c|0;y=De(a,z,f,c,0)|0;z=k[C>>2]|0;j[z+(A*6|0)>>1]=g;j[z+(A*6|0)+2>>1]=e;j[z+(A*6|0)+4>>1]=y}if((b|0)<(k[B>>2]|0))A=b;else break}return}function Ce(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,l=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;B=r;r=r+48|0;q=B+30|0;p=B+24|0;o=B+18|0;s=B+12|0;x=B+6|0;y=B;z=(k[a+180>>2]|0)-b|0;A=k[a+4608>>2]|0;t=k[a+4604>>2]|0;w=b+-1|0;u=j[A+(w*6|0)>>1]|0;v=j[A+(w*6|0)+2>>1]|0;w=j[A+(w*6|0)+4>>1]|0;c=u&65535;d=a+144|0;e=v&65535;f=w&65535;n=0;while(1){i=n+b|0;g=A+(i*6|0)|0;h=A+(i*6|0)+2|0;i=A+(i*6|0)+4|0;C=(m[g>>1]|0)-c|0;l=k[d>>2]|0;if((((C|0)>-1?C:0-C|0)|0)>(l|0))break;C=(m[h>>1]|0)-e|0;if((((C|0)>-1?C:0-C|0)|0)>(l|0))break;C=(m[i>>1]|0)-f|0;if((((C|0)>-1?C:0-C|0)|0)>(l|0))break;j[g>>1]=u;j[h>>1]=v;j[i>>1]=w;n=n+1|0;if((n|0)==(z|0)){n=z;break}}e=(n|0)==(z|0);f=a+4600|0;d=k[36476+(k[f>>2]<<2)>>2]|0;if((1<(n|0))c=n;else{c=n;do{ke(a,1,1);d=k[f>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[f>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>1]=j[C>>1]|0;j[x+2>>1]=j[C+2>>1]|0;j[x+4>>1]=j[C+4>>1]|0;j[y>>1]=u;j[y+2>>1]=v;j[y+4>>1]=w;b=t+(b*6|0)|0;j[o>>1]=j[x>>1]|0;j[o+2>>1]=j[x+2>>1]|0;j[o+4>>1]=j[x+4>>1]|0;j[p>>1]=j[y>>1]|0;j[p+2>>1]=j[y+2>>1]|0;j[p+4>>1]=j[y+4>>1]|0;j[q>>1]=j[b>>1]|0;j[q+2>>1]=j[b+2>>1]|0;j[q+4>>1]=j[b+4>>1]|0;Fe(s,a,o,p,q);j[C>>1]=j[s>>1]|0;j[C+2>>1]=j[s+2>>1]|0;j[C+4>>1]=j[s+4>>1]|0;C=k[f>>2]|0;k[f>>2]=(C|0)<1?0:C+-1|0;C=n+1|0;r=B;return C|0}if(!c){C=z;r=B;return C|0}ke(a,1,1);C=z;r=B;return C|0}function De(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;f=(r^b)-r|0;p=a+196+(f*12|0)+10|0;g=j[p>>1]|0;o=a+196+(f*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){b=5;while(1)if((g<>1]^r)-r+d|0;q=a+136|0;d=k[q>>2]|0;if((e&d|0)==(e|0))l=e;else l=d&~(e>>31);e=(c-l^r)-r|0;i=a+144|0;d=k[i>>2]|0;if((e|0)>0)e=(e+d|0)/(d<<1|1|0)|0;else e=(e-d|0)/(d<<1|1|0)|0;n=a+140|0;h=k[n>>2]|0;c=((e|0)<0?h:0)+e|0;h=c-((c|0)<((h+1|0)/2|0|0)?0:h)|0;f=a+196+(f*12|0)+4|0;if(!(d|b))e=(k[f>>2]<<1)+-1+g>>31;else e=0;d=e^h;Ee(a,b,d>>30^d<<1,k[a+156>>2]|0);d=k[a+160>>2]|0;b=(k[o>>2]|0)+((h|0)>-1?h:0-h|0)|0;e=(k[f>>2]|0)+(ia(k[i>>2]<<1|1,h)|0)|0;c=j[p>>1]|0;if((c|0)==(d|0)){b=b>>1;e=e>>1;c=d>>1}k[o>>2]=b;d=c+1|0;j[p>>1]=d;b=d+e|0;if((b|0)>=1){if((e|0)>0){e=e-d|0;p=j[m>>1]|0;j[m>>1]=(p<<16>>16<127&1)+(p&65535);e=(e|0)>0?0:e}}else{e=j[m>>1]|0;j[m>>1]=(e&65535)-(e<<16>>16>-128&1);e=(b|0)>(~c|0)?b:0-c|0}k[f>>2]=e;d=k[i>>2]|0;c=d<<1|1;b=(ia(c,(h^r)-r|0)|0)+l|0;if((b|0)>=(0-d|0)){e=k[q>>2]|0;if((e+d|0)<(b|0))b=b-(ia(k[n>>2]|0,c)|0)|0}else{b=(ia(k[n>>2]|0,c)|0)+b|0;e=k[q>>2]|0}if((b&e|0)==(b|0)){r=b;r=r&65535;return r|0}r=e&~(b>>31);r=r&65535;return r|0}function Ee(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=c>>b;f=a+148|0;g=d-(k[f>>2]|0)|0;if((e|0)<(g+-1|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-31-(k[f>>2]|0)|0)}else ke(a,1,g);b=k[f>>2]|0;ke(a,(1<>1]|0;p=o-(m[d>>1]|0)>>31|1;f=ia(p,(m[c>>1]|0)-o|0)|0;l=b+144|0;g=k[l>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;w=b+140|0;i=k[w>>2]|0;h=((f|0)<0?i:0)+f|0;i=h-((h|0)<((i+1|0)/2|0|0)?0:i)|0;h=b+4576|0;Ge(b,h,i);t=m[e+2>>1]|0;u=t-(m[d+2>>1]|0)>>31|1;f=ia(u,(m[c+2>>1]|0)-t|0)|0;g=k[l>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;q=k[w>>2]|0;v=((f|0)<0?q:0)+f|0;q=v-((v|0)<((q+1|0)/2|0|0)?0:q)|0;Ge(b,h,q);v=m[e+4>>1]|0;s=v-(m[d+4>>1]|0)>>31|1;f=ia(s,(m[c+4>>1]|0)-v|0)|0;g=k[l>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;n=k[w>>2]|0;f=((f|0)<0?n:0)+f|0;n=f-((f|0)<((n+1|0)/2|0|0)?0:n)|0;Ge(b,h,n);h=k[l>>2]|0;l=h<<1|1;f=(ia(ia(l,i)|0,p)|0)+o|0;c=0-h|0;if((f|0)>=(c|0)){g=k[r>>2]|0;if((g+h|0)<(f|0)){f=f-(ia(k[w>>2]|0,l)|0)|0;d=g}else d=g}else{f=(ia(k[w>>2]|0,l)|0)+f|0;d=k[r>>2]|0}if((f&d|0)!=(f|0))f=d&~(f>>31);e=f&65535;f=(ia(ia(l,q)|0,u)|0)+t|0;if((f|0)>=(c|0)){if((d+h|0)<(f|0))f=f-(ia(k[w>>2]|0,l)|0)|0}else f=(ia(k[w>>2]|0,l)|0)+f|0;if((f&d|0)!=(f|0))f=d&~(f>>31);g=f&65535;f=(ia(ia(l,n)|0,s)|0)+v|0;if((f|0)>=(c|0)){if((d+h|0)<(f|0))f=f-(ia(k[w>>2]|0,l)|0)|0}else f=(ia(k[w>>2]|0,l)|0)+f|0;if((f&d|0)==(f|0)){w=f;w=w&65535;j[a>>1]=e;v=a+2|0;j[v>>1]=g;a=a+4|0;j[a>>1]=w;return}w=d&~(f>>31);w=w&65535;j[a>>1]=e;v=a+2|0;j[v>>1]=g;a=a+4|0;j[a>>1]=w;return}function Ge(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;Ee(a,e,d,(k[a+156>>2]|0)+-1-(k[36476+(k[a+4600>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function He(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+144|0;a:do if(!(k[n>>2]|0)){c=k[a+136>>2]|0;b=a+152|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+184>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+188>>2]|0):0)?(k[d+12>>2]|0)==(k[a+192>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4612>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4612>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4612>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4612>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+152|0;while(0);m=1<>2];c=a+4616|0;d=m<<1;e=a+4620|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4612|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+192|0;j=a+188|0;g=a+184|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function Ie(a){a=a|0;var b=0,c=0;k[a>>2]=36024;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Je(a){a=a|0;var b=0,c=0;k[a>>2]=36024;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Ke(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+136>>2]|0,k[a+144>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+184>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+188>>2]=f;k[a+192>>2]=e;zf(a);e=a+140|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+196+(f*12|0)>>2]=b;k[a+196+(f*12|0)+4>>2]=0;j[a+196+(f*12|0)+8>>1]=0;j[a+196+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4576>>2]=h;k[a+4580>>2]=0;i[a+4584>>0]=l;i[a+4585>>0]=1;i[a+4586>>0]=0;k[a+4588>>2]=h;k[a+4592>>2]=1;i[a+4596>>0]=l;i[a+4597>>0]=1;i[a+4598>>0]=0;k[a+4600>>2]=0;r=g;return}function Le(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4624)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35800;k[b+128>>2]=k[a+136>>2];k[b+132>>2]=k[a+140>>2];k[b+136>>2]=k[a+144>>2];k[b+140>>2]=k[a+148>>2];k[b+144>>2]=k[a+152>>2];k[b+148>>2]=k[a+156>>2];k[b+152>>2]=k[a+160>>2];e=b+156|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+172>>2]=k[d>>2];k[b+176>>2]=0;k[b+180>>2]=0;k[b+184>>2]=0;e=b+4568|0;d=b+188|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4580|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4592|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];sf(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;sf(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function Me(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Ne(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;k[a>>2]=36712;k[a+4>>2]=c;m=a+8|0;d=k[c>>2]|0;j=c+16|0;g=k[j>>2]|0;f=ia(g,d)|0;k[m>>2]=0;n=a+12|0;k[n>>2]=0;k[a+16>>2]=0;do if(!f)f=g;else{if(!((f|0)<0?(x=0,qa(178,m|0),g=x,x=0,g&1):0))l=4;if((l|0)==4?(x=0,h=ta(67,f|0)|0,g=x,x=0,!(g&1)):0){k[n>>2]=h;k[m>>2]=h;k[a+16>>2]=h+f;d=h;do{i[d>>0]=0;d=(k[n>>2]|0)+1|0;k[n>>2]=d;f=f+-1|0}while((f|0)!=0);f=k[j>>2]|0;d=k[c>>2]|0;break}d=Wa()|0;e=k[m>>2]|0;if(e){if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e)}n=d;fb(n|0)}while(0);g=a+20|0;d=ia(f,d)|0;k[g>>2]=0;f=a+24|0;k[f>>2]=0;k[a+28>>2]=0;if(!d){n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))l=15;if((l|0)==15?(x=0,e=ta(67,d|0)|0,l=x,x=0,!(l&1)):0){k[f>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[f>>2]|0)+1|0;k[f>>2]=e;d=d+-1|0}while((d|0)!=0);n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}d=Wa()|0;e=k[g>>2]|0;if(e){if((k[f>>2]|0)!=(e|0))k[f>>2]=e;mj(e)}e=k[m>>2]|0;if(!e){n=d;fb(n|0)}if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e);n=d;fb(n|0)}function Oe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;k[a>>2]=36688;k[a+4>>2]=c;m=a+8|0;d=k[c>>2]|0;j=c+16|0;g=k[j>>2]|0;f=ia(g,d)|0;k[m>>2]=0;n=a+12|0;k[n>>2]=0;k[a+16>>2]=0;do if(!f)f=g;else{if(!((f|0)<0?(x=0,qa(178,m|0),g=x,x=0,g&1):0))l=4;if((l|0)==4?(x=0,h=ta(67,f|0)|0,g=x,x=0,!(g&1)):0){k[n>>2]=h;k[m>>2]=h;k[a+16>>2]=h+f;d=h;do{i[d>>0]=0;d=(k[n>>2]|0)+1|0;k[n>>2]=d;f=f+-1|0}while((f|0)!=0);f=k[j>>2]|0;d=k[c>>2]|0;break}d=Wa()|0;e=k[m>>2]|0;if(e){if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e)}n=d;fb(n|0)}while(0);g=a+20|0;d=ia(f,d)|0;k[g>>2]=0;f=a+24|0;k[f>>2]=0;k[a+28>>2]=0;if(!d){n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))l=15;if((l|0)==15?(x=0,e=ta(67,d|0)|0,l=x,x=0,!(l&1)):0){k[f>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[f>>2]|0)+1|0;k[f>>2]=e;d=d+-1|0}while((d|0)!=0);n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}d=Wa()|0;e=k[g>>2]|0;if(e){if((k[f>>2]|0)!=(e|0))k[f>>2]=e;mj(e)}e=k[m>>2]|0;if(!e){n=d;fb(n|0)}if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e);n=d;fb(n|0)}function Pe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;k[a>>2]=36664;k[a+4>>2]=c;m=a+8|0;d=k[c>>2]|0;j=c+16|0;g=k[j>>2]|0;f=ia(g,d)|0;k[m>>2]=0;n=a+12|0;k[n>>2]=0;k[a+16>>2]=0;do if(!f)f=g;else{if(!((f|0)<0?(x=0,qa(178,m|0),g=x,x=0,g&1):0))l=4;if((l|0)==4?(x=0,h=ta(67,f|0)|0,g=x,x=0,!(g&1)):0){k[n>>2]=h;k[m>>2]=h;k[a+16>>2]=h+f;d=h;do{i[d>>0]=0;d=(k[n>>2]|0)+1|0;k[n>>2]=d;f=f+-1|0}while((f|0)!=0);f=k[j>>2]|0;d=k[c>>2]|0;break}d=Wa()|0;e=k[m>>2]|0;if(e){if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e)}n=d;fb(n|0)}while(0);g=a+20|0;d=ia(f,d)|0;k[g>>2]=0;f=a+24|0;k[f>>2]=0;k[a+28>>2]=0;if(!d){n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))l=15;if((l|0)==15?(x=0,e=ta(67,d|0)|0,l=x,x=0,!(l&1)):0){k[f>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[f>>2]|0)+1|0;k[f>>2]=e;d=d+-1|0}while((d|0)!=0);n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}d=Wa()|0;e=k[g>>2]|0;if(e){if((k[f>>2]|0)!=(e|0))k[f>>2]=e;mj(e)}e=k[m>>2]|0;if(!e){n=d;fb(n|0)}if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e);n=d;fb(n|0)}function Qe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;k[a>>2]=36640;k[a+4>>2]=c;m=a+8|0;d=k[c>>2]|0;j=c+16|0;g=k[j>>2]|0;f=ia(g,d)|0;k[m>>2]=0;n=a+12|0;k[n>>2]=0;k[a+16>>2]=0;do if(!f)f=g;else{if(!((f|0)<0?(x=0,qa(178,m|0),g=x,x=0,g&1):0))l=4;if((l|0)==4?(x=0,h=ta(67,f|0)|0,g=x,x=0,!(g&1)):0){k[n>>2]=h;k[m>>2]=h;k[a+16>>2]=h+f;d=h;do{i[d>>0]=0;d=(k[n>>2]|0)+1|0;k[n>>2]=d;f=f+-1|0}while((f|0)!=0);f=k[j>>2]|0;d=k[c>>2]|0;break}d=Wa()|0;e=k[m>>2]|0;if(e){if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e)}n=d;fb(n|0)}while(0);g=a+20|0;d=ia(f,d)|0;k[g>>2]=0;f=a+24|0;k[f>>2]=0;k[a+28>>2]=0;if(!d){n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}if(!((d|0)<0?(x=0,qa(178,g|0),c=x,x=0,c&1):0))l=15;if((l|0)==15?(x=0,e=ta(67,d|0)|0,l=x,x=0,!(l&1)):0){k[f>>2]=e;k[g>>2]=e;k[a+28>>2]=e+d;do{i[e>>0]=0;e=(k[f>>2]|0)+1|0;k[f>>2]=e;d=d+-1|0}while((d|0)!=0);n=a+36|0;k[n>>2]=k[b>>2];k[n+4>>2]=k[b+4>>2];k[n+8>>2]=k[b+8>>2];return}d=Wa()|0;e=k[g>>2]|0;if(e){if((k[f>>2]|0)!=(e|0))k[f>>2]=e;mj(e)}e=k[m>>2]|0;if(!e){n=d;fb(n|0)}if((k[n>>2]|0)!=(e|0))k[n>>2]=e;mj(e);n=d;fb(n|0)}function Re(a){a=a|0;var b=0,c=0;k[a>>2]=36640;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=k[a+8>>2]|0;if(!c)return;b=a+12|0;if((k[b>>2]|0)!=(c|0))k[b>>2]=c;mj(c);return}function Se(a){a=a|0;var b=0,c=0;k[a>>2]=36640;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}b=k[a+8>>2]|0;if(!b){mj(a);return}c=a+12|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b);mj(a);return}function Te(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=a+36|0;if(!(k[e>>2]|0)){e=a+40|0;Xe(a,b,k[e>>2]|0,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}f=ia(k[(k[a+4>>2]|0)+16>>2]|0,c)|0;g=a+20|0;Xe(a,b,k[g>>2]|0,c,d);a=k[e>>2]|0;if((Qb[k[(k[a>>2]|0)+48>>2]&63](a,k[g>>2]|0,f)|0)==(f|0))return;e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,3,35648);g=x;x=0;if(g&1){g=Wa()|0;Ua(e|0);fb(g|0)}else ub(e|0,824,96)}function Ue(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;Ve(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{We(a,e,b,c,d);return}}function Ve(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0;h=a+4|0;f=k[h>>2]|0;if(!(i[f+32>>0]|0))h=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*3|0)|0;f=k[h>>2]|0;b=k[f+16>>2]|0;if((d|0)>0){f=k[g>>2]|0;a=0;while(1){j=f+2|0;m=i[f>>0]|0;i[f>>0]=i[j>>0]|0;i[j>>0]=m;a=a+1|0;if((a|0)==(d|0))break;else f=f+b|0}f=k[h>>2]|0}h=k[g>>2]|0}switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{g=l[h+(f*3|0)+1>>0]|0;e=128-g+(l[h+(f*3|0)+2>>0]|0)|0;j=(l[h+(f*3|0)>>0]|0)-g+128|0;m=c+(f*3|0)|0;i[m>>0]=g+192+(((e&255)+(j&255)|0)>>>2);i[m+1>>0]=e;i[m+2>>0]=j;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{d=l[h+(b*3|0)+1>>0]|0;j=128-d+(l[h+(b*3|0)+2>>0]|0)|0;m=(l[h+(b*3|0)>>0]|0)-d+128|0;i[c+b>>0]=d+192+(((j&255)+(m&255)|0)>>>2);i[c+(b+e)>>0]=j;i[c+(b+a)>>0]=m;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{m=i[h+(g<<2)+3>>0]|0;n=l[h+(g<<2)+1>>0]|0;d=128-n+(l[h+(g<<2)+2>>0]|0)|0;j=(l[h+(g<<2)>>0]|0)-n+128|0;i[c+g>>0]=n+192+(((d&255)+(j&255)|0)>>>2);i[c+(g+e)>>0]=d;i[c+(g+a)>>0]=j;i[c+(g+b)>>0]=m;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function We(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+176|0;n=m+152|0;p=m+16|0;o=m;g=ia(k[(k[a+4>>2]|0)+16>>2]|0,d)|0;j=a+20|0;f=k[j>>2]|0;if(!g){p=f;Ve(a,p,c,d,e);r=m;return}while(1){h=Qb[k[(k[b>>2]|0)+32>>2]&63](b,f,g)|0;if(!h)break;f=k[j>>2]|0;if((g|0)==(h|0)){l=26;break}else g=g-h|0}if((l|0)==26){Ve(a,f,c,d,e);r=m;return}c=p+56|0;j=p+4|0;k[p>>2]=36160;k[c>>2]=36180;x=0;ra(62,p+56|0,j|0);m=x;x=0;if(m&1){p=Wa()|0;qn(c);fb(p|0)}k[p+128>>2]=0;k[p+132>>2]=-1;k[p>>2]=36200;k[p+56>>2]=36220;x=0;qa(180,j|0);m=x;x=0;do if(m&1)f=Wa()|0;else{k[j>>2]=36236;b=p+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[p+52>>2]=16;k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;x=0;ra(63,j|0,n|0);m=x;x=0;if(m&1){f=Wa()|0;Sm(n);Sm(b);xn(j);break}Sm(n);x=0;f=va(28,p|0,49029,57)|0;n=x;x=0;if(!(n&1)?(x=0,Aa(36,f|0,0)|0,n=x,x=0,!(n&1)):0){h=Va(16)|0;x=0;ra(64,o|0,j|0);n=x;x=0;if(!(n&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,o|0);n=x;x=0;if(n&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(o);if(!g){o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}}else f=Wa()|0;Ua(h|0);o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}o=Wa()|0;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}while(0);p=f;qn(c);fb(p|0)}function Xe(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0;j=a+4|0;a=k[j>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){g=l[b+(a*3|0)+1>>0]|0;f=l[b+(a*3|0)+2>>0]|0;h=(l[b+(a*3|0)>>0]|0)-((f+g|0)>>>2)+64|0;e=c+(a*3|0)|0;i[e>>0]=f+128+h;i[e+1>>0]=h;i[e+2>>0]=g+128+h;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=l[b+(g+e)>>0]|0;o=l[b+(g+f)>>0]|0;m=(l[b+g>>0]|0)-((o+n|0)>>>2)+64|0;h=c+(g*3|0)|0;i[h>>0]=o+128+m;i[h+1>>0]=m;i[h+2>>0]=n+128+m;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{m=l[b+(g+e)>>0]|0;p=l[b+(g+a)>>0]|0;n=(l[b+g>>0]|0)-((p+m|0)>>>2)+64|0;o=c+(g<<2)|0;n=n<<8&65280|l[b+(g+f)>>0]<<24|p+128+n&255|m+128+n<<16&16711680;i[o>>0]=n;i[o+1>>0]=n>>8;i[o+2>>0]=n>>16;i[o+3>>0]=n>>24;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[j>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)>0){a=c;f=0}else return;while(1){p=a+2|0;o=i[a>>0]|0;i[a>>0]=i[p>>0]|0;i[p>>0]=o;f=f+1|0;if((f|0)==(d|0))break;else a=a+g|0}return}function Ye(a){a=a|0;var b=0,c=0;k[a>>2]=36664;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=k[a+8>>2]|0;if(!c)return;b=a+12|0;if((k[b>>2]|0)!=(c|0))k[b>>2]=c;mj(c);return}function Ze(a){a=a|0;var b=0,c=0;k[a>>2]=36664;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}b=k[a+8>>2]|0;if(!b){mj(a);return}c=a+12|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b);mj(a);return}function _e(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=a+36|0;if(!(k[e>>2]|0)){e=a+40|0;cf(a,b,k[e>>2]|0,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}f=ia(k[(k[a+4>>2]|0)+16>>2]|0,c)|0;g=a+20|0;cf(a,b,k[g>>2]|0,c,d);a=k[e>>2]|0;if((Qb[k[(k[a>>2]|0)+48>>2]&63](a,k[g>>2]|0,f)|0)==(f|0))return;e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,3,35648);g=x;x=0;if(g&1){g=Wa()|0;Ua(e|0);fb(g|0)}else ub(e|0,824,96)}function $e(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;af(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{bf(a,e,b,c,d);return}}function af(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0,o=0;h=a+4|0;f=k[h>>2]|0;if(!(i[f+32>>0]|0))h=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*3|0)|0;f=k[h>>2]|0;b=k[f+16>>2]|0;if((d|0)>0){f=k[g>>2]|0;a=0;while(1){j=f+2|0;m=i[f>>0]|0;i[f>>0]=i[j>>0]|0;i[j>>0]=m;a=a+1|0;if((a|0)==(d|0))break;else f=f+b|0}f=k[h>>2]|0}h=k[g>>2]|0}switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{b=l[h+(f*3|0)>>0]|0;e=i[h+(f*3|0)+1>>0]|0;g=e&255;j=(l[h+(f*3|0)+2>>0]|0)+128-((g+b|0)>>>1)&255;m=c+(f*3|0)|0;i[m>>0]=b+128-g;i[m+1>>0]=e;i[m+2>>0]=j;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{j=i[h+(b*3|0)+1>>0]|0;g=l[h+(b*3|0)>>0]|0;d=j&255;m=(l[h+(b*3|0)+2>>0]|0)+128-((d+g|0)>>>1)&255;i[c+b>>0]=g+128-d;i[c+(b+e)>>0]=j;i[c+(b+a)>>0]=m;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{d=i[h+(g<<2)+1>>0]|0;m=i[h+(g<<2)+3>>0]|0;o=l[h+(g<<2)>>0]|0;n=d&255;j=(l[h+(g<<2)+2>>0]|0)+128-((n+o|0)>>>1)&255;i[c+g>>0]=o+128-n;i[c+(g+e)>>0]=d;i[c+(g+a)>>0]=j;i[c+(g+b)>>0]=m;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function bf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+176|0;n=m+152|0;p=m+16|0;o=m;g=ia(k[(k[a+4>>2]|0)+16>>2]|0,d)|0;j=a+20|0;f=k[j>>2]|0;if(!g){p=f;af(a,p,c,d,e);r=m;return}while(1){h=Qb[k[(k[b>>2]|0)+32>>2]&63](b,f,g)|0;if(!h)break;f=k[j>>2]|0;if((g|0)==(h|0)){l=26;break}else g=g-h|0}if((l|0)==26){af(a,f,c,d,e);r=m;return}c=p+56|0;j=p+4|0;k[p>>2]=36160;k[c>>2]=36180;x=0;ra(62,p+56|0,j|0);m=x;x=0;if(m&1){p=Wa()|0;qn(c);fb(p|0)}k[p+128>>2]=0;k[p+132>>2]=-1;k[p>>2]=36200;k[p+56>>2]=36220;x=0;qa(180,j|0);m=x;x=0;do if(m&1)f=Wa()|0;else{k[j>>2]=36236;b=p+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[p+52>>2]=16;k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;x=0;ra(63,j|0,n|0);m=x;x=0;if(m&1){f=Wa()|0;Sm(n);Sm(b);xn(j);break}Sm(n);x=0;f=va(28,p|0,49029,57)|0;n=x;x=0;if(!(n&1)?(x=0,Aa(36,f|0,0)|0,n=x,x=0,!(n&1)):0){h=Va(16)|0;x=0;ra(64,o|0,j|0);n=x;x=0;if(!(n&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,o|0);n=x;x=0;if(n&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(o);if(!g){o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}}else f=Wa()|0;Ua(h|0);o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}o=Wa()|0;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}while(0);p=f;qn(c);fb(p|0)}function cf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0,o=0;j=a+4|0;a=k[j>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){g=i[b+(a*3|0)+1>>0]|0;h=g&255;f=(l[b+(a*3|0)>>0]|0)+128+h|0;h=(l[b+(a*3|0)+2>>0]|0)+128+(((f&255)+h|0)>>>1)&255;e=c+(a*3|0)|0;i[e>>0]=f;i[e+1>>0]=g;i[e+2>>0]=h;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=i[b+(g+e)>>0]|0;m=n&255;o=(l[b+g>>0]|0)+128+m|0;m=(l[b+(g+f)>>0]|0)+128+(((o&255)+m|0)>>>1)&255;h=c+(g*3|0)|0;i[h>>0]=o;i[h+1>>0]=n;i[h+2>>0]=m;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{n=l[b+(g+e)>>0]|0;m=(l[b+g>>0]|0)+128+n&255;o=c+(g<<2)|0;n=m|n<<8|l[b+(g+f)>>0]<<24|(l[b+(g+a)>>0]|0)+128+((m+n|0)>>>1)<<16&16711680;i[o>>0]=n;i[o+1>>0]=n>>8;i[o+2>>0]=n>>16;i[o+3>>0]=n>>24;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[j>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)>0){a=c;f=0}else return;while(1){o=a+2|0;n=i[a>>0]|0;i[a>>0]=i[o>>0]|0;i[o>>0]=n;f=f+1|0;if((f|0)==(d|0))break;else a=a+g|0}return}function df(a){a=a|0;var b=0,c=0;k[a>>2]=36688;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=k[a+8>>2]|0;if(!c)return;b=a+12|0;if((k[b>>2]|0)!=(c|0))k[b>>2]=c;mj(c);return}function ef(a){a=a|0;var b=0,c=0;k[a>>2]=36688;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}b=k[a+8>>2]|0;if(!b){mj(a);return}c=a+12|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b);mj(a);return}function ff(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=a+36|0;if(!(k[e>>2]|0)){e=a+40|0;kf(a,b,k[e>>2]|0,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}f=ia(k[(k[a+4>>2]|0)+16>>2]|0,c)|0;g=a+20|0;kf(a,b,k[g>>2]|0,c,d);a=k[e>>2]|0;if((Qb[k[(k[a>>2]|0)+48>>2]&63](a,k[g>>2]|0,f)|0)==(f|0))return;e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,3,35648);g=x;x=0;if(g&1){g=Wa()|0;Ua(e|0);fb(g|0)}else ub(e|0,824,96)}function gf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;hf(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{jf(a,e,b,c,d);return}}function hf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0;h=a+4|0;f=k[h>>2]|0;if(!(i[f+32>>0]|0))h=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*3|0)|0;f=k[h>>2]|0;b=k[f+16>>2]|0;if((d|0)>0){f=k[g>>2]|0;a=0;while(1){j=f+2|0;m=i[f>>0]|0;i[f>>0]=i[j>>0]|0;i[j>>0]=m;a=a+1|0;if((a|0)==(d|0))break;else f=f+b|0}f=k[h>>2]|0}h=k[g>>2]|0}switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{e=i[h+(f*3|0)+1>>0]|0;g=e&255;j=128-g+(l[h+(f*3|0)+2>>0]|0)&255;m=c+(f*3|0)|0;i[m>>0]=(l[h+(f*3|0)>>0]|0)+128-g;i[m+1>>0]=e;i[m+2>>0]=j;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{j=i[h+(b*3|0)+1>>0]|0;d=j&255;m=128-d+(l[h+(b*3|0)+2>>0]|0)&255;i[c+b>>0]=(l[h+(b*3|0)>>0]|0)+128-d;i[c+(b+e)>>0]=j;i[c+(b+a)>>0]=m;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{d=i[h+(g<<2)+1>>0]|0;m=i[h+(g<<2)+3>>0]|0;n=d&255;j=128-n+(l[h+(g<<2)+2>>0]|0)&255;i[c+g>>0]=(l[h+(g<<2)>>0]|0)+128-n;i[c+(g+e)>>0]=d;i[c+(g+a)>>0]=j;i[c+(g+b)>>0]=m;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function jf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+176|0;n=m+152|0;p=m+16|0;o=m;g=ia(k[(k[a+4>>2]|0)+16>>2]|0,d)|0;j=a+20|0;f=k[j>>2]|0;if(!g){p=f;hf(a,p,c,d,e);r=m;return}while(1){h=Qb[k[(k[b>>2]|0)+32>>2]&63](b,f,g)|0;if(!h)break;f=k[j>>2]|0;if((g|0)==(h|0)){l=26;break}else g=g-h|0}if((l|0)==26){hf(a,f,c,d,e);r=m;return}c=p+56|0;j=p+4|0;k[p>>2]=36160;k[c>>2]=36180;x=0;ra(62,p+56|0,j|0);m=x;x=0;if(m&1){p=Wa()|0;qn(c);fb(p|0)}k[p+128>>2]=0;k[p+132>>2]=-1;k[p>>2]=36200;k[p+56>>2]=36220;x=0;qa(180,j|0);m=x;x=0;do if(m&1)f=Wa()|0;else{k[j>>2]=36236;b=p+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[p+52>>2]=16;k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;x=0;ra(63,j|0,n|0);m=x;x=0;if(m&1){f=Wa()|0;Sm(n);Sm(b);xn(j);break}Sm(n);x=0;f=va(28,p|0,49029,57)|0;n=x;x=0;if(!(n&1)?(x=0,Aa(36,f|0,0)|0,n=x,x=0,!(n&1)):0){h=Va(16)|0;x=0;ra(64,o|0,j|0);n=x;x=0;if(!(n&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,o|0);n=x;x=0;if(n&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(o);if(!g){o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}}else f=Wa()|0;Ua(h|0);o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}o=Wa()|0;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}while(0);p=f;qn(c);fb(p|0)}function kf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0,o=0;j=a+4|0;a=k[j>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){g=i[b+(a*3|0)+1>>0]|0;f=g&255;h=f+128+(l[b+(a*3|0)+2>>0]|0)&255;e=c+(a*3|0)|0;i[e>>0]=(l[b+(a*3|0)>>0]|0)+128+f;i[e+1>>0]=g;i[e+2>>0]=h;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=i[b+(g+e)>>0]|0;o=n&255;m=o+128+(l[b+(g+f)>>0]|0)&255;h=c+(g*3|0)|0;i[h>>0]=(l[b+g>>0]|0)+128+o;i[h+1>>0]=n;i[h+2>>0]=m;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{n=l[b+(g+e)>>0]|0;o=c+(g<<2)|0;n=(l[b+g>>0]|0)+128+n&255|n<<8|l[b+(g+f)>>0]<<24|n+128+(l[b+(g+a)>>0]|0)<<16&16711680;i[o>>0]=n;i[o+1>>0]=n>>8;i[o+2>>0]=n>>16;i[o+3>>0]=n>>24;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[j>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)>0){a=c;f=0}else return;while(1){o=a+2|0;n=i[a>>0]|0;i[a>>0]=i[o>>0]|0;i[o>>0]=n;f=f+1|0;if((f|0)==(d|0))break;else a=a+g|0}return}function lf(a){a=a|0;var b=0,c=0;k[a>>2]=36712;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=k[a+8>>2]|0;if(!c)return;b=a+12|0;if((k[b>>2]|0)!=(c|0))k[b>>2]=c;mj(c);return}function mf(a){a=a|0;var b=0,c=0;k[a>>2]=36712;b=k[a+20>>2]|0;if(b){c=a+24|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}b=k[a+8>>2]|0;if(!b){mj(a);return}c=a+12|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b);mj(a);return}function nf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=a+36|0;if(!(k[e>>2]|0)){e=a+40|0;rf(a,b,k[e>>2]|0,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}f=ia(k[(k[a+4>>2]|0)+16>>2]|0,c)|0;g=a+20|0;rf(a,b,k[g>>2]|0,c,d);a=k[e>>2]|0;if((Qb[k[(k[a>>2]|0)+48>>2]&63](a,k[g>>2]|0,f)|0)==(f|0))return;e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,3,35648);g=x;x=0;if(g&1){g=Wa()|0;Ua(e|0);fb(g|0)}else ub(e|0,824,96)}function of(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=k[a+36>>2]|0;if(!e){e=a+40|0;pf(a,k[e>>2]|0,b,c,d);k[e>>2]=(k[e>>2]|0)+(k[(k[a+4>>2]|0)+12>>2]|0);return}else{qf(a,e,b,c,d);return}}function pf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0;h=a+4|0;f=k[h>>2]|0;if(!(i[f+32>>0]|0))h=b;else{g=a+8|0;vw(k[g>>2]|0,b|0,d*3|0)|0;f=k[h>>2]|0;b=k[f+16>>2]|0;if((d|0)>0){f=k[g>>2]|0;a=0;while(1){j=f+2|0;l=i[f>>0]|0;i[f>>0]=i[j>>0]|0;i[j>>0]=l;a=a+1|0;if((a|0)==(d|0))break;else f=f+b|0}f=k[h>>2]|0}h=k[g>>2]|0}switch(k[f+16>>2]|0){case 3:{if((k[f+24>>2]|0)==2){if((d|0)>0)f=0;else return;do{e=i[h+(f*3|0)+1>>0]|0;j=i[h+(f*3|0)+2>>0]|0;l=c+(f*3|0)|0;i[l>>0]=i[h+(f*3|0)>>0]|0;i[l+1>>0]=e;i[l+2>>0]=j;f=f+1|0}while((f|0)!=(d|0));return}f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=0;do{j=i[h+(b*3|0)+1>>0]|0;l=i[h+(b*3|0)+2>>0]|0;i[c+b>>0]=i[h+(b*3|0)>>0]|0;i[c+(b+e)>>0]=j;i[c+(b+a)>>0]=l;b=b+1|0}while((b|0)!=(f|0));return}case 4:{if((k[f+24>>2]|0)!=1)return;f=(e|0)<(d|0)?e:d;if((f|0)<=0)return;a=e<<1;b=e*3|0;g=0;do{d=i[h+(g<<2)+1>>0]|0;j=i[h+(g<<2)+2>>0]|0;l=i[h+(g<<2)+3>>0]|0;i[c+g>>0]=i[h+(g<<2)>>0]|0;i[c+(g+e)>>0]=d;i[c+(g+a)>>0]=j;i[c+(g+b)>>0]=l;g=g+1|0}while((g|0)!=(f|0));return}default:return}}function qf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+176|0;n=m+152|0;p=m+16|0;o=m;g=ia(k[(k[a+4>>2]|0)+16>>2]|0,d)|0;j=a+20|0;f=k[j>>2]|0;if(!g){p=f;pf(a,p,c,d,e);r=m;return}while(1){h=Qb[k[(k[b>>2]|0)+32>>2]&63](b,f,g)|0;if(!h)break;f=k[j>>2]|0;if((g|0)==(h|0)){l=26;break}else g=g-h|0}if((l|0)==26){pf(a,f,c,d,e);r=m;return}c=p+56|0;j=p+4|0;k[p>>2]=36160;k[c>>2]=36180;x=0;ra(62,p+56|0,j|0);m=x;x=0;if(m&1){p=Wa()|0;qn(c);fb(p|0)}k[p+128>>2]=0;k[p+132>>2]=-1;k[p>>2]=36200;k[p+56>>2]=36220;x=0;qa(180,j|0);m=x;x=0;do if(m&1)f=Wa()|0;else{k[j>>2]=36236;b=p+36|0;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;k[b+12>>2]=0;k[p+52>>2]=16;k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;x=0;ra(63,j|0,n|0);m=x;x=0;if(m&1){f=Wa()|0;Sm(n);Sm(b);xn(j);break}Sm(n);x=0;f=va(28,p|0,49029,57)|0;n=x;x=0;if(!(n&1)?(x=0,Aa(36,f|0,0)|0,n=x,x=0,!(n&1)):0){h=Va(16)|0;x=0;ra(64,o|0,j|0);n=x;x=0;if(!(n&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,h|0,3,35648,o|0);n=x;x=0;if(n&1)g=1;else{x=0;Fa(6,h|0,824,96);x=0;g=0}f=Wa()|0;Sm(o);if(!g){o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}}else f=Wa()|0;Ua(h|0);o=f;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}o=Wa()|0;k[p>>2]=36200;k[c>>2]=36220;k[j>>2]=36236;Sm(b);xn(j);qn(c);fb(o|0)}while(0);p=f;qn(c);fb(p|0)}function rf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0;j=a+4|0;a=k[j>>2]|0;a:do switch(k[a+16>>2]|0){case 3:{if((k[a+24>>2]|0)==2){if((d|0)>0)a=0;else break a;while(1){g=i[b+(a*3|0)+1>>0]|0;h=i[b+(a*3|0)+2>>0]|0;e=c+(a*3|0)|0;i[e>>0]=i[b+(a*3|0)>>0]|0;i[e+1>>0]=g;i[e+2>>0]=h;a=a+1|0;if((a|0)==(d|0))break a}}a=(d|0)<(e|0)?d:e;if((a|0)>0){f=e<<1;g=0;do{n=i[b+(g+e)>>0]|0;m=i[b+(g+f)>>0]|0;h=c+(g*3|0)|0;i[h>>0]=i[b+g>>0]|0;i[h+1>>0]=n;i[h+2>>0]=m;g=g+1|0}while((g|0)!=(a|0))}break}case 4:{if((k[a+24>>2]|0)==1?(h=(d|0)<(e|0)?d:e,(h|0)>0):0){a=e<<1;f=e*3|0;g=0;do{n=c+(g<<2)|0;m=l[b+(g+e)>>0]<<8|l[b+g>>0]|l[b+(g+a)>>0]<<16|l[b+(g+f)>>0]<<24;i[n>>0]=m;i[n+1>>0]=m>>8;i[n+2>>0]=m>>16;i[n+3>>0]=m>>24;g=g+1|0}while((g|0)!=(h|0))}break}default:{}}while(0);a=k[j>>2]|0;if(!(i[a+32>>0]|0))return;g=k[a+16>>2]|0;if((d|0)>0){a=c;f=0}else return;while(1){n=a+2|0;m=i[a>>0]|0;i[a>>0]=i[n>>0]|0;i[n>>0]=m;f=f+1|0;if((f|0)==(d|0))break;else a=a+g|0}return}function sf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;t=r;r=r+32|0;v=t+12|0;s=t;o=a+180|0;p=(k[o>>2]|0)+4|0;if((k[a+32>>2]|0)==1)q=k[a+24>>2]|0;else q=1;b=ia(q<<1,p)|0;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;a:do if(b){if(!(b>>>0>1431655765?(x=0,qa(178,v|0),u=x,x=0,u&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b*3|0)|0,u=x,x=0,!(u&1)):0){k[w>>2]=c;k[v>>2]=c;k[v+8>>2]=c+(b*3|0);while(1){i[c>>0]=0;i[c+1>>0]=0;i[c+2>>0]=0;c=(k[w>>2]|0)+3|0;k[w>>2]=c;b=b+-1|0;if(!b)break a}}d=Wa()|0;b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}while(0);k[s>>2]=0;u=s+4|0;k[u>>2]=0;k[s+8>>2]=0;do if(!q)f=19;else{if(!(q>>>0>1073741823?(x=0,qa(178,s|0),n=x,x=0,n&1):0))f=17;if((f|0)==17?(d=q<<2,x=0,e=ta(67,d|0)|0,n=x,x=0,!(n&1)):0){k[s>>2]=e;f=e+(q<<2)|0;k[s+8>>2]=f;sw(e|0,0,d|0)|0;k[u>>2]=f;f=19;break}d=Wa()|0;b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){e=a+12|0;b:do if((k[e>>2]|0)>0){f=a+4604|0;g=(ia(q,p)|0)+1|0;h=a+4608|0;j=a+92|0;l=(q|0)>0;m=a+4600|0;n=0;c:while(1){d=k[v>>2]|0;b=d+3|0;k[f>>2]=b;c=d+(g*3|0)|0;k[h>>2]=c;if(!(n&1))b=g;else{k[f>>2]=c;k[h>>2]=b;b=1}c=k[j>>2]|0;x=0;Ja(k[(k[c>>2]|0)+12>>2]|0,c|0,d+(b*3|0)|0,k[o>>2]|0,p|0);d=x;x=0;if(d&1){f=29;break}if(l){b=k[s>>2]|0;c=k[f>>2]|0;d=0;do{k[m>>2]=k[b+(d<<2)>>2];y=k[o>>2]|0;b=c+(y*3|0)|0;c=c+((y+-1|0)*3|0)|0;i[b>>0]=i[c>>0]|0;i[b+1>>0]=i[c+1>>0]|0;i[b+2>>0]=i[c+2>>0]|0;b=k[f>>2]|0;c=(k[h>>2]|0)+-3|0;i[c>>0]=i[b>>0]|0;i[c+1>>0]=i[b+1>>0]|0;i[c+2>>0]=i[b+2>>0]|0;x=0;ra(70,a|0,0);c=x;x=0;if(c&1){f=28;break c}b=k[s>>2]|0;k[b+(d<<2)>>2]=k[m>>2];c=(k[f>>2]|0)+(p*3|0)|0;k[f>>2]=c;k[h>>2]=(k[h>>2]|0)+(p*3|0);d=d+1|0}while((d|0)<(q|0))}n=n+1|0;if((n|0)>=(k[e>>2]|0)){f=41;break b}}if((f|0)==28){d=Wa()|0;break}else if((f|0)==29){d=Wa()|0;break}}else f=41;while(0);do if((f|0)==41){x=0;qa(182,a|0);y=x;x=0;if(y&1){d=Wa()|0;break}b=k[s>>2]|0;c=b;if(b){d=k[u>>2]|0;if((d|0)!=(b|0))k[u>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[v>>2]|0;if(!b){r=t;return}c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);r=t;return}while(0);b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}function tf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;A=a+180|0;if((k[A>>2]|0)<=0)return;B=a+4608|0;C=a+4604|0;D=a+4612|0;z=0;while(1){w=z+-1|0;f=k[B>>2]|0;g=k[C>>2]|0;b=z+1|0;e=l[g+(z*3|0)>>0]|0;y=k[D>>2]|0;h=l[g+(w*3|0)>>0]|0;j=e-h|0;m=l[f+(w*3|0)>>0]|0;n=h-m|0;o=((((i[y+((l[g+(b*3|0)>>0]|0)-e)>>0]|0)*9|0)+(i[y+j>>0]|0)|0)*9|0)+(i[y+n>>0]|0)|0;d=l[g+(z*3|0)+1>>0]|0;p=l[g+(w*3|0)+1>>0]|0;q=d-p|0;r=l[f+(w*3|0)+1>>0]|0;s=p-r|0;t=((((i[y+((l[g+(b*3|0)+1>>0]|0)-d)>>0]|0)*9|0)+(i[y+q>>0]|0)|0)*9|0)+(i[y+s>>0]|0)|0;c=l[g+(z*3|0)+2>>0]|0;u=l[g+(w*3|0)+2>>0]|0;v=c-u|0;w=l[f+(w*3|0)+2>>0]|0;x=u-w|0;y=((((i[y+((l[g+(b*3|0)+2>>0]|0)-c)>>0]|0)*9|0)+(i[y+v>>0]|0)|0)*9|0)+(i[y+x>>0]|0)|0;if(!(t|o|y))b=(uf(a,z,0)|0)+z|0;else{g=l[f+(z*3|0)>>0]|0;f=e-m>>31;if((f^n|0)>=0)if((f^j|0)<0)e=m;else e=m-h+e|0;g=vf(a,o,g,e,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+1>>0]|0;e=d-r>>31;if((e^s|0)>=0)if((e^q|0)<0)d=r;else d=r-p+d|0;e=vf(a,t,f,d,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+2>>0]|0;d=c-w>>31;if((d^x|0)>=0)if((d^v|0)<0)c=w;else c=w-u+c|0;y=vf(a,y,f,c,0)|0;z=(k[B>>2]|0)+(z*3|0)|0;i[z>>0]=g;i[z+1>>0]=e;i[z+2>>0]=y}if((b|0)<(k[A>>2]|0))z=b;else break}return}function uf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;B=r;r=r+32|0;A=B+15|0;p=B+12|0;o=B+9|0;q=B+6|0;w=B+3|0;x=B;y=(k[a+180>>2]|0)-b|0;z=k[a+4608>>2]|0;s=k[a+4604>>2]|0;v=z+((b+-1|0)*3|0)|0;t=i[v>>0]|0;u=i[v+1>>0]|0;v=i[v+2>>0]|0;c=t&255;d=a+144|0;e=u&255;f=v&255;n=0;while(1){g=z+((n+b|0)*3|0)|0;h=g+1|0;j=g+2|0;C=(l[g>>0]|0)-c|0;m=k[d>>2]|0;if((((C|0)>-1?C:0-C|0)|0)>(m|0))break;C=(l[h>>0]|0)-e|0;if((((C|0)>-1?C:0-C|0)|0)>(m|0))break;C=(l[j>>0]|0)-f|0;if((((C|0)>-1?C:0-C|0)|0)>(m|0))break;i[g>>0]=t;i[h>>0]=u;i[j>>0]=v;n=n+1|0;if((n|0)==(y|0)){n=y;break}}e=(n|0)==(y|0);f=a+4600|0;d=k[36476+(k[f>>2]<<2)>>2]|0;if((1<(n|0))c=n;else{c=n;do{ke(a,1,1);d=k[f>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[f>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>0]=i[C>>0]|0;i[w+1>>0]=i[C+1>>0]|0;i[w+2>>0]=i[C+2>>0]|0;i[x>>0]=t;i[x+1>>0]=u;i[x+2>>0]=v;b=s+(b*3|0)|0;i[o>>0]=i[w>>0]|0;i[o+1>>0]=i[w+1>>0]|0;i[o+2>>0]=i[w+2>>0]|0;i[p>>0]=i[x>>0]|0;i[p+1>>0]=i[x+1>>0]|0;i[p+2>>0]=i[x+2>>0]|0;i[A>>0]=i[b>>0]|0;i[A+1>>0]=i[b+1>>0]|0;i[A+2>>0]=i[b+2>>0]|0;xf(q,a,o,p,A);i[C>>0]=i[q>>0]|0;i[C+1>>0]=i[q+1>>0]|0;i[C+2>>0]=i[q+2>>0]|0;C=k[f>>2]|0;k[f>>2]=(C|0)<1?0:C+-1|0;C=n+1|0;r=B;return C|0}if(!c){C=y;r=B;return C|0}ke(a,1,1);C=y;r=B;return C|0}function vf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;f=(r^b)-r|0;p=a+196+(f*12|0)+10|0;g=j[p>>1]|0;o=a+196+(f*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){b=5;while(1)if((g<>1]^r)-r+d|0;q=a+136|0;d=k[q>>2]|0;if((e&d|0)==(e|0))l=e;else l=d&~(e>>31);e=(c-l^r)-r|0;i=a+144|0;d=k[i>>2]|0;if((e|0)>0)e=(e+d|0)/(d<<1|1|0)|0;else e=(e-d|0)/(d<<1|1|0)|0;n=a+140|0;h=k[n>>2]|0;c=((e|0)<0?h:0)+e|0;h=c-((c|0)<((h+1|0)/2|0|0)?0:h)|0;f=a+196+(f*12|0)+4|0;if(!(d|b))e=(k[f>>2]<<1)+-1+g>>31;else e=0;d=e^h;wf(a,b,d>>30^d<<1,k[a+156>>2]|0);d=k[a+160>>2]|0;b=(k[o>>2]|0)+((h|0)>-1?h:0-h|0)|0;e=(k[f>>2]|0)+(ia(k[i>>2]<<1|1,h)|0)|0;c=j[p>>1]|0;if((c|0)==(d|0)){b=b>>1;e=e>>1;c=d>>1}k[o>>2]=b;d=c+1|0;j[p>>1]=d;b=d+e|0;if((b|0)>=1){if((e|0)>0){e=e-d|0;p=j[m>>1]|0;j[m>>1]=(p<<16>>16<127&1)+(p&65535);e=(e|0)>0?0:e}}else{e=j[m>>1]|0;j[m>>1]=(e&65535)-(e<<16>>16>-128&1);e=(b|0)>(~c|0)?b:0-c|0}k[f>>2]=e;d=k[i>>2]|0;c=d<<1|1;b=(ia(c,(h^r)-r|0)|0)+l|0;if((b|0)>=(0-d|0)){e=k[q>>2]|0;if((e+d|0)<(b|0))b=b-(ia(k[n>>2]|0,c)|0)|0}else{b=(ia(k[n>>2]|0,c)|0)+b|0;e=k[q>>2]|0}if((b&e|0)==(b|0)){r=b;r=r&255;return r|0}r=e&~(b>>31);r=r&255;return r|0}function wf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=c>>b;f=a+148|0;g=d-(k[f>>2]|0)|0;if((e|0)<(g+-1|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-31-(k[f>>2]|0)|0)}else ke(a,1,g);b=k[f>>2]|0;ke(a,(1<>0]|0;p=o-(l[d>>0]|0)>>31|1;f=ia(p,(l[c>>0]|0)-o|0)|0;m=b+144|0;g=k[m>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;w=b+140|0;j=k[w>>2]|0;h=((f|0)<0?j:0)+f|0;j=h-((h|0)<((j+1|0)/2|0|0)?0:j)|0;h=b+4576|0;yf(b,h,j);t=l[e+1>>0]|0;u=t-(l[d+1>>0]|0)>>31|1;f=ia(u,(l[c+1>>0]|0)-t|0)|0;g=k[m>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;q=k[w>>2]|0;v=((f|0)<0?q:0)+f|0;q=v-((v|0)<((q+1|0)/2|0|0)?0:q)|0;yf(b,h,q);v=l[e+2>>0]|0;s=v-(l[d+2>>0]|0)>>31|1;f=ia(s,(l[c+2>>0]|0)-v|0)|0;g=k[m>>2]|0;if((f|0)>0)f=(f+g|0)/(g<<1|1|0)|0;else f=(f-g|0)/(g<<1|1|0)|0;n=k[w>>2]|0;f=((f|0)<0?n:0)+f|0;n=f-((f|0)<((n+1|0)/2|0|0)?0:n)|0;yf(b,h,n);h=k[m>>2]|0;m=h<<1|1;f=(ia(ia(m,j)|0,p)|0)+o|0;c=0-h|0;if((f|0)>=(c|0)){g=k[r>>2]|0;if((g+h|0)<(f|0)){f=f-(ia(k[w>>2]|0,m)|0)|0;d=g}else d=g}else{f=(ia(k[w>>2]|0,m)|0)+f|0;d=k[r>>2]|0}if((f&d|0)!=(f|0))f=d&~(f>>31);e=f&255;f=(ia(ia(m,q)|0,u)|0)+t|0;if((f|0)>=(c|0)){if((d+h|0)<(f|0))f=f-(ia(k[w>>2]|0,m)|0)|0}else f=(ia(k[w>>2]|0,m)|0)+f|0;if((f&d|0)!=(f|0))f=d&~(f>>31);g=f&255;f=(ia(ia(m,n)|0,s)|0)+v|0;if((f|0)>=(c|0)){if((d+h|0)<(f|0))f=f-(ia(k[w>>2]|0,m)|0)|0}else f=(ia(k[w>>2]|0,m)|0)+f|0;if((f&d|0)==(f|0)){w=f;w=w&255;i[a>>0]=e;v=a+1|0;i[v>>0]=g;a=a+2|0;i[a>>0]=w;return}w=d&~(f>>31);w=w&255;i[a>>0]=e;v=a+1|0;i[v>>0]=g;a=a+2|0;i[a>>0]=w;return}function yf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;wf(a,e,d,(k[a+156>>2]|0)+-1-(k[36476+(k[a+4600>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function zf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+144|0;a:do if(!(k[n>>2]|0)){c=k[a+136>>2]|0;b=a+152|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+184>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+188>>2]|0):0)?(k[d+12>>2]|0)==(k[a+192>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4612>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4612>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4612>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4612>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+152|0;while(0);m=1<>2];c=a+4616|0;d=m<<1;e=a+4620|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4612|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+192|0;j=a+188|0;g=a+184|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function Af(a){a=a|0;var b=0,c=0;k[a>>2]=35996;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Bf(a){a=a|0;var b=0,c=0;k[a>>2]=35996;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Cf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,65535,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+160>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+164>>2]=f;k[a+168>>2]=d;Lf(a);d=0;do{k[a+172+(d*12|0)>>2]=1024;k[a+172+(d*12|0)+4>>2]=0;j[a+172+(d*12|0)+8>>1]=0;j[a+172+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4552>>2]=1024;k[a+4556>>2]=0;i[a+4560>>0]=h;i[a+4561>>0]=1;i[a+4562>>0]=0;k[a+4564>>2]=1024;k[a+4568>>2]=1;i[a+4572>>0]=h;i[a+4573>>0]=1;i[a+4574>>0]=0;k[a+4576>>2]=0;r=e;return}function Df(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4600)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35772;e=b+132|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+148>>2]=k[d>>2];k[b+152>>2]=0;k[b+156>>2]=0;k[b+160>>2]=0;e=b+4544|0;d=b+164|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4556|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4568|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];Ff(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;Ff(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function Ef(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Ff(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;u=r;r=r+32|0;w=u+12|0;t=u;p=a+156|0;q=(k[p>>2]|0)+4|0;if((k[a+32>>2]|0)==1)s=k[a+24>>2]|0;else s=1;b=ia(s<<1,q)|0;k[w>>2]=0;y=w+4|0;k[y>>2]=0;k[w+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,w|0),v=x,x=0,v&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,v=x,x=0,!(v&1)):0){k[w>>2]=d;v=d+(b<<1)|0;k[w+8>>2]=v;sw(d|0,0,c|0)|0;k[y>>2]=v;break}d=Wa()|0;b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[t>>2]=0;v=t+4|0;k[v>>2]=0;k[t+8>>2]=0;do if(!s)g=18;else{if(!(s>>>0>1073741823?(x=0,qa(178,t|0),o=x,x=0,o&1):0))g=16;if((g|0)==16?(e=s<<2,x=0,f=ta(67,e|0)|0,o=x,x=0,!(o&1)):0){k[t>>2]=f;g=f+(s<<2)|0;k[t+8>>2]=g;sw(f|0,0,e|0)|0;k[v>>2]=g;g=18;break}d=Wa()|0;b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+12|0;a:do if((k[f>>2]|0)>0){g=a+4580|0;h=(ia(s,q)|0)+1|0;i=a+4584|0;l=a+92|0;m=(s|0)>0;n=a+4576|0;o=0;b:while(1){c=k[w>>2]|0;b=c+2|0;k[g>>2]=b;c=c+(h<<1)|0;k[i>>2]=c;if(!(o&1))b=c;else{k[g>>2]=c;k[i>>2]=b}e=k[l>>2]|0;x=0;Ja(k[(k[e>>2]|0)+12>>2]|0,e|0,b|0,k[p>>2]|0,q|0);e=x;x=0;if(e&1){g=28;break}if(m){b=k[g>>2]|0;c=k[i>>2]|0;d=k[t>>2]|0;e=0;do{k[n>>2]=k[d+(e<<2)>>2];d=k[p>>2]|0;j[b+(d<<1)>>1]=j[b+(d+-1<<1)>>1]|0;j[c+-2>>1]=j[b>>1]|0;x=0;ra(71,a|0,0);d=x;x=0;if(d&1){g=27;break b}d=k[t>>2]|0;k[d+(e<<2)>>2]=k[n>>2];b=(k[g>>2]|0)+(q<<1)|0;k[g>>2]=b;c=(k[i>>2]|0)+(q<<1)|0;k[i>>2]=c;e=e+1|0}while((e|0)<(s|0))}o=o+1|0;if((o|0)>=(k[f>>2]|0)){g=40;break a}}if((g|0)==27){d=Wa()|0;break}else if((g|0)==28){d=Wa()|0;break}}else g=40;while(0);do if((g|0)==40){x=0;qa(182,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[t>>2]|0;c=b;if(b){d=k[v>>2]|0;if((d|0)!=(b|0))k[v>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[w>>2]|0;if(!b){r=u;return}c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=u;return}while(0);b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function Gf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;p=a+4580|0;b=k[p>>2]|0;s=a+156|0;if((k[s>>2]|0)<=0)return;q=a+4584|0;r=a+4588|0;e=b;f=m[b+-2>>1]|0;b=m[b>>1]|0;o=0;while(1){n=k[q>>2]|0;l=m[n+(o+-1<<1)>>1]|0;d=o+1|0;c=m[e+(d<<1)>>1]|0;h=k[r>>2]|0;g=b-f|0;e=f-l|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(If(a,o,0)|0)+o|0;c=k[p>>2]|0;b=m[c+(d+-1<<1)>>1]|0;c=m[c+(d<<1)>>1]|0}else{f=b-l>>31;if((f^e|0)<0)e=b;else e=l+((f^g|0)<0?0:g)|0;n=Hf(a,h,m[n+(o<<1)>>1]|0,e,0)|0;j[(k[q>>2]|0)+(o<<1)>>1]=n}if((d|0)>=(k[s>>2]|0))break;e=k[p>>2]|0;f=b;b=c;o=d}return}function Hf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;i=(q^b)-q|0;p=a+172+(i*12|0)+10|0;g=j[p>>1]|0;o=a+172+(i*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){f=5;while(1)if((g<>1]^q)-q+d|0;if((e&65535|0)==(e|0))m=e;else m=e>>31&65535^65535;h=(c-m^q)-q<<16;l=h>>16;if(!f)e=(k[a+172+(i*12|0)+4>>2]<<1)+-1+g>>31;else e=0;d=e^l;d=d>>30^d<<1;e=d>>f;if((e|0)<47){if((e|0)>30){g=(e|0)/2|0;ke(a,0,g);e=e-g|0}ke(a,1,e+1|0);ke(a,d&(1<>1]|0;e=g<<16>>16==64;f=e&1;c=(k[d>>2]|0)+l>>f;g=e?32:g<<16>>16;k[o>>2]=(k[o>>2]|0)+((h|0)>-65536?l:0-l|0)>>f;f=g+1|0;j[p>>1]=f;e=f+c|0;if((e|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(e|0)>(~g|0)?e:0-g|0;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&65535;return b|0}if((c|0)<=0){p=c;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&65535;return b|0}p=c-f|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&65535;return b|0}function If(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,l=0,n=0;g=(k[a+156>>2]|0)-b|0;h=k[a+4584>>2]|0;l=k[a+4580>>2]|0;e=j[h+(b+-1<<1)>>1]|0;d=0;while(1){c=h+(d+b<<1)|0;if((j[c>>1]|0)!=e<<16>>16){n=d;break}j[c>>1]=e;d=d+1|0;if((d|0)==(g|0)){n=g;break}}f=e&65535;e=(n|0)==(g|0);i=a+4576|0;d=k[36476+(k[i>>2]<<2)>>2]|0;if((1<(n|0))c=n;else{c=n;do{ke(a,1,1);d=k[i>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[i>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>1]|0;c=m[l+(c<<1)>>1]|0;l=f-c|0;if((((l|0)>-1?l:0-l|0)|0)<1){c=d-f<<16>>16;Jf(a,a+4564|0,c);c=c+f|0}else{l=c-f>>31|1;b=(ia(d-c<<16,l)|0)>>16;Jf(a,a+4552|0,b);c=(ia(b,l)|0)+c|0}j[e>>1]=c;a=k[i>>2]|0;k[i>>2]=(a|0)<1?0:a+-1|0;a=n+1|0;return a|0}function Jf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;Kf(a,e,d,63-(k[36476+(k[a+4576>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function Kf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=c>>b;f=d+-16|0;if((e|0)<(d+-17|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-47|0)}else ke(a,1,f);ke(a,c+65535&65535,16);return}function Lf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,65535,0);j=a+160|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+164>>2]|0):0)?(k[h+12>>2]|0)==(k[a+168>>2]|0):0){j=k[8909]|0;k[a+4588>>2]=j+(((k[8910]|0)-j|0)>>>1);r=l;return}c=a+4592|0;d=a+4596|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=131072){if(f>>>0>131072?(g=b+131072|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,131072-f|0);b=k[c>>2]|0}h=a+4588|0;k[h>>2]=b+65536;g=a+168|0;e=a+164|0;f=-65536;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==65536)break}r=l;return}function Mf(a){a=a|0;var b=0,c=0;k[a>>2]=35968;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Nf(a){a=a|0;var b=0,c=0;k[a>>2]=35968;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Of(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,4095,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+160>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+164>>2]=f;k[a+168>>2]=d;Xf(a);d=0;do{k[a+172+(d*12|0)>>2]=64;k[a+172+(d*12|0)+4>>2]=0;j[a+172+(d*12|0)+8>>1]=0;j[a+172+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4552>>2]=64;k[a+4556>>2]=0;i[a+4560>>0]=h;i[a+4561>>0]=1;i[a+4562>>0]=0;k[a+4564>>2]=64;k[a+4568>>2]=1;i[a+4572>>0]=h;i[a+4573>>0]=1;i[a+4574>>0]=0;k[a+4576>>2]=0;r=e;return}function Pf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4600)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35744;e=b+132|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+148>>2]=k[d>>2];k[b+152>>2]=0;k[b+156>>2]=0;k[b+160>>2]=0;e=b+4544|0;d=b+164|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4556|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4568|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];Rf(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;Rf(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function Qf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Rf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;u=r;r=r+32|0;w=u+12|0;t=u;p=a+156|0;q=(k[p>>2]|0)+4|0;if((k[a+32>>2]|0)==1)s=k[a+24>>2]|0;else s=1;b=ia(s<<1,q)|0;k[w>>2]=0;y=w+4|0;k[y>>2]=0;k[w+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,w|0),v=x,x=0,v&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,v=x,x=0,!(v&1)):0){k[w>>2]=d;v=d+(b<<1)|0;k[w+8>>2]=v;sw(d|0,0,c|0)|0;k[y>>2]=v;break}d=Wa()|0;b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[t>>2]=0;v=t+4|0;k[v>>2]=0;k[t+8>>2]=0;do if(!s)g=18;else{if(!(s>>>0>1073741823?(x=0,qa(178,t|0),o=x,x=0,o&1):0))g=16;if((g|0)==16?(e=s<<2,x=0,f=ta(67,e|0)|0,o=x,x=0,!(o&1)):0){k[t>>2]=f;g=f+(s<<2)|0;k[t+8>>2]=g;sw(f|0,0,e|0)|0;k[v>>2]=g;g=18;break}d=Wa()|0;b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+12|0;a:do if((k[f>>2]|0)>0){g=a+4580|0;h=(ia(s,q)|0)+1|0;i=a+4584|0;l=a+92|0;m=(s|0)>0;n=a+4576|0;o=0;b:while(1){c=k[w>>2]|0;b=c+2|0;k[g>>2]=b;c=c+(h<<1)|0;k[i>>2]=c;if(!(o&1))b=c;else{k[g>>2]=c;k[i>>2]=b}e=k[l>>2]|0;x=0;Ja(k[(k[e>>2]|0)+12>>2]|0,e|0,b|0,k[p>>2]|0,q|0);e=x;x=0;if(e&1){g=28;break}if(m){b=k[g>>2]|0;c=k[i>>2]|0;d=k[t>>2]|0;e=0;do{k[n>>2]=k[d+(e<<2)>>2];d=k[p>>2]|0;j[b+(d<<1)>>1]=j[b+(d+-1<<1)>>1]|0;j[c+-2>>1]=j[b>>1]|0;x=0;ra(72,a|0,0);d=x;x=0;if(d&1){g=27;break b}d=k[t>>2]|0;k[d+(e<<2)>>2]=k[n>>2];b=(k[g>>2]|0)+(q<<1)|0;k[g>>2]=b;c=(k[i>>2]|0)+(q<<1)|0;k[i>>2]=c;e=e+1|0}while((e|0)<(s|0))}o=o+1|0;if((o|0)>=(k[f>>2]|0)){g=40;break a}}if((g|0)==27){d=Wa()|0;break}else if((g|0)==28){d=Wa()|0;break}}else g=40;while(0);do if((g|0)==40){x=0;qa(182,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[t>>2]|0;c=b;if(b){d=k[v>>2]|0;if((d|0)!=(b|0))k[v>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[w>>2]|0;if(!b){r=u;return}c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=u;return}while(0);b=k[t>>2]|0;c=b;if(b){e=k[v>>2]|0;if((e|0)!=(b|0))k[v>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[w>>2]|0;if(!b)fb(d|0);c=k[y>>2]|0;if((c|0)!=(b|0))k[y>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function Sf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;p=a+4580|0;b=k[p>>2]|0;s=a+156|0;if((k[s>>2]|0)<=0)return;q=a+4584|0;r=a+4588|0;e=b;f=m[b+-2>>1]|0;b=m[b>>1]|0;o=0;while(1){n=k[q>>2]|0;l=m[n+(o+-1<<1)>>1]|0;d=o+1|0;c=m[e+(d<<1)>>1]|0;h=k[r>>2]|0;g=b-f|0;e=f-l|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(Uf(a,o,0)|0)+o|0;c=k[p>>2]|0;b=m[c+(d+-1<<1)>>1]|0;c=m[c+(d<<1)>>1]|0}else{f=b-l>>31;if((f^e|0)<0)e=b;else e=l+((f^g|0)<0?0:g)|0;n=Tf(a,h,m[n+(o<<1)>>1]|0,e,0)|0;j[(k[q>>2]|0)+(o<<1)>>1]=n}if((d|0)>=(k[s>>2]|0))break;e=k[p>>2]|0;f=b;b=c;o=d}return}function Tf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;i=(q^b)-q|0;p=a+172+(i*12|0)+10|0;g=j[p>>1]|0;o=a+172+(i*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){f=5;while(1)if((g<>1]^q)-q+d|0;if((e&4095|0)==(e|0))m=e;else m=e>>31&4095^4095;h=(c-m^q)-q<<20;l=h>>20;if(!f)e=(k[a+172+(i*12|0)+4>>2]<<1)+-1+g>>31;else e=0;d=e^l;d=d>>30^d<<1;e=d>>f;if((e|0)<35){if((e|0)>30){g=(e|0)/2|0;ke(a,0,g);e=e-g|0}ke(a,1,e+1|0);ke(a,d&(1<>1]|0;e=g<<16>>16==64;f=e&1;c=(k[d>>2]|0)+l>>f;g=e?32:g<<16>>16;k[o>>2]=(k[o>>2]|0)+((h|0)>-1048576?l:0-l|0)>>f;f=g+1|0;j[p>>1]=f;e=f+c|0;if((e|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(e|0)>(~g|0)?e:0-g|0;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}if((c|0)<=0){p=c;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}p=c-f|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}function Uf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,l=0,n=0;g=(k[a+156>>2]|0)-b|0;h=k[a+4584>>2]|0;l=k[a+4580>>2]|0;e=j[h+(b+-1<<1)>>1]|0;d=0;while(1){c=h+(d+b<<1)|0;if((j[c>>1]|0)!=e<<16>>16){n=d;break}j[c>>1]=e;d=d+1|0;if((d|0)==(g|0)){n=g;break}}f=e&65535;e=(n|0)==(g|0);i=a+4576|0;d=k[36476+(k[i>>2]<<2)>>2]|0;if((1<(n|0))c=n;else{c=n;do{ke(a,1,1);d=k[i>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[i>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>1]|0;c=m[l+(c<<1)>>1]|0;l=f-c|0;if((((l|0)>-1?l:0-l|0)|0)<1){c=d-f<<20>>20;Vf(a,a+4564|0,c);c=c+f|0}else{l=c-f>>31|1;b=(ia(d-c<<20,l)|0)>>20;Vf(a,a+4552|0,b);c=(ia(b,l)|0)+c|0}j[e>>1]=c&4095;a=k[i>>2]|0;k[i>>2]=(a|0)<1?0:a+-1|0;a=n+1|0;return a|0}function Vf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;Wf(a,e,d,47-(k[36476+(k[a+4576>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function Wf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=c>>b;f=d+-12|0;if((e|0)<(d+-13|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-43|0)}else ke(a,1,f);ke(a,c+4095&4095,12);return}function Xf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,4095,0);j=a+160|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+164>>2]|0):0)?(k[h+12>>2]|0)==(k[a+168>>2]|0):0){j=k[8906]|0;k[a+4588>>2]=j+(((k[8907]|0)-j|0)>>>1);r=l;return}c=a+4592|0;d=a+4596|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=8192){if(f>>>0>8192?(g=b+8192|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,8192-f|0);b=k[c>>2]|0}h=a+4588|0;k[h>>2]=b+4096;g=a+168|0;e=a+164|0;f=-4096;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==4096)break}r=l;return}function Yf(a){a=a|0;var b=0,c=0;k[a>>2]=35940;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Zf(a){a=a|0;var b=0,c=0;k[a>>2]=35940;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function _f(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,255,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+160>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+164>>2]=f;k[a+168>>2]=d;hg(a);d=0;do{k[a+172+(d*12|0)>>2]=4;k[a+172+(d*12|0)+4>>2]=0;j[a+172+(d*12|0)+8>>1]=0;j[a+172+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4552>>2]=4;k[a+4556>>2]=0;i[a+4560>>0]=h;i[a+4561>>0]=1;i[a+4562>>0]=0;k[a+4564>>2]=4;k[a+4568>>2]=1;i[a+4572>>0]=h;i[a+4573>>0]=1;i[a+4574>>0]=0;k[a+4576>>2]=0;r=e;return}function $f(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4600)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35716;e=b+132|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+148>>2]=k[d>>2];k[b+152>>2]=0;k[b+156>>2]=0;k[b+160>>2]=0;e=b+4544|0;d=b+164|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4556|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4568|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];bg(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;bg(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function ag(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function bg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;t=r;r=r+32|0;v=t+12|0;s=t;o=a+156|0;p=(k[o>>2]|0)+4|0;if((k[a+32>>2]|0)==1)q=k[a+24>>2]|0;else q=1;b=ia(q<<1,p)|0;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;a:do if(b){if(!((b|0)<0?(x=0,qa(178,v|0),u=x,x=0,u&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b|0)|0,u=x,x=0,!(u&1)):0){k[w>>2]=c;k[v>>2]=c;k[v+8>>2]=c+b;while(1){i[c>>0]=0;c=(k[w>>2]|0)+1|0;k[w>>2]=c;b=b+-1|0;if(!b)break a}}c=Wa()|0;b=k[v>>2]|0;if(!b)fb(c|0);if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);fb(c|0)}while(0);k[s>>2]=0;u=s+4|0;k[u>>2]=0;k[s+8>>2]=0;do if(!q)f=19;else{if(!(q>>>0>1073741823?(x=0,qa(178,s|0),n=x,x=0,n&1):0))f=17;if((f|0)==17?(d=q<<2,x=0,e=ta(67,d|0)|0,n=x,x=0,!(n&1)):0){k[s>>2]=e;f=e+(q<<2)|0;k[s+8>>2]=f;sw(e|0,0,d|0)|0;k[u>>2]=f;f=19;break}c=Wa()|0;b=k[s>>2]|0;d=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){e=a+12|0;b:do if((k[e>>2]|0)>0){f=a+4580|0;g=(ia(q,p)|0)+1|0;h=a+4584|0;j=a+92|0;l=(q|0)>0;m=a+4576|0;n=0;c:while(1){c=k[v>>2]|0;b=c+1|0;k[f>>2]=b;c=c+g|0;k[h>>2]=c;if(!(n&1))b=c;else{k[f>>2]=c;k[h>>2]=b}d=k[j>>2]|0;x=0;Ja(k[(k[d>>2]|0)+12>>2]|0,d|0,b|0,k[o>>2]|0,p|0);d=x;x=0;if(d&1){f=29;break}if(l){b=k[f>>2]|0;c=k[s>>2]|0;d=0;do{k[m>>2]=k[c+(d<<2)>>2];c=k[o>>2]|0;i[b+c>>0]=i[b+(c+-1)>>0]|0;i[(k[h>>2]|0)+-1>>0]=i[k[f>>2]>>0]|0;x=0;ra(73,a|0,0);c=x;x=0;if(c&1){f=28;break c}c=k[s>>2]|0;k[c+(d<<2)>>2]=k[m>>2];b=(k[f>>2]|0)+p|0;k[f>>2]=b;k[h>>2]=(k[h>>2]|0)+p;d=d+1|0}while((d|0)<(q|0))}n=n+1|0;if((n|0)>=(k[e>>2]|0)){f=41;break b}}if((f|0)==28){c=Wa()|0;break}else if((f|0)==29){c=Wa()|0;break}}else f=41;while(0);do if((f|0)==41){x=0;qa(182,a|0);a=x;x=0;if(a&1){c=Wa()|0;break}b=k[s>>2]|0;c=b;if(b){d=k[u>>2]|0;if((d|0)!=(b|0))k[u>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[v>>2]|0;if(!b){r=t;return}if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);r=t;return}while(0);b=k[s>>2]|0;d=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}b=k[v>>2]|0;if(!b)fb(c|0);if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);fb(c|0)}function cg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0;o=a+4580|0;b=k[o>>2]|0;r=a+156|0;if((k[r>>2]|0)<=0)return;p=a+4584|0;q=a+4588|0;e=b;f=l[b+-1>>0]|0;b=l[b>>0]|0;n=0;while(1){m=k[p>>2]|0;j=l[m+(n+-1)>>0]|0;d=n+1|0;c=l[e+d>>0]|0;h=k[q>>2]|0;g=b-f|0;e=f-j|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(eg(a,n,0)|0)+n|0;c=k[o>>2]|0;b=l[c+(d+-1)>>0]|0;c=l[c+d>>0]|0}else{f=b-j>>31;if((f^e|0)<0)e=b;else e=j+((f^g|0)<0?0:g)|0;m=dg(a,h,l[m+n>>0]|0,e,0)|0;i[(k[p>>2]|0)+n>>0]=m}if((d|0)>=(k[r>>2]|0))break;e=k[o>>2]|0;f=b;b=c;n=d}return}function dg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;i=(q^b)-q|0;p=a+172+(i*12|0)+10|0;g=j[p>>1]|0;o=a+172+(i*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){f=5;while(1)if((g<>1]^q)-q+d|0;if((e&255|0)==(e|0))m=e;else m=e>>31&255^255;h=(c-m^q)-q<<24;l=h>>24;if(!f)e=(k[a+172+(i*12|0)+4>>2]<<1)+-1+g>>31;else e=0;e=e^l;e=e>>30^e<<1;d=e>>f;if((d|0)<23){ke(a,1,d+1|0);ke(a,e&(1<>1]|0;e=g<<16>>16==64;f=e&1;c=(k[d>>2]|0)+l>>f;g=e?32:g<<16>>16;k[o>>2]=(k[o>>2]|0)+((h|0)>-16777216?l:0-l|0)>>f;f=g+1|0;j[p>>1]=f;e=f+c|0;if((e|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(e|0)>(~g|0)?e:0-g|0;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}if((c|0)<=0){p=c;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}p=c-f|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}function eg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;g=(k[a+156>>2]|0)-b|0;h=k[a+4584>>2]|0;m=k[a+4580>>2]|0;e=i[h+(b+-1)>>0]|0;d=0;while(1){c=h+(d+b)|0;if((i[c>>0]|0)!=e<<24>>24){n=d;break}i[c>>0]=e;d=d+1|0;if((d|0)==(g|0)){n=g;break}}f=e&255;e=(n|0)==(g|0);j=a+4576|0;d=k[36476+(k[j>>2]<<2)>>2]|0;if((1<(n|0))c=n;else{c=n;do{ke(a,1,1);d=k[j>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[j>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>0]|0;c=l[m+c>>0]|0;m=f-c|0;if((((m|0)>-1?m:0-m|0)|0)<1){c=d-f<<24>>24;fg(a,a+4564|0,c);c=c+f|0}else{m=c-f>>31|1;b=(ia(d-c<<24,m)|0)>>24;fg(a,a+4552|0,b);c=(ia(b,m)|0)+c|0}i[e>>0]=c;a=k[j>>2]|0;k[j>>2]=(a|0)<1?0:a+-1|0;a=n+1|0;return a|0}function fg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;gg(a,e,d,31-(k[36476+(k[a+4576>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function gg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=c>>b;f=d+-8|0;if((e|0)<(d+-9|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-39|0)}else ke(a,1,f);ke(a,c+255&255,8);return}function hg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,255,0);j=a+160|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+164>>2]|0):0)?(k[h+12>>2]|0)==(k[a+168>>2]|0):0){j=k[8900]|0;k[a+4588>>2]=j+(((k[8901]|0)-j|0)>>>1);r=l;return}c=a+4592|0;d=a+4596|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=512){if(f>>>0>512?(g=b+512|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,512-f|0);b=k[c>>2]|0}h=a+4588|0;k[h>>2]=b+256;g=a+168|0;e=a+164|0;f=-256;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==256)break}r=l;return}function ig(a){a=a|0;var b=0,c=0;k[a>>2]=35912;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function jg(a){a=a|0;var b=0,c=0;k[a>>2]=35912;b=k[a+4592>>2]|0;if(b){c=a+4596|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function kg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,255,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+160>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+164>>2]=f;k[a+168>>2]=d;tg(a);d=0;do{k[a+172+(d*12|0)>>2]=4;k[a+172+(d*12|0)+4>>2]=0;j[a+172+(d*12|0)+8>>1]=0;j[a+172+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4552>>2]=4;k[a+4556>>2]=0;i[a+4560>>0]=h;i[a+4561>>0]=1;i[a+4562>>0]=0;k[a+4564>>2]=4;k[a+4568>>2]=1;i[a+4572>>0]=h;i[a+4573>>0]=1;i[a+4574>>0]=0;k[a+4576>>2]=0;r=e;return}function lg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4600)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35688;e=b+132|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+148>>2]=k[d>>2];k[b+152>>2]=0;k[b+156>>2]=0;k[b+160>>2]=0;e=b+4544|0;d=b+164|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4556|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4568|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];ng(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;ng(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}function mg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function ng(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;t=r;r=r+32|0;v=t+12|0;s=t;o=a+156|0;p=(k[o>>2]|0)+4|0;if((k[a+32>>2]|0)==1)q=k[a+24>>2]|0;else q=1;b=ia(q<<1,p)|0;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;a:do if(b){if(!(b>>>0>1431655765?(x=0,qa(178,v|0),u=x,x=0,u&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b*3|0)|0,u=x,x=0,!(u&1)):0){k[w>>2]=c;k[v>>2]=c;k[v+8>>2]=c+(b*3|0);while(1){i[c>>0]=0;i[c+1>>0]=0;i[c+2>>0]=0;c=(k[w>>2]|0)+3|0;k[w>>2]=c;b=b+-1|0;if(!b)break a}}d=Wa()|0;b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}while(0);k[s>>2]=0;u=s+4|0;k[u>>2]=0;k[s+8>>2]=0;do if(!q)f=19;else{if(!(q>>>0>1073741823?(x=0,qa(178,s|0),n=x,x=0,n&1):0))f=17;if((f|0)==17?(d=q<<2,x=0,e=ta(67,d|0)|0,n=x,x=0,!(n&1)):0){k[s>>2]=e;f=e+(q<<2)|0;k[s+8>>2]=f;sw(e|0,0,d|0)|0;k[u>>2]=f;f=19;break}d=Wa()|0;b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){e=a+12|0;b:do if((k[e>>2]|0)>0){f=a+4580|0;g=(ia(q,p)|0)+1|0;h=a+4584|0;j=a+92|0;l=(q|0)>0;m=a+4576|0;n=0;c:while(1){d=k[v>>2]|0;b=d+3|0;k[f>>2]=b;c=d+(g*3|0)|0;k[h>>2]=c;if(!(n&1))b=g;else{k[f>>2]=c;k[h>>2]=b;b=1}c=k[j>>2]|0;x=0;Ja(k[(k[c>>2]|0)+12>>2]|0,c|0,d+(b*3|0)|0,k[o>>2]|0,p|0);d=x;x=0;if(d&1){f=29;break}if(l){b=k[s>>2]|0;c=k[f>>2]|0;d=0;do{k[m>>2]=k[b+(d<<2)>>2];y=k[o>>2]|0;b=c+(y*3|0)|0;c=c+((y+-1|0)*3|0)|0;i[b>>0]=i[c>>0]|0;i[b+1>>0]=i[c+1>>0]|0;i[b+2>>0]=i[c+2>>0]|0;b=k[f>>2]|0;c=(k[h>>2]|0)+-3|0;i[c>>0]=i[b>>0]|0;i[c+1>>0]=i[b+1>>0]|0;i[c+2>>0]=i[b+2>>0]|0;x=0;ra(74,a|0,0);c=x;x=0;if(c&1){f=28;break c}b=k[s>>2]|0;k[b+(d<<2)>>2]=k[m>>2];c=(k[f>>2]|0)+(p*3|0)|0;k[f>>2]=c;k[h>>2]=(k[h>>2]|0)+(p*3|0);d=d+1|0}while((d|0)<(q|0))}n=n+1|0;if((n|0)>=(k[e>>2]|0)){f=41;break b}}if((f|0)==28){d=Wa()|0;break}else if((f|0)==29){d=Wa()|0;break}}else f=41;while(0);do if((f|0)==41){x=0;qa(182,a|0);y=x;x=0;if(y&1){d=Wa()|0;break}b=k[s>>2]|0;c=b;if(b){d=k[u>>2]|0;if((d|0)!=(b|0))k[u>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[v>>2]|0;if(!b){r=t;return}c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);r=t;return}while(0);b=k[s>>2]|0;c=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[v>>2]|0;if(!b)fb(d|0);c=k[w>>2]|0;if((c|0)!=(b|0))k[w>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}function og(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;A=a+156|0;if((k[A>>2]|0)<=0)return;B=a+4584|0;C=a+4580|0;D=a+4588|0;z=0;while(1){w=z+-1|0;f=k[B>>2]|0;g=k[C>>2]|0;b=z+1|0;e=l[g+(z*3|0)>>0]|0;y=k[D>>2]|0;h=l[g+(w*3|0)>>0]|0;j=e-h|0;m=l[f+(w*3|0)>>0]|0;n=h-m|0;o=((((i[y+((l[g+(b*3|0)>>0]|0)-e)>>0]|0)*9|0)+(i[y+j>>0]|0)|0)*9|0)+(i[y+n>>0]|0)|0;d=l[g+(z*3|0)+1>>0]|0;p=l[g+(w*3|0)+1>>0]|0;q=d-p|0;r=l[f+(w*3|0)+1>>0]|0;s=p-r|0;t=((((i[y+((l[g+(b*3|0)+1>>0]|0)-d)>>0]|0)*9|0)+(i[y+q>>0]|0)|0)*9|0)+(i[y+s>>0]|0)|0;c=l[g+(z*3|0)+2>>0]|0;u=l[g+(w*3|0)+2>>0]|0;v=c-u|0;w=l[f+(w*3|0)+2>>0]|0;x=u-w|0;y=((((i[y+((l[g+(b*3|0)+2>>0]|0)-c)>>0]|0)*9|0)+(i[y+v>>0]|0)|0)*9|0)+(i[y+x>>0]|0)|0;if(!(t|o|y))b=(pg(a,z,0)|0)+z|0;else{g=l[f+(z*3|0)>>0]|0;f=e-m>>31;if((f^n|0)>=0)if((f^j|0)<0)e=m;else e=m-h+e|0;g=qg(a,o,g,e,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+1>>0]|0;e=d-r>>31;if((e^s|0)>=0)if((e^q|0)<0)d=r;else d=r-p+d|0;e=qg(a,t,f,d,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+2>>0]|0;d=c-w>>31;if((d^x|0)>=0)if((d^v|0)<0)c=w;else c=w-u+c|0;y=qg(a,y,f,c,0)|0;z=(k[B>>2]|0)+(z*3|0)|0;i[z>>0]=g;i[z+1>>0]=e;i[z+2>>0]=y}if((b|0)<(k[A>>2]|0))z=b;else break}return}function pg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;m=(k[a+156>>2]|0)-b|0;n=k[a+4584>>2]|0;o=k[a+4580>>2]|0;j=n+((b+-1|0)*3|0)|0;p=i[j>>0]|0;h=i[j+1>>0]|0;j=i[j+2>>0]|0;f=0;while(1){c=n+((f+b|0)*3|0)|0;d=c+1|0;e=c+2|0;if(!(((i[c>>0]|0)==p<<24>>24?(i[d>>0]|0)==h<<24>>24:0)&(i[e>>0]|0)==j<<24>>24))break;i[c>>0]=p;i[d>>0]=h;i[e>>0]=j;f=f+1|0;if((f|0)==(m|0)){f=m;break}}e=(f|0)==(m|0);g=a+4576|0;d=k[36476+(k[g>>2]<<2)>>2]|0;if((1<(f|0))c=f;else{c=f;do{ke(a,1,1);d=k[g>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[g>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>0]|0;b=m+2|0;e=i[b>>0]|0;o=o+(d*3|0)|0;d=i[o+1>>0]|0;t=i[o+2>>0]|0;o=l[o>>0]|0;q=o-(p&255)>>31|1;r=(ia((l[m>>0]|0)-o<<24,q)|0)>>24;s=a+4552|0;rg(a,s,r);p=d&255;d=p-(h&255)>>31|1;c=(ia((c&255)-p<<24,d)|0)>>24;rg(a,s,c);h=t&255;j=h-(j&255)>>31|1;e=(ia((e&255)-h<<24,j)|0)>>24;rg(a,s,e);o=(ia(r,q)|0)+o&255;p=(ia(c,d)|0)+p&255;a=(ia(e,j)|0)+h&255;i[m>>0]=o;i[n>>0]=p;i[b>>0]=a;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;a=f+1|0;return a|0}if(!c){t=m;return t|0}ke(a,1,1);t=m;return t|0}function qg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;i=(q^b)-q|0;p=a+172+(i*12|0)+10|0;g=j[p>>1]|0;o=a+172+(i*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){f=5;while(1)if((g<>1]^q)-q+d|0;if((e&255|0)==(e|0))m=e;else m=e>>31&255^255;h=(c-m^q)-q<<24;l=h>>24;if(!f)e=(k[a+172+(i*12|0)+4>>2]<<1)+-1+g>>31;else e=0;e=e^l;e=e>>30^e<<1;d=e>>f;if((d|0)<23){ke(a,1,d+1|0);ke(a,e&(1<>1]|0;e=g<<16>>16==64;f=e&1;c=(k[d>>2]|0)+l>>f;g=e?32:g<<16>>16;k[o>>2]=(k[o>>2]|0)+((h|0)>-16777216?l:0-l|0)>>f;f=g+1|0;j[p>>1]=f;e=f+c|0;if((e|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(e|0)>(~g|0)?e:0-g|0;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}if((c|0)<=0){p=c;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}p=c-f|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[d>>2]=p;q=l^q;b=b>>>31;b=m+b|0;b=b+q|0;b=b&255;return b|0}function rg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;sg(a,e,d,31-(k[36476+(k[a+4576>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function sg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=c>>b;f=d+-8|0;if((e|0)<(d+-9|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-39|0)}else ke(a,1,f);ke(a,c+255&255,8);return}function tg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,255,0);j=a+160|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+164>>2]|0):0)?(k[h+12>>2]|0)==(k[a+168>>2]|0):0){j=k[8900]|0;k[a+4588>>2]=j+(((k[8901]|0)-j|0)>>>1);r=l;return}c=a+4592|0;d=a+4596|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=512){if(f>>>0>512?(g=b+512|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,512-f|0);b=k[c>>2]|0}h=a+4588|0;k[h>>2]=b+256;g=a+168|0;e=a+164|0;f=-256;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==256)break}r=l;return}function ug(a){a=a|0;var b=0,c=0;k[a>>2]=35884;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);a=a+4|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function vg(a){a=a|0;var b=0,c=0;k[a>>2]=35884;b=k[a+4616>>2]|0;if(b){c=a+4620|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36612;b=k[a+120>>2]|0;if(b){c=a+124|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+92|0;b=k[c>>2]|0;k[c>>2]=0;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);c=a+4|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function wg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+136>>2]|0,k[a+144>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+184>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+188>>2]=f;k[a+192>>2]=e;Gg(a);e=a+140|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+196+(f*12|0)>>2]=b;k[a+196+(f*12|0)+4>>2]=0;j[a+196+(f*12|0)+8>>1]=0;j[a+196+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4576>>2]=h;k[a+4580>>2]=0;i[a+4584>>0]=l;i[a+4585>>0]=1;i[a+4586>>0]=0;k[a+4588>>2]=h;k[a+4592>>2]=1;i[a+4596>>0]=l;i[a+4597>>0]=1;i[a+4598>>0]=0;k[a+4600>>2]=0;r=g;return}function xg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0;n=r;r=r+16|0;l=n;h=a+92|0;g=k[b>>2]|0;k[b>>2]=0;b=k[h>>2]|0;k[h>>2]=g;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);k[l>>2]=0;k[l+4>>2]=d;h=c+8|0;k[l+8>>2]=k[h>>2];if(d){b=lj(4624)|0;d=a+8|0;e=b+4|0;f=d;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));e=b+88|0;g=e+40|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[b>>2]=35660;k[b+128>>2]=k[a+136>>2];k[b+132>>2]=k[a+140>>2];k[b+136>>2]=k[a+144>>2];k[b+140>>2]=k[a+148>>2];k[b+144>>2]=k[a+152>>2];k[b+148>>2]=k[a+156>>2];k[b+152>>2]=k[a+160>>2];e=b+156|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[b+172>>2]=k[d>>2];k[b+176>>2]=0;k[b+180>>2]=0;k[b+184>>2]=0;e=b+4568|0;d=b+188|0;do{k[d>>2]=0;k[d+4>>2]=0;j[d+8>>1]=0;j[d+10>>1]=1;d=d+12|0}while((d|0)!=(e|0));f=a+4|0;k[e>>2]=0;k[e+4>>2]=0;j[e+8>>1]=0;i[e+10>>0]=0;g=b+4580|0;k[g>>2]=0;k[g+4>>2]=0;j[g+8>>1]=0;i[g+10>>0]=0;g=b+4592|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[g+16>>2]=0;k[g+20>>2]=0;k[g+24>>2]=0;i[g+28>>0]=0;if(!(k[b+28>>2]|0))k[b+20>>2]=1;d=k[f>>2]|0;k[f>>2]=b;if(d){Lb[k[(k[d>>2]|0)+4>>2]&255](d);b=k[f>>2]|0}ee(b,l)}l=a+100|0;k[l>>2]=32;k[a+96>>2]=0;b=k[c>>2]|0;if(!b){k[a+108>>2]=k[c+4>>2];k[a+104>>2]=k[h>>2];zg(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0}k[a+132>>2]=b;e=a+120|0;h=a+124|0;d=k[h>>2]|0;b=k[e>>2]|0;f=b;g=d-f|0;if(g>>>0>=4e3){if(g>>>0>4e3?(m=b+4e3|0,(d|0)!=(m|0)):0){k[h>>2]=m;d=m}}else{fe(e,4e3-g|0);b=k[e>>2]|0;f=b;d=k[h>>2]|0}k[a+108>>2]=f;k[a+104>>2]=d-b;zg(a);m=a+116|0;m=k[m>>2]|0;a=k[l>>2]|0;a=a+-32|0;a=(a|0)/8|0;a=m-a|0;r=n;return a|0} -function yg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+32>>2]|0)!=0?(k[a+24>>2]|0)!=1:0){p=a+8|0;s=a+36|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+16>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+20>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function zg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;t=r;r=r+32|0;v=t+12|0;s=t;p=a+180|0;q=(k[p>>2]|0)+4|0;if((k[a+32>>2]|0)==1)n=k[a+24>>2]|0;else n=1;b=ia(n<<1,q)|0;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;a:do if(b){if(!((b|0)<0?(x=0,qa(178,v|0),u=x,x=0,u&1):0))o=6;if((o|0)==6?(x=0,c=ta(67,b|0)|0,u=x,x=0,!(u&1)):0){k[w>>2]=c;k[v>>2]=c;k[v+8>>2]=c+b;while(1){i[c>>0]=0;c=(k[w>>2]|0)+1|0;k[w>>2]=c;b=b+-1|0;if(!b)break a}}c=Wa()|0;b=k[v>>2]|0;if(!b)fb(c|0);if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);fb(c|0)}while(0);k[s>>2]=0;u=s+4|0;k[u>>2]=0;k[s+8>>2]=0;do if(!n)o=19;else{if(!(n>>>0>1073741823?(x=0,qa(178,s|0),m=x,x=0,m&1):0))o=17;if((o|0)==17?(d=n<<2,x=0,e=ta(67,d|0)|0,m=x,x=0,!(m&1)):0){k[s>>2]=e;o=e+(n<<2)|0;k[s+8>>2]=o;sw(e|0,0,d|0)|0;k[u>>2]=o;o=19;break}c=Wa()|0;b=k[s>>2]|0;d=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}while(0);if((o|0)==19){g=a+12|0;b:do if((k[g>>2]|0)>0){h=a+4604|0;j=(ia(n,q)|0)+1|0;l=a+4608|0;m=a+92|0;f=a+4600|0;if((n|0)>0)e=0;else{d=0;while(1){c=k[v>>2]|0;b=c+1|0;k[h>>2]=b;c=c+j|0;k[l>>2]=c;if(!(d&1))b=c;else{k[h>>2]=c;k[l>>2]=b}n=k[m>>2]|0;x=0;Ja(k[(k[n>>2]|0)+12>>2]|0,n|0,b|0,k[p>>2]|0,q|0);n=x;x=0;if(n&1)break;d=d+1|0;if((d|0)>=(k[g>>2]|0)){o=45;break b}}c=Wa()|0;break}c:while(1){c=k[v>>2]|0;b=c+1|0;k[h>>2]=b;c=c+j|0;k[l>>2]=c;if(!(e&1))b=c;else{k[h>>2]=c;k[l>>2]=b}o=k[m>>2]|0;x=0;Ja(k[(k[o>>2]|0)+12>>2]|0,o|0,b|0,k[p>>2]|0,q|0);o=x;x=0;if(o&1){o=28;break}b=k[s>>2]|0;c=k[h>>2]|0;d=0;do{k[f>>2]=k[b+(d<<2)>>2];o=k[p>>2]|0;i[c+o>>0]=i[c+(o+-1)>>0]|0;i[(k[l>>2]|0)+-1>>0]=i[k[h>>2]>>0]|0;x=0;ra(75,a|0,0);o=x;x=0;if(o&1){o=36;break c}b=k[s>>2]|0;k[b+(d<<2)>>2]=k[f>>2];c=(k[h>>2]|0)+q|0;k[h>>2]=c;k[l>>2]=(k[l>>2]|0)+q;d=d+1|0}while((d|0)<(n|0));e=e+1|0;if((e|0)>=(k[g>>2]|0)){o=45;break b}}if((o|0)==28){c=Wa()|0;break}else if((o|0)==36){c=Wa()|0;break}}else o=45;while(0);do if((o|0)==45){x=0;qa(182,a|0);a=x;x=0;if(a&1){c=Wa()|0;break}b=k[s>>2]|0;c=b;if(b){d=k[u>>2]|0;if((d|0)!=(b|0))k[u>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[v>>2]|0;if(!b){r=t;return}if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);r=t;return}while(0);b=k[s>>2]|0;d=b;if(b){e=k[u>>2]|0;if((e|0)!=(b|0))k[u>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}b=k[v>>2]|0;if(!b)fb(c|0);if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);fb(c|0)}function Ag(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0;o=a+4604|0;b=k[o>>2]|0;r=a+180|0;if((k[r>>2]|0)<=0)return;p=a+4608|0;q=a+4612|0;e=b;f=l[b+-1>>0]|0;b=l[b>>0]|0;n=0;while(1){m=k[p>>2]|0;j=l[m+(n+-1)>>0]|0;d=n+1|0;c=l[e+d>>0]|0;h=k[q>>2]|0;g=b-f|0;e=f-j|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(Cg(a,n,0)|0)+n|0;c=k[o>>2]|0;b=l[c+(d+-1)>>0]|0;c=l[c+d>>0]|0}else{f=b-j>>31;if((f^e|0)<0)e=b;else e=j+((f^g|0)<0?0:g)|0;m=Bg(a,h,l[m+n>>0]|0,e,0)|0;i[(k[p>>2]|0)+n>>0]=m}if((d|0)>=(k[r>>2]|0))break;e=k[o>>2]|0;f=b;b=c;n=d}return}function Bg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;f=(r^b)-r|0;p=a+196+(f*12|0)+10|0;g=j[p>>1]|0;o=a+196+(f*12|0)|0;e=k[o>>2]|0;if((g|0)<(e|0))if((g<<1|0)<(e|0))if((g<<2|0)<(e|0))if((g<<3|0)<(e|0))if((g<<4|0)<(e|0)){b=5;while(1)if((g<>1]^r)-r+d|0;q=a+136|0;d=k[q>>2]|0;if((e&d|0)==(e|0))l=e;else l=d&~(e>>31);e=(c-l^r)-r|0;i=a+144|0;d=k[i>>2]|0;if((e|0)>0)e=(e+d|0)/(d<<1|1|0)|0;else e=(e-d|0)/(d<<1|1|0)|0;n=a+140|0;h=k[n>>2]|0;c=((e|0)<0?h:0)+e|0;h=c-((c|0)<((h+1|0)/2|0|0)?0:h)|0;f=a+196+(f*12|0)+4|0;if(!(d|b))e=(k[f>>2]<<1)+-1+g>>31;else e=0;d=e^h;Fg(a,b,d>>30^d<<1,k[a+156>>2]|0);d=k[a+160>>2]|0;b=(k[o>>2]|0)+((h|0)>-1?h:0-h|0)|0;e=(k[f>>2]|0)+(ia(k[i>>2]<<1|1,h)|0)|0;c=j[p>>1]|0;if((c|0)==(d|0)){b=b>>1;e=e>>1;c=d>>1}k[o>>2]=b;d=c+1|0;j[p>>1]=d;b=d+e|0;if((b|0)>=1){if((e|0)>0){e=e-d|0;p=j[m>>1]|0;j[m>>1]=(p<<16>>16<127&1)+(p&65535);e=(e|0)>0?0:e}}else{e=j[m>>1]|0;j[m>>1]=(e&65535)-(e<<16>>16>-128&1);e=(b|0)>(~c|0)?b:0-c|0}k[f>>2]=e;d=k[i>>2]|0;c=d<<1|1;b=(ia(c,(h^r)-r|0)|0)+l|0;if((b|0)>=(0-d|0)){e=k[q>>2]|0;if((e+d|0)<(b|0))b=b-(ia(k[n>>2]|0,c)|0)|0}else{b=(ia(k[n>>2]|0,c)|0)+b|0;e=k[q>>2]|0}if((b&e|0)==(b|0)){r=b;r=r&255;return r|0}r=e&~(b>>31);r=r&255;return r|0}function Cg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;j=(k[a+180>>2]|0)-b|0;m=k[a+4608>>2]|0;n=k[a+4604>>2]|0;e=i[m+(b+-1)>>0]|0;h=e&255;c=a+144|0;f=0;while(1){d=m+(f+b)|0;g=(l[d>>0]|0)-h|0;if((((g|0)>-1?g:0-g|0)|0)>(k[c>>2]|0))break;i[d>>0]=e;f=f+1|0;if((f|0)==(j|0)){f=j;break}}e=(f|0)==(j|0);g=a+4600|0;d=k[36476+(k[g>>2]<<2)>>2]|0;if((1<(f|0))c=f;else{c=f;do{ke(a,1,1);d=k[g>>2]|0;c=c-(1<>2])|0;d=(d|0)>30?31:d+1|0;k[g>>2]=d;d=k[36476+(d<<2)>>2]|0}while((c|0)>=(1<>0]|0,h,l[n+j>>0]|0)|0;i[b>>0]=a;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;a=f+1|0;return a|0}if(!c){a=j;return a|0}ke(a,1,1);a=j;return a|0}function Dg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=c-d|0;i=a+136|0;g=a+144|0;e=k[g>>2]|0;if((((h|0)>-1?h:0-h|0)|0)>(e|0)){f=d-c>>31|1;b=ia(f,b-d|0)|0;if((b|0)>0)b=(e+b|0)/(e<<1|1|0)|0;else b=(b-e|0)/(e<<1|1|0)|0;h=a+140|0;e=k[h>>2]|0;c=((b|0)<0?e:0)+b|0;e=c-((c|0)<((e+1|0)/2|0|0)?0:e)|0;Eg(a,a+4576|0,e);e=ia(e,f)|0;f=k[g>>2]|0;g=f<<1|1;e=(ia(e,g)|0)+d|0;if((e|0)>=(0-f|0)){b=k[i>>2]|0;if((b+f|0)<(e|0))e=e-(ia(k[h>>2]|0,g)|0)|0}else{e=(ia(k[h>>2]|0,g)|0)+e|0;b=k[i>>2]|0}if((e&b|0)==(e|0)){i=e;i=i&255;return i|0}i=b&~(e>>31);i=i&255;return i|0}else{b=b-c|0;if((b|0)>0)b=(e+b|0)/(e<<1|1|0)|0;else b=(b-e|0)/(e<<1|1|0)|0;h=a+140|0;e=k[h>>2]|0;f=((b|0)<0?e:0)+b|0;e=f-((f|0)<((e+1|0)/2|0|0)?0:e)|0;Eg(a,a+4588|0,e);f=k[g>>2]|0;g=f<<1|1;e=(ia(g,e)|0)+c|0;if((e|0)>=(0-f|0)){b=k[i>>2]|0;if((b+f|0)<(e|0))e=e-(ia(k[h>>2]|0,g)|0)|0}else{e=(ia(k[h>>2]|0,g)|0)+e|0;b=k[i>>2]|0}if((e&b|0)==(e|0)){i=e;i=i&255;return i|0}i=b&~(e>>31);i=i&255;return i|0}return 0}function Eg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0;n=b+9|0;g=l[n>>0]|0;m=b+4|0;j=k[m>>2]|0;e=(ia(g>>>1,j)|0)+(k[b>>2]|0)|0;if((g|0)<(e|0)){f=g;d=0;do{f=f<<1;d=d+1|0}while((f|0)<(e|0));e=d}else e=0;if((c|0)>0&(e|0)==0?l[b+10>>0]<<1>>>0>>0:0)d=1;else h=5;do if((h|0)==5){d=(c|0)<0;if(d?l[b+10>>0]<<1>>>0>=g>>>0:0){d=1;break}d=d&(e|0)!=0}while(0);d=(((c|0)>-1?c:0-c|0)<<1)-j+(d<<31>>31)|0;Fg(a,e,d,(k[a+156>>2]|0)+-1-(k[36476+(k[a+4600>>2]<<2)>>2]|0)|0);if((c|0)<0){a=b+10|0;i[a>>0]=(l[a>>0]|0)+1}d=(d+1-(k[m>>2]|0)>>1)+(k[b>>2]|0)|0;k[b>>2]=d;e=i[n>>0]|0;if(e<<24>>24!=(i[b+8>>0]|0)){b=e;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}k[b>>2]=d>>1;a=(e&255)>>>1;i[n>>0]=a;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=a;b=b&255;b=b+1|0;b=b&255;i[n>>0]=b;return}function Fg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=c>>b;f=a+148|0;g=d-(k[f>>2]|0)|0;if((e|0)<(g+-1|0)){if((e|0)>30){d=(e|0)/2|0;ke(a,0,d);e=e-d|0}ke(a,1,e+1|0);ke(a,(1<31){ke(a,0,31);ke(a,1,d+-31-(k[f>>2]|0)|0)}else ke(a,1,g);b=k[f>>2]|0;ke(a,(1<>2]|0)){c=k[a+136>>2]|0;b=a+152|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+184>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+188>>2]|0):0)?(k[d+12>>2]|0)==(k[a+192>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4612>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4612>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4612>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4612>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+152|0;while(0);m=1<>2];c=a+4616|0;d=m<<1;e=a+4620|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4612|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+192|0;j=a+188|0;g=a+184|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function Hg(a){a=a|0;var b=0,c=0;k[a>>2]=35856;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Ig(a){a=a|0;var b=0,c=0;k[a>>2]=35856;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Jg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Kg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+128>>2]|0,k[a+136>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+176>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+180>>2]=f;k[a+184>>2]=e;Vg(a);e=a+132|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+188+(f*12|0)>>2]=b;k[a+188+(f*12|0)+4>>2]=0;j[a+188+(f*12|0)+8>>1]=0;j[a+188+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4568>>2]=h;k[a+4572>>2]=0;i[a+4576>>0]=l;i[a+4577>>0]=1;i[a+4578>>0]=0;k[a+4580>>2]=h;k[a+4584>>2]=1;i[a+4588>>0]=l;i[a+4589>>0]=1;i[a+4590>>0]=0;k[a+4592>>2]=0;r=g;return}function Lg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4620>>0]=e&1;b=a+156|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);Mg(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function Mg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+172|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,C|0),B=x,x=0,B&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,B=x,x=0,!(B&1)):0){k[C>>2]=d;B=d+(b<<1)|0;k[C+8>>2]=B;sw(d|0,0,c|0)|0;k[D>>2]=B;break}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)g=18;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))g=16;if((g|0)==16?(e=y<<2,x=0,f=ta(67,e|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=f;g=f+(y<<2)|0;k[z+8>>2]=g;sw(f|0,0,e|0)|0;k[B>>2]=g;g=18;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+8|0;a:do if((k[f>>2]|0)>0){g=a+4596|0;h=ia(y,w)|0;i=h+1|0;l=a+4600|0;m=(y|0)>0;n=a+160|0;o=a+168|0;p=a+164|0;q=a+156|0;s=a+88|0;t=a+4592|0;u=0;b:while(1){d=k[C>>2]|0;c=d+2|0;k[g>>2]=c;d=d+(i<<1)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];e=k[v>>2]|0;j[c+(e<<1)>>1]=j[c+(e+-1<<1)>>1]|0;j[b+-2>>1]=j[c>>1]|0;x=0;ra(76,a|0,0);e=x;x=0;if(e&1){g=29;break b}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w<<1)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w<<1)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+((k[q>>2]|0)-h<<1)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){g=30;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){g=42;break a}}if((g|0)==29){d=Wa()|0;break}else if((g|0)==30){d=Wa()|0;break}}else g=42;while(0);do if((g|0)==42){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function Ng(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;q=a+4596|0;c=k[q>>2]|0;u=a+172|0;b=k[u>>2]|0;if((b|0)<=0)return;r=a+4600|0;s=a+4604|0;t=a+4592|0;h=c;f=m[c+-2>>1]|0;c=m[c>>1]|0;p=0;while(1){n=k[r>>2]|0;g=j[n+(p+-1<<1)>>1]|0;o=g&65535;e=p+1|0;d=m[h+(e<<1)>>1]|0;l=k[s>>2]|0;h=c-f|0;f=f-o|0;l=((((i[l+(d-c)>>0]|0)*9|0)+(i[l+h>>0]|0)|0)*9|0)+(i[l+f>>0]|0)|0;n=n+(p<<1)|0;if(!l){b=Qg(a,g,n,b-p|0)|0;c=b+p|0;if((c|0)!=(k[u>>2]|0)){o=Rg(a,o,m[(k[q>>2]|0)+(c<<1)>>1]|0)|0;j[(k[r>>2]|0)+(c<<1)>>1]=o;o=k[t>>2]|0;k[t>>2]=(o|0)<1?0:o+-1|0;b=b+1|0}e=b+p|0;d=k[q>>2]|0;c=m[d+(e+-1<<1)>>1]|0;d=m[d+(e<<1)>>1]|0}else{b=c-o>>31;if((b^f|0)<0)b=c;else b=o+((b^h|0)<0?0:h)|0;o=Pg(a,l,m[n>>1]|0,b,0)|0;j[(k[r>>2]|0)+(p<<1)>>1]=o}b=k[u>>2]|0;if((b|0)<=(e|0))break;h=k[q>>2]|0;f=c;c=d;p=e}return}function Og(a){a=a|0;var b=0,c=0,d=0,e=0;d=a+116|0;c=k[d>>2]|0;if((i[c>>0]|0)!=-1){e=a+112|0;b=k[e>>2]|0;if((b|0)<1){qe(a);b=k[e>>2]|0;c=k[d>>2]|0}a=a+108|0;d=k[a>>2]|0;k[e>>2]=b+-1;b=d<<1;k[a>>2]=b;if((i[c>>0]|0)!=-1){b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,6,35648);a=x;x=0;if(!(a&1))ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}}else b=k[a+108>>2]|0;if(!b)return;b=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,b|0,6,35648);a=x;x=0;if(!(a&1))ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}function Pg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;l=(r^b)-r|0;p=a+188+(l*12|0)+10|0;c=j[p>>1]|0;o=a+188+(l*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){b=5;while(1)if((c<>1]^r)-r+d|0;q=a+128|0;e=k[q>>2]|0;if((c&e|0)==(c|0))m=c;else m=e&~(c>>31);c=a+112|0;if((k[c>>2]|0)<8)qe(a);e=a+108|0;d=k[e>>2]|0;f=d>>>24;g=k[2832+(b<<11)+(f<<3)+4>>2]|0;if(!g){h=k[a+148>>2]|0;e=k[a+140>>2]|0;c=Tg(a)|0;if((c|0)<(h+-1-e|0)){if(b)c=(Ug(a,b)|0)+(c<>31^c>>1;if((((c|0)>-1?c:0-c|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(c|0);fb(a|0)}else ub(c|0,824,96)}}else{k[c>>2]=(k[c>>2]|0)-g;k[e>>2]=d<>2]|0}h=a+136|0;d=k[h>>2]|0;if(!b){if(!d)e=(k[a+188+(l*12|0)+4>>2]<<1)+-1+(j[p>>1]|0)>>31;else e=0;g=e^c}else g=c;b=k[a+152>>2]|0;e=(k[o>>2]|0)+((g|0)>-1?g:0-g|0)|0;f=a+188+(l*12|0)+4|0;c=(k[f>>2]|0)+(ia(d<<1|1,g)|0)|0;d=j[p>>1]|0;if((d|0)==(b|0)){e=e>>1;c=c>>1;d=b>>1}k[o>>2]=e;b=d+1|0;j[p>>1]=b;e=b+c|0;if((e|0)>=1){if((c|0)>0){c=c-b|0;p=j[n>>1]|0;j[n>>1]=(p<<16>>16<127&1)+(p&65535);c=(c|0)>0?0:c}}else{c=j[n>>1]|0;j[n>>1]=(c&65535)-(c<<16>>16>-128&1);c=(e|0)>(~d|0)?e:0-d|0}k[f>>2]=c;b=k[h>>2]|0;d=b<<1|1;e=(ia(d,(g^r)-r|0)|0)+m|0;if((e|0)>=(0-b|0)){c=k[q>>2]|0;if((c+b|0)<(e|0))e=e-(ia(k[a+132>>2]|0,d)|0)|0}else{e=(ia(k[a+132>>2]|0,d)|0)+e|0;c=k[q>>2]|0}if((e&c|0)==(e|0)){a=e;a=a&65535;return a|0}a=c&~(e>>31);a=a&65535;return a|0}function Qg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0;h=a+112|0;l=a+108|0;m=a+4592|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[l>>2]|0;e=e+-1|0;k[h>>2]=e;k[l>>2]=g<<1;if((g|0)>=0){n=8;break}g=k[m>>2]|0;o=1<>2];p=d-f|0;p=(o|0)<(p|0)?o:p;f=p+f|0;if((p|0)==(o|0))k[m>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((n|0)==8)if((f|0)!=(d|0)){e=k[m>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);p=x;x=0;if(p&1){p=Wa()|0;Ua(e|0);fb(p|0)}else ub(e|0,824,96)}}else e=d;if((e|0)>0)f=0;else return e|0;do{j[c+(f<<1)>>1]=b;f=f+1|0}while((f|0)!=(e|0));return e|0}function Rg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=b-c|0;g=a+128|0;d=a+136|0;if((((f|0)>-1?f:0-f|0)|0)>(k[d>>2]|0)){b=ia(Sg(a,a+4568|0)|0,c-b>>31|1)|0;e=k[d>>2]|0;f=e<<1|1;b=(ia(b,f)|0)+c|0;if((b|0)>=(0-e|0)){d=k[g>>2]|0;if((d+e|0)<(b|0))b=b-(ia(k[a+132>>2]|0,f)|0)|0}else{b=(ia(k[a+132>>2]|0,f)|0)+b|0;d=k[g>>2]|0}if((b&d|0)==(b|0)){a=b;a=a&65535;return a|0}a=d&~(b>>31);a=a&65535;return a|0}else{c=Sg(a,a+4580|0)|0;f=k[d>>2]|0;e=f<<1|1;b=(ia(e,c)|0)+b|0;if((b|0)>=(0-f|0)){d=k[g>>2]|0;if((d+f|0)<(b|0))b=b-(ia(k[a+132>>2]|0,e)|0)|0}else{b=(ia(k[a+132>>2]|0,e)|0)+b|0;d=k[g>>2]|0}if((b&d|0)==(b|0)){a=b;a=a&65535;return a|0}a=d&~(b>>31);a=a&65535;return a|0}return 0}function Sg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0;m=b+9|0;c=l[m>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;g=k[a+148>>2]|0;h=k[36476+(k[a+4592>>2]<<2)>>2]|0;c=k[a+140>>2]|0;e=Tg(a)|0;do if((e|0)<(g+-2-h-c|0))if(!d){d=k[f>>2]|0;a=d+e|0;c=a&1;a=(c+a|0)/2|0;j=8;break}else{h=(Ug(a,d)|0)+(e<>2]|0;e=h+d|0;g=e&1;c=g;f=1;e=(g+e|0)/2|0;break}else{e=(Ug(a,c)|0)+1|0;g=k[f>>2]|0;a=e+g|0;c=a&1;a=(c+a|0)/2|0;if(!d){d=g;j=8}else{h=e;f=1;e=a;d=g}}while(0);if((j|0)==8){h=e;f=l[b+10>>0]<<1>>>0>=(l[m>>0]|0)>>>0;e=a}e=(c|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(h+1-d>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[m>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){b=d;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[m>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=j;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}function Tg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;f=a+112|0;if((k[f>>2]|0)<16)qe(a);g=a+108|0;c=k[g>>2]|0;if((c|0)>=0)if(!(c&1073741824))if(!(c&536870912))if(!(c&268435456))if(!(c&134217728))if(!(c&67108864))if(!(c&33554432))if(!(c&16777216))if(!(c&8388608))if(!(c&4194304))if(!(c&2097152))if(!(c&1048576))if(!(c&524288))if(!(c&262144))if(!(c&131072)){e=c>>>12&16;b=e+-1|0;if(!e){b=(k[f>>2]|0)+-15|0;k[f>>2]=b;d=c<<15;k[g>>2]=d;c=b;b=15;while(1){if((c|0)<1){qe(a);e=k[g>>2]|0;c=k[f>>2]|0}else e=d;c=c+-1|0;k[f>>2]=c;d=e<<1;k[g>>2]=d;if((e|0)<0)break;else b=b+1|0}return b|0}}else b=14;else b=13;else b=12;else b=11;else b=10;else b=9;else b=8;else b=7;else b=6;else b=5;else b=4;else b=3;else b=2;else b=1;else b=0;a=b+1|0;k[f>>2]=(k[f>>2]|0)-a;k[g>>2]=c<>2]|0;if((c|0)<(b|0)){qe(a);c=k[d>>2]|0;if((c|0)<(b|0)){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(c|0);fb(a|0)}else ub(c|0,824,96)}}e=a+108|0;a=k[e>>2]|0;k[d>>2]=c-b;k[e>>2]=a<>>(32-b|0)|0}function Vg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+136|0;a:do if(!(k[n>>2]|0)){c=k[a+128>>2]|0;b=a+144|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+176>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+180>>2]|0):0)?(k[d+12>>2]|0)==(k[a+184>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4604>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4604>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4604>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4604>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+144|0;while(0);m=1<>2];c=a+4608|0;d=m<<1;e=a+4612|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4604|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+184|0;j=a+180|0;g=a+176|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function Wg(a){a=a|0;var b=0,c=0;k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Xg(a){a=a|0;var b=0,c=0;k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Yg(a){a=a|0;var b=0,c=0;k[a>>2]=35828;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Zg(a){a=a|0;var b=0,c=0;k[a>>2]=35828;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function _g(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=6;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=6;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function $g(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+128>>2]|0,k[a+136>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+176>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+180>>2]=f;k[a+184>>2]=e;hh(a);e=a+132|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+188+(f*12|0)>>2]=b;k[a+188+(f*12|0)+4>>2]=0;j[a+188+(f*12|0)+8>>1]=0;j[a+188+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4568>>2]=h;k[a+4572>>2]=0;i[a+4576>>0]=l;i[a+4577>>0]=1;i[a+4578>>0]=0;k[a+4580>>2]=h;k[a+4584>>2]=1;i[a+4588>>0]=l;i[a+4589>>0]=1;i[a+4590>>0]=0;k[a+4592>>2]=0;r=g;return}function ah(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4620>>0]=e&1;b=a+156|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);bh(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function bh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+172|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;do if(b){if(!(b>>>0>715827882?(x=0,qa(178,C|0),B=x,x=0,B&1):0))g=6;if((g|0)==6?(x=0,c=ta(67,b*6|0)|0,B=x,x=0,!(B&1)):0){k[D>>2]=c;k[C>>2]=c;d=c+(b*6|0)|0;k[C+8>>2]=d;while(1){j[c>>1]=0;j[c+2>>1]=0;j[c+4>>1]=0;b=b+-1|0;if(!b)break;else c=c+6|0}k[D>>2]=d;break}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)g=20;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))g=18;if((g|0)==18?(e=y<<2,x=0,f=ta(67,e|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=f;g=f+(y<<2)|0;k[z+8>>2]=g;sw(f|0,0,e|0)|0;k[B>>2]=g;g=20;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==20){f=a+8|0;a:do if((k[f>>2]|0)>0){g=a+4596|0;h=ia(y,w)|0;i=h+1|0;l=a+4600|0;m=(y|0)>0;n=a+160|0;o=a+168|0;p=a+164|0;q=a+156|0;s=a+88|0;t=a+4592|0;u=0;b:while(1){d=k[C>>2]|0;c=d+6|0;k[g>>2]=c;d=d+(i*6|0)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];b=k[v>>2]|0;e=c+(b*6|0)|0;c=c+((b+-1|0)*6|0)|0;j[e>>1]=j[c>>1]|0;j[e+2>>1]=j[c+2>>1]|0;j[e+4>>1]=j[c+4>>1]|0;e=(k[l>>2]|0)+-6|0;c=k[g>>2]|0;j[e>>1]=j[c>>1]|0;j[e+2>>1]=j[c+2>>1]|0;j[e+4>>1]=j[c+4>>1]|0;x=0;ra(77,a|0,0);e=x;x=0;if(e&1){g=31;break b}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w*6|0)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w*6|0)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+(((k[q>>2]|0)-h|0)*6|0)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){g=32;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){g=44;break a}}if((g|0)==31){d=Wa()|0;break}else if((g|0)==32){d=Wa()|0;break}}else g=44;while(0);do if((g|0)==44){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-6-b|0)>>>0)/6|0)*6|0);mj(b);fb(d|0)}function ch(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;N=r;r=r+32|0;D=N+24|0;M=N+18|0;L=N+12|0;E=N+6|0;F=N;G=a+172|0;b=k[G>>2]|0;if((b|0)<=0){r=N;return}H=a+4600|0;I=a+4596|0;J=a+4604|0;K=a+4592|0;C=0;while(1){d=C+-1|0;e=k[H>>2]|0;O=k[I>>2]|0;c=C+1|0;f=m[O+(C*6|0)>>1]|0;B=k[J>>2]|0;g=m[O+(d*6|0)>>1]|0;h=f-g|0;l=m[e+(d*6|0)>>1]|0;n=g-l|0;o=((((i[B+((m[O+(c*6|0)>>1]|0)-f)>>0]|0)*9|0)+(i[B+h>>0]|0)|0)*9|0)+(i[B+n>>0]|0)|0;p=m[O+(C*6|0)+2>>1]|0;q=m[O+(d*6|0)+2>>1]|0;s=p-q|0;t=m[e+(d*6|0)+2>>1]|0;u=q-t|0;v=((((i[B+((m[O+(c*6|0)+2>>1]|0)-p)>>0]|0)*9|0)+(i[B+s>>0]|0)|0)*9|0)+(i[B+u>>0]|0)|0;w=m[O+(C*6|0)+4>>1]|0;x=m[O+(d*6|0)+4>>1]|0;y=w-x|0;z=m[e+(d*6|0)+4>>1]|0;A=x-z|0;B=((((i[B+((m[O+(c*6|0)+4>>1]|0)-w)>>0]|0)*9|0)+(i[B+y>>0]|0)|0)*9|0)+(i[B+A>>0]|0)|0;if(!(v|o|B)){c=e+(d*6|0)|0;j[L>>1]=j[c>>1]|0;j[L+2>>1]=j[c+2>>1]|0;j[L+4>>1]=j[c+4>>1]|0;j[D>>1]=j[c>>1]|0;j[D+2>>1]=j[c+2>>1]|0;j[D+4>>1]=j[c+4>>1]|0;b=dh(a,D,e+(C*6|0)|0,b-C|0)|0;c=b+C|0;if((c|0)!=(k[G>>2]|0)){O=(k[I>>2]|0)+(c*6|0)|0;j[F>>1]=j[O>>1]|0;j[F+2>>1]=j[O+2>>1]|0;j[F+4>>1]=j[O+4>>1]|0;O=(k[H>>2]|0)+(c*6|0)|0;j[M>>1]=j[L>>1]|0;j[M+2>>1]=j[L+2>>1]|0;j[M+4>>1]=j[L+4>>1]|0;j[D>>1]=j[F>>1]|0;j[D+2>>1]=j[F+2>>1]|0;j[D+4>>1]=j[F+4>>1]|0;eh(E,a,M,D);j[O>>1]=j[E>>1]|0;j[O+2>>1]=j[E+2>>1]|0;j[O+4>>1]=j[E+4>>1]|0;O=k[K>>2]|0;k[K>>2]=(O|0)<1?0:O+-1|0;b=b+1|0}c=b+C|0}else{d=m[e+(C*6|0)>>1]|0;b=f-l>>31;if((b^n|0)>=0)if((b^h|0)<0)b=l;else b=l-g+f|0;else b=f;f=fh(a,o,d,b,0)|0;d=m[(k[H>>2]|0)+(C*6|0)+2>>1]|0;b=p-t>>31;if((b^u|0)>=0)if((b^s|0)<0)b=t;else b=t-q+p|0;else b=p;d=fh(a,v,d,b,0)|0;e=m[(k[H>>2]|0)+(C*6|0)+4>>1]|0;b=w-z>>31;if((b^A|0)>=0)if((b^y|0)<0)b=z;else b=z-x+w|0;else b=w;B=fh(a,B,e,b,0)|0;O=k[H>>2]|0;j[O+(C*6|0)>>1]=f;j[O+(C*6|0)+2>>1]=d;j[O+(C*6|0)+4>>1]=B}b=k[G>>2]|0;if((c|0)>=(b|0))break;else C=c}r=N;return}function dh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0;h=a+112|0;l=a+108|0;m=a+4592|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[l>>2]|0;e=e+-1|0;k[h>>2]=e;k[l>>2]=g<<1;if((g|0)>=0){n=8;break}g=k[m>>2]|0;o=1<>2];p=d-f|0;p=(o|0)<(p|0)?o:p;f=p+f|0;if((p|0)==(o|0))k[m>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((n|0)==8)if((f|0)!=(d|0)){e=k[m>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);p=x;x=0;if(p&1){p=Wa()|0;Ua(e|0);fb(p|0)}else ub(e|0,824,96)}}else e=d;if((e|0)<=0)return e|0;f=0;do{p=c+(f*6|0)|0;j[p>>1]=j[b>>1]|0;j[p+2>>1]=j[b+2>>1]|0;j[p+4>>1]=j[b+4>>1]|0;f=f+1|0}while((f|0)!=(e|0));return e|0}function eh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,l=0,n=0,o=0;i=b+4568|0;o=gh(b,i)|0;g=gh(b,i)|0;i=gh(b,i)|0;f=b+128|0;e=m[d>>1]|0;l=k[b+136>>2]|0;n=l<<1|1;e=(ia(ia(n,o)|0,e-(m[c>>1]|0)>>31|1)|0)+e|0;o=0-l|0;if((e|0)>=(o|0)){f=k[f>>2]|0;if((f+l|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else{e=(ia(k[b+132>>2]|0,n)|0)+e|0;f=k[f>>2]|0}if((e&f|0)!=(e|0))e=f&~(e>>31);h=e&65535;e=m[d+2>>1]|0;e=(ia(ia(n,g)|0,e-(m[c+2>>1]|0)>>31|1)|0)+e|0;if((e|0)>=(o|0)){if((f+l|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else e=(ia(k[b+132>>2]|0,n)|0)+e|0;if((e&f|0)!=(e|0))e=f&~(e>>31);g=e&65535;e=m[d+4>>1]|0;e=(ia(ia(n,i)|0,e-(m[c+4>>1]|0)>>31|1)|0)+e|0;if((e|0)>=(o|0)){if((f+l|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else e=(ia(k[b+132>>2]|0,n)|0)+e|0;if((e&f|0)==(e|0)){b=e;b=b&65535;j[a>>1]=h;o=a+2|0;j[o>>1]=g;a=a+4|0;j[a>>1]=b;return}b=f&~(e>>31);b=b&65535;j[a>>1]=h;o=a+2|0;j[o>>1]=g;a=a+4|0;j[a>>1]=b;return}function fh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;l=(r^b)-r|0;p=a+188+(l*12|0)+10|0;c=j[p>>1]|0;o=a+188+(l*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){b=5;while(1)if((c<>1]^r)-r+d|0;q=a+128|0;e=k[q>>2]|0;if((c&e|0)==(c|0))m=c;else m=e&~(c>>31);c=a+112|0;if((k[c>>2]|0)<8)qe(a);e=a+108|0;d=k[e>>2]|0;f=d>>>24;g=k[2832+(b<<11)+(f<<3)+4>>2]|0;if(!g){h=k[a+148>>2]|0;e=k[a+140>>2]|0;c=Tg(a)|0;if((c|0)<(h+-1-e|0)){if(b)c=(Ug(a,b)|0)+(c<>31^c>>1;if((((c|0)>-1?c:0-c|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(c|0);fb(a|0)}else ub(c|0,824,96)}}else{k[c>>2]=(k[c>>2]|0)-g;k[e>>2]=d<>2]|0}h=a+136|0;d=k[h>>2]|0;if(!b){if(!d)e=(k[a+188+(l*12|0)+4>>2]<<1)+-1+(j[p>>1]|0)>>31;else e=0;g=e^c}else g=c;b=k[a+152>>2]|0;e=(k[o>>2]|0)+((g|0)>-1?g:0-g|0)|0;f=a+188+(l*12|0)+4|0;c=(k[f>>2]|0)+(ia(d<<1|1,g)|0)|0;d=j[p>>1]|0;if((d|0)==(b|0)){e=e>>1;c=c>>1;d=b>>1}k[o>>2]=e;b=d+1|0;j[p>>1]=b;e=b+c|0;if((e|0)>=1){if((c|0)>0){c=c-b|0;p=j[n>>1]|0;j[n>>1]=(p<<16>>16<127&1)+(p&65535);c=(c|0)>0?0:c}}else{c=j[n>>1]|0;j[n>>1]=(c&65535)-(c<<16>>16>-128&1);c=(e|0)>(~d|0)?e:0-d|0}k[f>>2]=c;b=k[h>>2]|0;d=b<<1|1;e=(ia(d,(g^r)-r|0)|0)+m|0;if((e|0)>=(0-b|0)){c=k[q>>2]|0;if((c+b|0)<(e|0))e=e-(ia(k[a+132>>2]|0,d)|0)|0}else{e=(ia(k[a+132>>2]|0,d)|0)+e|0;c=k[q>>2]|0}if((e&c|0)==(e|0)){a=e;a=a&65535;return a|0}a=c&~(e>>31);a=a&65535;return a|0}function gh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0;m=b+9|0;c=l[m>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;g=k[a+148>>2]|0;h=k[36476+(k[a+4592>>2]<<2)>>2]|0;c=k[a+140>>2]|0;e=Tg(a)|0;do if((e|0)<(g+-2-h-c|0))if(!d){d=k[f>>2]|0;a=d+e|0;c=a&1;a=(c+a|0)/2|0;j=8;break}else{h=(Ug(a,d)|0)+(e<>2]|0;e=h+d|0;g=e&1;c=g;f=1;e=(g+e|0)/2|0;break}else{e=(Ug(a,c)|0)+1|0;g=k[f>>2]|0;a=e+g|0;c=a&1;a=(c+a|0)/2|0;if(!d){d=g;j=8}else{h=e;f=1;e=a;d=g}}while(0);if((j|0)==8){h=e;f=l[b+10>>0]<<1>>>0>=(l[m>>0]|0)>>>0;e=a}e=(c|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(h+1-d>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[m>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){b=d;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[m>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=j;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}function hh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+136|0;a:do if(!(k[n>>2]|0)){c=k[a+128>>2]|0;b=a+144|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+176>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+180>>2]|0):0)?(k[d+12>>2]|0)==(k[a+184>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4604>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4604>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4604>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4604>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+144|0;while(0);m=1<>2];c=a+4608|0;d=m<<1;e=a+4612|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4604|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+184|0;j=a+180|0;g=a+176|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function ih(a){a=a|0;var b=0,c=0;k[a>>2]=35800;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function jh(a){a=a|0;var b=0,c=0;k[a>>2]=35800;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function kh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function lh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+128>>2]|0,k[a+136>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+176>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+180>>2]=f;k[a+184>>2]=e;th(a);e=a+132|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+188+(f*12|0)>>2]=b;k[a+188+(f*12|0)+4>>2]=0;j[a+188+(f*12|0)+8>>1]=0;j[a+188+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4568>>2]=h;k[a+4572>>2]=0;i[a+4576>>0]=l;i[a+4577>>0]=1;i[a+4578>>0]=0;k[a+4580>>2]=h;k[a+4584>>2]=1;i[a+4588>>0]=l;i[a+4589>>0]=1;i[a+4590>>0]=0;k[a+4592>>2]=0;r=g;return}function mh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4620>>0]=e&1;b=a+156|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);nh(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function nh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+172|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;a:do if(b){if(!(b>>>0>1431655765?(x=0,qa(178,C|0),B=x,x=0,B&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b*3|0)|0,B=x,x=0,!(B&1)):0){k[D>>2]=c;k[C>>2]=c;k[C+8>>2]=c+(b*3|0);while(1){i[c>>0]=0;i[c+1>>0]=0;i[c+2>>0]=0;c=(k[D>>2]|0)+3|0;k[D>>2]=c;b=b+-1|0;if(!b)break a}}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)f=19;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))f=17;if((f|0)==17?(d=y<<2,x=0,e=ta(67,d|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=e;f=e+(y<<2)|0;k[z+8>>2]=f;sw(e|0,0,d|0)|0;k[B>>2]=f;f=19;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){f=a+8|0;b:do if((k[f>>2]|0)>0){g=a+4596|0;h=ia(y,w)|0;j=h+1|0;l=a+4600|0;m=(y|0)>0;n=a+160|0;o=a+168|0;p=a+164|0;q=a+156|0;s=a+88|0;t=a+4592|0;u=0;c:while(1){d=k[C>>2]|0;c=d+3|0;k[g>>2]=c;d=d+(j*3|0)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];b=k[v>>2]|0;e=c+(b*3|0)|0;c=c+((b+-1|0)*3|0)|0;i[e>>0]=i[c>>0]|0;i[e+1>>0]=i[c+1>>0]|0;i[e+2>>0]=i[c+2>>0]|0;c=k[g>>2]|0;e=(k[l>>2]|0)+-3|0;i[e>>0]=i[c>>0]|0;i[e+1>>0]=i[c+1>>0]|0;i[e+2>>0]=i[c+2>>0]|0;x=0;ra(78,a|0,0);e=x;x=0;if(e&1){f=30;break c}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w*3|0)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w*3|0)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+(((k[q>>2]|0)-h|0)*3|0)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){f=31;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){f=43;break b}}if((f|0)==30){d=Wa()|0;break}else if((f|0)==31){d=Wa()|0;break}}else f=43;while(0);do if((f|0)==43){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}function oh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;M=r;r=r+16|0;C=M+12|0;L=M+9|0;K=M+6|0;D=M+3|0;E=M;F=a+172|0;b=k[F>>2]|0;if((b|0)<=0){r=M;return}G=a+4600|0;H=a+4596|0;I=a+4604|0;J=a+4592|0;B=0;while(1){y=B+-1|0;d=k[G>>2]|0;e=d+(y*3|0)|0;N=k[H>>2]|0;c=B+1|0;f=l[N+(B*3|0)>>0]|0;A=k[I>>2]|0;g=l[N+(y*3|0)>>0]|0;h=f-g|0;j=l[e>>0]|0;m=g-j|0;n=((((i[A+((l[N+(c*3|0)>>0]|0)-f)>>0]|0)*9|0)+(i[A+h>>0]|0)|0)*9|0)+(i[A+m>>0]|0)|0;o=l[N+(B*3|0)+1>>0]|0;p=l[N+(y*3|0)+1>>0]|0;q=o-p|0;s=l[d+(y*3|0)+1>>0]|0;t=p-s|0;u=((((i[A+((l[N+(c*3|0)+1>>0]|0)-o)>>0]|0)*9|0)+(i[A+q>>0]|0)|0)*9|0)+(i[A+t>>0]|0)|0;v=l[N+(B*3|0)+2>>0]|0;w=l[N+(y*3|0)+2>>0]|0;x=v-w|0;y=l[d+(y*3|0)+2>>0]|0;z=w-y|0;A=((((i[A+((l[N+(c*3|0)+2>>0]|0)-v)>>0]|0)*9|0)+(i[A+x>>0]|0)|0)*9|0)+(i[A+z>>0]|0)|0;if(!(u|n|A)){i[K>>0]=i[e>>0]|0;i[K+1>>0]=i[e+1>>0]|0;i[K+2>>0]=i[e+2>>0]|0;i[C>>0]=i[e>>0]|0;i[C+1>>0]=i[e+1>>0]|0;i[C+2>>0]=i[e+2>>0]|0;b=ph(a,C,d+(B*3|0)|0,b-B|0)|0;c=b+B|0;if((c|0)!=(k[F>>2]|0)){N=(k[H>>2]|0)+(c*3|0)|0;i[E>>0]=i[N>>0]|0;i[E+1>>0]=i[N+1>>0]|0;i[E+2>>0]=i[N+2>>0]|0;N=k[G>>2]|0;i[L>>0]=i[K>>0]|0;i[L+1>>0]=i[K+1>>0]|0;i[L+2>>0]=i[K+2>>0]|0;i[C>>0]=i[E>>0]|0;i[C+1>>0]=i[E+1>>0]|0;i[C+2>>0]=i[E+2>>0]|0;qh(D,a,L,C);N=N+(c*3|0)|0;i[N>>0]=i[D>>0]|0;i[N+1>>0]=i[D+1>>0]|0;i[N+2>>0]=i[D+2>>0]|0;N=k[J>>2]|0;k[J>>2]=(N|0)<1?0:N+-1|0;b=b+1|0}c=b+B|0}else{d=l[d+(B*3|0)>>0]|0;b=f-j>>31;if((b^m|0)>=0)if((b^h|0)<0)b=j;else b=j-g+f|0;else b=f;f=rh(a,n,d,b,0)|0;d=l[(k[G>>2]|0)+(B*3|0)+1>>0]|0;b=o-s>>31;if((b^t|0)>=0)if((b^q|0)<0)b=s;else b=s-p+o|0;else b=o;d=rh(a,u,d,b,0)|0;e=l[(k[G>>2]|0)+(B*3|0)+2>>0]|0;b=v-y>>31;if((b^z|0)>=0)if((b^x|0)<0)b=y;else b=y-w+v|0;else b=v;A=rh(a,A,e,b,0)|0;N=(k[G>>2]|0)+(B*3|0)|0;i[N>>0]=f;i[N+1>>0]=d;i[N+2>>0]=A}b=k[F>>2]|0;if((c|0)>=(b|0))break;else B=c}r=M;return}function ph(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;h=a+112|0;j=a+108|0;l=a+4592|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[j>>2]|0;e=e+-1|0;k[h>>2]=e;k[j>>2]=g<<1;if((g|0)>=0){m=8;break}g=k[l>>2]|0;n=1<>2];o=d-f|0;o=(n|0)<(o|0)?n:o;f=o+f|0;if((o|0)==(n|0))k[l>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((m|0)==8)if((f|0)!=(d|0)){e=k[l>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);o=x;x=0;if(o&1){o=Wa()|0;Ua(e|0);fb(o|0)}else ub(e|0,824,96)}}else e=d;if((e|0)<=0)return e|0;f=0;do{o=c+(f*3|0)|0;i[o>>0]=i[b>>0]|0;i[o+1>>0]=i[b+1>>0]|0;i[o+2>>0]=i[b+2>>0]|0;f=f+1|0}while((f|0)!=(e|0));return e|0}function qh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0;j=b+4568|0;o=sh(b,j)|0;g=sh(b,j)|0;j=sh(b,j)|0;f=b+128|0;e=l[d>>0]|0;m=k[b+136>>2]|0;n=m<<1|1;e=(ia(ia(n,o)|0,e-(l[c>>0]|0)>>31|1)|0)+e|0;o=0-m|0;if((e|0)>=(o|0)){f=k[f>>2]|0;if((f+m|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else{e=(ia(k[b+132>>2]|0,n)|0)+e|0;f=k[f>>2]|0}if((e&f|0)!=(e|0))e=f&~(e>>31);h=e&255;e=l[d+1>>0]|0;e=(ia(ia(n,g)|0,e-(l[c+1>>0]|0)>>31|1)|0)+e|0;if((e|0)>=(o|0)){if((f+m|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else e=(ia(k[b+132>>2]|0,n)|0)+e|0;if((e&f|0)!=(e|0))e=f&~(e>>31);g=e&255;e=l[d+2>>0]|0;e=(ia(ia(n,j)|0,e-(l[c+2>>0]|0)>>31|1)|0)+e|0;if((e|0)>=(o|0)){if((f+m|0)<(e|0))e=e-(ia(k[b+132>>2]|0,n)|0)|0}else e=(ia(k[b+132>>2]|0,n)|0)+e|0;if((e&f|0)==(e|0)){b=e;b=b&255;i[a>>0]=h;o=a+1|0;i[o>>0]=g;a=a+2|0;i[a>>0]=b;return}b=f&~(e>>31);b=b&255;i[a>>0]=h;o=a+1|0;i[o>>0]=g;a=a+2|0;i[a>>0]=b;return}function rh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;l=(r^b)-r|0;p=a+188+(l*12|0)+10|0;c=j[p>>1]|0;o=a+188+(l*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){b=5;while(1)if((c<>1]^r)-r+d|0;q=a+128|0;e=k[q>>2]|0;if((c&e|0)==(c|0))m=c;else m=e&~(c>>31);c=a+112|0;if((k[c>>2]|0)<8)qe(a);e=a+108|0;d=k[e>>2]|0;f=d>>>24;g=k[2832+(b<<11)+(f<<3)+4>>2]|0;if(!g){h=k[a+148>>2]|0;e=k[a+140>>2]|0;c=Tg(a)|0;if((c|0)<(h+-1-e|0)){if(b)c=(Ug(a,b)|0)+(c<>31^c>>1;if((((c|0)>-1?c:0-c|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(c|0);fb(a|0)}else ub(c|0,824,96)}}else{k[c>>2]=(k[c>>2]|0)-g;k[e>>2]=d<>2]|0}h=a+136|0;d=k[h>>2]|0;if(!b){if(!d)e=(k[a+188+(l*12|0)+4>>2]<<1)+-1+(j[p>>1]|0)>>31;else e=0;g=e^c}else g=c;b=k[a+152>>2]|0;e=(k[o>>2]|0)+((g|0)>-1?g:0-g|0)|0;f=a+188+(l*12|0)+4|0;c=(k[f>>2]|0)+(ia(d<<1|1,g)|0)|0;d=j[p>>1]|0;if((d|0)==(b|0)){e=e>>1;c=c>>1;d=b>>1}k[o>>2]=e;b=d+1|0;j[p>>1]=b;e=b+c|0;if((e|0)>=1){if((c|0)>0){c=c-b|0;p=j[n>>1]|0;j[n>>1]=(p<<16>>16<127&1)+(p&65535);c=(c|0)>0?0:c}}else{c=j[n>>1]|0;j[n>>1]=(c&65535)-(c<<16>>16>-128&1);c=(e|0)>(~d|0)?e:0-d|0}k[f>>2]=c;b=k[h>>2]|0;d=b<<1|1;e=(ia(d,(g^r)-r|0)|0)+m|0;if((e|0)>=(0-b|0)){c=k[q>>2]|0;if((c+b|0)<(e|0))e=e-(ia(k[a+132>>2]|0,d)|0)|0}else{e=(ia(k[a+132>>2]|0,d)|0)+e|0;c=k[q>>2]|0}if((e&c|0)==(e|0)){a=e;a=a&255;return a|0}a=c&~(e>>31);a=a&255;return a|0}function sh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0;m=b+9|0;c=l[m>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;g=k[a+148>>2]|0;h=k[36476+(k[a+4592>>2]<<2)>>2]|0;c=k[a+140>>2]|0;e=Tg(a)|0;do if((e|0)<(g+-2-h-c|0))if(!d){d=k[f>>2]|0;a=d+e|0;c=a&1;a=(c+a|0)/2|0;j=8;break}else{h=(Ug(a,d)|0)+(e<>2]|0;e=h+d|0;g=e&1;c=g;f=1;e=(g+e|0)/2|0;break}else{e=(Ug(a,c)|0)+1|0;g=k[f>>2]|0;a=e+g|0;c=a&1;a=(c+a|0)/2|0;if(!d){d=g;j=8}else{h=e;f=1;e=a;d=g}}while(0);if((j|0)==8){h=e;f=l[b+10>>0]<<1>>>0>=(l[m>>0]|0)>>>0;e=a}e=(c|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(h+1-d>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[m>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){b=d;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[m>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=j;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}function th(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+136|0;a:do if(!(k[n>>2]|0)){c=k[a+128>>2]|0;b=a+144|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+176>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+180>>2]|0):0)?(k[d+12>>2]|0)==(k[a+184>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4604>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4604>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4604>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4604>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+144|0;while(0);m=1<>2];c=a+4608|0;d=m<<1;e=a+4612|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4604|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+184|0;j=a+180|0;g=a+176|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function uh(a){a=a|0;var b=0,c=0;k[a>>2]=35772;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function vh(a){a=a|0;var b=0,c=0;k[a>>2]=35772;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function wh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function xh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,65535,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+152>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+156>>2]=f;k[a+160>>2]=d;Fh(a);d=0;do{k[a+164+(d*12|0)>>2]=1024;k[a+164+(d*12|0)+4>>2]=0;j[a+164+(d*12|0)+8>>1]=0;j[a+164+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4544>>2]=1024;k[a+4548>>2]=0;i[a+4552>>0]=h;i[a+4553>>0]=1;i[a+4554>>0]=0;k[a+4556>>2]=1024;k[a+4560>>2]=1;i[a+4564>>0]=h;i[a+4565>>0]=1;i[a+4566>>0]=0;k[a+4568>>2]=0;r=e;return}function yh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4596>>0]=e&1;b=a+132|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);zh(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function zh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+148|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,C|0),B=x,x=0,B&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,B=x,x=0,!(B&1)):0){k[C>>2]=d;B=d+(b<<1)|0;k[C+8>>2]=B;sw(d|0,0,c|0)|0;k[D>>2]=B;break}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)g=18;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))g=16;if((g|0)==16?(e=y<<2,x=0,f=ta(67,e|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=f;g=f+(y<<2)|0;k[z+8>>2]=g;sw(f|0,0,e|0)|0;k[B>>2]=g;g=18;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+8|0;a:do if((k[f>>2]|0)>0){g=a+4572|0;h=ia(y,w)|0;i=h+1|0;l=a+4576|0;m=(y|0)>0;n=a+136|0;o=a+144|0;p=a+140|0;q=a+132|0;s=a+88|0;t=a+4568|0;u=0;b:while(1){d=k[C>>2]|0;c=d+2|0;k[g>>2]=c;d=d+(i<<1)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];e=k[v>>2]|0;j[c+(e<<1)>>1]=j[c+(e+-1<<1)>>1]|0;j[b+-2>>1]=j[c>>1]|0;x=0;ra(79,a|0,0);e=x;x=0;if(e&1){g=29;break b}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w<<1)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w<<1)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+((k[q>>2]|0)-h<<1)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){g=30;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){g=42;break a}}if((g|0)==29){d=Wa()|0;break}else if((g|0)==30){d=Wa()|0;break}}else g=42;while(0);do if((g|0)==42){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function Ah(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;p=a+4572|0;b=k[p>>2]|0;s=a+148|0;if((k[s>>2]|0)<=0)return;q=a+4576|0;r=a+4580|0;e=b;f=m[b+-2>>1]|0;b=m[b>>1]|0;o=0;while(1){n=k[q>>2]|0;l=m[n+(o+-1<<1)>>1]|0;d=o+1|0;c=m[e+(d<<1)>>1]|0;h=k[r>>2]|0;g=b-f|0;e=f-l|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(Ch(a,o,0)|0)+o|0;c=k[p>>2]|0;b=m[c+(d+-1<<1)>>1]|0;c=m[c+(d<<1)>>1]|0}else{f=b-l>>31;if((f^e|0)<0)e=b;else e=l+((f^g|0)<0?0:g)|0;n=Bh(a,h,m[n+(o<<1)>>1]|0,e,0)|0;j[(k[q>>2]|0)+(o<<1)>>1]=n}if((d|0)>=(k[s>>2]|0))break;e=k[p>>2]|0;f=b;b=c;o=d}return}function Bh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;m=(q^b)-q|0;p=a+164+(m*12|0)+10|0;c=j[p>>1]|0;o=a+164+(m*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){f=5;while(1)if((c<>1]^q)-q+d|0;if((c&65535|0)!=(c|0))c=c>>31&65535^65535;e=a+112|0;if((k[e>>2]|0)<8)qe(a);d=a+108|0;g=k[d>>2]|0;h=g>>>24;l=k[2832+(f<<11)+(h<<3)+4>>2]|0;if(!l){e=Tg(a)|0;if((e|0)<47){if(f)e=(Ug(a,f)|0)+(e<>31^e>>1;if((((e|0)>-1?e:0-e|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}else ub(c|0,824,96)}}else{k[e>>2]=(k[e>>2]|0)-l;k[d>>2]=g<>2]|0}l=a+164+(m*12|0)+4|0;d=k[l>>2]|0;if(!f){a=j[p>>1]|0;f=a;e=(d<<1)+-1+(a<<16>>16)>>31^e}else f=j[p>>1]|0;g=f<<16>>16==64;a=g&1;h=d+e>>a;g=g?32:f<<16>>16;k[o>>2]=((e|0)>-1?e:0-e|0)+(k[o>>2]|0)>>a;d=g+1|0;j[p>>1]=d;f=d+h|0;if((f|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(f|0)>(~g|0)?f:0-g|0;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&65535;return b|0}if((h|0)<=0){p=h;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&65535;return b|0}p=h-d|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&65535;return b|0}function Ch(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=a+4576|0;e=k[f>>2]|0;c=j[e+(b+-1<<1)>>1]|0;g=a+148|0;e=Dh(a,c,e+(b<<1)|0,(k[g>>2]|0)-b|0)|0;d=e+b|0;if((d|0)==(k[g>>2]|0)){g=e;return g|0}c=c&65535;b=m[(k[a+4572>>2]|0)+(d<<1)>>1]|0;g=c-b|0;if((((g|0)>-1?g:0-g|0)|0)<1)c=(Eh(a,a+4556|0)|0)+c|0;else c=(ia(Eh(a,a+4544|0)|0,b-c>>31|1)|0)+b|0;j[(k[f>>2]|0)+(d<<1)>>1]=c;g=a+4568|0;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;g=e+1|0;return g|0}function Dh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0;h=a+112|0;l=a+108|0;m=a+4568|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[l>>2]|0;e=e+-1|0;k[h>>2]=e;k[l>>2]=g<<1;if((g|0)>=0){n=8;break}g=k[m>>2]|0;o=1<>2];p=d-f|0;p=(o|0)<(p|0)?o:p;f=p+f|0;if((p|0)==(o|0))k[m>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((n|0)==8)if((f|0)!=(d|0)){e=k[m>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);p=x;x=0;if(p&1){p=Wa()|0;Ua(e|0);fb(p|0)}else ub(e|0,824,96)}}else e=d;if((e|0)>0)f=0;else return e|0;do{j[c+(f<<1)>>1]=b;f=f+1|0}while((f|0)!=(e|0));return e|0}function Eh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;h=b+9|0;c=l[h>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;e=k[36476+(k[a+4568>>2]<<2)>>2]|0;c=Tg(a)|0;do if((c|0)<(46-e|0))if(!d){a=k[f>>2]|0;e=a+c|0;d=e&1;e=(d+e|0)/2|0;g=8;break}else{c=(Ug(a,d)|0)+(c<>2]|0;e=c+a|0;j=e&1;d=j;f=1;e=(j+e|0)/2|0;break}else{c=(Ug(a,16)|0)+1|0;a=k[f>>2]|0;e=c+a|0;f=e&1;e=(f+e|0)/2|0;if(!d){d=f;g=8}else{d=f;f=1}}while(0);if((g|0)==8)f=l[b+10>>0]<<1>>>0>=(l[h>>0]|0)>>>0;e=(d|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(c+1-a>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[h>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){j=d;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[h>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}function Fh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,65535,0);j=a+152|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+156>>2]|0):0)?(k[h+12>>2]|0)==(k[a+160>>2]|0):0){j=k[8909]|0;k[a+4580>>2]=j+(((k[8910]|0)-j|0)>>>1);r=l;return}c=a+4584|0;d=a+4588|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=131072){if(f>>>0>131072?(g=b+131072|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,131072-f|0);b=k[c>>2]|0}h=a+4580|0;k[h>>2]=b+65536;g=a+160|0;e=a+156|0;f=-65536;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==65536)break}r=l;return}function Gh(a){a=a|0;var b=0,c=0;k[a>>2]=35744;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Hh(a){a=a|0;var b=0,c=0;k[a>>2]=35744;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Ih(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(37,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==16)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(38,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(39,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(40,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=2;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Jh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,4095,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+152>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+156>>2]=f;k[a+160>>2]=d;Rh(a);d=0;do{k[a+164+(d*12|0)>>2]=64;k[a+164+(d*12|0)+4>>2]=0;j[a+164+(d*12|0)+8>>1]=0;j[a+164+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4544>>2]=64;k[a+4548>>2]=0;i[a+4552>>0]=h;i[a+4553>>0]=1;i[a+4554>>0]=0;k[a+4556>>2]=64;k[a+4560>>2]=1;i[a+4564>>0]=h;i[a+4565>>0]=1;i[a+4566>>0]=0;k[a+4568>>2]=0;r=e;return}function Kh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4596>>0]=e&1;b=a+132|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);Lh(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function Lh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+148|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;do if(b){if(!((b|0)<0?(x=0,qa(178,C|0),B=x,x=0,B&1):0))g=6;if((g|0)==6?(c=b<<1,x=0,d=ta(67,c|0)|0,B=x,x=0,!(B&1)):0){k[C>>2]=d;B=d+(b<<1)|0;k[C+8>>2]=B;sw(d|0,0,c|0)|0;k[D>>2]=B;break}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)g=18;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))g=16;if((g|0)==16?(e=y<<2,x=0,f=ta(67,e|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=f;g=f+(y<<2)|0;k[z+8>>2]=g;sw(f|0,0,e|0)|0;k[B>>2]=g;g=18;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((g|0)==18){f=a+8|0;a:do if((k[f>>2]|0)>0){g=a+4572|0;h=ia(y,w)|0;i=h+1|0;l=a+4576|0;m=(y|0)>0;n=a+136|0;o=a+144|0;p=a+140|0;q=a+132|0;s=a+88|0;t=a+4568|0;u=0;b:while(1){d=k[C>>2]|0;c=d+2|0;k[g>>2]=c;d=d+(i<<1)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];e=k[v>>2]|0;j[c+(e<<1)>>1]=j[c+(e+-1<<1)>>1]|0;j[b+-2>>1]=j[c>>1]|0;x=0;ra(80,a|0,0);e=x;x=0;if(e&1){g=29;break b}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w<<1)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w<<1)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+((k[q>>2]|0)-h<<1)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){g=30;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){g=42;break a}}if((g|0)==29){d=Wa()|0;break}else if((g|0)==30){d=Wa()|0;break}}else g=42;while(0);do if((g|0)==42){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~((c+-2-b|0)>>>1)<<1);mj(b);fb(d|0)}function Mh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0,n=0,o=0,p=0,q=0,r=0,s=0;p=a+4572|0;b=k[p>>2]|0;s=a+148|0;if((k[s>>2]|0)<=0)return;q=a+4576|0;r=a+4580|0;e=b;f=m[b+-2>>1]|0;b=m[b>>1]|0;o=0;while(1){n=k[q>>2]|0;l=m[n+(o+-1<<1)>>1]|0;d=o+1|0;c=m[e+(d<<1)>>1]|0;h=k[r>>2]|0;g=b-f|0;e=f-l|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(Oh(a,o,0)|0)+o|0;c=k[p>>2]|0;b=m[c+(d+-1<<1)>>1]|0;c=m[c+(d<<1)>>1]|0}else{f=b-l>>31;if((f^e|0)<0)e=b;else e=l+((f^g|0)<0?0:g)|0;n=Nh(a,h,m[n+(o<<1)>>1]|0,e,0)|0;j[(k[q>>2]|0)+(o<<1)>>1]=n}if((d|0)>=(k[s>>2]|0))break;e=k[p>>2]|0;f=b;b=c;o=d}return}function Nh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;m=(q^b)-q|0;p=a+164+(m*12|0)+10|0;c=j[p>>1]|0;o=a+164+(m*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){f=5;while(1)if((c<>1]^q)-q+d|0;if((c&4095|0)!=(c|0))c=c>>31&4095^4095;e=a+112|0;if((k[e>>2]|0)<8)qe(a);d=a+108|0;g=k[d>>2]|0;h=g>>>24;l=k[2832+(f<<11)+(h<<3)+4>>2]|0;if(!l){e=Tg(a)|0;if((e|0)<35){if(f)e=(Ug(a,f)|0)+(e<>31^e>>1;if((((e|0)>-1?e:0-e|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}else ub(c|0,824,96)}}else{k[e>>2]=(k[e>>2]|0)-l;k[d>>2]=g<>2]|0}l=a+164+(m*12|0)+4|0;d=k[l>>2]|0;if(!f){a=j[p>>1]|0;f=a;e=(d<<1)+-1+(a<<16>>16)>>31^e}else f=j[p>>1]|0;g=f<<16>>16==64;a=g&1;h=d+e>>a;g=g?32:f<<16>>16;k[o>>2]=((e|0)>-1?e:0-e|0)+(k[o>>2]|0)>>a;d=g+1|0;j[p>>1]=d;f=d+h|0;if((f|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(f|0)>(~g|0)?f:0-g|0;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}if((h|0)<=0){p=h;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}p=h-d|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&4095;b=b&65535;return b|0}function Oh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=a+4576|0;e=k[f>>2]|0;c=j[e+(b+-1<<1)>>1]|0;g=a+148|0;e=Ph(a,c,e+(b<<1)|0,(k[g>>2]|0)-b|0)|0;d=e+b|0;if((d|0)==(k[g>>2]|0)){g=e;return g|0}c=c&65535;b=m[(k[a+4572>>2]|0)+(d<<1)>>1]|0;g=c-b|0;if((((g|0)>-1?g:0-g|0)|0)<1)c=(Qh(a,a+4556|0)|0)+c|0;else c=(ia(Qh(a,a+4544|0)|0,b-c>>31|1)|0)+b|0;j[(k[f>>2]|0)+(d<<1)>>1]=c&4095;g=a+4568|0;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;g=e+1|0;return g|0}function Ph(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0;h=a+112|0;l=a+108|0;m=a+4568|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[l>>2]|0;e=e+-1|0;k[h>>2]=e;k[l>>2]=g<<1;if((g|0)>=0){n=8;break}g=k[m>>2]|0;o=1<>2];p=d-f|0;p=(o|0)<(p|0)?o:p;f=p+f|0;if((p|0)==(o|0))k[m>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((n|0)==8)if((f|0)!=(d|0)){e=k[m>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);p=x;x=0;if(p&1){p=Wa()|0;Ua(e|0);fb(p|0)}else ub(e|0,824,96)}}else e=d;if((e|0)>0)f=0;else return e|0;do{j[c+(f<<1)>>1]=b;f=f+1|0}while((f|0)!=(e|0));return e|0}function Qh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;h=b+9|0;c=l[h>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;e=k[36476+(k[a+4568>>2]<<2)>>2]|0;c=Tg(a)|0;do if((c|0)<(34-e|0))if(!d){a=k[f>>2]|0;e=a+c|0;d=e&1;e=(d+e|0)/2|0;g=8;break}else{c=(Ug(a,d)|0)+(c<>2]|0;e=c+a|0;j=e&1;d=j;f=1;e=(j+e|0)/2|0;break}else{c=(Ug(a,12)|0)+1|0;a=k[f>>2]|0;e=c+a|0;f=e&1;e=(f+e|0)/2|0;if(!d){d=f;g=8}else{d=f;f=1}}while(0);if((g|0)==8)f=l[b+10>>0]<<1>>>0>=(l[h>>0]|0)>>>0;e=(d|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(c+1-a>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[h>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){j=d;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[h>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}function Rh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,4095,0);j=a+152|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+156>>2]|0):0)?(k[h+12>>2]|0)==(k[a+160>>2]|0):0){j=k[8906]|0;k[a+4580>>2]=j+(((k[8907]|0)-j|0)>>>1);r=l;return}c=a+4584|0;d=a+4588|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=8192){if(f>>>0>8192?(g=b+8192|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,8192-f|0);b=k[c>>2]|0}h=a+4580|0;k[h>>2]=b+4096;g=a+160|0;e=a+156|0;f=-4096;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==4096)break}r=l;return}function Sh(a){a=a|0;var b=0,c=0;k[a>>2]=35716;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function Th(a){a=a|0;var b=0,c=0;k[a>>2]=35716;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function Uh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function Vh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,255,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+152>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+156>>2]=f;k[a+160>>2]=d;bi(a);d=0;do{k[a+164+(d*12|0)>>2]=4;k[a+164+(d*12|0)+4>>2]=0;j[a+164+(d*12|0)+8>>1]=0;j[a+164+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4544>>2]=4;k[a+4548>>2]=0;i[a+4552>>0]=h;i[a+4553>>0]=1;i[a+4554>>0]=0;k[a+4556>>2]=4;k[a+4560>>2]=1;i[a+4564>>0]=h;i[a+4565>>0]=1;i[a+4566>>0]=0;k[a+4568>>2]=0;r=e;return}function Wh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4596>>0]=e&1;b=a+132|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);Xh(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function Xh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+148|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;a:do if(b){if(!((b|0)<0?(x=0,qa(178,C|0),B=x,x=0,B&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b|0)|0,B=x,x=0,!(B&1)):0){k[D>>2]=c;k[C>>2]=c;k[C+8>>2]=c+b;while(1){i[c>>0]=0;c=(k[D>>2]|0)+1|0;k[D>>2]=c;b=b+-1|0;if(!b)break a}}c=Wa()|0;b=k[C>>2]|0;if(!b)fb(c|0);if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);fb(c|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)f=19;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))f=17;if((f|0)==17?(d=y<<2,x=0,e=ta(67,d|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=e;f=e+(y<<2)|0;k[z+8>>2]=f;sw(e|0,0,d|0)|0;k[B>>2]=f;f=19;break}c=Wa()|0;b=k[z>>2]|0;d=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){f=a+8|0;b:do if((k[f>>2]|0)>0){g=a+4572|0;h=ia(y,w)|0;j=h+1|0;l=a+4576|0;m=(y|0)>0;n=a+136|0;o=a+144|0;p=a+140|0;q=a+132|0;s=a+88|0;t=a+4568|0;u=0;c:while(1){d=k[C>>2]|0;c=d+1|0;k[g>>2]=c;d=d+j|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];e=k[v>>2]|0;i[c+e>>0]=i[c+(e+-1)>>0]|0;i[(k[l>>2]|0)+-1>>0]=i[k[g>>2]>>0]|0;x=0;ra(81,a|0,0);e=x;x=0;if(e&1){f=30;break c}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+w|0;k[g>>2]=c;b=(k[l>>2]|0)+w|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+((k[q>>2]|0)-h)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){f=31;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){f=43;break b}}if((f|0)==30){c=Wa()|0;break}else if((f|0)==31){c=Wa()|0;break}}else f=43;while(0);do if((f|0)==43){x=0;qa(183,a|0);a=x;x=0;if(a&1){c=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);r=A;return}while(0);b=k[z>>2]|0;d=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(c|0);if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);fb(c|0)}function Yh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0;o=a+4572|0;b=k[o>>2]|0;r=a+148|0;if((k[r>>2]|0)<=0)return;p=a+4576|0;q=a+4580|0;e=b;f=l[b+-1>>0]|0;b=l[b>>0]|0;n=0;while(1){m=k[p>>2]|0;j=l[m+(n+-1)>>0]|0;d=n+1|0;c=l[e+d>>0]|0;h=k[q>>2]|0;g=b-f|0;e=f-j|0;h=((((i[h+(c-b)>>0]|0)*9|0)+(i[h+g>>0]|0)|0)*9|0)+(i[h+e>>0]|0)|0;if(!h){d=(_h(a,n,0)|0)+n|0;c=k[o>>2]|0;b=l[c+(d+-1)>>0]|0;c=l[c+d>>0]|0}else{f=b-j>>31;if((f^e|0)<0)e=b;else e=j+((f^g|0)<0?0:g)|0;m=Zh(a,h,l[m+n>>0]|0,e,0)|0;i[(k[p>>2]|0)+n>>0]=m}if((d|0)>=(k[r>>2]|0))break;e=k[o>>2]|0;f=b;b=c;n=d}return}function Zh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;m=(q^b)-q|0;p=a+164+(m*12|0)+10|0;c=j[p>>1]|0;o=a+164+(m*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){f=5;while(1)if((c<>1]^q)-q+d|0;if((c&255|0)!=(c|0))c=c>>31&255^255;e=a+112|0;if((k[e>>2]|0)<8)qe(a);d=a+108|0;g=k[d>>2]|0;h=g>>>24;l=k[2832+(f<<11)+(h<<3)+4>>2]|0;if(!l){e=Tg(a)|0;if((e|0)<23){if(f)e=(Ug(a,f)|0)+(e<>31^e>>1;if((((e|0)>-1?e:0-e|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}else ub(c|0,824,96)}}else{k[e>>2]=(k[e>>2]|0)-l;k[d>>2]=g<>2]|0}l=a+164+(m*12|0)+4|0;d=k[l>>2]|0;if(!f){a=j[p>>1]|0;f=a;e=(d<<1)+-1+(a<<16>>16)>>31^e}else f=j[p>>1]|0;g=f<<16>>16==64;a=g&1;h=d+e>>a;g=g?32:f<<16>>16;k[o>>2]=((e|0)>-1?e:0-e|0)+(k[o>>2]|0)>>a;d=g+1|0;j[p>>1]=d;f=d+h|0;if((f|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(f|0)>(~g|0)?f:0-g|0;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}if((h|0)<=0){p=h;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}p=h-d|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}function _h(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=a+4576|0;e=k[f>>2]|0;c=i[e+(b+-1)>>0]|0;g=a+148|0;e=$h(a,c,e+b|0,(k[g>>2]|0)-b|0)|0;d=e+b|0;if((d|0)==(k[g>>2]|0)){g=e;return g|0}c=c&255;b=l[(k[a+4572>>2]|0)+d>>0]|0;g=c-b|0;if((((g|0)>-1?g:0-g|0)|0)<1)c=(ai(a,a+4556|0)|0)+c|0;else c=(ia(ai(a,a+4544|0)|0,b-c>>31|1)|0)+b|0;i[(k[f>>2]|0)+d>>0]=c;g=a+4568|0;a=k[g>>2]|0;k[g>>2]=(a|0)<1?0:a+-1|0;g=e+1|0;return g|0}function $h(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;h=a+112|0;j=a+108|0;l=a+4568|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[j>>2]|0;e=e+-1|0;k[h>>2]=e;k[j>>2]=g<<1;if((g|0)>=0){m=8;break}g=k[l>>2]|0;n=1<>2];o=d-f|0;o=(n|0)<(o|0)?n:o;f=o+f|0;if((o|0)==(n|0))k[l>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((m|0)==8)if((f|0)!=(d|0)){e=k[l>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);o=x;x=0;if(o&1){o=Wa()|0;Ua(e|0);fb(o|0)}else ub(e|0,824,96)}}else e=d;if((e|0)<=0)return e|0;sw(c|0,b|0,e|0)|0;return e|0}function ai(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;h=b+9|0;c=l[h>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;e=k[36476+(k[a+4568>>2]<<2)>>2]|0;c=Tg(a)|0;do if((c|0)<(22-e|0))if(!d){a=k[f>>2]|0;e=a+c|0;d=e&1;e=(d+e|0)/2|0;g=8;break}else{c=(Ug(a,d)|0)+(c<>2]|0;e=c+a|0;j=e&1;d=j;f=1;e=(j+e|0)/2|0;break}else{c=(Ug(a,8)|0)+1|0;a=k[f>>2]|0;e=c+a|0;f=e&1;e=(f+e|0)/2|0;if(!d){d=f;g=8}else{d=f;f=1}}while(0);if((g|0)==8)f=l[b+10>>0]<<1>>>0>=(l[h>>0]|0)>>>0;e=(d|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(c+1-a>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[h>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){j=d;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[h>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}function bi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,255,0);j=a+152|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+156>>2]|0):0)?(k[h+12>>2]|0)==(k[a+160>>2]|0):0){j=k[8900]|0;k[a+4580>>2]=j+(((k[8901]|0)-j|0)>>>1);r=l;return}c=a+4584|0;d=a+4588|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=512){if(f>>>0>512?(g=b+512|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,512-f|0);b=k[c>>2]|0}h=a+4580|0;k[h>>2]=b+256;g=a+160|0;e=a+156|0;f=-256;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==256)break}r=l;return}function ci(a){a=a|0;var b=0,c=0;k[a>>2]=35688;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function di(a){a=a|0;var b=0,c=0;k[a>>2]=35688;b=k[a+4584>>2]|0;if(b){c=a+4588|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function ei(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=3;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function fi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+32|0;h=e;Oi(h,255,0);g=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[h+8>>2]|0:f;d=k[b+12>>2]|0;d=(d|0)==0?k[h+12>>2]|0:d;b=k[b+16>>2]|0;c=k[h+16>>2]|0;k[a+152>>2]=(g|0)==0?k[h+4>>2]|0:g;k[a+156>>2]=f;k[a+160>>2]=d;ni(a);d=0;do{k[a+164+(d*12|0)>>2]=4;k[a+164+(d*12|0)+4>>2]=0;j[a+164+(d*12|0)+8>>1]=0;j[a+164+(d*12|0)+10>>1]=1;d=d+1|0}while((d|0)!=365);h=((b|0)==0?c:b)&255;k[a+4544>>2]=4;k[a+4548>>2]=0;i[a+4552>>0]=h;i[a+4553>>0]=1;i[a+4554>>0]=0;k[a+4556>>2]=4;k[a+4560>>2]=1;i[a+4564>>0]=h;i[a+4565>>0]=1;i[a+4566>>0]=0;k[a+4568>>2]=0;r=e;return}function gi(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4596>>0]=e&1;b=a+132|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);hi(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function hi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;v=a+148|0;w=(k[v>>2]|0)+4|0;if((k[a+28>>2]|0)==1)y=k[a+20>>2]|0;else y=1;b=ia(y<<1,w)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;a:do if(b){if(!(b>>>0>1431655765?(x=0,qa(178,C|0),B=x,x=0,B&1):0))f=6;if((f|0)==6?(x=0,c=ta(67,b*3|0)|0,B=x,x=0,!(B&1)):0){k[D>>2]=c;k[C>>2]=c;k[C+8>>2]=c+(b*3|0);while(1){i[c>>0]=0;i[c+1>>0]=0;i[c+2>>0]=0;c=(k[D>>2]|0)+3|0;k[D>>2]=c;b=b+-1|0;if(!b)break a}}d=Wa()|0;b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!y)f=19;else{if(!(y>>>0>1073741823?(x=0,qa(178,z|0),u=x,x=0,u&1):0))f=17;if((f|0)==17?(d=y<<2,x=0,e=ta(67,d|0)|0,u=x,x=0,!(u&1)):0){k[z>>2]=e;f=e+(y<<2)|0;k[z+8>>2]=f;sw(e|0,0,d|0)|0;k[B>>2]=f;f=19;break}d=Wa()|0;b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}while(0);if((f|0)==19){f=a+8|0;b:do if((k[f>>2]|0)>0){g=a+4572|0;h=ia(y,w)|0;j=h+1|0;l=a+4576|0;m=(y|0)>0;n=a+136|0;o=a+144|0;p=a+140|0;q=a+132|0;s=a+88|0;t=a+4568|0;u=0;c:while(1){d=k[C>>2]|0;c=d+3|0;k[g>>2]=c;d=d+(j*3|0)|0;k[l>>2]=d;if(!(u&1))b=d;else{k[g>>2]=d;k[l>>2]=c;b=c;c=d}if(m){e=k[z>>2]|0;d=0;do{k[t>>2]=k[e+(d<<2)>>2];b=k[v>>2]|0;e=c+(b*3|0)|0;c=c+((b+-1|0)*3|0)|0;i[e>>0]=i[c>>0]|0;i[e+1>>0]=i[c+1>>0]|0;i[e+2>>0]=i[c+2>>0]|0;c=k[g>>2]|0;e=(k[l>>2]|0)+-3|0;i[e>>0]=i[c>>0]|0;i[e+1>>0]=i[c+1>>0]|0;i[e+2>>0]=i[c+2>>0]|0;x=0;ra(82,a|0,0);e=x;x=0;if(e&1){f=30;break c}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[t>>2];c=(k[g>>2]|0)+(w*3|0)|0;k[g>>2]=c;b=(k[l>>2]|0)+(w*3|0)|0;k[l>>2]=b;d=d+1|0}while((d|0)<(y|0))}e=k[n>>2]|0;if(((e|0)<=(u|0)?(u|0)<((k[o>>2]|0)+e|0):0)?(e=k[s>>2]|0,x=0,Ja(k[(k[e>>2]|0)+8>>2]|0,e|0,b+(((k[q>>2]|0)-h|0)*3|0)|0,k[p>>2]|0,w|0),e=x,x=0,e&1):0){f=31;break}u=u+1|0;if((u|0)>=(k[f>>2]|0)){f=43;break b}}if((f|0)==30){d=Wa()|0;break}else if((f|0)==31){d=Wa()|0;break}}else f=43;while(0);do if((f|0)==43){x=0;qa(183,a|0);a=x;x=0;if(a&1){d=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);r=A;return}while(0);b=k[z>>2]|0;c=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-c|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(d|0);c=k[D>>2]|0;if((c|0)!=(b|0))k[D>>2]=c+(~(((c+-3-b|0)>>>0)/3|0)*3|0);mj(b);fb(d|0)}function ii(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;A=a+148|0;if((k[A>>2]|0)<=0)return;B=a+4576|0;C=a+4572|0;D=a+4580|0;z=0;while(1){w=z+-1|0;f=k[B>>2]|0;g=k[C>>2]|0;b=z+1|0;e=l[g+(z*3|0)>>0]|0;y=k[D>>2]|0;h=l[g+(w*3|0)>>0]|0;j=e-h|0;m=l[f+(w*3|0)>>0]|0;n=h-m|0;o=((((i[y+((l[g+(b*3|0)>>0]|0)-e)>>0]|0)*9|0)+(i[y+j>>0]|0)|0)*9|0)+(i[y+n>>0]|0)|0;d=l[g+(z*3|0)+1>>0]|0;p=l[g+(w*3|0)+1>>0]|0;q=d-p|0;r=l[f+(w*3|0)+1>>0]|0;s=p-r|0;t=((((i[y+((l[g+(b*3|0)+1>>0]|0)-d)>>0]|0)*9|0)+(i[y+q>>0]|0)|0)*9|0)+(i[y+s>>0]|0)|0;c=l[g+(z*3|0)+2>>0]|0;u=l[g+(w*3|0)+2>>0]|0;v=c-u|0;w=l[f+(w*3|0)+2>>0]|0;x=u-w|0;y=((((i[y+((l[g+(b*3|0)+2>>0]|0)-c)>>0]|0)*9|0)+(i[y+v>>0]|0)|0)*9|0)+(i[y+x>>0]|0)|0;if(!(t|o|y))b=(ji(a,z,0)|0)+z|0;else{g=l[f+(z*3|0)>>0]|0;f=e-m>>31;if((f^n|0)>=0)if((f^j|0)<0)e=m;else e=m-h+e|0;g=ki(a,o,g,e,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+1>>0]|0;e=d-r>>31;if((e^s|0)>=0)if((e^q|0)<0)d=r;else d=r-p+d|0;e=ki(a,t,f,d,0)|0;f=l[(k[B>>2]|0)+(z*3|0)+2>>0]|0;d=c-w>>31;if((d^x|0)>=0)if((d^v|0)<0)c=w;else c=w-u+c|0;y=ki(a,y,f,c,0)|0;z=(k[B>>2]|0)+(z*3|0)|0;i[z>>0]=g;i[z+1>>0]=e;i[z+2>>0]=y}if((b|0)<(k[A>>2]|0))z=b;else break}return}function ji(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;j=r;r=r+16|0;m=j+3|0;n=j;f=a+4576|0;c=k[f>>2]|0;d=c+((b+-1|0)*3|0)|0;g=i[d>>0]|0;h=i[d+1>>0]|0;d=i[d+2>>0]|0;i[n>>0]=g;i[n+1>>0]=h;i[n+2>>0]=d;l=a+148|0;e=(k[l>>2]|0)-b|0;i[m>>0]=i[n>>0]|0;i[m+1>>0]=i[n+1>>0]|0;i[m+2>>0]=i[n+2>>0]|0;e=li(a,m,c+(b*3|0)|0,e)|0;c=e+b|0;if((c|0)==(k[l>>2]|0)){n=e;r=j;return n|0}m=(k[a+4572>>2]|0)+(c*3|0)|0;b=i[m>>0]|0;l=i[m+1>>0]|0;m=i[m+2>>0]|0;n=k[f>>2]|0;f=a+4544|0;p=mi(a,f)|0;o=mi(a,f)|0;b=b&255;b=(ia(b-(g&255)>>31|1,p)|0)+b&255;l=l&255;l=(ia(l-(h&255)>>31|1,o)|0)+l&255;m=m&255;m=(ia(m-(d&255)>>31|1,mi(a,f)|0)|0)+m&255;n=n+(c*3|0)|0;i[n>>0]=b;i[n+1>>0]=l;i[n+2>>0]=m;n=a+4568|0;m=k[n>>2]|0;k[n>>2]=(m|0)<1?0:m+-1|0;n=e+1|0;r=j;return n|0}function ki(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;q=b>>31;m=(q^b)-q|0;p=a+164+(m*12|0)+10|0;c=j[p>>1]|0;o=a+164+(m*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){f=5;while(1)if((c<>1]^q)-q+d|0;if((c&255|0)!=(c|0))c=c>>31&255^255;e=a+112|0;if((k[e>>2]|0)<8)qe(a);d=a+108|0;g=k[d>>2]|0;h=g>>>24;l=k[2832+(f<<11)+(h<<3)+4>>2]|0;if(!l){e=Tg(a)|0;if((e|0)<23){if(f)e=(Ug(a,f)|0)+(e<>31^e>>1;if((((e|0)>-1?e:0-e|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}else ub(c|0,824,96)}}else{k[e>>2]=(k[e>>2]|0)-l;k[d>>2]=g<>2]|0}l=a+164+(m*12|0)+4|0;d=k[l>>2]|0;if(!f){a=j[p>>1]|0;f=a;e=(d<<1)+-1+(a<<16>>16)>>31^e}else f=j[p>>1]|0;g=f<<16>>16==64;a=g&1;h=d+e>>a;g=g?32:f<<16>>16;k[o>>2]=((e|0)>-1?e:0-e|0)+(k[o>>2]|0)>>a;d=g+1|0;j[p>>1]=d;f=d+h|0;if((f|0)<1){p=j[n>>1]|0;j[n>>1]=(p&65535)-(p<<16>>16>-128&1);p=(f|0)>(~g|0)?f:0-g|0;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}if((h|0)<=0){p=h;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}p=h-d|0;o=j[n>>1]|0;j[n>>1]=(o<<16>>16<127&1)+(o&65535);p=(p|0)>0?0:p;k[l>>2]=p;q=e^q;b=b>>>31;b=c+b|0;b=b+q|0;b=b&255;return b|0}function li(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;h=a+112|0;j=a+108|0;l=a+4568|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[j>>2]|0;e=e+-1|0;k[h>>2]=e;k[j>>2]=g<<1;if((g|0)>=0){m=8;break}g=k[l>>2]|0;n=1<>2];o=d-f|0;o=(n|0)<(o|0)?n:o;f=o+f|0;if((o|0)==(n|0))k[l>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((m|0)==8)if((f|0)!=(d|0)){e=k[l>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);o=x;x=0;if(o&1){o=Wa()|0;Ua(e|0);fb(o|0)}else ub(e|0,824,96)}}else e=d;if((e|0)<=0)return e|0;f=0;do{o=c+(f*3|0)|0;i[o>>0]=i[b>>0]|0;i[o+1>>0]=i[b+1>>0]|0;i[o+2>>0]=i[b+2>>0]|0;f=f+1|0}while((f|0)!=(e|0));return e|0}function mi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;h=b+9|0;c=l[h>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;e=k[36476+(k[a+4568>>2]<<2)>>2]|0;c=Tg(a)|0;do if((c|0)<(22-e|0))if(!d){a=k[f>>2]|0;e=a+c|0;d=e&1;e=(d+e|0)/2|0;g=8;break}else{c=(Ug(a,d)|0)+(c<>2]|0;e=c+a|0;j=e&1;d=j;f=1;e=(j+e|0)/2|0;break}else{c=(Ug(a,8)|0)+1|0;a=k[f>>2]|0;e=c+a|0;f=e&1;e=(f+e|0)/2|0;if(!d){d=f;g=8}else{d=f;f=1}}while(0);if((g|0)==8)f=l[b+10>>0]<<1>>>0>=(l[h>>0]|0)>>>0;e=(d|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(c+1-a>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[h>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){j=d;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[h>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;j=j&255;j=j+1|0;j=j&255;i[h>>0]=j;return e|0} -function Vp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+128|0;f=m;o=m+116|0;p=m+104|0;h=m+20|0;l=m+16|0;j=m+12|0;n=m+8|0;g=m+4|0;i[o>>0]=i[58887]|0;i[o+1>>0]=i[58888]|0;i[o+2>>0]=i[58889]|0;i[o+3>>0]=i[58890]|0;i[o+4>>0]=i[58891]|0;i[o+5>>0]=i[58892]|0;Ep(o+1|0,58893,0,k[c+4>>2]|0);a=fp()|0;k[f>>2]=e;e=p+(av(p,12,a,o,f)|0)|0;o=Fp(p,e,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(3,p|0,o|0,e|0,h|0,l|0,j|0,n|0);e=x;x=0;if(e&1){p=Wa()|0;zm(a)|0;fb(p|0)}else{zm(a)|0;k[g>>2]=k[b>>2];o=k[l>>2]|0;p=k[j>>2]|0;k[f>>2]=k[g>>2];p=cv(f,h,o,p,c,d)|0;r=m;return p|0}return 0}function Wp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;m=r;r=r+240|0;g=m+8|0;a=m;o=m+204|0;i=m+32|0;l=m+28|0;j=m+24|0;n=m+20|0;h=m+16|0;p=a;k[p>>2]=37;k[p+4>>2]=0;Ep(a+1|0,58895,0,k[c+4>>2]|0);p=fp()|0;q=g;k[q>>2]=e;k[q+4>>2]=f;f=o+(av(o,23,p,a,g)|0)|0;e=Fp(o,f,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(3,o|0,e|0,f|0,i|0,l|0,j|0,n|0);f=x;x=0;if(f&1){q=Wa()|0;zm(a)|0;fb(q|0)}else{zm(a)|0;k[h>>2]=k[b>>2];p=k[l>>2]|0;q=k[j>>2]|0;k[g>>2]=k[h>>2];q=cv(g,i,p,q,c,d)|0;r=m;return q|0}return 0}function Xp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;z=r;r=r+352|0;t=z+312|0;n=z+48|0;m=z+32|0;i=z+24|0;f=z+8|0;l=z;q=z+316|0;s=z+80|0;h=z+84|0;y=z+76|0;w=z+72|0;u=z+68|0;v=z+64|0;j=l;k[j>>2]=37;k[j+4>>2]=0;j=Lp(l+1|0,58898,k[c+4>>2]|0)|0;k[s>>2]=q;a=fp()|0;if(j){k[f>>2]=k[c+8>>2];p[f+8>>3]=e;f=av(q,30,a,l,f)|0}else{p[i>>3]=e;f=av(q,30,a,l,i)|0}a:do if((f|0)>29){x=0;a=Da(3)|0;f=x;x=0;f=f&1;if(j){if(!f?(x=0,k[m>>2]=k[c+8>>2],p[m+8>>3]=e,g=Ea(17,s|0,a|0,l|0,m|0)|0,o=x,x=0,!(o&1)):0)A=12}else if(!f?(x=0,k[n>>2]=k[c+8>>2],p[n+8>>3]=e,o=Ea(17,s|0,a|0,l|0,n|0)|0,n=x,x=0,!(n&1)):0){g=o;A=12}do if((A|0)==12){a=k[s>>2]|0;if(!a){x=0;Ga(6);o=x;x=0;if(o&1)break;f=k[s>>2]|0}else f=a;a=f;l=f;A=16;break a}while(0);a=Wa()|0}else{a=k[s>>2]|0;l=0;g=f;A=16}while(0);if((A|0)==16){i=a+g|0;j=Fp(a,i,c)|0;do if((a|0)==(q|0)){a=q;f=0;A=22}else{g=Pl(g<<3)|0;if(!g){x=0;Ga(6);A=x;x=0;if(A&1){f=0;A=20;break}a=k[s>>2]|0}f=g;h=g;A=22}while(0);do if((A|0)==22){x=0;g=ta(68,c|0)|0;s=x;x=0;if(!(s&1)){k[u>>2]=g;x=0;ya(4,a|0,j|0,i|0,h|0,y|0,w|0,u|0);u=x;x=0;if(u&1){a=Wa()|0;zm(g)|0;break}zm(g)|0;k[v>>2]=k[b>>2];A=k[y>>2]|0;a=k[w>>2]|0;x=0;k[t>>2]=k[v>>2];a=sa(40,t|0,h|0,A|0,a|0,c|0,d|0)|0;A=x;x=0;if(!(A&1)){k[b>>2]=a;if(f)Ql(f);if(l)Ql(l);r=z;return a|0}else A=20}else A=20}while(0);if((A|0)==20)a=Wa()|0;if(f)Ql(f);if(l)Ql(l)}fb(a|0);return 0}function Yp(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;y=r;r=r+16|0;z=y;w=Ss(g,44212)|0;u=Ss(g,44368)|0;Mb[k[(k[u>>2]|0)+20>>2]&127](z,u);k[f>>2]=d;g=i[a>>0]|0;switch(g<<24>>24){case 43:case 45:{x=0;g=Aa(k[(k[w>>2]|0)+44>>2]|0,w|0,g|0)|0;v=x;x=0;if(v&1)t=8;else{l=k[f>>2]|0;k[f>>2]=l+4;k[l>>2]=g;l=a+1|0;t=10}break}default:{l=a;t=10}}a:do if((t|0)==10){v=c;b:do if((v-l|0)>1?(i[l>>0]|0)==48:0){h=l+1|0;switch(i[h>>0]|0){case 88:case 120:break;default:{t=11;break b}}x=0;g=Aa(k[(k[w>>2]|0)+44>>2]|0,w|0,48)|0;s=x;x=0;if(s&1){t=8;break a}s=k[f>>2]|0;k[f>>2]=s+4;k[s>>2]=g;l=l+2|0;x=0;g=Aa(k[(k[w>>2]|0)+44>>2]|0,w|0,i[h>>0]|0)|0;s=x;x=0;if(s&1){t=8;break a}s=k[f>>2]|0;k[f>>2]=s+4;k[s>>2]=g;if(l>>>0>>0){g=l;while(1){h=i[g>>0]|0;x=0;j=Da(3)|0;s=x;x=0;if(s&1)break;x=0;h=Aa(39,h<<24>>24|0,j|0)|0;s=x;x=0;if(s&1)break;if(!h){s=l;break b}g=g+1|0;if(g>>>0>=c>>>0){s=l;break b}}g=Wa()|0;break a}else{s=l;g=l}}else t=11;while(0);c:do if((t|0)==11)if(l>>>0>>0){g=l;while(1){h=i[g>>0]|0;x=0;j=Da(3)|0;s=x;x=0;if(s&1)break;x=0;h=Aa(40,h<<24>>24|0,j|0)|0;s=x;x=0;if(s&1)break;if(!h){s=l;break c}g=g+1|0;if(g>>>0>=c>>>0){s=l;break c}}g=Wa()|0;break a}else{s=l;g=l}while(0);p=i[z>>0]|0;q=z+4|0;if(((p&1)==0?(p&255)>>>1:k[q>>2]|0)|0){if((s|0)!=(g|0)?(m=g+-1|0,s>>>0>>0):0){j=s;h=m;do{p=i[j>>0]|0;i[j>>0]=i[h>>0]|0;i[h>>0]=p;j=j+1|0;h=h+-1|0}while(j>>>0>>0)}x=0;m=ta(k[(k[u>>2]|0)+16>>2]|0,u|0)|0;p=x;x=0;if(p&1){t=8;break}n=z+8|0;o=z+1|0;d:do if(s>>>0>>0){h=0;j=0;p=s;while(1){l=i[((i[z>>0]&1)==0?o:k[n>>2]|0)+j>>0]|0;if(l<<24>>24>0&(h|0)==(l<<24>>24|0)){h=k[f>>2]|0;k[f>>2]=h+4;k[h>>2]=m;h=i[z>>0]|0;l=0;j=(j>>>0<(((h&1)==0?(h&255)>>>1:k[q>>2]|0)+-1|0)>>>0&1)+j|0}else l=h;x=0;h=Aa(k[(k[w>>2]|0)+44>>2]|0,w|0,i[p>>0]|0)|0;A=x;x=0;if(A&1)break;A=k[f>>2]|0;k[f>>2]=A+4;k[A>>2]=h;p=p+1|0;if(p>>>0>=g>>>0)break d;else h=l+1|0}g=Wa()|0;break a}while(0);h=d+(s-a<<2)|0;l=k[f>>2]|0;if((h|0)!=(l|0)){j=l+-4|0;if(h>>>0>>0){do{A=k[h>>2]|0;k[h>>2]=k[j>>2];k[j>>2]=A;h=h+4|0;j=j+-4|0}while(h>>>0>>0);m=w;h=l}else{m=w;h=l}}else m=w}else{x=0;Ea(k[(k[w>>2]|0)+48>>2]|0,w|0,s|0,g|0,k[f>>2]|0)|0;A=x;x=0;if(A&1){t=8;break}h=(k[f>>2]|0)+(g-s<<2)|0;k[f>>2]=h;m=w}e:do if(g>>>0>>0){while(1){h=i[g>>0]|0;if(h<<24>>24==46){j=g;break}x=0;j=Aa(k[(k[m>>2]|0)+44>>2]|0,w|0,h|0)|0;A=x;x=0;if(A&1){t=4;break}A=k[f>>2]|0;h=A+4|0;k[f>>2]=h;k[A>>2]=j;g=g+1|0;if(g>>>0>=c>>>0)break e}if((t|0)==4){g=Wa()|0;break a}x=0;g=ta(k[(k[u>>2]|0)+12>>2]|0,u|0)|0;A=x;x=0;if(A&1){t=8;break a}A=k[f>>2]|0;h=A+4|0;k[f>>2]=h;k[A>>2]=g;g=j+1|0}while(0);x=0;Ea(k[(k[w>>2]|0)+48>>2]|0,w|0,g|0,c|0,h|0)|0;A=x;x=0;if(A&1)t=8;else{A=(k[f>>2]|0)+(v-g<<2)|0;k[f>>2]=A;k[e>>2]=(b|0)==(c|0)?A:d+(b-a<<2)|0;Sm(z);r=y;return}}while(0);if((t|0)==8)g=Wa()|0;Sm(z);fb(g|0)}function Zp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;z=r;r=r+352|0;t=z+304|0;n=z+48|0;m=z+32|0;i=z+24|0;f=z+8|0;l=z;q=z+308|0;s=z+72|0;h=z+76|0;y=z+68|0;w=z+64|0;u=z+60|0;v=z+56|0;j=l;k[j>>2]=37;k[j+4>>2]=0;j=Lp(l+1|0,58899,k[c+4>>2]|0)|0;k[s>>2]=q;a=fp()|0;if(j){k[f>>2]=k[c+8>>2];p[f+8>>3]=e;f=av(q,30,a,l,f)|0}else{p[i>>3]=e;f=av(q,30,a,l,i)|0}a:do if((f|0)>29){x=0;a=Da(3)|0;f=x;x=0;f=f&1;if(j){if(!f?(x=0,k[m>>2]=k[c+8>>2],p[m+8>>3]=e,g=Ea(17,s|0,a|0,l|0,m|0)|0,o=x,x=0,!(o&1)):0)A=12}else if(!f?(x=0,p[n>>3]=e,o=Ea(17,s|0,a|0,l|0,n|0)|0,n=x,x=0,!(n&1)):0){g=o;A=12}do if((A|0)==12){a=k[s>>2]|0;if(!a){x=0;Ga(6);o=x;x=0;if(o&1)break;f=k[s>>2]|0}else f=a;a=f;l=f;A=16;break a}while(0);a=Wa()|0}else{a=k[s>>2]|0;l=0;g=f;A=16}while(0);if((A|0)==16){i=a+g|0;j=Fp(a,i,c)|0;do if((a|0)==(q|0)){a=q;f=0;A=22}else{g=Pl(g<<3)|0;if(!g){x=0;Ga(6);A=x;x=0;if(A&1){f=0;A=20;break}a=k[s>>2]|0}f=g;h=g;A=22}while(0);do if((A|0)==22){x=0;g=ta(68,c|0)|0;s=x;x=0;if(!(s&1)){k[u>>2]=g;x=0;ya(4,a|0,j|0,i|0,h|0,y|0,w|0,u|0);u=x;x=0;if(u&1){a=Wa()|0;zm(g)|0;break}zm(g)|0;k[v>>2]=k[b>>2];A=k[y>>2]|0;a=k[w>>2]|0;x=0;k[t>>2]=k[v>>2];a=sa(40,t|0,h|0,A|0,a|0,c|0,d|0)|0;A=x;x=0;if(!(A&1)){k[b>>2]=a;if(f)Ql(f);if(l)Ql(l);r=z;return a|0}else A=20}else A=20}while(0);if((A|0)==20)a=Wa()|0;if(f)Ql(f);if(l)Ql(l)}fb(a|0);return 0}function _p(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;o=r;r=r+192|0;j=o;a=o+180|0;m=o+160|0;n=o+12|0;h=o+8|0;l=o+4|0;i[a>>0]=i[58901]|0;i[a+1>>0]=i[58902]|0;i[a+2>>0]=i[58903]|0;i[a+3>>0]=i[58904]|0;i[a+4>>0]=i[58905]|0;i[a+5>>0]=i[58906]|0;f=fp()|0;k[j>>2]=e;a=av(m,20,f,a,j)|0;e=m+a|0;f=Fp(m,e,c)|0;g=tn(c)|0;k[h>>2]=g;x=0;h=Aa(37,h|0,44212)|0;p=x;x=0;if(p&1){p=Wa()|0;zm(g)|0;fb(p|0)}else{zm(g)|0;Zb[k[(k[h>>2]|0)+48>>2]&31](h,m,e,n)|0;p=n+(a<<2)|0;k[l>>2]=k[b>>2];k[j>>2]=k[l>>2];p=cv(j,n,(f|0)==(e|0)?p:n+(f-m<<2)|0,p,c,d)|0;r=o;return p|0}return 0}function $p(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0;C=r;r=r+32|0;v=C+16|0;u=C+12|0;z=C+8|0;w=C+4|0;y=C;m=tn(d)|0;k[z>>2]=m;x=0;z=Aa(37,z|0,44220)|0;t=x;x=0;if(t&1){C=Wa()|0;zm(m)|0;fb(C|0)}zm(m)|0;k[e>>2]=0;t=z+8|0;m=k[b>>2]|0;a:do if((g|0)!=(h|0)){b:while(1){n=m;if(m){if((k[m+12>>2]|0)==(k[m+16>>2]|0)?(Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0)==-1:0){k[b>>2]=0;m=0;n=0}}else m=0;q=(m|0)==0;p=k[c>>2]|0;o=p;do if(p){if((k[p+12>>2]|0)==(k[p+16>>2]|0)?(Ob[k[(k[p>>2]|0)+36>>2]&127](p)|0)==-1:0){k[c>>2]=0;o=0;B=12;break}if(!q){B=13;break b}}else B=12;while(0);if((B|0)==12){B=0;if(q){B=13;break}else p=0}c:do if((Qb[k[(k[z>>2]|0)+36>>2]&63](z,i[g>>0]|0,0)|0)<<24>>24==37){p=g+1|0;if((p|0)==(h|0)){B=17;break b}s=Qb[k[(k[z>>2]|0)+36>>2]&63](z,i[p>>0]|0,0)|0;switch(s<<24>>24){case 48:case 69:{q=g+2|0;if((q|0)==(h|0)){B=20;break b}g=p;p=Qb[k[(k[z>>2]|0)+36>>2]&63](z,i[q>>0]|0,0)|0;m=s;break}default:{p=s;m=0}}s=k[(k[a>>2]|0)+36>>2]|0;k[w>>2]=n;k[y>>2]=o;k[u>>2]=k[w>>2];k[v>>2]=k[y>>2];s=ac[s&15](a,u,v,d,e,f,p,m)|0;k[b>>2]=s;g=g+2|0}else{n=i[g>>0]|0;if(n<<24>>24>-1?(A=k[t>>2]|0,(j[A+(n<<24>>24<<1)>>1]&8192)!=0):0){do{g=g+1|0;if((g|0)==(h|0)){g=h;break}n=i[g>>0]|0;if(n<<24>>24<=-1)break}while((j[A+(n<<24>>24<<1)>>1]&8192)!=0);n=p;while(1){if(m){if((k[m+12>>2]|0)==(k[m+16>>2]|0)?(Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0)==-1:0){k[b>>2]=0;m=0}}else m=0;o=(m|0)==0;do if(p){if((k[p+12>>2]|0)!=(k[p+16>>2]|0))if(o){s=n;break}else break c;if((Ob[k[(k[p>>2]|0)+36>>2]&127](p)|0)!=-1)if(o^(n|0)==0){s=n;p=n;break}else break c;else{k[c>>2]=0;n=0;B=39;break}}else B=39;while(0);if((B|0)==39){B=0;if(o)break c;else{s=n;p=0}}o=m+12|0;n=k[o>>2]|0;q=m+16|0;if((n|0)==(k[q>>2]|0))n=Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0;else n=l[n>>0]|0;if((n&255)<<24>>24<=-1)break c;if(!(j[(k[t>>2]|0)+(n<<24>>24<<1)>>1]&8192))break c;n=k[o>>2]|0;if((n|0)==(k[q>>2]|0)){Ob[k[(k[m>>2]|0)+40>>2]&127](m)|0;n=s;continue}else{k[o>>2]=n+1;n=s;continue}}}o=m+12|0;n=k[o>>2]|0;p=m+16|0;if((n|0)==(k[p>>2]|0))n=Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0;else n=l[n>>0]|0;s=Vb[k[(k[z>>2]|0)+12>>2]&63](z,n&255)|0;if(s<<24>>24!=(Vb[k[(k[z>>2]|0)+12>>2]&63](z,i[g>>0]|0)|0)<<24>>24){B=57;break b}n=k[o>>2]|0;if((n|0)==(k[p>>2]|0))Ob[k[(k[m>>2]|0)+40>>2]&127](m)|0;else k[o>>2]=n+1;g=g+1|0}while(0);m=k[b>>2]|0;if(!((g|0)!=(h|0)&(k[e>>2]|0)==0))break a}if((B|0)==13){k[e>>2]=4;break}else if((B|0)==17){k[e>>2]=4;break}else if((B|0)==20){k[e>>2]=4;break}else if((B|0)==57){k[e>>2]=4;m=k[b>>2]|0;break}}while(0);if(m){if((k[m+12>>2]|0)==(k[m+16>>2]|0)?(Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0)==-1:0){k[b>>2]=0;m=0}}else m=0;g=(m|0)==0;n=k[c>>2]|0;do if(n){if((k[n+12>>2]|0)==(k[n+16>>2]|0)?(Ob[k[(k[n>>2]|0)+36>>2]&127](n)|0)==-1:0){k[c>>2]=0;B=67;break}if(!g)B=68}else B=67;while(0);if((B|0)==67?g:0)B=68;if((B|0)==68)k[e>>2]=k[e>>2]|2;r=C;return m|0}function aq(a){a=a|0;return}function bq(a){a=a|0;mj(a);return}function cq(a){a=a|0;return 2}function dq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=$p(a,i,h,d,e,f,58907,58915)|0;r=g;return a|0}function eq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0;g=r;r=r+16|0;h=g+12|0;j=g+8|0;m=g+4|0;l=g;n=a+8|0;n=Ob[k[(k[n>>2]|0)+20>>2]&127](n)|0;k[m>>2]=k[b>>2];k[l>>2]=k[c>>2];c=i[n>>0]|0;o=(c&1)==0;b=o?n+1|0:k[n+8>>2]|0;c=b+(o?(c&255)>>>1:k[n+4>>2]|0)|0;k[j>>2]=k[m>>2];k[h>>2]=k[l>>2];a=$p(a,j,h,d,e,f,b,c)|0;r=g;return a|0}function fq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44220)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];gq(a,f+24|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function gq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=r;r=r+16|0;h=g+4|0;i=g;a=a+8|0;a=Ob[k[k[a>>2]>>2]&127](a)|0;k[i>>2]=k[d>>2];k[h>>2]=k[i>>2];c=(Hu(c,h,a,a+168|0,f,e,0)|0)-a|0;if((c|0)<168)k[b>>2]=((c|0)/12|0|0)%7|0;r=g;return}function hq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44220)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];iq(a,f+16|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function iq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=r;r=r+16|0;h=g+4|0;i=g;a=a+8|0;a=Ob[k[(k[a>>2]|0)+4>>2]&127](a)|0;k[i>>2]=k[d>>2];k[h>>2]=k[i>>2];c=(Hu(c,h,a,a+288|0,f,e,0)|0)-a|0;if((c|0)<288)k[b>>2]=((c|0)/12|0|0)%12|0;r=g;return}function jq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44220)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];kq(a,f+20|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function kq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,4)|0;if(!(k[e>>2]&4)){if((a|0)<69)a=a+2e3|0;else a=(a+-69|0)>>>0<31?a+1900|0:a;k[b>>2]=a+-1900}r=g;return}function lq(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;U=r;r=r+144|0;j=U+132|0;h=U+116|0;N=U+128|0;w=U+124|0;I=U+120|0;O=U+112|0;P=U+108|0;Q=U+104|0;R=U+100|0;S=U+96|0;T=U+92|0;l=U+88|0;m=U+84|0;n=U+80|0;o=U+76|0;p=U+72|0;q=U+68|0;s=U+64|0;t=U+60|0;u=U+56|0;v=U+52|0;y=U+48|0;z=U+44|0;A=U+40|0;B=U+36|0;C=U+32|0;D=U+28|0;E=U+24|0;F=U+20|0;G=U+16|0;H=U+12|0;J=U+8|0;K=U+4|0;L=U;k[e>>2]=0;M=tn(d)|0;k[N>>2]=M;x=0;N=Aa(37,N|0,44220)|0;W=x;x=0;if(W&1){W=Wa()|0;zm(M)|0;fb(W|0)}zm(M)|0;do switch(g<<24>>24|0){case 65:case 97:{k[w>>2]=k[c>>2];k[j>>2]=k[w>>2];gq(a,f+24|0,b,j,e,N);V=28;break}case 104:case 66:case 98:{k[I>>2]=k[c>>2];k[j>>2]=k[I>>2];iq(a,f+16|0,b,j,e,N);V=28;break}case 99:{V=a+8|0;V=Ob[k[(k[V>>2]|0)+12>>2]&127](V)|0;k[O>>2]=k[b>>2];k[P>>2]=k[c>>2];g=i[V>>0]|0;c=(g&1)==0;W=c?V+1|0:k[V+8>>2]|0;V=W+(c?(g&255)>>>1:k[V+4>>2]|0)|0;k[h>>2]=k[O>>2];k[j>>2]=k[P>>2];V=$p(a,h,j,d,e,f,W,V)|0;k[b>>2]=V;V=28;break}case 101:case 100:{k[Q>>2]=k[c>>2];k[j>>2]=k[Q>>2];mq(a,f+12|0,b,j,e,N);V=28;break}case 68:{k[R>>2]=k[b>>2];k[S>>2]=k[c>>2];k[h>>2]=k[R>>2];k[j>>2]=k[S>>2];V=$p(a,h,j,d,e,f,58915,58923)|0;k[b>>2]=V;V=28;break}case 70:{k[T>>2]=k[b>>2];k[l>>2]=k[c>>2];k[h>>2]=k[T>>2];k[j>>2]=k[l>>2];V=$p(a,h,j,d,e,f,58923,58931)|0;k[b>>2]=V;V=28;break}case 72:{k[m>>2]=k[c>>2];k[j>>2]=k[m>>2];nq(a,f+8|0,b,j,e,N);V=28;break}case 73:{k[n>>2]=k[c>>2];k[j>>2]=k[n>>2];oq(a,f+8|0,b,j,e,N);V=28;break}case 106:{k[o>>2]=k[c>>2];k[j>>2]=k[o>>2];pq(a,f+28|0,b,j,e,N);V=28;break}case 109:{k[p>>2]=k[c>>2];k[j>>2]=k[p>>2];qq(a,f+16|0,b,j,e,N);V=28;break}case 77:{k[q>>2]=k[c>>2];k[j>>2]=k[q>>2];rq(a,f+4|0,b,j,e,N);V=28;break}case 116:case 110:{k[s>>2]=k[c>>2];k[j>>2]=k[s>>2];sq(a,b,j,e,N);V=28;break}case 112:{k[t>>2]=k[c>>2];k[j>>2]=k[t>>2];tq(a,f+8|0,b,j,e,N);V=28;break}case 114:{k[u>>2]=k[b>>2];k[v>>2]=k[c>>2];k[h>>2]=k[u>>2];k[j>>2]=k[v>>2];V=$p(a,h,j,d,e,f,58931,58942)|0;k[b>>2]=V;V=28;break}case 82:{k[y>>2]=k[b>>2];k[z>>2]=k[c>>2];k[h>>2]=k[y>>2];k[j>>2]=k[z>>2];V=$p(a,h,j,d,e,f,58942,58947)|0;k[b>>2]=V;V=28;break}case 83:{k[A>>2]=k[c>>2];k[j>>2]=k[A>>2];uq(a,f,b,j,e,N);V=28;break}case 84:{k[B>>2]=k[b>>2];k[C>>2]=k[c>>2];k[h>>2]=k[B>>2];k[j>>2]=k[C>>2];V=$p(a,h,j,d,e,f,58947,58955)|0;k[b>>2]=V;V=28;break}case 119:{k[D>>2]=k[c>>2];k[j>>2]=k[D>>2];vq(a,f+24|0,b,j,e,N);V=28;break}case 120:{W=k[(k[a>>2]|0)+20>>2]|0;k[E>>2]=k[b>>2];k[F>>2]=k[c>>2];k[h>>2]=k[E>>2];k[j>>2]=k[F>>2];h=Nb[W&63](a,h,j,d,e,f)|0;break}case 88:{V=a+8|0;V=Ob[k[(k[V>>2]|0)+24>>2]&127](V)|0;k[G>>2]=k[b>>2];k[H>>2]=k[c>>2];g=i[V>>0]|0;c=(g&1)==0;W=c?V+1|0:k[V+8>>2]|0;V=W+(c?(g&255)>>>1:k[V+4>>2]|0)|0;k[h>>2]=k[G>>2];k[j>>2]=k[H>>2];V=$p(a,h,j,d,e,f,W,V)|0;k[b>>2]=V;V=28;break}case 121:{k[J>>2]=k[c>>2];k[j>>2]=k[J>>2];kq(a,f+20|0,b,j,e,N);V=28;break}case 89:{k[K>>2]=k[c>>2];k[j>>2]=k[K>>2];wq(a,f+20|0,b,j,e,N);V=28;break}case 37:{k[L>>2]=k[c>>2];k[j>>2]=k[L>>2];xq(a,b,j,e,N);V=28;break}default:{k[e>>2]=k[e>>2]|4;V=28}}while(0);if((V|0)==28)h=k[b>>2]|0;r=U;return h|0}function mq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a+-1|0)>>>0<31&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function nq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<24&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function oq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a+-1|0)>>>0<12&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function pq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,3)|0;c=k[e>>2]|0;if((a|0)<366&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function qq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<13&(c&4|0)==0)k[b>>2]=a+-1;else k[e>>2]=c|4;r=g;return}function rq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<60&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function sq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=e+8|0;a:while(1){e=k[b>>2]|0;do if(e){if((k[e+12>>2]|0)==(k[e+16>>2]|0))if((Ob[k[(k[e>>2]|0)+36>>2]&127](e)|0)==-1){k[b>>2]=0;e=0;break}else{e=k[b>>2]|0;break}}else e=0;while(0);e=(e|0)==0;a=k[c>>2]|0;do if(a){if((k[a+12>>2]|0)!=(k[a+16>>2]|0))if(e)break;else break a;if((Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)!=-1)if(e)break;else break a;else{k[c>>2]=0;h=12;break}}else h=12;while(0);if((h|0)==12){h=0;if(e){a=0;break}else a=0}e=k[b>>2]|0;f=k[e+12>>2]|0;if((f|0)==(k[e+16>>2]|0))e=Ob[k[(k[e>>2]|0)+36>>2]&127](e)|0;else e=l[f>>0]|0;if((e&255)<<24>>24<=-1)break;if(!(j[(k[g>>2]|0)+(e<<24>>24<<1)>>1]&8192))break;e=k[b>>2]|0;a=e+12|0;f=k[a>>2]|0;if((f|0)==(k[e+16>>2]|0)){Ob[k[(k[e>>2]|0)+40>>2]&127](e)|0;continue}else{k[a>>2]=f+1;continue}}e=k[b>>2]|0;do if(e){if((k[e+12>>2]|0)==(k[e+16>>2]|0))if((Ob[k[(k[e>>2]|0)+36>>2]&127](e)|0)==-1){k[b>>2]=0;e=0;break}else{e=k[b>>2]|0;break}}else e=0;while(0);e=(e|0)==0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)?(Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1:0){k[c>>2]=0;h=32;break}if(!e)h=33}else h=32;while(0);if((h|0)==32?e:0)h=33;if((h|0)==33)k[d>>2]=k[d>>2]|2;return}function tq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0;m=r;r=r+16|0;h=m+4|0;j=m;l=a+8|0;l=Ob[k[(k[l>>2]|0)+8>>2]&127](l)|0;a=i[l>>0]|0;if(!(a&1))g=(a&255)>>>1;else g=k[l+4>>2]|0;a=i[l+12>>0]|0;if(!(a&1))a=(a&255)>>>1;else a=k[l+16>>2]|0;do if((g|0)!=(0-a|0)){k[j>>2]=k[d>>2];k[h>>2]=k[j>>2];a=Hu(c,h,l,l+24|0,f,e,0)|0;g=k[b>>2]|0;if((a|0)==(l|0)&(g|0)==12){k[b>>2]=0;break}if((g|0)<12&(a-l|0)==12)k[b>>2]=g+12}else k[e>>2]=k[e>>2]|4;while(0);r=m;return}function uq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<61&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function vq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,1)|0;c=k[e>>2]|0;if((a|0)<7&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function wq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=dv(c,a,e,f,4)|0;if(!(k[e>>2]&4))k[b>>2]=a+-1900;r=g;return}function xq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;a=k[b>>2]|0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0))if((Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1){k[b>>2]=0;a=0;break}else{a=k[b>>2]|0;break}}else a=0;while(0);f=(a|0)==0;a=k[c>>2]|0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)?(Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1:0){k[c>>2]=0;h=11;break}if(f){g=a;h=13}else h=12}else h=11;while(0);if((h|0)==11)if(f)h=12;else{g=0;h=13}a:do if((h|0)==12)k[d>>2]=k[d>>2]|6;else if((h|0)==13){a=k[b>>2]|0;f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=l[f>>0]|0;if((Qb[k[(k[e>>2]|0)+36>>2]&63](e,a&255,0)|0)<<24>>24!=37){k[d>>2]=k[d>>2]|4;break}a=k[b>>2]|0;f=a+12|0;e=k[f>>2]|0;if((e|0)==(k[a+16>>2]|0)){Ob[k[(k[a>>2]|0)+40>>2]&127](a)|0;a=k[b>>2]|0;if(!a)a=0;else h=21}else{k[f>>2]=e+1;h=21}do if((h|0)==21)if((k[a+12>>2]|0)==(k[a+16>>2]|0))if((Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1){k[b>>2]=0;a=0;break}else{a=k[b>>2]|0;break}while(0);a=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)?(Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0)==-1:0){k[c>>2]=0;h=30;break}if(a)break a}else h=30;while(0);if((h|0)==30?!a:0)break;k[d>>2]=k[d>>2]|2}while(0);return}function yq(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;w=r;r=r+32|0;q=w+16|0;p=w+12|0;u=w+8|0;s=w+4|0;t=w;i=tn(d)|0;k[u>>2]=i;x=0;u=Aa(37,u|0,44212)|0;o=x;x=0;if(o&1){w=Wa()|0;zm(i)|0;fb(w|0)}zm(i)|0;k[e>>2]=0;i=k[b>>2]|0;a:do if((g|0)!=(h|0)){b:while(1){l=i;if(i){j=k[i+12>>2]|0;if((j|0)==(k[i+16>>2]|0))j=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else j=k[j>>2]|0;if((j|0)==-1){k[b>>2]=0;i=0;n=1;o=0}else{n=0;o=l}}else{i=0;n=1;o=l}m=k[c>>2]|0;j=m;do if(m){l=k[m+12>>2]|0;if((l|0)==(k[m+16>>2]|0))l=Ob[k[(k[m>>2]|0)+36>>2]&127](m)|0;else l=k[l>>2]|0;if((l|0)!=-1)if(n)break;else{v=17;break b}else{k[c>>2]=0;j=0;v=15;break}}else v=15;while(0);if((v|0)==15){v=0;if(n){v=17;break}else m=0}c:do if((Qb[k[(k[u>>2]|0)+52>>2]&63](u,k[g>>2]|0,0)|0)<<24>>24==37){l=g+4|0;if((l|0)==(h|0)){v=21;break b}n=Qb[k[(k[u>>2]|0)+52>>2]&63](u,k[l>>2]|0,0)|0;switch(n<<24>>24){case 48:case 69:{m=g+8|0;if((m|0)==(h|0)){v=24;break b}g=l;l=Qb[k[(k[u>>2]|0)+52>>2]&63](u,k[m>>2]|0,0)|0;i=n;break}default:{l=n;i=0}}n=k[(k[a>>2]|0)+36>>2]|0;k[s>>2]=o;k[t>>2]=j;k[p>>2]=k[s>>2];k[q>>2]=k[t>>2];o=ac[n&15](a,p,q,d,e,f,l,i)|0;k[b>>2]=o;g=g+8|0}else{if(!(Qb[k[(k[u>>2]|0)+12>>2]&63](u,8192,k[g>>2]|0)|0)){l=i+12|0;j=k[l>>2]|0;m=i+16|0;if((j|0)==(k[m>>2]|0))j=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else j=k[j>>2]|0;o=Vb[k[(k[u>>2]|0)+28>>2]&63](u,j)|0;if((o|0)!=(Vb[k[(k[u>>2]|0)+28>>2]&63](u,k[g>>2]|0)|0)){v=61;break b}j=k[l>>2]|0;if((j|0)==(k[m>>2]|0))Ob[k[(k[i>>2]|0)+40>>2]&127](i)|0;else k[l>>2]=j+4;g=g+4|0;break}do{g=g+4|0;if((g|0)==(h|0)){g=h;break}}while(Qb[k[(k[u>>2]|0)+12>>2]&63](u,8192,k[g>>2]|0)|0);j=m;n=m;while(1){if(i){l=k[i+12>>2]|0;if((l|0)==(k[i+16>>2]|0))l=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else l=k[l>>2]|0;if((l|0)==-1){k[b>>2]=0;m=1;i=0}else m=0}else{m=1;i=0}do if(n){l=k[n+12>>2]|0;if((l|0)==(k[n+16>>2]|0))l=Ob[k[(k[n>>2]|0)+36>>2]&127](n)|0;else l=k[l>>2]|0;if((l|0)!=-1)if(m^(j|0)==0){o=j;n=j;break}else break c;else{k[c>>2]=0;j=0;v=44;break}}else v=44;while(0);if((v|0)==44){v=0;if(m)break c;else{o=j;n=0}}l=i+12|0;j=k[l>>2]|0;m=i+16|0;if((j|0)==(k[m>>2]|0))j=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else j=k[j>>2]|0;if(!(Qb[k[(k[u>>2]|0)+12>>2]&63](u,8192,j)|0))break c;j=k[l>>2]|0;if((j|0)==(k[m>>2]|0)){Ob[k[(k[i>>2]|0)+40>>2]&127](i)|0;j=o;continue}else{k[l>>2]=j+4;j=o;continue}}}while(0);i=k[b>>2]|0;if(!((g|0)!=(h|0)&(k[e>>2]|0)==0))break a}if((v|0)==17){k[e>>2]=4;break}else if((v|0)==21){k[e>>2]=4;break}else if((v|0)==24){k[e>>2]=4;break}else if((v|0)==61){k[e>>2]=4;i=k[b>>2]|0;break}}while(0);if(i){g=k[i+12>>2]|0;if((g|0)==(k[i+16>>2]|0))g=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else g=k[g>>2]|0;if((g|0)==-1){k[b>>2]=0;i=0;l=1}else l=0}else{i=0;l=1}g=k[c>>2]|0;do if(g){j=k[g+12>>2]|0;if((j|0)==(k[g+16>>2]|0))g=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else g=k[j>>2]|0;if((g|0)!=-1)if(l)break;else{v=76;break}else{k[c>>2]=0;v=74;break}}else v=74;while(0);if((v|0)==74?l:0)v=76;if((v|0)==76)k[e>>2]=k[e>>2]|2;r=w;return i|0}function zq(a){a=a|0;return}function Aq(a){a=a|0;mj(a);return}function Bq(a){a=a|0;return 2}function Cq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=yq(a,i,h,d,e,f,44788,44820)|0;r=g;return a|0}function Dq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;g=r;r=r+16|0;h=g+12|0;j=g+8|0;m=g+4|0;l=g;p=a+8|0;p=Ob[k[(k[p>>2]|0)+20>>2]&127](p)|0;k[m>>2]=k[b>>2];k[l>>2]=k[c>>2];n=i[p>>0]|0;o=(n&1)==0;c=p+4|0;b=o?c:k[p+8>>2]|0;c=b+((o?(n&255)>>>1:k[c>>2]|0)<<2)|0;k[j>>2]=k[m>>2];k[h>>2]=k[l>>2];a=yq(a,j,h,d,e,f,b,c)|0;r=g;return a|0}function Eq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44212)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];Fq(a,f+24|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function Fq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=r;r=r+16|0;h=g+4|0;i=g;a=a+8|0;a=Ob[k[k[a>>2]>>2]&127](a)|0;k[i>>2]=k[d>>2];k[h>>2]=k[i>>2];c=(Su(c,h,a,a+168|0,f,e,0)|0)-a|0;if((c|0)<168)k[b>>2]=((c|0)/12|0|0)%7|0;r=g;return}function Gq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44212)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];Hq(a,f+16|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function Hq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=r;r=r+16|0;h=g+4|0;i=g;a=a+8|0;a=Ob[k[(k[a>>2]|0)+4>>2]&127](a)|0;k[i>>2]=k[d>>2];k[h>>2]=k[i>>2];c=(Su(c,h,a,a+288|0,f,e,0)|0)-a|0;if((c|0)<288)k[b>>2]=((c|0)/12|0|0)%12|0;r=g;return}function Iq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j+4|0;i=j;d=tn(d)|0;k[g>>2]=d;x=0;g=Aa(37,g|0,44212)|0;l=x;x=0;if(l&1){l=Wa()|0;zm(d)|0;fb(l|0)}else{zm(d)|0;k[i>>2]=k[c>>2];k[h>>2]=k[i>>2];Jq(a,f+20|0,b,h,e,g);r=j;return k[b>>2]|0}return 0}function Jq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,4)|0;if(!(k[e>>2]&4)){if((a|0)<69)a=a+2e3|0;else a=(a+-69|0)>>>0<31?a+1900|0:a;k[b>>2]=a+-1900}r=g;return}function Kq(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;U=r;r=r+144|0;j=U+132|0;h=U+116|0;N=U+128|0;w=U+124|0;I=U+120|0;O=U+112|0;P=U+108|0;Q=U+104|0;R=U+100|0;S=U+96|0;T=U+92|0;l=U+88|0;m=U+84|0;n=U+80|0;o=U+76|0;p=U+72|0;q=U+68|0;s=U+64|0;t=U+60|0;u=U+56|0;v=U+52|0;y=U+48|0;z=U+44|0;A=U+40|0;B=U+36|0;C=U+32|0;D=U+28|0;E=U+24|0;F=U+20|0;G=U+16|0;H=U+12|0;J=U+8|0;K=U+4|0;L=U;k[e>>2]=0;M=tn(d)|0;k[N>>2]=M;x=0;N=Aa(37,N|0,44212)|0;W=x;x=0;if(W&1){W=Wa()|0;zm(M)|0;fb(W|0)}zm(M)|0;do switch(g<<24>>24|0){case 65:case 97:{k[w>>2]=k[c>>2];k[j>>2]=k[w>>2];Fq(a,f+24|0,b,j,e,N);V=28;break}case 104:case 66:case 98:{k[I>>2]=k[c>>2];k[j>>2]=k[I>>2];Hq(a,f+16|0,b,j,e,N);V=28;break}case 99:{W=a+8|0;W=Ob[k[(k[W>>2]|0)+12>>2]&127](W)|0;k[O>>2]=k[b>>2];k[P>>2]=k[c>>2];g=i[W>>0]|0;c=(g&1)==0;V=W+4|0;W=c?V:k[W+8>>2]|0;V=W+((c?(g&255)>>>1:k[V>>2]|0)<<2)|0;k[h>>2]=k[O>>2];k[j>>2]=k[P>>2];V=yq(a,h,j,d,e,f,W,V)|0;k[b>>2]=V;V=28;break}case 101:case 100:{k[Q>>2]=k[c>>2];k[j>>2]=k[Q>>2];Lq(a,f+12|0,b,j,e,N);V=28;break}case 68:{k[R>>2]=k[b>>2];k[S>>2]=k[c>>2];k[h>>2]=k[R>>2];k[j>>2]=k[S>>2];V=yq(a,h,j,d,e,f,44820,44852)|0;k[b>>2]=V;V=28;break}case 70:{k[T>>2]=k[b>>2];k[l>>2]=k[c>>2];k[h>>2]=k[T>>2];k[j>>2]=k[l>>2];V=yq(a,h,j,d,e,f,44852,44884)|0;k[b>>2]=V;V=28;break}case 72:{k[m>>2]=k[c>>2];k[j>>2]=k[m>>2];Mq(a,f+8|0,b,j,e,N);V=28;break}case 73:{k[n>>2]=k[c>>2];k[j>>2]=k[n>>2];Nq(a,f+8|0,b,j,e,N);V=28;break}case 106:{k[o>>2]=k[c>>2];k[j>>2]=k[o>>2];Oq(a,f+28|0,b,j,e,N);V=28;break}case 109:{k[p>>2]=k[c>>2];k[j>>2]=k[p>>2];Pq(a,f+16|0,b,j,e,N);V=28;break}case 77:{k[q>>2]=k[c>>2];k[j>>2]=k[q>>2];Qq(a,f+4|0,b,j,e,N);V=28;break}case 116:case 110:{k[s>>2]=k[c>>2];k[j>>2]=k[s>>2];Rq(a,b,j,e,N);V=28;break}case 112:{k[t>>2]=k[c>>2];k[j>>2]=k[t>>2];Sq(a,f+8|0,b,j,e,N);V=28;break}case 114:{k[u>>2]=k[b>>2];k[v>>2]=k[c>>2];k[h>>2]=k[u>>2];k[j>>2]=k[v>>2];V=yq(a,h,j,d,e,f,44884,44928)|0;k[b>>2]=V;V=28;break}case 82:{k[y>>2]=k[b>>2];k[z>>2]=k[c>>2];k[h>>2]=k[y>>2];k[j>>2]=k[z>>2];V=yq(a,h,j,d,e,f,44928,44948)|0;k[b>>2]=V;V=28;break}case 83:{k[A>>2]=k[c>>2];k[j>>2]=k[A>>2];Tq(a,f,b,j,e,N);V=28;break}case 84:{k[B>>2]=k[b>>2];k[C>>2]=k[c>>2];k[h>>2]=k[B>>2];k[j>>2]=k[C>>2];V=yq(a,h,j,d,e,f,44948,44980)|0;k[b>>2]=V;V=28;break}case 119:{k[D>>2]=k[c>>2];k[j>>2]=k[D>>2];Uq(a,f+24|0,b,j,e,N);V=28;break}case 120:{W=k[(k[a>>2]|0)+20>>2]|0;k[E>>2]=k[b>>2];k[F>>2]=k[c>>2];k[h>>2]=k[E>>2];k[j>>2]=k[F>>2];h=Nb[W&63](a,h,j,d,e,f)|0;break}case 88:{W=a+8|0;W=Ob[k[(k[W>>2]|0)+24>>2]&127](W)|0;k[G>>2]=k[b>>2];k[H>>2]=k[c>>2];g=i[W>>0]|0;c=(g&1)==0;V=W+4|0;W=c?V:k[W+8>>2]|0;V=W+((c?(g&255)>>>1:k[V>>2]|0)<<2)|0;k[h>>2]=k[G>>2];k[j>>2]=k[H>>2];V=yq(a,h,j,d,e,f,W,V)|0;k[b>>2]=V;V=28;break}case 121:{k[J>>2]=k[c>>2];k[j>>2]=k[J>>2];Jq(a,f+20|0,b,j,e,N);V=28;break}case 89:{k[K>>2]=k[c>>2];k[j>>2]=k[K>>2];Vq(a,f+20|0,b,j,e,N);V=28;break}case 37:{k[L>>2]=k[c>>2];k[j>>2]=k[L>>2];Wq(a,b,j,e,N);V=28;break}default:{k[e>>2]=k[e>>2]|4;V=28}}while(0);if((V|0)==28)h=k[b>>2]|0;r=U;return h|0}function Lq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a+-1|0)>>>0<31&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Mq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<24&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Nq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a+-1|0)>>>0<12&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Oq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,3)|0;c=k[e>>2]|0;if((a|0)<366&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Pq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<13&(c&4|0)==0)k[b>>2]=a+-1;else k[e>>2]=c|4;r=g;return}function Qq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<60&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Rq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:while(1){a=k[b>>2]|0;do if(a){f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if((a|0)==-1){k[b>>2]=0;g=1;break}else{g=(k[b>>2]|0)==0;break}}else g=1;while(0);f=k[c>>2]|0;do if(f){a=k[f+12>>2]|0;if((a|0)==(k[f+16>>2]|0))a=Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0;else a=k[a>>2]|0;if((a|0)!=-1)if(g){g=f;break}else{g=f;break a}else{k[c>>2]=0;h=15;break}}else h=15;while(0);if((h|0)==15){h=0;if(g){g=0;break}else g=0}a=k[b>>2]|0;f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if(!(Qb[k[(k[e>>2]|0)+12>>2]&63](e,8192,a)|0))break;a=k[b>>2]|0;f=a+12|0;g=k[f>>2]|0;if((g|0)==(k[a+16>>2]|0)){Ob[k[(k[a>>2]|0)+40>>2]&127](a)|0;continue}else{k[f>>2]=g+4;continue}}a=k[b>>2]|0;do if(a){f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if((a|0)==-1){k[b>>2]=0;f=1;break}else{f=(k[b>>2]|0)==0;break}}else f=1;while(0);do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0))a=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else a=k[a>>2]|0;if((a|0)!=-1)if(f)break;else{h=39;break}else{k[c>>2]=0;h=37;break}}else h=37;while(0);if((h|0)==37?f:0)h=39;if((h|0)==39)k[d>>2]=k[d>>2]|2;return}function Sq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0;m=r;r=r+16|0;h=m+4|0;j=m;l=a+8|0;l=Ob[k[(k[l>>2]|0)+8>>2]&127](l)|0;a=i[l>>0]|0;if(!(a&1))g=(a&255)>>>1;else g=k[l+4>>2]|0;a=i[l+12>>0]|0;if(!(a&1))a=(a&255)>>>1;else a=k[l+16>>2]|0;do if((g|0)!=(0-a|0)){k[j>>2]=k[d>>2];k[h>>2]=k[j>>2];a=Su(c,h,l,l+24|0,f,e,0)|0;g=k[b>>2]|0;if((a|0)==(l|0)&(g|0)==12){k[b>>2]=0;break}if((g|0)<12&(a-l|0)==12)k[b>>2]=g+12}else k[e>>2]=k[e>>2]|4;while(0);r=m;return}function Tq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,2)|0;c=k[e>>2]|0;if((a|0)<61&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Uq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,1)|0;c=k[e>>2]|0;if((a|0)<7&(c&4|0)==0)k[b>>2]=a;else k[e>>2]=c|4;r=g;return}function Vq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=r;r=r+16|0;a=g+4|0;h=g;k[h>>2]=k[d>>2];k[a>>2]=k[h>>2];a=ev(c,a,e,f,4)|0;if(!(k[e>>2]&4))k[b>>2]=a+-1900;r=g;return}function Wq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a=k[b>>2]|0;do if(a){f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if((a|0)==-1){k[b>>2]=0;g=1;break}else{g=(k[b>>2]|0)==0;break}}else g=1;while(0);f=k[c>>2]|0;do if(f){a=k[f+12>>2]|0;if((a|0)==(k[f+16>>2]|0))a=Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0;else a=k[a>>2]|0;if((a|0)!=-1)if(g){h=f;i=17;break}else{i=16;break}else{k[c>>2]=0;i=14;break}}else i=14;while(0);if((i|0)==14)if(g)i=16;else{h=0;i=17}a:do if((i|0)==16)k[d>>2]=k[d>>2]|6;else if((i|0)==17){a=k[b>>2]|0;f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if((Qb[k[(k[e>>2]|0)+52>>2]&63](e,a,0)|0)<<24>>24!=37){k[d>>2]=k[d>>2]|4;break}a=k[b>>2]|0;f=a+12|0;g=k[f>>2]|0;if((g|0)==(k[a+16>>2]|0)){Ob[k[(k[a>>2]|0)+40>>2]&127](a)|0;a=k[b>>2]|0;if(!a)f=1;else i=25}else{k[f>>2]=g+4;i=25}do if((i|0)==25){f=k[a+12>>2]|0;if((f|0)==(k[a+16>>2]|0))a=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;else a=k[f>>2]|0;if((a|0)==-1){k[b>>2]=0;f=1;break}else{f=(k[b>>2]|0)==0;break}}while(0);do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0))a=Ob[k[(k[h>>2]|0)+36>>2]&127](h)|0;else a=k[a>>2]|0;if((a|0)!=-1)if(f)break a;else break;else{k[c>>2]=0;i=37;break}}else i=37;while(0);if((i|0)==37?!f:0)break;k[d>>2]=k[d>>2]|2}while(0);return}function Xq(a){a=a|0;Yq(a+8|0);return}function Yq(a){a=a|0;var b=0,c=0,d=0;b=k[a>>2]|0;x=0;c=Da(3)|0;d=x;x=0;do if(!(d&1)){if((b|0)!=(c|0)?(x=0,qa(188,k[a>>2]|0),d=x,x=0,d&1):0)break;return}while(0);d=Wa(0)|0;oc(d)}function Zq(a){a=a|0;Yq(a+8|0);mj(a);return}function _q(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0;j=r;r=r+112|0;h=j+4|0;c=j;k[c>>2]=h+100;$q(a+8|0,h,c,e,f,g);e=k[c>>2]|0;c=k[b>>2]|0;if((h|0)!=(e|0))do{g=i[h>>0]|0;do if(c){d=c+24|0;f=k[d>>2]|0;if((f|0)==(k[c+28>>2]|0)){b=(Vb[k[(k[c>>2]|0)+52>>2]&63](c,g&255)|0)==-1;c=b?0:c;break}else{k[d>>2]=f+1;i[f>>0]=g;break}}else c=0;while(0);h=h+1|0}while((h|0)!=(e|0));r=j;return c|0}function $q(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0;l=r;r=r+16|0;j=l;i[j>>0]=37;g=j+1|0;i[g>>0]=e;h=j+2|0;i[h>>0]=f;i[j+3>>0]=0;if(f<<24>>24){i[g>>0]=f;i[h>>0]=e}a=b+(_a(b|0,(k[c>>2]|0)-b|0,j|0,d|0,k[a>>2]|0)|0)|0;k[c>>2]=a;r=l;return}function ar(a){a=a|0;Yq(a+8|0);return}function br(a){a=a|0;Yq(a+8|0);mj(a);return}function cr(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=r;r=r+416|0;d=h+8|0;c=h;k[c>>2]=d+400;dr(a+8|0,d,c,e,f,g);a=k[c>>2]|0;c=k[b>>2]|0;if((d|0)!=(a|0)){e=d;do{d=k[e>>2]|0;if(!c)c=0;else{f=c+24|0;g=k[f>>2]|0;if((g|0)==(k[c+28>>2]|0))d=Vb[k[(k[c>>2]|0)+52>>2]&63](c,d)|0;else{k[f>>2]=g+4;k[g>>2]=d}c=(d|0)==-1?0:c}e=e+4|0}while((e|0)!=(a|0))}r=h;return c|0}function dr(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+128|0;j=g+16|0;l=g+12|0;h=g;i=g+8|0;k[l>>2]=j+100;$q(a,j,l,d,e,f);e=h;k[e>>2]=0;k[e+4>>2]=0;k[i>>2]=j;e=(k[c>>2]|0)-b>>2;f=Ak(k[a>>2]|0)|0;x=0;e=Ea(18,b|0,i|0,e|0,h|0)|0;a=x;x=0;if(a&1){e=Wa()|0;if((f|0)!=0?(x=0,ta(75,f|0)|0,l=x,x=0,l&1):0){l=Wa(0)|0;oc(l)}fb(e|0)}if((f|0)!=0?(x=0,ta(75,f|0)|0,l=x,x=0,l&1):0){l=Wa(0)|0;oc(l)}if((e|0)==-1)$r(58955);else{k[c>>2]=b+(e<<2);r=g;return}}function er(a){a=a|0;return}function fr(a){a=a|0;mj(a);return}function gr(a){a=a|0;return 127}function hr(a){a=a|0;return 127}function ir(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function jr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function kr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function lr(a,b){a=a|0;b=b|0;Rm(a,1,45);return}function mr(a){a=a|0;return 0}function nr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function or(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function pr(a){a=a|0;return}function qr(a){a=a|0;mj(a);return}function rr(a){a=a|0;return 127}function sr(a){a=a|0;return 127}function tr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function ur(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function vr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function wr(a,b){a=a|0;b=b|0;Rm(a,1,45);return}function xr(a){a=a|0;return 0}function yr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function zr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function Ar(a){a=a|0;return}function Br(a){a=a|0;mj(a);return}function Cr(a){a=a|0;return 2147483647}function Dr(a){a=a|0;return 2147483647}function Er(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Fr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Gr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Hr(a,b){a=a|0;b=b|0;dn(a,1,45);return}function Ir(a){a=a|0;return 0}function Jr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function Kr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function Lr(a){a=a|0;return}function Mr(a){a=a|0;mj(a);return}function Nr(a){a=a|0;return 2147483647}function Or(a){a=a|0;return 2147483647}function Pr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Qr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Rr(a,b){a=a|0;b=b|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function Sr(a,b){a=a|0;b=b|0;dn(a,1,45);return}function Tr(a){a=a|0;return 0}function Ur(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function Vr(a,b){a=a|0;b=b|0;i[a>>0]=2;i[a+1>>0]=3;i[a+2>>0]=0;i[a+3>>0]=4;return}function Wr(a){a=a|0;return}function Xr(a){a=a|0;mj(a);return}function Yr(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;B=r;r=r+240|0;z=B+24|0;A=B;a=B+136|0;D=B+16|0;y=B+12|0;C=B+8|0;n=B+134|0;j=B+4|0;w=B+124|0;k[D>>2]=a;E=D+4|0;k[E>>2]=189;l=a+100|0;x=0;h=ta(68,e|0)|0;v=x;x=0;if(!(v&1)){k[C>>2]=h;x=0;a=Aa(37,C|0,44220)|0;v=x;x=0;a:do if(!(v&1)?(i[n>>0]=0,k[j>>2]=k[c>>2],m=k[e+4>>2]|0,x=0,k[z>>2]=k[j>>2],m=ua(1,b|0,z|0,d|0,C|0,m|0,f|0,n|0,a|0,D|0,y|0,l|0)|0,v=x,x=0,!(v&1)):0){b:do if(m){x=0;Ea(k[(k[a>>2]|0)+32>>2]|0,a|0,58976,58986,w|0)|0;v=x;x=0;if(v&1){G=10;break a}j=k[y>>2]|0;l=k[D>>2]|0;a=j-l|0;if((a|0)>98){a=Pl(a+2|0)|0;h=a;if(!a){x=0;Ga(6);v=x;x=0;if(!(v&1)){a=0;G=13}}else G=13}else{h=0;a=z;G=13}do if((G|0)==13){if(i[n>>0]|0){i[a>>0]=45;a=a+1|0}u=w+10|0;v=w;if(l>>>0>>0){m=w+1|0;d=m+1|0;e=d+1|0;n=e+1|0;o=n+1|0;p=o+1|0;q=p+1|0;s=q+1|0;t=s+1|0;do{j=i[l>>0]|0;do if((i[w>>0]|0)!=j<<24>>24)if((i[m>>0]|0)!=j<<24>>24)if((i[d>>0]|0)!=j<<24>>24)if((i[e>>0]|0)!=j<<24>>24)if((i[n>>0]|0)==j<<24>>24)j=n;else{if((i[o>>0]|0)==j<<24>>24){j=o;break}if((i[p>>0]|0)==j<<24>>24){j=p;break}if((i[q>>0]|0)==j<<24>>24){j=q;break}if((i[s>>0]|0)==j<<24>>24){j=s;break}j=(i[t>>0]|0)==j<<24>>24?t:u}else j=e;else j=d;else j=m;else j=w;while(0);i[a>>0]=i[58976+(j-v)>>0]|0;l=l+1|0;a=a+1|0}while(l>>>0<(k[y>>2]|0)>>>0)}i[a>>0]=0;k[A>>2]=g;if((jl(z,58987,A)|0)!=1?(x=0,qa(190,58991),g=x,x=0,g&1):0)break;if(h)Ql(h);break b}while(0);a=Wa()|0;if(!h){j=a;h=D;break a}Ql(h);j=a;h=D;break a}while(0);a=k[b>>2]|0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1){G=10;break a}if((a|0)==-1){k[b>>2]=0;a=0;break}else{a=k[b>>2]|0;break}}}else a=0;while(0);h=(a|0)==0;a=k[c>>2]|0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1){G=10;break a}if((a|0)==-1){k[c>>2]=0;G=37;break}}if(!h)G=38}else G=37;while(0);if((G|0)==37?h:0)G=38;if((G|0)==38)k[f>>2]=k[f>>2]|2;h=k[b>>2]|0;zm(k[C>>2]|0)|0;a=k[D>>2]|0;k[D>>2]=0;if((a|0)!=0?(x=0,qa(k[E>>2]|0,a|0),G=x,x=0,G&1):0){G=Wa(0)|0;oc(G)}r=B;return h|0}else G=10;while(0);if((G|0)==10){j=Wa()|0;h=D}zm(k[C>>2]|0)|0;a=k[h>>2]|0;k[h>>2]=0;if(!a)F=j;else{h=k[E>>2]|0;G=45}}else{j=Wa()|0;k[D>>2]=0;h=189;G=45}if((G|0)==45){x=0;qa(h|0,a|0);G=x;x=0;if(G&1){G=Wa(0)|0;oc(G)}else F=j}fb(F|0);return 0}function Zr(a){a=a|0;return}function _r(a,b,c,d,e,f,g,h,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0;ba=r;r=r+512|0;P=ba+88|0;t=ba+96|0;da=ba+80|0;T=ba+72|0;S=ba+68|0;U=ba+500|0;Q=ba+497|0;V=ba+496|0;Y=ba+56|0;aa=ba+44|0;_=ba+32|0;Z=ba+20|0;$=ba+8|0;R=ba+4|0;X=ba;k[P>>2]=o;k[da>>2]=t;ca=da+4|0;k[ca>>2]=189;k[T>>2]=t;k[S>>2]=t+400;k[Y>>2]=0;k[Y+4>>2]=0;k[Y+8>>2]=0;k[aa>>2]=0;k[aa+4>>2]=0;k[aa+8>>2]=0;k[_>>2]=0;k[_+4>>2]=0;k[_+8>>2]=0;k[Z>>2]=0;k[Z+4>>2]=0;k[Z+8>>2]=0;k[$>>2]=0;k[$+4>>2]=0;k[$+8>>2]=0;x=0;za(1,c|0,d|0,U|0,Q|0,V|0,Y|0,aa|0,_|0,Z|0,R|0);O=x;x=0;a:do if(O&1)h=Wa()|0;else{k[n>>2]=k[m>>2];I=h+8|0;J=_+4|0;K=Z+4|0;L=Z+8|0;M=Z+1|0;N=_+8|0;O=_+1|0;z=(e&512|0)!=0;A=aa+8|0;B=aa+1|0;C=aa+4|0;D=$+4|0;E=$+8|0;F=$+1|0;G=U+3|0;H=Y+4|0;y=0;s=0;b:while(1){o=k[a>>2]|0;do if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}if((o|0)==-1){k[a>>2]=0;o=0;break}else{o=k[a>>2]|0;break}}}else o=0;while(0);o=(o|0)==0;h=k[b>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(o){w=h;break}else{W=235;break b}x=0;c=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=24;break b}if((c|0)!=-1)if(o){w=h;break}else{W=235;break b}else{k[b>>2]=0;W=15;break}}else W=15;while(0);if((W|0)==15){W=0;if(o){W=235;break}else w=0}c:do switch(i[U+y>>0]|0){case 1:{if((y|0)!=3){o=k[a>>2]|0;h=k[o+12>>2]|0;if((h|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;W=x;x=0;if(W&1){W=24;break b}}else o=l[h>>0]|0;if((o&255)<<24>>24<=-1){W=40;break b}if(!(j[(k[I>>2]|0)+(o<<24>>24<<1)>>1]&8192)){W=40;break b}o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;W=x;x=0;if(W&1){W=24;break b}}else{k[h>>2]=c+1;o=l[c>>0]|0}x=0;ra(67,$|0,o&255|0);W=x;x=0;if(W&1){W=24;break b}else{o=w;d=w;W=42}}break}case 0:{if((y|0)!=3){o=w;d=w;W=42}break}case 3:{h=i[_>>0]|0;o=(h&1)==0?(h&255)>>>1:k[J>>2]|0;c=i[Z>>0]|0;d=(c&1)==0?(c&255)>>>1:k[K>>2]|0;if((o|0)!=(0-d|0)){if(!o){o=k[a>>2]|0;h=k[o+12>>2]|0;if((h|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}h=i[Z>>0]|0}else{o=l[h>>0]|0;h=c}if((o&255)<<24>>24!=(i[((h&1)==0?M:k[L>>2]|0)>>0]|0))break c;o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}}else k[h>>2]=c+1;i[g>>0]=1;w=i[Z>>0]|0;s=((w&1)==0?(w&255)>>>1:k[K>>2]|0)>>>0>1?Z:s;break c}e=k[a>>2]|0;p=k[e+12>>2]|0;c=k[e+16>>2]|0;o=(p|0)==(c|0);if(!d){if(o){x=0;o=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){W=24;break b}h=i[_>>0]|0}else o=l[p>>0]|0;if((o&255)<<24>>24!=(i[((h&1)==0?O:k[N>>2]|0)>>0]|0)){i[g>>0]=1;break c}o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}}else k[h>>2]=c+1;w=i[_>>0]|0;s=((w&1)==0?(w&255)>>>1:k[J>>2]|0)>>>0>1?_:s;break c}if(o){x=0;o=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){W=24;break b}c=k[a>>2]|0;h=i[_>>0]|0;e=c;p=k[c+12>>2]|0;c=k[c+16>>2]|0}else o=l[p>>0]|0;d=e+12|0;c=(p|0)==(c|0);if((o&255)<<24>>24==(i[((h&1)==0?O:k[N>>2]|0)>>0]|0)){if(c){x=0;ta(k[(k[e>>2]|0)+40>>2]|0,e|0)|0;w=x;x=0;if(w&1){W=24;break b}}else k[d>>2]=p+1;w=i[_>>0]|0;s=((w&1)==0?(w&255)>>>1:k[J>>2]|0)>>>0>1?_:s;break c}if(c){x=0;o=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){W=24;break b}}else o=l[p>>0]|0;if((o&255)<<24>>24!=(i[((i[Z>>0]&1)==0?M:k[L>>2]|0)>>0]|0)){W=104;break b}o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}}else k[h>>2]=c+1;i[g>>0]=1;w=i[Z>>0]|0;s=((w&1)==0?(w&255)>>>1:k[K>>2]|0)>>>0>1?Z:s}break}case 2:{if(!(y>>>0<2|(s|0)!=0)?!(z|(y|0)==2&(i[G>>0]|0)!=0):0){s=0;break c}u=i[aa>>0]|0;o=(u&1)==0;v=k[A>>2]|0;c=o?B:v;q=c;d:do if((y|0)!=0?(l[U+(y+-1)>>0]|0)<2:0){p=o?(u&255)>>>1:k[C>>2]|0;d=c+p|0;e=k[I>>2]|0;e:do if(!p)h=q;else{p=c;h=q;do{o=i[p>>0]|0;if(o<<24>>24<=-1)break e;if(!(j[e+(o<<24>>24<<1)>>1]&8192))break e;p=p+1|0;h=p}while((p|0)!=(d|0))}while(0);d=h-q|0;e=i[$>>0]|0;o=(e&1)==0;e=o?(e&255)>>>1:k[D>>2]|0;if(e>>>0>=d>>>0){o=o?F:k[E>>2]|0;p=o+e|0;if((h|0)!=(q|0)){o=o+(e-d)|0;while(1){if((i[o>>0]|0)!=(i[c>>0]|0)){h=q;break d}o=o+1|0;if((o|0)==(p|0))break;else c=c+1|0}}}else h=q}else h=q;while(0);o=(u&1)==0;o=(o?B:v)+(o?(u&255)>>>1:k[C>>2]|0)|0;f:do if((h|0)!=(o|0)){e=w;d=w;o=h;while(1){h=k[a>>2]|0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;h=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=21;break b}if((h|0)==-1){k[a>>2]=0;h=0;break}else{h=k[a>>2]|0;break}}}else h=0;while(0);c=(h|0)==0;do if(d){if((k[d+12>>2]|0)!=(k[d+16>>2]|0))if(c){h=e;p=d;break}else break f;x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){W=21;break b}if((h|0)!=-1)if(c^(e|0)==0){h=e;p=e;break}else break f;else{k[b>>2]=0;h=0;W=131;break}}else{h=e;W=131}while(0);if((W|0)==131){W=0;if(c)break f;else p=0}c=k[a>>2]|0;d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){W=21;break b}}else c=l[d>>0]|0;if((c&255)<<24>>24!=(i[o>>0]|0))break f;c=k[a>>2]|0;d=c+12|0;e=k[d>>2]|0;if((e|0)==(k[c+16>>2]|0)){x=0;ta(k[(k[c>>2]|0)+40>>2]|0,c|0)|0;w=x;x=0;if(w&1){W=21;break b}}else k[d>>2]=e+1;o=o+1|0;c=i[aa>>0]|0;w=(c&1)==0;c=(w?B:k[A>>2]|0)+(w?(c&255)>>>1:k[C>>2]|0)|0;if((o|0)==(c|0)){o=c;break}else{e=h;d=p}}}while(0);if(z?(w=i[aa>>0]|0,v=(w&1)==0,(o|0)!=((v?B:k[A>>2]|0)+(v?(w&255)>>>1:k[C>>2]|0)|0)):0){W=143;break b}break}case 4:{q=i[V>>0]|0;h=w;e=w;o=0;g:while(1){c=k[a>>2]|0;do if(c){if((k[c+12>>2]|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){W=23;break b}if((c|0)==-1){k[a>>2]=0;c=0;break}else{c=k[a>>2]|0;break}}}else c=0;while(0);d=(c|0)==0;do if(e){if((k[e+12>>2]|0)!=(k[e+16>>2]|0))if(d){p=h;break}else{d=h;break g}x=0;c=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){W=23;break b}if((c|0)!=-1)if(d^(h|0)==0){p=h;e=h;break}else{d=h;break g}else{k[b>>2]=0;h=0;W=156;break}}else W=156;while(0);if((W|0)==156){W=0;if(d){d=h;break}else{p=h;e=0}}h=k[a>>2]|0;c=k[h+12>>2]|0;if((c|0)==(k[h+16>>2]|0)){x=0;h=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=23;break b}}else h=l[c>>0]|0;c=h&255;if(c<<24>>24>-1?(j[(k[I>>2]|0)+(h<<24>>24<<1)>>1]&2048)!=0:0){h=k[n>>2]|0;if((h|0)==(k[P>>2]|0)){x=0;Fa(12,m|0,n|0,P|0);w=x;x=0;if(w&1){W=23;break b}h=k[n>>2]|0}k[n>>2]=h+1;i[h>>0]=c;o=o+1|0}else{w=i[Y>>0]|0;if(!(c<<24>>24==q<<24>>24&((o|0)!=0?(((w&1)==0?(w&255)>>>1:k[H>>2]|0)|0)!=0:0))){d=p;break}if((t|0)==(k[S>>2]|0)){x=0;Fa(13,da|0,T|0,S|0);w=x;x=0;if(w&1){W=23;break b}t=k[T>>2]|0}w=t+4|0;k[T>>2]=w;k[t>>2]=o;t=w;o=0}h=k[a>>2]|0;c=h+12|0;d=k[c>>2]|0;if((d|0)==(k[h+16>>2]|0)){x=0;ta(k[(k[h>>2]|0)+40>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=23;break b}else{h=p;continue}}else{k[c>>2]=d+1;h=p;continue}}if((o|0)!=0?(k[da>>2]|0)!=(t|0):0){if((t|0)==(k[S>>2]|0)){x=0;Fa(13,da|0,T|0,S|0);w=x;x=0;if(w&1){W=24;break b}t=k[T>>2]|0}w=t+4|0;k[T>>2]=w;k[t>>2]=o;t=w}p=k[R>>2]|0;if((p|0)>0){o=k[a>>2]|0;do if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}if((o|0)==-1){k[a>>2]=0;o=0;break}else{o=k[a>>2]|0;break}}}else o=0;while(0);o=(o|0)==0;do if(d){if((k[d+12>>2]|0)==(k[d+16>>2]|0)){x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){W=24;break b}if((h|0)==-1){k[b>>2]=0;W=193;break}}if(!o){W=198;break b}}else W=193;while(0);if((W|0)==193){W=0;if(o){W=198;break b}else d=0}o=k[a>>2]|0;h=k[o+12>>2]|0;if((h|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}}else o=l[h>>0]|0;if((o&255)<<24>>24!=(i[Q>>0]|0)){W=198;break b}o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=24;break b}}else k[h>>2]=c+1;if((p|0)>0){e=d;c=d;q=p;while(1){o=k[a>>2]|0;do if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=22;break b}if((o|0)==-1){k[a>>2]=0;o=0;break}else{o=k[a>>2]|0;break}}}else o=0;while(0);h=(o|0)==0;do if(c){if((k[c+12>>2]|0)!=(k[c+16>>2]|0))if(h){o=e;p=c;break}else{W=222;break b}x=0;o=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){W=22;break b}if((o|0)!=-1)if(h^(e|0)==0){o=e;p=e;break}else{W=222;break b}else{k[b>>2]=0;o=0;W=215;break}}else{o=e;W=215}while(0);if((W|0)==215){W=0;if(h){W=222;break b}else p=0}h=k[a>>2]|0;c=k[h+12>>2]|0;if((c|0)==(k[h+16>>2]|0)){x=0;h=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=22;break b}}else h=l[c>>0]|0;if((h&255)<<24>>24<=-1){W=222;break b}if(!(j[(k[I>>2]|0)+(h<<24>>24<<1)>>1]&2048)){W=222;break b}if((k[n>>2]|0)==(k[P>>2]|0)?(x=0,Fa(12,m|0,n|0,P|0),w=x,x=0,w&1):0){W=22;break b}h=k[a>>2]|0;c=k[h+12>>2]|0;if((c|0)==(k[h+16>>2]|0)){x=0;h=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=22;break b}}else h=l[c>>0]|0;c=k[n>>2]|0;k[n>>2]=c+1;i[c>>0]=h;h=q;q=q+-1|0;k[R>>2]=q;c=k[a>>2]|0;d=c+12|0;e=k[d>>2]|0;if((e|0)==(k[c+16>>2]|0)){x=0;ta(k[(k[c>>2]|0)+40>>2]|0,c|0)|0;w=x;x=0;if(w&1){W=22;break b}}else k[d>>2]=e+1;if((h|0)<=1)break;else{e=o;c=p}}}}if((k[n>>2]|0)==(k[m>>2]|0)){W=233;break b}break}default:{}}while(0);h:do if((W|0)==42)while(1){W=0;h=k[a>>2]|0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;h=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;w=x;x=0;if(w&1){W=20;break b}if((h|0)==-1){k[a>>2]=0;h=0;break}else{h=k[a>>2]|0;break}}}else h=0;while(0);c=(h|0)==0;do if(d){if((k[d+12>>2]|0)!=(k[d+16>>2]|0))if(c){e=o;break}else break h;x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){W=20;break b}if((h|0)!=-1)if(c^(o|0)==0){e=o;d=o;break}else break h;else{k[b>>2]=0;o=0;W=54;break}}else W=54;while(0);if((W|0)==54){W=0;if(c)break h;else{e=o;d=0}}o=k[a>>2]|0;h=k[o+12>>2]|0;if((h|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){W=20;break b}}else o=l[h>>0]|0;if((o&255)<<24>>24<=-1)break h;if(!(j[(k[I>>2]|0)+(o<<24>>24<<1)>>1]&8192))break h;o=k[a>>2]|0;h=o+12|0;c=k[h>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+40>>2]|0,o|0)|0;W=x;x=0;if(W&1){W=20;break b}}else{k[h>>2]=c+1;o=l[c>>0]|0}x=0;ra(67,$|0,o&255|0);W=x;x=0;if(W&1){W=20;break b}else{o=e;W=42}}while(0);y=y+1|0;if(y>>>0>=4){W=235;break}}i:switch(W|0){case 20:{h=Wa()|0;break a}case 21:{h=Wa()|0;break a}case 22:{h=Wa()|0;break a}case 23:{h=Wa()|0;break a}case 24:{h=Wa()|0;break a}case 40:{k[f>>2]=k[f>>2]|4;h=0;break}case 104:{k[f>>2]=k[f>>2]|4;h=0;break}case 143:{k[f>>2]=k[f>>2]|4;h=0;break}case 198:{k[f>>2]=k[f>>2]|4;h=0;break}case 222:{k[f>>2]=k[f>>2]|4;h=0;break}case 233:{k[f>>2]=k[f>>2]|4;h=0;break}case 235:{j:do if(s){e=s+1|0;p=s+8|0;q=s+4|0;c=1;k:while(1){o=i[s>>0]|0;if(!(o&1))o=(o&255)>>>1;else o=k[q>>2]|0;if(c>>>0>=o>>>0)break j;o=k[a>>2]|0;do if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;n=x;x=0;if(n&1){W=19;break k}if((o|0)==-1){k[a>>2]=0;o=0;break}else{o=k[a>>2]|0;break}}}else o=0;while(0);h=(o|0)==0;o=k[b>>2]|0;do if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;n=x;x=0;if(n&1){W=19;break k}if((o|0)==-1){k[b>>2]=0;W=253;break}}if(!h){W=260;break k}}else W=253;while(0);if((W|0)==253?(W=0,h):0){W=260;break}o=k[a>>2]|0;h=k[o+12>>2]|0;if((h|0)==(k[o+16>>2]|0)){x=0;o=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;n=x;x=0;if(n&1){W=19;break}}else o=l[h>>0]|0;if(!(i[s>>0]&1))h=e;else h=k[p>>2]|0;if((o&255)<<24>>24!=(i[h+c>>0]|0)){W=260;break}o=c+1|0;h=k[a>>2]|0;c=h+12|0;d=k[c>>2]|0;if((d|0)==(k[h+16>>2]|0)){x=0;ta(k[(k[h>>2]|0)+40>>2]|0,h|0)|0;n=x;x=0;if(n&1){W=19;break}else{c=o;continue}}else{k[c>>2]=d+1;c=o;continue}}if((W|0)==19){h=Wa()|0;break a}else if((W|0)==260){k[f>>2]=k[f>>2]|4;h=0;break i}}while(0);o=k[da>>2]|0;if((o|0)!=(t|0)?(k[X>>2]=0,cs(Y,o,t,X),(k[X>>2]|0)!=0):0){k[f>>2]=k[f>>2]|4;h=0}else h=1;break}}Sm($);Sm(Z);Sm(_);Sm(aa);Sm(Y);o=k[da>>2]|0;k[da>>2]=0;if((o|0)!=0?(x=0,qa(k[ca>>2]|0,o|0),da=x,x=0,da&1):0){da=Wa(0)|0;oc(da)}r=ba;return h|0}while(0);Sm($);Sm(Z);Sm(_);Sm(aa);Sm(Y);o=k[da>>2]|0;k[da>>2]=0;if((o|0)!=0?(x=0,qa(k[ca>>2]|0,o|0),da=x,x=0,da&1):0){da=Wa(0)|0;oc(da)}fb(h|0);return 0}function $r(a){a=a|0;var b=0;b=Va(8)|0;x=0;ra(90,b|0,a|0);a=x;x=0;if(a&1){a=Wa()|0;Ua(b|0);fb(a|0)}else ub(b|0,616,80)}function as(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;v=r;r=r+144|0;h=v+24|0;a=v+32|0;w=v+16|0;q=v+8|0;n=v+4|0;o=v+28|0;j=v;k[w>>2]=a;A=w+4|0;k[A>>2]=189;l=a+100|0;x=0;u=ta(68,e|0)|0;m=x;x=0;if(!(m&1)){k[n>>2]=u;x=0;m=Aa(37,n|0,44220)|0;a=x;x=0;a:do if(!(a&1)?(i[o>>0]=0,s=k[c>>2]|0,k[j>>2]=s,p=k[e+4>>2]|0,t=s,x=0,k[h>>2]=k[j>>2],p=ua(1,b|0,h|0,d|0,n|0,p|0,f|0,o|0,m|0,w|0,q|0,l|0)|0,e=x,x=0,!(e&1)):0){if(p){if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}if(i[o>>0]|0){x=0;a=Aa(k[(k[m>>2]|0)+28>>2]|0,m|0,45)|0;e=x;x=0;if(e&1)break;x=0;ra(67,g|0,a|0);e=x;x=0;if(e&1)break}x=0;j=Aa(k[(k[m>>2]|0)+28>>2]|0,m|0,48)|0;e=x;x=0;if(e&1)break;a=k[w>>2]|0;l=k[q>>2]|0;h=l+-1|0;b:do if(a>>>0>>0)do{if((i[a>>0]|0)!=j<<24>>24)break b;a=a+1|0}while(a>>>0>>0);while(0);x=0;va(32,g|0,a|0,l|0)|0;g=x;x=0;if(g&1)break}a=k[b>>2]|0;do if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1)break a;if((a|0)==-1){k[b>>2]=0;a=0;break}else{a=k[b>>2]|0;break}}}else a=0;while(0);h=(a|0)==0;do if(s){if((k[t+12>>2]|0)==(k[t+16>>2]|0)){x=0;a=ta(k[(k[s>>2]|0)+36>>2]|0,t|0)|0;t=x;x=0;if(t&1)break a;if((a|0)==-1){k[c>>2]=0;z=29;break}}if(!h)z=30}else z=29;while(0);if((z|0)==29?h:0)z=30;if((z|0)==30)k[f>>2]=k[f>>2]|2;h=k[b>>2]|0;zm(u)|0;a=k[w>>2]|0;k[w>>2]=0;if((a|0)!=0?(x=0,qa(k[A>>2]|0,a|0),A=x,x=0,A&1):0){A=Wa(0)|0;oc(A)}r=v;return h|0}while(0);h=Wa()|0;zm(u)|0;a=k[w>>2]|0;k[w>>2]=0;if(!a)y=h;else z=36}else{h=Wa()|0;k[w>>2]=0;z=36}if((z|0)==36){x=0;qa(k[A>>2]|0,a|0);A=x;x=0;if(A&1){A=Wa(0)|0;oc(A)}else y=h}fb(y|0);return 0}function bs(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0;z=r;r=r+112|0;m=z+100|0;n=z+88|0;o=z+76|0;p=z+64|0;q=z+52|0;s=z+48|0;t=z+36|0;u=z+24|0;v=z+12|0;w=z;do if(a){a=Ss(b,43828)|0;Mb[k[(k[a>>2]|0)+44>>2]&127](m,a);w=k[m>>2]|0;i[c>>0]=w;i[c+1>>0]=w>>8;i[c+2>>0]=w>>16;i[c+3>>0]=w>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](n,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[j>>2]=k[n>>2];k[j+4>>2]=k[n+4>>2];k[j+8>>2]=k[n+8>>2];k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;Sm(n);Mb[k[(k[a>>2]|0)+28>>2]&127](o,a);if(!(i[h>>0]&1)){i[h+1>>0]=0;i[h>>0]=0}else{i[k[h+8>>2]>>0]=0;k[h+4>>2]=0}x=0;ra(91,h|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[h>>2]=k[o>>2];k[h+4>>2]=k[o+4>>2];k[h+8>>2]=k[o+8>>2];k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;Sm(o);h=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;i[d>>0]=h;h=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;i[e>>0]=h;Mb[k[(k[a>>2]|0)+20>>2]&127](p,a);if(!(i[f>>0]&1)){i[f+1>>0]=0;i[f>>0]=0}else{i[k[f+8>>2]>>0]=0;k[f+4>>2]=0}x=0;ra(91,f|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)};k[f>>2]=k[p>>2];k[f+4>>2]=k[p+4>>2];k[f+8>>2]=k[p+8>>2];k[p>>2]=0;k[p+4>>2]=0;k[p+8>>2]=0;Sm(p);Mb[k[(k[a>>2]|0)+24>>2]&127](q,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else{k[g>>2]=k[q>>2];k[g+4>>2]=k[q+4>>2];k[g+8>>2]=k[q+8>>2];k[q>>2]=0;k[q+4>>2]=0;k[q+8>>2]=0;Sm(q);y=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}else{a=Ss(b,43764)|0;Mb[k[(k[a>>2]|0)+44>>2]&127](s,a);s=k[s>>2]|0;i[c>>0]=s;i[c+1>>0]=s>>8;i[c+2>>0]=s>>16;i[c+3>>0]=s>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](t,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[j>>2]=k[t>>2];k[j+4>>2]=k[t+4>>2];k[j+8>>2]=k[t+8>>2];k[t>>2]=0;k[t+4>>2]=0;k[t+8>>2]=0;Sm(t);Mb[k[(k[a>>2]|0)+28>>2]&127](u,a);if(!(i[h>>0]&1)){i[h+1>>0]=0;i[h>>0]=0}else{i[k[h+8>>2]>>0]=0;k[h+4>>2]=0}x=0;ra(91,h|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[h>>2]=k[u>>2];k[h+4>>2]=k[u+4>>2];k[h+8>>2]=k[u+8>>2];k[u>>2]=0;k[u+4>>2]=0;k[u+8>>2]=0;Sm(u);h=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;i[d>>0]=h;h=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;i[e>>0]=h;Mb[k[(k[a>>2]|0)+20>>2]&127](v,a);if(!(i[f>>0]&1)){i[f+1>>0]=0;i[f>>0]=0}else{i[k[f+8>>2]>>0]=0;k[f+4>>2]=0}x=0;ra(91,f|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)};k[f>>2]=k[v>>2];k[f+4>>2]=k[v+4>>2];k[f+8>>2]=k[v+8>>2];k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;Sm(v);Mb[k[(k[a>>2]|0)+24>>2]&127](w,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else{k[g>>2]=k[w>>2];k[g+4>>2]=k[w+4>>2];k[g+8>>2]=k[w+8>>2];k[w>>2]=0;k[w+4>>2]=0;k[w+8>>2]=0;Sm(w);y=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}while(0);k[l>>2]=y;r=z;return}function cs(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;e=i[a>>0]|0;g=a+4|0;f=k[g>>2]|0;a:do if(((e&1)==0?(e&255)>>>1:f)|0){if((b|0)!=(c|0)){e=c+-4|0;if(e>>>0>b>>>0){f=b;do{h=k[f>>2]|0;k[f>>2]=k[e>>2];k[e>>2]=h;f=f+4|0;e=e+-4|0}while(f>>>0>>0)}e=i[a>>0]|0;f=k[g>>2]|0}h=(e&1)==0;g=h?a+1|0:k[a+8>>2]|0;c=c+-4|0;a=g+(h?(e&255)>>>1:f)|0;f=i[g>>0]|0;e=f<<24>>24<1|f<<24>>24==127;b:do if(c>>>0>b>>>0){while(1){if(!e?(f<<24>>24|0)!=(k[b>>2]|0):0)break;g=(a-g|0)>1?g+1|0:g;b=b+4|0;f=i[g>>0]|0;e=f<<24>>24<1|f<<24>>24==127;if(b>>>0>=c>>>0)break b}k[d>>2]=4;break a}while(0);if(!e?((k[c>>2]|0)+-1|0)>>>0>=f<<24>>24>>>0:0)k[d>>2]=4}while(0);return}function ds(a){a=a|0;return}function es(a){a=a|0;mj(a);return}function fs(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;B=r;r=r+576|0;w=B+424|0;A=B;a=B+24|0;D=B+16|0;y=B+12|0;C=B+8|0;n=B+464|0;j=B+4|0;z=B+468|0;k[D>>2]=a;F=D+4|0;k[F>>2]=189;l=a+400|0;x=0;h=ta(68,e|0)|0;v=x;x=0;if(!(v&1)){k[C>>2]=h;x=0;a=Aa(37,C|0,44212)|0;v=x;x=0;a:do if(!(v&1)?(i[n>>0]=0,k[j>>2]=k[c>>2],m=k[e+4>>2]|0,x=0,k[w>>2]=k[j>>2],m=ua(2,b|0,w|0,d|0,C|0,m|0,f|0,n|0,a|0,D|0,y|0,l|0)|0,v=x,x=0,!(v&1)):0){b:do if(m){x=0;Ea(k[(k[a>>2]|0)+48>>2]|0,a|0,59007,59017,w|0)|0;v=x;x=0;if(v&1){G=10;break a}j=k[y>>2]|0;l=k[D>>2]|0;a=j-l|0;if((a|0)>392){a=Pl((a>>2)+2|0)|0;h=a;if(!a){x=0;Ga(6);v=x;x=0;if(!(v&1)){a=0;G=13}}else G=13}else{h=0;a=z;G=13}do if((G|0)==13){if(i[n>>0]|0){i[a>>0]=45;a=a+1|0}u=w+40|0;v=w;if(l>>>0>>0){m=w+4|0;d=m+4|0;e=d+4|0;n=e+4|0;o=n+4|0;p=o+4|0;q=p+4|0;s=q+4|0;t=s+4|0;do{j=k[l>>2]|0;do if((k[w>>2]|0)!=(j|0))if((k[m>>2]|0)!=(j|0))if((k[d>>2]|0)!=(j|0))if((k[e>>2]|0)!=(j|0))if((k[n>>2]|0)==(j|0))j=n;else{if((k[o>>2]|0)==(j|0)){j=o;break}if((k[p>>2]|0)==(j|0)){j=p;break}if((k[q>>2]|0)==(j|0)){j=q;break}if((k[s>>2]|0)==(j|0)){j=s;break}j=(k[t>>2]|0)==(j|0)?t:u}else j=e;else j=d;else j=m;else j=w;while(0);i[a>>0]=i[59007+(j-v>>2)>>0]|0;l=l+4|0;a=a+1|0}while(l>>>0<(k[y>>2]|0)>>>0)}i[a>>0]=0;k[A>>2]=g;if((jl(z,58987,A)|0)!=1?(x=0,qa(190,58991),g=x,x=0,g&1):0)break;if(h)Ql(h);break b}while(0);a=Wa()|0;if(!h){j=a;h=D;break a}Ql(h);j=a;h=D;break a}while(0);a=k[b>>2]|0;do if(a){h=k[a+12>>2]|0;if((h|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1){G=10;break a}}else a=k[h>>2]|0;if((a|0)==-1){k[b>>2]=0;j=1;break}else{j=(k[b>>2]|0)==0;break}}else j=1;while(0);a=k[c>>2]|0;do if(a){h=k[a+12>>2]|0;if((h|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1){G=10;break a}}else a=k[h>>2]|0;if((a|0)!=-1)if(j)break;else{G=40;break}else{k[c>>2]=0;G=38;break}}else G=38;while(0);if((G|0)==38?j:0)G=40;if((G|0)==40)k[f>>2]=k[f>>2]|2;h=k[b>>2]|0;zm(k[C>>2]|0)|0;a=k[D>>2]|0;k[D>>2]=0;if((a|0)!=0?(x=0,qa(k[F>>2]|0,a|0),G=x,x=0,G&1):0){G=Wa(0)|0;oc(G)}r=B;return h|0}else G=10;while(0);if((G|0)==10){j=Wa()|0;h=D}zm(k[C>>2]|0)|0;a=k[h>>2]|0;k[h>>2]=0;if(!a)E=j;else{h=k[F>>2]|0;G=47}}else{j=Wa()|0;k[D>>2]=0;h=189;G=47}if((G|0)==47){x=0;qa(h|0,a|0);G=x;x=0;if(G&1){G=Wa(0)|0;oc(G)}else E=j}fb(E|0);return 0}function gs(a,b,c,d,e,f,g,h,j,m,n){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;m=m|0;n=n|0;var o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;Y=r;r=r+512|0;K=Y+96|0;o=Y+104|0;_=Y+88|0;O=Y+80|0;N=Y+76|0;P=Y+504|0;L=Y+72|0;Q=Y+68|0;T=Y+56|0;X=Y+44|0;V=Y+32|0;U=Y+20|0;W=Y+8|0;M=Y+4|0;S=Y;k[K>>2]=n;k[_>>2]=o;Z=_+4|0;k[Z>>2]=189;k[O>>2]=o;k[N>>2]=o+400;k[T>>2]=0;k[T+4>>2]=0;k[T+8>>2]=0;k[X>>2]=0;k[X+4>>2]=0;k[X+8>>2]=0;k[V>>2]=0;k[V+4>>2]=0;k[V+8>>2]=0;k[U>>2]=0;k[U+4>>2]=0;k[U+8>>2]=0;k[W>>2]=0;k[W+4>>2]=0;k[W+8>>2]=0;x=0;za(2,c|0,d|0,P|0,L|0,Q|0,T|0,X|0,V|0,U|0,M|0);J=x;x=0;a:do if(J&1)c=Wa()|0;else{k[m>>2]=k[j>>2];G=V+4|0;H=U+4|0;I=U+8|0;J=V+8|0;z=(e&512|0)!=0;A=X+8|0;B=X+4|0;C=W+4|0;D=W+8|0;E=P+3|0;F=T+4|0;y=0;q=0;b:while(1){n=k[a>>2]|0;do if(n){c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=26;break b}}else n=k[c>>2]|0;if((n|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);c=k[b>>2]|0;do if(c){n=k[c+12>>2]|0;if((n|0)==(k[c+16>>2]|0)){x=0;n=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=26;break b}}else n=k[n>>2]|0;if((n|0)!=-1)if(d){w=c;break}else{s=o;R=244;break b}else{k[b>>2]=0;R=16;break}}else R=16;while(0);if((R|0)==16){R=0;if(d){s=o;R=244;break}else w=0}c:do switch(i[P+y>>0]|0){case 1:{if((y|0)!=3){n=k[a>>2]|0;c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;R=x;x=0;if(R&1){R=26;break b}}else n=k[c>>2]|0;x=0;n=va(k[(k[h>>2]|0)+12>>2]|0,h|0,8192,n|0)|0;R=x;x=0;if(R&1){R=26;break b}if(!n){R=42;break b}n=k[a>>2]|0;c=n+12|0;d=k[c>>2]|0;if((d|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+40>>2]|0,n|0)|0;R=x;x=0;if(R&1){R=26;break b}}else{k[c>>2]=d+4;n=k[d>>2]|0}x=0;ra(92,W|0,n|0);R=x;x=0;if(R&1){R=26;break b}else{n=w;e=w;R=44}}else n=o;break}case 0:{if((y|0)==3)n=o;else{n=w;e=w;R=44}break}case 3:{c=i[V>>0]|0;n=(c&1)==0?(c&255)>>>1:k[G>>2]|0;d=i[U>>0]|0;e=(d&1)==0?(d&255)>>>1:k[H>>2]|0;if((n|0)==(0-e|0))n=o;else{if(!n){n=k[a>>2]|0;c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=26;break b}c=i[U>>0]|0}else{n=k[c>>2]|0;c=d}if((n|0)!=(k[((c&1)==0?H:k[I>>2]|0)>>2]|0)){n=o;break c}n=k[a>>2]|0;c=n+12|0;d=k[c>>2]|0;if((d|0)==(k[n+16>>2]|0)){x=0;ta(k[(k[n>>2]|0)+40>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=26;break b}}else k[c>>2]=d+4;i[g>>0]=1;w=i[U>>0]|0;n=o;q=((w&1)==0?(w&255)>>>1:k[H>>2]|0)>>>0>1?U:q;break c}p=k[a>>2]|0;s=k[p+12>>2]|0;d=k[p+16>>2]|0;n=(s|0)==(d|0);if(!e){if(n){x=0;n=ta(k[(k[p>>2]|0)+36>>2]|0,p|0)|0;w=x;x=0;if(w&1){R=26;break b}c=i[V>>0]|0}else n=k[s>>2]|0;if((n|0)!=(k[((c&1)==0?G:k[J>>2]|0)>>2]|0)){i[g>>0]=1;n=o;break c}n=k[a>>2]|0;c=n+12|0;d=k[c>>2]|0;if((d|0)==(k[n+16>>2]|0)){x=0;ta(k[(k[n>>2]|0)+40>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=26;break b}}else k[c>>2]=d+4;w=i[V>>0]|0;n=o;q=((w&1)==0?(w&255)>>>1:k[G>>2]|0)>>>0>1?V:q;break c}if(n){x=0;n=ta(k[(k[p>>2]|0)+36>>2]|0,p|0)|0;w=x;x=0;if(w&1){R=26;break b}d=k[a>>2]|0;c=i[V>>0]|0;p=d;s=k[d+12>>2]|0;d=k[d+16>>2]|0}else n=k[s>>2]|0;e=p+12|0;d=(s|0)==(d|0);if((n|0)==(k[((c&1)==0?G:k[J>>2]|0)>>2]|0)){if(d){x=0;ta(k[(k[p>>2]|0)+40>>2]|0,p|0)|0;w=x;x=0;if(w&1){R=26;break b}}else k[e>>2]=s+4;w=i[V>>0]|0;n=o;q=((w&1)==0?(w&255)>>>1:k[G>>2]|0)>>>0>1?V:q;break c}if(d){x=0;n=ta(k[(k[p>>2]|0)+36>>2]|0,p|0)|0;w=x;x=0;if(w&1){R=26;break b}}else n=k[s>>2]|0;if((n|0)!=(k[((i[U>>0]&1)==0?H:k[I>>2]|0)>>2]|0)){R=107;break b}n=k[a>>2]|0;c=n+12|0;d=k[c>>2]|0;if((d|0)==(k[n+16>>2]|0)){x=0;ta(k[(k[n>>2]|0)+40>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=26;break b}}else k[c>>2]=d+4;i[g>>0]=1;w=i[U>>0]|0;n=o;q=((w&1)==0?(w&255)>>>1:k[H>>2]|0)>>>0>1?U:q}break}case 2:{if(!(y>>>0<2|(q|0)!=0)?!(z|(y|0)==2&(i[E>>0]|0)!=0):0){n=o;q=0;break c}e=i[X>>0]|0;d=k[A>>2]|0;c=(e&1)==0?B:d;n=c;d:do if((y|0)!=0?(l[P+(y+-1)>>0]|0)<2:0){v=(e&1)==0;e:do if((c|0)!=((v?B:d)+((v?(e&255)>>>1:k[B>>2]|0)<<2)|0)){e=c;while(1){x=0;c=va(k[(k[h>>2]|0)+12>>2]|0,h|0,8192,k[e>>2]|0)|0;v=x;x=0;if(v&1){R=23;break b}if(!c)break;e=e+4|0;n=e;c=i[X>>0]|0;d=k[A>>2]|0;v=(c&1)==0;if((e|0)==((v?B:d)+((v?(c&255)>>>1:k[B>>2]|0)<<2)|0)){e=c;break e}}e=i[X>>0]|0;d=k[A>>2]|0}while(0);s=(e&1)==0?B:d;c=s;t=n-c>>2;u=i[W>>0]|0;p=(u&1)==0;u=p?(u&255)>>>1:k[C>>2]|0;if(u>>>0>=t>>>0){p=p?C:k[D>>2]|0;v=p+(u<<2)|0;if(!t)c=n;else{p=p+(u-t<<2)|0;while(1){if((k[p>>2]|0)!=(k[s>>2]|0))break d;p=p+4|0;if((p|0)==(v|0)){c=n;break}else s=s+4|0}}}}else c=n;while(0);n=(e&1)==0;n=(n?B:d)+((n?(e&255)>>>1:k[B>>2]|0)<<2)|0;f:do if((c|0)!=(n|0)){p=w;e=w;n=c;while(1){c=k[a>>2]|0;do if(c){d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=22;break b}}else c=k[d>>2]|0;if((c|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);do if(e){c=k[e+12>>2]|0;if((c|0)==(k[e+16>>2]|0)){x=0;c=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=22;break b}}else c=k[c>>2]|0;if((c|0)!=-1)if(d^(p|0)==0){c=p;s=p;break}else break f;else{k[b>>2]=0;c=0;R=136;break}}else{c=p;R=136}while(0);if((R|0)==136){R=0;if(d)break f;else s=0}d=k[a>>2]|0;e=k[d+12>>2]|0;if((e|0)==(k[d+16>>2]|0)){x=0;d=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){R=22;break b}}else d=k[e>>2]|0;if((d|0)!=(k[n>>2]|0))break f;d=k[a>>2]|0;e=d+12|0;p=k[e>>2]|0;if((p|0)==(k[d+16>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;w=x;x=0;if(w&1){R=22;break b}}else k[e>>2]=p+4;n=n+4|0;d=i[X>>0]|0;w=(d&1)==0;d=(w?B:k[A>>2]|0)+((w?(d&255)>>>1:k[B>>2]|0)<<2)|0;if((n|0)==(d|0)){n=d;break}else{p=c;e=s}}}while(0);if(z?(w=i[X>>0]|0,v=(w&1)==0,(n|0)!=((v?B:k[A>>2]|0)+((v?(w&255)>>>1:k[B>>2]|0)<<2)|0)):0){R=148;break b}else n=o;break}case 4:{u=k[Q>>2]|0;t=w;p=w;n=o;c=0;g:while(1){d=k[a>>2]|0;do if(d){e=k[d+12>>2]|0;if((e|0)==(k[d+16>>2]|0)){x=0;d=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){R=25;break b}}else d=k[e>>2]|0;if((d|0)==-1){k[a>>2]=0;e=1;break}else{e=(k[a>>2]|0)==0;break}}else e=1;while(0);do if(p){d=k[p+12>>2]|0;if((d|0)==(k[p+16>>2]|0)){x=0;d=ta(k[(k[p>>2]|0)+36>>2]|0,p|0)|0;w=x;x=0;if(w&1){R=25;break b}}else d=k[d>>2]|0;if((d|0)!=-1)if(e^(t|0)==0){d=t;s=t;break}else{o=t;break g}else{k[b>>2]=0;d=0;R=162;break}}else{d=t;R=162}while(0);if((R|0)==162){R=0;if(e){o=d;break}else s=0}e=k[a>>2]|0;o=k[e+12>>2]|0;if((o|0)==(k[e+16>>2]|0)){x=0;e=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=25;break b}}else e=k[o>>2]|0;x=0;o=va(k[(k[h>>2]|0)+12>>2]|0,h|0,2048,e|0)|0;w=x;x=0;if(w&1){R=25;break b}if(o){o=k[m>>2]|0;if((o|0)==(k[K>>2]|0)){x=0;Fa(14,j|0,m|0,K|0);w=x;x=0;if(w&1){R=25;break b}o=k[m>>2]|0}k[m>>2]=o+4;k[o>>2]=e;c=c+1|0}else{w=i[T>>0]|0;if(!((e|0)==(u|0)&((c|0)!=0?(((w&1)==0?(w&255)>>>1:k[F>>2]|0)|0)!=0:0))){o=d;break}if((n|0)==(k[N>>2]|0)){x=0;Fa(13,_|0,O|0,N|0);w=x;x=0;if(w&1){R=25;break b}n=k[O>>2]|0}w=n+4|0;k[O>>2]=w;k[n>>2]=c;n=w;c=0}e=k[a>>2]|0;o=e+12|0;p=k[o>>2]|0;if((p|0)==(k[e+16>>2]|0)){x=0;ta(k[(k[e>>2]|0)+40>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=25;break b}else{t=d;p=s;continue}}else{k[o>>2]=p+4;t=d;p=s;continue}}if((c|0)!=0?(k[_>>2]|0)!=(n|0):0){if((n|0)==(k[N>>2]|0)){x=0;Fa(13,_|0,O|0,N|0);w=x;x=0;if(w&1){R=26;break b}n=k[O>>2]|0}w=n+4|0;k[O>>2]=w;k[n>>2]=c;n=w}s=k[M>>2]|0;if((s|0)>0){c=k[a>>2]|0;do if(c){d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=26;break b}}else c=k[d>>2]|0;if((c|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);do if(o){c=k[o+12>>2]|0;if((c|0)==(k[o+16>>2]|0)){x=0;c=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;w=x;x=0;if(w&1){R=26;break b}}else c=k[c>>2]|0;if((c|0)!=-1)if(d)break;else{R=206;break b}else{k[b>>2]=0;R=200;break}}else R=200;while(0);if((R|0)==200){R=0;if(d){R=206;break b}else o=0}c=k[a>>2]|0;d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=26;break b}}else c=k[d>>2]|0;if((c|0)!=(k[L>>2]|0)){R=206;break b}c=k[a>>2]|0;d=c+12|0;e=k[d>>2]|0;if((e|0)==(k[c+16>>2]|0)){x=0;ta(k[(k[c>>2]|0)+40>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=26;break b}}else k[d>>2]=e+4;if((s|0)>0){p=o;e=o;t=s;while(1){c=k[a>>2]|0;do if(c){d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=24;break b}}else c=k[d>>2]|0;if((c|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);do if(e){c=k[e+12>>2]|0;if((c|0)==(k[e+16>>2]|0)){x=0;c=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=24;break b}}else c=k[c>>2]|0;if((c|0)!=-1)if(d^(p|0)==0){c=p;s=p;break}else{R=231;break b}else{k[b>>2]=0;c=0;R=224;break}}else{c=p;R=224}while(0);if((R|0)==224){R=0;if(d){R=231;break b}else s=0}d=k[a>>2]|0;e=k[d+12>>2]|0;if((e|0)==(k[d+16>>2]|0)){x=0;d=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){R=24;break b}}else d=k[e>>2]|0;x=0;d=va(k[(k[h>>2]|0)+12>>2]|0,h|0,2048,d|0)|0;w=x;x=0;if(w&1){R=24;break b}if(!d){R=231;break b}if((k[m>>2]|0)==(k[K>>2]|0)?(x=0,Fa(14,j|0,m|0,K|0),w=x,x=0,w&1):0){R=24;break b}d=k[a>>2]|0;e=k[d+12>>2]|0;if((e|0)==(k[d+16>>2]|0)){x=0;d=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;w=x;x=0;if(w&1){R=24;break b}}else d=k[e>>2]|0;e=k[m>>2]|0;k[m>>2]=e+4;k[e>>2]=d;d=t;t=t+-1|0;k[M>>2]=t;e=k[a>>2]|0;o=e+12|0;p=k[o>>2]|0;if((p|0)==(k[e+16>>2]|0)){x=0;ta(k[(k[e>>2]|0)+40>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=24;break b}}else k[o>>2]=p+4;if((d|0)<=1)break;else{p=c;e=s}}}}if((k[m>>2]|0)==(k[j>>2]|0)){R=242;break b}break}default:n=o}while(0);h:do if((R|0)==44)while(1){R=0;c=k[a>>2]|0;do if(c){d=k[c+12>>2]|0;if((d|0)==(k[c+16>>2]|0)){x=0;c=ta(k[(k[c>>2]|0)+36>>2]|0,c|0)|0;w=x;x=0;if(w&1){R=21;break b}}else c=k[d>>2]|0;if((c|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);do if(e){c=k[e+12>>2]|0;if((c|0)==(k[e+16>>2]|0)){x=0;c=ta(k[(k[e>>2]|0)+36>>2]|0,e|0)|0;w=x;x=0;if(w&1){R=21;break b}}else c=k[c>>2]|0;if((c|0)!=-1)if(d^(n|0)==0){p=n;e=n;break}else{n=o;break h}else{k[b>>2]=0;n=0;R=57;break}}else R=57;while(0);if((R|0)==57){R=0;if(d){n=o;break h}else{p=n;e=0}}n=k[a>>2]|0;c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;w=x;x=0;if(w&1){R=21;break b}}else n=k[c>>2]|0;x=0;n=va(k[(k[h>>2]|0)+12>>2]|0,h|0,8192,n|0)|0;w=x;x=0;if(w&1){R=21;break b}if(!n){n=o;break h}n=k[a>>2]|0;c=n+12|0;d=k[c>>2]|0;if((d|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+40>>2]|0,n|0)|0;R=x;x=0;if(R&1){R=21;break b}}else{k[c>>2]=d+4;n=k[d>>2]|0}x=0;ra(92,W|0,n|0);R=x;x=0;if(R&1){R=21;break b}else{n=p;R=44}}while(0);y=y+1|0;if(y>>>0>=4){s=n;R=244;break}else o=n}i:switch(R|0){case 21:{c=Wa()|0;break a}case 22:{c=Wa()|0;break a}case 23:{c=Wa()|0;break a}case 24:{c=Wa()|0;break a}case 25:{c=Wa()|0;break a}case 26:{c=Wa()|0;break a}case 42:{k[f>>2]=k[f>>2]|4;c=0;break}case 107:{k[f>>2]=k[f>>2]|4;c=0;break}case 148:{k[f>>2]=k[f>>2]|4;c=0;break}case 206:{k[f>>2]=k[f>>2]|4;c=0;break}case 231:{k[f>>2]=k[f>>2]|4;c=0;break}case 242:{k[f>>2]=k[f>>2]|4;c=0;break}case 244:{j:do if(q){o=q+4|0;p=q+8|0;e=1;k:while(1){n=i[q>>0]|0;if(!(n&1))n=(n&255)>>>1;else n=k[o>>2]|0;if(e>>>0>=n>>>0)break j;n=k[a>>2]|0;do if(n){c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;m=x;x=0;if(m&1){R=20;break k}}else n=k[c>>2]|0;if((n|0)==-1){k[a>>2]=0;d=1;break}else{d=(k[a>>2]|0)==0;break}}else d=1;while(0);n=k[b>>2]|0;do if(n){c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;m=x;x=0;if(m&1){R=20;break k}}else n=k[c>>2]|0;if((n|0)!=-1)if(d)break;else{R=271;break k}else{k[b>>2]=0;R=263;break}}else R=263;while(0);if((R|0)==263?(R=0,d):0){R=271;break}n=k[a>>2]|0;c=k[n+12>>2]|0;if((c|0)==(k[n+16>>2]|0)){x=0;n=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;m=x;x=0;if(m&1){R=20;break}}else n=k[c>>2]|0;if(!(i[q>>0]&1))c=o;else c=k[p>>2]|0;if((n|0)!=(k[c+(e<<2)>>2]|0)){R=271;break}n=e+1|0;c=k[a>>2]|0;d=c+12|0;e=k[d>>2]|0;if((e|0)==(k[c+16>>2]|0)){x=0;ta(k[(k[c>>2]|0)+40>>2]|0,c|0)|0;m=x;x=0;if(m&1){R=20;break}else{e=n;continue}}else{k[d>>2]=e+4;e=n;continue}}if((R|0)==20){c=Wa()|0;break a}else if((R|0)==271){k[f>>2]=k[f>>2]|4;c=0;break i}}while(0);n=k[_>>2]|0;if((n|0)!=(s|0)?(k[S>>2]=0,cs(T,n,s,S),(k[S>>2]|0)!=0):0){k[f>>2]=k[f>>2]|4;c=0}else c=1;break}}en(W);en(U);en(V);en(X);Sm(T);n=k[_>>2]|0;k[_>>2]=0;if((n|0)!=0?(x=0,qa(k[Z>>2]|0,n|0),_=x,x=0,_&1):0){_=Wa(0)|0;oc(_)}r=Y;return c|0}while(0);en(W);en(U);en(V);en(X);Sm(T);n=k[_>>2]|0;k[_>>2]=0;if((n|0)!=0?(x=0,qa(k[Z>>2]|0,n|0),_=x,x=0,_&1):0){_=Wa(0)|0;oc(_)}fb(c|0);return 0}function hs(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;v=r;r=r+432|0;h=v+424|0;a=v+24|0;y=v+16|0;q=v+8|0;n=v+4|0;o=v+428|0;j=v;k[y>>2]=a;A=y+4|0;k[A>>2]=189;l=a+400|0;x=0;u=ta(68,e|0)|0;m=x;x=0;if(!(m&1)){k[n>>2]=u;x=0;m=Aa(37,n|0,44212)|0;a=x;x=0;a:do if(!(a&1)?(i[o>>0]=0,s=k[c>>2]|0,k[j>>2]=s,p=k[e+4>>2]|0,t=s,x=0,k[h>>2]=k[j>>2],p=ua(2,b|0,h|0,d|0,n|0,p|0,f|0,o|0,m|0,y|0,q|0,l|0)|0,e=x,x=0,!(e&1)):0){if(p){if(!(i[g>>0]&1))i[g>>0]=0;else k[k[g+8>>2]>>2]=0;k[g+4>>2]=0;if(i[o>>0]|0){x=0;a=Aa(k[(k[m>>2]|0)+44>>2]|0,m|0,45)|0;e=x;x=0;if(e&1)break;x=0;ra(92,g|0,a|0);e=x;x=0;if(e&1)break}x=0;j=Aa(k[(k[m>>2]|0)+44>>2]|0,m|0,48)|0;e=x;x=0;if(e&1)break;a=k[y>>2]|0;l=k[q>>2]|0;h=l+-4|0;b:do if(a>>>0>>0)do{if((k[a>>2]|0)!=(j|0))break b;a=a+4|0}while(a>>>0>>0);while(0);x=0;va(33,g|0,a|0,l|0)|0;g=x;x=0;if(g&1)break}a=k[b>>2]|0;do if(a){h=k[a+12>>2]|0;if((h|0)==(k[a+16>>2]|0)){x=0;a=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;g=x;x=0;if(g&1)break a}else a=k[h>>2]|0;if((a|0)==-1){k[b>>2]=0;h=1;break}else{h=(k[b>>2]|0)==0;break}}else h=1;while(0);do if(s){a=k[t+12>>2]|0;if((a|0)==(k[t+16>>2]|0)){x=0;a=ta(k[(k[s>>2]|0)+36>>2]|0,t|0)|0;t=x;x=0;if(t&1)break a}else a=k[a>>2]|0;if((a|0)!=-1)if(h)break;else{z=32;break}else{k[c>>2]=0;z=30;break}}else z=30;while(0);if((z|0)==30?h:0)z=32;if((z|0)==32)k[f>>2]=k[f>>2]|2;h=k[b>>2]|0;zm(u)|0;a=k[y>>2]|0;k[y>>2]=0;if((a|0)!=0?(x=0,qa(k[A>>2]|0,a|0),A=x,x=0,A&1):0){A=Wa(0)|0;oc(A)}r=v;return h|0}while(0);h=Wa()|0;zm(u)|0;a=k[y>>2]|0;k[y>>2]=0;if(!a)w=h;else z=38}else{h=Wa()|0;k[y>>2]=0;z=38}if((z|0)==38){x=0;qa(k[A>>2]|0,a|0);A=x;x=0;if(A&1){A=Wa(0)|0;oc(A)}else w=h}fb(w|0);return 0}function is(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0;z=r;r=r+112|0;m=z+100|0;n=z+88|0;o=z+76|0;p=z+64|0;q=z+52|0;s=z+48|0;t=z+36|0;u=z+24|0;v=z+12|0;w=z;do if(a){a=Ss(b,43956)|0;Mb[k[(k[a>>2]|0)+44>>2]&127](m,a);w=k[m>>2]|0;i[c>>0]=w;i[c+1>>0]=w>>8;i[c+2>>0]=w>>16;i[c+3>>0]=w>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](n,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[j>>2]=k[n>>2];k[j+4>>2]=k[n+4>>2];k[j+8>>2]=k[n+8>>2];k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;en(n);Mb[k[(k[a>>2]|0)+28>>2]&127](o,a);if(!(i[h>>0]&1))i[h>>0]=0;else k[k[h+8>>2]>>2]=0;k[h+4>>2]=0;x=0;ra(93,h|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[h>>2]=k[o>>2];k[h+4>>2]=k[o+4>>2];k[h+8>>2]=k[o+8>>2];k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;en(o);h=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;k[d>>2]=h;h=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;k[e>>2]=h;Mb[k[(k[a>>2]|0)+20>>2]&127](p,a);if(!(i[f>>0]&1)){i[f+1>>0]=0;i[f>>0]=0}else{i[k[f+8>>2]>>0]=0;k[f+4>>2]=0}x=0;ra(91,f|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)};k[f>>2]=k[p>>2];k[f+4>>2]=k[p+4>>2];k[f+8>>2]=k[p+8>>2];k[p>>2]=0;k[p+4>>2]=0;k[p+8>>2]=0;Sm(p);Mb[k[(k[a>>2]|0)+24>>2]&127](q,a);if(!(i[g>>0]&1))i[g>>0]=0;else k[k[g+8>>2]>>2]=0;k[g+4>>2]=0;x=0;ra(93,g|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else{k[g>>2]=k[q>>2];k[g+4>>2]=k[q+4>>2];k[g+8>>2]=k[q+8>>2];k[q>>2]=0;k[q+4>>2]=0;k[q+8>>2]=0;en(q);y=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}else{a=Ss(b,43892)|0;Mb[k[(k[a>>2]|0)+44>>2]&127](s,a);s=k[s>>2]|0;i[c>>0]=s;i[c+1>>0]=s>>8;i[c+2>>0]=s>>16;i[c+3>>0]=s>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](t,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[j>>2]=k[t>>2];k[j+4>>2]=k[t+4>>2];k[j+8>>2]=k[t+8>>2];k[t>>2]=0;k[t+4>>2]=0;k[t+8>>2]=0;en(t);Mb[k[(k[a>>2]|0)+28>>2]&127](u,a);if(!(i[h>>0]&1))i[h>>0]=0;else k[k[h+8>>2]>>2]=0;k[h+4>>2]=0;x=0;ra(93,h|0,0);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)};k[h>>2]=k[u>>2];k[h+4>>2]=k[u+4>>2];k[h+8>>2]=k[u+8>>2];k[u>>2]=0;k[u+4>>2]=0;k[u+8>>2]=0;en(u);h=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;k[d>>2]=h;h=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;k[e>>2]=h;Mb[k[(k[a>>2]|0)+20>>2]&127](v,a);if(!(i[f>>0]&1)){i[f+1>>0]=0;i[f>>0]=0}else{i[k[f+8>>2]>>0]=0;k[f+4>>2]=0}x=0;ra(91,f|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)};k[f>>2]=k[v>>2];k[f+4>>2]=k[v+4>>2];k[f+8>>2]=k[v+8>>2];k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;Sm(v);Mb[k[(k[a>>2]|0)+24>>2]&127](w,a);if(!(i[g>>0]&1))i[g>>0]=0;else k[k[g+8>>2]>>2]=0;k[g+4>>2]=0;x=0;ra(93,g|0,0);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else{k[g>>2]=k[w>>2];k[g+4>>2]=k[w+4>>2];k[g+8>>2]=k[w+8>>2];k[w>>2]=0;k[w+4>>2]=0;k[w+8>>2]=0;en(w);y=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}while(0);k[l>>2]=y;r=z;return}function js(a){a=a|0;return}function ks(a){a=a|0;mj(a);return}function ls(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;D=r;r=r+384|0;u=D+8|0;g=D;j=D+284|0;l=D+72|0;h=D+184|0;F=D+68|0;A=D+80|0;w=D+77|0;B=D+76|0;G=D+56|0;I=D+44|0;H=D+32|0;m=D+28|0;t=D+84|0;z=D+24|0;y=D+20|0;v=D+16|0;k[l>>2]=j;p[u>>3]=f;j=il(j,100,59018,u)|0;do if(j>>>0>99){x=0;a=Da(3)|0;C=x;x=0;if(!(C&1)?(x=0,p[g>>3]=f,q=Ea(17,l|0,a|0,59018,g|0)|0,C=x,x=0,!(C&1)):0){a=k[l>>2]|0;if(!a){x=0;Ga(6);C=x;x=0;if(C&1){a=0;g=0;C=7;break}a=k[l>>2]|0}h=Pl(q)|0;g=h;if(!h){x=0;Ga(6);C=x;x=0;if(C&1)C=7;else{s=0;C=10}}else{s=h;C=10}}else{a=0;g=0;C=7}}else{g=0;a=0;s=h;q=j;C=10}while(0);if((C|0)==10){x=0;h=ta(68,d|0)|0;o=x;x=0;if(o&1)C=7;else{k[F>>2]=h;x=0;o=Aa(37,F|0,44220)|0;n=x;x=0;if(!(n&1)?(n=k[l>>2]|0,x=0,Ea(k[(k[o>>2]|0)+32>>2]|0,o|0,n|0,n+q|0,s|0)|0,n=x,x=0,!(n&1)):0){if(!q)n=0;else n=(i[k[l>>2]>>0]|0)==45;k[G>>2]=0;k[G+4>>2]=0;k[G+8>>2]=0;k[I>>2]=0;k[I+4>>2]=0;k[I+8>>2]=0;k[H>>2]=0;k[H+4>>2]=0;k[H+8>>2]=0;x=0;za(3,c|0,n|0,F|0,A|0,w|0,B|0,G|0,I|0,H|0,m|0);c=x;x=0;if(!(c&1)){m=k[m>>2]|0;if((q|0)>(m|0)){c=i[H>>0]|0;j=i[I>>0]|0;j=(q-m<<1|1)+m+((c&1)==0?(c&255)>>>1:k[H+4>>2]|0)+((j&1)==0?(j&255)>>>1:k[I+4>>2]|0)|0}else{c=i[H>>0]|0;j=i[I>>0]|0;j=m+2+((c&1)==0?(c&255)>>>1:k[H+4>>2]|0)+((j&1)==0?(j&255)>>>1:k[I+4>>2]|0)|0}if(j>>>0>100){j=Pl(j)|0;l=j;if(!j){x=0;Ga(6);t=x;x=0;if(!(t&1)){j=0;C=26}}else C=26}else{l=0;j=t;C=26}if((C|0)==26){x=0;wa(1,j|0,z|0,y|0,k[d+4>>2]|0,s|0,s+q|0,o|0,n|0,A|0,i[w>>0]|0,i[B>>0]|0,G|0,I|0,H|0,m|0);B=x;x=0;if(!(B&1)?(k[v>>2]=k[b>>2],b=k[z>>2]|0,E=k[y>>2]|0,x=0,k[u>>2]=k[v>>2],E=sa(39,u|0,j|0,b|0,E|0,d|0,e|0)|0,b=x,x=0,!(b&1)):0){if(l){Ql(l);h=k[F>>2]|0}Sm(H);Sm(I);Sm(G);zm(h)|0;if(g)Ql(g);if(a)Ql(a);r=D;return E|0}}j=Wa()|0;if(l){Ql(l);h=k[F>>2]|0}}else j=Wa()|0;Sm(H);Sm(I);Sm(G)}else j=Wa()|0;zm(h)|0}}if((C|0)==7)j=Wa()|0;if(g)Ql(g);if(a)Ql(a);fb(j|0);return 0}function ms(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;D=r;r=r+112|0;o=D+108|0;p=D+96|0;t=D+92|0;u=D+80|0;v=D+68|0;w=D+56|0;y=D+52|0;z=D+40|0;A=D+36|0;B=D+24|0;q=D+12|0;s=D;do if(a){a=Ss(c,43828)|0;c=k[a>>2]|0;do if(b){Mb[k[c+44>>2]&127](o,a);b=k[o>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](p,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[p>>2];k[j+4>>2]=k[p+4>>2];k[j+8>>2]=k[p+8>>2];k[p>>2]=0;k[p+4>>2]=0;k[p+8>>2]=0;Sm(p);n=a;break}}else{Mb[k[c+40>>2]&127](t,a);b=k[t>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+28>>2]&127](u,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[u>>2];k[j+4>>2]=k[u+4>>2];k[j+8>>2]=k[u+8>>2];k[u>>2]=0;k[u+4>>2]=0;k[u+8>>2]=0;Sm(u);n=a;break}}while(0);j=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;i[e>>0]=j;j=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;i[f>>0]=j;Mb[k[(k[n>>2]|0)+20>>2]&127](v,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)};k[g>>2]=k[v>>2];k[g+4>>2]=k[v+4>>2];k[g+8>>2]=k[v+8>>2];k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;Sm(v);Mb[k[(k[n>>2]|0)+24>>2]&127](w,a);if(!(i[h>>0]&1)){i[h+1>>0]=0;i[h>>0]=0}else{i[k[h+8>>2]>>0]=0;k[h+4>>2]=0}x=0;ra(91,h|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)}else{k[h>>2]=k[w>>2];k[h+4>>2]=k[w+4>>2];k[h+8>>2]=k[w+8>>2];k[w>>2]=0;k[w+4>>2]=0;k[w+8>>2]=0;Sm(w);C=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}else{a=Ss(c,43764)|0;c=k[a>>2]|0;do if(b){Mb[k[c+44>>2]&127](y,a);b=k[y>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](z,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[z>>2];k[j+4>>2]=k[z+4>>2];k[j+8>>2]=k[z+8>>2];k[z>>2]=0;k[z+4>>2]=0;k[z+8>>2]=0;Sm(z);m=a;break}}else{Mb[k[c+40>>2]&127](A,a);b=k[A>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+28>>2]&127](B,a);if(!(i[j>>0]&1)){i[j+1>>0]=0;i[j>>0]=0}else{i[k[j+8>>2]>>0]=0;k[j+4>>2]=0}x=0;ra(91,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[B>>2];k[j+4>>2]=k[B+4>>2];k[j+8>>2]=k[B+8>>2];k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;Sm(B);m=a;break}}while(0);j=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;i[e>>0]=j;j=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;i[f>>0]=j;Mb[k[(k[m>>2]|0)+20>>2]&127](q,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)};k[g>>2]=k[q>>2];k[g+4>>2]=k[q+4>>2];k[g+8>>2]=k[q+8>>2];k[q>>2]=0;k[q+4>>2]=0;k[q+8>>2]=0;Sm(q);Mb[k[(k[m>>2]|0)+24>>2]&127](s,a);if(!(i[h>>0]&1)){i[h+1>>0]=0;i[h>>0]=0}else{i[k[h+8>>2]>>0]=0;k[h+4>>2]=0}x=0;ra(91,h|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)}else{k[h>>2]=k[s>>2];k[h+4>>2]=k[s+4>>2];k[h+8>>2]=k[s+8>>2];k[s>>2]=0;k[s+4>>2]=0;k[s+8>>2]=0;Sm(s);C=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}while(0);k[l>>2]=C;r=D;return}function ns(a,b,c,d,e,f,g,h,l,m,n,o,p,q,r){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;k[c>>2]=a;N=q+4|0;O=q+8|0;P=q+1|0;H=p+4|0;I=(d&512|0)==0;J=p+8|0;K=p+1|0;L=g+8|0;M=(r|0)>0;A=o+4|0;B=o+8|0;C=o+1|0;D=r+1|0;F=-2-r-((r|0)<0?~r:-1)|0;G=(r|0)>0;z=0;do{switch(i[l+z>>0]|0){case 0:{k[b>>2]=k[c>>2];break}case 1:{k[b>>2]=k[c>>2];x=Vb[k[(k[g>>2]|0)+28>>2]&63](g,32)|0;y=k[c>>2]|0;k[c>>2]=y+1;i[y>>0]=x;break}case 3:{y=i[q>>0]|0;s=(y&1)==0;if((s?(y&255)>>>1:k[N>>2]|0)|0){x=i[(s?P:k[O>>2]|0)>>0]|0;y=k[c>>2]|0;k[c>>2]=y+1;i[y>>0]=x}break}case 2:{u=i[p>>0]|0;s=(u&1)==0;u=s?(u&255)>>>1:k[H>>2]|0;if(!(I|(u|0)==0)){t=s?K:k[J>>2]|0;v=t+u|0;s=k[c>>2]|0;if(u)do{i[s>>0]=i[t>>0]|0;t=t+1|0;s=s+1|0}while((t|0)!=(v|0));k[c>>2]=s}break}case 4:{s=k[c>>2]|0;e=h?e+1|0:e;w=e;v=k[L>>2]|0;a:do if(e>>>0>>0){t=e;do{u=i[t>>0]|0;if(u<<24>>24<=-1)break a;if(!(j[v+(u<<24>>24<<1)>>1]&2048))break a;t=t+1|0}while(t>>>0>>0)}else t=e;while(0);u=t;if(M){x=-2-u-~(u>>>0>w>>>0?w:u)|0;x=F>>>0>x>>>0?F:x;if(t>>>0>e>>>0&G){u=t;w=r;while(1){u=u+-1|0;y=i[u>>0]|0;v=k[c>>2]|0;k[c>>2]=v+1;i[v>>0]=y;v=(w|0)>1;if(!(u>>>0>e>>>0&v))break;else w=w+-1|0}}else v=G;y=D+x|0;u=t+(x+1)|0;if(v)w=Vb[k[(k[g>>2]|0)+28>>2]&63](g,48)|0;else w=0;t=k[c>>2]|0;k[c>>2]=t+1;if((y|0)>0){v=y;while(1){i[t>>0]=w;t=k[c>>2]|0;k[c>>2]=t+1;if((v|0)>1)v=v+-1|0;else break}}i[t>>0]=m}else u=t;if((u|0)!=(e|0)){y=i[o>>0]|0;t=(y&1)==0;if(!((t?(y&255)>>>1:k[A>>2]|0)|0))t=-1;else t=i[(t?C:k[B>>2]|0)>>0]|0;if((u|0)!=(e|0)){v=0;w=0;while(1){if((w|0)==(t|0)){y=k[c>>2]|0;k[c>>2]=y+1;i[y>>0]=n;v=v+1|0;y=i[o>>0]|0;t=(y&1)==0;if(v>>>0<(t?(y&255)>>>1:k[A>>2]|0)>>>0){t=i[(t?C:k[B>>2]|0)+v>>0]|0;t=t<<24>>24==127?-1:t<<24>>24;w=0}else{t=w;w=0}}u=u+-1|0;x=i[u>>0]|0;y=k[c>>2]|0;k[c>>2]=y+1;i[y>>0]=x;if((u|0)==(e|0))break;else w=w+1|0}}}else{x=Vb[k[(k[g>>2]|0)+28>>2]&63](g,48)|0;y=k[c>>2]|0;k[c>>2]=y+1;i[y>>0]=x}t=k[c>>2]|0;if((s|0)!=(t|0)?(E=t+-1|0,s>>>0>>0):0){t=E;do{y=i[s>>0]|0;i[s>>0]=i[t>>0]|0;i[t>>0]=y;s=s+1|0;t=t+-1|0}while(s>>>0>>0)}break}default:{}}z=z+1|0}while((z|0)!=4);t=i[q>>0]|0;e=(t&1)==0;t=e?(t&255)>>>1:k[N>>2]|0;if(t>>>0>1){s=e?P:k[O>>2]|0;u=s+t|0;e=k[c>>2]|0;if((t|0)!=1){s=s+1|0;do{i[e>>0]=i[s>>0]|0;e=e+1|0;s=s+1|0}while((s|0)!=(u|0))}k[c>>2]=e}switch(d&176|0){case 32:{k[b>>2]=k[c>>2];break}case 16:break;default:k[b>>2]=a}return}function os(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;z=r;r=r+176|0;p=z+56|0;B=z+52|0;w=z+64|0;t=z+61|0;y=z+60|0;C=z+40|0;E=z+28|0;D=z+16|0;l=z+12|0;o=z+68|0;v=z+8|0;u=z+4|0;q=z;a=tn(d)|0;k[B>>2]=a;x=0;s=Aa(37,B|0,44220)|0;n=x;x=0;do if(n&1)F=13;else{m=i[f>>0]|0;g=(m&1)==0;n=f+4|0;if(!((g?(m&255)>>>1:k[n>>2]|0)|0))m=0;else{g=i[(g?f+1|0:k[f+8>>2]|0)>>0]|0;x=0;h=Aa(k[(k[s>>2]|0)+28>>2]|0,s|0,45)|0;m=x;x=0;if(m&1){F=13;break}m=g<<24>>24==h<<24>>24}k[C>>2]=0;k[C+4>>2]=0;k[C+8>>2]=0;k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;k[D>>2]=0;k[D+4>>2]=0;k[D+8>>2]=0;x=0;za(3,c|0,m|0,B|0,w|0,t|0,y|0,C|0,E|0,D|0,l|0);j=x;x=0;if(!(j&1)){j=i[f>>0]|0;c=k[n>>2]|0;g=(j&1)==0?(j&255)>>>1:c;l=k[l>>2]|0;if((g|0)>(l|0)){G=i[D>>0]|0;h=i[E>>0]|0;g=(g-l<<1|1)+l+((G&1)==0?(G&255)>>>1:k[D+4>>2]|0)+((h&1)==0?(h&255)>>>1:k[E+4>>2]|0)|0}else{G=i[D>>0]|0;g=i[E>>0]|0;g=l+2+((G&1)==0?(G&255)>>>1:k[D+4>>2]|0)+((g&1)==0?(g&255)>>>1:k[E+4>>2]|0)|0}if(g>>>0>100){g=Pl(g)|0;h=g;if(!g){x=0;Ga(6);G=x;x=0;if(!(G&1)){j=i[f>>0]|0;c=k[n>>2]|0;g=0;F=17}}else F=17}else{h=0;g=o;F=17}if((F|0)==17){G=(j&1)==0;f=G?f+1|0:k[f+8>>2]|0;x=0;wa(1,g|0,v|0,u|0,k[d+4>>2]|0,f|0,f+(G?(j&255)>>>1:c)|0,s|0,m|0,w|0,i[t>>0]|0,i[y>>0]|0,C|0,E|0,D|0,l|0);G=x;x=0;if(!(G&1)?(k[q>>2]=k[b>>2],G=k[v>>2]|0,A=k[u>>2]|0,x=0,k[p>>2]=k[q>>2],A=sa(39,p|0,g|0,G|0,A|0,d|0,e|0)|0,G=x,x=0,!(G&1)):0){if(h){Ql(h);a=k[B>>2]|0}Sm(D);Sm(E);Sm(C);zm(a)|0;r=z;return A|0}}g=Wa()|0;if(h){Ql(h);a=k[B>>2]|0}}else g=Wa()|0;Sm(D);Sm(E);Sm(C)}while(0);if((F|0)==13)g=Wa()|0;zm(a)|0;fb(g|0);return 0}function ps(a){a=a|0;return}function qs(a){a=a|0;mj(a);return}function rs(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;D=r;r=r+992|0;u=D+8|0;g=D;j=D+888|0;l=D+880|0;h=D+480|0;F=D+76|0;A=D+884|0;w=D+72|0;B=D+68|0;G=D+56|0;I=D+44|0;H=D+32|0;m=D+28|0;t=D+80|0;z=D+24|0;y=D+20|0;v=D+16|0;k[l>>2]=j;p[u>>3]=f;j=il(j,100,59018,u)|0;do if(j>>>0>99){x=0;a=Da(3)|0;C=x;x=0;if(!(C&1)?(x=0,p[g>>3]=f,q=Ea(17,l|0,a|0,59018,g|0)|0,C=x,x=0,!(C&1)):0){a=k[l>>2]|0;if(!a){x=0;Ga(6);C=x;x=0;if(C&1){a=0;g=0;C=7;break}a=k[l>>2]|0}h=Pl(q<<2)|0;g=h;if(!h){x=0;Ga(6);C=x;x=0;if(C&1)C=7;else{s=0;C=10}}else{s=h;C=10}}else{a=0;g=0;C=7}}else{g=0;a=0;s=h;q=j;C=10}while(0);if((C|0)==10){x=0;h=ta(68,d|0)|0;o=x;x=0;if(o&1)C=7;else{k[F>>2]=h;x=0;o=Aa(37,F|0,44212)|0;n=x;x=0;if(!(n&1)?(n=k[l>>2]|0,x=0,Ea(k[(k[o>>2]|0)+48>>2]|0,o|0,n|0,n+q|0,s|0)|0,n=x,x=0,!(n&1)):0){if(!q)n=0;else n=(i[k[l>>2]>>0]|0)==45;k[G>>2]=0;k[G+4>>2]=0;k[G+8>>2]=0;k[I>>2]=0;k[I+4>>2]=0;k[I+8>>2]=0;k[H>>2]=0;k[H+4>>2]=0;k[H+8>>2]=0;x=0;za(4,c|0,n|0,F|0,A|0,w|0,B|0,G|0,I|0,H|0,m|0);c=x;x=0;if(!(c&1)){m=k[m>>2]|0;if((q|0)>(m|0)){c=i[H>>0]|0;j=i[I>>0]|0;j=(q-m<<1|1)+m+((c&1)==0?(c&255)>>>1:k[H+4>>2]|0)+((j&1)==0?(j&255)>>>1:k[I+4>>2]|0)|0}else{c=i[H>>0]|0;j=i[I>>0]|0;j=m+2+((c&1)==0?(c&255)>>>1:k[H+4>>2]|0)+((j&1)==0?(j&255)>>>1:k[I+4>>2]|0)|0}if(j>>>0>100){j=Pl(j<<2)|0;l=j;if(!j){x=0;Ga(6);t=x;x=0;if(!(t&1)){j=0;C=26}}else C=26}else{l=0;j=t;C=26}if((C|0)==26){x=0;wa(2,j|0,z|0,y|0,k[d+4>>2]|0,s|0,s+(q<<2)|0,o|0,n|0,A|0,k[w>>2]|0,k[B>>2]|0,G|0,I|0,H|0,m|0);B=x;x=0;if(!(B&1)?(k[v>>2]=k[b>>2],b=k[z>>2]|0,E=k[y>>2]|0,x=0,k[u>>2]=k[v>>2],E=sa(40,u|0,j|0,b|0,E|0,d|0,e|0)|0,b=x,x=0,!(b&1)):0){if(l){Ql(l);h=k[F>>2]|0}en(H);en(I);Sm(G);zm(h)|0;if(g)Ql(g);if(a)Ql(a);r=D;return E|0}}j=Wa()|0;if(l){Ql(l);h=k[F>>2]|0}}else j=Wa()|0;en(H);en(I);Sm(G)}else j=Wa()|0;zm(h)|0}}if((C|0)==7)j=Wa()|0;if(g)Ql(g);if(a)Ql(a);fb(j|0);return 0}function ss(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0;B=r;r=r+112|0;m=B+108|0;n=B+96|0;q=B+92|0;s=B+80|0;t=B+68|0;u=B+56|0;v=B+52|0;w=B+40|0;y=B+36|0;z=B+24|0;o=B+12|0;p=B;do if(a){a=Ss(c,43956)|0;c=k[a>>2]|0;do if(b){Mb[k[c+44>>2]&127](m,a);b=k[m>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](n,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[n>>2];k[j+4>>2]=k[n+4>>2];k[j+8>>2]=k[n+8>>2];k[n>>2]=0;k[n+4>>2]=0;k[n+8>>2]=0;en(n);break}}else{Mb[k[c+40>>2]&127](q,a);b=k[q>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+28>>2]&127](s,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[s>>2];k[j+4>>2]=k[s+4>>2];k[j+8>>2]=k[s+8>>2];k[s>>2]=0;k[s+4>>2]=0;k[s+8>>2]=0;en(s);break}}while(0);j=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;k[e>>2]=j;j=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;k[f>>2]=j;Mb[k[(k[a>>2]|0)+20>>2]&127](t,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)};k[g>>2]=k[t>>2];k[g+4>>2]=k[t+4>>2];k[g+8>>2]=k[t+8>>2];k[t>>2]=0;k[t+4>>2]=0;k[t+8>>2]=0;Sm(t);Mb[k[(k[a>>2]|0)+24>>2]&127](u,a);if(!(i[h>>0]&1))i[h>>0]=0;else k[k[h+8>>2]>>2]=0;k[h+4>>2]=0;x=0;ra(93,h|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)}else{k[h>>2]=k[u>>2];k[h+4>>2]=k[u+4>>2];k[h+8>>2]=k[u+8>>2];k[u>>2]=0;k[u+4>>2]=0;k[u+8>>2]=0;en(u);A=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}else{a=Ss(c,43892)|0;c=k[a>>2]|0;do if(b){Mb[k[c+44>>2]&127](v,a);b=k[v>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+32>>2]&127](w,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[w>>2];k[j+4>>2]=k[w+4>>2];k[j+8>>2]=k[w+8>>2];k[w>>2]=0;k[w+4>>2]=0;k[w+8>>2]=0;en(w);break}}else{Mb[k[c+40>>2]&127](y,a);b=k[y>>2]|0;i[d>>0]=b;i[d+1>>0]=b>>8;i[d+2>>0]=b>>16;i[d+3>>0]=b>>24;Mb[k[(k[a>>2]|0)+28>>2]&127](z,a);if(!(i[j>>0]&1))i[j>>0]=0;else k[k[j+8>>2]>>2]=0;k[j+4>>2]=0;x=0;ra(93,j|0,0);d=x;x=0;if(d&1){j=Wa(0)|0;oc(j)}else{k[j>>2]=k[z>>2];k[j+4>>2]=k[z+4>>2];k[j+8>>2]=k[z+8>>2];k[z>>2]=0;k[z+4>>2]=0;k[z+8>>2]=0;en(z);break}}while(0);j=Ob[k[(k[a>>2]|0)+12>>2]&127](a)|0;k[e>>2]=j;j=Ob[k[(k[a>>2]|0)+16>>2]&127](a)|0;k[f>>2]=j;Mb[k[(k[a>>2]|0)+20>>2]&127](o,a);if(!(i[g>>0]&1)){i[g+1>>0]=0;i[g>>0]=0}else{i[k[g+8>>2]>>0]=0;k[g+4>>2]=0}x=0;ra(91,g|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)};k[g>>2]=k[o>>2];k[g+4>>2]=k[o+4>>2];k[g+8>>2]=k[o+8>>2];k[o>>2]=0;k[o+4>>2]=0;k[o+8>>2]=0;Sm(o);Mb[k[(k[a>>2]|0)+24>>2]&127](p,a);if(!(i[h>>0]&1))i[h>>0]=0;else k[k[h+8>>2]>>2]=0;k[h+4>>2]=0;x=0;ra(93,h|0,0);f=x;x=0;if(f&1){f=Wa(0)|0;oc(f)}else{k[h>>2]=k[p>>2];k[h+4>>2]=k[p+4>>2];k[h+8>>2]=k[p+8>>2];k[p>>2]=0;k[p+4>>2]=0;k[p+8>>2]=0;en(p);A=Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0;break}}while(0);k[l>>2]=A;r=B;return}function ts(a,b,c,d,e,f,g,h,j,l,m,n,o,p,q){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;k[c>>2]=a;J=p+4|0;K=p+8|0;C=o+4|0;D=(d&512|0)==0;E=o+8|0;F=(q|0)>0;G=n+4|0;H=n+8|0;I=n+1|0;A=(q|0)>0;z=0;do{switch(i[j+z>>0]|0){case 0:{k[b>>2]=k[c>>2];break}case 1:{k[b>>2]=k[c>>2];x=Vb[k[(k[g>>2]|0)+44>>2]&63](g,32)|0;y=k[c>>2]|0;k[c>>2]=y+4;k[y>>2]=x;break}case 3:{y=i[p>>0]|0;r=(y&1)==0;if((r?(y&255)>>>1:k[J>>2]|0)|0){x=k[(r?J:k[K>>2]|0)>>2]|0;y=k[c>>2]|0;k[c>>2]=y+4;k[y>>2]=x}break}case 2:{v=i[o>>0]|0;r=(v&1)==0;v=r?(v&255)>>>1:k[C>>2]|0;if(!(D|(v|0)==0)){r=r?C:k[E>>2]|0;t=r+(v<<2)|0;u=k[c>>2]|0;if(v){s=u;while(1){k[s>>2]=k[r>>2];r=r+4|0;if((r|0)==(t|0))break;else s=s+4|0}}k[c>>2]=u+(v<<2)}break}case 4:{r=k[c>>2]|0;e=h?e+4|0:e;a:do if(e>>>0>>0){s=e;do{if(!(Qb[k[(k[g>>2]|0)+12>>2]&63](g,2048,k[s>>2]|0)|0))break a;s=s+4|0}while(s>>>0>>0)}else s=e;while(0);if(F){if(s>>>0>e>>>0&A){v=k[c>>2]|0;u=q;while(1){s=s+-4|0;t=v+4|0;k[v>>2]=k[s>>2];w=u+-1|0;u=(u|0)>1;if(s>>>0>e>>>0&u){v=t;u=w}else{v=w;break}}k[c>>2]=t;t=v}else{u=A;t=q}if(u)w=Vb[k[(k[g>>2]|0)+44>>2]&63](g,48)|0;else w=0;x=k[c>>2]|0;u=t+((t|0)<0?~t:-1)|0;if((t|0)>0){v=x;while(1){k[v>>2]=w;if((t|0)>1){v=v+4|0;t=t+-1|0}else break}}k[c>>2]=x+(u+2<<2);k[x+(u+1<<2)>>2]=l}if((s|0)==(e|0)){x=Vb[k[(k[g>>2]|0)+44>>2]&63](g,48)|0;y=k[c>>2]|0;s=y+4|0;k[c>>2]=s;k[y>>2]=x}else{x=i[n>>0]|0;t=(x&1)==0;y=k[G>>2]|0;if(!((t?(x&255)>>>1:y)|0))t=-1;else t=i[(t?I:k[H>>2]|0)>>0]|0;if((s|0)!=(e|0)){w=0;x=0;while(1){u=k[c>>2]|0;if((x|0)==(t|0)){v=u+4|0;k[c>>2]=v;k[u>>2]=m;w=w+1|0;u=i[n>>0]|0;t=(u&1)==0;if(w>>>0<(t?(u&255)>>>1:y)>>>0){t=i[(t?I:k[H>>2]|0)+w>>0]|0;u=v;t=t<<24>>24==127?-1:t<<24>>24;v=0}else{u=v;t=x;v=0}}else v=x;s=s+-4|0;x=k[s>>2]|0;k[c>>2]=u+4;k[u>>2]=x;if((s|0)==(e|0))break;else x=v+1|0}}s=k[c>>2]|0}if((r|0)!=(s|0)?(B=s+-4|0,r>>>0>>0):0){s=B;do{y=k[r>>2]|0;k[r>>2]=k[s>>2];k[s>>2]=y;r=r+4|0;s=s+-4|0}while(r>>>0>>0)}break}default:{}}z=z+1|0}while((z|0)!=4);r=i[p>>0]|0;e=(r&1)==0;r=e?(r&255)>>>1:k[J>>2]|0;if(r>>>0>1){s=e?J:k[K>>2]|0;e=s+4|0;s=s+(r<<2)|0;t=k[c>>2]|0;u=s-e|0;if((r|0)!=1){r=t;while(1){k[r>>2]=k[e>>2];e=e+4|0;if((e|0)==(s|0))break;else r=r+4|0}}k[c>>2]=t+(u>>>2<<2)}switch(d&176|0){case 32:{k[b>>2]=k[c>>2];break}case 16:break;default:k[b>>2]=a}return}function us(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;z=r;r=r+480|0;o=z+468|0;B=z+464|0;w=z+472|0;t=z+56|0;y=z+52|0;C=z+40|0;E=z+28|0;D=z+16|0;l=z+12|0;n=z+64|0;v=z+8|0;u=z+4|0;p=z;a=tn(d)|0;k[B>>2]=a;x=0;q=Aa(37,B|0,44212)|0;s=x;x=0;do if(s&1)F=13;else{m=i[f>>0]|0;g=(m&1)==0;s=f+4|0;if(!((g?(m&255)>>>1:k[s>>2]|0)|0))m=0;else{g=k[(g?s:k[f+8>>2]|0)>>2]|0;x=0;h=Aa(k[(k[q>>2]|0)+44>>2]|0,q|0,45)|0;m=x;x=0;if(m&1){F=13;break}m=(g|0)==(h|0)}k[C>>2]=0;k[C+4>>2]=0;k[C+8>>2]=0;k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;k[D>>2]=0;k[D+4>>2]=0;k[D+8>>2]=0;x=0;za(4,c|0,m|0,B|0,w|0,t|0,y|0,C|0,E|0,D|0,l|0);j=x;x=0;if(!(j&1)){j=i[f>>0]|0;c=k[s>>2]|0;g=(j&1)==0?(j&255)>>>1:c;l=k[l>>2]|0;if((g|0)>(l|0)){G=i[D>>0]|0;h=i[E>>0]|0;g=(g-l<<1|1)+l+((G&1)==0?(G&255)>>>1:k[D+4>>2]|0)+((h&1)==0?(h&255)>>>1:k[E+4>>2]|0)|0}else{G=i[D>>0]|0;g=i[E>>0]|0;g=l+2+((G&1)==0?(G&255)>>>1:k[D+4>>2]|0)+((g&1)==0?(g&255)>>>1:k[E+4>>2]|0)|0}if(g>>>0>100){g=Pl(g<<2)|0;h=g;if(!g){x=0;Ga(6);G=x;x=0;if(!(G&1)){j=i[f>>0]|0;c=k[s>>2]|0;g=0;F=17}}else F=17}else{h=0;g=n;F=17}if((F|0)==17){G=(j&1)==0;f=G?s:k[f+8>>2]|0;x=0;wa(2,g|0,v|0,u|0,k[d+4>>2]|0,f|0,f+((G?(j&255)>>>1:c)<<2)|0,q|0,m|0,w|0,k[t>>2]|0,k[y>>2]|0,C|0,E|0,D|0,l|0);G=x;x=0;if(!(G&1)?(k[p>>2]=k[b>>2],G=k[v>>2]|0,A=k[u>>2]|0,x=0,k[o>>2]=k[p>>2],A=sa(40,o|0,g|0,G|0,A|0,d|0,e|0)|0,G=x,x=0,!(G&1)):0){if(h){Ql(h);a=k[B>>2]|0}en(D);en(E);Sm(C);zm(a)|0;r=z;return A|0}}g=Wa()|0;if(h){Ql(h);a=k[B>>2]|0}}else g=Wa()|0;en(D);en(E);Sm(C)}while(0);if((F|0)==13)g=Wa()|0;zm(a)|0;fb(g|0);return 0}function vs(a){a=a|0;return}function ws(a){a=a|0;mj(a);return}function xs(a,b,c){a=a|0;b=b|0;c=c|0;a=vk((i[b>>0]&1)==0?b+1|0:k[b+8>>2]|0,1)|0;return a>>>((a|0)!=(-1|0)&1)|0}function ys(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0;h=r;r=r+16|0;j=h;k[j>>2]=0;k[j+4>>2]=0;k[j+8>>2]=0;g=i[f>>0]|0;l=(g&1)==0;b=l?f+1|0:k[f+8>>2]|0;g=l?(g&255)>>>1:k[f+4>>2]|0;f=b+g|0;a:do if((g|0)>0){while(1){x=0;ra(67,j|0,i[b>>0]|0);l=x;x=0;if(l&1)break;b=b+1|0;if(b>>>0>=f>>>0){g=4;break a}}b=Wa()|0;g=7}else g=4;while(0);b:do if((g|0)==4){x=0;b=Ea(19,((c|0)==-1?-1:c<<1)|0,d|0,e|0,((i[j>>0]&1)==0?j+1|0:k[j+8>>2]|0)|0)|0;l=x;x=0;if(l&1){b=Wa()|0;g=7;break}k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;l=xl(b)|0;f=b+l|0;c:do if((l|0)>0){while(1){x=0;ra(67,a|0,i[b>>0]|0);l=x;x=0;if(l&1)break;b=b+1|0;if(b>>>0>=f>>>0)break c}b=Wa()|0;Sm(a);break b}while(0);Sm(j);r=h;return}while(0);Sm(j);fb(b|0)}function zs(a,b){a=a|0;b=b|0;return}function As(a){a=a|0;return}function Bs(a){a=a|0;mj(a);return}function Cs(a,b,c){a=a|0;b=b|0;c=c|0;a=vk((i[b>>0]&1)==0?b+1|0:k[b+8>>2]|0,1)|0;return a>>>((a|0)!=(-1|0)&1)|0}function Ds(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;v=r;r=r+224|0;n=v+184|0;m=v+192|0;l=v+180|0;o=v+176|0;t=v+168|0;s=v+40|0;q=v+32|0;u=v+28|0;w=v+16|0;j=v+8|0;p=v;k[w>>2]=0;k[w+4>>2]=0;k[w+8>>2]=0;k[j+4>>2]=0;k[j>>2]=44696;h=i[f>>0]|0;y=(h&1)==0;g=f+4|0;b=y?g:k[f+8>>2]|0;f=y?(h&255)>>>1:k[g>>2]|0;g=b+(f<<2)|0;h=m+32|0;a:do if((f|0)>0){b:while(1){k[o>>2]=b;x=0;f=Ha(k[(k[j>>2]|0)+12>>2]|0,j|0,n|0,b|0,g|0,o|0,m|0,h|0,l|0)|0;y=x;x=0;if(y&1){f=12;break}if((f|0)==2?1:(k[o>>2]|0)==(b|0)){f=5;break}if(m>>>0<(k[l>>2]|0)>>>0){b=m;do{x=0;ra(67,w|0,i[b>>0]|0);y=x;x=0;if(y&1){f=11;break b}b=b+1|0}while(b>>>0<(k[l>>2]|0)>>>0)}b=k[o>>2]|0;if(!((f|0)!=2&b>>>0>>0)){f=9;break a}}if((f|0)==5){x=0;qa(190,58955);x=0;b=Wa()|0}else if((f|0)==11)b=Wa()|0;else if((f|0)==12)b=Wa()|0}else f=9;while(0);c:do if((f|0)==9){x=0;b=Ea(19,((c|0)==-1?-1:c<<1)|0,d|0,e|0,((i[w>>0]&1)==0?w+1|0:k[w+8>>2]|0)|0)|0;y=x;x=0;if(y&1){b=Wa()|0;break}k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[p+4>>2]=0;k[p>>2]=44744;y=xl(b)|0;g=b+y|0;h=g;j=s+128|0;d:do if((y|0)>0){e:while(1){k[u>>2]=b;x=0;f=Ha(k[(k[p>>2]|0)+16>>2]|0,p|0,t|0,b|0,((h-b|0)>32?b+32|0:g)|0,u|0,s|0,j|0,q|0)|0;y=x;x=0;if(y&1){f=24;break}if((f|0)==2?1:(k[u>>2]|0)==(b|0)){f=18;break}if(s>>>0<(k[q>>2]|0)>>>0){b=s;do{x=0;ra(92,a|0,k[b>>2]|0);y=x;x=0;if(y&1){f=23;break e}b=b+4|0}while(b>>>0<(k[q>>2]|0)>>>0)}b=k[u>>2]|0;if(!((f|0)!=2&b>>>0>>0))break d}if((f|0)==18){x=0;qa(190,58955);x=0;b=Wa()|0}else if((f|0)==23)b=Wa()|0;else if((f|0)==24)b=Wa()|0;en(a);break c}while(0);Sm(w);r=v;return}while(0);Sm(w);fb(b|0)}function Es(a,b){a=a|0;b=b|0;return}function Fs(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;k[a+4>>2]=b+-1;k[a>>2]=44196;f=a+8|0;x=0;ra(94,f|0,28);e=x;x=0;if(e&1)b=Wa()|0;else{e=a+144|0;x=0;Fa(5,e|0,58885,1);d=x;x=0;if(d&1)b=Wa()|0;else{c=k[f>>2]|0;d=a+12|0;b=k[d>>2]|0;if((b|0)!=(c|0)){do b=b+-4|0;while((b|0)!=(c|0));k[d>>2]=b}k[495]=0;k[494]=43124;x=0;ra(95,a|0,1976);d=x;x=0;do if(((((((((((((!(d&1)?(k[497]=0,k[496]=43164,x=0,ra(96,a|0,1984),d=x,x=0,!(d&1)):0)?(k[499]=0,k[498]=44236,k[500]=0,i[2004]=0,d=Ys()|0,k[500]=d,x=0,ra(97,a|0,1992),d=x,x=0,!(d&1)):0)?(k[503]=0,k[502]=44484,x=0,ra(98,a|0,2008),d=x,x=0,!(d&1)):0)?(k[505]=0,k[504]=44552,x=0,ra(99,a|0,2016),d=x,x=0,!(d&1)):0)?(x=0,ra(100,2024,1),d=x,x=0,!(d&1)):0)?(x=0,ra(101,a|0,2024),d=x,x=0,!(d&1)):0)?(k[511]=0,k[510]=44600,x=0,ra(102,a|0,2040),d=x,x=0,!(d&1)):0)?(k[513]=0,k[512]=44648,x=0,ra(103,a|0,2048),d=x,x=0,!(d&1)):0)?(bu(2056,1),x=0,ra(104,a|0,2056),d=x,x=0,!(d&1)):0)?(cu(2080,1),x=0,ra(105,a|0,2080),d=x,x=0,!(d&1)):0)?(k[529]=0,k[528]=43204,x=0,ra(106,a|0,2112),d=x,x=0,!(d&1)):0)?(k[531]=0,k[530]=43276,x=0,ra(107,a|0,2120),d=x,x=0,!(d&1)):0)?(k[533]=0,k[532]=43348,x=0,ra(108,a|0,2128),d=x,x=0,!(d&1)):0){k[535]=0;k[534]=43408;x=0;ra(109,a|0,2136);d=x;x=0;if(d&1){g=42;break}k[537]=0;k[536]=43716;x=0;ra(110,a|0,2144);d=x;x=0;if(d&1){g=42;break}k[539]=0;k[538]=43780;x=0;ra(111,a|0,2152);d=x;x=0;if(d&1){g=42;break}k[541]=0;k[540]=43844;x=0;ra(112,a|0,2160);d=x;x=0;if(d&1){g=42;break}k[543]=0;k[542]=43908;x=0;ra(113,a|0,2168);d=x;x=0;if(d&1){g=42;break}k[545]=0;k[544]=43972;x=0;ra(114,a|0,2176);d=x;x=0;if(d&1){g=42;break}k[547]=0;k[546]=44008;x=0;ra(115,a|0,2184);d=x;x=0;if(d&1){g=42;break}k[549]=0;k[548]=44044;x=0;ra(116,a|0,2192);d=x;x=0;if(d&1){g=42;break}k[551]=0;k[550]=44080;x=0;ra(117,a|0,2200);d=x;x=0;if(d&1){g=42;break}k[553]=0;k[552]=43468;k[554]=43516;x=0;ra(118,a|0,2208);d=x;x=0;if(d&1){g=42;break}k[557]=0;k[556]=43560;k[558]=43608;x=0;ra(119,a|0,2224);d=x;x=0;if(d&1){g=42;break}k[561]=0;k[560]=44464;x=0;b=Da(3)|0;d=x;x=0;if(d&1){b=Wa()|0;break}k[562]=b;k[560]=43652;x=0;ra(120,a|0,2240);d=x;x=0;if(d&1){g=42;break}k[565]=0;k[564]=44464;x=0;b=Da(3)|0;d=x;x=0;if(d&1){b=Wa()|0;break}k[566]=b;k[564]=43684;x=0;ra(121,a|0,2256);g=x;x=0;if(g&1){g=42;break}k[569]=0;k[568]=44116;x=0;ra(122,a|0,2272);g=x;x=0;if(g&1){g=42;break}k[571]=0;k[570]=44156;x=0;ra(123,a|0,2280);g=x;x=0;if(g&1){g=42;break}return}else g=42;while(0);if((g|0)==42)b=Wa()|0;Sm(e)}Nv(f)}fb(b|0)}function Gs(){var a=0;do if((i[2288]|0)==0?(Qa(2288)|0)!=0:0){x=0;Da(4)|0;a=x;x=0;if(a&1){a=Wa()|0;Bb(2288);fb(a|0)}else{k[11246]=44980;Ya(2288);break}}while(0);return k[11246]|0}function Hs(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;ym(b);e=a+8|0;d=k[e>>2]|0;do if((k[a+12>>2]|0)-d>>2>>>0<=c>>>0){x=0;ra(124,e|0,c+1|0);a=x;x=0;if(!(a&1)){d=k[e>>2]|0;break}d=Wa()|0;if(b)zm(b)|0;fb(d|0)}while(0);a=k[d+(c<<2)>>2]|0;if(a){zm(a)|0;d=k[e>>2]|0}k[d+(c<<2)>>2]=b;return}function Is(a){a=a|0;var b=0,c=0,d=0,e=0;k[a>>2]=44196;d=a+8|0;e=a+12|0;b=k[d>>2]|0;if((k[e>>2]|0)!=(b|0)){c=0;do{b=k[b+(c<<2)>>2]|0;if(b)zm(b)|0;c=c+1|0;b=k[d>>2]|0}while(c>>>0<(k[e>>2]|0)-b>>2>>>0)}Sm(a+144|0);Nv(d);return}function Js(a){a=a|0;Is(a);mj(a);return}function Ks(a,b){a=a|0;b=b|0;if(Pv(a,b)|0)return k[(k[a+8>>2]|0)+(b<<2)>>2]|0;else{a=Va(4)|0;Aj(a);ub(a|0,640,82)}return 0}function Ls(){Fs(2296,1);k[11245]=2296;return 44980}function Ms(){var a=0;a=Gs()|0;a=k[a>>2]|0;k[11247]=a;ym(a);return 44988}function Ns(){var a=0;do if((i[2456]|0)==0?(Qa(2456)|0)!=0:0){x=0;Da(5)|0;a=x;x=0;if(a&1){a=Wa()|0;Bb(2456);fb(a|0)}else{k[11248]=44988;Ya(2456);break}}while(0);return k[11248]|0}function Os(a){a=a|0;var b=0,c=0;x=0;b=Da(6)|0;c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)}else{c=k[b>>2]|0;k[a>>2]=c;ym(c);return}}function Ps(a,b){a=a|0;b=b|0;b=k[b>>2]|0;k[a>>2]=b;ym(b);return}function Qs(a){a=a|0;zm(k[a>>2]|0)|0;return}function Rs(a){a=a|0;var b=0,c=0;c=r;r=r+16|0;b=c;if((k[a>>2]|0)!=-1){k[b>>2]=a;k[b+4>>2]=191;k[b+8>>2]=0;Om(a,b,192)}r=c;return (k[a+4>>2]|0)+-1|0}function Ss(a,b){a=a|0;b=b|0;a=k[a>>2]|0;return Ks(a,Rs(b)|0)|0}function Ts(a){a=a|0;mj(a);return}function Us(a){a=a|0;if(a)Lb[k[(k[a>>2]|0)+4>>2]&255](a);return}function Vs(a){a=a|0;var b=0;b=k[11052]|0;k[11052]=b+1;k[a+4>>2]=b+1;return}function Ws(a){a=a|0;mj(a);return}function Xs(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<128){c=(Ys()|0)+(c<<1)|0;c=(j[c>>1]&b)<<16>>16!=0}else c=0;return c|0}function Ys(){var a=0,b=0;x=0;a=Da(7)|0;b=x;x=0;if(b&1){b=Wa(0)|0;oc(b)}else return k[a>>2]|0;return 0}function Zs(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;f=(c-b|0)>>>2;if((b|0)!=(c|0)){e=b;while(1){a=k[e>>2]|0;if(a>>>0<128){a=(Ys()|0)+(a<<1)|0;a=m[a>>1]|0}else a=0;j[d>>1]=a;e=e+4|0;if((e|0)==(c|0))break;else d=d+2|0}}return b+(f<<2)|0}function _s(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a:do if((c|0)==(d|0))c=d;else while(1){a=k[c>>2]|0;if(a>>>0<128?(a=(Ys()|0)+(a<<1)|0,(j[a>>1]&b)<<16>>16!=0):0)break a;c=c+4|0;if((c|0)==(d|0)){c=d;break}}while(0);return c|0}function $s(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a:do if((c|0)==(d|0))c=d;else while(1){a=k[c>>2]|0;if(a>>>0>=128)break a;a=(Ys()|0)+(a<<1)|0;if(!((j[a>>1]&b)<<16>>16))break a;c=c+4|0;if((c|0)==(d|0)){c=d;break}}while(0);return c|0}function at(a,b){a=a|0;b=b|0;if(b>>>0<128){b=(bt()|0)+(b<<2)|0;b=k[b>>2]|0}return b|0}function bt(){var a=0,b=0;x=0;a=Da(8)|0;b=x;x=0;if(b&1){b=Wa(0)|0;oc(b)}else return k[a>>2]|0;return 0}function ct(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=(c-b|0)>>>2;if((b|0)!=(c|0)){d=b;do{a=k[d>>2]|0;if(a>>>0<128){a=(bt()|0)+(a<<2)|0;a=k[a>>2]|0}k[d>>2]=a;d=d+4|0}while((d|0)!=(c|0))}return b+(e<<2)|0}function dt(a,b){a=a|0;b=b|0;if(b>>>0<128){b=(et()|0)+(b<<2)|0;b=k[b>>2]|0}return b|0}function et(){var a=0,b=0;x=0;a=Da(9)|0;b=x;x=0;if(b&1){b=Wa(0)|0;oc(b)}else return k[a>>2]|0;return 0}function ft(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=(c-b|0)>>>2;if((b|0)!=(c|0)){d=b;do{a=k[d>>2]|0;if(a>>>0<128){a=(et()|0)+(a<<2)|0;a=k[a>>2]|0}k[d>>2]=a;d=d+4|0}while((d|0)!=(c|0))}return b+(e<<2)|0}function gt(a,b){a=a|0;b=b|0;return b<<24>>24|0}function ht(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((b|0)!=(c|0))while(1){k[d>>2]=i[b>>0];b=b+1|0;if((b|0)==(c|0))break;else d=d+4|0}return c|0}function it(a,b,c){a=a|0;b=b|0;c=c|0;return (b>>>0<128?b&255:c)|0}function jt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=(c-b|0)>>>2;if((b|0)!=(c|0)){f=b;a=e;while(1){e=k[f>>2]|0;i[a>>0]=e>>>0<128?e&255:d;f=f+4|0;if((f|0)==(c|0))break;else a=a+1|0}}return b+(g<<2)|0}function kt(a){a=a|0;var b=0;k[a>>2]=44236;b=k[a+8>>2]|0;if((b|0)!=0?(i[a+12>>0]|0)!=0:0)nj(b);return}function lt(a){a=a|0;kt(a);mj(a);return}function mt(a,b){a=a|0;b=b|0;if(b<<24>>24>-1){b=(bt()|0)+((b&255)<<2)|0;b=k[b>>2]&255}return b|0}function nt(a,b,c){a=a|0;b=b|0;c=c|0;if((b|0)!=(c|0)){a=b;do{b=i[a>>0]|0;if(b<<24>>24>-1){b=(bt()|0)+(b<<24>>24<<2)|0;b=k[b>>2]&255}i[a>>0]=b;a=a+1|0}while((a|0)!=(c|0))}return c|0}function ot(a,b){a=a|0;b=b|0;if(b<<24>>24>-1){b=(et()|0)+(b<<24>>24<<2)|0;b=k[b>>2]&255}return b|0}function pt(a,b,c){a=a|0;b=b|0;c=c|0;if((b|0)!=(c|0)){a=b;do{b=i[a>>0]|0;if(b<<24>>24>-1){b=(et()|0)+(b<<24>>24<<2)|0;b=k[b>>2]&255}i[a>>0]=b;a=a+1|0}while((a|0)!=(c|0))}return c|0}function qt(a,b){a=a|0;b=b|0;return b|0}function rt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((b|0)!=(c|0))while(1){i[d>>0]=i[b>>0]|0;b=b+1|0;if((b|0)==(c|0))break;else d=d+1|0}return c|0}function st(a,b,c){a=a|0;b=b|0;c=c|0;return (b<<24>>24>-1?b:c)|0}function tt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if((b|0)!=(c|0))while(1){a=i[b>>0]|0;i[e>>0]=a<<24>>24>-1?a:d;b=b+1|0;if((b|0)==(c|0))break;else e=e+1|0}return c|0}function ut(a){a=a|0;mj(a);return}function vt(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k[e>>2]=c;k[h>>2]=f;return 3}function wt(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k[e>>2]=c;k[h>>2]=f;return 3}function xt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;k[e>>2]=c;return 3}function yt(a){a=a|0;return 1}function zt(a){a=a|0;return 1}function At(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a=d-c|0;return (a>>>0>>0?a:e)|0}function Bt(a){a=a|0;return 1}function Ct(a,b){a=a|0;b=b|0;var c=0;k[a+4>>2]=b+-1;k[a>>2]=44304;x=0;b=Da(3)|0;c=x;x=0;if(c&1){c=Wa()|0;fb(c|0)}else{k[a+8>>2]=b;return}}function Dt(a){a=a|0;Gu(a);mj(a);return} -function Hl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,m=0,n=0.0,o=0,q=0,s=0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0;ga=r;r=r+624|0;ba=ga+24|0;da=ga+16|0;ca=ga+588|0;Y=ga+576|0;aa=ga;V=ga+536|0;fa=ga+8|0;ea=ga+528|0;L=(a|0)!=0;N=V+40|0;U=N;V=V+39|0;W=fa+4|0;X=Y+12|0;Y=Y+11|0;Z=ca;_=X;$=_-Z|0;O=-2-Z|0;P=_+2|0;Q=ba+288|0;R=ca+9|0;S=R;T=ca+8|0;f=0;w=b;g=0;b=0;a:while(1){do if((f|0)>-1)if((g|0)>(2147483647-f|0)){f=mk()|0;k[f>>2]=75;f=-1;break}else{f=g+f|0;break}while(0);g=i[w>>0]|0;if(!(g<<24>>24)){K=245;break}else h=w;b:while(1){switch(g<<24>>24){case 37:{g=h;K=9;break b}case 0:{g=h;break b}default:{}}J=h+1|0;g=i[J>>0]|0;h=J}c:do if((K|0)==9)while(1){K=0;if((i[g+1>>0]|0)!=37)break c;h=h+1|0;g=g+2|0;if((i[g>>0]|0)==37)K=9;else break}while(0);y=h-w|0;if(L?(k[a>>2]&32|0)==0:0)fl(w,y,a)|0;if((h|0)!=(w|0)){w=g;g=y;continue}o=g+1|0;h=i[o>>0]|0;m=(h<<24>>24)+-48|0;if(m>>>0<10){J=(i[g+2>>0]|0)==36;o=J?g+3|0:o;h=i[o>>0]|0;u=J?m:-1;b=J?1:b}else u=-1;g=h<<24>>24;d:do if((g&-32|0)==32){m=0;while(1){if(!(1<>24)+-32|m;o=o+1|0;h=i[o>>0]|0;g=h<<24>>24;if((g&-32|0)!=32){q=m;g=o;break}}}else{q=0;g=o}while(0);do if(h<<24>>24==42){m=g+1|0;h=(i[m>>0]|0)+-48|0;if(h>>>0<10?(i[g+2>>0]|0)==36:0){k[e+(h<<2)>>2]=10;b=1;g=g+3|0;h=k[d+((i[m>>0]|0)+-48<<3)>>2]|0}else{if(b){f=-1;break a}if(!L){x=q;g=m;b=0;J=0;break}b=(k[c>>2]|0)+(4-1)&~(4-1);h=k[b>>2]|0;k[c>>2]=b+4;b=0;g=m}if((h|0)<0){x=q|8192;J=0-h|0}else{x=q;J=h}}else{m=(h<<24>>24)+-48|0;if(m>>>0<10){h=0;do{h=(h*10|0)+m|0;g=g+1|0;m=(i[g>>0]|0)+-48|0}while(m>>>0<10);if((h|0)<0){f=-1;break a}else{x=q;J=h}}else{x=q;J=0}}while(0);e:do if((i[g>>0]|0)==46){m=g+1|0;h=i[m>>0]|0;if(h<<24>>24!=42){o=(h<<24>>24)+-48|0;if(o>>>0<10){g=m;h=0}else{g=m;o=0;break}while(1){h=(h*10|0)+o|0;g=g+1|0;o=(i[g>>0]|0)+-48|0;if(o>>>0>=10){o=h;break e}}}m=g+2|0;h=(i[m>>0]|0)+-48|0;if(h>>>0<10?(i[g+3>>0]|0)==36:0){k[e+(h<<2)>>2]=10;g=g+4|0;o=k[d+((i[m>>0]|0)+-48<<3)>>2]|0;break}if(b){f=-1;break a}if(L){g=(k[c>>2]|0)+(4-1)&~(4-1);o=k[g>>2]|0;k[c>>2]=g+4;g=m}else{g=m;o=0}}else o=-1;while(0);s=0;while(1){h=(i[g>>0]|0)+-65|0;if(h>>>0>57){f=-1;break a}m=g+1|0;h=i[56223+(s*58|0)+h>>0]|0;q=h&255;if((q+-1|0)>>>0<8){g=m;s=q}else{I=m;break}}if(!(h<<24>>24)){f=-1;break}m=(u|0)>-1;do if(h<<24>>24==19)if(m){f=-1;break a}else K=52;else{if(m){k[e+(u<<2)>>2]=q;G=d+(u<<3)|0;H=k[G+4>>2]|0;K=aa;k[K>>2]=k[G>>2];k[K+4>>2]=H;K=52;break}if(!L){f=0;break a}Ml(aa,q,c)}while(0);if((K|0)==52?(K=0,!L):0){w=I;g=y;continue}u=i[g>>0]|0;u=(s|0)!=0&(u&15|0)==3?u&-33:u;m=x&-65537;H=(x&8192|0)==0?x:m;f:do switch(u|0){case 110:switch(s|0){case 0:{k[k[aa>>2]>>2]=f;w=I;g=y;continue a}case 1:{k[k[aa>>2]>>2]=f;w=I;g=y;continue a}case 2:{w=k[aa>>2]|0;k[w>>2]=f;k[w+4>>2]=((f|0)<0)<<31>>31;w=I;g=y;continue a}case 3:{j[k[aa>>2]>>1]=f;w=I;g=y;continue a}case 4:{i[k[aa>>2]>>0]=f;w=I;g=y;continue a}case 6:{k[k[aa>>2]>>2]=f;w=I;g=y;continue a}case 7:{w=k[aa>>2]|0;k[w>>2]=f;k[w+4>>2]=((f|0)<0)<<31>>31;w=I;g=y;continue a}default:{w=I;g=y;continue a}}case 112:{s=H|8;o=o>>>0>8?o:8;u=120;K=64;break}case 88:case 120:{s=H;K=64;break}case 111:{m=aa;h=k[m>>2]|0;m=k[m+4>>2]|0;if((h|0)==0&(m|0)==0)g=N;else{g=N;do{g=g+-1|0;i[g>>0]=h&7|48;h=uw(h|0,m|0,3)|0;m=M}while(!((h|0)==0&(m|0)==0))}if(!(H&8)){h=H;s=0;q=56703;K=77}else{s=U-g+1|0;h=H;o=(o|0)<(s|0)?s:o;s=0;q=56703;K=77}break}case 105:case 100:{h=aa;g=k[h>>2]|0;h=k[h+4>>2]|0;if((h|0)<0){g=rw(0,0,g|0,h|0)|0;h=M;m=aa;k[m>>2]=g;k[m+4>>2]=h;m=1;q=56703;K=76;break f}if(!(H&2048)){q=H&1;m=q;q=(q|0)==0?56703:56705;K=76}else{m=1;q=56704;K=76}break}case 117:{h=aa;g=k[h>>2]|0;h=k[h+4>>2]|0;m=0;q=56703;K=76;break}case 99:{i[V>>0]=k[aa>>2];w=V;h=1;s=0;u=56703;g=N;break}case 109:{g=mk()|0;g=nk(k[g>>2]|0)|0;K=82;break}case 115:{g=k[aa>>2]|0;g=(g|0)!=0?g:56713;K=82;break}case 67:{k[fa>>2]=k[aa>>2];k[W>>2]=0;k[aa>>2]=fa;o=-1;K=86;break}case 83:{if(!o){Ol(a,32,J,0,H);g=0;K=98}else K=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{n=+p[aa>>3];k[da>>2]=0;p[t>>3]=n;if((k[t+4>>2]|0)>=0)if(!(H&2048)){G=H&1;F=G;G=(G|0)==0?56721:56726}else{F=1;G=56723}else{n=-n;F=1;G=56720}p[t>>3]=n;E=k[t+4>>2]&2146435072;do if(E>>>0<2146435072|(E|0)==2146435072&0<0){v=+Gk(n,da)*2.0;h=v!=0.0;if(h)k[da>>2]=(k[da>>2]|0)+-1;C=u|32;if((C|0)==97){w=u&32;y=(w|0)==0?G:G+9|0;x=F|2;g=12-o|0;do if(!(o>>>0>11|(g|0)==0)){n=8.0;do{g=g+-1|0;n=n*16.0}while((g|0)!=0);if((i[y>>0]|0)==45){n=-(n+(-v-n));break}else{n=v+n-n;break}}else n=v;while(0);h=k[da>>2]|0;g=(h|0)<0?0-h|0:h;g=Nl(g,((g|0)<0)<<31>>31,X)|0;if((g|0)==(X|0)){i[Y>>0]=48;g=Y}i[g+-1>>0]=(h>>31&2)+43;s=g+-2|0;i[s>>0]=u+15;q=(o|0)<1;m=(H&8|0)==0;h=ca;while(1){G=~~n;g=h+1|0;i[h>>0]=l[56687+G>>0]|w;n=(n-+(G|0))*16.0;do if((g-Z|0)==1){if(m&(q&n==0.0))break;i[g>>0]=46;g=h+2|0}while(0);if(!(n!=0.0))break;else h=g}o=(o|0)!=0&(O+g|0)<(o|0)?P+o-s|0:$-s+g|0;m=o+x|0;Ol(a,32,J,m,H);if(!(k[a>>2]&32))fl(y,x,a)|0;Ol(a,48,J,m,H^65536);g=g-Z|0;if(!(k[a>>2]&32))fl(ca,g,a)|0;h=_-s|0;Ol(a,48,o-(g+h)|0,0,0);if(!(k[a>>2]&32))fl(s,h,a)|0;Ol(a,32,J,m,H^8192);g=(m|0)<(J|0)?J:m;break}g=(o|0)<0?6:o;if(h){h=(k[da>>2]|0)+-28|0;k[da>>2]=h;n=v*268435456.0}else{n=v;h=k[da>>2]|0}E=(h|0)<0?ba:Q;D=E;h=E;do{B=~~n>>>0;k[h>>2]=B;h=h+4|0;n=(n-+(B>>>0))*1.0e9}while(n!=0.0);m=h;h=k[da>>2]|0;if((h|0)>0){q=E;while(1){s=(h|0)>29?29:h;o=m+-4|0;do if(o>>>0>>0)o=q;else{h=0;do{B=ww(k[o>>2]|0,0,s|0)|0;B=tw(B|0,M|0,h|0,0)|0;h=M;A=Fw(B|0,h|0,1e9,0)|0;k[o>>2]=A;h=Ew(B|0,h|0,1e9,0)|0;o=o+-4|0}while(o>>>0>=q>>>0);if(!h){o=q;break}o=q+-4|0;k[o>>2]=h}while(0);while(1){if(m>>>0<=o>>>0)break;h=m+-4|0;if(!(k[h>>2]|0))m=h;else break}h=(k[da>>2]|0)-s|0;k[da>>2]=h;if((h|0)>0)q=o;else break}}else o=E;if((h|0)<0){y=((g+25|0)/9|0)+1|0;z=(C|0)==102;w=o;while(1){x=0-h|0;x=(x|0)>9?9:x;do if(w>>>0>>0){h=(1<>>x;o=0;s=w;do{B=k[s>>2]|0;k[s>>2]=(B>>>x)+o;o=ia(B&h,q)|0;s=s+4|0}while(s>>>0>>0);h=(k[w>>2]|0)==0?w+4|0:w;if(!o){o=h;break}k[m>>2]=o;o=h;m=m+4|0}else o=(k[w>>2]|0)==0?w+4|0:w;while(0);h=z?E:o;m=(m-h>>2|0)>(y|0)?h+(y<<2)|0:m;h=(k[da>>2]|0)+x|0;k[da>>2]=h;if((h|0)>=0){w=o;break}else w=o}}else w=o;do if(w>>>0>>0){h=(D-w>>2)*9|0;q=k[w>>2]|0;if(q>>>0<10)break;else o=10;do{o=o*10|0;h=h+1|0}while(q>>>0>=o>>>0)}else h=0;while(0);A=(C|0)==103;B=(g|0)!=0;o=g-((C|0)!=102?h:0)+((B&A)<<31>>31)|0;if((o|0)<(((m-D>>2)*9|0)+-9|0)){s=o+9216|0;z=(s|0)/9|0;o=E+(z+-1023<<2)|0;s=((s|0)%9|0)+1|0;if((s|0)<9){q=10;do{q=q*10|0;s=s+1|0}while((s|0)!=9)}else q=10;x=k[o>>2]|0;y=(x>>>0)%(q>>>0)|0;if((y|0)==0?(E+(z+-1022<<2)|0)==(m|0):0)q=w;else K=163;do if((K|0)==163){K=0;v=(((x>>>0)/(q>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;s=(q|0)/2|0;do if(y>>>0>>0)n=.5;else{if((y|0)==(s|0)?(E+(z+-1022<<2)|0)==(m|0):0){n=1.0;break}n=1.5}while(0);do if(F){if((i[G>>0]|0)!=45)break;v=-v;n=-n}while(0);s=x-y|0;k[o>>2]=s;if(!(v+n!=v)){q=w;break}C=s+q|0;k[o>>2]=C;if(C>>>0>999999999){h=w;while(1){q=o+-4|0;k[o>>2]=0;if(q>>>0>>0){h=h+-4|0;k[h>>2]=0}C=(k[q>>2]|0)+1|0;k[q>>2]=C;if(C>>>0>999999999)o=q;else{w=h;o=q;break}}}h=(D-w>>2)*9|0;s=k[w>>2]|0;if(s>>>0<10){q=w;break}else q=10;do{q=q*10|0;h=h+1|0}while(s>>>0>=q>>>0);q=w}while(0);C=o+4|0;w=q;m=m>>>0>C>>>0?C:m}y=0-h|0;while(1){if(m>>>0<=w>>>0){z=0;C=m;break}o=m+-4|0;if(!(k[o>>2]|0))m=o;else{z=1;C=m;break}}do if(A){g=(B&1^1)+g|0;if((g|0)>(h|0)&(h|0)>-5){u=u+-1|0;g=g+-1-h|0}else{u=u+-2|0;g=g+-1|0}m=H&8;if(m)break;do if(z){m=k[C+-4>>2]|0;if(!m){o=9;break}if(!((m>>>0)%10|0)){q=10;o=0}else{o=0;break}do{q=q*10|0;o=o+1|0}while(((m>>>0)%(q>>>0)|0|0)==0)}else o=9;while(0);m=((C-D>>2)*9|0)+-9|0;if((u|32|0)==102){m=m-o|0;m=(m|0)<0?0:m;g=(g|0)<(m|0)?g:m;m=0;break}else{m=m+h-o|0;m=(m|0)<0?0:m;g=(g|0)<(m|0)?g:m;m=0;break}}else m=H&8;while(0);x=g|m;q=(x|0)!=0&1;s=(u|32|0)==102;if(s){h=(h|0)>0?h:0;u=0}else{o=(h|0)<0?y:h;o=Nl(o,((o|0)<0)<<31>>31,X)|0;if((_-o|0)<2)do{o=o+-1|0;i[o>>0]=48}while((_-o|0)<2);i[o+-1>>0]=(h>>31&2)+43;D=o+-2|0;i[D>>0]=u;h=_-D|0;u=D}y=F+1+g+q+h|0;Ol(a,32,J,y,H);if(!(k[a>>2]&32))fl(G,F,a)|0;Ol(a,48,J,y,H^65536);do if(s){o=w>>>0>E>>>0?E:w;h=o;do{m=Nl(k[h>>2]|0,0,R)|0;do if((h|0)==(o|0)){if((m|0)!=(R|0))break;i[T>>0]=48;m=T}else{if(m>>>0<=ca>>>0)break;do{m=m+-1|0;i[m>>0]=48}while(m>>>0>ca>>>0)}while(0);if(!(k[a>>2]&32))fl(m,S-m|0,a)|0;h=h+4|0}while(h>>>0<=E>>>0);do if(x){if(k[a>>2]&32)break;fl(56755,1,a)|0}while(0);if((g|0)>0&h>>>0>>0){m=h;while(1){h=Nl(k[m>>2]|0,0,R)|0;if(h>>>0>ca>>>0)do{h=h+-1|0;i[h>>0]=48}while(h>>>0>ca>>>0);if(!(k[a>>2]&32))fl(h,(g|0)>9?9:g,a)|0;m=m+4|0;h=g+-9|0;if(!((g|0)>9&m>>>0>>0)){g=h;break}else g=h}}Ol(a,48,g+9|0,9,0)}else{s=z?C:w+4|0;if((g|0)>-1){q=(m|0)==0;o=w;do{h=Nl(k[o>>2]|0,0,R)|0;if((h|0)==(R|0)){i[T>>0]=48;h=T}do if((o|0)==(w|0)){m=h+1|0;if(!(k[a>>2]&32))fl(h,1,a)|0;if(q&(g|0)<1){h=m;break}if(k[a>>2]&32){h=m;break}fl(56755,1,a)|0;h=m}else{if(h>>>0<=ca>>>0)break;do{h=h+-1|0;i[h>>0]=48}while(h>>>0>ca>>>0)}while(0);m=S-h|0;if(!(k[a>>2]&32))fl(h,(g|0)>(m|0)?m:g,a)|0;g=g-m|0;o=o+4|0}while(o>>>0>>0&(g|0)>-1)}Ol(a,48,g+18|0,18,0);if(k[a>>2]&32)break;fl(u,_-u|0,a)|0}while(0);Ol(a,32,J,y,H^8192);g=(y|0)<(J|0)?J:y}else{s=(u&32|0)!=0;q=n!=n|0.0!=0.0;h=q?0:F;o=h+3|0;Ol(a,32,J,o,m);g=k[a>>2]|0;if(!(g&32)){fl(G,h,a)|0;g=k[a>>2]|0}if(!(g&32))fl(q?(s?56747:56751):s?56739:56743,3,a)|0;Ol(a,32,J,o,H^8192);g=(o|0)<(J|0)?J:o}while(0);w=I;continue a}default:{m=H;h=o;s=0;u=56703;g=N}}while(0);g:do if((K|0)==64){m=aa;h=k[m>>2]|0;m=k[m+4>>2]|0;q=u&32;if(!((h|0)==0&(m|0)==0)){g=N;do{g=g+-1|0;i[g>>0]=l[56687+(h&15)>>0]|q;h=uw(h|0,m|0,4)|0;m=M}while(!((h|0)==0&(m|0)==0));K=aa;if((s&8|0)==0|(k[K>>2]|0)==0&(k[K+4>>2]|0)==0){h=s;s=0;q=56703;K=77}else{h=s;s=2;q=56703+(u>>4)|0;K=77}}else{g=N;h=s;s=0;q=56703;K=77}}else if((K|0)==76){g=Nl(g,h,N)|0;h=H;s=m;K=77}else if((K|0)==82){K=0;H=tl(g,0,o)|0;G=(H|0)==0;w=g;h=G?o:H-g|0;s=0;u=56703;g=G?g+o|0:H}else if((K|0)==86){K=0;h=0;g=0;q=k[aa>>2]|0;while(1){m=k[q>>2]|0;if(!m)break;g=Sk(ea,m)|0;if((g|0)<0|g>>>0>(o-h|0)>>>0)break;h=g+h|0;if(o>>>0>h>>>0)q=q+4|0;else break}if((g|0)<0){f=-1;break a}Ol(a,32,J,h,H);if(!h){g=0;K=98}else{m=0;o=k[aa>>2]|0;while(1){g=k[o>>2]|0;if(!g){g=h;K=98;break g}g=Sk(ea,g)|0;m=g+m|0;if((m|0)>(h|0)){g=h;K=98;break g}if(!(k[a>>2]&32))fl(ea,g,a)|0;if(m>>>0>=h>>>0){g=h;K=98;break}else o=o+4|0}}}while(0);if((K|0)==98){K=0;Ol(a,32,J,g,H^8192);w=I;g=(J|0)>(g|0)?J:g;continue}if((K|0)==77){K=0;m=(o|0)>-1?h&-65537:h;h=aa;h=(k[h>>2]|0)!=0|(k[h+4>>2]|0)!=0;if((o|0)!=0|h){h=(h&1^1)+(U-g)|0;w=g;h=(o|0)>(h|0)?o:h;u=q;g=N}else{w=N;h=0;u=q;g=N}}q=g-w|0;h=(h|0)<(q|0)?q:h;o=s+h|0;g=(J|0)<(o|0)?o:J;Ol(a,32,g,o,m);if(!(k[a>>2]&32))fl(u,s,a)|0;Ol(a,48,g,o,m^65536);Ol(a,48,h,q,0);if(!(k[a>>2]&32))fl(w,q,a)|0;Ol(a,32,g,o,m^8192);w=I}h:do if((K|0)==245)if(!a)if(b){f=1;while(1){b=k[e+(f<<2)>>2]|0;if(!b)break;Ml(d+(f<<3)|0,b,c);f=f+1|0;if((f|0)>=10){f=1;break h}}if((f|0)<10)while(1){if(k[e+(f<<2)>>2]|0){f=-1;break h}f=f+1|0;if((f|0)>=10){f=1;break}}else f=1}else f=0;while(0);r=ga;return f|0}function Il(a,b,c){a=a|0;b=b|0;c=c|0;return $k(a,b,c)|0}function Jl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,h=0;h=r;r=r+112|0;g=h;e=g;f=e+112|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(f|0));e=g+4|0;k[e>>2]=a;f=g+8|0;k[f>>2]=-1;k[g+44>>2]=a;k[g+76>>2]=-1;qk(g,0);d=+ok(g,c,1);c=(k[e>>2]|0)-(k[f>>2]|0)+(k[g+108>>2]|0)|0;if(b)k[b>>2]=(c|0)!=0?a+c|0:a;r=h;return +d}function Kl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=r;r=r+112|0;h=i;k[h>>2]=0;f=h+4|0;k[f>>2]=a;k[h+44>>2]=a;g=h+8|0;k[g>>2]=(a|0)<0?-1:a+2147483647|0;k[h+76>>2]=-1;qk(h,0);d=pk(h,c,1,d,e)|0;if(b)k[b>>2]=a+((k[f>>2]|0)+(k[h+108>>2]|0)-(k[g>>2]|0));r=i;return d|0}function Ll(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=a+20|0;e=k[d>>2]|0;a=(k[a+16>>2]|0)-e|0;a=a>>>0>c>>>0?c:a;vw(e|0,b|0,a|0)|0;k[d>>2]=(k[d>>2]|0)+a;return c|0}function Ml(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{d=(k[c>>2]|0)+(4-1)&~(4-1);b=k[d>>2]|0;k[c>>2]=d+4;k[a>>2]=b;break a}case 10:{d=(k[c>>2]|0)+(4-1)&~(4-1);b=k[d>>2]|0;k[c>>2]=d+4;d=a;k[d>>2]=b;k[d+4>>2]=((b|0)<0)<<31>>31;break a}case 11:{d=(k[c>>2]|0)+(4-1)&~(4-1);b=k[d>>2]|0;k[c>>2]=d+4;d=a;k[d>>2]=b;k[d+4>>2]=0;break a}case 12:{d=(k[c>>2]|0)+(8-1)&~(8-1);b=d;e=k[b>>2]|0;b=k[b+4>>2]|0;k[c>>2]=d+8;d=a;k[d>>2]=e;k[d+4>>2]=b;break a}case 13:{e=(k[c>>2]|0)+(4-1)&~(4-1);d=k[e>>2]|0;k[c>>2]=e+4;d=(d&65535)<<16>>16;e=a;k[e>>2]=d;k[e+4>>2]=((d|0)<0)<<31>>31;break a}case 14:{e=(k[c>>2]|0)+(4-1)&~(4-1);d=k[e>>2]|0;k[c>>2]=e+4;e=a;k[e>>2]=d&65535;k[e+4>>2]=0;break a}case 15:{e=(k[c>>2]|0)+(4-1)&~(4-1);d=k[e>>2]|0;k[c>>2]=e+4;d=(d&255)<<24>>24;e=a;k[e>>2]=d;k[e+4>>2]=((d|0)<0)<<31>>31;break a}case 16:{e=(k[c>>2]|0)+(4-1)&~(4-1);d=k[e>>2]|0;k[c>>2]=e+4;e=a;k[e>>2]=d&255;k[e+4>>2]=0;break a}case 17:{e=(k[c>>2]|0)+(8-1)&~(8-1);f=+p[e>>3];k[c>>2]=e+8;p[a>>3]=f;break a}case 18:{e=(k[c>>2]|0)+(8-1)&~(8-1);f=+p[e>>3];k[c>>2]=e+8;p[a>>3]=f;break a}default:break a}while(0);while(0);return}function Nl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if(b>>>0>0|(b|0)==0&a>>>0>4294967295)while(1){d=Fw(a|0,b|0,10,0)|0;c=c+-1|0;i[c>>0]=d|48;d=Ew(a|0,b|0,10,0)|0;if(b>>>0>9|(b|0)==9&a>>>0>4294967295){a=d;b=M}else{a=d;break}}if(a)while(1){c=c+-1|0;i[c>>0]=(a>>>0)%10|0|48;if(a>>>0<10)break;else a=(a>>>0)/10|0}return c|0}function Ol(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=r;r=r+256|0;g=h;do if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;sw(g|0,b|0,(e>>>0>256?256:e)|0)|0;b=k[a>>2]|0;f=(b&32|0)==0;if(e>>>0>255){d=c-d|0;do{if(f){fl(g,256,a)|0;b=k[a>>2]|0}e=e+-256|0;f=(b&32|0)==0}while(e>>>0>255);if(f)e=d&255;else break}else if(!f)break;fl(g,e,a)|0}while(0);r=h;return}function Pl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;do if(a>>>0<245){o=a>>>0<11?16:a+11&-8;a=o>>>3;h=k[10218]|0;c=h>>>a;if(c&3){a=(c&1^1)+a|0;d=a<<1;c=40912+(d<<2)|0;d=40912+(d+2<<2)|0;e=k[d>>2]|0;f=e+8|0;g=k[f>>2]|0;do if((c|0)!=(g|0)){if(g>>>0<(k[10222]|0)>>>0)Pa();b=g+12|0;if((k[b>>2]|0)==(e|0)){k[b>>2]=c;k[d>>2]=g;break}else Pa()}else k[10218]=h&~(1<>2]=M|3;M=e+(M|4)|0;k[M>>2]=k[M>>2]|1;M=f;return M|0}g=k[10220]|0;if(o>>>0>g>>>0){if(c){d=2<>>12&16;d=d>>>i;e=d>>>5&8;d=d>>>e;f=d>>>2&4;d=d>>>f;c=d>>>1&2;d=d>>>c;a=d>>>1&1;a=(e|i|f|c|a)+(d>>>a)|0;d=a<<1;c=40912+(d<<2)|0;d=40912+(d+2<<2)|0;f=k[d>>2]|0;i=f+8|0;e=k[i>>2]|0;do if((c|0)!=(e|0)){if(e>>>0<(k[10222]|0)>>>0)Pa();b=e+12|0;if((k[b>>2]|0)==(f|0)){k[b>>2]=c;k[d>>2]=e;j=k[10220]|0;break}else Pa()}else{k[10218]=h&~(1<>2]=o|3;h=f+o|0;k[f+(o|4)>>2]=g|1;k[f+M>>2]=g;if(j){e=k[10223]|0;c=j>>>3;b=c<<1;d=40912+(b<<2)|0;a=k[10218]|0;c=1<>2]|0;if(b>>>0<(k[10222]|0)>>>0)Pa();else{l=a;m=b}}else{k[10218]=a|c;l=40912+(b+2<<2)|0;m=d}k[l>>2]=e;k[m+12>>2]=e;k[e+8>>2]=m;k[e+12>>2]=d}k[10220]=g;k[10223]=h;M=i;return M|0}a=k[10219]|0;if(a){c=(a&0-a)+-1|0;L=c>>>12&16;c=c>>>L;K=c>>>5&8;c=c>>>K;M=c>>>2&4;c=c>>>M;a=c>>>1&2;c=c>>>a;d=c>>>1&1;d=k[41176+((K|L|M|a|d)+(c>>>d)<<2)>>2]|0;c=(k[d+4>>2]&-8)-o|0;a=d;while(1){b=k[a+16>>2]|0;if(!b){b=k[a+20>>2]|0;if(!b){i=c;break}}a=(k[b+4>>2]&-8)-o|0;M=a>>>0>>0;c=M?a:c;a=b;d=M?b:d}f=k[10222]|0;if(d>>>0>>0)Pa();h=d+o|0;if(d>>>0>=h>>>0)Pa();g=k[d+24>>2]|0;c=k[d+12>>2]|0;do if((c|0)==(d|0)){a=d+20|0;b=k[a>>2]|0;if(!b){a=d+16|0;b=k[a>>2]|0;if(!b){n=0;break}}while(1){c=b+20|0;e=k[c>>2]|0;if(e){b=e;a=c;continue}c=b+16|0;e=k[c>>2]|0;if(!e)break;else{b=e;a=c}}if(a>>>0>>0)Pa();else{k[a>>2]=0;n=b;break}}else{e=k[d+8>>2]|0;if(e>>>0>>0)Pa();b=e+12|0;if((k[b>>2]|0)!=(d|0))Pa();a=c+8|0;if((k[a>>2]|0)==(d|0)){k[b>>2]=c;k[a>>2]=e;n=c;break}else Pa()}while(0);do if(g){b=k[d+28>>2]|0;a=41176+(b<<2)|0;if((d|0)==(k[a>>2]|0)){k[a>>2]=n;if(!n){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();b=g+16|0;if((k[b>>2]|0)==(d|0))k[b>>2]=n;else k[g+20>>2]=n;if(!n)break}a=k[10222]|0;if(n>>>0>>0)Pa();k[n+24>>2]=g;b=k[d+16>>2]|0;do if(b)if(b>>>0>>0)Pa();else{k[n+16>>2]=b;k[b+24>>2]=n;break}while(0);b=k[d+20>>2]|0;if(b)if(b>>>0<(k[10222]|0)>>>0)Pa();else{k[n+20>>2]=b;k[b+24>>2]=n;break}}while(0);if(i>>>0<16){M=i+o|0;k[d+4>>2]=M|3;M=d+(M+4)|0;k[M>>2]=k[M>>2]|1}else{k[d+4>>2]=o|3;k[d+(o|4)>>2]=i|1;k[d+(i+o)>>2]=i;b=k[10220]|0;if(b){f=k[10223]|0;c=b>>>3;b=c<<1;e=40912+(b<<2)|0;a=k[10218]|0;c=1<>2]|0;if(a>>>0<(k[10222]|0)>>>0)Pa();else{p=b;q=a}}else{k[10218]=a|c;p=40912+(b+2<<2)|0;q=e}k[p>>2]=f;k[q+12>>2]=f;k[f+8>>2]=q;k[f+12>>2]=e}k[10220]=i;k[10223]=h}M=d+8|0;return M|0}else q=o}else q=o}else if(a>>>0<=4294967231){a=a+11|0;m=a&-8;l=k[10219]|0;if(l){c=0-m|0;a=a>>>8;if(a)if(m>>>0>16777215)j=31;else{q=(a+1048320|0)>>>16&8;v=a<>>16&4;v=v<>>16&2;j=14-(p|q|j)+(v<>>15)|0;j=m>>>(j+7|0)&1|j<<1}else j=0;a=k[41176+(j<<2)>>2]|0;a:do if(!a){e=0;a=0;v=86}else{g=c;e=0;h=m<<((j|0)==31?0:25-(j>>>1)|0);i=a;a=0;while(1){f=k[i+4>>2]&-8;c=f-m|0;if(c>>>0>>0)if((f|0)==(m|0)){f=i;a=i;v=90;break a}else a=i;else c=g;v=k[i+20>>2]|0;i=k[i+16+(h>>>31<<2)>>2]|0;e=(v|0)==0|(v|0)==(i|0)?e:v;if(!i){v=86;break}else{g=c;h=h<<1}}}while(0);if((v|0)==86){if((e|0)==0&(a|0)==0){a=2<>>12&16;a=a>>>n;l=a>>>5&8;a=a>>>l;p=a>>>2&4;a=a>>>p;q=a>>>1&2;a=a>>>q;e=a>>>1&1;e=k[41176+((l|n|p|q|e)+(a>>>e)<<2)>>2]|0;a=0}if(!e){h=c;i=a}else{f=e;v=90}}if((v|0)==90)while(1){v=0;q=(k[f+4>>2]&-8)-m|0;e=q>>>0>>0;c=e?q:c;a=e?f:a;e=k[f+16>>2]|0;if(e){f=e;v=90;continue}f=k[f+20>>2]|0;if(!f){h=c;i=a;break}else v=90}if((i|0)!=0?h>>>0<((k[10220]|0)-m|0)>>>0:0){e=k[10222]|0;if(i>>>0>>0)Pa();g=i+m|0;if(i>>>0>=g>>>0)Pa();f=k[i+24>>2]|0;c=k[i+12>>2]|0;do if((c|0)==(i|0)){a=i+20|0;b=k[a>>2]|0;if(!b){a=i+16|0;b=k[a>>2]|0;if(!b){o=0;break}}while(1){c=b+20|0;d=k[c>>2]|0;if(d){b=d;a=c;continue}c=b+16|0;d=k[c>>2]|0;if(!d)break;else{b=d;a=c}}if(a>>>0>>0)Pa();else{k[a>>2]=0;o=b;break}}else{d=k[i+8>>2]|0;if(d>>>0>>0)Pa();b=d+12|0;if((k[b>>2]|0)!=(i|0))Pa();a=c+8|0;if((k[a>>2]|0)==(i|0)){k[b>>2]=c;k[a>>2]=d;o=c;break}else Pa()}while(0);do if(f){b=k[i+28>>2]|0;a=41176+(b<<2)|0;if((i|0)==(k[a>>2]|0)){k[a>>2]=o;if(!o){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();b=f+16|0;if((k[b>>2]|0)==(i|0))k[b>>2]=o;else k[f+20>>2]=o;if(!o)break}a=k[10222]|0;if(o>>>0>>0)Pa();k[o+24>>2]=f;b=k[i+16>>2]|0;do if(b)if(b>>>0>>0)Pa();else{k[o+16>>2]=b;k[b+24>>2]=o;break}while(0);b=k[i+20>>2]|0;if(b)if(b>>>0<(k[10222]|0)>>>0)Pa();else{k[o+20>>2]=b;k[b+24>>2]=o;break}}while(0);b:do if(h>>>0>=16){k[i+4>>2]=m|3;k[i+(m|4)>>2]=h|1;k[i+(h+m)>>2]=h;b=h>>>3;if(h>>>0<256){a=b<<1;d=40912+(a<<2)|0;c=k[10218]|0;b=1<>2]|0;if(a>>>0<(k[10222]|0)>>>0)Pa();else{s=b;t=a}}else{k[10218]=c|b;s=40912+(a+2<<2)|0;t=d}k[s>>2]=g;k[t+12>>2]=g;k[i+(m+8)>>2]=t;k[i+(m+12)>>2]=d;break}b=h>>>8;if(b)if(h>>>0>16777215)d=31;else{L=(b+1048320|0)>>>16&8;M=b<>>16&4;M=M<>>16&2;d=14-(K|L|d)+(M<>>15)|0;d=h>>>(d+7|0)&1|d<<1}else d=0;b=41176+(d<<2)|0;k[i+(m+28)>>2]=d;k[i+(m+20)>>2]=0;k[i+(m+16)>>2]=0;a=k[10219]|0;c=1<>2]=g;k[i+(m+24)>>2]=b;k[i+(m+12)>>2]=g;k[i+(m+8)>>2]=g;break}b=k[b>>2]|0;c:do if((k[b+4>>2]&-8|0)!=(h|0)){d=h<<((d|0)==31?0:25-(d>>>1)|0);while(1){a=b+16+(d>>>31<<2)|0;c=k[a>>2]|0;if(!c)break;if((k[c+4>>2]&-8|0)==(h|0)){y=c;break c}else{d=d<<1;b=c}}if(a>>>0<(k[10222]|0)>>>0)Pa();else{k[a>>2]=g;k[i+(m+24)>>2]=b;k[i+(m+12)>>2]=g;k[i+(m+8)>>2]=g;break b}}else y=b;while(0);b=y+8|0;a=k[b>>2]|0;M=k[10222]|0;if(a>>>0>=M>>>0&y>>>0>=M>>>0){k[a+12>>2]=g;k[b>>2]=g;k[i+(m+8)>>2]=a;k[i+(m+12)>>2]=y;k[i+(m+24)>>2]=0;break}else Pa()}else{M=h+m|0;k[i+4>>2]=M|3;M=i+(M+4)|0;k[M>>2]=k[M>>2]|1}while(0);M=i+8|0;return M|0}else q=m}else q=m}else q=-1;while(0);c=k[10220]|0;if(c>>>0>=q>>>0){b=c-q|0;a=k[10223]|0;if(b>>>0>15){k[10223]=a+q;k[10220]=b;k[a+(q+4)>>2]=b|1;k[a+c>>2]=b;k[a+4>>2]=q|3}else{k[10220]=0;k[10223]=0;k[a+4>>2]=c|3;M=a+(c+4)|0;k[M>>2]=k[M>>2]|1}M=a+8|0;return M|0}a=k[10221]|0;if(a>>>0>q>>>0){L=a-q|0;k[10221]=L;M=k[10224]|0;k[10224]=M+q;k[M+(q+4)>>2]=L|1;k[M+4>>2]=q|3;M=M+8|0;return M|0}do if(!(k[10336]|0)){a=hb(30)|0;if(!(a+-1&a)){k[10338]=a;k[10337]=a;k[10339]=-1;k[10340]=-1;k[10341]=0;k[10329]=0;y=(zb(0)|0)&-16^1431655768;k[10336]=y;break}else Pa()}while(0);i=q+48|0;h=k[10338]|0;j=q+47|0;g=h+j|0;h=0-h|0;l=g&h;if(l>>>0<=q>>>0){M=0;return M|0}a=k[10328]|0;if((a|0)!=0?(t=k[10326]|0,y=t+l|0,y>>>0<=t>>>0|y>>>0>a>>>0):0){M=0;return M|0}d:do if(!(k[10329]&4)){a=k[10224]|0;e:do if(a){e=41320;while(1){c=k[e>>2]|0;if(c>>>0<=a>>>0?(r=e+4|0,(c+(k[r>>2]|0)|0)>>>0>a>>>0):0){f=e;a=r;break}e=k[e+8>>2]|0;if(!e){v=174;break e}}c=g-(k[10221]|0)&h;if(c>>>0<2147483647){e=bb(c|0)|0;y=(e|0)==((k[f>>2]|0)+(k[a>>2]|0)|0);a=y?c:0;if(y){if((e|0)!=(-1|0)){w=e;p=a;v=194;break d}}else v=184}else a=0}else v=174;while(0);do if((v|0)==174){f=bb(0)|0;if((f|0)!=(-1|0)){a=f;c=k[10337]|0;e=c+-1|0;if(!(e&a))c=l;else c=l-a+(e+a&0-c)|0;a=k[10326]|0;e=a+c|0;if(c>>>0>q>>>0&c>>>0<2147483647){y=k[10328]|0;if((y|0)!=0?e>>>0<=a>>>0|e>>>0>y>>>0:0){a=0;break}e=bb(c|0)|0;y=(e|0)==(f|0);a=y?c:0;if(y){w=f;p=a;v=194;break d}else v=184}else a=0}else a=0}while(0);f:do if((v|0)==184){f=0-c|0;do if(i>>>0>c>>>0&(c>>>0<2147483647&(e|0)!=(-1|0))?(u=k[10338]|0,u=j-c+u&0-u,u>>>0<2147483647):0)if((bb(u|0)|0)==(-1|0)){bb(f|0)|0;break f}else{c=u+c|0;break}while(0);if((e|0)!=(-1|0)){w=e;p=c;v=194;break d}}while(0);k[10329]=k[10329]|4;v=191}else{a=0;v=191}while(0);if((((v|0)==191?l>>>0<2147483647:0)?(w=bb(l|0)|0,x=bb(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(z=x-w|0,A=z>>>0>(q+40|0)>>>0,A):0){p=A?z:a;v=194}if((v|0)==194){a=(k[10326]|0)+p|0;k[10326]=a;if(a>>>0>(k[10327]|0)>>>0)k[10327]=a;g=k[10224]|0;g:do if(g){f=41320;do{a=k[f>>2]|0;c=f+4|0;e=k[c>>2]|0;if((w|0)==(a+e|0)){B=a;C=c;D=e;E=f;v=204;break}f=k[f+8>>2]|0}while((f|0)!=0);if(((v|0)==204?(k[E+12>>2]&8|0)==0:0)?g>>>0>>0&g>>>0>=B>>>0:0){k[C>>2]=D+p;M=(k[10221]|0)+p|0;L=g+8|0;L=(L&7|0)==0?0:0-L&7;K=M-L|0;k[10224]=g+L;k[10221]=K;k[g+(L+4)>>2]=K|1;k[g+(M+4)>>2]=40;k[10225]=k[10340];break}a=k[10222]|0;if(w>>>0>>0){k[10222]=w;a=w}c=w+p|0;f=41320;while(1){if((k[f>>2]|0)==(c|0)){e=f;c=f;v=212;break}f=k[f+8>>2]|0;if(!f){c=41320;break}}if((v|0)==212)if(!(k[c+12>>2]&8)){k[e>>2]=w;n=c+4|0;k[n>>2]=(k[n>>2]|0)+p;n=w+8|0;n=(n&7|0)==0?0:0-n&7;j=w+(p+8)|0;j=(j&7|0)==0?0:0-j&7;b=w+(j+p)|0;m=n+q|0;o=w+m|0;l=b-(w+n)-q|0;k[w+(n+4)>>2]=q|3;h:do if((b|0)!=(g|0)){if((b|0)==(k[10223]|0)){M=(k[10220]|0)+l|0;k[10220]=M;k[10223]=o;k[w+(m+4)>>2]=M|1;k[w+(M+m)>>2]=M;break}h=p+4|0;c=k[w+(h+j)>>2]|0;if((c&3|0)==1){i=c&-8;f=c>>>3;i:do if(c>>>0>=256){g=k[w+((j|24)+p)>>2]|0;d=k[w+(p+12+j)>>2]|0;do if((d|0)==(b|0)){e=j|16;d=w+(h+e)|0;c=k[d>>2]|0;if(!c){d=w+(e+p)|0;c=k[d>>2]|0;if(!c){J=0;break}}while(1){e=c+20|0;f=k[e>>2]|0;if(f){c=f;d=e;continue}e=c+16|0;f=k[e>>2]|0;if(!f)break;else{c=f;d=e}}if(d>>>0>>0)Pa();else{k[d>>2]=0;J=c;break}}else{e=k[w+((j|8)+p)>>2]|0;if(e>>>0>>0)Pa();a=e+12|0;if((k[a>>2]|0)!=(b|0))Pa();c=d+8|0;if((k[c>>2]|0)==(b|0)){k[a>>2]=d;k[c>>2]=e;J=d;break}else Pa()}while(0);if(!g)break;a=k[w+(p+28+j)>>2]|0;c=41176+(a<<2)|0;do if((b|0)!=(k[c>>2]|0)){if(g>>>0<(k[10222]|0)>>>0)Pa();a=g+16|0;if((k[a>>2]|0)==(b|0))k[a>>2]=J;else k[g+20>>2]=J;if(!J)break i}else{k[c>>2]=J;if(J)break;k[10219]=k[10219]&~(1<>>0>>0)Pa();k[J+24>>2]=g;b=j|16;a=k[w+(b+p)>>2]|0;do if(a)if(a>>>0>>0)Pa();else{k[J+16>>2]=a;k[a+24>>2]=J;break}while(0);b=k[w+(h+b)>>2]|0;if(!b)break;if(b>>>0<(k[10222]|0)>>>0)Pa();else{k[J+20>>2]=b;k[b+24>>2]=J;break}}else{d=k[w+((j|8)+p)>>2]|0;e=k[w+(p+12+j)>>2]|0;c=40912+(f<<1<<2)|0;do if((d|0)!=(c|0)){if(d>>>0>>0)Pa();if((k[d+12>>2]|0)==(b|0))break;Pa()}while(0);if((e|0)==(d|0)){k[10218]=k[10218]&~(1<>>0>>0)Pa();a=e+8|0;if((k[a>>2]|0)==(b|0)){F=a;break}Pa()}while(0);k[d+12>>2]=e;k[F>>2]=d}while(0);b=w+((i|j)+p)|0;e=i+l|0}else e=l;b=b+4|0;k[b>>2]=k[b>>2]&-2;k[w+(m+4)>>2]=e|1;k[w+(e+m)>>2]=e;b=e>>>3;if(e>>>0<256){a=b<<1;d=40912+(a<<2)|0;c=k[10218]|0;b=1<>2]|0;if(a>>>0>=(k[10222]|0)>>>0){K=b;L=a;break}Pa()}while(0);k[K>>2]=o;k[L+12>>2]=o;k[w+(m+8)>>2]=L;k[w+(m+12)>>2]=d;break}b=e>>>8;do if(!b)d=0;else{if(e>>>0>16777215){d=31;break}K=(b+1048320|0)>>>16&8;L=b<>>16&4;L=L<>>16&2;d=14-(J|K|d)+(L<>>15)|0;d=e>>>(d+7|0)&1|d<<1}while(0);b=41176+(d<<2)|0;k[w+(m+28)>>2]=d;k[w+(m+20)>>2]=0;k[w+(m+16)>>2]=0;a=k[10219]|0;c=1<>2]=o;k[w+(m+24)>>2]=b;k[w+(m+12)>>2]=o;k[w+(m+8)>>2]=o;break}b=k[b>>2]|0;j:do if((k[b+4>>2]&-8|0)!=(e|0)){d=e<<((d|0)==31?0:25-(d>>>1)|0);while(1){a=b+16+(d>>>31<<2)|0;c=k[a>>2]|0;if(!c)break;if((k[c+4>>2]&-8|0)==(e|0)){M=c;break j}else{d=d<<1;b=c}}if(a>>>0<(k[10222]|0)>>>0)Pa();else{k[a>>2]=o;k[w+(m+24)>>2]=b;k[w+(m+12)>>2]=o;k[w+(m+8)>>2]=o;break h}}else M=b;while(0);b=M+8|0;a=k[b>>2]|0;L=k[10222]|0;if(a>>>0>=L>>>0&M>>>0>=L>>>0){k[a+12>>2]=o;k[b>>2]=o;k[w+(m+8)>>2]=a;k[w+(m+12)>>2]=M;k[w+(m+24)>>2]=0;break}else Pa()}else{M=(k[10221]|0)+l|0;k[10221]=M;k[10224]=o;k[w+(m+4)>>2]=M|1}while(0);M=w+(n|8)|0;return M|0}else c=41320;while(1){a=k[c>>2]|0;if(a>>>0<=g>>>0?(b=k[c+4>>2]|0,d=a+b|0,d>>>0>g>>>0):0)break;c=k[c+8>>2]|0}e=a+(b+-39)|0;a=a+(b+-47+((e&7|0)==0?0:0-e&7))|0;e=g+16|0;a=a>>>0>>0?g:a;b=a+8|0;c=w+8|0;c=(c&7|0)==0?0:0-c&7;M=p+-40-c|0;k[10224]=w+c;k[10221]=M;k[w+(c+4)>>2]=M|1;k[w+(p+-36)>>2]=40;k[10225]=k[10340];c=a+4|0;k[c>>2]=27;k[b>>2]=k[10330];k[b+4>>2]=k[10331];k[b+8>>2]=k[10332];k[b+12>>2]=k[10333];k[10330]=w;k[10331]=p;k[10333]=0;k[10332]=b;b=a+28|0;k[b>>2]=7;if((a+32|0)>>>0>>0)do{M=b;b=b+4|0;k[b>>2]=7}while((M+8|0)>>>0>>0);if((a|0)!=(g|0)){f=a-g|0;k[c>>2]=k[c>>2]&-2;k[g+4>>2]=f|1;k[a>>2]=f;b=f>>>3;if(f>>>0<256){a=b<<1;d=40912+(a<<2)|0;c=k[10218]|0;b=1<>2]|0;if(a>>>0<(k[10222]|0)>>>0)Pa();else{G=b;H=a}}else{k[10218]=c|b;G=40912+(a+2<<2)|0;H=d}k[G>>2]=g;k[H+12>>2]=g;k[g+8>>2]=H;k[g+12>>2]=d;break}b=f>>>8;if(b)if(f>>>0>16777215)d=31;else{L=(b+1048320|0)>>>16&8;M=b<>>16&4;M=M<>>16&2;d=14-(K|L|d)+(M<>>15)|0;d=f>>>(d+7|0)&1|d<<1}else d=0;c=41176+(d<<2)|0;k[g+28>>2]=d;k[g+20>>2]=0;k[e>>2]=0;b=k[10219]|0;a=1<>2]=g;k[g+24>>2]=c;k[g+12>>2]=g;k[g+8>>2]=g;break}b=k[c>>2]|0;k:do if((k[b+4>>2]&-8|0)!=(f|0)){d=f<<((d|0)==31?0:25-(d>>>1)|0);while(1){a=b+16+(d>>>31<<2)|0;c=k[a>>2]|0;if(!c)break;if((k[c+4>>2]&-8|0)==(f|0)){I=c;break k}else{d=d<<1;b=c}}if(a>>>0<(k[10222]|0)>>>0)Pa();else{k[a>>2]=g;k[g+24>>2]=b;k[g+12>>2]=g;k[g+8>>2]=g;break g}}else I=b;while(0);b=I+8|0;a=k[b>>2]|0;M=k[10222]|0;if(a>>>0>=M>>>0&I>>>0>=M>>>0){k[a+12>>2]=g;k[b>>2]=g;k[g+8>>2]=a;k[g+12>>2]=I;k[g+24>>2]=0;break}else Pa()}}else{M=k[10222]|0;if((M|0)==0|w>>>0>>0)k[10222]=w;k[10330]=w;k[10331]=p;k[10333]=0;k[10227]=k[10336];k[10226]=-1;b=0;do{M=b<<1;L=40912+(M<<2)|0;k[40912+(M+3<<2)>>2]=L;k[40912+(M+2<<2)>>2]=L;b=b+1|0}while((b|0)!=32);M=w+8|0;M=(M&7|0)==0?0:0-M&7;L=p+-40-M|0;k[10224]=w+M;k[10221]=L;k[w+(M+4)>>2]=L|1;k[w+(p+-36)>>2]=40;k[10225]=k[10340]}while(0);b=k[10221]|0;if(b>>>0>q>>>0){L=b-q|0;k[10221]=L;M=k[10224]|0;k[10224]=M+q;k[M+(q+4)>>2]=L|1;k[M+4>>2]=q|3;M=M+8|0;return M|0}}M=mk()|0;k[M>>2]=12;M=0;return M|0}function Ql(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;if(!a)return;b=a+-8|0;h=k[10222]|0;if(b>>>0>>0)Pa();c=k[a+-4>>2]|0;d=c&3;if((d|0)==1)Pa();o=c&-8;q=a+(o+-8)|0;do if(!(c&1)){b=k[b>>2]|0;if(!d)return;i=-8-b|0;l=a+i|0;m=b+o|0;if(l>>>0>>0)Pa();if((l|0)==(k[10223]|0)){b=a+(o+-4)|0;c=k[b>>2]|0;if((c&3|0)!=3){u=l;f=m;break}k[10220]=m;k[b>>2]=c&-2;k[a+(i+4)>>2]=m|1;k[q>>2]=m;return}e=b>>>3;if(b>>>0<256){d=k[a+(i+8)>>2]|0;c=k[a+(i+12)>>2]|0;b=40912+(e<<1<<2)|0;if((d|0)!=(b|0)){if(d>>>0>>0)Pa();if((k[d+12>>2]|0)!=(l|0))Pa()}if((c|0)==(d|0)){k[10218]=k[10218]&~(1<>>0>>0)Pa();b=c+8|0;if((k[b>>2]|0)==(l|0))g=b;else Pa()}else g=c+8|0;k[d+12>>2]=c;k[g>>2]=d;u=l;f=m;break}g=k[a+(i+24)>>2]|0;d=k[a+(i+12)>>2]|0;do if((d|0)==(l|0)){c=a+(i+20)|0;b=k[c>>2]|0;if(!b){c=a+(i+16)|0;b=k[c>>2]|0;if(!b){j=0;break}}while(1){d=b+20|0;e=k[d>>2]|0;if(e){b=e;c=d;continue}d=b+16|0;e=k[d>>2]|0;if(!e)break;else{b=e;c=d}}if(c>>>0>>0)Pa();else{k[c>>2]=0;j=b;break}}else{e=k[a+(i+8)>>2]|0;if(e>>>0>>0)Pa();b=e+12|0;if((k[b>>2]|0)!=(l|0))Pa();c=d+8|0;if((k[c>>2]|0)==(l|0)){k[b>>2]=d;k[c>>2]=e;j=d;break}else Pa()}while(0);if(g){b=k[a+(i+28)>>2]|0;c=41176+(b<<2)|0;if((l|0)==(k[c>>2]|0)){k[c>>2]=j;if(!j){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();b=g+16|0;if((k[b>>2]|0)==(l|0))k[b>>2]=j;else k[g+20>>2]=j;if(!j){u=l;f=m;break}}c=k[10222]|0;if(j>>>0>>0)Pa();k[j+24>>2]=g;b=k[a+(i+16)>>2]|0;do if(b)if(b>>>0>>0)Pa();else{k[j+16>>2]=b;k[b+24>>2]=j;break}while(0);b=k[a+(i+20)>>2]|0;if(b)if(b>>>0<(k[10222]|0)>>>0)Pa();else{k[j+20>>2]=b;k[b+24>>2]=j;u=l;f=m;break}else{u=l;f=m}}else{u=l;f=m}}else{u=b;f=o}while(0);if(u>>>0>=q>>>0)Pa();b=a+(o+-4)|0;c=k[b>>2]|0;if(!(c&1))Pa();if(!(c&2)){if((q|0)==(k[10224]|0)){t=(k[10221]|0)+f|0;k[10221]=t;k[10224]=u;k[u+4>>2]=t|1;if((u|0)!=(k[10223]|0))return;k[10223]=0;k[10220]=0;return}if((q|0)==(k[10223]|0)){t=(k[10220]|0)+f|0;k[10220]=t;k[10223]=u;k[u+4>>2]=t|1;k[u+t>>2]=t;return}f=(c&-8)+f|0;e=c>>>3;do if(c>>>0>=256){g=k[a+(o+16)>>2]|0;b=k[a+(o|4)>>2]|0;do if((b|0)==(q|0)){c=a+(o+12)|0;b=k[c>>2]|0;if(!b){c=a+(o+8)|0;b=k[c>>2]|0;if(!b){p=0;break}}while(1){d=b+20|0;e=k[d>>2]|0;if(e){b=e;c=d;continue}d=b+16|0;e=k[d>>2]|0;if(!e)break;else{b=e;c=d}}if(c>>>0<(k[10222]|0)>>>0)Pa();else{k[c>>2]=0;p=b;break}}else{c=k[a+o>>2]|0;if(c>>>0<(k[10222]|0)>>>0)Pa();d=c+12|0;if((k[d>>2]|0)!=(q|0))Pa();e=b+8|0;if((k[e>>2]|0)==(q|0)){k[d>>2]=b;k[e>>2]=c;p=b;break}else Pa()}while(0);if(g){b=k[a+(o+20)>>2]|0;c=41176+(b<<2)|0;if((q|0)==(k[c>>2]|0)){k[c>>2]=p;if(!p){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();b=g+16|0;if((k[b>>2]|0)==(q|0))k[b>>2]=p;else k[g+20>>2]=p;if(!p)break}c=k[10222]|0;if(p>>>0>>0)Pa();k[p+24>>2]=g;b=k[a+(o+8)>>2]|0;do if(b)if(b>>>0>>0)Pa();else{k[p+16>>2]=b;k[b+24>>2]=p;break}while(0);b=k[a+(o+12)>>2]|0;if(b)if(b>>>0<(k[10222]|0)>>>0)Pa();else{k[p+20>>2]=b;k[b+24>>2]=p;break}}}else{d=k[a+o>>2]|0;c=k[a+(o|4)>>2]|0;b=40912+(e<<1<<2)|0;if((d|0)!=(b|0)){if(d>>>0<(k[10222]|0)>>>0)Pa();if((k[d+12>>2]|0)!=(q|0))Pa()}if((c|0)==(d|0)){k[10218]=k[10218]&~(1<>>0<(k[10222]|0)>>>0)Pa();b=c+8|0;if((k[b>>2]|0)==(q|0))n=b;else Pa()}else n=c+8|0;k[d+12>>2]=c;k[n>>2]=d}while(0);k[u+4>>2]=f|1;k[u+f>>2]=f;if((u|0)==(k[10223]|0)){k[10220]=f;return}}else{k[b>>2]=c&-2;k[u+4>>2]=f|1;k[u+f>>2]=f}b=f>>>3;if(f>>>0<256){c=b<<1;e=40912+(c<<2)|0;d=k[10218]|0;b=1<>2]|0;if(c>>>0<(k[10222]|0)>>>0)Pa();else{r=b;s=c}}else{k[10218]=d|b;r=40912+(c+2<<2)|0;s=e}k[r>>2]=u;k[s+12>>2]=u;k[u+8>>2]=s;k[u+12>>2]=e;return}b=f>>>8;if(b)if(f>>>0>16777215)e=31;else{r=(b+1048320|0)>>>16&8;s=b<>>16&4;s=s<>>16&2;e=14-(q|r|e)+(s<>>15)|0;e=f>>>(e+7|0)&1|e<<1}else e=0;b=41176+(e<<2)|0;k[u+28>>2]=e;k[u+20>>2]=0;k[u+16>>2]=0;c=k[10219]|0;d=1<>2]|0;b:do if((k[b+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(e>>>1)|0);while(1){c=b+16+(e>>>31<<2)|0;d=k[c>>2]|0;if(!d)break;if((k[d+4>>2]&-8|0)==(f|0)){t=d;break b}else{e=e<<1;b=d}}if(c>>>0<(k[10222]|0)>>>0)Pa();else{k[c>>2]=u;k[u+24>>2]=b;k[u+12>>2]=u;k[u+8>>2]=u;break a}}else t=b;while(0);b=t+8|0;c=k[b>>2]|0;s=k[10222]|0;if(c>>>0>=s>>>0&t>>>0>=s>>>0){k[c+12>>2]=u;k[b>>2]=u;k[u+8>>2]=c;k[u+12>>2]=t;k[u+24>>2]=0;break}else Pa()}else{k[10219]=c|d;k[b>>2]=u;k[u+24>>2]=b;k[u+12>>2]=u;k[u+8>>2]=u}while(0);u=(k[10226]|0)+-1|0;k[10226]=u;if(!u)b=41328;else return;while(1){b=k[b>>2]|0;if(!b)break;else b=b+8|0}k[10226]=-1;return}function Rl(a,b){a=a|0;b=b|0;var c=0;if(a){c=ia(b,a)|0;if((b|a)>>>0>65535)c=((c>>>0)/(a>>>0)|0|0)==(b|0)?c:-1}else c=0;b=Pl(c)|0;if(!b)return b|0;if(!(k[b+-4>>2]&3))return b|0;sw(b|0,0,c|0)|0;return b|0}function Sl(a,b){a=a|0;b=b|0;var c=0,d=0;if(!a){a=Pl(b)|0;return a|0}if(b>>>0>4294967231){a=mk()|0;k[a>>2]=12;a=0;return a|0}c=Tl(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(c){a=c+8|0;return a|0}c=Pl(b)|0;if(!c){a=0;return a|0}d=k[a+-4>>2]|0;d=(d&-8)-((d&3|0)==0?8:4)|0;vw(c|0,a|0,(d>>>0>>0?d:b)|0)|0;Ql(a);a=c;return a|0}function Tl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0;o=a+4|0;p=k[o>>2]|0;i=p&-8;l=a+i|0;h=k[10222]|0;c=p&3;if(!((c|0)!=1&a>>>0>=h>>>0&a>>>0>>0))Pa();d=a+(i|4)|0;e=k[d>>2]|0;if(!(e&1))Pa();if(!c){if(b>>>0<256){a=0;return a|0}if(i>>>0>=(b+4|0)>>>0?(i-b|0)>>>0<=k[10338]<<1>>>0:0)return a|0;a=0;return a|0}if(i>>>0>=b>>>0){c=i-b|0;if(c>>>0<=15)return a|0;k[o>>2]=p&1|b|2;k[a+(b+4)>>2]=c|3;k[d>>2]=k[d>>2]|1;Ul(a+b|0,c);return a|0}if((l|0)==(k[10224]|0)){c=(k[10221]|0)+i|0;if(c>>>0<=b>>>0){a=0;return a|0}n=c-b|0;k[o>>2]=p&1|b|2;k[a+(b+4)>>2]=n|1;k[10224]=a+b;k[10221]=n;return a|0}if((l|0)==(k[10223]|0)){d=(k[10220]|0)+i|0;if(d>>>0>>0){a=0;return a|0}c=d-b|0;if(c>>>0>15){k[o>>2]=p&1|b|2;k[a+(b+4)>>2]=c|1;k[a+d>>2]=c;d=a+(d+4)|0;k[d>>2]=k[d>>2]&-2;d=a+b|0}else{k[o>>2]=p&1|d|2;d=a+(d+4)|0;k[d>>2]=k[d>>2]|1;d=0;c=0}k[10220]=c;k[10223]=d;return a|0}if(e&2){a=0;return a|0}m=(e&-8)+i|0;if(m>>>0>>0){a=0;return a|0}n=m-b|0;f=e>>>3;do if(e>>>0>=256){g=k[a+(i+24)>>2]|0;f=k[a+(i+12)>>2]|0;do if((f|0)==(l|0)){d=a+(i+20)|0;c=k[d>>2]|0;if(!c){d=a+(i+16)|0;c=k[d>>2]|0;if(!c){j=0;break}}while(1){e=c+20|0;f=k[e>>2]|0;if(f){c=f;d=e;continue}e=c+16|0;f=k[e>>2]|0;if(!f)break;else{c=f;d=e}}if(d>>>0>>0)Pa();else{k[d>>2]=0;j=c;break}}else{e=k[a+(i+8)>>2]|0;if(e>>>0>>0)Pa();c=e+12|0;if((k[c>>2]|0)!=(l|0))Pa();d=f+8|0;if((k[d>>2]|0)==(l|0)){k[c>>2]=f;k[d>>2]=e;j=f;break}else Pa()}while(0);if(g){c=k[a+(i+28)>>2]|0;d=41176+(c<<2)|0;if((l|0)==(k[d>>2]|0)){k[d>>2]=j;if(!j){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();c=g+16|0;if((k[c>>2]|0)==(l|0))k[c>>2]=j;else k[g+20>>2]=j;if(!j)break}d=k[10222]|0;if(j>>>0>>0)Pa();k[j+24>>2]=g;c=k[a+(i+16)>>2]|0;do if(c)if(c>>>0>>0)Pa();else{k[j+16>>2]=c;k[c+24>>2]=j;break}while(0);c=k[a+(i+20)>>2]|0;if(c)if(c>>>0<(k[10222]|0)>>>0)Pa();else{k[j+20>>2]=c;k[c+24>>2]=j;break}}}else{e=k[a+(i+8)>>2]|0;d=k[a+(i+12)>>2]|0;c=40912+(f<<1<<2)|0;if((e|0)!=(c|0)){if(e>>>0>>0)Pa();if((k[e+12>>2]|0)!=(l|0))Pa()}if((d|0)==(e|0)){k[10218]=k[10218]&~(1<>>0>>0)Pa();c=d+8|0;if((k[c>>2]|0)==(l|0))g=c;else Pa()}else g=d+8|0;k[e+12>>2]=d;k[g>>2]=e}while(0);if(n>>>0<16){k[o>>2]=m|p&1|2;b=a+(m|4)|0;k[b>>2]=k[b>>2]|1;return a|0}else{k[o>>2]=p&1|b|2;k[a+(b+4)>>2]=n|3;p=a+(m|4)|0;k[p>>2]=k[p>>2]|1;Ul(a+b|0,n);return a|0}return 0}function Ul(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;q=a+b|0;c=k[a+4>>2]|0;do if(!(c&1)){j=k[a>>2]|0;if(!(c&3))return;n=a+(0-j)|0;m=j+b|0;i=k[10222]|0;if(n>>>0>>0)Pa();if((n|0)==(k[10223]|0)){d=a+(b+4)|0;c=k[d>>2]|0;if((c&3|0)!=3){t=n;g=m;break}k[10220]=m;k[d>>2]=c&-2;k[a+(4-j)>>2]=m|1;k[q>>2]=m;return}f=j>>>3;if(j>>>0<256){e=k[a+(8-j)>>2]|0;d=k[a+(12-j)>>2]|0;c=40912+(f<<1<<2)|0;if((e|0)!=(c|0)){if(e>>>0>>0)Pa();if((k[e+12>>2]|0)!=(n|0))Pa()}if((d|0)==(e|0)){k[10218]=k[10218]&~(1<>>0>>0)Pa();c=d+8|0;if((k[c>>2]|0)==(n|0))h=c;else Pa()}else h=d+8|0;k[e+12>>2]=d;k[h>>2]=e;t=n;g=m;break}h=k[a+(24-j)>>2]|0;e=k[a+(12-j)>>2]|0;do if((e|0)==(n|0)){e=16-j|0;d=a+(e+4)|0;c=k[d>>2]|0;if(!c){d=a+e|0;c=k[d>>2]|0;if(!c){l=0;break}}while(1){e=c+20|0;f=k[e>>2]|0;if(f){c=f;d=e;continue}e=c+16|0;f=k[e>>2]|0;if(!f)break;else{c=f;d=e}}if(d>>>0>>0)Pa();else{k[d>>2]=0;l=c;break}}else{f=k[a+(8-j)>>2]|0;if(f>>>0>>0)Pa();c=f+12|0;if((k[c>>2]|0)!=(n|0))Pa();d=e+8|0;if((k[d>>2]|0)==(n|0)){k[c>>2]=e;k[d>>2]=f;l=e;break}else Pa()}while(0);if(h){c=k[a+(28-j)>>2]|0;d=41176+(c<<2)|0;if((n|0)==(k[d>>2]|0)){k[d>>2]=l;if(!l){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();c=h+16|0;if((k[c>>2]|0)==(n|0))k[c>>2]=l;else k[h+20>>2]=l;if(!l){t=n;g=m;break}}e=k[10222]|0;if(l>>>0>>0)Pa();k[l+24>>2]=h;c=16-j|0;d=k[a+c>>2]|0;do if(d)if(d>>>0>>0)Pa();else{k[l+16>>2]=d;k[d+24>>2]=l;break}while(0);c=k[a+(c+4)>>2]|0;if(c)if(c>>>0<(k[10222]|0)>>>0)Pa();else{k[l+20>>2]=c;k[c+24>>2]=l;t=n;g=m;break}else{t=n;g=m}}else{t=n;g=m}}else{t=a;g=b}while(0);i=k[10222]|0;if(q>>>0>>0)Pa();c=a+(b+4)|0;d=k[c>>2]|0;if(!(d&2)){if((q|0)==(k[10224]|0)){s=(k[10221]|0)+g|0;k[10221]=s;k[10224]=t;k[t+4>>2]=s|1;if((t|0)!=(k[10223]|0))return;k[10223]=0;k[10220]=0;return}if((q|0)==(k[10223]|0)){s=(k[10220]|0)+g|0;k[10220]=s;k[10223]=t;k[t+4>>2]=s|1;k[t+s>>2]=s;return}g=(d&-8)+g|0;f=d>>>3;do if(d>>>0>=256){h=k[a+(b+24)>>2]|0;e=k[a+(b+12)>>2]|0;do if((e|0)==(q|0)){d=a+(b+20)|0;c=k[d>>2]|0;if(!c){d=a+(b+16)|0;c=k[d>>2]|0;if(!c){p=0;break}}while(1){e=c+20|0;f=k[e>>2]|0;if(f){c=f;d=e;continue}e=c+16|0;f=k[e>>2]|0;if(!f)break;else{c=f;d=e}}if(d>>>0>>0)Pa();else{k[d>>2]=0;p=c;break}}else{f=k[a+(b+8)>>2]|0;if(f>>>0>>0)Pa();c=f+12|0;if((k[c>>2]|0)!=(q|0))Pa();d=e+8|0;if((k[d>>2]|0)==(q|0)){k[c>>2]=e;k[d>>2]=f;p=e;break}else Pa()}while(0);if(h){c=k[a+(b+28)>>2]|0;d=41176+(c<<2)|0;if((q|0)==(k[d>>2]|0)){k[d>>2]=p;if(!p){k[10219]=k[10219]&~(1<>>0<(k[10222]|0)>>>0)Pa();c=h+16|0;if((k[c>>2]|0)==(q|0))k[c>>2]=p;else k[h+20>>2]=p;if(!p)break}d=k[10222]|0;if(p>>>0>>0)Pa();k[p+24>>2]=h;c=k[a+(b+16)>>2]|0;do if(c)if(c>>>0>>0)Pa();else{k[p+16>>2]=c;k[c+24>>2]=p;break}while(0);c=k[a+(b+20)>>2]|0;if(c)if(c>>>0<(k[10222]|0)>>>0)Pa();else{k[p+20>>2]=c;k[c+24>>2]=p;break}}}else{e=k[a+(b+8)>>2]|0;d=k[a+(b+12)>>2]|0;c=40912+(f<<1<<2)|0;if((e|0)!=(c|0)){if(e>>>0>>0)Pa();if((k[e+12>>2]|0)!=(q|0))Pa()}if((d|0)==(e|0)){k[10218]=k[10218]&~(1<>>0>>0)Pa();c=d+8|0;if((k[c>>2]|0)==(q|0))o=c;else Pa()}else o=d+8|0;k[e+12>>2]=d;k[o>>2]=e}while(0);k[t+4>>2]=g|1;k[t+g>>2]=g;if((t|0)==(k[10223]|0)){k[10220]=g;return}}else{k[c>>2]=d&-2;k[t+4>>2]=g|1;k[t+g>>2]=g}c=g>>>3;if(g>>>0<256){d=c<<1;f=40912+(d<<2)|0;e=k[10218]|0;c=1<>2]|0;if(d>>>0<(k[10222]|0)>>>0)Pa();else{r=c;s=d}}else{k[10218]=e|c;r=40912+(d+2<<2)|0;s=f}k[r>>2]=t;k[s+12>>2]=t;k[t+8>>2]=s;k[t+12>>2]=f;return}c=g>>>8;if(c)if(g>>>0>16777215)f=31;else{r=(c+1048320|0)>>>16&8;s=c<>>16&4;s=s<>>16&2;f=14-(q|r|f)+(s<>>15)|0;f=g>>>(f+7|0)&1|f<<1}else f=0;c=41176+(f<<2)|0;k[t+28>>2]=f;k[t+20>>2]=0;k[t+16>>2]=0;d=k[10219]|0;e=1<>2]=t;k[t+24>>2]=c;k[t+12>>2]=t;k[t+8>>2]=t;return}c=k[c>>2]|0;a:do if((k[c+4>>2]&-8|0)!=(g|0)){f=g<<((f|0)==31?0:25-(f>>>1)|0);while(1){d=c+16+(f>>>31<<2)|0;e=k[d>>2]|0;if(!e)break;if((k[e+4>>2]&-8|0)==(g|0)){c=e;break a}else{f=f<<1;c=e}}if(d>>>0<(k[10222]|0)>>>0)Pa();k[d>>2]=t;k[t+24>>2]=c;k[t+12>>2]=t;k[t+8>>2]=t;return}while(0);d=c+8|0;e=k[d>>2]|0;s=k[10222]|0;if(!(e>>>0>=s>>>0&c>>>0>=s>>>0))Pa();k[e+12>>2]=t;k[d>>2]=t;k[t+8>>2]=e;k[t+12>>2]=c;k[t+24>>2]=0;return}function Vl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;d=k[9321]|0;Zl(42048,d,42104);k[10342]=42892;k[10344]=42912;k[10343]=0;a=k[10720]|0;x=0;ra(62,41368+a|0,42048);f=x;x=0;if(f&1){f=Wa()|0;qn(41376);fb(f|0)}k[41368+(a+72)>>2]=0;k[41368+(a+76)>>2]=-1;e=k[9322]|0;_l(42152,e,42112);k[10364]=42972;k[10365]=42992;c=k[10740]|0;x=0;ra(62,41456+c|0,42152);f=x;x=0;if(f&1){f=Wa()|0;qn(41460);fb(f|0)}a=c+72|0;k[41456+a>>2]=0;b=c+76|0;k[41456+b>>2]=-1;f=k[9320]|0;_l(42200,f,42120);k[10385]=42972;k[10386]=42992;x=0;ra(62,41540+c|0,42200);g=x;x=0;if(g&1){g=Wa()|0;qn(41544);fb(g|0)}k[41540+a>>2]=0;k[41540+b>>2]=-1;g=k[41540+((k[(k[10385]|0)+-12>>2]|0)+24)>>2]|0;k[10406]=42972;k[10407]=42992;x=0;ra(62,41624+c|0,g|0);g=x;x=0;if(g&1){g=Wa()|0;qn(41628);fb(g|0)}k[41624+a>>2]=0;k[41624+b>>2]=-1;k[41368+((k[(k[10342]|0)+-12>>2]|0)+72)>>2]=41456;a=41540+((k[(k[10385]|0)+-12>>2]|0)+4)|0;k[a>>2]=k[a>>2]|8192;k[41540+((k[(k[10385]|0)+-12>>2]|0)+72)>>2]=41456;$l(42248,d,42128);k[10427]=42932;k[10429]=42952;k[10428]=0;a=k[10730]|0;x=0;ra(62,41708+a|0,42248);g=x;x=0;if(g&1){g=Wa()|0;vn(41716);fb(g|0)}k[41708+(a+72)>>2]=0;k[41708+(a+76)>>2]=-1;am(42304,e,42136);k[10449]=43012;k[10450]=43032;c=k[10750]|0;x=0;ra(62,41796+c|0,42304);g=x;x=0;if(g&1){g=Wa()|0;vn(41800);fb(g|0)}a=c+72|0;k[41796+a>>2]=0;b=c+76|0;k[41796+b>>2]=-1;am(42352,f,42144);k[10470]=43012;k[10471]=43032;x=0;ra(62,41880+c|0,42352);g=x;x=0;if(g&1){g=Wa()|0;vn(41884);fb(g|0)}k[41880+a>>2]=0;k[41880+b>>2]=-1;g=k[41880+((k[(k[10470]|0)+-12>>2]|0)+24)>>2]|0;k[10491]=43012;k[10492]=43032;x=0;ra(62,41964+c|0,g|0);g=x;x=0;if(g&1){g=Wa()|0;vn(41968);fb(g|0)}else{k[41964+a>>2]=0;k[41964+b>>2]=-1;k[41708+((k[(k[10427]|0)+-12>>2]|0)+72)>>2]=41796;g=41880+((k[(k[10470]|0)+-12>>2]|0)+4)|0;k[g>>2]=k[g>>2]|8192;k[41880+((k[(k[10470]|0)+-12>>2]|0)+72)>>2]=41796;return}}function Wl(a){a=a|0;x=0;ta(70,41456)|0;a=x;x=0;if(((!(a&1)?(x=0,ta(70,41624)|0,a=x,x=0,!(a&1)):0)?(x=0,ta(71,41796)|0,a=x,x=0,!(a&1)):0)?(x=0,ta(71,41964)|0,a=x,x=0,!(a&1)):0)return;a=Wa(0)|0;oc(a)}function Xl(){Vl(0);tb(187,56757,w|0)|0;return}function Yl(){return}function Zl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+16|0;f=e+4|0;d=e;zn(a);k[a>>2]=42600;k[a+32>>2]=b;k[a+40>>2]=c;k[a+48>>2]=-1;i[a+52>>0]=0;Ps(f,a+4|0);k[d>>2]=k[f>>2];x=0;ra(23,a|0,d|0);c=x;x=0;if(c&1){f=Wa()|0;Qs(d);xn(a);fb(f|0)}else{Qs(d);r=e;return}}function _l(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+16|0;f=e+4|0;d=e;zn(a);k[a>>2]=42536;k[a+32>>2]=b;Ps(f,a+4|0);k[d>>2]=k[f>>2];x=0;b=Aa(37,d|0,44280)|0;f=x;x=0;if(f&1){f=Wa()|0;Qs(d);xn(a);fb(f|0)}else{Qs(d);k[a+36>>2]=b;k[a+40>>2]=c;f=(Ob[k[(k[b>>2]|0)+28>>2]&127](b)|0)&1;i[a+44>>0]=f;r=e;return}}function $l(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+16|0;f=e+4|0;d=e;On(a);k[a>>2]=42472;k[a+32>>2]=b;k[a+40>>2]=c;k[a+48>>2]=-1;i[a+52>>0]=0;Ps(f,a+4|0);k[d>>2]=k[f>>2];x=0;ra(21,a|0,d|0);c=x;x=0;if(c&1){f=Wa()|0;Qs(d);Mn(a);fb(f|0)}else{Qs(d);r=e;return}}function am(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+16|0;f=e+4|0;d=e;On(a);k[a>>2]=42408;k[a+32>>2]=b;Ps(f,a+4|0);k[d>>2]=k[f>>2];x=0;b=Aa(37,d|0,44288)|0;f=x;x=0;if(f&1){f=Wa()|0;Qs(d);Mn(a);fb(f|0)}else{Qs(d);k[a+36>>2]=b;k[a+40>>2]=c;f=(Ob[k[(k[b>>2]|0)+28>>2]&127](b)|0)&1;i[a+44>>0]=f;r=e;return}}function bm(a){a=a|0;Mn(a);mj(a);return}function cm(a,b){a=a|0;b=b|0;Ob[k[(k[a>>2]|0)+24>>2]&127](a)|0;b=Ss(b,44288)|0;k[a+36>>2]=b;b=(Ob[k[(k[b>>2]|0)+28>>2]&127](b)|0)&1;i[a+44>>0]=b;return}function dm(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j;c=a+36|0;d=a+40|0;e=h+8|0;f=h;b=a+32|0;a:while(1){a=k[c>>2]|0;a=Wb[k[(k[a>>2]|0)+20>>2]&31](a,k[d>>2]|0,h,e,g)|0;l=(k[g>>2]|0)-f|0;if((gl(h,1,l,k[b>>2]|0)|0)!=(l|0)){a=-1;break}switch(a|0){case 1:break;case 2:{a=-1;break a}default:{i=4;break a}}}if((i|0)==4)a=((dl(k[b>>2]|0)|0)!=0)<<31>>31;r=j;return a|0}function em(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a:do if(!(i[a+44>>0]|0))if((c|0)>0){d=b;b=0;while(1){if((Vb[k[(k[a>>2]|0)+52>>2]&63](a,k[d>>2]|0)|0)==-1)break a;b=b+1|0;if((b|0)<(c|0))d=d+4|0;else break}}else b=0;else b=gl(b,4,c,k[a+32>>2]|0)|0;while(0);return b|0}function fm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;s=r;r=r+32|0;o=s+16|0;c=s+8|0;n=s+4|0;m=s;p=(b|0)==-1;a:do if(!p){k[c>>2]=b;if(i[a+44>>0]|0)if((gl(c,4,1,k[a+32>>2]|0)|0)==1){q=11;break}else{c=-1;break}k[n>>2]=o;j=c+4|0;l=a+36|0;e=a+40|0;f=o+8|0;g=o;h=a+32|0;while(1){a=k[l>>2]|0;a=ac[k[(k[a>>2]|0)+12>>2]&15](a,k[e>>2]|0,c,j,m,o,f,n)|0;if((k[m>>2]|0)==(c|0)){c=-1;break a}if((a|0)==3)break;d=(a|0)==1;if(a>>>0>=2){c=-1;break a}a=(k[n>>2]|0)-g|0;if((gl(o,1,a,k[h>>2]|0)|0)!=(a|0)){c=-1;break a}if(d)c=d?k[m>>2]|0:c;else{q=11;break a}}if((gl(c,1,1,k[h>>2]|0)|0)!=1)c=-1;else q=11}else q=11;while(0);if((q|0)==11)c=p?0:b;r=s;return c|0}function gm(a,b){a=a|0;b=b|0;var c=0,d=0;d=Ss(b,44288)|0;c=a+36|0;k[c>>2]=d;d=Ob[k[(k[d>>2]|0)+24>>2]&127](d)|0;b=a+44|0;k[b>>2]=d;c=k[c>>2]|0;c=(Ob[k[(k[c>>2]|0)+28>>2]&127](c)|0)&1;i[a+53>>0]=c;if((k[b>>2]|0)>8)$r(56783);return}function hm(a){a=a|0;Mn(a);mj(a);return}function im(a){a=a|0;return lm(a,0)|0}function jm(a){a=a|0;return lm(a,1)|0}function km(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;j=l+16|0;h=l+8|0;d=l+4|0;e=l;f=a+52|0;c=(i[f>>0]|0)!=0;a:do if((b|0)==-1)if(c)b=-1;else{b=k[a+48>>2]|0;i[f>>0]=(b|0)!=-1&1}else{g=a+48|0;b:do if(c){k[d>>2]=k[g>>2];c=k[a+36>>2]|0;switch(ac[k[(k[c>>2]|0)+12>>2]&15](c,k[a+40>>2]|0,d,d+4|0,e,j,j+8|0,h)|0){case 1:case 2:{b=-1;break a}case 3:{i[j>>0]=k[g>>2];k[h>>2]=j+1;break}default:{}}c=a+32|0;while(1){d=k[h>>2]|0;if(d>>>0<=j>>>0)break b;a=d+-1|0;k[h>>2]=a;if((kl(i[a>>0]|0,k[c>>2]|0)|0)==-1){b=-1;break a}}}while(0);k[g>>2]=b;i[f>>0]=1}while(0);r=l;return b|0}function lm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;q=r;r=r+32|0;p=q+16|0;o=q+8|0;l=q+4|0;m=q;e=a+52|0;a:do if(i[e>>0]|0){d=a+48|0;c=k[d>>2]|0;if(b){k[d>>2]=-1;i[e>>0]=0}}else{c=k[a+44>>2]|0;c=(c|0)>1?c:1;n=a+32|0;if((c|0)>0){e=0;do{d=hl(k[n>>2]|0)|0;if((d|0)==-1){c=-1;break a}i[p+e>>0]=d;e=e+1|0}while((e|0)<(c|0))}b:do if(!(i[a+53>>0]|0)){g=a+40|0;h=a+36|0;j=o+4|0;c:while(1){s=k[g>>2]|0;e=s;d=k[e>>2]|0;e=k[e+4>>2]|0;t=k[h>>2]|0;f=p+c|0;switch(ac[k[(k[t>>2]|0)+16>>2]&15](t,s,p,f,l,o,j,m)|0){case 2:{c=-1;break a}case 3:break c;case 1:break;default:break b}t=k[g>>2]|0;k[t>>2]=d;k[t+4>>2]=e;if((c|0)==8){c=-1;break a}d=hl(k[n>>2]|0)|0;if((d|0)==-1){c=-1;break a}i[f>>0]=d;c=c+1|0}k[o>>2]=i[p>>0]}else k[o>>2]=i[p>>0];while(0);if(b){c=k[o>>2]|0;k[a+48>>2]=c;break}while(1){if((c|0)<=0)break;c=c+-1|0;if((kl(i[p+c>>0]|0,k[n>>2]|0)|0)==-1){c=-1;break a}}c=k[o>>2]|0}while(0);r=q;return c|0}function mm(a){a=a|0;xn(a);mj(a);return}function nm(a,b){a=a|0;b=b|0;Ob[k[(k[a>>2]|0)+24>>2]&127](a)|0;b=Ss(b,44280)|0;k[a+36>>2]=b;b=(Ob[k[(k[b>>2]|0)+28>>2]&127](b)|0)&1;i[a+44>>0]=b;return}function om(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0;j=r;r=r+16|0;h=j+8|0;g=j;c=a+36|0;d=a+40|0;e=h+8|0;f=h;b=a+32|0;a:while(1){a=k[c>>2]|0;a=Wb[k[(k[a>>2]|0)+20>>2]&31](a,k[d>>2]|0,h,e,g)|0;l=(k[g>>2]|0)-f|0;if((gl(h,1,l,k[b>>2]|0)|0)!=(l|0)){a=-1;break}switch(a|0){case 1:break;case 2:{a=-1;break a}default:{i=4;break a}}}if((i|0)==4)a=((dl(k[b>>2]|0)|0)!=0)<<31>>31;r=j;return a|0}function pm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a:do if(!(i[a+44>>0]|0))if((c|0)>0){d=b;b=0;while(1){if((Vb[k[(k[a>>2]|0)+52>>2]&63](a,l[d>>0]|0)|0)==-1)break a;b=b+1|0;if((b|0)<(c|0))d=d+1|0;else break}}else b=0;else b=gl(b,1,c,k[a+32>>2]|0)|0;while(0);return b|0}function qm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;s=r;r=r+32|0;o=s+16|0;c=s+8|0;n=s+4|0;m=s;p=(b|0)==-1;a:do if(!p){i[c>>0]=b;if(i[a+44>>0]|0)if((gl(c,1,1,k[a+32>>2]|0)|0)==1){q=11;break}else{c=-1;break}k[n>>2]=o;l=c+1|0;e=a+36|0;f=a+40|0;g=o+8|0;h=o;j=a+32|0;while(1){a=k[e>>2]|0;a=ac[k[(k[a>>2]|0)+12>>2]&15](a,k[f>>2]|0,c,l,m,o,g,n)|0;if((k[m>>2]|0)==(c|0)){c=-1;break a}if((a|0)==3)break;d=(a|0)==1;if(a>>>0>=2){c=-1;break a}a=(k[n>>2]|0)-h|0;if((gl(o,1,a,k[j>>2]|0)|0)!=(a|0)){c=-1;break a}if(d)c=d?k[m>>2]|0:c;else{q=11;break a}}if((gl(c,1,1,k[j>>2]|0)|0)!=1)c=-1;else q=11}else q=11;while(0);if((q|0)==11)c=p?0:b;r=s;return c|0}function rm(a,b){a=a|0;b=b|0;var c=0,d=0;d=Ss(b,44280)|0;c=a+36|0;k[c>>2]=d;d=Ob[k[(k[d>>2]|0)+24>>2]&127](d)|0;b=a+44|0;k[b>>2]=d;c=k[c>>2]|0;c=(Ob[k[(k[c>>2]|0)+28>>2]&127](c)|0)&1;i[a+53>>0]=c;if((k[b>>2]|0)>8)$r(56783);return}function sm(a){a=a|0;xn(a);mj(a);return}function tm(a){a=a|0;return wm(a,0)|0}function um(a){a=a|0;return wm(a,1)|0}function vm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;j=l+16|0;h=l+4|0;d=l+8|0;e=l;f=a+52|0;c=(i[f>>0]|0)!=0;a:do if((b|0)==-1)if(c)b=-1;else{b=k[a+48>>2]|0;i[f>>0]=(b|0)!=-1&1}else{g=a+48|0;b:do if(c){i[d>>0]=k[g>>2];c=k[a+36>>2]|0;switch(ac[k[(k[c>>2]|0)+12>>2]&15](c,k[a+40>>2]|0,d,d+1|0,e,j,j+8|0,h)|0){case 1:case 2:{b=-1;break a}case 3:{i[j>>0]=k[g>>2];k[h>>2]=j+1;break}default:{}}c=a+32|0;while(1){d=k[h>>2]|0;if(d>>>0<=j>>>0)break b;a=d+-1|0;k[h>>2]=a;if((kl(i[a>>0]|0,k[c>>2]|0)|0)==-1){b=-1;break a}}}while(0);k[g>>2]=b;i[f>>0]=1}while(0);r=l;return b|0}function wm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0;s=r;r=r+32|0;q=s+16|0;p=s+8|0;m=s+4|0;n=s;e=a+52|0;a:do if(i[e>>0]|0){d=a+48|0;c=k[d>>2]|0;if(b){k[d>>2]=-1;i[e>>0]=0}}else{c=k[a+44>>2]|0;c=(c|0)>1?c:1;o=a+32|0;if((c|0)>0){e=0;do{d=hl(k[o>>2]|0)|0;if((d|0)==-1){c=-1;break a}i[q+e>>0]=d;e=e+1|0}while((e|0)<(c|0))}b:do if(!(i[a+53>>0]|0)){g=a+40|0;h=a+36|0;j=p+1|0;c:while(1){t=k[g>>2]|0;e=t;d=k[e>>2]|0;e=k[e+4>>2]|0;u=k[h>>2]|0;f=q+c|0;switch(ac[k[(k[u>>2]|0)+16>>2]&15](u,t,q,f,m,p,j,n)|0){case 2:{c=-1;break a}case 3:break c;case 1:break;default:break b}u=k[g>>2]|0;k[u>>2]=d;k[u+4>>2]=e;if((c|0)==8){c=-1;break a}d=hl(k[o>>2]|0)|0;if((d|0)==-1){c=-1;break a}i[f>>0]=d;c=c+1|0}i[p>>0]=i[q>>0]|0}else i[p>>0]=i[q>>0]|0;while(0);if(b){c=i[p>>0]|0;k[a+48>>2]=c&255}else{while(1){if((c|0)<=0)break;c=c+-1|0;if((kl(l[q+c>>0]|0,k[o>>2]|0)|0)==-1){c=-1;break a}}c=i[p>>0]|0}c=c&255}while(0);r=s;return c|0}function xm(a){a=a|0;return}function ym(a){a=a|0;a=a+4|0;k[a>>2]=(k[a>>2]|0)+1;return}function zm(a){a=a|0;var b=0,c=0;c=a+4|0;b=k[c>>2]|0;k[c>>2]=b+-1;if(!b){Lb[k[(k[a>>2]|0)+8>>2]&255](a);a=1}else a=0;return a|0}function Am(a,b){a=a|0;b=b|0;k[a>>2]=36868;x=0;ra(86,a+4|0,((i[b>>0]&1)==0?b+1|0:k[b+8>>2]|0)|0);a=x;x=0;if(a&1){a=Wa()|0;fb(a|0)}else return}function Bm(a,b){a=a|0;b=b|0;k[a>>2]=36868;x=0;ra(86,a+4|0,b|0);a=x;x=0;if(a&1){a=Wa()|0;fb(a|0)}else return}function Cm(a,b){a=a|0;b=b|0;var c=0,d=0;d=xl(b)|0;c=lj(d+13|0)|0;k[c>>2]=d;k[c+4>>2]=d;k[c+8>>2]=0;c=c+12|0;vw(c|0,b|0,d+1|0)|0;k[a>>2]=c;return}function Dm(a,b,c){a=a|0;b=b|0;c=c|0;k[a>>2]=c;k[a+4>>2]=b;return}function Em(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=r;r=r+16|0;d=e;_b[k[(k[a>>2]|0)+12>>2]&15](d,a,b);if((k[d+4>>2]|0)==(k[c+4>>2]|0))d=(k[d>>2]|0)==(k[c>>2]|0);else d=0;r=e;return d|0}function Fm(a,b,c){a=a|0;b=b|0;c=c|0;return ((k[b>>2]|0)==(c|0)?(k[b+4>>2]|0)==(a|0):0)|0}function Gm(a,b,c){a=a|0;b=b|0;c=c|0;b=nk(c)|0;Qm(a,b,xl(b)|0);return}function Hm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;g=r;r=r+16|0;f=g;d=k[b>>2]|0;do if(d){e=i[c>>0]|0;if(!(e&1))e=(e&255)>>>1;else e=k[c+4>>2]|0;if(e){Zm(c,56990)|0;d=k[b>>2]|0}b=k[b+4>>2]|0;_b[k[(k[b>>2]|0)+24>>2]&15](f,b,d);b=i[f>>0]|0;e=(b&1)==0;x=0;va(30,c|0,(e?f+1|0:k[f+8>>2]|0)|0,(e?(b&255)>>>1:k[f+4>>2]|0)|0)|0;b=x;x=0;if(b&1){g=Wa()|0;Sm(f);fb(g|0)}else{Sm(f);break}}while(0);k[a>>2]=k[c>>2];k[a+4>>2]=k[c+4>>2];k[a+8>>2]=k[c+8>>2];k[c>>2]=0;k[c+4>>2]=0;k[c+8>>2]=0;r=g;return}function Im(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+32|0;d=e+12|0;f=e;Qm(f,c,xl(c)|0);x=0;Fa(10,d|0,b|0,f|0);c=x;x=0;do if(!(c&1)){x=0;ra(87,a|0,d|0);c=x;x=0;if(c&1){e=Wa()|0;Sm(d);d=e;break}else{Sm(d);Sm(f);k[a>>2]=42664;c=k[b+4>>2]|0;f=a+8|0;k[f>>2]=k[b>>2];k[f+4>>2]=c;r=e;return}}else d=Wa()|0;while(0);Sm(f);fb(d|0)}function Jm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=r;r=r+48|0;e=f+24|0;h=f+16|0;g=f;k[h>>2]=b;k[h+4>>2]=c;Pm(g,d);x=0;Fa(10,e|0,h|0,g|0);d=x;x=0;do if(!(d&1)){x=0;ra(87,a|0,e|0);h=x;x=0;if(h&1){h=Wa()|0;Sm(e);e=h;break}else{Sm(e);Sm(g);k[a>>2]=42664;k[a+8>>2]=b;k[a+12>>2]=c;r=f;return}}else e=Wa()|0;while(0);Sm(g);fb(e|0)}function Km(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;e=r;r=r+48|0;d=e+24|0;g=e+16|0;f=e;k[g>>2]=b;k[g+4>>2]=c;Qm(f,58898,0);x=0;Fa(10,d|0,g|0,f|0);g=x;x=0;do if(!(g&1)){x=0;ra(87,a|0,d|0);g=x;x=0;if(g&1){g=Wa()|0;Sm(d);d=g;break}else{Sm(d);Sm(f);k[a>>2]=42664;k[a+8>>2]=b;k[a+12>>2]=c;r=e;return}}else d=Wa()|0;while(0);Sm(f);fb(d|0)}function Lm(a){a=a|0;wj(a);return}function Mm(a){a=a|0;wj(a);mj(a);return}function Nm(a){a=a|0;return}function Om(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;Ab(42676)|0;if((k[a>>2]|0)==1)do Ma(42704,42676)|0;while((k[a>>2]|0)==1);do if(!(k[a>>2]|0)){k[a>>2]=1;x=0;ta(72,42676)|0;d=x;x=0;if((((!(d&1)?(x=0,qa(c|0,b|0),d=x,x=0,!(d&1)):0)?(x=0,ta(73,42676)|0,d=x,x=0,!(d&1)):0)?(k[a>>2]=-1,x=0,ta(72,42676)|0,d=x,x=0,!(d&1)):0)?(x=0,ta(74,42704)|0,d=x,x=0,!(d&1)):0)break;d=Wa(0)|0;cb(d|0)|0;x=0;ta(73,42676)|0;d=x;x=0;if((!(d&1)?(k[a>>2]=0,x=0,ta(72,42676)|0,d=x,x=0,!(d&1)):0)?(x=0,ta(74,42704)|0,d=x,x=0,!(d&1)):0){x=0;Ga(5);x=0}b=Wa()|0;x=0;Ga(3);d=x;x=0;if(d&1){d=Wa(0)|0;oc(d)}else fb(b|0)}else lb(42676)|0;while(0);return}function Pm(a,b){a=a|0;b=b|0;if(!(i[b>>0]&1)){k[a>>2]=k[b>>2];k[a+4>>2]=k[b+4>>2];k[a+8>>2]=k[b+8>>2]}else Qm(a,k[b+8>>2]|0,k[b+4>>2]|0);return}function Qm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if(c>>>0>4294967279)ij(a);if(c>>>0<11){i[a>>0]=c<<1;a=a+1|0}else{e=c+16&-16;d=lj(e)|0;k[a+8>>2]=d;k[a>>2]=e|1;k[a+4>>2]=c;a=d}vw(a|0,b|0,c|0)|0;i[a+c>>0]=0;return}function Rm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if(b>>>0>4294967279)ij(a);if(b>>>0<11){i[a>>0]=b<<1;a=a+1|0}else{e=b+16&-16;d=lj(e)|0;k[a+8>>2]=d;k[a>>2]=e|1;k[a+4>>2]=b;a=d}sw(a|0,c|0,b|0)|0;i[a+b>>0]=0;return}function Sm(a){a=a|0;if(i[a>>0]&1)mj(k[a+8>>2]|0);return}function Tm(a,b){a=a|0;b=b|0;var c=0,d=0;if((a|0)!=(b|0)){c=i[b>>0]|0;d=(c&1)==0;Vm(a,d?b+1|0:k[b+8>>2]|0,d?(c&255)>>>1:k[b+4>>2]|0)|0}return a|0}function Um(a,b){a=a|0;b=b|0;return Vm(a,b,xl(b)|0)|0}function Vm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=i[a>>0]|0;if(!(d&1))f=10;else{d=k[a>>2]|0;f=(d&-2)+-1|0;d=d&255}e=(d&1)==0;do if(f>>>0>=c>>>0){if(e)d=a+1|0;else d=k[a+8>>2]|0;xw(d|0,b|0,c|0)|0;i[d+c>>0]=0;if(!(i[a>>0]&1)){i[a>>0]=c<<1;break}else{k[a+4>>2]=c;break}}else{if(e)d=(d&255)>>>1;else d=k[a+4>>2]|0;an(a,f,c-f|0,d,0,d,c,b)}while(0);return a|0}function Wm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=i[a>>0]|0;e=(d&1)==0;if(e)d=(d&255)>>>1;else d=k[a+4>>2]|0;do if(d>>>0>=b>>>0)if(e){i[a+1+b>>0]=0;i[a>>0]=b<<1;break}else{i[(k[a+8>>2]|0)+b>>0]=0;k[a+4>>2]=b;break}else Xm(a,b-d|0,c)|0;while(0);return}function Xm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;if(b){d=i[a>>0]|0;if(!(d&1))e=10;else{d=k[a>>2]|0;e=(d&-2)+-1|0;d=d&255}if(!(d&1))f=(d&255)>>>1;else f=k[a+4>>2]|0;if((e-f|0)>>>0>>0){bn(a,e,b-e+f|0,f,f,0,0);d=i[a>>0]|0}if(!(d&1))e=a+1|0;else e=k[a+8>>2]|0;sw(e+f|0,c|0,b|0)|0;d=f+b|0;if(!(i[a>>0]&1))i[a>>0]=d<<1;else k[a+4>>2]=d;i[e+d>>0]=0}return a|0}function Ym(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;if(b>>>0>4294967279)ij(a);c=i[a>>0]|0;if(!(c&1))d=10;else{c=k[a>>2]|0;d=(c&-2)+-1|0;c=c&255}if(!(c&1))h=(c&255)>>>1;else h=k[a+4>>2]|0;b=h>>>0>b>>>0?h:b;if(b>>>0<11)g=10;else g=(b+16&-16)+-1|0;a:do if((g|0)!=(d|0)){do if((g|0)!=10){b=g+1|0;if(g>>>0<=d>>>0){x=0;b=ta(67,b|0)|0;f=x;x=0;if(f&1){a=Wa(0)|0;cb(a|0)|0;eb();break a}}else b=lj(b)|0;if(!(c&1)){d=1;e=a+1|0;f=0;break}else{d=1;e=k[a+8>>2]|0;f=1;break}}else{b=a+1|0;d=0;e=k[a+8>>2]|0;f=1}while(0);if(!(c&1))c=(c&255)>>>1;else c=k[a+4>>2]|0;vw(b|0,e|0,c+1|0)|0;if(f)mj(e);if(d){k[a>>2]=g+1|1;k[a+4>>2]=h;k[a+8>>2]=b;break}else{i[a>>0]=h<<1;break}}while(0);return}function Zm(a,b){a=a|0;b=b|0;return $m(a,b,xl(b)|0)|0}function _m(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=i[a>>0]|0;d=(c&1)!=0;if(d){e=(k[a>>2]&-2)+-1|0;f=k[a+4>>2]|0}else{e=10;f=(c&255)>>>1}if((f|0)==(e|0)){bn(a,e,1,e,e,0,0);if(!(i[a>>0]&1))e=7;else e=8}else if(d)e=8;else e=7;if((e|0)==7){i[a>>0]=(f<<1)+2;c=a+1|0;d=f+1|0}else if((e|0)==8){c=k[a+8>>2]|0;d=f+1|0;k[a+4>>2]=d}i[c+f>>0]=b;i[c+d>>0]=0;return}function $m(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=i[a>>0]|0;if(!(d&1))e=10;else{d=k[a>>2]|0;e=(d&-2)+-1|0;d=d&255}if(!(d&1))f=(d&255)>>>1;else f=k[a+4>>2]|0;if((e-f|0)>>>0>=c>>>0){if(c){if(!(d&1))e=a+1|0;else e=k[a+8>>2]|0;vw(e+f|0,b|0,c|0)|0;d=f+c|0;if(!(i[a>>0]&1))i[a>>0]=d<<1;else k[a+4>>2]=d;i[e+d>>0]=0}}else an(a,e,c-e+f|0,f,f,0,c,b);return a|0}function an(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0;if((-18-b|0)>>>0>>0)ij(a);if(!(i[a>>0]&1))m=a+1|0;else m=k[a+8>>2]|0;if(b>>>0<2147483623){j=c+b|0;l=b<<1;j=j>>>0>>0?l:j;j=j>>>0<11?11:j+16&-16}else j=-17;l=lj(j)|0;if(e)vw(l|0,m|0,e|0)|0;if(g)vw(l+e|0,h|0,g|0)|0;c=d-f|0;if((c|0)!=(e|0))vw(l+(g+e)|0,m+(f+e)|0,c-e|0)|0;if((b|0)!=10)mj(m);k[a+8>>2]=l;k[a>>2]=j|1;b=c+g|0;k[a+4>>2]=b;i[l+b>>0]=0;return}function bn(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0;if((-17-b|0)>>>0>>0)ij(a);if(!(i[a>>0]&1))l=a+1|0;else l=k[a+8>>2]|0;if(b>>>0<2147483623){h=c+b|0;j=b<<1;h=h>>>0>>0?j:h;h=h>>>0<11?11:h+16&-16}else h=-17;j=lj(h)|0;if(e)vw(j|0,l|0,e|0)|0;c=d-f|0;if((c|0)!=(e|0))vw(j+(g+e)|0,l+(f+e)|0,c-e|0)|0;if((b|0)!=10)mj(l);k[a+8>>2]=j;k[a>>2]=h|1;return}function cn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if(c>>>0>1073741807)ij(a);if(c>>>0<2){i[a>>0]=c<<1;a=a+4|0}else{e=c+4&-4;d=lj(e<<2)|0;k[a+8>>2]=d;k[a>>2]=e|1;k[a+4>>2]=c;a=d}Al(a,b,c)|0;k[a+(c<<2)>>2]=0;return}function dn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if(b>>>0>1073741807)ij(a);if(b>>>0<2){i[a>>0]=b<<1;a=a+4|0}else{e=b+4&-4;d=lj(e<<2)|0;k[a+8>>2]=d;k[a>>2]=e|1;k[a+4>>2]=b;a=d}Cl(a,c,b)|0;k[a+(b<<2)>>2]=0;return}function en(a){a=a|0;if(i[a>>0]&1)mj(k[a+8>>2]|0);return}function fn(a,b){a=a|0;b=b|0;return gn(a,b,zl(b)|0)|0}function gn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=i[a>>0]|0;if(!(d&1))f=1;else{d=k[a>>2]|0;f=(d&-2)+-1|0;d=d&255}e=(d&1)==0;do if(f>>>0>=c>>>0){if(e)d=a+4|0;else d=k[a+8>>2]|0;Bl(d,b,c)|0;k[d+(c<<2)>>2]=0;if(!(i[a>>0]&1)){i[a>>0]=c<<1;break}else{k[a+4>>2]=c;break}}else{if(e)d=(d&255)>>>1;else d=k[a+4>>2]|0;kn(a,f,c-f|0,d,0,d,c,b)}while(0);return a|0}function hn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;if(b>>>0>1073741807)ij(a);c=i[a>>0]|0;if(!(c&1))d=1;else{c=k[a>>2]|0;d=(c&-2)+-1|0;c=c&255}if(!(c&1))h=(c&255)>>>1;else h=k[a+4>>2]|0;b=h>>>0>b>>>0?h:b;if(b>>>0<2)g=1;else g=(b+4&-4)+-1|0;a:do if((g|0)!=(d|0)){do if((g|0)!=1){b=(g<<2)+4|0;if(g>>>0<=d>>>0){x=0;b=ta(67,b|0)|0;f=x;x=0;if(f&1){a=Wa(0)|0;cb(a|0)|0;eb();break a}}else b=lj(b)|0;if(!(c&1)){d=1;e=a+4|0;f=0;break}else{d=1;e=k[a+8>>2]|0;f=1;break}}else{b=a+4|0;d=0;e=k[a+8>>2]|0;f=1}while(0);if(!(c&1))c=(c&255)>>>1;else c=k[a+4>>2]|0;Al(b,e,c+1|0)|0;if(f)mj(e);if(d){k[a>>2]=g+1|1;k[a+4>>2]=h;k[a+8>>2]=b;break}else{i[a>>0]=h<<1;break}}while(0);return}function jn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=i[a>>0]|0;d=(c&1)!=0;if(d){e=(k[a>>2]&-2)+-1|0;f=k[a+4>>2]|0}else{e=1;f=(c&255)>>>1}if((f|0)==(e|0)){ln(a,e,1,e,e,0,0);if(!(i[a>>0]&1))e=7;else e=8}else if(d)e=8;else e=7;if((e|0)==7){i[a>>0]=(f<<1)+2;c=a+4|0;d=f+1|0}else if((e|0)==8){c=k[a+8>>2]|0;d=f+1|0;k[a+4>>2]=d}k[c+(f<<2)>>2]=b;k[c+(d<<2)>>2]=0;return}function kn(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0;if((1073741806-b|0)>>>0>>0)ij(a);if(!(i[a>>0]&1))m=a+4|0;else m=k[a+8>>2]|0;if(b>>>0<536870887){j=c+b|0;l=b<<1;j=j>>>0>>0?l:j;j=j>>>0<2?2:j+4&-4}else j=1073741807;l=lj(j<<2)|0;if(e)Al(l,m,e)|0;if(g)Al(l+(e<<2)|0,h,g)|0;c=d-f|0;if((c|0)!=(e|0))Al(l+(g+e<<2)|0,m+(f+e<<2)|0,c-e|0)|0;if((b|0)!=1)mj(m);k[a+8>>2]=l;k[a>>2]=j|1;b=c+g|0;k[a+4>>2]=b;k[l+(b<<2)>>2]=0;return}function ln(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0;if((1073741807-b|0)>>>0>>0)ij(a);if(!(i[a>>0]&1))l=a+4|0;else l=k[a+8>>2]|0;if(b>>>0<536870887){h=c+b|0;j=b<<1;h=h>>>0>>0?j:h;h=h>>>0<2?2:h+4&-4}else h=1073741807;j=lj(h<<2)|0;if(e)Al(j,l,e)|0;c=d-f|0;if((c|0)!=(e|0))Al(j+(g+e<<2)|0,l+(f+e<<2)|0,c-e|0)|0;if((b|0)!=1)mj(l);k[a+8>>2]=j;k[a>>2]=h|1;return}function mn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;e=b;d=c-e|0;if(d>>>0>4294967279)ij(a);if(d>>>0<11){i[a>>0]=d<<1;f=a+1|0}else{g=d+16&-16;f=lj(g)|0;k[a+8>>2]=f;k[a>>2]=g|1;k[a+4>>2]=d}a=c-e|0;if((b|0)!=(c|0)){d=f;while(1){i[d>>0]=i[b>>0]|0;b=b+1|0;if((b|0)==(c|0))break;else d=d+1|0}}i[f+a>>0]=0;return}function nn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=b;d=c-f|0;e=d>>2;if(e>>>0>1073741807)ij(a);if(e>>>0<2){i[a>>0]=d>>>1;a=a+4|0}else{g=e+4&-4;d=lj(g<<2)|0;k[a+8>>2]=d;k[a>>2]=g|1;k[a+4>>2]=e;a=d}e=(c-f|0)>>>2;if((b|0)!=(c|0)){d=a;while(1){k[d>>2]=k[b>>2];b=b+4|0;if((b|0)==(c|0))break;else d=d+4|0}}k[a+(e<<2)>>2]=0;return}function on(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=r;r=r+16|0;d=c;e=(k[a+24>>2]|0)==0;k[a+16>>2]=e&1|b;if(!((e&1|b)&k[a+20>>2])){r=c;return}b=Va(16)|0;Co()|0;k[d>>2]=1;k[d+4>>2]=43112;x=0;Fa(11,b|0,57437,d|0);e=x;x=0;if(e&1){e=Wa()|0;Ua(b|0);fb(e|0)}else ub(b|0,864,112)}function pn(a){a=a|0;var b=0;k[a>>2]=43068;x=0;ra(88,a|0,0);b=x;x=0;if(b&1){b=Wa(0)|0;oc(b)}else{Qs(a+28|0);Ql(k[a+32>>2]|0);Ql(k[a+36>>2]|0);Ql(k[a+48>>2]|0);Ql(k[a+60>>2]|0);return}}function qn(a){a=a|0;pn(a);return}function rn(a){a=a|0;pn(a);mj(a);return}function sn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=k[a+40>>2]|0;d=a+32|0;e=a+36|0;if(c)do{c=c+-1|0;_b[k[(k[d>>2]|0)+(c<<2)>>2]&15](b,a,k[(k[e>>2]|0)+(c<<2)>>2]|0)}while((c|0)!=0);return}function tn(a){a=a|0;var b=0,c=0;c=r;r=r+16|0;b=c;Ps(b,a+28|0);r=c;return k[b>>2]|0}function un(a,b){a=a|0;b=b|0;var c=0;k[a+24>>2]=b;k[a+16>>2]=(b|0)==0&1;k[a+20>>2]=0;k[a+4>>2]=4098;k[a+12>>2]=0;k[a+8>>2]=6;c=a+28|0;b=a+32|0;a=b+40|0;do{k[b>>2]=0;b=b+4|0}while((b|0)<(a|0));Os(c);return}function vn(a){a=a|0;pn(a);return}function wn(a){a=a|0;pn(a);mj(a);return}function xn(a){a=a|0;k[a>>2]=42760;Qs(a+4|0);return}function yn(a){a=a|0;k[a>>2]=42760;Qs(a+4|0);mj(a);return}function zn(a){a=a|0;k[a>>2]=42760;Os(a+4|0);a=a+8|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[a+20>>2]=0;return}function An(a,b){a=a|0;b=b|0;return}function Bn(a,b,c){a=a|0;b=b|0;c=c|0;return a|0}function Cn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}function Dn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}function En(a){a=a|0;return 0}function Fn(a){a=a|0;return 0}function Gn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=a+12|0;g=a+16|0;a:do if((c|0)>0){e=b;b=0;while(1){d=k[f>>2]|0;if(d>>>0<(k[g>>2]|0)>>>0){k[f>>2]=d+1;d=i[d>>0]|0}else{d=Ob[k[(k[a>>2]|0)+40>>2]&127](a)|0;if((d|0)==-1)break a;d=d&255}i[e>>0]=d;b=b+1|0;if((b|0)<(c|0))e=e+1|0;else break}}else b=0;while(0);return b|0}function Hn(a){a=a|0;return -1}function In(a){a=a|0;var b=0;if((Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1)a=-1;else{b=a+12|0;a=k[b>>2]|0;k[b>>2]=a+1;a=l[a>>0]|0}return a|0}function Jn(a,b){a=a|0;b=b|0;return -1}function Kn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;f=a+24|0;g=a+28|0;a:do if((c|0)>0){e=b;b=0;while(1){d=k[f>>2]|0;if(d>>>0>=(k[g>>2]|0)>>>0){if((Vb[k[(k[a>>2]|0)+52>>2]&63](a,l[e>>0]|0)|0)==-1)break a}else{h=i[e>>0]|0;k[f>>2]=d+1;i[d>>0]=h}b=b+1|0;if((b|0)<(c|0))e=e+1|0;else break}}else b=0;while(0);return b|0}function Ln(a,b){a=a|0;b=b|0;return -1}function Mn(a){a=a|0;k[a>>2]=42824;Qs(a+4|0);return}function Nn(a){a=a|0;k[a>>2]=42824;Qs(a+4|0);mj(a);return}function On(a){a=a|0;k[a>>2]=42824;Os(a+4|0);a=a+8|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[a+20>>2]=0;return}function Pn(a,b){a=a|0;b=b|0;return}function Qn(a,b,c){a=a|0;b=b|0;c=c|0;return a|0}function Rn(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}function Sn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=a;k[b>>2]=0;k[b+4>>2]=0;b=a+8|0;k[b>>2]=-1;k[b+4>>2]=-1;return}function Tn(a){a=a|0;return 0}function Un(a){a=a|0;return 0}function Vn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=a+12|0;g=a+16|0;a:do if((c|0)>0){e=b;b=0;while(1){d=k[f>>2]|0;if(d>>>0>=(k[g>>2]|0)>>>0){d=Ob[k[(k[a>>2]|0)+40>>2]&127](a)|0;if((d|0)==-1)break a}else{k[f>>2]=d+4;d=k[d>>2]|0}k[e>>2]=d;b=b+1|0;if((b|0)<(c|0))e=e+4|0;else break}}else b=0;while(0);return b|0}function Wn(a){a=a|0;return -1}function Xn(a){a=a|0;var b=0;if((Ob[k[(k[a>>2]|0)+36>>2]&127](a)|0)==-1)a=-1;else{b=a+12|0;a=k[b>>2]|0;k[b>>2]=a+4;a=k[a>>2]|0}return a|0}function Yn(a,b){a=a|0;b=b|0;return -1}function Zn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;f=a+24|0;g=a+28|0;a:do if((c|0)>0){e=b;b=0;while(1){d=k[f>>2]|0;if(d>>>0>=(k[g>>2]|0)>>>0){if((Vb[k[(k[a>>2]|0)+52>>2]&63](a,k[e>>2]|0)|0)==-1)break a}else{h=k[e>>2]|0;k[f>>2]=d+4;k[d>>2]=h}b=b+1|0;if((b|0)<(c|0))e=e+4|0;else break}}else b=0;while(0);return b|0}function _n(a,b){a=a|0;b=b|0;return -1}function $n(a){a=a|0;pn(a+8|0);return}function ao(a){a=a|0;pn(a+((k[(k[a>>2]|0)+-12>>2]|0)+8)|0);return}function bo(a){a=a|0;pn(a+8|0);mj(a);return}function co(a){a=a|0;bo(a+(k[(k[a>>2]|0)+-12>>2]|0)|0);return}function eo(a){a=a|0;var b=0,c=0,d=0,e=0;d=r;r=r+16|0;c=d;a:do if(k[a+((k[(k[a>>2]|0)+-12>>2]|0)+24)>>2]|0){x=0;ra(65,c|0,a|0);b=x;x=0;b:do if(b&1)b=Wa(0)|0;else{do if(i[c>>0]|0){b=k[a+((k[(k[a>>2]|0)+-12>>2]|0)+24)>>2]|0;x=0;b=ta(k[(k[b>>2]|0)+24>>2]|0,b|0)|0;e=x;x=0;if(!(e&1)){if((b|0)!=-1)break;e=k[(k[a>>2]|0)+-12>>2]|0;x=0;ra(66,a+e|0,k[a+(e+16)>>2]|1|0);e=x;x=0;if(!(e&1))break}b=Wa(0)|0;ro(c);break b}while(0);ro(c);break a}while(0);cb(b|0)|0;x=0;qa(181,a+(k[(k[a>>2]|0)+-12>>2]|0)|0);e=x;x=0;if(!(e&1)){eb();break}b=Wa()|0;x=0;Ga(3);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else fb(b|0)}while(0);r=d;return a|0}function fo(a){a=a|0;var b=0;b=a+16|0;k[b>>2]=k[b>>2]|1;if(!(k[a+20>>2]&1))return;else vb()}function go(a){a=a|0;pn(a+8|0);return}function ho(a){a=a|0;pn(a+((k[(k[a>>2]|0)+-12>>2]|0)+8)|0);return}function io(a){a=a|0;pn(a+8|0);mj(a);return}function jo(a){a=a|0;io(a+(k[(k[a>>2]|0)+-12>>2]|0)|0);return}function ko(a){a=a|0;var b=0,c=0,d=0,e=0;d=r;r=r+16|0;c=d;a:do if(k[a+((k[(k[a>>2]|0)+-12>>2]|0)+24)>>2]|0){x=0;ra(89,c|0,a|0);b=x;x=0;b:do if(b&1)b=Wa(0)|0;else{do if(i[c>>0]|0){b=k[a+((k[(k[a>>2]|0)+-12>>2]|0)+24)>>2]|0;x=0;b=ta(k[(k[b>>2]|0)+24>>2]|0,b|0)|0;e=x;x=0;if(!(e&1)){if((b|0)!=-1)break;e=k[(k[a>>2]|0)+-12>>2]|0;x=0;ra(66,a+e|0,k[a+(e+16)>>2]|1|0);e=x;x=0;if(!(e&1))break}b=Wa(0)|0;zo(c);break b}while(0);zo(c);break a}while(0);cb(b|0)|0;x=0;qa(181,a+(k[(k[a>>2]|0)+-12>>2]|0)|0);e=x;x=0;if(!(e&1)){eb();break}b=Wa()|0;x=0;Ga(3);e=x;x=0;if(e&1){e=Wa(0)|0;oc(e)}else fb(b|0)}while(0);r=d;return a|0}function lo(a,b){a=a|0;b=b|0;return}function mo(a){a=a|0;pn(a+4|0);return}function no(a){a=a|0;pn(a+((k[(k[a>>2]|0)+-12>>2]|0)+4)|0);return}function oo(a){a=a|0;pn(a+4|0);mj(a);return}function po(a){a=a|0;oo(a+(k[(k[a>>2]|0)+-12>>2]|0)|0);return}function qo(a,b){a=a|0;b=b|0;var c=0;i[a>>0]=0;k[a+4>>2]=b;c=k[(k[b>>2]|0)+-12>>2]|0;if(!(k[b+(c+16)>>2]|0)){c=k[b+(c+72)>>2]|0;if(c)eo(c)|0;i[a>>0]=1}return}function ro(a){a=a|0;var b=0,c=0;a=a+4|0;c=k[a>>2]|0;b=k[(k[c>>2]|0)+-12>>2]|0;do if((((k[c+(b+24)>>2]|0)!=0?(k[c+(b+16)>>2]|0)==0:0)?(k[c+(b+4)>>2]&8192|0)!=0:0)?!(gb()|0):0){b=k[a>>2]|0;b=k[b+((k[(k[b>>2]|0)+-12>>2]|0)+24)>>2]|0;x=0;b=ta(k[(k[b>>2]|0)+24>>2]|0,b|0)|0;c=x;x=0;if(!(c&1)){if((b|0)!=-1)break;b=k[a>>2]|0;c=k[(k[b>>2]|0)+-12>>2]|0;x=0;ra(66,b+c|0,k[b+(c+16)>>2]|1|0);c=x;x=0;if(!(c&1))break}c=Wa(0)|0;cb(c|0)|0;x=0;Ga(3);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)}}while(0);return}function so(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;o=r;r=r+32|0;h=o+20|0;j=o+16|0;m=o+8|0;c=o;x=0;ra(65,m|0,a|0);l=x;x=0;a:do if(l&1){c=Wa(0)|0;d=a;e=a;n=19}else{do if(i[m>>0]|0){l=tn(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=l;x=0;l=Aa(37,c|0,43392)|0;g=x;x=0;if(g&1){n=Wa(0)|0;Qs(c);c=n}else{Qs(c);e=k[(k[a>>2]|0)+-12>>2]|0;g=k[a+(e+24)>>2]|0;d=a+e|0;e=a+(e+76)|0;c=k[e>>2]|0;do if((c|0)==-1){c=tn(d)|0;k[h>>2]=c;x=0;c=Aa(37,h|0,44220)|0;p=x;x=0;if(!(p&1)?(x=0,f=Aa(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0,p=x,x=0,!(p&1)):0){Qs(h);c=f<<24>>24;k[e>>2]=c;n=10;break}c=Wa(0)|0;Qs(h)}else n=10;while(0);if((n|0)==10){p=k[(k[l>>2]|0)+16>>2]|0;k[j>>2]=g;x=0;k[h>>2]=k[j>>2];c=Ba(p|0,l|0,h|0,d|0,c&255|0,b|0)|0;p=x;x=0;if(!(p&1)){if(c)break;p=k[(k[a>>2]|0)+-12>>2]|0;x=0;ra(66,a+p|0,k[a+(p+16)>>2]|5|0);p=x;x=0;if(!(p&1))break}c=Wa(0)|0}}ro(m);d=a;e=a;n=19;break a}while(0);ro(m)}while(0);do if((n|0)==19){cb(c|0)|0;x=0;qa(181,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);p=x;x=0;if(!(p&1)){eb();break}c=Wa()|0;x=0;Ga(3);p=x;x=0;if(p&1){p=Wa(0)|0;oc(p)}else fb(c|0)}while(0);r=o;return a|0}function to(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;o=r;r=r+32|0;h=o+20|0;j=o+16|0;m=o+8|0;c=o;x=0;ra(65,m|0,a|0);l=x;x=0;a:do if(l&1){c=Wa(0)|0;d=a;e=a;n=19}else{do if(i[m>>0]|0){l=tn(a+(k[(k[a>>2]|0)+-12>>2]|0)|0)|0;k[c>>2]=l;x=0;l=Aa(37,c|0,43392)|0;g=x;x=0;if(g&1){n=Wa(0)|0;Qs(c);c=n}else{Qs(c);e=k[(k[a>>2]|0)+-12>>2]|0;g=k[a+(e+24)>>2]|0;d=a+e|0;e=a+(e+76)|0;c=k[e>>2]|0;do if((c|0)==-1){c=tn(d)|0;k[h>>2]=c;x=0;c=Aa(37,h|0,44220)|0;p=x;x=0;if(!(p&1)?(x=0,f=Aa(k[(k[c>>2]|0)+28>>2]|0,c|0,32)|0,p=x,x=0,!(p&1)):0){Qs(h);c=f<<24>>24;k[e>>2]=c;n=10;break}c=Wa(0)|0;Qs(h)}else n=10;while(0);if((n|0)==10){p=k[(k[l>>2]|0)+24>>2]|0;k[j>>2]=g;x=0;k[h>>2]=k[j>>2];c=Ba(p|0,l|0,h|0,d|0,c&255|0,b|0)|0;p=x;x=0;if(!(p&1)){if(c)break;p=k[(k[a>>2]|0)+-12>>2]|0;x=0;ra(66,a+p|0,k[a+(p+16)>>2]|5|0);p=x;x=0;if(!(p&1))break}c=Wa(0)|0}}ro(m);d=a;e=a;n=19;break a}while(0);ro(m)}while(0);do if((n|0)==19){cb(c|0)|0;x=0;qa(181,d+(k[(k[e>>2]|0)+-12>>2]|0)|0);p=x;x=0;if(!(p&1)){eb();break}c=Wa()|0;x=0;Ga(3);p=x;x=0;if(p&1){p=Wa(0)|0;oc(p)}else fb(c|0)}while(0);r=o;return a|0}function uo(a){a=a|0;pn(a+4|0);return}function vo(a){a=a|0;pn(a+((k[(k[a>>2]|0)+-12>>2]|0)+4)|0);return}function wo(a){a=a|0;pn(a+4|0);mj(a);return}function xo(a){a=a|0;wo(a+(k[(k[a>>2]|0)+-12>>2]|0)|0);return}function yo(a,b){a=a|0;b=b|0;var c=0;i[a>>0]=0;k[a+4>>2]=b;c=k[(k[b>>2]|0)+-12>>2]|0;if(!(k[b+(c+16)>>2]|0)){c=k[b+(c+72)>>2]|0;if(c)ko(c)|0;i[a>>0]=1}return}function zo(a){a=a|0;var b=0,c=0;a=a+4|0;c=k[a>>2]|0;b=k[(k[c>>2]|0)+-12>>2]|0;do if((((k[c+(b+24)>>2]|0)!=0?(k[c+(b+16)>>2]|0)==0:0)?(k[c+(b+4)>>2]&8192|0)!=0:0)?!(gb()|0):0){b=k[a>>2]|0;b=k[b+((k[(k[b>>2]|0)+-12>>2]|0)+24)>>2]|0;x=0;b=ta(k[(k[b>>2]|0)+24>>2]|0,b|0)|0;c=x;x=0;if(!(c&1)){if((b|0)!=-1)break;b=k[a>>2]|0;c=k[(k[b>>2]|0)+-12>>2]|0;x=0;ra(66,b+c|0,k[b+(c+16)>>2]|1|0);c=x;x=0;if(!(c&1))break}c=Wa(0)|0;cb(c|0)|0;x=0;Ga(3);c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)}}while(0);return}function Ao(a){a=a|0;return 57453}function Bo(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)!=1&(c|0)<257)Gm(a,b,c);else Qm(a,57462,35);return}function Co(){if((i[1048]|0)==0?(Qa(1048)|0)!=0:0){k[10778]=43084;tb(72,43112,w|0)|0;Ya(1048)}return 43112}function Do(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;d=r;r=r+16|0;e=d+8|0;f=d;h=c;g=k[h+4>>2]|0;c=f;k[c>>2]=k[h>>2];k[c+4>>2]=g;k[e>>2]=k[f>>2];k[e+4>>2]=k[f+4>>2];Im(a,e,b);k[a>>2]=43048;r=d;return}function Eo(a){a=a|0;Lm(a);return}function Fo(a){a=a|0;Lm(a);mj(a);return}function Go(a){a=a|0;pn(a);mj(a);return}function Ho(a){a=a|0;mj(a);return}function Io(a){a=a|0;return}function Jo(a){a=a|0;return}function Ko(a){a=a|0;mj(a);return}function Lo(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;a:do if((d|0)==(e|0))g=6;else while(1){if((b|0)==(c|0)){b=-1;break a}a=i[b>>0]|0;f=i[d>>0]|0;if(a<<24>>24>24){b=-1;break a}if(f<<24>>24>24){b=1;break a}b=b+1|0;d=d+1|0;if((d|0)==(e|0)){g=6;break}}while(0);if((g|0)==6)b=(b|0)!=(c|0)&1;return b|0}function Mo(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;mn(a,c,d);return}function No(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if((b|0)==(c|0))a=0;else{a=0;do{a=(i[b>>0]|0)+(a<<4)|0;d=a&-268435456;a=(d>>>24|d)^a;b=b+1|0}while((b|0)!=(c|0))}return a|0}function Oo(a){a=a|0;return}function Po(a){a=a|0;mj(a);return}function Qo(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;a:do if((d|0)==(e|0))g=6;else while(1){if((b|0)==(c|0)){b=-1;break a}a=k[b>>2]|0;f=k[d>>2]|0;if((a|0)<(f|0)){b=-1;break a}if((f|0)<(a|0)){b=1;break a}b=b+4|0;d=d+4|0;if((d|0)==(e|0)){g=6;break}}while(0);if((g|0)==6)b=(b|0)!=(c|0)&1;return b|0}function Ro(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;nn(a,c,d);return}function So(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if((b|0)==(c|0))a=0;else{a=0;do{a=(k[b>>2]|0)+(a<<4)|0;d=a&-268435456;a=(d>>>24|d)^a;b=b+4|0}while((b|0)!=(c|0))}return a|0}function To(a){a=a|0;return}function Uo(a){a=a|0;mj(a);return}function Vo(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;q=r;r=r+64|0;o=q+56|0;g=q+52|0;m=q+48|0;h=q+44|0;j=q+40|0;l=q+36|0;n=q+32|0;s=q+8|0;p=q;a:do if(!(k[d+4>>2]&1)){k[m>>2]=-1;s=k[(k[a>>2]|0)+16>>2]|0;k[h>>2]=k[b>>2];k[j>>2]=k[c>>2];k[g>>2]=k[h>>2];k[o>>2]=k[j>>2];g=Nb[s&63](a,g,o,d,e,m)|0;k[b>>2]=g;switch(k[m>>2]|0){case 0:{i[f>>0]=0;break a}case 1:{i[f>>0]=1;break a}default:{i[f>>0]=1;k[e>>2]=4;break a}}}else{g=tn(d)|0;k[l>>2]=g;x=0;a=Aa(37,l|0,44220)|0;m=x;x=0;do if(!(m&1)){zm(g)|0;g=tn(d)|0;k[n>>2]=g;x=0;j=Aa(37,n|0,44360)|0;n=x;x=0;if(n&1){s=Wa()|0;zm(g)|0;g=s;break}zm(g)|0;x=0;ra(k[(k[j>>2]|0)+24>>2]|0,s|0,j|0);n=x;x=0;if(!(n&1)){h=s+12|0;x=0;ra(k[(k[j>>2]|0)+28>>2]|0,h|0,j|0);n=x;x=0;if(!(n&1)){k[p>>2]=k[c>>2];x=0;k[o>>2]=k[p>>2];g=na(7,b|0,o|0,s|0,s+24|0,a|0,e|0,1)|0;e=x;x=0;if(e&1){g=Wa()|0;Sm(s+12|0);Sm(s);break}else{i[f>>0]=(g|0)==(s|0)&1;g=k[b>>2]|0;Sm(s+12|0);Sm(s);break a}}}else h=s;g=Wa()|0;j=M;if((s|0)!=(h|0))do{h=h+-12|0;Sm(h)}while((h|0)!=(s|0))}else{s=Wa()|0;zm(g)|0;g=s}while(0);fb(g|0)}while(0);r=q;return g|0}function Wo(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Iu(a,i,h,d,e,f)|0;r=g;return a|0}function Xo(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Ju(a,i,h,d,e,f)|0;r=g;return a|0}function Yo(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Ku(a,i,h,d,e,f)|0;r=g;return a|0}function Zo(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Lu(a,i,h,d,e,f)|0;r=g;return a|0}function _o(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Mu(a,i,h,d,e,f)|0;r=g;return a|0}function $o(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Nu(a,i,h,d,e,f)|0;r=g;return a|0}function ap(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Ou(a,i,h,d,e,f)|0;r=g;return a|0}function bp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Pu(a,i,h,d,e,f)|0;r=g;return a|0}function cp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Qu(a,i,h,d,e,f)|0;r=g;return a|0}function dp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;C=r;r=r+240|0;w=C;q=C+208|0;E=C+32|0;a=C+28|0;D=C+16|0;v=C+12|0;t=C+48|0;u=C+8|0;s=C+4|0;k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;x=0;d=ta(68,d|0)|0;p=x;x=0;do if(p&1)a=Wa()|0;else{k[a>>2]=d;x=0;a=Aa(37,a|0,44220)|0;p=x;x=0;if(!(p&1)?(x=0,Ea(k[(k[a>>2]|0)+32>>2]|0,a|0,57498,57524,q|0)|0,p=x,x=0,!(p&1)):0){zm(d)|0;k[D>>2]=0;k[D+4>>2]=0;k[D+8>>2]=0;if(!(i[D>>0]&1))a=10;else a=(k[D>>2]&-2)+-1|0;x=0;Fa(8,D|0,a|0,0);p=x;x=0;a:do if(!(p&1)){o=D+8|0;p=D+1|0;d=(i[D>>0]&1)==0?p:k[o>>2]|0;k[v>>2]=d;k[u>>2]=t;k[s>>2]=0;n=D+4|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){F=29;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;h=(a|0)==0;g=k[c>>2]|0;do if(g){if((k[g+12>>2]|0)!=(k[g+16>>2]|0))if(h)break;else break b;x=0;j=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;m=x;x=0;if(m&1){F=29;break b}if((j|0)!=-1)if(h)break;else break b;else{k[c>>2]=0;F=19;break}}else F=19;while(0);if((F|0)==19){F=0;if(h){g=0;break}else g=0}h=i[D>>0]|0;h=(h&1)==0?(h&255)>>>1:k[n>>2]|0;if((k[v>>2]|0)==(d+h|0)){x=0;Fa(8,D|0,h<<1|0,0);m=x;x=0;if(m&1){F=29;break}if(!(i[D>>0]&1))d=10;else d=(k[D>>2]&-2)+-1|0;x=0;Fa(8,D|0,d|0,0);m=x;x=0;if(m&1){F=29;break}d=(i[D>>0]&1)==0?p:k[o>>2]|0;k[v>>2]=d+h}j=a+12|0;h=k[j>>2]|0;m=a+16|0;if((h|0)==(k[m>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;G=x;x=0;if(G&1){F=29;break}}else h=l[h>>0]|0;if(ep(h&255,16,d,v,s,0,E,t,u,q)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;G=x;x=0;if(G&1){F=29;break}else continue}else{k[j>>2]=g+1;continue}}if((F|0)==29){a=Wa()|0;break}x=0;Fa(8,D|0,(k[v>>2]|0)-d|0,0);G=x;x=0;if((!(G&1)?(y=i[D>>0]|0,z=k[o>>2]|0,x=0,A=Da(3)|0,G=x,x=0,!(G&1)):0)?(x=0,k[w>>2]=f,B=Ea(16,((y&1)==0?p:z)|0,A|0,58882,w|0)|0,G=x,x=0,!(G&1)):0){if((B|0)!=1)k[e>>2]=4;if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;G=x;x=0;if(G&1){F=30;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;G=x;x=0;if(G&1){F=30;break a}if((a|0)==-1){k[c>>2]=0;F=55;break}}if(!d)F=56}else F=55;while(0);if((F|0)==55?d:0)F=56;if((F|0)==56)k[e>>2]=k[e>>2]|2;G=k[b>>2]|0;Sm(D);Sm(E);r=C;return G|0}else F=30}else F=30;while(0);if((F|0)==30)a=Wa()|0;Sm(D);break}a=Wa()|0;zm(d)|0}while(0);Sm(E);fb(a|0);return 0}function ep(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0;o=k[d>>2]|0;p=(o|0)==(c|0);do if(p){m=(i[l+24>>0]|0)==a<<24>>24;if(!m?(i[l+25>>0]|0)!=a<<24>>24:0){n=5;break}k[d>>2]=c+1;i[c>>0]=m?43:45;k[e>>2]=0;m=0}else n=5;while(0);a:do if((n|0)==5){n=i[g>>0]|0;if(a<<24>>24==f<<24>>24?(((n&1)==0?(n&255)>>>1:k[g+4>>2]|0)|0)!=0:0){m=k[j>>2]|0;if((m-h|0)>=160){m=0;break}b=k[e>>2]|0;k[j>>2]=m+4;k[m>>2]=b;k[e>>2]=0;m=0;break}g=l+26|0;m=l;while(1){if((i[m>>0]|0)==a<<24>>24)break;m=m+1|0;if((m|0)==(g|0)){m=g;break}}m=m-l|0;if((m|0)>23)m=-1;else{switch(b|0){case 10:case 8:{if((m|0)>=(b|0)){m=-1;break a}break}case 16:{if((m|0)>=22){if(p){m=-1;break a}if((o-c|0)>=3){m=-1;break a}if((i[o+-1>>0]|0)!=48){m=-1;break a}k[e>>2]=0;m=i[57498+m>>0]|0;k[d>>2]=o+1;i[o>>0]=m;m=0;break a}break}default:{}}m=i[57498+m>>0]|0;k[d>>2]=o+1;i[o>>0]=m;k[e>>2]=(k[e>>2]|0)+1;m=0}}while(0);return m|0}function fp(){var a=0,b=0;do if((i[1968]|0)==0?(Qa(1968)|0)!=0:0){x=0;a=va(31,2147483647,58885,0)|0;b=x;x=0;if(b&1){b=Wa()|0;Bb(1968);fb(b|0)}else{k[11196]=a;Ya(1968);break}}while(0);return k[11196]|0}function gp(a){a=a|0;return}function hp(a){a=a|0;mj(a);return}function ip(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;q=r;r=r+64|0;o=q+56|0;g=q+52|0;m=q+48|0;h=q+44|0;j=q+40|0;l=q+36|0;n=q+32|0;s=q+8|0;p=q;a:do if(!(k[d+4>>2]&1)){k[m>>2]=-1;s=k[(k[a>>2]|0)+16>>2]|0;k[h>>2]=k[b>>2];k[j>>2]=k[c>>2];k[g>>2]=k[h>>2];k[o>>2]=k[j>>2];g=Nb[s&63](a,g,o,d,e,m)|0;k[b>>2]=g;switch(k[m>>2]|0){case 0:{i[f>>0]=0;break a}case 1:{i[f>>0]=1;break a}default:{i[f>>0]=1;k[e>>2]=4;break a}}}else{g=tn(d)|0;k[l>>2]=g;x=0;a=Aa(37,l|0,44212)|0;m=x;x=0;do if(!(m&1)){zm(g)|0;g=tn(d)|0;k[n>>2]=g;x=0;j=Aa(37,n|0,44368)|0;n=x;x=0;if(n&1){s=Wa()|0;zm(g)|0;g=s;break}zm(g)|0;x=0;ra(k[(k[j>>2]|0)+24>>2]|0,s|0,j|0);n=x;x=0;if(!(n&1)){h=s+12|0;x=0;ra(k[(k[j>>2]|0)+28>>2]|0,h|0,j|0);n=x;x=0;if(!(n&1)){k[p>>2]=k[c>>2];x=0;k[o>>2]=k[p>>2];g=na(8,b|0,o|0,s|0,s+24|0,a|0,e|0,1)|0;e=x;x=0;if(e&1){g=Wa()|0;en(s+12|0);en(s);break}else{i[f>>0]=(g|0)==(s|0)&1;g=k[b>>2]|0;en(s+12|0);en(s);break a}}}else h=s;g=Wa()|0;j=M;if((s|0)!=(h|0))do{h=h+-12|0;en(h)}while((h|0)!=(s|0))}else{s=Wa()|0;zm(g)|0;g=s}while(0);fb(g|0)}while(0);r=q;return g|0}function jp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Tu(a,i,h,d,e,f)|0;r=g;return a|0}function kp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Uu(a,i,h,d,e,f)|0;r=g;return a|0}function lp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Vu(a,i,h,d,e,f)|0;r=g;return a|0}function mp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Wu(a,i,h,d,e,f)|0;r=g;return a|0}function np(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Xu(a,i,h,d,e,f)|0;r=g;return a|0}function op(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Yu(a,i,h,d,e,f)|0;r=g;return a|0}function pp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=Zu(a,i,h,d,e,f)|0;r=g;return a|0}function qp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=_u(a,i,h,d,e,f)|0;r=g;return a|0}function rp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0;g=r;r=r+16|0;h=g+12|0;i=g+8|0;l=g+4|0;j=g;k[l>>2]=k[b>>2];k[j>>2]=k[c>>2];k[i>>2]=k[l>>2];k[h>>2]=k[j>>2];a=$u(a,i,h,d,e,f)|0;r=g;return a|0}function sp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;B=r;r=r+320|0;v=B;p=B+208|0;D=B+32|0;a=B+28|0;C=B+16|0;u=B+12|0;s=B+48|0;t=B+8|0;q=B+4|0;k[D>>2]=0;k[D+4>>2]=0;k[D+8>>2]=0;x=0;d=ta(68,d|0)|0;o=x;x=0;do if(o&1)a=Wa()|0;else{k[a>>2]=d;x=0;a=Aa(37,a|0,44212)|0;o=x;x=0;if(!(o&1)?(x=0,Ea(k[(k[a>>2]|0)+48>>2]|0,a|0,57498,57524,p|0)|0,o=x,x=0,!(o&1)):0){zm(d)|0;k[C>>2]=0;k[C+4>>2]=0;k[C+8>>2]=0;if(!(i[C>>0]&1))a=10;else a=(k[C>>2]&-2)+-1|0;x=0;Fa(8,C|0,a|0,0);o=x;x=0;a:do if(!(o&1)){n=C+8|0;o=C+1|0;a=(i[C>>0]&1)==0?o:k[n>>2]|0;k[u>>2]=a;k[t>>2]=s;k[q>>2]=0;m=C+4|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){E=30;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;d=0;h=1}else{d=g;h=0}}else{d=0;h=1}j=k[c>>2]|0;do if(j){g=k[j+12>>2]|0;if((g|0)==(k[j+16>>2]|0)){x=0;g=ta(k[(k[j>>2]|0)+36>>2]|0,j|0)|0;l=x;x=0;if(l&1){E=30;break b}}else g=k[g>>2]|0;if((g|0)!=-1)if(h){g=j;break}else{g=j;break b}else{k[c>>2]=0;E=20;break}}else E=20;while(0);if((E|0)==20){E=0;if(h){g=0;break}else g=0}h=i[C>>0]|0;h=(h&1)==0?(h&255)>>>1:k[m>>2]|0;if((k[u>>2]|0)==(a+h|0)){x=0;Fa(8,C|0,h<<1|0,0);l=x;x=0;if(l&1){E=30;break}if(!(i[C>>0]&1))a=10;else a=(k[C>>2]&-2)+-1|0;x=0;Fa(8,C|0,a|0,0);l=x;x=0;if(l&1){E=30;break}a=(i[C>>0]&1)==0?o:k[n>>2]|0;k[u>>2]=a+h}j=d+12|0;h=k[j>>2]|0;l=d+16|0;if((h|0)==(k[l>>2]|0)){x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;F=x;x=0;if(F&1){E=30;break}}else h=k[h>>2]|0;if(tp(h,16,a,u,q,0,D,s,t,p)|0)break;g=k[j>>2]|0;if((g|0)==(k[l>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;F=x;x=0;if(F&1){E=30;break}else{g=d;continue}}else{k[j>>2]=g+4;g=d;continue}}if((E|0)==30){a=Wa()|0;break}x=0;Fa(8,C|0,(k[u>>2]|0)-a|0,0);F=x;x=0;if((!(F&1)?(w=i[C>>0]|0,y=k[n>>2]|0,x=0,z=Da(3)|0,F=x,x=0,!(F&1)):0)?(x=0,k[v>>2]=f,A=Ea(16,((w&1)==0?o:y)|0,z|0,58882,v|0)|0,F=x,x=0,!(F&1)):0){if((A|0)!=1)k[e>>2]=4;if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;F=x;x=0;if(F&1){E=31;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;F=x;x=0;if(F&1){E=31;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{E=59;break}else{k[c>>2]=0;E=57;break}}else E=57;while(0);if((E|0)==57?d:0)E=59;if((E|0)==59)k[e>>2]=k[e>>2]|2;F=k[b>>2]|0;Sm(C);Sm(D);r=B;return F|0}else E=31}else E=31;while(0);if((E|0)==31)a=Wa()|0;Sm(C);break}a=Wa()|0;zm(d)|0}while(0);Sm(D);fb(a|0);return 0}function tp(a,b,c,d,e,f,g,h,j,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;var m=0,n=0,o=0,p=0;o=k[d>>2]|0;p=(o|0)==(c|0);do if(p){m=(k[l+96>>2]|0)==(a|0);if(!m?(k[l+100>>2]|0)!=(a|0):0){n=5;break}k[d>>2]=c+1;i[c>>0]=m?43:45;k[e>>2]=0;m=0}else n=5;while(0);a:do if((n|0)==5){n=i[g>>0]|0;if((a|0)==(f|0)?(((n&1)==0?(n&255)>>>1:k[g+4>>2]|0)|0)!=0:0){m=k[j>>2]|0;if((m-h|0)>=160){m=0;break}b=k[e>>2]|0;k[j>>2]=m+4;k[m>>2]=b;k[e>>2]=0;m=0;break}g=l+104|0;m=l;while(1){if((k[m>>2]|0)==(a|0))break;m=m+4|0;if((m|0)==(g|0)){m=g;break}}m=m-l|0;g=m>>2;if((m|0)>92)m=-1;else{switch(b|0){case 10:case 8:{if((g|0)>=(b|0)){m=-1;break a}break}case 16:{if((m|0)>=88){if(p){m=-1;break a}if((o-c|0)>=3){m=-1;break a}if((i[o+-1>>0]|0)!=48){m=-1;break a}k[e>>2]=0;m=i[57498+g>>0]|0;k[d>>2]=o+1;i[o>>0]=m;m=0;break a}break}default:{}}m=i[57498+g>>0]|0;k[d>>2]=o+1;i[o>>0]=m;k[e>>2]=(k[e>>2]|0)+1;m=0}}while(0);return m|0}function up(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0;j=r;r=r+16|0;h=j;b=tn(b)|0;k[h>>2]=b;x=0;e=Aa(37,h|0,44220)|0;l=x;x=0;if((((!(l&1)?(x=0,Ea(k[(k[e>>2]|0)+32>>2]|0,e|0,57498,57524,c|0)|0,l=x,x=0,!(l&1)):0)?(x=0,g=Aa(37,h|0,44360)|0,l=x,x=0,!(l&1)):0)?(x=0,f=ta(k[(k[g>>2]|0)+16>>2]|0,g|0)|0,l=x,x=0,!(l&1)):0)?(i[d>>0]=f,x=0,ra(k[(k[g>>2]|0)+20>>2]|0,a|0,g|0),l=x,x=0,!(l&1)):0){zm(b)|0;r=j;return}l=Wa()|0;zm(b)|0;fb(l|0)}function vp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0;m=r;r=r+16|0;l=m;b=tn(b)|0;k[l>>2]=b;x=0;f=Aa(37,l|0,44220)|0;n=x;x=0;if(((((!(n&1)?(x=0,Ea(k[(k[f>>2]|0)+32>>2]|0,f|0,57498,57530,c|0)|0,n=x,x=0,!(n&1)):0)?(x=0,j=Aa(37,l|0,44360)|0,n=x,x=0,!(n&1)):0)?(x=0,g=ta(k[(k[j>>2]|0)+12>>2]|0,j|0)|0,n=x,x=0,!(n&1)):0)?(i[d>>0]=g,x=0,h=ta(k[(k[j>>2]|0)+16>>2]|0,j|0)|0,n=x,x=0,!(n&1)):0)?(i[e>>0]=h,x=0,ra(k[(k[j>>2]|0)+20>>2]|0,a|0,j|0),n=x,x=0,!(n&1)):0){zm(b)|0;r=m;return}n=Wa()|0;zm(b)|0;fb(n|0)}function wp(a,b,c,d,e,f,g,h,j,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;m=m|0;n=n|0;o=o|0;var p=0,q=0;a:do if(a<<24>>24==f<<24>>24)if(i[b>>0]|0){i[b>>0]=0;c=k[e>>2]|0;k[e>>2]=c+1;i[c>>0]=46;c=i[h>>0]|0;if((((c&1)==0?(c&255)>>>1:k[h+4>>2]|0)|0)!=0?(p=k[m>>2]|0,(p-j|0)<160):0){j=k[n>>2]|0;k[m>>2]=p+4;k[p>>2]=j;p=0}else p=0}else p=-1;else{if(a<<24>>24==g<<24>>24?(g=i[h>>0]|0,(((g&1)==0?(g&255)>>>1:k[h+4>>2]|0)|0)!=0):0){if(!(i[b>>0]|0)){p=-1;break}p=k[m>>2]|0;if((p-j|0)>=160){p=0;break}j=k[n>>2]|0;k[m>>2]=p+4;k[p>>2]=j;k[n>>2]=0;p=0;break}f=o+32|0;p=o;while(1){if((i[p>>0]|0)==a<<24>>24)break;p=p+1|0;if((p|0)==(f|0)){p=f;break}}f=p-o|0;if((f|0)>31)p=-1;else{g=i[57498+f>>0]|0;switch(f|0){case 24:case 25:{p=k[e>>2]|0;if((p|0)!=(d|0)?(l[p+-1>>0]&95|0)!=(l[c>>0]&127|0):0){p=-1;break a}k[e>>2]=p+1;i[p>>0]=g;p=0;break a}case 23:case 22:{i[c>>0]=80;p=k[e>>2]|0;k[e>>2]=p+1;i[p>>0]=g;p=0;break a}default:{p=g&95;if((((p|0)==(i[c>>0]|0)?(i[c>>0]=p|128,(i[b>>0]|0)!=0):0)?(i[b>>0]=0,c=i[h>>0]|0,(((c&1)==0?(c&255)>>>1:k[h+4>>2]|0)|0)!=0):0)?(q=k[m>>2]|0,(q-j|0)<160):0){j=k[n>>2]|0;k[m>>2]=q+4;k[q>>2]=j}m=k[e>>2]|0;k[e>>2]=m+1;i[m>>0]=g;if((f|0)>21){p=0;break a}k[n>>2]=(k[n>>2]|0)+1;p=0;break a}}}}while(0);return p|0}function xp(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=r;r=r+16|0;h=i;b=tn(b)|0;k[h>>2]=b;x=0;e=Aa(37,h|0,44212)|0;j=x;x=0;if((((!(j&1)?(x=0,Ea(k[(k[e>>2]|0)+48>>2]|0,e|0,57498,57524,c|0)|0,j=x,x=0,!(j&1)):0)?(x=0,g=Aa(37,h|0,44368)|0,j=x,x=0,!(j&1)):0)?(x=0,f=ta(k[(k[g>>2]|0)+16>>2]|0,g|0)|0,j=x,x=0,!(j&1)):0)?(k[d>>2]=f,x=0,ra(k[(k[g>>2]|0)+20>>2]|0,a|0,g|0),j=x,x=0,!(j&1)):0){zm(b)|0;r=i;return}j=Wa()|0;zm(b)|0;fb(j|0)}function yp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0;l=r;r=r+16|0;j=l;b=tn(b)|0;k[j>>2]=b;x=0;f=Aa(37,j|0,44212)|0;m=x;x=0;if(((((!(m&1)?(x=0,Ea(k[(k[f>>2]|0)+48>>2]|0,f|0,57498,57530,c|0)|0,m=x,x=0,!(m&1)):0)?(x=0,i=Aa(37,j|0,44368)|0,m=x,x=0,!(m&1)):0)?(x=0,g=ta(k[(k[i>>2]|0)+12>>2]|0,i|0)|0,m=x,x=0,!(m&1)):0)?(k[d>>2]=g,x=0,h=ta(k[(k[i>>2]|0)+16>>2]|0,i|0)|0,m=x,x=0,!(m&1)):0)?(k[e>>2]=h,x=0,ra(k[(k[i>>2]|0)+20>>2]|0,a|0,i|0),m=x,x=0,!(m&1)):0){zm(b)|0;r=l;return}m=Wa()|0;zm(b)|0;fb(m|0)}function zp(a,b,c,d,e,f,g,h,j,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;m=m|0;n=n|0;o=o|0;var p=0,q=0;a:do if((a|0)==(f|0))if(i[b>>0]|0){i[b>>0]=0;c=k[e>>2]|0;k[e>>2]=c+1;i[c>>0]=46;c=i[h>>0]|0;if((((c&1)==0?(c&255)>>>1:k[h+4>>2]|0)|0)!=0?(p=k[m>>2]|0,(p-j|0)<160):0){j=k[n>>2]|0;k[m>>2]=p+4;k[p>>2]=j;p=0}else p=0}else p=-1;else{if((a|0)==(g|0)?(g=i[h>>0]|0,(((g&1)==0?(g&255)>>>1:k[h+4>>2]|0)|0)!=0):0){if(!(i[b>>0]|0)){p=-1;break}p=k[m>>2]|0;if((p-j|0)>=160){p=0;break}j=k[n>>2]|0;k[m>>2]=p+4;k[p>>2]=j;k[n>>2]=0;p=0;break}f=o+128|0;p=o;while(1){if((k[p>>2]|0)==(a|0))break;p=p+4|0;if((p|0)==(f|0)){p=f;break}}f=p-o|0;p=f>>2;if((f|0)<=124){g=i[57498+p>>0]|0;switch(p|0){case 24:case 25:{p=k[e>>2]|0;if((p|0)!=(d|0)?(l[p+-1>>0]&95|0)!=(l[c>>0]&127|0):0){p=-1;break a}k[e>>2]=p+1;i[p>>0]=g;p=0;break a}case 23:case 22:{i[c>>0]=80;break}default:{p=g&95;if((((p|0)==(i[c>>0]|0)?(i[c>>0]=p|128,(i[b>>0]|0)!=0):0)?(i[b>>0]=0,c=i[h>>0]|0,(((c&1)==0?(c&255)>>>1:k[h+4>>2]|0)|0)!=0):0)?(q=k[m>>2]|0,(q-j|0)<160):0){j=k[n>>2]|0;k[m>>2]=q+4;k[q>>2]=j}}}m=k[e>>2]|0;k[e>>2]=m+1;i[m>>0]=g;if((f|0)>84)p=0;else{k[n>>2]=(k[n>>2]|0)+1;p=0}}else p=-1}while(0);return p|0}function Ap(a){a=a|0;return}function Bp(a){a=a|0;mj(a);return}function Cp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0;m=r;r=r+32|0;f=m+20|0;g=m+16|0;h=m+12|0;l=m;a:do if(!(k[c+4>>2]&1)){l=k[(k[a>>2]|0)+24>>2]|0;k[g>>2]=k[b>>2];k[f>>2]=k[g>>2];f=Wb[l&31](a,f,c,d,e&1)|0}else{f=tn(c)|0;k[h>>2]=f;x=0;g=Aa(37,h|0,44360)|0;j=x;x=0;b:do if(j&1){m=Wa()|0;zm(f)|0;f=m}else{zm(f)|0;f=k[g>>2]|0;if(e)Mb[k[f+24>>2]&127](l,g);else Mb[k[f+28>>2]&127](l,g);a=i[l>>0]|0;j=(a&1)==0;f=l+1|0;e=l+8|0;h=j?f:l+1|0;f=j?f:k[l+8>>2]|0;j=l+4|0;c=(a&1)==0;c:do if((f|0)!=((c?h:k[e>>2]|0)+(c?(a&255)>>>1:k[j>>2]|0)|0)){d:while(1){g=i[f>>0]|0;d=k[b>>2]|0;do if(d){c=d+24|0;a=k[c>>2]|0;if((a|0)!=(k[d+28>>2]|0)){k[c>>2]=a+1;i[a>>0]=g;break}x=0;g=Aa(k[(k[d>>2]|0)+52>>2]|0,d|0,g&255|0)|0;a=x;x=0;if(a&1)break d;if((g|0)==-1)k[b>>2]=0}while(0);f=f+1|0;a=i[l>>0]|0;c=(a&1)==0;if((f|0)==((c?h:k[e>>2]|0)+(c?(a&255)>>>1:k[j>>2]|0)|0))break c}f=Wa()|0;Sm(l);break b}while(0);f=k[b>>2]|0;Sm(l);break a}while(0);fb(f|0)}while(0);r=m;return f|0}function Dp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+64|0;f=m;o=m+56|0;p=m+44|0;h=m+20|0;l=m+16|0;j=m+12|0;n=m+8|0;g=m+4|0;i[o>>0]=i[58887]|0;i[o+1>>0]=i[58888]|0;i[o+2>>0]=i[58889]|0;i[o+3>>0]=i[58890]|0;i[o+4>>0]=i[58891]|0;i[o+5>>0]=i[58892]|0;Ep(o+1|0,58893,1,k[c+4>>2]|0);a=fp()|0;k[f>>2]=e;e=p+(av(p,12,a,o,f)|0)|0;o=Fp(p,e,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(1,p|0,o|0,e|0,h|0,l|0,j|0,n|0);e=x;x=0;if(e&1){p=Wa()|0;zm(a)|0;fb(p|0)}else{zm(a)|0;k[g>>2]=k[b>>2];o=k[l>>2]|0;p=k[j>>2]|0;k[f>>2]=k[g>>2];p=md(f,h,o,p,c,d)|0;r=m;return p|0}return 0}function Ep(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;if(d&2048){i[a>>0]=43;a=a+1|0}if(d&512){i[a>>0]=35;a=a+1|0}e=i[b>>0]|0;if(e<<24>>24){f=b;while(1){f=f+1|0;b=a+1|0;i[a>>0]=e;e=i[f>>0]|0;if(!(e<<24>>24)){a=b;break}else a=b}}a:do switch(d&74|0){case 64:{i[a>>0]=111;break}case 8:if(!(d&16384)){i[a>>0]=120;break a}else{i[a>>0]=88;break a}default:if(c){i[a>>0]=100;break a}else{i[a>>0]=117;break a}}while(0);return}function Fp(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a:do switch(k[c+4>>2]&176|0){case 16:{c=i[a>>0]|0;switch(c<<24>>24){case 43:case 45:{a=a+1|0;break a}default:{}}if((b-a|0)>1&c<<24>>24==48){switch(i[a+1>>0]|0){case 88:case 120:break;default:{d=7;break a}}a=a+2|0}else d=7;break}case 32:{a=b;break}default:d=7}while(0);return a|0}function Gp(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;u=r;r=r+16|0;v=u;s=Ss(g,44220)|0;l=Ss(g,44360)|0;Mb[k[(k[l>>2]|0)+20>>2]&127](v,l);p=i[v>>0]|0;q=v+4|0;a:do if(!(((p&1)==0?(p&255)>>>1:k[q>>2]|0)|0)){x=0;Ea(k[(k[s>>2]|0)+32>>2]|0,s|0,a|0,c|0,d|0)|0;t=x;x=0;if(t&1)t=5;else{g=d+(c-a)|0;k[f>>2]=g;t=29}}else{k[f>>2]=d;g=i[a>>0]|0;switch(g<<24>>24){case 43:case 45:{x=0;g=Aa(k[(k[s>>2]|0)+28>>2]|0,s|0,g|0)|0;p=x;x=0;if(p&1){t=5;break a}j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=g;j=a+1|0;break}default:j=a}b:do if((c-j|0)>1?(i[j>>0]|0)==48:0){g=j+1|0;switch(i[g>>0]|0){case 88:case 120:break;default:break b}x=0;h=Aa(k[(k[s>>2]|0)+28>>2]|0,s|0,48)|0;p=x;x=0;if(p&1){t=5;break a}p=k[f>>2]|0;k[f>>2]=p+1;i[p>>0]=h;x=0;g=Aa(k[(k[s>>2]|0)+28>>2]|0,s|0,i[g>>0]|0)|0;p=x;x=0;if(p&1){t=5;break a}p=k[f>>2]|0;k[f>>2]=p+1;i[p>>0]=g;j=j+2|0}while(0);if((j|0)!=(c|0)?(m=c+-1|0,j>>>0>>0):0){h=j;g=m;do{p=i[h>>0]|0;i[h>>0]=i[g>>0]|0;i[g>>0]=p;h=h+1|0;g=g+-1|0}while(h>>>0>>0)}x=0;m=ta(k[(k[l>>2]|0)+16>>2]|0,l|0)|0;p=x;x=0;if(!(p&1)){n=v+8|0;o=v+1|0;c:do if(j>>>0>>0){g=0;h=0;p=j;while(1){l=i[((i[v>>0]&1)==0?o:k[n>>2]|0)+h>>0]|0;if(l<<24>>24!=0&(g|0)==(l<<24>>24|0)){g=k[f>>2]|0;k[f>>2]=g+1;i[g>>0]=m;g=i[v>>0]|0;l=0;h=(h>>>0<(((g&1)==0?(g&255)>>>1:k[q>>2]|0)+-1|0)>>>0&1)+h|0}else l=g;x=0;g=Aa(k[(k[s>>2]|0)+28>>2]|0,s|0,i[p>>0]|0)|0;w=x;x=0;if(w&1)break;w=k[f>>2]|0;k[f>>2]=w+1;i[w>>0]=g;p=p+1|0;if(p>>>0>=c>>>0)break c;else g=l+1|0}g=Wa()|0;break a}while(0);h=a;g=d+(j-h)|0;a=k[f>>2]|0;if((g|0)==(a|0)){a=h;t=29}else{a=a+-1|0;if(g>>>0>>0)do{w=i[g>>0]|0;i[g>>0]=i[a>>0]|0;i[a>>0]=w;g=g+1|0;a=a+-1|0}while(g>>>0>>0);a=h;g=k[f>>2]|0;t=29}}else t=5}while(0);if((t|0)==5)g=Wa()|0;else if((t|0)==29){k[e>>2]=(b|0)==(c|0)?g:d+(b-a)|0;Sm(v);r=u;return}Sm(v);fb(g|0)}function Hp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;m=r;r=r+96|0;g=m+8|0;a=m;o=m+74|0;i=m+32|0;l=m+28|0;j=m+24|0;n=m+20|0;h=m+16|0;p=a;k[p>>2]=37;k[p+4>>2]=0;Ep(a+1|0,58895,1,k[c+4>>2]|0);p=fp()|0;q=g;k[q>>2]=e;k[q+4>>2]=f;f=o+(av(o,22,p,a,g)|0)|0;e=Fp(o,f,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(1,o|0,e|0,f|0,i|0,l|0,j|0,n|0);f=x;x=0;if(f&1){q=Wa()|0;zm(a)|0;fb(q|0)}else{zm(a)|0;k[h>>2]=k[b>>2];p=k[l>>2]|0;q=k[j>>2]|0;k[g>>2]=k[h>>2];q=md(g,i,p,q,c,d)|0;r=m;return q|0}return 0}function Ip(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+64|0;f=m;o=m+56|0;p=m+44|0;h=m+20|0;l=m+16|0;j=m+12|0;n=m+8|0;g=m+4|0;i[o>>0]=i[58887]|0;i[o+1>>0]=i[58888]|0;i[o+2>>0]=i[58889]|0;i[o+3>>0]=i[58890]|0;i[o+4>>0]=i[58891]|0;i[o+5>>0]=i[58892]|0;Ep(o+1|0,58893,0,k[c+4>>2]|0);a=fp()|0;k[f>>2]=e;e=p+(av(p,12,a,o,f)|0)|0;o=Fp(p,e,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(1,p|0,o|0,e|0,h|0,l|0,j|0,n|0);e=x;x=0;if(e&1){p=Wa()|0;zm(a)|0;fb(p|0)}else{zm(a)|0;k[g>>2]=k[b>>2];o=k[l>>2]|0;p=k[j>>2]|0;k[f>>2]=k[g>>2];p=md(f,h,o,p,c,d)|0;r=m;return p|0}return 0}function Jp(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;m=r;r=r+112|0;g=m+8|0;a=m;o=m+75|0;i=m+32|0;l=m+28|0;j=m+24|0;n=m+20|0;h=m+16|0;p=a;k[p>>2]=37;k[p+4>>2]=0;Ep(a+1|0,58895,0,k[c+4>>2]|0);p=fp()|0;q=g;k[q>>2]=e;k[q+4>>2]=f;f=o+(av(o,23,p,a,g)|0)|0;e=Fp(o,f,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(1,o|0,e|0,f|0,i|0,l|0,j|0,n|0);f=x;x=0;if(f&1){q=Wa()|0;zm(a)|0;fb(q|0)}else{zm(a)|0;k[h>>2]=k[b>>2];p=k[l>>2]|0;q=k[j>>2]|0;k[g>>2]=k[h>>2];q=md(g,i,p,q,c,d)|0;r=m;return q|0}return 0}function Kp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;z=r;r=r+176|0;t=z+84|0;n=z+48|0;m=z+32|0;i=z+24|0;f=z+8|0;l=z;q=z+88|0;s=z+80|0;h=z+118|0;y=z+76|0;w=z+72|0;u=z+68|0;v=z+64|0;j=l;k[j>>2]=37;k[j+4>>2]=0;j=Lp(l+1|0,58898,k[c+4>>2]|0)|0;k[s>>2]=q;a=fp()|0;if(j){k[f>>2]=k[c+8>>2];p[f+8>>3]=e;f=av(q,30,a,l,f)|0}else{p[i>>3]=e;f=av(q,30,a,l,i)|0}a:do if((f|0)>29){x=0;a=Da(3)|0;f=x;x=0;f=f&1;if(j){if(!f?(x=0,k[m>>2]=k[c+8>>2],p[m+8>>3]=e,g=Ea(17,s|0,a|0,l|0,m|0)|0,o=x,x=0,!(o&1)):0)A=12}else if(!f?(x=0,k[n>>2]=k[c+8>>2],p[n+8>>3]=e,o=Ea(17,s|0,a|0,l|0,n|0)|0,n=x,x=0,!(n&1)):0){g=o;A=12}do if((A|0)==12){a=k[s>>2]|0;if(!a){x=0;Ga(6);o=x;x=0;if(o&1)break;f=k[s>>2]|0}else f=a;a=f;l=f;A=16;break a}while(0);a=Wa()|0}else{a=k[s>>2]|0;l=0;g=f;A=16}while(0);if((A|0)==16){i=a+g|0;j=Fp(a,i,c)|0;do if((a|0)==(q|0)){a=q;f=0;A=22}else{g=Pl(g<<1)|0;if(!g){x=0;Ga(6);A=x;x=0;if(A&1){f=0;A=20;break}a=k[s>>2]|0}f=g;h=g;A=22}while(0);do if((A|0)==22){x=0;g=ta(68,c|0)|0;s=x;x=0;if(!(s&1)){k[u>>2]=g;x=0;ya(2,a|0,j|0,i|0,h|0,y|0,w|0,u|0);u=x;x=0;if(u&1){a=Wa()|0;zm(g)|0;break}zm(g)|0;k[v>>2]=k[b>>2];A=k[y>>2]|0;a=k[w>>2]|0;x=0;k[t>>2]=k[v>>2];a=sa(39,t|0,h|0,A|0,a|0,c|0,d|0)|0;A=x;x=0;if(!(A&1)){k[b>>2]=a;if(f)Ql(f);if(l)Ql(l);r=z;return a|0}else A=20}else A=20}while(0);if((A|0)==20)a=Wa()|0;if(f)Ql(f);if(l)Ql(l)}fb(a|0);return 0}function Lp(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;if(c&2048){i[a>>0]=43;a=a+1|0}if(c&1024){i[a>>0]=35;a=a+1|0}g=c&260;e=c>>>14;h=(g|0)==260;if(h)f=0;else{i[a>>0]=46;i[a+1>>0]=42;a=a+2|0;f=1}c=i[b>>0]|0;if(c<<24>>24){d=a;while(1){b=b+1|0;a=d+1|0;i[d>>0]=c;c=i[b>>0]|0;if(!(c<<24>>24))break;else d=a}}a:do switch(g|0){case 4:if(!(e&1)){i[a>>0]=102;break a}else{i[a>>0]=70;break a}case 256:if(!(e&1)){i[a>>0]=101;break a}else{i[a>>0]=69;break a}default:{c=(e&1|0)!=0;if(h)if(c){i[a>>0]=65;break a}else{i[a>>0]=97;break a}else if(c){i[a>>0]=71;break a}else{i[a>>0]=103;break a}}}while(0);return f|0}function Mp(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0;z=r;r=r+16|0;A=z;y=Ss(g,44220)|0;v=Ss(g,44360)|0;Mb[k[(k[v>>2]|0)+20>>2]&127](A,v);k[f>>2]=d;g=i[a>>0]|0;switch(g<<24>>24){case 43:case 45:{x=0;g=Aa(k[(k[y>>2]|0)+28>>2]|0,y|0,g|0)|0;w=x;x=0;if(w&1)u=8;else{m=k[f>>2]|0;k[f>>2]=m+1;i[m>>0]=g;m=a+1|0;u=10}break}default:{m=a;u=10}}a:do if((u|0)==10){w=c;b:do if((w-m|0)>1?(i[m>>0]|0)==48:0){j=m+1|0;switch(i[j>>0]|0){case 88:case 120:break;default:{u=11;break b}}x=0;g=Aa(k[(k[y>>2]|0)+28>>2]|0,y|0,48)|0;t=x;x=0;if(t&1){u=8;break a}t=k[f>>2]|0;k[f>>2]=t+1;i[t>>0]=g;m=m+2|0;x=0;g=Aa(k[(k[y>>2]|0)+28>>2]|0,y|0,i[j>>0]|0)|0;t=x;x=0;if(t&1){u=8;break a}t=k[f>>2]|0;k[f>>2]=t+1;i[t>>0]=g;if(m>>>0>>0){g=m;while(1){j=i[g>>0]|0;x=0;l=Da(3)|0;t=x;x=0;if(t&1)break;x=0;j=Aa(39,j<<24>>24|0,l|0)|0;t=x;x=0;if(t&1)break;if(!j){t=m;break b}g=g+1|0;if(g>>>0>=c>>>0){t=m;break b}}g=Wa()|0;break a}else{t=m;g=m}}else u=11;while(0);c:do if((u|0)==11)if(m>>>0>>0){g=m;while(1){j=i[g>>0]|0;x=0;l=Da(3)|0;t=x;x=0;if(t&1)break;x=0;j=Aa(40,j<<24>>24|0,l|0)|0;t=x;x=0;if(t&1)break;if(!j){t=m;break c}g=g+1|0;if(g>>>0>=c>>>0){t=m;break c}}g=Wa()|0;break a}else{t=m;g=m}while(0);q=i[A>>0]|0;s=A+4|0;if(((q&1)==0?(q&255)>>>1:k[s>>2]|0)|0){if((t|0)!=(g|0)?(n=g+-1|0,t>>>0>>0):0){l=t;j=n;do{q=i[l>>0]|0;i[l>>0]=i[j>>0]|0;i[j>>0]=q;l=l+1|0;j=j+-1|0}while(l>>>0>>0)}x=0;n=ta(k[(k[v>>2]|0)+16>>2]|0,v|0)|0;q=x;x=0;if(q&1){u=8;break}o=A+8|0;p=A+1|0;d:do if(t>>>0>>0){j=0;l=0;q=t;while(1){m=i[((i[A>>0]&1)==0?p:k[o>>2]|0)+l>>0]|0;if(m<<24>>24>0&(j|0)==(m<<24>>24|0)){j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=n;j=i[A>>0]|0;m=0;l=(l>>>0<(((j&1)==0?(j&255)>>>1:k[s>>2]|0)+-1|0)>>>0&1)+l|0}else m=j;x=0;j=Aa(k[(k[y>>2]|0)+28>>2]|0,y|0,i[q>>0]|0)|0;B=x;x=0;if(B&1)break;B=k[f>>2]|0;k[f>>2]=B+1;i[B>>0]=j;q=q+1|0;if(q>>>0>=g>>>0)break d;else j=m+1|0}g=Wa()|0;break a}while(0);j=d+(t-a)|0;l=k[f>>2]|0;if((j|0)!=(l|0)?(h=l+-1|0,j>>>0>>0):0){do{B=i[j>>0]|0;i[j>>0]=i[h>>0]|0;i[h>>0]=B;j=j+1|0;h=h+-1|0}while(j>>>0>>0);j=y}else j=y}else{x=0;Ea(k[(k[y>>2]|0)+32>>2]|0,y|0,t|0,g|0,k[f>>2]|0)|0;B=x;x=0;if(B&1){u=8;break}k[f>>2]=(k[f>>2]|0)+(g-t);j=y}e:do if(g>>>0>>0){while(1){h=i[g>>0]|0;if(h<<24>>24==46)break;x=0;h=Aa(k[(k[j>>2]|0)+28>>2]|0,y|0,h|0)|0;B=x;x=0;if(B&1){u=4;break}B=k[f>>2]|0;k[f>>2]=B+1;i[B>>0]=h;g=g+1|0;if(g>>>0>=c>>>0)break e}if((u|0)==4){g=Wa()|0;break a}x=0;h=ta(k[(k[v>>2]|0)+12>>2]|0,v|0)|0;B=x;x=0;if(B&1){u=8;break a}B=k[f>>2]|0;k[f>>2]=B+1;i[B>>0]=h;g=g+1|0}while(0);x=0;Ea(k[(k[y>>2]|0)+32>>2]|0,y|0,g|0,c|0,k[f>>2]|0)|0;B=x;x=0;if(B&1)u=8;else{B=(k[f>>2]|0)+(w-g)|0;k[f>>2]=B;k[e>>2]=(b|0)==(c|0)?B:d+(b-a)|0;Sm(A);r=z;return}}while(0);if((u|0)==8)g=Wa()|0;Sm(A);fb(g|0)}function Np(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;z=r;r=r+176|0;t=z+76|0;n=z+48|0;m=z+32|0;i=z+24|0;f=z+8|0;l=z;q=z+80|0;s=z+72|0;h=z+110|0;y=z+68|0;w=z+64|0;u=z+60|0;v=z+56|0;j=l;k[j>>2]=37;k[j+4>>2]=0;j=Lp(l+1|0,58899,k[c+4>>2]|0)|0;k[s>>2]=q;a=fp()|0;if(j){k[f>>2]=k[c+8>>2];p[f+8>>3]=e;f=av(q,30,a,l,f)|0}else{p[i>>3]=e;f=av(q,30,a,l,i)|0}a:do if((f|0)>29){x=0;a=Da(3)|0;f=x;x=0;f=f&1;if(j){if(!f?(x=0,k[m>>2]=k[c+8>>2],p[m+8>>3]=e,g=Ea(17,s|0,a|0,l|0,m|0)|0,o=x,x=0,!(o&1)):0)A=12}else if(!f?(x=0,p[n>>3]=e,o=Ea(17,s|0,a|0,l|0,n|0)|0,n=x,x=0,!(n&1)):0){g=o;A=12}do if((A|0)==12){a=k[s>>2]|0;if(!a){x=0;Ga(6);o=x;x=0;if(o&1)break;f=k[s>>2]|0}else f=a;a=f;l=f;A=16;break a}while(0);a=Wa()|0}else{a=k[s>>2]|0;l=0;g=f;A=16}while(0);if((A|0)==16){i=a+g|0;j=Fp(a,i,c)|0;do if((a|0)==(q|0)){a=q;f=0;A=22}else{g=Pl(g<<1)|0;if(!g){x=0;Ga(6);A=x;x=0;if(A&1){f=0;A=20;break}a=k[s>>2]|0}f=g;h=g;A=22}while(0);do if((A|0)==22){x=0;g=ta(68,c|0)|0;s=x;x=0;if(!(s&1)){k[u>>2]=g;x=0;ya(2,a|0,j|0,i|0,h|0,y|0,w|0,u|0);u=x;x=0;if(u&1){a=Wa()|0;zm(g)|0;break}zm(g)|0;k[v>>2]=k[b>>2];A=k[y>>2]|0;a=k[w>>2]|0;x=0;k[t>>2]=k[v>>2];a=sa(39,t|0,h|0,A|0,a|0,c|0,d|0)|0;A=x;x=0;if(!(A&1)){k[b>>2]=a;if(f)Ql(f);if(l)Ql(l);r=z;return a|0}else A=20}else A=20}while(0);if((A|0)==20)a=Wa()|0;if(f)Ql(f);if(l)Ql(l)}fb(a|0);return 0}function Op(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;o=r;r=r+80|0;j=o;a=o+70|0;m=o+12|0;n=o+32|0;h=o+8|0;l=o+4|0;i[a>>0]=i[58901]|0;i[a+1>>0]=i[58902]|0;i[a+2>>0]=i[58903]|0;i[a+3>>0]=i[58904]|0;i[a+4>>0]=i[58905]|0;i[a+5>>0]=i[58906]|0;f=fp()|0;k[j>>2]=e;a=av(m,20,f,a,j)|0;e=m+a|0;f=Fp(m,e,c)|0;g=tn(c)|0;k[h>>2]=g;x=0;h=Aa(37,h|0,44220)|0;p=x;x=0;if(p&1){p=Wa()|0;zm(g)|0;fb(p|0)}else{zm(g)|0;Zb[k[(k[h>>2]|0)+32>>2]&31](h,m,e,n)|0;p=n+a|0;k[l>>2]=k[b>>2];k[j>>2]=k[l>>2];p=md(j,n,(f|0)==(e|0)?p:n+(f-m)|0,p,c,d)|0;r=o;return p|0}return 0}function Pp(a){a=a|0;return}function Qp(a){a=a|0;mj(a);return}function Rp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;f=l+20|0;g=l+16|0;h=l+12|0;j=l;a:do if(!(k[c+4>>2]&1)){j=k[(k[a>>2]|0)+24>>2]|0;k[g>>2]=k[b>>2];k[f>>2]=k[g>>2];f=Wb[j&31](a,f,c,d,e&1)|0}else{f=tn(c)|0;k[h>>2]=f;x=0;g=Aa(37,h|0,44368)|0;h=x;x=0;b:do if(h&1){l=Wa()|0;zm(f)|0;f=l}else{zm(f)|0;f=k[g>>2]|0;if(e)Mb[k[f+24>>2]&127](j,g);else Mb[k[f+28>>2]&127](j,g);a=i[j>>0]|0;c=(a&1)==0;f=j+4|0;e=j+8|0;h=c?f:j+4|0;f=c?f:k[j+8>>2]|0;c=(a&1)==0;c:do if((f|0)!=((c?h:k[e>>2]|0)+((c?(a&255)>>>1:k[h>>2]|0)<<2)|0)){while(1){g=k[f>>2]|0;d=k[b>>2]|0;if(d){c=d+24|0;a=k[c>>2]|0;if((a|0)==(k[d+28>>2]|0)){x=0;g=Aa(k[(k[d>>2]|0)+52>>2]|0,d|0,g|0)|0;a=x;x=0;if(a&1)break}else{k[c>>2]=a+4;k[a>>2]=g}if((g|0)==-1)k[b>>2]=0}f=f+4|0;a=i[j>>0]|0;c=(a&1)==0;if((f|0)==((c?h:k[e>>2]|0)+((c?(a&255)>>>1:k[h>>2]|0)<<2)|0))break c}f=Wa()|0;en(j);break b}while(0);f=k[b>>2]|0;en(j);break a}while(0);fb(f|0)}while(0);r=l;return f|0}function Sp(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;m=r;r=r+128|0;f=m;o=m+116|0;p=m+104|0;h=m+20|0;l=m+16|0;j=m+12|0;n=m+8|0;g=m+4|0;i[o>>0]=i[58887]|0;i[o+1>>0]=i[58888]|0;i[o+2>>0]=i[58889]|0;i[o+3>>0]=i[58890]|0;i[o+4>>0]=i[58891]|0;i[o+5>>0]=i[58892]|0;Ep(o+1|0,58893,1,k[c+4>>2]|0);a=fp()|0;k[f>>2]=e;e=p+(av(p,12,a,o,f)|0)|0;o=Fp(p,e,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(3,p|0,o|0,e|0,h|0,l|0,j|0,n|0);e=x;x=0;if(e&1){p=Wa()|0;zm(a)|0;fb(p|0)}else{zm(a)|0;k[g>>2]=k[b>>2];o=k[l>>2]|0;p=k[j>>2]|0;k[f>>2]=k[g>>2];p=cv(f,h,o,p,c,d)|0;r=m;return p|0}return 0}function Tp(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;u=r;r=r+16|0;v=u;s=Ss(g,44212)|0;l=Ss(g,44368)|0;Mb[k[(k[l>>2]|0)+20>>2]&127](v,l);p=i[v>>0]|0;q=v+4|0;a:do if(!(((p&1)==0?(p&255)>>>1:k[q>>2]|0)|0)){x=0;Ea(k[(k[s>>2]|0)+48>>2]|0,s|0,a|0,c|0,d|0)|0;t=x;x=0;if(t&1)t=5;else{g=d+(c-a<<2)|0;k[f>>2]=g;t=28}}else{k[f>>2]=d;g=i[a>>0]|0;switch(g<<24>>24){case 43:case 45:{x=0;g=Aa(k[(k[s>>2]|0)+44>>2]|0,s|0,g|0)|0;p=x;x=0;if(p&1){t=5;break a}j=k[f>>2]|0;k[f>>2]=j+4;k[j>>2]=g;j=a+1|0;break}default:j=a}b:do if((c-j|0)>1?(i[j>>0]|0)==48:0){g=j+1|0;switch(i[g>>0]|0){case 88:case 120:break;default:{p=j;break b}}x=0;h=Aa(k[(k[s>>2]|0)+44>>2]|0,s|0,48)|0;p=x;x=0;if(p&1){t=5;break a}p=k[f>>2]|0;k[f>>2]=p+4;k[p>>2]=h;x=0;g=Aa(k[(k[s>>2]|0)+44>>2]|0,s|0,i[g>>0]|0)|0;p=x;x=0;if(p&1){t=5;break a}p=k[f>>2]|0;k[f>>2]=p+4;k[p>>2]=g;p=j+2|0}else p=j;while(0);if((p|0)!=(c|0)?(m=c+-1|0,p>>>0>>0):0){h=p;g=m;do{o=i[h>>0]|0;i[h>>0]=i[g>>0]|0;i[g>>0]=o;h=h+1|0;g=g+-1|0}while(h>>>0>>0)}x=0;l=ta(k[(k[l>>2]|0)+16>>2]|0,l|0)|0;o=x;x=0;if(!(o&1)){m=v+8|0;n=v+1|0;c:do if(p>>>0>>0){g=0;h=0;o=p;while(1){j=i[((i[v>>0]&1)==0?n:k[m>>2]|0)+h>>0]|0;if(j<<24>>24!=0&(g|0)==(j<<24>>24|0)){g=k[f>>2]|0;k[f>>2]=g+4;k[g>>2]=l;g=i[v>>0]|0;j=0;h=(h>>>0<(((g&1)==0?(g&255)>>>1:k[q>>2]|0)+-1|0)>>>0&1)+h|0}else j=g;x=0;g=Aa(k[(k[s>>2]|0)+44>>2]|0,s|0,i[o>>0]|0)|0;w=x;x=0;if(w&1)break;w=k[f>>2]|0;k[f>>2]=w+4;k[w>>2]=g;o=o+1|0;if(o>>>0>=c>>>0)break c;else g=j+1|0}g=Wa()|0;break a}while(0);j=a;g=d+(p-j<<2)|0;h=k[f>>2]|0;if((g|0)!=(h|0)){a=h+-4|0;if(g>>>0>>0){do{w=k[g>>2]|0;k[g>>2]=k[a>>2];k[a>>2]=w;g=g+4|0;a=a+-4|0}while(g>>>0>>0);a=j;g=h;t=28}else{a=j;g=h;t=28}}else{a=j;t=28}}else t=5}while(0);if((t|0)==5)g=Wa()|0;else if((t|0)==28){k[e>>2]=(b|0)==(c|0)?g:d+(b-a<<2)|0;Sm(v);r=u;return}Sm(v);fb(g|0)}function Up(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;m=r;r=r+224|0;g=m+8|0;a=m;o=m+196|0;i=m+32|0;l=m+28|0;j=m+24|0;n=m+20|0;h=m+16|0;p=a;k[p>>2]=37;k[p+4>>2]=0;Ep(a+1|0,58895,1,k[c+4>>2]|0);p=fp()|0;q=g;k[q>>2]=e;k[q+4>>2]=f;f=o+(av(o,22,p,a,g)|0)|0;e=Fp(o,f,c)|0;a=tn(c)|0;k[n>>2]=a;x=0;ya(3,o|0,e|0,f|0,i|0,l|0,j|0,n|0);f=x;x=0;if(f&1){q=Wa()|0;zm(a)|0;fb(q|0)}else{zm(a)|0;k[h>>2]=k[b>>2];p=k[l>>2]|0;q=k[j>>2]|0;k[g>>2]=k[h>>2];q=cv(g,i,p,q,c,d)|0;r=m;return q|0}return 0} -function Et(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0;t=r;r=r+16|0;q=t;o=t+8|0;a:do if((c|0)==(d|0))j=d;else{j=c;while(1){if(!(k[j>>2]|0))break a;j=j+4|0;if((j|0)==(d|0)){j=d;break}}}while(0);k[h>>2]=f;k[e>>2]=c;m=g;p=a+8|0;b:do if(!((f|0)==(g|0)|(c|0)==(d|0))){a=f;l=j;c:while(1){v=b;f=k[v+4>>2]|0;j=q;k[j>>2]=k[v>>2];k[j+4>>2]=f;j=Ak(k[p>>2]|0)|0;x=0;f=Ba(21,a|0,e|0,l-c>>2|0,m-a|0,b|0)|0;v=x;x=0;if(v&1){u=9;break}if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){u=8;break}switch(f|0){case 0:{n=1;break b}case -1:{j=a;u=14;break c}default:{}}j=(k[h>>2]|0)+f|0;k[h>>2]=j;if((j|0)==(g|0)){u=27;break}if((l|0)==(d|0)){c=k[e>>2]|0;a=j;j=d}else{j=Ak(k[p>>2]|0)|0;x=0;c=va(34,o|0,0,b|0)|0;v=x;x=0;if(v&1){u=35;break}if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){u=34;break}if((c|0)==-1){n=2;break b}if(c>>>0>(m-(k[h>>2]|0)|0)>>>0){n=1;break b}if(c){j=o;while(1){l=i[j>>0]|0;v=k[h>>2]|0;k[h>>2]=v+1;i[v>>0]=l;c=c+-1|0;if(!c)break;else j=j+1|0}}c=(k[e>>2]|0)+4|0;k[e>>2]=c;d:do if((c|0)==(d|0))j=d;else{j=c;while(1){if(!(k[j>>2]|0))break d;j=j+4|0;if((j|0)==(d|0)){j=d;break}}}while(0);a=k[h>>2]|0}if((a|0)==(g|0)|(c|0)==(d|0)){u=47;break b}else l=j}if((u|0)==8){v=Wa(0)|0;oc(v)}else if((u|0)==9){c=Wa()|0;if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}else if((u|0)==14){k[h>>2]=j;e:do if((c|0)!=(k[e>>2]|0)){while(1){v=k[c>>2]|0;a=Ak(k[p>>2]|0)|0;x=0;j=va(34,j|0,v|0,q|0)|0;v=x;x=0;if(v&1){s=a;break}if((a|0)!=0?(x=0,ta(75,a|0)|0,v=x,x=0,v&1):0){u=18;break}if((j|0)==-1)break e;j=(k[h>>2]|0)+j|0;k[h>>2]=j;c=c+4|0;if((c|0)==(k[e>>2]|0))break e}if((u|0)==18){v=Wa(0)|0;oc(v)}c=Wa()|0;if((s|0)!=0?(x=0,ta(75,s|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}while(0);k[e>>2]=c;n=2;break}else if((u|0)==27){c=k[e>>2]|0;u=47;break}else if((u|0)==34){v=Wa(0)|0;oc(v)}else if((u|0)==35){c=Wa()|0;if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}}else u=47;while(0);if((u|0)==47)n=(c|0)!=(d|0)&1;r=t;return n|0}function Ft(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0;t=r;r=r+16|0;s=t;a:do if((c|0)==(d|0))j=d;else{j=c;while(1){if(!(i[j>>0]|0))break a;j=j+1|0;if((j|0)==(d|0)){j=d;break}}}while(0);k[h>>2]=f;k[e>>2]=c;n=g;p=a+8|0;b:do if(!((f|0)==(g|0)|(c|0)==(d|0))){a=f;m=j;c:while(1){l=b;j=k[l+4>>2]|0;f=s;k[f>>2]=k[l>>2];k[f+4>>2]=j;f=m;j=Ak(k[p>>2]|0)|0;x=0;l=Ba(22,a|0,e|0,f-c|0,n-a>>2|0,b|0)|0;v=x;x=0;if(v&1){u=9;break}if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){u=8;break}switch(l|0){case 0:{o=2;break b}case -1:{j=a;u=14;break c}default:{}}a=(k[h>>2]|0)+(l<<2)|0;k[h>>2]=a;if((a|0)==(g|0)){u=31;break}c=k[e>>2]|0;if((m|0)==(d|0))j=d;else{j=Ak(k[p>>2]|0)|0;x=0;c=Ea(20,a|0,c|0,1,b|0)|0;v=x;x=0;if(v&1){u=38;break}if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){u=37;break}if(c){o=2;break b}k[h>>2]=(k[h>>2]|0)+4;c=(k[e>>2]|0)+1|0;k[e>>2]=c;d:do if((c|0)==(d|0))j=d;else{j=c;while(1){if(!(i[j>>0]|0))break d;j=j+1|0;if((j|0)==(d|0)){j=d;break}}}while(0);a=k[h>>2]|0}if((a|0)==(g|0)|(c|0)==(d|0)){u=47;break b}else m=j}if((u|0)==8){v=Wa(0)|0;oc(v)}else if((u|0)==9){c=Wa()|0;if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}else if((u|0)==14){k[h>>2]=j;e:do if((c|0)!=(k[e>>2]|0)){a=j;f:while(1){j=Ak(k[p>>2]|0)|0;x=0;a=Ea(20,a|0,c|0,f-c|0,s|0)|0;v=x;x=0;if(v&1){u=19;break}if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){u=18;break}switch(a|0){case -1:{u=25;break f}case -2:{u=26;break f}case 0:{c=c+1|0;break}default:c=c+a|0}a=(k[h>>2]|0)+4|0;k[h>>2]=a;if((c|0)==(k[e>>2]|0)){q=c;break e}}if((u|0)==18){v=Wa(0)|0;oc(v)}else if((u|0)==19){c=Wa()|0;if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}else if((u|0)==25){k[e>>2]=c;o=2;break b}else if((u|0)==26){k[e>>2]=c;o=1;break b}}else q=c;while(0);k[e>>2]=q;o=(q|0)!=(d|0)&1;break}else if((u|0)==31){c=k[e>>2]|0;u=47;break}else if((u|0)==37){v=Wa(0)|0;oc(v)}else if((u|0)==38){c=Wa()|0;if((j|0)!=0?(x=0,ta(75,j|0)|0,v=x,x=0,v&1):0){v=Wa(0)|0;oc(v)}fb(c|0)}}else u=47;while(0);if((u|0)==47)o=(c|0)!=(d|0)&1;r=t;return o|0}function Gt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=r;r=r+16|0;f=g;k[e>>2]=c;c=Ak(k[a+8>>2]|0)|0;x=0;a=va(34,f|0,0,b|0)|0;b=x;x=0;if(b&1){f=Wa()|0;if((c|0)!=0?(x=0,ta(75,c|0)|0,g=x,x=0,g&1):0){g=Wa(0)|0;oc(g)}fb(f|0)}if((c|0)!=0?(x=0,ta(75,c|0)|0,b=x,x=0,b&1):0){b=Wa(0)|0;oc(b)}switch(a|0){case 0:case -1:{f=2;break}default:{a=a+-1|0;if(a>>>0<=(d-(k[e>>2]|0)|0)>>>0)if(!a)f=0;else while(1){b=i[f>>0]|0;d=k[e>>2]|0;k[e>>2]=d+1;i[d>>0]=b;a=a+-1|0;if(!a){f=0;break}else f=f+1|0}else f=1}}r=g;return f|0}function Ht(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;b=a+8|0;x=0;c=ta(75,k[b>>2]|0)|0;d=x;x=0;do if(d&1)e=16;else{x=0;d=va(35,0,0,4)|0;a=x;x=0;if(a&1){a=Wa(0)|0;if(!c)break;x=0;ta(75,c|0)|0;g=x;x=0;if(!(g&1))break;g=Wa(0)|0;oc(g)}if((c|0)!=0?(x=0,ta(75,c|0)|0,g=x,x=0,g&1):0){g=Wa(0)|0;oc(g)}if(!d){a=k[b>>2]|0;if(a){x=0;a=ta(75,a|0)|0;g=x;x=0;if(g&1){e=16;break}if((a|0)!=0?(x=0,ta(75,a|0)|0,g=x,x=0,g&1):0){g=Wa(0)|0;oc(g)}else f=0}else f=1}else f=-1;return f|0}while(0);if((e|0)==16)a=Wa(0)|0;oc(a);return 0}function It(a){a=a|0;return 0}function Jt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0;j=d;i=a+8|0;a:do if((c|0)==(d|0)|(e|0)==0)a=0;else{a=0;h=0;while(1){g=Ak(k[i>>2]|0)|0;x=0;f=va(36,c|0,j-c|0,b|0)|0;n=x;x=0;if(n&1){m=g;break}if((g|0)!=0?(x=0,ta(75,g|0)|0,n=x,x=0,n&1):0){l=5;break}switch(f|0){case -2:case -1:break a;case 0:{c=c+1|0;f=1;break}default:c=c+f|0}a=f+a|0;h=h+1|0;if((c|0)==(d|0)|h>>>0>=e>>>0)break a}if((l|0)==5){n=Wa(0)|0;oc(n)}a=Wa()|0;if((m|0)!=0?(x=0,ta(75,m|0)|0,n=x,x=0,n&1):0){n=Wa(0)|0;oc(n)}fb(a|0)}while(0);return a|0}function Kt(a){a=a|0;var b=0,c=0;a=k[a+8>>2]|0;if(a){x=0;a=ta(75,a|0)|0;c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)}if((a|0)!=0?(x=0,ta(75,a|0)|0,c=x,x=0,c&1):0){c=Wa(0)|0;oc(c)}else b=4}else b=1;return b|0}function Lt(a){a=a|0;mj(a);return}function Mt(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;a=r;r=r+16|0;i=a+4|0;b=a;k[i>>2]=c;k[b>>2]=f;g=Rv(c,d,i,f,g,b,1114111,0)|0;k[e>>2]=k[i>>2];k[h>>2]=k[b>>2];r=a;return g|0}function Nt(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;a=r;r=r+16|0;i=a+4|0;b=a;k[i>>2]=c;k[b>>2]=f;g=Sv(c,d,i,f,g,b,1114111,0)|0;k[e>>2]=k[i>>2];k[h>>2]=k[b>>2];r=a;return g|0}function Ot(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;k[e>>2]=c;return 3}function Pt(a){a=a|0;return 0}function Qt(a){a=a|0;return 0}function Rt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Tv(c,d,e,1114111,0)|0}function St(a){a=a|0;return 4}function Tt(a){a=a|0;mj(a);return}function Ut(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;a=r;r=r+16|0;i=a+4|0;b=a;k[i>>2]=c;k[b>>2]=f;g=Uv(c,d,i,f,g,b,1114111,0)|0;k[e>>2]=k[i>>2];k[h>>2]=k[b>>2];r=a;return g|0}function Vt(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;a=r;r=r+16|0;i=a+4|0;b=a;k[i>>2]=c;k[b>>2]=f;g=Vv(c,d,i,f,g,b,1114111,0)|0;k[e>>2]=k[i>>2];k[h>>2]=k[b>>2];r=a;return g|0}function Wt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;k[e>>2]=c;return 3}function Xt(a){a=a|0;return 0}function Yt(a){a=a|0;return 0}function Zt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Wv(c,d,e,1114111,0)|0}function _t(a){a=a|0;return 4}function $t(a){a=a|0;mj(a);return}function au(a){a=a|0;mj(a);return}function bu(a,b){a=a|0;b=b|0;k[a+4>>2]=b+-1;k[a>>2]=44384;i[a+8>>0]=46;i[a+9>>0]=44;a=a+12|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function cu(a,b){a=a|0;b=b|0;k[a+4>>2]=b+-1;k[a>>2]=44424;k[a+8>>2]=46;k[a+12>>2]=44;a=a+16|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;return}function du(a){a=a|0;k[a>>2]=44384;Sm(a+12|0);return}function eu(a){a=a|0;du(a);mj(a);return}function fu(a){a=a|0;k[a>>2]=44424;Sm(a+16|0);return}function gu(a){a=a|0;fu(a);mj(a);return}function hu(a){a=a|0;return i[a+8>>0]|0}function iu(a){a=a|0;return k[a+8>>2]|0}function ju(a){a=a|0;return i[a+9>>0]|0}function ku(a){a=a|0;return k[a+12>>2]|0}function lu(a,b){a=a|0;b=b|0;Pm(a,b+12|0);return}function mu(a,b){a=a|0;b=b|0;Pm(a,b+16|0);return}function nu(a,b){a=a|0;b=b|0;Qm(a,59024,4);return}function ou(a,b){a=a|0;b=b|0;cn(a,44996,zl(44996)|0);return}function pu(a,b){a=a|0;b=b|0;Qm(a,59029,5);return}function qu(a,b){a=a|0;b=b|0;cn(a,45016,zl(45016)|0);return}function ru(a){a=a|0;switch(k[a+4>>2]&74|0){case 64:{a=8;break}case 8:{a=16;break}case 0:{a=0;break}default:a=10}return a|0}function su(a){a=a|0;do if((i[2464]|0)==0?(Qa(2464)|0)!=0:0){if((i[2472]|0)==0?(Qa(2472)|0)!=0:0){a=45040;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=45208);tb(193,0,w|0)|0;Ya(2472)}x=0;Aa(41,45040,59035)|0;a=x;x=0;if(((((((((((((!(a&1)?(x=0,Aa(41,45052,59042)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45064,59049)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45076,59057)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45088,59067)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45100,59076)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45112,59083)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45124,59092)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45136,59096)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45148,59100)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45160,59104)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45172,59108)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45184,59112)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45196,59116)|0,a=x,x=0,!(a&1)):0){k[11302]=45040;Ya(2464);break}a=Wa()|0;Bb(2464);fb(a|0)}while(0);return k[11302]|0}function tu(a){a=a|0;do if((i[2480]|0)==0?(Qa(2480)|0)!=0:0){if((i[2488]|0)==0?(Qa(2488)|0)!=0:0){a=45212;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=45380);tb(194,0,w|0)|0;Ya(2488)}x=0;Aa(42,45212,45380)|0;a=x;x=0;if(((((((((((((!(a&1)?(x=0,Aa(42,45224,45408)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45236,45436)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45248,45468)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45260,45508)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45272,45544)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45284,45572)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45296,45608)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45308,45624)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45320,45640)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45332,45656)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45344,45672)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45356,45688)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,45368,45704)|0,a=x,x=0,!(a&1)):0){k[11430]=45212;Ya(2480);break}a=Wa()|0;Bb(2480);fb(a|0)}while(0);return k[11430]|0}function uu(a){a=a|0;a:do if((i[2496]|0)==0?(Qa(2496)|0)!=0:0){if((i[2504]|0)==0?(Qa(2504)|0)!=0:0){a=45724;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=46012);tb(195,0,w|0)|0;Ya(2504)}x=0;Aa(41,45724,59120)|0;a=x;x=0;do if((((((((((((((!(a&1)?(x=0,Aa(41,45736,59128)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45748,59137)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45760,59143)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45772,59149)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45784,59153)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45796,59158)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45808,59163)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45820,59170)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45832,59180)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45844,59188)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45856,59197)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45868,59206)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45880,59210)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(41,45892,59214)|0,a=x,x=0,!(a&1)):0){x=0;Aa(41,45904,59218)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45916,59149)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45928,59222)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45940,59226)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45952,59230)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45964,59234)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45976,59238)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,45988,59242)|0;a=x;x=0;if(a&1)break;x=0;Aa(41,46e3,59246)|0;a=x;x=0;if(a&1)break;k[11503]=45724;Ya(2496);break a}while(0);a=Wa()|0;Bb(2496);fb(a|0)}while(0);return k[11503]|0}function vu(a){a=a|0;a:do if((i[2512]|0)==0?(Qa(2512)|0)!=0:0){if((i[2520]|0)==0?(Qa(2520)|0)!=0:0){a=46016;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=46304);tb(196,0,w|0)|0;Ya(2520)}x=0;Aa(42,46016,46304)|0;a=x;x=0;do if((((((((((((((!(a&1)?(x=0,Aa(42,46028,46336)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46040,46372)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46052,46396)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46064,46420)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46076,46436)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46088,46456)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46100,46476)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46112,46504)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46124,46544)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46136,46576)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46148,46612)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46160,46648)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46172,46664)|0,a=x,x=0,!(a&1)):0)?(x=0,Aa(42,46184,46680)|0,a=x,x=0,!(a&1)):0){x=0;Aa(42,46196,46696)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46208,46420)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46220,46712)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46232,46728)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46244,46744)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46256,46760)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46268,46776)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46280,46792)|0;a=x;x=0;if(a&1)break;x=0;Aa(42,46292,46808)|0;a=x;x=0;if(a&1)break;k[11706]=46016;Ya(2512);break a}while(0);a=Wa()|0;Bb(2512);fb(a|0)}while(0);return k[11706]|0}function wu(a){a=a|0;do if((i[2528]|0)==0?(Qa(2528)|0)!=0:0){if((i[2536]|0)==0?(Qa(2536)|0)!=0:0){a=46828;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=47116);tb(197,0,w|0)|0;Ya(2536)}x=0;Aa(41,46828,59250)|0;a=x;x=0;if(!(a&1)?(x=0,Aa(41,46840,59253)|0,a=x,x=0,!(a&1)):0){k[11779]=46828;Ya(2528);break}a=Wa()|0;Bb(2528);fb(a|0)}while(0);return k[11779]|0}function xu(a){a=a|0;do if((i[2544]|0)==0?(Qa(2544)|0)!=0:0){if((i[2552]|0)==0?(Qa(2552)|0)!=0:0){a=47120;do{k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;a=a+12|0}while((a|0)!=47408);tb(198,0,w|0)|0;Ya(2552)}x=0;Aa(42,47120,47408)|0;a=x;x=0;if(!(a&1)?(x=0,Aa(42,47132,47420)|0,a=x,x=0,!(a&1)):0){k[11858]=47120;Ya(2544);break}a=Wa()|0;Bb(2544);fb(a|0)}while(0);return k[11858]|0}function yu(a){a=a|0;do if((i[2560]|0)==0?(Qa(2560)|0)!=0:0){x=0;Fa(5,47436,59256,8);a=x;x=0;if(a&1){a=Wa()|0;Bb(2560);fb(a|0)}else{tb(199,47436,w|0)|0;Ya(2560);break}}while(0);return 47436}function zu(a){a=a|0;var b=0;do if((i[2568]|0)==0?(Qa(2568)|0)!=0:0){x=0;a=ta(76,47448)|0;b=x;x=0;if(!(b&1)?(x=0,Fa(15,47484,47448,a|0),b=x,x=0,!(b&1)):0){tb(200,47484,w|0)|0;Ya(2568);break}b=Wa()|0;Bb(2568);fb(b|0)}while(0);return 47484}function Au(a){a=a|0;do if((i[2576]|0)==0?(Qa(2576)|0)!=0:0){x=0;Fa(5,47496,59265,8);a=x;x=0;if(a&1){a=Wa()|0;Bb(2576);fb(a|0)}else{tb(199,47496,w|0)|0;Ya(2576);break}}while(0);return 47496}function Bu(a){a=a|0;var b=0;do if((i[2584]|0)==0?(Qa(2584)|0)!=0:0){x=0;a=ta(76,47508)|0;b=x;x=0;if(!(b&1)?(x=0,Fa(15,47544,47508,a|0),b=x,x=0,!(b&1)):0){tb(200,47544,w|0)|0;Ya(2584);break}b=Wa()|0;Bb(2584);fb(b|0)}while(0);return 47544}function Cu(a){a=a|0;do if((i[2592]|0)==0?(Qa(2592)|0)!=0:0){x=0;Fa(5,47556,59274,20);a=x;x=0;if(a&1){a=Wa()|0;Bb(2592);fb(a|0)}else{tb(199,47556,w|0)|0;Ya(2592);break}}while(0);return 47556}function Du(a){a=a|0;var b=0;do if((i[2600]|0)==0?(Qa(2600)|0)!=0:0){x=0;a=ta(76,47568)|0;b=x;x=0;if(!(b&1)?(x=0,Fa(15,47652,47568,a|0),b=x,x=0,!(b&1)):0){tb(200,47652,w|0)|0;Ya(2600);break}b=Wa()|0;Bb(2600);fb(b|0)}while(0);return 47652}function Eu(a){a=a|0;do if((i[2608]|0)==0?(Qa(2608)|0)!=0:0){x=0;Fa(5,47664,59295,11);a=x;x=0;if(a&1){a=Wa()|0;Bb(2608);fb(a|0)}else{tb(199,47664,w|0)|0;Ya(2608);break}}while(0);return 47664}function Fu(a){a=a|0;var b=0;do if((i[2616]|0)==0?(Qa(2616)|0)!=0:0){x=0;a=ta(76,47676)|0;b=x;x=0;if(!(b&1)?(x=0,Fa(15,47724,47676,a|0),b=x,x=0,!(b&1)):0){tb(200,47724,w|0)|0;Ya(2616);break}b=Wa()|0;Bb(2616);fb(b|0)}while(0);return 47724}function Gu(a){a=a|0;var b=0,c=0,d=0;k[a>>2]=44304;a=a+8|0;b=k[a>>2]|0;x=0;c=Da(3)|0;d=x;x=0;do if(!(d&1)){if((b|0)!=(c|0)?(x=0,qa(188,k[a>>2]|0),d=x,x=0,d&1):0)break;return}while(0);d=Wa(0)|0;oc(d)}function Hu(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0;z=r;r=r+112|0;j=z;n=(d-c|0)/12|0;do if(n>>>0>100){j=Pl(n)|0;if((j|0)==0?(x=0,Ga(6),y=x,x=0,y&1):0){h=0;q=6;break}h=j;q=11}else{h=0;q=11}while(0);a:do if((q|0)==11){if((c|0)==(d|0))m=0;else{q=c;o=0;p=j;while(1){m=i[q>>0]|0;if(!(m&1))m=(m&255)>>>1;else m=k[q+4>>2]|0;if(!m){i[p>>0]=2;m=o+1|0;n=n+-1|0}else{i[p>>0]=1;m=o}q=q+12|0;if((q|0)==(d|0))break;else{o=m;p=p+1|0}}}w=(c|0)==(d|0);y=(c|0)==(d|0);v=0;s=m;b:while(1){m=k[a>>2]|0;do if(m){if((k[m+12>>2]|0)==(k[m+16>>2]|0)){x=0;m=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;u=x;x=0;if(u&1){q=5;break b}if((m|0)==-1){k[a>>2]=0;m=0;break}else{m=k[a>>2]|0;break}}}else m=0;while(0);q=(m|0)==0;o=k[b>>2]|0;if(o){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;m=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;u=x;x=0;if(u&1){q=5;break}if((m|0)==-1){k[b>>2]=0;o=0}}}else o=0;p=(o|0)==0;m=k[a>>2]|0;if(!((n|0)!=0&(q^p))){q=64;break}o=k[m+12>>2]|0;if((o|0)==(k[m+16>>2]|0)){x=0;m=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;u=x;x=0;if(u&1){q=5;break}}else m=l[o>>0]|0;m=m&255;if(!g){x=0;m=Aa(k[(k[e>>2]|0)+12>>2]|0,e|0,m|0)|0;u=x;x=0;if(u&1){q=5;break}}u=v+1|0;if(w){m=0;q=s}else{p=0;t=c;q=s;s=j;while(1){do if((i[s>>0]|0)==1){if(!(i[t>>0]&1))o=t+1|0;else o=k[t+8>>2]|0;o=i[o+v>>0]|0;if(!g){x=0;o=Aa(k[(k[e>>2]|0)+12>>2]|0,e|0,o|0)|0;A=x;x=0;if(A&1){q=4;break b}}if(m<<24>>24!=o<<24>>24){i[s>>0]=0;o=p;n=n+-1|0;break}o=i[t>>0]|0;if(!(o&1))o=(o&255)>>>1;else o=k[t+4>>2]|0;if((o|0)==(u|0)){i[s>>0]=2;o=1;q=q+1|0;n=n+-1|0}else o=1}else o=p;while(0);t=t+12|0;if((t|0)==(d|0)){m=o;break}else{p=o;s=s+1|0}}}if(!m){v=u;s=q;continue}m=k[a>>2]|0;o=m+12|0;p=k[o>>2]|0;if((p|0)==(k[m+16>>2]|0)){x=0;ta(k[(k[m>>2]|0)+40>>2]|0,m|0)|0;A=x;x=0;if(A&1){q=5;break}}else k[o>>2]=p+1;if((q+n|0)>>>0<2|y){v=u;s=q;continue}else{m=c;p=q;q=j}while(1){if((i[q>>0]|0)==2){o=i[m>>0]|0;if(!(o&1))o=(o&255)>>>1;else o=k[m+4>>2]|0;if((o|0)!=(u|0)){i[q>>0]=0;p=p+-1|0}}m=m+12|0;if((m|0)==(d|0)){v=u;s=p;continue b}else q=q+1|0}}if((q|0)==4){c=Wa()|0;break}else if((q|0)==5){c=Wa()|0;break}else if((q|0)==64){do if(m){if((k[m+12>>2]|0)==(k[m+16>>2]|0)){x=0;m=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;A=x;x=0;if(A&1){q=6;break a}if((m|0)==-1){k[a>>2]=0;m=0;break}else{m=k[a>>2]|0;break}}}else m=0;while(0);n=(m|0)==0;do if(!p){if((k[o+12>>2]|0)==(k[o+16>>2]|0)){x=0;m=ta(k[(k[o>>2]|0)+36>>2]|0,o|0)|0;A=x;x=0;if(A&1){q=6;break a}if((m|0)==-1){k[b>>2]=0;q=76;break}}if(!n)q=77}else q=76;while(0);if((q|0)==76?n:0)q=77;if((q|0)==77)k[f>>2]=k[f>>2]|2;c:do if((c|0)==(d|0))q=81;else while(1){if((i[j>>0]|0)==2)break c;c=c+12|0;if((c|0)==(d|0)){q=81;break}else j=j+1|0}while(0);if((q|0)==81){k[f>>2]=k[f>>2]|4;c=d}if(h)Ql(h);r=z;return c|0}}while(0);if((q|0)==6)c=Wa()|0;if(h)Ql(h);fb(c|0);return 0}function Iu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+240|0;s=A+202|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;up(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){D=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;h=(a|0)==0;g=k[c>>2]|0;do if(g){if((k[g+12>>2]|0)!=(k[g+16>>2]|0))if(h)break;else break b;x=0;j=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;m=x;x=0;if(m&1){D=24;break b}if((j|0)!=-1)if(h)break;else break b;else{k[c>>2]=0;D=16;break}}else D=16;while(0);if((D|0)==16){D=0;if(h){g=0;break}else g=0}h=i[B>>0]|0;h=(h&1)==0?(h&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(d+h|0)){x=0;Fa(8,B|0,h<<1|0,0);m=x;x=0;if(m&1){D=24;break}if(!(i[B>>0]&1))d=10;else d=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,d|0,0);m=x;x=0;if(m&1){D=24;break}d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d+h}j=a+12|0;h=k[j>>2]|0;m=a+16|0;if((h|0)==(k[m>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}}else h=l[h>>0]|0;if(ep(h&255,t,d,u,v,n,C,y,z,s)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}else continue}else{k[j>>2]=g+1;continue}}if((D|0)==24){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;d=Ea(21,d|0,k[u>>2]|0,e|0,t|0)|0;E=x;x=0;if(!(E&1)){k[f>>2]=d;cs(C,y,k[z>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;E=x;x=0;if(E&1){D=25;break a}if((a|0)==-1){k[c>>2]=0;D=49;break}}if(!d)D=50}else D=49;while(0);if((D|0)==49?d:0)D=50;if((D|0)==50)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=25}else D=25;while(0);if((D|0)==25)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Ju(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+240|0;s=A+202|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;up(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){D=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;g=(a|0)==0;h=k[c>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(g)break;else break b;x=0;j=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;m=x;x=0;if(m&1){D=24;break b}if((j|0)!=-1)if(g)break;else break b;else{k[c>>2]=0;D=16;break}}else D=16;while(0);if((D|0)==16){D=0;if(g){h=0;break}else h=0}g=i[B>>0]|0;g=(g&1)==0?(g&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(d+g|0)){x=0;Fa(8,B|0,g<<1|0,0);m=x;x=0;if(m&1){D=24;break}if(!(i[B>>0]&1))d=10;else d=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,d|0,0);m=x;x=0;if(m&1){D=24;break}d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d+g}j=a+12|0;g=k[j>>2]|0;m=a+16|0;if((g|0)==(k[m>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}}else g=l[g>>0]|0;if(ep(g&255,t,d,u,v,n,C,y,z,s)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}else continue}else{k[j>>2]=g+1;continue}}if((D|0)==24){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;d=Ea(22,d|0,k[u>>2]|0,e|0,t|0)|0;g=M;E=x;x=0;if(!(E&1)){E=f;k[E>>2]=d;k[E+4>>2]=g;cs(C,y,k[z>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;E=x;x=0;if(E&1){D=25;break a}if((a|0)==-1){k[c>>2]=0;D=49;break}}if(!d)D=50}else D=49;while(0);if((D|0)==49?d:0)D=50;if((D|0)==50)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=25}else D=25;while(0);if((D|0)==25)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Ku(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;B=r;r=r+240|0;t=B+202|0;g=B+200|0;D=B+24|0;C=B+12|0;v=B+8|0;z=B+40|0;A=B+4|0;w=B;u=ru(d)|0;up(D,d,t,g);k[C>>2]=0;k[C+4>>2]=0;k[C+8>>2]=0;if(!(i[C>>0]&1))a=10;else a=(k[C>>2]&-2)+-1|0;x=0;Fa(8,C|0,a|0,0);s=x;x=0;a:do if(!(s&1)){p=C+8|0;q=C+1|0;d=(i[C>>0]&1)==0?q:k[p>>2]|0;k[v>>2]=d;k[A>>2]=z;k[w>>2]=0;s=C+4|0;o=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;n=x;x=0;if(n&1){E=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;h=(a|0)==0;g=k[c>>2]|0;do if(g){if((k[g+12>>2]|0)!=(k[g+16>>2]|0))if(h)break;else break b;x=0;m=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;n=x;x=0;if(n&1){E=24;break b}if((m|0)!=-1)if(h)break;else break b;else{k[c>>2]=0;E=16;break}}else E=16;while(0);if((E|0)==16){E=0;if(h){g=0;break}else g=0}h=i[C>>0]|0;h=(h&1)==0?(h&255)>>>1:k[s>>2]|0;if((k[v>>2]|0)==(d+h|0)){x=0;Fa(8,C|0,h<<1|0,0);n=x;x=0;if(n&1){E=24;break}if(!(i[C>>0]&1))d=10;else d=(k[C>>2]&-2)+-1|0;x=0;Fa(8,C|0,d|0,0);n=x;x=0;if(n&1){E=24;break}d=(i[C>>0]&1)==0?q:k[p>>2]|0;k[v>>2]=d+h}m=a+12|0;h=k[m>>2]|0;n=a+16|0;if((h|0)==(k[n>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;F=x;x=0;if(F&1){E=24;break}}else h=l[h>>0]|0;if(ep(h&255,u,d,v,w,o,D,z,A,t)|0)break;g=k[m>>2]|0;if((g|0)==(k[n>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;F=x;x=0;if(F&1){E=24;break}else continue}else{k[m>>2]=g+1;continue}}if((E|0)==24){a=Wa()|0;break}F=i[D>>0]|0;if((((F&1)==0?(F&255)>>>1:k[D+4>>2]|0)|0)!=0?(y=k[A>>2]|0,(y-z|0)<160):0){F=k[w>>2]|0;k[A>>2]=y+4;k[y>>2]=F}x=0;d=Ea(23,d|0,k[v>>2]|0,e|0,u|0)|0;F=x;x=0;if(!(F&1)){j[f>>1]=d;cs(D,z,k[A>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;F=x;x=0;if(F&1){E=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;F=x;x=0;if(F&1){E=25;break a}if((a|0)==-1){k[c>>2]=0;E=49;break}}if(!d)E=50}else E=49;while(0);if((E|0)==49?d:0)E=50;if((E|0)==50)k[e>>2]=k[e>>2]|2;F=k[b>>2]|0;Sm(C);Sm(D);r=B;return F|0}else E=25}else E=25;while(0);if((E|0)==25)a=Wa()|0;Sm(C);Sm(D);fb(a|0);return 0}function Lu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+240|0;s=A+202|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;up(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){D=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;h=(a|0)==0;g=k[c>>2]|0;do if(g){if((k[g+12>>2]|0)!=(k[g+16>>2]|0))if(h)break;else break b;x=0;j=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;m=x;x=0;if(m&1){D=24;break b}if((j|0)!=-1)if(h)break;else break b;else{k[c>>2]=0;D=16;break}}else D=16;while(0);if((D|0)==16){D=0;if(h){g=0;break}else g=0}h=i[B>>0]|0;h=(h&1)==0?(h&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(d+h|0)){x=0;Fa(8,B|0,h<<1|0,0);m=x;x=0;if(m&1){D=24;break}if(!(i[B>>0]&1))d=10;else d=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,d|0,0);m=x;x=0;if(m&1){D=24;break}d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d+h}j=a+12|0;h=k[j>>2]|0;m=a+16|0;if((h|0)==(k[m>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}}else h=l[h>>0]|0;if(ep(h&255,t,d,u,v,n,C,y,z,s)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}else continue}else{k[j>>2]=g+1;continue}}if((D|0)==24){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;d=Ea(24,d|0,k[u>>2]|0,e|0,t|0)|0;E=x;x=0;if(!(E&1)){k[f>>2]=d;cs(C,y,k[z>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;E=x;x=0;if(E&1){D=25;break a}if((a|0)==-1){k[c>>2]=0;D=49;break}}if(!d)D=50}else D=49;while(0);if((D|0)==49?d:0)D=50;if((D|0)==50)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=25}else D=25;while(0);if((D|0)==25)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Mu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+240|0;s=A+202|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;up(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){D=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;h=(a|0)==0;g=k[c>>2]|0;do if(g){if((k[g+12>>2]|0)!=(k[g+16>>2]|0))if(h)break;else break b;x=0;j=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;m=x;x=0;if(m&1){D=24;break b}if((j|0)!=-1)if(h)break;else break b;else{k[c>>2]=0;D=16;break}}else D=16;while(0);if((D|0)==16){D=0;if(h){g=0;break}else g=0}h=i[B>>0]|0;h=(h&1)==0?(h&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(d+h|0)){x=0;Fa(8,B|0,h<<1|0,0);m=x;x=0;if(m&1){D=24;break}if(!(i[B>>0]&1))d=10;else d=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,d|0,0);m=x;x=0;if(m&1){D=24;break}d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d+h}j=a+12|0;h=k[j>>2]|0;m=a+16|0;if((h|0)==(k[m>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}}else h=l[h>>0]|0;if(ep(h&255,t,d,u,v,n,C,y,z,s)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}else continue}else{k[j>>2]=g+1;continue}}if((D|0)==24){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;d=Ea(25,d|0,k[u>>2]|0,e|0,t|0)|0;E=x;x=0;if(!(E&1)){k[f>>2]=d;cs(C,y,k[z>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;E=x;x=0;if(E&1){D=25;break a}if((a|0)==-1){k[c>>2]=0;D=49;break}}if(!d)D=50}else D=49;while(0);if((D|0)==49?d:0)D=50;if((D|0)==50)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=25}else D=25;while(0);if((D|0)==25)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Nu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+240|0;s=A+202|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;up(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=i[g>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;m=x;x=0;if(m&1){D=24;break}if((g|0)==-1){k[b>>2]=0;a=0}}}else a=0;g=(a|0)==0;h=k[c>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(g)break;else break b;x=0;j=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;m=x;x=0;if(m&1){D=24;break b}if((j|0)!=-1)if(g)break;else break b;else{k[c>>2]=0;D=16;break}}else D=16;while(0);if((D|0)==16){D=0;if(g){h=0;break}else h=0}g=i[B>>0]|0;g=(g&1)==0?(g&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(d+g|0)){x=0;Fa(8,B|0,g<<1|0,0);m=x;x=0;if(m&1){D=24;break}if(!(i[B>>0]&1))d=10;else d=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,d|0,0);m=x;x=0;if(m&1){D=24;break}d=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=d+g}j=a+12|0;g=k[j>>2]|0;m=a+16|0;if((g|0)==(k[m>>2]|0)){x=0;g=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}}else g=l[g>>0]|0;if(ep(g&255,t,d,u,v,n,C,y,z,s)|0)break;g=k[j>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=24;break}else continue}else{k[j>>2]=g+1;continue}}if((D|0)==24){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;d=Ea(26,d|0,k[u>>2]|0,e|0,t|0)|0;g=M;E=x;x=0;if(!(E&1)){E=f;k[E>>2]=d;k[E+4>>2]=g;cs(C,y,k[z>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;E=x;x=0;if(E&1){D=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;E=x;x=0;if(E&1){D=25;break a}if((a|0)==-1){k[c>>2]=0;D=49;break}}if(!d)D=50}else D=49;while(0);if((D|0)==49?d:0)D=50;if((D|0)==50)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=25}else D=25;while(0);if((D|0)==25)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Ou(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,m=0,n=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;E=r;r=r+240|0;v=E+208|0;h=E+203|0;j=E+202|0;G=E+24|0;F=E+12|0;y=E+8|0;C=E+40|0;D=E+4|0;z=E;A=E+201|0;w=E+200|0;vp(G,d,v,h,j);k[F>>2]=0;k[F+4>>2]=0;k[F+8>>2]=0;if(!(i[F>>0]&1))a=10;else a=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,a|0,0);u=x;x=0;a:do if(!(u&1)){s=F+8|0;t=F+1|0;d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d;k[D>>2]=C;k[z>>2]=0;i[A>>0]=1;i[w>>0]=69;u=F+4|0;q=i[h>>0]|0;p=i[j>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;n=x;x=0;if(n&1){H=24;break}if((h|0)==-1){k[b>>2]=0;a=0}}}else a=0;j=(a|0)==0;h=k[c>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(j)break;else break b;x=0;m=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;n=x;x=0;if(n&1){H=24;break b}if((m|0)!=-1)if(j)break;else break b;else{k[c>>2]=0;H=16;break}}else H=16;while(0);if((H|0)==16){H=0;if(j){h=0;break}else h=0}j=i[F>>0]|0;j=(j&1)==0?(j&255)>>>1:k[u>>2]|0;if((k[y>>2]|0)==(d+j|0)){x=0;Fa(8,F|0,j<<1|0,0);n=x;x=0;if(n&1){H=24;break}if(!(i[F>>0]&1))d=10;else d=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,d|0,0);n=x;x=0;if(n&1){H=24;break}d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d+j}m=a+12|0;j=k[m>>2]|0;n=a+16|0;if((j|0)==(k[n>>2]|0)){x=0;j=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}}else j=l[j>>0]|0;if(wp(j&255,A,w,d,y,q,p,G,C,D,z,v)|0)break;h=k[m>>2]|0;if((h|0)==(k[n>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}else continue}else{k[m>>2]=h+1;continue}}if((H|0)==24){a=Wa()|0;break}I=i[G>>0]|0;if(!((i[A>>0]|0)==0?1:(((I&1)==0?(I&255)>>>1:k[G+4>>2]|0)|0)==0)?(B=k[D>>2]|0,(B-C|0)<160):0){I=k[z>>2]|0;k[D>>2]=B+4;k[B>>2]=I}x=0;g=+Ca(1,d|0,k[y>>2]|0,e|0);I=x;x=0;if(!(I&1)){o[f>>2]=g;cs(G,C,k[D>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;I=x;x=0;if(I&1){H=25;break a}if((a|0)==-1){k[c>>2]=0;H=49;break}}if(!d)H=50}else H=49;while(0);if((H|0)==49?d:0)H=50;if((H|0)==50)k[e>>2]=k[e>>2]|2;I=k[b>>2]|0;Sm(F);Sm(G);r=E;return I|0}else H=25}else H=25;while(0);if((H|0)==25)a=Wa()|0;Sm(F);Sm(G);fb(a|0);return 0}function Pu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;E=r;r=r+240|0;v=E+208|0;h=E+203|0;j=E+202|0;G=E+24|0;F=E+12|0;y=E+8|0;C=E+40|0;D=E+4|0;z=E;A=E+201|0;w=E+200|0;vp(G,d,v,h,j);k[F>>2]=0;k[F+4>>2]=0;k[F+8>>2]=0;if(!(i[F>>0]&1))a=10;else a=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,a|0,0);u=x;x=0;a:do if(!(u&1)){s=F+8|0;t=F+1|0;d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d;k[D>>2]=C;k[z>>2]=0;i[A>>0]=1;i[w>>0]=69;u=F+4|0;q=i[h>>0]|0;o=i[j>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;n=x;x=0;if(n&1){H=24;break}if((h|0)==-1){k[b>>2]=0;a=0}}}else a=0;j=(a|0)==0;h=k[c>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(j)break;else break b;x=0;m=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;n=x;x=0;if(n&1){H=24;break b}if((m|0)!=-1)if(j)break;else break b;else{k[c>>2]=0;H=16;break}}else H=16;while(0);if((H|0)==16){H=0;if(j){h=0;break}else h=0}j=i[F>>0]|0;j=(j&1)==0?(j&255)>>>1:k[u>>2]|0;if((k[y>>2]|0)==(d+j|0)){x=0;Fa(8,F|0,j<<1|0,0);n=x;x=0;if(n&1){H=24;break}if(!(i[F>>0]&1))d=10;else d=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,d|0,0);n=x;x=0;if(n&1){H=24;break}d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d+j}m=a+12|0;j=k[m>>2]|0;n=a+16|0;if((j|0)==(k[n>>2]|0)){x=0;j=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}}else j=l[j>>0]|0;if(wp(j&255,A,w,d,y,q,o,G,C,D,z,v)|0)break;h=k[m>>2]|0;if((h|0)==(k[n>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}else continue}else{k[m>>2]=h+1;continue}}if((H|0)==24){a=Wa()|0;break}I=i[G>>0]|0;if(!((i[A>>0]|0)==0?1:(((I&1)==0?(I&255)>>>1:k[G+4>>2]|0)|0)==0)?(B=k[D>>2]|0,(B-C|0)<160):0){I=k[z>>2]|0;k[D>>2]=B+4;k[B>>2]=I}x=0;g=+Ca(2,d|0,k[y>>2]|0,e|0);I=x;x=0;if(!(I&1)){p[f>>3]=g;cs(G,C,k[D>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;I=x;x=0;if(I&1){H=25;break a}if((a|0)==-1){k[c>>2]=0;H=49;break}}if(!d)H=50}else H=49;while(0);if((H|0)==49?d:0)H=50;if((H|0)==50)k[e>>2]=k[e>>2]|2;I=k[b>>2]|0;Sm(F);Sm(G);r=E;return I|0}else H=25}else H=25;while(0);if((H|0)==25)a=Wa()|0;Sm(F);Sm(G);fb(a|0);return 0}function Qu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;E=r;r=r+240|0;v=E+208|0;h=E+203|0;j=E+202|0;G=E+24|0;F=E+12|0;y=E+8|0;C=E+40|0;D=E+4|0;z=E;A=E+201|0;w=E+200|0;vp(G,d,v,h,j);k[F>>2]=0;k[F+4>>2]=0;k[F+8>>2]=0;if(!(i[F>>0]&1))a=10;else a=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,a|0,0);u=x;x=0;a:do if(!(u&1)){s=F+8|0;t=F+1|0;d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d;k[D>>2]=C;k[z>>2]=0;i[A>>0]=1;i[w>>0]=69;u=F+4|0;q=i[h>>0]|0;o=i[j>>0]|0;a=k[b>>2]|0;b:while(1){if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;h=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;n=x;x=0;if(n&1){H=24;break}if((h|0)==-1){k[b>>2]=0;a=0}}}else a=0;j=(a|0)==0;h=k[c>>2]|0;do if(h){if((k[h+12>>2]|0)!=(k[h+16>>2]|0))if(j)break;else break b;x=0;m=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;n=x;x=0;if(n&1){H=24;break b}if((m|0)!=-1)if(j)break;else break b;else{k[c>>2]=0;H=16;break}}else H=16;while(0);if((H|0)==16){H=0;if(j){h=0;break}else h=0}j=i[F>>0]|0;j=(j&1)==0?(j&255)>>>1:k[u>>2]|0;if((k[y>>2]|0)==(d+j|0)){x=0;Fa(8,F|0,j<<1|0,0);n=x;x=0;if(n&1){H=24;break}if(!(i[F>>0]&1))d=10;else d=(k[F>>2]&-2)+-1|0;x=0;Fa(8,F|0,d|0,0);n=x;x=0;if(n&1){H=24;break}d=(i[F>>0]&1)==0?t:k[s>>2]|0;k[y>>2]=d+j}m=a+12|0;j=k[m>>2]|0;n=a+16|0;if((j|0)==(k[n>>2]|0)){x=0;j=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}}else j=l[j>>0]|0;if(wp(j&255,A,w,d,y,q,o,G,C,D,z,v)|0)break;h=k[m>>2]|0;if((h|0)==(k[n>>2]|0)){x=0;ta(k[(k[a>>2]|0)+40>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=24;break}else continue}else{k[m>>2]=h+1;continue}}if((H|0)==24){a=Wa()|0;break}I=i[G>>0]|0;if(!((i[A>>0]|0)==0?1:(((I&1)==0?(I&255)>>>1:k[G+4>>2]|0)|0)==0)?(B=k[D>>2]|0,(B-C|0)<160):0){I=k[z>>2]|0;k[D>>2]=B+4;k[B>>2]=I}x=0;g=+Ca(3,d|0,k[y>>2]|0,e|0);I=x;x=0;if(!(I&1)){p[f>>3]=g;cs(G,C,k[D>>2]|0,e);if(a){if((k[a+12>>2]|0)==(k[a+16>>2]|0)){x=0;d=ta(k[(k[a>>2]|0)+36>>2]|0,a|0)|0;I=x;x=0;if(I&1){H=25;break}if((d|0)==-1){k[b>>2]=0;a=0}}}else a=0;d=(a|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;I=x;x=0;if(I&1){H=25;break a}if((a|0)==-1){k[c>>2]=0;H=49;break}}if(!d)H=50}else H=49;while(0);if((H|0)==49?d:0)H=50;if((H|0)==50)k[e>>2]=k[e>>2]|2;I=k[b>>2]|0;Sm(F);Sm(G);r=E;return I|0}else H=25}else H=25;while(0);if((H|0)==25)a=Wa()|0;Sm(F);Sm(G);fb(a|0);return 0}function Ru(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=r;r=r+16|0;f=e;k[f>>2]=d;d=Ak(b)|0;b=pl(a,c,f)|0;if((d|0)!=0?(x=0,ta(75,d|0)|0,f=x,x=0,f&1):0){f=Wa(0)|0;oc(f)}r=e;return b|0}function Su(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0;y=r;r=r+112|0;j=y;m=(d-c|0)/12|0;do if(m>>>0>100){j=Pl(m)|0;if((j|0)==0?(x=0,Ga(6),w=x,x=0,w&1):0){h=0;o=6;break}h=j;o=11}else{h=0;o=11}while(0);a:do if((o|0)==11){if((c|0)==(d|0))l=0;else{p=c;n=0;o=j;while(1){l=i[p>>0]|0;if(!(l&1))l=(l&255)>>>1;else l=k[p+4>>2]|0;if(!l){i[o>>0]=2;l=n+1|0;m=m+-1|0}else{i[o>>0]=1;l=n}p=p+12|0;if((p|0)==(d|0))break;else{n=l;o=o+1|0}}}v=(c|0)==(d|0);w=(c|0)==(d|0);u=0;q=m;b:while(1){m=k[a>>2]|0;do if(m){n=k[m+12>>2]|0;if((n|0)==(k[m+16>>2]|0)){x=0;m=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;t=x;x=0;if(t&1){o=5;break b}}else m=k[n>>2]|0;if((m|0)==-1){k[a>>2]=0;p=1;break}else{p=(k[a>>2]|0)==0;break}}else p=1;while(0);n=k[b>>2]|0;if(n){m=k[n+12>>2]|0;if((m|0)==(k[n+16>>2]|0)){x=0;m=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;t=x;x=0;if(t&1){o=5;break}}else m=k[m>>2]|0;if((m|0)==-1){k[b>>2]=0;n=0;o=1}else o=0}else{n=0;o=1}m=k[a>>2]|0;if(!((q|0)!=0&(p^o))){o=66;break}n=k[m+12>>2]|0;if((n|0)==(k[m+16>>2]|0)){x=0;m=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;t=x;x=0;if(t&1){o=5;break}}else m=k[n>>2]|0;if(!g){x=0;m=Aa(k[(k[e>>2]|0)+28>>2]|0,e|0,m|0)|0;t=x;x=0;if(t&1){o=5;break}}t=u+1|0;if(v){m=0;p=q}else{p=0;s=c;o=q;q=j;while(1){do if((i[q>>0]|0)==1){if(!(i[s>>0]&1))n=s+4|0;else n=k[s+8>>2]|0;n=k[n+(u<<2)>>2]|0;if(!g){x=0;n=Aa(k[(k[e>>2]|0)+28>>2]|0,e|0,n|0)|0;z=x;x=0;if(z&1){o=4;break b}}if((m|0)!=(n|0)){i[q>>0]=0;n=p;o=o+-1|0;break}n=i[s>>0]|0;if(!(n&1))n=(n&255)>>>1;else n=k[s+4>>2]|0;if((n|0)==(t|0)){i[q>>0]=2;n=1;l=l+1|0;o=o+-1|0}else n=1}else n=p;while(0);s=s+12|0;if((s|0)==(d|0)){m=n;p=o;break}else{p=n;q=q+1|0}}}if(!m){u=t;q=p;continue}m=k[a>>2]|0;n=m+12|0;o=k[n>>2]|0;if((o|0)==(k[m+16>>2]|0)){x=0;ta(k[(k[m>>2]|0)+40>>2]|0,m|0)|0;z=x;x=0;if(z&1){o=5;break}}else k[n>>2]=o+4;if((l+p|0)>>>0<2|w){u=t;q=p;continue}else{m=c;o=j}while(1){if((i[o>>0]|0)==2){n=i[m>>0]|0;if(!(n&1))n=(n&255)>>>1;else n=k[m+4>>2]|0;if((n|0)!=(t|0)){i[o>>0]=0;l=l+-1|0}}m=m+12|0;if((m|0)==(d|0)){u=t;q=p;continue b}else o=o+1|0}}if((o|0)==4){c=Wa()|0;break}else if((o|0)==5){c=Wa()|0;break}else if((o|0)==66){do if(m){l=k[m+12>>2]|0;if((l|0)==(k[m+16>>2]|0)){x=0;l=ta(k[(k[m>>2]|0)+36>>2]|0,m|0)|0;z=x;x=0;if(z&1){o=6;break a}}else l=k[l>>2]|0;if((l|0)==-1){k[a>>2]=0;m=1;break}else{m=(k[a>>2]|0)==0;break}}else m=1;while(0);do if(n){l=k[n+12>>2]|0;if((l|0)==(k[n+16>>2]|0)){x=0;l=ta(k[(k[n>>2]|0)+36>>2]|0,n|0)|0;z=x;x=0;if(z&1){o=6;break a}}else l=k[l>>2]|0;if((l|0)!=-1)if(m)break;else{o=81;break}else{k[b>>2]=0;o=79;break}}else o=79;while(0);if((o|0)==79?m:0)o=81;if((o|0)==81)k[f>>2]=k[f>>2]|2;c:do if((c|0)==(d|0))o=85;else while(1){if((i[j>>0]|0)==2)break c;c=c+12|0;if((c|0)==(d|0)){o=85;break}else j=j+1|0}while(0);if((o|0)==85){k[f>>2]=k[f>>2]|4;c=d}if(h)Ql(h);r=y;return c|0}}while(0);if((o|0)==6)c=Wa()|0;if(h)Ql(h);fb(c|0);return 0}function Tu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;z=r;r=r+320|0;q=z+208|0;g=z+200|0;B=z+24|0;A=z+12|0;t=z+8|0;w=z+40|0;y=z+4|0;u=z;s=ru(d)|0;xp(B,d,q,g);k[A>>2]=0;k[A+4>>2]=0;k[A+8>>2]=0;if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);p=x;x=0;a:do if(!(p&1)){n=A+8|0;o=A+1|0;a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a;k[y>>2]=w;k[u>>2]=0;p=A+4|0;m=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){C=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;d=0;h=1}else{d=g;h=0}}else{d=0;h=1}j=k[c>>2]|0;do if(j){g=k[j+12>>2]|0;if((g|0)==(k[j+16>>2]|0)){x=0;g=ta(k[(k[j>>2]|0)+36>>2]|0,j|0)|0;l=x;x=0;if(l&1){C=25;break b}}else g=k[g>>2]|0;if((g|0)!=-1)if(h)break;else{g=j;break b}else{k[c>>2]=0;C=17;break}}else C=17;while(0);if((C|0)==17){C=0;if(h){g=0;break}else j=0}g=i[A>>0]|0;g=(g&1)==0?(g&255)>>>1:k[p>>2]|0;if((k[t>>2]|0)==(a+g|0)){x=0;Fa(8,A|0,g<<1|0,0);l=x;x=0;if(l&1){C=25;break}if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);l=x;x=0;if(l&1){C=25;break}a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a+g}h=d+12|0;g=k[h>>2]|0;l=d+16|0;if((g|0)==(k[l>>2]|0)){x=0;g=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}}else g=k[g>>2]|0;if(tp(g,s,a,t,u,m,B,w,y,q)|0){g=j;break}g=k[h>>2]|0;if((g|0)==(k[l>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}else{g=d;continue}}else{k[h>>2]=g+4;g=d;continue}}if((C|0)==25){a=Wa()|0;break}D=i[B>>0]|0;if((((D&1)==0?(D&255)>>>1:k[B+4>>2]|0)|0)!=0?(v=k[y>>2]|0,(v-w|0)<160):0){D=k[u>>2]|0;k[y>>2]=v+4;k[v>>2]=D}x=0;a=Ea(21,a|0,k[t>>2]|0,e|0,s|0)|0;D=x;x=0;if(!(D&1)){k[f>>2]=a;cs(B,w,k[y>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{C=53;break}else{k[c>>2]=0;C=51;break}}else C=51;while(0);if((C|0)==51?d:0)C=53;if((C|0)==53)k[e>>2]=k[e>>2]|2;D=k[b>>2]|0;Sm(A);Sm(B);r=z;return D|0}else C=26}else C=26;while(0);if((C|0)==26)a=Wa()|0;Sm(A);Sm(B);fb(a|0);return 0}function Uu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;z=r;r=r+320|0;q=z+208|0;g=z+200|0;B=z+24|0;A=z+12|0;t=z+8|0;w=z+40|0;y=z+4|0;u=z;s=ru(d)|0;xp(B,d,q,g);k[A>>2]=0;k[A+4>>2]=0;k[A+8>>2]=0;if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);p=x;x=0;a:do if(!(p&1)){n=A+8|0;o=A+1|0;a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a;k[y>>2]=w;k[u>>2]=0;p=A+4|0;m=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){C=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;g=0;j=1}else j=0}else{g=0;j=1}h=k[c>>2]|0;do if(h){d=k[h+12>>2]|0;if((d|0)==(k[h+16>>2]|0)){x=0;d=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;l=x;x=0;if(l&1){C=25;break b}}else d=k[d>>2]|0;if((d|0)!=-1)if(j)break;else break b;else{k[c>>2]=0;C=17;break}}else C=17;while(0);if((C|0)==17){C=0;if(j){h=0;break}else h=0}d=i[A>>0]|0;d=(d&1)==0?(d&255)>>>1:k[p>>2]|0;if((k[t>>2]|0)==(a+d|0)){x=0;Fa(8,A|0,d<<1|0,0);l=x;x=0;if(l&1){C=25;break}if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);l=x;x=0;if(l&1){C=25;break}a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a+d}j=g+12|0;d=k[j>>2]|0;l=g+16|0;if((d|0)==(k[l>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=25;break}}else d=k[d>>2]|0;if(tp(d,s,a,t,u,m,B,w,y,q)|0)break;d=k[j>>2]|0;if((d|0)==(k[l>>2]|0)){x=0;ta(k[(k[g>>2]|0)+40>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=25;break}else continue}else{k[j>>2]=d+4;continue}}if((C|0)==25){a=Wa()|0;break}D=i[B>>0]|0;if((((D&1)==0?(D&255)>>>1:k[B+4>>2]|0)|0)!=0?(v=k[y>>2]|0,(v-w|0)<160):0){D=k[u>>2]|0;k[y>>2]=v+4;k[v>>2]=D}x=0;a=Ea(22,a|0,k[t>>2]|0,e|0,s|0)|0;d=M;D=x;x=0;if(!(D&1)){D=f;k[D>>2]=a;k[D+4>>2]=d;cs(B,w,k[y>>2]|0,e);if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;D=x;x=0;if(D&1){C=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{C=53;break}else{k[c>>2]=0;C=51;break}}else C=51;while(0);if((C|0)==51?d:0)C=53;if((C|0)==53)k[e>>2]=k[e>>2]|2;D=k[b>>2]|0;Sm(A);Sm(B);r=z;return D|0}else C=26}else C=26;while(0);if((C|0)==26)a=Wa()|0;Sm(A);Sm(B);fb(a|0);return 0}function Vu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;A=r;r=r+320|0;s=A+208|0;g=A+200|0;C=A+24|0;B=A+12|0;u=A+8|0;y=A+40|0;z=A+4|0;v=A;t=ru(d)|0;xp(C,d,s,g);k[B>>2]=0;k[B+4>>2]=0;k[B+8>>2]=0;if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);q=x;x=0;a:do if(!(q&1)){o=B+8|0;p=B+1|0;a=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=a;k[z>>2]=y;k[v>>2]=0;q=B+4|0;n=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;m=x;x=0;if(m&1){D=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;d=0;h=1}else{d=g;h=0}}else{d=0;h=1}l=k[c>>2]|0;do if(l){g=k[l+12>>2]|0;if((g|0)==(k[l+16>>2]|0)){x=0;g=ta(k[(k[l>>2]|0)+36>>2]|0,l|0)|0;m=x;x=0;if(m&1){D=25;break b}}else g=k[g>>2]|0;if((g|0)!=-1)if(h)break;else{g=l;break b}else{k[c>>2]=0;D=17;break}}else D=17;while(0);if((D|0)==17){D=0;if(h){g=0;break}else l=0}g=i[B>>0]|0;g=(g&1)==0?(g&255)>>>1:k[q>>2]|0;if((k[u>>2]|0)==(a+g|0)){x=0;Fa(8,B|0,g<<1|0,0);m=x;x=0;if(m&1){D=25;break}if(!(i[B>>0]&1))a=10;else a=(k[B>>2]&-2)+-1|0;x=0;Fa(8,B|0,a|0,0);m=x;x=0;if(m&1){D=25;break}a=(i[B>>0]&1)==0?p:k[o>>2]|0;k[u>>2]=a+g}h=d+12|0;g=k[h>>2]|0;m=d+16|0;if((g|0)==(k[m>>2]|0)){x=0;g=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;E=x;x=0;if(E&1){D=25;break}}else g=k[g>>2]|0;if(tp(g,t,a,u,v,n,C,y,z,s)|0){g=l;break}g=k[h>>2]|0;if((g|0)==(k[m>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;E=x;x=0;if(E&1){D=25;break}else{g=d;continue}}else{k[h>>2]=g+4;g=d;continue}}if((D|0)==25){a=Wa()|0;break}E=i[C>>0]|0;if((((E&1)==0?(E&255)>>>1:k[C+4>>2]|0)|0)!=0?(w=k[z>>2]|0,(w-y|0)<160):0){E=k[v>>2]|0;k[z>>2]=w+4;k[w>>2]=E}x=0;a=Ea(23,a|0,k[u>>2]|0,e|0,t|0)|0;E=x;x=0;if(!(E&1)){j[f>>1]=a;cs(C,y,k[z>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;E=x;x=0;if(E&1){D=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;E=x;x=0;if(E&1){D=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{D=53;break}else{k[c>>2]=0;D=51;break}}else D=51;while(0);if((D|0)==51?d:0)D=53;if((D|0)==53)k[e>>2]=k[e>>2]|2;E=k[b>>2]|0;Sm(B);Sm(C);r=A;return E|0}else D=26}else D=26;while(0);if((D|0)==26)a=Wa()|0;Sm(B);Sm(C);fb(a|0);return 0}function Wu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;z=r;r=r+320|0;q=z+208|0;g=z+200|0;B=z+24|0;A=z+12|0;t=z+8|0;w=z+40|0;y=z+4|0;u=z;s=ru(d)|0;xp(B,d,q,g);k[A>>2]=0;k[A+4>>2]=0;k[A+8>>2]=0;if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);p=x;x=0;a:do if(!(p&1)){n=A+8|0;o=A+1|0;a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a;k[y>>2]=w;k[u>>2]=0;p=A+4|0;m=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){C=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;d=0;h=1}else{d=g;h=0}}else{d=0;h=1}j=k[c>>2]|0;do if(j){g=k[j+12>>2]|0;if((g|0)==(k[j+16>>2]|0)){x=0;g=ta(k[(k[j>>2]|0)+36>>2]|0,j|0)|0;l=x;x=0;if(l&1){C=25;break b}}else g=k[g>>2]|0;if((g|0)!=-1)if(h)break;else{g=j;break b}else{k[c>>2]=0;C=17;break}}else C=17;while(0);if((C|0)==17){C=0;if(h){g=0;break}else j=0}g=i[A>>0]|0;g=(g&1)==0?(g&255)>>>1:k[p>>2]|0;if((k[t>>2]|0)==(a+g|0)){x=0;Fa(8,A|0,g<<1|0,0);l=x;x=0;if(l&1){C=25;break}if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);l=x;x=0;if(l&1){C=25;break}a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a+g}h=d+12|0;g=k[h>>2]|0;l=d+16|0;if((g|0)==(k[l>>2]|0)){x=0;g=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}}else g=k[g>>2]|0;if(tp(g,s,a,t,u,m,B,w,y,q)|0){g=j;break}g=k[h>>2]|0;if((g|0)==(k[l>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}else{g=d;continue}}else{k[h>>2]=g+4;g=d;continue}}if((C|0)==25){a=Wa()|0;break}D=i[B>>0]|0;if((((D&1)==0?(D&255)>>>1:k[B+4>>2]|0)|0)!=0?(v=k[y>>2]|0,(v-w|0)<160):0){D=k[u>>2]|0;k[y>>2]=v+4;k[v>>2]=D}x=0;a=Ea(24,a|0,k[t>>2]|0,e|0,s|0)|0;D=x;x=0;if(!(D&1)){k[f>>2]=a;cs(B,w,k[y>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{C=53;break}else{k[c>>2]=0;C=51;break}}else C=51;while(0);if((C|0)==51?d:0)C=53;if((C|0)==53)k[e>>2]=k[e>>2]|2;D=k[b>>2]|0;Sm(A);Sm(B);r=z;return D|0}else C=26}else C=26;while(0);if((C|0)==26)a=Wa()|0;Sm(A);Sm(B);fb(a|0);return 0}function Xu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;z=r;r=r+320|0;q=z+208|0;g=z+200|0;B=z+24|0;A=z+12|0;t=z+8|0;w=z+40|0;y=z+4|0;u=z;s=ru(d)|0;xp(B,d,q,g);k[A>>2]=0;k[A+4>>2]=0;k[A+8>>2]=0;if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);p=x;x=0;a:do if(!(p&1)){n=A+8|0;o=A+1|0;a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a;k[y>>2]=w;k[u>>2]=0;p=A+4|0;m=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){C=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;d=0;h=1}else{d=g;h=0}}else{d=0;h=1}j=k[c>>2]|0;do if(j){g=k[j+12>>2]|0;if((g|0)==(k[j+16>>2]|0)){x=0;g=ta(k[(k[j>>2]|0)+36>>2]|0,j|0)|0;l=x;x=0;if(l&1){C=25;break b}}else g=k[g>>2]|0;if((g|0)!=-1)if(h)break;else{g=j;break b}else{k[c>>2]=0;C=17;break}}else C=17;while(0);if((C|0)==17){C=0;if(h){g=0;break}else j=0}g=i[A>>0]|0;g=(g&1)==0?(g&255)>>>1:k[p>>2]|0;if((k[t>>2]|0)==(a+g|0)){x=0;Fa(8,A|0,g<<1|0,0);l=x;x=0;if(l&1){C=25;break}if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);l=x;x=0;if(l&1){C=25;break}a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a+g}h=d+12|0;g=k[h>>2]|0;l=d+16|0;if((g|0)==(k[l>>2]|0)){x=0;g=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}}else g=k[g>>2]|0;if(tp(g,s,a,t,u,m,B,w,y,q)|0){g=j;break}g=k[h>>2]|0;if((g|0)==(k[l>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=25;break}else{g=d;continue}}else{k[h>>2]=g+4;g=d;continue}}if((C|0)==25){a=Wa()|0;break}D=i[B>>0]|0;if((((D&1)==0?(D&255)>>>1:k[B+4>>2]|0)|0)!=0?(v=k[y>>2]|0,(v-w|0)<160):0){D=k[u>>2]|0;k[y>>2]=v+4;k[v>>2]=D}x=0;a=Ea(25,a|0,k[t>>2]|0,e|0,s|0)|0;D=x;x=0;if(!(D&1)){k[f>>2]=a;cs(B,w,k[y>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;D=x;x=0;if(D&1){C=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{C=53;break}else{k[c>>2]=0;C=51;break}}else C=51;while(0);if((C|0)==51?d:0)C=53;if((C|0)==53)k[e>>2]=k[e>>2]|2;D=k[b>>2]|0;Sm(A);Sm(B);r=z;return D|0}else C=26}else C=26;while(0);if((C|0)==26)a=Wa()|0;Sm(A);Sm(B);fb(a|0);return 0}function Yu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;z=r;r=r+320|0;q=z+208|0;g=z+200|0;B=z+24|0;A=z+12|0;t=z+8|0;w=z+40|0;y=z+4|0;u=z;s=ru(d)|0;xp(B,d,q,g);k[A>>2]=0;k[A+4>>2]=0;k[A+8>>2]=0;if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);p=x;x=0;a:do if(!(p&1)){n=A+8|0;o=A+1|0;a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a;k[y>>2]=w;k[u>>2]=0;p=A+4|0;m=k[g>>2]|0;g=k[b>>2]|0;b:while(1){if(g){d=k[g+12>>2]|0;if((d|0)==(k[g+16>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;l=x;x=0;if(l&1){C=25;break}}else d=k[d>>2]|0;if((d|0)==-1){k[b>>2]=0;g=0;j=1}else j=0}else{g=0;j=1}h=k[c>>2]|0;do if(h){d=k[h+12>>2]|0;if((d|0)==(k[h+16>>2]|0)){x=0;d=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;l=x;x=0;if(l&1){C=25;break b}}else d=k[d>>2]|0;if((d|0)!=-1)if(j)break;else break b;else{k[c>>2]=0;C=17;break}}else C=17;while(0);if((C|0)==17){C=0;if(j){h=0;break}else h=0}d=i[A>>0]|0;d=(d&1)==0?(d&255)>>>1:k[p>>2]|0;if((k[t>>2]|0)==(a+d|0)){x=0;Fa(8,A|0,d<<1|0,0);l=x;x=0;if(l&1){C=25;break}if(!(i[A>>0]&1))a=10;else a=(k[A>>2]&-2)+-1|0;x=0;Fa(8,A|0,a|0,0);l=x;x=0;if(l&1){C=25;break}a=(i[A>>0]&1)==0?o:k[n>>2]|0;k[t>>2]=a+d}j=g+12|0;d=k[j>>2]|0;l=g+16|0;if((d|0)==(k[l>>2]|0)){x=0;d=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=25;break}}else d=k[d>>2]|0;if(tp(d,s,a,t,u,m,B,w,y,q)|0)break;d=k[j>>2]|0;if((d|0)==(k[l>>2]|0)){x=0;ta(k[(k[g>>2]|0)+40>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=25;break}else continue}else{k[j>>2]=d+4;continue}}if((C|0)==25){a=Wa()|0;break}D=i[B>>0]|0;if((((D&1)==0?(D&255)>>>1:k[B+4>>2]|0)|0)!=0?(v=k[y>>2]|0,(v-w|0)<160):0){D=k[u>>2]|0;k[y>>2]=v+4;k[v>>2]=D}x=0;a=Ea(26,a|0,k[t>>2]|0,e|0,s|0)|0;d=M;D=x;x=0;if(!(D&1)){D=f;k[D>>2]=a;k[D+4>>2]=d;cs(B,w,k[y>>2]|0,e);if(g){a=k[g+12>>2]|0;if((a|0)==(k[g+16>>2]|0)){x=0;a=ta(k[(k[g>>2]|0)+36>>2]|0,g|0)|0;D=x;x=0;if(D&1){C=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;D=x;x=0;if(D&1){C=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{C=53;break}else{k[c>>2]=0;C=51;break}}else C=51;while(0);if((C|0)==51?d:0)C=53;if((C|0)==53)k[e>>2]=k[e>>2]|2;D=k[b>>2]|0;Sm(A);Sm(B);r=z;return D|0}else C=26}else C=26;while(0);if((C|0)==26)a=Wa()|0;Sm(A);Sm(B);fb(a|0);return 0}function Zu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,l=0,m=0,n=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;D=r;r=r+352|0;u=D+208|0;h=D+40|0;j=D+36|0;F=D+24|0;E=D+12|0;w=D+8|0;B=D+48|0;C=D+4|0;y=D;z=D+337|0;v=D+336|0;yp(F,d,u,h,j);k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);t=x;x=0;a:do if(!(t&1)){q=E+8|0;s=E+1|0;a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a;k[C>>2]=B;k[y>>2]=0;i[z>>0]=1;i[v>>0]=69;t=E+4|0;p=k[h>>2]|0;n=k[j>>2]|0;d=k[b>>2]|0;b:while(1){if(d){h=k[d+12>>2]|0;if((h|0)==(k[d+16>>2]|0)){x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;m=x;x=0;if(m&1){G=25;break}}else h=k[h>>2]|0;if((h|0)==-1){k[b>>2]=0;d=0;l=1}else l=0}else{d=0;l=1}h=k[c>>2]|0;do if(h){j=k[h+12>>2]|0;if((j|0)==(k[h+16>>2]|0)){x=0;j=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;m=x;x=0;if(m&1){G=25;break b}}else j=k[j>>2]|0;if((j|0)!=-1)if(l)break;else break b;else{k[c>>2]=0;G=17;break}}else G=17;while(0);if((G|0)==17){G=0;if(l){h=0;break}else h=0}j=i[E>>0]|0;j=(j&1)==0?(j&255)>>>1:k[t>>2]|0;if((k[w>>2]|0)==(a+j|0)){x=0;Fa(8,E|0,j<<1|0,0);m=x;x=0;if(m&1){G=25;break}if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);m=x;x=0;if(m&1){G=25;break}a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a+j}l=d+12|0;j=k[l>>2]|0;m=d+16|0;if((j|0)==(k[m>>2]|0)){x=0;j=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}}else j=k[j>>2]|0;if(zp(j,z,v,a,w,p,n,F,B,C,y,u)|0)break;h=k[l>>2]|0;if((h|0)==(k[m>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}else continue}else{k[l>>2]=h+4;continue}}if((G|0)==25){a=Wa()|0;break}H=i[F>>0]|0;if(!((i[z>>0]|0)==0?1:(((H&1)==0?(H&255)>>>1:k[F+4>>2]|0)|0)==0)?(A=k[C>>2]|0,(A-B|0)<160):0){H=k[y>>2]|0;k[C>>2]=A+4;k[A>>2]=H}x=0;g=+Ca(1,a|0,k[w>>2]|0,e|0);H=x;x=0;if(!(H&1)){o[f>>2]=g;cs(F,B,k[C>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;H=x;x=0;if(H&1){G=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{G=53;break}else{k[c>>2]=0;G=51;break}}else G=51;while(0);if((G|0)==51?d:0)G=53;if((G|0)==53)k[e>>2]=k[e>>2]|2;H=k[b>>2]|0;Sm(E);Sm(F);r=D;return H|0}else G=26}else G=26;while(0);if((G|0)==26)a=Wa()|0;Sm(E);Sm(F);fb(a|0);return 0}function _u(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;D=r;r=r+352|0;u=D+208|0;h=D+40|0;j=D+36|0;F=D+24|0;E=D+12|0;w=D+8|0;B=D+48|0;C=D+4|0;y=D;z=D+337|0;v=D+336|0;yp(F,d,u,h,j);k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);t=x;x=0;a:do if(!(t&1)){q=E+8|0;s=E+1|0;a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a;k[C>>2]=B;k[y>>2]=0;i[z>>0]=1;i[v>>0]=69;t=E+4|0;o=k[h>>2]|0;n=k[j>>2]|0;d=k[b>>2]|0;b:while(1){if(d){h=k[d+12>>2]|0;if((h|0)==(k[d+16>>2]|0)){x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;m=x;x=0;if(m&1){G=25;break}}else h=k[h>>2]|0;if((h|0)==-1){k[b>>2]=0;d=0;l=1}else l=0}else{d=0;l=1}h=k[c>>2]|0;do if(h){j=k[h+12>>2]|0;if((j|0)==(k[h+16>>2]|0)){x=0;j=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;m=x;x=0;if(m&1){G=25;break b}}else j=k[j>>2]|0;if((j|0)!=-1)if(l)break;else break b;else{k[c>>2]=0;G=17;break}}else G=17;while(0);if((G|0)==17){G=0;if(l){h=0;break}else h=0}j=i[E>>0]|0;j=(j&1)==0?(j&255)>>>1:k[t>>2]|0;if((k[w>>2]|0)==(a+j|0)){x=0;Fa(8,E|0,j<<1|0,0);m=x;x=0;if(m&1){G=25;break}if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);m=x;x=0;if(m&1){G=25;break}a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a+j}l=d+12|0;j=k[l>>2]|0;m=d+16|0;if((j|0)==(k[m>>2]|0)){x=0;j=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}}else j=k[j>>2]|0;if(zp(j,z,v,a,w,o,n,F,B,C,y,u)|0)break;h=k[l>>2]|0;if((h|0)==(k[m>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}else continue}else{k[l>>2]=h+4;continue}}if((G|0)==25){a=Wa()|0;break}H=i[F>>0]|0;if(!((i[z>>0]|0)==0?1:(((H&1)==0?(H&255)>>>1:k[F+4>>2]|0)|0)==0)?(A=k[C>>2]|0,(A-B|0)<160):0){H=k[y>>2]|0;k[C>>2]=A+4;k[A>>2]=H}x=0;g=+Ca(2,a|0,k[w>>2]|0,e|0);H=x;x=0;if(!(H&1)){p[f>>3]=g;cs(F,B,k[C>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;H=x;x=0;if(H&1){G=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{G=53;break}else{k[c>>2]=0;G=51;break}}else G=51;while(0);if((G|0)==51?d:0)G=53;if((G|0)==53)k[e>>2]=k[e>>2]|2;H=k[b>>2]|0;Sm(E);Sm(F);r=D;return H|0}else G=26}else G=26;while(0);if((G|0)==26)a=Wa()|0;Sm(E);Sm(F);fb(a|0);return 0}function $u(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0.0,h=0,j=0,l=0,m=0,n=0,o=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;D=r;r=r+352|0;u=D+208|0;h=D+40|0;j=D+36|0;F=D+24|0;E=D+12|0;w=D+8|0;B=D+48|0;C=D+4|0;y=D;z=D+337|0;v=D+336|0;yp(F,d,u,h,j);k[E>>2]=0;k[E+4>>2]=0;k[E+8>>2]=0;if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);t=x;x=0;a:do if(!(t&1)){q=E+8|0;s=E+1|0;a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a;k[C>>2]=B;k[y>>2]=0;i[z>>0]=1;i[v>>0]=69;t=E+4|0;o=k[h>>2]|0;n=k[j>>2]|0;d=k[b>>2]|0;b:while(1){if(d){h=k[d+12>>2]|0;if((h|0)==(k[d+16>>2]|0)){x=0;h=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;m=x;x=0;if(m&1){G=25;break}}else h=k[h>>2]|0;if((h|0)==-1){k[b>>2]=0;d=0;l=1}else l=0}else{d=0;l=1}h=k[c>>2]|0;do if(h){j=k[h+12>>2]|0;if((j|0)==(k[h+16>>2]|0)){x=0;j=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;m=x;x=0;if(m&1){G=25;break b}}else j=k[j>>2]|0;if((j|0)!=-1)if(l)break;else break b;else{k[c>>2]=0;G=17;break}}else G=17;while(0);if((G|0)==17){G=0;if(l){h=0;break}else h=0}j=i[E>>0]|0;j=(j&1)==0?(j&255)>>>1:k[t>>2]|0;if((k[w>>2]|0)==(a+j|0)){x=0;Fa(8,E|0,j<<1|0,0);m=x;x=0;if(m&1){G=25;break}if(!(i[E>>0]&1))a=10;else a=(k[E>>2]&-2)+-1|0;x=0;Fa(8,E|0,a|0,0);m=x;x=0;if(m&1){G=25;break}a=(i[E>>0]&1)==0?s:k[q>>2]|0;k[w>>2]=a+j}l=d+12|0;j=k[l>>2]|0;m=d+16|0;if((j|0)==(k[m>>2]|0)){x=0;j=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}}else j=k[j>>2]|0;if(zp(j,z,v,a,w,o,n,F,B,C,y,u)|0)break;h=k[l>>2]|0;if((h|0)==(k[m>>2]|0)){x=0;ta(k[(k[d>>2]|0)+40>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=25;break}else continue}else{k[l>>2]=h+4;continue}}if((G|0)==25){a=Wa()|0;break}H=i[F>>0]|0;if(!((i[z>>0]|0)==0?1:(((H&1)==0?(H&255)>>>1:k[F+4>>2]|0)|0)==0)?(A=k[C>>2]|0,(A-B|0)<160):0){H=k[y>>2]|0;k[C>>2]=A+4;k[A>>2]=H}x=0;g=+Ca(3,a|0,k[w>>2]|0,e|0);H=x;x=0;if(!(H&1)){p[f>>3]=g;cs(F,B,k[C>>2]|0,e);if(d){a=k[d+12>>2]|0;if((a|0)==(k[d+16>>2]|0)){x=0;a=ta(k[(k[d>>2]|0)+36>>2]|0,d|0)|0;H=x;x=0;if(H&1){G=26;break}}else a=k[a>>2]|0;if((a|0)==-1){k[b>>2]=0;d=1}else d=0}else d=1;do if(h){a=k[h+12>>2]|0;if((a|0)==(k[h+16>>2]|0)){x=0;a=ta(k[(k[h>>2]|0)+36>>2]|0,h|0)|0;H=x;x=0;if(H&1){G=26;break a}}else a=k[a>>2]|0;if((a|0)!=-1)if(d)break;else{G=53;break}else{k[c>>2]=0;G=51;break}}else G=51;while(0);if((G|0)==51?d:0)G=53;if((G|0)==53)k[e>>2]=k[e>>2]|2;H=k[b>>2]|0;Sm(E);Sm(F);r=D;return H|0}else G=26}else G=26;while(0);if((G|0)==26)a=Wa()|0;Sm(E);Sm(F);fb(a|0);return 0}function av(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=r;r=r+16|0;g=f;k[g>>2]=e;e=Ak(c)|0;c=ol(a,b,d,g)|0;if((e|0)!=0?(x=0,ta(75,e|0)|0,g=x,x=0,g&1):0){g=Wa(0)|0;oc(g)}r=f;return c|0}function bv(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=r;r=r+16|0;f=e;k[f>>2]=d;d=Ak(b)|0;x=0;b=va(37,a|0,c|0,f|0)|0;a=x;x=0;if(a&1){b=Wa()|0;if((d|0)!=0?(x=0,ta(75,d|0)|0,f=x,x=0,f&1):0){f=Wa(0)|0;oc(f)}fb(b|0)}else{if((d|0)!=0?(x=0,ta(75,d|0)|0,f=x,x=0,f&1):0){f=Wa(0)|0;oc(f)}r=e;return b|0}return 0}function cv(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0;n=r;r=r+16|0;m=n;g=k[a>>2]|0;a:do if(!g)g=0;else{o=b;j=d-o>>2;l=e+12|0;h=k[l>>2]|0;j=(h|0)>(j|0)?h-j|0:0;h=c;o=h-o|0;e=o>>2;if((o|0)>0?(Qb[k[(k[g>>2]|0)+48>>2]&63](g,b,e)|0)!=(e|0):0){k[a>>2]=0;g=0;break}do if((j|0)>0){dn(m,j,f);x=0;e=va(k[(k[g>>2]|0)+48>>2]|0,g|0,((i[m>>0]&1)==0?m+4|0:k[m+8>>2]|0)|0,j|0)|0;o=x;x=0;if(o&1){o=Wa()|0;en(m);fb(o|0)}if((e|0)==(j|0)){en(m);break}else{k[a>>2]=0;en(m);g=0;break a}}while(0);o=d-h|0;d=o>>2;if((o|0)>0?(Qb[k[(k[g>>2]|0)+48>>2]&63](g,c,d)|0)!=(d|0):0){k[a>>2]=0;g=0;break}k[l>>2]=0}while(0);r=n;return g|0}function dv(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,m=0,n=0,o=0,p=0,q=0,r=0;f=k[a>>2]|0;do if(f){if((k[f+12>>2]|0)==(k[f+16>>2]|0))if((Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0)==-1){k[a>>2]=0;f=0;break}else{f=k[a>>2]|0;break}}else f=0;while(0);g=(f|0)==0;f=k[b>>2]|0;do if(f){if((k[f+12>>2]|0)==(k[f+16>>2]|0)?(Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0)==-1:0){k[b>>2]=0;r=11;break}if(g)r=13;else r=12}else r=11;while(0);if((r|0)==11)if(g)r=12;else{f=0;r=13}a:do if((r|0)==12){k[c>>2]=k[c>>2]|6;f=0}else if((r|0)==13){g=k[a>>2]|0;h=k[g+12>>2]|0;if((h|0)==(k[g+16>>2]|0))g=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else g=l[h>>0]|0;h=g&255;if(h<<24>>24>-1?(q=d+8|0,(j[(k[q>>2]|0)+(g<<24>>24<<1)>>1]&2048)!=0):0){m=(Qb[k[(k[d>>2]|0)+36>>2]&63](d,h,0)|0)<<24>>24;g=k[a>>2]|0;h=g+12|0;i=k[h>>2]|0;if((i|0)==(k[g+16>>2]|0)){Ob[k[(k[g>>2]|0)+40>>2]&127](g)|0;o=e;n=f;e=f;f=m}else{k[h>>2]=i+1;o=e;n=f;e=f;f=m}while(1){f=f+-48|0;p=o+-1|0;g=k[a>>2]|0;do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0))if((Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0)==-1){k[a>>2]=0;g=0;break}else{g=k[a>>2]|0;break}}else g=0;while(0);i=(g|0)==0;if(e)if((k[e+12>>2]|0)==(k[e+16>>2]|0))if((Ob[k[(k[e>>2]|0)+36>>2]&127](e)|0)==-1){k[b>>2]=0;h=0;e=0}else{h=n;e=n}else h=n;else{h=n;e=0}g=k[a>>2]|0;if(!((o|0)>1&(i^(e|0)==0)))break;i=k[g+12>>2]|0;if((i|0)==(k[g+16>>2]|0))g=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else g=l[i>>0]|0;i=g&255;if(i<<24>>24<=-1)break a;if(!(j[(k[q>>2]|0)+(g<<24>>24<<1)>>1]&2048))break a;f=((Qb[k[(k[d>>2]|0)+36>>2]&63](d,i,0)|0)<<24>>24)+(f*10|0)|0;g=k[a>>2]|0;i=g+12|0;m=k[i>>2]|0;if((m|0)==(k[g+16>>2]|0)){Ob[k[(k[g>>2]|0)+40>>2]&127](g)|0;o=p;n=h;continue}else{k[i>>2]=m+1;o=p;n=h;continue}}do if(g){if((k[g+12>>2]|0)==(k[g+16>>2]|0))if((Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0)==-1){k[a>>2]=0;g=0;break}else{g=k[a>>2]|0;break}}else g=0;while(0);g=(g|0)==0;do if(h){if((k[h+12>>2]|0)==(k[h+16>>2]|0)?(Ob[k[(k[h>>2]|0)+36>>2]&127](h)|0)==-1:0){k[b>>2]=0;r=50;break}if(g)break a}else r=50;while(0);if((r|0)==50?!g:0)break;k[c>>2]=k[c>>2]|2;break}k[c>>2]=k[c>>2]|4;f=0}while(0);return f|0}function ev(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0;f=k[a>>2]|0;do if(f){g=k[f+12>>2]|0;if((g|0)==(k[f+16>>2]|0))f=Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0;else f=k[g>>2]|0;if((f|0)==-1){k[a>>2]=0;h=1;break}else{h=(k[a>>2]|0)==0;break}}else h=1;while(0);g=k[b>>2]|0;do if(g){f=k[g+12>>2]|0;if((f|0)==(k[g+16>>2]|0))f=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else f=k[f>>2]|0;if((f|0)!=-1)if(h){o=17;break}else{o=16;break}else{k[b>>2]=0;o=14;break}}else o=14;while(0);if((o|0)==14)if(h)o=16;else{g=0;o=17}a:do if((o|0)==16){k[c>>2]=k[c>>2]|6;f=0}else if((o|0)==17){f=k[a>>2]|0;h=k[f+12>>2]|0;if((h|0)==(k[f+16>>2]|0))f=Ob[k[(k[f>>2]|0)+36>>2]&127](f)|0;else f=k[h>>2]|0;if(!(Qb[k[(k[d>>2]|0)+12>>2]&63](d,2048,f)|0)){k[c>>2]=k[c>>2]|4;f=0;break}f=(Qb[k[(k[d>>2]|0)+52>>2]&63](d,f,0)|0)<<24>>24;h=k[a>>2]|0;i=h+12|0;j=k[i>>2]|0;if((j|0)==(k[h+16>>2]|0)){Ob[k[(k[h>>2]|0)+40>>2]&127](h)|0;m=e;l=g;i=g}else{k[i>>2]=j+4;m=e;l=g;i=g}while(1){f=f+-48|0;n=m+-1|0;g=k[a>>2]|0;do if(g){h=k[g+12>>2]|0;if((h|0)==(k[g+16>>2]|0))g=Ob[k[(k[g>>2]|0)+36>>2]&127](g)|0;else g=k[h>>2]|0;if((g|0)==-1){k[a>>2]=0;j=1;break}else{j=(k[a>>2]|0)==0;break}}else j=1;while(0);do if(i){g=k[i+12>>2]|0;if((g|0)==(k[i+16>>2]|0))g=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else g=k[g>>2]|0;if((g|0)==-1){k[b>>2]=0;i=0;e=0;g=1;break}else{i=l;e=l;g=(l|0)==0;break}}else{i=l;e=0;g=1}while(0);h=k[a>>2]|0;if(!((m|0)>1&(j^g)))break;g=k[h+12>>2]|0;if((g|0)==(k[h+16>>2]|0))g=Ob[k[(k[h>>2]|0)+36>>2]&127](h)|0;else g=k[g>>2]|0;if(!(Qb[k[(k[d>>2]|0)+12>>2]&63](d,2048,g)|0))break a;f=((Qb[k[(k[d>>2]|0)+52>>2]&63](d,g,0)|0)<<24>>24)+(f*10|0)|0;g=k[a>>2]|0;h=g+12|0;j=k[h>>2]|0;if((j|0)==(k[g+16>>2]|0)){Ob[k[(k[g>>2]|0)+40>>2]&127](g)|0;m=n;l=i;i=e;continue}else{k[h>>2]=j+4;m=n;l=i;i=e;continue}}do if(h){g=k[h+12>>2]|0;if((g|0)==(k[h+16>>2]|0))g=Ob[k[(k[h>>2]|0)+36>>2]&127](h)|0;else g=k[g>>2]|0;if((g|0)==-1){k[a>>2]=0;h=1;break}else{h=(k[a>>2]|0)==0;break}}else h=1;while(0);do if(i){g=k[i+12>>2]|0;if((g|0)==(k[i+16>>2]|0))g=Ob[k[(k[i>>2]|0)+36>>2]&127](i)|0;else g=k[g>>2]|0;if((g|0)!=-1)if(h)break a;else break;else{k[b>>2]=0;o=60;break}}else o=60;while(0);if((o|0)==60?!h:0)break;k[c>>2]=k[c>>2]|2}while(0);return f|0}function fv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=a+4|0;d=(k[f>>2]|0)!=189;h=k[a>>2]|0;g=h;e=(k[c>>2]|0)-g|0;e=e>>>0<2147483647?e<<1:-1;g=(k[b>>2]|0)-g|0;h=Sl(d?h:0,e)|0;if(!h)ak();do if(!d){d=k[a>>2]|0;k[a>>2]=h;if(d){x=0;qa(k[f>>2]|0,d|0);h=x;x=0;if(h&1){h=Wa(0)|0;oc(h)}else{i=k[a>>2]|0;break}}else i=h}else{k[a>>2]=h;i=h}while(0);k[f>>2]=201;k[b>>2]=i+g;k[c>>2]=(k[a>>2]|0)+e;return}function gv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=a+4|0;d=(k[f>>2]|0)!=189;h=k[a>>2]|0;g=h;e=(k[c>>2]|0)-g|0;e=e>>>0<2147483647?e<<1:-1;g=(k[b>>2]|0)-g>>2;h=Sl(d?h:0,e)|0;if(!h)ak();do if(!d){d=k[a>>2]|0;k[a>>2]=h;if(d){x=0;qa(k[f>>2]|0,d|0);h=x;x=0;if(h&1){h=Wa(0)|0;oc(h)}else{i=k[a>>2]|0;break}}else i=h}else{k[a>>2]=h;i=h}while(0);k[f>>2]=201;k[b>>2]=i+(g<<2);k[c>>2]=(k[a>>2]|0)+(e>>>2<<2);return}function hv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0;f=b;d=i[a>>0]|0;if(!(d&1)){e=10;j=(d&255)>>>1}else{d=k[a>>2]|0;e=(d&-2)+-1|0;j=k[a+4>>2]|0;d=d&255}h=c-f|0;do if((c|0)!=(b|0)){if((e-j|0)>>>0>>0){bn(a,e,j+h-e|0,j,j,0,0);d=i[a>>0]|0}if(!(d&1))g=a+1|0;else g=k[a+8>>2]|0;f=c+(j-f)|0;if((b|0)!=(c|0)){d=b;e=g+j|0;while(1){i[e>>0]=i[d>>0]|0;d=d+1|0;if((d|0)==(c|0))break;else e=e+1|0}}i[g+f>>0]=0;d=j+h|0;if(!(i[a>>0]&1)){i[a>>0]=d<<1;break}else{k[a+4>>2]=d;break}}while(0);return a|0}function iv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=a+4|0;d=(k[f>>2]|0)!=189;h=k[a>>2]|0;g=h;e=(k[c>>2]|0)-g|0;e=e>>>0<2147483647?e<<1:-1;g=(k[b>>2]|0)-g>>2;h=Sl(d?h:0,e)|0;if(!h)ak();do if(!d){d=k[a>>2]|0;k[a>>2]=h;if(d){x=0;qa(k[f>>2]|0,d|0);h=x;x=0;if(h&1){h=Wa(0)|0;oc(h)}else{i=k[a>>2]|0;break}}else i=h}else{k[a>>2]=h;i=h}while(0);k[f>>2]=201;k[b>>2]=i+(g<<2);k[c>>2]=(k[a>>2]|0)+(e>>>2<<2);return}function jv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0;f=b;d=i[a>>0]|0;if(!(d&1)){e=1;j=(d&255)>>>1}else{d=k[a>>2]|0;e=(d&-2)+-1|0;j=k[a+4>>2]|0;d=d&255}h=c-f>>2;do if(h){if((e-j|0)>>>0>>0){ln(a,e,j+h-e|0,j,j,0,0);d=i[a>>0]|0}if(!(d&1))g=a+4|0;else g=k[a+8>>2]|0;f=j+((c-f|0)>>>2)|0;if((b|0)!=(c|0)){d=b;e=g+(j<<2)|0;while(1){k[e>>2]=k[d>>2];d=d+4|0;if((d|0)==(c|0))break;else e=e+4|0}}k[g+(f<<2)>>2]=0;d=j+h|0;if(!(i[a>>0]&1)){i[a>>0]=d<<1;break}else{k[a+4>>2]=d;break}}while(0);return a|0}function kv(a,b){a=a|0;b=b|0;var c=0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;i[a+128>>0]=0;do if(b){x=0;ra(125,a|0,b|0);c=x;x=0;if(c&1){c=Wa()|0;Nv(a);fb(c|0)}else{cw(a,b);break}}while(0);return}function lv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43148)|0);return}function mv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43188)|0);return}function nv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44220)|0);return}function ov(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44212)|0);return}function pv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44280)|0);return}function qv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44288)|0);return}function rv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44344)|0);return}function sv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44352)|0);return}function tv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44360)|0);return}function uv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44368)|0);return}function vv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43260)|0);return}function wv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43332)|0);return}function xv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43392)|0);return}function yv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43452)|0);return}function zv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43764)|0);return}function Av(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43828)|0);return}function Bv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43892)|0);return}function Cv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43956)|0);return}function Dv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43992)|0);return}function Ev(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44028)|0);return}function Fv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44064)|0);return}function Gv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44100)|0);return}function Hv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43544)|0);return}function Iv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43636)|0);return}function Jv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43668)|0);return}function Kv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(43700)|0);return}function Lv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44140)|0);return}function Mv(a,b){a=a|0;b=b|0;Hs(a,b,Rs(44180)|0);return}function Nv(a){a=a|0;var b=0,c=0,d=0;c=k[a>>2]|0;do if(c){d=a+4|0;b=k[d>>2]|0;if((b|0)!=(c|0)){do b=b+-4|0;while((b|0)!=(c|0));k[d>>2]=b}if((a+16|0)==(c|0)){i[a+128>>0]=0;break}else{mj(c);break}}while(0);return}function Ov(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;g=a+4|0;c=k[g>>2]|0;d=k[a>>2]|0;e=c-d>>2;if(e>>>0>=b>>>0){if(e>>>0>b>>>0?(f=d+(b<<2)|0,(c|0)!=(f|0)):0){do c=c+-4|0;while((c|0)!=(f|0));k[g>>2]=c}}else bw(a,b-e|0);return}function Pv(a,b){a=a|0;b=b|0;var c=0;c=k[a+8>>2]|0;if((k[a+12>>2]|0)-c>>2>>>0>b>>>0)c=(k[c+(b<<2)>>2]|0)!=0;else c=0;return c|0}function Qv(a){a=a|0;var b=0,c=0;c=a+4|0;b=k[c>>2]|0;c=k[c+4>>2]|0;a=(k[a>>2]|0)+(c>>1)|0;if(c&1)b=k[(k[a>>2]|0)+b>>2]|0;Lb[b&255](a);return}function Rv(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var l=0,n=0;k[c>>2]=a;k[f>>2]=d;if(h&2)if((e-d|0)<3)a=1;else{k[f>>2]=d+1;i[d>>0]=-17;l=k[f>>2]|0;k[f>>2]=l+1;i[l>>0]=-69;l=k[f>>2]|0;k[f>>2]=l+1;i[l>>0]=-65;l=4}else l=4;a:do if((l|0)==4){n=b;a=k[c>>2]|0;if(a>>>0>>0)while(1){h=j[a>>1]|0;l=h&65535;if(l>>>0>g>>>0){a=2;break a}do if((h&65535)<128){a=k[f>>2]|0;if((e-a|0)<1){a=1;break a}k[f>>2]=a+1;i[a>>0]=h}else{if((h&65535)<2048){a=k[f>>2]|0;if((e-a|0)<2){a=1;break a}k[f>>2]=a+1;i[a>>0]=l>>>6|192;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l&63|128;break}if((h&65535)<55296){a=k[f>>2]|0;if((e-a|0)<3){a=1;break a}k[f>>2]=a+1;i[a>>0]=l>>>12|224;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l>>>6&63|128;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l&63|128;break}if((h&65535)>=56320){if((h&65535)<57344){a=2;break a}a=k[f>>2]|0;if((e-a|0)<3){a=1;break a}k[f>>2]=a+1;i[a>>0]=l>>>12|224;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l>>>6&63|128;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l&63|128;break}if((n-a|0)<4){a=1;break a}a=a+2|0;h=m[a>>1]|0;if((h&64512|0)!=56320){a=2;break a}if((e-(k[f>>2]|0)|0)<4){a=1;break a}d=l&960;if(((d<<10)+65536|l<<10&64512|h&1023)>>>0>g>>>0){a=2;break a}k[c>>2]=a;a=(d>>>6)+1|0;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=a>>>2|240;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l>>>2&15|a<<4&48|128;d=k[f>>2]|0;k[f>>2]=d+1;i[d>>0]=l<<4&48|h>>>6&15|128;l=k[f>>2]|0;k[f>>2]=l+1;i[l>>0]=h&63|128}while(0);a=(k[c>>2]|0)+2|0;k[c>>2]=a;if(a>>>0>=b>>>0){a=0;break}}else a=0}while(0);return a|0}function Sv(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var m=0,n=0,o=0,p=0,q=0,r=0;k[c>>2]=a;k[f>>2]=d;if(h&4){a=k[c>>2]|0;h=b;if((((h-a|0)>2?(i[a>>0]|0)==-17:0)?(i[a+1>>0]|0)==-69:0)?(i[a+2>>0]|0)==-65:0){k[c>>2]=a+3;m=k[f>>2]|0}else m=d}else{m=d;h=b}q=e;d=k[c>>2]|0;a=d>>>0>>0;a:do if(a&m>>>0>>0)while(1){a=i[d>>0]|0;o=a&255;if(o>>>0>g>>>0){a=2;break a}do if(a<<24>>24>-1){j[m>>1]=a&255;k[c>>2]=d+1}else{if((a&255)<194){a=2;break a}if((a&255)<224){if((h-d|0)<2){a=1;break a}a=l[d+1>>0]|0;if((a&192|0)!=128){a=2;break a}a=a&63|o<<6&1984;if(a>>>0>g>>>0){a=2;break a}j[m>>1]=a;k[c>>2]=d+2;break}if((a&255)<240){if((h-d|0)<3){a=1;break a}n=i[d+1>>0]|0;a=i[d+2>>0]|0;switch(o|0){case 224:{if((n&-32)<<24>>24!=-96){a=2;break a}break}case 237:{if((n&-32)<<24>>24!=-128){a=2;break a}break}default:if((n&-64)<<24>>24!=-128){a=2;break a}}a=a&255;if((a&192|0)!=128){a=2;break a}a=(n&255)<<6&4032|o<<12|a&63;if((a&65535)>>>0>g>>>0){a=2;break a}j[m>>1]=a;k[c>>2]=d+3;break}if((a&255)>=245){a=2;break a}if((h-d|0)<4){a=1;break a}n=i[d+1>>0]|0;a=i[d+2>>0]|0;d=i[d+3>>0]|0;switch(o|0){case 240:{if((n+112&255)>=48){a=2;break a}break}case 244:{if((n&-16)<<24>>24!=-128){a=2;break a}break}default:if((n&-64)<<24>>24!=-128){a=2;break a}}p=a&255;if((p&192|0)!=128){a=2;break a}a=d&255;if((a&192|0)!=128){a=2;break a}if((q-m|0)<4){a=1;break a}o=o&7;d=n&255;n=p<<6;a=a&63;if((d<<12&258048|o<<18|n&4032|a)>>>0>g>>>0){a=2;break a}j[m>>1]=d<<2&60|p>>>4&3|((d>>>4&3|o<<2)<<6)+16320|55296;p=m+2|0;k[f>>2]=p;j[p>>1]=a|n&960|56320;k[c>>2]=(k[c>>2]|0)+4}while(0);m=(k[f>>2]|0)+2|0;k[f>>2]=m;d=k[c>>2]|0;a=d>>>0>>0;if(!(a&m>>>0>>0)){r=39;break}}else r=39;while(0);if((r|0)==39)a=a&1;return a|0}function Tv(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,m=0,n=0;n=b;if((((e&4|0)!=0?(n-a|0)>2:0)?(i[a>>0]|0)==-17:0)?(i[a+1>>0]|0)==-69:0)e=(i[a+2>>0]|0)==-65?a+3|0:a;else e=a;a:do if((c|0)!=0&e>>>0>>0){m=e;f=0;b:while(1){e=i[m>>0]|0;k=e&255;if(k>>>0>d>>>0){e=m;f=42;break a}do if(e<<24>>24>-1)e=m+1|0;else{if((e&255)<194){e=m;f=42;break a}if((e&255)<224){if((n-m|0)<2){e=m;f=42;break a}e=l[m+1>>0]|0;if((e&192|0)!=128){e=m;f=42;break a}if((e&63|k<<6&1984)>>>0>d>>>0){e=m;f=42;break a}e=m+2|0;break}if((e&255)<240){e=m;if((n-e|0)<3){e=m;f=42;break a}h=i[m+1>>0]|0;g=i[m+2>>0]|0;switch(k|0){case 224:{if((h&-32)<<24>>24!=-96){f=20;break b}break}case 237:{if((h&-32)<<24>>24!=-128){f=22;break b}break}default:if((h&-64)<<24>>24!=-128){f=24;break b}}e=g&255;if((e&192|0)!=128){e=m;f=42;break a}if(((h&255)<<6&4032|k<<12&61440|e&63)>>>0>d>>>0){e=m;f=42;break a}e=m+3|0;break}if((e&255)>=245){e=m;f=42;break a}e=m;if((c-f|0)>>>0<2|(n-e|0)<4){e=m;f=42;break a}j=i[m+1>>0]|0;g=i[m+2>>0]|0;h=i[m+3>>0]|0;switch(k|0){case 240:{if((j+112&255)>=48){f=32;break b}break}case 244:{if((j&-16)<<24>>24!=-128){f=34;break b}break}default:if((j&-64)<<24>>24!=-128){f=36;break b}}g=g&255;if((g&192|0)!=128){e=m;f=42;break a}e=h&255;if((e&192|0)!=128){e=m;f=42;break a}if(((j&255)<<12&258048|k<<18&1835008|g<<6&4032|e&63)>>>0>d>>>0){e=m;f=42;break a}e=m+4|0;f=f+1|0}while(0);f=f+1|0;if(!(f>>>0>>0&e>>>0>>0)){f=42;break a}else m=e}if((f|0)==20){e=e-a|0;break}else if((f|0)==22){e=e-a|0;break}else if((f|0)==24){e=e-a|0;break}else if((f|0)==32){e=e-a|0;break}else if((f|0)==34){e=e-a|0;break}else if((f|0)==36){e=e-a|0;break}}else f=42;while(0);if((f|0)==42)e=e-a|0;return e|0}function Uv(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,l=0;k[c>>2]=a;k[f>>2]=d;l=e;if(h&2)if((l-d|0)<3)a=1;else{k[f>>2]=d+1;i[d>>0]=-17;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=-69;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=-65;j=4}else j=4;a:do if((j|0)==4){a=k[c>>2]|0;if(a>>>0>>0)while(1){h=k[a>>2]|0;if(h>>>0>g>>>0|(h&-2048|0)==55296){a=2;break a}do if(h>>>0>=128){if(h>>>0<2048){a=k[f>>2]|0;if((l-a|0)<2){a=1;break a}k[f>>2]=a+1;i[a>>0]=h>>>6|192;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h&63|128;break}a=k[f>>2]|0;e=l-a|0;if(h>>>0<65536){if((e|0)<3){a=1;break a}k[f>>2]=a+1;i[a>>0]=h>>>12|224;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h>>>6&63|128;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h&63|128;break}else{if((e|0)<4){a=1;break a}k[f>>2]=a+1;i[a>>0]=h>>>18|240;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h>>>12&63|128;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h>>>6&63|128;j=k[f>>2]|0;k[f>>2]=j+1;i[j>>0]=h&63|128;break}}else{a=k[f>>2]|0;if((l-a|0)<1){a=1;break a}k[f>>2]=a+1;i[a>>0]=h}while(0);a=(k[c>>2]|0)+4|0;k[c>>2]=a;if(a>>>0>=b>>>0){a=0;break}}else a=0}while(0);return a|0}function Vv(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,m=0,n=0,o=0,p=0,q=0;k[c>>2]=a;k[f>>2]=d;if(h&4){a=k[c>>2]|0;h=b;if((((h-a|0)>2?(i[a>>0]|0)==-17:0)?(i[a+1>>0]|0)==-69:0)?(i[a+2>>0]|0)==-65:0){k[c>>2]=a+3;d=k[f>>2]|0;p=h}else p=h}else p=b;h=k[c>>2]|0;a=h>>>0>>0;a:do if(a&d>>>0>>0)while(1){a=i[h>>0]|0;o=a&255;do if(a<<24>>24>-1){if(o>>>0>g>>>0){a=2;break a}k[d>>2]=o;k[c>>2]=h+1}else{if((a&255)<194){a=2;break a}if((a&255)<224){if((p-h|0)<2){a=1;break a}a=l[h+1>>0]|0;if((a&192|0)!=128){a=2;break a}a=a&63|o<<6&1984;if(a>>>0>g>>>0){a=2;break a}k[d>>2]=a;k[c>>2]=h+2;break}if((a&255)<240){if((p-h|0)<3){a=1;break a}j=i[h+1>>0]|0;a=i[h+2>>0]|0;switch(o|0){case 224:{if((j&-32)<<24>>24!=-96){a=2;break a}break}case 237:{if((j&-32)<<24>>24!=-128){a=2;break a}break}default:if((j&-64)<<24>>24!=-128){a=2;break a}}a=a&255;if((a&192|0)!=128){a=2;break a}a=(j&255)<<6&4032|o<<12&61440|a&63;if(a>>>0>g>>>0){a=2;break a}k[d>>2]=a;k[c>>2]=h+3;break}if((a&255)>=245){a=2;break a}if((p-h|0)<4){a=1;break a}n=i[h+1>>0]|0;a=i[h+2>>0]|0;j=i[h+3>>0]|0;switch(o|0){case 240:{if((n+112&255)>=48){a=2;break a}break}case 244:{if((n&-16)<<24>>24!=-128){a=2;break a}break}default:if((n&-64)<<24>>24!=-128){a=2;break a}}m=a&255;if((m&192|0)!=128){a=2;break a}a=j&255;if((a&192|0)!=128){a=2;break a}a=(n&255)<<12&258048|o<<18&1835008|m<<6&4032|a&63;if(a>>>0>g>>>0){a=2;break a}k[d>>2]=a;k[c>>2]=h+4}while(0);d=(k[f>>2]|0)+4|0;k[f>>2]=d;h=k[c>>2]|0;a=h>>>0>>0;if(!(a&d>>>0>>0)){q=38;break}}else q=38;while(0);if((q|0)==38)a=a&1;return a|0}function Wv(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,m=0,n=0;n=b;if((((e&4|0)!=0?(n-a|0)>2:0)?(i[a>>0]|0)==-17:0)?(i[a+1>>0]|0)==-69:0)e=(i[a+2>>0]|0)==-65?a+3|0:a;else e=a;a:do if((c|0)!=0&e>>>0>>0){k=e;m=0;b:while(1){e=i[k>>0]|0;j=e&255;do if(e<<24>>24>-1){if(j>>>0>d>>>0){e=k;f=42;break a}e=k+1|0}else{if((e&255)<194){e=k;f=42;break a}if((e&255)<224){if((n-k|0)<2){e=k;f=42;break a}e=l[k+1>>0]|0;if((e&192|0)!=128){e=k;f=42;break a}if((e&63|j<<6&1984)>>>0>d>>>0){e=k;f=42;break a}e=k+2|0;break}if((e&255)<240){e=k;if((n-e|0)<3){e=k;f=42;break a}g=i[k+1>>0]|0;f=i[k+2>>0]|0;switch(j|0){case 224:{if((g&-32)<<24>>24!=-96){f=20;break b}break}case 237:{if((g&-32)<<24>>24!=-128){f=22;break b}break}default:if((g&-64)<<24>>24!=-128){f=24;break b}}e=f&255;if((e&192|0)!=128){e=k;f=42;break a}if(((g&255)<<6&4032|j<<12&61440|e&63)>>>0>d>>>0){e=k;f=42;break a}e=k+3|0;break}if((e&255)>=245){e=k;f=42;break a}e=k;if((n-e|0)<4){e=k;f=42;break a}h=i[k+1>>0]|0;f=i[k+2>>0]|0;g=i[k+3>>0]|0;switch(j|0){case 240:{if((h+112&255)>=48){f=32;break b}break}case 244:{if((h&-16)<<24>>24!=-128){f=34;break b}break}default:if((h&-64)<<24>>24!=-128){f=36;break b}}f=f&255;if((f&192|0)!=128){e=k;f=42;break a}e=g&255;if((e&192|0)!=128){e=k;f=42;break a}if(((h&255)<<12&258048|j<<18&1835008|f<<6&4032|e&63)>>>0>d>>>0){e=k;f=42;break a}e=k+4|0}while(0);m=m+1|0;if(!(m>>>0>>0&e>>>0>>0)){f=42;break a}else k=e}if((f|0)==20){e=e-a|0;break}else if((f|0)==22){e=e-a|0;break}else if((f|0)==24){e=e-a|0;break}else if((f|0)==32){e=e-a|0;break}else if((f|0)==34){e=e-a|0;break}else if((f|0)==36){e=e-a|0;break}}else f=42;while(0);if((f|0)==42)e=e-a|0;return e|0}function Xv(a){a=a|0;Sm(45196);Sm(45184);Sm(45172);Sm(45160);Sm(45148);Sm(45136);Sm(45124);Sm(45112);Sm(45100);Sm(45088);Sm(45076);Sm(45064);Sm(45052);Sm(45040);return}function Yv(a){a=a|0;en(45368);en(45356);en(45344);en(45332);en(45320);en(45308);en(45296);en(45284);en(45272);en(45260);en(45248);en(45236);en(45224);en(45212);return}function Zv(a){a=a|0;Sm(46e3);Sm(45988);Sm(45976);Sm(45964);Sm(45952);Sm(45940);Sm(45928);Sm(45916);Sm(45904);Sm(45892);Sm(45880);Sm(45868);Sm(45856);Sm(45844);Sm(45832);Sm(45820);Sm(45808);Sm(45796);Sm(45784);Sm(45772);Sm(45760);Sm(45748);Sm(45736);Sm(45724);return}function _v(a){a=a|0;en(46292);en(46280);en(46268);en(46256);en(46244);en(46232);en(46220);en(46208);en(46196);en(46184);en(46172);en(46160);en(46148);en(46136);en(46124);en(46112);en(46100);en(46088);en(46076);en(46064);en(46052);en(46040);en(46028);en(46016);return}function $v(a){a=a|0;Sm(47104);Sm(47092);Sm(47080);Sm(47068);Sm(47056);Sm(47044);Sm(47032);Sm(47020);Sm(47008);Sm(46996);Sm(46984);Sm(46972);Sm(46960);Sm(46948);Sm(46936);Sm(46924);Sm(46912);Sm(46900);Sm(46888);Sm(46876);Sm(46864);Sm(46852);Sm(46840);Sm(46828);return}function aw(a){a=a|0;en(47396);en(47384);en(47372);en(47360);en(47348);en(47336);en(47324);en(47312);en(47300);en(47288);en(47276);en(47264);en(47252);en(47240);en(47228);en(47216);en(47204);en(47192);en(47180);en(47168);en(47156);en(47144);en(47132);en(47120);return}function bw(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;i=r;r=r+32|0;h=i;f=k[a+8>>2]|0;c=k[a+4>>2]|0;if(f-c>>2>>>0>>0){d=k[a>>2]|0;g=c-d>>2;e=g+b|0;if(e>>>0>1073741823)jj(a);c=f-d|0;if(c>>2>>>0<536870911){c=c>>1;c=c>>>0>>0?e:c}else c=1073741823;dw(h,c,g,a+16|0);g=h+8|0;f=k[g>>2]|0;sw(f|0,0,b<<2|0)|0;k[g>>2]=f+(b<<2);ew(a,h);fw(h)}else cw(a,b);r=i;return}function cw(a,b){a=a|0;b=b|0;var c=0;c=a+4|0;a=b;b=k[c>>2]|0;do{k[b>>2]=0;b=(k[c>>2]|0)+4|0;k[c>>2]=b;a=a+-1|0}while((a|0)!=0);return}function dw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;k[a+12>>2]=0;k[a+16>>2]=d;do if(b){e=d+112|0;if(b>>>0<29&(i[e>>0]|0)==0){i[e>>0]=1;break}else{d=lj(b<<2)|0;break}}else d=0;while(0);k[a>>2]=d;c=d+(c<<2)|0;k[a+8>>2]=c;k[a+4>>2]=c;k[a+12>>2]=d+(b<<2);return}function ew(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;d=k[a>>2]|0;f=a+4|0;c=b+4|0;e=(k[f>>2]|0)-d|0;g=(k[c>>2]|0)+(0-(e>>2)<<2)|0;k[c>>2]=g;vw(g|0,d|0,e|0)|0;e=k[a>>2]|0;k[a>>2]=k[c>>2];k[c>>2]=e;e=b+8|0;d=k[f>>2]|0;k[f>>2]=k[e>>2];k[e>>2]=d;e=a+8|0;a=b+12|0;d=k[e>>2]|0;k[e>>2]=k[a>>2];k[a>>2]=d;k[b>>2]=k[c>>2];return}function fw(a){a=a|0;var b=0,c=0,d=0;c=k[a+4>>2]|0;d=a+8|0;b=k[d>>2]|0;if((b|0)!=(c|0)){do b=b+-4|0;while((b|0)!=(c|0));k[d>>2]=b}c=k[a>>2]|0;do if(c){b=k[a+16>>2]|0;if((b|0)==(c|0)){i[b+112>>0]=0;break}else{mj(c);break}}while(0);return}function gw(a,b){a=a|0;b=b|0;var c=0;if(b>>>0>1073741823)jj(a);c=a+128|0;if(b>>>0<29&(i[c>>0]|0)==0){i[c>>0]=1;c=a+16|0}else c=lj(b<<2)|0;k[a+4>>2]=c;k[a>>2]=c;k[a+8>>2]=c+(b<<2);return}function hw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,h=0;h=r;r=r+16|0;g=h;do if((a|0)!=(b|0)){e=mk()|0;f=k[e>>2]|0;k[e>>2]=0;d=+ql(a,g,fp()|0);a=k[e>>2]|0;if(!a)k[e>>2]=f;if((k[g>>2]|0)!=(b|0)){k[c>>2]=4;d=0.0;break}if((a|0)==34)k[c>>2]=4}else{k[c>>2]=4;d=0.0}while(0);r=h;return +d}function iw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,h=0;h=r;r=r+16|0;g=h;do if((a|0)!=(b|0)){e=mk()|0;f=k[e>>2]|0;k[e>>2]=0;d=+ql(a,g,fp()|0);a=k[e>>2]|0;if(!a)k[e>>2]=f;if((k[g>>2]|0)!=(b|0)){k[c>>2]=4;d=0.0;break}if((a|0)==34)k[c>>2]=4}else{k[c>>2]=4;d=0.0}while(0);r=h;return +d}function jw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,h=0;h=r;r=r+16|0;g=h;do if((a|0)==(b|0)){k[c>>2]=4;d=0.0}else{e=mk()|0;f=k[e>>2]|0;k[e>>2]=0;d=+ql(a,g,fp()|0);a=k[e>>2]|0;if(!a)k[e>>2]=f;if((k[g>>2]|0)!=(b|0)){k[c>>2]=4;d=0.0;break}if((a|0)==34)k[c>>2]=4}while(0);r=h;return +d}function kw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;h=r;r=r+16|0;g=h;do if((a|0)!=(b|0)){if((i[a>>0]|0)==45){k[c>>2]=4;d=0;a=0;break}e=mk()|0;f=k[e>>2]|0;k[e>>2]=0;a=fk(a,g,d,fp()|0)|0;d=k[e>>2]|0;if(!d)k[e>>2]=f;if((k[g>>2]|0)!=(b|0)){k[c>>2]=4;d=0;a=0;break}if((d|0)==34){k[c>>2]=4;d=-1;a=-1}else d=M}else{k[c>>2]=4;d=0;a=0}while(0);M=d;r=h;return a|0}function lw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;j=r;r=r+16|0;h=j;do if((a|0)!=(b|0)){if((i[a>>0]|0)==45){k[c>>2]=4;a=0;break}f=mk()|0;g=k[f>>2]|0;k[f>>2]=0;a=fk(a,h,d,fp()|0)|0;d=M;e=k[f>>2]|0;if(!e)k[f>>2]=g;if((k[h>>2]|0)!=(b|0)){k[c>>2]=4;a=0;break}if(d>>>0>0|(d|0)==0&a>>>0>4294967295|(e|0)==34){k[c>>2]=4;a=-1;break}else break}else{k[c>>2]=4;a=0}while(0);r=j;return a|0}function mw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;j=r;r=r+16|0;h=j;do if((a|0)!=(b|0)){if((i[a>>0]|0)==45){k[c>>2]=4;a=0;break}f=mk()|0;g=k[f>>2]|0;k[f>>2]=0;a=fk(a,h,d,fp()|0)|0;d=M;e=k[f>>2]|0;if(!e)k[f>>2]=g;if((k[h>>2]|0)!=(b|0)){k[c>>2]=4;a=0;break}if(d>>>0>0|(d|0)==0&a>>>0>4294967295|(e|0)==34){k[c>>2]=4;a=-1;break}else break}else{k[c>>2]=4;a=0}while(0);r=j;return a|0}function nw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;j=r;r=r+16|0;h=j;do if((a|0)!=(b|0)){if((i[a>>0]|0)==45){k[c>>2]=4;a=0;break}f=mk()|0;g=k[f>>2]|0;k[f>>2]=0;a=fk(a,h,d,fp()|0)|0;d=M;e=k[f>>2]|0;if(!e)k[f>>2]=g;if((k[h>>2]|0)!=(b|0)){k[c>>2]=4;a=0;break}if(d>>>0>0|(d|0)==0&a>>>0>65535|(e|0)==34){k[c>>2]=4;a=-1;break}else{a=a&65535;break}}else{k[c>>2]=4;a=0}while(0);r=j;return a|0}function ow(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=r;r=r+16|0;h=i;do if((a|0)!=(b|0)){f=mk()|0;g=k[f>>2]|0;k[f>>2]=0;a=gk(a,h,d,fp()|0)|0;d=M;e=k[f>>2]|0;if(!e)k[f>>2]=g;if((k[h>>2]|0)!=(b|0)){k[c>>2]=4;d=0;a=0;break}if((e|0)==34){k[c>>2]=4;h=(d|0)>0|(d|0)==0&a>>>0>0;M=h?2147483647:-2147483648;r=i;return (h?-1:0)|0}}else{k[c>>2]=4;d=0;a=0}while(0);M=d;r=i;return a|0}function pw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=r;r=r+16|0;h=i;a:do if((a|0)==(b|0)){k[c>>2]=4;a=0}else{f=mk()|0;g=k[f>>2]|0;k[f>>2]=0;a=gk(a,h,d,fp()|0)|0;d=M;e=k[f>>2]|0;if(!e)k[f>>2]=g;if((k[h>>2]|0)!=(b|0)){k[c>>2]=4;a=0;break}do if((e|0)==34){k[c>>2]=4;if((d|0)>0|(d|0)==0&a>>>0>0){a=2147483647;break a}}else{if((d|0)<-1|(d|0)==-1&a>>>0<2147483648){k[c>>2]=4;break}if((d|0)>0|(d|0)==0&a>>>0>2147483647){k[c>>2]=4;a=2147483647;break a}else break a}while(0);a=-2147483648}while(0);r=i;return a|0}function qw(){}function rw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (M=d,a-c>>>0|0)|0}function sw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=a+c|0;if((c|0)>=20){b=b&255;f=a&3;g=b|b<<8|b<<16|b<<24;e=d&~3;if(f){f=a+4-f|0;while((a|0)<(f|0)){i[a>>0]=b;a=a+1|0}}while((a|0)<(e|0)){k[a>>2]=g;a=a+4|0}}while((a|0)<(d|0)){i[a>>0]=b;a=a+1|0}return a-c|0}function tw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (M=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function uw(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){M=b>>>c;return a>>>c|(b&(1<>>c-32|0}function vw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if((c|0)>=4096)return db(a|0,b|0,c|0)|0;d=a|0;if((a&3)==(b&3)){while(a&3){if(!c)return d|0;i[a>>0]=i[b>>0]|0;a=a+1|0;b=b+1|0;c=c-1|0}while((c|0)>=4){k[a>>2]=k[b>>2];a=a+4|0;b=b+4|0;c=c-4|0}}while((c|0)>0){i[a>>0]=i[b>>0]|0;a=a+1|0;b=b+1|0;c=c-1|0}return d|0}function ww(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){M=b<>>32-c;return a<0){a=a-1|0;b=b-1|0;c=c-1|0;i[a>>0]=i[b>>0]|0}a=d}else vw(a,b,c)|0;return a|0}function yw(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){M=b>>c;return a>>>c|(b&(1<>c-32|0}function zw(a){a=a|0;var b=0;b=i[v+(a&255)>>0]|0;if((b|0)<8)return b|0;b=i[v+(a>>8&255)>>0]|0;if((b|0)<8)return b+8|0;b=i[v+(a>>16&255)>>0]|0;if((b|0)<8)return b+16|0;return (i[v+(a>>>24)>>0]|0)+24|0}function Aw(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=ia(e,f)|0;d=a>>>16;a=(c>>>16)+(ia(e,d)|0)|0;e=b>>>16;b=ia(e,f)|0;return (M=(a>>>16)+(ia(e,d)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|c&65535|0)|0}function Bw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=b>>31|((b|0)<0?-1:0)<<1;i=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;f=d>>31|((d|0)<0?-1:0)<<1;e=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;h=rw(j^a,i^b,j,i)|0;g=M;a=f^j;b=e^i;return rw((Gw(h,g,rw(f^c,e^d,f,e)|0,M,0)|0)^a,M^b,a,b)|0}function Cw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=r;r=r+16|0;h=e|0;g=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;j=d>>31|((d|0)<0?-1:0)<<1;i=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;a=rw(g^a,f^b,g,f)|0;b=M;Gw(a,b,rw(j^c,i^d,j,i)|0,M,h)|0;d=rw(k[h>>2]^g,k[h+4>>2]^f,g,f)|0;c=M;r=e;return (M=c,d)|0}function Dw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;c=Aw(e,f)|0;a=M;return (M=(ia(b,f)|0)+(ia(d,e)|0)+a|a&0,c|0|0)|0}function Ew(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Gw(a,b,c,d,0)|0}function Fw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;f=r;r=r+16|0;e=f|0;Gw(a,b,c,d,e)|0;r=f;return (M=k[e+4>>2]|0,k[e>>2]|0)|0}function Gw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0;l=a;i=b;j=i;g=c;n=d;h=n;if(!j){f=(e|0)!=0;if(!h){if(f){k[e>>2]=(l>>>0)%(g>>>0);k[e+4>>2]=0}n=0;e=(l>>>0)/(g>>>0)>>>0;return (M=n,e)|0}else{if(!f){n=0;e=0;return (M=n,e)|0}k[e>>2]=a|0;k[e+4>>2]=b&0;n=0;e=0;return (M=n,e)|0}}f=(h|0)==0;do if(g){if(!f){f=(ka(h|0)|0)-(ka(j|0)|0)|0;if(f>>>0<=31){m=f+1|0;h=31-f|0;b=f-31>>31;g=m;a=l>>>(m>>>0)&b|j<>>(m>>>0)&b;f=0;h=l<>2]=a|0;k[e+4>>2]=i|b&0;n=0;e=0;return (M=n,e)|0}f=g-1|0;if(f&g){h=(ka(g|0)|0)+33-(ka(j|0)|0)|0;p=64-h|0;m=32-h|0;i=m>>31;o=h-32|0;b=o>>31;g=h;a=m-1>>31&j>>>(o>>>0)|(j<>>(h>>>0))&b;b=b&j>>>(h>>>0);f=l<>>(o>>>0))&i|l<>31;break}if(e){k[e>>2]=f&l;k[e+4>>2]=0}if((g|0)==1){o=i|b&0;p=a|0|0;return (M=o,p)|0}else{p=zw(g|0)|0;o=j>>>(p>>>0)|0;p=j<<32-p|l>>>(p>>>0)|0;return (M=o,p)|0}}else{if(f){if(e){k[e>>2]=(j>>>0)%(g>>>0);k[e+4>>2]=0}o=0;p=(j>>>0)/(g>>>0)>>>0;return (M=o,p)|0}if(!l){if(e){k[e>>2]=0;k[e+4>>2]=(j>>>0)%(h>>>0)}o=0;p=(j>>>0)/(h>>>0)>>>0;return (M=o,p)|0}f=h-1|0;if(!(f&h)){if(e){k[e>>2]=a|0;k[e+4>>2]=f&j|b&0}o=0;p=j>>>((zw(h|0)|0)>>>0);return (M=o,p)|0}f=(ka(h|0)|0)-(ka(j|0)|0)|0;if(f>>>0<=30){b=f+1|0;h=31-f|0;g=b;a=j<>>(b>>>0);b=j>>>(b>>>0);f=0;h=l<>2]=a|0;k[e+4>>2]=i|b&0;o=0;p=0;return (M=o,p)|0}while(0);if(!g){j=h;i=0;h=0}else{m=c|0|0;l=n|d&0;j=tw(m|0,l|0,-1,-1)|0;c=M;i=h;h=0;do{d=i;i=f>>>31|i<<1;f=h|f<<1;d=a<<1|d>>>31|0;n=a>>>31|b<<1|0;rw(j,c,d,n)|0;p=M;o=p>>31|((p|0)<0?-1:0)<<1;h=o&1;a=rw(d,n,o&m,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;b=M;g=g-1|0}while((g|0)!=0);j=i;i=0}g=0;if(e){k[e>>2]=a;k[e+4>>2]=b}o=(f|0)>>>31|(j|g)<<1|(g<<1|f>>>31)&0|i;p=(f<<1|0>>>31)&-2|h;return (M=o,p)|0}function Hw(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;return Ib[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0)|0}function Iw(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Jb[a&15](b|0,c|0,d|0,e|0,f|0)}function Jw(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;return Kb[a&3](b|0,c|0,d|0,e|0,f|0,+g)|0}function Kw(a,b){a=a|0;b=b|0;Lb[a&255](b|0)}function Lw(a,b,c){a=a|0;b=b|0;c=c|0;Mb[a&127](b|0,c|0)}function Mw(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Nb[a&63](b|0,c|0,d|0,e|0,f|0,g|0)|0}function Nw(a,b){a=a|0;b=b|0;return Ob[a&127](b|0)|0}function Ow(a,b,c,d,e,f,g,h,i,j,k,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;return Pb[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0,l|0)|0}function Pw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Qb[a&63](b|0,c|0,d|0)|0}function Qw(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;Rb[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0,l|0,m|0,n|0,o|0,p|0)}function Rw(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Sb[a&15](b|0,c|0,d|0,e|0,f|0,g|0)}function Sw(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;Tb[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function Tw(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;Ub[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)}function Uw(a,b,c){a=a|0;b=b|0;c=c|0;return Vb[a&63](b|0,c|0)|0}function Vw(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return Wb[a&31](b|0,c|0,d|0,e|0,f|0)|0}function Ww(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +Xb[a&3](b|0,c|0,d|0)}function Xw(a){a=a|0;return Yb[a&15]()|0}function Yw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Zb[a&31](b|0,c|0,d|0,e|0)|0}function Zw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;_b[a&15](b|0,c|0,d|0)}function _w(a){a=a|0;$b[a&7]()}function $w(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return ac[a&15](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)|0}function ax(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;return bc[a&7](b|0,c|0,d|0,e|0,+f)|0}function bx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;cc[a&63](b|0,c|0,d|0,e|0)}function cx(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;la(0);return 0}function dx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;la(1)}function ex(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;la(2);return 0}function fx(a){a=a|0;la(3)}function gx(a,b){a=a|0;b=b|0;la(4)}function hx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;la(5);return 0}function ix(a){a=a|0;la(6);return 0}function jx(a){a=a|0;return lb(a|0)|0}function kx(a){a=a|0;return Ab(a|0)|0}function lx(a){a=a|0;return qb(a|0)|0}function mx(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;la(7);return 0}function nx(a,b,c){a=a|0;b=b|0;c=c|0;la(8);return 0}function ox(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;la(9)}function px(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;la(10)}function qx(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;la(11)}function rx(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;la(12)}function sx(a,b){a=a|0;b=b|0;la(13);return 0}function tx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;la(14);return 0}function ux(a,b,c){a=a|0;b=b|0;c=c|0;la(15);return 0.0}function vx(){la(16);return 0}function wx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;la(17);return 0}function xx(a,b,c){a=a|0;b=b|0;c=c|0;la(18)}function yx(a,b,c){a=a|0;b=b|0;c=c|0;ub(a|0,b|0,c|0)}function zx(){la(19)}function Ax(){yb()}function Bx(){eb()}function Cx(){vb()}function Dx(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;la(20);return 0}function Ex(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;la(21);return 0}function Fx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;la(22)} -function ni(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0;l=r;r=r+32|0;h=l;Oi(h,255,0);j=a+152|0;if(((k[h+4>>2]|0)==(k[j>>2]|0)?(k[h+8>>2]|0)==(k[a+156>>2]|0):0)?(k[h+12>>2]|0)==(k[a+160>>2]|0):0){j=k[8900]|0;k[a+4580>>2]=j+(((k[8901]|0)-j|0)>>>1);r=l;return}c=a+4584|0;d=a+4588|0;e=k[d>>2]|0;b=k[c>>2]|0;f=e-b|0;if(f>>>0>=512){if(f>>>0>512?(g=b+512|0,(e|0)!=(g|0)):0)k[d>>2]=g}else{se(c,512-f|0);b=k[c>>2]|0}h=a+4580|0;k[h>>2]=b+256;g=a+160|0;e=a+156|0;f=-256;while(1){b=k[g>>2]|0;if((f|0)>(0-b|0)){c=k[e>>2]|0;if((f|0)>(0-c|0)){d=k[j>>2]|0;if((f|0)>(0-d|0))if((f|0)>=0){if((f|0)<1){i[(k[h>>2]|0)+f>>0]=0;f=1;continue}if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1}else b=-1;else b=-2}else b=-3}else b=-4;i[(k[h>>2]|0)+f>>0]=b;f=f+1|0;if((f|0)==256)break}r=l;return}function oi(a){a=a|0;var b=0,c=0;k[a>>2]=35660;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}a=a+88|0;b=k[a>>2]|0;k[a>>2]=0;if(!b)return;Lb[k[(k[b>>2]|0)+4>>2]&255](b);return}function pi(a){a=a|0;var b=0,c=0;k[a>>2]=35660;b=k[a+4608>>2]|0;if(b){c=a+4612|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}k[a>>2]=36736;b=k[a+92>>2]|0;if(b){c=a+96|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b)}c=a+88|0;b=k[c>>2]|0;k[c>>2]=0;if(!b){mj(a);return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);mj(a);return}function qi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,y=0,z=0;u=r;r=r+352|0;v=u+328|0;y=u+192|0;c=u+343|0;d=u+342|0;e=u+341|0;f=u+340|0;o=u+176|0;h=u+168|0;j=u+160|0;l=u+152|0;t=u;q=u+136|0;if((k[a+28>>2]|0)!=0?(k[a+20>>2]|0)!=1:0){p=a+4|0;s=a+32|0;g=k[s>>2]|0;if(!g){a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[c>>0]|0;Ja(44,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}a=k[a+12>>2]|0;if((a|0)==8)switch(g|0){case 1:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[d>>0]|0;Ja(45,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[e>>0]|0;Ja(46,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(48)|0;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];i[v>>0]=i[f>>0]|0;Ja(47,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=y+56|0;e=y+4|0;k[y>>2]=36160;k[g>>2]=36180;x=0;ra(62,y+56|0,e|0);u=x;x=0;if(u&1){z=Wa()|0;qn(g);fb(z|0)}k[y+128>>2]=0;k[y+132>>2]=-1;k[y>>2]=36200;k[y+56>>2]=36220;x=0;qa(180,e|0);u=x;x=0;do if(u&1)a=Wa()|0;else{k[e>>2]=36236;f=y+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[y+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);u=x;x=0;if(u&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,y|0,49007,21)|0;v=x;x=0;do if((!(v&1)?(x=0,m=Aa(36,a|0,k[s>>2]|0)|0,v=x,x=0,!(v&1)):0)?(x=0,va(28,m|0,50997,18)|0,v=x,x=0,!(v&1)):0){d=Va(16)|0;x=0;ra(64,o|0,e|0);v=x;x=0;if(!(v&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,o|0);v=x;x=0;if(v&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(o);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=34;while(0);if((z|0)==34)a=Wa()|0;k[y>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}if((a|0)<=8){a=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,a|0,8,35648);z=x;x=0;if(!(z&1))ub(a|0,824,96);z=Wa()|0;Ua(a|0);fb(z|0)}c=16-a|0;switch(g|0){case 1:{a=lj(60)|0;k[h>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[h>>2];k[v+4>>2]=k[h+4>>2];Ja(41,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 2:{a=lj(60)|0;k[j>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[j>>2];k[v+4>>2]=k[j+4>>2];Ja(42,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}case 3:{a=lj(60)|0;k[l>>2]=c;x=0;k[y>>2]=k[b>>2];k[y+4>>2]=k[b+4>>2];k[y+8>>2]=k[b+8>>2];k[v>>2]=k[l>>2];k[v+4>>2]=k[l+4>>2];Ja(43,a|0,y|0,p|0,v|0);z=x;x=0;if(!(z&1)){z=a;r=u;return z|0}z=Wa()|0;mj(a);fb(z|0)}default:{g=t+56|0;e=t+4|0;k[t>>2]=36160;k[g>>2]=36180;x=0;ra(62,t+56|0,e|0);y=x;x=0;if(y&1){z=Wa()|0;qn(g);fb(z|0)}k[t+128>>2]=0;k[t+132>>2]=-1;k[t>>2]=36200;k[t+56>>2]=36220;x=0;qa(180,e|0);y=x;x=0;do if(y&1)a=Wa()|0;else{k[e>>2]=36236;f=t+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[t+52>>2]=16;k[v>>2]=0;k[v+4>>2]=0;k[v+8>>2]=0;x=0;ra(63,e|0,v|0);y=x;x=0;if(y&1){a=Wa()|0;Sm(v);Sm(f);xn(e);break}Sm(v);x=0;a=va(28,t|0,49007,21)|0;y=x;x=0;do if((!(y&1)?(x=0,n=Aa(36,a|0,k[s>>2]|0)|0,y=x,x=0,!(y&1)):0)?(x=0,va(28,n|0,50997,18)|0,y=x,x=0,!(y&1)):0){d=Va(16)|0;x=0;ra(64,q|0,e|0);y=x;x=0;if(!(y&1)){if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Ja(36,d|0,9,35648,q|0);y=x;x=0;if(y&1)c=1;else{x=0;Fa(6,d|0,824,96);x=0;c=0}a=Wa()|0;Sm(q);if(!c)break}else a=Wa()|0;Ua(d|0)}else z=64;while(0);if((z|0)==64)a=Wa()|0;k[t>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);z=a;fb(z|0)}while(0);z=a;qn(g);fb(z|0)}}}c=k[b+4>>2]|0;d=lj(16)|0;a=k[a+16>>2]|0;if(!c){z=k[b>>2]|0;k[d>>2]=36132;k[d+4>>2]=z;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}else{k[d>>2]=36108;k[d+4>>2]=c;k[d+8>>2]=1;k[d+12>>2]=a;z=d;r=u;return z|0}return 0}function ri(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,l=0;g=r;r=r+32|0;l=g;Oi(l,k[a+128>>2]|0,k[a+136>>2]|0);h=k[b+4>>2]|0;f=k[b+8>>2]|0;f=(f|0)==0?k[l+8>>2]|0:f;e=k[b+12>>2]|0;e=(e|0)==0?k[l+12>>2]|0:e;c=k[b+16>>2]|0;d=k[l+16>>2]|0;k[a+176>>2]=(h|0)==0?k[l+4>>2]|0:h;k[a+180>>2]=f;k[a+184>>2]=e;zi(a);e=a+132|0;b=(k[e>>2]|0)+32|0;b=(b|0)<128?2:(b|0)/64|0;f=0;do{k[a+188+(f*12|0)>>2]=b;k[a+188+(f*12|0)+4>>2]=0;j[a+188+(f*12|0)+8>>1]=0;j[a+188+(f*12|0)+10>>1]=1;f=f+1|0}while((f|0)!=365);h=(k[e>>2]|0)+32|0;h=(h|0)<128?2:(h|0)/64|0;l=((c|0)==0?d:c)&255;k[a+4568>>2]=h;k[a+4572>>2]=0;i[a+4576>>0]=l;i[a+4577>>0]=1;i[a+4578>>0]=0;k[a+4580>>2]=h;k[a+4584>>2]=1;i[a+4588>>0]=l;i[a+4589>>0]=1;i[a+4590>>0]=0;k[a+4592>>2]=0;r=g;return}function si(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=a+88|0;f=k[b>>2]|0;k[b>>2]=0;b=k[g>>2]|0;k[g>>2]=f;if(b)Lb[k[(k[b>>2]|0)+4>>2]&255](b);g=d+4|0;f=k[g>>2]|0;i[a+4620>>0]=e&1;b=a+156|0;k[b>>2]=k[c>>2];k[b+4>>2]=k[c+4>>2];k[b+8>>2]=k[c+8>>2];k[b+12>>2]=k[c+12>>2];ee(a,d);ti(a);b=k[a+116>>2]|0;a=k[a+112>>2]|0;while(1){e=b+-1|0;c=(i[e>>0]|0)==-1?7:8;if((a|0)<(c|0))break;else{b=e;a=a-c|0}}b=b-f|0;e=k[g>>2]|0;if(!e)return;k[g>>2]=e+b;d=d+8|0;k[d>>2]=(k[d>>2]|0)-b;return}function ti(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0;A=r;r=r+32|0;C=A+12|0;z=A;h=a+172|0;y=(k[h>>2]|0)+4|0;if((k[a+28>>2]|0)==1)j=k[a+20>>2]|0;else j=1;b=ia(j<<1,y)|0;k[C>>2]=0;D=C+4|0;k[D>>2]=0;k[C+8>>2]=0;a:do if(b){if(!((b|0)<0?(x=0,qa(178,C|0),B=x,x=0,B&1):0))w=6;if((w|0)==6?(x=0,c=ta(67,b|0)|0,B=x,x=0,!(B&1)):0){k[D>>2]=c;k[C>>2]=c;k[C+8>>2]=c+b;while(1){i[c>>0]=0;c=(k[D>>2]|0)+1|0;k[D>>2]=c;b=b+-1|0;if(!b)break a}}c=Wa()|0;b=k[C>>2]|0;if(!b)fb(c|0);if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);fb(c|0)}while(0);k[z>>2]=0;B=z+4|0;k[B>>2]=0;k[z+8>>2]=0;do if(!j)w=19;else{if(!(j>>>0>1073741823?(x=0,qa(178,z|0),v=x,x=0,v&1):0))w=17;if((w|0)==17?(d=j<<2,x=0,e=ta(67,d|0)|0,v=x,x=0,!(v&1)):0){k[z>>2]=e;w=e+(j<<2)|0;k[z+8>>2]=w;sw(e|0,0,d|0)|0;k[B>>2]=w;w=19;break}c=Wa()|0;b=k[z>>2]|0;d=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}while(0);if((w|0)==19){l=a+8|0;b=k[l>>2]|0;b:do if((b|0)>0){m=a+4596|0;n=ia(j,y)|0;o=n+1|0;p=a+4600|0;q=a+160|0;s=a+168|0;t=a+164|0;u=a+156|0;v=a+88|0;g=a+4592|0;if((j|0)>0)f=0;else{f=0;while(1){e=k[C>>2]|0;c=e+1|0;k[m>>2]=c;d=e+o|0;k[p>>2]=d;if(!(f&1))c=o;else{k[m>>2]=d;k[p>>2]=c;c=1}j=k[q>>2]|0;if((j|0)<=(f|0)?(f|0)<((k[s>>2]|0)+j|0):0){j=k[v>>2]|0;x=0;Ja(k[(k[j>>2]|0)+8>>2]|0,j|0,e+(c+((k[u>>2]|0)-n))|0,k[t>>2]|0,y|0);j=x;x=0;if(j&1)break;b=k[l>>2]|0}f=f+1|0;if((f|0)>=(b|0)){w=50;break b}}c=Wa()|0;break}c:while(1){c=k[C>>2]|0;b=c+1|0;k[m>>2]=b;c=c+o|0;k[p>>2]=c;if(f&1){k[m>>2]=c;k[p>>2]=b;b=c}e=k[z>>2]|0;c=b;d=0;do{k[g>>2]=k[e+(d<<2)>>2];w=k[h>>2]|0;i[c+w>>0]=i[c+(w+-1)>>0]|0;i[(k[p>>2]|0)+-1>>0]=i[k[m>>2]>>0]|0;x=0;ra(83,a|0,0);w=x;x=0;if(w&1){w=38;break c}e=k[z>>2]|0;k[e+(d<<2)>>2]=k[g>>2];c=(k[m>>2]|0)+y|0;k[m>>2]=c;b=k[p>>2]|0;k[p>>2]=b+y;d=d+1|0}while((d|0)<(j|0));w=k[q>>2]|0;if(((w|0)<=(f|0)?(f|0)<((k[s>>2]|0)+w|0):0)?(w=k[v>>2]|0,x=0,Ja(k[(k[w>>2]|0)+8>>2]|0,w|0,b+(y+((k[u>>2]|0)-n))|0,k[t>>2]|0,y|0),w=x,x=0,w&1):0){w=30;break}f=f+1|0;if((f|0)>=(k[l>>2]|0)){w=50;break b}}if((w|0)==30){c=Wa()|0;break}else if((w|0)==38){c=Wa()|0;break}}else w=50;while(0);do if((w|0)==50){x=0;qa(183,a|0);a=x;x=0;if(a&1){c=Wa()|0;break}b=k[z>>2]|0;c=b;if(b){d=k[B>>2]|0;if((d|0)!=(b|0))k[B>>2]=d+(~((d+-4-c|0)>>>2)<<2);mj(b)}b=k[C>>2]|0;if(!b){r=A;return}if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);r=A;return}while(0);b=k[z>>2]|0;d=b;if(b){e=k[B>>2]|0;if((e|0)!=(b|0))k[B>>2]=e+(~((e+-4-d|0)>>>2)<<2);mj(b)}}b=k[C>>2]|0;if(!b)fb(c|0);if((k[D>>2]|0)!=(b|0))k[D>>2]=b;mj(b);fb(c|0)}function ui(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;p=a+4596|0;c=k[p>>2]|0;t=a+172|0;b=k[t>>2]|0;if((b|0)<=0)return;q=a+4600|0;r=a+4604|0;s=a+4592|0;h=c;f=l[c+-1>>0]|0;c=l[c>>0]|0;o=0;while(1){m=k[q>>2]|0;g=i[m+(o+-1)>>0]|0;n=g&255;e=o+1|0;d=l[h+e>>0]|0;j=k[r>>2]|0;h=c-f|0;f=f-n|0;j=((((i[j+(d-c)>>0]|0)*9|0)+(i[j+h>>0]|0)|0)*9|0)+(i[j+f>>0]|0)|0;m=m+o|0;if(!j){b=wi(a,g,m,b-o|0)|0;c=b+o|0;if((c|0)!=(k[t>>2]|0)){n=xi(a,n,l[(k[p>>2]|0)+c>>0]|0)|0;i[(k[q>>2]|0)+c>>0]=n;n=k[s>>2]|0;k[s>>2]=(n|0)<1?0:n+-1|0;b=b+1|0}e=b+o|0;d=k[p>>2]|0;c=l[d+(e+-1)>>0]|0;d=l[d+e>>0]|0}else{b=c-n>>31;if((b^f|0)<0)b=c;else b=n+((b^h|0)<0?0:h)|0;n=vi(a,j,l[m>>0]|0,b,0)|0;i[(k[q>>2]|0)+o>>0]=n}b=k[t>>2]|0;if((b|0)<=(e|0))break;h=k[p>>2]|0;f=c;c=d;o=e}return}function vi(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b>>31;l=(r^b)-r|0;p=a+188+(l*12|0)+10|0;c=j[p>>1]|0;o=a+188+(l*12|0)|0;e=k[o>>2]|0;if((c|0)<(e|0))if((c<<1|0)<(e|0))if((c<<2|0)<(e|0))if((c<<3|0)<(e|0))if((c<<4|0)<(e|0)){b=5;while(1)if((c<>1]^r)-r+d|0;q=a+128|0;e=k[q>>2]|0;if((c&e|0)==(c|0))m=c;else m=e&~(c>>31);c=a+112|0;if((k[c>>2]|0)<8)qe(a);e=a+108|0;d=k[e>>2]|0;f=d>>>24;g=k[2832+(b<<11)+(f<<3)+4>>2]|0;if(!g){h=k[a+148>>2]|0;e=k[a+140>>2]|0;c=Tg(a)|0;if((c|0)<(h+-1-e|0)){if(b)c=(Ug(a,b)|0)+(c<>31^c>>1;if((((c|0)>-1?c:0-c|0)|0)>65535){c=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,c|0,5,35648);a=x;x=0;if(a&1){a=Wa()|0;Ua(c|0);fb(a|0)}else ub(c|0,824,96)}}else{k[c>>2]=(k[c>>2]|0)-g;k[e>>2]=d<>2]|0}h=a+136|0;d=k[h>>2]|0;if(!b){if(!d)e=(k[a+188+(l*12|0)+4>>2]<<1)+-1+(j[p>>1]|0)>>31;else e=0;g=e^c}else g=c;b=k[a+152>>2]|0;e=(k[o>>2]|0)+((g|0)>-1?g:0-g|0)|0;f=a+188+(l*12|0)+4|0;c=(k[f>>2]|0)+(ia(d<<1|1,g)|0)|0;d=j[p>>1]|0;if((d|0)==(b|0)){e=e>>1;c=c>>1;d=b>>1}k[o>>2]=e;b=d+1|0;j[p>>1]=b;e=b+c|0;if((e|0)>=1){if((c|0)>0){c=c-b|0;p=j[n>>1]|0;j[n>>1]=(p<<16>>16<127&1)+(p&65535);c=(c|0)>0?0:c}}else{c=j[n>>1]|0;j[n>>1]=(c&65535)-(c<<16>>16>-128&1);c=(e|0)>(~d|0)?e:0-d|0}k[f>>2]=c;b=k[h>>2]|0;d=b<<1|1;e=(ia(d,(g^r)-r|0)|0)+m|0;if((e|0)>=(0-b|0)){c=k[q>>2]|0;if((c+b|0)<(e|0))e=e-(ia(k[a+132>>2]|0,d)|0)|0}else{e=(ia(k[a+132>>2]|0,d)|0)+e|0;c=k[q>>2]|0}if((e&c|0)==(e|0)){a=e;a=a&255;return a|0}a=c&~(e>>31);a=a&255;return a|0}function wi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;h=a+112|0;j=a+108|0;l=a+4592|0;e=k[h>>2]|0;f=0;while(1){if((e|0)<1){qe(a);e=k[h>>2]|0}g=k[j>>2]|0;e=e+-1|0;k[h>>2]=e;k[j>>2]=g<<1;if((g|0)>=0){m=8;break}g=k[l>>2]|0;n=1<>2];o=d-f|0;o=(n|0)<(o|0)?n:o;f=o+f|0;if((o|0)==(n|0))k[l>>2]=(g|0)>30?31:g+1|0;if((f|0)==(d|0)){e=d;break}}if((m|0)==8)if((f|0)!=(d|0)){e=k[l>>2]|0;if((e+-4|0)>>>0<28)e=Ug(a,k[36476+(e<<2)>>2]|0)|0;else e=0;e=e+f|0;if((e|0)>(d|0)){e=Va(16)|0;if((i[8]|0)==0?(Qa(8)|0)!=0:0){tb(72,35648,w|0)|0;Ya(8)}x=0;Fa(7,e|0,5,35648);o=x;x=0;if(o&1){o=Wa()|0;Ua(e|0);fb(o|0)}else ub(e|0,824,96)}}else e=d;if((e|0)<=0)return e|0;sw(c|0,b|0,e|0)|0;return e|0}function xi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=b-c|0;g=a+128|0;d=a+136|0;if((((f|0)>-1?f:0-f|0)|0)>(k[d>>2]|0)){b=ia(yi(a,a+4568|0)|0,c-b>>31|1)|0;e=k[d>>2]|0;f=e<<1|1;b=(ia(b,f)|0)+c|0;if((b|0)>=(0-e|0)){d=k[g>>2]|0;if((d+e|0)<(b|0))b=b-(ia(k[a+132>>2]|0,f)|0)|0}else{b=(ia(k[a+132>>2]|0,f)|0)+b|0;d=k[g>>2]|0}if((b&d|0)==(b|0)){a=b;a=a&255;return a|0}a=d&~(b>>31);a=a&255;return a|0}else{c=yi(a,a+4580|0)|0;f=k[d>>2]|0;e=f<<1|1;b=(ia(e,c)|0)+b|0;if((b|0)>=(0-f|0)){d=k[g>>2]|0;if((d+f|0)<(b|0))b=b-(ia(k[a+132>>2]|0,e)|0)|0}else{b=(ia(k[a+132>>2]|0,e)|0)+b|0;d=k[g>>2]|0}if((b&d|0)==(b|0)){a=b;a=a&255;return a|0}a=d&~(b>>31);a=a&255;return a|0}return 0}function yi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,m=0;m=b+9|0;c=l[m>>0]|0;f=b+4|0;e=(ia(c>>>1,k[f>>2]|0)|0)+(k[b>>2]|0)|0;if((c|0)<(e|0)){d=0;do{c=c<<1;d=d+1|0}while((c|0)<(e|0))}else d=0;g=k[a+148>>2]|0;h=k[36476+(k[a+4592>>2]<<2)>>2]|0;c=k[a+140>>2]|0;e=Tg(a)|0;do if((e|0)<(g+-2-h-c|0))if(!d){d=k[f>>2]|0;a=d+e|0;c=a&1;a=(c+a|0)/2|0;j=8;break}else{h=(Ug(a,d)|0)+(e<>2]|0;e=h+d|0;g=e&1;c=g;f=1;e=(g+e|0)/2|0;break}else{e=(Ug(a,c)|0)+1|0;g=k[f>>2]|0;a=e+g|0;c=a&1;a=(c+a|0)/2|0;if(!d){d=g;j=8}else{h=e;f=1;e=a;d=g}}while(0);if((j|0)==8){h=e;f=l[b+10>>0]<<1>>>0>=(l[m>>0]|0)>>>0;e=a}e=(c|0)!=0^f?e:0-e|0;if((e|0)<0){j=b+10|0;i[j>>0]=(l[j>>0]|0)+1}c=(h+1-d>>1)+(k[b>>2]|0)|0;k[b>>2]=c;d=i[m>>0]|0;if(d<<24>>24!=(i[b+8>>0]|0)){b=d;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}k[b>>2]=c>>1;j=(d&255)>>>1;i[m>>0]=j;b=b+10|0;i[b>>0]=(l[b>>0]|0)>>>1;b=j;b=b&255;b=b+1|0;b=b&255;i[m>>0]=b;return e|0}function zi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0;o=r;r=r+32|0;d=o;n=a+136|0;a:do if(!(k[n>>2]|0)){c=k[a+128>>2]|0;b=a+144|0;if((((c|0)==((1<>2])+-1|0)?(Oi(d,c,0),(k[d+4>>2]|0)==(k[a+176>>2]|0)):0)?(k[d+8>>2]|0)==(k[a+180>>2]|0):0)?(k[d+12>>2]|0)==(k[a+184>>2]|0):0)switch(k[b>>2]|0){case 8:{n=k[8900]|0;k[a+4604>>2]=n+(((k[8901]|0)-n|0)>>>1);r=o;return}case 10:{n=k[8903]|0;k[a+4604>>2]=n+(((k[8904]|0)-n|0)>>>1);r=o;return}case 12:{n=k[8906]|0;k[a+4604>>2]=n+(((k[8907]|0)-n|0)>>>1);r=o;return}case 16:{n=k[8909]|0;k[a+4604>>2]=n+(((k[8910]|0)-n|0)>>>1);r=o;return}default:break a}}else b=a+144|0;while(0);m=1<>2];c=a+4608|0;d=m<<1;e=a+4612|0;f=k[e>>2]|0;b=k[c>>2]|0;g=f-b|0;if(d>>>0<=g>>>0){if(d>>>0>>0?(h=b+d|0,(f|0)!=(h|0)):0)k[e>>2]=h}else{se(c,d-g|0);b=k[c>>2]|0}l=a+4604|0;k[l>>2]=b+m;b=0-m|0;if((m|0)<=(b|0)){r=o;return}h=a+184|0;j=a+180|0;g=a+176|0;f=b;do{b=k[h>>2]|0;if((f|0)>(0-b|0)){c=k[j>>2]|0;if((f|0)>(0-c|0)){d=k[g>>2]|0;if((f|0)>(0-d|0)){e=k[n>>2]|0;if((f|0)>=(0-e|0))if((e|0)<(f|0))if((d|0)<=(f|0))if((c|0)>(f|0))b=2;else b=(b|0)>(f|0)?3:4;else b=1;else b=0;else b=-1}else b=-2}else b=-3}else b=-4;i[(k[l>>2]|0)+f>>0]=b;f=f+1|0}while((f|0)!=(m|0));r=o;return}function Ai(a){a=a|0;mj(a);return}function Bi(a){a=a|0;return 50767}function Ci(a,b,c){a=a|0;b=b|0;c=c|0;Qm(a,50754,12);return}function Di(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;q=r;r=r+16|0;s=q;k[s>>2]=0;t=s+4|0;k[t>>2]=0;k[s+8>>2]=0;o=s+8|0;x=0;e=ta(67,1)|0;n=x;x=0;a:do if((!(n&1)?(n=e+1|0,i[e>>0]=c,k[s>>2]=e,k[t>>2]=n,k[o>>2]=n,x=0,ra(84,s|0,b&65535|0),n=x,x=0,!(n&1)):0)?(x=0,ra(84,s|0,a&65535|0),n=x,x=0,!(n&1)):0){l=d&255;e=k[t>>2]|0;c=k[o>>2]|0;if(e>>>0>=c>>>0){b=k[s>>2]|0;a=b;g=e-a+1|0;if((g|0)<0){x=0;qa(178,s|0);n=x;x=0;if(n&1){p=52;break}a=k[s>>2]|0;c=k[o>>2]|0;b=a}j=b;e=c-j|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;c=k[t>>2]|0;h=c-j|0;if(!e){e=0;g=0}else p=12}else{h=k[t>>2]|0;e=2147483647;c=h;h=h-j|0;p=12}if((p|0)==12){x=0;g=ta(67,e|0)|0;n=x;x=0;if(n&1){p=52;break}}i[g+h>>0]=l;m=c-j|0;n=g+(h-m)|0;vw(n|0,b|0,m|0)|0;k[s>>2]=n;k[t>>2]=g+(h+1);k[o>>2]=g+e;if(a)mj(a)}else{i[e>>0]=l;k[t>>2]=(k[t>>2]|0)+1}b:do if((d|0)>0){n=0;while(1){n=n+1|0;m=n&255;e=k[t>>2]|0;b=k[o>>2]|0;if(e>>>0>=b>>>0){a=k[s>>2]|0;c=a;g=e-c+1|0;if((g|0)<0){x=0;qa(178,s|0);l=x;x=0;if(l&1)break;a=k[s>>2]|0;c=a;b=k[o>>2]|0}l=a;e=b-l|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;b=k[t>>2]|0;h=b-l|0;if(!e){j=0;g=0}else p=25}else{h=k[t>>2]|0;e=2147483647;b=h;h=h-l|0;p=25}if((p|0)==25){p=0;x=0;g=ta(67,e|0)|0;j=x;x=0;if(j&1)break;else j=e}i[g+h>>0]=m;e=g+(h+1)|0;l=b-l|0;m=g+(h-l)|0;vw(m|0,a|0,l|0)|0;k[s>>2]=m;k[t>>2]=e;k[o>>2]=g+j;if(c){mj(c);e=k[t>>2]|0}}else{i[e>>0]=m;e=(k[t>>2]|0)+1|0;k[t>>2]=e}c=k[o>>2]|0;if(e>>>0>=c>>>0){b=k[s>>2]|0;a=b;g=e-a+1|0;if((g|0)<0){x=0;qa(178,s|0);m=x;x=0;if(m&1)break;a=k[s>>2]|0;c=k[o>>2]|0;b=a}l=b;e=c-l|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;g=k[t>>2]|0;h=g-l|0;if(!e){j=0;c=0}else p=36}else{h=k[t>>2]|0;e=2147483647;g=h;h=h-l|0;p=36}if((p|0)==36){p=0;x=0;c=ta(67,e|0)|0;m=x;x=0;if(m&1)break;else j=e}i[c+h>>0]=17;e=c+(h+1)|0;l=g-l|0;m=c+(h-l)|0;vw(m|0,b|0,l|0)|0;k[s>>2]=m;k[t>>2]=e;k[o>>2]=c+j;if(a){mj(a);e=k[t>>2]|0}}else{i[e>>0]=17;e=(k[t>>2]|0)+1|0;k[t>>2]=e}c=k[o>>2]|0;if(e>>>0>=c>>>0){b=k[s>>2]|0;a=b;g=e-a+1|0;if((g|0)<0){x=0;qa(178,s|0);m=x;x=0;if(m&1)break;a=k[s>>2]|0;c=k[o>>2]|0;b=a}j=b;e=c-j|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;c=k[t>>2]|0;h=c-j|0;if(!e){e=0;g=0}else p=48}else{h=k[t>>2]|0;e=2147483647;c=h;h=h-j|0;p=48}if((p|0)==48){p=0;x=0;g=ta(67,e|0)|0;m=x;x=0;if(m&1)break}i[g+h>>0]=0;l=c-j|0;m=g+(h-l)|0;vw(m|0,b|0,l|0)|0;k[s>>2]=m;k[t>>2]=g+(h+1);k[o>>2]=g+e;if(a)mj(a)}else{i[e>>0]=0;k[t>>2]=(k[t>>2]|0)+1}if((n|0)>=(d|0))break b}f=Wa()|0;break a}while(0);x=0;h=ta(67,20)|0;d=x;x=0;if(!(d&1)){k[h>>2]=36800;i[h+4>>0]=-9;a=h+8|0;k[a>>2]=0;g=h+12|0;k[g>>2]=0;c=h+16|0;k[c>>2]=0;e=k[t>>2]|0;d=k[s>>2]|0;b=e-d|0;do if((e|0)!=(d|0)){if(!((b|0)<0?(x=0,qa(178,a|0),d=x,x=0,d&1):0))p=62;if((p|0)==62?(x=0,f=ta(67,b|0)|0,d=x,x=0,!(d&1)):0){k[g>>2]=f;k[a>>2]=f;k[c>>2]=f+b;e=k[s>>2]|0;c=k[t>>2]|0;if((e|0)==(c|0))break;do{i[f>>0]=i[e>>0]|0;f=(k[g>>2]|0)+1|0;k[g>>2]=f;e=e+1|0}while((e|0)!=(c|0));e=k[s>>2]|0;break}f=Wa()|0;e=k[a>>2]|0;if(e){if((k[g>>2]|0)!=(e|0))k[g>>2]=e;mj(e)}mj(h);break a}while(0);if(!e){r=q;return h|0}if((k[t>>2]|0)!=(e|0))k[t>>2]=e;mj(e);r=q;return h|0}else p=52}else p=52;while(0);if((p|0)==52)f=Wa()|0;e=k[s>>2]|0;if(!e)fb(f|0);if((k[t>>2]|0)!=(e|0))k[t>>2]=e;mj(e);fb(f|0);return 0}function Ei(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,y=0;t=r;r=r+32|0;p=t+28|0;v=t+16|0;s=t+4|0;q=t;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;n=lj(5)|0;k[v>>2]=n;o=v+8|0;k[o>>2]=n+5;i[n>>0]=74;i[n+1>>0]=70;i[n+2>>0]=73;i[n+3>>0]=70;i[n+4>>0]=0;k[w>>2]=n+5;x=0;ra(84,v|0,k[a>>2]&65535|0);n=x;x=0;a:do if(!(n&1)){l=k[a+4>>2]&255;b=k[w>>2]|0;d=k[o>>2]|0;if(b>>>0>=d>>>0){e=k[v>>2]|0;f=e;g=b-f+1|0;if((g|0)<0){x=0;qa(178,v|0);n=x;x=0;if(n&1){u=43;break}f=k[v>>2]|0;d=k[o>>2]|0;e=f}j=e;b=d-j|0;if(b>>>0<1073741823){b=b<<1;b=b>>>0>>0?g:b;d=k[w>>2]|0;h=d-j|0;if(!b){b=0;g=0}else u=10}else{h=k[w>>2]|0;b=2147483647;d=h;h=h-j|0;u=10}if((u|0)==10){x=0;g=ta(67,b|0)|0;n=x;x=0;if(n&1){u=43;break}}i[g+h>>0]=l;m=d-j|0;n=g+(h-m)|0;vw(n|0,e|0,m|0)|0;k[v>>2]=n;k[w>>2]=g+(h+1);k[o>>2]=g+b;if(f)mj(f)}else{i[b>>0]=l;k[w>>2]=(k[w>>2]|0)+1}x=0;ra(84,v|0,k[a+8>>2]&65535|0);n=x;x=0;if(!(n&1)?(x=0,ra(84,v|0,k[a+12>>2]&65535|0),n=x,x=0,!(n&1)):0){n=a+16|0;m=k[n>>2]&255;b=k[w>>2]|0;e=k[o>>2]|0;if(b>>>0>=e>>>0){f=k[v>>2]|0;d=f;g=b-d+1|0;if((g|0)<0){x=0;qa(178,v|0);l=x;x=0;if(l&1){u=43;break}f=k[v>>2]|0;d=f;e=k[o>>2]|0}l=f;b=e-l|0;if(b>>>0<1073741823){b=b<<1;b=b>>>0>>0?g:b;g=k[w>>2]|0;h=g-l|0;if(!b){j=0;e=0}else u=23}else{h=k[w>>2]|0;b=2147483647;g=h;h=h-l|0;u=23}if((u|0)==23){x=0;e=ta(67,b|0)|0;j=x;x=0;if(j&1){u=43;break}else j=b}i[e+h>>0]=m;b=e+(h+1)|0;l=g-l|0;m=e+(h-l)|0;vw(m|0,f|0,l|0)|0;k[v>>2]=m;k[w>>2]=b;k[o>>2]=e+j;if(d){mj(d);b=k[w>>2]|0}}else{i[b>>0]=m;b=(k[w>>2]|0)+1|0;k[w>>2]=b}m=a+20|0;l=k[m>>2]&255;d=k[o>>2]|0;if(b>>>0>=d>>>0){e=k[v>>2]|0;f=e;g=b-f+1|0;if((g|0)<0){x=0;qa(178,v|0);j=x;x=0;if(j&1){u=43;break}f=k[v>>2]|0;d=k[o>>2]|0;e=f}j=e;b=d-j|0;if(b>>>0<1073741823){b=b<<1;b=b>>>0>>0?g:b;d=k[w>>2]|0;h=d-j|0;if(!b){b=0;g=0}else u=34}else{h=k[w>>2]|0;b=2147483647;d=h;h=h-j|0;u=34}if((u|0)==34){x=0;g=ta(67,b|0)|0;y=x;x=0;if(y&1){u=43;break}}i[g+h>>0]=l;l=d-j|0;y=g+(h-l)|0;vw(y|0,e|0,l|0)|0;k[v>>2]=y;k[w>>2]=g+(h+1);k[o>>2]=g+b;if(f)mj(f)}else{i[b>>0]=l;k[w>>2]=(k[w>>2]|0)+1}b=k[n>>2]|0;do if((b|0)>0){if(!(k[a+24>>2]|0)){k[q>>2]=k[w>>2];y=0+(ia(b*3|0,k[m>>2]|0)|0)|0;x=0;k[p>>2]=k[q>>2];Ea(15,v|0,p|0,0,y|0)|0;y=x;x=0;if(y&1){u=43;break a}else break}d=Va(16)|0;x=0;Fa(5,s|0,50792,57);y=x;x=0;if(!(y&1)){x=0;b=Da(1)|0;y=x;x=0;if(!(y&1)?(x=0,Ja(36,d|0,1,b|0,s|0),y=x,x=0,!(y&1)):0){x=0;Fa(6,d|0,824,96);x=0;c=0}else c=1;b=Wa()|0;Sm(s);if(!c){c=b;break a}}else b=Wa()|0;Ua(d|0);c=b;break a}while(0);x=0;h=ta(67,20)|0;y=x;x=0;if(!(y&1)){k[h>>2]=36800;i[h+4>>0]=-32;f=h+8|0;k[f>>2]=0;g=h+12|0;k[g>>2]=0;d=h+16|0;k[d>>2]=0;b=k[w>>2]|0;y=k[v>>2]|0;e=b-y|0;do if((b|0)!=(y|0)){if(!((e|0)<0?(x=0,qa(178,f|0),y=x,x=0,y&1):0))u=53;if((u|0)==53?(x=0,c=ta(67,e|0)|0,y=x,x=0,!(y&1)):0){k[g>>2]=c;k[f>>2]=c;k[d>>2]=c+e;b=k[v>>2]|0;d=k[w>>2]|0;if((b|0)==(d|0))break;do{i[c>>0]=i[b>>0]|0;c=(k[g>>2]|0)+1|0;k[g>>2]=c;b=b+1|0}while((b|0)!=(d|0));b=k[v>>2]|0;break}b=Wa()|0;c=k[f>>2]|0;if(c){if((k[g>>2]|0)!=(c|0))k[g>>2]=c;mj(c)}mj(h);u=44;break a}while(0);if(!b){r=t;return h|0}if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);r=t;return h|0}else u=43}else u=43}else u=43;while(0);if((u|0)==43){b=Wa()|0;u=44}if((u|0)==44)c=b;b=k[v>>2]|0;if(!b)fb(c|0);if((k[w>>2]|0)!=(b|0))k[w>>2]=b;mj(b);fb(c|0);return 0}function Fi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0;h=r;r=r+16|0;l=h;k[l>>2]=0;m=l+4|0;k[m>>2]=0;k[l+8>>2]=0;x=0;b=ta(67,1)|0;g=x;x=0;a:do if((((((!(g&1)?(g=b+1|0,i[b>>0]=1,k[l>>2]=b,k[m>>2]=g,k[l+8>>2]=g,x=0,ra(84,l|0,k[a>>2]&65535|0),g=x,x=0,!(g&1)):0)?(x=0,ra(84,l|0,k[a+4>>2]&65535|0),g=x,x=0,!(g&1)):0)?(x=0,ra(84,l|0,k[a+8>>2]&65535|0),g=x,x=0,!(g&1)):0)?(x=0,ra(84,l|0,k[a+12>>2]&65535|0),g=x,x=0,!(g&1)):0)?(x=0,ra(84,l|0,k[a+16>>2]&65535|0),g=x,x=0,!(g&1)):0)?(x=0,j=ta(67,20)|0,g=x,x=0,!(g&1)):0){k[j>>2]=36800;i[j+4>>0]=-8;e=j+8|0;k[e>>2]=0;g=j+12|0;k[g>>2]=0;a=j+16|0;k[a>>2]=0;b=k[m>>2]|0;n=k[l>>2]|0;d=b-n|0;do if((b|0)!=(n|0)){if(!((d|0)<0?(x=0,qa(178,e|0),n=x,x=0,n&1):0))f=11;if((f|0)==11?(x=0,c=ta(67,d|0)|0,n=x,x=0,!(n&1)):0){k[g>>2]=c;k[e>>2]=c;k[a>>2]=c+d;b=k[l>>2]|0;a=k[m>>2]|0;if((b|0)==(a|0))break;do{i[c>>0]=i[b>>0]|0;c=(k[g>>2]|0)+1|0;k[g>>2]=c;b=b+1|0}while((b|0)!=(a|0));b=k[l>>2]|0;break}c=Wa()|0;b=k[e>>2]|0;if(b){if((k[g>>2]|0)!=(b|0))k[g>>2]=b;mj(b)}mj(j);break a}while(0);if(!b){r=h;return j|0}if((k[m>>2]|0)!=(b|0))k[m>>2]=b;mj(b);r=h;return j|0}else f=25;while(0);if((f|0)==25)c=Wa()|0;b=k[l>>2]|0;if(!b)fb(c|0);if((k[m>>2]|0)!=(b|0))k[m>>2]=b;mj(b);fb(c|0);return 0}function Gi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;f=lj(5)|0;i[f>>0]=109;i[f+1>>0]=114;i[f+2>>0]=102;i[f+3>>0]=120;i[f+4>>0]=a;x=0;e=ta(67,20)|0;d=x;x=0;if(d&1){e=Wa()|0;mj(f);fb(e|0)}k[e>>2]=36800;i[e+4>>0]=-24;a=e+8|0;k[a>>2]=0;b=e+12|0;k[b>>2]=0;c=e+16|0;k[c>>2]=0;x=0;d=ta(67,5)|0;g=x;x=0;if(!(g&1)){k[b>>2]=d;k[a>>2]=d;k[c>>2]=d+5;i[d>>0]=109;g=(k[b>>2]|0)+1|0;k[b>>2]=g;d=f+1|0;i[g>>0]=i[d>>0]|0;g=(k[b>>2]|0)+1|0;k[b>>2]=g;d=d+1|0;i[g>>0]=i[d>>0]|0;g=(k[b>>2]|0)+1|0;k[b>>2]=g;d=d+1|0;i[g>>0]=i[d>>0]|0;g=(k[b>>2]|0)+1|0;k[b>>2]=g;i[g>>0]=i[d+1>>0]|0;k[b>>2]=(k[b>>2]|0)+1;mj(f);return e|0}g=Wa()|0;mj(e);mj(f);fb(g|0);return 0}function Hi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;u=r;r=r+16|0;v=u;k[v>>2]=0;w=v+4|0;k[w>>2]=0;k[v+8>>2]=0;s=v+8|0;x=0;e=ta(67,1)|0;q=x;x=0;a:do if(!(q&1)){h=e+1|0;q=h;i[e>>0]=b;k[v>>2]=e;k[w>>2]=q;k[s>>2]=q;if((b|0)>0){g=h;q=0;do{p=q+a&255;if(g>>>0>=h>>>0){e=k[v>>2]|0;j=e;g=g-j+1|0;if((g|0)<0){x=0;qa(178,v|0);o=x;x=0;if(o&1){t=28;break}j=k[v>>2]|0;h=k[s>>2]|0;o=j}else o=e;n=o;e=h-n|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;h=k[w>>2]|0;l=h-n|0;if(!e){m=0;g=0}else t=13}else{l=k[w>>2]|0;e=2147483647;h=l;l=l-n|0;t=13}if((t|0)==13){t=0;x=0;g=ta(67,e|0)|0;m=x;x=0;if(m&1){t=28;break}else m=e}i[g+l>>0]=p;e=g+(l+1)|0;n=h-n|0;p=g+(l-n)|0;vw(p|0,o|0,n|0)|0;k[v>>2]=p;k[w>>2]=e;k[s>>2]=g+m;if(j){mj(j);e=k[w>>2]|0}}else{i[g>>0]=p;e=(k[w>>2]|0)+1|0;k[w>>2]=e}h=k[s>>2]|0;if(e>>>0>=h>>>0){j=k[v>>2]|0;g=j;l=e-g+1|0;if((l|0)<0){x=0;qa(178,v|0);p=x;x=0;if(p&1){t=28;break}j=k[v>>2]|0;g=j;h=k[s>>2]|0}n=j;e=h-n|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?l:e;l=k[w>>2]|0;h=l-n|0;if(!e){e=0;m=0}else t=24}else{h=k[w>>2]|0;e=2147483647;l=h;h=h-n|0;t=24}if((t|0)==24){t=0;x=0;m=ta(67,e|0)|0;p=x;x=0;if(p&1){t=28;break}}i[m+h>>0]=0;o=l-n|0;p=m+(h-o)|0;vw(p|0,j|0,o|0)|0;k[v>>2]=p;k[w>>2]=m+(h+1);k[s>>2]=m+e;if(g)mj(g)}else{i[e>>0]=0;k[w>>2]=(k[w>>2]|0)+1}q=q+1|0;g=k[w>>2]|0;h=k[s>>2]|0}while((q|0)<(b|0));if((t|0)==28){f=Wa()|0;break}e=c&255;if(g>>>0>>0){i[g>>0]=e;g=(k[w>>2]|0)+1|0;k[w>>2]=g}else t=37}else{g=h;e=c&255;t=37}if((t|0)==37){j=k[v>>2]|0;l=j;m=g-l+1|0;if((m|0)<0){x=0;qa(178,v|0);c=x;x=0;if(c&1){t=29;break}l=k[v>>2]|0;h=k[s>>2]|0;j=l}p=j;g=h-p|0;if(g>>>0<1073741823){g=g<<1;g=g>>>0>>0?m:g;m=k[w>>2]|0;n=m-p|0;if(!g){o=0;h=0}else t=43}else{n=k[w>>2]|0;g=2147483647;m=n;n=n-p|0;t=43}if((t|0)==43){x=0;h=ta(67,g|0)|0;c=x;x=0;if(c&1){t=29;break}else o=g}i[h+n>>0]=e;g=h+(n+1)|0;a=m-p|0;c=h+(n-a)|0;vw(c|0,j|0,a|0)|0;k[v>>2]=c;k[w>>2]=g;k[s>>2]=h+o;if(l){mj(l);g=k[w>>2]|0}}p=d&255;e=k[s>>2]|0;if(g>>>0>=e>>>0){h=k[v>>2]|0;j=h;g=g-j+1|0;if((g|0)<0){x=0;qa(178,v|0);d=x;x=0;if(d&1){t=29;break}j=k[v>>2]|0;e=k[s>>2]|0;h=j}o=h;e=e-o|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?g:e;l=k[w>>2]|0;m=l-o|0;if(!e){n=0;g=0}else t=54}else{m=k[w>>2]|0;e=2147483647;l=m;m=m-o|0;t=54}if((t|0)==54){x=0;g=ta(67,e|0)|0;d=x;x=0;if(d&1){t=29;break}else n=e}i[g+m>>0]=p;e=g+(m+1)|0;c=l-o|0;d=g+(m-c)|0;vw(d|0,h|0,c|0)|0;k[v>>2]=d;k[w>>2]=e;k[s>>2]=g+n;if(j){mj(j);e=k[w>>2]|0}}else{i[g>>0]=p;e=(k[w>>2]|0)+1|0;k[w>>2]=e}g=k[s>>2]|0;if(e>>>0>=g>>>0){h=k[v>>2]|0;j=h;l=e-j+1|0;if((l|0)<0){x=0;qa(178,v|0);d=x;x=0;if(d&1){t=29;break}j=k[v>>2]|0;g=k[s>>2]|0;h=j}n=h;e=g-n|0;if(e>>>0<1073741823){e=e<<1;e=e>>>0>>0?l:e;g=k[w>>2]|0;m=g-n|0;if(!e){e=0;l=0}else t=65}else{m=k[w>>2]|0;e=2147483647;g=m;m=m-n|0;t=65}if((t|0)==65){x=0;l=ta(67,e|0)|0;d=x;x=0;if(d&1){t=29;break}}i[l+m>>0]=0;c=g-n|0;d=l+(m-c)|0;vw(d|0,h|0,c|0)|0;k[v>>2]=d;k[w>>2]=l+(m+1);k[s>>2]=l+e;if(j)mj(j)}else{i[e>>0]=0;k[w>>2]=(k[w>>2]|0)+1}x=0;m=ta(67,20)|0;s=x;x=0;if(!(s&1)){k[m>>2]=36800;i[m+4>>0]=-38;j=m+8|0;k[j>>2]=0;l=m+12|0;k[l>>2]=0;g=m+16|0;k[g>>2]=0;e=k[w>>2]|0;s=k[v>>2]|0;h=e-s|0;do if((e|0)!=(s|0)){if(!((h|0)<0?(x=0,qa(178,j|0),s=x,x=0,s&1):0))t=72;if((t|0)==72?(x=0,f=ta(67,h|0)|0,s=x,x=0,!(s&1)):0){k[l>>2]=f;k[j>>2]=f;k[g>>2]=f+h;e=k[v>>2]|0;g=k[w>>2]|0;if((e|0)==(g|0))break;do{i[f>>0]=i[e>>0]|0;f=(k[l>>2]|0)+1|0;k[l>>2]=f;e=e+1|0}while((e|0)!=(g|0));e=k[v>>2]|0;break}f=Wa()|0;e=k[j>>2]|0;if(e){if((k[l>>2]|0)!=(e|0))k[l>>2]=e;mj(e)}mj(m);break a}while(0);if(!e){r=u;return m|0}if((k[w>>2]|0)!=(e|0))k[w>>2]=e;mj(e);r=u;return m|0}else t=29}else t=29;while(0);if((t|0)==29)f=Wa()|0;e=k[v>>2]|0;if(!e)fb(f|0);if((k[w>>2]|0)!=(e|0))k[w>>2]=e;mj(e);fb(f|0);return 0}function Ii(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;n=(b&65535)>>>8&255;o=a+4|0;c=k[o>>2]|0;p=a+8|0;d=k[p>>2]|0;if(c>>>0>=d>>>0){e=k[a>>2]|0;f=e;g=c-f+1|0;if((g|0)<0){jj(a);f=k[a>>2]|0;d=k[p>>2]|0;e=f}m=e;c=d-m|0;if(c>>>0<1073741823){c=c<<1;c=c>>>0>>0?g:c;g=k[o>>2]|0;d=g-m|0;if(!c){l=0;j=0;h=d;c=g}else q=8}else{d=k[o>>2]|0;c=2147483647;g=d;d=d-m|0;q=8}if((q|0)==8){l=c;j=lj(c)|0;h=d;c=g}i[j+h>>0]=n;d=j+(h+1)|0;m=c-m|0;n=j+(h-m)|0;vw(n|0,e|0,m|0)|0;k[a>>2]=n;k[o>>2]=d;k[p>>2]=j+l;if(f){mj(f);d=k[o>>2]|0}}else{i[c>>0]=n;d=(k[o>>2]|0)+1|0;k[o>>2]=d}m=b&255;c=k[p>>2]|0;if(d>>>0>>0){i[d>>0]=m;k[o>>2]=(k[o>>2]|0)+1;return}e=k[a>>2]|0;f=e;d=d-f+1|0;if((d|0)<0){jj(a);f=k[a>>2]|0;c=k[p>>2]|0;e=f}l=e;c=c-l|0;if(c>>>0<1073741823){c=c<<1;c=c>>>0>>0?d:c;g=k[o>>2]|0;d=g-l|0;if(!c){j=0;h=0;c=g}else q=18}else{d=k[o>>2]|0;c=2147483647;g=d;d=d-l|0;q=18}if((q|0)==18){j=c;h=lj(c)|0;c=g}i[h+d>>0]=m;b=c-l|0;q=h+(d-b)|0;vw(q|0,e|0,b|0)|0;k[a>>2]=q;k[o>>2]=h+(d+1);k[p>>2]=h+j;if(!f)return;mj(f);return}function Ji(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=k[a>>2]|0;q=k[b>>2]|0;p=q;j=e;n=c;l=d-n|0;if((l|0)<=0){r=q;return r|0}o=a+8|0;b=k[o>>2]|0;r=a+4|0;m=k[r>>2]|0;f=m;if((l|0)<=(b-f|0)){h=f-p|0;if((l|0)>(h|0)){g=c+h|0;if((g|0)==(d|0))b=m;else{f=g;b=m;do{i[b>>0]=i[f>>0]|0;b=(k[r>>2]|0)+1|0;k[r>>2]=b;f=f+1|0}while((f|0)!=(d|0))}if((h|0)>0)h=b;else{r=q;return r|0}}else{h=m;g=d}e=h-(e+(l-j+p))|0;b=q+e|0;if(b>>>0>>0){f=h;do{i[f>>0]=i[b>>0]|0;b=b+1|0;f=(k[r>>2]|0)+1|0;k[r>>2]=f}while((b|0)!=(m|0))}xw(h+(0-e)|0,q|0,e|0)|0;xw(q|0,c|0,g-n|0)|0;r=q;return r|0}f=f-j+l|0;if((f|0)<0){jj(a);b=k[o>>2]|0;e=k[a>>2]|0}g=e;b=b-g|0;if(b>>>0<1073741823){b=b<<1;b=b>>>0>>0?f:b;f=p-g|0;if(!b){g=0;l=0}else h=15}else{b=2147483647;f=p-g|0;h=15}if((h|0)==15){g=b;l=lj(b)|0}j=l+f|0;b=j;h=l+g|0;if((c|0)!=(d|0)){e=c;g=j;do{i[g>>0]=i[e>>0]|0;g=b+1|0;b=g;e=e+1|0}while((e|0)!=(d|0));e=k[a>>2]|0}c=p-e|0;d=l+(f-c)|0;vw(d|0,e|0,c|0)|0;p=(k[r>>2]|0)-p|0;c=b;vw(c|0,q|0,p|0)|0;b=k[a>>2]|0;k[a>>2]=d;k[r>>2]=c+p;k[o>>2]=h;if(!b){r=j;return r|0}mj(b);r=j;return r|0}function Ki(a){a=a|0;var b=0;k[a>>2]=36800;b=k[a+8>>2]|0;if(!b)return;a=a+12|0;if((k[a>>2]|0)!=(b|0))k[a>>2]=b;mj(b);return}function Li(a){a=a|0;var b=0,c=0;k[a>>2]=36800;b=k[a+8>>2]|0;if(!b){mj(a);return}c=a+12|0;if((k[c>>2]|0)!=(b|0))k[c>>2]=b;mj(b);mj(a);return}function Mi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;Ni(b,-1);Ni(b,i[a+4>>0]|0);e=a+12|0;d=a+8|0;a=(k[e>>2]|0)-(k[d>>2]|0)+2|0;Ni(b,(a&65535)>>>8&255);Ni(b,a&255);a=k[d>>2]|0;if((k[e>>2]|0)==(a|0))return;else c=0;do{Ni(b,i[a+c>>0]|0);c=c+1|0;a=k[d>>2]|0}while(c>>>0<((k[e>>2]|0)-a|0)>>>0);return}function Ni(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;e=k[a+4>>2]|0;if(e){c=e+24|0;d=k[c>>2]|0;if((d|0)==(k[e+28>>2]|0)){Vb[k[(k[e>>2]|0)+52>>2]&63](e,b&255)|0;return}else{k[c>>2]=d+1;i[d>>0]=b;return}}c=a+16|0;d=k[c>>2]|0;if(d>>>0<(k[a+12>>2]|0)>>>0){k[c>>2]=d+1;i[(k[a+8>>2]|0)+d>>0]=b;return}c=Va(16)|0;x=0;d=Da(1)|0;b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}x=0;Fa(7,c|0,4,d|0);b=x;x=0;if(b&1){b=Wa()|0;Ua(c|0);fb(b|0)}else ub(c|0,824,96)}function Oi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;e=(b|0)<4095?(b+128|0)/256|0:16;f=(c*3|0)+2+e|0;d=c+1|0;f=(f|0)<(d|0)|(f|0)>(b|0)?d:f;k[a+4>>2]=f;d=(e<<2|3)+(c*5|0)|0;d=(d|0)>(b|0)|(d|0)<(f|0)?f:d;k[a+8>>2]=d;c=(c*7|0)+4+(e*17|0)|0;k[a+12>>2]=(c|0)>(b|0)|(c|0)<(d|0)?d:c;k[a>>2]=b;k[a+16>>2]=64;return}function Pi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;l=r;r=r+128|0;h=l+100|0;d=l+16|0;c=l+112|0;j=l+4|0;m=l;e=d;f=a+20|0;g=e+84|0;do{k[e>>2]=k[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));k[d+16>>2]=k[a+4>>2];f=zc(c,d,a+56|0)|0;c=k[(k[f>>2]|0)+16>>2]|0;a=a+8|0;x=0;k[h>>2]=k[a>>2];k[h+4>>2]=k[a+4>>2];k[h+8>>2]=k[a+8>>2];c=Aa(c|0,f|0,h|0)|0;a=x;x=0;do if(a&1)c=Wa()|0;else{e=b+4|0;k[j>>2]=k[e>>2];k[j+4>>2]=k[e+4>>2];k[j+8>>2]=k[e+8>>2];e=b+16|0;a=k[e>>2]|0;h=j+8|0;k[h>>2]=(k[h>>2]|0)-a;h=j+4|0;k[h>>2]=(k[h>>2]|0)+a;h=k[(k[f>>2]|0)+12>>2]|0;k[m>>2]=c;x=0;c=Ea(h|0,f|0,m|0,j|0,((i[b>>0]|0)==0?0:(k[b+8>>2]|0)+a|0)|0)|0;j=x;x=0;if(j&1){c=Wa()|0;d=k[m>>2]|0;k[m>>2]=0;if(!d)break;Lb[k[(k[d>>2]|0)+4>>2]&255](d);break}d=k[m>>2]|0;k[m>>2]=0;if(d)Lb[k[(k[d>>2]|0)+4>>2]&255](d);if(!(k[b+4>>2]|0))k[e>>2]=(k[e>>2]|0)+c;if(!f){r=l;return}Lb[k[(k[f>>2]|0)+4>>2]&255](f);r=l;return}while(0);if(!f)fb(c|0);Lb[k[(k[f>>2]|0)+4>>2]&255](f);fb(c|0)}function Qi(a,b){a=a|0;b=b|0;k[a>>2]=k[b>>2];k[a+4>>2]=k[b+4>>2];k[a+8>>2]=k[b+8>>2];i[a+12>>0]=0;b=a+16|0;a=b+100|0;do{k[b>>2]=0;b=b+4|0}while((b|0)<(a|0));return}function Ri(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;u=r;r=r+32|0;t=u+4|0;o=u+16|0;v=u;Si(a);p=a+16|0;e=k[a+24>>2]|0;a:do if((e+-2|0)>>>0<=14){q=a+40|0;c=k[q>>2]|0;if(c>>>0>2)c=5;else{s=a+32|0;f=k[s>>2]|0;switch(f|0){case 0:{c=1;break a}case 4:{if((c|0)==2){c=2;break a}break}case 3:break;default:if(c){c=2;break a}}n=a+100|0;c=a+108|0;d=k[c>>2]|0;if((d|0)<1){d=k[p>>2]|0;k[c>>2]=d;c=k[a+20>>2]|0;k[a+112>>2]=c}else c=k[a+112>>2]|0;j=Dw(c|0,((c|0)<0)<<31>>31|0,d|0,((d|0)<0)<<31>>31|0)|0;h=(e+7|0)/8|0;h=Dw(j|0,M|0,h|0,((h|0)<0)<<31>>31|0)|0;j=b+4|0;c=k[j>>2]|0;g=b+8|0;if((c|0)!=0?(l=k[g>>2]|0,m=Dw(f|0,((f|0)<0)<<31>>31|0,h|0,M|0)|0,e=M,0<(e|0)|0==(e|0)&l>>>0>>0):0){c=Va(16)|0;x=0;d=Da(1)|0;v=x;x=0;if(!(v&1)?(x=0,Fa(7,c|0,3,d|0),v=x,x=0,!(v&1)):0)ub(c|0,824,96);v=Wa()|0;Ua(c|0);fb(v|0)}l=a+52|0;m=a+12|0;if((f|0)>0)f=0;else{r=u;return}while(1){Ti(a,(f|0)==0);d=xc(o,p,l)|0;e=k[(k[d>>2]|0)+8>>2]|0;x=0;k[t>>2]=k[b>>2];k[t+4>>2]=k[b+4>>2];k[t+8>>2]=k[b+8>>2];e=Aa(e|0,d|0,t|0)|0;w=x;x=0;if(w&1){e=32;break}w=k[(k[d>>2]|0)+16>>2]|0;k[v>>2]=e;x=0;oa(w|0,d|0,v|0,n|0,a|0,(i[m>>0]|0)!=0|0);w=x;x=0;if(w&1){e=30;break}e=k[v>>2]|0;k[v>>2]=0;if(e)Lb[k[(k[e>>2]|0)+4>>2]&255](e);if(!c)c=0;else{c=c+h|0;k[j>>2]=c;k[g>>2]=(k[g>>2]|0)-h}e=(k[q>>2]|0)==0;f=(e&1)+f|0;if(d)Lb[k[(k[d>>2]|0)+4>>2]&255](d);if(!e){e=34;break}if((f|0)>=(k[s>>2]|0)){e=34;break}}if((e|0)==30){c=Wa()|0;e=k[v>>2]|0;k[v>>2]=0;if(e)Lb[k[(k[e>>2]|0)+4>>2]&255](e)}else if((e|0)==32){c=Wa()|0;if(!d){w=c;fb(w|0)}}else if((e|0)==34){r=u;return}Lb[k[(k[d>>2]|0)+4>>2]&255](d);w=c;fb(w|0)}}else c=2;while(0);d=Va(16)|0;x=0;e=Da(1)|0;w=x;x=0;if(!(w&1)?(x=0,Fa(7,d|0,c|0,e|0),w=x,x=0,!(w&1)):0)ub(d|0,824,96);w=Wa()|0;Ua(d|0);fb(w|0)}function Si(a){a=a|0;var b=0,c=0,d=0,e=0;if((Wi(a)|0)<<24>>24!=-40){b=Va(16)|0;x=0;c=Da(1)|0;e=x;x=0;if(!(e&1)?(x=0,Fa(7,b|0,5,c|0),e=x,x=0,!(e&1)):0)ub(b|0,824,96);e=Wa()|0;Ua(b|0);fb(e|0)}b=Wi(a)|0;if(b<<24>>24==-38)return;while(1){d=((Vi(a)|0)&255)<<8;d=d|(Vi(a)|0)&255;b=Xi(a,b)|0;c=-2-b+d|0;if((c|0)<0)break;if((c|0)>0){b=d+-2-b|0;c=0;do{Vi(a)|0;c=c+1|0}while((c|0)!=(b|0))}b=Wi(a)|0;if(b<<24>>24==-38){e=8;break}}if((e|0)==8)return;b=Va(16)|0;x=0;c=Da(1)|0;e=x;x=0;if(!(e&1)?(x=0,Fa(7,b|0,5,c|0),e=x,x=0,!(e&1)):0)ub(b|0,824,96);e=Wa()|0;Ua(b|0);fb(e|0)}function Ti(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;if(!b){if((Vi(a)|0)<<24>>24!=-1){b=Va(16)|0;x=0;c=Da(1)|0;a=x;x=0;if(!(a&1)?(x=0,Fa(7,b|0,12,c|0),a=x,x=0,!(a&1)):0)ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}if((Vi(a)|0)<<24>>24!=-38){b=Va(16)|0;x=0;c=Da(1)|0;a=x;x=0;if(!(a&1)?(x=0,Fa(7,b|0,5,c|0),a=x,x=0,!(a&1)):0)ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}}Vi(a)|0;Vi(a)|0;c=Vi(a)|0;d=c&255;do if(c<<24>>24==1){Vi(a)|0;c=0;e=20}else{if((d|0)==(k[a+32>>2]|0)){b=Vi(a)|0;if(!(c<<24>>24))break;else{c=0;e=20;break}}b=Va(16)|0;x=0;c=Da(1)|0;a=x;x=0;if(!(a&1)?(x=0,Fa(7,b|0,2,c|0),a=x,x=0,!(a&1)):0)ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}while(0);if((e|0)==20)while(1){Vi(a)|0;c=c+1|0;b=Vi(a)|0;if((c|0)==(d|0))break;else e=20}k[a+36>>2]=b&255;e=Vi(a)|0;c=a+40|0;k[c>>2]=e&255;if((e&255)>=3){b=Va(16)|0;x=0;c=Da(1)|0;a=x;x=0;if(!(a&1)?(x=0,Fa(7,b|0,5,c|0),a=x,x=0,!(a&1)):0)ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}if((Vi(a)|0)<<24>>24){b=Va(16)|0;x=0;c=Da(1)|0;a=x;x=0;if(!(a&1)?(x=0,Fa(7,b|0,5,c|0),a=x,x=0,!(a&1)):0)ub(b|0,824,96);a=Wa()|0;Ua(b|0);fb(a|0)}d=a+28|0;if(k[d>>2]|0)return;b=k[a+108>>2]|0;if(!b)b=k[a+16>>2]|0;if(!(k[c>>2]|0))c=1;else c=k[a+32>>2]|0;e=ia(c,b)|0;a=ia(e,((k[a+24>>2]|0)+7|0)/8|0)|0;k[d>>2]=a;return}function Ui(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if((c|0)<=0)return;n=b+4|0;o=b+8|0;q=0;do{p=Vi(a)|0;d=k[n>>2]|0;e=k[o>>2]|0;if(d>>>0>=e>>>0){f=k[b>>2]|0;g=f;h=d-g+1|0;if((h|0)<0){jj(b);g=k[b>>2]|0;e=k[o>>2]|0;f=g}m=f;d=e-m|0;if(d>>>0<1073741823){d=d<<1;d=d>>>0>>0?h:d;h=k[n>>2]|0;e=h-m|0;if(!d){l=0;j=0;d=h}else r=10}else{e=k[n>>2]|0;d=2147483647;h=e;e=e-m|0;r=10}if((r|0)==10){r=0;l=d;j=lj(d)|0;d=h}i[j+e>>0]=p;m=d-m|0;p=j+(e-m)|0;vw(p|0,f|0,m|0)|0;k[b>>2]=p;k[n>>2]=j+(e+1);k[o>>2]=j+l;if(g)mj(g)}else{i[d>>0]=p;k[n>>2]=(k[n>>2]|0)+1}q=q+1|0}while((q|0)!=(c|0));return}function Vi(a){a=a|0;var b=0,c=0,d=0,e=0;c=k[a>>2]|0;if(c){a=c+12|0;b=k[a>>2]|0;if((b|0)==(k[c+16>>2]|0))a=Ob[k[(k[c>>2]|0)+40>>2]&127](c)|0;else{k[a>>2]=b+1;a=l[b>>0]|0}e=a&255;return e|0}d=a+8|0;e=k[d>>2]|0;if(e){a=a+4|0;b=k[a>>2]|0;c=i[b>>0]|0;if(!b){e=c;return e|0}k[a>>2]=b+1;k[d>>2]=e+-1;e=c;return e|0}a=Va(16)|0;x=0;b=Da(1)|0;e=x;x=0;if(e&1){e=Wa()|0;Ua(a|0);fb(e|0)}x=0;Fa(7,a|0,4,b|0);e=x;x=0;if(e&1){e=Wa()|0;Ua(a|0);fb(e|0)}else ub(a|0,824,96);return 0}function Wi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0;c=r;r=r+176|0;b=c+152|0;i=c+16|0;g=c;h=Vi(a)|0;d=h&255;if(h<<24>>24==-1){do b=Vi(a)|0;while(b<<24>>24==-1);r=c;return b|0}h=i+56|0;f=i+4|0;k[i>>2]=36160;k[h>>2]=36180;x=0;ra(62,i+56|0,f|0);e=x;x=0;if(e&1){i=Wa()|0;qn(h);fb(i|0)}k[i+128>>2]=0;k[i+132>>2]=-1;k[i>>2]=36200;k[i+56>>2]=36220;x=0;qa(180,f|0);e=x;x=0;do if(e&1)b=Wa()|0;else{k[f>>2]=36236;e=i+36|0;k[e>>2]=0;k[e+4>>2]=0;k[e+8>>2]=0;k[e+12>>2]=0;k[i+52>>2]=16;k[b>>2]=0;k[b+4>>2]=0;k[b+8>>2]=0;x=0;ra(63,f|0,b|0);c=x;x=0;if(c&1){i=Wa()|0;Sm(b);Sm(e);xn(f);b=i;break}Sm(b);k[i+((k[(k[i>>2]|0)+-12>>2]|0)+76)>>2]=48;x=0;b=va(28,i|0,50907,62)|0;c=x;x=0;if(!(c&1)?(c=b+((k[(k[b>>2]|0)+-12>>2]|0)+4)|0,k[c>>2]=k[c>>2]&-75|8,c=b+((k[(k[b>>2]|0)+-12>>2]|0)+4)|0,k[c>>2]=k[c>>2]|16384,k[b+((k[(k[b>>2]|0)+-12>>2]|0)+12)>>2]=2,x=0,Aa(38,b|0,d|0)|0,d=x,x=0,!(d&1)):0){c=Va(16)|0;x=0;ra(64,g|0,f|0);d=x;x=0;if(!(d&1)){x=0;b=Da(1)|0;d=x;x=0;if(!(d&1)?(x=0,Ja(36,c|0,12,b|0,g|0),d=x,x=0,!(d&1)):0){x=0;Fa(6,c|0,824,96);x=0;a=0}else a=1;b=Wa()|0;Sm(g);if(!a){g=b;k[i>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}}else b=Wa()|0;Ua(c|0);g=b;k[i>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}g=Wa()|0;k[i>>2]=36200;k[h>>2]=36220;k[f>>2]=36236;Sm(e);xn(f);qn(h);fb(g|0)}while(0);i=b;qn(h);fb(i|0);return 0}function Xi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0;c=r;r=r+320|0;h=c+300|0;l=c+152|0;i=c+288|0;m=c+16|0;j=c;switch(b<<24>>24){case -9:{n=(Vi(a)|0)&255;k[a+24>>2]=n;n=((Vi(a)|0)&255)<<8|(Vi(a)|0)&255;m=((Vi(a)|0)&255)<<8|(Vi(a)|0)&255;k[a+16>>2]=m;k[a+20>>2]=n;n=(Vi(a)|0)&255;k[a+32>>2]=n;n=6;r=c;return n|0}case -8:{n=Yi(a)|0;r=c;return n|0}case -24:{n=Zi(a)|0;r=c;return n|0}case -53:case -54:case -55:case -57:case -58:case -59:case -61:case -62:case -63:case -64:{g=l+56|0;e=l+4|0;k[l>>2]=36160;k[g>>2]=36180;x=0;ra(62,l+56|0,e|0);m=x;x=0;if(m&1){n=Wa()|0;qn(g);fb(n|0)}k[l+128>>2]=0;k[l+132>>2]=-1;k[l>>2]=36200;k[l+56>>2]=36220;x=0;qa(180,e|0);m=x;x=0;do if(m&1)a=Wa()|0;else{k[e>>2]=36236;f=l+36|0;k[f>>2]=0;k[f+4>>2]=0;k[f+8>>2]=0;k[f+12>>2]=0;k[l+52>>2]=16;k[h>>2]=0;k[h+4>>2]=0;k[h+8>>2]=0;x=0;ra(63,e|0,h|0);m=x;x=0;if(m&1){a=Wa()|0;Sm(h);Sm(f);xn(e);break}Sm(h);x=0;a=va(28,l|0,50970,26)|0;m=x;x=0;do if((!(m&1)?(x=0,d=Aa(38,a|0,b&255|0)|0,m=x,x=0,!(m&1)):0)?(x=0,va(28,d|0,50997,18)|0,m=x,x=0,!(m&1)):0){d=Va(16)|0;x=0;ra(64,i|0,e|0);m=x;x=0;if(!(m&1)){x=0;a=Da(1)|0;m=x;x=0;if(!(m&1)?(x=0,Ja(36,d|0,10,a|0,i|0),m=x,x=0,!(m&1)):0){x=0;Fa(6,d|0,824,96);x=0;c=0}else c=1;a=Wa()|0;Sm(i);if(!c)break}else a=Wa()|0;Ua(d|0)}else n=20;while(0);if((n|0)==20)a=Wa()|0;k[l>>2]=36200;k[g>>2]=36220;k[e>>2]=36236;Sm(f);xn(e);qn(g);n=a;fb(n|0)}while(0);n=a;qn(g);fb(n|0)}case -25:case -32:case -2:{n=0;r=c;return n|0}default:{i=m+56|0;f=m+4|0;k[m>>2]=36160;k[i>>2]=36180;x=0;ra(62,m+56|0,f|0);l=x;x=0;if(l&1){n=Wa()|0;qn(i);fb(n|0)}k[m+128>>2]=0;k[m+132>>2]=-1;k[m>>2]=36200;k[m+56>>2]=36220;x=0;qa(180,f|0);l=x;x=0;do if(l&1)a=Wa()|0;else{k[f>>2]=36236;g=m+36|0;k[g>>2]=0;k[g+4>>2]=0;k[g+8>>2]=0;k[g+12>>2]=0;k[m+52>>2]=16;k[h>>2]=0;k[h+4>>2]=0;k[h+8>>2]=0;x=0;ra(63,f|0,h|0);l=x;x=0;if(l&1){a=Wa()|0;Sm(h);Sm(g);xn(f);break}Sm(h);x=0;a=va(28,m|0,51016,20)|0;l=x;x=0;do if((!(l&1)?(x=0,e=Aa(38,a|0,b&255|0)|0,l=x,x=0,!(l&1)):0)?(x=0,va(28,e|0,51037,13)|0,l=x,x=0,!(l&1)):0){d=Va(16)|0;x=0;ra(64,j|0,f|0);l=x;x=0;if(!(l&1)){x=0;a=Da(1)|0;l=x;x=0;if(!(l&1)?(x=0,Ja(36,d|0,11,a|0,j|0),l=x,x=0,!(l&1)):0){x=0;Fa(6,d|0,824,96);x=0;c=0}else c=1;a=Wa()|0;Sm(j);if(!c)break}else a=Wa()|0;Ua(d|0)}else n=40;while(0);if((n|0)==40)a=Wa()|0;k[m>>2]=36200;k[i>>2]=36220;k[f>>2]=36236;Sm(g);xn(f);qn(i);n=a;fb(n|0)}while(0);n=a;qn(i);fb(n|0)}}return 0}function Yi(a){a=a|0;var b=0;if((Vi(a)|0)<<24>>24!=1){a=1;return a|0}b=((Vi(a)|0)&255)<<8;b=b|(Vi(a)|0)&255;k[a+52>>2]=b;b=((Vi(a)|0)&255)<<8;b=b|(Vi(a)|0)&255;k[a+56>>2]=b;b=((Vi(a)|0)&255)<<8;b=b|(Vi(a)|0)&255;k[a+60>>2]=b;b=((Vi(a)|0)&255)<<8;b=b|(Vi(a)|0)&255;k[a+64>>2]=b;b=((Vi(a)|0)&255)<<8;b=b|(Vi(a)|0)&255;k[a+68>>2]=b;a=11;return a|0}function Zi(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;c=r;r=r+16|0;e=c;k[e>>2]=0;f=e+4|0;k[f>>2]=0;k[e+8>>2]=0;x=0;Fa(9,a|0,e|0,4);b=x;x=0;a:do if(b&1)d=3;else{b=k[e>>2]|0;b:do if(!(yl(b,51051,4)|0)){x=0;b=ta(69,a|0)|0;g=x;x=0;if(g&1){d=3;break a}b=b&255;switch(b|0){case 3:case 2:case 1:case 0:{k[a+44>>2]=b;a=5;b=k[e>>2]|0;break b}case 5:case 4:{b=Va(16)|0;x=0;a=Da(1)|0;g=x;x=0;if(!(g&1)?(x=0,Fa(7,b|0,7,a|0),g=x,x=0,!(g&1)):0){x=0;Fa(6,b|0,824,96);x=0;d=3;break a}a=Wa()|0;Ua(b|0);break a}default:{b=Va(16)|0;x=0;a=Da(1)|0;g=x;x=0;if(!(g&1)?(x=0,Fa(7,b|0,5,a|0),g=x,x=0,!(g&1)):0){x=0;Fa(6,b|0,824,96);x=0;d=3;break a}a=Wa()|0;Ua(b|0);break a}}}else a=4;while(0);if(!b){r=c;return a|0}if((k[f>>2]|0)!=(b|0))k[f>>2]=b;mj(b);r=c;return a|0}while(0);if((d|0)==3)a=Wa()|0;b=k[e>>2]|0;if(!b)fb(a|0);if((k[f>>2]|0)!=(b|0))k[f>>2]=b;mj(b);fb(a|0);return 0}function _i(a){a=a|0;var b=0,c=0,d=0;d=k[(k[a>>2]|0)+-12>>2]|0;k[a+d>>2]=36200;b=a+(d+56)|0;k[b>>2]=36220;c=a+(d+4)|0;k[c>>2]=36236;Sm(a+(d+36)|0);xn(c);qn(b);return}function $i(a){a=a|0;return}function aj(a){a=a|0;mj(a);return}function bj(a){a=a|0;i[a>>0]=0;a=a+4|0;k[a>>2]=0;k[a+4>>2]=0;k[a+8>>2]=0;k[a+12>>2]=0;k[a+16>>2]=0;k[a+20>>2]=0;k[a+24>>2]=0;k[a+28>>2]=0;return}function cj(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;e=r;r=r+16|0;f=e;b=Gi(b)|0;k[f>>2]=b;c=a+28|0;d=k[c>>2]|0;if(d>>>0<(k[a+32>>2]|0)>>>0){k[d>>2]=b;k[c>>2]=d+4;k[f>>2]=0;r=e;return}x=0;ra(57,a+24|0,f|0);a=x;x=0;if(a&1){b=Wa()|0;c=k[f>>2]|0;k[f>>2]=0;if(!c)fb(b|0);Lb[k[(k[c>>2]|0)+4>>2]&255](c);fb(b|0)}else{b=k[f>>2]|0;k[f>>2]=0;if(!b){r=e;return}Lb[k[(k[b>>2]|0)+4>>2]&255](b);r=e;return}}function dj(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;d=a+4|0;k[d>>2]=k[b>>2];k[d+4>>2]=k[b+4>>2];k[d+8>>2]=k[b+8>>2];Ni(a,-1);Ni(a,-40);d=a+28|0;e=a+24|0;b=k[e>>2]|0;if((k[d>>2]|0)==(b|0)){Ni(a,-1);Ni(a,-39);a=a+16|0;a=k[a>>2]|0;return a|0}else c=0;do{f=k[b+(c<<2)>>2]|0;Mb[k[(k[f>>2]|0)+8>>2]&127](f,a);c=c+1|0;b=k[e>>2]|0}while(c>>>0<(k[d>>2]|0)-b>>2>>>0);Ni(a,-1);Ni(a,-39);f=a+16|0;f=k[f>>2]|0;return f|0}function ej(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0;m=r;r=r+48|0;h=m+32|0;e=m+12|0;i=m+8|0;l=m+4|0;n=m;d=c+36|0;do if(((((k[d>>2]|0)==0?(k[c+40>>2]|0)==0:0)?(k[c+44>>2]|0)==0:0)?(k[c+48>>2]|0)==0:0)?(k[c+52>>2]|0)==0:0){d=k[c+8>>2]|0;if((d|0)<=12){f=a+28|0;g=a+32|0;break}Oi(e,(1<>2]|0);d=Fi(e)|0;k[i>>2]=d;f=a+28|0;e=k[f>>2]|0;g=a+32|0;if(e>>>0<(k[g>>2]|0)>>>0){k[e>>2]=d;k[f>>2]=e+4;k[i>>2]=0;break}x=0;ra(57,a+24|0,i|0);h=x;x=0;if(!(h&1)){d=k[i>>2]|0;k[i>>2]=0;if(!d)break;Lb[k[(k[d>>2]|0)+4>>2]&255](d);break}c=Wa()|0;d=k[i>>2]|0;k[i>>2]=0;if(!d){n=c;fb(n|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);n=c;fb(n|0)}else j=6;while(0);do if((j|0)==6){d=Fi(d)|0;k[h>>2]=d;f=a+28|0;e=k[f>>2]|0;g=a+32|0;if(e>>>0<(k[g>>2]|0)>>>0){k[e>>2]=d;k[f>>2]=e+4;k[h>>2]=0;break}x=0;ra(57,a+24|0,h|0);j=x;x=0;if(!(j&1)){d=k[h>>2]|0;k[h>>2]=0;if(!d)break;Lb[k[(k[d>>2]|0)+4>>2]&255](d);break}c=Wa()|0;d=k[h>>2]|0;k[h>>2]=0;if(!d){n=c;fb(n|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);n=c;fb(n|0)}while(0);d=a+20|0;e=(k[d>>2]|0)+1|0;k[d>>2]=e;d=k[c+24>>2]|0;h=(d|0)==0?1:k[c+16>>2]|0;d=Hi(e,h,k[c+20>>2]|0,d)|0;k[l>>2]=d;e=k[f>>2]|0;do if(e>>>0<(k[g>>2]|0)>>>0){k[e>>2]=d;k[f>>2]=e+4;k[l>>2]=0}else{x=0;ra(57,a+24|0,l|0);j=x;x=0;if(!(j&1)){d=k[l>>2]|0;k[l>>2]=0;if(!d)break;Lb[k[(k[d>>2]|0)+4>>2]&255](d);break}c=Wa()|0;d=k[l>>2]|0;k[l>>2]=0;if(!d){n=c;fb(n|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);n=c;fb(n|0)}while(0);i=lj(104)|0;k[i>>2]=36820;k[i+4>>2]=h;e=i+8|0;k[e>>2]=k[b>>2];k[e+4>>2]=k[b+4>>2];k[e+8>>2]=k[b+8>>2];e=i+20|0;d=e+84|0;do{k[e>>2]=k[c>>2];e=e+4|0;c=c+4|0}while((e|0)<(d|0));k[n>>2]=i;c=k[f>>2]|0;if(c>>>0<(k[g>>2]|0)>>>0){k[c>>2]=i;k[f>>2]=c+4;k[n>>2]=0;r=m;return}x=0;ra(57,a+24|0,n|0);a=x;x=0;if(a&1){c=Wa()|0;d=k[n>>2]|0;k[n>>2]=0;if(!d){n=c;fb(n|0)}Lb[k[(k[d>>2]|0)+4>>2]&255](d);n=c;fb(n|0)}else{c=k[n>>2]|0;k[n>>2]=0;if(!c){r=m;return}Lb[k[(k[c>>2]|0)+4>>2]&255](c);r=m;return}}function fj(a,b,c,d,e,f,g,h,j,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,s=0,t=0,u=0;p=r;r=r+96|0;o=p;n=sc(a,b,o,0)|0;if(n){e=n;r=p;return e|0}i[o+32>>0]=0;s=k[o+8>>2]|0;u=k[o>>2]|0;t=k[o+4>>2]|0;n=ia(t,u)|0;q=k[o+16>>2]|0;n=ia(ia(n,(s|0)<9?1:2)|0,q)|0;k[d>>2]=n;n=Pl(n)|0;k[c>>2]=n;k[e>>2]=u;k[f>>2]=t;k[g>>2]=s;k[h>>2]=k[o+12>>2];k[j>>2]=q;k[l>>2]=k[o+20>>2];k[m>>2]=k[o+24>>2];e=tc(n,k[d>>2]|0,a,b,0,0)|0;r=p;return e|0}function gj(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,l=0,m=0,n=0;m=r;r=r+96|0;j=m+4|0;g=m;l=j;n=l+84|0;do{k[l>>2]=0;l=l+4|0}while((l|0)<(n|0));k[j+16>>2]=f;k[j+8>>2]=e;k[j>>2]=c;k[j+4>>2]=d;c=Pl(b)|0;k[h>>2]=c;k[g>>2]=0;c=rc(h,b,g,a,b,j,0)|0;k[i>>2]=k[g>>2];r=m;return c|0}function hj(a,b){a=a|0;b=b|0;var c=0;c=r;r=r+16|0;k[c>>2]=b;b=k[9320]|0;ml(b,a,c)|0;el(10,b)|0;Pa()}function ij(a){a=a|0;Ta(51337,51366,1164,51442)}function jj(a){a=a|0;Ta(51463,51486,303,51442)}function kj(){var a=0,b=0;a=r;r=r+16|0;if(!(mb(37024,4)|0)){b=ib(k[9255]|0)|0;r=a;return b|0}else hj(51562,a);return 0}function lj(a){a=a|0;var b=0;b=(a|0)==0?1:a;a=Pl(b)|0;a:do if(!a){while(1){a=uj()|0;if(!a)break;$b[a&7]();a=Pl(b)|0;if(a)break a}b=Va(4)|0;k[b>>2]=36844;ub(b|0,592,78)}while(0);return a|0}function mj(a){a=a|0;Ql(a);return}function nj(a){a=a|0;mj(a);return}function oj(a){a=a|0;k[a>>2]=36844;return}function pj(a){a=a|0;return}function qj(a){a=a|0;mj(a);return}function rj(a){a=a|0;return 51611}function sj(a){a=a|0;var b=0;b=r;r=r+16|0;x=0;Ga(a|0);a=x;x=0;if(!(a&1)){x=0;ra(85,51626,b|0);x=0}a=Wa(0)|0;cb(a|0)|0;x=0;ra(85,51666,b+8|0);x=0;a=Wa(0)|0;x=0;Ga(3);b=x;x=0;if(b&1){b=Wa(0)|0;oc(b)}else oc(a)}function tj(){var a=0,b=0,c=0;x=0;a=Da(2)|0;c=x;x=0;if(c&1){c=Wa(0)|0;oc(c)}if(((a|0)!=0?(b=k[a>>2]|0,(b|0)!=0):0)?(c=b+48|0,(k[c>>2]&-256|0)==1126902528?(k[c+4>>2]|0)==1129074247:0):0)sj(k[b+12>>2]|0);c=k[9208]|0;k[9208]=c+0;sj(c)}function uj(){var a=0;a=k[9214]|0;k[9214]=a+0;return a|0}function vj(a){a=a|0;return}function wj(a){a=a|0;k[a>>2]=36868;dk(a+4|0);return}function xj(a){a=a|0;wj(a);mj(a);return}function yj(a){a=a|0;return k[a+4>>2]|0}function zj(a){a=a|0;return}function Aj(a){a=a|0;k[a>>2]=36888;return}function Bj(a){a=a|0;return}function Cj(a){a=a|0;mj(a);return}function Dj(a){a=a|0;return 51716}function Ej(a){a=a|0;return}function Fj(a){a=a|0;return}function Gj(a){a=a|0;return}function Hj(a){a=a|0;mj(a);return}function Ij(a){a=a|0;mj(a);return}function Jj(a){a=a|0;mj(a);return}function Kj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;g=r;r=r+64|0;f=g;if((a|0)!=(b|0))if((b|0)!=0?(e=Qj(b,656,672,0)|0,(e|0)!=0):0){b=f;d=b+56|0;do{k[b>>2]=0;b=b+4|0}while((b|0)<(d|0));k[f>>2]=e;k[f+8>>2]=a;k[f+12>>2]=-1;k[f+48>>2]=1;cc[k[(k[e>>2]|0)+28>>2]&63](e,f,k[c>>2]|0,1);if((k[f+24>>2]|0)==1){k[c>>2]=k[f+16>>2];b=1}else b=0}else b=0;else b=1;r=g;return b|0}function Lj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;a=b+16|0;e=k[a>>2]|0;do if(e){if((e|0)!=(c|0)){d=b+36|0;k[d>>2]=(k[d>>2]|0)+1;k[b+24>>2]=2;i[b+54>>0]=1;break}a=b+24|0;if((k[a>>2]|0)==2)k[a>>2]=d}else{k[a>>2]=c;k[b+24>>2]=d;k[b+36>>2]=1}while(0);return}function Mj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((a|0)==(k[b+8>>2]|0))Lj(0,b,c,d);return}function Nj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((a|0)==(k[b+8>>2]|0))Lj(0,b,c,d);else{a=k[a+8>>2]|0;cc[k[(k[a>>2]|0)+28>>2]&63](a,b,c,d)}return}function Oj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;f=k[a+4>>2]|0;e=f>>8;if(f&1)e=k[(k[c>>2]|0)+e>>2]|0;a=k[a>>2]|0;cc[k[(k[a>>2]|0)+28>>2]&63](a,b,c+e|0,(f&2|0)!=0?d:2);return}function Pj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if((a|0)!=(k[b+8>>2]|0)){f=k[a+12>>2]|0;e=a+16+(f<<3)|0;Oj(a+16|0,b,c,d);if((f|0)>1){f=b+54|0;a=a+24|0;do{Oj(a,b,c,d);if(i[f>>0]|0)break a;a=a+8|0}while(a>>>0>>0)}}else Lj(0,b,c,d);while(0);return}function Qj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,l=0,m=0,n=0,o=0,p=0,q=0;q=r;r=r+64|0;p=q;o=k[a>>2]|0;n=a+(k[o+-8>>2]|0)|0;o=k[o+-4>>2]|0;k[p>>2]=c;k[p+4>>2]=a;k[p+8>>2]=b;k[p+12>>2]=d;d=p+16|0;a=p+20|0;b=p+24|0;e=p+28|0;f=p+32|0;g=p+40|0;h=(o|0)==(c|0);l=d;m=l+36|0;do{k[l>>2]=0;l=l+4|0}while((l|0)<(m|0));j[d+36>>1]=0;i[d+38>>0]=0;a:do if(h){k[p+48>>2]=1;Sb[k[(k[c>>2]|0)+20>>2]&15](c,p,n,n,1,0);d=(k[b>>2]|0)==1?n:0}else{Jb[k[(k[o>>2]|0)+24>>2]&15](o,p,n,1,0);switch(k[p+36>>2]|0){case 0:{d=(k[g>>2]|0)==1&(k[e>>2]|0)==1&(k[f>>2]|0)==1?k[a>>2]|0:0;break a}case 1:break;default:{d=0;break a}}if((k[b>>2]|0)!=1?!((k[g>>2]|0)==0&(k[e>>2]|0)==1&(k[f>>2]|0)==1):0){d=0;break}d=k[d>>2]|0}while(0);r=q;return d|0}function Rj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;i[b+53>>0]=1;do if((k[b+4>>2]|0)==(d|0)){i[b+52>>0]=1;d=b+16|0;a=k[d>>2]|0;if(!a){k[d>>2]=c;k[b+24>>2]=e;k[b+36>>2]=1;if(!((e|0)==1?(k[b+48>>2]|0)==1:0))break;i[b+54>>0]=1;break}if((a|0)!=(c|0)){e=b+36|0;k[e>>2]=(k[e>>2]|0)+1;i[b+54>>0]=1;break}a=b+24|0;d=k[a>>2]|0;if((d|0)==2){k[a>>2]=e;d=e}if((d|0)==1?(k[b+48>>2]|0)==1:0)i[b+54>>0]=1}while(0);return}function Sj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0;a:do if((a|0)==(k[b+8>>2]|0)){if((k[b+4>>2]|0)==(c|0)?(f=b+28|0,(k[f>>2]|0)!=1):0)k[f>>2]=d}else{if((a|0)!=(k[b>>2]|0)){q=k[a+12>>2]|0;h=a+16+(q<<3)|0;Uj(a+16|0,b,c,d,e);f=a+24|0;if((q|0)<=1)break;g=k[a+8>>2]|0;if((g&2|0)==0?(j=b+36|0,(k[j>>2]|0)!=1):0){if(!(g&1)){g=b+54|0;while(1){if(i[g>>0]|0)break a;if((k[j>>2]|0)==1)break a;Uj(f,b,c,d,e);f=f+8|0;if(f>>>0>=h>>>0)break a}}g=b+24|0;a=b+54|0;while(1){if(i[a>>0]|0)break a;if((k[j>>2]|0)==1?(k[g>>2]|0)==1:0)break a;Uj(f,b,c,d,e);f=f+8|0;if(f>>>0>=h>>>0)break a}}g=b+54|0;while(1){if(i[g>>0]|0)break a;Uj(f,b,c,d,e);f=f+8|0;if(f>>>0>=h>>>0)break a}}if((k[b+16>>2]|0)!=(c|0)?(p=b+20|0,(k[p>>2]|0)!=(c|0)):0){k[b+32>>2]=d;m=b+44|0;if((k[m>>2]|0)==4)break;g=k[a+12>>2]|0;h=a+16+(g<<3)|0;j=b+52|0;d=b+53|0;n=b+54|0;l=a+8|0;o=b+24|0;b:do if((g|0)>0){g=0;f=0;a=a+16|0;while(1){i[j>>0]=0;i[d>>0]=0;Tj(a,b,c,c,1,e);if(i[n>>0]|0){q=20;break b}do if(i[d>>0]|0){if(!(i[j>>0]|0))if(!(k[l>>2]&1)){f=1;q=20;break b}else{f=1;break}if((k[o>>2]|0)==1)break b;if(!(k[l>>2]&2))break b;else{g=1;f=1}}while(0);a=a+8|0;if(a>>>0>=h>>>0){q=20;break}}}else{g=0;f=0;q=20}while(0);do if((q|0)==20){if((!g?(k[p>>2]=c,c=b+40|0,k[c>>2]=(k[c>>2]|0)+1,(k[b+36>>2]|0)==1):0)?(k[o>>2]|0)==2:0){i[n>>0]=1;if(f)break}else q=24;if((q|0)==24?f:0)break;k[m>>2]=4;break a}while(0);k[m>>2]=3;break}if((d|0)==1)k[b+32>>2]=1}while(0);return}function Tj(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=k[a+4>>2]|0;g=h>>8;if(h&1)g=k[(k[d>>2]|0)+g>>2]|0;a=k[a>>2]|0;Sb[k[(k[a>>2]|0)+20>>2]&15](a,b,c,d+g|0,(h&2|0)!=0?e:2,f);return}function Uj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=k[a+4>>2]|0;f=g>>8;if(g&1)f=k[(k[c>>2]|0)+f>>2]|0;a=k[a>>2]|0;Jb[k[(k[a>>2]|0)+24>>2]&15](a,b,c+f|0,(g&2|0)!=0?d:2,e);return}function Vj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;a:do if((a|0)==(k[b+8>>2]|0)){if((k[b+4>>2]|0)==(c|0)?(f=b+28|0,(k[f>>2]|0)!=1):0)k[f>>2]=d}else{if((a|0)!=(k[b>>2]|0)){h=k[a+8>>2]|0;Jb[k[(k[h>>2]|0)+24>>2]&15](h,b,c,d,e);break}if((k[b+16>>2]|0)!=(c|0)?(g=b+20|0,(k[g>>2]|0)!=(c|0)):0){k[b+32>>2]=d;d=b+44|0;if((k[d>>2]|0)==4)break;f=b+52|0;i[f>>0]=0;j=b+53|0;i[j>>0]=0;a=k[a+8>>2]|0;Sb[k[(k[a>>2]|0)+20>>2]&15](a,b,c,c,1,e);if(i[j>>0]|0){if(!(i[f>>0]|0)){f=1;h=13}}else{f=0;h=13}do if((h|0)==13){k[g>>2]=c;j=b+40|0;k[j>>2]=(k[j>>2]|0)+1;if((k[b+36>>2]|0)==1?(k[b+24>>2]|0)==2:0){i[b+54>>0]=1;if(f)break}else h=16;if((h|0)==16?f:0)break;k[d>>2]=4;break a}while(0);k[d>>2]=3;break}if((d|0)==1)k[b+32>>2]=1}while(0);return}function Wj(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;do if((a|0)==(k[b+8>>2]|0)){if((k[b+4>>2]|0)==(c|0)?(g=b+28|0,(k[g>>2]|0)!=1):0)k[g>>2]=d}else if((a|0)==(k[b>>2]|0)){if((k[b+16>>2]|0)!=(c|0)?(f=b+20|0,(k[f>>2]|0)!=(c|0)):0){k[b+32>>2]=d;k[f>>2]=c;e=b+40|0;k[e>>2]=(k[e>>2]|0)+1;if((k[b+36>>2]|0)==1?(k[b+24>>2]|0)==2:0)i[b+54>>0]=1;k[b+44>>2]=4;break}if((d|0)==1)k[b+32>>2]=1}while(0);return}function Xj(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0;if((a|0)==(k[b+8>>2]|0))Rj(0,b,c,d,e);else{m=b+52|0;n=i[m>>0]|0;o=b+53|0;p=i[o>>0]|0;l=k[a+12>>2]|0;g=a+16+(l<<3)|0;i[m>>0]=0;i[o>>0]=0;Tj(a+16|0,b,c,d,e,f);a:do if((l|0)>1){h=b+24|0;j=a+8|0;l=b+54|0;a=a+24|0;do{if(i[l>>0]|0)break a;if(!(i[m>>0]|0)){if((i[o>>0]|0)!=0?(k[j>>2]&1|0)==0:0)break a}else{if((k[h>>2]|0)==1)break a;if(!(k[j>>2]&2))break a}i[m>>0]=0;i[o>>0]=0;Tj(a,b,c,d,e,f);a=a+8|0}while(a>>>0>>0)}while(0);i[m>>0]=n;i[o>>0]=p}return}function Yj(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if((a|0)==(k[b+8>>2]|0))Rj(0,b,c,d,e);else{a=k[a+8>>2]|0;Sb[k[(k[a>>2]|0)+20>>2]&15](a,b,c,d,e,f)}return}function Zj(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if((a|0)==(k[b+8>>2]|0))Rj(0,b,c,d,e);return}function _j(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=r;r=r+16|0;d=e;k[d>>2]=k[c>>2];a=Qb[k[(k[a>>2]|0)+16>>2]&63](a,b,d)|0;if(a)k[c>>2]=k[d>>2];r=e;return a&1|0}function $j(a){a=a|0;if(!a)a=0;else a=(Qj(a,656,704,0)|0)!=0;return a&1|0}function ak(){var a=0;a=Va(4)|0;oj(a);ub(a|0,592,78)}function bk(){var a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0;e=r;r=r+48|0;g=e+32|0;c=e+24|0;h=e+16|0;f=e;e=e+36|0;a=kj()|0;if((a|0)!=0?(d=k[a>>2]|0,(d|0)!=0):0){a=d+48|0;b=k[a>>2]|0;a=k[a+4>>2]|0;if(!((b&-256|0)==1126902528&(a|0)==1129074247)){k[c>>2]=k[9257];hj(51919,c)}if((b|0)==1126902529&(a|0)==1129074247)a=k[d+44>>2]|0;else a=d+80|0;k[e>>2]=a;d=k[d>>2]|0;a=k[d+4>>2]|0;if(Qb[k[(k[608>>2]|0)+16>>2]&63](608,d,e)|0){h=k[e>>2]|0;e=k[9257]|0;h=Ob[k[(k[h>>2]|0)+8>>2]&127](h)|0;k[f>>2]=e;k[f+4>>2]=a;k[f+8>>2]=h;hj(51833,f)}else{k[h>>2]=k[9257];k[h+4>>2]=a;hj(51878,h)}}hj(51957,g)}function ck(){var a=0;a=r;r=r+16|0;if(!(Oa(37020,184)|0)){r=a;return}else hj(51730,a)}function dk(a){a=a|0;var b=0,c=0;c=(k[a>>2]|0)+-4|0;b=k[c>>2]|0;k[c>>2]=b+-1;if((b+-1|0)<0)mj((k[a>>2]|0)+-12|0);return}function ek(a){a=a|0;var b=0;b=r;r=r+16|0;Ql(a);if(!(sb(k[9255]|0,0)|0)){r=b;return}else hj(51780,b)}function fk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=rl(a,b,c)|0;return a|0}function gk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=sl(a,b,c)|0;return a|0}function hk(){return 37296}function ik(){return 37300}function jk(){return 37304}function kk(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function lk(a){a=a|0;if((a+-48|0)>>>0<10)a=1;else a=((a|32)+-97|0)>>>0<6;return a&1|0}function mk(){var a=0;if(!(k[9258]|0))a=37308;else{a=(kb()|0)+60|0;a=k[a>>2]|0}return a|0}function nk(a){a=a|0;var b=0,c=0;b=0;while(1){if((l[51978+b>>0]|0)==(a|0)){c=2;break}b=b+1|0;if((b|0)==87){b=87;a=52066;c=5;break}}if((c|0)==2)if(!b)a=52066;else{a=52066;c=5}if((c|0)==5)while(1){c=a;while(1){a=c+1|0;if(!(i[c>>0]|0))break;else c=a}b=b+-1|0;if(!b)break;else c=5}return a|0}function ok(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0.0,g=0,h=0,j=0.0,m=0,n=0,o=0,p=0.0,q=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0;K=r;r=r+512|0;G=K;switch(b|0){case 0:{J=24;I=-149;y=4;break}case 1:{J=53;I=-1074;y=4;break}case 2:{J=53;I=-1074;y=4;break}default:d=0.0}a:do if((y|0)==4){D=a+4|0;A=a+100|0;do{b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0}while((kk(b)|0)!=0);b:do switch(b|0){case 43:case 45:{e=1-(((b|0)==45&1)<<1)|0;b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0;H=e;break b}else{b=rk(a)|0;H=e;break b}}default:H=1}while(0);e=b;b=0;do{if((e|32|0)!=(i[53870+b>>0]|0))break;do if(b>>>0<7){e=k[D>>2]|0;if(e>>>0<(k[A>>2]|0)>>>0){k[D>>2]=e+1;e=l[e>>0]|0;break}else{e=rk(a)|0;break}}while(0);b=b+1|0}while(b>>>0<8);c:do switch(b|0){case 8:break;case 3:{y=23;break}default:{g=(c|0)!=0;if(g&b>>>0>3)if((b|0)==8)break c;else{y=23;break c}d:do if(!b){b=0;do{if((e|32|0)!=(i[56747+b>>0]|0))break d;do if(b>>>0<2){e=k[D>>2]|0;if(e>>>0<(k[A>>2]|0)>>>0){k[D>>2]=e+1;e=l[e>>0]|0;break}else{e=rk(a)|0;break}}while(0);b=b+1|0}while(b>>>0<3)}while(0);switch(b|0){case 3:{b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if((b|0)==40)b=1;else{if(!(k[A>>2]|0)){d=B;break a}k[D>>2]=(k[D>>2]|0)+-1;d=B;break a}while(1){e=k[D>>2]|0;if(e>>>0<(k[A>>2]|0)>>>0){k[D>>2]=e+1;e=l[e>>0]|0}else e=rk(a)|0;if(!((e+-48|0)>>>0<10|(e+-65|0)>>>0<26)?!((e|0)==95|(e+-97|0)>>>0<26):0)break;b=b+1|0}if((e|0)==41){d=B;break a}e=(k[A>>2]|0)==0;if(!e)k[D>>2]=(k[D>>2]|0)+-1;if(!g){J=mk()|0;k[J>>2]=22;qk(a,0);d=0.0;break a}if(!b){d=B;break a}while(1){b=b+-1|0;if(!e)k[D>>2]=(k[D>>2]|0)+-1;if(!b){d=B;break a}}}case 0:{do if((e|0)==48){b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if((b|32|0)!=120){if(!(k[A>>2]|0)){b=48;break}k[D>>2]=(k[D>>2]|0)+-1;b=48;break}b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0;g=0}else{b=rk(a)|0;g=0}e:while(1){switch(b|0){case 46:{y=74;break e}case 48:break;default:{w=0;h=0;v=0;e=0;m=g;n=0;u=0;j=1.0;g=0;d=0.0;break e}}b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0;g=1;continue}else{b=rk(a)|0;g=1;continue}}if((y|0)==74){b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if((b|0)==48){g=0;e=0;do{b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;g=tw(g|0,e|0,-1,-1)|0;e=M}while((b|0)==48);w=0;h=0;v=g;m=1;n=1;u=0;j=1.0;g=0;d=0.0}else{w=0;h=0;v=0;e=0;m=g;n=1;u=0;j=1.0;g=0;d=0.0}}while(1){s=b+-48|0;o=b|32;if(s>>>0>=10){t=(b|0)==46;if(!(t|(o+-97|0)>>>0<6)){o=v;s=w;break}if(t)if(!n){t=h;e=w;s=w;n=1;o=u;f=j}else{o=v;s=w;b=46;break}else y=86}else y=86;if((y|0)==86){y=0;b=(b|0)>57?o+-87|0:s;do if(!((w|0)<0|(w|0)==0&h>>>0<8)){if((w|0)<0|(w|0)==0&h>>>0<14){q=j*.0625;o=u;f=q;d=d+q*+(b|0);break}if((u|0)!=0|(b|0)==0){o=u;f=j}else{o=1;f=j;d=d+j*.5}}else{o=u;f=j;g=b+(g<<4)|0}while(0);h=tw(h|0,w|0,1,0)|0;t=v;s=M;m=1}b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;w=s;v=t;b=l[b>>0]|0;u=o;j=f;continue}else{w=s;v=t;b=rk(a)|0;u=o;j=f;continue}}if(!m){b=(k[A>>2]|0)==0;if(!b)k[D>>2]=(k[D>>2]|0)+-1;if(c){if(!b?(x=k[D>>2]|0,k[D>>2]=x+-1,(n|0)!=0):0)k[D>>2]=x+-2}else qk(a,0);d=+(H|0)*0.0;break a}m=(n|0)==0;n=m?h:o;m=m?s:e;if((s|0)<0|(s|0)==0&h>>>0<8){e=s;do{g=g<<4;h=tw(h|0,e|0,1,0)|0;e=M}while((e|0)<0|(e|0)==0&h>>>0<8)}if((b|32|0)==112){e=Dl(a,c)|0;b=M;if((e|0)==0&(b|0)==-2147483648){if(!c){qk(a,0);d=0.0;break a}if(!(k[A>>2]|0)){e=0;b=0}else{k[D>>2]=(k[D>>2]|0)+-1;e=0;b=0}}}else if(!(k[A>>2]|0)){e=0;b=0}else{k[D>>2]=(k[D>>2]|0)+-1;e=0;b=0}G=ww(n|0,m|0,2)|0;G=tw(G|0,M|0,-32,-1)|0;b=tw(G|0,M|0,e|0,b|0)|0;e=M;if(!g){d=+(H|0)*0.0;break a}if((e|0)>0|(e|0)==0&b>>>0>(0-I|0)>>>0){J=mk()|0;k[J>>2]=34;d=+(H|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break a}G=I+-106|0;F=((G|0)<0)<<31>>31;if((e|0)<(F|0)|(e|0)==(F|0)&b>>>0>>0){J=mk()|0;k[J>>2]=34;d=+(H|0)*2.2250738585072014e-308*2.2250738585072014e-308;break a}if((g|0)>-1){do{F=!(d>=.5);G=F&1|g<<1;g=G^1;d=d+(F?d:d+-1.0);b=tw(b|0,e|0,-1,-1)|0;e=M}while((G|0)>-1);h=b;j=d}else{h=b;j=d}b=rw(32,0,I|0,((I|0)<0)<<31>>31|0)|0;b=tw(h|0,e|0,b|0,M|0)|0;I=M;if(0>(I|0)|0==(I|0)&J>>>0>b>>>0)if((b|0)<0){b=0;y=127}else y=125;else{b=J;y=125}if((y|0)==125)if((b|0)<53)y=127;else{e=b;f=+(H|0);d=0.0}if((y|0)==127){d=+(H|0);e=b;f=d;d=+Ck(+Hk(1.0,84-b|0),d)}J=(g&1|0)==0&(j!=0.0&(e|0)<32);d=f*(J?0.0:j)+(d+f*+(((J&1)+g|0)>>>0))-d;if(!(d!=0.0)){J=mk()|0;k[J>>2]=34}d=+Ik(d,h);break a}else b=e;while(0);E=I+J|0;F=0-E|0;g=0;f:while(1){switch(b|0){case 46:{y=138;break f}case 48:break;default:{e=0;o=0;n=0;break f}}b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0;g=1;continue}else{b=rk(a)|0;g=1;continue}}if((y|0)==138){b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if((b|0)==48){e=0;b=0;while(1){e=tw(e|0,b|0,-1,-1)|0;g=M;b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if((b|0)==48)b=g;else{o=g;g=1;n=1;break}}}else{e=0;o=0;n=1}}k[G>>2]=0;m=b+-48|0;h=(b|0)==46;g:do if(h|m>>>0<10){z=G+496|0;w=0;t=0;u=h;y=o;s=g;x=n;g=0;h=0;n=0;h:while(1){do if(u)if(!x){e=w;o=t;x=1}else{o=y;b=w;m=t;break h}else{u=tw(w|0,t|0,1,0)|0;t=M;v=(b|0)!=48;if((h|0)>=125){if(!v){o=y;w=u;break}k[z>>2]=k[z>>2]|1;o=y;w=u;break}o=G+(h<<2)|0;if(g)m=b+-48+((k[o>>2]|0)*10|0)|0;k[o>>2]=m;g=g+1|0;m=(g|0)==9;o=y;w=u;s=1;g=m?0:g;h=(m&1)+h|0;n=v?u:n}while(0);b=k[D>>2]|0;if(b>>>0<(k[A>>2]|0)>>>0){k[D>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;m=b+-48|0;u=(b|0)==46;if(!(u|m>>>0<10)){m=x;y=161;break g}else y=o}s=(s|0)!=0;y=169}else{w=0;t=0;s=g;m=n;g=0;h=0;n=0;y=161}while(0);do if((y|0)==161){z=(m|0)==0;e=z?w:e;o=z?t:o;s=(s|0)!=0;if(!((b|32|0)==101&s))if((b|0)>-1){b=w;m=t;y=169;break}else{b=w;m=t;y=171;break}m=Dl(a,c)|0;b=M;if((m|0)==0&(b|0)==-2147483648){if(!c){qk(a,0);d=0.0;break}if(!(k[A>>2]|0)){m=0;b=0}else{k[D>>2]=(k[D>>2]|0)+-1;m=0;b=0}}e=tw(m|0,b|0,e|0,o|0)|0;s=w;o=M;m=t;y=173}while(0);if((y|0)==169)if(k[A>>2]|0){k[D>>2]=(k[D>>2]|0)+-1;if(s){s=b;y=173}else y=172}else y=171;if((y|0)==171)if(s){s=b;y=173}else y=172;do if((y|0)==172){J=mk()|0;k[J>>2]=22;qk(a,0);d=0.0}else if((y|0)==173){b=k[G>>2]|0;if(!b){d=+(H|0)*0.0;break}if(((m|0)<0|(m|0)==0&s>>>0<10)&((e|0)==(s|0)&(o|0)==(m|0))?J>>>0>30|(b>>>J|0)==0:0){d=+(H|0)*+(b>>>0);break}a=(I|0)/-2|0;D=((a|0)<0)<<31>>31;if((o|0)>(D|0)|(o|0)==(D|0)&e>>>0>a>>>0){J=mk()|0;k[J>>2]=34;d=+(H|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}a=I+-106|0;D=((a|0)<0)<<31>>31;if((o|0)<(D|0)|(o|0)==(D|0)&e>>>0>>0){J=mk()|0;k[J>>2]=34;d=+(H|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if(g){if((g|0)<9){m=G+(h<<2)|0;b=k[m>>2]|0;do{b=b*10|0;g=g+1|0}while((g|0)!=9);k[m>>2]=b}h=h+1|0}if((n|0)<9?(n|0)<=(e|0)&(e|0)<18:0){if((e|0)==9){d=+(H|0)*+((k[G>>2]|0)>>>0);break}if((e|0)<9){d=+(H|0)*+((k[G>>2]|0)>>>0)/+(k[37312+(8-e<<2)>>2]|0);break}a=J+27+(ia(e,-3)|0)|0;b=k[G>>2]|0;if((a|0)>30|(b>>>a|0)==0){d=+(H|0)*+(b>>>0)*+(k[37312+(e+-10<<2)>>2]|0);break}}b=(e|0)%9|0;if(!b){g=0;b=0}else{s=(e|0)>-1?b:b+9|0;m=k[37312+(8-s<<2)>>2]|0;if(h){n=1e9/(m|0)|0;g=0;b=0;o=0;do{A=G+(o<<2)|0;D=k[A>>2]|0;a=((D>>>0)/(m>>>0)|0)+b|0;k[A>>2]=a;b=ia((D>>>0)%(m>>>0)|0,n)|0;a=(o|0)==(g|0)&(a|0)==0;o=o+1|0;e=a?e+-9|0:e;g=a?o&127:g}while((o|0)!=(h|0));if(b){k[G+(h<<2)>>2]=b;h=h+1|0}}else{g=0;h=0}b=0;e=9-s+e|0}i:while(1){t=(e|0)<18;u=(e|0)==18;v=G+(g<<2)|0;do{if(!t){if(!u)break i;if((k[v>>2]|0)>>>0>=9007199){e=18;break i}}m=0;n=h+127|0;while(1){s=n&127;o=G+(s<<2)|0;n=ww(k[o>>2]|0,0,29)|0;n=tw(n|0,M|0,m|0,0)|0;m=M;if(m>>>0>0|(m|0)==0&n>>>0>1e9){a=Ew(n|0,m|0,1e9,0)|0;n=Fw(n|0,m|0,1e9,0)|0;m=a}else m=0;k[o>>2]=n;a=(s|0)==(g|0);h=(s|0)!=(h+127&127|0)|a?h:(n|0)==0?s:h;if(a)break;else n=s+-1|0}b=b+-29|0}while((m|0)==0);g=g+127&127;if((g|0)==(h|0)){a=h+127&127;h=G+((h+126&127)<<2)|0;k[h>>2]=k[h>>2]|k[G+(a<<2)>>2];h=a}k[G+(g<<2)>>2]=m;e=e+9|0}j:while(1){w=h+1&127;v=G+((h+127&127)<<2)|0;while(1){t=(e|0)==18;u=(e|0)>27?9:1;s=t^1;while(1){n=g&127;o=(n|0)==(h|0);do if(!o){m=k[G+(n<<2)>>2]|0;if(m>>>0<9007199){y=219;break}if(m>>>0>9007199)break;m=g+1&127;if((m|0)==(h|0)){y=219;break}m=k[G+(m<<2)>>2]|0;if(m>>>0<254740991){y=219;break}if(!(m>>>0>254740991|s)){e=n;break j}}else y=219;while(0);if((y|0)==219?(y=0,t):0){y=220;break j}b=b+u|0;if((g|0)==(h|0))g=h;else break}s=(1<>>u;n=g;m=0;o=g;while(1){D=G+(o<<2)|0;a=k[D>>2]|0;g=(a>>>u)+m|0;k[D>>2]=g;m=ia(a&s,t)|0;g=(o|0)==(n|0)&(g|0)==0;o=o+1&127;e=g?e+-9|0:e;g=g?o:n;if((o|0)==(h|0))break;else n=g}if(!m)continue;if((w|0)!=(g|0))break;k[v>>2]=k[v>>2]|1}k[G+(h<<2)>>2]=m;h=w}if((y|0)==220)if(o){k[G+(w+-1<<2)>>2]=0;e=h;h=w}else e=n;d=+((k[G+(e<<2)>>2]|0)>>>0);e=g+1&127;if((e|0)==(h|0)){h=g+2&127;k[G+(h+-1<<2)>>2]=0}q=+(H|0);f=q*(d*1.0e9+ +((k[G+(e<<2)>>2]|0)>>>0));t=b+53|0;o=t-I|0;s=(o|0)<(J|0);e=s&1;n=s?((o|0)<0?0:o):J;if((n|0)<53){L=+Ck(+Hk(1.0,105-n|0),f);j=+Ek(f,+Hk(1.0,53-n|0));p=L;d=j;j=L+(f-j)}else{p=0.0;d=0.0;j=f}m=g+2&127;do if((m|0)==(h|0))f=d;else{m=k[G+(m<<2)>>2]|0;do if(m>>>0>=5e8){if(m>>>0>5e8){d=q*.75+d;break}if((g+3&127|0)==(h|0)){d=q*.5+d;break}else{d=q*.75+d;break}}else{if((m|0)==0?(g+3&127|0)==(h|0):0)break;d=q*.25+d}while(0);if((53-n|0)<=1){f=d;break}if(+Ek(d,1.0)!=0.0){f=d;break}f=d+1.0}while(0);d=j+f-p;do if((t&2147483647|0)>(-2-E|0)){if(+X(+d)>=9007199254740992.0){e=s&(n|0)==(o|0)?0:e;b=b+1|0;d=d*.5}if((b+50|0)<=(F|0)?!(f!=0.0&(e|0)!=0):0)break;J=mk()|0;k[J>>2]=34}while(0);d=+Ik(d,b)}while(0);break a}default:{if(k[A>>2]|0)k[D>>2]=(k[D>>2]|0)+-1;J=mk()|0;k[J>>2]=22;qk(a,0);d=0.0;break a}}}}while(0);if((y|0)==23){e=(k[A>>2]|0)==0;if(!e)k[D>>2]=(k[D>>2]|0)+-1;if((c|0)!=0&b>>>0>3)do{if(!e)k[D>>2]=(k[D>>2]|0)+-1;b=b+-1|0}while(b>>>0>3)}d=+(H|0)*C}while(0);r=K;return +d}function pk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,m=0,n=0,o=0,p=0,q=0,r=0;a:do if(b>>>0>36){e=mk()|0;k[e>>2]=22;e=0;d=0}else{r=a+4|0;q=a+100|0;do{f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0}while((kk(f)|0)!=0);b:do switch(f|0){case 43:case 45:{g=((f|0)==45)<<31>>31;f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0;p=g;break b}else{f=rk(a)|0;p=g;break b}}default:p=0}while(0);g=(b|0)==0;do if((b&-17|0)==0&(f|0)==48){f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;if((f|32|0)!=120)if(g){b=8;n=46;break}else{n=32;break}b=k[r>>2]|0;if(b>>>0<(k[q>>2]|0)>>>0){k[r>>2]=b+1;f=l[b>>0]|0}else f=rk(a)|0;if((l[53879+(f+1)>>0]|0)>15){d=(k[q>>2]|0)==0;if(!d)k[r>>2]=(k[r>>2]|0)+-1;if(!c){qk(a,0);e=0;d=0;break a}if(d){e=0;d=0;break a}k[r>>2]=(k[r>>2]|0)+-1;e=0;d=0;break a}else{b=16;n=46}}else{b=g?10:b;if((l[53879+(f+1)>>0]|0)>>>0>>0)n=32;else{if(k[q>>2]|0)k[r>>2]=(k[r>>2]|0)+-1;qk(a,0);e=mk()|0;k[e>>2]=22;e=0;d=0;break a}}while(0);if((n|0)==32)if((b|0)==10){b=f+-48|0;if(b>>>0<10){f=0;while(1){g=(f*10|0)+b|0;b=k[r>>2]|0;if(b>>>0<(k[q>>2]|0)>>>0){k[r>>2]=b+1;f=l[b>>0]|0}else f=rk(a)|0;b=f+-48|0;if(!(b>>>0<10&g>>>0<429496729)){b=g;break}else f=g}g=0}else{b=0;g=0}c=f+-48|0;if(c>>>0<10){while(1){h=Dw(b|0,g|0,10,0)|0;j=M;m=((c|0)<0)<<31>>31;o=~m;if(j>>>0>o>>>0|(j|0)==(o|0)&h>>>0>~c>>>0){h=b;break}b=tw(h|0,j|0,c|0,m|0)|0;g=M;f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;c=f+-48|0;if(!(c>>>0<10&(g>>>0<429496729|(g|0)==429496729&b>>>0<2576980378))){h=b;break}}if(c>>>0>9){f=h;b=p}else{b=10;n=72}}else{f=b;b=p}}else n=46;c:do if((n|0)==46){if(!(b+-1&b)){n=i[54136+((b*23|0)>>>5&7)>>0]|0;g=i[53879+(f+1)>>0]|0;c=g&255;if(c>>>0>>0){f=0;while(1){h=c|f<>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;g=i[53879+(f+1)>>0]|0;c=g&255;if(!(h>>>0<134217728&c>>>0>>0))break;else f=h}c=0}else{c=0;h=0}j=uw(-1,-1,n|0)|0;m=M;if((g&255)>>>0>=b>>>0|(c>>>0>m>>>0|(c|0)==(m|0)&h>>>0>j>>>0)){g=c;n=72;break}else f=c;while(1){h=ww(h|0,f|0,n|0)|0;c=M;h=g&255|h;f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;g=i[53879+(f+1)>>0]|0;if((g&255)>>>0>=b>>>0|(c>>>0>m>>>0|(c|0)==(m|0)&h>>>0>j>>>0)){g=c;n=72;break c}else f=c}}g=i[53879+(f+1)>>0]|0;c=g&255;if(c>>>0>>0){f=0;while(1){h=c+(ia(f,b)|0)|0;f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;g=i[53879+(f+1)>>0]|0;c=g&255;if(!(h>>>0<119304647&c>>>0>>0))break;else f=h}c=0}else{h=0;c=0}if((g&255)>>>0>>0){n=Ew(-1,-1,b|0,0)|0;o=M;m=c;while(1){if(m>>>0>o>>>0|(m|0)==(o|0)&h>>>0>n>>>0){g=m;n=72;break c}c=Dw(h|0,m|0,b|0,0)|0;j=M;g=g&255;if(j>>>0>4294967295|(j|0)==-1&c>>>0>~g>>>0){g=m;n=72;break c}h=tw(g|0,0,c|0,j|0)|0;c=M;f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;g=i[53879+(f+1)>>0]|0;if((g&255)>>>0>=b>>>0){g=c;n=72;break}else m=c}}else{g=c;n=72}}while(0);if((n|0)==72)if((l[53879+(f+1)>>0]|0)>>>0>>0){do{f=k[r>>2]|0;if(f>>>0<(k[q>>2]|0)>>>0){k[r>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0}while((l[53879+(f+1)>>0]|0)>>>0>>0);g=mk()|0;k[g>>2]=34;g=e;f=d;b=(d&1|0)==0&0==0?p:0}else{f=h;b=p}if(k[q>>2]|0)k[r>>2]=(k[r>>2]|0)+-1;if(!(g>>>0>>0|(g|0)==(e|0)&f>>>0>>0)){if(!((d&1|0)!=0|0!=0|(b|0)!=0)){r=mk()|0;k[r>>2]=34;d=tw(d|0,e|0,-1,-1)|0;e=M;break}if(g>>>0>e>>>0|(g|0)==(e|0)&f>>>0>d>>>0){r=mk()|0;k[r>>2]=34;break}}d=((b|0)<0)<<31>>31;d=rw(f^b|0,g^d|0,b|0,d|0)|0;e=M}while(0);M=e;return d|0}function qk(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;k[a+104>>2]=b;c=k[a+4>>2]|0;d=k[a+8>>2]|0;e=d-c|0;k[a+108>>2]=e;if((b|0)!=0&(e|0)>(b|0))k[a+100>>2]=c+b;else k[a+100>>2]=d;return}function rk(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;c=a+104|0;f=k[c>>2]|0;if((f|0)!=0?(k[a+108>>2]|0)>=(f|0):0)g=4;else{b=cl(a)|0;if((b|0)>=0){e=k[c>>2]|0;c=a+8|0;if(e){d=k[c>>2]|0;f=k[a+4>>2]|0;c=d;e=e-(k[a+108>>2]|0)+-1|0;if((c-f|0)>(e|0))k[a+100>>2]=f+e;else g=9}else{d=k[c>>2]|0;c=d;g=9}if((g|0)==9)k[a+100>>2]=c;c=k[a+4>>2]|0;if(d){a=a+108|0;k[a>>2]=d+1-c+(k[a>>2]|0)}c=c+-1|0;if((l[c>>0]|0|0)!=(b|0))i[c>>0]=b}else g=4}if((g|0)==4){k[a+100>>2]=0;b=-1}return b|0}function sk(a){a=a|0;var b=0;if(a>>>0>4294963200){b=mk()|0;k[b>>2]=0-a;a=-1}return a|0}function tk(a){a=a|0;return 0}function uk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return d|0}function vk(a,b){a=a|0;b=b|0;return -1|0}function wk(a){a=a|0;Ql(a);return}function xk(a,b){a=a|0;b=b|0;return (a+-48|0)>>>0<10|0}function yk(a,b){a=a|0;b=b|0;return lk(a)|0}function zk(a,b,c){a=a|0;b=b|0;c=c|0;if(((i[b>>0]|0)!=0?(vl(b,58885)|0)!=0:0)?(vl(b,54145)|0)!=0:0)c=0;else if(!c)c=Rl(1,4)|0;return c|0}function Ak(a){a=a|0;var b=0,c=0;b=(kb()|0)+176|0;c=k[b>>2]|0;if(a)k[b>>2]=a;return c|0}function Bk(a,b){a=+a;b=+b;var c=0,d=0;p[t>>3]=a;d=k[t>>2]|0;c=k[t+4>>2]|0;p[t>>3]=b;c=k[t+4>>2]&-2147483648|c&2147483647;k[t>>2]=d;k[t+4>>2]=c;return +(+p[t>>3])}function Ck(a,b){a=+a;b=+b;return +(+Bk(a,b))}function Dk(a,b){a=+a;b=+b;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0;p[t>>3]=a;c=k[t>>2]|0;j=k[t+4>>2]|0;p[t>>3]=b;l=k[t>>2]|0;m=k[t+4>>2]|0;d=uw(c|0,j|0,52)|0;d=d&2047;h=uw(l|0,m|0,52)|0;h=h&2047;n=j&-2147483648;g=ww(l|0,m|0,1)|0;i=M;a:do if(!((g|0)==0&(i|0)==0)?(f=m&2147483647,!(f>>>0>2146435072|(f|0)==2146435072&l>>>0>0|(d|0)==2047)):0){e=ww(c|0,j|0,1)|0;f=M;if(!(f>>>0>i>>>0|(f|0)==(i|0)&e>>>0>g>>>0))return +((e|0)==(g|0)&(f|0)==(i|0)?a*0.0:a);if(!d){d=ww(c|0,j|0,12)|0;e=M;if((e|0)>-1|(e|0)==-1&d>>>0>4294967295){f=d;d=0;do{d=d+-1|0;f=ww(f|0,e|0,1)|0;e=M}while((e|0)>-1|(e|0)==-1&f>>>0>4294967295)}else d=0;c=ww(c|0,j|0,1-d|0)|0;e=M}else e=j&1048575|1048576;if(!h){f=ww(l|0,m|0,12)|0;g=M;if((g|0)>-1|(g|0)==-1&f>>>0>4294967295){h=0;do{h=h+-1|0;f=ww(f|0,g|0,1)|0;g=M}while((g|0)>-1|(g|0)==-1&f>>>0>4294967295)}else h=0;l=ww(l|0,m|0,1-h|0)|0;j=M}else j=m&1048575|1048576;i=rw(c|0,e|0,l|0,j|0)|0;g=M;f=(g|0)>-1|(g|0)==-1&i>>>0>4294967295;b:do if((d|0)>(h|0)){while(1){if(f)if((c|0)==(l|0)&(e|0)==(j|0))break;else{c=i;e=g}c=ww(c|0,e|0,1)|0;e=M;d=d+-1|0;i=rw(c|0,e|0,l|0,j|0)|0;g=M;f=(g|0)>-1|(g|0)==-1&i>>>0>4294967295;if((d|0)<=(h|0))break b}b=a*0.0;break a}while(0);if(f)if((c|0)==(l|0)&(e|0)==(j|0)){b=a*0.0;break}else{e=g;c=i}if(e>>>0<1048576|(e|0)==1048576&c>>>0<0)do{c=ww(c|0,e|0,1)|0;e=M;d=d+-1|0}while(e>>>0<1048576|(e|0)==1048576&c>>>0<0);if((d|0)>0){m=tw(c|0,e|0,0,-1048576)|0;c=M;d=ww(d|0,0,52)|0;c=c|M;d=m|d}else{d=uw(c|0,e|0,1-d|0)|0;c=M}k[t>>2]=d;k[t+4>>2]=c|n;b=+p[t>>3]}else o=3;while(0);if((o|0)==3){b=a*b;b=b/b}return +b}function Ek(a,b){a=+a;b=+b;return +(+Dk(a,b))}function Fk(a,b){a=+a;b=b|0;var c=0,d=0,e=0;p[t>>3]=a;c=k[t>>2]|0;d=k[t+4>>2]|0;e=uw(c|0,d|0,52)|0;e=e&2047;switch(e|0){case 0:{if(a!=0.0){a=+Fk(a*18446744073709551616.0,b);c=(k[b>>2]|0)+-64|0}else c=0;k[b>>2]=c;break}case 2047:break;default:{k[b>>2]=e+-1022;k[t>>2]=c;k[t+4>>2]=d&-2146435073|1071644672;a=+p[t>>3]}}return +a}function Gk(a,b){a=+a;b=b|0;return +(+Fk(a,b))}function Hk(a,b){a=+a;b=b|0;var c=0;if((b|0)>1023){a=a*8988465674311579538646525.0e283;c=b+-1023|0;if((c|0)>1023){c=b+-2046|0;c=(c|0)>1023?1023:c;a=a*8988465674311579538646525.0e283}}else if((b|0)<-1022){a=a*2.2250738585072014e-308;c=b+1022|0;if((c|0)<-1022){c=b+2044|0;c=(c|0)<-1022?-1022:c;a=a*2.2250738585072014e-308}}else c=b;c=ww(c+1023|0,0,52)|0;b=M;k[t>>2]=c;k[t+4>>2]=b;return +(a*+p[t>>3])}function Ik(a,b){a=+a;b=b|0;return +(+Hk(a,b))}function Jk(a,b,c){a=a|0;b=b|0;c=c|0;return Kk(0,a,b,(c|0)!=0?c:37344)|0}function Kk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0;j=r;r=r+16|0;e=j;g=(d|0)==0?37348:d;d=k[g>>2]|0;a:do if(!b)if(!d)d=0;else h=15;else{f=(a|0)==0?e:a;if(!c)d=-2;else{if(!d){d=i[b>>0]|0;e=d&255;if(d<<24>>24>-1){k[f>>2]=e;d=d<<24>>24!=0&1;break}d=e+-194|0;if(d>>>0>50){h=15;break}d=k[37076+(d<<2)>>2]|0;e=c+-1|0;if(e){b=b+1|0;h=9}}else{e=c;h=9}b:do if((h|0)==9){a=i[b>>0]|0;l=(a&255)>>>3;if((l+-16|l+(d>>26))>>>0>7){h=15;break a}while(1){b=b+1|0;d=(a&255)+-128|d<<6;e=e+-1|0;if((d|0)>=0)break;if(!e)break b;a=i[b>>0]|0;if((a&-64)<<24>>24!=-128){h=15;break a}}k[g>>2]=0;k[f>>2]=d;d=c-e|0;break a}while(0);k[g>>2]=d;d=-2}}while(0);if((h|0)==15){k[g>>2]=0;d=mk()|0;k[d>>2]=84;d=-1}r=j;return d|0}function Lk(a){a=a|0;if(!a)a=1;else a=(k[a>>2]|0)==0;return a&1|0}function Mk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0;n=r;r=r+1040|0;j=n+8|0;m=n;i=k[b>>2]|0;k[m>>2]=i;l=(a|0)!=0;d=l?d:256;a=l?a:j;f=i;a:do if((d|0)!=0&(i|0)!=0){h=d;i=f;d=0;while(1){f=c>>>2;g=f>>>0>=h>>>0;if(!(c>>>0>131|g)){f=i;break a}f=g?h:f;c=c-f|0;f=Nk(a,m,f,e)|0;if((f|0)==-1){d=c;break}o=(a|0)==(j|0);i=o?0:f;g=h-i|0;a=o?a:a+(f<<2)|0;d=f+d|0;f=k[m>>2]|0;if((h|0)!=(i|0)&(f|0)!=0){h=g;i=f}else{h=g;break a}}c=d;h=0;f=k[m>>2]|0;d=-1}else{h=d;d=0}while(0);b:do if((f|0)!=0?(h|0)!=0&(c|0)!=0:0){g=f;f=a;while(1){a=Kk(f,g,c,e)|0;if((a+2|0)>>>0<3)break;g=(k[m>>2]|0)+a|0;k[m>>2]=g;h=h+-1|0;d=d+1|0;if(!((h|0)!=0&(c|0)!=(a|0)))break b;else{c=c-a|0;f=f+4|0}}switch(a|0){case -1:{d=-1;break b}case 0:{k[m>>2]=0;break b}default:{k[e>>2]=0;break b}}}while(0);if(l)k[b>>2]=k[m>>2];r=n;return d|0}function Nk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,m=0;e=k[b>>2]|0;if((d|0)!=0?(f=k[d>>2]|0,(f|0)!=0):0)if(!a){d=c;g=e;m=16}else{k[d>>2]=0;j=a;d=c;h=f;m=37}else if(!a){d=c;m=7}else{f=a;d=c;m=6}a:while(1)if((m|0)==6){if(!d){m=26;break}else a=f;while(1){f=i[e>>0]|0;do if(((f&255)+-1|0)>>>0<127?d>>>0>4&(e&3|0)==0:0){g=e;while(1){e=k[g>>2]|0;if((e+-16843009|e)&-2139062144){f=e;e=g;m=32;break}k[a>>2]=e&255;k[a+4>>2]=l[g+1>>0];k[a+8>>2]=l[g+2>>0];e=g+4|0;f=a+16|0;k[a+12>>2]=l[g+3>>0];d=d+-4|0;if(d>>>0>4){a=f;g=e}else{m=31;break}}if((m|0)==31){a=f;f=i[e>>0]|0;break}else if((m|0)==32){f=f&255;break}}while(0);f=f&255;if((f+-1|0)>>>0>=127)break;e=e+1|0;k[a>>2]=f;d=d+-1|0;if(!d){m=26;break a}else a=a+4|0}f=f+-194|0;if(f>>>0>50){m=48;break}j=a;h=k[37076+(f<<2)>>2]|0;e=e+1|0;m=37;continue}else if((m|0)==7){f=i[e>>0]|0;if(((f&255)+-1|0)>>>0<127?(e&3|0)==0:0){f=k[e>>2]|0;if(!((f+-16843009|f)&-2139062144))do{e=e+4|0;d=d+-4|0;f=k[e>>2]|0}while(((f+-16843009|f)&-2139062144|0)==0);f=f&255}f=f&255;if((f+-1|0)>>>0<127){d=d+-1|0;e=e+1|0;m=7;continue}f=f+-194|0;if(f>>>0>50){m=48;break}f=k[37076+(f<<2)>>2]|0;g=e+1|0;m=16;continue}else if((m|0)==16){m=(l[g>>0]|0)>>>3;if((m+-16|m+(f>>26))>>>0>7){m=17;break}e=g+1|0;if(f&33554432){if((i[e>>0]&-64)<<24>>24!=-128){m=20;break}e=g+2|0;if(f&524288){if((i[e>>0]&-64)<<24>>24!=-128){m=23;break}e=g+3|0}}d=d+-1|0;m=7;continue}else if((m|0)==37){f=l[e>>0]|0;m=f>>>3;if((m+-16|m+(h>>26))>>>0>7){m=38;break}g=e+1|0;a=f+-128|h<<6;if((a|0)<0){f=l[g>>0]|0;if((f&192|0)!=128){m=41;break}g=e+2|0;a=f+-128|a<<6;if((a|0)<0){f=l[g>>0]|0;if((f&192|0)!=128){m=44;break}a=f+-128|a<<6;e=e+3|0}else e=g}else e=g;k[j>>2]=a;f=j+4|0;d=d+-1|0;m=6;continue}if((m|0)==17){e=g+-1|0;m=47}else if((m|0)==20){e=g+-1|0;m=47}else if((m|0)==23){e=g+-1|0;m=47}else if((m|0)==26)k[b>>2]=e;else if((m|0)==38){a=j;f=h;e=e+-1|0;m=47}else if((m|0)==41){d=j;c=e+-1|0;m=52}else if((m|0)==44){d=j;c=e+-1|0;m=52}if((m|0)==47)if(!f)m=48;else{d=a;c=e;m=52}if((m|0)==48)if(!(i[e>>0]|0)){if(a){k[a>>2]=0;k[b>>2]=0}c=c-d|0}else{d=a;c=e;m=52}if((m|0)==52){m=mk()|0;k[m>>2]=84;if(!d)c=-1;else{k[b>>2]=c;c=-1}}return c|0}function Ok(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;g=r;r=r+16|0;d=g;a:do if(!b)d=0;else{do if(c){f=(a|0)==0?d:a;d=i[b>>0]|0;a=d&255;if(d<<24>>24>-1){k[f>>2]=a;d=d<<24>>24!=0&1;break a}d=a+-194|0;if(d>>>0<=50){a=b+1|0;e=k[37076+(d<<2)>>2]|0;if(c>>>0<4?(e&-2147483648>>>((c*6|0)+-6|0)|0)!=0:0)break;d=l[a>>0]|0;c=d>>>3;if((c+-16|c+(e>>26))>>>0<=7){d=d+-128|e<<6;if((d|0)>=0){k[f>>2]=d;d=2;break a}a=l[b+2>>0]|0;if((a&192|0)==128){a=a+-128|d<<6;if((a|0)>=0){k[f>>2]=a;d=3;break a}d=l[b+3>>0]|0;if((d&192|0)==128){k[f>>2]=d+-128|a<<6;d=4;break a}}}}}while(0);d=mk()|0;k[d>>2]=84;d=-1}while(0);r=g;return d|0}function Pk(a,b,c){a=a|0;b=b|0;c=c|0;do if(a){if(b>>>0<128){i[a>>0]=b;a=1;break}if(b>>>0<2048){i[a>>0]=b>>>6|192;i[a+1>>0]=b&63|128;a=2;break}if(b>>>0<55296|(b&-8192|0)==57344){i[a>>0]=b>>>12|224;i[a+1>>0]=b>>>6&63|128;i[a+2>>0]=b&63|128;a=3;break}if((b+-65536|0)>>>0<1048576){i[a>>0]=b>>>18|240;i[a+1>>0]=b>>>12&63|128;i[a+2>>0]=b>>>6&63|128;i[a+3>>0]=b&63|128;a=4;break}else{a=mk()|0;k[a>>2]=84;a=-1;break}}else a=1;while(0);return a|0}function Qk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0;l=r;r=r+272|0;h=l+8|0;j=l;g=k[b>>2]|0;k[j>>2]=g;i=(a|0)!=0;e=i?d:256;d=i?a:h;a=g;a:do if((e|0)!=0&(g|0)!=0){g=e;f=a;e=0;while(1){a=c>>>0>=g>>>0;if(!(a|c>>>0>32)){a=f;break a}a=a?g:c;c=c-a|0;a=Rk(d,j,a,0)|0;if((a|0)==-1){e=c;break}n=(d|0)==(h|0);m=n?0:a;f=g-m|0;d=n?d:d+a|0;e=a+e|0;a=k[j>>2]|0;if((g|0)!=(m|0)&(a|0)!=0){g=f;f=a}else{g=f;break a}}c=e;g=0;a=k[j>>2]|0;e=-1}else{g=e;e=0}while(0);b:do if((a|0)!=0?(g|0)!=0&(c|0)!=0:0){f=a;a=d;while(1){d=Pk(a,k[f>>2]|0,0)|0;if((d+1|0)>>>0<2)break;f=(k[j>>2]|0)+4|0;k[j>>2]=f;c=c+-1|0;e=e+1|0;if(!((g|0)!=(d|0)&(c|0)!=0))break b;else{g=g-d|0;a=a+d|0}}if(!d)k[j>>2]=0;else e=-1}while(0);if(i)k[b>>2]=k[j>>2];r=l;return e|0}function Rk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;h=r;r=r+16|0;g=h;a:do if(!a){a=k[b>>2]|0;d=k[a>>2]|0;if(!d)c=0;else{c=0;do{if(d>>>0>127){d=Pk(g,d,0)|0;if((d|0)==-1){c=-1;break a}}else d=1;c=d+c|0;a=a+4|0;d=k[a>>2]|0}while((d|0)!=0)}}else{b:do if(c>>>0>3){d=c;e=k[b>>2]|0;while(1){f=k[e>>2]|0;if((f+-1|0)>>>0>126){if(!f)break;f=Pk(a,f,0)|0;if((f|0)==-1){c=-1;break a}a=a+f|0;d=d-f|0}else{i[a>>0]=f;a=a+1|0;d=d+-1|0;e=k[b>>2]|0}e=e+4|0;k[b>>2]=e;if(d>>>0<=3)break b}i[a>>0]=0;k[b>>2]=0;c=c-d|0;break a}else d=c;while(0);if(d){e=k[b>>2]|0;while(1){f=k[e>>2]|0;if((f+-1|0)>>>0>126){if(!f){e=19;break}f=Pk(g,f,0)|0;if((f|0)==-1){c=-1;break a}if(d>>>0>>0){e=22;break}Pk(a,k[e>>2]|0,0)|0;a=a+f|0;d=d-f|0}else{i[a>>0]=f;a=a+1|0;d=d+-1|0;e=k[b>>2]|0}e=e+4|0;k[b>>2]=e;if(!d)break a}if((e|0)==19){i[a>>0]=0;k[b>>2]=0;c=c-d|0;break}else if((e|0)==22){c=c-d|0;break}}}while(0);r=h;return c|0}function Sk(a,b){a=a|0;b=b|0;if(!a)a=0;else a=Pk(a,b,0)|0;return a|0}function Tk(a){a=a|0;return 0}function Uk(a){a=a|0;return}function Vk(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0;j=r;r=r+16|0;h=j;g=b&255;i[h>>0]=g;d=a+16|0;e=k[d>>2]|0;if(!e)if(!(bl(a)|0)){e=k[d>>2]|0;f=4}else c=-1;else f=4;do if((f|0)==4){d=a+20|0;f=k[d>>2]|0;if(f>>>0>>0?(c=b&255,(c|0)!=(i[a+75>>0]|0)):0){k[d>>2]=f+1;i[f>>0]=g;break}if((Qb[k[a+36>>2]&63](a,h,1)|0)==1)c=l[h>>0]|0;else c=-1}while(0);r=j;return c|0}function Wk(a){a=a|0;var b=0,c=0;b=r;r=r+16|0;c=b;k[c>>2]=k[a+60>>2];a=sk(wb(6,c|0)|0)|0;r=b;return a|0}function Xk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0;l=r;r=r+48|0;f=l+16|0;e=l;d=l+32|0;k[d>>2]=b;g=d+4|0;j=a+48|0;m=k[j>>2]|0;k[g>>2]=c-((m|0)!=0&1);h=a+44|0;k[d+8>>2]=k[h>>2];k[d+12>>2]=m;if(!(k[9258]|0)){k[f>>2]=k[a+60>>2];k[f+4>>2]=d;k[f+8>>2]=2;d=sk(Eb(145,f|0)|0)|0}else{xb(185,a|0);k[e>>2]=k[a+60>>2];k[e+4>>2]=d;k[e+8>>2]=2;d=sk(Eb(145,e|0)|0)|0;pb(0)}if((d|0)>=1){g=k[g>>2]|0;if(d>>>0>g>>>0){f=k[h>>2]|0;e=a+4|0;k[e>>2]=f;k[a+8>>2]=f+(d-g);if(!(k[j>>2]|0))d=c;else{k[e>>2]=f+1;i[b+(c+-1)>>0]=i[f>>0]|0;d=c}}}else{k[a>>2]=k[a>>2]|d&48^16;k[a+8>>2]=0;k[a+4>>2]=0}r=l;return d|0}function Yk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=r;r=r+32|0;f=e;d=e+20|0;k[f>>2]=k[a+60>>2];k[f+4>>2]=0;k[f+8>>2]=b;k[f+12>>2]=d;k[f+16>>2]=c;if((sk(Db(140,f|0)|0)|0)<0){k[d>>2]=-1;a=-1}else a=k[d>>2]|0;r=e;return a|0}function Zk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,l=0,m=0,n=0,o=0,p=0;p=r;r=r+48|0;m=p+16|0;l=p;d=p+32|0;n=a+28|0;e=k[n>>2]|0;k[d>>2]=e;o=a+20|0;e=(k[o>>2]|0)-e|0;k[d+4>>2]=e;k[d+8>>2]=b;k[d+12>>2]=c;i=a+60|0;j=a+44|0;b=2;e=e+c|0;while(1){if(!(k[9258]|0)){k[m>>2]=k[i>>2];k[m+4>>2]=d;k[m+8>>2]=b;g=sk(Fb(146,m|0)|0)|0}else{xb(186,a|0);k[l>>2]=k[i>>2];k[l+4>>2]=d;k[l+8>>2]=b;g=sk(Fb(146,l|0)|0)|0;pb(0)}if((e|0)==(g|0)){e=6;break}if((g|0)<0){e=8;break}e=e-g|0;f=k[d+4>>2]|0;if(g>>>0<=f>>>0)if((b|0)==2){k[n>>2]=(k[n>>2]|0)+g;h=f;b=2}else h=f;else{h=k[j>>2]|0;k[n>>2]=h;k[o>>2]=h;h=k[d+12>>2]|0;g=g-f|0;d=d+8|0;b=b+-1|0}k[d>>2]=(k[d>>2]|0)+g;k[d+4>>2]=h-g}if((e|0)==6){m=k[j>>2]|0;k[a+16>>2]=m+(k[a+48>>2]|0);a=m;k[n>>2]=a;k[o>>2]=a}else if((e|0)==8){k[a+16>>2]=0;k[n>>2]=0;k[o>>2]=0;k[a>>2]=k[a>>2]|32;if((b|0)==2)c=0;else c=c-(k[d+4>>2]|0)|0}r=p;return c|0}function _k(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=r;r=r+80|0;d=e;k[a+36>>2]=8;if((k[a>>2]&64|0)==0?(k[d>>2]=k[a+60>>2],k[d+4>>2]=21505,k[d+8>>2]=e+12,(nb(54,d|0)|0)!=0):0)i[a+75>>0]=-1;d=Zk(a,b,c)|0;r=e;return d|0}function $k(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=a+84|0;f=k[d>>2]|0;g=c+256|0;e=tl(f,0,g)|0;e=(e|0)==0?g:e-f|0;c=e>>>0>>0?e:c;vw(b|0,f|0,c|0)|0;k[a+4>>2]=f+c;b=f+e|0;k[a+8>>2]=b;k[d>>2]=b;return c|0}function al(a){a=a|0;var b=0,c=0;b=a+74|0;c=i[b>>0]|0;i[b>>0]=c+255|c;b=a+20|0;c=a+44|0;if((k[b>>2]|0)>>>0>(k[c>>2]|0)>>>0)Qb[k[a+36>>2]&63](a,0,0)|0;k[a+16>>2]=0;k[a+28>>2]=0;k[b>>2]=0;b=k[a>>2]|0;if(b&20)if(!(b&4))b=-1;else{k[a>>2]=b|32;b=-1}else{b=k[c>>2]|0;k[a+8>>2]=b;k[a+4>>2]=b;b=0}return b|0}function bl(a){a=a|0;var b=0,c=0;b=a+74|0;c=i[b>>0]|0;i[b>>0]=c+255|c;b=k[a>>2]|0;if(!(b&8)){k[a+8>>2]=0;k[a+4>>2]=0;b=k[a+44>>2]|0;k[a+28>>2]=b;k[a+20>>2]=b;k[a+16>>2]=b+(k[a+48>>2]|0);b=0}else{k[a>>2]=b|32;b=-1}return b|0}function cl(a){a=a|0;var b=0,c=0;c=r;r=r+16|0;b=c;if((k[a+8>>2]|0)==0?(al(a)|0)!=0:0)b=-1;else if((Qb[k[a+32>>2]&63](a,b,1)|0)==1)b=l[b>>0]|0;else b=-1;r=c;return b|0}function dl(a){a=a|0;var b=0,c=0;do if(a){if((k[a+76>>2]|0)<=-1){b=Gl(a)|0;break}c=(Tk(a)|0)==0;b=Gl(a)|0;if(!c)Uk(a)}else{if(!(k[9323]|0))b=0;else b=dl(k[9323]|0)|0;Na(37060);a=k[9264]|0;if(a)do{if((k[a+76>>2]|0)>-1)c=Tk(a)|0;else c=0;if((k[a+20>>2]|0)>>>0>(k[a+28>>2]|0)>>>0)b=Gl(a)|0|b;if(c)Uk(a);a=k[a+56>>2]|0}while((a|0)!=0);ob(37060)}while(0);return b|0}function el(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;if((k[b+76>>2]|0)>=0?(Tk(b)|0)!=0:0){if((i[b+75>>0]|0)!=(a|0)?(d=b+20|0,e=k[d>>2]|0,e>>>0<(k[b+16>>2]|0)>>>0):0){k[d>>2]=e+1;i[e>>0]=a;c=a&255}else c=Vk(b,a)|0;Uk(b)}else g=3;do if((g|0)==3){if((i[b+75>>0]|0)!=(a|0)?(f=b+20|0,c=k[f>>2]|0,c>>>0<(k[b+16>>2]|0)>>>0):0){k[f>>2]=c+1;i[c>>0]=a;c=a&255;break}c=Vk(b,a)|0}while(0);return c|0}function fl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=c+16|0;e=k[d>>2]|0;if(!e)if(!(bl(c)|0)){e=k[d>>2]|0;f=4}else d=0;else f=4;a:do if((f|0)==4){g=c+20|0;f=k[g>>2]|0;if((e-f|0)>>>0>>0){d=Qb[k[c+36>>2]&63](c,a,b)|0;break}b:do if((i[c+75>>0]|0)>-1){d=b;while(1){if(!d){e=f;d=0;break b}e=d+-1|0;if((i[a+e>>0]|0)==10)break;else d=e}if((Qb[k[c+36>>2]&63](c,a,d)|0)>>>0>>0)break a;b=b-d|0;a=a+d|0;e=k[g>>2]|0}else{e=f;d=0}while(0);vw(e|0,a|0,b|0)|0;k[g>>2]=(k[g>>2]|0)+b;d=d+b|0}while(0);return d|0}function gl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=ia(c,b)|0;if((k[d+76>>2]|0)>-1){f=(Tk(d)|0)==0;a=fl(a,e,d)|0;if(!f)Uk(d)}else a=fl(a,e,d)|0;if((a|0)!=(e|0))c=(a>>>0)/(b>>>0)|0;return c|0}function hl(a){a=a|0;var b=0,c=0,d=0;if((k[a+76>>2]|0)>=0?(Tk(a)|0)!=0:0){b=a+4|0;c=k[b>>2]|0;if(c>>>0<(k[a+8>>2]|0)>>>0){k[b>>2]=c+1;b=l[c>>0]|0}else b=cl(a)|0}else d=3;do if((d|0)==3){b=a+4|0;c=k[b>>2]|0;if(c>>>0<(k[a+8>>2]|0)>>>0){k[b>>2]=c+1;b=l[c>>0]|0;break}else{b=cl(a)|0;break}}while(0);return b|0}function il(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=r;r=r+16|0;f=e;k[f>>2]=d;d=ol(a,b,c,f)|0;r=e;return d|0}function jl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=r;r=r+16|0;e=d;k[e>>2]=c;c=pl(a,b,e)|0;r=d;return c|0}function kl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;do if((a|0)!=-1){if((k[b+76>>2]|0)>-1)e=Tk(b)|0;else e=0;if(!((k[b+8>>2]|0)==0?(al(b)|0)!=0:0))f=6;if((f|0)==6?(c=b+4|0,d=k[c>>2]|0,d>>>0>((k[b+44>>2]|0)+-8|0)>>>0):0){f=d+-1|0;k[c>>2]=f;i[f>>0]=a;k[b>>2]=k[b>>2]&-17;if(!e)break;Uk(b);break}if(e){Uk(b);a=-1}else a=-1}else a=-1;while(0);return a|0}function ll(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;h=r;r=r+16|0;d=h;e=Pl(240)|0;do if(e){k[d>>2]=k[c>>2];d=ol(e,240,b,d)|0;if(d>>>0<240){b=Sl(e,d+1|0)|0;k[a>>2]=(b|0)!=0?b:e;break}Ql(e);if((d|0)>=0?(g=d+1|0,f=Pl(g)|0,k[a>>2]=f,(f|0)!=0):0)d=ol(f,g,b,c)|0;else d=-1}else d=-1;while(0);r=h;return d|0}function ml(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;s=r;r=r+224|0;n=s+80|0;q=s+96|0;p=s;o=s+136|0;d=q;e=d+40|0;do{k[d>>2]=0;d=d+4|0}while((d|0)<(e|0));k[n>>2]=k[c>>2];if((Hl(0,b,n,p,q)|0)<0)c=-1;else{if((k[a+76>>2]|0)>-1)l=Tk(a)|0;else l=0;c=k[a>>2]|0;m=c&32;if((i[a+74>>0]|0)<1)k[a>>2]=c&-33;c=a+48|0;if(!(k[c>>2]|0)){e=a+44|0;f=k[e>>2]|0;k[e>>2]=o;g=a+28|0;k[g>>2]=o;h=a+20|0;k[h>>2]=o;k[c>>2]=80;j=a+16|0;k[j>>2]=o+80;d=Hl(a,b,n,p,q)|0;if(f){Qb[k[a+36>>2]&63](a,0,0)|0;d=(k[h>>2]|0)==0?-1:d;k[e>>2]=f;k[c>>2]=0;k[j>>2]=0;k[g>>2]=0;k[h>>2]=0}}else d=Hl(a,b,n,p,q)|0;c=k[a>>2]|0;k[a>>2]=c|m;if(l)Uk(a);c=(c&32|0)==0?d:-1}r=s;return c|0}function nl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,m=0.0,n=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,N=0,O=0,P=0,Q=0;P=r;r=r+304|0;G=P+16|0;I=P+8|0;H=P+33|0;J=P;y=P+32|0;if((k[a+76>>2]|0)>-1)O=Tk(a)|0;else O=0;d=i[b>>0]|0;a:do if(d<<24>>24){K=a+4|0;L=a+100|0;F=a+108|0;z=a+8|0;A=H+10|0;B=H+33|0;C=I+4|0;D=H+46|0;E=H+94|0;f=d;d=0;g=b;s=0;e=0;b=0;b:while(1){c:do if(!(kk(f&255)|0)){f=(i[g>>0]|0)==37;d:do if(f){n=g+1|0;h=i[n>>0]|0;e:do switch(h<<24>>24){case 37:break d;case 42:{x=0;h=g+2|0;break}default:{h=(h&255)+-48|0;if(h>>>0<10?(i[g+2>>0]|0)==36:0){k[G>>2]=k[c>>2];while(1){x=(k[G>>2]|0)+(4-1)&~(4-1);f=k[x>>2]|0;k[G>>2]=x+4;if(h>>>0>1)h=h+-1|0;else break}x=f;h=g+3|0;break e}h=(k[c>>2]|0)+(4-1)&~(4-1);x=k[h>>2]|0;k[c>>2]=h+4;h=n}}while(0);f=i[h>>0]|0;g=f&255;if((g+-48|0)>>>0<10){f=0;while(1){n=(f*10|0)+-48+g|0;h=h+1|0;f=i[h>>0]|0;g=f&255;if((g+-48|0)>>>0>=10)break;else f=n}}else n=0;if(f<<24>>24==109){h=h+1|0;q=i[h>>0]|0;f=(x|0)!=0&1;e=0;b=0}else{q=f;f=0}g=h+1|0;switch(q&255|0){case 104:{w=(i[g>>0]|0)==104;g=w?h+2|0:g;h=w?-2:-1;break}case 108:{w=(i[g>>0]|0)==108;g=w?h+2|0:g;h=w?3:1;break}case 106:{h=3;break}case 116:case 122:{h=1;break}case 76:{h=2;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{g=h;h=0;break}default:{N=152;break b}}q=l[g>>0]|0;t=(q&47|0)==3;q=t?q|32:q;t=t?1:h;switch(q|0){case 99:{w=s;v=(n|0)<1?1:n;break}case 91:{w=s;v=n;break}case 110:{if(!x){h=s;break c}switch(t|0){case -2:{i[x>>0]=s;h=s;break c}case -1:{j[x>>1]=s;h=s;break c}case 0:{k[x>>2]=s;h=s;break c}case 1:{k[x>>2]=s;h=s;break c}case 3:{h=x;k[h>>2]=s;k[h+4>>2]=((s|0)<0)<<31>>31;h=s;break c}default:{h=s;break c}}}default:{qk(a,0);do{h=k[K>>2]|0;if(h>>>0<(k[L>>2]|0)>>>0){k[K>>2]=h+1;h=l[h>>0]|0}else h=rk(a)|0}while((kk(h)|0)!=0);h=k[K>>2]|0;if(k[L>>2]|0){h=h+-1|0;k[K>>2]=h}w=(k[F>>2]|0)+s+h-(k[z>>2]|0)|0;v=n}}qk(a,v);h=k[K>>2]|0;n=k[L>>2]|0;if(h>>>0>>0)k[K>>2]=h+1;else{if((rk(a)|0)<0){N=152;break b}n=k[L>>2]|0}if(n)k[K>>2]=(k[K>>2]|0)+-1;f:do switch(q|0){case 91:case 99:case 115:{u=(q|0)==99;g:do if((q&239|0)==99){sw(H|0,-1,257)|0;i[H>>0]=0;if((q|0)==115){i[B>>0]=0;i[A>>0]=0;i[A+1>>0]=0;i[A+2>>0]=0;i[A+3>>0]=0;i[A+4>>0]=0}}else{Q=g+1|0;s=(i[Q>>0]|0)==94;h=s&1;q=s?Q:g;g=s?g+2|0:Q;sw(H|0,s&1|0,257)|0;i[H>>0]=0;switch(i[g>>0]|0){case 45:{s=(h^1)&255;i[D>>0]=s;g=q+2|0;break}case 93:{s=(h^1)&255;i[E>>0]=s;g=q+2|0;break}default:s=(h^1)&255}while(1){h=i[g>>0]|0;h:do switch(h<<24>>24){case 0:{N=152;break b}case 93:break g;case 45:{q=g+1|0;h=i[q>>0]|0;switch(h<<24>>24){case 93:case 0:{h=45;break h}default:{}}g=i[g+-1>>0]|0;if((g&255)<(h&255)){g=g&255;do{g=g+1|0;i[H+g>>0]=s;h=i[q>>0]|0}while((g|0)<(h&255|0));g=q}else g=q;break}default:{}}while(0);i[H+((h&255)+1)>>0]=s;g=g+1|0}}while(0);q=u?v+1|0:31;s=(t|0)==1;t=(f|0)!=0;i:do if(s){if(t){b=Pl(q<<2)|0;if(!b){e=0;N=152;break b}}else b=x;k[I>>2]=0;k[C>>2]=0;e=0;j:while(1){n=(b|0)==0;do{k:while(1){h=k[K>>2]|0;if(h>>>0<(k[L>>2]|0)>>>0){k[K>>2]=h+1;h=l[h>>0]|0}else h=rk(a)|0;if(!(i[H+(h+1)>>0]|0))break j;i[y>>0]=h;switch(Kk(J,y,1,I)|0){case -1:{e=0;N=152;break b}case -2:break;default:break k}}if(!n){k[b+(e<<2)>>2]=k[J>>2];e=e+1|0}}while(!(t&(e|0)==(q|0)));e=q<<1|1;h=Sl(b,e<<2)|0;if(!h){e=0;N=152;break b}Q=q;q=e;b=h;e=Q}if(!(Lk(I)|0)){e=0;N=152;break b}else{n=e;e=0}}else{if(t){e=Pl(q)|0;if(!e){e=0;b=0;N=152;break b}else h=0;while(1){do{b=k[K>>2]|0;if(b>>>0<(k[L>>2]|0)>>>0){k[K>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if(!(i[H+(b+1)>>0]|0)){n=h;b=0;break i}i[e+h>>0]=b;h=h+1|0}while((h|0)!=(q|0));b=q<<1|1;h=Sl(e,b)|0;if(!h){b=0;N=152;break b}else{Q=q;q=b;e=h;h=Q}}}if(!x){e=n;while(1){b=k[K>>2]|0;if(b>>>0>>0){k[K>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if(!(i[H+(b+1)>>0]|0)){n=0;e=0;b=0;break i}e=k[L>>2]|0}}else{e=0;while(1){b=k[K>>2]|0;if(b>>>0>>0){k[K>>2]=b+1;b=l[b>>0]|0}else b=rk(a)|0;if(!(i[H+(b+1)>>0]|0)){n=e;e=x;b=0;break i}i[x+e>>0]=b;n=k[L>>2]|0;e=e+1|0}}}while(0);h=k[K>>2]|0;if(k[L>>2]|0){h=h+-1|0;k[K>>2]=h}h=h-(k[z>>2]|0)+(k[F>>2]|0)|0;if(!h)break b;if(!((h|0)==(v|0)|u^1))break b;do if(t)if(s){k[x>>2]=b;break}else{k[x>>2]=e;break}while(0);if(!u){if(b)k[b+(n<<2)>>2]=0;if(!e){e=0;break f}i[e+n>>0]=0}break}case 120:case 88:case 112:{h=16;N=134;break}case 111:{h=8;N=134;break}case 117:case 100:{h=10;N=134;break}case 105:{h=0;N=134;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{m=+ok(a,t,0);if((k[F>>2]|0)==((k[z>>2]|0)-(k[K>>2]|0)|0))break b;if(x)switch(t|0){case 0:{o[x>>2]=m;break f}case 1:{p[x>>3]=m;break f}case 2:{p[x>>3]=m;break f}default:break f}break}default:{}}while(0);l:do if((N|0)==134){N=0;h=pk(a,h,0,-1,-1)|0;if((k[F>>2]|0)==((k[z>>2]|0)-(k[K>>2]|0)|0))break b;if((x|0)!=0&(q|0)==112){k[x>>2]=h;break}if(x)switch(t|0){case -2:{i[x>>0]=h;break l}case -1:{j[x>>1]=h;break l}case 0:{k[x>>2]=h;break l}case 1:{k[x>>2]=h;break l}case 3:{Q=x;k[Q>>2]=h;k[Q+4>>2]=M;break l}default:break l}}while(0);d=((x|0)!=0&1)+d|0;h=(k[F>>2]|0)+w+(k[K>>2]|0)-(k[z>>2]|0)|0;break c}while(0);g=g+(f&1)|0;qk(a,0);f=k[K>>2]|0;if(f>>>0<(k[L>>2]|0)>>>0){k[K>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0;if((f|0)!=(l[g>>0]|0)){N=21;break b}h=s+1|0}else{while(1){f=g+1|0;if(!(kk(l[f>>0]|0)|0))break;else g=f}qk(a,0);do{f=k[K>>2]|0;if(f>>>0<(k[L>>2]|0)>>>0){k[K>>2]=f+1;f=l[f>>0]|0}else f=rk(a)|0}while((kk(f)|0)!=0);f=k[K>>2]|0;if(k[L>>2]|0){f=f+-1|0;k[K>>2]=f}h=(k[F>>2]|0)+s+f-(k[z>>2]|0)|0}while(0);g=g+1|0;f=i[g>>0]|0;if(!(f<<24>>24))break a;else s=h}if((N|0)==21){if(k[L>>2]|0)k[K>>2]=(k[K>>2]|0)+-1;if((d|0)!=0|(f|0)>-1)break;else{d=0;N=153}}else if((N|0)==152)if(!d){d=f;N=153}if((N|0)==153){f=d;d=-1}if(f){Ql(e);Ql(b)}}else d=0;while(0);if(O)Uk(a);r=P;return d|0}function ol(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,l=0,m=0;m=r;r=r+128|0;e=m+112|0;l=m;f=l;g=37352;h=f+112|0;do{k[f>>2]=k[g>>2];f=f+4|0;g=g+4|0}while((f|0)<(h|0));if((b+-1|0)>>>0>2147483646)if(!b){b=1;j=4}else{b=mk()|0;k[b>>2]=75;b=-1}else{e=a;j=4}if((j|0)==4){j=-2-e|0;j=b>>>0>j>>>0?j:b;k[l+48>>2]=j;a=l+20|0;k[a>>2]=e;k[l+44>>2]=e;b=e+j|0;e=l+16|0;k[e>>2]=b;k[l+28>>2]=b;b=ml(l,c,d)|0;if(j){c=k[a>>2]|0;i[c+(((c|0)==(k[e>>2]|0))<<31>>31)>>0]=0}}r=m;return b|0}function pl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=r;r=r+112|0;d=f;e=d;g=e+112|0;do{k[e>>2]=0;e=e+4|0}while((e|0)<(g|0));k[d+32>>2]=29;k[d+44>>2]=a;k[d+76>>2]=-1;k[d+84>>2]=a;g=nl(d,b,c)|0;r=f;return g|0}function ql(a,b,c){a=a|0;b=b|0;c=c|0;return +(+Jl(a,b,2))}function rl(a,b,c){a=a|0;b=b|0;c=c|0;a=Kl(a,b,c,-1,-1)|0;return a|0}function sl(a,b,c){a=a|0;b=b|0;c=c|0;a=Kl(a,b,c,0,-2147483648)|0;return a|0}function tl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;f=b&255;d=(c|0)!=0;a:do if(d&(a&3|0)!=0){e=b&255;while(1){if((i[a>>0]|0)==e<<24>>24){g=6;break a}a=a+1|0;c=c+-1|0;d=(c|0)!=0;if(!(d&(a&3|0)!=0)){g=5;break}}}else g=5;while(0);if((g|0)==5)if(d)g=6;else c=0;b:do if((g|0)==6){e=b&255;if((i[a>>0]|0)!=e<<24>>24){d=ia(f,16843009)|0;c:do if(c>>>0>3)while(1){f=k[a>>2]^d;if((f&-2139062144^-2139062144)&f+-16843009)break;a=a+4|0;c=c+-4|0;if(c>>>0<=3){g=11;break c}}else g=11;while(0);if((g|0)==11)if(!c){c=0;break}while(1){if((i[a>>0]|0)==e<<24>>24)break b;a=a+1|0;c=c+-1|0;if(!c){c=0;break}}}}while(0);return ((c|0)!=0?a:0)|0}function ul(a,b){a=a|0;b=b|0;var c=0,d=0;c=b;a:do if(!((c^a)&3)){if(c&3)do{c=i[b>>0]|0;i[a>>0]=c;if(!(c<<24>>24))break a;b=b+1|0;a=a+1|0}while((b&3|0)!=0);c=k[b>>2]|0;if(!((c&-2139062144^-2139062144)&c+-16843009)){d=a;while(1){b=b+4|0;a=d+4|0;k[d>>2]=c;c=k[b>>2]|0;if((c&-2139062144^-2139062144)&c+-16843009)break;else d=a}}d=8}else d=8;while(0);if((d|0)==8){d=i[b>>0]|0;i[a>>0]=d;if(d<<24>>24)do{b=b+1|0;a=a+1|0;d=i[b>>0]|0;i[a>>0]=d}while(d<<24>>24!=0)}return a|0}function vl(a,b){a=a|0;b=b|0;var c=0,d=0;d=i[a>>0]|0;c=i[b>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=c<<24>>24)b=d;else{do{a=a+1|0;b=b+1|0;d=i[a>>0]|0;c=i[b>>0]|0}while(!(d<<24>>24==0?1:d<<24>>24!=c<<24>>24));b=d}return (b&255)-(c&255)|0}function wl(a,b){a=a|0;b=b|0;ul(a,b)|0;return a|0}function xl(a){a=a|0;var b=0,c=0,d=0;d=a;a:do if(!(d&3))c=4;else{b=a;a=d;while(1){if(!(i[b>>0]|0))break a;b=b+1|0;a=b;if(!(a&3)){a=b;c=4;break}}}while(0);if((c|0)==4){while(1){b=k[a>>2]|0;if(!((b&-2139062144^-2139062144)&b+-16843009))a=a+4|0;else break}if((b&255)<<24>>24)do a=a+1|0;while((i[a>>0]|0)!=0)}return a-d|0}function yl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if(!c)b=0;else{d=i[a>>0]|0;a:do if(!(d<<24>>24))d=0;else while(1){c=c+-1|0;e=i[b>>0]|0;if(!(d<<24>>24==e<<24>>24&((c|0)!=0&e<<24>>24!=0)))break a;a=a+1|0;b=b+1|0;d=i[a>>0]|0;if(!(d<<24>>24)){d=0;break}}while(0);b=(d&255)-(l[b>>0]|0)|0}return b|0}function zl(a){a=a|0;var b=0;b=a;while(1)if(!(k[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function Al(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if(c){d=a;while(1){c=c+-1|0;k[d>>2]=k[b>>2];if(!c)break;else{b=b+4|0;d=d+4|0}}}return a|0}function Bl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=(c|0)==0;if(a-b>>2>>>0>>0){if(!d)do{c=c+-1|0;k[a+(c<<2)>>2]=k[b+(c<<2)>>2]}while((c|0)!=0)}else if(!d){d=b;b=a;while(1){c=c+-1|0;k[b>>2]=k[d>>2];if(!c)break;else{d=d+4|0;b=b+4|0}}}return a|0}function Cl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if(c){d=a;while(1){c=c+-1|0;k[d>>2]=b;if(!c)break;else d=d+4|0}}return a|0}function Dl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;g=a+4|0;c=k[g>>2]|0;h=a+100|0;if(c>>>0<(k[h>>2]|0)>>>0){k[g>>2]=c+1;c=l[c>>0]|0}else c=rk(a)|0;switch(c|0){case 43:case 45:{d=(c|0)==45&1;c=k[g>>2]|0;if(c>>>0<(k[h>>2]|0)>>>0){k[g>>2]=c+1;c=l[c>>0]|0}else c=rk(a)|0;if((b|0)!=0&(c+-48|0)>>>0>9?(k[h>>2]|0)!=0:0){k[g>>2]=(k[g>>2]|0)+-1;f=d}else f=d;break}default:f=0}if((c+-48|0)>>>0>9)if(!(k[h>>2]|0)){d=-2147483648;c=0}else{k[g>>2]=(k[g>>2]|0)+-1;d=-2147483648;c=0}else{d=0;do{d=c+-48+(d*10|0)|0;c=k[g>>2]|0;if(c>>>0<(k[h>>2]|0)>>>0){k[g>>2]=c+1;c=l[c>>0]|0}else c=rk(a)|0}while((c+-48|0)>>>0<10&(d|0)<214748364);b=((d|0)<0)<<31>>31;if((c+-48|0)>>>0<10){do{b=Dw(d|0,b|0,10,0)|0;d=M;c=tw(c|0,((c|0)<0)<<31>>31|0,-48,-1)|0;d=tw(c|0,M|0,b|0,d|0)|0;b=M;c=k[g>>2]|0;if(c>>>0<(k[h>>2]|0)>>>0){k[g>>2]=c+1;c=l[c>>0]|0}else c=rk(a)|0}while((c+-48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&d>>>0<2061584302));e=d}else e=d;if((c+-48|0)>>>0<10)do{c=k[g>>2]|0;if(c>>>0<(k[h>>2]|0)>>>0){k[g>>2]=c+1;c=l[c>>0]|0}else c=rk(a)|0}while((c+-48|0)>>>0<10);if(k[h>>2]|0)k[g>>2]=(k[g>>2]|0)+-1;a=(f|0)!=0;c=rw(0,0,e|0,b|0)|0;d=a?M:b;c=a?c:e}M=d;return c|0}function El(a){a=a|0;if(!(k[a+68>>2]|0))Uk(a);return}function Fl(a){a=a|0;if(!(k[a+68>>2]|0))Uk(a);return}function Gl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;b=a+20|0;f=a+28|0;if((k[b>>2]|0)>>>0>(k[f>>2]|0)>>>0?(Qb[k[a+36>>2]&63](a,0,0)|0,(k[b>>2]|0)==0):0)b=-1;else{g=a+4|0;c=k[g>>2]|0;d=a+8|0;e=k[d>>2]|0;if(c>>>0>>0)Qb[k[a+40>>2]&63](a,c-e|0,1)|0;k[a+16>>2]=0;k[f>>2]=0;k[b>>2]=0;k[d>>2]=0;k[g>>2]=0;b=0}return b|0} - -// EMSCRIPTEN_END_FUNCS -var Ib=[cx,_q,cr,Yr,as,fs,hs,Hu,Su,cx,cx,cx,cx,cx,cx,cx];var Jb=[dx,si,gi,Wh,Kh,yh,mh,ah,Lg,Wj,Vj,Sj,dx,dx,dx,dx];var Kb=[ex,ls,rs,ex];var Lb=[fx,oi,pi,ci,di,Sh,Th,Gh,Hh,uh,vh,ih,jh,Yg,Zg,Hg,Ig,ug,vg,ig,jg,Yf,Zf,Mf,Nf,Af,Bf,Ie,Je,ve,we,Dc,Ec,Zd,be,_d,mo,oo,no,po,ud,vd,_i,wd,nd,od,Sc,Tc,_c,$c,fd,gd,xd,yd,Ed,Fd,Ld,Md,Sd,Td,te,ue,Re,Se,Ye,Ze,df,ef,lf,mf,Wg,Xg,Nm,Ai,Ki,Li,$i,aj,pj,qj,wj,xj,Bj,Cj,Ej,Hj,Fj,Gj,Ij,Jj,Mn,bm,hm,xn,mm,sm,Lm,Mm,yn,Nn,$n,bo,ao,co,go,io,ho,jo,uo,wo,vo,xo,Eo,Fo,pn,Go,Ho,Io,Ko,Us,Oo,Po,To,Uo,gp,hp,Ap,Bp,Pp,Qp,aq,bq,zq,Aq,Xq,Zq,ar,br,er,fr,pr,qr,Ar,Br,Lr,Mr,Wr,Xr,ds,es,js,ks,ps,qs,vs,ws,As,Bs,Is,Js,kt,lt,Gu,Dt,du,eu,fu,gu,Jo,Ts,Ws,ut,Lt,Tt,$t,au,bj,Si,jj,Cc,zn,fo,ie,Og,ek,El,Fl,Wl,wk,Zr,$r,Vs,Qv,Xv,Yv,Zv,_v,$v,aw,Sm,en,Ql,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx,fx];var Mb=[gx,ri,fi,Vh,Jh,xh,lh,$g,Kg,wg,kg,_f,Of,Cf,Ke,xe,Fc,An,Mi,Pi,cm,gm,nm,rm,Pn,ir,jr,kr,lr,nr,or,tr,ur,vr,wr,yr,zr,Er,Fr,Gr,Hr,Jr,Kr,Pr,Qr,Rr,Sr,Ur,Vr,zs,Es,lu,nu,pu,mu,ou,qu,uc,cj,Qi,Ri,Ti,un,Mc,Oc,qo,on,_m,he,Be,tf,Gf,Sf,cg,og,Ag,Ng,ch,oh,Ah,Mh,Yh,ii,ui,Ii,hj,Cm,Am,sn,yo,Bm,Ym,jn,hn,kv,lv,mv,nv,ov,pv,Ct,qv,rv,sv,tv,uv,vv,wv,xv,yv,zv,Av,Bv,Cv,Dv,Ev,Fv,Gv,Hv,Iv,Jv,Kv,Lv,Mv,Ov,gw,gx,gx];var Nb=[hx,Vo,Wo,Xo,Yo,Zo,_o,$o,ap,bp,cp,dp,ip,jp,kp,lp,mp,np,op,pp,qp,rp,sp,Hp,Jp,Up,Wp,dq,eq,fq,hq,jq,Cq,Dq,Eq,Gq,Iq,os,us,md,cv,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx,hx];var Ob=[ix,En,Fn,rd,In,Bi,rj,yj,Dj,Wk,dm,Un,Wn,Xn,Tn,im,jm,om,Hn,tm,um,Ao,cq,su,uu,wu,Cu,Eu,yu,Au,Bq,tu,vu,xu,Du,Fu,zu,Bu,gr,hr,mr,rr,sr,xr,Cr,Dr,Ir,Nr,Or,Tr,Ht,It,Kt,hu,ju,iu,ku,yt,zt,Bt,Pt,Qt,St,Xt,Yt,_t,Ei,lj,tn,Vi,eo,ko,jx,kx,lx,Ak,zl,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix];var Pb=[mx,_r,gs,mx];var Qb=[nx,Bn,Gn,Kn,Em,Fm,Kj,Ll,Zk,Yk,Xk,_k,Qn,Vn,em,Zn,pm,No,So,xs,Cs,nt,pt,st,Xs,ct,ft,it,Nc,Il,$m,zk,hv,jv,Pk,Ok,Jk,ll,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx,nx];var Rb=[ox,ns,ts,ox];var Sb=[px,pd,Zj,Yj,Xj,Rn,Cn,ys,Ds,px,px,px,px,px,px,px];var Tb=[qx,Gp,Mp,Tp,Yp,qx,qx,qx];var Ub=[rx,bs,is,ms,ss,rx,rx,rx];var Vb=[sx,qi,ei,Uh,Ih,wh,kh,_g,Jg,yg,mg,ag,Qf,Ef,Me,ze,Hc,sd,td,Yn,fm,km,_n,Jn,qm,vm,Ln,mt,ot,qt,at,dt,gt,dj,yc,Ac,so,Ss,to,yk,xk,Um,fn,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx,sx];var Wb=[tx,Lo,Qo,Cp,Dp,Ip,Op,Rp,Sp,Vp,_p,tt,Gt,Jt,jt,xt,At,Ot,Rt,Wt,Zt,Qk,Mk,tx,tx,tx,tx,tx,tx,tx,tx,tx];var Xb=[ux,jw,iw,hw];var Yb=[vx,vc,kj,fp,Ls,Ms,Ns,hk,jk,ik,vx,vx,vx,vx,vx,vx];var Zb=[wx,xg,lg,$f,Pf,Df,Le,ye,Gc,rt,Zs,_s,$s,ht,Di,Ji,Ru,bv,Nk,uk,Kk,pw,ow,nw,mw,lw,kw,wx,wx,wx,wx,wx];var _b=[xx,Dm,Ci,Bo,ej,Qm,yx,Km,Wm,Ui,Hm,Do,fv,gv,iv,cn];var $b=[zx,Ax,bk,Bx,ck,Cx,ak,zx];var ac=[Dx,lq,Kq,Et,Ft,vt,wt,Mt,Nt,Ut,Vt,Dx,Dx,Dx,Dx,Dx];var bc=[Ex,Kp,Np,Xp,Zp,Ex,Ex,Ex];var cc=[Fx,ce,de,$d,ae,qd,Uc,Vc,ad,bd,hd,id,zd,Ad,Gd,Hd,Nd,Od,Ud,Vd,Te,Ue,_e,$e,ff,gf,nf,of,Mj,Nj,Pj,Sn,Dn,Mo,Ro,nc,Jm,Ic,Jc,Kc,Lc,Pc,Qc,Rc,Ne,Oe,Pe,Qe,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx,Fx];return{_jpegls_encode:gj,___cxa_can_catch:_j,_free:Ql,_jpegls_decode:fj,___cxa_is_pointer_type:$j,_i64Add:tw,_memmove:xw,_i64Subtract:rw,_memset:sw,_malloc:Pl,_memcpy:vw,_bitshift64Lshr:uw,_bitshift64Shl:ww,__GLOBAL__I_000101:Xl,__GLOBAL__sub_I_jpegls_cpp:Bc,__GLOBAL__sub_I_iostream_cpp:Yl,runPostSets:qw,_emscripten_replace_memory:Hb,stackAlloc:dc,stackSave:ec,stackRestore:fc,establishStackSpace:gc,setThrew:hc,setTempRet0:kc,getTempRet0:lc,dynCall_iiiiiiii:Hw,dynCall_viiiii:Iw,dynCall_iiiiiid:Jw,dynCall_vi:Kw,dynCall_vii:Lw,dynCall_iiiiiii:Mw,dynCall_ii:Nw,dynCall_iiiiiiiiiiii:Ow,dynCall_iiii:Pw,dynCall_viiiiiiiiiiiiiii:Qw,dynCall_viiiiii:Rw,dynCall_viiiiiii:Sw,dynCall_viiiiiiiiii:Tw,dynCall_iii:Uw,dynCall_iiiiii:Vw,dynCall_diii:Ww,dynCall_i:Xw,dynCall_iiiii:Yw,dynCall_viii:Zw,dynCall_v:_w,dynCall_iiiiiiiii:$w,dynCall_iiiiid:ax,dynCall_viiii:bx}}) - - -// EMSCRIPTEN_END_ASM -(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var _jpegls_encode=Module["_jpegls_encode"]=asm["_jpegls_encode"];var ___cxa_can_catch=Module["___cxa_can_catch"]=asm["___cxa_can_catch"];var _free=Module["_free"]=asm["_free"];var _jpegls_decode=Module["_jpegls_decode"]=asm["_jpegls_decode"];var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=asm["___cxa_is_pointer_type"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _memmove=Module["_memmove"]=asm["_memmove"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _memset=Module["_memset"]=asm["_memset"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _emscripten_replace_memory=Module["_emscripten_replace_memory"]=asm["_emscripten_replace_memory"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var __GLOBAL__sub_I_iostream_cpp=Module["__GLOBAL__sub_I_iostream_cpp"]=asm["__GLOBAL__sub_I_iostream_cpp"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var __GLOBAL__sub_I_jpegls_cpp=Module["__GLOBAL__sub_I_jpegls_cpp"]=asm["__GLOBAL__sub_I_jpegls_cpp"];var __GLOBAL__I_000101=Module["__GLOBAL__I_000101"]=asm["__GLOBAL__I_000101"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=asm["dynCall_iiiiiiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_iiiiiid=Module["dynCall_iiiiiid"]=asm["dynCall_iiiiiid"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=asm["dynCall_iiiiiii"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_iiiiiiiiiiii=Module["dynCall_iiiiiiiiiiii"]=asm["dynCall_iiiiiiiiiiii"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_viiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiii"]=asm["dynCall_viiiiiiiiiiiiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=asm["dynCall_viiiiiii"];var dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=asm["dynCall_viiiiiiiiii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_iiiiii=Module["dynCall_iiiiii"]=asm["dynCall_iiiiii"];var dynCall_diii=Module["dynCall_diii"]=asm["dynCall_diii"];var dynCall_i=Module["dynCall_i"]=asm["dynCall_i"];var dynCall_iiiii=Module["dynCall_iiiii"]=asm["dynCall_iiiii"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=asm["dynCall_iiiiiiiii"];var dynCall_iiiiid=Module["dynCall_iiiiid"]=asm["dynCall_iiiiid"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];Runtime.stackAlloc=asm["stackAlloc"];Runtime.stackSave=asm["stackSave"];Runtime.stackRestore=asm["stackRestore"];Runtime.establishStackSpace=asm["establishStackSpace"];Runtime.setTempRet0=asm["setTempRet0"];Runtime.getTempRet0=asm["getTempRet0"];function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["stdout"]["once"]("drain",(function(){process["exit"](status)}));console.log(" ");setTimeout((function(){process["exit"](status)}),500)}else if(ENVIRONMENT_IS_SHELL&&typeof quit==="function"){quit(status)}throw new ExitStatus(status)}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run() - - - - - - return Module; -}; -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = CharLS; -} diff --git a/lib/jpeg-baseline.js b/lib/jpeg-baseline.js index 5229620..2b8803f 100644 --- a/lib/jpeg-baseline.js +++ b/lib/jpeg-baseline.js @@ -22,995 +22,1007 @@ // in PostScript Level 2, Technical Note #5116 // (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf) -var ColorSpace = {Unkown: 0, Grayscale: 1, AdobeRGB: 2, RGB: 3, CYMK: 4}; -var JpegImage = (function jpegImage() { - "use strict"; - var dctZigZag = new Int32Array([ - 0, - 1, 8, - 16, 9, 2, - 3, 10, 17, 24, - 32, 25, 18, 11, 4, - 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, - 7, 14, 21, 28, 35, 42, 49, 56, - 57, 50, 43, 36, 29, 22, 15, - 23, 30, 37, 44, 51, 58, - 59, 52, 45, 38, 31, - 39, 46, 53, 60, - 61, 54, 47, - 55, 62, - 63 - ]); - - var dctCos1 = 4017; // cos(pi/16) - var dctSin1 = 799; // sin(pi/16) - var dctCos3 = 3406; // cos(3*pi/16) - var dctSin3 = 2276; // sin(3*pi/16) - var dctCos6 = 1567; // cos(6*pi/16) - var dctSin6 = 3784; // sin(6*pi/16) - var dctSqrt2 = 5793; // sqrt(2) - var dctSqrt1d2 = 2896; // sqrt(2) / 2 - - function constructor() { +const ColorSpace = { Unkown: 0, Grayscale: 1, AdobeRGB: 2, RGB: 3, CYMK: 4 } +export const JpegImage = (function jpegImage() { + 'use strict' + const dctZigZag = new Int32Array([ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, + 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, + 47, 55, 62, 63 + ]) + + const dctCos1 = 4017 // cos(pi/16) + const dctSin1 = 799 // sin(pi/16) + const dctCos3 = 3406 // cos(3*pi/16) + const dctSin3 = 2276 // sin(3*pi/16) + const dctCos6 = 1567 // cos(6*pi/16) + const dctSin6 = 3784 // sin(6*pi/16) + const dctSqrt2 = 5793 // sqrt(2) + const dctSqrt1d2 = 2896 // sqrt(2) / 2 + + function constructor() {} + + function buildHuffmanTable(codeLengths, values) { + let k = 0 + const code = [] + let i + let j + let length = 16 + while (length > 0 && !codeLengths[length - 1]) length-- + code.push({ children: [], index: 0 }) + let p = code[0] + let q + for (i = 0; i < length; i++) { + for (j = 0; j < codeLengths[i]; j++) { + p = code.pop() + p.children[p.index] = values[k] + while (p.index > 0) { + p = code.pop() + } + p.index++ + code.push(p) + while (code.length <= i) { + code.push((q = { children: [], index: 0 })) + p.children[p.index] = q.children + p = q + } + k++ + } + if (i + 1 < length) { + // p here points to last code + code.push((q = { children: [], index: 0 })) + p.children[p.index] = q.children + p = q + } } - - function buildHuffmanTable(codeLengths, values) { - var k = 0, code = [], i, j, length = 16; - while (length > 0 && !codeLengths[length - 1]) - length--; - code.push({children: [], index: 0}); - var p = code[0], q; - for (i = 0; i < length; i++) { - for (j = 0; j < codeLengths[i]; j++) { - p = code.pop(); - p.children[p.index] = values[k]; - while (p.index > 0) { - p = code.pop(); - } - p.index++; - code.push(p); - while (code.length <= i) { - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - k++; - } - if (i + 1 < length) { - // p here points to last code - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } + return code[0].children + } + + function getBlockBufferOffset(component, row, col) { + return 64 * ((component.blocksPerLine + 1) * row + col) + } + + function decodeScan( + data, + offset, + frame, + components, + resetInterval, + spectralStart, + spectralEnd, + successivePrev, + successive + ) { + const mcusPerLine = frame.mcusPerLine + const progressive = frame.progressive + + const startOffset = offset + let bitsData = 0 + let bitsCount = 0 + + function readBit() { + if (bitsCount > 0) { + bitsCount-- + return (bitsData >> bitsCount) & 1 + } + bitsData = data[offset++] + if (bitsData === 0xff) { + const nextByte = data[offset++] + if (nextByte) { + throw new Error('unexpected marker: ' + ((bitsData << 8) | nextByte).toString(16)) } - return code[0].children; + // unstuff 0 + } + bitsCount = 7 + return bitsData >>> 7 } - function getBlockBufferOffset(component, row, col) { - return 64 * ((component.blocksPerLine + 1) * row + col); + function decodeHuffman(tree) { + let node = tree + let bit + while ((bit = readBit()) !== null) { + node = node[bit] + if (typeof node === 'number') return node + if (typeof node !== 'object') throw new Error('invalid huffman sequence') + } + return null } - function decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successivePrev, successive) { - var precision = frame.precision; - var samplesPerLine = frame.samplesPerLine; - var scanLines = frame.scanLines; - var mcusPerLine = frame.mcusPerLine; - var progressive = frame.progressive; - var maxH = frame.maxH, maxV = frame.maxV; - - var startOffset = offset, bitsData = 0, bitsCount = 0; - - function readBit() { - if (bitsCount > 0) { - bitsCount--; - return (bitsData >> bitsCount) & 1; - } - bitsData = data[offset++]; - if (bitsData == 0xFF) { - var nextByte = data[offset++]; - if (nextByte) { - throw "unexpected marker: " + ((bitsData << 8) | nextByte).toString(16); - } - // unstuff 0 - } - bitsCount = 7; - return bitsData >>> 7; - } - - function decodeHuffman(tree) { - var node = tree; - var bit; - while ((bit = readBit()) !== null) { - node = node[bit]; - if (typeof node === 'number') - return node; - if (typeof node !== 'object') - throw "invalid huffman sequence"; - } - return null; - } - - function receive(length) { - var n = 0; - while (length > 0) { - var bit = readBit(); - if (bit === null) - return; - n = (n << 1) | bit; - length--; - } - return n; - } + function receive(length) { + let n = 0 + while (length > 0) { + const bit = readBit() + if (bit === null) return + n = (n << 1) | bit + length-- + } + return n + } - function receiveAndExtend(length) { - var n = receive(length); - if (n >= 1 << (length - 1)) - return n; - return n + (-1 << length) + 1; - } + function receiveAndExtend(length) { + const n = receive(length) + if (n >= 1 << (length - 1)) return n + return n + (-1 << length) + 1 + } - function decodeBaseline(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : receiveAndExtend(t); - component.blockData[offset] = (component.pred += diff); - var k = 1; - while (k < 64) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) - break; - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s); - k++; - } + function decodeBaseline(component, offset) { + const t = decodeHuffman(component.huffmanTableDC) + const diff = t === 0 ? 0 : receiveAndExtend(t) + component.blockData[offset] = component.pred += diff + let k = 1 + while (k < 64) { + const rs = decodeHuffman(component.huffmanTableAC) + const s = rs & 15 + const r = rs >> 4 + if (s === 0) { + if (r < 15) break + k += 16 + continue } + k += r + const z = dctZigZag[k] + component.blockData[offset + z] = receiveAndExtend(s) + k++ + } + } - function decodeDCFirst(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive); - component.blockData[offset] = (component.pred += diff); - } + function decodeDCFirst(component, offset) { + const t = decodeHuffman(component.huffmanTableDC) + const diff = t === 0 ? 0 : receiveAndExtend(t) << successive + component.blockData[offset] = component.pred += diff + } - function decodeDCSuccessive(component, offset) { - component.blockData[offset] |= readBit() << successive; - } + function decodeDCSuccessive(component, offset) { + component.blockData[offset] |= readBit() << successive + } - var eobrun = 0; - function decodeACFirst(component, offset) { - if (eobrun > 0) { - eobrun--; - return; - } - var k = spectralStart, e = spectralEnd; - while (k <= e) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r) - 1; - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive); - k++; - } + let eobrun = 0 + function decodeACFirst(component, offset) { + if (eobrun > 0) { + eobrun-- + return + } + let k = spectralStart + const e = spectralEnd + while (k <= e) { + const rs = decodeHuffman(component.huffmanTableAC) + const s = rs & 15 + const r = rs >> 4 + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r) - 1 + break + } + k += 16 + continue } + k += r + const z = dctZigZag[k] + component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive) + k++ + } + } - var successiveACState = 0, successiveACNextValue; - function decodeACSuccessive(component, offset) { - var k = spectralStart, e = spectralEnd, r = 0; - while (k <= e) { - var z = dctZigZag[k]; - switch (successiveACState) { - case 0: // initial state - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15; - r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r); - successiveACState = 4; - } else { - r = 16; - successiveACState = 1; - } - } else { - if (s !== 1) - throw "invalid ACn encoding"; - successiveACNextValue = receiveAndExtend(s); - successiveACState = r ? 2 : 3; - } - continue; - case 1: // skipping r zero items - case 2: - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - r--; - if (r === 0) - successiveACState = successiveACState == 2 ? 3 : 0; - } - break; - case 3: // set value for a zero item - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - component.blockData[offset + z] = successiveACNextValue << successive; - successiveACState = 0; - } - break; - case 4: // eob - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } - break; + let successiveACState = 0 + let successiveACNextValue + function decodeACSuccessive(component, offset) { + let k = spectralStart + const e = spectralEnd + let r = 0 + while (k <= e) { + const z = dctZigZag[k] + switch (successiveACState) { + case 0: // initial state + { + const rs = decodeHuffman(component.huffmanTableAC) + const s = rs & 15 + r = rs >> 4 + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r) + successiveACState = 4 + } else { + r = 16 + successiveACState = 1 } - k++; - } - if (successiveACState === 4) { - eobrun--; - if (eobrun === 0) - successiveACState = 0; - } - } - - function decodeMcu(component, decode, mcu, row, col) { - var mcuRow = (mcu / mcusPerLine) | 0; - var mcuCol = mcu % mcusPerLine; - var blockRow = mcuRow * component.v + row; - var blockCol = mcuCol * component.h + col; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - function decodeBlock(component, decode, mcu) { - var blockRow = (mcu / component.blocksPerLine) | 0; - var blockCol = mcu % component.blocksPerLine; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - var componentsLength = components.length; - var component, i, j, k, n; - var decodeFn; - if (progressive) { - if (spectralStart === 0) - decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; - else - decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; - } else { - decodeFn = decodeBaseline; - } - - var mcu = 0, marker; - var mcuExpected; - if (componentsLength == 1) { - mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; - } else { - mcuExpected = mcusPerLine * frame.mcusPerColumn; - } - if (!resetInterval) { - resetInterval = mcuExpected; - } - - var h, v; - while (mcu < mcuExpected) { - // reset interval stuff - for (i = 0; i < componentsLength; i++) { - components[i].pred = 0; + } else { + if (s !== 1) throw new Error('invalid ACn encoding') + successiveACNextValue = receiveAndExtend(s) + successiveACState = r ? 2 : 3 + } } - eobrun = 0; - - if (componentsLength == 1) { - component = components[0]; - for (n = 0; n < resetInterval; n++) { - decodeBlock(component, decodeFn, mcu); - mcu++; - } + continue + case 1: // skipping r zero items + case 2: + if (component.blockData[offset + z]) { + component.blockData[offset + z] += readBit() << successive } else { - for (n = 0; n < resetInterval; n++) { - for (i = 0; i < componentsLength; i++) { - component = components[i]; - h = component.h; - v = component.v; - for (j = 0; j < v; j++) { - for (k = 0; k < h; k++) { - decodeMcu(component, decodeFn, mcu, j, k); - } - } - } - mcu++; - } + r-- + if (r === 0) successiveACState = successiveACState === 2 ? 3 : 0 } - - // find marker - bitsCount = 0; - marker = (data[offset] << 8) | data[offset + 1]; - if (marker <= 0xFF00) { - throw "marker was not found"; - } - - if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx - offset += 2; + break + case 3: // set value for a zero item + if (component.blockData[offset + z]) { + component.blockData[offset + z] += readBit() << successive } else { - break; + component.blockData[offset + z] = successiveACNextValue << successive + successiveACState = 0 } + break + case 4: // eob + if (component.blockData[offset + z]) { + component.blockData[offset + z] += readBit() << successive + } + break } + k++ + } + if (successiveACState === 4) { + eobrun-- + if (eobrun === 0) successiveACState = 0 + } + } - return offset - startOffset; + function decodeMcu(component, decode, mcu, row, col) { + const mcuRow = (mcu / mcusPerLine) | 0 + const mcuCol = mcu % mcusPerLine + const blockRow = mcuRow * component.v + row + const blockCol = mcuCol * component.h + col + const offset = getBlockBufferOffset(component, blockRow, blockCol) + decode(component, offset) } - // A port of poppler's IDCT method which in turn is taken from: - // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, - // "Practical Fast 1-D DCT Algorithms with 11 Multiplications", - // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, - // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { - var qt = component.quantizationTable; - var v0, v1, v2, v3, v4, v5, v6, v7, t; - var i; - - // dequant - for (i = 0; i < 64; i++) { - p[i] = component.blockData[blockBufferOffset + i] * qt[i]; - } + function decodeBlock(component, decode, mcu) { + const blockRow = (mcu / component.blocksPerLine) | 0 + const blockCol = mcu % component.blocksPerLine + const offset = getBlockBufferOffset(component, blockRow, blockCol) + decode(component, offset) + } - // inverse DCT on rows - for (i = 0; i < 8; ++i) { - var row = 8 * i; - - // check for all-zero AC coefficients - if (p[1 + row] === 0 && p[2 + row] === 0 && p[3 + row] === 0 && - p[4 + row] === 0 && p[5 + row] === 0 && p[6 + row] === 0 && - p[7 + row] === 0) { - t = (dctSqrt2 * p[0 + row] + 512) >> 10; - p[0 + row] = t; - p[1 + row] = t; - p[2 + row] = t; - p[3 + row] = t; - p[4 + row] = t; - p[5 + row] = t; - p[6 + row] = t; - p[7 + row] = t; - continue; - } + const componentsLength = components.length + let component, i, j, k, n + let decodeFn + if (progressive) { + if (spectralStart === 0) decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive + else decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive + } else { + decodeFn = decodeBaseline + } - // stage 4 - v0 = (dctSqrt2 * p[0 + row] + 128) >> 8; - v1 = (dctSqrt2 * p[4 + row] + 128) >> 8; - v2 = p[2 + row]; - v3 = p[6 + row]; - v4 = (dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128) >> 8; - v7 = (dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128) >> 8; - v5 = p[3 + row] << 4; - v6 = p[5 + row] << 4; - - // stage 3 - t = (v0 - v1 + 1) >> 1; - v0 = (v0 + v1 + 1) >> 1; - v1 = t; - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; - v3 = t; - t = (v4 - v6 + 1) >> 1; - v4 = (v4 + v6 + 1) >> 1; - v6 = t; - t = (v7 + v5 + 1) >> 1; - v5 = (v7 - v5 + 1) >> 1; - v7 = t; - - // stage 2 - t = (v0 - v3 + 1) >> 1; - v0 = (v0 + v3 + 1) >> 1; - v3 = t; - t = (v1 - v2 + 1) >> 1; - v1 = (v1 + v2 + 1) >> 1; - v2 = t; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[0 + row] = v0 + v7; - p[7 + row] = v0 - v7; - p[1 + row] = v1 + v6; - p[6 + row] = v1 - v6; - p[2 + row] = v2 + v5; - p[5 + row] = v2 - v5; - p[3 + row] = v3 + v4; - p[4 + row] = v3 - v4; - } + let mcu = 0 + let marker + let mcuExpected + if (componentsLength === 1) { + mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn + } else { + mcuExpected = mcusPerLine * frame.mcusPerColumn + } + if (!resetInterval) { + resetInterval = mcuExpected + } - // inverse DCT on columns - for (i = 0; i < 8; ++i) { - var col = i; - - // check for all-zero AC coefficients - if (p[1 * 8 + col] === 0 && p[2 * 8 + col] === 0 && p[3 * 8 + col] === 0 && - p[4 * 8 + col] === 0 && p[5 * 8 + col] === 0 && p[6 * 8 + col] === 0 && - p[7 * 8 + col] === 0) { - t = (dctSqrt2 * p[i + 0] + 8192) >> 14; - p[0 * 8 + col] = t; - p[1 * 8 + col] = t; - p[2 * 8 + col] = t; - p[3 * 8 + col] = t; - p[4 * 8 + col] = t; - p[5 * 8 + col] = t; - p[6 * 8 + col] = t; - p[7 * 8 + col] = t; - continue; + let h, v + while (mcu < mcuExpected) { + // reset interval stuff + for (i = 0; i < componentsLength; i++) { + components[i].pred = 0 + } + eobrun = 0 + + if (componentsLength === 1) { + component = components[0] + for (n = 0; n < resetInterval; n++) { + decodeBlock(component, decodeFn, mcu) + mcu++ + } + } else { + for (n = 0; n < resetInterval; n++) { + for (i = 0; i < componentsLength; i++) { + component = components[i] + h = component.h + v = component.v + for (j = 0; j < v; j++) { + for (k = 0; k < h; k++) { + decodeMcu(component, decodeFn, mcu, j, k) + } } - - // stage 4 - v0 = (dctSqrt2 * p[0 * 8 + col] + 2048) >> 12; - v1 = (dctSqrt2 * p[4 * 8 + col] + 2048) >> 12; - v2 = p[2 * 8 + col]; - v3 = p[6 * 8 + col]; - v4 = (dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048) >> 12; - v7 = (dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048) >> 12; - v5 = p[3 * 8 + col]; - v6 = p[5 * 8 + col]; - - // stage 3 - t = (v0 - v1 + 1) >> 1; - v0 = (v0 + v1 + 1) >> 1; - v1 = t; - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; - v3 = t; - t = (v4 - v6 + 1) >> 1; - v4 = (v4 + v6 + 1) >> 1; - v6 = t; - t = (v7 + v5 + 1) >> 1; - v5 = (v7 - v5 + 1) >> 1; - v7 = t; - - // stage 2 - t = (v0 - v3 + 1) >> 1; - v0 = (v0 + v3 + 1) >> 1; - v3 = t; - t = (v1 - v2 + 1) >> 1; - v1 = (v1 + v2 + 1) >> 1; - v2 = t; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[0 * 8 + col] = v0 + v7; - p[7 * 8 + col] = v0 - v7; - p[1 * 8 + col] = v1 + v6; - p[6 * 8 + col] = v1 - v6; - p[2 * 8 + col] = v2 + v5; - p[5 * 8 + col] = v2 - v5; - p[3 * 8 + col] = v3 + v4; - p[4 * 8 + col] = v3 - v4; + } + mcu++ } + } + + // find marker + bitsCount = 0 + marker = (data[offset] << 8) | data[offset + 1] + if (marker <= 0xff00) { + throw new Error('marker was not found') + } + + if (marker >= 0xffd0 && marker <= 0xffd7) { + // RSTx + offset += 2 + } else { + break + } + } - // convert to 8-bit integers - for (i = 0; i < 64; ++i) { - var index = blockBufferOffset + i; - var q = p[i]; - q = (q <= -2056 / component.bitConversion) ? 0 : - (q >= 2024 / component.bitConversion) ? 255 / component.bitConversion : - (q + 2056 / component.bitConversion) >> 4; - component.blockData[index] = q; - } + return offset - startOffset + } + + // A port of poppler's IDCT method which in turn is taken from: + // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, + // "Practical Fast 1-D DCT Algorithms with 11 Multiplications", + // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, + // 988-991. + function quantizeAndInverse(component, blockBufferOffset, p) { + const qt = component.quantizationTable + let v0, v1, v2, v3, v4, v5, v6, v7, t + let i + + // dequant + for (i = 0; i < 64; i++) { + p[i] = component.blockData[blockBufferOffset + i] * qt[i] } - function buildComponentData(frame, component) { - var lines = []; - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var samplesPerLine = blocksPerLine << 3; - var computationBuffer = new Int32Array(64); - - var i, j, ll = 0; - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var offset = getBlockBufferOffset(component, blockRow, blockCol); - quantizeAndInverse(component, offset, computationBuffer); - } - } - return component.blockData; + // inverse DCT on rows + for (i = 0; i < 8; ++i) { + const row = 8 * i + + // check for all-zero AC coefficients + if ( + p[1 + row] === 0 && + p[2 + row] === 0 && + p[3 + row] === 0 && + p[4 + row] === 0 && + p[5 + row] === 0 && + p[6 + row] === 0 && + p[7 + row] === 0 + ) { + t = (dctSqrt2 * p[0 + row] + 512) >> 10 + p[0 + row] = t + p[1 + row] = t + p[2 + row] = t + p[3 + row] = t + p[4 + row] = t + p[5 + row] = t + p[6 + row] = t + p[7 + row] = t + continue + } + + // stage 4 + v0 = (dctSqrt2 * p[0 + row] + 128) >> 8 + v1 = (dctSqrt2 * p[4 + row] + 128) >> 8 + v2 = p[2 + row] + v3 = p[6 + row] + v4 = (dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128) >> 8 + v7 = (dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128) >> 8 + v5 = p[3 + row] << 4 + v6 = p[5 + row] << 4 + + // stage 3 + t = (v0 - v1 + 1) >> 1 + v0 = (v0 + v1 + 1) >> 1 + v1 = t + t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8 + v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8 + v3 = t + t = (v4 - v6 + 1) >> 1 + v4 = (v4 + v6 + 1) >> 1 + v6 = t + t = (v7 + v5 + 1) >> 1 + v5 = (v7 - v5 + 1) >> 1 + v7 = t + + // stage 2 + t = (v0 - v3 + 1) >> 1 + v0 = (v0 + v3 + 1) >> 1 + v3 = t + t = (v1 - v2 + 1) >> 1 + v1 = (v1 + v2 + 1) >> 1 + v2 = t + t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12 + v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12 + v7 = t + t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12 + v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12 + v6 = t + + // stage 1 + p[0 + row] = v0 + v7 + p[7 + row] = v0 - v7 + p[1 + row] = v1 + v6 + p[6 + row] = v1 - v6 + p[2 + row] = v2 + v5 + p[5 + row] = v2 - v5 + p[3 + row] = v3 + v4 + p[4 + row] = v3 - v4 } - function clampToUint8(a) { - return a <= 0 ? 0 : a >= 255 ? 255 : a | 0; + // inverse DCT on columns + for (i = 0; i < 8; ++i) { + const col = i + + // check for all-zero AC coefficients + if ( + p[1 * 8 + col] === 0 && + p[2 * 8 + col] === 0 && + p[3 * 8 + col] === 0 && + p[4 * 8 + col] === 0 && + p[5 * 8 + col] === 0 && + p[6 * 8 + col] === 0 && + p[7 * 8 + col] === 0 + ) { + t = (dctSqrt2 * p[i + 0] + 8192) >> 14 + p[0 * 8 + col] = t + p[1 * 8 + col] = t + p[2 * 8 + col] = t + p[3 * 8 + col] = t + p[4 * 8 + col] = t + p[5 * 8 + col] = t + p[6 * 8 + col] = t + p[7 * 8 + col] = t + continue + } + + // stage 4 + v0 = (dctSqrt2 * p[0 * 8 + col] + 2048) >> 12 + v1 = (dctSqrt2 * p[4 * 8 + col] + 2048) >> 12 + v2 = p[2 * 8 + col] + v3 = p[6 * 8 + col] + v4 = (dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048) >> 12 + v7 = (dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048) >> 12 + v5 = p[3 * 8 + col] + v6 = p[5 * 8 + col] + + // stage 3 + t = (v0 - v1 + 1) >> 1 + v0 = (v0 + v1 + 1) >> 1 + v1 = t + t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12 + v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12 + v3 = t + t = (v4 - v6 + 1) >> 1 + v4 = (v4 + v6 + 1) >> 1 + v6 = t + t = (v7 + v5 + 1) >> 1 + v5 = (v7 - v5 + 1) >> 1 + v7 = t + + // stage 2 + t = (v0 - v3 + 1) >> 1 + v0 = (v0 + v3 + 1) >> 1 + v3 = t + t = (v1 - v2 + 1) >> 1 + v1 = (v1 + v2 + 1) >> 1 + v2 = t + t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12 + v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12 + v7 = t + t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12 + v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12 + v6 = t + + // stage 1 + p[0 * 8 + col] = v0 + v7 + p[7 * 8 + col] = v0 - v7 + p[1 * 8 + col] = v1 + v6 + p[6 * 8 + col] = v1 - v6 + p[2 * 8 + col] = v2 + v5 + p[5 * 8 + col] = v2 - v5 + p[3 * 8 + col] = v3 + v4 + p[4 * 8 + col] = v3 - v4 } - constructor.prototype = { - load: function load(path) { - var handleData = (function (data) { - this.parse(data); - if (this.onload) - this.onload(); - }).bind(this); - - if (path.indexOf("data:") > -1) { - var offset = path.indexOf("base64,") + 7; - var data = atob(path.substring(offset)); - var arr = new Uint8Array(data.length); - for (var i = data.length - 1; i >= 0; i--) { - arr[i] = data.charCodeAt(i); + // convert to 8-bit integers + for (i = 0; i < 64; ++i) { + const index = blockBufferOffset + i + let q = p[i] + q = + q <= -2056 / component.bitConversion + ? 0 + : q >= 2024 / component.bitConversion + ? 255 / component.bitConversion + : (q + 2056 / component.bitConversion) >> 4 + component.blockData[index] = q + } + } + + function buildComponentData(frame, component) { + const blocksPerLine = component.blocksPerLine + const blocksPerColumn = component.blocksPerColumn + const computationBuffer = new Int32Array(64) + + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const offset = getBlockBufferOffset(component, blockRow, blockCol) + quantizeAndInverse(component, offset, computationBuffer) + } + } + return component.blockData + } + + function clampToUint8(a) { + return a <= 0 ? 0 : a >= 255 ? 255 : a | 0 + } + + constructor.prototype = { + load: function load(path) { + const handleData = function (data) { + this.parse(data) + if (this.onload) this.onload() + }.bind(this) + + if (path.indexOf('data:') > -1) { + const offset = path.indexOf('base64,') + 7 + const data = atob(path.substring(offset)) + const arr = new Uint8Array(data.length) + for (let i = data.length - 1; i >= 0; i--) { + arr[i] = data.charCodeAt(i) + } + handleData(data) + } else { + const xhr = new XMLHttpRequest() + xhr.open('GET', path, true) + xhr.responseType = 'arraybuffer' + xhr.onload = function () { + // TODO catch parse error + const data = new Uint8Array(xhr.response) + handleData(data) + } + xhr.send(null) + } + }, + parse: function parse(data) { + function readUint16() { + const value = (data[offset] << 8) | data[offset + 1] + offset += 2 + return value + } + + function readDataBlock() { + const length = readUint16() + const array = data.subarray(offset, offset + length - 2) + offset += array.length + return array + } + + function prepareComponents(frame) { + const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH) + const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV) + for (let i = 0; i < frame.components.length; i++) { + const component = frame.components[i] + const blocksPerLine = Math.ceil((Math.ceil(frame.samplesPerLine / 8) * component.h) / frame.maxH) + const blocksPerColumn = Math.ceil((Math.ceil(frame.scanLines / 8) * component.v) / frame.maxV) + const blocksPerLineForMcu = mcusPerLine * component.h + const blocksPerColumnForMcu = mcusPerColumn * component.v + + const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1) + component.blockData = new Int16Array(blocksBufferSize) + component.blocksPerLine = blocksPerLine + component.blocksPerColumn = blocksPerColumn + } + frame.mcusPerLine = mcusPerLine + frame.mcusPerColumn = mcusPerColumn + } + + let offset = 0 + let jfif = null + let adobe = null + let frame, resetInterval + const quantizationTables = [] + const huffmanTablesAC = [] + const huffmanTablesDC = [] + let fileMarker = readUint16() + if (fileMarker !== 0xffd8) { + // SOI (Start of Image) + throw new Error('SOI not found') + } + + fileMarker = readUint16() + while (fileMarker !== 0xffd9) { + // EOI (End of image) + let i, j, l + switch (fileMarker) { + case 0xffe0: // APP0 (Application Specific) + case 0xffe1: // APP1 + case 0xffe2: // APP2 + case 0xffe3: // APP3 + case 0xffe4: // APP4 + case 0xffe5: // APP5 + case 0xffe6: // APP6 + case 0xffe7: // APP7 + case 0xffe8: // APP8 + case 0xffe9: // APP9 + case 0xffea: // APP10 + case 0xffeb: // APP11 + case 0xffec: // APP12 + case 0xffed: // APP13 + case 0xffee: // APP14 + case 0xffef: // APP15 + case 0xfffe: // COM (Comment) + { + const appData = readDataBlock() + + if (fileMarker === 0xffe0) { + if ( + appData[0] === 0x4a && + appData[1] === 0x46 && + appData[2] === 0x49 && + appData[3] === 0x46 && + appData[4] === 0 + ) { + // 'JFIF\x00' + jfif = { + version: { major: appData[5], minor: appData[6] }, + densityUnits: appData[7], + xDensity: (appData[8] << 8) | appData[9], + yDensity: (appData[10] << 8) | appData[11], + thumbWidth: appData[12], + thumbHeight: appData[13], + thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) + } } - handleData(data); - } else { - var xhr = new XMLHttpRequest(); - xhr.open("GET", path, true); - xhr.responseType = "arraybuffer"; - xhr.onload = (function () { - // TODO catch parse error - var data = new Uint8Array(xhr.response); - handleData(data); - }).bind(this); - xhr.send(null); - } - }, - parse: function parse(data) { - - function readUint16() { - var value = (data[offset] << 8) | data[offset + 1]; - offset += 2; - return value; + } + // TODO APP1 - Exif + if (fileMarker === 0xffee) { + if ( + appData[0] === 0x41 && + appData[1] === 0x64 && + appData[2] === 0x6f && + appData[3] === 0x62 && + appData[4] === 0x65 && + appData[5] === 0 + ) { + // 'Adobe\x00' + adobe = { + version: appData[6], + flags0: (appData[7] << 8) | appData[8], + flags1: (appData[9] << 8) | appData[10], + transformCode: appData[11] + } + } + } } + break - function readDataBlock() { - var length = readUint16(); - var array = data.subarray(offset, offset + length - 2); - offset += array.length; - return array; + case 0xffdb: // DQT (Define Quantization Tables) + { + const quantizationTablesLength = readUint16() + const quantizationTablesEnd = quantizationTablesLength + offset - 2 + while (offset < quantizationTablesEnd) { + const quantizationTableSpec = data[offset++] + const tableData = new Int32Array(64) + if (quantizationTableSpec >> 4 === 0) { + // 8 bit values + for (j = 0; j < 64; j++) { + const z = dctZigZag[j] + tableData[z] = data[offset++] + } + } else if (quantizationTableSpec >> 4 === 1) { + // 16 bit + for (j = 0; j < 64; j++) { + const zz = dctZigZag[j] + tableData[zz] = readUint16() + } + } else throw new Error('DQT: invalid table spec') + quantizationTables[quantizationTableSpec & 15] = tableData + } } + break - function prepareComponents(frame) { - var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); - var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); - for (var i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); - var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); - var blocksPerLineForMcu = mcusPerLine * component.h; - var blocksPerColumnForMcu = mcusPerColumn * component.v; - - var blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); - component.blockData = new Int16Array(blocksBufferSize); - component.blocksPerLine = blocksPerLine; - component.blocksPerColumn = blocksPerColumn; - } - frame.mcusPerLine = mcusPerLine; - frame.mcusPerColumn = mcusPerColumn; + case 0xffc0: // SOF0 (Start of Frame, Baseline DCT) + case 0xffc1: // SOF1 (Start of Frame, Extended DCT) + case 0xffc2: // SOF2 (Start of Frame, Progressive DCT) + { + if (frame) { + throw new Error('Only single frame JPEGs supported') + } + readUint16() // skip data length + frame = {} + frame.extended = fileMarker === 0xffc1 + frame.progressive = fileMarker === 0xffc2 + frame.precision = data[offset++] + frame.scanLines = readUint16() + frame.samplesPerLine = readUint16() + frame.components = [] + frame.componentIds = {} + const componentsCount = data[offset++] + let componentId + let maxH = 0 + let maxV = 0 + for (i = 0; i < componentsCount; i++) { + componentId = data[offset] + const h = data[offset + 1] >> 4 + const v = data[offset + 1] & 15 + if (maxH < h) maxH = h + if (maxV < v) maxV = v + const qId = data[offset + 2] + l = frame.components.push({ + h, + v, + quantizationTable: quantizationTables[qId], + quantizationTableId: qId, + bitConversion: 255 / ((1 << frame.precision) - 1) + }) + frame.componentIds[componentId] = l - 1 + offset += 3 + } + frame.maxH = maxH + frame.maxV = maxV + prepareComponents(frame) } + break - var offset = 0, length = data.length; - var jfif = null; - var adobe = null; - var pixels = null; - var frame, resetInterval; - var quantizationTables = []; - var huffmanTablesAC = [], huffmanTablesDC = []; - var fileMarker = readUint16(); - if (fileMarker != 0xFFD8) { // SOI (Start of Image) - throw "SOI not found"; + case 0xffc4: // DHT (Define Huffman Tables) + { + const huffmanLength = readUint16() + for (i = 2; i < huffmanLength; ) { + const huffmanTableSpec = data[offset++] + const codeLengths = new Uint8Array(16) + let codeLengthSum = 0 + for (j = 0; j < 16; j++, offset++) codeLengthSum += codeLengths[j] = data[offset] + const huffmanValues = new Uint8Array(codeLengthSum) + for (j = 0; j < codeLengthSum; j++, offset++) huffmanValues[j] = data[offset] + i += 17 + codeLengthSum + ;(huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = + buildHuffmanTable(codeLengths, huffmanValues) + } } + break - fileMarker = readUint16(); - while (fileMarker != 0xFFD9) { // EOI (End of image) - var i, j, l; - switch (fileMarker) { - case 0xFFE0: // APP0 (Application Specific) - case 0xFFE1: // APP1 - case 0xFFE2: // APP2 - case 0xFFE3: // APP3 - case 0xFFE4: // APP4 - case 0xFFE5: // APP5 - case 0xFFE6: // APP6 - case 0xFFE7: // APP7 - case 0xFFE8: // APP8 - case 0xFFE9: // APP9 - case 0xFFEA: // APP10 - case 0xFFEB: // APP11 - case 0xFFEC: // APP12 - case 0xFFED: // APP13 - case 0xFFEE: // APP14 - case 0xFFEF: // APP15 - case 0xFFFE: // COM (Comment) - var appData = readDataBlock(); - - if (fileMarker === 0xFFE0) { - if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 && - appData[3] === 0x46 && appData[4] === 0) { // 'JFIF\x00' - jfif = { - version: {major: appData[5], minor: appData[6]}, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) - }; - } - } - // TODO APP1 - Exif - if (fileMarker === 0xFFEE) { - if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F && - appData[3] === 0x62 && appData[4] === 0x65 && appData[5] === 0) { // 'Adobe\x00' - adobe = { - version: appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - }; - } - } - break; - - case 0xFFDB: // DQT (Define Quantization Tables) - var quantizationTablesLength = readUint16(); - var quantizationTablesEnd = quantizationTablesLength + offset - 2; - while (offset < quantizationTablesEnd) { - var quantizationTableSpec = data[offset++]; - var tableData = new Int32Array(64); - if ((quantizationTableSpec >> 4) === 0) { // 8 bit values - for (j = 0; j < 64; j++) { - var z = dctZigZag[j]; - tableData[z] = data[offset++]; - } - } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - for (j = 0; j < 64; j++) { - var zz = dctZigZag[j]; - tableData[zz] = readUint16(); - } - } else - throw "DQT: invalid table spec"; - quantizationTables[quantizationTableSpec & 15] = tableData; - } - break; - - case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT) - case 0xFFC1: // SOF1 (Start of Frame, Extended DCT) - case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT) - if (frame) { - throw "Only single frame JPEGs supported"; - } - readUint16(); // skip data length - frame = {}; - frame.extended = (fileMarker === 0xFFC1); - frame.progressive = (fileMarker === 0xFFC2); - frame.precision = data[offset++]; - frame.scanLines = readUint16(); - frame.samplesPerLine = readUint16(); - frame.components = []; - frame.componentIds = {}; - var componentsCount = data[offset++], componentId; - var maxH = 0, maxV = 0; - for (i = 0; i < componentsCount; i++) { - componentId = data[offset]; - var h = data[offset + 1] >> 4; - var v = data[offset + 1] & 15; - if (maxH < h) - maxH = h; - if (maxV < v) - maxV = v; - var qId = data[offset + 2]; - l = frame.components.push({ - h: h, - v: v, - quantizationTable: quantizationTables[qId], - quantizationTableId: qId, - bitConversion: 255 / ((1 << frame.precision) - 1) - }); - frame.componentIds[componentId] = l - 1; - offset += 3; - } - frame.maxH = maxH; - frame.maxV = maxV; - prepareComponents(frame); - break; - - case 0xFFC4: // DHT (Define Huffman Tables) - var huffmanLength = readUint16(); - for (i = 2; i < huffmanLength; ) { - var huffmanTableSpec = data[offset++]; - var codeLengths = new Uint8Array(16); - var codeLengthSum = 0; - for (j = 0; j < 16; j++, offset++) - codeLengthSum += (codeLengths[j] = data[offset]); - var huffmanValues = new Uint8Array(codeLengthSum); - for (j = 0; j < codeLengthSum; j++, offset++) - huffmanValues[j] = data[offset]; - i += 17 + codeLengthSum; - - ((huffmanTableSpec >> 4) === 0 ? - huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues); - } - break; - - case 0xFFDD: // DRI (Define Restart Interval) - readUint16(); // skip data length - resetInterval = readUint16(); - break; - - case 0xFFDA: // SOS (Start of Scan) - var scanLength = readUint16(); - var selectorsCount = data[offset++]; - var components = [], component; - for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; - component = frame.components[componentIndex]; - var tableSpec = data[offset++]; - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; - components.push(component); - } - var spectralStart = data[offset++]; - var spectralEnd = data[offset++]; - var successiveApproximation = data[offset++]; - var processed = decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successiveApproximation >> 4, successiveApproximation & 15); - offset += processed; - break; - default: - if (data[offset - 3] == 0xFF && - data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3; - break; - } - throw "unknown JPEG marker " + fileMarker.toString(16); - } - fileMarker = readUint16(); - } + case 0xffdd: // DRI (Define Restart Interval) + readUint16() // skip data length + resetInterval = readUint16() + break - this.width = frame.samplesPerLine; - this.height = frame.scanLines; - this.jfif = jfif; - this.adobe = adobe; - this.components = []; - switch (frame.components.length) + case 0xffda: // SOS (Start of Scan) { - case 1: - this.colorspace = ColorSpace.Grayscale; - break; - case 3: - if (this.adobe) - this.colorspace = ColorSpace.AdobeRGB; - else - this.colorspace = ColorSpace.RGB; - break; - case 4: - this.colorspace = ColorSpace.CYMK; - break; - default: - this.colorspace = ColorSpace.Unknown; + // unused scan length + readUint16() + + const selectorsCount = data[offset++] + const components = [] + let component + for (i = 0; i < selectorsCount; i++) { + const componentIndex = frame.componentIds[data[offset++]] + component = frame.components[componentIndex] + const tableSpec = data[offset++] + component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4] + component.huffmanTableAC = huffmanTablesAC[tableSpec & 15] + components.push(component) + } + const spectralStart = data[offset++] + const spectralEnd = data[offset++] + const successiveApproximation = data[offset++] + const processed = decodeScan( + data, + offset, + frame, + components, + resetInterval, + spectralStart, + spectralEnd, + successiveApproximation >> 4, + successiveApproximation & 15 + ) + offset += processed } - for (var i = 0; i < frame.components.length; i++) { - var component = frame.components[i]; - if (!component.quantizationTable && component.quantizationTableId !== null) - component.quantizationTable = quantizationTables[component.quantizationTableId]; - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn, - bitConversion: component.bitConversion - }); + break + default: + if (data[offset - 3] === 0xff && data[offset - 2] >= 0xc0 && data[offset - 2] <= 0xfe) { + // could be incorrect encoding -- last 0xFF byte of the previous + // block was eaten by the encoder + offset -= 3 + break } - }, - getData16: function getData16(width, height) { - if (this.components.length !== 1) - throw 'Unsupported color mode'; - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY; - var x, y, i; - var offset = 0; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint16Array(dataLength); - var componentLine; - - // lineData is reused for all components. Assume first component is - // the biggest - var lineData = new Uint16Array((this.components[0].blocksPerLine << 3) * - this.components[0].blocksPerColumn * 8); - - // First construct image data ... - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var samplesPerLine = blocksPerLine << 3; - - var j, k, ll = 0; - var lineOffset = 0; - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - var scanLine = blockRow << 3; - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var bufferOffset = getBlockBufferOffset(component, blockRow, blockCol); - var offset = 0, sample = blockCol << 3; - for (j = 0; j < 8; j++) { - var lineOffset = (scanLine + j) * samplesPerLine; - for (k = 0; k < 8; k++) { - lineData[lineOffset + sample + k] = - component.output[bufferOffset + offset++]; - } - } - } - } - - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - - var cx, cy; - var index; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cy = 0 | (y * componentScaleY); - cx = 0 | (x * componentScaleX); - index = cy * samplesPerLine + cx; - data[offset] = lineData[index]; - offset += numComponents; - } - } + throw new Error('unknown JPEG marker ' + fileMarker.toString(16)) + } + fileMarker = readUint16() + } + + this.width = frame.samplesPerLine + this.height = frame.scanLines + this.jfif = jfif + this.adobe = adobe + this.components = [] + switch (frame.components.length) { + case 1: + this.colorspace = ColorSpace.Grayscale + break + case 3: + if (this.adobe) this.colorspace = ColorSpace.AdobeRGB + else this.colorspace = ColorSpace.RGB + break + case 4: + this.colorspace = ColorSpace.CYMK + break + default: + this.colorspace = ColorSpace.Unknown + } + for (let i = 0; i < frame.components.length; i++) { + const component = frame.components[i] + if (!component.quantizationTable && component.quantizationTableId !== null) + component.quantizationTable = quantizationTables[component.quantizationTableId] + this.components.push({ + output: buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV, + blocksPerLine: component.blocksPerLine, + blocksPerColumn: component.blocksPerColumn, + bitConversion: component.bitConversion + }) + } + }, + getData16: function getData16(width, height) { + if (this.components.length !== 1) throw new Error('Unsupported color mode') + const scaleX = this.width / width + const scaleY = this.height / height + + let component, componentScaleX, componentScaleY + let x, y, i + let offset = 0 + const numComponents = this.components.length + const dataLength = width * height * numComponents + const data = new Uint16Array(dataLength) + + // lineData is reused for all components. Assume first component is + // the biggest + const lineData = new Uint16Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) + + // First construct image data ... + for (i = 0; i < numComponents; i++) { + component = this.components[i] + const blocksPerLine = component.blocksPerLine + const blocksPerColumn = component.blocksPerColumn + const samplesPerLine = blocksPerLine << 3 + + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + const scanLine = blockRow << 3 + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const bufferOffset = getBlockBufferOffset(component, blockRow, blockCol) + offset = 0 + const sample = blockCol << 3 + for (let j = 0; j < 8; j++) { + const lineOffset = (scanLine + j) * samplesPerLine + for (let k = 0; k < 8; k++) { + lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] + } } - return data; - }, - getData: function getData(width, height) { - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY; - var x, y, i; - var offset = 0; - var Y, Cb, Cr, K, C, M, Ye, R, G, B; - var colorTransform; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint8Array(dataLength); - var componentLine; - - // lineData is reused for all components. Assume first component is - // the biggest - var lineData = new Uint8Array((this.components[0].blocksPerLine << 3) * - this.components[0].blocksPerColumn * 8); - - // First construct image data ... - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var samplesPerLine = blocksPerLine << 3; - - var j, k, ll = 0; - var lineOffset = 0; - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - var scanLine = blockRow << 3; - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var bufferOffset = getBlockBufferOffset(component, blockRow, blockCol); - var offset = 0, sample = blockCol << 3; - for (j = 0; j < 8; j++) { - var lineOffset = (scanLine + j) * samplesPerLine; - for (k = 0; k < 8; k++) { - lineData[lineOffset + sample + k] = - component.output[bufferOffset + offset++] * component.bitConversion; - } - } - } - } + } + } - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - - var cx, cy; - var index; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cy = 0 | (y * componentScaleY); - cx = 0 | (x * componentScaleX); - index = cy * samplesPerLine + cx; - data[offset] = lineData[index]; - offset += numComponents; - } - } + componentScaleX = component.scaleX * scaleX + componentScaleY = component.scaleY * scaleY + offset = i + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + const cy = 0 | (y * componentScaleY) + const cx = 0 | (x * componentScaleX) + const index = cy * samplesPerLine + cx + data[offset] = lineData[index] + offset += numComponents + } + } + } + return data + }, + getData: function getData(width, height) { + const scaleX = this.width / width + const scaleY = this.height / height + + let component, componentScaleX, componentScaleY + let x, y, i + let offset = 0 + let Y, Cb, Cr, C, M, R, G, B + let colorTransform + const numComponents = this.components.length + const dataLength = width * height * numComponents + const data = new Uint8Array(dataLength) + + // lineData is reused for all components. Assume first component is + // the biggest + const lineData = new Uint8Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) + + // First construct image data ... + for (i = 0; i < numComponents; i++) { + component = this.components[i] + const blocksPerLine = component.blocksPerLine + const blocksPerColumn = component.blocksPerColumn + const samplesPerLine = blocksPerLine << 3 + + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + const scanLine = blockRow << 3 + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const bufferOffset = getBlockBufferOffset(component, blockRow, blockCol) + let offset = 0 + const sample = blockCol << 3 + for (let j = 0; j < 8; j++) { + const lineOffset = (scanLine + j) * samplesPerLine + for (let k = 0; k < 8; k++) { + lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] * component.bitConversion + } } + } + } - // ... then transform colors, if necessary - switch (numComponents) { - case 1: - case 2: - break; - // no color conversion for one or two compoenents - - case 3: - // The default transform for three components is true - colorTransform = true; - // The adobe transform marker overrides any previous setting - if (this.adobe && this.adobe.transformCode) - colorTransform = true; - else if (typeof this.colorTransform !== 'undefined') - colorTransform = !!this.colorTransform; - - if (colorTransform) { - for (i = 0; i < dataLength; i += numComponents) { - Y = data[i ]; - Cb = data[i + 1]; - Cr = data[i + 2]; - - R = clampToUint8(Y - 179.456 + 1.402 * Cr); - G = clampToUint8(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); - B = clampToUint8(Y - 226.816 + 1.772 * Cb); - - data[i ] = R; - data[i + 1] = G; - data[i + 2] = B; - } - } - break; - case 4: - if (!this.adobe) - throw 'Unsupported color mode (4 components)'; - // The default transform for four components is false - colorTransform = false; - // The adobe transform marker overrides any previous setting - if (this.adobe && this.adobe.transformCode) - colorTransform = true; - else if (typeof this.colorTransform !== 'undefined') - colorTransform = !!this.colorTransform; - - if (colorTransform) { - for (i = 0; i < dataLength; i += numComponents) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - - C = clampToUint8(434.456 - Y - 1.402 * Cr); - M = clampToUint8(119.541 - Y + 0.344 * Cb + 0.714 * Cr); - Y = clampToUint8(481.816 - Y - 1.772 * Cb); - - data[i ] = C; - data[i + 1] = M; - data[i + 2] = Y; - // K is unchanged - } - } - break; - default: - throw 'Unsupported color mode'; - } - return data; + componentScaleX = component.scaleX * scaleX + componentScaleY = component.scaleY * scaleY + offset = i + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + const cy = 0 | (y * componentScaleY) + const cx = 0 | (x * componentScaleX) + const index = cy * samplesPerLine + cx + data[offset] = lineData[index] + offset += numComponents + } } - }; - - return constructor; -})(); -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = { - JpegImage: JpegImage - }; -} \ No newline at end of file + } + + // ... then transform colors, if necessary + switch (numComponents) { + case 1: + case 2: + break + // no color conversion for one or two compoenents + + case 3: + // The default transform for three components is true + colorTransform = true + // The adobe transform marker overrides any previous setting + if (this.adobe && this.adobe.transformCode) colorTransform = true + else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform + + if (colorTransform) { + for (i = 0; i < dataLength; i += numComponents) { + Y = data[i] + Cb = data[i + 1] + Cr = data[i + 2] + + R = clampToUint8(Y - 179.456 + 1.402 * Cr) + G = clampToUint8(Y + 135.459 - 0.344 * Cb - 0.714 * Cr) + B = clampToUint8(Y - 226.816 + 1.772 * Cb) + + data[i] = R + data[i + 1] = G + data[i + 2] = B + } + } + break + case 4: + if (!this.adobe) throw new Error('Unsupported color mode (4 components)') + // The default transform for four components is false + colorTransform = false + // The adobe transform marker overrides any previous setting + if (this.adobe && this.adobe.transformCode) colorTransform = true + else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform + + if (colorTransform) { + for (i = 0; i < dataLength; i += numComponents) { + Y = data[i] + Cb = data[i + 1] + Cr = data[i + 2] + + C = clampToUint8(434.456 - Y - 1.402 * Cr) + M = clampToUint8(119.541 - Y + 0.344 * Cb + 0.714 * Cr) + Y = clampToUint8(481.816 - Y - 1.772 * Cb) + + data[i] = C + data[i + 1] = M + data[i + 2] = Y + // K is unchanged + } + } + break + default: + throw new Error('Unsupported color mode') + } + return data + } + } + + return constructor +})() diff --git a/lib/jpeg-ls.js b/lib/jpeg-ls.js index 36a981f..001c8e9 100644 --- a/lib/jpeg-ls.js +++ b/lib/jpeg-ls.js @@ -23,130 +23,114 @@ SOFTWARE. */ -"use strict"; +import charLS from 'CharLS.js' -var CharLS = CharLS || ((typeof require !== 'undefined') ? require('../lib/charLS-DynamicMemory-browser.js') : null); +export const JpegLS = (function () { + function constructor() {} -var JpegLS = (function () { - var charLS; - - function constructor() { + constructor.prototype = { + decodeJPEGLS: function (pixelData, signed) { + return decodeJPEGLS(pixelData, signed) } - - constructor.prototype = { - decodeJPEGLS: function(pixelData, signed) { - return decodeJPEGLS(pixelData, signed); - } - }; - - function jpegLSDecode(data, isSigned) { - // prepare input parameters - var dataPtr = charLS._malloc(data.length); - charLS.writeArrayToMemory(data, dataPtr); - - // prepare output parameters - var imagePtrPtr=charLS._malloc(4); - var imageSizePtr=charLS._malloc(4); - var widthPtr=charLS._malloc(4); - var heightPtr=charLS._malloc(4); - var bitsPerSamplePtr=charLS._malloc(4); - var stridePtr=charLS._malloc(4); - var allowedLossyErrorPtr =charLS._malloc(4); - var componentsPtr=charLS._malloc(4); - var interleaveModePtr=charLS._malloc(4); - - // Decode the image - var result = charLS.ccall( - 'jpegls_decode', - 'number', - ['number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'], - [dataPtr, data.length, imagePtrPtr, imageSizePtr, widthPtr, heightPtr, bitsPerSamplePtr, stridePtr, componentsPtr, allowedLossyErrorPtr, interleaveModePtr] - ); - - // Extract result values into object - var image = { - result : result, - width : charLS.getValue(widthPtr,'i32'), - height : charLS.getValue(heightPtr,'i32'), - bitsPerSample : charLS.getValue(bitsPerSamplePtr,'i32'), - stride : charLS.getValue(stridePtr,'i32'), - components : charLS.getValue(componentsPtr, 'i32'), - allowedLossyError : charLS.getValue(allowedLossyErrorPtr, 'i32'), - interleaveMode: charLS.getValue(interleaveModePtr, 'i32'), - pixelData: undefined - }; - - // Copy image from emscripten heap into appropriate array buffer type - var imagePtr = charLS.getValue(imagePtrPtr, '*'); - if(image.bitsPerSample <= 8) { - image.pixelData = new Uint8Array(image.width * image.height * image.components); - image.pixelData.set(new Uint8Array(charLS.HEAP8.buffer, imagePtr, image.pixelData.length)); - } else { - // I have seen 16 bit signed images, but I don't know if 16 bit unsigned is valid, hoping to get - // answer here: - // https://github.com/team-charls/charls/issues/14 - if(isSigned) { - image.pixelData = new Int16Array(image.width * image.height * image.components); - image.pixelData.set(new Int16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)); - } else { - image.pixelData = new Uint16Array(image.width * image.height * image.components); - image.pixelData.set(new Uint16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)); - } - } - - // free memory and return image object - charLS._free(dataPtr); - charLS._free(imagePtr); - charLS._free(imagePtrPtr); - charLS._free(imageSizePtr); - charLS._free(widthPtr); - charLS._free(heightPtr); - charLS._free(bitsPerSamplePtr); - charLS._free(stridePtr); - charLS._free(componentsPtr); - charLS._free(interleaveModePtr); - - return image; + } + + function jpegLSDecode(data, isSigned) { + // prepare input parameters + const dataPtr = charLS._malloc(data.length) + charLS.writeArrayToMemory(data, dataPtr) + + // prepare output parameters + const imagePtrPtr = charLS._malloc(4) + const imageSizePtr = charLS._malloc(4) + const widthPtr = charLS._malloc(4) + const heightPtr = charLS._malloc(4) + const bitsPerSamplePtr = charLS._malloc(4) + const stridePtr = charLS._malloc(4) + const allowedLossyErrorPtr = charLS._malloc(4) + const componentsPtr = charLS._malloc(4) + const interleaveModePtr = charLS._malloc(4) + + // Decode the image + const result = charLS.ccall( + 'jpegls_decode', + 'number', + ['number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'], + [ + dataPtr, + data.length, + imagePtrPtr, + imageSizePtr, + widthPtr, + heightPtr, + bitsPerSamplePtr, + stridePtr, + componentsPtr, + allowedLossyErrorPtr, + interleaveModePtr + ] + ) + + // Extract result values into object + const image = { + result, + width: charLS.getValue(widthPtr, 'i32'), + height: charLS.getValue(heightPtr, 'i32'), + bitsPerSample: charLS.getValue(bitsPerSamplePtr, 'i32'), + stride: charLS.getValue(stridePtr, 'i32'), + components: charLS.getValue(componentsPtr, 'i32'), + allowedLossyError: charLS.getValue(allowedLossyErrorPtr, 'i32'), + interleaveMode: charLS.getValue(interleaveModePtr, 'i32'), + pixelData: undefined } - function initializeJPEGLS() { - // check to make sure codec is loaded - if(typeof CharLS === 'undefined') { - throw 'No JPEG-LS decoder loaded'; - } - - // Try to initialize CharLS - // CharLS https://github.com/chafey/charls - if(!charLS) { - charLS = CharLS(); - if(!charLS || !charLS._jpegls_decode) { - throw 'JPEG-LS failed to initialize'; - } - } + // Copy image from emscripten heap into appropriate array buffer type + const imagePtr = charLS.getValue(imagePtrPtr, '*') + if (image.bitsPerSample <= 8) { + image.pixelData = new Uint8Array(image.width * image.height * image.components) + image.pixelData.set(new Uint8Array(charLS.HEAP8.buffer, imagePtr, image.pixelData.length)) + } else { + // I have seen 16 bit signed images, but I don't know if 16 bit unsigned is valid, hoping to get + // answer here: + // https://github.com/team-charls/charls/issues/14 + if (isSigned) { + image.pixelData = new Int16Array(image.width * image.height * image.components) + image.pixelData.set(new Int16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) + } else { + image.pixelData = new Uint16Array(image.width * image.height * image.components) + image.pixelData.set(new Uint16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) + } } - function decodeJPEGLS(pixelData, signed) { - initializeJPEGLS(); - - var image = jpegLSDecode(pixelData, signed); - // console.log(image); - - // throw error if not success or too much data - if(image.result !== 0 && image.result !== 6) { - throw 'JPEG-LS decoder failed to decode frame (error code ' + image.result + ')'; - } + // free memory and return image object + charLS._free(dataPtr) + charLS._free(imagePtr) + charLS._free(imagePtrPtr) + charLS._free(imageSizePtr) + charLS._free(widthPtr) + charLS._free(heightPtr) + charLS._free(bitsPerSamplePtr) + charLS._free(stridePtr) + charLS._free(componentsPtr) + charLS._free(interleaveModePtr) + + return image + } + + function decodeJPEGLS(pixelData, signed) { + const image = jpegLSDecode(pixelData, signed) + + // throw error if not success or too much data + if (image.result !== 0 && image.result !== 6) { + throw new Error('JPEG-LS decoder failed to decode frame (error code ' + image.result + ')') + } - var imageFrame = {}; - imageFrame.columns = image.width; - imageFrame.rows = image.height; - imageFrame.pixelData = image.pixelData; + const imageFrame = {} + imageFrame.columns = image.width + imageFrame.rows = image.height + imageFrame.pixelData = image.pixelData - return imageFrame; - } + return imageFrame + } - return constructor; -}()); -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = JpegLS; -} \ No newline at end of file + return constructor +})() diff --git a/lib/jpx.js b/lib/jpx.js deleted file mode 100755 index 2a8cc40..0000000 --- a/lib/jpx.js +++ /dev/null @@ -1,4051 +0,0 @@ -/*! image-JPEG2000 - v0.3.1 - 2015-08-26 | https://github.com/OHIF/image-JPEG2000 */ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals ArithmeticDecoder, globalScope, log2, readUint16, readUint32, - info, warn */ - -'use strict'; - -var JpxImage = (function JpxImageClosure() { - // Table E.1 - var SubbandsGainLog2 = { - 'LL': 0, - 'LH': 1, - 'HL': 1, - 'HH': 2 - }; - function JpxImage() { - this.failOnCorruptedImage = false; - } - JpxImage.prototype = { - parse: function JpxImage_parse(data) { - - var head = readUint16(data, 0); - // No box header, immediate start of codestream (SOC) - if (head === 0xFF4F) { - this.parseCodestream(data, 0, data.length); - return; - } - - var position = 0, length = data.length; - while (position < length) { - var headerSize = 8; - var lbox = readUint32(data, position); - var tbox = readUint32(data, position + 4); - position += headerSize; - if (lbox === 1) { - // XLBox: read UInt64 according to spec. - // JavaScript's int precision of 53 bit should be sufficient here. - lbox = readUint32(data, position) * 4294967296 + - readUint32(data, position + 4); - position += 8; - headerSize += 8; - } - if (lbox === 0) { - lbox = length - position + headerSize; - } - if (lbox < headerSize) { - throw new Error('JPX Error: Invalid box field size'); - } - var dataLength = lbox - headerSize; - var jumpDataLength = true; - switch (tbox) { - case 0x6A703268: // 'jp2h' - jumpDataLength = false; // parsing child boxes - break; - case 0x636F6C72: // 'colr' - // Colorspaces are not used, the CS from the PDF is used. - var method = data[position]; - var precedence = data[position + 1]; - var approximation = data[position + 2]; - if (method === 1) { - // enumerated colorspace - var colorspace = readUint32(data, position + 3); - switch (colorspace) { - case 16: // this indicates a sRGB colorspace - case 17: // this indicates a grayscale colorspace - case 18: // this indicates a YUV colorspace - break; - default: - warn('Unknown colorspace ' + colorspace); - break; - } - } else if (method === 2) { - info('ICC profile not supported'); - } - break; - case 0x6A703263: // 'jp2c' - this.parseCodestream(data, position, position + dataLength); - break; - case 0x6A502020: // 'jP\024\024' - if (0x0d0a870a !== readUint32(data, position)) { - warn('Invalid JP2 signature'); - } - break; - // The following header types are valid but currently not used: - case 0x6A501A1A: // 'jP\032\032' - case 0x66747970: // 'ftyp' - case 0x72726571: // 'rreq' - case 0x72657320: // 'res ' - case 0x69686472: // 'ihdr' - break; - default: - var headerType = String.fromCharCode((tbox >> 24) & 0xFF, - (tbox >> 16) & 0xFF, - (tbox >> 8) & 0xFF, - tbox & 0xFF); - warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); - break; - } - if (jumpDataLength) { - position += dataLength; - } - } - }, - parseImageProperties: function JpxImage_parseImageProperties(stream) { - var newByte = stream.getByte(); - while (newByte >= 0) { - var oldByte = newByte; - newByte = stream.getByte(); - var code = (oldByte << 8) | newByte; - // Image and tile size (SIZ) - if (code === 0xFF51) { - stream.skip(4); - var Xsiz = stream.getInt32() >>> 0; // Byte 4 - var Ysiz = stream.getInt32() >>> 0; // Byte 8 - var XOsiz = stream.getInt32() >>> 0; // Byte 12 - var YOsiz = stream.getInt32() >>> 0; // Byte 16 - stream.skip(16); - var Csiz = stream.getUint16(); // Byte 36 - this.width = Xsiz - XOsiz; - this.height = Ysiz - YOsiz; - this.componentsCount = Csiz; - // Results are always returned as Uint8Arrays - this.bitsPerComponent = 8; - return; - } - } - throw new Error('JPX Error: No size marker found in JPX stream'); - }, - parseCodestream: function JpxImage_parseCodestream(data, start, end) { - var context = {}; - try { - var doNotRecover = false; - var position = start; - while (position + 1 < end) { - var code = readUint16(data, position); - position += 2; - - var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; - switch (code) { - case 0xFF4F: // Start of codestream (SOC) - context.mainHeader = true; - break; - case 0xFFD9: // End of codestream (EOC) - break; - case 0xFF51: // Image and tile size (SIZ) - length = readUint16(data, position); - var siz = {}; - siz.Xsiz = readUint32(data, position + 4); - siz.Ysiz = readUint32(data, position + 8); - siz.XOsiz = readUint32(data, position + 12); - siz.YOsiz = readUint32(data, position + 16); - siz.XTsiz = readUint32(data, position + 20); - siz.YTsiz = readUint32(data, position + 24); - siz.XTOsiz = readUint32(data, position + 28); - siz.YTOsiz = readUint32(data, position + 32); - var componentsCount = readUint16(data, position + 36); - siz.Csiz = componentsCount; - var components = []; - j = position + 38; - for (var i = 0; i < componentsCount; i++) { - var component = { - precision: (data[j] & 0x7F) + 1, - isSigned: !!(data[j] & 0x80), - XRsiz: data[j + 1], - YRsiz: data[j + 1] - }; - calculateComponentDimensions(component, siz); - components.push(component); - } - context.SIZ = siz; - context.components = components; - calculateTileGrids(context, components); - context.QCC = []; - context.COC = []; - break; - case 0xFF5C: // Quantization default (QCD) - length = readUint16(data, position); - var qcd = {}; - j = position + 2; - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcd.noQuantization = (spqcdSize === 8); - qcd.scalarExpounded = scalarExpounded; - qcd.guardBits = sqcd >> 5; - spqcds = []; - while (j < length + position) { - var spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcd.SPqcds = spqcds; - if (context.mainHeader) { - context.QCD = qcd; - } else { - context.currentTile.QCD = qcd; - context.currentTile.QCC = []; - } - break; - case 0xFF5D: // Quantization component (QCC) - length = readUint16(data, position); - var qcc = {}; - j = position + 2; - var cqcc; - if (context.SIZ.Csiz < 257) { - cqcc = data[j++]; - } else { - cqcc = readUint16(data, j); - j += 2; - } - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcc.noQuantization = (spqcdSize === 8); - qcc.scalarExpounded = scalarExpounded; - qcc.guardBits = sqcd >> 5; - spqcds = []; - while (j < (length + position)) { - spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcc.SPqcds = spqcds; - if (context.mainHeader) { - context.QCC[cqcc] = qcc; - } else { - context.currentTile.QCC[cqcc] = qcc; - } - break; - case 0xFF52: // Coding style default (COD) - length = readUint16(data, position); - var cod = {}; - j = position + 2; - var scod = data[j++]; - cod.entropyCoderWithCustomPrecincts = !!(scod & 1); - cod.sopMarkerUsed = !!(scod & 2); - cod.ephMarkerUsed = !!(scod & 4); - cod.progressionOrder = data[j++]; - cod.layersCount = readUint16(data, j); - j += 2; - cod.multipleComponentTransform = data[j++]; - - cod.decompositionLevelsCount = data[j++]; - cod.xcb = (data[j++] & 0xF) + 2; - cod.ycb = (data[j++] & 0xF) + 2; - var blockStyle = data[j++]; - cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); - cod.resetContextProbabilities = !!(blockStyle & 2); - cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); - cod.predictableTermination = !!(blockStyle & 16); - cod.segmentationSymbolUsed = !!(blockStyle & 32); - cod.reversibleTransformation = data[j++]; - if (cod.entropyCoderWithCustomPrecincts) { - var precinctsSizes = []; - while (j < length + position) { - var precinctsSize = data[j++]; - precinctsSizes.push({ - PPx: precinctsSize & 0xF, - PPy: precinctsSize >> 4 - }); - } - cod.precinctsSizes = precinctsSizes; - } - var unsupported = []; - if (cod.selectiveArithmeticCodingBypass) { - unsupported.push('selectiveArithmeticCodingBypass'); - } - if (cod.resetContextProbabilities) { - unsupported.push('resetContextProbabilities'); - } - if (cod.terminationOnEachCodingPass) { - unsupported.push('terminationOnEachCodingPass'); - } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); - } - if (cod.predictableTermination) { - unsupported.push('predictableTermination'); - } - if (unsupported.length > 0) { - doNotRecover = true; - throw new Error('JPX Error: Unsupported COD options (' + - unsupported.join(', ') + ')'); - } - if (context.mainHeader) { - context.COD = cod; - } else { - context.currentTile.COD = cod; - context.currentTile.COC = []; - } - break; - case 0xFF90: // Start of tile-part (SOT) - length = readUint16(data, position); - tile = {}; - tile.index = readUint16(data, position + 2); - tile.length = readUint32(data, position + 4); - tile.dataEnd = tile.length + position - 2; - tile.partIndex = data[position + 8]; - tile.partsCount = data[position + 9]; - - context.mainHeader = false; - if (tile.partIndex === 0) { - // reset component specific settings - tile.COD = context.COD; - tile.COC = context.COC.slice(0); // clone of the global COC - tile.QCD = context.QCD; - tile.QCC = context.QCC.slice(0); // clone of the global COC - } - context.currentTile = tile; - break; - case 0xFF93: // Start of data (SOD) - tile = context.currentTile; - if (tile.partIndex === 0) { - initializeTile(context, tile.index); - buildPackets(context); - } - - // moving to the end of the data - length = tile.dataEnd - position; - parseTilePackets(context, data, position, length); - break; - case 0xFF55: // Tile-part lengths, main header (TLM) - case 0xFF57: // Packet length, main header (PLM) - case 0xFF58: // Packet length, tile-part header (PLT) - case 0xFF64: // Comment (COM) - length = readUint16(data, position); - // skipping content - break; - case 0xFF53: // Coding style component (COC) - throw new Error('JPX Error: Codestream code 0xFF53 (COC) is ' + - 'not implemented'); - default: - throw new Error('JPX Error: Unknown codestream code: ' + - code.toString(16)); - } - position += length; - } - } catch (e) { - if (doNotRecover || this.failOnCorruptedImage) { - throw e; - } else { - warn('Trying to recover from ' + e.message); - } - } - this.tiles = transformComponents(context); - this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; - this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; - this.componentsCount = context.SIZ.Csiz; - } - }; - function calculateComponentDimensions(component, siz) { - // Section B.2 Component mapping - component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); - component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); - component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); - component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); - component.width = component.x1 - component.x0; - component.height = component.y1 - component.y0; - } - function calculateTileGrids(context, components) { - var siz = context.SIZ; - // Section B.3 Division into tile and tile-components - var tile, tiles = []; - var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); - var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); - for (var q = 0; q < numYtiles; q++) { - for (var p = 0; p < numXtiles; p++) { - tile = {}; - tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); - tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); - tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); - tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); - tile.width = tile.tx1 - tile.tx0; - tile.height = tile.ty1 - tile.ty0; - tile.components = []; - tiles.push(tile); - } - } - context.tiles = tiles; - - var componentsCount = siz.Csiz; - for (var i = 0, ii = componentsCount; i < ii; i++) { - var component = components[i]; - for (var j = 0, jj = tiles.length; j < jj; j++) { - var tileComponent = {}; - tile = tiles[j]; - tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); - tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); - tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); - tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); - tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; - tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; - tile.components[i] = tileComponent; - } - } - } - function getBlocksDimensions(context, component, r) { - var codOrCoc = component.codingStyleParameters; - var result = {}; - if (!codOrCoc.entropyCoderWithCustomPrecincts) { - result.PPx = 15; - result.PPy = 15; - } else { - result.PPx = codOrCoc.precinctsSizes[r].PPx; - result.PPy = codOrCoc.precinctsSizes[r].PPy; - } - // calculate codeblock size as described in section B.7 - result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : - Math.min(codOrCoc.xcb, result.PPx)); - result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : - Math.min(codOrCoc.ycb, result.PPy)); - return result; - } - function buildPrecincts(context, resolution, dimensions) { - // Section B.6 Division resolution to precincts - var precinctWidth = 1 << dimensions.PPx; - var precinctHeight = 1 << dimensions.PPy; - // Jasper introduces codeblock groups for mapping each subband codeblocks - // to precincts. Precinct partition divides a resolution according to width - // and height parameters. The subband that belongs to the resolution level - // has a different size than the level, unless it is the zero resolution. - - // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding: - // The precinct partitioning for a particular subband is derived from a - // partitioning of its parent LL band (i.e., the LL band at the next higher - // resolution level)... The LL band associated with each resolution level is - // divided into precincts... Each of the resulting precinct regions is then - // mapped into its child subbands (if any) at the next lower resolution - // level. This is accomplished by using the coordinate transformation - // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the - // coordinates of a point in the LL band and child subband, respectively. - var isZeroRes = resolution.resLevel === 0; - var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); - var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1)); - var numprecinctswide = (resolution.trx1 > resolution.trx0 ? - Math.ceil(resolution.trx1 / precinctWidth) - - Math.floor(resolution.trx0 / precinctWidth) : 0); - var numprecinctshigh = (resolution.try1 > resolution.try0 ? - Math.ceil(resolution.try1 / precinctHeight) - - Math.floor(resolution.try0 / precinctHeight) : 0); - var numprecincts = numprecinctswide * numprecinctshigh; - - resolution.precinctParameters = { - precinctWidth: precinctWidth, - precinctHeight: precinctHeight, - numprecinctswide: numprecinctswide, - numprecinctshigh: numprecinctshigh, - numprecincts: numprecincts, - precinctWidthInSubband: precinctWidthInSubband, - precinctHeightInSubband: precinctHeightInSubband - }; - } - function buildCodeblocks(context, subband, dimensions) { - // Section B.7 Division sub-band into code-blocks - var xcb_ = dimensions.xcb_; - var ycb_ = dimensions.ycb_; - var codeblockWidth = 1 << xcb_; - var codeblockHeight = 1 << ycb_; - var cbx0 = subband.tbx0 >> xcb_; - var cby0 = subband.tby0 >> ycb_; - var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_; - var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_; - var precinctParameters = subband.resolution.precinctParameters; - var codeblocks = []; - var precincts = []; - var i, j, codeblock, precinctNumber; - for (j = cby0; j < cby1; j++) { - for (i = cbx0; i < cbx1; i++) { - codeblock = { - cbx: i, - cby: j, - tbx0: codeblockWidth * i, - tby0: codeblockHeight * j, - tbx1: codeblockWidth * (i + 1), - tby1: codeblockHeight * (j + 1) - }; - - codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); - codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); - codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); - codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); - - // Calculate precinct number for this codeblock, codeblock position - // should be relative to its subband, use actual dimension and position - // See comment about codeblock group width and height - var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / - precinctParameters.precinctWidthInSubband); - var pj = Math.floor((codeblock.tby0_ - subband.tby0) / - precinctParameters.precinctHeightInSubband); - precinctNumber = pi + (pj * precinctParameters.numprecinctswide); - - codeblock.precinctNumber = precinctNumber; - codeblock.subbandType = subband.type; - codeblock.Lblock = 3; - - if (codeblock.tbx1_ <= codeblock.tbx0_ || - codeblock.tby1_ <= codeblock.tby0_) { - continue; - } - codeblocks.push(codeblock); - // building precinct for the sub-band - var precinct = precincts[precinctNumber]; - if (precinct !== undefined) { - if (i < precinct.cbxMin) { - precinct.cbxMin = i; - } else if (i > precinct.cbxMax) { - precinct.cbxMax = i; - } - if (j < precinct.cbyMin) { - precinct.cbxMin = j; - } else if (j > precinct.cbyMax) { - precinct.cbyMax = j; - } - } else { - precincts[precinctNumber] = precinct = { - cbxMin: i, - cbyMin: j, - cbxMax: i, - cbyMax: j - }; - } - codeblock.precinct = precinct; - } - } - subband.codeblockParameters = { - codeblockWidth: xcb_, - codeblockHeight: ycb_, - numcodeblockwide: cbx1 - cbx0 + 1, - numcodeblockhigh: cby1 - cby0 + 1 - }; - subband.codeblocks = codeblocks; - subband.precincts = precincts; - } - function createPacket(resolution, precinctNumber, layerNumber) { - var precinctCodeblocks = []; - // Section B.10.8 Order of info in packet - var subbands = resolution.subbands; - // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence - for (var i = 0, ii = subbands.length; i < ii; i++) { - var subband = subbands[i]; - var codeblocks = subband.codeblocks; - for (var j = 0, jj = codeblocks.length; j < jj; j++) { - var codeblock = codeblocks[j]; - if (codeblock.precinctNumber !== precinctNumber) { - continue; - } - precinctCodeblocks.push(codeblock); - } - } - return { - layerNumber: layerNumber, - codeblocks: precinctCodeblocks - }; - } - function LayerResolutionComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var l = 0, r = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.1 Layer-resolution-component-position - for (; l < layersCount; l++) { - for (; r <= maxDecompositionLevelsCount; r++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - r = 0; - } - }; - } - function ResolutionLayerComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var r = 0, l = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.2 Resolution-layer-component-position - for (; r <= maxDecompositionLevelsCount; r++) { - for (; l < layersCount; l++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - l = 0; - } - }; - } - function ResolutionPositionComponentLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var l, r, c, p; - var maxDecompositionLevelsCount = 0; - for (c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - component.codingStyleParameters.decompositionLevelsCount); - } - var maxNumPrecinctsInLevel = new Int32Array( - maxDecompositionLevelsCount + 1); - for (r = 0; r <= maxDecompositionLevelsCount; ++r) { - var maxNumPrecincts = 0; - for (c = 0; c < componentsCount; ++c) { - var resolutions = tile.components[c].resolutions; - if (r < resolutions.length) { - maxNumPrecincts = Math.max(maxNumPrecincts, - resolutions[r].precinctParameters.numprecincts); - } - } - maxNumPrecinctsInLevel[r] = maxNumPrecincts; - } - l = 0; - r = 0; - c = 0; - p = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.3 Resolution-position-component-layer - for (; r <= maxDecompositionLevelsCount; r++) { - for (; p < maxNumPrecinctsInLevel[r]; p++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - if (p >= numprecincts) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, p, l); - l++; - return packet; - } - l = 0; - } - c = 0; - } - p = 0; - } - }; - } - function PositionComponentResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var precinctsIterationSizes = precinctsSizes; - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.4 Position-component-resolution-layer - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = - precinctsSizes.components[c].resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - c = 0; - } - px = 0; - } - }; - } - function ComponentPositionResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.5 Component-position-resolution-layer - for (; c < componentsCount; ++c) { - var component = tile.components[c]; - var precinctsIterationSizes = precinctsSizes.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = precinctsIterationSizes.resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - px = 0; - } - py = 0; - } - }; - } - function getPrecinctIndexIfExist( - pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { - var posX = pxIndex * precinctIterationSizes.minWidth; - var posY = pyIndex * precinctIterationSizes.minHeight; - if (posX % sizeInImageScale.width !== 0 || - posY % sizeInImageScale.height !== 0) { - return null; - } - var startPrecinctRowIndex = - (posY / sizeInImageScale.width) * - resolution.precinctParameters.numprecinctswide; - return (posX / sizeInImageScale.height) + startPrecinctRowIndex; - } - function getPrecinctSizesInImageScale(tile) { - var componentsCount = tile.components.length; - var minWidth = Number.MAX_VALUE; - var minHeight = Number.MAX_VALUE; - var maxNumWide = 0; - var maxNumHigh = 0; - var sizePerComponent = new Array(componentsCount); - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - var sizePerResolution = new Array(decompositionLevelsCount + 1); - var minWidthCurrentComponent = Number.MAX_VALUE; - var minHeightCurrentComponent = Number.MAX_VALUE; - var maxNumWideCurrentComponent = 0; - var maxNumHighCurrentComponent = 0; - var scale = 1; - for (var r = decompositionLevelsCount; r >= 0; --r) { - var resolution = component.resolutions[r]; - var widthCurrentResolution = - scale * resolution.precinctParameters.precinctWidth; - var heightCurrentResolution = - scale * resolution.precinctParameters.precinctHeight; - minWidthCurrentComponent = Math.min( - minWidthCurrentComponent, - widthCurrentResolution); - minHeightCurrentComponent = Math.min( - minHeightCurrentComponent, - heightCurrentResolution); - maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, - resolution.precinctParameters.numprecinctswide); - maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, - resolution.precinctParameters.numprecinctshigh); - sizePerResolution[r] = { - width: widthCurrentResolution, - height: heightCurrentResolution - }; - scale <<= 1; - } - minWidth = Math.min(minWidth, minWidthCurrentComponent); - minHeight = Math.min(minHeight, minHeightCurrentComponent); - maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); - maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); - sizePerComponent[c] = { - resolutions: sizePerResolution, - minWidth: minWidthCurrentComponent, - minHeight: minHeightCurrentComponent, - maxNumWide: maxNumWideCurrentComponent, - maxNumHigh: maxNumHighCurrentComponent - }; - } - return { - components: sizePerComponent, - minWidth: minWidth, - minHeight: minHeight, - maxNumWide: maxNumWide, - maxNumHigh: maxNumHigh - }; - } - function buildPackets(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var componentsCount = siz.Csiz; - // Creating resolutions and sub-bands for each component - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - // Section B.5 Resolution levels and sub-bands - var resolutions = []; - var subbands = []; - for (var r = 0; r <= decompositionLevelsCount; r++) { - var blocksDimensions = getBlocksDimensions(context, component, r); - var resolution = {}; - var scale = 1 << (decompositionLevelsCount - r); - resolution.trx0 = Math.ceil(component.tcx0 / scale); - resolution.try0 = Math.ceil(component.tcy0 / scale); - resolution.trx1 = Math.ceil(component.tcx1 / scale); - resolution.try1 = Math.ceil(component.tcy1 / scale); - resolution.resLevel = r; - buildPrecincts(context, resolution, blocksDimensions); - resolutions.push(resolution); - - var subband; - if (r === 0) { - // one sub-band (LL) with last decomposition - subband = {}; - subband.type = 'LL'; - subband.tbx0 = Math.ceil(component.tcx0 / scale); - subband.tby0 = Math.ceil(component.tcy0 / scale); - subband.tbx1 = Math.ceil(component.tcx1 / scale); - subband.tby1 = Math.ceil(component.tcy1 / scale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolution.subbands = [subband]; - } else { - var bscale = 1 << (decompositionLevelsCount - r + 1); - var resolutionSubbands = []; - // three sub-bands (HL, LH and HH) with rest of decompositions - subband = {}; - subband.type = 'HL'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'LH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'HH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - resolution.subbands = resolutionSubbands; - } - } - component.resolutions = resolutions; - component.subbands = subbands; - } - // Generate the packets sequence - var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; - switch (progressionOrder) { - case 0: - tile.packetsIterator = - new LayerResolutionComponentPositionIterator(context); - break; - case 1: - tile.packetsIterator = - new ResolutionLayerComponentPositionIterator(context); - break; - case 2: - tile.packetsIterator = - new ResolutionPositionComponentLayerIterator(context); - break; - case 3: - tile.packetsIterator = - new PositionComponentResolutionLayerIterator(context); - break; - case 4: - tile.packetsIterator = - new ComponentPositionResolutionLayerIterator(context); - break; - default: - throw new Error('JPX Error: Unsupported progression order ' + - progressionOrder); - } - } - function parseTilePackets(context, data, offset, dataLength) { - var position = 0; - var buffer, bufferSize = 0, skipNextBit = false; - function readBits(count) { - while (bufferSize < count) { - if(offset + position >= data.length){ - throw new Error("Unexpected EOF"); - } - var b = data[offset + position]; - position++; - if (skipNextBit) { - buffer = (buffer << 7) | b; - bufferSize += 7; - skipNextBit = false; - } else { - buffer = (buffer << 8) | b; - bufferSize += 8; - } - if (b === 0xFF) { - skipNextBit = true; - } - } - bufferSize -= count; - return (buffer >>> bufferSize) & ((1 << count) - 1); - } - function skipMarkerIfEqual(value) { - if (data[offset + position - 1] === 0xFF && - data[offset + position] === value) { - skipBytes(1); - return true; - } else if (data[offset + position] === 0xFF && - data[offset + position + 1] === value) { - skipBytes(2); - return true; - } - return false; - } - function skipBytes(count) { - position += count; - } - function alignToByte() { - bufferSize = 0; - if (skipNextBit) { - position++; - skipNextBit = false; - } - } - function readCodingpasses() { - if (readBits(1) === 0) { - return 1; - } - if (readBits(1) === 0) { - return 2; - } - var value = readBits(2); - if (value < 3) { - return value + 3; - } - value = readBits(5); - if (value < 31) { - return value + 6; - } - value = readBits(7); - return value + 37; - } - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var sopMarkerUsed = context.COD.sopMarkerUsed; - var ephMarkerUsed = context.COD.ephMarkerUsed; - var packetsIterator = tile.packetsIterator; - while (position < dataLength) { - try{ - alignToByte(); - if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { - // Skip also marker segment length and packet sequence ID - skipBytes(4); - } - var packet = packetsIterator.nextPacket(); - if (packet === undefined) { - //No more packets. Stream is probably truncated. - return; - } - if (!readBits(1)) { - continue; - } - var layerNumber = packet.layerNumber; - var queue = [], codeblock; - for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { - codeblock = packet.codeblocks[i]; - var precinct = codeblock.precinct; - var codeblockColumn = codeblock.cbx - precinct.cbxMin; - var codeblockRow = codeblock.cby - precinct.cbyMin; - var codeblockIncluded = false; - var firstTimeInclusion = false; - var valueReady; - if (codeblock['included'] !== undefined) { - codeblockIncluded = !!readBits(1); - } else { - // reading inclusion tree - precinct = codeblock.precinct; - var inclusionTree, zeroBitPlanesTree; - if (precinct['inclusionTree'] !== undefined) { - inclusionTree = precinct.inclusionTree; - } else { - // building inclusion and zero bit-planes trees - var width = precinct.cbxMax - precinct.cbxMin + 1; - var height = precinct.cbyMax - precinct.cbyMin + 1; - inclusionTree = new InclusionTree(width, height); - zeroBitPlanesTree = new TagTree(width, height); - precinct.inclusionTree = inclusionTree; - precinct.zeroBitPlanesTree = zeroBitPlanesTree; - } - - inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber); - while (true) { - if (position >= data.length) { - return; - } - if (inclusionTree.isAboveThreshold()){ - break; - } - if (inclusionTree.isKnown()) { - inclusionTree.nextLevel(); - continue; - } - if (readBits(1)) { - inclusionTree.setKnown(); - if (inclusionTree.isLeaf()) { - codeblock.included = true; - codeblockIncluded = firstTimeInclusion = true; - break; - } else { - inclusionTree.nextLevel(); - } - } else { - inclusionTree.incrementValue(); - } - } - } - if (!codeblockIncluded) { - continue; - } - if (firstTimeInclusion) { - zeroBitPlanesTree = precinct.zeroBitPlanesTree; - zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); - while (true) { - if (position >= data.length) { - return; - } - if (readBits(1)) { - valueReady = !zeroBitPlanesTree.nextLevel(); - if (valueReady) { - break; - } - } else { - zeroBitPlanesTree.incrementValue(); - } - } - codeblock.zeroBitPlanes = zeroBitPlanesTree.value; - } - var codingpasses = readCodingpasses(); - while (readBits(1)) { - codeblock.Lblock++; - } - var codingpassesLog2 = log2(codingpasses); - // rounding down log2 - var bits = ((codingpasses < (1 << codingpassesLog2)) ? - codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; - var codedDataLength = readBits(bits); - queue.push({ - codeblock: codeblock, - codingpasses: codingpasses, - dataLength: codedDataLength - }); - } - alignToByte(); - if (ephMarkerUsed) { - skipMarkerIfEqual(0x92); - } - while (queue.length > 0) { - var packetItem = queue.shift(); - codeblock = packetItem.codeblock; - if (codeblock['data'] === undefined) { - codeblock.data = []; - } - codeblock.data.push({ - data: data, - start: offset + position, - end: offset + position + packetItem.dataLength, - codingpasses: packetItem.codingpasses - }); - position += packetItem.dataLength; - } - } catch (e) { - return; - } - } - return position; - } - function copyCoefficients(coefficients, levelWidth, levelHeight, subband, - delta, mb, reversible, segmentationSymbolUsed) { - var x0 = subband.tbx0; - var y0 = subband.tby0; - var width = subband.tbx1 - subband.tbx0; - var codeblocks = subband.codeblocks; - var right = subband.type.charAt(0) === 'H' ? 1 : 0; - var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; - - for (var i = 0, ii = codeblocks.length; i < ii; ++i) { - var codeblock = codeblocks[i]; - var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; - var blockHeight = codeblock.tby1_ - codeblock.tby0_; - if (blockWidth === 0 || blockHeight === 0) { - continue; - } - if (codeblock['data'] === undefined) { - continue; - } - - var bitModel, currentCodingpassType; - bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, - codeblock.zeroBitPlanes, mb); - currentCodingpassType = 2; // first bit plane starts from cleanup - - // collect data - var data = codeblock.data, totalLength = 0, codingpasses = 0; - var j, jj, dataItem; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - totalLength += dataItem.end - dataItem.start; - codingpasses += dataItem.codingpasses; - } - var encodedData = new Int16Array(totalLength); - var position = 0; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); - encodedData.set(chunk, position); - position += chunk.length; - } - // decoding the item - var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); - bitModel.setDecoder(decoder); - - for (j = 0; j < codingpasses; j++) { - switch (currentCodingpassType) { - case 0: - bitModel.runSignificancePropogationPass(); - break; - case 1: - bitModel.runMagnitudeRefinementPass(); - break; - case 2: - bitModel.runCleanupPass(); - if (segmentationSymbolUsed) { - bitModel.checkSegmentationSymbol(); - } - break; - } - currentCodingpassType = (currentCodingpassType + 1) % 3; - } - - var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width; - var sign = bitModel.coefficentsSign; - var magnitude = bitModel.coefficentsMagnitude; - var bitsDecoded = bitModel.bitsDecoded; - var magnitudeCorrection = reversible ? 0 : 0.5; - var k, n, nb; - position = 0; - // Do the interleaving of Section F.3.3 here, so we do not need - // to copy later. LL level is not interleaved, just copied. - var interleave = (subband.type !== 'LL'); - for (j = 0; j < blockHeight; j++) { - var row = (offset / width) | 0; // row in the non-interleaved subband - var levelOffset = 2 * row * (levelWidth - width) + right + bottom; - for (k = 0; k < blockWidth; k++) { - n = magnitude[position]; - if (n !== 0) { - n = (n + magnitudeCorrection) * delta; - if (sign[position] !== 0) { - n = -n; - } - nb = bitsDecoded[position]; - var pos = interleave ? (levelOffset + (offset << 1)) : offset; - if (reversible && (nb >= mb)) { - coefficients[pos] = n; - } else { - coefficients[pos] = n * (1 << (mb - nb)); - } - } - offset++; - position++; - } - offset += width - blockWidth; - } - } - } - function transformTile(context, tile, c) { - var component = tile.components[c]; - var codingStyleParameters = component.codingStyleParameters; - var quantizationParameters = component.quantizationParameters; - var decompositionLevelsCount = - codingStyleParameters.decompositionLevelsCount; - var spqcds = quantizationParameters.SPqcds; - var scalarExpounded = quantizationParameters.scalarExpounded; - var guardBits = quantizationParameters.guardBits; - var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; - var precision = context.components[c].precision; - - var reversible = codingStyleParameters.reversibleTransformation; - var transform = (reversible ? new ReversibleTransform() : - new IrreversibleTransform()); - - var subbandCoefficients = []; - var b = 0; - for (var i = 0; i <= decompositionLevelsCount; i++) { - var resolution = component.resolutions[i]; - - var width = resolution.trx1 - resolution.trx0; - var height = resolution.try1 - resolution.try0; - // Allocate space for the whole sublevel. - var coefficients = new Float32Array(width * height); - - for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { - var mu, epsilon; - if (!scalarExpounded) { - // formula E-5 - mu = spqcds[0].mu; - epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); - } else { - mu = spqcds[b].mu; - epsilon = spqcds[b].epsilon; - b++; - } - - var subband = resolution.subbands[j]; - var gainLog2 = SubbandsGainLog2[subband.type]; - - // calulate quantization coefficient (Section E.1.1.1) - var delta = (reversible ? 1 : - Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); - var mb = (guardBits + epsilon - 1); - - // In the first resolution level, copyCoefficients will fill the - // whole array with coefficients. In the succeding passes, - // copyCoefficients will consecutively fill in the values that belong - // to the interleaved positions of the HL, LH, and HH coefficients. - // The LL coefficients will then be interleaved in Transform.iterate(). - copyCoefficients(coefficients, width, height, subband, delta, mb, - reversible, segmentationSymbolUsed); - } - subbandCoefficients.push({ - width: width, - height: height, - items: coefficients - }); - } - - var result = transform.calculate(subbandCoefficients, - component.tcx0, component.tcy0); - return { - left: component.tcx0, - top: component.tcy0, - width: result.width, - height: result.height, - items: result.items - }; - } - function transformComponents(context) { - var siz = context.SIZ; - var components = context.components; - var componentsCount = siz.Csiz; - var resultImages = []; - for (var i = 0, ii = context.tiles.length; i < ii; i++) { - var tile = context.tiles[i]; - var transformedTiles = []; - var c; - for (c = 0; c < componentsCount; c++) { - transformedTiles[c] = transformTile(context, tile, c); - } - var tile0 = transformedTiles[0]; - var isSigned = components[0].isSigned; - if (isSigned) { - var out = new Int16Array(tile0.items.length * componentsCount); - } else { - var out = new Uint16Array(tile0.items.length * componentsCount); - } - var result = { - left: tile0.left, - top: tile0.top, - width: tile0.width, - height: tile0.height, - items: out - }; - - // Section G.2.2 Inverse multi component transform - var shift, offset, max, min, maxK; - var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; - if (tile.codingStyleDefaultParameters.multipleComponentTransform) { - var fourComponents = componentsCount === 4; - var y0items = transformedTiles[0].items; - var y1items = transformedTiles[1].items; - var y2items = transformedTiles[2].items; - var y3items = fourComponents ? transformedTiles[3].items : null; - - // HACK: The multiple component transform formulas below assume that - // all components have the same precision. With this in mind, we - // compute shift and offset only once. - shift = components[0].precision - 8; - offset = (128 << shift) + 0.5; - max = 255 * (1 << shift); - maxK = max * 0.5; - min = -maxK; - - var component0 = tile.components[0]; - var alpha01 = componentsCount - 3; - jj = y0items.length; - if (!component0.codingStyleParameters.reversibleTransformation) { - // inverse irreversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - r = y0 + 1.402 * y2; - g = y0 - 0.34413 * y1 - 0.71414 * y2; - b = y0 + 1.772 * y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } else { - // inverse reversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - g = y0 - ((y2 + y1) >> 2); - r = g + y2; - b = g + y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } - if (fourComponents) { - for (j = 0, pos = 3; j < jj; j++, pos += 4) { - k = y3items[j]; - out[pos] = k <= min ? 0 : k >= maxK ? 255 : (k + offset) >> shift; - } - } - } else { // no multi-component transform - for (c = 0; c < componentsCount; c++) { - if (components[c].precision === 8){ - var items = transformedTiles[c].items; - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - max = (127.5 * (1 << shift)); - min = -max; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = val <= min ? 0 : - val >= max ? 255 : (val + offset) >> shift; - pos += componentsCount; - } - }else{ - var isSigned = components[c].isSigned; - var items = transformedTiles[c].items; - - if(isSigned){ - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - out[pos] = items[j]; - pos += componentsCount; - } - }else{ - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - var precisionMax = Math.pow(2,components[c].precision)-1; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = Math.max(Math.min((val + offset),precisionMax),0); - pos += componentsCount; - } - } - } - } - } - resultImages.push(result); - } - return resultImages; - } - function initializeTile(context, tileIndex) { - var siz = context.SIZ; - var componentsCount = siz.Csiz; - var tile = context.tiles[tileIndex]; - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ? - context.currentTile.QCC[c] : context.currentTile.QCD); - component.quantizationParameters = qcdOrQcc; - var codOrCoc = (context.currentTile.COC[c] !== undefined ? - context.currentTile.COC[c] : context.currentTile.COD); - component.codingStyleParameters = codOrCoc; - } - tile.codingStyleDefaultParameters = context.currentTile.COD; - } - - // Section B.10.2 Tag trees - var TagTree = (function TagTreeClosure() { - function TagTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var level = { - width: width, - height: height, - items: [] - }; - this.levels.push(level); - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - TagTree.prototype = { - reset: function TagTree_reset(i, j) { - var currentLevel = 0, value = 0, level; - while (currentLevel < this.levels.length) { - level = this.levels[currentLevel]; - var index = i + j * level.width; - if (level.items[index] !== undefined) { - value = level.items[index]; - break; - } - level.index = index; - i >>= 1; - j >>= 1; - currentLevel++; - } - currentLevel--; - level = this.levels[currentLevel]; - level.items[level.index] = value; - this.currentLevel = currentLevel; - delete this.value; - }, - incrementValue: function TagTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index]++; - }, - nextLevel: function TagTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - currentLevel--; - if (currentLevel < 0) { - this.value = value; - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return TagTree; - })(); - - var InclusionTree = (function InclusionTreeClosure() { - function InclusionTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var items = new Uint8Array(width * height); - var status = new Uint8Array(width * height); - for (var j = 0, jj = items.length; j < jj; j++) { - items[j] = 0; - status[j] = 0; - } - - var level = { - width: width, - height: height, - items: items, - status: status - }; - this.levels.push(level); - - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - InclusionTree.prototype = { - reset: function InclusionTree_reset(i, j, stopValue) { - this.currentStopValue = stopValue; - var currentLevel = 0; - while (currentLevel < this.levels.length) { - var level = this.levels[currentLevel]; - var index = i + j * level.width; - level.index = index; - - i >>= 1; - j >>= 1; - currentLevel++; - } - - this.currentLevel = this.levels.length - 1; - this.minValue =this.levels[this.currentLevel].items[0]; - return; - }, - incrementValue: function InclusionTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index] = level.items[level.index] + 1; - if(level.items[level.index] > this.minValue) { - this.minValue = level.items[level.index]; - } - }, - nextLevel: function InclusionTree_nextLevel() { - var currentLevel = this.currentLevel; - currentLevel--; - if (currentLevel < 0) { - return false; - } else { - this.currentLevel = currentLevel; - var level = this.levels[currentLevel]; - if(level.items[level.index] < this.minValue) { - level.items[level.index] = this.minValue; - }else if (level.items[level.index] > this.minValue) { - this.minValue = level.items[level.index]; - } - return true; - } - }, - isLeaf: function InclusionTree_isLeaf(){ - return (this.currentLevel === 0); - }, - isAboveThreshold: function InclusionTree_isAboveThreshold(){ - var levelindex = this.currentLevel; - var level = this.levels[levelindex]; - return (level.items[level.index] > this.currentStopValue); - }, - isKnown: function InclusionTree_isKnown(){ - var levelindex = this.currentLevel; - var level = this.levels[levelindex]; - return (level.status[level.index] > 0); - }, - setKnown: function InclusionTree_setKnown(){ - var levelindex = this.currentLevel; - var level = this.levels[levelindex]; - level.status[level.index] = 1; - return; - } - - }; - return InclusionTree; - })(); - - // Section D. Coefficient bit modeling - var BitModel = (function BitModelClosure() { - var UNIFORM_CONTEXT = 17; - var RUNLENGTH_CONTEXT = 18; - // Table D-1 - // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4), - // vv - sum of Vi (0..2), and hh - sum of Hi (0..2) - var LLAndLHContextsLabel = new Uint8Array([ - 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, - 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, - 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8 - ]); - var HLContextLabel = new Uint8Array([ - 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, - 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, - 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8 - ]); - var HHContextLabel = new Uint8Array([ - 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, - 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, - 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8 - ]); - - function BitModel(width, height, subband, zeroBitPlanes, mb) { - this.width = width; - this.height = height; - - this.contextLabelTable = (subband === 'HH' ? HHContextLabel : - (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel)); - - var coefficientCount = width * height; - - // coefficients outside the encoding region treated as insignificant - // add border state cells for significanceState - this.neighborsSignificance = new Uint8Array(coefficientCount); - this.coefficentsSign = new Uint8Array(coefficientCount); - this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : - mb > 6 ? new Uint16Array(coefficientCount) : - new Uint8Array(coefficientCount); - this.processingFlags = new Uint8Array(coefficientCount); - - var bitsDecoded = new Uint8Array(coefficientCount); - if (zeroBitPlanes !== 0) { - for (var i = 0; i < coefficientCount; i++) { - bitsDecoded[i] = zeroBitPlanes; - } - } - this.bitsDecoded = bitsDecoded; - - this.reset(); - } - - BitModel.prototype = { - setDecoder: function BitModel_setDecoder(decoder) { - this.decoder = decoder; - }, - reset: function BitModel_reset() { - // We have 17 contexts that are accessed via context labels, - // plus the uniform and runlength context. - this.contexts = new Int8Array(19); - - // Contexts are packed into 1 byte: - // highest 7 bits carry the index, lowest bit carries mps - this.contexts[0] = (4 << 1) | 0; - this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0; - this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0; - }, - setNeighborsSignificance: - function BitModel_setNeighborsSignificance(row, column, index) { - var neighborsSignificance = this.neighborsSignificance; - var width = this.width, height = this.height; - var left = (column > 0); - var right = (column + 1 < width); - var i; - - if (row > 0) { - i = index - width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (row + 1 < height) { - i = index + width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (left) { - neighborsSignificance[index - 1] += 0x01; - } - if (right) { - neighborsSignificance[index + 1] += 0x01; - } - neighborsSignificance[index] |= 0x80; - }, - runSignificancePropogationPass: - function BitModel_runSignificancePropogationPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var neighborsSignificance = this.neighborsSignificance; - var processingFlags = this.processingFlags; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processedInverseMask = ~1; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - - for (var i0 = 0; i0 < height; i0 += 4) { - for (var j = 0; j < width; j++) { - var index = i0 * width + j; - for (var i1 = 0; i1 < 4; i1++, index += width) { - var i = i0 + i1; - if (i >= height) { - break; - } - // clear processed flag first - processingFlags[index] &= processedInverseMask; - - if (coefficentsMagnitude[index] || - !neighborsSignificance[index]) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision) { - var sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - decodeSignBit: function BitModel_decodeSignBit(row, column, index) { - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contribution, sign0, sign1, significance1; - var contextLabel, decoded; - - // calculate horizontal contribution - significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0); - if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { - sign1 = coefficentsSign[index + 1]; - if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign1 - sign0; - } else { - contribution = 1 - sign1 - sign1; - } - } else if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign0 - sign0; - } else { - contribution = 0; - } - var horizontalContribution = 3 * contribution; - - // calculate vertical contribution and combine with the horizontal - significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0); - if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { - sign1 = coefficentsSign[index + width]; - if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign1 - sign0 + horizontalContribution; - } else { - contribution = 1 - sign1 - sign1 + horizontalContribution; - } - } else if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign0 - sign0 + horizontalContribution; - } else { - contribution = horizontalContribution; - } - - if (contribution >= 0) { - contextLabel = 9 + contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel); - } else { - contextLabel = 9 - contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; - } - return decoded; - }, - runMagnitudeRefinementPass: - function BitModel_runMagnitudeRefinementPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var neighborsSignificance = this.neighborsSignificance; - var contexts = this.contexts; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var length = width * height; - var width4 = width * 4; - - for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { - indexNext = Math.min(length, index0 + width4); - for (var j = 0; j < width; j++) { - for (var index = index0 + j; index < indexNext; index += width) { - - // significant but not those that have just become - if (!coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = 16; - if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { - processingFlags[index] ^= firstMagnitudeBitMask; - // first refinement - var significance = neighborsSignificance[index] & 127; - contextLabel = significance === 0 ? 15 : 14; - } - - var bit = decoder.readBit(contexts, contextLabel); - coefficentsMagnitude[index] = - (coefficentsMagnitude[index] << 1) | bit; - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - runCleanupPass: function BitModel_runCleanupPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var neighborsSignificance = this.neighborsSignificance; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var oneRowDown = width; - var twoRowsDown = width * 2; - var threeRowsDown = width * 3; - var iNext; - for (var i0 = 0; i0 < height; i0 = iNext) { - iNext = Math.min(i0 + 4, height); - var indexBase = i0 * width; - var checkAllEmpty = i0 + 3 < height; - for (var j = 0; j < width; j++) { - var index0 = indexBase + j; - // using the property: labels[neighborsSignificance[index]] === 0 - // when neighborsSignificance[index] === 0 - var allEmpty = (checkAllEmpty && - processingFlags[index0] === 0 && - processingFlags[index0 + oneRowDown] === 0 && - processingFlags[index0 + twoRowsDown] === 0 && - processingFlags[index0 + threeRowsDown] === 0 && - neighborsSignificance[index0] === 0 && - neighborsSignificance[index0 + oneRowDown] === 0 && - neighborsSignificance[index0 + twoRowsDown] === 0 && - neighborsSignificance[index0 + threeRowsDown] === 0); - var i1 = 0, index = index0; - var i = i0, sign; - if (allEmpty) { - var hasSignificantCoefficent = - decoder.readBit(contexts, RUNLENGTH_CONTEXT); - if (!hasSignificantCoefficent) { - bitsDecoded[index0]++; - bitsDecoded[index0 + oneRowDown]++; - bitsDecoded[index0 + twoRowsDown]++; - bitsDecoded[index0 + threeRowsDown]++; - continue; // next column - } - i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (i1 !== 0) { - i = i0 + i1; - index += i1 * width; - } - - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - - index = index0; - for (var i2 = i0; i2 <= i; i2++, index += width) { - bitsDecoded[index]++; - } - - i1++; - } - for (i = i0 + i1; i < iNext; i++, index += width) { - if (coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision === 1) { - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - } - } - } - }, - checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { - var decoder = this.decoder; - var contexts = this.contexts; - var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (symbol !== 0xA) { - throw new Error('JPX Error: Invalid segmentation symbol'); - } - } - }; - - return BitModel; - })(); - - // Section F, Discrete wavelet transformation - var Transform = (function TransformClosure() { - function Transform() {} - - Transform.prototype.calculate = - function transformCalculate(subbands, u0, v0) { - var ll = subbands[0]; - for (var i = 1, ii = subbands.length; i < ii; i++) { - ll = this.iterate(ll, subbands[i], u0, v0); - } - return ll; - }; - Transform.prototype.extend = function extend(buffer, offset, size) { - // Section F.3.7 extending... using max extension of 4 - var i1 = offset - 1, j1 = offset + 1; - var i2 = offset + size - 2, j2 = offset + size; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1] = buffer[j1]; - buffer[j2] = buffer[i2]; - }; - Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, - u0, v0) { - var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; - var width = hl_lh_hh.width; - var height = hl_lh_hh.height; - var items = hl_lh_hh.items; - var i, j, k, l, u, v; - - // Interleave LL according to Section F.3.3 - for (k = 0, i = 0; i < llHeight; i++) { - l = i * 2 * width; - for (j = 0; j < llWidth; j++, k++, l += 2) { - items[l] = llItems[k]; - } - } - // The LL band is not needed anymore. - llItems = ll.items = null; - - var bufferPadding = 4; - var rowBuffer = new Float32Array(width + 2 * bufferPadding); - - // Section F.3.4 HOR_SR - if (width === 1) { - // if width = 1, when u0 even keep items as is, when odd divide by 2 - if ((u0 & 1) !== 0) { - for (v = 0, k = 0; v < height; v++, k += width) { - items[k] *= 0.5; - } - } - } else { - for (v = 0, k = 0; v < height; v++, k += width) { - rowBuffer.set(items.subarray(k, k + width), bufferPadding); - - this.extend(rowBuffer, bufferPadding, width); - this.filter(rowBuffer, bufferPadding, width); - - items.set( - rowBuffer.subarray(bufferPadding, bufferPadding + width), - k); - } - } - - // Accesses to the items array can take long, because it may not fit into - // CPU cache and has to be fetched from main memory. Since subsequent - // accesses to the items array are not local when reading columns, we - // have a cache miss every time. To reduce cache misses, get up to - // 'numBuffers' items at a time and store them into the individual - // buffers. The colBuffers should be small enough to fit into CPU cache. - var numBuffers = 16; - var colBuffers = []; - for (i = 0; i < numBuffers; i++) { - colBuffers.push(new Float32Array(height + 2 * bufferPadding)); - } - var b, currentBuffer = 0; - ll = bufferPadding + height; - - // Section F.3.5 VER_SR - if (height === 1) { - // if height = 1, when v0 even keep items as is, when odd divide by 2 - if ((v0 & 1) !== 0) { - for (u = 0; u < width; u++) { - items[u] *= 0.5; - } - } - } else { - for (u = 0; u < width; u++) { - // if we ran out of buffers, copy several image columns at once - if (currentBuffer === 0) { - numBuffers = Math.min(width - u, numBuffers); - for (k = u, l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - colBuffers[b][l] = items[k + b]; - } - } - currentBuffer = numBuffers; - } - - currentBuffer--; - var buffer = colBuffers[currentBuffer]; - this.extend(buffer, bufferPadding, height); - this.filter(buffer, bufferPadding, height); - - // If this is last buffer in this group of buffers, flush all buffers. - if (currentBuffer === 0) { - k = u - numBuffers + 1; - for (l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - items[k + b] = colBuffers[b][l]; - } - } - } - } - } - - return { - width: width, - height: height, - items: items - }; - }; - return Transform; - })(); - - // Section 3.8.2 Irreversible 9-7 filter - var IrreversibleTransform = (function IrreversibleTransformClosure() { - function IrreversibleTransform() { - Transform.call(this); - } - - IrreversibleTransform.prototype = Object.create(Transform.prototype); - IrreversibleTransform.prototype.filter = - function irreversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n, current, next; - - var alpha = -1.586134342059924; - var beta = -0.052980118572961; - var gamma = 0.882911075530934; - var delta = 0.443506852043971; - var K = 1.230174104914001; - var K_ = 1 / K; - - // step 1 is combined with step 3 - - // step 2 - j = offset - 3; - for (n = len + 4; n--; j += 2) { - x[j] *= K_; - } - - // step 1 & 3 - j = offset - 2; - current = delta * x[j -1]; - for (n = len + 3; n--; j += 2) { - next = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - if (n--) { - j += 2; - current = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - } else { - break; - } - } - - // step 4 - j = offset - 1; - current = gamma * x[j - 1]; - for (n = len + 2; n--; j += 2) { - next = gamma * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = gamma * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 5 - j = offset; - current = beta * x[j - 1]; - for (n = len + 1; n--; j += 2) { - next = beta * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = beta * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 6 - if (len !== 0) { - j = offset + 1; - current = alpha * x[j - 1]; - for (n = len; n--; j += 2) { - next = alpha * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = alpha * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - } - }; - - return IrreversibleTransform; - })(); - - // Section 3.8.1 Reversible 5-3 filter - var ReversibleTransform = (function ReversibleTransformClosure() { - function ReversibleTransform() { - Transform.call(this); - } - - ReversibleTransform.prototype = Object.create(Transform.prototype); - ReversibleTransform.prototype.filter = - function reversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n; - - for (j = offset, n = len + 1; n--; j += 2) { - x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2; - } - - for (j = offset + 1, n = len; n--; j += 2) { - x[j] += (x[j - 1] + x[j + 1]) >> 1; - } - }; - - return ReversibleTransform; - })(); - - return JpxImage; -})(); - - -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -/* This class implements the QM Coder decoding as defined in - * JPEG 2000 Part I Final Committee Draft Version 1.0 - * Annex C.3 Arithmetic decoding procedure - * available at http://www.jpeg.org/public/fcd15444-1.pdf - * - * The arithmetic decoder is used in conjunction with context models to decode - * JPEG2000 and JBIG2 streams. - */ -var ArithmeticDecoder = (function ArithmeticDecoderClosure() { - // Table C-2 - var QeTable = [ - {qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, - {qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, - {qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, - {qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, - {qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, - {qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, - {qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, - {qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, - {qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, - {qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, - {qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, - {qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, - {qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, - {qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, - {qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, - {qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, - {qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, - {qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, - {qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, - {qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, - {qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, - {qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, - {qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, - {qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, - {qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, - {qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, - {qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, - {qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, - {qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, - {qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, - {qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, - {qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, - {qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, - {qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, - {qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, - {qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, - {qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, - {qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, - {qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, - {qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, - {qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, - {qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, - {qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, - {qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, - {qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, - {qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, - {qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} - ]; - - // C.3.5 Initialisation of the decoder (INITDEC) - function ArithmeticDecoder(data, start, end) { - this.data = data; - this.bp = start; - this.dataEnd = end; - - this.chigh = data[start]; - this.clow = 0; - - this.byteIn(); - - this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F); - this.clow = (this.clow << 7) & 0xFFFF; - this.ct -= 7; - this.a = 0x8000; - } - - ArithmeticDecoder.prototype = { - // C.3.4 Compressed data input (BYTEIN) - byteIn: function ArithmeticDecoder_byteIn() { - var data = this.data; - var bp = this.bp; - if (data[bp] === 0xFF) { - var b1 = data[bp + 1]; - if (b1 > 0x8F) { - this.clow += 0xFF00; - this.ct = 8; - } else { - bp++; - this.clow += (data[bp] << 9); - this.ct = 7; - this.bp = bp; - } - } else { - bp++; - this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00; - this.ct = 8; - this.bp = bp; - } - if (this.clow > 0xFFFF) { - this.chigh += (this.clow >> 16); - this.clow &= 0xFFFF; - } - }, - // C.3.2 Decoding a decision (DECODE) - readBit: function ArithmeticDecoder_readBit(contexts, pos) { - // contexts are packed into 1 byte: - // highest 7 bits carry cx.index, lowest bit carries cx.mps - var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; - var qeTableIcx = QeTable[cx_index]; - var qeIcx = qeTableIcx.qe; - var d; - var a = this.a - qeIcx; - - if (this.chigh < qeIcx) { - // exchangeLps - if (a < qeIcx) { - a = qeIcx; - d = cx_mps; - cx_index = qeTableIcx.nmps; - } else { - a = qeIcx; - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } - } else { - this.chigh -= qeIcx; - if ((a & 0x8000) !== 0) { - this.a = a; - return cx_mps; - } - // exchangeMps - if (a < qeIcx) { - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } else { - d = cx_mps; - cx_index = qeTableIcx.nmps; - } - } - // C.3.3 renormD; - do { - if (this.ct === 0) { - this.byteIn(); - } - - a <<= 1; - this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 0xFFFF; - this.ct--; - } while ((a & 0x8000) === 0); - this.a = a; - - contexts[pos] = cx_index << 1 | cx_mps; - return d; - } - }; - - return ArithmeticDecoder; -})(); - -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals Cmd, ColorSpace, Dict, MozBlobBuilder, Name, PDFJS, Ref, URL, - Promise */ - -'use strict'; - -var globalScope = (typeof window === 'undefined') ? this : window; - -var isWorker = (typeof window === 'undefined'); - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - WIDGET: 1, - TEXT: 2, - LINK: 3 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -// The global PDFJS object exposes the API -// In production, it will be declared outside a global wrapper -// In development, it will be declared here -if (!globalScope.PDFJS) { - globalScope.PDFJS = {}; -} - -//globalScope.PDFJS.pdfBug = false; - -var PDFJS = PDFJS || {}; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - // If multiple arguments were passed, pass them all to the log function. - if (arguments.length > 1) { - var logArguments = ['Error:']; - logArguments.push.apply(logArguments, arguments); - console.log.apply(console, logArguments); - // Join the arguments into a single string for the lines below. - msg = [].join.call(arguments, ' '); - } else { - console.log('Error: ' + msg); - } - console.log(backtrace()); - UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown); - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -var UnsupportedManager = PDFJS.UnsupportedManager = - (function UnsupportedManagerClosure() { - var listeners = []; - return { - listen: function (cb) { - listeners.push(cb); - }, - notify: function (featureId) { - warn('Unsupported feature "' + featureId + '"'); - for (var i = 0, ii = listeners.length; i < ii; i++) { - listeners[i](featureId); - } - } - }; -})(); - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - if (/^[a-z][a-z0-9+\-.]*:/i.test(url)) { - return url; - } - var i; - if (url.charAt(0) === '/') { - // absolute path - i = baseUrl.indexOf('://'); - if (url.charAt(1) === '/') { - ++i; - } else { - i = baseUrl.indexOf('/', i + 3); - } - return baseUrl.substring(0, i) + url; - } else { - // relative path - var pathLength = baseUrl.length; - i = baseUrl.lastIndexOf('#'); - pathLength = i >= 0 ? i : pathLength; - i = baseUrl.lastIndexOf('?', pathLength); - pathLength = i >= 0 ? i : pathLength; - var prefixLength = baseUrl.lastIndexOf('/', pathLength); - return baseUrl.substring(0, prefixLength + 1) + url; - } -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - -//#if !(FIREFOX || MOZCENTRAL || B2G || CHROME) -//// Lazy test if the userAgant support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); -//#else -//PDFJS.hasCanvasTypedArrays = true; -//#endif - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 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, 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, 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, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isNull(v) { - return v === null; -} - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isArray(v) { - return v instanceof Array; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -function isRef(v) { - return v instanceof Ref; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch2 !== 'function') { - globalScope.Promise.prototype.catch2 = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } -//#if !MOZCENTRAL - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch2: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -//#else -//throw new Error('DOM Promise is not present'); -//#endif -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(name, comObj) { - this.name = name; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - ah['console_log'] = [function ahConsoleLog(data) { - console.log.apply(console, data); - }]; - ah['console_error'] = [function ahConsoleError(data) { - console.error.apply(console, data); - }]; - ah['_unsupported_feature'] = [function ah_unsupportedFeature(data) { - UnsupportedManager.notify(data); - }]; - - comObj.onmessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - comObj.postMessage({ - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }; -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = JpxImage; -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b1599db..eceec57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,22 +9,37 @@ "version": "1.2.45", "license": "MIT", "dependencies": { - "@wearemothership/dicom-character-set": "^1.0.4-opt.1", + "CharLS.js": "^2.0.1", "fflate": "*", "jpeg-lossless-decoder-js": "^2.0.7", + "jpeg2000": "^1.1.1", "pako": "^2.1", "xss": "1.0.14" }, "devDependencies": { "browserify": "*", "esbuild": "*", + "eslint": "^8.36.0", + "eslint-config-prettier": "^9.0.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-prettier": "^5.0.1", "full-icu": "*", "icu4c-data": "*", "jsdoc-to-markdown": "*", "mocha": "*", + "prettier": "^3.1.0", "uglify-js": "*" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@babel/parser": { "version": "7.21.8", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.8.tgz", @@ -389,6 +404,95 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "dev": true + }, "node_modules/@jsdoc/salty": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.5.tgz", @@ -401,6 +505,68 @@ "node": ">=v12.0.0" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "peer": true + }, "node_modules/@types/linkify-it": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", @@ -423,13 +589,11 @@ "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", "dev": true }, - "node_modules/@wearemothership/dicom-character-set": { - "version": "1.0.4-opt.1", - "resolved": "https://registry.npmjs.org/@wearemothership/dicom-character-set/-/dicom-character-set-1.0.4-opt.1.tgz", - "integrity": "sha512-stqhnpawYHY2UZKj4RHTF71ab3q3z8S1SO9ToQKjsHQwowUdFVo6YFea93psFux3yqNbRlQjwoCdPjHcD0YQzw==", - "engines": { - "node": ">=10" - } + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true }, "node_modules/acorn": { "version": "7.4.1", @@ -443,6 +607,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-node": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", @@ -463,6 +636,22 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -545,6 +734,120 @@ "node": ">=12.17" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, + "peer": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -626,6 +929,15 @@ } ] }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -647,6 +959,18 @@ "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -893,12 +1217,66 @@ "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", "dev": true }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "dev": true }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "peer": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dev": true, + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cache-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", @@ -929,18 +1307,28 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -993,6 +1381,11 @@ "node": ">=8" } }, + "node_modules/CharLS.js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/CharLS.js/-/CharLS.js-2.0.1.tgz", + "integrity": "sha512-ELk0UZ7RKdsHYMOnqsrUe4USFGKtFgwES/WqlGbkq+W6pBe7s58KMtsSIpf1SIdeOAg1vSyY0tFYN3o0Z3q7mQ==" + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -1292,6 +1685,20 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -1369,34 +1776,118 @@ "node": ">=4.0.0" } }, - "node_modules/defined": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", - "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", "dev": true, + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", "dev": true, "dependencies": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" }, - "bin": { - "deps-sort": "bin/cmd.js" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "peer": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deps-sort": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "dev": true, + "dependencies": { + "JSONStream": "^1.0.3", + "shasum-object": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + }, + "bin": { + "deps-sort": "bin/cmd.js" + } + }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "dev": true, "dependencies": { "inherits": "^2.0.1", @@ -1469,6 +1960,18 @@ "node": ">=12" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -1524,6 +2027,103 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/es-abstract": { + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", + "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", + "dev": true, + "peer": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.5", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", + "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "dev": true, + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "peer": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "peer": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/esbuild": { "version": "0.17.19", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", @@ -1579,6 +2179,436 @@ "node": ">=8" } }, + "node_modules/eslint": { + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.54.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-config-standard": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", + "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-es-x": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.3.0.tgz", + "integrity": "sha512-W9zIs+k00I/I13+Bdkl/zG1MEO07G97XjUSQuH117w620SJ6bHtLUmoMvkGA2oYnI/gNdr+G7BONLyYnFaLLEQ==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.6.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", + "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "dev": true, + "peer": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-n": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.3.1.tgz", + "integrity": "sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "builtins": "^5.0.1", + "eslint-plugin-es-x": "^7.1.0", + "get-tsconfig": "^4.7.0", + "ignore": "^5.2.4", + "is-builtin-module": "^3.2.1", + "is-core-module": "^2.12.1", + "minimatch": "^3.1.2", + "resolve": "^1.22.2", + "semver": "^7.5.3" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", + "integrity": "sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.5" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-promise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -1598,12 +2628,84 @@ "safe-buffer": "^5.1.1" } }, + "node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -1618,6 +2720,18 @@ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.4.tgz", "integrity": "sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==" }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/file-set": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", @@ -1698,6 +2812,26 @@ "flat": "cli.js" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -1745,16 +2879,48 @@ "dependencies": { "yauzl": "^2.10.0" }, - "bin": { - "full-icu": "node-full-icu.js", - "node-full-icu-path": "node-icu-data.js" + "bin": { + "full-icu": "node-full-icu.js", + "node-full-icu-path": "node-icu-data.js" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-assigned-identifiers": { "version": "1.2.0", @@ -1772,20 +2938,62 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "peer": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1818,6 +3026,37 @@ "node": ">= 6" } }, + "node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "peer": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -1836,6 +3075,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -1878,6 +3123,16 @@ "node": ">= 0.4.0" } }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1887,6 +3142,18 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", @@ -1964,6 +3231,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -1999,6 +3278,15 @@ "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", "dev": true }, + "node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, + "engines": { + "node": ">=14.18.0" + } + }, "node_modules/icu4c-data": { "version": "0.57.2", "resolved": "https://registry.npmjs.org/icu4c-data/-/icu4c-data-0.57.2.tgz", @@ -2025,6 +3313,40 @@ } ] }, + "node_modules/ignore": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2071,6 +3393,21 @@ "insert-module-globals": "bin/cmd.js" } }, + "node_modules/internal-slot": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", + "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "dev": true, + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -2087,6 +3424,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "peer": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2099,12 +3464,45 @@ "node": ">=8" } }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "peer": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -2117,42 +3515,176 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "peer": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, + "peer": true, "dependencies": { - "has": "^1.0.3" + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, + "peer": true, "dependencies": { + "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { @@ -2162,47 +3694,70 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, + "peer": true, "dependencies": { - "is-extglob": "^2.1.1" + "call-bind": "^1.0.2" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, + "peer": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=0.12.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, + "peer": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -2223,17 +3778,68 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, "node_modules/jpeg-lossless-decoder-js": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/jpeg-lossless-decoder-js/-/jpeg-lossless-decoder-js-2.0.7.tgz", "integrity": "sha512-tbZlhFkKmx+JaqVMkq47SKWGuXLkIaV8fTbnhO39dYEnQrSShLGuLCGb0n6ntXjtmk6oAWGiIriWOLwj9od0yQ==" }, + "node_modules/jpeg2000": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jpeg2000/-/jpeg2000-1.1.1.tgz", + "integrity": "sha512-keyTI3PY83W4AoeAw8aNJp7LUaU+OcZAga7QiUZPF+LtSY721kuIMNBkJmEXem6v7+lR8I85tcJTGEz8dHNIyQ==" + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2342,6 +3948,37 @@ "node": ">=12.17" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -2367,6 +4004,15 @@ "node": "*" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/klaw": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", @@ -2386,6 +4032,19 @@ "stream-splicer": "^2.0.0" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/linkify-it": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", @@ -2428,6 +4087,12 @@ "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", @@ -2462,6 +4127,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/markdown-it": { "version": "12.3.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", @@ -2517,6 +4195,34 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -2536,6 +4242,18 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2745,6 +4463,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -2760,28 +4484,143 @@ "node": ">=0.10.0" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-get": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", + "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", + "dev": true + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-to-spawn-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", + "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" } }, - "node_modules/object-get": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", - "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", - "dev": true - }, - "node_modules/object-to-spawn-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", - "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", + "node_modules/object.values": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, "engines": { - "node": ">=8.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { @@ -2793,6 +4632,56 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dev": true, + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -2834,6 +4723,18 @@ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parents": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", @@ -2880,6 +4781,15 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -2917,6 +4827,12 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -2929,6 +4845,42 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -2989,6 +4941,26 @@ "node": ">=0.4.x" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3151,6 +5123,24 @@ "node": ">=0.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3170,31 +5160,228 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, - "bin": { - "resolve": "bin/resolve" + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/run-applescript/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/run-applescript/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/run-applescript/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-applescript/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } + "peer": true }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -3216,12 +5403,37 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -3231,6 +5443,36 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "peer": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -3253,6 +5495,27 @@ "fast-safe-stringify": "^2.0.7" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/shell-quote": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", @@ -3262,6 +5525,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", @@ -3448,6 +5732,54 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -3460,6 +5792,28 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3508,6 +5862,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/syntax-error": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", @@ -3576,6 +5946,12 @@ "node": ">=4" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -3604,6 +5980,18 @@ "node": ">=0.6.0" } }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3616,12 +6004,124 @@ "node": ">=8.0" } }, + "node_modules/tsconfig-paths": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "dev": true, + "peer": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", "dev": true }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "peer": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -3661,6 +6161,22 @@ "umd": "bin/cli.js" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undeclared-identifiers": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", @@ -3683,6 +6199,33 @@ "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", "dev": true }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -3733,18 +6276,49 @@ "node": ">=12.17" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "peer": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.4", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -3849,6 +6423,13 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "peer": true + }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index c6287d9..2d30900 100644 --- a/package.json +++ b/package.json @@ -3,27 +3,36 @@ "version": "1.2.45", "description": "A JavaScript DICOM reader.", "main": "src/main.js", + "type": "module", "directories": { "test": "tests" }, "dependencies": { - "@wearemothership/dicom-character-set": "^1.0.4-opt.1", + "CharLS.js": "^2.0.1", + "fflate": "*", "jpeg-lossless-decoder-js": "^2.0.7", + "jpeg2000": "^1.1.1", "pako": "^2.1", - "fflate": "*", "xss": "1.0.14" }, "devDependencies": { - "esbuild": "*", "browserify": "*", - "uglify-js": "*", + "esbuild": "*", + "eslint": "^8.36.0", + "eslint-config-prettier": "^9.0.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-prettier": "^5.0.1", "full-icu": "*", "icu4c-data": "*", "jsdoc-to-markdown": "*", - "mocha": "*" + "mocha": "*", + "prettier": "^3.1.0", + "uglify-js": "*" }, "scripts": { + "lint": "DEBUG=eslint:cli-engine eslint --fix .", "test": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests", + "test-dev": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests/driver-jpeg-2000.js", "esbuild": "rm -rf build; mkdir build; esbuild src/main.js --bundle --global-name=daikon --platform=node --outfile=build/daikon.js; esbuild src/main.js --bundle --global-name=daikon --platform=node --minify --outfile=build/daikon-min.js", "build": "rm -rf build; mkdir build; browserify --standalone daikon src/main.js -o build/daikon.js; uglifyjs build/daikon.js -o build/daikon-min.js", "release": "rm release/current/*.js; cp build/*.js release/current/.", diff --git a/src/compression-utils.js b/src/compression-utils.js index 56fbe33..9c9e27c 100644 --- a/src/compression-utils.js +++ b/src/compression-utils.js @@ -1,59 +1,33 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.CompressionUtils = daikon.CompressionUtils || {}; - - -/*** Static Pseudo-constants ***/ - -daikon.CompressionUtils.JPEG_MAGIC_NUMBER = [0xFF, 0xD8]; -daikon.CompressionUtils.JPEG2000_MAGIC_NUMBER = [0xFF, 0x4F, 0xFF, 0x51]; - - -/*** Static methods ***/ - -daikon.CompressionUtils.isHeaderJPEG = function (data) { - if (data) { - if (data.getUint8(0) !== daikon.CompressionUtils.JPEG_MAGIC_NUMBER[0]) { - return false; - } - - if (data.getUint8(1) !== daikon.CompressionUtils.JPEG_MAGIC_NUMBER[1]) { - return false; - } - - return true; +/** * Static Pseudo-constants ***/ +export const JPEG_MAGIC_NUMBER = [0xff, 0xd8] +export const JPEG2000_MAGIC_NUMBER = [0xff, 0x4f, 0xff, 0x51] + +export const isHeaderJPEG = (data) => { + if (data) { + if (data.getUint8(0) !== JPEG_MAGIC_NUMBER[0]) { + return false } - return false; -}; - + if (data.getUint8(1) !== JPEG_MAGIC_NUMBER[1]) { + return false + } -daikon.CompressionUtils.isHeaderJPEG2000 = function (data) { - var ctr; + return true + } - if (data) { - for (ctr = 0; ctr < daikon.CompressionUtils.JPEG2000_MAGIC_NUMBER.length; ctr+=1) { - if (data.getUint8(ctr) !== daikon.CompressionUtils.JPEG2000_MAGIC_NUMBER[ctr]) { - return false; - } - } + return false +} - return true; +export const isHeaderJPEG2000 = (data) => { + if (data) { + for (let ctr = 0; ctr < JPEG2000_MAGIC_NUMBER.length; ctr += 1) { + if (data.getUint8(ctr) !== JPEG2000_MAGIC_NUMBER[ctr]) { + return false + } } - return false; -}; - - -/*** Exports ***/ + return true + } -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.CompressionUtils; -} \ No newline at end of file + return false +} diff --git a/src/dictionary.js b/src/dictionary.js index e8574d2..346cf04 100644 --- a/src/dictionary.js +++ b/src/dictionary.js @@ -1,3633 +1,3615 @@ +/** * Static Pseudo-constants ***/ -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; - -/** - * daikon.Dictionary - * @type {{}|*} - */ -daikon.Dictionary = daikon.Dictionary || {}; -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); - - -/*** Static Pseudo-constants ***/ - -daikon.Dictionary.dictPrivate = { - "0207" : { - "101F" : ["FE", "ElscintDataScale"] // uses special Elscint double type (see Tag class) - } -}; - - -daikon.Dictionary.dict = { - "0002" : { - "0001" : ["OB", "FileMetaInformationVersion"], - "0002" : ["UI", "MediaStoredSOPClassUID"], - "0003" : ["UI", "MediaStoredSOPInstanceUID"], - "0010" : ["UI", "TransferSyntaxUID"], - "0012" : ["UI", "ImplementationClassUID"], - "0013" : ["SH", "ImplementationVersionName"], - "0016" : ["AE", "SourceApplicationEntityTitle"], - "0100" : ["UI", "PrivateInformationCreatorUID"], - "0102" : ["OB", "PrivateInformation"] - }, - "0004" : { - "1130" : ["CS", "FilesetID"], - "1141" : ["CS", "FilesetDescriptorFileFileID"], - "1142" : ["CS", "FilesetDescriptorFileFormat"], - "1200" : ["UL", "RootDirectoryEntitysFirstDirectoryRecordOffset"], - "1202" : ["UL", "RootDirectoryEntitysLastDirectoryRecordOffset"], - "1212" : ["US", "File-setConsistenceFlag"], - "1220" : ["SQ", "DirectoryRecordSequence"], - "1400" : ["UL", "NextDirectoryRecordOffset"], - "1410" : ["US", "RecordInuseFlag"], - "1420" : ["UL", "ReferencedLowerlevelDirectoryEntityOffset"], - "1430" : ["CS", "DirectoryRecordType"], - "1432" : ["UI", "PrivateRecordUID"], - "1500" : ["CS", "ReferencedFileID"], - "1510" : ["UI", "ReferencedSOPClassUIDInFile"], - "1511" : ["UI", "ReferencedSOPInstanceUIDInFile"], - "1600" : ["UL", "NumberOfReferences"] - }, - "0008" : { - "0001" : ["UL", "LengthToEnd"], - "0005" : ["CS", "SpecificCharacterSet"], - "0006" : ["SQ", "LanguageCodeSequence"], - "0008" : ["CS", "ImageType"], - "0010" : ["SH", "RecognitionCode"], - "0012" : ["DA", "InstanceCreationDate"], - "0013" : ["TM", "InstanceCreationTime"], - "0014" : ["UI", "InstanceCreatorUID"], - "0016" : ["UI", "SOPClassUID"], - "0018" : ["UI", "SOPInstanceUID"], - "001A" : ["UI", "RelatedGeneralSOPClassUID"], - "001B" : ["UI", "OriginalSpecializedSOPClassUID"], - "0020" : ["DA", "StudyDate"], - "0021" : ["DA", "SeriesDate"], - "0022" : ["DA", "AcquisitionDate"], - "0023" : ["DA", "ContentDate"], - "0024" : ["DA", "OverlayDate"], - "0025" : ["DA", "CurveDate"], - "002A" : ["DT", "AcquisitionDateTime"], - "0030" : ["TM", "StudyTime"], - "0031" : ["TM", "SeriesTime"], - "0032" : ["TM", "AcquisitionTime"], - "0033" : ["TM", "ContentTime"], - "0034" : ["TM", "OverlayTime"], - "0035" : ["TM", "CurveTime"], - "0040" : ["US", "DataSetType"], - "0041" : ["LO", "DataSetSubtype"], - "0042" : ["CS", "NuclearMedicineSeriesType"], - "0050" : ["SH", "AccessionNumber"], - "0051" : ["SQ", "IssuerOfAccessionNumberSequence"], - "0052" : ["CS", "QueryRetrieveLevel"], - "0054" : ["AE", "RetrieveAETitle"], - "0056" : ["CS", "InstanceAvailability"], - "0058" : ["UI", "FailedSOPInstanceUIDList"], - "0060" : ["CS", "Modality"], - "0061" : ["CS", "ModalitiesInStudy"], - "0062" : ["UI", "SOPClassesInStudy"], - "0064" : ["CS", "ConversionType"], - "0068" : ["CS", "PresentationIntentType"], - "0070" : ["LO", "Manufacturer"], - "0080" : ["LO", "InstitutionName"], - "0081" : ["ST", "InstitutionAddress"], - "0082" : ["SQ", "InstitutionCodeSequence"], - "0090" : ["PN", "ReferringPhysicianName"], - "0092" : ["ST", "ReferringPhysicianAddress"], - "0094" : ["SH", "ReferringPhysicianTelephoneNumbers"], - "0096" : ["SQ", "ReferringPhysicianIdentificationSequence"], - "0100" : ["SH", "CodeValue"], - "0102" : ["SH", "CodingSchemeDesignator"], - "0103" : ["SH", "CodingSchemeVersion"], - "0104" : ["LO", "CodeMeaning"], - "0105" : ["CS", "MappingResource"], - "0106" : ["DT", "ContextGroupVersion"], - "0107" : ["DT", "ContextGroupLocalVersion"], - "010B" : ["CS", "ContextGroupExtensionFlag"], - "010C" : ["UI", "CodingSchemeUID"], - "010D" : ["UI", "ContextGroupExtensionCreatorUID"], - "010F" : ["CS", "ContextIdentifier"], - "0110" : ["SQ", "CodingSchemeIdentificationSequence"], - "0112" : ["LO", "CodingSchemeRegistry"], - "0114" : ["ST", "CodingSchemeExternalID"], - "0115" : ["ST", "CodingSchemeName"], - "0116" : ["ST", "CodingSchemeResponsibleOrganization"], - "0117" : ["UI", "ContextUID"], - "0201" : ["SH", "TimezoneOffsetFromUTC"], - "1000" : ["AE", "NetworkID"], - "1010" : ["SH", "StationName"], - "1030" : ["LO", "StudyDescription"], - "1032" : ["SQ", "ProcedureCodeSequence"], - "103E" : ["LO", "SeriesDescription"], - "103F" : ["SQ", "SeriesDescriptionCodeSequence"], - "1040" : ["LO", "InstitutionalDepartmentName"], - "1048" : ["PN", "PhysiciansOfRecord"], - "1049" : ["SQ", "PhysiciansOfRecordIdentificationSequence"], - "1050" : ["PN", "PerformingPhysicianName"], - "1052" : ["SQ", "PerformingPhysicianIdentificationSequence"], - "1060" : ["PN", "NameOfPhysiciansReadingStudy"], - "1062" : ["SQ", "PhysiciansReadingStudyIdentificationSequence"], - "1070" : ["PN", "OperatorsName"], - "1072" : ["SQ", "OperatorIdentificationSequence"], - "1080" : ["LO", "AdmittingDiagnosesDescription"], - "1084" : ["SQ", "AdmittingDiagnosesCodeSequence"], - "1090" : ["LO", "ManufacturerModelName"], - "1100" : ["SQ", "ReferencedResultsSequence"], - "1110" : ["SQ", "ReferencedStudySequence"], - "1111" : ["SQ", "ReferencedPerformedProcedureStepSequence"], - "1115" : ["SQ", "ReferencedSeriesSequence"], - "1120" : ["SQ", "ReferencedPatientSequence"], - "1125" : ["SQ", "ReferencedVisitSequence"], - "1130" : ["SQ", "ReferencedOverlaySequence"], - "1134" : ["SQ", "ReferencedStereometricInstanceSequence"], - "113A" : ["SQ", "ReferencedWaveformSequence"], - "1140" : ["SQ", "ReferencedImageSequence"], - "1145" : ["SQ", "ReferencedCurveSequence"], - "114A" : ["SQ", "ReferencedInstanceSequence"], - "114B" : ["SQ", "ReferencedRealWorldValueMappingInstanceSequence"], - "1150" : ["UI", "ReferencedSOPClassUID"], - "1155" : ["UI", "ReferencedSOPInstanceUID"], - "115A" : ["UI", "SOPClassesSupported"], - "1160" : ["IS", "ReferencedFrameNumber"], - "1161" : ["UL", "SimpleFrameList"], - "1162" : ["UL", "CalculatedFrameList"], - "1163" : ["FD", "TimeRange"], - "1164" : ["SQ", "FrameExtractionSequence"], - "1167" : ["UI", "MultiFrameSourceSOPInstanceUID"], - "1195" : ["UI", "TransactionUID"], - "1197" : ["US", "FailureReason"], - "1198" : ["SQ", "FailedSOPSequence"], - "1199" : ["SQ", "ReferencedSOPSequence"], - "1200" : ["SQ", "StudiesContainingOtherReferencedInstancesSequence"], - "1250" : ["SQ", "RelatedSeriesSequence"], - "2110" : ["CS", "LossyImageCompressionRetired"], - "2111" : ["ST", "DerivationDescription"], - "2112" : ["SQ", "SourceImageSequence"], - "2120" : ["SH", "StageName"], - "2122" : ["IS", "StageNumber"], - "2124" : ["IS", "NumberOfStages"], - "2127" : ["SH", "ViewName"], - "2128" : ["IS", "ViewNumber"], - "2129" : ["IS", "NumberOfEventTimers"], - "212A" : ["IS", "NumberOfViewsInStage"], - "2130" : ["DS", "EventElapsedTimes"], - "2132" : ["LO", "EventTimerNames"], - "2133" : ["SQ", "EventTimerSequence"], - "2134" : ["FD", "EventTimeOffset"], - "2135" : ["SQ", "EventCodeSequence"], - "2142" : ["IS", "StartTrim"], - "2143" : ["IS", "StopTrim"], - "2144" : ["IS", "RecommendedDisplayFrameRate"], - "2200" : ["CS", "TransducerPosition"], - "2204" : ["CS", "TransducerOrientation"], - "2208" : ["CS", "AnatomicStructure"], - "2218" : ["SQ", "AnatomicRegionSequence"], - "2220" : ["SQ", "AnatomicRegionModifierSequence"], - "2228" : ["SQ", "PrimaryAnatomicStructureSequence"], - "2229" : ["SQ", "AnatomicStructureSpaceOrRegionSequence"], - "2230" : ["SQ", "PrimaryAnatomicStructureModifierSequence"], - "2240" : ["SQ", "TransducerPositionSequence"], - "2242" : ["SQ", "TransducerPositionModifierSequence"], - "2244" : ["SQ", "TransducerOrientationSequence"], - "2246" : ["SQ", "TransducerOrientationModifierSequence"], - "2251" : ["SQ", "AnatomicStructureSpaceOrRegionCodeSequenceTrial"], - "2253" : ["SQ", "AnatomicPortalOfEntranceCodeSequenceTrial"], - "2255" : ["SQ", "AnatomicApproachDirectionCodeSequenceTrial"], - "2256" : ["ST", "AnatomicPerspectiveDescriptionTrial"], - "2257" : ["SQ", "AnatomicPerspectiveCodeSequenceTrial"], - "2258" : ["ST", "AnatomicLocationOfExaminingInstrumentDescriptionTrial"], - "2259" : ["SQ", "AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"], - "225A" : ["SQ", "AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"], - "225C" : ["SQ", "OnAxisBackgroundAnatomicStructureCodeSequenceTrial"], - "3001" : ["SQ", "AlternateRepresentationSequence"], - "3010" : ["UI", "IrradiationEventUID"], - "4000" : ["LT", "IdentifyingComments"], - "9007" : ["CS", "FrameType"], - "9092" : ["SQ", "ReferencedImageEvidenceSequence"], - "9121" : ["SQ", "ReferencedRawDataSequence"], - "9123" : ["UI", "CreatorVersionUID"], - "9124" : ["SQ", "DerivationImageSequence"], - "9154" : ["SQ", "SourceImageEvidenceSequence"], - "9205" : ["CS", "PixelPresentation"], - "9206" : ["CS", "VolumetricProperties"], - "9207" : ["CS", "VolumeBasedCalculationTechnique"], - "9208" : ["CS", "ComplexImageComponent"], - "9209" : ["CS", "AcquisitionContrast"], - "9215" : ["SQ", "DerivationCodeSequence"], - "9237" : ["SQ", "ReferencedPresentationStateSequence"], - "9410" : ["SQ", "ReferencedOtherPlaneSequence"], - "9458" : ["SQ", "FrameDisplaySequence"], - "9459" : ["FL", "RecommendedDisplayFrameRateInFloat"], - "9460" : ["CS", "SkipFrameRangeFlag"] - }, - "0010" : { - "0010" : ["PN", "PatientName"], - "0020" : ["LO", "PatientID"], - "0021" : ["LO", "IssuerOfPatientID"], - "0022" : ["CS", "TypeOfPatientID"], - "0024" : ["SQ", "IssuerOfPatientIDQualifiersSequence"], - "0030" : ["DA", "PatientBirthDate"], - "0032" : ["TM", "PatientBirthTime"], - "0040" : ["CS", "PatientSex"], - "0050" : ["SQ", "PatientInsurancePlanCodeSequence"], - "0101" : ["SQ", "PatientPrimaryLanguageCodeSequence"], - "0102" : ["SQ", "PatientPrimaryLanguageModifierCodeSequence"], - "1000" : ["LO", "OtherPatientIDs"], - "1001" : ["PN", "OtherPatientNames"], - "1002" : ["SQ", "OtherPatientIDsSequence"], - "1005" : ["PN", "PatientBirthName"], - "1010" : ["AS", "PatientAge"], - "1020" : ["DS", "PatientSize"], - "1021" : ["SQ", "PatientSizeCodeSequence"], - "1030" : ["DS", "PatientWeight"], - "1040" : ["LO", "PatientAddress"], - "1050" : ["LO", "InsurancePlanIdentification"], - "1060" : ["PN", "PatientMotherBirthName"], - "1080" : ["LO", "MilitaryRank"], - "1081" : ["LO", "BranchOfService"], - "1090" : ["LO", "MedicalRecordLocator"], - "2000" : ["LO", "MedicalAlerts"], - "2110" : ["LO", "Allergies"], - "2150" : ["LO", "CountryOfResidence"], - "2152" : ["LO", "RegionOfResidence"], - "2154" : ["SH", "PatientTelephoneNumbers"], - "2160" : ["SH", "EthnicGroup"], - "2180" : ["SH", "Occupation"], - "21A0" : ["CS", "SmokingStatus"], - "21B0" : ["LT", "AdditionalPatientHistory"], - "21C0" : ["US", "PregnancyStatus"], - "21D0" : ["DA", "LastMenstrualDate"], - "21F0" : ["LO", "PatientReligiousPreference"], - "2201" : ["LO", "PatientSpeciesDescription"], - "2202" : ["SQ", "PatientSpeciesCodeSequence"], - "2203" : ["CS", "PatientSexNeutered"], - "2210" : ["CS", "AnatomicalOrientationType"], - "2292" : ["LO", "PatientBreedDescription"], - "2293" : ["SQ", "PatientBreedCodeSequence"], - "2294" : ["SQ", "BreedRegistrationSequence"], - "2295" : ["LO", "BreedRegistrationNumber"], - "2296" : ["SQ", "BreedRegistryCodeSequence"], - "2297" : ["PN", "ResponsiblePerson"], - "2298" : ["CS", "ResponsiblePersonRole"], - "2299" : ["LO", "ResponsibleOrganization"], - "4000" : ["LT", "PatientComments"], - "9431" : ["FL", "ExaminedBodyThickness"] - }, - "0012" : { - "0010" : ["LO", "ClinicalTrialSponsorName"], - "0020" : ["LO", "ClinicalTrialProtocolID"], - "0021" : ["LO", "ClinicalTrialProtocolName"], - "0030" : ["LO", "ClinicalTrialSiteID"], - "0031" : ["LO", "ClinicalTrialSiteName"], - "0040" : ["LO", "ClinicalTrialSubjectID"], - "0042" : ["LO", "ClinicalTrialSubjectReadingID"], - "0050" : ["LO", "ClinicalTrialTimePointID"], - "0051" : ["ST", "ClinicalTrialTimePointDescription"], - "0060" : ["LO", "ClinicalTrialCoordinatingCenterName"], - "0062" : ["CS", "PatientIdentityRemoved"], - "0063" : ["LO", "DeidentificationMethod"], - "0064" : ["SQ", "DeidentificationMethodCodeSequence"], - "0071" : ["LO", "ClinicalTrialSeriesID"], - "0072" : ["LO", "ClinicalTrialSeriesDescription"], - "0081" : ["LO", "ClinicalTrialProtocolEthicsCommitteeName"], - "0082" : ["LO", "ClinicalTrialProtocolEthicsCommitteeApprovalNumber"], - "0083" : ["SQ", "ConsentForClinicalTrialUseSequence"], - "0084" : ["CS", "DistributionType"], - "0085" : ["CS", "ConsentForDistributionFlag"] - }, - "0014" : { - "0023" : ["ST", "CADFileFormat"], - "0024" : ["ST", "ComponentReferenceSystem"], - "0025" : ["ST", "ComponentManufacturingProcedure"], - "0028" : ["ST", "ComponentManufacturer"], - "0030" : ["DS", "MaterialThickness"], - "0032" : ["DS", "MaterialPipeDiameter"], - "0034" : ["DS", "MaterialIsolationDiameter"], - "0042" : ["ST", "MaterialGrade"], - "0044" : ["ST", "MaterialPropertiesFileID"], - "0045" : ["ST", "MaterialPropertiesFileFormat"], - "0046" : ["LT", "MaterialNotes"], - "0050" : ["CS", "ComponentShape"], - "0052" : ["CS", "CurvatureType"], - "0054" : ["DS", "OuterDiameter"], - "0056" : ["DS", "InnerDiameter"], - "1010" : ["ST", "ActualEnvironmentalConditions"], - "1020" : ["DA", "ExpiryDate"], - "1040" : ["ST", "EnvironmentalConditions"], - "2002" : ["SQ", "EvaluatorSequence"], - "2004" : ["IS", "EvaluatorNumber"], - "2006" : ["PN", "EvaluatorName"], - "2008" : ["IS", "EvaluationAttempt"], - "2012" : ["SQ", "IndicationSequence"], - "2014" : ["IS", "IndicationNumber "], - "2016" : ["SH", "IndicationLabel"], - "2018" : ["ST", "IndicationDescription"], - "201A" : ["CS", "IndicationType"], - "201C" : ["CS", "IndicationDisposition"], - "201E" : ["SQ", "IndicationROISequence"], - "2030" : ["SQ", "IndicationPhysicalPropertySequence"], - "2032" : ["SH", "PropertyLabel"], - "2202" : ["IS", "CoordinateSystemNumberOfAxes "], - "2204" : ["SQ", "CoordinateSystemAxesSequence"], - "2206" : ["ST", "CoordinateSystemAxisDescription"], - "2208" : ["CS", "CoordinateSystemDataSetMapping"], - "220A" : ["IS", "CoordinateSystemAxisNumber"], - "220C" : ["CS", "CoordinateSystemAxisType"], - "220E" : ["CS", "CoordinateSystemAxisUnits"], - "2210" : ["OB", "CoordinateSystemAxisValues"], - "2220" : ["SQ", "CoordinateSystemTransformSequence"], - "2222" : ["ST", "TransformDescription"], - "2224" : ["IS", "TransformNumberOfAxes"], - "2226" : ["IS", "TransformOrderOfAxes"], - "2228" : ["CS", "TransformedAxisUnits"], - "222A" : ["DS", "CoordinateSystemTransformRotationAndScaleMatrix"], - "222C" : ["DS", "CoordinateSystemTransformTranslationMatrix"], - "3011" : ["DS", "InternalDetectorFrameTime"], - "3012" : ["DS", "NumberOfFramesIntegrated"], - "3020" : ["SQ", "DetectorTemperatureSequence"], - "3022" : ["DS", "SensorName"], - "3024" : ["DS", "HorizontalOffsetOfSensor"], - "3026" : ["DS", "VerticalOffsetOfSensor"], - "3028" : ["DS", "SensorTemperature"], - "3040" : ["SQ", "DarkCurrentSequence"], - "3050" : ["OB", "DarkCurrentCounts"], - "3060" : ["SQ", "GainCorrectionReferenceSequence"], - "3070" : ["OB", "AirCounts"], - "3071" : ["DS", "KVUsedInGainCalibration"], - "3072" : ["DS", "MAUsedInGainCalibration"], - "3073" : ["DS", "NumberOfFramesUsedForIntegration"], - "3074" : ["LO", "FilterMaterialUsedInGainCalibration"], - "3075" : ["DS", "FilterThicknessUsedInGainCalibration"], - "3076" : ["DA", "DateOfGainCalibration"], - "3077" : ["TM", "TimeOfGainCalibration"], - "3080" : ["OB", "BadPixelImage"], - "3099" : ["LT", "CalibrationNotes"], - "4002" : ["SQ", "PulserEquipmentSequence"], - "4004" : ["CS", "PulserType"], - "4006" : ["LT", "PulserNotes"], - "4008" : ["SQ", "ReceiverEquipmentSequence"], - "400A" : ["CS", "AmplifierType"], - "400C" : ["LT", "ReceiverNotes"], - "400E" : ["SQ", "PreAmplifierEquipmentSequence"], - "400F" : ["LT", "PreAmplifierNotes"], - "4010" : ["SQ", "TransmitTransducerSequence"], - "4011" : ["SQ", "ReceiveTransducerSequence"], - "4012" : ["US", "NumberOfElements"], - "4013" : ["CS", "ElementShape"], - "4014" : ["DS", "ElementDimensionA"], - "4015" : ["DS", "ElementDimensionB"], - "4016" : ["DS", "ElementPitch"], - "4017" : ["DS", "MeasuredBeamDimensionA"], - "4018" : ["DS", "MeasuredBeamDimensionB"], - "4019" : ["DS", "LocationOfMeasuredBeamDiameter"], - "401A" : ["DS", "NominalFrequency"], - "401B" : ["DS", "MeasuredCenterFrequency"], - "401C" : ["DS", "MeasuredBandwidth"], - "4020" : ["SQ", "PulserSettingsSequence"], - "4022" : ["DS", "PulseWidth"], - "4024" : ["DS", "ExcitationFrequency"], - "4026" : ["CS", "ModulationType"], - "4028" : ["DS", "Damping"], - "4030" : ["SQ", "ReceiverSettingsSequence"], - "4031" : ["DS", "AcquiredSoundpathLength"], - "4032" : ["CS", "AcquisitionCompressionType"], - "4033" : ["IS", "AcquisitionSampleSize"], - "4034" : ["DS", "RectifierSmoothing"], - "4035" : ["SQ", "DACSequence"], - "4036" : ["CS", "DACType"], - "4038" : ["DS", "DACGainPoints"], - "403A" : ["DS", "DACTimePoints"], - "403C" : ["DS", "DACAmplitude"], - "4040" : ["SQ", "PreAmplifierSettingsSequence"], - "4050" : ["SQ", "TransmitTransducerSettingsSequence"], - "4051" : ["SQ", "ReceiveTransducerSettingsSequence"], - "4052" : ["DS", "IncidentAngle"], - "4054" : ["ST", "CouplingTechnique"], - "4056" : ["ST", "CouplingMedium"], - "4057" : ["DS", "CouplingVelocity"], - "4058" : ["DS", "CrystalCenterLocationX"], - "4059" : ["DS", "CrystalCenterLocationZ"], - "405A" : ["DS", "SoundPathLength"], - "405C" : ["ST", "DelayLawIdentifier"], - "4060" : ["SQ", "GateSettingsSequence"], - "4062" : ["DS", "GateThreshold"], - "4064" : ["DS", "VelocityOfSound"], - "4070" : ["SQ", "CalibrationSettingsSequence"], - "4072" : ["ST", "CalibrationProcedure"], - "4074" : ["SH", "ProcedureVersion"], - "4076" : ["DA", "ProcedureCreationDate"], - "4078" : ["DA", "ProcedureExpirationDate"], - "407A" : ["DA", "ProcedureLastModifiedDate"], - "407C" : ["TM", "CalibrationTime"], - "407E" : ["DA", "CalibrationDate"], - "5002" : ["IS", "LINACEnergy"], - "5004" : ["IS", "LINACOutput"] - }, - "0018" : { - "0010" : ["LO", "ContrastBolusAgent"], - "0012" : ["SQ", "ContrastBolusAgentSequence"], - "0014" : ["SQ", "ContrastBolusAdministrationRouteSequence"], - "0015" : ["CS", "BodyPartExamined"], - "0020" : ["CS", "ScanningSequence"], - "0021" : ["CS", "SequenceVariant"], - "0022" : ["CS", "ScanOptions"], - "0023" : ["CS", "MRAcquisitionType"], - "0024" : ["SH", "SequenceName"], - "0025" : ["CS", "AngioFlag"], - "0026" : ["SQ", "InterventionDrugInformationSequence"], - "0027" : ["TM", "InterventionDrugStopTime"], - "0028" : ["DS", "InterventionDrugDose"], - "0029" : ["SQ", "InterventionDrugCodeSequence"], - "002A" : ["SQ", "AdditionalDrugSequence"], - "0030" : ["LO", "Radionuclide"], - "0031" : ["LO", "Radiopharmaceutical"], - "0032" : ["DS", "EnergyWindowCenterline"], - "0033" : ["DS", "EnergyWindowTotalWidth"], - "0034" : ["LO", "InterventionDrugName"], - "0035" : ["TM", "InterventionDrugStartTime"], - "0036" : ["SQ", "InterventionSequence"], - "0037" : ["CS", "TherapyType"], - "0038" : ["CS", "InterventionStatus"], - "0039" : ["CS", "TherapyDescription"], - "003A" : ["ST", "InterventionDescription"], - "0040" : ["IS", "CineRate"], - "0042" : ["CS", "InitialCineRunState"], - "0050" : ["DS", "SliceThickness"], - "0060" : ["DS", "KVP"], - "0070" : ["IS", "CountsAccumulated"], - "0071" : ["CS", "AcquisitionTerminationCondition"], - "0072" : ["DS", "EffectiveDuration"], - "0073" : ["CS", "AcquisitionStartCondition"], - "0074" : ["IS", "AcquisitionStartConditionData"], - "0075" : ["IS", "AcquisitionTerminationConditionData"], - "0080" : ["DS", "RepetitionTime"], - "0081" : ["DS", "EchoTime"], - "0082" : ["DS", "InversionTime"], - "0083" : ["DS", "NumberOfAverages"], - "0084" : ["DS", "ImagingFrequency"], - "0085" : ["SH", "ImagedNucleus"], - "0086" : ["IS", "EchoNumbers"], - "0087" : ["DS", "MagneticFieldStrength"], - "0088" : ["DS", "SpacingBetweenSlices"], - "0089" : ["IS", "NumberOfPhaseEncodingSteps"], - "0090" : ["DS", "DataCollectionDiameter"], - "0091" : ["IS", "EchoTrainLength"], - "0093" : ["DS", "PercentSampling"], - "0094" : ["DS", "PercentPhaseFieldOfView"], - "0095" : ["DS", "PixelBandwidth"], - "1000" : ["LO", "DeviceSerialNumber"], - "1002" : ["UI", "DeviceUID"], - "1003" : ["LO", "DeviceID"], - "1004" : ["LO", "PlateID"], - "1005" : ["LO", "GeneratorID"], - "1006" : ["LO", "GridID"], - "1007" : ["LO", "CassetteID"], - "1008" : ["LO", "GantryID"], - "1010" : ["LO", "SecondaryCaptureDeviceID"], - "1011" : ["LO", "HardcopyCreationDeviceID"], - "1012" : ["DA", "DateOfSecondaryCapture"], - "1014" : ["TM", "TimeOfSecondaryCapture"], - "1016" : ["LO", "SecondaryCaptureDeviceManufacturer"], - "1017" : ["LO", "HardcopyDeviceManufacturer"], - "1018" : ["LO", "SecondaryCaptureDeviceManufacturerModelName"], - "1019" : ["LO", "SecondaryCaptureDeviceSoftwareVersions"], - "101A" : ["LO", "HardcopyDeviceSoftwareVersion"], - "101B" : ["LO", "HardcopyDeviceManufacturerModelName"], - "1020" : ["LO", "SoftwareVersions"], - "1022" : ["SH", "VideoImageFormatAcquired"], - "1023" : ["LO", "DigitalImageFormatAcquired"], - "1030" : ["LO", "ProtocolName"], - "1040" : ["LO", "ContrastBolusRoute"], - "1041" : ["DS", "ContrastBolusVolume"], - "1042" : ["TM", "ContrastBolusStartTime"], - "1043" : ["TM", "ContrastBolusStopTime"], - "1044" : ["DS", "ContrastBolusTotalDose"], - "1045" : ["IS", "SyringeCounts"], - "1046" : ["DS", "ContrastFlowRate"], - "1047" : ["DS", "ContrastFlowDuration"], - "1048" : ["CS", "ContrastBolusIngredient"], - "1049" : ["DS", "ContrastBolusIngredientConcentration"], - "1050" : ["DS", "SpatialResolution"], - "1060" : ["DS", "TriggerTime"], - "1061" : ["LO", "TriggerSourceOrType"], - "1062" : ["IS", "NominalInterval"], - "1063" : ["DS", "FrameTime"], - "1064" : ["LO", "CardiacFramingType"], - "1065" : ["DS", "FrameTimeVector"], - "1066" : ["DS", "FrameDelay"], - "1067" : ["DS", "ImageTriggerDelay"], - "1068" : ["DS", "MultiplexGroupTimeOffset"], - "1069" : ["DS", "TriggerTimeOffset"], - "106A" : ["CS", "SynchronizationTrigger"], - "106C" : ["US", "SynchronizationChannel"], - "106E" : ["UL", "TriggerSamplePosition"], - "1070" : ["LO", "RadiopharmaceuticalRoute"], - "1071" : ["DS", "RadiopharmaceuticalVolume"], - "1072" : ["TM", "RadiopharmaceuticalStartTime"], - "1073" : ["TM", "RadiopharmaceuticalStopTime"], - "1074" : ["DS", "RadionuclideTotalDose"], - "1075" : ["DS", "RadionuclideHalfLife"], - "1076" : ["DS", "RadionuclidePositronFraction"], - "1077" : ["DS", "RadiopharmaceuticalSpecificActivity"], - "1078" : ["DT", "RadiopharmaceuticalStartDateTime"], - "1079" : ["DT", "RadiopharmaceuticalStopDateTime"], - "1080" : ["CS", "BeatRejectionFlag"], - "1081" : ["IS", "LowRRValue"], - "1082" : ["IS", "HighRRValue"], - "1083" : ["IS", "IntervalsAcquired"], - "1084" : ["IS", "IntervalsRejected"], - "1085" : ["LO", "PVCRejection"], - "1086" : ["IS", "SkipBeats"], - "1088" : ["IS", "HeartRate"], - "1090" : ["IS", "CardiacNumberOfImages"], - "1094" : ["IS", "TriggerWindow"], - "1100" : ["DS", "ReconstructionDiameter"], - "1110" : ["DS", "DistanceSourceToDetector"], - "1111" : ["DS", "DistanceSourceToPatient"], - "1114" : ["DS", "EstimatedRadiographicMagnificationFactor"], - "1120" : ["DS", "GantryDetectorTilt"], - "1121" : ["DS", "GantryDetectorSlew"], - "1130" : ["DS", "TableHeight"], - "1131" : ["DS", "TableTraverse"], - "1134" : ["CS", "TableMotion"], - "1135" : ["DS", "TableVerticalIncrement"], - "1136" : ["DS", "TableLateralIncrement"], - "1137" : ["DS", "TableLongitudinalIncrement"], - "1138" : ["DS", "TableAngle"], - "113A" : ["CS", "TableType"], - "1140" : ["CS", "RotationDirection"], - "1141" : ["DS", "AngularPosition"], - "1142" : ["DS", "RadialPosition"], - "1143" : ["DS", "ScanArc"], - "1144" : ["DS", "AngularStep"], - "1145" : ["DS", "CenterOfRotationOffset"], - "1146" : ["DS", "RotationOffset"], - "1147" : ["CS", "FieldOfViewShape"], - "1149" : ["IS", "FieldOfViewDimensions"], - "1150" : ["IS", "ExposureTime"], - "1151" : ["IS", "XRayTubeCurrent"], - "1152" : ["IS", "Exposure"], - "1153" : ["IS", "ExposureInuAs"], - "1154" : ["DS", "AveragePulseWidth"], - "1155" : ["CS", "RadiationSetting"], - "1156" : ["CS", "RectificationType"], - "115A" : ["CS", "RadiationMode"], - "115E" : ["DS", "ImageAndFluoroscopyAreaDoseProduct"], - "1160" : ["SH", "FilterType"], - "1161" : ["LO", "TypeOfFilters"], - "1162" : ["DS", "IntensifierSize"], - "1164" : ["DS", "ImagerPixelSpacing"], - "1166" : ["CS", "Grid"], - "1170" : ["IS", "GeneratorPower"], - "1180" : ["SH", "CollimatorGridName"], - "1181" : ["CS", "CollimatorType"], - "1182" : ["IS", "FocalDistance"], - "1183" : ["DS", "XFocusCenter"], - "1184" : ["DS", "YFocusCenter"], - "1190" : ["DS", "FocalSpots"], - "1191" : ["CS", "AnodeTargetMaterial"], - "11A0" : ["DS", "BodyPartThickness"], - "11A2" : ["DS", "CompressionForce"], - "1200" : ["DA", "DateOfLastCalibration"], - "1201" : ["TM", "TimeOfLastCalibration"], - "1210" : ["SH", "ConvolutionKernel"], - "1240" : ["IS", "UpperLowerPixelValues"], - "1242" : ["IS", "ActualFrameDuration"], - "1243" : ["IS", "CountRate"], - "1244" : ["US", "PreferredPlaybackSequencing"], - "1250" : ["SH", "ReceiveCoilName"], - "1251" : ["SH", "TransmitCoilName"], - "1260" : ["SH", "PlateType"], - "1261" : ["LO", "PhosphorType"], - "1300" : ["DS", "ScanVelocity"], - "1301" : ["CS", "WholeBodyTechnique"], - "1302" : ["IS", "ScanLength"], - "1310" : ["US", "AcquisitionMatrix"], - "1312" : ["CS", "InPlanePhaseEncodingDirection"], - "1314" : ["DS", "FlipAngle"], - "1315" : ["CS", "VariableFlipAngleFlag"], - "1316" : ["DS", "SAR"], - "1318" : ["DS", "dBdt"], - "1400" : ["LO", "AcquisitionDeviceProcessingDescription"], - "1401" : ["LO", "AcquisitionDeviceProcessingCode"], - "1402" : ["CS", "CassetteOrientation"], - "1403" : ["CS", "CassetteSize"], - "1404" : ["US", "ExposuresOnPlate"], - "1405" : ["IS", "RelativeXRayExposure"], - "1411" : ["DS", "ExposureIndex"], - "1412" : ["DS", "TargetExposureIndex"], - "1413" : ["DS", "DeviationIndex"], - "1450" : ["DS", "ColumnAngulation"], - "1460" : ["DS", "TomoLayerHeight"], - "1470" : ["DS", "TomoAngle"], - "1480" : ["DS", "TomoTime"], - "1490" : ["CS", "TomoType"], - "1491" : ["CS", "TomoClass"], - "1495" : ["IS", "NumberOfTomosynthesisSourceImages"], - "1500" : ["CS", "PositionerMotion"], - "1508" : ["CS", "PositionerType"], - "1510" : ["DS", "PositionerPrimaryAngle"], - "1511" : ["DS", "PositionerSecondaryAngle"], - "1520" : ["DS", "PositionerPrimaryAngleIncrement"], - "1521" : ["DS", "PositionerSecondaryAngleIncrement"], - "1530" : ["DS", "DetectorPrimaryAngle"], - "1531" : ["DS", "DetectorSecondaryAngle"], - "1600" : ["CS", "ShutterShape"], - "1602" : ["IS", "ShutterLeftVerticalEdge"], - "1604" : ["IS", "ShutterRightVerticalEdge"], - "1606" : ["IS", "ShutterUpperHorizontalEdge"], - "1608" : ["IS", "ShutterLowerHorizontalEdge"], - "1610" : ["IS", "CenterOfCircularShutter"], - "1612" : ["IS", "RadiusOfCircularShutter"], - "1620" : ["IS", "VerticesOfThePolygonalShutter"], - "1622" : ["US", "ShutterPresentationValue"], - "1623" : ["US", "ShutterOverlayGroup"], - "1624" : ["US", "ShutterPresentationColorCIELabValue"], - "1700" : ["CS", "CollimatorShape"], - "1702" : ["IS", "CollimatorLeftVerticalEdge"], - "1704" : ["IS", "CollimatorRightVerticalEdge"], - "1706" : ["IS", "CollimatorUpperHorizontalEdge"], - "1708" : ["IS", "CollimatorLowerHorizontalEdge"], - "1710" : ["IS", "CenterOfCircularCollimator"], - "1712" : ["IS", "RadiusOfCircularCollimator"], - "1720" : ["IS", "VerticesOfThePolygonalCollimator"], - "1800" : ["CS", "AcquisitionTimeSynchronized"], - "1801" : ["SH", "TimeSource"], - "1802" : ["CS", "TimeDistributionProtocol"], - "1803" : ["LO", "NTPSourceAddress"], - "2001" : ["IS", "PageNumberVector"], - "2002" : ["SH", "FrameLabelVector"], - "2003" : ["DS", "FramePrimaryAngleVector"], - "2004" : ["DS", "FrameSecondaryAngleVector"], - "2005" : ["DS", "SliceLocationVector"], - "2006" : ["SH", "DisplayWindowLabelVector"], - "2010" : ["DS", "NominalScannedPixelSpacing"], - "2020" : ["CS", "DigitizingDeviceTransportDirection"], - "2030" : ["DS", "RotationOfScannedFilm"], - "3100" : ["CS", "IVUSAcquisition"], - "3101" : ["DS", "IVUSPullbackRate"], - "3102" : ["DS", "IVUSGatedRate"], - "3103" : ["IS", "IVUSPullbackStartFrameNumber"], - "3104" : ["IS", "IVUSPullbackStopFrameNumber"], - "3105" : ["IS", "LesionNumber"], - "4000" : ["LT", "AcquisitionComments"], - "5000" : ["SH", "OutputPower"], - "5010" : ["LO", "TransducerData"], - "5012" : ["DS", "FocusDepth"], - "5020" : ["LO", "ProcessingFunction"], - "5021" : ["LO", "PostprocessingFunction"], - "5022" : ["DS", "MechanicalIndex"], - "5024" : ["DS", "BoneThermalIndex"], - "5026" : ["DS", "CranialThermalIndex"], - "5027" : ["DS", "SoftTissueThermalIndex"], - "5028" : ["DS", "SoftTissueFocusThermalIndex"], - "5029" : ["DS", "SoftTissueSurfaceThermalIndex"], - "5030" : ["DS", "DynamicRange"], - "5040" : ["DS", "TotalGain"], - "5050" : ["IS", "DepthOfScanField"], - "5100" : ["CS", "PatientPosition"], - "5101" : ["CS", "ViewPosition"], - "5104" : ["SQ", "ProjectionEponymousNameCodeSequence"], - "5210" : ["DS", "ImageTransformationMatrix"], - "5212" : ["DS", "ImageTranslationVector"], - "6000" : ["DS", "Sensitivity"], - "6011" : ["SQ", "SequenceOfUltrasoundRegions"], - "6012" : ["US", "RegionSpatialFormat"], - "6014" : ["US", "RegionDataType"], - "6016" : ["UL", "RegionFlags"], - "6018" : ["UL", "RegionLocationMinX0"], - "601A" : ["UL", "RegionLocationMinY0"], - "601C" : ["UL", "RegionLocationMaxX1"], - "601E" : ["UL", "RegionLocationMaxY1"], - "6020" : ["SL", "ReferencePixelX0"], - "6022" : ["SL", "ReferencePixelY0"], - "6024" : ["US", "PhysicalUnitsXDirection"], - "6026" : ["US", "PhysicalUnitsYDirection"], - "6028" : ["FD", "ReferencePixelPhysicalValueX"], - "602A" : ["FD", "ReferencePixelPhysicalValueY"], - "602C" : ["FD", "PhysicalDeltaX"], - "602E" : ["FD", "PhysicalDeltaY"], - "6030" : ["UL", "TransducerFrequency"], - "6031" : ["CS", "TransducerType"], - "6032" : ["UL", "PulseRepetitionFrequency"], - "6034" : ["FD", "DopplerCorrectionAngle"], - "6036" : ["FD", "SteeringAngle"], - "6038" : ["UL", "DopplerSampleVolumeXPositionRetired"], - "6039" : ["SL", "DopplerSampleVolumeXPosition"], - "603A" : ["UL", "DopplerSampleVolumeYPositionRetired"], - "603B" : ["SL", "DopplerSampleVolumeYPosition"], - "603C" : ["UL", "TMLinePositionX0Retired"], - "603D" : ["SL", "TMLinePositionX0"], - "603E" : ["UL", "TMLinePositionY0Retired"], - "603F" : ["SL", "TMLinePositionY0"], - "6040" : ["UL", "TMLinePositionX1Retired"], - "6041" : ["SL", "TMLinePositionX1"], - "6042" : ["UL", "TMLinePositionY1Retired"], - "6043" : ["SL", "TMLinePositionY1"], - "6044" : ["US", "PixelComponentOrganization"], - "6046" : ["UL", "PixelComponentMask"], - "6048" : ["UL", "PixelComponentRangeStart"], - "604A" : ["UL", "PixelComponentRangeStop"], - "604C" : ["US", "PixelComponentPhysicalUnits"], - "604E" : ["US", "PixelComponentDataType"], - "6050" : ["UL", "NumberOfTableBreakPoints"], - "6052" : ["UL", "TableOfXBreakPoints"], - "6054" : ["FD", "TableOfYBreakPoints"], - "6056" : ["UL", "NumberOfTableEntries"], - "6058" : ["UL", "TableOfPixelValues"], - "605A" : ["FL", "TableOfParameterValues"], - "6060" : ["FL", "RWaveTimeVector"], - "7000" : ["CS", "DetectorConditionsNominalFlag"], - "7001" : ["DS", "DetectorTemperature"], - "7004" : ["CS", "DetectorType"], - "7005" : ["CS", "DetectorConfiguration"], - "7006" : ["LT", "DetectorDescription"], - "7008" : ["LT", "DetectorMode"], - "700A" : ["SH", "DetectorID"], - "700C" : ["DA", "DateOfLastDetectorCalibration"], - "700E" : ["TM", "TimeOfLastDetectorCalibration"], - "7010" : ["IS", "ExposuresOnDetectorSinceLastCalibration"], - "7011" : ["IS", "ExposuresOnDetectorSinceManufactured"], - "7012" : ["DS", "DetectorTimeSinceLastExposure"], - "7014" : ["DS", "DetectorActiveTime"], - "7016" : ["DS", "DetectorActivationOffsetFromExposure"], - "701A" : ["DS", "DetectorBinning"], - "7020" : ["DS", "DetectorElementPhysicalSize"], - "7022" : ["DS", "DetectorElementSpacing"], - "7024" : ["CS", "DetectorActiveShape"], - "7026" : ["DS", "DetectorActiveDimensions"], - "7028" : ["DS", "DetectorActiveOrigin"], - "702A" : ["LO", "DetectorManufacturerName"], - "702B" : ["LO", "DetectorManufacturerModelName"], - "7030" : ["DS", "FieldOfViewOrigin"], - "7032" : ["DS", "FieldOfViewRotation"], - "7034" : ["CS", "FieldOfViewHorizontalFlip"], - "7036" : ["FL", "PixelDataAreaOriginRelativeToFOV"], - "7038" : ["FL", "PixelDataAreaRotationAngleRelativeToFOV"], - "7040" : ["LT", "GridAbsorbingMaterial"], - "7041" : ["LT", "GridSpacingMaterial"], - "7042" : ["DS", "GridThickness"], - "7044" : ["DS", "GridPitch"], - "7046" : ["IS", "GridAspectRatio"], - "7048" : ["DS", "GridPeriod"], - "704C" : ["DS", "GridFocalDistance"], - "7050" : ["CS", "FilterMaterial"], - "7052" : ["DS", "FilterThicknessMinimum"], - "7054" : ["DS", "FilterThicknessMaximum"], - "7056" : ["FL", "FilterBeamPathLengthMinimum"], - "7058" : ["FL", "FilterBeamPathLengthMaximum"], - "7060" : ["CS", "ExposureControlMode"], - "7062" : ["LT", "ExposureControlModeDescription"], - "7064" : ["CS", "ExposureStatus"], - "7065" : ["DS", "PhototimerSetting"], - "8150" : ["DS", "ExposureTimeInuS"], - "8151" : ["DS", "XRayTubeCurrentInuA"], - "9004" : ["CS", "ContentQualification"], - "9005" : ["SH", "PulseSequenceName"], - "9006" : ["SQ", "MRImagingModifierSequence"], - "9008" : ["CS", "EchoPulseSequence"], - "9009" : ["CS", "InversionRecovery"], - "9010" : ["CS", "FlowCompensation"], - "9011" : ["CS", "MultipleSpinEcho"], - "9012" : ["CS", "MultiPlanarExcitation"], - "9014" : ["CS", "PhaseContrast"], - "9015" : ["CS", "TimeOfFlightContrast"], - "9016" : ["CS", "Spoiling"], - "9017" : ["CS", "SteadyStatePulseSequence"], - "9018" : ["CS", "EchoPlanarPulseSequence"], - "9019" : ["FD", "TagAngleFirstAxis"], - "9020" : ["CS", "MagnetizationTransfer"], - "9021" : ["CS", "T2Preparation"], - "9022" : ["CS", "BloodSignalNulling"], - "9024" : ["CS", "SaturationRecovery"], - "9025" : ["CS", "SpectrallySelectedSuppression"], - "9026" : ["CS", "SpectrallySelectedExcitation"], - "9027" : ["CS", "SpatialPresaturation"], - "9028" : ["CS", "Tagging"], - "9029" : ["CS", "OversamplingPhase"], - "9030" : ["FD", "TagSpacingFirstDimension"], - "9032" : ["CS", "GeometryOfKSpaceTraversal"], - "9033" : ["CS", "SegmentedKSpaceTraversal"], - "9034" : ["CS", "RectilinearPhaseEncodeReordering"], - "9035" : ["FD", "TagThickness"], - "9036" : ["CS", "PartialFourierDirection"], - "9037" : ["CS", "CardiacSynchronizationTechnique"], - "9041" : ["LO", "ReceiveCoilManufacturerName"], - "9042" : ["SQ", "MRReceiveCoilSequence"], - "9043" : ["CS", "ReceiveCoilType"], - "9044" : ["CS", "QuadratureReceiveCoil"], - "9045" : ["SQ", "MultiCoilDefinitionSequence"], - "9046" : ["LO", "MultiCoilConfiguration"], - "9047" : ["SH", "MultiCoilElementName"], - "9048" : ["CS", "MultiCoilElementUsed"], - "9049" : ["SQ", "MRTransmitCoilSequence"], - "9050" : ["LO", "TransmitCoilManufacturerName"], - "9051" : ["CS", "TransmitCoilType"], - "9052" : ["FD", "SpectralWidth"], - "9053" : ["FD", "ChemicalShiftReference"], - "9054" : ["CS", "VolumeLocalizationTechnique"], - "9058" : ["US", "MRAcquisitionFrequencyEncodingSteps"], - "9059" : ["CS", "Decoupling"], - "9060" : ["CS", "DecoupledNucleus"], - "9061" : ["FD", "DecouplingFrequency"], - "9062" : ["CS", "DecouplingMethod"], - "9063" : ["FD", "DecouplingChemicalShiftReference"], - "9064" : ["CS", "KSpaceFiltering"], - "9065" : ["CS", "TimeDomainFiltering"], - "9066" : ["US", "NumberOfZeroFills"], - "9067" : ["CS", "BaselineCorrection"], - "9069" : ["FD", "ParallelReductionFactorInPlane"], - "9070" : ["FD", "CardiacRRIntervalSpecified"], - "9073" : ["FD", "AcquisitionDuration"], - "9074" : ["DT", "FrameAcquisitionDateTime"], - "9075" : ["CS", "DiffusionDirectionality"], - "9076" : ["SQ", "DiffusionGradientDirectionSequence"], - "9077" : ["CS", "ParallelAcquisition"], - "9078" : ["CS", "ParallelAcquisitionTechnique"], - "9079" : ["FD", "InversionTimes"], - "9080" : ["ST", "MetaboliteMapDescription"], - "9081" : ["CS", "PartialFourier"], - "9082" : ["FD", "EffectiveEchoTime"], - "9083" : ["SQ", "MetaboliteMapCodeSequence"], - "9084" : ["SQ", "ChemicalShiftSequence"], - "9085" : ["CS", "CardiacSignalSource"], - "9087" : ["FD", "DiffusionBValue"], - "9089" : ["FD", "DiffusionGradientOrientation"], - "9090" : ["FD", "VelocityEncodingDirection"], - "9091" : ["FD", "VelocityEncodingMinimumValue"], - "9092" : ["SQ", "VelocityEncodingAcquisitionSequence"], - "9093" : ["US", "NumberOfKSpaceTrajectories"], - "9094" : ["CS", "CoverageOfKSpace"], - "9095" : ["UL", "SpectroscopyAcquisitionPhaseRows"], - "9096" : ["FD", "ParallelReductionFactorInPlaneRetired"], - "9098" : ["FD", "TransmitterFrequency"], - "9100" : ["CS", "ResonantNucleus"], - "9101" : ["CS", "FrequencyCorrection"], - "9103" : ["SQ", "MRSpectroscopyFOVGeometrySequence"], - "9104" : ["FD", "SlabThickness"], - "9105" : ["FD", "SlabOrientation"], - "9106" : ["FD", "MidSlabPosition"], - "9107" : ["SQ", "MRSpatialSaturationSequence"], - "9112" : ["SQ", "MRTimingAndRelatedParametersSequence"], - "9114" : ["SQ", "MREchoSequence"], - "9115" : ["SQ", "MRModifierSequence"], - "9117" : ["SQ", "MRDiffusionSequence"], - "9118" : ["SQ", "CardiacSynchronizationSequence"], - "9119" : ["SQ", "MRAveragesSequence"], - "9125" : ["SQ", "MRFOVGeometrySequence"], - "9126" : ["SQ", "VolumeLocalizationSequence"], - "9127" : ["UL", "SpectroscopyAcquisitionDataColumns"], - "9147" : ["CS", "DiffusionAnisotropyType"], - "9151" : ["DT", "FrameReferenceDateTime"], - "9152" : ["SQ", "MRMetaboliteMapSequence"], - "9155" : ["FD", "ParallelReductionFactorOutOfPlane"], - "9159" : ["UL", "SpectroscopyAcquisitionOutOfPlanePhaseSteps"], - "9166" : ["CS", "BulkMotionStatus"], - "9168" : ["FD", "ParallelReductionFactorSecondInPlane"], - "9169" : ["CS", "CardiacBeatRejectionTechnique"], - "9170" : ["CS", "RespiratoryMotionCompensationTechnique"], - "9171" : ["CS", "RespiratorySignalSource"], - "9172" : ["CS", "BulkMotionCompensationTechnique"], - "9173" : ["CS", "BulkMotionSignalSource"], - "9174" : ["CS", "ApplicableSafetyStandardAgency"], - "9175" : ["LO", "ApplicableSafetyStandardDescription"], - "9176" : ["SQ", "OperatingModeSequence"], - "9177" : ["CS", "OperatingModeType"], - "9178" : ["CS", "OperatingMode"], - "9179" : ["CS", "SpecificAbsorptionRateDefinition"], - "9180" : ["CS", "GradientOutputType"], - "9181" : ["FD", "SpecificAbsorptionRateValue"], - "9182" : ["FD", "GradientOutput"], - "9183" : ["CS", "FlowCompensationDirection"], - "9184" : ["FD", "TaggingDelay"], - "9185" : ["ST", "RespiratoryMotionCompensationTechniqueDescription"], - "9186" : ["SH", "RespiratorySignalSourceID"], - "9195" : ["FD", "ChemicalShiftMinimumIntegrationLimitInHz"], - "9196" : ["FD", "ChemicalShiftMaximumIntegrationLimitInHz"], - "9197" : ["SQ", "MRVelocityEncodingSequence"], - "9198" : ["CS", "FirstOrderPhaseCorrection"], - "9199" : ["CS", "WaterReferencedPhaseCorrection"], - "9200" : ["CS", "MRSpectroscopyAcquisitionType"], - "9214" : ["CS", "RespiratoryCyclePosition"], - "9217" : ["FD", "VelocityEncodingMaximumValue"], - "9218" : ["FD", "TagSpacingSecondDimension"], - "9219" : ["SS", "TagAngleSecondAxis"], - "9220" : ["FD", "FrameAcquisitionDuration"], - "9226" : ["SQ", "MRImageFrameTypeSequence"], - "9227" : ["SQ", "MRSpectroscopyFrameTypeSequence"], - "9231" : ["US", "MRAcquisitionPhaseEncodingStepsInPlane"], - "9232" : ["US", "MRAcquisitionPhaseEncodingStepsOutOfPlane"], - "9234" : ["UL", "SpectroscopyAcquisitionPhaseColumns"], - "9236" : ["CS", "CardiacCyclePosition"], - "9239" : ["SQ", "SpecificAbsorptionRateSequence"], - "9240" : ["US", "RFEchoTrainLength"], - "9241" : ["US", "GradientEchoTrainLength"], - "9250" : ["CS", "ArterialSpinLabelingContrast"], - "9251" : ["SQ", "MRArterialSpinLabelingSequence"], - "9252" : ["LO", "ASLTechniqueDescription"], - "9253" : ["US", "ASLSlabNumber"], - "9254" : ["FD ", "ASLSlabThickness"], - "9255" : ["FD ", "ASLSlabOrientation"], - "9256" : ["FD ", "ASLMidSlabPosition"], - "9257" : ["CS", "ASLContext"], - "9258" : ["UL", "ASLPulseTrainDuration"], - "9259" : ["CS", "ASLCrusherFlag"], - "925A" : ["FD", "ASLCrusherFlow"], - "925B" : ["LO", "ASLCrusherDescription"], - "925C" : ["CS", "ASLBolusCutoffFlag"], - "925D" : ["SQ", "ASLBolusCutoffTimingSequence"], - "925E" : ["LO", "ASLBolusCutoffTechnique"], - "925F" : ["UL", "ASLBolusCutoffDelayTime"], - "9260" : ["SQ", "ASLSlabSequence"], - "9295" : ["FD", "ChemicalShiftMinimumIntegrationLimitInppm"], - "9296" : ["FD", "ChemicalShiftMaximumIntegrationLimitInppm"], - "9301" : ["SQ", "CTAcquisitionTypeSequence"], - "9302" : ["CS", "AcquisitionType"], - "9303" : ["FD", "TubeAngle"], - "9304" : ["SQ", "CTAcquisitionDetailsSequence"], - "9305" : ["FD", "RevolutionTime"], - "9306" : ["FD", "SingleCollimationWidth"], - "9307" : ["FD", "TotalCollimationWidth"], - "9308" : ["SQ", "CTTableDynamicsSequence"], - "9309" : ["FD", "TableSpeed"], - "9310" : ["FD", "TableFeedPerRotation"], - "9311" : ["FD", "SpiralPitchFactor"], - "9312" : ["SQ", "CTGeometrySequence"], - "9313" : ["FD", "DataCollectionCenterPatient"], - "9314" : ["SQ", "CTReconstructionSequence"], - "9315" : ["CS", "ReconstructionAlgorithm"], - "9316" : ["CS", "ConvolutionKernelGroup"], - "9317" : ["FD", "ReconstructionFieldOfView"], - "9318" : ["FD", "ReconstructionTargetCenterPatient"], - "9319" : ["FD", "ReconstructionAngle"], - "9320" : ["SH", "ImageFilter"], - "9321" : ["SQ", "CTExposureSequence"], - "9322" : ["FD", "ReconstructionPixelSpacing"], - "9323" : ["CS", "ExposureModulationType"], - "9324" : ["FD", "EstimatedDoseSaving"], - "9325" : ["SQ", "CTXRayDetailsSequence"], - "9326" : ["SQ", "CTPositionSequence"], - "9327" : ["FD", "TablePosition"], - "9328" : ["FD", "ExposureTimeInms"], - "9329" : ["SQ", "CTImageFrameTypeSequence"], - "9330" : ["FD", "XRayTubeCurrentInmA"], - "9332" : ["FD", "ExposureInmAs"], - "9333" : ["CS", "ConstantVolumeFlag"], - "9334" : ["CS", "FluoroscopyFlag"], - "9335" : ["FD", "DistanceSourceToDataCollectionCenter"], - "9337" : ["US", "ContrastBolusAgentNumber"], - "9338" : ["SQ", "ContrastBolusIngredientCodeSequence"], - "9340" : ["SQ", "ContrastAdministrationProfileSequence"], - "9341" : ["SQ", "ContrastBolusUsageSequence"], - "9342" : ["CS", "ContrastBolusAgentAdministered"], - "9343" : ["CS", "ContrastBolusAgentDetected"], - "9344" : ["CS", "ContrastBolusAgentPhase"], - "9345" : ["FD", "CTDIvol"], - "9346" : ["SQ", "CTDIPhantomTypeCodeSequence"], - "9351" : ["FL", "CalciumScoringMassFactorPatient"], - "9352" : ["FL", "CalciumScoringMassFactorDevice"], - "9353" : ["FL", "EnergyWeightingFactor"], - "9360" : ["SQ", "CTAdditionalXRaySourceSequence"], - "9401" : ["SQ", "ProjectionPixelCalibrationSequence"], - "9402" : ["FL", "DistanceSourceToIsocenter"], - "9403" : ["FL", "DistanceObjectToTableTop"], - "9404" : ["FL", "ObjectPixelSpacingInCenterOfBeam"], - "9405" : ["SQ", "PositionerPositionSequence"], - "9406" : ["SQ", "TablePositionSequence"], - "9407" : ["SQ", "CollimatorShapeSequence"], - "9410" : ["CS", "PlanesInAcquisition"], - "9412" : ["SQ", "XAXRFFrameCharacteristicsSequence"], - "9417" : ["SQ", "FrameAcquisitionSequence"], - "9420" : ["CS", "XRayReceptorType"], - "9423" : ["LO", "AcquisitionProtocolName"], - "9424" : ["LT", "AcquisitionProtocolDescription"], - "9425" : ["CS", "ContrastBolusIngredientOpaque"], - "9426" : ["FL", "DistanceReceptorPlaneToDetectorHousing"], - "9427" : ["CS", "IntensifierActiveShape"], - "9428" : ["FL", "IntensifierActiveDimensions"], - "9429" : ["FL", "PhysicalDetectorSize"], - "9430" : ["FL", "PositionOfIsocenterProjection"], - "9432" : ["SQ", "FieldOfViewSequence"], - "9433" : ["LO", "FieldOfViewDescription"], - "9434" : ["SQ", "ExposureControlSensingRegionsSequence"], - "9435" : ["CS", "ExposureControlSensingRegionShape"], - "9436" : ["SS", "ExposureControlSensingRegionLeftVerticalEdge"], - "9437" : ["SS", "ExposureControlSensingRegionRightVerticalEdge"], - "9438" : ["SS", "ExposureControlSensingRegionUpperHorizontalEdge"], - "9439" : ["SS", "ExposureControlSensingRegionLowerHorizontalEdge"], - "9440" : ["SS", "CenterOfCircularExposureControlSensingRegion"], - "9441" : ["US", "RadiusOfCircularExposureControlSensingRegion"], - "9442" : ["SS", "VerticesOfThePolygonalExposureControlSensingRegion"], - "9447" : ["FL", "ColumnAngulationPatient"], - "9449" : ["FL", "BeamAngle"], - "9451" : ["SQ", "FrameDetectorParametersSequence"], - "9452" : ["FL", "CalculatedAnatomyThickness"], - "9455" : ["SQ", "CalibrationSequence"], - "9456" : ["SQ", "ObjectThicknessSequence"], - "9457" : ["CS", "PlaneIdentification"], - "9461" : ["FL", "FieldOfViewDimensionsInFloat"], - "9462" : ["SQ", "IsocenterReferenceSystemSequence"], - "9463" : ["FL", "PositionerIsocenterPrimaryAngle"], - "9464" : ["FL", "PositionerIsocenterSecondaryAngle"], - "9465" : ["FL", "PositionerIsocenterDetectorRotationAngle"], - "9466" : ["FL", "TableXPositionToIsocenter"], - "9467" : ["FL", "TableYPositionToIsocenter"], - "9468" : ["FL", "TableZPositionToIsocenter"], - "9469" : ["FL", "TableHorizontalRotationAngle"], - "9470" : ["FL", "TableHeadTiltAngle"], - "9471" : ["FL", "TableCradleTiltAngle"], - "9472" : ["SQ", "FrameDisplayShutterSequence"], - "9473" : ["FL", "AcquiredImageAreaDoseProduct"], - "9474" : ["CS", "CArmPositionerTabletopRelationship"], - "9476" : ["SQ", "XRayGeometrySequence"], - "9477" : ["SQ", "IrradiationEventIdentificationSequence"], - "9504" : ["SQ", "XRay3DFrameTypeSequence"], - "9506" : ["SQ", "ContributingSourcesSequence"], - "9507" : ["SQ", "XRay3DAcquisitionSequence"], - "9508" : ["FL", "PrimaryPositionerScanArc"], - "9509" : ["FL", "SecondaryPositionerScanArc"], - "9510" : ["FL ", "PrimaryPositionerScanStartAngle"], - "9511" : ["FL", "SecondaryPositionerScanStartAngle"], - "9514" : ["FL", "PrimaryPositionerIncrement"], - "9515" : ["FL", "SecondaryPositionerIncrement"], - "9516" : ["DT", "StartAcquisitionDateTime"], - "9517" : ["DT", "EndAcquisitionDateTime"], - "9524" : ["LO", "ApplicationName"], - "9525" : ["LO", "ApplicationVersion"], - "9526" : ["LO", "ApplicationManufacturer"], - "9527" : ["CS", "AlgorithmType"], - "9528" : ["LO", "AlgorithmDescription"], - "9530" : ["SQ", "XRay3DReconstructionSequence"], - "9531" : ["LO", "ReconstructionDescription"], - "9538" : ["SQ", "PerProjectionAcquisitionSequence"], - "9601" : ["SQ", "DiffusionBMatrixSequence"], - "9602" : ["FD", "DiffusionBValueXX"], - "9603" : ["FD", "DiffusionBValueXY"], - "9604" : ["FD", "DiffusionBValueXZ"], - "9605" : ["FD", "DiffusionBValueYY"], - "9606" : ["FD", "DiffusionBValueYZ"], - "9607" : ["FD", "DiffusionBValueZZ"], - "9701" : ["DT", "DecayCorrectionDateTime"], - "9715" : ["FD", "StartDensityThreshold"], - "9716" : ["FD", "StartRelativeDensityDifferenceThreshold"], - "9717" : ["FD", "StartCardiacTriggerCountThreshold"], - "9718" : ["FD", "StartRespiratoryTriggerCountThreshold"], - "9719" : ["FD", "TerminationCountsThreshold"], - "9720" : ["FD", "TerminationDensityThreshold"], - "9721" : ["FD", "TerminationRelativeDensityThreshold"], - "9722" : ["FD", "TerminationTimeThreshold"], - "9723" : ["FD", "TerminationCardiacTriggerCountThreshold"], - "9724" : ["FD", "TerminationRespiratoryTriggerCountThreshold"], - "9725" : ["CS", "DetectorGeometry"], - "9726" : ["FD", "TransverseDetectorSeparation"], - "9727" : ["FD", "AxialDetectorDimension"], - "9729" : ["US", "RadiopharmaceuticalAgentNumber"], - "9732" : ["SQ", "PETFrameAcquisitionSequence"], - "9733" : ["SQ", "PETDetectorMotionDetailsSequence"], - "9734" : ["SQ", "PETTableDynamicsSequence"], - "9735" : ["SQ", "PETPositionSequence"], - "9736" : ["SQ", "PETFrameCorrectionFactorsSequence"], - "9737" : ["SQ", "RadiopharmaceuticalUsageSequence"], - "9738" : ["CS", "AttenuationCorrectionSource"], - "9739" : ["US", "NumberOfIterations"], - "9740" : ["US", "NumberOfSubsets"], - "9749" : ["SQ", "PETReconstructionSequence"], - "9751" : ["SQ", "PETFrameTypeSequence"], - "9755" : ["CS", "TimeOfFlightInformationUsed"], - "9756" : ["CS", "ReconstructionType"], - "9758" : ["CS", "DecayCorrected"], - "9759" : ["CS", "AttenuationCorrected"], - "9760" : ["CS", "ScatterCorrected"], - "9761" : ["CS", "DeadTimeCorrected"], - "9762" : ["CS", "GantryMotionCorrected"], - "9763" : ["CS", "PatientMotionCorrected"], - "9764" : ["CS", "CountLossNormalizationCorrected"], - "9765" : ["CS", "RandomsCorrected"], - "9766" : ["CS", "NonUniformRadialSamplingCorrected"], - "9767" : ["CS", "SensitivityCalibrated"], - "9768" : ["CS", "DetectorNormalizationCorrection"], - "9769" : ["CS", "IterativeReconstructionMethod"], - "9770" : ["CS", "AttenuationCorrectionTemporalRelationship"], - "9771" : ["SQ", "PatientPhysiologicalStateSequence"], - "9772" : ["SQ", "PatientPhysiologicalStateCodeSequence"], - "9801" : ["FD", "DepthsOfFocus"], - "9803" : ["SQ", "ExcludedIntervalsSequence"], - "9804" : ["DT", "ExclusionStartDatetime"], - "9805" : ["FD", "ExclusionDuration"], - "9806" : ["SQ", "USImageDescriptionSequence"], - "9807" : ["SQ", "ImageDataTypeSequence"], - "9808" : ["CS", "DataType"], - "9809" : ["SQ", "TransducerScanPatternCodeSequence"], - "980B" : ["CS", "AliasedDataType"], - "980C" : ["CS", "PositionMeasuringDeviceUsed"], - "980D" : ["SQ", "TransducerGeometryCodeSequence"], - "980E" : ["SQ", "TransducerBeamSteeringCodeSequence"], - "980F" : ["SQ", "TransducerApplicationCodeSequence"], - "A001" : ["SQ", "ContributingEquipmentSequence"], - "A002" : ["DT", "ContributionDateTime"], - "A003" : ["ST", "ContributionDescription"] - }, - "0020" : { - "000D" : ["UI", "StudyInstanceUID"], - "000E" : ["UI", "SeriesInstanceUID"], - "0010" : ["SH", "StudyID"], - "0011" : ["IS", "SeriesNumber"], - "0012" : ["IS", "AcquisitionNumber"], - "0013" : ["IS", "InstanceNumber"], - "0014" : ["IS", "IsotopeNumber"], - "0015" : ["IS", "PhaseNumber"], - "0016" : ["IS", "IntervalNumber"], - "0017" : ["IS", "TimeSlotNumber"], - "0018" : ["IS", "AngleNumber"], - "0019" : ["IS", "ItemNumber"], - "0020" : ["CS", "PatientOrientation"], - "0022" : ["IS", "OverlayNumber"], - "0024" : ["IS", "CurveNumber"], - "0026" : ["IS", "LUTNumber"], - "0030" : ["DS", "ImagePosition"], - "0032" : ["DS", "ImagePositionPatient"], - "0035" : ["DS", "ImageOrientation"], - "0037" : ["DS", "ImageOrientationPatient"], - "0050" : ["DS", "Location"], - "0052" : ["UI", "FrameOfReferenceUID"], - "0060" : ["CS", "Laterality"], - "0062" : ["CS", "ImageLaterality"], - "0070" : ["LO", "ImageGeometryType"], - "0080" : ["CS", "MaskingImage"], - "00AA" : ["IS", "ReportNumber"], - "0100" : ["IS", "TemporalPositionIdentifier"], - "0105" : ["IS", "NumberOfTemporalPositions"], - "0110" : ["DS", "TemporalResolution"], - "0200" : ["UI", "SynchronizationFrameOfReferenceUID"], - "0242" : ["UI", "SOPInstanceUIDOfConcatenationSource"], - "1000" : ["IS", "SeriesInStudy"], - "1001" : ["IS", "AcquisitionsInSeries"], - "1002" : ["IS", "ImagesInAcquisition"], - "1003" : ["IS", "ImagesInSeries"], - "1004" : ["IS", "AcquisitionsInStudy"], - "1005" : ["IS", "ImagesInStudy"], - "1020" : ["LO", "Reference"], - "1040" : ["LO", "PositionReferenceIndicator"], - "1041" : ["DS", "SliceLocation"], - "1070" : ["IS", "OtherStudyNumbers"], - "1200" : ["IS", "NumberOfPatientRelatedStudies"], - "1202" : ["IS", "NumberOfPatientRelatedSeries"], - "1204" : ["IS", "NumberOfPatientRelatedInstances"], - "1206" : ["IS", "NumberOfStudyRelatedSeries"], - "1208" : ["IS", "NumberOfStudyRelatedInstances"], - "1209" : ["IS", "NumberOfSeriesRelatedInstances"], - "3401" : ["CS", "ModifyingDeviceID"], - "3402" : ["CS", "ModifiedImageID"], - "3403" : ["DA", "ModifiedImageDate"], - "3404" : ["LO", "ModifyingDeviceManufacturer"], - "3405" : ["TM", "ModifiedImageTime"], - "3406" : ["LO", "ModifiedImageDescription"], - "4000" : ["LT", "ImageComments"], - "5000" : ["AT", "OriginalImageIdentification"], - "5002" : ["LO", "OriginalImageIdentificationNomenclature"], - "9056" : ["SH", "StackID"], - "9057" : ["UL", "InStackPositionNumber"], - "9071" : ["SQ", "FrameAnatomySequence"], - "9072" : ["CS", "FrameLaterality"], - "9111" : ["SQ", "FrameContentSequence"], - "9113" : ["SQ", "PlanePositionSequence"], - "9116" : ["SQ", "PlaneOrientationSequence"], - "9128" : ["UL", "TemporalPositionIndex"], - "9153" : ["FD", "NominalCardiacTriggerDelayTime"], - "9154" : ["FL", "NominalCardiacTriggerTimePriorToRPeak"], - "9155" : ["FL", "ActualCardiacTriggerTimePriorToRPeak"], - "9156" : ["US", "FrameAcquisitionNumber"], - "9157" : ["UL", "DimensionIndexValues"], - "9158" : ["LT", "FrameComments"], - "9161" : ["UI", "ConcatenationUID"], - "9162" : ["US", "InConcatenationNumber"], - "9163" : ["US", "InConcatenationTotalNumber"], - "9164" : ["UI", "DimensionOrganizationUID"], - "9165" : ["AT", "DimensionIndexPointer"], - "9167" : ["AT", "FunctionalGroupPointer"], - "9213" : ["LO", "DimensionIndexPrivateCreator"], - "9221" : ["SQ", "DimensionOrganizationSequence"], - "9222" : ["SQ", "DimensionIndexSequence"], - "9228" : ["UL", "ConcatenationFrameOffsetNumber"], - "9238" : ["LO", "FunctionalGroupPrivateCreator"], - "9241" : ["FL", "NominalPercentageOfCardiacPhase"], - "9245" : ["FL", "NominalPercentageOfRespiratoryPhase"], - "9246" : ["FL", "StartingRespiratoryAmplitude"], - "9247" : ["CS", "StartingRespiratoryPhase"], - "9248" : ["FL", "EndingRespiratoryAmplitude"], - "9249" : ["CS", "EndingRespiratoryPhase"], - "9250" : ["CS", "RespiratoryTriggerType"], - "9251" : ["FD", "RRIntervalTimeNominal"], - "9252" : ["FD", "ActualCardiacTriggerDelayTime"], - "9253" : ["SQ", "RespiratorySynchronizationSequence"], - "9254" : ["FD", "RespiratoryIntervalTime"], - "9255" : ["FD", "NominalRespiratoryTriggerDelayTime"], - "9256" : ["FD", "RespiratoryTriggerDelayThreshold"], - "9257" : ["FD", "ActualRespiratoryTriggerDelayTime"], - "9301" : ["FD", "ImagePositionVolume"], - "9302" : ["FD", "ImageOrientationVolume"], - "9307" : ["CS", "UltrasoundAcquisitionGeometry"], - "9308" : ["FD", "ApexPosition"], - "9309" : ["FD", "VolumeToTransducerMappingMatrix"], - "930A" : ["FD", "VolumeToTableMappingMatrix"], - "930C" : ["CS", "PatientFrameOfReferenceSource"], - "930D" : ["FD", "TemporalPositionTimeOffset"], - "930E" : ["SQ", "PlanePositionVolumeSequence"], - "930F" : ["SQ", "PlaneOrientationVolumeSequence"], - "9310" : ["SQ", "TemporalPositionSequence"], - "9311" : ["CS", "DimensionOrganizationType"], - "9312" : ["UI", "VolumeFrameOfReferenceUID"], - "9313" : ["UI", "TableFrameOfReferenceUID"], - "9421" : ["LO", "DimensionDescriptionLabel"], - "9450" : ["SQ", "PatientOrientationInFrameSequence"], - "9453" : ["LO", "FrameLabel"], - "9518" : ["US", "AcquisitionIndex"], - "9529" : ["SQ", "ContributingSOPInstancesReferenceSequence"], - "9536" : ["US", "ReconstructionIndex"] - }, - "0022" : { - "0001" : ["US", "LightPathFilterPassThroughWavelength"], - "0002" : ["US", "LightPathFilterPassBand"], - "0003" : ["US", "ImagePathFilterPassThroughWavelength"], - "0004" : ["US", "ImagePathFilterPassBand"], - "0005" : ["CS", "PatientEyeMovementCommanded"], - "0006" : ["SQ", "PatientEyeMovementCommandCodeSequence"], - "0007" : ["FL", "SphericalLensPower"], - "0008" : ["FL", "CylinderLensPower"], - "0009" : ["FL", "CylinderAxis"], - "000A" : ["FL", "EmmetropicMagnification"], - "000B" : ["FL", "IntraOcularPressure"], - "000C" : ["FL", "HorizontalFieldOfView"], - "000D" : ["CS", "PupilDilated"], - "000E" : ["FL", "DegreeOfDilation"], - "0010" : ["FL", "StereoBaselineAngle"], - "0011" : ["FL", "StereoBaselineDisplacement"], - "0012" : ["FL", "StereoHorizontalPixelOffset"], - "0013" : ["FL", "StereoVerticalPixelOffset"], - "0014" : ["FL", "StereoRotation"], - "0015" : ["SQ", "AcquisitionDeviceTypeCodeSequence"], - "0016" : ["SQ", "IlluminationTypeCodeSequence"], - "0017" : ["SQ", "LightPathFilterTypeStackCodeSequence"], - "0018" : ["SQ", "ImagePathFilterTypeStackCodeSequence"], - "0019" : ["SQ", "LensesCodeSequence"], - "001A" : ["SQ", "ChannelDescriptionCodeSequence"], - "001B" : ["SQ", "RefractiveStateSequence"], - "001C" : ["SQ", "MydriaticAgentCodeSequence"], - "001D" : ["SQ", "RelativeImagePositionCodeSequence"], - "001E" : ["FL", "CameraAngleOfView"], - "0020" : ["SQ", "StereoPairsSequence"], - "0021" : ["SQ", "LeftImageSequence"], - "0022" : ["SQ", "RightImageSequence"], - "0030" : ["FL", "AxialLengthOfTheEye"], - "0031" : ["SQ", "OphthalmicFrameLocationSequence"], - "0032" : ["FL", "ReferenceCoordinates"], - "0035" : ["FL", "DepthSpatialResolution"], - "0036" : ["FL", "MaximumDepthDistortion"], - "0037" : ["FL", "AlongScanSpatialResolution"], - "0038" : ["FL", "MaximumAlongScanDistortion"], - "0039" : ["CS", "OphthalmicImageOrientation"], - "0041" : ["FL", "DepthOfTransverseImage"], - "0042" : ["SQ", "MydriaticAgentConcentrationUnitsSequence"], - "0048" : ["FL", "AcrossScanSpatialResolution"], - "0049" : ["FL", "MaximumAcrossScanDistortion"], - "004E" : ["DS", "MydriaticAgentConcentration"], - "0055" : ["FL", "IlluminationWaveLength"], - "0056" : ["FL", "IlluminationPower"], - "0057" : ["FL", "IlluminationBandwidth"], - "0058" : ["SQ", "MydriaticAgentSequence"], - "1007" : ["SQ", "OphthalmicAxialMeasurementsRightEyeSequence"], - "1008" : ["SQ", "OphthalmicAxialMeasurementsLeftEyeSequence"], - "1010" : ["CS", "OphthalmicAxialLengthMeasurementsType"], - "1019" : ["FL", "OphthalmicAxialLength"], - "1024" : ["SQ", "LensStatusCodeSequence"], - "1025" : ["SQ", "VitreousStatusCodeSequence"], - "1028" : ["SQ", "IOLFormulaCodeSequence"], - "1029" : ["LO", "IOLFormulaDetail"], - "1033" : ["FL", "KeratometerIndex"], - "1035" : ["SQ", "SourceOfOphthalmicAxialLengthCodeSequence"], - "1037" : ["FL", "TargetRefraction"], - "1039" : ["CS", "RefractiveProcedureOccurred"], - "1040" : ["SQ", "RefractiveSurgeryTypeCodeSequence"], - "1044" : ["SQ", "OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence"], - "1050" : ["SQ", "OphthalmicAxialLengthMeasurementsSequence"], - "1053" : ["FL", "IOLPower"], - "1054" : ["FL", "PredictedRefractiveError"], - "1059" : ["FL", "OphthalmicAxialLengthVelocity"], - "1065" : ["LO", "LensStatusDescription"], - "1066" : ["LO", "VitreousStatusDescription"], - "1090" : ["SQ", "IOLPowerSequence"], - "1092" : ["SQ", "LensConstantSequence"], - "1093" : ["LO", "IOLManufacturer"], - "1094" : ["LO", "LensConstantDescription"], - "1096" : ["SQ", "KeratometryMeasurementTypeCodeSequence"], - "1100" : ["SQ", "ReferencedOphthalmicAxialMeasurementsSequence"], - "1101" : ["SQ", "OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"], - "1103" : ["SQ", "RefractiveErrorBeforeRefractiveSurgeryCodeSequence"], - "1121" : ["FL", "IOLPowerForExactEmmetropia"], - "1122" : ["FL", "IOLPowerForExactTargetRefraction"], - "1125" : ["SQ", "AnteriorChamberDepthDefinitionCodeSequence"], - "1130" : ["FL", "LensThickness"], - "1131" : ["FL", "AnteriorChamberDepth"], - "1132" : ["SQ", "SourceOfLensThicknessDataCodeSequence"], - "1133" : ["SQ", "SourceOfAnteriorChamberDepthDataCodeSequence"], - "1135" : ["SQ", "SourceOfRefractiveErrorDataCodeSequence"], - "1140" : ["CS", "OphthalmicAxialLengthMeasurementModified"], - "1150" : ["SQ", "OphthalmicAxialLengthDataSourceCodeSequence"], - "1153" : ["SQ", "OphthalmicAxialLengthAcquisitionMethodCodeSequence"], - "1155" : ["FL", "SignalToNoiseRatio"], - "1159" : ["LO", "OphthalmicAxialLengthDataSourceDescription"], - "1210" : ["SQ", "OphthalmicAxialLengthMeasurementsTotalLengthSequence"], - "1211" : ["SQ", "OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"], - "1212" : ["SQ", "OphthalmicAxialLengthMeasurementsLengthSummationSequence"], - "1220" : ["SQ", "UltrasoundOphthalmicAxialLengthMeasurementsSequence"], - "1225" : ["SQ", "OpticalOphthalmicAxialLengthMeasurementsSequence"], - "1230" : ["SQ", "UltrasoundSelectedOphthalmicAxialLengthSequence"], - "1250" : ["SQ", "OphthalmicAxialLengthSelectionMethodCodeSequence"], - "1255" : ["SQ", "OpticalSelectedOphthalmicAxialLengthSequence"], - "1257" : ["SQ", "SelectedSegmentalOphthalmicAxialLengthSequence"], - "1260" : ["SQ", "SelectedTotalOphthalmicAxialLengthSequence"], - "1262" : ["SQ", "OphthalmicAxialLengthQualityMetricSequence"], - "1273" : ["LO", "OphthalmicAxialLengthQualityMetricTypeDescription"], - "1300" : ["SQ", "IntraocularLensCalculationsRightEyeSequence"], - "1310" : ["SQ", "IntraocularLensCalculationsLeftEyeSequence"], - "1330" : ["SQ", "ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"] - }, - "0024" : { - "0010" : ["FL", "VisualFieldHorizontalExtent"], - "0011" : ["FL", "VisualFieldVerticalExtent"], - "0012" : ["CS", "VisualFieldShape"], - "0016" : ["SQ", "ScreeningTestModeCodeSequence"], - "0018" : ["FL", "MaximumStimulusLuminance"], - "0020" : ["FL", "BackgroundLuminance"], - "0021" : ["SQ", "StimulusColorCodeSequence"], - "0024" : ["SQ", "BackgroundIlluminationColorCodeSequence"], - "0025" : ["FL", "StimulusArea"], - "0028" : ["FL", "StimulusPresentationTime"], - "0032" : ["SQ", "FixationSequence"], - "0033" : ["SQ", "FixationMonitoringCodeSequence"], - "0034" : ["SQ", "VisualFieldCatchTrialSequence"], - "0035" : ["US", "FixationCheckedQuantity"], - "0036" : ["US", "PatientNotProperlyFixatedQuantity"], - "0037" : ["CS", "PresentedVisualStimuliDataFlag"], - "0038" : ["US", "NumberOfVisualStimuli"], - "0039" : ["CS", "ExcessiveFixationLossesDataFlag"], - "0040" : ["CS", "ExcessiveFixationLosses"], - "0042" : ["US", "StimuliRetestingQuantity"], - "0044" : ["LT", "CommentsOnPatientPerformanceOfVisualField"], - "0045" : ["CS", "FalseNegativesEstimateFlag"], - "0046" : ["FL", "FalseNegativesEstimate"], - "0048" : ["US", "NegativeCatchTrialsQuantity"], - "0050" : ["US", "FalseNegativesQuantity"], - "0051" : ["CS", "ExcessiveFalseNegativesDataFlag"], - "0052" : ["CS", "ExcessiveFalseNegatives"], - "0053" : ["CS", "FalsePositivesEstimateFlag"], - "0054" : ["FL", "FalsePositivesEstimate"], - "0055" : ["CS", "CatchTrialsDataFlag"], - "0056" : ["US", "PositiveCatchTrialsQuantity"], - "0057" : ["CS", "TestPointNormalsDataFlag"], - "0058" : ["SQ", "TestPointNormalsSequence"], - "0059" : ["CS", "GlobalDeviationProbabilityNormalsFlag"], - "0060" : ["US", "FalsePositivesQuantity"], - "0061" : ["CS", "ExcessiveFalsePositivesDataFlag"], - "0062" : ["CS", "ExcessiveFalsePositives"], - "0063" : ["CS", "VisualFieldTestNormalsFlag"], - "0064" : ["SQ", "ResultsNormalsSequence"], - "0065" : ["SQ", "AgeCorrectedSensitivityDeviationAlgorithmSequence"], - "0066" : ["FL", "GlobalDeviationFromNormal"], - "0067" : ["SQ", "GeneralizedDefectSensitivityDeviationAlgorithmSequence"], - "0068" : ["FL", "LocalizedDeviationfromNormal"], - "0069" : ["LO", "PatientReliabilityIndicator"], - "0070" : ["FL", "VisualFieldMeanSensitivity"], - "0071" : ["FL", "GlobalDeviationProbability"], - "0072" : ["CS", "LocalDeviationProbabilityNormalsFlag"], - "0073" : ["FL", "LocalizedDeviationProbability"], - "0074" : ["CS", "ShortTermFluctuationCalculated"], - "0075" : ["FL", "ShortTermFluctuation"], - "0076" : ["CS", "ShortTermFluctuationProbabilityCalculated"], - "0077" : ["FL", "ShortTermFluctuationProbability"], - "0078" : ["CS", "CorrectedLocalizedDeviationFromNormalCalculated"], - "0079" : ["FL", "CorrectedLocalizedDeviationFromNormal"], - "0080" : ["CS", "CorrectedLocalizedDeviationFromNormalProbabilityCalculated"], - "0081" : ["FL", "CorrectedLocalizedDeviationFromNormalProbability"], - "0083" : ["SQ", "GlobalDeviationProbabilitySequence"], - "0085" : ["SQ", "LocalizedDeviationProbabilitySequence"], - "0086" : ["CS", "FovealSensitivityMeasured"], - "0087" : ["FL", "FovealSensitivity"], - "0088" : ["FL", "VisualFieldTestDuration"], - "0089" : ["SQ", "VisualFieldTestPointSequence"], - "0090" : ["FL", "VisualFieldTestPointXCoordinate"], - "0091" : ["FL", "VisualFieldTestPointYCoordinate"], - "0092" : ["FL", "AgeCorrectedSensitivityDeviationValue"], - "0093" : ["CS", "StimulusResults"], - "0094" : ["FL", "SensitivityValue"], - "0095" : ["CS", "RetestStimulusSeen"], - "0096" : ["FL", "RetestSensitivityValue"], - "0097" : ["SQ", "VisualFieldTestPointNormalsSequence"], - "0098" : ["FL", "QuantifiedDefect"], - "0100" : ["FL", "AgeCorrectedSensitivityDeviationProbabilityValue"], - "0102" : ["CS", "GeneralizedDefectCorrectedSensitivityDeviationFlag "], - "0103" : ["FL", "GeneralizedDefectCorrectedSensitivityDeviationValue "], - "0104" : ["FL", "GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"], - "0105" : ["FL ", "MinimumSensitivityValue"], - "0106" : ["CS", "BlindSpotLocalized"], - "0107" : ["FL", "BlindSpotXCoordinate"], - "0108" : ["FL", "BlindSpotYCoordinate "], - "0110" : ["SQ", "VisualAcuityMeasurementSequence"], - "0112" : ["SQ", "RefractiveParametersUsedOnPatientSequence"], - "0113" : ["CS", "MeasurementLaterality"], - "0114" : ["SQ", "OphthalmicPatientClinicalInformationLeftEyeSequence"], - "0115" : ["SQ", "OphthalmicPatientClinicalInformationRightEyeSequence"], - "0117" : ["CS", "FovealPointNormativeDataFlag"], - "0118" : ["FL", "FovealPointProbabilityValue"], - "0120" : ["CS", "ScreeningBaselineMeasured"], - "0122" : ["SQ", "ScreeningBaselineMeasuredSequence"], - "0124" : ["CS", "ScreeningBaselineType"], - "0126" : ["FL", "ScreeningBaselineValue"], - "0202" : ["LO", "AlgorithmSource"], - "0306" : ["LO", "DataSetName"], - "0307" : ["LO", "DataSetVersion"], - "0308" : ["LO", "DataSetSource"], - "0309" : ["LO", "DataSetDescription"], - "0317" : ["SQ", "VisualFieldTestReliabilityGlobalIndexSequence"], - "0320" : ["SQ", "VisualFieldGlobalResultsIndexSequence"], - "0325" : ["SQ", "DataObservationSequence"], - "0338" : ["CS", "IndexNormalsFlag"], - "0341" : ["FL", "IndexProbability"], - "0344" : ["SQ", "IndexProbabilitySequence"] - }, - "0028" : { - "0002" : ["US", "SamplesPerPixel"], - "0003" : ["US", "SamplesPerPixelUsed"], - "0004" : ["CS", "PhotometricInterpretation"], - "0005" : ["US", "ImageDimensions"], - "0006" : ["US", "PlanarConfiguration"], - "0008" : ["IS", "NumberOfFrames"], - "0009" : ["AT", "FrameIncrementPointer"], - "000A" : ["AT", "FrameDimensionPointer"], - "0010" : ["US", "Rows"], - "0011" : ["US", "Columns"], - "0012" : ["US", "Planes"], - "0014" : ["US", "UltrasoundColorDataPresent"], - "0030" : ["DS", "PixelSpacing"], - "0031" : ["DS", "ZoomFactor"], - "0032" : ["DS", "ZoomCenter"], - "0034" : ["IS", "PixelAspectRatio"], - "0040" : ["CS", "ImageFormat"], - "0050" : ["LO", "ManipulatedImage"], - "0051" : ["CS", "CorrectedImage"], - "005F" : ["LO", "CompressionRecognitionCode"], - "0060" : ["CS", "CompressionCode"], - "0061" : ["SH", "CompressionOriginator"], - "0062" : ["LO", "CompressionLabel"], - "0063" : ["SH", "CompressionDescription"], - "0065" : ["CS", "CompressionSequence"], - "0066" : ["AT", "CompressionStepPointers"], - "0068" : ["US", "RepeatInterval"], - "0069" : ["US", "BitsGrouped"], - "0070" : ["US", "PerimeterTable"], - "0071" : ["SS", "PerimeterValue"], - "0080" : ["US", "PredictorRows"], - "0081" : ["US", "PredictorColumns"], - "0082" : ["US", "PredictorConstants"], - "0090" : ["CS", "BlockedPixels"], - "0091" : ["US", "BlockRows"], - "0092" : ["US", "BlockColumns"], - "0093" : ["US", "RowOverlap"], - "0094" : ["US", "ColumnOverlap"], - "0100" : ["US", "BitsAllocated"], - "0101" : ["US", "BitsStored"], - "0102" : ["US", "HighBit"], - "0103" : ["US", "PixelRepresentation"], - "0104" : ["SS", "SmallestValidPixelValue"], - "0105" : ["SS", "LargestValidPixelValue"], - "0106" : ["SS", "SmallestImagePixelValue"], - "0107" : ["SS", "LargestImagePixelValue"], - "0108" : ["SS", "SmallestPixelValueInSeries"], - "0109" : ["SS", "LargestPixelValueInSeries"], - "0110" : ["SS", "SmallestImagePixelValueInPlane"], - "0111" : ["SS", "LargestImagePixelValueInPlane"], - "0120" : ["SS", "PixelPaddingValue"], - "0121" : ["SS", "PixelPaddingRangeLimit"], - "0200" : ["US", "ImageLocation"], - "0300" : ["CS", "QualityControlImage"], - "0301" : ["CS", "BurnedInAnnotation"], - "0302" : ["CS", "RecognizableVisualFeatures"], - "0303" : ["CS", "LongitudinalTemporalInformationModified"], - "0400" : ["LO", "TransformLabel"], - "0401" : ["LO", "TransformVersionNumber"], - "0402" : ["US", "NumberOfTransformSteps"], - "0403" : ["LO", "SequenceOfCompressedData"], - "0404" : ["AT", "DetailsOfCoefficients"], - "0700" : ["LO", "DCTLabel"], - "0701" : ["CS", "DataBlockDescription"], - "0702" : ["AT", "DataBlock"], - "0710" : ["US", "NormalizationFactorFormat"], - "0720" : ["US", "ZonalMapNumberFormat"], - "0721" : ["AT", "ZonalMapLocation"], - "0722" : ["US", "ZonalMapFormat"], - "0730" : ["US", "AdaptiveMapFormat"], - "0740" : ["US", "CodeNumberFormat"], - "0A02" : ["CS", "PixelSpacingCalibrationType"], - "0A04" : ["LO", "PixelSpacingCalibrationDescription"], - "1040" : ["CS", "PixelIntensityRelationship"], - "1041" : ["SS", "PixelIntensityRelationshipSign"], - "1050" : ["DS", "WindowCenter"], - "1051" : ["DS", "WindowWidth"], - "1052" : ["DS", "RescaleIntercept"], - "1053" : ["DS", "RescaleSlope"], - "1054" : ["LO", "RescaleType"], - "1055" : ["LO", "WindowCenterWidthExplanation"], - "1056" : ["CS", "VOILUTFunction"], - "1080" : ["CS", "GrayScale"], - "1090" : ["CS", "RecommendedViewingMode"], - "1100" : ["SS", "GrayLookupTableDescriptor"], - "1101" : ["SS", "RedPaletteColorLookupTableDescriptor"], - "1102" : ["SS", "GreenPaletteColorLookupTableDescriptor"], - "1103" : ["SS", "BluePaletteColorLookupTableDescriptor"], - "1104" : ["US", "AlphaPaletteColorLookupTableDescriptor"], - "1111" : ["SS", "LargeRedPaletteColorLookupTableDescriptor"], - "1112" : ["SS", "LargeGreenPaletteColorLookupTableDescriptor"], - "1113" : ["SS", "LargeBluePaletteColorLookupTableDescriptor"], - "1199" : ["UI", "PaletteColorLookupTableUID"], - "1200" : ["OW", "GrayLookupTableData"], - "1201" : ["OW", "RedPaletteColorLookupTableData"], - "1202" : ["OW", "GreenPaletteColorLookupTableData"], - "1203" : ["OW", "BluePaletteColorLookupTableData"], - "1204" : ["OW", "AlphaPaletteColorLookupTableData"], - "1211" : ["OW", "LargeRedPaletteColorLookupTableData"], - "1212" : ["OW", "LargeGreenPaletteColorLookupTableData"], - "1213" : ["OW", "LargeBluePaletteColorLookupTableData"], - "1214" : ["UI", "LargePaletteColorLookupTableUID"], - "1221" : ["OW", "SegmentedRedPaletteColorLookupTableData"], - "1222" : ["OW", "SegmentedGreenPaletteColorLookupTableData"], - "1223" : ["OW", "SegmentedBluePaletteColorLookupTableData"], - "1300" : ["CS", "BreastImplantPresent"], - "1350" : ["CS", "PartialView"], - "1351" : ["ST", "PartialViewDescription"], - "1352" : ["SQ", "PartialViewCodeSequence"], - "135A" : ["CS", "SpatialLocationsPreserved"], - "1401" : ["SQ", "DataFrameAssignmentSequence"], - "1402" : ["CS", "DataPathAssignment"], - "1403" : ["US", "BitsMappedToColorLookupTable"], - "1404" : ["SQ", "BlendingLUT1Sequence"], - "1405" : ["CS", "BlendingLUT1TransferFunction"], - "1406" : ["FD", "BlendingWeightConstant"], - "1407" : ["US", "BlendingLookupTableDescriptor"], - "1408" : ["OW", "BlendingLookupTableData"], - "140B" : ["SQ", "EnhancedPaletteColorLookupTableSequence"], - "140C" : ["SQ", "BlendingLUT2Sequence"], - "140D" : ["CS", "BlendingLUT2TransferFunction"], - "140E" : ["CS", "DataPathID"], - "140F" : ["CS", "RGBLUTTransferFunction"], - "1410" : ["CS", "AlphaLUTTransferFunction"], - "2000" : ["OB", "ICCProfile"], - "2110" : ["CS", "LossyImageCompression"], - "2112" : ["DS", "LossyImageCompressionRatio"], - "2114" : ["CS", "LossyImageCompressionMethod"], - "3000" : ["SQ", "ModalityLUTSequence"], - "3002" : ["SS", "LUTDescriptor"], - "3003" : ["LO", "LUTExplanation"], - "3004" : ["LO", "ModalityLUTType"], - "3006" : ["OW", "LUTData"], - "3010" : ["SQ", "VOILUTSequence"], - "3110" : ["SQ", "SoftcopyVOILUTSequence"], - "4000" : ["LT", "ImagePresentationComments"], - "5000" : ["SQ", "BiPlaneAcquisitionSequence"], - "6010" : ["US", "RepresentativeFrameNumber"], - "6020" : ["US", "FrameNumbersOfInterest"], - "6022" : ["LO", "FrameOfInterestDescription"], - "6023" : ["CS", "FrameOfInterestType"], - "6030" : ["US", "MaskPointers"], - "6040" : ["US", "RWavePointer"], - "6100" : ["SQ", "MaskSubtractionSequence"], - "6101" : ["CS", "MaskOperation"], - "6102" : ["US", "ApplicableFrameRange"], - "6110" : ["US", "MaskFrameNumbers"], - "6112" : ["US", "ContrastFrameAveraging"], - "6114" : ["FL", "MaskSubPixelShift"], - "6120" : ["SS", "TIDOffset"], - "6190" : ["ST", "MaskOperationExplanation"], - "7FE0" : ["UT", "PixelDataProviderURL"], - "9001" : ["UL", "DataPointRows"], - "9002" : ["UL", "DataPointColumns"], - "9003" : ["CS", "SignalDomainColumns"], - "9099" : ["US", "LargestMonochromePixelValue"], - "9108" : ["CS", "DataRepresentation"], - "9110" : ["SQ", "PixelMeasuresSequence"], - "9132" : ["SQ", "FrameVOILUTSequence"], - "9145" : ["SQ", "PixelValueTransformationSequence"], - "9235" : ["CS", "SignalDomainRows"], - "9411" : ["FL", "DisplayFilterPercentage"], - "9415" : ["SQ", "FramePixelShiftSequence"], - "9416" : ["US", "SubtractionItemID"], - "9422" : ["SQ", "PixelIntensityRelationshipLUTSequence"], - "9443" : ["SQ", "FramePixelDataPropertiesSequence"], - "9444" : ["CS", "GeometricalProperties"], - "9445" : ["FL", "GeometricMaximumDistortion"], - "9446" : ["CS", "ImageProcessingApplied"], - "9454" : ["CS", "MaskSelectionMode"], - "9474" : ["CS", "LUTFunction"], - "9478" : ["FL", "MaskVisibilityPercentage"], - "9501" : ["SQ", "PixelShiftSequence"], - "9502" : ["SQ", "RegionPixelShiftSequence"], - "9503" : ["SS", "VerticesOfTheRegion"], - "9505" : ["SQ", "MultiFramePresentationSequence"], - "9506" : ["US", "PixelShiftFrameRange"], - "9507" : ["US", "LUTFrameRange"], - "9520" : ["DS", "ImageToEquipmentMappingMatrix"], - "9537" : ["CS", "EquipmentCoordinateSystemIdentification"] - }, - "0032" : { - "000A" : ["CS", "StudyStatusID"], - "000C" : ["CS", "StudyPriorityID"], - "0012" : ["LO", "StudyIDIssuer"], - "0032" : ["DA", "StudyVerifiedDate"], - "0033" : ["TM", "StudyVerifiedTime"], - "0034" : ["DA", "StudyReadDate"], - "0035" : ["TM", "StudyReadTime"], - "1000" : ["DA", "ScheduledStudyStartDate"], - "1001" : ["TM", "ScheduledStudyStartTime"], - "1010" : ["DA", "ScheduledStudyStopDate"], - "1011" : ["TM", "ScheduledStudyStopTime"], - "1020" : ["LO", "ScheduledStudyLocation"], - "1021" : ["AE", "ScheduledStudyLocationAETitle"], - "1030" : ["LO", "ReasonForStudy"], - "1031" : ["SQ", "RequestingPhysicianIdentificationSequence"], - "1032" : ["PN", "RequestingPhysician"], - "1033" : ["LO", "RequestingService"], - "1034" : ["SQ", "RequestingServiceCodeSequence"], - "1040" : ["DA", "StudyArrivalDate"], - "1041" : ["TM", "StudyArrivalTime"], - "1050" : ["DA", "StudyCompletionDate"], - "1051" : ["TM", "StudyCompletionTime"], - "1055" : ["CS", "StudyComponentStatusID"], - "1060" : ["LO", "RequestedProcedureDescription"], - "1064" : ["SQ", "RequestedProcedureCodeSequence"], - "1070" : ["LO", "RequestedContrastAgent"], - "4000" : ["LT", "StudyComments"] - }, - "0038" : { - "0004" : ["SQ", "ReferencedPatientAliasSequence"], - "0008" : ["CS", "VisitStatusID"], - "0010" : ["LO", "AdmissionID"], - "0011" : ["LO", "IssuerOfAdmissionID"], - "0014" : ["SQ", "IssuerOfAdmissionIDSequence"], - "0016" : ["LO", "RouteOfAdmissions"], - "001A" : ["DA", "ScheduledAdmissionDate"], - "001B" : ["TM", "ScheduledAdmissionTime"], - "001C" : ["DA", "ScheduledDischargeDate"], - "001D" : ["TM", "ScheduledDischargeTime"], - "001E" : ["LO", "ScheduledPatientInstitutionResidence"], - "0020" : ["DA", "AdmittingDate"], - "0021" : ["TM", "AdmittingTime"], - "0030" : ["DA", "DischargeDate"], - "0032" : ["TM", "DischargeTime"], - "0040" : ["LO", "DischargeDiagnosisDescription"], - "0044" : ["SQ", "DischargeDiagnosisCodeSequence"], - "0050" : ["LO", "SpecialNeeds"], - "0060" : ["LO", "ServiceEpisodeID"], - "0061" : ["LO", "IssuerOfServiceEpisodeID"], - "0062" : ["LO", "ServiceEpisodeDescription"], - "0064" : ["SQ", "IssuerOfServiceEpisodeIDSequence"], - "0100" : ["SQ", "PertinentDocumentsSequence"], - "0300" : ["LO", "CurrentPatientLocation"], - "0400" : ["LO", "PatientInstitutionResidence"], - "0500" : ["LO", "PatientState"], - "0502" : ["SQ", "PatientClinicalTrialParticipationSequence"], - "4000" : ["LT", "VisitComments"] - }, - "003A" : { - "0004" : ["CS", "WaveformOriginality"], - "0005" : ["US", "NumberOfWaveformChannels"], - "0010" : ["UL", "NumberOfWaveformSamples"], - "001A" : ["DS", "SamplingFrequency"], - "0020" : ["SH", "MultiplexGroupLabel"], - "0200" : ["SQ", "ChannelDefinitionSequence"], - "0202" : ["IS", "WaveformChannelNumber"], - "0203" : ["SH", "ChannelLabel"], - "0205" : ["CS", "ChannelStatus"], - "0208" : ["SQ", "ChannelSourceSequence"], - "0209" : ["SQ", "ChannelSourceModifiersSequence"], - "020A" : ["SQ", "SourceWaveformSequence"], - "020C" : ["LO", "ChannelDerivationDescription"], - "0210" : ["DS", "ChannelSensitivity"], - "0211" : ["SQ", "ChannelSensitivityUnitsSequence"], - "0212" : ["DS", "ChannelSensitivityCorrectionFactor"], - "0213" : ["DS", "ChannelBaseline"], - "0214" : ["DS", "ChannelTimeSkew"], - "0215" : ["DS", "ChannelSampleSkew"], - "0218" : ["DS", "ChannelOffset"], - "021A" : ["US", "WaveformBitsStored"], - "0220" : ["DS", "FilterLowFrequency"], - "0221" : ["DS", "FilterHighFrequency"], - "0222" : ["DS", "NotchFilterFrequency"], - "0223" : ["DS", "NotchFilterBandwidth"], - "0230" : ["FL", "WaveformDataDisplayScale"], - "0231" : ["US", "WaveformDisplayBackgroundCIELabValue"], - "0240" : ["SQ", "WaveformPresentationGroupSequence"], - "0241" : ["US", "PresentationGroupNumber"], - "0242" : ["SQ", "ChannelDisplaySequence"], - "0244" : ["US", "ChannelRecommendedDisplayCIELabValue"], - "0245" : ["FL", "ChannelPosition"], - "0246" : ["CS", "DisplayShadingFlag"], - "0247" : ["FL", "FractionalChannelDisplayScale"], - "0248" : ["FL", "AbsoluteChannelDisplayScale"], - "0300" : ["SQ", "MultiplexedAudioChannelsDescriptionCodeSequence"], - "0301" : ["IS", "ChannelIdentificationCode"], - "0302" : ["CS", "ChannelMode"] - }, - "0040" : { - "0001" : ["AE", "ScheduledStationAETitle"], - "0002" : ["DA", "ScheduledProcedureStepStartDate"], - "0003" : ["TM", "ScheduledProcedureStepStartTime"], - "0004" : ["DA", "ScheduledProcedureStepEndDate"], - "0005" : ["TM", "ScheduledProcedureStepEndTime"], - "0006" : ["PN", "ScheduledPerformingPhysicianName"], - "0007" : ["LO", "ScheduledProcedureStepDescription"], - "0008" : ["SQ", "ScheduledProtocolCodeSequence"], - "0009" : ["SH", "ScheduledProcedureStepID"], - "000A" : ["SQ", "StageCodeSequence"], - "000B" : ["SQ", "ScheduledPerformingPhysicianIdentificationSequence"], - "0010" : ["SH", "ScheduledStationName"], - "0011" : ["SH", "ScheduledProcedureStepLocation"], - "0012" : ["LO", "PreMedication"], - "0020" : ["CS", "ScheduledProcedureStepStatus"], - "0026" : ["SQ", "OrderPlacerIdentifierSequence"], - "0027" : ["SQ", "OrderFillerIdentifierSequence"], - "0031" : ["UT", "LocalNamespaceEntityID"], - "0032" : ["UT", "UniversalEntityID"], - "0033" : ["CS", "UniversalEntityIDType"], - "0035" : ["CS", "IdentifierTypeCode"], - "0036" : ["SQ", "AssigningFacilitySequence"], - "0039" : ["SQ", "AssigningJurisdictionCodeSequence"], - "003A" : ["SQ", "AssigningAgencyOrDepartmentCodeSequence"], - "0100" : ["SQ", "ScheduledProcedureStepSequence"], - "0220" : ["SQ", "ReferencedNonImageCompositeSOPInstanceSequence"], - "0241" : ["AE", "PerformedStationAETitle"], - "0242" : ["SH", "PerformedStationName"], - "0243" : ["SH", "PerformedLocation"], - "0244" : ["DA", "PerformedProcedureStepStartDate"], - "0245" : ["TM", "PerformedProcedureStepStartTime"], - "0250" : ["DA", "PerformedProcedureStepEndDate"], - "0251" : ["TM", "PerformedProcedureStepEndTime"], - "0252" : ["CS", "PerformedProcedureStepStatus"], - "0253" : ["SH", "PerformedProcedureStepID"], - "0254" : ["LO", "PerformedProcedureStepDescription"], - "0255" : ["LO", "PerformedProcedureTypeDescription"], - "0260" : ["SQ", "PerformedProtocolCodeSequence"], - "0261" : ["CS", "PerformedProtocolType"], - "0270" : ["SQ", "ScheduledStepAttributesSequence"], - "0275" : ["SQ", "RequestAttributesSequence"], - "0280" : ["ST", "CommentsOnThePerformedProcedureStep"], - "0281" : ["SQ", "PerformedProcedureStepDiscontinuationReasonCodeSequence"], - "0293" : ["SQ", "QuantitySequence"], - "0294" : ["DS", "Quantity"], - "0295" : ["SQ", "MeasuringUnitsSequence"], - "0296" : ["SQ", "BillingItemSequence"], - "0300" : ["US", "TotalTimeOfFluoroscopy"], - "0301" : ["US", "TotalNumberOfExposures"], - "0302" : ["US", "EntranceDose"], - "0303" : ["US", "ExposedArea"], - "0306" : ["DS", "DistanceSourceToEntrance"], - "0307" : ["DS", "DistanceSourceToSupport"], - "030E" : ["SQ", "ExposureDoseSequence"], - "0310" : ["ST", "CommentsOnRadiationDose"], - "0312" : ["DS", "XRayOutput"], - "0314" : ["DS", "HalfValueLayer"], - "0316" : ["DS", "OrganDose"], - "0318" : ["CS", "OrganExposed"], - "0320" : ["SQ", "BillingProcedureStepSequence"], - "0321" : ["SQ", "FilmConsumptionSequence"], - "0324" : ["SQ", "BillingSuppliesAndDevicesSequence"], - "0330" : ["SQ", "ReferencedProcedureStepSequence"], - "0340" : ["SQ", "PerformedSeriesSequence"], - "0400" : ["LT", "CommentsOnTheScheduledProcedureStep"], - "0440" : ["SQ", "ProtocolContextSequence"], - "0441" : ["SQ", "ContentItemModifierSequence"], - "0500" : ["SQ", "ScheduledSpecimenSequence"], - "050A" : ["LO", "SpecimenAccessionNumber"], - "0512" : ["LO", "ContainerIdentifier"], - "0513" : ["SQ", "IssuerOfTheContainerIdentifierSequence"], - "0515" : ["SQ", "AlternateContainerIdentifierSequence"], - "0518" : ["SQ", "ContainerTypeCodeSequence"], - "051A" : ["LO", "ContainerDescription"], - "0520" : ["SQ", "ContainerComponentSequence"], - "0550" : ["SQ", "SpecimenSequence"], - "0551" : ["LO", "SpecimenIdentifier"], - "0552" : ["SQ", "SpecimenDescriptionSequenceTrial"], - "0553" : ["ST", "SpecimenDescriptionTrial"], - "0554" : ["UI", "SpecimenUID"], - "0555" : ["SQ", "AcquisitionContextSequence"], - "0556" : ["ST", "AcquisitionContextDescription"], - "059A" : ["SQ", "SpecimenTypeCodeSequence"], - "0560" : ["SQ", "SpecimenDescriptionSequence"], - "0562" : ["SQ", "IssuerOfTheSpecimenIdentifierSequence"], - "0600" : ["LO", "SpecimenShortDescription"], - "0602" : ["UT", "SpecimenDetailedDescription"], - "0610" : ["SQ", "SpecimenPreparationSequence"], - "0612" : ["SQ", "SpecimenPreparationStepContentItemSequence"], - "0620" : ["SQ", "SpecimenLocalizationContentItemSequence"], - "06FA" : ["LO", "SlideIdentifier"], - "071A" : ["SQ", "ImageCenterPointCoordinatesSequence"], - "072A" : ["DS", "XOffsetInSlideCoordinateSystem"], - "073A" : ["DS", "YOffsetInSlideCoordinateSystem"], - "074A" : ["DS", "ZOffsetInSlideCoordinateSystem"], - "08D8" : ["SQ", "PixelSpacingSequence"], - "08DA" : ["SQ", "CoordinateSystemAxisCodeSequence"], - "08EA" : ["SQ", "MeasurementUnitsCodeSequence"], - "09F8" : ["SQ", "VitalStainCodeSequenceTrial"], - "1001" : ["SH", "RequestedProcedureID"], - "1002" : ["LO", "ReasonForTheRequestedProcedure"], - "1003" : ["SH", "RequestedProcedurePriority"], - "1004" : ["LO", "PatientTransportArrangements"], - "1005" : ["LO", "RequestedProcedureLocation"], - "1006" : ["SH", "PlacerOrderNumberProcedure"], - "1007" : ["SH", "FillerOrderNumberProcedure"], - "1008" : ["LO", "ConfidentialityCode"], - "1009" : ["SH", "ReportingPriority"], - "100A" : ["SQ", "ReasonForRequestedProcedureCodeSequence"], - "1010" : ["PN", "NamesOfIntendedRecipientsOfResults"], - "1011" : ["SQ", "IntendedRecipientsOfResultsIdentificationSequence"], - "1012" : ["SQ", "ReasonForPerformedProcedureCodeSequence"], - "1060" : ["LO", "RequestedProcedureDescriptionTrial"], - "1101" : ["SQ", "PersonIdentificationCodeSequence"], - "1102" : ["ST", "PersonAddress"], - "1103" : ["LO", "PersonTelephoneNumbers"], - "1400" : ["LT", "RequestedProcedureComments"], - "2001" : ["LO", "ReasonForTheImagingServiceRequest"], - "2004" : ["DA", "IssueDateOfImagingServiceRequest"], - "2005" : ["TM", "IssueTimeOfImagingServiceRequest"], - "2006" : ["SH", "PlacerOrderNumberImagingServiceRequestRetired"], - "2007" : ["SH", "FillerOrderNumberImagingServiceRequestRetired"], - "2008" : ["PN", "OrderEnteredBy"], - "2009" : ["SH", "OrderEntererLocation"], - "2010" : ["SH", "OrderCallbackPhoneNumber"], - "2016" : ["LO", "PlacerOrderNumberImagingServiceRequest"], - "2017" : ["LO", "FillerOrderNumberImagingServiceRequest"], - "2400" : ["LT", "ImagingServiceRequestComments"], - "3001" : ["LO", "ConfidentialityConstraintOnPatientDataDescription"], - "4001" : ["CS", "GeneralPurposeScheduledProcedureStepStatus"], - "4002" : ["CS", "GeneralPurposePerformedProcedureStepStatus"], - "4003" : ["CS", "GeneralPurposeScheduledProcedureStepPriority"], - "4004" : ["SQ", "ScheduledProcessingApplicationsCodeSequence"], - "4005" : ["DT", "ScheduledProcedureStepStartDateTime"], - "4006" : ["CS", "MultipleCopiesFlag"], - "4007" : ["SQ", "PerformedProcessingApplicationsCodeSequence"], - "4009" : ["SQ", "HumanPerformerCodeSequence"], - "4010" : ["DT", "ScheduledProcedureStepModificationDateTime"], - "4011" : ["DT", "ExpectedCompletionDateTime"], - "4015" : ["SQ", "ResultingGeneralPurposePerformedProcedureStepsSequence"], - "4016" : ["SQ", "ReferencedGeneralPurposeScheduledProcedureStepSequence"], - "4018" : ["SQ", "ScheduledWorkitemCodeSequence"], - "4019" : ["SQ", "PerformedWorkitemCodeSequence"], - "4020" : ["CS", "InputAvailabilityFlag"], - "4021" : ["SQ", "InputInformationSequence"], - "4022" : ["SQ", "RelevantInformationSequence"], - "4023" : ["UI", "ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"], - "4025" : ["SQ", "ScheduledStationNameCodeSequence"], - "4026" : ["SQ", "ScheduledStationClassCodeSequence"], - "4027" : ["SQ", "ScheduledStationGeographicLocationCodeSequence"], - "4028" : ["SQ", "PerformedStationNameCodeSequence"], - "4029" : ["SQ", "PerformedStationClassCodeSequence"], - "4030" : ["SQ", "PerformedStationGeographicLocationCodeSequence"], - "4031" : ["SQ", "RequestedSubsequentWorkitemCodeSequence"], - "4032" : ["SQ", "NonDICOMOutputCodeSequence"], - "4033" : ["SQ", "OutputInformationSequence"], - "4034" : ["SQ", "ScheduledHumanPerformersSequence"], - "4035" : ["SQ", "ActualHumanPerformersSequence"], - "4036" : ["LO", "HumanPerformerOrganization"], - "4037" : ["PN", "HumanPerformerName"], - "4040" : ["CS", "RawDataHandling"], - "4041" : ["CS", "InputReadinessState"], - "4050" : ["DT", "PerformedProcedureStepStartDateTime"], - "4051" : ["DT", "PerformedProcedureStepEndDateTime"], - "4052" : ["DT", "ProcedureStepCancellationDateTime"], - "8302" : ["DS", "EntranceDoseInmGy"], - "9094" : ["SQ", "ReferencedImageRealWorldValueMappingSequence"], - "9096" : ["SQ", "RealWorldValueMappingSequence"], - "9098" : ["SQ", "PixelValueMappingCodeSequence"], - "9210" : ["SH", "LUTLabel"], - "9211" : ["SS", "RealWorldValueLastValueMapped"], - "9212" : ["FD", "RealWorldValueLUTData"], - "9216" : ["SS", "RealWorldValueFirstValueMapped"], - "9224" : ["FD", "RealWorldValueIntercept"], - "9225" : ["FD", "RealWorldValueSlope"], - "A007" : ["CS", "FindingsFlagTrial"], - "A010" : ["CS", "RelationshipType"], - "A020" : ["SQ", "FindingsSequenceTrial"], - "A021" : ["UI", "FindingsGroupUIDTrial"], - "A022" : ["UI", "ReferencedFindingsGroupUIDTrial"], - "A023" : ["DA", "FindingsGroupRecordingDateTrial"], - "A024" : ["TM", "FindingsGroupRecordingTimeTrial"], - "A026" : ["SQ", "FindingsSourceCategoryCodeSequenceTrial"], - "A027" : ["LO", "VerifyingOrganization"], - "A028" : ["SQ", "DocumentingOrganizationIdentifierCodeSequenceTrial"], - "A030" : ["DT", "VerificationDateTime"], - "A032" : ["DT", "ObservationDateTime"], - "A040" : ["CS", "ValueType"], - "A043" : ["SQ", "ConceptNameCodeSequence"], - "A047" : ["LO", "MeasurementPrecisionDescriptionTrial"], - "A050" : ["CS", "ContinuityOfContent"], - "A057" : ["CS", "UrgencyOrPriorityAlertsTrial"], - "A060" : ["LO", "SequencingIndicatorTrial"], - "A066" : ["SQ", "DocumentIdentifierCodeSequenceTrial"], - "A067" : ["PN", "DocumentAuthorTrial"], - "A068" : ["SQ", "DocumentAuthorIdentifierCodeSequenceTrial"], - "A070" : ["SQ", "IdentifierCodeSequenceTrial"], - "A073" : ["SQ", "VerifyingObserverSequence"], - "A074" : ["OB", "ObjectBinaryIdentifierTrial"], - "A075" : ["PN", "VerifyingObserverName"], - "A076" : ["SQ", "DocumentingObserverIdentifierCodeSequenceTrial"], - "A078" : ["SQ", "AuthorObserverSequence"], - "A07A" : ["SQ", "ParticipantSequence"], - "A07C" : ["SQ", "CustodialOrganizationSequence"], - "A080" : ["CS", "ParticipationType"], - "A082" : ["DT", "ParticipationDateTime"], - "A084" : ["CS", "ObserverType"], - "A085" : ["SQ", "ProcedureIdentifierCodeSequenceTrial"], - "A088" : ["SQ", "VerifyingObserverIdentificationCodeSequence"], - "A089" : ["OB", "ObjectDirectoryBinaryIdentifierTrial"], - "A090" : ["SQ", "EquivalentCDADocumentSequence"], - "A0B0" : ["US", "ReferencedWaveformChannels"], - "A110" : ["DA", "DateOfDocumentOrVerbalTransactionTrial"], - "A112" : ["TM", "TimeOfDocumentCreationOrVerbalTransactionTrial"], - "A120" : ["DT", "DateTime"], - "A121" : ["DA", "Date"], - "A122" : ["TM", "Time"], - "A123" : ["PN", "PersonName"], - "A124" : ["UI", "UID"], - "A125" : ["CS", "ReportStatusIDTrial"], - "A130" : ["CS", "TemporalRangeType"], - "A132" : ["UL", "ReferencedSamplePositions"], - "A136" : ["US", "ReferencedFrameNumbers"], - "A138" : ["DS", "ReferencedTimeOffsets"], - "A13A" : ["DT", "ReferencedDateTime"], - "A160" : ["UT", "TextValue"], - "A167" : ["SQ", "ObservationCategoryCodeSequenceTrial"], - "A168" : ["SQ", "ConceptCodeSequence"], - "A16A" : ["ST", "BibliographicCitationTrial"], - "A170" : ["SQ", "PurposeOfReferenceCodeSequence"], - "A171" : ["UI", "ObservationUIDTrial"], - "A172" : ["UI", "ReferencedObservationUIDTrial"], - "A173" : ["CS", "ReferencedObservationClassTrial"], - "A174" : ["CS", "ReferencedObjectObservationClassTrial"], - "A180" : ["US", "AnnotationGroupNumber"], - "A192" : ["DA", "ObservationDateTrial"], - "A193" : ["TM", "ObservationTimeTrial"], - "A194" : ["CS", "MeasurementAutomationTrial"], - "A195" : ["SQ", "ModifierCodeSequence"], - "A224" : ["ST", "IdentificationDescriptionTrial"], - "A290" : ["CS", "CoordinatesSetGeometricTypeTrial"], - "A296" : ["SQ", "AlgorithmCodeSequenceTrial"], - "A297" : ["ST", "AlgorithmDescriptionTrial"], - "A29A" : ["SL", "PixelCoordinatesSetTrial"], - "A300" : ["SQ", "MeasuredValueSequence"], - "A301" : ["SQ", "NumericValueQualifierCodeSequence"], - "A307" : ["PN", "CurrentObserverTrial"], - "A30A" : ["DS", "NumericValue"], - "A313" : ["SQ", "ReferencedAccessionSequenceTrial"], - "A33A" : ["ST", "ReportStatusCommentTrial"], - "A340" : ["SQ", "ProcedureContextSequenceTrial"], - "A352" : ["PN", "VerbalSourceTrial"], - "A353" : ["ST", "AddressTrial"], - "A354" : ["LO", "TelephoneNumberTrial"], - "A358" : ["SQ", "VerbalSourceIdentifierCodeSequenceTrial"], - "A360" : ["SQ", "PredecessorDocumentsSequence"], - "A370" : ["SQ", "ReferencedRequestSequence"], - "A372" : ["SQ", "PerformedProcedureCodeSequence"], - "A375" : ["SQ", "CurrentRequestedProcedureEvidenceSequence"], - "A380" : ["SQ", "ReportDetailSequenceTrial"], - "A385" : ["SQ", "PertinentOtherEvidenceSequence"], - "A390" : ["SQ", "HL7StructuredDocumentReferenceSequence"], - "A402" : ["UI", "ObservationSubjectUIDTrial"], - "A403" : ["CS", "ObservationSubjectClassTrial"], - "A404" : ["SQ", "ObservationSubjectTypeCodeSequenceTrial"], - "A491" : ["CS", "CompletionFlag"], - "A492" : ["LO", "CompletionFlagDescription"], - "A493" : ["CS", "VerificationFlag"], - "A494" : ["CS", "ArchiveRequested"], - "A496" : ["CS", "PreliminaryFlag"], - "A504" : ["SQ", "ContentTemplateSequence"], - "A525" : ["SQ", "IdenticalDocumentsSequence"], - "A600" : ["CS", "ObservationSubjectContextFlagTrial"], - "A601" : ["CS", "ObserverContextFlagTrial"], - "A603" : ["CS", "ProcedureContextFlagTrial"], - "A730" : ["SQ", "ContentSequence"], - "A731" : ["SQ", "RelationshipSequenceTrial"], - "A732" : ["SQ", "RelationshipTypeCodeSequenceTrial"], - "A744" : ["SQ", "LanguageCodeSequenceTrial"], - "A992" : ["ST", "UniformResourceLocatorTrial"], - "B020" : ["SQ", "WaveformAnnotationSequence"], - "DB00" : ["CS", "TemplateIdentifier"], - "DB06" : ["DT", "TemplateVersion"], - "DB07" : ["DT", "TemplateLocalVersion"], - "DB0B" : ["CS", "TemplateExtensionFlag"], - "DB0C" : ["UI", "TemplateExtensionOrganizationUID"], - "DB0D" : ["UI", "TemplateExtensionCreatorUID"], - "DB73" : ["UL", "ReferencedContentItemIdentifier"], - "E001" : ["ST", "HL7InstanceIdentifier"], - "E004" : ["DT", "HL7DocumentEffectiveTime"], - "E006" : ["SQ", "HL7DocumentTypeCodeSequence"], - "E008" : ["SQ", "DocumentClassCodeSequence"], - "E010" : ["UT", "RetrieveURI"], - "E011" : ["UI", "RetrieveLocationUID"], - "E020" : ["CS", "TypeOfInstances"], - "E021" : ["SQ", "DICOMRetrievalSequence"], - "E022" : ["SQ", "DICOMMediaRetrievalSequence"], - "E023" : ["SQ", "WADORetrievalSequence"], - "E024" : ["SQ", "XDSRetrievalSequence"], - "E030" : ["UI", "RepositoryUniqueID"], - "E031" : ["UI", "HomeCommunityID"] - }, - "0042" : { - "0010" : ["ST", "DocumentTitle"], - "0011" : ["OB", "EncapsulatedDocument"], - "0012" : ["LO", "MIMETypeOfEncapsulatedDocument"], - "0013" : ["SQ", "SourceInstanceSequence"], - "0014" : ["LO", "ListOfMIMETypes"] - }, - "0044" : { - "0001" : ["ST", "ProductPackageIdentifier"], - "0002" : ["CS", "SubstanceAdministrationApproval"], - "0003" : ["LT", "ApprovalStatusFurtherDescription"], - "0004" : ["DT", "ApprovalStatusDateTime"], - "0007" : ["SQ", "ProductTypeCodeSequence"], - "0008" : ["LO", "ProductName"], - "0009" : ["LT", "ProductDescription"], - "000A" : ["LO", "ProductLotIdentifier"], - "000B" : ["DT", "ProductExpirationDateTime"], - "0010" : ["DT", "SubstanceAdministrationDateTime"], - "0011" : ["LO", "SubstanceAdministrationNotes"], - "0012" : ["LO", "SubstanceAdministrationDeviceID"], - "0013" : ["SQ", "ProductParameterSequence"], - "0019" : ["SQ", "SubstanceAdministrationParameterSequence"] - }, - "0046" : { - "0012" : ["LO", "LensDescription"], - "0014" : ["SQ", "RightLensSequence"], - "0015" : ["SQ", "LeftLensSequence"], - "0016" : ["SQ", "UnspecifiedLateralityLensSequence"], - "0018" : ["SQ", "CylinderSequence"], - "0028" : ["SQ", "PrismSequence"], - "0030" : ["FD", "HorizontalPrismPower"], - "0032" : ["CS", "HorizontalPrismBase"], - "0034" : ["FD", "VerticalPrismPower"], - "0036" : ["CS", "VerticalPrismBase"], - "0038" : ["CS", "LensSegmentType"], - "0040" : ["FD", "OpticalTransmittance"], - "0042" : ["FD", "ChannelWidth"], - "0044" : ["FD", "PupilSize"], - "0046" : ["FD", "CornealSize"], - "0050" : ["SQ", "AutorefractionRightEyeSequence"], - "0052" : ["SQ", "AutorefractionLeftEyeSequence"], - "0060" : ["FD", "DistancePupillaryDistance"], - "0062" : ["FD", "NearPupillaryDistance"], - "0063" : ["FD", "IntermediatePupillaryDistance"], - "0064" : ["FD", "OtherPupillaryDistance"], - "0070" : ["SQ", "KeratometryRightEyeSequence"], - "0071" : ["SQ", "KeratometryLeftEyeSequence"], - "0074" : ["SQ", "SteepKeratometricAxisSequence"], - "0075" : ["FD", "RadiusOfCurvature"], - "0076" : ["FD", "KeratometricPower"], - "0077" : ["FD", "KeratometricAxis"], - "0080" : ["SQ", "FlatKeratometricAxisSequence"], - "0092" : ["CS", "BackgroundColor"], - "0094" : ["CS", "Optotype"], - "0095" : ["CS", "OptotypePresentation"], - "0097" : ["SQ", "SubjectiveRefractionRightEyeSequence"], - "0098" : ["SQ", "SubjectiveRefractionLeftEyeSequence"], - "0100" : ["SQ", "AddNearSequence"], - "0101" : ["SQ", "AddIntermediateSequence"], - "0102" : ["SQ", "AddOtherSequence"], - "0104" : ["FD", "AddPower"], - "0106" : ["FD", "ViewingDistance"], - "0121" : ["SQ", "VisualAcuityTypeCodeSequence"], - "0122" : ["SQ", "VisualAcuityRightEyeSequence"], - "0123" : ["SQ", "VisualAcuityLeftEyeSequence"], - "0124" : ["SQ", "VisualAcuityBothEyesOpenSequence"], - "0125" : ["CS", "ViewingDistanceType"], - "0135" : ["SS", "VisualAcuityModifiers"], - "0137" : ["FD", "DecimalVisualAcuity"], - "0139" : ["LO", "OptotypeDetailedDefinition"], - "0145" : ["SQ", "ReferencedRefractiveMeasurementsSequence"], - "0146" : ["FD", "SpherePower"], - "0147" : ["FD", "CylinderPower"] - }, - "0048" : { - "0001" : ["FL", "ImagedVolumeWidth"], - "0002" : ["FL", "ImagedVolumeHeight"], - "0003" : ["FL", "ImagedVolumeDepth"], - "0006" : ["UL", "TotalPixelMatrixColumns"], - "0007" : ["UL", "TotalPixelMatrixRows"], - "0008" : ["SQ", "TotalPixelMatrixOriginSequence"], - "0010" : ["CS", "SpecimenLabelInImage"], - "0011" : ["CS", "FocusMethod"], - "0012" : ["CS", "ExtendedDepthOfField"], - "0013" : ["US", "NumberOfFocalPlanes"], - "0014" : ["FL", "DistanceBetweenFocalPlanes"], - "0015" : ["US", "RecommendedAbsentPixelCIELabValue"], - "0100" : ["SQ", "IlluminatorTypeCodeSequence"], - "0102" : ["DS", "ImageOrientationSlide"], - "0105" : ["SQ", "OpticalPathSequence"], - "0106" : ["SH", "OpticalPathIdentifier"], - "0107" : ["ST", "OpticalPathDescription"], - "0108" : ["SQ", "IlluminationColorCodeSequence"], - "0110" : ["SQ", "SpecimenReferenceSequence"], - "0111" : ["DS", "CondenserLensPower"], - "0112" : ["DS", "ObjectiveLensPower"], - "0113" : ["DS", "ObjectiveLensNumericalAperture"], - "0120" : ["SQ", "PaletteColorLookupTableSequence"], - "0200" : ["SQ", "ReferencedImageNavigationSequence"], - "0201" : ["US", "TopLeftHandCornerOfLocalizerArea"], - "0202" : ["US", "BottomRightHandCornerOfLocalizerArea"], - "0207" : ["SQ", "OpticalPathIdentificationSequence"], - "021A" : ["SQ", "PlanePositionSlideSequence"], - "021E" : ["SL", "RowPositionInTotalImagePixelMatrix"], - "021F" : ["SL", "ColumnPositionInTotalImagePixelMatrix"], - "0301" : ["CS", "PixelOriginInterpretation"] - }, - "0050" : { - "0004" : ["CS", "CalibrationImage"], - "0010" : ["SQ", "DeviceSequence"], - "0012" : ["SQ", "ContainerComponentTypeCodeSequence"], - "0013" : ["FD", "ContainerComponentThickness"], - "0014" : ["DS", "DeviceLength"], - "0015" : ["FD", "ContainerComponentWidth"], - "0016" : ["DS", "DeviceDiameter"], - "0017" : ["CS", "DeviceDiameterUnits"], - "0018" : ["DS", "DeviceVolume"], - "0019" : ["DS", "InterMarkerDistance"], - "001A" : ["CS", "ContainerComponentMaterial"], - "001B" : ["LO", "ContainerComponentID"], - "001C" : ["FD", "ContainerComponentLength"], - "001D" : ["FD", "ContainerComponentDiameter"], - "001E" : ["LO", "ContainerComponentDescription"], - "0020" : ["LO", "DeviceDescription"] - }, - "0052" : { - "0001" : ["FL", "ContrastBolusIngredientPercentByVolume"], - "0002" : ["FD", "OCTFocalDistance"], - "0003" : ["FD", "BeamSpotSize"], - "0004" : ["FD", "EffectiveRefractiveIndex"], - "0006" : ["CS", "OCTAcquisitionDomain"], - "0007" : ["FD", "OCTOpticalCenterWavelength"], - "0008" : ["FD", "AxialResolution"], - "0009" : ["FD", "RangingDepth"], - "0011" : ["FD", "ALineRate"], - "0012" : ["US", "ALinesPerFrame"], - "0013" : ["FD", "CatheterRotationalRate"], - "0014" : ["FD", "ALinePixelSpacing"], - "0016" : ["SQ", "ModeOfPercutaneousAccessSequence"], - "0025" : ["SQ", "IntravascularOCTFrameTypeSequence"], - "0026" : ["CS", "OCTZOffsetApplied"], - "0027" : ["SQ", "IntravascularFrameContentSequence"], - "0028" : ["FD", "IntravascularLongitudinalDistance"], - "0029" : ["SQ", "IntravascularOCTFrameContentSequence"], - "0030" : ["SS", "OCTZOffsetCorrection"], - "0031" : ["CS", "CatheterDirectionOfRotation"], - "0033" : ["FD", "SeamLineLocation"], - "0034" : ["FD", "FirstALineLocation"], - "0036" : ["US", "SeamLineIndex"], - "0038" : ["US", "NumberOfPaddedAlines"], - "0039" : ["CS", "InterpolationType"], - "003A" : ["CS", "RefractiveIndexApplied"] - }, - "0054" : { - "0010" : ["US", "EnergyWindowVector"], - "0011" : ["US", "NumberOfEnergyWindows"], - "0012" : ["SQ", "EnergyWindowInformationSequence"], - "0013" : ["SQ", "EnergyWindowRangeSequence"], - "0014" : ["DS", "EnergyWindowLowerLimit"], - "0015" : ["DS", "EnergyWindowUpperLimit"], - "0016" : ["SQ", "RadiopharmaceuticalInformationSequence"], - "0017" : ["IS", "ResidualSyringeCounts"], - "0018" : ["SH", "EnergyWindowName"], - "0020" : ["US", "DetectorVector"], - "0021" : ["US", "NumberOfDetectors"], - "0022" : ["SQ", "DetectorInformationSequence"], - "0030" : ["US", "PhaseVector"], - "0031" : ["US", "NumberOfPhases"], - "0032" : ["SQ", "PhaseInformationSequence"], - "0033" : ["US", "NumberOfFramesInPhase"], - "0036" : ["IS", "PhaseDelay"], - "0038" : ["IS", "PauseBetweenFrames"], - "0039" : ["CS", "PhaseDescription"], - "0050" : ["US", "RotationVector"], - "0051" : ["US", "NumberOfRotations"], - "0052" : ["SQ", "RotationInformationSequence"], - "0053" : ["US", "NumberOfFramesInRotation"], - "0060" : ["US", "RRIntervalVector"], - "0061" : ["US", "NumberOfRRIntervals"], - "0062" : ["SQ", "GatedInformationSequence"], - "0063" : ["SQ", "DataInformationSequence"], - "0070" : ["US", "TimeSlotVector"], - "0071" : ["US", "NumberOfTimeSlots"], - "0072" : ["SQ", "TimeSlotInformationSequence"], - "0073" : ["DS", "TimeSlotTime"], - "0080" : ["US", "SliceVector"], - "0081" : ["US", "NumberOfSlices"], - "0090" : ["US", "AngularViewVector"], - "0100" : ["US", "TimeSliceVector"], - "0101" : ["US", "NumberOfTimeSlices"], - "0200" : ["DS", "StartAngle"], - "0202" : ["CS", "TypeOfDetectorMotion"], - "0210" : ["IS", "TriggerVector"], - "0211" : ["US", "NumberOfTriggersInPhase"], - "0220" : ["SQ", "ViewCodeSequence"], - "0222" : ["SQ", "ViewModifierCodeSequence"], - "0300" : ["SQ", "RadionuclideCodeSequence"], - "0302" : ["SQ", "AdministrationRouteCodeSequence"], - "0304" : ["SQ", "RadiopharmaceuticalCodeSequence"], - "0306" : ["SQ", "CalibrationDataSequence"], - "0308" : ["US", "EnergyWindowNumber"], - "0400" : ["SH", "ImageID"], - "0410" : ["SQ", "PatientOrientationCodeSequence"], - "0412" : ["SQ", "PatientOrientationModifierCodeSequence"], - "0414" : ["SQ", "PatientGantryRelationshipCodeSequence"], - "0500" : ["CS", "SliceProgressionDirection"], - "1000" : ["CS", "SeriesType"], - "1001" : ["CS", "Units"], - "1002" : ["CS", "CountsSource"], - "1004" : ["CS", "ReprojectionMethod"], - "1006" : ["CS", "SUVType"], - "1100" : ["CS", "RandomsCorrectionMethod"], - "1101" : ["LO", "AttenuationCorrectionMethod"], - "1102" : ["CS", "DecayCorrection"], - "1103" : ["LO", "ReconstructionMethod"], - "1104" : ["LO", "DetectorLinesOfResponseUsed"], - "1105" : ["LO", "ScatterCorrectionMethod"], - "1200" : ["DS", "AxialAcceptance"], - "1201" : ["IS", "AxialMash"], - "1202" : ["IS", "TransverseMash"], - "1203" : ["DS", "DetectorElementSize"], - "1210" : ["DS", "CoincidenceWindowWidth"], - "1220" : ["CS", "SecondaryCountsType"], - "1300" : ["DS", "FrameReferenceTime"], - "1310" : ["IS", "PrimaryPromptsCountsAccumulated"], - "1311" : ["IS", "SecondaryCountsAccumulated"], - "1320" : ["DS", "SliceSensitivityFactor"], - "1321" : ["DS", "DecayFactor"], - "1322" : ["DS", "DoseCalibrationFactor"], - "1323" : ["DS", "ScatterFractionFactor"], - "1324" : ["DS", "DeadTimeFactor"], - "1330" : ["US", "ImageIndex"], - "1400" : ["CS", "CountsIncluded"], - "1401" : ["CS", "DeadTimeCorrectionFlag"] - }, - "0060" : { - "3000" : ["SQ", "HistogramSequence"], - "3002" : ["US", "HistogramNumberOfBins"], - "3004" : ["SS", "HistogramFirstBinValue"], - "3006" : ["SS", "HistogramLastBinValue"], - "3008" : ["US", "HistogramBinWidth"], - "3010" : ["LO", "HistogramExplanation"], - "3020" : ["UL", "HistogramData"] - }, - "0062" : { - "0001" : ["CS", "SegmentationType"], - "0002" : ["SQ", "SegmentSequence"], - "0003" : ["SQ", "SegmentedPropertyCategoryCodeSequence"], - "0004" : ["US", "SegmentNumber"], - "0005" : ["LO", "SegmentLabel"], - "0006" : ["ST", "SegmentDescription"], - "0008" : ["CS", "SegmentAlgorithmType"], - "0009" : ["LO", "SegmentAlgorithmName"], - "000A" : ["SQ", "SegmentIdentificationSequence"], - "000B" : ["US", "ReferencedSegmentNumber"], - "000C" : ["US", "RecommendedDisplayGrayscaleValue"], - "000D" : ["US", "RecommendedDisplayCIELabValue"], - "000E" : ["US", "MaximumFractionalValue"], - "000F" : ["SQ", "SegmentedPropertyTypeCodeSequence"], - "0010" : ["CS", "SegmentationFractionalType"] - }, - "0064" : { - "0002" : ["SQ", "DeformableRegistrationSequence"], - "0003" : ["UI", "SourceFrameOfReferenceUID"], - "0005" : ["SQ", "DeformableRegistrationGridSequence"], - "0007" : ["UL", "GridDimensions"], - "0008" : ["FD", "GridResolution"], - "0009" : ["OF", "VectorGridData"], - "000F" : ["SQ", "PreDeformationMatrixRegistrationSequence"], - "0010" : ["SQ", "PostDeformationMatrixRegistrationSequence"] - }, - "0066" : { - "0001" : ["UL", "NumberOfSurfaces"], - "0002" : ["SQ", "SurfaceSequence"], - "0003" : ["UL", "SurfaceNumber"], - "0004" : ["LT", "SurfaceComments"], - "0009" : ["CS", "SurfaceProcessing"], - "000A" : ["FL", "SurfaceProcessingRatio"], - "000B" : ["LO", "SurfaceProcessingDescription"], - "000C" : ["FL", "RecommendedPresentationOpacity"], - "000D" : ["CS", "RecommendedPresentationType"], - "000E" : ["CS", "FiniteVolume"], - "0010" : ["CS", "Manifold"], - "0011" : ["SQ", "SurfacePointsSequence"], - "0012" : ["SQ", "SurfacePointsNormalsSequence"], - "0013" : ["SQ", "SurfaceMeshPrimitivesSequence"], - "0015" : ["UL", "NumberOfSurfacePoints"], - "0016" : ["OF", "PointCoordinatesData"], - "0017" : ["FL", "PointPositionAccuracy"], - "0018" : ["FL", "MeanPointDistance"], - "0019" : ["FL", "MaximumPointDistance"], - "001A" : ["FL", "PointsBoundingBoxCoordinates"], - "001B" : ["FL", "AxisOfRotation"], - "001C" : ["FL", "CenterOfRotation"], - "001E" : ["UL", "NumberOfVectors"], - "001F" : ["US", "VectorDimensionality"], - "0020" : ["FL", "VectorAccuracy"], - "0021" : ["OF", "VectorCoordinateData"], - "0023" : ["OW", "TrianglePointIndexList"], - "0024" : ["OW", "EdgePointIndexList"], - "0025" : ["OW", "VertexPointIndexList"], - "0026" : ["SQ", "TriangleStripSequence"], - "0027" : ["SQ", "TriangleFanSequence"], - "0028" : ["SQ", "LineSequence"], - "0029" : ["OW", "PrimitivePointIndexList"], - "002A" : ["UL", "SurfaceCount"], - "002B" : ["SQ", "ReferencedSurfaceSequence"], - "002C" : ["UL", "ReferencedSurfaceNumber"], - "002D" : ["SQ", "SegmentSurfaceGenerationAlgorithmIdentificationSequence"], - "002E" : ["SQ", "SegmentSurfaceSourceInstanceSequence"], - "002F" : ["SQ", "AlgorithmFamilyCodeSequence"], - "0030" : ["SQ", "AlgorithmNameCodeSequence"], - "0031" : ["LO", "AlgorithmVersion"], - "0032" : ["LT", "AlgorithmParameters"], - "0034" : ["SQ", "FacetSequence"], - "0035" : ["SQ", "SurfaceProcessingAlgorithmIdentificationSequence"], - "0036" : ["LO", "AlgorithmName"] - }, - "0068" : { - "6210" : ["LO", "ImplantSize"], - "6221" : ["LO", "ImplantTemplateVersion"], - "6222" : ["SQ", "ReplacedImplantTemplateSequence"], - "6223" : ["CS", "ImplantType"], - "6224" : ["SQ", "DerivationImplantTemplateSequence"], - "6225" : ["SQ", "OriginalImplantTemplateSequence"], - "6226" : ["DT", "EffectiveDateTime"], - "6230" : ["SQ", "ImplantTargetAnatomySequence"], - "6260" : ["SQ", "InformationFromManufacturerSequence"], - "6265" : ["SQ", "NotificationFromManufacturerSequence"], - "6270" : ["DT", "InformationIssueDateTime"], - "6280" : ["ST", "InformationSummary"], - "62A0" : ["SQ", "ImplantRegulatoryDisapprovalCodeSequence"], - "62A5" : ["FD", "OverallTemplateSpatialTolerance"], - "62C0" : ["SQ", "HPGLDocumentSequence"], - "62D0" : ["US", "HPGLDocumentID"], - "62D5" : ["LO", "HPGLDocumentLabel"], - "62E0" : ["SQ", "ViewOrientationCodeSequence"], - "62F0" : ["FD", "ViewOrientationModifier"], - "62F2" : ["FD", "HPGLDocumentScaling"], - "6300" : ["OB", "HPGLDocument"], - "6310" : ["US", "HPGLContourPenNumber"], - "6320" : ["SQ", "HPGLPenSequence"], - "6330" : ["US", "HPGLPenNumber"], - "6340" : ["LO", "HPGLPenLabel"], - "6345" : ["ST", "HPGLPenDescription"], - "6346" : ["FD", "RecommendedRotationPoint"], - "6347" : ["FD", "BoundingRectangle"], - "6350" : ["US", "ImplantTemplate3DModelSurfaceNumber"], - "6360" : ["SQ", "SurfaceModelDescriptionSequence"], - "6380" : ["LO", "SurfaceModelLabel"], - "6390" : ["FD", "SurfaceModelScalingFactor"], - "63A0" : ["SQ", "MaterialsCodeSequence"], - "63A4" : ["SQ", "CoatingMaterialsCodeSequence"], - "63A8" : ["SQ", "ImplantTypeCodeSequence"], - "63AC" : ["SQ", "FixationMethodCodeSequence"], - "63B0" : ["SQ", "MatingFeatureSetsSequence"], - "63C0" : ["US", "MatingFeatureSetID"], - "63D0" : ["LO", "MatingFeatureSetLabel"], - "63E0" : ["SQ", "MatingFeatureSequence"], - "63F0" : ["US", "MatingFeatureID"], - "6400" : ["SQ", "MatingFeatureDegreeOfFreedomSequence"], - "6410" : ["US", "DegreeOfFreedomID"], - "6420" : ["CS", "DegreeOfFreedomType"], - "6430" : ["SQ", "TwoDMatingFeatureCoordinatesSequence"], - "6440" : ["US", "ReferencedHPGLDocumentID"], - "6450" : ["FD", "TwoDMatingPoint"], - "6460" : ["FD", "TwoDMatingAxes"], - "6470" : ["SQ", "TwoDDegreeOfFreedomSequence"], - "6490" : ["FD", "ThreeDDegreeOfFreedomAxis"], - "64A0" : ["FD", "RangeOfFreedom"], - "64C0" : ["FD", "ThreeDMatingPoint"], - "64D0" : ["FD", "ThreeDMatingAxes"], - "64F0" : ["FD", "TwoDDegreeOfFreedomAxis"], - "6500" : ["SQ", "PlanningLandmarkPointSequence"], - "6510" : ["SQ", "PlanningLandmarkLineSequence"], - "6520" : ["SQ", "PlanningLandmarkPlaneSequence"], - "6530" : ["US", "PlanningLandmarkID"], - "6540" : ["LO", "PlanningLandmarkDescription"], - "6545" : ["SQ", "PlanningLandmarkIdentificationCodeSequence"], - "6550" : ["SQ", "TwoDPointCoordinatesSequence"], - "6560" : ["FD", "TwoDPointCoordinates"], - "6590" : ["FD", "ThreeDPointCoordinates"], - "65A0" : ["SQ", "TwoDLineCoordinatesSequence"], - "65B0" : ["FD", "TwoDLineCoordinates"], - "65D0" : ["FD", "ThreeDLineCoordinates"], - "65E0" : ["SQ", "TwoDPlaneCoordinatesSequence"], - "65F0" : ["FD", "TwoDPlaneIntersection"], - "6610" : ["FD", "ThreeDPlaneOrigin"], - "6620" : ["FD", "ThreeDPlaneNormal"] - }, - "0070" : { - "0001" : ["SQ", "GraphicAnnotationSequence"], - "0002" : ["CS", "GraphicLayer"], - "0003" : ["CS", "BoundingBoxAnnotationUnits"], - "0004" : ["CS", "AnchorPointAnnotationUnits"], - "0005" : ["CS", "GraphicAnnotationUnits"], - "0006" : ["ST", "UnformattedTextValue"], - "0008" : ["SQ", "TextObjectSequence"], - "0009" : ["SQ", "GraphicObjectSequence"], - "0010" : ["FL", "BoundingBoxTopLeftHandCorner"], - "0011" : ["FL", "BoundingBoxBottomRightHandCorner"], - "0012" : ["CS", "BoundingBoxTextHorizontalJustification"], - "0014" : ["FL", "AnchorPoint"], - "0015" : ["CS", "AnchorPointVisibility"], - "0020" : ["US", "GraphicDimensions"], - "0021" : ["US", "NumberOfGraphicPoints"], - "0022" : ["FL", "GraphicData"], - "0023" : ["CS", "GraphicType"], - "0024" : ["CS", "GraphicFilled"], - "0040" : ["IS", "ImageRotationRetired"], - "0041" : ["CS", "ImageHorizontalFlip"], - "0042" : ["US", "ImageRotation"], - "0050" : ["US", "DisplayedAreaTopLeftHandCornerTrial"], - "0051" : ["US", "DisplayedAreaBottomRightHandCornerTrial"], - "0052" : ["SL", "DisplayedAreaTopLeftHandCorner"], - "0053" : ["SL", "DisplayedAreaBottomRightHandCorner"], - "005A" : ["SQ", "DisplayedAreaSelectionSequence"], - "0060" : ["SQ", "GraphicLayerSequence"], - "0062" : ["IS", "GraphicLayerOrder"], - "0066" : ["US", "GraphicLayerRecommendedDisplayGrayscaleValue"], - "0067" : ["US", "GraphicLayerRecommendedDisplayRGBValue"], - "0068" : ["LO", "GraphicLayerDescription"], - "0080" : ["CS", "ContentLabel"], - "0081" : ["LO", "ContentDescription"], - "0082" : ["DA", "PresentationCreationDate"], - "0083" : ["TM", "PresentationCreationTime"], - "0084" : ["PN", "ContentCreatorName"], - "0086" : ["SQ", "ContentCreatorIdentificationCodeSequence"], - "0087" : ["SQ", "AlternateContentDescriptionSequence"], - "0100" : ["CS", "PresentationSizeMode"], - "0101" : ["DS", "PresentationPixelSpacing"], - "0102" : ["IS", "PresentationPixelAspectRatio"], - "0103" : ["FL", "PresentationPixelMagnificationRatio"], - "0207" : ["LO", "GraphicGroupLabel"], - "0208" : ["ST", "GraphicGroupDescription"], - "0209" : ["SQ", "CompoundGraphicSequence"], - "0226" : ["UL", "CompoundGraphicInstanceID"], - "0227" : ["LO", "FontName"], - "0228" : ["CS", "FontNameType"], - "0229" : ["LO", "CSSFontName"], - "0230" : ["FD", "RotationAngle"], - "0231" : ["SQ", "TextStyleSequence"], - "0232" : ["SQ", "LineStyleSequence"], - "0233" : ["SQ", "FillStyleSequence"], - "0234" : ["SQ", "GraphicGroupSequence"], - "0241" : ["US", "TextColorCIELabValue"], - "0242" : ["CS", "HorizontalAlignment"], - "0243" : ["CS", "VerticalAlignment"], - "0244" : ["CS", "ShadowStyle"], - "0245" : ["FL", "ShadowOffsetX"], - "0246" : ["FL", "ShadowOffsetY"], - "0247" : ["US", "ShadowColorCIELabValue"], - "0248" : ["CS", "Underlined"], - "0249" : ["CS", "Bold"], - "0250" : ["CS", "Italic"], - "0251" : ["US", "PatternOnColorCIELabValue"], - "0252" : ["US", "PatternOffColorCIELabValue"], - "0253" : ["FL", "LineThickness"], - "0254" : ["CS", "LineDashingStyle"], - "0255" : ["UL", "LinePattern"], - "0256" : ["OB", "FillPattern"], - "0257" : ["CS", "FillMode"], - "0258" : ["FL", "ShadowOpacity"], - "0261" : ["FL", "GapLength"], - "0262" : ["FL", "DiameterOfVisibility"], - "0273" : ["FL", "RotationPoint"], - "0274" : ["CS", "TickAlignment"], - "0278" : ["CS", "ShowTickLabel"], - "0279" : ["CS", "TickLabelAlignment"], - "0282" : ["CS", "CompoundGraphicUnits"], - "0284" : ["FL", "PatternOnOpacity"], - "0285" : ["FL", "PatternOffOpacity"], - "0287" : ["SQ", "MajorTicksSequence"], - "0288" : ["FL", "TickPosition"], - "0289" : ["SH", "TickLabel"], - "0294" : ["CS", "CompoundGraphicType"], - "0295" : ["UL", "GraphicGroupID"], - "0306" : ["CS", "ShapeType"], - "0308" : ["SQ", "RegistrationSequence"], - "0309" : ["SQ", "MatrixRegistrationSequence"], - "030A" : ["SQ", "MatrixSequence"], - "030C" : ["CS", "FrameOfReferenceTransformationMatrixType"], - "030D" : ["SQ", "RegistrationTypeCodeSequence"], - "030F" : ["ST", "FiducialDescription"], - "0310" : ["SH", "FiducialIdentifier"], - "0311" : ["SQ", "FiducialIdentifierCodeSequence"], - "0312" : ["FD", "ContourUncertaintyRadius"], - "0314" : ["SQ", "UsedFiducialsSequence"], - "0318" : ["SQ", "GraphicCoordinatesDataSequence"], - "031A" : ["UI", "FiducialUID"], - "031C" : ["SQ", "FiducialSetSequence"], - "031E" : ["SQ", "FiducialSequence"], - "0401" : ["US", "GraphicLayerRecommendedDisplayCIELabValue"], - "0402" : ["SQ", "BlendingSequence"], - "0403" : ["FL", "RelativeOpacity"], - "0404" : ["SQ", "ReferencedSpatialRegistrationSequence"], - "0405" : ["CS", "BlendingPosition"] - }, - "0072" : { - "0002" : ["SH", "HangingProtocolName"], - "0004" : ["LO", "HangingProtocolDescription"], - "0006" : ["CS", "HangingProtocolLevel"], - "0008" : ["LO", "HangingProtocolCreator"], - "000A" : ["DT", "HangingProtocolCreationDateTime"], - "000C" : ["SQ", "HangingProtocolDefinitionSequence"], - "000E" : ["SQ", "HangingProtocolUserIdentificationCodeSequence"], - "0010" : ["LO", "HangingProtocolUserGroupName"], - "0012" : ["SQ", "SourceHangingProtocolSequence"], - "0014" : ["US", "NumberOfPriorsReferenced"], - "0020" : ["SQ", "ImageSetsSequence"], - "0022" : ["SQ", "ImageSetSelectorSequence"], - "0024" : ["CS", "ImageSetSelectorUsageFlag"], - "0026" : ["AT", "SelectorAttribute"], - "0028" : ["US", "SelectorValueNumber"], - "0030" : ["SQ", "TimeBasedImageSetsSequence"], - "0032" : ["US", "ImageSetNumber"], - "0034" : ["CS", "ImageSetSelectorCategory"], - "0038" : ["US", "RelativeTime"], - "003A" : ["CS", "RelativeTimeUnits"], - "003C" : ["SS", "AbstractPriorValue"], - "003E" : ["SQ", "AbstractPriorCodeSequence"], - "0040" : ["LO", "ImageSetLabel"], - "0050" : ["CS", "SelectorAttributeVR"], - "0052" : ["AT", "SelectorSequencePointer"], - "0054" : ["LO", "SelectorSequencePointerPrivateCreator"], - "0056" : ["LO", "SelectorAttributePrivateCreator"], - "0060" : ["AT", "SelectorATValue"], - "0062" : ["CS", "SelectorCSValue"], - "0064" : ["IS", "SelectorISValue"], - "0066" : ["LO", "SelectorLOValue"], - "0068" : ["LT", "SelectorLTValue"], - "006A" : ["PN", "SelectorPNValue"], - "006C" : ["SH", "SelectorSHValue"], - "006E" : ["ST", "SelectorSTValue"], - "0070" : ["UT", "SelectorUTValue"], - "0072" : ["DS", "SelectorDSValue"], - "0074" : ["FD", "SelectorFDValue"], - "0076" : ["FL", "SelectorFLValue"], - "0078" : ["UL", "SelectorULValue"], - "007A" : ["US", "SelectorUSValue"], - "007C" : ["SL", "SelectorSLValue"], - "007E" : ["SS", "SelectorSSValue"], - "0080" : ["SQ", "SelectorCodeSequenceValue"], - "0100" : ["US", "NumberOfScreens"], - "0102" : ["SQ", "NominalScreenDefinitionSequence"], - "0104" : ["US", "NumberOfVerticalPixels"], - "0106" : ["US", "NumberOfHorizontalPixels"], - "0108" : ["FD", "DisplayEnvironmentSpatialPosition"], - "010A" : ["US", "ScreenMinimumGrayscaleBitDepth"], - "010C" : ["US", "ScreenMinimumColorBitDepth"], - "010E" : ["US", "ApplicationMaximumRepaintTime"], - "0200" : ["SQ", "DisplaySetsSequence"], - "0202" : ["US", "DisplaySetNumber"], - "0203" : ["LO", "DisplaySetLabel"], - "0204" : ["US", "DisplaySetPresentationGroup"], - "0206" : ["LO", "DisplaySetPresentationGroupDescription"], - "0208" : ["CS", "PartialDataDisplayHandling"], - "0210" : ["SQ", "SynchronizedScrollingSequence"], - "0212" : ["US", "DisplaySetScrollingGroup"], - "0214" : ["SQ", "NavigationIndicatorSequence"], - "0216" : ["US", "NavigationDisplaySet"], - "0218" : ["US", "ReferenceDisplaySets"], - "0300" : ["SQ", "ImageBoxesSequence"], - "0302" : ["US", "ImageBoxNumber"], - "0304" : ["CS", "ImageBoxLayoutType"], - "0306" : ["US", "ImageBoxTileHorizontalDimension"], - "0308" : ["US", "ImageBoxTileVerticalDimension"], - "0310" : ["CS", "ImageBoxScrollDirection"], - "0312" : ["CS", "ImageBoxSmallScrollType"], - "0314" : ["US", "ImageBoxSmallScrollAmount"], - "0316" : ["CS", "ImageBoxLargeScrollType"], - "0318" : ["US", "ImageBoxLargeScrollAmount"], - "0320" : ["US", "ImageBoxOverlapPriority"], - "0330" : ["FD", "CineRelativeToRealTime"], - "0400" : ["SQ", "FilterOperationsSequence"], - "0402" : ["CS", "FilterByCategory"], - "0404" : ["CS", "FilterByAttributePresence"], - "0406" : ["CS", "FilterByOperator"], - "0420" : ["US", "StructuredDisplayBackgroundCIELabValue"], - "0421" : ["US", "EmptyImageBoxCIELabValue"], - "0422" : ["SQ", "StructuredDisplayImageBoxSequence"], - "0424" : ["SQ", "StructuredDisplayTextBoxSequence"], - "0427" : ["SQ", "ReferencedFirstFrameSequence"], - "0430" : ["SQ", "ImageBoxSynchronizationSequence"], - "0432" : ["US", "SynchronizedImageBoxList"], - "0434" : ["CS", "TypeOfSynchronization"], - "0500" : ["CS", "BlendingOperationType"], - "0510" : ["CS", "ReformattingOperationType"], - "0512" : ["FD", "ReformattingThickness"], - "0514" : ["FD", "ReformattingInterval"], - "0516" : ["CS", "ReformattingOperationInitialViewDirection"], - "0520" : ["CS", "ThreeDRenderingType"], - "0600" : ["SQ", "SortingOperationsSequence"], - "0602" : ["CS", "SortByCategory"], - "0604" : ["CS", "SortingDirection"], - "0700" : ["CS", "DisplaySetPatientOrientation"], - "0702" : ["CS", "VOIType"], - "0704" : ["CS", "PseudoColorType"], - "0705" : ["SQ", "PseudoColorPaletteInstanceReferenceSequence"], - "0706" : ["CS", "ShowGrayscaleInverted"], - "0710" : ["CS", "ShowImageTrueSizeFlag"], - "0712" : ["CS", "ShowGraphicAnnotationFlag"], - "0714" : ["CS", "ShowPatientDemographicsFlag"], - "0716" : ["CS", "ShowAcquisitionTechniquesFlag"], - "0717" : ["CS", "DisplaySetHorizontalJustification"], - "0718" : ["CS", "DisplaySetVerticalJustification"] - }, - "0074" : { - "0120" : ["FD", "ContinuationStartMeterset"], - "0121" : ["FD", "ContinuationEndMeterset"], - "1000" : ["CS", "ProcedureStepState"], - "1002" : ["SQ", "ProcedureStepProgressInformationSequence"], - "1004" : ["DS", "ProcedureStepProgress"], - "1006" : ["ST", "ProcedureStepProgressDescription"], - "1008" : ["SQ", "ProcedureStepCommunicationsURISequence"], - "100A" : ["ST", "ContactURI"], - "100C" : ["LO", "ContactDisplayName"], - "100E" : ["SQ", "ProcedureStepDiscontinuationReasonCodeSequence"], - "1020" : ["SQ", "BeamTaskSequence"], - "1022" : ["CS", "BeamTaskType"], - "1024" : ["IS", "BeamOrderIndexTrial"], - "1026" : ["FD", "TableTopVerticalAdjustedPosition"], - "1027" : ["FD", "TableTopLongitudinalAdjustedPosition"], - "1028" : ["FD", "TableTopLateralAdjustedPosition"], - "102A" : ["FD", "PatientSupportAdjustedAngle"], - "102B" : ["FD", "TableTopEccentricAdjustedAngle"], - "102C" : ["FD", "TableTopPitchAdjustedAngle"], - "102D" : ["FD", "TableTopRollAdjustedAngle"], - "1030" : ["SQ", "DeliveryVerificationImageSequence"], - "1032" : ["CS", "VerificationImageTiming"], - "1034" : ["CS", "DoubleExposureFlag"], - "1036" : ["CS", "DoubleExposureOrdering"], - "1038" : ["DS", "DoubleExposureMetersetTrial"], - "103A" : ["DS", "DoubleExposureFieldDeltaTrial"], - "1040" : ["SQ", "RelatedReferenceRTImageSequence"], - "1042" : ["SQ", "GeneralMachineVerificationSequence"], - "1044" : ["SQ", "ConventionalMachineVerificationSequence"], - "1046" : ["SQ", "IonMachineVerificationSequence"], - "1048" : ["SQ", "FailedAttributesSequence"], - "104A" : ["SQ", "OverriddenAttributesSequence"], - "104C" : ["SQ", "ConventionalControlPointVerificationSequence"], - "104E" : ["SQ", "IonControlPointVerificationSequence"], - "1050" : ["SQ", "AttributeOccurrenceSequence"], - "1052" : ["AT", "AttributeOccurrencePointer"], - "1054" : ["UL", "AttributeItemSelector"], - "1056" : ["LO", "AttributeOccurrencePrivateCreator"], - "1057" : ["IS", "SelectorSequencePointerItems"], - "1200" : ["CS", "ScheduledProcedureStepPriority"], - "1202" : ["LO", "WorklistLabel"], - "1204" : ["LO", "ProcedureStepLabel"], - "1210" : ["SQ", "ScheduledProcessingParametersSequence"], - "1212" : ["SQ", "PerformedProcessingParametersSequence"], - "1216" : ["SQ", "UnifiedProcedureStepPerformedProcedureSequence"], - "1220" : ["SQ", "RelatedProcedureStepSequence"], - "1222" : ["LO", "ProcedureStepRelationshipType"], - "1224" : ["SQ", "ReplacedProcedureStepSequence"], - "1230" : ["LO", "DeletionLock"], - "1234" : ["AE", "ReceivingAE"], - "1236" : ["AE", "RequestingAE"], - "1238" : ["LT", "ReasonForCancellation"], - "1242" : ["CS", "SCPStatus"], - "1244" : ["CS", "SubscriptionListStatus"], - "1246" : ["CS", "UnifiedProcedureStepListStatus"], - "1324" : ["UL", "BeamOrderIndex"], - "1338" : ["FD", "DoubleExposureMeterset"], - "133A" : ["FD", "DoubleExposureFieldDelta"] - }, - "0076" : { - "0001" : ["LO", "ImplantAssemblyTemplateName"], - "0003" : ["LO", "ImplantAssemblyTemplateIssuer"], - "0006" : ["LO", "ImplantAssemblyTemplateVersion"], - "0008" : ["SQ", "ReplacedImplantAssemblyTemplateSequence"], - "000A" : ["CS", "ImplantAssemblyTemplateType"], - "000C" : ["SQ", "OriginalImplantAssemblyTemplateSequence"], - "000E" : ["SQ", "DerivationImplantAssemblyTemplateSequence"], - "0010" : ["SQ", "ImplantAssemblyTemplateTargetAnatomySequence"], - "0020" : ["SQ", "ProcedureTypeCodeSequence"], - "0030" : ["LO", "SurgicalTechnique"], - "0032" : ["SQ", "ComponentTypesSequence"], - "0034" : ["CS", "ComponentTypeCodeSequence"], - "0036" : ["CS", "ExclusiveComponentType"], - "0038" : ["CS", "MandatoryComponentType"], - "0040" : ["SQ", "ComponentSequence"], - "0055" : ["US", "ComponentID"], - "0060" : ["SQ", "ComponentAssemblySequence"], - "0070" : ["US", "Component1ReferencedID"], - "0080" : ["US", "Component1ReferencedMatingFeatureSetID"], - "0090" : ["US", "Component1ReferencedMatingFeatureID"], - "00A0" : ["US", "Component2ReferencedID"], - "00B0" : ["US", "Component2ReferencedMatingFeatureSetID"], - "00C0" : ["US", "Component2ReferencedMatingFeatureID"] - }, - "0078" : { - "0001" : ["LO", "ImplantTemplateGroupName"], - "0010" : ["ST", "ImplantTemplateGroupDescription"], - "0020" : ["LO", "ImplantTemplateGroupIssuer"], - "0024" : ["LO", "ImplantTemplateGroupVersion"], - "0026" : ["SQ", "ReplacedImplantTemplateGroupSequence"], - "0028" : ["SQ", "ImplantTemplateGroupTargetAnatomySequence"], - "002A" : ["SQ", "ImplantTemplateGroupMembersSequence"], - "002E" : ["US", "ImplantTemplateGroupMemberID"], - "0050" : ["FD", "ThreeDImplantTemplateGroupMemberMatchingPoint"], - "0060" : ["FD", "ThreeDImplantTemplateGroupMemberMatchingAxes"], - "0070" : ["SQ", "ImplantTemplateGroupMemberMatching2DCoordinatesSequence"], - "0090" : ["FD", "TwoDImplantTemplateGroupMemberMatchingPoint"], - "00A0" : ["FD", "TwoDImplantTemplateGroupMemberMatchingAxes"], - "00B0" : ["SQ", "ImplantTemplateGroupVariationDimensionSequence"], - "00B2" : ["LO", "ImplantTemplateGroupVariationDimensionName"], - "00B4" : ["SQ", "ImplantTemplateGroupVariationDimensionRankSequence"], - "00B6" : ["US", "ReferencedImplantTemplateGroupMemberID"], - "00B8" : ["US", "ImplantTemplateGroupVariationDimensionRank"] - }, - "0088" : { - "0130" : ["SH", "StorageMediaFileSetID"], - "0140" : ["UI", "StorageMediaFileSetUID"], - "0200" : ["SQ", "IconImageSequence"], - "0904" : ["LO", "TopicTitle"], - "0906" : ["ST", "TopicSubject"], - "0910" : ["LO", "TopicAuthor"], - "0912" : ["LO", "TopicKeywords"] - }, - "0100" : { - "0410" : ["CS", "SOPInstanceStatus"], - "0420" : ["DT", "SOPAuthorizationDateTime"], - "0424" : ["LT", "SOPAuthorizationComment"], - "0426" : ["LO", "AuthorizationEquipmentCertificationNumber"] - }, - "0400" : { - "0005" : ["US", "MACIDNumber"], - "0010" : ["UI", "MACCalculationTransferSyntaxUID"], - "0015" : ["CS", "MACAlgorithm"], - "0020" : ["AT", "DataElementsSigned"], - "0100" : ["UI", "DigitalSignatureUID"], - "0105" : ["DT", "DigitalSignatureDateTime"], - "0110" : ["CS", "CertificateType"], - "0115" : ["OB", "CertificateOfSigner"], - "0120" : ["OB", "Signature"], - "0305" : ["CS", "CertifiedTimestampType"], - "0310" : ["OB", "CertifiedTimestamp"], - "0401" : ["SQ", "DigitalSignaturePurposeCodeSequence"], - "0402" : ["SQ", "ReferencedDigitalSignatureSequence"], - "0403" : ["SQ", "ReferencedSOPInstanceMACSequence"], - "0404" : ["OB", "MAC"], - "0500" : ["SQ", "EncryptedAttributesSequence"], - "0510" : ["UI", "EncryptedContentTransferSyntaxUID"], - "0520" : ["OB", "EncryptedContent"], - "0550" : ["SQ", "ModifiedAttributesSequence"], - "0561" : ["SQ", "OriginalAttributesSequence"], - "0562" : ["DT", "AttributeModificationDateTime"], - "0563" : ["LO", "ModifyingSystem"], - "0564" : ["LO", "SourceOfPreviousValues"], - "0565" : ["CS", "ReasonForTheAttributeModification"] - }, - "2000" : { - "0010" : ["IS", "NumberOfCopies"], - "001E" : ["SQ", "PrinterConfigurationSequence"], - "0020" : ["CS", "PrintPriority"], - "0030" : ["CS", "MediumType"], - "0040" : ["CS", "FilmDestination"], - "0050" : ["LO", "FilmSessionLabel"], - "0060" : ["IS", "MemoryAllocation"], - "0061" : ["IS", "MaximumMemoryAllocation"], - "0062" : ["CS", "ColorImagePrintingFlag"], - "0063" : ["CS", "CollationFlag"], - "0065" : ["CS", "AnnotationFlag"], - "0067" : ["CS", "ImageOverlayFlag"], - "0069" : ["CS", "PresentationLUTFlag"], - "006A" : ["CS", "ImageBoxPresentationLUTFlag"], - "00A0" : ["US", "MemoryBitDepth"], - "00A1" : ["US", "PrintingBitDepth"], - "00A2" : ["SQ", "MediaInstalledSequence"], - "00A4" : ["SQ", "OtherMediaAvailableSequence"], - "00A8" : ["SQ", "SupportedImageDisplayFormatsSequence"], - "0500" : ["SQ", "ReferencedFilmBoxSequence"], - "0510" : ["SQ", "ReferencedStoredPrintSequence"] - }, - "2010" : { - "0010" : ["ST", "ImageDisplayFormat"], - "0030" : ["CS", "AnnotationDisplayFormatID"], - "0040" : ["CS", "FilmOrientation"], - "0050" : ["CS", "FilmSizeID"], - "0052" : ["CS", "PrinterResolutionID"], - "0054" : ["CS", "DefaultPrinterResolutionID"], - "0060" : ["CS", "MagnificationType"], - "0080" : ["CS", "SmoothingType"], - "00A6" : ["CS", "DefaultMagnificationType"], - "00A7" : ["CS", "OtherMagnificationTypesAvailable"], - "00A8" : ["CS", "DefaultSmoothingType"], - "00A9" : ["CS", "OtherSmoothingTypesAvailable"], - "0100" : ["CS", "BorderDensity"], - "0110" : ["CS", "EmptyImageDensity"], - "0120" : ["US", "MinDensity"], - "0130" : ["US", "MaxDensity"], - "0140" : ["CS", "Trim"], - "0150" : ["ST", "ConfigurationInformation"], - "0152" : ["LT", "ConfigurationInformationDescription"], - "0154" : ["IS", "MaximumCollatedFilms"], - "015E" : ["US", "Illumination"], - "0160" : ["US", "ReflectedAmbientLight"], - "0376" : ["DS", "PrinterPixelSpacing"], - "0500" : ["SQ", "ReferencedFilmSessionSequence"], - "0510" : ["SQ", "ReferencedImageBoxSequence"], - "0520" : ["SQ", "ReferencedBasicAnnotationBoxSequence"] - }, - "2020" : { - "0010" : ["US", "ImageBoxPosition"], - "0020" : ["CS", "Polarity"], - "0030" : ["DS", "RequestedImageSize"], - "0040" : ["CS", "RequestedDecimateCropBehavior"], - "0050" : ["CS", "RequestedResolutionID"], - "00A0" : ["CS", "RequestedImageSizeFlag"], - "00A2" : ["CS", "DecimateCropResult"], - "0110" : ["SQ", "BasicGrayscaleImageSequence"], - "0111" : ["SQ", "BasicColorImageSequence"], - "0130" : ["SQ", "ReferencedImageOverlayBoxSequence"], - "0140" : ["SQ", "ReferencedVOILUTBoxSequence"] - }, - "2030" : { - "0010" : ["US", "AnnotationPosition"], - "0020" : ["LO", "TextString"] - }, - "2040" : { - "0010" : ["SQ", "ReferencedOverlayPlaneSequence"], - "0011" : ["US", "ReferencedOverlayPlaneGroups"], - "0020" : ["SQ", "OverlayPixelDataSequence"], - "0060" : ["CS", "OverlayMagnificationType"], - "0070" : ["CS", "OverlaySmoothingType"], - "0072" : ["CS", "OverlayOrImageMagnification"], - "0074" : ["US", "MagnifyToNumberOfColumns"], - "0080" : ["CS", "OverlayForegroundDensity"], - "0082" : ["CS", "OverlayBackgroundDensity"], - "0090" : ["CS", "OverlayMode"], - "0100" : ["CS", "ThresholdDensity"], - "0500" : ["SQ", "ReferencedImageBoxSequenceRetired"] - }, - "2050" : { - "0010" : ["SQ", "PresentationLUTSequence"], - "0020" : ["CS", "PresentationLUTShape"], - "0500" : ["SQ", "ReferencedPresentationLUTSequence"] - }, - "2100" : { - "0010" : ["SH", "PrintJobID"], - "0020" : ["CS", "ExecutionStatus"], - "0030" : ["CS", "ExecutionStatusInfo"], - "0040" : ["DA", "CreationDate"], - "0050" : ["TM", "CreationTime"], - "0070" : ["AE", "Originator"], - "0140" : ["AE", "DestinationAE"], - "0160" : ["SH", "OwnerID"], - "0170" : ["IS", "NumberOfFilms"], - "0500" : ["SQ", "ReferencedPrintJobSequencePullStoredPrint"] - }, - "2110" : { - "0010" : ["CS", "PrinterStatus"], - "0020" : ["CS", "PrinterStatusInfo"], - "0030" : ["LO", "PrinterName"], - "0099" : ["SH", "PrintQueueID"] - }, - "2120" : { - "0010" : ["CS", "QueueStatus"], - "0050" : ["SQ", "PrintJobDescriptionSequence"], - "0070" : ["SQ", "ReferencedPrintJobSequence"] - }, - "2130" : { - "0010" : ["SQ", "PrintManagementCapabilitiesSequence"], - "0015" : ["SQ", "PrinterCharacteristicsSequence"], - "0030" : ["SQ", "FilmBoxContentSequence"], - "0040" : ["SQ", "ImageBoxContentSequence"], - "0050" : ["SQ", "AnnotationContentSequence"], - "0060" : ["SQ", "ImageOverlayBoxContentSequence"], - "0080" : ["SQ", "PresentationLUTContentSequence"], - "00A0" : ["SQ", "ProposedStudySequence"], - "00C0" : ["SQ", "OriginalImageSequence"] - }, - "2200" : { - "0001" : ["CS", "LabelUsingInformationExtractedFromInstances"], - "0002" : ["UT", "LabelText"], - "0003" : ["CS", "LabelStyleSelection"], - "0004" : ["LT", "MediaDisposition"], - "0005" : ["LT", "BarcodeValue"], - "0006" : ["CS", "BarcodeSymbology"], - "0007" : ["CS", "AllowMediaSplitting"], - "0008" : ["CS", "IncludeNonDICOMObjects"], - "0009" : ["CS", "IncludeDisplayApplication"], - "000A" : ["CS", "PreserveCompositeInstancesAfterMediaCreation"], - "000B" : ["US", "TotalNumberOfPiecesOfMediaCreated"], - "000C" : ["LO", "RequestedMediaApplicationProfile"], - "000D" : ["SQ", "ReferencedStorageMediaSequence"], - "000E" : ["AT", "FailureAttributes"], - "000F" : ["CS", "AllowLossyCompression"], - "0020" : ["CS", "RequestPriority"] - }, - "3002" : { - "0002" : ["SH", "RTImageLabel"], - "0003" : ["LO", "RTImageName"], - "0004" : ["ST", "RTImageDescription"], - "000A" : ["CS", "ReportedValuesOrigin"], - "000C" : ["CS", "RTImagePlane"], - "000D" : ["DS", "XRayImageReceptorTranslation"], - "000E" : ["DS", "XRayImageReceptorAngle"], - "0010" : ["DS", "RTImageOrientation"], - "0011" : ["DS", "ImagePlanePixelSpacing"], - "0012" : ["DS", "RTImagePosition"], - "0020" : ["SH", "RadiationMachineName"], - "0022" : ["DS", "RadiationMachineSAD"], - "0024" : ["DS", "RadiationMachineSSD"], - "0026" : ["DS", "RTImageSID"], - "0028" : ["DS", "SourceToReferenceObjectDistance"], - "0029" : ["IS", "FractionNumber"], - "0030" : ["SQ", "ExposureSequence"], - "0032" : ["DS", "MetersetExposure"], - "0034" : ["DS", "DiaphragmPosition"], - "0040" : ["SQ", "FluenceMapSequence"], - "0041" : ["CS", "FluenceDataSource"], - "0042" : ["DS", "FluenceDataScale"], - "0050" : ["SQ", "PrimaryFluenceModeSequence"], - "0051" : ["CS", "FluenceMode"], - "0052" : ["SH", "FluenceModeID"] - }, - "3004" : { - "0001" : ["CS", "DVHType"], - "0002" : ["CS", "DoseUnits"], - "0004" : ["CS", "DoseType"], - "0006" : ["LO", "DoseComment"], - "0008" : ["DS", "NormalizationPoint"], - "000A" : ["CS", "DoseSummationType"], - "000C" : ["DS", "GridFrameOffsetVector"], - "000E" : ["DS", "DoseGridScaling"], - "0010" : ["SQ", "RTDoseROISequence"], - "0012" : ["DS", "DoseValue"], - "0014" : ["CS", "TissueHeterogeneityCorrection"], - "0040" : ["DS", "DVHNormalizationPoint"], - "0042" : ["DS", "DVHNormalizationDoseValue"], - "0050" : ["SQ", "DVHSequence"], - "0052" : ["DS", "DVHDoseScaling"], - "0054" : ["CS", "DVHVolumeUnits"], - "0056" : ["IS", "DVHNumberOfBins"], - "0058" : ["DS", "DVHData"], - "0060" : ["SQ", "DVHReferencedROISequence"], - "0062" : ["CS", "DVHROIContributionType"], - "0070" : ["DS", "DVHMinimumDose"], - "0072" : ["DS", "DVHMaximumDose"], - "0074" : ["DS", "DVHMeanDose"] - }, - "3006" : { - "0002" : ["SH", "StructureSetLabel"], - "0004" : ["LO", "StructureSetName"], - "0006" : ["ST", "StructureSetDescription"], - "0008" : ["DA", "StructureSetDate"], - "0009" : ["TM", "StructureSetTime"], - "0010" : ["SQ", "ReferencedFrameOfReferenceSequence"], - "0012" : ["SQ", "RTReferencedStudySequence"], - "0014" : ["SQ", "RTReferencedSeriesSequence"], - "0016" : ["SQ", "ContourImageSequence"], - "0020" : ["SQ", "StructureSetROISequence"], - "0022" : ["IS", "ROINumber"], - "0024" : ["UI", "ReferencedFrameOfReferenceUID"], - "0026" : ["LO", "ROIName"], - "0028" : ["ST", "ROIDescription"], - "002A" : ["IS", "ROIDisplayColor"], - "002C" : ["DS", "ROIVolume"], - "0030" : ["SQ", "RTRelatedROISequence"], - "0033" : ["CS", "RTROIRelationship"], - "0036" : ["CS", "ROIGenerationAlgorithm"], - "0038" : ["LO", "ROIGenerationDescription"], - "0039" : ["SQ", "ROIContourSequence"], - "0040" : ["SQ", "ContourSequence"], - "0042" : ["CS", "ContourGeometricType"], - "0044" : ["DS", "ContourSlabThickness"], - "0045" : ["DS", "ContourOffsetVector"], - "0046" : ["IS", "NumberOfContourPoints"], - "0048" : ["IS", "ContourNumber"], - "0049" : ["IS", "AttachedContours"], - "0050" : ["DS", "ContourData"], - "0080" : ["SQ", "RTROIObservationsSequence"], - "0082" : ["IS", "ObservationNumber"], - "0084" : ["IS", "ReferencedROINumber"], - "0085" : ["SH", "ROIObservationLabel"], - "0086" : ["SQ", "RTROIIdentificationCodeSequence"], - "0088" : ["ST", "ROIObservationDescription"], - "00A0" : ["SQ", "RelatedRTROIObservationsSequence"], - "00A4" : ["CS", "RTROIInterpretedType"], - "00A6" : ["PN", "ROIInterpreter"], - "00B0" : ["SQ", "ROIPhysicalPropertiesSequence"], - "00B2" : ["CS", "ROIPhysicalProperty"], - "00B4" : ["DS", "ROIPhysicalPropertyValue"], - "00B6" : ["SQ", "ROIElementalCompositionSequence"], - "00B7" : ["US", "ROIElementalCompositionAtomicNumber"], - "00B8" : ["FL", "ROIElementalCompositionAtomicMassFraction"], - "00C0" : ["SQ", "FrameOfReferenceRelationshipSequence"], - "00C2" : ["UI", "RelatedFrameOfReferenceUID"], - "00C4" : ["CS", "FrameOfReferenceTransformationType"], - "00C6" : ["DS", "FrameOfReferenceTransformationMatrix"], - "00C8" : ["LO", "FrameOfReferenceTransformationComment"] - }, - "3008" : { - "0010" : ["SQ", "MeasuredDoseReferenceSequence"], - "0012" : ["ST", "MeasuredDoseDescription"], - "0014" : ["CS", "MeasuredDoseType"], - "0016" : ["DS", "MeasuredDoseValue"], - "0020" : ["SQ", "TreatmentSessionBeamSequence"], - "0021" : ["SQ", "TreatmentSessionIonBeamSequence"], - "0022" : ["IS", "CurrentFractionNumber"], - "0024" : ["DA", "TreatmentControlPointDate"], - "0025" : ["TM", "TreatmentControlPointTime"], - "002A" : ["CS", "TreatmentTerminationStatus"], - "002B" : ["SH", "TreatmentTerminationCode"], - "002C" : ["CS", "TreatmentVerificationStatus"], - "0030" : ["SQ", "ReferencedTreatmentRecordSequence"], - "0032" : ["DS", "SpecifiedPrimaryMeterset"], - "0033" : ["DS", "SpecifiedSecondaryMeterset"], - "0036" : ["DS", "DeliveredPrimaryMeterset"], - "0037" : ["DS", "DeliveredSecondaryMeterset"], - "003A" : ["DS", "SpecifiedTreatmentTime"], - "003B" : ["DS", "DeliveredTreatmentTime"], - "0040" : ["SQ", "ControlPointDeliverySequence"], - "0041" : ["SQ", "IonControlPointDeliverySequence"], - "0042" : ["DS", "SpecifiedMeterset"], - "0044" : ["DS", "DeliveredMeterset"], - "0045" : ["FL", "MetersetRateSet"], - "0046" : ["FL", "MetersetRateDelivered"], - "0047" : ["FL", "ScanSpotMetersetsDelivered"], - "0048" : ["DS", "DoseRateDelivered"], - "0050" : ["SQ", "TreatmentSummaryCalculatedDoseReferenceSequence"], - "0052" : ["DS", "CumulativeDoseToDoseReference"], - "0054" : ["DA", "FirstTreatmentDate"], - "0056" : ["DA", "MostRecentTreatmentDate"], - "005A" : ["IS", "NumberOfFractionsDelivered"], - "0060" : ["SQ", "OverrideSequence"], - "0061" : ["AT", "ParameterSequencePointer"], - "0062" : ["AT", "OverrideParameterPointer"], - "0063" : ["IS", "ParameterItemIndex"], - "0064" : ["IS", "MeasuredDoseReferenceNumber"], - "0065" : ["AT", "ParameterPointer"], - "0066" : ["ST", "OverrideReason"], - "0068" : ["SQ", "CorrectedParameterSequence"], - "006A" : ["FL", "CorrectionValue"], - "0070" : ["SQ", "CalculatedDoseReferenceSequence"], - "0072" : ["IS", "CalculatedDoseReferenceNumber"], - "0074" : ["ST", "CalculatedDoseReferenceDescription"], - "0076" : ["DS", "CalculatedDoseReferenceDoseValue"], - "0078" : ["DS", "StartMeterset"], - "007A" : ["DS", "EndMeterset"], - "0080" : ["SQ", "ReferencedMeasuredDoseReferenceSequence"], - "0082" : ["IS", "ReferencedMeasuredDoseReferenceNumber"], - "0090" : ["SQ", "ReferencedCalculatedDoseReferenceSequence"], - "0092" : ["IS", "ReferencedCalculatedDoseReferenceNumber"], - "00A0" : ["SQ", "BeamLimitingDeviceLeafPairsSequence"], - "00B0" : ["SQ", "RecordedWedgeSequence"], - "00C0" : ["SQ", "RecordedCompensatorSequence"], - "00D0" : ["SQ", "RecordedBlockSequence"], - "00E0" : ["SQ", "TreatmentSummaryMeasuredDoseReferenceSequence"], - "00F0" : ["SQ", "RecordedSnoutSequence"], - "00F2" : ["SQ", "RecordedRangeShifterSequence"], - "00F4" : ["SQ", "RecordedLateralSpreadingDeviceSequence"], - "00F6" : ["SQ", "RecordedRangeModulatorSequence"], - "0100" : ["SQ", "RecordedSourceSequence"], - "0105" : ["LO", "SourceSerialNumber"], - "0110" : ["SQ", "TreatmentSessionApplicationSetupSequence"], - "0116" : ["CS", "ApplicationSetupCheck"], - "0120" : ["SQ", "RecordedBrachyAccessoryDeviceSequence"], - "0122" : ["IS", "ReferencedBrachyAccessoryDeviceNumber"], - "0130" : ["SQ", "RecordedChannelSequence"], - "0132" : ["DS", "SpecifiedChannelTotalTime"], - "0134" : ["DS", "DeliveredChannelTotalTime"], - "0136" : ["IS", "SpecifiedNumberOfPulses"], - "0138" : ["IS", "DeliveredNumberOfPulses"], - "013A" : ["DS", "SpecifiedPulseRepetitionInterval"], - "013C" : ["DS", "DeliveredPulseRepetitionInterval"], - "0140" : ["SQ", "RecordedSourceApplicatorSequence"], - "0142" : ["IS", "ReferencedSourceApplicatorNumber"], - "0150" : ["SQ", "RecordedChannelShieldSequence"], - "0152" : ["IS", "ReferencedChannelShieldNumber"], - "0160" : ["SQ", "BrachyControlPointDeliveredSequence"], - "0162" : ["DA", "SafePositionExitDate"], - "0164" : ["TM", "SafePositionExitTime"], - "0166" : ["DA", "SafePositionReturnDate"], - "0168" : ["TM", "SafePositionReturnTime"], - "0200" : ["CS", "CurrentTreatmentStatus"], - "0202" : ["ST", "TreatmentStatusComment"], - "0220" : ["SQ", "FractionGroupSummarySequence"], - "0223" : ["IS", "ReferencedFractionNumber"], - "0224" : ["CS", "FractionGroupType"], - "0230" : ["CS", "BeamStopperPosition"], - "0240" : ["SQ", "FractionStatusSummarySequence"], - "0250" : ["DA", "TreatmentDate"], - "0251" : ["TM", "TreatmentTime"] - }, - "300A" : { - "0002" : ["SH", "RTPlanLabel"], - "0003" : ["LO", "RTPlanName"], - "0004" : ["ST", "RTPlanDescription"], - "0006" : ["DA", "RTPlanDate"], - "0007" : ["TM", "RTPlanTime"], - "0009" : ["LO", "TreatmentProtocols"], - "000A" : ["CS", "PlanIntent"], - "000B" : ["LO", "TreatmentSites"], - "000C" : ["CS", "RTPlanGeometry"], - "000E" : ["ST", "PrescriptionDescription"], - "0010" : ["SQ", "DoseReferenceSequence"], - "0012" : ["IS", "DoseReferenceNumber"], - "0013" : ["UI", "DoseReferenceUID"], - "0014" : ["CS", "DoseReferenceStructureType"], - "0015" : ["CS", "NominalBeamEnergyUnit"], - "0016" : ["LO", "DoseReferenceDescription"], - "0018" : ["DS", "DoseReferencePointCoordinates"], - "001A" : ["DS", "NominalPriorDose"], - "0020" : ["CS", "DoseReferenceType"], - "0021" : ["DS", "ConstraintWeight"], - "0022" : ["DS", "DeliveryWarningDose"], - "0023" : ["DS", "DeliveryMaximumDose"], - "0025" : ["DS", "TargetMinimumDose"], - "0026" : ["DS", "TargetPrescriptionDose"], - "0027" : ["DS", "TargetMaximumDose"], - "0028" : ["DS", "TargetUnderdoseVolumeFraction"], - "002A" : ["DS", "OrganAtRiskFullVolumeDose"], - "002B" : ["DS", "OrganAtRiskLimitDose"], - "002C" : ["DS", "OrganAtRiskMaximumDose"], - "002D" : ["DS", "OrganAtRiskOverdoseVolumeFraction"], - "0040" : ["SQ", "ToleranceTableSequence"], - "0042" : ["IS", "ToleranceTableNumber"], - "0043" : ["SH", "ToleranceTableLabel"], - "0044" : ["DS", "GantryAngleTolerance"], - "0046" : ["DS", "BeamLimitingDeviceAngleTolerance"], - "0048" : ["SQ", "BeamLimitingDeviceToleranceSequence"], - "004A" : ["DS", "BeamLimitingDevicePositionTolerance"], - "004B" : ["FL", "SnoutPositionTolerance"], - "004C" : ["DS", "PatientSupportAngleTolerance"], - "004E" : ["DS", "TableTopEccentricAngleTolerance"], - "004F" : ["FL", "TableTopPitchAngleTolerance"], - "0050" : ["FL", "TableTopRollAngleTolerance"], - "0051" : ["DS", "TableTopVerticalPositionTolerance"], - "0052" : ["DS", "TableTopLongitudinalPositionTolerance"], - "0053" : ["DS", "TableTopLateralPositionTolerance"], - "0055" : ["CS", "RTPlanRelationship"], - "0070" : ["SQ", "FractionGroupSequence"], - "0071" : ["IS", "FractionGroupNumber"], - "0072" : ["LO", "FractionGroupDescription"], - "0078" : ["IS", "NumberOfFractionsPlanned"], - "0079" : ["IS", "NumberOfFractionPatternDigitsPerDay"], - "007A" : ["IS", "RepeatFractionCycleLength"], - "007B" : ["LT", "FractionPattern"], - "0080" : ["IS", "NumberOfBeams"], - "0082" : ["DS", "BeamDoseSpecificationPoint"], - "0084" : ["DS", "BeamDose"], - "0086" : ["DS", "BeamMeterset"], - "0088" : ["FL", "BeamDosePointDepth"], - "0089" : ["FL", "BeamDosePointEquivalentDepth"], - "008A" : ["FL", "BeamDosePointSSD"], - "00A0" : ["IS", "NumberOfBrachyApplicationSetups"], - "00A2" : ["DS", "BrachyApplicationSetupDoseSpecificationPoint"], - "00A4" : ["DS", "BrachyApplicationSetupDose"], - "00B0" : ["SQ", "BeamSequence"], - "00B2" : ["SH", "TreatmentMachineName"], - "00B3" : ["CS", "PrimaryDosimeterUnit"], - "00B4" : ["DS", "SourceAxisDistance"], - "00B6" : ["SQ", "BeamLimitingDeviceSequence"], - "00B8" : ["CS", "RTBeamLimitingDeviceType"], - "00BA" : ["DS", "SourceToBeamLimitingDeviceDistance"], - "00BB" : ["FL", "IsocenterToBeamLimitingDeviceDistance"], - "00BC" : ["IS", "NumberOfLeafJawPairs"], - "00BE" : ["DS", "LeafPositionBoundaries"], - "00C0" : ["IS", "BeamNumber"], - "00C2" : ["LO", "BeamName"], - "00C3" : ["ST", "BeamDescription"], - "00C4" : ["CS", "BeamType"], - "00C6" : ["CS", "RadiationType"], - "00C7" : ["CS", "HighDoseTechniqueType"], - "00C8" : ["IS", "ReferenceImageNumber"], - "00CA" : ["SQ", "PlannedVerificationImageSequence"], - "00CC" : ["LO", "ImagingDeviceSpecificAcquisitionParameters"], - "00CE" : ["CS", "TreatmentDeliveryType"], - "00D0" : ["IS", "NumberOfWedges"], - "00D1" : ["SQ", "WedgeSequence"], - "00D2" : ["IS", "WedgeNumber"], - "00D3" : ["CS", "WedgeType"], - "00D4" : ["SH", "WedgeID"], - "00D5" : ["IS", "WedgeAngle"], - "00D6" : ["DS", "WedgeFactor"], - "00D7" : ["FL", "TotalWedgeTrayWaterEquivalentThickness"], - "00D8" : ["DS", "WedgeOrientation"], - "00D9" : ["FL", "IsocenterToWedgeTrayDistance"], - "00DA" : ["DS", "SourceToWedgeTrayDistance"], - "00DB" : ["FL", "WedgeThinEdgePosition"], - "00DC" : ["SH", "BolusID"], - "00DD" : ["ST", "BolusDescription"], - "00E0" : ["IS", "NumberOfCompensators"], - "00E1" : ["SH", "MaterialID"], - "00E2" : ["DS", "TotalCompensatorTrayFactor"], - "00E3" : ["SQ", "CompensatorSequence"], - "00E4" : ["IS", "CompensatorNumber"], - "00E5" : ["SH", "CompensatorID"], - "00E6" : ["DS", "SourceToCompensatorTrayDistance"], - "00E7" : ["IS", "CompensatorRows"], - "00E8" : ["IS", "CompensatorColumns"], - "00E9" : ["DS", "CompensatorPixelSpacing"], - "00EA" : ["DS", "CompensatorPosition"], - "00EB" : ["DS", "CompensatorTransmissionData"], - "00EC" : ["DS", "CompensatorThicknessData"], - "00ED" : ["IS", "NumberOfBoli"], - "00EE" : ["CS", "CompensatorType"], - "00F0" : ["IS", "NumberOfBlocks"], - "00F2" : ["DS", "TotalBlockTrayFactor"], - "00F3" : ["FL", "TotalBlockTrayWaterEquivalentThickness"], - "00F4" : ["SQ", "BlockSequence"], - "00F5" : ["SH", "BlockTrayID"], - "00F6" : ["DS", "SourceToBlockTrayDistance"], - "00F7" : ["FL", "IsocenterToBlockTrayDistance"], - "00F8" : ["CS", "BlockType"], - "00F9" : ["LO", "AccessoryCode"], - "00FA" : ["CS", "BlockDivergence"], - "00FB" : ["CS", "BlockMountingPosition"], - "00FC" : ["IS", "BlockNumber"], - "00FE" : ["LO", "BlockName"], - "0100" : ["DS", "BlockThickness"], - "0102" : ["DS", "BlockTransmission"], - "0104" : ["IS", "BlockNumberOfPoints"], - "0106" : ["DS", "BlockData"], - "0107" : ["SQ", "ApplicatorSequence"], - "0108" : ["SH", "ApplicatorID"], - "0109" : ["CS", "ApplicatorType"], - "010A" : ["LO", "ApplicatorDescription"], - "010C" : ["DS", "CumulativeDoseReferenceCoefficient"], - "010E" : ["DS", "FinalCumulativeMetersetWeight"], - "0110" : ["IS", "NumberOfControlPoints"], - "0111" : ["SQ", "ControlPointSequence"], - "0112" : ["IS", "ControlPointIndex"], - "0114" : ["DS", "NominalBeamEnergy"], - "0115" : ["DS", "DoseRateSet"], - "0116" : ["SQ", "WedgePositionSequence"], - "0118" : ["CS", "WedgePosition"], - "011A" : ["SQ", "BeamLimitingDevicePositionSequence"], - "011C" : ["DS", "LeafJawPositions"], - "011E" : ["DS", "GantryAngle"], - "011F" : ["CS", "GantryRotationDirection"], - "0120" : ["DS", "BeamLimitingDeviceAngle"], - "0121" : ["CS", "BeamLimitingDeviceRotationDirection"], - "0122" : ["DS", "PatientSupportAngle"], - "0123" : ["CS", "PatientSupportRotationDirection"], - "0124" : ["DS", "TableTopEccentricAxisDistance"], - "0125" : ["DS", "TableTopEccentricAngle"], - "0126" : ["CS", "TableTopEccentricRotationDirection"], - "0128" : ["DS", "TableTopVerticalPosition"], - "0129" : ["DS", "TableTopLongitudinalPosition"], - "012A" : ["DS", "TableTopLateralPosition"], - "012C" : ["DS", "IsocenterPosition"], - "012E" : ["DS", "SurfaceEntryPoint"], - "0130" : ["DS", "SourceToSurfaceDistance"], - "0134" : ["DS", "CumulativeMetersetWeight"], - "0140" : ["FL", "TableTopPitchAngle"], - "0142" : ["CS", "TableTopPitchRotationDirection"], - "0144" : ["FL", "TableTopRollAngle"], - "0146" : ["CS", "TableTopRollRotationDirection"], - "0148" : ["FL", "HeadFixationAngle"], - "014A" : ["FL", "GantryPitchAngle"], - "014C" : ["CS", "GantryPitchRotationDirection"], - "014E" : ["FL", "GantryPitchAngleTolerance"], - "0180" : ["SQ", "PatientSetupSequence"], - "0182" : ["IS", "PatientSetupNumber"], - "0183" : ["LO", "PatientSetupLabel"], - "0184" : ["LO", "PatientAdditionalPosition"], - "0190" : ["SQ", "FixationDeviceSequence"], - "0192" : ["CS", "FixationDeviceType"], - "0194" : ["SH", "FixationDeviceLabel"], - "0196" : ["ST", "FixationDeviceDescription"], - "0198" : ["SH", "FixationDevicePosition"], - "0199" : ["FL", "FixationDevicePitchAngle"], - "019A" : ["FL", "FixationDeviceRollAngle"], - "01A0" : ["SQ", "ShieldingDeviceSequence"], - "01A2" : ["CS", "ShieldingDeviceType"], - "01A4" : ["SH", "ShieldingDeviceLabel"], - "01A6" : ["ST", "ShieldingDeviceDescription"], - "01A8" : ["SH", "ShieldingDevicePosition"], - "01B0" : ["CS", "SetupTechnique"], - "01B2" : ["ST", "SetupTechniqueDescription"], - "01B4" : ["SQ", "SetupDeviceSequence"], - "01B6" : ["CS", "SetupDeviceType"], - "01B8" : ["SH", "SetupDeviceLabel"], - "01BA" : ["ST", "SetupDeviceDescription"], - "01BC" : ["DS", "SetupDeviceParameter"], - "01D0" : ["ST", "SetupReferenceDescription"], - "01D2" : ["DS", "TableTopVerticalSetupDisplacement"], - "01D4" : ["DS", "TableTopLongitudinalSetupDisplacement"], - "01D6" : ["DS", "TableTopLateralSetupDisplacement"], - "0200" : ["CS", "BrachyTreatmentTechnique"], - "0202" : ["CS", "BrachyTreatmentType"], - "0206" : ["SQ", "TreatmentMachineSequence"], - "0210" : ["SQ", "SourceSequence"], - "0212" : ["IS", "SourceNumber"], - "0214" : ["CS", "SourceType"], - "0216" : ["LO", "SourceManufacturer"], - "0218" : ["DS", "ActiveSourceDiameter"], - "021A" : ["DS", "ActiveSourceLength"], - "0222" : ["DS", "SourceEncapsulationNominalThickness"], - "0224" : ["DS", "SourceEncapsulationNominalTransmission"], - "0226" : ["LO", "SourceIsotopeName"], - "0228" : ["DS", "SourceIsotopeHalfLife"], - "0229" : ["CS", "SourceStrengthUnits"], - "022A" : ["DS", "ReferenceAirKermaRate"], - "022B" : ["DS", "SourceStrength"], - "022C" : ["DA", "SourceStrengthReferenceDate"], - "022E" : ["TM", "SourceStrengthReferenceTime"], - "0230" : ["SQ", "ApplicationSetupSequence"], - "0232" : ["CS", "ApplicationSetupType"], - "0234" : ["IS", "ApplicationSetupNumber"], - "0236" : ["LO", "ApplicationSetupName"], - "0238" : ["LO", "ApplicationSetupManufacturer"], - "0240" : ["IS", "TemplateNumber"], - "0242" : ["SH", "TemplateType"], - "0244" : ["LO", "TemplateName"], - "0250" : ["DS", "TotalReferenceAirKerma"], - "0260" : ["SQ", "BrachyAccessoryDeviceSequence"], - "0262" : ["IS", "BrachyAccessoryDeviceNumber"], - "0263" : ["SH", "BrachyAccessoryDeviceID"], - "0264" : ["CS", "BrachyAccessoryDeviceType"], - "0266" : ["LO", "BrachyAccessoryDeviceName"], - "026A" : ["DS", "BrachyAccessoryDeviceNominalThickness"], - "026C" : ["DS", "BrachyAccessoryDeviceNominalTransmission"], - "0280" : ["SQ", "ChannelSequence"], - "0282" : ["IS", "ChannelNumber"], - "0284" : ["DS", "ChannelLength"], - "0286" : ["DS", "ChannelTotalTime"], - "0288" : ["CS", "SourceMovementType"], - "028A" : ["IS", "NumberOfPulses"], - "028C" : ["DS", "PulseRepetitionInterval"], - "0290" : ["IS", "SourceApplicatorNumber"], - "0291" : ["SH", "SourceApplicatorID"], - "0292" : ["CS", "SourceApplicatorType"], - "0294" : ["LO", "SourceApplicatorName"], - "0296" : ["DS", "SourceApplicatorLength"], - "0298" : ["LO", "SourceApplicatorManufacturer"], - "029C" : ["DS", "SourceApplicatorWallNominalThickness"], - "029E" : ["DS", "SourceApplicatorWallNominalTransmission"], - "02A0" : ["DS", "SourceApplicatorStepSize"], - "02A2" : ["IS", "TransferTubeNumber"], - "02A4" : ["DS", "TransferTubeLength"], - "02B0" : ["SQ", "ChannelShieldSequence"], - "02B2" : ["IS", "ChannelShieldNumber"], - "02B3" : ["SH", "ChannelShieldID"], - "02B4" : ["LO", "ChannelShieldName"], - "02B8" : ["DS", "ChannelShieldNominalThickness"], - "02BA" : ["DS", "ChannelShieldNominalTransmission"], - "02C8" : ["DS", "FinalCumulativeTimeWeight"], - "02D0" : ["SQ", "BrachyControlPointSequence"], - "02D2" : ["DS", "ControlPointRelativePosition"], - "02D4" : ["DS", "ControlPoint3DPosition"], - "02D6" : ["DS", "CumulativeTimeWeight"], - "02E0" : ["CS", "CompensatorDivergence"], - "02E1" : ["CS", "CompensatorMountingPosition"], - "02E2" : ["DS", "SourceToCompensatorDistance"], - "02E3" : ["FL", "TotalCompensatorTrayWaterEquivalentThickness"], - "02E4" : ["FL", "IsocenterToCompensatorTrayDistance"], - "02E5" : ["FL", "CompensatorColumnOffset"], - "02E6" : ["FL", "IsocenterToCompensatorDistances"], - "02E7" : ["FL", "CompensatorRelativeStoppingPowerRatio"], - "02E8" : ["FL", "CompensatorMillingToolDiameter"], - "02EA" : ["SQ", "IonRangeCompensatorSequence"], - "02EB" : ["LT", "CompensatorDescription"], - "0302" : ["IS", "RadiationMassNumber"], - "0304" : ["IS", "RadiationAtomicNumber"], - "0306" : ["SS", "RadiationChargeState"], - "0308" : ["CS", "ScanMode"], - "030A" : ["FL", "VirtualSourceAxisDistances"], - "030C" : ["SQ", "SnoutSequence"], - "030D" : ["FL", "SnoutPosition"], - "030F" : ["SH", "SnoutID"], - "0312" : ["IS", "NumberOfRangeShifters"], - "0314" : ["SQ", "RangeShifterSequence"], - "0316" : ["IS", "RangeShifterNumber"], - "0318" : ["SH", "RangeShifterID"], - "0320" : ["CS", "RangeShifterType"], - "0322" : ["LO", "RangeShifterDescription"], - "0330" : ["IS", "NumberOfLateralSpreadingDevices"], - "0332" : ["SQ", "LateralSpreadingDeviceSequence"], - "0334" : ["IS", "LateralSpreadingDeviceNumber"], - "0336" : ["SH", "LateralSpreadingDeviceID"], - "0338" : ["CS", "LateralSpreadingDeviceType"], - "033A" : ["LO", "LateralSpreadingDeviceDescription"], - "033C" : ["FL", "LateralSpreadingDeviceWaterEquivalentThickness"], - "0340" : ["IS", "NumberOfRangeModulators"], - "0342" : ["SQ", "RangeModulatorSequence"], - "0344" : ["IS", "RangeModulatorNumber"], - "0346" : ["SH", "RangeModulatorID"], - "0348" : ["CS", "RangeModulatorType"], - "034A" : ["LO", "RangeModulatorDescription"], - "034C" : ["SH", "BeamCurrentModulationID"], - "0350" : ["CS", "PatientSupportType"], - "0352" : ["SH", "PatientSupportID"], - "0354" : ["LO", "PatientSupportAccessoryCode"], - "0356" : ["FL", "FixationLightAzimuthalAngle"], - "0358" : ["FL", "FixationLightPolarAngle"], - "035A" : ["FL", "MetersetRate"], - "0360" : ["SQ", "RangeShifterSettingsSequence"], - "0362" : ["LO", "RangeShifterSetting"], - "0364" : ["FL", "IsocenterToRangeShifterDistance"], - "0366" : ["FL", "RangeShifterWaterEquivalentThickness"], - "0370" : ["SQ", "LateralSpreadingDeviceSettingsSequence"], - "0372" : ["LO", "LateralSpreadingDeviceSetting"], - "0374" : ["FL", "IsocenterToLateralSpreadingDeviceDistance"], - "0380" : ["SQ", "RangeModulatorSettingsSequence"], - "0382" : ["FL", "RangeModulatorGatingStartValue"], - "0384" : ["FL", "RangeModulatorGatingStopValue"], - "0386" : ["FL", "RangeModulatorGatingStartWaterEquivalentThickness"], - "0388" : ["FL", "RangeModulatorGatingStopWaterEquivalentThickness"], - "038A" : ["FL", "IsocenterToRangeModulatorDistance"], - "0390" : ["SH", "ScanSpotTuneID"], - "0392" : ["IS", "NumberOfScanSpotPositions"], - "0394" : ["FL", "ScanSpotPositionMap"], - "0396" : ["FL", "ScanSpotMetersetWeights"], - "0398" : ["FL", "ScanningSpotSize"], - "039A" : ["IS", "NumberOfPaintings"], - "03A0" : ["SQ", "IonToleranceTableSequence"], - "03A2" : ["SQ", "IonBeamSequence"], - "03A4" : ["SQ", "IonBeamLimitingDeviceSequence"], - "03A6" : ["SQ", "IonBlockSequence"], - "03A8" : ["SQ", "IonControlPointSequence"], - "03AA" : ["SQ", "IonWedgeSequence"], - "03AC" : ["SQ", "IonWedgePositionSequence"], - "0401" : ["SQ", "ReferencedSetupImageSequence"], - "0402" : ["ST", "SetupImageComment"], - "0410" : ["SQ", "MotionSynchronizationSequence"], - "0412" : ["FL", "ControlPointOrientation"], - "0420" : ["SQ", "GeneralAccessorySequence"], - "0421" : ["SH", "GeneralAccessoryID"], - "0422" : ["ST", "GeneralAccessoryDescription"], - "0423" : ["CS", "GeneralAccessoryType"], - "0424" : ["IS", "GeneralAccessoryNumber"], - "0431" : ["SQ", "ApplicatorGeometrySequence"], - "0432" : ["CS", "ApplicatorApertureShape"], - "0433" : ["FL", "ApplicatorOpening"], - "0434" : ["FL", "ApplicatorOpeningX"], - "0435" : ["FL", "ApplicatorOpeningY"], - "0436" : ["FL", "SourceToApplicatorMountingPositionDistance"] - }, - "300C" : { - "0002" : ["SQ", "ReferencedRTPlanSequence"], - "0004" : ["SQ", "ReferencedBeamSequence"], - "0006" : ["IS", "ReferencedBeamNumber"], - "0007" : ["IS", "ReferencedReferenceImageNumber"], - "0008" : ["DS", "StartCumulativeMetersetWeight"], - "0009" : ["DS", "EndCumulativeMetersetWeight"], - "000A" : ["SQ", "ReferencedBrachyApplicationSetupSequence"], - "000C" : ["IS", "ReferencedBrachyApplicationSetupNumber"], - "000E" : ["IS", "ReferencedSourceNumber"], - "0020" : ["SQ", "ReferencedFractionGroupSequence"], - "0022" : ["IS", "ReferencedFractionGroupNumber"], - "0040" : ["SQ", "ReferencedVerificationImageSequence"], - "0042" : ["SQ", "ReferencedReferenceImageSequence"], - "0050" : ["SQ", "ReferencedDoseReferenceSequence"], - "0051" : ["IS", "ReferencedDoseReferenceNumber"], - "0055" : ["SQ", "BrachyReferencedDoseReferenceSequence"], - "0060" : ["SQ", "ReferencedStructureSetSequence"], - "006A" : ["IS", "ReferencedPatientSetupNumber"], - "0080" : ["SQ", "ReferencedDoseSequence"], - "00A0" : ["IS", "ReferencedToleranceTableNumber"], - "00B0" : ["SQ", "ReferencedBolusSequence"], - "00C0" : ["IS", "ReferencedWedgeNumber"], - "00D0" : ["IS", "ReferencedCompensatorNumber"], - "00E0" : ["IS", "ReferencedBlockNumber"], - "00F0" : ["IS", "ReferencedControlPointIndex"], - "00F2" : ["SQ", "ReferencedControlPointSequence"], - "00F4" : ["IS", "ReferencedStartControlPointIndex"], - "00F6" : ["IS", "ReferencedStopControlPointIndex"], - "0100" : ["IS", "ReferencedRangeShifterNumber"], - "0102" : ["IS", "ReferencedLateralSpreadingDeviceNumber"], - "0104" : ["IS", "ReferencedRangeModulatorNumber"] - }, - "300E" : { - "0002" : ["CS", "ApprovalStatus"], - "0004" : ["DA", "ReviewDate"], - "0005" : ["TM", "ReviewTime"], - "0008" : ["PN", "ReviewerName"] - }, - "4000" : { - "0010" : ["LT", "Arbitrary"], - "4000" : ["LT", "TextComments"] - }, - "4008" : { - "0040" : ["SH", "ResultsID"], - "0042" : ["LO", "ResultsIDIssuer"], - "0050" : ["SQ", "ReferencedInterpretationSequence"], - "00FF" : ["CS", "ReportProductionStatusTrial"], - "0100" : ["DA", "InterpretationRecordedDate"], - "0101" : ["TM", "InterpretationRecordedTime"], - "0102" : ["PN", "InterpretationRecorder"], - "0103" : ["LO", "ReferenceToRecordedSound"], - "0108" : ["DA", "InterpretationTranscriptionDate"], - "0109" : ["TM", "InterpretationTranscriptionTime"], - "010A" : ["PN", "InterpretationTranscriber"], - "010B" : ["ST", "InterpretationText"], - "010C" : ["PN", "InterpretationAuthor"], - "0111" : ["SQ", "InterpretationApproverSequence"], - "0112" : ["DA", "InterpretationApprovalDate"], - "0113" : ["TM", "InterpretationApprovalTime"], - "0114" : ["PN", "PhysicianApprovingInterpretation"], - "0115" : ["LT", "InterpretationDiagnosisDescription"], - "0117" : ["SQ", "InterpretationDiagnosisCodeSequence"], - "0118" : ["SQ", "ResultsDistributionListSequence"], - "0119" : ["PN", "DistributionName"], - "011A" : ["LO", "DistributionAddress"], - "0200" : ["SH", "InterpretationID"], - "0202" : ["LO", "InterpretationIDIssuer"], - "0210" : ["CS", "InterpretationTypeID"], - "0212" : ["CS", "InterpretationStatusID"], - "0300" : ["ST", "Impressions"], - "4000" : ["ST", "ResultsComments"] - }, - "4010" : { - "0001" : ["CS", "LowEnergyDetectors"], - "0002" : ["CS", "HighEnergyDetectors"], - "0004" : ["SQ", "DetectorGeometrySequence"], - "1001" : ["SQ", "ThreatROIVoxelSequence"], - "1004" : ["FL", "ThreatROIBase"], - "1005" : ["FL", "ThreatROIExtents"], - "1006" : ["OB", "ThreatROIBitmap"], - "1007" : ["SH", "RouteSegmentID"], - "1008" : ["CS", "GantryType"], - "1009" : ["CS", "OOIOwnerType"], - "100A" : ["SQ", "RouteSegmentSequence"], - "1010" : ["US", "PotentialThreatObjectID"], - "1011" : ["SQ", "ThreatSequence"], - "1012" : ["CS", "ThreatCategory"], - "1013" : ["LT", "ThreatCategoryDescription"], - "1014" : ["CS", "ATDAbilityAssessment"], - "1015" : ["CS", "ATDAssessmentFlag"], - "1016" : ["FL", "ATDAssessmentProbability"], - "1017" : ["FL", "Mass"], - "1018" : ["FL", "Density"], - "1019" : ["FL", "ZEffective"], - "101A" : ["SH", "BoardingPassID"], - "101B" : ["FL", "CenterOfMass"], - "101C" : ["FL", "CenterOfPTO"], - "101D" : ["FL", "BoundingPolygon"], - "101E" : ["SH", "RouteSegmentStartLocationID"], - "101F" : ["SH", "RouteSegmentEndLocationID"], - "1020" : ["CS", "RouteSegmentLocationIDType"], - "1021" : ["CS", "AbortReason"], - "1023" : ["FL", "VolumeOfPTO"], - "1024" : ["CS", "AbortFlag"], - "1025" : ["DT", "RouteSegmentStartTime"], - "1026" : ["DT", "RouteSegmentEndTime"], - "1027" : ["CS", "TDRType"], - "1028" : ["CS", "InternationalRouteSegment"], - "1029" : ["LO", "ThreatDetectionAlgorithmandVersion"], - "102A" : ["SH", "AssignedLocation"], - "102B" : ["DT", "AlarmDecisionTime"], - "1031" : ["CS", "AlarmDecision"], - "1033" : ["US", "NumberOfTotalObjects"], - "1034" : ["US", "NumberOfAlarmObjects"], - "1037" : ["SQ", "PTORepresentationSequence"], - "1038" : ["SQ", "ATDAssessmentSequence"], - "1039" : ["CS", "TIPType"], - "103A" : ["CS", "DICOSVersion"], - "1041" : ["DT", "OOIOwnerCreationTime"], - "1042" : ["CS", "OOIType"], - "1043" : ["FL", "OOISize"], - "1044" : ["CS", "AcquisitionStatus"], - "1045" : ["SQ", "BasisMaterialsCodeSequence"], - "1046" : ["CS", "PhantomType"], - "1047" : ["SQ", "OOIOwnerSequence"], - "1048" : ["CS", "ScanType"], - "1051" : ["LO", "ItineraryID"], - "1052" : ["SH", "ItineraryIDType"], - "1053" : ["LO", "ItineraryIDAssigningAuthority"], - "1054" : ["SH", "RouteID"], - "1055" : ["SH", "RouteIDAssigningAuthority"], - "1056" : ["CS", "InboundArrivalType"], - "1058" : ["SH", "CarrierID"], - "1059" : ["CS", "CarrierIDAssigningAuthority"], - "1060" : ["FL", "SourceOrientation"], - "1061" : ["FL", "SourcePosition"], - "1062" : ["FL", "BeltHeight"], - "1064" : ["SQ", "AlgorithmRoutingCodeSequence"], - "1067" : ["CS", "TransportClassification"], - "1068" : ["LT", "OOITypeDescriptor"], - "1069" : ["FL", "TotalProcessingTime"], - "106C" : ["OB", "DetectorCalibrationData"] - } -}; +import { dec2hex } from './utilities.js' +export const dictPrivate = { + '0207': { + '101F': ['FE', 'ElscintDataScale'] // uses special Elscint double type (see Tag class) + } +} +export const dict = { + '0002': { + '0001': ['OB', 'FileMetaInformationVersion'], + '0002': ['UI', 'MediaStoredSOPClassUID'], + '0003': ['UI', 'MediaStoredSOPInstanceUID'], + '0010': ['UI', 'TransferSyntaxUID'], + '0012': ['UI', 'ImplementationClassUID'], + '0013': ['SH', 'ImplementationVersionName'], + '0016': ['AE', 'SourceApplicationEntityTitle'], + '0100': ['UI', 'PrivateInformationCreatorUID'], + '0102': ['OB', 'PrivateInformation'] + }, + '0004': { + 1130: ['CS', 'FilesetID'], + 1141: ['CS', 'FilesetDescriptorFileFileID'], + 1142: ['CS', 'FilesetDescriptorFileFormat'], + 1200: ['UL', 'RootDirectoryEntitysFirstDirectoryRecordOffset'], + 1202: ['UL', 'RootDirectoryEntitysLastDirectoryRecordOffset'], + 1212: ['US', 'File-setConsistenceFlag'], + 1220: ['SQ', 'DirectoryRecordSequence'], + 1400: ['UL', 'NextDirectoryRecordOffset'], + 1410: ['US', 'RecordInuseFlag'], + 1420: ['UL', 'ReferencedLowerlevelDirectoryEntityOffset'], + 1430: ['CS', 'DirectoryRecordType'], + 1432: ['UI', 'PrivateRecordUID'], + 1500: ['CS', 'ReferencedFileID'], + 1510: ['UI', 'ReferencedSOPClassUIDInFile'], + 1511: ['UI', 'ReferencedSOPInstanceUIDInFile'], + 1600: ['UL', 'NumberOfReferences'] + }, + '0008': { + '0001': ['UL', 'LengthToEnd'], + '0005': ['CS', 'SpecificCharacterSet'], + '0006': ['SQ', 'LanguageCodeSequence'], + '0008': ['CS', 'ImageType'], + '0010': ['SH', 'RecognitionCode'], + '0012': ['DA', 'InstanceCreationDate'], + '0013': ['TM', 'InstanceCreationTime'], + '0014': ['UI', 'InstanceCreatorUID'], + '0016': ['UI', 'SOPClassUID'], + '0018': ['UI', 'SOPInstanceUID'], + '001A': ['UI', 'RelatedGeneralSOPClassUID'], + '001B': ['UI', 'OriginalSpecializedSOPClassUID'], + '0020': ['DA', 'StudyDate'], + '0021': ['DA', 'SeriesDate'], + '0022': ['DA', 'AcquisitionDate'], + '0023': ['DA', 'ContentDate'], + '0024': ['DA', 'OverlayDate'], + '0025': ['DA', 'CurveDate'], + '002A': ['DT', 'AcquisitionDateTime'], + '0030': ['TM', 'StudyTime'], + '0031': ['TM', 'SeriesTime'], + '0032': ['TM', 'AcquisitionTime'], + '0033': ['TM', 'ContentTime'], + '0034': ['TM', 'OverlayTime'], + '0035': ['TM', 'CurveTime'], + '0040': ['US', 'DataSetType'], + '0041': ['LO', 'DataSetSubtype'], + '0042': ['CS', 'NuclearMedicineSeriesType'], + '0050': ['SH', 'AccessionNumber'], + '0051': ['SQ', 'IssuerOfAccessionNumberSequence'], + '0052': ['CS', 'QueryRetrieveLevel'], + '0054': ['AE', 'RetrieveAETitle'], + '0056': ['CS', 'InstanceAvailability'], + '0058': ['UI', 'FailedSOPInstanceUIDList'], + '0060': ['CS', 'Modality'], + '0061': ['CS', 'ModalitiesInStudy'], + '0062': ['UI', 'SOPClassesInStudy'], + '0064': ['CS', 'ConversionType'], + '0068': ['CS', 'PresentationIntentType'], + '0070': ['LO', 'Manufacturer'], + '0080': ['LO', 'InstitutionName'], + '0081': ['ST', 'InstitutionAddress'], + '0082': ['SQ', 'InstitutionCodeSequence'], + '0090': ['PN', 'ReferringPhysicianName'], + '0092': ['ST', 'ReferringPhysicianAddress'], + '0094': ['SH', 'ReferringPhysicianTelephoneNumbers'], + '0096': ['SQ', 'ReferringPhysicianIdentificationSequence'], + '0100': ['SH', 'CodeValue'], + '0102': ['SH', 'CodingSchemeDesignator'], + '0103': ['SH', 'CodingSchemeVersion'], + '0104': ['LO', 'CodeMeaning'], + '0105': ['CS', 'MappingResource'], + '0106': ['DT', 'ContextGroupVersion'], + '0107': ['DT', 'ContextGroupLocalVersion'], + '010B': ['CS', 'ContextGroupExtensionFlag'], + '010C': ['UI', 'CodingSchemeUID'], + '010D': ['UI', 'ContextGroupExtensionCreatorUID'], + '010F': ['CS', 'ContextIdentifier'], + '0110': ['SQ', 'CodingSchemeIdentificationSequence'], + '0112': ['LO', 'CodingSchemeRegistry'], + '0114': ['ST', 'CodingSchemeExternalID'], + '0115': ['ST', 'CodingSchemeName'], + '0116': ['ST', 'CodingSchemeResponsibleOrganization'], + '0117': ['UI', 'ContextUID'], + '0201': ['SH', 'TimezoneOffsetFromUTC'], + 1000: ['AE', 'NetworkID'], + 1010: ['SH', 'StationName'], + 1030: ['LO', 'StudyDescription'], + 1032: ['SQ', 'ProcedureCodeSequence'], + '103E': ['LO', 'SeriesDescription'], + '103F': ['SQ', 'SeriesDescriptionCodeSequence'], + 1040: ['LO', 'InstitutionalDepartmentName'], + 1048: ['PN', 'PhysiciansOfRecord'], + 1049: ['SQ', 'PhysiciansOfRecordIdentificationSequence'], + 1050: ['PN', 'PerformingPhysicianName'], + 1052: ['SQ', 'PerformingPhysicianIdentificationSequence'], + 1060: ['PN', 'NameOfPhysiciansReadingStudy'], + 1062: ['SQ', 'PhysiciansReadingStudyIdentificationSequence'], + 1070: ['PN', 'OperatorsName'], + 1072: ['SQ', 'OperatorIdentificationSequence'], + 1080: ['LO', 'AdmittingDiagnosesDescription'], + 1084: ['SQ', 'AdmittingDiagnosesCodeSequence'], + 1090: ['LO', 'ManufacturerModelName'], + 1100: ['SQ', 'ReferencedResultsSequence'], + 1110: ['SQ', 'ReferencedStudySequence'], + 1111: ['SQ', 'ReferencedPerformedProcedureStepSequence'], + 1115: ['SQ', 'ReferencedSeriesSequence'], + 1120: ['SQ', 'ReferencedPatientSequence'], + 1125: ['SQ', 'ReferencedVisitSequence'], + 1130: ['SQ', 'ReferencedOverlaySequence'], + 1134: ['SQ', 'ReferencedStereometricInstanceSequence'], + '113A': ['SQ', 'ReferencedWaveformSequence'], + 1140: ['SQ', 'ReferencedImageSequence'], + 1145: ['SQ', 'ReferencedCurveSequence'], + '114A': ['SQ', 'ReferencedInstanceSequence'], + '114B': ['SQ', 'ReferencedRealWorldValueMappingInstanceSequence'], + 1150: ['UI', 'ReferencedSOPClassUID'], + 1155: ['UI', 'ReferencedSOPInstanceUID'], + '115A': ['UI', 'SOPClassesSupported'], + 1160: ['IS', 'ReferencedFrameNumber'], + 1161: ['UL', 'SimpleFrameList'], + 1162: ['UL', 'CalculatedFrameList'], + 1163: ['FD', 'TimeRange'], + 1164: ['SQ', 'FrameExtractionSequence'], + 1167: ['UI', 'MultiFrameSourceSOPInstanceUID'], + 1195: ['UI', 'TransactionUID'], + 1197: ['US', 'FailureReason'], + 1198: ['SQ', 'FailedSOPSequence'], + 1199: ['SQ', 'ReferencedSOPSequence'], + 1200: ['SQ', 'StudiesContainingOtherReferencedInstancesSequence'], + 1250: ['SQ', 'RelatedSeriesSequence'], + 2110: ['CS', 'LossyImageCompressionRetired'], + 2111: ['ST', 'DerivationDescription'], + 2112: ['SQ', 'SourceImageSequence'], + 2120: ['SH', 'StageName'], + 2122: ['IS', 'StageNumber'], + 2124: ['IS', 'NumberOfStages'], + 2127: ['SH', 'ViewName'], + 2128: ['IS', 'ViewNumber'], + 2129: ['IS', 'NumberOfEventTimers'], + '212A': ['IS', 'NumberOfViewsInStage'], + 2130: ['DS', 'EventElapsedTimes'], + 2132: ['LO', 'EventTimerNames'], + 2133: ['SQ', 'EventTimerSequence'], + 2134: ['FD', 'EventTimeOffset'], + 2135: ['SQ', 'EventCodeSequence'], + 2142: ['IS', 'StartTrim'], + 2143: ['IS', 'StopTrim'], + 2144: ['IS', 'RecommendedDisplayFrameRate'], + 2200: ['CS', 'TransducerPosition'], + 2204: ['CS', 'TransducerOrientation'], + 2208: ['CS', 'AnatomicStructure'], + 2218: ['SQ', 'AnatomicRegionSequence'], + 2220: ['SQ', 'AnatomicRegionModifierSequence'], + 2228: ['SQ', 'PrimaryAnatomicStructureSequence'], + 2229: ['SQ', 'AnatomicStructureSpaceOrRegionSequence'], + 2230: ['SQ', 'PrimaryAnatomicStructureModifierSequence'], + 2240: ['SQ', 'TransducerPositionSequence'], + 2242: ['SQ', 'TransducerPositionModifierSequence'], + 2244: ['SQ', 'TransducerOrientationSequence'], + 2246: ['SQ', 'TransducerOrientationModifierSequence'], + 2251: ['SQ', 'AnatomicStructureSpaceOrRegionCodeSequenceTrial'], + 2253: ['SQ', 'AnatomicPortalOfEntranceCodeSequenceTrial'], + 2255: ['SQ', 'AnatomicApproachDirectionCodeSequenceTrial'], + 2256: ['ST', 'AnatomicPerspectiveDescriptionTrial'], + 2257: ['SQ', 'AnatomicPerspectiveCodeSequenceTrial'], + 2258: ['ST', 'AnatomicLocationOfExaminingInstrumentDescriptionTrial'], + 2259: ['SQ', 'AnatomicLocationOfExaminingInstrumentCodeSequenceTrial'], + '225A': ['SQ', 'AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial'], + '225C': ['SQ', 'OnAxisBackgroundAnatomicStructureCodeSequenceTrial'], + 3001: ['SQ', 'AlternateRepresentationSequence'], + 3010: ['UI', 'IrradiationEventUID'], + 4000: ['LT', 'IdentifyingComments'], + 9007: ['CS', 'FrameType'], + 9092: ['SQ', 'ReferencedImageEvidenceSequence'], + 9121: ['SQ', 'ReferencedRawDataSequence'], + 9123: ['UI', 'CreatorVersionUID'], + 9124: ['SQ', 'DerivationImageSequence'], + 9154: ['SQ', 'SourceImageEvidenceSequence'], + 9205: ['CS', 'PixelPresentation'], + 9206: ['CS', 'VolumetricProperties'], + 9207: ['CS', 'VolumeBasedCalculationTechnique'], + 9208: ['CS', 'ComplexImageComponent'], + 9209: ['CS', 'AcquisitionContrast'], + 9215: ['SQ', 'DerivationCodeSequence'], + 9237: ['SQ', 'ReferencedPresentationStateSequence'], + 9410: ['SQ', 'ReferencedOtherPlaneSequence'], + 9458: ['SQ', 'FrameDisplaySequence'], + 9459: ['FL', 'RecommendedDisplayFrameRateInFloat'], + 9460: ['CS', 'SkipFrameRangeFlag'] + }, + '0010': { + '0010': ['PN', 'PatientName'], + '0020': ['LO', 'PatientID'], + '0021': ['LO', 'IssuerOfPatientID'], + '0022': ['CS', 'TypeOfPatientID'], + '0024': ['SQ', 'IssuerOfPatientIDQualifiersSequence'], + '0030': ['DA', 'PatientBirthDate'], + '0032': ['TM', 'PatientBirthTime'], + '0040': ['CS', 'PatientSex'], + '0050': ['SQ', 'PatientInsurancePlanCodeSequence'], + '0101': ['SQ', 'PatientPrimaryLanguageCodeSequence'], + '0102': ['SQ', 'PatientPrimaryLanguageModifierCodeSequence'], + 1000: ['LO', 'OtherPatientIDs'], + 1001: ['PN', 'OtherPatientNames'], + 1002: ['SQ', 'OtherPatientIDsSequence'], + 1005: ['PN', 'PatientBirthName'], + 1010: ['AS', 'PatientAge'], + 1020: ['DS', 'PatientSize'], + 1021: ['SQ', 'PatientSizeCodeSequence'], + 1030: ['DS', 'PatientWeight'], + 1040: ['LO', 'PatientAddress'], + 1050: ['LO', 'InsurancePlanIdentification'], + 1060: ['PN', 'PatientMotherBirthName'], + 1080: ['LO', 'MilitaryRank'], + 1081: ['LO', 'BranchOfService'], + 1090: ['LO', 'MedicalRecordLocator'], + 2000: ['LO', 'MedicalAlerts'], + 2110: ['LO', 'Allergies'], + 2150: ['LO', 'CountryOfResidence'], + 2152: ['LO', 'RegionOfResidence'], + 2154: ['SH', 'PatientTelephoneNumbers'], + 2160: ['SH', 'EthnicGroup'], + 2180: ['SH', 'Occupation'], + '21A0': ['CS', 'SmokingStatus'], + '21B0': ['LT', 'AdditionalPatientHistory'], + '21C0': ['US', 'PregnancyStatus'], + '21D0': ['DA', 'LastMenstrualDate'], + '21F0': ['LO', 'PatientReligiousPreference'], + 2201: ['LO', 'PatientSpeciesDescription'], + 2202: ['SQ', 'PatientSpeciesCodeSequence'], + 2203: ['CS', 'PatientSexNeutered'], + 2210: ['CS', 'AnatomicalOrientationType'], + 2292: ['LO', 'PatientBreedDescription'], + 2293: ['SQ', 'PatientBreedCodeSequence'], + 2294: ['SQ', 'BreedRegistrationSequence'], + 2295: ['LO', 'BreedRegistrationNumber'], + 2296: ['SQ', 'BreedRegistryCodeSequence'], + 2297: ['PN', 'ResponsiblePerson'], + 2298: ['CS', 'ResponsiblePersonRole'], + 2299: ['LO', 'ResponsibleOrganization'], + 4000: ['LT', 'PatientComments'], + 9431: ['FL', 'ExaminedBodyThickness'] + }, + '0012': { + '0010': ['LO', 'ClinicalTrialSponsorName'], + '0020': ['LO', 'ClinicalTrialProtocolID'], + '0021': ['LO', 'ClinicalTrialProtocolName'], + '0030': ['LO', 'ClinicalTrialSiteID'], + '0031': ['LO', 'ClinicalTrialSiteName'], + '0040': ['LO', 'ClinicalTrialSubjectID'], + '0042': ['LO', 'ClinicalTrialSubjectReadingID'], + '0050': ['LO', 'ClinicalTrialTimePointID'], + '0051': ['ST', 'ClinicalTrialTimePointDescription'], + '0060': ['LO', 'ClinicalTrialCoordinatingCenterName'], + '0062': ['CS', 'PatientIdentityRemoved'], + '0063': ['LO', 'DeidentificationMethod'], + '0064': ['SQ', 'DeidentificationMethodCodeSequence'], + '0071': ['LO', 'ClinicalTrialSeriesID'], + '0072': ['LO', 'ClinicalTrialSeriesDescription'], + '0081': ['LO', 'ClinicalTrialProtocolEthicsCommitteeName'], + '0082': ['LO', 'ClinicalTrialProtocolEthicsCommitteeApprovalNumber'], + '0083': ['SQ', 'ConsentForClinicalTrialUseSequence'], + '0084': ['CS', 'DistributionType'], + '0085': ['CS', 'ConsentForDistributionFlag'] + }, + '0014': { + '0023': ['ST', 'CADFileFormat'], + '0024': ['ST', 'ComponentReferenceSystem'], + '0025': ['ST', 'ComponentManufacturingProcedure'], + '0028': ['ST', 'ComponentManufacturer'], + '0030': ['DS', 'MaterialThickness'], + '0032': ['DS', 'MaterialPipeDiameter'], + '0034': ['DS', 'MaterialIsolationDiameter'], + '0042': ['ST', 'MaterialGrade'], + '0044': ['ST', 'MaterialPropertiesFileID'], + '0045': ['ST', 'MaterialPropertiesFileFormat'], + '0046': ['LT', 'MaterialNotes'], + '0050': ['CS', 'ComponentShape'], + '0052': ['CS', 'CurvatureType'], + '0054': ['DS', 'OuterDiameter'], + '0056': ['DS', 'InnerDiameter'], + 1010: ['ST', 'ActualEnvironmentalConditions'], + 1020: ['DA', 'ExpiryDate'], + 1040: ['ST', 'EnvironmentalConditions'], + 2002: ['SQ', 'EvaluatorSequence'], + 2004: ['IS', 'EvaluatorNumber'], + 2006: ['PN', 'EvaluatorName'], + 2008: ['IS', 'EvaluationAttempt'], + 2012: ['SQ', 'IndicationSequence'], + 2014: ['IS', 'IndicationNumber '], + 2016: ['SH', 'IndicationLabel'], + 2018: ['ST', 'IndicationDescription'], + '201A': ['CS', 'IndicationType'], + '201C': ['CS', 'IndicationDisposition'], + '201E': ['SQ', 'IndicationROISequence'], + 2030: ['SQ', 'IndicationPhysicalPropertySequence'], + 2032: ['SH', 'PropertyLabel'], + 2202: ['IS', 'CoordinateSystemNumberOfAxes '], + 2204: ['SQ', 'CoordinateSystemAxesSequence'], + 2206: ['ST', 'CoordinateSystemAxisDescription'], + 2208: ['CS', 'CoordinateSystemDataSetMapping'], + '220A': ['IS', 'CoordinateSystemAxisNumber'], + '220C': ['CS', 'CoordinateSystemAxisType'], + '220E': ['CS', 'CoordinateSystemAxisUnits'], + 2210: ['OB', 'CoordinateSystemAxisValues'], + 2220: ['SQ', 'CoordinateSystemTransformSequence'], + 2222: ['ST', 'TransformDescription'], + 2224: ['IS', 'TransformNumberOfAxes'], + 2226: ['IS', 'TransformOrderOfAxes'], + 2228: ['CS', 'TransformedAxisUnits'], + '222A': ['DS', 'CoordinateSystemTransformRotationAndScaleMatrix'], + '222C': ['DS', 'CoordinateSystemTransformTranslationMatrix'], + 3011: ['DS', 'InternalDetectorFrameTime'], + 3012: ['DS', 'NumberOfFramesIntegrated'], + 3020: ['SQ', 'DetectorTemperatureSequence'], + 3022: ['DS', 'SensorName'], + 3024: ['DS', 'HorizontalOffsetOfSensor'], + 3026: ['DS', 'VerticalOffsetOfSensor'], + 3028: ['DS', 'SensorTemperature'], + 3040: ['SQ', 'DarkCurrentSequence'], + 3050: ['OB', 'DarkCurrentCounts'], + 3060: ['SQ', 'GainCorrectionReferenceSequence'], + 3070: ['OB', 'AirCounts'], + 3071: ['DS', 'KVUsedInGainCalibration'], + 3072: ['DS', 'MAUsedInGainCalibration'], + 3073: ['DS', 'NumberOfFramesUsedForIntegration'], + 3074: ['LO', 'FilterMaterialUsedInGainCalibration'], + 3075: ['DS', 'FilterThicknessUsedInGainCalibration'], + 3076: ['DA', 'DateOfGainCalibration'], + 3077: ['TM', 'TimeOfGainCalibration'], + 3080: ['OB', 'BadPixelImage'], + 3099: ['LT', 'CalibrationNotes'], + 4002: ['SQ', 'PulserEquipmentSequence'], + 4004: ['CS', 'PulserType'], + 4006: ['LT', 'PulserNotes'], + 4008: ['SQ', 'ReceiverEquipmentSequence'], + '400A': ['CS', 'AmplifierType'], + '400C': ['LT', 'ReceiverNotes'], + '400E': ['SQ', 'PreAmplifierEquipmentSequence'], + '400F': ['LT', 'PreAmplifierNotes'], + 4010: ['SQ', 'TransmitTransducerSequence'], + 4011: ['SQ', 'ReceiveTransducerSequence'], + 4012: ['US', 'NumberOfElements'], + 4013: ['CS', 'ElementShape'], + 4014: ['DS', 'ElementDimensionA'], + 4015: ['DS', 'ElementDimensionB'], + 4016: ['DS', 'ElementPitch'], + 4017: ['DS', 'MeasuredBeamDimensionA'], + 4018: ['DS', 'MeasuredBeamDimensionB'], + 4019: ['DS', 'LocationOfMeasuredBeamDiameter'], + '401A': ['DS', 'NominalFrequency'], + '401B': ['DS', 'MeasuredCenterFrequency'], + '401C': ['DS', 'MeasuredBandwidth'], + 4020: ['SQ', 'PulserSettingsSequence'], + 4022: ['DS', 'PulseWidth'], + 4024: ['DS', 'ExcitationFrequency'], + 4026: ['CS', 'ModulationType'], + 4028: ['DS', 'Damping'], + 4030: ['SQ', 'ReceiverSettingsSequence'], + 4031: ['DS', 'AcquiredSoundpathLength'], + 4032: ['CS', 'AcquisitionCompressionType'], + 4033: ['IS', 'AcquisitionSampleSize'], + 4034: ['DS', 'RectifierSmoothing'], + 4035: ['SQ', 'DACSequence'], + 4036: ['CS', 'DACType'], + 4038: ['DS', 'DACGainPoints'], + '403A': ['DS', 'DACTimePoints'], + '403C': ['DS', 'DACAmplitude'], + 4040: ['SQ', 'PreAmplifierSettingsSequence'], + 4050: ['SQ', 'TransmitTransducerSettingsSequence'], + 4051: ['SQ', 'ReceiveTransducerSettingsSequence'], + 4052: ['DS', 'IncidentAngle'], + 4054: ['ST', 'CouplingTechnique'], + 4056: ['ST', 'CouplingMedium'], + 4057: ['DS', 'CouplingVelocity'], + 4058: ['DS', 'CrystalCenterLocationX'], + 4059: ['DS', 'CrystalCenterLocationZ'], + '405A': ['DS', 'SoundPathLength'], + '405C': ['ST', 'DelayLawIdentifier'], + 4060: ['SQ', 'GateSettingsSequence'], + 4062: ['DS', 'GateThreshold'], + 4064: ['DS', 'VelocityOfSound'], + 4070: ['SQ', 'CalibrationSettingsSequence'], + 4072: ['ST', 'CalibrationProcedure'], + 4074: ['SH', 'ProcedureVersion'], + 4076: ['DA', 'ProcedureCreationDate'], + 4078: ['DA', 'ProcedureExpirationDate'], + '407A': ['DA', 'ProcedureLastModifiedDate'], + '407C': ['TM', 'CalibrationTime'], + '407E': ['DA', 'CalibrationDate'], + 5002: ['IS', 'LINACEnergy'], + 5004: ['IS', 'LINACOutput'] + }, + '0018': { + '0010': ['LO', 'ContrastBolusAgent'], + '0012': ['SQ', 'ContrastBolusAgentSequence'], + '0014': ['SQ', 'ContrastBolusAdministrationRouteSequence'], + '0015': ['CS', 'BodyPartExamined'], + '0020': ['CS', 'ScanningSequence'], + '0021': ['CS', 'SequenceVariant'], + '0022': ['CS', 'ScanOptions'], + '0023': ['CS', 'MRAcquisitionType'], + '0024': ['SH', 'SequenceName'], + '0025': ['CS', 'AngioFlag'], + '0026': ['SQ', 'InterventionDrugInformationSequence'], + '0027': ['TM', 'InterventionDrugStopTime'], + '0028': ['DS', 'InterventionDrugDose'], + '0029': ['SQ', 'InterventionDrugCodeSequence'], + '002A': ['SQ', 'AdditionalDrugSequence'], + '0030': ['LO', 'Radionuclide'], + '0031': ['LO', 'Radiopharmaceutical'], + '0032': ['DS', 'EnergyWindowCenterline'], + '0033': ['DS', 'EnergyWindowTotalWidth'], + '0034': ['LO', 'InterventionDrugName'], + '0035': ['TM', 'InterventionDrugStartTime'], + '0036': ['SQ', 'InterventionSequence'], + '0037': ['CS', 'TherapyType'], + '0038': ['CS', 'InterventionStatus'], + '0039': ['CS', 'TherapyDescription'], + '003A': ['ST', 'InterventionDescription'], + '0040': ['IS', 'CineRate'], + '0042': ['CS', 'InitialCineRunState'], + '0050': ['DS', 'SliceThickness'], + '0060': ['DS', 'KVP'], + '0070': ['IS', 'CountsAccumulated'], + '0071': ['CS', 'AcquisitionTerminationCondition'], + '0072': ['DS', 'EffectiveDuration'], + '0073': ['CS', 'AcquisitionStartCondition'], + '0074': ['IS', 'AcquisitionStartConditionData'], + '0075': ['IS', 'AcquisitionTerminationConditionData'], + '0080': ['DS', 'RepetitionTime'], + '0081': ['DS', 'EchoTime'], + '0082': ['DS', 'InversionTime'], + '0083': ['DS', 'NumberOfAverages'], + '0084': ['DS', 'ImagingFrequency'], + '0085': ['SH', 'ImagedNucleus'], + '0086': ['IS', 'EchoNumbers'], + '0087': ['DS', 'MagneticFieldStrength'], + '0088': ['DS', 'SpacingBetweenSlices'], + '0089': ['IS', 'NumberOfPhaseEncodingSteps'], + '0090': ['DS', 'DataCollectionDiameter'], + '0091': ['IS', 'EchoTrainLength'], + '0093': ['DS', 'PercentSampling'], + '0094': ['DS', 'PercentPhaseFieldOfView'], + '0095': ['DS', 'PixelBandwidth'], + 1000: ['LO', 'DeviceSerialNumber'], + 1002: ['UI', 'DeviceUID'], + 1003: ['LO', 'DeviceID'], + 1004: ['LO', 'PlateID'], + 1005: ['LO', 'GeneratorID'], + 1006: ['LO', 'GridID'], + 1007: ['LO', 'CassetteID'], + 1008: ['LO', 'GantryID'], + 1010: ['LO', 'SecondaryCaptureDeviceID'], + 1011: ['LO', 'HardcopyCreationDeviceID'], + 1012: ['DA', 'DateOfSecondaryCapture'], + 1014: ['TM', 'TimeOfSecondaryCapture'], + 1016: ['LO', 'SecondaryCaptureDeviceManufacturer'], + 1017: ['LO', 'HardcopyDeviceManufacturer'], + 1018: ['LO', 'SecondaryCaptureDeviceManufacturerModelName'], + 1019: ['LO', 'SecondaryCaptureDeviceSoftwareVersions'], + '101A': ['LO', 'HardcopyDeviceSoftwareVersion'], + '101B': ['LO', 'HardcopyDeviceManufacturerModelName'], + 1020: ['LO', 'SoftwareVersions'], + 1022: ['SH', 'VideoImageFormatAcquired'], + 1023: ['LO', 'DigitalImageFormatAcquired'], + 1030: ['LO', 'ProtocolName'], + 1040: ['LO', 'ContrastBolusRoute'], + 1041: ['DS', 'ContrastBolusVolume'], + 1042: ['TM', 'ContrastBolusStartTime'], + 1043: ['TM', 'ContrastBolusStopTime'], + 1044: ['DS', 'ContrastBolusTotalDose'], + 1045: ['IS', 'SyringeCounts'], + 1046: ['DS', 'ContrastFlowRate'], + 1047: ['DS', 'ContrastFlowDuration'], + 1048: ['CS', 'ContrastBolusIngredient'], + 1049: ['DS', 'ContrastBolusIngredientConcentration'], + 1050: ['DS', 'SpatialResolution'], + 1060: ['DS', 'TriggerTime'], + 1061: ['LO', 'TriggerSourceOrType'], + 1062: ['IS', 'NominalInterval'], + 1063: ['DS', 'FrameTime'], + 1064: ['LO', 'CardiacFramingType'], + 1065: ['DS', 'FrameTimeVector'], + 1066: ['DS', 'FrameDelay'], + 1067: ['DS', 'ImageTriggerDelay'], + 1068: ['DS', 'MultiplexGroupTimeOffset'], + 1069: ['DS', 'TriggerTimeOffset'], + '106A': ['CS', 'SynchronizationTrigger'], + '106C': ['US', 'SynchronizationChannel'], + '106E': ['UL', 'TriggerSamplePosition'], + 1070: ['LO', 'RadiopharmaceuticalRoute'], + 1071: ['DS', 'RadiopharmaceuticalVolume'], + 1072: ['TM', 'RadiopharmaceuticalStartTime'], + 1073: ['TM', 'RadiopharmaceuticalStopTime'], + 1074: ['DS', 'RadionuclideTotalDose'], + 1075: ['DS', 'RadionuclideHalfLife'], + 1076: ['DS', 'RadionuclidePositronFraction'], + 1077: ['DS', 'RadiopharmaceuticalSpecificActivity'], + 1078: ['DT', 'RadiopharmaceuticalStartDateTime'], + 1079: ['DT', 'RadiopharmaceuticalStopDateTime'], + 1080: ['CS', 'BeatRejectionFlag'], + 1081: ['IS', 'LowRRValue'], + 1082: ['IS', 'HighRRValue'], + 1083: ['IS', 'IntervalsAcquired'], + 1084: ['IS', 'IntervalsRejected'], + 1085: ['LO', 'PVCRejection'], + 1086: ['IS', 'SkipBeats'], + 1088: ['IS', 'HeartRate'], + 1090: ['IS', 'CardiacNumberOfImages'], + 1094: ['IS', 'TriggerWindow'], + 1100: ['DS', 'ReconstructionDiameter'], + 1110: ['DS', 'DistanceSourceToDetector'], + 1111: ['DS', 'DistanceSourceToPatient'], + 1114: ['DS', 'EstimatedRadiographicMagnificationFactor'], + 1120: ['DS', 'GantryDetectorTilt'], + 1121: ['DS', 'GantryDetectorSlew'], + 1130: ['DS', 'TableHeight'], + 1131: ['DS', 'TableTraverse'], + 1134: ['CS', 'TableMotion'], + 1135: ['DS', 'TableVerticalIncrement'], + 1136: ['DS', 'TableLateralIncrement'], + 1137: ['DS', 'TableLongitudinalIncrement'], + 1138: ['DS', 'TableAngle'], + '113A': ['CS', 'TableType'], + 1140: ['CS', 'RotationDirection'], + 1141: ['DS', 'AngularPosition'], + 1142: ['DS', 'RadialPosition'], + 1143: ['DS', 'ScanArc'], + 1144: ['DS', 'AngularStep'], + 1145: ['DS', 'CenterOfRotationOffset'], + 1146: ['DS', 'RotationOffset'], + 1147: ['CS', 'FieldOfViewShape'], + 1149: ['IS', 'FieldOfViewDimensions'], + 1150: ['IS', 'ExposureTime'], + 1151: ['IS', 'XRayTubeCurrent'], + 1152: ['IS', 'Exposure'], + 1153: ['IS', 'ExposureInuAs'], + 1154: ['DS', 'AveragePulseWidth'], + 1155: ['CS', 'RadiationSetting'], + 1156: ['CS', 'RectificationType'], + '115A': ['CS', 'RadiationMode'], + '115E': ['DS', 'ImageAndFluoroscopyAreaDoseProduct'], + 1160: ['SH', 'FilterType'], + 1161: ['LO', 'TypeOfFilters'], + 1162: ['DS', 'IntensifierSize'], + 1164: ['DS', 'ImagerPixelSpacing'], + 1166: ['CS', 'Grid'], + 1170: ['IS', 'GeneratorPower'], + 1180: ['SH', 'CollimatorGridName'], + 1181: ['CS', 'CollimatorType'], + 1182: ['IS', 'FocalDistance'], + 1183: ['DS', 'XFocusCenter'], + 1184: ['DS', 'YFocusCenter'], + 1190: ['DS', 'FocalSpots'], + 1191: ['CS', 'AnodeTargetMaterial'], + '11A0': ['DS', 'BodyPartThickness'], + '11A2': ['DS', 'CompressionForce'], + 1200: ['DA', 'DateOfLastCalibration'], + 1201: ['TM', 'TimeOfLastCalibration'], + 1210: ['SH', 'ConvolutionKernel'], + 1240: ['IS', 'UpperLowerPixelValues'], + 1242: ['IS', 'ActualFrameDuration'], + 1243: ['IS', 'CountRate'], + 1244: ['US', 'PreferredPlaybackSequencing'], + 1250: ['SH', 'ReceiveCoilName'], + 1251: ['SH', 'TransmitCoilName'], + 1260: ['SH', 'PlateType'], + 1261: ['LO', 'PhosphorType'], + 1300: ['DS', 'ScanVelocity'], + 1301: ['CS', 'WholeBodyTechnique'], + 1302: ['IS', 'ScanLength'], + 1310: ['US', 'AcquisitionMatrix'], + 1312: ['CS', 'InPlanePhaseEncodingDirection'], + 1314: ['DS', 'FlipAngle'], + 1315: ['CS', 'VariableFlipAngleFlag'], + 1316: ['DS', 'SAR'], + 1318: ['DS', 'dBdt'], + 1400: ['LO', 'AcquisitionDeviceProcessingDescription'], + 1401: ['LO', 'AcquisitionDeviceProcessingCode'], + 1402: ['CS', 'CassetteOrientation'], + 1403: ['CS', 'CassetteSize'], + 1404: ['US', 'ExposuresOnPlate'], + 1405: ['IS', 'RelativeXRayExposure'], + 1411: ['DS', 'ExposureIndex'], + 1412: ['DS', 'TargetExposureIndex'], + 1413: ['DS', 'DeviationIndex'], + 1450: ['DS', 'ColumnAngulation'], + 1460: ['DS', 'TomoLayerHeight'], + 1470: ['DS', 'TomoAngle'], + 1480: ['DS', 'TomoTime'], + 1490: ['CS', 'TomoType'], + 1491: ['CS', 'TomoClass'], + 1495: ['IS', 'NumberOfTomosynthesisSourceImages'], + 1500: ['CS', 'PositionerMotion'], + 1508: ['CS', 'PositionerType'], + 1510: ['DS', 'PositionerPrimaryAngle'], + 1511: ['DS', 'PositionerSecondaryAngle'], + 1520: ['DS', 'PositionerPrimaryAngleIncrement'], + 1521: ['DS', 'PositionerSecondaryAngleIncrement'], + 1530: ['DS', 'DetectorPrimaryAngle'], + 1531: ['DS', 'DetectorSecondaryAngle'], + 1600: ['CS', 'ShutterShape'], + 1602: ['IS', 'ShutterLeftVerticalEdge'], + 1604: ['IS', 'ShutterRightVerticalEdge'], + 1606: ['IS', 'ShutterUpperHorizontalEdge'], + 1608: ['IS', 'ShutterLowerHorizontalEdge'], + 1610: ['IS', 'CenterOfCircularShutter'], + 1612: ['IS', 'RadiusOfCircularShutter'], + 1620: ['IS', 'VerticesOfThePolygonalShutter'], + 1622: ['US', 'ShutterPresentationValue'], + 1623: ['US', 'ShutterOverlayGroup'], + 1624: ['US', 'ShutterPresentationColorCIELabValue'], + 1700: ['CS', 'CollimatorShape'], + 1702: ['IS', 'CollimatorLeftVerticalEdge'], + 1704: ['IS', 'CollimatorRightVerticalEdge'], + 1706: ['IS', 'CollimatorUpperHorizontalEdge'], + 1708: ['IS', 'CollimatorLowerHorizontalEdge'], + 1710: ['IS', 'CenterOfCircularCollimator'], + 1712: ['IS', 'RadiusOfCircularCollimator'], + 1720: ['IS', 'VerticesOfThePolygonalCollimator'], + 1800: ['CS', 'AcquisitionTimeSynchronized'], + 1801: ['SH', 'TimeSource'], + 1802: ['CS', 'TimeDistributionProtocol'], + 1803: ['LO', 'NTPSourceAddress'], + 2001: ['IS', 'PageNumberVector'], + 2002: ['SH', 'FrameLabelVector'], + 2003: ['DS', 'FramePrimaryAngleVector'], + 2004: ['DS', 'FrameSecondaryAngleVector'], + 2005: ['DS', 'SliceLocationVector'], + 2006: ['SH', 'DisplayWindowLabelVector'], + 2010: ['DS', 'NominalScannedPixelSpacing'], + 2020: ['CS', 'DigitizingDeviceTransportDirection'], + 2030: ['DS', 'RotationOfScannedFilm'], + 3100: ['CS', 'IVUSAcquisition'], + 3101: ['DS', 'IVUSPullbackRate'], + 3102: ['DS', 'IVUSGatedRate'], + 3103: ['IS', 'IVUSPullbackStartFrameNumber'], + 3104: ['IS', 'IVUSPullbackStopFrameNumber'], + 3105: ['IS', 'LesionNumber'], + 4000: ['LT', 'AcquisitionComments'], + 5000: ['SH', 'OutputPower'], + 5010: ['LO', 'TransducerData'], + 5012: ['DS', 'FocusDepth'], + 5020: ['LO', 'ProcessingFunction'], + 5021: ['LO', 'PostprocessingFunction'], + 5022: ['DS', 'MechanicalIndex'], + 5024: ['DS', 'BoneThermalIndex'], + 5026: ['DS', 'CranialThermalIndex'], + 5027: ['DS', 'SoftTissueThermalIndex'], + 5028: ['DS', 'SoftTissueFocusThermalIndex'], + 5029: ['DS', 'SoftTissueSurfaceThermalIndex'], + 5030: ['DS', 'DynamicRange'], + 5040: ['DS', 'TotalGain'], + 5050: ['IS', 'DepthOfScanField'], + 5100: ['CS', 'PatientPosition'], + 5101: ['CS', 'ViewPosition'], + 5104: ['SQ', 'ProjectionEponymousNameCodeSequence'], + 5210: ['DS', 'ImageTransformationMatrix'], + 5212: ['DS', 'ImageTranslationVector'], + 6000: ['DS', 'Sensitivity'], + 6011: ['SQ', 'SequenceOfUltrasoundRegions'], + 6012: ['US', 'RegionSpatialFormat'], + 6014: ['US', 'RegionDataType'], + 6016: ['UL', 'RegionFlags'], + 6018: ['UL', 'RegionLocationMinX0'], + '601A': ['UL', 'RegionLocationMinY0'], + '601C': ['UL', 'RegionLocationMaxX1'], + '601E': ['UL', 'RegionLocationMaxY1'], + 6020: ['SL', 'ReferencePixelX0'], + 6022: ['SL', 'ReferencePixelY0'], + 6024: ['US', 'PhysicalUnitsXDirection'], + 6026: ['US', 'PhysicalUnitsYDirection'], + 6028: ['FD', 'ReferencePixelPhysicalValueX'], + '602A': ['FD', 'ReferencePixelPhysicalValueY'], + '602C': ['FD', 'PhysicalDeltaX'], + '602E': ['FD', 'PhysicalDeltaY'], + 6030: ['UL', 'TransducerFrequency'], + 6031: ['CS', 'TransducerType'], + 6032: ['UL', 'PulseRepetitionFrequency'], + 6034: ['FD', 'DopplerCorrectionAngle'], + 6036: ['FD', 'SteeringAngle'], + 6038: ['UL', 'DopplerSampleVolumeXPositionRetired'], + 6039: ['SL', 'DopplerSampleVolumeXPosition'], + '603A': ['UL', 'DopplerSampleVolumeYPositionRetired'], + '603B': ['SL', 'DopplerSampleVolumeYPosition'], + '603C': ['UL', 'TMLinePositionX0Retired'], + '603D': ['SL', 'TMLinePositionX0'], + '603E': ['UL', 'TMLinePositionY0Retired'], + '603F': ['SL', 'TMLinePositionY0'], + 6040: ['UL', 'TMLinePositionX1Retired'], + 6041: ['SL', 'TMLinePositionX1'], + 6042: ['UL', 'TMLinePositionY1Retired'], + 6043: ['SL', 'TMLinePositionY1'], + 6044: ['US', 'PixelComponentOrganization'], + 6046: ['UL', 'PixelComponentMask'], + 6048: ['UL', 'PixelComponentRangeStart'], + '604A': ['UL', 'PixelComponentRangeStop'], + '604C': ['US', 'PixelComponentPhysicalUnits'], + '604E': ['US', 'PixelComponentDataType'], + 6050: ['UL', 'NumberOfTableBreakPoints'], + 6052: ['UL', 'TableOfXBreakPoints'], + 6054: ['FD', 'TableOfYBreakPoints'], + 6056: ['UL', 'NumberOfTableEntries'], + 6058: ['UL', 'TableOfPixelValues'], + '605A': ['FL', 'TableOfParameterValues'], + 6060: ['FL', 'RWaveTimeVector'], + 7000: ['CS', 'DetectorConditionsNominalFlag'], + 7001: ['DS', 'DetectorTemperature'], + 7004: ['CS', 'DetectorType'], + 7005: ['CS', 'DetectorConfiguration'], + 7006: ['LT', 'DetectorDescription'], + 7008: ['LT', 'DetectorMode'], + '700A': ['SH', 'DetectorID'], + '700C': ['DA', 'DateOfLastDetectorCalibration'], + '700E': ['TM', 'TimeOfLastDetectorCalibration'], + 7010: ['IS', 'ExposuresOnDetectorSinceLastCalibration'], + 7011: ['IS', 'ExposuresOnDetectorSinceManufactured'], + 7012: ['DS', 'DetectorTimeSinceLastExposure'], + 7014: ['DS', 'DetectorActiveTime'], + 7016: ['DS', 'DetectorActivationOffsetFromExposure'], + '701A': ['DS', 'DetectorBinning'], + 7020: ['DS', 'DetectorElementPhysicalSize'], + 7022: ['DS', 'DetectorElementSpacing'], + 7024: ['CS', 'DetectorActiveShape'], + 7026: ['DS', 'DetectorActiveDimensions'], + 7028: ['DS', 'DetectorActiveOrigin'], + '702A': ['LO', 'DetectorManufacturerName'], + '702B': ['LO', 'DetectorManufacturerModelName'], + 7030: ['DS', 'FieldOfViewOrigin'], + 7032: ['DS', 'FieldOfViewRotation'], + 7034: ['CS', 'FieldOfViewHorizontalFlip'], + 7036: ['FL', 'PixelDataAreaOriginRelativeToFOV'], + 7038: ['FL', 'PixelDataAreaRotationAngleRelativeToFOV'], + 7040: ['LT', 'GridAbsorbingMaterial'], + 7041: ['LT', 'GridSpacingMaterial'], + 7042: ['DS', 'GridThickness'], + 7044: ['DS', 'GridPitch'], + 7046: ['IS', 'GridAspectRatio'], + 7048: ['DS', 'GridPeriod'], + '704C': ['DS', 'GridFocalDistance'], + 7050: ['CS', 'FilterMaterial'], + 7052: ['DS', 'FilterThicknessMinimum'], + 7054: ['DS', 'FilterThicknessMaximum'], + 7056: ['FL', 'FilterBeamPathLengthMinimum'], + 7058: ['FL', 'FilterBeamPathLengthMaximum'], + 7060: ['CS', 'ExposureControlMode'], + 7062: ['LT', 'ExposureControlModeDescription'], + 7064: ['CS', 'ExposureStatus'], + 7065: ['DS', 'PhototimerSetting'], + 8150: ['DS', 'ExposureTimeInuS'], + 8151: ['DS', 'XRayTubeCurrentInuA'], + 9004: ['CS', 'ContentQualification'], + 9005: ['SH', 'PulseSequenceName'], + 9006: ['SQ', 'MRImagingModifierSequence'], + 9008: ['CS', 'EchoPulseSequence'], + 9009: ['CS', 'InversionRecovery'], + 9010: ['CS', 'FlowCompensation'], + 9011: ['CS', 'MultipleSpinEcho'], + 9012: ['CS', 'MultiPlanarExcitation'], + 9014: ['CS', 'PhaseContrast'], + 9015: ['CS', 'TimeOfFlightContrast'], + 9016: ['CS', 'Spoiling'], + 9017: ['CS', 'SteadyStatePulseSequence'], + 9018: ['CS', 'EchoPlanarPulseSequence'], + 9019: ['FD', 'TagAngleFirstAxis'], + 9020: ['CS', 'MagnetizationTransfer'], + 9021: ['CS', 'T2Preparation'], + 9022: ['CS', 'BloodSignalNulling'], + 9024: ['CS', 'SaturationRecovery'], + 9025: ['CS', 'SpectrallySelectedSuppression'], + 9026: ['CS', 'SpectrallySelectedExcitation'], + 9027: ['CS', 'SpatialPresaturation'], + 9028: ['CS', 'Tagging'], + 9029: ['CS', 'OversamplingPhase'], + 9030: ['FD', 'TagSpacingFirstDimension'], + 9032: ['CS', 'GeometryOfKSpaceTraversal'], + 9033: ['CS', 'SegmentedKSpaceTraversal'], + 9034: ['CS', 'RectilinearPhaseEncodeReordering'], + 9035: ['FD', 'TagThickness'], + 9036: ['CS', 'PartialFourierDirection'], + 9037: ['CS', 'CardiacSynchronizationTechnique'], + 9041: ['LO', 'ReceiveCoilManufacturerName'], + 9042: ['SQ', 'MRReceiveCoilSequence'], + 9043: ['CS', 'ReceiveCoilType'], + 9044: ['CS', 'QuadratureReceiveCoil'], + 9045: ['SQ', 'MultiCoilDefinitionSequence'], + 9046: ['LO', 'MultiCoilConfiguration'], + 9047: ['SH', 'MultiCoilElementName'], + 9048: ['CS', 'MultiCoilElementUsed'], + 9049: ['SQ', 'MRTransmitCoilSequence'], + 9050: ['LO', 'TransmitCoilManufacturerName'], + 9051: ['CS', 'TransmitCoilType'], + 9052: ['FD', 'SpectralWidth'], + 9053: ['FD', 'ChemicalShiftReference'], + 9054: ['CS', 'VolumeLocalizationTechnique'], + 9058: ['US', 'MRAcquisitionFrequencyEncodingSteps'], + 9059: ['CS', 'Decoupling'], + 9060: ['CS', 'DecoupledNucleus'], + 9061: ['FD', 'DecouplingFrequency'], + 9062: ['CS', 'DecouplingMethod'], + 9063: ['FD', 'DecouplingChemicalShiftReference'], + 9064: ['CS', 'KSpaceFiltering'], + 9065: ['CS', 'TimeDomainFiltering'], + 9066: ['US', 'NumberOfZeroFills'], + 9067: ['CS', 'BaselineCorrection'], + 9069: ['FD', 'ParallelReductionFactorInPlane'], + 9070: ['FD', 'CardiacRRIntervalSpecified'], + 9073: ['FD', 'AcquisitionDuration'], + 9074: ['DT', 'FrameAcquisitionDateTime'], + 9075: ['CS', 'DiffusionDirectionality'], + 9076: ['SQ', 'DiffusionGradientDirectionSequence'], + 9077: ['CS', 'ParallelAcquisition'], + 9078: ['CS', 'ParallelAcquisitionTechnique'], + 9079: ['FD', 'InversionTimes'], + 9080: ['ST', 'MetaboliteMapDescription'], + 9081: ['CS', 'PartialFourier'], + 9082: ['FD', 'EffectiveEchoTime'], + 9083: ['SQ', 'MetaboliteMapCodeSequence'], + 9084: ['SQ', 'ChemicalShiftSequence'], + 9085: ['CS', 'CardiacSignalSource'], + 9087: ['FD', 'DiffusionBValue'], + 9089: ['FD', 'DiffusionGradientOrientation'], + 9090: ['FD', 'VelocityEncodingDirection'], + 9091: ['FD', 'VelocityEncodingMinimumValue'], + 9092: ['SQ', 'VelocityEncodingAcquisitionSequence'], + 9093: ['US', 'NumberOfKSpaceTrajectories'], + 9094: ['CS', 'CoverageOfKSpace'], + 9095: ['UL', 'SpectroscopyAcquisitionPhaseRows'], + 9096: ['FD', 'ParallelReductionFactorInPlaneRetired'], + 9098: ['FD', 'TransmitterFrequency'], + 9100: ['CS', 'ResonantNucleus'], + 9101: ['CS', 'FrequencyCorrection'], + 9103: ['SQ', 'MRSpectroscopyFOVGeometrySequence'], + 9104: ['FD', 'SlabThickness'], + 9105: ['FD', 'SlabOrientation'], + 9106: ['FD', 'MidSlabPosition'], + 9107: ['SQ', 'MRSpatialSaturationSequence'], + 9112: ['SQ', 'MRTimingAndRelatedParametersSequence'], + 9114: ['SQ', 'MREchoSequence'], + 9115: ['SQ', 'MRModifierSequence'], + 9117: ['SQ', 'MRDiffusionSequence'], + 9118: ['SQ', 'CardiacSynchronizationSequence'], + 9119: ['SQ', 'MRAveragesSequence'], + 9125: ['SQ', 'MRFOVGeometrySequence'], + 9126: ['SQ', 'VolumeLocalizationSequence'], + 9127: ['UL', 'SpectroscopyAcquisitionDataColumns'], + 9147: ['CS', 'DiffusionAnisotropyType'], + 9151: ['DT', 'FrameReferenceDateTime'], + 9152: ['SQ', 'MRMetaboliteMapSequence'], + 9155: ['FD', 'ParallelReductionFactorOutOfPlane'], + 9159: ['UL', 'SpectroscopyAcquisitionOutOfPlanePhaseSteps'], + 9166: ['CS', 'BulkMotionStatus'], + 9168: ['FD', 'ParallelReductionFactorSecondInPlane'], + 9169: ['CS', 'CardiacBeatRejectionTechnique'], + 9170: ['CS', 'RespiratoryMotionCompensationTechnique'], + 9171: ['CS', 'RespiratorySignalSource'], + 9172: ['CS', 'BulkMotionCompensationTechnique'], + 9173: ['CS', 'BulkMotionSignalSource'], + 9174: ['CS', 'ApplicableSafetyStandardAgency'], + 9175: ['LO', 'ApplicableSafetyStandardDescription'], + 9176: ['SQ', 'OperatingModeSequence'], + 9177: ['CS', 'OperatingModeType'], + 9178: ['CS', 'OperatingMode'], + 9179: ['CS', 'SpecificAbsorptionRateDefinition'], + 9180: ['CS', 'GradientOutputType'], + 9181: ['FD', 'SpecificAbsorptionRateValue'], + 9182: ['FD', 'GradientOutput'], + 9183: ['CS', 'FlowCompensationDirection'], + 9184: ['FD', 'TaggingDelay'], + 9185: ['ST', 'RespiratoryMotionCompensationTechniqueDescription'], + 9186: ['SH', 'RespiratorySignalSourceID'], + 9195: ['FD', 'ChemicalShiftMinimumIntegrationLimitInHz'], + 9196: ['FD', 'ChemicalShiftMaximumIntegrationLimitInHz'], + 9197: ['SQ', 'MRVelocityEncodingSequence'], + 9198: ['CS', 'FirstOrderPhaseCorrection'], + 9199: ['CS', 'WaterReferencedPhaseCorrection'], + 9200: ['CS', 'MRSpectroscopyAcquisitionType'], + 9214: ['CS', 'RespiratoryCyclePosition'], + 9217: ['FD', 'VelocityEncodingMaximumValue'], + 9218: ['FD', 'TagSpacingSecondDimension'], + 9219: ['SS', 'TagAngleSecondAxis'], + 9220: ['FD', 'FrameAcquisitionDuration'], + 9226: ['SQ', 'MRImageFrameTypeSequence'], + 9227: ['SQ', 'MRSpectroscopyFrameTypeSequence'], + 9231: ['US', 'MRAcquisitionPhaseEncodingStepsInPlane'], + 9232: ['US', 'MRAcquisitionPhaseEncodingStepsOutOfPlane'], + 9234: ['UL', 'SpectroscopyAcquisitionPhaseColumns'], + 9236: ['CS', 'CardiacCyclePosition'], + 9239: ['SQ', 'SpecificAbsorptionRateSequence'], + 9240: ['US', 'RFEchoTrainLength'], + 9241: ['US', 'GradientEchoTrainLength'], + 9250: ['CS', 'ArterialSpinLabelingContrast'], + 9251: ['SQ', 'MRArterialSpinLabelingSequence'], + 9252: ['LO', 'ASLTechniqueDescription'], + 9253: ['US', 'ASLSlabNumber'], + 9254: ['FD ', 'ASLSlabThickness'], + 9255: ['FD ', 'ASLSlabOrientation'], + 9256: ['FD ', 'ASLMidSlabPosition'], + 9257: ['CS', 'ASLContext'], + 9258: ['UL', 'ASLPulseTrainDuration'], + 9259: ['CS', 'ASLCrusherFlag'], + '925A': ['FD', 'ASLCrusherFlow'], + '925B': ['LO', 'ASLCrusherDescription'], + '925C': ['CS', 'ASLBolusCutoffFlag'], + '925D': ['SQ', 'ASLBolusCutoffTimingSequence'], + '925E': ['LO', 'ASLBolusCutoffTechnique'], + '925F': ['UL', 'ASLBolusCutoffDelayTime'], + 9260: ['SQ', 'ASLSlabSequence'], + 9295: ['FD', 'ChemicalShiftMinimumIntegrationLimitInppm'], + 9296: ['FD', 'ChemicalShiftMaximumIntegrationLimitInppm'], + 9301: ['SQ', 'CTAcquisitionTypeSequence'], + 9302: ['CS', 'AcquisitionType'], + 9303: ['FD', 'TubeAngle'], + 9304: ['SQ', 'CTAcquisitionDetailsSequence'], + 9305: ['FD', 'RevolutionTime'], + 9306: ['FD', 'SingleCollimationWidth'], + 9307: ['FD', 'TotalCollimationWidth'], + 9308: ['SQ', 'CTTableDynamicsSequence'], + 9309: ['FD', 'TableSpeed'], + 9310: ['FD', 'TableFeedPerRotation'], + 9311: ['FD', 'SpiralPitchFactor'], + 9312: ['SQ', 'CTGeometrySequence'], + 9313: ['FD', 'DataCollectionCenterPatient'], + 9314: ['SQ', 'CTReconstructionSequence'], + 9315: ['CS', 'ReconstructionAlgorithm'], + 9316: ['CS', 'ConvolutionKernelGroup'], + 9317: ['FD', 'ReconstructionFieldOfView'], + 9318: ['FD', 'ReconstructionTargetCenterPatient'], + 9319: ['FD', 'ReconstructionAngle'], + 9320: ['SH', 'ImageFilter'], + 9321: ['SQ', 'CTExposureSequence'], + 9322: ['FD', 'ReconstructionPixelSpacing'], + 9323: ['CS', 'ExposureModulationType'], + 9324: ['FD', 'EstimatedDoseSaving'], + 9325: ['SQ', 'CTXRayDetailsSequence'], + 9326: ['SQ', 'CTPositionSequence'], + 9327: ['FD', 'TablePosition'], + 9328: ['FD', 'ExposureTimeInms'], + 9329: ['SQ', 'CTImageFrameTypeSequence'], + 9330: ['FD', 'XRayTubeCurrentInmA'], + 9332: ['FD', 'ExposureInmAs'], + 9333: ['CS', 'ConstantVolumeFlag'], + 9334: ['CS', 'FluoroscopyFlag'], + 9335: ['FD', 'DistanceSourceToDataCollectionCenter'], + 9337: ['US', 'ContrastBolusAgentNumber'], + 9338: ['SQ', 'ContrastBolusIngredientCodeSequence'], + 9340: ['SQ', 'ContrastAdministrationProfileSequence'], + 9341: ['SQ', 'ContrastBolusUsageSequence'], + 9342: ['CS', 'ContrastBolusAgentAdministered'], + 9343: ['CS', 'ContrastBolusAgentDetected'], + 9344: ['CS', 'ContrastBolusAgentPhase'], + 9345: ['FD', 'CTDIvol'], + 9346: ['SQ', 'CTDIPhantomTypeCodeSequence'], + 9351: ['FL', 'CalciumScoringMassFactorPatient'], + 9352: ['FL', 'CalciumScoringMassFactorDevice'], + 9353: ['FL', 'EnergyWeightingFactor'], + 9360: ['SQ', 'CTAdditionalXRaySourceSequence'], + 9401: ['SQ', 'ProjectionPixelCalibrationSequence'], + 9402: ['FL', 'DistanceSourceToIsocenter'], + 9403: ['FL', 'DistanceObjectToTableTop'], + 9404: ['FL', 'ObjectPixelSpacingInCenterOfBeam'], + 9405: ['SQ', 'PositionerPositionSequence'], + 9406: ['SQ', 'TablePositionSequence'], + 9407: ['SQ', 'CollimatorShapeSequence'], + 9410: ['CS', 'PlanesInAcquisition'], + 9412: ['SQ', 'XAXRFFrameCharacteristicsSequence'], + 9417: ['SQ', 'FrameAcquisitionSequence'], + 9420: ['CS', 'XRayReceptorType'], + 9423: ['LO', 'AcquisitionProtocolName'], + 9424: ['LT', 'AcquisitionProtocolDescription'], + 9425: ['CS', 'ContrastBolusIngredientOpaque'], + 9426: ['FL', 'DistanceReceptorPlaneToDetectorHousing'], + 9427: ['CS', 'IntensifierActiveShape'], + 9428: ['FL', 'IntensifierActiveDimensions'], + 9429: ['FL', 'PhysicalDetectorSize'], + 9430: ['FL', 'PositionOfIsocenterProjection'], + 9432: ['SQ', 'FieldOfViewSequence'], + 9433: ['LO', 'FieldOfViewDescription'], + 9434: ['SQ', 'ExposureControlSensingRegionsSequence'], + 9435: ['CS', 'ExposureControlSensingRegionShape'], + 9436: ['SS', 'ExposureControlSensingRegionLeftVerticalEdge'], + 9437: ['SS', 'ExposureControlSensingRegionRightVerticalEdge'], + 9438: ['SS', 'ExposureControlSensingRegionUpperHorizontalEdge'], + 9439: ['SS', 'ExposureControlSensingRegionLowerHorizontalEdge'], + 9440: ['SS', 'CenterOfCircularExposureControlSensingRegion'], + 9441: ['US', 'RadiusOfCircularExposureControlSensingRegion'], + 9442: ['SS', 'VerticesOfThePolygonalExposureControlSensingRegion'], + 9447: ['FL', 'ColumnAngulationPatient'], + 9449: ['FL', 'BeamAngle'], + 9451: ['SQ', 'FrameDetectorParametersSequence'], + 9452: ['FL', 'CalculatedAnatomyThickness'], + 9455: ['SQ', 'CalibrationSequence'], + 9456: ['SQ', 'ObjectThicknessSequence'], + 9457: ['CS', 'PlaneIdentification'], + 9461: ['FL', 'FieldOfViewDimensionsInFloat'], + 9462: ['SQ', 'IsocenterReferenceSystemSequence'], + 9463: ['FL', 'PositionerIsocenterPrimaryAngle'], + 9464: ['FL', 'PositionerIsocenterSecondaryAngle'], + 9465: ['FL', 'PositionerIsocenterDetectorRotationAngle'], + 9466: ['FL', 'TableXPositionToIsocenter'], + 9467: ['FL', 'TableYPositionToIsocenter'], + 9468: ['FL', 'TableZPositionToIsocenter'], + 9469: ['FL', 'TableHorizontalRotationAngle'], + 9470: ['FL', 'TableHeadTiltAngle'], + 9471: ['FL', 'TableCradleTiltAngle'], + 9472: ['SQ', 'FrameDisplayShutterSequence'], + 9473: ['FL', 'AcquiredImageAreaDoseProduct'], + 9474: ['CS', 'CArmPositionerTabletopRelationship'], + 9476: ['SQ', 'XRayGeometrySequence'], + 9477: ['SQ', 'IrradiationEventIdentificationSequence'], + 9504: ['SQ', 'XRay3DFrameTypeSequence'], + 9506: ['SQ', 'ContributingSourcesSequence'], + 9507: ['SQ', 'XRay3DAcquisitionSequence'], + 9508: ['FL', 'PrimaryPositionerScanArc'], + 9509: ['FL', 'SecondaryPositionerScanArc'], + 9510: ['FL ', 'PrimaryPositionerScanStartAngle'], + 9511: ['FL', 'SecondaryPositionerScanStartAngle'], + 9514: ['FL', 'PrimaryPositionerIncrement'], + 9515: ['FL', 'SecondaryPositionerIncrement'], + 9516: ['DT', 'StartAcquisitionDateTime'], + 9517: ['DT', 'EndAcquisitionDateTime'], + 9524: ['LO', 'ApplicationName'], + 9525: ['LO', 'ApplicationVersion'], + 9526: ['LO', 'ApplicationManufacturer'], + 9527: ['CS', 'AlgorithmType'], + 9528: ['LO', 'AlgorithmDescription'], + 9530: ['SQ', 'XRay3DReconstructionSequence'], + 9531: ['LO', 'ReconstructionDescription'], + 9538: ['SQ', 'PerProjectionAcquisitionSequence'], + 9601: ['SQ', 'DiffusionBMatrixSequence'], + 9602: ['FD', 'DiffusionBValueXX'], + 9603: ['FD', 'DiffusionBValueXY'], + 9604: ['FD', 'DiffusionBValueXZ'], + 9605: ['FD', 'DiffusionBValueYY'], + 9606: ['FD', 'DiffusionBValueYZ'], + 9607: ['FD', 'DiffusionBValueZZ'], + 9701: ['DT', 'DecayCorrectionDateTime'], + 9715: ['FD', 'StartDensityThreshold'], + 9716: ['FD', 'StartRelativeDensityDifferenceThreshold'], + 9717: ['FD', 'StartCardiacTriggerCountThreshold'], + 9718: ['FD', 'StartRespiratoryTriggerCountThreshold'], + 9719: ['FD', 'TerminationCountsThreshold'], + 9720: ['FD', 'TerminationDensityThreshold'], + 9721: ['FD', 'TerminationRelativeDensityThreshold'], + 9722: ['FD', 'TerminationTimeThreshold'], + 9723: ['FD', 'TerminationCardiacTriggerCountThreshold'], + 9724: ['FD', 'TerminationRespiratoryTriggerCountThreshold'], + 9725: ['CS', 'DetectorGeometry'], + 9726: ['FD', 'TransverseDetectorSeparation'], + 9727: ['FD', 'AxialDetectorDimension'], + 9729: ['US', 'RadiopharmaceuticalAgentNumber'], + 9732: ['SQ', 'PETFrameAcquisitionSequence'], + 9733: ['SQ', 'PETDetectorMotionDetailsSequence'], + 9734: ['SQ', 'PETTableDynamicsSequence'], + 9735: ['SQ', 'PETPositionSequence'], + 9736: ['SQ', 'PETFrameCorrectionFactorsSequence'], + 9737: ['SQ', 'RadiopharmaceuticalUsageSequence'], + 9738: ['CS', 'AttenuationCorrectionSource'], + 9739: ['US', 'NumberOfIterations'], + 9740: ['US', 'NumberOfSubsets'], + 9749: ['SQ', 'PETReconstructionSequence'], + 9751: ['SQ', 'PETFrameTypeSequence'], + 9755: ['CS', 'TimeOfFlightInformationUsed'], + 9756: ['CS', 'ReconstructionType'], + 9758: ['CS', 'DecayCorrected'], + 9759: ['CS', 'AttenuationCorrected'], + 9760: ['CS', 'ScatterCorrected'], + 9761: ['CS', 'DeadTimeCorrected'], + 9762: ['CS', 'GantryMotionCorrected'], + 9763: ['CS', 'PatientMotionCorrected'], + 9764: ['CS', 'CountLossNormalizationCorrected'], + 9765: ['CS', 'RandomsCorrected'], + 9766: ['CS', 'NonUniformRadialSamplingCorrected'], + 9767: ['CS', 'SensitivityCalibrated'], + 9768: ['CS', 'DetectorNormalizationCorrection'], + 9769: ['CS', 'IterativeReconstructionMethod'], + 9770: ['CS', 'AttenuationCorrectionTemporalRelationship'], + 9771: ['SQ', 'PatientPhysiologicalStateSequence'], + 9772: ['SQ', 'PatientPhysiologicalStateCodeSequence'], + 9801: ['FD', 'DepthsOfFocus'], + 9803: ['SQ', 'ExcludedIntervalsSequence'], + 9804: ['DT', 'ExclusionStartDatetime'], + 9805: ['FD', 'ExclusionDuration'], + 9806: ['SQ', 'USImageDescriptionSequence'], + 9807: ['SQ', 'ImageDataTypeSequence'], + 9808: ['CS', 'DataType'], + 9809: ['SQ', 'TransducerScanPatternCodeSequence'], + '980B': ['CS', 'AliasedDataType'], + '980C': ['CS', 'PositionMeasuringDeviceUsed'], + '980D': ['SQ', 'TransducerGeometryCodeSequence'], + '980E': ['SQ', 'TransducerBeamSteeringCodeSequence'], + '980F': ['SQ', 'TransducerApplicationCodeSequence'], + A001: ['SQ', 'ContributingEquipmentSequence'], + A002: ['DT', 'ContributionDateTime'], + A003: ['ST', 'ContributionDescription'] + }, + '0020': { + '000D': ['UI', 'StudyInstanceUID'], + '000E': ['UI', 'SeriesInstanceUID'], + '0010': ['SH', 'StudyID'], + '0011': ['IS', 'SeriesNumber'], + '0012': ['IS', 'AcquisitionNumber'], + '0013': ['IS', 'InstanceNumber'], + '0014': ['IS', 'IsotopeNumber'], + '0015': ['IS', 'PhaseNumber'], + '0016': ['IS', 'IntervalNumber'], + '0017': ['IS', 'TimeSlotNumber'], + '0018': ['IS', 'AngleNumber'], + '0019': ['IS', 'ItemNumber'], + '0020': ['CS', 'PatientOrientation'], + '0022': ['IS', 'OverlayNumber'], + '0024': ['IS', 'CurveNumber'], + '0026': ['IS', 'LUTNumber'], + '0030': ['DS', 'ImagePosition'], + '0032': ['DS', 'ImagePositionPatient'], + '0035': ['DS', 'ImageOrientation'], + '0037': ['DS', 'ImageOrientationPatient'], + '0050': ['DS', 'Location'], + '0052': ['UI', 'FrameOfReferenceUID'], + '0060': ['CS', 'Laterality'], + '0062': ['CS', 'ImageLaterality'], + '0070': ['LO', 'ImageGeometryType'], + '0080': ['CS', 'MaskingImage'], + '00AA': ['IS', 'ReportNumber'], + '0100': ['IS', 'TemporalPositionIdentifier'], + '0105': ['IS', 'NumberOfTemporalPositions'], + '0110': ['DS', 'TemporalResolution'], + '0200': ['UI', 'SynchronizationFrameOfReferenceUID'], + '0242': ['UI', 'SOPInstanceUIDOfConcatenationSource'], + 1000: ['IS', 'SeriesInStudy'], + 1001: ['IS', 'AcquisitionsInSeries'], + 1002: ['IS', 'ImagesInAcquisition'], + 1003: ['IS', 'ImagesInSeries'], + 1004: ['IS', 'AcquisitionsInStudy'], + 1005: ['IS', 'ImagesInStudy'], + 1020: ['LO', 'Reference'], + 1040: ['LO', 'PositionReferenceIndicator'], + 1041: ['DS', 'SliceLocation'], + 1070: ['IS', 'OtherStudyNumbers'], + 1200: ['IS', 'NumberOfPatientRelatedStudies'], + 1202: ['IS', 'NumberOfPatientRelatedSeries'], + 1204: ['IS', 'NumberOfPatientRelatedInstances'], + 1206: ['IS', 'NumberOfStudyRelatedSeries'], + 1208: ['IS', 'NumberOfStudyRelatedInstances'], + 1209: ['IS', 'NumberOfSeriesRelatedInstances'], + 3401: ['CS', 'ModifyingDeviceID'], + 3402: ['CS', 'ModifiedImageID'], + 3403: ['DA', 'ModifiedImageDate'], + 3404: ['LO', 'ModifyingDeviceManufacturer'], + 3405: ['TM', 'ModifiedImageTime'], + 3406: ['LO', 'ModifiedImageDescription'], + 4000: ['LT', 'ImageComments'], + 5000: ['AT', 'OriginalImageIdentification'], + 5002: ['LO', 'OriginalImageIdentificationNomenclature'], + 9056: ['SH', 'StackID'], + 9057: ['UL', 'InStackPositionNumber'], + 9071: ['SQ', 'FrameAnatomySequence'], + 9072: ['CS', 'FrameLaterality'], + 9111: ['SQ', 'FrameContentSequence'], + 9113: ['SQ', 'PlanePositionSequence'], + 9116: ['SQ', 'PlaneOrientationSequence'], + 9128: ['UL', 'TemporalPositionIndex'], + 9153: ['FD', 'NominalCardiacTriggerDelayTime'], + 9154: ['FL', 'NominalCardiacTriggerTimePriorToRPeak'], + 9155: ['FL', 'ActualCardiacTriggerTimePriorToRPeak'], + 9156: ['US', 'FrameAcquisitionNumber'], + 9157: ['UL', 'DimensionIndexValues'], + 9158: ['LT', 'FrameComments'], + 9161: ['UI', 'ConcatenationUID'], + 9162: ['US', 'InConcatenationNumber'], + 9163: ['US', 'InConcatenationTotalNumber'], + 9164: ['UI', 'DimensionOrganizationUID'], + 9165: ['AT', 'DimensionIndexPointer'], + 9167: ['AT', 'FunctionalGroupPointer'], + 9213: ['LO', 'DimensionIndexPrivateCreator'], + 9221: ['SQ', 'DimensionOrganizationSequence'], + 9222: ['SQ', 'DimensionIndexSequence'], + 9228: ['UL', 'ConcatenationFrameOffsetNumber'], + 9238: ['LO', 'FunctionalGroupPrivateCreator'], + 9241: ['FL', 'NominalPercentageOfCardiacPhase'], + 9245: ['FL', 'NominalPercentageOfRespiratoryPhase'], + 9246: ['FL', 'StartingRespiratoryAmplitude'], + 9247: ['CS', 'StartingRespiratoryPhase'], + 9248: ['FL', 'EndingRespiratoryAmplitude'], + 9249: ['CS', 'EndingRespiratoryPhase'], + 9250: ['CS', 'RespiratoryTriggerType'], + 9251: ['FD', 'RRIntervalTimeNominal'], + 9252: ['FD', 'ActualCardiacTriggerDelayTime'], + 9253: ['SQ', 'RespiratorySynchronizationSequence'], + 9254: ['FD', 'RespiratoryIntervalTime'], + 9255: ['FD', 'NominalRespiratoryTriggerDelayTime'], + 9256: ['FD', 'RespiratoryTriggerDelayThreshold'], + 9257: ['FD', 'ActualRespiratoryTriggerDelayTime'], + 9301: ['FD', 'ImagePositionVolume'], + 9302: ['FD', 'ImageOrientationVolume'], + 9307: ['CS', 'UltrasoundAcquisitionGeometry'], + 9308: ['FD', 'ApexPosition'], + 9309: ['FD', 'VolumeToTransducerMappingMatrix'], + '930A': ['FD', 'VolumeToTableMappingMatrix'], + '930C': ['CS', 'PatientFrameOfReferenceSource'], + '930D': ['FD', 'TemporalPositionTimeOffset'], + '930E': ['SQ', 'PlanePositionVolumeSequence'], + '930F': ['SQ', 'PlaneOrientationVolumeSequence'], + 9310: ['SQ', 'TemporalPositionSequence'], + 9311: ['CS', 'DimensionOrganizationType'], + 9312: ['UI', 'VolumeFrameOfReferenceUID'], + 9313: ['UI', 'TableFrameOfReferenceUID'], + 9421: ['LO', 'DimensionDescriptionLabel'], + 9450: ['SQ', 'PatientOrientationInFrameSequence'], + 9453: ['LO', 'FrameLabel'], + 9518: ['US', 'AcquisitionIndex'], + 9529: ['SQ', 'ContributingSOPInstancesReferenceSequence'], + 9536: ['US', 'ReconstructionIndex'] + }, + '0022': { + '0001': ['US', 'LightPathFilterPassThroughWavelength'], + '0002': ['US', 'LightPathFilterPassBand'], + '0003': ['US', 'ImagePathFilterPassThroughWavelength'], + '0004': ['US', 'ImagePathFilterPassBand'], + '0005': ['CS', 'PatientEyeMovementCommanded'], + '0006': ['SQ', 'PatientEyeMovementCommandCodeSequence'], + '0007': ['FL', 'SphericalLensPower'], + '0008': ['FL', 'CylinderLensPower'], + '0009': ['FL', 'CylinderAxis'], + '000A': ['FL', 'EmmetropicMagnification'], + '000B': ['FL', 'IntraOcularPressure'], + '000C': ['FL', 'HorizontalFieldOfView'], + '000D': ['CS', 'PupilDilated'], + '000E': ['FL', 'DegreeOfDilation'], + '0010': ['FL', 'StereoBaselineAngle'], + '0011': ['FL', 'StereoBaselineDisplacement'], + '0012': ['FL', 'StereoHorizontalPixelOffset'], + '0013': ['FL', 'StereoVerticalPixelOffset'], + '0014': ['FL', 'StereoRotation'], + '0015': ['SQ', 'AcquisitionDeviceTypeCodeSequence'], + '0016': ['SQ', 'IlluminationTypeCodeSequence'], + '0017': ['SQ', 'LightPathFilterTypeStackCodeSequence'], + '0018': ['SQ', 'ImagePathFilterTypeStackCodeSequence'], + '0019': ['SQ', 'LensesCodeSequence'], + '001A': ['SQ', 'ChannelDescriptionCodeSequence'], + '001B': ['SQ', 'RefractiveStateSequence'], + '001C': ['SQ', 'MydriaticAgentCodeSequence'], + '001D': ['SQ', 'RelativeImagePositionCodeSequence'], + '001E': ['FL', 'CameraAngleOfView'], + '0020': ['SQ', 'StereoPairsSequence'], + '0021': ['SQ', 'LeftImageSequence'], + '0022': ['SQ', 'RightImageSequence'], + '0030': ['FL', 'AxialLengthOfTheEye'], + '0031': ['SQ', 'OphthalmicFrameLocationSequence'], + '0032': ['FL', 'ReferenceCoordinates'], + '0035': ['FL', 'DepthSpatialResolution'], + '0036': ['FL', 'MaximumDepthDistortion'], + '0037': ['FL', 'AlongScanSpatialResolution'], + '0038': ['FL', 'MaximumAlongScanDistortion'], + '0039': ['CS', 'OphthalmicImageOrientation'], + '0041': ['FL', 'DepthOfTransverseImage'], + '0042': ['SQ', 'MydriaticAgentConcentrationUnitsSequence'], + '0048': ['FL', 'AcrossScanSpatialResolution'], + '0049': ['FL', 'MaximumAcrossScanDistortion'], + '004E': ['DS', 'MydriaticAgentConcentration'], + '0055': ['FL', 'IlluminationWaveLength'], + '0056': ['FL', 'IlluminationPower'], + '0057': ['FL', 'IlluminationBandwidth'], + '0058': ['SQ', 'MydriaticAgentSequence'], + 1007: ['SQ', 'OphthalmicAxialMeasurementsRightEyeSequence'], + 1008: ['SQ', 'OphthalmicAxialMeasurementsLeftEyeSequence'], + 1010: ['CS', 'OphthalmicAxialLengthMeasurementsType'], + 1019: ['FL', 'OphthalmicAxialLength'], + 1024: ['SQ', 'LensStatusCodeSequence'], + 1025: ['SQ', 'VitreousStatusCodeSequence'], + 1028: ['SQ', 'IOLFormulaCodeSequence'], + 1029: ['LO', 'IOLFormulaDetail'], + 1033: ['FL', 'KeratometerIndex'], + 1035: ['SQ', 'SourceOfOphthalmicAxialLengthCodeSequence'], + 1037: ['FL', 'TargetRefraction'], + 1039: ['CS', 'RefractiveProcedureOccurred'], + 1040: ['SQ', 'RefractiveSurgeryTypeCodeSequence'], + 1044: ['SQ', 'OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence'], + 1050: ['SQ', 'OphthalmicAxialLengthMeasurementsSequence'], + 1053: ['FL', 'IOLPower'], + 1054: ['FL', 'PredictedRefractiveError'], + 1059: ['FL', 'OphthalmicAxialLengthVelocity'], + 1065: ['LO', 'LensStatusDescription'], + 1066: ['LO', 'VitreousStatusDescription'], + 1090: ['SQ', 'IOLPowerSequence'], + 1092: ['SQ', 'LensConstantSequence'], + 1093: ['LO', 'IOLManufacturer'], + 1094: ['LO', 'LensConstantDescription'], + 1096: ['SQ', 'KeratometryMeasurementTypeCodeSequence'], + 1100: ['SQ', 'ReferencedOphthalmicAxialMeasurementsSequence'], + 1101: ['SQ', 'OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence'], + 1103: ['SQ', 'RefractiveErrorBeforeRefractiveSurgeryCodeSequence'], + 1121: ['FL', 'IOLPowerForExactEmmetropia'], + 1122: ['FL', 'IOLPowerForExactTargetRefraction'], + 1125: ['SQ', 'AnteriorChamberDepthDefinitionCodeSequence'], + 1130: ['FL', 'LensThickness'], + 1131: ['FL', 'AnteriorChamberDepth'], + 1132: ['SQ', 'SourceOfLensThicknessDataCodeSequence'], + 1133: ['SQ', 'SourceOfAnteriorChamberDepthDataCodeSequence'], + 1135: ['SQ', 'SourceOfRefractiveErrorDataCodeSequence'], + 1140: ['CS', 'OphthalmicAxialLengthMeasurementModified'], + 1150: ['SQ', 'OphthalmicAxialLengthDataSourceCodeSequence'], + 1153: ['SQ', 'OphthalmicAxialLengthAcquisitionMethodCodeSequence'], + 1155: ['FL', 'SignalToNoiseRatio'], + 1159: ['LO', 'OphthalmicAxialLengthDataSourceDescription'], + 1210: ['SQ', 'OphthalmicAxialLengthMeasurementsTotalLengthSequence'], + 1211: ['SQ', 'OphthalmicAxialLengthMeasurementsSegmentalLengthSequence'], + 1212: ['SQ', 'OphthalmicAxialLengthMeasurementsLengthSummationSequence'], + 1220: ['SQ', 'UltrasoundOphthalmicAxialLengthMeasurementsSequence'], + 1225: ['SQ', 'OpticalOphthalmicAxialLengthMeasurementsSequence'], + 1230: ['SQ', 'UltrasoundSelectedOphthalmicAxialLengthSequence'], + 1250: ['SQ', 'OphthalmicAxialLengthSelectionMethodCodeSequence'], + 1255: ['SQ', 'OpticalSelectedOphthalmicAxialLengthSequence'], + 1257: ['SQ', 'SelectedSegmentalOphthalmicAxialLengthSequence'], + 1260: ['SQ', 'SelectedTotalOphthalmicAxialLengthSequence'], + 1262: ['SQ', 'OphthalmicAxialLengthQualityMetricSequence'], + 1273: ['LO', 'OphthalmicAxialLengthQualityMetricTypeDescription'], + 1300: ['SQ', 'IntraocularLensCalculationsRightEyeSequence'], + 1310: ['SQ', 'IntraocularLensCalculationsLeftEyeSequence'], + 1330: ['SQ', 'ReferencedOphthalmicAxialLengthMeasurementQCImageSequence'] + }, + '0024': { + '0010': ['FL', 'VisualFieldHorizontalExtent'], + '0011': ['FL', 'VisualFieldVerticalExtent'], + '0012': ['CS', 'VisualFieldShape'], + '0016': ['SQ', 'ScreeningTestModeCodeSequence'], + '0018': ['FL', 'MaximumStimulusLuminance'], + '0020': ['FL', 'BackgroundLuminance'], + '0021': ['SQ', 'StimulusColorCodeSequence'], + '0024': ['SQ', 'BackgroundIlluminationColorCodeSequence'], + '0025': ['FL', 'StimulusArea'], + '0028': ['FL', 'StimulusPresentationTime'], + '0032': ['SQ', 'FixationSequence'], + '0033': ['SQ', 'FixationMonitoringCodeSequence'], + '0034': ['SQ', 'VisualFieldCatchTrialSequence'], + '0035': ['US', 'FixationCheckedQuantity'], + '0036': ['US', 'PatientNotProperlyFixatedQuantity'], + '0037': ['CS', 'PresentedVisualStimuliDataFlag'], + '0038': ['US', 'NumberOfVisualStimuli'], + '0039': ['CS', 'ExcessiveFixationLossesDataFlag'], + '0040': ['CS', 'ExcessiveFixationLosses'], + '0042': ['US', 'StimuliRetestingQuantity'], + '0044': ['LT', 'CommentsOnPatientPerformanceOfVisualField'], + '0045': ['CS', 'FalseNegativesEstimateFlag'], + '0046': ['FL', 'FalseNegativesEstimate'], + '0048': ['US', 'NegativeCatchTrialsQuantity'], + '0050': ['US', 'FalseNegativesQuantity'], + '0051': ['CS', 'ExcessiveFalseNegativesDataFlag'], + '0052': ['CS', 'ExcessiveFalseNegatives'], + '0053': ['CS', 'FalsePositivesEstimateFlag'], + '0054': ['FL', 'FalsePositivesEstimate'], + '0055': ['CS', 'CatchTrialsDataFlag'], + '0056': ['US', 'PositiveCatchTrialsQuantity'], + '0057': ['CS', 'TestPointNormalsDataFlag'], + '0058': ['SQ', 'TestPointNormalsSequence'], + '0059': ['CS', 'GlobalDeviationProbabilityNormalsFlag'], + '0060': ['US', 'FalsePositivesQuantity'], + '0061': ['CS', 'ExcessiveFalsePositivesDataFlag'], + '0062': ['CS', 'ExcessiveFalsePositives'], + '0063': ['CS', 'VisualFieldTestNormalsFlag'], + '0064': ['SQ', 'ResultsNormalsSequence'], + '0065': ['SQ', 'AgeCorrectedSensitivityDeviationAlgorithmSequence'], + '0066': ['FL', 'GlobalDeviationFromNormal'], + '0067': ['SQ', 'GeneralizedDefectSensitivityDeviationAlgorithmSequence'], + '0068': ['FL', 'LocalizedDeviationfromNormal'], + '0069': ['LO', 'PatientReliabilityIndicator'], + '0070': ['FL', 'VisualFieldMeanSensitivity'], + '0071': ['FL', 'GlobalDeviationProbability'], + '0072': ['CS', 'LocalDeviationProbabilityNormalsFlag'], + '0073': ['FL', 'LocalizedDeviationProbability'], + '0074': ['CS', 'ShortTermFluctuationCalculated'], + '0075': ['FL', 'ShortTermFluctuation'], + '0076': ['CS', 'ShortTermFluctuationProbabilityCalculated'], + '0077': ['FL', 'ShortTermFluctuationProbability'], + '0078': ['CS', 'CorrectedLocalizedDeviationFromNormalCalculated'], + '0079': ['FL', 'CorrectedLocalizedDeviationFromNormal'], + '0080': ['CS', 'CorrectedLocalizedDeviationFromNormalProbabilityCalculated'], + '0081': ['FL', 'CorrectedLocalizedDeviationFromNormalProbability'], + '0083': ['SQ', 'GlobalDeviationProbabilitySequence'], + '0085': ['SQ', 'LocalizedDeviationProbabilitySequence'], + '0086': ['CS', 'FovealSensitivityMeasured'], + '0087': ['FL', 'FovealSensitivity'], + '0088': ['FL', 'VisualFieldTestDuration'], + '0089': ['SQ', 'VisualFieldTestPointSequence'], + '0090': ['FL', 'VisualFieldTestPointXCoordinate'], + '0091': ['FL', 'VisualFieldTestPointYCoordinate'], + '0092': ['FL', 'AgeCorrectedSensitivityDeviationValue'], + '0093': ['CS', 'StimulusResults'], + '0094': ['FL', 'SensitivityValue'], + '0095': ['CS', 'RetestStimulusSeen'], + '0096': ['FL', 'RetestSensitivityValue'], + '0097': ['SQ', 'VisualFieldTestPointNormalsSequence'], + '0098': ['FL', 'QuantifiedDefect'], + '0100': ['FL', 'AgeCorrectedSensitivityDeviationProbabilityValue'], + '0102': ['CS', 'GeneralizedDefectCorrectedSensitivityDeviationFlag '], + '0103': ['FL', 'GeneralizedDefectCorrectedSensitivityDeviationValue '], + '0104': ['FL', 'GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue'], + '0105': ['FL ', 'MinimumSensitivityValue'], + '0106': ['CS', 'BlindSpotLocalized'], + '0107': ['FL', 'BlindSpotXCoordinate'], + '0108': ['FL', 'BlindSpotYCoordinate '], + '0110': ['SQ', 'VisualAcuityMeasurementSequence'], + '0112': ['SQ', 'RefractiveParametersUsedOnPatientSequence'], + '0113': ['CS', 'MeasurementLaterality'], + '0114': ['SQ', 'OphthalmicPatientClinicalInformationLeftEyeSequence'], + '0115': ['SQ', 'OphthalmicPatientClinicalInformationRightEyeSequence'], + '0117': ['CS', 'FovealPointNormativeDataFlag'], + '0118': ['FL', 'FovealPointProbabilityValue'], + '0120': ['CS', 'ScreeningBaselineMeasured'], + '0122': ['SQ', 'ScreeningBaselineMeasuredSequence'], + '0124': ['CS', 'ScreeningBaselineType'], + '0126': ['FL', 'ScreeningBaselineValue'], + '0202': ['LO', 'AlgorithmSource'], + '0306': ['LO', 'DataSetName'], + '0307': ['LO', 'DataSetVersion'], + '0308': ['LO', 'DataSetSource'], + '0309': ['LO', 'DataSetDescription'], + '0317': ['SQ', 'VisualFieldTestReliabilityGlobalIndexSequence'], + '0320': ['SQ', 'VisualFieldGlobalResultsIndexSequence'], + '0325': ['SQ', 'DataObservationSequence'], + '0338': ['CS', 'IndexNormalsFlag'], + '0341': ['FL', 'IndexProbability'], + '0344': ['SQ', 'IndexProbabilitySequence'] + }, + '0028': { + '0002': ['US', 'SamplesPerPixel'], + '0003': ['US', 'SamplesPerPixelUsed'], + '0004': ['CS', 'PhotometricInterpretation'], + '0005': ['US', 'ImageDimensions'], + '0006': ['US', 'PlanarConfiguration'], + '0008': ['IS', 'NumberOfFrames'], + '0009': ['AT', 'FrameIncrementPointer'], + '000A': ['AT', 'FrameDimensionPointer'], + '0010': ['US', 'Rows'], + '0011': ['US', 'Columns'], + '0012': ['US', 'Planes'], + '0014': ['US', 'UltrasoundColorDataPresent'], + '0030': ['DS', 'PixelSpacing'], + '0031': ['DS', 'ZoomFactor'], + '0032': ['DS', 'ZoomCenter'], + '0034': ['IS', 'PixelAspectRatio'], + '0040': ['CS', 'ImageFormat'], + '0050': ['LO', 'ManipulatedImage'], + '0051': ['CS', 'CorrectedImage'], + '005F': ['LO', 'CompressionRecognitionCode'], + '0060': ['CS', 'CompressionCode'], + '0061': ['SH', 'CompressionOriginator'], + '0062': ['LO', 'CompressionLabel'], + '0063': ['SH', 'CompressionDescription'], + '0065': ['CS', 'CompressionSequence'], + '0066': ['AT', 'CompressionStepPointers'], + '0068': ['US', 'RepeatInterval'], + '0069': ['US', 'BitsGrouped'], + '0070': ['US', 'PerimeterTable'], + '0071': ['SS', 'PerimeterValue'], + '0080': ['US', 'PredictorRows'], + '0081': ['US', 'PredictorColumns'], + '0082': ['US', 'PredictorConstants'], + '0090': ['CS', 'BlockedPixels'], + '0091': ['US', 'BlockRows'], + '0092': ['US', 'BlockColumns'], + '0093': ['US', 'RowOverlap'], + '0094': ['US', 'ColumnOverlap'], + '0100': ['US', 'BitsAllocated'], + '0101': ['US', 'BitsStored'], + '0102': ['US', 'HighBit'], + '0103': ['US', 'PixelRepresentation'], + '0104': ['SS', 'SmallestValidPixelValue'], + '0105': ['SS', 'LargestValidPixelValue'], + '0106': ['SS', 'SmallestImagePixelValue'], + '0107': ['SS', 'LargestImagePixelValue'], + '0108': ['SS', 'SmallestPixelValueInSeries'], + '0109': ['SS', 'LargestPixelValueInSeries'], + '0110': ['SS', 'SmallestImagePixelValueInPlane'], + '0111': ['SS', 'LargestImagePixelValueInPlane'], + '0120': ['SS', 'PixelPaddingValue'], + '0121': ['SS', 'PixelPaddingRangeLimit'], + '0200': ['US', 'ImageLocation'], + '0300': ['CS', 'QualityControlImage'], + '0301': ['CS', 'BurnedInAnnotation'], + '0302': ['CS', 'RecognizableVisualFeatures'], + '0303': ['CS', 'LongitudinalTemporalInformationModified'], + '0400': ['LO', 'TransformLabel'], + '0401': ['LO', 'TransformVersionNumber'], + '0402': ['US', 'NumberOfTransformSteps'], + '0403': ['LO', 'SequenceOfCompressedData'], + '0404': ['AT', 'DetailsOfCoefficients'], + '0700': ['LO', 'DCTLabel'], + '0701': ['CS', 'DataBlockDescription'], + '0702': ['AT', 'DataBlock'], + '0710': ['US', 'NormalizationFactorFormat'], + '0720': ['US', 'ZonalMapNumberFormat'], + '0721': ['AT', 'ZonalMapLocation'], + '0722': ['US', 'ZonalMapFormat'], + '0730': ['US', 'AdaptiveMapFormat'], + '0740': ['US', 'CodeNumberFormat'], + '0A02': ['CS', 'PixelSpacingCalibrationType'], + '0A04': ['LO', 'PixelSpacingCalibrationDescription'], + 1040: ['CS', 'PixelIntensityRelationship'], + 1041: ['SS', 'PixelIntensityRelationshipSign'], + 1050: ['DS', 'WindowCenter'], + 1051: ['DS', 'WindowWidth'], + 1052: ['DS', 'RescaleIntercept'], + 1053: ['DS', 'RescaleSlope'], + 1054: ['LO', 'RescaleType'], + 1055: ['LO', 'WindowCenterWidthExplanation'], + 1056: ['CS', 'VOILUTFunction'], + 1080: ['CS', 'GrayScale'], + 1090: ['CS', 'RecommendedViewingMode'], + 1100: ['SS', 'GrayLookupTableDescriptor'], + 1101: ['SS', 'RedPaletteColorLookupTableDescriptor'], + 1102: ['SS', 'GreenPaletteColorLookupTableDescriptor'], + 1103: ['SS', 'BluePaletteColorLookupTableDescriptor'], + 1104: ['US', 'AlphaPaletteColorLookupTableDescriptor'], + 1111: ['SS', 'LargeRedPaletteColorLookupTableDescriptor'], + 1112: ['SS', 'LargeGreenPaletteColorLookupTableDescriptor'], + 1113: ['SS', 'LargeBluePaletteColorLookupTableDescriptor'], + 1199: ['UI', 'PaletteColorLookupTableUID'], + 1200: ['OW', 'GrayLookupTableData'], + 1201: ['OW', 'RedPaletteColorLookupTableData'], + 1202: ['OW', 'GreenPaletteColorLookupTableData'], + 1203: ['OW', 'BluePaletteColorLookupTableData'], + 1204: ['OW', 'AlphaPaletteColorLookupTableData'], + 1211: ['OW', 'LargeRedPaletteColorLookupTableData'], + 1212: ['OW', 'LargeGreenPaletteColorLookupTableData'], + 1213: ['OW', 'LargeBluePaletteColorLookupTableData'], + 1214: ['UI', 'LargePaletteColorLookupTableUID'], + 1221: ['OW', 'SegmentedRedPaletteColorLookupTableData'], + 1222: ['OW', 'SegmentedGreenPaletteColorLookupTableData'], + 1223: ['OW', 'SegmentedBluePaletteColorLookupTableData'], + 1300: ['CS', 'BreastImplantPresent'], + 1350: ['CS', 'PartialView'], + 1351: ['ST', 'PartialViewDescription'], + 1352: ['SQ', 'PartialViewCodeSequence'], + '135A': ['CS', 'SpatialLocationsPreserved'], + 1401: ['SQ', 'DataFrameAssignmentSequence'], + 1402: ['CS', 'DataPathAssignment'], + 1403: ['US', 'BitsMappedToColorLookupTable'], + 1404: ['SQ', 'BlendingLUT1Sequence'], + 1405: ['CS', 'BlendingLUT1TransferFunction'], + 1406: ['FD', 'BlendingWeightConstant'], + 1407: ['US', 'BlendingLookupTableDescriptor'], + 1408: ['OW', 'BlendingLookupTableData'], + '140B': ['SQ', 'EnhancedPaletteColorLookupTableSequence'], + '140C': ['SQ', 'BlendingLUT2Sequence'], + '140D': ['CS', 'BlendingLUT2TransferFunction'], + '140E': ['CS', 'DataPathID'], + '140F': ['CS', 'RGBLUTTransferFunction'], + 1410: ['CS', 'AlphaLUTTransferFunction'], + 2000: ['OB', 'ICCProfile'], + 2110: ['CS', 'LossyImageCompression'], + 2112: ['DS', 'LossyImageCompressionRatio'], + 2114: ['CS', 'LossyImageCompressionMethod'], + 3000: ['SQ', 'ModalityLUTSequence'], + 3002: ['SS', 'LUTDescriptor'], + 3003: ['LO', 'LUTExplanation'], + 3004: ['LO', 'ModalityLUTType'], + 3006: ['OW', 'LUTData'], + 3010: ['SQ', 'VOILUTSequence'], + 3110: ['SQ', 'SoftcopyVOILUTSequence'], + 4000: ['LT', 'ImagePresentationComments'], + 5000: ['SQ', 'BiPlaneAcquisitionSequence'], + 6010: ['US', 'RepresentativeFrameNumber'], + 6020: ['US', 'FrameNumbersOfInterest'], + 6022: ['LO', 'FrameOfInterestDescription'], + 6023: ['CS', 'FrameOfInterestType'], + 6030: ['US', 'MaskPointers'], + 6040: ['US', 'RWavePointer'], + 6100: ['SQ', 'MaskSubtractionSequence'], + 6101: ['CS', 'MaskOperation'], + 6102: ['US', 'ApplicableFrameRange'], + 6110: ['US', 'MaskFrameNumbers'], + 6112: ['US', 'ContrastFrameAveraging'], + 6114: ['FL', 'MaskSubPixelShift'], + 6120: ['SS', 'TIDOffset'], + 6190: ['ST', 'MaskOperationExplanation'], + '7FE0': ['UT', 'PixelDataProviderURL'], + 9001: ['UL', 'DataPointRows'], + 9002: ['UL', 'DataPointColumns'], + 9003: ['CS', 'SignalDomainColumns'], + 9099: ['US', 'LargestMonochromePixelValue'], + 9108: ['CS', 'DataRepresentation'], + 9110: ['SQ', 'PixelMeasuresSequence'], + 9132: ['SQ', 'FrameVOILUTSequence'], + 9145: ['SQ', 'PixelValueTransformationSequence'], + 9235: ['CS', 'SignalDomainRows'], + 9411: ['FL', 'DisplayFilterPercentage'], + 9415: ['SQ', 'FramePixelShiftSequence'], + 9416: ['US', 'SubtractionItemID'], + 9422: ['SQ', 'PixelIntensityRelationshipLUTSequence'], + 9443: ['SQ', 'FramePixelDataPropertiesSequence'], + 9444: ['CS', 'GeometricalProperties'], + 9445: ['FL', 'GeometricMaximumDistortion'], + 9446: ['CS', 'ImageProcessingApplied'], + 9454: ['CS', 'MaskSelectionMode'], + 9474: ['CS', 'LUTFunction'], + 9478: ['FL', 'MaskVisibilityPercentage'], + 9501: ['SQ', 'PixelShiftSequence'], + 9502: ['SQ', 'RegionPixelShiftSequence'], + 9503: ['SS', 'VerticesOfTheRegion'], + 9505: ['SQ', 'MultiFramePresentationSequence'], + 9506: ['US', 'PixelShiftFrameRange'], + 9507: ['US', 'LUTFrameRange'], + 9520: ['DS', 'ImageToEquipmentMappingMatrix'], + 9537: ['CS', 'EquipmentCoordinateSystemIdentification'] + }, + '0032': { + '000A': ['CS', 'StudyStatusID'], + '000C': ['CS', 'StudyPriorityID'], + '0012': ['LO', 'StudyIDIssuer'], + '0032': ['DA', 'StudyVerifiedDate'], + '0033': ['TM', 'StudyVerifiedTime'], + '0034': ['DA', 'StudyReadDate'], + '0035': ['TM', 'StudyReadTime'], + 1000: ['DA', 'ScheduledStudyStartDate'], + 1001: ['TM', 'ScheduledStudyStartTime'], + 1010: ['DA', 'ScheduledStudyStopDate'], + 1011: ['TM', 'ScheduledStudyStopTime'], + 1020: ['LO', 'ScheduledStudyLocation'], + 1021: ['AE', 'ScheduledStudyLocationAETitle'], + 1030: ['LO', 'ReasonForStudy'], + 1031: ['SQ', 'RequestingPhysicianIdentificationSequence'], + 1032: ['PN', 'RequestingPhysician'], + 1033: ['LO', 'RequestingService'], + 1034: ['SQ', 'RequestingServiceCodeSequence'], + 1040: ['DA', 'StudyArrivalDate'], + 1041: ['TM', 'StudyArrivalTime'], + 1050: ['DA', 'StudyCompletionDate'], + 1051: ['TM', 'StudyCompletionTime'], + 1055: ['CS', 'StudyComponentStatusID'], + 1060: ['LO', 'RequestedProcedureDescription'], + 1064: ['SQ', 'RequestedProcedureCodeSequence'], + 1070: ['LO', 'RequestedContrastAgent'], + 4000: ['LT', 'StudyComments'] + }, + '0038': { + '0004': ['SQ', 'ReferencedPatientAliasSequence'], + '0008': ['CS', 'VisitStatusID'], + '0010': ['LO', 'AdmissionID'], + '0011': ['LO', 'IssuerOfAdmissionID'], + '0014': ['SQ', 'IssuerOfAdmissionIDSequence'], + '0016': ['LO', 'RouteOfAdmissions'], + '001A': ['DA', 'ScheduledAdmissionDate'], + '001B': ['TM', 'ScheduledAdmissionTime'], + '001C': ['DA', 'ScheduledDischargeDate'], + '001D': ['TM', 'ScheduledDischargeTime'], + '001E': ['LO', 'ScheduledPatientInstitutionResidence'], + '0020': ['DA', 'AdmittingDate'], + '0021': ['TM', 'AdmittingTime'], + '0030': ['DA', 'DischargeDate'], + '0032': ['TM', 'DischargeTime'], + '0040': ['LO', 'DischargeDiagnosisDescription'], + '0044': ['SQ', 'DischargeDiagnosisCodeSequence'], + '0050': ['LO', 'SpecialNeeds'], + '0060': ['LO', 'ServiceEpisodeID'], + '0061': ['LO', 'IssuerOfServiceEpisodeID'], + '0062': ['LO', 'ServiceEpisodeDescription'], + '0064': ['SQ', 'IssuerOfServiceEpisodeIDSequence'], + '0100': ['SQ', 'PertinentDocumentsSequence'], + '0300': ['LO', 'CurrentPatientLocation'], + '0400': ['LO', 'PatientInstitutionResidence'], + '0500': ['LO', 'PatientState'], + '0502': ['SQ', 'PatientClinicalTrialParticipationSequence'], + 4000: ['LT', 'VisitComments'] + }, + '003A': { + '0004': ['CS', 'WaveformOriginality'], + '0005': ['US', 'NumberOfWaveformChannels'], + '0010': ['UL', 'NumberOfWaveformSamples'], + '001A': ['DS', 'SamplingFrequency'], + '0020': ['SH', 'MultiplexGroupLabel'], + '0200': ['SQ', 'ChannelDefinitionSequence'], + '0202': ['IS', 'WaveformChannelNumber'], + '0203': ['SH', 'ChannelLabel'], + '0205': ['CS', 'ChannelStatus'], + '0208': ['SQ', 'ChannelSourceSequence'], + '0209': ['SQ', 'ChannelSourceModifiersSequence'], + '020A': ['SQ', 'SourceWaveformSequence'], + '020C': ['LO', 'ChannelDerivationDescription'], + '0210': ['DS', 'ChannelSensitivity'], + '0211': ['SQ', 'ChannelSensitivityUnitsSequence'], + '0212': ['DS', 'ChannelSensitivityCorrectionFactor'], + '0213': ['DS', 'ChannelBaseline'], + '0214': ['DS', 'ChannelTimeSkew'], + '0215': ['DS', 'ChannelSampleSkew'], + '0218': ['DS', 'ChannelOffset'], + '021A': ['US', 'WaveformBitsStored'], + '0220': ['DS', 'FilterLowFrequency'], + '0221': ['DS', 'FilterHighFrequency'], + '0222': ['DS', 'NotchFilterFrequency'], + '0223': ['DS', 'NotchFilterBandwidth'], + '0230': ['FL', 'WaveformDataDisplayScale'], + '0231': ['US', 'WaveformDisplayBackgroundCIELabValue'], + '0240': ['SQ', 'WaveformPresentationGroupSequence'], + '0241': ['US', 'PresentationGroupNumber'], + '0242': ['SQ', 'ChannelDisplaySequence'], + '0244': ['US', 'ChannelRecommendedDisplayCIELabValue'], + '0245': ['FL', 'ChannelPosition'], + '0246': ['CS', 'DisplayShadingFlag'], + '0247': ['FL', 'FractionalChannelDisplayScale'], + '0248': ['FL', 'AbsoluteChannelDisplayScale'], + '0300': ['SQ', 'MultiplexedAudioChannelsDescriptionCodeSequence'], + '0301': ['IS', 'ChannelIdentificationCode'], + '0302': ['CS', 'ChannelMode'] + }, + '0040': { + '0001': ['AE', 'ScheduledStationAETitle'], + '0002': ['DA', 'ScheduledProcedureStepStartDate'], + '0003': ['TM', 'ScheduledProcedureStepStartTime'], + '0004': ['DA', 'ScheduledProcedureStepEndDate'], + '0005': ['TM', 'ScheduledProcedureStepEndTime'], + '0006': ['PN', 'ScheduledPerformingPhysicianName'], + '0007': ['LO', 'ScheduledProcedureStepDescription'], + '0008': ['SQ', 'ScheduledProtocolCodeSequence'], + '0009': ['SH', 'ScheduledProcedureStepID'], + '000A': ['SQ', 'StageCodeSequence'], + '000B': ['SQ', 'ScheduledPerformingPhysicianIdentificationSequence'], + '0010': ['SH', 'ScheduledStationName'], + '0011': ['SH', 'ScheduledProcedureStepLocation'], + '0012': ['LO', 'PreMedication'], + '0020': ['CS', 'ScheduledProcedureStepStatus'], + '0026': ['SQ', 'OrderPlacerIdentifierSequence'], + '0027': ['SQ', 'OrderFillerIdentifierSequence'], + '0031': ['UT', 'LocalNamespaceEntityID'], + '0032': ['UT', 'UniversalEntityID'], + '0033': ['CS', 'UniversalEntityIDType'], + '0035': ['CS', 'IdentifierTypeCode'], + '0036': ['SQ', 'AssigningFacilitySequence'], + '0039': ['SQ', 'AssigningJurisdictionCodeSequence'], + '003A': ['SQ', 'AssigningAgencyOrDepartmentCodeSequence'], + '0100': ['SQ', 'ScheduledProcedureStepSequence'], + '0220': ['SQ', 'ReferencedNonImageCompositeSOPInstanceSequence'], + '0241': ['AE', 'PerformedStationAETitle'], + '0242': ['SH', 'PerformedStationName'], + '0243': ['SH', 'PerformedLocation'], + '0244': ['DA', 'PerformedProcedureStepStartDate'], + '0245': ['TM', 'PerformedProcedureStepStartTime'], + '0250': ['DA', 'PerformedProcedureStepEndDate'], + '0251': ['TM', 'PerformedProcedureStepEndTime'], + '0252': ['CS', 'PerformedProcedureStepStatus'], + '0253': ['SH', 'PerformedProcedureStepID'], + '0254': ['LO', 'PerformedProcedureStepDescription'], + '0255': ['LO', 'PerformedProcedureTypeDescription'], + '0260': ['SQ', 'PerformedProtocolCodeSequence'], + '0261': ['CS', 'PerformedProtocolType'], + '0270': ['SQ', 'ScheduledStepAttributesSequence'], + '0275': ['SQ', 'RequestAttributesSequence'], + '0280': ['ST', 'CommentsOnThePerformedProcedureStep'], + '0281': ['SQ', 'PerformedProcedureStepDiscontinuationReasonCodeSequence'], + '0293': ['SQ', 'QuantitySequence'], + '0294': ['DS', 'Quantity'], + '0295': ['SQ', 'MeasuringUnitsSequence'], + '0296': ['SQ', 'BillingItemSequence'], + '0300': ['US', 'TotalTimeOfFluoroscopy'], + '0301': ['US', 'TotalNumberOfExposures'], + '0302': ['US', 'EntranceDose'], + '0303': ['US', 'ExposedArea'], + '0306': ['DS', 'DistanceSourceToEntrance'], + '0307': ['DS', 'DistanceSourceToSupport'], + '030E': ['SQ', 'ExposureDoseSequence'], + '0310': ['ST', 'CommentsOnRadiationDose'], + '0312': ['DS', 'XRayOutput'], + '0314': ['DS', 'HalfValueLayer'], + '0316': ['DS', 'OrganDose'], + '0318': ['CS', 'OrganExposed'], + '0320': ['SQ', 'BillingProcedureStepSequence'], + '0321': ['SQ', 'FilmConsumptionSequence'], + '0324': ['SQ', 'BillingSuppliesAndDevicesSequence'], + '0330': ['SQ', 'ReferencedProcedureStepSequence'], + '0340': ['SQ', 'PerformedSeriesSequence'], + '0400': ['LT', 'CommentsOnTheScheduledProcedureStep'], + '0440': ['SQ', 'ProtocolContextSequence'], + '0441': ['SQ', 'ContentItemModifierSequence'], + '0500': ['SQ', 'ScheduledSpecimenSequence'], + '050A': ['LO', 'SpecimenAccessionNumber'], + '0512': ['LO', 'ContainerIdentifier'], + '0513': ['SQ', 'IssuerOfTheContainerIdentifierSequence'], + '0515': ['SQ', 'AlternateContainerIdentifierSequence'], + '0518': ['SQ', 'ContainerTypeCodeSequence'], + '051A': ['LO', 'ContainerDescription'], + '0520': ['SQ', 'ContainerComponentSequence'], + '0550': ['SQ', 'SpecimenSequence'], + '0551': ['LO', 'SpecimenIdentifier'], + '0552': ['SQ', 'SpecimenDescriptionSequenceTrial'], + '0553': ['ST', 'SpecimenDescriptionTrial'], + '0554': ['UI', 'SpecimenUID'], + '0555': ['SQ', 'AcquisitionContextSequence'], + '0556': ['ST', 'AcquisitionContextDescription'], + '059A': ['SQ', 'SpecimenTypeCodeSequence'], + '0560': ['SQ', 'SpecimenDescriptionSequence'], + '0562': ['SQ', 'IssuerOfTheSpecimenIdentifierSequence'], + '0600': ['LO', 'SpecimenShortDescription'], + '0602': ['UT', 'SpecimenDetailedDescription'], + '0610': ['SQ', 'SpecimenPreparationSequence'], + '0612': ['SQ', 'SpecimenPreparationStepContentItemSequence'], + '0620': ['SQ', 'SpecimenLocalizationContentItemSequence'], + '06FA': ['LO', 'SlideIdentifier'], + '071A': ['SQ', 'ImageCenterPointCoordinatesSequence'], + '072A': ['DS', 'XOffsetInSlideCoordinateSystem'], + '073A': ['DS', 'YOffsetInSlideCoordinateSystem'], + '074A': ['DS', 'ZOffsetInSlideCoordinateSystem'], + '08D8': ['SQ', 'PixelSpacingSequence'], + '08DA': ['SQ', 'CoordinateSystemAxisCodeSequence'], + '08EA': ['SQ', 'MeasurementUnitsCodeSequence'], + '09F8': ['SQ', 'VitalStainCodeSequenceTrial'], + 1001: ['SH', 'RequestedProcedureID'], + 1002: ['LO', 'ReasonForTheRequestedProcedure'], + 1003: ['SH', 'RequestedProcedurePriority'], + 1004: ['LO', 'PatientTransportArrangements'], + 1005: ['LO', 'RequestedProcedureLocation'], + 1006: ['SH', 'PlacerOrderNumberProcedure'], + 1007: ['SH', 'FillerOrderNumberProcedure'], + 1008: ['LO', 'ConfidentialityCode'], + 1009: ['SH', 'ReportingPriority'], + '100A': ['SQ', 'ReasonForRequestedProcedureCodeSequence'], + 1010: ['PN', 'NamesOfIntendedRecipientsOfResults'], + 1011: ['SQ', 'IntendedRecipientsOfResultsIdentificationSequence'], + 1012: ['SQ', 'ReasonForPerformedProcedureCodeSequence'], + 1060: ['LO', 'RequestedProcedureDescriptionTrial'], + 1101: ['SQ', 'PersonIdentificationCodeSequence'], + 1102: ['ST', 'PersonAddress'], + 1103: ['LO', 'PersonTelephoneNumbers'], + 1400: ['LT', 'RequestedProcedureComments'], + 2001: ['LO', 'ReasonForTheImagingServiceRequest'], + 2004: ['DA', 'IssueDateOfImagingServiceRequest'], + 2005: ['TM', 'IssueTimeOfImagingServiceRequest'], + 2006: ['SH', 'PlacerOrderNumberImagingServiceRequestRetired'], + 2007: ['SH', 'FillerOrderNumberImagingServiceRequestRetired'], + 2008: ['PN', 'OrderEnteredBy'], + 2009: ['SH', 'OrderEntererLocation'], + 2010: ['SH', 'OrderCallbackPhoneNumber'], + 2016: ['LO', 'PlacerOrderNumberImagingServiceRequest'], + 2017: ['LO', 'FillerOrderNumberImagingServiceRequest'], + 2400: ['LT', 'ImagingServiceRequestComments'], + 3001: ['LO', 'ConfidentialityConstraintOnPatientDataDescription'], + 4001: ['CS', 'GeneralPurposeScheduledProcedureStepStatus'], + 4002: ['CS', 'GeneralPurposePerformedProcedureStepStatus'], + 4003: ['CS', 'GeneralPurposeScheduledProcedureStepPriority'], + 4004: ['SQ', 'ScheduledProcessingApplicationsCodeSequence'], + 4005: ['DT', 'ScheduledProcedureStepStartDateTime'], + 4006: ['CS', 'MultipleCopiesFlag'], + 4007: ['SQ', 'PerformedProcessingApplicationsCodeSequence'], + 4009: ['SQ', 'HumanPerformerCodeSequence'], + 4010: ['DT', 'ScheduledProcedureStepModificationDateTime'], + 4011: ['DT', 'ExpectedCompletionDateTime'], + 4015: ['SQ', 'ResultingGeneralPurposePerformedProcedureStepsSequence'], + 4016: ['SQ', 'ReferencedGeneralPurposeScheduledProcedureStepSequence'], + 4018: ['SQ', 'ScheduledWorkitemCodeSequence'], + 4019: ['SQ', 'PerformedWorkitemCodeSequence'], + 4020: ['CS', 'InputAvailabilityFlag'], + 4021: ['SQ', 'InputInformationSequence'], + 4022: ['SQ', 'RelevantInformationSequence'], + 4023: ['UI', 'ReferencedGeneralPurposeScheduledProcedureStepTransactionUID'], + 4025: ['SQ', 'ScheduledStationNameCodeSequence'], + 4026: ['SQ', 'ScheduledStationClassCodeSequence'], + 4027: ['SQ', 'ScheduledStationGeographicLocationCodeSequence'], + 4028: ['SQ', 'PerformedStationNameCodeSequence'], + 4029: ['SQ', 'PerformedStationClassCodeSequence'], + 4030: ['SQ', 'PerformedStationGeographicLocationCodeSequence'], + 4031: ['SQ', 'RequestedSubsequentWorkitemCodeSequence'], + 4032: ['SQ', 'NonDICOMOutputCodeSequence'], + 4033: ['SQ', 'OutputInformationSequence'], + 4034: ['SQ', 'ScheduledHumanPerformersSequence'], + 4035: ['SQ', 'ActualHumanPerformersSequence'], + 4036: ['LO', 'HumanPerformerOrganization'], + 4037: ['PN', 'HumanPerformerName'], + 4040: ['CS', 'RawDataHandling'], + 4041: ['CS', 'InputReadinessState'], + 4050: ['DT', 'PerformedProcedureStepStartDateTime'], + 4051: ['DT', 'PerformedProcedureStepEndDateTime'], + 4052: ['DT', 'ProcedureStepCancellationDateTime'], + 8302: ['DS', 'EntranceDoseInmGy'], + 9094: ['SQ', 'ReferencedImageRealWorldValueMappingSequence'], + 9096: ['SQ', 'RealWorldValueMappingSequence'], + 9098: ['SQ', 'PixelValueMappingCodeSequence'], + 9210: ['SH', 'LUTLabel'], + 9211: ['SS', 'RealWorldValueLastValueMapped'], + 9212: ['FD', 'RealWorldValueLUTData'], + 9216: ['SS', 'RealWorldValueFirstValueMapped'], + 9224: ['FD', 'RealWorldValueIntercept'], + 9225: ['FD', 'RealWorldValueSlope'], + A007: ['CS', 'FindingsFlagTrial'], + A010: ['CS', 'RelationshipType'], + A020: ['SQ', 'FindingsSequenceTrial'], + A021: ['UI', 'FindingsGroupUIDTrial'], + A022: ['UI', 'ReferencedFindingsGroupUIDTrial'], + A023: ['DA', 'FindingsGroupRecordingDateTrial'], + A024: ['TM', 'FindingsGroupRecordingTimeTrial'], + A026: ['SQ', 'FindingsSourceCategoryCodeSequenceTrial'], + A027: ['LO', 'VerifyingOrganization'], + A028: ['SQ', 'DocumentingOrganizationIdentifierCodeSequenceTrial'], + A030: ['DT', 'VerificationDateTime'], + A032: ['DT', 'ObservationDateTime'], + A040: ['CS', 'ValueType'], + A043: ['SQ', 'ConceptNameCodeSequence'], + A047: ['LO', 'MeasurementPrecisionDescriptionTrial'], + A050: ['CS', 'ContinuityOfContent'], + A057: ['CS', 'UrgencyOrPriorityAlertsTrial'], + A060: ['LO', 'SequencingIndicatorTrial'], + A066: ['SQ', 'DocumentIdentifierCodeSequenceTrial'], + A067: ['PN', 'DocumentAuthorTrial'], + A068: ['SQ', 'DocumentAuthorIdentifierCodeSequenceTrial'], + A070: ['SQ', 'IdentifierCodeSequenceTrial'], + A073: ['SQ', 'VerifyingObserverSequence'], + A074: ['OB', 'ObjectBinaryIdentifierTrial'], + A075: ['PN', 'VerifyingObserverName'], + A076: ['SQ', 'DocumentingObserverIdentifierCodeSequenceTrial'], + A078: ['SQ', 'AuthorObserverSequence'], + A07A: ['SQ', 'ParticipantSequence'], + A07C: ['SQ', 'CustodialOrganizationSequence'], + A080: ['CS', 'ParticipationType'], + A082: ['DT', 'ParticipationDateTime'], + A084: ['CS', 'ObserverType'], + A085: ['SQ', 'ProcedureIdentifierCodeSequenceTrial'], + A088: ['SQ', 'VerifyingObserverIdentificationCodeSequence'], + A089: ['OB', 'ObjectDirectoryBinaryIdentifierTrial'], + A090: ['SQ', 'EquivalentCDADocumentSequence'], + A0B0: ['US', 'ReferencedWaveformChannels'], + A110: ['DA', 'DateOfDocumentOrVerbalTransactionTrial'], + A112: ['TM', 'TimeOfDocumentCreationOrVerbalTransactionTrial'], + A120: ['DT', 'DateTime'], + A121: ['DA', 'Date'], + A122: ['TM', 'Time'], + A123: ['PN', 'PersonName'], + A124: ['UI', 'UID'], + A125: ['CS', 'ReportStatusIDTrial'], + A130: ['CS', 'TemporalRangeType'], + A132: ['UL', 'ReferencedSamplePositions'], + A136: ['US', 'ReferencedFrameNumbers'], + A138: ['DS', 'ReferencedTimeOffsets'], + A13A: ['DT', 'ReferencedDateTime'], + A160: ['UT', 'TextValue'], + A167: ['SQ', 'ObservationCategoryCodeSequenceTrial'], + A168: ['SQ', 'ConceptCodeSequence'], + A16A: ['ST', 'BibliographicCitationTrial'], + A170: ['SQ', 'PurposeOfReferenceCodeSequence'], + A171: ['UI', 'ObservationUIDTrial'], + A172: ['UI', 'ReferencedObservationUIDTrial'], + A173: ['CS', 'ReferencedObservationClassTrial'], + A174: ['CS', 'ReferencedObjectObservationClassTrial'], + A180: ['US', 'AnnotationGroupNumber'], + A192: ['DA', 'ObservationDateTrial'], + A193: ['TM', 'ObservationTimeTrial'], + A194: ['CS', 'MeasurementAutomationTrial'], + A195: ['SQ', 'ModifierCodeSequence'], + A224: ['ST', 'IdentificationDescriptionTrial'], + A290: ['CS', 'CoordinatesSetGeometricTypeTrial'], + A296: ['SQ', 'AlgorithmCodeSequenceTrial'], + A297: ['ST', 'AlgorithmDescriptionTrial'], + A29A: ['SL', 'PixelCoordinatesSetTrial'], + A300: ['SQ', 'MeasuredValueSequence'], + A301: ['SQ', 'NumericValueQualifierCodeSequence'], + A307: ['PN', 'CurrentObserverTrial'], + A30A: ['DS', 'NumericValue'], + A313: ['SQ', 'ReferencedAccessionSequenceTrial'], + A33A: ['ST', 'ReportStatusCommentTrial'], + A340: ['SQ', 'ProcedureContextSequenceTrial'], + A352: ['PN', 'VerbalSourceTrial'], + A353: ['ST', 'AddressTrial'], + A354: ['LO', 'TelephoneNumberTrial'], + A358: ['SQ', 'VerbalSourceIdentifierCodeSequenceTrial'], + A360: ['SQ', 'PredecessorDocumentsSequence'], + A370: ['SQ', 'ReferencedRequestSequence'], + A372: ['SQ', 'PerformedProcedureCodeSequence'], + A375: ['SQ', 'CurrentRequestedProcedureEvidenceSequence'], + A380: ['SQ', 'ReportDetailSequenceTrial'], + A385: ['SQ', 'PertinentOtherEvidenceSequence'], + A390: ['SQ', 'HL7StructuredDocumentReferenceSequence'], + A402: ['UI', 'ObservationSubjectUIDTrial'], + A403: ['CS', 'ObservationSubjectClassTrial'], + A404: ['SQ', 'ObservationSubjectTypeCodeSequenceTrial'], + A491: ['CS', 'CompletionFlag'], + A492: ['LO', 'CompletionFlagDescription'], + A493: ['CS', 'VerificationFlag'], + A494: ['CS', 'ArchiveRequested'], + A496: ['CS', 'PreliminaryFlag'], + A504: ['SQ', 'ContentTemplateSequence'], + A525: ['SQ', 'IdenticalDocumentsSequence'], + A600: ['CS', 'ObservationSubjectContextFlagTrial'], + A601: ['CS', 'ObserverContextFlagTrial'], + A603: ['CS', 'ProcedureContextFlagTrial'], + A730: ['SQ', 'ContentSequence'], + A731: ['SQ', 'RelationshipSequenceTrial'], + A732: ['SQ', 'RelationshipTypeCodeSequenceTrial'], + A744: ['SQ', 'LanguageCodeSequenceTrial'], + A992: ['ST', 'UniformResourceLocatorTrial'], + B020: ['SQ', 'WaveformAnnotationSequence'], + DB00: ['CS', 'TemplateIdentifier'], + DB06: ['DT', 'TemplateVersion'], + DB07: ['DT', 'TemplateLocalVersion'], + DB0B: ['CS', 'TemplateExtensionFlag'], + DB0C: ['UI', 'TemplateExtensionOrganizationUID'], + DB0D: ['UI', 'TemplateExtensionCreatorUID'], + DB73: ['UL', 'ReferencedContentItemIdentifier'], + E001: ['ST', 'HL7InstanceIdentifier'], + E004: ['DT', 'HL7DocumentEffectiveTime'], + E006: ['SQ', 'HL7DocumentTypeCodeSequence'], + E008: ['SQ', 'DocumentClassCodeSequence'], + E010: ['UT', 'RetrieveURI'], + E011: ['UI', 'RetrieveLocationUID'], + E020: ['CS', 'TypeOfInstances'], + E021: ['SQ', 'DICOMRetrievalSequence'], + E022: ['SQ', 'DICOMMediaRetrievalSequence'], + E023: ['SQ', 'WADORetrievalSequence'], + E024: ['SQ', 'XDSRetrievalSequence'], + E030: ['UI', 'RepositoryUniqueID'], + E031: ['UI', 'HomeCommunityID'] + }, + '0042': { + '0010': ['ST', 'DocumentTitle'], + '0011': ['OB', 'EncapsulatedDocument'], + '0012': ['LO', 'MIMETypeOfEncapsulatedDocument'], + '0013': ['SQ', 'SourceInstanceSequence'], + '0014': ['LO', 'ListOfMIMETypes'] + }, + '0044': { + '0001': ['ST', 'ProductPackageIdentifier'], + '0002': ['CS', 'SubstanceAdministrationApproval'], + '0003': ['LT', 'ApprovalStatusFurtherDescription'], + '0004': ['DT', 'ApprovalStatusDateTime'], + '0007': ['SQ', 'ProductTypeCodeSequence'], + '0008': ['LO', 'ProductName'], + '0009': ['LT', 'ProductDescription'], + '000A': ['LO', 'ProductLotIdentifier'], + '000B': ['DT', 'ProductExpirationDateTime'], + '0010': ['DT', 'SubstanceAdministrationDateTime'], + '0011': ['LO', 'SubstanceAdministrationNotes'], + '0012': ['LO', 'SubstanceAdministrationDeviceID'], + '0013': ['SQ', 'ProductParameterSequence'], + '0019': ['SQ', 'SubstanceAdministrationParameterSequence'] + }, + '0046': { + '0012': ['LO', 'LensDescription'], + '0014': ['SQ', 'RightLensSequence'], + '0015': ['SQ', 'LeftLensSequence'], + '0016': ['SQ', 'UnspecifiedLateralityLensSequence'], + '0018': ['SQ', 'CylinderSequence'], + '0028': ['SQ', 'PrismSequence'], + '0030': ['FD', 'HorizontalPrismPower'], + '0032': ['CS', 'HorizontalPrismBase'], + '0034': ['FD', 'VerticalPrismPower'], + '0036': ['CS', 'VerticalPrismBase'], + '0038': ['CS', 'LensSegmentType'], + '0040': ['FD', 'OpticalTransmittance'], + '0042': ['FD', 'ChannelWidth'], + '0044': ['FD', 'PupilSize'], + '0046': ['FD', 'CornealSize'], + '0050': ['SQ', 'AutorefractionRightEyeSequence'], + '0052': ['SQ', 'AutorefractionLeftEyeSequence'], + '0060': ['FD', 'DistancePupillaryDistance'], + '0062': ['FD', 'NearPupillaryDistance'], + '0063': ['FD', 'IntermediatePupillaryDistance'], + '0064': ['FD', 'OtherPupillaryDistance'], + '0070': ['SQ', 'KeratometryRightEyeSequence'], + '0071': ['SQ', 'KeratometryLeftEyeSequence'], + '0074': ['SQ', 'SteepKeratometricAxisSequence'], + '0075': ['FD', 'RadiusOfCurvature'], + '0076': ['FD', 'KeratometricPower'], + '0077': ['FD', 'KeratometricAxis'], + '0080': ['SQ', 'FlatKeratometricAxisSequence'], + '0092': ['CS', 'BackgroundColor'], + '0094': ['CS', 'Optotype'], + '0095': ['CS', 'OptotypePresentation'], + '0097': ['SQ', 'SubjectiveRefractionRightEyeSequence'], + '0098': ['SQ', 'SubjectiveRefractionLeftEyeSequence'], + '0100': ['SQ', 'AddNearSequence'], + '0101': ['SQ', 'AddIntermediateSequence'], + '0102': ['SQ', 'AddOtherSequence'], + '0104': ['FD', 'AddPower'], + '0106': ['FD', 'ViewingDistance'], + '0121': ['SQ', 'VisualAcuityTypeCodeSequence'], + '0122': ['SQ', 'VisualAcuityRightEyeSequence'], + '0123': ['SQ', 'VisualAcuityLeftEyeSequence'], + '0124': ['SQ', 'VisualAcuityBothEyesOpenSequence'], + '0125': ['CS', 'ViewingDistanceType'], + '0135': ['SS', 'VisualAcuityModifiers'], + '0137': ['FD', 'DecimalVisualAcuity'], + '0139': ['LO', 'OptotypeDetailedDefinition'], + '0145': ['SQ', 'ReferencedRefractiveMeasurementsSequence'], + '0146': ['FD', 'SpherePower'], + '0147': ['FD', 'CylinderPower'] + }, + '0048': { + '0001': ['FL', 'ImagedVolumeWidth'], + '0002': ['FL', 'ImagedVolumeHeight'], + '0003': ['FL', 'ImagedVolumeDepth'], + '0006': ['UL', 'TotalPixelMatrixColumns'], + '0007': ['UL', 'TotalPixelMatrixRows'], + '0008': ['SQ', 'TotalPixelMatrixOriginSequence'], + '0010': ['CS', 'SpecimenLabelInImage'], + '0011': ['CS', 'FocusMethod'], + '0012': ['CS', 'ExtendedDepthOfField'], + '0013': ['US', 'NumberOfFocalPlanes'], + '0014': ['FL', 'DistanceBetweenFocalPlanes'], + '0015': ['US', 'RecommendedAbsentPixelCIELabValue'], + '0100': ['SQ', 'IlluminatorTypeCodeSequence'], + '0102': ['DS', 'ImageOrientationSlide'], + '0105': ['SQ', 'OpticalPathSequence'], + '0106': ['SH', 'OpticalPathIdentifier'], + '0107': ['ST', 'OpticalPathDescription'], + '0108': ['SQ', 'IlluminationColorCodeSequence'], + '0110': ['SQ', 'SpecimenReferenceSequence'], + '0111': ['DS', 'CondenserLensPower'], + '0112': ['DS', 'ObjectiveLensPower'], + '0113': ['DS', 'ObjectiveLensNumericalAperture'], + '0120': ['SQ', 'PaletteColorLookupTableSequence'], + '0200': ['SQ', 'ReferencedImageNavigationSequence'], + '0201': ['US', 'TopLeftHandCornerOfLocalizerArea'], + '0202': ['US', 'BottomRightHandCornerOfLocalizerArea'], + '0207': ['SQ', 'OpticalPathIdentificationSequence'], + '021A': ['SQ', 'PlanePositionSlideSequence'], + '021E': ['SL', 'RowPositionInTotalImagePixelMatrix'], + '021F': ['SL', 'ColumnPositionInTotalImagePixelMatrix'], + '0301': ['CS', 'PixelOriginInterpretation'] + }, + '0050': { + '0004': ['CS', 'CalibrationImage'], + '0010': ['SQ', 'DeviceSequence'], + '0012': ['SQ', 'ContainerComponentTypeCodeSequence'], + '0013': ['FD', 'ContainerComponentThickness'], + '0014': ['DS', 'DeviceLength'], + '0015': ['FD', 'ContainerComponentWidth'], + '0016': ['DS', 'DeviceDiameter'], + '0017': ['CS', 'DeviceDiameterUnits'], + '0018': ['DS', 'DeviceVolume'], + '0019': ['DS', 'InterMarkerDistance'], + '001A': ['CS', 'ContainerComponentMaterial'], + '001B': ['LO', 'ContainerComponentID'], + '001C': ['FD', 'ContainerComponentLength'], + '001D': ['FD', 'ContainerComponentDiameter'], + '001E': ['LO', 'ContainerComponentDescription'], + '0020': ['LO', 'DeviceDescription'] + }, + '0052': { + '0001': ['FL', 'ContrastBolusIngredientPercentByVolume'], + '0002': ['FD', 'OCTFocalDistance'], + '0003': ['FD', 'BeamSpotSize'], + '0004': ['FD', 'EffectiveRefractiveIndex'], + '0006': ['CS', 'OCTAcquisitionDomain'], + '0007': ['FD', 'OCTOpticalCenterWavelength'], + '0008': ['FD', 'AxialResolution'], + '0009': ['FD', 'RangingDepth'], + '0011': ['FD', 'ALineRate'], + '0012': ['US', 'ALinesPerFrame'], + '0013': ['FD', 'CatheterRotationalRate'], + '0014': ['FD', 'ALinePixelSpacing'], + '0016': ['SQ', 'ModeOfPercutaneousAccessSequence'], + '0025': ['SQ', 'IntravascularOCTFrameTypeSequence'], + '0026': ['CS', 'OCTZOffsetApplied'], + '0027': ['SQ', 'IntravascularFrameContentSequence'], + '0028': ['FD', 'IntravascularLongitudinalDistance'], + '0029': ['SQ', 'IntravascularOCTFrameContentSequence'], + '0030': ['SS', 'OCTZOffsetCorrection'], + '0031': ['CS', 'CatheterDirectionOfRotation'], + '0033': ['FD', 'SeamLineLocation'], + '0034': ['FD', 'FirstALineLocation'], + '0036': ['US', 'SeamLineIndex'], + '0038': ['US', 'NumberOfPaddedAlines'], + '0039': ['CS', 'InterpolationType'], + '003A': ['CS', 'RefractiveIndexApplied'] + }, + '0054': { + '0010': ['US', 'EnergyWindowVector'], + '0011': ['US', 'NumberOfEnergyWindows'], + '0012': ['SQ', 'EnergyWindowInformationSequence'], + '0013': ['SQ', 'EnergyWindowRangeSequence'], + '0014': ['DS', 'EnergyWindowLowerLimit'], + '0015': ['DS', 'EnergyWindowUpperLimit'], + '0016': ['SQ', 'RadiopharmaceuticalInformationSequence'], + '0017': ['IS', 'ResidualSyringeCounts'], + '0018': ['SH', 'EnergyWindowName'], + '0020': ['US', 'DetectorVector'], + '0021': ['US', 'NumberOfDetectors'], + '0022': ['SQ', 'DetectorInformationSequence'], + '0030': ['US', 'PhaseVector'], + '0031': ['US', 'NumberOfPhases'], + '0032': ['SQ', 'PhaseInformationSequence'], + '0033': ['US', 'NumberOfFramesInPhase'], + '0036': ['IS', 'PhaseDelay'], + '0038': ['IS', 'PauseBetweenFrames'], + '0039': ['CS', 'PhaseDescription'], + '0050': ['US', 'RotationVector'], + '0051': ['US', 'NumberOfRotations'], + '0052': ['SQ', 'RotationInformationSequence'], + '0053': ['US', 'NumberOfFramesInRotation'], + '0060': ['US', 'RRIntervalVector'], + '0061': ['US', 'NumberOfRRIntervals'], + '0062': ['SQ', 'GatedInformationSequence'], + '0063': ['SQ', 'DataInformationSequence'], + '0070': ['US', 'TimeSlotVector'], + '0071': ['US', 'NumberOfTimeSlots'], + '0072': ['SQ', 'TimeSlotInformationSequence'], + '0073': ['DS', 'TimeSlotTime'], + '0080': ['US', 'SliceVector'], + '0081': ['US', 'NumberOfSlices'], + '0090': ['US', 'AngularViewVector'], + '0100': ['US', 'TimeSliceVector'], + '0101': ['US', 'NumberOfTimeSlices'], + '0200': ['DS', 'StartAngle'], + '0202': ['CS', 'TypeOfDetectorMotion'], + '0210': ['IS', 'TriggerVector'], + '0211': ['US', 'NumberOfTriggersInPhase'], + '0220': ['SQ', 'ViewCodeSequence'], + '0222': ['SQ', 'ViewModifierCodeSequence'], + '0300': ['SQ', 'RadionuclideCodeSequence'], + '0302': ['SQ', 'AdministrationRouteCodeSequence'], + '0304': ['SQ', 'RadiopharmaceuticalCodeSequence'], + '0306': ['SQ', 'CalibrationDataSequence'], + '0308': ['US', 'EnergyWindowNumber'], + '0400': ['SH', 'ImageID'], + '0410': ['SQ', 'PatientOrientationCodeSequence'], + '0412': ['SQ', 'PatientOrientationModifierCodeSequence'], + '0414': ['SQ', 'PatientGantryRelationshipCodeSequence'], + '0500': ['CS', 'SliceProgressionDirection'], + 1000: ['CS', 'SeriesType'], + 1001: ['CS', 'Units'], + 1002: ['CS', 'CountsSource'], + 1004: ['CS', 'ReprojectionMethod'], + 1006: ['CS', 'SUVType'], + 1100: ['CS', 'RandomsCorrectionMethod'], + 1101: ['LO', 'AttenuationCorrectionMethod'], + 1102: ['CS', 'DecayCorrection'], + 1103: ['LO', 'ReconstructionMethod'], + 1104: ['LO', 'DetectorLinesOfResponseUsed'], + 1105: ['LO', 'ScatterCorrectionMethod'], + 1200: ['DS', 'AxialAcceptance'], + 1201: ['IS', 'AxialMash'], + 1202: ['IS', 'TransverseMash'], + 1203: ['DS', 'DetectorElementSize'], + 1210: ['DS', 'CoincidenceWindowWidth'], + 1220: ['CS', 'SecondaryCountsType'], + 1300: ['DS', 'FrameReferenceTime'], + 1310: ['IS', 'PrimaryPromptsCountsAccumulated'], + 1311: ['IS', 'SecondaryCountsAccumulated'], + 1320: ['DS', 'SliceSensitivityFactor'], + 1321: ['DS', 'DecayFactor'], + 1322: ['DS', 'DoseCalibrationFactor'], + 1323: ['DS', 'ScatterFractionFactor'], + 1324: ['DS', 'DeadTimeFactor'], + 1330: ['US', 'ImageIndex'], + 1400: ['CS', 'CountsIncluded'], + 1401: ['CS', 'DeadTimeCorrectionFlag'] + }, + '0060': { + 3000: ['SQ', 'HistogramSequence'], + 3002: ['US', 'HistogramNumberOfBins'], + 3004: ['SS', 'HistogramFirstBinValue'], + 3006: ['SS', 'HistogramLastBinValue'], + 3008: ['US', 'HistogramBinWidth'], + 3010: ['LO', 'HistogramExplanation'], + 3020: ['UL', 'HistogramData'] + }, + '0062': { + '0001': ['CS', 'SegmentationType'], + '0002': ['SQ', 'SegmentSequence'], + '0003': ['SQ', 'SegmentedPropertyCategoryCodeSequence'], + '0004': ['US', 'SegmentNumber'], + '0005': ['LO', 'SegmentLabel'], + '0006': ['ST', 'SegmentDescription'], + '0008': ['CS', 'SegmentAlgorithmType'], + '0009': ['LO', 'SegmentAlgorithmName'], + '000A': ['SQ', 'SegmentIdentificationSequence'], + '000B': ['US', 'ReferencedSegmentNumber'], + '000C': ['US', 'RecommendedDisplayGrayscaleValue'], + '000D': ['US', 'RecommendedDisplayCIELabValue'], + '000E': ['US', 'MaximumFractionalValue'], + '000F': ['SQ', 'SegmentedPropertyTypeCodeSequence'], + '0010': ['CS', 'SegmentationFractionalType'] + }, + '0064': { + '0002': ['SQ', 'DeformableRegistrationSequence'], + '0003': ['UI', 'SourceFrameOfReferenceUID'], + '0005': ['SQ', 'DeformableRegistrationGridSequence'], + '0007': ['UL', 'GridDimensions'], + '0008': ['FD', 'GridResolution'], + '0009': ['OF', 'VectorGridData'], + '000F': ['SQ', 'PreDeformationMatrixRegistrationSequence'], + '0010': ['SQ', 'PostDeformationMatrixRegistrationSequence'] + }, + '0066': { + '0001': ['UL', 'NumberOfSurfaces'], + '0002': ['SQ', 'SurfaceSequence'], + '0003': ['UL', 'SurfaceNumber'], + '0004': ['LT', 'SurfaceComments'], + '0009': ['CS', 'SurfaceProcessing'], + '000A': ['FL', 'SurfaceProcessingRatio'], + '000B': ['LO', 'SurfaceProcessingDescription'], + '000C': ['FL', 'RecommendedPresentationOpacity'], + '000D': ['CS', 'RecommendedPresentationType'], + '000E': ['CS', 'FiniteVolume'], + '0010': ['CS', 'Manifold'], + '0011': ['SQ', 'SurfacePointsSequence'], + '0012': ['SQ', 'SurfacePointsNormalsSequence'], + '0013': ['SQ', 'SurfaceMeshPrimitivesSequence'], + '0015': ['UL', 'NumberOfSurfacePoints'], + '0016': ['OF', 'PointCoordinatesData'], + '0017': ['FL', 'PointPositionAccuracy'], + '0018': ['FL', 'MeanPointDistance'], + '0019': ['FL', 'MaximumPointDistance'], + '001A': ['FL', 'PointsBoundingBoxCoordinates'], + '001B': ['FL', 'AxisOfRotation'], + '001C': ['FL', 'CenterOfRotation'], + '001E': ['UL', 'NumberOfVectors'], + '001F': ['US', 'VectorDimensionality'], + '0020': ['FL', 'VectorAccuracy'], + '0021': ['OF', 'VectorCoordinateData'], + '0023': ['OW', 'TrianglePointIndexList'], + '0024': ['OW', 'EdgePointIndexList'], + '0025': ['OW', 'VertexPointIndexList'], + '0026': ['SQ', 'TriangleStripSequence'], + '0027': ['SQ', 'TriangleFanSequence'], + '0028': ['SQ', 'LineSequence'], + '0029': ['OW', 'PrimitivePointIndexList'], + '002A': ['UL', 'SurfaceCount'], + '002B': ['SQ', 'ReferencedSurfaceSequence'], + '002C': ['UL', 'ReferencedSurfaceNumber'], + '002D': ['SQ', 'SegmentSurfaceGenerationAlgorithmIdentificationSequence'], + '002E': ['SQ', 'SegmentSurfaceSourceInstanceSequence'], + '002F': ['SQ', 'AlgorithmFamilyCodeSequence'], + '0030': ['SQ', 'AlgorithmNameCodeSequence'], + '0031': ['LO', 'AlgorithmVersion'], + '0032': ['LT', 'AlgorithmParameters'], + '0034': ['SQ', 'FacetSequence'], + '0035': ['SQ', 'SurfaceProcessingAlgorithmIdentificationSequence'], + '0036': ['LO', 'AlgorithmName'] + }, + '0068': { + 6210: ['LO', 'ImplantSize'], + 6221: ['LO', 'ImplantTemplateVersion'], + 6222: ['SQ', 'ReplacedImplantTemplateSequence'], + 6223: ['CS', 'ImplantType'], + 6224: ['SQ', 'DerivationImplantTemplateSequence'], + 6225: ['SQ', 'OriginalImplantTemplateSequence'], + 6226: ['DT', 'EffectiveDateTime'], + 6230: ['SQ', 'ImplantTargetAnatomySequence'], + 6260: ['SQ', 'InformationFromManufacturerSequence'], + 6265: ['SQ', 'NotificationFromManufacturerSequence'], + 6270: ['DT', 'InformationIssueDateTime'], + 6280: ['ST', 'InformationSummary'], + '62A0': ['SQ', 'ImplantRegulatoryDisapprovalCodeSequence'], + '62A5': ['FD', 'OverallTemplateSpatialTolerance'], + '62C0': ['SQ', 'HPGLDocumentSequence'], + '62D0': ['US', 'HPGLDocumentID'], + '62D5': ['LO', 'HPGLDocumentLabel'], + '62E0': ['SQ', 'ViewOrientationCodeSequence'], + '62F0': ['FD', 'ViewOrientationModifier'], + '62F2': ['FD', 'HPGLDocumentScaling'], + 6300: ['OB', 'HPGLDocument'], + 6310: ['US', 'HPGLContourPenNumber'], + 6320: ['SQ', 'HPGLPenSequence'], + 6330: ['US', 'HPGLPenNumber'], + 6340: ['LO', 'HPGLPenLabel'], + 6345: ['ST', 'HPGLPenDescription'], + 6346: ['FD', 'RecommendedRotationPoint'], + 6347: ['FD', 'BoundingRectangle'], + 6350: ['US', 'ImplantTemplate3DModelSurfaceNumber'], + 6360: ['SQ', 'SurfaceModelDescriptionSequence'], + 6380: ['LO', 'SurfaceModelLabel'], + 6390: ['FD', 'SurfaceModelScalingFactor'], + '63A0': ['SQ', 'MaterialsCodeSequence'], + '63A4': ['SQ', 'CoatingMaterialsCodeSequence'], + '63A8': ['SQ', 'ImplantTypeCodeSequence'], + '63AC': ['SQ', 'FixationMethodCodeSequence'], + '63B0': ['SQ', 'MatingFeatureSetsSequence'], + '63C0': ['US', 'MatingFeatureSetID'], + '63D0': ['LO', 'MatingFeatureSetLabel'], + '63E0': ['SQ', 'MatingFeatureSequence'], + '63F0': ['US', 'MatingFeatureID'], + 6400: ['SQ', 'MatingFeatureDegreeOfFreedomSequence'], + 6410: ['US', 'DegreeOfFreedomID'], + 6420: ['CS', 'DegreeOfFreedomType'], + 6430: ['SQ', 'TwoDMatingFeatureCoordinatesSequence'], + 6440: ['US', 'ReferencedHPGLDocumentID'], + 6450: ['FD', 'TwoDMatingPoint'], + 6460: ['FD', 'TwoDMatingAxes'], + 6470: ['SQ', 'TwoDDegreeOfFreedomSequence'], + 6490: ['FD', 'ThreeDDegreeOfFreedomAxis'], + '64A0': ['FD', 'RangeOfFreedom'], + '64C0': ['FD', 'ThreeDMatingPoint'], + '64D0': ['FD', 'ThreeDMatingAxes'], + '64F0': ['FD', 'TwoDDegreeOfFreedomAxis'], + 6500: ['SQ', 'PlanningLandmarkPointSequence'], + 6510: ['SQ', 'PlanningLandmarkLineSequence'], + 6520: ['SQ', 'PlanningLandmarkPlaneSequence'], + 6530: ['US', 'PlanningLandmarkID'], + 6540: ['LO', 'PlanningLandmarkDescription'], + 6545: ['SQ', 'PlanningLandmarkIdentificationCodeSequence'], + 6550: ['SQ', 'TwoDPointCoordinatesSequence'], + 6560: ['FD', 'TwoDPointCoordinates'], + 6590: ['FD', 'ThreeDPointCoordinates'], + '65A0': ['SQ', 'TwoDLineCoordinatesSequence'], + '65B0': ['FD', 'TwoDLineCoordinates'], + '65D0': ['FD', 'ThreeDLineCoordinates'], + '65E0': ['SQ', 'TwoDPlaneCoordinatesSequence'], + '65F0': ['FD', 'TwoDPlaneIntersection'], + 6610: ['FD', 'ThreeDPlaneOrigin'], + 6620: ['FD', 'ThreeDPlaneNormal'] + }, + '0070': { + '0001': ['SQ', 'GraphicAnnotationSequence'], + '0002': ['CS', 'GraphicLayer'], + '0003': ['CS', 'BoundingBoxAnnotationUnits'], + '0004': ['CS', 'AnchorPointAnnotationUnits'], + '0005': ['CS', 'GraphicAnnotationUnits'], + '0006': ['ST', 'UnformattedTextValue'], + '0008': ['SQ', 'TextObjectSequence'], + '0009': ['SQ', 'GraphicObjectSequence'], + '0010': ['FL', 'BoundingBoxTopLeftHandCorner'], + '0011': ['FL', 'BoundingBoxBottomRightHandCorner'], + '0012': ['CS', 'BoundingBoxTextHorizontalJustification'], + '0014': ['FL', 'AnchorPoint'], + '0015': ['CS', 'AnchorPointVisibility'], + '0020': ['US', 'GraphicDimensions'], + '0021': ['US', 'NumberOfGraphicPoints'], + '0022': ['FL', 'GraphicData'], + '0023': ['CS', 'GraphicType'], + '0024': ['CS', 'GraphicFilled'], + '0040': ['IS', 'ImageRotationRetired'], + '0041': ['CS', 'ImageHorizontalFlip'], + '0042': ['US', 'ImageRotation'], + '0050': ['US', 'DisplayedAreaTopLeftHandCornerTrial'], + '0051': ['US', 'DisplayedAreaBottomRightHandCornerTrial'], + '0052': ['SL', 'DisplayedAreaTopLeftHandCorner'], + '0053': ['SL', 'DisplayedAreaBottomRightHandCorner'], + '005A': ['SQ', 'DisplayedAreaSelectionSequence'], + '0060': ['SQ', 'GraphicLayerSequence'], + '0062': ['IS', 'GraphicLayerOrder'], + '0066': ['US', 'GraphicLayerRecommendedDisplayGrayscaleValue'], + '0067': ['US', 'GraphicLayerRecommendedDisplayRGBValue'], + '0068': ['LO', 'GraphicLayerDescription'], + '0080': ['CS', 'ContentLabel'], + '0081': ['LO', 'ContentDescription'], + '0082': ['DA', 'PresentationCreationDate'], + '0083': ['TM', 'PresentationCreationTime'], + '0084': ['PN', 'ContentCreatorName'], + '0086': ['SQ', 'ContentCreatorIdentificationCodeSequence'], + '0087': ['SQ', 'AlternateContentDescriptionSequence'], + '0100': ['CS', 'PresentationSizeMode'], + '0101': ['DS', 'PresentationPixelSpacing'], + '0102': ['IS', 'PresentationPixelAspectRatio'], + '0103': ['FL', 'PresentationPixelMagnificationRatio'], + '0207': ['LO', 'GraphicGroupLabel'], + '0208': ['ST', 'GraphicGroupDescription'], + '0209': ['SQ', 'CompoundGraphicSequence'], + '0226': ['UL', 'CompoundGraphicInstanceID'], + '0227': ['LO', 'FontName'], + '0228': ['CS', 'FontNameType'], + '0229': ['LO', 'CSSFontName'], + '0230': ['FD', 'RotationAngle'], + '0231': ['SQ', 'TextStyleSequence'], + '0232': ['SQ', 'LineStyleSequence'], + '0233': ['SQ', 'FillStyleSequence'], + '0234': ['SQ', 'GraphicGroupSequence'], + '0241': ['US', 'TextColorCIELabValue'], + '0242': ['CS', 'HorizontalAlignment'], + '0243': ['CS', 'VerticalAlignment'], + '0244': ['CS', 'ShadowStyle'], + '0245': ['FL', 'ShadowOffsetX'], + '0246': ['FL', 'ShadowOffsetY'], + '0247': ['US', 'ShadowColorCIELabValue'], + '0248': ['CS', 'Underlined'], + '0249': ['CS', 'Bold'], + '0250': ['CS', 'Italic'], + '0251': ['US', 'PatternOnColorCIELabValue'], + '0252': ['US', 'PatternOffColorCIELabValue'], + '0253': ['FL', 'LineThickness'], + '0254': ['CS', 'LineDashingStyle'], + '0255': ['UL', 'LinePattern'], + '0256': ['OB', 'FillPattern'], + '0257': ['CS', 'FillMode'], + '0258': ['FL', 'ShadowOpacity'], + '0261': ['FL', 'GapLength'], + '0262': ['FL', 'DiameterOfVisibility'], + '0273': ['FL', 'RotationPoint'], + '0274': ['CS', 'TickAlignment'], + '0278': ['CS', 'ShowTickLabel'], + '0279': ['CS', 'TickLabelAlignment'], + '0282': ['CS', 'CompoundGraphicUnits'], + '0284': ['FL', 'PatternOnOpacity'], + '0285': ['FL', 'PatternOffOpacity'], + '0287': ['SQ', 'MajorTicksSequence'], + '0288': ['FL', 'TickPosition'], + '0289': ['SH', 'TickLabel'], + '0294': ['CS', 'CompoundGraphicType'], + '0295': ['UL', 'GraphicGroupID'], + '0306': ['CS', 'ShapeType'], + '0308': ['SQ', 'RegistrationSequence'], + '0309': ['SQ', 'MatrixRegistrationSequence'], + '030A': ['SQ', 'MatrixSequence'], + '030C': ['CS', 'FrameOfReferenceTransformationMatrixType'], + '030D': ['SQ', 'RegistrationTypeCodeSequence'], + '030F': ['ST', 'FiducialDescription'], + '0310': ['SH', 'FiducialIdentifier'], + '0311': ['SQ', 'FiducialIdentifierCodeSequence'], + '0312': ['FD', 'ContourUncertaintyRadius'], + '0314': ['SQ', 'UsedFiducialsSequence'], + '0318': ['SQ', 'GraphicCoordinatesDataSequence'], + '031A': ['UI', 'FiducialUID'], + '031C': ['SQ', 'FiducialSetSequence'], + '031E': ['SQ', 'FiducialSequence'], + '0401': ['US', 'GraphicLayerRecommendedDisplayCIELabValue'], + '0402': ['SQ', 'BlendingSequence'], + '0403': ['FL', 'RelativeOpacity'], + '0404': ['SQ', 'ReferencedSpatialRegistrationSequence'], + '0405': ['CS', 'BlendingPosition'] + }, + '0072': { + '0002': ['SH', 'HangingProtocolName'], + '0004': ['LO', 'HangingProtocolDescription'], + '0006': ['CS', 'HangingProtocolLevel'], + '0008': ['LO', 'HangingProtocolCreator'], + '000A': ['DT', 'HangingProtocolCreationDateTime'], + '000C': ['SQ', 'HangingProtocolDefinitionSequence'], + '000E': ['SQ', 'HangingProtocolUserIdentificationCodeSequence'], + '0010': ['LO', 'HangingProtocolUserGroupName'], + '0012': ['SQ', 'SourceHangingProtocolSequence'], + '0014': ['US', 'NumberOfPriorsReferenced'], + '0020': ['SQ', 'ImageSetsSequence'], + '0022': ['SQ', 'ImageSetSelectorSequence'], + '0024': ['CS', 'ImageSetSelectorUsageFlag'], + '0026': ['AT', 'SelectorAttribute'], + '0028': ['US', 'SelectorValueNumber'], + '0030': ['SQ', 'TimeBasedImageSetsSequence'], + '0032': ['US', 'ImageSetNumber'], + '0034': ['CS', 'ImageSetSelectorCategory'], + '0038': ['US', 'RelativeTime'], + '003A': ['CS', 'RelativeTimeUnits'], + '003C': ['SS', 'AbstractPriorValue'], + '003E': ['SQ', 'AbstractPriorCodeSequence'], + '0040': ['LO', 'ImageSetLabel'], + '0050': ['CS', 'SelectorAttributeVR'], + '0052': ['AT', 'SelectorSequencePointer'], + '0054': ['LO', 'SelectorSequencePointerPrivateCreator'], + '0056': ['LO', 'SelectorAttributePrivateCreator'], + '0060': ['AT', 'SelectorATValue'], + '0062': ['CS', 'SelectorCSValue'], + '0064': ['IS', 'SelectorISValue'], + '0066': ['LO', 'SelectorLOValue'], + '0068': ['LT', 'SelectorLTValue'], + '006A': ['PN', 'SelectorPNValue'], + '006C': ['SH', 'SelectorSHValue'], + '006E': ['ST', 'SelectorSTValue'], + '0070': ['UT', 'SelectorUTValue'], + '0072': ['DS', 'SelectorDSValue'], + '0074': ['FD', 'SelectorFDValue'], + '0076': ['FL', 'SelectorFLValue'], + '0078': ['UL', 'SelectorULValue'], + '007A': ['US', 'SelectorUSValue'], + '007C': ['SL', 'SelectorSLValue'], + '007E': ['SS', 'SelectorSSValue'], + '0080': ['SQ', 'SelectorCodeSequenceValue'], + '0100': ['US', 'NumberOfScreens'], + '0102': ['SQ', 'NominalScreenDefinitionSequence'], + '0104': ['US', 'NumberOfVerticalPixels'], + '0106': ['US', 'NumberOfHorizontalPixels'], + '0108': ['FD', 'DisplayEnvironmentSpatialPosition'], + '010A': ['US', 'ScreenMinimumGrayscaleBitDepth'], + '010C': ['US', 'ScreenMinimumColorBitDepth'], + '010E': ['US', 'ApplicationMaximumRepaintTime'], + '0200': ['SQ', 'DisplaySetsSequence'], + '0202': ['US', 'DisplaySetNumber'], + '0203': ['LO', 'DisplaySetLabel'], + '0204': ['US', 'DisplaySetPresentationGroup'], + '0206': ['LO', 'DisplaySetPresentationGroupDescription'], + '0208': ['CS', 'PartialDataDisplayHandling'], + '0210': ['SQ', 'SynchronizedScrollingSequence'], + '0212': ['US', 'DisplaySetScrollingGroup'], + '0214': ['SQ', 'NavigationIndicatorSequence'], + '0216': ['US', 'NavigationDisplaySet'], + '0218': ['US', 'ReferenceDisplaySets'], + '0300': ['SQ', 'ImageBoxesSequence'], + '0302': ['US', 'ImageBoxNumber'], + '0304': ['CS', 'ImageBoxLayoutType'], + '0306': ['US', 'ImageBoxTileHorizontalDimension'], + '0308': ['US', 'ImageBoxTileVerticalDimension'], + '0310': ['CS', 'ImageBoxScrollDirection'], + '0312': ['CS', 'ImageBoxSmallScrollType'], + '0314': ['US', 'ImageBoxSmallScrollAmount'], + '0316': ['CS', 'ImageBoxLargeScrollType'], + '0318': ['US', 'ImageBoxLargeScrollAmount'], + '0320': ['US', 'ImageBoxOverlapPriority'], + '0330': ['FD', 'CineRelativeToRealTime'], + '0400': ['SQ', 'FilterOperationsSequence'], + '0402': ['CS', 'FilterByCategory'], + '0404': ['CS', 'FilterByAttributePresence'], + '0406': ['CS', 'FilterByOperator'], + '0420': ['US', 'StructuredDisplayBackgroundCIELabValue'], + '0421': ['US', 'EmptyImageBoxCIELabValue'], + '0422': ['SQ', 'StructuredDisplayImageBoxSequence'], + '0424': ['SQ', 'StructuredDisplayTextBoxSequence'], + '0427': ['SQ', 'ReferencedFirstFrameSequence'], + '0430': ['SQ', 'ImageBoxSynchronizationSequence'], + '0432': ['US', 'SynchronizedImageBoxList'], + '0434': ['CS', 'TypeOfSynchronization'], + '0500': ['CS', 'BlendingOperationType'], + '0510': ['CS', 'ReformattingOperationType'], + '0512': ['FD', 'ReformattingThickness'], + '0514': ['FD', 'ReformattingInterval'], + '0516': ['CS', 'ReformattingOperationInitialViewDirection'], + '0520': ['CS', 'ThreeDRenderingType'], + '0600': ['SQ', 'SortingOperationsSequence'], + '0602': ['CS', 'SortByCategory'], + '0604': ['CS', 'SortingDirection'], + '0700': ['CS', 'DisplaySetPatientOrientation'], + '0702': ['CS', 'VOIType'], + '0704': ['CS', 'PseudoColorType'], + '0705': ['SQ', 'PseudoColorPaletteInstanceReferenceSequence'], + '0706': ['CS', 'ShowGrayscaleInverted'], + '0710': ['CS', 'ShowImageTrueSizeFlag'], + '0712': ['CS', 'ShowGraphicAnnotationFlag'], + '0714': ['CS', 'ShowPatientDemographicsFlag'], + '0716': ['CS', 'ShowAcquisitionTechniquesFlag'], + '0717': ['CS', 'DisplaySetHorizontalJustification'], + '0718': ['CS', 'DisplaySetVerticalJustification'] + }, + '0074': { + '0120': ['FD', 'ContinuationStartMeterset'], + '0121': ['FD', 'ContinuationEndMeterset'], + 1000: ['CS', 'ProcedureStepState'], + 1002: ['SQ', 'ProcedureStepProgressInformationSequence'], + 1004: ['DS', 'ProcedureStepProgress'], + 1006: ['ST', 'ProcedureStepProgressDescription'], + 1008: ['SQ', 'ProcedureStepCommunicationsURISequence'], + '100A': ['ST', 'ContactURI'], + '100C': ['LO', 'ContactDisplayName'], + '100E': ['SQ', 'ProcedureStepDiscontinuationReasonCodeSequence'], + 1020: ['SQ', 'BeamTaskSequence'], + 1022: ['CS', 'BeamTaskType'], + 1024: ['IS', 'BeamOrderIndexTrial'], + 1026: ['FD', 'TableTopVerticalAdjustedPosition'], + 1027: ['FD', 'TableTopLongitudinalAdjustedPosition'], + 1028: ['FD', 'TableTopLateralAdjustedPosition'], + '102A': ['FD', 'PatientSupportAdjustedAngle'], + '102B': ['FD', 'TableTopEccentricAdjustedAngle'], + '102C': ['FD', 'TableTopPitchAdjustedAngle'], + '102D': ['FD', 'TableTopRollAdjustedAngle'], + 1030: ['SQ', 'DeliveryVerificationImageSequence'], + 1032: ['CS', 'VerificationImageTiming'], + 1034: ['CS', 'DoubleExposureFlag'], + 1036: ['CS', 'DoubleExposureOrdering'], + 1038: ['DS', 'DoubleExposureMetersetTrial'], + '103A': ['DS', 'DoubleExposureFieldDeltaTrial'], + 1040: ['SQ', 'RelatedReferenceRTImageSequence'], + 1042: ['SQ', 'GeneralMachineVerificationSequence'], + 1044: ['SQ', 'ConventionalMachineVerificationSequence'], + 1046: ['SQ', 'IonMachineVerificationSequence'], + 1048: ['SQ', 'FailedAttributesSequence'], + '104A': ['SQ', 'OverriddenAttributesSequence'], + '104C': ['SQ', 'ConventionalControlPointVerificationSequence'], + '104E': ['SQ', 'IonControlPointVerificationSequence'], + 1050: ['SQ', 'AttributeOccurrenceSequence'], + 1052: ['AT', 'AttributeOccurrencePointer'], + 1054: ['UL', 'AttributeItemSelector'], + 1056: ['LO', 'AttributeOccurrencePrivateCreator'], + 1057: ['IS', 'SelectorSequencePointerItems'], + 1200: ['CS', 'ScheduledProcedureStepPriority'], + 1202: ['LO', 'WorklistLabel'], + 1204: ['LO', 'ProcedureStepLabel'], + 1210: ['SQ', 'ScheduledProcessingParametersSequence'], + 1212: ['SQ', 'PerformedProcessingParametersSequence'], + 1216: ['SQ', 'UnifiedProcedureStepPerformedProcedureSequence'], + 1220: ['SQ', 'RelatedProcedureStepSequence'], + 1222: ['LO', 'ProcedureStepRelationshipType'], + 1224: ['SQ', 'ReplacedProcedureStepSequence'], + 1230: ['LO', 'DeletionLock'], + 1234: ['AE', 'ReceivingAE'], + 1236: ['AE', 'RequestingAE'], + 1238: ['LT', 'ReasonForCancellation'], + 1242: ['CS', 'SCPStatus'], + 1244: ['CS', 'SubscriptionListStatus'], + 1246: ['CS', 'UnifiedProcedureStepListStatus'], + 1324: ['UL', 'BeamOrderIndex'], + 1338: ['FD', 'DoubleExposureMeterset'], + '133A': ['FD', 'DoubleExposureFieldDelta'] + }, + '0076': { + '0001': ['LO', 'ImplantAssemblyTemplateName'], + '0003': ['LO', 'ImplantAssemblyTemplateIssuer'], + '0006': ['LO', 'ImplantAssemblyTemplateVersion'], + '0008': ['SQ', 'ReplacedImplantAssemblyTemplateSequence'], + '000A': ['CS', 'ImplantAssemblyTemplateType'], + '000C': ['SQ', 'OriginalImplantAssemblyTemplateSequence'], + '000E': ['SQ', 'DerivationImplantAssemblyTemplateSequence'], + '0010': ['SQ', 'ImplantAssemblyTemplateTargetAnatomySequence'], + '0020': ['SQ', 'ProcedureTypeCodeSequence'], + '0030': ['LO', 'SurgicalTechnique'], + '0032': ['SQ', 'ComponentTypesSequence'], + '0034': ['CS', 'ComponentTypeCodeSequence'], + '0036': ['CS', 'ExclusiveComponentType'], + '0038': ['CS', 'MandatoryComponentType'], + '0040': ['SQ', 'ComponentSequence'], + '0055': ['US', 'ComponentID'], + '0060': ['SQ', 'ComponentAssemblySequence'], + '0070': ['US', 'Component1ReferencedID'], + '0080': ['US', 'Component1ReferencedMatingFeatureSetID'], + '0090': ['US', 'Component1ReferencedMatingFeatureID'], + '00A0': ['US', 'Component2ReferencedID'], + '00B0': ['US', 'Component2ReferencedMatingFeatureSetID'], + '00C0': ['US', 'Component2ReferencedMatingFeatureID'] + }, + '0078': { + '0001': ['LO', 'ImplantTemplateGroupName'], + '0010': ['ST', 'ImplantTemplateGroupDescription'], + '0020': ['LO', 'ImplantTemplateGroupIssuer'], + '0024': ['LO', 'ImplantTemplateGroupVersion'], + '0026': ['SQ', 'ReplacedImplantTemplateGroupSequence'], + '0028': ['SQ', 'ImplantTemplateGroupTargetAnatomySequence'], + '002A': ['SQ', 'ImplantTemplateGroupMembersSequence'], + '002E': ['US', 'ImplantTemplateGroupMemberID'], + '0050': ['FD', 'ThreeDImplantTemplateGroupMemberMatchingPoint'], + '0060': ['FD', 'ThreeDImplantTemplateGroupMemberMatchingAxes'], + '0070': ['SQ', 'ImplantTemplateGroupMemberMatching2DCoordinatesSequence'], + '0090': ['FD', 'TwoDImplantTemplateGroupMemberMatchingPoint'], + '00A0': ['FD', 'TwoDImplantTemplateGroupMemberMatchingAxes'], + '00B0': ['SQ', 'ImplantTemplateGroupVariationDimensionSequence'], + '00B2': ['LO', 'ImplantTemplateGroupVariationDimensionName'], + '00B4': ['SQ', 'ImplantTemplateGroupVariationDimensionRankSequence'], + '00B6': ['US', 'ReferencedImplantTemplateGroupMemberID'], + '00B8': ['US', 'ImplantTemplateGroupVariationDimensionRank'] + }, + '0088': { + '0130': ['SH', 'StorageMediaFileSetID'], + '0140': ['UI', 'StorageMediaFileSetUID'], + '0200': ['SQ', 'IconImageSequence'], + '0904': ['LO', 'TopicTitle'], + '0906': ['ST', 'TopicSubject'], + '0910': ['LO', 'TopicAuthor'], + '0912': ['LO', 'TopicKeywords'] + }, + '0100': { + '0410': ['CS', 'SOPInstanceStatus'], + '0420': ['DT', 'SOPAuthorizationDateTime'], + '0424': ['LT', 'SOPAuthorizationComment'], + '0426': ['LO', 'AuthorizationEquipmentCertificationNumber'] + }, + '0400': { + '0005': ['US', 'MACIDNumber'], + '0010': ['UI', 'MACCalculationTransferSyntaxUID'], + '0015': ['CS', 'MACAlgorithm'], + '0020': ['AT', 'DataElementsSigned'], + '0100': ['UI', 'DigitalSignatureUID'], + '0105': ['DT', 'DigitalSignatureDateTime'], + '0110': ['CS', 'CertificateType'], + '0115': ['OB', 'CertificateOfSigner'], + '0120': ['OB', 'Signature'], + '0305': ['CS', 'CertifiedTimestampType'], + '0310': ['OB', 'CertifiedTimestamp'], + '0401': ['SQ', 'DigitalSignaturePurposeCodeSequence'], + '0402': ['SQ', 'ReferencedDigitalSignatureSequence'], + '0403': ['SQ', 'ReferencedSOPInstanceMACSequence'], + '0404': ['OB', 'MAC'], + '0500': ['SQ', 'EncryptedAttributesSequence'], + '0510': ['UI', 'EncryptedContentTransferSyntaxUID'], + '0520': ['OB', 'EncryptedContent'], + '0550': ['SQ', 'ModifiedAttributesSequence'], + '0561': ['SQ', 'OriginalAttributesSequence'], + '0562': ['DT', 'AttributeModificationDateTime'], + '0563': ['LO', 'ModifyingSystem'], + '0564': ['LO', 'SourceOfPreviousValues'], + '0565': ['CS', 'ReasonForTheAttributeModification'] + }, + 2000: { + '0010': ['IS', 'NumberOfCopies'], + '001E': ['SQ', 'PrinterConfigurationSequence'], + '0020': ['CS', 'PrintPriority'], + '0030': ['CS', 'MediumType'], + '0040': ['CS', 'FilmDestination'], + '0050': ['LO', 'FilmSessionLabel'], + '0060': ['IS', 'MemoryAllocation'], + '0061': ['IS', 'MaximumMemoryAllocation'], + '0062': ['CS', 'ColorImagePrintingFlag'], + '0063': ['CS', 'CollationFlag'], + '0065': ['CS', 'AnnotationFlag'], + '0067': ['CS', 'ImageOverlayFlag'], + '0069': ['CS', 'PresentationLUTFlag'], + '006A': ['CS', 'ImageBoxPresentationLUTFlag'], + '00A0': ['US', 'MemoryBitDepth'], + '00A1': ['US', 'PrintingBitDepth'], + '00A2': ['SQ', 'MediaInstalledSequence'], + '00A4': ['SQ', 'OtherMediaAvailableSequence'], + '00A8': ['SQ', 'SupportedImageDisplayFormatsSequence'], + '0500': ['SQ', 'ReferencedFilmBoxSequence'], + '0510': ['SQ', 'ReferencedStoredPrintSequence'] + }, + 2010: { + '0010': ['ST', 'ImageDisplayFormat'], + '0030': ['CS', 'AnnotationDisplayFormatID'], + '0040': ['CS', 'FilmOrientation'], + '0050': ['CS', 'FilmSizeID'], + '0052': ['CS', 'PrinterResolutionID'], + '0054': ['CS', 'DefaultPrinterResolutionID'], + '0060': ['CS', 'MagnificationType'], + '0080': ['CS', 'SmoothingType'], + '00A6': ['CS', 'DefaultMagnificationType'], + '00A7': ['CS', 'OtherMagnificationTypesAvailable'], + '00A8': ['CS', 'DefaultSmoothingType'], + '00A9': ['CS', 'OtherSmoothingTypesAvailable'], + '0100': ['CS', 'BorderDensity'], + '0110': ['CS', 'EmptyImageDensity'], + '0120': ['US', 'MinDensity'], + '0130': ['US', 'MaxDensity'], + '0140': ['CS', 'Trim'], + '0150': ['ST', 'ConfigurationInformation'], + '0152': ['LT', 'ConfigurationInformationDescription'], + '0154': ['IS', 'MaximumCollatedFilms'], + '015E': ['US', 'Illumination'], + '0160': ['US', 'ReflectedAmbientLight'], + '0376': ['DS', 'PrinterPixelSpacing'], + '0500': ['SQ', 'ReferencedFilmSessionSequence'], + '0510': ['SQ', 'ReferencedImageBoxSequence'], + '0520': ['SQ', 'ReferencedBasicAnnotationBoxSequence'] + }, + 2020: { + '0010': ['US', 'ImageBoxPosition'], + '0020': ['CS', 'Polarity'], + '0030': ['DS', 'RequestedImageSize'], + '0040': ['CS', 'RequestedDecimateCropBehavior'], + '0050': ['CS', 'RequestedResolutionID'], + '00A0': ['CS', 'RequestedImageSizeFlag'], + '00A2': ['CS', 'DecimateCropResult'], + '0110': ['SQ', 'BasicGrayscaleImageSequence'], + '0111': ['SQ', 'BasicColorImageSequence'], + '0130': ['SQ', 'ReferencedImageOverlayBoxSequence'], + '0140': ['SQ', 'ReferencedVOILUTBoxSequence'] + }, + 2030: { + '0010': ['US', 'AnnotationPosition'], + '0020': ['LO', 'TextString'] + }, + 2040: { + '0010': ['SQ', 'ReferencedOverlayPlaneSequence'], + '0011': ['US', 'ReferencedOverlayPlaneGroups'], + '0020': ['SQ', 'OverlayPixelDataSequence'], + '0060': ['CS', 'OverlayMagnificationType'], + '0070': ['CS', 'OverlaySmoothingType'], + '0072': ['CS', 'OverlayOrImageMagnification'], + '0074': ['US', 'MagnifyToNumberOfColumns'], + '0080': ['CS', 'OverlayForegroundDensity'], + '0082': ['CS', 'OverlayBackgroundDensity'], + '0090': ['CS', 'OverlayMode'], + '0100': ['CS', 'ThresholdDensity'], + '0500': ['SQ', 'ReferencedImageBoxSequenceRetired'] + }, + 2050: { + '0010': ['SQ', 'PresentationLUTSequence'], + '0020': ['CS', 'PresentationLUTShape'], + '0500': ['SQ', 'ReferencedPresentationLUTSequence'] + }, + 2100: { + '0010': ['SH', 'PrintJobID'], + '0020': ['CS', 'ExecutionStatus'], + '0030': ['CS', 'ExecutionStatusInfo'], + '0040': ['DA', 'CreationDate'], + '0050': ['TM', 'CreationTime'], + '0070': ['AE', 'Originator'], + '0140': ['AE', 'DestinationAE'], + '0160': ['SH', 'OwnerID'], + '0170': ['IS', 'NumberOfFilms'], + '0500': ['SQ', 'ReferencedPrintJobSequencePullStoredPrint'] + }, + 2110: { + '0010': ['CS', 'PrinterStatus'], + '0020': ['CS', 'PrinterStatusInfo'], + '0030': ['LO', 'PrinterName'], + '0099': ['SH', 'PrintQueueID'] + }, + 2120: { + '0010': ['CS', 'QueueStatus'], + '0050': ['SQ', 'PrintJobDescriptionSequence'], + '0070': ['SQ', 'ReferencedPrintJobSequence'] + }, + 2130: { + '0010': ['SQ', 'PrintManagementCapabilitiesSequence'], + '0015': ['SQ', 'PrinterCharacteristicsSequence'], + '0030': ['SQ', 'FilmBoxContentSequence'], + '0040': ['SQ', 'ImageBoxContentSequence'], + '0050': ['SQ', 'AnnotationContentSequence'], + '0060': ['SQ', 'ImageOverlayBoxContentSequence'], + '0080': ['SQ', 'PresentationLUTContentSequence'], + '00A0': ['SQ', 'ProposedStudySequence'], + '00C0': ['SQ', 'OriginalImageSequence'] + }, + 2200: { + '0001': ['CS', 'LabelUsingInformationExtractedFromInstances'], + '0002': ['UT', 'LabelText'], + '0003': ['CS', 'LabelStyleSelection'], + '0004': ['LT', 'MediaDisposition'], + '0005': ['LT', 'BarcodeValue'], + '0006': ['CS', 'BarcodeSymbology'], + '0007': ['CS', 'AllowMediaSplitting'], + '0008': ['CS', 'IncludeNonDICOMObjects'], + '0009': ['CS', 'IncludeDisplayApplication'], + '000A': ['CS', 'PreserveCompositeInstancesAfterMediaCreation'], + '000B': ['US', 'TotalNumberOfPiecesOfMediaCreated'], + '000C': ['LO', 'RequestedMediaApplicationProfile'], + '000D': ['SQ', 'ReferencedStorageMediaSequence'], + '000E': ['AT', 'FailureAttributes'], + '000F': ['CS', 'AllowLossyCompression'], + '0020': ['CS', 'RequestPriority'] + }, + 3002: { + '0002': ['SH', 'RTImageLabel'], + '0003': ['LO', 'RTImageName'], + '0004': ['ST', 'RTImageDescription'], + '000A': ['CS', 'ReportedValuesOrigin'], + '000C': ['CS', 'RTImagePlane'], + '000D': ['DS', 'XRayImageReceptorTranslation'], + '000E': ['DS', 'XRayImageReceptorAngle'], + '0010': ['DS', 'RTImageOrientation'], + '0011': ['DS', 'ImagePlanePixelSpacing'], + '0012': ['DS', 'RTImagePosition'], + '0020': ['SH', 'RadiationMachineName'], + '0022': ['DS', 'RadiationMachineSAD'], + '0024': ['DS', 'RadiationMachineSSD'], + '0026': ['DS', 'RTImageSID'], + '0028': ['DS', 'SourceToReferenceObjectDistance'], + '0029': ['IS', 'FractionNumber'], + '0030': ['SQ', 'ExposureSequence'], + '0032': ['DS', 'MetersetExposure'], + '0034': ['DS', 'DiaphragmPosition'], + '0040': ['SQ', 'FluenceMapSequence'], + '0041': ['CS', 'FluenceDataSource'], + '0042': ['DS', 'FluenceDataScale'], + '0050': ['SQ', 'PrimaryFluenceModeSequence'], + '0051': ['CS', 'FluenceMode'], + '0052': ['SH', 'FluenceModeID'] + }, + 3004: { + '0001': ['CS', 'DVHType'], + '0002': ['CS', 'DoseUnits'], + '0004': ['CS', 'DoseType'], + '0006': ['LO', 'DoseComment'], + '0008': ['DS', 'NormalizationPoint'], + '000A': ['CS', 'DoseSummationType'], + '000C': ['DS', 'GridFrameOffsetVector'], + '000E': ['DS', 'DoseGridScaling'], + '0010': ['SQ', 'RTDoseROISequence'], + '0012': ['DS', 'DoseValue'], + '0014': ['CS', 'TissueHeterogeneityCorrection'], + '0040': ['DS', 'DVHNormalizationPoint'], + '0042': ['DS', 'DVHNormalizationDoseValue'], + '0050': ['SQ', 'DVHSequence'], + '0052': ['DS', 'DVHDoseScaling'], + '0054': ['CS', 'DVHVolumeUnits'], + '0056': ['IS', 'DVHNumberOfBins'], + '0058': ['DS', 'DVHData'], + '0060': ['SQ', 'DVHReferencedROISequence'], + '0062': ['CS', 'DVHROIContributionType'], + '0070': ['DS', 'DVHMinimumDose'], + '0072': ['DS', 'DVHMaximumDose'], + '0074': ['DS', 'DVHMeanDose'] + }, + 3006: { + '0002': ['SH', 'StructureSetLabel'], + '0004': ['LO', 'StructureSetName'], + '0006': ['ST', 'StructureSetDescription'], + '0008': ['DA', 'StructureSetDate'], + '0009': ['TM', 'StructureSetTime'], + '0010': ['SQ', 'ReferencedFrameOfReferenceSequence'], + '0012': ['SQ', 'RTReferencedStudySequence'], + '0014': ['SQ', 'RTReferencedSeriesSequence'], + '0016': ['SQ', 'ContourImageSequence'], + '0020': ['SQ', 'StructureSetROISequence'], + '0022': ['IS', 'ROINumber'], + '0024': ['UI', 'ReferencedFrameOfReferenceUID'], + '0026': ['LO', 'ROIName'], + '0028': ['ST', 'ROIDescription'], + '002A': ['IS', 'ROIDisplayColor'], + '002C': ['DS', 'ROIVolume'], + '0030': ['SQ', 'RTRelatedROISequence'], + '0033': ['CS', 'RTROIRelationship'], + '0036': ['CS', 'ROIGenerationAlgorithm'], + '0038': ['LO', 'ROIGenerationDescription'], + '0039': ['SQ', 'ROIContourSequence'], + '0040': ['SQ', 'ContourSequence'], + '0042': ['CS', 'ContourGeometricType'], + '0044': ['DS', 'ContourSlabThickness'], + '0045': ['DS', 'ContourOffsetVector'], + '0046': ['IS', 'NumberOfContourPoints'], + '0048': ['IS', 'ContourNumber'], + '0049': ['IS', 'AttachedContours'], + '0050': ['DS', 'ContourData'], + '0080': ['SQ', 'RTROIObservationsSequence'], + '0082': ['IS', 'ObservationNumber'], + '0084': ['IS', 'ReferencedROINumber'], + '0085': ['SH', 'ROIObservationLabel'], + '0086': ['SQ', 'RTROIIdentificationCodeSequence'], + '0088': ['ST', 'ROIObservationDescription'], + '00A0': ['SQ', 'RelatedRTROIObservationsSequence'], + '00A4': ['CS', 'RTROIInterpretedType'], + '00A6': ['PN', 'ROIInterpreter'], + '00B0': ['SQ', 'ROIPhysicalPropertiesSequence'], + '00B2': ['CS', 'ROIPhysicalProperty'], + '00B4': ['DS', 'ROIPhysicalPropertyValue'], + '00B6': ['SQ', 'ROIElementalCompositionSequence'], + '00B7': ['US', 'ROIElementalCompositionAtomicNumber'], + '00B8': ['FL', 'ROIElementalCompositionAtomicMassFraction'], + '00C0': ['SQ', 'FrameOfReferenceRelationshipSequence'], + '00C2': ['UI', 'RelatedFrameOfReferenceUID'], + '00C4': ['CS', 'FrameOfReferenceTransformationType'], + '00C6': ['DS', 'FrameOfReferenceTransformationMatrix'], + '00C8': ['LO', 'FrameOfReferenceTransformationComment'] + }, + 3008: { + '0010': ['SQ', 'MeasuredDoseReferenceSequence'], + '0012': ['ST', 'MeasuredDoseDescription'], + '0014': ['CS', 'MeasuredDoseType'], + '0016': ['DS', 'MeasuredDoseValue'], + '0020': ['SQ', 'TreatmentSessionBeamSequence'], + '0021': ['SQ', 'TreatmentSessionIonBeamSequence'], + '0022': ['IS', 'CurrentFractionNumber'], + '0024': ['DA', 'TreatmentControlPointDate'], + '0025': ['TM', 'TreatmentControlPointTime'], + '002A': ['CS', 'TreatmentTerminationStatus'], + '002B': ['SH', 'TreatmentTerminationCode'], + '002C': ['CS', 'TreatmentVerificationStatus'], + '0030': ['SQ', 'ReferencedTreatmentRecordSequence'], + '0032': ['DS', 'SpecifiedPrimaryMeterset'], + '0033': ['DS', 'SpecifiedSecondaryMeterset'], + '0036': ['DS', 'DeliveredPrimaryMeterset'], + '0037': ['DS', 'DeliveredSecondaryMeterset'], + '003A': ['DS', 'SpecifiedTreatmentTime'], + '003B': ['DS', 'DeliveredTreatmentTime'], + '0040': ['SQ', 'ControlPointDeliverySequence'], + '0041': ['SQ', 'IonControlPointDeliverySequence'], + '0042': ['DS', 'SpecifiedMeterset'], + '0044': ['DS', 'DeliveredMeterset'], + '0045': ['FL', 'MetersetRateSet'], + '0046': ['FL', 'MetersetRateDelivered'], + '0047': ['FL', 'ScanSpotMetersetsDelivered'], + '0048': ['DS', 'DoseRateDelivered'], + '0050': ['SQ', 'TreatmentSummaryCalculatedDoseReferenceSequence'], + '0052': ['DS', 'CumulativeDoseToDoseReference'], + '0054': ['DA', 'FirstTreatmentDate'], + '0056': ['DA', 'MostRecentTreatmentDate'], + '005A': ['IS', 'NumberOfFractionsDelivered'], + '0060': ['SQ', 'OverrideSequence'], + '0061': ['AT', 'ParameterSequencePointer'], + '0062': ['AT', 'OverrideParameterPointer'], + '0063': ['IS', 'ParameterItemIndex'], + '0064': ['IS', 'MeasuredDoseReferenceNumber'], + '0065': ['AT', 'ParameterPointer'], + '0066': ['ST', 'OverrideReason'], + '0068': ['SQ', 'CorrectedParameterSequence'], + '006A': ['FL', 'CorrectionValue'], + '0070': ['SQ', 'CalculatedDoseReferenceSequence'], + '0072': ['IS', 'CalculatedDoseReferenceNumber'], + '0074': ['ST', 'CalculatedDoseReferenceDescription'], + '0076': ['DS', 'CalculatedDoseReferenceDoseValue'], + '0078': ['DS', 'StartMeterset'], + '007A': ['DS', 'EndMeterset'], + '0080': ['SQ', 'ReferencedMeasuredDoseReferenceSequence'], + '0082': ['IS', 'ReferencedMeasuredDoseReferenceNumber'], + '0090': ['SQ', 'ReferencedCalculatedDoseReferenceSequence'], + '0092': ['IS', 'ReferencedCalculatedDoseReferenceNumber'], + '00A0': ['SQ', 'BeamLimitingDeviceLeafPairsSequence'], + '00B0': ['SQ', 'RecordedWedgeSequence'], + '00C0': ['SQ', 'RecordedCompensatorSequence'], + '00D0': ['SQ', 'RecordedBlockSequence'], + '00E0': ['SQ', 'TreatmentSummaryMeasuredDoseReferenceSequence'], + '00F0': ['SQ', 'RecordedSnoutSequence'], + '00F2': ['SQ', 'RecordedRangeShifterSequence'], + '00F4': ['SQ', 'RecordedLateralSpreadingDeviceSequence'], + '00F6': ['SQ', 'RecordedRangeModulatorSequence'], + '0100': ['SQ', 'RecordedSourceSequence'], + '0105': ['LO', 'SourceSerialNumber'], + '0110': ['SQ', 'TreatmentSessionApplicationSetupSequence'], + '0116': ['CS', 'ApplicationSetupCheck'], + '0120': ['SQ', 'RecordedBrachyAccessoryDeviceSequence'], + '0122': ['IS', 'ReferencedBrachyAccessoryDeviceNumber'], + '0130': ['SQ', 'RecordedChannelSequence'], + '0132': ['DS', 'SpecifiedChannelTotalTime'], + '0134': ['DS', 'DeliveredChannelTotalTime'], + '0136': ['IS', 'SpecifiedNumberOfPulses'], + '0138': ['IS', 'DeliveredNumberOfPulses'], + '013A': ['DS', 'SpecifiedPulseRepetitionInterval'], + '013C': ['DS', 'DeliveredPulseRepetitionInterval'], + '0140': ['SQ', 'RecordedSourceApplicatorSequence'], + '0142': ['IS', 'ReferencedSourceApplicatorNumber'], + '0150': ['SQ', 'RecordedChannelShieldSequence'], + '0152': ['IS', 'ReferencedChannelShieldNumber'], + '0160': ['SQ', 'BrachyControlPointDeliveredSequence'], + '0162': ['DA', 'SafePositionExitDate'], + '0164': ['TM', 'SafePositionExitTime'], + '0166': ['DA', 'SafePositionReturnDate'], + '0168': ['TM', 'SafePositionReturnTime'], + '0200': ['CS', 'CurrentTreatmentStatus'], + '0202': ['ST', 'TreatmentStatusComment'], + '0220': ['SQ', 'FractionGroupSummarySequence'], + '0223': ['IS', 'ReferencedFractionNumber'], + '0224': ['CS', 'FractionGroupType'], + '0230': ['CS', 'BeamStopperPosition'], + '0240': ['SQ', 'FractionStatusSummarySequence'], + '0250': ['DA', 'TreatmentDate'], + '0251': ['TM', 'TreatmentTime'] + }, + '300A': { + '0002': ['SH', 'RTPlanLabel'], + '0003': ['LO', 'RTPlanName'], + '0004': ['ST', 'RTPlanDescription'], + '0006': ['DA', 'RTPlanDate'], + '0007': ['TM', 'RTPlanTime'], + '0009': ['LO', 'TreatmentProtocols'], + '000A': ['CS', 'PlanIntent'], + '000B': ['LO', 'TreatmentSites'], + '000C': ['CS', 'RTPlanGeometry'], + '000E': ['ST', 'PrescriptionDescription'], + '0010': ['SQ', 'DoseReferenceSequence'], + '0012': ['IS', 'DoseReferenceNumber'], + '0013': ['UI', 'DoseReferenceUID'], + '0014': ['CS', 'DoseReferenceStructureType'], + '0015': ['CS', 'NominalBeamEnergyUnit'], + '0016': ['LO', 'DoseReferenceDescription'], + '0018': ['DS', 'DoseReferencePointCoordinates'], + '001A': ['DS', 'NominalPriorDose'], + '0020': ['CS', 'DoseReferenceType'], + '0021': ['DS', 'ConstraintWeight'], + '0022': ['DS', 'DeliveryWarningDose'], + '0023': ['DS', 'DeliveryMaximumDose'], + '0025': ['DS', 'TargetMinimumDose'], + '0026': ['DS', 'TargetPrescriptionDose'], + '0027': ['DS', 'TargetMaximumDose'], + '0028': ['DS', 'TargetUnderdoseVolumeFraction'], + '002A': ['DS', 'OrganAtRiskFullVolumeDose'], + '002B': ['DS', 'OrganAtRiskLimitDose'], + '002C': ['DS', 'OrganAtRiskMaximumDose'], + '002D': ['DS', 'OrganAtRiskOverdoseVolumeFraction'], + '0040': ['SQ', 'ToleranceTableSequence'], + '0042': ['IS', 'ToleranceTableNumber'], + '0043': ['SH', 'ToleranceTableLabel'], + '0044': ['DS', 'GantryAngleTolerance'], + '0046': ['DS', 'BeamLimitingDeviceAngleTolerance'], + '0048': ['SQ', 'BeamLimitingDeviceToleranceSequence'], + '004A': ['DS', 'BeamLimitingDevicePositionTolerance'], + '004B': ['FL', 'SnoutPositionTolerance'], + '004C': ['DS', 'PatientSupportAngleTolerance'], + '004E': ['DS', 'TableTopEccentricAngleTolerance'], + '004F': ['FL', 'TableTopPitchAngleTolerance'], + '0050': ['FL', 'TableTopRollAngleTolerance'], + '0051': ['DS', 'TableTopVerticalPositionTolerance'], + '0052': ['DS', 'TableTopLongitudinalPositionTolerance'], + '0053': ['DS', 'TableTopLateralPositionTolerance'], + '0055': ['CS', 'RTPlanRelationship'], + '0070': ['SQ', 'FractionGroupSequence'], + '0071': ['IS', 'FractionGroupNumber'], + '0072': ['LO', 'FractionGroupDescription'], + '0078': ['IS', 'NumberOfFractionsPlanned'], + '0079': ['IS', 'NumberOfFractionPatternDigitsPerDay'], + '007A': ['IS', 'RepeatFractionCycleLength'], + '007B': ['LT', 'FractionPattern'], + '0080': ['IS', 'NumberOfBeams'], + '0082': ['DS', 'BeamDoseSpecificationPoint'], + '0084': ['DS', 'BeamDose'], + '0086': ['DS', 'BeamMeterset'], + '0088': ['FL', 'BeamDosePointDepth'], + '0089': ['FL', 'BeamDosePointEquivalentDepth'], + '008A': ['FL', 'BeamDosePointSSD'], + '00A0': ['IS', 'NumberOfBrachyApplicationSetups'], + '00A2': ['DS', 'BrachyApplicationSetupDoseSpecificationPoint'], + '00A4': ['DS', 'BrachyApplicationSetupDose'], + '00B0': ['SQ', 'BeamSequence'], + '00B2': ['SH', 'TreatmentMachineName'], + '00B3': ['CS', 'PrimaryDosimeterUnit'], + '00B4': ['DS', 'SourceAxisDistance'], + '00B6': ['SQ', 'BeamLimitingDeviceSequence'], + '00B8': ['CS', 'RTBeamLimitingDeviceType'], + '00BA': ['DS', 'SourceToBeamLimitingDeviceDistance'], + '00BB': ['FL', 'IsocenterToBeamLimitingDeviceDistance'], + '00BC': ['IS', 'NumberOfLeafJawPairs'], + '00BE': ['DS', 'LeafPositionBoundaries'], + '00C0': ['IS', 'BeamNumber'], + '00C2': ['LO', 'BeamName'], + '00C3': ['ST', 'BeamDescription'], + '00C4': ['CS', 'BeamType'], + '00C6': ['CS', 'RadiationType'], + '00C7': ['CS', 'HighDoseTechniqueType'], + '00C8': ['IS', 'ReferenceImageNumber'], + '00CA': ['SQ', 'PlannedVerificationImageSequence'], + '00CC': ['LO', 'ImagingDeviceSpecificAcquisitionParameters'], + '00CE': ['CS', 'TreatmentDeliveryType'], + '00D0': ['IS', 'NumberOfWedges'], + '00D1': ['SQ', 'WedgeSequence'], + '00D2': ['IS', 'WedgeNumber'], + '00D3': ['CS', 'WedgeType'], + '00D4': ['SH', 'WedgeID'], + '00D5': ['IS', 'WedgeAngle'], + '00D6': ['DS', 'WedgeFactor'], + '00D7': ['FL', 'TotalWedgeTrayWaterEquivalentThickness'], + '00D8': ['DS', 'WedgeOrientation'], + '00D9': ['FL', 'IsocenterToWedgeTrayDistance'], + '00DA': ['DS', 'SourceToWedgeTrayDistance'], + '00DB': ['FL', 'WedgeThinEdgePosition'], + '00DC': ['SH', 'BolusID'], + '00DD': ['ST', 'BolusDescription'], + '00E0': ['IS', 'NumberOfCompensators'], + '00E1': ['SH', 'MaterialID'], + '00E2': ['DS', 'TotalCompensatorTrayFactor'], + '00E3': ['SQ', 'CompensatorSequence'], + '00E4': ['IS', 'CompensatorNumber'], + '00E5': ['SH', 'CompensatorID'], + '00E6': ['DS', 'SourceToCompensatorTrayDistance'], + '00E7': ['IS', 'CompensatorRows'], + '00E8': ['IS', 'CompensatorColumns'], + '00E9': ['DS', 'CompensatorPixelSpacing'], + '00EA': ['DS', 'CompensatorPosition'], + '00EB': ['DS', 'CompensatorTransmissionData'], + '00EC': ['DS', 'CompensatorThicknessData'], + '00ED': ['IS', 'NumberOfBoli'], + '00EE': ['CS', 'CompensatorType'], + '00F0': ['IS', 'NumberOfBlocks'], + '00F2': ['DS', 'TotalBlockTrayFactor'], + '00F3': ['FL', 'TotalBlockTrayWaterEquivalentThickness'], + '00F4': ['SQ', 'BlockSequence'], + '00F5': ['SH', 'BlockTrayID'], + '00F6': ['DS', 'SourceToBlockTrayDistance'], + '00F7': ['FL', 'IsocenterToBlockTrayDistance'], + '00F8': ['CS', 'BlockType'], + '00F9': ['LO', 'AccessoryCode'], + '00FA': ['CS', 'BlockDivergence'], + '00FB': ['CS', 'BlockMountingPosition'], + '00FC': ['IS', 'BlockNumber'], + '00FE': ['LO', 'BlockName'], + '0100': ['DS', 'BlockThickness'], + '0102': ['DS', 'BlockTransmission'], + '0104': ['IS', 'BlockNumberOfPoints'], + '0106': ['DS', 'BlockData'], + '0107': ['SQ', 'ApplicatorSequence'], + '0108': ['SH', 'ApplicatorID'], + '0109': ['CS', 'ApplicatorType'], + '010A': ['LO', 'ApplicatorDescription'], + '010C': ['DS', 'CumulativeDoseReferenceCoefficient'], + '010E': ['DS', 'FinalCumulativeMetersetWeight'], + '0110': ['IS', 'NumberOfControlPoints'], + '0111': ['SQ', 'ControlPointSequence'], + '0112': ['IS', 'ControlPointIndex'], + '0114': ['DS', 'NominalBeamEnergy'], + '0115': ['DS', 'DoseRateSet'], + '0116': ['SQ', 'WedgePositionSequence'], + '0118': ['CS', 'WedgePosition'], + '011A': ['SQ', 'BeamLimitingDevicePositionSequence'], + '011C': ['DS', 'LeafJawPositions'], + '011E': ['DS', 'GantryAngle'], + '011F': ['CS', 'GantryRotationDirection'], + '0120': ['DS', 'BeamLimitingDeviceAngle'], + '0121': ['CS', 'BeamLimitingDeviceRotationDirection'], + '0122': ['DS', 'PatientSupportAngle'], + '0123': ['CS', 'PatientSupportRotationDirection'], + '0124': ['DS', 'TableTopEccentricAxisDistance'], + '0125': ['DS', 'TableTopEccentricAngle'], + '0126': ['CS', 'TableTopEccentricRotationDirection'], + '0128': ['DS', 'TableTopVerticalPosition'], + '0129': ['DS', 'TableTopLongitudinalPosition'], + '012A': ['DS', 'TableTopLateralPosition'], + '012C': ['DS', 'IsocenterPosition'], + '012E': ['DS', 'SurfaceEntryPoint'], + '0130': ['DS', 'SourceToSurfaceDistance'], + '0134': ['DS', 'CumulativeMetersetWeight'], + '0140': ['FL', 'TableTopPitchAngle'], + '0142': ['CS', 'TableTopPitchRotationDirection'], + '0144': ['FL', 'TableTopRollAngle'], + '0146': ['CS', 'TableTopRollRotationDirection'], + '0148': ['FL', 'HeadFixationAngle'], + '014A': ['FL', 'GantryPitchAngle'], + '014C': ['CS', 'GantryPitchRotationDirection'], + '014E': ['FL', 'GantryPitchAngleTolerance'], + '0180': ['SQ', 'PatientSetupSequence'], + '0182': ['IS', 'PatientSetupNumber'], + '0183': ['LO', 'PatientSetupLabel'], + '0184': ['LO', 'PatientAdditionalPosition'], + '0190': ['SQ', 'FixationDeviceSequence'], + '0192': ['CS', 'FixationDeviceType'], + '0194': ['SH', 'FixationDeviceLabel'], + '0196': ['ST', 'FixationDeviceDescription'], + '0198': ['SH', 'FixationDevicePosition'], + '0199': ['FL', 'FixationDevicePitchAngle'], + '019A': ['FL', 'FixationDeviceRollAngle'], + '01A0': ['SQ', 'ShieldingDeviceSequence'], + '01A2': ['CS', 'ShieldingDeviceType'], + '01A4': ['SH', 'ShieldingDeviceLabel'], + '01A6': ['ST', 'ShieldingDeviceDescription'], + '01A8': ['SH', 'ShieldingDevicePosition'], + '01B0': ['CS', 'SetupTechnique'], + '01B2': ['ST', 'SetupTechniqueDescription'], + '01B4': ['SQ', 'SetupDeviceSequence'], + '01B6': ['CS', 'SetupDeviceType'], + '01B8': ['SH', 'SetupDeviceLabel'], + '01BA': ['ST', 'SetupDeviceDescription'], + '01BC': ['DS', 'SetupDeviceParameter'], + '01D0': ['ST', 'SetupReferenceDescription'], + '01D2': ['DS', 'TableTopVerticalSetupDisplacement'], + '01D4': ['DS', 'TableTopLongitudinalSetupDisplacement'], + '01D6': ['DS', 'TableTopLateralSetupDisplacement'], + '0200': ['CS', 'BrachyTreatmentTechnique'], + '0202': ['CS', 'BrachyTreatmentType'], + '0206': ['SQ', 'TreatmentMachineSequence'], + '0210': ['SQ', 'SourceSequence'], + '0212': ['IS', 'SourceNumber'], + '0214': ['CS', 'SourceType'], + '0216': ['LO', 'SourceManufacturer'], + '0218': ['DS', 'ActiveSourceDiameter'], + '021A': ['DS', 'ActiveSourceLength'], + '0222': ['DS', 'SourceEncapsulationNominalThickness'], + '0224': ['DS', 'SourceEncapsulationNominalTransmission'], + '0226': ['LO', 'SourceIsotopeName'], + '0228': ['DS', 'SourceIsotopeHalfLife'], + '0229': ['CS', 'SourceStrengthUnits'], + '022A': ['DS', 'ReferenceAirKermaRate'], + '022B': ['DS', 'SourceStrength'], + '022C': ['DA', 'SourceStrengthReferenceDate'], + '022E': ['TM', 'SourceStrengthReferenceTime'], + '0230': ['SQ', 'ApplicationSetupSequence'], + '0232': ['CS', 'ApplicationSetupType'], + '0234': ['IS', 'ApplicationSetupNumber'], + '0236': ['LO', 'ApplicationSetupName'], + '0238': ['LO', 'ApplicationSetupManufacturer'], + '0240': ['IS', 'TemplateNumber'], + '0242': ['SH', 'TemplateType'], + '0244': ['LO', 'TemplateName'], + '0250': ['DS', 'TotalReferenceAirKerma'], + '0260': ['SQ', 'BrachyAccessoryDeviceSequence'], + '0262': ['IS', 'BrachyAccessoryDeviceNumber'], + '0263': ['SH', 'BrachyAccessoryDeviceID'], + '0264': ['CS', 'BrachyAccessoryDeviceType'], + '0266': ['LO', 'BrachyAccessoryDeviceName'], + '026A': ['DS', 'BrachyAccessoryDeviceNominalThickness'], + '026C': ['DS', 'BrachyAccessoryDeviceNominalTransmission'], + '0280': ['SQ', 'ChannelSequence'], + '0282': ['IS', 'ChannelNumber'], + '0284': ['DS', 'ChannelLength'], + '0286': ['DS', 'ChannelTotalTime'], + '0288': ['CS', 'SourceMovementType'], + '028A': ['IS', 'NumberOfPulses'], + '028C': ['DS', 'PulseRepetitionInterval'], + '0290': ['IS', 'SourceApplicatorNumber'], + '0291': ['SH', 'SourceApplicatorID'], + '0292': ['CS', 'SourceApplicatorType'], + '0294': ['LO', 'SourceApplicatorName'], + '0296': ['DS', 'SourceApplicatorLength'], + '0298': ['LO', 'SourceApplicatorManufacturer'], + '029C': ['DS', 'SourceApplicatorWallNominalThickness'], + '029E': ['DS', 'SourceApplicatorWallNominalTransmission'], + '02A0': ['DS', 'SourceApplicatorStepSize'], + '02A2': ['IS', 'TransferTubeNumber'], + '02A4': ['DS', 'TransferTubeLength'], + '02B0': ['SQ', 'ChannelShieldSequence'], + '02B2': ['IS', 'ChannelShieldNumber'], + '02B3': ['SH', 'ChannelShieldID'], + '02B4': ['LO', 'ChannelShieldName'], + '02B8': ['DS', 'ChannelShieldNominalThickness'], + '02BA': ['DS', 'ChannelShieldNominalTransmission'], + '02C8': ['DS', 'FinalCumulativeTimeWeight'], + '02D0': ['SQ', 'BrachyControlPointSequence'], + '02D2': ['DS', 'ControlPointRelativePosition'], + '02D4': ['DS', 'ControlPoint3DPosition'], + '02D6': ['DS', 'CumulativeTimeWeight'], + '02E0': ['CS', 'CompensatorDivergence'], + '02E1': ['CS', 'CompensatorMountingPosition'], + '02E2': ['DS', 'SourceToCompensatorDistance'], + '02E3': ['FL', 'TotalCompensatorTrayWaterEquivalentThickness'], + '02E4': ['FL', 'IsocenterToCompensatorTrayDistance'], + '02E5': ['FL', 'CompensatorColumnOffset'], + '02E6': ['FL', 'IsocenterToCompensatorDistances'], + '02E7': ['FL', 'CompensatorRelativeStoppingPowerRatio'], + '02E8': ['FL', 'CompensatorMillingToolDiameter'], + '02EA': ['SQ', 'IonRangeCompensatorSequence'], + '02EB': ['LT', 'CompensatorDescription'], + '0302': ['IS', 'RadiationMassNumber'], + '0304': ['IS', 'RadiationAtomicNumber'], + '0306': ['SS', 'RadiationChargeState'], + '0308': ['CS', 'ScanMode'], + '030A': ['FL', 'VirtualSourceAxisDistances'], + '030C': ['SQ', 'SnoutSequence'], + '030D': ['FL', 'SnoutPosition'], + '030F': ['SH', 'SnoutID'], + '0312': ['IS', 'NumberOfRangeShifters'], + '0314': ['SQ', 'RangeShifterSequence'], + '0316': ['IS', 'RangeShifterNumber'], + '0318': ['SH', 'RangeShifterID'], + '0320': ['CS', 'RangeShifterType'], + '0322': ['LO', 'RangeShifterDescription'], + '0330': ['IS', 'NumberOfLateralSpreadingDevices'], + '0332': ['SQ', 'LateralSpreadingDeviceSequence'], + '0334': ['IS', 'LateralSpreadingDeviceNumber'], + '0336': ['SH', 'LateralSpreadingDeviceID'], + '0338': ['CS', 'LateralSpreadingDeviceType'], + '033A': ['LO', 'LateralSpreadingDeviceDescription'], + '033C': ['FL', 'LateralSpreadingDeviceWaterEquivalentThickness'], + '0340': ['IS', 'NumberOfRangeModulators'], + '0342': ['SQ', 'RangeModulatorSequence'], + '0344': ['IS', 'RangeModulatorNumber'], + '0346': ['SH', 'RangeModulatorID'], + '0348': ['CS', 'RangeModulatorType'], + '034A': ['LO', 'RangeModulatorDescription'], + '034C': ['SH', 'BeamCurrentModulationID'], + '0350': ['CS', 'PatientSupportType'], + '0352': ['SH', 'PatientSupportID'], + '0354': ['LO', 'PatientSupportAccessoryCode'], + '0356': ['FL', 'FixationLightAzimuthalAngle'], + '0358': ['FL', 'FixationLightPolarAngle'], + '035A': ['FL', 'MetersetRate'], + '0360': ['SQ', 'RangeShifterSettingsSequence'], + '0362': ['LO', 'RangeShifterSetting'], + '0364': ['FL', 'IsocenterToRangeShifterDistance'], + '0366': ['FL', 'RangeShifterWaterEquivalentThickness'], + '0370': ['SQ', 'LateralSpreadingDeviceSettingsSequence'], + '0372': ['LO', 'LateralSpreadingDeviceSetting'], + '0374': ['FL', 'IsocenterToLateralSpreadingDeviceDistance'], + '0380': ['SQ', 'RangeModulatorSettingsSequence'], + '0382': ['FL', 'RangeModulatorGatingStartValue'], + '0384': ['FL', 'RangeModulatorGatingStopValue'], + '0386': ['FL', 'RangeModulatorGatingStartWaterEquivalentThickness'], + '0388': ['FL', 'RangeModulatorGatingStopWaterEquivalentThickness'], + '038A': ['FL', 'IsocenterToRangeModulatorDistance'], + '0390': ['SH', 'ScanSpotTuneID'], + '0392': ['IS', 'NumberOfScanSpotPositions'], + '0394': ['FL', 'ScanSpotPositionMap'], + '0396': ['FL', 'ScanSpotMetersetWeights'], + '0398': ['FL', 'ScanningSpotSize'], + '039A': ['IS', 'NumberOfPaintings'], + '03A0': ['SQ', 'IonToleranceTableSequence'], + '03A2': ['SQ', 'IonBeamSequence'], + '03A4': ['SQ', 'IonBeamLimitingDeviceSequence'], + '03A6': ['SQ', 'IonBlockSequence'], + '03A8': ['SQ', 'IonControlPointSequence'], + '03AA': ['SQ', 'IonWedgeSequence'], + '03AC': ['SQ', 'IonWedgePositionSequence'], + '0401': ['SQ', 'ReferencedSetupImageSequence'], + '0402': ['ST', 'SetupImageComment'], + '0410': ['SQ', 'MotionSynchronizationSequence'], + '0412': ['FL', 'ControlPointOrientation'], + '0420': ['SQ', 'GeneralAccessorySequence'], + '0421': ['SH', 'GeneralAccessoryID'], + '0422': ['ST', 'GeneralAccessoryDescription'], + '0423': ['CS', 'GeneralAccessoryType'], + '0424': ['IS', 'GeneralAccessoryNumber'], + '0431': ['SQ', 'ApplicatorGeometrySequence'], + '0432': ['CS', 'ApplicatorApertureShape'], + '0433': ['FL', 'ApplicatorOpening'], + '0434': ['FL', 'ApplicatorOpeningX'], + '0435': ['FL', 'ApplicatorOpeningY'], + '0436': ['FL', 'SourceToApplicatorMountingPositionDistance'] + }, + '300C': { + '0002': ['SQ', 'ReferencedRTPlanSequence'], + '0004': ['SQ', 'ReferencedBeamSequence'], + '0006': ['IS', 'ReferencedBeamNumber'], + '0007': ['IS', 'ReferencedReferenceImageNumber'], + '0008': ['DS', 'StartCumulativeMetersetWeight'], + '0009': ['DS', 'EndCumulativeMetersetWeight'], + '000A': ['SQ', 'ReferencedBrachyApplicationSetupSequence'], + '000C': ['IS', 'ReferencedBrachyApplicationSetupNumber'], + '000E': ['IS', 'ReferencedSourceNumber'], + '0020': ['SQ', 'ReferencedFractionGroupSequence'], + '0022': ['IS', 'ReferencedFractionGroupNumber'], + '0040': ['SQ', 'ReferencedVerificationImageSequence'], + '0042': ['SQ', 'ReferencedReferenceImageSequence'], + '0050': ['SQ', 'ReferencedDoseReferenceSequence'], + '0051': ['IS', 'ReferencedDoseReferenceNumber'], + '0055': ['SQ', 'BrachyReferencedDoseReferenceSequence'], + '0060': ['SQ', 'ReferencedStructureSetSequence'], + '006A': ['IS', 'ReferencedPatientSetupNumber'], + '0080': ['SQ', 'ReferencedDoseSequence'], + '00A0': ['IS', 'ReferencedToleranceTableNumber'], + '00B0': ['SQ', 'ReferencedBolusSequence'], + '00C0': ['IS', 'ReferencedWedgeNumber'], + '00D0': ['IS', 'ReferencedCompensatorNumber'], + '00E0': ['IS', 'ReferencedBlockNumber'], + '00F0': ['IS', 'ReferencedControlPointIndex'], + '00F2': ['SQ', 'ReferencedControlPointSequence'], + '00F4': ['IS', 'ReferencedStartControlPointIndex'], + '00F6': ['IS', 'ReferencedStopControlPointIndex'], + '0100': ['IS', 'ReferencedRangeShifterNumber'], + '0102': ['IS', 'ReferencedLateralSpreadingDeviceNumber'], + '0104': ['IS', 'ReferencedRangeModulatorNumber'] + }, + '300E': { + '0002': ['CS', 'ApprovalStatus'], + '0004': ['DA', 'ReviewDate'], + '0005': ['TM', 'ReviewTime'], + '0008': ['PN', 'ReviewerName'] + }, + 4000: { + '0010': ['LT', 'Arbitrary'], + 4000: ['LT', 'TextComments'] + }, + 4008: { + '0040': ['SH', 'ResultsID'], + '0042': ['LO', 'ResultsIDIssuer'], + '0050': ['SQ', 'ReferencedInterpretationSequence'], + '00FF': ['CS', 'ReportProductionStatusTrial'], + '0100': ['DA', 'InterpretationRecordedDate'], + '0101': ['TM', 'InterpretationRecordedTime'], + '0102': ['PN', 'InterpretationRecorder'], + '0103': ['LO', 'ReferenceToRecordedSound'], + '0108': ['DA', 'InterpretationTranscriptionDate'], + '0109': ['TM', 'InterpretationTranscriptionTime'], + '010A': ['PN', 'InterpretationTranscriber'], + '010B': ['ST', 'InterpretationText'], + '010C': ['PN', 'InterpretationAuthor'], + '0111': ['SQ', 'InterpretationApproverSequence'], + '0112': ['DA', 'InterpretationApprovalDate'], + '0113': ['TM', 'InterpretationApprovalTime'], + '0114': ['PN', 'PhysicianApprovingInterpretation'], + '0115': ['LT', 'InterpretationDiagnosisDescription'], + '0117': ['SQ', 'InterpretationDiagnosisCodeSequence'], + '0118': ['SQ', 'ResultsDistributionListSequence'], + '0119': ['PN', 'DistributionName'], + '011A': ['LO', 'DistributionAddress'], + '0200': ['SH', 'InterpretationID'], + '0202': ['LO', 'InterpretationIDIssuer'], + '0210': ['CS', 'InterpretationTypeID'], + '0212': ['CS', 'InterpretationStatusID'], + '0300': ['ST', 'Impressions'], + 4000: ['ST', 'ResultsComments'] + }, + 4010: { + '0001': ['CS', 'LowEnergyDetectors'], + '0002': ['CS', 'HighEnergyDetectors'], + '0004': ['SQ', 'DetectorGeometrySequence'], + 1001: ['SQ', 'ThreatROIVoxelSequence'], + 1004: ['FL', 'ThreatROIBase'], + 1005: ['FL', 'ThreatROIExtents'], + 1006: ['OB', 'ThreatROIBitmap'], + 1007: ['SH', 'RouteSegmentID'], + 1008: ['CS', 'GantryType'], + 1009: ['CS', 'OOIOwnerType'], + '100A': ['SQ', 'RouteSegmentSequence'], + 1010: ['US', 'PotentialThreatObjectID'], + 1011: ['SQ', 'ThreatSequence'], + 1012: ['CS', 'ThreatCategory'], + 1013: ['LT', 'ThreatCategoryDescription'], + 1014: ['CS', 'ATDAbilityAssessment'], + 1015: ['CS', 'ATDAssessmentFlag'], + 1016: ['FL', 'ATDAssessmentProbability'], + 1017: ['FL', 'Mass'], + 1018: ['FL', 'Density'], + 1019: ['FL', 'ZEffective'], + '101A': ['SH', 'BoardingPassID'], + '101B': ['FL', 'CenterOfMass'], + '101C': ['FL', 'CenterOfPTO'], + '101D': ['FL', 'BoundingPolygon'], + '101E': ['SH', 'RouteSegmentStartLocationID'], + '101F': ['SH', 'RouteSegmentEndLocationID'], + 1020: ['CS', 'RouteSegmentLocationIDType'], + 1021: ['CS', 'AbortReason'], + 1023: ['FL', 'VolumeOfPTO'], + 1024: ['CS', 'AbortFlag'], + 1025: ['DT', 'RouteSegmentStartTime'], + 1026: ['DT', 'RouteSegmentEndTime'], + 1027: ['CS', 'TDRType'], + 1028: ['CS', 'InternationalRouteSegment'], + 1029: ['LO', 'ThreatDetectionAlgorithmandVersion'], + '102A': ['SH', 'AssignedLocation'], + '102B': ['DT', 'AlarmDecisionTime'], + 1031: ['CS', 'AlarmDecision'], + 1033: ['US', 'NumberOfTotalObjects'], + 1034: ['US', 'NumberOfAlarmObjects'], + 1037: ['SQ', 'PTORepresentationSequence'], + 1038: ['SQ', 'ATDAssessmentSequence'], + 1039: ['CS', 'TIPType'], + '103A': ['CS', 'DICOSVersion'], + 1041: ['DT', 'OOIOwnerCreationTime'], + 1042: ['CS', 'OOIType'], + 1043: ['FL', 'OOISize'], + 1044: ['CS', 'AcquisitionStatus'], + 1045: ['SQ', 'BasisMaterialsCodeSequence'], + 1046: ['CS', 'PhantomType'], + 1047: ['SQ', 'OOIOwnerSequence'], + 1048: ['CS', 'ScanType'], + 1051: ['LO', 'ItineraryID'], + 1052: ['SH', 'ItineraryIDType'], + 1053: ['LO', 'ItineraryIDAssigningAuthority'], + 1054: ['SH', 'RouteID'], + 1055: ['SH', 'RouteIDAssigningAuthority'], + 1056: ['CS', 'InboundArrivalType'], + 1058: ['SH', 'CarrierID'], + 1059: ['CS', 'CarrierIDAssigningAuthority'], + 1060: ['FL', 'SourceOrientation'], + 1061: ['FL', 'SourcePosition'], + 1062: ['FL', 'BeltHeight'], + 1064: ['SQ', 'AlgorithmRoutingCodeSequence'], + 1067: ['CS', 'TransportClassification'], + 1068: ['LT', 'OOITypeDescriptor'], + 1069: ['FL', 'TotalProcessingTime'], + '106C': ['OB', 'DetectorCalibrationData'] + } +} -/*** Static Methods ***/ +/** * Static Methods ***/ /** * Returns the VR for the specified group and element. @@ -3635,37 +3617,35 @@ daikon.Dictionary.dict = { * @param {number} element * @returns {string} */ -daikon.Dictionary.getVR = function (group, element) { - var vr, elementData, groupData; - - groupData = daikon.Dictionary.dict[daikon.Utils.dec2hex(group)]; - if (groupData) { - elementData = groupData[daikon.Utils.dec2hex(element)]; - if (elementData) { - vr = elementData[0]; - } else if (element === 0) { - vr = 'UL'; - } - } +export const getVR = (group, element) => { + let vr, elementData, groupData - if (!vr) { - groupData = daikon.Dictionary.dictPrivate[daikon.Utils.dec2hex(group)]; - if (groupData) { - elementData = groupData[daikon.Utils.dec2hex(element)]; - if (elementData) { - vr = elementData[0]; - } - } + groupData = dict[dec2hex(group)] + if (groupData) { + elementData = groupData[dec2hex(element)] + if (elementData) { + vr = elementData[0] + } else if (element === 0) { + vr = 'UL' } + } - if (!vr) { - vr = 'OB'; + if (!vr) { + groupData = dictPrivate[dec2hex(group)] + if (groupData) { + elementData = groupData[dec2hex(element)] + if (elementData) { + vr = elementData[0] + } } + } - return vr; -}; - + if (!vr) { + vr = 'OB' + } + return vr +} /** * Returns the description for the specified group and element. @@ -3673,40 +3653,32 @@ daikon.Dictionary.getVR = function (group, element) { * @param {number} element * @returns {string} */ -daikon.Dictionary.getDescription = function (group, element) { - var des, elementData, groupData; +export const getDescription = (group, element) => { + let des, elementData, groupData - groupData = daikon.Dictionary.dict[daikon.Utils.dec2hex(group)]; - if (groupData) { - elementData = groupData[daikon.Utils.dec2hex(element)]; - if (elementData) { - des = elementData[1]; - } else if (element === 0) { - des = ("Group " + daikon.Utils.dec2hex(group) + " Length"); - } - } - - if (!des) { - groupData = daikon.Dictionary.dictPrivate[daikon.Utils.dec2hex(group)]; - if (groupData) { - elementData = groupData[daikon.Utils.dec2hex(element)]; - if (elementData) { - des = elementData[1]; - } - } + groupData = dict[dec2hex(group)] + if (groupData) { + elementData = groupData[dec2hex(element)] + if (elementData) { + des = elementData[1] + } else if (element === 0) { + des = 'Group ' + dec2hex(group) + ' Length' } + } - if (!des) { - des = 'PrivateData'; + if (!des) { + groupData = dictPrivate[dec2hex(group)] + if (groupData) { + elementData = groupData[dec2hex(element)] + if (elementData) { + des = elementData[1] + } } + } - return des; -}; - - -/*** Exports ***/ + if (!des) { + des = 'PrivateData' + } -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Dictionary; + return des } diff --git a/src/image.js b/src/image.js index 37f639c..9b89cea 100644 --- a/src/image.js +++ b/src/image.js @@ -1,1649 +1,1523 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.Tag = daikon.Tag || ((typeof require !== 'undefined') ? require('./tag.js') : null); -daikon.CompressionUtils = daikon.CompressionUtils || ((typeof require !== 'undefined') ? require('./compression-utils.js') : null); -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); -daikon.RLE = daikon.RLE || ((typeof require !== 'undefined') ? require('./rle.js') : null); - -var jpeg = ((typeof require !== 'undefined') ? require('jpeg-lossless-decoder-js') : null); -var JpegDecoder = JpegDecoder || ((typeof require !== 'undefined') ? require('../lib/jpeg-baseline.js').JpegImage : null); -var JpxImage = JpxImage || ((typeof require !== 'undefined') ? require('../lib/jpx.js') : null); -var JpegLSDecoder = JpegLSDecoder || ((typeof require !== 'undefined') ? require('../lib/jpeg-ls.js') : null); - - -/*** Constructor ***/ - -/** - * The Image constructor. - * @property {object} tags - a map of tag id to tag (see daikon.Tag.createId) - * @property {object} tagsFlat - a flattened map of tags - * @type {Function} - */ -daikon.Image = daikon.Image || function () { - this.tags = {}; - this.tagsFlat = {}; - this.littleEndian = false; - this.index = -1; - this.decompressed = false; - this.privateDataAll = null; - this.convertedPalette = false; -}; - - -/*** Static Pseudo-constants ***/ - -daikon.Image.SLICE_DIRECTION_UNKNOWN = -1; -daikon.Image.SLICE_DIRECTION_AXIAL = 2; -daikon.Image.SLICE_DIRECTION_CORONAL = 1; -daikon.Image.SLICE_DIRECTION_SAGITTAL = 0; -daikon.Image.SLICE_DIRECTION_OBLIQUE = 3; -daikon.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE = 0.8; - -daikon.Image.BYTE_TYPE_UNKNOWN = 0; -daikon.Image.BYTE_TYPE_BINARY = 1; -daikon.Image.BYTE_TYPE_INTEGER = 2; -daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED = 3; -daikon.Image.BYTE_TYPE_FLOAT = 4; -daikon.Image.BYTE_TYPE_COMPLEX = 5; -daikon.Image.BYTE_TYPE_RGB = 6; - - -/*** Static Methods ***/ - -daikon.Image.skipPaletteConversion = false; - - -daikon.Image.getSingleValueSafely = function (tag, index) { +import jpeg from 'jpeg-lossless-decoder-js' +import { JpxImage } from 'jpeg2000' +import { JpegImage } from '../lib/jpeg-baseline.js' +import { JpegLS } from '../lib/jpeg-ls.js' + +import { Tag } from './tag.js' +import { MAX_VALUE, MIN_VALUE, concatArrayBuffers2, createBitMask, fillBuffer } from './utilities.js' +import { RLE } from './rle.js' +import { Parser } from './parser.js' +import { isHeaderJPEG, isHeaderJPEG2000 } from './compression-utils.js' + +export class Image { + static SLICE_DIRECTION_UNKNOWN = -1 + static SLICE_DIRECTION_AXIAL = 2 + static SLICE_DIRECTION_CORONAL = 1 + static SLICE_DIRECTION_SAGITTAL = 0 + static SLICE_DIRECTION_OBLIQUE = 3 + static OBLIQUITY_THRESHOLD_COSINE_VALUE = 0.8 + static BYTE_TYPE_UNKNOWN = 0 + static BYTE_TYPE_BINARY = 1 + static BYTE_TYPE_INTEGER = 2 + static BYTE_TYPE_INTEGER_UNSIGNED = 3 + static BYTE_TYPE_FLOAT = 4 + static BYTE_TYPE_COMPLEX = 5 + static BYTE_TYPE_RGB = 6 + + tags = {} // a map of tag id to tag (see Tag.createId) + tagsFlat = {} // a flattened map of tags + littleEndian = false + index = -1 + decompressed = false + privateDataAll = null + convertedPalette = false + skipPaletteConversion = false + + getSingleValueSafely(tag, index) { if (tag && tag.value) { - return tag.value[index]; + return tag.value[index] } - return null; -}; - + return null + } - -daikon.Image.getValueSafely = function (tag) { + getValueSafely(tag) { if (tag) { - return tag.value; + return tag.value } - return null; -}; - + return null + } + // originally from: http://public.kitware.com/pipermail/insight-users/2005-March/012246.html + getMajorAxisFromPatientRelativeDirectionCosine(x, y, z) { + const orientationX = x < 0 ? 'R' : 'L' + const orientationY = y < 0 ? 'A' : 'P' + const orientationZ = z < 0 ? 'F' : 'H' -// originally from: http://public.kitware.com/pipermail/insight-users/2005-March/012246.html -daikon.Image.getMajorAxisFromPatientRelativeDirectionCosine = function(x, y, z) { - var axis, orientationX, orientationY, orientationZ, absX, absY, absZ; - - orientationX = (x < 0) ? "R" : "L"; - orientationY = (y < 0) ? "A" : "P"; - orientationZ = (z < 0) ? "F" : "H"; - - absX = Math.abs(x); - absY = Math.abs(y); - absZ = Math.abs(z); + const absX = Math.abs(x) + const absY = Math.abs(y) + const absZ = Math.abs(z) // The tests here really don't need to check the other dimensions, // just the threshold, since the sum of the squares should be == 1.0 // but just in case ... - if ((absX > daikon.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE) && (absX > absY) && (absX > absZ)) { - axis = orientationX; - } else if ((absY > daikon.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE) && (absY > absX) && (absY > absZ)) { - axis = orientationY; - } else if ((absZ > daikon.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE) && (absZ > absX) && (absZ > absY)) { - axis = orientationZ; + let axis + if (absX > Image.OBLIQUITY_THRESHOLD_COSINE_VALUE && absX > absY && absX > absZ) { + axis = orientationX + } else if (absY > Image.OBLIQUITY_THRESHOLD_COSINE_VALUE && absY > absX && absY > absZ) { + axis = orientationY + } else if (absZ > Image.OBLIQUITY_THRESHOLD_COSINE_VALUE && absZ > absX && absZ > absY) { + axis = orientationZ } else { - axis = null; + axis = null } - return axis; -}; - - -/*** Prototype Methods ***/ - -/** - * Returns the number of columns. - * @returns {number} - */ -daikon.Image.prototype.getCols = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_COLS[0], daikon.Tag.TAG_COLS[1]), 0); -}; - - - -/** - * Returns the number of rows. - * @returns {number} - */ -daikon.Image.prototype.getRows = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_ROWS[0], daikon.Tag.TAG_ROWS[1]), 0); -}; - - - -/** - * Returns the series description. - * @returns {string} - */ -daikon.Image.prototype.getSeriesDescription = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SERIES_DESCRIPTION[0], daikon.Tag.TAG_SERIES_DESCRIPTION[1]), 0); -}; - - - -/** - * Returns the series instance UID. - * @returns {string} - */ -daikon.Image.prototype.getSeriesInstanceUID = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SERIES_INSTANCE_UID[0], daikon.Tag.TAG_SERIES_INSTANCE_UID[1]), 0); -}; - - - -/** - * Returns the series number. - * @returns {number} - */ -daikon.Image.prototype.getSeriesNumber = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SERIES_NUMBER[0], daikon.Tag.TAG_SERIES_NUMBER[1]), 0); -}; - - - -/** - * Returns the echo number. - * @returns {number} - */ -daikon.Image.prototype.getEchoNumber = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_ECHO_NUMBER[0], daikon.Tag.TAG_ECHO_NUMBER[1]), 0); -}; - - - -/** - * Returns the image position. - * @return {number[]} - */ -daikon.Image.prototype.getImagePosition = function () { - return daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_POSITION[0], daikon.Tag.TAG_IMAGE_POSITION[1])); -}; - -/** - * Returns the image axis directions - * @return {number[]} - */ -daikon.Image.prototype.getImageDirections = function () { - return daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_ORIENTATION[0], daikon.Tag.TAG_IMAGE_ORIENTATION[1])) -}; - - -/** - * Returns the image position value by index. - * @param {number} sliceDir - the index - * @returns {number} - */ -daikon.Image.prototype.getImagePositionSliceDir = function (sliceDir) { - var imagePos = daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_POSITION[0], daikon.Tag.TAG_IMAGE_POSITION[1])); + return axis + } + + /** + * Returns the number of columns. + * @returns {number} + */ + getCols() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_COLS[0], Tag.TAG_COLS[1]), 0) + } + + /** + * Returns the number of rows. + * @returns {number} + */ + getRows() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_ROWS[0], Tag.TAG_ROWS[1]), 0) + } + + /** + * Returns the series description. + * @returns {string} + */ + getSeriesDescription() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SERIES_DESCRIPTION[0], Tag.TAG_SERIES_DESCRIPTION[1]), 0) + } + + /** + * Returns the series instance UID. + * @returns {string} + */ + getSeriesInstanceUID() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SERIES_INSTANCE_UID[0], Tag.TAG_SERIES_INSTANCE_UID[1]), 0) + } + + /** + * Returns the series number. + * @returns {number} + */ + getSeriesNumber() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SERIES_NUMBER[0], Tag.TAG_SERIES_NUMBER[1]), 0) + } + + /** + * Returns the echo number. + * @returns {number} + */ + getEchoNumber() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_ECHO_NUMBER[0], Tag.TAG_ECHO_NUMBER[1]), 0) + } + + /** + * Returns the image position. + * @return {number[]} + */ + getImagePosition() { + return this.getValueSafely(this.getTag(Tag.TAG_IMAGE_POSITION[0], Tag.TAG_IMAGE_POSITION[1])) + } + + /** + * Returns the image axis directions + * @return {number[]} + */ + getImageDirections() { + return this.getValueSafely(this.getTag(Tag.TAG_IMAGE_ORIENTATION[0], Tag.TAG_IMAGE_ORIENTATION[1])) + } + + /** + * Returns the image position value by index. + * @param {number} sliceDir - the index + * @returns {number} + */ + getImagePositionSliceDir(sliceDir) { + const imagePos = this.getValueSafely(this.getTag(Tag.TAG_IMAGE_POSITION[0], Tag.TAG_IMAGE_POSITION[1])) if (imagePos) { - if (sliceDir >= 0) { - return imagePos[sliceDir]; - } + if (sliceDir >= 0) { + return imagePos[sliceDir] + } } - return 0; -}; - - -/** - * Returns the modality - * @returns {string} - */ -daikon.Image.prototype.getModality = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_MODALITY[0], daikon.Tag.TAG_MODALITY[1]), 0); -}; - - -/** - * Returns the slice location. - * @returns {number} - */ -daikon.Image.prototype.getSliceLocation = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SLICE_LOCATION[0], daikon.Tag.TAG_SLICE_LOCATION[1]), 0); -}; - - - -/** - * Returns the slice location vector. - * @returns {number[]} - */ -daikon.Image.prototype.getSliceLocationVector = function () { - return daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_SLICE_LOCATION_VECTOR[0], daikon.Tag.TAG_SLICE_LOCATION_VECTOR[1])); -}; - - - -/** - * Returns the image number. - * @returns {number} - */ -daikon.Image.prototype.getImageNumber = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_NUM[0], daikon.Tag.TAG_IMAGE_NUM[1]), 0); -}; - - -/** - * Returns the temporal position. - * @returns {number} - */ -daikon.Image.prototype.getTemporalPosition = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_TEMPORAL_POSITION[0], daikon.Tag.TAG_TEMPORAL_POSITION[1]), 0); -}; - - -/** - * Returns the temporal number. - * @returns {number} - */ -daikon.Image.prototype.getTemporalNumber = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0], daikon.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]), 0); -}; - - -/** - * Returns the slice gap. - * @returns {number} - */ -daikon.Image.prototype.getSliceGap = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SLICE_GAP[0], daikon.Tag.TAG_SLICE_GAP[1]), 0); -}; - - -/** - * Returns the slice thickness. - * @returns {number} - */ -daikon.Image.prototype.getSliceThickness = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SLICE_THICKNESS[0], daikon.Tag.TAG_SLICE_THICKNESS[1]), 0); -}; - - -/** - * Returns the image maximum. - * @returns {number} - */ -daikon.Image.prototype.getImageMax = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_MAX[0], daikon.Tag.TAG_IMAGE_MAX[1]), 0); -}; - - -/** - * Returns the image minimum. - * @returns {number} - */ -daikon.Image.prototype.getImageMin = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_MIN[0], daikon.Tag.TAG_IMAGE_MIN[1]), 0); -}; - - -/** - * Returns the rescale slope. - * @returns {number} - */ -daikon.Image.prototype.getDataScaleSlope = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_DATA_SCALE_SLOPE[0], daikon.Tag.TAG_DATA_SCALE_SLOPE[1]), 0); -}; - - -/** - * Returns the rescale intercept. - * @returns {number} - */ -daikon.Image.prototype.getDataScaleIntercept = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_DATA_SCALE_INTERCEPT[0], daikon.Tag.TAG_DATA_SCALE_INTERCEPT[1]), 0); -}; - - - -daikon.Image.prototype.getDataScaleElscint = function () { - var scale = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_DATA_SCALE_ELSCINT[0], daikon.Tag.TAG_DATA_SCALE_ELSCINT[1]), 0); + return 0 + } + + /** + * Returns the modality + * @returns {string} + */ + getModality() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_MODALITY[0], Tag.TAG_MODALITY[1]), 0) + } + + /** + * Returns the slice location. + * @returns {number} + */ + getSliceLocation() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SLICE_LOCATION[0], Tag.TAG_SLICE_LOCATION[1]), 0) + } + + /** + * Returns the slice location vector. + * @returns {number[]} + */ + getSliceLocationVector() { + return this.getValueSafely(this.getTag(Tag.TAG_SLICE_LOCATION_VECTOR[0], Tag.TAG_SLICE_LOCATION_VECTOR[1])) + } + + /** + * Returns the image number. + * @returns {number} + */ + getImageNumber() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_IMAGE_NUM[0], Tag.TAG_IMAGE_NUM[1]), 0) + } + + /** + * Returns the temporal position. + * @returns {number} + */ + getTemporalPosition() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_TEMPORAL_POSITION[0], Tag.TAG_TEMPORAL_POSITION[1]), 0) + } + + /** + * Returns the temporal number. + * @returns {number} + */ + getTemporalNumber() { + return this.getSingleValueSafely( + this.getTag(Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0], Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]), + 0 + ) + } + + /** + * Returns the slice gap. + * @returns {number} + */ + getSliceGap() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SLICE_GAP[0], Tag.TAG_SLICE_GAP[1]), 0) + } + + /** + * Returns the slice thickness. + * @returns {number} + */ + getSliceThickness() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_SLICE_THICKNESS[0], Tag.TAG_SLICE_THICKNESS[1]), 0) + } + + /** + * Returns the image maximum. + * @returns {number} + */ + getImageMax() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_IMAGE_MAX[0], Tag.TAG_IMAGE_MAX[1]), 0) + } + + /** + * Returns the image minimum. + * @returns {number} + */ + getImageMin() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_IMAGE_MIN[0], Tag.TAG_IMAGE_MIN[1]), 0) + } + + /** + * Returns the rescale slope. + * @returns {number} + */ + getDataScaleSlope() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_DATA_SCALE_SLOPE[0], Tag.TAG_DATA_SCALE_SLOPE[1]), 0) + } + + /** + * Returns the rescale intercept. + * @returns {number} + */ + getDataScaleIntercept() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_DATA_SCALE_INTERCEPT[0], Tag.TAG_DATA_SCALE_INTERCEPT[1]), 0) + } + + getDataScaleElscint() { + let scale = this.getSingleValueSafely(this.getTag(Tag.TAG_DATA_SCALE_ELSCINT[0], Tag.TAG_DATA_SCALE_ELSCINT[1]), 0) if (!scale) { - scale = 1; + scale = 1 } - var bandwidth = this.getPixelBandwidth(); - scale = Math.sqrt(bandwidth) / (10 * scale); + const bandwidth = this.getPixelBandwidth() + scale = Math.sqrt(bandwidth) / (10 * scale) if (scale <= 0) { - scale = 1; + scale = 1 } - return scale; -}; - - -/** - * Returns the window width. - * @returns {number} - */ -daikon.Image.prototype.getWindowWidth = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_WINDOW_WIDTH[0], daikon.Tag.TAG_WINDOW_WIDTH[1]), 0); -}; - - -/** - * Returns the window center. - * @returns {number} - */ -daikon.Image.prototype.getWindowCenter = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_WINDOW_CENTER[0], daikon.Tag.TAG_WINDOW_CENTER[1]), 0); -}; - - - -daikon.Image.prototype.getPixelBandwidth = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PIXEL_BANDWIDTH[0], daikon.Tag.TAG_PIXEL_BANDWIDTH[1]), 0); -}; - - - -daikon.Image.prototype.getSeriesId = function () { - var des = this.getSeriesDescription(); - var uid = this.getSeriesInstanceUID(); - var num = this.getSeriesNumber(); - var echo = this.getEchoNumber(); - var orientation = this.getOrientation(); - var cols = this.getCols(); - var rows = this.getRows(); - - var id = ""; + return scale + } + + /** + * Returns the window width. + * @returns {number} + */ + getWindowWidth() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_WINDOW_WIDTH[0], Tag.TAG_WINDOW_WIDTH[1]), 0) + } + + /** + * Returns the window center. + * @returns {number} + */ + getWindowCenter() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_WINDOW_CENTER[0], Tag.TAG_WINDOW_CENTER[1]), 0) + } + + getPixelBandwidth() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_PIXEL_BANDWIDTH[0], Tag.TAG_PIXEL_BANDWIDTH[1]), 0) + } + + getSeriesId() { + const des = this.getSeriesDescription() + const uid = this.getSeriesInstanceUID() + const num = this.getSeriesNumber() + const echo = this.getEchoNumber() + const orientation = this.getOrientation() + const cols = this.getCols() + const rows = this.getRows() + + let id = '' if (des !== null) { - id += (" " + des); + id += ' ' + des } if (uid !== null) { - id += (" " + uid); + id += ' ' + uid } if (num !== null) { - id += (" " + num); + id += ' ' + num } if (echo !== null) { - id += (" " + echo); + id += ' ' + echo } if (orientation !== null) { - id += (" " + orientation); + id += ' ' + orientation } - id += (" (" + cols + " x " + rows + ")"); - - return id; -}; - - -/** - * Returns the pixel spacing. - * @returns {number[]} - */ -daikon.Image.prototype.getPixelSpacing = function () { - return daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_PIXEL_SPACING[0], daikon.Tag.TAG_PIXEL_SPACING[1])); -}; - - -/** - * Returns the image type. - * @returns {string[]} - */ -daikon.Image.prototype.getImageType = function () { - return daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_TYPE[0], daikon.Tag.TAG_IMAGE_TYPE[1])); -}; - - -/** - * Returns the number of bits stored. - * @returns {number} - */ -daikon.Image.prototype.getBitsStored = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_BITS_STORED[0], daikon.Tag.TAG_BITS_STORED[1]), 0); -}; - - -/** - * Returns the number of bits allocated. - * @returns {number} - */ -daikon.Image.prototype.getBitsAllocated = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_BITS_ALLOCATED[0], daikon.Tag.TAG_BITS_ALLOCATED[1]), 0); -}; - - -/** - * Returns the frame time. - * @returns {number} - */ -daikon.Image.prototype.getFrameTime = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_FRAME_TIME[0], daikon.Tag.TAG_FRAME_TIME[1]), 0); -}; - - -/** - * Returns the acquisition matrix (e.g., "mosaic" data). - * @returns {number[]} - */ -daikon.Image.prototype.getAcquisitionMatrix = function () { - var mat, matPrivate, start, end, str; - - mat = [0, 0]; - mat[0] = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_ACQUISITION_MATRIX[0], daikon.Tag.TAG_ACQUISITION_MATRIX[1]), 0); + id += ' (' + cols + ' x ' + rows + ')' + + return id + } + + /** + * Returns the pixel spacing. + * @returns {number[]} + */ + getPixelSpacing() { + return this.getValueSafely(this.getTag(Tag.TAG_PIXEL_SPACING[0], Tag.TAG_PIXEL_SPACING[1])) + } + + /** + * Returns the image type. + * @returns {string[]} + */ + getImageType() { + return this.getValueSafely(this.getTag(Tag.TAG_IMAGE_TYPE[0], Tag.TAG_IMAGE_TYPE[1])) + } + + /** + * Returns the number of bits stored. + * @returns {number} + */ + getBitsStored() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_BITS_STORED[0], Tag.TAG_BITS_STORED[1]), 0) + } + + /** + * Returns the number of bits allocated. + * @returns {number} + */ + getBitsAllocated() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_BITS_ALLOCATED[0], Tag.TAG_BITS_ALLOCATED[1]), 0) + } + + /** + * Returns the frame time. + * @returns {number} + */ + getFrameTime() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_FRAME_TIME[0], Tag.TAG_FRAME_TIME[1]), 0) + } + + /** + * Returns the acquisition matrix (e.g., "mosaic" data). + * @returns {number[]} + */ + getAcquisitionMatrix() { + let matPrivate, start, end, str + + const mat = [0, 0] + mat[0] = this.getSingleValueSafely(this.getTag(Tag.TAG_ACQUISITION_MATRIX[0], Tag.TAG_ACQUISITION_MATRIX[1]), 0) if (this.privateDataAll === null) { - this.privateDataAll = this.getAllInterpretedPrivateData(); + this.privateDataAll = this.getAllInterpretedPrivateData() } - if ((this.privateDataAll !== null) && (this.privateDataAll.length > 0)) { - start = this.privateDataAll.indexOf("AcquisitionMatrixText"); - if (start !== -1) { - - end = this.privateDataAll.indexOf('\n', start); - - if (end !== -1) { - str = this.privateDataAll.substring(start, end); - matPrivate = str.match(/\d+/g); - - if ((matPrivate !== null) && (matPrivate.length === 2)) { - mat[0] = matPrivate[0]; - mat[1] = matPrivate[1]; - } else if ((matPrivate !== null) && (matPrivate.length === 1)) { - mat[0] = matPrivate[0]; - } - } + if (this.privateDataAll !== null && this.privateDataAll.length > 0) { + start = this.privateDataAll.indexOf('AcquisitionMatrixText') + if (start !== -1) { + end = this.privateDataAll.indexOf('\n', start) + + if (end !== -1) { + str = this.privateDataAll.substring(start, end) + matPrivate = str.match(/\d+/g) + + if (matPrivate !== null && matPrivate.length === 2) { + mat[0] = matPrivate[0] + mat[1] = matPrivate[1] + } else if (matPrivate !== null && matPrivate.length === 1) { + mat[0] = matPrivate[0] + } } + } } if (mat[1] === 0) { - mat[1] = mat[0]; + mat[1] = mat[0] } - return mat; -}; + return mat + } + /** + * Returns the TR. + * @returns {number} + */ + getTR() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_TR, Tag.TAG_TR[1]), 0) + } -/** - * Returns the TR. - * @returns {number} - */ -daikon.Image.prototype.getTR = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_TR, daikon.Tag.TAG_TR[1]), 0); -}; - - - -daikon.Image.prototype.putTag = function (tag) { + putTag(tag) { if (this.tags[tag.id] && this.tags[tag.id].value[0] !== tag.value[0]) { - return; + return } - this.tags[tag.id] = tag; - this.putFlattenedTag(this.tagsFlat, tag); -}; - - - -daikon.Image.prototype.putFlattenedTag = function (tags, tag) { - var ctr; + this.tags[tag.id] = tag + this.putFlattenedTag(this.tagsFlat, tag) + } + putFlattenedTag(tags, tag) { if (tag.sublist) { - for (ctr = 0; ctr < tag.value.length; ctr += 1) { - this.putFlattenedTag(tags, tag.value[ctr]); - } + for (let ctr = 0; ctr < tag.value.length; ctr += 1) { + this.putFlattenedTag(tags, tag.value[ctr]) + } } else { - if (!tags[tag.id]) { - tags[tag.id] = tag; - } + if (!tags[tag.id]) { + tags[tag.id] = tag + } } -}; - + } -/** - * Returns a tag matching the specified group and element. - * @param {number} group - * @param {number} element - * @returns {daikon.Tag} - */ -daikon.Image.prototype.getTag = function (group, element) { - var tagId = daikon.Tag.createId(group, element); + /** + * Returns a tag matching the specified group and element. + * @param {number} group + * @param {number} element + * @returns {daikon.Tag} + */ + getTag(group, element) { + const tagId = Tag.createId(group, element) if (this.tags[tagId]) { - return this.tags[tagId]; + return this.tags[tagId] } - return this.tagsFlat[tagId]; -}; + return this.tagsFlat[tagId] + } + /** + * Returns the pixel data tag. + * @returns {daikon.Tag} + */ + getPixelData() { + return this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])] + } -/** - * Returns the pixel data tag. - * @returns {daikon.Tag} - */ -daikon.Image.prototype.getPixelData = function () { - return this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])]; -}; - - - -daikon.Image.prototype.getPixelDataBytes = function () { + getPixelDataBytes() { if (this.isCompressed()) { - this.decompress(); + this.decompress() } - if (this.isPalette() && !daikon.Image.skipPaletteConversion) { - this.convertPalette(); + if (this.isPalette() && !this.skipPaletteConversion) { + this.convertPalette() } - return this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value.buffer; -}; - - -/** - * Returns the raw pixel data. - * @returns {ArrayBuffer} - */ -daikon.Image.prototype.getRawData = function () { - return this.getPixelDataBytes(); -}; - - -/** - * Returns interpreted pixel data (considers datatype, byte order, data scales). - * @param {boolean} asArray - if true, the returned data is a JavaScript Array - * @param {boolean} asObject - if true, an object is returned with properties: data, min, max, minIndex, maxIndex, numCols, numRows - * @param {number} frameIndex - if provided, only the desired frame in a multi-frame dataset is returned - * @returns {Float32Array|Array|object} - */ -daikon.Image.prototype.getInterpretedData = function (asArray, asObject, frameIndex) { - var datatype, numBytes, numElements, dataView, data, ctr, mask, slope, intercept, min, max, value, minIndex, - maxIndex, littleEndian, rawValue, rawData, allFrames, elementsPerFrame, totalElements, offset, dataCtr; - allFrames = arguments.length < 3; - mask = daikon.Utils.createBitMask(this.getBitsAllocated() / 8, this.getBitsStored(), - this.getDataType() === daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED); - datatype = this.getPixelRepresentation() ? daikon.Image.BYTE_TYPE_INTEGER : daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED; - numBytes = this.getBitsAllocated() / 8; - rawData = this.getRawData(); - dataView = new DataView(rawData); - totalElements = rawData.byteLength / numBytes; - elementsPerFrame = totalElements / this.getNumberOfFrames(); - numElements = allFrames ? totalElements : elementsPerFrame; - offset = allFrames ? 0 : frameIndex * elementsPerFrame; - slope = this.getDataScaleSlope() || 1; - intercept = this.getDataScaleIntercept() || 0; - min = daikon.Utils.MAX_VALUE; - max = daikon.Utils.MIN_VALUE; - minIndex = -1; - maxIndex = -1; - littleEndian = this.littleEndian; + return this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value.buffer + } + + /** + * Returns the raw pixel data. + * @returns {ArrayBuffer} + */ + getRawData() { + return this.getPixelDataBytes() + } + + /** + * Returns interpreted pixel data (considers datatype, byte order, data scales). + * @param {boolean} asArray - if true, the returned data is a JavaScript Array + * @param {boolean} asObject - if true, an object is returned with properties: data, min, max, minIndex, maxIndex, numCols, numRows + * @param {number} frameIndex - if provided, only the desired frame in a multi-frame dataset is returned + * @returns {Float32Array|Array|object} + */ + getInterpretedData(asArray, asObject, frameIndex) { + let data, min, max, value, minIndex, maxIndex, rawValue + const allFrames = arguments.length < 3 + const mask = createBitMask( + this.getBitsAllocated() / 8, + this.getBitsStored(), + this.getDataType() === Image.BYTE_TYPE_INTEGER_UNSIGNED + ) + const datatype = this.getPixelRepresentation() ? Image.BYTE_TYPE_INTEGER : Image.BYTE_TYPE_INTEGER_UNSIGNED + const numBytes = this.getBitsAllocated() / 8 + const rawData = this.getRawData() + const dataView = new DataView(rawData) + const totalElements = rawData.byteLength / numBytes + const elementsPerFrame = totalElements / this.getNumberOfFrames() + const numElements = allFrames ? totalElements : elementsPerFrame + const offset = allFrames ? 0 : frameIndex * elementsPerFrame + const slope = this.getDataScaleSlope() || 1 + const intercept = this.getDataScaleIntercept() || 0 + min = MAX_VALUE + max = MIN_VALUE + minIndex = -1 + maxIndex = -1 + const littleEndian = this.littleEndian if (asArray) { - data = new Array(numElements); + data = new Array(numElements) } else { - data = new Float32Array(numElements); + data = new Float32Array(numElements) } - var getWord; - if (datatype === daikon.Image.BYTE_TYPE_INTEGER) { - if (numBytes === 1) { - getWord = dataView.getInt8.bind(dataView) - } else if (numBytes === 2) { - getWord = dataView.getInt16.bind(dataView) - } - } else if (datatype === daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED) { - if (numBytes === 1) { - getWord = dataView.getUint8.bind(dataView) - } else if (numBytes === 2) { - getWord = dataView.getUint16.bind(dataView) - } + let getWord + if (datatype === Image.BYTE_TYPE_INTEGER) { + if (numBytes === 1) { + getWord = dataView.getInt8.bind(dataView) + } else if (numBytes === 2) { + getWord = dataView.getInt16.bind(dataView) + } + } else if (datatype === Image.BYTE_TYPE_INTEGER_UNSIGNED) { + if (numBytes === 1) { + getWord = dataView.getUint8.bind(dataView) + } else if (numBytes === 2) { + getWord = dataView.getUint16.bind(dataView) + } } - + // invert pixel values if INVERTED or MONOCHROME1 - var invert = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_LUT_SHAPE[0], daikon.Tag.TAG_LUT_SHAPE[1]), 0) === "INVERSE"; - invert = invert || this.getPhotometricInterpretation() === "MONOCHROME1"; + let invert = this.getSingleValueSafely(this.getTag(Tag.TAG_LUT_SHAPE[0], Tag.TAG_LUT_SHAPE[1]), 0) === 'INVERSE' + invert = invert || this.getPhotometricInterpretation() === 'MONOCHROME1' if (invert) { - var maxVal = Math.pow(2, this.getBitsStored()) - 1; - var minVal = 0; - if (datatype === daikon.Image.BYTE_TYPE_INTEGER) { - maxVal /= 2; - minVal = -maxVal; - } - var originalGetWord = getWord; - getWord = function(offset, endian) { - var val = maxVal - originalGetWord(offset, endian); - return Math.min(maxVal, Math.max(minVal, val)); - } + let maxVal = Math.pow(2, this.getBitsStored()) - 1 + let minVal = 0 + if (datatype === Image.BYTE_TYPE_INTEGER) { + maxVal /= 2 + minVal = -maxVal + } + const originalGetWord = getWord + getWord = (offset, endian) => { + const val = maxVal - originalGetWord(offset, endian) + return Math.min(maxVal, Math.max(minVal, val)) + } } - for (ctr = offset, dataCtr = 0; dataCtr < numElements; ctr++, dataCtr++) { - rawValue = getWord(ctr * numBytes, littleEndian); + for (let ctr = offset, dataCtr = 0; dataCtr < numElements; ctr++, dataCtr++) { + rawValue = getWord(ctr * numBytes, littleEndian) - value = ((rawValue & mask) * slope) + intercept; - data[dataCtr] = value; + value = (rawValue & mask) * slope + intercept + data[dataCtr] = value - if (value < min) { - min = value; - minIndex = dataCtr; - } + if (value < min) { + min = value + minIndex = dataCtr + } - if (value > max) { - max = value; - maxIndex = dataCtr; - } + if (value > max) { + max = value + maxIndex = dataCtr + } } if (asObject) { - return {data: data, min: min, minIndex: minIndex, max: max, maxIndex: maxIndex, numCols: this.getCols(), - numRows: this.getRows()}; + return { + data, + min, + minIndex, + max, + maxIndex, + numCols: this.getCols(), + numRows: this.getRows() + } } - - return data; -}; - - -daikon.Image.prototype.convertPalette = function () { - var data, reds, greens, blues, rgb, numBytes, numElements, ctr, index, rVal, gVal, bVal; - - data = this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value; - - reds = this.getPalleteValues(daikon.Tag.TAG_PALETTE_RED); - greens = this.getPalleteValues(daikon.Tag.TAG_PALETTE_GREEN); - blues = this.getPalleteValues(daikon.Tag.TAG_PALETTE_BLUE); - - if ((reds !== null) && (reds.length > 0) && (greens !== null) && (greens.length > 0) && (blues !== null) && - (blues.length > 0) && !this.convertedPalette) { - rgb = new DataView(new ArrayBuffer(this.getRows() * this.getCols() * this.getNumberOfFrames() * 3)); - numBytes = parseInt(Math.ceil(this.getBitsAllocated() / 8)); - numElements = data.byteLength / numBytes; - - if (numBytes === 1) { - for (ctr = 0; ctr < numElements; ctr += 1) { - index = data.getUint8(ctr); - rVal = reds[index]; - gVal = greens[index]; - bVal = blues[index]; - rgb.setUint8((ctr * 3), rVal); - rgb.setUint8((ctr * 3) + 1, gVal); - rgb.setUint8((ctr * 3) + 2, bVal); - } - } else if (numBytes === 2) { - for (ctr = 0; ctr < numElements; ctr += 1) { - index = data.getUint16(ctr * 2); - rVal = reds[index]; - gVal = greens[index]; - bVal = blues[index]; - rgb.setUint8((ctr * 3), rVal); - rgb.setUint8((ctr * 3) + 1, gVal); - rgb.setUint8((ctr * 3) + 2, bVal); - } + return data + } + + convertPalette() { + let data, rgb, numBytes, numElements, index, rVal, gVal, bVal + + data = this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value + + const reds = this.getPalleteValues(Tag.TAG_PALETTE_RED) + const greens = this.getPalleteValues(Tag.TAG_PALETTE_GREEN) + const blues = this.getPalleteValues(Tag.TAG_PALETTE_BLUE) + + if ( + reds !== null && + reds.length > 0 && + greens !== null && + greens.length > 0 && + blues !== null && + blues.length > 0 && + !this.convertedPalette + ) { + rgb = new DataView(new ArrayBuffer(this.getRows() * this.getCols() * this.getNumberOfFrames() * 3)) + numBytes = parseInt(Math.ceil(this.getBitsAllocated() / 8)) + numElements = data.byteLength / numBytes + + if (numBytes === 1) { + for (let ctr = 0; ctr < numElements; ctr += 1) { + index = data.getUint8(ctr) + rVal = reds[index] + gVal = greens[index] + bVal = blues[index] + rgb.setUint8(ctr * 3, rVal) + rgb.setUint8(ctr * 3 + 1, gVal) + rgb.setUint8(ctr * 3 + 2, bVal) + } + } else if (numBytes === 2) { + for (let ctr = 0; ctr < numElements; ctr += 1) { + index = data.getUint16(ctr * 2) + rVal = reds[index] + gVal = greens[index] + bVal = blues[index] + rgb.setUint8(ctr * 3, rVal) + rgb.setUint8(ctr * 3 + 1, gVal) + rgb.setUint8(ctr * 3 + 2, bVal) } + } - data = rgb; - this.convertedPalette = true; + data = rgb + this.convertedPalette = true } - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = data; -}; + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = data + } - - -daikon.Image.prototype.decompressJPEG = function (jpg) { + decompressJPEG(jpg) { if (this.isCompressedJPEGLossless()) { - var decoder = new jpeg.lossless.Decoder(); - return decoder.decode(jpg); + const decoder = new jpeg.lossless.Decoder() + return decoder.decode(jpg) } else if (this.isCompressedJPEGBaseline()) { - var decoder = new JpegDecoder(); - decoder.parse(new Uint8Array(jpg)); - var width = decoder.width; - var height = decoder.height; - - var decoded; - if (this.getBitsAllocated() === 8) { - decoded = decoder.getData(width, height); - } else if (this.getBitsAllocated() === 16) { - decoded = decoder.getData16(width, height); - } - - return decoded; + const decoder = new JpegImage() + decoder.parse(new Uint8Array(jpg)) + const width = decoder.width + const height = decoder.height + + let decoded + if (this.getBitsAllocated() === 8) { + decoded = decoder.getData(width, height) + } else if (this.getBitsAllocated() === 16) { + decoded = decoder.getData16(width, height) + } + + return decoded } else if (this.isCompressedJPEG2000()) { - var decoder = new JpxImage(); - decoder.parse(new Uint8Array(jpg)); - return decoder.tiles[0].items; + const decoder = new JpxImage() + decoder.parse(new Uint8Array(jpg)) + return decoder.tiles[0].items } else if (this.isCompressedJPEGLS()) { - var decoder = new JpegLSDecoder(); - return decoder.decodeJPEGLS(new Uint8Array(jpg), this.getDataType() === daikon.Image.BYTE_TYPE_INTEGER); + const decoder = new JpegLS() + return decoder.decodeJPEGLS(new Uint8Array(jpg), this.getDataType() === Image.BYTE_TYPE_INTEGER) } -}; - + } + decompress() { + let decoded, jpegs, rle, decoder, decompressed, numFrames, frameSize, temp, width, height, numComponents -daikon.Image.prototype.decompress = function () { - var jpegs, rle, decoder, decompressed, numFrames, frameSize, temp, ctr, width, height, numComponents, decoded; - - decompressed = null; + decompressed = null if (!this.decompressed) { - this.decompressed = true; - - frameSize = this.getRows() * this.getCols() * parseInt(Math.ceil(this.getBitsAllocated() / 8)); - numFrames = this.getNumberOfFrames(); - - if (this.isCompressedJPEGLossless()) { - jpegs = this.getJpegs(); - - for (ctr = 0; ctr < jpegs.length; ctr+=1) { - decoder = new jpeg.lossless.Decoder(); - temp = decoder.decode(jpegs[ctr]); - numComponents = decoder.numComp; + this.decompressed = true - if (decompressed === null) { - decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)); - } - - (new Uint8Array(decompressed.buffer)).set(new Uint8Array(temp.buffer), (ctr * frameSize * numComponents)); - temp = null; - } - - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = decompressed; - } else if (this.isCompressedJPEGBaseline()) { - jpegs = this.getJpegs(); - - for (ctr = 0; ctr < jpegs.length; ctr+=1) { - decoder = new JpegDecoder(); - decoder.parse(new Uint8Array(jpegs[ctr])); - width = decoder.width; - height = decoder.height; - numComponents = decoder.components.length; - - if (decompressed === null) { - decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)); - } - - if (this.getBitsAllocated() === 8) { - decoded = decoder.getData(width, height); - } else if (this.getBitsAllocated() === 16) { - decoded = decoder.getData16(width, height); - } - - daikon.Utils.fillBuffer(decoded, decompressed, (ctr * frameSize * numComponents), - parseInt(Math.ceil(this.getBitsAllocated() / 8))); - - decoded = null; - } + frameSize = this.getRows() * this.getCols() * parseInt(Math.ceil(this.getBitsAllocated() / 8)) + numFrames = this.getNumberOfFrames() - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = decompressed; - } else if (this.isCompressedJPEG2000()) { - jpegs = this.getJpegs(); + if (this.isCompressedJPEGLossless()) { + jpegs = this.getJpegs() - for (ctr = 0; ctr < jpegs.length; ctr+=1) { - decoder = new JpxImage(); - decoder.parse(new Uint8Array(jpegs[ctr])); - width = decoder.width; - height = decoder.height; - decoded = decoder.tiles[0].items; - numComponents = decoder.componentsCount; + for (let ctr = 0; ctr < jpegs.length; ctr += 1) { + decoder = new jpeg.lossless.Decoder() + temp = decoder.decode(jpegs[ctr]) + numComponents = decoder.numComp - if (decompressed === null) { - decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)); - } + if (decompressed === null) { + decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)) + } - daikon.Utils.fillBuffer(decoded, decompressed, (ctr * frameSize * numComponents), - parseInt(Math.ceil(this.getBitsAllocated() / 8))); - - decoded = null; - } - - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = decompressed; - } else if (this.isCompressedJPEGLS()) { - jpegs = this.getJpegs(); - - for (ctr = 0; ctr < jpegs.length; ctr+=1) { - decoder = new JpegLSDecoder(); - var decoded = decoder.decodeJPEGLS(new Uint8Array(jpegs[ctr]), this.getDataType() === daikon.Image.BYTE_TYPE_INTEGER); - width = decoded.columns; - height = decoded.rows; - decoded = decoded.pixelData; - numComponents = this.getNumberOfSamplesPerPixel(); - - if (decompressed === null) { - decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)); - } - - daikon.Utils.fillBuffer(decoded, decompressed, (ctr * frameSize * numComponents), - parseInt(Math.ceil(this.getBitsAllocated() / 8))); - - decoded = null; - } - - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = decompressed; - } else if (this.isCompressedRLE()) { - rle = this.getRLE(); - - for (ctr = 0; ctr < rle.length; ctr+=1) { - decoder = new daikon.RLE(); - temp = decoder.decode(rle[ctr], this.littleEndian, this.getRows() * this.getCols()); - numComponents = (decoder.numSegments === 3 ? 3 : 1); - - if (decompressed === null) { - decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)); - } - - (new Uint8Array(decompressed.buffer)).set(new Uint8Array(temp.buffer), (ctr * frameSize * numComponents)); - temp = null; - } - - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = decompressed; + new Uint8Array(decompressed.buffer).set(new Uint8Array(temp.buffer), ctr * frameSize * numComponents) + temp = null } - } -}; + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = decompressed + } else if (this.isCompressedJPEGBaseline()) { + jpegs = this.getJpegs() + + for (let ctr = 0; ctr < jpegs.length; ctr += 1) { + decoder = new JpegImage() + decoder.parse(new Uint8Array(jpegs[ctr])) + width = decoder.width + height = decoder.height + numComponents = decoder.components.length + + if (decompressed === null) { + decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)) + } + + if (this.getBitsAllocated() === 8) { + decoded = decoder.getData(width, height) + } else if (this.getBitsAllocated() === 16) { + decoded = decoder.getData16(width, height) + } + + fillBuffer( + decoded, + decompressed, + ctr * frameSize * numComponents, + parseInt(Math.ceil(this.getBitsAllocated() / 8)) + ) + + decoded = null + } -/** - * Returns true if pixel data is found. - * @returns {boolean} - */ -daikon.Image.prototype.hasPixelData = function () { - return (this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])] !== undefined); -}; + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = decompressed + } else if (this.isCompressedJPEG2000()) { + jpegs = this.getJpegs() + + for (let ctr = 0; ctr < jpegs.length; ctr += 1) { + decoder = new JpxImage() + decoder.parse(Buffer.from(new Uint8Array(jpegs[ctr]))) + width = decoder.width + height = decoder.height + decoded = decoder.tiles[0].items + numComponents = decoder.componentsCount + + if (decompressed === null) { + decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)) + } + + fillBuffer( + decoded, + decompressed, + ctr * frameSize * numComponents, + parseInt(Math.ceil(this.getBitsAllocated() / 8)) + ) + + decoded = null + } + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = decompressed + } else if (this.isCompressedJPEGLS()) { + jpegs = this.getJpegs() + + for (let ctr = 0; ctr < jpegs.length; ctr += 1) { + decoder = new JpegLS() + decoded = decoder.decodeJPEGLS(new Uint8Array(jpegs[ctr]), this.getDataType() === Image.BYTE_TYPE_INTEGER) + width = decoded.columns + height = decoded.rows + decoded = decoded.pixelData + numComponents = this.getNumberOfSamplesPerPixel() + + if (decompressed === null) { + decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)) + } + + fillBuffer( + decoded, + decompressed, + ctr * frameSize * numComponents, + parseInt(Math.ceil(this.getBitsAllocated() / 8)) + ) + + decoded = null + } + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = decompressed + } else if (this.isCompressedRLE()) { + rle = this.getRLE() -daikon.Image.prototype.clearPixelData = function () { - this.tags[daikon.Tag.createId(daikon.Tag.TAG_PIXEL_DATA[0], daikon.Tag.TAG_PIXEL_DATA[1])].value = null; -}; + for (let ctr = 0; ctr < rle.length; ctr += 1) { + decoder = new RLE() + temp = decoder.decode(rle[ctr], this.littleEndian, this.getRows() * this.getCols()) + numComponents = decoder.numSegments === 3 ? 3 : 1 + if (decompressed === null) { + decompressed = new DataView(new ArrayBuffer(frameSize * numFrames * numComponents)) + } -/** - * Returns an orientation string (e.g., XYZ+--). - * @returns {string} - */ -daikon.Image.prototype.getOrientation = function () { - var orientation = null, - dirCos = daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_ORIENTATION[0], daikon.Tag.TAG_IMAGE_ORIENTATION[1])), - ctr, - spacing, - rowSpacing, - swapZ, - bigRow = 0, bigCol = 0, - biggest = 0, orient = ''; + new Uint8Array(decompressed.buffer).set(new Uint8Array(temp.buffer), ctr * frameSize * numComponents) + temp = null + } - if (!dirCos || (dirCos.length !== 6)) { - return null; + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = decompressed + } + } + } + + /** + * Returns true if pixel data is found. + * @returns {boolean} + */ + hasPixelData() { + return this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])] !== undefined + } + + clearPixelData() { + this.tags[Tag.createId(Tag.TAG_PIXEL_DATA[0], Tag.TAG_PIXEL_DATA[1])].value = null + } + + /** + * Returns an orientation string (e.g., XYZ+--). + * @returns {string} + */ + getOrientation() { + let orientation = null + const dirCos = this.getValueSafely(this.getTag(Tag.TAG_IMAGE_ORIENTATION[0], Tag.TAG_IMAGE_ORIENTATION[1])) + let ctr + let bigRow = 0 + let bigCol = 0 + let biggest = 0 + let orient = '' + + if (!dirCos || dirCos.length !== 6) { + return null } - spacing = this.getPixelSpacing(); + const spacing = this.getPixelSpacing() if (!spacing) { - return null; + return null } - rowSpacing = spacing[0]; - swapZ = true; + const rowSpacing = spacing[0] + const swapZ = true for (ctr = 0; ctr < 3; ctr += 1) { - if (Math.abs(dirCos[ctr]) > biggest) { - biggest = Math.abs(dirCos[ctr]); - bigRow = ctr; - } + if (Math.abs(dirCos[ctr]) > biggest) { + biggest = Math.abs(dirCos[ctr]) + bigRow = ctr + } } - biggest = 0; + biggest = 0 + // TODO: clean up this mess for (; ctr < 6; ctr += 1) { - if (Math.abs(dirCos[ctr]) > biggest) { - biggest = Math.abs(dirCos[ctr]); - bigCol = ctr; - } + if (Math.abs(dirCos[ctr]) > biggest) { + biggest = Math.abs(dirCos[ctr]) + bigCol = ctr + } } switch (bigRow) { - case 0: - orient += ('X'); - if (bigCol === 4) { - orient += ("YZ"); - } else { - orient += ("ZY"); - } - break; - case 1: - orient += ('Y'); - if (bigCol === 3) { - orient += ("XZ"); - } else { - orient += ("ZX"); - } - break; - case 2: - orient += ('Z'); - if (bigCol === 3) { - orient += ("XY"); - } else { - orient += ("YX"); - } - break; - default: - break; + case 0: + orient += 'X' + if (bigCol === 4) { + orient += 'YZ' + } else { + orient += 'ZY' + } + break + case 1: + orient += 'Y' + if (bigCol === 3) { + orient += 'XZ' + } else { + orient += 'ZX' + } + break + case 2: + orient += 'Z' + if (bigCol === 3) { + orient += 'XY' + } else { + orient += 'YX' + } + break + default: + break } switch (bigRow) { - case 0: - if (dirCos[bigRow] > 0.0) { - orient += ('-'); - } else { - orient += ('+'); - } - if (bigCol === 4) { - if (dirCos[bigCol] > 0.0) { - orient += ('-'); - } else { - orient += ('+'); - } - } else { - if (dirCos[bigCol] > 0.0) { - orient += ('+'); - } else { - orient += ('-'); - } - } - break; - case 1: - if (dirCos[bigRow] > 0.0) { - orient += ('-'); + case 0: + if (dirCos[bigRow] > 0.0) { + orient += '-' + } else { + orient += '+' + } + if (bigCol === 4) { + if (dirCos[bigCol] > 0.0) { + orient += '-' + } else { + orient += '+' + } + } else { + if (dirCos[bigCol] > 0.0) { + orient += '+' + } else { + orient += '-' + } + } + break + case 1: + if (dirCos[bigRow] > 0.0) { + orient += '-' + } else { + orient += '+' + } + if (bigCol === 3) { + if (dirCos[bigCol] > 0.0) { + orient += '-' + } else { + orient += '+' + } + } else { + if (dirCos[bigCol] > 0.0) { + orient += '+' + } else { + orient += '-' + } + } + break + case 2: + if (dirCos[bigRow] > 0.0) { + orient += '+' + } else { + orient += '-' + } + // Has to be X or Y so opposite senses + if (dirCos[bigCol] > 0.0) { + orient += '-' + } else { + orient += '+' + } + break + default: + break + } + + if (rowSpacing === 0.0) { + orient += '+' + orientation = orient + } else { + if (swapZ) { + switch (orient.charAt(2)) { + case 'X': + if (rowSpacing > 0.0) { + orient += '-' } else { - orient += ('+'); + orient += '+' } - if (bigCol === 3) { - if (dirCos[bigCol] > 0.0) { - orient += ('-'); - } else { - orient += ('+'); - } + break + case 'Y': + case 'Z': + if (rowSpacing > 0.0) { + orient += '+' } else { - if (dirCos[bigCol] > 0.0) { - orient += ('+'); - } else { - orient += ('-'); - } + orient += '-' } - break; - case 2: - if (dirCos[bigRow] > 0.0) { - orient += ('+'); + break + default: + break + } + } else { + switch (orient.charAt(2)) { + case 'X': + if (rowSpacing > 0.0) { + orient += '+' } else { - orient += ('-'); + orient += '-' } - //Has to be X or Y so opposite senses - if (dirCos[bigCol] > 0.0) { - orient += ('-'); + break + case 'Y': + case 'Z': + if (rowSpacing > 0.0) { + orient += '-' } else { - orient += ('+'); - } - break; - default: - break; - } - - if (rowSpacing === 0.0) { - orient += ('+'); - orientation = orient; - } else { - if (swapZ) { - switch (orient.charAt(2)) { - case 'X': - if (rowSpacing > 0.0) { - orient += ('-'); - } else { - orient += ('+'); - } - break; - case 'Y': - case 'Z': - if (rowSpacing > 0.0) { - orient += ('+'); - } else { - orient += ('-'); - } - break; - default: - break; - } - } else { - switch (orient.charAt(2)) { - case 'X': - if (rowSpacing > 0.0) { - orient += ('+'); - } else { - orient += ('-'); - } - break; - case 'Y': - case 'Z': - if (rowSpacing > 0.0) { - orient += ('-'); - } else { - orient += ('+'); - } - break; - default: - break; + orient += '+' } + break + default: + break } + } - orientation = orient; + orientation = orient } - return orientation; -}; - + return orientation + } -/** - * Returns true if this image is "mosaic". - * @returns {boolean} - */ -daikon.Image.prototype.isMosaic = function () { - var imageType, labeledAsMosaic = false, canReadAsMosaic, ctr, matSize; + /** + * Returns true if this image is "mosaic". + * @returns {boolean} + */ + isMosaic() { + let labeledAsMosaic = false - imageType = this.getImageType(); + const imageType = this.getImageType() if (imageType !== null) { - for (ctr = 0; ctr < imageType.length; ctr += 1) { - if (imageType[ctr].toUpperCase().indexOf("MOSAIC") !== -1) { - labeledAsMosaic = true; - break; - } + for (let ctr = 0; ctr < imageType.length; ctr += 1) { + if (imageType[ctr].toUpperCase().indexOf('MOSAIC') !== -1) { + labeledAsMosaic = true + break } + } } - matSize = this.getAcquisitionMatrix(); - canReadAsMosaic = (matSize[0] > 0) && ((matSize[0] < this.getRows()) || (matSize[1] < this.getCols())); - return labeledAsMosaic && canReadAsMosaic; -}; - - -/** - * Returns true if this image uses palette colors. - * @returns {boolean} - */ -daikon.Image.prototype.isPalette = function () { - var value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0], daikon.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]), 0); + const matSize = this.getAcquisitionMatrix() + const canReadAsMosaic = matSize[0] > 0 && (matSize[0] < this.getRows() || matSize[1] < this.getCols()) + return labeledAsMosaic && canReadAsMosaic + } + + /** + * Returns true if this image uses palette colors. + * @returns {boolean} + */ + isPalette() { + const value = this.getSingleValueSafely( + this.getTag(Tag.TAG_PHOTOMETRIC_INTERPRETATION[0], Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]), + 0 + ) if (value !== null) { - if (value.toLowerCase().indexOf("palette") !== -1) { - return true; - } + if (value.toLowerCase().indexOf('palette') !== -1) { + return true + } } - return false; -}; - - - -daikon.Image.prototype.getMosaicCols = function() { - return this.getCols() / this.getAcquisitionMatrix()[1]; -}; - - - -daikon.Image.prototype.getMosaicRows = function() { - return this.getRows() / this.getAcquisitionMatrix()[0]; -}; - + return false + } + getMosaicCols() { + return this.getCols() / this.getAcquisitionMatrix()[1] + } -daikon.Image.prototype.isElscint = function() { - var tag = this.getTag(daikon.Tag.TAG_DATA_SCALE_ELSCINT[0], daikon.Tag.TAG_DATA_SCALE_ELSCINT[1]); - return (tag !== undefined); -}; + getMosaicRows() { + return this.getRows() / this.getAcquisitionMatrix()[0] + } + isElscint() { + const tag = this.getTag(Tag.TAG_DATA_SCALE_ELSCINT[0], Tag.TAG_DATA_SCALE_ELSCINT[1]) + return tag !== undefined + } -/** - * Returns true if this image stores compressed data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressed = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); - - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores compressed data. + * @returns {boolean} + */ + isCompressed() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG) !== -1) { - return true; - } else if (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE) !== -1) { - return true; - } + if (transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG) !== -1) { + return true + } else if (transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_RLE) !== -1) { + return true + } } - return false; -}; - + return false + } -/** - * Returns true if this image stores JPEG data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedJPEG = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); - - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores JPEG data. + * @returns {boolean} + */ + isCompressedJPEG() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG) !== -1) { - return true; - } + if (transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG) !== -1) { + return true + } } - return false; -}; + return false + } - -/** - * Returns true of this image stores lossless JPEG data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedJPEGLossless = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); - - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true of this image stores lossless JPEG data. + * @returns {boolean} + */ + isCompressedJPEGLossless() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if ((transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS) !== -1) || - (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1) !== -1)) { - return true; - } + if ( + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS) !== -1 || + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1) !== -1 + ) { + return true + } } - return false; -}; - - -/** - * Returns true if this image stores baseline JPEG data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedJPEGBaseline = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); + return false + } - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores baseline JPEG data. + * @returns {boolean} + */ + isCompressedJPEGBaseline() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if ((transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT) !== -1) || - (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT) !== -1)) { - return true; - } + if ( + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT) !== -1 || + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT) !== -1 + ) { + return true + } } - return false; -}; - - -/** - * Returns true if this image stores JPEG2000 data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedJPEG2000 = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); + return false + } - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores JPEG2000 data. + * @returns {boolean} + */ + isCompressedJPEG2000() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if ((transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000) !== -1) || - (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS) !== -1)) { - return true; - } + if ( + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000) !== -1 || + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS) !== -1 + ) { + return true + } } - return false; -}; - + return false + } -/** - * Returns true if this image stores JPEG-LS data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedJPEGLS = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); - - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores JPEG-LS data. + * @returns {boolean} + */ + isCompressedJPEGLS() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if ((transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS) !== -1) || - (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS) !== -1)) { - return true; - } + if ( + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS) !== -1 || + transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS) !== -1 + ) { + return true + } } - return false; -}; - - -/** - * Returns true if this image stores RLE data. - * @returns {boolean} - */ -daikon.Image.prototype.isCompressedRLE = function() { - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); + return false + } - var transferSyntax = this.getTransferSyntax(); + /** + * Returns true if this image stores RLE data. + * @returns {boolean} + */ + isCompressedRLE() { + const transferSyntax = this.getTransferSyntax() if (transferSyntax) { - if (transferSyntax.indexOf(daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE) !== -1) { - return true; - } + if (transferSyntax.indexOf(Parser.TRANSFER_SYNTAX_COMPRESSION_RLE) !== -1) { + return true + } } - return false; -}; - + return false + } -/** - * Returns the number of frames. - * @returns {number} - */ -daikon.Image.prototype.getNumberOfFrames = function () { - var value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_NUMBER_OF_FRAMES[0], daikon.Tag.TAG_NUMBER_OF_FRAMES[1]), 0); + /** + * Returns the number of frames. + * @returns {number} + */ + getNumberOfFrames() { + const value = this.getSingleValueSafely(this.getTag(Tag.TAG_NUMBER_OF_FRAMES[0], Tag.TAG_NUMBER_OF_FRAMES[1]), 0) if (value !== null) { - return value; + return value } - return 1; -}; - + return 1 + } -/** - * Returns the number of samples per pixel. - * @returns {number} - */ -daikon.Image.prototype.getNumberOfSamplesPerPixel = function () { - var value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SAMPLES_PER_PIXEL[0], daikon.Tag.TAG_SAMPLES_PER_PIXEL[1]), 0); + /** + * Returns the number of samples per pixel. + * @returns {number} + */ + getNumberOfSamplesPerPixel() { + const value = this.getSingleValueSafely(this.getTag(Tag.TAG_SAMPLES_PER_PIXEL[0], Tag.TAG_SAMPLES_PER_PIXEL[1]), 0) if (value !== null) { - return value; + return value } - return 1; -}; - - - -daikon.Image.prototype.getNumberOfImplicitFrames = function () { - var pixelData, length, size; + return 1 + } + getNumberOfImplicitFrames() { if (this.isCompressed()) { - return 1; + return 1 } - pixelData = this.getPixelData(); - length = pixelData.offsetEnd - pixelData.offsetValue; - size = this.getCols() * this.getRows() * (parseInt(this.getBitsAllocated() / 8)); - - return parseInt(length / size); -}; - - -/** - * Returns the pixel representation. - * @returns {number} - */ -daikon.Image.prototype.getPixelRepresentation = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PIXEL_REPRESENTATION[0], daikon.Tag.TAG_PIXEL_REPRESENTATION[1]), 0); -}; - - -/** - * Returns the photometric interpretation. - * @returns {string} - */ -daikon.Image.prototype.getPhotometricInterpretation = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0], daikon.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]), 0); -}; - - -/** - * Returns the patient name. - * @returns {string} - */ -daikon.Image.prototype.getPatientName = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PATIENT_NAME[0], daikon.Tag.TAG_PATIENT_NAME[1]), 0); -}; - - -/** - * Returns the patient ID. - * @returns {string} - */ -daikon.Image.prototype.getPatientID = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PATIENT_ID[0], daikon.Tag.TAG_PATIENT_ID[1]), 0); -}; - - -/** - * Returns the study time. - * @returns {string} - */ -daikon.Image.prototype.getStudyTime = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_STUDY_TIME[0], daikon.Tag.TAG_STUDY_TIME[1]), 0); -}; - - -/** - * Returns the transfer syntax. - * @returns {string} - */ -daikon.Image.prototype.getTransferSyntax = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_TRANSFER_SYNTAX[0], daikon.Tag.TAG_TRANSFER_SYNTAX[1]), 0); -}; - - -/** - * Returns the study date. - * @returns {string} - */ -daikon.Image.prototype.getStudyDate = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_STUDY_DATE[0], daikon.Tag.TAG_STUDY_DATE[1]), 0); -}; - - -/** - * Returns the planar configuration. - * @returns {number} - */ -daikon.Image.prototype.getPlanarConfig = function () { - return daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_PLANAR_CONFIG[0], daikon.Tag.TAG_PLANAR_CONFIG[1]), 0); -}; - - -/** - * Returns all descriptive info for this image. - * @returns {string} - */ -daikon.Image.prototype.getImageDescription = function () { - var value, string = ""; - - value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_STUDY_DES[0], daikon.Tag.TAG_STUDY_DES[1]), 0); + const pixelData = this.getPixelData() + const length = pixelData.offsetEnd - pixelData.offsetValue + const size = this.getCols() * this.getRows() * parseInt(this.getBitsAllocated() / 8) + + return parseInt(length / size) + } + + /** + * Returns the pixel representation. + * @returns {number} + */ + getPixelRepresentation() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_PIXEL_REPRESENTATION[0], Tag.TAG_PIXEL_REPRESENTATION[1]), 0) + } + + /** + * Returns the photometric interpretation. + * @returns {string} + */ + getPhotometricInterpretation() { + return this.getSingleValueSafely( + this.getTag(Tag.TAG_PHOTOMETRIC_INTERPRETATION[0], Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]), + 0 + ) + } + + /** + * Returns the patient name. + * @returns {string} + */ + getPatientName() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_PATIENT_NAME[0], Tag.TAG_PATIENT_NAME[1]), 0) + } + + /** + * Returns the patient ID. + * @returns {string} + */ + getPatientID() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_PATIENT_ID[0], Tag.TAG_PATIENT_ID[1]), 0) + } + + /** + * Returns the study time. + * @returns {string} + */ + getStudyTime() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_STUDY_TIME[0], Tag.TAG_STUDY_TIME[1]), 0) + } + + /** + * Returns the transfer syntax. + * @returns {string} + */ + getTransferSyntax() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_TRANSFER_SYNTAX[0], Tag.TAG_TRANSFER_SYNTAX[1]), 0) + } + + /** + * Returns the study date. + * @returns {string} + */ + getStudyDate() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_STUDY_DATE[0], Tag.TAG_STUDY_DATE[1]), 0) + } + + /** + * Returns the planar configuration. + * @returns {number} + */ + getPlanarConfig() { + return this.getSingleValueSafely(this.getTag(Tag.TAG_PLANAR_CONFIG[0], Tag.TAG_PLANAR_CONFIG[1]), 0) + } + + /** + * Returns all descriptive info for this image. + * @returns {string} + */ + getImageDescription() { + let value + let string = '' + + value = this.getSingleValueSafely(this.getTag(Tag.TAG_STUDY_DES[0], Tag.TAG_STUDY_DES[1]), 0) if (value !== null) { - string += (" " + value); + string += ' ' + value } - value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_SERIES_DESCRIPTION[0], daikon.Tag.TAG_SERIES_DESCRIPTION[1]), 0); + value = this.getSingleValueSafely(this.getTag(Tag.TAG_SERIES_DESCRIPTION[0], Tag.TAG_SERIES_DESCRIPTION[1]), 0) if (value !== null) { - string += (" " + value); + string += ' ' + value } - value = daikon.Image.getSingleValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_COMMENTS[0], daikon.Tag.TAG_IMAGE_COMMENTS[1]), 0); + value = this.getSingleValueSafely(this.getTag(Tag.TAG_IMAGE_COMMENTS[0], Tag.TAG_IMAGE_COMMENTS[1]), 0) if (value !== null) { - string += (" " + value); + string += ' ' + value } - return string.trim(); -}; - + return string.trim() + } -/** - * Returns the datatype (e.g., daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED). - * @returns {number} - */ -daikon.Image.prototype.getDataType = function () { - var interp, dataType; - - dataType = this.getPixelRepresentation(); + /** + * Returns the datatype (e.g., Image.BYTE_TYPE_INTEGER_UNSIGNED). + * @returns {number} + */ + getDataType() { + const dataType = this.getPixelRepresentation() if (dataType === null) { - return daikon.Image.BYTE_TYPE_UNKNOWN; + return Image.BYTE_TYPE_UNKNOWN } - interp = this.getPhotometricInterpretation(); + const interp = this.getPhotometricInterpretation() if (interp !== null) { - if ((interp.trim().indexOf('RGB') !== -1) || (interp.trim().indexOf('YBR') !== -1) || - (interp.trim().toLowerCase().indexOf('palette') !== -1)) { - return daikon.Image.BYTE_TYPE_RGB; - } + if ( + interp.trim().indexOf('RGB') !== -1 || + interp.trim().indexOf('YBR') !== -1 || + interp.trim().toLowerCase().indexOf('palette') !== -1 + ) { + return Image.BYTE_TYPE_RGB + } } if (dataType === 0) { - return daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED; + return Image.BYTE_TYPE_INTEGER_UNSIGNED } else if (dataType === 1) { - return daikon.Image.BYTE_TYPE_INTEGER; + return Image.BYTE_TYPE_INTEGER } else { - return daikon.Image.BYTE_TYPE_UNKNOWN; + return Image.BYTE_TYPE_UNKNOWN } -}; + } + // originally from: http://public.kitware.com/pipermail/insight-users/2005-March/012246.html + getAcquiredSliceDirection() { + let label + const dirCos = this.getValueSafely(this.getTag(Tag.TAG_IMAGE_ORIENTATION[0], Tag.TAG_IMAGE_ORIENTATION[1])) -// originally from: http://public.kitware.com/pipermail/insight-users/2005-March/012246.html -daikon.Image.prototype.getAcquiredSliceDirection = function () { - var dirCos, rowAxis, colAxis, label; - - dirCos = daikon.Image.getValueSafely(this.getTag(daikon.Tag.TAG_IMAGE_ORIENTATION[0], daikon.Tag.TAG_IMAGE_ORIENTATION[1])); - - if (!dirCos || (dirCos.length !== 6)) { - return daikon.Image.SLICE_DIRECTION_UNKNOWN; + if (!dirCos || dirCos.length !== 6) { + return Image.SLICE_DIRECTION_UNKNOWN } - rowAxis = daikon.Image.getMajorAxisFromPatientRelativeDirectionCosine(dirCos[0], dirCos[1], dirCos[2]); - colAxis = daikon.Image.getMajorAxisFromPatientRelativeDirectionCosine(dirCos[3], dirCos[4], dirCos[5]); - - if ((rowAxis !== null) && (colAxis !== null)) { - if (((rowAxis === "R") || (rowAxis === "L")) && ((colAxis === "A") || (colAxis === "P"))) { - label = daikon.Image.SLICE_DIRECTION_AXIAL; - } else if (((colAxis === "R") || (colAxis === "L")) && ((rowAxis === "A") || (rowAxis === "P"))) { - label = daikon.Image.SLICE_DIRECTION_AXIAL; - } else if (((rowAxis === "R") || (rowAxis === "L")) && ((colAxis === "H") || (colAxis === "F"))) { - label = daikon.Image.SLICE_DIRECTION_CORONAL; - } else if (((colAxis === "R") || (colAxis === "L")) && ((rowAxis === "H") || (rowAxis === "F"))) { - label = daikon.Image.SLICE_DIRECTION_CORONAL; - } else if (((rowAxis === "A") || (rowAxis === "P")) && ((colAxis === "H") || (colAxis === "F"))) { - label = daikon.Image.SLICE_DIRECTION_SAGITTAL; - } else if (((colAxis === "A") || (colAxis === "P")) && ((rowAxis === "H") || (rowAxis === "F"))) { - label = daikon.Image.SLICE_DIRECTION_SAGITTAL; - } + const rowAxis = this.getMajorAxisFromPatientRelativeDirectionCosine(dirCos[0], dirCos[1], dirCos[2]) + const colAxis = this.getMajorAxisFromPatientRelativeDirectionCosine(dirCos[3], dirCos[4], dirCos[5]) + + if (rowAxis !== null && colAxis !== null) { + if ((rowAxis === 'R' || rowAxis === 'L') && (colAxis === 'A' || colAxis === 'P')) { + label = Image.SLICE_DIRECTION_AXIAL + } else if ((colAxis === 'R' || colAxis === 'L') && (rowAxis === 'A' || rowAxis === 'P')) { + label = Image.SLICE_DIRECTION_AXIAL + } else if ((rowAxis === 'R' || rowAxis === 'L') && (colAxis === 'H' || colAxis === 'F')) { + label = Image.SLICE_DIRECTION_CORONAL + } else if ((colAxis === 'R' || colAxis === 'L') && (rowAxis === 'H' || rowAxis === 'F')) { + label = Image.SLICE_DIRECTION_CORONAL + } else if ((rowAxis === 'A' || rowAxis === 'P') && (colAxis === 'H' || colAxis === 'F')) { + label = Image.SLICE_DIRECTION_SAGITTAL + } else if ((colAxis === 'A' || colAxis === 'P') && (rowAxis === 'H' || rowAxis === 'F')) { + label = Image.SLICE_DIRECTION_SAGITTAL + } } else { - label = daikon.Image.SLICE_DIRECTION_OBLIQUE; + label = Image.SLICE_DIRECTION_OBLIQUE } - return label; -}; - - - -// returns an array of tags -/** - * Returns encapsulated data tags. - * @returns {daikon.Tag[]} - */ -daikon.Image.prototype.getEncapsulatedData = function () { - var buffer, parser; - - daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); - - buffer = this.getPixelData().value.buffer; - parser = new daikon.Parser(); - return parser.parseEncapsulated(new DataView(buffer)); -}; - + return label + } + // returns an array of tags + /** + * Returns encapsulated data tags. + * @returns {daikon.Tag[]} + */ + getEncapsulatedData() { + const buffer = this.getPixelData().value.buffer + const parser = new Parser() + return parser.parseEncapsulated(new DataView(buffer)) + } -daikon.Image.prototype.getJpegs = function () { - var encapTags, numTags, ctr, currentJpeg, data = [], dataConcat = []; + getJpegs() { + let numTags + let currentJpeg + const data = [] + const dataConcat = [] - encapTags = this.getEncapsulatedData(); + const encapTags = this.getEncapsulatedData() // organize data as an array of an array of JPEG parts if (encapTags) { - numTags = encapTags.length; - - for (ctr = 0; ctr < numTags; ctr += 1) { - if (daikon.CompressionUtils.isHeaderJPEG(encapTags[ctr].value) || - daikon.CompressionUtils.isHeaderJPEG2000(encapTags[ctr].value)) { - currentJpeg = []; - currentJpeg.push(encapTags[ctr].value.buffer); - data.push(currentJpeg); - } else if (currentJpeg && encapTags[ctr].value) { - currentJpeg.push(encapTags[ctr].value.buffer); - } + numTags = encapTags.length + + for (let ctr = 0; ctr < numTags; ctr += 1) { + if (isHeaderJPEG(encapTags[ctr].value) || isHeaderJPEG2000(encapTags[ctr].value)) { + currentJpeg = [] + currentJpeg.push(encapTags[ctr].value.buffer) + data.push(currentJpeg) + } else if (currentJpeg && encapTags[ctr].value) { + currentJpeg.push(encapTags[ctr].value.buffer) } + } } // concat into an array of full JPEGs - for (ctr = 0; ctr < data.length; ctr += 1) { - if (data[ctr].length > 1) { - dataConcat[ctr] = daikon.Utils.concatArrayBuffers2(data[ctr]); - } else { - dataConcat[ctr] = data[ctr][0]; - } - - data[ctr] = null; + for (let ctr = 0; ctr < data.length; ctr += 1) { + if (data[ctr].length > 1) { + dataConcat[ctr] = concatArrayBuffers2(data[ctr]) + } else { + dataConcat[ctr] = data[ctr][0] + } + + data[ctr] = null } - return dataConcat; -}; - + return dataConcat + } + getRLE() { + let numTags + const data = [] -daikon.Image.prototype.getRLE = function () { - var encapTags, numTags, ctr, data = []; - - encapTags = this.getEncapsulatedData(); + const encapTags = this.getEncapsulatedData() // organize data as an array of an array of JPEG parts if (encapTags) { - numTags = encapTags.length; + numTags = encapTags.length - // the first sublist item contains offsets, need offsets? - for (ctr = 1; ctr < numTags; ctr += 1) { - if (encapTags[ctr].value) { - data.push(encapTags[ctr].value.buffer); - } + // the first sublist item contains offsets, need offsets? + for (let ctr = 1; ctr < numTags; ctr += 1) { + if (encapTags[ctr].value) { + data.push(encapTags[ctr].value.buffer) } + } } - return data; -}; - - -/** - * Returns a string of interpreted private data. - * @returns {string} - */ -daikon.Image.prototype.getAllInterpretedPrivateData = function() { - var ctr, key, tag, str = ""; - - var sorted_keys = Object.keys(this.tags).sort(); - - for (ctr = 0; ctr < sorted_keys.length; ctr+=1) { - key = sorted_keys[ctr]; - if (this.tags.hasOwnProperty(key)) { - tag = this.tags[key]; - if (tag.hasInterpretedPrivateData()) { - str += tag.value; - } + return data + } + + /** + * Returns a string of interpreted private data. + * @returns {string} + */ + getAllInterpretedPrivateData() { + let key + let tag + let str = '' + + const sorted_keys = Object.keys(this.tags).sort() + + for (let ctr = 0; ctr < sorted_keys.length; ctr += 1) { + key = sorted_keys[ctr] + if (this.tags[key] !== undefined) { + tag = this.tags[key] + if (tag.hasInterpretedPrivateData()) { + str += tag.value } + } } - return str; -}; - - -/** - * Returns a string representation of this image. - * @returns {string} - */ -daikon.Image.prototype.toString = function () { - var ctr, tag, key, str = ""; - - var sorted_keys = Object.keys(this.tags).sort(); - - for (ctr = 0; ctr < sorted_keys.length; ctr+=1) { - key = sorted_keys[ctr]; - if (this.tags.hasOwnProperty(key)) { - tag = this.tags[key]; - str += (tag.toHTMLString() + "
"); - } + return str + } + + /** + * Returns a string representation of this image. + * @returns {string} + */ + toString() { + let tag + let key + let str = '' + + const sorted_keys = Object.keys(this.tags).sort() + + for (let ctr = 0; ctr < sorted_keys.length; ctr += 1) { + key = sorted_keys[ctr] + if (this.tags[key] !== undefined) { + tag = this.tags[key] + str += tag.toHTMLString() + '
' + } } - str = str.replace(/\n\s*\n/g, '\n'); // replace mutli-newlines with single newline - str = str.replace(/(?:\r\n|\r|\n)/g, '
'); // replace newlines with
- - return str; -}; + str = str.replace(/\n\s*\n/g, '\n') // replace mutli-newlines with single newline + str = str.replace(/(?:\r\n|\r|\n)/g, '
') // replace newlines with
+ return str + } - -daikon.Image.prototype.getPalleteValues = function (tagID) { - /*jslint bitwise: true */ - - var valsBig, valsLittle, value, numVals, ctr, valsBigMax, valsBigMin, valsLittleMax, valsLittleMin, valsBigDiff, - valsLittleDiff; - - valsBig = null; - valsLittle = null; - - value = daikon.Image.getValueSafely(this.getTag(tagID[0], tagID[1])); + getPalleteValues(tagID) { + const value = this.getValueSafely(this.getTag(tagID[0], tagID[1])) if (value !== null) { - numVals = value.buffer.byteLength / 2; - valsBig = []; - valsLittle = []; - - for (ctr = 0; ctr < numVals; ctr += 1) { - valsBig[ctr] = (value.getUint16(ctr * 2, false) & 0xFFFF); - valsLittle[ctr] = (value.getUint16(ctr * 2, true) & 0xFFFF); - } - - valsBigMax = Math.max.apply(Math, valsBig); - valsBigMin = Math.min.apply(Math, valsBig); - valsLittleMax = Math.max.apply(Math, valsLittle); - valsLittleMin = Math.min.apply(Math, valsLittle); - valsBigDiff = Math.abs(valsBigMax - valsBigMin); - valsLittleDiff = Math.abs(valsLittleMax - valsLittleMin); - - if (valsBigDiff < valsLittleDiff) { - return this.scalePalette(valsBig); - } else { - return this.scalePalette(valsLittle); - } + const numVals = value.buffer.byteLength / 2 + const valsBig = [] + const valsLittle = [] + + for (let ctr = 0; ctr < numVals; ctr += 1) { + valsBig[ctr] = value.getUint16(ctr * 2, false) & 0xffff + valsLittle[ctr] = value.getUint16(ctr * 2, true) & 0xffff + } + + const valsBigMax = Math.max.apply(Math, valsBig) + const valsBigMin = Math.min.apply(Math, valsBig) + const valsLittleMax = Math.max.apply(Math, valsLittle) + const valsLittleMin = Math.min.apply(Math, valsLittle) + const valsBigDiff = Math.abs(valsBigMax - valsBigMin) + const valsLittleDiff = Math.abs(valsLittleMax - valsLittleMin) + + if (valsBigDiff < valsLittleDiff) { + return this.scalePalette(valsBig) + } else { + return this.scalePalette(valsLittle) + } } - return null; -}; - - + return null + } -daikon.Image.prototype.scalePalette = function (pal) { - var min, max, ctr, slope, intercept; + scalePalette(pal) { + const max = Math.max.apply(Math, pal) + const min = Math.min.apply(Math, pal) - max = Math.max.apply(Math, pal); - min = Math.min.apply(Math, pal); + if (max > 255 || min < 0) { + const slope = 255.0 / (max - min) + const intercept = min - if ((max > 255) || (min < 0)) { - slope = 255.0 / (max - min); - intercept = min; - - for (ctr = 0; ctr < pal.length; ctr += 1) { - pal[ctr] = parseInt(Math.round((pal[ctr] - intercept) * slope)); - } + for (let ctr = 0; ctr < pal.length; ctr += 1) { + pal[ctr] = parseInt(Math.round((pal[ctr] - intercept) * slope)) + } } - return pal; -}; - - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Image; + return pal + } } diff --git a/src/iterator.js b/src/iterator.js index 4656535..7ee7352 100644 --- a/src/iterator.js +++ b/src/iterator.js @@ -1,38 +1,18 @@ - -/*jslint browser: true, node: true */ -/*global require */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; - - -/*** Constructor ***/ -daikon.OrderedMapIterator = daikon.OrderedMapIterator || function (orderedMap) { - this.orderedMap = orderedMap; - this.index = 0; -}; - - -/*** Prototype Methods ***/ - -daikon.OrderedMapIterator.prototype.hasNext = function() { - return (this.index < this.orderedMap.orderedKeys.length); -}; - - - -daikon.OrderedMapIterator.prototype.next = function() { - var item = this.orderedMap.get(this.orderedMap.orderedKeys[this.index]); - this.index += 1; - return item; -}; - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.OrderedMapIterator; +export class OrderedMapIterator { + index = 0 + orderedMap + + constructor(orderedMap) { + this.orderedMap = orderedMap + } + + hasNext() { + return this.index < this.orderedMap.orderedKeys.length + } + + next() { + const item = this.orderedMap.get(this.orderedMap.orderedKeys[this.index]) + this.index += 1 + return item + } } diff --git a/src/license.js b/src/license.js index 3b0b6ea..fe95d13 100644 --- a/src/license.js +++ b/src/license.js @@ -15,22 +15,6 @@ * limitations under the License. */ -/*! jpx.js - * Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /*! lossless.js * Copyright (C) 2015 Michael Martinez * Changes: Added support for selection values 2-7, fixed minor bugs & @@ -55,4 +39,4 @@ * You should have received a copy of the GNU Lesser General Public License * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ \ No newline at end of file + */ diff --git a/src/main.js b/src/main.js index 93e0bac..f63bde0 100644 --- a/src/main.js +++ b/src/main.js @@ -1,47 +1,12 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ****/ - -/** - * daikon - * @type {*|{}} - */ -var daikon = daikon || {}; - -daikon.CompressionUtils = daikon.CompressionUtils || ((typeof require !== 'undefined') ? require('./compression-utils.js') : null); -daikon.Dictionary = daikon.Dictionary || ((typeof require !== 'undefined') ? require('./dictionary.js') : null); -daikon.Image = daikon.Image || ((typeof require !== 'undefined') ? require('./image.js') : null); -daikon.OrderedMapIterator = daikon.OrderedMapIterator || ((typeof require !== 'undefined') ? require('./iterator.js') : null); -daikon.OrderedMap = daikon.OrderedMap || ((typeof require !== 'undefined') ? require('./orderedmap.js') : null); -daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); -daikon.RLE = daikon.RLE || ((typeof require !== 'undefined') ? require('./rle.js') : null); -daikon.Series = daikon.Series || ((typeof require !== 'undefined') ? require('./series.js') : null); -daikon.Tag = daikon.Tag || ((typeof require !== 'undefined') ? require('./tag.js') : null); -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); -daikon.Siemens = daikon.Siemens || ((typeof require !== 'undefined') ? require('./siemens.js') : null); - -var jpeg = jpeg || {}; -jpeg.lossless = jpeg.lossless || {}; -jpeg.lossless.Decoder = ((typeof require !== 'undefined') ? require('jpeg-lossless-decoder-js') : null); - -var JpegDecoder = JpegDecoder || ((typeof require !== 'undefined') ? require('../lib/jpeg-baseline.js').JpegImage : null); - -var JpxImage = JpxImage || ((typeof require !== 'undefined') ? require('../lib/jpx.js') : null); - -var CharLS = CharLS || ((typeof require !== 'undefined') ? require('../lib/charLS-DynamicMemory-browser.js') : null); -var JpegLSDecoder = JpegLSDecoder || ((typeof require !== 'undefined') ? require('../lib/jpeg-ls.js') : null); - -//use fflate not pako -var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); -//var fflate = fflate || ((typeof require !== 'undefined') ? require('fflate') : null); - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon; -} +export * as CompressionUtils from './compression-utils.js' +export * as Utils from './utilities.js' +export * as Dictionary from './dictionary.js' + +export * from './image.js' +export * from './iterator.js' +export * from './orderedmap.js' +export * from './parser.js' +export * from './rle.js' +export * from './series.js' +export * from './tag.js' +export * from './siemens.js' diff --git a/src/orderedmap.js b/src/orderedmap.js index d1f119b..d1a3b83 100644 --- a/src/orderedmap.js +++ b/src/orderedmap.js @@ -1,79 +1,53 @@ +import { OrderedMapIterator } from './iterator.js' -/*jslint browser: true, node: true */ -/*global require */ +export class OrderedMap { + map = {} + orderedKeys = [] -"use strict"; - -// Based on: http://stackoverflow.com/questions/3549894/javascript-data-structure-for-fast-lookup-and-ordered-looping - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.OrderedMapIterator = daikon.OrderedMapIterator || ((typeof require !== 'undefined') ? require('./iterator.js') : null); - - -/*** Constructor ***/ -daikon.OrderedMap = daikon.OrderedMap || function () { - this.map = {}; - this.orderedKeys = []; -}; - - - -daikon.OrderedMap.prototype.put = function(key, value) { - if (key in this.map) { // key already exists, replace value - this.map[key] = value; - } else { // insert new key and value - this.orderedKeys.push(key); - this.orderedKeys.sort(function(a, b) { return parseFloat(a) - parseFloat(b); }); - this.map[key] = value; + put(key, value) { + if (key in this.map) { + // key already exists, replace value + this.map[key] = value + } else { + // insert new key and value + this.orderedKeys.push(key) + this.orderedKeys.sort(function (a, b) { + return parseFloat(a) - parseFloat(b) + }) + this.map[key] = value } -}; - - + } -daikon.OrderedMap.prototype.remove = function(key) { - var index = this.orderedKeys.indexOf(key); - if(index === -1) { - throw new Error('key does not exist'); + remove(key) { + const index = this.orderedKeys.indexOf(key) + if (index === -1) { + throw new Error('key does not exist') } - this.orderedKeys.splice(index, 1); - delete this.map[key]; -}; + this.orderedKeys.splice(index, 1) + delete this.map[key] + } - - -daikon.OrderedMap.prototype.get = function(key) { + get(key) { if (key in this.map) { - return this.map[key]; + return this.map[key] } - return null; -}; - - - -daikon.OrderedMap.prototype.iterator = function() { - return new daikon.OrderedMapIterator(this); -}; + return null + } + iterator() { + return new OrderedMapIterator(this) + } - -daikon.OrderedMap.prototype.getOrderedValues = function() { - var orderedValues = [], it = this.iterator(); + getOrderedValues() { + const orderedValues = [] + const it = this.iterator() while (it.hasNext()) { - orderedValues.push(it.next()); + orderedValues.push(it.next()) } - return orderedValues; -}; - - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.OrderedMap; + return orderedValues + } } diff --git a/src/parser.js b/src/parser.js index 0b8b6ac..a680cea 100644 --- a/src/parser.js +++ b/src/parser.js @@ -1,439 +1,434 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.Tag = daikon.Tag || ((typeof require !== 'undefined') ? require('./tag.js') : null); -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); -daikon.Dictionary = daikon.Dictionary || ((typeof require !== 'undefined') ? require('./dictionary.js') : null); -daikon.Image = daikon.Image || ((typeof require !== 'undefined') ? require('./image.js') : null); - -//use fflate not pako -var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); -//var fflate = fflate || ((typeof require !== 'undefined') ? require('fflate') : null); - -/*** Constructor ***/ - -/** - * The Parser constructor. - * @property {boolean} explicit - * @property {boolean} littleEndian - * @type {Function} - */ -daikon.Parser = daikon.Parser || function () { - this.littleEndian = true; - this.explicit = true; - this.metaFound = false; - this.metaFinished = false; - this.metaFinishedOffset = -1; - this.needsDeflate = false; - this.inflated = null; - this.encapsulation = false; - this.level = 0; - this.error = null; -}; - - -/*** Static Fields ***/ - -/** - * Global property to output string representation of tags as they are parsed. - * @type {boolean} - */ -daikon.Parser.verbose = false; - - -/*** Static Pseudo-constants ***/ - -daikon.Parser.MAGIC_COOKIE_OFFSET = 128; -daikon.Parser.MAGIC_COOKIE = [68, 73, 67, 77]; -daikon.Parser.VRS = ["AE", "AS", "AT", "CS", "DA", "DS", "DT", "FL", "FD", "IS", "LO", "LT", "OB", "OD", "OF", "OW", "PN", "SH", "SL", "SS", "ST", "TM", "UI", "UL", "UN", "US", "UT", "UC"]; -daikon.Parser.DATA_VRS = ["OB", "OW", "OF", "SQ", "UT", "UN", "UC"]; -daikon.Parser.RAW_DATA_VRS = ["OB", "OD", "OF", "OW", "UN"]; -daikon.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE = "1.2.840.10008.1.2"; -daikon.Parser.TRANSFER_SYNTAX_EXPLICIT_LITTLE = "1.2.840.10008.1.2.1"; -daikon.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG = "1.2.840.10008.1.2.2"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG = "1.2.840.10008.1.2.4"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS = "1.2.840.10008.1.2.4.57"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1 = "1.2.840.10008.1.2.4.70"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT = "1.2.840.10008.1.2.4.50"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT = "1.2.840.10008.1.2.4.51"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS = "1.2.840.10008.1.2.4.80"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LS = "1.2.840.10008.1.2.4.81"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS = "1.2.840.10008.1.2.4.90"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000 = "1.2.840.10008.1.2.4.91"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE = "1.2.840.10008.1.2.5"; -daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE = "1.2.840.10008.1.2.1.99"; -daikon.Parser.UNDEFINED_LENGTH = 0xFFFFFFFF; - - -/*** Static Methods ***/ - -/** - * Returns true if the DICOM magic cookie is found. - * @param {DataView} data - * @returns {boolean} - */ -daikon.Parser.isMagicCookieFound = function (data) { - var offset = daikon.Parser.MAGIC_COOKIE_OFFSET, magicCookieLength = daikon.Parser.MAGIC_COOKIE.length, ctr; - - for (ctr = 0; ctr < magicCookieLength; ctr += 1) { - if (data.getUint8(offset + ctr) !== daikon.Parser.MAGIC_COOKIE[ctr]) { - return false; - } +import { inflateRaw } from 'pako' +import { Image } from './image.js' +import { concatArrayBuffers, getStringAt } from './utilities.js' +import { getVR } from './dictionary.js' +import { Tag } from './tag.js' + +export class Parser { + static MAGIC_COOKIE_OFFSET = 128 + static MAGIC_COOKIE = [68, 73, 67, 77] + static VRS = [ + 'AE', + 'AS', + 'AT', + 'CS', + 'DA', + 'DS', + 'DT', + 'FL', + 'FD', + 'IS', + 'LO', + 'LT', + 'OB', + 'OD', + 'OF', + 'OW', + 'PN', + 'SH', + 'SL', + 'SS', + 'ST', + 'TM', + 'UI', + 'UL', + 'UN', + 'US', + 'UT', + 'UC' + ] + + static DATA_VRS = ['OB', 'OW', 'OF', 'SQ', 'UT', 'UN', 'UC'] + static RAW_DATA_VRS = ['OB', 'OD', 'OF', 'OW', 'UN'] + static TRANSFER_SYNTAX_IMPLICIT_LITTLE = '1.2.840.10008.1.2' + static TRANSFER_SYNTAX_EXPLICIT_LITTLE = '1.2.840.10008.1.2.1' + static TRANSFER_SYNTAX_EXPLICIT_BIG = '1.2.840.10008.1.2.2' + static TRANSFER_SYNTAX_COMPRESSION_JPEG = '1.2.840.10008.1.2.4' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS = '1.2.840.10008.1.2.4.57' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1 = '1.2.840.10008.1.2.4.70' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT = '1.2.840.10008.1.2.4.50' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT = '1.2.840.10008.1.2.4.51' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_LS_LOSSLESS = '1.2.840.10008.1.2.4.80' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_LS = '1.2.840.10008.1.2.4.81' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS = '1.2.840.10008.1.2.4.90' + static TRANSFER_SYNTAX_COMPRESSION_JPEG_2000 = '1.2.840.10008.1.2.4.91' + static TRANSFER_SYNTAX_COMPRESSION_RLE = '1.2.840.10008.1.2.5' + static TRANSFER_SYNTAX_COMPRESSION_DEFLATE = '1.2.840.10008.1.2.1.99' + static UNDEFINED_LENGTH = 0xffffffff + + littleEndian = true + explicit = true + metaFound = false + metaFinished = false + metaFinishedOffset = -1 + needsDeflate = false + inflated = null + encapsulation = false + level = 0 + error = null + verbose = false + + /** + * Returns true if the DICOM magic cookie is found. + * @param {DataView} data + * @returns {boolean} + */ + static isMagicCookieFound(data) { + const offset = Parser.MAGIC_COOKIE_OFFSET + const magicCookieLength = Parser.MAGIC_COOKIE.length + + for (let ctr = 0; ctr < magicCookieLength; ctr += 1) { + if (data.getUint8(offset + ctr) !== Parser.MAGIC_COOKIE[ctr]) { + return false + } } - return true; -}; - - -/*** Prototype Methods ***/ - -/** - * Parses this data and returns an image object. - * @param {DataView} data - * @returns {daikon.Image|null} - */ -daikon.Parser.prototype.parse = function (data) { - var image = null, offset, tag, copyMeta, copyDeflated; + return true + } + + /** + * Parses this data and returns an image object. + * @param {DataView} data + * @returns {daikon.Image|null} + */ + parse(data) { + let image = null + let offset + let tag + let copyMeta + let copyDeflated try { - image = new daikon.Image(); - offset = this.findFirstTagOffset(data); - tag = this.getNextTag(data, offset); + image = new Image() + offset = this.findFirstTagOffset(data) + tag = this.getNextTag(data, offset) - while (tag !== null) { - if (daikon.Parser.verbose) { - console.log(tag.toString()); - } + while (tag !== null) { + if (this.verbose) { + console.info(tag.toString()) + } - image.putTag(tag); + image.putTag(tag) - if (tag.isPixelData()) { - break; - } - - if (this.needsDeflate && (tag.offsetEnd >= this.metaFinishedOffset)) { - this.needsDeflate = false; - copyMeta = data.buffer.slice(0, tag.offsetEnd); - copyDeflated = data.buffer.slice(tag.offsetEnd); - this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, pako.inflateRaw(copyDeflated)); - //this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, fflate.decompressSync(new Uint8Array(copyDeflated))); - data = new DataView(this.inflated); - } + if (tag.isPixelData()) { + break + } - tag = this.getNextTag(data, tag.offsetEnd); + if (this.needsDeflate && tag.offsetEnd >= this.metaFinishedOffset) { + this.needsDeflate = false + copyMeta = data.buffer.slice(0, tag.offsetEnd) + copyDeflated = data.buffer.slice(tag.offsetEnd) + this.inflated = concatArrayBuffers(copyMeta, inflateRaw(copyDeflated)) + // this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, fflate.decompressSync(new Uint8Array(copyDeflated))); + data = new DataView(this.inflated) } + + tag = this.getNextTag(data, tag.offsetEnd) + } } catch (err) { - this.error = err; + this.error = err } if (image !== null) { - image.littleEndian = this.littleEndian; + image.littleEndian = this.littleEndian } - return image; -}; + return image + } + parseEncapsulated(data) { + const offset = 0 + let tag + const tags = [] - -daikon.Parser.prototype.parseEncapsulated = function (data) { - var offset = 0, tag, tags = []; - - this.encapsulation = true; + this.encapsulation = true try { - tag = this.getNextTag(data, offset); + tag = this.getNextTag(data, offset) - while (tag !== null) { - if (tag.isSublistItem()) { - tags.push(tag); - } - - if (daikon.Parser.verbose) { - console.log(tag.toString()); - } + while (tag !== null) { + if (tag.isSublistItem()) { + tags.push(tag) + } - tag = this.getNextTag(data, tag.offsetEnd); + if (this.verbose) { + console.info(tag.toString()) } - } catch (err) { - this.error = err; + tag = this.getNextTag(data, tag.offsetEnd) + } + } catch (err) { + this.error = err } - return tags; -}; - - + return tags + } -daikon.Parser.prototype.testForValidTag = function (data) { - var offset, tag = null; + testForValidTag(data) { + let offset + let tag = null try { - offset = this.findFirstTagOffset(data); - tag = this.getNextTag(data, offset, false); + offset = this.findFirstTagOffset(data) + tag = this.getNextTag(data, offset, false) } catch (err) { - this.error = err; + this.error = err } - return tag; -}; + return tag + } - - -daikon.Parser.prototype.getNextTag = function (data, offset, testForTag) { - var group = 0, element, value = null, offsetStart = offset, offsetValue, length = 0, little = true, vr = null, tag; + getNextTag(data, offset, testForTag) { + let group = 0 + let value = null + const offsetStart = offset + let length = 0 + let little = true + let vr = null if (offset >= data.byteLength) { - return null; + return null } if (this.metaFinished) { - little = this.littleEndian; - group = data.getUint16(offset, little); + little = this.littleEndian + group = data.getUint16(offset, little) } else { - group = data.getUint16(offset, true); - - if (((this.metaFinishedOffset !== -1) && (offset >= this.metaFinishedOffset)) || (group !== 0x0002)) { - this.metaFinished = true; - little = this.littleEndian; - group = data.getUint16(offset, little); - } else { - little = true; - } + group = data.getUint16(offset, true) + + if ((this.metaFinishedOffset !== -1 && offset >= this.metaFinishedOffset) || group !== 0x0002) { + this.metaFinished = true + little = this.littleEndian + group = data.getUint16(offset, little) + } else { + little = true + } } - if (!this.metaFound && (group === 0x0002)) { - this.metaFound = true; + if (!this.metaFound && group === 0x0002) { + this.metaFound = true } - offset += 2; + offset += 2 - element = data.getUint16(offset, little); - offset += 2; + const element = data.getUint16(offset, little) + offset += 2 if (this.explicit || !this.metaFinished) { - vr = daikon.Utils.getStringAt(data, offset, 2); + vr = getStringAt(data, offset, 2) - if (!this.metaFound && this.metaFinished && (daikon.Parser.VRS.indexOf(vr) === -1)) { - vr = daikon.Dictionary.getVR(group, element); - length = data.getUint32(offset, little); - offset += 4; - this.explicit = false; - } else { - offset += 2; + if (!this.metaFound && this.metaFinished && Parser.VRS.indexOf(vr) === -1) { + vr = getVR(group, element) + length = data.getUint32(offset, little) + offset += 4 + this.explicit = false + } else { + offset += 2 - if (daikon.Parser.DATA_VRS.indexOf(vr) !== -1) { - offset += 2; // skip two empty bytes + if (Parser.DATA_VRS.indexOf(vr) !== -1) { + offset += 2 // skip two empty bytes - length = data.getUint32(offset, little); - offset += 4; - } else { - length = data.getUint16(offset, little); - offset += 2; - } + length = data.getUint32(offset, little) + offset += 4 + } else { + length = data.getUint16(offset, little) + offset += 2 } + } } else { - vr = daikon.Dictionary.getVR(group, element); - length = data.getUint32(offset, little); + vr = getVR(group, element) + length = data.getUint32(offset, little) - if (length === daikon.Parser.UNDEFINED_LENGTH) { - vr = 'SQ'; - } + if (length === Parser.UNDEFINED_LENGTH) { + vr = 'SQ' + } - offset += 4; + offset += 4 } - offsetValue = offset; + const offsetValue = offset - var isPixelData = ((group === daikon.Tag.TAG_PIXEL_DATA[0]) && (element === daikon.Tag.TAG_PIXEL_DATA[1])); + const isPixelData = group === Tag.TAG_PIXEL_DATA[0] && element === Tag.TAG_PIXEL_DATA[1] /* color lookup data will be in (0028,12XX), so don't try to treat these as a sublist even though it can look like a list. Example: (0028,1201) OW 0000\ffff\ffff\0000\ffff\ffff\0000\cccc\0000\0000\1e1e\0000\0101... # 512, 1 RedPaletteColorLookupTableData (0028,1202) OW 0000\ffff\0000\ffff\8080\3333\ffff\b3b3\0000\0000\1e1e\0000\0101... # 512, 1 GreenPaletteColorLookupTableData (0028,1203) OW 0000\0000\ffff\ffff\0000\4d4d\0000\0000\0000\0000\1e1e\0000\0101... # 512, 1 BluePaletteColorLookupTableData */ - var isLookupTableData = 0x0028 === group && element>= 0x1201 && element<0x1300; - - if ((vr === 'SQ') || (!isLookupTableData && !isPixelData && !this.encapsulation && (daikon.Parser.DATA_VRS.indexOf(vr) !== -1) && (vr !== 'UC'))) { - value = this.parseSublist(data, offset, length, vr !== 'SQ'); - - if (length === daikon.Parser.UNDEFINED_LENGTH) { - length = value[value.length - 1].offsetEnd - offset; - } - } else if ((length > 0) && !testForTag) { - if (length === daikon.Parser.UNDEFINED_LENGTH) { - if (isPixelData) { - length = (data.byteLength - offset); - } + const isLookupTableData = group === 0x0028 && element >= 0x1201 && element < 0x1300 + + if ( + vr === 'SQ' || + (!isLookupTableData && !isPixelData && !this.encapsulation && Parser.DATA_VRS.indexOf(vr) !== -1 && vr !== 'UC') + ) { + value = this.parseSublist(data, offset, length, vr !== 'SQ') + + if (length === Parser.UNDEFINED_LENGTH) { + length = value[value.length - 1].offsetEnd - offset + } + } else if (length > 0 && !testForTag) { + if (length === Parser.UNDEFINED_LENGTH) { + if (isPixelData) { + length = data.byteLength - offset } + } - value = data.buffer.slice(offset, offset + length); + value = data.buffer.slice(offset, offset + length) } - offset += length; - tag = new daikon.Tag(group, element, vr, value, offsetStart, offsetValue, offset, this.littleEndian, this.charset); + offset += length + const tag = new Tag(group, element, vr, value, offsetStart, offsetValue, offset, this.littleEndian, this.charset) if (tag.value) { - if (tag.isTransformSyntax()) { - // 传输语法已存在 - this.transformSyntaxAlreadyExist = true; - if (tag.value[0] === daikon.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE) { - this.explicit = false; - this.littleEndian = true; - } else if (tag.value[0] === daikon.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG) { - this.explicit = true; - this.littleEndian = false; - } else if (tag.value[0] === daikon.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE) { - this.needsDeflate = true; - this.explicit = true; - this.littleEndian = true; - } else { - this.explicit = true; - this.littleEndian = true; - } - } else if (tag.isMetaLength()) { - this.metaFinishedOffset = tag.value[0] + offset; - } else if (tag.isCharset()) { - var charset = tag.value; - if (charset.length == 2) { - charset = (charset[0] || "ISO 2022 IR 6") + "\\" + charset[1]; - } - else if (charset.length == 1) { - - charset = charset[0]; - } - this.charset = charset; + if (tag.isTransformSyntax()) { + this.transformSyntaxAlreadyExist = true + if (tag.value[0] === Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE) { + this.explicit = false + this.littleEndian = true + } else if (tag.value[0] === Parser.TRANSFER_SYNTAX_EXPLICIT_BIG) { + this.explicit = true + this.littleEndian = false + } else if (tag.value[0] === Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE) { + this.needsDeflate = true + this.explicit = true + this.littleEndian = true + } else { + this.explicit = true + this.littleEndian = true + } + } else if (tag.isMetaLength()) { + this.metaFinishedOffset = tag.value[0] + offset + } else if (tag.isCharset()) { + let charset = tag.value + if (charset.length === 2) { + charset = (charset[0] || 'ISO 2022 IR 6') + '\\' + charset[1] + } else if (charset.length === 1) { + charset = charset[0] } + this.charset = charset + } } - return tag; -}; + return tag + } + parseSublist(data, offset, length, raw) { + let sublistItem + const offsetEnd = offset + length + const tags = [] + this.level++ -daikon.Parser.prototype.parseSublist = function (data, offset, length, raw) { - var sublistItem, - offsetEnd = offset + length, - tags = []; + if (length === Parser.UNDEFINED_LENGTH) { + sublistItem = this.parseSublistItem(data, offset, raw) - this.level++; + while (!sublistItem.isSequenceDelim()) { + tags.push(sublistItem) + offset = sublistItem.offsetEnd + sublistItem = this.parseSublistItem(data, offset, raw) + } - if (length === daikon.Parser.UNDEFINED_LENGTH) { - sublistItem = this.parseSublistItem(data, offset, raw); - - while (!sublistItem.isSequenceDelim()) { - tags.push(sublistItem); - offset = sublistItem.offsetEnd; - sublistItem = this.parseSublistItem(data, offset, raw); - } - - tags.push(sublistItem); + tags.push(sublistItem) } else { - while (offset < offsetEnd) { - sublistItem = this.parseSublistItem(data, offset, raw); - tags.push(sublistItem); - offset = sublistItem.offsetEnd; - } + while (offset < offsetEnd) { + sublistItem = this.parseSublistItem(data, offset, raw) + tags.push(sublistItem) + offset = sublistItem.offsetEnd + } } - this.level--; - - return tags; -}; + this.level-- + return tags + } + parseSublistItem(data, offset, raw) { + let offsetEnd + let tag + const offsetStart = offset + let value = null + const tags = [] -daikon.Parser.prototype.parseSublistItem = function (data, offset, raw) { - var group, element, length, offsetEnd, tag, offsetStart = offset, value = null, offsetValue, sublistItemTag, tags = []; + const group = data.getUint16(offset, this.littleEndian) + offset += 2 - group = data.getUint16(offset, this.littleEndian); - offset += 2; + const element = data.getUint16(offset, this.littleEndian) + offset += 2 - element = data.getUint16(offset, this.littleEndian); - offset += 2; + const length = data.getUint32(offset, this.littleEndian) + offset += 4 - length = data.getUint32(offset, this.littleEndian); - offset += 4; + const offsetValue = offset - offsetValue = offset; + if (length === Parser.UNDEFINED_LENGTH) { + tag = this.getNextTag(data, offset) - if (length === daikon.Parser.UNDEFINED_LENGTH) { - tag = this.getNextTag(data, offset); + while (tag && !tag.isSublistItemDelim()) { + tags.push(tag) + offset = tag.offsetEnd + tag = this.getNextTag(data, offset) + } - while (tag && !tag.isSublistItemDelim()) { - tags.push(tag); - offset = tag.offsetEnd; - tag = this.getNextTag(data, offset); - } - - tag && tags.push(tag); - tag && (offset = tag.offsetEnd); + tag && tags.push(tag) + tag && (offset = tag.offsetEnd) } else if (raw) { - value = data.buffer.slice(offset, offset + length); - offset = offset + length; + value = data.buffer.slice(offset, offset + length) + offset = offset + length } else { - offsetEnd = offset + length; + offsetEnd = offset + length - while (offset < offsetEnd) { - tag = this.getNextTag(data, offset); - tags.push(tag); - offset = tag.offsetEnd; - } + while (offset < offsetEnd) { + tag = this.getNextTag(data, offset) + tags.push(tag) + offset = tag.offsetEnd + } } - sublistItemTag = new daikon.Tag(group, element, null, value || tags, offsetStart, offsetValue, offset, this.littleEndian); - - return sublistItemTag; -}; - - - -daikon.Parser.prototype.findFirstTagOffset = function (data) { - var offset = 0, - magicCookieLength = daikon.Parser.MAGIC_COOKIE.length, - searchOffsetMax = daikon.Parser.MAGIC_COOKIE_OFFSET * 5, - found = false, - ctr = 0, - ctrIn = 0, - ch = 0; - - if (daikon.Parser.isMagicCookieFound(data)) { - offset = daikon.Parser.MAGIC_COOKIE_OFFSET + magicCookieLength; + const sublistItemTag = new Tag( + group, + element, + null, + value || tags, + offsetStart, + offsetValue, + offset, + this.littleEndian + ) + + return sublistItemTag + } + + findFirstTagOffset(data) { + let offset = 0 + const magicCookieLength = Parser.MAGIC_COOKIE.length + const searchOffsetMax = Parser.MAGIC_COOKIE_OFFSET * 5 + let found = false + let ch = 0 + + if (Parser.isMagicCookieFound(data)) { + offset = Parser.MAGIC_COOKIE_OFFSET + magicCookieLength } else { - for (ctr = 0; ctr < searchOffsetMax; ctr += 1) { - ch = data.getUint8(ctr); - if (ch === daikon.Parser.MAGIC_COOKIE[0]) { - found = true; - for (ctrIn = 1; ctrIn < magicCookieLength; ctrIn += 1) { - if (data.getUint8(ctr + ctrIn) !== daikon.Parser.MAGIC_COOKIE[ctrIn]) { - found = false; - } - } - - if (found) { - offset = ctr + magicCookieLength; - break; - } + for (let ctr = 0; ctr < searchOffsetMax; ctr += 1) { + ch = data.getUint8(ctr) + if (ch === Parser.MAGIC_COOKIE[0]) { + found = true + for (let ctrIn = 1; ctrIn < magicCookieLength; ctrIn += 1) { + if (data.getUint8(ctr + ctrIn) !== Parser.MAGIC_COOKIE[ctrIn]) { + found = false } + } + + if (found) { + offset = ctr + magicCookieLength + break + } } + } } - return offset; -}; - - - -daikon.Parser.prototype.hasError = function () { - return (this.error !== null); -}; - - -/*** Exports ***/ + return offset + } -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Parser; + hasError() { + return this.error !== null + } } diff --git a/src/rle.js b/src/rle.js index f2c3138..06fe9ce 100644 --- a/src/rle.js +++ b/src/rle.js @@ -1,208 +1,151 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; - - -/*** Constructor ***/ - -/** - * The RLE constructor. - * @type {Function} - */ -daikon.RLE = daikon.RLE || function () { - this.rawData = null; - this.bytesRead = 0; - this.bytesPut = 0; - this.segElemPut = 0; - this.numSegments = 0; - this.segmentOffsets = []; - this.littleEndian = true; - this.segmentIndex = 0; - this.numElements = 0; - this.size = 0; - this.output = null; -}; - - -/*** Static Pseudo-constants ***/ - -daikon.RLE.HEADER_SIZE = 64; - - -/*** Prototype Methods ***/ - -/** - * Decodes the RLE data. - * @param {ArrayBuffer} data - * @param {boolean} littleEndian - * @param {number} numElements - * @returns {DataView} - */ -daikon.RLE.prototype.decode = function (data, littleEndian, numElements) { - var ctr; - - this.rawData = new DataView(data); - this.littleEndian = littleEndian; - this.numElements = numElements; - - this.readHeader(); - this.output = new DataView(new ArrayBuffer(this.size)); - - for (ctr = 0; ctr < this.numSegments; ctr+=1) { - this.readNextSegment(); +export class RLE { + static HEADER_SIZE = 64 + + rawData = null + bytesRead = 0 + bytesPut = 0 + segElemPut = 0 + numSegments = 0 + segmentOffsets = [] + littleEndian = true + segmentIndex = 0 + numElements = 0 + size = 0 + output = null + + /** + * Decodes the RLE data. + * @param {ArrayBuffer} data + * @param {boolean} littleEndian + * @param {number} numElements + * @returns {DataView} + */ + decode(data, littleEndian, numElements) { + this.rawData = new DataView(data) + this.littleEndian = littleEndian + this.numElements = numElements + + this.readHeader() + this.output = new DataView(new ArrayBuffer(this.size)) + + for (let ctr = 0; ctr < this.numSegments; ctr += 1) { + this.readNextSegment() } - return this.processData(); -}; - - -daikon.RLE.prototype.processData = function () { - /*jslint bitwise: true */ - - var ctr, temp1, temp2, temp3, value, outputProcessed, offset; + return this.processData() + } + processData() { if (this.numSegments === 1) { - return this.output; + return this.output } else if (this.numSegments === 2) { - outputProcessed = new DataView(new ArrayBuffer(this.size)); - - for (ctr = 0; ctr < this.numElements; ctr+=1) { - temp1 = (this.output.getInt8(ctr)); - temp2 = (this.output.getInt8(ctr + this.numElements)); - value = (((temp1 & 0xFF) << 8) | (temp2 & 0xFF)); - outputProcessed.setInt16(ctr * 2, value, this.littleEndian); - } - - return outputProcessed; - } else if (this.numSegments === 3) { // rgb - outputProcessed = new DataView(new ArrayBuffer(this.size)); - offset = (2 * this.numElements); - - for (ctr = 0; ctr < this.numElements; ctr+=1) { - outputProcessed.setInt8(ctr * 3, this.output.getInt8(ctr)); - outputProcessed.setInt8(ctr * 3 + 1, this.output.getInt8(ctr + this.numElements)); - outputProcessed.setInt8(ctr * 3 + 2, this.output.getInt8(ctr + offset)); - } - - return outputProcessed; + const outputProcessed = new DataView(new ArrayBuffer(this.size)) + + for (let ctr = 0; ctr < this.numElements; ctr += 1) { + const temp1 = this.output.getInt8(ctr) + const temp2 = this.output.getInt8(ctr + this.numElements) + const value = ((temp1 & 0xff) << 8) | (temp2 & 0xff) + outputProcessed.setInt16(ctr * 2, value, this.littleEndian) + } + + return outputProcessed + } else if (this.numSegments === 3) { + // rgb + const outputProcessed = new DataView(new ArrayBuffer(this.size)) + const offset = 2 * this.numElements + + for (let ctr = 0; ctr < this.numElements; ctr += 1) { + outputProcessed.setInt8(ctr * 3, this.output.getInt8(ctr)) + outputProcessed.setInt8(ctr * 3 + 1, this.output.getInt8(ctr + this.numElements)) + outputProcessed.setInt8(ctr * 3 + 2, this.output.getInt8(ctr + offset)) + } + + return outputProcessed } else { - throw new Error("RLE data with " + this.numSegments + " segments is not supported!"); + throw new Error('RLE data with ' + this.numSegments + ' segments is not supported!') } -}; + } + readHeader() { + this.numSegments = this.getInt32() + this.size = this.numElements * this.numSegments - -daikon.RLE.prototype.readHeader = function () { - var ctr; - - this.numSegments = this.getInt32(); - this.size = this.numElements * this.numSegments; - - for (ctr = 0; ctr < this.numSegments; ctr+=1) { - this.segmentOffsets[ctr] = this.getInt32(); + for (let ctr = 0; ctr < this.numSegments; ctr += 1) { + this.segmentOffsets[ctr] = this.getInt32() } - this.bytesRead = daikon.RLE.HEADER_SIZE; -}; - - + this.bytesRead = RLE.HEADER_SIZE + } -daikon.RLE.prototype.hasValidInput = function () { - return ((this.bytesRead < this.rawData.buffer.byteLength) && - (this.bytesPut < this.size) && (this.segElemPut < this.numElements)); -}; + hasValidInput() { + return ( + this.bytesRead < this.rawData.buffer.byteLength && this.bytesPut < this.size && this.segElemPut < this.numElements + ) + } + readNextSegment() { + let code - -daikon.RLE.prototype.readNextSegment = function () { - var code; - - this.bytesRead = this.segmentOffsets[this.segmentIndex]; - this.segElemPut = 0; + this.bytesRead = this.segmentOffsets[this.segmentIndex] + this.segElemPut = 0 while (this.hasValidInput()) { - code = this.get(); - - if ((code >= 0) && (code < 128)) { - this.readLiteral(code); - } else if ((code <= -1) && (code > -128)) { - this.readEncoded(code); - } else if (code === -128) { - console.warn("RLE: unsupported code!"); - } + code = this.get() + + if (code >= 0 && code < 128) { + this.readLiteral(code) + } else if (code <= -1 && code > -128) { + this.readEncoded(code) + } else if (code === -128) { + console.warn('RLE: unsupported code!') + } } - this.segmentIndex+=1; -}; - + this.segmentIndex += 1 + } - -daikon.RLE.prototype.readLiteral = function (code) { - var ctr, length = (code + 1); + readLiteral(code) { + const length = code + 1 if (this.hasValidInput()) { - for (ctr = 0; ctr < length; ctr+=1) { - this.put(this.get()); - } + for (let ctr = 0; ctr < length; ctr += 1) { + this.put(this.get()) + } } else { - console.warn("RLE: insufficient data!"); + console.warn('RLE: insufficient data!') } -}; - - + } -daikon.RLE.prototype.readEncoded = function (code) { - var ctr, - runLength = (1 - code), - encoded = this.get(); + readEncoded(code) { + const runLength = 1 - code + const encoded = this.get() - for (ctr = 0; ctr < runLength; ctr+=1) { - this.put(encoded); + for (let ctr = 0; ctr < runLength; ctr += 1) { + this.put(encoded) } -}; - - - -daikon.RLE.prototype.getInt32 = function () { - var value = this.rawData.getInt32(this.bytesRead, this.littleEndian); - this.bytesRead += 4; - return value; -}; - - - -daikon.RLE.prototype.getInt16 = function () { - var value = this.rawData.getInt16(this.bytesRead, this.littleEndian); - this.bytesRead += 2; - return value; -}; - - - -daikon.RLE.prototype.get = function () { - var value = this.rawData.getInt8(this.bytesRead); - this.bytesRead += 1; - return value; -}; - - - -daikon.RLE.prototype.put = function (val) { - this.output.setInt8(this.bytesPut, val); - this.bytesPut += 1; - this.segElemPut += 1; -}; - - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.RLE; + } + + getInt32() { + const value = this.rawData.getInt32(this.bytesRead, this.littleEndian) + this.bytesRead += 4 + return value + } + + getInt16() { + const value = this.rawData.getInt16(this.bytesRead, this.littleEndian) + this.bytesRead += 2 + return value + } + + get() { + const value = this.rawData.getInt8(this.bytesRead) + this.bytesRead += 1 + return value + } + + put(val) { + this.output.setInt8(this.bytesPut, val) + this.bytesPut += 1 + this.segElemPut += 1 + } } diff --git a/src/series.js b/src/series.js index 0969ce7..a419ee8 100644 --- a/src/series.js +++ b/src/series.js @@ -1,583 +1,542 @@ - -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.Parser = daikon.Parser || ((typeof require !== 'undefined') ? require('./parser.js') : null); -daikon.Image = daikon.Image || ((typeof require !== 'undefined') ? require('./image.js') : null); -daikon.OrderedMap = daikon.OrderedMap || ((typeof require !== 'undefined') ? require('./orderedmap.js') : null); -daikon.OrderedMapIterator = daikon.OrderedMapIterator || ((typeof require !== 'undefined') ? require('./iterator.js') : null); -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); - - -/*** Constructor ***/ - -/** - * The Series constructor. - * @property {daikon.Image[]} images - * @type {Function} - */ -daikon.Series = daikon.Series || function () { - this.images = []; - this.imagesOriginalOrder = null; - this.isMosaic = false; - this.isElscint = false; - this.isCompressed = false; - this.numberOfFrames = 0; - this.numberOfFramesInFile = 0; - this.isMultiFrame = false; - this.isMultiFrameVolume = false; - this.isMultiFrameTimeseries = false; - this.isImplicitTimeseries = false; - this.sliceSense = false; - this.sliceDir = daikon.Image.SLICE_DIRECTION_UNKNOWN; - this.error = null; -}; - - -/*** Static fields ***/ -daikon.Series.parserError = null; - -/** - * True to keep original order of images, ignoring metadata-based ordering. - * @type {boolean} - */ -daikon.Series.useExplicitOrdering = false; - -/** - * A hint to software to use this explicit distance (mm) between slices (see daikon.Series.useExplicitOrdering) - * @type {number} - */ -daikon.Series.useExplicitSpacing = 0; - - -/*** Static Methods ***/ - -/** - * Parses the DICOM header and return an image object. - * @param {DataView} data - * @returns {daikon.Image|null} - */ -daikon.Series.parseImage = function (data) { - var parser, image; - - parser = new daikon.Parser(); - image = parser.parse(data); +import { Image } from './image.js' +import { OrderedMap } from './orderedmap.js' +import { Parser } from './parser.js' +import { bind } from './utilities.js' + +export class Series { + images = [] + imagesOriginalOrder = null + isMosaic = false + isElscint = false + isCompressed = false + numberOfFrames = 0 + numberOfFramesInFile = 0 + isMultiFrame = false + isMultiFrameVolume = false + isMultiFrameTimeseries = false + isImplicitTimeseries = false + sliceSense = false + sliceDir = Image.SLICE_DIRECTION_UNKNOWN + error = null + parserError = null + + /** + * True to keep original order of images, ignoring metadata-based ordering. + * @type {boolean} + */ + useExplicitOrdering = false + + /** + * A hint to software to use this explicit distance (mm) between slices (see this.useExplicitOrdering) + * @type {number} + */ + useExplicitSpacing = 0 + + /** * Static Methods ***/ + + /** + * Parses the DICOM header and return an image object. + * @param {DataView} data + * @returns {daikon.Image|null} + */ + static parseImage(data) { + const parser = new Parser() + const image = parser.parse(data) if (parser.hasError()) { - daikon.Series.parserError = parser.error; - return null; + this.parserError = parser.error + return null } if (parser.inflated) { - image.inflated = parser.inflated; + image.inflated = parser.inflated } - return image; -}; - - + return image + } -daikon.Series.getMosaicOffset = function (mosaicCols, mosaicColWidth, mosaicRowHeight, mosaicWidth, xLocVal, - yLocVal, zLocVal) { - var xLoc, yLoc, zLoc; + static getMosaicOffset(mosaicCols, mosaicColWidth, mosaicRowHeight, mosaicWidth, xLocVal, yLocVal, zLocVal) { + let xLoc, yLoc - xLoc = xLocVal; - yLoc = yLocVal; - zLoc = zLocVal; + xLoc = xLocVal + yLoc = yLocVal + const zLoc = zLocVal - xLoc = ((zLoc % mosaicCols) * mosaicColWidth) + xLoc; - yLoc = (((parseInt(zLoc / mosaicCols)) * mosaicRowHeight) + yLoc) * mosaicWidth; + xLoc = (zLoc % mosaicCols) * mosaicColWidth + xLoc + yLoc = (parseInt(zLoc / mosaicCols) * mosaicRowHeight + yLoc) * mosaicWidth - return (xLoc + yLoc); -}; + return xLoc + yLoc + } + static orderDicoms(images, numFrames, sliceDir) { + const hasImagePosition = images[0].getImagePosition() !== null + const hasSliceLocation = images[0].getSliceLocation() !== null + const hasImageNumber = images[0].getImageNumber() !== null + const timeMap = this.orderByTime(images, numFrames, sliceDir, hasImagePosition, hasSliceLocation) + const timeIt = timeMap.orderedKeys -daikon.Series.orderDicoms = function (images, numFrames, sliceDir) { - var hasImagePosition, hasSliceLocation, hasImageNumber, timeMap, timeIt, ctr, ctrIn, dg, ordered, - imagesOrderedByTimeAndSpace; + const imagesOrderedByTimeAndSpace = [] - hasImagePosition = (images[0].getImagePosition() !== null); - hasSliceLocation = (images[0].getSliceLocation() !== null); - hasImageNumber = (images[0].getImageNumber() !== null); + for (let ctr = 0; ctr < timeIt.length; ctr += 1) { + const dg = timeMap.get(timeIt[ctr]) - timeMap = daikon.Series.orderByTime(images, numFrames, sliceDir, hasImagePosition, hasSliceLocation); - timeIt = timeMap.orderedKeys; + let ordered + if (hasImagePosition) { + ordered = this.orderByImagePosition(dg, sliceDir) + } else if (hasSliceLocation) { + ordered = this.orderBySliceLocation(dg) + } else if (hasImageNumber) { + ordered = this.orderByImageNumber(dg) + } else { + ordered = dg + } - imagesOrderedByTimeAndSpace = []; - - for (ctr = 0; ctr < timeIt.length; ctr += 1) { - dg = timeMap.get(timeIt[ctr]); - - if (hasImagePosition) { - ordered = daikon.Series.orderByImagePosition(dg, sliceDir); - } else if (hasSliceLocation) { - ordered = daikon.Series.orderBySliceLocation(dg); - } else if (hasImageNumber) { - ordered = daikon.Series.orderByImageNumber(dg); - } else { - ordered = dg; - } - - for (ctrIn = 0; ctrIn < ordered.length; ctrIn += 1) { - imagesOrderedByTimeAndSpace.push(ordered[ctrIn]); - } + for (let ctrIn = 0; ctrIn < ordered.length; ctrIn += 1) { + imagesOrderedByTimeAndSpace.push(ordered[ctrIn]) + } } - for (ctrIn = 0; ctrIn < imagesOrderedByTimeAndSpace.length; ctrIn += 1) { - imagesOrderedByTimeAndSpace[ctrIn].index = ctrIn; + for (let ctrIn = 0; ctrIn < imagesOrderedByTimeAndSpace.length; ctrIn += 1) { + imagesOrderedByTimeAndSpace[ctrIn].index = ctrIn } - return imagesOrderedByTimeAndSpace; -}; - - + return imagesOrderedByTimeAndSpace + } -daikon.Series.orderByImagePosition = function (images, sliceDir) { - var dicomMap, ctr; - dicomMap = new daikon.OrderedMap(); + static orderByImagePosition(images, sliceDir) { + const dicomMap = new OrderedMap() - for (ctr = 0; ctr < images.length; ctr += 1) { - dicomMap.put(images[ctr].getImagePositionSliceDir(sliceDir), images[ctr]); + for (let ctr = 0; ctr < images.length; ctr += 1) { + dicomMap.put(images[ctr].getImagePositionSliceDir(sliceDir), images[ctr]) } - return dicomMap.getOrderedValues(); -}; + return dicomMap.getOrderedValues() + } + static orderBySliceLocation(images) { + const dicomMap = new OrderedMap() - -daikon.Series.orderBySliceLocation = function (images) { - var dicomMap, ctr; - dicomMap = new daikon.OrderedMap(); - - for (ctr = 0; ctr < images.length; ctr += 1) { - dicomMap.put(images[ctr].getSliceLocation(), images[ctr]); + for (let ctr = 0; ctr < images.length; ctr += 1) { + dicomMap.put(images[ctr].getSliceLocation(), images[ctr]) } - return dicomMap.getOrderedValues(); -}; - + return dicomMap.getOrderedValues() + } + static orderByImageNumber(images) { + const dicomMap = new OrderedMap() -daikon.Series.orderByImageNumber = function (images) { - var dicomMap, ctr; - dicomMap = new daikon.OrderedMap(); - - for (ctr = 0; ctr < images.length; ctr += 1) { - dicomMap.put(images[ctr].getImageNumber(), images[ctr]); + for (let ctr = 0; ctr < images.length; ctr += 1) { + dicomMap.put(images[ctr].getImageNumber(), images[ctr]) } - return dicomMap.getOrderedValues(); -}; - + return dicomMap.getOrderedValues() + } - -daikon.Series.hasMatchingSlice = function (dg, image, sliceDir, doImagePos, doSliceLoc) { - var matchingNum = 0, ctr, current, imagePos, sliceLoc, imageNum; + static hasMatchingSlice(dg, image, sliceDir, doImagePos, doSliceLoc) { + let matchingNum = 0 if (doImagePos) { - matchingNum = image.getImagePositionSliceDir(sliceDir); + matchingNum = image.getImagePositionSliceDir(sliceDir) } else if (doSliceLoc) { - matchingNum = image.getSliceLocation(); + matchingNum = image.getSliceLocation() } else { - matchingNum = image.getImageNumber(); + matchingNum = image.getImageNumber() } - for (ctr = 0; ctr < dg.length; ctr += 1) { - current = dg[ctr]; + for (let ctr = 0; ctr < dg.length; ctr += 1) { + const current = dg[ctr] - if (doImagePos) { - imagePos = current.getImagePositionSliceDir(sliceDir); - if (imagePos === matchingNum) { - return true; - } - } else if (doSliceLoc) { - sliceLoc = current.getSliceLocation(); - if (sliceLoc === matchingNum) { - return true; - } - } else { - imageNum = current.getImageNumber(); - if (imageNum === matchingNum) { - return true; - } + if (doImagePos) { + const imagePos = current.getImagePositionSliceDir(sliceDir) + if (imagePos === matchingNum) { + return true } + } else if (doSliceLoc) { + const sliceLoc = current.getSliceLocation() + if (sliceLoc === matchingNum) { + return true + } + } else { + const imageNum = current.getImageNumber() + if (imageNum === matchingNum) { + return true + } + } } - return false; -}; - - - -daikon.Series.orderByTime = function (images, numFrames, sliceDir, hasImagePosition, hasSliceLocation) { - var dicomMap, hasTemporalPosition, hasTemporalNumber, ctr, image, tempPos, dg, timeBySliceMap, imageNum, - sliceMarker, slice, dicomsCopy, dicomsCopyIndex, sliceIt, timeIt, dgFound, it; - - dicomMap = new daikon.OrderedMap(); - hasTemporalPosition = (numFrames > 1) && (images[0].getTemporalPosition() !== null); - hasTemporalNumber = (numFrames > 1) && (images[0].getTemporalNumber() !== null) && (images[0].getTemporalNumber() === numFrames); - - if (hasTemporalPosition && hasTemporalNumber) { // explicit series - for (ctr = 0; ctr < images.length; ctr += 1) { - image = images[ctr]; - - tempPos = image.getTemporalPosition(); - dg = dicomMap.get(tempPos); - if (!dg) { - dg = []; - dicomMap.put(tempPos, dg); - } + return false + } + + static orderByTime(images, numFrames, sliceDir, hasImagePosition, hasSliceLocation) { + let image, + tempPos, + dg, + timeBySliceMap, + sliceMarker, + slice, + dicomsCopy, + dicomsCopyIndex, + sliceIt, + timeIt, + dgFound, + it + + const dicomMap = new OrderedMap() + const hasTemporalPosition = numFrames > 1 && images[0].getTemporalPosition() !== null + const hasTemporalNumber = + numFrames > 1 && images[0].getTemporalNumber() !== null && images[0].getTemporalNumber() === numFrames + + if (hasTemporalPosition && hasTemporalNumber) { + // explicit series + for (let ctr = 0; ctr < images.length; ctr += 1) { + image = images[ctr] + + tempPos = image.getTemporalPosition() + dg = dicomMap.get(tempPos) + if (!dg) { + dg = [] + dicomMap.put(tempPos, dg) + } - dg.push(image); + dg.push(image) + } + } else { + // implicit series + // order data by slice then time + timeBySliceMap = new OrderedMap() + for (let ctr = 0; ctr < images.length; ctr += 1) { + if (images[ctr] !== null) { + sliceMarker = ctr + if (hasImagePosition) { + sliceMarker = images[ctr].getImagePositionSliceDir(sliceDir) + } else if (hasSliceLocation) { + sliceMarker = images[ctr].getSliceLocation() + } + + slice = timeBySliceMap.get(sliceMarker) + if (slice === null) { + slice = new OrderedMap() + timeBySliceMap.put(sliceMarker, slice) + } + + slice.put(ctr, images[ctr]) } - } else { // implicit series - // order data by slice then time - timeBySliceMap = new daikon.OrderedMap(); - for (ctr = 0; ctr < images.length; ctr += 1) { - if (images[ctr] !== null) { - imageNum = images[ctr].getImageNumber(); - sliceMarker = ctr; - if (hasImagePosition) { - sliceMarker = images[ctr].getImagePositionSliceDir(sliceDir); - } else if (hasSliceLocation) { - sliceMarker = images[ctr].getSliceLocation(); - } - - slice = timeBySliceMap.get(sliceMarker); - if (slice === null) { - slice = new daikon.OrderedMap(); - timeBySliceMap.put(sliceMarker, slice); - } - - slice.put(ctr, images[ctr]); - } + } + + // copy into DICOM array (ordered by slice by time) + dicomsCopy = [] + dicomsCopyIndex = 0 + sliceIt = timeBySliceMap.iterator() + while (sliceIt.hasNext()) { + slice = sliceIt.next() + timeIt = slice.iterator() + while (timeIt.hasNext()) { + dicomsCopy[dicomsCopyIndex] = timeIt.next() + dicomsCopyIndex += 1 } - - // copy into DICOM array (ordered by slice by time) - dicomsCopy = []; - dicomsCopyIndex = 0; - sliceIt = timeBySliceMap.iterator(); - while (sliceIt.hasNext()) { - slice = sliceIt.next(); - timeIt = slice.iterator(); - while (timeIt.hasNext()) { - dicomsCopy[dicomsCopyIndex] = timeIt.next(); - dicomsCopyIndex += 1; + } + + // groups dicoms by timepoint + for (let ctr = 0; ctr < dicomsCopy.length; ctr += 1) { + if (dicomsCopy[ctr] !== null) { + dgFound = null + it = dicomMap.iterator() + while (it.hasNext()) { + dg = it.next() + if (!this.hasMatchingSlice(dg, dicomsCopy[ctr], sliceDir, hasImagePosition, hasSliceLocation)) { + dgFound = dg + break } - } + } - // groups dicoms by timepoint - for (ctr = 0; ctr < dicomsCopy.length; ctr += 1) { - if (dicomsCopy[ctr] !== null) { - dgFound = null; - it = dicomMap.iterator(); - while (it.hasNext()) { - dg = it.next(); - if (!daikon.Series.hasMatchingSlice(dg, dicomsCopy[ctr], sliceDir, hasImagePosition, hasSliceLocation)) { - dgFound = dg; - break; - } - } - - if (dgFound === null) { - dgFound = []; - dicomMap.put(dicomMap.orderedKeys.length, dgFound); - } - - dgFound.push(dicomsCopy[ctr]); - } + if (dgFound === null) { + dgFound = [] + dicomMap.put(dicomMap.orderedKeys.length, dgFound) + } + + dgFound.push(dicomsCopy[ctr]) } + } } - return dicomMap; -}; - - -/*** Prototype Methods ***/ + return dicomMap + } -daikon.Series.prototype.getOrder = function () { - var ctr, order = []; + getOrder() { + const order = [] - for (ctr = 0; ctr < this.imagesOriginalOrder.length; ctr += 1) { - order[ctr] = this.imagesOriginalOrder[ctr].index; + for (let ctr = 0; ctr < this.imagesOriginalOrder.length; ctr += 1) { + order[ctr] = this.imagesOriginalOrder[ctr].index } - return order; -}; - - -/** - * Returns the series ID. - * @returns {string} - */ -daikon.Series.prototype.toString = function () { - return this.images[0].getSeriesId(); -}; - - -/** - * Returns a nice name for the series. - * @returns {string|null} - */ -daikon.Series.prototype.getName = function () { - var des = this.images[0].getSeriesDescription(); - var uid = this.images[0].getSeriesInstanceUID(); + return order + } + + /** + * Returns the series ID. + * @returns {string} + */ + toString() { + return this.images[0].getSeriesId() + } + + /** + * Returns a nice name for the series. + * @returns {string|null} + */ + getName() { + const des = this.images[0].getSeriesDescription() + const uid = this.images[0].getSeriesInstanceUID() if (des !== null) { - return des; + return des } if (uid !== null) { - return uid; + return uid } - return null; -}; - - -/** - * Adds an image to the series. - * @param {daikon.Image} image - */ -daikon.Series.prototype.addImage = function (image) { - this.images.push(image); -}; - - -/** - * Returns true if the specified image is part of the series (or if no images are yet part of the series). - * @param {daikon.Image} image - * @returns {boolean} - */ -daikon.Series.prototype.matchesSeries = function (image) { + return null + } + + /** + * Adds an image to the series. + * @param {daikon.Image} image + */ + addImage(image) { + this.images.push(image) + } + + /** + * Returns true if the specified image is part of the series (or if no images are yet part of the series). + * @param {daikon.Image} image + * @returns {boolean} + */ + matchesSeries(image) { if (this.images.length === 0) { - return true; + return true } - return (this.images[0].getSeriesId() === image.getSeriesId()); -}; - - -/** - * Orders and organizes the images in this series. - */ -daikon.Series.prototype.buildSeries = function () { - var hasFrameTime, ctr, sliceLoc, orderedImages, sliceLocationFirst, sliceLocationLast, sliceLocDiff, - sliceLocations, orientation, imagePos; + return this.images[0].getSeriesId() === image.getSeriesId() + } - this.isMosaic = this.images[0].isMosaic(); - this.isElscint = this.images[0].isElscint(); - this.isCompressed = this.images[0].isCompressed(); + /** + * Orders and organizes the images in this series. + */ + buildSeries() { + this.isMosaic = this.images[0].isMosaic() + this.isElscint = this.images[0].isElscint() + this.isCompressed = this.images[0].isCompressed() // check for multi-frame - this.numberOfFrames = this.images[0].getNumberOfFrames(); - this.numberOfFramesInFile = this.images[0].getNumberOfImplicitFrames(); - this.isMultiFrame = (this.numberOfFrames > 1) || (this.isMosaic && (this.images[0].length > 1)); - this.isMultiFrameVolume = false; - this.isMultiFrameTimeseries = false; - this.isImplicitTimeseries = false; + this.numberOfFrames = this.images[0].getNumberOfFrames() + this.numberOfFramesInFile = this.images[0].getNumberOfImplicitFrames() + this.isMultiFrame = this.numberOfFrames > 1 || (this.isMosaic && this.images[0].length > 1) + this.isMultiFrameVolume = false + this.isMultiFrameTimeseries = false + this.isImplicitTimeseries = false if (this.isMultiFrame) { - hasFrameTime = (this.images[0].getFrameTime() > 0); - if (this.isMosaic) { - this.isMultiFrameTimeseries = true; + const hasFrameTime = this.images[0].getFrameTime() > 0 + if (this.isMosaic) { + this.isMultiFrameTimeseries = true + } else { + if (hasFrameTime) { + this.isMultiFrameTimeseries = true + } else if (this.numberOfFramesInFile > 1) { + this.isMultiFrameTimeseries = true + this.numberOfFrames = this.images.length } else { - if (hasFrameTime) { - this.isMultiFrameTimeseries = true; - } else if (this.numberOfFramesInFile > 1) { - this.isMultiFrameTimeseries = true; - this.numberOfFrames = this.images.length; - } else { - this.isMultiFrameVolume = true; - } + this.isMultiFrameVolume = true } + } } - if (!this.isMosaic && (this.numberOfFrames <= 1)) { // check for implicit frame count - imagePos = (this.images[0].getImagePosition() || []); - sliceLoc = imagePos.toString(); - this.numberOfFrames = 0; + if (!this.isMosaic && this.numberOfFrames <= 1) { + // check for implicit frame count + const imagePos = this.images[0].getImagePosition() || [] + const sliceLoc = imagePos.toString() + this.numberOfFrames = 0 - for (ctr = 0; ctr < this.images.length; ctr += 1) { - imagePos = (this.images[ctr].getImagePosition() || []); + for (let ctr = 0; ctr < this.images.length; ctr += 1) { + const imagePos = this.images[ctr].getImagePosition() || [] - if (imagePos.toString() === sliceLoc) { - this.numberOfFrames += 1; - } + if (imagePos.toString() === sliceLoc) { + this.numberOfFrames += 1 } + } - if (this.numberOfFrames > 1) { - this.isImplicitTimeseries = true; - } + if (this.numberOfFrames > 1) { + this.isImplicitTimeseries = true + } } - this.sliceDir = this.images[0].getAcquiredSliceDirection(); + this.sliceDir = this.images[0].getAcquiredSliceDirection() - if (daikon.Series.useExplicitOrdering) { - orderedImages = this.images.slice(); + let orderedImages + if (this.useExplicitOrdering) { + orderedImages = this.images.slice() } else { - orderedImages = daikon.Series.orderDicoms(this.images, this.numberOfFrames, this.sliceDir); + orderedImages = Series.orderDicoms(this.images, this.numberOfFrames, this.sliceDir) } - sliceLocationFirst = orderedImages[0].getImagePositionSliceDir(this.sliceDir); - sliceLocationLast = orderedImages[orderedImages.length - 1].getImagePositionSliceDir(this.sliceDir); - sliceLocDiff = sliceLocationLast - sliceLocationFirst; + const sliceLocationFirst = orderedImages[0].getImagePositionSliceDir(this.sliceDir) + const sliceLocationLast = orderedImages[orderedImages.length - 1].getImagePositionSliceDir(this.sliceDir) + const sliceLocDiff = sliceLocationLast - sliceLocationFirst - if (daikon.Series.useExplicitOrdering) { - this.sliceSense = false; + if (this.useExplicitOrdering) { + this.sliceSense = false } else if (this.isMosaic) { - this.sliceSense = true; + this.sliceSense = true } else if (this.isMultiFrame) { - sliceLocations = orderedImages[0].getSliceLocationVector(); - if (sliceLocations !== null) { - orientation = orderedImages[0].getOrientation(); - - if (orientation.charAt(2) === 'Z') { - this.sliceSense = (sliceLocations[0] - sliceLocations[sliceLocations.length - 1]) < 0; - } else { - this.sliceSense = (sliceLocations[0] - sliceLocations[sliceLocations.length - 1]) > 0; - } + const sliceLocations = orderedImages[0].getSliceLocationVector() + if (sliceLocations !== null) { + const orientation = orderedImages[0].getOrientation() + + if (orientation.charAt(2) === 'Z') { + this.sliceSense = sliceLocations[0] - sliceLocations[sliceLocations.length - 1] < 0 } else { - this.sliceSense = sliceLocationFirst < 0 ? false : true; // maybe??? + this.sliceSense = sliceLocations[0] - sliceLocations[sliceLocations.length - 1] > 0 } + } else { + this.sliceSense = !(sliceLocationFirst < 0) // maybe??? + } } else { - /* - * "The direction of the axes is defined fully by the patient's orientation. The x-axis is increasing to the left hand side of the patient. The - * y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient." - */ - if ((this.sliceDir === daikon.Image.SLICE_DIRECTION_SAGITTAL) || (this.sliceDir === daikon.Image.SLICE_DIRECTION_CORONAL)) { - if (sliceLocDiff > 0) { - this.sliceSense = false; - } else { - this.sliceSense = true; - } + /* + * "The direction of the axes is defined fully by the patient's orientation. The x-axis is increasing to the left hand side of the patient. The + * y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient." + */ + if (this.sliceDir === Image.SLICE_DIRECTION_SAGITTAL || this.sliceDir === Image.SLICE_DIRECTION_CORONAL) { + if (sliceLocDiff > 0) { + this.sliceSense = false } else { - if (sliceLocDiff > 0) { - this.sliceSense = true; - } else { - this.sliceSense = false; - } + this.sliceSense = true } + } else { + if (sliceLocDiff > 0) { + this.sliceSense = true + } else { + this.sliceSense = false + } + } } - this.imagesOriginalOrder = this.images; - this.images = orderedImages; -}; - + this.imagesOriginalOrder = this.images + this.images = orderedImages + } -/** - * Concatenates image data (asynchronously). - * @param {object} progressMeter -- the object must have a drawProgress(percent, label) function [e.g., drawProgress(.5, "Loading...")] - * @param {Function} onFinishedImageRead -- callback - */ -daikon.Series.prototype.concatenateImageData = function (progressMeter, onFinishedImageRead) { - var buffer, data, length; + /** + * Concatenates image data (asynchronously). + * @param {object} progressMeter -- the object must have a drawProgress(percent, label) function [e.g., drawProgress(.5, "Loading...")] + * @param {Function} onFinishedImageRead -- callback + */ + concatenateImageData(progressMeter, onFinishedImageRead) { + let data if (this.isMosaic) { - data = this.getMosaicData(this.images[0], this.images[0].getPixelDataBytes()); + data = this.getMosaicData(this.images[0], this.images[0].getPixelDataBytes()) } else { - data = this.images[0].getPixelDataBytes(); + data = this.images[0].getPixelDataBytes() } - length = this.validatePixelDataLength(this.images[0]); - this.images[0].clearPixelData(); - buffer = new Uint8Array(new ArrayBuffer(length * this.images.length)); - buffer.set(new Uint8Array(data, 0, length), 0); - - setTimeout(daikon.Utils.bind(this, function() { this.concatenateNextImageData(buffer, length, progressMeter, 1, onFinishedImageRead)}), 0); -}; - + const length = this.validatePixelDataLength(this.images[0]) + this.images[0].clearPixelData() + const buffer = new Uint8Array(new ArrayBuffer(length * this.images.length)) + buffer.set(new Uint8Array(data, 0, length), 0) + setTimeout( + bind(this, function () { + this.concatenateNextImageData(buffer, length, progressMeter, 1, onFinishedImageRead) + }), + 0 + ) + } -daikon.Series.prototype.concatenateNextImageData = function (buffer, frameSize, progressMeter, index, - onFinishedImageRead) { - var data, length; + concatenateNextImageData(buffer, frameSize, progressMeter, index, onFinishedImageRead) { + let data, length if (index >= this.images.length) { - if (progressMeter) { - progressMeter.drawProgress(1, "Reading DICOM Images"); - } + if (progressMeter) { + progressMeter.drawProgress(1, 'Reading DICOM Images') + } - onFinishedImageRead(buffer.buffer); + onFinishedImageRead(buffer.buffer) } else { - if (progressMeter) { - progressMeter.drawProgress(index / this.images.length, "Reading DICOM Images"); - } - - if (this.isMosaic) { - data = this.getMosaicData(this.images[index], this.images[index].getPixelDataBytes()); - } else { - data = this.images[index].getPixelDataBytes(); - } - - length = this.validatePixelDataLength(this.images[index]); - this.images[index].clearPixelData(); - buffer.set(new Uint8Array(data, 0, length), (frameSize * index)); - - setTimeout(daikon.Utils.bind(this, function() {this.concatenateNextImageData(buffer, frameSize, progressMeter, - index + 1, onFinishedImageRead);}), 0); + if (progressMeter) { + progressMeter.drawProgress(index / this.images.length, 'Reading DICOM Images') + } + + if (this.isMosaic) { + data = this.getMosaicData(this.images[index], this.images[index].getPixelDataBytes()) + } else { + data = this.images[index].getPixelDataBytes() + } + + length = this.validatePixelDataLength(this.images[index]) + this.images[index].clearPixelData() + buffer.set(new Uint8Array(data, 0, length), frameSize * index) + + setTimeout( + bind(this, function () { + this.concatenateNextImageData(buffer, frameSize, progressMeter, index + 1, onFinishedImageRead) + }), + 0 + ) } -}; - + } - -daikon.Series.prototype.validatePixelDataLength = function (image) { - var length = image.getPixelDataBytes().byteLength, - sliceLength = image.getCols() * image.getRows(); + validatePixelDataLength(image) { + const length = image.getPixelDataBytes().byteLength + const sliceLength = image.getCols() * image.getRows() // pixel data length should be divisible by slice size, if not, try to figure out correct pixel data length - if ((length % sliceLength) === 0) { - return length; + if (length % sliceLength === 0) { + return length } - return sliceLength * image.getNumberOfFrames() * image.getNumberOfSamplesPerPixel() * (image.getBitsAllocated() / 8); -}; - - - -daikon.Series.prototype.getMosaicData = function (image, data) { - var mosaicWidth, mosaicHeight, mosaicRows, mosaicCols, mosaicRowHeight, mosaicColWidth, - numBytes, ctrS, ctrR, ctrC, numSlices, numRows, numCols, buffer, dataTyped, offset, ctr, index = 0; - - numBytes = parseInt(this.images[0].getBitsAllocated() / 8); - numSlices = this.images[0].getMosaicCols() * this.images[0].getMosaicRows(); - numRows = parseInt(this.images[0].getRows() / this.images[0].getMosaicRows()); - numCols = parseInt(this.images[0].getCols() / this.images[0].getMosaicCols()); - - mosaicWidth = this.images[0].getCols(); - mosaicHeight = this.images[0].getRows(); - mosaicRows = this.images[0].getMosaicRows(); - mosaicCols = this.images[0].getMosaicCols(); - mosaicRowHeight = parseInt(mosaicHeight / mosaicRows); - mosaicColWidth = parseInt(mosaicWidth / mosaicCols); - - buffer = new Uint8Array(new ArrayBuffer(numSlices * numRows * numCols * numBytes)); - dataTyped = new Uint8Array(data); - - for (ctrS = 0; ctrS < numSlices; ctrS += 1) { - for (ctrR = 0; ctrR < numRows; ctrR += 1) { - for (ctrC = 0; ctrC < numCols; ctrC += 1) { - offset = daikon.Series.getMosaicOffset(mosaicCols, mosaicColWidth, mosaicRowHeight, mosaicWidth, ctrC, - ctrR, ctrS); - for (ctr = 0; ctr < numBytes; ctr += 1) { - buffer[index] = dataTyped[(offset * numBytes) + ctr]; - index += 1; - } - } + return sliceLength * image.getNumberOfFrames() * image.getNumberOfSamplesPerPixel() * (image.getBitsAllocated() / 8) + } + + getMosaicData(image, data) { + let index = 0 + + const numBytes = parseInt(this.images[0].getBitsAllocated() / 8) + const numSlices = this.images[0].getMosaicCols() * this.images[0].getMosaicRows() + const numRows = parseInt(this.images[0].getRows() / this.images[0].getMosaicRows()) + const numCols = parseInt(this.images[0].getCols() / this.images[0].getMosaicCols()) + + const mosaicWidth = this.images[0].getCols() + const mosaicHeight = this.images[0].getRows() + const mosaicRows = this.images[0].getMosaicRows() + const mosaicCols = this.images[0].getMosaicCols() + const mosaicRowHeight = parseInt(mosaicHeight / mosaicRows) + const mosaicColWidth = parseInt(mosaicWidth / mosaicCols) + + const buffer = new Uint8Array(new ArrayBuffer(numSlices * numRows * numCols * numBytes)) + const dataTyped = new Uint8Array(data) + + for (let ctrS = 0; ctrS < numSlices; ctrS += 1) { + for (let ctrR = 0; ctrR < numRows; ctrR += 1) { + for (let ctrC = 0; ctrC < numCols; ctrC += 1) { + const offset = this.getMosaicOffset( + mosaicCols, + mosaicColWidth, + mosaicRowHeight, + mosaicWidth, + ctrC, + ctrR, + ctrS + ) + for (let ctr = 0; ctr < numBytes; ctr += 1) { + buffer[index] = dataTyped[offset * numBytes + ctr] + index += 1 + } } + } } - return buffer.buffer; -}; - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Series; + return buffer.buffer + } } diff --git a/src/siemens.js b/src/siemens.js index 99d153c..7b9a86a 100644 --- a/src/siemens.js +++ b/src/siemens.js @@ -1,186 +1,141 @@ +import { swap32 } from './utilities.js' + +export class Siemens { + static CSA2_MAGIC_NUMBER = [83, 86, 49, 48] + static NAME_LENGTH = 64 + static ELEMENT_CSA1 = 0x1010 + static ELEMENT_CSA2 = 0x1020 + static GROUP_CSA = 0x029 + + output = '' + + constructor(buffer) { + this.data = new DataView(buffer, 0) + } + + /** + * Reads the Siemens header. (See http://nipy.org/nibabel/dicom/siemens_csa.html) + * @returns {string} + */ + readHeader() { + try { + if (this.data.byteLength > Siemens.CSA2_MAGIC_NUMBER.length) { + let match = true -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); - - -/*** Constructor ***/ - -/** - * The Siemens constructor. - * @params {ArrayBuffer} buffer - * @type {Function} - */ -daikon.Siemens = daikon.Siemens || function (buffer) { - this.output = ""; - this.data = new DataView(buffer, 0); -}; - - -/*** Static Pseudo-constants ***/ - -daikon.Siemens.CSA2_MAGIC_NUMBER = [83, 86, 49, 48]; -daikon.Siemens.NAME_LENGTH = 64; -daikon.Siemens.ELEMENT_CSA1 = 0x1010; -daikon.Siemens.ELEMENT_CSA2 = 0x1020; -daikon.Siemens.GROUP_CSA = 0x029; - - -/*** Prototype Methods ***/ - -/** - * Reads the Siemens header. (See http://nipy.org/nibabel/dicom/siemens_csa.html) - * @returns {string} - */ -daikon.Siemens.prototype.readHeader = function () { - /*jslint bitwise: true */ - - var ctr, match; + for (let ctr = 0; ctr < Siemens.CSA2_MAGIC_NUMBER.length; ctr += 1) { + match &= this.data.getUint8(ctr) === Siemens.CSA2_MAGIC_NUMBER[ctr] + } - try { - if (this.data.byteLength > daikon.Siemens.CSA2_MAGIC_NUMBER.length) { - match = true; - - for (ctr = 0; ctr < daikon.Siemens.CSA2_MAGIC_NUMBER.length; ctr += 1) { - match &= (this.data.getUint8(ctr) === daikon.Siemens.CSA2_MAGIC_NUMBER[ctr]); - } - - if (match) { - this.readHeaderAtOffset(daikon.Siemens.CSA2_MAGIC_NUMBER.length + 4); - } else { - this.readHeaderAtOffset(0); - } + if (match) { + this.readHeaderAtOffset(Siemens.CSA2_MAGIC_NUMBER.length + 4) + } else { + this.readHeaderAtOffset(0) } + } } catch (error) { - console.log(error); + console.error(error) } - return this.output; -}; - - + return this.output + } -daikon.Siemens.prototype.readHeaderAtOffset = function (offset) { - var numTags, ctr; + readHeaderAtOffset(offset) { + this.output += '\n' - this.output += '\n'; + const numTags = swap32(this.data.getUint32(offset)) - numTags = daikon.Utils.swap32(this.data.getUint32(offset)); - - if ((numTags < 1) || (numTags > 128)) { - return this.output; + if (numTags < 1 || numTags > 128) { + return this.output } - offset += 4; + offset += 4 - offset += 4; // unused + offset += 4 // unused - for (ctr = 0; ctr < numTags; ctr += 1) { - offset = this.readTag(offset); + for (let ctr = 0; ctr < numTags; ctr += 1) { + offset = this.readTag(offset) - if (offset === -1) { - break; - } + if (offset === -1) { + break + } } - return this.output; -}; - - + return this.output + } -daikon.Siemens.prototype.readTag = function (offset) { - var name, ctr, numItems; + readTag(offset) { + const name = this.readString(offset, Siemens.NAME_LENGTH) - name = this.readString(offset, daikon.Siemens.NAME_LENGTH); + offset += Siemens.NAME_LENGTH - offset += daikon.Siemens.NAME_LENGTH; + offset += 4 // vm - offset += 4; // vm + offset += 4 - offset += 4; + offset += 4 // syngodt - offset += 4; // syngodt + const numItems = swap32(this.data.getUint32(offset)) - numItems = daikon.Utils.swap32(this.data.getUint32(offset)); - offset += 4; + offset += 4 - offset += 4; // unused + offset += 4 // unused - this.output += (" " + name + "="); + this.output += ' ' + name + '=' - for (ctr = 0; ctr < numItems; ctr += 1) { - offset = this.readItem(offset); + for (let ctr = 0; ctr < numItems; ctr += 1) { + offset = this.readItem(offset) - if (offset === -1) { - break; - } else if ((offset % 4) !== 0) { - offset += (4 - (offset % 4)); - } + if (offset === -1) { + break + } else if (offset % 4 !== 0) { + offset += 4 - (offset % 4) + } } - this.output += ('\n'); - - return offset; -}; + this.output += '\n' + return offset + } + readString(offset, length) { + let str = '' -daikon.Siemens.prototype.readString = function (offset, length) { - var char2, ctr, str = ""; + for (let ctr = 0; ctr < length; ctr += 1) { + const char2 = this.data.getUint8(offset + ctr) - for (ctr = 0; ctr < length; ctr += 1) { - char2 = this.data.getUint8(offset + ctr); - - if (char2 === 0) { - break; - } + if (char2 === 0) { + break + } - str += String.fromCharCode(char2); + str += String.fromCharCode(char2) } - return str; -}; + return str + } + readItem(offset) { + const itemLength = swap32(this.data.getUint32(offset)) - -daikon.Siemens.prototype.readItem = function (offset) { - var itemLength; - - itemLength = daikon.Utils.swap32(this.data.getUint32(offset)); - - if ((offset + itemLength) > this.data.buffer.length) { - return -1; + if (offset + itemLength > this.data.buffer.length) { + return -1 } - offset += 16; + offset += 16 if (itemLength > 0) { - this.output += (this.readString(offset, itemLength) + " "); + this.output += this.readString(offset, itemLength) + ' ' } - return offset + itemLength; -}; - - -/** - * Returns true if the specified group and element indicate this tag can be read. - * @param {number} group - * @param {number} element - * @returns {boolean} - */ -daikon.Siemens.prototype.canRead = function (group, element) { - return (group === daikon.Siemens.GROUP_CSA) && ((element === daikon.Siemens.ELEMENT_CSA1) || (element === daikon.Siemens.ELEMENT_CSA2)); -}; - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Siemens; + return offset + itemLength + } + + /** + * Returns true if the specified group and element indicate this tag can be read. + * @param {number} group + * @param {number} element + * @returns {boolean} + */ + canRead(group, element) { + return group === Siemens.GROUP_CSA && (element === Siemens.ELEMENT_CSA1 || element === Siemens.ELEMENT_CSA2) + } } diff --git a/src/tag.js b/src/tag.js index b813494..2663274 100644 --- a/src/tag.js +++ b/src/tag.js @@ -1,770 +1,694 @@ - -/*jslint browser: true, node: true */ -/*global require */ - -"use strict"; - -var xss = require("xss"); - -/*** Imports ***/ -var daikon = daikon || {}; -daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./utilities.js') : null); -daikon.Dictionary = daikon.Dictionary || ((typeof require !== 'undefined') ? require('./dictionary.js') : null); -daikon.Siemens = daikon.Siemens || ((typeof require !== 'undefined') ? require('./siemens.js') : null); - - -/*** Constructor ***/ - -/** - * The Tag constuctor. - * @property {number} group - * @property {number} element - * @property {string} vr - * @property {number} offsetStart - * @property {number} offsetValue - * @property {number} offsetEnd - * @property {boolean} sublist - true if this tag is a sublist - * @property {number|number[]|string|string[]|object} value - * @type {Function} - */ -daikon.Tag = daikon.Tag || function (group, element, vr, value, offsetStart, offsetValue, offsetEnd, littleEndian, charset) { - this.group = group; - this.element = element; - this.vr = vr; - this.offsetStart = offsetStart; - this.offsetValue = offsetValue; - this.offsetEnd = offsetEnd; - this.sublist = false; - this.preformatted = false; - this.id = daikon.Tag.createId(group, element); +import xss from 'xss' +import { getDescription } from './dictionary.js' +import { Siemens } from './siemens.js' +import { + bytesToDouble, + convertCamcelCaseToTitleCase, + dec2hex, + getStringAt, + isString, + isValidDate, + safeParseFloat, + safeParseInt, + trim +} from './utilities.js' + +export class Tag { + static PRIVATE_DATA_READERS = [Siemens] + + static VR_AE_MAX_LENGTH = 16 + static VR_AS_MAX_LENGTH = 4 + static VR_AT_MAX_LENGTH = 4 + static VR_CS_MAX_LENGTH = 16 + static VR_DA_MAX_LENGTH = 8 + static VR_DS_MAX_LENGTH = 16 + static VR_DT_MAX_LENGTH = 26 + static VR_FL_MAX_LENGTH = 4 + static VR_FD_MAX_LENGTH = 8 + static VR_IS_MAX_LENGTH = 12 + static VR_LO_MAX_LENGTH = 64 + static VR_LT_MAX_LENGTH = 10240 + static VR_OB_MAX_LENGTH = -1 + static VR_OD_MAX_LENGTH = -1 + static VR_OF_MAX_LENGTH = -1 + static VR_OW_MAX_LENGTH = -1 + static VR_PN_MAX_LENGTH = 64 * 5 + static VR_SH_MAX_LENGTH = 16 + static VR_SL_MAX_LENGTH = 4 + static VR_SS_MAX_LENGTH = 2 + static VR_ST_MAX_LENGTH = 1024 + static VR_TM_MAX_LENGTH = 16 + static VR_UI_MAX_LENGTH = 64 + static VR_UL_MAX_LENGTH = 4 + static VR_UN_MAX_LENGTH = -1 + static VR_US_MAX_LENGTH = 2 + static VR_UT_MAX_LENGTH = -1 + static VR_UC_MAX_LENGTH = -1 + + // metadata + static TAG_TRANSFER_SYNTAX = [0x0002, 0x0010] + static TAG_META_LENGTH = [0x0002, 0x0000] + + // sublists + static TAG_SUBLIST_ITEM = [0xfffe, 0xe000] + static TAG_SUBLIST_ITEM_DELIM = [0xfffe, 0xe00d] + static TAG_SUBLIST_SEQ_DELIM = [0xfffe, 0xe0dd] + + // image dims + static TAG_ROWS = [0x0028, 0x0010] + static TAG_COLS = [0x0028, 0x0011] + static TAG_ACQUISITION_MATRIX = [0x0018, 0x1310] + static TAG_NUMBER_OF_FRAMES = [0x0028, 0x0008] + static TAG_NUMBER_TEMPORAL_POSITIONS = [0x0020, 0x0105] + + // voxel dims + static TAG_PIXEL_SPACING = [0x0028, 0x0030] + static TAG_SLICE_THICKNESS = [0x0018, 0x0050] + static TAG_SLICE_GAP = [0x0018, 0x0088] + static TAG_TR = [0x0018, 0x0080] + static TAG_FRAME_TIME = [0x0018, 0x1063] + + // datatype + static TAG_BITS_ALLOCATED = [0x0028, 0x0100] + static TAG_BITS_STORED = [0x0028, 0x0101] + static TAG_PIXEL_REPRESENTATION = [0x0028, 0x0103] + static TAG_HIGH_BIT = [0x0028, 0x0102] + static TAG_PHOTOMETRIC_INTERPRETATION = [0x0028, 0x0004] + static TAG_SAMPLES_PER_PIXEL = [0x0028, 0x0002] + static TAG_PLANAR_CONFIG = [0x0028, 0x0006] + static TAG_PALETTE_RED = [0x0028, 0x1201] + static TAG_PALETTE_GREEN = [0x0028, 0x1202] + static TAG_PALETTE_BLUE = [0x0028, 0x1203] + + // data scale + static TAG_DATA_SCALE_SLOPE = [0x0028, 0x1053] + static TAG_DATA_SCALE_INTERCEPT = [0x0028, 0x1052] + static TAG_DATA_SCALE_ELSCINT = [0x0207, 0x101f] + static TAG_PIXEL_BANDWIDTH = [0x0018, 0x0095] + + // range + static TAG_IMAGE_MIN = [0x0028, 0x0106] + static TAG_IMAGE_MAX = [0x0028, 0x0107] + static TAG_WINDOW_CENTER = [0x0028, 0x1050] + static TAG_WINDOW_WIDTH = [0x0028, 0x1051] + + // descriptors + static TAG_SPECIFIC_CHAR_SET = [0x0008, 0x0005] + static TAG_PATIENT_NAME = [0x0010, 0x0010] + static TAG_PATIENT_ID = [0x0010, 0x0020] + static TAG_STUDY_DATE = [0x0008, 0x0020] + static TAG_STUDY_TIME = [0x0008, 0x0030] + static TAG_STUDY_DES = [0x0008, 0x1030] + static TAG_IMAGE_TYPE = [0x0008, 0x0008] + static TAG_IMAGE_COMMENTS = [0x0020, 0x4000] + static TAG_SEQUENCE_NAME = [0x0018, 0x0024] + static TAG_MODALITY = [0x0008, 0x0060] + + // session ID + static TAG_FRAME_OF_REF_UID = [0x0020, 0x0052] + + // study ID + static TAG_STUDY_UID = [0x0020, 0x000d] + + // volume ID + static TAG_SERIES_DESCRIPTION = [0x0008, 0x103e] + static TAG_SERIES_INSTANCE_UID = [0x0020, 0x000e] + static TAG_SERIES_NUMBER = [0x0020, 0x0011] + static TAG_ECHO_NUMBER = [0x0018, 0x0086] + static TAG_TEMPORAL_POSITION = [0x0020, 0x0100] + + // slice ID + static TAG_IMAGE_NUM = [0x0020, 0x0013] + static TAG_SLICE_LOCATION = [0x0020, 0x1041] + + // orientation + static TAG_IMAGE_ORIENTATION = [0x0020, 0x0037] + static TAG_IMAGE_POSITION = [0x0020, 0x0032] + static TAG_SLICE_LOCATION_VECTOR = [0x0018, 0x2005] + + // LUT shape + static TAG_LUT_SHAPE = [0x2050, 0x0020] + + // pixel data + static TAG_PIXEL_DATA = [0x7fe0, 0x0010] + + /** + * The Tag constuctor. + * @property {number} group + * @property {number} element + * @property {string} vr + * @property {number} offsetStart + * @property {number} offsetValue + * @property {number} offsetEnd + * @property {boolean} sublist - true if this tag is a sublist + * @property {number|number[]|string|string[]|object} value + * @type {Function} + */ + + constructor(group, element, vr, value, offsetStart, offsetValue, offsetEnd, littleEndian, charset) { + this.group = group + this.element = element + this.vr = vr + this.offsetStart = offsetStart + this.offsetValue = offsetValue + this.offsetEnd = offsetEnd + this.sublist = false + this.preformatted = false + this.id = Tag.createId(group, element) if (value instanceof Array) { - this.value = value; - this.sublist = true; + this.value = value + this.sublist = true } else if (value !== null) { - var dv = new DataView(value); - this.value = daikon.Tag.convertValue(vr, dv, littleEndian, charset); + const dv = new DataView(value) + this.value = this.convertValue(vr, dv, littleEndian, charset) - if ((this.value === dv) && this.isPrivateData()) { - this.value = daikon.Tag.convertPrivateValue(group, element, dv); - this.preformatted = (this.value !== dv); - } + if (this.value === dv && this.isPrivateData()) { + this.value = this.convertPrivateValue(group, element, dv) + this.preformatted = this.value !== dv + } } else { - this.value = null; + this.value = null } -}; - - -/*** Static Pseudo-constants ***/ - -daikon.Tag.PRIVATE_DATA_READERS = [daikon.Siemens]; - -daikon.Tag.VR_AE_MAX_LENGTH = 16; -daikon.Tag.VR_AS_MAX_LENGTH = 4; -daikon.Tag.VR_AT_MAX_LENGTH = 4; -daikon.Tag.VR_CS_MAX_LENGTH = 16; -daikon.Tag.VR_DA_MAX_LENGTH = 8; -daikon.Tag.VR_DS_MAX_LENGTH = 16; -daikon.Tag.VR_DT_MAX_LENGTH = 26; -daikon.Tag.VR_FL_MAX_LENGTH = 4; -daikon.Tag.VR_FD_MAX_LENGTH = 8; -daikon.Tag.VR_IS_MAX_LENGTH = 12; -daikon.Tag.VR_LO_MAX_LENGTH = 64; -daikon.Tag.VR_LT_MAX_LENGTH = 10240; -daikon.Tag.VR_OB_MAX_LENGTH = -1; -daikon.Tag.VR_OD_MAX_LENGTH = -1; -daikon.Tag.VR_OF_MAX_LENGTH = -1; -daikon.Tag.VR_OW_MAX_LENGTH = -1; -daikon.Tag.VR_PN_MAX_LENGTH = 64 * 5; -daikon.Tag.VR_SH_MAX_LENGTH = 16; -daikon.Tag.VR_SL_MAX_LENGTH = 4; -daikon.Tag.VR_SS_MAX_LENGTH = 2; -daikon.Tag.VR_ST_MAX_LENGTH = 1024; -daikon.Tag.VR_TM_MAX_LENGTH = 16; -daikon.Tag.VR_UI_MAX_LENGTH = 64; -daikon.Tag.VR_UL_MAX_LENGTH = 4; -daikon.Tag.VR_UN_MAX_LENGTH = -1; -daikon.Tag.VR_US_MAX_LENGTH = 2; -daikon.Tag.VR_UT_MAX_LENGTH = -1; -daikon.Tag.VR_UC_MAX_LENGTH = -1; - -// metadata -daikon.Tag.TAG_TRANSFER_SYNTAX = [0x0002, 0x0010]; -daikon.Tag.TAG_META_LENGTH = [0x0002, 0x0000]; - -// sublists -daikon.Tag.TAG_SUBLIST_ITEM = [0xFFFE, 0xE000]; -daikon.Tag.TAG_SUBLIST_ITEM_DELIM = [0xFFFE, 0xE00D]; -daikon.Tag.TAG_SUBLIST_SEQ_DELIM = [0xFFFE, 0xE0DD]; - -// image dims -daikon.Tag.TAG_ROWS = [0x0028, 0x0010]; -daikon.Tag.TAG_COLS = [0x0028, 0x0011]; -daikon.Tag.TAG_ACQUISITION_MATRIX = [0x0018, 0x1310]; -daikon.Tag.TAG_NUMBER_OF_FRAMES = [0x0028, 0x0008]; -daikon.Tag.TAG_NUMBER_TEMPORAL_POSITIONS = [0x0020, 0x0105]; - -// voxel dims -daikon.Tag.TAG_PIXEL_SPACING = [0x0028, 0x0030]; -daikon.Tag.TAG_SLICE_THICKNESS = [0x0018, 0x0050]; -daikon.Tag.TAG_SLICE_GAP = [0x0018, 0x0088]; -daikon.Tag.TAG_TR = [0x0018, 0x0080]; -daikon.Tag.TAG_FRAME_TIME = [0x0018, 0x1063]; - -// datatype -daikon.Tag.TAG_BITS_ALLOCATED = [0x0028, 0x0100]; -daikon.Tag.TAG_BITS_STORED = [0x0028, 0x0101]; -daikon.Tag.TAG_PIXEL_REPRESENTATION = [0x0028, 0x0103]; -daikon.Tag.TAG_HIGH_BIT = [0x0028, 0x0102]; -daikon.Tag.TAG_PHOTOMETRIC_INTERPRETATION = [0x0028, 0x0004]; -daikon.Tag.TAG_SAMPLES_PER_PIXEL = [0x0028, 0x0002]; -daikon.Tag.TAG_PLANAR_CONFIG = [0x0028, 0x0006]; -daikon.Tag.TAG_PALETTE_RED = [0x0028, 0x1201]; -daikon.Tag.TAG_PALETTE_GREEN = [0x0028, 0x1202]; -daikon.Tag.TAG_PALETTE_BLUE = [0x0028, 0x1203]; - -// data scale -daikon.Tag.TAG_DATA_SCALE_SLOPE = [0x0028, 0x1053]; -daikon.Tag.TAG_DATA_SCALE_INTERCEPT = [0x0028, 0x1052]; -daikon.Tag.TAG_DATA_SCALE_ELSCINT = [0x0207, 0x101F]; -daikon.Tag.TAG_PIXEL_BANDWIDTH = [0x0018, 0x0095]; - -// range -daikon.Tag.TAG_IMAGE_MIN = [0x0028, 0x0106]; -daikon.Tag.TAG_IMAGE_MAX = [0x0028, 0x0107]; -daikon.Tag.TAG_WINDOW_CENTER = [0x0028, 0x1050]; -daikon.Tag.TAG_WINDOW_WIDTH = [0x0028, 0x1051]; - -// descriptors -daikon.Tag.TAG_SPECIFIC_CHAR_SET = [0x0008, 0x0005]; -daikon.Tag.TAG_PATIENT_NAME = [0x0010, 0x0010]; -daikon.Tag.TAG_PATIENT_ID = [0x0010, 0x0020]; -daikon.Tag.TAG_STUDY_DATE = [0x0008, 0x0020]; -daikon.Tag.TAG_STUDY_TIME = [0x0008, 0x0030]; -daikon.Tag.TAG_STUDY_DES = [0x0008, 0x1030]; -daikon.Tag.TAG_IMAGE_TYPE = [0x0008, 0x0008]; -daikon.Tag.TAG_IMAGE_COMMENTS = [0x0020, 0x4000]; -daikon.Tag.TAG_SEQUENCE_NAME = [0x0018, 0x0024]; -daikon.Tag.TAG_MODALITY = [0x0008, 0x0060]; - -// session ID -daikon.Tag.TAG_FRAME_OF_REF_UID = [0x0020, 0x0052]; - -// study ID -daikon.Tag.TAG_STUDY_UID = [0x0020, 0x000D]; - -// volume ID -daikon.Tag.TAG_SERIES_DESCRIPTION = [0x0008, 0x103E]; -daikon.Tag.TAG_SERIES_INSTANCE_UID = [0x0020, 0x000E]; -daikon.Tag.TAG_SERIES_NUMBER = [0x0020, 0x0011]; -daikon.Tag.TAG_ECHO_NUMBER = [0x0018, 0x0086]; -daikon.Tag.TAG_TEMPORAL_POSITION = [0x0020, 0x0100]; - -// slice ID -daikon.Tag.TAG_IMAGE_NUM = [0x0020, 0x0013]; -daikon.Tag.TAG_SLICE_LOCATION = [0x0020, 0x1041]; - -// orientation -daikon.Tag.TAG_IMAGE_ORIENTATION = [0x0020, 0x0037]; -daikon.Tag.TAG_IMAGE_POSITION = [0x0020, 0x0032]; -daikon.Tag.TAG_SLICE_LOCATION_VECTOR = [0x0018, 0x2005]; - -// LUT shape -daikon.Tag.TAG_LUT_SHAPE = [0x2050, 0x0020]; - -// pixel data -daikon.Tag.TAG_PIXEL_DATA = [0x7FE0, 0x0010]; - - -/*** Static methods ***/ - -/** - * Create an ID string based on the specified group and element - * @param {number} group - * @param {number} element - * @returns {string} - */ -daikon.Tag.createId = function (group, element) { - var groupStr = daikon.Utils.dec2hex(group), - elemStr = daikon.Utils.dec2hex(element); - return groupStr + elemStr; -}; - - - -daikon.Tag.getUnsignedInteger16 = function (rawData, littleEndian) { - var data, mul, ctr; - - mul = rawData.byteLength / 2; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getUint16(ctr * 2, littleEndian); + } + + /** + * Create an ID string based on the specified group and element + * @param {number} group + * @param {number} element + * @returns {string} + */ + static createId(group, element) { + const groupStr = dec2hex(group) + const elemStr = dec2hex(element) + return groupStr + elemStr + } + + getUnsignedInteger16(rawData, littleEndian) { + const mul = rawData.byteLength / 2 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getUint16(ctr * 2, littleEndian) } - return data; -}; - - - -daikon.Tag.getSignedInteger16 = function (rawData, littleEndian) { - var data, mul, ctr; + return data + } - mul = rawData.byteLength / 2; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getInt16(ctr * 2, littleEndian); + getSignedInteger16(rawData, littleEndian) { + const mul = rawData.byteLength / 2 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getInt16(ctr * 2, littleEndian) } - return data; -}; + return data + } - - -daikon.Tag.getFloat32 = function (rawData, littleEndian) { - var data, mul, ctr; - - mul = rawData.byteLength / 4; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getFloat32(ctr * 4, littleEndian); + getFloat32(rawData, littleEndian) { + const mul = rawData.byteLength / 4 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getFloat32(ctr * 4, littleEndian) } - return data; -}; - + return data + } - -daikon.Tag.getSignedInteger32 = function (rawData, littleEndian) { - var data, mul, ctr; - - mul = rawData.byteLength / 4; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getInt32(ctr * 4, littleEndian); + getSignedInteger32(rawData, littleEndian) { + const mul = rawData.byteLength / 4 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getInt32(ctr * 4, littleEndian) } - return data; -}; - - + return data + } -daikon.Tag.getUnsignedInteger32 = function (rawData, littleEndian) { - var data, mul, ctr; - - mul = rawData.byteLength / 4; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getUint32(ctr * 4, littleEndian); + getUnsignedInteger32(rawData, littleEndian) { + const mul = rawData.byteLength / 4 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getUint32(ctr * 4, littleEndian) } - return data; -}; - - - -daikon.Tag.getFloat64 = function (rawData, littleEndian) { - var data, mul, ctr; + return data + } + getFloat64(rawData, littleEndian) { if (rawData.byteLength < 8) { - return 0; + return 0 } - mul = rawData.byteLength / 8; - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = rawData.getFloat64(ctr * 8, littleEndian); + const mul = rawData.byteLength / 8 + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = rawData.getFloat64(ctr * 8, littleEndian) } - return data; -}; + return data + } + getDoubleElscint(rawData) { + let data = [] + const reordered = [] - -daikon.Tag.getDoubleElscint = function (rawData) { - var data = [], reordered = [], ctr; - - for (ctr = 0; ctr < 8; ctr += 1) { - data[ctr] = rawData.getUint8(ctr); + for (let ctr = 0; ctr < 8; ctr += 1) { + data[ctr] = rawData.getUint8(ctr) } - reordered[0] = data[3]; - reordered[1] = data[2]; - reordered[2] = data[1]; - reordered[3] = data[0]; - reordered[4] = data[7]; - reordered[5] = data[6]; - reordered[6] = data[5]; - reordered[7] = data[4]; - - data = [daikon.Utils.bytesToDouble(reordered)]; - - return data; -}; - + reordered[0] = data[3] + reordered[1] = data[2] + reordered[2] = data[1] + reordered[3] = data[0] + reordered[4] = data[7] + reordered[5] = data[6] + reordered[6] = data[5] + reordered[7] = data[4] + + data = [bytesToDouble(reordered)] + + return data + } + + getFixedLengthStringValue(rawData, maxLength, charset, vr) { + const mul = Math.floor(rawData.byteLength / maxLength) + const data = [] + for (let ctr = 0; ctr < mul; ctr += 1) { + data[ctr] = getStringAt(rawData, ctr * maxLength, maxLength, charset, vr) + } + return data + } -daikon.Tag.getFixedLengthStringValue = function (rawData, maxLength, charset, vr) { - var data, mul, ctr; + getStringValue(rawData, charset, vr) { + const data = getStringAt(rawData, 0, rawData.byteLength, charset, vr).split('\\') - mul = Math.floor(rawData.byteLength / maxLength); - data = []; - for (ctr = 0; ctr < mul; ctr += 1) { - data[ctr] = daikon.Utils.getStringAt(rawData, ctr * maxLength, maxLength, charset, vr); + for (let ctr = 0; ctr < data.length; ctr += 1) { + data[ctr] = trim(data[ctr]) } - return data; -}; - + return data + } + getDateStringValue(rawData) { + const dotFormat = this.getSingleStringValue(rawData)[0].indexOf('.') !== -1 + const stringData = this.getFixedLengthStringValue(rawData, dotFormat ? 10 : Tag.VR_DA_MAX_LENGTH) + let parts = null + const data = [] -daikon.Tag.getStringValue = function (rawData, charset, vr) { - var data = daikon.Utils.getStringAt(rawData, 0, rawData.byteLength, charset, vr).split('\\'), ctr; - - for (ctr = 0; ctr < data.length; ctr += 1) { - data[ctr] = daikon.Utils.trim(data[ctr]); - } - - return data; -}; - - - -daikon.Tag.getDateStringValue = function (rawData) { - var dotFormat = (daikon.Tag.getSingleStringValue(rawData)[0].indexOf('.') !== -1), - stringData = daikon.Tag.getFixedLengthStringValue(rawData, dotFormat ? 10 : daikon.Tag.VR_DA_MAX_LENGTH), - parts = null, - data = [], - ctr; - - for (ctr = 0; ctr < stringData.length; ctr += 1) { - if (dotFormat) { - parts = stringData[ctr].split('.'); - if (parts.length === 3) { - data[ctr] = new Date(daikon.Utils.safeParseInt(parts[0]), - daikon.Utils.safeParseInt(parts[1]) - 1, - daikon.Utils.safeParseInt(parts[2])); - } else { - data[ctr] = new Date(); - } - } else if (stringData[ctr].length === 8) { - data[ctr] = new Date(daikon.Utils.safeParseInt(stringData[ctr].substring(0, 4)), - daikon.Utils.safeParseInt(stringData[ctr].substring(4, 6)) - 1, - daikon.Utils.safeParseInt(stringData[ctr].substring(6, 8))); + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + if (dotFormat) { + parts = stringData[ctr].split('.') + if (parts.length === 3) { + data[ctr] = new Date(safeParseInt(parts[0]), safeParseInt(parts[1]) - 1, safeParseInt(parts[2])) } else { - data[ctr] = Date.parse(stringData[ctr]); - } - - if (!daikon.Utils.isValidDate(data[ctr])) { - data[ctr] = stringData[ctr]; + data[ctr] = new Date() } + } else if (stringData[ctr].length === 8) { + data[ctr] = new Date( + safeParseInt(stringData[ctr].substring(0, 4)), + safeParseInt(stringData[ctr].substring(4, 6)) - 1, + safeParseInt(stringData[ctr].substring(6, 8)) + ) + } else { + data[ctr] = Date.parse(stringData[ctr]) + } + + if (!isValidDate(data[ctr])) { + data[ctr] = stringData[ctr] + } } - return data; -}; - - - -daikon.Tag.getDateTimeStringValue = function (rawData) { - var stringData = daikon.Tag.getStringValue(rawData), - data = [], - ctr, - year = null, - month = null, - date = null, - hours = null, - minutes = null, - seconds = null; - - for (ctr = 0; ctr < stringData.length; ctr += 1) { - if (stringData[ctr].length >= 4) { - year = parseInt(stringData[ctr].substring(0, 4), 10); // required - - if (stringData[ctr].length >= 6) { - month = daikon.Utils.safeParseInt(stringData[ctr].substring(4, 6)) - 1; - } - - if (stringData[ctr].length >= 8) { - date = daikon.Utils.safeParseInt(stringData[ctr].substring(6, 8)); - } - - if (stringData[ctr].length >= 10) { - hours = daikon.Utils.safeParseInt(stringData[ctr].substring(8, 10)); - } + return data + } + + getDateTimeStringValue(rawData) { + const stringData = this.getStringValue(rawData) + const data = [] + let year = null + let month = null + let date = null + let hours = null + let minutes = null + let seconds = null + + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + if (stringData[ctr].length >= 4) { + year = parseInt(stringData[ctr].substring(0, 4), 10) // required + + if (stringData[ctr].length >= 6) { + month = safeParseInt(stringData[ctr].substring(4, 6)) - 1 + } - if (stringData[ctr].length >= 12) { - minutes = daikon.Utils.safeParseInt(stringData[ctr].substring(10, 12)); - } + if (stringData[ctr].length >= 8) { + date = safeParseInt(stringData[ctr].substring(6, 8)) + } - if (stringData[ctr].length >= 14) { - seconds = daikon.Utils.safeParseInt(stringData[ctr].substring(12, 14)); - } + if (stringData[ctr].length >= 10) { + hours = safeParseInt(stringData[ctr].substring(8, 10)) + } - data[ctr] = new Date(year, month, date, hours, minutes, seconds); - } else { - data[ctr] = Date.parse(stringData[ctr]); + if (stringData[ctr].length >= 12) { + minutes = safeParseInt(stringData[ctr].substring(10, 12)) } - if (!daikon.Utils.isValidDate(data[ctr])) { - data[ctr] = stringData[ctr]; + if (stringData[ctr].length >= 14) { + seconds = safeParseInt(stringData[ctr].substring(12, 14)) } - } - return data; -}; + data[ctr] = new Date(year, month, date, hours, minutes, seconds) + } else { + data[ctr] = Date.parse(stringData[ctr]) + } + if (!isValidDate(data[ctr])) { + data[ctr] = stringData[ctr] + } + } + return data + } -daikon.Tag.getTimeStringValue = function (rawData, ms) { - var stringData = daikon.Tag.getStringValue(rawData), - data = []; + getTimeStringValue(rawData, ms) { + const stringData = this.getStringValue(rawData) + const data = [] if (ms) { - var parts = null, - ctr, - hours = 0, - minutes = 0, - seconds = 0; - - for (ctr = 0; ctr < stringData.length; ctr += 1) { - if (stringData[ctr].indexOf(':') !== -1) { - parts = stringData[ctr].split(':'); - hours = daikon.Utils.safeParseInt(parts[0]); - - if (parts.length > 1) { - minutes = daikon.Utils.safeParseInt(parts[1]); - } - - if (parts.length > 2) { - seconds = daikon.Utils.safeParseFloat(parts[2]); - } - } else { - if (stringData[ctr].length >= 2) { - hours = daikon.Utils.safeParseInt(stringData[ctr].substring(0, 2)); - } - - if (stringData[ctr].length >= 4) { - minutes = daikon.Utils.safeParseInt(stringData[ctr].substring(2, 4)); - } - - if (stringData[ctr].length >= 6) { - seconds = daikon.Utils.safeParseFloat(stringData[ctr].substring(4)); - } - } - - data[ctr] = Math.round((hours * 60 * 60 * 1000) + (minutes * 60 * 1000) + (seconds * 1000)); - } + let parts = null + let hours = 0 + let minutes = 0 + let seconds = 0 + + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + if (stringData[ctr].indexOf(':') !== -1) { + parts = stringData[ctr].split(':') + hours = safeParseInt(parts[0]) + + if (parts.length > 1) { + minutes = safeParseInt(parts[1]) + } + + if (parts.length > 2) { + seconds = safeParseFloat(parts[2]) + } + } else { + if (stringData[ctr].length >= 2) { + hours = safeParseInt(stringData[ctr].substring(0, 2)) + } - return data; - } + if (stringData[ctr].length >= 4) { + minutes = safeParseInt(stringData[ctr].substring(2, 4)) + } + if (stringData[ctr].length >= 6) { + seconds = safeParseFloat(stringData[ctr].substring(4)) + } + } - return stringData; -}; + data[ctr] = Math.round(hours * 60 * 60 * 1000 + minutes * 60 * 1000 + seconds * 1000) + } + return data + } + return stringData + } -daikon.Tag.getDoubleStringValue = function (rawData) { - var stringData = daikon.Tag.getStringValue(rawData), - data = [], - ctr; + getDoubleStringValue(rawData) { + const stringData = this.getStringValue(rawData) + const data = [] - for (ctr = 0; ctr < stringData.length; ctr += 1) { - data[ctr] = parseFloat(stringData[ctr]); + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + data[ctr] = parseFloat(stringData[ctr]) } - return data; -}; + return data + } + getIntegerStringValue(rawData) { + const stringData = this.getStringValue(rawData) + const data = [] - -daikon.Tag.getIntegerStringValue = function (rawData) { - var stringData = daikon.Tag.getStringValue(rawData), - data = [], - ctr; - - for (ctr = 0; ctr < stringData.length; ctr += 1) { - data[ctr] = parseInt(stringData[ctr], 10); + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + data[ctr] = parseInt(stringData[ctr], 10) } - return data; -}; - - + return data + } -daikon.Tag.getSingleStringValue = function (rawData, maxLength, charset, vr) { - var len = rawData.byteLength; + getSingleStringValue(rawData, maxLength, charset, vr) { + let len = rawData.byteLength if (maxLength) { - len = Math.min(rawData.byteLength, maxLength); + len = Math.min(rawData.byteLength, maxLength) } - return [daikon.Utils.trim(daikon.Utils.getStringAt(rawData, 0, len, charset, vr))]; -}; + return [trim(getStringAt(rawData, 0, len, charset, vr))] + } + getPersonNameStringValue(rawData, charset, vr) { + const stringData = this.getStringValue(rawData, charset, vr) + const data = [] - -daikon.Tag.getPersonNameStringValue = function (rawData, charset, vr) { - var stringData = daikon.Tag.getStringValue(rawData, charset, vr), - data = [], - ctr; - - for (ctr = 0; ctr < stringData.length; ctr += 1) { - data[ctr] = stringData[ctr].replace('^', ' '); + for (let ctr = 0; ctr < stringData.length; ctr += 1) { + data[ctr] = stringData[ctr].replace('^', ' ') } - return data; -}; - - + return data + } -daikon.Tag.convertPrivateValue = function (group, element, rawData) { - var ctr, privReader; - - for (ctr = 0; ctr < daikon.Tag.PRIVATE_DATA_READERS.length; ctr += 1) { - privReader = new daikon.Tag.PRIVATE_DATA_READERS[ctr](rawData.buffer); - if (privReader.canRead(group, element)) { - return privReader.readHeader(); - } + convertPrivateValue(group, element, rawData) { + for (let ctr = 0; ctr < Tag.PRIVATE_DATA_READERS.length; ctr += 1) { + const privReader = new Tag.PRIVATE_DATA_READERS[ctr](rawData.buffer) + if (privReader.canRead(group, element)) { + return privReader.readHeader() + } } - return rawData; -}; - - + return rawData + } -daikon.Tag.convertValue = function (vr, rawData, littleEndian, charset) { - var data = null; + convertValue(vr, rawData, littleEndian, charset) { + let data = null // http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html if (vr === 'AE') { - data = daikon.Tag.getSingleStringValue(rawData, daikon.Tag.VR_AE_MAX_LENGTH); + data = this.getSingleStringValue(rawData, Tag.VR_AE_MAX_LENGTH) } else if (vr === 'AS') { - data = daikon.Tag.getFixedLengthStringValue(rawData, daikon.Tag.VR_AS_MAX_LENGTH); + data = this.getFixedLengthStringValue(rawData, Tag.VR_AS_MAX_LENGTH) } else if (vr === 'AT') { - data = daikon.Tag.getUnsignedInteger16(rawData, littleEndian); + data = this.getUnsignedInteger16(rawData, littleEndian) } else if (vr === 'CS') { - data = daikon.Tag.getStringValue(rawData); + data = this.getStringValue(rawData) } else if (vr === 'DA') { - data = daikon.Tag.getDateStringValue(rawData); + data = this.getDateStringValue(rawData) } else if (vr === 'DS') { - data = daikon.Tag.getDoubleStringValue(rawData); + data = this.getDoubleStringValue(rawData) } else if (vr === 'DT') { - data = daikon.Tag.getDateTimeStringValue(rawData); + data = this.getDateTimeStringValue(rawData) } else if (vr === 'FL') { - data = daikon.Tag.getFloat32(rawData, littleEndian); + data = this.getFloat32(rawData, littleEndian) } else if (vr === 'FD') { - data = daikon.Tag.getFloat64(rawData, littleEndian); - } else if (vr === 'FE') { // special Elscint double (see dictionary) - data = daikon.Tag.getDoubleElscint(rawData, littleEndian); + data = this.getFloat64(rawData, littleEndian) + } else if (vr === 'FE') { + // special Elscint double (see dictionary) + data = this.getDoubleElscint(rawData, littleEndian) } else if (vr === 'IS') { - data = daikon.Tag.getIntegerStringValue(rawData); + data = this.getIntegerStringValue(rawData) } else if (vr === 'LO') { - data = daikon.Tag.getStringValue(rawData, charset, vr); + data = this.getStringValue(rawData, charset, vr) } else if (vr === 'LT') { - data = daikon.Tag.getSingleStringValue(rawData, daikon.Tag.VR_AT_MAX_LENGTH, charset, vr); + data = this.getSingleStringValue(rawData, Tag.VR_AT_MAX_LENGTH, charset, vr) } else if (vr === 'OB') { - data = rawData; + data = rawData } else if (vr === 'OD') { - data = rawData; + data = rawData } else if (vr === 'OF') { - data = rawData; + data = rawData } else if (vr === 'OW') { - data = rawData; + data = rawData } else if (vr === 'PN') { - data = daikon.Tag.getPersonNameStringValue(rawData, charset, vr); + data = this.getPersonNameStringValue(rawData, charset, vr) } else if (vr === 'SH') { - data = daikon.Tag.getStringValue(rawData, charset, vr); + data = this.getStringValue(rawData, charset, vr) } else if (vr === 'SL') { - data = daikon.Tag.getSignedInteger32(rawData, littleEndian); + data = this.getSignedInteger32(rawData, littleEndian) } else if (vr === 'SQ') { - data = null; + data = null } else if (vr === 'SS') { - data = daikon.Tag.getSignedInteger16(rawData, littleEndian); + data = this.getSignedInteger16(rawData, littleEndian) } else if (vr === 'ST') { - data = daikon.Tag.getSingleStringValue(rawData, daikon.Tag.VR_ST_MAX_LENGTH, charset, vr); + data = this.getSingleStringValue(rawData, Tag.VR_ST_MAX_LENGTH, charset, vr) } else if (vr === 'TM') { - data = daikon.Tag.getTimeStringValue(rawData); + data = this.getTimeStringValue(rawData) } else if (vr === 'UI') { - data = daikon.Tag.getStringValue(rawData); + data = this.getStringValue(rawData) } else if (vr === 'UL') { - data = daikon.Tag.getUnsignedInteger32(rawData, littleEndian); + data = this.getUnsignedInteger32(rawData, littleEndian) } else if (vr === 'UN') { - data = rawData; + data = rawData } else if (vr === 'US') { - data = daikon.Tag.getUnsignedInteger16(rawData, littleEndian); + data = this.getUnsignedInteger16(rawData, littleEndian) } else if (vr === 'UT') { - data = daikon.Tag.getSingleStringValue(rawData, Number.MAX_SAFE_INTEGER, charset, vr); + data = this.getSingleStringValue(rawData, Number.MAX_SAFE_INTEGER, charset, vr) } else if (vr === 'UC') { - data = daikon.Tag.getStringValue(rawData); + data = this.getStringValue(rawData) } - return data; -}; - - -/*** Prototype Methods ***/ - -/** - * Returns a string representation of this tag. - * @param {number} [level] - the indentation level - * @param {boolean} [html] - * @returns {string} - */ -daikon.Tag.prototype.toString = function (level, html) { - var valueStr = '', - ctr, - groupStr = daikon.Utils.dec2hex(this.group), - elemStr = daikon.Utils.dec2hex(this.element), - tagStr = '(' + groupStr + ',' + elemStr + ')', - des = '', - padding; + return data + } + + /** * Prototype Methods ***/ + + /** + * Returns a string representation of this tag. + * @param {number} [level] - the indentation level + * @param {boolean} [html] + * @returns {string} + */ + toString(level, html) { + let valueStr = '' + const groupStr = dec2hex(this.group) + const elemStr = dec2hex(this.element) + let tagStr = '(' + groupStr + ',' + elemStr + ')' + let des = '' + let padding = '' if (level === undefined) { - level = 0; + level = 0 } - padding = ""; - for (ctr = 0; ctr < level; ctr += 1) { - if (html) { - padding += "  "; - } else { - padding += " "; - } + for (let ctr = 0; ctr < level; ctr += 1) { + if (html) { + padding += '  ' + } else { + padding += ' ' + } } if (this.sublist) { - for (ctr = 0; ctr < this.value.length; ctr += 1) { - valueStr += ('\n' + (this.value[ctr].toString(level + 1, html))); - } + for (let ctr = 0; ctr < this.value.length; ctr += 1) { + valueStr += '\n' + this.value[ctr].toString(level + 1, html) + } } else if (this.vr === 'SQ') { - valueStr = ''; + valueStr = '' } else if (this.isPixelData()) { - valueStr = ''; + valueStr = '' } else if (!this.value) { - valueStr = ''; + valueStr = '' } else { - if (html && this.preformatted) { - valueStr = "[
"+this.value +"
]"; - } else { - valueStr = '[' + this.value + ']'; - } + if (html && this.preformatted) { + valueStr = '[
' + this.value + '
]' + } else { + valueStr = '[' + this.value + ']' + } } if (this.isSublistItem()) { - tagStr = "Sequence Item"; + tagStr = 'Sequence Item' } else if (this.isSublistItemDelim()) { - tagStr = "Sequence Item Delimiter"; + tagStr = 'Sequence Item Delimiter' } else if (this.isSequenceDelim()) { - tagStr = "Sequence Delimiter"; + tagStr = 'Sequence Delimiter' } else if (this.isPixelData()) { - tagStr = "Pixel Data"; + tagStr = 'Pixel Data' } else { - des = daikon.Utils.convertCamcelCaseToTitleCase(daikon.Dictionary.getDescription(this.group, this.element)); + des = convertCamcelCaseToTitleCase(getDescription(this.group, this.element)) } // filter for xss - valueStr = xss(valueStr); + valueStr = xss(valueStr) if (html) { - return padding + "" + tagStr + "   " + des + '   ' + valueStr; + return ( + padding + + "" + + tagStr + + '   ' + + des + + '   ' + + valueStr + ) } else { - return padding + ' ' + tagStr + ' ' + des + ' ' + valueStr; + return padding + ' ' + tagStr + ' ' + des + ' ' + valueStr } -}; - - -/** - * Returns an HTML string representation of this tag. - * @param {number} level - the indentation level - * @returns {string} - */ -daikon.Tag.prototype.toHTMLString = function (level) { - return this.toString(level, true); -}; - - -/** - * Returns true if this is the transform syntax tag. - * @returns {boolean} - */ -daikon.Tag.prototype.isTransformSyntax = function () { - return (this.group === daikon.Tag.TAG_TRANSFER_SYNTAX[0]) && (this.element === daikon.Tag.TAG_TRANSFER_SYNTAX[1]); -}; - - -/** - * Returns true if this is the char set tag. - * @returns {boolean} - */ -daikon.Tag.prototype.isCharset = function () { - return (this.group === daikon.Tag.TAG_SPECIFIC_CHAR_SET[0]) && (this.element === daikon.Tag.TAG_SPECIFIC_CHAR_SET[1]); -}; - - -/** - * Returns true if this is the pixel data tag. - * @returns {boolean} - */ -daikon.Tag.prototype.isPixelData = function () { - return (this.group === daikon.Tag.TAG_PIXEL_DATA[0]) && (this.element === daikon.Tag.TAG_PIXEL_DATA[1]); -}; - - -/** - * Returns true if this tag contains private data. - * @returns {boolean} - */ -daikon.Tag.prototype.isPrivateData = function () { - /*jslint bitwise: true */ - return ((this.group & 1) === 1); -}; - - -/** - * Returns true if this tag contains private data that can be read. - * @returns {boolean} - */ -daikon.Tag.prototype.hasInterpretedPrivateData = function () { - return this.isPrivateData() && daikon.Utils.isString(this.value); -}; - - -/** - * Returns true if this tag is a sublist item. - * @returns {boolean} - */ -daikon.Tag.prototype.isSublistItem = function () { - return (this.group === daikon.Tag.TAG_SUBLIST_ITEM[0]) && (this.element === daikon.Tag.TAG_SUBLIST_ITEM[1]); -}; - - -/** - * Returns true if this tag is a sublist item delimiter. - * @returns {boolean} - */ -daikon.Tag.prototype.isSublistItemDelim = function () { - return (this.group === daikon.Tag.TAG_SUBLIST_ITEM_DELIM[0]) && (this.element === daikon.Tag.TAG_SUBLIST_ITEM_DELIM[1]); -}; - - -/** - * Returns true if this tag is a sequence delimiter. - * @returns {boolean} - */ -daikon.Tag.prototype.isSequenceDelim = function () { - return (this.group === daikon.Tag.TAG_SUBLIST_SEQ_DELIM[0]) && (this.element === daikon.Tag.TAG_SUBLIST_SEQ_DELIM[1]); -}; - - -/** - * Returns true if this is a meta length tag. - * @returns {boolean} - */ -daikon.Tag.prototype.isMetaLength = function () { - return (this.group === daikon.Tag.TAG_META_LENGTH[0]) && (this.element === daikon.Tag.TAG_META_LENGTH[1]); -}; - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Tag; + } + + /** + * Returns an HTML string representation of this tag. + * @param {number} level - the indentation level + * @returns {string} + */ + toHTMLString(level) { + return this.toString(level, true) + } + + /** + * Returns true if this is the transform syntax tag. + * @returns {boolean} + */ + isTransformSyntax() { + return this.group === Tag.TAG_TRANSFER_SYNTAX[0] && this.element === Tag.TAG_TRANSFER_SYNTAX[1] + } + + /** + * Returns true if this is the char set tag. + * @returns {boolean} + */ + isCharset() { + return this.group === Tag.TAG_SPECIFIC_CHAR_SET[0] && this.element === Tag.TAG_SPECIFIC_CHAR_SET[1] + } + + /** + * Returns true if this is the pixel data tag. + * @returns {boolean} + */ + isPixelData() { + return this.group === Tag.TAG_PIXEL_DATA[0] && this.element === Tag.TAG_PIXEL_DATA[1] + } + + /** + * Returns true if this tag contains private data. + * @returns {boolean} + */ + isPrivateData() { + return (this.group & 1) === 1 + } + + /** + * Returns true if this tag contains private data that can be read. + * @returns {boolean} + */ + hasInterpretedPrivateData() { + return this.isPrivateData() && isString(this.value) + } + + /** + * Returns true if this tag is a sublist item. + * @returns {boolean} + */ + isSublistItem() { + return this.group === Tag.TAG_SUBLIST_ITEM[0] && this.element === Tag.TAG_SUBLIST_ITEM[1] + } + + /** + * Returns true if this tag is a sublist item delimiter. + * @returns {boolean} + */ + isSublistItemDelim() { + return this.group === Tag.TAG_SUBLIST_ITEM_DELIM[0] && this.element === Tag.TAG_SUBLIST_ITEM_DELIM[1] + } + + /** + * Returns true if this tag is a sequence delimiter. + * @returns {boolean} + */ + isSequenceDelim() { + return this.group === Tag.TAG_SUBLIST_SEQ_DELIM[0] && this.element === Tag.TAG_SUBLIST_SEQ_DELIM[1] + } + + /** + * Returns true if this is a meta length tag. + * @returns {boolean} + */ + isMetaLength() { + return this.group === Tag.TAG_META_LENGTH[0] && this.element === Tag.TAG_META_LENGTH[1] + } } diff --git a/src/utilities.js b/src/utilities.js index 7c1b7e3..3d27606 100644 --- a/src/utilities.js +++ b/src/utilities.js @@ -1,321 +1,239 @@ +/** * Static Pseudo-constants ***/ +export const MAX_VALUE = 9007199254740991 +export const MIN_VALUE = -9007199254740991 -/*jslint browser: true, node: true */ -/*global require, module */ - -"use strict"; - -/*** Imports ***/ -//var convertBytes = require('@wearemothership/dicom-character-set').convertBytes; -var daikon = daikon || {}; -daikon.Utils = daikon.Utils || {}; - - -daikon.Utils.crcTable = null; - - -/*** Static Pseudo-constants ***/ - -daikon.Utils.MAX_VALUE = 9007199254740991; -daikon.Utils.MIN_VALUE = -9007199254740991; - - - -/*** Static methods ***/ - -daikon.Utils.dec2hex = function (i) { - return (i + 0x10000).toString(16).substr(-4).toUpperCase(); -}; - - +export const dec2hex = (i) => (i + 0x10000).toString(16).substr(-4).toUpperCase() // http://stackoverflow.com/questions/966225/how-can-i-create-a-two-dimensional-array-in-javascript -daikon.Utils.createArray = function (length) { - var arr = new Array(length || 0), - i = length; - - if (arguments.length > 1) { - var args = Array.prototype.slice.call(arguments, 1); - while(i--) arr[length-1 - i] = daikon.Utils.createArray.apply(this, args); - } - - return arr; -}; - - -daikon.Utils.getStringAt = function (dataview, start, length, charset, vr) { - var str = "", ctr, ch; - - for (ctr = 0; ctr < length; ctr += 1) { - ch = dataview.getUint8(start + ctr); - - if (ch !== 0) { - str += String.fromCharCode(ch); - } - } - - /* - @from wearemothership dicom-character-set - var strBuff = new Uint8Array(dataview.buffer, dataview.byteOffset + start, length); - var str = convertBytes(charset || "ISO 2022 IR 6", strBuff, {vr: vr} ); - while (str && str.charCodeAt(str.length - 1) === 0) { - str = str.slice(0,-1); - } - */ - return str; -}; +// TODO: clean this mess up +export const createArray = function (length) { + const arr = new Array(length || 0) + let i = length + if (arguments.length > 1) { + const args = Array.prototype.slice.call(arguments, 1) + while (i--) arr[length - 1 - i] = createArray.apply(this, args) + } + return arr +} -daikon.Utils.trim = function (str) { - return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); -}; - - - -daikon.Utils.stripLeadingZeros = function (str) { - return str.replace(/^[0]+/g, ""); -}; - +export const getStringAt = (dataview, start, length, charset, vr) => { + let str = '' + for (let ctr = 0; ctr < length; ctr += 1) { + const ch = dataview.getUint8(start + ctr) -daikon.Utils.safeParseInt = function (str) { - str = daikon.Utils.stripLeadingZeros(str); - if (str.length > 0) { - return parseInt(str, 10); + if (ch !== 0) { + str += String.fromCharCode(ch) } + } - return 0; -}; - + return str +} +export const trim = (str) => str.replace(/^\s\s*/, '').replace(/\s\s*$/, '') -daikon.Utils.convertCamcelCaseToTitleCase = function (str) { - var result = str.replace(/([A-Z][a-z])/g, " $1"); - return daikon.Utils.trim(result.charAt(0).toUpperCase() + result.slice(1)); -}; +export const stripLeadingZeros = (str) => str.replace(/^[0]+/g, '') +export const safeParseInt = (str) => { + str = stripLeadingZeros(str) + if (str.length > 0) { + return parseInt(str, 10) + } + return 0 +} -daikon.Utils.safeParseFloat = function (str) { - str = daikon.Utils.stripLeadingZeros(str); - if (str.length > 0) { - return parseFloat(str); - } +export const convertCamcelCaseToTitleCase = (str) => { + const result = str.replace(/([A-Z][a-z])/g, ' $1') + return trim(result.charAt(0).toUpperCase() + result.slice(1)) +} - return 0; -}; +export const safeParseFloat = function (str) { + str = stripLeadingZeros(str) + if (str.length > 0) { + return parseFloat(str) + } + return 0 +} // http://stackoverflow.com/questions/8361086/convert-byte-array-to-numbers-in-javascript -daikon.Utils.bytesToDouble = function (data) { - var sign = (data[0] & 1<<7)>>7; - - var exponent = (((data[0] & 127) << 4) | (data[1]&(15<<4))>>4); - - if(exponent == 0) return 0; - if(exponent == 0x7ff) return (sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - var mul = Math.pow(2,exponent - 1023 - 52); - var mantissa = data[7]+ - data[6]*Math.pow(2,8)+ - data[5]*Math.pow(2,8*2)+ - data[4]*Math.pow(2,8*3)+ - data[3]*Math.pow(2,8*4)+ - data[2]*Math.pow(2,8*5)+ - (data[1]&15)*Math.pow(2,8*6)+ - Math.pow(2,52); - - return Math.pow(-1,sign)*mantissa*mul; -}; - - - -daikon.Utils.concatArrayBuffers = function (buffer1, buffer2) { - var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); - tmp.set(new Uint8Array(buffer1), 0); - tmp.set(new Uint8Array(buffer2), buffer1.byteLength); - return tmp.buffer; -}; - - - -daikon.Utils.concatArrayBuffers2 = function (buffers) { - var length = 0, offset = 0, ctr; - - for (ctr = 0; ctr < buffers.length; ctr += 1) { - length += buffers[ctr].byteLength; - } - - var tmp = new Uint8Array(length); +export const bytesToDouble = function (data) { + const sign = (data[0] & (1 << 7)) >> 7 + + const exponent = ((data[0] & 127) << 4) | ((data[1] & (15 << 4)) >> 4) + + if (exponent === 0) return 0 + if (exponent === 0x7ff) return sign ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY + + const mul = Math.pow(2, exponent - 1023 - 52) + const mantissa = + data[7] + + data[6] * Math.pow(2, 8) + + data[5] * Math.pow(2, 8 * 2) + + data[4] * Math.pow(2, 8 * 3) + + data[3] * Math.pow(2, 8 * 4) + + data[2] * Math.pow(2, 8 * 5) + + (data[1] & 15) * Math.pow(2, 8 * 6) + + Math.pow(2, 52) + + return Math.pow(-1, sign) * mantissa * mul +} - for (ctr = 0; ctr < buffers.length; ctr += 1) { - tmp.set(new Uint8Array(buffers[ctr]), offset); - offset += buffers[ctr].byteLength; +export const concatArrayBuffers = function (buffer1, buffer2) { + const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength) + tmp.set(new Uint8Array(buffer1), 0) + tmp.set(new Uint8Array(buffer2), buffer1.byteLength) + return tmp.buffer +} - } +export const concatArrayBuffers2 = function (buffers) { + let length = 0 + let offset = 0 - return tmp.buffer; -}; + for (let ctr = 0; ctr < buffers.length; ctr += 1) { + length += buffers[ctr].byteLength + } + const tmp = new Uint8Array(length) + for (let ctr = 0; ctr < buffers.length; ctr += 1) { + tmp.set(new Uint8Array(buffers[ctr]), offset) + offset += buffers[ctr].byteLength + } -daikon.Utils.fillBuffer = function (array, buffer, offset, numBytes) { - var ctr; + return tmp.buffer +} - if (numBytes === 1) { - for (ctr = 0; ctr < array.length; ctr+=1) { - buffer.setUint8(offset + ctr, array[ctr]); - } - } else if (numBytes === 2) { - for (ctr = 0; ctr < array.length; ctr+=1) { - buffer.setUint16(offset + (ctr * 2), array[ctr], true); - } +export const fillBuffer = function (array, buffer, offset, numBytes) { + if (numBytes === 1) { + for (let ctr = 0; ctr < array.length; ctr += 1) { + buffer.setUint8(offset + ctr, array[ctr]) } -}; - - - -daikon.Utils.fillBufferRGB = function (array, buffer, offset) { - var r, g, b, ctr, numElements = (parseInt(array.length / 3)); - - for (ctr = 0; ctr < numElements; ctr+=1) { - r = array[ctr * 3]; - g = array[ctr * 3 + 1]; - b = array[ctr * 3 + 2]; - - buffer.setUint8(offset + ctr, parseInt((r + b + g) / 3), true); + } else if (numBytes === 2) { + for (let ctr = 0; ctr < array.length; ctr += 1) { + buffer.setUint16(offset + ctr * 2, array[ctr], true) } -}; - + } +} +export const fillBufferRGB = function (array, buffer, offset) { + const numElements = parseInt(array.length / 3) -daikon.Utils.bind = function (scope, fn, args, appendArgs) { - if (arguments.length === 2) { - return function () { - return fn.apply(scope, arguments); - }; - } + for (let ctr = 0; ctr < numElements; ctr += 1) { + const r = array[ctr * 3] + const g = array[ctr * 3 + 1] + const b = array[ctr * 3 + 2] - var method = fn, - slice = Array.prototype.slice; + buffer.setUint8(offset + ctr, parseInt((r + b + g) / 3), true) + } +} +export const bind = function (scope, fn, args, appendArgs) { + if (arguments.length === 2) { return function () { - var callArgs = args || arguments; - - if (appendArgs === true) { - callArgs = slice.call(arguments, 0); - callArgs = callArgs.concat(args); - } else if (typeof appendArgs === 'number') { - callArgs = slice.call(arguments, 0); // copy arguments first - Ext.Array.insert(callArgs, appendArgs, args); - } - - return method.apply(scope || window, callArgs); - }; -}; - + return fn.apply(scope, arguments) + } + } + const method = fn + const slice = Array.prototype.slice -daikon.Utils.toArrayBuffer = function (buffer) { - var ab, view, i; + return function () { + let callArgs = args || arguments - ab = new ArrayBuffer(buffer.length); - view = new Uint8Array(ab); - for (i = 0; i < buffer.length; i += 1) { - view[i] = buffer[i]; + if (appendArgs === true) { + callArgs = slice.call(arguments, 0) + callArgs = callArgs.concat(args) + } else if (typeof appendArgs === 'number') { + callArgs = slice.call(arguments, 0) // copy arguments first + Array.insert(callArgs, appendArgs, args) } - return ab; -}; + return method.apply(scope || window, callArgs) + } +} +export const toArrayBuffer = function (buffer) { + const ab = new ArrayBuffer(buffer.length) + const view = new Uint8Array(ab) + for (let i = 0; i < buffer.length; i += 1) { + view[i] = buffer[i] + } + return ab +} // http://stackoverflow.com/questions/203739/why-does-instanceof-return-false-for-some-literals -daikon.Utils.isString = function (s) { - return typeof(s) === 'string' || s instanceof String; -}; - - +export const isString = function (s) { + return typeof s === 'string' || s instanceof String +} // http://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript -daikon.Utils.isValidDate = function(d) { - if (Object.prototype.toString.call(d) === "[object Date]") { - if (isNaN(d.getTime())) { - return false; - } else { - return true; - } +export const isValidDate = function (d) { + if (Object.prototype.toString.call(d) === '[object Date]') { + if (isNaN(d.getTime())) { + return false } else { - return false; + return true } -}; - - - -daikon.Utils.swap32 = function (val) { - /*jslint bitwise: true */ - return ((val & 0xFF) << 24) | ((val & 0xFF00) << 8) | ((val >> 8) & 0xFF00) | ((val >> 24) & 0xFF); -}; - - + } else { + return false + } +} -daikon.Utils.swap16 = function (val) { - /*jslint bitwise: true */ - return ((((val & 0xFF) << 8) | ((val >> 8) & 0xFF)) << 16) >> 16; // since JS uses 32-bit when bit shifting -}; +export const swap32 = function (val) { + return ((val & 0xff) << 24) | ((val & 0xff00) << 8) | ((val >> 8) & 0xff00) | ((val >> 24) & 0xff) +} +export const swap16 = function (val) { + return ((((val & 0xff) << 8) | ((val >> 8) & 0xff)) << 16) >> 16 // since JS uses 32-bit when bit shifting +} // http://stackoverflow.com/questions/18638900/javascript-crc32 -daikon.Utils.makeCRCTable = function(){ - var c; - var crcTable = []; - for(var n =0; n < 256; n++){ - c = n; - for(var k =0; k < 8; k++){ - c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - crcTable[n] = c; +export const makeCRCTable = function () { + let c + const crcTable = [] + for (let n = 0; n < 256; n++) { + c = n + for (let k = 0; k < 8; k++) { + c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1 } - return crcTable; -}; - -daikon.Utils.crc32 = function(dataView) { - var crcTable = daikon.Utils.crcTable || (daikon.Utils.crcTable = daikon.Utils.makeCRCTable()); - var crc = 0 ^ (-1); + crcTable[n] = c + } + return crcTable +} - for (var i = 0; i < dataView.byteLength; i++ ) { - crc = (crc >>> 8) ^ crcTable[(crc ^ dataView.getUint8(i)) & 0xFF]; - } +export const crcTable = makeCRCTable() - return (crc ^ (-1)) >>> 0; -}; +export const crc32 = function (dataView) { + let crc = 0 ^ -1 + for (let i = 0; i < dataView.byteLength; i++) { + crc = (crc >>> 8) ^ crcTable[(crc ^ dataView.getUint8(i)) & 0xff] + } + return (crc ^ -1) >>> 0 +} -daikon.Utils.createBitMask = function (numBytes, bitsStored, unsigned) { - var mask = 0xFFFFFFFF; - mask >>>= (((4 - numBytes) * 8) + ((numBytes * 8) - bitsStored)); +export const createBitMask = function (numBytes, bitsStored, unsigned) { + let mask = 0xffffffff + mask >>>= (4 - numBytes) * 8 + (numBytes * 8 - bitsStored) - if (unsigned) { - if (numBytes == 1) { - mask &= 0x000000FF; - } else if (numBytes == 2) { - mask &= 0x0000FFFF; - } else if (numBytes == 4) { - mask &= 0xFFFFFFFF; - } else if (numBytes == 8) { - mask = 0xFFFFFFFF; - } - } else { - mask = 0xFFFFFFFF; + if (unsigned) { + if (numBytes === 1) { + mask &= 0x000000ff + } else if (numBytes === 2) { + mask &= 0x0000ffff + } else if (numBytes === 4) { + mask &= 0xffffffff + } else if (numBytes === 8) { + mask = 0xffffffff } + } else { + mask = 0xffffffff + } - return mask; -}; - - - -/*** Exports ***/ - -var moduleType = typeof module; -if ((moduleType !== 'undefined') && module.exports) { - module.exports = daikon.Utils; + return mask } diff --git a/tests/browser.html b/tests/browser.html index 43ad46a..41907a2 100644 --- a/tests/browser.html +++ b/tests/browser.html @@ -16,8 +16,6 @@ function readDICOM(name, buf) { clearLog(); - console.log("File: " + name); - console.log(""); var data = new DataView(buf); daikon.Parser.verbose = true; daikon.Series.parseImage(data); diff --git a/tests/driver-deflated.js b/tests/driver-deflated.js index ee4d5fb..31d9002 100644 --- a/tests/driver-deflated.js +++ b/tests/driver-deflated.js @@ -1,34 +1,30 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/deflated.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/deflated.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) +let imageData = null describe('Daikon', function () { - describe('test deflated', function () { - it('image size should be 524288', function () { - assert.equal(262144, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes uncompressed size should be 262144', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(262144, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 3700532309', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 3700532309); - }); - }); -}); + describe('test deflated', function () { + it('image size should be 524288', function () { + assert.equal( + 262144, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes uncompressed size should be 262144', function (done) { + imageData = image.getPixelDataBytes() + assert.equal(262144, imageData.byteLength) + done() + }) + + it('image data checksum should equal 3700532309', function () { + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 3700532309) + }) + }) +}) diff --git a/tests/driver-explicit-big.js b/tests/driver-explicit-big.js index 2f75765..fd0de30 100644 --- a/tests/driver-explicit-big.js +++ b/tests/driver-explicit-big.js @@ -1,37 +1,30 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/explicit_big.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var dataInterpreted = null; -var image = null; +const buf = fs.readFileSync('./tests/data/explicit_big.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +let dataInterpreted = null +let image = null describe('Daikon', function () { - describe('test explicit big', function () { - it('should not throw error', function (done) { - assert.doesNotThrow(function() { - image = daikon.Series.parseImage(data); - done(); - }); - }); - - it('image data checksum should equal 148031006', function () { - var imageData = image.getPixelDataBytes(); - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 148031006); - }); - - it('image max should equal 891', function () { - dataInterpreted = image.getInterpretedData(false, true); - assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 891); - }); - }); -}); + describe('test explicit big', function () { + it('should not throw error', function (done) { + assert.doesNotThrow(function () { + image = daikon.Series.parseImage(data) + done() + }) + }) + + it('image data checksum should equal 148031006', function () { + const imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 148031006) + }) + + it('image max should equal 891', function () { + dataInterpreted = image.getInterpretedData(false, true) + assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 891) + }) + }) +}) diff --git a/tests/driver-explicit-little.js b/tests/driver-explicit-little.js index 5f49104..4759c10 100644 --- a/tests/driver-explicit-little.js +++ b/tests/driver-explicit-little.js @@ -1,37 +1,30 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/explicit_little.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var dataInterpreted = null; -var image = null; +const buf = fs.readFileSync('./tests/data/explicit_little.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +let dataInterpreted = null +let image = null describe('Daikon', function () { - describe('test explicit little', function () { - it('should not throw error', function (done) { - assert.doesNotThrow(function() { - image = daikon.Series.parseImage(data); - done(); - }); - }); - - it('image data checksum should equal 2095278243', function () { - var imageData = image.getPixelDataBytes(); - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 2095278243); - }); - - it('image max should equal 252', function () { - dataInterpreted = image.getInterpretedData(false, true); - assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 252); - }); - }); -}); + describe('test explicit little', function () { + it('should not throw error', function (done) { + assert.doesNotThrow(function () { + image = daikon.Series.parseImage(data) + done() + }) + }) + + it('image data checksum should equal 2095278243', function () { + const imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 2095278243) + }) + + it('image max should equal 252', function () { + dataInterpreted = image.getInterpretedData(false, true) + assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 252) + }) + }) +}) diff --git a/tests/driver-implicit.js b/tests/driver-implicit.js index 7c93979..1139f34 100644 --- a/tests/driver-implicit.js +++ b/tests/driver-implicit.js @@ -1,37 +1,30 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/implicit_little.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var dataInterpreted = null; -var image = null; +const buf = fs.readFileSync('./tests/data/implicit_little.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +let dataInterpreted = null +let image = null describe('Daikon', function () { - describe('test implicit', function () { - it('should not throw error', function (done) { - assert.doesNotThrow(function() { - image = daikon.Series.parseImage(data); - done(); - }); - }); - - it('image data checksum should equal 3896449929', function () { - var imageData = image.getPixelDataBytes(); - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 3896449929); - }); - - it('image max should equal 575', function () { - dataInterpreted = image.getInterpretedData(false, true); - assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 575); - }); - }); -}); + describe('test implicit', function () { + it('should not throw error', function (done) { + assert.doesNotThrow(function () { + image = daikon.Series.parseImage(data) + done() + }) + }) + + it('image data checksum should equal 3896449929', function () { + const imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 3896449929) + }) + + it('image max should equal 575', function () { + dataInterpreted = image.getInterpretedData(false, true) + assert.equal(dataInterpreted.data[dataInterpreted.maxIndex], 575) + }) + }) +}) diff --git a/tests/driver-jpeg-2000.js b/tests/driver-jpeg-2000.js index 63013ce..8041eb9 100644 --- a/tests/driver-jpeg-2000.js +++ b/tests/driver-jpeg-2000.js @@ -1,39 +1,35 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/jpeg_2000.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/jpeg_2000.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) describe('Daikon', function () { - describe('test jpeg 2000', function () { - it('image size should be 524288', function () { - assert.equal(524288, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes compressed size should be 7560', function (done) { - assert.equal(7560, image.getPixelData().value.buffer.byteLength); - done(); - }); - - it('pixel bytes uncompressed size should be 524288', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(524288, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 2592514340', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 2592514340); - }); - }); -}); + describe('test jpeg 2000', function () { + it('image size should be 524288', function () { + assert.equal( + 524288, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes compressed size should be 7560', function (done) { + assert.equal(7560, image.getPixelData().value.buffer.byteLength) + done() + }) + + it('pixel bytes uncompressed size should be 524288', function (done) { + const imageData = image.getPixelDataBytes() + assert.equal(524288, imageData.byteLength) + done() + }) + + it('image data checksum should equal 2592514340', function () { + const imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 717203911) + }) + }) +}) diff --git a/tests/driver-jpeg-baseline-8bit.js b/tests/driver-jpeg-baseline-8bit.js index 0b23642..2b897ae 100644 --- a/tests/driver-jpeg-baseline-8bit.js +++ b/tests/driver-jpeg-baseline-8bit.js @@ -1,39 +1,36 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/jpeg_baseline_8bit.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/jpeg_baseline_8bit.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) +let imageData = null describe('Daikon', function () { - describe('test jpeg baseline 8bit', function () { - it('image size should be 25165824', function () { - assert.equal(25165824, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes compressed size should be 1691672', function (done) { - assert.equal(1691672, image.getPixelData().value.buffer.byteLength); - done(); - }); - - it('pixel bytes uncompressed size should be 25165824', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(25165824, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 3962430437', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 3962430437); - }); - }); -}); + describe('test jpeg baseline 8bit', function () { + it('image size should be 25165824', function () { + assert.equal( + 25165824, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes compressed size should be 1691672', function (done) { + assert.equal(1691672, image.getPixelData().value.buffer.byteLength) + done() + }) + + it('pixel bytes uncompressed size should be 25165824', function (done) { + imageData = image.getPixelDataBytes() + assert.equal(25165824, imageData.byteLength) + done() + }) + + it('image data checksum should equal 3962430437', function () { + imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 3962430437) + }) + }) +}) diff --git a/tests/driver-jpeg-lossless-sel1.js b/tests/driver-jpeg-lossless-sel1.js index 6e62f2d..717c7bc 100644 --- a/tests/driver-jpeg-lossless-sel1.js +++ b/tests/driver-jpeg-lossless-sel1.js @@ -1,39 +1,35 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/jpeg_lossless_sel1.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/jpeg_lossless_sel1.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) +let imageData = null describe('Daikon', function () { - describe('test jpeg lossless sel1', function () { - it('image size should be 409600', function () { - assert.equal(409600, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes compressed size should be 143498', function (done) { - assert.equal(143498, image.getPixelData().value.buffer.byteLength); - done(); - }); - - it('pixel bytes uncompressed size should be 409600', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(409600, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 4077593098', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 4077593098); - }); - }); -}); + describe('test jpeg lossless sel1', function () { + it('image size should be 409600', function () { + assert.equal( + 409600, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes compressed size should be 143498', function (done) { + assert.equal(143498, image.getPixelData().value.buffer.byteLength) + done() + }) + + it('pixel bytes uncompressed size should be 409600', function (done) { + imageData = image.getPixelDataBytes() + assert.equal(409600, imageData.byteLength) + done() + }) + + it('image data checksum should equal 4077593098', function () { + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 4077593098) + }) + }) +}) diff --git a/tests/driver-jpeg-ls.js b/tests/driver-jpeg-ls.js index 4429c2b..5e3d548 100644 --- a/tests/driver-jpeg-ls.js +++ b/tests/driver-jpeg-ls.js @@ -1,39 +1,36 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/jpeg_ls.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/jpeg_ls.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) +let imageData = null describe('Daikon', function () { - describe('test jpegls', function () { - it('image size should be 2097152', function () { - assert.equal(2097152, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes compressed size should be 279654', function (done) { - assert.equal(279654, image.getPixelData().value.buffer.byteLength); - done(); - }); - - it('pixel bytes uncompressed size should be 2097152', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(2097152, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 157645463', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 157645463); - }); - }); -}); + describe('test jpegls', function () { + it('image size should be 2097152', function () { + assert.equal( + 2097152, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes compressed size should be 279654', function (done) { + assert.equal(279654, image.getPixelData().value.buffer.byteLength) + done() + }) + + it('pixel bytes uncompressed size should be 2097152', function (done) { + imageData = image.getPixelDataBytes() + assert.equal(2097152, imageData.byteLength) + done() + }) + + it('image data checksum should equal 157645463', function () { + imageData = image.getPixelDataBytes() + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 157645463) + }) + }) +}) diff --git a/tests/driver-rle.js b/tests/driver-rle.js index dcd9664..b35d473 100644 --- a/tests/driver-rle.js +++ b/tests/driver-rle.js @@ -1,39 +1,35 @@ +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var buf = fs.readFileSync('./tests/data/rle.dcm'); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); -var image = daikon.Series.parseImage(data); -var imageData = null; +const buf = fs.readFileSync('./tests/data/rle.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) +const image = daikon.Series.parseImage(data) +let imageData = null describe('Daikon', function () { - describe('test rle', function () { - it('image size should be 524288', function () { - assert.equal(524288, (image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8))); - }); - - it('pixel bytes compressed size should be 248496', function (done) { - assert.equal(248496, image.getPixelData().value.buffer.byteLength); - done(); - }); - - it('pixel bytes uncompressed size should be 524288', function (done) { - imageData = image.getPixelDataBytes(); - assert.equal(524288, imageData.byteLength); - done(); - }); - - it('image data checksum should equal 1052635650', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 1052635650); - }); - }); -}); + describe('test rle', function () { + it('image size should be 524288', function () { + assert.equal( + 524288, + image.getRows() * image.getCols() * image.getNumberOfFrames() * (image.getBitsAllocated() / 8) + ) + }) + + it('pixel bytes compressed size should be 248496', function (done) { + assert.equal(248496, image.getPixelData().value.buffer.byteLength) + done() + }) + + it('pixel bytes uncompressed size should be 524288', function (done) { + imageData = image.getPixelDataBytes() + assert.equal(524288, imageData.byteLength) + done() + }) + + it('image data checksum should equal 1052635650', function () { + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 1052635650) + }) + }) +}) diff --git a/tests/driver-series.js b/tests/driver-series.js index 74dde31..12ee65b 100644 --- a/tests/driver-series.js +++ b/tests/driver-series.js @@ -1,66 +1,56 @@ - -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ - -"use strict"; - -var assert = require("assert"); -var fs = require('fs'); - -var daikon = require('../src/main.js'); - -var ctr, filePath, buf, image; -var series = new daikon.Series(); -var files = fs.readdirSync('./tests/data/volume/'); -var imageData = null; - -for (ctr in files) { - if (files[ctr]) { - filePath = './tests/data/volume/' + files[ctr]; - buf = fs.readFileSync(filePath); - image = daikon.Series.parseImage(new DataView(daikon.Utils.toArrayBuffer(buf))); - - if (image === null) { - console.error(daikon.Series.parserError); - } else if (image.hasPixelData()) { - if ((series.images.length === 0) || (image.getSeriesId() === series.images[0].getSeriesId())) { - series.addImage(image); - } - } +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' + +const series = new daikon.Series() +const files = fs.readdirSync('./tests/data/volume/') +let imageData = null + +for (const file of files) { + const filePath = './tests/data/volume/' + file + const buf = fs.readFileSync(filePath) + const image = daikon.Series.parseImage(new DataView(daikon.Utils.toArrayBuffer(buf))) + + if (image === null) { + console.error(daikon.Series.parserError) + } else if (image.hasPixelData()) { + if (series.images.length === 0 || image.getSeriesId() === series.images[0].getSeriesId()) { + series.addImage(image) } + } } -series.buildSeries(); +series.buildSeries() describe('Daikon', function () { - describe('test series', function () { - it('cols should equal 256', function () { - assert.equal(256, series.images[0].getCols()); - }); - - it('rows should equal 256', function () { - assert.equal(256, series.images[0].getRows()); - }); - - it('slices should equal 20', function () { - assert.equal(20, series.images.length); - }); - - it('bits allocated should be 16', function () { - assert.equal(16, series.images[0].getBitsAllocated()); - }); - - it('image size should be 2621440', function (done) { - series.concatenateImageData(null, function (data) { - imageData = data; - assert.equal(2621440, data.byteLength); - done(); - }); - }); - - it('image data checksum should equal 2682517968', function () { - var checksum = daikon.Utils.crc32(new DataView(imageData)); - assert.equal(checksum, 2682517968); - }); - }); -}); + describe('test series', function () { + it('cols should equal 256', function () { + assert.equal(256, series.images[0].getCols()) + }) + + it('rows should equal 256', function () { + assert.equal(256, series.images[0].getRows()) + }) + + it('slices should equal 20', function () { + assert.equal(20, series.images.length) + }) + + it('bits allocated should be 16', function () { + assert.equal(16, series.images[0].getBitsAllocated()) + }) + + it('image size should be 2621440', function (done) { + series.concatenateImageData(null, function (data) { + imageData = data + assert.equal(2621440, data.byteLength) + done() + }) + }) + + it('image data checksum should equal 2682517968', function () { + const checksum = daikon.Utils.crc32(new DataView(imageData)) + assert.equal(checksum, 2682517968) + }) + }) +}) diff --git a/tests/driver-tags.js b/tests/driver-tags.js index 5eb104d..bbd3407 100644 --- a/tests/driver-tags.js +++ b/tests/driver-tags.js @@ -1,53 +1,45 @@ -/*jslint browser: true, node: true */ -/*global require, module, describe, it */ -// from https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html +import assert from 'assert' +import fs from 'fs' +import * as daikon from '../src/main.js' -"use strict"; - -var assert = require("assert"); -var fs = require("fs"); - -var daikon = require("../src/main.js"); - -var buf = fs.readFileSync("./tests/data/jpeg_baseline_8bit.dcm"); -var data = new DataView(daikon.Utils.toArrayBuffer(buf)); +const buf = fs.readFileSync('./tests/data/jpeg_baseline_8bit.dcm') +const data = new DataView(daikon.Utils.toArrayBuffer(buf)) // daikon.Parser.verbose = true; -var image = daikon.Series.parseImage(data); +const image = daikon.Series.parseImage(data) -describe("Daikon", function () { - describe("test jpeg verify tags", function () { - it("private tags are correctly read", function () { - var tags = image.tags; - assert.equal(tags["50000005"].value[0], 2); - assert.equal(tags["50000010"].value[0], 3840); - assert.equal(tags["50000020"].value[0], "ECG"); - assert.equal(tags["50000030"].value[0], "DPPS"); - assert.equal(tags["50000103"].value[0], 0); - }); - }); +describe('Daikon', function () { + describe('test jpeg verify tags', function () { + it('private tags are correctly read', function () { + const tags = image.tags + assert.equal(tags['50000005'].value[0], 2) + assert.equal(tags['50000010'].value[0], 3840) + assert.equal(tags['50000020'].value[0], 'ECG') + assert.equal(tags['50000030'].value[0], 'DPPS') + assert.equal(tags['50000103'].value[0], 0) + }) + }) - describe("verify xss strings are filtered out", function () { - it("script tags and event handlers are removed", function () { + describe('verify xss strings are filtered out', function () { + it('script tags and event handlers are removed', function () { // add xss tags from https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html - let xssTag = image.tags[50000020]; + const xssTag = image.tags[50000020] xssTag.value = [ - "allowed", - "values", - "", + 'allowed', + 'values', + '', "javascript:/*-->", - "\\xxs link\\", + '\\xxs link\\', '"\\>', - "", - "", - '', - ].join("\n"); + '', + '', + '' + ].join('\n') + + const tagText = xssTag.toString() - // console.log(xssTag); - let tagText = xssTag.toString(); - - const re = /( Date: Wed, 22 Nov 2023 11:57:45 +0100 Subject: [PATCH 2/5] fix up pipeline --- .github/workflows/test.yml | 7 +++---- package.json | 2 +- src/utilities.js | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18c5e68..e7e91d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,7 @@ jobs: cache: "npm" - run: npm install - run: npm run build - # TODO: activate this once a linting setup exists - # - name: Lint - # if: matrix.os != 'windows-latest' - # run: npm run lint + - name: Lint + if: matrix.os != 'windows-latest' + run: npm run lint - run: npm run test \ No newline at end of file diff --git a/package.json b/package.json index 2d30900..5cfe870 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "uglify-js": "*" }, "scripts": { - "lint": "DEBUG=eslint:cli-engine eslint --fix .", + "lint": "eslint .", "test": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests", "test-dev": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests/driver-jpeg-2000.js", "esbuild": "rm -rf build; mkdir build; esbuild src/main.js --bundle --global-name=daikon --platform=node --outfile=build/daikon.js; esbuild src/main.js --bundle --global-name=daikon --platform=node --minify --outfile=build/daikon-min.js", diff --git a/src/utilities.js b/src/utilities.js index 3d27606..fa92334 100644 --- a/src/utilities.js +++ b/src/utilities.js @@ -18,7 +18,7 @@ export const createArray = function (length) { return arr } -export const getStringAt = (dataview, start, length, charset, vr) => { +export const getStringAt = (dataview, start, length) => { let str = '' for (let ctr = 0; ctr < length; ctr += 1) { From ed20cf47a02b768922c643f34fcd49a64c2c74c4 Mon Sep 17 00:00:00 2001 From: Jens Ochsenmeier Date: Wed, 22 Nov 2023 12:01:44 +0100 Subject: [PATCH 3/5] cleanup --- package-lock.json | 2392 ++------------------------------------------- package.json | 11 +- 2 files changed, 64 insertions(+), 2339 deletions(-) diff --git a/package-lock.json b/package-lock.json index eceec57..ac20a39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,18 +17,14 @@ "xss": "1.0.14" }, "devDependencies": { - "browserify": "*", "esbuild": "*", "eslint": "^8.36.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-prettier": "^5.0.1", - "full-icu": "*", - "icu4c-data": "*", - "jsdoc-to-markdown": "*", + "icu4c-data": "^0.57.2", "mocha": "*", - "prettier": "^3.1.0", - "uglify-js": "*" + "prettier": "^3.1.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -40,18 +36,6 @@ "node": ">=0.10.0" } }, - "node_modules/@babel/parser": { - "version": "7.21.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.8.tgz", - "integrity": "sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@esbuild/android-arm": { "version": "0.17.19", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", @@ -493,18 +477,6 @@ "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, - "node_modules/@jsdoc/salty": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.5.tgz", - "integrity": "sha512-TfRP53RqunNe2HBobVBJ0VLhK1HbfvBYeTC1ahnN64PWvyYyGebmMiPkuwvD9fpw2ZbkoPb8Q7mwy0aR8Z9rvw==", - "dev": true, - "dependencies": { - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v12.0.0" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -567,28 +539,6 @@ "dev": true, "peer": true }, - "node_modules/@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", - "dev": true - }, - "node_modules/@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "dev": true, - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "dev": true - }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -600,6 +550,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -616,26 +567,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-node": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", - "dev": true, - "dependencies": { - "acorn": "^7.0.0", - "acorn-walk": "^7.0.0", - "xtend": "^4.0.2" - } - }, - "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -661,27 +592,6 @@ "node": ">=6" } }, - "node_modules/ansi-escape-sequences": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", - "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", - "dev": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ansi-escape-sequences/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -725,15 +635,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", @@ -848,54 +749,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "util": "0.10.3" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", - "dev": true - }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==", - "dev": true, - "dependencies": { - "inherits": "2.0.1" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -909,26 +768,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -947,18 +786,6 @@ "node": ">=8" } }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, "node_modules/bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -993,230 +820,12 @@ "node": ">=8" } }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "dev": true - }, - "node_modules/browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dev": true, - "dependencies": { - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "JSONStream": "^1.0.3", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - }, - "bin": { - "browser-pack": "bin/cmd.js" - } - }, - "node_modules/browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dev": true, - "dependencies": { - "resolve": "^1.17.0" - } - }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "node_modules/browserify": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", - "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", - "dev": true, - "dependencies": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "~0.2.0", - "buffer": "~5.2.1", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.1", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^3.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.2.1", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "mkdirp-classic": "^0.5.2", - "module-deps": "^6.2.3", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "^1.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum-object": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.12.0", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "browserify": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/browserify-zlib/node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "node_modules/buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", @@ -1230,12 +839,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", - "dev": true - }, "node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -1277,40 +880,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cache-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", - "integrity": "sha512-4gkeHlFpSKgm3vm2gJN5sPqfmijYRFYCQ6tv5cLw0xVmT6r1z1vd4FNnpuOREco3cBs1G709sZ72LdgddKvL5w==", - "dev": true, - "dependencies": { - "array-back": "^4.0.1", - "fs-then-native": "^2.0.0", - "mkdirp2": "^1.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cache-point/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cached-path-relative": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", - "dev": true - }, "node_modules/call-bind": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2", "get-intrinsic": "^1.2.1", @@ -1341,18 +916,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "dev": true, - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1413,16 +976,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -1434,19 +987,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/collect-all": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collect-all/-/collect-all-1.0.4.tgz", - "integrity": "sha512-RKZhRwJtJEP5FWul+gkSMEnaK6H3AGPTTWOiRimCcs+rc/OmQE3Yhy1Q7A7KsdkG3ZXVdZq68Y6ONSdvkeEcKA==", - "dev": true, - "dependencies": { - "stream-connect": "^1.0.2", - "stream-via": "^1.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1465,288 +1005,51 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", - "dev": true, - "dependencies": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-args/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">= 8" } }, - "node_modules/command-line-args/node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" }, - "node_modules/command-line-tool": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/command-line-tool/-/command-line-tool-0.8.0.tgz", - "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "command-line-args": "^5.0.0", - "command-line-usage": "^4.1.0", - "typical": "^2.6.1" + "ms": "2.1.2" }, "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-tool/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz", - "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", - "dev": true, - "dependencies": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "table-layout": "^0.4.2", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "node_modules/common-sequence": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz", - "integrity": "sha512-jAg09gkdkrDO9EWTdXfv80WWH3yeZl5oT69fGfedBNS9pXUKYInVJ1bJ+/ht2+Moeei48TmSbQDYMc8EOx9G0g==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/config-master": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", - "integrity": "sha512-n7LBL1zBzYdTpF1mx5DNcZnZn05CWIdsdvtPL4MosvqbBUK3Rq6VWEtGUuF3Y0s9/CIhMejezqlSkP6TnCJ/9g==", - "dev": true, - "dependencies": { - "walk-back": "^2.0.1" - } - }, - "node_modules/config-master/node_modules/walk-back": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", - "integrity": "sha512-Nb6GvBR8UWX1D+Le+xUq0+Q1kFmRBIWVrfLnQAOmcpEzA9oAxwJ9gIr36t9TWYfzvWRvuMtjHiVsJYEkXWaTAQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", - "dev": true - }, - "node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==", - "dev": true - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/cssfilter": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", - "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" - }, - "node_modules/dash-ast": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/debug/node_modules/ms": { @@ -1767,15 +1070,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1821,6 +1115,7 @@ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", @@ -1860,57 +1155,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/defined": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", - "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", - "dev": true, - "dependencies": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "bin": { - "deps-sort": "bin/cmd.js" - } - }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/detective": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", - "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", - "dev": true, - "dependencies": { - "acorn-node": "^1.8.2", - "defined": "^1.0.0", - "minimist": "^1.2.6" - }, - "bin": { - "detective": "bin/detective.js" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -1920,46 +1164,6 @@ "node": ">=0.3.1" } }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/dmd": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/dmd/-/dmd-6.2.0.tgz", - "integrity": "sha512-uXWxLF1H7TkUAuoHK59/h/ts5cKavm2LnhrIgJWisip4BVzPoXavlwyoprFFn2CzcahKYgvkfaebS6oxzgflkg==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "common-sequence": "^2.0.2", - "file-set": "^4.0.2", - "handlebars": "^4.7.7", - "marked": "^4.2.3", - "object-get": "^2.1.1", - "reduce-flatten": "^3.0.1", - "reduce-unique": "^2.0.1", - "reduce-without": "^1.0.1", - "test-value": "^3.0.0", - "walk-back": "^5.1.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1972,61 +1176,12 @@ "node": ">=6.0.0" } }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true, - "engines": { - "node": ">=0.4", - "npm": ">=1.2" - } - }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/es-abstract": { "version": "1.22.3", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", @@ -2170,15 +1325,6 @@ "node": ">=6" } }, - "node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint": { "version": "8.54.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", @@ -2609,25 +1755,6 @@ "node": ">=0.10.0" } }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "node_modules/execa": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", @@ -2691,12 +1818,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true - }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -2706,15 +1827,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/fflate": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.4.tgz", @@ -2732,28 +1844,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/file-set": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", - "integrity": "sha512-fuxEgzk4L8waGXaAkd8cMr73Pm0FxOVkn8hztzUW7BAHhOGH90viQNXbiOsnecCWmfInqU6YmAMwxRMdKETceQ==", - "dev": true, - "dependencies": { - "array-back": "^5.0.0", - "glob": "^7.1.6" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/file-set/node_modules/array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2766,27 +1856,6 @@ "node": ">=8" } }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/find-replace/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2837,19 +1906,11 @@ "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, + "peer": true, "dependencies": { "is-callable": "^1.1.3" } }, - "node_modules/fs-then-native": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz", - "integrity": "sha512-X712jAOaWXkemQCAmWeg5rOT2i+KOpWz1Z/txk/cW0qlOu2oQ9H61vc5w3X/iyuUEfq/OyaFJ78/cZAQD1/bgA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2870,25 +1931,12 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/full-icu": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/full-icu/-/full-icu-1.5.0.tgz", - "integrity": "sha512-BxB2otKUSFyvENjbI8EtQscpiPOEnhrf5V4MVpa6PjzsrLmdKKUUhulbydsfKS4ve6cGXNVRLlrOjizby/ZfDA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "yauzl": "^2.10.0" - }, - "bin": { - "full-icu": "node-full-icu.js", - "node-full-icu-path": "node-icu-data.js" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2922,12 +1970,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2942,6 +1984,7 @@ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2", "has-proto": "^1.0.1", @@ -3062,6 +2105,7 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -3069,60 +2113,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, - "node_modules/handlebars/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -3147,6 +2143,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", "dev": true, + "peer": true, "dependencies": { "get-intrinsic": "^1.2.2" }, @@ -3159,6 +2156,7 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -3171,6 +2169,7 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -3183,6 +2182,7 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, + "peer": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3193,49 +2193,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -3252,32 +2215,6 @@ "he": "bin/he" } }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", - "dev": true - }, "node_modules/human-signals": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", @@ -3293,26 +2230,6 @@ "integrity": "sha512-oyPIZGEn7sprroCgTc/LuZzr2Br+7StiwHDKLGgcNWs+S9q8Mqpm6vlb1OGDnBVEc7hfSmAWHaiHRu/nhDNRtg==", "dev": true }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/ignore": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", @@ -3363,36 +2280,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==", - "dev": true, - "dependencies": { - "source-map": "~0.5.3" - } - }, - "node_modules/insert-module-globals": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", - "dev": true, - "dependencies": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "bin": { - "insert-module-globals": "bin/cmd.js" - } - }, "node_modules/internal-slot": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", @@ -3408,22 +2295,6 @@ "node": ">= 0.4" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -3481,12 +2352,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "node_modules/is-builtin-module": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", @@ -3508,6 +2373,7 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -3520,6 +2386,7 @@ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, + "peer": true, "dependencies": { "hasown": "^2.0.0" }, @@ -3576,21 +2443,6 @@ "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3756,6 +2608,7 @@ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, + "peer": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -3818,12 +2671,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3852,102 +2699,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "dev": true, - "dependencies": { - "xmlcreate": "^2.0.4" - } - }, - "node_modules/jsdoc": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz", - "integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.20.15", - "@jsdoc/salty": "^0.2.1", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "underscore": "~1.13.2" - }, - "bin": { - "jsdoc": "jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsdoc-api": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-8.0.0.tgz", - "integrity": "sha512-Rnhor0suB1Ds1abjmFkFfKeD+kSMRN9oHMTMZoJVUrmtCGDwXty+sWMA9sa4xbe4UyxuPjhC7tavZ40mDKK6QQ==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "collect-all": "^1.0.4", - "file-set": "^4.0.2", - "fs-then-native": "^2.0.0", - "jsdoc": "^4.0.0", - "object-to-spawn-args": "^2.0.1", - "temp-path": "^1.0.0", - "walk-back": "^5.1.0" - }, - "engines": { - "node": ">=12.17" - } - }, - "node_modules/jsdoc-parse": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.0.tgz", - "integrity": "sha512-Afu1fQBEb7QHt6QWX/6eUWvYHJofB90Fjx7FuJYF7mnG9z5BkAIpms1wsnvYLytfmqpEENHs/fax9p8gvMj7dw==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "lodash.omit": "^4.5.0", - "lodash.pick": "^4.4.0", - "reduce-extract": "^1.0.0", - "sort-array": "^4.1.5", - "test-value": "^3.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/jsdoc-to-markdown": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.0.tgz", - "integrity": "sha512-2FQvYkg491+FP6s15eFlgSSWs69CvQrpbABGYBtvAvGWy/lWo8IKKToarT283w59rQFrpcjHl3YdhHCa3l7gXg==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "command-line-tool": "^0.8.0", - "config-master": "^3.1.0", - "dmd": "^6.2.0", - "jsdoc-api": "^8.0.0", - "jsdoc-parse": "^6.2.0", - "walk-back": "^5.1.0" - }, - "bin": { - "jsdoc2md": "bin/cli.js" - }, - "engines": { - "node": ">=12.17" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -3979,31 +2730,6 @@ "json5": "lib/cli.js" } }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", - "dev": true, - "engines": [ - "node >= 0.2.0" - ] - }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - }, - "bin": { - "JSONStream": "bin.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4013,25 +2739,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.9" - } - }, - "node_modules/labeled-stream-splicer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", - "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "stream-splicer": "^2.0.0" - } - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -4045,15 +2752,6 @@ "node": ">= 0.8.0" } }, - "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "dev": true, - "dependencies": { - "uc.micro": "^1.0.1" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4069,48 +2767,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, - "node_modules/lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.omit": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", - "dev": true - }, - "node_modules/lodash.padend": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", - "integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==", - "dev": true - }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -4140,61 +2802,6 @@ "node": ">=10" } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it-anchor": { - "version": "8.6.7", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", - "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", - "dev": true, - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" - } - }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", - "dev": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4223,25 +2830,6 @@ "node": ">=8.6" } }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -4254,18 +2842,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "dev": true - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4283,38 +2859,15 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, - "node_modules/mkdirp2": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mkdirp2/-/mkdirp2-1.0.5.tgz", - "integrity": "sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==", - "dev": true - }, - "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "node_modules/mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -4416,35 +2969,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/module-deps": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", - "dev": true, - "dependencies": { - "browser-resolve": "^2.0.0", - "cached-path-relative": "^1.0.2", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.2.0", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "JSONStream": "^1.0.3", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "module-deps": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4469,12 +2993,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4511,21 +3029,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-get": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", - "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", - "dev": true - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -4546,15 +3049,6 @@ "node": ">= 0.4" } }, - "node_modules/object-to-spawn-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", - "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", @@ -4682,12 +3176,6 @@ "node": ">= 0.8.0" } }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", - "dev": true - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4735,34 +3223,6 @@ "node": ">=6" } }, - "node_modules/parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", - "dev": true, - "dependencies": { - "path-platform": "~0.11.15" - } - }, - "node_modules/parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4794,38 +3254,8 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "peer": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -4881,66 +3311,6 @@ "node": ">=6.0.0" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4970,55 +3340,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5031,98 +3352,6 @@ "node": ">=8.10.0" } }, - "node_modules/reduce-extract": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reduce-extract/-/reduce-extract-1.0.0.tgz", - "integrity": "sha512-QF8vjWx3wnRSL5uFMyCjDeDc5EBMiryoT9tz94VvgjKfzecHAVnqmXAwQDcr7X4JmLc2cjkjFGCVzhMqDjgR9g==", - "dev": true, - "dependencies": { - "test-value": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-extract/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/reduce-extract/node_modules/test-value": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-1.1.0.tgz", - "integrity": "sha512-wrsbRo7qP+2Je8x8DsK8ovCGyxe3sYfQwOraIY/09A2gFXU9DYKiTF14W4ki/01AEh56kMzAmlj9CaHGDDUBJA==", - "dev": true, - "dependencies": { - "array-back": "^1.0.2", - "typical": "^2.4.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-flatten": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.1.tgz", - "integrity": "sha512-bYo+97BmUUOzg09XwfkwALt4PQH1M5L0wzKerBt6WLm3Fhdd43mMS89HiT1B9pJIqko/6lWx3OnV4J9f2Kqp5Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/reduce-unique": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", - "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/reduce-without": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-without/-/reduce-without-1.0.1.tgz", - "integrity": "sha512-zQv5y/cf85sxvdrKPlfcRzlDn/OqKFThNimYmsS3flmkioKvkUGn2Qg9cJVoQiEvdxFGLE0MQER/9fZ9sUqdxg==", - "dev": true, - "dependencies": { - "test-value": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-without/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/reduce-without/node_modules/test-value": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", - "dev": true, - "dependencies": { - "array-back": "^1.0.3", - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", @@ -5150,20 +3379,12 @@ "node": ">=0.10.0" } }, - "node_modules/requizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", - "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", - "dev": true, - "dependencies": { - "lodash": "^4.17.21" - } - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, + "peer": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -5220,16 +3441,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "node_modules/run-applescript": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", @@ -5418,12 +3629,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5448,6 +3653,7 @@ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", "dev": true, + "peer": true, "dependencies": { "define-data-property": "^1.1.1", "get-intrinsic": "^1.2.1", @@ -5473,28 +3679,6 @@ "node": ">= 0.4" } }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shasum-object": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", - "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", - "dev": true, - "dependencies": { - "fast-safe-stringify": "^2.0.7" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5516,15 +3700,6 @@ "node": ">=8" } }, - "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -5546,178 +3721,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/sort-array": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-4.1.5.tgz", - "integrity": "sha512-Ya4peoS1fgFN42RN1REk2FgdNOeLIEMKFGJvs7VTP3OklF8+kl2SkpVliZ4tk/PurWsrWRsdNdU+tgyOBkB9sA==", - "dev": true, - "dependencies": { - "array-back": "^5.0.0", - "typical": "^6.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sort-array/node_modules/array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/sort-array/node_modules/typical": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", - "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-browserify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", - "dev": true, - "dependencies": { - "inherits": "~2.0.4", - "readable-stream": "^3.5.0" - } - }, - "node_modules/stream-browserify/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", - "dev": true, - "dependencies": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-connect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-connect/-/stream-connect-1.0.2.tgz", - "integrity": "sha512-68Kl+79cE0RGKemKkhxTSg8+6AGrqBt+cbZAXevg2iJ6Y3zX4JhA/sZeGzLpxW9cXhmqAcE7KnJCisUmIUfnFQ==", - "dev": true, - "dependencies": { - "array-back": "^1.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-connect/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/stream-http": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" - } - }, - "node_modules/stream-http/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", - "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-via": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", - "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5826,15 +3829,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", - "dev": true, - "dependencies": { - "minimist": "^1.1.0" - } - }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5855,6 +3849,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "peer": true, "engines": { "node": ">= 0.4" }, @@ -5878,108 +3873,12 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "dependencies": { - "acorn-node": "^1.2.0" - } - }, - "node_modules/table-layout": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", - "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", - "dev": true, - "dependencies": { - "array-back": "^2.0.0", - "deep-extend": "~0.6.0", - "lodash.padend": "^4.6.1", - "typical": "^2.6.1", - "wordwrapjs": "^3.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/temp-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", - "integrity": "sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==", - "dev": true - }, - "node_modules/test-value": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-3.0.0.tgz", - "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", - "dev": true, - "dependencies": { - "array-back": "^2.0.0", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/test-value/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==", - "dev": true, - "dependencies": { - "process": "~0.11.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/titleize": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", @@ -6023,12 +3922,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "node_modules/tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6122,45 +4015,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true - }, - "node_modules/typical": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", - "dev": true - }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "dev": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true, - "bin": { - "umd": "bin/cli.js" - } - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -6177,28 +4031,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undeclared-identifiers": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", - "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", - "dev": true, - "dependencies": { - "acorn-node": "^1.3.0", - "dash-ast": "^1.0.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - }, - "bin": { - "undeclared-identifiers": "bin.js" - } - }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", - "dev": true - }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", @@ -6226,56 +4058,6 @@ "node": ">=6" } }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "node_modules/walk-back": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.0.tgz", - "integrity": "sha512-Uhxps5yZcVNbLEAnb+xaEEMdgTXl9qAQDzKYejG2AZ7qPwRQ81lozY9ECDbjLPNWm7YsO1IK5rsP1KoQzXAcGA==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6313,6 +4095,7 @@ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "dev": true, + "peer": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.4", @@ -6327,34 +4110,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, - "node_modules/wordwrapjs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz", - "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", - "dev": true, - "dependencies": { - "reduce-flatten": "^1.0.1", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/reduce-flatten": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz", - "integrity": "sha512-j5WfFJfc9CoXv/WbwVLHq74i/hdTUpy+iNC534LxczMRP67vJeK3V9JOdnL0N1cIRbn9mYhE2yVjvvKXDxvNXQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -6384,12 +4139,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "node_modules/xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", - "dev": true - }, "node_modules/xss": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", @@ -6405,15 +4154,6 @@ "node": ">= 0.10.0" } }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -6472,16 +4212,6 @@ "node": ">=10" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 5cfe870..6287742 100644 --- a/package.json +++ b/package.json @@ -16,25 +16,20 @@ "xss": "1.0.14" }, "devDependencies": { - "browserify": "*", "esbuild": "*", "eslint": "^8.36.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-prettier": "^5.0.1", - "full-icu": "*", - "icu4c-data": "*", - "jsdoc-to-markdown": "*", + "icu4c-data": "^0.57.2", "mocha": "*", - "prettier": "^3.1.0", - "uglify-js": "*" + "prettier": "^3.1.0" }, "scripts": { "lint": "eslint .", "test": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests", "test-dev": "NODE_ICU_DATA=./node_modules/icu4c-data/ && mocha --timeout 0 tests/driver-jpeg-2000.js", - "esbuild": "rm -rf build; mkdir build; esbuild src/main.js --bundle --global-name=daikon --platform=node --outfile=build/daikon.js; esbuild src/main.js --bundle --global-name=daikon --platform=node --minify --outfile=build/daikon-min.js", - "build": "rm -rf build; mkdir build; browserify --standalone daikon src/main.js -o build/daikon.js; uglifyjs build/daikon.js -o build/daikon-min.js", + "build": "rm -rf build; mkdir build; esbuild src/main.js --bundle --global-name=daikon --platform=node --outfile=build/daikon.js; esbuild src/main.js --bundle --global-name=daikon --platform=node --minify --outfile=build/daikon-min.js", "release": "rm release/current/*.js; cp build/*.js release/current/.", "doc": "rm -rf build; mkdir build; ./node_modules/.bin/jsdoc2md src/*.js > build/docs.md" }, From dd653f80c14a164f223b67d4df441d35a8591e92 Mon Sep 17 00:00:00 2001 From: Jens Ochsenmeier Date: Wed, 22 Nov 2023 12:10:01 +0100 Subject: [PATCH 4/5] baseline to class --- lib/jpeg-baseline.js | 972 +++++++++++++++++++++---------------------- 1 file changed, 484 insertions(+), 488 deletions(-) diff --git a/lib/jpeg-baseline.js b/lib/jpeg-baseline.js index 2b8803f..2afef29 100644 --- a/lib/jpeg-baseline.js +++ b/lib/jpeg-baseline.js @@ -22,27 +22,24 @@ // in PostScript Level 2, Technical Note #5116 // (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf) -const ColorSpace = { Unkown: 0, Grayscale: 1, AdobeRGB: 2, RGB: 3, CYMK: 4 } -export const JpegImage = (function jpegImage() { - 'use strict' - const dctZigZag = new Int32Array([ +export class JpegImage { + static ColorSpace = { Unkown: 0, Grayscale: 1, AdobeRGB: 2, RGB: 3, CYMK: 4 } + static dctZigZag = new Int32Array([ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 ]) - const dctCos1 = 4017 // cos(pi/16) - const dctSin1 = 799 // sin(pi/16) - const dctCos3 = 3406 // cos(3*pi/16) - const dctSin3 = 2276 // sin(3*pi/16) - const dctCos6 = 1567 // cos(6*pi/16) - const dctSin6 = 3784 // sin(6*pi/16) - const dctSqrt2 = 5793 // sqrt(2) - const dctSqrt1d2 = 2896 // sqrt(2) / 2 + static dctCos1 = 4017 // cos(pi/16) + static dctSin1 = 799 // sin(pi/16) + static dctCos3 = 3406 // cos(3*pi/16) + static dctSin3 = 2276 // sin(3*pi/16) + static dctCos6 = 1567 // cos(6*pi/16) + static dctSin6 = 3784 // sin(6*pi/16) + static dctSqrt2 = 5793 // sqrt(2) + static dctSqrt1d2 = 2896 // sqrt(2) / 2 - function constructor() {} - - function buildHuffmanTable(codeLengths, values) { + static buildHuffmanTable(codeLengths, values) { let k = 0 const code = [] let i @@ -78,11 +75,11 @@ export const JpegImage = (function jpegImage() { return code[0].children } - function getBlockBufferOffset(component, row, col) { + static getBlockBufferOffset(component, row, col) { return 64 * ((component.blocksPerLine + 1) * row + col) } - function decodeScan( + static decodeScan( data, offset, frame, @@ -160,7 +157,7 @@ export const JpegImage = (function jpegImage() { continue } k += r - const z = dctZigZag[k] + const z = JpegImage.dctZigZag[k] component.blockData[offset + z] = receiveAndExtend(s) k++ } @@ -197,7 +194,7 @@ export const JpegImage = (function jpegImage() { continue } k += r - const z = dctZigZag[k] + const z = JpegImage.dctZigZag[k] component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive) k++ } @@ -210,7 +207,7 @@ export const JpegImage = (function jpegImage() { const e = spectralEnd let r = 0 while (k <= e) { - const z = dctZigZag[k] + const z = JpegImage.dctZigZag[k] switch (successiveACState) { case 0: // initial state { @@ -268,14 +265,14 @@ export const JpegImage = (function jpegImage() { const mcuCol = mcu % mcusPerLine const blockRow = mcuRow * component.v + row const blockCol = mcuCol * component.h + col - const offset = getBlockBufferOffset(component, blockRow, blockCol) + const offset = JpegImage.getBlockBufferOffset(component, blockRow, blockCol) decode(component, offset) } function decodeBlock(component, decode, mcu) { const blockRow = (mcu / component.blocksPerLine) | 0 const blockCol = mcu % component.blocksPerLine - const offset = getBlockBufferOffset(component, blockRow, blockCol) + const offset = JpegImage.getBlockBufferOffset(component, blockRow, blockCol) decode(component, offset) } @@ -354,7 +351,7 @@ export const JpegImage = (function jpegImage() { // "Practical Fast 1-D DCT Algorithms with 11 Multiplications", // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { + static quantizeAndInverse(component, blockBufferOffset, p) { const qt = component.quantizationTable let v0, v1, v2, v3, v4, v5, v6, v7, t let i @@ -378,7 +375,7 @@ export const JpegImage = (function jpegImage() { p[6 + row] === 0 && p[7 + row] === 0 ) { - t = (dctSqrt2 * p[0 + row] + 512) >> 10 + t = (JpegImage.dctSqrt2 * p[0 + row] + 512) >> 10 p[0 + row] = t p[1 + row] = t p[2 + row] = t @@ -391,12 +388,12 @@ export const JpegImage = (function jpegImage() { } // stage 4 - v0 = (dctSqrt2 * p[0 + row] + 128) >> 8 - v1 = (dctSqrt2 * p[4 + row] + 128) >> 8 + v0 = (JpegImage.dctSqrt2 * p[0 + row] + 128) >> 8 + v1 = (JpegImage.dctSqrt2 * p[4 + row] + 128) >> 8 v2 = p[2 + row] v3 = p[6 + row] - v4 = (dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128) >> 8 - v7 = (dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128) >> 8 + v4 = (JpegImage.dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128) >> 8 + v7 = (JpegImage.dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128) >> 8 v5 = p[3 + row] << 4 v6 = p[5 + row] << 4 @@ -404,8 +401,8 @@ export const JpegImage = (function jpegImage() { t = (v0 - v1 + 1) >> 1 v0 = (v0 + v1 + 1) >> 1 v1 = t - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8 - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8 + t = (v2 * JpegImage.dctSin6 + v3 * JpegImage.dctCos6 + 128) >> 8 + v2 = (v2 * JpegImage.dctCos6 - v3 * JpegImage.dctSin6 + 128) >> 8 v3 = t t = (v4 - v6 + 1) >> 1 v4 = (v4 + v6 + 1) >> 1 @@ -421,11 +418,11 @@ export const JpegImage = (function jpegImage() { t = (v1 - v2 + 1) >> 1 v1 = (v1 + v2 + 1) >> 1 v2 = t - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12 - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12 + t = (v4 * JpegImage.dctSin3 + v7 * JpegImage.dctCos3 + 2048) >> 12 + v4 = (v4 * JpegImage.dctCos3 - v7 * JpegImage.dctSin3 + 2048) >> 12 v7 = t - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12 - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12 + t = (v5 * JpegImage.dctSin1 + v6 * JpegImage.dctCos1 + 2048) >> 12 + v5 = (v5 * JpegImage.dctCos1 - v6 * JpegImage.dctSin1 + 2048) >> 12 v6 = t // stage 1 @@ -453,7 +450,7 @@ export const JpegImage = (function jpegImage() { p[6 * 8 + col] === 0 && p[7 * 8 + col] === 0 ) { - t = (dctSqrt2 * p[i + 0] + 8192) >> 14 + t = (JpegImage.dctSqrt2 * p[i + 0] + 8192) >> 14 p[0 * 8 + col] = t p[1 * 8 + col] = t p[2 * 8 + col] = t @@ -466,12 +463,12 @@ export const JpegImage = (function jpegImage() { } // stage 4 - v0 = (dctSqrt2 * p[0 * 8 + col] + 2048) >> 12 - v1 = (dctSqrt2 * p[4 * 8 + col] + 2048) >> 12 + v0 = (JpegImage.dctSqrt2 * p[0 * 8 + col] + 2048) >> 12 + v1 = (JpegImage.dctSqrt2 * p[4 * 8 + col] + 2048) >> 12 v2 = p[2 * 8 + col] v3 = p[6 * 8 + col] - v4 = (dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048) >> 12 - v7 = (dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048) >> 12 + v4 = (JpegImage.dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048) >> 12 + v7 = (JpegImage.dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048) >> 12 v5 = p[3 * 8 + col] v6 = p[5 * 8 + col] @@ -479,8 +476,8 @@ export const JpegImage = (function jpegImage() { t = (v0 - v1 + 1) >> 1 v0 = (v0 + v1 + 1) >> 1 v1 = t - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12 - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12 + t = (v2 * JpegImage.dctSin6 + v3 * JpegImage.dctCos6 + 2048) >> 12 + v2 = (v2 * JpegImage.dctCos6 - v3 * JpegImage.dctSin6 + 2048) >> 12 v3 = t t = (v4 - v6 + 1) >> 1 v4 = (v4 + v6 + 1) >> 1 @@ -496,11 +493,11 @@ export const JpegImage = (function jpegImage() { t = (v1 - v2 + 1) >> 1 v1 = (v1 + v2 + 1) >> 1 v2 = t - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12 - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12 + t = (v4 * JpegImage.dctSin3 + v7 * JpegImage.dctCos3 + 2048) >> 12 + v4 = (v4 * JpegImage.dctCos3 - v7 * JpegImage.dctSin3 + 2048) >> 12 v7 = t - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12 - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12 + t = (v5 * JpegImage.dctSin1 + v6 * JpegImage.dctCos1 + 2048) >> 12 + v5 = (v5 * JpegImage.dctCos1 - v6 * JpegImage.dctSin1 + 2048) >> 12 v6 = t // stage 1 @@ -528,501 +525,500 @@ export const JpegImage = (function jpegImage() { } } - function buildComponentData(frame, component) { + static buildComponentData(frame, component) { const blocksPerLine = component.blocksPerLine const blocksPerColumn = component.blocksPerColumn const computationBuffer = new Int32Array(64) for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { - const offset = getBlockBufferOffset(component, blockRow, blockCol) - quantizeAndInverse(component, offset, computationBuffer) + const offset = JpegImage.getBlockBufferOffset(component, blockRow, blockCol) + JpegImage.quantizeAndInverse(component, offset, computationBuffer) } } return component.blockData } - function clampToUint8(a) { + static clampToUint8(a) { return a <= 0 ? 0 : a >= 255 ? 255 : a | 0 } - constructor.prototype = { - load: function load(path) { - const handleData = function (data) { - this.parse(data) - if (this.onload) this.onload() - }.bind(this) - - if (path.indexOf('data:') > -1) { - const offset = path.indexOf('base64,') + 7 - const data = atob(path.substring(offset)) - const arr = new Uint8Array(data.length) - for (let i = data.length - 1; i >= 0; i--) { - arr[i] = data.charCodeAt(i) - } - handleData(data) - } else { - const xhr = new XMLHttpRequest() - xhr.open('GET', path, true) - xhr.responseType = 'arraybuffer' - xhr.onload = function () { - // TODO catch parse error - const data = new Uint8Array(xhr.response) - handleData(data) - } - xhr.send(null) + load(path) { + const handleData = function (data) { + this.parse(data) + if (this.onload) this.onload() + }.bind(this) + + if (path.indexOf('data:') > -1) { + const offset = path.indexOf('base64,') + 7 + const data = atob(path.substring(offset)) + const arr = new Uint8Array(data.length) + for (let i = data.length - 1; i >= 0; i--) { + arr[i] = data.charCodeAt(i) } - }, - parse: function parse(data) { - function readUint16() { - const value = (data[offset] << 8) | data[offset + 1] - offset += 2 - return value + handleData(data) + } else { + const xhr = new XMLHttpRequest() + xhr.open('GET', path, true) + xhr.responseType = 'arraybuffer' + xhr.onload = function () { + // TODO catch parse error + const data = new Uint8Array(xhr.response) + handleData(data) } + xhr.send(null) + } + } - function readDataBlock() { - const length = readUint16() - const array = data.subarray(offset, offset + length - 2) - offset += array.length - return array - } + parse(data) { + function readUint16() { + const value = (data[offset] << 8) | data[offset + 1] + offset += 2 + return value + } - function prepareComponents(frame) { - const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH) - const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV) - for (let i = 0; i < frame.components.length; i++) { - const component = frame.components[i] - const blocksPerLine = Math.ceil((Math.ceil(frame.samplesPerLine / 8) * component.h) / frame.maxH) - const blocksPerColumn = Math.ceil((Math.ceil(frame.scanLines / 8) * component.v) / frame.maxV) - const blocksPerLineForMcu = mcusPerLine * component.h - const blocksPerColumnForMcu = mcusPerColumn * component.v - - const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1) - component.blockData = new Int16Array(blocksBufferSize) - component.blocksPerLine = blocksPerLine - component.blocksPerColumn = blocksPerColumn - } - frame.mcusPerLine = mcusPerLine - frame.mcusPerColumn = mcusPerColumn - } + function readDataBlock() { + const length = readUint16() + const array = data.subarray(offset, offset + length - 2) + offset += array.length + return array + } - let offset = 0 - let jfif = null - let adobe = null - let frame, resetInterval - const quantizationTables = [] - const huffmanTablesAC = [] - const huffmanTablesDC = [] - let fileMarker = readUint16() - if (fileMarker !== 0xffd8) { - // SOI (Start of Image) - throw new Error('SOI not found') + function prepareComponents(frame) { + const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH) + const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV) + for (let i = 0; i < frame.components.length; i++) { + const component = frame.components[i] + const blocksPerLine = Math.ceil((Math.ceil(frame.samplesPerLine / 8) * component.h) / frame.maxH) + const blocksPerColumn = Math.ceil((Math.ceil(frame.scanLines / 8) * component.v) / frame.maxV) + const blocksPerLineForMcu = mcusPerLine * component.h + const blocksPerColumnForMcu = mcusPerColumn * component.v + + const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1) + component.blockData = new Int16Array(blocksBufferSize) + component.blocksPerLine = blocksPerLine + component.blocksPerColumn = blocksPerColumn } + frame.mcusPerLine = mcusPerLine + frame.mcusPerColumn = mcusPerColumn + } - fileMarker = readUint16() - while (fileMarker !== 0xffd9) { - // EOI (End of image) - let i, j, l - switch (fileMarker) { - case 0xffe0: // APP0 (Application Specific) - case 0xffe1: // APP1 - case 0xffe2: // APP2 - case 0xffe3: // APP3 - case 0xffe4: // APP4 - case 0xffe5: // APP5 - case 0xffe6: // APP6 - case 0xffe7: // APP7 - case 0xffe8: // APP8 - case 0xffe9: // APP9 - case 0xffea: // APP10 - case 0xffeb: // APP11 - case 0xffec: // APP12 - case 0xffed: // APP13 - case 0xffee: // APP14 - case 0xffef: // APP15 - case 0xfffe: // COM (Comment) - { - const appData = readDataBlock() - - if (fileMarker === 0xffe0) { - if ( - appData[0] === 0x4a && - appData[1] === 0x46 && - appData[2] === 0x49 && - appData[3] === 0x46 && - appData[4] === 0 - ) { - // 'JFIF\x00' - jfif = { - version: { major: appData[5], minor: appData[6] }, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) - } - } - } - // TODO APP1 - Exif - if (fileMarker === 0xffee) { - if ( - appData[0] === 0x41 && - appData[1] === 0x64 && - appData[2] === 0x6f && - appData[3] === 0x62 && - appData[4] === 0x65 && - appData[5] === 0 - ) { - // 'Adobe\x00' - adobe = { - version: appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - } + let offset = 0 + let jfif = null + let adobe = null + let frame, resetInterval + const quantizationTables = [] + const huffmanTablesAC = [] + const huffmanTablesDC = [] + let fileMarker = readUint16() + if (fileMarker !== 0xffd8) { + // SOI (Start of Image) + throw new Error('SOI not found') + } + + fileMarker = readUint16() + while (fileMarker !== 0xffd9) { + // EOI (End of image) + let i, j, l + switch (fileMarker) { + case 0xffe0: // APP0 (Application Specific) + case 0xffe1: // APP1 + case 0xffe2: // APP2 + case 0xffe3: // APP3 + case 0xffe4: // APP4 + case 0xffe5: // APP5 + case 0xffe6: // APP6 + case 0xffe7: // APP7 + case 0xffe8: // APP8 + case 0xffe9: // APP9 + case 0xffea: // APP10 + case 0xffeb: // APP11 + case 0xffec: // APP12 + case 0xffed: // APP13 + case 0xffee: // APP14 + case 0xffef: // APP15 + case 0xfffe: // COM (Comment) + { + const appData = readDataBlock() + + if (fileMarker === 0xffe0) { + if ( + appData[0] === 0x4a && + appData[1] === 0x46 && + appData[2] === 0x49 && + appData[3] === 0x46 && + appData[4] === 0 + ) { + // 'JFIF\x00' + jfif = { + version: { major: appData[5], minor: appData[6] }, + densityUnits: appData[7], + xDensity: (appData[8] << 8) | appData[9], + yDensity: (appData[10] << 8) | appData[11], + thumbWidth: appData[12], + thumbHeight: appData[13], + thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) } } } - break - - case 0xffdb: // DQT (Define Quantization Tables) - { - const quantizationTablesLength = readUint16() - const quantizationTablesEnd = quantizationTablesLength + offset - 2 - while (offset < quantizationTablesEnd) { - const quantizationTableSpec = data[offset++] - const tableData = new Int32Array(64) - if (quantizationTableSpec >> 4 === 0) { - // 8 bit values - for (j = 0; j < 64; j++) { - const z = dctZigZag[j] - tableData[z] = data[offset++] - } - } else if (quantizationTableSpec >> 4 === 1) { - // 16 bit - for (j = 0; j < 64; j++) { - const zz = dctZigZag[j] - tableData[zz] = readUint16() - } - } else throw new Error('DQT: invalid table spec') - quantizationTables[quantizationTableSpec & 15] = tableData + // TODO APP1 - Exif + if (fileMarker === 0xffee) { + if ( + appData[0] === 0x41 && + appData[1] === 0x64 && + appData[2] === 0x6f && + appData[3] === 0x62 && + appData[4] === 0x65 && + appData[5] === 0 + ) { + // 'Adobe\x00' + adobe = { + version: appData[6], + flags0: (appData[7] << 8) | appData[8], + flags1: (appData[9] << 8) | appData[10], + transformCode: appData[11] + } } } - break + } + break - case 0xffc0: // SOF0 (Start of Frame, Baseline DCT) - case 0xffc1: // SOF1 (Start of Frame, Extended DCT) - case 0xffc2: // SOF2 (Start of Frame, Progressive DCT) - { - if (frame) { - throw new Error('Only single frame JPEGs supported') - } - readUint16() // skip data length - frame = {} - frame.extended = fileMarker === 0xffc1 - frame.progressive = fileMarker === 0xffc2 - frame.precision = data[offset++] - frame.scanLines = readUint16() - frame.samplesPerLine = readUint16() - frame.components = [] - frame.componentIds = {} - const componentsCount = data[offset++] - let componentId - let maxH = 0 - let maxV = 0 - for (i = 0; i < componentsCount; i++) { - componentId = data[offset] - const h = data[offset + 1] >> 4 - const v = data[offset + 1] & 15 - if (maxH < h) maxH = h - if (maxV < v) maxV = v - const qId = data[offset + 2] - l = frame.components.push({ - h, - v, - quantizationTable: quantizationTables[qId], - quantizationTableId: qId, - bitConversion: 255 / ((1 << frame.precision) - 1) - }) - frame.componentIds[componentId] = l - 1 - offset += 3 - } - frame.maxH = maxH - frame.maxV = maxV - prepareComponents(frame) + case 0xffdb: // DQT (Define Quantization Tables) + { + const quantizationTablesLength = readUint16() + const quantizationTablesEnd = quantizationTablesLength + offset - 2 + while (offset < quantizationTablesEnd) { + const quantizationTableSpec = data[offset++] + const tableData = new Int32Array(64) + if (quantizationTableSpec >> 4 === 0) { + // 8 bit values + for (j = 0; j < 64; j++) { + const z = JpegImage.dctZigZag[j] + tableData[z] = data[offset++] + } + } else if (quantizationTableSpec >> 4 === 1) { + // 16 bit + for (j = 0; j < 64; j++) { + const zz = JpegImage.dctZigZag[j] + tableData[zz] = readUint16() + } + } else throw new Error('DQT: invalid table spec') + quantizationTables[quantizationTableSpec & 15] = tableData } - break + } + break - case 0xffc4: // DHT (Define Huffman Tables) - { - const huffmanLength = readUint16() - for (i = 2; i < huffmanLength; ) { - const huffmanTableSpec = data[offset++] - const codeLengths = new Uint8Array(16) - let codeLengthSum = 0 - for (j = 0; j < 16; j++, offset++) codeLengthSum += codeLengths[j] = data[offset] - const huffmanValues = new Uint8Array(codeLengthSum) - for (j = 0; j < codeLengthSum; j++, offset++) huffmanValues[j] = data[offset] - i += 17 + codeLengthSum - ;(huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues) - } + case 0xffc0: // SOF0 (Start of Frame, Baseline DCT) + case 0xffc1: // SOF1 (Start of Frame, Extended DCT) + case 0xffc2: // SOF2 (Start of Frame, Progressive DCT) + { + if (frame) { + throw new Error('Only single frame JPEGs supported') } - break - - case 0xffdd: // DRI (Define Restart Interval) readUint16() // skip data length - resetInterval = readUint16() - break - - case 0xffda: // SOS (Start of Scan) - { - // unused scan length - readUint16() - - const selectorsCount = data[offset++] - const components = [] - let component - for (i = 0; i < selectorsCount; i++) { - const componentIndex = frame.componentIds[data[offset++]] - component = frame.components[componentIndex] - const tableSpec = data[offset++] - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4] - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15] - components.push(component) - } - const spectralStart = data[offset++] - const spectralEnd = data[offset++] - const successiveApproximation = data[offset++] - const processed = decodeScan( - data, - offset, - frame, - components, - resetInterval, - spectralStart, - spectralEnd, - successiveApproximation >> 4, - successiveApproximation & 15 - ) - offset += processed - } - break - default: - if (data[offset - 3] === 0xff && data[offset - 2] >= 0xc0 && data[offset - 2] <= 0xfe) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3 - break + frame = {} + frame.extended = fileMarker === 0xffc1 + frame.progressive = fileMarker === 0xffc2 + frame.precision = data[offset++] + frame.scanLines = readUint16() + frame.samplesPerLine = readUint16() + frame.components = [] + frame.componentIds = {} + const componentsCount = data[offset++] + let componentId + let maxH = 0 + let maxV = 0 + for (i = 0; i < componentsCount; i++) { + componentId = data[offset] + const h = data[offset + 1] >> 4 + const v = data[offset + 1] & 15 + if (maxH < h) maxH = h + if (maxV < v) maxV = v + const qId = data[offset + 2] + l = frame.components.push({ + h, + v, + quantizationTable: quantizationTables[qId], + quantizationTableId: qId, + bitConversion: 255 / ((1 << frame.precision) - 1) + }) + frame.componentIds[componentId] = l - 1 + offset += 3 } - throw new Error('unknown JPEG marker ' + fileMarker.toString(16)) - } - fileMarker = readUint16() - } + frame.maxH = maxH + frame.maxV = maxV + prepareComponents(frame) + } + break - this.width = frame.samplesPerLine - this.height = frame.scanLines - this.jfif = jfif - this.adobe = adobe - this.components = [] - switch (frame.components.length) { - case 1: - this.colorspace = ColorSpace.Grayscale + case 0xffc4: // DHT (Define Huffman Tables) + { + const huffmanLength = readUint16() + for (i = 2; i < huffmanLength; ) { + const huffmanTableSpec = data[offset++] + const codeLengths = new Uint8Array(16) + let codeLengthSum = 0 + for (j = 0; j < 16; j++, offset++) codeLengthSum += codeLengths[j] = data[offset] + const huffmanValues = new Uint8Array(codeLengthSum) + for (j = 0; j < codeLengthSum; j++, offset++) huffmanValues[j] = data[offset] + i += 17 + codeLengthSum + ;(huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = + JpegImage.buildHuffmanTable(codeLengths, huffmanValues) + } + } break - case 3: - if (this.adobe) this.colorspace = ColorSpace.AdobeRGB - else this.colorspace = ColorSpace.RGB + + case 0xffdd: // DRI (Define Restart Interval) + readUint16() // skip data length + resetInterval = readUint16() break - case 4: - this.colorspace = ColorSpace.CYMK + + case 0xffda: // SOS (Start of Scan) + { + // unused scan length + readUint16() + + const selectorsCount = data[offset++] + const components = [] + let component + for (i = 0; i < selectorsCount; i++) { + const componentIndex = frame.componentIds[data[offset++]] + component = frame.components[componentIndex] + const tableSpec = data[offset++] + component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4] + component.huffmanTableAC = huffmanTablesAC[tableSpec & 15] + components.push(component) + } + const spectralStart = data[offset++] + const spectralEnd = data[offset++] + const successiveApproximation = data[offset++] + const processed = JpegImage.decodeScan( + data, + offset, + frame, + components, + resetInterval, + spectralStart, + spectralEnd, + successiveApproximation >> 4, + successiveApproximation & 15 + ) + offset += processed + } break default: - this.colorspace = ColorSpace.Unknown - } - for (let i = 0; i < frame.components.length; i++) { - const component = frame.components[i] - if (!component.quantizationTable && component.quantizationTableId !== null) - component.quantizationTable = quantizationTables[component.quantizationTableId] - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn, - bitConversion: component.bitConversion - }) + if (data[offset - 3] === 0xff && data[offset - 2] >= 0xc0 && data[offset - 2] <= 0xfe) { + // could be incorrect encoding -- last 0xFF byte of the previous + // block was eaten by the encoder + offset -= 3 + break + } + throw new Error('unknown JPEG marker ' + fileMarker.toString(16)) } - }, - getData16: function getData16(width, height) { - if (this.components.length !== 1) throw new Error('Unsupported color mode') - const scaleX = this.width / width - const scaleY = this.height / height - - let component, componentScaleX, componentScaleY - let x, y, i - let offset = 0 - const numComponents = this.components.length - const dataLength = width * height * numComponents - const data = new Uint16Array(dataLength) - - // lineData is reused for all components. Assume first component is - // the biggest - const lineData = new Uint16Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) - - // First construct image data ... - for (i = 0; i < numComponents; i++) { - component = this.components[i] - const blocksPerLine = component.blocksPerLine - const blocksPerColumn = component.blocksPerColumn - const samplesPerLine = blocksPerLine << 3 - - for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - const scanLine = blockRow << 3 - for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { - const bufferOffset = getBlockBufferOffset(component, blockRow, blockCol) - offset = 0 - const sample = blockCol << 3 - for (let j = 0; j < 8; j++) { - const lineOffset = (scanLine + j) * samplesPerLine - for (let k = 0; k < 8; k++) { - lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] - } + fileMarker = readUint16() + } + + this.width = frame.samplesPerLine + this.height = frame.scanLines + this.jfif = jfif + this.adobe = adobe + this.components = [] + switch (frame.components.length) { + case 1: + this.colorspace = JpegImage.ColorSpace.Grayscale + break + case 3: + if (this.adobe) this.colorspace = JpegImage.ColorSpace.AdobeRGB + else this.colorspace = JpegImage.ColorSpace.RGB + break + case 4: + this.colorspace = JpegImage.ColorSpace.CYMK + break + default: + this.colorspace = JpegImage.ColorSpace.Unknown + } + for (let i = 0; i < frame.components.length; i++) { + const component = frame.components[i] + if (!component.quantizationTable && component.quantizationTableId !== null) + component.quantizationTable = quantizationTables[component.quantizationTableId] + this.components.push({ + output: JpegImage.buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV, + blocksPerLine: component.blocksPerLine, + blocksPerColumn: component.blocksPerColumn, + bitConversion: component.bitConversion + }) + } + } + + getData16(width, height) { + if (this.components.length !== 1) throw new Error('Unsupported color mode') + const scaleX = this.width / width + const scaleY = this.height / height + + let component, componentScaleX, componentScaleY + let x, y, i + let offset = 0 + const numComponents = this.components.length + const dataLength = width * height * numComponents + const data = new Uint16Array(dataLength) + + // lineData is reused for all components. Assume first component is + // the biggest + const lineData = new Uint16Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) + + // First construct image data ... + for (i = 0; i < numComponents; i++) { + component = this.components[i] + const blocksPerLine = component.blocksPerLine + const blocksPerColumn = component.blocksPerColumn + const samplesPerLine = blocksPerLine << 3 + + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + const scanLine = blockRow << 3 + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const bufferOffset = JpegImage.getBlockBufferOffset(component, blockRow, blockCol) + offset = 0 + const sample = blockCol << 3 + for (let j = 0; j < 8; j++) { + const lineOffset = (scanLine + j) * samplesPerLine + for (let k = 0; k < 8; k++) { + lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] } } } + } - componentScaleX = component.scaleX * scaleX - componentScaleY = component.scaleY * scaleY - offset = i - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - const cy = 0 | (y * componentScaleY) - const cx = 0 | (x * componentScaleX) - const index = cy * samplesPerLine + cx - data[offset] = lineData[index] - offset += numComponents - } + componentScaleX = component.scaleX * scaleX + componentScaleY = component.scaleY * scaleY + offset = i + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + const cy = 0 | (y * componentScaleY) + const cx = 0 | (x * componentScaleX) + const index = cy * samplesPerLine + cx + data[offset] = lineData[index] + offset += numComponents } } - return data - }, - getData: function getData(width, height) { - const scaleX = this.width / width - const scaleY = this.height / height - - let component, componentScaleX, componentScaleY - let x, y, i - let offset = 0 - let Y, Cb, Cr, C, M, R, G, B - let colorTransform - const numComponents = this.components.length - const dataLength = width * height * numComponents - const data = new Uint8Array(dataLength) - - // lineData is reused for all components. Assume first component is - // the biggest - const lineData = new Uint8Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) - - // First construct image data ... - for (i = 0; i < numComponents; i++) { - component = this.components[i] - const blocksPerLine = component.blocksPerLine - const blocksPerColumn = component.blocksPerColumn - const samplesPerLine = blocksPerLine << 3 - - for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - const scanLine = blockRow << 3 - for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { - const bufferOffset = getBlockBufferOffset(component, blockRow, blockCol) - let offset = 0 - const sample = blockCol << 3 - for (let j = 0; j < 8; j++) { - const lineOffset = (scanLine + j) * samplesPerLine - for (let k = 0; k < 8; k++) { - lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] * component.bitConversion - } + } + return data + } + + getData(width, height) { + const scaleX = this.width / width + const scaleY = this.height / height + + let component, componentScaleX, componentScaleY + let x, y, i + let offset = 0 + let Y, Cb, Cr, C, M, R, G, B + let colorTransform + const numComponents = this.components.length + const dataLength = width * height * numComponents + const data = new Uint8Array(dataLength) + + // lineData is reused for all components. Assume first component is + // the biggest + const lineData = new Uint8Array((this.components[0].blocksPerLine << 3) * this.components[0].blocksPerColumn * 8) + + // First construct image data ... + for (i = 0; i < numComponents; i++) { + component = this.components[i] + const blocksPerLine = component.blocksPerLine + const blocksPerColumn = component.blocksPerColumn + const samplesPerLine = blocksPerLine << 3 + + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + const scanLine = blockRow << 3 + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const bufferOffset = JpegImage.getBlockBufferOffset(component, blockRow, blockCol) + let offset = 0 + const sample = blockCol << 3 + for (let j = 0; j < 8; j++) { + const lineOffset = (scanLine + j) * samplesPerLine + for (let k = 0; k < 8; k++) { + lineData[lineOffset + sample + k] = component.output[bufferOffset + offset++] * component.bitConversion } } } + } - componentScaleX = component.scaleX * scaleX - componentScaleY = component.scaleY * scaleY - offset = i - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - const cy = 0 | (y * componentScaleY) - const cx = 0 | (x * componentScaleX) - const index = cy * samplesPerLine + cx - data[offset] = lineData[index] - offset += numComponents - } + componentScaleX = component.scaleX * scaleX + componentScaleY = component.scaleY * scaleY + offset = i + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + const cy = 0 | (y * componentScaleY) + const cx = 0 | (x * componentScaleX) + const index = cy * samplesPerLine + cx + data[offset] = lineData[index] + offset += numComponents } } + } - // ... then transform colors, if necessary - switch (numComponents) { - case 1: - case 2: - break - // no color conversion for one or two compoenents - - case 3: - // The default transform for three components is true - colorTransform = true - // The adobe transform marker overrides any previous setting - if (this.adobe && this.adobe.transformCode) colorTransform = true - else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform - - if (colorTransform) { - for (i = 0; i < dataLength; i += numComponents) { - Y = data[i] - Cb = data[i + 1] - Cr = data[i + 2] - - R = clampToUint8(Y - 179.456 + 1.402 * Cr) - G = clampToUint8(Y + 135.459 - 0.344 * Cb - 0.714 * Cr) - B = clampToUint8(Y - 226.816 + 1.772 * Cb) - - data[i] = R - data[i + 1] = G - data[i + 2] = B - } + // ... then transform colors, if necessary + switch (numComponents) { + case 1: + case 2: + break + // no color conversion for one or two compoenents + + case 3: + // The default transform for three components is true + colorTransform = true + // The adobe transform marker overrides any previous setting + if (this.adobe && this.adobe.transformCode) colorTransform = true + else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform + + if (colorTransform) { + for (i = 0; i < dataLength; i += numComponents) { + Y = data[i] + Cb = data[i + 1] + Cr = data[i + 2] + + R = JpegImage.clampToUint8(Y - 179.456 + 1.402 * Cr) + G = JpegImage.clampToUint8(Y + 135.459 - 0.344 * Cb - 0.714 * Cr) + B = JpegImage.clampToUint8(Y - 226.816 + 1.772 * Cb) + + data[i] = R + data[i + 1] = G + data[i + 2] = B } - break - case 4: - if (!this.adobe) throw new Error('Unsupported color mode (4 components)') - // The default transform for four components is false - colorTransform = false - // The adobe transform marker overrides any previous setting - if (this.adobe && this.adobe.transformCode) colorTransform = true - else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform - - if (colorTransform) { - for (i = 0; i < dataLength; i += numComponents) { - Y = data[i] - Cb = data[i + 1] - Cr = data[i + 2] - - C = clampToUint8(434.456 - Y - 1.402 * Cr) - M = clampToUint8(119.541 - Y + 0.344 * Cb + 0.714 * Cr) - Y = clampToUint8(481.816 - Y - 1.772 * Cb) - - data[i] = C - data[i + 1] = M - data[i + 2] = Y - // K is unchanged - } + } + break + case 4: + if (!this.adobe) throw new Error('Unsupported color mode (4 components)') + // The default transform for four components is false + colorTransform = false + // The adobe transform marker overrides any previous setting + if (this.adobe && this.adobe.transformCode) colorTransform = true + else if (typeof this.colorTransform !== 'undefined') colorTransform = !!this.colorTransform + + if (colorTransform) { + for (i = 0; i < dataLength; i += numComponents) { + Y = data[i] + Cb = data[i + 1] + Cr = data[i + 2] + + C = JpegImage.clampToUint8(434.456 - Y - 1.402 * Cr) + M = JpegImage.clampToUint8(119.541 - Y + 0.344 * Cb + 0.714 * Cr) + Y = JpegImage.clampToUint8(481.816 - Y - 1.772 * Cb) + + data[i] = C + data[i + 1] = M + data[i + 2] = Y + // K is unchanged } - break - default: - throw new Error('Unsupported color mode') - } - return data + } + break + default: + throw new Error('Unsupported color mode') } + return data } - - return constructor -})() +} From 0b2a99f37e7e54c90685532a6387947eea31f89e Mon Sep 17 00:00:00 2001 From: Jens Ochsenmeier Date: Wed, 22 Nov 2023 12:12:28 +0100 Subject: [PATCH 5/5] simplify jpeg-ls --- lib/jpeg-ls.js | 190 +++++++++++++++++++++++-------------------------- src/image.js | 8 +-- 2 files changed, 92 insertions(+), 106 deletions(-) diff --git a/lib/jpeg-ls.js b/lib/jpeg-ls.js index 001c8e9..463af4b 100644 --- a/lib/jpeg-ls.js +++ b/lib/jpeg-ls.js @@ -25,112 +25,100 @@ import charLS from 'CharLS.js' -export const JpegLS = (function () { - function constructor() {} - - constructor.prototype = { - decodeJPEGLS: function (pixelData, signed) { - return decodeJPEGLS(pixelData, signed) - } +function jpegLSDecode(data, isSigned) { + // prepare input parameters + const dataPtr = charLS._malloc(data.length) + charLS.writeArrayToMemory(data, dataPtr) + + // prepare output parameters + const imagePtrPtr = charLS._malloc(4) + const imageSizePtr = charLS._malloc(4) + const widthPtr = charLS._malloc(4) + const heightPtr = charLS._malloc(4) + const bitsPerSamplePtr = charLS._malloc(4) + const stridePtr = charLS._malloc(4) + const allowedLossyErrorPtr = charLS._malloc(4) + const componentsPtr = charLS._malloc(4) + const interleaveModePtr = charLS._malloc(4) + + // Decode the image + const result = charLS.ccall( + 'jpegls_decode', + 'number', + ['number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'], + [ + dataPtr, + data.length, + imagePtrPtr, + imageSizePtr, + widthPtr, + heightPtr, + bitsPerSamplePtr, + stridePtr, + componentsPtr, + allowedLossyErrorPtr, + interleaveModePtr + ] + ) + + // Extract result values into object + const image = { + result, + width: charLS.getValue(widthPtr, 'i32'), + height: charLS.getValue(heightPtr, 'i32'), + bitsPerSample: charLS.getValue(bitsPerSamplePtr, 'i32'), + stride: charLS.getValue(stridePtr, 'i32'), + components: charLS.getValue(componentsPtr, 'i32'), + allowedLossyError: charLS.getValue(allowedLossyErrorPtr, 'i32'), + interleaveMode: charLS.getValue(interleaveModePtr, 'i32'), + pixelData: undefined } - function jpegLSDecode(data, isSigned) { - // prepare input parameters - const dataPtr = charLS._malloc(data.length) - charLS.writeArrayToMemory(data, dataPtr) - - // prepare output parameters - const imagePtrPtr = charLS._malloc(4) - const imageSizePtr = charLS._malloc(4) - const widthPtr = charLS._malloc(4) - const heightPtr = charLS._malloc(4) - const bitsPerSamplePtr = charLS._malloc(4) - const stridePtr = charLS._malloc(4) - const allowedLossyErrorPtr = charLS._malloc(4) - const componentsPtr = charLS._malloc(4) - const interleaveModePtr = charLS._malloc(4) - - // Decode the image - const result = charLS.ccall( - 'jpegls_decode', - 'number', - ['number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'], - [ - dataPtr, - data.length, - imagePtrPtr, - imageSizePtr, - widthPtr, - heightPtr, - bitsPerSamplePtr, - stridePtr, - componentsPtr, - allowedLossyErrorPtr, - interleaveModePtr - ] - ) - - // Extract result values into object - const image = { - result, - width: charLS.getValue(widthPtr, 'i32'), - height: charLS.getValue(heightPtr, 'i32'), - bitsPerSample: charLS.getValue(bitsPerSamplePtr, 'i32'), - stride: charLS.getValue(stridePtr, 'i32'), - components: charLS.getValue(componentsPtr, 'i32'), - allowedLossyError: charLS.getValue(allowedLossyErrorPtr, 'i32'), - interleaveMode: charLS.getValue(interleaveModePtr, 'i32'), - pixelData: undefined - } - - // Copy image from emscripten heap into appropriate array buffer type - const imagePtr = charLS.getValue(imagePtrPtr, '*') - if (image.bitsPerSample <= 8) { - image.pixelData = new Uint8Array(image.width * image.height * image.components) - image.pixelData.set(new Uint8Array(charLS.HEAP8.buffer, imagePtr, image.pixelData.length)) + // Copy image from emscripten heap into appropriate array buffer type + const imagePtr = charLS.getValue(imagePtrPtr, '*') + if (image.bitsPerSample <= 8) { + image.pixelData = new Uint8Array(image.width * image.height * image.components) + image.pixelData.set(new Uint8Array(charLS.HEAP8.buffer, imagePtr, image.pixelData.length)) + } else { + // I have seen 16 bit signed images, but I don't know if 16 bit unsigned is valid, hoping to get + // answer here: + // https://github.com/team-charls/charls/issues/14 + if (isSigned) { + image.pixelData = new Int16Array(image.width * image.height * image.components) + image.pixelData.set(new Int16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) } else { - // I have seen 16 bit signed images, but I don't know if 16 bit unsigned is valid, hoping to get - // answer here: - // https://github.com/team-charls/charls/issues/14 - if (isSigned) { - image.pixelData = new Int16Array(image.width * image.height * image.components) - image.pixelData.set(new Int16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) - } else { - image.pixelData = new Uint16Array(image.width * image.height * image.components) - image.pixelData.set(new Uint16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) - } + image.pixelData = new Uint16Array(image.width * image.height * image.components) + image.pixelData.set(new Uint16Array(charLS.HEAP16.buffer, imagePtr, image.pixelData.length)) } - - // free memory and return image object - charLS._free(dataPtr) - charLS._free(imagePtr) - charLS._free(imagePtrPtr) - charLS._free(imageSizePtr) - charLS._free(widthPtr) - charLS._free(heightPtr) - charLS._free(bitsPerSamplePtr) - charLS._free(stridePtr) - charLS._free(componentsPtr) - charLS._free(interleaveModePtr) - - return image } - function decodeJPEGLS(pixelData, signed) { - const image = jpegLSDecode(pixelData, signed) - - // throw error if not success or too much data - if (image.result !== 0 && image.result !== 6) { - throw new Error('JPEG-LS decoder failed to decode frame (error code ' + image.result + ')') - } - - const imageFrame = {} - imageFrame.columns = image.width - imageFrame.rows = image.height - imageFrame.pixelData = image.pixelData - - return imageFrame + // free memory and return image object + charLS._free(dataPtr) + charLS._free(imagePtr) + charLS._free(imagePtrPtr) + charLS._free(imageSizePtr) + charLS._free(widthPtr) + charLS._free(heightPtr) + charLS._free(bitsPerSamplePtr) + charLS._free(stridePtr) + charLS._free(componentsPtr) + charLS._free(interleaveModePtr) + + return image +} + +export function decodeJPEGLS(pixelData, signed) { + const image = jpegLSDecode(pixelData, signed) + + // throw error if not success or too much data + if (image.result !== 0 && image.result !== 6) { + throw new Error('JPEG-LS decoder failed to decode frame (error code ' + image.result + ')') } - return constructor -})() + const imageFrame = {} + imageFrame.columns = image.width + imageFrame.rows = image.height + imageFrame.pixelData = image.pixelData + + return imageFrame +} diff --git a/src/image.js b/src/image.js index 9b89cea..6c56f2a 100644 --- a/src/image.js +++ b/src/image.js @@ -1,7 +1,7 @@ import jpeg from 'jpeg-lossless-decoder-js' import { JpxImage } from 'jpeg2000' import { JpegImage } from '../lib/jpeg-baseline.js' -import { JpegLS } from '../lib/jpeg-ls.js' +import { decodeJPEGLS } from '../lib/jpeg-ls.js' import { Tag } from './tag.js' import { MAX_VALUE, MIN_VALUE, concatArrayBuffers2, createBitMask, fillBuffer } from './utilities.js' @@ -655,8 +655,7 @@ export class Image { decoder.parse(new Uint8Array(jpg)) return decoder.tiles[0].items } else if (this.isCompressedJPEGLS()) { - const decoder = new JpegLS() - return decoder.decodeJPEGLS(new Uint8Array(jpg), this.getDataType() === Image.BYTE_TYPE_INTEGER) + return decodeJPEGLS(new Uint8Array(jpg), this.getDataType() === Image.BYTE_TYPE_INTEGER) } } @@ -749,8 +748,7 @@ export class Image { jpegs = this.getJpegs() for (let ctr = 0; ctr < jpegs.length; ctr += 1) { - decoder = new JpegLS() - decoded = decoder.decodeJPEGLS(new Uint8Array(jpegs[ctr]), this.getDataType() === Image.BYTE_TYPE_INTEGER) + decoded = decodeJPEGLS(new Uint8Array(jpegs[ctr]), this.getDataType() === Image.BYTE_TYPE_INTEGER) width = decoded.columns height = decoded.rows decoded = decoded.pixelData